From: support
Date: Tue, 28 Feb 2023 10:33:57 +0000 (+0000)
Subject: Built motion from commit 8c034dcd.|2.6.31
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22?a=commitdiff_plain;h=07c2caee3531dd9c638c01fdbc5813c41eb44f84;p=motion2.git
Built motion from commit 8c034dcd.|2.6.31
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index c20ec34..602bed5 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -1,6 +1,6 @@
define({
"name": "xCALLY Motion API",
- "version": "2.6.30",
+ "version": "2.6.31",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-02-23T15:26:20.737Z",
+ "time": "2023-02-28T10:24:57.355Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index fbdc98a..e340764 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -1,6 +1,6 @@
{
"name": "xCALLY Motion API",
- "version": "2.6.30",
+ "version": "2.6.31",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-02-23T15:26:20.737Z",
+ "time": "2023-02-28T10:24:57.355Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 79d1d28..b5730ae 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.30",
+ "version": "2.6.31",
"dependencies": {
"@babel/code-frame": {
"version": "7.18.6",
diff --git a/package.json b/package.json
index 98d3c67..5e87c80 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.30",
+ "version": "2.6.31",
"description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.",
"main": "server/app.js",
"engines": {
diff --git a/server/Release_scripts.md b/server/Release_scripts.md
new file mode 100644
index 0000000..19bfca0
--- /dev/null
+++ b/server/Release_scripts.md
@@ -0,0 +1,17 @@
+# Release scripts
+
+## Tag master
+```bash
+git checkout master
+git pull origin master
+git tag -a 2.6.30 -m "Versione 2.6.30"
+git push origin --tags
+```
+
+## Merge master to develop
+```bash
+git checkout develop
+git pull origin master
+git push origin develop
+```
+
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 80efc21..86d0220 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 _0xf3b0=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','action','contactManager','integration','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0xf3b0,0x15d));var _0x0f3b=function(_0x285800,_0x26765e){_0x285800=_0x285800-0x0;var _0x4b809e=_0xf3b0[_0x285800];return _0x4b809e;};'use strict';var Sequelize=require('sequelize');module[_0x0f3b('0x0')]={'name':{'type':Sequelize[_0x0f3b('0x1')],'get':function(_0xfecf96){return this['getDataValue'](_0x0f3b('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x0f3b('0x3'),_0x0f3b('0x4'),'motionbar',_0x0f3b('0x5'),_0x0f3b('0x6'),_0x0f3b('0x7'),'bot',_0x0f3b('0x8')]],'msg':_0x0f3b('0x9')}},'comment':_0x0f3b('0x9')},'data1':{'type':Sequelize[_0x0f3b('0xa')](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[_0x0f3b('0xa')](0x1000),'comment':_0x0f3b('0xb')},'data3':{'type':Sequelize[_0x0f3b('0xa')](0x1000),'comment':_0x0f3b('0xc')},'data4':{'type':Sequelize[_0x0f3b('0xa')](0x1000),'comments':_0x0f3b('0xd')},'data5':{'type':Sequelize[_0x0f3b('0xa')](0x1000),'comments':_0x0f3b('0xe')},'data6':{'type':Sequelize['STRING'],'comments':_0x0f3b('0xf')},'data7':{'type':Sequelize[_0x0f3b('0x10')],'comments':_0x0f3b('0x11')}};
\ No newline at end of file
+var _0xb681=['exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','TEXT','urlForward[body]','sequelize'];(function(_0xe534e,_0x4aac7d){var _0xf0827a=function(_0x86039b){while(--_0x86039b){_0xe534e['push'](_0xe534e['shift']());}};_0xf0827a(++_0x4aac7d);}(_0xb681,0x153));var _0x1b68=function(_0x2565d1,_0x31077c){_0x2565d1=_0x2565d1-0x0;var _0x54a1fc=_0xb681[_0x2565d1];return _0x54a1fc;};'use strict';var Sequelize=require(_0x1b68('0x0'));module[_0x1b68('0x1')]={'name':{'type':Sequelize[_0x1b68('0x2')],'get':function(_0x1adca9){return this[_0x1b68('0x3')](_0x1b68('0x4'));}},'action':{'type':Sequelize[_0x1b68('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1b68('0x6'),_0x1b68('0x7'),_0x1b68('0x8'),'jscripty',_0x1b68('0x9'),'browser',_0x1b68('0xa'),_0x1b68('0xb')]],'msg':_0x1b68('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x1b68('0x5')](0x1000),'comment':_0x1b68('0xd')},'data4':{'type':Sequelize[_0x1b68('0x5')](0x1000),'comments':_0x1b68('0xe')},'data5':{'type':Sequelize[_0x1b68('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x1b68('0x5')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x1b68('0xf')],'comments':_0x1b68('0x10')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 3e03087..2d881fb 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 _0xdcd4=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','name','body','Action','find','params','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0xdcd4,0x1b3));var _0x4dcd=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xdcd4[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x4dcd('0x0'));var rimraf=require(_0x4dcd('0x1'));var zipdir=require(_0x4dcd('0x2'));var jsonpatch=require(_0x4dcd('0x3'));var rp=require(_0x4dcd('0x4'));var moment=require('moment');var BPromise=require(_0x4dcd('0x5'));var Mustache=require(_0x4dcd('0x6'));var util=require(_0x4dcd('0x7'));var path=require(_0x4dcd('0x8'));var sox=require(_0x4dcd('0x9'));var csv=require('to-csv');var ejs=require(_0x4dcd('0xa'));var fs=require('fs');var fs_extra=require(_0x4dcd('0xb'));var _=require(_0x4dcd('0xc'));var squel=require(_0x4dcd('0xd'));var crypto=require(_0x4dcd('0xe'));var jsforce=require(_0x4dcd('0xf'));var deskjs=require(_0x4dcd('0x10'));var toCsv=require(_0x4dcd('0x11'));var querystring=require(_0x4dcd('0x12'));var Papa=require(_0x4dcd('0x13'));var Redis=require(_0x4dcd('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x4dcd('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4dcd('0x16'));var logger=require(_0x4dcd('0x17'))(_0x4dcd('0x18'));var utils=require(_0x4dcd('0x19'));var config=require(_0x4dcd('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x4dcd('0x1b'))['db'];function respondWithStatusCode(_0x4b5944,_0x246c2a){_0x246c2a=_0x246c2a||0xcc;return function(_0x3b4c93){if(_0x3b4c93){return _0x4b5944[_0x4dcd('0x1c')](_0x246c2a);}return _0x4b5944[_0x4dcd('0x1d')](_0x246c2a)[_0x4dcd('0x1e')]();};}function respondWithResult(_0x1e2aa9,_0x30a1ec){_0x30a1ec=_0x30a1ec||0xc8;return function(_0xc50e6c){if(_0xc50e6c){return _0x1e2aa9[_0x4dcd('0x1d')](_0x30a1ec)[_0x4dcd('0x1f')](_0xc50e6c);}};}function respondWithFilteredResult(_0x1ef4be,_0x5a7f76){return function(_0x362b68){if(_0x362b68){var _0x5f129f=typeof _0x5a7f76[_0x4dcd('0x20')]==='undefined'&&typeof _0x5a7f76[_0x4dcd('0x21')]===_0x4dcd('0x22');var _0x58cd42=_0x362b68['count'];var _0x4764b9=_0x5f129f?0x0:_0x5a7f76[_0x4dcd('0x20')];var _0x548b2b=_0x5f129f?_0x362b68[_0x4dcd('0x23')]:_0x5a7f76[_0x4dcd('0x20')]+_0x5a7f76[_0x4dcd('0x21')];var _0x1f991b;if(_0x548b2b>=_0x58cd42){_0x548b2b=_0x58cd42;_0x1f991b=0xc8;}else{_0x1f991b=0xce;}_0x1ef4be[_0x4dcd('0x1d')](_0x1f991b);return _0x1ef4be[_0x4dcd('0x24')]('Content-Range',_0x4764b9+'-'+_0x548b2b+'/'+_0x58cd42)['json'](_0x362b68);}return null;};}function patchUpdates(_0x21bd1f){return function(_0x127045){try{jsonpatch[_0x4dcd('0x25')](_0x127045,_0x21bd1f,!![]);}catch(_0x4d0f5b){return BPromise[_0x4dcd('0x26')](_0x4d0f5b);}return _0x127045[_0x4dcd('0x27')]();};}function saveUpdates(_0x31cdbb,_0x3edebf){return function(_0xaafeba){if(_0xaafeba){return _0xaafeba[_0x4dcd('0x28')](_0x31cdbb)[_0x4dcd('0x29')](function(_0x112f68){return _0x112f68;});}return null;};}function removeEntity(_0x421e60,_0x496be7){return function(_0x18fce6){if(_0x18fce6){return _0x18fce6['destroy']()['then'](function(){_0x421e60[_0x4dcd('0x1d')](0xcc)[_0x4dcd('0x1e')]();});}};}function handleEntityNotFound(_0x13c105,_0x13de99){return function(_0x47b3b1){if(!_0x47b3b1){_0x13c105[_0x4dcd('0x1c')](0x194);}return _0x47b3b1;};}function handleError(_0x1c83a1,_0x1d91b3){_0x1d91b3=_0x1d91b3||0x1f4;return function(_0x2cd4e8){logger[_0x4dcd('0x2a')](_0x2cd4e8['stack']);if(_0x2cd4e8[_0x4dcd('0x2b')]){delete _0x2cd4e8[_0x4dcd('0x2b')];}_0x1c83a1[_0x4dcd('0x1d')](_0x1d91b3)['send'](_0x2cd4e8);};}exports[_0x4dcd('0x28')]=function(_0x1b4f5b,_0x33f582){if(_0x1b4f5b[_0x4dcd('0x2c')]['id']){delete _0x1b4f5b[_0x4dcd('0x2c')]['id'];}return db[_0x4dcd('0x2d')][_0x4dcd('0x2e')]({'where':{'id':_0x1b4f5b[_0x4dcd('0x2f')]['id']}})[_0x4dcd('0x29')](handleEntityNotFound(_0x33f582,null))[_0x4dcd('0x29')](saveUpdates(_0x1b4f5b[_0x4dcd('0x2c')],null))[_0x4dcd('0x29')](respondWithResult(_0x33f582,null))[_0x4dcd('0x30')](handleError(_0x33f582,null));};exports[_0x4dcd('0x31')]=function(_0x4dc0ab,_0x27d3f3){return db[_0x4dcd('0x2d')]['find']({'where':{'id':_0x4dc0ab[_0x4dcd('0x2f')]['id']}})[_0x4dcd('0x29')](handleEntityNotFound(_0x27d3f3,null))[_0x4dcd('0x29')](removeEntity(_0x27d3f3,null))[_0x4dcd('0x30')](handleError(_0x27d3f3,null));};
\ No newline at end of file
+var _0xb547=['params','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','then','destroy','sendStatus','error','name','send','update','Action','find'];(function(_0x41bdd4,_0x3d5c76){var _0x5c03a6=function(_0x59634a){while(--_0x59634a){_0x41bdd4['push'](_0x41bdd4['shift']());}};_0x5c03a6(++_0x3d5c76);}(_0xb547,0x1a1));var _0x7b54=function(_0x1ea6eb,_0x33d3d4){_0x1ea6eb=_0x1ea6eb-0x0;var _0x127200=_0xb547[_0x1ea6eb];return _0x127200;};'use strict';var emlformat=require(_0x7b54('0x0'));var rimraf=require(_0x7b54('0x1'));var zipdir=require(_0x7b54('0x2'));var jsonpatch=require(_0x7b54('0x3'));var rp=require('request-promise');var moment=require(_0x7b54('0x4'));var BPromise=require(_0x7b54('0x5'));var Mustache=require('mustache');var util=require(_0x7b54('0x6'));var path=require(_0x7b54('0x7'));var sox=require(_0x7b54('0x8'));var csv=require(_0x7b54('0x9'));var ejs=require(_0x7b54('0xa'));var fs=require('fs');var fs_extra=require(_0x7b54('0xb'));var _=require('lodash');var squel=require(_0x7b54('0xc'));var crypto=require('crypto');var jsforce=require(_0x7b54('0xd'));var deskjs=require(_0x7b54('0xe'));var toCsv=require(_0x7b54('0x9'));var querystring=require('querystring');var Papa=require(_0x7b54('0xf'));var Redis=require(_0x7b54('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7b54('0x11'));var as=require(_0x7b54('0x12'));var hardwareService=require(_0x7b54('0x13'));var logger=require(_0x7b54('0x14'))('api');var utils=require(_0x7b54('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7b54('0x16'));var db=require(_0x7b54('0x17'))['db'];function respondWithStatusCode(_0xb42eb8,_0x58165d){_0x58165d=_0x58165d||0xcc;return function(_0x1f3cf6){if(_0x1f3cf6){return _0xb42eb8['sendStatus'](_0x58165d);}return _0xb42eb8[_0x7b54('0x18')](_0x58165d)['end']();};}function respondWithResult(_0x73c549,_0x5db416){_0x5db416=_0x5db416||0xc8;return function(_0xce6a86){if(_0xce6a86){return _0x73c549[_0x7b54('0x18')](_0x5db416)['json'](_0xce6a86);}};}function respondWithFilteredResult(_0x33e068,_0x2c9a57){return function(_0x5b5734){if(_0x5b5734){var _0x1d4f74=typeof _0x2c9a57['offset']==='undefined'&&typeof _0x2c9a57[_0x7b54('0x19')]===_0x7b54('0x1a');var _0x32a042=_0x5b5734[_0x7b54('0x1b')];var _0x34fec7=_0x1d4f74?0x0:_0x2c9a57[_0x7b54('0x1c')];var _0x54c197=_0x1d4f74?_0x5b5734['count']:_0x2c9a57[_0x7b54('0x1c')]+_0x2c9a57[_0x7b54('0x19')];var _0x474444;if(_0x54c197>=_0x32a042){_0x54c197=_0x32a042;_0x474444=0xc8;}else{_0x474444=0xce;}_0x33e068[_0x7b54('0x18')](_0x474444);return _0x33e068[_0x7b54('0x1d')](_0x7b54('0x1e'),_0x34fec7+'-'+_0x54c197+'/'+_0x32a042)[_0x7b54('0x1f')](_0x5b5734);}return null;};}function patchUpdates(_0x2c69f3){return function(_0x170656){try{jsonpatch[_0x7b54('0x20')](_0x170656,_0x2c69f3,!![]);}catch(_0x4eec14){return BPromise[_0x7b54('0x21')](_0x4eec14);}return _0x170656['save']();};}function saveUpdates(_0x2f0297,_0x592f4b){return function(_0x550148){if(_0x550148){return _0x550148['update'](_0x2f0297)[_0x7b54('0x22')](function(_0x2a8068){return _0x2a8068;});}return null;};}function removeEntity(_0x318cf9,_0x1257a7){return function(_0x45f594){if(_0x45f594){return _0x45f594[_0x7b54('0x23')]()['then'](function(){_0x318cf9[_0x7b54('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1516df,_0x2e596a){return function(_0x4e1576){if(!_0x4e1576){_0x1516df[_0x7b54('0x24')](0x194);}return _0x4e1576;};}function handleError(_0x1b0295,_0x3e7ab7){_0x3e7ab7=_0x3e7ab7||0x1f4;return function(_0x17a834){logger[_0x7b54('0x25')](_0x17a834['stack']);if(_0x17a834[_0x7b54('0x26')]){delete _0x17a834[_0x7b54('0x26')];}_0x1b0295[_0x7b54('0x18')](_0x3e7ab7)[_0x7b54('0x27')](_0x17a834);};}exports[_0x7b54('0x28')]=function(_0x1a1da0,_0x3c25bf){if(_0x1a1da0['body']['id']){delete _0x1a1da0['body']['id'];}return db[_0x7b54('0x29')][_0x7b54('0x2a')]({'where':{'id':_0x1a1da0[_0x7b54('0x2b')]['id']}})[_0x7b54('0x22')](handleEntityNotFound(_0x3c25bf,null))[_0x7b54('0x22')](saveUpdates(_0x1a1da0[_0x7b54('0x2c')],null))['then'](respondWithResult(_0x3c25bf,null))[_0x7b54('0x2d')](handleError(_0x3c25bf,null));};exports[_0x7b54('0x23')]=function(_0x86014b,_0x3bbe69){return db[_0x7b54('0x29')][_0x7b54('0x2a')]({'where':{'id':_0x86014b[_0x7b54('0x2b')]['id']}})[_0x7b54('0x22')](handleEntityNotFound(_0x3bbe69,null))[_0x7b54('0x22')](removeEntity(_0x3bbe69,null))[_0x7b54('0x2d')](handleError(_0x3bbe69,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index d0076e2..9489077 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 _0x5f11=['exports','define','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./action.attributes'];(function(_0xc49513,_0x18ed11){var _0x1194bc=function(_0x59b707){while(--_0x59b707){_0xc49513['push'](_0xc49513['shift']());}};_0x1194bc(++_0x18ed11);}(_0x5f11,0x98));var _0x15f1=function(_0x4f7b07,_0x372be0){_0x4f7b07=_0x4f7b07-0x0;var _0x1268c6=_0x5f11[_0x4f7b07];return _0x1268c6;};'use strict';var _=require(_0x15f1('0x0'));var util=require(_0x15f1('0x1'));var logger=require(_0x15f1('0x2'))('api');var moment=require(_0x15f1('0x3'));var BPromise=require(_0x15f1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x15f1('0x5'));var rimraf=require('rimraf');var config=require(_0x15f1('0x6'));var attributes=require(_0x15f1('0x7'));module[_0x15f1('0x8')]=function(_0x3e8819,_0x407626){return _0x3e8819[_0x15f1('0x9')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x85be=['rimraf','./action.attributes','exports','define','tools_actions','lodash','util','api','moment','request-promise','path'];(function(_0x143ee7,_0x18e5d3){var _0x31b693=function(_0xbe2612){while(--_0xbe2612){_0x143ee7['push'](_0x143ee7['shift']());}};_0x31b693(++_0x18e5d3);}(_0x85be,0x1c8));var _0xe85b=function(_0x573a8b,_0x26c29f){_0x573a8b=_0x573a8b-0x0;var _0x25a2ff=_0x85be[_0x573a8b];return _0x25a2ff;};'use strict';var _=require(_0xe85b('0x0'));var util=require(_0xe85b('0x1'));var logger=require('../../config/logger')(_0xe85b('0x2'));var moment=require(_0xe85b('0x3'));var BPromise=require('bluebird');var rp=require(_0xe85b('0x4'));var fs=require('fs');var path=require(_0xe85b('0x5'));var rimraf=require(_0xe85b('0x6'));var config=require('../../config/environment');var attributes=require(_0xe85b('0x7'));module[_0xe85b('0x8')]=function(_0x32c3e9,_0x1fa0e1){return _0x32c3e9[_0xe85b('0x9')]('Action',attributes,{'tableName':_0xe85b('0xa'),'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 76d102a..27ed211 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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x16f5be,_0x4b5f97){var _0xbdda95=function(_0x5bdfdf){while(--_0x5bdfdf){_0x16f5be['push'](_0x16f5be['shift']());}};_0xbdda95(++_0x4b5f97);}(_0x1261,0x144));var _0x1126=function(_0x13321a,_0x273c96){_0x13321a=_0x13321a-0x0;var _0x452c07=_0x1261[_0x13321a];return _0x452c07;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x814b,0x1a2));var _0xb814=function(_0x39e15b,_0x555185){_0x39e15b=_0x39e15b-0x0;var _0x4e5766=_0x814b[_0x39e15b];return _0x4e5766;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 322ec64..56f4a11 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 _0xc47d=['isAuthenticated','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x53e29e,_0x17c540){var _0x54c118=function(_0x45b1bf){while(--_0x45b1bf){_0x53e29e['push'](_0x53e29e['shift']());}};_0x54c118(++_0x17c540);}(_0xc47d,0x1f2));var _0xdc47=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc47d[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xdc47('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdc47('0x1'));var router=express[_0xdc47('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xdc47('0x3'));var interaction=require(_0xdc47('0x4'));var config=require(_0xdc47('0x5'));var controller=require(_0xdc47('0x6'));router[_0xdc47('0x7')](_0xdc47('0x8'),auth[_0xdc47('0x9')](),controller['update']);router[_0xdc47('0xa')]('/:id',auth[_0xdc47('0x9')](),controller[_0xdc47('0xb')]);module[_0xdc47('0xc')]=router;
\ No newline at end of file
+var _0x6c99=['/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','isAuthenticated','update','delete'];(function(_0x1d1963,_0x32cc0e){var _0x3f58bb=function(_0x514823){while(--_0x514823){_0x1d1963['push'](_0x1d1963['shift']());}};_0x3f58bb(++_0x32cc0e);}(_0x6c99,0x113));var _0x96c9=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x6c99[_0x525c7b];return _0x27b33e;};'use strict';var multer=require(_0x96c9('0x0'));var util=require(_0x96c9('0x1'));var path=require('path');var timeout=require(_0x96c9('0x2'));var express=require(_0x96c9('0x3'));var router=express[_0x96c9('0x4')]();var fs_extra=require(_0x96c9('0x5'));var auth=require(_0x96c9('0x6'));var interaction=require(_0x96c9('0x7'));var config=require(_0x96c9('0x8'));var controller=require('./action.controller');router[_0x96c9('0x9')]('/:id',auth[_0x96c9('0xa')](),controller[_0x96c9('0xb')]);router[_0x96c9('0xc')](_0x96c9('0xd'),auth[_0x96c9('0xa')](),controller[_0x96c9('0xe')]);module[_0x96c9('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 0e44a80..69f1bf2 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 _0x6f47=['TEXT','exports','STRING'];(function(_0x3a21d0,_0x52afc5){var _0xe70ae2=function(_0xdd58c5){while(--_0xdd58c5){_0x3a21d0['push'](_0x3a21d0['shift']());}};_0xe70ae2(++_0x52afc5);}(_0x6f47,0xc7));var _0x76f4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6f47[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1b5931,_0xcce6cb){_0x1b5931=_0x1b5931-0x0;var _0x1d85da=_0x1cb9[_0x1b5931];return _0x1d85da;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x91cb('0x1')]},'parent':{'type':Sequelize[_0x91cb('0x1')]},'table':{'type':Sequelize[_0x91cb('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x91cb('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 6004421..e5a07a6 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 _0x9feb=['AnalyticCustomReport','rawAttributes','fieldName','type','key','model','map','keys','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','function','replace','format','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','left_join','SUM(%s)','MAX(%s)','includes','AnalyticMetric','select','metric','%s.%s\x20=\x20%s.%s','output','fullPath','%s-%s.%s','randomstring','generate','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','Run\x20Query:','child_process','fork','../../components/export/','savename','COUNT(*)','value','groupBy','alias','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','then','get','UserProfileResource','name'];(function(_0xa6e4c8,_0x52e242){var _0x29e0c8=function(_0x2caaf2){while(--_0x2caaf2){_0xa6e4c8['push'](_0xa6e4c8['shift']());}};_0x29e0c8(++_0x52e242);}(_0x9feb,0x1c0));var _0xb9fe=function(_0xf879bb,_0x5aaebf){_0xf879bb=_0xf879bb-0x0;var _0x277abc=_0x9feb[_0xf879bb];return _0x277abc;};'use strict';var emlformat=require(_0xb9fe('0x0'));var rimraf=require(_0xb9fe('0x1'));var zipdir=require(_0xb9fe('0x2'));var jsonpatch=require(_0xb9fe('0x3'));var rp=require(_0xb9fe('0x4'));var moment=require(_0xb9fe('0x5'));var BPromise=require(_0xb9fe('0x6'));var Mustache=require('mustache');var util=require(_0xb9fe('0x7'));var path=require(_0xb9fe('0x8'));var sox=require(_0xb9fe('0x9'));var csv=require(_0xb9fe('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9fe('0xb'));var _=require(_0xb9fe('0xc'));var squel=require(_0xb9fe('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb9fe('0xe'));var toCsv=require(_0xb9fe('0xa'));var querystring=require('querystring');var Papa=require(_0xb9fe('0xf'));var Redis=require('ioredis');var authService=require(_0xb9fe('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb9fe('0x11'));var hardwareService=require(_0xb9fe('0x12'));var logger=require(_0xb9fe('0x13'))(_0xb9fe('0x14'));var utils=require(_0xb9fe('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb9fe('0x16'))['db'];var dbH=require('../../mysqldb')[_0xb9fe('0x17')];function respondWithStatusCode(_0x231fbf,_0x2aba6a){_0x2aba6a=_0x2aba6a||0xcc;return function(_0x216678){if(_0x216678){return _0x231fbf[_0xb9fe('0x18')](_0x2aba6a);}return _0x231fbf[_0xb9fe('0x19')](_0x2aba6a)[_0xb9fe('0x1a')]();};}function respondWithResult(_0x572bb4,_0x4c4784){_0x4c4784=_0x4c4784||0xc8;return function(_0x206af1){if(_0x206af1){return _0x572bb4[_0xb9fe('0x19')](_0x4c4784)[_0xb9fe('0x1b')](_0x206af1);}};}function respondWithFilteredResult(_0x154b38,_0x3b894c){return function(_0x548376){if(_0x548376){var _0x3416f0=typeof _0x3b894c[_0xb9fe('0x1c')]===_0xb9fe('0x1d')&&typeof _0x3b894c['limit']===_0xb9fe('0x1d');var _0x2fae14=_0x548376['count'];var _0x55aa68=_0x3416f0?0x0:_0x3b894c['offset'];var _0x1fa7d0=_0x3416f0?_0x548376[_0xb9fe('0x1e')]:_0x3b894c[_0xb9fe('0x1c')]+_0x3b894c[_0xb9fe('0x1f')];var _0x13e68a;if(_0x1fa7d0>=_0x2fae14){_0x1fa7d0=_0x2fae14;_0x13e68a=0xc8;}else{_0x13e68a=0xce;}_0x154b38['status'](_0x13e68a);return _0x154b38[_0xb9fe('0x20')](_0xb9fe('0x21'),_0x55aa68+'-'+_0x1fa7d0+'/'+_0x2fae14)[_0xb9fe('0x1b')](_0x548376);}return null;};}function patchUpdates(_0xbcedb6){return function(_0x1b8ccf){try{jsonpatch[_0xb9fe('0x22')](_0x1b8ccf,_0xbcedb6,!![]);}catch(_0x398d5b){return BPromise['reject'](_0x398d5b);}return _0x1b8ccf['save']();};}function saveUpdates(_0x56db76,_0xe1a332){return function(_0x462909){if(_0x462909){return _0x462909[_0xb9fe('0x23')](_0x56db76)['then'](function(_0x4e8e6a){return _0x4e8e6a;});}return null;};}function removeEntity(_0x106bbd,_0x1c3058){return function(_0xc2b2c6){if(_0xc2b2c6){return _0xc2b2c6[_0xb9fe('0x24')]()[_0xb9fe('0x25')](function(){var _0x359f66=_0xc2b2c6[_0xb9fe('0x26')]({'plain':!![]});var _0x20a8f6='CustomReports';return db[_0xb9fe('0x27')][_0xb9fe('0x24')]({'where':{'type':_0x20a8f6,'resourceId':_0x359f66['id']}})[_0xb9fe('0x25')](function(){return _0xc2b2c6;});})['then'](function(){_0x106bbd[_0xb9fe('0x19')](0xcc)[_0xb9fe('0x1a')]();});}};}function handleEntityNotFound(_0x58fa64,_0x5c9cf4){return function(_0x10c2f2){if(!_0x10c2f2){_0x58fa64[_0xb9fe('0x18')](0x194);}return _0x10c2f2;};}function handleError(_0xaff1cd,_0x499d59){_0x499d59=_0x499d59||0x1f4;return function(_0x21981f){logger['error'](_0x21981f['stack']);if(_0x21981f[_0xb9fe('0x28')]){delete _0x21981f[_0xb9fe('0x28')];}_0xaff1cd['status'](_0x499d59)['send'](_0x21981f);};}exports['index']=function(_0x129a8f,_0x1477fa){var _0x4be4fd={},_0x3de764={},_0x216839={'count':0x0,'rows':[]};var _0x1b8bbb=_['map'](db[_0xb9fe('0x29')][_0xb9fe('0x2a')],function(_0x5eb5ed){return{'name':_0x5eb5ed[_0xb9fe('0x2b')],'type':_0x5eb5ed[_0xb9fe('0x2c')][_0xb9fe('0x2d')]};});_0x3de764[_0xb9fe('0x2e')]=_[_0xb9fe('0x2f')](_0x1b8bbb,_0xb9fe('0x28'));_0x3de764['query']=_[_0xb9fe('0x30')](_0x129a8f['query']);_0x3de764['filters']=_[_0xb9fe('0x31')](_0x3de764['model'],_0x3de764['query']);_0x4be4fd[_0xb9fe('0x32')]=_[_0xb9fe('0x31')](_0x3de764[_0xb9fe('0x2e')],qs[_0xb9fe('0x33')](_0x129a8f[_0xb9fe('0x34')][_0xb9fe('0x33')]));_0x4be4fd[_0xb9fe('0x32')]=_0x4be4fd[_0xb9fe('0x32')]['length']?_0x4be4fd[_0xb9fe('0x32')]:_0x3de764['model'];if(!_0x129a8f[_0xb9fe('0x34')][_0xb9fe('0x35')](_0xb9fe('0x36'))){_0x4be4fd[_0xb9fe('0x1f')]=qs['limit'](_0x129a8f[_0xb9fe('0x34')][_0xb9fe('0x1f')]);_0x4be4fd['offset']=qs[_0xb9fe('0x1c')](_0x129a8f[_0xb9fe('0x34')][_0xb9fe('0x1c')]);}_0x4be4fd[_0xb9fe('0x37')]=qs['sort'](_0x129a8f['query'][_0xb9fe('0x38')]);_0x4be4fd[_0xb9fe('0x39')]=qs['filters'](_[_0xb9fe('0x3a')](_0x129a8f[_0xb9fe('0x34')],_0x3de764[_0xb9fe('0x3b')]),_0x1b8bbb);if(_0x129a8f[_0xb9fe('0x34')][_0xb9fe('0x3c')]){_0x4be4fd[_0xb9fe('0x39')]=_['merge'](_0x4be4fd['where'],{'$or':_[_0xb9fe('0x2f')](_0x1b8bbb,function(_0x172419){if(_0x172419['type']!==_0xb9fe('0x3d')){var _0x22b4b1={};_0x22b4b1[_0x172419[_0xb9fe('0x28')]]={'$like':'%'+_0x129a8f[_0xb9fe('0x34')]['filter']+'%'};return _0x22b4b1;}})});}_0x4be4fd=_[_0xb9fe('0x3e')]({},_0x4be4fd,_0x129a8f[_0xb9fe('0x3f')]);var _0x1def98={'where':_0x4be4fd[_0xb9fe('0x39')]};return db[_0xb9fe('0x29')][_0xb9fe('0x1e')](_0x1def98)[_0xb9fe('0x25')](function(_0x5769fb){_0x216839[_0xb9fe('0x1e')]=_0x5769fb;if(_0x129a8f[_0xb9fe('0x34')][_0xb9fe('0x40')]){_0x4be4fd[_0xb9fe('0x41')]=[{'all':!![]}];}return db[_0xb9fe('0x29')][_0xb9fe('0x42')](_0x4be4fd);})[_0xb9fe('0x25')](function(_0xcea1d9){_0x216839[_0xb9fe('0x43')]=_0xcea1d9;return _0x216839;})[_0xb9fe('0x25')](respondWithFilteredResult(_0x1477fa,_0x4be4fd))[_0xb9fe('0x44')](handleError(_0x1477fa,null));};exports[_0xb9fe('0x45')]=function(_0x4d4a0b,_0x236a91){var _0x3b4101={'raw':![],'where':{'id':_0x4d4a0b['params']['id']}},_0x48095f={};_0x48095f[_0xb9fe('0x2e')]=_[_0xb9fe('0x30')](db['AnalyticCustomReport'][_0xb9fe('0x2a')]);_0x48095f[_0xb9fe('0x34')]=_[_0xb9fe('0x30')](_0x4d4a0b[_0xb9fe('0x34')]);_0x48095f[_0xb9fe('0x3b')]=_['intersection'](_0x48095f[_0xb9fe('0x2e')],_0x48095f['query']);_0x3b4101['attributes']=_['intersection'](_0x48095f[_0xb9fe('0x2e')],qs[_0xb9fe('0x33')](_0x4d4a0b[_0xb9fe('0x34')]['fields']));_0x3b4101[_0xb9fe('0x32')]=_0x3b4101[_0xb9fe('0x32')][_0xb9fe('0x46')]?_0x3b4101[_0xb9fe('0x32')]:_0x48095f[_0xb9fe('0x2e')];if(_0x4d4a0b[_0xb9fe('0x34')]['includeAll']){_0x3b4101[_0xb9fe('0x41')]=[{'all':!![]}];}_0x3b4101=_[_0xb9fe('0x3e')]({},_0x3b4101,_0x4d4a0b[_0xb9fe('0x3f')]);return db['AnalyticCustomReport'][_0xb9fe('0x47')](_0x3b4101)[_0xb9fe('0x25')](handleEntityNotFound(_0x236a91,null))['then'](respondWithResult(_0x236a91,null))['catch'](handleError(_0x236a91,null));};exports[_0xb9fe('0x48')]=function(_0x572083,_0x3f6f3c){return db[_0xb9fe('0x29')]['create'](_0x572083[_0xb9fe('0x49')],{})[_0xb9fe('0x25')](function(_0x451e2a){var _0xca115f=_0x572083[_0xb9fe('0x4a')]['get']({'plain':!![]});if(!_0xca115f)throw new Error(_0xb9fe('0x4b'));if(_0xca115f[_0xb9fe('0x4c')]===_0xb9fe('0x4a')){var _0x17c13a=_0x451e2a['get']({'plain':!![]});var _0x23d606=_0xb9fe('0x4d');return db[_0xb9fe('0x4e')][_0xb9fe('0x47')]({'where':{'name':_0x23d606,'userProfileId':_0xca115f[_0xb9fe('0x4f')]},'raw':!![]})[_0xb9fe('0x25')](function(_0x854f87){if(_0x854f87&&_0x854f87[_0xb9fe('0x50')]===0x0){return db[_0xb9fe('0x27')][_0xb9fe('0x48')]({'name':_0x17c13a['name'],'resourceId':_0x17c13a['id'],'type':_0xb9fe('0x51'),'sectionId':_0x854f87['id']},{})[_0xb9fe('0x25')](function(){return _0x451e2a;});}else{return _0x451e2a;}})[_0xb9fe('0x44')](function(_0x15cd91){logger[_0xb9fe('0x52')](_0xb9fe('0x53'),_0x15cd91);throw _0x15cd91;});}return _0x451e2a;})[_0xb9fe('0x25')](respondWithResult(_0x3f6f3c,0xc9))[_0xb9fe('0x44')](handleError(_0x3f6f3c,null));};exports[_0xb9fe('0x23')]=function(_0x288f8e,_0x15f4f3){if(_0x288f8e[_0xb9fe('0x49')]['id']){delete _0x288f8e[_0xb9fe('0x49')]['id'];}return db['AnalyticCustomReport'][_0xb9fe('0x47')]({'where':{'id':_0x288f8e[_0xb9fe('0x54')]['id']}})[_0xb9fe('0x25')](handleEntityNotFound(_0x15f4f3,null))['then'](saveUpdates(_0x288f8e[_0xb9fe('0x49')],null))[_0xb9fe('0x25')](respondWithResult(_0x15f4f3,null))[_0xb9fe('0x44')](handleError(_0x15f4f3,null));};exports[_0xb9fe('0x24')]=function(_0x4bdac3,_0x4c847c){return db[_0xb9fe('0x29')]['find']({'where':{'id':_0x4bdac3[_0xb9fe('0x54')]['id']}})[_0xb9fe('0x25')](handleEntityNotFound(_0x4c847c,null))[_0xb9fe('0x25')](removeEntity(_0x4c847c,null))[_0xb9fe('0x44')](handleError(_0x4c847c,null));};exports[_0xb9fe('0x55')]=function(_0x1e0e25,_0x110804){var _0x524246=0xa;var _0x248154=[_0xb9fe('0x56'),'left_join',_0xb9fe('0x57'),_0xb9fe('0x58')];var _0xb68519={'SUM':'SUM(%s)','COUNT':_0xb9fe('0x59'),'COUNT DISTINCT':_0xb9fe('0x5a'),'MAX':'MAX(%s)','MIN':_0xb9fe('0x5b'),'AVG':_0xb9fe('0x5c'),'GROUP_CONCAT':_0xb9fe('0x5d'),'GROUP_CONCAT ASC':_0xb9fe('0x5e'),'GROUP_CONCAT DESC':_0xb9fe('0x5f')};var _0x38a3a7={'SEC_TO_TIME':_0xb9fe('0x60'),'DATE':_0xb9fe('0x61'),'HOUR':_0xb9fe('0x62'),'ROUND':_0xb9fe('0x63'),'UNIX_TIMESTAMP':_0xb9fe('0x64')};var _0x635d4a=function(_0x1d1457){return!_['includes']([_0xb9fe('0x65'),_0xb9fe('0x66'),_0xb9fe('0x67'),_0xb9fe('0x68')],_0x1d1457);};var _0x32b1d2=function(_0x4c9d34){if(!_0x4c9d34||!_0x4c9d34['rules'][_0xb9fe('0x46')]){return'';}for(var _0x3b6294='(',_0x1db89c=0x0;_0x1db89c<_0x4c9d34['rules'][_0xb9fe('0x46')];_0x1db89c+=0x1){_0x1db89c>0x0&&(_0x3b6294+='\x20'+_0x4c9d34[_0xb9fe('0x69')]+'\x20');_0x3b6294+=_0x4c9d34[_0xb9fe('0x6a')][_0x1db89c][_0xb9fe('0x6b')]?_0x32b1d2(_0x4c9d34['rules'][_0x1db89c]['group']):_0x4c9d34[_0xb9fe('0x6a')][_0x1db89c][_0xb9fe('0x6c')]+'\x20'+_0x4c9d34[_0xb9fe('0x6a')][_0x1db89c][_0xb9fe('0x6d')]+(_0x635d4a(_0x4c9d34[_0xb9fe('0x6a')][_0x1db89c][_0xb9fe('0x6d')])?'\x20'+_0x4c9d34[_0xb9fe('0x6a')][_0x1db89c]['value']:'');}return _0x3b6294+')';};var _0x30366e={'where':{'id':_0x1e0e25['params']['id']}},_0x526343,_0x4d356d,_0x3adcae,_0x2684c6,_0x4970dd;_0x30366e=_[_0xb9fe('0x3e')]({},_0x30366e,_0x1e0e25[_0xb9fe('0x3f')]);return db[_0xb9fe('0x29')][_0xb9fe('0x47')](_0x30366e)[_0xb9fe('0x25')](function(_0x1f62f6){if(_0x1f62f6){_0x526343=_0x1f62f6;return _0x1f62f6[_0xb9fe('0x6e')]();}return null;})[_0xb9fe('0x25')](function(_0x592da4){if(_0x592da4){if(!_0x592da4[_0xb9fe('0x46')]){throw new db[(_0xb9fe('0x6f'))][(_0xb9fe('0x70'))](_0xb9fe('0x71'),0x193);}_0x4d356d=_0x592da4;return db['AnalyticMetric'][_0xb9fe('0x42')]({'raw':!![]});}return null;})[_0xb9fe('0x25')](function(_0x214eee){if(_0x214eee){_0x3adcae=_[_0xb9fe('0x72')](_0x214eee,'id');var _0x41ddba;var _0x13dbb8=squel['select']();_0x13dbb8[_0xb9fe('0x73')](_0x526343[_0xb9fe('0x74')]);for(var _0x3788d8=0x0;_0x3788d8<_0x4d356d[_0xb9fe('0x46')];_0x3788d8+=0x1){_0x41ddba=_0x4d356d[_0x3788d8]['MetricId']?_0x3adcae[_0x4d356d[_0x3788d8][_0xb9fe('0x75')]]['metric']:_0x4d356d[_0x3788d8][_0xb9fe('0x6c')];_0x41ddba=_0x4d356d[_0x3788d8][_0xb9fe('0x76')]?_[_0xb9fe('0x77')](_0xb68519[_0x4d356d[_0x3788d8][_0xb9fe('0x76')]],'%s',_0x41ddba):_0x41ddba;_0x41ddba=_0x4d356d[_0x3788d8][_0xb9fe('0x78')]?_[_0xb9fe('0x77')](_0x38a3a7[_0x4d356d[_0x3788d8][_0xb9fe('0x78')]],'%s',_0x41ddba):_0x41ddba;if(_0x4d356d[_0x3788d8]['groupBy']){_0x13dbb8[_0xb9fe('0x6b')](_0x41ddba);}_0x4d356d[_0x3788d8][_0xb9fe('0x79')]&&_0x13dbb8[_0xb9fe('0x37')](_0x41ddba,_0x4d356d[_0x3788d8][_0xb9fe('0x79')]===_0xb9fe('0x7a')?![]:!![]);_0x13dbb8['field'](_0x41ddba,_0x4d356d[_0x3788d8]['alias']||_0x41ddba);}if(_0x526343[_0xb9fe('0x7b')]){_0x526343[_0xb9fe('0x7b')]=JSON['parse'](_0x526343['joins']);for(var _0x28b324=0x0;_0x28b324<_0x526343[_0xb9fe('0x7b')][_0xb9fe('0x46')];_0x28b324+=0x1){if(_0x526343[_0xb9fe('0x7b')][_0x28b324]['type']&&_['includes'](_0x248154,_0x526343[_0xb9fe('0x7b')][_0x28b324][_0xb9fe('0x2c')])&&_0x526343[_0xb9fe('0x7b')][_0x28b324][_0xb9fe('0x7c')]&&_0x526343[_0xb9fe('0x7b')][_0x28b324][_0xb9fe('0x7d')]&&_0x526343[_0xb9fe('0x7b')][_0x28b324][_0xb9fe('0x7e')]){_0x13dbb8[_0x526343[_0xb9fe('0x7b')][_0x28b324][_0xb9fe('0x2c')]](_0x526343['joins'][_0x28b324][_0xb9fe('0x7d')],null,util[_0xb9fe('0x78')]('%s.%s\x20=\x20%s.%s',_0x526343['table'],_0x526343[_0xb9fe('0x7b')][_0x28b324]['parentKey'],_0x526343[_0xb9fe('0x7b')][_0x28b324]['foreignTable'],_0x526343[_0xb9fe('0x7b')][_0x28b324]['foreignKey']));}}}if(_0x526343[_0xb9fe('0x7f')]){_0x526343['conditions']=JSON[_0xb9fe('0x80')](_0x526343[_0xb9fe('0x7f')]);_0x13dbb8[_0xb9fe('0x39')](_0x32b1d2(_0x526343[_0xb9fe('0x7f')][_0xb9fe('0x6b')]));}_0x4970dd=_0x13dbb8[_0xb9fe('0x81')]();_0x13dbb8[_0xb9fe('0x1f')](_0x524246);_0x13dbb8[_0xb9fe('0x1c')](0x0);logger[_0xb9fe('0x82')](_0xb9fe('0x83'),_0x13dbb8['toString']());return dbH[_0xb9fe('0x84')][_0xb9fe('0x34')](_0x13dbb8[_0xb9fe('0x85')](),{'type':dbH['sequelize'][_0xb9fe('0x86')][_0xb9fe('0x87')]});}})[_0xb9fe('0x25')](respondWithResult(_0x110804,null))['catch'](handleError(_0x110804,null));};function runReport(_0x2ab114,_0x2b7158,_0x1a0e6d){var _0x178747=_0x2b7158[_0xb9fe('0x28')];var _0x10588d=0xa;var _0x23206f=[_0xb9fe('0x56'),_0xb9fe('0x88'),'right_join','cross_join'];var _0x389a32={'SUM':_0xb9fe('0x89'),'COUNT':_0xb9fe('0x59'),'COUNT DISTINCT':_0xb9fe('0x5a'),'MAX':_0xb9fe('0x8a'),'MIN':_0xb9fe('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb9fe('0x5e'),'GROUP_CONCAT DESC':_0xb9fe('0x5f')};var _0xf21778={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb9fe('0x64')};var _0x28e714=function(_0xd7a4dd){return!_[_0xb9fe('0x8b')]([_0xb9fe('0x65'),'IS\x20NOT\x20NULL',_0xb9fe('0x67'),_0xb9fe('0x68')],_0xd7a4dd);};var _0x1128e0=function(_0x27d5c1){if(!_0x27d5c1||!_0x27d5c1['rules']['length']){return'';}for(var _0x3d3011='(',_0x48230c=0x0;_0x48230c<_0x27d5c1[_0xb9fe('0x6a')][_0xb9fe('0x46')];_0x48230c+=0x1){_0x48230c>0x0&&(_0x3d3011+='\x20'+_0x27d5c1[_0xb9fe('0x69')]+'\x20');_0x3d3011+=_0x27d5c1['rules'][_0x48230c][_0xb9fe('0x6b')]?_0x1128e0(_0x27d5c1[_0xb9fe('0x6a')][_0x48230c][_0xb9fe('0x6b')]):_0x27d5c1['rules'][_0x48230c][_0xb9fe('0x6c')]+'\x20'+_0x27d5c1[_0xb9fe('0x6a')][_0x48230c][_0xb9fe('0x6d')]+(_0x28e714(_0x27d5c1[_0xb9fe('0x6a')][_0x48230c][_0xb9fe('0x6d')])?'\x20'+_0x27d5c1[_0xb9fe('0x6a')][_0x48230c]['value']:'');}return _0x3d3011+')';};var _0x289e43={'where':{'id':_0x2ab114['id']}},_0x5e9974,_0xf94bd9,_0x2d16f4,_0x25efa7,_0x37e70e;_0x289e43=_['merge']({},_0x289e43,_0x1a0e6d);return db[_0xb9fe('0x29')]['find'](_0x289e43)[_0xb9fe('0x25')](function(_0x2a25e3){if(_0x2a25e3){_0x5e9974=_0x2a25e3;return _0x2a25e3[_0xb9fe('0x6e')]();}return null;})[_0xb9fe('0x25')](function(_0x34302c){if(_0x34302c){if(!_0x34302c[_0xb9fe('0x46')]){throw new db['Sequelize'][(_0xb9fe('0x70'))](_0xb9fe('0x71'),0x193);}_0xf94bd9=_0x34302c;return db[_0xb9fe('0x8c')][_0xb9fe('0x42')]({'raw':!![]});}return null;})['then'](function(_0x4c40dd){if(_0x4c40dd){_0x2d16f4=_[_0xb9fe('0x72')](_0x4c40dd,'id');var _0xa431d6;var _0x4588ef=squel[_0xb9fe('0x8d')]();_0x4588ef[_0xb9fe('0x73')](_0x5e9974['table']);for(var _0xf8fb62=0x0;_0xf8fb62<_0xf94bd9[_0xb9fe('0x46')];_0xf8fb62+=0x1){_0xa431d6=_0xf94bd9[_0xf8fb62][_0xb9fe('0x75')]?_0x2d16f4[_0xf94bd9[_0xf8fb62]['MetricId']][_0xb9fe('0x8e')]:_0xf94bd9[_0xf8fb62][_0xb9fe('0x6c')];_0xa431d6=_0xf94bd9[_0xf8fb62][_0xb9fe('0x76')]?_[_0xb9fe('0x77')](_0x389a32[_0xf94bd9[_0xf8fb62][_0xb9fe('0x76')]],'%s',_0xa431d6):_0xa431d6;_0xa431d6=_0xf94bd9[_0xf8fb62][_0xb9fe('0x78')]?_[_0xb9fe('0x77')](_0xf21778[_0xf94bd9[_0xf8fb62][_0xb9fe('0x78')]],'%s',_0xa431d6):_0xa431d6;if(_0xf94bd9[_0xf8fb62]['groupBy']){_0x4588ef[_0xb9fe('0x6b')](_0xa431d6);}_0xf94bd9[_0xf8fb62][_0xb9fe('0x79')]&&_0x4588ef[_0xb9fe('0x37')](_0xa431d6,_0xf94bd9[_0xf8fb62]['orderBy']===_0xb9fe('0x7a')?![]:!![]);_0x4588ef[_0xb9fe('0x6c')](_0xa431d6,_0xf94bd9[_0xf8fb62]['alias']||_0xa431d6);}if(_0x5e9974['joins']){_0x5e9974[_0xb9fe('0x7b')]=JSON['parse'](_0x5e9974[_0xb9fe('0x7b')]);for(var _0x1cffb7=0x0;_0x1cffb7<_0x5e9974[_0xb9fe('0x7b')][_0xb9fe('0x46')];_0x1cffb7+=0x1){if(_0x5e9974[_0xb9fe('0x7b')][_0x1cffb7][_0xb9fe('0x2c')]&&_[_0xb9fe('0x8b')](_0x23206f,_0x5e9974[_0xb9fe('0x7b')][_0x1cffb7][_0xb9fe('0x2c')])&&_0x5e9974['joins'][_0x1cffb7][_0xb9fe('0x7c')]&&_0x5e9974[_0xb9fe('0x7b')][_0x1cffb7][_0xb9fe('0x7d')]&&_0x5e9974[_0xb9fe('0x7b')][_0x1cffb7][_0xb9fe('0x7e')]){_0x4588ef[_0x5e9974[_0xb9fe('0x7b')][_0x1cffb7]['type']](_0x5e9974[_0xb9fe('0x7b')][_0x1cffb7][_0xb9fe('0x7d')],null,util['format'](_0xb9fe('0x8f'),_0x5e9974[_0xb9fe('0x74')],_0x5e9974[_0xb9fe('0x7b')][_0x1cffb7][_0xb9fe('0x7c')],_0x5e9974[_0xb9fe('0x7b')][_0x1cffb7][_0xb9fe('0x7d')],_0x5e9974[_0xb9fe('0x7b')][_0x1cffb7][_0xb9fe('0x7e')]));}}}if(_0x5e9974[_0xb9fe('0x7f')]){_0x5e9974[_0xb9fe('0x7f')]=JSON['parse'](_0x5e9974['conditions']);_0x4588ef[_0xb9fe('0x39')](_0x1128e0(_0x5e9974[_0xb9fe('0x7f')][_0xb9fe('0x6b')]));}_0x37e70e=_0x4588ef[_0xb9fe('0x81')]();_0x4588ef[_0xb9fe('0x1f')](_0x10588d);_0x4588ef[_0xb9fe('0x1c')](0x0);return;}})[_0xb9fe('0x25')](function(){if(_0x2b7158[_0xb9fe('0x90')]==='web'){return null;}var _0x421ad2=_[_0xb9fe('0x3e')](_0x2b7158,{'name':_0x2b7158[_0xb9fe('0x91')]||_0x2b7158['name']||_0x5e9974[_0xb9fe('0x28')],'basename':_0x178747,'savename':util[_0xb9fe('0x78')](_0xb9fe('0x92'),_0x2b7158[_0xb9fe('0x28')]||_0x5e9974[_0xb9fe('0x28')],require(_0xb9fe('0x93'))[_0xb9fe('0x94')](0x4),_0x2b7158[_0xb9fe('0x90')]||_0xb9fe('0x95')),'reportId':_0x5e9974['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xb9fe('0x48')](_0x421ad2,{'raw':!![]});})['then'](function(_0x36e603){if(_0x5e9974[_0xb9fe('0x74')]===_0xb9fe('0x96')){_0x37e70e[_0xb9fe('0x39')](_0x5e9974[_0xb9fe('0x74')]+_0xb9fe('0x97'),_0x2b7158['startDate'],_0x2b7158[_0xb9fe('0x98')]);}else{_0x37e70e[_0xb9fe('0x39')](_0x5e9974['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b7158[_0xb9fe('0x99')],_0x2b7158[_0xb9fe('0x98')]);}if(_0x36e603){logger['info'](_0xb9fe('0x9a'),_0x37e70e[_0xb9fe('0x85')]());require(_0xb9fe('0x9b'))[_0xb9fe('0x9c')](path[_0xb9fe('0x56')](__dirname,_0xb9fe('0x9d'),_0x36e603['output']),[_0x36e603['id'],_0x37e70e[_0xb9fe('0x85')](),path['join'](__dirname,'../../files/reports',_0x36e603[_0xb9fe('0x9e')]),_0x178747]);return _0x36e603;}else{var _0x186d17=squel[_0xb9fe('0x8d')]();_0x186d17[_0xb9fe('0x73')]('('+_0x37e70e[_0xb9fe('0x85')]()+')','countTable');_0x186d17[_0xb9fe('0x6c')](_0xb9fe('0x9f'),_0xb9fe('0x1e'));_0x37e70e[_0xb9fe('0x1f')](_0x2b7158[_0xb9fe('0x1f')]||_0x10588d);_0x37e70e[_0xb9fe('0x1c')](_0x2b7158[_0xb9fe('0x1c')]||0x0);return dbH[_0xb9fe('0x84')][_0xb9fe('0x34')](_0x186d17[_0xb9fe('0x85')](),{'type':dbH[_0xb9fe('0x84')][_0xb9fe('0x86')][_0xb9fe('0x87')]})['then'](function(_0x3fcab5){if(!_0x3fcab5[_0xb9fe('0x46')]){_0x25efa7=0x0;}else{_0x25efa7=_0x3fcab5[0x0][_0xb9fe('0x1e')]||0x0;}return dbH[_0xb9fe('0x84')][_0xb9fe('0x34')](_0x37e70e[_0xb9fe('0x85')](),{'type':dbH['sequelize'][_0xb9fe('0x86')][_0xb9fe('0x87')]});})['then'](function(_0x2cc240){return{'rows':_0x2cc240||[],'count':_0x25efa7};});}});}exports['run']=function(_0x2fe34d,_0x4d0c1d){return runReport(_0x2fe34d[_0xb9fe('0x54')],_0x2fe34d['query'],_0x2fe34d[_0xb9fe('0x3f')])[_0xb9fe('0x25')](respondWithResult(_0x4d0c1d,null))[_0xb9fe('0x44')](handleError(_0x4d0c1d,null));};exports['runReport']=runReport;exports['query']=function(_0x30bf41,_0x359d49){var _0x642ec4=0xa;var _0x1324c7=[_0xb9fe('0x56'),_0xb9fe('0x88'),_0xb9fe('0x57'),'cross_join'];var _0x2d0a78={'SUM':'SUM(%s)','COUNT':_0xb9fe('0x59'),'COUNT DISTINCT':_0xb9fe('0x5a'),'MAX':_0xb9fe('0x8a'),'MIN':_0xb9fe('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb9fe('0x5d'),'GROUP_CONCAT ASC':_0xb9fe('0x5e'),'GROUP_CONCAT DESC':_0xb9fe('0x5f')};var _0x587ae7={'SEC_TO_TIME':_0xb9fe('0x60'),'DATE':_0xb9fe('0x61'),'HOUR':_0xb9fe('0x62'),'ROUND':_0xb9fe('0x63'),'UNIX_TIMESTAMP':_0xb9fe('0x64')};var _0x52819e=function(_0x3bb5a5){return!_[_0xb9fe('0x8b')]([_0xb9fe('0x65'),_0xb9fe('0x66'),'IS\x20EMPTY',_0xb9fe('0x68')],_0x3bb5a5);};var _0x86aafa=function(_0x1aa7e8){if(!_0x1aa7e8||!_0x1aa7e8[_0xb9fe('0x6a')][_0xb9fe('0x46')]){return'';}for(var _0x46df6b='(',_0x1c4829=0x0;_0x1c4829<_0x1aa7e8[_0xb9fe('0x6a')][_0xb9fe('0x46')];_0x1c4829+=0x1){_0x1c4829>0x0&&(_0x46df6b+='\x20'+_0x1aa7e8[_0xb9fe('0x69')]+'\x20');_0x46df6b+=_0x1aa7e8[_0xb9fe('0x6a')][_0x1c4829]['group']?_0x86aafa(_0x1aa7e8[_0xb9fe('0x6a')][_0x1c4829]['group']):_0x1aa7e8[_0xb9fe('0x6a')][_0x1c4829][_0xb9fe('0x6c')]+'\x20'+_0x1aa7e8['rules'][_0x1c4829][_0xb9fe('0x6d')]+(_0x52819e(_0x1aa7e8[_0xb9fe('0x6a')][_0x1c4829][_0xb9fe('0x6d')])?'\x20'+_0x1aa7e8[_0xb9fe('0x6a')][_0x1c4829][_0xb9fe('0xa0')]:'');}return _0x46df6b+')';};var _0x2dbeed={'where':{'id':_0x30bf41[_0xb9fe('0x54')]['id']}},_0x53b8f0,_0x32203d,_0x4a86d7,_0x5d5b0e,_0x22efc8;_0x2dbeed=_[_0xb9fe('0x3e')]({},_0x2dbeed,_0x30bf41[_0xb9fe('0x3f')]);return db[_0xb9fe('0x29')][_0xb9fe('0x47')](_0x2dbeed)['then'](function(_0x51947b){if(_0x51947b){_0x53b8f0=_0x51947b;return _0x51947b[_0xb9fe('0x6e')]();}return null;})[_0xb9fe('0x25')](function(_0x517238){if(_0x517238){if(!_0x517238[_0xb9fe('0x46')]){throw new db[(_0xb9fe('0x6f'))]['ValidationErrorItem'](_0xb9fe('0x71'),0x193);}_0x32203d=_0x517238;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xb9fe('0x25')](function(_0x23a547){if(_0x23a547){_0x4a86d7=_[_0xb9fe('0x72')](_0x23a547,'id');var _0x8538de;var _0xd33570=squel[_0xb9fe('0x8d')]();_0xd33570[_0xb9fe('0x73')](_0x53b8f0[_0xb9fe('0x74')]);for(var _0x45144c=0x0;_0x45144c<_0x32203d[_0xb9fe('0x46')];_0x45144c+=0x1){_0x8538de=_0x32203d[_0x45144c][_0xb9fe('0x75')]?_0x4a86d7[_0x32203d[_0x45144c]['MetricId']][_0xb9fe('0x8e')]:_0x32203d[_0x45144c][_0xb9fe('0x6c')];_0x8538de=_0x32203d[_0x45144c][_0xb9fe('0x76')]?_[_0xb9fe('0x77')](_0x2d0a78[_0x32203d[_0x45144c][_0xb9fe('0x76')]],'%s',_0x8538de):_0x8538de;_0x8538de=_0x32203d[_0x45144c][_0xb9fe('0x78')]?_[_0xb9fe('0x77')](_0x587ae7[_0x32203d[_0x45144c]['format']],'%s',_0x8538de):_0x8538de;if(_0x32203d[_0x45144c][_0xb9fe('0xa1')]){_0xd33570[_0xb9fe('0x6b')](_0x8538de);}_0x32203d[_0x45144c][_0xb9fe('0x79')]&&_0xd33570[_0xb9fe('0x37')](_0x8538de,_0x32203d[_0x45144c]['orderBy']==='DESC'?![]:!![]);_0xd33570['field'](_0x8538de,_0x32203d[_0x45144c][_0xb9fe('0xa2')]||_0x8538de);}if(_0x53b8f0[_0xb9fe('0x7b')]){_0x53b8f0[_0xb9fe('0x7b')]=JSON['parse'](_0x53b8f0[_0xb9fe('0x7b')]);for(var _0x5c30e0=0x0;_0x5c30e0<_0x53b8f0[_0xb9fe('0x7b')]['length'];_0x5c30e0+=0x1){if(_0x53b8f0['joins'][_0x5c30e0][_0xb9fe('0x2c')]&&_[_0xb9fe('0x8b')](_0x1324c7,_0x53b8f0[_0xb9fe('0x7b')][_0x5c30e0]['type'])&&_0x53b8f0['joins'][_0x5c30e0][_0xb9fe('0x7c')]&&_0x53b8f0['joins'][_0x5c30e0][_0xb9fe('0x7d')]&&_0x53b8f0[_0xb9fe('0x7b')][_0x5c30e0][_0xb9fe('0x7e')]){_0xd33570[_0x53b8f0[_0xb9fe('0x7b')][_0x5c30e0][_0xb9fe('0x2c')]](_0x53b8f0['joins'][_0x5c30e0][_0xb9fe('0x7d')],null,util[_0xb9fe('0x78')](_0xb9fe('0x8f'),_0x53b8f0['table'],_0x53b8f0[_0xb9fe('0x7b')][_0x5c30e0]['parentKey'],_0x53b8f0[_0xb9fe('0x7b')][_0x5c30e0]['foreignTable'],_0x53b8f0[_0xb9fe('0x7b')][_0x5c30e0]['foreignKey']));}}}if(_0x53b8f0[_0xb9fe('0x7f')]){_0x53b8f0[_0xb9fe('0x7f')]=JSON[_0xb9fe('0x80')](_0x53b8f0['conditions']);_0xd33570[_0xb9fe('0x39')](_0x86aafa(_0x53b8f0[_0xb9fe('0x7f')][_0xb9fe('0x6b')]));}_0x22efc8=_0xd33570[_0xb9fe('0x81')]();_0xd33570[_0xb9fe('0x1f')](_0x642ec4);_0xd33570[_0xb9fe('0x1c')](0x0);logger[_0xb9fe('0x82')](_0xb9fe('0x83'),_0xd33570[_0xb9fe('0x85')]());return dbH[_0xb9fe('0x84')]['query'](_0xd33570['toString'](),{'type':dbH[_0xb9fe('0x84')]['QueryTypes'][_0xb9fe('0x87')]});}})[_0xb9fe('0x25')](function(){return{'sql':_0x22efc8['toString']()};})[_0xb9fe('0x25')](respondWithResult(_0x359d49,null))[_0xb9fe('0x44')](handleError(_0x359d49,null));};
\ No newline at end of file
+var _0x3b59=['foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MIN(%s)','AVG(%s)','HOUR(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','AnalyticMetric','keyBy','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','fork','../../files/reports','savename','countTable','COUNT(*)','run','runReport','debug','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','select','from','table','MetricId','function','format','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x3b59,0xd6));var _0x93b5=function(_0xdb951d,_0x1dc42b){_0xdb951d=_0xdb951d-0x0;var _0x5e789e=_0x3b59[_0xdb951d];return _0x5e789e;};'use strict';var emlformat=require(_0x93b5('0x0'));var rimraf=require(_0x93b5('0x1'));var zipdir=require(_0x93b5('0x2'));var jsonpatch=require(_0x93b5('0x3'));var rp=require(_0x93b5('0x4'));var moment=require(_0x93b5('0x5'));var BPromise=require(_0x93b5('0x6'));var Mustache=require('mustache');var util=require(_0x93b5('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x93b5('0x8'));var ejs=require(_0x93b5('0x9'));var fs=require('fs');var fs_extra=require(_0x93b5('0xa'));var _=require(_0x93b5('0xb'));var squel=require(_0x93b5('0xc'));var crypto=require('crypto');var jsforce=require(_0x93b5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x93b5('0x8'));var querystring=require(_0x93b5('0xe'));var Papa=require(_0x93b5('0xf'));var Redis=require(_0x93b5('0x10'));var authService=require(_0x93b5('0x11'));var qs=require(_0x93b5('0x12'));var as=require(_0x93b5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x93b5('0x14'));var utils=require(_0x93b5('0x15'));var config=require(_0x93b5('0x16'));var licenseUtil=require(_0x93b5('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x93b5('0x18'))[_0x93b5('0x19')];function respondWithStatusCode(_0x2a7e48,_0x129ec2){_0x129ec2=_0x129ec2||0xcc;return function(_0xe04d09){if(_0xe04d09){return _0x2a7e48[_0x93b5('0x1a')](_0x129ec2);}return _0x2a7e48[_0x93b5('0x1b')](_0x129ec2)[_0x93b5('0x1c')]();};}function respondWithResult(_0x146f1f,_0x1122f8){_0x1122f8=_0x1122f8||0xc8;return function(_0x8893f1){if(_0x8893f1){return _0x146f1f[_0x93b5('0x1b')](_0x1122f8)['json'](_0x8893f1);}};}function respondWithFilteredResult(_0x384e94,_0x39cc42){return function(_0x105cb3){if(_0x105cb3){var _0x432703=typeof _0x39cc42[_0x93b5('0x1d')]===_0x93b5('0x1e')&&typeof _0x39cc42[_0x93b5('0x1f')]==='undefined';var _0x312e2c=_0x105cb3[_0x93b5('0x20')];var _0x1baefb=_0x432703?0x0:_0x39cc42[_0x93b5('0x1d')];var _0x3180fd=_0x432703?_0x105cb3[_0x93b5('0x20')]:_0x39cc42[_0x93b5('0x1d')]+_0x39cc42[_0x93b5('0x1f')];var _0x527356;if(_0x3180fd>=_0x312e2c){_0x3180fd=_0x312e2c;_0x527356=0xc8;}else{_0x527356=0xce;}_0x384e94[_0x93b5('0x1b')](_0x527356);return _0x384e94[_0x93b5('0x21')](_0x93b5('0x22'),_0x1baefb+'-'+_0x3180fd+'/'+_0x312e2c)[_0x93b5('0x23')](_0x105cb3);}return null;};}function patchUpdates(_0xb44586){return function(_0x699465){try{jsonpatch[_0x93b5('0x24')](_0x699465,_0xb44586,!![]);}catch(_0x297eb2){return BPromise[_0x93b5('0x25')](_0x297eb2);}return _0x699465[_0x93b5('0x26')]();};}function saveUpdates(_0x52cf63,_0x83bbb3){return function(_0x25f25a){if(_0x25f25a){return _0x25f25a[_0x93b5('0x27')](_0x52cf63)[_0x93b5('0x28')](function(_0x454314){return _0x454314;});}return null;};}function removeEntity(_0x4487d,_0x1905a3){return function(_0x2d4f57){if(_0x2d4f57){return _0x2d4f57[_0x93b5('0x29')]()[_0x93b5('0x28')](function(){var _0x52dc13=_0x2d4f57['get']({'plain':!![]});var _0x2d12bc=_0x93b5('0x2a');return db[_0x93b5('0x2b')]['destroy']({'where':{'type':_0x2d12bc,'resourceId':_0x52dc13['id']}})[_0x93b5('0x28')](function(){return _0x2d4f57;});})[_0x93b5('0x28')](function(){_0x4487d['status'](0xcc)[_0x93b5('0x1c')]();});}};}function handleEntityNotFound(_0x2a3cdd,_0x4c8c5d){return function(_0x2a5407){if(!_0x2a5407){_0x2a3cdd[_0x93b5('0x1a')](0x194);}return _0x2a5407;};}function handleError(_0x4b4201,_0x5834b1){_0x5834b1=_0x5834b1||0x1f4;return function(_0x3ad6d3){logger[_0x93b5('0x2c')](_0x3ad6d3[_0x93b5('0x2d')]);if(_0x3ad6d3[_0x93b5('0x2e')]){delete _0x3ad6d3[_0x93b5('0x2e')];}_0x4b4201['status'](_0x5834b1)['send'](_0x3ad6d3);};}exports[_0x93b5('0x2f')]=function(_0x4fd120,_0x1c0778){var _0x85e5aa={},_0x327ace={},_0x4bf74e={'count':0x0,'rows':[]};var _0x402c4e=_[_0x93b5('0x30')](db[_0x93b5('0x31')][_0x93b5('0x32')],function(_0x45f9f5){return{'name':_0x45f9f5[_0x93b5('0x33')],'type':_0x45f9f5[_0x93b5('0x34')][_0x93b5('0x35')]};});_0x327ace['model']=_[_0x93b5('0x30')](_0x402c4e,_0x93b5('0x2e'));_0x327ace[_0x93b5('0x36')]=_[_0x93b5('0x37')](_0x4fd120[_0x93b5('0x36')]);_0x327ace[_0x93b5('0x38')]=_[_0x93b5('0x39')](_0x327ace[_0x93b5('0x3a')],_0x327ace[_0x93b5('0x36')]);_0x85e5aa['attributes']=_['intersection'](_0x327ace[_0x93b5('0x3a')],qs[_0x93b5('0x3b')](_0x4fd120['query']['fields']));_0x85e5aa[_0x93b5('0x3c')]=_0x85e5aa['attributes'][_0x93b5('0x3d')]?_0x85e5aa[_0x93b5('0x3c')]:_0x327ace[_0x93b5('0x3a')];if(!_0x4fd120['query'][_0x93b5('0x3e')](_0x93b5('0x3f'))){_0x85e5aa['limit']=qs['limit'](_0x4fd120['query'][_0x93b5('0x1f')]);_0x85e5aa['offset']=qs[_0x93b5('0x1d')](_0x4fd120[_0x93b5('0x36')][_0x93b5('0x1d')]);}_0x85e5aa['order']=qs[_0x93b5('0x40')](_0x4fd120[_0x93b5('0x36')]['sort']);_0x85e5aa['where']=qs[_0x93b5('0x38')](_[_0x93b5('0x41')](_0x4fd120[_0x93b5('0x36')],_0x327ace[_0x93b5('0x38')]),_0x402c4e);if(_0x4fd120['query'][_0x93b5('0x42')]){_0x85e5aa[_0x93b5('0x43')]=_[_0x93b5('0x44')](_0x85e5aa['where'],{'$or':_['map'](_0x402c4e,function(_0x403d5b){if(_0x403d5b['type']!==_0x93b5('0x45')){var _0x1ac2ee={};_0x1ac2ee[_0x403d5b[_0x93b5('0x2e')]]={'$like':'%'+_0x4fd120[_0x93b5('0x36')][_0x93b5('0x42')]+'%'};return _0x1ac2ee;}})});}_0x85e5aa=_[_0x93b5('0x44')]({},_0x85e5aa,_0x4fd120[_0x93b5('0x46')]);var _0xcb1fac={'where':_0x85e5aa[_0x93b5('0x43')]};return db[_0x93b5('0x31')][_0x93b5('0x20')](_0xcb1fac)[_0x93b5('0x28')](function(_0x4ebfa6){_0x4bf74e[_0x93b5('0x20')]=_0x4ebfa6;if(_0x4fd120[_0x93b5('0x36')][_0x93b5('0x47')]){_0x85e5aa[_0x93b5('0x48')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x93b5('0x49')](_0x85e5aa);})['then'](function(_0x3b4b3e){_0x4bf74e[_0x93b5('0x4a')]=_0x3b4b3e;return _0x4bf74e;})[_0x93b5('0x28')](respondWithFilteredResult(_0x1c0778,_0x85e5aa))['catch'](handleError(_0x1c0778,null));};exports[_0x93b5('0x4b')]=function(_0x1a3dbc,_0x4b1a21){var _0x332b16={'raw':![],'where':{'id':_0x1a3dbc[_0x93b5('0x4c')]['id']}},_0x4042e6={};_0x4042e6[_0x93b5('0x3a')]=_[_0x93b5('0x37')](db[_0x93b5('0x31')][_0x93b5('0x32')]);_0x4042e6[_0x93b5('0x36')]=_['keys'](_0x1a3dbc['query']);_0x4042e6[_0x93b5('0x38')]=_[_0x93b5('0x39')](_0x4042e6[_0x93b5('0x3a')],_0x4042e6[_0x93b5('0x36')]);_0x332b16['attributes']=_['intersection'](_0x4042e6[_0x93b5('0x3a')],qs[_0x93b5('0x3b')](_0x1a3dbc[_0x93b5('0x36')][_0x93b5('0x3b')]));_0x332b16[_0x93b5('0x3c')]=_0x332b16['attributes'][_0x93b5('0x3d')]?_0x332b16[_0x93b5('0x3c')]:_0x4042e6[_0x93b5('0x3a')];if(_0x1a3dbc[_0x93b5('0x36')][_0x93b5('0x47')]){_0x332b16['include']=[{'all':!![]}];}_0x332b16=_[_0x93b5('0x44')]({},_0x332b16,_0x1a3dbc['options']);return db[_0x93b5('0x31')][_0x93b5('0x4d')](_0x332b16)[_0x93b5('0x28')](handleEntityNotFound(_0x4b1a21,null))[_0x93b5('0x28')](respondWithResult(_0x4b1a21,null))[_0x93b5('0x4e')](handleError(_0x4b1a21,null));};exports[_0x93b5('0x4f')]=function(_0xf6c6ae,_0x320f5f){return db['AnalyticCustomReport'][_0x93b5('0x4f')](_0xf6c6ae[_0x93b5('0x50')],{})['then'](function(_0x29e53c){var _0x424fb6=_0xf6c6ae[_0x93b5('0x51')][_0x93b5('0x52')]({'plain':!![]});if(!_0x424fb6)throw new Error(_0x93b5('0x53'));if(_0x424fb6[_0x93b5('0x54')]===_0x93b5('0x51')){var _0x516bca=_0x29e53c['get']({'plain':!![]});var _0x49441b=_0x93b5('0x55');return db[_0x93b5('0x56')][_0x93b5('0x4d')]({'where':{'name':_0x49441b,'userProfileId':_0x424fb6[_0x93b5('0x57')]},'raw':!![]})['then'](function(_0x5e9165){if(_0x5e9165&&_0x5e9165[_0x93b5('0x58')]===0x0){return db[_0x93b5('0x2b')][_0x93b5('0x4f')]({'name':_0x516bca[_0x93b5('0x2e')],'resourceId':_0x516bca['id'],'type':'CustomReports','sectionId':_0x5e9165['id']},{})[_0x93b5('0x28')](function(){return _0x29e53c;});}else{return _0x29e53c;}})[_0x93b5('0x4e')](function(_0x4e5545){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e5545);throw _0x4e5545;});}return _0x29e53c;})[_0x93b5('0x28')](respondWithResult(_0x320f5f,0xc9))['catch'](handleError(_0x320f5f,null));};exports[_0x93b5('0x27')]=function(_0xbc7280,_0x19723f){if(_0xbc7280[_0x93b5('0x50')]['id']){delete _0xbc7280[_0x93b5('0x50')]['id'];}return db[_0x93b5('0x31')]['find']({'where':{'id':_0xbc7280['params']['id']}})[_0x93b5('0x28')](handleEntityNotFound(_0x19723f,null))[_0x93b5('0x28')](saveUpdates(_0xbc7280[_0x93b5('0x50')],null))['then'](respondWithResult(_0x19723f,null))[_0x93b5('0x4e')](handleError(_0x19723f,null));};exports[_0x93b5('0x29')]=function(_0x39e95e,_0x59e8e5){return db['AnalyticCustomReport'][_0x93b5('0x4d')]({'where':{'id':_0x39e95e[_0x93b5('0x4c')]['id']}})[_0x93b5('0x28')](handleEntityNotFound(_0x59e8e5,null))['then'](removeEntity(_0x59e8e5,null))[_0x93b5('0x4e')](handleError(_0x59e8e5,null));};exports['preview']=function(_0x1bef0d,_0x54eee9){var _0x4c9bee=0xa;var _0x57a456=[_0x93b5('0x59'),_0x93b5('0x5a'),_0x93b5('0x5b'),_0x93b5('0x5c')];var _0x3e19db={'SUM':_0x93b5('0x5d'),'COUNT':_0x93b5('0x5e'),'COUNT DISTINCT':_0x93b5('0x5f'),'MAX':_0x93b5('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x93b5('0x61'),'GROUP_CONCAT ASC':_0x93b5('0x62'),'GROUP_CONCAT DESC':_0x93b5('0x63')};var _0x4860b9={'SEC_TO_TIME':_0x93b5('0x64'),'DATE':_0x93b5('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x93b5('0x66'),'UNIX_TIMESTAMP':_0x93b5('0x67')};var _0x221eff=function(_0x8cf841){return!_[_0x93b5('0x68')]([_0x93b5('0x69'),'IS\x20NOT\x20NULL',_0x93b5('0x6a'),'IS\x20NOT\x20EMPTY'],_0x8cf841);};var _0x52e18d=function(_0x1a98e2){if(!_0x1a98e2||!_0x1a98e2[_0x93b5('0x6b')][_0x93b5('0x3d')]){return'';}for(var _0x2144ce='(',_0x39c7dc=0x0;_0x39c7dc<_0x1a98e2[_0x93b5('0x6b')][_0x93b5('0x3d')];_0x39c7dc+=0x1){_0x39c7dc>0x0&&(_0x2144ce+='\x20'+_0x1a98e2[_0x93b5('0x6c')]+'\x20');_0x2144ce+=_0x1a98e2[_0x93b5('0x6b')][_0x39c7dc]['group']?_0x52e18d(_0x1a98e2[_0x93b5('0x6b')][_0x39c7dc][_0x93b5('0x6d')]):_0x1a98e2['rules'][_0x39c7dc][_0x93b5('0x6e')]+'\x20'+_0x1a98e2[_0x93b5('0x6b')][_0x39c7dc][_0x93b5('0x6f')]+(_0x221eff(_0x1a98e2[_0x93b5('0x6b')][_0x39c7dc]['condition'])?'\x20'+_0x1a98e2[_0x93b5('0x6b')][_0x39c7dc][_0x93b5('0x70')]:'');}return _0x2144ce+')';};var _0x2edb70={'where':{'id':_0x1bef0d[_0x93b5('0x4c')]['id']}},_0x317765,_0x134ec4,_0x5f17fb,_0x41bee6,_0x511a80;_0x2edb70=_[_0x93b5('0x44')]({},_0x2edb70,_0x1bef0d[_0x93b5('0x46')]);return db[_0x93b5('0x31')][_0x93b5('0x4d')](_0x2edb70)[_0x93b5('0x28')](function(_0x65f5c){if(_0x65f5c){_0x317765=_0x65f5c;return _0x65f5c[_0x93b5('0x71')]();}return null;})['then'](function(_0x31d32e){if(_0x31d32e){if(!_0x31d32e[_0x93b5('0x3d')]){throw new db[(_0x93b5('0x72'))][(_0x93b5('0x73'))](_0x93b5('0x74'),0x193);}_0x134ec4=_0x31d32e;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x93b5('0x28')](function(_0x1e2d6a){if(_0x1e2d6a){_0x5f17fb=_['keyBy'](_0x1e2d6a,'id');var _0x53e343;var _0x19859b=squel[_0x93b5('0x75')]();_0x19859b[_0x93b5('0x76')](_0x317765[_0x93b5('0x77')]);for(var _0x2dff8c=0x0;_0x2dff8c<_0x134ec4['length'];_0x2dff8c+=0x1){_0x53e343=_0x134ec4[_0x2dff8c][_0x93b5('0x78')]?_0x5f17fb[_0x134ec4[_0x2dff8c][_0x93b5('0x78')]]['metric']:_0x134ec4[_0x2dff8c][_0x93b5('0x6e')];_0x53e343=_0x134ec4[_0x2dff8c][_0x93b5('0x79')]?_['replace'](_0x3e19db[_0x134ec4[_0x2dff8c][_0x93b5('0x79')]],'%s',_0x53e343):_0x53e343;_0x53e343=_0x134ec4[_0x2dff8c][_0x93b5('0x7a')]?_[_0x93b5('0x7b')](_0x4860b9[_0x134ec4[_0x2dff8c][_0x93b5('0x7a')]],'%s',_0x53e343):_0x53e343;if(_0x134ec4[_0x2dff8c][_0x93b5('0x7c')]){_0x19859b[_0x93b5('0x6d')](_0x53e343);}_0x134ec4[_0x2dff8c][_0x93b5('0x7d')]&&_0x19859b[_0x93b5('0x7e')](_0x53e343,_0x134ec4[_0x2dff8c][_0x93b5('0x7d')]===_0x93b5('0x7f')?![]:!![]);_0x19859b[_0x93b5('0x6e')](_0x53e343,_0x134ec4[_0x2dff8c][_0x93b5('0x80')]||_0x53e343);}if(_0x317765['joins']){_0x317765[_0x93b5('0x81')]=JSON[_0x93b5('0x82')](_0x317765[_0x93b5('0x81')]);for(var _0x23b987=0x0;_0x23b987<_0x317765[_0x93b5('0x81')][_0x93b5('0x3d')];_0x23b987+=0x1){if(_0x317765[_0x93b5('0x81')][_0x23b987]['type']&&_[_0x93b5('0x68')](_0x57a456,_0x317765[_0x93b5('0x81')][_0x23b987]['type'])&&_0x317765[_0x93b5('0x81')][_0x23b987][_0x93b5('0x83')]&&_0x317765[_0x93b5('0x81')][_0x23b987][_0x93b5('0x84')]&&_0x317765[_0x93b5('0x81')][_0x23b987][_0x93b5('0x85')]){_0x19859b[_0x317765[_0x93b5('0x81')][_0x23b987][_0x93b5('0x34')]](_0x317765[_0x93b5('0x81')][_0x23b987][_0x93b5('0x84')],null,util[_0x93b5('0x7a')](_0x93b5('0x86'),_0x317765[_0x93b5('0x77')],_0x317765[_0x93b5('0x81')][_0x23b987][_0x93b5('0x83')],_0x317765[_0x93b5('0x81')][_0x23b987][_0x93b5('0x84')],_0x317765[_0x93b5('0x81')][_0x23b987][_0x93b5('0x85')]));}}}if(_0x317765['conditions']){_0x317765[_0x93b5('0x87')]=JSON['parse'](_0x317765[_0x93b5('0x87')]);_0x19859b[_0x93b5('0x43')](_0x52e18d(_0x317765['conditions']['group']));}_0x511a80=_0x19859b[_0x93b5('0x88')]();_0x19859b[_0x93b5('0x1f')](_0x4c9bee);_0x19859b[_0x93b5('0x1d')](0x0);logger['debug'](_0x93b5('0x89'),_0x19859b[_0x93b5('0x8a')]());return dbH[_0x93b5('0x8b')][_0x93b5('0x36')](_0x19859b[_0x93b5('0x8a')](),{'type':dbH[_0x93b5('0x8b')][_0x93b5('0x8c')][_0x93b5('0x8d')]});}})[_0x93b5('0x28')](respondWithResult(_0x54eee9,null))['catch'](handleError(_0x54eee9,null));};function runReport(_0x46dff8,_0x301836,_0x150414){var _0x3e88cd=_0x301836[_0x93b5('0x2e')];var _0x172991=0xa;var _0x4b2b68=[_0x93b5('0x59'),_0x93b5('0x5a'),'right_join',_0x93b5('0x5c')];var _0x2656c5={'SUM':_0x93b5('0x5d'),'COUNT':_0x93b5('0x5e'),'COUNT DISTINCT':_0x93b5('0x5f'),'MAX':'MAX(%s)','MIN':_0x93b5('0x8e'),'AVG':_0x93b5('0x8f'),'GROUP_CONCAT':_0x93b5('0x61'),'GROUP_CONCAT ASC':_0x93b5('0x62'),'GROUP_CONCAT DESC':_0x93b5('0x63')};var _0x2a9f92={'SEC_TO_TIME':_0x93b5('0x64'),'DATE':_0x93b5('0x65'),'HOUR':_0x93b5('0x90'),'ROUND':_0x93b5('0x66'),'UNIX_TIMESTAMP':_0x93b5('0x67')};var _0x13db8c=function(_0x55ff62){return!_['includes']([_0x93b5('0x69'),_0x93b5('0x91'),'IS\x20EMPTY',_0x93b5('0x92')],_0x55ff62);};var _0x501c84=function(_0x14e471){if(!_0x14e471||!_0x14e471[_0x93b5('0x6b')][_0x93b5('0x3d')]){return'';}for(var _0x493947='(',_0xe7ded0=0x0;_0xe7ded0<_0x14e471['rules'][_0x93b5('0x3d')];_0xe7ded0+=0x1){_0xe7ded0>0x0&&(_0x493947+='\x20'+_0x14e471[_0x93b5('0x6c')]+'\x20');_0x493947+=_0x14e471[_0x93b5('0x6b')][_0xe7ded0][_0x93b5('0x6d')]?_0x501c84(_0x14e471[_0x93b5('0x6b')][_0xe7ded0][_0x93b5('0x6d')]):_0x14e471[_0x93b5('0x6b')][_0xe7ded0][_0x93b5('0x6e')]+'\x20'+_0x14e471[_0x93b5('0x6b')][_0xe7ded0][_0x93b5('0x6f')]+(_0x13db8c(_0x14e471[_0x93b5('0x6b')][_0xe7ded0]['condition'])?'\x20'+_0x14e471[_0x93b5('0x6b')][_0xe7ded0]['value']:'');}return _0x493947+')';};var _0x2cc5d4={'where':{'id':_0x46dff8['id']}},_0x1c10c3,_0x52e1b2,_0x213046,_0x2a0c9d,_0x337e1a;_0x2cc5d4=_[_0x93b5('0x44')]({},_0x2cc5d4,_0x150414);return db[_0x93b5('0x31')]['find'](_0x2cc5d4)[_0x93b5('0x28')](function(_0x3ff5e3){if(_0x3ff5e3){_0x1c10c3=_0x3ff5e3;return _0x3ff5e3[_0x93b5('0x71')]();}return null;})[_0x93b5('0x28')](function(_0x5464b0){if(_0x5464b0){if(!_0x5464b0['length']){throw new db[(_0x93b5('0x72'))][(_0x93b5('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x52e1b2=_0x5464b0;return db[_0x93b5('0x93')][_0x93b5('0x49')]({'raw':!![]});}return null;})[_0x93b5('0x28')](function(_0x40ce9e){if(_0x40ce9e){_0x213046=_[_0x93b5('0x94')](_0x40ce9e,'id');var _0x108cf0;var _0x583e1a=squel['select']();_0x583e1a['from'](_0x1c10c3[_0x93b5('0x77')]);for(var _0x3b0add=0x0;_0x3b0add<_0x52e1b2[_0x93b5('0x3d')];_0x3b0add+=0x1){_0x108cf0=_0x52e1b2[_0x3b0add][_0x93b5('0x78')]?_0x213046[_0x52e1b2[_0x3b0add]['MetricId']][_0x93b5('0x95')]:_0x52e1b2[_0x3b0add][_0x93b5('0x6e')];_0x108cf0=_0x52e1b2[_0x3b0add]['function']?_[_0x93b5('0x7b')](_0x2656c5[_0x52e1b2[_0x3b0add][_0x93b5('0x79')]],'%s',_0x108cf0):_0x108cf0;_0x108cf0=_0x52e1b2[_0x3b0add][_0x93b5('0x7a')]?_[_0x93b5('0x7b')](_0x2a9f92[_0x52e1b2[_0x3b0add][_0x93b5('0x7a')]],'%s',_0x108cf0):_0x108cf0;if(_0x52e1b2[_0x3b0add][_0x93b5('0x7c')]){_0x583e1a['group'](_0x108cf0);}_0x52e1b2[_0x3b0add][_0x93b5('0x7d')]&&_0x583e1a[_0x93b5('0x7e')](_0x108cf0,_0x52e1b2[_0x3b0add][_0x93b5('0x7d')]===_0x93b5('0x7f')?![]:!![]);_0x583e1a[_0x93b5('0x6e')](_0x108cf0,_0x52e1b2[_0x3b0add]['alias']||_0x108cf0);}if(_0x1c10c3['joins']){_0x1c10c3[_0x93b5('0x81')]=JSON[_0x93b5('0x82')](_0x1c10c3[_0x93b5('0x81')]);for(var _0xa9b356=0x0;_0xa9b356<_0x1c10c3['joins'][_0x93b5('0x3d')];_0xa9b356+=0x1){if(_0x1c10c3[_0x93b5('0x81')][_0xa9b356][_0x93b5('0x34')]&&_[_0x93b5('0x68')](_0x4b2b68,_0x1c10c3[_0x93b5('0x81')][_0xa9b356][_0x93b5('0x34')])&&_0x1c10c3[_0x93b5('0x81')][_0xa9b356]['parentKey']&&_0x1c10c3[_0x93b5('0x81')][_0xa9b356][_0x93b5('0x84')]&&_0x1c10c3[_0x93b5('0x81')][_0xa9b356]['foreignKey']){_0x583e1a[_0x1c10c3[_0x93b5('0x81')][_0xa9b356]['type']](_0x1c10c3['joins'][_0xa9b356][_0x93b5('0x84')],null,util[_0x93b5('0x7a')](_0x93b5('0x86'),_0x1c10c3['table'],_0x1c10c3['joins'][_0xa9b356][_0x93b5('0x83')],_0x1c10c3[_0x93b5('0x81')][_0xa9b356][_0x93b5('0x84')],_0x1c10c3['joins'][_0xa9b356][_0x93b5('0x85')]));}}}if(_0x1c10c3['conditions']){_0x1c10c3['conditions']=JSON['parse'](_0x1c10c3['conditions']);_0x583e1a[_0x93b5('0x43')](_0x501c84(_0x1c10c3['conditions'][_0x93b5('0x6d')]));}_0x337e1a=_0x583e1a[_0x93b5('0x88')]();_0x583e1a[_0x93b5('0x1f')](_0x172991);_0x583e1a[_0x93b5('0x1d')](0x0);return;}})[_0x93b5('0x28')](function(){if(_0x301836[_0x93b5('0x96')]===_0x93b5('0x97')){return null;}var _0x38bdb2=_['merge'](_0x301836,{'name':_0x301836[_0x93b5('0x98')]||_0x301836['name']||_0x1c10c3[_0x93b5('0x2e')],'basename':_0x3e88cd,'savename':util[_0x93b5('0x7a')](_0x93b5('0x99'),_0x301836[_0x93b5('0x2e')]||_0x1c10c3[_0x93b5('0x2e')],require(_0x93b5('0x9a'))[_0x93b5('0x9b')](0x4),_0x301836[_0x93b5('0x96')]||_0x93b5('0x9c')),'reportId':_0x1c10c3['id'],'reportType':_0x93b5('0x9d')});return db['AnalyticExtractedReport'][_0x93b5('0x4f')](_0x38bdb2,{'raw':!![]});})[_0x93b5('0x28')](function(_0x7a2b31){if(_0x1c10c3[_0x93b5('0x77')]===_0x93b5('0x9e')){_0x337e1a['where'](_0x1c10c3[_0x93b5('0x77')]+_0x93b5('0x9f'),_0x301836['startDate'],_0x301836[_0x93b5('0xa0')]);}else{_0x337e1a[_0x93b5('0x43')](_0x1c10c3[_0x93b5('0x77')]+_0x93b5('0xa1'),_0x301836[_0x93b5('0xa2')],_0x301836['endDate']);}if(_0x7a2b31){logger[_0x93b5('0xa3')](_0x93b5('0xa4'),_0x337e1a[_0x93b5('0x8a')]());require('child_process')[_0x93b5('0xa5')](path['join'](__dirname,'../../components/export/',_0x7a2b31[_0x93b5('0x96')]),[_0x7a2b31['id'],_0x337e1a[_0x93b5('0x8a')](),path[_0x93b5('0x59')](__dirname,_0x93b5('0xa6'),_0x7a2b31[_0x93b5('0xa7')]),_0x3e88cd]);return _0x7a2b31;}else{var _0x3db7bf=squel[_0x93b5('0x75')]();_0x3db7bf[_0x93b5('0x76')]('('+_0x337e1a[_0x93b5('0x8a')]()+')',_0x93b5('0xa8'));_0x3db7bf[_0x93b5('0x6e')](_0x93b5('0xa9'),_0x93b5('0x20'));_0x337e1a[_0x93b5('0x1f')](_0x301836[_0x93b5('0x1f')]||_0x172991);_0x337e1a[_0x93b5('0x1d')](_0x301836['offset']||0x0);return dbH[_0x93b5('0x8b')][_0x93b5('0x36')](_0x3db7bf[_0x93b5('0x8a')](),{'type':dbH[_0x93b5('0x8b')]['QueryTypes'][_0x93b5('0x8d')]})['then'](function(_0x1d1818){if(!_0x1d1818['length']){_0x2a0c9d=0x0;}else{_0x2a0c9d=_0x1d1818[0x0]['count']||0x0;}return dbH[_0x93b5('0x8b')]['query'](_0x337e1a[_0x93b5('0x8a')](),{'type':dbH[_0x93b5('0x8b')]['QueryTypes'][_0x93b5('0x8d')]});})[_0x93b5('0x28')](function(_0x16c3bb){return{'rows':_0x16c3bb||[],'count':_0x2a0c9d};});}});}exports[_0x93b5('0xaa')]=function(_0x244db0,_0x2d78d5){return runReport(_0x244db0[_0x93b5('0x4c')],_0x244db0[_0x93b5('0x36')],_0x244db0[_0x93b5('0x46')])[_0x93b5('0x28')](respondWithResult(_0x2d78d5,null))[_0x93b5('0x4e')](handleError(_0x2d78d5,null));};exports[_0x93b5('0xab')]=runReport;exports[_0x93b5('0x36')]=function(_0x329198,_0x383800){var _0x3daeb1=0xa;var _0x2e86d=[_0x93b5('0x59'),_0x93b5('0x5a'),_0x93b5('0x5b'),_0x93b5('0x5c')];var _0xeee052={'SUM':_0x93b5('0x5d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x93b5('0x5f'),'MAX':_0x93b5('0x60'),'MIN':_0x93b5('0x8e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x93b5('0x61'),'GROUP_CONCAT ASC':_0x93b5('0x62'),'GROUP_CONCAT DESC':_0x93b5('0x63')};var _0x424e3a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x93b5('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x93b5('0x66'),'UNIX_TIMESTAMP':_0x93b5('0x67')};var _0x1c73e0=function(_0x1151b7){return!_[_0x93b5('0x68')](['IS\x20NULL',_0x93b5('0x91'),_0x93b5('0x6a'),_0x93b5('0x92')],_0x1151b7);};var _0x3b5be6=function(_0x207976){if(!_0x207976||!_0x207976[_0x93b5('0x6b')][_0x93b5('0x3d')]){return'';}for(var _0x34e34d='(',_0x17f4b3=0x0;_0x17f4b3<_0x207976[_0x93b5('0x6b')][_0x93b5('0x3d')];_0x17f4b3+=0x1){_0x17f4b3>0x0&&(_0x34e34d+='\x20'+_0x207976[_0x93b5('0x6c')]+'\x20');_0x34e34d+=_0x207976[_0x93b5('0x6b')][_0x17f4b3][_0x93b5('0x6d')]?_0x3b5be6(_0x207976[_0x93b5('0x6b')][_0x17f4b3][_0x93b5('0x6d')]):_0x207976[_0x93b5('0x6b')][_0x17f4b3]['field']+'\x20'+_0x207976[_0x93b5('0x6b')][_0x17f4b3]['condition']+(_0x1c73e0(_0x207976[_0x93b5('0x6b')][_0x17f4b3][_0x93b5('0x6f')])?'\x20'+_0x207976['rules'][_0x17f4b3][_0x93b5('0x70')]:'');}return _0x34e34d+')';};var _0x43a564={'where':{'id':_0x329198[_0x93b5('0x4c')]['id']}},_0x40265e,_0x307ecf,_0x524d19,_0x15dfcf,_0x362d3d;_0x43a564=_[_0x93b5('0x44')]({},_0x43a564,_0x329198[_0x93b5('0x46')]);return db[_0x93b5('0x31')][_0x93b5('0x4d')](_0x43a564)[_0x93b5('0x28')](function(_0x4024b9){if(_0x4024b9){_0x40265e=_0x4024b9;return _0x4024b9[_0x93b5('0x71')]();}return null;})['then'](function(_0x35c350){if(_0x35c350){if(!_0x35c350[_0x93b5('0x3d')]){throw new db[(_0x93b5('0x72'))][(_0x93b5('0x73'))](_0x93b5('0x74'),0x193);}_0x307ecf=_0x35c350;return db[_0x93b5('0x93')][_0x93b5('0x49')]({'raw':!![]});}return null;})[_0x93b5('0x28')](function(_0x14217b){if(_0x14217b){_0x524d19=_[_0x93b5('0x94')](_0x14217b,'id');var _0x2213c7;var _0x6d5b16=squel[_0x93b5('0x75')]();_0x6d5b16['from'](_0x40265e[_0x93b5('0x77')]);for(var _0x1f5cdd=0x0;_0x1f5cdd<_0x307ecf[_0x93b5('0x3d')];_0x1f5cdd+=0x1){_0x2213c7=_0x307ecf[_0x1f5cdd][_0x93b5('0x78')]?_0x524d19[_0x307ecf[_0x1f5cdd][_0x93b5('0x78')]]['metric']:_0x307ecf[_0x1f5cdd][_0x93b5('0x6e')];_0x2213c7=_0x307ecf[_0x1f5cdd][_0x93b5('0x79')]?_[_0x93b5('0x7b')](_0xeee052[_0x307ecf[_0x1f5cdd][_0x93b5('0x79')]],'%s',_0x2213c7):_0x2213c7;_0x2213c7=_0x307ecf[_0x1f5cdd][_0x93b5('0x7a')]?_[_0x93b5('0x7b')](_0x424e3a[_0x307ecf[_0x1f5cdd][_0x93b5('0x7a')]],'%s',_0x2213c7):_0x2213c7;if(_0x307ecf[_0x1f5cdd][_0x93b5('0x7c')]){_0x6d5b16[_0x93b5('0x6d')](_0x2213c7);}_0x307ecf[_0x1f5cdd]['orderBy']&&_0x6d5b16['order'](_0x2213c7,_0x307ecf[_0x1f5cdd][_0x93b5('0x7d')]===_0x93b5('0x7f')?![]:!![]);_0x6d5b16[_0x93b5('0x6e')](_0x2213c7,_0x307ecf[_0x1f5cdd][_0x93b5('0x80')]||_0x2213c7);}if(_0x40265e[_0x93b5('0x81')]){_0x40265e['joins']=JSON['parse'](_0x40265e['joins']);for(var _0x19aa40=0x0;_0x19aa40<_0x40265e['joins'][_0x93b5('0x3d')];_0x19aa40+=0x1){if(_0x40265e['joins'][_0x19aa40][_0x93b5('0x34')]&&_[_0x93b5('0x68')](_0x2e86d,_0x40265e[_0x93b5('0x81')][_0x19aa40][_0x93b5('0x34')])&&_0x40265e['joins'][_0x19aa40][_0x93b5('0x83')]&&_0x40265e[_0x93b5('0x81')][_0x19aa40][_0x93b5('0x84')]&&_0x40265e[_0x93b5('0x81')][_0x19aa40][_0x93b5('0x85')]){_0x6d5b16[_0x40265e[_0x93b5('0x81')][_0x19aa40][_0x93b5('0x34')]](_0x40265e[_0x93b5('0x81')][_0x19aa40]['foreignTable'],null,util[_0x93b5('0x7a')](_0x93b5('0x86'),_0x40265e[_0x93b5('0x77')],_0x40265e[_0x93b5('0x81')][_0x19aa40][_0x93b5('0x83')],_0x40265e[_0x93b5('0x81')][_0x19aa40][_0x93b5('0x84')],_0x40265e[_0x93b5('0x81')][_0x19aa40][_0x93b5('0x85')]));}}}if(_0x40265e[_0x93b5('0x87')]){_0x40265e['conditions']=JSON['parse'](_0x40265e[_0x93b5('0x87')]);_0x6d5b16[_0x93b5('0x43')](_0x3b5be6(_0x40265e[_0x93b5('0x87')][_0x93b5('0x6d')]));}_0x362d3d=_0x6d5b16[_0x93b5('0x88')]();_0x6d5b16[_0x93b5('0x1f')](_0x3daeb1);_0x6d5b16['offset'](0x0);logger[_0x93b5('0xac')](_0x93b5('0x89'),_0x6d5b16[_0x93b5('0x8a')]());return dbH[_0x93b5('0x8b')][_0x93b5('0x36')](_0x6d5b16[_0x93b5('0x8a')](),{'type':dbH[_0x93b5('0x8b')][_0x93b5('0x8c')][_0x93b5('0x8d')]});}})[_0x93b5('0x28')](function(){return{'sql':_0x362d3d[_0x93b5('0x8a')]()};})['then'](respondWithResult(_0x383800,null))['catch'](handleError(_0x383800,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index ea0c98c..7c13900 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 _0xd03c=['path','../../config/environment','lodash','util','api','moment','bluebird','request-promise'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd03c,0x1ba));var _0xcd03=function(_0x1ae842,_0x5b39b8){_0x1ae842=_0x1ae842-0x0;var _0x128131=_0xd03c[_0x1ae842];return _0x128131;};'use strict';var _=require(_0xcd03('0x0'));var util=require(_0xcd03('0x1'));var logger=require('../../config/logger')(_0xcd03('0x2'));var moment=require(_0xcd03('0x3'));var BPromise=require(_0xcd03('0x4'));var rp=require(_0xcd03('0x5'));var fs=require('fs');var path=require(_0xcd03('0x6'));var rimraf=require('rimraf');var config=require(_0xcd03('0x7'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x589bad,_0x22510d){return _0x589bad['define']('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x61ae=['path','rimraf','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger','api','moment'];(function(_0xdfc402,_0x3f1811){var _0x4c6a10=function(_0xbb756){while(--_0xbb756){_0xdfc402['push'](_0xdfc402['shift']());}};_0x4c6a10(++_0x3f1811);}(_0x61ae,0x1d4));var _0xe61a=function(_0x413727,_0x17adb1){_0x413727=_0x413727-0x0;var _0x5f46d7=_0x61ae[_0x413727];return _0x5f46d7;};'use strict';var _=require(_0xe61a('0x0'));var util=require(_0xe61a('0x1'));var logger=require(_0xe61a('0x2'))(_0xe61a('0x3'));var moment=require(_0xe61a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe61a('0x5'));var rimraf=require(_0xe61a('0x6'));var config=require('../../config/environment');var attributes=require(_0xe61a('0x7'));module[_0xe61a('0x8')]=function(_0x46c136,_0x15880e){return _0x46c136[_0xe61a('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0xe61a('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 022a8eb..493c6bc 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 _0xce84=['../../config/logger','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x15d55c,_0xb356c1){var _0x53157b=function(_0x1b0274){while(--_0x1b0274){_0x15d55c['push'](_0x15d55c['shift']());}};_0x53157b(++_0xb356c1);}(_0xce84,0x14e));var _0x4ce8=function(_0xc2b0e0,_0x223cae){_0xc2b0e0=_0xc2b0e0-0x0;var _0xa6e0f6=_0xce84[_0xc2b0e0];return _0xa6e0f6;};'use strict';var _=require(_0x4ce8('0x0'));var util=require(_0x4ce8('0x1'));var moment=require(_0x4ce8('0x2'));var BPromise=require('bluebird');var rs=require(_0x4ce8('0x3'));var fs=require('fs');var Redis=require(_0x4ce8('0x4'));var db=require(_0x4ce8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4ce8('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4ce8('0x7'));var client=jayson[_0x4ce8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fcc0d,_0x1b4fc5,_0xc937c4){return new BPromise(function(_0x451690,_0x26be84){return client[_0x4ce8('0x9')](_0x1fcc0d,_0xc937c4)[_0x4ce8('0xa')](function(_0x5043c0){logger[_0x4ce8('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1b4fc5,_0x4ce8('0xc'));logger[_0x4ce8('0xd')](_0x4ce8('0xe'),_0x1b4fc5,'request\x20sent',JSON[_0x4ce8('0xf')](_0x5043c0));if(_0x5043c0['error']){if(_0x5043c0[_0x4ce8('0x10')]['code']===0x1f4){logger[_0x4ce8('0x10')](_0x4ce8('0x11'),_0x1b4fc5,_0x5043c0[_0x4ce8('0x10')][_0x4ce8('0x12')]);return _0x26be84(_0x5043c0[_0x4ce8('0x10')][_0x4ce8('0x12')]);}logger['error'](_0x4ce8('0x11'),_0x1b4fc5,_0x5043c0['error'][_0x4ce8('0x12')]);return _0x451690(_0x5043c0[_0x4ce8('0x10')][_0x4ce8('0x12')]);}else{logger[_0x4ce8('0xb')](_0x4ce8('0x11'),_0x1b4fc5,_0x4ce8('0xc'));_0x451690(_0x5043c0[_0x4ce8('0x13')]['message']);}})['catch'](function(_0x584b11){logger[_0x4ce8('0x10')](_0x4ce8('0x11'),_0x1b4fc5,_0x584b11);_0x26be84(_0x584b11);});});}
\ No newline at end of file
+var _0x54e6=['message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','info','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x4ff876,_0x293d17){var _0x118ef3=function(_0x327708){while(--_0x327708){_0x4ff876['push'](_0x4ff876['shift']());}};_0x118ef3(++_0x293d17);}(_0x54e6,0x1b3));var _0x654e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x54e6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x654e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x654e('0x1'));var rs=require(_0x654e('0x2'));var fs=require('fs');var Redis=require(_0x654e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x654e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x654e('0x5'));var jayson=require(_0x654e('0x6'));var client=jayson['client'][_0x654e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d0ba3,_0xc42c4f,_0x238d99){return new BPromise(function(_0x3f4904,_0x401e3d){return client['request'](_0x2d0ba3,_0x238d99)['then'](function(_0x9db266){logger[_0x654e('0x8')]('AnalyticCustomReport,\x20%s,\x20%s',_0xc42c4f,_0x654e('0x9'));logger['debug'](_0x654e('0xa'),_0xc42c4f,_0x654e('0x9'),JSON['stringify'](_0x9db266));if(_0x9db266[_0x654e('0xb')]){if(_0x9db266['error']['code']===0x1f4){logger[_0x654e('0xb')](_0x654e('0xc'),_0xc42c4f,_0x9db266['error'][_0x654e('0xd')]);return _0x401e3d(_0x9db266[_0x654e('0xb')]['message']);}logger[_0x654e('0xb')](_0x654e('0xc'),_0xc42c4f,_0x9db266[_0x654e('0xb')][_0x654e('0xd')]);return _0x3f4904(_0x9db266[_0x654e('0xb')][_0x654e('0xd')]);}else{logger[_0x654e('0x8')](_0x654e('0xc'),_0xc42c4f,_0x654e('0x9'));_0x3f4904(_0x9db266[_0x654e('0xe')][_0x654e('0xd')]);}})[_0x654e('0xf')](function(_0x53efc7){logger[_0x654e('0xb')](_0x654e('0xc'),_0xc42c4f,_0x53efc7);_0x401e3d(_0x53efc7);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 9983be7..cee6bc3 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 _0xa3ff=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','update','destroy','exports','multer'];(function(_0x1ef4ac,_0x42e47a){var _0x37c6e8=function(_0x7c322c){while(--_0x7c322c){_0x1ef4ac['push'](_0x1ef4ac['shift']());}};_0x37c6e8(++_0x42e47a);}(_0xa3ff,0x15f));var _0xfa3f=function(_0x231cd1,_0x3943d1){_0x231cd1=_0x231cd1-0x0;var _0x10d942=_0xa3ff[_0x231cd1];return _0x10d942;};'use strict';var multer=require(_0xfa3f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfa3f('0x1'));var express=require(_0xfa3f('0x2'));var router=express['Router']();var fs_extra=require(_0xfa3f('0x3'));var auth=require(_0xfa3f('0x4'));var interaction=require(_0xfa3f('0x5'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0xfa3f('0x6')](),controller[_0xfa3f('0x7')]);router[_0xfa3f('0x8')](_0xfa3f('0x9'),auth[_0xfa3f('0x6')](),controller[_0xfa3f('0xa')]);router['get'](_0xfa3f('0xb'),auth[_0xfa3f('0x6')](),controller[_0xfa3f('0xc')]);router[_0xfa3f('0x8')](_0xfa3f('0xd'),auth[_0xfa3f('0x6')](),controller[_0xfa3f('0xe')]);router[_0xfa3f('0x8')](_0xfa3f('0xf'),auth['isAuthenticated'](),controller[_0xfa3f('0x10')]);router['post']('/',auth[_0xfa3f('0x6')](),controller[_0xfa3f('0x11')]);router[_0xfa3f('0x12')](_0xfa3f('0x9'),auth[_0xfa3f('0x6')](),controller[_0xfa3f('0x13')]);router['delete'](_0xfa3f('0x9'),auth[_0xfa3f('0x6')](),controller[_0xfa3f('0x14')]);module[_0xfa3f('0x15')]=router;
\ No newline at end of file
+var _0xc591=['get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','query','post','create','update','delete','/:id','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller'];(function(_0x30a88a,_0x1c0c9f){var _0x3282e=function(_0x52b2a8){while(--_0x52b2a8){_0x30a88a['push'](_0x30a88a['shift']());}};_0x3282e(++_0x1c0c9f);}(_0xc591,0x1d2));var _0x1c59=function(_0x2cbc82,_0x30d15a){_0x2cbc82=_0x2cbc82-0x0;var _0x222f31=_0xc591[_0x2cbc82];return _0x222f31;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1c59('0x0'));var timeout=require(_0x1c59('0x1'));var express=require(_0x1c59('0x2'));var router=express[_0x1c59('0x3')]();var fs_extra=require(_0x1c59('0x4'));var auth=require(_0x1c59('0x5'));var interaction=require(_0x1c59('0x6'));var config=require(_0x1c59('0x7'));var controller=require(_0x1c59('0x8'));router[_0x1c59('0x9')]('/',auth[_0x1c59('0xa')](),controller[_0x1c59('0xb')]);router[_0x1c59('0x9')]('/:id',auth[_0x1c59('0xa')](),controller[_0x1c59('0xc')]);router['get'](_0x1c59('0xd'),auth[_0x1c59('0xa')](),controller[_0x1c59('0xe')]);router['get'](_0x1c59('0xf'),auth['isAuthenticated'](),controller[_0x1c59('0x10')]);router[_0x1c59('0x9')]('/:id/query',auth[_0x1c59('0xa')](),controller[_0x1c59('0x11')]);router[_0x1c59('0x12')]('/',auth[_0x1c59('0xa')](),controller[_0x1c59('0x13')]);router['put']('/:id',auth[_0x1c59('0xa')](),controller[_0x1c59('0x14')]);router[_0x1c59('0x15')](_0x1c59('0x16'),auth[_0x1c59('0xa')](),controller[_0x1c59('0x17')]);module[_0x1c59('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 75aacb5..a150277 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 _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x2574eb,_0x4bf81c){var _0x2511b7=function(_0x49a99d){while(--_0x49a99d){_0x2574eb['push'](_0x2574eb['shift']());}};_0x2511b7(++_0x4bf81c);}(_0xeff8,0x186));var _0x8eff=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xeff8[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}};
\ No newline at end of file
+var _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x35fb56,_0x5dadff){var _0x2fd52c=function(_0x97bd3f){while(--_0x97bd3f){_0x35fb56['push'](_0x35fb56['shift']());}};_0x2fd52c(++_0x5dadff);}(_0x5075,0x73));var _0x5507=function(_0x2ada6a,_0x49cece){_0x2ada6a=_0x2ada6a-0x0;var _0x42b8fa=_0x5075[_0x2ada6a];return _0x42b8fa;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index a8a50a6..ae5ad9f 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 _0x2542=['getFields','ValidationErrorItem','metric','format','DESC','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','sequelize','SELECT','run','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','save','destroy','then','get','end','error','stack','name','send','index','map','AnalyticDefaultReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','field','replace','function','groupBy','orderBy','alias','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','value'];(function(_0x294bd9,_0x1faea8){var _0xdd5b3f=function(_0xb2df4e){while(--_0xb2df4e){_0x294bd9['push'](_0x294bd9['shift']());}};_0xdd5b3f(++_0x1faea8);}(_0x2542,0x169));var _0x2254=function(_0x37f970,_0x82fb47){_0x37f970=_0x37f970-0x0;var _0x6c0d62=_0x2542[_0x37f970];return _0x6c0d62;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];var dbH=require(_0x2254('0x19'))[_0x2254('0x1a')];function respondWithStatusCode(_0x3c326b,_0x381efe){_0x381efe=_0x381efe||0xcc;return function(_0x592a4f){if(_0x592a4f){return _0x3c326b[_0x2254('0x1b')](_0x381efe);}return _0x3c326b[_0x2254('0x1c')](_0x381efe)['end']();};}function respondWithResult(_0x2f4de,_0x1e582d){_0x1e582d=_0x1e582d||0xc8;return function(_0xfb23cb){if(_0xfb23cb){return _0x2f4de[_0x2254('0x1c')](_0x1e582d)[_0x2254('0x1d')](_0xfb23cb);}};}function respondWithFilteredResult(_0xbc5548,_0x50f137){return function(_0x18baf4){if(_0x18baf4){var _0x57247a=typeof _0x50f137[_0x2254('0x1e')]===_0x2254('0x1f')&&typeof _0x50f137[_0x2254('0x20')]===_0x2254('0x1f');var _0x1ae11e=_0x18baf4[_0x2254('0x21')];var _0x497724=_0x57247a?0x0:_0x50f137['offset'];var _0x5ec98d=_0x57247a?_0x18baf4[_0x2254('0x21')]:_0x50f137[_0x2254('0x1e')]+_0x50f137[_0x2254('0x20')];var _0x1f1163;if(_0x5ec98d>=_0x1ae11e){_0x5ec98d=_0x1ae11e;_0x1f1163=0xc8;}else{_0x1f1163=0xce;}_0xbc5548[_0x2254('0x1c')](_0x1f1163);return _0xbc5548[_0x2254('0x22')]('Content-Range',_0x497724+'-'+_0x5ec98d+'/'+_0x1ae11e)[_0x2254('0x1d')](_0x18baf4);}return null;};}function patchUpdates(_0x16148d){return function(_0x906cde){try{jsonpatch['apply'](_0x906cde,_0x16148d,!![]);}catch(_0x52fedc){return BPromise['reject'](_0x52fedc);}return _0x906cde[_0x2254('0x23')]();};}function saveUpdates(_0x559af4,_0xf88b56){return function(_0x56b91e){if(_0x56b91e){return _0x56b91e['update'](_0x559af4)['then'](function(_0x540020){return _0x540020;});}return null;};}function removeEntity(_0x5e5edb,_0x4f797d){return function(_0x1aa71f){if(_0x1aa71f){return _0x1aa71f[_0x2254('0x24')]()[_0x2254('0x25')](function(){var _0x265467=_0x1aa71f[_0x2254('0x26')]({'plain':!![]});var _0x1349c9='DefaultReports';return db['UserProfileResource'][_0x2254('0x24')]({'where':{'type':_0x1349c9,'resourceId':_0x265467['id']}})['then'](function(){return _0x1aa71f;});})[_0x2254('0x25')](function(){_0x5e5edb[_0x2254('0x1c')](0xcc)[_0x2254('0x27')]();});}};}function handleEntityNotFound(_0x3aa0bd,_0x19043b){return function(_0x482688){if(!_0x482688){_0x3aa0bd[_0x2254('0x1b')](0x194);}return _0x482688;};}function handleError(_0x2a789b,_0x21285d){_0x21285d=_0x21285d||0x1f4;return function(_0x37af8b){logger[_0x2254('0x28')](_0x37af8b[_0x2254('0x29')]);if(_0x37af8b[_0x2254('0x2a')]){delete _0x37af8b[_0x2254('0x2a')];}_0x2a789b[_0x2254('0x1c')](_0x21285d)[_0x2254('0x2b')](_0x37af8b);};}exports[_0x2254('0x2c')]=function(_0xad7774,_0x220f2a){var _0x27d30a={},_0x4577f4={},_0x1b16c8={'count':0x0,'rows':[]};var _0x2c929f=_[_0x2254('0x2d')](db[_0x2254('0x2e')]['rawAttributes'],function(_0xe29526){return{'name':_0xe29526[_0x2254('0x2f')],'type':_0xe29526[_0x2254('0x30')][_0x2254('0x31')]};});_0x4577f4[_0x2254('0x32')]=_[_0x2254('0x2d')](_0x2c929f,_0x2254('0x2a'));_0x4577f4[_0x2254('0x33')]=_[_0x2254('0x34')](_0xad7774['query']);_0x4577f4[_0x2254('0x35')]=_[_0x2254('0x36')](_0x4577f4['model'],_0x4577f4[_0x2254('0x33')]);_0x27d30a[_0x2254('0x37')]=_[_0x2254('0x36')](_0x4577f4[_0x2254('0x32')],qs['fields'](_0xad7774['query'][_0x2254('0x38')]));_0x27d30a['attributes']=_0x27d30a[_0x2254('0x37')][_0x2254('0x39')]?_0x27d30a[_0x2254('0x37')]:_0x4577f4[_0x2254('0x32')];if(!_0xad7774[_0x2254('0x33')][_0x2254('0x3a')](_0x2254('0x3b'))){_0x27d30a['limit']=qs[_0x2254('0x20')](_0xad7774[_0x2254('0x33')][_0x2254('0x20')]);_0x27d30a[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0xad7774[_0x2254('0x33')][_0x2254('0x1e')]);}_0x27d30a[_0x2254('0x3c')]=qs[_0x2254('0x3d')](_0xad7774[_0x2254('0x33')]['sort']);_0x27d30a[_0x2254('0x3e')]=qs[_0x2254('0x35')](_[_0x2254('0x3f')](_0xad7774[_0x2254('0x33')],_0x4577f4['filters']),_0x2c929f);if(_0xad7774[_0x2254('0x33')][_0x2254('0x40')]){_0x27d30a[_0x2254('0x3e')]=_[_0x2254('0x41')](_0x27d30a[_0x2254('0x3e')],{'$or':_[_0x2254('0x2d')](_0x2c929f,function(_0x423377){if(_0x423377[_0x2254('0x30')]!=='VIRTUAL'){var _0x362ad1={};_0x362ad1[_0x423377['name']]={'$like':'%'+_0xad7774[_0x2254('0x33')][_0x2254('0x40')]+'%'};return _0x362ad1;}})});}_0x27d30a=_[_0x2254('0x41')]({},_0x27d30a,_0xad7774[_0x2254('0x42')]);var _0x460bb3={'where':_0x27d30a[_0x2254('0x3e')]};return db[_0x2254('0x2e')]['count'](_0x460bb3)[_0x2254('0x25')](function(_0x2f1ff9){_0x1b16c8[_0x2254('0x21')]=_0x2f1ff9;if(_0xad7774[_0x2254('0x33')][_0x2254('0x43')]){_0x27d30a['include']=[{'all':!![]}];}return db[_0x2254('0x2e')][_0x2254('0x44')](_0x27d30a);})[_0x2254('0x25')](function(_0x135ed8){_0x1b16c8[_0x2254('0x45')]=_0x135ed8;return _0x1b16c8;})['then'](respondWithFilteredResult(_0x220f2a,_0x27d30a))[_0x2254('0x46')](handleError(_0x220f2a,null));};exports['show']=function(_0x91e091,_0x1ded9a){var _0xb4d042={'raw':!![],'where':{'id':_0x91e091[_0x2254('0x47')]['id']}},_0x31c31e={};_0x31c31e[_0x2254('0x32')]=_[_0x2254('0x34')](db[_0x2254('0x2e')][_0x2254('0x48')]);_0x31c31e[_0x2254('0x33')]=_[_0x2254('0x34')](_0x91e091[_0x2254('0x33')]);_0x31c31e[_0x2254('0x35')]=_['intersection'](_0x31c31e[_0x2254('0x32')],_0x31c31e[_0x2254('0x33')]);_0xb4d042[_0x2254('0x37')]=_['intersection'](_0x31c31e[_0x2254('0x32')],qs[_0x2254('0x38')](_0x91e091[_0x2254('0x33')][_0x2254('0x38')]));_0xb4d042[_0x2254('0x37')]=_0xb4d042[_0x2254('0x37')][_0x2254('0x39')]?_0xb4d042[_0x2254('0x37')]:_0x31c31e[_0x2254('0x32')];if(_0x91e091['query'][_0x2254('0x43')]){_0xb4d042[_0x2254('0x49')]=[{'all':!![]}];}_0xb4d042=_[_0x2254('0x41')]({},_0xb4d042,_0x91e091[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0xb4d042)[_0x2254('0x25')](handleEntityNotFound(_0x1ded9a,null))[_0x2254('0x25')](respondWithResult(_0x1ded9a,null))[_0x2254('0x46')](handleError(_0x1ded9a,null));};exports[_0x2254('0x4b')]=function(_0x5b14c5,_0x36b977){return db[_0x2254('0x2e')]['create'](_0x5b14c5[_0x2254('0x4c')],{})[_0x2254('0x25')](function(_0x12e2ff){var _0x4331a9=_0x5b14c5['user'][_0x2254('0x26')]({'plain':!![]});if(!_0x4331a9)throw new Error(_0x2254('0x4d'));if(_0x4331a9['role']===_0x2254('0x4e')){var _0x3f0670=_0x12e2ff[_0x2254('0x26')]({'plain':!![]});var _0x43bb88='Reports';return db[_0x2254('0x4f')][_0x2254('0x4a')]({'where':{'name':_0x43bb88,'userProfileId':_0x4331a9[_0x2254('0x50')]},'raw':!![]})['then'](function(_0x4cc18a){if(_0x4cc18a&&_0x4cc18a[_0x2254('0x51')]===0x0){return db[_0x2254('0x52')]['create']({'name':_0x3f0670[_0x2254('0x2a')],'resourceId':_0x3f0670['id'],'type':'DefaultReports','sectionId':_0x4cc18a['id']},{})['then'](function(){return _0x12e2ff;});}else{return _0x12e2ff;}})[_0x2254('0x46')](function(_0x135962){logger[_0x2254('0x28')](_0x2254('0x53'),_0x135962);throw _0x135962;});}return _0x12e2ff;})[_0x2254('0x25')](respondWithResult(_0x36b977,0xc9))['catch'](handleError(_0x36b977,null));};exports['update']=function(_0x1bd988,_0x5e3fbc){if(_0x1bd988[_0x2254('0x4c')]['id']){delete _0x1bd988[_0x2254('0x4c')]['id'];}return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x1bd988['params']['id']}})[_0x2254('0x25')](handleEntityNotFound(_0x5e3fbc,null))[_0x2254('0x25')](saveUpdates(_0x1bd988['body'],null))['then'](respondWithResult(_0x5e3fbc,null))[_0x2254('0x46')](handleError(_0x5e3fbc,null));};exports['destroy']=function(_0x2cc59c,_0x305ace){return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x2cc59c[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x305ace,null))['then'](removeEntity(_0x305ace,null))[_0x2254('0x46')](handleError(_0x305ace,null));};exports['preview']=function(_0x335c66,_0x510fe0){var _0x4da493=0xa;var _0x5999c8=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x13606e={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':_0x2254('0x5b'),'MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f391d={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x329378=function(_0xae171c){return!_[_0x2254('0x65')]([_0x2254('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x2254('0x67')],_0xae171c);};var _0x423c17=function(_0x1d73a3){if(!_0x1d73a3||!_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x53b55b='(',_0x45b7bd=0x0;_0x45b7bd<_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')];_0x45b7bd+=0x1){_0x45b7bd>0x0&&(_0x53b55b+='\x20'+_0x1d73a3['operator']+'\x20');_0x53b55b+=_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]?_0x423c17(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]):_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['field']+'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd][_0x2254('0x6a')]+(_0x329378(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x6a')])?'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['value']:'');}return _0x53b55b+')';};var _0x5cc6bd={'where':{'id':_0x335c66['params']['id']}},_0xde4e7,_0xa159a4,_0x486b82,_0x506d95,_0x48406e;_0x5cc6bd=_[_0x2254('0x41')]({},_0x5cc6bd,_0x335c66['options']);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x5cc6bd)[_0x2254('0x25')](function(_0x1ed6b9){if(_0x1ed6b9){_0xde4e7=_0x1ed6b9;return _0x1ed6b9['getFields']();}return null;})[_0x2254('0x25')](function(_0x5ecf82){if(_0x5ecf82){if(!_0x5ecf82[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xa159a4=_0x5ecf82;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x3b3b20){if(_0x3b3b20){_0x486b82=_[_0x2254('0x6e')](_0x3b3b20,'id');var _0x3cefbe;var _0x4f77e5=squel[_0x2254('0x6f')]();_0x4f77e5[_0x2254('0x70')](_0xde4e7['table']);for(var _0x1ac8ff=0x0;_0x1ac8ff<_0xa159a4[_0x2254('0x39')];_0x1ac8ff+=0x1){_0x3cefbe=_0xa159a4[_0x1ac8ff]['MetricId']?_0x486b82[_0xa159a4[_0x1ac8ff][_0x2254('0x71')]]['metric']:_0xa159a4[_0x1ac8ff][_0x2254('0x72')];_0x3cefbe=_0xa159a4[_0x1ac8ff]['function']?_[_0x2254('0x73')](_0x13606e[_0xa159a4[_0x1ac8ff][_0x2254('0x74')]],'%s',_0x3cefbe):_0x3cefbe;_0x3cefbe=_0xa159a4[_0x1ac8ff]['format']?_[_0x2254('0x73')](_0x2f391d[_0xa159a4[_0x1ac8ff]['format']],'%s',_0x3cefbe):_0x3cefbe;if(_0xa159a4[_0x1ac8ff][_0x2254('0x75')]){_0x4f77e5[_0x2254('0x69')](_0x3cefbe);}_0xa159a4[_0x1ac8ff][_0x2254('0x76')]&&_0x4f77e5['order'](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x76')]==='DESC'?![]:!![]);_0x4f77e5[_0x2254('0x72')](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x77')]||_0x3cefbe);}if(_0xde4e7['joins']){_0xde4e7['joins']=JSON[_0x2254('0x78')](_0xde4e7[_0x2254('0x79')]);for(var _0x451520=0x0;_0x451520<_0xde4e7[_0x2254('0x79')]['length'];_0x451520+=0x1){if(_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x5999c8,_0xde4e7[_0x2254('0x79')][_0x451520]['type'])&&_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7a')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7b')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7c')]){_0x4f77e5[_0xde4e7['joins'][_0x451520]['type']](_0xde4e7['joins'][_0x451520][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0xde4e7[_0x2254('0x7e')],_0xde4e7['joins'][_0x451520][_0x2254('0x7a')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7b')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7c')]));}}}if(_0xde4e7[_0x2254('0x7f')]){_0xde4e7['conditions']=JSON['parse'](_0xde4e7[_0x2254('0x7f')]);_0x4f77e5[_0x2254('0x3e')](_0x423c17(_0xde4e7[_0x2254('0x7f')][_0x2254('0x69')]));}_0x48406e=_0x4f77e5[_0x2254('0x80')]();_0x4f77e5[_0x2254('0x20')](_0x4da493);_0x4f77e5[_0x2254('0x1e')](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4f77e5[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4f77e5[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')]['SELECT']});}})[_0x2254('0x25')](respondWithResult(_0x510fe0,null))[_0x2254('0x46')](handleError(_0x510fe0,null));};function runReport(_0x4dfcb4,_0x1c317b,_0x4e699c){var _0x2ad519=_0x1c317b[_0x2254('0x2a')];var _0x30f2c9=0xa;var _0x1f7a48=['join',_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x3a8d4f={'SUM':'SUM(%s)','COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f3650={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x251d70=function(_0x2c7705){return!_['includes']([_0x2254('0x66'),'IS\x20NOT\x20NULL',_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x2c7705);};var _0x36d121=function(_0x207a09){if(!_0x207a09||!_0x207a09[_0x2254('0x68')]['length']){return'';}for(var _0x8a3656='(',_0x1554f1=0x0;_0x1554f1<_0x207a09[_0x2254('0x68')][_0x2254('0x39')];_0x1554f1+=0x1){_0x1554f1>0x0&&(_0x8a3656+='\x20'+_0x207a09[_0x2254('0x87')]+'\x20');_0x8a3656+=_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]?_0x36d121(_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]):_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x72')]+'\x20'+_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x6a')]+(_0x251d70(_0x207a09['rules'][_0x1554f1][_0x2254('0x6a')])?'\x20'+_0x207a09['rules'][_0x1554f1][_0x2254('0x88')]:'');}return _0x8a3656+')';};var _0xb98b40={'where':{'id':_0x4dfcb4['id']}},_0x3b1d5c,_0x2c907a,_0x23b78c,_0x2b5dba,_0x30307a;_0xb98b40=_['merge']({},_0xb98b40,_0x4e699c);return db[_0x2254('0x2e')]['find'](_0xb98b40)[_0x2254('0x25')](function(_0x52712d){if(_0x52712d){_0x3b1d5c=_0x52712d;return _0x52712d[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x1d0c8f){if(_0x1d0c8f){if(!_0x1d0c8f['length']){throw new db[(_0x2254('0x6b'))][(_0x2254('0x8a'))](_0x2254('0x6c'),0x193);}_0x2c907a=_0x1d0c8f;return db[_0x2254('0x6d')][_0x2254('0x44')]({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x34185c){if(_0x34185c){_0x23b78c=_[_0x2254('0x6e')](_0x34185c,'id');var _0x5e94b6;var _0x56239e=squel[_0x2254('0x6f')]();_0x56239e['from'](_0x3b1d5c[_0x2254('0x7e')]);for(var _0x3a1365=0x0;_0x3a1365<_0x2c907a[_0x2254('0x39')];_0x3a1365+=0x1){_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x71')]?_0x23b78c[_0x2c907a[_0x3a1365][_0x2254('0x71')]][_0x2254('0x8b')]:_0x2c907a[_0x3a1365][_0x2254('0x72')];_0x5e94b6=_0x2c907a[_0x3a1365]['function']?_[_0x2254('0x73')](_0x3a8d4f[_0x2c907a[_0x3a1365][_0x2254('0x74')]],'%s',_0x5e94b6):_0x5e94b6;_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x8c')]?_['replace'](_0x2f3650[_0x2c907a[_0x3a1365][_0x2254('0x8c')]],'%s',_0x5e94b6):_0x5e94b6;if(_0x2c907a[_0x3a1365][_0x2254('0x75')]){_0x56239e[_0x2254('0x69')](_0x5e94b6);}_0x2c907a[_0x3a1365][_0x2254('0x76')]&&_0x56239e[_0x2254('0x3c')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x56239e[_0x2254('0x72')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x77')]||_0x5e94b6);}if(_0x3b1d5c['joins']){_0x3b1d5c[_0x2254('0x79')]=JSON[_0x2254('0x78')](_0x3b1d5c['joins']);for(var _0x4cec5b=0x0;_0x4cec5b<_0x3b1d5c[_0x2254('0x79')]['length'];_0x4cec5b+=0x1){if(_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x1f7a48,_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')])&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7a')]&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b]['foreignTable']&&_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7c')]){_0x56239e[_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]](_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3b1d5c[_0x2254('0x7e')],_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7a')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7c')]));}}}if(_0x3b1d5c[_0x2254('0x7f')]){_0x3b1d5c[_0x2254('0x7f')]=JSON['parse'](_0x3b1d5c[_0x2254('0x7f')]);_0x56239e[_0x2254('0x3e')](_0x36d121(_0x3b1d5c['conditions'][_0x2254('0x69')]));}_0x30307a=_0x56239e[_0x2254('0x80')]();_0x56239e[_0x2254('0x20')](_0x30f2c9);_0x56239e[_0x2254('0x1e')](0x0);return;}})[_0x2254('0x25')](function(){if(_0x1c317b[_0x2254('0x8e')]===_0x2254('0x8f')){return null;}var _0x38e2df=_[_0x2254('0x41')](_0x1c317b,{'name':_0x1c317b[_0x2254('0x90')]||_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c['name'],'basename':_0x2ad519,'savename':util[_0x2254('0x8c')](_0x2254('0x91'),_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c[_0x2254('0x2a')],require(_0x2254('0x92'))[_0x2254('0x93')](0x4),_0x1c317b[_0x2254('0x8e')]||'csv'),'reportId':_0x3b1d5c['id'],'reportType':_0x2254('0x94')});return db[_0x2254('0x95')][_0x2254('0x4b')](_0x38e2df,{'raw':!![]});})['then'](function(_0x60f5ac){if(_0x3b1d5c[_0x2254('0x7e')]===_0x2254('0x96')){_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x97'),_0x1c317b['startDate'],_0x1c317b[_0x2254('0x98')]);}else{_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x99'),_0x1c317b[_0x2254('0x9a')],_0x1c317b['endDate']);}if(_0x60f5ac){logger['info'](_0x2254('0x9b'),_0x30307a['toString']());require(_0x2254('0x9c'))[_0x2254('0x9d')](path[_0x2254('0x54')](__dirname,_0x2254('0x9e'),_0x60f5ac[_0x2254('0x8e')]),[_0x60f5ac['id'],_0x30307a[_0x2254('0x83')](),path['join'](__dirname,'../../files/reports',_0x60f5ac[_0x2254('0x9f')]),_0x2ad519]);return _0x60f5ac;}else{var _0x3317d4=squel[_0x2254('0x6f')]();_0x3317d4[_0x2254('0x70')]('('+_0x30307a['toString']()+')',_0x2254('0xa0'));_0x3317d4[_0x2254('0x72')](_0x2254('0xa1'),_0x2254('0x21'));_0x30307a[_0x2254('0x20')](_0x1c317b[_0x2254('0x20')]||_0x30f2c9);_0x30307a[_0x2254('0x1e')](_0x1c317b[_0x2254('0x1e')]||0x0);return dbH[_0x2254('0xa2')]['query'](_0x3317d4[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')]['SELECT']})[_0x2254('0x25')](function(_0xe38a28){if(!_0xe38a28[_0x2254('0x39')]){_0x2b5dba=0x0;}else{_0x2b5dba=_0xe38a28[0x0]['count']||0x0;}return dbH['sequelize'][_0x2254('0x33')](_0x30307a[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')][_0x2254('0xa3')]});})[_0x2254('0x25')](function(_0x4011de){return{'rows':_0x4011de||[],'count':_0x2b5dba};});}});}exports[_0x2254('0xa4')]=function(_0x5cb3d1,_0x1d8238){return runReport(_0x5cb3d1[_0x2254('0x47')],_0x5cb3d1[_0x2254('0x33')],_0x5cb3d1[_0x2254('0x42')])[_0x2254('0x25')](respondWithResult(_0x1d8238,null))[_0x2254('0x46')](handleError(_0x1d8238,null));};exports['runReport']=runReport;exports['query']=function(_0x40339d,_0x4b3b96){var _0x59b8af=0xa;var _0x408695=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),'cross_join'];var _0x596eae={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x739a29={'SEC_TO_TIME':_0x2254('0x61'),'DATE':'DATE(%s)','HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x243466=function(_0x1b8587){return!_[_0x2254('0x65')]([_0x2254('0x66'),_0x2254('0xa5'),_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x1b8587);};var _0xbec5d0=function(_0x18f841){if(!_0x18f841||!_0x18f841[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x275b56='(',_0x315add=0x0;_0x315add<_0x18f841['rules']['length'];_0x315add+=0x1){_0x315add>0x0&&(_0x275b56+='\x20'+_0x18f841[_0x2254('0x87')]+'\x20');_0x275b56+=_0x18f841['rules'][_0x315add][_0x2254('0x69')]?_0xbec5d0(_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x69')]):_0x18f841[_0x2254('0x68')][_0x315add]['field']+'\x20'+_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x6a')]+(_0x243466(_0x18f841[_0x2254('0x68')][_0x315add]['condition'])?'\x20'+_0x18f841['rules'][_0x315add][_0x2254('0x88')]:'');}return _0x275b56+')';};var _0x51b02a={'where':{'id':_0x40339d[_0x2254('0x47')]['id']}},_0x3e7642,_0xe1abb6,_0x1a44d0,_0x4af6a7,_0x539aba;_0x51b02a=_[_0x2254('0x41')]({},_0x51b02a,_0x40339d[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x51b02a)['then'](function(_0x34e28b){if(_0x34e28b){_0x3e7642=_0x34e28b;return _0x34e28b[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x5d373){if(_0x5d373){if(!_0x5d373[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xe1abb6=_0x5d373;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x56a7ce){if(_0x56a7ce){_0x1a44d0=_[_0x2254('0x6e')](_0x56a7ce,'id');var _0x34bf19;var _0x4965c7=squel[_0x2254('0x6f')]();_0x4965c7[_0x2254('0x70')](_0x3e7642[_0x2254('0x7e')]);for(var _0x45541b=0x0;_0x45541b<_0xe1abb6[_0x2254('0x39')];_0x45541b+=0x1){_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x71')]?_0x1a44d0[_0xe1abb6[_0x45541b][_0x2254('0x71')]][_0x2254('0x8b')]:_0xe1abb6[_0x45541b][_0x2254('0x72')];_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x74')]?_[_0x2254('0x73')](_0x596eae[_0xe1abb6[_0x45541b][_0x2254('0x74')]],'%s',_0x34bf19):_0x34bf19;_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x8c')]?_[_0x2254('0x73')](_0x739a29[_0xe1abb6[_0x45541b]['format']],'%s',_0x34bf19):_0x34bf19;if(_0xe1abb6[_0x45541b][_0x2254('0x75')]){_0x4965c7[_0x2254('0x69')](_0x34bf19);}_0xe1abb6[_0x45541b]['orderBy']&&_0x4965c7['order'](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x4965c7[_0x2254('0x72')](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x77')]||_0x34bf19);}if(_0x3e7642['joins']){_0x3e7642[_0x2254('0x79')]=JSON['parse'](_0x3e7642['joins']);for(var _0x40fec0=0x0;_0x40fec0<_0x3e7642[_0x2254('0x79')][_0x2254('0x39')];_0x40fec0+=0x1){if(_0x3e7642[_0x2254('0x79')][_0x40fec0]['type']&&_[_0x2254('0x65')](_0x408695,_0x3e7642['joins'][_0x40fec0][_0x2254('0x30')])&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]){_0x4965c7[_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x30')]](_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0x3e7642[_0x2254('0x7e')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]));}}}if(_0x3e7642['conditions']){_0x3e7642[_0x2254('0x7f')]=JSON[_0x2254('0x78')](_0x3e7642[_0x2254('0x7f')]);_0x4965c7[_0x2254('0x3e')](_0xbec5d0(_0x3e7642[_0x2254('0x7f')]['group']));}_0x539aba=_0x4965c7[_0x2254('0x80')]();_0x4965c7[_0x2254('0x20')](_0x59b8af);_0x4965c7['offset'](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4965c7[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4965c7[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')][_0x2254('0xa3')]});}})[_0x2254('0x25')](function(){return{'sql':_0x539aba[_0x2254('0x83')]()};})['then'](respondWithResult(_0x4b3b96,null))[_0x2254('0x46')](handleError(_0x4b3b96,null));};
\ No newline at end of file
+var _0x5fc3=['QueryTypes','right_join','HOUR(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','destroy','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)'];(function(_0x29c88c,_0x352699){var _0x3b156a=function(_0x2dceed){while(--_0x2dceed){_0x29c88c['push'](_0x29c88c['shift']());}};_0x3b156a(++_0x352699);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x5fc3[_0x5b7788];return _0x573871;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x35fc('0x17')];function respondWithStatusCode(_0x5d462a,_0x397738){_0x397738=_0x397738||0xcc;return function(_0x22055e){if(_0x22055e){return _0x5d462a[_0x35fc('0x18')](_0x397738);}return _0x5d462a[_0x35fc('0x19')](_0x397738)[_0x35fc('0x1a')]();};}function respondWithResult(_0x5cfe94,_0x59507a){_0x59507a=_0x59507a||0xc8;return function(_0x5eac0f){if(_0x5eac0f){return _0x5cfe94['status'](_0x59507a)[_0x35fc('0x1b')](_0x5eac0f);}};}function respondWithFilteredResult(_0x229d56,_0x53b898){return function(_0x154958){if(_0x154958){var _0x227a49=typeof _0x53b898[_0x35fc('0x1c')]==='undefined'&&typeof _0x53b898[_0x35fc('0x1d')]===_0x35fc('0x1e');var _0x553677=_0x154958[_0x35fc('0x1f')];var _0x363e47=_0x227a49?0x0:_0x53b898[_0x35fc('0x1c')];var _0x5f56c6=_0x227a49?_0x154958[_0x35fc('0x1f')]:_0x53b898[_0x35fc('0x1c')]+_0x53b898[_0x35fc('0x1d')];var _0x488234;if(_0x5f56c6>=_0x553677){_0x5f56c6=_0x553677;_0x488234=0xc8;}else{_0x488234=0xce;}_0x229d56[_0x35fc('0x19')](_0x488234);return _0x229d56[_0x35fc('0x20')](_0x35fc('0x21'),_0x363e47+'-'+_0x5f56c6+'/'+_0x553677)[_0x35fc('0x1b')](_0x154958);}return null;};}function patchUpdates(_0x20ffde){return function(_0x21f1a9){try{jsonpatch[_0x35fc('0x22')](_0x21f1a9,_0x20ffde,!![]);}catch(_0x3b05b0){return BPromise[_0x35fc('0x23')](_0x3b05b0);}return _0x21f1a9[_0x35fc('0x24')]();};}function saveUpdates(_0x5bd2b8,_0x323aee){return function(_0xd5399f){if(_0xd5399f){return _0xd5399f[_0x35fc('0x25')](_0x5bd2b8)[_0x35fc('0x26')](function(_0x3b4743){return _0x3b4743;});}return null;};}function removeEntity(_0x55e9e7,_0x33f5e8){return function(_0x4c587a){if(_0x4c587a){return _0x4c587a['destroy']()[_0x35fc('0x26')](function(){var _0x5a93df=_0x4c587a[_0x35fc('0x27')]({'plain':!![]});var _0x51cfec=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x29')]({'where':{'type':_0x51cfec,'resourceId':_0x5a93df['id']}})[_0x35fc('0x26')](function(){return _0x4c587a;});})['then'](function(){_0x55e9e7['status'](0xcc)[_0x35fc('0x1a')]();});}};}function handleEntityNotFound(_0x58edb6,_0x274208){return function(_0x1a5d92){if(!_0x1a5d92){_0x58edb6['sendStatus'](0x194);}return _0x1a5d92;};}function handleError(_0x26b7cb,_0x645eac){_0x645eac=_0x645eac||0x1f4;return function(_0x383837){logger[_0x35fc('0x2a')](_0x383837[_0x35fc('0x2b')]);if(_0x383837[_0x35fc('0x2c')]){delete _0x383837[_0x35fc('0x2c')];}_0x26b7cb[_0x35fc('0x19')](_0x645eac)['send'](_0x383837);};}exports[_0x35fc('0x2d')]=function(_0x220931,_0x22af18){var _0x52acc5={},_0xe79f52={},_0x16f067={'count':0x0,'rows':[]};var _0x3822a8=_[_0x35fc('0x2e')](db[_0x35fc('0x2f')][_0x35fc('0x30')],function(_0x222ddb){return{'name':_0x222ddb[_0x35fc('0x31')],'type':_0x222ddb[_0x35fc('0x32')][_0x35fc('0x33')]};});_0xe79f52['model']=_['map'](_0x3822a8,_0x35fc('0x2c'));_0xe79f52['query']=_[_0x35fc('0x34')](_0x220931[_0x35fc('0x35')]);_0xe79f52[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],_0xe79f52[_0x35fc('0x35')]);_0x52acc5['attributes']=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x220931[_0x35fc('0x35')][_0x35fc('0x39')]));_0x52acc5[_0x35fc('0x3a')]=_0x52acc5['attributes'][_0x35fc('0x3b')]?_0x52acc5[_0x35fc('0x3a')]:_0xe79f52[_0x35fc('0x38')];if(!_0x220931['query'][_0x35fc('0x3c')]('nolimit')){_0x52acc5[_0x35fc('0x1d')]=qs[_0x35fc('0x1d')](_0x220931[_0x35fc('0x35')][_0x35fc('0x1d')]);_0x52acc5['offset']=qs['offset'](_0x220931['query'][_0x35fc('0x1c')]);}_0x52acc5['order']=qs[_0x35fc('0x3d')](_0x220931['query'][_0x35fc('0x3d')]);_0x52acc5[_0x35fc('0x3e')]=qs[_0x35fc('0x36')](_[_0x35fc('0x3f')](_0x220931[_0x35fc('0x35')],_0xe79f52[_0x35fc('0x36')]),_0x3822a8);if(_0x220931[_0x35fc('0x35')]['filter']){_0x52acc5[_0x35fc('0x3e')]=_[_0x35fc('0x40')](_0x52acc5['where'],{'$or':_[_0x35fc('0x2e')](_0x3822a8,function(_0x1ccc41){if(_0x1ccc41[_0x35fc('0x32')]!==_0x35fc('0x41')){var _0x813866={};_0x813866[_0x1ccc41[_0x35fc('0x2c')]]={'$like':'%'+_0x220931['query'][_0x35fc('0x42')]+'%'};return _0x813866;}})});}_0x52acc5=_[_0x35fc('0x40')]({},_0x52acc5,_0x220931[_0x35fc('0x43')]);var _0x52543b={'where':_0x52acc5[_0x35fc('0x3e')]};return db[_0x35fc('0x2f')]['count'](_0x52543b)[_0x35fc('0x26')](function(_0x280af1){_0x16f067[_0x35fc('0x1f')]=_0x280af1;if(_0x220931[_0x35fc('0x35')][_0x35fc('0x44')]){_0x52acc5[_0x35fc('0x45')]=[{'all':!![]}];}return db[_0x35fc('0x2f')][_0x35fc('0x46')](_0x52acc5);})['then'](function(_0x596e83){_0x16f067[_0x35fc('0x47')]=_0x596e83;return _0x16f067;})[_0x35fc('0x26')](respondWithFilteredResult(_0x22af18,_0x52acc5))['catch'](handleError(_0x22af18,null));};exports['show']=function(_0x4ff202,_0x79677d){var _0x10f98b={'raw':!![],'where':{'id':_0x4ff202[_0x35fc('0x48')]['id']}},_0x4e56ed={};_0x4e56ed[_0x35fc('0x38')]=_[_0x35fc('0x34')](db[_0x35fc('0x2f')]['rawAttributes']);_0x4e56ed['query']=_['keys'](_0x4ff202['query']);_0x4e56ed['filters']=_[_0x35fc('0x37')](_0x4e56ed[_0x35fc('0x38')],_0x4e56ed['query']);_0x10f98b[_0x35fc('0x3a')]=_['intersection'](_0x4e56ed[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x4ff202[_0x35fc('0x35')][_0x35fc('0x39')]));_0x10f98b[_0x35fc('0x3a')]=_0x10f98b['attributes'][_0x35fc('0x3b')]?_0x10f98b[_0x35fc('0x3a')]:_0x4e56ed['model'];if(_0x4ff202[_0x35fc('0x35')][_0x35fc('0x44')]){_0x10f98b[_0x35fc('0x45')]=[{'all':!![]}];}_0x10f98b=_[_0x35fc('0x40')]({},_0x10f98b,_0x4ff202['options']);return db[_0x35fc('0x2f')]['find'](_0x10f98b)['then'](handleEntityNotFound(_0x79677d,null))[_0x35fc('0x26')](respondWithResult(_0x79677d,null))[_0x35fc('0x49')](handleError(_0x79677d,null));};exports[_0x35fc('0x4a')]=function(_0xca8aef,_0xf2ca20){return db[_0x35fc('0x2f')][_0x35fc('0x4a')](_0xca8aef[_0x35fc('0x4b')],{})['then'](function(_0x3e2961){var _0x91d7c0=_0xca8aef[_0x35fc('0x4c')][_0x35fc('0x27')]({'plain':!![]});if(!_0x91d7c0)throw new Error(_0x35fc('0x4d'));if(_0x91d7c0[_0x35fc('0x4e')]===_0x35fc('0x4c')){var _0x347a4a=_0x3e2961[_0x35fc('0x27')]({'plain':!![]});var _0xe6eb6a=_0x35fc('0x4f');return db[_0x35fc('0x50')][_0x35fc('0x51')]({'where':{'name':_0xe6eb6a,'userProfileId':_0x91d7c0[_0x35fc('0x52')]},'raw':!![]})['then'](function(_0x553ed6){if(_0x553ed6&&_0x553ed6[_0x35fc('0x53')]===0x0){return db[_0x35fc('0x54')][_0x35fc('0x4a')]({'name':_0x347a4a[_0x35fc('0x2c')],'resourceId':_0x347a4a['id'],'type':_0x35fc('0x28'),'sectionId':_0x553ed6['id']},{})[_0x35fc('0x26')](function(){return _0x3e2961;});}else{return _0x3e2961;}})['catch'](function(_0x4f024c){logger[_0x35fc('0x2a')](_0x35fc('0x55'),_0x4f024c);throw _0x4f024c;});}return _0x3e2961;})[_0x35fc('0x26')](respondWithResult(_0xf2ca20,0xc9))[_0x35fc('0x49')](handleError(_0xf2ca20,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4b')]['id'];}return db[_0x35fc('0x2f')]['find']({'where':{'id':_0x467980[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x26')](saveUpdates(_0x467980[_0x35fc('0x4b')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['AnalyticDefaultReport'][_0x35fc('0x51')]({'where':{'id':_0x240338[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x26')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x49')](handleError(_0x2ea8d6,null));};exports['preview']=function(_0x2d9d45,_0x757aa6){var _0x39d470=0xa;var _0x509e77=[_0x35fc('0x56'),_0x35fc('0x57'),'right_join',_0x35fc('0x58')];var _0x164c7b={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x303927={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23b54f=function(_0xb1c68a){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xb1c68a);};var _0x5353ea=function(_0x4faef4){if(!_0x4faef4||!_0x4faef4['rules'][_0x35fc('0x3b')]){return'';}for(var _0x44250b='(',_0xd470e8=0x0;_0xd470e8<_0x4faef4[_0x35fc('0x65')]['length'];_0xd470e8+=0x1){_0xd470e8>0x0&&(_0x44250b+='\x20'+_0x4faef4[_0x35fc('0x66')]+'\x20');_0x44250b+=_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]?_0x5353ea(_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]):_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x68')]+'\x20'+_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x69')]+(_0x23b54f(_0x4faef4['rules'][_0xd470e8][_0x35fc('0x69')])?'\x20'+_0x4faef4['rules'][_0xd470e8][_0x35fc('0x6a')]:'');}return _0x44250b+')';};var _0x9029e3={'where':{'id':_0x2d9d45['params']['id']}},_0x2ac8e1,_0x2bc76c,_0x4bdde7,_0x465c14,_0x4af592;_0x9029e3=_['merge']({},_0x9029e3,_0x2d9d45[_0x35fc('0x43')]);return db['AnalyticDefaultReport'][_0x35fc('0x51')](_0x9029e3)['then'](function(_0x11717){if(_0x11717){_0x2ac8e1=_0x11717;return _0x11717['getFields']();}return null;})[_0x35fc('0x26')](function(_0x455b84){if(_0x455b84){if(!_0x455b84[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))]['ValidationErrorItem'](_0x35fc('0x6c'),0x193);}_0x2bc76c=_0x455b84;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3aa7fa){if(_0x3aa7fa){_0x4bdde7=_[_0x35fc('0x6e')](_0x3aa7fa,'id');var _0x37764b;var _0x3c1b56=squel[_0x35fc('0x6f')]();_0x3c1b56[_0x35fc('0x70')](_0x2ac8e1[_0x35fc('0x71')]);for(var _0x4464d5=0x0;_0x4464d5<_0x2bc76c['length'];_0x4464d5+=0x1){_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x72')]?_0x4bdde7[_0x2bc76c[_0x4464d5][_0x35fc('0x72')]][_0x35fc('0x73')]:_0x2bc76c[_0x4464d5]['field'];_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x164c7b[_0x2bc76c[_0x4464d5]['function']],'%s',_0x37764b):_0x37764b;_0x37764b=_0x2bc76c[_0x4464d5]['format']?_[_0x35fc('0x75')](_0x303927[_0x2bc76c[_0x4464d5]['format']],'%s',_0x37764b):_0x37764b;if(_0x2bc76c[_0x4464d5][_0x35fc('0x76')]){_0x3c1b56[_0x35fc('0x67')](_0x37764b);}_0x2bc76c[_0x4464d5][_0x35fc('0x77')]&&_0x3c1b56[_0x35fc('0x78')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x77')]===_0x35fc('0x79')?![]:!![]);_0x3c1b56[_0x35fc('0x68')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x7a')]||_0x37764b);}if(_0x2ac8e1[_0x35fc('0x7b')]){_0x2ac8e1[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x2ac8e1[_0x35fc('0x7b')]);for(var _0x29f2b9=0x0;_0x29f2b9<_0x2ac8e1[_0x35fc('0x7b')][_0x35fc('0x3b')];_0x29f2b9+=0x1){if(_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]&&_[_0x35fc('0x62')](_0x509e77,_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')])&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7d')]&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7e')]&&_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]){_0x3c1b56[_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]](_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],null,util[_0x35fc('0x80')](_0x35fc('0x81'),_0x2ac8e1[_0x35fc('0x71')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9]['parentKey'],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]));}}}if(_0x2ac8e1[_0x35fc('0x82')]){_0x2ac8e1[_0x35fc('0x82')]=JSON['parse'](_0x2ac8e1[_0x35fc('0x82')]);_0x3c1b56[_0x35fc('0x3e')](_0x5353ea(_0x2ac8e1[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x4af592=_0x3c1b56[_0x35fc('0x83')]();_0x3c1b56[_0x35fc('0x1d')](_0x39d470);_0x3c1b56[_0x35fc('0x1c')](0x0);logger[_0x35fc('0x84')](_0x35fc('0x85'),_0x3c1b56['toString']());return dbH[_0x35fc('0x86')]['query'](_0x3c1b56[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')]['QueryTypes'][_0x35fc('0x88')]});}})[_0x35fc('0x26')](respondWithResult(_0x757aa6,null))[_0x35fc('0x49')](handleError(_0x757aa6,null));};function runReport(_0x4274d6,_0x4026cc,_0x1a765f){var _0x42f87e=_0x4026cc[_0x35fc('0x2c')];var _0x25ee61=0xa;var _0x5806bf=['join','left_join','right_join',_0x35fc('0x58')];var _0x23cf84={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':'MAX(%s)','MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15e936={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x319033=function(_0x9fe765){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x9fe765);};var _0x2faff7=function(_0xa2c5f8){if(!_0xa2c5f8||!_0xa2c5f8[_0x35fc('0x65')][_0x35fc('0x3b')]){return'';}for(var _0x221c5b='(',_0x1fcd36=0x0;_0x1fcd36<_0xa2c5f8['rules'][_0x35fc('0x3b')];_0x1fcd36+=0x1){_0x1fcd36>0x0&&(_0x221c5b+='\x20'+_0xa2c5f8['operator']+'\x20');_0x221c5b+=_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]?_0x2faff7(_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]):_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x68')]+'\x20'+_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x69')]+(_0x319033(_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x69')])?'\x20'+_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x6a')]:'');}return _0x221c5b+')';};var _0x5abdf9={'where':{'id':_0x4274d6['id']}},_0x5512f6,_0x487cb5,_0x23b261,_0x4c742c,_0x2fae26;_0x5abdf9=_[_0x35fc('0x40')]({},_0x5abdf9,_0x1a765f);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x5abdf9)['then'](function(_0x28e80d){if(_0x28e80d){_0x5512f6=_0x28e80d;return _0x28e80d[_0x35fc('0x8e')]();}return null;})[_0x35fc('0x26')](function(_0x47c507){if(_0x47c507){if(!_0x47c507[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))][(_0x35fc('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x487cb5=_0x47c507;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x2edb1b){if(_0x2edb1b){_0x23b261=_[_0x35fc('0x6e')](_0x2edb1b,'id');var _0x3858a9;var _0x4859be=squel[_0x35fc('0x6f')]();_0x4859be[_0x35fc('0x70')](_0x5512f6['table']);for(var _0x5849a0=0x0;_0x5849a0<_0x487cb5[_0x35fc('0x3b')];_0x5849a0+=0x1){_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x72')]?_0x23b261[_0x487cb5[_0x5849a0][_0x35fc('0x72')]]['metric']:_0x487cb5[_0x5849a0]['field'];_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x23cf84[_0x487cb5[_0x5849a0]['function']],'%s',_0x3858a9):_0x3858a9;_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x80')]?_[_0x35fc('0x75')](_0x15e936[_0x487cb5[_0x5849a0][_0x35fc('0x80')]],'%s',_0x3858a9):_0x3858a9;if(_0x487cb5[_0x5849a0]['groupBy']){_0x4859be[_0x35fc('0x67')](_0x3858a9);}_0x487cb5[_0x5849a0][_0x35fc('0x77')]&&_0x4859be[_0x35fc('0x78')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x77')]==='DESC'?![]:!![]);_0x4859be[_0x35fc('0x68')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x7a')]||_0x3858a9);}if(_0x5512f6[_0x35fc('0x7b')]){_0x5512f6['joins']=JSON[_0x35fc('0x7c')](_0x5512f6[_0x35fc('0x7b')]);for(var _0x425f72=0x0;_0x425f72<_0x5512f6['joins'][_0x35fc('0x3b')];_0x425f72+=0x1){if(_0x5512f6[_0x35fc('0x7b')][_0x425f72]['type']&&_[_0x35fc('0x62')](_0x5806bf,_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x32')])&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]){_0x4859be[_0x5512f6['joins'][_0x425f72][_0x35fc('0x32')]](_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],null,util[_0x35fc('0x80')]('%s.%s\x20=\x20%s.%s',_0x5512f6[_0x35fc('0x71')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]));}}}if(_0x5512f6[_0x35fc('0x82')]){_0x5512f6['conditions']=JSON['parse'](_0x5512f6[_0x35fc('0x82')]);_0x4859be[_0x35fc('0x3e')](_0x2faff7(_0x5512f6[_0x35fc('0x82')]['group']));}_0x2fae26=_0x4859be[_0x35fc('0x83')]();_0x4859be[_0x35fc('0x1d')](_0x25ee61);_0x4859be[_0x35fc('0x1c')](0x0);return;}})[_0x35fc('0x26')](function(){if(_0x4026cc['output']==='web'){return null;}var _0x379650=_['merge'](_0x4026cc,{'name':_0x4026cc[_0x35fc('0x90')]||_0x4026cc[_0x35fc('0x2c')]||_0x5512f6['name'],'basename':_0x42f87e,'savename':util['format'](_0x35fc('0x91'),_0x4026cc[_0x35fc('0x2c')]||_0x5512f6[_0x35fc('0x2c')],require('randomstring')[_0x35fc('0x92')](0x4),_0x4026cc[_0x35fc('0x93')]||_0x35fc('0x94')),'reportId':_0x5512f6['id'],'reportType':'default'});return db[_0x35fc('0x95')][_0x35fc('0x4a')](_0x379650,{'raw':!![]});})[_0x35fc('0x26')](function(_0x328e90){if(_0x5512f6['table']===_0x35fc('0x96')){_0x2fae26[_0x35fc('0x3e')](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x97'),_0x4026cc[_0x35fc('0x98')],_0x4026cc[_0x35fc('0x99')]);}else{_0x2fae26['where'](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x9a'),_0x4026cc['startDate'],_0x4026cc[_0x35fc('0x99')]);}if(_0x328e90){logger[_0x35fc('0x9b')]('Run\x20Query:',_0x2fae26[_0x35fc('0x87')]());require(_0x35fc('0x9c'))[_0x35fc('0x9d')](path[_0x35fc('0x56')](__dirname,_0x35fc('0x9e'),_0x328e90['output']),[_0x328e90['id'],_0x2fae26[_0x35fc('0x87')](),path[_0x35fc('0x56')](__dirname,_0x35fc('0x9f'),_0x328e90['savename']),_0x42f87e]);return _0x328e90;}else{var _0x1224cd=squel['select']();_0x1224cd['from']('('+_0x2fae26[_0x35fc('0x87')]()+')',_0x35fc('0xa0'));_0x1224cd[_0x35fc('0x68')](_0x35fc('0xa1'),_0x35fc('0x1f'));_0x2fae26['limit'](_0x4026cc[_0x35fc('0x1d')]||_0x25ee61);_0x2fae26[_0x35fc('0x1c')](_0x4026cc[_0x35fc('0x1c')]||0x0);return dbH['sequelize'][_0x35fc('0x35')](_0x1224cd[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]})['then'](function(_0x1a2d73){if(!_0x1a2d73[_0x35fc('0x3b')]){_0x4c742c=0x0;}else{_0x4c742c=_0x1a2d73[0x0]['count']||0x0;}return dbH['sequelize'][_0x35fc('0x35')](_0x2fae26[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]});})[_0x35fc('0x26')](function(_0x8c80ca){return{'rows':_0x8c80ca||[],'count':_0x4c742c};});}});}exports['run']=function(_0x5dc286,_0x146ce1){return runReport(_0x5dc286[_0x35fc('0x48')],_0x5dc286[_0x35fc('0x35')],_0x5dc286[_0x35fc('0x43')])[_0x35fc('0x26')](respondWithResult(_0x146ce1,null))['catch'](handleError(_0x146ce1,null));};exports['runReport']=runReport;exports[_0x35fc('0x35')]=function(_0x2451f2,_0x3fff79){var _0x1c6ce9=0xa;var _0x4b2079=['join',_0x35fc('0x57'),_0x35fc('0xa3'),_0x35fc('0x58')];var _0xd46d64={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':'MIN(%s)','AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x274337={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':_0x35fc('0xa4'),'ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x19ae76=function(_0x366a3b){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x366a3b);};var _0x345026=function(_0x553f7d){if(!_0x553f7d||!_0x553f7d[_0x35fc('0x65')]['length']){return'';}for(var _0x5aa072='(',_0x3c96ef=0x0;_0x3c96ef<_0x553f7d[_0x35fc('0x65')][_0x35fc('0x3b')];_0x3c96ef+=0x1){_0x3c96ef>0x0&&(_0x5aa072+='\x20'+_0x553f7d['operator']+'\x20');_0x5aa072+=_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]?_0x345026(_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]):_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x68')]+'\x20'+_0x553f7d['rules'][_0x3c96ef]['condition']+(_0x19ae76(_0x553f7d[_0x35fc('0x65')][_0x3c96ef]['condition'])?'\x20'+_0x553f7d['rules'][_0x3c96ef][_0x35fc('0x6a')]:'');}return _0x5aa072+')';};var _0x48b826={'where':{'id':_0x2451f2[_0x35fc('0x48')]['id']}},_0x556f9a,_0x5ae83f,_0x450769,_0x5d461c,_0x355154;_0x48b826=_[_0x35fc('0x40')]({},_0x48b826,_0x2451f2[_0x35fc('0x43')]);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x48b826)['then'](function(_0x522ff2){if(_0x522ff2){_0x556f9a=_0x522ff2;return _0x522ff2[_0x35fc('0x8e')]();}return null;})['then'](function(_0x233c94){if(_0x233c94){if(!_0x233c94[_0x35fc('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ae83f=_0x233c94;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x135e18){if(_0x135e18){_0x450769=_[_0x35fc('0x6e')](_0x135e18,'id');var _0x28525f;var _0x9116b1=squel[_0x35fc('0x6f')]();_0x9116b1['from'](_0x556f9a['table']);for(var _0x5cefdb=0x0;_0x5cefdb<_0x5ae83f['length'];_0x5cefdb+=0x1){_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x72')]?_0x450769[_0x5ae83f[_0x5cefdb]['MetricId']][_0x35fc('0x73')]:_0x5ae83f[_0x5cefdb]['field'];_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0xd46d64[_0x5ae83f[_0x5cefdb]['function']],'%s',_0x28525f):_0x28525f;_0x28525f=_0x5ae83f[_0x5cefdb]['format']?_[_0x35fc('0x75')](_0x274337[_0x5ae83f[_0x5cefdb][_0x35fc('0x80')]],'%s',_0x28525f):_0x28525f;if(_0x5ae83f[_0x5cefdb][_0x35fc('0x76')]){_0x9116b1[_0x35fc('0x67')](_0x28525f);}_0x5ae83f[_0x5cefdb][_0x35fc('0x77')]&&_0x9116b1['order'](_0x28525f,_0x5ae83f[_0x5cefdb]['orderBy']===_0x35fc('0x79')?![]:!![]);_0x9116b1['field'](_0x28525f,_0x5ae83f[_0x5cefdb][_0x35fc('0x7a')]||_0x28525f);}if(_0x556f9a['joins']){_0x556f9a[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x556f9a[_0x35fc('0x7b')]);for(var _0x10e30e=0x0;_0x10e30e<_0x556f9a['joins'][_0x35fc('0x3b')];_0x10e30e+=0x1){if(_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')]&&_['includes'](_0x4b2079,_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')])&&_0x556f9a['joins'][_0x10e30e][_0x35fc('0x7d')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]){_0x9116b1[_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x32')]](_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],null,util['format'](_0x35fc('0x81'),_0x556f9a[_0x35fc('0x71')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7d')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]));}}}if(_0x556f9a['conditions']){_0x556f9a['conditions']=JSON['parse'](_0x556f9a['conditions']);_0x9116b1['where'](_0x345026(_0x556f9a[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x355154=_0x9116b1[_0x35fc('0x83')]();_0x9116b1[_0x35fc('0x1d')](_0x1c6ce9);_0x9116b1[_0x35fc('0x1c')](0x0);logger['debug'](_0x35fc('0x85'),_0x9116b1[_0x35fc('0x87')]());return dbH[_0x35fc('0x86')][_0x35fc('0x35')](_0x9116b1[_0x35fc('0x87')](),{'type':dbH['sequelize'][_0x35fc('0xa2')][_0x35fc('0x88')]});}})[_0x35fc('0x26')](function(){return{'sql':_0x355154['toString']()};})[_0x35fc('0x26')](respondWithResult(_0x3fff79,null))[_0x35fc('0x49')](handleError(_0x3fff79,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index f262dd3..21ea3c8 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 _0x7403=['../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2a2818,_0x14f644){var _0x237971=function(_0x90bec3){while(--_0x90bec3){_0x2a2818['push'](_0x2a2818['shift']());}};_0x237971(++_0x14f644);}(_0x7403,0x88));var _0x3740=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7403[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3740('0x0'));var logger=require(_0x3740('0x1'))(_0x3740('0x2'));var moment=require(_0x3740('0x3'));var BPromise=require('bluebird');var rp=require(_0x3740('0x4'));var fs=require('fs');var path=require(_0x3740('0x5'));var rimraf=require(_0x3740('0x6'));var config=require(_0x3740('0x7'));var attributes=require(_0x3740('0x8'));module[_0x3740('0x9')]=function(_0x5d394b,_0x3f6ae7){return _0x5d394b[_0x3740('0xa')](_0x3740('0xb'),attributes,{'tableName':_0x3740('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5348=['../../config/logger','api','moment','path','rimraf','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash'];(function(_0x3ef8f7,_0x35359a){var _0x3b097e=function(_0x189c92){while(--_0x189c92){_0x3ef8f7['push'](_0x3ef8f7['shift']());}};_0x3b097e(++_0x35359a);}(_0x5348,0x13f));var _0x8534=function(_0x2a050e,_0x31d347){_0x2a050e=_0x2a050e-0x0;var _0x160d80=_0x5348[_0x2a050e];return _0x160d80;};'use strict';var _=require(_0x8534('0x0'));var util=require('util');var logger=require(_0x8534('0x1'))(_0x8534('0x2'));var moment=require(_0x8534('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8534('0x4'));var rimraf=require(_0x8534('0x5'));var config=require('../../config/environment');var attributes=require(_0x8534('0x6'));module[_0x8534('0x7')]=function(_0x372f41,_0x38de8f){return _0x372f41[_0x8534('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0x8534('0x9'),'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 7f46c52..f217c60 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 _0xf265=['request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x2558f3,_0x42ff6b){var _0x323372=function(_0x198ede){while(--_0x198ede){_0x2558f3['push'](_0x2558f3['shift']());}};_0x323372(++_0x42ff6b);}(_0xf265,0x171));var _0x5f26=function(_0x5b2c0b,_0x12fa22){_0x5b2c0b=_0x5b2c0b-0x0;var _0x300219=_0xf265[_0x5b2c0b];return _0x300219;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5f26('0x0'));var BPromise=require(_0x5f26('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f26('0x2'));var db=require(_0x5f26('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f26('0x4'))(_0x5f26('0x5'));var config=require(_0x5f26('0x6'));var jayson=require(_0x5f26('0x7'));var client=jayson['client'][_0x5f26('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13c712,_0xf2621a,_0x56999a){return new BPromise(function(_0x32c123,_0xfce51){return client['request'](_0x13c712,_0x56999a)[_0x5f26('0x9')](function(_0xf0c20b){logger['info'](_0x5f26('0xa'),_0xf2621a,_0x5f26('0xb'));logger[_0x5f26('0xc')](_0x5f26('0xd'),_0xf2621a,_0x5f26('0xb'),JSON['stringify'](_0xf0c20b));if(_0xf0c20b['error']){if(_0xf0c20b['error'][_0x5f26('0xe')]===0x1f4){logger[_0x5f26('0xf')](_0x5f26('0xa'),_0xf2621a,_0xf0c20b[_0x5f26('0xf')][_0x5f26('0x10')]);return _0xfce51(_0xf0c20b[_0x5f26('0xf')]['message']);}logger[_0x5f26('0xf')](_0x5f26('0xa'),_0xf2621a,_0xf0c20b[_0x5f26('0xf')][_0x5f26('0x10')]);return _0x32c123(_0xf0c20b[_0x5f26('0xf')]['message']);}else{logger[_0x5f26('0x11')](_0x5f26('0xa'),_0xf2621a,'request\x20sent');_0x32c123(_0xf0c20b[_0x5f26('0x12')][_0x5f26('0x10')]);}})[_0x5f26('0x13')](function(_0x427964){logger[_0x5f26('0xf')](_0x5f26('0xa'),_0xf2621a,_0x427964);_0xfce51(_0x427964);});});}
\ No newline at end of file
+var _0x3638=['bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x53212a,_0x3e81bd){var _0xecfd59=function(_0x1ddd64){while(--_0x1ddd64){_0x53212a['push'](_0x53212a['shift']());}};_0xecfd59(++_0x3e81bd);}(_0x3638,0x1b6));var _0x8363=function(_0x990a0d,_0x460bb0){_0x990a0d=_0x990a0d-0x0;var _0x19e4d0=_0x3638[_0x990a0d];return _0x19e4d0;};'use strict';var _=require(_0x8363('0x0'));var util=require('util');var moment=require(_0x8363('0x1'));var BPromise=require(_0x8363('0x2'));var rs=require(_0x8363('0x3'));var fs=require('fs');var Redis=require(_0x8363('0x4'));var db=require(_0x8363('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8363('0x6'));var config=require('../../config/environment');var jayson=require(_0x8363('0x7'));var client=jayson[_0x8363('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25adc6,_0x3a9991,_0x1fbc1f){return new BPromise(function(_0x3f2c2d,_0x33428d){return client[_0x8363('0x9')](_0x25adc6,_0x1fbc1f)['then'](function(_0x256fad){logger[_0x8363('0xa')](_0x8363('0xb'),_0x3a9991,_0x8363('0xc'));logger[_0x8363('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3a9991,'request\x20sent',JSON[_0x8363('0xe')](_0x256fad));if(_0x256fad[_0x8363('0xf')]){if(_0x256fad[_0x8363('0xf')][_0x8363('0x10')]===0x1f4){logger[_0x8363('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3a9991,_0x256fad[_0x8363('0xf')]['message']);return _0x33428d(_0x256fad['error'][_0x8363('0x11')]);}logger[_0x8363('0xf')](_0x8363('0xb'),_0x3a9991,_0x256fad[_0x8363('0xf')][_0x8363('0x11')]);return _0x3f2c2d(_0x256fad[_0x8363('0xf')][_0x8363('0x11')]);}else{logger[_0x8363('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3a9991,_0x8363('0xc'));_0x3f2c2d(_0x256fad[_0x8363('0x12')][_0x8363('0x11')]);}})[_0x8363('0x13')](function(_0x1be8d0){logger[_0x8363('0xf')](_0x8363('0xb'),_0x3a9991,_0x1be8d0);_0x33428d(_0x1be8d0);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index dfab5e6..fdbe194 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 _0x1b21=['/:id/preview','preview','/:id/run','run','query','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x1b21,0x14e));var _0x11b2=function(_0x200f0a,_0x123025){_0x200f0a=_0x200f0a-0x0;var _0x45f574=_0x1b21[_0x200f0a];return _0x45f574;};'use strict';var multer=require(_0x11b2('0x0'));var util=require('util');var path=require(_0x11b2('0x1'));var timeout=require('connect-timeout');var express=require(_0x11b2('0x2'));var router=express[_0x11b2('0x3')]();var fs_extra=require(_0x11b2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x11b2('0x5'));var config=require('../../config/environment');var controller=require(_0x11b2('0x6'));router['get']('/',auth[_0x11b2('0x7')](),controller[_0x11b2('0x8')]);router[_0x11b2('0x9')](_0x11b2('0xa'),auth[_0x11b2('0x7')](),controller['show']);router[_0x11b2('0x9')](_0x11b2('0xb'),auth[_0x11b2('0x7')](),controller[_0x11b2('0xc')]);router['get'](_0x11b2('0xd'),auth[_0x11b2('0x7')](),controller[_0x11b2('0xe')]);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0x11b2('0xf')]);router[_0x11b2('0x10')]('/',auth[_0x11b2('0x7')](),controller[_0x11b2('0x11')]);router[_0x11b2('0x12')](_0x11b2('0xa'),auth[_0x11b2('0x7')](),controller[_0x11b2('0x13')]);router[_0x11b2('0x14')]('/:id',auth[_0x11b2('0x7')](),controller[_0x11b2('0x15')]);module[_0x11b2('0x16')]=router;
\ No newline at end of file
+var _0x283b=['index','get','show','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2c4ef1,_0x1efcc9){var _0x55e3a4=function(_0xbf6330){while(--_0xbf6330){_0x2c4ef1['push'](_0x2c4ef1['shift']());}};_0x55e3a4(++_0x1efcc9);}(_0x283b,0x188));var _0xb283=function(_0x15695b,_0x5d307d){_0x15695b=_0x15695b-0x0;var _0x591375=_0x283b[_0x15695b];return _0x591375;};'use strict';var multer=require(_0xb283('0x0'));var util=require(_0xb283('0x1'));var path=require(_0xb283('0x2'));var timeout=require(_0xb283('0x3'));var express=require(_0xb283('0x4'));var router=express[_0xb283('0x5')]();var fs_extra=require(_0xb283('0x6'));var auth=require(_0xb283('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb283('0x8')]);router[_0xb283('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb283('0xa')]);router[_0xb283('0x9')](_0xb283('0xb'),auth[_0xb283('0xc')](),controller[_0xb283('0xd')]);router[_0xb283('0x9')](_0xb283('0xe'),auth[_0xb283('0xc')](),controller[_0xb283('0xf')]);router[_0xb283('0x9')](_0xb283('0x10'),auth[_0xb283('0xc')](),controller[_0xb283('0x11')]);router[_0xb283('0x12')]('/',auth[_0xb283('0xc')](),controller[_0xb283('0x13')]);router[_0xb283('0x14')](_0xb283('0x15'),auth[_0xb283('0xc')](),controller['update']);router[_0xb283('0x16')]('/:id',auth[_0xb283('0xc')](),controller[_0xb283('0x17')]);module[_0xb283('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 559a087..92f5818 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 _0xee70=['scheduled','INTEGER','UNSIGNED','exports','STRING','ENUM','pdf','csv','DATE','manual'];(function(_0xfacfc5,_0x27dc2d){var _0x4f2f7c=function(_0x9ddeb4){while(--_0x9ddeb4){_0xfacfc5['push'](_0xfacfc5['shift']());}};_0x4f2f7c(++_0x27dc2d);}(_0xee70,0xc1));var _0x0ee7=function(_0x8a5fcd,_0x545f24){_0x8a5fcd=_0x8a5fcd-0x0;var _0x4ffdc8=_0xee70[_0x8a5fcd];return _0x4ffdc8;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x0ee7('0x0')]={'name':{'type':Sequelize[_0x0ee7('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x0ee7('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x0ee7('0x2')]('csv',_0x0ee7('0x3'),'xlsx'),'allowNull':![],'defaultValue':_0x0ee7('0x4')},'savename':{'type':Sequelize[_0x0ee7('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0ee7('0x5')]},'endDate':{'type':Sequelize[_0x0ee7('0x5')]},'status':{'type':Sequelize[_0x0ee7('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x0ee7('0x6'),_0x0ee7('0x7')),'allowNull':![],'defaultValue':_0x0ee7('0x6')},'reportId':{'type':Sequelize[_0x0ee7('0x8')](0xb)[_0x0ee7('0x9')]},'reportType':{'type':Sequelize[_0x0ee7('0x1')]}};
\ No newline at end of file
+var _0xa928=['manual','scheduled','INTEGER','UNSIGNED','sequelize','STRING','ENUM','pdf','xlsx','csv','DATE','Loading'];(function(_0x5b8945,_0x353c7d){var _0x42dbed=function(_0x334163){while(--_0x334163){_0x5b8945['push'](_0x5b8945['shift']());}};_0x42dbed(++_0x353c7d);}(_0xa928,0xf4));var _0x8a92=function(_0x428270,_0x386879){_0x428270=_0x428270-0x0;var _0x5de082=_0xa928[_0x428270];return _0x5de082;};'use strict';var Sequelize=require(_0x8a92('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x8a92('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x8a92('0x2')]('csv',_0x8a92('0x3'),_0x8a92('0x4')),'allowNull':![],'defaultValue':_0x8a92('0x5')},'savename':{'type':Sequelize[_0x8a92('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8a92('0x6')]},'endDate':{'type':Sequelize[_0x8a92('0x6')]},'status':{'type':Sequelize[_0x8a92('0x1')],'defaultValue':_0x8a92('0x7')},'type':{'type':Sequelize[_0x8a92('0x2')](_0x8a92('0x8'),_0x8a92('0x9')),'allowNull':![],'defaultValue':_0x8a92('0x8')},'reportId':{'type':Sequelize[_0x8a92('0xa')](0xb)[_0x8a92('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 939ec1a..87f0b14 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 _0xce02=['attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','savename','output','existsSync','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','offset','Content-Range','json','reject','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields'];(function(_0x29a347,_0x592ca6){var _0x20093a=function(_0x8c65cb){while(--_0x8c65cb){_0x29a347['push'](_0x29a347['shift']());}};_0x20093a(++_0x592ca6);}(_0xce02,0x82));var _0x2ce0=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0xce02[_0x4551f6];return _0x581dc2;};'use strict';var emlformat=require(_0x2ce0('0x0'));var rimraf=require(_0x2ce0('0x1'));var zipdir=require(_0x2ce0('0x2'));var jsonpatch=require(_0x2ce0('0x3'));var rp=require(_0x2ce0('0x4'));var moment=require('moment');var BPromise=require(_0x2ce0('0x5'));var Mustache=require(_0x2ce0('0x6'));var util=require(_0x2ce0('0x7'));var path=require(_0x2ce0('0x8'));var sox=require('sox');var csv=require(_0x2ce0('0x9'));var ejs=require(_0x2ce0('0xa'));var fs=require('fs');var fs_extra=require(_0x2ce0('0xb'));var _=require(_0x2ce0('0xc'));var squel=require('squel');var crypto=require(_0x2ce0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2ce0('0xe'));var toCsv=require(_0x2ce0('0x9'));var querystring=require(_0x2ce0('0xf'));var Papa=require('papaparse');var Redis=require(_0x2ce0('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ce0('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x2ce0('0x12'));var licenseUtil=require(_0x2ce0('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a59d8,_0x3c6f17){_0x3c6f17=_0x3c6f17||0xcc;return function(_0x193533){if(_0x193533){return _0x3a59d8[_0x2ce0('0x14')](_0x3c6f17);}return _0x3a59d8[_0x2ce0('0x15')](_0x3c6f17)['end']();};}function respondWithResult(_0x168de1,_0xb1fe8e){_0xb1fe8e=_0xb1fe8e||0xc8;return function(_0x57f213){if(_0x57f213){return _0x168de1[_0x2ce0('0x15')](_0xb1fe8e)['json'](_0x57f213);}};}function respondWithFilteredResult(_0x58985f,_0x1b7be6){return function(_0x3e23f2){if(_0x3e23f2){var _0x5a667=typeof _0x1b7be6['offset']===_0x2ce0('0x16')&&typeof _0x1b7be6[_0x2ce0('0x17')]==='undefined';var _0x25d881=_0x3e23f2[_0x2ce0('0x18')];var _0xe75b4b=_0x5a667?0x0:_0x1b7be6[_0x2ce0('0x19')];var _0x17b62d=_0x5a667?_0x3e23f2['count']:_0x1b7be6[_0x2ce0('0x19')]+_0x1b7be6[_0x2ce0('0x17')];var _0x3102f9;if(_0x17b62d>=_0x25d881){_0x17b62d=_0x25d881;_0x3102f9=0xc8;}else{_0x3102f9=0xce;}_0x58985f[_0x2ce0('0x15')](_0x3102f9);return _0x58985f['set'](_0x2ce0('0x1a'),_0xe75b4b+'-'+_0x17b62d+'/'+_0x25d881)[_0x2ce0('0x1b')](_0x3e23f2);}return null;};}function patchUpdates(_0x54c6ed){return function(_0x23c318){try{jsonpatch['apply'](_0x23c318,_0x54c6ed,!![]);}catch(_0x400e38){return BPromise[_0x2ce0('0x1c')](_0x400e38);}return _0x23c318['save']();};}function saveUpdates(_0x28c5a2,_0x2316ba){return function(_0x3d2910){if(_0x3d2910){return _0x3d2910[_0x2ce0('0x1d')](_0x28c5a2)[_0x2ce0('0x1e')](function(_0x262956){return _0x262956;});}return null;};}function removeEntity(_0xcf663,_0x41a5ed){return function(_0x3febc9){if(_0x3febc9){return _0x3febc9[_0x2ce0('0x1f')]()['then'](function(){var _0x725950=_0x3febc9[_0x2ce0('0x20')]({'plain':!![]});var _0x3cd223=_0x2ce0('0x21');return db[_0x2ce0('0x22')]['destroy']({'where':{'type':_0x3cd223,'resourceId':_0x725950['id']}})['then'](function(){return _0x3febc9;});})[_0x2ce0('0x1e')](function(){_0xcf663[_0x2ce0('0x15')](0xcc)[_0x2ce0('0x23')]();});}};}function handleEntityNotFound(_0x3c126f,_0x3d6fca){return function(_0xaaebd2){if(!_0xaaebd2){_0x3c126f[_0x2ce0('0x14')](0x194);}return _0xaaebd2;};}function handleError(_0x25afe9,_0x3f2919){_0x3f2919=_0x3f2919||0x1f4;return function(_0x15bad0){logger[_0x2ce0('0x24')](_0x15bad0[_0x2ce0('0x25')]);if(_0x15bad0[_0x2ce0('0x26')]){delete _0x15bad0[_0x2ce0('0x26')];}_0x25afe9[_0x2ce0('0x15')](_0x3f2919)[_0x2ce0('0x27')](_0x15bad0);};}exports[_0x2ce0('0x28')]=function(_0x3afd3a,_0x485e7b){var _0x7c6e23={},_0x1712ac={},_0x583580={'count':0x0,'rows':[]};var _0x461c59=_['map'](db[_0x2ce0('0x29')][_0x2ce0('0x2a')],function(_0x3e1ff5){return{'name':_0x3e1ff5[_0x2ce0('0x2b')],'type':_0x3e1ff5[_0x2ce0('0x2c')][_0x2ce0('0x2d')]};});_0x1712ac[_0x2ce0('0x2e')]=_['map'](_0x461c59,_0x2ce0('0x26'));_0x1712ac['query']=_[_0x2ce0('0x2f')](_0x3afd3a[_0x2ce0('0x30')]);_0x1712ac[_0x2ce0('0x31')]=_[_0x2ce0('0x32')](_0x1712ac[_0x2ce0('0x2e')],_0x1712ac[_0x2ce0('0x30')]);_0x7c6e23['attributes']=_[_0x2ce0('0x32')](_0x1712ac[_0x2ce0('0x2e')],qs['fields'](_0x3afd3a[_0x2ce0('0x30')][_0x2ce0('0x33')]));_0x7c6e23[_0x2ce0('0x34')]=_0x7c6e23[_0x2ce0('0x34')][_0x2ce0('0x35')]?_0x7c6e23[_0x2ce0('0x34')]:_0x1712ac[_0x2ce0('0x2e')];if(!_0x3afd3a[_0x2ce0('0x30')][_0x2ce0('0x36')](_0x2ce0('0x37'))){_0x7c6e23['limit']=qs['limit'](_0x3afd3a[_0x2ce0('0x30')][_0x2ce0('0x17')]);_0x7c6e23[_0x2ce0('0x19')]=qs[_0x2ce0('0x19')](_0x3afd3a[_0x2ce0('0x30')][_0x2ce0('0x19')]);}_0x7c6e23[_0x2ce0('0x38')]=qs[_0x2ce0('0x39')](_0x3afd3a['query'][_0x2ce0('0x39')]);_0x7c6e23[_0x2ce0('0x3a')]=qs[_0x2ce0('0x31')](_['pick'](_0x3afd3a['query'],_0x1712ac[_0x2ce0('0x31')]),_0x461c59);if(_0x3afd3a[_0x2ce0('0x30')]['filter']){_0x7c6e23[_0x2ce0('0x3a')]=_['merge'](_0x7c6e23[_0x2ce0('0x3a')],{'$or':_['map'](_0x461c59,function(_0x2d56f3){if(_0x2d56f3[_0x2ce0('0x2c')]!==_0x2ce0('0x3b')){var _0x25385b={};_0x25385b[_0x2d56f3[_0x2ce0('0x26')]]={'$like':'%'+_0x3afd3a[_0x2ce0('0x30')]['filter']+'%'};return _0x25385b;}})});}_0x7c6e23=_[_0x2ce0('0x3c')]({},_0x7c6e23,_0x3afd3a[_0x2ce0('0x3d')]);var _0x26e492={'where':_0x7c6e23[_0x2ce0('0x3a')]};return db[_0x2ce0('0x29')][_0x2ce0('0x18')](_0x26e492)[_0x2ce0('0x1e')](function(_0x4b71be){_0x583580[_0x2ce0('0x18')]=_0x4b71be;if(_0x3afd3a[_0x2ce0('0x30')][_0x2ce0('0x3e')]){_0x7c6e23[_0x2ce0('0x3f')]=[{'all':!![]}];}return db[_0x2ce0('0x29')][_0x2ce0('0x40')](_0x7c6e23);})[_0x2ce0('0x1e')](function(_0x307d40){_0x583580[_0x2ce0('0x41')]=_0x307d40;return _0x583580;})['then'](respondWithFilteredResult(_0x485e7b,_0x7c6e23))[_0x2ce0('0x42')](handleError(_0x485e7b,null));};exports[_0x2ce0('0x43')]=function(_0x333f13,_0x7e7065){var _0x23f9f8={'raw':!![],'where':{'id':_0x333f13[_0x2ce0('0x44')]['id']}},_0x14276d={};_0x14276d['model']=_[_0x2ce0('0x2f')](db[_0x2ce0('0x29')][_0x2ce0('0x2a')]);_0x14276d['query']=_[_0x2ce0('0x2f')](_0x333f13['query']);_0x14276d[_0x2ce0('0x31')]=_['intersection'](_0x14276d[_0x2ce0('0x2e')],_0x14276d[_0x2ce0('0x30')]);_0x23f9f8[_0x2ce0('0x34')]=_['intersection'](_0x14276d[_0x2ce0('0x2e')],qs[_0x2ce0('0x33')](_0x333f13[_0x2ce0('0x30')]['fields']));_0x23f9f8[_0x2ce0('0x34')]=_0x23f9f8[_0x2ce0('0x34')][_0x2ce0('0x35')]?_0x23f9f8[_0x2ce0('0x34')]:_0x14276d[_0x2ce0('0x2e')];if(_0x333f13[_0x2ce0('0x30')][_0x2ce0('0x3e')]){_0x23f9f8[_0x2ce0('0x3f')]=[{'all':!![]}];}_0x23f9f8=_[_0x2ce0('0x3c')]({},_0x23f9f8,_0x333f13[_0x2ce0('0x3d')]);return db[_0x2ce0('0x29')][_0x2ce0('0x45')](_0x23f9f8)[_0x2ce0('0x1e')](handleEntityNotFound(_0x7e7065,null))[_0x2ce0('0x1e')](respondWithResult(_0x7e7065,null))[_0x2ce0('0x42')](handleError(_0x7e7065,null));};exports[_0x2ce0('0x46')]=function(_0x29d913,_0x5eee3d){return db['AnalyticExtractedReport'][_0x2ce0('0x46')](_0x29d913['body'],{})[_0x2ce0('0x1e')](function(_0x5c67bd){var _0x487238=_0x29d913['user']['get']({'plain':!![]});if(!_0x487238)throw new Error(_0x2ce0('0x47'));if(_0x487238[_0x2ce0('0x48')]===_0x2ce0('0x49')){var _0x5c0f70=_0x5c67bd[_0x2ce0('0x20')]({'plain':!![]});var _0x41e46d=_0x2ce0('0x21');return db[_0x2ce0('0x4a')][_0x2ce0('0x45')]({'where':{'name':_0x41e46d,'userProfileId':_0x487238['userProfileId']},'raw':!![]})[_0x2ce0('0x1e')](function(_0x30825f){if(_0x30825f&&_0x30825f[_0x2ce0('0x4b')]===0x0){return db[_0x2ce0('0x22')][_0x2ce0('0x46')]({'name':_0x5c0f70[_0x2ce0('0x26')],'resourceId':_0x5c0f70['id'],'type':_0x30825f['name'],'sectionId':_0x30825f['id']},{})['then'](function(){return _0x5c67bd;});}else{return _0x5c67bd;}})[_0x2ce0('0x42')](function(_0x2fa4d5){logger[_0x2ce0('0x24')](_0x2ce0('0x4c'),_0x2fa4d5);throw _0x2fa4d5;});}return _0x5c67bd;})[_0x2ce0('0x1e')](respondWithResult(_0x5eee3d,0xc9))['catch'](handleError(_0x5eee3d,null));};exports[_0x2ce0('0x1d')]=function(_0x1d089a,_0x11dae2){if(_0x1d089a[_0x2ce0('0x4d')]['id']){delete _0x1d089a['body']['id'];}return db[_0x2ce0('0x29')][_0x2ce0('0x45')]({'where':{'id':_0x1d089a['params']['id']}})[_0x2ce0('0x1e')](handleEntityNotFound(_0x11dae2,null))[_0x2ce0('0x1e')](saveUpdates(_0x1d089a['body'],null))[_0x2ce0('0x1e')](respondWithResult(_0x11dae2,null))[_0x2ce0('0x42')](handleError(_0x11dae2,null));};exports[_0x2ce0('0x1f')]=function(_0x4150a4,_0x4f2d9e){return db['AnalyticExtractedReport'][_0x2ce0('0x45')]({'where':{'id':_0x4150a4['params']['id']}})[_0x2ce0('0x1e')](handleEntityNotFound(_0x4f2d9e,null))[_0x2ce0('0x1e')](removeEntity(_0x4f2d9e,null))['catch'](handleError(_0x4f2d9e,null));};exports[_0x2ce0('0x4e')]=function(_0x25b753,_0x120214,_0x46ccd2){return db[_0x2ce0('0x29')][_0x2ce0('0x45')]({'where':{'id':_0x25b753[_0x2ce0('0x44')]['id']},'attributes':['name','basename',_0x2ce0('0x4f'),_0x2ce0('0x50')],'raw':!![]})[_0x2ce0('0x1e')](handleEntityNotFound(_0x120214,null))['then'](function(_0x434f4f){if(_0x434f4f){if(!fs[_0x2ce0('0x51')](path['join'](config[_0x2ce0('0x52')],_0x2ce0('0x53'),_0x434f4f[_0x2ce0('0x4f')]))){throw new db['Sequelize'][(_0x2ce0('0x54'))](_0x2ce0('0x55'));}if(_0x25b753[_0x2ce0('0x30')][_0x2ce0('0x56')]){return _0x120214[_0x2ce0('0x14')](0xc8);}return _0x120214[_0x2ce0('0x4e')](path[_0x2ce0('0x57')](config[_0x2ce0('0x52')],'server/files/reports',_0x434f4f['savename']),util['format'](_0x2ce0('0x58'),_0x434f4f[_0x2ce0('0x59')]||_0x434f4f[_0x2ce0('0x26')],_0x434f4f['output'][_0x2ce0('0x5a')]()));}})[_0x2ce0('0x42')](handleError(_0x120214,null));};
\ No newline at end of file
+var _0x621f=['bluebird','mustache','util','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','update','then','get','ExtractedReports','UserProfileResource','destroy','error','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','params','download','basename','savename','output','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','join','format','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1f0911,_0x313a6e){var _0xb41453=function(_0x3d47f0){while(--_0x3d47f0){_0x1f0911['push'](_0x1f0911['shift']());}};_0xb41453(++_0x313a6e);}(_0x621f,0xb5));var _0xf621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x621f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf621('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf621('0x1'));var jsonpatch=require(_0xf621('0x2'));var rp=require(_0xf621('0x3'));var moment=require(_0xf621('0x4'));var BPromise=require(_0xf621('0x5'));var Mustache=require(_0xf621('0x6'));var util=require(_0xf621('0x7'));var path=require(_0xf621('0x8'));var sox=require('sox');var csv=require(_0xf621('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf621('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf621('0xb'));var jsforce=require(_0xf621('0xc'));var deskjs=require(_0xf621('0xd'));var toCsv=require(_0xf621('0x9'));var querystring=require(_0xf621('0xe'));var Papa=require(_0xf621('0xf'));var Redis=require(_0xf621('0x10'));var authService=require(_0xf621('0x11'));var qs=require(_0xf621('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf621('0x13'));var logger=require(_0xf621('0x14'))(_0xf621('0x15'));var utils=require(_0xf621('0x16'));var config=require(_0xf621('0x17'));var licenseUtil=require(_0xf621('0x18'));var db=require(_0xf621('0x19'))['db'];function respondWithStatusCode(_0x33adbb,_0xe5a030){_0xe5a030=_0xe5a030||0xcc;return function(_0x42d98a){if(_0x42d98a){return _0x33adbb[_0xf621('0x1a')](_0xe5a030);}return _0x33adbb[_0xf621('0x1b')](_0xe5a030)[_0xf621('0x1c')]();};}function respondWithResult(_0x5dc7a3,_0x505080){_0x505080=_0x505080||0xc8;return function(_0x125f71){if(_0x125f71){return _0x5dc7a3[_0xf621('0x1b')](_0x505080)['json'](_0x125f71);}};}function respondWithFilteredResult(_0x3e765e,_0x268f9d){return function(_0x5383b3){if(_0x5383b3){var _0x1cf018=typeof _0x268f9d[_0xf621('0x1d')]==='undefined'&&typeof _0x268f9d[_0xf621('0x1e')]===_0xf621('0x1f');var _0x3658c7=_0x5383b3['count'];var _0x47a134=_0x1cf018?0x0:_0x268f9d[_0xf621('0x1d')];var _0x501c38=_0x1cf018?_0x5383b3[_0xf621('0x20')]:_0x268f9d[_0xf621('0x1d')]+_0x268f9d[_0xf621('0x1e')];var _0x141cbd;if(_0x501c38>=_0x3658c7){_0x501c38=_0x3658c7;_0x141cbd=0xc8;}else{_0x141cbd=0xce;}_0x3e765e[_0xf621('0x1b')](_0x141cbd);return _0x3e765e[_0xf621('0x21')](_0xf621('0x22'),_0x47a134+'-'+_0x501c38+'/'+_0x3658c7)[_0xf621('0x23')](_0x5383b3);}return null;};}function patchUpdates(_0x37dc0a){return function(_0x55987c){try{jsonpatch[_0xf621('0x24')](_0x55987c,_0x37dc0a,!![]);}catch(_0x4d1461){return BPromise['reject'](_0x4d1461);}return _0x55987c['save']();};}function saveUpdates(_0x55de5a,_0x5dcd40){return function(_0xa05b05){if(_0xa05b05){return _0xa05b05[_0xf621('0x25')](_0x55de5a)[_0xf621('0x26')](function(_0x59c3e8){return _0x59c3e8;});}return null;};}function removeEntity(_0x58aa17,_0x40eadf){return function(_0x3a49f3){if(_0x3a49f3){return _0x3a49f3['destroy']()[_0xf621('0x26')](function(){var _0x3e7c9c=_0x3a49f3[_0xf621('0x27')]({'plain':!![]});var _0x2475a2=_0xf621('0x28');return db[_0xf621('0x29')][_0xf621('0x2a')]({'where':{'type':_0x2475a2,'resourceId':_0x3e7c9c['id']}})['then'](function(){return _0x3a49f3;});})[_0xf621('0x26')](function(){_0x58aa17['status'](0xcc)[_0xf621('0x1c')]();});}};}function handleEntityNotFound(_0x557bca,_0x41f33c){return function(_0x52444b){if(!_0x52444b){_0x557bca[_0xf621('0x1a')](0x194);}return _0x52444b;};}function handleError(_0x437eba,_0x323f32){_0x323f32=_0x323f32||0x1f4;return function(_0x5606e3){logger[_0xf621('0x2b')](_0x5606e3['stack']);if(_0x5606e3[_0xf621('0x2c')]){delete _0x5606e3[_0xf621('0x2c')];}_0x437eba[_0xf621('0x1b')](_0x323f32)[_0xf621('0x2d')](_0x5606e3);};}exports['index']=function(_0x47dd65,_0xaa54eb){var _0x35e365={},_0x2cdab2={},_0xfab3e8={'count':0x0,'rows':[]};var _0x3280a2=_['map'](db[_0xf621('0x2e')][_0xf621('0x2f')],function(_0x311314){return{'name':_0x311314[_0xf621('0x30')],'type':_0x311314[_0xf621('0x31')][_0xf621('0x32')]};});_0x2cdab2[_0xf621('0x33')]=_[_0xf621('0x34')](_0x3280a2,'name');_0x2cdab2['query']=_[_0xf621('0x35')](_0x47dd65[_0xf621('0x36')]);_0x2cdab2[_0xf621('0x37')]=_[_0xf621('0x38')](_0x2cdab2[_0xf621('0x33')],_0x2cdab2[_0xf621('0x36')]);_0x35e365[_0xf621('0x39')]=_[_0xf621('0x38')](_0x2cdab2[_0xf621('0x33')],qs[_0xf621('0x3a')](_0x47dd65['query'][_0xf621('0x3a')]));_0x35e365['attributes']=_0x35e365[_0xf621('0x39')][_0xf621('0x3b')]?_0x35e365[_0xf621('0x39')]:_0x2cdab2[_0xf621('0x33')];if(!_0x47dd65[_0xf621('0x36')][_0xf621('0x3c')]('nolimit')){_0x35e365[_0xf621('0x1e')]=qs[_0xf621('0x1e')](_0x47dd65[_0xf621('0x36')]['limit']);_0x35e365['offset']=qs[_0xf621('0x1d')](_0x47dd65[_0xf621('0x36')][_0xf621('0x1d')]);}_0x35e365[_0xf621('0x3d')]=qs['sort'](_0x47dd65[_0xf621('0x36')]['sort']);_0x35e365[_0xf621('0x3e')]=qs[_0xf621('0x37')](_['pick'](_0x47dd65[_0xf621('0x36')],_0x2cdab2[_0xf621('0x37')]),_0x3280a2);if(_0x47dd65[_0xf621('0x36')][_0xf621('0x3f')]){_0x35e365['where']=_['merge'](_0x35e365[_0xf621('0x3e')],{'$or':_[_0xf621('0x34')](_0x3280a2,function(_0x1ce303){if(_0x1ce303[_0xf621('0x31')]!==_0xf621('0x40')){var _0x1b5e5a={};_0x1b5e5a[_0x1ce303['name']]={'$like':'%'+_0x47dd65[_0xf621('0x36')][_0xf621('0x3f')]+'%'};return _0x1b5e5a;}})});}_0x35e365=_['merge']({},_0x35e365,_0x47dd65[_0xf621('0x41')]);var _0x1e1ddf={'where':_0x35e365[_0xf621('0x3e')]};return db[_0xf621('0x2e')]['count'](_0x1e1ddf)[_0xf621('0x26')](function(_0xe08612){_0xfab3e8['count']=_0xe08612;if(_0x47dd65[_0xf621('0x36')][_0xf621('0x42')]){_0x35e365[_0xf621('0x43')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xf621('0x44')](_0x35e365);})[_0xf621('0x26')](function(_0x27203e){_0xfab3e8[_0xf621('0x45')]=_0x27203e;return _0xfab3e8;})[_0xf621('0x26')](respondWithFilteredResult(_0xaa54eb,_0x35e365))[_0xf621('0x46')](handleError(_0xaa54eb,null));};exports[_0xf621('0x47')]=function(_0x210b77,_0xbef852){var _0x5a2c55={'raw':!![],'where':{'id':_0x210b77['params']['id']}},_0x31fe23={};_0x31fe23[_0xf621('0x33')]=_['keys'](db[_0xf621('0x2e')]['rawAttributes']);_0x31fe23[_0xf621('0x36')]=_['keys'](_0x210b77[_0xf621('0x36')]);_0x31fe23[_0xf621('0x37')]=_['intersection'](_0x31fe23[_0xf621('0x33')],_0x31fe23[_0xf621('0x36')]);_0x5a2c55[_0xf621('0x39')]=_['intersection'](_0x31fe23['model'],qs[_0xf621('0x3a')](_0x210b77[_0xf621('0x36')][_0xf621('0x3a')]));_0x5a2c55[_0xf621('0x39')]=_0x5a2c55['attributes'][_0xf621('0x3b')]?_0x5a2c55['attributes']:_0x31fe23[_0xf621('0x33')];if(_0x210b77['query'][_0xf621('0x42')]){_0x5a2c55[_0xf621('0x43')]=[{'all':!![]}];}_0x5a2c55=_[_0xf621('0x48')]({},_0x5a2c55,_0x210b77[_0xf621('0x41')]);return db[_0xf621('0x2e')][_0xf621('0x49')](_0x5a2c55)['then'](handleEntityNotFound(_0xbef852,null))['then'](respondWithResult(_0xbef852,null))[_0xf621('0x46')](handleError(_0xbef852,null));};exports['create']=function(_0x15877c,_0x441b89){return db['AnalyticExtractedReport'][_0xf621('0x4a')](_0x15877c[_0xf621('0x4b')],{})['then'](function(_0x451871){var _0x4a9a08=_0x15877c[_0xf621('0x4c')][_0xf621('0x27')]({'plain':!![]});if(!_0x4a9a08)throw new Error(_0xf621('0x4d'));if(_0x4a9a08['role']==='user'){var _0x36481e=_0x451871[_0xf621('0x27')]({'plain':!![]});var _0x183c32=_0xf621('0x28');return db[_0xf621('0x4e')][_0xf621('0x49')]({'where':{'name':_0x183c32,'userProfileId':_0x4a9a08[_0xf621('0x4f')]},'raw':!![]})[_0xf621('0x26')](function(_0x2481cf){if(_0x2481cf&&_0x2481cf['autoAssociation']===0x0){return db[_0xf621('0x29')][_0xf621('0x4a')]({'name':_0x36481e[_0xf621('0x2c')],'resourceId':_0x36481e['id'],'type':_0x2481cf[_0xf621('0x2c')],'sectionId':_0x2481cf['id']},{})[_0xf621('0x26')](function(){return _0x451871;});}else{return _0x451871;}})[_0xf621('0x46')](function(_0x379dfc){logger[_0xf621('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x379dfc);throw _0x379dfc;});}return _0x451871;})[_0xf621('0x26')](respondWithResult(_0x441b89,0xc9))[_0xf621('0x46')](handleError(_0x441b89,null));};exports['update']=function(_0x1dba60,_0xab23ae){if(_0x1dba60[_0xf621('0x4b')]['id']){delete _0x1dba60[_0xf621('0x4b')]['id'];}return db['AnalyticExtractedReport'][_0xf621('0x49')]({'where':{'id':_0x1dba60['params']['id']}})[_0xf621('0x26')](handleEntityNotFound(_0xab23ae,null))[_0xf621('0x26')](saveUpdates(_0x1dba60[_0xf621('0x4b')],null))['then'](respondWithResult(_0xab23ae,null))[_0xf621('0x46')](handleError(_0xab23ae,null));};exports['destroy']=function(_0x2e6e5b,_0x375338){return db[_0xf621('0x2e')][_0xf621('0x49')]({'where':{'id':_0x2e6e5b[_0xf621('0x50')]['id']}})[_0xf621('0x26')](handleEntityNotFound(_0x375338,null))[_0xf621('0x26')](removeEntity(_0x375338,null))['catch'](handleError(_0x375338,null));};exports[_0xf621('0x51')]=function(_0x25dd7c,_0x4f75de,_0x4f61e3){return db[_0xf621('0x2e')][_0xf621('0x49')]({'where':{'id':_0x25dd7c[_0xf621('0x50')]['id']},'attributes':[_0xf621('0x2c'),_0xf621('0x52'),_0xf621('0x53'),_0xf621('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x4f75de,null))[_0xf621('0x26')](function(_0x31b38a){if(_0x31b38a){if(!fs['existsSync'](path['join'](config[_0xf621('0x55')],_0xf621('0x56'),_0x31b38a[_0xf621('0x53')]))){throw new db[(_0xf621('0x57'))][(_0xf621('0x58'))](_0xf621('0x59'));}if(_0x25dd7c[_0xf621('0x36')]['exists']){return _0x4f75de[_0xf621('0x1a')](0xc8);}return _0x4f75de['download'](path[_0xf621('0x5a')](config['root'],_0xf621('0x56'),_0x31b38a[_0xf621('0x53')]),util[_0xf621('0x5b')]('%s.%s',_0x31b38a[_0xf621('0x52')]||_0x31b38a[_0xf621('0x2c')],_0x31b38a[_0xf621('0x54')][_0xf621('0x5c')]()));}})[_0xf621('0x46')](handleError(_0x4f75de,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 86ec184..6d5552e 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 _0x8172=['request-promise','rimraf','../../config/environment','define','AnalyticExtractedReport','util','api','moment'];(function(_0x4d3c86,_0x519f56){var _0x213120=function(_0x1dcd20){while(--_0x1dcd20){_0x4d3c86['push'](_0x4d3c86['shift']());}};_0x213120(++_0x519f56);}(_0x8172,0x7d));var _0x2817=function(_0x1f7fdb,_0x18a0f8){_0x1f7fdb=_0x1f7fdb-0x0;var _0x32792f=_0x8172[_0x1f7fdb];return _0x32792f;};'use strict';var _=require('lodash');var util=require(_0x2817('0x0'));var logger=require('../../config/logger')(_0x2817('0x1'));var moment=require(_0x2817('0x2'));var BPromise=require('bluebird');var rp=require(_0x2817('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2817('0x4'));var config=require(_0x2817('0x5'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x2fba30,_0x3799c4){return _0x2fba30[_0x2817('0x6')](_0x2817('0x7'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6c8a=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x64cddd,_0x5f1aa2){var _0x16142f=function(_0x21e74d){while(--_0x21e74d){_0x64cddd['push'](_0x64cddd['shift']());}};_0x16142f(++_0x5f1aa2);}(_0x6c8a,0x1c1));var _0xa6c8=function(_0xbc1f3c,_0x3cb185){_0xbc1f3c=_0xbc1f3c-0x0;var _0x1bbd42=_0x6c8a[_0xbc1f3c];return _0x1bbd42;};'use strict';var _=require('lodash');var util=require(_0xa6c8('0x0'));var logger=require('../../config/logger')(_0xa6c8('0x1'));var moment=require(_0xa6c8('0x2'));var BPromise=require(_0xa6c8('0x3'));var rp=require(_0xa6c8('0x4'));var fs=require('fs');var path=require(_0xa6c8('0x5'));var rimraf=require('rimraf');var config=require(_0xa6c8('0x6'));var attributes=require(_0xa6c8('0x7'));module[_0xa6c8('0x8')]=function(_0x3a35c1,_0x272553){return _0x3a35c1[_0xa6c8('0x9')](_0xa6c8('0xa'),attributes,{'tableName':_0xa6c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index d3f430e..995f621 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 _0x4c8d=['stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','info','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x35f616,_0xc97542){var _0x4057dc=function(_0x526fd9){while(--_0x526fd9){_0x35f616['push'](_0x35f616['shift']());}};_0x4057dc(++_0xc97542);}(_0x4c8d,0xf7));var _0xd4c8=function(_0x23522c,_0x62b8eb){_0x23522c=_0x23522c-0x0;var _0x105050=_0x4c8d[_0x23522c];return _0x105050;};'use strict';var _=require('lodash');var util=require(_0xd4c8('0x0'));var moment=require(_0xd4c8('0x1'));var BPromise=require(_0xd4c8('0x2'));var rs=require(_0xd4c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4c8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd4c8('0x5'))('rpc');var config=require(_0xd4c8('0x6'));var jayson=require(_0xd4c8('0x7'));var client=jayson[_0xd4c8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1de0f7,_0x1472b9,_0x1bd383){return new BPromise(function(_0x32693c,_0x2dd027){return client[_0xd4c8('0x9')](_0x1de0f7,_0x1bd383)['then'](function(_0x4edf30){logger[_0xd4c8('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1472b9,'request\x20sent');logger['debug'](_0xd4c8('0xb'),_0x1472b9,_0xd4c8('0xc'),JSON[_0xd4c8('0xd')](_0x4edf30));if(_0x4edf30['error']){if(_0x4edf30[_0xd4c8('0xe')][_0xd4c8('0xf')]===0x1f4){logger[_0xd4c8('0xe')](_0xd4c8('0x10'),_0x1472b9,_0x4edf30[_0xd4c8('0xe')][_0xd4c8('0x11')]);return _0x2dd027(_0x4edf30[_0xd4c8('0xe')][_0xd4c8('0x11')]);}logger[_0xd4c8('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1472b9,_0x4edf30['error'][_0xd4c8('0x11')]);return _0x32693c(_0x4edf30[_0xd4c8('0xe')][_0xd4c8('0x11')]);}else{logger['info'](_0xd4c8('0x10'),_0x1472b9,'request\x20sent');_0x32693c(_0x4edf30[_0xd4c8('0x12')][_0xd4c8('0x11')]);}})[_0xd4c8('0x13')](function(_0x32b483){logger[_0xd4c8('0xe')](_0xd4c8('0x10'),_0x1472b9,_0x32b483);_0x2dd027(_0x32b483);});});}
\ No newline at end of file
+var _0xe875=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5f0bf6,_0x46cc44){var _0x5e8e1a=function(_0x37e24a){while(--_0x37e24a){_0x5f0bf6['push'](_0x5f0bf6['shift']());}};_0x5e8e1a(++_0x46cc44);}(_0xe875,0x1b8));var _0x5e87=function(_0x2f146a,_0x20f2bd){_0x2f146a=_0x2f146a-0x0;var _0x1bd7d9=_0xe875[_0x2f146a];return _0x1bd7d9;};'use strict';var _=require(_0x5e87('0x0'));var util=require(_0x5e87('0x1'));var moment=require(_0x5e87('0x2'));var BPromise=require(_0x5e87('0x3'));var rs=require(_0x5e87('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5e87('0x5'));var logger=require(_0x5e87('0x6'))(_0x5e87('0x7'));var config=require(_0x5e87('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5e87('0x9')][_0x5e87('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x250eef,_0x358587,_0xc3bc1e){return new BPromise(function(_0x13feab,_0x4636ed){return client[_0x5e87('0xb')](_0x250eef,_0xc3bc1e)[_0x5e87('0xc')](function(_0x10f7ca){logger[_0x5e87('0xd')](_0x5e87('0xe'),_0x358587,_0x5e87('0xf'));logger[_0x5e87('0x10')](_0x5e87('0x11'),_0x358587,_0x5e87('0xf'),JSON[_0x5e87('0x12')](_0x10f7ca));if(_0x10f7ca[_0x5e87('0x13')]){if(_0x10f7ca[_0x5e87('0x13')]['code']===0x1f4){logger[_0x5e87('0x13')](_0x5e87('0xe'),_0x358587,_0x10f7ca[_0x5e87('0x13')]['message']);return _0x4636ed(_0x10f7ca[_0x5e87('0x13')][_0x5e87('0x14')]);}logger[_0x5e87('0x13')](_0x5e87('0xe'),_0x358587,_0x10f7ca[_0x5e87('0x13')][_0x5e87('0x14')]);return _0x13feab(_0x10f7ca[_0x5e87('0x13')]['message']);}else{logger[_0x5e87('0xd')](_0x5e87('0xe'),_0x358587,'request\x20sent');_0x13feab(_0x10f7ca[_0x5e87('0x15')][_0x5e87('0x14')]);}})[_0x5e87('0x16')](function(_0x9a5c07){logger[_0x5e87('0x13')](_0x5e87('0xe'),_0x358587,_0x9a5c07);_0x4636ed(_0x9a5c07);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index b3468c5..e4070da 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 _0xdd93=['get','show','/:id/download','download','post','create','put','update','delete','/:id','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index'];(function(_0x241e91,_0x26ebf4){var _0x341357=function(_0x135941){while(--_0x135941){_0x241e91['push'](_0x241e91['shift']());}};_0x341357(++_0x26ebf4);}(_0xdd93,0xf1));var _0x3dd9=function(_0x598e12,_0x3aea87){_0x598e12=_0x598e12-0x0;var _0x4c343d=_0xdd93[_0x598e12];return _0x4c343d;};'use strict';var multer=require(_0x3dd9('0x0'));var util=require(_0x3dd9('0x1'));var path=require(_0x3dd9('0x2'));var timeout=require(_0x3dd9('0x3'));var express=require('express');var router=express[_0x3dd9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3dd9('0x5'));var interaction=require(_0x3dd9('0x6'));var config=require(_0x3dd9('0x7'));var controller=require(_0x3dd9('0x8'));router['get']('/',auth[_0x3dd9('0x9')](),controller[_0x3dd9('0xa')]);router[_0x3dd9('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x3dd9('0xc')]);router['get'](_0x3dd9('0xd'),auth['isAuthenticated'](),controller[_0x3dd9('0xe')]);router[_0x3dd9('0xf')]('/',auth[_0x3dd9('0x9')](),controller[_0x3dd9('0x10')]);router[_0x3dd9('0x11')]('/:id',auth[_0x3dd9('0x9')](),controller[_0x3dd9('0x12')]);router[_0x3dd9('0x13')](_0x3dd9('0x14'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe320=['util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','post','create','/:id','delete','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe320,0x109));var _0x0e32=function(_0x536e5a,_0x512421){_0x536e5a=_0x536e5a-0x0;var _0x17821c=_0xe320[_0x536e5a];return _0x17821c;};'use strict';var multer=require(_0x0e32('0x0'));var util=require(_0x0e32('0x1'));var path=require(_0x0e32('0x2'));var timeout=require(_0x0e32('0x3'));var express=require(_0x0e32('0x4'));var router=express[_0x0e32('0x5')]();var fs_extra=require(_0x0e32('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0e32('0x7'));var controller=require(_0x0e32('0x8'));router[_0x0e32('0x9')]('/',auth[_0x0e32('0xa')](),controller[_0x0e32('0xb')]);router['get']('/:id',auth[_0x0e32('0xa')](),controller[_0x0e32('0xc')]);router[_0x0e32('0x9')](_0x0e32('0xd'),auth[_0x0e32('0xa')](),controller['download']);router[_0x0e32('0xe')]('/',auth[_0x0e32('0xa')](),controller[_0x0e32('0xf')]);router['put'](_0x0e32('0x10'),auth[_0x0e32('0xa')](),controller['update']);router[_0x0e32('0x11')](_0x0e32('0x10'),auth[_0x0e32('0xa')](),controller['destroy']);module[_0x0e32('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index d5cb1f9..6c92ce1 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 _0xc4e1=['sequelize','exports','STRING','BOOLEAN'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xc4e1,0x12c));var _0x1c4e=function(_0x3e4e70,_0x5772a4){_0x3e4e70=_0x3e4e70-0x0;var _0x264dc5=_0xc4e1[_0x3e4e70];return _0x264dc5;};'use strict';var Sequelize=require(_0x1c4e('0x0'));module[_0x1c4e('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x1c4e('0x2')]},'format':{'type':Sequelize[_0x1c4e('0x2')]},'groupBy':{'type':Sequelize[_0x1c4e('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1c4e('0x2')]},'custom':{'type':Sequelize[_0x1c4e('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x8186=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x2a1d67,_0x250f1b){var _0x52b432=function(_0x211fcd){while(--_0x211fcd){_0x2a1d67['push'](_0x2a1d67['shift']());}};_0x52b432(++_0x250f1b);}(_0x8186,0x188));var _0x6818=function(_0x2e8418,_0x58c529){_0x2e8418=_0x2e8418-0x0;var _0x548fe6=_0x8186[_0x2e8418];return _0x548fe6;};'use strict';var Sequelize=require(_0x6818('0x0'));module[_0x6818('0x1')]={'field':{'type':Sequelize[_0x6818('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x6818('0x3')]},'format':{'type':Sequelize[_0x6818('0x3')]},'groupBy':{'type':Sequelize[_0x6818('0x4')],'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 2886a77..457996f 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 _0x08f5=['merge','where','VIRTUAL','options','includeAll','findAll','show','params','rawAttributes','keys','find','catch','create','body','bulkCreate','update','destroy','bulkDestroy','ids','AnalyticCustomReport','transaction','CustomReportId','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','map','AnalyticFieldReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter'];(function(_0x5d0a4c,_0x5b5929){var _0x27ffd9=function(_0x1bbb1e){while(--_0x1bbb1e){_0x5d0a4c['push'](_0x5d0a4c['shift']());}};_0x27ffd9(++_0x5b5929);}(_0x08f5,0x197));var _0x508f=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0x08f5[_0x51e79c];return _0x2467be;};'use strict';var emlformat=require(_0x508f('0x0'));var rimraf=require(_0x508f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x508f('0x2'));var moment=require(_0x508f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x508f('0x4'));var path=require(_0x508f('0x5'));var sox=require(_0x508f('0x6'));var csv=require(_0x508f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x508f('0x8'));var _=require('lodash');var squel=require(_0x508f('0x9'));var crypto=require(_0x508f('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x508f('0x7'));var querystring=require(_0x508f('0xb'));var Papa=require('papaparse');var Redis=require(_0x508f('0xc'));var authService=require(_0x508f('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x508f('0xe'));var logger=require(_0x508f('0xf'))(_0x508f('0x10'));var utils=require('../../config/utils');var config=require(_0x508f('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x508f('0x12'))['db'];function respondWithStatusCode(_0x142f4a,_0x4bff7c){_0x4bff7c=_0x4bff7c||0xcc;return function(_0x1d23c4){if(_0x1d23c4){return _0x142f4a[_0x508f('0x13')](_0x4bff7c);}return _0x142f4a[_0x508f('0x14')](_0x4bff7c)[_0x508f('0x15')]();};}function respondWithResult(_0x480994,_0x3567ce){_0x3567ce=_0x3567ce||0xc8;return function(_0x3cbeea){if(_0x3cbeea){return _0x480994[_0x508f('0x14')](_0x3567ce)['json'](_0x3cbeea);}};}function respondWithFilteredResult(_0x1f8b40,_0x52c2f1){return function(_0x17ea31){if(_0x17ea31){var _0x47f22d=typeof _0x52c2f1[_0x508f('0x16')]==='undefined'&&typeof _0x52c2f1[_0x508f('0x17')]===_0x508f('0x18');var _0x267914=_0x17ea31['count'];var _0x556d59=_0x47f22d?0x0:_0x52c2f1[_0x508f('0x16')];var _0x40c876=_0x47f22d?_0x17ea31[_0x508f('0x19')]:_0x52c2f1[_0x508f('0x16')]+_0x52c2f1[_0x508f('0x17')];var _0x264ad0;if(_0x40c876>=_0x267914){_0x40c876=_0x267914;_0x264ad0=0xc8;}else{_0x264ad0=0xce;}_0x1f8b40[_0x508f('0x14')](_0x264ad0);return _0x1f8b40[_0x508f('0x1a')](_0x508f('0x1b'),_0x556d59+'-'+_0x40c876+'/'+_0x267914)[_0x508f('0x1c')](_0x17ea31);}return null;};}function patchUpdates(_0x306fa1){return function(_0x563609){try{jsonpatch[_0x508f('0x1d')](_0x563609,_0x306fa1,!![]);}catch(_0x4d81dd){return BPromise[_0x508f('0x1e')](_0x4d81dd);}return _0x563609[_0x508f('0x1f')]();};}function saveUpdates(_0x171af7,_0x3927b2){return function(_0x14ebae){if(_0x14ebae){return _0x14ebae['update'](_0x171af7)[_0x508f('0x20')](function(_0xaecad9){return _0xaecad9;});}return null;};}function removeEntity(_0x5aa696,_0x191347){return function(_0x429ede){if(_0x429ede){return _0x429ede['destroy']()['then'](function(){_0x5aa696[_0x508f('0x14')](0xcc)[_0x508f('0x15')]();});}};}function handleEntityNotFound(_0x31d39e,_0x4b778c){return function(_0x380da6){if(!_0x380da6){_0x31d39e[_0x508f('0x13')](0x194);}return _0x380da6;};}function handleError(_0xef2c41,_0x547385){_0x547385=_0x547385||0x1f4;return function(_0x385634){logger[_0x508f('0x21')](_0x385634[_0x508f('0x22')]);if(_0x385634[_0x508f('0x23')]){delete _0x385634[_0x508f('0x23')];}_0xef2c41[_0x508f('0x14')](_0x547385)[_0x508f('0x24')](_0x385634);};}exports['index']=function(_0x46b726,_0x5589ea){var _0x3bf539={},_0x389932={},_0x143bd5={'count':0x0,'rows':[]};var _0x49278a=_[_0x508f('0x25')](db[_0x508f('0x26')]['rawAttributes'],function(_0x3ea9b9){return{'name':_0x3ea9b9[_0x508f('0x27')],'type':_0x3ea9b9[_0x508f('0x28')][_0x508f('0x29')]};});_0x389932[_0x508f('0x2a')]=_[_0x508f('0x25')](_0x49278a,_0x508f('0x23'));_0x389932[_0x508f('0x2b')]=_['keys'](_0x46b726[_0x508f('0x2b')]);_0x389932[_0x508f('0x2c')]=_[_0x508f('0x2d')](_0x389932['model'],_0x389932[_0x508f('0x2b')]);_0x3bf539['attributes']=_[_0x508f('0x2d')](_0x389932[_0x508f('0x2a')],qs[_0x508f('0x2e')](_0x46b726[_0x508f('0x2b')][_0x508f('0x2e')]));_0x3bf539[_0x508f('0x2f')]=_0x3bf539['attributes'][_0x508f('0x30')]?_0x3bf539[_0x508f('0x2f')]:_0x389932[_0x508f('0x2a')];if(!_0x46b726[_0x508f('0x2b')][_0x508f('0x31')](_0x508f('0x32'))){_0x3bf539[_0x508f('0x17')]=qs['limit'](_0x46b726[_0x508f('0x2b')][_0x508f('0x17')]);_0x3bf539[_0x508f('0x16')]=qs[_0x508f('0x16')](_0x46b726[_0x508f('0x2b')]['offset']);}_0x3bf539[_0x508f('0x33')]=qs[_0x508f('0x34')](_0x46b726[_0x508f('0x2b')][_0x508f('0x34')]);_0x3bf539['where']=qs['filters'](_[_0x508f('0x35')](_0x46b726[_0x508f('0x2b')],_0x389932['filters']),_0x49278a);if(_0x46b726[_0x508f('0x2b')][_0x508f('0x36')]){_0x3bf539['where']=_[_0x508f('0x37')](_0x3bf539[_0x508f('0x38')],{'$or':_[_0x508f('0x25')](_0x49278a,function(_0xc99402){if(_0xc99402[_0x508f('0x28')]!==_0x508f('0x39')){var _0x335d80={};_0x335d80[_0xc99402[_0x508f('0x23')]]={'$like':'%'+_0x46b726[_0x508f('0x2b')][_0x508f('0x36')]+'%'};return _0x335d80;}})});}_0x3bf539=_[_0x508f('0x37')]({},_0x3bf539,_0x46b726[_0x508f('0x3a')]);var _0x202346={'where':_0x3bf539[_0x508f('0x38')]};return db['AnalyticFieldReport']['count'](_0x202346)[_0x508f('0x20')](function(_0x15eb63){_0x143bd5['count']=_0x15eb63;if(_0x46b726['query'][_0x508f('0x3b')]){_0x3bf539['include']=[{'all':!![]}];}return db[_0x508f('0x26')][_0x508f('0x3c')](_0x3bf539);})['then'](function(_0x30c34f){_0x143bd5['rows']=_0x30c34f;return _0x143bd5;})['then'](respondWithFilteredResult(_0x5589ea,_0x3bf539))['catch'](handleError(_0x5589ea,null));};exports[_0x508f('0x3d')]=function(_0x6ec73b,_0x310e7c){var _0x2460e4={'raw':![],'where':{'id':_0x6ec73b[_0x508f('0x3e')]['id']}},_0x3ec91f={};_0x3ec91f[_0x508f('0x2a')]=_['keys'](db['AnalyticFieldReport'][_0x508f('0x3f')]);_0x3ec91f[_0x508f('0x2b')]=_[_0x508f('0x40')](_0x6ec73b[_0x508f('0x2b')]);_0x3ec91f[_0x508f('0x2c')]=_[_0x508f('0x2d')](_0x3ec91f[_0x508f('0x2a')],_0x3ec91f[_0x508f('0x2b')]);_0x2460e4[_0x508f('0x2f')]=_[_0x508f('0x2d')](_0x3ec91f[_0x508f('0x2a')],qs[_0x508f('0x2e')](_0x6ec73b[_0x508f('0x2b')]['fields']));_0x2460e4[_0x508f('0x2f')]=_0x2460e4[_0x508f('0x2f')][_0x508f('0x30')]?_0x2460e4['attributes']:_0x3ec91f[_0x508f('0x2a')];if(_0x6ec73b[_0x508f('0x2b')][_0x508f('0x3b')]){_0x2460e4['include']=[{'all':!![]}];}_0x2460e4=_['merge']({},_0x2460e4,_0x6ec73b['options']);return db['AnalyticFieldReport'][_0x508f('0x41')](_0x2460e4)[_0x508f('0x20')](handleEntityNotFound(_0x310e7c,null))[_0x508f('0x20')](respondWithResult(_0x310e7c,null))[_0x508f('0x42')](handleError(_0x310e7c,null));};exports[_0x508f('0x43')]=function(_0x3fe728,_0xbeb9af){return db['AnalyticFieldReport'][_0x508f('0x43')](_0x3fe728[_0x508f('0x44')],{})[_0x508f('0x20')](respondWithResult(_0xbeb9af,0xc9))['catch'](handleError(_0xbeb9af,null));};exports[_0x508f('0x45')]=function(_0x165f1d,_0x197da7){return db['AnalyticFieldReport'][_0x508f('0x45')](_0x165f1d[_0x508f('0x44')],{'raw':![],'individualHooks':!![]})[_0x508f('0x20')](respondWithResult(_0x197da7,0xc9))[_0x508f('0x42')](handleError(_0x197da7,null));};exports[_0x508f('0x46')]=function(_0x10ff20,_0x49e73c){if(_0x10ff20[_0x508f('0x44')]['id']){delete _0x10ff20[_0x508f('0x44')]['id'];}return db[_0x508f('0x26')]['find']({'where':{'id':_0x10ff20['params']['id']}})[_0x508f('0x20')](handleEntityNotFound(_0x49e73c,null))['then'](saveUpdates(_0x10ff20[_0x508f('0x44')],null))['then'](respondWithResult(_0x49e73c,null))[_0x508f('0x42')](handleError(_0x49e73c,null));};exports[_0x508f('0x47')]=function(_0x4f7720,_0x2d0f75){return db['AnalyticFieldReport'][_0x508f('0x41')]({'where':{'id':_0x4f7720[_0x508f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2d0f75,null))[_0x508f('0x20')](removeEntity(_0x2d0f75,null))['catch'](handleError(_0x2d0f75,null));};exports[_0x508f('0x48')]=function(_0x51a783,_0x568198){return db[_0x508f('0x26')]['destroy']({'where':{'id':_0x51a783[_0x508f('0x2b')][_0x508f('0x49')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x568198,0xcc))[_0x508f('0x42')](handleError(_0x568198,null));};exports['addFields']=function(_0x12e4d4,_0x5717f8,_0x3881a4){return db[_0x508f('0x4a')]['findOne']({'where':{'id':_0x12e4d4[_0x508f('0x3e')]['id']}})[_0x508f('0x20')](handleEntityNotFound(_0x5717f8,null))[_0x508f('0x20')](function(_0x1ad709){if(_0x1ad709){return db['sequelize'][_0x508f('0x4b')](function(_0x5e8c90){return db['AnalyticFieldReport'][_0x508f('0x47')]({'where':{'CustomReportId':_0x12e4d4[_0x508f('0x3e')]['id']},'transaction':_0x5e8c90})[_0x508f('0x20')](function(_0x94cb6d){var _0x1aea41=_[_0x508f('0x25')](_0x12e4d4['body'],function(_0x94a9e){delete _0x94a9e['id'];_0x94a9e[_0x508f('0x4c')]=_0x12e4d4['params']['id'];return _0x94a9e;});return db[_0x508f('0x26')][_0x508f('0x45')](_0x1aea41,{'transaction':_0x5e8c90});});})[_0x508f('0x20')](function(){return db[_0x508f('0x26')][_0x508f('0x3c')]({'where':{'CustomReportId':_0x12e4d4['params']['id']}});});}})['then'](respondWithResult(_0x5717f8,null))[_0x508f('0x42')](handleError(_0x5717f8,null));};
\ No newline at end of file
+var _0x65b6=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','update','then','destroy','stack','name','send','index','type','key','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','options','AnalyticFieldReport','includeAll','rows','catch','params','rawAttributes','intersection','length','include','bulkCreate','body','find','bulkDestroy','ids','AnalyticCustomReport','findOne','transaction','findAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0xfb7458,_0x26472d){var _0x5de66d=function(_0x448fdb){while(--_0x448fdb){_0xfb7458['push'](_0xfb7458['shift']());}};_0x5de66d(++_0x26472d);}(_0x65b6,0x1c3));var _0x665b=function(_0x50cf08,_0x5eb8c5){_0x50cf08=_0x50cf08-0x0;var _0x23a9df=_0x65b6[_0x50cf08];return _0x23a9df;};'use strict';var emlformat=require(_0x665b('0x0'));var rimraf=require(_0x665b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x665b('0x2'));var rp=require(_0x665b('0x3'));var moment=require(_0x665b('0x4'));var BPromise=require(_0x665b('0x5'));var Mustache=require(_0x665b('0x6'));var util=require(_0x665b('0x7'));var path=require(_0x665b('0x8'));var sox=require(_0x665b('0x9'));var csv=require('to-csv');var ejs=require(_0x665b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x665b('0xb'));var squel=require(_0x665b('0xc'));var crypto=require(_0x665b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x665b('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x665b('0xf'));var qs=require(_0x665b('0x10'));var as=require(_0x665b('0x11'));var hardwareService=require(_0x665b('0x12'));var logger=require(_0x665b('0x13'))(_0x665b('0x14'));var utils=require(_0x665b('0x15'));var config=require(_0x665b('0x16'));var licenseUtil=require(_0x665b('0x17'));var db=require(_0x665b('0x18'))['db'];function respondWithStatusCode(_0xff7c23,_0x291204){_0x291204=_0x291204||0xcc;return function(_0x894f5b){if(_0x894f5b){return _0xff7c23[_0x665b('0x19')](_0x291204);}return _0xff7c23[_0x665b('0x1a')](_0x291204)[_0x665b('0x1b')]();};}function respondWithResult(_0x33811f,_0x21cb45){_0x21cb45=_0x21cb45||0xc8;return function(_0x4377a0){if(_0x4377a0){return _0x33811f[_0x665b('0x1a')](_0x21cb45)[_0x665b('0x1c')](_0x4377a0);}};}function respondWithFilteredResult(_0x406576,_0x2b2a41){return function(_0x41f654){if(_0x41f654){var _0x3abcbd=typeof _0x2b2a41['offset']===_0x665b('0x1d')&&typeof _0x2b2a41[_0x665b('0x1e')]===_0x665b('0x1d');var _0x206f6a=_0x41f654[_0x665b('0x1f')];var _0x440f48=_0x3abcbd?0x0:_0x2b2a41[_0x665b('0x20')];var _0x18f6d1=_0x3abcbd?_0x41f654['count']:_0x2b2a41[_0x665b('0x20')]+_0x2b2a41[_0x665b('0x1e')];var _0x299483;if(_0x18f6d1>=_0x206f6a){_0x18f6d1=_0x206f6a;_0x299483=0xc8;}else{_0x299483=0xce;}_0x406576['status'](_0x299483);return _0x406576['set'](_0x665b('0x21'),_0x440f48+'-'+_0x18f6d1+'/'+_0x206f6a)['json'](_0x41f654);}return null;};}function patchUpdates(_0x3e8142){return function(_0x5006e0){try{jsonpatch[_0x665b('0x22')](_0x5006e0,_0x3e8142,!![]);}catch(_0x261f65){return BPromise['reject'](_0x261f65);}return _0x5006e0['save']();};}function saveUpdates(_0x41bc99,_0x2ad3cf){return function(_0x3c54a3){if(_0x3c54a3){return _0x3c54a3[_0x665b('0x23')](_0x41bc99)[_0x665b('0x24')](function(_0x2a6bf4){return _0x2a6bf4;});}return null;};}function removeEntity(_0x540042,_0x3d752a){return function(_0x464e56){if(_0x464e56){return _0x464e56[_0x665b('0x25')]()[_0x665b('0x24')](function(){_0x540042[_0x665b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d035e,_0x4c53c8){return function(_0x5917d6){if(!_0x5917d6){_0x4d035e[_0x665b('0x19')](0x194);}return _0x5917d6;};}function handleError(_0x4324b1,_0x2d2ea7){_0x2d2ea7=_0x2d2ea7||0x1f4;return function(_0x3e1687){logger['error'](_0x3e1687[_0x665b('0x26')]);if(_0x3e1687[_0x665b('0x27')]){delete _0x3e1687['name'];}_0x4324b1[_0x665b('0x1a')](_0x2d2ea7)[_0x665b('0x28')](_0x3e1687);};}exports[_0x665b('0x29')]=function(_0xf57a51,_0x3217ca){var _0x4aba7f={},_0x1643fb={},_0x3db01f={'count':0x0,'rows':[]};var _0x328890=_['map'](db['AnalyticFieldReport']['rawAttributes'],function(_0x56c8b0){return{'name':_0x56c8b0['fieldName'],'type':_0x56c8b0[_0x665b('0x2a')][_0x665b('0x2b')]};});_0x1643fb[_0x665b('0x2c')]=_['map'](_0x328890,'name');_0x1643fb[_0x665b('0x2d')]=_[_0x665b('0x2e')](_0xf57a51[_0x665b('0x2d')]);_0x1643fb[_0x665b('0x2f')]=_['intersection'](_0x1643fb[_0x665b('0x2c')],_0x1643fb[_0x665b('0x2d')]);_0x4aba7f['attributes']=_['intersection'](_0x1643fb['model'],qs[_0x665b('0x30')](_0xf57a51[_0x665b('0x2d')][_0x665b('0x30')]));_0x4aba7f[_0x665b('0x31')]=_0x4aba7f[_0x665b('0x31')]['length']?_0x4aba7f['attributes']:_0x1643fb[_0x665b('0x2c')];if(!_0xf57a51['query'][_0x665b('0x32')](_0x665b('0x33'))){_0x4aba7f['limit']=qs[_0x665b('0x1e')](_0xf57a51[_0x665b('0x2d')][_0x665b('0x1e')]);_0x4aba7f[_0x665b('0x20')]=qs[_0x665b('0x20')](_0xf57a51[_0x665b('0x2d')][_0x665b('0x20')]);}_0x4aba7f[_0x665b('0x34')]=qs[_0x665b('0x35')](_0xf57a51[_0x665b('0x2d')]['sort']);_0x4aba7f[_0x665b('0x36')]=qs[_0x665b('0x2f')](_[_0x665b('0x37')](_0xf57a51['query'],_0x1643fb[_0x665b('0x2f')]),_0x328890);if(_0xf57a51[_0x665b('0x2d')]['filter']){_0x4aba7f[_0x665b('0x36')]=_['merge'](_0x4aba7f[_0x665b('0x36')],{'$or':_[_0x665b('0x38')](_0x328890,function(_0x39dfdb){if(_0x39dfdb[_0x665b('0x2a')]!==_0x665b('0x39')){var _0x43b99f={};_0x43b99f[_0x39dfdb[_0x665b('0x27')]]={'$like':'%'+_0xf57a51[_0x665b('0x2d')][_0x665b('0x3a')]+'%'};return _0x43b99f;}})});}_0x4aba7f=_[_0x665b('0x3b')]({},_0x4aba7f,_0xf57a51[_0x665b('0x3c')]);var _0x1ca726={'where':_0x4aba7f[_0x665b('0x36')]};return db[_0x665b('0x3d')]['count'](_0x1ca726)[_0x665b('0x24')](function(_0xcbf16c){_0x3db01f[_0x665b('0x1f')]=_0xcbf16c;if(_0xf57a51[_0x665b('0x2d')][_0x665b('0x3e')]){_0x4aba7f['include']=[{'all':!![]}];}return db[_0x665b('0x3d')]['findAll'](_0x4aba7f);})['then'](function(_0xe9e657){_0x3db01f[_0x665b('0x3f')]=_0xe9e657;return _0x3db01f;})[_0x665b('0x24')](respondWithFilteredResult(_0x3217ca,_0x4aba7f))[_0x665b('0x40')](handleError(_0x3217ca,null));};exports['show']=function(_0x471779,_0x169602){var _0x10430c={'raw':![],'where':{'id':_0x471779[_0x665b('0x41')]['id']}},_0x274d0a={};_0x274d0a[_0x665b('0x2c')]=_[_0x665b('0x2e')](db[_0x665b('0x3d')][_0x665b('0x42')]);_0x274d0a[_0x665b('0x2d')]=_[_0x665b('0x2e')](_0x471779['query']);_0x274d0a['filters']=_[_0x665b('0x43')](_0x274d0a['model'],_0x274d0a['query']);_0x10430c[_0x665b('0x31')]=_[_0x665b('0x43')](_0x274d0a[_0x665b('0x2c')],qs[_0x665b('0x30')](_0x471779[_0x665b('0x2d')][_0x665b('0x30')]));_0x10430c[_0x665b('0x31')]=_0x10430c['attributes'][_0x665b('0x44')]?_0x10430c[_0x665b('0x31')]:_0x274d0a['model'];if(_0x471779[_0x665b('0x2d')][_0x665b('0x3e')]){_0x10430c[_0x665b('0x45')]=[{'all':!![]}];}_0x10430c=_[_0x665b('0x3b')]({},_0x10430c,_0x471779[_0x665b('0x3c')]);return db[_0x665b('0x3d')]['find'](_0x10430c)[_0x665b('0x24')](handleEntityNotFound(_0x169602,null))[_0x665b('0x24')](respondWithResult(_0x169602,null))[_0x665b('0x40')](handleError(_0x169602,null));};exports['create']=function(_0xc65393,_0x59e235){return db[_0x665b('0x3d')]['create'](_0xc65393['body'],{})[_0x665b('0x24')](respondWithResult(_0x59e235,0xc9))[_0x665b('0x40')](handleError(_0x59e235,null));};exports[_0x665b('0x46')]=function(_0x51154a,_0x376139){return db[_0x665b('0x3d')][_0x665b('0x46')](_0x51154a['body'],{'raw':![],'individualHooks':!![]})[_0x665b('0x24')](respondWithResult(_0x376139,0xc9))['catch'](handleError(_0x376139,null));};exports[_0x665b('0x23')]=function(_0x197c9e,_0x31a0f8){if(_0x197c9e[_0x665b('0x47')]['id']){delete _0x197c9e[_0x665b('0x47')]['id'];}return db[_0x665b('0x3d')][_0x665b('0x48')]({'where':{'id':_0x197c9e[_0x665b('0x41')]['id']}})[_0x665b('0x24')](handleEntityNotFound(_0x31a0f8,null))[_0x665b('0x24')](saveUpdates(_0x197c9e[_0x665b('0x47')],null))[_0x665b('0x24')](respondWithResult(_0x31a0f8,null))[_0x665b('0x40')](handleError(_0x31a0f8,null));};exports[_0x665b('0x25')]=function(_0x282dbc,_0x14cdbf){return db['AnalyticFieldReport'][_0x665b('0x48')]({'where':{'id':_0x282dbc[_0x665b('0x41')]['id']}})[_0x665b('0x24')](handleEntityNotFound(_0x14cdbf,null))[_0x665b('0x24')](removeEntity(_0x14cdbf,null))[_0x665b('0x40')](handleError(_0x14cdbf,null));};exports[_0x665b('0x49')]=function(_0x42eaa5,_0x34614a){return db[_0x665b('0x3d')][_0x665b('0x25')]({'where':{'id':_0x42eaa5[_0x665b('0x2d')][_0x665b('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x665b('0x24')](respondWithResult(_0x34614a,0xcc))[_0x665b('0x40')](handleError(_0x34614a,null));};exports['addFields']=function(_0x28a6f8,_0x38599c,_0x2188cb){return db[_0x665b('0x4b')][_0x665b('0x4c')]({'where':{'id':_0x28a6f8[_0x665b('0x41')]['id']}})[_0x665b('0x24')](handleEntityNotFound(_0x38599c,null))[_0x665b('0x24')](function(_0x11f621){if(_0x11f621){return db['sequelize'][_0x665b('0x4d')](function(_0xe7b108){return db[_0x665b('0x3d')][_0x665b('0x25')]({'where':{'CustomReportId':_0x28a6f8[_0x665b('0x41')]['id']},'transaction':_0xe7b108})['then'](function(_0x5a4373){var _0x3875d1=_[_0x665b('0x38')](_0x28a6f8[_0x665b('0x47')],function(_0x38d1c9){delete _0x38d1c9['id'];_0x38d1c9['CustomReportId']=_0x28a6f8['params']['id'];return _0x38d1c9;});return db['AnalyticFieldReport']['bulkCreate'](_0x3875d1,{'transaction':_0xe7b108});});})[_0x665b('0x24')](function(){return db[_0x665b('0x3d')][_0x665b('0x4e')]({'where':{'CustomReportId':_0x28a6f8[_0x665b('0x41')]['id']}});});}})['then'](respondWithResult(_0x38599c,null))[_0x665b('0x40')](handleError(_0x38599c,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index bb4252b..c3973df 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 _0xc5e8=['lodash','moment','bluebird','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc5e8,0xab));var _0x8c5e=function(_0x182dfc,_0x521382){_0x182dfc=_0x182dfc-0x0;var _0x287b78=_0xc5e8[_0x182dfc];return _0x287b78;};'use strict';var _=require(_0x8c5e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8c5e('0x1'));var BPromise=require(_0x8c5e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8c5e('0x3'));var config=require(_0x8c5e('0x4'));var attributes=require(_0x8c5e('0x5'));module[_0x8c5e('0x6')]=function(_0x3c7ea9,_0x2cde4e){return _0x3c7ea9[_0x8c5e('0x7')]('AnalyticFieldReport',attributes,{'tableName':_0x8c5e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe4ca=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xe4ca,0x1d0));var _0xae4c=function(_0x390aca,_0x25ea70){_0x390aca=_0x390aca-0x0;var _0x48eeba=_0xe4ca[_0x390aca];return _0x48eeba;};'use strict';var _=require(_0xae4c('0x0'));var util=require(_0xae4c('0x1'));var logger=require(_0xae4c('0x2'))(_0xae4c('0x3'));var moment=require(_0xae4c('0x4'));var BPromise=require(_0xae4c('0x5'));var rp=require(_0xae4c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae4c('0x7'));var config=require(_0xae4c('0x8'));var attributes=require(_0xae4c('0x9'));module[_0xae4c('0xa')]=function(_0xa81304,_0x189e31){return _0xa81304[_0xae4c('0xb')](_0xae4c('0xc'),attributes,{'tableName':_0xae4c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index e020adb..8300c39 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 _0xc252=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x3c1b1a,_0x5114b6){var _0x243e34=function(_0x52b16d){while(--_0x52b16d){_0x3c1b1a['push'](_0x3c1b1a['shift']());}};_0x243e34(++_0x5114b6);}(_0xc252,0x13d));var _0x2c25=function(_0x161869,_0x2d5af0){_0x161869=_0x161869-0x0;var _0x340132=_0xc252[_0x161869];return _0x340132;};'use strict';var _=require(_0x2c25('0x0'));var util=require(_0x2c25('0x1'));var moment=require(_0x2c25('0x2'));var BPromise=require(_0x2c25('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c25('0x4'));var db=require(_0x2c25('0x5'))['db'];var utils=require(_0x2c25('0x6'));var logger=require(_0x2c25('0x7'))(_0x2c25('0x8'));var config=require(_0x2c25('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2c25('0xa')][_0x2c25('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30f8e7,_0x1e58f8,_0x55a9f4){return new BPromise(function(_0x594e70,_0x24f2a6){return client['request'](_0x30f8e7,_0x55a9f4)[_0x2c25('0xc')](function(_0x35ca25){logger[_0x2c25('0xd')](_0x2c25('0xe'),_0x1e58f8,_0x2c25('0xf'));logger[_0x2c25('0x10')](_0x2c25('0x11'),_0x1e58f8,_0x2c25('0xf'),JSON[_0x2c25('0x12')](_0x35ca25));if(_0x35ca25[_0x2c25('0x13')]){if(_0x35ca25[_0x2c25('0x13')]['code']===0x1f4){logger[_0x2c25('0x13')](_0x2c25('0xe'),_0x1e58f8,_0x35ca25['error']['message']);return _0x24f2a6(_0x35ca25[_0x2c25('0x13')][_0x2c25('0x14')]);}logger[_0x2c25('0x13')](_0x2c25('0xe'),_0x1e58f8,_0x35ca25[_0x2c25('0x13')][_0x2c25('0x14')]);return _0x594e70(_0x35ca25['error'][_0x2c25('0x14')]);}else{logger[_0x2c25('0xd')](_0x2c25('0xe'),_0x1e58f8,_0x2c25('0xf'));_0x594e70(_0x35ca25[_0x2c25('0x15')][_0x2c25('0x14')]);}})[_0x2c25('0x16')](function(_0x110adc){logger[_0x2c25('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1e58f8,_0x110adc);_0x24f2a6(_0x110adc);});});}
\ No newline at end of file
+var _0xdff5=['then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xdff5,0x163));var _0x5dff=function(_0x4200ac,_0x54fa9a){_0x4200ac=_0x4200ac-0x0;var _0x464fa6=_0xdff5[_0x4200ac];return _0x464fa6;};'use strict';var _=require(_0x5dff('0x0'));var util=require(_0x5dff('0x1'));var moment=require(_0x5dff('0x2'));var BPromise=require(_0x5dff('0x3'));var rs=require(_0x5dff('0x4'));var fs=require('fs');var Redis=require(_0x5dff('0x5'));var db=require(_0x5dff('0x6'))['db'];var utils=require(_0x5dff('0x7'));var logger=require(_0x5dff('0x8'))(_0x5dff('0x9'));var config=require(_0x5dff('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5dff('0xb')][_0x5dff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47f214,_0x28c000,_0x22401d){return new BPromise(function(_0x1362fa,_0x1bffdd){return client['request'](_0x47f214,_0x22401d)[_0x5dff('0xd')](function(_0x557484){logger[_0x5dff('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x28c000,_0x5dff('0xf'));logger[_0x5dff('0x10')](_0x5dff('0x11'),_0x28c000,'request\x20sent',JSON['stringify'](_0x557484));if(_0x557484[_0x5dff('0x12')]){if(_0x557484[_0x5dff('0x12')]['code']===0x1f4){logger[_0x5dff('0x12')](_0x5dff('0x13'),_0x28c000,_0x557484['error'][_0x5dff('0x14')]);return _0x1bffdd(_0x557484['error'][_0x5dff('0x14')]);}logger[_0x5dff('0x12')](_0x5dff('0x13'),_0x28c000,_0x557484[_0x5dff('0x12')]['message']);return _0x1362fa(_0x557484['error'][_0x5dff('0x14')]);}else{logger[_0x5dff('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x28c000,_0x5dff('0xf'));_0x1362fa(_0x557484[_0x5dff('0x15')]['message']);}})[_0x5dff('0x16')](function(_0x28fadf){logger['error'](_0x5dff('0x13'),_0x28c000,_0x28fadf);_0x1bffdd(_0x28fadf);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index c19c1b5..9745f39 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(_0x1471bf,_0x56c476){var _0x3248d0=function(_0x2ca09c){while(--_0x2ca09c){_0x1471bf['push'](_0x1471bf['shift']());}};_0x3248d0(++_0x56c476);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+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(_0x61691a,_0x1ed4e4){var _0x3d8612=function(_0x519d63){while(--_0x519d63){_0x61691a['push'](_0x61691a['shift']());}};_0x3d8612(++_0x1ed4e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 d3ea884..b6c966c 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 _0x705f=['TEXT','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x705f,0x75));var _0xf705=function(_0x212348,_0x55415c){_0x212348=_0x212348-0x0;var _0x1696e9=_0x705f[_0x212348];return _0x1696e9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf705('0x0')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xf705('0x0')]},'metric':{'type':Sequelize[_0xf705('0x1')]},'description':{'type':Sequelize[_0xf705('0x0')]}};
\ No newline at end of file
+var _0x4ffe=['STRING','TEXT','sequelize','exports'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x4ffe,0x172));var _0xe4ff=function(_0x4fa892,_0x4e66a0){_0x4fa892=_0x4fa892-0x0;var _0x260ef6=_0x4ffe[_0x4fa892];return _0x260ef6;};'use strict';var Sequelize=require(_0xe4ff('0x0'));module[_0xe4ff('0x1')]={'name':{'type':Sequelize[_0xe4ff('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xe4ff('0x2')]},'metric':{'type':Sequelize[_0xe4ff('0x3')]},'description':{'type':Sequelize[_0xe4ff('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index fb8bf77..215998a 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 _0x84ab=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','map','AnalyticMetric','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','include','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0x84ab,0x12f));var _0xb84a=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x84ab[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];function respondWithStatusCode(_0x4d3758,_0x83444e){_0x83444e=_0x83444e||0xcc;return function(_0x4777dc){if(_0x4777dc){return _0x4d3758[_0xb84a('0x16')](_0x83444e);}return _0x4d3758[_0xb84a('0x17')](_0x83444e)[_0xb84a('0x18')]();};}function respondWithResult(_0x11dfe9,_0x12ccab){_0x12ccab=_0x12ccab||0xc8;return function(_0x475b){if(_0x475b){return _0x11dfe9[_0xb84a('0x17')](_0x12ccab)[_0xb84a('0x19')](_0x475b);}};}function respondWithFilteredResult(_0xc0b2e0,_0x1251ec){return function(_0x5716bd){if(_0x5716bd){var _0x11dd4d=typeof _0x1251ec[_0xb84a('0x1a')]===_0xb84a('0x1b')&&typeof _0x1251ec[_0xb84a('0x1c')]===_0xb84a('0x1b');var _0x1be87a=_0x5716bd[_0xb84a('0x1d')];var _0x34d82f=_0x11dd4d?0x0:_0x1251ec[_0xb84a('0x1a')];var _0x3f7437=_0x11dd4d?_0x5716bd[_0xb84a('0x1d')]:_0x1251ec[_0xb84a('0x1a')]+_0x1251ec[_0xb84a('0x1c')];var _0x200289;if(_0x3f7437>=_0x1be87a){_0x3f7437=_0x1be87a;_0x200289=0xc8;}else{_0x200289=0xce;}_0xc0b2e0['status'](_0x200289);return _0xc0b2e0[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x34d82f+'-'+_0x3f7437+'/'+_0x1be87a)['json'](_0x5716bd);}return null;};}function patchUpdates(_0xac76d3){return function(_0x61ef03){try{jsonpatch[_0xb84a('0x20')](_0x61ef03,_0xac76d3,!![]);}catch(_0x19f637){return BPromise['reject'](_0x19f637);}return _0x61ef03['save']();};}function saveUpdates(_0x1466ae,_0x19097d){return function(_0x2d70fd){if(_0x2d70fd){return _0x2d70fd[_0xb84a('0x21')](_0x1466ae)[_0xb84a('0x22')](function(_0x3b8fb2){return _0x3b8fb2;});}return null;};}function removeEntity(_0x8b28cd,_0x21d0d3){return function(_0x3aa06f){if(_0x3aa06f){return _0x3aa06f[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){var _0x1aab7d=_0x3aa06f[_0xb84a('0x24')]({'plain':!![]});var _0x409df0=_0xb84a('0x25');return db[_0xb84a('0x26')][_0xb84a('0x23')]({'where':{'type':_0x409df0,'resourceId':_0x1aab7d['id']}})[_0xb84a('0x22')](function(){return _0x3aa06f;});})[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x1db72c,_0x2fe40d){return function(_0x35d1f7){if(!_0x35d1f7){_0x1db72c[_0xb84a('0x16')](0x194);}return _0x35d1f7;};}function handleError(_0x97d71b,_0x5349ea){_0x5349ea=_0x5349ea||0x1f4;return function(_0x582954){logger[_0xb84a('0x27')](_0x582954[_0xb84a('0x28')]);if(_0x582954['name']){delete _0x582954[_0xb84a('0x29')];}_0x97d71b[_0xb84a('0x17')](_0x5349ea)['send'](_0x582954);};}exports['index']=function(_0x28f2e7,_0x8e9319){var _0x49ba3d={},_0x251778={},_0xba1147={'count':0x0,'rows':[]};var _0x3abc22=_[_0xb84a('0x2a')](db[_0xb84a('0x2b')][_0xb84a('0x2c')],function(_0x34b212){return{'name':_0x34b212[_0xb84a('0x2d')],'type':_0x34b212['type'][_0xb84a('0x2e')]};});_0x251778['model']=_['map'](_0x3abc22,_0xb84a('0x29'));_0x251778[_0xb84a('0x2f')]=_['keys'](_0x28f2e7['query']);_0x251778[_0xb84a('0x30')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],_0x251778[_0xb84a('0x2f')]);_0x49ba3d[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],qs[_0xb84a('0x34')](_0x28f2e7['query'][_0xb84a('0x34')]));_0x49ba3d[_0xb84a('0x33')]=_0x49ba3d[_0xb84a('0x33')][_0xb84a('0x35')]?_0x49ba3d[_0xb84a('0x33')]:_0x251778[_0xb84a('0x32')];if(!_0x28f2e7[_0xb84a('0x2f')]['hasOwnProperty'](_0xb84a('0x36'))){_0x49ba3d['limit']=qs[_0xb84a('0x1c')](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x49ba3d['offset']=qs['offset'](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1a')]);}_0x49ba3d[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_0x28f2e7[_0xb84a('0x2f')]['sort']);_0x49ba3d[_0xb84a('0x39')]=qs[_0xb84a('0x30')](_['pick'](_0x28f2e7[_0xb84a('0x2f')],_0x251778[_0xb84a('0x30')]),_0x3abc22);if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3a')]){_0x49ba3d['where']=_['merge'](_0x49ba3d['where'],{'$or':_[_0xb84a('0x2a')](_0x3abc22,function(_0x11e1ac){if(_0x11e1ac[_0xb84a('0x3b')]!==_0xb84a('0x3c')){var _0x55b0b8={};_0x55b0b8[_0x11e1ac[_0xb84a('0x29')]]={'$like':'%'+_0x28f2e7['query'][_0xb84a('0x3a')]+'%'};return _0x55b0b8;}})});}_0x49ba3d=_['merge']({},_0x49ba3d,_0x28f2e7['options']);var _0x59d7a1={'where':_0x49ba3d[_0xb84a('0x39')]};return db[_0xb84a('0x2b')][_0xb84a('0x1d')](_0x59d7a1)[_0xb84a('0x22')](function(_0x5e547e){_0xba1147[_0xb84a('0x1d')]=_0x5e547e;if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x49ba3d[_0xb84a('0x3e')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x49ba3d);})[_0xb84a('0x22')](function(_0x1f3e04){_0xba1147['rows']=_0x1f3e04;return _0xba1147;})[_0xb84a('0x22')](respondWithFilteredResult(_0x8e9319,_0x49ba3d))[_0xb84a('0x3f')](handleError(_0x8e9319,null));};exports[_0xb84a('0x40')]=function(_0x25280a,_0x3f005b){var _0x241536={'raw':!![],'where':{'id':_0x25280a[_0xb84a('0x41')]['id']}},_0x24d700={};_0x24d700[_0xb84a('0x32')]=_[_0xb84a('0x42')](db[_0xb84a('0x2b')][_0xb84a('0x2c')]);_0x24d700[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x25280a[_0xb84a('0x2f')]);_0x24d700['filters']=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],_0x24d700[_0xb84a('0x2f')]);_0x241536[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],qs['fields'](_0x25280a[_0xb84a('0x2f')]['fields']));_0x241536[_0xb84a('0x33')]=_0x241536[_0xb84a('0x33')][_0xb84a('0x35')]?_0x241536[_0xb84a('0x33')]:_0x24d700['model'];if(_0x25280a[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x241536[_0xb84a('0x3e')]=[{'all':!![]}];}_0x241536=_['merge']({},_0x241536,_0x25280a['options']);return db[_0xb84a('0x2b')][_0xb84a('0x43')](_0x241536)[_0xb84a('0x22')](handleEntityNotFound(_0x3f005b,null))['then'](respondWithResult(_0x3f005b,null))['catch'](handleError(_0x3f005b,null));};exports['create']=function(_0x45630d,_0x384a0d){return db[_0xb84a('0x2b')][_0xb84a('0x44')](_0x45630d[_0xb84a('0x45')],{})['then'](function(_0x4b40fe){var _0x5b853a=_0x45630d['user'][_0xb84a('0x24')]({'plain':!![]});if(!_0x5b853a)throw new Error(_0xb84a('0x46'));if(_0x5b853a['role']===_0xb84a('0x47')){var _0xc8bac2=_0x4b40fe[_0xb84a('0x24')]({'plain':!![]});var _0x2f70f0=_0xb84a('0x25');return db[_0xb84a('0x48')]['find']({'where':{'name':_0x2f70f0,'userProfileId':_0x5b853a['userProfileId']},'raw':!![]})[_0xb84a('0x22')](function(_0x50172a){if(_0x50172a&&_0x50172a[_0xb84a('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0xc8bac2['name'],'resourceId':_0xc8bac2['id'],'type':_0x50172a[_0xb84a('0x29')],'sectionId':_0x50172a['id']},{})[_0xb84a('0x22')](function(){return _0x4b40fe;});}else{return _0x4b40fe;}})[_0xb84a('0x3f')](function(_0x25b6a0){logger[_0xb84a('0x27')](_0xb84a('0x4a'),_0x25b6a0);throw _0x25b6a0;});}return _0x4b40fe;})[_0xb84a('0x22')](respondWithResult(_0x384a0d,0xc9))[_0xb84a('0x3f')](handleError(_0x384a0d,null));};exports['update']=function(_0x5afdd0,_0x4c5bdf){if(_0x5afdd0[_0xb84a('0x45')]['id']){delete _0x5afdd0[_0xb84a('0x45')]['id'];}return db['AnalyticMetric'][_0xb84a('0x43')]({'where':{'id':_0x5afdd0['params']['id']}})['then'](handleEntityNotFound(_0x4c5bdf,null))['then'](saveUpdates(_0x5afdd0[_0xb84a('0x45')],null))[_0xb84a('0x22')](respondWithResult(_0x4c5bdf,null))[_0xb84a('0x3f')](handleError(_0x4c5bdf,null));};exports['destroy']=function(_0x5f757e,_0x2e98bf){return db[_0xb84a('0x2b')]['find']({'where':{'id':_0x5f757e[_0xb84a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e98bf,null))['then'](removeEntity(_0x2e98bf,null))[_0xb84a('0x3f')](handleError(_0x2e98bf,null));};
\ No newline at end of file
+var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x9489e6,_0x4d5d98){var _0x46fdfc=function(_0x524818){while(--_0x524818){_0x9489e6['push'](_0x9489e6['shift']());}};_0x46fdfc(++_0x4d5d98);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xf58718,_0x33541a){_0xf58718=_0xf58718-0x0;var _0x5aea10=_0xf2ca[_0xf58718];return _0x5aea10;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 5949587..e7d1322 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 _0xd101=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd101,0xc1));var _0x1d10=function(_0x28f210,_0x4fff00){_0x28f210=_0x28f210-0x0;var _0x2dbf2c=_0xd101[_0x28f210];return _0x2dbf2c;};'use strict';var _=require(_0x1d10('0x0'));var util=require('util');var logger=require(_0x1d10('0x1'))(_0x1d10('0x2'));var moment=require(_0x1d10('0x3'));var BPromise=require(_0x1d10('0x4'));var rp=require(_0x1d10('0x5'));var fs=require('fs');var path=require(_0x1d10('0x6'));var rimraf=require(_0x1d10('0x7'));var config=require(_0x1d10('0x8'));var attributes=require('./analyticMetric.attributes');module[_0x1d10('0x9')]=function(_0x203072,_0x2a4e2d){return _0x203072[_0x1d10('0xa')](_0x1d10('0xb'),attributes,{'tableName':_0x1d10('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcd05=['../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','moment','bluebird','request-promise','path'];(function(_0x4a15ff,_0x44c30d){var _0x26b619=function(_0x1bc3c5){while(--_0x1bc3c5){_0x4a15ff['push'](_0x4a15ff['shift']());}};_0x26b619(++_0x44c30d);}(_0xcd05,0x163));var _0x5cd0=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0xcd05[_0x754ab4];return _0x34079a;};'use strict';var _=require(_0x5cd0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5cd0('0x1'));var BPromise=require(_0x5cd0('0x2'));var rp=require(_0x5cd0('0x3'));var fs=require('fs');var path=require(_0x5cd0('0x4'));var rimraf=require('rimraf');var config=require(_0x5cd0('0x5'));var attributes=require(_0x5cd0('0x6'));module['exports']=function(_0x47c141,_0x4eea17){return _0x47c141[_0x5cd0('0x7')](_0x5cd0('0x8'),attributes,{'tableName':_0x5cd0('0x9'),'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 9137470..fea1fbd 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 _0x0ff9=['info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request'];(function(_0x4c057f,_0x1ed571){var _0x154bbd=function(_0x390c4e){while(--_0x390c4e){_0x4c057f['push'](_0x4c057f['shift']());}};_0x154bbd(++_0x1ed571);}(_0x0ff9,0x1e4));var _0x90ff=function(_0x3dadad,_0x4fc8c5){_0x3dadad=_0x3dadad-0x0;var _0x5d3d44=_0x0ff9[_0x3dadad];return _0x5d3d44;};'use strict';var _=require(_0x90ff('0x0'));var util=require(_0x90ff('0x1'));var moment=require(_0x90ff('0x2'));var BPromise=require(_0x90ff('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x90ff('0x4'))['db'];var utils=require(_0x90ff('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x90ff('0x6'));var jayson=require(_0x90ff('0x7'));var client=jayson[_0x90ff('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3612b2,_0x4b80c0,_0x5e7e78){return new BPromise(function(_0x481d3e,_0x3b74de){return client[_0x90ff('0x9')](_0x3612b2,_0x5e7e78)['then'](function(_0x22cdb6){logger[_0x90ff('0xa')](_0x90ff('0xb'),_0x4b80c0,'request\x20sent');logger[_0x90ff('0xc')](_0x90ff('0xd'),_0x4b80c0,'request\x20sent',JSON[_0x90ff('0xe')](_0x22cdb6));if(_0x22cdb6[_0x90ff('0xf')]){if(_0x22cdb6[_0x90ff('0xf')][_0x90ff('0x10')]===0x1f4){logger['error'](_0x90ff('0xb'),_0x4b80c0,_0x22cdb6[_0x90ff('0xf')]['message']);return _0x3b74de(_0x22cdb6[_0x90ff('0xf')][_0x90ff('0x11')]);}logger['error'](_0x90ff('0xb'),_0x4b80c0,_0x22cdb6[_0x90ff('0xf')][_0x90ff('0x11')]);return _0x481d3e(_0x22cdb6[_0x90ff('0xf')]['message']);}else{logger['info'](_0x90ff('0xb'),_0x4b80c0,_0x90ff('0x12'));_0x481d3e(_0x22cdb6['result']['message']);}})['catch'](function(_0x1b3862){logger['error'](_0x90ff('0xb'),_0x4b80c0,_0x1b3862);_0x3b74de(_0x1b3862);});});}
\ No newline at end of file
+var _0x5dc5=['error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1a2921,_0x322c9a){var _0x4dfa0a=function(_0x321865){while(--_0x321865){_0x1a2921['push'](_0x1a2921['shift']());}};_0x4dfa0a(++_0x322c9a);}(_0x5dc5,0x118));var _0x55dc=function(_0x3ffd24,_0xb4fda5){_0x3ffd24=_0x3ffd24-0x0;var _0x1a0867=_0x5dc5[_0x3ffd24];return _0x1a0867;};'use strict';var _=require(_0x55dc('0x0'));var util=require(_0x55dc('0x1'));var moment=require('moment');var BPromise=require(_0x55dc('0x2'));var rs=require(_0x55dc('0x3'));var fs=require('fs');var Redis=require(_0x55dc('0x4'));var db=require(_0x55dc('0x5'))['db'];var utils=require(_0x55dc('0x6'));var logger=require(_0x55dc('0x7'))(_0x55dc('0x8'));var config=require('../../config/environment');var jayson=require(_0x55dc('0x9'));var client=jayson[_0x55dc('0xa')][_0x55dc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4734e0,_0x3bf565,_0x451e5b){return new BPromise(function(_0x2dbc03,_0x7fd8c7){return client['request'](_0x4734e0,_0x451e5b)[_0x55dc('0xc')](function(_0x51f4a4){logger[_0x55dc('0xd')](_0x55dc('0xe'),_0x3bf565,_0x55dc('0xf'));logger[_0x55dc('0x10')](_0x55dc('0x11'),_0x3bf565,_0x55dc('0xf'),JSON[_0x55dc('0x12')](_0x51f4a4));if(_0x51f4a4[_0x55dc('0x13')]){if(_0x51f4a4[_0x55dc('0x13')][_0x55dc('0x14')]===0x1f4){logger[_0x55dc('0x13')](_0x55dc('0xe'),_0x3bf565,_0x51f4a4[_0x55dc('0x13')][_0x55dc('0x15')]);return _0x7fd8c7(_0x51f4a4[_0x55dc('0x13')][_0x55dc('0x15')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x3bf565,_0x51f4a4[_0x55dc('0x13')][_0x55dc('0x15')]);return _0x2dbc03(_0x51f4a4[_0x55dc('0x13')][_0x55dc('0x15')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x3bf565,_0x55dc('0xf'));_0x2dbc03(_0x51f4a4[_0x55dc('0x16')][_0x55dc('0x15')]);}})['catch'](function(_0x1a9f11){logger['error'](_0x55dc('0xe'),_0x3bf565,_0x1a9f11);_0x7fd8c7(_0x1a9f11);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index d1a60f0..664151d 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 _0xf961=['fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0x5c1a56,_0x1fa025){var _0xda7488=function(_0x531155){while(--_0x531155){_0x5c1a56['push'](_0x5c1a56['shift']());}};_0xda7488(++_0x1fa025);}(_0xf961,0x1cf));var _0x1f96=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xf961[_0x50aa2e];return _0x5e07f0;};'use strict';var multer=require(_0x1f96('0x0'));var util=require(_0x1f96('0x1'));var path=require(_0x1f96('0x2'));var timeout=require(_0x1f96('0x3'));var express=require('express');var router=express[_0x1f96('0x4')]();var fs_extra=require(_0x1f96('0x5'));var auth=require(_0x1f96('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1f96('0x7'));var controller=require(_0x1f96('0x8'));router[_0x1f96('0x9')]('/',auth['isAuthenticated'](),controller[_0x1f96('0xa')]);router['get'](_0x1f96('0xb'),auth[_0x1f96('0xc')](),controller[_0x1f96('0xd')]);router[_0x1f96('0xe')]('/',auth[_0x1f96('0xc')](),controller[_0x1f96('0xf')]);router['put']('/:id',auth[_0x1f96('0xc')](),controller['update']);router[_0x1f96('0x10')](_0x1f96('0xb'),auth[_0x1f96('0xc')](),controller[_0x1f96('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xfafd=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3768f3,_0x4a40f1){var _0x526a13=function(_0x350126){while(--_0x350126){_0x3768f3['push'](_0x3768f3['shift']());}};_0x526a13(++_0x4a40f1);}(_0xfafd,0xcc));var _0xdfaf=function(_0x41fdcd,_0x2fa74b){_0x41fdcd=_0x41fdcd-0x0;var _0x1f3ed5=_0xfafd[_0x41fdcd];return _0x1f3ed5;};'use strict';var multer=require('multer');var util=require(_0xdfaf('0x0'));var path=require(_0xdfaf('0x1'));var timeout=require(_0xdfaf('0x2'));var express=require(_0xdfaf('0x3'));var router=express[_0xdfaf('0x4')]();var fs_extra=require(_0xdfaf('0x5'));var auth=require(_0xdfaf('0x6'));var interaction=require(_0xdfaf('0x7'));var config=require(_0xdfaf('0x8'));var controller=require(_0xdfaf('0x9'));router[_0xdfaf('0xa')]('/',auth[_0xdfaf('0xb')](),controller[_0xdfaf('0xc')]);router[_0xdfaf('0xa')](_0xdfaf('0xd'),auth['isAuthenticated'](),controller[_0xdfaf('0xe')]);router[_0xdfaf('0xf')]('/',auth[_0xdfaf('0xb')](),controller[_0xdfaf('0x10')]);router[_0xdfaf('0x11')](_0xdfaf('0xd'),auth[_0xdfaf('0xb')](),controller[_0xdfaf('0x12')]);router['delete'](_0xdfaf('0xd'),auth[_0xdfaf('0xb')](),controller[_0xdfaf('0x13')]);module[_0xdfaf('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index bbc6bde..111325a 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 _0x3448=['sequelize','exports'];(function(_0x5070c4,_0x30860a){var _0x85df53=function(_0x549ec5){while(--_0x549ec5){_0x5070c4['push'](_0x5070c4['shift']());}};_0x85df53(++_0x30860a);}(_0x3448,0x1ba));var _0x8344=function(_0x5375bd,_0x16783b){_0x5375bd=_0x5375bd-0x0;var _0x15b903=_0x3448[_0x5375bd];return _0x15b903;};'use strict';var Sequelize=require(_0x8344('0x0'));module[_0x8344('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x5a1f=['TEXT','sequelize','exports'];(function(_0xeec67d,_0x1c629a){var _0x17e958=function(_0x3096e4){while(--_0x3096e4){_0xeec67d['push'](_0xeec67d['shift']());}};_0x17e958(++_0x1c629a);}(_0x5a1f,0x19c));var _0xf5a1=function(_0x4ead60,_0x1f3ef7){_0x4ead60=_0x4ead60-0x0;var _0x172fef=_0x5a1f[_0x4ead60];return _0x172fef;};'use strict';var Sequelize=require(_0xf5a1('0x0'));module[_0xf5a1('0x1')]={'tree':{'type':Sequelize[_0xf5a1('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 939a15e..5471867 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 _0x6b6b=['AnalyticTreeReport','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','json','offset','limit','count','status','Content-Range','apply','save','update','destroy','end','error','stack','name','send','index','map'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x6b6b,0x65));var _0xb6b6=function(_0xfdbaf0,_0x45f455){_0xfdbaf0=_0xfdbaf0-0x0;var _0x314a46=_0x6b6b[_0xfdbaf0];return _0x314a46;};'use strict';var emlformat=require(_0xb6b6('0x0'));var rimraf=require(_0xb6b6('0x1'));var zipdir=require(_0xb6b6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb6b6('0x3'));var Mustache=require(_0xb6b6('0x4'));var util=require('util');var path=require(_0xb6b6('0x5'));var sox=require(_0xb6b6('0x6'));var csv=require(_0xb6b6('0x7'));var ejs=require(_0xb6b6('0x8'));var fs=require('fs');var fs_extra=require(_0xb6b6('0x9'));var _=require('lodash');var squel=require(_0xb6b6('0xa'));var crypto=require(_0xb6b6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb6b6('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb6b6('0xd'));var Papa=require(_0xb6b6('0xe'));var Redis=require(_0xb6b6('0xf'));var authService=require(_0xb6b6('0x10'));var qs=require(_0xb6b6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb6b6('0x12'));var utils=require(_0xb6b6('0x13'));var config=require(_0xb6b6('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d374f,_0x275803){_0x275803=_0x275803||0xcc;return function(_0x1187f4){if(_0x1187f4){return _0x3d374f[_0xb6b6('0x15')](_0x275803);}return _0x3d374f['status'](_0x275803)['end']();};}function respondWithResult(_0x25db48,_0xb59d2f){_0xb59d2f=_0xb59d2f||0xc8;return function(_0x41dce1){if(_0x41dce1){return _0x25db48['status'](_0xb59d2f)[_0xb6b6('0x16')](_0x41dce1);}};}function respondWithFilteredResult(_0x390290,_0x5f36e2){return function(_0x103d88){if(_0x103d88){var _0x4bb820=typeof _0x5f36e2[_0xb6b6('0x17')]==='undefined'&&typeof _0x5f36e2[_0xb6b6('0x18')]==='undefined';var _0xd36604=_0x103d88[_0xb6b6('0x19')];var _0x15ed2d=_0x4bb820?0x0:_0x5f36e2[_0xb6b6('0x17')];var _0x5e0feb=_0x4bb820?_0x103d88[_0xb6b6('0x19')]:_0x5f36e2[_0xb6b6('0x17')]+_0x5f36e2[_0xb6b6('0x18')];var _0x643870;if(_0x5e0feb>=_0xd36604){_0x5e0feb=_0xd36604;_0x643870=0xc8;}else{_0x643870=0xce;}_0x390290[_0xb6b6('0x1a')](_0x643870);return _0x390290['set'](_0xb6b6('0x1b'),_0x15ed2d+'-'+_0x5e0feb+'/'+_0xd36604)['json'](_0x103d88);}return null;};}function patchUpdates(_0x525b79){return function(_0x2df5f0){try{jsonpatch[_0xb6b6('0x1c')](_0x2df5f0,_0x525b79,!![]);}catch(_0x4fb7e8){return BPromise['reject'](_0x4fb7e8);}return _0x2df5f0[_0xb6b6('0x1d')]();};}function saveUpdates(_0x21bf2c,_0x37bb80){return function(_0x5deaf8){if(_0x5deaf8){return _0x5deaf8[_0xb6b6('0x1e')](_0x21bf2c)['then'](function(_0x52345b){return _0x52345b;});}return null;};}function removeEntity(_0x25823b,_0x157ced){return function(_0x3db076){if(_0x3db076){return _0x3db076[_0xb6b6('0x1f')]()['then'](function(){_0x25823b[_0xb6b6('0x1a')](0xcc)[_0xb6b6('0x20')]();});}};}function handleEntityNotFound(_0x23aed6,_0x6ab7e2){return function(_0x314c77){if(!_0x314c77){_0x23aed6[_0xb6b6('0x15')](0x194);}return _0x314c77;};}function handleError(_0x43ff83,_0x55c578){_0x55c578=_0x55c578||0x1f4;return function(_0x429915){logger[_0xb6b6('0x21')](_0x429915[_0xb6b6('0x22')]);if(_0x429915[_0xb6b6('0x23')]){delete _0x429915['name'];}_0x43ff83[_0xb6b6('0x1a')](_0x55c578)[_0xb6b6('0x24')](_0x429915);};}exports[_0xb6b6('0x25')]=function(_0x1864c5,_0x4d4d05){var _0x1a567a={},_0x587cdd={},_0x1cd6bb={'count':0x0,'rows':[]};var _0x2ba2aa=_[_0xb6b6('0x26')](db[_0xb6b6('0x27')][_0xb6b6('0x28')],function(_0x15c0aa){return{'name':_0x15c0aa['fieldName'],'type':_0x15c0aa[_0xb6b6('0x29')]['key']};});_0x587cdd[_0xb6b6('0x2a')]=_[_0xb6b6('0x26')](_0x2ba2aa,_0xb6b6('0x23'));_0x587cdd[_0xb6b6('0x2b')]=_['keys'](_0x1864c5[_0xb6b6('0x2b')]);_0x587cdd['filters']=_[_0xb6b6('0x2c')](_0x587cdd[_0xb6b6('0x2a')],_0x587cdd[_0xb6b6('0x2b')]);_0x1a567a[_0xb6b6('0x2d')]=_['intersection'](_0x587cdd[_0xb6b6('0x2a')],qs[_0xb6b6('0x2e')](_0x1864c5[_0xb6b6('0x2b')]['fields']));_0x1a567a['attributes']=_0x1a567a[_0xb6b6('0x2d')][_0xb6b6('0x2f')]?_0x1a567a['attributes']:_0x587cdd[_0xb6b6('0x2a')];if(!_0x1864c5[_0xb6b6('0x2b')][_0xb6b6('0x30')]('nolimit')){_0x1a567a['limit']=qs[_0xb6b6('0x18')](_0x1864c5[_0xb6b6('0x2b')][_0xb6b6('0x18')]);_0x1a567a[_0xb6b6('0x17')]=qs['offset'](_0x1864c5[_0xb6b6('0x2b')][_0xb6b6('0x17')]);}_0x1a567a[_0xb6b6('0x31')]=qs[_0xb6b6('0x32')](_0x1864c5[_0xb6b6('0x2b')][_0xb6b6('0x32')]);_0x1a567a['where']=qs[_0xb6b6('0x33')](_[_0xb6b6('0x34')](_0x1864c5[_0xb6b6('0x2b')],_0x587cdd[_0xb6b6('0x33')]),_0x2ba2aa);if(_0x1864c5['query'][_0xb6b6('0x35')]){_0x1a567a['where']=_['merge'](_0x1a567a[_0xb6b6('0x36')],{'$or':_['map'](_0x2ba2aa,function(_0x34cb1c){if(_0x34cb1c[_0xb6b6('0x29')]!==_0xb6b6('0x37')){var _0x2fc816={};_0x2fc816[_0x34cb1c['name']]={'$like':'%'+_0x1864c5[_0xb6b6('0x2b')][_0xb6b6('0x35')]+'%'};return _0x2fc816;}})});}_0x1a567a=_[_0xb6b6('0x38')]({},_0x1a567a,_0x1864c5[_0xb6b6('0x39')]);var _0x578f06={'where':_0x1a567a[_0xb6b6('0x36')]};return db[_0xb6b6('0x27')][_0xb6b6('0x19')](_0x578f06)[_0xb6b6('0x3a')](function(_0x47ca4d){_0x1cd6bb['count']=_0x47ca4d;if(_0x1864c5['query'][_0xb6b6('0x3b')]){_0x1a567a[_0xb6b6('0x3c')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xb6b6('0x3d')](_0x1a567a);})[_0xb6b6('0x3a')](function(_0x48fc7d){_0x1cd6bb[_0xb6b6('0x3e')]=_0x48fc7d;return _0x1cd6bb;})[_0xb6b6('0x3a')](respondWithFilteredResult(_0x4d4d05,_0x1a567a))[_0xb6b6('0x3f')](handleError(_0x4d4d05,null));};exports[_0xb6b6('0x40')]=function(_0x2b9b5e,_0xacb628){var _0x1badbf={'raw':!![],'where':{'id':_0x2b9b5e[_0xb6b6('0x41')]['id']}},_0x415821={};_0x415821[_0xb6b6('0x2a')]=_[_0xb6b6('0x42')](db[_0xb6b6('0x27')]['rawAttributes']);_0x415821[_0xb6b6('0x2b')]=_[_0xb6b6('0x42')](_0x2b9b5e[_0xb6b6('0x2b')]);_0x415821[_0xb6b6('0x33')]=_[_0xb6b6('0x2c')](_0x415821[_0xb6b6('0x2a')],_0x415821[_0xb6b6('0x2b')]);_0x1badbf[_0xb6b6('0x2d')]=_[_0xb6b6('0x2c')](_0x415821[_0xb6b6('0x2a')],qs[_0xb6b6('0x2e')](_0x2b9b5e['query']['fields']));_0x1badbf[_0xb6b6('0x2d')]=_0x1badbf['attributes'][_0xb6b6('0x2f')]?_0x1badbf[_0xb6b6('0x2d')]:_0x415821[_0xb6b6('0x2a')];if(_0x2b9b5e['query']['includeAll']){_0x1badbf[_0xb6b6('0x3c')]=[{'all':!![]}];}_0x1badbf=_[_0xb6b6('0x38')]({},_0x1badbf,_0x2b9b5e[_0xb6b6('0x39')]);return db[_0xb6b6('0x27')][_0xb6b6('0x43')](_0x1badbf)['then'](handleEntityNotFound(_0xacb628,null))[_0xb6b6('0x3a')](respondWithResult(_0xacb628,null))[_0xb6b6('0x3f')](handleError(_0xacb628,null));};exports[_0xb6b6('0x44')]=function(_0x2caa34,_0xd4bb26){return db[_0xb6b6('0x27')][_0xb6b6('0x44')](_0x2caa34['body'],{})[_0xb6b6('0x3a')](respondWithResult(_0xd4bb26,0xc9))['catch'](handleError(_0xd4bb26,null));};exports[_0xb6b6('0x1e')]=function(_0x355dcc,_0x39050e){if(_0x355dcc[_0xb6b6('0x45')]['id']){delete _0x355dcc['body']['id'];}return db[_0xb6b6('0x27')][_0xb6b6('0x43')]({'where':{'id':_0x355dcc[_0xb6b6('0x41')]['id']}})[_0xb6b6('0x3a')](handleEntityNotFound(_0x39050e,null))[_0xb6b6('0x3a')](saveUpdates(_0x355dcc[_0xb6b6('0x45')],null))[_0xb6b6('0x3a')](respondWithResult(_0x39050e,null))[_0xb6b6('0x3f')](handleError(_0x39050e,null));};exports[_0xb6b6('0x1f')]=function(_0x58c079,_0x3f2c14){return db['AnalyticTreeReport'][_0xb6b6('0x43')]({'where':{'id':_0x58c079[_0xb6b6('0x41')]['id']}})[_0xb6b6('0x3a')](handleEntityNotFound(_0x3f2c14,null))[_0xb6b6('0x3a')](removeEntity(_0x3f2c14,null))[_0xb6b6('0x3f')](handleError(_0x3f2c14,null));};
\ No newline at end of file
+var _0x0fed=['show','params','rawAttributes','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','map','AnalyticTreeReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows'];(function(_0x2418e0,_0x7215b0){var _0x55ffbf=function(_0x4fc0ec){while(--_0x4fc0ec){_0x2418e0['push'](_0x2418e0['shift']());}};_0x55ffbf(++_0x7215b0);}(_0x0fed,0xdb));var _0xd0fe=function(_0x20234e,_0x384a42){_0x20234e=_0x20234e-0x0;var _0x4df7c4=_0x0fed[_0x20234e];return _0x4df7c4;};'use strict';var emlformat=require(_0xd0fe('0x0'));var rimraf=require(_0xd0fe('0x1'));var zipdir=require(_0xd0fe('0x2'));var jsonpatch=require(_0xd0fe('0x3'));var rp=require(_0xd0fe('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd0fe('0x5'));var util=require(_0xd0fe('0x6'));var path=require(_0xd0fe('0x7'));var sox=require('sox');var csv=require(_0xd0fe('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0fe('0x9'));var squel=require(_0xd0fe('0xa'));var crypto=require(_0xd0fe('0xb'));var jsforce=require(_0xd0fe('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd0fe('0x8'));var querystring=require(_0xd0fe('0xd'));var Papa=require('papaparse');var Redis=require(_0xd0fe('0xe'));var authService=require(_0xd0fe('0xf'));var qs=require(_0xd0fe('0x10'));var as=require(_0xd0fe('0x11'));var hardwareService=require(_0xd0fe('0x12'));var logger=require(_0xd0fe('0x13'))(_0xd0fe('0x14'));var utils=require(_0xd0fe('0x15'));var config=require(_0xd0fe('0x16'));var licenseUtil=require(_0xd0fe('0x17'));var db=require(_0xd0fe('0x18'))['db'];function respondWithStatusCode(_0x51ca1e,_0x44eb4b){_0x44eb4b=_0x44eb4b||0xcc;return function(_0x2f231d){if(_0x2f231d){return _0x51ca1e['sendStatus'](_0x44eb4b);}return _0x51ca1e[_0xd0fe('0x19')](_0x44eb4b)[_0xd0fe('0x1a')]();};}function respondWithResult(_0x263599,_0x1afc6e){_0x1afc6e=_0x1afc6e||0xc8;return function(_0x3da337){if(_0x3da337){return _0x263599[_0xd0fe('0x19')](_0x1afc6e)[_0xd0fe('0x1b')](_0x3da337);}};}function respondWithFilteredResult(_0x498e87,_0x36f6cb){return function(_0x6109f){if(_0x6109f){var _0x4bcfdb=typeof _0x36f6cb[_0xd0fe('0x1c')]===_0xd0fe('0x1d')&&typeof _0x36f6cb['limit']===_0xd0fe('0x1d');var _0x378ae7=_0x6109f[_0xd0fe('0x1e')];var _0x8283b4=_0x4bcfdb?0x0:_0x36f6cb[_0xd0fe('0x1c')];var _0x129072=_0x4bcfdb?_0x6109f[_0xd0fe('0x1e')]:_0x36f6cb[_0xd0fe('0x1c')]+_0x36f6cb[_0xd0fe('0x1f')];var _0x5a9be4;if(_0x129072>=_0x378ae7){_0x129072=_0x378ae7;_0x5a9be4=0xc8;}else{_0x5a9be4=0xce;}_0x498e87['status'](_0x5a9be4);return _0x498e87[_0xd0fe('0x20')](_0xd0fe('0x21'),_0x8283b4+'-'+_0x129072+'/'+_0x378ae7)[_0xd0fe('0x1b')](_0x6109f);}return null;};}function patchUpdates(_0x5591bb){return function(_0x589403){try{jsonpatch['apply'](_0x589403,_0x5591bb,!![]);}catch(_0x2a6794){return BPromise['reject'](_0x2a6794);}return _0x589403['save']();};}function saveUpdates(_0x190ee7,_0x450a04){return function(_0x34e7d9){if(_0x34e7d9){return _0x34e7d9[_0xd0fe('0x22')](_0x190ee7)[_0xd0fe('0x23')](function(_0x109527){return _0x109527;});}return null;};}function removeEntity(_0x2ef217,_0x7c6127){return function(_0x36827e){if(_0x36827e){return _0x36827e[_0xd0fe('0x24')]()[_0xd0fe('0x23')](function(){_0x2ef217[_0xd0fe('0x19')](0xcc)[_0xd0fe('0x1a')]();});}};}function handleEntityNotFound(_0x12c934,_0x51e2a9){return function(_0x3d1ad0){if(!_0x3d1ad0){_0x12c934[_0xd0fe('0x25')](0x194);}return _0x3d1ad0;};}function handleError(_0x543923,_0x5d12cd){_0x5d12cd=_0x5d12cd||0x1f4;return function(_0x134662){logger[_0xd0fe('0x26')](_0x134662[_0xd0fe('0x27')]);if(_0x134662['name']){delete _0x134662[_0xd0fe('0x28')];}_0x543923[_0xd0fe('0x19')](_0x5d12cd)['send'](_0x134662);};}exports['index']=function(_0x337cb5,_0x237289){var _0x5ac605={},_0xcd8164={},_0x1d470e={'count':0x0,'rows':[]};var _0x5a7dbb=_[_0xd0fe('0x29')](db[_0xd0fe('0x2a')]['rawAttributes'],function(_0x2f781d){return{'name':_0x2f781d[_0xd0fe('0x2b')],'type':_0x2f781d[_0xd0fe('0x2c')][_0xd0fe('0x2d')]};});_0xcd8164[_0xd0fe('0x2e')]=_['map'](_0x5a7dbb,'name');_0xcd8164[_0xd0fe('0x2f')]=_[_0xd0fe('0x30')](_0x337cb5['query']);_0xcd8164[_0xd0fe('0x31')]=_[_0xd0fe('0x32')](_0xcd8164[_0xd0fe('0x2e')],_0xcd8164['query']);_0x5ac605[_0xd0fe('0x33')]=_['intersection'](_0xcd8164[_0xd0fe('0x2e')],qs[_0xd0fe('0x34')](_0x337cb5['query'][_0xd0fe('0x34')]));_0x5ac605[_0xd0fe('0x33')]=_0x5ac605[_0xd0fe('0x33')][_0xd0fe('0x35')]?_0x5ac605[_0xd0fe('0x33')]:_0xcd8164['model'];if(!_0x337cb5['query']['hasOwnProperty'](_0xd0fe('0x36'))){_0x5ac605[_0xd0fe('0x1f')]=qs[_0xd0fe('0x1f')](_0x337cb5[_0xd0fe('0x2f')][_0xd0fe('0x1f')]);_0x5ac605[_0xd0fe('0x1c')]=qs[_0xd0fe('0x1c')](_0x337cb5['query'][_0xd0fe('0x1c')]);}_0x5ac605['order']=qs[_0xd0fe('0x37')](_0x337cb5[_0xd0fe('0x2f')][_0xd0fe('0x37')]);_0x5ac605[_0xd0fe('0x38')]=qs[_0xd0fe('0x31')](_[_0xd0fe('0x39')](_0x337cb5[_0xd0fe('0x2f')],_0xcd8164[_0xd0fe('0x31')]),_0x5a7dbb);if(_0x337cb5['query'][_0xd0fe('0x3a')]){_0x5ac605['where']=_[_0xd0fe('0x3b')](_0x5ac605['where'],{'$or':_[_0xd0fe('0x29')](_0x5a7dbb,function(_0x274e6e){if(_0x274e6e['type']!==_0xd0fe('0x3c')){var _0x34d14f={};_0x34d14f[_0x274e6e[_0xd0fe('0x28')]]={'$like':'%'+_0x337cb5[_0xd0fe('0x2f')][_0xd0fe('0x3a')]+'%'};return _0x34d14f;}})});}_0x5ac605=_['merge']({},_0x5ac605,_0x337cb5[_0xd0fe('0x3d')]);var _0x5d5cb5={'where':_0x5ac605[_0xd0fe('0x38')]};return db[_0xd0fe('0x2a')]['count'](_0x5d5cb5)[_0xd0fe('0x23')](function(_0x451453){_0x1d470e['count']=_0x451453;if(_0x337cb5[_0xd0fe('0x2f')]['includeAll']){_0x5ac605[_0xd0fe('0x3e')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xd0fe('0x3f')](_0x5ac605);})[_0xd0fe('0x23')](function(_0x12050a){_0x1d470e[_0xd0fe('0x40')]=_0x12050a;return _0x1d470e;})[_0xd0fe('0x23')](respondWithFilteredResult(_0x237289,_0x5ac605))['catch'](handleError(_0x237289,null));};exports[_0xd0fe('0x41')]=function(_0x75f0ec,_0x17f87c){var _0x278901={'raw':!![],'where':{'id':_0x75f0ec[_0xd0fe('0x42')]['id']}},_0x4e3960={};_0x4e3960[_0xd0fe('0x2e')]=_[_0xd0fe('0x30')](db[_0xd0fe('0x2a')][_0xd0fe('0x43')]);_0x4e3960[_0xd0fe('0x2f')]=_[_0xd0fe('0x30')](_0x75f0ec[_0xd0fe('0x2f')]);_0x4e3960['filters']=_['intersection'](_0x4e3960['model'],_0x4e3960[_0xd0fe('0x2f')]);_0x278901[_0xd0fe('0x33')]=_[_0xd0fe('0x32')](_0x4e3960[_0xd0fe('0x2e')],qs['fields'](_0x75f0ec[_0xd0fe('0x2f')][_0xd0fe('0x34')]));_0x278901['attributes']=_0x278901[_0xd0fe('0x33')][_0xd0fe('0x35')]?_0x278901['attributes']:_0x4e3960[_0xd0fe('0x2e')];if(_0x75f0ec[_0xd0fe('0x2f')]['includeAll']){_0x278901[_0xd0fe('0x3e')]=[{'all':!![]}];}_0x278901=_['merge']({},_0x278901,_0x75f0ec[_0xd0fe('0x3d')]);return db['AnalyticTreeReport']['find'](_0x278901)['then'](handleEntityNotFound(_0x17f87c,null))[_0xd0fe('0x23')](respondWithResult(_0x17f87c,null))[_0xd0fe('0x44')](handleError(_0x17f87c,null));};exports['create']=function(_0x82ae2,_0x36b03b){return db['AnalyticTreeReport']['create'](_0x82ae2[_0xd0fe('0x45')],{})[_0xd0fe('0x23')](respondWithResult(_0x36b03b,0xc9))[_0xd0fe('0x44')](handleError(_0x36b03b,null));};exports[_0xd0fe('0x22')]=function(_0xf8f21,_0x101830){if(_0xf8f21[_0xd0fe('0x45')]['id']){delete _0xf8f21[_0xd0fe('0x45')]['id'];}return db[_0xd0fe('0x2a')][_0xd0fe('0x46')]({'where':{'id':_0xf8f21[_0xd0fe('0x42')]['id']}})[_0xd0fe('0x23')](handleEntityNotFound(_0x101830,null))[_0xd0fe('0x23')](saveUpdates(_0xf8f21[_0xd0fe('0x45')],null))['then'](respondWithResult(_0x101830,null))[_0xd0fe('0x44')](handleError(_0x101830,null));};exports[_0xd0fe('0x24')]=function(_0x4e7aef,_0x590b55){return db[_0xd0fe('0x2a')][_0xd0fe('0x46')]({'where':{'id':_0x4e7aef[_0xd0fe('0x42')]['id']}})[_0xd0fe('0x23')](handleEntityNotFound(_0x590b55,null))[_0xd0fe('0x23')](removeEntity(_0x590b55,null))[_0xd0fe('0x44')](handleError(_0x590b55,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 6323214..0d5afca 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 _0x9cd3=['request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','bluebird'];(function(_0x466ee9,_0x14111b){var _0x229a84=function(_0x4e9bde){while(--_0x4e9bde){_0x466ee9['push'](_0x466ee9['shift']());}};_0x229a84(++_0x14111b);}(_0x9cd3,0x1c4));var _0x39cd=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x9cd3[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x39cd('0x0'));var util=require(_0x39cd('0x1'));var logger=require(_0x39cd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x39cd('0x3'));var rp=require(_0x39cd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39cd('0x5'));var config=require(_0x39cd('0x6'));var attributes=require(_0x39cd('0x7'));module[_0x39cd('0x8')]=function(_0x4b584a,_0x27280f){return _0x4b584a[_0x39cd('0x9')](_0x39cd('0xa'),attributes,{'tableName':_0x39cd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4905=['path','rimraf','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','request-promise'];(function(_0x301c9f,_0x3da512){var _0x1184ec=function(_0x36cd1a){while(--_0x36cd1a){_0x301c9f['push'](_0x301c9f['shift']());}};_0x1184ec(++_0x3da512);}(_0x4905,0x97));var _0x5490=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x4905[_0x3826ad];return _0x17b900;};'use strict';var _=require(_0x5490('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5490('0x1'));var fs=require('fs');var path=require(_0x5490('0x2'));var rimraf=require(_0x5490('0x3'));var config=require(_0x5490('0x4'));var attributes=require('./analyticTreeReport.attributes');module[_0x5490('0x5')]=function(_0x40354b,_0x1f5641){return _0x40354b[_0x5490('0x6')](_0x5490('0x7'),attributes,{'tableName':_0x5490('0x8'),'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 12de349..fae8218 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x52ad50,_0xb3aacf){var _0x1a8ab3=function(_0x1c3522){while(--_0x1c3522){_0x52ad50['push'](_0x52ad50['shift']());}};_0x1a8ab3(++_0xb3aacf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x21c7bf,_0x58a016){_0x21c7bf=_0x21c7bf-0x0;var _0x5393bf=_0x5f2f[_0x21c7bf];return _0x5393bf;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x59ae59,_0x3351f4){_0x59ae59=_0x59ae59-0x0;var _0x1bd86=_0x7a54[_0x59ae59];return _0x1bd86;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 861e7d6..8435967 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 _0xad0e=['delete','destroy','exports','util','path','connect-timeout','fs-extra','../../config/environment','get','isAuthenticated','/:id','show','post','put'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0xad0e,0x199));var _0xead0=function(_0x46204b,_0x7525fa){_0x46204b=_0x46204b-0x0;var _0x453ddf=_0xad0e[_0x46204b];return _0x453ddf;};'use strict';var multer=require('multer');var util=require(_0xead0('0x0'));var path=require(_0xead0('0x1'));var timeout=require(_0xead0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xead0('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xead0('0x4'));var controller=require('./analyticTreeReport.controller');router[_0xead0('0x5')]('/',auth[_0xead0('0x6')](),controller['index']);router[_0xead0('0x5')](_0xead0('0x7'),auth[_0xead0('0x6')](),controller[_0xead0('0x8')]);router[_0xead0('0x9')]('/',auth[_0xead0('0x6')](),controller['create']);router[_0xead0('0xa')]('/:id',auth[_0xead0('0x6')](),controller['update']);router[_0xead0('0xb')]('/:id',auth[_0xead0('0x6')](),controller[_0xead0('0xc')]);module[_0xead0('0xd')]=router;
\ No newline at end of file
+var _0x2a9a=['./analyticTreeReport.controller','index','get','/:id','post','isAuthenticated','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2c072e,_0x4b79a2){var _0x354c5d=function(_0x183fcd){while(--_0x183fcd){_0x2c072e['push'](_0x2c072e['shift']());}};_0x354c5d(++_0x4b79a2);}(_0x2a9a,0x8a));var _0xa2a9=function(_0x5215db,_0x4e50bf){_0x5215db=_0x5215db-0x0;var _0x182ef3=_0x2a9a[_0x5215db];return _0x182ef3;};'use strict';var multer=require('multer');var util=require(_0xa2a9('0x0'));var path=require(_0xa2a9('0x1'));var timeout=require(_0xa2a9('0x2'));var express=require(_0xa2a9('0x3'));var router=express[_0xa2a9('0x4')]();var fs_extra=require(_0xa2a9('0x5'));var auth=require(_0xa2a9('0x6'));var interaction=require(_0xa2a9('0x7'));var config=require(_0xa2a9('0x8'));var controller=require(_0xa2a9('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xa2a9('0xa')]);router[_0xa2a9('0xb')](_0xa2a9('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa2a9('0xd')]('/',auth[_0xa2a9('0xe')](),controller[_0xa2a9('0xf')]);router[_0xa2a9('0x10')](_0xa2a9('0xc'),auth[_0xa2a9('0xe')](),controller[_0xa2a9('0x11')]);router[_0xa2a9('0x12')]('/:id',auth[_0xa2a9('0xe')](),controller[_0xa2a9('0x13')]);module[_0xa2a9('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 4182b04..a9f8d6c 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 _0x1a8f=['STRING','sequelize'];(function(_0xfe7bff,_0x52d136){var _0x43903d=function(_0xe53c7){while(--_0xe53c7){_0xfe7bff['push'](_0xfe7bff['shift']());}};_0x43903d(++_0x52d136);}(_0x1a8f,0x87));var _0xf1a8=function(_0x3f9819,_0x4c2e0b){_0x3f9819=_0x3f9819-0x0;var _0x2700c2=_0x1a8f[_0x3f9819];return _0x2700c2;};'use strict';var Sequelize=require(_0xf1a8('0x0'));module['exports']={'name':{'type':Sequelize[_0xf1a8('0x1')]},'basename':{'type':Sequelize[_0xf1a8('0x1')]},'type':{'type':Sequelize[_0xf1a8('0x1')]}};
\ No newline at end of file
+var _0x55a5=['STRING','sequelize'];(function(_0x44a78f,_0x5a23cf){var _0x454def=function(_0x493fcf){while(--_0x493fcf){_0x44a78f['push'](_0x44a78f['shift']());}};_0x454def(++_0x5a23cf);}(_0x55a5,0xf7));var _0x555a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x55a5[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0x555a('0x0'));module['exports']={'name':{'type':Sequelize[_0x555a('0x1')]},'basename':{'type':Sequelize[_0x555a('0x1')]},'type':{'type':Sequelize[_0x555a('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 23144c5..f316e36 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 _0x8796=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','Attachment','findAll','rows','catch','show','params','find','get','omit','createdAt','body','updatedAt','create','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','lodash','squel','to-csv','querystring','ioredis','../../components/parsers/qs'];(function(_0x13e3b6,_0x34af72){var _0x585365=function(_0x1a1cf1){while(--_0x1a1cf1){_0x13e3b6['push'](_0x13e3b6['shift']());}};_0x585365(++_0x34af72);}(_0x8796,0xf9));var _0x6879=function(_0x148e49,_0x1b5a5b){_0x148e49=_0x148e49-0x0;var _0x19223a=_0x8796[_0x148e49];return _0x19223a;};'use strict';var emlformat=require(_0x6879('0x0'));var rimraf=require(_0x6879('0x1'));var zipdir=require(_0x6879('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6879('0x3'));var moment=require('moment');var BPromise=require(_0x6879('0x4'));var Mustache=require('mustache');var util=require(_0x6879('0x5'));var path=require(_0x6879('0x6'));var sox=require(_0x6879('0x7'));var csv=require('to-csv');var ejs=require(_0x6879('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6879('0x9'));var squel=require(_0x6879('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6879('0xb'));var querystring=require(_0x6879('0xc'));var Papa=require('papaparse');var Redis=require(_0x6879('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x6879('0xe'));var as=require(_0x6879('0xf'));var hardwareService=require(_0x6879('0x10'));var logger=require('../../config/logger')(_0x6879('0x11'));var utils=require(_0x6879('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x6879('0x13'));var db=require(_0x6879('0x14'))['db'];function respondWithStatusCode(_0x4ea6af,_0x4695cc){_0x4695cc=_0x4695cc||0xcc;return function(_0xa31883){if(_0xa31883){return _0x4ea6af[_0x6879('0x15')](_0x4695cc);}return _0x4ea6af[_0x6879('0x16')](_0x4695cc)[_0x6879('0x17')]();};}function respondWithResult(_0x3f132b,_0x992b96){_0x992b96=_0x992b96||0xc8;return function(_0x5c748a){if(_0x5c748a){return _0x3f132b[_0x6879('0x16')](_0x992b96)[_0x6879('0x18')](_0x5c748a);}};}function respondWithFilteredResult(_0x2eee1c,_0xa195c4){return function(_0x347193){if(_0x347193){var _0x3c3965=typeof _0xa195c4[_0x6879('0x19')]===_0x6879('0x1a')&&typeof _0xa195c4[_0x6879('0x1b')]===_0x6879('0x1a');var _0x4b8fdc=_0x347193[_0x6879('0x1c')];var _0x2e35a9=_0x3c3965?0x0:_0xa195c4[_0x6879('0x19')];var _0x597e09=_0x3c3965?_0x347193[_0x6879('0x1c')]:_0xa195c4[_0x6879('0x19')]+_0xa195c4[_0x6879('0x1b')];var _0x515def;if(_0x597e09>=_0x4b8fdc){_0x597e09=_0x4b8fdc;_0x515def=0xc8;}else{_0x515def=0xce;}_0x2eee1c[_0x6879('0x16')](_0x515def);return _0x2eee1c[_0x6879('0x1d')]('Content-Range',_0x2e35a9+'-'+_0x597e09+'/'+_0x4b8fdc)[_0x6879('0x18')](_0x347193);}return null;};}function patchUpdates(_0x2ee798){return function(_0x51c562){try{jsonpatch[_0x6879('0x1e')](_0x51c562,_0x2ee798,!![]);}catch(_0x237053){return BPromise[_0x6879('0x1f')](_0x237053);}return _0x51c562['save']();};}function saveUpdates(_0x3831be,_0x3d4313){return function(_0x34a4a6){if(_0x34a4a6){return _0x34a4a6[_0x6879('0x20')](_0x3831be)[_0x6879('0x21')](function(_0x269cd3){return _0x269cd3;});}return null;};}function removeEntity(_0x24592f,_0x69449d){return function(_0x253f14){if(_0x253f14){return _0x253f14[_0x6879('0x22')]()[_0x6879('0x21')](function(){_0x24592f['status'](0xcc)[_0x6879('0x17')]();});}};}function handleEntityNotFound(_0x1fee12,_0x63a464){return function(_0x114e76){if(!_0x114e76){_0x1fee12[_0x6879('0x15')](0x194);}return _0x114e76;};}function handleError(_0x39876c,_0x596e45){_0x596e45=_0x596e45||0x1f4;return function(_0x19e2e6){logger[_0x6879('0x23')](_0x19e2e6[_0x6879('0x24')]);if(_0x19e2e6[_0x6879('0x25')]){delete _0x19e2e6[_0x6879('0x25')];}_0x39876c[_0x6879('0x16')](_0x596e45)[_0x6879('0x26')](_0x19e2e6);};}exports[_0x6879('0x27')]=function(_0x2dc9e2,_0x38f15a){var _0x952e65={},_0x2fb9ea={},_0x143d94={'count':0x0,'rows':[]};var _0x1cc281=_[_0x6879('0x28')](db['Attachment'][_0x6879('0x29')],function(_0x4a8f37){return{'name':_0x4a8f37[_0x6879('0x2a')],'type':_0x4a8f37[_0x6879('0x2b')][_0x6879('0x2c')]};});_0x2fb9ea[_0x6879('0x2d')]=_[_0x6879('0x28')](_0x1cc281,_0x6879('0x25'));_0x2fb9ea[_0x6879('0x2e')]=_[_0x6879('0x2f')](_0x2dc9e2[_0x6879('0x2e')]);_0x2fb9ea[_0x6879('0x30')]=_[_0x6879('0x31')](_0x2fb9ea['model'],_0x2fb9ea['query']);_0x952e65[_0x6879('0x32')]=_['intersection'](_0x2fb9ea[_0x6879('0x2d')],qs[_0x6879('0x33')](_0x2dc9e2[_0x6879('0x2e')]['fields']));_0x952e65[_0x6879('0x32')]=_0x952e65[_0x6879('0x32')][_0x6879('0x34')]?_0x952e65[_0x6879('0x32')]:_0x2fb9ea[_0x6879('0x2d')];if(!_0x2dc9e2[_0x6879('0x2e')][_0x6879('0x35')](_0x6879('0x36'))){_0x952e65[_0x6879('0x1b')]=qs[_0x6879('0x1b')](_0x2dc9e2[_0x6879('0x2e')][_0x6879('0x1b')]);_0x952e65[_0x6879('0x19')]=qs['offset'](_0x2dc9e2[_0x6879('0x2e')][_0x6879('0x19')]);}_0x952e65[_0x6879('0x37')]=qs[_0x6879('0x38')](_0x2dc9e2[_0x6879('0x2e')][_0x6879('0x38')]);_0x952e65[_0x6879('0x39')]=qs['filters'](_[_0x6879('0x3a')](_0x2dc9e2[_0x6879('0x2e')],_0x2fb9ea['filters']),_0x1cc281);if(_0x2dc9e2[_0x6879('0x2e')][_0x6879('0x3b')]){_0x952e65[_0x6879('0x39')]=_[_0x6879('0x3c')](_0x952e65[_0x6879('0x39')],{'$or':_[_0x6879('0x28')](_0x1cc281,function(_0x5d4464){if(_0x5d4464['type']!=='VIRTUAL'){var _0x177153={};_0x177153[_0x5d4464[_0x6879('0x25')]]={'$like':'%'+_0x2dc9e2['query'][_0x6879('0x3b')]+'%'};return _0x177153;}})});}_0x952e65=_[_0x6879('0x3c')]({},_0x952e65,_0x2dc9e2[_0x6879('0x3d')]);var _0x584387={'where':_0x952e65['where']};return db['Attachment'][_0x6879('0x1c')](_0x584387)[_0x6879('0x21')](function(_0x29c483){_0x143d94['count']=_0x29c483;if(_0x2dc9e2['query'][_0x6879('0x3e')]){_0x952e65[_0x6879('0x3f')]=[{'all':!![]}];}return db[_0x6879('0x40')][_0x6879('0x41')](_0x952e65);})[_0x6879('0x21')](function(_0x4fa1ed){_0x143d94[_0x6879('0x42')]=_0x4fa1ed;return _0x143d94;})['then'](respondWithFilteredResult(_0x38f15a,_0x952e65))[_0x6879('0x43')](handleError(_0x38f15a,null));};exports[_0x6879('0x44')]=function(_0x545b9b,_0x2dca71){var _0x96ae2={'raw':!![],'where':{'id':_0x545b9b[_0x6879('0x45')]['id']}},_0x121bce={};_0x121bce[_0x6879('0x2d')]=_[_0x6879('0x2f')](db[_0x6879('0x40')][_0x6879('0x29')]);_0x121bce[_0x6879('0x2e')]=_['keys'](_0x545b9b['query']);_0x121bce[_0x6879('0x30')]=_[_0x6879('0x31')](_0x121bce[_0x6879('0x2d')],_0x121bce[_0x6879('0x2e')]);_0x96ae2['attributes']=_['intersection'](_0x121bce[_0x6879('0x2d')],qs[_0x6879('0x33')](_0x545b9b[_0x6879('0x2e')][_0x6879('0x33')]));_0x96ae2[_0x6879('0x32')]=_0x96ae2[_0x6879('0x32')][_0x6879('0x34')]?_0x96ae2['attributes']:_0x121bce['model'];if(_0x545b9b[_0x6879('0x2e')][_0x6879('0x3e')]){_0x96ae2['include']=[{'all':!![]}];}_0x96ae2=_[_0x6879('0x3c')]({},_0x96ae2,_0x545b9b['options']);return db[_0x6879('0x40')][_0x6879('0x46')](_0x96ae2)['then'](handleEntityNotFound(_0x2dca71,null))['then'](respondWithResult(_0x2dca71,null))['catch'](handleError(_0x2dca71,null));};exports['clone']=function(_0x31fe3d,_0x189476){var _0x1c7927={'where':{'id':_0x31fe3d[_0x6879('0x45')]['id']}},_0x5cd624={};_0x5cd624['model']=_['keys'](db[_0x6879('0x40')][_0x6879('0x29')]);_0x1c7927[_0x6879('0x32')]=_['intersection'](_0x5cd624[_0x6879('0x2d')],qs[_0x6879('0x33')](_0x31fe3d[_0x6879('0x2e')]['fields']));_0x1c7927['attributes']=_0x1c7927[_0x6879('0x32')][_0x6879('0x34')]?_0x1c7927[_0x6879('0x32')]:_0x5cd624[_0x6879('0x2d')];if(_0x31fe3d['query'][_0x6879('0x3e')]){_0x1c7927['include']=[{'all':!![]}];}_0x1c7927=_['merge']({},_0x1c7927,_0x31fe3d['options']);return db[_0x6879('0x40')][_0x6879('0x46')](_0x1c7927)[_0x6879('0x21')](handleEntityNotFound(_0x189476,null))[_0x6879('0x21')](function(_0x2af765){if(_0x2af765){var _0x2175f5=_0x2af765[_0x6879('0x47')]({'plain':!![]});_0x2175f5=qs[_0x6879('0x48')](_0x2175f5,['id',_0x6879('0x49'),'updatedAt']);_0x31fe3d[_0x6879('0x4a')]=_['omit'](_0x31fe3d['body'],['id',_0x6879('0x49'),_0x6879('0x4b')]);return db[_0x6879('0x40')][_0x6879('0x4c')](_[_0x6879('0x3c')](_0x2175f5,_0x31fe3d[_0x6879('0x4a')]),{'include':_0x31fe3d[_0x6879('0x2e')][_0x6879('0x3e')]?[{'all':!![]}]:undefined});}})[_0x6879('0x21')](respondWithResult(_0x189476,0xc9))[_0x6879('0x43')](handleError(_0x189476,null));};exports[_0x6879('0x20')]=function(_0x2fa925,_0x5d8306){if(_0x2fa925[_0x6879('0x4a')]['id']){delete _0x2fa925[_0x6879('0x4a')]['id'];}return db['Attachment'][_0x6879('0x46')]({'where':{'id':_0x2fa925[_0x6879('0x45')]['id']}})['then'](handleEntityNotFound(_0x5d8306,null))['then'](saveUpdates(_0x2fa925[_0x6879('0x4a')],null))[_0x6879('0x21')](respondWithResult(_0x5d8306,null))[_0x6879('0x43')](handleError(_0x5d8306,null));};exports[_0x6879('0x22')]=function(_0x615411,_0x45df7f){return db[_0x6879('0x40')]['find']({'where':{'id':_0x615411[_0x6879('0x45')]['id']}})[_0x6879('0x21')](handleEntityNotFound(_0x45df7f,null))['then'](removeEntity(_0x45df7f,null))['catch'](handleError(_0x45df7f,null));};exports[_0x6879('0x4c')]=function(_0x456098,_0x913929,_0x4b6118){_0x456098['body'][_0x6879('0x25')]=_0x456098[_0x6879('0x4d')][_0x6879('0x4e')];_0x456098[_0x6879('0x4a')][_0x6879('0x4f')]=_0x456098[_0x6879('0x4d')][_0x6879('0x50')];_0x456098['body']['type']=_0x456098[_0x6879('0x4d')]['mimetype'];return db[_0x6879('0x40')][_0x6879('0x4c')](_0x456098[_0x6879('0x4a')])[_0x6879('0x21')](respondWithResult(_0x913929,0xc9))['catch'](handleError(_0x913929,null));};exports[_0x6879('0x51')]=function(_0x33174f,_0x41e403,_0x2b2a99){return db[_0x6879('0x40')][_0x6879('0x52')]({'where':{'id':_0x33174f[_0x6879('0x45')]['id']},'raw':!![]})[_0x6879('0x21')](handleEntityNotFound(_0x41e403,null))[_0x6879('0x21')](function(_0x443025){if(_0x443025){var _0x4f716f=_0x443025[_0x6879('0x53')]!==null;var _0x3b14cf=path[_0x6879('0x54')](config[_0x6879('0x55')],_0x6879('0x56'));if(_0x4f716f){_0x3b14cf=path[_0x6879('0x54')](_0x3b14cf,_0x6879('0x57'));}var _0x560659=path[_0x6879('0x54')](_0x3b14cf,_0x443025[_0x6879('0x4f')]);return _0x41e403['download'](_0x560659);}})[_0x6879('0x43')](handleError(_0x41e403,null));};
\ No newline at end of file
+var _0xa324=['../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','options','Attachment','clone','find','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','join','eml-format','zip-dir','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x48e9f2,_0x21fc89){var _0x4bf512=function(_0x23910d){while(--_0x23910d){_0x48e9f2['push'](_0x48e9f2['shift']());}};_0x4bf512(++_0x21fc89);}(_0xa324,0x13d));var _0x4a32=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xa324[_0x2aecb2];return _0x3ebb80;};'use strict';var emlformat=require(_0x4a32('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a32('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4a32('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4a32('0x3'));var sox=require(_0x4a32('0x4'));var csv=require(_0x4a32('0x5'));var ejs=require(_0x4a32('0x6'));var fs=require('fs');var fs_extra=require(_0x4a32('0x7'));var _=require(_0x4a32('0x8'));var squel=require(_0x4a32('0x9'));var crypto=require('crypto');var jsforce=require(_0x4a32('0xa'));var deskjs=require(_0x4a32('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4a32('0xc'));var Redis=require(_0x4a32('0xd'));var authService=require(_0x4a32('0xe'));var qs=require(_0x4a32('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a32('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x4a32('0x11'));var config=require(_0x4a32('0x12'));var licenseUtil=require(_0x4a32('0x13'));var db=require(_0x4a32('0x14'))['db'];function respondWithStatusCode(_0x49841b,_0x51225a){_0x51225a=_0x51225a||0xcc;return function(_0x503c96){if(_0x503c96){return _0x49841b[_0x4a32('0x15')](_0x51225a);}return _0x49841b['status'](_0x51225a)[_0x4a32('0x16')]();};}function respondWithResult(_0x2eee03,_0x2852f6){_0x2852f6=_0x2852f6||0xc8;return function(_0x2592cc){if(_0x2592cc){return _0x2eee03[_0x4a32('0x17')](_0x2852f6)['json'](_0x2592cc);}};}function respondWithFilteredResult(_0xc47424,_0x295c96){return function(_0x4997c8){if(_0x4997c8){var _0x4652e1=typeof _0x295c96[_0x4a32('0x18')]===_0x4a32('0x19')&&typeof _0x295c96['limit']===_0x4a32('0x19');var _0x2896eb=_0x4997c8[_0x4a32('0x1a')];var _0x55f126=_0x4652e1?0x0:_0x295c96[_0x4a32('0x18')];var _0x14323c=_0x4652e1?_0x4997c8[_0x4a32('0x1a')]:_0x295c96[_0x4a32('0x18')]+_0x295c96[_0x4a32('0x1b')];var _0x4057ef;if(_0x14323c>=_0x2896eb){_0x14323c=_0x2896eb;_0x4057ef=0xc8;}else{_0x4057ef=0xce;}_0xc47424[_0x4a32('0x17')](_0x4057ef);return _0xc47424[_0x4a32('0x1c')](_0x4a32('0x1d'),_0x55f126+'-'+_0x14323c+'/'+_0x2896eb)[_0x4a32('0x1e')](_0x4997c8);}return null;};}function patchUpdates(_0x2bcfb2){return function(_0x2688da){try{jsonpatch['apply'](_0x2688da,_0x2bcfb2,!![]);}catch(_0x15fad2){return BPromise[_0x4a32('0x1f')](_0x15fad2);}return _0x2688da[_0x4a32('0x20')]();};}function saveUpdates(_0x364dc5,_0xd763df){return function(_0x174977){if(_0x174977){return _0x174977[_0x4a32('0x21')](_0x364dc5)['then'](function(_0x10a709){return _0x10a709;});}return null;};}function removeEntity(_0x467123,_0x59554c){return function(_0x1c3f85){if(_0x1c3f85){return _0x1c3f85[_0x4a32('0x22')]()[_0x4a32('0x23')](function(){_0x467123['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb400f1,_0x48c3df){return function(_0x49204f){if(!_0x49204f){_0xb400f1[_0x4a32('0x15')](0x194);}return _0x49204f;};}function handleError(_0x313af6,_0x864353){_0x864353=_0x864353||0x1f4;return function(_0x4e8ce4){logger[_0x4a32('0x24')](_0x4e8ce4['stack']);if(_0x4e8ce4[_0x4a32('0x25')]){delete _0x4e8ce4[_0x4a32('0x25')];}_0x313af6['status'](_0x864353)[_0x4a32('0x26')](_0x4e8ce4);};}exports[_0x4a32('0x27')]=function(_0x2b6064,_0x562900){var _0x3ece27={},_0x5f0e7c={},_0x17c7cc={'count':0x0,'rows':[]};var _0x4cf9f9=_[_0x4a32('0x28')](db['Attachment'][_0x4a32('0x29')],function(_0x1cc91b){return{'name':_0x1cc91b[_0x4a32('0x2a')],'type':_0x1cc91b[_0x4a32('0x2b')]['key']};});_0x5f0e7c[_0x4a32('0x2c')]=_['map'](_0x4cf9f9,_0x4a32('0x25'));_0x5f0e7c[_0x4a32('0x2d')]=_[_0x4a32('0x2e')](_0x2b6064['query']);_0x5f0e7c[_0x4a32('0x2f')]=_[_0x4a32('0x30')](_0x5f0e7c[_0x4a32('0x2c')],_0x5f0e7c[_0x4a32('0x2d')]);_0x3ece27[_0x4a32('0x31')]=_[_0x4a32('0x30')](_0x5f0e7c[_0x4a32('0x2c')],qs[_0x4a32('0x32')](_0x2b6064[_0x4a32('0x2d')][_0x4a32('0x32')]));_0x3ece27[_0x4a32('0x31')]=_0x3ece27[_0x4a32('0x31')][_0x4a32('0x33')]?_0x3ece27['attributes']:_0x5f0e7c[_0x4a32('0x2c')];if(!_0x2b6064[_0x4a32('0x2d')][_0x4a32('0x34')]('nolimit')){_0x3ece27[_0x4a32('0x1b')]=qs['limit'](_0x2b6064[_0x4a32('0x2d')][_0x4a32('0x1b')]);_0x3ece27[_0x4a32('0x18')]=qs['offset'](_0x2b6064[_0x4a32('0x2d')][_0x4a32('0x18')]);}_0x3ece27[_0x4a32('0x35')]=qs[_0x4a32('0x36')](_0x2b6064[_0x4a32('0x2d')][_0x4a32('0x36')]);_0x3ece27[_0x4a32('0x37')]=qs[_0x4a32('0x2f')](_['pick'](_0x2b6064['query'],_0x5f0e7c[_0x4a32('0x2f')]),_0x4cf9f9);if(_0x2b6064[_0x4a32('0x2d')]['filter']){_0x3ece27[_0x4a32('0x37')]=_[_0x4a32('0x38')](_0x3ece27[_0x4a32('0x37')],{'$or':_[_0x4a32('0x28')](_0x4cf9f9,function(_0x1929ce){if(_0x1929ce[_0x4a32('0x2b')]!==_0x4a32('0x39')){var _0x4c156c={};_0x4c156c[_0x1929ce[_0x4a32('0x25')]]={'$like':'%'+_0x2b6064[_0x4a32('0x2d')][_0x4a32('0x3a')]+'%'};return _0x4c156c;}})});}_0x3ece27=_[_0x4a32('0x38')]({},_0x3ece27,_0x2b6064['options']);var _0x180f9a={'where':_0x3ece27[_0x4a32('0x37')]};return db['Attachment'][_0x4a32('0x1a')](_0x180f9a)[_0x4a32('0x23')](function(_0x138c31){_0x17c7cc[_0x4a32('0x1a')]=_0x138c31;if(_0x2b6064[_0x4a32('0x2d')][_0x4a32('0x3b')]){_0x3ece27[_0x4a32('0x3c')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x3ece27);})['then'](function(_0x2658fc){_0x17c7cc[_0x4a32('0x3d')]=_0x2658fc;return _0x17c7cc;})[_0x4a32('0x23')](respondWithFilteredResult(_0x562900,_0x3ece27))[_0x4a32('0x3e')](handleError(_0x562900,null));};exports[_0x4a32('0x3f')]=function(_0x4009a0,_0x57c722){var _0x28d1bc={'raw':!![],'where':{'id':_0x4009a0[_0x4a32('0x40')]['id']}},_0x2a5a01={};_0x2a5a01[_0x4a32('0x2c')]=_[_0x4a32('0x2e')](db['Attachment'][_0x4a32('0x29')]);_0x2a5a01[_0x4a32('0x2d')]=_[_0x4a32('0x2e')](_0x4009a0[_0x4a32('0x2d')]);_0x2a5a01[_0x4a32('0x2f')]=_['intersection'](_0x2a5a01['model'],_0x2a5a01[_0x4a32('0x2d')]);_0x28d1bc[_0x4a32('0x31')]=_['intersection'](_0x2a5a01['model'],qs[_0x4a32('0x32')](_0x4009a0['query'][_0x4a32('0x32')]));_0x28d1bc['attributes']=_0x28d1bc[_0x4a32('0x31')][_0x4a32('0x33')]?_0x28d1bc['attributes']:_0x2a5a01['model'];if(_0x4009a0[_0x4a32('0x2d')][_0x4a32('0x3b')]){_0x28d1bc['include']=[{'all':!![]}];}_0x28d1bc=_[_0x4a32('0x38')]({},_0x28d1bc,_0x4009a0[_0x4a32('0x41')]);return db[_0x4a32('0x42')]['find'](_0x28d1bc)[_0x4a32('0x23')](handleEntityNotFound(_0x57c722,null))[_0x4a32('0x23')](respondWithResult(_0x57c722,null))['catch'](handleError(_0x57c722,null));};exports[_0x4a32('0x43')]=function(_0x208e00,_0x4b4eba){var _0x41af4f={'where':{'id':_0x208e00['params']['id']}},_0x5a1def={};_0x5a1def[_0x4a32('0x2c')]=_['keys'](db[_0x4a32('0x42')][_0x4a32('0x29')]);_0x41af4f[_0x4a32('0x31')]=_[_0x4a32('0x30')](_0x5a1def['model'],qs[_0x4a32('0x32')](_0x208e00[_0x4a32('0x2d')][_0x4a32('0x32')]));_0x41af4f[_0x4a32('0x31')]=_0x41af4f[_0x4a32('0x31')]['length']?_0x41af4f[_0x4a32('0x31')]:_0x5a1def[_0x4a32('0x2c')];if(_0x208e00['query']['includeAll']){_0x41af4f[_0x4a32('0x3c')]=[{'all':!![]}];}_0x41af4f=_[_0x4a32('0x38')]({},_0x41af4f,_0x208e00[_0x4a32('0x41')]);return db[_0x4a32('0x42')][_0x4a32('0x44')](_0x41af4f)[_0x4a32('0x23')](handleEntityNotFound(_0x4b4eba,null))[_0x4a32('0x23')](function(_0x2e0ace){if(_0x2e0ace){var _0x2f7913=_0x2e0ace[_0x4a32('0x45')]({'plain':!![]});_0x2f7913=qs[_0x4a32('0x46')](_0x2f7913,['id',_0x4a32('0x47'),_0x4a32('0x48')]);_0x208e00[_0x4a32('0x49')]=_[_0x4a32('0x46')](_0x208e00['body'],['id',_0x4a32('0x47'),_0x4a32('0x48')]);return db[_0x4a32('0x42')][_0x4a32('0x4a')](_['merge'](_0x2f7913,_0x208e00[_0x4a32('0x49')]),{'include':_0x208e00[_0x4a32('0x2d')][_0x4a32('0x3b')]?[{'all':!![]}]:undefined});}})[_0x4a32('0x23')](respondWithResult(_0x4b4eba,0xc9))['catch'](handleError(_0x4b4eba,null));};exports[_0x4a32('0x21')]=function(_0x8a03c3,_0x1b4579){if(_0x8a03c3[_0x4a32('0x49')]['id']){delete _0x8a03c3[_0x4a32('0x49')]['id'];}return db['Attachment']['find']({'where':{'id':_0x8a03c3[_0x4a32('0x40')]['id']}})[_0x4a32('0x23')](handleEntityNotFound(_0x1b4579,null))[_0x4a32('0x23')](saveUpdates(_0x8a03c3[_0x4a32('0x49')],null))[_0x4a32('0x23')](respondWithResult(_0x1b4579,null))['catch'](handleError(_0x1b4579,null));};exports[_0x4a32('0x22')]=function(_0x3d692d,_0x177e8a){return db[_0x4a32('0x42')][_0x4a32('0x44')]({'where':{'id':_0x3d692d[_0x4a32('0x40')]['id']}})['then'](handleEntityNotFound(_0x177e8a,null))[_0x4a32('0x23')](removeEntity(_0x177e8a,null))['catch'](handleError(_0x177e8a,null));};exports['create']=function(_0x47d057,_0x13ef93,_0xc3683e){_0x47d057['body'][_0x4a32('0x25')]=_0x47d057[_0x4a32('0x4b')][_0x4a32('0x4c')];_0x47d057['body'][_0x4a32('0x4d')]=_0x47d057[_0x4a32('0x4b')][_0x4a32('0x4e')];_0x47d057[_0x4a32('0x49')][_0x4a32('0x2b')]=_0x47d057[_0x4a32('0x4b')][_0x4a32('0x4f')];return db[_0x4a32('0x42')]['create'](_0x47d057[_0x4a32('0x49')])[_0x4a32('0x23')](respondWithResult(_0x13ef93,0xc9))[_0x4a32('0x3e')](handleError(_0x13ef93,null));};exports[_0x4a32('0x50')]=function(_0x204e46,_0x174d72,_0xa6c67f){return db[_0x4a32('0x42')][_0x4a32('0x51')]({'where':{'id':_0x204e46[_0x4a32('0x40')]['id']},'raw':!![]})[_0x4a32('0x23')](handleEntityNotFound(_0x174d72,null))[_0x4a32('0x23')](function(_0x1cbbaf){if(_0x1cbbaf){var _0x17b49f=_0x1cbbaf['ChatOfflineMessageId']!==null;var _0x5f4cac=path[_0x4a32('0x52')](config['root'],'server/files/attachments/');if(_0x17b49f){_0x5f4cac=path[_0x4a32('0x52')](_0x5f4cac,'offline-chat/');}var _0x5a396c=path[_0x4a32('0x52')](_0x5f4cac,_0x1cbbaf[_0x4a32('0x4d')]);return _0x174d72['download'](_0x5a396c);}})['catch'](handleError(_0x174d72,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index dc5e8e7..b51fbdc 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 _0x4758=['../../config/environment','./attachment.attributes','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1d9e60,_0x51ce17){var _0x4d1283=function(_0x3713ab){while(--_0x3713ab){_0x1d9e60['push'](_0x1d9e60['shift']());}};_0x4d1283(++_0x51ce17);}(_0x4758,0x108));var _0x8475=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4758[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8475('0x0'));var util=require(_0x8475('0x1'));var logger=require(_0x8475('0x2'))(_0x8475('0x3'));var moment=require(_0x8475('0x4'));var BPromise=require(_0x8475('0x5'));var rp=require(_0x8475('0x6'));var fs=require('fs');var path=require(_0x8475('0x7'));var rimraf=require(_0x8475('0x8'));var config=require(_0x8475('0x9'));var attributes=require(_0x8475('0xa'));module['exports']=function(_0x45503f,_0x266a9f){return _0x45503f['define'](_0x8475('0xb'),attributes,{'tableName':_0x8475('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ce9=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','./attachment.attributes','exports','Attachment'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x4ce9,0x118));var _0x94ce=function(_0x281a61,_0x4d3807){_0x281a61=_0x281a61-0x0;var _0x4b9d4d=_0x4ce9[_0x281a61];return _0x4b9d4d;};'use strict';var _=require(_0x94ce('0x0'));var util=require('util');var logger=require(_0x94ce('0x1'))(_0x94ce('0x2'));var moment=require(_0x94ce('0x3'));var BPromise=require(_0x94ce('0x4'));var rp=require(_0x94ce('0x5'));var fs=require('fs');var path=require(_0x94ce('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x94ce('0x7'));module[_0x94ce('0x8')]=function(_0x4a5ffe,_0x497c9c){return _0x4a5ffe['define'](_0x94ce('0x9'),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 00b079a..d79ce84 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 _0x6a24=['create','body','options','raw','then','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment','Attachment'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x6a24,0xd1));var _0x46a2=function(_0x482896,_0x5395ee){_0x482896=_0x482896-0x0;var _0x3641cc=_0x6a24[_0x482896];return _0x3641cc;};'use strict';var _=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var moment=require('moment');var BPromise=require(_0x46a2('0x2'));var rs=require(_0x46a2('0x3'));var fs=require('fs');var Redis=require(_0x46a2('0x4'));var db=require(_0x46a2('0x5'))['db'];var utils=require(_0x46a2('0x6'));var logger=require('../../config/logger')(_0x46a2('0x7'));var config=require(_0x46a2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x46a2('0x9')][_0x46a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x506698,_0x49870f,_0x2092f3){return new BPromise(function(_0x321b88,_0x587092){return client[_0x46a2('0xb')](_0x506698,_0x2092f3)['then'](function(_0x395578){logger['info'](_0x46a2('0xc'),_0x49870f,_0x46a2('0xd'));logger[_0x46a2('0xe')](_0x46a2('0xf'),_0x49870f,_0x46a2('0xd'),JSON[_0x46a2('0x10')](_0x395578));if(_0x395578[_0x46a2('0x11')]){if(_0x395578[_0x46a2('0x11')]['code']===0x1f4){logger['error'](_0x46a2('0xc'),_0x49870f,_0x395578[_0x46a2('0x11')]['message']);return _0x587092(_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);}logger[_0x46a2('0x11')](_0x46a2('0xc'),_0x49870f,_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);return _0x321b88(_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x49870f,_0x46a2('0xd'));_0x321b88(_0x395578[_0x46a2('0x13')]['message']);}})[_0x46a2('0x14')](function(_0x2d755b){logger['error'](_0x46a2('0xc'),_0x49870f,_0x2d755b);_0x587092(_0x2d755b);});});}exports[_0x46a2('0x15')]=function(_0x577f18){var _0x27250b=this;return new Promise(function(_0x24f75f,_0x529bb5){return db[_0x46a2('0x16')][_0x46a2('0x17')](_0x577f18[_0x46a2('0x18')],{'raw':_0x577f18[_0x46a2('0x19')]?_0x577f18[_0x46a2('0x19')][_0x46a2('0x1a')]===undefined?!![]:![]:!![]})[_0x46a2('0x1b')](function(_0x202294){logger[_0x46a2('0x1c')](_0x46a2('0x15'),_0x577f18);logger[_0x46a2('0xe')](_0x46a2('0x15'),_0x577f18,JSON[_0x46a2('0x10')](_0x202294));_0x24f75f(_0x202294);})['catch'](function(_0xa37d90){logger['error'](_0x46a2('0x15'),_0xa37d90[_0x46a2('0x12')],_0x577f18);_0x529bb5(_0x27250b['error'](0x1f4,_0xa37d90[_0x46a2('0x12')]));});});};
\ No newline at end of file
+var _0x0834=['message','result','catch','create','options','raw','CreateAttachment','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2b90dc,_0x10b832){var _0x4794a6=function(_0x3720ca){while(--_0x3720ca){_0x2b90dc['push'](_0x2b90dc['shift']());}};_0x4794a6(++_0x10b832);}(_0x0834,0x18e));var _0x4083=function(_0xf94f9b,_0x2db140){_0xf94f9b=_0xf94f9b-0x0;var _0x2a8df6=_0x0834[_0xf94f9b];return _0x2a8df6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4083('0x0'));var BPromise=require(_0x4083('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4083('0x2'));var logger=require(_0x4083('0x3'))('rpc');var config=require(_0x4083('0x4'));var jayson=require(_0x4083('0x5'));var client=jayson['client'][_0x4083('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5c5a54,_0x31c7ef,_0x26ed53){return new BPromise(function(_0x2c42bb,_0x1d56dd){return client[_0x4083('0x7')](_0x5c5a54,_0x26ed53)[_0x4083('0x8')](function(_0x3cee37){logger[_0x4083('0x9')](_0x4083('0xa'),_0x31c7ef,_0x4083('0xb'));logger[_0x4083('0xc')](_0x4083('0xd'),_0x31c7ef,_0x4083('0xb'),JSON[_0x4083('0xe')](_0x3cee37));if(_0x3cee37[_0x4083('0xf')]){if(_0x3cee37['error']['code']===0x1f4){logger[_0x4083('0xf')](_0x4083('0xa'),_0x31c7ef,_0x3cee37['error'][_0x4083('0x10')]);return _0x1d56dd(_0x3cee37[_0x4083('0xf')][_0x4083('0x10')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x31c7ef,_0x3cee37[_0x4083('0xf')][_0x4083('0x10')]);return _0x2c42bb(_0x3cee37['error'][_0x4083('0x10')]);}else{logger[_0x4083('0x9')](_0x4083('0xa'),_0x31c7ef,_0x4083('0xb'));_0x2c42bb(_0x3cee37[_0x4083('0x11')]['message']);}})[_0x4083('0x12')](function(_0x10cadd){logger[_0x4083('0xf')](_0x4083('0xa'),_0x31c7ef,_0x10cadd);_0x1d56dd(_0x10cadd);});});}exports['CreateAttachment']=function(_0x4e7d59){var _0x4d6089=this;return new Promise(function(_0xafda0c,_0x53d525){return db['Attachment'][_0x4083('0x13')](_0x4e7d59['body'],{'raw':_0x4e7d59[_0x4083('0x14')]?_0x4e7d59[_0x4083('0x14')][_0x4083('0x15')]===undefined?!![]:![]:!![]})[_0x4083('0x8')](function(_0x4b32e9){logger[_0x4083('0x9')]('CreateAttachment',_0x4e7d59);logger[_0x4083('0xc')](_0x4083('0x16'),_0x4e7d59,JSON[_0x4083('0xe')](_0x4b32e9));_0xafda0c(_0x4b32e9);})[_0x4083('0x12')](function(_0x5d7461){logger[_0x4083('0xf')]('CreateAttachment',_0x5d7461[_0x4083('0x10')],_0x4e7d59);_0x53d525(_0x4d6089[_0x4083('0xf')](0x1f4,_0x5d7461['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 8ffa9f8..99ae391 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5c5f03,_0x16bd73){var _0x124a40=function(_0x3b8092){while(--_0x3b8092){_0x5c5f03['push'](_0x5c5f03['shift']());}};_0x124a40(++_0x16bd73);}(_0x2032,0xd9));var _0x2203=function(_0x1cd140,_0x1ee670){_0x1cd140=_0x1cd140-0x0;var _0x29a32c=_0x2032[_0x1cd140];return _0x29a32c;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x27f38d,_0x2c5015){var _0x315ecb=function(_0x3e4c99){while(--_0x3e4c99){_0x27f38d['push'](_0x27f38d['shift']());}};_0x315ecb(++_0x2c5015);}(_0x757a,0xde));var _0xa757=function(_0x160821,_0x3377f7){_0x160821=_0x160821-0x0;var _0xe6abc4=_0x757a[_0x160821];return _0xe6abc4;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 99d62c6..403c1d1 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 _0xb926=['message','login','ad-login','json','online','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','undefined','activedirectory','baseDN','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','disabled','blockedAt','admin','user','name','blocked','blockDuration','minutes','clearBlockUser','getLicense','catch','status','send'];(function(_0x32d5b4,_0x35a043){var _0x33157e=function(_0x4889cb){while(--_0x4889cb){_0x32d5b4['push'](_0x32d5b4['shift']());}};_0x33157e(++_0x35a043);}(_0xb926,0xce));var _0x6b92=function(_0x255212,_0x106ece){_0x255212=_0x255212-0x0;var _0x5ea982=_0xb926[_0x255212];return _0x5ea982;};'use strict';var passport=require(_0x6b92('0x0'));var LocalStrategy=require(_0x6b92('0x1'))[_0x6b92('0x2')];var moment=require(_0x6b92('0x3'));var ActiveDirectory=require(_0x6b92('0x4'));var BPromise=require(_0x6b92('0x5'));var util=require(_0x6b92('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x6b92('0x7'));var utils=require(_0x6b92('0x8'));var config=require(_0x6b92('0x9'));var logger=require(_0x6b92('0xa'))(_0x6b92('0xb'));function isActiveDirectoryConfigured(_0x141cca){var _0x1c5ab6=![];if(typeof _0x141cca['activedirectory']!==_0x6b92('0xc')){_0x1c5ab6=_0x141cca[_0x6b92('0xd')][_0x6b92('0xe')]&&_0x141cca[_0x6b92('0xd')]['url']&&_0x141cca['activedirectory'][_0x6b92('0xf')];}return _0x1c5ab6;}function adAuthenticate(_0x4ac28d,_0x564877,_0x3596c6){return new BPromise(function(_0x25e1c2,_0x111779){try{var _0x3aaddd=new ActiveDirectory(_0x4ac28d);_0x3aaddd[_0x6b92('0x10')](_0x564877,_0x3596c6,function(_0x3736a4,_0x4c32f0){if(_0x3736a4){logger['error'](_0x6b92('0x11'),_0x564877,util[_0x6b92('0x12')](_0x3736a4,{'showHidden':![],'depth':null}));_0x111779(_0x6b92('0x13'));}else if(!_0x4c32f0){logger['error'](_0x6b92('0x14'),_0x564877);_0x111779('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x25e1c2(_0x4c32f0);}});}catch(_0x57628f){_0x111779(_0x57628f);}});}function ActiveDirectoryAuthenticate(_0x4981f0,_0x59b365,_0x1b083b,_0x53ca93){var _0x3d4b21,_0xe41b01;if(!isActiveDirectoryConfigured(config)){logger[_0x6b92('0x15')](_0x6b92('0x16'),_0x59b365);return _0x53ca93(null,![],{'message':_0x6b92('0x13')});}return db[_0x6b92('0x17')][_0x6b92('0x18')]({'where':{'id':0x1},'attributes':[_0x6b92('0x19'),'blockDuration'],'raw':!![]})[_0x6b92('0x1a')](function(_0x205481){_0x3d4b21=_0x205481;if(!_0x3d4b21[_0x6b92('0x19')]){logger[_0x6b92('0x15')](_0x6b92('0x1b'),_0x59b365);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x4981f0['findOne']({'attributes':['id','name',_0x6b92('0x1c'),_0x6b92('0x1d'),_0x6b92('0x1e'),_0x6b92('0x1f'),'blocked',_0x6b92('0x20'),'online'],'where':{'name':_0x59b365,'role':{'$or':[_0x6b92('0x21'),_0x6b92('0x22'),'agent']},'adSsoEnabled':!![]}});})[_0x6b92('0x1a')](function(_0x4d84d0){if(!_0x4d84d0||_0x4d84d0&&_0x4d84d0[_0x6b92('0x23')]!==_0x59b365){throw new Error(_0x6b92('0x13'));}_0xe41b01=_0x4d84d0;var _0x1f8477=_0xe41b01[_0x6b92('0x23')]+'@'+config[_0x6b92('0xd')][_0x6b92('0xf')];return adAuthenticate(config[_0x6b92('0xd')],_0x1f8477,_0x1b083b);})[_0x6b92('0x1a')](function(_0x36bc3e){if(_0xe41b01['disabled']){throw new Error(_0x6b92('0x13'));}if(_0x3d4b21['blockDuration']>0x0){if(_0xe41b01[_0x6b92('0x24')]){if(moment(_0xe41b01[_0x6b92('0x20')])['add'](_0x3d4b21[_0x6b92('0x25')],_0x6b92('0x26'))>moment()){throw new Error(_0x6b92('0x13'));}return utils[_0x6b92('0x27')](_0xe41b01,0x0,![],null)['then'](function(){return utils[_0x6b92('0x28')](_0xe41b01);})['then'](function(){return _0x53ca93(null,_0xe41b01);});}else{return utils[_0x6b92('0x28')](_0xe41b01)[_0x6b92('0x1a')](function(){return _0x53ca93(null,_0xe41b01);});}}else{return utils[_0x6b92('0x28')](_0xe41b01)[_0x6b92('0x1a')](function(){return _0x53ca93(null,_0xe41b01);});}})[_0x6b92('0x29')](function(_0x32f2ec){return _0x53ca93(null,![],_0x32f2ec);});}function handleError(_0x109cc1,_0x168e78,_0x1ca36d){return _0x109cc1[_0x6b92('0x2a')](_0x168e78||0x1f4)[_0x6b92('0x2b')]({'message':_0x1ca36d?_0x1ca36d[_0x6b92('0x2c')]||_0x1ca36d:''});}exports[_0x6b92('0x2d')]=function(_0x39c085,_0x4ab414,_0x59caba){passport[_0x6b92('0x10')](_0x6b92('0x2e'),function(_0x486575,_0x55e088,_0xf32247){var _0x46f1d3=_0x486575||_0xf32247;if(_0x46f1d3){return handleError(_0x4ab414,0x191,_0x46f1d3);}if(!_0x55e088){return handleError(_0x4ab414,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3a8bc3={'payload':{'id':_0x55e088['id'],'role':_0x55e088[_0x6b92('0x1e')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3a8bc3)[_0x6b92('0x1a')](function(_0x3b13fb){_0x4ab414[_0x6b92('0x2f')]({'id':_0x55e088['id'],'token':_0x3b13fb,'statusCall':'','isAlreadyLogged':_0x55e088[_0x6b92('0x30')]});});}})(_0x39c085,_0x4ab414,_0x59caba);};passport['use'](_0x6b92('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':_0x6b92('0x1c')},function(_0x311899,_0x3c574e,_0x1d2dfd){return ActiveDirectoryAuthenticate(db[_0x6b92('0x31')],_0x311899,_0x3c574e,_0x1d2dfd);}));
\ No newline at end of file
+var _0xc86e=['moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','undefined','activedirectory','baseDN','url','domain','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blockedAt','online','user','blocked','minutes','clearBlockUser','getLicense','status','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','use','password','passport','passport-local'];(function(_0x5533b0,_0x2c1801){var _0x1b10f7=function(_0x5bc55c){while(--_0x5bc55c){_0x5533b0['push'](_0x5533b0['shift']());}};_0x1b10f7(++_0x2c1801);}(_0xc86e,0xd0));var _0xec86=function(_0x28a510,_0x58b893){_0x28a510=_0x28a510-0x0;var _0x499425=_0xc86e[_0x28a510];return _0x499425;};'use strict';var passport=require(_0xec86('0x0'));var LocalStrategy=require(_0xec86('0x1'))['Strategy'];var moment=require(_0xec86('0x2'));var ActiveDirectory=require(_0xec86('0x3'));var BPromise=require(_0xec86('0x4'));var util=require(_0xec86('0x5'));var db=require(_0xec86('0x6'))['db'];var authService=require(_0xec86('0x7'));var utils=require(_0xec86('0x8'));var config=require('../../config/environment');var logger=require(_0xec86('0x9'))('api');function isActiveDirectoryConfigured(_0x111662){var _0x45b954=![];if(typeof _0x111662['activedirectory']!==_0xec86('0xa')){_0x45b954=_0x111662[_0xec86('0xb')][_0xec86('0xc')]&&_0x111662[_0xec86('0xb')][_0xec86('0xd')]&&_0x111662['activedirectory'][_0xec86('0xe')];}return _0x45b954;}function adAuthenticate(_0x25927c,_0x255c6b,_0x466d6a){return new BPromise(function(_0x2d23e3,_0x504b34){try{var _0x2b97f6=new ActiveDirectory(_0x25927c);_0x2b97f6['authenticate'](_0x255c6b,_0x466d6a,function(_0x529220,_0x4960f1){if(_0x529220){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x255c6b,util[_0xec86('0xf')](_0x529220,{'showHidden':![],'depth':null}));_0x504b34(_0xec86('0x10'));}else if(!_0x4960f1){logger[_0xec86('0x11')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x255c6b);_0x504b34('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2d23e3(_0x4960f1);}});}catch(_0x2b009){_0x504b34(_0x2b009);}});}function ActiveDirectoryAuthenticate(_0x49230e,_0x366991,_0x179a03,_0x114745){var _0x29d8c2,_0x5e3dd9;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x366991);return _0x114745(null,![],{'message':_0xec86('0x10')});}return db[_0xec86('0x12')][_0xec86('0x13')]({'where':{'id':0x1},'attributes':[_0xec86('0x14'),_0xec86('0x15')],'raw':!![]})[_0xec86('0x16')](function(_0x31ca9c){_0x29d8c2=_0x31ca9c;if(!_0x29d8c2[_0xec86('0x14')]){logger['error'](_0xec86('0x17'),_0x366991);throw new Error(_0xec86('0x10'));}return _0x49230e[_0xec86('0x13')]({'attributes':['id',_0xec86('0x18'),'password',_0xec86('0x19'),_0xec86('0x1a'),_0xec86('0x1b'),'blocked',_0xec86('0x1c'),_0xec86('0x1d')],'where':{'name':_0x366991,'role':{'$or':['admin',_0xec86('0x1e'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x400d80){if(!_0x400d80||_0x400d80&&_0x400d80['name']!==_0x366991){throw new Error(_0xec86('0x10'));}_0x5e3dd9=_0x400d80;var _0x101bcf=_0x5e3dd9[_0xec86('0x18')]+'@'+config[_0xec86('0xb')]['domain'];return adAuthenticate(config['activedirectory'],_0x101bcf,_0x179a03);})[_0xec86('0x16')](function(_0x1c1014){if(_0x5e3dd9[_0xec86('0x1b')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x29d8c2[_0xec86('0x15')]>0x0){if(_0x5e3dd9[_0xec86('0x1f')]){if(moment(_0x5e3dd9[_0xec86('0x1c')])['add'](_0x29d8c2['blockDuration'],_0xec86('0x20'))>moment()){throw new Error(_0xec86('0x10'));}return utils[_0xec86('0x21')](_0x5e3dd9,0x0,![],null)[_0xec86('0x16')](function(){return utils['getLicense'](_0x5e3dd9);})[_0xec86('0x16')](function(){return _0x114745(null,_0x5e3dd9);});}else{return utils[_0xec86('0x22')](_0x5e3dd9)['then'](function(){return _0x114745(null,_0x5e3dd9);});}}else{return utils[_0xec86('0x22')](_0x5e3dd9)[_0xec86('0x16')](function(){return _0x114745(null,_0x5e3dd9);});}})['catch'](function(_0xaf2310){return _0x114745(null,![],_0xaf2310);});}function handleError(_0xa1e20d,_0x2d80ea,_0x35c17a){return _0xa1e20d[_0xec86('0x23')](_0x2d80ea||0x1f4)['send']({'message':_0x35c17a?_0x35c17a['message']||_0x35c17a:''});}exports[_0xec86('0x24')]=function(_0x3455d2,_0x203085,_0x9b6005){passport[_0xec86('0x25')](_0xec86('0x26'),function(_0xc5594b,_0x119208,_0x16acb8){var _0x1c2f51=_0xc5594b||_0x16acb8;if(_0x1c2f51){return handleError(_0x203085,0x191,_0x1c2f51);}if(!_0x119208){return handleError(_0x203085,0x194,{'message':_0xec86('0x27')});}else{var _0x1d2928={'payload':{'id':_0x119208['id'],'role':_0x119208['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1d2928)[_0xec86('0x16')](function(_0x1fb929){_0x203085['json']({'id':_0x119208['id'],'token':_0x1fb929,'statusCall':'','isAlreadyLogged':_0x119208[_0xec86('0x1d')]});});}})(_0x3455d2,_0x203085,_0x9b6005);};passport[_0xec86('0x28')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0xec86('0x29')},function(_0x18f2fe,_0xd77177,_0x21e563){return ActiveDirectoryAuthenticate(db['User'],_0x18f2fe,_0xd77177,_0x21e563);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 566516e..5b81be0 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 _0xc0c1=['exports','express','./authActiveDirectory.controller','post'];(function(_0x5de7a5,_0x23948a){var _0x41e57b=function(_0x4b348e){while(--_0x4b348e){_0x5de7a5['push'](_0x5de7a5['shift']());}};_0x41e57b(++_0x23948a);}(_0xc0c1,0x119));var _0x1c0c=function(_0x51995a,_0x3a0cb1){_0x51995a=_0x51995a-0x0;var _0x3b8a5a=_0xc0c1[_0x51995a];return _0x3b8a5a;};'use strict';var express=require(_0x1c0c('0x0'));var router=express['Router']();var controller=require(_0x1c0c('0x1'));router[_0x1c0c('0x2')]('/',controller['login']);module[_0x1c0c('0x3')]=router;
\ No newline at end of file
+var _0x45b1=['exports','Router','./authActiveDirectory.controller','post','login'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x45b1,0x1a0));var _0x145b=function(_0x9099d8,_0x1dc380){_0x9099d8=_0x9099d8-0x0;var _0x1988d4=_0x45b1[_0x9099d8];return _0x1988d4;};'use strict';var express=require('express');var router=express[_0x145b('0x0')]();var controller=require(_0x145b('0x1'));router[_0x145b('0x2')]('/',controller[_0x145b('0x3')]);module[_0x145b('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 9ec3d00..79da536 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0xa059ea,_0x5cb91e){var _0x156a4c=function(_0x1b4717){while(--_0x1b4717){_0xa059ea['push'](_0xa059ea['shift']());}};_0x156a4c(++_0x5cb91e);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _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(_0x28c5d1,_0x2688b9){var _0x19309f=function(_0x393348){while(--_0x393348){_0x28c5d1['push'](_0x28c5d1['shift']());}};_0x19309f(++_0x2688b9);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 e7a741e..bde0273 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 _0xff32=['/callback','callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','get','login'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xff32,0x15a));var _0x2ff3=function(_0x5e7fe0,_0x48f825){_0x5e7fe0=_0x5e7fe0-0x0;var _0x4a38d6=_0xff32[_0x5e7fe0];return _0x4a38d6;};'use strict';var express=require('express');var passport=require(_0x2ff3('0x0'));var router=express[_0x2ff3('0x1')]();var controller=require(_0x2ff3('0x2'));var userController=require(_0x2ff3('0x3'));var authService=require('../../components/auth/service');router[_0x2ff3('0x4')]('/',controller[_0x2ff3('0x5')]);router['get'](_0x2ff3('0x6'),controller[_0x2ff3('0x7')],authService[_0x2ff3('0x8')],userController[_0x2ff3('0x5')],authService[_0x2ff3('0x9')]);module[_0x2ff3('0xa')]=router;
\ No newline at end of file
+var _0x7a57=['isMiddleware','exports','express','Router','./authGoogle.controller','../user/user.controller.js','get','login','callback'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x7a57,0x1d6));var _0x77a5=function(_0x360bb3,_0x3197fd){_0x360bb3=_0x360bb3-0x0;var _0x55e3f2=_0x7a57[_0x360bb3];return _0x55e3f2;};'use strict';var express=require(_0x77a5('0x0'));var passport=require('passport');var router=express[_0x77a5('0x1')]();var controller=require(_0x77a5('0x2'));var userController=require(_0x77a5('0x3'));var authService=require('../../components/auth/service');router[_0x77a5('0x4')]('/',controller[_0x77a5('0x5')]);router[_0x77a5('0x4')]('/callback',controller[_0x77a5('0x6')],authService[_0x77a5('0x7')],userController['login'],authService['setTokenCookie']);module[_0x77a5('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 2b64c83..03a38a1 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 _0xa28b=['The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\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://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','local-login','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','minutes','clearBlockUser','add','getLicense','catch','MailAccount','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','SendMail','error','message','stringify','status','send','signToken','online','forgot','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','find','body','This\x20email\x20is\x20not\x20registered.'];(function(_0x33d244,_0x46f998){var _0x5420ec=function(_0x1e9974){while(--_0x1e9974){_0x33d244['push'](_0x33d244['shift']());}};_0x5420ec(++_0x46f998);}(_0xa28b,0x15b));var _0xba28=function(_0x29b328,_0x8c73ed){_0x29b328=_0x29b328-0x0;var _0x1f59ab=_0xa28b[_0x29b328];return _0x1f59ab;};'use strict';var util=require('util');var passport=require(_0xba28('0x0'));var LocalStrategy=require(_0xba28('0x1'))[_0xba28('0x2')];var jayson=require(_0xba28('0x3'));var _=require(_0xba28('0x4'));var rs=require(_0xba28('0x5'));var moment=require(_0xba28('0x6'));var db=require(_0xba28('0x7'))['db'];var authService=require(_0xba28('0x8'));var utils=require(_0xba28('0x9'));var client=jayson[_0xba28('0xa')]['http']({'port':0x232b});function localAuthenticate(_0x309b4e,_0x5d4de6,_0x51c502,_0xbb9604){var _0x2a35f4,_0x4cb74b;return db[_0xba28('0xb')][_0xba28('0xc')]({'where':{'id':0x1},'attributes':[_0xba28('0xd'),_0xba28('0xe')],'raw':!![]})[_0xba28('0xf')](function(_0x306915){_0x2a35f4=_0x306915;return _0x309b4e[_0xba28('0xc')]({'attributes':['id',_0xba28('0x10'),_0xba28('0x11'),_0xba28('0x12'),_0xba28('0x13'),_0xba28('0x14'),_0xba28('0x15'),_0xba28('0x16'),_0xba28('0x17')],'where':{'name':_0x5d4de6,'role':{'$or':['admin',_0xba28('0x18'),_0xba28('0x19')]}}});})[_0xba28('0xf')](function(_0x566997){if(!_0x566997||_0x566997&&_0x566997[_0xba28('0x10')]!==_0x5d4de6){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x4cb74b=_0x566997;return _0x4cb74b;}})['then'](function(){_0x4cb74b[_0xba28('0x1a')](_0x51c502,function(_0x5d8f64,_0x3c8202){var _0x169b55=_0x4cb74b[_0xba28('0x17')]+0x1;if(_0x5d8f64){return _0xbb9604(_0x5d8f64);}else if(!_0x3c8202){if(_0x4cb74b[_0xba28('0x14')]){return _0xbb9604(null,![],{'message':_0xba28('0x1b')});}else if(_0x2a35f4[_0xba28('0xd')]>0x0){if(_0x4cb74b[_0xba28('0x15')]){if(_0x2a35f4[_0xba28('0xe')]>0x0){if(moment(_0x4cb74b['blockedAt'])['add'](_0x2a35f4[_0xba28('0xe')],_0xba28('0x1c'))>moment()){return _0xbb9604(null,![],{'message':_0xba28('0x1b')});}else{return utils['clearBlockUser'](_0x4cb74b,_0x169b55,![],null)['then'](function(){return _0xbb9604(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0xbb9604(null,![],{'message':_0xba28('0x1b')});}}else{if(_0x169b55>=_0x2a35f4['allowedLoginAttempts']){return utils[_0xba28('0x1d')](_0x4cb74b,0x0,!![],moment())[_0xba28('0xf')](function(){return _0xbb9604(null,![],{'message':_0xba28('0x1b')});});}else{return utils[_0xba28('0x1d')](_0x4cb74b,_0x169b55,![],null)[_0xba28('0xf')](function(){return _0xbb9604(null,![],{'message':_0xba28('0x1b')});});}}}else{return _0xbb9604(null,![],{'message':_0xba28('0x1b')});}}else{if(_0x4cb74b[_0xba28('0x14')]){return _0xbb9604(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2a35f4['allowedLoginAttempts']>0x0){if(_0x4cb74b[_0xba28('0x15')]){if(_0x2a35f4['blockDuration']>0x0){if(moment(_0x4cb74b[_0xba28('0x16')])[_0xba28('0x1e')](_0x2a35f4['blockDuration'],_0xba28('0x1c'))>moment()){return _0xbb9604(null,![],{'message':_0xba28('0x1b')});}else{return utils[_0xba28('0x1d')](_0x4cb74b,0x0,![],null)[_0xba28('0xf')](function(){return utils[_0xba28('0x1f')](_0x4cb74b);})[_0xba28('0xf')](function(){return _0xbb9604(null,_0x4cb74b);});}}else{return _0xbb9604(null,![],{'message':_0xba28('0x1b')});}}else{return utils['clearBlockUser'](_0x4cb74b,0x0,![],null)[_0xba28('0xf')](function(){return utils['getLicense'](_0x4cb74b);})[_0xba28('0xf')](function(){return _0xbb9604(null,_0x4cb74b);})[_0xba28('0x20')](function(_0x35aa30){return _0xbb9604(null,![],_0x35aa30);});}}else{if(_0x4cb74b[_0xba28('0x15')]){return _0xbb9604(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xba28('0x1f')](_0x4cb74b)[_0xba28('0xf')](function(){return _0xbb9604(null,_0x4cb74b);});}}}});})[_0xba28('0x20')](function(_0x160d33){return _0xbb9604(null,![],_0x160d33);});}function sendServiceMail(_0x2c9eb9){return db[_0xba28('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0xba28('0x10'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xba28('0x22'),'include':[{'model':db[_0xba28('0x23')],'as':_0xba28('0x23')}]}]})[_0xba28('0xf')](function(_0x3e6544){if(!_0x3e6544){throw new Error(_0xba28('0x24'));}var _0x41c152=_0x3e6544[_0xba28('0x25')]();var _0x5ac3b1={'account':_0x41c152,'message':_[_0xba28('0x26')]({'from':util[_0xba28('0x27')](_0xba28('0x28'),_0x3e6544[_0xba28('0x10')],_0x3e6544[_0xba28('0x29')]||_0x3e6544[_0xba28('0x22')]['user'])},_0x2c9eb9)};return client['request'](_0xba28('0x2a'),_0x5ac3b1);})['then'](function(_0x408e5f){if(_0x408e5f['error']){throw new Error(util[_0xba28('0x27')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x408e5f[_0xba28('0x2b')][_0xba28('0x2c')]||JSON[_0xba28('0x2d')](_0x408e5f[_0xba28('0x2b')])));}return!![];});}function handleError(_0x832b5,_0x25b45e,_0x4430cf){return _0x832b5[_0xba28('0x2e')](_0x25b45e||0x1f4)[_0xba28('0x2f')]({'message':_0x4430cf?_0x4430cf[_0xba28('0x2c')]||_0x4430cf:''});}exports['login']=function(_0x442390,_0x2d8bdf,_0x227a3b){passport[_0xba28('0x1a')]('local-login',function(_0xf30f4a,_0xe2db92,_0x40eac8){var _0x456d35=_0xf30f4a||_0x40eac8;if(_0x456d35){return handleError(_0x2d8bdf,0x191,_0x456d35);}if(!_0xe2db92){return handleError(_0x2d8bdf,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x1ff619={'payload':{'id':_0xe2db92['id'],'role':_0xe2db92[_0xba28('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0xba28('0x30')](_0x1ff619)[_0xba28('0xf')](function(_0x5e212e){_0x2d8bdf['json']({'id':_0xe2db92['id'],'token':_0x5e212e,'statusCall':'','isAlreadyLogged':_0xe2db92[_0xba28('0x31')]});});}})(_0x442390,_0x2d8bdf,_0x227a3b);};exports[_0xba28('0x32')]=function(_0x59f78d,_0xa6389a){if(!_0x59f78d['body'][_0xba28('0x29')]){return handleError(_0xa6389a,0x1f4,{'message':_0xba28('0x33')});}var _0x997275=rs[_0xba28('0x34')]();_0x59f78d['body'][_0xba28('0x29')]=_0x59f78d['body']['email']['trim']()[_0xba28('0x35')]();var _0x3656f3;return db[_0xba28('0xb')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x345649){_0x3656f3=_0x345649;return db[_0xba28('0x36')][_0xba28('0x37')]({'where':{'email':_0x59f78d[_0xba28('0x38')]['email']}});})[_0xba28('0xf')](function(_0x5af292){if(!_0x5af292){throw new Error(_0xba28('0x39'));}if(_0x5af292[_0xba28('0x14')]){throw new Error(_0xba28('0x3a'));}if(_0x5af292['blocked']){if(moment(_0x5af292[_0xba28('0x16')])[_0xba28('0x1e')](_0x3656f3[_0xba28('0xe')],'minutes')>moment()){throw new Error(_0xba28('0x3b'));}else{_0x5af292[_0xba28('0x15')]=![];_0x5af292[_0xba28('0x16')]=null;}}_0x5af292[_0xba28('0x3c')]=_0x997275;_0x5af292['resetPasswordExpires']=Date[_0xba28('0x3d')]()+0x36ee80;return _0x5af292['save']();})[_0xba28('0xf')](function(){return sendServiceMail({'to':_0x59f78d[_0xba28('0x38')]['email'],'subject':_0xba28('0x3e'),'text':_0xba28('0x3f')+_0xba28('0x40')+_0xba28('0x41')+_0x59f78d['headers'][_0xba28('0x42')]+_0xba28('0x43')+_0x997275+'\x0a\x0a'+_0xba28('0x44')});})[_0xba28('0xf')](function(){_0xa6389a[_0xba28('0x2e')](0xc8)[_0xba28('0x2f')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x53205b){return handleError(_0xa6389a,0x1f4,_0x53205b);});};exports[_0xba28('0x45')]=function(_0x209020,_0x3f1329){return db[_0xba28('0x36')][_0xba28('0x37')]({'where':{'resetPasswordToken':_0x209020[_0xba28('0x46')]['token'],'resetPasswordExpires':{'$gt':Date[_0xba28('0x3d')]()}}})[_0xba28('0xf')](function(_0xbda51b){if(!_0xbda51b){throw new Error(_0xba28('0x47'));}return db[_0xba28('0xb')][_0xba28('0xc')]({'attributes':['id',_0xba28('0x48'),_0xba28('0x49'),_0xba28('0x4a')]})[_0xba28('0xf')](function(_0x1cd9c3){if(_0x1cd9c3['securePassword'])authService[_0xba28('0x4b')](_0x209020[_0xba28('0x38')][_0xba28('0x11')]);if(!_0x1cd9c3[_0xba28('0x49')]||!_0xbda51b[_0xba28('0x4c')])return _0xbda51b;authService[_0xba28('0x4d')](_0x209020[_0xba28('0x38')]['password'],_0xbda51b['previousPasswords'],_0x1cd9c3[_0xba28('0x4a')]);return _0xbda51b;})[_0xba28('0xf')](function(){_0xbda51b[_0xba28('0x11')]=_0x209020[_0xba28('0x38')]['password'];_0xbda51b['resetPasswordToken']=null;_0xbda51b[_0xba28('0x4e')]=null;return _0xbda51b['save']();});})[_0xba28('0xf')](function(){_0x3f1329[_0xba28('0x2e')](0xc8)[_0xba28('0x2f')]({'message':_0xba28('0x4f')});})[_0xba28('0x20')](function(_0x3e506a){return handleError(_0x3f1329,0x1f4,_0x3e506a);});};passport['use'](_0xba28('0x50'),new LocalStrategy({'usernameField':_0xba28('0x10'),'passwordField':'password'},function(_0xa0c134,_0x3cb379,_0x43de81){return localAuthenticate(db[_0xba28('0x36')],_0xa0c134,_0x3cb379,_0x43de81);}));
\ No newline at end of file
+var _0x2d92=['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','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','securePassword','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordExpires','save','status','use','util','passport','passport-local','Strategy','moment','../../mysqldb','../../config/utils','client','Setting','findOne','password','salt','disabled','blocked','blockedAt','admin','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','authenticate','loginAttempts','allowedLoginAttempts','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message','login','local-login','role','signToken','json','online','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now'];(function(_0x7a82d9,_0x1b5b4a){var _0x220c0c=function(_0x5c50b6){while(--_0x5c50b6){_0x7a82d9['push'](_0x7a82d9['shift']());}};_0x220c0c(++_0x1b5b4a);}(_0x2d92,0xb9));var _0x22d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2d92[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x22d9('0x0'));var passport=require(_0x22d9('0x1'));var LocalStrategy=require(_0x22d9('0x2'))[_0x22d9('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require('randomstring');var moment=require(_0x22d9('0x4'));var db=require(_0x22d9('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x22d9('0x6'));var client=jayson[_0x22d9('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x273e13,_0x3fe726,_0x4a90dd,_0x293405){var _0x5985b1,_0x31ffd8;return db[_0x22d9('0x8')][_0x22d9('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x60a7a3){_0x5985b1=_0x60a7a3;return _0x273e13['findOne']({'attributes':['id','name',_0x22d9('0xa'),_0x22d9('0xb'),'role',_0x22d9('0xc'),_0x22d9('0xd'),_0x22d9('0xe'),'loginAttempts'],'where':{'name':_0x3fe726,'role':{'$or':[_0x22d9('0xf'),'user',_0x22d9('0x10')]}}});})['then'](function(_0x533b04){if(!_0x533b04||_0x533b04&&_0x533b04[_0x22d9('0x11')]!==_0x3fe726){throw new Error(_0x22d9('0x12'));}else{_0x31ffd8=_0x533b04;return _0x31ffd8;}})[_0x22d9('0x13')](function(){_0x31ffd8[_0x22d9('0x14')](_0x4a90dd,function(_0x30ffd6,_0x175d40){var _0x2f478e=_0x31ffd8[_0x22d9('0x15')]+0x1;if(_0x30ffd6){return _0x293405(_0x30ffd6);}else if(!_0x175d40){if(_0x31ffd8[_0x22d9('0xc')]){return _0x293405(null,![],{'message':_0x22d9('0x12')});}else if(_0x5985b1[_0x22d9('0x16')]>0x0){if(_0x31ffd8[_0x22d9('0xd')]){if(_0x5985b1[_0x22d9('0x17')]>0x0){if(moment(_0x31ffd8[_0x22d9('0xe')])[_0x22d9('0x18')](_0x5985b1['blockDuration'],_0x22d9('0x19'))>moment()){return _0x293405(null,![],{'message':_0x22d9('0x12')});}else{return utils[_0x22d9('0x1a')](_0x31ffd8,_0x2f478e,![],null)[_0x22d9('0x13')](function(){return _0x293405(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x293405(null,![],{'message':_0x22d9('0x12')});}}else{if(_0x2f478e>=_0x5985b1[_0x22d9('0x16')]){return utils[_0x22d9('0x1a')](_0x31ffd8,0x0,!![],moment())['then'](function(){return _0x293405(null,![],{'message':_0x22d9('0x12')});});}else{return utils[_0x22d9('0x1a')](_0x31ffd8,_0x2f478e,![],null)['then'](function(){return _0x293405(null,![],{'message':_0x22d9('0x12')});});}}}else{return _0x293405(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x31ffd8[_0x22d9('0xc')]){return _0x293405(null,![],{'message':_0x22d9('0x12')});}else if(_0x5985b1[_0x22d9('0x16')]>0x0){if(_0x31ffd8[_0x22d9('0xd')]){if(_0x5985b1[_0x22d9('0x17')]>0x0){if(moment(_0x31ffd8[_0x22d9('0xe')])[_0x22d9('0x18')](_0x5985b1[_0x22d9('0x17')],_0x22d9('0x19'))>moment()){return _0x293405(null,![],{'message':_0x22d9('0x12')});}else{return utils[_0x22d9('0x1a')](_0x31ffd8,0x0,![],null)[_0x22d9('0x13')](function(){return utils['getLicense'](_0x31ffd8);})[_0x22d9('0x13')](function(){return _0x293405(null,_0x31ffd8);});}}else{return _0x293405(null,![],{'message':_0x22d9('0x12')});}}else{return utils['clearBlockUser'](_0x31ffd8,0x0,![],null)[_0x22d9('0x13')](function(){return utils[_0x22d9('0x1b')](_0x31ffd8);})[_0x22d9('0x13')](function(){return _0x293405(null,_0x31ffd8);})[_0x22d9('0x1c')](function(_0x3bd6e3){return _0x293405(null,![],_0x3bd6e3);});}}else{if(_0x31ffd8[_0x22d9('0xd')]){return _0x293405(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x22d9('0x1b')](_0x31ffd8)[_0x22d9('0x13')](function(){return _0x293405(null,_0x31ffd8);});}}}});})[_0x22d9('0x1c')](function(_0x51cb5a){return _0x293405(null,![],_0x51cb5a);});}function sendServiceMail(_0x19b5e0){return db[_0x22d9('0x1d')][_0x22d9('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x22d9('0x11'),_0x22d9('0x1f')],'include':[{'model':db[_0x22d9('0x20')],'as':_0x22d9('0x21'),'include':[{'model':db[_0x22d9('0x22')],'as':_0x22d9('0x22')}]}]})[_0x22d9('0x13')](function(_0x2f31e5){if(!_0x2f31e5){throw new Error(_0x22d9('0x23'));}var _0x497caa=_0x2f31e5[_0x22d9('0x24')]();var _0x427085={'account':_0x497caa,'message':_[_0x22d9('0x25')]({'from':util[_0x22d9('0x26')](_0x22d9('0x27'),_0x2f31e5[_0x22d9('0x11')],_0x2f31e5['email']||_0x2f31e5[_0x22d9('0x21')][_0x22d9('0x28')])},_0x19b5e0)};return client[_0x22d9('0x29')](_0x22d9('0x2a'),_0x427085);})[_0x22d9('0x13')](function(_0x6b96f5){if(_0x6b96f5[_0x22d9('0x2b')]){throw new Error(util[_0x22d9('0x26')](_0x22d9('0x2c'),_0x6b96f5[_0x22d9('0x2b')]['message']||JSON[_0x22d9('0x2d')](_0x6b96f5[_0x22d9('0x2b')])));}return!![];});}function handleError(_0x30176b,_0x59f716,_0xab0278){return _0x30176b['status'](_0x59f716||0x1f4)[_0x22d9('0x2e')]({'message':_0xab0278?_0xab0278[_0x22d9('0x2f')]||_0xab0278:''});}exports[_0x22d9('0x30')]=function(_0x1c011d,_0x4d887c,_0x49cf16){passport['authenticate'](_0x22d9('0x31'),function(_0x20f151,_0x55dee9,_0xf1c2a6){var _0x29bd4d=_0x20f151||_0xf1c2a6;if(_0x29bd4d){return handleError(_0x4d887c,0x191,_0x29bd4d);}if(!_0x55dee9){return handleError(_0x4d887c,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3f129f={'payload':{'id':_0x55dee9['id'],'role':_0x55dee9[_0x22d9('0x32')]},'options':{'expiresIn':0x15180}};return authService[_0x22d9('0x33')](_0x3f129f)['then'](function(_0x247c1c){_0x4d887c[_0x22d9('0x34')]({'id':_0x55dee9['id'],'token':_0x247c1c,'statusCall':'','isAlreadyLogged':_0x55dee9[_0x22d9('0x35')]});});}})(_0x1c011d,_0x4d887c,_0x49cf16);};exports['forgot']=function(_0x4edc29,_0x4c59b9){if(!_0x4edc29['body'][_0x22d9('0x1f')]){return handleError(_0x4c59b9,0x1f4,{'message':_0x22d9('0x36')});}var _0x7127cc=rs[_0x22d9('0x37')]();_0x4edc29['body'][_0x22d9('0x1f')]=_0x4edc29[_0x22d9('0x38')][_0x22d9('0x1f')][_0x22d9('0x39')]()[_0x22d9('0x3a')]();var _0x1f4330;return db[_0x22d9('0x8')][_0x22d9('0x9')]({'where':{'id':0x1},'attributes':[_0x22d9('0x16'),_0x22d9('0x17')],'raw':!![]})[_0x22d9('0x13')](function(_0x469d6d){_0x1f4330=_0x469d6d;return db[_0x22d9('0x3b')][_0x22d9('0x1e')]({'where':{'email':_0x4edc29[_0x22d9('0x38')][_0x22d9('0x1f')]}});})[_0x22d9('0x13')](function(_0x983eb1){if(!_0x983eb1){throw new Error(_0x22d9('0x3c'));}if(_0x983eb1[_0x22d9('0xc')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x983eb1['blocked']){if(moment(_0x983eb1[_0x22d9('0xe')])['add'](_0x1f4330['blockDuration'],_0x22d9('0x19'))>moment()){throw new Error(_0x22d9('0x3d'));}else{_0x983eb1[_0x22d9('0xd')]=![];_0x983eb1[_0x22d9('0xe')]=null;}}_0x983eb1[_0x22d9('0x3e')]=_0x7127cc;_0x983eb1['resetPasswordExpires']=Date[_0x22d9('0x3f')]()+0x36ee80;return _0x983eb1['save']();})['then'](function(){return sendServiceMail({'to':_0x4edc29[_0x22d9('0x38')][_0x22d9('0x1f')],'subject':_0x22d9('0x40'),'text':_0x22d9('0x41')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x4edc29['headers'][_0x22d9('0x42')]+_0x22d9('0x43')+_0x7127cc+'\x0a\x0a'+_0x22d9('0x44')});})['then'](function(){_0x4c59b9['status'](0xc8)[_0x22d9('0x2e')]({'message':_0x22d9('0x45')});})[_0x22d9('0x1c')](function(_0x4fd253){return handleError(_0x4c59b9,0x1f4,_0x4fd253);});};exports[_0x22d9('0x46')]=function(_0x5e0b5b,_0x5392c7){return db['User'][_0x22d9('0x1e')]({'where':{'resetPasswordToken':_0x5e0b5b[_0x22d9('0x47')][_0x22d9('0x48')],'resetPasswordExpires':{'$gt':Date[_0x22d9('0x3f')]()}}})[_0x22d9('0x13')](function(_0x1b52e6){if(!_0x1b52e6){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x22d9('0x8')][_0x22d9('0x9')]({'attributes':['id',_0x22d9('0x49'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x22d9('0x13')](function(_0x10e754){if(_0x10e754[_0x22d9('0x49')])authService[_0x22d9('0x4a')](_0x5e0b5b[_0x22d9('0x38')][_0x22d9('0xa')]);if(!_0x10e754[_0x22d9('0x4b')]||!_0x1b52e6[_0x22d9('0x4c')])return _0x1b52e6;authService[_0x22d9('0x4d')](_0x5e0b5b['body']['password'],_0x1b52e6[_0x22d9('0x4c')],_0x10e754[_0x22d9('0x4e')]);return _0x1b52e6;})['then'](function(){_0x1b52e6['password']=_0x5e0b5b[_0x22d9('0x38')][_0x22d9('0xa')];_0x1b52e6[_0x22d9('0x3e')]=null;_0x1b52e6[_0x22d9('0x4f')]=null;return _0x1b52e6[_0x22d9('0x50')]();});})[_0x22d9('0x13')](function(){_0x5392c7[_0x22d9('0x51')](0xc8)[_0x22d9('0x2e')]({'message':'Password\x20reset!'});})['catch'](function(_0x52b704){return handleError(_0x5392c7,0x1f4,_0x52b704);});};passport[_0x22d9('0x52')](_0x22d9('0x31'),new LocalStrategy({'usernameField':_0x22d9('0x11'),'passwordField':_0x22d9('0xa')},function(_0x33f301,_0x1a5c5b,_0x315786){return localAuthenticate(db[_0x22d9('0x3b')],_0x33f301,_0x1a5c5b,_0x315786);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 2afbb02..ef5eb52 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 _0x7b84=['reset','exports','express','Router','post','login','forgot'];(function(_0x1e9cd0,_0x2b83dc){var _0x3c7d65=function(_0x4dad25){while(--_0x4dad25){_0x1e9cd0['push'](_0x1e9cd0['shift']());}};_0x3c7d65(++_0x2b83dc);}(_0x7b84,0x1c2));var _0x47b8=function(_0x745ba4,_0x42516d){_0x745ba4=_0x745ba4-0x0;var _0x27d00a=_0x7b84[_0x745ba4];return _0x27d00a;};'use strict';var express=require(_0x47b8('0x0'));var router=express[_0x47b8('0x1')]();var controller=require('./authLocal.controller');router[_0x47b8('0x2')]('/',controller[_0x47b8('0x3')]);router[_0x47b8('0x2')]('/forgot',controller[_0x47b8('0x4')]);router['post']('/reset/:token',controller[_0x47b8('0x5')]);module[_0x47b8('0x6')]=router;
\ No newline at end of file
+var _0x158f=['login','post','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0x1f3386,_0x49e688){var _0x4d2338=function(_0x48574b){while(--_0x48574b){_0x1f3386['push'](_0x1f3386['shift']());}};_0x4d2338(++_0x49e688);}(_0x158f,0x167));var _0xf158=function(_0x14a83c,_0x394b54){_0x14a83c=_0x14a83c-0x0;var _0x345d56=_0x158f[_0x14a83c];return _0x345d56;};'use strict';var express=require(_0xf158('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0xf158('0x1')]);router[_0xf158('0x2')](_0xf158('0x3'),controller[_0xf158('0x4')]);router['post'](_0xf158('0x5'),controller[_0xf158('0x6')]);module[_0xf158('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index d756ee4..ef630ac 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 _0x8876=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0xaaf2e2,_0x19d28a){var _0x28bc36=function(_0x53bdb5){while(--_0x53bdb5){_0xaaf2e2['push'](_0xaaf2e2['shift']());}};_0x28bc36(++_0x19d28a);}(_0x8876,0x152));var _0x6887=function(_0x265abe,_0x2f8efa){_0x265abe=_0x265abe-0x0;var _0x32313a=_0x8876[_0x265abe];return _0x32313a;};'use strict';var Sequelize=require(_0x6887('0x0'));module[_0x6887('0x1')]={'name':{'type':Sequelize[_0x6887('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x6887('0x2')]},'description':{'type':Sequelize[_0x6887('0x2')]},'status':{'type':Sequelize[_0x6887('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6887('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x1217=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x22896c,_0x12bbf0){var _0x1d3f5b=function(_0xc11db9){while(--_0xc11db9){_0x22896c['push'](_0x22896c['shift']());}};_0x1d3f5b(++_0x12bbf0);}(_0x1217,0x1c1));var _0x7121=function(_0x219e21,_0x210f12){_0x219e21=_0x219e21-0x0;var _0x4acae7=_0x1217[_0x219e21];return _0x4acae7;};'use strict';var Sequelize=require(_0x7121('0x0'));module[_0x7121('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x7121('0x2')]},'description':{'type':Sequelize[_0x7121('0x2')]},'status':{'type':Sequelize[_0x7121('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7121('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 d7da450..6c57b08 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 _0x3c1a=['then','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','Condition','omit','ids','getConditions','addActions','Action','findOne','getActions','rimraf','zip-dir','fast-json-patch','request-promise','util','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update'];(function(_0x42e98c,_0x1c6bb9){var _0x59803e=function(_0x3a587e){while(--_0x3a587e){_0x42e98c['push'](_0x42e98c['shift']());}};_0x59803e(++_0x1c6bb9);}(_0x3c1a,0x15f));var _0xa3c1=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x3c1a[_0x5a95fa];return _0x1a61b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa3c1('0x0'));var zipdir=require(_0xa3c1('0x1'));var jsonpatch=require(_0xa3c1('0x2'));var rp=require(_0xa3c1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa3c1('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xa3c1('0x5'));var ejs=require(_0xa3c1('0x6'));var fs=require('fs');var fs_extra=require(_0xa3c1('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa3c1('0x8'));var jsforce=require(_0xa3c1('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xa3c1('0x5'));var querystring=require('querystring');var Papa=require(_0xa3c1('0xa'));var Redis=require('ioredis');var authService=require(_0xa3c1('0xb'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa3c1('0xc'));var logger=require('../../config/logger')(_0xa3c1('0xd'));var utils=require(_0xa3c1('0xe'));var config=require('../../config/environment');var licenseUtil=require(_0xa3c1('0xf'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b5b3e,_0x2c4b5c){_0x2c4b5c=_0x2c4b5c||0xcc;return function(_0x38c3e8){if(_0x38c3e8){return _0x2b5b3e[_0xa3c1('0x10')](_0x2c4b5c);}return _0x2b5b3e['status'](_0x2c4b5c)[_0xa3c1('0x11')]();};}function respondWithResult(_0x5c84b9,_0x3be631){_0x3be631=_0x3be631||0xc8;return function(_0x4f01ba){if(_0x4f01ba){return _0x5c84b9[_0xa3c1('0x12')](_0x3be631)[_0xa3c1('0x13')](_0x4f01ba);}};}function respondWithFilteredResult(_0x3a5338,_0x376891){return function(_0x5d71e2){if(_0x5d71e2){var _0x39a4fc=typeof _0x376891['offset']===_0xa3c1('0x14')&&typeof _0x376891[_0xa3c1('0x15')]===_0xa3c1('0x14');var _0x19f316=_0x5d71e2[_0xa3c1('0x16')];var _0x107cc1=_0x39a4fc?0x0:_0x376891['offset'];var _0x329851=_0x39a4fc?_0x5d71e2[_0xa3c1('0x16')]:_0x376891[_0xa3c1('0x17')]+_0x376891['limit'];var _0x28a4c0;if(_0x329851>=_0x19f316){_0x329851=_0x19f316;_0x28a4c0=0xc8;}else{_0x28a4c0=0xce;}_0x3a5338[_0xa3c1('0x12')](_0x28a4c0);return _0x3a5338['set'](_0xa3c1('0x18'),_0x107cc1+'-'+_0x329851+'/'+_0x19f316)['json'](_0x5d71e2);}return null;};}function patchUpdates(_0x13c81e){return function(_0x4b981b){try{jsonpatch[_0xa3c1('0x19')](_0x4b981b,_0x13c81e,!![]);}catch(_0x368614){return BPromise[_0xa3c1('0x1a')](_0x368614);}return _0x4b981b[_0xa3c1('0x1b')]();};}function saveUpdates(_0x1ab608,_0x5c7b96){return function(_0x311cf8){if(_0x311cf8){return _0x311cf8[_0xa3c1('0x1c')](_0x1ab608)[_0xa3c1('0x1d')](function(_0x33900d){return _0x33900d;});}return null;};}function removeEntity(_0x2ef9cb,_0x4da87c){return function(_0x2be55e){if(_0x2be55e){return _0x2be55e['destroy']()[_0xa3c1('0x1d')](function(){_0x2ef9cb[_0xa3c1('0x12')](0xcc)[_0xa3c1('0x11')]();});}};}function handleEntityNotFound(_0x25a32c,_0x712cb2){return function(_0x34117b){if(!_0x34117b){_0x25a32c[_0xa3c1('0x10')](0x194);}return _0x34117b;};}function handleError(_0x5d4b71,_0x562b3c){_0x562b3c=_0x562b3c||0x1f4;return function(_0x302ab9){logger[_0xa3c1('0x1e')](_0x302ab9[_0xa3c1('0x1f')]);if(_0x302ab9[_0xa3c1('0x20')]){delete _0x302ab9['name'];}_0x5d4b71[_0xa3c1('0x12')](_0x562b3c)[_0xa3c1('0x21')](_0x302ab9);};}exports[_0xa3c1('0x22')]=function(_0x25096d,_0x3c48cc){var _0x39aa41={},_0x523987={},_0x1f0ef6={'count':0x0,'rows':[]};var _0x1ce5cd=_[_0xa3c1('0x23')](db[_0xa3c1('0x24')][_0xa3c1('0x25')],function(_0x3af580){return{'name':_0x3af580[_0xa3c1('0x26')],'type':_0x3af580['type'][_0xa3c1('0x27')]};});_0x523987[_0xa3c1('0x28')]=_[_0xa3c1('0x23')](_0x1ce5cd,_0xa3c1('0x20'));_0x523987[_0xa3c1('0x29')]=_[_0xa3c1('0x2a')](_0x25096d[_0xa3c1('0x29')]);_0x523987[_0xa3c1('0x2b')]=_[_0xa3c1('0x2c')](_0x523987[_0xa3c1('0x28')],_0x523987[_0xa3c1('0x29')]);_0x39aa41[_0xa3c1('0x2d')]=_['intersection'](_0x523987[_0xa3c1('0x28')],qs[_0xa3c1('0x2e')](_0x25096d['query'][_0xa3c1('0x2e')]));_0x39aa41[_0xa3c1('0x2d')]=_0x39aa41[_0xa3c1('0x2d')][_0xa3c1('0x2f')]?_0x39aa41[_0xa3c1('0x2d')]:_0x523987['model'];if(!_0x25096d[_0xa3c1('0x29')][_0xa3c1('0x30')]('nolimit')){_0x39aa41['limit']=qs[_0xa3c1('0x15')](_0x25096d[_0xa3c1('0x29')][_0xa3c1('0x15')]);_0x39aa41[_0xa3c1('0x17')]=qs['offset'](_0x25096d[_0xa3c1('0x29')][_0xa3c1('0x17')]);}_0x39aa41[_0xa3c1('0x31')]=qs[_0xa3c1('0x32')](_0x25096d[_0xa3c1('0x29')]['sort']);_0x39aa41[_0xa3c1('0x33')]=qs[_0xa3c1('0x2b')](_[_0xa3c1('0x34')](_0x25096d['query'],_0x523987[_0xa3c1('0x2b')]),_0x1ce5cd);if(_0x25096d[_0xa3c1('0x29')]['filter']){_0x39aa41[_0xa3c1('0x33')]=_[_0xa3c1('0x35')](_0x39aa41[_0xa3c1('0x33')],{'$or':_[_0xa3c1('0x23')](_0x1ce5cd,function(_0x79d309){if(_0x79d309[_0xa3c1('0x36')]!=='VIRTUAL'){var _0x31ef66={};_0x31ef66[_0x79d309[_0xa3c1('0x20')]]={'$like':'%'+_0x25096d[_0xa3c1('0x29')][_0xa3c1('0x37')]+'%'};return _0x31ef66;}})});}_0x39aa41=_['merge']({},_0x39aa41,_0x25096d[_0xa3c1('0x38')]);var _0x20210a={'where':_0x39aa41[_0xa3c1('0x33')]};return db[_0xa3c1('0x24')][_0xa3c1('0x16')](_0x20210a)['then'](function(_0x5c5493){_0x1f0ef6[_0xa3c1('0x16')]=_0x5c5493;if(_0x25096d['query'][_0xa3c1('0x39')]){_0x39aa41[_0xa3c1('0x3a')]=[{'all':!![]}];}return db[_0xa3c1('0x24')][_0xa3c1('0x3b')](_0x39aa41);})[_0xa3c1('0x1d')](function(_0x10cba7){_0x1f0ef6[_0xa3c1('0x3c')]=_0x10cba7;return _0x1f0ef6;})[_0xa3c1('0x1d')](respondWithFilteredResult(_0x3c48cc,_0x39aa41))[_0xa3c1('0x3d')](handleError(_0x3c48cc,null));};exports[_0xa3c1('0x3e')]=function(_0x1e8ac4,_0x3142a5){var _0x207fd0={'raw':![],'where':{'id':_0x1e8ac4[_0xa3c1('0x3f')]['id']}},_0x44e0f2={};_0x44e0f2[_0xa3c1('0x28')]=_[_0xa3c1('0x2a')](db[_0xa3c1('0x24')]['rawAttributes']);_0x44e0f2[_0xa3c1('0x29')]=_['keys'](_0x1e8ac4[_0xa3c1('0x29')]);_0x44e0f2['filters']=_[_0xa3c1('0x2c')](_0x44e0f2[_0xa3c1('0x28')],_0x44e0f2[_0xa3c1('0x29')]);_0x207fd0[_0xa3c1('0x2d')]=_['intersection'](_0x44e0f2[_0xa3c1('0x28')],qs[_0xa3c1('0x2e')](_0x1e8ac4[_0xa3c1('0x29')][_0xa3c1('0x2e')]));_0x207fd0[_0xa3c1('0x2d')]=_0x207fd0[_0xa3c1('0x2d')][_0xa3c1('0x2f')]?_0x207fd0[_0xa3c1('0x2d')]:_0x44e0f2[_0xa3c1('0x28')];if(_0x1e8ac4[_0xa3c1('0x29')][_0xa3c1('0x39')]){_0x207fd0[_0xa3c1('0x3a')]=[{'all':!![]}];}_0x207fd0=_[_0xa3c1('0x35')]({},_0x207fd0,_0x1e8ac4[_0xa3c1('0x38')]);return db[_0xa3c1('0x24')][_0xa3c1('0x40')](_0x207fd0)[_0xa3c1('0x1d')](handleEntityNotFound(_0x3142a5,null))[_0xa3c1('0x1d')](respondWithResult(_0x3142a5,null))[_0xa3c1('0x3d')](handleError(_0x3142a5,null));};exports[_0xa3c1('0x41')]=function(_0x1a9e68,_0x5e2de7){return db['Automation'][_0xa3c1('0x41')](_0x1a9e68[_0xa3c1('0x42')],{})[_0xa3c1('0x1d')](respondWithResult(_0x5e2de7,0xc9))[_0xa3c1('0x3d')](handleError(_0x5e2de7,null));};exports['update']=function(_0x5706a3,_0x5c9be0){if(_0x5706a3['body']['id']){delete _0x5706a3[_0xa3c1('0x42')]['id'];}return db['Automation'][_0xa3c1('0x40')]({'where':{'id':_0x5706a3[_0xa3c1('0x3f')]['id']}})[_0xa3c1('0x1d')](handleEntityNotFound(_0x5c9be0,null))[_0xa3c1('0x1d')](saveUpdates(_0x5706a3[_0xa3c1('0x42')],null))['then'](respondWithResult(_0x5c9be0,null))['catch'](handleError(_0x5c9be0,null));};exports[_0xa3c1('0x43')]=function(_0x173f6a,_0x5a3c76){return db[_0xa3c1('0x24')]['find']({'where':{'id':_0x173f6a[_0xa3c1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5a3c76,null))[_0xa3c1('0x1d')](removeEntity(_0x5a3c76,null))[_0xa3c1('0x3d')](handleError(_0x5a3c76,null));};exports['addConditions']=function(_0x260b68,_0x1e7865,_0x5e5648){return db[_0xa3c1('0x44')]['find']({'where':{'id':_0x260b68[_0xa3c1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1e7865,null))[_0xa3c1('0x1d')](function(_0x51743e){if(_0x51743e){return _0x51743e['addConditions'](_0x260b68[_0xa3c1('0x42')]['ids'],_[_0xa3c1('0x45')](_0x260b68[_0xa3c1('0x42')],[_0xa3c1('0x46'),'id'])||{});}})['then'](respondWithResult(_0x1e7865,null))[_0xa3c1('0x3d')](handleError(_0x1e7865,null));};exports[_0xa3c1('0x47')]=function(_0x3e96ba,_0x243a51,_0x49db8b){var _0xef740e={};var _0x43390a={};var _0x1a9e18;var _0xf16397;return db[_0xa3c1('0x24')]['findOne']({'where':{'id':_0x3e96ba['params']['id']}})[_0xa3c1('0x1d')](handleEntityNotFound(_0x243a51,null))[_0xa3c1('0x1d')](function(_0x1efeef){if(_0x1efeef){_0x1a9e18=_0x1efeef;_0x43390a[_0xa3c1('0x28')]=_[_0xa3c1('0x2a')](db['Condition'][_0xa3c1('0x25')]);_0x43390a[_0xa3c1('0x29')]=_[_0xa3c1('0x2a')](_0x3e96ba[_0xa3c1('0x29')]);_0x43390a[_0xa3c1('0x2b')]=_[_0xa3c1('0x2c')](_0x43390a[_0xa3c1('0x28')],_0x43390a[_0xa3c1('0x29')]);_0xef740e['attributes']=_[_0xa3c1('0x2c')](_0x43390a[_0xa3c1('0x28')],qs[_0xa3c1('0x2e')](_0x3e96ba[_0xa3c1('0x29')][_0xa3c1('0x2e')]));_0xef740e[_0xa3c1('0x2d')]=_0xef740e[_0xa3c1('0x2d')][_0xa3c1('0x2f')]?_0xef740e[_0xa3c1('0x2d')]:_0x43390a[_0xa3c1('0x28')];_0xef740e[_0xa3c1('0x31')]=qs[_0xa3c1('0x32')](_0x3e96ba[_0xa3c1('0x29')][_0xa3c1('0x32')]);_0xef740e['where']=qs['filters'](_['pick'](_0x3e96ba['query'],_0x43390a[_0xa3c1('0x2b')]));if(_0x3e96ba[_0xa3c1('0x29')][_0xa3c1('0x37')]){_0xef740e[_0xa3c1('0x33')]=_[_0xa3c1('0x35')](_0xef740e[_0xa3c1('0x33')],{'$or':_[_0xa3c1('0x23')](_0xef740e['attributes'],function(_0x35fc7d){var _0x3da7f1={};_0x3da7f1[_0x35fc7d]={'$like':'%'+_0x3e96ba[_0xa3c1('0x29')][_0xa3c1('0x37')]+'%'};return _0x3da7f1;})});}_0xef740e=_[_0xa3c1('0x35')]({},_0xef740e,_0x3e96ba[_0xa3c1('0x38')]);return _0x1a9e18['getConditions'](_0xef740e);}})[_0xa3c1('0x1d')](function(_0x47ed37){if(_0x47ed37){_0xf16397=_0x47ed37[_0xa3c1('0x2f')];if(!_0x3e96ba[_0xa3c1('0x29')][_0xa3c1('0x30')]('nolimit')){_0xef740e[_0xa3c1('0x15')]=qs[_0xa3c1('0x15')](_0x3e96ba[_0xa3c1('0x29')][_0xa3c1('0x15')]);_0xef740e[_0xa3c1('0x17')]=qs[_0xa3c1('0x17')](_0x3e96ba[_0xa3c1('0x29')]['offset']);}return _0x1a9e18[_0xa3c1('0x47')](_0xef740e);}})[_0xa3c1('0x1d')](function(_0x1428c1){if(_0x1428c1){return _0x1428c1?{'count':_0xf16397,'rows':_0x1428c1}:null;}})['then'](respondWithResult(_0x243a51,null))[_0xa3c1('0x3d')](handleError(_0x243a51,null));};exports[_0xa3c1('0x48')]=function(_0x34649d,_0x1d219a,_0x1908de){return db[_0xa3c1('0x49')][_0xa3c1('0x40')]({'where':{'id':_0x34649d[_0xa3c1('0x3f')]['id']}})[_0xa3c1('0x1d')](handleEntityNotFound(_0x1d219a,null))[_0xa3c1('0x1d')](function(_0x52ec47){if(_0x52ec47){return _0x52ec47[_0xa3c1('0x48')](_0x34649d[_0xa3c1('0x42')][_0xa3c1('0x46')],_['omit'](_0x34649d[_0xa3c1('0x42')],[_0xa3c1('0x46'),'id'])||{});}})[_0xa3c1('0x1d')](respondWithResult(_0x1d219a,null))[_0xa3c1('0x3d')](handleError(_0x1d219a,null));};exports['getActions']=function(_0x52d792,_0x13d93e,_0x570536){var _0x203433={};var _0x1f8060={};var _0x45ffb1;var _0x332f50;return db[_0xa3c1('0x24')][_0xa3c1('0x4a')]({'where':{'id':_0x52d792['params']['id']}})[_0xa3c1('0x1d')](handleEntityNotFound(_0x13d93e,null))[_0xa3c1('0x1d')](function(_0x1d1fa4){if(_0x1d1fa4){_0x45ffb1=_0x1d1fa4;_0x1f8060[_0xa3c1('0x28')]=_[_0xa3c1('0x2a')](db[_0xa3c1('0x49')][_0xa3c1('0x25')]);_0x1f8060[_0xa3c1('0x29')]=_[_0xa3c1('0x2a')](_0x52d792[_0xa3c1('0x29')]);_0x1f8060[_0xa3c1('0x2b')]=_[_0xa3c1('0x2c')](_0x1f8060[_0xa3c1('0x28')],_0x1f8060['query']);_0x203433[_0xa3c1('0x2d')]=_[_0xa3c1('0x2c')](_0x1f8060[_0xa3c1('0x28')],qs[_0xa3c1('0x2e')](_0x52d792[_0xa3c1('0x29')]['fields']));_0x203433[_0xa3c1('0x2d')]=_0x203433['attributes'][_0xa3c1('0x2f')]?_0x203433[_0xa3c1('0x2d')]:_0x1f8060[_0xa3c1('0x28')];_0x203433[_0xa3c1('0x31')]=qs['sort'](_0x52d792['query']['sort']);_0x203433['where']=qs['filters'](_['pick'](_0x52d792[_0xa3c1('0x29')],_0x1f8060['filters']));if(_0x52d792[_0xa3c1('0x29')][_0xa3c1('0x37')]){_0x203433[_0xa3c1('0x33')]=_[_0xa3c1('0x35')](_0x203433[_0xa3c1('0x33')],{'$or':_['map'](_0x203433['attributes'],function(_0x51c49e){var _0x1ac440={};_0x1ac440[_0x51c49e]={'$like':'%'+_0x52d792[_0xa3c1('0x29')][_0xa3c1('0x37')]+'%'};return _0x1ac440;})});}_0x203433=_[_0xa3c1('0x35')]({},_0x203433,_0x52d792[_0xa3c1('0x38')]);return _0x45ffb1[_0xa3c1('0x4b')](_0x203433);}})['then'](function(_0x2d59f2){if(_0x2d59f2){_0x332f50=_0x2d59f2[_0xa3c1('0x2f')];if(!_0x52d792[_0xa3c1('0x29')][_0xa3c1('0x30')]('nolimit')){_0x203433[_0xa3c1('0x15')]=qs[_0xa3c1('0x15')](_0x52d792[_0xa3c1('0x29')][_0xa3c1('0x15')]);_0x203433[_0xa3c1('0x17')]=qs[_0xa3c1('0x17')](_0x52d792['query'][_0xa3c1('0x17')]);}return _0x45ffb1[_0xa3c1('0x4b')](_0x203433);}})[_0xa3c1('0x1d')](function(_0x3f37ff){if(_0x3f37ff){return _0x3f37ff?{'count':_0x332f50,'rows':_0x3f37ff}:null;}})[_0xa3c1('0x1d')](respondWithResult(_0x13d93e,null))[_0xa3c1('0x3d')](handleError(_0x13d93e,null));};
\ No newline at end of file
+var _0x2ca9=['then','error','name','send','map','Automation','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','destroy','ids','omit','getConditions','findOne','Condition','nolimit','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2ca9,0x11a));var _0x92ca=function(_0x525bfc,_0x184933){_0x525bfc=_0x525bfc-0x0;var _0x400e1c=_0x2ca9[_0x525bfc];return _0x400e1c;};'use strict';var emlformat=require(_0x92ca('0x0'));var rimraf=require(_0x92ca('0x1'));var zipdir=require(_0x92ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x92ca('0x3'));var moment=require(_0x92ca('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x92ca('0x5'));var util=require(_0x92ca('0x6'));var path=require(_0x92ca('0x7'));var sox=require('sox');var csv=require(_0x92ca('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x92ca('0x9'));var squel=require('squel');var crypto=require(_0x92ca('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x92ca('0x8'));var querystring=require(_0x92ca('0xb'));var Papa=require(_0x92ca('0xc'));var Redis=require(_0x92ca('0xd'));var authService=require(_0x92ca('0xe'));var qs=require(_0x92ca('0xf'));var as=require(_0x92ca('0x10'));var hardwareService=require(_0x92ca('0x11'));var logger=require(_0x92ca('0x12'))(_0x92ca('0x13'));var utils=require(_0x92ca('0x14'));var config=require(_0x92ca('0x15'));var licenseUtil=require(_0x92ca('0x16'));var db=require(_0x92ca('0x17'))['db'];function respondWithStatusCode(_0x5ed757,_0xac7af0){_0xac7af0=_0xac7af0||0xcc;return function(_0x158c01){if(_0x158c01){return _0x5ed757[_0x92ca('0x18')](_0xac7af0);}return _0x5ed757['status'](_0xac7af0)['end']();};}function respondWithResult(_0x4c3deb,_0x3376e6){_0x3376e6=_0x3376e6||0xc8;return function(_0x10ba55){if(_0x10ba55){return _0x4c3deb['status'](_0x3376e6)[_0x92ca('0x19')](_0x10ba55);}};}function respondWithFilteredResult(_0x4596f3,_0x3e73bc){return function(_0x4ce1f7){if(_0x4ce1f7){var _0x5a4e2a=typeof _0x3e73bc[_0x92ca('0x1a')]===_0x92ca('0x1b')&&typeof _0x3e73bc[_0x92ca('0x1c')]==='undefined';var _0x3764fa=_0x4ce1f7[_0x92ca('0x1d')];var _0x27a93b=_0x5a4e2a?0x0:_0x3e73bc[_0x92ca('0x1a')];var _0x28b9cd=_0x5a4e2a?_0x4ce1f7[_0x92ca('0x1d')]:_0x3e73bc[_0x92ca('0x1a')]+_0x3e73bc[_0x92ca('0x1c')];var _0x36fd01;if(_0x28b9cd>=_0x3764fa){_0x28b9cd=_0x3764fa;_0x36fd01=0xc8;}else{_0x36fd01=0xce;}_0x4596f3[_0x92ca('0x1e')](_0x36fd01);return _0x4596f3[_0x92ca('0x1f')](_0x92ca('0x20'),_0x27a93b+'-'+_0x28b9cd+'/'+_0x3764fa)[_0x92ca('0x19')](_0x4ce1f7);}return null;};}function patchUpdates(_0x55e221){return function(_0x2cc2f5){try{jsonpatch['apply'](_0x2cc2f5,_0x55e221,!![]);}catch(_0x44c393){return BPromise[_0x92ca('0x21')](_0x44c393);}return _0x2cc2f5['save']();};}function saveUpdates(_0x56f372,_0x24b7fd){return function(_0x426a75){if(_0x426a75){return _0x426a75['update'](_0x56f372)[_0x92ca('0x22')](function(_0x6f28be){return _0x6f28be;});}return null;};}function removeEntity(_0x53b210,_0x4d39b6){return function(_0x4b650d){if(_0x4b650d){return _0x4b650d['destroy']()[_0x92ca('0x22')](function(){_0x53b210[_0x92ca('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d2b21,_0xdd2f7d){return function(_0x17d88c){if(!_0x17d88c){_0x3d2b21[_0x92ca('0x18')](0x194);}return _0x17d88c;};}function handleError(_0x1a8b24,_0x2748e2){_0x2748e2=_0x2748e2||0x1f4;return function(_0x3f1cd8){logger[_0x92ca('0x23')](_0x3f1cd8['stack']);if(_0x3f1cd8[_0x92ca('0x24')]){delete _0x3f1cd8['name'];}_0x1a8b24[_0x92ca('0x1e')](_0x2748e2)[_0x92ca('0x25')](_0x3f1cd8);};}exports['index']=function(_0x2c7326,_0x4c1453){var _0x33a6d1={},_0x32a614={},_0x14a83a={'count':0x0,'rows':[]};var _0x16fb6d=_[_0x92ca('0x26')](db[_0x92ca('0x27')][_0x92ca('0x28')],function(_0x1053df){return{'name':_0x1053df['fieldName'],'type':_0x1053df[_0x92ca('0x29')][_0x92ca('0x2a')]};});_0x32a614[_0x92ca('0x2b')]=_['map'](_0x16fb6d,_0x92ca('0x24'));_0x32a614[_0x92ca('0x2c')]=_[_0x92ca('0x2d')](_0x2c7326['query']);_0x32a614[_0x92ca('0x2e')]=_[_0x92ca('0x2f')](_0x32a614[_0x92ca('0x2b')],_0x32a614[_0x92ca('0x2c')]);_0x33a6d1['attributes']=_[_0x92ca('0x2f')](_0x32a614[_0x92ca('0x2b')],qs[_0x92ca('0x30')](_0x2c7326[_0x92ca('0x2c')][_0x92ca('0x30')]));_0x33a6d1[_0x92ca('0x31')]=_0x33a6d1[_0x92ca('0x31')][_0x92ca('0x32')]?_0x33a6d1[_0x92ca('0x31')]:_0x32a614[_0x92ca('0x2b')];if(!_0x2c7326[_0x92ca('0x2c')][_0x92ca('0x33')]('nolimit')){_0x33a6d1['limit']=qs[_0x92ca('0x1c')](_0x2c7326[_0x92ca('0x2c')][_0x92ca('0x1c')]);_0x33a6d1[_0x92ca('0x1a')]=qs[_0x92ca('0x1a')](_0x2c7326['query']['offset']);}_0x33a6d1[_0x92ca('0x34')]=qs[_0x92ca('0x35')](_0x2c7326[_0x92ca('0x2c')][_0x92ca('0x35')]);_0x33a6d1['where']=qs[_0x92ca('0x2e')](_[_0x92ca('0x36')](_0x2c7326[_0x92ca('0x2c')],_0x32a614[_0x92ca('0x2e')]),_0x16fb6d);if(_0x2c7326[_0x92ca('0x2c')][_0x92ca('0x37')]){_0x33a6d1[_0x92ca('0x38')]=_[_0x92ca('0x39')](_0x33a6d1[_0x92ca('0x38')],{'$or':_[_0x92ca('0x26')](_0x16fb6d,function(_0x393070){if(_0x393070[_0x92ca('0x29')]!==_0x92ca('0x3a')){var _0x115080={};_0x115080[_0x393070['name']]={'$like':'%'+_0x2c7326[_0x92ca('0x2c')][_0x92ca('0x37')]+'%'};return _0x115080;}})});}_0x33a6d1=_[_0x92ca('0x39')]({},_0x33a6d1,_0x2c7326[_0x92ca('0x3b')]);var _0x429f9f={'where':_0x33a6d1['where']};return db['Automation'][_0x92ca('0x1d')](_0x429f9f)[_0x92ca('0x22')](function(_0x51b50d){_0x14a83a['count']=_0x51b50d;if(_0x2c7326['query'][_0x92ca('0x3c')]){_0x33a6d1[_0x92ca('0x3d')]=[{'all':!![]}];}return db[_0x92ca('0x27')][_0x92ca('0x3e')](_0x33a6d1);})[_0x92ca('0x22')](function(_0x205c15){_0x14a83a[_0x92ca('0x3f')]=_0x205c15;return _0x14a83a;})[_0x92ca('0x22')](respondWithFilteredResult(_0x4c1453,_0x33a6d1))[_0x92ca('0x40')](handleError(_0x4c1453,null));};exports['show']=function(_0x1a4ec8,_0x1ea359){var _0x49d822={'raw':![],'where':{'id':_0x1a4ec8[_0x92ca('0x41')]['id']}},_0x36c22e={};_0x36c22e[_0x92ca('0x2b')]=_[_0x92ca('0x2d')](db[_0x92ca('0x27')][_0x92ca('0x28')]);_0x36c22e['query']=_['keys'](_0x1a4ec8[_0x92ca('0x2c')]);_0x36c22e[_0x92ca('0x2e')]=_['intersection'](_0x36c22e[_0x92ca('0x2b')],_0x36c22e[_0x92ca('0x2c')]);_0x49d822[_0x92ca('0x31')]=_[_0x92ca('0x2f')](_0x36c22e[_0x92ca('0x2b')],qs[_0x92ca('0x30')](_0x1a4ec8['query'][_0x92ca('0x30')]));_0x49d822['attributes']=_0x49d822[_0x92ca('0x31')][_0x92ca('0x32')]?_0x49d822[_0x92ca('0x31')]:_0x36c22e['model'];if(_0x1a4ec8[_0x92ca('0x2c')]['includeAll']){_0x49d822[_0x92ca('0x3d')]=[{'all':!![]}];}_0x49d822=_[_0x92ca('0x39')]({},_0x49d822,_0x1a4ec8[_0x92ca('0x3b')]);return db[_0x92ca('0x27')][_0x92ca('0x42')](_0x49d822)[_0x92ca('0x22')](handleEntityNotFound(_0x1ea359,null))[_0x92ca('0x22')](respondWithResult(_0x1ea359,null))[_0x92ca('0x40')](handleError(_0x1ea359,null));};exports[_0x92ca('0x43')]=function(_0x2df740,_0x45d2cd){return db[_0x92ca('0x27')][_0x92ca('0x43')](_0x2df740[_0x92ca('0x44')],{})['then'](respondWithResult(_0x45d2cd,0xc9))[_0x92ca('0x40')](handleError(_0x45d2cd,null));};exports[_0x92ca('0x45')]=function(_0x150291,_0x511d72){if(_0x150291[_0x92ca('0x44')]['id']){delete _0x150291[_0x92ca('0x44')]['id'];}return db[_0x92ca('0x27')][_0x92ca('0x42')]({'where':{'id':_0x150291[_0x92ca('0x41')]['id']}})[_0x92ca('0x22')](handleEntityNotFound(_0x511d72,null))[_0x92ca('0x22')](saveUpdates(_0x150291['body'],null))[_0x92ca('0x22')](respondWithResult(_0x511d72,null))[_0x92ca('0x40')](handleError(_0x511d72,null));};exports[_0x92ca('0x46')]=function(_0x78c5d3,_0x398aa8){return db[_0x92ca('0x27')]['find']({'where':{'id':_0x78c5d3[_0x92ca('0x41')]['id']}})[_0x92ca('0x22')](handleEntityNotFound(_0x398aa8,null))[_0x92ca('0x22')](removeEntity(_0x398aa8,null))[_0x92ca('0x40')](handleError(_0x398aa8,null));};exports['addConditions']=function(_0x39ad14,_0x10f9c7,_0x42e9e4){return db['Condition'][_0x92ca('0x42')]({'where':{'id':_0x39ad14[_0x92ca('0x41')]['id']}})[_0x92ca('0x22')](handleEntityNotFound(_0x10f9c7,null))[_0x92ca('0x22')](function(_0x41cd36){if(_0x41cd36){return _0x41cd36['addConditions'](_0x39ad14['body'][_0x92ca('0x47')],_[_0x92ca('0x48')](_0x39ad14[_0x92ca('0x44')],[_0x92ca('0x47'),'id'])||{});}})['then'](respondWithResult(_0x10f9c7,null))[_0x92ca('0x40')](handleError(_0x10f9c7,null));};exports[_0x92ca('0x49')]=function(_0x537b51,_0x35d753,_0x28d7a4){var _0x3676f6={};var _0x2f7741={};var _0x1e49a8;var _0x18d672;return db[_0x92ca('0x27')][_0x92ca('0x4a')]({'where':{'id':_0x537b51[_0x92ca('0x41')]['id']}})['then'](handleEntityNotFound(_0x35d753,null))[_0x92ca('0x22')](function(_0x1c6d1c){if(_0x1c6d1c){_0x1e49a8=_0x1c6d1c;_0x2f7741[_0x92ca('0x2b')]=_[_0x92ca('0x2d')](db[_0x92ca('0x4b')][_0x92ca('0x28')]);_0x2f7741['query']=_['keys'](_0x537b51[_0x92ca('0x2c')]);_0x2f7741['filters']=_[_0x92ca('0x2f')](_0x2f7741[_0x92ca('0x2b')],_0x2f7741[_0x92ca('0x2c')]);_0x3676f6['attributes']=_['intersection'](_0x2f7741[_0x92ca('0x2b')],qs[_0x92ca('0x30')](_0x537b51[_0x92ca('0x2c')]['fields']));_0x3676f6[_0x92ca('0x31')]=_0x3676f6[_0x92ca('0x31')][_0x92ca('0x32')]?_0x3676f6[_0x92ca('0x31')]:_0x2f7741[_0x92ca('0x2b')];_0x3676f6['order']=qs[_0x92ca('0x35')](_0x537b51[_0x92ca('0x2c')]['sort']);_0x3676f6[_0x92ca('0x38')]=qs[_0x92ca('0x2e')](_[_0x92ca('0x36')](_0x537b51[_0x92ca('0x2c')],_0x2f7741['filters']));if(_0x537b51['query'][_0x92ca('0x37')]){_0x3676f6[_0x92ca('0x38')]=_[_0x92ca('0x39')](_0x3676f6[_0x92ca('0x38')],{'$or':_[_0x92ca('0x26')](_0x3676f6[_0x92ca('0x31')],function(_0x536906){var _0x126fd8={};_0x126fd8[_0x536906]={'$like':'%'+_0x537b51[_0x92ca('0x2c')][_0x92ca('0x37')]+'%'};return _0x126fd8;})});}_0x3676f6=_[_0x92ca('0x39')]({},_0x3676f6,_0x537b51[_0x92ca('0x3b')]);return _0x1e49a8['getConditions'](_0x3676f6);}})[_0x92ca('0x22')](function(_0x45d2bd){if(_0x45d2bd){_0x18d672=_0x45d2bd[_0x92ca('0x32')];if(!_0x537b51[_0x92ca('0x2c')][_0x92ca('0x33')](_0x92ca('0x4c'))){_0x3676f6['limit']=qs[_0x92ca('0x1c')](_0x537b51[_0x92ca('0x2c')][_0x92ca('0x1c')]);_0x3676f6[_0x92ca('0x1a')]=qs[_0x92ca('0x1a')](_0x537b51[_0x92ca('0x2c')][_0x92ca('0x1a')]);}return _0x1e49a8[_0x92ca('0x49')](_0x3676f6);}})[_0x92ca('0x22')](function(_0x517992){if(_0x517992){return _0x517992?{'count':_0x18d672,'rows':_0x517992}:null;}})[_0x92ca('0x22')](respondWithResult(_0x35d753,null))[_0x92ca('0x40')](handleError(_0x35d753,null));};exports['addActions']=function(_0x1be7b1,_0x236bac,_0x2c0a80){return db[_0x92ca('0x4d')][_0x92ca('0x42')]({'where':{'id':_0x1be7b1[_0x92ca('0x41')]['id']}})['then'](handleEntityNotFound(_0x236bac,null))['then'](function(_0x5f55de){if(_0x5f55de){return _0x5f55de['addActions'](_0x1be7b1[_0x92ca('0x44')][_0x92ca('0x47')],_[_0x92ca('0x48')](_0x1be7b1[_0x92ca('0x44')],[_0x92ca('0x47'),'id'])||{});}})[_0x92ca('0x22')](respondWithResult(_0x236bac,null))[_0x92ca('0x40')](handleError(_0x236bac,null));};exports[_0x92ca('0x4e')]=function(_0x35761b,_0x47d57a,_0x1855a9){var _0x344609={};var _0x4e76ef={};var _0x10b1e3;var _0x1989f0;return db['Automation'][_0x92ca('0x4a')]({'where':{'id':_0x35761b[_0x92ca('0x41')]['id']}})[_0x92ca('0x22')](handleEntityNotFound(_0x47d57a,null))['then'](function(_0xbca2a){if(_0xbca2a){_0x10b1e3=_0xbca2a;_0x4e76ef[_0x92ca('0x2b')]=_[_0x92ca('0x2d')](db[_0x92ca('0x4d')]['rawAttributes']);_0x4e76ef[_0x92ca('0x2c')]=_[_0x92ca('0x2d')](_0x35761b[_0x92ca('0x2c')]);_0x4e76ef[_0x92ca('0x2e')]=_[_0x92ca('0x2f')](_0x4e76ef['model'],_0x4e76ef[_0x92ca('0x2c')]);_0x344609[_0x92ca('0x31')]=_['intersection'](_0x4e76ef[_0x92ca('0x2b')],qs[_0x92ca('0x30')](_0x35761b[_0x92ca('0x2c')]['fields']));_0x344609[_0x92ca('0x31')]=_0x344609[_0x92ca('0x31')]['length']?_0x344609[_0x92ca('0x31')]:_0x4e76ef['model'];_0x344609[_0x92ca('0x34')]=qs[_0x92ca('0x35')](_0x35761b['query'][_0x92ca('0x35')]);_0x344609[_0x92ca('0x38')]=qs['filters'](_[_0x92ca('0x36')](_0x35761b[_0x92ca('0x2c')],_0x4e76ef[_0x92ca('0x2e')]));if(_0x35761b[_0x92ca('0x2c')][_0x92ca('0x37')]){_0x344609[_0x92ca('0x38')]=_['merge'](_0x344609['where'],{'$or':_[_0x92ca('0x26')](_0x344609[_0x92ca('0x31')],function(_0x548afa){var _0x2d6848={};_0x2d6848[_0x548afa]={'$like':'%'+_0x35761b[_0x92ca('0x2c')][_0x92ca('0x37')]+'%'};return _0x2d6848;})});}_0x344609=_[_0x92ca('0x39')]({},_0x344609,_0x35761b['options']);return _0x10b1e3[_0x92ca('0x4e')](_0x344609);}})['then'](function(_0x1ac073){if(_0x1ac073){_0x1989f0=_0x1ac073['length'];if(!_0x35761b[_0x92ca('0x2c')]['hasOwnProperty'](_0x92ca('0x4c'))){_0x344609[_0x92ca('0x1c')]=qs[_0x92ca('0x1c')](_0x35761b[_0x92ca('0x2c')][_0x92ca('0x1c')]);_0x344609[_0x92ca('0x1a')]=qs[_0x92ca('0x1a')](_0x35761b[_0x92ca('0x2c')][_0x92ca('0x1a')]);}return _0x10b1e3[_0x92ca('0x4e')](_0x344609);}})[_0x92ca('0x22')](function(_0x164365){if(_0x164365){return _0x164365?{'count':_0x1989f0,'rows':_0x164365}:null;}})['then'](respondWithResult(_0x47d57a,null))[_0x92ca('0x40')](handleError(_0x47d57a,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 1f3bf9d..0d971fe 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 _0x923e=['request-promise','path','../../config/environment','exports','Automation','tools_automations','lodash','util','../../config/logger','api','bluebird'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0x923e,0x1df));var _0xe923=function(_0x10f68e,_0xf198ea){_0x10f68e=_0x10f68e-0x0;var _0x4c8372=_0x923e[_0x10f68e];return _0x4c8372;};'use strict';var _=require(_0xe923('0x0'));var util=require(_0xe923('0x1'));var logger=require(_0xe923('0x2'))(_0xe923('0x3'));var moment=require('moment');var BPromise=require(_0xe923('0x4'));var rp=require(_0xe923('0x5'));var fs=require('fs');var path=require(_0xe923('0x6'));var rimraf=require('rimraf');var config=require(_0xe923('0x7'));var attributes=require('./automation.attributes');module[_0xe923('0x8')]=function(_0x5b99eb,_0x594cbe){return _0x5b99eb['define'](_0xe923('0x9'),attributes,{'tableName':_0xe923('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b0a=['./automation.attributes','define','Automation','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x4423fd,_0x1f72c3){var _0x90f9b0=function(_0x1b6533){while(--_0x1b6533){_0x4423fd['push'](_0x4423fd['shift']());}};_0x90f9b0(++_0x1f72c3);}(_0x6b0a,0x108));var _0xa6b0=function(_0x557935,_0x1f346a){_0x557935=_0x557935-0x0;var _0x59d065=_0x6b0a[_0x557935];return _0x59d065;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa6b0('0x0'))(_0xa6b0('0x1'));var moment=require(_0xa6b0('0x2'));var BPromise=require(_0xa6b0('0x3'));var rp=require(_0xa6b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa6b0('0x5'));var attributes=require(_0xa6b0('0x6'));module['exports']=function(_0x3b1ba4,_0x2db04f){return _0x3b1ba4[_0xa6b0('0x7')](_0xa6b0('0x8'),attributes,{'tableName':'tools_automations','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 322fbbc..ddc7569 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 _0x7275=['util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','then','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash'];(function(_0xca410c,_0x4453ea){var _0x29ddce=function(_0x443149){while(--_0x443149){_0xca410c['push'](_0xca410c['shift']());}};_0x29ddce(++_0x4453ea);}(_0x7275,0x143));var _0x5727=function(_0x1eb9d5,_0xb5d9e6){_0x1eb9d5=_0x1eb9d5-0x0;var _0x434ca5=_0x7275[_0x1eb9d5];return _0x434ca5;};'use strict';var _=require(_0x5727('0x0'));var util=require(_0x5727('0x1'));var moment=require(_0x5727('0x2'));var BPromise=require('bluebird');var rs=require(_0x5727('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5727('0x4'))['db'];var utils=require(_0x5727('0x5'));var logger=require('../../config/logger')(_0x5727('0x6'));var config=require(_0x5727('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x336262,_0x49184a,_0x33a6fe){return new BPromise(function(_0x4de37c,_0x129402){return client['request'](_0x336262,_0x33a6fe)[_0x5727('0x8')](function(_0x18e712){logger['info'](_0x5727('0x9'),_0x49184a,_0x5727('0xa'));logger['debug'](_0x5727('0xb'),_0x49184a,_0x5727('0xa'),JSON['stringify'](_0x18e712));if(_0x18e712[_0x5727('0xc')]){if(_0x18e712[_0x5727('0xc')][_0x5727('0xd')]===0x1f4){logger[_0x5727('0xc')](_0x5727('0x9'),_0x49184a,_0x18e712[_0x5727('0xc')]['message']);return _0x129402(_0x18e712[_0x5727('0xc')][_0x5727('0xe')]);}logger[_0x5727('0xc')](_0x5727('0x9'),_0x49184a,_0x18e712[_0x5727('0xc')][_0x5727('0xe')]);return _0x4de37c(_0x18e712[_0x5727('0xc')]['message']);}else{logger[_0x5727('0xf')](_0x5727('0x9'),_0x49184a,_0x5727('0xa'));_0x4de37c(_0x18e712[_0x5727('0x10')][_0x5727('0xe')]);}})[_0x5727('0x11')](function(_0x273dc9){logger['error'](_0x5727('0x9'),_0x49184a,_0x273dc9);_0x129402(_0x273dc9);});});}
\ No newline at end of file
+var _0x9ccd=['catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x4aa2c9,_0x3c74e5){var _0x212e33=function(_0x20f06a){while(--_0x20f06a){_0x4aa2c9['push'](_0x4aa2c9['shift']());}};_0x212e33(++_0x3c74e5);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ccd[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xd9cc('0x0'));var util=require('util');var moment=require(_0xd9cc('0x1'));var BPromise=require(_0xd9cc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9cc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd9cc('0x4'))(_0xd9cc('0x5'));var config=require(_0xd9cc('0x6'));var jayson=require(_0xd9cc('0x7'));var client=jayson[_0xd9cc('0x8')][_0xd9cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f7b2b,_0x23b70a,_0x9e1e10){return new BPromise(function(_0x1a1bd1,_0x20282c){return client[_0xd9cc('0xa')](_0x1f7b2b,_0x9e1e10)[_0xd9cc('0xb')](function(_0x1737e5){logger[_0xd9cc('0xc')](_0xd9cc('0xd'),_0x23b70a,'request\x20sent');logger[_0xd9cc('0xe')](_0xd9cc('0xf'),_0x23b70a,_0xd9cc('0x10'),JSON[_0xd9cc('0x11')](_0x1737e5));if(_0x1737e5[_0xd9cc('0x12')]){if(_0x1737e5[_0xd9cc('0x12')][_0xd9cc('0x13')]===0x1f4){logger[_0xd9cc('0x12')]('Automation,\x20%s,\x20%s',_0x23b70a,_0x1737e5[_0xd9cc('0x12')]['message']);return _0x20282c(_0x1737e5['error']['message']);}logger['error']('Automation,\x20%s,\x20%s',_0x23b70a,_0x1737e5[_0xd9cc('0x12')][_0xd9cc('0x14')]);return _0x1a1bd1(_0x1737e5[_0xd9cc('0x12')][_0xd9cc('0x14')]);}else{logger[_0xd9cc('0xc')](_0xd9cc('0xd'),_0x23b70a,_0xd9cc('0x10'));_0x1a1bd1(_0x1737e5['result'][_0xd9cc('0x14')]);}})[_0xd9cc('0x15')](function(_0x513635){logger[_0xd9cc('0x12')](_0xd9cc('0xd'),_0x23b70a,_0x513635);_0x20282c(_0x513635);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 1c28010..f8e54e4 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 _0xf82e=['getActions','create','post','/:id/conditions','addConditions','addActions','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','/:id/actions'];(function(_0x2d6392,_0x1516f){var _0x3bff7e=function(_0x328a80){while(--_0x328a80){_0x2d6392['push'](_0x2d6392['shift']());}};_0x3bff7e(++_0x1516f);}(_0xf82e,0x172));var _0xef82=function(_0x54c7d9,_0x110ba1){_0x54c7d9=_0x54c7d9-0x0;var _0x2faa9b=_0xf82e[_0x54c7d9];return _0x2faa9b;};'use strict';var multer=require(_0xef82('0x0'));var util=require(_0xef82('0x1'));var path=require(_0xef82('0x2'));var timeout=require(_0xef82('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xef82('0x4'));var auth=require(_0xef82('0x5'));var interaction=require(_0xef82('0x6'));var config=require(_0xef82('0x7'));var controller=require(_0xef82('0x8'));router[_0xef82('0x9')]('/',auth[_0xef82('0xa')](),controller['index']);router['get'](_0xef82('0xb'),auth[_0xef82('0xa')](),controller[_0xef82('0xc')]);router[_0xef82('0x9')]('/:id/conditions',auth['isAuthenticated'](),controller['getConditions']);router[_0xef82('0x9')](_0xef82('0xd'),auth[_0xef82('0xa')](),controller[_0xef82('0xe')]);router['post']('/',auth[_0xef82('0xa')](),controller[_0xef82('0xf')]);router[_0xef82('0x10')](_0xef82('0x11'),auth['isAuthenticated'](),controller[_0xef82('0x12')]);router[_0xef82('0x10')](_0xef82('0xd'),auth['isAuthenticated'](),controller[_0xef82('0x13')]);router[_0xef82('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xef82('0x15')]);router[_0xef82('0x16')](_0xef82('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xef82('0x17')]=router;
\ No newline at end of file
+var _0x4e00=['index','/:id','show','/:id/conditions','/:id/actions','post','create','addConditions','put','update','delete','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated'];(function(_0x517624,_0x1777bb){var _0x1c8ece=function(_0x5db23d){while(--_0x5db23d){_0x517624['push'](_0x517624['shift']());}};_0x1c8ece(++_0x1777bb);}(_0x4e00,0xa0));var _0x04e0=function(_0x2b20a3,_0x53b751){_0x2b20a3=_0x2b20a3-0x0;var _0x39657b=_0x4e00[_0x2b20a3];return _0x39657b;};'use strict';var multer=require('multer');var util=require(_0x04e0('0x0'));var path=require('path');var timeout=require(_0x04e0('0x1'));var express=require(_0x04e0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x04e0('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x04e0('0x4'));var controller=require(_0x04e0('0x5'));router[_0x04e0('0x6')]('/',auth[_0x04e0('0x7')](),controller[_0x04e0('0x8')]);router[_0x04e0('0x6')](_0x04e0('0x9'),auth['isAuthenticated'](),controller[_0x04e0('0xa')]);router[_0x04e0('0x6')](_0x04e0('0xb'),auth[_0x04e0('0x7')](),controller['getConditions']);router[_0x04e0('0x6')](_0x04e0('0xc'),auth['isAuthenticated'](),controller['getActions']);router[_0x04e0('0xd')]('/',auth['isAuthenticated'](),controller[_0x04e0('0xe')]);router[_0x04e0('0xd')](_0x04e0('0xb'),auth[_0x04e0('0x7')](),controller[_0x04e0('0xf')]);router[_0x04e0('0xd')](_0x04e0('0xc'),auth[_0x04e0('0x7')](),controller['addActions']);router[_0x04e0('0x10')]('/:id',auth[_0x04e0('0x7')](),controller[_0x04e0('0x11')]);router[_0x04e0('0x12')]('/:id',auth[_0x04e0('0x7')](),controller[_0x04e0('0x13')]);module[_0x04e0('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 125c62f..d77df23 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 _0xcad1=['#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#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)','exports','STRING','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0xcad1,0x16c));var _0x1cad=function(_0x75fd4c,_0xd1c91b){_0x75fd4c=_0x75fd4c-0x0;var _0x46afe9=_0xcad1[_0x75fd4c];return _0x46afe9;};'use strict';var Sequelize=require('sequelize');module[_0x1cad('0x0')]={'name':{'type':Sequelize[_0x1cad('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x1cad('0x2')),'allowNull':![],'defaultValue':_0x1cad('0x2')},'description':{'type':Sequelize[_0x1cad('0x1')]},'active':{'type':Sequelize[_0x1cad('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x1cad('0x4')](0x4)[_0x1cad('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1cad('0x6')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1cad('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x1cad('0x4')](0x3)[_0x1cad('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cad('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1cad('0x4')](0x5)[_0x1cad('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cad('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0x1cad('0x4')](0x3)[_0x1cad('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cad('0x9')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1cad('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cad('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1cad('0x4')](0x3)[_0x1cad('0x5')],'defaultValue':0x3,'comment':_0x1cad('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1cad('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cad('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1cad('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1cad('0xd')},'dialTimezone':{'type':Sequelize[_0x1cad('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x1cad('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x1cad('0xf')](_0x1cad('0x10'),_0x1cad('0x11'),_0x1cad('0x12')),'defaultValue':_0x1cad('0x10')},'dialAMDActive':{'type':Sequelize[_0x1cad('0x3')],'defaultValue':0x0,'comment':_0x1cad('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x1cad('0x4')](0x9)[_0x1cad('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1cad('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x1cad('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1cad('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1cad('0x4')](0x9)[_0x1cad('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1cad('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1cad('0x4')](0x9)[_0x1cad('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1cad('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x1cad('0x4')](0x9)[_0x1cad('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1cad('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1cad('0x4')](0x9)[_0x1cad('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1cad('0x4')](0x9)[_0x1cad('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1cad('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1cad('0x4')](0x5)[_0x1cad('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1cad('0x4')](0x9)[_0x1cad('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1cad('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1cad('0xf')]('DESC',_0x1cad('0x1b')),'defaultValue':_0x1cad('0x1c')},'dialPrefix':{'type':Sequelize[_0x1cad('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1cad('0x4')](0x3)[_0x1cad('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1cad('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1cad('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1cad('0x4')](0x3)[_0x1cad('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cad('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1cad('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x1cad('0x4')](0x3)[_0x1cad('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cad('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x1cad('0x4')](0x5)[_0x1cad('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cad('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1cad('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cad('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cad('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x1cad('0x4')](0x3)[_0x1cad('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cad('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1cad('0x4')](0x5)[_0x1cad('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cad('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1cad('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cad('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1cad('0x4')](0x5)[_0x1cad('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x4813=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x4813,0xdc));var _0x3481=function(_0x2e0f65,_0x27af29){_0x2e0f65=_0x2e0f65-0x0;var _0x7fd3d8=_0x4813[_0x2e0f65];return _0x7fd3d8;};'use strict';var Sequelize=require(_0x3481('0x0'));module['exports']={'name':{'type':Sequelize[_0x3481('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x3481('0x2')),'allowNull':![],'defaultValue':_0x3481('0x2')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x3481('0x3')],'defaultValue':0x0,'comment':_0x3481('0x4')},'limitCalls':{'type':Sequelize[_0x3481('0x5')](0x4)[_0x3481('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x3481('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3481('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3481('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3481('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3481('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3481('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3481('0x5')](0x5)[_0x3481('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3481('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x3481('0x5')](0x3)[_0x3481('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3481('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3481('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3481('0x5')](0x3)[_0x3481('0x6')],'defaultValue':0x3,'comment':_0x3481('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3481('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3481('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3481('0x5')](0x3)[_0x3481('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3481('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x3481('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x3481('0x10')]('always',_0x3481('0x11'),_0x3481('0x12')),'defaultValue':_0x3481('0x13')},'dialAMDActive':{'type':Sequelize[_0x3481('0x3')],'defaultValue':0x0,'comment':_0x3481('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x3481('0x5')](0x9)[_0x3481('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x3481('0x5')](0x9)[_0x3481('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3481('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3481('0x5')](0x9)[_0x3481('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3481('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3481('0x5')](0x9)[_0x3481('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x3481('0x5')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3481('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3481('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3481('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3481('0x5')](0x9)[_0x3481('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3481('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x3481('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3481('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3481('0x5')](0x9)[_0x3481('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3481('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x3481('0x1c'),_0x3481('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x3481('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3481('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3481('0x1e')},'dialCutDigit':{'type':Sequelize[_0x3481('0x5')](0x3)[_0x3481('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3481('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3481('0x5')](0x3)[_0x3481('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3481('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3481('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3481('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x3481('0x5')](0x3)[_0x3481('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3481('0x22')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3481('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3481('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3481('0x5')](0x3)[_0x3481('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3481('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3481('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3481('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0x3481('0x5')](0x3)[_0x3481('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3481('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3481('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3481('0x5')](0x3)[_0x3481('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3481('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3481('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3481('0x28')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 9bb9b1d..607599e 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 _0x8425=['ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','error','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','createdAt','role','params','findOne','CmHopper','CampaignId','pick','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','omit','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','into','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','CmListId','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id'];(function(_0x138d06,_0x33edf2){var _0x1a01eb=function(_0x387acb){while(--_0x387acb){_0x138d06['push'](_0x138d06['shift']());}};_0x1a01eb(++_0x33edf2);}(_0x8425,0x13b));var _0x5842=function(_0x235d58,_0x38f76b){_0x235d58=_0x235d58-0x0;var _0x3caffe=_0x8425[_0x235d58];return _0x3caffe;};'use strict';var emlformat=require(_0x5842('0x0'));var rimraf=require(_0x5842('0x1'));var zipdir=require(_0x5842('0x2'));var jsonpatch=require(_0x5842('0x3'));var rp=require('request-promise');var moment=require(_0x5842('0x4'));var BPromise=require(_0x5842('0x5'));var Mustache=require(_0x5842('0x6'));var util=require(_0x5842('0x7'));var path=require(_0x5842('0x8'));var sox=require(_0x5842('0x9'));var csv=require(_0x5842('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5842('0xb'));var _=require(_0x5842('0xc'));var squel=require(_0x5842('0xd'));var crypto=require(_0x5842('0xe'));var jsforce=require(_0x5842('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5842('0x10'));var Papa=require('papaparse');var Redis=require(_0x5842('0x11'));var authService=require(_0x5842('0x12'));var qs=require(_0x5842('0x13'));var as=require(_0x5842('0x14'));var hardwareService=require(_0x5842('0x15'));var logger=require(_0x5842('0x16'))(_0x5842('0x17'));var utils=require(_0x5842('0x18'));var config=require(_0x5842('0x19'));var licenseUtil=require(_0x5842('0x1a'));var db=require(_0x5842('0x1b'))['db'];function respondWithStatusCode(_0x27c9dd,_0x4bdc3e){_0x4bdc3e=_0x4bdc3e||0xcc;return function(_0x161205){if(_0x161205){return _0x27c9dd[_0x5842('0x1c')](_0x4bdc3e);}return _0x27c9dd[_0x5842('0x1d')](_0x4bdc3e)[_0x5842('0x1e')]();};}function respondWithResult(_0x7ffc1d,_0xae5ed3){_0xae5ed3=_0xae5ed3||0xc8;return function(_0x34df4e){if(_0x34df4e){return _0x7ffc1d[_0x5842('0x1d')](_0xae5ed3)[_0x5842('0x1f')](_0x34df4e);}};}function respondWithFilteredResult(_0x290d85,_0x1dd6a3){return function(_0x2194b7){if(_0x2194b7){var _0x2e62bc=typeof _0x1dd6a3[_0x5842('0x20')]===_0x5842('0x21')&&typeof _0x1dd6a3['limit']===_0x5842('0x21');var _0x30553a=_0x2194b7[_0x5842('0x22')];var _0x5c95e8=_0x2e62bc?0x0:_0x1dd6a3[_0x5842('0x20')];var _0x2de73e=_0x2e62bc?_0x2194b7[_0x5842('0x22')]:_0x1dd6a3[_0x5842('0x20')]+_0x1dd6a3['limit'];var _0x5a96f6;if(_0x2de73e>=_0x30553a){_0x2de73e=_0x30553a;_0x5a96f6=0xc8;}else{_0x5a96f6=0xce;}_0x290d85['status'](_0x5a96f6);return _0x290d85[_0x5842('0x23')]('Content-Range',_0x5c95e8+'-'+_0x2de73e+'/'+_0x30553a)[_0x5842('0x1f')](_0x2194b7);}return null;};}function patchUpdates(_0x3a3fc9){return function(_0x347220){try{jsonpatch['apply'](_0x347220,_0x3a3fc9,!![]);}catch(_0x5d7ec3){return BPromise['reject'](_0x5d7ec3);}return _0x347220[_0x5842('0x24')]();};}function saveUpdates(_0x2c4f58,_0x465265){return function(_0x242275){if(_0x242275){return _0x242275[_0x5842('0x25')](_0x2c4f58)['then'](function(_0x27bba8){return _0x27bba8;});}return null;};}function removeEntity(_0x26db23,_0xfd6c08){return function(_0x54563b){if(_0x54563b){return _0x54563b[_0x5842('0x26')]()[_0x5842('0x27')](function(){var _0x31a61b=_0x54563b[_0x5842('0x28')]({'plain':!![]});var _0x446c33=_0x5842('0x29');return db[_0x5842('0x2a')]['destroy']({'where':{'type':_0x446c33,'resourceId':_0x31a61b['id']}})['then'](function(){return _0x54563b;});})['then'](function(){_0x26db23[_0x5842('0x1d')](0xcc)[_0x5842('0x1e')]();});}};}function handleEntityNotFound(_0x2be6b8,_0x17079a){return function(_0x2ab1ac){if(!_0x2ab1ac){_0x2be6b8['sendStatus'](0x194);}return _0x2ab1ac;};}function handleError(_0x489b13,_0x1b375b){_0x1b375b=_0x1b375b||0x1f4;return function(_0x37295d){logger[_0x5842('0x2b')](_0x37295d['stack']);if(_0x37295d[_0x5842('0x2c')]){delete _0x37295d[_0x5842('0x2c')];}_0x489b13[_0x5842('0x1d')](_0x1b375b)[_0x5842('0x2d')](_0x37295d);};}exports[_0x5842('0x2e')]=function(_0x1fafd7,_0xf3dcf5){var _0x2f6d6b={},_0x5522c3={},_0x449efc={'count':0x0,'rows':[]};var _0x54646a=_[_0x5842('0x2f')](db[_0x5842('0x30')][_0x5842('0x31')],function(_0x28a1fd){return{'name':_0x28a1fd[_0x5842('0x32')],'type':_0x28a1fd[_0x5842('0x33')][_0x5842('0x34')]};});_0x5522c3[_0x5842('0x35')]=_['map'](_0x54646a,'name');_0x5522c3[_0x5842('0x36')]=_[_0x5842('0x37')](_0x1fafd7[_0x5842('0x36')]);_0x5522c3[_0x5842('0x38')]=_[_0x5842('0x39')](_0x5522c3[_0x5842('0x35')],_0x5522c3[_0x5842('0x36')]);_0x2f6d6b['attributes']=_[_0x5842('0x39')](_0x5522c3[_0x5842('0x35')],qs[_0x5842('0x3a')](_0x1fafd7['query'][_0x5842('0x3a')]));_0x2f6d6b[_0x5842('0x3b')]=_0x2f6d6b[_0x5842('0x3b')]['length']?_0x2f6d6b[_0x5842('0x3b')]:_0x5522c3[_0x5842('0x35')];if(!_0x1fafd7[_0x5842('0x36')][_0x5842('0x3c')](_0x5842('0x3d'))){_0x2f6d6b[_0x5842('0x3e')]=qs[_0x5842('0x3e')](_0x1fafd7['query']['limit']);_0x2f6d6b['offset']=qs[_0x5842('0x20')](_0x1fafd7[_0x5842('0x36')][_0x5842('0x20')]);}_0x2f6d6b[_0x5842('0x3f')]=qs[_0x5842('0x40')](_0x1fafd7[_0x5842('0x36')][_0x5842('0x40')]);_0x2f6d6b[_0x5842('0x41')]=qs[_0x5842('0x38')](_['pick'](_0x1fafd7[_0x5842('0x36')],_0x5522c3[_0x5842('0x38')]),_0x54646a);if(_0x1fafd7['query'][_0x5842('0x42')]){_0x2f6d6b[_0x5842('0x41')]=_[_0x5842('0x43')](_0x2f6d6b['where'],{'$or':_['map'](_0x54646a,function(_0x2f306f){if(_0x2f306f['type']!==_0x5842('0x44')){var _0x341480={};_0x341480[_0x2f306f[_0x5842('0x2c')]]={'$like':'%'+_0x1fafd7['query'][_0x5842('0x42')]+'%'};return _0x341480;}})});}_0x2f6d6b=_['merge']({},_0x2f6d6b,_0x1fafd7['options']);var _0xb7e241={'where':_0x2f6d6b['where']};return db[_0x5842('0x30')]['count'](_0xb7e241)[_0x5842('0x27')](function(_0x3e30fb){_0x449efc[_0x5842('0x22')]=_0x3e30fb;if(_0x1fafd7['query'][_0x5842('0x45')]){_0x2f6d6b[_0x5842('0x46')]=[{'all':!![]}];}return db[_0x5842('0x30')][_0x5842('0x47')](_0x2f6d6b);})['then'](function(_0x2187ee){_0x449efc[_0x5842('0x48')]=_0x2187ee;return _0x449efc;})[_0x5842('0x27')](respondWithFilteredResult(_0xf3dcf5,_0x2f6d6b))[_0x5842('0x49')](handleError(_0xf3dcf5,null));};exports[_0x5842('0x4a')]=function(_0x280320,_0x356c12){var _0x351fd3={'raw':![],'where':{'id':_0x280320['params']['id']}},_0x3c5f1b={};_0x3c5f1b['model']=_[_0x5842('0x37')](db[_0x5842('0x30')]['rawAttributes']);_0x3c5f1b['query']=_[_0x5842('0x37')](_0x280320[_0x5842('0x36')]);_0x3c5f1b[_0x5842('0x38')]=_[_0x5842('0x39')](_0x3c5f1b['model'],_0x3c5f1b[_0x5842('0x36')]);_0x351fd3['attributes']=_[_0x5842('0x39')](_0x3c5f1b[_0x5842('0x35')],qs['fields'](_0x280320['query'][_0x5842('0x3a')]));_0x351fd3[_0x5842('0x3b')]=_0x351fd3[_0x5842('0x3b')][_0x5842('0x4b')]?_0x351fd3['attributes']:_0x3c5f1b[_0x5842('0x35')];if(_0x280320[_0x5842('0x36')]['includeAll']){_0x351fd3[_0x5842('0x46')]=[{'all':!![]}];}_0x351fd3=_[_0x5842('0x43')]({},_0x351fd3,_0x280320[_0x5842('0x4c')]);return db[_0x5842('0x30')][_0x5842('0x4d')](_0x351fd3)[_0x5842('0x27')](handleEntityNotFound(_0x356c12,null))['then'](respondWithResult(_0x356c12,null))[_0x5842('0x49')](handleError(_0x356c12,null));};exports[_0x5842('0x4e')]=function(_0x58c166,_0x1a6b65){return db[_0x5842('0x30')]['create'](_0x58c166['body'],{})[_0x5842('0x27')](function(_0x233b7a){var _0x371668=_0x58c166[_0x5842('0x4f')][_0x5842('0x28')]({'plain':!![]});if(!_0x371668)throw new Error(_0x5842('0x50'));if(_0x371668['role']==='user'){var _0x1e76f1=_0x233b7a[_0x5842('0x28')]({'plain':!![]});var _0x45f4de=_0x5842('0x29');return db[_0x5842('0x51')][_0x5842('0x4d')]({'where':{'name':_0x45f4de,'userProfileId':_0x371668[_0x5842('0x52')]},'raw':!![]})['then'](function(_0x1f006b){if(_0x1f006b&&_0x1f006b[_0x5842('0x53')]===0x0){return db[_0x5842('0x2a')]['create']({'name':_0x1e76f1['name'],'resourceId':_0x1e76f1['id'],'type':_0x1f006b[_0x5842('0x2c')],'sectionId':_0x1f006b['id']},{})['then'](function(){return _0x233b7a;});}else{return _0x233b7a;}})['catch'](function(_0x451ae3){logger[_0x5842('0x2b')](_0x5842('0x54'),_0x451ae3);throw _0x451ae3;});}return _0x233b7a;})[_0x5842('0x27')](respondWithResult(_0x1a6b65,0xc9))['catch'](handleError(_0x1a6b65,null));};exports[_0x5842('0x55')]=function(_0x365362,_0x3adc9c){var _0x4c4dbb={'where':{'id':_0x365362['params']['id']}},_0x24436c={};_0x24436c[_0x5842('0x35')]=_[_0x5842('0x37')](db['Campaign'][_0x5842('0x31')]);_0x4c4dbb['attributes']=_['intersection'](_0x24436c[_0x5842('0x35')],qs[_0x5842('0x3a')](_0x365362[_0x5842('0x36')][_0x5842('0x3a')]));_0x4c4dbb['attributes']=_0x4c4dbb[_0x5842('0x3b')][_0x5842('0x4b')]?_0x4c4dbb[_0x5842('0x3b')]:_0x24436c['model'];if(_0x365362[_0x5842('0x36')][_0x5842('0x45')]){_0x4c4dbb[_0x5842('0x46')]=[{'all':!![]}];}_0x4c4dbb=_[_0x5842('0x43')]({},_0x4c4dbb,_0x365362[_0x5842('0x4c')]);return db[_0x5842('0x30')][_0x5842('0x4d')](_0x4c4dbb)['then'](handleEntityNotFound(_0x3adc9c,null))[_0x5842('0x27')](function(_0x4e7ca8){if(_0x4e7ca8){var _0x51ba03=_0x4e7ca8['get']({'plain':!![]});_0x51ba03=qs['omit'](_0x51ba03,['id','createdAt',_0x5842('0x56')]);_0x365362[_0x5842('0x57')]=_['omit'](_0x365362[_0x5842('0x57')],['id',_0x5842('0x58'),_0x5842('0x56')]);return db['Campaign'][_0x5842('0x4e')](_[_0x5842('0x43')](_0x51ba03,_0x365362[_0x5842('0x57')]),{'include':_0x365362[_0x5842('0x36')][_0x5842('0x45')]?[{'all':!![]}]:undefined})[_0x5842('0x27')](function(_0x526f32){var _0x2de4e9=_0x365362[_0x5842('0x4f')][_0x5842('0x28')]({'plain':!![]});if(!_0x2de4e9)throw new Error(_0x5842('0x50'));if(_0x2de4e9[_0x5842('0x59')]===_0x5842('0x4f')){var _0x141208=_0x526f32[_0x5842('0x28')]({'plain':!![]});var _0x389867=_0x5842('0x29');return db[_0x5842('0x51')][_0x5842('0x4d')]({'where':{'name':_0x389867,'userProfileId':_0x2de4e9['userProfileId']},'raw':!![]})['then'](function(_0xccb58e){if(_0xccb58e&&_0xccb58e[_0x5842('0x53')]===0x0){return db['UserProfileResource'][_0x5842('0x4e')]({'name':_0x141208[_0x5842('0x2c')],'resourceId':_0x141208['id'],'type':_0xccb58e[_0x5842('0x2c')],'sectionId':_0xccb58e['id']},{})['then'](function(){return _0x526f32;});}else{return _0x526f32;}})['catch'](function(_0x21c45f){logger[_0x5842('0x2b')](_0x5842('0x54'),_0x21c45f);throw _0x21c45f;});}return _0x526f32;});}})[_0x5842('0x27')](respondWithResult(_0x3adc9c,0xc9))[_0x5842('0x49')](handleError(_0x3adc9c,null));};exports[_0x5842('0x25')]=function(_0x40a55c,_0x2cf0ef){if(_0x40a55c[_0x5842('0x57')]['id']){delete _0x40a55c[_0x5842('0x57')]['id'];}return db['Campaign'][_0x5842('0x4d')]({'where':{'id':_0x40a55c[_0x5842('0x5a')]['id']}})[_0x5842('0x27')](handleEntityNotFound(_0x2cf0ef,null))[_0x5842('0x27')](saveUpdates(_0x40a55c[_0x5842('0x57')],null))['then'](respondWithResult(_0x2cf0ef,null))[_0x5842('0x49')](handleError(_0x2cf0ef,null));};exports['destroy']=function(_0x4cbe89,_0x22bf70){return db[_0x5842('0x30')][_0x5842('0x4d')]({'where':{'id':_0x4cbe89[_0x5842('0x5a')]['id']}})[_0x5842('0x27')](handleEntityNotFound(_0x22bf70,null))[_0x5842('0x27')](removeEntity(_0x22bf70,null))['catch'](handleError(_0x22bf70,null));};exports['getHoppers']=function(_0x57ab3d,_0xf87265,_0x3dbf9b){var _0x37095b={'raw':!![],'where':{}};var _0x3d37b0={};var _0x489f67={'count':0x0,'rows':[]};return db[_0x5842('0x30')][_0x5842('0x5b')]({'where':{'id':_0x57ab3d['params']['id']}})[_0x5842('0x27')](handleEntityNotFound(_0xf87265,null))['then'](function(_0x217253){if(_0x217253){_0x3d37b0[_0x5842('0x35')]=_[_0x5842('0x37')](db[_0x5842('0x5c')][_0x5842('0x31')]);_0x3d37b0['query']=_[_0x5842('0x37')](_0x57ab3d[_0x5842('0x36')]);_0x3d37b0[_0x5842('0x38')]=_[_0x5842('0x39')](_0x3d37b0[_0x5842('0x35')],_0x3d37b0[_0x5842('0x36')]);_0x37095b['attributes']=_[_0x5842('0x39')](_0x3d37b0[_0x5842('0x35')],qs[_0x5842('0x3a')](_0x57ab3d[_0x5842('0x36')][_0x5842('0x3a')]));_0x37095b['attributes']=_0x37095b[_0x5842('0x3b')]['length']?_0x37095b[_0x5842('0x3b')]:_0x3d37b0['model'];if(!_0x57ab3d[_0x5842('0x36')]['hasOwnProperty'](_0x5842('0x3d'))){_0x37095b[_0x5842('0x3e')]=qs[_0x5842('0x3e')](_0x57ab3d[_0x5842('0x36')]['limit']);_0x37095b[_0x5842('0x20')]=qs['offset'](_0x57ab3d[_0x5842('0x36')][_0x5842('0x20')]);}_0x37095b[_0x5842('0x3f')]=qs[_0x5842('0x40')](_0x57ab3d[_0x5842('0x36')][_0x5842('0x40')]);_0x37095b[_0x5842('0x41')]=qs[_0x5842('0x38')](_['pick'](_0x57ab3d[_0x5842('0x36')],_0x3d37b0[_0x5842('0x38')]));_0x37095b[_0x5842('0x41')][_0x5842('0x5d')]=_0x217253['id'];if(_0x57ab3d[_0x5842('0x36')]['filter']){_0x37095b['where']=_[_0x5842('0x43')](_0x37095b['where'],{'$or':_['map'](_0x37095b[_0x5842('0x3b')],function(_0x360899){var _0x993de9={};_0x993de9[_0x360899]={'$like':'%'+_0x57ab3d[_0x5842('0x36')][_0x5842('0x42')]+'%'};return _0x993de9;})});}_0x37095b=_['merge']({},_0x37095b,_0x57ab3d['options']);return db[_0x5842('0x5c')][_0x5842('0x22')]({'where':_0x37095b['where']})[_0x5842('0x27')](function(_0x6275a){_0x489f67[_0x5842('0x22')]=_0x6275a;if(_0x57ab3d[_0x5842('0x36')][_0x5842('0x45')]){_0x37095b[_0x5842('0x46')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x37095b);})['then'](function(_0x16b90e){_0x489f67[_0x5842('0x48')]=_0x16b90e;return _0x489f67;});}})[_0x5842('0x27')](respondWithFilteredResult(_0xf87265,_0x37095b))[_0x5842('0x49')](handleError(_0xf87265,null));};exports['getHopperHistories']=function(_0x3a9ac4,_0x273751,_0x588371){var _0x4ce511={'raw':!![],'where':{}};var _0x3c5e85={};var _0x35ef38={'count':0x0,'rows':[]};return db[_0x5842('0x30')]['findOne']({'where':{'id':_0x3a9ac4[_0x5842('0x5a')]['id']}})['then'](handleEntityNotFound(_0x273751,null))[_0x5842('0x27')](function(_0x293f0d){if(_0x293f0d){_0x3c5e85[_0x5842('0x35')]=_[_0x5842('0x37')](db['CmHopperHistory'][_0x5842('0x31')]);_0x3c5e85[_0x5842('0x36')]=_[_0x5842('0x37')](_0x3a9ac4[_0x5842('0x36')]);_0x3c5e85[_0x5842('0x38')]=_['intersection'](_0x3c5e85[_0x5842('0x35')],_0x3c5e85[_0x5842('0x36')]);_0x4ce511[_0x5842('0x3b')]=_[_0x5842('0x39')](_0x3c5e85[_0x5842('0x35')],qs[_0x5842('0x3a')](_0x3a9ac4['query'][_0x5842('0x3a')]));_0x4ce511[_0x5842('0x3b')]=_0x4ce511[_0x5842('0x3b')][_0x5842('0x4b')]?_0x4ce511[_0x5842('0x3b')]:_0x3c5e85[_0x5842('0x35')];if(!_0x3a9ac4[_0x5842('0x36')][_0x5842('0x3c')]('nolimit')){_0x4ce511['limit']=qs['limit'](_0x3a9ac4['query'][_0x5842('0x3e')]);_0x4ce511[_0x5842('0x20')]=qs['offset'](_0x3a9ac4[_0x5842('0x36')][_0x5842('0x20')]);}_0x4ce511['order']=qs[_0x5842('0x40')](_0x3a9ac4[_0x5842('0x36')][_0x5842('0x40')]);_0x4ce511[_0x5842('0x41')]=qs[_0x5842('0x38')](_[_0x5842('0x5e')](_0x3a9ac4[_0x5842('0x36')],_0x3c5e85['filters']));_0x4ce511[_0x5842('0x41')][_0x5842('0x5d')]=_0x293f0d['id'];if(_0x3a9ac4[_0x5842('0x36')]['filter']){_0x4ce511['where']=_[_0x5842('0x43')](_0x4ce511['where'],{'$or':_[_0x5842('0x2f')](_0x4ce511[_0x5842('0x3b')],function(_0x40d2d8){var _0x3de2c1={};_0x3de2c1[_0x40d2d8]={'$like':'%'+_0x3a9ac4[_0x5842('0x36')][_0x5842('0x42')]+'%'};return _0x3de2c1;})});}_0x4ce511=_[_0x5842('0x43')]({},_0x4ce511,_0x3a9ac4[_0x5842('0x4c')]);return db['CmHopperHistory'][_0x5842('0x22')]({'where':_0x4ce511[_0x5842('0x41')]})['then'](function(_0xfb53e){_0x35ef38[_0x5842('0x22')]=_0xfb53e;if(_0x3a9ac4[_0x5842('0x36')][_0x5842('0x45')]){_0x4ce511[_0x5842('0x46')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x4ce511);})[_0x5842('0x27')](function(_0x473030){_0x35ef38['rows']=_0x473030;return _0x35ef38;});}})['then'](respondWithFilteredResult(_0x273751,_0x4ce511))[_0x5842('0x49')](handleError(_0x273751,null));};exports[_0x5842('0x5f')]=function(_0x3e4ae1,_0x582536,_0x3a993a){var _0xf8cd20={'raw':!![],'where':{}};var _0x41a6bb={};var _0x5345a6={'count':0x0,'rows':[]};return db[_0x5842('0x30')][_0x5842('0x5b')]({'where':{'id':_0x3e4ae1[_0x5842('0x5a')]['id']}})[_0x5842('0x27')](handleEntityNotFound(_0x582536,null))[_0x5842('0x27')](function(_0xc88a2e){if(_0xc88a2e){_0x41a6bb[_0x5842('0x35')]=_[_0x5842('0x37')](db[_0x5842('0x60')][_0x5842('0x31')]);_0x41a6bb[_0x5842('0x36')]=_[_0x5842('0x37')](_0x3e4ae1[_0x5842('0x36')]);_0x41a6bb[_0x5842('0x38')]=_[_0x5842('0x39')](_0x41a6bb[_0x5842('0x35')],_0x41a6bb[_0x5842('0x36')]);_0xf8cd20['attributes']=_[_0x5842('0x39')](_0x41a6bb[_0x5842('0x35')],qs['fields'](_0x3e4ae1['query'][_0x5842('0x3a')]));_0xf8cd20[_0x5842('0x3b')]=_0xf8cd20[_0x5842('0x3b')][_0x5842('0x4b')]?_0xf8cd20['attributes']:_0x41a6bb['model'];if(!_0x3e4ae1[_0x5842('0x36')][_0x5842('0x3c')](_0x5842('0x3d'))){_0xf8cd20[_0x5842('0x3e')]=qs[_0x5842('0x3e')](_0x3e4ae1[_0x5842('0x36')][_0x5842('0x3e')]);_0xf8cd20['offset']=qs['offset'](_0x3e4ae1[_0x5842('0x36')][_0x5842('0x20')]);}_0xf8cd20['order']=qs['sort'](_0x3e4ae1[_0x5842('0x36')][_0x5842('0x40')]);_0xf8cd20[_0x5842('0x41')]=qs[_0x5842('0x38')](_[_0x5842('0x5e')](_0x3e4ae1[_0x5842('0x36')],_0x41a6bb[_0x5842('0x38')]));_0xf8cd20[_0x5842('0x41')][_0x5842('0x5d')]=_0xc88a2e['id'];if(_0x3e4ae1[_0x5842('0x36')][_0x5842('0x42')]){_0xf8cd20[_0x5842('0x41')]=_[_0x5842('0x43')](_0xf8cd20['where'],{'$or':_[_0x5842('0x2f')](_0xf8cd20['attributes'],function(_0x50990c){var _0x15f462={};_0x15f462[_0x50990c]={'$like':'%'+_0x3e4ae1[_0x5842('0x36')][_0x5842('0x42')]+'%'};return _0x15f462;})});}_0xf8cd20=_['merge']({},_0xf8cd20,_0x3e4ae1[_0x5842('0x4c')]);return db[_0x5842('0x60')][_0x5842('0x22')]({'where':_0xf8cd20[_0x5842('0x41')]})[_0x5842('0x27')](function(_0x1b873b){_0x5345a6[_0x5842('0x22')]=_0x1b873b;if(_0x3e4ae1[_0x5842('0x36')][_0x5842('0x45')]){_0xf8cd20[_0x5842('0x46')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x5842('0x47')](_0xf8cd20);})[_0x5842('0x27')](function(_0x3db4c4){_0x5345a6[_0x5842('0x48')]=_0x3db4c4;return _0x5345a6;});}})['then'](respondWithFilteredResult(_0x582536,_0xf8cd20))[_0x5842('0x49')](handleError(_0x582536,null));};exports[_0x5842('0x61')]=function(_0x2ed56e,_0x37e48e,_0x39c815){var _0x2a7698={'raw':!![],'where':{}};var _0x249f24={};var _0x1df641={'count':0x0,'rows':[]};return db[_0x5842('0x30')]['findOne']({'where':{'id':_0x2ed56e[_0x5842('0x5a')]['id']}})[_0x5842('0x27')](handleEntityNotFound(_0x37e48e,null))[_0x5842('0x27')](function(_0x394296){if(_0x394296){_0x249f24[_0x5842('0x35')]=_['keys'](db[_0x5842('0x62')]['rawAttributes']);_0x249f24[_0x5842('0x36')]=_[_0x5842('0x37')](_0x2ed56e['query']);_0x249f24[_0x5842('0x38')]=_[_0x5842('0x39')](_0x249f24[_0x5842('0x35')],_0x249f24[_0x5842('0x36')]);_0x2a7698[_0x5842('0x3b')]=_[_0x5842('0x39')](_0x249f24['model'],qs['fields'](_0x2ed56e[_0x5842('0x36')][_0x5842('0x3a')]));_0x2a7698[_0x5842('0x3b')]=_0x2a7698[_0x5842('0x3b')]['length']?_0x2a7698['attributes']:_0x249f24['model'];if(!_0x2ed56e[_0x5842('0x36')][_0x5842('0x3c')](_0x5842('0x3d'))){_0x2a7698[_0x5842('0x3e')]=qs[_0x5842('0x3e')](_0x2ed56e[_0x5842('0x36')][_0x5842('0x3e')]);_0x2a7698[_0x5842('0x20')]=qs[_0x5842('0x20')](_0x2ed56e[_0x5842('0x36')][_0x5842('0x20')]);}_0x2a7698[_0x5842('0x3f')]=qs[_0x5842('0x40')](_0x2ed56e['query'][_0x5842('0x40')]);_0x2a7698[_0x5842('0x41')]=qs[_0x5842('0x38')](_[_0x5842('0x5e')](_0x2ed56e[_0x5842('0x36')],_0x249f24['filters']));_0x2a7698['where']['CampaignId']=_0x394296['id'];if(_0x2ed56e[_0x5842('0x36')][_0x5842('0x42')]){_0x2a7698['where']=_[_0x5842('0x43')](_0x2a7698[_0x5842('0x41')],{'$or':_[_0x5842('0x2f')](_0x2a7698['attributes'],function(_0x335978){var _0x4b1495={};_0x4b1495[_0x335978]={'$like':'%'+_0x2ed56e[_0x5842('0x36')][_0x5842('0x42')]+'%'};return _0x4b1495;})});}_0x2a7698=_['merge']({},_0x2a7698,_0x2ed56e[_0x5842('0x4c')]);return db[_0x5842('0x62')][_0x5842('0x22')]({'where':_0x2a7698['where']})[_0x5842('0x27')](function(_0x48024b){_0x1df641['count']=_0x48024b;if(_0x2ed56e[_0x5842('0x36')][_0x5842('0x45')]){_0x2a7698[_0x5842('0x46')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x5842('0x47')](_0x2a7698);})['then'](function(_0x2685cc){_0x1df641[_0x5842('0x48')]=_0x2685cc;return _0x1df641;});}})[_0x5842('0x27')](respondWithFilteredResult(_0x37e48e,_0x2a7698))[_0x5842('0x49')](handleError(_0x37e48e,null));};exports['getLists']=function(_0xd9a00e,_0x45a01b,_0x3b5a03){var _0x59960b={};var _0x87dfc6={};var _0x2b79b4;var _0x439306;return db['Campaign']['findOne']({'where':{'id':_0xd9a00e[_0x5842('0x5a')]['id']}})[_0x5842('0x27')](handleEntityNotFound(_0x45a01b,null))[_0x5842('0x27')](function(_0x4bc828){if(_0x4bc828){_0x2b79b4=_0x4bc828;_0x87dfc6[_0x5842('0x35')]=_[_0x5842('0x37')](db[_0x5842('0x63')][_0x5842('0x31')]);_0x87dfc6['query']=_[_0x5842('0x37')](_0xd9a00e[_0x5842('0x36')]);_0x87dfc6[_0x5842('0x38')]=_[_0x5842('0x39')](_0x87dfc6[_0x5842('0x35')],_0x87dfc6[_0x5842('0x36')]);_0x59960b[_0x5842('0x3b')]=_[_0x5842('0x39')](_0x87dfc6[_0x5842('0x35')],qs[_0x5842('0x3a')](_0xd9a00e[_0x5842('0x36')][_0x5842('0x3a')]));_0x59960b[_0x5842('0x3b')]=_0x59960b[_0x5842('0x3b')]['length']?_0x59960b[_0x5842('0x3b')]:_0x87dfc6['model'];_0x59960b[_0x5842('0x3f')]=qs[_0x5842('0x40')](_0xd9a00e['query']['sort']);_0x59960b[_0x5842('0x41')]=qs[_0x5842('0x38')](_[_0x5842('0x5e')](_0xd9a00e[_0x5842('0x36')],_0x87dfc6[_0x5842('0x38')]));if(_0xd9a00e[_0x5842('0x36')][_0x5842('0x42')]){_0x59960b['where']=_[_0x5842('0x43')](_0x59960b[_0x5842('0x41')],{'$or':_[_0x5842('0x2f')](_0x59960b[_0x5842('0x3b')],function(_0x33be61){var _0x2ade7={};_0x2ade7[_0x33be61]={'$like':'%'+_0xd9a00e[_0x5842('0x36')]['filter']+'%'};return _0x2ade7;})});}_0x59960b=_[_0x5842('0x43')]({},_0x59960b,_0xd9a00e[_0x5842('0x4c')]);return _0x2b79b4[_0x5842('0x64')](_0x59960b);}})['then'](function(_0x20ae66){if(_0x20ae66){_0x439306=_0x20ae66[_0x5842('0x4b')];if(!_0xd9a00e[_0x5842('0x36')][_0x5842('0x3c')](_0x5842('0x3d'))){_0x59960b[_0x5842('0x3e')]=qs[_0x5842('0x3e')](_0xd9a00e[_0x5842('0x36')]['limit']);_0x59960b['offset']=qs[_0x5842('0x20')](_0xd9a00e[_0x5842('0x36')][_0x5842('0x20')]);}return _0x2b79b4[_0x5842('0x64')](_0x59960b);}})[_0x5842('0x27')](function(_0x196ce8){if(_0x196ce8){return _0x196ce8?{'count':_0x439306,'rows':_0x196ce8}:null;}})['then'](respondWithResult(_0x45a01b,null))[_0x5842('0x49')](handleError(_0x45a01b,null));};exports[_0x5842('0x65')]=function(_0x1d5d0d,_0x13eb76,_0x11837d){var _0x350b73,_0x5c8368;var _0xfd544b=[];var _0x247fc0=moment()[_0x5842('0x66')](_0x5842('0x67'));return db[_0x5842('0x30')][_0x5842('0x4d')]({'where':{'id':_0x1d5d0d[_0x5842('0x5a')]['id']}})['then'](handleEntityNotFound(_0x13eb76,null))[_0x5842('0x27')](function(_0x12a966){if(_0x12a966){_0x5c8368=_0x12a966;return _0x12a966[_0x5842('0x65')](_0x1d5d0d['body'][_0x5842('0x68')],_[_0x5842('0x69')](_0x1d5d0d[_0x5842('0x57')],[_0x5842('0x68'),'id'])||{});}return null;})['spread'](function(_0x4fa0d4){var _0x4472ef;var _0x42d1bf;_0x350b73=_0x4fa0d4||[];var _0x1167db=[];if(_0x4fa0d4){for(var _0x528716=0x0;_0x528716<_0x4fa0d4[_0x5842('0x4b')];_0x528716+=0x1){var _0x3bf757=_0x4fa0d4[_0x528716][_0x5842('0x28')]({'plain':!![]});_0x5c8368[_0x5842('0x6a')]=_0x1d5d0d[_0x5842('0x57')][_0x5842('0x6a')]?_0x1d5d0d[_0x5842('0x57')][_0x5842('0x6a')]:_0x5c8368['dialCheckDuplicateType'];switch(_0x5c8368[_0x5842('0x6a')]){case'always':_0x4472ef=squel[_0x5842('0x6b')]()['into'](_0x5842('0x6c'))[_0x5842('0x6d')]([_0x5842('0x6e'),_0x5842('0x6f'),_0x5842('0x70'),_0x5842('0x71'),_0x5842('0x5d'),_0x5842('0x58'),_0x5842('0x56')],squel[_0x5842('0x72')]()[_0x5842('0x73')](_0x5842('0x6e'),_0x5842('0x6e'))[_0x5842('0x73')](_0x5842('0x74'),_0x5842('0x6f'))[_0x5842('0x73')]('id',_0x5842('0x70'))[_0x5842('0x73')](_0x3bf757['CmListId'][_0x5842('0x75')](),_0x5842('0x71'))[_0x5842('0x73')](_0x1d5d0d[_0x5842('0x5a')]['id']['toString'](),_0x5842('0x5d'))[_0x5842('0x73')]('\x27'+_0x247fc0+'\x27',_0x5842('0x58'))[_0x5842('0x73')]('\x27'+_0x247fc0+'\x27',_0x5842('0x56'))[_0x5842('0x76')](_0x5842('0x77'))[_0x5842('0x41')](_0x5842('0x78'))[_0x5842('0x41')]('ListId\x20=\x20?',_0x3bf757['CmListId'][_0x5842('0x75')]())[_0x5842('0x41')](_0x5842('0x79'))[_0x5842('0x41')](_0x5842('0x7a'),squel[_0x5842('0x72')]()[_0x5842('0x73')](_0x5842('0x7b'))[_0x5842('0x76')](_0x5842('0x7c'))[_0x5842('0x41')](_0x5842('0x7d'),_0x1d5d0d[_0x5842('0x5a')]['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0x5842('0x76')](_0x5842('0x6c'))['where']('CampaignId\x20=\x20?',_0x1d5d0d['params']['id'][_0x5842('0x75')]())))[_0x5842('0x75')]();break;case _0x5842('0x7e'):_0x4472ef=squel[_0x5842('0x6b')]()[_0x5842('0x7f')](_0x5842('0x6c'))['fromQuery'](['phone',_0x5842('0x6f'),_0x5842('0x70'),_0x5842('0x71'),_0x5842('0x5d'),_0x5842('0x58'),_0x5842('0x56')],squel[_0x5842('0x72')]()[_0x5842('0x73')](_0x5842('0x6e'),'phone')['field'](_0x5842('0x74'),'scheduledAt')[_0x5842('0x73')]('id','ContactId')[_0x5842('0x73')](_0x3bf757['CmListId'][_0x5842('0x75')](),_0x5842('0x71'))[_0x5842('0x73')](_0x1d5d0d[_0x5842('0x5a')]['id'][_0x5842('0x75')](),_0x5842('0x5d'))[_0x5842('0x73')]('\x27'+_0x247fc0+'\x27',_0x5842('0x58'))[_0x5842('0x73')]('\x27'+_0x247fc0+'\x27',_0x5842('0x56'))[_0x5842('0x76')](_0x5842('0x77'))[_0x5842('0x41')](_0x5842('0x78'))['where'](_0x5842('0x80'),_0x3bf757['CmListId'][_0x5842('0x75')]())[_0x5842('0x41')](_0x5842('0x79'))[_0x5842('0x41')](_0x5842('0x7a'),squel[_0x5842('0x72')]()['field'](_0x5842('0x81'))['from'](_0x5842('0x6c'))['where'](_0x5842('0x7d'),_0x1d5d0d[_0x5842('0x5a')]['id']['toString']())))[_0x5842('0x75')]();break;default:_0x4472ef=squel[_0x5842('0x6b')]()['into'](_0x5842('0x6c'))[_0x5842('0x6d')]([_0x5842('0x6e'),_0x5842('0x6f'),_0x5842('0x70'),_0x5842('0x71'),'CampaignId',_0x5842('0x58'),_0x5842('0x56')],squel[_0x5842('0x72')]()[_0x5842('0x73')](_0x5842('0x6e'),_0x5842('0x6e'))['field'](_0x5842('0x74'),_0x5842('0x6f'))[_0x5842('0x73')]('id',_0x5842('0x70'))[_0x5842('0x73')](_0x3bf757[_0x5842('0x82')][_0x5842('0x75')](),_0x5842('0x71'))[_0x5842('0x73')](_0x1d5d0d[_0x5842('0x5a')]['id'][_0x5842('0x75')](),_0x5842('0x5d'))[_0x5842('0x73')]('\x27'+_0x247fc0+'\x27','createdAt')[_0x5842('0x73')]('\x27'+_0x247fc0+'\x27',_0x5842('0x56'))[_0x5842('0x76')](_0x5842('0x77'))[_0x5842('0x41')](_0x5842('0x78'))['where'](_0x5842('0x80'),_0x3bf757[_0x5842('0x82')]['toString']())[_0x5842('0x41')](_0x5842('0x79')))[_0x5842('0x75')]();}_0x42d1bf=squel[_0x5842('0x6b')]()[_0x5842('0x7f')](_0x5842('0x83'))[_0x5842('0x6d')]([_0x5842('0x84'),'scheduledAt','phone',_0x5842('0x85'),_0x5842('0x58'),'updatedAt'],squel[_0x5842('0x72')]()['field'](_0x5842('0x86'),'id')[_0x5842('0x73')](_0x5842('0x74'),'scheduledAt')[_0x5842('0x73')](_0x5842('0x87'),_0x5842('0x6e'))[_0x5842('0x73')](_0x5842('0x88'),'OrderBy')[_0x5842('0x73')]('\x27'+_0x247fc0+'\x27','createdAt')[_0x5842('0x73')]('\x27'+_0x247fc0+'\x27','updatedAt')['from'](_0x5842('0x89'),'ci')[_0x5842('0x8a')]('cm_hopper','h',_0x5842('0x8b'))[_0x5842('0x41')]('h.ListId\x20=\x20?',_0x3bf757[_0x5842('0x82')][_0x5842('0x75')]())[_0x5842('0x41')](_0x5842('0x8c'),_0x1d5d0d[_0x5842('0x5a')]['id'][_0x5842('0x75')]())[_0x5842('0x41')](_0x5842('0x8d'),_0x247fc0))[_0x5842('0x75')]();_0x1167db[_0x5842('0x8e')](db[_0x5842('0x8f')]['query'](_0x4472ef));_0xfd544b[_0x5842('0x8e')](db[_0x5842('0x8f')][_0x5842('0x36')](_0x42d1bf));}return BPromise[_0x5842('0x90')](_0x1167db);}})['then'](function(){return BPromise[_0x5842('0x90')](_0xfd544b);})[_0x5842('0x27')](function(){return _0x350b73;})[_0x5842('0x27')](respondWithResult(_0x13eb76,null))[_0x5842('0x49')](handleError(_0x13eb76,null));};exports['removeLists']=function(_0xcb30e3,_0x3bf44e,_0x1b6b87){return db[_0x5842('0x30')]['find']({'where':{'id':_0xcb30e3['params']['id']}})[_0x5842('0x27')](handleEntityNotFound(_0x3bf44e,null))['then'](function(_0x132843){if(_0x132843){return _0x132843['removeLists'](_0xcb30e3[_0x5842('0x36')][_0x5842('0x68')]);}})[_0x5842('0x27')](function(_0x333aaf){if(_0x333aaf){return db['CmHopper'][_0x5842('0x26')]({'where':{'ListId':_0xcb30e3[_0x5842('0x36')][_0x5842('0x68')],'CampaignId':_0xcb30e3[_0x5842('0x5a')]['id']}})[_0x5842('0x27')](function(){return _0x333aaf;});}})['then'](respondWithStatusCode(_0x3bf44e,null))[_0x5842('0x49')](handleError(_0x3bf44e,null));};exports[_0x5842('0x91')]=function(_0x43fcd9,_0x15a4b1,_0x4daeca){var _0x3a92a9={};var _0x461b97={};var _0x375470;var _0xea02b;return db['Campaign'][_0x5842('0x5b')]({'where':{'id':_0x43fcd9[_0x5842('0x5a')]['id']}})[_0x5842('0x27')](handleEntityNotFound(_0x15a4b1,null))[_0x5842('0x27')](function(_0x27420f){if(_0x27420f){_0x375470=_0x27420f;_0x461b97[_0x5842('0x35')]=_['keys'](db[_0x5842('0x63')][_0x5842('0x31')]);_0x461b97[_0x5842('0x36')]=_[_0x5842('0x37')](_0x43fcd9[_0x5842('0x36')]);_0x461b97['filters']=_[_0x5842('0x39')](_0x461b97[_0x5842('0x35')],_0x461b97[_0x5842('0x36')]);_0x3a92a9[_0x5842('0x3b')]=_['intersection'](_0x461b97[_0x5842('0x35')],qs[_0x5842('0x3a')](_0x43fcd9[_0x5842('0x36')][_0x5842('0x3a')]));_0x3a92a9[_0x5842('0x3b')]=_0x3a92a9[_0x5842('0x3b')][_0x5842('0x4b')]?_0x3a92a9[_0x5842('0x3b')]:_0x461b97['model'];_0x3a92a9[_0x5842('0x3f')]=qs[_0x5842('0x40')](_0x43fcd9['query'][_0x5842('0x40')]);_0x3a92a9[_0x5842('0x41')]=qs[_0x5842('0x38')](_[_0x5842('0x5e')](_0x43fcd9[_0x5842('0x36')],_0x461b97[_0x5842('0x38')]));if(_0x43fcd9[_0x5842('0x36')][_0x5842('0x42')]){_0x3a92a9[_0x5842('0x41')]=_[_0x5842('0x43')](_0x3a92a9[_0x5842('0x41')],{'$or':_[_0x5842('0x2f')](_0x3a92a9[_0x5842('0x3b')],function(_0x2ee5c9){var _0x41f0ca={};_0x41f0ca[_0x2ee5c9]={'$like':'%'+_0x43fcd9['query']['filter']+'%'};return _0x41f0ca;})});}_0x3a92a9=_[_0x5842('0x43')]({},_0x3a92a9,_0x43fcd9[_0x5842('0x4c')]);return _0x375470[_0x5842('0x91')](_0x3a92a9);}})['then'](function(_0x2b8647){if(_0x2b8647){_0xea02b=_0x2b8647['length'];if(!_0x43fcd9[_0x5842('0x36')][_0x5842('0x3c')](_0x5842('0x3d'))){_0x3a92a9['limit']=qs['limit'](_0x43fcd9[_0x5842('0x36')][_0x5842('0x3e')]);_0x3a92a9[_0x5842('0x20')]=qs[_0x5842('0x20')](_0x43fcd9[_0x5842('0x36')][_0x5842('0x20')]);}return _0x375470[_0x5842('0x91')](_0x3a92a9);}})['then'](function(_0x1da00e){if(_0x1da00e){return _0x1da00e?{'count':_0xea02b,'rows':_0x1da00e}:null;}})[_0x5842('0x27')](respondWithResult(_0x15a4b1,null))[_0x5842('0x49')](handleError(_0x15a4b1,null));};exports[_0x5842('0x92')]=function(_0x55cf69,_0x359516,_0xbd9582){var _0x46ee09,_0x32004a;var _0x1ee6a9=[];var _0x41caae=moment()[_0x5842('0x66')](_0x5842('0x67'));return db[_0x5842('0x30')]['find']({'where':{'id':_0x55cf69[_0x5842('0x5a')]['id']}})[_0x5842('0x27')](handleEntityNotFound(_0x359516,null))[_0x5842('0x27')](function(_0x340561){if(_0x340561){_0x32004a=_0x340561;return _0x340561['addBlackLists'](_0x55cf69[_0x5842('0x57')]['ids'],_[_0x5842('0x69')](_0x55cf69[_0x5842('0x57')],[_0x5842('0x68'),'id'])||{});}return null;})[_0x5842('0x93')](function(_0x405e35){var _0x2a6562;var _0xe7ac8f;_0x46ee09=_0x405e35||[];var _0x15608f=[];if(_0x405e35){for(var _0x3126df=0x0;_0x3126df<_0x405e35[_0x5842('0x4b')];_0x3126df+=0x1){var _0x4a72ab=_0x405e35[_0x3126df]['get']({'plain':!![]});_0x2a6562=squel['insert']()[_0x5842('0x7f')](_0x5842('0x94'))[_0x5842('0x6d')]([_0x5842('0x6e'),_0x5842('0x70'),_0x5842('0x71'),_0x5842('0x5d'),'createdAt',_0x5842('0x56')],squel['select']()[_0x5842('0x73')](_0x5842('0x6e'),'phone')[_0x5842('0x73')]('id','ContactId')[_0x5842('0x73')](_0x4a72ab[_0x5842('0x82')][_0x5842('0x75')](),_0x5842('0x71'))['field'](_0x55cf69[_0x5842('0x5a')]['id'][_0x5842('0x75')](),_0x5842('0x5d'))[_0x5842('0x73')](_0x5842('0x74'),'createdAt')[_0x5842('0x73')](_0x5842('0x74'),_0x5842('0x56'))[_0x5842('0x76')](_0x5842('0x77'))[_0x5842('0x41')](_0x5842('0x78'))[_0x5842('0x41')]('ListId\x20=\x20?',_0x4a72ab[_0x5842('0x82')][_0x5842('0x75')]())[_0x5842('0x41')](_0x5842('0x79')))[_0x5842('0x75')]();_0x15608f[_0x5842('0x8e')](db[_0x5842('0x8f')]['query'](_0x2a6562));}return BPromise['all'](_0x15608f);}})[_0x5842('0x27')](function(){return _0x46ee09;})[_0x5842('0x27')](respondWithResult(_0x359516,null))[_0x5842('0x49')](handleError(_0x359516,null));};exports[_0x5842('0x95')]=function(_0x4b0ffe,_0x3a9465,_0x1c5328){return db[_0x5842('0x30')][_0x5842('0x4d')]({'where':{'id':_0x4b0ffe['params']['id']}})['then'](handleEntityNotFound(_0x3a9465,null))[_0x5842('0x27')](function(_0x115157){if(_0x115157){return _0x115157[_0x5842('0x95')](_0x4b0ffe[_0x5842('0x36')]['ids']);}})[_0x5842('0x27')](function(_0x164934){if(_0x164934){return db[_0x5842('0x62')][_0x5842('0x26')]({'where':{'ListId':_0x4b0ffe[_0x5842('0x36')][_0x5842('0x68')],'CampaignId':_0x4b0ffe[_0x5842('0x5a')]['id']}})[_0x5842('0x27')](function(){return _0x164934;});}})[_0x5842('0x27')](respondWithStatusCode(_0x3a9465,null))[_0x5842('0x49')](handleError(_0x3a9465,null));};
\ No newline at end of file
+var _0x486e=['cm_contacts','toString','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','ListId\x20=\x20?','cm_hopper_additional_phones','OrderBy','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','then','destroy','IvrCampaigns','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','where','VIRTUAL','merge','options','Campaign','includeAll','findAll','rows','catch','show','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','params','getHoppers','findOne','hasOwnProperty','CampaignId','filter','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','from'];(function(_0x10b629,_0x150565){var _0x2ef4f2=function(_0x2b00a8){while(--_0x2b00a8){_0x10b629['push'](_0x10b629['shift']());}};_0x2ef4f2(++_0x150565);}(_0x486e,0xb2));var _0xe486=function(_0x9db798,_0x3f5685){_0x9db798=_0x9db798-0x0;var _0x417009=_0x486e[_0x9db798];return _0x417009;};'use strict';var emlformat=require(_0xe486('0x0'));var rimraf=require(_0xe486('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe486('0x2'));var rp=require(_0xe486('0x3'));var moment=require(_0xe486('0x4'));var BPromise=require(_0xe486('0x5'));var Mustache=require(_0xe486('0x6'));var util=require(_0xe486('0x7'));var path=require(_0xe486('0x8'));var sox=require(_0xe486('0x9'));var csv=require(_0xe486('0xa'));var ejs=require(_0xe486('0xb'));var fs=require('fs');var fs_extra=require(_0xe486('0xc'));var _=require('lodash');var squel=require(_0xe486('0xd'));var crypto=require(_0xe486('0xe'));var jsforce=require(_0xe486('0xf'));var deskjs=require(_0xe486('0x10'));var toCsv=require(_0xe486('0xa'));var querystring=require(_0xe486('0x11'));var Papa=require(_0xe486('0x12'));var Redis=require(_0xe486('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe486('0x14'));var hardwareService=require(_0xe486('0x15'));var logger=require(_0xe486('0x16'))(_0xe486('0x17'));var utils=require(_0xe486('0x18'));var config=require(_0xe486('0x19'));var licenseUtil=require(_0xe486('0x1a'));var db=require(_0xe486('0x1b'))['db'];function respondWithStatusCode(_0x372057,_0x530344){_0x530344=_0x530344||0xcc;return function(_0x5a1aad){if(_0x5a1aad){return _0x372057[_0xe486('0x1c')](_0x530344);}return _0x372057[_0xe486('0x1d')](_0x530344)[_0xe486('0x1e')]();};}function respondWithResult(_0x564a6f,_0x5ddb65){_0x5ddb65=_0x5ddb65||0xc8;return function(_0x339746){if(_0x339746){return _0x564a6f['status'](_0x5ddb65)[_0xe486('0x1f')](_0x339746);}};}function respondWithFilteredResult(_0x3da621,_0x4a0259){return function(_0x355002){if(_0x355002){var _0x5016f0=typeof _0x4a0259['offset']===_0xe486('0x20')&&typeof _0x4a0259[_0xe486('0x21')]==='undefined';var _0x3d983b=_0x355002['count'];var _0x25e946=_0x5016f0?0x0:_0x4a0259[_0xe486('0x22')];var _0x5d209a=_0x5016f0?_0x355002[_0xe486('0x23')]:_0x4a0259[_0xe486('0x22')]+_0x4a0259['limit'];var _0xf0697f;if(_0x5d209a>=_0x3d983b){_0x5d209a=_0x3d983b;_0xf0697f=0xc8;}else{_0xf0697f=0xce;}_0x3da621[_0xe486('0x1d')](_0xf0697f);return _0x3da621[_0xe486('0x24')]('Content-Range',_0x25e946+'-'+_0x5d209a+'/'+_0x3d983b)[_0xe486('0x1f')](_0x355002);}return null;};}function patchUpdates(_0x301344){return function(_0x2c34e3){try{jsonpatch[_0xe486('0x25')](_0x2c34e3,_0x301344,!![]);}catch(_0x4650bf){return BPromise[_0xe486('0x26')](_0x4650bf);}return _0x2c34e3[_0xe486('0x27')]();};}function saveUpdates(_0xdc43f0,_0x5b61cc){return function(_0x22efff){if(_0x22efff){return _0x22efff['update'](_0xdc43f0)[_0xe486('0x28')](function(_0x50ae4c){return _0x50ae4c;});}return null;};}function removeEntity(_0x3020e7,_0x47a811){return function(_0x39113f){if(_0x39113f){return _0x39113f[_0xe486('0x29')]()[_0xe486('0x28')](function(){var _0x9f77fc=_0x39113f['get']({'plain':!![]});var _0x2e7182=_0xe486('0x2a');return db[_0xe486('0x2b')][_0xe486('0x29')]({'where':{'type':_0x2e7182,'resourceId':_0x9f77fc['id']}})[_0xe486('0x28')](function(){return _0x39113f;});})[_0xe486('0x28')](function(){_0x3020e7['status'](0xcc)[_0xe486('0x1e')]();});}};}function handleEntityNotFound(_0x2b08d0,_0x502b4c){return function(_0x87ece6){if(!_0x87ece6){_0x2b08d0['sendStatus'](0x194);}return _0x87ece6;};}function handleError(_0x48ab9f,_0x4ecdac){_0x4ecdac=_0x4ecdac||0x1f4;return function(_0x361b51){logger[_0xe486('0x2c')](_0x361b51[_0xe486('0x2d')]);if(_0x361b51['name']){delete _0x361b51[_0xe486('0x2e')];}_0x48ab9f['status'](_0x4ecdac)['send'](_0x361b51);};}exports[_0xe486('0x2f')]=function(_0x1c6d22,_0x22a1c9){var _0x2fc3a7={},_0x39f3f9={},_0x70e1bb={'count':0x0,'rows':[]};var _0x39b179=_['map'](db['Campaign'][_0xe486('0x30')],function(_0x5f3b54){return{'name':_0x5f3b54[_0xe486('0x31')],'type':_0x5f3b54[_0xe486('0x32')][_0xe486('0x33')]};});_0x39f3f9[_0xe486('0x34')]=_[_0xe486('0x35')](_0x39b179,'name');_0x39f3f9[_0xe486('0x36')]=_[_0xe486('0x37')](_0x1c6d22[_0xe486('0x36')]);_0x39f3f9[_0xe486('0x38')]=_['intersection'](_0x39f3f9[_0xe486('0x34')],_0x39f3f9[_0xe486('0x36')]);_0x2fc3a7[_0xe486('0x39')]=_['intersection'](_0x39f3f9[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x1c6d22[_0xe486('0x36')][_0xe486('0x3a')]));_0x2fc3a7['attributes']=_0x2fc3a7[_0xe486('0x39')][_0xe486('0x3b')]?_0x2fc3a7[_0xe486('0x39')]:_0x39f3f9[_0xe486('0x34')];if(!_0x1c6d22['query']['hasOwnProperty'](_0xe486('0x3c'))){_0x2fc3a7[_0xe486('0x21')]=qs[_0xe486('0x21')](_0x1c6d22[_0xe486('0x36')]['limit']);_0x2fc3a7[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x1c6d22[_0xe486('0x36')]['offset']);}_0x2fc3a7[_0xe486('0x3d')]=qs[_0xe486('0x3e')](_0x1c6d22[_0xe486('0x36')][_0xe486('0x3e')]);_0x2fc3a7['where']=qs['filters'](_[_0xe486('0x3f')](_0x1c6d22[_0xe486('0x36')],_0x39f3f9[_0xe486('0x38')]),_0x39b179);if(_0x1c6d22[_0xe486('0x36')]['filter']){_0x2fc3a7[_0xe486('0x40')]=_['merge'](_0x2fc3a7[_0xe486('0x40')],{'$or':_[_0xe486('0x35')](_0x39b179,function(_0xecdc73){if(_0xecdc73[_0xe486('0x32')]!==_0xe486('0x41')){var _0x178fcc={};_0x178fcc[_0xecdc73['name']]={'$like':'%'+_0x1c6d22[_0xe486('0x36')]['filter']+'%'};return _0x178fcc;}})});}_0x2fc3a7=_[_0xe486('0x42')]({},_0x2fc3a7,_0x1c6d22[_0xe486('0x43')]);var _0x1ba5e3={'where':_0x2fc3a7['where']};return db[_0xe486('0x44')]['count'](_0x1ba5e3)[_0xe486('0x28')](function(_0x22c5d2){_0x70e1bb[_0xe486('0x23')]=_0x22c5d2;if(_0x1c6d22['query'][_0xe486('0x45')]){_0x2fc3a7['include']=[{'all':!![]}];}return db[_0xe486('0x44')][_0xe486('0x46')](_0x2fc3a7);})['then'](function(_0x312a3a){_0x70e1bb[_0xe486('0x47')]=_0x312a3a;return _0x70e1bb;})[_0xe486('0x28')](respondWithFilteredResult(_0x22a1c9,_0x2fc3a7))[_0xe486('0x48')](handleError(_0x22a1c9,null));};exports[_0xe486('0x49')]=function(_0x9d6953,_0x5c4c9c){var _0x20b6b5={'raw':![],'where':{'id':_0x9d6953['params']['id']}},_0x45c705={};_0x45c705[_0xe486('0x34')]=_['keys'](db[_0xe486('0x44')][_0xe486('0x30')]);_0x45c705['query']=_[_0xe486('0x37')](_0x9d6953[_0xe486('0x36')]);_0x45c705[_0xe486('0x38')]=_['intersection'](_0x45c705[_0xe486('0x34')],_0x45c705[_0xe486('0x36')]);_0x20b6b5[_0xe486('0x39')]=_[_0xe486('0x4a')](_0x45c705['model'],qs[_0xe486('0x3a')](_0x9d6953[_0xe486('0x36')][_0xe486('0x3a')]));_0x20b6b5[_0xe486('0x39')]=_0x20b6b5[_0xe486('0x39')][_0xe486('0x3b')]?_0x20b6b5[_0xe486('0x39')]:_0x45c705['model'];if(_0x9d6953[_0xe486('0x36')][_0xe486('0x45')]){_0x20b6b5['include']=[{'all':!![]}];}_0x20b6b5=_[_0xe486('0x42')]({},_0x20b6b5,_0x9d6953[_0xe486('0x43')]);return db['Campaign'][_0xe486('0x4b')](_0x20b6b5)[_0xe486('0x28')](handleEntityNotFound(_0x5c4c9c,null))[_0xe486('0x28')](respondWithResult(_0x5c4c9c,null))[_0xe486('0x48')](handleError(_0x5c4c9c,null));};exports[_0xe486('0x4c')]=function(_0x10b115,_0x43f2da){return db['Campaign'][_0xe486('0x4c')](_0x10b115[_0xe486('0x4d')],{})['then'](function(_0x3bc7dd){var _0x26e8c5=_0x10b115[_0xe486('0x4e')][_0xe486('0x4f')]({'plain':!![]});if(!_0x26e8c5)throw new Error(_0xe486('0x50'));if(_0x26e8c5[_0xe486('0x51')]==='user'){var _0x1c8ad5=_0x3bc7dd[_0xe486('0x4f')]({'plain':!![]});var _0x4e781c=_0xe486('0x2a');return db[_0xe486('0x52')][_0xe486('0x4b')]({'where':{'name':_0x4e781c,'userProfileId':_0x26e8c5[_0xe486('0x53')]},'raw':!![]})[_0xe486('0x28')](function(_0x319585){if(_0x319585&&_0x319585[_0xe486('0x54')]===0x0){return db[_0xe486('0x2b')][_0xe486('0x4c')]({'name':_0x1c8ad5[_0xe486('0x2e')],'resourceId':_0x1c8ad5['id'],'type':_0x319585['name'],'sectionId':_0x319585['id']},{})[_0xe486('0x28')](function(){return _0x3bc7dd;});}else{return _0x3bc7dd;}})[_0xe486('0x48')](function(_0x3c9cf2){logger[_0xe486('0x2c')](_0xe486('0x55'),_0x3c9cf2);throw _0x3c9cf2;});}return _0x3bc7dd;})[_0xe486('0x28')](respondWithResult(_0x43f2da,0xc9))['catch'](handleError(_0x43f2da,null));};exports[_0xe486('0x56')]=function(_0x1592d5,_0x4df7c6){var _0x31e57a={'where':{'id':_0x1592d5['params']['id']}},_0x4de708={};_0x4de708[_0xe486('0x34')]=_[_0xe486('0x37')](db[_0xe486('0x44')]['rawAttributes']);_0x31e57a[_0xe486('0x39')]=_['intersection'](_0x4de708[_0xe486('0x34')],qs['fields'](_0x1592d5[_0xe486('0x36')]['fields']));_0x31e57a['attributes']=_0x31e57a['attributes'][_0xe486('0x3b')]?_0x31e57a[_0xe486('0x39')]:_0x4de708[_0xe486('0x34')];if(_0x1592d5[_0xe486('0x36')][_0xe486('0x45')]){_0x31e57a[_0xe486('0x57')]=[{'all':!![]}];}_0x31e57a=_['merge']({},_0x31e57a,_0x1592d5['options']);return db[_0xe486('0x44')]['find'](_0x31e57a)[_0xe486('0x28')](handleEntityNotFound(_0x4df7c6,null))[_0xe486('0x28')](function(_0x1b96f1){if(_0x1b96f1){var _0x50732c=_0x1b96f1['get']({'plain':!![]});_0x50732c=qs[_0xe486('0x58')](_0x50732c,['id',_0xe486('0x59'),_0xe486('0x5a')]);_0x1592d5[_0xe486('0x4d')]=_[_0xe486('0x58')](_0x1592d5[_0xe486('0x4d')],['id',_0xe486('0x59'),_0xe486('0x5a')]);return db[_0xe486('0x44')]['create'](_['merge'](_0x50732c,_0x1592d5[_0xe486('0x4d')]),{'include':_0x1592d5[_0xe486('0x36')][_0xe486('0x45')]?[{'all':!![]}]:undefined})[_0xe486('0x28')](function(_0x358bce){var _0x2ec277=_0x1592d5['user']['get']({'plain':!![]});if(!_0x2ec277)throw new Error(_0xe486('0x50'));if(_0x2ec277[_0xe486('0x51')]===_0xe486('0x4e')){var _0x148bad=_0x358bce[_0xe486('0x4f')]({'plain':!![]});var _0x33f2f6='IvrCampaigns';return db[_0xe486('0x52')][_0xe486('0x4b')]({'where':{'name':_0x33f2f6,'userProfileId':_0x2ec277[_0xe486('0x53')]},'raw':!![]})[_0xe486('0x28')](function(_0x512d18){if(_0x512d18&&_0x512d18[_0xe486('0x54')]===0x0){return db[_0xe486('0x2b')]['create']({'name':_0x148bad[_0xe486('0x2e')],'resourceId':_0x148bad['id'],'type':_0x512d18[_0xe486('0x2e')],'sectionId':_0x512d18['id']},{})[_0xe486('0x28')](function(){return _0x358bce;});}else{return _0x358bce;}})[_0xe486('0x48')](function(_0x4feeb5){logger[_0xe486('0x2c')](_0xe486('0x55'),_0x4feeb5);throw _0x4feeb5;});}return _0x358bce;});}})[_0xe486('0x28')](respondWithResult(_0x4df7c6,0xc9))[_0xe486('0x48')](handleError(_0x4df7c6,null));};exports['update']=function(_0x39a093,_0x290dc1){if(_0x39a093[_0xe486('0x4d')]['id']){delete _0x39a093[_0xe486('0x4d')]['id'];}return db[_0xe486('0x44')][_0xe486('0x4b')]({'where':{'id':_0x39a093[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x290dc1,null))['then'](saveUpdates(_0x39a093[_0xe486('0x4d')],null))[_0xe486('0x28')](respondWithResult(_0x290dc1,null))[_0xe486('0x48')](handleError(_0x290dc1,null));};exports[_0xe486('0x29')]=function(_0x8f0b78,_0x276742){return db['Campaign']['find']({'where':{'id':_0x8f0b78[_0xe486('0x5b')]['id']}})['then'](handleEntityNotFound(_0x276742,null))[_0xe486('0x28')](removeEntity(_0x276742,null))[_0xe486('0x48')](handleError(_0x276742,null));};exports[_0xe486('0x5c')]=function(_0x1dfdc0,_0x2bec02,_0x22b50d){var _0x696632={'raw':!![],'where':{}};var _0x183700={};var _0x12863d={'count':0x0,'rows':[]};return db[_0xe486('0x44')][_0xe486('0x5d')]({'where':{'id':_0x1dfdc0[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x2bec02,null))[_0xe486('0x28')](function(_0x333a1f){if(_0x333a1f){_0x183700['model']=_['keys'](db['CmHopper'][_0xe486('0x30')]);_0x183700[_0xe486('0x36')]=_['keys'](_0x1dfdc0[_0xe486('0x36')]);_0x183700[_0xe486('0x38')]=_['intersection'](_0x183700['model'],_0x183700[_0xe486('0x36')]);_0x696632[_0xe486('0x39')]=_['intersection'](_0x183700['model'],qs[_0xe486('0x3a')](_0x1dfdc0[_0xe486('0x36')][_0xe486('0x3a')]));_0x696632[_0xe486('0x39')]=_0x696632['attributes'][_0xe486('0x3b')]?_0x696632[_0xe486('0x39')]:_0x183700[_0xe486('0x34')];if(!_0x1dfdc0[_0xe486('0x36')][_0xe486('0x5e')]('nolimit')){_0x696632[_0xe486('0x21')]=qs[_0xe486('0x21')](_0x1dfdc0[_0xe486('0x36')]['limit']);_0x696632[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x1dfdc0['query'][_0xe486('0x22')]);}_0x696632[_0xe486('0x3d')]=qs['sort'](_0x1dfdc0['query'][_0xe486('0x3e')]);_0x696632[_0xe486('0x40')]=qs[_0xe486('0x38')](_[_0xe486('0x3f')](_0x1dfdc0[_0xe486('0x36')],_0x183700[_0xe486('0x38')]));_0x696632[_0xe486('0x40')][_0xe486('0x5f')]=_0x333a1f['id'];if(_0x1dfdc0['query'][_0xe486('0x60')]){_0x696632['where']=_[_0xe486('0x42')](_0x696632['where'],{'$or':_[_0xe486('0x35')](_0x696632[_0xe486('0x39')],function(_0x193204){var _0x403cb1={};_0x403cb1[_0x193204]={'$like':'%'+_0x1dfdc0[_0xe486('0x36')]['filter']+'%'};return _0x403cb1;})});}_0x696632=_[_0xe486('0x42')]({},_0x696632,_0x1dfdc0[_0xe486('0x43')]);return db[_0xe486('0x61')][_0xe486('0x23')]({'where':_0x696632['where']})[_0xe486('0x28')](function(_0x43a082){_0x12863d['count']=_0x43a082;if(_0x1dfdc0['query']['includeAll']){_0x696632[_0xe486('0x57')]=[{'all':!![]}];}return db['CmHopper'][_0xe486('0x46')](_0x696632);})[_0xe486('0x28')](function(_0x17f9c9){_0x12863d['rows']=_0x17f9c9;return _0x12863d;});}})[_0xe486('0x28')](respondWithFilteredResult(_0x2bec02,_0x696632))[_0xe486('0x48')](handleError(_0x2bec02,null));};exports[_0xe486('0x62')]=function(_0x1c092d,_0x4ea43e,_0x341960){var _0x2f28f5={'raw':!![],'where':{}};var _0x351154={};var _0x394eca={'count':0x0,'rows':[]};return db[_0xe486('0x44')][_0xe486('0x5d')]({'where':{'id':_0x1c092d[_0xe486('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4ea43e,null))[_0xe486('0x28')](function(_0x3603d2){if(_0x3603d2){_0x351154[_0xe486('0x34')]=_[_0xe486('0x37')](db[_0xe486('0x63')]['rawAttributes']);_0x351154['query']=_[_0xe486('0x37')](_0x1c092d[_0xe486('0x36')]);_0x351154[_0xe486('0x38')]=_[_0xe486('0x4a')](_0x351154[_0xe486('0x34')],_0x351154[_0xe486('0x36')]);_0x2f28f5[_0xe486('0x39')]=_['intersection'](_0x351154[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x1c092d[_0xe486('0x36')]['fields']));_0x2f28f5[_0xe486('0x39')]=_0x2f28f5[_0xe486('0x39')][_0xe486('0x3b')]?_0x2f28f5[_0xe486('0x39')]:_0x351154[_0xe486('0x34')];if(!_0x1c092d[_0xe486('0x36')][_0xe486('0x5e')](_0xe486('0x3c'))){_0x2f28f5[_0xe486('0x21')]=qs[_0xe486('0x21')](_0x1c092d[_0xe486('0x36')][_0xe486('0x21')]);_0x2f28f5[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x1c092d[_0xe486('0x36')]['offset']);}_0x2f28f5[_0xe486('0x3d')]=qs[_0xe486('0x3e')](_0x1c092d[_0xe486('0x36')][_0xe486('0x3e')]);_0x2f28f5[_0xe486('0x40')]=qs[_0xe486('0x38')](_[_0xe486('0x3f')](_0x1c092d[_0xe486('0x36')],_0x351154[_0xe486('0x38')]));_0x2f28f5[_0xe486('0x40')][_0xe486('0x5f')]=_0x3603d2['id'];if(_0x1c092d[_0xe486('0x36')][_0xe486('0x60')]){_0x2f28f5[_0xe486('0x40')]=_[_0xe486('0x42')](_0x2f28f5[_0xe486('0x40')],{'$or':_[_0xe486('0x35')](_0x2f28f5['attributes'],function(_0x4d0144){var _0x540206={};_0x540206[_0x4d0144]={'$like':'%'+_0x1c092d[_0xe486('0x36')][_0xe486('0x60')]+'%'};return _0x540206;})});}_0x2f28f5=_['merge']({},_0x2f28f5,_0x1c092d[_0xe486('0x43')]);return db[_0xe486('0x63')]['count']({'where':_0x2f28f5[_0xe486('0x40')]})[_0xe486('0x28')](function(_0x2b16ed){_0x394eca[_0xe486('0x23')]=_0x2b16ed;if(_0x1c092d[_0xe486('0x36')][_0xe486('0x45')]){_0x2f28f5[_0xe486('0x57')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xe486('0x46')](_0x2f28f5);})[_0xe486('0x28')](function(_0x10678b){_0x394eca['rows']=_0x10678b;return _0x394eca;});}})[_0xe486('0x28')](respondWithFilteredResult(_0x4ea43e,_0x2f28f5))[_0xe486('0x48')](handleError(_0x4ea43e,null));};exports[_0xe486('0x64')]=function(_0x3e2a12,_0x5b6052,_0x14bd14){var _0x63f070={'raw':!![],'where':{}};var _0xd82fd4={};var _0x13b8ec={'count':0x0,'rows':[]};return db[_0xe486('0x44')][_0xe486('0x5d')]({'where':{'id':_0x3e2a12[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x5b6052,null))[_0xe486('0x28')](function(_0x3e15e1){if(_0x3e15e1){_0xd82fd4[_0xe486('0x34')]=_[_0xe486('0x37')](db['CmHopperFinal'][_0xe486('0x30')]);_0xd82fd4[_0xe486('0x36')]=_[_0xe486('0x37')](_0x3e2a12['query']);_0xd82fd4[_0xe486('0x38')]=_[_0xe486('0x4a')](_0xd82fd4['model'],_0xd82fd4[_0xe486('0x36')]);_0x63f070[_0xe486('0x39')]=_[_0xe486('0x4a')](_0xd82fd4[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x3e2a12[_0xe486('0x36')]['fields']));_0x63f070[_0xe486('0x39')]=_0x63f070['attributes'][_0xe486('0x3b')]?_0x63f070[_0xe486('0x39')]:_0xd82fd4[_0xe486('0x34')];if(!_0x3e2a12['query'][_0xe486('0x5e')](_0xe486('0x3c'))){_0x63f070[_0xe486('0x21')]=qs[_0xe486('0x21')](_0x3e2a12[_0xe486('0x36')][_0xe486('0x21')]);_0x63f070[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x3e2a12[_0xe486('0x36')][_0xe486('0x22')]);}_0x63f070[_0xe486('0x3d')]=qs[_0xe486('0x3e')](_0x3e2a12[_0xe486('0x36')][_0xe486('0x3e')]);_0x63f070[_0xe486('0x40')]=qs[_0xe486('0x38')](_[_0xe486('0x3f')](_0x3e2a12[_0xe486('0x36')],_0xd82fd4['filters']));_0x63f070[_0xe486('0x40')][_0xe486('0x5f')]=_0x3e15e1['id'];if(_0x3e2a12['query'][_0xe486('0x60')]){_0x63f070[_0xe486('0x40')]=_[_0xe486('0x42')](_0x63f070['where'],{'$or':_[_0xe486('0x35')](_0x63f070['attributes'],function(_0x37c8c8){var _0x4537e3={};_0x4537e3[_0x37c8c8]={'$like':'%'+_0x3e2a12['query'][_0xe486('0x60')]+'%'};return _0x4537e3;})});}_0x63f070=_[_0xe486('0x42')]({},_0x63f070,_0x3e2a12['options']);return db[_0xe486('0x65')][_0xe486('0x23')]({'where':_0x63f070['where']})[_0xe486('0x28')](function(_0x20e28c){_0x13b8ec['count']=_0x20e28c;if(_0x3e2a12[_0xe486('0x36')][_0xe486('0x45')]){_0x63f070[_0xe486('0x57')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xe486('0x46')](_0x63f070);})[_0xe486('0x28')](function(_0x216ea8){_0x13b8ec['rows']=_0x216ea8;return _0x13b8ec;});}})[_0xe486('0x28')](respondWithFilteredResult(_0x5b6052,_0x63f070))[_0xe486('0x48')](handleError(_0x5b6052,null));};exports[_0xe486('0x66')]=function(_0x31f489,_0x1ef654,_0x2c583f){var _0x4ebc75={'raw':!![],'where':{}};var _0x1b0f9d={};var _0x57fe91={'count':0x0,'rows':[]};return db[_0xe486('0x44')]['findOne']({'where':{'id':_0x31f489['params']['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x1ef654,null))['then'](function(_0x44b4af){if(_0x44b4af){_0x1b0f9d[_0xe486('0x34')]=_[_0xe486('0x37')](db[_0xe486('0x67')][_0xe486('0x30')]);_0x1b0f9d[_0xe486('0x36')]=_[_0xe486('0x37')](_0x31f489[_0xe486('0x36')]);_0x1b0f9d[_0xe486('0x38')]=_['intersection'](_0x1b0f9d[_0xe486('0x34')],_0x1b0f9d['query']);_0x4ebc75[_0xe486('0x39')]=_[_0xe486('0x4a')](_0x1b0f9d[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x31f489[_0xe486('0x36')][_0xe486('0x3a')]));_0x4ebc75[_0xe486('0x39')]=_0x4ebc75['attributes'][_0xe486('0x3b')]?_0x4ebc75[_0xe486('0x39')]:_0x1b0f9d[_0xe486('0x34')];if(!_0x31f489[_0xe486('0x36')]['hasOwnProperty'](_0xe486('0x3c'))){_0x4ebc75[_0xe486('0x21')]=qs['limit'](_0x31f489[_0xe486('0x36')][_0xe486('0x21')]);_0x4ebc75[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x31f489['query']['offset']);}_0x4ebc75[_0xe486('0x3d')]=qs[_0xe486('0x3e')](_0x31f489[_0xe486('0x36')]['sort']);_0x4ebc75['where']=qs['filters'](_[_0xe486('0x3f')](_0x31f489['query'],_0x1b0f9d[_0xe486('0x38')]));_0x4ebc75[_0xe486('0x40')][_0xe486('0x5f')]=_0x44b4af['id'];if(_0x31f489[_0xe486('0x36')][_0xe486('0x60')]){_0x4ebc75[_0xe486('0x40')]=_[_0xe486('0x42')](_0x4ebc75[_0xe486('0x40')],{'$or':_[_0xe486('0x35')](_0x4ebc75['attributes'],function(_0x521de9){var _0x15ac77={};_0x15ac77[_0x521de9]={'$like':'%'+_0x31f489[_0xe486('0x36')][_0xe486('0x60')]+'%'};return _0x15ac77;})});}_0x4ebc75=_[_0xe486('0x42')]({},_0x4ebc75,_0x31f489[_0xe486('0x43')]);return db[_0xe486('0x67')][_0xe486('0x23')]({'where':_0x4ebc75[_0xe486('0x40')]})['then'](function(_0x379e25){_0x57fe91[_0xe486('0x23')]=_0x379e25;if(_0x31f489['query'][_0xe486('0x45')]){_0x4ebc75[_0xe486('0x57')]=[{'all':!![]}];}return db[_0xe486('0x67')][_0xe486('0x46')](_0x4ebc75);})['then'](function(_0x512151){_0x57fe91[_0xe486('0x47')]=_0x512151;return _0x57fe91;});}})[_0xe486('0x28')](respondWithFilteredResult(_0x1ef654,_0x4ebc75))[_0xe486('0x48')](handleError(_0x1ef654,null));};exports[_0xe486('0x68')]=function(_0x27dbdd,_0x3775c8,_0x5d1e03){var _0x5dbec8={};var _0x884f99={};var _0x1d0271;var _0x178857;return db[_0xe486('0x44')][_0xe486('0x5d')]({'where':{'id':_0x27dbdd['params']['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x3775c8,null))[_0xe486('0x28')](function(_0x4867f9){if(_0x4867f9){_0x1d0271=_0x4867f9;_0x884f99[_0xe486('0x34')]=_[_0xe486('0x37')](db[_0xe486('0x69')][_0xe486('0x30')]);_0x884f99[_0xe486('0x36')]=_[_0xe486('0x37')](_0x27dbdd[_0xe486('0x36')]);_0x884f99[_0xe486('0x38')]=_[_0xe486('0x4a')](_0x884f99[_0xe486('0x34')],_0x884f99[_0xe486('0x36')]);_0x5dbec8[_0xe486('0x39')]=_[_0xe486('0x4a')](_0x884f99[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x27dbdd[_0xe486('0x36')][_0xe486('0x3a')]));_0x5dbec8['attributes']=_0x5dbec8[_0xe486('0x39')][_0xe486('0x3b')]?_0x5dbec8['attributes']:_0x884f99[_0xe486('0x34')];_0x5dbec8[_0xe486('0x3d')]=qs['sort'](_0x27dbdd[_0xe486('0x36')][_0xe486('0x3e')]);_0x5dbec8['where']=qs['filters'](_[_0xe486('0x3f')](_0x27dbdd[_0xe486('0x36')],_0x884f99[_0xe486('0x38')]));if(_0x27dbdd[_0xe486('0x36')][_0xe486('0x60')]){_0x5dbec8[_0xe486('0x40')]=_['merge'](_0x5dbec8[_0xe486('0x40')],{'$or':_[_0xe486('0x35')](_0x5dbec8[_0xe486('0x39')],function(_0x2d57a7){var _0x46fd1b={};_0x46fd1b[_0x2d57a7]={'$like':'%'+_0x27dbdd['query']['filter']+'%'};return _0x46fd1b;})});}_0x5dbec8=_[_0xe486('0x42')]({},_0x5dbec8,_0x27dbdd[_0xe486('0x43')]);return _0x1d0271['getLists'](_0x5dbec8);}})[_0xe486('0x28')](function(_0xaa4f8){if(_0xaa4f8){_0x178857=_0xaa4f8[_0xe486('0x3b')];if(!_0x27dbdd[_0xe486('0x36')]['hasOwnProperty'](_0xe486('0x3c'))){_0x5dbec8[_0xe486('0x21')]=qs[_0xe486('0x21')](_0x27dbdd[_0xe486('0x36')][_0xe486('0x21')]);_0x5dbec8[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x27dbdd[_0xe486('0x36')][_0xe486('0x22')]);}return _0x1d0271[_0xe486('0x68')](_0x5dbec8);}})[_0xe486('0x28')](function(_0x364af4){if(_0x364af4){return _0x364af4?{'count':_0x178857,'rows':_0x364af4}:null;}})[_0xe486('0x28')](respondWithResult(_0x3775c8,null))[_0xe486('0x48')](handleError(_0x3775c8,null));};exports['addLists']=function(_0x506598,_0x5a2dd0,_0x37fc31){var _0x2f25ed,_0x414e50;var _0x4e2250=[];var _0x491543=moment()[_0xe486('0x6a')](_0xe486('0x6b'));return db[_0xe486('0x44')][_0xe486('0x4b')]({'where':{'id':_0x506598[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x5a2dd0,null))[_0xe486('0x28')](function(_0xf214d8){if(_0xf214d8){_0x414e50=_0xf214d8;return _0xf214d8['addLists'](_0x506598['body'][_0xe486('0x6c')],_[_0xe486('0x58')](_0x506598[_0xe486('0x4d')],[_0xe486('0x6c'),'id'])||{});}return null;})['spread'](function(_0x1289e5){var _0x439f75;var _0x7bf3ff;_0x2f25ed=_0x1289e5||[];var _0x369b45=[];if(_0x1289e5){for(var _0x14d9ed=0x0;_0x14d9ed<_0x1289e5[_0xe486('0x3b')];_0x14d9ed+=0x1){var _0x1f953d=_0x1289e5[_0x14d9ed][_0xe486('0x4f')]({'plain':!![]});_0x414e50['dialCheckDuplicateType']=_0x506598[_0xe486('0x4d')]['dialCheckDuplicateType']?_0x506598[_0xe486('0x4d')]['dialCheckDuplicateType']:_0x414e50[_0xe486('0x6d')];switch(_0x414e50['dialCheckDuplicateType']){case _0xe486('0x6e'):_0x439f75=squel[_0xe486('0x6f')]()['into'](_0xe486('0x70'))[_0xe486('0x71')]([_0xe486('0x72'),_0xe486('0x73'),_0xe486('0x74'),_0xe486('0x75'),_0xe486('0x5f'),_0xe486('0x59'),'updatedAt'],squel['select']()[_0xe486('0x76')](_0xe486('0x72'),_0xe486('0x72'))[_0xe486('0x76')](_0xe486('0x77'),_0xe486('0x73'))[_0xe486('0x76')]('id',_0xe486('0x74'))['field'](_0x1f953d[_0xe486('0x78')]['toString'](),_0xe486('0x75'))[_0xe486('0x76')](_0x506598[_0xe486('0x5b')]['id']['toString'](),'CampaignId')['field']('\x27'+_0x491543+'\x27',_0xe486('0x59'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27',_0xe486('0x5a'))[_0xe486('0x79')](_0xe486('0x7a'))[_0xe486('0x40')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x1f953d[_0xe486('0x78')][_0xe486('0x7b')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xe486('0x40')](_0xe486('0x7c'),squel[_0xe486('0x7d')]()[_0xe486('0x76')](_0xe486('0x7e'))[_0xe486('0x79')](_0xe486('0x7f'))[_0xe486('0x40')](_0xe486('0x80'),_0x506598[_0xe486('0x5b')]['id'][_0xe486('0x7b')]()))[_0xe486('0x40')](_0xe486('0x7c'),squel[_0xe486('0x7d')]()[_0xe486('0x76')](_0xe486('0x81'))[_0xe486('0x79')](_0xe486('0x70'))[_0xe486('0x40')](_0xe486('0x80'),_0x506598[_0xe486('0x5b')]['id']['toString']())))[_0xe486('0x7b')]();break;case _0xe486('0x82'):_0x439f75=squel['insert']()[_0xe486('0x83')](_0xe486('0x70'))[_0xe486('0x71')]([_0xe486('0x72'),'scheduledAt','ContactId','ListId','CampaignId',_0xe486('0x59'),_0xe486('0x5a')],squel[_0xe486('0x7d')]()[_0xe486('0x76')](_0xe486('0x72'),_0xe486('0x72'))[_0xe486('0x76')]('NOW()',_0xe486('0x73'))[_0xe486('0x76')]('id',_0xe486('0x74'))[_0xe486('0x76')](_0x1f953d[_0xe486('0x78')]['toString'](),_0xe486('0x75'))['field'](_0x506598['params']['id'][_0xe486('0x7b')](),_0xe486('0x5f'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27',_0xe486('0x59'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27',_0xe486('0x5a'))[_0xe486('0x79')](_0xe486('0x7a'))[_0xe486('0x40')](_0xe486('0x84'))[_0xe486('0x40')]('ListId\x20=\x20?',_0x1f953d[_0xe486('0x78')][_0xe486('0x7b')]())['where'](_0xe486('0x85'))['where'](_0xe486('0x7c'),squel[_0xe486('0x7d')]()[_0xe486('0x76')]('COALESCE(phone,\x27\x27)')[_0xe486('0x79')](_0xe486('0x70'))['where'](_0xe486('0x80'),_0x506598[_0xe486('0x5b')]['id'][_0xe486('0x7b')]())))[_0xe486('0x7b')]();break;default:_0x439f75=squel[_0xe486('0x6f')]()[_0xe486('0x83')]('cm_hopper')[_0xe486('0x71')](['phone',_0xe486('0x73'),_0xe486('0x74'),'ListId',_0xe486('0x5f'),_0xe486('0x59'),_0xe486('0x5a')],squel[_0xe486('0x7d')]()[_0xe486('0x76')](_0xe486('0x72'),'phone')[_0xe486('0x76')](_0xe486('0x77'),_0xe486('0x73'))['field']('id',_0xe486('0x74'))[_0xe486('0x76')](_0x1f953d[_0xe486('0x78')]['toString'](),_0xe486('0x75'))[_0xe486('0x76')](_0x506598[_0xe486('0x5b')]['id'][_0xe486('0x7b')](),_0xe486('0x5f'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27',_0xe486('0x59'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27',_0xe486('0x5a'))[_0xe486('0x79')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xe486('0x40')](_0xe486('0x86'),_0x1f953d[_0xe486('0x78')][_0xe486('0x7b')]())[_0xe486('0x40')](_0xe486('0x85')))[_0xe486('0x7b')]();}_0x7bf3ff=squel[_0xe486('0x6f')]()[_0xe486('0x83')](_0xe486('0x87'))[_0xe486('0x71')](['cmHopperId',_0xe486('0x73'),_0xe486('0x72'),_0xe486('0x88'),_0xe486('0x59'),_0xe486('0x5a')],squel['select']()[_0xe486('0x76')]('h.id','id')[_0xe486('0x76')]('NOW()','scheduledAt')[_0xe486('0x76')]('ci.item',_0xe486('0x72'))[_0xe486('0x76')](_0xe486('0x89'),_0xe486('0x88'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27','createdAt')[_0xe486('0x76')]('\x27'+_0x491543+'\x27','updatedAt')[_0xe486('0x79')]('cm_contact_has_items','ci')[_0xe486('0x8a')]('cm_hopper','h',_0xe486('0x8b'))[_0xe486('0x40')]('h.ListId\x20=\x20?',_0x1f953d[_0xe486('0x78')]['toString']())[_0xe486('0x40')](_0xe486('0x8c'),_0x506598[_0xe486('0x5b')]['id'][_0xe486('0x7b')]())['where'](_0xe486('0x8d'),_0x491543))['toString']();_0x369b45[_0xe486('0x8e')](db[_0xe486('0x8f')][_0xe486('0x36')](_0x439f75));_0x4e2250[_0xe486('0x8e')](db[_0xe486('0x8f')][_0xe486('0x36')](_0x7bf3ff));}return BPromise[_0xe486('0x90')](_0x369b45);}})[_0xe486('0x28')](function(){return BPromise[_0xe486('0x90')](_0x4e2250);})[_0xe486('0x28')](function(){return _0x2f25ed;})[_0xe486('0x28')](respondWithResult(_0x5a2dd0,null))[_0xe486('0x48')](handleError(_0x5a2dd0,null));};exports[_0xe486('0x91')]=function(_0x319924,_0x11fc68,_0x36f91f){return db[_0xe486('0x44')][_0xe486('0x4b')]({'where':{'id':_0x319924['params']['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x11fc68,null))[_0xe486('0x28')](function(_0x382cdd){if(_0x382cdd){return _0x382cdd[_0xe486('0x91')](_0x319924[_0xe486('0x36')][_0xe486('0x6c')]);}})['then'](function(_0x4c032d){if(_0x4c032d){return db[_0xe486('0x61')]['destroy']({'where':{'ListId':_0x319924[_0xe486('0x36')][_0xe486('0x6c')],'CampaignId':_0x319924['params']['id']}})['then'](function(){return _0x4c032d;});}})[_0xe486('0x28')](respondWithStatusCode(_0x11fc68,null))['catch'](handleError(_0x11fc68,null));};exports[_0xe486('0x92')]=function(_0x40e0f3,_0x53b45d,_0x1a804d){var _0x23c08a={};var _0x42379b={};var _0xeb13bf;var _0x4314a8;return db[_0xe486('0x44')][_0xe486('0x5d')]({'where':{'id':_0x40e0f3[_0xe486('0x5b')]['id']}})['then'](handleEntityNotFound(_0x53b45d,null))['then'](function(_0x660778){if(_0x660778){_0xeb13bf=_0x660778;_0x42379b['model']=_[_0xe486('0x37')](db[_0xe486('0x69')]['rawAttributes']);_0x42379b[_0xe486('0x36')]=_[_0xe486('0x37')](_0x40e0f3['query']);_0x42379b[_0xe486('0x38')]=_[_0xe486('0x4a')](_0x42379b[_0xe486('0x34')],_0x42379b[_0xe486('0x36')]);_0x23c08a[_0xe486('0x39')]=_[_0xe486('0x4a')](_0x42379b[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x40e0f3[_0xe486('0x36')][_0xe486('0x3a')]));_0x23c08a[_0xe486('0x39')]=_0x23c08a['attributes']['length']?_0x23c08a[_0xe486('0x39')]:_0x42379b[_0xe486('0x34')];_0x23c08a[_0xe486('0x3d')]=qs[_0xe486('0x3e')](_0x40e0f3[_0xe486('0x36')][_0xe486('0x3e')]);_0x23c08a[_0xe486('0x40')]=qs[_0xe486('0x38')](_['pick'](_0x40e0f3[_0xe486('0x36')],_0x42379b[_0xe486('0x38')]));if(_0x40e0f3[_0xe486('0x36')][_0xe486('0x60')]){_0x23c08a[_0xe486('0x40')]=_[_0xe486('0x42')](_0x23c08a[_0xe486('0x40')],{'$or':_[_0xe486('0x35')](_0x23c08a[_0xe486('0x39')],function(_0x2e8d19){var _0x8bc29c={};_0x8bc29c[_0x2e8d19]={'$like':'%'+_0x40e0f3[_0xe486('0x36')]['filter']+'%'};return _0x8bc29c;})});}_0x23c08a=_[_0xe486('0x42')]({},_0x23c08a,_0x40e0f3['options']);return _0xeb13bf['getBlackLists'](_0x23c08a);}})[_0xe486('0x28')](function(_0x2ca599){if(_0x2ca599){_0x4314a8=_0x2ca599['length'];if(!_0x40e0f3[_0xe486('0x36')][_0xe486('0x5e')](_0xe486('0x3c'))){_0x23c08a[_0xe486('0x21')]=qs['limit'](_0x40e0f3[_0xe486('0x36')]['limit']);_0x23c08a[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x40e0f3[_0xe486('0x36')][_0xe486('0x22')]);}return _0xeb13bf['getBlackLists'](_0x23c08a);}})[_0xe486('0x28')](function(_0x2b863d){if(_0x2b863d){return _0x2b863d?{'count':_0x4314a8,'rows':_0x2b863d}:null;}})[_0xe486('0x28')](respondWithResult(_0x53b45d,null))[_0xe486('0x48')](handleError(_0x53b45d,null));};exports['addBlackLists']=function(_0x501d3f,_0x9c7f9b,_0x1fe136){var _0x248db2,_0xba5703;var _0x250045=[];var _0x4f874d=moment()[_0xe486('0x6a')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xe486('0x44')][_0xe486('0x4b')]({'where':{'id':_0x501d3f[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x9c7f9b,null))['then'](function(_0x73e5c5){if(_0x73e5c5){_0xba5703=_0x73e5c5;return _0x73e5c5['addBlackLists'](_0x501d3f[_0xe486('0x4d')]['ids'],_[_0xe486('0x58')](_0x501d3f[_0xe486('0x4d')],[_0xe486('0x6c'),'id'])||{});}return null;})[_0xe486('0x93')](function(_0x4dddb2){var _0x2fbc7c;var _0x2bfd7c;_0x248db2=_0x4dddb2||[];var _0x2ec0d7=[];if(_0x4dddb2){for(var _0x10b6b9=0x0;_0x10b6b9<_0x4dddb2[_0xe486('0x3b')];_0x10b6b9+=0x1){var _0x3d2c9c=_0x4dddb2[_0x10b6b9]['get']({'plain':!![]});_0x2fbc7c=squel['insert']()[_0xe486('0x83')](_0xe486('0x94'))[_0xe486('0x71')]([_0xe486('0x72'),_0xe486('0x74'),_0xe486('0x75'),_0xe486('0x5f'),_0xe486('0x59'),_0xe486('0x5a')],squel[_0xe486('0x7d')]()[_0xe486('0x76')](_0xe486('0x72'),_0xe486('0x72'))['field']('id','ContactId')[_0xe486('0x76')](_0x3d2c9c[_0xe486('0x78')][_0xe486('0x7b')](),'ListId')['field'](_0x501d3f['params']['id']['toString'](),_0xe486('0x5f'))['field'](_0xe486('0x77'),'createdAt')[_0xe486('0x76')](_0xe486('0x77'),_0xe486('0x5a'))[_0xe486('0x79')](_0xe486('0x7a'))['where'](_0xe486('0x84'))[_0xe486('0x40')]('ListId\x20=\x20?',_0x3d2c9c[_0xe486('0x78')][_0xe486('0x7b')]())[_0xe486('0x40')](_0xe486('0x85')))[_0xe486('0x7b')]();_0x2ec0d7[_0xe486('0x8e')](db[_0xe486('0x8f')][_0xe486('0x36')](_0x2fbc7c));}return BPromise[_0xe486('0x90')](_0x2ec0d7);}})[_0xe486('0x28')](function(){return _0x248db2;})[_0xe486('0x28')](respondWithResult(_0x9c7f9b,null))['catch'](handleError(_0x9c7f9b,null));};exports[_0xe486('0x95')]=function(_0x5b6077,_0x4e28c6,_0x32d8ba){return db['Campaign']['find']({'where':{'id':_0x5b6077[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x4e28c6,null))[_0xe486('0x28')](function(_0xc7e200){if(_0xc7e200){return _0xc7e200[_0xe486('0x95')](_0x5b6077[_0xe486('0x36')][_0xe486('0x6c')]);}})[_0xe486('0x28')](function(_0x2a9cb9){if(_0x2a9cb9){return db[_0xe486('0x67')]['destroy']({'where':{'ListId':_0x5b6077[_0xe486('0x36')]['ids'],'CampaignId':_0x5b6077[_0xe486('0x5b')]['id']}})['then'](function(){return _0x2a9cb9;});}})[_0xe486('0x28')](respondWithStatusCode(_0x4e28c6,null))[_0xe486('0x48')](handleError(_0x4e28c6,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 83f905f..c78862d 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x3fa545,_0x19ff03){var _0x12b6dc=function(_0x112cb8){while(--_0x112cb8){_0x3fa545['push'](_0x3fa545['shift']());}};_0x12b6dc(++_0x19ff03);}(_0x7a54,0x106));var _0x47a5=function(_0x2085ad,_0x4cbb6e){_0x2085ad=_0x2085ad-0x0;var _0x177ddb=_0x7a54[_0x2085ad];return _0x177ddb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index d780edb..1a05a11 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 _0xf257=['map','model','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include'];(function(_0x123e0d,_0x44229a){var _0x15a212=function(_0x449402){while(--_0x449402){_0x123e0d['push'](_0x123e0d['shift']());}};_0x15a212(++_0x44229a);}(_0xf257,0x82));var _0x7f25=function(_0x5db6cf,_0x321c5d){_0x5db6cf=_0x5db6cf-0x0;var _0x4f3521=_0xf257[_0x5db6cf];return _0x4f3521;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7f25('0x0'));var BPromise=require(_0x7f25('0x1'));var rs=require(_0x7f25('0x2'));var fs=require('fs');var Redis=require(_0x7f25('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f25('0x4'));var logger=require(_0x7f25('0x5'))(_0x7f25('0x6'));var config=require(_0x7f25('0x7'));var jayson=require(_0x7f25('0x8'));var client=jayson[_0x7f25('0x9')][_0x7f25('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x242a3e,_0x369a09,_0x16e278){return new BPromise(function(_0x31a5d8,_0x1ae607){return client[_0x7f25('0xb')](_0x242a3e,_0x16e278)[_0x7f25('0xc')](function(_0x57ba17){logger[_0x7f25('0xd')](_0x7f25('0xe'),_0x369a09,'request\x20sent');logger['debug'](_0x7f25('0xf'),_0x369a09,'request\x20sent',JSON[_0x7f25('0x10')](_0x57ba17));if(_0x57ba17[_0x7f25('0x11')]){if(_0x57ba17[_0x7f25('0x11')][_0x7f25('0x12')]===0x1f4){logger[_0x7f25('0x11')](_0x7f25('0xe'),_0x369a09,_0x57ba17[_0x7f25('0x11')]['message']);return _0x1ae607(_0x57ba17['error'][_0x7f25('0x13')]);}logger['error'](_0x7f25('0xe'),_0x369a09,_0x57ba17[_0x7f25('0x11')][_0x7f25('0x13')]);return _0x31a5d8(_0x57ba17[_0x7f25('0x11')][_0x7f25('0x13')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x369a09,'request\x20sent');_0x31a5d8(_0x57ba17[_0x7f25('0x14')][_0x7f25('0x13')]);}})[_0x7f25('0x15')](function(_0x167363){logger[_0x7f25('0x11')](_0x7f25('0xe'),_0x369a09,_0x167363);_0x1ae607(_0x167363);});});}exports[_0x7f25('0x16')]=function(_0x26d4aa){var _0x5e0067=this;return new Promise(function(_0x23f30c,_0x1cd6c1){return db[_0x7f25('0x17')][_0x7f25('0x18')]({'raw':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa[_0x7f25('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x26d4aa['options']?_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1a')]||null:null,'attributes':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1b')]||null:null,'limit':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1c')]||null:null,'include':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa['options'][_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1d')],function(_0x29039a){return{'model':db[_0x29039a['model']],'as':_0x29039a['as'],'attributes':_0x29039a[_0x7f25('0x1b')],'include':_0x29039a[_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x29039a['include'],function(_0x17b38c){return{'model':db[_0x17b38c['model']],'as':_0x17b38c['as'],'attributes':_0x17b38c[_0x7f25('0x1b')],'include':_0x17b38c[_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x17b38c[_0x7f25('0x1d')],function(_0x382fd4){return{'model':db[_0x382fd4[_0x7f25('0x1f')]],'as':_0x382fd4['as'],'attributes':_0x382fd4[_0x7f25('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7f25('0xc')](function(_0x44116d){logger[_0x7f25('0xd')]('GetCampaign',_0x26d4aa);logger['debug'](_0x7f25('0x16'),_0x26d4aa,JSON[_0x7f25('0x10')](_0x44116d));_0x23f30c(_0x44116d);})['catch'](function(_0xa373ee){logger[_0x7f25('0x11')](_0x7f25('0x16'),_0xa373ee[_0x7f25('0x13')],_0x26d4aa);_0x1cd6c1(_0x5e0067[_0x7f25('0x11')](0x1f4,_0xa373ee[_0x7f25('0x13')]));});});};
\ No newline at end of file
+var _0xd382=['options','raw','where','attributes','limit','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','info','Campaign,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll'];(function(_0x32397a,_0x486c0f){var _0x266af8=function(_0x336075){while(--_0x336075){_0x32397a['push'](_0x32397a['shift']());}};_0x266af8(++_0x486c0f);}(_0xd382,0x1b6));var _0x2d38=function(_0x5b4c12,_0x2fa6f7){_0x5b4c12=_0x5b4c12-0x0;var _0x12c608=_0xd382[_0x5b4c12];return _0x12c608;};'use strict';var _=require(_0x2d38('0x0'));var util=require(_0x2d38('0x1'));var moment=require(_0x2d38('0x2'));var BPromise=require(_0x2d38('0x3'));var rs=require(_0x2d38('0x4'));var fs=require('fs');var Redis=require(_0x2d38('0x5'));var db=require(_0x2d38('0x6'))['db'];var utils=require(_0x2d38('0x7'));var logger=require(_0x2d38('0x8'))(_0x2d38('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2d38('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e2919,_0x55ae65,_0x1296cb){return new BPromise(function(_0x3fb88f,_0x39ebfd){return client['request'](_0x1e2919,_0x1296cb)['then'](function(_0x5f20a4){logger[_0x2d38('0xb')](_0x2d38('0xc'),_0x55ae65,'request\x20sent');logger[_0x2d38('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x55ae65,_0x2d38('0xe'),JSON[_0x2d38('0xf')](_0x5f20a4));if(_0x5f20a4[_0x2d38('0x10')]){if(_0x5f20a4[_0x2d38('0x10')][_0x2d38('0x11')]===0x1f4){logger[_0x2d38('0x10')](_0x2d38('0xc'),_0x55ae65,_0x5f20a4['error'][_0x2d38('0x12')]);return _0x39ebfd(_0x5f20a4[_0x2d38('0x10')][_0x2d38('0x12')]);}logger[_0x2d38('0x10')](_0x2d38('0xc'),_0x55ae65,_0x5f20a4['error'][_0x2d38('0x12')]);return _0x3fb88f(_0x5f20a4[_0x2d38('0x10')][_0x2d38('0x12')]);}else{logger[_0x2d38('0xb')](_0x2d38('0xc'),_0x55ae65,_0x2d38('0xe'));_0x3fb88f(_0x5f20a4[_0x2d38('0x13')][_0x2d38('0x12')]);}})[_0x2d38('0x14')](function(_0x6d2a9a){logger[_0x2d38('0x10')](_0x2d38('0xc'),_0x55ae65,_0x6d2a9a);_0x39ebfd(_0x6d2a9a);});});}exports[_0x2d38('0x15')]=function(_0x1e3028){var _0x45c7a8=this;return new Promise(function(_0x9904e0,_0x56016e){return db[_0x2d38('0x16')][_0x2d38('0x17')]({'raw':_0x1e3028['options']?_0x1e3028[_0x2d38('0x18')][_0x2d38('0x19')]===undefined?!![]:![]:!![],'where':_0x1e3028[_0x2d38('0x18')]?_0x1e3028['options'][_0x2d38('0x1a')]||null:null,'attributes':_0x1e3028['options']?_0x1e3028['options'][_0x2d38('0x1b')]||null:null,'limit':_0x1e3028[_0x2d38('0x18')]?_0x1e3028[_0x2d38('0x18')][_0x2d38('0x1c')]||null:null,'include':_0x1e3028[_0x2d38('0x18')]?_0x1e3028[_0x2d38('0x18')][_0x2d38('0x1d')]?_[_0x2d38('0x1e')](_0x1e3028[_0x2d38('0x18')][_0x2d38('0x1d')],function(_0x584e1f){return{'model':db[_0x584e1f[_0x2d38('0x1f')]],'as':_0x584e1f['as'],'attributes':_0x584e1f['attributes'],'include':_0x584e1f[_0x2d38('0x1d')]?_['map'](_0x584e1f[_0x2d38('0x1d')],function(_0xfa9bd){return{'model':db[_0xfa9bd[_0x2d38('0x1f')]],'as':_0xfa9bd['as'],'attributes':_0xfa9bd[_0x2d38('0x1b')],'include':_0xfa9bd[_0x2d38('0x1d')]?_[_0x2d38('0x1e')](_0xfa9bd[_0x2d38('0x1d')],function(_0x529564){return{'model':db[_0x529564[_0x2d38('0x1f')]],'as':_0x529564['as'],'attributes':_0x529564[_0x2d38('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2d38('0x20')](function(_0x3d18cd){logger[_0x2d38('0xb')](_0x2d38('0x15'),_0x1e3028);logger[_0x2d38('0xd')](_0x2d38('0x15'),_0x1e3028,JSON['stringify'](_0x3d18cd));_0x9904e0(_0x3d18cd);})['catch'](function(_0x5570c2){logger[_0x2d38('0x10')](_0x2d38('0x15'),_0x5570c2[_0x2d38('0x12')],_0x1e3028);_0x56016e(_0x45c7a8['error'](0x1f4,_0x5570c2[_0x2d38('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index fadfdaa..909cfba 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 _0x02bc=['/:id/clone','clone','addLists','put','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x02bc,0x1d7));var _0xc02b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x02bc[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xc02b('0x0'));var util=require(_0xc02b('0x1'));var path=require(_0xc02b('0x2'));var timeout=require('connect-timeout');var express=require(_0xc02b('0x3'));var router=express[_0xc02b('0x4')]();var fs_extra=require(_0xc02b('0x5'));var auth=require(_0xc02b('0x6'));var interaction=require(_0xc02b('0x7'));var config=require(_0xc02b('0x8'));var controller=require('./campaign.controller');router[_0xc02b('0x9')]('/',auth[_0xc02b('0xa')](),controller[_0xc02b('0xb')]);router[_0xc02b('0x9')](_0xc02b('0xc'),auth[_0xc02b('0xa')](),controller[_0xc02b('0xd')]);router['get'](_0xc02b('0xe'),auth['isAuthenticated'](),controller[_0xc02b('0xf')]);router['get']('/:id/hopper_histories',auth[_0xc02b('0xa')](),controller['getHopperHistories']);router[_0xc02b('0x9')](_0xc02b('0x10'),auth[_0xc02b('0xa')](),controller['getHopperFinals']);router[_0xc02b('0x9')](_0xc02b('0x11'),auth['isAuthenticated'](),controller[_0xc02b('0x12')]);router[_0xc02b('0x9')](_0xc02b('0x13'),auth[_0xc02b('0xa')](),controller[_0xc02b('0x14')]);router[_0xc02b('0x9')](_0xc02b('0x15'),auth[_0xc02b('0xa')](),controller[_0xc02b('0x16')]);router[_0xc02b('0x17')]('/',auth[_0xc02b('0xa')](),controller['create']);router[_0xc02b('0x17')](_0xc02b('0x18'),auth['isAuthenticated'](),controller[_0xc02b('0x19')]);router[_0xc02b('0x17')]('/:id/lists',auth['isAuthenticated'](),controller[_0xc02b('0x1a')]);router['post'](_0xc02b('0x15'),auth[_0xc02b('0xa')](),controller['addBlackLists']);router[_0xc02b('0x1b')](_0xc02b('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xc02b('0x1c')](_0xc02b('0xc'),auth[_0xc02b('0xa')](),controller[_0xc02b('0x1d')]);router[_0xc02b('0x1c')]('/:id/lists',auth[_0xc02b('0xa')](),controller[_0xc02b('0x1e')]);router[_0xc02b('0x1c')](_0xc02b('0x15'),auth[_0xc02b('0xa')](),controller[_0xc02b('0x1f')]);module[_0xc02b('0x20')]=router;
\ No newline at end of file
+var _0x3518=['create','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','/:id/lists','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists'];(function(_0x2941e7,_0x40f256){var _0x38ff1d=function(_0x5c65ec){while(--_0x5c65ec){_0x2941e7['push'](_0x2941e7['shift']());}};_0x38ff1d(++_0x40f256);}(_0x3518,0xbc));var _0x8351=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x3518[_0x2d34d6];return _0x1d3d12;};'use strict';var multer=require(_0x8351('0x0'));var util=require(_0x8351('0x1'));var path=require('path');var timeout=require(_0x8351('0x2'));var express=require(_0x8351('0x3'));var router=express['Router']();var fs_extra=require(_0x8351('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8351('0x5'));var config=require(_0x8351('0x6'));var controller=require(_0x8351('0x7'));router[_0x8351('0x8')]('/',auth[_0x8351('0x9')](),controller[_0x8351('0xa')]);router[_0x8351('0x8')](_0x8351('0xb'),auth[_0x8351('0x9')](),controller['show']);router[_0x8351('0x8')](_0x8351('0xc'),auth[_0x8351('0x9')](),controller[_0x8351('0xd')]);router[_0x8351('0x8')](_0x8351('0xe'),auth[_0x8351('0x9')](),controller['getHopperHistories']);router['get'](_0x8351('0xf'),auth['isAuthenticated'](),controller[_0x8351('0x10')]);router[_0x8351('0x8')](_0x8351('0x11'),auth[_0x8351('0x9')](),controller[_0x8351('0x12')]);router[_0x8351('0x8')]('/:id/lists',auth[_0x8351('0x9')](),controller[_0x8351('0x13')]);router[_0x8351('0x8')](_0x8351('0x14'),auth[_0x8351('0x9')](),controller[_0x8351('0x15')]);router['post']('/',auth[_0x8351('0x9')](),controller[_0x8351('0x16')]);router[_0x8351('0x17')](_0x8351('0x18'),auth[_0x8351('0x9')](),controller[_0x8351('0x19')]);router[_0x8351('0x17')]('/:id/lists',auth[_0x8351('0x9')](),controller[_0x8351('0x1a')]);router[_0x8351('0x17')](_0x8351('0x14'),auth[_0x8351('0x9')](),controller[_0x8351('0x1b')]);router[_0x8351('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x8351('0x1d')]);router[_0x8351('0x1e')](_0x8351('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x8351('0x1e')](_0x8351('0x1f'),auth[_0x8351('0x9')](),controller[_0x8351('0x20')]);router[_0x8351('0x1e')]('/:id/blacklists',auth[_0x8351('0x9')](),controller[_0x8351('0x21')]);module[_0x8351('0x22')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 1125545..dec9d1f 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 _0xbec1=['getDataValue','key','sequelize','exports','STRING','TEXT','medium','VIRTUAL'];(function(_0x3d56db,_0x8039b7){var _0xb3c326=function(_0x5ea72f){while(--_0x5ea72f){_0x3d56db['push'](_0x3d56db['shift']());}};_0xb3c326(++_0x8039b7);}(_0xbec1,0xda));var _0x1bec=function(_0xb0838e,_0x255ee3){_0xb0838e=_0xb0838e-0x0;var _0x4d6fc1=_0xbec1[_0xb0838e];return _0x4d6fc1;};'use strict';var Sequelize=require(_0x1bec('0x0'));module[_0x1bec('0x1')]={'key':{'type':Sequelize[_0x1bec('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x1bec('0x3')],'length':_0x1bec('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x1bec('0x2')]},'name':{'type':Sequelize[_0x1bec('0x5')],'get':function(){return this[_0x1bec('0x6')](_0x1bec('0x7'));}}};
\ No newline at end of file
+var _0x5a3d=['exports','medium','STRING','getDataValue','key'];(function(_0x2140c7,_0x2c3a57){var _0x16abad=function(_0x2a3261){while(--_0x2a3261){_0x2140c7['push'](_0x2140c7['shift']());}};_0x16abad(++_0x2c3a57);}(_0x5a3d,0x19f));var _0xd5a3=function(_0x16717a,_0x204625){_0x16717a=_0x16717a-0x0;var _0x2c3c24=_0x5a3d[_0x16717a];return _0x2c3c24;};'use strict';var Sequelize=require('sequelize');module[_0xd5a3('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0xd5a3('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xd5a3('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xd5a3('0x3')](_0xd5a3('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 5174270..295c59f 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 _0x5594=['set','apply','then','destroy','get','CannedAnswers','sendStatus','error','stack','name','CannedAnswer','rawAttributes','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','params','include','update','body','find','catch','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count'];(function(_0x552eba,_0x3a777e){var _0x1f9980=function(_0x5696af){while(--_0x5696af){_0x552eba['push'](_0x552eba['shift']());}};_0x1f9980(++_0x3a777e);}(_0x5594,0x1c6));var _0x4559=function(_0x1b9fb0,_0x2033bb){_0x1b9fb0=_0x1b9fb0-0x0;var _0x5e99c8=_0x5594[_0x1b9fb0];return _0x5e99c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4559('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4559('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4559('0x2'));var util=require(_0x4559('0x3'));var path=require(_0x4559('0x4'));var sox=require(_0x4559('0x5'));var csv=require(_0x4559('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4559('0x7'));var _=require(_0x4559('0x8'));var squel=require('squel');var crypto=require(_0x4559('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x4559('0xa'));var toCsv=require(_0x4559('0x6'));var querystring=require('querystring');var Papa=require(_0x4559('0xb'));var Redis=require(_0x4559('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4559('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4559('0xe'));var logger=require(_0x4559('0xf'))(_0x4559('0x10'));var utils=require(_0x4559('0x11'));var config=require(_0x4559('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x4559('0x13'))['db'];function respondWithStatusCode(_0x353c89,_0x5d36ce){_0x5d36ce=_0x5d36ce||0xcc;return function(_0x447d5d){if(_0x447d5d){return _0x353c89['sendStatus'](_0x5d36ce);}return _0x353c89['status'](_0x5d36ce)['end']();};}function respondWithResult(_0x1f25a0,_0x66da76){_0x66da76=_0x66da76||0xc8;return function(_0x4486a5){if(_0x4486a5){return _0x1f25a0[_0x4559('0x14')](_0x66da76)[_0x4559('0x15')](_0x4486a5);}};}function respondWithFilteredResult(_0x523277,_0x449148){return function(_0x494193){if(_0x494193){var _0x3a5712=typeof _0x449148[_0x4559('0x16')]===_0x4559('0x17')&&typeof _0x449148[_0x4559('0x18')]==='undefined';var _0x254264=_0x494193[_0x4559('0x19')];var _0x5c4d36=_0x3a5712?0x0:_0x449148[_0x4559('0x16')];var _0x4a8732=_0x3a5712?_0x494193[_0x4559('0x19')]:_0x449148['offset']+_0x449148[_0x4559('0x18')];var _0x273233;if(_0x4a8732>=_0x254264){_0x4a8732=_0x254264;_0x273233=0xc8;}else{_0x273233=0xce;}_0x523277[_0x4559('0x14')](_0x273233);return _0x523277[_0x4559('0x1a')]('Content-Range',_0x5c4d36+'-'+_0x4a8732+'/'+_0x254264)[_0x4559('0x15')](_0x494193);}return null;};}function patchUpdates(_0x2b96cc){return function(_0x5dbc26){try{jsonpatch[_0x4559('0x1b')](_0x5dbc26,_0x2b96cc,!![]);}catch(_0x33c205){return BPromise['reject'](_0x33c205);}return _0x5dbc26['save']();};}function saveUpdates(_0x381226,_0x17ec01){return function(_0xb2ed23){if(_0xb2ed23){return _0xb2ed23['update'](_0x381226)[_0x4559('0x1c')](function(_0x17c59d){return _0x17c59d;});}return null;};}function removeEntity(_0x312479,_0x5f094b){return function(_0x3c0f7d){if(_0x3c0f7d){return _0x3c0f7d[_0x4559('0x1d')]()[_0x4559('0x1c')](function(){var _0x4b738e=_0x3c0f7d[_0x4559('0x1e')]({'plain':!![]});var _0x120027=_0x4559('0x1f');return db['UserProfileResource']['destroy']({'where':{'type':_0x120027,'resourceId':_0x4b738e['id']}})[_0x4559('0x1c')](function(){return _0x3c0f7d;});})[_0x4559('0x1c')](function(){_0x312479[_0x4559('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5959ab,_0x5da872){return function(_0x625480){if(!_0x625480){_0x5959ab[_0x4559('0x20')](0x194);}return _0x625480;};}function handleError(_0x4060ce,_0x46c89b){_0x46c89b=_0x46c89b||0x1f4;return function(_0x513f73){logger[_0x4559('0x21')](_0x513f73[_0x4559('0x22')]);if(_0x513f73[_0x4559('0x23')]){delete _0x513f73[_0x4559('0x23')];}_0x4060ce[_0x4559('0x14')](_0x46c89b)['send'](_0x513f73);};}exports['index']=function(_0x211a54,_0x327a52){var _0x53d05a={},_0x1811f8={},_0x3589c7={'count':0x0,'rows':[]};var _0x1fae51=_['map'](db[_0x4559('0x24')][_0x4559('0x25')],function(_0x5975b5){return{'name':_0x5975b5['fieldName'],'type':_0x5975b5['type']['key']};});_0x1811f8[_0x4559('0x26')]=_[_0x4559('0x27')](_0x1fae51,'name');_0x1811f8[_0x4559('0x28')]=_[_0x4559('0x29')](_0x211a54[_0x4559('0x28')]);_0x1811f8[_0x4559('0x2a')]=_[_0x4559('0x2b')](_0x1811f8[_0x4559('0x26')],_0x1811f8[_0x4559('0x28')]);_0x53d05a[_0x4559('0x2c')]=_[_0x4559('0x2b')](_0x1811f8[_0x4559('0x26')],qs['fields'](_0x211a54[_0x4559('0x28')][_0x4559('0x2d')]));_0x53d05a['attributes']=_0x53d05a[_0x4559('0x2c')][_0x4559('0x2e')]?_0x53d05a[_0x4559('0x2c')]:_0x1811f8[_0x4559('0x26')];if(!_0x211a54['query']['hasOwnProperty'](_0x4559('0x2f'))){_0x53d05a['limit']=qs[_0x4559('0x18')](_0x211a54['query'][_0x4559('0x18')]);_0x53d05a[_0x4559('0x16')]=qs[_0x4559('0x16')](_0x211a54[_0x4559('0x28')][_0x4559('0x16')]);}_0x53d05a[_0x4559('0x30')]=qs[_0x4559('0x31')](_0x211a54['query'][_0x4559('0x31')]);_0x53d05a[_0x4559('0x32')]=qs['filters'](_[_0x4559('0x33')](_0x211a54[_0x4559('0x28')],_0x1811f8[_0x4559('0x2a')]),_0x1fae51);if(_0x211a54[_0x4559('0x28')][_0x4559('0x34')]){_0x53d05a[_0x4559('0x32')]=_[_0x4559('0x35')](_0x53d05a['where'],{'$or':[{'key':{'$like':'%'+_0x211a54[_0x4559('0x28')][_0x4559('0x34')]+'%'}},{'value':{'$like':'%'+_0x211a54['query'][_0x4559('0x34')]+'%'}}]});}_0x53d05a=_[_0x4559('0x35')]({},_0x53d05a,_0x211a54[_0x4559('0x36')]);var _0x27571c={'where':_0x53d05a[_0x4559('0x32')]};return db[_0x4559('0x24')]['count'](_0x27571c)['then'](function(_0x386a3d){_0x3589c7[_0x4559('0x19')]=_0x386a3d;if(_0x211a54['query'][_0x4559('0x37')]){_0x53d05a['include']=[{'all':!![]}];}return db[_0x4559('0x24')][_0x4559('0x38')](_0x53d05a);})[_0x4559('0x1c')](function(_0x3de472){_0x3589c7[_0x4559('0x39')]=_0x3de472;return _0x3589c7;})['then'](respondWithFilteredResult(_0x327a52,_0x53d05a))['catch'](handleError(_0x327a52,null));};exports['show']=function(_0x454248,_0x69315b){var _0x47a76c={'raw':!![],'where':{'id':_0x454248[_0x4559('0x3a')]['id']}},_0xd434f7={};_0xd434f7[_0x4559('0x26')]=_[_0x4559('0x29')](db[_0x4559('0x24')][_0x4559('0x25')]);_0xd434f7[_0x4559('0x28')]=_[_0x4559('0x29')](_0x454248[_0x4559('0x28')]);_0xd434f7[_0x4559('0x2a')]=_[_0x4559('0x2b')](_0xd434f7[_0x4559('0x26')],_0xd434f7[_0x4559('0x28')]);_0x47a76c['attributes']=_[_0x4559('0x2b')](_0xd434f7[_0x4559('0x26')],qs[_0x4559('0x2d')](_0x454248[_0x4559('0x28')]['fields']));_0x47a76c[_0x4559('0x2c')]=_0x47a76c[_0x4559('0x2c')][_0x4559('0x2e')]?_0x47a76c[_0x4559('0x2c')]:_0xd434f7[_0x4559('0x26')];if(_0x454248[_0x4559('0x28')][_0x4559('0x37')]){_0x47a76c[_0x4559('0x3b')]=[{'all':!![]}];}_0x47a76c=_[_0x4559('0x35')]({},_0x47a76c,_0x454248[_0x4559('0x36')]);return db['CannedAnswer']['find'](_0x47a76c)[_0x4559('0x1c')](handleEntityNotFound(_0x69315b,null))[_0x4559('0x1c')](respondWithResult(_0x69315b,null))['catch'](handleError(_0x69315b,null));};exports[_0x4559('0x3c')]=function(_0x3b6040,_0x3f3009){if(_0x3b6040[_0x4559('0x3d')]['id']){delete _0x3b6040[_0x4559('0x3d')]['id'];}return db[_0x4559('0x24')][_0x4559('0x3e')]({'where':{'id':_0x3b6040['params']['id']}})[_0x4559('0x1c')](handleEntityNotFound(_0x3f3009,null))[_0x4559('0x1c')](saveUpdates(_0x3b6040['body'],null))[_0x4559('0x1c')](respondWithResult(_0x3f3009,null))[_0x4559('0x3f')](handleError(_0x3f3009,null));};exports['destroy']=function(_0x2e7cd1,_0x4c9614){return db[_0x4559('0x24')][_0x4559('0x3e')]({'where':{'id':_0x2e7cd1[_0x4559('0x3a')]['id']}})[_0x4559('0x1c')](handleEntityNotFound(_0x4c9614,null))[_0x4559('0x1c')](removeEntity(_0x4c9614,null))[_0x4559('0x3f')](handleError(_0x4c9614,null));};exports[_0x4559('0x40')]=function(_0xcc1825,_0x406962){var _0x4c1f2b={'key':_0xcc1825[_0x4559('0x3d')][_0x4559('0x41')]};if(_0xcc1825[_0x4559('0x3d')][_0x4559('0x42')]){_0x4c1f2b[_0x4559('0x42')]=_0xcc1825[_0x4559('0x3d')]['MailAccountId'];}else if(_0xcc1825['body'][_0x4559('0x43')]){_0x4c1f2b['SmsAccountId']=_0xcc1825[_0x4559('0x3d')]['SmsAccountId'];}else if(_0xcc1825[_0x4559('0x3d')][_0x4559('0x44')]){_0x4c1f2b[_0x4559('0x44')]=_0xcc1825[_0x4559('0x3d')]['OpenchannelAccountId'];}else if(_0xcc1825[_0x4559('0x3d')][_0x4559('0x45')]){_0x4c1f2b[_0x4559('0x45')]=_0xcc1825[_0x4559('0x3d')][_0x4559('0x45')];}return db[_0x4559('0x24')][_0x4559('0x3e')]({'where':_0x4c1f2b})['then'](function(_0x362c75){if(_0x362c75){throw new db[(_0x4559('0x46'))][(_0x4559('0x47'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x4559('0x24')]['create'](_0xcc1825[_0x4559('0x3d')]);})[_0x4559('0x1c')](function(_0x31516d){var _0x1613d8=_0xcc1825[_0x4559('0x48')][_0x4559('0x1e')]({'plain':!![]});if(!_0x1613d8)throw new Error(_0x4559('0x49'));if(_0x1613d8[_0x4559('0x4a')]===_0x4559('0x48')){var _0x55e3f2=_0x31516d[_0x4559('0x1e')]({'plain':!![]});return db[_0x4559('0x4b')]['find']({'where':{'name':_0x4559('0x1f'),'userProfileId':_0x1613d8[_0x4559('0x4c')]},'raw':!![]})[_0x4559('0x1c')](function(_0x31d177){if(_0x31d177&&_0x31d177[_0x4559('0x4d')]===0x0){return db[_0x4559('0x4e')]['create']({'name':_0x55e3f2[_0x4559('0x23')],'resourceId':_0x55e3f2['id'],'type':_0x31d177[_0x4559('0x23')],'sectionId':_0x31d177['id']},{})[_0x4559('0x1c')](function(){return _0x31516d;});}else{return _0x31516d;}})[_0x4559('0x3f')](function(_0x151e92){logger['error'](_0x4559('0x4f'),_0x151e92);throw _0x151e92;});}return _0x31516d;})[_0x4559('0x1c')](respondWithResult(_0x406962,0xc9))[_0x4559('0x3f')](handleError(_0x406962,null));};
\ No newline at end of file
+var _0x97af=['keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','find','catch','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CannedAnswers','userProfileId','autoAssociation','error','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','UserProfileResource','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query'];(function(_0x527372,_0x173b25){var _0x4f88b2=function(_0x1d0bb6){while(--_0x1d0bb6){_0x527372['push'](_0x527372['shift']());}};_0x4f88b2(++_0x173b25);}(_0x97af,0xca));var _0xf97a=function(_0x5c2ad0,_0x46752e){_0x5c2ad0=_0x5c2ad0-0x0;var _0x3d0155=_0x97af[_0x5c2ad0];return _0x3d0155;};'use strict';var emlformat=require(_0xf97a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf97a('0x1'));var rp=require(_0xf97a('0x2'));var moment=require(_0xf97a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf97a('0x4'));var util=require(_0xf97a('0x5'));var path=require(_0xf97a('0x6'));var sox=require('sox');var csv=require(_0xf97a('0x7'));var ejs=require(_0xf97a('0x8'));var fs=require('fs');var fs_extra=require(_0xf97a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf97a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf97a('0xb'));var toCsv=require(_0xf97a('0x7'));var querystring=require(_0xf97a('0xc'));var Papa=require('papaparse');var Redis=require(_0xf97a('0xd'));var authService=require(_0xf97a('0xe'));var qs=require(_0xf97a('0xf'));var as=require(_0xf97a('0x10'));var hardwareService=require(_0xf97a('0x11'));var logger=require(_0xf97a('0x12'))(_0xf97a('0x13'));var utils=require(_0xf97a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf97a('0x15'));var db=require(_0xf97a('0x16'))['db'];function respondWithStatusCode(_0x464f48,_0x494671){_0x494671=_0x494671||0xcc;return function(_0xa8b234){if(_0xa8b234){return _0x464f48[_0xf97a('0x17')](_0x494671);}return _0x464f48[_0xf97a('0x18')](_0x494671)[_0xf97a('0x19')]();};}function respondWithResult(_0x416026,_0x15a099){_0x15a099=_0x15a099||0xc8;return function(_0x47e187){if(_0x47e187){return _0x416026[_0xf97a('0x18')](_0x15a099)[_0xf97a('0x1a')](_0x47e187);}};}function respondWithFilteredResult(_0x35701d,_0x5e0616){return function(_0x260755){if(_0x260755){var _0x2aea97=typeof _0x5e0616[_0xf97a('0x1b')]===_0xf97a('0x1c')&&typeof _0x5e0616[_0xf97a('0x1d')]===_0xf97a('0x1c');var _0x22ae09=_0x260755[_0xf97a('0x1e')];var _0x2a2ba5=_0x2aea97?0x0:_0x5e0616[_0xf97a('0x1b')];var _0x33ae74=_0x2aea97?_0x260755[_0xf97a('0x1e')]:_0x5e0616[_0xf97a('0x1b')]+_0x5e0616[_0xf97a('0x1d')];var _0x14e80c;if(_0x33ae74>=_0x22ae09){_0x33ae74=_0x22ae09;_0x14e80c=0xc8;}else{_0x14e80c=0xce;}_0x35701d[_0xf97a('0x18')](_0x14e80c);return _0x35701d[_0xf97a('0x1f')](_0xf97a('0x20'),_0x2a2ba5+'-'+_0x33ae74+'/'+_0x22ae09)[_0xf97a('0x1a')](_0x260755);}return null;};}function patchUpdates(_0x2d32b0){return function(_0x43e959){try{jsonpatch[_0xf97a('0x21')](_0x43e959,_0x2d32b0,!![]);}catch(_0x29298a){return BPromise[_0xf97a('0x22')](_0x29298a);}return _0x43e959['save']();};}function saveUpdates(_0x11f2c2,_0x5c99d1){return function(_0x41b01e){if(_0x41b01e){return _0x41b01e[_0xf97a('0x23')](_0x11f2c2)[_0xf97a('0x24')](function(_0x360c20){return _0x360c20;});}return null;};}function removeEntity(_0x5abb8f,_0x3a87a7){return function(_0x50d076){if(_0x50d076){return _0x50d076['destroy']()['then'](function(){var _0x477fc7=_0x50d076[_0xf97a('0x25')]({'plain':!![]});var _0x20c00c='CannedAnswers';return db[_0xf97a('0x26')]['destroy']({'where':{'type':_0x20c00c,'resourceId':_0x477fc7['id']}})['then'](function(){return _0x50d076;});})[_0xf97a('0x24')](function(){_0x5abb8f[_0xf97a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d1195,_0x502558){return function(_0x574ec7){if(!_0x574ec7){_0x1d1195[_0xf97a('0x17')](0x194);}return _0x574ec7;};}function handleError(_0x40a01c,_0x5257c9){_0x5257c9=_0x5257c9||0x1f4;return function(_0xb7aa58){logger['error'](_0xb7aa58[_0xf97a('0x27')]);if(_0xb7aa58['name']){delete _0xb7aa58[_0xf97a('0x28')];}_0x40a01c[_0xf97a('0x18')](_0x5257c9)[_0xf97a('0x29')](_0xb7aa58);};}exports['index']=function(_0x3fb2b8,_0x59bf2e){var _0x492698={},_0x30ce21={},_0xc8c2fa={'count':0x0,'rows':[]};var _0x2e1bbd=_[_0xf97a('0x2a')](db[_0xf97a('0x2b')][_0xf97a('0x2c')],function(_0x38249e){return{'name':_0x38249e[_0xf97a('0x2d')],'type':_0x38249e[_0xf97a('0x2e')][_0xf97a('0x2f')]};});_0x30ce21[_0xf97a('0x30')]=_['map'](_0x2e1bbd,_0xf97a('0x28'));_0x30ce21[_0xf97a('0x31')]=_[_0xf97a('0x32')](_0x3fb2b8['query']);_0x30ce21[_0xf97a('0x33')]=_['intersection'](_0x30ce21[_0xf97a('0x30')],_0x30ce21[_0xf97a('0x31')]);_0x492698[_0xf97a('0x34')]=_[_0xf97a('0x35')](_0x30ce21[_0xf97a('0x30')],qs['fields'](_0x3fb2b8[_0xf97a('0x31')][_0xf97a('0x36')]));_0x492698[_0xf97a('0x34')]=_0x492698['attributes'][_0xf97a('0x37')]?_0x492698[_0xf97a('0x34')]:_0x30ce21[_0xf97a('0x30')];if(!_0x3fb2b8[_0xf97a('0x31')][_0xf97a('0x38')](_0xf97a('0x39'))){_0x492698[_0xf97a('0x1d')]=qs[_0xf97a('0x1d')](_0x3fb2b8[_0xf97a('0x31')][_0xf97a('0x1d')]);_0x492698[_0xf97a('0x1b')]=qs['offset'](_0x3fb2b8['query'][_0xf97a('0x1b')]);}_0x492698['order']=qs[_0xf97a('0x3a')](_0x3fb2b8[_0xf97a('0x31')][_0xf97a('0x3a')]);_0x492698[_0xf97a('0x3b')]=qs[_0xf97a('0x33')](_[_0xf97a('0x3c')](_0x3fb2b8[_0xf97a('0x31')],_0x30ce21[_0xf97a('0x33')]),_0x2e1bbd);if(_0x3fb2b8[_0xf97a('0x31')][_0xf97a('0x3d')]){_0x492698[_0xf97a('0x3b')]=_[_0xf97a('0x3e')](_0x492698[_0xf97a('0x3b')],{'$or':[{'key':{'$like':'%'+_0x3fb2b8[_0xf97a('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x3fb2b8[_0xf97a('0x31')][_0xf97a('0x3d')]+'%'}}]});}_0x492698=_[_0xf97a('0x3e')]({},_0x492698,_0x3fb2b8[_0xf97a('0x3f')]);var _0x509dd8={'where':_0x492698[_0xf97a('0x3b')]};return db['CannedAnswer'][_0xf97a('0x1e')](_0x509dd8)[_0xf97a('0x24')](function(_0x461563){_0xc8c2fa[_0xf97a('0x1e')]=_0x461563;if(_0x3fb2b8[_0xf97a('0x31')][_0xf97a('0x40')]){_0x492698[_0xf97a('0x41')]=[{'all':!![]}];}return db[_0xf97a('0x2b')]['findAll'](_0x492698);})['then'](function(_0x15a881){_0xc8c2fa['rows']=_0x15a881;return _0xc8c2fa;})['then'](respondWithFilteredResult(_0x59bf2e,_0x492698))['catch'](handleError(_0x59bf2e,null));};exports['show']=function(_0xceedc2,_0xf1c45f){var _0x15a114={'raw':!![],'where':{'id':_0xceedc2['params']['id']}},_0xd70b5a={};_0xd70b5a[_0xf97a('0x30')]=_['keys'](db[_0xf97a('0x2b')][_0xf97a('0x2c')]);_0xd70b5a[_0xf97a('0x31')]=_[_0xf97a('0x32')](_0xceedc2[_0xf97a('0x31')]);_0xd70b5a[_0xf97a('0x33')]=_[_0xf97a('0x35')](_0xd70b5a[_0xf97a('0x30')],_0xd70b5a[_0xf97a('0x31')]);_0x15a114[_0xf97a('0x34')]=_[_0xf97a('0x35')](_0xd70b5a[_0xf97a('0x30')],qs[_0xf97a('0x36')](_0xceedc2[_0xf97a('0x31')][_0xf97a('0x36')]));_0x15a114[_0xf97a('0x34')]=_0x15a114[_0xf97a('0x34')]['length']?_0x15a114[_0xf97a('0x34')]:_0xd70b5a[_0xf97a('0x30')];if(_0xceedc2['query']['includeAll']){_0x15a114[_0xf97a('0x41')]=[{'all':!![]}];}_0x15a114=_['merge']({},_0x15a114,_0xceedc2[_0xf97a('0x3f')]);return db[_0xf97a('0x2b')][_0xf97a('0x42')](_0x15a114)[_0xf97a('0x24')](handleEntityNotFound(_0xf1c45f,null))['then'](respondWithResult(_0xf1c45f,null))[_0xf97a('0x43')](handleError(_0xf1c45f,null));};exports[_0xf97a('0x23')]=function(_0x510c73,_0x1c5214){if(_0x510c73['body']['id']){delete _0x510c73[_0xf97a('0x44')]['id'];}return db[_0xf97a('0x2b')][_0xf97a('0x42')]({'where':{'id':_0x510c73['params']['id']}})[_0xf97a('0x24')](handleEntityNotFound(_0x1c5214,null))[_0xf97a('0x24')](saveUpdates(_0x510c73['body'],null))[_0xf97a('0x24')](respondWithResult(_0x1c5214,null))[_0xf97a('0x43')](handleError(_0x1c5214,null));};exports['destroy']=function(_0x18677f,_0x209a8){return db['CannedAnswer']['find']({'where':{'id':_0x18677f[_0xf97a('0x45')]['id']}})[_0xf97a('0x24')](handleEntityNotFound(_0x209a8,null))[_0xf97a('0x24')](removeEntity(_0x209a8,null))['catch'](handleError(_0x209a8,null));};exports[_0xf97a('0x46')]=function(_0x383ce8,_0x3ad038){var _0x2b6ed7={'key':_0x383ce8[_0xf97a('0x44')][_0xf97a('0x2f')]};if(_0x383ce8[_0xf97a('0x44')][_0xf97a('0x47')]){_0x2b6ed7[_0xf97a('0x47')]=_0x383ce8[_0xf97a('0x44')]['MailAccountId'];}else if(_0x383ce8['body'][_0xf97a('0x48')]){_0x2b6ed7[_0xf97a('0x48')]=_0x383ce8[_0xf97a('0x44')][_0xf97a('0x48')];}else if(_0x383ce8[_0xf97a('0x44')][_0xf97a('0x49')]){_0x2b6ed7[_0xf97a('0x49')]=_0x383ce8[_0xf97a('0x44')][_0xf97a('0x49')];}else if(_0x383ce8['body'][_0xf97a('0x4a')]){_0x2b6ed7[_0xf97a('0x4a')]=_0x383ce8[_0xf97a('0x44')][_0xf97a('0x4a')];}return db['CannedAnswer']['find']({'where':_0x2b6ed7})[_0xf97a('0x24')](function(_0x47b9f8){if(_0x47b9f8){throw new db[(_0xf97a('0x4b'))][(_0xf97a('0x4c'))]('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0xf97a('0x46')](_0x383ce8[_0xf97a('0x44')]);})['then'](function(_0x1805db){var _0x3fca4c=_0x383ce8['user']['get']({'plain':!![]});if(!_0x3fca4c)throw new Error(_0xf97a('0x4d'));if(_0x3fca4c[_0xf97a('0x4e')]===_0xf97a('0x4f')){var _0x44b124=_0x1805db[_0xf97a('0x25')]({'plain':!![]});return db['UserProfileSection'][_0xf97a('0x42')]({'where':{'name':_0xf97a('0x50'),'userProfileId':_0x3fca4c[_0xf97a('0x51')]},'raw':!![]})[_0xf97a('0x24')](function(_0x4fda45){if(_0x4fda45&&_0x4fda45[_0xf97a('0x52')]===0x0){return db[_0xf97a('0x26')][_0xf97a('0x46')]({'name':_0x44b124[_0xf97a('0x28')],'resourceId':_0x44b124['id'],'type':_0x4fda45[_0xf97a('0x28')],'sectionId':_0x4fda45['id']},{})[_0xf97a('0x24')](function(){return _0x1805db;});}else{return _0x1805db;}})[_0xf97a('0x43')](function(_0x306091){logger[_0xf97a('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x306091);throw _0x306091;});}return _0x1805db;})[_0xf97a('0x24')](respondWithResult(_0x3ad038,0xc9))[_0xf97a('0x43')](handleError(_0x3ad038,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 3eff1fa..794fe8b 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 _0x5e1e=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x5e1e,0x137));var _0xe5e1=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x5e1e[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0xe5e1('0x0'));var util=require(_0xe5e1('0x1'));var logger=require(_0xe5e1('0x2'))('api');var moment=require(_0xe5e1('0x3'));var BPromise=require(_0xe5e1('0x4'));var rp=require(_0xe5e1('0x5'));var fs=require('fs');var path=require(_0xe5e1('0x6'));var rimraf=require(_0xe5e1('0x7'));var config=require(_0xe5e1('0x8'));var attributes=require('./cannedAnswer.attributes');module[_0xe5e1('0x9')]=function(_0x396c75,_0x27b765){return _0x396c75[_0xe5e1('0xa')](_0xe5e1('0xb'),attributes,{'tableName':_0xe5e1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe5e1('0xd'),'collate':_0xe5e1('0xe')});};
\ No newline at end of file
+var _0x5447=['./cannedAnswer.attributes','CannedAnswer','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x2211ed,_0x1bca0b){var _0x4d78cc=function(_0x467b59){while(--_0x467b59){_0x2211ed['push'](_0x2211ed['shift']());}};_0x4d78cc(++_0x1bca0b);}(_0x5447,0x1a7));var _0x7544=function(_0x55e151,_0x106f12){_0x55e151=_0x55e151-0x0;var _0x64c2e0=_0x5447[_0x55e151];return _0x64c2e0;};'use strict';var _=require(_0x7544('0x0'));var util=require(_0x7544('0x1'));var logger=require(_0x7544('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7544('0x3'));var fs=require('fs');var path=require(_0x7544('0x4'));var rimraf=require(_0x7544('0x5'));var config=require(_0x7544('0x6'));var attributes=require(_0x7544('0x7'));module['exports']=function(_0x1efed6,_0x5dbdeb){return _0x1efed6['define'](_0x7544('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7544('0x9')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 1cc1d4c..3c3881c 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(_0x123756,_0x3b3eaa){var _0xeeaa88=function(_0x25c3be){while(--_0x25c3be){_0x123756['push'](_0x123756['shift']());}};_0xeeaa88(++_0x3b3eaa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x4bfb66,_0x5eac95){var _0x4a45d6=function(_0x6ef966){while(--_0x6ef966){_0x4bfb66['push'](_0x4bfb66['shift']());}};_0x4a45d6(++_0x5eac95);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 c9205e0..eedbc3d 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 _0x1fdb=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x5bb4b3,_0x30b4d3){var _0x2f018d=function(_0x249afd){while(--_0x249afd){_0x5bb4b3['push'](_0x5bb4b3['shift']());}};_0x2f018d(++_0x30b4d3);}(_0x1fdb,0x138));var _0xb1fd=function(_0x8bffdd,_0x459131){_0x8bffdd=_0x8bffdd-0x0;var _0x17558e=_0x1fdb[_0x8bffdd];return _0x17558e;};'use strict';var multer=require(_0xb1fd('0x0'));var util=require(_0xb1fd('0x1'));var path=require(_0xb1fd('0x2'));var timeout=require(_0xb1fd('0x3'));var express=require(_0xb1fd('0x4'));var router=express[_0xb1fd('0x5')]();var fs_extra=require(_0xb1fd('0x6'));var auth=require(_0xb1fd('0x7'));var interaction=require(_0xb1fd('0x8'));var config=require('../../config/environment');var controller=require(_0xb1fd('0x9'));router[_0xb1fd('0xa')]('/',auth[_0xb1fd('0xb')](),controller[_0xb1fd('0xc')]);router[_0xb1fd('0xa')](_0xb1fd('0xd'),auth[_0xb1fd('0xb')](),controller[_0xb1fd('0xe')]);router[_0xb1fd('0xf')]('/',auth[_0xb1fd('0xb')](),controller[_0xb1fd('0x10')]);router[_0xb1fd('0x11')](_0xb1fd('0xd'),auth['isAuthenticated'](),controller[_0xb1fd('0x12')]);router[_0xb1fd('0x13')](_0xb1fd('0xd'),auth[_0xb1fd('0xb')](),controller[_0xb1fd('0x14')]);module[_0xb1fd('0x15')]=router;
\ No newline at end of file
+var _0x58bf=['isAuthenticated','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','index','get','/:id'];(function(_0x22806f,_0x105b2a){var _0x1f28ac=function(_0x5cccd8){while(--_0x5cccd8){_0x22806f['push'](_0x22806f['shift']());}};_0x1f28ac(++_0x105b2a);}(_0x58bf,0x104));var _0xf58b=function(_0x34f591,_0x55fb1c){_0x34f591=_0x34f591-0x0;var _0xda3ec2=_0x58bf[_0x34f591];return _0xda3ec2;};'use strict';var multer=require(_0xf58b('0x0'));var util=require('util');var path=require(_0xf58b('0x1'));var timeout=require(_0xf58b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf58b('0x3'));var interaction=require(_0xf58b('0x4'));var config=require(_0xf58b('0x5'));var controller=require(_0xf58b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xf58b('0x7')]);router[_0xf58b('0x8')](_0xf58b('0x9'),auth[_0xf58b('0xa')](),controller[_0xf58b('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf58b('0xc')]);router[_0xf58b('0xd')](_0xf58b('0x9'),auth['isAuthenticated'](),controller[_0xf58b('0xe')]);router[_0xf58b('0xf')](_0xf58b('0x9'),auth[_0xf58b('0xa')](),controller[_0xf58b('0x10')]);module[_0xf58b('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 6020ec6..96150eb 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 _0x8979=['INTEGER','sequelize','exports','DATE','STRING'];(function(_0x4da356,_0x5235e1){var _0x321b07=function(_0x2bc6f4){while(--_0x2bc6f4){_0x4da356['push'](_0x4da356['shift']());}};_0x321b07(++_0x5235e1);}(_0x8979,0x16e));var _0x9897=function(_0x2e8f2c,_0x480886){_0x2e8f2c=_0x2e8f2c-0x0;var _0xdab2c8=_0x8979[_0x2e8f2c];return _0xdab2c8;};'use strict';var Sequelize=require(_0x9897('0x0'));module[_0x9897('0x1')]={'calldate':{'type':Sequelize[_0x9897('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x9897('0x3')]},'src':{'type':Sequelize[_0x9897('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9897('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x9897('0x3')]},'lastdata':{'type':Sequelize[_0x9897('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9897('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9897('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x9897('0x3')]},'userfield':{'type':Sequelize[_0x9897('0x3')]},'uniqueid':{'type':Sequelize[_0x9897('0x3')]},'linkedid':{'type':Sequelize[_0x9897('0x3')]},'sequence':{'type':Sequelize[_0x9897('0x3')]},'peeraccount':{'type':Sequelize[_0x9897('0x3')]},'type':{'type':Sequelize[_0x9897('0x3')]},'tag':{'type':Sequelize[_0x9897('0x3')]}};
\ No newline at end of file
+var _0x1ca7=['exports','STRING','INTEGER','sequelize'];(function(_0x4da572,_0x326408){var _0x378393=function(_0x1357e4){while(--_0x1357e4){_0x4da572['push'](_0x4da572['shift']());}};_0x378393(++_0x326408);}(_0x1ca7,0x157));var _0x71ca=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x1ca7[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x71ca('0x0'));module[_0x71ca('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x71ca('0x2')]},'dst':{'type':Sequelize[_0x71ca('0x2')]},'dcontext':{'type':Sequelize[_0x71ca('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x71ca('0x2')]},'lastapp':{'type':Sequelize[_0x71ca('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x71ca('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x71ca('0x2')]},'amaflags':{'type':Sequelize[_0x71ca('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x71ca('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x71ca('0x2')]},'linkedid':{'type':Sequelize[_0x71ca('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x71ca('0x2')]},'type':{'type':Sequelize[_0x71ca('0x2')]},'tag':{'type':Sequelize[_0x71ca('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 7a0187e..9f201ee 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 _0x0e85=['json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','map','Cdr','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end'];(function(_0xe59e5d,_0x36a1f7){var _0x457efa=function(_0x45a171){while(--_0x45a171){_0xe59e5d['push'](_0xe59e5d['shift']());}};_0x457efa(++_0x36a1f7);}(_0x0e85,0x7c));var _0x50e8=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x0e85[_0x5f309e];return _0x487b5e;};'use strict';var emlformat=require(_0x50e8('0x0'));var rimraf=require(_0x50e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50e8('0x2'));var rp=require(_0x50e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50e8('0x4'));var path=require('path');var sox=require(_0x50e8('0x5'));var csv=require(_0x50e8('0x6'));var ejs=require(_0x50e8('0x7'));var fs=require('fs');var fs_extra=require(_0x50e8('0x8'));var _=require('lodash');var squel=require(_0x50e8('0x9'));var crypto=require(_0x50e8('0xa'));var jsforce=require(_0x50e8('0xb'));var deskjs=require(_0x50e8('0xc'));var toCsv=require(_0x50e8('0x6'));var querystring=require(_0x50e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e8('0xe'));var authService=require(_0x50e8('0xf'));var qs=require(_0x50e8('0x10'));var as=require(_0x50e8('0x11'));var hardwareService=require(_0x50e8('0x12'));var logger=require(_0x50e8('0x13'))(_0x50e8('0x14'));var utils=require(_0x50e8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50e8('0x16'))['db'];function respondWithStatusCode(_0x24d381,_0x508377){_0x508377=_0x508377||0xcc;return function(_0x49e02f){if(_0x49e02f){return _0x24d381[_0x50e8('0x17')](_0x508377);}return _0x24d381[_0x50e8('0x18')](_0x508377)[_0x50e8('0x19')]();};}function respondWithResult(_0x473aa7,_0x54efd3){_0x54efd3=_0x54efd3||0xc8;return function(_0x18596f){if(_0x18596f){return _0x473aa7[_0x50e8('0x18')](_0x54efd3)[_0x50e8('0x1a')](_0x18596f);}};}function respondWithFilteredResult(_0x5c3baa,_0x5524a3){return function(_0x30a872){if(_0x30a872){var _0xf02b48=typeof _0x5524a3[_0x50e8('0x1b')]===_0x50e8('0x1c')&&typeof _0x5524a3[_0x50e8('0x1d')]===_0x50e8('0x1c');var _0x5642bf=_0x30a872['count'];var _0x441f25=_0xf02b48?0x0:_0x5524a3[_0x50e8('0x1b')];var _0x40d060=_0xf02b48?_0x30a872[_0x50e8('0x1e')]:_0x5524a3[_0x50e8('0x1b')]+_0x5524a3[_0x50e8('0x1d')];var _0x1a451d;if(_0x40d060>=_0x5642bf){_0x40d060=_0x5642bf;_0x1a451d=0xc8;}else{_0x1a451d=0xce;}_0x5c3baa['status'](_0x1a451d);return _0x5c3baa[_0x50e8('0x1f')]('Content-Range',_0x441f25+'-'+_0x40d060+'/'+_0x5642bf)[_0x50e8('0x1a')](_0x30a872);}return null;};}function patchUpdates(_0xe04a5c){return function(_0xd263d){try{jsonpatch[_0x50e8('0x20')](_0xd263d,_0xe04a5c,!![]);}catch(_0x46af8e){return BPromise['reject'](_0x46af8e);}return _0xd263d[_0x50e8('0x21')]();};}function saveUpdates(_0x1e4e0d,_0x58110d){return function(_0x31d23c){if(_0x31d23c){return _0x31d23c[_0x50e8('0x22')](_0x1e4e0d)['then'](function(_0x1ce7fc){return _0x1ce7fc;});}return null;};}function removeEntity(_0xe7e56c,_0x4f56b7){return function(_0x47a3d8){if(_0x47a3d8){return _0x47a3d8['destroy']()[_0x50e8('0x23')](function(){_0xe7e56c[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();});}};}function handleEntityNotFound(_0x371a1f,_0xc2f832){return function(_0x13b6e9){if(!_0x13b6e9){_0x371a1f['sendStatus'](0x194);}return _0x13b6e9;};}function handleError(_0x3a6442,_0x396611){_0x396611=_0x396611||0x1f4;return function(_0x4b3a09){logger[_0x50e8('0x24')](_0x4b3a09[_0x50e8('0x25')]);if(_0x4b3a09[_0x50e8('0x26')]){delete _0x4b3a09[_0x50e8('0x26')];}_0x3a6442['status'](_0x396611)[_0x50e8('0x27')](_0x4b3a09);};}exports['index']=function(_0x30fedf,_0x39c0c6){var _0x42bbef={},_0x4f0b88={},_0x1041b9={'count':0x0,'rows':[]};var _0x126c99=_[_0x50e8('0x28')](db[_0x50e8('0x29')][_0x50e8('0x2a')],function(_0x18aa31){return{'name':_0x18aa31[_0x50e8('0x2b')],'type':_0x18aa31['type'][_0x50e8('0x2c')]};});_0x4f0b88[_0x50e8('0x2d')]=_['map'](_0x126c99,'name');_0x4f0b88[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](_0x30fedf[_0x50e8('0x2e')]);_0x4f0b88['filters']=_['intersection'](_0x4f0b88[_0x50e8('0x2d')],_0x4f0b88[_0x50e8('0x2e')]);_0x42bbef['attributes']=_[_0x50e8('0x30')](_0x4f0b88[_0x50e8('0x2d')],qs[_0x50e8('0x31')](_0x30fedf[_0x50e8('0x2e')]['fields']));_0x42bbef[_0x50e8('0x32')]=_0x42bbef['attributes'][_0x50e8('0x33')]?_0x42bbef[_0x50e8('0x32')]:_0x4f0b88[_0x50e8('0x2d')];if(!_0x30fedf['query'][_0x50e8('0x34')](_0x50e8('0x35'))){_0x42bbef['limit']=qs[_0x50e8('0x1d')](_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x1d')]);_0x42bbef[_0x50e8('0x1b')]=qs['offset'](_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x1b')]);}_0x42bbef[_0x50e8('0x36')]=qs[_0x50e8('0x37')](_0x30fedf['query'][_0x50e8('0x37')]);_0x42bbef[_0x50e8('0x38')]=qs[_0x50e8('0x39')](_['pick'](_0x30fedf['query'],_0x4f0b88['filters']),_0x126c99);if(_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x3a')]){_0x42bbef[_0x50e8('0x38')]=_[_0x50e8('0x3b')](_0x42bbef[_0x50e8('0x38')],{'$or':_[_0x50e8('0x28')](_0x126c99,function(_0xb566c2){if(_0xb566c2[_0x50e8('0x3c')]!==_0x50e8('0x3d')){var _0x3a1b4d={};_0x3a1b4d[_0xb566c2['name']]={'$like':'%'+_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x3a')]+'%'};return _0x3a1b4d;}})});}_0x42bbef=_[_0x50e8('0x3b')]({},_0x42bbef,_0x30fedf[_0x50e8('0x3e')]);var _0x5dbbe1={'where':_0x42bbef[_0x50e8('0x38')]};return db[_0x50e8('0x29')][_0x50e8('0x1e')](_0x5dbbe1)[_0x50e8('0x23')](function(_0x8e8a97){_0x1041b9['count']=_0x8e8a97;if(_0x30fedf['query'][_0x50e8('0x3f')]){_0x42bbef[_0x50e8('0x40')]=[{'all':!![]}];}return db['Cdr'][_0x50e8('0x41')](_0x42bbef);})[_0x50e8('0x23')](function(_0x3db1ab){_0x1041b9[_0x50e8('0x42')]=_0x3db1ab;return _0x1041b9;})[_0x50e8('0x23')](respondWithFilteredResult(_0x39c0c6,_0x42bbef))[_0x50e8('0x43')](handleError(_0x39c0c6,null));};exports[_0x50e8('0x44')]=function(_0x172049,_0x5e9da3){var _0x3d26bd={'raw':!![],'where':{'id':_0x172049[_0x50e8('0x45')]['id']}},_0x44e0ca={};_0x44e0ca[_0x50e8('0x2d')]=_['keys'](db[_0x50e8('0x29')][_0x50e8('0x2a')]);_0x44e0ca[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](_0x172049['query']);_0x44e0ca[_0x50e8('0x39')]=_['intersection'](_0x44e0ca['model'],_0x44e0ca['query']);_0x3d26bd[_0x50e8('0x32')]=_[_0x50e8('0x30')](_0x44e0ca['model'],qs[_0x50e8('0x31')](_0x172049[_0x50e8('0x2e')][_0x50e8('0x31')]));_0x3d26bd[_0x50e8('0x32')]=_0x3d26bd[_0x50e8('0x32')][_0x50e8('0x33')]?_0x3d26bd['attributes']:_0x44e0ca[_0x50e8('0x2d')];if(_0x172049['query'][_0x50e8('0x3f')]){_0x3d26bd[_0x50e8('0x40')]=[{'all':!![]}];}_0x3d26bd=_['merge']({},_0x3d26bd,_0x172049[_0x50e8('0x3e')]);return db['Cdr'][_0x50e8('0x46')](_0x3d26bd)[_0x50e8('0x23')](handleEntityNotFound(_0x5e9da3,null))[_0x50e8('0x23')](respondWithResult(_0x5e9da3,null))[_0x50e8('0x43')](handleError(_0x5e9da3,null));};exports[_0x50e8('0x47')]=function(_0x3f72ea,_0x229d60){return db[_0x50e8('0x29')][_0x50e8('0x47')](_0x3f72ea[_0x50e8('0x48')],{})[_0x50e8('0x23')](respondWithResult(_0x229d60,0xc9))['catch'](handleError(_0x229d60,null));};exports[_0x50e8('0x22')]=function(_0x275a1b,_0x479431){if(_0x275a1b[_0x50e8('0x48')]['id']){delete _0x275a1b['body']['id'];}return db[_0x50e8('0x29')]['find']({'where':{'id':_0x275a1b[_0x50e8('0x45')]['id']}})[_0x50e8('0x23')](handleEntityNotFound(_0x479431,null))[_0x50e8('0x23')](saveUpdates(_0x275a1b[_0x50e8('0x48')],null))[_0x50e8('0x23')](respondWithResult(_0x479431,null))[_0x50e8('0x43')](handleError(_0x479431,null));};exports[_0x50e8('0x49')]=function(_0x5f256a,_0x3410f3){return db[_0x50e8('0x29')][_0x50e8('0x46')]({'where':{'id':_0x5f256a[_0x50e8('0x45')]['id']}})[_0x50e8('0x23')](handleEntityNotFound(_0x3410f3,null))[_0x50e8('0x23')](removeEntity(_0x3410f3,null))['catch'](handleError(_0x3410f3,null));};exports[_0x50e8('0x4a')]=function(_0x250b28,_0xff2e24){return db[_0x50e8('0x29')]['describe']()[_0x50e8('0x23')](respondWithResult(_0xff2e24,null))[_0x50e8('0x43')](handleError(_0xff2e24,null));};
\ No newline at end of file
+var _0xf9d5=['lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','sendStatus','error','stack','name','index','map','Cdr','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x256823,_0x2392df){var _0x5db66b=function(_0x2bd5d6){while(--_0x2bd5d6){_0x256823['push'](_0x256823['shift']());}};_0x5db66b(++_0x2392df);}(_0xf9d5,0x122));var _0x5f9d=function(_0x2f5b30,_0x1b0a55){_0x2f5b30=_0x2f5b30-0x0;var _0x1d756b=_0xf9d5[_0x2f5b30];return _0x1d756b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f9d('0x0'));var zipdir=require(_0x5f9d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f9d('0x2'));var moment=require(_0x5f9d('0x3'));var BPromise=require(_0x5f9d('0x4'));var Mustache=require(_0x5f9d('0x5'));var util=require(_0x5f9d('0x6'));var path=require(_0x5f9d('0x7'));var sox=require(_0x5f9d('0x8'));var csv=require('to-csv');var ejs=require(_0x5f9d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f9d('0xa'));var squel=require(_0x5f9d('0xb'));var crypto=require('crypto');var jsforce=require(_0x5f9d('0xc'));var deskjs=require(_0x5f9d('0xd'));var toCsv=require(_0x5f9d('0xe'));var querystring=require(_0x5f9d('0xf'));var Papa=require(_0x5f9d('0x10'));var Redis=require(_0x5f9d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5f9d('0x12'));var as=require(_0x5f9d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f9d('0x14'));var utils=require(_0x5f9d('0x15'));var config=require(_0x5f9d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f9d('0x17'))['db'];function respondWithStatusCode(_0x10f5b1,_0x257910){_0x257910=_0x257910||0xcc;return function(_0x23a39f){if(_0x23a39f){return _0x10f5b1['sendStatus'](_0x257910);}return _0x10f5b1[_0x5f9d('0x18')](_0x257910)[_0x5f9d('0x19')]();};}function respondWithResult(_0x234902,_0x5aacdc){_0x5aacdc=_0x5aacdc||0xc8;return function(_0x8e2381){if(_0x8e2381){return _0x234902[_0x5f9d('0x18')](_0x5aacdc)['json'](_0x8e2381);}};}function respondWithFilteredResult(_0x4fd1cb,_0x2f0154){return function(_0x334cea){if(_0x334cea){var _0x3d4a1c=typeof _0x2f0154[_0x5f9d('0x1a')]===_0x5f9d('0x1b')&&typeof _0x2f0154['limit']==='undefined';var _0x54bd00=_0x334cea[_0x5f9d('0x1c')];var _0x4fb9a5=_0x3d4a1c?0x0:_0x2f0154[_0x5f9d('0x1a')];var _0x48448e=_0x3d4a1c?_0x334cea[_0x5f9d('0x1c')]:_0x2f0154[_0x5f9d('0x1a')]+_0x2f0154[_0x5f9d('0x1d')];var _0x55a31c;if(_0x48448e>=_0x54bd00){_0x48448e=_0x54bd00;_0x55a31c=0xc8;}else{_0x55a31c=0xce;}_0x4fd1cb[_0x5f9d('0x18')](_0x55a31c);return _0x4fd1cb[_0x5f9d('0x1e')](_0x5f9d('0x1f'),_0x4fb9a5+'-'+_0x48448e+'/'+_0x54bd00)[_0x5f9d('0x20')](_0x334cea);}return null;};}function patchUpdates(_0x320182){return function(_0xa62826){try{jsonpatch[_0x5f9d('0x21')](_0xa62826,_0x320182,!![]);}catch(_0x2563d5){return BPromise[_0x5f9d('0x22')](_0x2563d5);}return _0xa62826['save']();};}function saveUpdates(_0x4a2eeb,_0x5465b1){return function(_0x1bc76b){if(_0x1bc76b){return _0x1bc76b['update'](_0x4a2eeb)[_0x5f9d('0x23')](function(_0x5a3472){return _0x5a3472;});}return null;};}function removeEntity(_0x9d86ce,_0x564886){return function(_0x4875c5){if(_0x4875c5){return _0x4875c5['destroy']()[_0x5f9d('0x23')](function(){_0x9d86ce[_0x5f9d('0x18')](0xcc)[_0x5f9d('0x19')]();});}};}function handleEntityNotFound(_0x234511,_0x542bbc){return function(_0x379d2d){if(!_0x379d2d){_0x234511[_0x5f9d('0x24')](0x194);}return _0x379d2d;};}function handleError(_0x190402,_0x74f212){_0x74f212=_0x74f212||0x1f4;return function(_0x2d097f){logger[_0x5f9d('0x25')](_0x2d097f[_0x5f9d('0x26')]);if(_0x2d097f[_0x5f9d('0x27')]){delete _0x2d097f[_0x5f9d('0x27')];}_0x190402[_0x5f9d('0x18')](_0x74f212)['send'](_0x2d097f);};}exports[_0x5f9d('0x28')]=function(_0x1b9054,_0x1496c0){var _0x13cc7c={},_0x10e542={},_0x24233e={'count':0x0,'rows':[]};var _0x38b10d=_[_0x5f9d('0x29')](db[_0x5f9d('0x2a')]['rawAttributes'],function(_0x4ed27d){return{'name':_0x4ed27d['fieldName'],'type':_0x4ed27d[_0x5f9d('0x2b')]['key']};});_0x10e542[_0x5f9d('0x2c')]=_['map'](_0x38b10d,_0x5f9d('0x27'));_0x10e542['query']=_[_0x5f9d('0x2d')](_0x1b9054[_0x5f9d('0x2e')]);_0x10e542[_0x5f9d('0x2f')]=_[_0x5f9d('0x30')](_0x10e542[_0x5f9d('0x2c')],_0x10e542['query']);_0x13cc7c[_0x5f9d('0x31')]=_['intersection'](_0x10e542[_0x5f9d('0x2c')],qs['fields'](_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x32')]));_0x13cc7c['attributes']=_0x13cc7c[_0x5f9d('0x31')][_0x5f9d('0x33')]?_0x13cc7c[_0x5f9d('0x31')]:_0x10e542['model'];if(!_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x34')](_0x5f9d('0x35'))){_0x13cc7c[_0x5f9d('0x1d')]=qs[_0x5f9d('0x1d')](_0x1b9054['query'][_0x5f9d('0x1d')]);_0x13cc7c[_0x5f9d('0x1a')]=qs[_0x5f9d('0x1a')](_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x1a')]);}_0x13cc7c[_0x5f9d('0x36')]=qs['sort'](_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x37')]);_0x13cc7c[_0x5f9d('0x38')]=qs['filters'](_['pick'](_0x1b9054[_0x5f9d('0x2e')],_0x10e542[_0x5f9d('0x2f')]),_0x38b10d);if(_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x39')]){_0x13cc7c[_0x5f9d('0x38')]=_['merge'](_0x13cc7c['where'],{'$or':_[_0x5f9d('0x29')](_0x38b10d,function(_0x3c5737){if(_0x3c5737['type']!==_0x5f9d('0x3a')){var _0x4e15be={};_0x4e15be[_0x3c5737[_0x5f9d('0x27')]]={'$like':'%'+_0x1b9054[_0x5f9d('0x2e')]['filter']+'%'};return _0x4e15be;}})});}_0x13cc7c=_[_0x5f9d('0x3b')]({},_0x13cc7c,_0x1b9054[_0x5f9d('0x3c')]);var _0x4d3288={'where':_0x13cc7c['where']};return db[_0x5f9d('0x2a')][_0x5f9d('0x1c')](_0x4d3288)[_0x5f9d('0x23')](function(_0x3c43f6){_0x24233e[_0x5f9d('0x1c')]=_0x3c43f6;if(_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x3d')]){_0x13cc7c[_0x5f9d('0x3e')]=[{'all':!![]}];}return db[_0x5f9d('0x2a')][_0x5f9d('0x3f')](_0x13cc7c);})[_0x5f9d('0x23')](function(_0x227ef6){_0x24233e[_0x5f9d('0x40')]=_0x227ef6;return _0x24233e;})[_0x5f9d('0x23')](respondWithFilteredResult(_0x1496c0,_0x13cc7c))[_0x5f9d('0x41')](handleError(_0x1496c0,null));};exports[_0x5f9d('0x42')]=function(_0x45ba15,_0x1590b5){var _0xf02211={'raw':!![],'where':{'id':_0x45ba15[_0x5f9d('0x43')]['id']}},_0x21b5d1={};_0x21b5d1[_0x5f9d('0x2c')]=_[_0x5f9d('0x2d')](db[_0x5f9d('0x2a')][_0x5f9d('0x44')]);_0x21b5d1[_0x5f9d('0x2e')]=_[_0x5f9d('0x2d')](_0x45ba15[_0x5f9d('0x2e')]);_0x21b5d1[_0x5f9d('0x2f')]=_[_0x5f9d('0x30')](_0x21b5d1['model'],_0x21b5d1[_0x5f9d('0x2e')]);_0xf02211['attributes']=_[_0x5f9d('0x30')](_0x21b5d1[_0x5f9d('0x2c')],qs[_0x5f9d('0x32')](_0x45ba15[_0x5f9d('0x2e')][_0x5f9d('0x32')]));_0xf02211[_0x5f9d('0x31')]=_0xf02211[_0x5f9d('0x31')]['length']?_0xf02211[_0x5f9d('0x31')]:_0x21b5d1[_0x5f9d('0x2c')];if(_0x45ba15[_0x5f9d('0x2e')]['includeAll']){_0xf02211[_0x5f9d('0x3e')]=[{'all':!![]}];}_0xf02211=_['merge']({},_0xf02211,_0x45ba15[_0x5f9d('0x3c')]);return db[_0x5f9d('0x2a')][_0x5f9d('0x45')](_0xf02211)['then'](handleEntityNotFound(_0x1590b5,null))['then'](respondWithResult(_0x1590b5,null))[_0x5f9d('0x41')](handleError(_0x1590b5,null));};exports[_0x5f9d('0x46')]=function(_0x4c9645,_0x2a43a3){return db['Cdr'][_0x5f9d('0x46')](_0x4c9645[_0x5f9d('0x47')],{})[_0x5f9d('0x23')](respondWithResult(_0x2a43a3,0xc9))[_0x5f9d('0x41')](handleError(_0x2a43a3,null));};exports[_0x5f9d('0x48')]=function(_0x16a9fa,_0x3aa63c){if(_0x16a9fa[_0x5f9d('0x47')]['id']){delete _0x16a9fa[_0x5f9d('0x47')]['id'];}return db[_0x5f9d('0x2a')]['find']({'where':{'id':_0x16a9fa[_0x5f9d('0x43')]['id']}})[_0x5f9d('0x23')](handleEntityNotFound(_0x3aa63c,null))['then'](saveUpdates(_0x16a9fa[_0x5f9d('0x47')],null))[_0x5f9d('0x23')](respondWithResult(_0x3aa63c,null))[_0x5f9d('0x41')](handleError(_0x3aa63c,null));};exports[_0x5f9d('0x49')]=function(_0xc9a152,_0x414868){return db[_0x5f9d('0x2a')][_0x5f9d('0x45')]({'where':{'id':_0xc9a152['params']['id']}})['then'](handleEntityNotFound(_0x414868,null))[_0x5f9d('0x23')](removeEntity(_0x414868,null))[_0x5f9d('0x41')](handleError(_0x414868,null));};exports[_0x5f9d('0x4a')]=function(_0x101616,_0x97aac2){return db[_0x5f9d('0x2a')][_0x5f9d('0x4a')]()[_0x5f9d('0x23')](respondWithResult(_0x97aac2,null))[_0x5f9d('0x41')](handleError(_0x97aac2,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index f7d46f0..2c100c3 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(_0x3ae1aa,_0x1bb16a){var _0x51d70a=function(_0x58ba64){while(--_0x58ba64){_0x3ae1aa['push'](_0x3ae1aa['shift']());}};_0x51d70a(++_0x1bb16a);}(_0x7a54,0x106));var _0x47a5=function(_0x49fdd8,_0x18d74e){_0x49fdd8=_0x49fdd8-0x0;var _0xce2281=_0x7a54[_0x49fdd8];return _0xce2281;};'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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x559d58,_0x132357){var _0xcc7a44=function(_0x4d584f){while(--_0x4d584f){_0x559d58['push'](_0x559d58['shift']());}};_0xcc7a44(++_0x132357);}(_0x7a54,0x106));var _0x47a5=function(_0x198483,_0x55a8aa){_0x198483=_0x198483-0x0;var _0x420714=_0x7a54[_0x198483];return _0x420714;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index b3f8b34..dae4982 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 _0x7aa7=['client','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3f287f,_0x2fdfab){var _0x2305b7=function(_0x41d729){while(--_0x41d729){_0x3f287f['push'](_0x3f287f['shift']());}};_0x2305b7(++_0x2fdfab);}(_0x7aa7,0x171));var _0x77aa=function(_0x5aa480,_0x4317b3){_0x5aa480=_0x5aa480-0x0;var _0xbde51d=_0x7aa7[_0x5aa480];return _0xbde51d;};'use strict';var _=require(_0x77aa('0x0'));var util=require(_0x77aa('0x1'));var moment=require(_0x77aa('0x2'));var BPromise=require('bluebird');var rs=require(_0x77aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x77aa('0x4'))['db'];var utils=require(_0x77aa('0x5'));var logger=require(_0x77aa('0x6'))(_0x77aa('0x7'));var config=require('../../config/environment');var jayson=require(_0x77aa('0x8'));var client=jayson[_0x77aa('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a40c2,_0x2fbd6c,_0x1429ae){return new BPromise(function(_0xfd90f2,_0x3b2f31){return client['request'](_0x5a40c2,_0x1429ae)['then'](function(_0x56ab8f){logger[_0x77aa('0xa')](_0x77aa('0xb'),_0x2fbd6c,_0x77aa('0xc'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x2fbd6c,_0x77aa('0xc'),JSON[_0x77aa('0xd')](_0x56ab8f));if(_0x56ab8f[_0x77aa('0xe')]){if(_0x56ab8f[_0x77aa('0xe')][_0x77aa('0xf')]===0x1f4){logger[_0x77aa('0xe')](_0x77aa('0xb'),_0x2fbd6c,_0x56ab8f[_0x77aa('0xe')]['message']);return _0x3b2f31(_0x56ab8f[_0x77aa('0xe')][_0x77aa('0x10')]);}logger[_0x77aa('0xe')](_0x77aa('0xb'),_0x2fbd6c,_0x56ab8f[_0x77aa('0xe')]['message']);return _0xfd90f2(_0x56ab8f['error'][_0x77aa('0x10')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x2fbd6c,_0x77aa('0xc'));_0xfd90f2(_0x56ab8f['result']['message']);}})[_0x77aa('0x11')](function(_0x3e991f){logger[_0x77aa('0xe')](_0x77aa('0xb'),_0x2fbd6c,_0x3e991f);_0x3b2f31(_0x3e991f);});});}
\ No newline at end of file
+var _0xd649=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','Cdr,\x20%s,\x20%s','message','catch','lodash','util','bluebird'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0xd649,0x19f));var _0x9d64=function(_0x285233,_0x58e017){_0x285233=_0x285233-0x0;var _0x2e9a77=_0xd649[_0x285233];return _0x2e9a77;};'use strict';var _=require(_0x9d64('0x0'));var util=require(_0x9d64('0x1'));var moment=require('moment');var BPromise=require(_0x9d64('0x2'));var rs=require(_0x9d64('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d64('0x4'))['db'];var utils=require(_0x9d64('0x5'));var logger=require(_0x9d64('0x6'))(_0x9d64('0x7'));var config=require(_0x9d64('0x8'));var jayson=require(_0x9d64('0x9'));var client=jayson[_0x9d64('0xa')][_0x9d64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a7823,_0x101922,_0x7d616e){return new BPromise(function(_0x42fdac,_0xf1b4b){return client[_0x9d64('0xc')](_0x2a7823,_0x7d616e)[_0x9d64('0xd')](function(_0x4b7938){logger[_0x9d64('0xe')]('Cdr,\x20%s,\x20%s',_0x101922,_0x9d64('0xf'));logger[_0x9d64('0x10')]('Cdr,\x20%s,\x20%s,\x20%s',_0x101922,'request\x20sent',JSON['stringify'](_0x4b7938));if(_0x4b7938['error']){if(_0x4b7938[_0x9d64('0x11')][_0x9d64('0x12')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x101922,_0x4b7938[_0x9d64('0x11')]['message']);return _0xf1b4b(_0x4b7938[_0x9d64('0x11')]['message']);}logger[_0x9d64('0x11')](_0x9d64('0x13'),_0x101922,_0x4b7938['error'][_0x9d64('0x14')]);return _0x42fdac(_0x4b7938[_0x9d64('0x11')][_0x9d64('0x14')]);}else{logger[_0x9d64('0xe')]('Cdr,\x20%s,\x20%s',_0x101922,_0x9d64('0xf'));_0x42fdac(_0x4b7938['result'][_0x9d64('0x14')]);}})[_0x9d64('0x15')](function(_0x5e6257){logger[_0x9d64('0x11')]('Cdr,\x20%s,\x20%s',_0x101922,_0x5e6257);_0xf1b4b(_0x5e6257);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index f063298..57469bd 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _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(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 2ed42ef..cfa0d7a 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 _0x4a8d=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x869ff8,_0xf525f6){var _0x20fdc1=function(_0x1a23ab){while(--_0x1a23ab){_0x869ff8['push'](_0x869ff8['shift']());}};_0x20fdc1(++_0xf525f6);}(_0x4a8d,0x11f));var _0xd4a8=function(_0xc1773,_0x393c9c){_0xc1773=_0xc1773-0x0;var _0x1fbcf0=_0x4a8d[_0xc1773];return _0x1fbcf0;};'use strict';var Sequelize=require(_0xd4a8('0x0'));module[_0xd4a8('0x1')]={'priority':{'type':Sequelize[_0xd4a8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd4a8('0x3')],'allowNull':![],'defaultValue':_0xd4a8('0x4')},'appdata':{'type':Sequelize[_0xd4a8('0x5')]()},'description':{'type':Sequelize[_0xd4a8('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd4a8('0x6')}};
\ No newline at end of file
+var _0x25a5=['TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x33007f,_0x4b38d2){var _0x10d38c=function(_0x497992){while(--_0x497992){_0x33007f['push'](_0x33007f['shift']());}};_0x10d38c(++_0x4b38d2);}(_0x25a5,0xa2));var _0x525a=function(_0x3c328f,_0x295abd){_0x3c328f=_0x3c328f-0x0;var _0x3fc412=_0x25a5[_0x3c328f];return _0x3fc412;};'use strict';var Sequelize=require(_0x525a('0x0'));module['exports']={'priority':{'type':Sequelize[_0x525a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x525a('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x525a('0x3')]()},'description':{'type':Sequelize[_0x525a('0x2')]},'interval':{'type':Sequelize[_0x525a('0x2')],'defaultValue':_0x525a('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index b5dad77..8a20bec 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 _0xbc9d=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','then','stack','name','send','show','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','options','body','ChatApplication','find','params','catch'];(function(_0x928174,_0x47a9c8){var _0x50a603=function(_0x8fb37e){while(--_0x8fb37e){_0x928174['push'](_0x928174['shift']());}};_0x50a603(++_0x47a9c8);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x4cdb37,_0x2aa998){_0x4cdb37=_0x4cdb37-0x0;var _0x5ef6d6=_0xbc9d[_0x4cdb37];return _0x5ef6d6;};'use strict';var emlformat=require(_0xdbc9('0x0'));var rimraf=require(_0xdbc9('0x1'));var zipdir=require(_0xdbc9('0x2'));var jsonpatch=require(_0xdbc9('0x3'));var rp=require(_0xdbc9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdbc9('0x5'));var path=require(_0xdbc9('0x6'));var sox=require(_0xdbc9('0x7'));var csv=require(_0xdbc9('0x8'));var ejs=require(_0xdbc9('0x9'));var fs=require('fs');var fs_extra=require(_0xdbc9('0xa'));var _=require(_0xdbc9('0xb'));var squel=require('squel');var crypto=require(_0xdbc9('0xc'));var jsforce=require(_0xdbc9('0xd'));var deskjs=require(_0xdbc9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbc9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbc9('0x10'));var qs=require(_0xdbc9('0x11'));var as=require(_0xdbc9('0x12'));var hardwareService=require(_0xdbc9('0x13'));var logger=require('../../config/logger')(_0xdbc9('0x14'));var utils=require(_0xdbc9('0x15'));var config=require(_0xdbc9('0x16'));var licenseUtil=require(_0xdbc9('0x17'));var db=require(_0xdbc9('0x18'))['db'];function respondWithStatusCode(_0x103d54,_0x48bc83){_0x48bc83=_0x48bc83||0xcc;return function(_0x567e71){if(_0x567e71){return _0x103d54[_0xdbc9('0x19')](_0x48bc83);}return _0x103d54[_0xdbc9('0x1a')](_0x48bc83)[_0xdbc9('0x1b')]();};}function respondWithResult(_0x436e50,_0x53495d){_0x53495d=_0x53495d||0xc8;return function(_0x4a9dcb){if(_0x4a9dcb){return _0x436e50[_0xdbc9('0x1a')](_0x53495d)[_0xdbc9('0x1c')](_0x4a9dcb);}};}function respondWithFilteredResult(_0x3a8a7b,_0x4c7b4f){return function(_0x1b4616){if(_0x1b4616){var _0x1abee8=typeof _0x4c7b4f['offset']===_0xdbc9('0x1d')&&typeof _0x4c7b4f[_0xdbc9('0x1e')]===_0xdbc9('0x1d');var _0x14e655=_0x1b4616[_0xdbc9('0x1f')];var _0x33f1bd=_0x1abee8?0x0:_0x4c7b4f[_0xdbc9('0x20')];var _0xc2ddd2=_0x1abee8?_0x1b4616[_0xdbc9('0x1f')]:_0x4c7b4f[_0xdbc9('0x20')]+_0x4c7b4f['limit'];var _0x1ca5fd;if(_0xc2ddd2>=_0x14e655){_0xc2ddd2=_0x14e655;_0x1ca5fd=0xc8;}else{_0x1ca5fd=0xce;}_0x3a8a7b['status'](_0x1ca5fd);return _0x3a8a7b[_0xdbc9('0x21')](_0xdbc9('0x22'),_0x33f1bd+'-'+_0xc2ddd2+'/'+_0x14e655)['json'](_0x1b4616);}return null;};}function patchUpdates(_0x4408e9){return function(_0x5367dc){try{jsonpatch['apply'](_0x5367dc,_0x4408e9,!![]);}catch(_0x4ab00d){return BPromise['reject'](_0x4ab00d);}return _0x5367dc[_0xdbc9('0x23')]();};}function saveUpdates(_0x2011a2,_0x570ad9){return function(_0x16dcf7){if(_0x16dcf7){return _0x16dcf7[_0xdbc9('0x24')](_0x2011a2)['then'](function(_0x1bc073){return _0x1bc073;});}return null;};}function removeEntity(_0x6b788,_0x1b1c0d){return function(_0x119230){if(_0x119230){return _0x119230[_0xdbc9('0x25')]()[_0xdbc9('0x26')](function(){_0x6b788[_0xdbc9('0x1a')](0xcc)[_0xdbc9('0x1b')]();});}};}function handleEntityNotFound(_0x3c8c1d,_0x4a868b){return function(_0x550bef){if(!_0x550bef){_0x3c8c1d[_0xdbc9('0x19')](0x194);}return _0x550bef;};}function handleError(_0x446ab9,_0x1053ca){_0x1053ca=_0x1053ca||0x1f4;return function(_0x24fdec){logger['error'](_0x24fdec[_0xdbc9('0x27')]);if(_0x24fdec[_0xdbc9('0x28')]){delete _0x24fdec['name'];}_0x446ab9['status'](_0x1053ca)[_0xdbc9('0x29')](_0x24fdec);};}exports[_0xdbc9('0x2a')]=function(_0x473430,_0x59bfd2){var _0x13a432={'raw':!![],'where':{'id':_0x473430['params']['id']}},_0x539e57={};_0x539e57[_0xdbc9('0x2b')]=_['keys'](db['ChatApplication'][_0xdbc9('0x2c')]);_0x539e57[_0xdbc9('0x2d')]=_[_0xdbc9('0x2e')](_0x473430['query']);_0x539e57[_0xdbc9('0x2f')]=_[_0xdbc9('0x30')](_0x539e57['model'],_0x539e57['query']);_0x13a432[_0xdbc9('0x31')]=_[_0xdbc9('0x30')](_0x539e57[_0xdbc9('0x2b')],qs[_0xdbc9('0x32')](_0x473430[_0xdbc9('0x2d')][_0xdbc9('0x32')]));_0x13a432[_0xdbc9('0x31')]=_0x13a432['attributes'][_0xdbc9('0x33')]?_0x13a432[_0xdbc9('0x31')]:_0x539e57[_0xdbc9('0x2b')];if(_0x473430[_0xdbc9('0x2d')][_0xdbc9('0x34')]){_0x13a432[_0xdbc9('0x35')]=[{'all':!![]}];}_0x13a432=_['merge']({},_0x13a432,_0x473430[_0xdbc9('0x36')]);return db['ChatApplication']['find'](_0x13a432)['then'](handleEntityNotFound(_0x59bfd2,null))['then'](respondWithResult(_0x59bfd2,null))['catch'](handleError(_0x59bfd2,null));};exports[_0xdbc9('0x24')]=function(_0x186012,_0x205123){if(_0x186012['body']['id']){delete _0x186012[_0xdbc9('0x37')]['id'];}return db[_0xdbc9('0x38')][_0xdbc9('0x39')]({'where':{'id':_0x186012[_0xdbc9('0x3a')]['id']}})[_0xdbc9('0x26')](handleEntityNotFound(_0x205123,null))[_0xdbc9('0x26')](saveUpdates(_0x186012['body'],null))[_0xdbc9('0x26')](respondWithResult(_0x205123,null))[_0xdbc9('0x3b')](handleError(_0x205123,null));};exports[_0xdbc9('0x25')]=function(_0x52f3b5,_0x2f07fe){return db[_0xdbc9('0x38')][_0xdbc9('0x39')]({'where':{'id':_0x52f3b5[_0xdbc9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x2f07fe,null))['then'](removeEntity(_0x2f07fe,null))[_0xdbc9('0x3b')](handleError(_0x2f07fe,null));};
\ No newline at end of file
+var _0xb11e=['send','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','options','find','catch','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','count','then','destroy','sendStatus','stack','name'];(function(_0x1e1965,_0x55785c){var _0x1a2e96=function(_0x27d366){while(--_0x27d366){_0x1e1965['push'](_0x1e1965['shift']());}};_0x1a2e96(++_0x55785c);}(_0xb11e,0x7d));var _0xeb11=function(_0x331b3c,_0xa86628){_0x331b3c=_0x331b3c-0x0;var _0x5bbba3=_0xb11e[_0x331b3c];return _0x5bbba3;};'use strict';var emlformat=require(_0xeb11('0x0'));var rimraf=require(_0xeb11('0x1'));var zipdir=require(_0xeb11('0x2'));var jsonpatch=require(_0xeb11('0x3'));var rp=require(_0xeb11('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeb11('0x5'));var util=require(_0xeb11('0x6'));var path=require(_0xeb11('0x7'));var sox=require(_0xeb11('0x8'));var csv=require('to-csv');var ejs=require(_0xeb11('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xeb11('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeb11('0xb'));var toCsv=require(_0xeb11('0xc'));var querystring=require(_0xeb11('0xd'));var Papa=require('papaparse');var Redis=require(_0xeb11('0xe'));var authService=require(_0xeb11('0xf'));var qs=require(_0xeb11('0x10'));var as=require(_0xeb11('0x11'));var hardwareService=require(_0xeb11('0x12'));var logger=require(_0xeb11('0x13'))(_0xeb11('0x14'));var utils=require(_0xeb11('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xeb11('0x16'));var db=require(_0xeb11('0x17'))['db'];function respondWithStatusCode(_0x15b1e4,_0x517962){_0x517962=_0x517962||0xcc;return function(_0x44b192){if(_0x44b192){return _0x15b1e4['sendStatus'](_0x517962);}return _0x15b1e4[_0xeb11('0x18')](_0x517962)['end']();};}function respondWithResult(_0x5d183d,_0x146cfa){_0x146cfa=_0x146cfa||0xc8;return function(_0x2e0d2c){if(_0x2e0d2c){return _0x5d183d[_0xeb11('0x18')](_0x146cfa)[_0xeb11('0x19')](_0x2e0d2c);}};}function respondWithFilteredResult(_0x4c6a67,_0x58d276){return function(_0x200730){if(_0x200730){var _0xd1a9bf=typeof _0x58d276[_0xeb11('0x1a')]==='undefined'&&typeof _0x58d276[_0xeb11('0x1b')]==='undefined';var _0x33a996=_0x200730[_0xeb11('0x1c')];var _0x139ff8=_0xd1a9bf?0x0:_0x58d276['offset'];var _0xf36770=_0xd1a9bf?_0x200730[_0xeb11('0x1c')]:_0x58d276['offset']+_0x58d276['limit'];var _0x1906db;if(_0xf36770>=_0x33a996){_0xf36770=_0x33a996;_0x1906db=0xc8;}else{_0x1906db=0xce;}_0x4c6a67[_0xeb11('0x18')](_0x1906db);return _0x4c6a67['set']('Content-Range',_0x139ff8+'-'+_0xf36770+'/'+_0x33a996)[_0xeb11('0x19')](_0x200730);}return null;};}function patchUpdates(_0xf057c){return function(_0x4dfe03){try{jsonpatch['apply'](_0x4dfe03,_0xf057c,!![]);}catch(_0x17af28){return BPromise['reject'](_0x17af28);}return _0x4dfe03['save']();};}function saveUpdates(_0x5779df,_0xeeb427){return function(_0x1caf4f){if(_0x1caf4f){return _0x1caf4f['update'](_0x5779df)[_0xeb11('0x1d')](function(_0x40a4cb){return _0x40a4cb;});}return null;};}function removeEntity(_0x53e48d,_0x1c526d){return function(_0x3b2e1a){if(_0x3b2e1a){return _0x3b2e1a[_0xeb11('0x1e')]()['then'](function(){_0x53e48d[_0xeb11('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b97b5,_0x8af064){return function(_0x2a4fc6){if(!_0x2a4fc6){_0x5b97b5[_0xeb11('0x1f')](0x194);}return _0x2a4fc6;};}function handleError(_0x59e3fb,_0x4d8cf8){_0x4d8cf8=_0x4d8cf8||0x1f4;return function(_0xca08dd){logger['error'](_0xca08dd[_0xeb11('0x20')]);if(_0xca08dd[_0xeb11('0x21')]){delete _0xca08dd[_0xeb11('0x21')];}_0x59e3fb[_0xeb11('0x18')](_0x4d8cf8)[_0xeb11('0x22')](_0xca08dd);};}exports['show']=function(_0x1d9bf7,_0x387fb7){var _0x4ee70a={'raw':!![],'where':{'id':_0x1d9bf7['params']['id']}},_0x104561={};_0x104561[_0xeb11('0x23')]=_[_0xeb11('0x24')](db[_0xeb11('0x25')][_0xeb11('0x26')]);_0x104561[_0xeb11('0x27')]=_[_0xeb11('0x24')](_0x1d9bf7[_0xeb11('0x27')]);_0x104561[_0xeb11('0x28')]=_[_0xeb11('0x29')](_0x104561['model'],_0x104561[_0xeb11('0x27')]);_0x4ee70a['attributes']=_[_0xeb11('0x29')](_0x104561[_0xeb11('0x23')],qs[_0xeb11('0x2a')](_0x1d9bf7['query']['fields']));_0x4ee70a[_0xeb11('0x2b')]=_0x4ee70a[_0xeb11('0x2b')][_0xeb11('0x2c')]?_0x4ee70a[_0xeb11('0x2b')]:_0x104561['model'];if(_0x1d9bf7[_0xeb11('0x27')][_0xeb11('0x2d')]){_0x4ee70a[_0xeb11('0x2e')]=[{'all':!![]}];}_0x4ee70a=_['merge']({},_0x4ee70a,_0x1d9bf7[_0xeb11('0x2f')]);return db['ChatApplication'][_0xeb11('0x30')](_0x4ee70a)['then'](handleEntityNotFound(_0x387fb7,null))[_0xeb11('0x1d')](respondWithResult(_0x387fb7,null))[_0xeb11('0x31')](handleError(_0x387fb7,null));};exports[_0xeb11('0x32')]=function(_0x3641b3,_0x3147c8){if(_0x3641b3[_0xeb11('0x33')]['id']){delete _0x3641b3[_0xeb11('0x33')]['id'];}return db['ChatApplication'][_0xeb11('0x30')]({'where':{'id':_0x3641b3['params']['id']}})[_0xeb11('0x1d')](handleEntityNotFound(_0x3147c8,null))['then'](saveUpdates(_0x3641b3[_0xeb11('0x33')],null))[_0xeb11('0x1d')](respondWithResult(_0x3147c8,null))[_0xeb11('0x31')](handleError(_0x3147c8,null));};exports[_0xeb11('0x1e')]=function(_0x53a811,_0x149431){return db[_0xeb11('0x25')][_0xeb11('0x30')]({'where':{'id':_0x53a811[_0xeb11('0x34')]['id']}})[_0xeb11('0x1d')](handleEntityNotFound(_0x149431,null))[_0xeb11('0x1d')](removeEntity(_0x149431,null))[_0xeb11('0x31')](handleError(_0x149431,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 912be1b..2c0ebce 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 _0xcc49=['define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x189df9,_0x260093){var _0x3b879d=function(_0x376433){while(--_0x376433){_0x189df9['push'](_0x189df9['shift']());}};_0x3b879d(++_0x260093);}(_0xcc49,0x155));var _0x9cc4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xcc49[_0x432682];return _0x463d05;};'use strict';var _=require(_0x9cc4('0x0'));var util=require(_0x9cc4('0x1'));var logger=require(_0x9cc4('0x2'))(_0x9cc4('0x3'));var moment=require(_0x9cc4('0x4'));var BPromise=require(_0x9cc4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cc4('0x6'));var rimraf=require(_0x9cc4('0x7'));var config=require(_0x9cc4('0x8'));var attributes=require('./chatApplication.attributes');module[_0x9cc4('0x9')]=function(_0x48faa6,_0x1859c7){return _0x48faa6[_0x9cc4('0xa')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9cc4('0xb'),'collate':_0x9cc4('0xc')});};
\ No newline at end of file
+var _0x149c=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4'];(function(_0x5e005e,_0x2b9f1c){var _0x22a48e=function(_0xd00148){while(--_0xd00148){_0x5e005e['push'](_0x5e005e['shift']());}};_0x22a48e(++_0x2b9f1c);}(_0x149c,0x143));var _0xc149=function(_0x4468f6,_0x1886f8){_0x4468f6=_0x4468f6-0x0;var _0x1a9eda=_0x149c[_0x4468f6];return _0x1a9eda;};'use strict';var _=require(_0xc149('0x0'));var util=require('util');var logger=require(_0xc149('0x1'))(_0xc149('0x2'));var moment=require(_0xc149('0x3'));var BPromise=require('bluebird');var rp=require(_0xc149('0x4'));var fs=require('fs');var path=require(_0xc149('0x5'));var rimraf=require(_0xc149('0x6'));var config=require(_0xc149('0x7'));var attributes=require(_0xc149('0x8'));module[_0xc149('0x9')]=function(_0x3b5e34,_0x5e9b5c){return _0x3b5e34['define'](_0xc149('0xa'),attributes,{'tableName':_0xc149('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc149('0xc'),'collate':_0xc149('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 2c8744a..fd55841 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 _0x6d74=['request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x6d74,0x1d3));var _0x46d7=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x6d74[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x46d7('0x0'));var util=require('util');var moment=require(_0x46d7('0x1'));var BPromise=require(_0x46d7('0x2'));var rs=require(_0x46d7('0x3'));var fs=require('fs');var Redis=require(_0x46d7('0x4'));var db=require(_0x46d7('0x5'))['db'];var utils=require(_0x46d7('0x6'));var logger=require(_0x46d7('0x7'))(_0x46d7('0x8'));var config=require(_0x46d7('0x9'));var jayson=require(_0x46d7('0xa'));var client=jayson[_0x46d7('0xb')][_0x46d7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c5823,_0x5f533d,_0x35ef03){return new BPromise(function(_0x4b525b,_0x30535f){return client[_0x46d7('0xd')](_0x4c5823,_0x35ef03)['then'](function(_0x3e388b){logger[_0x46d7('0xe')](_0x46d7('0xf'),_0x5f533d,_0x46d7('0x10'));logger[_0x46d7('0x11')](_0x46d7('0x12'),_0x5f533d,_0x46d7('0x10'),JSON[_0x46d7('0x13')](_0x3e388b));if(_0x3e388b[_0x46d7('0x14')]){if(_0x3e388b['error'][_0x46d7('0x15')]===0x1f4){logger[_0x46d7('0x14')](_0x46d7('0xf'),_0x5f533d,_0x3e388b['error'][_0x46d7('0x16')]);return _0x30535f(_0x3e388b[_0x46d7('0x14')][_0x46d7('0x16')]);}logger[_0x46d7('0x14')](_0x46d7('0xf'),_0x5f533d,_0x3e388b[_0x46d7('0x14')]['message']);return _0x4b525b(_0x3e388b[_0x46d7('0x14')]['message']);}else{logger[_0x46d7('0xe')]('ChatApplication,\x20%s,\x20%s',_0x5f533d,'request\x20sent');_0x4b525b(_0x3e388b['result'][_0x46d7('0x16')]);}})['catch'](function(_0x23b1f5){logger['error'](_0x46d7('0xf'),_0x5f533d,_0x23b1f5);_0x30535f(_0x23b1f5);});});}
\ No newline at end of file
+var _0x477d=['error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x450027,_0x5ad1e4){var _0x30712f=function(_0xdf85ec){while(--_0xdf85ec){_0x450027['push'](_0x450027['shift']());}};_0x30712f(++_0x5ad1e4);}(_0x477d,0x134));var _0xd477=function(_0x4fa2d0,_0x19f947){_0x4fa2d0=_0x4fa2d0-0x0;var _0x19fc92=_0x477d[_0x4fa2d0];return _0x19fc92;};'use strict';var _=require(_0xd477('0x0'));var util=require(_0xd477('0x1'));var moment=require(_0xd477('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd477('0x3'));var db=require(_0xd477('0x4'))['db'];var utils=require(_0xd477('0x5'));var logger=require(_0xd477('0x6'))(_0xd477('0x7'));var config=require('../../config/environment');var jayson=require(_0xd477('0x8'));var client=jayson['client'][_0xd477('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f3c9a,_0x2b796f,_0x5ed887){return new BPromise(function(_0x24c8e8,_0x1c5a83){return client[_0xd477('0xa')](_0x2f3c9a,_0x5ed887)[_0xd477('0xb')](function(_0x8584bf){logger[_0xd477('0xc')](_0xd477('0xd'),_0x2b796f,'request\x20sent');logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x2b796f,_0xd477('0xe'),JSON['stringify'](_0x8584bf));if(_0x8584bf[_0xd477('0xf')]){if(_0x8584bf[_0xd477('0xf')][_0xd477('0x10')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x2b796f,_0x8584bf[_0xd477('0xf')]['message']);return _0x1c5a83(_0x8584bf[_0xd477('0xf')][_0xd477('0x11')]);}logger['error'](_0xd477('0xd'),_0x2b796f,_0x8584bf[_0xd477('0xf')][_0xd477('0x11')]);return _0x24c8e8(_0x8584bf[_0xd477('0xf')][_0xd477('0x11')]);}else{logger['info'](_0xd477('0xd'),_0x2b796f,_0xd477('0xe'));_0x24c8e8(_0x8584bf['result'][_0xd477('0x11')]);}})[_0xd477('0x12')](function(_0x25c14b){logger[_0xd477('0xf')](_0xd477('0xd'),_0x2b796f,_0x25c14b);_0x1c5a83(_0x25c14b);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index d6dd3f1..b41e137 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 _0xd8d9=['multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','delete','isAuthenticated','destroy','exports'];(function(_0x2416b9,_0x313d5d){var _0x9eefeb=function(_0x4265bd){while(--_0x4265bd){_0x2416b9['push'](_0x2416b9['shift']());}};_0x9eefeb(++_0x313d5d);}(_0xd8d9,0x130));var _0x9d8d=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xd8d9[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x9d8d('0x0'));var util=require('util');var path=require(_0x9d8d('0x1'));var timeout=require('connect-timeout');var express=require(_0x9d8d('0x2'));var router=express['Router']();var fs_extra=require(_0x9d8d('0x3'));var auth=require(_0x9d8d('0x4'));var interaction=require(_0x9d8d('0x5'));var config=require(_0x9d8d('0x6'));var controller=require(_0x9d8d('0x7'));router[_0x9d8d('0x8')](_0x9d8d('0x9'),auth['isAuthenticated'](),controller[_0x9d8d('0xa')]);router[_0x9d8d('0xb')](_0x9d8d('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x9d8d('0xc')]('/:id',auth[_0x9d8d('0xd')](),controller[_0x9d8d('0xe')]);module[_0x9d8d('0xf')]=router;
\ No newline at end of file
+var _0x9449=['/:id','isAuthenticated','show','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get'];(function(_0x32a81f,_0x4eee66){var _0x5b67a2=function(_0x35d368){while(--_0x35d368){_0x32a81f['push'](_0x32a81f['shift']());}};_0x5b67a2(++_0x4eee66);}(_0x9449,0xca));var _0x9944=function(_0x2ccd6a,_0x51eb42){_0x2ccd6a=_0x2ccd6a-0x0;var _0x60a6c8=_0x9449[_0x2ccd6a];return _0x60a6c8;};'use strict';var multer=require(_0x9944('0x0'));var util=require(_0x9944('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9944('0x2')]();var fs_extra=require(_0x9944('0x3'));var auth=require(_0x9944('0x4'));var interaction=require(_0x9944('0x5'));var config=require('../../config/environment');var controller=require(_0x9944('0x6'));router[_0x9944('0x7')](_0x9944('0x8'),auth[_0x9944('0x9')](),controller[_0x9944('0xa')]);router['put'](_0x9944('0x8'),auth[_0x9944('0x9')](),controller['update']);router[_0x9944('0xb')](_0x9944('0x8'),auth[_0x9944('0x9')](),controller[_0x9944('0xc')]);module[_0x9944('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 4bf6692..d16609b 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 _0x18af=['BOOLEAN','sequelize','STRING'];(function(_0x120abd,_0x5c9313){var _0x84a06c=function(_0x281bb2){while(--_0x281bb2){_0x120abd['push'](_0x120abd['shift']());}};_0x84a06c(++_0x5c9313);}(_0x18af,0x8b));var _0xf18a=function(_0x2f39ea,_0x54cca1){_0x2f39ea=_0x2f39ea-0x0;var _0x5b7527=_0x18af[_0x2f39ea];return _0x5b7527;};'use strict';var Sequelize=require(_0xf18a('0x0'));module['exports']={'name':{'type':Sequelize[_0xf18a('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xf18a('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x80cf=['sequelize','exports','STRING'];(function(_0x195ad,_0x464052){var _0x28d60c=function(_0x257020){while(--_0x257020){_0x195ad['push'](_0x195ad['shift']());}};_0x28d60c(++_0x464052);}(_0x80cf,0xfc));var _0xf80c=function(_0x4076d1,_0x1d2751){_0x4076d1=_0x4076d1-0x0;var _0x2f2aef=_0x80cf[_0x4076d1];return _0x2f2aef;};'use strict';var Sequelize=require(_0xf80c('0x0'));module[_0xf80c('0x1')]={'name':{'type':Sequelize[_0xf80c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'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 8a441d1..eda4933 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 _0x2cb0=['filters','where','merge','VIRTUAL','filter','options','findAll','rows','show','params','includeAll','include','catch','create','body','find','getUnread','user','toInteger','addMembers','ids','getMembers','findOne','removeMembers','ChatGroupId','ChatInternalMessage','pick','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','end','json','undefined','count','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','ChatGroup','rawAttributes','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort'];(function(_0x608576,_0x21ed02){var _0x531312=function(_0x1c2971){while(--_0x1c2971){_0x608576['push'](_0x608576['shift']());}};_0x531312(++_0x21ed02);}(_0x2cb0,0x7b));var _0x02cb=function(_0x2d1e52,_0x338038){_0x2d1e52=_0x2d1e52-0x0;var _0x47097d=_0x2cb0[_0x2d1e52];return _0x47097d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x02cb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x02cb('0x1'));var rp=require(_0x02cb('0x2'));var moment=require(_0x02cb('0x3'));var BPromise=require(_0x02cb('0x4'));var Mustache=require('mustache');var util=require(_0x02cb('0x5'));var path=require('path');var sox=require(_0x02cb('0x6'));var csv=require(_0x02cb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x02cb('0x8'));var crypto=require(_0x02cb('0x9'));var jsforce=require(_0x02cb('0xa'));var deskjs=require(_0x02cb('0xb'));var toCsv=require(_0x02cb('0x7'));var querystring=require(_0x02cb('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x02cb('0xd'));var qs=require(_0x02cb('0xe'));var as=require(_0x02cb('0xf'));var hardwareService=require(_0x02cb('0x10'));var logger=require(_0x02cb('0x11'))(_0x02cb('0x12'));var utils=require('../../config/utils');var config=require(_0x02cb('0x13'));var licenseUtil=require(_0x02cb('0x14'));var db=require(_0x02cb('0x15'))['db'];config[_0x02cb('0x16')]=_[_0x02cb('0x17')](config['redis'],{'host':_0x02cb('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02cb('0x16')]));require('./chatGroup.socket')[_0x02cb('0x19')](socket);function respondWithStatusCode(_0x4cc2a0,_0xd45f42){_0xd45f42=_0xd45f42||0xcc;return function(_0x25d236){if(_0x25d236){return _0x4cc2a0['sendStatus'](_0xd45f42);}return _0x4cc2a0[_0x02cb('0x1a')](_0xd45f42)[_0x02cb('0x1b')]();};}function respondWithResult(_0x6eb3b,_0x46c458){_0x46c458=_0x46c458||0xc8;return function(_0x17fe0d){if(_0x17fe0d){return _0x6eb3b[_0x02cb('0x1a')](_0x46c458)[_0x02cb('0x1c')](_0x17fe0d);}};}function respondWithFilteredResult(_0x517946,_0xeaf3cc){return function(_0x2899d3){if(_0x2899d3){var _0x823a6e=typeof _0xeaf3cc['offset']===_0x02cb('0x1d')&&typeof _0xeaf3cc['limit']==='undefined';var _0x56fdbb=_0x2899d3[_0x02cb('0x1e')];var _0x5bdb3e=_0x823a6e?0x0:_0xeaf3cc['offset'];var _0x67f4bb=_0x823a6e?_0x2899d3[_0x02cb('0x1e')]:_0xeaf3cc['offset']+_0xeaf3cc['limit'];var _0x2b7e00;if(_0x67f4bb>=_0x56fdbb){_0x67f4bb=_0x56fdbb;_0x2b7e00=0xc8;}else{_0x2b7e00=0xce;}_0x517946[_0x02cb('0x1a')](_0x2b7e00);return _0x517946[_0x02cb('0x1f')]('Content-Range',_0x5bdb3e+'-'+_0x67f4bb+'/'+_0x56fdbb)[_0x02cb('0x1c')](_0x2899d3);}return null;};}function patchUpdates(_0x51b3ad){return function(_0x651446){try{jsonpatch[_0x02cb('0x20')](_0x651446,_0x51b3ad,!![]);}catch(_0xfacf5e){return BPromise[_0x02cb('0x21')](_0xfacf5e);}return _0x651446[_0x02cb('0x22')]();};}function saveUpdates(_0x241d2b,_0x3dde4e){return function(_0x993817){if(_0x993817){return _0x993817[_0x02cb('0x23')](_0x241d2b)[_0x02cb('0x24')](function(_0x15b1fe){return _0x15b1fe;});}return null;};}function removeEntity(_0x9342fb,_0x39cd2b){return function(_0x4c2b38){if(_0x4c2b38){return _0x4c2b38[_0x02cb('0x25')]()[_0x02cb('0x24')](function(){_0x9342fb[_0x02cb('0x1a')](0xcc)[_0x02cb('0x1b')]();});}};}function handleEntityNotFound(_0x5b6b2d,_0x3dd60e){return function(_0x215564){if(!_0x215564){_0x5b6b2d[_0x02cb('0x26')](0x194);}return _0x215564;};}function handleError(_0xb7bd31,_0x5bb6bd){_0x5bb6bd=_0x5bb6bd||0x1f4;return function(_0x1dc331){logger[_0x02cb('0x27')](_0x1dc331['stack']);if(_0x1dc331[_0x02cb('0x28')]){delete _0x1dc331[_0x02cb('0x28')];}_0xb7bd31[_0x02cb('0x1a')](_0x5bb6bd)[_0x02cb('0x29')](_0x1dc331);};}exports[_0x02cb('0x2a')]=function(_0xc4c1d0,_0x93afe5){var _0x2e38c0={},_0x5729cb={},_0xaa351a={'count':0x0,'rows':[]};var _0x496b03=_[_0x02cb('0x2b')](db[_0x02cb('0x2c')][_0x02cb('0x2d')],function(_0x1edd7b){return{'name':_0x1edd7b['fieldName'],'type':_0x1edd7b[_0x02cb('0x2e')][_0x02cb('0x2f')]};});_0x5729cb['model']=_[_0x02cb('0x2b')](_0x496b03,_0x02cb('0x28'));_0x5729cb[_0x02cb('0x30')]=_[_0x02cb('0x31')](_0xc4c1d0[_0x02cb('0x30')]);_0x5729cb['filters']=_[_0x02cb('0x32')](_0x5729cb['model'],_0x5729cb[_0x02cb('0x30')]);_0x2e38c0[_0x02cb('0x33')]=_['intersection'](_0x5729cb[_0x02cb('0x34')],qs[_0x02cb('0x35')](_0xc4c1d0[_0x02cb('0x30')][_0x02cb('0x35')]));_0x2e38c0[_0x02cb('0x33')]=_0x2e38c0[_0x02cb('0x33')][_0x02cb('0x36')]?_0x2e38c0[_0x02cb('0x33')]:_0x5729cb['model'];if(!_0xc4c1d0['query'][_0x02cb('0x37')](_0x02cb('0x38'))){_0x2e38c0[_0x02cb('0x39')]=qs['limit'](_0xc4c1d0[_0x02cb('0x30')][_0x02cb('0x39')]);_0x2e38c0[_0x02cb('0x3a')]=qs[_0x02cb('0x3a')](_0xc4c1d0['query']['offset']);}_0x2e38c0[_0x02cb('0x3b')]=qs[_0x02cb('0x3c')](_0xc4c1d0[_0x02cb('0x30')][_0x02cb('0x3c')]);_0x2e38c0['where']=qs[_0x02cb('0x3d')](_['pick'](_0xc4c1d0[_0x02cb('0x30')],_0x5729cb[_0x02cb('0x3d')]),_0x496b03);if(_0xc4c1d0[_0x02cb('0x30')]['filter']){_0x2e38c0[_0x02cb('0x3e')]=_[_0x02cb('0x3f')](_0x2e38c0[_0x02cb('0x3e')],{'$or':_['map'](_0x496b03,function(_0x1006ba){if(_0x1006ba[_0x02cb('0x2e')]!==_0x02cb('0x40')){var _0x6e0adb={};_0x6e0adb[_0x1006ba[_0x02cb('0x28')]]={'$like':'%'+_0xc4c1d0['query'][_0x02cb('0x41')]+'%'};return _0x6e0adb;}})});}_0x2e38c0=_[_0x02cb('0x3f')]({},_0x2e38c0,_0xc4c1d0[_0x02cb('0x42')]);var _0x35ae54={'where':_0x2e38c0[_0x02cb('0x3e')]};return db[_0x02cb('0x2c')][_0x02cb('0x1e')](_0x35ae54)['then'](function(_0x1e4fe2){_0xaa351a[_0x02cb('0x1e')]=_0x1e4fe2;if(_0xc4c1d0[_0x02cb('0x30')]['includeAll']){_0x2e38c0['include']=[{'all':!![]}];}return db[_0x02cb('0x2c')][_0x02cb('0x43')](_0x2e38c0);})[_0x02cb('0x24')](function(_0x347d84){_0xaa351a[_0x02cb('0x44')]=_0x347d84;return _0xaa351a;})[_0x02cb('0x24')](respondWithFilteredResult(_0x93afe5,_0x2e38c0))['catch'](handleError(_0x93afe5,null));};exports[_0x02cb('0x45')]=function(_0x48a9f1,_0x4fea8e){var _0x15d507={'raw':!![],'where':{'id':_0x48a9f1[_0x02cb('0x46')]['id']}},_0x1d7d53={};_0x1d7d53['model']=_['keys'](db[_0x02cb('0x2c')][_0x02cb('0x2d')]);_0x1d7d53[_0x02cb('0x30')]=_[_0x02cb('0x31')](_0x48a9f1[_0x02cb('0x30')]);_0x1d7d53['filters']=_[_0x02cb('0x32')](_0x1d7d53['model'],_0x1d7d53[_0x02cb('0x30')]);_0x15d507[_0x02cb('0x33')]=_[_0x02cb('0x32')](_0x1d7d53[_0x02cb('0x34')],qs['fields'](_0x48a9f1[_0x02cb('0x30')][_0x02cb('0x35')]));_0x15d507[_0x02cb('0x33')]=_0x15d507[_0x02cb('0x33')][_0x02cb('0x36')]?_0x15d507[_0x02cb('0x33')]:_0x1d7d53[_0x02cb('0x34')];if(_0x48a9f1[_0x02cb('0x30')][_0x02cb('0x47')]){_0x15d507[_0x02cb('0x48')]=[{'all':!![]}];}_0x15d507=_['merge']({},_0x15d507,_0x48a9f1[_0x02cb('0x42')]);return db[_0x02cb('0x2c')]['find'](_0x15d507)[_0x02cb('0x24')](handleEntityNotFound(_0x4fea8e,null))[_0x02cb('0x24')](respondWithResult(_0x4fea8e,null))[_0x02cb('0x49')](handleError(_0x4fea8e,null));};exports[_0x02cb('0x4a')]=function(_0x24fdda,_0x46a110){return db[_0x02cb('0x2c')][_0x02cb('0x4a')](_0x24fdda[_0x02cb('0x4b')],{})[_0x02cb('0x24')](respondWithResult(_0x46a110,0xc9))[_0x02cb('0x49')](handleError(_0x46a110,null));};exports[_0x02cb('0x23')]=function(_0x21bbd3,_0x30d30f){if(_0x21bbd3[_0x02cb('0x4b')]['id']){delete _0x21bbd3[_0x02cb('0x4b')]['id'];}return db[_0x02cb('0x2c')][_0x02cb('0x4c')]({'where':{'id':_0x21bbd3['params']['id']}})[_0x02cb('0x24')](handleEntityNotFound(_0x30d30f,null))[_0x02cb('0x24')](saveUpdates(_0x21bbd3[_0x02cb('0x4b')],null))[_0x02cb('0x24')](respondWithResult(_0x30d30f,null))[_0x02cb('0x49')](handleError(_0x30d30f,null));};exports[_0x02cb('0x25')]=function(_0x4e8af5,_0x12ecc7){return db[_0x02cb('0x2c')][_0x02cb('0x4c')]({'where':{'id':_0x4e8af5[_0x02cb('0x46')]['id']}})['then'](handleEntityNotFound(_0x12ecc7,null))['then'](removeEntity(_0x12ecc7,null))[_0x02cb('0x49')](handleError(_0x12ecc7,null));};exports['describe']=function(_0x1f98a2,_0x51bea4){return db[_0x02cb('0x2c')]['describe']()[_0x02cb('0x24')](respondWithResult(_0x51bea4,null))['catch'](handleError(_0x51bea4,null));};exports[_0x02cb('0x4d')]=function(_0x387caa,_0x40645c,_0x25a438){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x387caa[_0x02cb('0x46')]['id'],'ToId':_0x387caa[_0x02cb('0x4e')]['id'],'read':![]}})[_0x02cb('0x24')](function(_0xb76081){return{'id':_[_0x02cb('0x4f')](_0x387caa[_0x02cb('0x46')]['id']),'count':_0xb76081};})[_0x02cb('0x24')](respondWithResult(_0x40645c,null))['catch'](handleError(_0x40645c,null));};exports[_0x02cb('0x50')]=function(_0x34f8a8,_0x560fd3,_0x316530){return db[_0x02cb('0x2c')][_0x02cb('0x4c')]({'where':{'id':_0x34f8a8[_0x02cb('0x46')]['id']}})[_0x02cb('0x24')](handleEntityNotFound(_0x560fd3,null))[_0x02cb('0x24')](function(_0x5b048a){if(_0x5b048a){return _0x5b048a['addMembers'](_0x34f8a8['body'][_0x02cb('0x51')],_['omit'](_0x34f8a8[_0x02cb('0x4b')],['ids','id'])||{});}})[_0x02cb('0x24')](respondWithResult(_0x560fd3,null))[_0x02cb('0x49')](handleError(_0x560fd3,null));};exports[_0x02cb('0x52')]=function(_0x54e3e3,_0x4a3d84,_0x33d229){var _0x1b1833={};var _0x53d03e={};var _0x57e6aa;var _0x35ba4e;return db['ChatGroup'][_0x02cb('0x53')]({'where':{'id':_0x54e3e3['params']['id']}})['then'](handleEntityNotFound(_0x4a3d84,null))[_0x02cb('0x24')](function(_0x57b8d2){if(_0x57b8d2){_0x57e6aa=_0x57b8d2;_0x53d03e[_0x02cb('0x34')]=_[_0x02cb('0x31')](db['User']['rawAttributes']);_0x53d03e[_0x02cb('0x30')]=_[_0x02cb('0x31')](_0x54e3e3[_0x02cb('0x30')]);_0x53d03e[_0x02cb('0x3d')]=_[_0x02cb('0x32')](_0x53d03e['model'],_0x53d03e[_0x02cb('0x30')]);_0x1b1833[_0x02cb('0x33')]=_[_0x02cb('0x32')](_0x53d03e[_0x02cb('0x34')],qs[_0x02cb('0x35')](_0x54e3e3['query'][_0x02cb('0x35')]));_0x1b1833[_0x02cb('0x33')]=_0x1b1833['attributes'][_0x02cb('0x36')]?_0x1b1833[_0x02cb('0x33')]:_0x53d03e[_0x02cb('0x34')];_0x1b1833[_0x02cb('0x3b')]=qs[_0x02cb('0x3c')](_0x54e3e3[_0x02cb('0x30')]['sort']);_0x1b1833[_0x02cb('0x3e')]=qs[_0x02cb('0x3d')](_['pick'](_0x54e3e3[_0x02cb('0x30')],_0x53d03e[_0x02cb('0x3d')]));if(_0x54e3e3[_0x02cb('0x30')][_0x02cb('0x41')]){_0x1b1833[_0x02cb('0x3e')]=_[_0x02cb('0x3f')](_0x1b1833[_0x02cb('0x3e')],{'$or':_[_0x02cb('0x2b')](_0x1b1833[_0x02cb('0x33')],function(_0x3ff61e){var _0x5bea01={};_0x5bea01[_0x3ff61e]={'$like':'%'+_0x54e3e3[_0x02cb('0x30')][_0x02cb('0x41')]+'%'};return _0x5bea01;})});}_0x1b1833=_[_0x02cb('0x3f')]({},_0x1b1833,_0x54e3e3[_0x02cb('0x42')]);return _0x57e6aa[_0x02cb('0x52')](_0x1b1833);}})[_0x02cb('0x24')](function(_0x1f5245){if(_0x1f5245){_0x35ba4e=_0x1f5245[_0x02cb('0x36')];if(!_0x54e3e3['query']['hasOwnProperty'](_0x02cb('0x38'))){_0x1b1833[_0x02cb('0x39')]=qs['limit'](_0x54e3e3['query'][_0x02cb('0x39')]);_0x1b1833[_0x02cb('0x3a')]=qs[_0x02cb('0x3a')](_0x54e3e3[_0x02cb('0x30')][_0x02cb('0x3a')]);}return _0x57e6aa[_0x02cb('0x52')](_0x1b1833);}})[_0x02cb('0x24')](function(_0x2e444c){if(_0x2e444c){return _0x2e444c?{'count':_0x35ba4e,'rows':_0x2e444c}:null;}})[_0x02cb('0x24')](respondWithResult(_0x4a3d84,null))[_0x02cb('0x49')](handleError(_0x4a3d84,null));};exports[_0x02cb('0x54')]=function(_0x5f1291,_0x198a73,_0x43bbd2){return db['ChatGroup'][_0x02cb('0x4c')]({'where':{'id':_0x5f1291[_0x02cb('0x46')]['id']}})[_0x02cb('0x24')](handleEntityNotFound(_0x198a73,null))[_0x02cb('0x24')](function(_0x4a953c){if(_0x4a953c){return _0x4a953c[_0x02cb('0x54')](_0x5f1291[_0x02cb('0x30')]['ids']);}})[_0x02cb('0x24')](respondWithStatusCode(_0x198a73,null))['catch'](handleError(_0x198a73,null));};exports['addMessage']=function(_0x3f840c,_0x27e51c,_0x52470a){if(_0x3f840c['body']['id']){delete _0x3f840c[_0x02cb('0x4b')]['id'];}return db[_0x02cb('0x2c')][_0x02cb('0x4c')]({'where':{'id':_0x3f840c[_0x02cb('0x46')]['id']}})[_0x02cb('0x24')](handleEntityNotFound(_0x27e51c,null))[_0x02cb('0x24')](function(_0x44718b){if(_0x44718b){_0x3f840c[_0x02cb('0x4b')][_0x02cb('0x55')]=_0x44718b['id'];return db[_0x02cb('0x56')]['create'](_0x3f840c[_0x02cb('0x4b')]);}})[_0x02cb('0x24')](respondWithResult(_0x27e51c,null))[_0x02cb('0x49')](handleError(_0x27e51c,null));};exports['getMessages']=function(_0x896939,_0x11b426,_0x17af78){var _0x4e868e={};var _0x31c5c4={};var _0x23355b;var _0x54df15;return db['ChatGroup'][_0x02cb('0x53')]({'where':{'id':_0x896939[_0x02cb('0x46')]['id']}})[_0x02cb('0x24')](handleEntityNotFound(_0x11b426,null))[_0x02cb('0x24')](function(_0x2dbb8b){if(_0x2dbb8b){_0x23355b=_0x2dbb8b;_0x31c5c4[_0x02cb('0x34')]=_[_0x02cb('0x31')](db[_0x02cb('0x56')]['rawAttributes']);_0x31c5c4[_0x02cb('0x30')]=_[_0x02cb('0x31')](_0x896939['query']);_0x31c5c4['filters']=_[_0x02cb('0x32')](_0x31c5c4['model'],_0x31c5c4[_0x02cb('0x30')]);_0x4e868e[_0x02cb('0x33')]=_[_0x02cb('0x32')](_0x31c5c4[_0x02cb('0x34')],qs[_0x02cb('0x35')](_0x896939[_0x02cb('0x30')][_0x02cb('0x35')]));_0x4e868e['attributes']=_0x4e868e[_0x02cb('0x33')][_0x02cb('0x36')]?_0x4e868e['attributes']:_0x31c5c4[_0x02cb('0x34')];_0x4e868e[_0x02cb('0x3b')]=qs[_0x02cb('0x3c')](_0x896939[_0x02cb('0x30')][_0x02cb('0x3c')]);_0x4e868e[_0x02cb('0x3e')]=qs[_0x02cb('0x3d')](_[_0x02cb('0x57')](_0x896939[_0x02cb('0x30')],_0x31c5c4[_0x02cb('0x3d')]));if(_0x896939['query']['filter']){_0x4e868e[_0x02cb('0x3e')]=_[_0x02cb('0x3f')](_0x4e868e['where'],{'$or':_[_0x02cb('0x2b')](_0x4e868e['attributes'],function(_0x4111da){var _0x40e0d0={};_0x40e0d0[_0x4111da]={'$like':'%'+_0x896939['query'][_0x02cb('0x41')]+'%'};return _0x40e0d0;})});}if(_0x896939[_0x02cb('0x30')][_0x02cb('0x58')]){var _0xc3477e=_0x896939[_0x02cb('0x30')][_0x02cb('0x58')][_0x02cb('0x59')](',');var _0x589100={};_0x589100[_0xc3477e[0x0]]={'$gte':moment(_0xc3477e[0x1])['format'](_0x02cb('0x5a'))};_0x4e868e[_0x02cb('0x3e')]=_[_0x02cb('0x3f')](_0x4e868e['where'],_0x589100);}_0x4e868e=_[_0x02cb('0x3f')]({},_0x4e868e,_0x896939['options']);return _0x23355b[_0x02cb('0x5b')](_0x4e868e);}})[_0x02cb('0x24')](function(_0x12bc85){if(_0x12bc85){_0x54df15=_0x12bc85[_0x02cb('0x36')];if(!_0x896939[_0x02cb('0x30')]['hasOwnProperty'](_0x02cb('0x38'))){_0x4e868e[_0x02cb('0x39')]=qs[_0x02cb('0x39')](_0x896939['query']['limit']);_0x4e868e[_0x02cb('0x3a')]=qs['offset'](_0x896939['query'][_0x02cb('0x3a')]);}return _0x23355b[_0x02cb('0x5b')](_0x4e868e);}})[_0x02cb('0x24')](function(_0x45c207){if(_0x45c207){return _0x45c207?{'count':_0x54df15,'rows':_0x45c207}:null;}})[_0x02cb('0x24')](respondWithResult(_0x11b426,null))[_0x02cb('0x49')](handleError(_0x11b426,null));};
\ No newline at end of file
+var _0x35d5=['offset','undefined','count','limit','status','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','ChatGroup','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','end','json'];(function(_0x2462ed,_0x5c6425){var _0x5cf82b=function(_0x34b219){while(--_0x34b219){_0x2462ed['push'](_0x2462ed['shift']());}};_0x5cf82b(++_0x5c6425);}(_0x35d5,0x16b));var _0x535d=function(_0x497665,_0x3ea3b2){_0x497665=_0x497665-0x0;var _0x1ff718=_0x35d5[_0x497665];return _0x1ff718;};'use strict';var emlformat=require(_0x535d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x535d('0x1'));var jsonpatch=require(_0x535d('0x2'));var rp=require('request-promise');var moment=require(_0x535d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x535d('0x4'));var util=require(_0x535d('0x5'));var path=require(_0x535d('0x6'));var sox=require(_0x535d('0x7'));var csv=require('to-csv');var ejs=require(_0x535d('0x8'));var fs=require('fs');var fs_extra=require(_0x535d('0x9'));var _=require(_0x535d('0xa'));var squel=require(_0x535d('0xb'));var crypto=require(_0x535d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x535d('0xd'));var toCsv=require(_0x535d('0xe'));var querystring=require(_0x535d('0xf'));var Papa=require(_0x535d('0x10'));var Redis=require(_0x535d('0x11'));var authService=require(_0x535d('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x535d('0x13'));var logger=require(_0x535d('0x14'))(_0x535d('0x15'));var utils=require(_0x535d('0x16'));var config=require(_0x535d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x535d('0x18'))['db'];config[_0x535d('0x19')]=_[_0x535d('0x1a')](config[_0x535d('0x19')],{'host':_0x535d('0x1b'),'port':0x18eb});var socket=require(_0x535d('0x1c'))(new Redis(config[_0x535d('0x19')]));require(_0x535d('0x1d'))['register'](socket);function respondWithStatusCode(_0x351ac3,_0x58e7d1){_0x58e7d1=_0x58e7d1||0xcc;return function(_0xd07612){if(_0xd07612){return _0x351ac3[_0x535d('0x1e')](_0x58e7d1);}return _0x351ac3['status'](_0x58e7d1)[_0x535d('0x1f')]();};}function respondWithResult(_0x18462b,_0x4980ce){_0x4980ce=_0x4980ce||0xc8;return function(_0x3e0bb6){if(_0x3e0bb6){return _0x18462b['status'](_0x4980ce)[_0x535d('0x20')](_0x3e0bb6);}};}function respondWithFilteredResult(_0x91f9ba,_0x4b7861){return function(_0x25dca1){if(_0x25dca1){var _0x4a6029=typeof _0x4b7861[_0x535d('0x21')]===_0x535d('0x22')&&typeof _0x4b7861['limit']==='undefined';var _0x3415d0=_0x25dca1[_0x535d('0x23')];var _0x145d75=_0x4a6029?0x0:_0x4b7861[_0x535d('0x21')];var _0x4e9b59=_0x4a6029?_0x25dca1[_0x535d('0x23')]:_0x4b7861['offset']+_0x4b7861[_0x535d('0x24')];var _0x3d2bba;if(_0x4e9b59>=_0x3415d0){_0x4e9b59=_0x3415d0;_0x3d2bba=0xc8;}else{_0x3d2bba=0xce;}_0x91f9ba[_0x535d('0x25')](_0x3d2bba);return _0x91f9ba['set'](_0x535d('0x26'),_0x145d75+'-'+_0x4e9b59+'/'+_0x3415d0)[_0x535d('0x20')](_0x25dca1);}return null;};}function patchUpdates(_0x27fac0){return function(_0x46a875){try{jsonpatch['apply'](_0x46a875,_0x27fac0,!![]);}catch(_0x3a86e6){return BPromise[_0x535d('0x27')](_0x3a86e6);}return _0x46a875[_0x535d('0x28')]();};}function saveUpdates(_0x394461,_0x10e06c){return function(_0xa57c32){if(_0xa57c32){return _0xa57c32[_0x535d('0x29')](_0x394461)[_0x535d('0x2a')](function(_0x393a33){return _0x393a33;});}return null;};}function removeEntity(_0x511d8b,_0x1690b3){return function(_0x4361d8){if(_0x4361d8){return _0x4361d8[_0x535d('0x2b')]()[_0x535d('0x2a')](function(){_0x511d8b[_0x535d('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dafbc,_0x2847b9){return function(_0x21da69){if(!_0x21da69){_0x2dafbc[_0x535d('0x1e')](0x194);}return _0x21da69;};}function handleError(_0x5719cb,_0x39b057){_0x39b057=_0x39b057||0x1f4;return function(_0x4b41e0){logger[_0x535d('0x2c')](_0x4b41e0['stack']);if(_0x4b41e0[_0x535d('0x2d')]){delete _0x4b41e0[_0x535d('0x2d')];}_0x5719cb[_0x535d('0x25')](_0x39b057)[_0x535d('0x2e')](_0x4b41e0);};}exports[_0x535d('0x2f')]=function(_0x1c6de6,_0x95d112){var _0x4ab7e2={},_0x38598c={},_0x2f5a42={'count':0x0,'rows':[]};var _0x27582d=_[_0x535d('0x30')](db[_0x535d('0x31')][_0x535d('0x32')],function(_0x14db67){return{'name':_0x14db67['fieldName'],'type':_0x14db67[_0x535d('0x33')]['key']};});_0x38598c[_0x535d('0x34')]=_[_0x535d('0x30')](_0x27582d,'name');_0x38598c[_0x535d('0x35')]=_[_0x535d('0x36')](_0x1c6de6[_0x535d('0x35')]);_0x38598c[_0x535d('0x37')]=_[_0x535d('0x38')](_0x38598c[_0x535d('0x34')],_0x38598c[_0x535d('0x35')]);_0x4ab7e2['attributes']=_[_0x535d('0x38')](_0x38598c[_0x535d('0x34')],qs['fields'](_0x1c6de6[_0x535d('0x35')][_0x535d('0x39')]));_0x4ab7e2[_0x535d('0x3a')]=_0x4ab7e2[_0x535d('0x3a')][_0x535d('0x3b')]?_0x4ab7e2[_0x535d('0x3a')]:_0x38598c['model'];if(!_0x1c6de6[_0x535d('0x35')][_0x535d('0x3c')](_0x535d('0x3d'))){_0x4ab7e2[_0x535d('0x24')]=qs[_0x535d('0x24')](_0x1c6de6[_0x535d('0x35')][_0x535d('0x24')]);_0x4ab7e2[_0x535d('0x21')]=qs['offset'](_0x1c6de6[_0x535d('0x35')][_0x535d('0x21')]);}_0x4ab7e2[_0x535d('0x3e')]=qs[_0x535d('0x3f')](_0x1c6de6['query'][_0x535d('0x3f')]);_0x4ab7e2['where']=qs[_0x535d('0x37')](_[_0x535d('0x40')](_0x1c6de6[_0x535d('0x35')],_0x38598c[_0x535d('0x37')]),_0x27582d);if(_0x1c6de6['query'][_0x535d('0x41')]){_0x4ab7e2[_0x535d('0x42')]=_[_0x535d('0x43')](_0x4ab7e2[_0x535d('0x42')],{'$or':_[_0x535d('0x30')](_0x27582d,function(_0x484f89){if(_0x484f89[_0x535d('0x33')]!==_0x535d('0x44')){var _0x5d013d={};_0x5d013d[_0x484f89[_0x535d('0x2d')]]={'$like':'%'+_0x1c6de6[_0x535d('0x35')]['filter']+'%'};return _0x5d013d;}})});}_0x4ab7e2=_[_0x535d('0x43')]({},_0x4ab7e2,_0x1c6de6[_0x535d('0x45')]);var _0x380d34={'where':_0x4ab7e2[_0x535d('0x42')]};return db[_0x535d('0x31')][_0x535d('0x23')](_0x380d34)[_0x535d('0x2a')](function(_0x4122a0){_0x2f5a42[_0x535d('0x23')]=_0x4122a0;if(_0x1c6de6[_0x535d('0x35')][_0x535d('0x46')]){_0x4ab7e2[_0x535d('0x47')]=[{'all':!![]}];}return db[_0x535d('0x31')][_0x535d('0x48')](_0x4ab7e2);})[_0x535d('0x2a')](function(_0x5c13ec){_0x2f5a42[_0x535d('0x49')]=_0x5c13ec;return _0x2f5a42;})[_0x535d('0x2a')](respondWithFilteredResult(_0x95d112,_0x4ab7e2))[_0x535d('0x4a')](handleError(_0x95d112,null));};exports[_0x535d('0x4b')]=function(_0x257079,_0x1d8395){var _0x162fe8={'raw':!![],'where':{'id':_0x257079[_0x535d('0x4c')]['id']}},_0x48d91a={};_0x48d91a[_0x535d('0x34')]=_[_0x535d('0x36')](db[_0x535d('0x31')][_0x535d('0x32')]);_0x48d91a[_0x535d('0x35')]=_[_0x535d('0x36')](_0x257079[_0x535d('0x35')]);_0x48d91a[_0x535d('0x37')]=_[_0x535d('0x38')](_0x48d91a[_0x535d('0x34')],_0x48d91a[_0x535d('0x35')]);_0x162fe8[_0x535d('0x3a')]=_[_0x535d('0x38')](_0x48d91a[_0x535d('0x34')],qs['fields'](_0x257079['query'][_0x535d('0x39')]));_0x162fe8[_0x535d('0x3a')]=_0x162fe8[_0x535d('0x3a')][_0x535d('0x3b')]?_0x162fe8[_0x535d('0x3a')]:_0x48d91a[_0x535d('0x34')];if(_0x257079[_0x535d('0x35')]['includeAll']){_0x162fe8['include']=[{'all':!![]}];}_0x162fe8=_[_0x535d('0x43')]({},_0x162fe8,_0x257079[_0x535d('0x45')]);return db[_0x535d('0x31')][_0x535d('0x4d')](_0x162fe8)[_0x535d('0x2a')](handleEntityNotFound(_0x1d8395,null))['then'](respondWithResult(_0x1d8395,null))[_0x535d('0x4a')](handleError(_0x1d8395,null));};exports['create']=function(_0x35c730,_0x537e48){return db[_0x535d('0x31')][_0x535d('0x4e')](_0x35c730['body'],{})[_0x535d('0x2a')](respondWithResult(_0x537e48,0xc9))[_0x535d('0x4a')](handleError(_0x537e48,null));};exports[_0x535d('0x29')]=function(_0x1a82ac,_0x44c5ab){if(_0x1a82ac['body']['id']){delete _0x1a82ac['body']['id'];}return db[_0x535d('0x31')][_0x535d('0x4d')]({'where':{'id':_0x1a82ac[_0x535d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x44c5ab,null))[_0x535d('0x2a')](saveUpdates(_0x1a82ac[_0x535d('0x4f')],null))['then'](respondWithResult(_0x44c5ab,null))[_0x535d('0x4a')](handleError(_0x44c5ab,null));};exports[_0x535d('0x2b')]=function(_0xca192d,_0x3792d4){return db[_0x535d('0x31')][_0x535d('0x4d')]({'where':{'id':_0xca192d[_0x535d('0x4c')]['id']}})[_0x535d('0x2a')](handleEntityNotFound(_0x3792d4,null))[_0x535d('0x2a')](removeEntity(_0x3792d4,null))['catch'](handleError(_0x3792d4,null));};exports[_0x535d('0x50')]=function(_0x1e1d7f,_0xe7ff5c){return db[_0x535d('0x31')][_0x535d('0x50')]()[_0x535d('0x2a')](respondWithResult(_0xe7ff5c,null))['catch'](handleError(_0xe7ff5c,null));};exports[_0x535d('0x51')]=function(_0x3935ab,_0x5e15a2,_0x55cc3a){return db[_0x535d('0x52')]['count']({'where':{'ChatGroupId':_0x3935ab[_0x535d('0x4c')]['id'],'ToId':_0x3935ab[_0x535d('0x53')]['id'],'read':![]}})[_0x535d('0x2a')](function(_0xd79b26){return{'id':_[_0x535d('0x54')](_0x3935ab[_0x535d('0x4c')]['id']),'count':_0xd79b26};})[_0x535d('0x2a')](respondWithResult(_0x5e15a2,null))[_0x535d('0x4a')](handleError(_0x5e15a2,null));};exports[_0x535d('0x55')]=function(_0x4f624f,_0x2660b1,_0x226b62){return db['ChatGroup'][_0x535d('0x4d')]({'where':{'id':_0x4f624f[_0x535d('0x4c')]['id']}})[_0x535d('0x2a')](handleEntityNotFound(_0x2660b1,null))[_0x535d('0x2a')](function(_0x461532){if(_0x461532){return _0x461532[_0x535d('0x55')](_0x4f624f[_0x535d('0x4f')][_0x535d('0x56')],_[_0x535d('0x57')](_0x4f624f['body'],[_0x535d('0x56'),'id'])||{});}})[_0x535d('0x2a')](respondWithResult(_0x2660b1,null))[_0x535d('0x4a')](handleError(_0x2660b1,null));};exports[_0x535d('0x58')]=function(_0x3b0001,_0x5028f2,_0x5542fd){var _0x19679f={};var _0x36b1ad={};var _0x4e425c;var _0x5f09d7;return db[_0x535d('0x31')][_0x535d('0x59')]({'where':{'id':_0x3b0001[_0x535d('0x4c')]['id']}})[_0x535d('0x2a')](handleEntityNotFound(_0x5028f2,null))['then'](function(_0x32365e){if(_0x32365e){_0x4e425c=_0x32365e;_0x36b1ad['model']=_[_0x535d('0x36')](db[_0x535d('0x5a')][_0x535d('0x32')]);_0x36b1ad[_0x535d('0x35')]=_[_0x535d('0x36')](_0x3b0001['query']);_0x36b1ad['filters']=_[_0x535d('0x38')](_0x36b1ad['model'],_0x36b1ad[_0x535d('0x35')]);_0x19679f[_0x535d('0x3a')]=_['intersection'](_0x36b1ad[_0x535d('0x34')],qs[_0x535d('0x39')](_0x3b0001['query'][_0x535d('0x39')]));_0x19679f[_0x535d('0x3a')]=_0x19679f['attributes']['length']?_0x19679f[_0x535d('0x3a')]:_0x36b1ad[_0x535d('0x34')];_0x19679f[_0x535d('0x3e')]=qs[_0x535d('0x3f')](_0x3b0001['query']['sort']);_0x19679f['where']=qs[_0x535d('0x37')](_[_0x535d('0x40')](_0x3b0001['query'],_0x36b1ad[_0x535d('0x37')]));if(_0x3b0001[_0x535d('0x35')]['filter']){_0x19679f['where']=_[_0x535d('0x43')](_0x19679f[_0x535d('0x42')],{'$or':_['map'](_0x19679f[_0x535d('0x3a')],function(_0x2b7829){var _0x2ddcd8={};_0x2ddcd8[_0x2b7829]={'$like':'%'+_0x3b0001[_0x535d('0x35')][_0x535d('0x41')]+'%'};return _0x2ddcd8;})});}_0x19679f=_['merge']({},_0x19679f,_0x3b0001[_0x535d('0x45')]);return _0x4e425c[_0x535d('0x58')](_0x19679f);}})[_0x535d('0x2a')](function(_0x2c58de){if(_0x2c58de){_0x5f09d7=_0x2c58de[_0x535d('0x3b')];if(!_0x3b0001[_0x535d('0x35')][_0x535d('0x3c')](_0x535d('0x3d'))){_0x19679f['limit']=qs[_0x535d('0x24')](_0x3b0001['query'][_0x535d('0x24')]);_0x19679f['offset']=qs[_0x535d('0x21')](_0x3b0001[_0x535d('0x35')][_0x535d('0x21')]);}return _0x4e425c[_0x535d('0x58')](_0x19679f);}})[_0x535d('0x2a')](function(_0xc7bb53){if(_0xc7bb53){return _0xc7bb53?{'count':_0x5f09d7,'rows':_0xc7bb53}:null;}})[_0x535d('0x2a')](respondWithResult(_0x5028f2,null))[_0x535d('0x4a')](handleError(_0x5028f2,null));};exports[_0x535d('0x5b')]=function(_0x22cd76,_0x5c35a5,_0x3f19dd){return db['ChatGroup']['find']({'where':{'id':_0x22cd76[_0x535d('0x4c')]['id']}})[_0x535d('0x2a')](handleEntityNotFound(_0x5c35a5,null))[_0x535d('0x2a')](function(_0x95e724){if(_0x95e724){return _0x95e724[_0x535d('0x5b')](_0x22cd76[_0x535d('0x35')][_0x535d('0x56')]);}})[_0x535d('0x2a')](respondWithStatusCode(_0x5c35a5,null))[_0x535d('0x4a')](handleError(_0x5c35a5,null));};exports[_0x535d('0x5c')]=function(_0x44ca49,_0x2081ea,_0x3f477a){if(_0x44ca49[_0x535d('0x4f')]['id']){delete _0x44ca49[_0x535d('0x4f')]['id'];}return db[_0x535d('0x31')][_0x535d('0x4d')]({'where':{'id':_0x44ca49[_0x535d('0x4c')]['id']}})[_0x535d('0x2a')](handleEntityNotFound(_0x2081ea,null))['then'](function(_0x72c3d3){if(_0x72c3d3){_0x44ca49['body'][_0x535d('0x5d')]=_0x72c3d3['id'];return db[_0x535d('0x52')][_0x535d('0x4e')](_0x44ca49[_0x535d('0x4f')]);}})[_0x535d('0x2a')](respondWithResult(_0x2081ea,null))[_0x535d('0x4a')](handleError(_0x2081ea,null));};exports[_0x535d('0x5e')]=function(_0x39e148,_0x29f6a7,_0x112c1b){var _0x43f9e8={};var _0x120f05={};var _0x5bbc91;var _0x3871da;return db[_0x535d('0x31')][_0x535d('0x59')]({'where':{'id':_0x39e148[_0x535d('0x4c')]['id']}})[_0x535d('0x2a')](handleEntityNotFound(_0x29f6a7,null))[_0x535d('0x2a')](function(_0x1a3f8c){if(_0x1a3f8c){_0x5bbc91=_0x1a3f8c;_0x120f05[_0x535d('0x34')]=_[_0x535d('0x36')](db['ChatInternalMessage'][_0x535d('0x32')]);_0x120f05[_0x535d('0x35')]=_['keys'](_0x39e148[_0x535d('0x35')]);_0x120f05[_0x535d('0x37')]=_[_0x535d('0x38')](_0x120f05['model'],_0x120f05[_0x535d('0x35')]);_0x43f9e8[_0x535d('0x3a')]=_[_0x535d('0x38')](_0x120f05[_0x535d('0x34')],qs[_0x535d('0x39')](_0x39e148[_0x535d('0x35')][_0x535d('0x39')]));_0x43f9e8[_0x535d('0x3a')]=_0x43f9e8[_0x535d('0x3a')][_0x535d('0x3b')]?_0x43f9e8['attributes']:_0x120f05[_0x535d('0x34')];_0x43f9e8['order']=qs['sort'](_0x39e148[_0x535d('0x35')]['sort']);_0x43f9e8[_0x535d('0x42')]=qs[_0x535d('0x37')](_[_0x535d('0x40')](_0x39e148['query'],_0x120f05[_0x535d('0x37')]));if(_0x39e148['query'][_0x535d('0x41')]){_0x43f9e8[_0x535d('0x42')]=_[_0x535d('0x43')](_0x43f9e8['where'],{'$or':_[_0x535d('0x30')](_0x43f9e8['attributes'],function(_0x2a977e){var _0x59f497={};_0x59f497[_0x2a977e]={'$like':'%'+_0x39e148[_0x535d('0x35')][_0x535d('0x41')]+'%'};return _0x59f497;})});}if(_0x39e148[_0x535d('0x35')][_0x535d('0x5f')]){var _0x38bbaa=_0x39e148[_0x535d('0x35')][_0x535d('0x5f')][_0x535d('0x60')](',');var _0x515144={};_0x515144[_0x38bbaa[0x0]]={'$gte':moment(_0x38bbaa[0x1])[_0x535d('0x61')](_0x535d('0x62'))};_0x43f9e8[_0x535d('0x42')]=_['merge'](_0x43f9e8[_0x535d('0x42')],_0x515144);}_0x43f9e8=_['merge']({},_0x43f9e8,_0x39e148[_0x535d('0x45')]);return _0x5bbc91[_0x535d('0x5e')](_0x43f9e8);}})[_0x535d('0x2a')](function(_0x325620){if(_0x325620){_0x3871da=_0x325620[_0x535d('0x3b')];if(!_0x39e148[_0x535d('0x35')]['hasOwnProperty']('nolimit')){_0x43f9e8[_0x535d('0x24')]=qs[_0x535d('0x24')](_0x39e148[_0x535d('0x35')][_0x535d('0x24')]);_0x43f9e8[_0x535d('0x21')]=qs[_0x535d('0x21')](_0x39e148[_0x535d('0x35')][_0x535d('0x21')]);}return _0x5bbc91[_0x535d('0x5e')](_0x43f9e8);}})[_0x535d('0x2a')](function(_0xee1691){if(_0xee1691){return _0xee1691?{'count':_0x3871da,'rows':_0xee1691}:null;}})[_0x535d('0x2a')](respondWithResult(_0x29f6a7,null))[_0x535d('0x4a')](handleError(_0x29f6a7,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index dd21e0f..9f3d678 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 _0xb3f9=['emit','hook','exports','events','../../mysqldb','save','remove'];(function(_0x537cf8,_0x1eb921){var _0x1f7d47=function(_0x5a52aa){while(--_0x5a52aa){_0x537cf8['push'](_0x537cf8['shift']());}};_0x1f7d47(++_0x1eb921);}(_0xb3f9,0x7a));var _0x9b3f=function(_0xb720a2,_0x474f32){_0xb720a2=_0xb720a2-0x0;var _0xd3695f=_0xb3f9[_0xb720a2];return _0xd3695f;};'use strict';var EventEmitter=require(_0x9b3f('0x0'));var ChatGroup=require(_0x9b3f('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9b3f('0x2'),'afterUpdate':'update','afterDestroy':_0x9b3f('0x3')};function emitEvent(_0x361db7){return function(_0x35fd0b,_0xa9df41,_0x227cca){ChatGroupEvents[_0x9b3f('0x4')](_0x361db7+':'+_0x35fd0b['id'],_0x35fd0b);ChatGroupEvents['emit'](_0x361db7,_0x35fd0b);_0x227cca(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x9b3f('0x5')](e,emitEvent(event));}}module[_0x9b3f('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0x42bd=['events','ChatGroup','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x4c3b19,_0x31ccfe){var _0x5f0e89=function(_0x4c7778){while(--_0x4c7778){_0x4c3b19['push'](_0x4c3b19['shift']());}};_0x5f0e89(++_0x31ccfe);}(_0x42bd,0x198));var _0xd42b=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x42bd[_0x13d07a];return _0x5ee0ee;};'use strict';var EventEmitter=require(_0xd42b('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xd42b('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd42b('0x2')](0x0);var events={'afterCreate':_0xd42b('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4f4911){return function(_0x704f48,_0x43efff,_0x1907b4){ChatGroupEvents[_0xd42b('0x4')](_0x4f4911+':'+_0x704f48['id'],_0x704f48);ChatGroupEvents[_0xd42b('0x4')](_0x4f4911,_0x704f48);_0x1907b4(null);};}for(var e in events){if(events[_0xd42b('0x5')](e)){var event=events[e];ChatGroup[_0xd42b('0x6')](e,emitEvent(event));}}module[_0xd42b('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 01c4c38..0ac009a 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 _0xe80f=['request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','api','moment','bluebird'];(function(_0x5a9d8c,_0x5de60d){var _0x2456f1=function(_0x5b2b15){while(--_0x5b2b15){_0x5a9d8c['push'](_0x5a9d8c['shift']());}};_0x2456f1(++_0x5de60d);}(_0xe80f,0x74));var _0xfe80=function(_0x153249,_0x120e2e){_0x153249=_0x153249-0x0;var _0x22bc34=_0xe80f[_0x153249];return _0x22bc34;};'use strict';var _=require('lodash');var util=require(_0xfe80('0x0'));var logger=require('../../config/logger')(_0xfe80('0x1'));var moment=require(_0xfe80('0x2'));var BPromise=require(_0xfe80('0x3'));var rp=require(_0xfe80('0x4'));var fs=require('fs');var path=require(_0xfe80('0x5'));var rimraf=require('rimraf');var config=require(_0xfe80('0x6'));var attributes=require(_0xfe80('0x7'));module[_0xfe80('0x8')]=function(_0x4364b2,_0x3bef48){return _0x4364b2[_0xfe80('0x9')](_0xfe80('0xa'),attributes,{'tableName':_0xfe80('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e87=['request-promise','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash','../../config/logger','api','moment','bluebird'];(function(_0x555cd0,_0x3b9867){var _0x403c3c=function(_0x128f9a){while(--_0x128f9a){_0x555cd0['push'](_0x555cd0['shift']());}};_0x403c3c(++_0x3b9867);}(_0x3e87,0xa0));var _0x73e8=function(_0x5cfa70,_0x10dd3f){_0x5cfa70=_0x5cfa70-0x0;var _0x4f11db=_0x3e87[_0x5cfa70];return _0x4f11db;};'use strict';var _=require(_0x73e8('0x0'));var util=require('util');var logger=require(_0x73e8('0x1'))(_0x73e8('0x2'));var moment=require(_0x73e8('0x3'));var BPromise=require(_0x73e8('0x4'));var rp=require(_0x73e8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x73e8('0x6'));var attributes=require(_0x73e8('0x7'));module[_0x73e8('0x8')]=function(_0x2a3e19,_0x3796b8){return _0x2a3e19[_0x73e8('0x9')]('ChatGroup',attributes,{'tableName':_0x73e8('0xa'),'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 06c75d0..e97cdd5 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 _0x28aa=['defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x48a51c,_0x3a4e38){var _0x5a2aa4=function(_0x539df8){while(--_0x539df8){_0x48a51c['push'](_0x48a51c['shift']());}};_0x5a2aa4(++_0x3a4e38);}(_0x28aa,0xf8));var _0xa28a=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x28aa[_0x187ee1];return _0x388160;};'use strict';var _=require('lodash');var util=require(_0xa28a('0x0'));var moment=require(_0xa28a('0x1'));var BPromise=require(_0xa28a('0x2'));var rs=require(_0xa28a('0x3'));var fs=require('fs');var Redis=require(_0xa28a('0x4'));var db=require(_0xa28a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa28a('0x6'))(_0xa28a('0x7'));var config=require(_0xa28a('0x8'));var jayson=require(_0xa28a('0x9'));var client=jayson['client'][_0xa28a('0xa')]({'port':0x232a});config[_0xa28a('0xb')]=_[_0xa28a('0xc')](config[_0xa28a('0xb')],{'host':_0xa28a('0xd'),'port':0x18eb});var socket=require(_0xa28a('0xe'))(new Redis(config[_0xa28a('0xb')]));require(_0xa28a('0xf'))[_0xa28a('0x10')](socket);function respondWithRpcPromise(_0x1caf6b,_0x3e8701,_0xc23755){return new BPromise(function(_0x19a508,_0x899bad){return client[_0xa28a('0x11')](_0x1caf6b,_0xc23755)['then'](function(_0x1c223c){logger[_0xa28a('0x12')](_0xa28a('0x13'),_0x3e8701,_0xa28a('0x14'));logger['debug'](_0xa28a('0x15'),_0x3e8701,_0xa28a('0x14'),JSON['stringify'](_0x1c223c));if(_0x1c223c[_0xa28a('0x16')]){if(_0x1c223c[_0xa28a('0x16')][_0xa28a('0x17')]===0x1f4){logger[_0xa28a('0x16')](_0xa28a('0x13'),_0x3e8701,_0x1c223c[_0xa28a('0x16')][_0xa28a('0x18')]);return _0x899bad(_0x1c223c[_0xa28a('0x16')][_0xa28a('0x18')]);}logger[_0xa28a('0x16')]('ChatGroup,\x20%s,\x20%s',_0x3e8701,_0x1c223c[_0xa28a('0x16')][_0xa28a('0x18')]);return _0x19a508(_0x1c223c[_0xa28a('0x16')]['message']);}else{logger[_0xa28a('0x12')](_0xa28a('0x13'),_0x3e8701,_0xa28a('0x14'));_0x19a508(_0x1c223c[_0xa28a('0x19')][_0xa28a('0x18')]);}})['catch'](function(_0x48093b){logger[_0xa28a('0x16')]('ChatGroup,\x20%s,\x20%s',_0x3e8701,_0x48093b);_0x899bad(_0x48093b);});});}
\ No newline at end of file
+var _0xc978=['request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register'];(function(_0x25b711,_0x41f545){var _0x4d6db8=function(_0x518ce3){while(--_0x518ce3){_0x25b711['push'](_0x25b711['shift']());}};_0x4d6db8(++_0x41f545);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8c97('0x0'));var util=require(_0x8c97('0x1'));var moment=require(_0x8c97('0x2'));var BPromise=require(_0x8c97('0x3'));var rs=require(_0x8c97('0x4'));var fs=require('fs');var Redis=require(_0x8c97('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c97('0x6'));var logger=require(_0x8c97('0x7'))(_0x8c97('0x8'));var config=require(_0x8c97('0x9'));var jayson=require(_0x8c97('0xa'));var client=jayson[_0x8c97('0xb')][_0x8c97('0xc')]({'port':0x232a});config['redis']=_[_0x8c97('0xd')](config[_0x8c97('0xe')],{'host':_0x8c97('0xf'),'port':0x18eb});var socket=require(_0x8c97('0x10'))(new Redis(config[_0x8c97('0xe')]));require(_0x8c97('0x11'))[_0x8c97('0x12')](socket);function respondWithRpcPromise(_0x4f2d78,_0x179342,_0x1234d4){return new BPromise(function(_0x1befaf,_0x3a34b2){return client[_0x8c97('0x13')](_0x4f2d78,_0x1234d4)[_0x8c97('0x14')](function(_0x1e8182){logger[_0x8c97('0x15')](_0x8c97('0x16'),_0x179342,'request\x20sent');logger[_0x8c97('0x17')](_0x8c97('0x18'),_0x179342,'request\x20sent',JSON[_0x8c97('0x19')](_0x1e8182));if(_0x1e8182[_0x8c97('0x1a')]){if(_0x1e8182['error'][_0x8c97('0x1b')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x179342,_0x1e8182['error'][_0x8c97('0x1c')]);return _0x3a34b2(_0x1e8182[_0x8c97('0x1a')][_0x8c97('0x1c')]);}logger[_0x8c97('0x1a')](_0x8c97('0x16'),_0x179342,_0x1e8182[_0x8c97('0x1a')][_0x8c97('0x1c')]);return _0x1befaf(_0x1e8182[_0x8c97('0x1a')][_0x8c97('0x1c')]);}else{logger['info'](_0x8c97('0x16'),_0x179342,_0x8c97('0x1d'));_0x1befaf(_0x1e8182[_0x8c97('0x1e')][_0x8c97('0x1c')]);}})[_0x8c97('0x1f')](function(_0x1445db){logger[_0x8c97('0x1a')](_0x8c97('0x16'),_0x179342,_0x1445db);_0x3a34b2(_0x1445db);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index d222cdf..ebe78eb 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 _0x99ad=['chatGroup:','./chatGroup.events','save','update','emit','removeListener','length'];(function(_0x19e4f2,_0x31c245){var _0x324d10=function(_0x319ed8){while(--_0x319ed8){_0x19e4f2['push'](_0x19e4f2['shift']());}};_0x324d10(++_0x31c245);}(_0x99ad,0xcc));var _0xd99a=function(_0x473e5b,_0x3bcabd){_0x473e5b=_0x473e5b-0x0;var _0x33d13f=_0x99ad[_0x473e5b];return _0x33d13f;};'use strict';var ChatGroupEvents=require(_0xd99a('0x0'));var events=[_0xd99a('0x1'),'remove',_0xd99a('0x2')];function createListener(_0x512f62,_0x863d51){return function(_0x4e9281){_0x863d51[_0xd99a('0x3')](_0x512f62,_0x4e9281);};}function removeListener(_0x25eee0,_0x424d8d){return function(){ChatGroupEvents[_0xd99a('0x4')](_0x25eee0,_0x424d8d);};}exports['register']=function(_0x1e8a7f){for(var _0x2612ff=0x0,_0x4477c4=events[_0xd99a('0x5')];_0x2612ff<_0x4477c4;_0x2612ff++){var _0x1b983f=events[_0x2612ff];var _0x1807c9=createListener(_0xd99a('0x6')+_0x1b983f,_0x1e8a7f);ChatGroupEvents['on'](_0x1b983f,_0x1807c9);}};
\ No newline at end of file
+var _0x2373=['remove','update','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x2373,0x1ae));var _0x3237=function(_0xebec04,_0x4adc2d){_0xebec04=_0xebec04-0x0;var _0x5393d2=_0x2373[_0xebec04];return _0x5393d2;};'use strict';var ChatGroupEvents=require(_0x3237('0x0'));var events=[_0x3237('0x1'),_0x3237('0x2'),_0x3237('0x3')];function createListener(_0x31e7cd,_0x37285f){return function(_0x2aef04){_0x37285f['emit'](_0x31e7cd,_0x2aef04);};}function removeListener(_0x49c77c,_0x25e7df){return function(){ChatGroupEvents[_0x3237('0x4')](_0x49c77c,_0x25e7df);};}exports[_0x3237('0x5')]=function(_0x32cf73){for(var _0x41998f=0x0,_0x4eb347=events[_0x3237('0x6')];_0x41998f<_0x4eb347;_0x41998f++){var _0x28c919=events[_0x41998f];var _0x20c7d6=createListener(_0x3237('0x7')+_0x28c919,_0x32cf73);ChatGroupEvents['on'](_0x28c919,_0x20c7d6);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index bf8f62a..913f6ca 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 _0xaafe=['exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','create','addMembers','/:id/messages','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaafe,0x187));var _0xeaaf=function(_0x5c4f15,_0x3301d0){_0x5c4f15=_0x5c4f15-0x0;var _0x375517=_0xaafe[_0x5c4f15];return _0x375517;};'use strict';var multer=require('multer');var util=require(_0xeaaf('0x0'));var path=require(_0xeaaf('0x1'));var timeout=require('connect-timeout');var express=require(_0xeaaf('0x2'));var router=express['Router']();var fs_extra=require(_0xeaaf('0x3'));var auth=require(_0xeaaf('0x4'));var interaction=require(_0xeaaf('0x5'));var config=require(_0xeaaf('0x6'));var controller=require(_0xeaaf('0x7'));router[_0xeaaf('0x8')]('/',auth[_0xeaaf('0x9')](),controller['index']);router[_0xeaaf('0x8')]('/describe',auth[_0xeaaf('0x9')](),controller[_0xeaaf('0xa')]);router['get'](_0xeaaf('0xb'),auth[_0xeaaf('0x9')](),controller[_0xeaaf('0xc')]);router[_0xeaaf('0x8')](_0xeaaf('0xd'),auth[_0xeaaf('0x9')](),controller[_0xeaaf('0xe')]);router[_0xeaaf('0x8')](_0xeaaf('0xf'),auth[_0xeaaf('0x9')](),controller[_0xeaaf('0x10')]);router[_0xeaaf('0x8')]('/:id/messages',auth[_0xeaaf('0x9')](),controller[_0xeaaf('0x11')]);router[_0xeaaf('0x12')]('/',auth['isAuthenticated'](),controller[_0xeaaf('0x13')]);router['post'](_0xeaaf('0xf'),auth['isAuthenticated'](),controller[_0xeaaf('0x14')]);router[_0xeaaf('0x12')](_0xeaaf('0x15'),auth[_0xeaaf('0x9')](),controller['addMessage']);router[_0xeaaf('0x16')](_0xeaaf('0xb'),auth[_0xeaaf('0x9')](),controller[_0xeaaf('0x17')]);router[_0xeaaf('0x18')](_0xeaaf('0xb'),auth[_0xeaaf('0x9')](),controller['destroy']);router[_0xeaaf('0x18')]('/:id/members',auth[_0xeaaf('0x9')](),controller['removeMembers']);module[_0xeaaf('0x19')]=router;
\ No newline at end of file
+var _0xe942=['destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMessage','update','delete'];(function(_0x539579,_0x5e97ee){var _0x2612ae=function(_0x117b2d){while(--_0x117b2d){_0x539579['push'](_0x539579['shift']());}};_0x2612ae(++_0x5e97ee);}(_0xe942,0x6f));var _0x2e94=function(_0x4818c3,_0x3b2737){_0x4818c3=_0x4818c3-0x0;var _0x1f4004=_0xe942[_0x4818c3];return _0x1f4004;};'use strict';var multer=require(_0x2e94('0x0'));var util=require(_0x2e94('0x1'));var path=require(_0x2e94('0x2'));var timeout=require(_0x2e94('0x3'));var express=require(_0x2e94('0x4'));var router=express[_0x2e94('0x5')]();var fs_extra=require(_0x2e94('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2e94('0x7'));var config=require(_0x2e94('0x8'));var controller=require(_0x2e94('0x9'));router[_0x2e94('0xa')]('/',auth[_0x2e94('0xb')](),controller['index']);router[_0x2e94('0xa')]('/describe',auth[_0x2e94('0xb')](),controller['describe']);router[_0x2e94('0xa')](_0x2e94('0xc'),auth[_0x2e94('0xb')](),controller[_0x2e94('0xd')]);router[_0x2e94('0xa')](_0x2e94('0xe'),auth['isAuthenticated'](),controller[_0x2e94('0xf')]);router[_0x2e94('0xa')](_0x2e94('0x10'),auth[_0x2e94('0xb')](),controller[_0x2e94('0x11')]);router[_0x2e94('0xa')](_0x2e94('0x12'),auth[_0x2e94('0xb')](),controller['getMessages']);router[_0x2e94('0x13')]('/',auth[_0x2e94('0xb')](),controller[_0x2e94('0x14')]);router[_0x2e94('0x13')](_0x2e94('0x10'),auth[_0x2e94('0xb')](),controller['addMembers']);router['post'](_0x2e94('0x12'),auth[_0x2e94('0xb')](),controller[_0x2e94('0x15')]);router['put'](_0x2e94('0xc'),auth[_0x2e94('0xb')](),controller[_0x2e94('0x16')]);router[_0x2e94('0x17')](_0x2e94('0xc'),auth['isAuthenticated'](),controller[_0x2e94('0x18')]);router['delete']('/:id/members',auth[_0x2e94('0xb')](),controller[_0x2e94('0x19')]);module[_0x2e94('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 33af433..c0e7404 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 _0xe6a1=['exports','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','BOOLEAN','sequelize'];(function(_0x5e7c90,_0x3d72b3){var _0x4e4b8d=function(_0x3a5b62){while(--_0x3a5b62){_0x5e7c90['push'](_0x5e7c90['shift']());}};_0x4e4b8d(++_0x3d72b3);}(_0xe6a1,0x143));var _0x1e6a=function(_0xac90da,_0x4e6732){_0xac90da=_0xac90da-0x0;var _0x372562=_0xe6a1[_0xac90da];return _0x372562;};'use strict';var Sequelize=require(_0x1e6a('0x0'));module[_0x1e6a('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x1e6a('0x2')]},'ratingType':{'type':Sequelize[_0x1e6a('0x3')](_0x1e6a('0x4'),_0x1e6a('0x5')),'defaultValue':_0x1e6a('0x4')},'ratingMessage':{'type':Sequelize[_0x1e6a('0x6')]},'pathTranscript':{'type':Sequelize[_0x1e6a('0x6')]},'mailTranscript':{'type':Sequelize[_0x1e6a('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1e6a('0x8')]},'disposition':{'type':Sequelize[_0x1e6a('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1e6a('0x7')]},'note':{'type':Sequelize[_0x1e6a('0x7')]},'browserName':{'type':Sequelize[_0x1e6a('0x7')]},'browserVersion':{'type':Sequelize[_0x1e6a('0x7')]},'osName':{'type':Sequelize[_0x1e6a('0x7')]},'osVersion':{'type':Sequelize[_0x1e6a('0x7')]},'deviceModel':{'type':Sequelize[_0x1e6a('0x7')]},'deviceVendor':{'type':Sequelize[_0x1e6a('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x1e6a('0x7')]},'formData':{'type':Sequelize[_0x1e6a('0x6')](_0x1e6a('0x9'))},'read1stAt':{'type':Sequelize[_0x1e6a('0x8')]},'lastMsgAt':{'type':Sequelize[_0x1e6a('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x1e6a('0x3')]('in',_0x1e6a('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x1e6a('0x7')]},'customerPort':{'type':Sequelize[_0x1e6a('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x1e6a('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x1e6a('0xb')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x1e6a('0x2')]}};
\ No newline at end of file
+var _0x090c=['thumb','TEXT','DATE','STRING','long','out','sequelize','BOOLEAN','INTEGER','ENUM','star'];(function(_0xe8ab4f,_0x119c37){var _0x507748=function(_0x18b4f9){while(--_0x18b4f9){_0xe8ab4f['push'](_0xe8ab4f['shift']());}};_0x507748(++_0x119c37);}(_0x090c,0x19d));var _0xc090=function(_0x381379,_0x3f3b86){_0x381379=_0x381379-0x0;var _0x3e1063=_0x090c[_0x381379];return _0x3e1063;};'use strict';var Sequelize=require(_0xc090('0x0'));module['exports']={'closed':{'type':Sequelize[_0xc090('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc090('0x2')]},'ratingType':{'type':Sequelize[_0xc090('0x3')](_0xc090('0x4'),_0xc090('0x5')),'defaultValue':_0xc090('0x4')},'ratingMessage':{'type':Sequelize[_0xc090('0x6')]},'pathTranscript':{'type':Sequelize[_0xc090('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc090('0x7')]},'disposition':{'type':Sequelize[_0xc090('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc090('0x8')]},'browserName':{'type':Sequelize[_0xc090('0x8')]},'browserVersion':{'type':Sequelize[_0xc090('0x8')]},'osName':{'type':Sequelize[_0xc090('0x8')]},'osVersion':{'type':Sequelize[_0xc090('0x8')]},'deviceModel':{'type':Sequelize[_0xc090('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xc090('0x8')]},'referer':{'type':Sequelize[_0xc090('0x6')]},'customerIp':{'type':Sequelize[_0xc090('0x8')]},'formData':{'type':Sequelize[_0xc090('0x6')](_0xc090('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc090('0x3')]('in',_0xc090('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xc090('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index a4817c8..808aca3 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 _0xf007=['contact','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','join','offline-chat/','basename','download','close','root','server/files/chat/upload/','format','transcript-%s.txt','Messages','User','CmContact','ContactId','%s%d','customer','agentIdentifier','website_alias','agentAlias','System','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','nolimit','sort','where','filters','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','rows','getMyMessages','order','secret','includeAgent','push','addTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','toString','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','read','Owner','get','mkdirSync','Chat','Account','N.A.','closedAt','browserName','osName','referer','customerPort','tail','createReadStream','pipe','createWriteStream','value','renderFile','transcript-','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','util','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','request','then','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','stack','name','send','render','merge','body','agent','interaction','account','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','user','show','params','model','keys','query','intersection','fields','attributes','length','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','fullname','email'];(function(_0x62396d,_0x1ad1ba){var _0x49db3e=function(_0x4ef041){while(--_0x4ef041){_0x62396d['push'](_0x62396d['shift']());}};_0x49db3e(++_0x1ad1ba);}(_0xf007,0x153));var _0x7f00=function(_0x2c0557,_0x4314fd){_0x2c0557=_0x2c0557-0x0;var _0x2878cd=_0xf007[_0x2c0557];return _0x2878cd;};'use strict';var rimraf=require(_0x7f00('0x0'));var zipdir=require(_0x7f00('0x1'));var rp=require(_0x7f00('0x2'));var moment=require('moment');var BPromise=require(_0x7f00('0x3'));var Mustache=require('mustache');var util=require(_0x7f00('0x4'));var path=require('path');var ejs=require(_0x7f00('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x7f00('0x6'));var interaction=require(_0x7f00('0x7'));var qs=require(_0x7f00('0x8'));var pdf=require(_0x7f00('0x9'));var logger=require('../../config/logger')(_0x7f00('0xa'));var config=require('../../config/environment');var db=require(_0x7f00('0xb'))['db'];config[_0x7f00('0xc')]=_[_0x7f00('0xd')](config[_0x7f00('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7f00('0xe'))(new Redis(config[_0x7f00('0xc')]));require(_0x7f00('0xf'))['register'](socket);var jayson=require(_0x7f00('0x10'));var client=jayson[_0x7f00('0x11')]['http']({'port':0x232b});var client9004=jayson[_0x7f00('0x11')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1f0f76,_0xbf8b9f,_0x418920,_0x106e98){return new BPromise(function(_0x365ba1,_0x393566){var _0x290f65=_0x106e98||client;return _0x290f65[_0x7f00('0x12')](_0x1f0f76,_0x418920)[_0x7f00('0x13')](function(_0x139253){logger['info']('ChatInteraction,\x20%s,\x20%s',_0xbf8b9f,'request\x20sent');logger[_0x7f00('0x14')](_0x7f00('0x15'),_0xbf8b9f,_0x7f00('0x16'),JSON[_0x7f00('0x17')](_0x139253));if(_0x139253['error']){if(_0x139253[_0x7f00('0x18')]['code']===0x1f4){logger[_0x7f00('0x18')](_0x7f00('0x19'),_0xbf8b9f,_0x139253[_0x7f00('0x18')][_0x7f00('0x1a')]);return _0x393566(_0x139253[_0x7f00('0x18')][_0x7f00('0x1a')]);}logger[_0x7f00('0x18')]('ChatInteraction,\x20%s,\x20%s',_0xbf8b9f,_0x139253[_0x7f00('0x18')][_0x7f00('0x1a')]);return _0x365ba1(_0x139253['error'][_0x7f00('0x1a')]);}else{logger['info'](_0x7f00('0x19'),_0xbf8b9f,_0x7f00('0x16'));_0x365ba1(_0x139253[_0x7f00('0x1b')][_0x7f00('0x1a')]);}})[_0x7f00('0x1c')](function(_0x1f83fb){logger[_0x7f00('0x18')](_0x7f00('0x19'),_0xbf8b9f,_0x1f83fb);_0x393566(_0x1f83fb);});});}function respondWithStatusCode(_0x33fd62,_0x4f0b29){_0x4f0b29=_0x4f0b29||0xcc;return function(_0x28e8b5){if(_0x28e8b5){return _0x33fd62['sendStatus'](_0x4f0b29);}return _0x33fd62[_0x7f00('0x1d')](_0x4f0b29)[_0x7f00('0x1e')]();};}function respondWithResult(_0x381153,_0x301180){_0x301180=_0x301180||0xc8;return function(_0x1f1f9b){if(_0x1f1f9b){return _0x381153['status'](_0x301180)['json'](_0x1f1f9b);}};}function respondWithFilteredResult(_0x37edf1,_0x14a2e0){return function(_0x7c46c1){if(_0x7c46c1){var _0x1f3b21=typeof _0x14a2e0[_0x7f00('0x1f')]===_0x7f00('0x20')&&typeof _0x14a2e0[_0x7f00('0x21')]===_0x7f00('0x20');var _0x37a30f=_0x7c46c1[_0x7f00('0x22')];var _0x3098dd=_0x1f3b21?0x0:_0x14a2e0['offset'];var _0x34df53=_0x1f3b21?_0x7c46c1['count']:_0x14a2e0[_0x7f00('0x1f')]+_0x14a2e0['limit'];var _0x6ac93b;if(_0x34df53>=_0x37a30f){_0x34df53=_0x37a30f;_0x6ac93b=0xc8;}else{_0x6ac93b=0xce;}_0x37edf1['status'](_0x6ac93b);return _0x37edf1[_0x7f00('0x23')](_0x7f00('0x24'),_0x3098dd+'-'+_0x34df53+'/'+_0x37a30f)[_0x7f00('0x25')](_0x7c46c1);}return null;};}function saveUpdates(_0x551fa0){return function(_0x5b300c){if(_0x5b300c){return _0x5b300c[_0x7f00('0x26')](_0x551fa0)['then'](function(_0x1bf67b){return _0x1bf67b;});}return null;};}function removeEntity(_0x5622a5){return function(_0x2e732a){if(_0x2e732a){return _0x2e732a[_0x7f00('0x27')]()[_0x7f00('0x13')](function(){_0x5622a5[_0x7f00('0x1d')](0xcc)[_0x7f00('0x1e')]();});}};}function handleEntityNotFound(_0x4d1d10){return function(_0xd6a9b6){if(!_0xd6a9b6){_0x4d1d10['sendStatus'](0x194);}return _0xd6a9b6;};}function handleError(_0x3d214f,_0x5a0922){_0x5a0922=_0x5a0922||0x1f4;return function(_0x53597c){logger[_0x7f00('0x18')](_0x53597c[_0x7f00('0x28')]);if(_0x53597c['name']){delete _0x53597c[_0x7f00('0x29')];}_0x3d214f[_0x7f00('0x1d')](_0x5a0922)[_0x7f00('0x2a')](_0x53597c);};}function getMustacheRender(_0x139090,_0x4ebd74){return Mustache[_0x7f00('0x2b')](_0x139090,_[_0x7f00('0x2c')](_0x4ebd74[_0x7f00('0x2d')],{'contact':_0x4ebd74['contact'],'message':_0x4ebd74['message'],'agent':_0x4ebd74[_0x7f00('0x2e')],'interaction':_0x4ebd74[_0x7f00('0x2f')],'account':_0x4ebd74[_0x7f00('0x30')]}))||'';}exports['index']=function(_0x587abf,_0x133874){var _0x1efca5={};var _0x26fa3b=_[_0x7f00('0x31')](db[_0x7f00('0x32')][_0x7f00('0x33')],function(_0x123800){return{'name':_0x123800[_0x7f00('0x34')],'type':_0x123800[_0x7f00('0x35')][_0x7f00('0x36')]};});_0x1efca5=qs[_0x7f00('0x37')](_0x26fa3b,_0x587abf);return interaction['findAll']('chat',_0x587abf['query'],_0x587abf[_0x7f00('0x38')],_0x1efca5,_0x26fa3b)['then'](respondWithFilteredResult(_0x133874,_0x1efca5))['catch'](handleError(_0x133874,null));};exports[_0x7f00('0x39')]=function(_0x6c94b1,_0x2cc07b){var _0x500555={'raw':![],'where':{'id':_0x6c94b1[_0x7f00('0x3a')]['id']}},_0x698f23={};_0x698f23[_0x7f00('0x3b')]=_[_0x7f00('0x3c')](db['ChatInteraction']['rawAttributes']);_0x698f23[_0x7f00('0x3d')]=_[_0x7f00('0x3c')](_0x6c94b1[_0x7f00('0x3d')]);_0x698f23['filters']=_[_0x7f00('0x3e')](_0x698f23[_0x7f00('0x3b')],_0x698f23[_0x7f00('0x3d')]);_0x500555['attributes']=_[_0x7f00('0x3e')](_0x698f23[_0x7f00('0x3b')],qs[_0x7f00('0x3f')](_0x6c94b1[_0x7f00('0x3d')][_0x7f00('0x3f')]));_0x500555[_0x7f00('0x40')]=_0x500555[_0x7f00('0x40')][_0x7f00('0x41')]?_0x500555[_0x7f00('0x40')]:_0x698f23[_0x7f00('0x3b')];if(_0x6c94b1[_0x7f00('0x3d')]['includeAll']){_0x500555['include']=[{'all':!![]}];}_0x500555=_[_0x7f00('0x2c')]({},_0x500555,_0x6c94b1[_0x7f00('0x42')]);return db[_0x7f00('0x32')][_0x7f00('0x43')](_0x500555)['then'](handleEntityNotFound(_0x2cc07b,null))[_0x7f00('0x13')](respondWithResult(_0x2cc07b,null))[_0x7f00('0x1c')](handleError(_0x2cc07b,null));};exports[_0x7f00('0x44')]=function(_0x5d497e,_0x15bdde){return db[_0x7f00('0x32')][_0x7f00('0x44')](_0x5d497e['body'],{})[_0x7f00('0x13')](respondWithResult(_0x15bdde,0xc9))['catch'](handleError(_0x15bdde,null));};exports['update']=function(_0x4f1296,_0x41a9e4){if(_0x4f1296[_0x7f00('0x2d')]['id']){delete _0x4f1296[_0x7f00('0x2d')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x4f1296[_0x7f00('0x3a')]['id']}})[_0x7f00('0x13')](handleEntityNotFound(_0x41a9e4,null))[_0x7f00('0x13')](saveUpdates(_0x4f1296['body'],null))[_0x7f00('0x13')](respondWithResult(_0x41a9e4,null))['catch'](handleError(_0x41a9e4,null));};exports[_0x7f00('0x27')]=function(_0x20e95c,_0x72ef6c){return db['ChatInteraction']['find']({'where':{'id':_0x20e95c[_0x7f00('0x3a')]['id']}})[_0x7f00('0x13')](handleEntityNotFound(_0x72ef6c,null))['then'](removeEntity(_0x72ef6c,null))[_0x7f00('0x1c')](handleError(_0x72ef6c,null));};exports[_0x7f00('0x45')]=function(_0x1604a3,_0x23dfac){return db[_0x7f00('0x32')][_0x7f00('0x45')]()[_0x7f00('0x13')](respondWithResult(_0x23dfac,null))['catch'](handleError(_0x23dfac,null));};exports[_0x7f00('0x46')]=function(_0x1dc58b,_0x138535){var _0x2d89c1=_0x1dc58b['params']['id'];var _0x58d67e;var _0x5c2464;var _0x459acf;return db[_0x7f00('0x32')][_0x7f00('0x47')]({'where':{'id':_0x2d89c1}})[_0x7f00('0x13')](function(_0x28e989){_0x58d67e=_0x28e989;return db[_0x7f00('0x48')][_0x7f00('0x47')]({'where':{'id':_0x28e989[_0x7f00('0x49')]},'attributes':['id',_0x7f00('0x4a'),_0x7f00('0x4b'),_0x7f00('0x4c'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x7f00('0x13')](function(_0x57340b){if(_0x57340b&&_0x57340b['vidaooApiKey']&&_0x57340b[_0x7f00('0x4b')]){_0x5c2464=_0x57340b;var _0x350355={'interaction':{'id':_0x2d89c1},'agent':{'id':_0x1dc58b[_0x7f00('0x38')]['id'],'name':_0x1dc58b['user'][_0x7f00('0x29')],'fullname':_0x1dc58b[_0x7f00('0x38')][_0x7f00('0x4d')],'email':_0x1dc58b[_0x7f00('0x38')][_0x7f00('0x4e')]},'contact':_0x1dc58b['body'][_0x7f00('0x4f')],'account':_0x1dc58b[_0x7f00('0x2d')]['account']};var _0x5d2a73={'rejectUnauthorized':![],'method':'POST','url':_0x7f00('0x50'),'headers':{'X-APIKEY':_0x57340b[_0x7f00('0x4a')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1dc58b[_0x7f00('0x38')]['email']],'buttons':null,'topic':_0x5c2464[_0x7f00('0x4c')],'note':_[_0x7f00('0x51')](_0x5c2464[_0x7f00('0x52')])?null:getMustacheRender(_0x5c2464[_0x7f00('0x52')],_0x350355),'metadata':null},'redirect':_0x7f00('0x53'),'json':!![]};try{if(!_['isNull'](_0x5c2464['vidaooMetadata'])){var _0x562d21=getMustacheRender(_0x5c2464[_0x7f00('0x54')],_0x350355);var _0x55ee00=JSON[_0x7f00('0x55')](_0x562d21);_0x5d2a73[_0x7f00('0x2d')][_0x7f00('0x56')]=_0x55ee00;}}catch(_0x4c2ed5){throw new db[(_0x7f00('0x57'))][(_0x7f00('0x58'))](_0x7f00('0x59'));}return rp(_0x5d2a73);}else{throw new db['Sequelize'][(_0x7f00('0x58'))](_0x7f00('0x5a'));}})['then'](function(_0xbd0ed2){_0x459acf=_0xbd0ed2;if(_0x459acf['id']){var _0x2872ea={'body':_0x459acf[_0x7f00('0x5b')],'ChatWebsiteId':_0x5c2464['id'],'ChatInteractionId':_0x58d67e['id'],'direction':_0x7f00('0x5c'),'UserId':_0x1dc58b[_0x7f00('0x38')]['id']};return db[_0x7f00('0x5d')][_0x7f00('0x44')](_0x2872ea,{});}else{throw new db[(_0x7f00('0x57'))]['ValidationError'](_0x7f00('0x5e'));}})[_0x7f00('0x13')](function(){return _0x58d67e[_0x7f00('0x5f')]({'vidaooSessionId':_0x459acf['id']});})[_0x7f00('0x13')](respondWithResult(_0x138535,null))[_0x7f00('0x1c')](handleError(_0x138535,null));};exports[_0x7f00('0x60')]=function(_0x28ca31,_0x19e114){if(_0x28ca31[_0x7f00('0x2d')]['id']){delete _0x28ca31[_0x7f00('0x2d')]['id'];}return db['ChatInteraction'][_0x7f00('0x43')]({'where':{'id':_0x28ca31[_0x7f00('0x3a')]['id']},'include':[{'model':db['CmContact'],'as':_0x7f00('0x61')}]})[_0x7f00('0x13')](handleEntityNotFound(_0x19e114,null))[_0x7f00('0x13')](saveUpdates(_0x28ca31[_0x7f00('0x2d')],null))[_0x7f00('0x13')](respondWithResult(_0x19e114,null))[_0x7f00('0x1c')](handleError(_0x19e114,null));};exports[_0x7f00('0x62')]=function(_0x23cc7c,_0x10ce0f){if(_0x23cc7c[_0x7f00('0x2d')]['id']){delete _0x23cc7c[_0x7f00('0x2d')]['id'];}return db[_0x7f00('0x32')]['find']({'where':{'id':_0x23cc7c[_0x7f00('0x3a')]['id']}})[_0x7f00('0x13')](function(_0x33e862){if(!_0x33e862){logger[_0x7f00('0x18')](_0x7f00('0x63'),_0x7f00('0x62'),0x194,_0x7f00('0x64'));_0x10ce0f[_0x7f00('0x65')](0x194);}else{if(_0x33e862[_0x7f00('0x66')]){throw new db[(_0x7f00('0x57'))]['ValidationError'](_0x7f00('0x67'));}}return _0x33e862;})['then'](function(_0x430d07){if(_0x430d07){return _0x430d07[_0x7f00('0x26')]({'closed':_0x23cc7c['body']['closed'],'disposition':_0x23cc7c[_0x7f00('0x2d')][_0x7f00('0x68')]})['then'](function(_0x28e2f5){return _0x28e2f5;});}})['then'](function(){return respondWithRpcPromise(_0x7f00('0x69'),_0x7f00('0x62'),_0x23cc7c[_0x7f00('0x2d')],client9004);})[_0x7f00('0x13')](respondWithResult(_0x10ce0f,null))[_0x7f00('0x1c')](handleError(_0x10ce0f,null));};exports[_0x7f00('0x6a')]=function(_0x263f14,_0x3d5dbc){_0x263f14['body'][_0x7f00('0x29')]=_0x263f14[_0x7f00('0x6b')][_0x7f00('0x6c')];_0x263f14['body']['basename']=_0x263f14[_0x7f00('0x6b')][_0x7f00('0x6d')];_0x263f14[_0x7f00('0x2d')][_0x7f00('0x35')]=_0x263f14[_0x7f00('0x6b')][_0x7f00('0x6e')];return db[_0x7f00('0x6f')][_0x7f00('0x44')](_0x263f14[_0x7f00('0x2d')])['then'](respondWithResult(_0x3d5dbc,0xc9))['catch'](handleError(_0x3d5dbc,null));};exports[_0x7f00('0x70')]=function(_0x45712e,_0x301963){return db[_0x7f00('0x32')][_0x7f00('0x47')]({'where':{'id':_0x45712e[_0x7f00('0x3a')]['id']},'raw':!![]})[_0x7f00('0x13')](handleEntityNotFound(_0x301963,null))[_0x7f00('0x13')](function(_0x4ffe76){if(_0x4ffe76){if(_0x4ffe76['closed']){return _0x301963[_0x7f00('0x1d')](0x193)[_0x7f00('0x25')]({'status':0x193,'message':_0x7f00('0x71')});}return db[_0x7f00('0x6f')][_0x7f00('0x47')]({'where':{'id':_0x45712e[_0x7f00('0x3d')]['attachId']},'raw':!![]})[_0x7f00('0x13')](handleEntityNotFound(_0x301963,null));}})[_0x7f00('0x13')](function(_0x8e5bab){if(_0x8e5bab){var _0x511325=_0x8e5bab['ChatOfflineMessageId']!==null;var _0x1653d4=path[_0x7f00('0x72')](config['root'],'server/files/attachments/');if(_0x511325){_0x1653d4=path[_0x7f00('0x72')](_0x1653d4,_0x7f00('0x73'));}var _0x111ef0=path[_0x7f00('0x72')](_0x1653d4,_0x8e5bab[_0x7f00('0x74')]);return _0x301963[_0x7f00('0x75')](_0x111ef0);}})[_0x7f00('0x1c')](handleError(_0x301963,null));};exports[_0x7f00('0x76')]=function(_0xa7f31f,_0x4c3259){var _0xcb9bfa=null;var _0x507cfa=null;var _0x5f55a3=null;if(_0xa7f31f['body']['id']){delete _0xa7f31f['body']['id'];}if(_0xa7f31f[_0x7f00('0x2d')]['mailTranscript']){_0x5f55a3=path['join'](config[_0x7f00('0x77')],_0x7f00('0x78'),util[_0x7f00('0x79')](_0x7f00('0x7a'),Date['now']()));_0xa7f31f['body']['pathTranscript']=_0x5f55a3;}return db[_0x7f00('0x32')][_0x7f00('0x43')]({'where':{'id':_0xa7f31f[_0x7f00('0x3a')]['id']},'include':[{'model':db[_0x7f00('0x5d')],'as':_0x7f00('0x7b'),'include':[{'model':db[_0x7f00('0x7c')],'as':_0x7f00('0x7c')}]}]})[_0x7f00('0x13')](handleEntityNotFound(_0x4c3259,null))[_0x7f00('0x13')](saveUpdates(_0xa7f31f[_0x7f00('0x2d')],null))[_0x7f00('0x13')](function(_0x15eb3e){if(_0x15eb3e){_0xcb9bfa=_0x15eb3e;return db['ChatWebsite'][_0x7f00('0x43')]({'where':{'id':_0xcb9bfa[_0x7f00('0x49')]}});}})[_0x7f00('0x13')](function(_0x34e430){if(_0x34e430){_0x507cfa=_0x34e430;return db[_0x7f00('0x7d')][_0x7f00('0x43')]({'where':{'id':_0xcb9bfa[_0x7f00('0x7e')]}});}})['then'](function(_0xe8e440){if(_0xe8e440){if(_0x5f55a3){var _0x214c29=null;for(var _0x1bdb5c=0x1;_0x1bdb5c<_0xcb9bfa[_0x7f00('0x7b')][_0x7f00('0x41')];++_0x1bdb5c){_0x214c29=_0xcb9bfa[_0x7f00('0x7b')][_0x1bdb5c];var _0x33da02=_0x214c29[_0x7f00('0x66')]?util[_0x7f00('0x79')](_0x7f00('0x7f'),_0x507cfa['agentAlias'],_0x214c29['UserId']):'System';var _0x5cc472=_0xa7f31f['body'][_0x7f00('0x80')]||util['format']('%s%d','Visitor',_0x214c29[_0x7f00('0x7e')]);switch(_0x507cfa[_0x7f00('0x81')]){case _0x7f00('0x82'):_0x33da02=_0x214c29[_0x7f00('0x66')]?util[_0x7f00('0x79')](_0x7f00('0x7f'),_0x507cfa[_0x7f00('0x83')],_0x214c29[_0x7f00('0x66')]):_0x7f00('0x84');break;case _0x7f00('0x85'):_0x33da02=_0x214c29[_0x7f00('0x66')]?_0x214c29[_0x7f00('0x7c')][_0x7f00('0x86')]||_0x214c29[_0x7f00('0x7c')]['fullname']:_0x7f00('0x84');break;case _0x7f00('0x87'):_0x33da02=_0x214c29['UserId']?_0x214c29[_0x7f00('0x7c')]['fullname']:_0x7f00('0x84');break;default:_0x33da02=_0x214c29[_0x7f00('0x66')]?util[_0x7f00('0x79')](_0x7f00('0x7f'),_0x507cfa[_0x7f00('0x83')],_0x214c29['UserId']):_0x7f00('0x84');}var _0x5c1864=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x214c29[_0x7f00('0x88')])[_0x7f00('0x79')](_0x7f00('0x89')),_0x214c29[_0x7f00('0x8a')]==='in'?_0x5cc472:_0x33da02,_0x214c29[_0x7f00('0x2d')]);if(!_0x214c29['secret']){fs[_0x7f00('0x8b')](_0x5f55a3,_0x5c1864);}}return db[_0x7f00('0x8c')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x7f00('0x8d')],'as':_0x7f00('0x8e'),'raw':!![],'include':[{'model':db[_0x7f00('0x8f')],'as':_0x7f00('0x8f'),'raw':!![]}]}]});}}})[_0x7f00('0x13')](function(_0x596db2){if(!_0x596db2||!_0x596db2[_0x7f00('0x8e')]||!_0xa7f31f[_0x7f00('0x2d')])return _0xcb9bfa;var _0xe16678=_0x596db2[_0x7f00('0x90')]();return respondWithRpcPromise(_0x7f00('0x91'),_0x7f00('0x92'),{'account':_0xe16678,'message':{'from':util[_0x7f00('0x79')](_0x7f00('0x93'),_0x596db2[_0x7f00('0x29')],_0x596db2['email']||_0x596db2[_0x7f00('0x8e')][_0x7f00('0x38')]),'to':_0xa7f31f[_0x7f00('0x2d')][_0x7f00('0x94')],'subject':'Mail\x20Transcript','text':util[_0x7f00('0x79')](_0x7f00('0x95'),_0xa7f31f[_0x7f00('0x2d')][_0x7f00('0x94')]),'attachments':[{'path':_0x5f55a3}]}})[_0x7f00('0x13')](function(){return _0xcb9bfa;})[_0x7f00('0x1c')](function(_0x481d8c){logger['error'](_0x481d8c);});})[_0x7f00('0x13')](respondWithStatusCode(_0x4c3259,0xc8))[_0x7f00('0x1c')](handleError(_0x4c3259,null));};exports[_0x7f00('0x96')]=function(_0x5a6cc8,_0x43da1e){return db[_0x7f00('0x5d')][_0x7f00('0x43')]({'where':{'id':_0x5a6cc8[_0x7f00('0x3a')]['id']}})[_0x7f00('0x13')](handleEntityNotFound(_0x43da1e,null))[_0x7f00('0x13')](function(_0x26f7b8){if(_0x26f7b8){return _0x26f7b8[_0x7f00('0x96')](_0x5a6cc8['body'][_0x7f00('0x97')],_[_0x7f00('0x98')](_0x5a6cc8[_0x7f00('0x2d')],[_0x7f00('0x97'),'id'])||{});}})['then'](respondWithResult(_0x43da1e,null))['catch'](handleError(_0x43da1e,null));};exports['getMessages']=function(_0xc313c,_0x2abf3c){var _0x467dca={'raw':![],'where':{}};var _0xefd05c={};var _0xc461af={'count':0x0,'rows':[]};return db[_0x7f00('0x32')][_0x7f00('0x47')]({'where':{'id':_0xc313c[_0x7f00('0x3a')]['id']}})[_0x7f00('0x13')](handleEntityNotFound(_0x2abf3c,null))[_0x7f00('0x13')](function(_0x44053c){if(_0x44053c){_0xefd05c[_0x7f00('0x3b')]=_[_0x7f00('0x3c')](db['ChatMessage'][_0x7f00('0x33')]);_0xefd05c['query']=_['keys'](_0xc313c[_0x7f00('0x3d')]);_0xefd05c['filters']=_[_0x7f00('0x3e')](_0xefd05c[_0x7f00('0x3b')],_0xefd05c[_0x7f00('0x3d')]);_0x467dca[_0x7f00('0x40')]=_[_0x7f00('0x3e')](_0xefd05c[_0x7f00('0x3b')],qs[_0x7f00('0x3f')](_0xc313c[_0x7f00('0x3d')][_0x7f00('0x3f')]));_0x467dca[_0x7f00('0x40')]=_0x467dca[_0x7f00('0x40')][_0x7f00('0x41')]?_0x467dca[_0x7f00('0x40')]:_0xefd05c[_0x7f00('0x3b')];if(!_0xc313c[_0x7f00('0x3d')][_0x7f00('0x99')](_0x7f00('0x9a'))){_0x467dca[_0x7f00('0x21')]=qs[_0x7f00('0x21')](_0xc313c[_0x7f00('0x3d')][_0x7f00('0x21')]);_0x467dca[_0x7f00('0x1f')]=qs['offset'](_0xc313c[_0x7f00('0x3d')][_0x7f00('0x1f')]);}_0x467dca['order']=qs[_0x7f00('0x9b')](_0xc313c[_0x7f00('0x3d')]['sort']);_0x467dca[_0x7f00('0x9c')]=qs[_0x7f00('0x9d')](_[_0x7f00('0x9e')](_0xc313c[_0x7f00('0x3d')],_0xefd05c[_0x7f00('0x9d')]));_0x467dca['where'][_0x7f00('0x9f')]=_0x44053c['id'];if(_0xc313c['query']['filter']){_0x467dca['where']=_[_0x7f00('0x2c')](_0x467dca[_0x7f00('0x9c')],{'$or':_['map'](_0x467dca[_0x7f00('0x40')],function(_0xb6c8b2){var _0x3d74a9={};_0x3d74a9[_0xb6c8b2]={'$like':'%'+_0xc313c[_0x7f00('0x3d')][_0x7f00('0xa0')]+'%'};return _0x3d74a9;})});}if(_0xc313c['query'][_0x7f00('0xa1')]){var _0x3af8dc=_0xc313c[_0x7f00('0x3d')][_0x7f00('0xa1')][_0x7f00('0xa2')](',');var _0x55996e={};_0x55996e[_0x3af8dc[0x0]]={'$gte':moment(_0x3af8dc[0x1])['format'](_0x7f00('0xa3'))};_0x467dca[_0x7f00('0x9c')]=_[_0x7f00('0x2c')](_0x467dca['where'],_0x55996e);}_0x467dca=_[_0x7f00('0x2c')]({},_0x467dca,_0xc313c[_0x7f00('0x42')]);return db[_0x7f00('0x5d')]['count']({'where':_0x467dca[_0x7f00('0x9c')]})[_0x7f00('0x13')](function(_0x140bd5){_0xc461af['count']=_0x140bd5;if(_0xc313c['query'][_0x7f00('0xa4')]){_0x467dca[_0x7f00('0xa5')]=[{'all':!![]}];}return db[_0x7f00('0x5d')][_0x7f00('0xa6')](_0x467dca);})[_0x7f00('0x13')](function(_0x269f98){_0xc461af[_0x7f00('0xa7')]=_0x269f98;return _0xc461af;});}})[_0x7f00('0x13')](respondWithFilteredResult(_0x2abf3c,_0x467dca))[_0x7f00('0x1c')](handleError(_0x2abf3c,null));};exports[_0x7f00('0xa8')]=function(_0x2c6fed,_0x39ca20){var _0x260f0f={'where':{}},_0x5cc9ce={},_0xe9afd7={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x7f00('0x47')]({'where':{'id':_0x2c6fed[_0x7f00('0x3a')]['id']}})[_0x7f00('0x13')](handleEntityNotFound(_0x39ca20,null))['then'](function(_0x27e69d){if(_0x27e69d){_0x5cc9ce[_0x7f00('0x3b')]=_[_0x7f00('0x3c')](db[_0x7f00('0x5d')][_0x7f00('0x33')]);_0x5cc9ce[_0x7f00('0x3d')]=_['keys'](_0x2c6fed[_0x7f00('0x3d')]);_0x5cc9ce[_0x7f00('0x9d')]=_[_0x7f00('0x3e')](_0x5cc9ce[_0x7f00('0x3b')],_0x5cc9ce[_0x7f00('0x3d')]);_0x260f0f[_0x7f00('0x40')]=_[_0x7f00('0x3e')](_0x5cc9ce[_0x7f00('0x3b')],qs['fields'](_0x2c6fed[_0x7f00('0x3d')][_0x7f00('0x3f')]));_0x260f0f[_0x7f00('0x40')]=_0x260f0f[_0x7f00('0x40')][_0x7f00('0x41')]?_0x260f0f['attributes']:_0x5cc9ce[_0x7f00('0x3b')];if(!_0x2c6fed[_0x7f00('0x3d')][_0x7f00('0x99')](_0x7f00('0x9a'))){_0x260f0f[_0x7f00('0x21')]=qs[_0x7f00('0x21')](_0x2c6fed[_0x7f00('0x3d')][_0x7f00('0x21')]);_0x260f0f[_0x7f00('0x1f')]=qs['offset'](_0x2c6fed[_0x7f00('0x3d')]['offset']);}_0x260f0f[_0x7f00('0xa9')]=qs[_0x7f00('0x9b')](_0x2c6fed[_0x7f00('0x3d')]['sort']);_0x260f0f[_0x7f00('0x9c')]=qs[_0x7f00('0x9d')](_[_0x7f00('0x9e')](_0x2c6fed[_0x7f00('0x3d')],_0x5cc9ce[_0x7f00('0x9d')]));_0x260f0f[_0x7f00('0x9c')][_0x7f00('0x9f')]=_0x27e69d['id'];if(_0x2c6fed[_0x7f00('0x3d')][_0x7f00('0xa0')]){_0x260f0f[_0x7f00('0x9c')]=_[_0x7f00('0x2c')](_0x260f0f['where'],{'$or':_[_0x7f00('0x31')](_0x260f0f[_0x7f00('0x40')],function(_0x512a56){var _0x5b5512={};_0x5b5512[_0x512a56]={'$like':'%'+_0x2c6fed['query'][_0x7f00('0xa0')]+'%'};return _0x5b5512;})});}_0x260f0f[_0x7f00('0x9c')][_0x7f00('0xaa')]=![];if(_0x2c6fed[_0x7f00('0x3d')]['id']){_0x260f0f[_0x7f00('0x9c')]['id']={'$gt':_0x2c6fed[_0x7f00('0x3d')]['id']};}_0x260f0f=_['merge']({},_0x260f0f,_0x2c6fed[_0x7f00('0x42')]);return db[_0x7f00('0x5d')][_0x7f00('0x22')]({'where':_0x260f0f[_0x7f00('0x9c')]})[_0x7f00('0x13')](function(_0x20f046){_0xe9afd7[_0x7f00('0x22')]=_0x20f046;_0x260f0f[_0x7f00('0xa5')]=[];if(_0x2c6fed[_0x7f00('0x3d')][_0x7f00('0xab')]){_0x260f0f[_0x7f00('0xa5')][_0x7f00('0xac')]({'model':db[_0x7f00('0x7c')],'as':_0x7f00('0x7c'),'attributes':['id','fullname',_0x7f00('0x86')]});}if(_0x2c6fed[_0x7f00('0x3d')][_0x7f00('0xa4')]){_0x260f0f[_0x7f00('0xa5')]=[{'all':!![]}];}return db[_0x7f00('0x5d')][_0x7f00('0xa6')](_0x260f0f);})[_0x7f00('0x13')](function(_0x3ac55b){_0xe9afd7[_0x7f00('0xa7')]=_0x3ac55b;return _0xe9afd7;});}})[_0x7f00('0x13')](respondWithFilteredResult(_0x39ca20,_0x260f0f))['catch'](handleError(_0x39ca20,null));};exports[_0x7f00('0xad')]=function(_0x3480d5,_0x465b8d){return db['ChatInteraction'][_0x7f00('0x43')]({'where':{'id':_0x3480d5[_0x7f00('0x3a')]['id']}})[_0x7f00('0x13')](handleEntityNotFound(_0x465b8d,null))[_0x7f00('0x13')](function(_0x431f16){if(_0x431f16){return _0x431f16['setTags'](_0x3480d5[_0x7f00('0x2d')][_0x7f00('0x97')],_[_0x7f00('0x98')](_0x3480d5['body'],['ids','id'])||{})[_0x7f00('0xae')](function(){return db[_0x7f00('0xaf')][_0x7f00('0xa6')]({'attributes':['id',_0x7f00('0x29'),'color'],'where':{'id':_0x3480d5[_0x7f00('0x2d')][_0x7f00('0x97')]}});})[_0x7f00('0x13')](function(_0x1ce6a1){socket[_0x7f00('0xb0')](_0x7f00('0xb1'),{'id':Number(_0x3480d5[_0x7f00('0x3a')]['id']),'tags':_0x1ce6a1||[]});return{'id':Number(_0x3480d5[_0x7f00('0x3a')]['id']),'tags':_0x1ce6a1||[]};});}})[_0x7f00('0x13')](respondWithResult(_0x465b8d,null))[_0x7f00('0x1c')](handleError(_0x465b8d,null));};exports[_0x7f00('0xb2')]=function(_0x4797e4,_0x389b6e){return db['ChatInteraction'][_0x7f00('0x43')]({'where':{'id':_0x4797e4[_0x7f00('0x3a')]['id']}})['then'](handleEntityNotFound(_0x389b6e,null))[_0x7f00('0x13')](function(_0x42d1a3){if(_0x42d1a3){return _0x42d1a3[_0x7f00('0xb2')](_0x4797e4['query'][_0x7f00('0x97')]);}})['then'](respondWithStatusCode(_0x389b6e,null))[_0x7f00('0x1c')](handleError(_0x389b6e,null));};exports[_0x7f00('0x75')]=function(_0x113bd8,_0x2f3ef8){var _0x4a53c6=moment()[_0x7f00('0xb3')]()[_0x7f00('0xb4')]();var _0x41c592=path[_0x7f00('0x72')](config['root'],_0x7f00('0xb5'),'files',_0x7f00('0xb6'));var _0x4cd4dd=path[_0x7f00('0x72')](config[_0x7f00('0x77')],'server',_0x7f00('0xb7'),_0x7f00('0xb8'));var _0x5d7d93=path[_0x7f00('0x72')](_0x41c592,_0x4a53c6);var _0x2fac5e=util[_0x7f00('0x79')](_0x7f00('0xb9'),_0x113bd8[_0x7f00('0x3a')]['id'],_0x4a53c6);var _0x267ba3=path['join'](_0x41c592,_0x2fac5e);var _0x420f2f=[];_0x420f2f[_0x7f00('0xac')]({'model':db[_0x7f00('0x7c')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x420f2f[_0x7f00('0xac')]({'model':db[_0x7f00('0x7d')],'as':_0x7f00('0x61'),'attributes':['id',_0x7f00('0xba'),_0x7f00('0xbb')],'raw':!![]});if(_0x113bd8[_0x7f00('0x3d')][_0x7f00('0xb8')]){_0x420f2f[_0x7f00('0xac')]({'model':db[_0x7f00('0x6f')],'as':_0x7f00('0x6f'),'raw':!![]});}var _0x55d8ba=[{'model':db[_0x7f00('0x5d')],'as':_0x7f00('0x7b'),'attributes':['id',_0x7f00('0x2d'),'createdAt',_0x7f00('0x8a'),_0x7f00('0xaa'),_0x7f00('0xbc')],'include':_0x420f2f}];_0x55d8ba[_0x7f00('0xac')]({'model':db[_0x7f00('0x48')],'as':'Account','attributes':['id',_0x7f00('0x29')]});_0x55d8ba[_0x7f00('0xac')]({'model':db[_0x7f00('0x7c')],'as':_0x7f00('0xbd'),'attributes':['id',_0x7f00('0x4d')]});return db[_0x7f00('0x32')][_0x7f00('0x43')]({'where':{'id':_0x113bd8['params']['id']},'include':_0x55d8ba})[_0x7f00('0x13')](handleEntityNotFound(_0x2f3ef8,null))[_0x7f00('0x13')](function(_0x1c3ba6){if(_0x1c3ba6){var _0x32d926=_0x1c3ba6[_0x7f00('0xbe')]({'plain':!![]});fs[_0x7f00('0xbf')](_0x5d7d93);var _0x20ef05={'channel':_0x7f00('0xc0'),'account':_0x32d926[_0x7f00('0xc1')][_0x7f00('0x29')],'agent':_0x32d926[_0x7f00('0xbd')]?_0x32d926['Owner'][_0x7f00('0x4d')]:_0x7f00('0xc2'),'createdAt':moment(_0x32d926[_0x7f00('0x88')])[_0x7f00('0x79')](_0x7f00('0xa3'))[_0x7f00('0xb4')](),'closedAt':_0x32d926['closed']?moment(_0x32d926[_0x7f00('0xc3')])[_0x7f00('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7f00('0xb4')]():'','disposition':_0x32d926[_0x7f00('0x68')],'chatInfo':{'browser':_0x32d926[_0x7f00('0xc4')],'os':_0x32d926[_0x7f00('0xc5')],'referer':_0x32d926[_0x7f00('0xc6')],'customerIp':_0x32d926['customerIp'],'customerPort':_0x32d926[_0x7f00('0xc7')]?_0x32d926[_0x7f00('0xc7')]:'N.A.'},'messages':_(_0x32d926[_0x7f00('0x7b')])[_0x7f00('0xc8')]()[_0x7f00('0xa0')]({'secret':![]})['map'](function(_0x340500){if(_0x340500[_0x7f00('0x6f')]){var _0x194cc9=path[_0x7f00('0x72')](_0x4cd4dd,_0x340500[_0x7f00('0x6f')][_0x7f00('0x74')]);if(fs['existsSync'](_0x194cc9)){fs[_0x7f00('0xc9')](_0x194cc9)[_0x7f00('0xca')](fs[_0x7f00('0xcb')](path[_0x7f00('0x72')](_0x5d7d93,_0x340500['Attachment'][_0x7f00('0x74')])));}}return{'date':moment(_0x340500[_0x7f00('0x88')])[_0x7f00('0x79')](_0x7f00('0xa3'))[_0x7f00('0xb4')](),'sender':_0x340500[_0x7f00('0x8a')]===_0x7f00('0x5c')?_0x340500[_0x7f00('0x7c')]?_0x340500[_0x7f00('0x7c')][_0x7f00('0x4d')]:_0x7f00('0x84'):_0x340500['Contact']['firstName']+(_0x340500['Contact'][_0x7f00('0xbb')]?'\x20'+_0x340500[_0x7f00('0x61')][_0x7f00('0xbb')]:''),'body':_0x340500[_0x7f00('0x6f')]?_0x340500[_0x7f00('0x6f')][_0x7f00('0x74')]:_0x340500[_0x7f00('0x2d')],'direction':_0x340500[_0x7f00('0x8a')]===_0x7f00('0x5c')?'A':'C','secret':_0x340500['secret'],'read':_0x340500['read'],'attachment':_0x340500[_0x7f00('0x6f')]};})[_0x7f00('0xcc')]()};return ejs[_0x7f00('0xcd')](path[_0x7f00('0x72')](config[_0x7f00('0x77')],_0x7f00('0xb5'),'views','downloadInteraction.ejs'),{'interaction':_0x20ef05})[_0x7f00('0x13')](function(_0x2d6752){var _0x53185a=path[_0x7f00('0x72')](_0x5d7d93,_0x7f00('0xce')+_0x32d926['id']+'-'+_0x4a53c6+'.pdf');var _0x57ab39={'path':_0x53185a,'channel':'Chat','interactionId':_0x32d926['id']};return pdf['createPdfFromHTML'](_0x2d6752,_0x57ab39);})[_0x7f00('0x13')](function(){return new Promise(function(_0x196e11,_0x31f998){zipdir(_0x5d7d93,{'saveTo':_0x267ba3},function(_0x2081ad,_0x298a19){if(_0x2081ad)return _0x31f998(_0x2081ad);return _0x196e11(_0x298a19);});})[_0x7f00('0x13')](function(){return new BPromise(function(_0x3e49e6,_0x345120){rimraf(_0x5d7d93,function(_0x2ad039){if(_0x2ad039)_0x345120(_0x2ad039);return _0x3e49e6();});});})[_0x7f00('0x13')](function(){return _0x2f3ef8[_0x7f00('0x75')](_0x267ba3,_0x2fac5e,function(_0x359938){if(_0x359938){logger['error'](_0x7f00('0xcf'),_0x359938);}else{fs[_0x7f00('0xd0')](_0x267ba3);}});});});}else{return _0x2f3ef8['sendStatus'](0xc8);}})[_0x7f00('0x1c')](handleError(_0x2f3ef8,null));};
\ No newline at end of file
+var _0x2b5f=['ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','find','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','originalname','basename','file','filename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','now','Messages','User','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','Smtp','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','hasOwnProperty','nolimit','order','sort','pick','filters','ChatInteractionId','filter','where','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','count','includeAgent','addTags','setTags','omit','spread','Tag','color','emit','removeTags','unix','server','tmp','files','firstName','attachments','direction','read','push','Account','mkdirSync','Owner','N.A.','toString','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','lastName','value','views','transcript-','.pdf','Chat','createPdfFromHTML','err','rimraf','request-promise','moment','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','defaults','socket.io-emitter','./chatInteraction.socket','register','client','http','then','info','debug','request\x20sent','error','ChatInteraction,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','undefined','limit','set','Content-Range','update','destroy','name','send','render','merge','body','contact','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','catch','show','params','model','keys','query','intersection','attributes','fields','length','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','user','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','vidaooMetadata','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2b5f,0x78));var _0xf2b5=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2b5f[_0x21a9d9];return _0x46adce;};'use strict';var rimraf=require(_0xf2b5('0x0'));var zipdir=require('zip-dir');var rp=require(_0xf2b5('0x1'));var moment=require(_0xf2b5('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf2b5('0x3'));var path=require(_0xf2b5('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf2b5('0x5'));var Redis=require('ioredis');var interaction=require(_0xf2b5('0x6'));var qs=require(_0xf2b5('0x7'));var pdf=require(_0xf2b5('0x8'));var logger=require('../../config/logger')(_0xf2b5('0x9'));var config=require(_0xf2b5('0xa'));var db=require(_0xf2b5('0xb'))['db'];config['redis']=_[_0xf2b5('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf2b5('0xd'))(new Redis(config['redis']));require(_0xf2b5('0xe'))[_0xf2b5('0xf')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf2b5('0x10')][_0xf2b5('0x11')]({'port':0x232b});var client9004=jayson[_0xf2b5('0x10')][_0xf2b5('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x5b4ada,_0xef6cdc,_0x1e0146,_0x2f9945){return new BPromise(function(_0xc34d17,_0x2b6c8d){var _0xc40b38=_0x2f9945||client;return _0xc40b38['request'](_0x5b4ada,_0x1e0146)[_0xf2b5('0x12')](function(_0x477809){logger[_0xf2b5('0x13')]('ChatInteraction,\x20%s,\x20%s',_0xef6cdc,'request\x20sent');logger[_0xf2b5('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xef6cdc,_0xf2b5('0x15'),JSON['stringify'](_0x477809));if(_0x477809[_0xf2b5('0x16')]){if(_0x477809['error']['code']===0x1f4){logger[_0xf2b5('0x16')](_0xf2b5('0x17'),_0xef6cdc,_0x477809[_0xf2b5('0x16')][_0xf2b5('0x18')]);return _0x2b6c8d(_0x477809[_0xf2b5('0x16')][_0xf2b5('0x18')]);}logger[_0xf2b5('0x16')](_0xf2b5('0x17'),_0xef6cdc,_0x477809['error']['message']);return _0xc34d17(_0x477809[_0xf2b5('0x16')][_0xf2b5('0x18')]);}else{logger['info'](_0xf2b5('0x17'),_0xef6cdc,'request\x20sent');_0xc34d17(_0x477809[_0xf2b5('0x19')][_0xf2b5('0x18')]);}})['catch'](function(_0x4e896f){logger[_0xf2b5('0x16')](_0xf2b5('0x17'),_0xef6cdc,_0x4e896f);_0x2b6c8d(_0x4e896f);});});}function respondWithStatusCode(_0x2900d8,_0x3a1b76){_0x3a1b76=_0x3a1b76||0xcc;return function(_0x4903ff){if(_0x4903ff){return _0x2900d8[_0xf2b5('0x1a')](_0x3a1b76);}return _0x2900d8[_0xf2b5('0x1b')](_0x3a1b76)['end']();};}function respondWithResult(_0x3e239b,_0x2973c3){_0x2973c3=_0x2973c3||0xc8;return function(_0x2751d4){if(_0x2751d4){return _0x3e239b['status'](_0x2973c3)[_0xf2b5('0x1c')](_0x2751d4);}};}function respondWithFilteredResult(_0x5c8c4f,_0x18dffd){return function(_0x4d6a73){if(_0x4d6a73){var _0x22d3be=typeof _0x18dffd[_0xf2b5('0x1d')]===_0xf2b5('0x1e')&&typeof _0x18dffd[_0xf2b5('0x1f')]==='undefined';var _0x399828=_0x4d6a73['count'];var _0x495710=_0x22d3be?0x0:_0x18dffd[_0xf2b5('0x1d')];var _0x53883f=_0x22d3be?_0x4d6a73['count']:_0x18dffd[_0xf2b5('0x1d')]+_0x18dffd[_0xf2b5('0x1f')];var _0x4dc4e4;if(_0x53883f>=_0x399828){_0x53883f=_0x399828;_0x4dc4e4=0xc8;}else{_0x4dc4e4=0xce;}_0x5c8c4f['status'](_0x4dc4e4);return _0x5c8c4f[_0xf2b5('0x20')](_0xf2b5('0x21'),_0x495710+'-'+_0x53883f+'/'+_0x399828)['json'](_0x4d6a73);}return null;};}function saveUpdates(_0x38c78c){return function(_0x2149b5){if(_0x2149b5){return _0x2149b5[_0xf2b5('0x22')](_0x38c78c)[_0xf2b5('0x12')](function(_0x47275d){return _0x47275d;});}return null;};}function removeEntity(_0x4b289e){return function(_0x192d22){if(_0x192d22){return _0x192d22[_0xf2b5('0x23')]()[_0xf2b5('0x12')](function(){_0x4b289e[_0xf2b5('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2399e8){return function(_0x2cb60d){if(!_0x2cb60d){_0x2399e8['sendStatus'](0x194);}return _0x2cb60d;};}function handleError(_0xd67776,_0x5f57e2){_0x5f57e2=_0x5f57e2||0x1f4;return function(_0x140900){logger[_0xf2b5('0x16')](_0x140900['stack']);if(_0x140900[_0xf2b5('0x24')]){delete _0x140900[_0xf2b5('0x24')];}_0xd67776[_0xf2b5('0x1b')](_0x5f57e2)[_0xf2b5('0x25')](_0x140900);};}function getMustacheRender(_0x18687d,_0x18fc6a){return Mustache[_0xf2b5('0x26')](_0x18687d,_[_0xf2b5('0x27')](_0x18fc6a[_0xf2b5('0x28')],{'contact':_0x18fc6a[_0xf2b5('0x29')],'message':_0x18fc6a[_0xf2b5('0x18')],'agent':_0x18fc6a['agent'],'interaction':_0x18fc6a[_0xf2b5('0x2a')],'account':_0x18fc6a[_0xf2b5('0x2b')]}))||'';}exports[_0xf2b5('0x2c')]=function(_0x509a77,_0x19848){var _0x47d982={};var _0x26cd4e=_[_0xf2b5('0x2d')](db[_0xf2b5('0x2e')][_0xf2b5('0x2f')],function(_0x572342){return{'name':_0x572342[_0xf2b5('0x30')],'type':_0x572342[_0xf2b5('0x31')][_0xf2b5('0x32')]};});_0x47d982=qs[_0xf2b5('0x33')](_0x26cd4e,_0x509a77);return interaction[_0xf2b5('0x34')](_0xf2b5('0x35'),_0x509a77['query'],_0x509a77['user'],_0x47d982,_0x26cd4e)[_0xf2b5('0x12')](respondWithFilteredResult(_0x19848,_0x47d982))[_0xf2b5('0x36')](handleError(_0x19848,null));};exports[_0xf2b5('0x37')]=function(_0x5d674,_0x150e2b){var _0x57ff6f={'raw':![],'where':{'id':_0x5d674[_0xf2b5('0x38')]['id']}},_0x48d329={};_0x48d329[_0xf2b5('0x39')]=_[_0xf2b5('0x3a')](db[_0xf2b5('0x2e')][_0xf2b5('0x2f')]);_0x48d329[_0xf2b5('0x3b')]=_[_0xf2b5('0x3a')](_0x5d674[_0xf2b5('0x3b')]);_0x48d329['filters']=_[_0xf2b5('0x3c')](_0x48d329[_0xf2b5('0x39')],_0x48d329[_0xf2b5('0x3b')]);_0x57ff6f[_0xf2b5('0x3d')]=_[_0xf2b5('0x3c')](_0x48d329[_0xf2b5('0x39')],qs[_0xf2b5('0x3e')](_0x5d674[_0xf2b5('0x3b')][_0xf2b5('0x3e')]));_0x57ff6f[_0xf2b5('0x3d')]=_0x57ff6f[_0xf2b5('0x3d')][_0xf2b5('0x3f')]?_0x57ff6f[_0xf2b5('0x3d')]:_0x48d329[_0xf2b5('0x39')];if(_0x5d674[_0xf2b5('0x3b')][_0xf2b5('0x40')]){_0x57ff6f[_0xf2b5('0x41')]=[{'all':!![]}];}_0x57ff6f=_['merge']({},_0x57ff6f,_0x5d674[_0xf2b5('0x42')]);return db[_0xf2b5('0x2e')]['find'](_0x57ff6f)[_0xf2b5('0x12')](handleEntityNotFound(_0x150e2b,null))['then'](respondWithResult(_0x150e2b,null))[_0xf2b5('0x36')](handleError(_0x150e2b,null));};exports[_0xf2b5('0x43')]=function(_0x49631a,_0x28c2ed){return db[_0xf2b5('0x2e')][_0xf2b5('0x43')](_0x49631a[_0xf2b5('0x28')],{})[_0xf2b5('0x12')](respondWithResult(_0x28c2ed,0xc9))['catch'](handleError(_0x28c2ed,null));};exports[_0xf2b5('0x22')]=function(_0x5dcfe1,_0xf73075){if(_0x5dcfe1['body']['id']){delete _0x5dcfe1[_0xf2b5('0x28')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5dcfe1[_0xf2b5('0x38')]['id']}})['then'](handleEntityNotFound(_0xf73075,null))[_0xf2b5('0x12')](saveUpdates(_0x5dcfe1['body'],null))[_0xf2b5('0x12')](respondWithResult(_0xf73075,null))['catch'](handleError(_0xf73075,null));};exports[_0xf2b5('0x23')]=function(_0x54199f,_0x1d884b){return db[_0xf2b5('0x2e')]['find']({'where':{'id':_0x54199f[_0xf2b5('0x38')]['id']}})['then'](handleEntityNotFound(_0x1d884b,null))[_0xf2b5('0x12')](removeEntity(_0x1d884b,null))['catch'](handleError(_0x1d884b,null));};exports['describe']=function(_0x4ad89b,_0x4735f7){return db[_0xf2b5('0x2e')][_0xf2b5('0x44')]()[_0xf2b5('0x12')](respondWithResult(_0x4735f7,null))[_0xf2b5('0x36')](handleError(_0x4735f7,null));};exports[_0xf2b5('0x45')]=function(_0x1c4728,_0x441e7d){var _0x52b960=_0x1c4728[_0xf2b5('0x38')]['id'];var _0x2ad80f;var _0x543244;var _0x34fafe;return db['ChatInteraction'][_0xf2b5('0x46')]({'where':{'id':_0x52b960}})[_0xf2b5('0x12')](function(_0x2820e2){_0x2ad80f=_0x2820e2;return db[_0xf2b5('0x47')]['findOne']({'where':{'id':_0x2820e2[_0xf2b5('0x48')]},'attributes':['id',_0xf2b5('0x49'),_0xf2b5('0x4a'),'vidaooTopic',_0xf2b5('0x4b'),'vidaooMetadata'],'raw':!![]});})[_0xf2b5('0x12')](function(_0x381220){if(_0x381220&&_0x381220[_0xf2b5('0x49')]&&_0x381220['vidaooEscalation']){_0x543244=_0x381220;var _0x5012d7={'interaction':{'id':_0x52b960},'agent':{'id':_0x1c4728[_0xf2b5('0x4c')]['id'],'name':_0x1c4728[_0xf2b5('0x4c')][_0xf2b5('0x24')],'fullname':_0x1c4728[_0xf2b5('0x4c')]['fullname'],'email':_0x1c4728['user']['email']},'contact':_0x1c4728[_0xf2b5('0x28')]['contact'],'account':_0x1c4728[_0xf2b5('0x28')][_0xf2b5('0x2b')]};var _0x437ff2={'rejectUnauthorized':![],'method':_0xf2b5('0x4d'),'url':_0xf2b5('0x4e'),'headers':{'X-APIKEY':_0x381220[_0xf2b5('0x49')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1c4728['user']['email']],'buttons':null,'topic':_0x543244[_0xf2b5('0x4f')],'note':_['isNull'](_0x543244[_0xf2b5('0x4b')])?null:getMustacheRender(_0x543244[_0xf2b5('0x4b')],_0x5012d7),'metadata':null},'redirect':_0xf2b5('0x50'),'json':!![]};try{if(!_[_0xf2b5('0x51')](_0x543244[_0xf2b5('0x52')])){var _0x2d9d23=getMustacheRender(_0x543244[_0xf2b5('0x52')],_0x5012d7);var _0x337ba0=JSON[_0xf2b5('0x53')](_0x2d9d23);_0x437ff2[_0xf2b5('0x28')]['metadata']=_0x337ba0;}}catch(_0xae8ae0){throw new db[(_0xf2b5('0x54'))][(_0xf2b5('0x55'))](_0xf2b5('0x56'));}return rp(_0x437ff2);}else{throw new db[(_0xf2b5('0x54'))][(_0xf2b5('0x55'))](_0xf2b5('0x57'));}})['then'](function(_0x2dc231){_0x34fafe=_0x2dc231;if(_0x34fafe['id']){var _0x27a390={'body':_0x34fafe['join_url'],'ChatWebsiteId':_0x543244['id'],'ChatInteractionId':_0x2ad80f['id'],'direction':'out','UserId':_0x1c4728[_0xf2b5('0x4c')]['id']};return db[_0xf2b5('0x58')][_0xf2b5('0x43')](_0x27a390,{});}else{throw new db['Sequelize'][(_0xf2b5('0x55'))](_0xf2b5('0x59'));}})[_0xf2b5('0x12')](function(){return _0x2ad80f[_0xf2b5('0x5a')]({'vidaooSessionId':_0x34fafe['id']});})[_0xf2b5('0x12')](respondWithResult(_0x441e7d,null))[_0xf2b5('0x36')](handleError(_0x441e7d,null));};exports[_0xf2b5('0x5b')]=function(_0x34c327,_0x3a6b36){if(_0x34c327[_0xf2b5('0x28')]['id']){delete _0x34c327[_0xf2b5('0x28')]['id'];}return db[_0xf2b5('0x2e')][_0xf2b5('0x5c')]({'where':{'id':_0x34c327[_0xf2b5('0x38')]['id']},'include':[{'model':db[_0xf2b5('0x5d')],'as':_0xf2b5('0x5e')}]})[_0xf2b5('0x12')](handleEntityNotFound(_0x3a6b36,null))['then'](saveUpdates(_0x34c327[_0xf2b5('0x28')],null))[_0xf2b5('0x12')](respondWithResult(_0x3a6b36,null))[_0xf2b5('0x36')](handleError(_0x3a6b36,null));};exports[_0xf2b5('0x5f')]=function(_0x9af9ea,_0x565e73){if(_0x9af9ea[_0xf2b5('0x28')]['id']){delete _0x9af9ea[_0xf2b5('0x28')]['id'];}return db[_0xf2b5('0x2e')][_0xf2b5('0x5c')]({'where':{'id':_0x9af9ea[_0xf2b5('0x38')]['id']}})['then'](function(_0x218051){if(!_0x218051){logger[_0xf2b5('0x16')](_0xf2b5('0x60'),_0xf2b5('0x5f'),0x194,_0xf2b5('0x61'));_0x565e73['sendStatus'](0x194);}else{if(_0x218051[_0xf2b5('0x62')]){throw new db[(_0xf2b5('0x54'))][(_0xf2b5('0x55'))](_0xf2b5('0x63'));}}return _0x218051;})[_0xf2b5('0x12')](function(_0x2999ec){if(_0x2999ec){return _0x2999ec[_0xf2b5('0x22')]({'closed':_0x9af9ea[_0xf2b5('0x28')][_0xf2b5('0x64')],'disposition':_0x9af9ea[_0xf2b5('0x28')]['disposition']})[_0xf2b5('0x12')](function(_0x56be02){return _0x56be02;});}})[_0xf2b5('0x12')](function(){return respondWithRpcPromise('AbandonInteraction',_0xf2b5('0x5f'),_0x9af9ea[_0xf2b5('0x28')],client9004);})['then'](respondWithResult(_0x565e73,null))[_0xf2b5('0x36')](handleError(_0x565e73,null));};exports['attachmentUpload']=function(_0x3d296b,_0x263a44){_0x3d296b[_0xf2b5('0x28')][_0xf2b5('0x24')]=_0x3d296b['file'][_0xf2b5('0x65')];_0x3d296b['body'][_0xf2b5('0x66')]=_0x3d296b[_0xf2b5('0x67')][_0xf2b5('0x68')];_0x3d296b[_0xf2b5('0x28')]['type']=_0x3d296b[_0xf2b5('0x67')][_0xf2b5('0x69')];return db[_0xf2b5('0x6a')][_0xf2b5('0x43')](_0x3d296b[_0xf2b5('0x28')])[_0xf2b5('0x12')](respondWithResult(_0x263a44,0xc9))[_0xf2b5('0x36')](handleError(_0x263a44,null));};exports['attachmentDownload']=function(_0x4b61db,_0x3d1662){return db['ChatInteraction'][_0xf2b5('0x46')]({'where':{'id':_0x4b61db['params']['id']},'raw':!![]})[_0xf2b5('0x12')](handleEntityNotFound(_0x3d1662,null))[_0xf2b5('0x12')](function(_0xa6ae15){if(_0xa6ae15){if(_0xa6ae15[_0xf2b5('0x64')]){return _0x3d1662[_0xf2b5('0x1b')](0x193)[_0xf2b5('0x1c')]({'status':0x193,'message':_0xf2b5('0x6b')});}return db[_0xf2b5('0x6a')][_0xf2b5('0x46')]({'where':{'id':_0x4b61db[_0xf2b5('0x3b')][_0xf2b5('0x6c')]},'raw':!![]})['then'](handleEntityNotFound(_0x3d1662,null));}})[_0xf2b5('0x12')](function(_0x2c9ddc){if(_0x2c9ddc){var _0x42acd7=_0x2c9ddc[_0xf2b5('0x6d')]!==null;var _0x4aae16=path[_0xf2b5('0x6e')](config[_0xf2b5('0x6f')],_0xf2b5('0x70'));if(_0x42acd7){_0x4aae16=path['join'](_0x4aae16,_0xf2b5('0x71'));}var _0x5517c5=path[_0xf2b5('0x6e')](_0x4aae16,_0x2c9ddc[_0xf2b5('0x66')]);return _0x3d1662[_0xf2b5('0x72')](_0x5517c5);}})[_0xf2b5('0x36')](handleError(_0x3d1662,null));};exports[_0xf2b5('0x73')]=function(_0x1d3754,_0x1485d9){var _0x498744=null;var _0xa07a23=null;var _0x9aa106=null;if(_0x1d3754[_0xf2b5('0x28')]['id']){delete _0x1d3754['body']['id'];}if(_0x1d3754[_0xf2b5('0x28')][_0xf2b5('0x74')]){_0x9aa106=path['join'](config[_0xf2b5('0x6f')],_0xf2b5('0x75'),util[_0xf2b5('0x76')]('transcript-%s.txt',Date[_0xf2b5('0x77')]()));_0x1d3754[_0xf2b5('0x28')]['pathTranscript']=_0x9aa106;}return db[_0xf2b5('0x2e')]['find']({'where':{'id':_0x1d3754[_0xf2b5('0x38')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xf2b5('0x78'),'include':[{'model':db[_0xf2b5('0x79')],'as':_0xf2b5('0x79')}]}]})[_0xf2b5('0x12')](handleEntityNotFound(_0x1485d9,null))[_0xf2b5('0x12')](saveUpdates(_0x1d3754[_0xf2b5('0x28')],null))[_0xf2b5('0x12')](function(_0x2d4027){if(_0x2d4027){_0x498744=_0x2d4027;return db['ChatWebsite'][_0xf2b5('0x5c')]({'where':{'id':_0x498744[_0xf2b5('0x48')]}});}})[_0xf2b5('0x12')](function(_0x11d380){if(_0x11d380){_0xa07a23=_0x11d380;return db[_0xf2b5('0x5d')]['find']({'where':{'id':_0x498744[_0xf2b5('0x7a')]}});}})[_0xf2b5('0x12')](function(_0xf4765e){if(_0xf4765e){if(_0x9aa106){var _0x5b6269=null;for(var _0x33dfe6=0x1;_0x33dfe6<_0x498744['Messages']['length'];++_0x33dfe6){_0x5b6269=_0x498744[_0xf2b5('0x78')][_0x33dfe6];var _0x1271bc=_0x5b6269[_0xf2b5('0x62')]?util[_0xf2b5('0x76')](_0xf2b5('0x7b'),_0xa07a23[_0xf2b5('0x7c')],_0x5b6269[_0xf2b5('0x62')]):_0xf2b5('0x7d');var _0x3a4c5e=_0x1d3754[_0xf2b5('0x28')][_0xf2b5('0x7e')]||util['format'](_0xf2b5('0x7b'),_0xf2b5('0x7f'),_0x5b6269[_0xf2b5('0x7a')]);switch(_0xa07a23[_0xf2b5('0x80')]){case _0xf2b5('0x81'):_0x1271bc=_0x5b6269['UserId']?util['format'](_0xf2b5('0x7b'),_0xa07a23[_0xf2b5('0x7c')],_0x5b6269['UserId']):_0xf2b5('0x7d');break;case'agent_alias':_0x1271bc=_0x5b6269['UserId']?_0x5b6269[_0xf2b5('0x79')][_0xf2b5('0x82')]||_0x5b6269['User'][_0xf2b5('0x83')]:_0xf2b5('0x7d');break;case _0xf2b5('0x84'):_0x1271bc=_0x5b6269[_0xf2b5('0x62')]?_0x5b6269[_0xf2b5('0x79')][_0xf2b5('0x83')]:_0xf2b5('0x7d');break;default:_0x1271bc=_0x5b6269[_0xf2b5('0x62')]?util['format'](_0xf2b5('0x7b'),_0xa07a23[_0xf2b5('0x7c')],_0x5b6269[_0xf2b5('0x62')]):_0xf2b5('0x7d');}var _0x38b2a4=util[_0xf2b5('0x76')](_0xf2b5('0x85'),moment(_0x5b6269[_0xf2b5('0x86')])[_0xf2b5('0x76')](_0xf2b5('0x87')),_0x5b6269['direction']==='in'?_0x3a4c5e:_0x1271bc,_0x5b6269[_0xf2b5('0x28')]);if(!_0x5b6269[_0xf2b5('0x88')]){fs[_0xf2b5('0x89')](_0x9aa106,_0x38b2a4);}}return db['MailAccount'][_0xf2b5('0x46')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf2b5('0x8a'),'raw':!![],'include':[{'model':db[_0xf2b5('0x8b')],'as':_0xf2b5('0x8b'),'raw':!![]}]}]});}}})[_0xf2b5('0x12')](function(_0x203d4b){if(!_0x203d4b||!_0x203d4b[_0xf2b5('0x8a')]||!_0x1d3754['body'])return _0x498744;var _0x449dc0=_0x203d4b[_0xf2b5('0x8c')]();return respondWithRpcPromise(_0xf2b5('0x8d'),'sendMail',{'account':_0x449dc0,'message':{'from':util[_0xf2b5('0x76')](_0xf2b5('0x8e'),_0x203d4b['name'],_0x203d4b[_0xf2b5('0x8f')]||_0x203d4b[_0xf2b5('0x8a')][_0xf2b5('0x4c')]),'to':_0x1d3754[_0xf2b5('0x28')]['mailTranscript'],'subject':_0xf2b5('0x90'),'text':util['format'](_0xf2b5('0x91'),_0x1d3754[_0xf2b5('0x28')][_0xf2b5('0x74')]),'attachments':[{'path':_0x9aa106}]}})['then'](function(){return _0x498744;})[_0xf2b5('0x36')](function(_0x194a6c){logger['error'](_0x194a6c);});})[_0xf2b5('0x12')](respondWithStatusCode(_0x1485d9,0xc8))['catch'](handleError(_0x1485d9,null));};exports[_0xf2b5('0x92')]=function(_0x54b58e,_0x174daf){return db[_0xf2b5('0x58')][_0xf2b5('0x5c')]({'where':{'id':_0x54b58e[_0xf2b5('0x38')]['id']}})[_0xf2b5('0x12')](handleEntityNotFound(_0x174daf,null))[_0xf2b5('0x12')](function(_0x3efc25){if(_0x3efc25){return _0x3efc25[_0xf2b5('0x92')](_0x54b58e[_0xf2b5('0x28')][_0xf2b5('0x93')],_['omit'](_0x54b58e[_0xf2b5('0x28')],[_0xf2b5('0x93'),'id'])||{});}})['then'](respondWithResult(_0x174daf,null))[_0xf2b5('0x36')](handleError(_0x174daf,null));};exports[_0xf2b5('0x94')]=function(_0x57366a,_0x2cab17){var _0x4760a6={'raw':![],'where':{}};var _0x49178b={};var _0x5aac14={'count':0x0,'rows':[]};return db[_0xf2b5('0x2e')][_0xf2b5('0x46')]({'where':{'id':_0x57366a[_0xf2b5('0x38')]['id']}})[_0xf2b5('0x12')](handleEntityNotFound(_0x2cab17,null))[_0xf2b5('0x12')](function(_0x2f266f){if(_0x2f266f){_0x49178b[_0xf2b5('0x39')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x49178b[_0xf2b5('0x3b')]=_[_0xf2b5('0x3a')](_0x57366a[_0xf2b5('0x3b')]);_0x49178b['filters']=_[_0xf2b5('0x3c')](_0x49178b['model'],_0x49178b[_0xf2b5('0x3b')]);_0x4760a6['attributes']=_['intersection'](_0x49178b['model'],qs[_0xf2b5('0x3e')](_0x57366a[_0xf2b5('0x3b')][_0xf2b5('0x3e')]));_0x4760a6[_0xf2b5('0x3d')]=_0x4760a6['attributes'][_0xf2b5('0x3f')]?_0x4760a6[_0xf2b5('0x3d')]:_0x49178b[_0xf2b5('0x39')];if(!_0x57366a[_0xf2b5('0x3b')][_0xf2b5('0x95')](_0xf2b5('0x96'))){_0x4760a6[_0xf2b5('0x1f')]=qs['limit'](_0x57366a[_0xf2b5('0x3b')][_0xf2b5('0x1f')]);_0x4760a6[_0xf2b5('0x1d')]=qs[_0xf2b5('0x1d')](_0x57366a[_0xf2b5('0x3b')]['offset']);}_0x4760a6[_0xf2b5('0x97')]=qs['sort'](_0x57366a[_0xf2b5('0x3b')][_0xf2b5('0x98')]);_0x4760a6['where']=qs['filters'](_[_0xf2b5('0x99')](_0x57366a[_0xf2b5('0x3b')],_0x49178b[_0xf2b5('0x9a')]));_0x4760a6['where'][_0xf2b5('0x9b')]=_0x2f266f['id'];if(_0x57366a[_0xf2b5('0x3b')][_0xf2b5('0x9c')]){_0x4760a6[_0xf2b5('0x9d')]=_['merge'](_0x4760a6[_0xf2b5('0x9d')],{'$or':_[_0xf2b5('0x2d')](_0x4760a6[_0xf2b5('0x3d')],function(_0x4056ce){var _0x2b4d62={};_0x2b4d62[_0x4056ce]={'$like':'%'+_0x57366a['query']['filter']+'%'};return _0x2b4d62;})});}if(_0x57366a[_0xf2b5('0x3b')][_0xf2b5('0x9e')]){var _0x2b3a3d=_0x57366a[_0xf2b5('0x3b')][_0xf2b5('0x9e')][_0xf2b5('0x9f')](',');var _0x2982e2={};_0x2982e2[_0x2b3a3d[0x0]]={'$gte':moment(_0x2b3a3d[0x1])['format'](_0xf2b5('0xa0'))};_0x4760a6[_0xf2b5('0x9d')]=_[_0xf2b5('0x27')](_0x4760a6[_0xf2b5('0x9d')],_0x2982e2);}_0x4760a6=_['merge']({},_0x4760a6,_0x57366a['options']);return db['ChatMessage']['count']({'where':_0x4760a6['where']})[_0xf2b5('0x12')](function(_0x4edf05){_0x5aac14['count']=_0x4edf05;if(_0x57366a[_0xf2b5('0x3b')]['includeAll']){_0x4760a6[_0xf2b5('0x41')]=[{'all':!![]}];}return db[_0xf2b5('0x58')][_0xf2b5('0x34')](_0x4760a6);})['then'](function(_0x379299){_0x5aac14[_0xf2b5('0xa1')]=_0x379299;return _0x5aac14;});}})[_0xf2b5('0x12')](respondWithFilteredResult(_0x2cab17,_0x4760a6))['catch'](handleError(_0x2cab17,null));};exports[_0xf2b5('0xa2')]=function(_0x1b1216,_0x2fbcb0){var _0x1aeb44={'where':{}},_0xdf7ded={},_0x57742a={'count':0x0,'rows':[]};return db[_0xf2b5('0x2e')][_0xf2b5('0x46')]({'where':{'id':_0x1b1216[_0xf2b5('0x38')]['id']}})[_0xf2b5('0x12')](handleEntityNotFound(_0x2fbcb0,null))['then'](function(_0x163d82){if(_0x163d82){_0xdf7ded[_0xf2b5('0x39')]=_['keys'](db[_0xf2b5('0x58')][_0xf2b5('0x2f')]);_0xdf7ded['query']=_['keys'](_0x1b1216[_0xf2b5('0x3b')]);_0xdf7ded[_0xf2b5('0x9a')]=_[_0xf2b5('0x3c')](_0xdf7ded[_0xf2b5('0x39')],_0xdf7ded[_0xf2b5('0x3b')]);_0x1aeb44[_0xf2b5('0x3d')]=_[_0xf2b5('0x3c')](_0xdf7ded[_0xf2b5('0x39')],qs['fields'](_0x1b1216['query'][_0xf2b5('0x3e')]));_0x1aeb44[_0xf2b5('0x3d')]=_0x1aeb44[_0xf2b5('0x3d')][_0xf2b5('0x3f')]?_0x1aeb44['attributes']:_0xdf7ded[_0xf2b5('0x39')];if(!_0x1b1216[_0xf2b5('0x3b')][_0xf2b5('0x95')](_0xf2b5('0x96'))){_0x1aeb44['limit']=qs[_0xf2b5('0x1f')](_0x1b1216[_0xf2b5('0x3b')]['limit']);_0x1aeb44[_0xf2b5('0x1d')]=qs[_0xf2b5('0x1d')](_0x1b1216[_0xf2b5('0x3b')][_0xf2b5('0x1d')]);}_0x1aeb44[_0xf2b5('0x97')]=qs[_0xf2b5('0x98')](_0x1b1216['query']['sort']);_0x1aeb44[_0xf2b5('0x9d')]=qs[_0xf2b5('0x9a')](_[_0xf2b5('0x99')](_0x1b1216[_0xf2b5('0x3b')],_0xdf7ded['filters']));_0x1aeb44['where'][_0xf2b5('0x9b')]=_0x163d82['id'];if(_0x1b1216[_0xf2b5('0x3b')][_0xf2b5('0x9c')]){_0x1aeb44[_0xf2b5('0x9d')]=_[_0xf2b5('0x27')](_0x1aeb44[_0xf2b5('0x9d')],{'$or':_[_0xf2b5('0x2d')](_0x1aeb44[_0xf2b5('0x3d')],function(_0x3b932b){var _0x1d570f={};_0x1d570f[_0x3b932b]={'$like':'%'+_0x1b1216['query'][_0xf2b5('0x9c')]+'%'};return _0x1d570f;})});}_0x1aeb44[_0xf2b5('0x9d')][_0xf2b5('0x88')]=![];if(_0x1b1216[_0xf2b5('0x3b')]['id']){_0x1aeb44[_0xf2b5('0x9d')]['id']={'$gt':_0x1b1216[_0xf2b5('0x3b')]['id']};}_0x1aeb44=_[_0xf2b5('0x27')]({},_0x1aeb44,_0x1b1216[_0xf2b5('0x42')]);return db[_0xf2b5('0x58')][_0xf2b5('0xa3')]({'where':_0x1aeb44[_0xf2b5('0x9d')]})['then'](function(_0x1dee9d){_0x57742a[_0xf2b5('0xa3')]=_0x1dee9d;_0x1aeb44[_0xf2b5('0x41')]=[];if(_0x1b1216[_0xf2b5('0x3b')][_0xf2b5('0xa4')]){_0x1aeb44[_0xf2b5('0x41')]['push']({'model':db[_0xf2b5('0x79')],'as':_0xf2b5('0x79'),'attributes':['id',_0xf2b5('0x83'),'alias']});}if(_0x1b1216[_0xf2b5('0x3b')]['includeAll']){_0x1aeb44[_0xf2b5('0x41')]=[{'all':!![]}];}return db[_0xf2b5('0x58')]['findAll'](_0x1aeb44);})[_0xf2b5('0x12')](function(_0x5a1408){_0x57742a[_0xf2b5('0xa1')]=_0x5a1408;return _0x57742a;});}})[_0xf2b5('0x12')](respondWithFilteredResult(_0x2fbcb0,_0x1aeb44))[_0xf2b5('0x36')](handleError(_0x2fbcb0,null));};exports[_0xf2b5('0xa5')]=function(_0x238293,_0x32cacb){return db[_0xf2b5('0x2e')][_0xf2b5('0x5c')]({'where':{'id':_0x238293[_0xf2b5('0x38')]['id']}})[_0xf2b5('0x12')](handleEntityNotFound(_0x32cacb,null))[_0xf2b5('0x12')](function(_0x297663){if(_0x297663){return _0x297663[_0xf2b5('0xa6')](_0x238293[_0xf2b5('0x28')][_0xf2b5('0x93')],_[_0xf2b5('0xa7')](_0x238293[_0xf2b5('0x28')],[_0xf2b5('0x93'),'id'])||{})[_0xf2b5('0xa8')](function(){return db[_0xf2b5('0xa9')][_0xf2b5('0x34')]({'attributes':['id','name',_0xf2b5('0xaa')],'where':{'id':_0x238293[_0xf2b5('0x28')]['ids']}});})[_0xf2b5('0x12')](function(_0x3ef625){socket[_0xf2b5('0xab')]('chatInteractionTags:save',{'id':Number(_0x238293[_0xf2b5('0x38')]['id']),'tags':_0x3ef625||[]});return{'id':Number(_0x238293[_0xf2b5('0x38')]['id']),'tags':_0x3ef625||[]};});}})[_0xf2b5('0x12')](respondWithResult(_0x32cacb,null))[_0xf2b5('0x36')](handleError(_0x32cacb,null));};exports['removeTags']=function(_0x40eefb,_0x2303f8){return db[_0xf2b5('0x2e')]['find']({'where':{'id':_0x40eefb[_0xf2b5('0x38')]['id']}})[_0xf2b5('0x12')](handleEntityNotFound(_0x2303f8,null))[_0xf2b5('0x12')](function(_0x56cc8c){if(_0x56cc8c){return _0x56cc8c[_0xf2b5('0xac')](_0x40eefb[_0xf2b5('0x3b')][_0xf2b5('0x93')]);}})[_0xf2b5('0x12')](respondWithStatusCode(_0x2303f8,null))['catch'](handleError(_0x2303f8,null));};exports[_0xf2b5('0x72')]=function(_0x29e655,_0x55d5c7){var _0x9622d4=moment()[_0xf2b5('0xad')]()['toString']();var _0x5afad7=path[_0xf2b5('0x6e')](config[_0xf2b5('0x6f')],_0xf2b5('0xae'),'files',_0xf2b5('0xaf'));var _0x25b7d2=path['join'](config[_0xf2b5('0x6f')],'server',_0xf2b5('0xb0'),'attachments');var _0x3aed7c=path[_0xf2b5('0x6e')](_0x5afad7,_0x9622d4);var _0x55fbe5=util[_0xf2b5('0x76')]('transcript-%d-%s.zip',_0x29e655[_0xf2b5('0x38')]['id'],_0x9622d4);var _0x1ff790=path[_0xf2b5('0x6e')](_0x5afad7,_0x55fbe5);var _0x1b906c=[];_0x1b906c['push']({'model':db[_0xf2b5('0x79')],'as':_0xf2b5('0x79'),'attributes':['id',_0xf2b5('0x83')],'raw':!![]});_0x1b906c['push']({'model':db[_0xf2b5('0x5d')],'as':_0xf2b5('0x5e'),'attributes':['id',_0xf2b5('0xb1'),'lastName'],'raw':!![]});if(_0x29e655[_0xf2b5('0x3b')][_0xf2b5('0xb2')]){_0x1b906c['push']({'model':db[_0xf2b5('0x6a')],'as':_0xf2b5('0x6a'),'raw':!![]});}var _0x46165b=[{'model':db[_0xf2b5('0x58')],'as':_0xf2b5('0x78'),'attributes':['id','body',_0xf2b5('0x86'),_0xf2b5('0xb3'),_0xf2b5('0x88'),_0xf2b5('0xb4')],'include':_0x1b906c}];_0x46165b[_0xf2b5('0xb5')]({'model':db['ChatWebsite'],'as':_0xf2b5('0xb6'),'attributes':['id','name']});_0x46165b[_0xf2b5('0xb5')]({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db['ChatInteraction'][_0xf2b5('0x5c')]({'where':{'id':_0x29e655[_0xf2b5('0x38')]['id']},'include':_0x46165b})['then'](handleEntityNotFound(_0x55d5c7,null))['then'](function(_0x460e65){if(_0x460e65){var _0x2ca175=_0x460e65['get']({'plain':!![]});fs[_0xf2b5('0xb7')](_0x3aed7c);var _0x38bc5e={'channel':'Chat','account':_0x2ca175['Account']['name'],'agent':_0x2ca175[_0xf2b5('0xb8')]?_0x2ca175['Owner'][_0xf2b5('0x83')]:_0xf2b5('0xb9'),'createdAt':moment(_0x2ca175['createdAt'])[_0xf2b5('0x76')](_0xf2b5('0xa0'))[_0xf2b5('0xba')](),'closedAt':_0x2ca175[_0xf2b5('0x64')]?moment(_0x2ca175[_0xf2b5('0xbb')])[_0xf2b5('0x76')](_0xf2b5('0xa0'))['toString']():'','disposition':_0x2ca175[_0xf2b5('0xbc')],'chatInfo':{'browser':_0x2ca175[_0xf2b5('0xbd')],'os':_0x2ca175[_0xf2b5('0xbe')],'referer':_0x2ca175[_0xf2b5('0xbf')],'customerIp':_0x2ca175[_0xf2b5('0xc0')],'customerPort':_0x2ca175[_0xf2b5('0xc1')]?_0x2ca175[_0xf2b5('0xc1')]:'N.A.'},'messages':_(_0x2ca175[_0xf2b5('0x78')])[_0xf2b5('0xc2')]()['filter']({'secret':![]})[_0xf2b5('0x2d')](function(_0xe38fbe){if(_0xe38fbe[_0xf2b5('0x6a')]){var _0x122bea=path[_0xf2b5('0x6e')](_0x25b7d2,_0xe38fbe[_0xf2b5('0x6a')][_0xf2b5('0x66')]);if(fs[_0xf2b5('0xc3')](_0x122bea)){fs[_0xf2b5('0xc4')](_0x122bea)[_0xf2b5('0xc5')](fs[_0xf2b5('0xc6')](path[_0xf2b5('0x6e')](_0x3aed7c,_0xe38fbe[_0xf2b5('0x6a')][_0xf2b5('0x66')])));}}return{'date':moment(_0xe38fbe[_0xf2b5('0x86')])[_0xf2b5('0x76')](_0xf2b5('0xa0'))[_0xf2b5('0xba')](),'sender':_0xe38fbe[_0xf2b5('0xb3')]===_0xf2b5('0xc7')?_0xe38fbe[_0xf2b5('0x79')]?_0xe38fbe[_0xf2b5('0x79')][_0xf2b5('0x83')]:_0xf2b5('0x7d'):_0xe38fbe[_0xf2b5('0x5e')]['firstName']+(_0xe38fbe[_0xf2b5('0x5e')]['lastName']?'\x20'+_0xe38fbe[_0xf2b5('0x5e')][_0xf2b5('0xc8')]:''),'body':_0xe38fbe[_0xf2b5('0x6a')]?_0xe38fbe['Attachment'][_0xf2b5('0x66')]:_0xe38fbe[_0xf2b5('0x28')],'direction':_0xe38fbe[_0xf2b5('0xb3')]===_0xf2b5('0xc7')?'A':'C','secret':_0xe38fbe[_0xf2b5('0x88')],'read':_0xe38fbe[_0xf2b5('0xb4')],'attachment':_0xe38fbe[_0xf2b5('0x6a')]};})[_0xf2b5('0xc9')]()};return ejs['renderFile'](path[_0xf2b5('0x6e')](config[_0xf2b5('0x6f')],_0xf2b5('0xae'),_0xf2b5('0xca'),'downloadInteraction.ejs'),{'interaction':_0x38bc5e})[_0xf2b5('0x12')](function(_0x261c7d){var _0x361052=path[_0xf2b5('0x6e')](_0x3aed7c,_0xf2b5('0xcb')+_0x2ca175['id']+'-'+_0x9622d4+_0xf2b5('0xcc'));var _0xafc7c7={'path':_0x361052,'channel':_0xf2b5('0xcd'),'interactionId':_0x2ca175['id']};return pdf[_0xf2b5('0xce')](_0x261c7d,_0xafc7c7);})[_0xf2b5('0x12')](function(){return new Promise(function(_0x47bbe1,_0x5620c0){zipdir(_0x3aed7c,{'saveTo':_0x1ff790},function(_0x3e400a,_0x4bfba5){if(_0x3e400a)return _0x5620c0(_0x3e400a);return _0x47bbe1(_0x4bfba5);});})[_0xf2b5('0x12')](function(){return new BPromise(function(_0x2059c2,_0xde1046){rimraf(_0x3aed7c,function(_0x4f8d32){if(_0x4f8d32)_0xde1046(_0x4f8d32);return _0x2059c2();});});})['then'](function(){return _0x55d5c7[_0xf2b5('0x72')](_0x1ff790,_0x55fbe5,function(_0x397524){if(_0x397524){logger[_0xf2b5('0x16')](_0xf2b5('0xcf'),_0x397524);}else{fs['unlinkSync'](_0x1ff790);}});});});}else{return _0x55d5c7['sendStatus'](0xc8);}})[_0xf2b5('0x36')](handleError(_0x55d5c7,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 8b43a83..c3f8fb9 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 _0x8cc0=['save','update','remove','setDataValue','findAll','then','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners'];(function(_0x1487e4,_0x584812){var _0x1f9354=function(_0x5b6306){while(--_0x5b6306){_0x1487e4['push'](_0x1487e4['shift']());}};_0x1f9354(++_0x584812);}(_0x8cc0,0x7c));var _0x08cc=function(_0x26ba65,_0x4b4d0c){_0x26ba65=_0x26ba65-0x0;var _0x133ae2=_0x8cc0[_0x26ba65];return _0x133ae2;};'use strict';var EventEmitter=require(_0x08cc('0x0'));var ChatInteraction=require(_0x08cc('0x1'))['db'][_0x08cc('0x2')];var ChatMessage=require(_0x08cc('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x08cc('0x3')](0x0);var events={'afterCreate':_0x08cc('0x4'),'afterUpdate':_0x08cc('0x5'),'afterDestroy':_0x08cc('0x6')};function emitEvent(_0x4e3407){return function(_0x1c2f15,_0x10719d,_0x34c55e){_0x1c2f15['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1fe02b){_0x1c2f15[_0x08cc('0x7')]('Users',_0x1fe02b['map'](function(_0x54b019){return{'id':_0x54b019['id']};}));return ChatMessage[_0x08cc('0x8')]({'where':{'ChatInteractionId':_0x1c2f15['id'],'direction':'in','read':![]},'raw':!![]});})[_0x08cc('0x9')](function(_0x462a6a){_0x1c2f15[_0x08cc('0x7')]('unreadMessages',_0x462a6a[_0x08cc('0xa')]);ChatInteractionEvents[_0x08cc('0xb')](_0x4e3407+':'+_0x1c2f15['id'],_0x1c2f15);ChatInteractionEvents[_0x08cc('0xb')](_0x4e3407,_0x1c2f15);_0x34c55e(null);})[_0x08cc('0xc')](_0x34c55e(null));};}for(var e in events){if(events[_0x08cc('0xd')](e)){var event=events[e];ChatInteraction[_0x08cc('0xe')](e,emitEvent(event));}}module[_0x08cc('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x0615=['getUsers','setDataValue','map','findAll','then','unreadMessages','length','catch','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x1a3ce8,_0x21bc10){var _0x554169=function(_0x1b5daa){while(--_0x1b5daa){_0x1a3ce8['push'](_0x1a3ce8['shift']());}};_0x554169(++_0x21bc10);}(_0x0615,0x64));var _0x5061=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0615[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x5061('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x5061('0x1')];var ChatMessage=require(_0x5061('0x2'))['db'][_0x5061('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5061('0x4')](0x0);var events={'afterCreate':_0x5061('0x5'),'afterUpdate':_0x5061('0x6'),'afterDestroy':_0x5061('0x7')};function emitEvent(_0x4ff904){return function(_0x37278c,_0x1e699b,_0x26caef){_0x37278c[_0x5061('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x20fb6b){_0x37278c[_0x5061('0x9')]('Users',_0x20fb6b[_0x5061('0xa')](function(_0x3b2c15){return{'id':_0x3b2c15['id']};}));return ChatMessage[_0x5061('0xb')]({'where':{'ChatInteractionId':_0x37278c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5061('0xc')](function(_0x1712dd){_0x37278c[_0x5061('0x9')](_0x5061('0xd'),_0x1712dd[_0x5061('0xe')]);ChatInteractionEvents['emit'](_0x4ff904+':'+_0x37278c['id'],_0x37278c);ChatInteractionEvents['emit'](_0x4ff904,_0x37278c);_0x26caef(null);})[_0x5061('0xf')](_0x26caef(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x5061('0x10')](e,emitEvent(event));}}module[_0x5061('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 6190913..5ea5ff4 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 _0x4655=['bluebird','path','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment'];(function(_0x433b5f,_0xe46c0){var _0x315b75=function(_0x1cda78){while(--_0x1cda78){_0x433b5f['push'](_0x433b5f['shift']());}};_0x315b75(++_0xe46c0);}(_0x4655,0x11d));var _0x5465=function(_0x259f79,_0x3dda4a){_0x259f79=_0x259f79-0x0;var _0xfe940=_0x4655[_0x259f79];return _0xfe940;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5465('0x0'))(_0x5465('0x1'));var moment=require(_0x5465('0x2'));var BPromise=require(_0x5465('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5465('0x4'));var rimraf=require(_0x5465('0x5'));var config=require('../../config/environment');var attributes=require(_0x5465('0x6'));module[_0x5465('0x7')]=function(_0x4f0a5a,_0x4ebe4d){return _0x4f0a5a[_0x5465('0x8')](_0x5465('0x9'),attributes,{'tableName':_0x5465('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a5f0e,_0x33668d,_0x52ec90){if(_0x1a5f0e[_0x5465('0xb')](_0x5465('0xc'))){_0x1a5f0e[_0x5465('0xd')]=moment()[_0x5465('0xe')](_0x5465('0xf'));}_0x52ec90(null,_0x1a5f0e);}},'charset':_0x5465('0x10'),'collate':_0x5465('0x11')});};
\ No newline at end of file
+var _0xeee1=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','chat_interactions','changed','closed','closedAt'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0xeee1,0x188));var _0x1eee=function(_0x2192eb,_0x5bd6d3){_0x2192eb=_0x2192eb-0x0;var _0x9f6bf8=_0xeee1[_0x2192eb];return _0x9f6bf8;};'use strict';var _=require(_0x1eee('0x0'));var util=require('util');var logger=require(_0x1eee('0x1'))('api');var moment=require(_0x1eee('0x2'));var BPromise=require(_0x1eee('0x3'));var rp=require(_0x1eee('0x4'));var fs=require('fs');var path=require(_0x1eee('0x5'));var rimraf=require(_0x1eee('0x6'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x1eee('0x7')]=function(_0x4e31aa,_0x1fe905){return _0x4e31aa[_0x1eee('0x8')]('ChatInteraction',attributes,{'tableName':_0x1eee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x521d26,_0x257aa7,_0x5ebe57){if(_0x521d26[_0x1eee('0xa')](_0x1eee('0xb'))){_0x521d26[_0x1eee('0xc')]=moment()[_0x1eee('0xd')](_0x1eee('0xe'));}_0x5ebe57(null,_0x521d26);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index b7e40ec..2e7e5c1 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 _0xb5b5=['omit','spread','AddTags','debug','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','then','catch','AddTagsToChatInteraction','find','addTags','ids'];(function(_0x568c05,_0x4a3932){var _0xfaf243=function(_0xd0055e){while(--_0xd0055e){_0x568c05['push'](_0x568c05['shift']());}};_0xfaf243(++_0x4a3932);}(_0xb5b5,0x1d2));var _0x5b5b=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0xb5b5[_0x26f1b2];return _0x1624a4;};'use strict';var _=require('lodash');var util=require(_0x5b5b('0x0'));var moment=require(_0x5b5b('0x1'));var BPromise=require('bluebird');var rs=require(_0x5b5b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b5b('0x3'))['db'];var utils=require(_0x5b5b('0x4'));var logger=require(_0x5b5b('0x5'))('rpc');var config=require(_0x5b5b('0x6'));var jayson=require(_0x5b5b('0x7'));var client=jayson[_0x5b5b('0x8')][_0x5b5b('0x9')]({'port':0x232a});config[_0x5b5b('0xa')]=_[_0x5b5b('0xb')](config[_0x5b5b('0xa')],{'host':_0x5b5b('0xc'),'port':0x18eb});var socket=require(_0x5b5b('0xd'))(new Redis(config['redis']));require(_0x5b5b('0xe'))[_0x5b5b('0xf')](socket);function respondWithRpcPromise(_0x2a3737,_0x25f292,_0x5c66c4){return new BPromise(function(_0x5ab64f,_0x480029){return client[_0x5b5b('0x10')](_0x2a3737,_0x5c66c4)['then'](function(_0x3738e6){logger[_0x5b5b('0x11')](_0x5b5b('0x12'),_0x25f292,_0x5b5b('0x13'));logger['debug'](_0x5b5b('0x14'),_0x25f292,_0x5b5b('0x13'),JSON['stringify'](_0x3738e6));if(_0x3738e6[_0x5b5b('0x15')]){if(_0x3738e6[_0x5b5b('0x15')][_0x5b5b('0x16')]===0x1f4){logger[_0x5b5b('0x15')](_0x5b5b('0x12'),_0x25f292,_0x3738e6[_0x5b5b('0x15')]['message']);return _0x480029(_0x3738e6[_0x5b5b('0x15')][_0x5b5b('0x17')]);}logger[_0x5b5b('0x15')](_0x5b5b('0x12'),_0x25f292,_0x3738e6[_0x5b5b('0x15')][_0x5b5b('0x17')]);return _0x5ab64f(_0x3738e6['error']['message']);}else{logger[_0x5b5b('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x25f292,_0x5b5b('0x13'));_0x5ab64f(_0x3738e6[_0x5b5b('0x18')]['message']);}})['catch'](function(_0x210ee9){logger['error'](_0x5b5b('0x12'),_0x25f292,_0x210ee9);_0x480029(_0x210ee9);});});}exports[_0x5b5b('0x19')]=function(_0x30cb58){var _0x6f0d90=this;return new Promise(function(_0x5d3127,_0xcce540){return db[_0x5b5b('0x1a')][_0x5b5b('0x1b')](_0x30cb58[_0x5b5b('0x1c')],{'raw':_0x30cb58[_0x5b5b('0x1d')]?_0x30cb58[_0x5b5b('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30cb58[_0x5b5b('0x1d')]?_0x30cb58[_0x5b5b('0x1d')][_0x5b5b('0x1e')]||null:null,'attributes':_0x30cb58[_0x5b5b('0x1d')]?_0x30cb58['options'][_0x5b5b('0x1f')]||null:null,'limit':_0x30cb58[_0x5b5b('0x1d')]?_0x30cb58[_0x5b5b('0x1d')]['limit']||null:null})[_0x5b5b('0x20')](function(_0x356c15){logger['info']('UpdateChatInteraction',_0x30cb58);logger['debug'](_0x5b5b('0x19'),_0x30cb58,JSON['stringify'](_0x356c15));_0x5d3127(_0x356c15);})[_0x5b5b('0x21')](function(_0x189f5a){logger[_0x5b5b('0x15')](_0x5b5b('0x19'),_0x189f5a[_0x5b5b('0x17')],_0x30cb58);_0xcce540(_0x6f0d90['error'](0x1f4,_0x189f5a[_0x5b5b('0x17')]));});});};exports[_0x5b5b('0x22')]=function(_0x345bc1){return new Promise(function(_0x2b6a2f,_0x1d6c96){return db['ChatInteraction'][_0x5b5b('0x23')]({'where':_0x345bc1[_0x5b5b('0x1d')]?_0x345bc1[_0x5b5b('0x1d')][_0x5b5b('0x1e')]||null:null})['then'](function(_0x48e951){if(_0x48e951){return _0x48e951[_0x5b5b('0x24')](_0x345bc1[_0x5b5b('0x1c')][_0x5b5b('0x25')],_[_0x5b5b('0x26')](_0x345bc1[_0x5b5b('0x1c')],['ids','id'])||{});}})[_0x5b5b('0x27')](function(_0x1493b2){logger[_0x5b5b('0x11')](_0x5b5b('0x28'),_0x345bc1);logger[_0x5b5b('0x29')]('AddTags',_0x345bc1,JSON['stringify'](_0x1493b2));_0x2b6a2f(_0x1493b2);})['catch'](function(_0x1c78b3){logger[_0x5b5b('0x15')](_0x5b5b('0x28'),_0x1c78b3['message'],_0x345bc1);_0x1d6c96(_this['error'](0x1f4,_0x1c78b3[_0x5b5b('0x17')]));});});};
\ No newline at end of file
+var _0x42ee=['code','message','info','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','then','find','addTags','ids','omit','AddTags','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','register','request','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x178ce9,_0x150618){var _0x3c2d98=function(_0x28a5b7){while(--_0x28a5b7){_0x178ce9['push'](_0x178ce9['shift']());}};_0x3c2d98(++_0x150618);}(_0x42ee,0xe1));var _0xe42e=function(_0x4bd950,_0x184ed5){_0x4bd950=_0x4bd950-0x0;var _0x5dc59a=_0x42ee[_0x4bd950];return _0x5dc59a;};'use strict';var _=require(_0xe42e('0x0'));var util=require('util');var moment=require(_0xe42e('0x1'));var BPromise=require(_0xe42e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe42e('0x3'));var db=require(_0xe42e('0x4'))['db'];var utils=require(_0xe42e('0x5'));var logger=require(_0xe42e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe42e('0x7')][_0xe42e('0x8')]({'port':0x232a});config[_0xe42e('0x9')]=_[_0xe42e('0xa')](config[_0xe42e('0x9')],{'host':_0xe42e('0xb'),'port':0x18eb});var socket=require(_0xe42e('0xc'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xe42e('0xd')](socket);function respondWithRpcPromise(_0x24bc2b,_0x1a3d07,_0x88a13a){return new BPromise(function(_0x2eb509,_0x516a35){return client[_0xe42e('0xe')](_0x24bc2b,_0x88a13a)['then'](function(_0x55b2cb){logger['info'](_0xe42e('0xf'),_0x1a3d07,'request\x20sent');logger[_0xe42e('0x10')](_0xe42e('0x11'),_0x1a3d07,_0xe42e('0x12'),JSON[_0xe42e('0x13')](_0x55b2cb));if(_0x55b2cb['error']){if(_0x55b2cb[_0xe42e('0x14')][_0xe42e('0x15')]===0x1f4){logger[_0xe42e('0x14')](_0xe42e('0xf'),_0x1a3d07,_0x55b2cb[_0xe42e('0x14')][_0xe42e('0x16')]);return _0x516a35(_0x55b2cb[_0xe42e('0x14')][_0xe42e('0x16')]);}logger[_0xe42e('0x14')](_0xe42e('0xf'),_0x1a3d07,_0x55b2cb[_0xe42e('0x14')][_0xe42e('0x16')]);return _0x2eb509(_0x55b2cb[_0xe42e('0x14')][_0xe42e('0x16')]);}else{logger[_0xe42e('0x17')](_0xe42e('0xf'),_0x1a3d07,_0xe42e('0x12'));_0x2eb509(_0x55b2cb[_0xe42e('0x18')]['message']);}})['catch'](function(_0x3ecce4){logger[_0xe42e('0x14')](_0xe42e('0xf'),_0x1a3d07,_0x3ecce4);_0x516a35(_0x3ecce4);});});}exports[_0xe42e('0x19')]=function(_0x481dfe){var _0x34707d=this;return new Promise(function(_0x220d68,_0x808c27){return db[_0xe42e('0x1a')][_0xe42e('0x1b')](_0x481dfe[_0xe42e('0x1c')],{'raw':_0x481dfe['options']?_0x481dfe[_0xe42e('0x1d')][_0xe42e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x481dfe[_0xe42e('0x1d')]?_0x481dfe['options'][_0xe42e('0x1f')]||null:null,'attributes':_0x481dfe[_0xe42e('0x1d')]?_0x481dfe['options'][_0xe42e('0x20')]||null:null,'limit':_0x481dfe[_0xe42e('0x1d')]?_0x481dfe[_0xe42e('0x1d')][_0xe42e('0x21')]||null:null})[_0xe42e('0x22')](function(_0x1324a9){logger['info'](_0xe42e('0x19'),_0x481dfe);logger[_0xe42e('0x10')](_0xe42e('0x19'),_0x481dfe,JSON[_0xe42e('0x13')](_0x1324a9));_0x220d68(_0x1324a9);})['catch'](function(_0x11279a){logger['error']('UpdateChatInteraction',_0x11279a[_0xe42e('0x16')],_0x481dfe);_0x808c27(_0x34707d[_0xe42e('0x14')](0x1f4,_0x11279a[_0xe42e('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x41e1e1){return new Promise(function(_0x2da0c7,_0x2bdbf5){return db[_0xe42e('0x1a')][_0xe42e('0x23')]({'where':_0x41e1e1[_0xe42e('0x1d')]?_0x41e1e1['options'][_0xe42e('0x1f')]||null:null})[_0xe42e('0x22')](function(_0x3f03e0){if(_0x3f03e0){return _0x3f03e0[_0xe42e('0x24')](_0x41e1e1[_0xe42e('0x1c')][_0xe42e('0x25')],_[_0xe42e('0x26')](_0x41e1e1[_0xe42e('0x1c')],['ids','id'])||{});}})['spread'](function(_0x5df499){logger[_0xe42e('0x17')](_0xe42e('0x27'),_0x41e1e1);logger['debug'](_0xe42e('0x27'),_0x41e1e1,JSON[_0xe42e('0x13')](_0x5df499));_0x2da0c7(_0x5df499);})[_0xe42e('0x28')](function(_0x50032a){logger[_0xe42e('0x14')](_0xe42e('0x27'),_0x50032a[_0xe42e('0x16')],_0x41e1e1);_0x2bdbf5(_this['error'](0x1f4,_0x50032a[_0xe42e('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 1de09ec..f5ace82 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 _0x76ff=['./chatInteraction.events','save','emit','removeListener','register','length'];(function(_0x5766f1,_0x1feaa6){var _0x507999=function(_0x632a1a){while(--_0x632a1a){_0x5766f1['push'](_0x5766f1['shift']());}};_0x507999(++_0x1feaa6);}(_0x76ff,0xa8));var _0xf76f=function(_0x4a8963,_0x148027){_0x4a8963=_0x4a8963-0x0;var _0x572fa9=_0x76ff[_0x4a8963];return _0x572fa9;};'use strict';var ChatInteractionEvents=require(_0xf76f('0x0'));var events=[_0xf76f('0x1'),'remove','update'];function createListener(_0x20f55c,_0x546992){return function(_0x1201b7){_0x546992[_0xf76f('0x2')](_0x20f55c,_0x1201b7);};}function removeListener(_0x3e19a2,_0x11b1de){return function(){ChatInteractionEvents[_0xf76f('0x3')](_0x3e19a2,_0x11b1de);};}exports[_0xf76f('0x4')]=function(_0x1aa763){for(var _0x47f244=0x0,_0x1315fa=events[_0xf76f('0x5')];_0x47f244<_0x1315fa;_0x47f244++){var _0x493f22=events[_0x47f244];var _0x2fb5b5=createListener('chatInteraction:'+_0x493f22,_0x1aa763);ChatInteractionEvents['on'](_0x493f22,_0x2fb5b5);}};
\ No newline at end of file
+var _0x83cc=['update','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x2e2f64,_0x5a7677){var _0x398dba=function(_0x627a6){while(--_0x627a6){_0x2e2f64['push'](_0x2e2f64['shift']());}};_0x398dba(++_0x5a7677);}(_0x83cc,0x115));var _0xc83c=function(_0xdb5808,_0x58c067){_0xdb5808=_0xdb5808-0x0;var _0x111072=_0x83cc[_0xdb5808];return _0x111072;};'use strict';var ChatInteractionEvents=require(_0xc83c('0x0'));var events=[_0xc83c('0x1'),_0xc83c('0x2'),_0xc83c('0x3')];function createListener(_0x4ec98b,_0x3b1082){return function(_0x424cc0){_0x3b1082['emit'](_0x4ec98b,_0x424cc0);};}function removeListener(_0x4c0bb7,_0x4f8e30){return function(){ChatInteractionEvents[_0xc83c('0x4')](_0x4c0bb7,_0x4f8e30);};}exports[_0xc83c('0x5')]=function(_0x4d0639){for(var _0x4a0e00=0x0,_0x484002=events[_0xc83c('0x6')];_0x4a0e00<_0x484002;_0x4a0e00++){var _0x541a71=events[_0x4a0e00];var _0x8d1208=createListener(_0xc83c('0x7')+_0x541a71,_0x4d0639);ChatInteractionEvents['on'](_0x541a71,_0x8d1208);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index d0ff9cd..6610520 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 _0xb11d=['chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','destroy','removeTags','util','connect-timeout','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked'];(function(_0x1703d1,_0x34a1db){var _0x1d8ed6=function(_0x1160ee){while(--_0x1160ee){_0x1703d1['push'](_0x1703d1['shift']());}};_0x1d8ed6(++_0x34a1db);}(_0xb11d,0x1d0));var _0xdb11=function(_0x40044c,_0x5b37c7){_0x40044c=_0x40044c-0x0;var _0x5d6177=_0xb11d[_0x40044c];return _0x5d6177;};'use strict';var multer=require('multer');var util=require(_0xdb11('0x0'));var path=require('path');var timeout=require(_0xdb11('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdb11('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xdb11('0x3'));var controller=require('./chatInteraction.controller');router[_0xdb11('0x4')]('/',auth[_0xdb11('0x5')](),controller[_0xdb11('0x6')]);router[_0xdb11('0x4')](_0xdb11('0x7'),auth[_0xdb11('0x5')](),controller[_0xdb11('0x8')]);router[_0xdb11('0x4')](_0xdb11('0x9'),auth[_0xdb11('0xa')](),controller['show']);router[_0xdb11('0x4')](_0xdb11('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xdb11('0xc')]);router[_0xdb11('0x4')](_0xdb11('0xd'),auth[_0xdb11('0x5')](),controller[_0xdb11('0xe')]);router[_0xdb11('0x4')](_0xdb11('0xf'),auth[_0xdb11('0xa')](),controller[_0xdb11('0x10')]);router[_0xdb11('0x4')]('/:id/download',auth[_0xdb11('0x5')](),controller[_0xdb11('0x11')]);router[_0xdb11('0x12')]('/',auth[_0xdb11('0x5')](),controller[_0xdb11('0x13')]);router[_0xdb11('0x12')](_0xdb11('0x14'),auth[_0xdb11('0x5')](),controller[_0xdb11('0x15')]);var upload=multer({'storage':multer[_0xdb11('0x16')]({'destination':function(_0x39acd3,_0x15f38f,_0x40bcfa){_0x40bcfa(null,path[_0xdb11('0x17')](config[_0xdb11('0x18')],_0xdb11('0x19')));},'filename':function(_0x5c1316,_0x10763f,_0x34da73){_0x34da73(null,util[_0xdb11('0x1a')](_0xdb11('0x1b'),Date['now'](),_0x10763f[_0xdb11('0x1c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xdb11('0x1d'),upload[_0xdb11('0x1e')](_0xdb11('0x1f')),controller[_0xdb11('0x20')]);router[_0xdb11('0x12')]('/:id/messages',auth[_0xdb11('0xa')](),controller[_0xdb11('0x21')]);router[_0xdb11('0x12')](_0xdb11('0x22'),auth[_0xdb11('0x5')](),interaction[_0xdb11('0x23')](_0xdb11('0x24'),_0xdb11('0x25')),controller[_0xdb11('0x26')]);router[_0xdb11('0x27')](_0xdb11('0x9'),auth[_0xdb11('0x5')](),interaction[_0xdb11('0x23')](_0xdb11('0x24'),_0xdb11('0x28')),controller[_0xdb11('0x29')]);router[_0xdb11('0x27')](_0xdb11('0x2a'),controller[_0xdb11('0x2b')]);router[_0xdb11('0x27')](_0xdb11('0x2c'),auth[_0xdb11('0xa')](),controller[_0xdb11('0x2d')]);router['put']('/:id/close',controller[_0xdb11('0x2e')]);router[_0xdb11('0x2f')](_0xdb11('0x9'),auth[_0xdb11('0x5')](),interaction['tracked'](_0xdb11('0x24'),'chatinteraction:destroy'),controller[_0xdb11('0x30')]);router[_0xdb11('0x2f')]('/:id/tags',auth[_0xdb11('0x5')](),controller[_0xdb11('0x31')]);module['exports']=router;
\ No newline at end of file
+var _0xc013=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','getMessages','getMyMessages','download','post','create','/:id/vidaoo','diskStorage','format','%s-%s','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','customUpdate','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','multer'];(function(_0x54ad34,_0x6659ed){var _0x1060c9=function(_0x34f561){while(--_0x34f561){_0x54ad34['push'](_0x54ad34['shift']());}};_0x1060c9(++_0x6659ed);}(_0xc013,0x14f));var _0x3c01=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0xc013[_0x99868f];return _0x27a71b;};'use strict';var multer=require(_0x3c01('0x0'));var util=require(_0x3c01('0x1'));var path=require(_0x3c01('0x2'));var timeout=require(_0x3c01('0x3'));var express=require(_0x3c01('0x4'));var router=express[_0x3c01('0x5')]();var fs_extra=require(_0x3c01('0x6'));var auth=require(_0x3c01('0x7'));var interaction=require(_0x3c01('0x8'));var config=require('../../config/environment');var controller=require(_0x3c01('0x9'));router[_0x3c01('0xa')]('/',auth[_0x3c01('0xb')](),controller['index']);router[_0x3c01('0xa')](_0x3c01('0xc'),auth[_0x3c01('0xb')](),controller[_0x3c01('0xd')]);router[_0x3c01('0xa')](_0x3c01('0xe'),auth[_0x3c01('0xf')](),controller[_0x3c01('0x10')]);router[_0x3c01('0xa')](_0x3c01('0x11'),auth[_0x3c01('0xf')](),controller['attachmentDownload']);router['get']('/:id/messages',auth[_0x3c01('0xb')](),controller[_0x3c01('0x12')]);router[_0x3c01('0xa')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0x3c01('0x13')]);router[_0x3c01('0xa')]('/:id/download',auth[_0x3c01('0xb')](),controller[_0x3c01('0x14')]);router[_0x3c01('0x15')]('/',auth[_0x3c01('0xb')](),controller[_0x3c01('0x16')]);router[_0x3c01('0x15')](_0x3c01('0x17'),auth[_0x3c01('0xb')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x3c01('0x18')]({'destination':function(_0x40c2c0,_0x1e10d3,_0x3d42bd){_0x3d42bd(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x518d2c,_0x2dc23e,_0x8a59ca){_0x8a59ca(null,util[_0x3c01('0x19')](_0x3c01('0x1a'),Date['now'](),_0x2dc23e['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x3c01('0x1b'),upload[_0x3c01('0x1c')](_0x3c01('0x1d')),controller[_0x3c01('0x1e')]);router[_0x3c01('0x15')](_0x3c01('0x1f'),auth[_0x3c01('0xf')](),controller[_0x3c01('0x20')]);router[_0x3c01('0x15')](_0x3c01('0x21'),auth[_0x3c01('0xb')](),interaction[_0x3c01('0x22')](_0x3c01('0x23'),_0x3c01('0x24')),controller[_0x3c01('0x25')]);router[_0x3c01('0x26')](_0x3c01('0xe'),auth[_0x3c01('0xb')](),interaction[_0x3c01('0x22')](_0x3c01('0x23'),_0x3c01('0x27')),controller[_0x3c01('0x28')]);router[_0x3c01('0x26')]('/:id/custom_update',controller[_0x3c01('0x29')]);router[_0x3c01('0x26')]('/:id/abandon',auth[_0x3c01('0xf')](),controller[_0x3c01('0x2a')]);router[_0x3c01('0x26')](_0x3c01('0x2b'),controller['close']);router[_0x3c01('0x2c')](_0x3c01('0xe'),auth['isAuthenticated'](),interaction[_0x3c01('0x22')](_0x3c01('0x23'),_0x3c01('0x2d')),controller[_0x3c01('0x2e')]);router[_0x3c01('0x2c')]('/:id/tags',auth['isAuthenticated'](),controller[_0x3c01('0x2f')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 3311cd0..30fb9bb 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 _0xb995=['medium','exports','TEXT'];(function(_0x4d875f,_0x2c7732){var _0x1671e0=function(_0x5f15e8){while(--_0x5f15e8){_0x4d875f['push'](_0x4d875f['shift']());}};_0x1671e0(++_0x2c7732);}(_0xb995,0x94));var _0x5b99=function(_0x5e4d4a,_0x2322e1){_0x5e4d4a=_0x5e4d4a-0x0;var _0x19fbd3=_0xb995[_0x5e4d4a];return _0x19fbd3;};'use strict';var Sequelize=require('sequelize');module[_0x5b99('0x0')]={'body':{'type':Sequelize[_0x5b99('0x1')](_0x5b99('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xe3b3=['medium','BOOLEAN','sequelize','TEXT'];(function(_0xd98e38,_0xfae9f4){var _0x28b0cd=function(_0xc6414f){while(--_0xc6414f){_0xd98e38['push'](_0xd98e38['shift']());}};_0x28b0cd(++_0xfae9f4);}(_0xe3b3,0x18e));var _0x3e3b=function(_0x44f3a4,_0x2f889e){_0x44f3a4=_0x44f3a4-0x0;var _0x2294a2=_0xe3b3[_0x44f3a4];return _0x2294a2;};'use strict';var Sequelize=require(_0x3e3b('0x0'));module['exports']={'body':{'type':Sequelize[_0x3e3b('0x1')](_0x3e3b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3e3b('0x3')],'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 639de11..77fc162 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 _0x983e=['User','findAll','agent','admin','user','fullname','role','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','messages','FromId','ToId','read','body','-createdAt','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','rows','catch','show','includeAll','include','find','create','params','describe','get','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers'];(function(_0x31172e,_0xa59e5){var _0x414ada=function(_0x37ede4){while(--_0x37ede4){_0x31172e['push'](_0x31172e['shift']());}};_0x414ada(++_0xa59e5);}(_0x983e,0x103));var _0xe983=function(_0x1c6e60,_0x1b47c2){_0x1c6e60=_0x1c6e60-0x0;var _0x29e908=_0x983e[_0x1c6e60];return _0x29e908;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe983('0x0'));var zipdir=require(_0xe983('0x1'));var jsonpatch=require(_0xe983('0x2'));var rp=require(_0xe983('0x3'));var moment=require(_0xe983('0x4'));var BPromise=require(_0xe983('0x5'));var Mustache=require(_0xe983('0x6'));var util=require(_0xe983('0x7'));var path=require(_0xe983('0x8'));var sox=require(_0xe983('0x9'));var csv=require('to-csv');var ejs=require(_0xe983('0xa'));var fs=require('fs');var fs_extra=require(_0xe983('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe983('0xc'));var jsforce=require(_0xe983('0xd'));var deskjs=require(_0xe983('0xe'));var toCsv=require(_0xe983('0xf'));var querystring=require(_0xe983('0x10'));var Papa=require(_0xe983('0x11'));var Redis=require(_0xe983('0x12'));var authService=require(_0xe983('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe983('0x14'));var hardwareService=require(_0xe983('0x15'));var logger=require(_0xe983('0x16'))(_0xe983('0x17'));var utils=require(_0xe983('0x18'));var config=require(_0xe983('0x19'));var licenseUtil=require(_0xe983('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe983('0x1b')](config[_0xe983('0x1c')],{'host':_0xe983('0x1d'),'port':0x18eb});var socket=require(_0xe983('0x1e'))(new Redis(config[_0xe983('0x1c')]));require(_0xe983('0x1f'))[_0xe983('0x20')](socket);function respondWithStatusCode(_0xbf05bd,_0x18d836){_0x18d836=_0x18d836||0xcc;return function(_0x5324e1){if(_0x5324e1){return _0xbf05bd[_0xe983('0x21')](_0x18d836);}return _0xbf05bd[_0xe983('0x22')](_0x18d836)[_0xe983('0x23')]();};}function respondWithResult(_0x2332b2,_0x3b0734){_0x3b0734=_0x3b0734||0xc8;return function(_0xd132f0){if(_0xd132f0){return _0x2332b2[_0xe983('0x22')](_0x3b0734)[_0xe983('0x24')](_0xd132f0);}};}function respondWithFilteredResult(_0x313753,_0x2ab9f3){return function(_0x7a1380){if(_0x7a1380){var _0x3d3490=typeof _0x2ab9f3[_0xe983('0x25')]==='undefined'&&typeof _0x2ab9f3[_0xe983('0x26')]===_0xe983('0x27');var _0x5b3548=_0x7a1380[_0xe983('0x28')];var _0x416385=_0x3d3490?0x0:_0x2ab9f3[_0xe983('0x25')];var _0xec5049=_0x3d3490?_0x7a1380[_0xe983('0x28')]:_0x2ab9f3[_0xe983('0x25')]+_0x2ab9f3[_0xe983('0x26')];var _0x31c70f;if(_0xec5049>=_0x5b3548){_0xec5049=_0x5b3548;_0x31c70f=0xc8;}else{_0x31c70f=0xce;}_0x313753[_0xe983('0x22')](_0x31c70f);return _0x313753['set'](_0xe983('0x29'),_0x416385+'-'+_0xec5049+'/'+_0x5b3548)[_0xe983('0x24')](_0x7a1380);}return null;};}function patchUpdates(_0x228fd5){return function(_0x3b7173){try{jsonpatch[_0xe983('0x2a')](_0x3b7173,_0x228fd5,!![]);}catch(_0x1c2532){return BPromise[_0xe983('0x2b')](_0x1c2532);}return _0x3b7173['save']();};}function saveUpdates(_0x5068f7,_0x5d9a0a){return function(_0x2282e8){if(_0x2282e8){return _0x2282e8[_0xe983('0x2c')](_0x5068f7)[_0xe983('0x2d')](function(_0x4d3e04){return _0x4d3e04;});}return null;};}function removeEntity(_0x457e4d,_0x4c7fb9){return function(_0x57f365){if(_0x57f365){return _0x57f365[_0xe983('0x2e')]()[_0xe983('0x2d')](function(){_0x457e4d[_0xe983('0x22')](0xcc)[_0xe983('0x23')]();});}};}function handleEntityNotFound(_0x2a2096,_0x5c3bc6){return function(_0x3fb72a){if(!_0x3fb72a){_0x2a2096['sendStatus'](0x194);}return _0x3fb72a;};}function handleError(_0x1f1d19,_0x244b50){_0x244b50=_0x244b50||0x1f4;return function(_0x119c71){logger['error'](_0x119c71['stack']);if(_0x119c71[_0xe983('0x2f')]){delete _0x119c71['name'];}_0x1f1d19[_0xe983('0x22')](_0x244b50)[_0xe983('0x30')](_0x119c71);};}exports[_0xe983('0x31')]=function(_0x49b384,_0x500a0a){var _0x15e0b7={},_0x1760b7={},_0x4ee0fe={'count':0x0,'rows':[]};var _0x5ecd48=_[_0xe983('0x32')](db[_0xe983('0x33')][_0xe983('0x34')],function(_0x496d4){return{'name':_0x496d4[_0xe983('0x35')],'type':_0x496d4[_0xe983('0x36')][_0xe983('0x37')]};});_0x1760b7['model']=_[_0xe983('0x32')](_0x5ecd48,'name');_0x1760b7['query']=_[_0xe983('0x38')](_0x49b384[_0xe983('0x39')]);_0x1760b7['filters']=_['intersection'](_0x1760b7[_0xe983('0x3a')],_0x1760b7[_0xe983('0x39')]);_0x15e0b7[_0xe983('0x3b')]=_[_0xe983('0x3c')](_0x1760b7[_0xe983('0x3a')],qs[_0xe983('0x3d')](_0x49b384[_0xe983('0x39')]['fields']));_0x15e0b7[_0xe983('0x3b')]=_0x15e0b7[_0xe983('0x3b')][_0xe983('0x3e')]?_0x15e0b7[_0xe983('0x3b')]:_0x1760b7[_0xe983('0x3a')];if(!_0x49b384[_0xe983('0x39')][_0xe983('0x3f')](_0xe983('0x40'))){_0x15e0b7[_0xe983('0x26')]=qs['limit'](_0x49b384[_0xe983('0x39')]['limit']);_0x15e0b7[_0xe983('0x25')]=qs[_0xe983('0x25')](_0x49b384[_0xe983('0x39')][_0xe983('0x25')]);}_0x15e0b7[_0xe983('0x41')]=qs[_0xe983('0x42')](_0x49b384[_0xe983('0x39')][_0xe983('0x42')]);_0x15e0b7[_0xe983('0x43')]=qs[_0xe983('0x44')](_['pick'](_0x49b384[_0xe983('0x39')],_0x1760b7['filters']),_0x5ecd48);if(_0x49b384[_0xe983('0x39')][_0xe983('0x45')]){_0x15e0b7[_0xe983('0x43')]=_[_0xe983('0x46')](_0x15e0b7['where'],{'$or':_['map'](_0x5ecd48,function(_0x179920){if(_0x179920[_0xe983('0x36')]!==_0xe983('0x47')){var _0x4f487b={};_0x4f487b[_0x179920[_0xe983('0x2f')]]={'$like':'%'+_0x49b384[_0xe983('0x39')][_0xe983('0x45')]+'%'};return _0x4f487b;}})});}_0x15e0b7=_[_0xe983('0x46')]({},_0x15e0b7,_0x49b384[_0xe983('0x48')]);var _0x574adb={'where':_0x15e0b7['where']};return db[_0xe983('0x33')][_0xe983('0x28')](_0x574adb)[_0xe983('0x2d')](function(_0x5e4ef1){_0x4ee0fe[_0xe983('0x28')]=_0x5e4ef1;if(_0x49b384[_0xe983('0x39')]['includeAll']){_0x15e0b7['include']=[{'all':!![]}];}return db[_0xe983('0x33')]['findAll'](_0x15e0b7);})['then'](function(_0x2b8dcd){_0x4ee0fe[_0xe983('0x49')]=_0x2b8dcd;return _0x4ee0fe;})[_0xe983('0x2d')](respondWithFilteredResult(_0x500a0a,_0x15e0b7))[_0xe983('0x4a')](handleError(_0x500a0a,null));};exports[_0xe983('0x4b')]=function(_0x157ee0,_0x314b81){var _0x59f05e={'raw':!![],'where':{'id':_0x157ee0['params']['id']}},_0x210601={};_0x210601['model']=_['keys'](db[_0xe983('0x33')][_0xe983('0x34')]);_0x210601['query']=_[_0xe983('0x38')](_0x157ee0[_0xe983('0x39')]);_0x210601[_0xe983('0x44')]=_[_0xe983('0x3c')](_0x210601[_0xe983('0x3a')],_0x210601[_0xe983('0x39')]);_0x59f05e[_0xe983('0x3b')]=_[_0xe983('0x3c')](_0x210601['model'],qs['fields'](_0x157ee0[_0xe983('0x39')][_0xe983('0x3d')]));_0x59f05e[_0xe983('0x3b')]=_0x59f05e[_0xe983('0x3b')][_0xe983('0x3e')]?_0x59f05e['attributes']:_0x210601[_0xe983('0x3a')];if(_0x157ee0[_0xe983('0x39')][_0xe983('0x4c')]){_0x59f05e[_0xe983('0x4d')]=[{'all':!![]}];}_0x59f05e=_[_0xe983('0x46')]({},_0x59f05e,_0x157ee0[_0xe983('0x48')]);return db[_0xe983('0x33')][_0xe983('0x4e')](_0x59f05e)[_0xe983('0x2d')](handleEntityNotFound(_0x314b81,null))[_0xe983('0x2d')](respondWithResult(_0x314b81,null))[_0xe983('0x4a')](handleError(_0x314b81,null));};exports[_0xe983('0x4f')]=function(_0x5bbe94,_0x4f33f1){return db['ChatInternalMessage']['create'](_0x5bbe94['body'],{})[_0xe983('0x2d')](respondWithResult(_0x4f33f1,0xc9))[_0xe983('0x4a')](handleError(_0x4f33f1,null));};exports[_0xe983('0x2c')]=function(_0x24cb37,_0x3b59fc){if(_0x24cb37['body']['id']){delete _0x24cb37['body']['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x24cb37[_0xe983('0x50')]['id']}})['then'](handleEntityNotFound(_0x3b59fc,null))['then'](saveUpdates(_0x24cb37['body'],null))[_0xe983('0x2d')](respondWithResult(_0x3b59fc,null))[_0xe983('0x4a')](handleError(_0x3b59fc,null));};exports[_0xe983('0x2e')]=function(_0x393271,_0x1123dd){return db[_0xe983('0x33')]['find']({'where':{'id':_0x393271[_0xe983('0x50')]['id']}})[_0xe983('0x2d')](handleEntityNotFound(_0x1123dd,null))[_0xe983('0x2d')](removeEntity(_0x1123dd,null))[_0xe983('0x4a')](handleError(_0x1123dd,null));};exports['describe']=function(_0x6c830f,_0x1b70e6){return db[_0xe983('0x33')][_0xe983('0x51')]()[_0xe983('0x2d')](respondWithResult(_0x1b70e6,null))['catch'](handleError(_0x1b70e6,null));};function wrapUser(_0x4a3e95){return function(_0x2e5f5a){var _0x105e6e=_0x4a3e95[_0xe983('0x52')]({'plain':!![]});_0x105e6e['messages']=[];if(_0x2e5f5a){_0x105e6e['lastMessageAt']=_0x2e5f5a[_0xe983('0x53')];_0x105e6e[_0xe983('0x54')]=_0x2e5f5a;}else{_0x105e6e[_0xe983('0x55')]=moment(0x0)[_0xe983('0x56')](_0xe983('0x57'));_0x105e6e[_0xe983('0x54')]={};}return _0x105e6e;};}exports[_0xe983('0x58')]=function(_0x51b764,_0x3d1c79,_0xdf4dbb){var _0x4c8477=[];return db[_0xe983('0x59')][_0xe983('0x5a')]({'where':{'role':[_0xe983('0x5b'),_0xe983('0x5c'),_0xe983('0x5d')]},'attributes':['id',_0xe983('0x5e'),_0xe983('0x2f'),_0xe983('0x5f'),'userpic','internal',_0xe983('0x60'),_0xe983('0x61'),_0xe983('0x62'),_0xe983('0x63')],'order':qs[_0xe983('0x42')](_0xe983('0x64')),'include':[{'model':db[_0xe983('0x65')],'as':_0xe983('0x66'),'attributes':['id',_0xe983('0x2f'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x515afa){if(_0x515afa){var _0x4e5b94=_0x51b764[_0xe983('0x5d')]['get']({'plain':!![]});if(!_0x4e5b94)throw new Error(_0xe983('0x67'));if(_0x4e5b94['role']===_0xe983('0x5d')){return db['UserProfileSection'][_0xe983('0x4e')]({'where':{'name':_0xe983('0x68'),'userProfileId':_0x4e5b94[_0xe983('0x69')]},'raw':!![]})[_0xe983('0x2d')](function(_0x53d919){if(_0x53d919){if(_0x53d919[_0xe983('0x6a')]===0x0){return db['UserProfileResource'][_0xe983('0x5a')]({'where':{'sectionId':_0x53d919['id']},'raw':!![]})['then'](function(_0x63e655){var _0x5bdcba=[];if(_[_0xe983('0x6b')](_0x63e655)){_0x5bdcba=_[_0xe983('0x45')](_0x515afa,function(_0x1291d9){if(_0x1291d9[_0xe983('0x5f')]!==_0xe983('0x5b')){return _0x1291d9;}});return _0x5bdcba;}else{for(var _0x45670c=0x0;_0x45670c<_0x515afa[_0xe983('0x3e')];_0x45670c++){var _0xedaa46=_0x515afa[_0x45670c];if(_0xedaa46[_0xe983('0x5f')]===_0xe983('0x5b')){var _0x161ffb=_[_0xe983('0x4e')](_0x63e655,function(_0x475c8b){return _0x475c8b[_0xe983('0x6c')]===_0xedaa46['id'];});if(_0x161ffb)_0x5bdcba[_0xe983('0x6d')](_0xedaa46);}else{_0x5bdcba['push'](_0xedaa46);}}return _0x5bdcba;}});}else{return _0x515afa;}}else{var _0x220767=_[_0xe983('0x45')](_0x515afa,function(_0x27cdb8){if(_0x27cdb8[_0xe983('0x5f')]!==_0xe983('0x5b')){return _0x27cdb8;}});return _0x220767;}});}else{return _0x515afa;}}})[_0xe983('0x2d')](function(_0x595804){var _0x508bec=[];if(_0x595804){_0x4c8477=_0x595804;for(var _0x395901=0x0;_0x395901<_0x595804[_0xe983('0x3e')];_0x395901+=0x1){_0x4c8477[_0x395901][_0xe983('0x6e')]=[];_0x508bec['push'](db[_0xe983('0x33')][_0xe983('0x4e')]({'where':{'FromId':[_0x51b764['user']['id'],_0x595804[_0x395901]['id']],'ToId':[_0x51b764[_0xe983('0x5d')]['id'],_0x595804[_0x395901]['id']],'ChatGroupId':null},'attributes':['id',_0xe983('0x53'),_0xe983('0x6f'),_0xe983('0x70'),_0xe983('0x71'),_0xe983('0x72')],'order':qs[_0xe983('0x42')](_0xe983('0x73')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe983('0x2d')](wrapUser(_0x595804[_0x395901])));}return BPromise['all'](_0x508bec);}return[];})[_0xe983('0x2d')](function(_0x448797){return{'rows':_0x448797,'count':_0x448797[_0xe983('0x3e')]};})[_0xe983('0x2d')](respondWithResult(_0x3d1c79,null))[_0xe983('0x4a')](handleError(_0x3d1c79,null));};
\ No newline at end of file
+var _0x8896=['status','offset','undefined','limit','count','Content-Range','json','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','body','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','-createdAt','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','redis','./chatInternalMessage.socket','register','sendStatus'];(function(_0x28e537,_0x1d36fa){var _0x3c47f8=function(_0x4a5b06){while(--_0x4a5b06){_0x28e537['push'](_0x28e537['shift']());}};_0x3c47f8(++_0x1d36fa);}(_0x8896,0xaf));var _0x6889=function(_0x5ad45b,_0x150f13){_0x5ad45b=_0x5ad45b-0x0;var _0x33f225=_0x8896[_0x5ad45b];return _0x33f225;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6889('0x0'));var zipdir=require(_0x6889('0x1'));var jsonpatch=require(_0x6889('0x2'));var rp=require(_0x6889('0x3'));var moment=require('moment');var BPromise=require(_0x6889('0x4'));var Mustache=require(_0x6889('0x5'));var util=require(_0x6889('0x6'));var path=require(_0x6889('0x7'));var sox=require(_0x6889('0x8'));var csv=require(_0x6889('0x9'));var ejs=require(_0x6889('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6889('0xb'));var jsforce=require(_0x6889('0xc'));var deskjs=require(_0x6889('0xd'));var toCsv=require(_0x6889('0x9'));var querystring=require('querystring');var Papa=require(_0x6889('0xe'));var Redis=require(_0x6889('0xf'));var authService=require(_0x6889('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6889('0x11'));var logger=require(_0x6889('0x12'))(_0x6889('0x13'));var utils=require(_0x6889('0x14'));var config=require(_0x6889('0x15'));var licenseUtil=require(_0x6889('0x16'));var db=require(_0x6889('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x6889('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6889('0x19')]));require(_0x6889('0x1a'))[_0x6889('0x1b')](socket);function respondWithStatusCode(_0x84383a,_0xb37e62){_0xb37e62=_0xb37e62||0xcc;return function(_0x2ab0bd){if(_0x2ab0bd){return _0x84383a[_0x6889('0x1c')](_0xb37e62);}return _0x84383a[_0x6889('0x1d')](_0xb37e62)['end']();};}function respondWithResult(_0x1478ac,_0x23cc5b){_0x23cc5b=_0x23cc5b||0xc8;return function(_0x5f5b40){if(_0x5f5b40){return _0x1478ac[_0x6889('0x1d')](_0x23cc5b)['json'](_0x5f5b40);}};}function respondWithFilteredResult(_0x98d3d9,_0x1b7320){return function(_0x55ad40){if(_0x55ad40){var _0x179b2a=typeof _0x1b7320[_0x6889('0x1e')]===_0x6889('0x1f')&&typeof _0x1b7320[_0x6889('0x20')]===_0x6889('0x1f');var _0x3c6868=_0x55ad40[_0x6889('0x21')];var _0x40ed21=_0x179b2a?0x0:_0x1b7320[_0x6889('0x1e')];var _0x1c3184=_0x179b2a?_0x55ad40[_0x6889('0x21')]:_0x1b7320[_0x6889('0x1e')]+_0x1b7320[_0x6889('0x20')];var _0x173817;if(_0x1c3184>=_0x3c6868){_0x1c3184=_0x3c6868;_0x173817=0xc8;}else{_0x173817=0xce;}_0x98d3d9[_0x6889('0x1d')](_0x173817);return _0x98d3d9['set'](_0x6889('0x22'),_0x40ed21+'-'+_0x1c3184+'/'+_0x3c6868)[_0x6889('0x23')](_0x55ad40);}return null;};}function patchUpdates(_0xdef17b){return function(_0x73ec13){try{jsonpatch['apply'](_0x73ec13,_0xdef17b,!![]);}catch(_0x3c8fca){return BPromise['reject'](_0x3c8fca);}return _0x73ec13['save']();};}function saveUpdates(_0x5190d5,_0x2fcf2c){return function(_0x4477a5){if(_0x4477a5){return _0x4477a5[_0x6889('0x24')](_0x5190d5)[_0x6889('0x25')](function(_0x4415a6){return _0x4415a6;});}return null;};}function removeEntity(_0xaf1b6d,_0x4c999b){return function(_0x123646){if(_0x123646){return _0x123646[_0x6889('0x26')]()[_0x6889('0x25')](function(){_0xaf1b6d[_0x6889('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x161e74,_0x3d7295){return function(_0x24be9d){if(!_0x24be9d){_0x161e74[_0x6889('0x1c')](0x194);}return _0x24be9d;};}function handleError(_0x457372,_0x14c02e){_0x14c02e=_0x14c02e||0x1f4;return function(_0x45a8e2){logger[_0x6889('0x27')](_0x45a8e2[_0x6889('0x28')]);if(_0x45a8e2[_0x6889('0x29')]){delete _0x45a8e2[_0x6889('0x29')];}_0x457372[_0x6889('0x1d')](_0x14c02e)[_0x6889('0x2a')](_0x45a8e2);};}exports[_0x6889('0x2b')]=function(_0xbab1a4,_0x5bba56){var _0x4ab65a={},_0x275b21={},_0x34c964={'count':0x0,'rows':[]};var _0x592d4e=_[_0x6889('0x2c')](db[_0x6889('0x2d')]['rawAttributes'],function(_0x20649c){return{'name':_0x20649c['fieldName'],'type':_0x20649c[_0x6889('0x2e')][_0x6889('0x2f')]};});_0x275b21[_0x6889('0x30')]=_[_0x6889('0x2c')](_0x592d4e,_0x6889('0x29'));_0x275b21[_0x6889('0x31')]=_[_0x6889('0x32')](_0xbab1a4[_0x6889('0x31')]);_0x275b21[_0x6889('0x33')]=_[_0x6889('0x34')](_0x275b21['model'],_0x275b21['query']);_0x4ab65a['attributes']=_[_0x6889('0x34')](_0x275b21[_0x6889('0x30')],qs['fields'](_0xbab1a4[_0x6889('0x31')][_0x6889('0x35')]));_0x4ab65a['attributes']=_0x4ab65a[_0x6889('0x36')][_0x6889('0x37')]?_0x4ab65a[_0x6889('0x36')]:_0x275b21[_0x6889('0x30')];if(!_0xbab1a4[_0x6889('0x31')]['hasOwnProperty']('nolimit')){_0x4ab65a[_0x6889('0x20')]=qs[_0x6889('0x20')](_0xbab1a4[_0x6889('0x31')]['limit']);_0x4ab65a[_0x6889('0x1e')]=qs[_0x6889('0x1e')](_0xbab1a4[_0x6889('0x31')]['offset']);}_0x4ab65a[_0x6889('0x38')]=qs[_0x6889('0x39')](_0xbab1a4['query']['sort']);_0x4ab65a['where']=qs['filters'](_[_0x6889('0x3a')](_0xbab1a4[_0x6889('0x31')],_0x275b21['filters']),_0x592d4e);if(_0xbab1a4[_0x6889('0x31')][_0x6889('0x3b')]){_0x4ab65a[_0x6889('0x3c')]=_[_0x6889('0x3d')](_0x4ab65a[_0x6889('0x3c')],{'$or':_[_0x6889('0x2c')](_0x592d4e,function(_0x1a9ebb){if(_0x1a9ebb[_0x6889('0x2e')]!=='VIRTUAL'){var _0x37523a={};_0x37523a[_0x1a9ebb['name']]={'$like':'%'+_0xbab1a4[_0x6889('0x31')][_0x6889('0x3b')]+'%'};return _0x37523a;}})});}_0x4ab65a=_[_0x6889('0x3d')]({},_0x4ab65a,_0xbab1a4[_0x6889('0x3e')]);var _0x1dfdb4={'where':_0x4ab65a['where']};return db[_0x6889('0x2d')][_0x6889('0x21')](_0x1dfdb4)['then'](function(_0xca753a){_0x34c964[_0x6889('0x21')]=_0xca753a;if(_0xbab1a4[_0x6889('0x31')][_0x6889('0x3f')]){_0x4ab65a[_0x6889('0x40')]=[{'all':!![]}];}return db[_0x6889('0x2d')][_0x6889('0x41')](_0x4ab65a);})['then'](function(_0x22587b){_0x34c964[_0x6889('0x42')]=_0x22587b;return _0x34c964;})[_0x6889('0x25')](respondWithFilteredResult(_0x5bba56,_0x4ab65a))[_0x6889('0x43')](handleError(_0x5bba56,null));};exports['show']=function(_0x143caf,_0x59b76c){var _0xfd8dde={'raw':!![],'where':{'id':_0x143caf[_0x6889('0x44')]['id']}},_0x339cb1={};_0x339cb1[_0x6889('0x30')]=_[_0x6889('0x32')](db[_0x6889('0x2d')]['rawAttributes']);_0x339cb1['query']=_[_0x6889('0x32')](_0x143caf[_0x6889('0x31')]);_0x339cb1['filters']=_[_0x6889('0x34')](_0x339cb1['model'],_0x339cb1['query']);_0xfd8dde['attributes']=_['intersection'](_0x339cb1[_0x6889('0x30')],qs[_0x6889('0x35')](_0x143caf[_0x6889('0x31')][_0x6889('0x35')]));_0xfd8dde[_0x6889('0x36')]=_0xfd8dde['attributes'][_0x6889('0x37')]?_0xfd8dde[_0x6889('0x36')]:_0x339cb1[_0x6889('0x30')];if(_0x143caf[_0x6889('0x31')]['includeAll']){_0xfd8dde[_0x6889('0x40')]=[{'all':!![]}];}_0xfd8dde=_[_0x6889('0x3d')]({},_0xfd8dde,_0x143caf[_0x6889('0x3e')]);return db['ChatInternalMessage']['find'](_0xfd8dde)['then'](handleEntityNotFound(_0x59b76c,null))[_0x6889('0x25')](respondWithResult(_0x59b76c,null))['catch'](handleError(_0x59b76c,null));};exports['create']=function(_0x2ab876,_0x58ce32){return db[_0x6889('0x2d')]['create'](_0x2ab876[_0x6889('0x45')],{})[_0x6889('0x25')](respondWithResult(_0x58ce32,0xc9))[_0x6889('0x43')](handleError(_0x58ce32,null));};exports[_0x6889('0x24')]=function(_0x59cf49,_0x50952d){if(_0x59cf49['body']['id']){delete _0x59cf49[_0x6889('0x45')]['id'];}return db[_0x6889('0x2d')][_0x6889('0x46')]({'where':{'id':_0x59cf49[_0x6889('0x44')]['id']}})['then'](handleEntityNotFound(_0x50952d,null))['then'](saveUpdates(_0x59cf49[_0x6889('0x45')],null))[_0x6889('0x25')](respondWithResult(_0x50952d,null))[_0x6889('0x43')](handleError(_0x50952d,null));};exports[_0x6889('0x26')]=function(_0x490d20,_0xb19d01){return db[_0x6889('0x2d')][_0x6889('0x46')]({'where':{'id':_0x490d20[_0x6889('0x44')]['id']}})[_0x6889('0x25')](handleEntityNotFound(_0xb19d01,null))[_0x6889('0x25')](removeEntity(_0xb19d01,null))[_0x6889('0x43')](handleError(_0xb19d01,null));};exports[_0x6889('0x47')]=function(_0x5793fd,_0xa384b4){return db['ChatInternalMessage'][_0x6889('0x47')]()['then'](respondWithResult(_0xa384b4,null))[_0x6889('0x43')](handleError(_0xa384b4,null));};function wrapUser(_0x290be6){return function(_0x291ec1){var _0x536541=_0x290be6[_0x6889('0x48')]({'plain':!![]});_0x536541[_0x6889('0x49')]=[];if(_0x291ec1){_0x536541[_0x6889('0x4a')]=_0x291ec1[_0x6889('0x4b')];_0x536541[_0x6889('0x4c')]=_0x291ec1;}else{_0x536541[_0x6889('0x4a')]=moment(0x0)[_0x6889('0x4d')](_0x6889('0x4e'));_0x536541[_0x6889('0x4c')]={};}return _0x536541;};}exports['getUsers']=function(_0x270a8c,_0x2c093c,_0x32d8df){var _0x212c25=[];return db['User'][_0x6889('0x41')]({'where':{'role':[_0x6889('0x4f'),_0x6889('0x50'),_0x6889('0x51')]},'attributes':['id',_0x6889('0x52'),'name',_0x6889('0x53'),_0x6889('0x54'),_0x6889('0x55'),_0x6889('0x56'),_0x6889('0x57'),_0x6889('0x58'),'showWebBar'],'order':qs[_0x6889('0x39')]('-online'),'include':[{'model':db[_0x6889('0x59')],'as':_0x6889('0x5a'),'attributes':['id',_0x6889('0x29'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x820ac8){if(_0x820ac8){var _0x72a89d=_0x270a8c['user'][_0x6889('0x48')]({'plain':!![]});if(!_0x72a89d)throw new Error(_0x6889('0x5b'));if(_0x72a89d['role']===_0x6889('0x51')){return db['UserProfileSection'][_0x6889('0x46')]({'where':{'name':_0x6889('0x5c'),'userProfileId':_0x72a89d[_0x6889('0x5d')]},'raw':!![]})['then'](function(_0x297368){if(_0x297368){if(_0x297368[_0x6889('0x5e')]===0x0){return db[_0x6889('0x5f')][_0x6889('0x41')]({'where':{'sectionId':_0x297368['id']},'raw':!![]})['then'](function(_0xa49962){var _0x144baa=[];if(_[_0x6889('0x60')](_0xa49962)){_0x144baa=_[_0x6889('0x3b')](_0x820ac8,function(_0x3ef123){if(_0x3ef123[_0x6889('0x53')]!==_0x6889('0x4f')){return _0x3ef123;}});return _0x144baa;}else{for(var _0x104151=0x0;_0x104151<_0x820ac8[_0x6889('0x37')];_0x104151++){var _0x795b5f=_0x820ac8[_0x104151];if(_0x795b5f[_0x6889('0x53')]===_0x6889('0x4f')){var _0x27c8d1=_[_0x6889('0x46')](_0xa49962,function(_0x114246){return _0x114246[_0x6889('0x61')]===_0x795b5f['id'];});if(_0x27c8d1)_0x144baa[_0x6889('0x62')](_0x795b5f);}else{_0x144baa[_0x6889('0x62')](_0x795b5f);}}return _0x144baa;}});}else{return _0x820ac8;}}else{var _0x1972e4=_[_0x6889('0x3b')](_0x820ac8,function(_0x53efc3){if(_0x53efc3[_0x6889('0x53')]!==_0x6889('0x4f')){return _0x53efc3;}});return _0x1972e4;}});}else{return _0x820ac8;}}})[_0x6889('0x25')](function(_0x2cb950){var _0x52937a=[];if(_0x2cb950){_0x212c25=_0x2cb950;for(var _0x4bf8c1=0x0;_0x4bf8c1<_0x2cb950['length'];_0x4bf8c1+=0x1){_0x212c25[_0x4bf8c1]['messages']=[];_0x52937a[_0x6889('0x62')](db[_0x6889('0x2d')][_0x6889('0x46')]({'where':{'FromId':[_0x270a8c[_0x6889('0x51')]['id'],_0x2cb950[_0x4bf8c1]['id']],'ToId':[_0x270a8c[_0x6889('0x51')]['id'],_0x2cb950[_0x4bf8c1]['id']],'ChatGroupId':null},'attributes':['id',_0x6889('0x4b'),_0x6889('0x63'),_0x6889('0x64'),'read',_0x6889('0x45')],'order':qs[_0x6889('0x39')](_0x6889('0x65')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x2cb950[_0x4bf8c1])));}return BPromise['all'](_0x52937a);}return[];})[_0x6889('0x25')](function(_0x329d38){return{'rows':_0x329d38,'count':_0x329d38[_0x6889('0x37')]};})[_0x6889('0x25')](respondWithResult(_0x2c093c,null))['catch'](handleError(_0x2c093c,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index a6b2b2b..1937747 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 _0x0ad9=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x160bb3,_0x358b11){var _0x3b1003=function(_0x28886d){while(--_0x28886d){_0x160bb3['push'](_0x160bb3['shift']());}};_0x3b1003(++_0x358b11);}(_0x0ad9,0x9f));var _0x90ad=function(_0x4cbc97,_0x553a7f){_0x4cbc97=_0x4cbc97-0x0;var _0x1ab60e=_0x0ad9[_0x4cbc97];return _0x1ab60e;};'use strict';var EventEmitter=require(_0x90ad('0x0'));var ChatInternalMessage=require(_0x90ad('0x1'))['db'][_0x90ad('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x90ad('0x3')](0x0);var events={'afterCreate':_0x90ad('0x4'),'afterUpdate':_0x90ad('0x5'),'afterDestroy':_0x90ad('0x6')};function emitEvent(_0x4529aa){return function(_0xb15d53,_0x4353a0,_0x5230f2){ChatInternalMessageEvents[_0x90ad('0x7')](_0x4529aa+':'+_0xb15d53['id'],_0xb15d53);ChatInternalMessageEvents[_0x90ad('0x7')](_0x4529aa,_0xb15d53);_0x5230f2(null);};}for(var e in events){if(events[_0x90ad('0x8')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x90ad('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xe033=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x331298,_0x12341a){var _0x3824bc=function(_0x19449f){while(--_0x19449f){_0x331298['push'](_0x331298['shift']());}};_0x3824bc(++_0x12341a);}(_0xe033,0x161));var _0x3e03=function(_0x38ee62,_0x2d38da){_0x38ee62=_0x38ee62-0x0;var _0x3e677f=_0xe033[_0x38ee62];return _0x3e677f;};'use strict';var EventEmitter=require(_0x3e03('0x0'));var ChatInternalMessage=require(_0x3e03('0x1'))['db'][_0x3e03('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3e03('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3e03('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3f3985){return function(_0x4119cb,_0x4d02e1,_0x40b4c4){ChatInternalMessageEvents[_0x3e03('0x5')](_0x3f3985+':'+_0x4119cb['id'],_0x4119cb);ChatInternalMessageEvents[_0x3e03('0x5')](_0x3f3985,_0x4119cb);_0x40b4c4(null);};}for(var e in events){if(events[_0x3e03('0x6')](e)){var event=events[e];ChatInternalMessage[_0x3e03('0x7')](e,emitEvent(event));}}module[_0x3e03('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index f579c2b..54b25d9 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 _0xa2ab=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','define','chat_internal_messages','utf8mb4','util'];(function(_0x5a6b16,_0x4c22ef){var _0x54f033=function(_0x24d8d3){while(--_0x24d8d3){_0x5a6b16['push'](_0x5a6b16['shift']());}};_0x54f033(++_0x4c22ef);}(_0xa2ab,0x18b));var _0xba2a=function(_0x1edea9,_0x4b9a1b){_0x1edea9=_0x1edea9-0x0;var _0xf0ac12=_0xa2ab[_0x1edea9];return _0xf0ac12;};'use strict';var _=require('lodash');var util=require(_0xba2a('0x0'));var logger=require(_0xba2a('0x1'))(_0xba2a('0x2'));var moment=require(_0xba2a('0x3'));var BPromise=require(_0xba2a('0x4'));var rp=require(_0xba2a('0x5'));var fs=require('fs');var path=require(_0xba2a('0x6'));var rimraf=require('rimraf');var config=require(_0xba2a('0x7'));var attributes=require(_0xba2a('0x8'));module['exports']=function(_0x279bfe,_0x46ba15){return _0x279bfe[_0xba2a('0x9')]('ChatInternalMessage',attributes,{'tableName':_0xba2a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xba2a('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x00fc=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define'];(function(_0x99c3b9,_0x1ff031){var _0x5e08da=function(_0x10452c){while(--_0x10452c){_0x99c3b9['push'](_0x99c3b9['shift']());}};_0x5e08da(++_0x1ff031);}(_0x00fc,0x153));var _0xc00f=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0x00fc[_0x28394f];return _0x2618d2;};'use strict';var _=require(_0xc00f('0x0'));var util=require(_0xc00f('0x1'));var logger=require('../../config/logger')(_0xc00f('0x2'));var moment=require('moment');var BPromise=require(_0xc00f('0x3'));var rp=require(_0xc00f('0x4'));var fs=require('fs');var path=require(_0xc00f('0x5'));var rimraf=require(_0xc00f('0x6'));var config=require(_0xc00f('0x7'));var attributes=require(_0xc00f('0x8'));module[_0xc00f('0x9')]=function(_0x5a8ca8,_0x59b20c){return _0x5a8ca8[_0xc00f('0xa')]('ChatInternalMessage',attributes,{'tableName':_0xc00f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc00f('0xc'),'collate':_0xc00f('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index c02880e..962b9b9 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 _0xc6b4=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2b8281,_0x251e26){var _0x380e28=function(_0x583006){while(--_0x583006){_0x2b8281['push'](_0x2b8281['shift']());}};_0x380e28(++_0x251e26);}(_0xc6b4,0x1aa));var _0x4c6b=function(_0x48e921,_0x20cf98){_0x48e921=_0x48e921-0x0;var _0x4986fe=_0xc6b4[_0x48e921];return _0x4986fe;};'use strict';var _=require(_0x4c6b('0x0'));var util=require('util');var moment=require(_0x4c6b('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c6b('0x2'));var fs=require('fs');var Redis=require(_0x4c6b('0x3'));var db=require(_0x4c6b('0x4'))['db'];var utils=require(_0x4c6b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4c6b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4c6b('0x7')][_0x4c6b('0x8')]({'port':0x232a});config[_0x4c6b('0x9')]=_[_0x4c6b('0xa')](config['redis'],{'host':_0x4c6b('0xb'),'port':0x18eb});var socket=require(_0x4c6b('0xc'))(new Redis(config[_0x4c6b('0x9')]));require(_0x4c6b('0xd'))[_0x4c6b('0xe')](socket);function respondWithRpcPromise(_0x2a3238,_0xfe06ee,_0xf67a29){return new BPromise(function(_0x587139,_0x4225b1){return client['request'](_0x2a3238,_0xf67a29)[_0x4c6b('0xf')](function(_0x5e9ed2){logger[_0x4c6b('0x10')](_0x4c6b('0x11'),_0xfe06ee,'request\x20sent');logger['debug'](_0x4c6b('0x12'),_0xfe06ee,'request\x20sent',JSON['stringify'](_0x5e9ed2));if(_0x5e9ed2['error']){if(_0x5e9ed2['error']['code']===0x1f4){logger[_0x4c6b('0x13')](_0x4c6b('0x11'),_0xfe06ee,_0x5e9ed2['error'][_0x4c6b('0x14')]);return _0x4225b1(_0x5e9ed2[_0x4c6b('0x13')]['message']);}logger[_0x4c6b('0x13')](_0x4c6b('0x11'),_0xfe06ee,_0x5e9ed2[_0x4c6b('0x13')][_0x4c6b('0x14')]);return _0x587139(_0x5e9ed2[_0x4c6b('0x13')][_0x4c6b('0x14')]);}else{logger[_0x4c6b('0x10')](_0x4c6b('0x11'),_0xfe06ee,_0x4c6b('0x15'));_0x587139(_0x5e9ed2[_0x4c6b('0x16')]['message']);}})[_0x4c6b('0x17')](function(_0x52cca3){logger[_0x4c6b('0x13')](_0x4c6b('0x11'),_0xfe06ee,_0x52cca3);_0x4225b1(_0x52cca3);});});}
\ No newline at end of file
+var _0x9374=['defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','info','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','http','redis'];(function(_0x1e8d54,_0x334a60){var _0x58c69f=function(_0x52abc){while(--_0x52abc){_0x1e8d54['push'](_0x1e8d54['shift']());}};_0x58c69f(++_0x334a60);}(_0x9374,0x1ac));var _0x4937=function(_0x2ae0bf,_0x41bd97){_0x2ae0bf=_0x2ae0bf-0x0;var _0x41480c=_0x9374[_0x2ae0bf];return _0x41480c;};'use strict';var _=require('lodash');var util=require(_0x4937('0x0'));var moment=require(_0x4937('0x1'));var BPromise=require(_0x4937('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4937('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4937('0x4'));var logger=require(_0x4937('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4937('0x6'));var client=jayson['client'][_0x4937('0x7')]({'port':0x232a});config[_0x4937('0x8')]=_[_0x4937('0x9')](config[_0x4937('0x8')],{'host':_0x4937('0xa'),'port':0x18eb});var socket=require(_0x4937('0xb'))(new Redis(config[_0x4937('0x8')]));require(_0x4937('0xc'))[_0x4937('0xd')](socket);function respondWithRpcPromise(_0x3a0757,_0x4423af,_0x3654bb){return new BPromise(function(_0x1a3877,_0x2dcb13){return client['request'](_0x3a0757,_0x3654bb)[_0x4937('0xe')](function(_0x44e06b){logger['info'](_0x4937('0xf'),_0x4423af,_0x4937('0x10'));logger[_0x4937('0x11')](_0x4937('0x12'),_0x4423af,_0x4937('0x10'),JSON['stringify'](_0x44e06b));if(_0x44e06b[_0x4937('0x13')]){if(_0x44e06b[_0x4937('0x13')]['code']===0x1f4){logger[_0x4937('0x13')](_0x4937('0xf'),_0x4423af,_0x44e06b[_0x4937('0x13')][_0x4937('0x14')]);return _0x2dcb13(_0x44e06b['error'][_0x4937('0x14')]);}logger[_0x4937('0x13')](_0x4937('0xf'),_0x4423af,_0x44e06b['error'][_0x4937('0x14')]);return _0x1a3877(_0x44e06b[_0x4937('0x13')][_0x4937('0x14')]);}else{logger[_0x4937('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x4423af,'request\x20sent');_0x1a3877(_0x44e06b['result'][_0x4937('0x14')]);}})[_0x4937('0x16')](function(_0x2d0f2b){logger[_0x4937('0x13')](_0x4937('0xf'),_0x4423af,_0x2d0f2b);_0x2dcb13(_0x2d0f2b);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 2015fa7..53e79c0 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 _0x18ab=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x52097c,_0x42d6a2){var _0x180642=function(_0xeabc6b){while(--_0xeabc6b){_0x52097c['push'](_0x52097c['shift']());}};_0x180642(++_0x42d6a2);}(_0x18ab,0x178));var _0xb18a=function(_0x4fde02,_0x565a82){_0x4fde02=_0x4fde02-0x0;var _0x4c2581=_0x18ab[_0x4fde02];return _0x4c2581;};'use strict';var ChatInternalMessageEvents=require(_0xb18a('0x0'));var events=[_0xb18a('0x1'),'remove','update'];function createListener(_0x2792de,_0x3eb087){return function(_0x5cf955){_0x3eb087[_0xb18a('0x2')](_0x2792de,_0x5cf955);};}function removeListener(_0x212db2,_0x5c6320){return function(){ChatInternalMessageEvents[_0xb18a('0x3')](_0x212db2,_0x5c6320);};}exports[_0xb18a('0x4')]=function(_0x3720f9){for(var _0x2fd533=0x0,_0x55c826=events[_0xb18a('0x5')];_0x2fd533<_0x55c826;_0x2fd533++){var _0x4c8677=events[_0x2fd533];var _0x4c1b58=createListener(_0xb18a('0x6')+_0x4c8677,_0x3720f9);ChatInternalMessageEvents['on'](_0x4c8677,_0x4c1b58);}};
\ No newline at end of file
+var _0x5ef8=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5ef8,0xd9));var _0x85ef=function(_0x12f831,_0x28c91f){_0x12f831=_0x12f831-0x0;var _0x635103=_0x5ef8[_0x12f831];return _0x635103;};'use strict';var ChatInternalMessageEvents=require(_0x85ef('0x0'));var events=[_0x85ef('0x1'),_0x85ef('0x2'),_0x85ef('0x3')];function createListener(_0x11d344,_0x2cb43d){return function(_0x483ad2){_0x2cb43d[_0x85ef('0x4')](_0x11d344,_0x483ad2);};}function removeListener(_0x5a1c33,_0x4ef647){return function(){ChatInternalMessageEvents[_0x85ef('0x5')](_0x5a1c33,_0x4ef647);};}exports[_0x85ef('0x6')]=function(_0x3bcbd9){for(var _0x5a2650=0x0,_0x379b66=events[_0x85ef('0x7')];_0x5a2650<_0x379b66;_0x5a2650++){var _0x27da47=events[_0x5a2650];var _0x29eb04=createListener(_0x85ef('0x8')+_0x27da47,_0x3bcbd9);ChatInternalMessageEvents['on'](_0x27da47,_0x29eb04);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index b296640..4679e7a 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 _0xa143=['isAuthenticated','index','get','/describe','describe','/users','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x465a18,_0x5f3867){var _0x43c605=function(_0xa58132){while(--_0xa58132){_0x465a18['push'](_0x465a18['shift']());}};_0x43c605(++_0x5f3867);}(_0xa143,0x69));var _0x3a14=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa143[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x3a14('0x0'));var util=require(_0x3a14('0x1'));var path=require(_0x3a14('0x2'));var timeout=require(_0x3a14('0x3'));var express=require(_0x3a14('0x4'));var router=express[_0x3a14('0x5')]();var fs_extra=require(_0x3a14('0x6'));var auth=require(_0x3a14('0x7'));var interaction=require(_0x3a14('0x8'));var config=require(_0x3a14('0x9'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x3a14('0xa')](),controller[_0x3a14('0xb')]);router[_0x3a14('0xc')](_0x3a14('0xd'),auth['isAuthenticated'](),controller[_0x3a14('0xe')]);router['get'](_0x3a14('0xf'),auth['isAuthenticated'](),controller['getUsers']);router['get'](_0x3a14('0x10'),auth[_0x3a14('0xa')](),controller[_0x3a14('0x11')]);router[_0x3a14('0x12')]('/',auth[_0x3a14('0xa')](),controller[_0x3a14('0x13')]);router['put']('/:id',controller[_0x3a14('0x14')]);router['delete'](_0x3a14('0x10'),auth[_0x3a14('0xa')](),controller[_0x3a14('0x15')]);module[_0x3a14('0x16')]=router;
\ No newline at end of file
+var _0x90a1=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x453211,_0x4b8cd9){var _0x526453=function(_0x1ba196){while(--_0x1ba196){_0x453211['push'](_0x453211['shift']());}};_0x526453(++_0x4b8cd9);}(_0x90a1,0xae));var _0x190a=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x90a1[_0x20ef64];return _0x3707d8;};'use strict';var multer=require(_0x190a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x190a('0x1'));var express=require(_0x190a('0x2'));var router=express[_0x190a('0x3')]();var fs_extra=require(_0x190a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x190a('0x5'));var config=require(_0x190a('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x190a('0x7')]('/',auth[_0x190a('0x8')](),controller[_0x190a('0x9')]);router[_0x190a('0x7')](_0x190a('0xa'),auth[_0x190a('0x8')](),controller[_0x190a('0xb')]);router[_0x190a('0x7')]('/users',auth['isAuthenticated'](),controller['getUsers']);router[_0x190a('0x7')](_0x190a('0xc'),auth[_0x190a('0x8')](),controller['show']);router['post']('/',auth[_0x190a('0x8')](),controller[_0x190a('0xd')]);router[_0x190a('0xe')](_0x190a('0xc'),controller[_0x190a('0xf')]);router[_0x190a('0x10')]('/:id',auth[_0x190a('0x8')](),controller['destroy']);module[_0x190a('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index b42de69..421ef04 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 _0x6f59=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x30e41d,_0x3133e2){var _0x372be4=function(_0x33a4db){while(--_0x33a4db){_0x30e41d['push'](_0x30e41d['shift']());}};_0x372be4(++_0x3133e2);}(_0x6f59,0x1be));var _0x96f5=function(_0x39855e,_0x303c7d){_0x39855e=_0x39855e-0x0;var _0x1e25ce=_0x6f59[_0x39855e];return _0x1e25ce;};'use strict';var Sequelize=require(_0x96f5('0x0'));module[_0x96f5('0x1')]={'body':{'type':Sequelize[_0x96f5('0x2')](_0x96f5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x96f5('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x96f5('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x96f5('0x5')]('in',_0x96f5('0x6')),'defaultValue':_0x96f5('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x96f5('0x7')]},'providerName':{'type':Sequelize[_0x96f5('0x8')]},'providerResponse':{'type':Sequelize[_0x96f5('0x2')]}};
\ No newline at end of file
+var _0x6000=['out','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6000,0x17c));var _0x0600=function(_0x47515d,_0x3aa091){_0x47515d=_0x47515d-0x0;var _0x179f7c=_0x6000[_0x47515d];return _0x179f7c;};'use strict';var Sequelize=require(_0x0600('0x0'));module[_0x0600('0x1')]={'body':{'type':Sequelize[_0x0600('0x2')](_0x0600('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x0600('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x0600('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x0600('0x5')),'defaultValue':_0x0600('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x0600('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 7a83c19..c7c3b1b 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 _0x3885=['rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','ChatMessage','then','includeAll','findAll','rows','show','params','length','include','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','formData','reject','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','event','rejectmessage','eml-format'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x3885,0x19d));var _0x5388=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3885[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x5388('0x0'));var rimraf=require(_0x5388('0x1'));var zipdir=require(_0x5388('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5388('0x3'));var BPromise=require(_0x5388('0x4'));var Mustache=require(_0x5388('0x5'));var util=require('util');var path=require(_0x5388('0x6'));var sox=require(_0x5388('0x7'));var csv=require(_0x5388('0x8'));var ejs=require(_0x5388('0x9'));var fs=require('fs');var fs_extra=require(_0x5388('0xa'));var _=require(_0x5388('0xb'));var squel=require(_0x5388('0xc'));var crypto=require(_0x5388('0xd'));var jsforce=require(_0x5388('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5388('0x8'));var querystring=require(_0x5388('0xf'));var Papa=require(_0x5388('0x10'));var Redis=require(_0x5388('0x11'));var authService=require(_0x5388('0x12'));var qs=require(_0x5388('0x13'));var as=require(_0x5388('0x14'));var hardwareService=require(_0x5388('0x15'));var logger=require(_0x5388('0x16'))(_0x5388('0x17'));var utils=require(_0x5388('0x18'));var config=require(_0x5388('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5388('0x1a'))['db'];config[_0x5388('0x1b')]=_[_0x5388('0x1c')](config[_0x5388('0x1b')],{'host':_0x5388('0x1d'),'port':0x18eb});var socket=require(_0x5388('0x1e'))(new Redis(config[_0x5388('0x1b')]));require(_0x5388('0x1f'))[_0x5388('0x20')](socket);var jayson=require(_0x5388('0x21'));var client=jayson[_0x5388('0x22')][_0x5388('0x23')]({'port':0x232c});var client9002=jayson['client'][_0x5388('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x5802fb,_0x399e9c,_0x516854,_0x251d44){return new BPromise(function(_0x4d1364,_0x3bb675){var _0x1911f3=_0x251d44||client;return _0x1911f3['request'](_0x5802fb,_0x516854)['then'](function(_0x389b2b){logger['info']('ChatMessage,\x20%s,\x20%s',_0x399e9c,_0x5388('0x24'));logger[_0x5388('0x25')](_0x5388('0x26'),_0x399e9c,_0x5388('0x24'),JSON['stringify'](_0x389b2b));if(_0x389b2b['error']){if(_0x389b2b[_0x5388('0x27')]['code']===0x1f4){logger[_0x5388('0x27')](_0x5388('0x28'),_0x399e9c,_0x389b2b[_0x5388('0x27')]['message']);return _0x3bb675(_0x389b2b[_0x5388('0x27')][_0x5388('0x29')]);}logger[_0x5388('0x27')](_0x5388('0x28'),_0x399e9c,_0x389b2b['error'][_0x5388('0x29')]);return _0x4d1364(_0x389b2b[_0x5388('0x27')][_0x5388('0x29')]);}else{logger['info'](_0x5388('0x28'),_0x399e9c,'request\x20sent');_0x4d1364(_0x389b2b[_0x5388('0x2a')][_0x5388('0x29')]);}})[_0x5388('0x2b')](function(_0x255f46){logger[_0x5388('0x27')](_0x5388('0x28'),_0x399e9c,_0x255f46);_0x3bb675(_0x255f46);});});}function respondWithStatusCode(_0x186824,_0x3e8c70){_0x3e8c70=_0x3e8c70||0xcc;return function(_0x4f9445){if(_0x4f9445){return _0x186824[_0x5388('0x2c')](_0x3e8c70);}return _0x186824[_0x5388('0x2d')](_0x3e8c70)[_0x5388('0x2e')]();};}function respondWithResult(_0x564d2f,_0x474f21){_0x474f21=_0x474f21||0xc8;return function(_0x491699){if(_0x491699){return _0x564d2f[_0x5388('0x2d')](_0x474f21)[_0x5388('0x2f')](_0x491699);}};}function respondWithFilteredResult(_0x23a143,_0x54eeab){return function(_0x218bfe){if(_0x218bfe){var _0x208073=typeof _0x54eeab[_0x5388('0x30')]===_0x5388('0x31')&&typeof _0x54eeab[_0x5388('0x32')]===_0x5388('0x31');var _0xb58f6=_0x218bfe['count'];var _0x4f5feb=_0x208073?0x0:_0x54eeab[_0x5388('0x30')];var _0x229a19=_0x208073?_0x218bfe[_0x5388('0x33')]:_0x54eeab[_0x5388('0x30')]+_0x54eeab[_0x5388('0x32')];var _0x1ab068;if(_0x229a19>=_0xb58f6){_0x229a19=_0xb58f6;_0x1ab068=0xc8;}else{_0x1ab068=0xce;}_0x23a143['status'](_0x1ab068);return _0x23a143[_0x5388('0x34')]('Content-Range',_0x4f5feb+'-'+_0x229a19+'/'+_0xb58f6)['json'](_0x218bfe);}return null;};}function patchUpdates(_0x2728dd){return function(_0x59abb9){try{jsonpatch[_0x5388('0x35')](_0x59abb9,_0x2728dd,!![]);}catch(_0x5158eb){return BPromise['reject'](_0x5158eb);}return _0x59abb9[_0x5388('0x36')]();};}function saveUpdates(_0x1333fa,_0x59a983){return function(_0x511726){if(_0x511726){return _0x511726[_0x5388('0x37')](_0x1333fa)['then'](function(_0x12c30f){return _0x12c30f;});}return null;};}function removeEntity(_0x1b860b,_0x2f71d9){return function(_0x5b748e){if(_0x5b748e){return _0x5b748e[_0x5388('0x38')]()['then'](function(){_0x1b860b['status'](0xcc)[_0x5388('0x2e')]();});}};}function handleEntityNotFound(_0x3dcbf3,_0x3ed684){return function(_0x3eb95f){if(!_0x3eb95f){_0x3dcbf3['sendStatus'](0x194);}return _0x3eb95f;};}function handleError(_0x10ba5a,_0x472c82){_0x472c82=_0x472c82||0x1f4;return function(_0x3be834){logger[_0x5388('0x27')](_0x3be834[_0x5388('0x39')]);if(_0x3be834['name']){delete _0x3be834[_0x5388('0x3a')];}_0x10ba5a[_0x5388('0x2d')](_0x472c82)[_0x5388('0x3b')](_0x3be834);};}exports[_0x5388('0x3c')]=function(_0x25a3d4,_0x192c8c){var _0x5265ea={},_0xcef25c={},_0xc8599={'count':0x0,'rows':[]};var _0x1203de=_[_0x5388('0x3d')](db['ChatMessage'][_0x5388('0x3e')],function(_0x108ce5){return{'name':_0x108ce5[_0x5388('0x3f')],'type':_0x108ce5[_0x5388('0x40')]['key']};});_0xcef25c['model']=_[_0x5388('0x3d')](_0x1203de,'name');_0xcef25c[_0x5388('0x41')]=_[_0x5388('0x42')](_0x25a3d4['query']);_0xcef25c[_0x5388('0x43')]=_[_0x5388('0x44')](_0xcef25c[_0x5388('0x45')],_0xcef25c[_0x5388('0x41')]);_0x5265ea[_0x5388('0x46')]=_[_0x5388('0x44')](_0xcef25c[_0x5388('0x45')],qs['fields'](_0x25a3d4[_0x5388('0x41')][_0x5388('0x47')]));_0x5265ea[_0x5388('0x46')]=_0x5265ea[_0x5388('0x46')]['length']?_0x5265ea[_0x5388('0x46')]:_0xcef25c['model'];if(!_0x25a3d4[_0x5388('0x41')][_0x5388('0x48')]('nolimit')){_0x5265ea['limit']=qs['limit'](_0x25a3d4[_0x5388('0x41')]['limit']);_0x5265ea[_0x5388('0x30')]=qs['offset'](_0x25a3d4[_0x5388('0x41')]['offset']);}_0x5265ea[_0x5388('0x49')]=qs['sort'](_0x25a3d4[_0x5388('0x41')][_0x5388('0x4a')]);_0x5265ea['where']=qs[_0x5388('0x43')](_[_0x5388('0x4b')](_0x25a3d4['query'],_0xcef25c[_0x5388('0x43')]),_0x1203de);if(_0x25a3d4[_0x5388('0x41')][_0x5388('0x4c')]){_0x5265ea['where']=_[_0x5388('0x4d')](_0x5265ea[_0x5388('0x4e')],{'$or':_[_0x5388('0x3d')](_0x1203de,function(_0x15a427){if(_0x15a427[_0x5388('0x40')]!==_0x5388('0x4f')){var _0x5c9748={};_0x5c9748[_0x15a427['name']]={'$like':'%'+_0x25a3d4[_0x5388('0x41')][_0x5388('0x4c')]+'%'};return _0x5c9748;}})});}_0x5265ea=_[_0x5388('0x4d')]({},_0x5265ea,_0x25a3d4[_0x5388('0x50')]);var _0x129327={'where':_0x5265ea[_0x5388('0x4e')]};return db[_0x5388('0x51')][_0x5388('0x33')](_0x129327)[_0x5388('0x52')](function(_0x10dea3){_0xc8599[_0x5388('0x33')]=_0x10dea3;if(_0x25a3d4[_0x5388('0x41')][_0x5388('0x53')]){_0x5265ea['include']=[{'all':!![]}];}return db[_0x5388('0x51')][_0x5388('0x54')](_0x5265ea);})[_0x5388('0x52')](function(_0x5c7c13){_0xc8599[_0x5388('0x55')]=_0x5c7c13;return _0xc8599;})[_0x5388('0x52')](respondWithFilteredResult(_0x192c8c,_0x5265ea))[_0x5388('0x2b')](handleError(_0x192c8c,null));};exports[_0x5388('0x56')]=function(_0x3510d7,_0x5ea13f){var _0x57f115={'raw':!![],'where':{'id':_0x3510d7[_0x5388('0x57')]['id']}},_0x43179e={};_0x43179e[_0x5388('0x45')]=_[_0x5388('0x42')](db['ChatMessage'][_0x5388('0x3e')]);_0x43179e[_0x5388('0x41')]=_[_0x5388('0x42')](_0x3510d7[_0x5388('0x41')]);_0x43179e[_0x5388('0x43')]=_[_0x5388('0x44')](_0x43179e['model'],_0x43179e[_0x5388('0x41')]);_0x57f115[_0x5388('0x46')]=_[_0x5388('0x44')](_0x43179e[_0x5388('0x45')],qs['fields'](_0x3510d7['query'][_0x5388('0x47')]));_0x57f115[_0x5388('0x46')]=_0x57f115[_0x5388('0x46')][_0x5388('0x58')]?_0x57f115[_0x5388('0x46')]:_0x43179e['model'];if(_0x3510d7[_0x5388('0x41')][_0x5388('0x53')]){_0x57f115[_0x5388('0x59')]=[{'all':!![]}];}_0x57f115=_['merge']({},_0x57f115,_0x3510d7[_0x5388('0x50')]);return db[_0x5388('0x51')][_0x5388('0x5a')](_0x57f115)[_0x5388('0x52')](handleEntityNotFound(_0x5ea13f,null))['then'](respondWithResult(_0x5ea13f,null))[_0x5388('0x2b')](handleError(_0x5ea13f,null));};exports[_0x5388('0x5b')]=function(_0x14c01a,_0x14e6c4){return db[_0x5388('0x51')][_0x5388('0x5b')](_0x14c01a[_0x5388('0x5c')],{})[_0x5388('0x52')](respondWithResult(_0x14e6c4,0xc9))[_0x5388('0x2b')](handleError(_0x14e6c4,null));};exports[_0x5388('0x37')]=function(_0x272587,_0x1dde6e){if(_0x272587['body']['id']){delete _0x272587['body']['id'];}return db[_0x5388('0x51')][_0x5388('0x5a')]({'where':{'id':_0x272587[_0x5388('0x57')]['id']}})[_0x5388('0x52')](handleEntityNotFound(_0x1dde6e,null))[_0x5388('0x52')](saveUpdates(_0x272587[_0x5388('0x5c')],null))['then'](respondWithResult(_0x1dde6e,null))[_0x5388('0x2b')](handleError(_0x1dde6e,null));};exports[_0x5388('0x38')]=function(_0x4d7b8a,_0x5c4297){return db['ChatMessage'][_0x5388('0x5a')]({'where':{'id':_0x4d7b8a['params']['id']}})[_0x5388('0x52')](handleEntityNotFound(_0x5c4297,null))['then'](removeEntity(_0x5c4297,null))[_0x5388('0x2b')](handleError(_0x5c4297,null));};exports[_0x5388('0x5d')]=function(_0x165211,_0x41fab8){return db[_0x5388('0x51')][_0x5388('0x5d')]()['then'](respondWithResult(_0x41fab8,null))[_0x5388('0x2b')](handleError(_0x41fab8,null));};var interaction_log=require(_0x5388('0x16'))(_0x5388('0x5e'));exports[_0x5388('0x5f')]=function(_0xa96605,_0x4a1521,_0x5a542f){var _0x2a763b={'agent':{},'channel':_0x5388('0x60')};if(_0xa96605[_0x5388('0x5c')]['id']){delete _0xa96605[_0x5388('0x5c')]['id'];}_0xa96605['body'][_0x5388('0x61')]=!![];_0xa96605[_0x5388('0x5c')][_0x5388('0x62')]=moment()[_0x5388('0x63')](_0x5388('0x64'));_0xa96605[_0x5388('0x5c')]['UserId']=_0xa96605[_0x5388('0x5c')][_0x5388('0x65')]||_0xa96605[_0x5388('0x66')]['id'];_0x2a763b[_0x5388('0x67')]['id']=_0xa96605[_0x5388('0x5c')]['UserId'];return db[_0x5388('0x51')]['find']({'where':{'id':_0xa96605[_0x5388('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4a1521,null))[_0x5388('0x52')](saveUpdates(_0xa96605[_0x5388('0x5c')],null))[_0x5388('0x52')](function(_0x470d62){if(_0x470d62){_0x2a763b[_0x5388('0x29')]=_0x470d62[_0x5388('0x68')]({'plain':!![]});return db[_0x5388('0x69')][_0x5388('0x5a')]({'where':{'id':_0x470d62['ChatInteractionId']}});}return null;})[_0x5388('0x52')](handleEntityNotFound(_0x4a1521,null))[_0x5388('0x52')](function(_0x5331e3){if(_0x5331e3){return _0x5331e3[_0x5388('0x37')]({'UserId':_0xa96605[_0x5388('0x5c')][_0x5388('0x65')],'read1stAt':_['isNil'](_0x5331e3['read1stAt'])?moment()[_0x5388('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5388('0x52')](function(_0x4faf35){if(_0x4faf35){_0x2a763b['interaction']=_0x4faf35[_0x5388('0x68')]({'plain':!![]});interaction_log[_0x5388('0x6a')](_0x5388('0x6b'),_0xa96605[_0x5388('0x66')]['id'],_0xa96605[_0x5388('0x66')][_0x5388('0x3a')],_0xa96605[_0x5388('0x66')][_0x5388('0x6c')],_0x2a763b[_0x5388('0x6d')]['id'],_0xa96605[_0x5388('0x5c')]?JSON[_0x5388('0x6e')](_0xa96605[_0x5388('0x5c')]):_0x5388('0x6f'));return respondWithRpcPromise(_0x5388('0x70'),_0x5388('0x71'),_0x2a763b);}return null;})[_0x5388('0x52')](function(_0x374640){var _0x58e485=_0x5388('0x72')+_0x374640[_0x5388('0x29')][_0x5388('0x73')];return db['sequelize']['query'](_0x58e485,{'type':db[_0x5388('0x74')]['QueryTypes'][_0x5388('0x75')],'raw':!![]})[_0x5388('0x52')](function(_0x5ddb5d){return _0x5ddb5d;});})[_0x5388('0x52')](function(_0x44b0bb){if(_0x44b0bb){_0x2a763b[_0x5388('0x29')][_0x5388('0x76')]=_0x44b0bb[0x0];if(!_0xa96605[_0x5388('0x5c')][_0x5388('0x65')])return;return db[_0x5388('0x77')]['find']({'where':{'id':_0xa96605[_0x5388('0x5c')][_0x5388('0x65')],'role':_0x5388('0x67')},'attributes':['id',_0x5388('0x3a'),_0x5388('0x78'),_0x5388('0x79'),_0x5388('0x7a')],'raw':!![]});}return null;})[_0x5388('0x52')](function(_0x57a87b){if(!_0x57a87b)return null;_0x2a763b[_0x5388('0x29')][_0x5388('0x67')]=_0x57a87b;return _0x2a763b;})['then'](function(_0x5761fb){if(_0x5761fb){if(_0xa96605['body']['manual']){_0x2a763b['message'][_0x5388('0x7b')]=util[_0x5388('0x63')](_0x5388('0x7c'),_0xa96605['user'][_0x5388('0x3a')]);_0x2a763b['message'][_0x5388('0x7d')]=_0x2a763b[_0x5388('0x7d')];_0x2a763b[_0x5388('0x29')][_0x5388('0x7e')]=_0x2a763b['channel'];_0x2a763b[_0x5388('0x29')]['event']=_0x5388('0x5f');return respondWithRpcPromise('EventManager',_0x5388('0x7f'),{'event':_0x5388('0x80'),'message':_[_0x5388('0x4d')](_0x2a763b[_0x5388('0x29')],JSON['parse'](_0x2a763b[_0x5388('0x6d')][_0x5388('0x81')]))},client9002)[_0x5388('0x52')](function(){return _0x2a763b;});}return _0x2a763b;}return null;})[_0x5388('0x52')](respondWithResult(_0x4a1521,null))['catch'](handleError(_0x4a1521,null));};var interaction_log=require(_0x5388('0x16'))(_0x5388('0x5e'));exports[_0x5388('0x82')]=function(_0xf1a90,_0x543bff,_0x13f050){var _0x2a34c6={'agent':{},'channel':_0x5388('0x60')};if(_0xf1a90[_0x5388('0x5c')]['id']){delete _0xf1a90[_0x5388('0x5c')]['id'];}_0xf1a90[_0x5388('0x5c')][_0x5388('0x65')]=_0xf1a90[_0x5388('0x5c')]['UserId']||_0xf1a90[_0x5388('0x66')]['id'];_0x2a34c6[_0x5388('0x67')]['id']=_0xf1a90[_0x5388('0x5c')][_0x5388('0x65')];return db[_0x5388('0x51')][_0x5388('0x5a')]({'where':{'id':_0xf1a90['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x543bff,null))[_0x5388('0x52')](function(_0x38e68f){if(_0x38e68f){_0x2a34c6[_0x5388('0x29')]=_0x38e68f[_0x5388('0x68')]({'plain':!![]});return db[_0x5388('0x69')][_0x5388('0x5a')]({'where':{'id':_0x38e68f[_0x5388('0x83')]}});}return null;})[_0x5388('0x52')](handleEntityNotFound(_0x543bff,null))[_0x5388('0x52')](function(_0x5c79e8){if(_0x5c79e8){_0x2a34c6[_0x5388('0x6d')]=_0x5c79e8[_0x5388('0x68')]({'plain':!![]});interaction_log[_0x5388('0x6a')](_0x5388('0x84'),_0xf1a90[_0x5388('0x66')]['id'],_0xf1a90[_0x5388('0x66')][_0x5388('0x3a')],_0xf1a90[_0x5388('0x66')][_0x5388('0x6c')],_0x2a34c6[_0x5388('0x6d')]['id'],_0xf1a90['body']?JSON[_0x5388('0x6e')](_0xf1a90[_0x5388('0x5c')]):_0x5388('0x6f'));return respondWithRpcPromise(_0x5388('0x85'),_0x5388('0x86'),_0x2a34c6);}return null;})[_0x5388('0x52')](function(_0x1279e0){var _0x127036=_0x5388('0x72')+_0x1279e0[_0x5388('0x29')]['ContactId'];return db['sequelize'][_0x5388('0x41')](_0x127036,{'type':db[_0x5388('0x74')][_0x5388('0x87')][_0x5388('0x75')],'raw':!![]})[_0x5388('0x52')](function(_0xa6513a){return _0xa6513a;});})[_0x5388('0x52')](function(_0x1b6ae2){if(_0x1b6ae2){_0x2a34c6[_0x5388('0x29')][_0x5388('0x76')]=_0x1b6ae2[0x0];if(!_0xf1a90[_0x5388('0x5c')][_0x5388('0x65')])return;return db[_0x5388('0x77')][_0x5388('0x5a')]({'where':{'id':_0xf1a90['body'][_0x5388('0x65')],'role':_0x5388('0x67')},'attributes':['id','name',_0x5388('0x78'),'email','internal'],'raw':!![]});}return null;})[_0x5388('0x52')](function(_0x4fd40d){if(!_0x4fd40d)return null;_0x2a34c6[_0x5388('0x29')][_0x5388('0x67')]=_0x4fd40d;return _0x2a34c6;})[_0x5388('0x52')](function(_0x4b535c){if(_0x4b535c){_0x4b535c[_0x5388('0x29')][_0x5388('0x7b')]=util[_0x5388('0x63')]('SIP/%s',_0xf1a90[_0x5388('0x66')][_0x5388('0x3a')]);_0x4b535c[_0x5388('0x29')][_0x5388('0x7d')]=_0x2a34c6[_0x5388('0x7d')];_0x4b535c[_0x5388('0x29')][_0x5388('0x7e')]=_0x2a34c6[_0x5388('0x7d')];_0x4b535c[_0x5388('0x29')][_0x5388('0x88')]=_0x5388('0x82');respondWithRpcPromise('EventManager',_0x5388('0x7f'),{'event':_0x5388('0x89'),'message':_[_0x5388('0x4d')](_0x2a34c6[_0x5388('0x29')],JSON['parse'](_0x2a34c6['interaction'][_0x5388('0x81')]))},client9002);return _0x2a34c6;}return null;})[_0x5388('0x52')](respondWithResult(_0x543bff,null))[_0x5388('0x2b')](handleError(_0x543bff,null));};
\ No newline at end of file
+var _0xfb38=['socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','name','send','index','map','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','ChatMessage','rawAttributes','include','find','create','body','describe','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','format','role','interaction','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','User','fullname','email','internal','interface','channel','motionChannel','accept','EventManager','acceptmessage','parse','formData','chat-interactions','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','Sequelize','QueryTypes','contact','SIP/%s','event','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x43d106,_0x96a475){var _0x2160bc=function(_0x1219fb){while(--_0x1219fb){_0x43d106['push'](_0x43d106['shift']());}};_0x2160bc(++_0x96a475);}(_0xfb38,0xf0));var _0x8fb3=function(_0x48347d,_0x31ee2a){_0x48347d=_0x48347d-0x0;var _0x110f3d=_0xfb38[_0x48347d];return _0x110f3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8fb3('0x0'));var zipdir=require(_0x8fb3('0x1'));var jsonpatch=require(_0x8fb3('0x2'));var rp=require(_0x8fb3('0x3'));var moment=require(_0x8fb3('0x4'));var BPromise=require(_0x8fb3('0x5'));var Mustache=require(_0x8fb3('0x6'));var util=require(_0x8fb3('0x7'));var path=require(_0x8fb3('0x8'));var sox=require('sox');var csv=require(_0x8fb3('0x9'));var ejs=require(_0x8fb3('0xa'));var fs=require('fs');var fs_extra=require(_0x8fb3('0xb'));var _=require(_0x8fb3('0xc'));var squel=require('squel');var crypto=require(_0x8fb3('0xd'));var jsforce=require(_0x8fb3('0xe'));var deskjs=require(_0x8fb3('0xf'));var toCsv=require(_0x8fb3('0x9'));var querystring=require(_0x8fb3('0x10'));var Papa=require(_0x8fb3('0x11'));var Redis=require(_0x8fb3('0x12'));var authService=require(_0x8fb3('0x13'));var qs=require(_0x8fb3('0x14'));var as=require(_0x8fb3('0x15'));var hardwareService=require(_0x8fb3('0x16'));var logger=require(_0x8fb3('0x17'))(_0x8fb3('0x18'));var utils=require(_0x8fb3('0x19'));var config=require(_0x8fb3('0x1a'));var licenseUtil=require(_0x8fb3('0x1b'));var db=require(_0x8fb3('0x1c'))['db'];config[_0x8fb3('0x1d')]=_[_0x8fb3('0x1e')](config['redis'],{'host':_0x8fb3('0x1f'),'port':0x18eb});var socket=require(_0x8fb3('0x20'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x8fb3('0x21')](socket);var jayson=require(_0x8fb3('0x22'));var client=jayson[_0x8fb3('0x23')][_0x8fb3('0x24')]({'port':0x232c});var client9002=jayson['client'][_0x8fb3('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x2b93aa,_0x104297,_0x225519,_0x53e5f6){return new BPromise(function(_0x46cf10,_0x41e3d3){var _0x2943ff=_0x53e5f6||client;return _0x2943ff[_0x8fb3('0x25')](_0x2b93aa,_0x225519)[_0x8fb3('0x26')](function(_0x4d8343){logger[_0x8fb3('0x27')]('ChatMessage,\x20%s,\x20%s',_0x104297,_0x8fb3('0x28'));logger[_0x8fb3('0x29')](_0x8fb3('0x2a'),_0x104297,_0x8fb3('0x28'),JSON[_0x8fb3('0x2b')](_0x4d8343));if(_0x4d8343[_0x8fb3('0x2c')]){if(_0x4d8343[_0x8fb3('0x2c')][_0x8fb3('0x2d')]===0x1f4){logger['error'](_0x8fb3('0x2e'),_0x104297,_0x4d8343[_0x8fb3('0x2c')][_0x8fb3('0x2f')]);return _0x41e3d3(_0x4d8343[_0x8fb3('0x2c')][_0x8fb3('0x2f')]);}logger[_0x8fb3('0x2c')](_0x8fb3('0x2e'),_0x104297,_0x4d8343['error']['message']);return _0x46cf10(_0x4d8343[_0x8fb3('0x2c')][_0x8fb3('0x2f')]);}else{logger[_0x8fb3('0x27')](_0x8fb3('0x2e'),_0x104297,_0x8fb3('0x28'));_0x46cf10(_0x4d8343[_0x8fb3('0x30')][_0x8fb3('0x2f')]);}})[_0x8fb3('0x31')](function(_0x33afdc){logger['error'](_0x8fb3('0x2e'),_0x104297,_0x33afdc);_0x41e3d3(_0x33afdc);});});}function respondWithStatusCode(_0x5e328c,_0x1c354e){_0x1c354e=_0x1c354e||0xcc;return function(_0x558dee){if(_0x558dee){return _0x5e328c[_0x8fb3('0x32')](_0x1c354e);}return _0x5e328c[_0x8fb3('0x33')](_0x1c354e)[_0x8fb3('0x34')]();};}function respondWithResult(_0xdc15ca,_0x7dec91){_0x7dec91=_0x7dec91||0xc8;return function(_0x1e55c7){if(_0x1e55c7){return _0xdc15ca['status'](_0x7dec91)[_0x8fb3('0x35')](_0x1e55c7);}};}function respondWithFilteredResult(_0x59c470,_0x39e810){return function(_0x2cf24a){if(_0x2cf24a){var _0x300019=typeof _0x39e810['offset']===_0x8fb3('0x36')&&typeof _0x39e810[_0x8fb3('0x37')]===_0x8fb3('0x36');var _0x139792=_0x2cf24a[_0x8fb3('0x38')];var _0x3dc4a2=_0x300019?0x0:_0x39e810[_0x8fb3('0x39')];var _0x2fd253=_0x300019?_0x2cf24a['count']:_0x39e810[_0x8fb3('0x39')]+_0x39e810[_0x8fb3('0x37')];var _0x56a257;if(_0x2fd253>=_0x139792){_0x2fd253=_0x139792;_0x56a257=0xc8;}else{_0x56a257=0xce;}_0x59c470[_0x8fb3('0x33')](_0x56a257);return _0x59c470[_0x8fb3('0x3a')]('Content-Range',_0x3dc4a2+'-'+_0x2fd253+'/'+_0x139792)[_0x8fb3('0x35')](_0x2cf24a);}return null;};}function patchUpdates(_0x1014bd){return function(_0x20149b){try{jsonpatch[_0x8fb3('0x3b')](_0x20149b,_0x1014bd,!![]);}catch(_0x3e8d5a){return BPromise[_0x8fb3('0x3c')](_0x3e8d5a);}return _0x20149b[_0x8fb3('0x3d')]();};}function saveUpdates(_0x51e3a8,_0xf7a3a6){return function(_0x29468){if(_0x29468){return _0x29468[_0x8fb3('0x3e')](_0x51e3a8)[_0x8fb3('0x26')](function(_0x56097c){return _0x56097c;});}return null;};}function removeEntity(_0x5075fb,_0x276fd0){return function(_0x9ce71f){if(_0x9ce71f){return _0x9ce71f['destroy']()[_0x8fb3('0x26')](function(){_0x5075fb[_0x8fb3('0x33')](0xcc)[_0x8fb3('0x34')]();});}};}function handleEntityNotFound(_0x33196f,_0x2cad5d){return function(_0x5544d5){if(!_0x5544d5){_0x33196f[_0x8fb3('0x32')](0x194);}return _0x5544d5;};}function handleError(_0x2b1758,_0x47378e){_0x47378e=_0x47378e||0x1f4;return function(_0x3f1d8c){logger[_0x8fb3('0x2c')](_0x3f1d8c['stack']);if(_0x3f1d8c['name']){delete _0x3f1d8c[_0x8fb3('0x3f')];}_0x2b1758['status'](_0x47378e)[_0x8fb3('0x40')](_0x3f1d8c);};}exports[_0x8fb3('0x41')]=function(_0x9ff6ad,_0x1ef823){var _0x4aa684={},_0x16fc02={},_0x7f591e={'count':0x0,'rows':[]};var _0x5b0955=_[_0x8fb3('0x42')](db['ChatMessage']['rawAttributes'],function(_0x53bbec){return{'name':_0x53bbec[_0x8fb3('0x43')],'type':_0x53bbec[_0x8fb3('0x44')][_0x8fb3('0x45')]};});_0x16fc02['model']=_[_0x8fb3('0x42')](_0x5b0955,'name');_0x16fc02[_0x8fb3('0x46')]=_[_0x8fb3('0x47')](_0x9ff6ad[_0x8fb3('0x46')]);_0x16fc02['filters']=_[_0x8fb3('0x48')](_0x16fc02[_0x8fb3('0x49')],_0x16fc02[_0x8fb3('0x46')]);_0x4aa684[_0x8fb3('0x4a')]=_[_0x8fb3('0x48')](_0x16fc02[_0x8fb3('0x49')],qs[_0x8fb3('0x4b')](_0x9ff6ad['query'][_0x8fb3('0x4b')]));_0x4aa684[_0x8fb3('0x4a')]=_0x4aa684['attributes'][_0x8fb3('0x4c')]?_0x4aa684[_0x8fb3('0x4a')]:_0x16fc02[_0x8fb3('0x49')];if(!_0x9ff6ad['query']['hasOwnProperty'](_0x8fb3('0x4d'))){_0x4aa684[_0x8fb3('0x37')]=qs['limit'](_0x9ff6ad[_0x8fb3('0x46')]['limit']);_0x4aa684[_0x8fb3('0x39')]=qs[_0x8fb3('0x39')](_0x9ff6ad['query'][_0x8fb3('0x39')]);}_0x4aa684[_0x8fb3('0x4e')]=qs[_0x8fb3('0x4f')](_0x9ff6ad[_0x8fb3('0x46')]['sort']);_0x4aa684[_0x8fb3('0x50')]=qs[_0x8fb3('0x51')](_['pick'](_0x9ff6ad[_0x8fb3('0x46')],_0x16fc02['filters']),_0x5b0955);if(_0x9ff6ad[_0x8fb3('0x46')][_0x8fb3('0x52')]){_0x4aa684['where']=_[_0x8fb3('0x53')](_0x4aa684['where'],{'$or':_[_0x8fb3('0x42')](_0x5b0955,function(_0x99d4b2){if(_0x99d4b2[_0x8fb3('0x44')]!==_0x8fb3('0x54')){var _0x24f9f8={};_0x24f9f8[_0x99d4b2[_0x8fb3('0x3f')]]={'$like':'%'+_0x9ff6ad[_0x8fb3('0x46')]['filter']+'%'};return _0x24f9f8;}})});}_0x4aa684=_[_0x8fb3('0x53')]({},_0x4aa684,_0x9ff6ad[_0x8fb3('0x55')]);var _0x2ae452={'where':_0x4aa684['where']};return db['ChatMessage'][_0x8fb3('0x38')](_0x2ae452)[_0x8fb3('0x26')](function(_0x23b9e5){_0x7f591e['count']=_0x23b9e5;if(_0x9ff6ad[_0x8fb3('0x46')][_0x8fb3('0x56')]){_0x4aa684['include']=[{'all':!![]}];}return db['ChatMessage'][_0x8fb3('0x57')](_0x4aa684);})[_0x8fb3('0x26')](function(_0x537f77){_0x7f591e[_0x8fb3('0x58')]=_0x537f77;return _0x7f591e;})['then'](respondWithFilteredResult(_0x1ef823,_0x4aa684))[_0x8fb3('0x31')](handleError(_0x1ef823,null));};exports[_0x8fb3('0x59')]=function(_0xe31421,_0x275f43){var _0x1164c4={'raw':!![],'where':{'id':_0xe31421[_0x8fb3('0x5a')]['id']}},_0x430cdc={};_0x430cdc[_0x8fb3('0x49')]=_['keys'](db[_0x8fb3('0x5b')][_0x8fb3('0x5c')]);_0x430cdc[_0x8fb3('0x46')]=_[_0x8fb3('0x47')](_0xe31421[_0x8fb3('0x46')]);_0x430cdc['filters']=_['intersection'](_0x430cdc[_0x8fb3('0x49')],_0x430cdc[_0x8fb3('0x46')]);_0x1164c4['attributes']=_[_0x8fb3('0x48')](_0x430cdc[_0x8fb3('0x49')],qs['fields'](_0xe31421[_0x8fb3('0x46')][_0x8fb3('0x4b')]));_0x1164c4[_0x8fb3('0x4a')]=_0x1164c4['attributes'][_0x8fb3('0x4c')]?_0x1164c4['attributes']:_0x430cdc['model'];if(_0xe31421[_0x8fb3('0x46')][_0x8fb3('0x56')]){_0x1164c4[_0x8fb3('0x5d')]=[{'all':!![]}];}_0x1164c4=_[_0x8fb3('0x53')]({},_0x1164c4,_0xe31421[_0x8fb3('0x55')]);return db['ChatMessage'][_0x8fb3('0x5e')](_0x1164c4)[_0x8fb3('0x26')](handleEntityNotFound(_0x275f43,null))[_0x8fb3('0x26')](respondWithResult(_0x275f43,null))['catch'](handleError(_0x275f43,null));};exports[_0x8fb3('0x5f')]=function(_0x456590,_0x46f4c1){return db['ChatMessage'][_0x8fb3('0x5f')](_0x456590[_0x8fb3('0x60')],{})['then'](respondWithResult(_0x46f4c1,0xc9))[_0x8fb3('0x31')](handleError(_0x46f4c1,null));};exports[_0x8fb3('0x3e')]=function(_0x5d1ca3,_0x1f5ef6){if(_0x5d1ca3[_0x8fb3('0x60')]['id']){delete _0x5d1ca3[_0x8fb3('0x60')]['id'];}return db[_0x8fb3('0x5b')][_0x8fb3('0x5e')]({'where':{'id':_0x5d1ca3[_0x8fb3('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1f5ef6,null))[_0x8fb3('0x26')](saveUpdates(_0x5d1ca3[_0x8fb3('0x60')],null))[_0x8fb3('0x26')](respondWithResult(_0x1f5ef6,null))[_0x8fb3('0x31')](handleError(_0x1f5ef6,null));};exports['destroy']=function(_0x12c660,_0x28f6ee){return db[_0x8fb3('0x5b')][_0x8fb3('0x5e')]({'where':{'id':_0x12c660[_0x8fb3('0x5a')]['id']}})['then'](handleEntityNotFound(_0x28f6ee,null))[_0x8fb3('0x26')](removeEntity(_0x28f6ee,null))['catch'](handleError(_0x28f6ee,null));};exports[_0x8fb3('0x61')]=function(_0x525cad,_0x32e5d5){return db['ChatMessage'][_0x8fb3('0x61')]()[_0x8fb3('0x26')](respondWithResult(_0x32e5d5,null))[_0x8fb3('0x31')](handleError(_0x32e5d5,null));};var interaction_log=require(_0x8fb3('0x17'))('chat-interactions');exports['accept']=function(_0x2ed8f3,_0xf54379,_0x42d589){var _0x9c065c={'agent':{},'channel':'chat'};if(_0x2ed8f3['body']['id']){delete _0x2ed8f3[_0x8fb3('0x60')]['id'];}_0x2ed8f3[_0x8fb3('0x60')][_0x8fb3('0x62')]=!![];_0x2ed8f3['body'][_0x8fb3('0x63')]=moment()['format'](_0x8fb3('0x64'));_0x2ed8f3[_0x8fb3('0x60')][_0x8fb3('0x65')]=_0x2ed8f3[_0x8fb3('0x60')]['UserId']||_0x2ed8f3[_0x8fb3('0x66')]['id'];_0x9c065c[_0x8fb3('0x67')]['id']=_0x2ed8f3[_0x8fb3('0x60')]['UserId'];return db['ChatMessage'][_0x8fb3('0x5e')]({'where':{'id':_0x2ed8f3['params']['id'],'UserId':null}})[_0x8fb3('0x26')](handleEntityNotFound(_0xf54379,null))[_0x8fb3('0x26')](saveUpdates(_0x2ed8f3[_0x8fb3('0x60')],null))[_0x8fb3('0x26')](function(_0x15f420){if(_0x15f420){_0x9c065c[_0x8fb3('0x2f')]=_0x15f420[_0x8fb3('0x68')]({'plain':!![]});return db[_0x8fb3('0x69')][_0x8fb3('0x5e')]({'where':{'id':_0x15f420[_0x8fb3('0x6a')]}});}return null;})[_0x8fb3('0x26')](handleEntityNotFound(_0xf54379,null))[_0x8fb3('0x26')](function(_0x30accf){if(_0x30accf){return _0x30accf['update']({'UserId':_0x2ed8f3[_0x8fb3('0x60')]['UserId'],'read1stAt':_[_0x8fb3('0x6b')](_0x30accf['read1stAt'])?moment()[_0x8fb3('0x6c')](_0x8fb3('0x64')):undefined});}return null;})['then'](function(_0x4d9f92){if(_0x4d9f92){_0x9c065c['interaction']=_0x4d9f92[_0x8fb3('0x68')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2ed8f3[_0x8fb3('0x66')]['id'],_0x2ed8f3[_0x8fb3('0x66')][_0x8fb3('0x3f')],_0x2ed8f3[_0x8fb3('0x66')][_0x8fb3('0x6d')],_0x9c065c[_0x8fb3('0x6e')]['id'],_0x2ed8f3[_0x8fb3('0x60')]?JSON['stringify'](_0x2ed8f3[_0x8fb3('0x60')]):_0x8fb3('0x6f'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x9c065c);}return null;})[_0x8fb3('0x26')](function(_0x26fd12){var _0x45d87a=_0x8fb3('0x70')+_0x26fd12['message'][_0x8fb3('0x71')];return db[_0x8fb3('0x72')][_0x8fb3('0x46')](_0x45d87a,{'type':db['Sequelize']['QueryTypes'][_0x8fb3('0x73')],'raw':!![]})[_0x8fb3('0x26')](function(_0x3cd543){return _0x3cd543;});})['then'](function(_0x2f200c){if(_0x2f200c){_0x9c065c[_0x8fb3('0x2f')]['contact']=_0x2f200c[0x0];if(!_0x2ed8f3['body'][_0x8fb3('0x65')])return;return db[_0x8fb3('0x74')][_0x8fb3('0x5e')]({'where':{'id':_0x2ed8f3['body'][_0x8fb3('0x65')],'role':_0x8fb3('0x67')},'attributes':['id',_0x8fb3('0x3f'),_0x8fb3('0x75'),_0x8fb3('0x76'),_0x8fb3('0x77')],'raw':!![]});}return null;})[_0x8fb3('0x26')](function(_0x4ce03f){if(!_0x4ce03f)return null;_0x9c065c['message']['agent']=_0x4ce03f;return _0x9c065c;})[_0x8fb3('0x26')](function(_0x26d5ca){if(_0x26d5ca){if(_0x2ed8f3[_0x8fb3('0x60')]['manual']){_0x9c065c[_0x8fb3('0x2f')][_0x8fb3('0x78')]=util[_0x8fb3('0x6c')]('SIP/%s',_0x2ed8f3['user']['name']);_0x9c065c[_0x8fb3('0x2f')][_0x8fb3('0x79')]=_0x9c065c['channel'];_0x9c065c[_0x8fb3('0x2f')][_0x8fb3('0x7a')]=_0x9c065c['channel'];_0x9c065c[_0x8fb3('0x2f')]['event']=_0x8fb3('0x7b');return respondWithRpcPromise(_0x8fb3('0x7c'),_0x8fb3('0x7c'),{'event':_0x8fb3('0x7d'),'message':_['merge'](_0x9c065c[_0x8fb3('0x2f')],JSON[_0x8fb3('0x7e')](_0x9c065c[_0x8fb3('0x6e')][_0x8fb3('0x7f')]))},client9002)['then'](function(){return _0x9c065c;});}return _0x9c065c;}return null;})[_0x8fb3('0x26')](respondWithResult(_0xf54379,null))[_0x8fb3('0x31')](handleError(_0xf54379,null));};var interaction_log=require(_0x8fb3('0x17'))(_0x8fb3('0x80'));exports[_0x8fb3('0x3c')]=function(_0xd181b4,_0xe203d2,_0x112d2a){var _0x1f94ea={'agent':{},'channel':_0x8fb3('0x81')};if(_0xd181b4[_0x8fb3('0x60')]['id']){delete _0xd181b4[_0x8fb3('0x60')]['id'];}_0xd181b4[_0x8fb3('0x60')][_0x8fb3('0x65')]=_0xd181b4[_0x8fb3('0x60')][_0x8fb3('0x65')]||_0xd181b4[_0x8fb3('0x66')]['id'];_0x1f94ea['agent']['id']=_0xd181b4[_0x8fb3('0x60')]['UserId'];return db['ChatMessage']['find']({'where':{'id':_0xd181b4[_0x8fb3('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xe203d2,null))[_0x8fb3('0x26')](function(_0x11a0c7){if(_0x11a0c7){_0x1f94ea['message']=_0x11a0c7[_0x8fb3('0x68')]({'plain':!![]});return db['ChatInteraction'][_0x8fb3('0x5e')]({'where':{'id':_0x11a0c7[_0x8fb3('0x6a')]}});}return null;})[_0x8fb3('0x26')](handleEntityNotFound(_0xe203d2,null))[_0x8fb3('0x26')](function(_0x5f1a2f){if(_0x5f1a2f){_0x1f94ea['interaction']=_0x5f1a2f[_0x8fb3('0x68')]({'plain':!![]});interaction_log[_0x8fb3('0x27')](_0x8fb3('0x82'),_0xd181b4[_0x8fb3('0x66')]['id'],_0xd181b4[_0x8fb3('0x66')][_0x8fb3('0x3f')],_0xd181b4['user'][_0x8fb3('0x6d')],_0x1f94ea['interaction']['id'],_0xd181b4[_0x8fb3('0x60')]?JSON[_0x8fb3('0x2b')](_0xd181b4['body']):_0x8fb3('0x6f'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x1f94ea);}return null;})[_0x8fb3('0x26')](function(_0x1d41b3){var _0x129181=_0x8fb3('0x70')+_0x1d41b3[_0x8fb3('0x2f')]['ContactId'];return db[_0x8fb3('0x72')]['query'](_0x129181,{'type':db[_0x8fb3('0x83')][_0x8fb3('0x84')][_0x8fb3('0x73')],'raw':!![]})['then'](function(_0x4217aa){return _0x4217aa;});})[_0x8fb3('0x26')](function(_0x5c689a){if(_0x5c689a){_0x1f94ea['message'][_0x8fb3('0x85')]=_0x5c689a[0x0];if(!_0xd181b4[_0x8fb3('0x60')][_0x8fb3('0x65')])return;return db[_0x8fb3('0x74')]['find']({'where':{'id':_0xd181b4[_0x8fb3('0x60')]['UserId'],'role':'agent'},'attributes':['id',_0x8fb3('0x3f'),'fullname',_0x8fb3('0x76'),_0x8fb3('0x77')],'raw':!![]});}return null;})[_0x8fb3('0x26')](function(_0x1ec2ec){if(!_0x1ec2ec)return null;_0x1f94ea[_0x8fb3('0x2f')]['agent']=_0x1ec2ec;return _0x1f94ea;})[_0x8fb3('0x26')](function(_0x15a80f){if(_0x15a80f){_0x15a80f[_0x8fb3('0x2f')]['interface']=util[_0x8fb3('0x6c')](_0x8fb3('0x86'),_0xd181b4[_0x8fb3('0x66')][_0x8fb3('0x3f')]);_0x15a80f[_0x8fb3('0x2f')]['channel']=_0x1f94ea[_0x8fb3('0x79')];_0x15a80f[_0x8fb3('0x2f')][_0x8fb3('0x7a')]=_0x1f94ea[_0x8fb3('0x79')];_0x15a80f['message'][_0x8fb3('0x87')]=_0x8fb3('0x3c');respondWithRpcPromise(_0x8fb3('0x7c'),_0x8fb3('0x7c'),{'event':'rejectmessage','message':_[_0x8fb3('0x53')](_0x1f94ea['message'],JSON['parse'](_0x1f94ea[_0x8fb3('0x6e')][_0x8fb3('0x7f')]))},client9002);return _0x1f94ea;}return null;})[_0x8fb3('0x26')](respondWithResult(_0xe203d2,null))[_0x8fb3('0x31')](handleError(_0xe203d2,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 448cbda..fe97697 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 _0xe2ba=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','update','remove'];(function(_0x52061c,_0x2af3e7){var _0x4ac570=function(_0xd83173){while(--_0xd83173){_0x52061c['push'](_0x52061c['shift']());}};_0x4ac570(++_0x2af3e7);}(_0xe2ba,0x19b));var _0xae2b=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xe2ba[_0x334841];return _0x5beb4b;};'use strict';var EventEmitter=require(_0xae2b('0x0'));var ChatMessage=require(_0xae2b('0x1'))['db'][_0xae2b('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xae2b('0x3'),'afterDestroy':_0xae2b('0x4')};function emitEvent(_0x49ff3c){return function(_0x26db90,_0x271a9a,_0x4413aa){ChatMessageEvents['emit'](_0x49ff3c+':'+_0x26db90['id'],_0x26db90);ChatMessageEvents[_0xae2b('0x5')](_0x49ff3c,_0x26db90);_0x4413aa(null);};}for(var e in events){if(events[_0xae2b('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xae2b('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x9c2b=['emit','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','remove'];(function(_0x3e6b44,_0x4f542f){var _0x3cdb8d=function(_0x12fa08){while(--_0x12fa08){_0x3e6b44['push'](_0x3e6b44['shift']());}};_0x3cdb8d(++_0x4f542f);}(_0x9c2b,0x1f3));var _0xb9c2=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x9c2b[_0x4b2436];return _0x4f5ab2;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xb9c2('0x0'))['db'][_0xb9c2('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb9c2('0x2')](0x0);var events={'afterCreate':_0xb9c2('0x3'),'afterUpdate':'update','afterDestroy':_0xb9c2('0x4')};function emitEvent(_0x393b29){return function(_0x297b1b,_0x5d7338,_0x29ff51){ChatMessageEvents['emit'](_0x393b29+':'+_0x297b1b['id'],_0x297b1b);ChatMessageEvents[_0xb9c2('0x5')](_0x393b29,_0x297b1b);_0x29ff51(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xb9c2('0x6')](e,emitEvent(event));}}module[_0xb9c2('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 5ba9550..c194046 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 _0xfd4e=['toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','chat_messages','body','FULLTEXT','models','get','direction'];(function(_0xc9fa65,_0x5d4d49){var _0x4ba605=function(_0x261320){while(--_0x261320){_0xc9fa65['push'](_0xc9fa65['shift']());}};_0x4ba605(++_0x5d4d49);}(_0xfd4e,0x1a0));var _0xefd4=function(_0x415e4d,_0x17ebc2){_0x415e4d=_0x415e4d-0x0;var _0x2a81d6=_0xfd4e[_0x415e4d];return _0x2a81d6;};'use strict';var _=require('lodash');var util=require(_0xefd4('0x0'));var logger=require(_0xefd4('0x1'))(_0xefd4('0x2'));var moment=require(_0xefd4('0x3'));var BPromise=require(_0xefd4('0x4'));var rp=require(_0xefd4('0x5'));var fs=require('fs');var path=require(_0xefd4('0x6'));var rimraf=require(_0xefd4('0x7'));var config=require(_0xefd4('0x8'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x2d145a,_0x2e7a82){return _0x2d145a[_0xefd4('0x9')]('ChatMessage',attributes,{'tableName':_0xefd4('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xefd4('0xb')],'type':_0xefd4('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x364e4d,_0x4d4773,_0x3c5fbc){var _0x3b4726=_0x2d145a[_0xefd4('0xd')];var _0x322afc=_0x364e4d[_0xefd4('0xe')]({'plain':!![]});if(_0x322afc[_0xefd4('0xf')][_0xefd4('0x10')]()==='in'||_0x322afc['direction'][_0xefd4('0x10')]()===_0xefd4('0x11')&&!_0x322afc[_0xefd4('0x12')]&&!_['isNil'](_0x322afc[_0xefd4('0x13')])){_0x3b4726[_0xefd4('0x14')][_0xefd4('0x15')]({'where':{'id':_0x322afc[_0xefd4('0x16')]}})['then'](function(_0x18d1f6){if(_0x18d1f6){_0x18d1f6[_0xefd4('0x17')]({'lastMsgAt':_0x322afc[_0xefd4('0x18')],'lastMsgDirection':_0x322afc[_0xefd4('0xf')][_0xefd4('0x10')]()});}})['catch'](function(_0x1a568c){console['error'](_0x1a568c);});}_0x3c5fbc();}},'charset':_0xefd4('0x19'),'collate':_0xefd4('0x1a')});};
\ No newline at end of file
+var _0x0081=['toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','direction','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','chat_messages','body','FULLTEXT','models'];(function(_0x1ea012,_0x2ba44e){var _0x2ddab2=function(_0x1b7623){while(--_0x1b7623){_0x1ea012['push'](_0x1ea012['shift']());}};_0x2ddab2(++_0x2ba44e);}(_0x0081,0xba));var _0x1008=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x0081[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x1008('0x0'));var util=require(_0x1008('0x1'));var logger=require(_0x1008('0x2'))(_0x1008('0x3'));var moment=require(_0x1008('0x4'));var BPromise=require(_0x1008('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1008('0x6'));var config=require(_0x1008('0x7'));var attributes=require('./chatMessage.attributes');module[_0x1008('0x8')]=function(_0x54ddb5,_0x2dfa9b){return _0x54ddb5[_0x1008('0x9')]('ChatMessage',attributes,{'tableName':_0x1008('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x1008('0xb')],'type':_0x1008('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x43929a,_0x3e0bc7,_0x4114ec){var _0x117176=_0x54ddb5[_0x1008('0xd')];var _0x54bfc8=_0x43929a['get']({'plain':!![]});if(_0x54bfc8['direction']['toLowerCase']()==='in'||_0x54bfc8['direction'][_0x1008('0xe')]()===_0x1008('0xf')&&!_0x54bfc8['secret']&&!_[_0x1008('0x10')](_0x54bfc8[_0x1008('0x11')])){_0x117176[_0x1008('0x12')][_0x1008('0x13')]({'where':{'id':_0x54bfc8[_0x1008('0x14')]}})['then'](function(_0xe2b55c){if(_0xe2b55c){_0xe2b55c[_0x1008('0x15')]({'lastMsgAt':_0x54bfc8[_0x1008('0x16')],'lastMsgDirection':_0x54bfc8[_0x1008('0x17')][_0x1008('0xe')]()});}})['catch'](function(_0x5883a9){console['error'](_0x5883a9);});}_0x4114ec();}},'charset':'utf8mb4','collate':_0x1008('0x18')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 40f27c5..4d078c0 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 _0x66da=['ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request'];(function(_0x347ba9,_0x4e4cd7){var _0x238ac6=function(_0x1948af){while(--_0x1948af){_0x347ba9['push'](_0x347ba9['shift']());}};_0x238ac6(++_0x4e4cd7);}(_0x66da,0x16f));var _0xa66d=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x66da[_0x42bc91];return _0x3f5507;};'use strict';var _=require(_0xa66d('0x0'));var util=require(_0xa66d('0x1'));var moment=require(_0xa66d('0x2'));var BPromise=require(_0xa66d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa66d('0x4'));var logger=require(_0xa66d('0x5'))(_0xa66d('0x6'));var config=require(_0xa66d('0x7'));var jayson=require(_0xa66d('0x8'));var client=jayson['client'][_0xa66d('0x9')]({'port':0x232a});config[_0xa66d('0xa')]=_[_0xa66d('0xb')](config[_0xa66d('0xa')],{'host':_0xa66d('0xc'),'port':0x18eb});var socket=require(_0xa66d('0xd'))(new Redis(config[_0xa66d('0xa')]));require(_0xa66d('0xe'))[_0xa66d('0xf')](socket);function respondWithRpcPromise(_0x9becae,_0x22b38f,_0x1e65b0){return new BPromise(function(_0x4c0dde,_0x92016b){return client[_0xa66d('0x10')](_0x9becae,_0x1e65b0)['then'](function(_0x4906cd){logger['info'](_0xa66d('0x11'),_0x22b38f,'request\x20sent');logger[_0xa66d('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x22b38f,_0xa66d('0x13'),JSON[_0xa66d('0x14')](_0x4906cd));if(_0x4906cd['error']){if(_0x4906cd[_0xa66d('0x15')][_0xa66d('0x16')]===0x1f4){logger['error'](_0xa66d('0x11'),_0x22b38f,_0x4906cd['error'][_0xa66d('0x17')]);return _0x92016b(_0x4906cd['error'][_0xa66d('0x17')]);}logger[_0xa66d('0x15')]('ChatMessage,\x20%s,\x20%s',_0x22b38f,_0x4906cd[_0xa66d('0x15')][_0xa66d('0x17')]);return _0x4c0dde(_0x4906cd[_0xa66d('0x15')][_0xa66d('0x17')]);}else{logger[_0xa66d('0x18')]('ChatMessage,\x20%s,\x20%s',_0x22b38f,_0xa66d('0x13'));_0x4c0dde(_0x4906cd['result'][_0xa66d('0x17')]);}})[_0xa66d('0x19')](function(_0x55db3b){logger[_0xa66d('0x15')](_0xa66d('0x11'),_0x22b38f,_0x55db3b);_0x92016b(_0x55db3b);});});}exports[_0xa66d('0x1a')]=function(_0x3d0219){var _0x5082de=this;return new Promise(function(_0xee7546,_0x232fe3){return db[_0xa66d('0x1b')][_0xa66d('0x1c')](_0x3d0219[_0xa66d('0x1d')],{'raw':_0x3d0219[_0xa66d('0x1e')]?_0x3d0219['options'][_0xa66d('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0xfde811){logger[_0xa66d('0x18')](_0xa66d('0x1a'),_0x3d0219);logger[_0xa66d('0x12')](_0xa66d('0x1a'),_0x3d0219,JSON[_0xa66d('0x14')](_0xfde811));_0xee7546(_0xfde811);})['catch'](function(_0x42527c){logger['error'](_0xa66d('0x1a'),_0x42527c[_0xa66d('0x17')],_0x3d0219);_0x232fe3(_0x5082de[_0xa66d('0x15')](0x1f4,_0x42527c[_0xa66d('0x17')]));});});};
\ No newline at end of file
+var _0x4316=['request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ChatMessage','body','options','raw','CreateChatMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4316,0x1ee));var _0x6431=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4316[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6431('0x0'));var util=require(_0x6431('0x1'));var moment=require(_0x6431('0x2'));var BPromise=require(_0x6431('0x3'));var rs=require(_0x6431('0x4'));var fs=require('fs');var Redis=require(_0x6431('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6431('0x6'));var logger=require(_0x6431('0x7'))(_0x6431('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6431('0x9')][_0x6431('0xa')]({'port':0x232a});config[_0x6431('0xb')]=_[_0x6431('0xc')](config['redis'],{'host':_0x6431('0xd'),'port':0x18eb});var socket=require(_0x6431('0xe'))(new Redis(config[_0x6431('0xb')]));require('./chatMessage.socket')[_0x6431('0xf')](socket);function respondWithRpcPromise(_0x31eefa,_0x16290f,_0x54fe38){return new BPromise(function(_0xfd1c6c,_0x227fe0){return client[_0x6431('0x10')](_0x31eefa,_0x54fe38)[_0x6431('0x11')](function(_0x3417f4){logger[_0x6431('0x12')](_0x6431('0x13'),_0x16290f,_0x6431('0x14'));logger[_0x6431('0x15')](_0x6431('0x16'),_0x16290f,_0x6431('0x14'),JSON['stringify'](_0x3417f4));if(_0x3417f4[_0x6431('0x17')]){if(_0x3417f4[_0x6431('0x17')][_0x6431('0x18')]===0x1f4){logger[_0x6431('0x17')]('ChatMessage,\x20%s,\x20%s',_0x16290f,_0x3417f4[_0x6431('0x17')][_0x6431('0x19')]);return _0x227fe0(_0x3417f4['error'][_0x6431('0x19')]);}logger[_0x6431('0x17')](_0x6431('0x13'),_0x16290f,_0x3417f4[_0x6431('0x17')][_0x6431('0x19')]);return _0xfd1c6c(_0x3417f4[_0x6431('0x17')][_0x6431('0x19')]);}else{logger['info'](_0x6431('0x13'),_0x16290f,_0x6431('0x14'));_0xfd1c6c(_0x3417f4[_0x6431('0x1a')][_0x6431('0x19')]);}})[_0x6431('0x1b')](function(_0x2174e1){logger[_0x6431('0x17')](_0x6431('0x13'),_0x16290f,_0x2174e1);_0x227fe0(_0x2174e1);});});}exports['CreateChatMessage']=function(_0x55c81d){var _0x2afb68=this;return new Promise(function(_0x3690d1,_0x373fcb){return db[_0x6431('0x1c')]['create'](_0x55c81d[_0x6431('0x1d')],{'raw':_0x55c81d[_0x6431('0x1e')]?_0x55c81d[_0x6431('0x1e')][_0x6431('0x1f')]===undefined?!![]:![]:!![]})[_0x6431('0x11')](function(_0xcc28aa){logger[_0x6431('0x12')]('CreateChatMessage',_0x55c81d);logger['debug'](_0x6431('0x20'),_0x55c81d,JSON[_0x6431('0x21')](_0xcc28aa));_0x3690d1(_0xcc28aa);})['catch'](function(_0x5364cb){logger[_0x6431('0x17')](_0x6431('0x20'),_0x5364cb[_0x6431('0x19')],_0x55c81d);_0x373fcb(_0x2afb68[_0x6431('0x17')](0x1f4,_0x5364cb['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index d57f778..21bfc3c 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 _0x0bde=['save','update','emit','removeListener','register','length','chatMessage:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xe0bd('0x0'),'remove',_0xe0bd('0x1')];function createListener(_0x3dc984,_0x1d8922){return function(_0x1e198a){_0x1d8922[_0xe0bd('0x2')](_0x3dc984,_0x1e198a);};}function removeListener(_0x5541b9,_0x34df88){return function(){ChatMessageEvents[_0xe0bd('0x3')](_0x5541b9,_0x34df88);};}exports[_0xe0bd('0x4')]=function(_0x3b712a){for(var _0x22bfd1=0x0,_0x26393f=events[_0xe0bd('0x5')];_0x22bfd1<_0x26393f;_0x22bfd1++){var _0x491dc7=events[_0x22bfd1];var _0x40b36a=createListener(_0xe0bd('0x6')+_0x491dc7,_0x3b712a);ChatMessageEvents['on'](_0x491dc7,_0x40b36a);}};
\ No newline at end of file
+var _0x7118=['length','chatMessage:','remove','update','emit','removeListener','register'];(function(_0x819e48,_0x430040){var _0x522d4a=function(_0x1bb24f){while(--_0x1bb24f){_0x819e48['push'](_0x819e48['shift']());}};_0x522d4a(++_0x430040);}(_0x7118,0x159));var _0x8711=function(_0x1fea8c,_0x20ceb5){_0x1fea8c=_0x1fea8c-0x0;var _0x129b9d=_0x7118[_0x1fea8c];return _0x129b9d;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x8711('0x0'),_0x8711('0x1')];function createListener(_0x5c64d4,_0x1758c5){return function(_0x3ea36f){_0x1758c5[_0x8711('0x2')](_0x5c64d4,_0x3ea36f);};}function removeListener(_0x259c36,_0x12496b){return function(){ChatMessageEvents[_0x8711('0x3')](_0x259c36,_0x12496b);};}exports[_0x8711('0x4')]=function(_0x54885e){for(var _0x385033=0x0,_0x2244c2=events[_0x8711('0x5')];_0x385033<_0x2244c2;_0x385033++){var _0x3d82f2=events[_0x385033];var _0x189349=createListener(_0x8711('0x6')+_0x3d82f2,_0x54885e);ChatMessageEvents['on'](_0x3d82f2,_0x189349);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 9bec236..20c7c41 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 _0x467f=['update','accept','/:id/reject','reject','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','get','describe','/:id','show','post','isAuthenticated','tracked','put'];(function(_0x3bd8ba,_0x1df4ce){var _0x9c8b58=function(_0x18ebde){while(--_0x18ebde){_0x3bd8ba['push'](_0x3bd8ba['shift']());}};_0x9c8b58(++_0x1df4ce);}(_0x467f,0x10d));var _0xf467=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x467f[_0x39c734];return _0xb2a2f9;};'use strict';var multer=require(_0xf467('0x0'));var util=require(_0xf467('0x1'));var path=require(_0xf467('0x2'));var timeout=require('connect-timeout');var express=require(_0xf467('0x3'));var router=express[_0xf467('0x4')]();var fs_extra=require(_0xf467('0x5'));var auth=require(_0xf467('0x6'));var interaction=require(_0xf467('0x7'));var config=require(_0xf467('0x8'));var controller=require(_0xf467('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf467('0xa')]);router[_0xf467('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xf467('0xc')]);router[_0xf467('0xb')](_0xf467('0xd'),auth['isAuthenticated'](),controller[_0xf467('0xe')]);router[_0xf467('0xf')]('/',auth[_0xf467('0x10')](),interaction[_0xf467('0x11')]('chat','chatmessage:create'),controller['create']);router[_0xf467('0x12')](_0xf467('0xd'),controller[_0xf467('0x13')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0xf467('0x14')]);router['put'](_0xf467('0x15'),auth[_0xf467('0x10')](),controller[_0xf467('0x16')]);router['delete'](_0xf467('0xd'),auth[_0xf467('0x10')](),controller['destroy']);module[_0xf467('0x17')]=router;
\ No newline at end of file
+var _0x9125=['update','/:id/accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','chat','put'];(function(_0x402731,_0x43c115){var _0x111736=function(_0x5a7044){while(--_0x5a7044){_0x402731['push'](_0x402731['shift']());}};_0x111736(++_0x43c115);}(_0x9125,0x19b));var _0x5912=function(_0xd02bb,_0x26e2d0){_0xd02bb=_0xd02bb-0x0;var _0x1cdf23=_0x9125[_0xd02bb];return _0x1cdf23;};'use strict';var multer=require(_0x5912('0x0'));var util=require(_0x5912('0x1'));var path=require(_0x5912('0x2'));var timeout=require(_0x5912('0x3'));var express=require(_0x5912('0x4'));var router=express[_0x5912('0x5')]();var fs_extra=require(_0x5912('0x6'));var auth=require(_0x5912('0x7'));var interaction=require(_0x5912('0x8'));var config=require('../../config/environment');var controller=require(_0x5912('0x9'));router['get']('/',auth[_0x5912('0xa')](),controller[_0x5912('0xb')]);router[_0x5912('0xc')](_0x5912('0xd'),auth[_0x5912('0xa')](),controller[_0x5912('0xe')]);router['get'](_0x5912('0xf'),auth[_0x5912('0xa')](),controller[_0x5912('0x10')]);router[_0x5912('0x11')]('/',auth[_0x5912('0xa')](),interaction[_0x5912('0x12')](_0x5912('0x13'),'chatmessage:create'),controller['create']);router[_0x5912('0x14')](_0x5912('0xf'),controller[_0x5912('0x15')]);router[_0x5912('0x14')](_0x5912('0x16'),auth[_0x5912('0xa')](),controller['accept']);router[_0x5912('0x14')](_0x5912('0x17'),auth['isAuthenticated'](),controller['reject']);router[_0x5912('0x18')](_0x5912('0xf'),auth['isAuthenticated'](),controller[_0x5912('0x19')]);module[_0x5912('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 567e787..3e77d75 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x606d02,_0x405657){var _0x12011a=function(_0x126e8b){while(--_0x126e8b){_0x606d02['push'](_0x606d02['shift']());}};_0x12011a(++_0x405657);}(_0xdb28,0x106));var _0x8db2=function(_0x579347,_0x3ce9df){_0x579347=_0x579347-0x0;var _0x3776d2=_0xdb28[_0x579347];return _0x3776d2;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x55f16e,_0x3b3c88){var _0x4777ba=function(_0x54fa72){while(--_0x54fa72){_0x55f16e['push'](_0x55f16e['shift']());}};_0x4777ba(++_0x3b3c88);}(_0xdb28,0x106));var _0x8db2=function(_0x5a7b6e,_0x41b082){_0x5a7b6e=_0x5a7b6e-0x0;var _0x39d50b=_0xdb28[_0x5a7b6e];return _0x39d50b;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 23bc05f..7a58a15 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x4cb9d0,_0x4e8e4f){var _0x173a77=function(_0x1e9d48){while(--_0x1e9d48){_0x4cb9d0['push'](_0x4cb9d0['shift']());}};_0x173a77(++_0x4e8e4f);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1e32a2,_0x41fdb4){var _0x1146b2=function(_0xf04d33){while(--_0xf04d33){_0x1e32a2['push'](_0x1e32a2['shift']());}};_0x1146b2(++_0x41fdb4);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 65ad049..9b27cf0 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 _0x5709=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','save','update','remove'];(function(_0x2924d3,_0x43216b){var _0x4be4e4=function(_0x57446b){while(--_0x57446b){_0x2924d3['push'](_0x2924d3['shift']());}};_0x4be4e4(++_0x43216b);}(_0x5709,0x158));var _0x9570=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5709[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x9570('0x0'));var ChatOfflineMessage=require(_0x9570('0x1'))['db'][_0x9570('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9570('0x3'),'afterUpdate':_0x9570('0x4'),'afterDestroy':_0x9570('0x5')};function emitEvent(_0x52e787){return function(_0x2c9ed0,_0x59262b,_0x47e2e3){ChatOfflineMessageEvents[_0x9570('0x6')](_0x52e787+':'+_0x2c9ed0['id'],_0x2c9ed0);ChatOfflineMessageEvents[_0x9570('0x6')](_0x52e787,_0x2c9ed0);_0x47e2e3(null);};}for(var e in events){if(events[_0x9570('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x9570('0x8')](e,emitEvent(event));}}module[_0x9570('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x3c96=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0x160e1b,_0xd246a){var _0x3e8455=function(_0x1354c2){while(--_0x1354c2){_0x160e1b['push'](_0x160e1b['shift']());}};_0x3e8455(++_0xd246a);}(_0x3c96,0xfa));var _0x63c9=function(_0x2f9351,_0x3a115f){_0x2f9351=_0x2f9351-0x0;var _0x256360=_0x3c96[_0x2f9351];return _0x256360;};'use strict';var EventEmitter=require(_0x63c9('0x0'));var ChatOfflineMessage=require(_0x63c9('0x1'))['db'][_0x63c9('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x63c9('0x3')](0x0);var events={'afterCreate':_0x63c9('0x4'),'afterUpdate':_0x63c9('0x5'),'afterDestroy':_0x63c9('0x6')};function emitEvent(_0x40560a){return function(_0x36478b,_0x784db4,_0x1d0bb3){ChatOfflineMessageEvents['emit'](_0x40560a+':'+_0x36478b['id'],_0x36478b);ChatOfflineMessageEvents['emit'](_0x40560a,_0x36478b);_0x1d0bb3(null);};}for(var e in events){if(events[_0x63c9('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x63c9('0x8')](e,emitEvent(event));}}module[_0x63c9('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 1d5f4d4..481fceb 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 _0x70a4=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0x38df49,_0x343e54){var _0x22d1d8=function(_0x15aabe){while(--_0x15aabe){_0x38df49['push'](_0x38df49['shift']());}};_0x22d1d8(++_0x343e54);}(_0x70a4,0x154));var _0x470a=function(_0x16ea87,_0x378d8b){_0x16ea87=_0x16ea87-0x0;var _0x6e7b1c=_0x70a4[_0x16ea87];return _0x6e7b1c;};'use strict';var attributes=require(_0x470a('0x0'));module[_0x470a('0x1')]=function(_0xbc2fe5){return _0xbc2fe5[_0x470a('0x2')](_0x470a('0x3'),attributes,{'tableName':_0x470a('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x470a('0x5'),'collate':_0x470a('0x6')});};
\ No newline at end of file
+var _0xb7f8=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x3f88bc,_0xe38cf5){var _0x4df1c4=function(_0x111de1){while(--_0x111de1){_0x3f88bc['push'](_0x3f88bc['shift']());}};_0x4df1c4(++_0xe38cf5);}(_0xb7f8,0x141));var _0x8b7f=function(_0x48b690,_0x4f41be){_0x48b690=_0x48b690-0x0;var _0x4139d4=_0xb7f8[_0x48b690];return _0x4139d4;};'use strict';var attributes=require(_0x8b7f('0x0'));module[_0x8b7f('0x1')]=function(_0x35957e){return _0x35957e[_0x8b7f('0x2')](_0x8b7f('0x3'),attributes,{'tableName':_0x8b7f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8b7f('0x5'),'collate':_0x8b7f('0x6')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 2d0c987..fcdcfb1 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 _0xd78e=['rpc','../../config/environment','client','http','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x45f457,_0x3ea3c6){var _0x7fdfa=function(_0x1e93a4){while(--_0x1e93a4){_0x45f457['push'](_0x45f457['shift']());}};_0x7fdfa(++_0x3ea3c6);}(_0xd78e,0x19b));var _0xed78=function(_0x57da0a,_0x284aed){_0x57da0a=_0x57da0a-0x0;var _0x3145d5=_0xd78e[_0x57da0a];return _0x3145d5;};'use strict';var _=require('lodash');var util=require(_0xed78('0x0'));var moment=require(_0xed78('0x1'));var BPromise=require(_0xed78('0x2'));var rs=require(_0xed78('0x3'));var fs=require('fs');var Redis=require(_0xed78('0x4'));var db=require(_0xed78('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xed78('0x6'))(_0xed78('0x7'));var config=require(_0xed78('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xed78('0x9')][_0xed78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x249039,_0x591dc0,_0x2f5643){return new BPromise(function(_0x45a537,_0x48badf){return client['request'](_0x249039,_0x2f5643)[_0xed78('0xb')](function(_0x3bfc8b){logger[_0xed78('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x591dc0,'request\x20sent');logger[_0xed78('0xd')](_0xed78('0xe'),_0x591dc0,_0xed78('0xf'),JSON[_0xed78('0x10')](_0x3bfc8b));if(_0x3bfc8b['error']){if(_0x3bfc8b['error']['code']===0x1f4){logger[_0xed78('0x11')](_0xed78('0x12'),_0x591dc0,_0x3bfc8b[_0xed78('0x11')]['message']);return _0x48badf(_0x3bfc8b[_0xed78('0x11')]['message']);}logger[_0xed78('0x11')](_0xed78('0x12'),_0x591dc0,_0x3bfc8b[_0xed78('0x11')][_0xed78('0x13')]);return _0x45a537(_0x3bfc8b[_0xed78('0x11')]['message']);}else{logger[_0xed78('0xc')](_0xed78('0x12'),_0x591dc0,_0xed78('0xf'));_0x45a537(_0x3bfc8b[_0xed78('0x14')][_0xed78('0x13')]);}})[_0xed78('0x15')](function(_0x2ce9d8){logger[_0xed78('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x591dc0,_0x2ce9d8);_0x48badf(_0x2ce9d8);});});}
\ No newline at end of file
+var _0xdf97=['client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x4226e8,_0x5cdd46){var _0x13c031=function(_0x59356b){while(--_0x59356b){_0x4226e8['push'](_0x4226e8['shift']());}};_0x13c031(++_0x5cdd46);}(_0xdf97,0x1c7));var _0x7df9=function(_0x3f43fa,_0x1ccd65){_0x3f43fa=_0x3f43fa-0x0;var _0x3cf4bb=_0xdf97[_0x3f43fa];return _0x3cf4bb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7df9('0x0'));var BPromise=require(_0x7df9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7df9('0x2'));var db=require(_0x7df9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7df9('0x4'))(_0x7df9('0x5'));var config=require('../../config/environment');var jayson=require(_0x7df9('0x6'));var client=jayson[_0x7df9('0x7')][_0x7df9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x200298,_0x41341e,_0x1e5eb7){return new BPromise(function(_0x3c1661,_0x9e6b7e){return client[_0x7df9('0x9')](_0x200298,_0x1e5eb7)[_0x7df9('0xa')](function(_0x11d45c){logger['info'](_0x7df9('0xb'),_0x41341e,'request\x20sent');logger[_0x7df9('0xc')](_0x7df9('0xd'),_0x41341e,_0x7df9('0xe'),JSON[_0x7df9('0xf')](_0x11d45c));if(_0x11d45c['error']){if(_0x11d45c[_0x7df9('0x10')][_0x7df9('0x11')]===0x1f4){logger['error'](_0x7df9('0xb'),_0x41341e,_0x11d45c[_0x7df9('0x10')][_0x7df9('0x12')]);return _0x9e6b7e(_0x11d45c[_0x7df9('0x10')][_0x7df9('0x12')]);}logger[_0x7df9('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x41341e,_0x11d45c[_0x7df9('0x10')][_0x7df9('0x12')]);return _0x3c1661(_0x11d45c[_0x7df9('0x10')][_0x7df9('0x12')]);}else{logger[_0x7df9('0x13')](_0x7df9('0xb'),_0x41341e,_0x7df9('0xe'));_0x3c1661(_0x11d45c[_0x7df9('0x14')][_0x7df9('0x12')]);}})[_0x7df9('0x15')](function(_0x4d2bad){logger[_0x7df9('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x41341e,_0x4d2bad);_0x9e6b7e(_0x4d2bad);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index f0ba2f3..c274e74 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 _0xe608=['fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x190a41,_0x5b0d39){var _0x2a8e65=function(_0x4a770c){while(--_0x4a770c){_0x190a41['push'](_0x190a41['shift']());}};_0x2a8e65(++_0x5b0d39);}(_0xe608,0x19f));var _0x8e60=function(_0x267c52,_0x3c0df3){_0x267c52=_0x267c52-0x0;var _0x46c47b=_0xe608[_0x267c52];return _0x46c47b;};'use strict';var multer=require(_0x8e60('0x0'));var util=require(_0x8e60('0x1'));var path=require('path');var timeout=require(_0x8e60('0x2'));var express=require(_0x8e60('0x3'));var router=express[_0x8e60('0x4')]();var fs_extra=require(_0x8e60('0x5'));var auth=require(_0x8e60('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8e60('0x7'));var controller=require(_0x8e60('0x8'));router[_0x8e60('0x9')]('/',auth[_0x8e60('0xa')](),controller[_0x8e60('0xb')]);router['get'](_0x8e60('0xc'),auth['isAuthenticated'](),controller[_0x8e60('0xd')]);router[_0x8e60('0x9')]('/:id',auth[_0x8e60('0xa')](),controller['show']);router[_0x8e60('0xe')]('/',auth[_0x8e60('0xa')](),controller[_0x8e60('0xf')]);router[_0x8e60('0x10')](_0x8e60('0x11'),auth[_0x8e60('0xa')](),controller[_0x8e60('0x12')]);router['delete'](_0x8e60('0x11'),auth[_0x8e60('0xa')](),controller[_0x8e60('0x13')]);module[_0x8e60('0x14')]=router;
\ No newline at end of file
+var _0x42cb=['../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','index','get','/:id','create','put','update','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x5bfe13,_0x3f0c62){var _0x4f8eae=function(_0x5008ed){while(--_0x5008ed){_0x5bfe13['push'](_0x5bfe13['shift']());}};_0x4f8eae(++_0x3f0c62);}(_0x42cb,0x15a));var _0xb42c=function(_0x16fee4,_0x1856c3){_0x16fee4=_0x16fee4-0x0;var _0x12702d=_0x42cb[_0x16fee4];return _0x12702d;};'use strict';var multer=require(_0xb42c('0x0'));var util=require(_0xb42c('0x1'));var path=require(_0xb42c('0x2'));var timeout=require(_0xb42c('0x3'));var express=require('express');var router=express[_0xb42c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb42c('0x5'));var interaction=require(_0xb42c('0x6'));var config=require('../../config/environment');var controller=require(_0xb42c('0x7'));router['get']('/',auth[_0xb42c('0x8')](),controller[_0xb42c('0x9')]);router[_0xb42c('0xa')]('/describe',auth[_0xb42c('0x8')](),controller['describe']);router['get'](_0xb42c('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xb42c('0x8')](),controller[_0xb42c('0xc')]);router[_0xb42c('0xd')](_0xb42c('0xb'),auth[_0xb42c('0x8')](),controller[_0xb42c('0xe')]);router['delete'](_0xb42c('0xb'),auth[_0xb42c('0x8')](),controller[_0xb42c('0xf')]);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 910f125..8acf829 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 _0x0e91=['sequelize','exports','mouseOver'];(function(_0x1d9dc3,_0x59e248){var _0x4f08bc=function(_0x598fda){while(--_0x598fda){_0x1d9dc3['push'](_0x1d9dc3['shift']());}};_0x4f08bc(++_0x59e248);}(_0x0e91,0xf0));var _0x10e9=function(_0x56740a,_0x568894){_0x56740a=_0x56740a-0x0;var _0x257144=_0x0e91[_0x56740a];return _0x257144;};'use strict';var Sequelize=require(_0x10e9('0x0'));module[_0x10e9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x10e9('0x2'),'timeout'),'defaultValue':_0x10e9('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x1f02=['mouseOver','INTEGER','exports','STRING','ENUM'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x1f02,0xde));var _0x21f0=function(_0x2363ea,_0x23d302){_0x2363ea=_0x2363ea-0x0;var _0x293483=_0x1f02[_0x2363ea];return _0x293483;};'use strict';var Sequelize=require('sequelize');module[_0x21f0('0x0')]={'name':{'type':Sequelize[_0x21f0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x21f0('0x2')](_0x21f0('0x3'),'timeout'),'defaultValue':_0x21f0('0x3')},'selector':{'type':Sequelize[_0x21f0('0x1')]},'timeout':{'type':Sequelize[_0x21f0('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 527b6a6..4578ce7 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 _0x6737=['request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','catch','create','body','rimraf','zip-dir'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x6737,0xe2));var _0x7673=function(_0x53fa19,_0x55cb48){_0x53fa19=_0x53fa19-0x0;var _0x42a55a=_0x6737[_0x53fa19];return _0x42a55a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7673('0x0'));var zipdir=require(_0x7673('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7673('0x2'));var moment=require(_0x7673('0x3'));var BPromise=require(_0x7673('0x4'));var Mustache=require(_0x7673('0x5'));var util=require('util');var path=require(_0x7673('0x6'));var sox=require(_0x7673('0x7'));var csv=require('to-csv');var ejs=require(_0x7673('0x8'));var fs=require('fs');var fs_extra=require(_0x7673('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7673('0xa'));var toCsv=require('to-csv');var querystring=require(_0x7673('0xb'));var Papa=require(_0x7673('0xc'));var Redis=require('ioredis');var authService=require(_0x7673('0xd'));var qs=require(_0x7673('0xe'));var as=require(_0x7673('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7673('0x10'));var utils=require('../../config/utils');var config=require(_0x7673('0x11'));var licenseUtil=require(_0x7673('0x12'));var db=require(_0x7673('0x13'))['db'];function respondWithStatusCode(_0x451c87,_0x41d6bd){_0x41d6bd=_0x41d6bd||0xcc;return function(_0x119e42){if(_0x119e42){return _0x451c87[_0x7673('0x14')](_0x41d6bd);}return _0x451c87[_0x7673('0x15')](_0x41d6bd)[_0x7673('0x16')]();};}function respondWithResult(_0x20a649,_0x5c8626){_0x5c8626=_0x5c8626||0xc8;return function(_0x26f0c4){if(_0x26f0c4){return _0x20a649[_0x7673('0x15')](_0x5c8626)[_0x7673('0x17')](_0x26f0c4);}};}function respondWithFilteredResult(_0x2c83d,_0x224cea){return function(_0x2e83c4){if(_0x2e83c4){var _0x2a2840=typeof _0x224cea['offset']==='undefined'&&typeof _0x224cea[_0x7673('0x18')]===_0x7673('0x19');var _0x50f8d9=_0x2e83c4[_0x7673('0x1a')];var _0x17699a=_0x2a2840?0x0:_0x224cea['offset'];var _0x33ff7d=_0x2a2840?_0x2e83c4[_0x7673('0x1a')]:_0x224cea[_0x7673('0x1b')]+_0x224cea['limit'];var _0x50f22d;if(_0x33ff7d>=_0x50f8d9){_0x33ff7d=_0x50f8d9;_0x50f22d=0xc8;}else{_0x50f22d=0xce;}_0x2c83d[_0x7673('0x15')](_0x50f22d);return _0x2c83d[_0x7673('0x1c')]('Content-Range',_0x17699a+'-'+_0x33ff7d+'/'+_0x50f8d9)[_0x7673('0x17')](_0x2e83c4);}return null;};}function patchUpdates(_0x29bbd9){return function(_0x2e1260){try{jsonpatch[_0x7673('0x1d')](_0x2e1260,_0x29bbd9,!![]);}catch(_0x4245bf){return BPromise[_0x7673('0x1e')](_0x4245bf);}return _0x2e1260['save']();};}function saveUpdates(_0x557161,_0xea9b37){return function(_0x21774f){if(_0x21774f){return _0x21774f[_0x7673('0x1f')](_0x557161)[_0x7673('0x20')](function(_0x16bb16){return _0x16bb16;});}return null;};}function removeEntity(_0x54f38d,_0x2009e1){return function(_0x3b2a75){if(_0x3b2a75){return _0x3b2a75[_0x7673('0x21')]()[_0x7673('0x20')](function(){_0x54f38d[_0x7673('0x15')](0xcc)[_0x7673('0x16')]();});}};}function handleEntityNotFound(_0x538280,_0x14e3ed){return function(_0xaca974){if(!_0xaca974){_0x538280[_0x7673('0x14')](0x194);}return _0xaca974;};}function handleError(_0x191bf4,_0x5a98fe){_0x5a98fe=_0x5a98fe||0x1f4;return function(_0x5e2cd7){logger[_0x7673('0x22')](_0x5e2cd7[_0x7673('0x23')]);if(_0x5e2cd7[_0x7673('0x24')]){delete _0x5e2cd7[_0x7673('0x24')];}_0x191bf4[_0x7673('0x15')](_0x5a98fe)[_0x7673('0x25')](_0x5e2cd7);};}exports[_0x7673('0x26')]=function(_0x5a59f9,_0x4e9e34){var _0x341f9e={'raw':!![],'where':{'id':_0x5a59f9[_0x7673('0x27')]['id']}},_0x2d4c0a={};_0x2d4c0a[_0x7673('0x28')]=_[_0x7673('0x29')](db[_0x7673('0x2a')][_0x7673('0x2b')]);_0x2d4c0a['query']=_['keys'](_0x5a59f9[_0x7673('0x2c')]);_0x2d4c0a[_0x7673('0x2d')]=_[_0x7673('0x2e')](_0x2d4c0a[_0x7673('0x28')],_0x2d4c0a['query']);_0x341f9e[_0x7673('0x2f')]=_['intersection'](_0x2d4c0a[_0x7673('0x28')],qs[_0x7673('0x30')](_0x5a59f9[_0x7673('0x2c')][_0x7673('0x30')]));_0x341f9e[_0x7673('0x2f')]=_0x341f9e[_0x7673('0x2f')][_0x7673('0x31')]?_0x341f9e[_0x7673('0x2f')]:_0x2d4c0a[_0x7673('0x28')];if(_0x5a59f9[_0x7673('0x2c')][_0x7673('0x32')]){_0x341f9e[_0x7673('0x33')]=[{'all':!![]}];}_0x341f9e=_[_0x7673('0x34')]({},_0x341f9e,_0x5a59f9['options']);return db[_0x7673('0x2a')][_0x7673('0x35')](_0x341f9e)[_0x7673('0x20')](handleEntityNotFound(_0x4e9e34,null))[_0x7673('0x20')](respondWithResult(_0x4e9e34,null))[_0x7673('0x36')](handleError(_0x4e9e34,null));};exports[_0x7673('0x37')]=function(_0x2915f0,_0x5736c0){return db['ChatProactiveAction'][_0x7673('0x37')](_0x2915f0[_0x7673('0x38')],{})[_0x7673('0x20')](respondWithResult(_0x5736c0,0xc9))[_0x7673('0x36')](handleError(_0x5736c0,null));};exports[_0x7673('0x1f')]=function(_0x101e03,_0x159afd){if(_0x101e03['body']['id']){delete _0x101e03[_0x7673('0x38')]['id'];}return db[_0x7673('0x2a')]['find']({'where':{'id':_0x101e03[_0x7673('0x27')]['id']}})[_0x7673('0x20')](handleEntityNotFound(_0x159afd,null))[_0x7673('0x20')](saveUpdates(_0x101e03[_0x7673('0x38')],null))['then'](respondWithResult(_0x159afd,null))[_0x7673('0x36')](handleError(_0x159afd,null));};exports[_0x7673('0x21')]=function(_0x4b82e8,_0x2a20ff){return db[_0x7673('0x2a')][_0x7673('0x35')]({'where':{'id':_0x4b82e8['params']['id']}})[_0x7673('0x20')](handleEntityNotFound(_0x2a20ff,null))[_0x7673('0x20')](removeEntity(_0x2a20ff,null))[_0x7673('0x36')](handleError(_0x2a20ff,null));};
\ No newline at end of file
+var _0x0d4d=['destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','Content-Range','apply','save','update','then','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','find','catch','ChatProactiveAction','create','body'];(function(_0x3c3f94,_0x25b247){var _0x2c7166=function(_0x166ead){while(--_0x166ead){_0x3c3f94['push'](_0x3c3f94['shift']());}};_0x2c7166(++_0x25b247);}(_0x0d4d,0x132));var _0xd0d4=function(_0x4909ce,_0x2094a4){_0x4909ce=_0x4909ce-0x0;var _0x209756=_0x0d4d[_0x4909ce];return _0x209756;};'use strict';var emlformat=require(_0xd0d4('0x0'));var rimraf=require(_0xd0d4('0x1'));var zipdir=require(_0xd0d4('0x2'));var jsonpatch=require(_0xd0d4('0x3'));var rp=require(_0xd0d4('0x4'));var moment=require(_0xd0d4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd0d4('0x6'));var util=require('util');var path=require(_0xd0d4('0x7'));var sox=require(_0xd0d4('0x8'));var csv=require('to-csv');var ejs=require(_0xd0d4('0x9'));var fs=require('fs');var fs_extra=require(_0xd0d4('0xa'));var _=require(_0xd0d4('0xb'));var squel=require('squel');var crypto=require(_0xd0d4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd0d4('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd0d4('0xe'));var Papa=require(_0xd0d4('0xf'));var Redis=require(_0xd0d4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd0d4('0x11'));var as=require(_0xd0d4('0x12'));var hardwareService=require(_0xd0d4('0x13'));var logger=require(_0xd0d4('0x14'))(_0xd0d4('0x15'));var utils=require(_0xd0d4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd0d4('0x17'));var db=require(_0xd0d4('0x18'))['db'];function respondWithStatusCode(_0x29ee49,_0x2ddeca){_0x2ddeca=_0x2ddeca||0xcc;return function(_0x38ca06){if(_0x38ca06){return _0x29ee49[_0xd0d4('0x19')](_0x2ddeca);}return _0x29ee49['status'](_0x2ddeca)[_0xd0d4('0x1a')]();};}function respondWithResult(_0x2131c8,_0x10a175){_0x10a175=_0x10a175||0xc8;return function(_0x5d6dd7){if(_0x5d6dd7){return _0x2131c8['status'](_0x10a175)[_0xd0d4('0x1b')](_0x5d6dd7);}};}function respondWithFilteredResult(_0x186405,_0x553b47){return function(_0x29bda4){if(_0x29bda4){var _0x1e8608=typeof _0x553b47['offset']==='undefined'&&typeof _0x553b47[_0xd0d4('0x1c')]===_0xd0d4('0x1d');var _0x268e1a=_0x29bda4['count'];var _0x5cf4c6=_0x1e8608?0x0:_0x553b47['offset'];var _0x407cda=_0x1e8608?_0x29bda4[_0xd0d4('0x1e')]:_0x553b47[_0xd0d4('0x1f')]+_0x553b47['limit'];var _0x568c75;if(_0x407cda>=_0x268e1a){_0x407cda=_0x268e1a;_0x568c75=0xc8;}else{_0x568c75=0xce;}_0x186405[_0xd0d4('0x20')](_0x568c75);return _0x186405['set'](_0xd0d4('0x21'),_0x5cf4c6+'-'+_0x407cda+'/'+_0x268e1a)[_0xd0d4('0x1b')](_0x29bda4);}return null;};}function patchUpdates(_0x1dcc1b){return function(_0x485cd8){try{jsonpatch[_0xd0d4('0x22')](_0x485cd8,_0x1dcc1b,!![]);}catch(_0x4d9fac){return BPromise['reject'](_0x4d9fac);}return _0x485cd8[_0xd0d4('0x23')]();};}function saveUpdates(_0xda03dd,_0x49b6f0){return function(_0x50f959){if(_0x50f959){return _0x50f959[_0xd0d4('0x24')](_0xda03dd)[_0xd0d4('0x25')](function(_0x398a00){return _0x398a00;});}return null;};}function removeEntity(_0x4c94b1,_0x1d8033){return function(_0x1c0831){if(_0x1c0831){return _0x1c0831['destroy']()[_0xd0d4('0x25')](function(){_0x4c94b1['status'](0xcc)[_0xd0d4('0x1a')]();});}};}function handleEntityNotFound(_0x1b03ef,_0x16808c){return function(_0x5380c3){if(!_0x5380c3){_0x1b03ef['sendStatus'](0x194);}return _0x5380c3;};}function handleError(_0x131de5,_0x4e7cc1){_0x4e7cc1=_0x4e7cc1||0x1f4;return function(_0x50e7f0){logger[_0xd0d4('0x26')](_0x50e7f0[_0xd0d4('0x27')]);if(_0x50e7f0[_0xd0d4('0x28')]){delete _0x50e7f0[_0xd0d4('0x28')];}_0x131de5['status'](_0x4e7cc1)[_0xd0d4('0x29')](_0x50e7f0);};}exports[_0xd0d4('0x2a')]=function(_0x45acf8,_0x22e142){var _0x7eecce={'raw':!![],'where':{'id':_0x45acf8[_0xd0d4('0x2b')]['id']}},_0xefce4f={};_0xefce4f[_0xd0d4('0x2c')]=_[_0xd0d4('0x2d')](db['ChatProactiveAction'][_0xd0d4('0x2e')]);_0xefce4f[_0xd0d4('0x2f')]=_[_0xd0d4('0x2d')](_0x45acf8[_0xd0d4('0x2f')]);_0xefce4f[_0xd0d4('0x30')]=_[_0xd0d4('0x31')](_0xefce4f['model'],_0xefce4f['query']);_0x7eecce[_0xd0d4('0x32')]=_['intersection'](_0xefce4f[_0xd0d4('0x2c')],qs[_0xd0d4('0x33')](_0x45acf8[_0xd0d4('0x2f')][_0xd0d4('0x33')]));_0x7eecce[_0xd0d4('0x32')]=_0x7eecce[_0xd0d4('0x32')][_0xd0d4('0x34')]?_0x7eecce['attributes']:_0xefce4f['model'];if(_0x45acf8[_0xd0d4('0x2f')][_0xd0d4('0x35')]){_0x7eecce['include']=[{'all':!![]}];}_0x7eecce=_[_0xd0d4('0x36')]({},_0x7eecce,_0x45acf8['options']);return db['ChatProactiveAction'][_0xd0d4('0x37')](_0x7eecce)[_0xd0d4('0x25')](handleEntityNotFound(_0x22e142,null))[_0xd0d4('0x25')](respondWithResult(_0x22e142,null))[_0xd0d4('0x38')](handleError(_0x22e142,null));};exports['create']=function(_0x47e4c5,_0x184d3c){return db[_0xd0d4('0x39')][_0xd0d4('0x3a')](_0x47e4c5['body'],{})[_0xd0d4('0x25')](respondWithResult(_0x184d3c,0xc9))[_0xd0d4('0x38')](handleError(_0x184d3c,null));};exports[_0xd0d4('0x24')]=function(_0x45038e,_0x18fd6d){if(_0x45038e[_0xd0d4('0x3b')]['id']){delete _0x45038e[_0xd0d4('0x3b')]['id'];}return db[_0xd0d4('0x39')]['find']({'where':{'id':_0x45038e[_0xd0d4('0x2b')]['id']}})['then'](handleEntityNotFound(_0x18fd6d,null))['then'](saveUpdates(_0x45038e[_0xd0d4('0x3b')],null))['then'](respondWithResult(_0x18fd6d,null))[_0xd0d4('0x38')](handleError(_0x18fd6d,null));};exports[_0xd0d4('0x3c')]=function(_0x1c6d7c,_0x1d6329){return db[_0xd0d4('0x39')][_0xd0d4('0x37')]({'where':{'id':_0x1c6d7c['params']['id']}})[_0xd0d4('0x25')](handleEntityNotFound(_0x1d6329,null))[_0xd0d4('0x25')](removeEntity(_0x1d6329,null))['catch'](handleError(_0x1d6329,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 9d52570..c715201 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 _0x0153=['util','api','moment','bluebird','request-promise','path','rimraf','ChatProactiveAction','chat_proactive_actions'];(function(_0x175081,_0x2968cc){var _0x5b4a6c=function(_0x1c3c21){while(--_0x1c3c21){_0x175081['push'](_0x175081['shift']());}};_0x5b4a6c(++_0x2968cc);}(_0x0153,0x1e6));var _0x3015=function(_0x3af770,_0x1a957a){_0x3af770=_0x3af770-0x0;var _0x42c9a9=_0x0153[_0x3af770];return _0x42c9a9;};'use strict';var _=require('lodash');var util=require(_0x3015('0x0'));var logger=require('../../config/logger')(_0x3015('0x1'));var moment=require(_0x3015('0x2'));var BPromise=require(_0x3015('0x3'));var rp=require(_0x3015('0x4'));var fs=require('fs');var path=require(_0x3015('0x5'));var rimraf=require(_0x3015('0x6'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x45215b,_0x5b08d9){return _0x45215b['define'](_0x3015('0x7'),attributes,{'tableName':_0x3015('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5821=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','../../config/logger'];(function(_0x7b341f,_0x11e481){var _0x46d0a1=function(_0x6f779d){while(--_0x6f779d){_0x7b341f['push'](_0x7b341f['shift']());}};_0x46d0a1(++_0x11e481);}(_0x5821,0xa7));var _0x1582=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5821[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1582('0x0'))('api');var moment=require(_0x1582('0x1'));var BPromise=require(_0x1582('0x2'));var rp=require(_0x1582('0x3'));var fs=require('fs');var path=require(_0x1582('0x4'));var rimraf=require(_0x1582('0x5'));var config=require(_0x1582('0x6'));var attributes=require(_0x1582('0x7'));module[_0x1582('0x8')]=function(_0x47a015,_0xb22447){return _0x47a015[_0x1582('0x9')](_0x1582('0xa'),attributes,{'tableName':_0x1582('0xb'),'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 69896c8..d4e0760 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 _0x780f=['ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info'];(function(_0x3477dd,_0x340ddf){var _0x5b9f71=function(_0x50eda4){while(--_0x50eda4){_0x3477dd['push'](_0x3477dd['shift']());}};_0x5b9f71(++_0x340ddf);}(_0x780f,0x6c));var _0xf780=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x780f[_0x270adf];return _0x29eda9;};'use strict';var _=require(_0xf780('0x0'));var util=require(_0xf780('0x1'));var moment=require(_0xf780('0x2'));var BPromise=require(_0xf780('0x3'));var rs=require(_0xf780('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf780('0x5'));var logger=require(_0xf780('0x6'))(_0xf780('0x7'));var config=require(_0xf780('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf780('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bd856,_0x93539d,_0x1c3fdc){return new BPromise(function(_0xa12d00,_0x44f14c){return client[_0xf780('0xa')](_0x1bd856,_0x1c3fdc)['then'](function(_0x2c8221){logger[_0xf780('0xb')](_0xf780('0xc'),_0x93539d,_0xf780('0xd'));logger[_0xf780('0xe')](_0xf780('0xf'),_0x93539d,_0xf780('0xd'),JSON['stringify'](_0x2c8221));if(_0x2c8221['error']){if(_0x2c8221[_0xf780('0x10')][_0xf780('0x11')]===0x1f4){logger[_0xf780('0x10')](_0xf780('0xc'),_0x93539d,_0x2c8221['error'][_0xf780('0x12')]);return _0x44f14c(_0x2c8221[_0xf780('0x10')][_0xf780('0x12')]);}logger[_0xf780('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x93539d,_0x2c8221[_0xf780('0x10')]['message']);return _0xa12d00(_0x2c8221[_0xf780('0x10')][_0xf780('0x12')]);}else{logger[_0xf780('0xb')](_0xf780('0xc'),_0x93539d,_0xf780('0xd'));_0xa12d00(_0x2c8221[_0xf780('0x13')][_0xf780('0x12')]);}})['catch'](function(_0x450198){logger[_0xf780('0x10')](_0xf780('0xc'),_0x93539d,_0x450198);_0x44f14c(_0x450198);});});}
\ No newline at end of file
+var _0x4ee9=['then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2157c8,_0x42d795){var _0x18e2a3=function(_0x2d5eac){while(--_0x2d5eac){_0x2157c8['push'](_0x2157c8['shift']());}};_0x18e2a3(++_0x42d795);}(_0x4ee9,0x64));var _0x94ee=function(_0x14d643,_0x1c7727){_0x14d643=_0x14d643-0x0;var _0x3a4451=_0x4ee9[_0x14d643];return _0x3a4451;};'use strict';var _=require('lodash');var util=require(_0x94ee('0x0'));var moment=require(_0x94ee('0x1'));var BPromise=require(_0x94ee('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94ee('0x3'))['db'];var utils=require(_0x94ee('0x4'));var logger=require('../../config/logger')(_0x94ee('0x5'));var config=require(_0x94ee('0x6'));var jayson=require(_0x94ee('0x7'));var client=jayson['client'][_0x94ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8a5ff0,_0x4c5204,_0x44138b){return new BPromise(function(_0x315fd2,_0x24adec){return client[_0x94ee('0x9')](_0x8a5ff0,_0x44138b)[_0x94ee('0xa')](function(_0x4615b1){logger[_0x94ee('0xb')](_0x94ee('0xc'),_0x4c5204,_0x94ee('0xd'));logger[_0x94ee('0xe')](_0x94ee('0xf'),_0x4c5204,_0x94ee('0xd'),JSON[_0x94ee('0x10')](_0x4615b1));if(_0x4615b1[_0x94ee('0x11')]){if(_0x4615b1[_0x94ee('0x11')][_0x94ee('0x12')]===0x1f4){logger[_0x94ee('0x11')](_0x94ee('0xc'),_0x4c5204,_0x4615b1[_0x94ee('0x11')][_0x94ee('0x13')]);return _0x24adec(_0x4615b1[_0x94ee('0x11')][_0x94ee('0x13')]);}logger[_0x94ee('0x11')](_0x94ee('0xc'),_0x4c5204,_0x4615b1[_0x94ee('0x11')][_0x94ee('0x13')]);return _0x315fd2(_0x4615b1[_0x94ee('0x11')][_0x94ee('0x13')]);}else{logger[_0x94ee('0xb')](_0x94ee('0xc'),_0x4c5204,'request\x20sent');_0x315fd2(_0x4615b1[_0x94ee('0x14')][_0x94ee('0x13')]);}})[_0x94ee('0x15')](function(_0x3f6e3a){logger[_0x94ee('0x11')](_0x94ee('0xc'),_0x4c5204,_0x3f6e3a);_0x24adec(_0x3f6e3a);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index d97783b..10989d6 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 _0x207c=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x2890a8,_0x1ccd49){var _0x1cbd49=function(_0x5a9402){while(--_0x5a9402){_0x2890a8['push'](_0x2890a8['shift']());}};_0x1cbd49(++_0x1ccd49);}(_0x207c,0x1e8));var _0xc207=function(_0xec1289,_0x4fa82b){_0xec1289=_0xec1289-0x0;var _0x3e223c=_0x207c[_0xec1289];return _0x3e223c;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./chatProactiveAction.controller');router['get']('/:id',auth[_0xc207('0x8')](),controller[_0xc207('0x9')]);router[_0xc207('0xa')]('/',auth['isAuthenticated'](),controller[_0xc207('0xb')]);router[_0xc207('0xc')](_0xc207('0xd'),auth['isAuthenticated'](),controller[_0xc207('0xe')]);router[_0xc207('0xf')](_0xc207('0xd'),auth[_0xc207('0x8')](),controller[_0xc207('0x10')]);module[_0xc207('0x11')]=router;
\ No newline at end of file
+var _0xf2ca=['show','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x50472c,_0x2f1e04){var _0x2a5db0=function(_0x1fcb15){while(--_0x1fcb15){_0x50472c['push'](_0x50472c['shift']());}};_0x2a5db0(++_0x2f1e04);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x1de43c,_0xaa29de){_0x1de43c=_0x1de43c-0x0;var _0x296d3e=_0xf2ca[_0x1de43c];return _0x296d3e;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xaf2c('0x9')](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xc')]);router['post']('/',auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xd')]);router['put'](_0xaf2c('0xa'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['delete'](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xf')]);module[_0xaf2c('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index d3fdb54..1abedec 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 _0xa9fb=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x1df1ae,_0x16dbac){var _0x1c2825=function(_0x30f230){while(--_0x30f230){_0x1df1ae['push'](_0x1df1ae['shift']());}};_0x1c2825(++_0x16dbac);}(_0xa9fb,0x1c9));var _0xba9f=function(_0x44f4ed,_0x23f1e4){_0x44f4ed=_0x44f4ed-0x0;var _0x47ef85=_0xa9fb[_0x44f4ed];return _0x47ef85;};'use strict';var Sequelize=require(_0xba9f('0x0'));module[_0xba9f('0x1')]={'name':{'type':Sequelize[_0xba9f('0x2')],'unique':_0xba9f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xba9f('0x4')](_0xba9f('0x5'),_0xba9f('0x6'),_0xba9f('0x7'))}};
\ No newline at end of file
+var _0xc094=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x2a8ea3,_0x14311b){var _0xd21cbf=function(_0x1015ce){while(--_0x1015ce){_0x2a8ea3['push'](_0x2a8ea3['shift']());}};_0xd21cbf(++_0x14311b);}(_0xc094,0x134));var _0x4c09=function(_0x14478e,_0x529002){_0x14478e=_0x14478e-0x0;var _0x5869d1=_0xc094[_0x14478e];return _0x5869d1;};'use strict';var Sequelize=require(_0x4c09('0x0'));module[_0x4c09('0x1')]={'name':{'type':Sequelize[_0x4c09('0x2')],'unique':_0x4c09('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4c09('0x2')]},'timeout':{'type':Sequelize[_0x4c09('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4c09('0x5')](_0x4c09('0x6'),_0x4c09('0x7'),_0x4c09('0x8'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index c94c83a..a2d48be 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 _0xdaec=['options','addTeams','Agents','online','voicePause','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','SELECT','every','TeamId','all','union','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','ids','omit','isArray','getAgents','findOne','bluebird','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','status','end','json','undefined','limit','offset','Content-Range','then','destroy','get','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','ChatQueue','count','include','query','findAll','rows','catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','UserChatQueue','hasOwnProperty','nolimit','sort','pick','where','ChatQueueId','filter','User','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdaec,0xa0));var _0xcdae=function(_0x3f816c,_0x51ed7c){_0x3f816c=_0x3f816c-0x0;var _0x55f2dd=_0xdaec[_0x3f816c];return _0x55f2dd;};'use strict';var BPromise=require(_0xcdae('0x0'));var util=require('util');var _=require('lodash');var squel=require(_0xcdae('0x1'));var Redis=require(_0xcdae('0x2'));var qs=require(_0xcdae('0x3'));var logger=require(_0xcdae('0x4'))('api');var config=require(_0xcdae('0x5'));var db=require(_0xcdae('0x6'))['db'];config[_0xcdae('0x7')]=_[_0xcdae('0x8')](config['redis'],{'host':_0xcdae('0x9'),'port':0x18eb});var socket=require(_0xcdae('0xa'))(new Redis(config['redis']));require(_0xcdae('0xb'))[_0xcdae('0xc')](socket);function respondWithStatusCode(_0x27a98d,_0x4c25c0){_0x4c25c0=_0x4c25c0||0xcc;return function(_0x1f02b4){if(_0x1f02b4){return _0x27a98d['sendStatus'](_0x4c25c0);}return _0x27a98d[_0xcdae('0xd')](_0x4c25c0)[_0xcdae('0xe')]();};}function respondWithResult(_0x120312,_0x253d32){_0x253d32=_0x253d32||0xc8;return function(_0x3c73be){if(_0x3c73be){return _0x120312[_0xcdae('0xd')](_0x253d32)[_0xcdae('0xf')](_0x3c73be);}};}function respondWithFilteredResult(_0x5e8ae3,_0x4a64d3){return function(_0x3b5017){if(_0x3b5017){var _0x1f9aca=typeof _0x4a64d3['offset']===_0xcdae('0x10')&&typeof _0x4a64d3[_0xcdae('0x11')]==='undefined';var _0x251a67=_0x3b5017['count'];var _0x3e700f=_0x1f9aca?0x0:_0x4a64d3[_0xcdae('0x12')];var _0x46566f=_0x1f9aca?_0x3b5017['count']:_0x4a64d3[_0xcdae('0x12')]+_0x4a64d3[_0xcdae('0x11')];var _0x298900;if(_0x46566f>=_0x251a67){_0x46566f=_0x251a67;_0x298900=0xc8;}else{_0x298900=0xce;}_0x5e8ae3[_0xcdae('0xd')](_0x298900);return _0x5e8ae3['set'](_0xcdae('0x13'),_0x3e700f+'-'+_0x46566f+'/'+_0x251a67)[_0xcdae('0xf')](_0x3b5017);}return null;};}function saveUpdates(_0x59740b){return function(_0x2a25a4){if(_0x2a25a4){return _0x2a25a4['update'](_0x59740b)[_0xcdae('0x14')](function(_0x2ef0e2){return _0x2ef0e2;});}return null;};}function removeEntity(_0x1932a2){return function(_0x14e70a){if(_0x14e70a){return _0x14e70a[_0xcdae('0x15')]()[_0xcdae('0x14')](function(){var _0x3e9692=_0x14e70a[_0xcdae('0x16')]({'plain':!![]});var _0x26e25d='ChatQueues';return db['UserProfileResource'][_0xcdae('0x15')]({'where':{'type':_0x26e25d,'resourceId':_0x3e9692['id']}})[_0xcdae('0x14')](function(){return _0x14e70a;});})[_0xcdae('0x14')](function(){_0x1932a2[_0xcdae('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3febdd){return function(_0x85ba26){if(!_0x85ba26){_0x3febdd['sendStatus'](0x194);}return _0x85ba26;};}function handleError(_0x2dce94,_0x465d9d){_0x465d9d=_0x465d9d||0x1f4;return function(_0x2d8ad5){logger[_0xcdae('0x17')](_0x2d8ad5[_0xcdae('0x18')]);if(_0x2d8ad5['name']){delete _0x2d8ad5[_0xcdae('0x19')];}_0x2dce94[_0xcdae('0xd')](_0x465d9d)[_0xcdae('0x1a')](_0x2d8ad5);};}exports[_0xcdae('0x1b')]=function(_0x556783,_0x119b18){var _0x3dab4a={};var _0x92a31a={'count':0x0,'rows':[]};var _0x342b6b=_[_0xcdae('0x1c')](db['ChatQueue'][_0xcdae('0x1d')],function(_0x4516c1){return{'name':_0x4516c1[_0xcdae('0x1e')],'type':_0x4516c1[_0xcdae('0x1f')][_0xcdae('0x20')]};});_0x3dab4a=qs[_0xcdae('0x21')](_0x342b6b,_0x556783);var _0x80d931={'where':_0x3dab4a['where']};return db[_0xcdae('0x22')][_0xcdae('0x23')](_0x80d931)[_0xcdae('0x14')](function(_0x5b2452){_0x92a31a['count']=_0x5b2452;_0x3dab4a[_0xcdae('0x24')]=qs[_0xcdae('0x24')](_0x556783[_0xcdae('0x25')]);return db[_0xcdae('0x22')][_0xcdae('0x26')](_0x3dab4a);})['then'](function(_0x4a6c69){_0x92a31a[_0xcdae('0x27')]=_0x4a6c69;return _0x92a31a;})[_0xcdae('0x14')](respondWithFilteredResult(_0x119b18,_0x3dab4a))[_0xcdae('0x28')](handleError(_0x119b18,null));};exports[_0xcdae('0x29')]=function(_0x2e1998,_0x2d8d4b){var _0x598d29={'raw':!![],'where':{'id':_0x2e1998['params']['id']}},_0x214b18={};_0x214b18[_0xcdae('0x2a')]=_[_0xcdae('0x2b')](db['ChatQueue']['rawAttributes']);_0x214b18[_0xcdae('0x25')]=_[_0xcdae('0x2b')](_0x2e1998['query']);_0x214b18[_0xcdae('0x2c')]=_[_0xcdae('0x2d')](_0x214b18['model'],_0x214b18['query']);_0x598d29[_0xcdae('0x2e')]=_[_0xcdae('0x2d')](_0x214b18[_0xcdae('0x2a')],qs[_0xcdae('0x2f')](_0x2e1998['query'][_0xcdae('0x2f')]));_0x598d29['attributes']=_0x598d29[_0xcdae('0x2e')][_0xcdae('0x30')]?_0x598d29[_0xcdae('0x2e')]:_0x214b18[_0xcdae('0x2a')];if(_0x2e1998[_0xcdae('0x25')][_0xcdae('0x31')]){_0x598d29[_0xcdae('0x24')]=[{'all':!![]}];}_0x598d29=_[_0xcdae('0x32')]({},_0x598d29,_0x2e1998['options']);return db[_0xcdae('0x22')][_0xcdae('0x33')](_0x598d29)[_0xcdae('0x14')](handleEntityNotFound(_0x2d8d4b,null))['then'](respondWithResult(_0x2d8d4b,null))['catch'](handleError(_0x2d8d4b,null));};exports['create']=function(_0x41fa2c,_0x3118c4){return db[_0xcdae('0x22')]['create'](_0x41fa2c[_0xcdae('0x34')],{})[_0xcdae('0x14')](function(_0x2b7fbf){var _0x5b6312=_0x41fa2c['user']['get']({'plain':!![]});if(!_0x5b6312)throw new Error(_0xcdae('0x35'));if(_0x5b6312[_0xcdae('0x36')]===_0xcdae('0x37')){var _0x2abf28=_0x2b7fbf['get']({'plain':!![]});var _0x1e5886=_0xcdae('0x38');return db[_0xcdae('0x39')][_0xcdae('0x33')]({'where':{'name':_0x1e5886,'userProfileId':_0x5b6312[_0xcdae('0x3a')]},'raw':!![]})[_0xcdae('0x14')](function(_0x5ca7f9){if(_0x5ca7f9&&_0x5ca7f9[_0xcdae('0x3b')]===0x0){return db[_0xcdae('0x3c')][_0xcdae('0x3d')]({'name':_0x2abf28['name'],'resourceId':_0x2abf28['id'],'type':_0x5ca7f9[_0xcdae('0x19')],'sectionId':_0x5ca7f9['id']},{})[_0xcdae('0x14')](function(){return _0x2b7fbf;});}else{return _0x2b7fbf;}})[_0xcdae('0x28')](function(_0x297028){logger[_0xcdae('0x17')](_0xcdae('0x3e'),_0x297028);throw _0x297028;});}return _0x2b7fbf;})[_0xcdae('0x14')](respondWithResult(_0x3118c4,0xc9))['catch'](handleError(_0x3118c4,null));};exports[_0xcdae('0x3f')]=function(_0x80673b,_0x531a3a){if(_0x80673b['body']['id']){delete _0x80673b['body']['id'];}return db[_0xcdae('0x22')]['find']({'where':{'id':_0x80673b[_0xcdae('0x40')]['id']}})['then'](handleEntityNotFound(_0x531a3a,null))[_0xcdae('0x14')](saveUpdates(_0x80673b['body'],null))[_0xcdae('0x14')](respondWithResult(_0x531a3a,null))[_0xcdae('0x28')](handleError(_0x531a3a,null));};exports[_0xcdae('0x15')]=function(_0x4e5d52,_0x2b30ec){return db[_0xcdae('0x22')]['find']({'where':{'id':_0x4e5d52[_0xcdae('0x40')]['id']}})[_0xcdae('0x14')](handleEntityNotFound(_0x2b30ec,null))['then'](removeEntity(_0x2b30ec,null))[_0xcdae('0x28')](handleError(_0x2b30ec,null));};exports[_0xcdae('0x41')]=function(_0x332d9c,_0x675caf){return db[_0xcdae('0x22')][_0xcdae('0x41')]()[_0xcdae('0x14')](respondWithResult(_0x675caf,null))['catch'](handleError(_0x675caf,null));};exports[_0xcdae('0x42')]=function(_0xde0b22,_0xae0978){var _0x59cb22={'raw':!![],'where':{}},_0x66f426={},_0x158663;return db[_0xcdae('0x22')]['findOne']({'where':{'id':_0xde0b22[_0xcdae('0x40')]['id']}})[_0xcdae('0x14')](handleEntityNotFound(_0xae0978,null))[_0xcdae('0x14')](function(_0x32b914){if(_0x32b914){_0x158663=_0x32b914[_0xcdae('0x16')]({'plain':!![]});_0x66f426['model']=_[_0xcdae('0x2b')](db[_0xcdae('0x43')]['rawAttributes']);_0x66f426['query']=_[_0xcdae('0x2b')](_0xde0b22['query']);_0x66f426[_0xcdae('0x2c')]=_[_0xcdae('0x2d')](_0x66f426[_0xcdae('0x2a')],_0x66f426[_0xcdae('0x25')]);_0x59cb22[_0xcdae('0x2e')]=_[_0xcdae('0x2d')](_0x66f426[_0xcdae('0x2a')],qs[_0xcdae('0x2f')](_0xde0b22['query'][_0xcdae('0x2f')]));_0x59cb22[_0xcdae('0x2e')]=_0x59cb22[_0xcdae('0x2e')][_0xcdae('0x30')]?_0x59cb22[_0xcdae('0x2e')]:_0x66f426[_0xcdae('0x2a')];if(!_0xde0b22[_0xcdae('0x25')][_0xcdae('0x44')](_0xcdae('0x45'))){_0x59cb22['limit']=qs[_0xcdae('0x11')](_0xde0b22['query'][_0xcdae('0x11')]);_0x59cb22['offset']=qs[_0xcdae('0x12')](_0xde0b22[_0xcdae('0x25')][_0xcdae('0x12')]);}_0x59cb22['order']=qs[_0xcdae('0x46')](_0xde0b22['query'][_0xcdae('0x46')]);_0x59cb22['where']=qs['filters'](_[_0xcdae('0x47')](_0xde0b22[_0xcdae('0x25')],_0x66f426[_0xcdae('0x2c')]));_0x59cb22[_0xcdae('0x48')][_0xcdae('0x49')]=_0x32b914['id'];if(_0xde0b22[_0xcdae('0x25')][_0xcdae('0x4a')]){_0x59cb22[_0xcdae('0x48')]=_[_0xcdae('0x32')](_0x59cb22[_0xcdae('0x48')],{'$or':_[_0xcdae('0x1c')](_0x59cb22['attributes'],function(_0x9c36c8){var _0xc41b62={};_0xc41b62[_0x9c36c8]={'$like':'%'+_0xde0b22[_0xcdae('0x25')][_0xcdae('0x4a')]+'%'};return _0xc41b62;})});}_0x59cb22=_[_0xcdae('0x32')]({},_0x59cb22,_0xde0b22['options']);return db[_0xcdae('0x43')]['findAll'](_0x59cb22);}})[_0xcdae('0x14')](function(_0x2a3fc8){if(_0x2a3fc8){return db[_0xcdae('0x4b')]['findAndCountAll']({'where':{'id':_[_0xcdae('0x1c')](_0x2a3fc8,_0xcdae('0x4c')),'role':_0xcdae('0x4d')},'attributes':['id',_0xcdae('0x19'),_0xcdae('0x4e'),_0xcdae('0x4f'),_0xcdae('0x50')]});}})['then'](function(_0x34026b){if(_0x34026b){return{'count':_0x34026b[_0xcdae('0x23')],'rows':_[_0xcdae('0x1c')](_0x34026b[_0xcdae('0x27')],function(_0x27cccd){return{'membername':_0x27cccd['name'],'UserId':_0x27cccd['id'],'queue_name':_0x158663[_0xcdae('0x19')],'ChatQueueId':_0x158663['id'],'interface':util['format'](_0xcdae('0x51'),_0xcdae('0x52'),_0x27cccd[_0xcdae('0x19')]),'penalty':0x0,'paused':_0x27cccd['chatPause'],'createdAt':_0x27cccd[_0xcdae('0x50')],'updatedAt':_0x27cccd[_0xcdae('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xae0978,_0x59cb22))[_0xcdae('0x28')](handleError(_0xae0978,null));};exports[_0xcdae('0x53')]=function(_0x1a2cb2,_0x522b8e){var _0x982ef={};var _0xd5f801={};var _0x491133;var _0x6b76ab;return db[_0xcdae('0x22')]['findOne']({'where':{'id':_0x1a2cb2[_0xcdae('0x40')]['id']}})['then'](handleEntityNotFound(_0x522b8e,null))['then'](function(_0x4ab7e9){if(_0x4ab7e9){_0x491133=_0x4ab7e9;_0xd5f801[_0xcdae('0x2a')]=_[_0xcdae('0x2b')](db['Team'][_0xcdae('0x1d')]);_0xd5f801[_0xcdae('0x25')]=_[_0xcdae('0x2b')](_0x1a2cb2['query']);_0xd5f801[_0xcdae('0x2c')]=_[_0xcdae('0x2d')](_0xd5f801[_0xcdae('0x2a')],_0xd5f801[_0xcdae('0x25')]);_0x982ef[_0xcdae('0x2e')]=_['intersection'](_0xd5f801['model'],qs[_0xcdae('0x2f')](_0x1a2cb2[_0xcdae('0x25')][_0xcdae('0x2f')]));_0x982ef[_0xcdae('0x2e')]=_0x982ef[_0xcdae('0x2e')][_0xcdae('0x30')]?_0x982ef[_0xcdae('0x2e')]:_0xd5f801[_0xcdae('0x2a')];_0x982ef['order']=qs[_0xcdae('0x46')](_0x1a2cb2[_0xcdae('0x25')][_0xcdae('0x46')]);_0x982ef[_0xcdae('0x48')]=qs['filters'](_[_0xcdae('0x47')](_0x1a2cb2[_0xcdae('0x25')],_0xd5f801[_0xcdae('0x2c')]));if(_0x1a2cb2[_0xcdae('0x25')][_0xcdae('0x4a')]){_0x982ef['where']=_[_0xcdae('0x32')](_0x982ef[_0xcdae('0x48')],{'$or':_[_0xcdae('0x1c')](_0x982ef[_0xcdae('0x2e')],function(_0x1ef414){var _0x1f7acc={};_0x1f7acc[_0x1ef414]={'$like':'%'+_0x1a2cb2[_0xcdae('0x25')][_0xcdae('0x4a')]+'%'};return _0x1f7acc;})});}_0x982ef=_['merge']({},_0x982ef,_0x1a2cb2[_0xcdae('0x54')]);return _0x491133[_0xcdae('0x53')](_0x982ef);}})['then'](function(_0x33455a){if(_0x33455a){_0x6b76ab=_0x33455a['length'];if(!_0x1a2cb2[_0xcdae('0x25')][_0xcdae('0x44')]('nolimit')){_0x982ef[_0xcdae('0x11')]=qs[_0xcdae('0x11')](_0x1a2cb2[_0xcdae('0x25')][_0xcdae('0x11')]);_0x982ef[_0xcdae('0x12')]=qs[_0xcdae('0x12')](_0x1a2cb2[_0xcdae('0x25')]['offset']);}return _0x491133[_0xcdae('0x53')](_0x982ef);}})[_0xcdae('0x14')](function(_0x31d98a){if(_0x31d98a){return _0x31d98a?{'count':_0x6b76ab,'rows':_0x31d98a}:null;}})[_0xcdae('0x14')](respondWithResult(_0x522b8e,null))[_0xcdae('0x28')](handleError(_0x522b8e,null));};exports[_0xcdae('0x55')]=function(_0x1aa7e1,_0x4f0464){var _0x40dbb6=_0x1aa7e1[_0xcdae('0x34')]['ids'];return db['Team']['findAll']({'where':{'id':_0x40dbb6},'attributes':['id'],'include':[{'model':db[_0xcdae('0x4b')],'as':_0xcdae('0x56'),'attributes':['id','name',_0xcdae('0x57'),_0xcdae('0x58'),'interface'],'raw':!![]}]})['then'](function(_0x475897){if(_0x475897){var _0x475a70=_[_0xcdae('0x59')](_0x475897,function(_0x38fa78){var _0x47309d=_0x38fa78[_0xcdae('0x16')]({'plain':!![]});return _0x47309d[_0xcdae('0x56')];});return db[_0xcdae('0x22')][_0xcdae('0x33')]({'where':{'id':_0x1aa7e1['params']['id']}})['then'](function(_0x4b85ea){return db[_0xcdae('0x5a')][_0xcdae('0x5b')](function(_0x4beda8){return _0x4b85ea['addTeams'](_0x40dbb6,{'transaction':_0x4beda8})[_0xcdae('0x14')](function(){return BPromise['each'](_0x475a70,function(_0x31cecc){return db[_0xcdae('0x43')][_0xcdae('0x5c')]({'where':{'UserId':_0x31cecc['id'],'ChatQueueId':_0x1aa7e1['params']['id']},'transaction':_0x4beda8});});})[_0xcdae('0x14')](function(){_0x475a70[_0xcdae('0x5d')](function(_0x1e9d93){socket[_0xcdae('0x5e')](_0xcdae('0x5f'),{'UserId':_0x1e9d93['id'],'ChatQueueId':_0x4b85ea['id']});});});});});}})[_0xcdae('0x14')](respondWithStatusCode(_0x4f0464,null))[_0xcdae('0x28')](handleError(_0x4f0464,null));};exports[_0xcdae('0x60')]=function(_0x28bbc5,_0xf8093a){return db['Team'][_0xcdae('0x26')]({'where':{'id':_0x28bbc5[_0xcdae('0x25')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xf8093a,null))[_0xcdae('0x14')](function(_0x6711c6){var _0x588852=_[_0xcdae('0x1c')](_0x6711c6,'id');var _0x2f1dba=[];var _0x21e337=[];var _0x46ce70=squel[_0xcdae('0x61')]();_0x46ce70[_0xcdae('0x62')](_0xcdae('0x63'))[_0xcdae('0x64')](_0xcdae('0x65'),'tq')['join'](_0xcdae('0x66'),'ut',_0xcdae('0x67'))[_0xcdae('0x48')](_0xcdae('0x68'),_0x28bbc5[_0xcdae('0x40')]['id']);for(var _0x171a0d=0x0;_0x171a0d<_0x6711c6[_0xcdae('0x30')];_0x171a0d+=0x1){let _0x1ee059=_0x6711c6[_0x171a0d];for(var _0x2e1b03=0x0;_0x2e1b03<_0x1ee059[_0xcdae('0x56')]['length'];_0x2e1b03+=0x1){let _0x1e6640=_0x1ee059[_0xcdae('0x56')][_0x2e1b03];var _0x255be5=_0x46ce70[_0xcdae('0x69')]();_0x255be5['where'](_0xcdae('0x6a'),_0x1e6640['id']);_0x21e337['push'](db[_0xcdae('0x5a')][_0xcdae('0x25')](_0x255be5['toString'](),{'type':db[_0xcdae('0x5a')]['QueryTypes'][_0xcdae('0x6b')]})[_0xcdae('0x14')](function(_0x310295){if(_0x310295[_0xcdae('0x30')]===0x1){return _0x1e6640['id'];}else{var _0x267e72=_[_0xcdae('0x6c')](_[_0xcdae('0x1c')](_0x310295,_0xcdae('0x6d')),function(_0x4c9c94){return _['includes'](_0x588852,_0x4c9c94);});if(_0x267e72){return _0x1e6640['id'];}}}));}}return BPromise[_0xcdae('0x6e')](_0x21e337)[_0xcdae('0x14')](function(_0x50eeeb){_0x2f1dba=_(_0x2f1dba)[_0xcdae('0x6f')](_0x50eeeb)[_0xcdae('0x70')]()['value']();return db[_0xcdae('0x22')][_0xcdae('0x33')]({'where':{'id':_0x28bbc5['params']['id']}})[_0xcdae('0x14')](function(_0xfc5fd2){return db[_0xcdae('0x5a')][_0xcdae('0x5b')](function(_0x2a8af3){return _0xfc5fd2[_0xcdae('0x60')](_0x28bbc5[_0xcdae('0x25')]['ids'],{'transaction':_0x2a8af3})[_0xcdae('0x14')](function(){if(!_[_0xcdae('0x71')](_0x2f1dba)){return _0xfc5fd2[_0xcdae('0x72')](_0x2f1dba,{'transaction':_0x2a8af3});}})['then'](function(){_0x2f1dba['forEach'](function(_0x18dbf9){socket[_0xcdae('0x5e')](_0xcdae('0x73'),{'UserId':_0x18dbf9,'ChatQueueId':_0xfc5fd2['id']});});});});});});})['then'](respondWithStatusCode(_0xf8093a,null))[_0xcdae('0x28')](handleError(_0xf8093a,null));};exports[_0xcdae('0x74')]=function(_0x3d6339,_0x54f924){return db['ChatQueue'][_0xcdae('0x33')]({'where':{'id':_0x3d6339[_0xcdae('0x40')]['id']}})[_0xcdae('0x14')](handleEntityNotFound(_0x54f924,null))['then'](function(_0x4320fa){if(_0x4320fa){return _0x4320fa[_0xcdae('0x74')](_0x3d6339[_0xcdae('0x34')][_0xcdae('0x75')],_[_0xcdae('0x76')](_0x3d6339[_0xcdae('0x34')],[_0xcdae('0x75'),'id'])||{})['spread'](function(_0x5418ce){for(var _0x2fec91=0x0;_0x2fec91<_0x3d6339[_0xcdae('0x34')][_0xcdae('0x75')][_0xcdae('0x30')];_0x2fec91+=0x1){socket['emit'](_0xcdae('0x5f'),{'UserId':Number(_0x3d6339[_0xcdae('0x34')][_0xcdae('0x75')][_0x2fec91]),'ChatQueueId':Number(_0x3d6339['params']['id'])});}return _0x5418ce;});}})[_0xcdae('0x14')](respondWithResult(_0x54f924,null))[_0xcdae('0x28')](handleError(_0x54f924,null));};exports[_0xcdae('0x72')]=function(_0x44822a,_0x2815d7){return db[_0xcdae('0x22')][_0xcdae('0x33')]({'where':{'id':_0x44822a[_0xcdae('0x40')]['id']}})[_0xcdae('0x14')](handleEntityNotFound(_0x2815d7,null))[_0xcdae('0x14')](function(_0x4935ff){if(_0x4935ff){return _0x4935ff[_0xcdae('0x72')](_0x44822a[_0xcdae('0x25')][_0xcdae('0x75')])['then'](function(){if(_[_0xcdae('0x77')](_0x44822a[_0xcdae('0x25')]['ids'])){for(var _0x4c0052=0x0;_0x4c0052<_0x44822a[_0xcdae('0x25')][_0xcdae('0x75')][_0xcdae('0x30')];_0x4c0052+=0x1){socket[_0xcdae('0x5e')](_0xcdae('0x73'),{'UserId':Number(_0x44822a[_0xcdae('0x25')]['ids'][_0x4c0052]),'ChatQueueId':Number(_0x44822a[_0xcdae('0x40')]['id'])});}}else{socket[_0xcdae('0x5e')](_0xcdae('0x73'),{'UserId':Number(_0x44822a[_0xcdae('0x25')][_0xcdae('0x75')]),'ChatQueueId':Number(_0x44822a[_0xcdae('0x40')]['id'])});}});}})[_0xcdae('0x14')](respondWithStatusCode(_0x2815d7,null))[_0xcdae('0x28')](handleError(_0x2815d7,null));};exports[_0xcdae('0x78')]=function(_0x139543,_0x372c99){var _0x1de8e1={};var _0x56d15a={};var _0x1a54e2;var _0xab77cb;return db[_0xcdae('0x22')][_0xcdae('0x79')]({'where':{'id':_0x139543[_0xcdae('0x40')]['id']}})[_0xcdae('0x14')](handleEntityNotFound(_0x372c99,null))['then'](function(_0x558214){if(_0x558214){_0x1a54e2=_0x558214;_0x56d15a[_0xcdae('0x2a')]=_['keys'](db[_0xcdae('0x4b')][_0xcdae('0x1d')]);_0x56d15a[_0xcdae('0x25')]=_[_0xcdae('0x2b')](_0x139543['query']);_0x56d15a[_0xcdae('0x2c')]=_[_0xcdae('0x2d')](_0x56d15a[_0xcdae('0x2a')],_0x56d15a[_0xcdae('0x25')]);_0x1de8e1[_0xcdae('0x2e')]=_['intersection'](_0x56d15a[_0xcdae('0x2a')],qs[_0xcdae('0x2f')](_0x139543[_0xcdae('0x25')]['fields']));_0x1de8e1[_0xcdae('0x2e')]=_0x1de8e1[_0xcdae('0x2e')][_0xcdae('0x30')]?_0x1de8e1['attributes']:_0x56d15a[_0xcdae('0x2a')];_0x1de8e1['order']=qs['sort'](_0x139543['query'][_0xcdae('0x46')]);_0x1de8e1[_0xcdae('0x48')]=qs[_0xcdae('0x2c')](_['pick'](_0x139543['query'],_0x56d15a['filters']));if(_0x139543[_0xcdae('0x25')][_0xcdae('0x4a')]){_0x1de8e1[_0xcdae('0x48')]=_[_0xcdae('0x32')](_0x1de8e1[_0xcdae('0x48')],{'$or':_[_0xcdae('0x1c')](_0x1de8e1['attributes'],function(_0x5915ca){var _0x869c30={};_0x869c30[_0x5915ca]={'$like':'%'+_0x139543[_0xcdae('0x25')][_0xcdae('0x4a')]+'%'};return _0x869c30;})});}_0x1de8e1=_[_0xcdae('0x32')]({},_0x1de8e1,_0x139543[_0xcdae('0x54')]);return _0x1a54e2[_0xcdae('0x78')](_0x1de8e1);}})[_0xcdae('0x14')](function(_0x402541){if(_0x402541){_0xab77cb=_0x402541[_0xcdae('0x30')];if(!_0x139543[_0xcdae('0x25')][_0xcdae('0x44')](_0xcdae('0x45'))){_0x1de8e1[_0xcdae('0x11')]=qs[_0xcdae('0x11')](_0x139543[_0xcdae('0x25')][_0xcdae('0x11')]);_0x1de8e1[_0xcdae('0x12')]=qs[_0xcdae('0x12')](_0x139543[_0xcdae('0x25')][_0xcdae('0x12')]);}return _0x1a54e2[_0xcdae('0x78')](_0x1de8e1);}})['then'](function(_0x194049){if(_0x194049){return _0x194049?{'count':_0xab77cb,'rows':_0x194049}:null;}})['then'](respondWithResult(_0x372c99,null))['catch'](handleError(_0x372c99,null));};
\ No newline at end of file
+var _0x7a00=['squel','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','then','get','UserProfileResource','destroy','error','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','catch','params','keys','query','filters','intersection','model','attributes','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ChatQueues','userProfileId','autoAssociation','update','describe','findOne','UserChatQueue','fields','hasOwnProperty','nolimit','sort','pick','ChatQueueId','merge','findAll','User','UserId','agent','chatPause','updatedAt','createdAt','rows','%s/%s','SIP','Team','order','filter','getTeams','ids','online','voicePause','interface','Agents','transaction','addTeams','forEach','emit','userChatQueue:save','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','all','union','compact','value','removeTeams','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','util','lodash'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x7a00,0x157));var _0x07a0=function(_0x2feda9,_0x400eb6){_0x2feda9=_0x2feda9-0x0;var _0x4a7a95=_0x7a00[_0x2feda9];return _0x4a7a95;};'use strict';var BPromise=require('bluebird');var util=require(_0x07a0('0x0'));var _=require(_0x07a0('0x1'));var squel=require(_0x07a0('0x2'));var Redis=require('ioredis');var qs=require(_0x07a0('0x3'));var logger=require(_0x07a0('0x4'))('api');var config=require(_0x07a0('0x5'));var db=require(_0x07a0('0x6'))['db'];config[_0x07a0('0x7')]=_[_0x07a0('0x8')](config[_0x07a0('0x7')],{'host':_0x07a0('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x07a0('0x7')]));require('./chatQueue.socket')[_0x07a0('0xa')](socket);function respondWithStatusCode(_0x4f91a9,_0x1f6755){_0x1f6755=_0x1f6755||0xcc;return function(_0x5b9818){if(_0x5b9818){return _0x4f91a9[_0x07a0('0xb')](_0x1f6755);}return _0x4f91a9[_0x07a0('0xc')](_0x1f6755)[_0x07a0('0xd')]();};}function respondWithResult(_0x1d38b8,_0x5c5cb6){_0x5c5cb6=_0x5c5cb6||0xc8;return function(_0x4d8c58){if(_0x4d8c58){return _0x1d38b8[_0x07a0('0xc')](_0x5c5cb6)[_0x07a0('0xe')](_0x4d8c58);}};}function respondWithFilteredResult(_0x5ba94f,_0x44953b){return function(_0x370dee){if(_0x370dee){var _0x751812=typeof _0x44953b['offset']==='undefined'&&typeof _0x44953b[_0x07a0('0xf')]===_0x07a0('0x10');var _0x58c855=_0x370dee[_0x07a0('0x11')];var _0x5d1e3a=_0x751812?0x0:_0x44953b[_0x07a0('0x12')];var _0x2b01a7=_0x751812?_0x370dee[_0x07a0('0x11')]:_0x44953b[_0x07a0('0x12')]+_0x44953b[_0x07a0('0xf')];var _0x3b7f1f;if(_0x2b01a7>=_0x58c855){_0x2b01a7=_0x58c855;_0x3b7f1f=0xc8;}else{_0x3b7f1f=0xce;}_0x5ba94f[_0x07a0('0xc')](_0x3b7f1f);return _0x5ba94f['set'](_0x07a0('0x13'),_0x5d1e3a+'-'+_0x2b01a7+'/'+_0x58c855)[_0x07a0('0xe')](_0x370dee);}return null;};}function saveUpdates(_0x2a373c){return function(_0x17ea0e){if(_0x17ea0e){return _0x17ea0e['update'](_0x2a373c)[_0x07a0('0x14')](function(_0x38e0b2){return _0x38e0b2;});}return null;};}function removeEntity(_0x374a54){return function(_0xa4accd){if(_0xa4accd){return _0xa4accd['destroy']()[_0x07a0('0x14')](function(){var _0x48710a=_0xa4accd[_0x07a0('0x15')]({'plain':!![]});var _0x16dc3b='ChatQueues';return db[_0x07a0('0x16')][_0x07a0('0x17')]({'where':{'type':_0x16dc3b,'resourceId':_0x48710a['id']}})[_0x07a0('0x14')](function(){return _0xa4accd;});})[_0x07a0('0x14')](function(){_0x374a54[_0x07a0('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32d251){return function(_0x5d3371){if(!_0x5d3371){_0x32d251[_0x07a0('0xb')](0x194);}return _0x5d3371;};}function handleError(_0x2ed14d,_0x4776f5){_0x4776f5=_0x4776f5||0x1f4;return function(_0x58e464){logger[_0x07a0('0x18')](_0x58e464[_0x07a0('0x19')]);if(_0x58e464[_0x07a0('0x1a')]){delete _0x58e464['name'];}_0x2ed14d['status'](_0x4776f5)['send'](_0x58e464);};}exports[_0x07a0('0x1b')]=function(_0x5e6c3e,_0x36434d){var _0x488833={};var _0x3690af={'count':0x0,'rows':[]};var _0x256da2=_[_0x07a0('0x1c')](db[_0x07a0('0x1d')][_0x07a0('0x1e')],function(_0x4d7262){return{'name':_0x4d7262[_0x07a0('0x1f')],'type':_0x4d7262[_0x07a0('0x20')][_0x07a0('0x21')]};});_0x488833=qs[_0x07a0('0x22')](_0x256da2,_0x5e6c3e);var _0x383cb4={'where':_0x488833[_0x07a0('0x23')]};return db[_0x07a0('0x1d')]['count'](_0x383cb4)[_0x07a0('0x14')](function(_0x4dd03f){_0x3690af[_0x07a0('0x11')]=_0x4dd03f;_0x488833[_0x07a0('0x24')]=qs['include'](_0x5e6c3e['query']);return db['ChatQueue']['findAll'](_0x488833);})['then'](function(_0x4f7cd6){_0x3690af['rows']=_0x4f7cd6;return _0x3690af;})[_0x07a0('0x14')](respondWithFilteredResult(_0x36434d,_0x488833))[_0x07a0('0x25')](handleError(_0x36434d,null));};exports['show']=function(_0x5676c0,_0x34480d){var _0x251217={'raw':!![],'where':{'id':_0x5676c0[_0x07a0('0x26')]['id']}},_0x3dd7d6={};_0x3dd7d6['model']=_[_0x07a0('0x27')](db['ChatQueue'][_0x07a0('0x1e')]);_0x3dd7d6['query']=_[_0x07a0('0x27')](_0x5676c0[_0x07a0('0x28')]);_0x3dd7d6[_0x07a0('0x29')]=_[_0x07a0('0x2a')](_0x3dd7d6[_0x07a0('0x2b')],_0x3dd7d6[_0x07a0('0x28')]);_0x251217[_0x07a0('0x2c')]=_[_0x07a0('0x2a')](_0x3dd7d6[_0x07a0('0x2b')],qs['fields'](_0x5676c0['query']['fields']));_0x251217[_0x07a0('0x2c')]=_0x251217['attributes'][_0x07a0('0x2d')]?_0x251217[_0x07a0('0x2c')]:_0x3dd7d6[_0x07a0('0x2b')];if(_0x5676c0[_0x07a0('0x28')]['includeAll']){_0x251217[_0x07a0('0x24')]=[{'all':!![]}];}_0x251217=_['merge']({},_0x251217,_0x5676c0[_0x07a0('0x2e')]);return db['ChatQueue'][_0x07a0('0x2f')](_0x251217)[_0x07a0('0x14')](handleEntityNotFound(_0x34480d,null))[_0x07a0('0x14')](respondWithResult(_0x34480d,null))[_0x07a0('0x25')](handleError(_0x34480d,null));};exports['create']=function(_0x3bf396,_0x1304d6){return db[_0x07a0('0x1d')][_0x07a0('0x30')](_0x3bf396[_0x07a0('0x31')],{})[_0x07a0('0x14')](function(_0x2dc37f){var _0x5406fe=_0x3bf396['user'][_0x07a0('0x15')]({'plain':!![]});if(!_0x5406fe)throw new Error(_0x07a0('0x32'));if(_0x5406fe['role']===_0x07a0('0x33')){var _0x2145ad=_0x2dc37f[_0x07a0('0x15')]({'plain':!![]});var _0x4dffa7=_0x07a0('0x34');return db['UserProfileSection'][_0x07a0('0x2f')]({'where':{'name':_0x4dffa7,'userProfileId':_0x5406fe[_0x07a0('0x35')]},'raw':!![]})[_0x07a0('0x14')](function(_0x4fa680){if(_0x4fa680&&_0x4fa680[_0x07a0('0x36')]===0x0){return db['UserProfileResource'][_0x07a0('0x30')]({'name':_0x2145ad[_0x07a0('0x1a')],'resourceId':_0x2145ad['id'],'type':_0x4fa680[_0x07a0('0x1a')],'sectionId':_0x4fa680['id']},{})[_0x07a0('0x14')](function(){return _0x2dc37f;});}else{return _0x2dc37f;}})[_0x07a0('0x25')](function(_0x2eeea7){logger[_0x07a0('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2eeea7);throw _0x2eeea7;});}return _0x2dc37f;})['then'](respondWithResult(_0x1304d6,0xc9))[_0x07a0('0x25')](handleError(_0x1304d6,null));};exports[_0x07a0('0x37')]=function(_0x1e53ad,_0x480c3d){if(_0x1e53ad[_0x07a0('0x31')]['id']){delete _0x1e53ad['body']['id'];}return db['ChatQueue'][_0x07a0('0x2f')]({'where':{'id':_0x1e53ad[_0x07a0('0x26')]['id']}})[_0x07a0('0x14')](handleEntityNotFound(_0x480c3d,null))[_0x07a0('0x14')](saveUpdates(_0x1e53ad['body'],null))[_0x07a0('0x14')](respondWithResult(_0x480c3d,null))['catch'](handleError(_0x480c3d,null));};exports[_0x07a0('0x17')]=function(_0x465191,_0x40527c){return db[_0x07a0('0x1d')][_0x07a0('0x2f')]({'where':{'id':_0x465191[_0x07a0('0x26')]['id']}})['then'](handleEntityNotFound(_0x40527c,null))[_0x07a0('0x14')](removeEntity(_0x40527c,null))[_0x07a0('0x25')](handleError(_0x40527c,null));};exports[_0x07a0('0x38')]=function(_0x568d95,_0x3379c9){return db['ChatQueue'][_0x07a0('0x38')]()['then'](respondWithResult(_0x3379c9,null))[_0x07a0('0x25')](handleError(_0x3379c9,null));};exports['getMembers']=function(_0xe54dae,_0x4a3dd6){var _0x39b72d={'raw':!![],'where':{}},_0x2b9bb8={},_0xb6e5e8;return db['ChatQueue'][_0x07a0('0x39')]({'where':{'id':_0xe54dae[_0x07a0('0x26')]['id']}})[_0x07a0('0x14')](handleEntityNotFound(_0x4a3dd6,null))['then'](function(_0x11d7a7){if(_0x11d7a7){_0xb6e5e8=_0x11d7a7[_0x07a0('0x15')]({'plain':!![]});_0x2b9bb8['model']=_[_0x07a0('0x27')](db[_0x07a0('0x3a')]['rawAttributes']);_0x2b9bb8[_0x07a0('0x28')]=_['keys'](_0xe54dae[_0x07a0('0x28')]);_0x2b9bb8[_0x07a0('0x29')]=_['intersection'](_0x2b9bb8[_0x07a0('0x2b')],_0x2b9bb8[_0x07a0('0x28')]);_0x39b72d[_0x07a0('0x2c')]=_[_0x07a0('0x2a')](_0x2b9bb8[_0x07a0('0x2b')],qs[_0x07a0('0x3b')](_0xe54dae['query'][_0x07a0('0x3b')]));_0x39b72d[_0x07a0('0x2c')]=_0x39b72d['attributes'][_0x07a0('0x2d')]?_0x39b72d[_0x07a0('0x2c')]:_0x2b9bb8[_0x07a0('0x2b')];if(!_0xe54dae['query'][_0x07a0('0x3c')](_0x07a0('0x3d'))){_0x39b72d['limit']=qs[_0x07a0('0xf')](_0xe54dae[_0x07a0('0x28')][_0x07a0('0xf')]);_0x39b72d[_0x07a0('0x12')]=qs['offset'](_0xe54dae[_0x07a0('0x28')][_0x07a0('0x12')]);}_0x39b72d['order']=qs['sort'](_0xe54dae['query'][_0x07a0('0x3e')]);_0x39b72d[_0x07a0('0x23')]=qs[_0x07a0('0x29')](_[_0x07a0('0x3f')](_0xe54dae['query'],_0x2b9bb8[_0x07a0('0x29')]));_0x39b72d[_0x07a0('0x23')][_0x07a0('0x40')]=_0x11d7a7['id'];if(_0xe54dae[_0x07a0('0x28')]['filter']){_0x39b72d[_0x07a0('0x23')]=_[_0x07a0('0x41')](_0x39b72d['where'],{'$or':_[_0x07a0('0x1c')](_0x39b72d[_0x07a0('0x2c')],function(_0x2e8088){var _0x1109fa={};_0x1109fa[_0x2e8088]={'$like':'%'+_0xe54dae[_0x07a0('0x28')]['filter']+'%'};return _0x1109fa;})});}_0x39b72d=_[_0x07a0('0x41')]({},_0x39b72d,_0xe54dae[_0x07a0('0x2e')]);return db['UserChatQueue'][_0x07a0('0x42')](_0x39b72d);}})[_0x07a0('0x14')](function(_0x1ff96d){if(_0x1ff96d){return db[_0x07a0('0x43')]['findAndCountAll']({'where':{'id':_[_0x07a0('0x1c')](_0x1ff96d,_0x07a0('0x44')),'role':_0x07a0('0x45')},'attributes':['id',_0x07a0('0x1a'),_0x07a0('0x46'),_0x07a0('0x47'),_0x07a0('0x48')]});}})[_0x07a0('0x14')](function(_0x5e0515){if(_0x5e0515){return{'count':_0x5e0515[_0x07a0('0x11')],'rows':_[_0x07a0('0x1c')](_0x5e0515[_0x07a0('0x49')],function(_0x273a62){return{'membername':_0x273a62[_0x07a0('0x1a')],'UserId':_0x273a62['id'],'queue_name':_0xb6e5e8[_0x07a0('0x1a')],'ChatQueueId':_0xb6e5e8['id'],'interface':util['format'](_0x07a0('0x4a'),_0x07a0('0x4b'),_0x273a62['name']),'penalty':0x0,'paused':_0x273a62[_0x07a0('0x46')],'createdAt':_0x273a62['createdAt'],'updatedAt':_0x273a62[_0x07a0('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x07a0('0x14')](respondWithFilteredResult(_0x4a3dd6,_0x39b72d))[_0x07a0('0x25')](handleError(_0x4a3dd6,null));};exports['getTeams']=function(_0x177e0a,_0x5b963f){var _0x35769d={};var _0x5e92a1={};var _0x323782;var _0x42827b;return db[_0x07a0('0x1d')][_0x07a0('0x39')]({'where':{'id':_0x177e0a[_0x07a0('0x26')]['id']}})[_0x07a0('0x14')](handleEntityNotFound(_0x5b963f,null))[_0x07a0('0x14')](function(_0x4f9d11){if(_0x4f9d11){_0x323782=_0x4f9d11;_0x5e92a1[_0x07a0('0x2b')]=_['keys'](db[_0x07a0('0x4c')][_0x07a0('0x1e')]);_0x5e92a1[_0x07a0('0x28')]=_[_0x07a0('0x27')](_0x177e0a[_0x07a0('0x28')]);_0x5e92a1[_0x07a0('0x29')]=_[_0x07a0('0x2a')](_0x5e92a1[_0x07a0('0x2b')],_0x5e92a1[_0x07a0('0x28')]);_0x35769d[_0x07a0('0x2c')]=_[_0x07a0('0x2a')](_0x5e92a1['model'],qs[_0x07a0('0x3b')](_0x177e0a['query'][_0x07a0('0x3b')]));_0x35769d['attributes']=_0x35769d[_0x07a0('0x2c')][_0x07a0('0x2d')]?_0x35769d['attributes']:_0x5e92a1[_0x07a0('0x2b')];_0x35769d[_0x07a0('0x4d')]=qs[_0x07a0('0x3e')](_0x177e0a[_0x07a0('0x28')][_0x07a0('0x3e')]);_0x35769d[_0x07a0('0x23')]=qs['filters'](_[_0x07a0('0x3f')](_0x177e0a[_0x07a0('0x28')],_0x5e92a1[_0x07a0('0x29')]));if(_0x177e0a[_0x07a0('0x28')][_0x07a0('0x4e')]){_0x35769d[_0x07a0('0x23')]=_[_0x07a0('0x41')](_0x35769d[_0x07a0('0x23')],{'$or':_[_0x07a0('0x1c')](_0x35769d['attributes'],function(_0x39feed){var _0x379e7f={};_0x379e7f[_0x39feed]={'$like':'%'+_0x177e0a[_0x07a0('0x28')]['filter']+'%'};return _0x379e7f;})});}_0x35769d=_[_0x07a0('0x41')]({},_0x35769d,_0x177e0a[_0x07a0('0x2e')]);return _0x323782[_0x07a0('0x4f')](_0x35769d);}})[_0x07a0('0x14')](function(_0x53a10c){if(_0x53a10c){_0x42827b=_0x53a10c[_0x07a0('0x2d')];if(!_0x177e0a[_0x07a0('0x28')][_0x07a0('0x3c')](_0x07a0('0x3d'))){_0x35769d['limit']=qs['limit'](_0x177e0a[_0x07a0('0x28')][_0x07a0('0xf')]);_0x35769d[_0x07a0('0x12')]=qs[_0x07a0('0x12')](_0x177e0a[_0x07a0('0x28')][_0x07a0('0x12')]);}return _0x323782[_0x07a0('0x4f')](_0x35769d);}})[_0x07a0('0x14')](function(_0x128c1c){if(_0x128c1c){return _0x128c1c?{'count':_0x42827b,'rows':_0x128c1c}:null;}})['then'](respondWithResult(_0x5b963f,null))[_0x07a0('0x25')](handleError(_0x5b963f,null));};exports['addTeams']=function(_0x46b925,_0x5d2e88){var _0x29d273=_0x46b925[_0x07a0('0x31')][_0x07a0('0x50')];return db[_0x07a0('0x4c')][_0x07a0('0x42')]({'where':{'id':_0x29d273},'attributes':['id'],'include':[{'model':db[_0x07a0('0x43')],'as':'Agents','attributes':['id',_0x07a0('0x1a'),_0x07a0('0x51'),_0x07a0('0x52'),_0x07a0('0x53')],'raw':!![]}]})[_0x07a0('0x14')](function(_0x14b416){if(_0x14b416){var _0x2747d8=_['flatMap'](_0x14b416,function(_0x4b736e){var _0x491843=_0x4b736e[_0x07a0('0x15')]({'plain':!![]});return _0x491843[_0x07a0('0x54')];});return db[_0x07a0('0x1d')][_0x07a0('0x2f')]({'where':{'id':_0x46b925[_0x07a0('0x26')]['id']}})['then'](function(_0x272b1c){return db['sequelize'][_0x07a0('0x55')](function(_0x3382a0){return _0x272b1c[_0x07a0('0x56')](_0x29d273,{'transaction':_0x3382a0})[_0x07a0('0x14')](function(){return BPromise['each'](_0x2747d8,function(_0x52925c){return db[_0x07a0('0x3a')]['findOrCreate']({'where':{'UserId':_0x52925c['id'],'ChatQueueId':_0x46b925[_0x07a0('0x26')]['id']},'transaction':_0x3382a0});});})['then'](function(){_0x2747d8[_0x07a0('0x57')](function(_0x55910d){socket[_0x07a0('0x58')](_0x07a0('0x59'),{'UserId':_0x55910d['id'],'ChatQueueId':_0x272b1c['id']});});});});});}})[_0x07a0('0x14')](respondWithStatusCode(_0x5d2e88,null))[_0x07a0('0x25')](handleError(_0x5d2e88,null));};exports['removeTeams']=function(_0xe69383,_0x32df3b){return db['Team']['findAll']({'where':{'id':_0xe69383[_0x07a0('0x28')]['ids']},'attributes':['id'],'include':[{'model':db[_0x07a0('0x43')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x07a0('0x14')](handleEntityNotFound(_0x32df3b,null))['then'](function(_0x42ed2e){var _0xdb9b23=_[_0x07a0('0x1c')](_0x42ed2e,'id');var _0x328a94=[];var _0x22ac14=[];var _0x34a58c=squel[_0x07a0('0x5a')]();_0x34a58c[_0x07a0('0x5b')](_0x07a0('0x5c'))[_0x07a0('0x5d')](_0x07a0('0x5e'),'tq')[_0x07a0('0x5f')]('user_has_teams','ut',_0x07a0('0x60'))[_0x07a0('0x23')](_0x07a0('0x61'),_0xe69383[_0x07a0('0x26')]['id']);for(var _0x126225=0x0;_0x126225<_0x42ed2e[_0x07a0('0x2d')];_0x126225+=0x1){let _0x1f8845=_0x42ed2e[_0x126225];for(var _0x3f9ed1=0x0;_0x3f9ed1<_0x1f8845[_0x07a0('0x54')][_0x07a0('0x2d')];_0x3f9ed1+=0x1){let _0x133a55=_0x1f8845[_0x07a0('0x54')][_0x3f9ed1];var _0xa33a6d=_0x34a58c['clone']();_0xa33a6d[_0x07a0('0x23')]('ut.UserId\x20=\x20?',_0x133a55['id']);_0x22ac14[_0x07a0('0x62')](db['sequelize']['query'](_0xa33a6d[_0x07a0('0x63')](),{'type':db[_0x07a0('0x64')][_0x07a0('0x65')][_0x07a0('0x66')]})[_0x07a0('0x14')](function(_0x28f72d){if(_0x28f72d[_0x07a0('0x2d')]===0x1){return _0x133a55['id'];}else{var _0x5e4dc7=_['every'](_[_0x07a0('0x1c')](_0x28f72d,'TeamId'),function(_0x51cd7f){return _['includes'](_0xdb9b23,_0x51cd7f);});if(_0x5e4dc7){return _0x133a55['id'];}}}));}}return BPromise[_0x07a0('0x67')](_0x22ac14)[_0x07a0('0x14')](function(_0x50336d){_0x328a94=_(_0x328a94)[_0x07a0('0x68')](_0x50336d)[_0x07a0('0x69')]()[_0x07a0('0x6a')]();return db[_0x07a0('0x1d')]['find']({'where':{'id':_0xe69383[_0x07a0('0x26')]['id']}})[_0x07a0('0x14')](function(_0x4cb88b){return db[_0x07a0('0x64')][_0x07a0('0x55')](function(_0x22a137){return _0x4cb88b[_0x07a0('0x6b')](_0xe69383[_0x07a0('0x28')]['ids'],{'transaction':_0x22a137})[_0x07a0('0x14')](function(){if(!_['isEmpty'](_0x328a94)){return _0x4cb88b['removeAgents'](_0x328a94,{'transaction':_0x22a137});}})[_0x07a0('0x14')](function(){_0x328a94[_0x07a0('0x57')](function(_0x32fa11){socket[_0x07a0('0x58')](_0x07a0('0x6c'),{'UserId':_0x32fa11,'ChatQueueId':_0x4cb88b['id']});});});});});});})[_0x07a0('0x14')](respondWithStatusCode(_0x32df3b,null))['catch'](handleError(_0x32df3b,null));};exports[_0x07a0('0x6d')]=function(_0x5055b6,_0x7dc327){return db[_0x07a0('0x1d')][_0x07a0('0x2f')]({'where':{'id':_0x5055b6['params']['id']}})[_0x07a0('0x14')](handleEntityNotFound(_0x7dc327,null))[_0x07a0('0x14')](function(_0x345577){if(_0x345577){return _0x345577['addAgents'](_0x5055b6[_0x07a0('0x31')]['ids'],_[_0x07a0('0x6e')](_0x5055b6['body'],[_0x07a0('0x50'),'id'])||{})[_0x07a0('0x6f')](function(_0x5d351e){for(var _0x57d475=0x0;_0x57d475<_0x5055b6[_0x07a0('0x31')]['ids'][_0x07a0('0x2d')];_0x57d475+=0x1){socket[_0x07a0('0x58')](_0x07a0('0x59'),{'UserId':Number(_0x5055b6[_0x07a0('0x31')][_0x07a0('0x50')][_0x57d475]),'ChatQueueId':Number(_0x5055b6[_0x07a0('0x26')]['id'])});}return _0x5d351e;});}})['then'](respondWithResult(_0x7dc327,null))[_0x07a0('0x25')](handleError(_0x7dc327,null));};exports[_0x07a0('0x70')]=function(_0x26b858,_0x192464){return db[_0x07a0('0x1d')][_0x07a0('0x2f')]({'where':{'id':_0x26b858[_0x07a0('0x26')]['id']}})[_0x07a0('0x14')](handleEntityNotFound(_0x192464,null))['then'](function(_0x37f0f9){if(_0x37f0f9){return _0x37f0f9['removeAgents'](_0x26b858['query']['ids'])[_0x07a0('0x14')](function(){if(_[_0x07a0('0x71')](_0x26b858[_0x07a0('0x28')][_0x07a0('0x50')])){for(var _0x557956=0x0;_0x557956<_0x26b858[_0x07a0('0x28')]['ids'][_0x07a0('0x2d')];_0x557956+=0x1){socket[_0x07a0('0x58')]('userChatQueue:remove',{'UserId':Number(_0x26b858[_0x07a0('0x28')]['ids'][_0x557956]),'ChatQueueId':Number(_0x26b858[_0x07a0('0x26')]['id'])});}}else{socket[_0x07a0('0x58')](_0x07a0('0x6c'),{'UserId':Number(_0x26b858['query'][_0x07a0('0x50')]),'ChatQueueId':Number(_0x26b858['params']['id'])});}});}})[_0x07a0('0x14')](respondWithStatusCode(_0x192464,null))['catch'](handleError(_0x192464,null));};exports['getAgents']=function(_0x58b09d,_0x2f31ba){var _0x4ef68e={};var _0x106668={};var _0x3de7fe;var _0x56f7b6;return db[_0x07a0('0x1d')][_0x07a0('0x39')]({'where':{'id':_0x58b09d['params']['id']}})[_0x07a0('0x14')](handleEntityNotFound(_0x2f31ba,null))['then'](function(_0x25b2dd){if(_0x25b2dd){_0x3de7fe=_0x25b2dd;_0x106668['model']=_[_0x07a0('0x27')](db[_0x07a0('0x43')][_0x07a0('0x1e')]);_0x106668[_0x07a0('0x28')]=_['keys'](_0x58b09d[_0x07a0('0x28')]);_0x106668['filters']=_['intersection'](_0x106668[_0x07a0('0x2b')],_0x106668[_0x07a0('0x28')]);_0x4ef68e[_0x07a0('0x2c')]=_[_0x07a0('0x2a')](_0x106668[_0x07a0('0x2b')],qs['fields'](_0x58b09d[_0x07a0('0x28')][_0x07a0('0x3b')]));_0x4ef68e[_0x07a0('0x2c')]=_0x4ef68e[_0x07a0('0x2c')]['length']?_0x4ef68e[_0x07a0('0x2c')]:_0x106668[_0x07a0('0x2b')];_0x4ef68e[_0x07a0('0x4d')]=qs[_0x07a0('0x3e')](_0x58b09d[_0x07a0('0x28')]['sort']);_0x4ef68e['where']=qs[_0x07a0('0x29')](_[_0x07a0('0x3f')](_0x58b09d[_0x07a0('0x28')],_0x106668[_0x07a0('0x29')]));if(_0x58b09d[_0x07a0('0x28')]['filter']){_0x4ef68e[_0x07a0('0x23')]=_[_0x07a0('0x41')](_0x4ef68e[_0x07a0('0x23')],{'$or':_['map'](_0x4ef68e[_0x07a0('0x2c')],function(_0x356b5c){var _0x22b4cf={};_0x22b4cf[_0x356b5c]={'$like':'%'+_0x58b09d[_0x07a0('0x28')][_0x07a0('0x4e')]+'%'};return _0x22b4cf;})});}_0x4ef68e=_[_0x07a0('0x41')]({},_0x4ef68e,_0x58b09d[_0x07a0('0x2e')]);return _0x3de7fe[_0x07a0('0x72')](_0x4ef68e);}})['then'](function(_0x2f63fd){if(_0x2f63fd){_0x56f7b6=_0x2f63fd[_0x07a0('0x2d')];if(!_0x58b09d['query']['hasOwnProperty'](_0x07a0('0x3d'))){_0x4ef68e['limit']=qs[_0x07a0('0xf')](_0x58b09d[_0x07a0('0x28')][_0x07a0('0xf')]);_0x4ef68e[_0x07a0('0x12')]=qs[_0x07a0('0x12')](_0x58b09d[_0x07a0('0x28')][_0x07a0('0x12')]);}return _0x3de7fe[_0x07a0('0x72')](_0x4ef68e);}})[_0x07a0('0x14')](function(_0x284fd4){if(_0x284fd4){return _0x284fd4?{'count':_0x56f7b6,'rows':_0x284fd4}:null;}})['then'](respondWithResult(_0x2f31ba,null))[_0x07a0('0x25')](handleError(_0x2f31ba,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 8594a5b..1108af3 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 _0x7c17=['exports','events','../../mysqldb','ChatQueue','setMaxListeners','remove','hasOwnProperty','hook'];(function(_0xdd31c,_0x484018){var _0x11b6ce=function(_0x178aca){while(--_0x178aca){_0xdd31c['push'](_0xdd31c['shift']());}};_0x11b6ce(++_0x484018);}(_0x7c17,0x149));var _0x77c1=function(_0x266ef6,_0x243c05){_0x266ef6=_0x266ef6-0x0;var _0x3178f6=_0x7c17[_0x266ef6];return _0x3178f6;};'use strict';var EventEmitter=require(_0x77c1('0x0'));var ChatQueue=require(_0x77c1('0x1'))['db'][_0x77c1('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x77c1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x77c1('0x4')};function emitEvent(_0x11c0e5){return function(_0x5d368e,_0x46ef1c,_0x20dd51){ChatQueueEvents['emit'](_0x11c0e5+':'+_0x5d368e['id'],_0x5d368e);ChatQueueEvents['emit'](_0x11c0e5,_0x5d368e);_0x20dd51(null);};}for(var e in events){if(events[_0x77c1('0x5')](e)){var event=events[e];ChatQueue[_0x77c1('0x6')](e,emitEvent(event));}}module[_0x77c1('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x3d5b=['exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x28a5eb,_0x513eac){var _0xb4d010=function(_0x201a4d){while(--_0x201a4d){_0x28a5eb['push'](_0x28a5eb['shift']());}};_0xb4d010(++_0x513eac);}(_0x3d5b,0x85));var _0xb3d5=function(_0x2e8795,_0x9298e6){_0x2e8795=_0x2e8795-0x0;var _0x36f65a=_0x3d5b[_0x2e8795];return _0x36f65a;};'use strict';var EventEmitter=require(_0xb3d5('0x0'));var ChatQueue=require(_0xb3d5('0x1'))['db'][_0xb3d5('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb3d5('0x3')](0x0);var events={'afterCreate':_0xb3d5('0x4'),'afterUpdate':_0xb3d5('0x5'),'afterDestroy':_0xb3d5('0x6')};function emitEvent(_0x7e0d11){return function(_0xd5a49b,_0x437822,_0x5481a2){ChatQueueEvents[_0xb3d5('0x7')](_0x7e0d11+':'+_0xd5a49b['id'],_0xd5a49b);ChatQueueEvents[_0xb3d5('0x7')](_0x7e0d11,_0xd5a49b);_0x5481a2(null);};}for(var e in events){if(events[_0xb3d5('0x8')](e)){var event=events[e];ChatQueue[_0xb3d5('0x9')](e,emitEvent(event));}}module[_0xb3d5('0xa')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 56bc311..495cc27 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 _0x7e87=['ChatQueue','chat_queues','lodash','util','bluebird','request-promise','rimraf','./chatQueue.attributes','define'];(function(_0x19a679,_0x480403){var _0x5106ff=function(_0x177019){while(--_0x177019){_0x19a679['push'](_0x19a679['shift']());}};_0x5106ff(++_0x480403);}(_0x7e87,0x1cd));var _0x77e8=function(_0x37163a,_0xe854c2){_0x37163a=_0x37163a-0x0;var _0x4c7bcc=_0x7e87[_0x37163a];return _0x4c7bcc;};'use strict';var _=require(_0x77e8('0x0'));var util=require(_0x77e8('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x77e8('0x2'));var rp=require(_0x77e8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77e8('0x4'));var config=require('../../config/environment');var attributes=require(_0x77e8('0x5'));module['exports']=function(_0x3e827a,_0x4ed6a7){return _0x3e827a[_0x77e8('0x6')](_0x77e8('0x7'),attributes,{'tableName':_0x77e8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4f61=['path','rimraf','../../config/environment','./chatQueue.attributes','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3ed4bc,_0x4f445d){var _0x28c4b0=function(_0x4ced39){while(--_0x4ced39){_0x3ed4bc['push'](_0x3ed4bc['shift']());}};_0x28c4b0(++_0x4f445d);}(_0x4f61,0x7e));var _0x14f6=function(_0x1e9d45,_0x1ad469){_0x1e9d45=_0x1e9d45-0x0;var _0x3e0c94=_0x4f61[_0x1e9d45];return _0x3e0c94;};'use strict';var _=require(_0x14f6('0x0'));var util=require(_0x14f6('0x1'));var logger=require(_0x14f6('0x2'))(_0x14f6('0x3'));var moment=require(_0x14f6('0x4'));var BPromise=require('bluebird');var rp=require(_0x14f6('0x5'));var fs=require('fs');var path=require(_0x14f6('0x6'));var rimraf=require(_0x14f6('0x7'));var config=require(_0x14f6('0x8'));var attributes=require(_0x14f6('0x9'));module['exports']=function(_0x592e97,_0x57a6a5){return _0x592e97['define'](_0x14f6('0xa'),attributes,{'tableName':_0x14f6('0xb'),'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 7b2c898..b566b3c 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 _0x8425=['catch','ChatQueue','raw','options','where','attributes','include','map','model','GetChatQueue','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x26b622,_0x237e9e){var _0x58a028=function(_0xde1652){while(--_0xde1652){_0x26b622['push'](_0x26b622['shift']());}};_0x58a028(++_0x237e9e);}(_0x8425,0x13b));var _0x5842=function(_0x3b5d33,_0x417885){_0x3b5d33=_0x3b5d33-0x0;var _0x6934c8=_0x8425[_0x3b5d33];return _0x6934c8;};'use strict';var _=require(_0x5842('0x0'));var util=require(_0x5842('0x1'));var moment=require(_0x5842('0x2'));var BPromise=require(_0x5842('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5842('0x4'));var db=require(_0x5842('0x5'))['db'];var utils=require(_0x5842('0x6'));var logger=require(_0x5842('0x7'))(_0x5842('0x8'));var config=require(_0x5842('0x9'));var jayson=require(_0x5842('0xa'));var client=jayson['client'][_0x5842('0xb')]({'port':0x232a});config[_0x5842('0xc')]=_[_0x5842('0xd')](config[_0x5842('0xc')],{'host':_0x5842('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5842('0xf'))['register'](socket);function respondWithRpcPromise(_0xc55038,_0x2e6b84,_0x33e5f7){return new BPromise(function(_0x2b6c6d,_0x11cb15){return client[_0x5842('0x10')](_0xc55038,_0x33e5f7)[_0x5842('0x11')](function(_0x1c7cf4){logger[_0x5842('0x12')](_0x5842('0x13'),_0x2e6b84,_0x5842('0x14'));logger[_0x5842('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2e6b84,_0x5842('0x14'),JSON[_0x5842('0x16')](_0x1c7cf4));if(_0x1c7cf4[_0x5842('0x17')]){if(_0x1c7cf4[_0x5842('0x17')][_0x5842('0x18')]===0x1f4){logger[_0x5842('0x17')](_0x5842('0x13'),_0x2e6b84,_0x1c7cf4[_0x5842('0x17')][_0x5842('0x19')]);return _0x11cb15(_0x1c7cf4[_0x5842('0x17')][_0x5842('0x19')]);}logger[_0x5842('0x17')](_0x5842('0x13'),_0x2e6b84,_0x1c7cf4[_0x5842('0x17')][_0x5842('0x19')]);return _0x2b6c6d(_0x1c7cf4['error'][_0x5842('0x19')]);}else{logger[_0x5842('0x12')](_0x5842('0x13'),_0x2e6b84,'request\x20sent');_0x2b6c6d(_0x1c7cf4[_0x5842('0x1a')][_0x5842('0x19')]);}})[_0x5842('0x1b')](function(_0x25feee){logger['error']('ChatQueue,\x20%s,\x20%s',_0x2e6b84,_0x25feee);_0x11cb15(_0x25feee);});});}exports['GetChatQueue']=function(_0x3702d1){var _0x4d0a72=this;return new Promise(function(_0x354e90,_0x3a3fc9){return db[_0x5842('0x1c')]['findAll']({'raw':_0x3702d1['options']?_0x3702d1['options'][_0x5842('0x1d')]===undefined?!![]:![]:!![],'where':_0x3702d1[_0x5842('0x1e')]?_0x3702d1[_0x5842('0x1e')][_0x5842('0x1f')]||null:null,'attributes':_0x3702d1[_0x5842('0x1e')]?_0x3702d1['options'][_0x5842('0x20')]||null:null,'limit':_0x3702d1[_0x5842('0x1e')]?_0x3702d1[_0x5842('0x1e')]['limit']||null:null,'include':_0x3702d1[_0x5842('0x1e')]?_0x3702d1[_0x5842('0x1e')][_0x5842('0x21')]?_[_0x5842('0x22')](_0x3702d1[_0x5842('0x1e')][_0x5842('0x21')],function(_0x34421b){return{'model':db[_0x34421b['model']],'as':_0x34421b['as'],'attributes':_0x34421b['attributes'],'include':_0x34421b['include']?_[_0x5842('0x22')](_0x34421b[_0x5842('0x21')],function(_0x2be6b8){return{'model':db[_0x2be6b8[_0x5842('0x23')]],'as':_0x2be6b8['as'],'attributes':_0x2be6b8[_0x5842('0x20')],'include':_0x2be6b8['include']?_['map'](_0x2be6b8[_0x5842('0x21')],function(_0x37295d){return{'model':db[_0x37295d[_0x5842('0x23')]],'as':_0x37295d['as'],'attributes':_0x37295d['attributes']};}):[]};}):[]};}):[]:[]})[_0x5842('0x11')](function(_0x336f18){logger[_0x5842('0x12')](_0x5842('0x24'),_0x3702d1);logger[_0x5842('0x15')](_0x5842('0x24'),_0x3702d1,JSON[_0x5842('0x16')](_0x336f18));_0x354e90(_0x336f18);})[_0x5842('0x1b')](function(_0x5522c3){logger[_0x5842('0x17')]('GetChatQueue',_0x5522c3[_0x5842('0x19')],_0x3702d1);_0x3a3fc9(_0x4d0a72[_0x5842('0x17')](0x1f4,_0x5522c3[_0x5842('0x19')]));});});};exports[_0x5842('0x25')]=function(_0x2c0b8b){var _0x325e0e=this;return new Promise(function(_0x199be2,_0x21bad1){return db['ChatQueue']['find']({'raw':_0x2c0b8b[_0x5842('0x1e')]?_0x2c0b8b[_0x5842('0x1e')][_0x5842('0x1d')]===undefined?!![]:![]:!![],'where':_0x2c0b8b[_0x5842('0x1e')]?_0x2c0b8b[_0x5842('0x1e')][_0x5842('0x1f')]||null:null,'attributes':_0x2c0b8b[_0x5842('0x1e')]?_0x2c0b8b['options'][_0x5842('0x20')]||null:null,'include':_0x2c0b8b[_0x5842('0x1e')]?_0x2c0b8b[_0x5842('0x1e')]['include']?_[_0x5842('0x22')](_0x2c0b8b[_0x5842('0x1e')][_0x5842('0x21')],function(_0x5d105c){return{'model':db[_0x5d105c[_0x5842('0x23')]],'as':_0x5d105c['as'],'attributes':_0x5d105c[_0x5842('0x20')],'include':_0x5d105c[_0x5842('0x21')]?_[_0x5842('0x22')](_0x5d105c[_0x5842('0x21')],function(_0x68eff2){return{'model':db[_0x68eff2[_0x5842('0x23')]],'as':_0x68eff2['as'],'attributes':_0x68eff2['attributes'],'include':_0x68eff2['include']?_['map'](_0x68eff2[_0x5842('0x21')],function(_0x4407b4){return{'model':db[_0x4407b4[_0x5842('0x23')]],'as':_0x4407b4['as'],'attributes':_0x4407b4[_0x5842('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5842('0x11')](function(_0xf78bc){logger[_0x5842('0x12')](_0x5842('0x25'),_0x2c0b8b);logger[_0x5842('0x15')]('ShowChatQueue',_0x2c0b8b,JSON[_0x5842('0x16')](_0xf78bc));_0x199be2(_0xf78bc);})[_0x5842('0x1b')](function(_0x4e2c96){logger[_0x5842('0x17')](_0x5842('0x25'),_0x4e2c96[_0x5842('0x19')],_0x2c0b8b);_0x21bad1(_0x325e0e['error'](0x1f4,_0x4e2c96['message']));});});};
\ No newline at end of file
+var _0x6bab=['../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','include','map','model','attributes','ShowChatQueue','find','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x1dd56c,_0x511e8a){var _0x211d4f=function(_0x1531a9){while(--_0x1531a9){_0x1dd56c['push'](_0x1dd56c['shift']());}};_0x211d4f(++_0x511e8a);}(_0x6bab,0x1c7));var _0xb6ba=function(_0x5e8d3e,_0x18ed2e){_0x5e8d3e=_0x5e8d3e-0x0;var _0x1348c0=_0x6bab[_0x5e8d3e];return _0x1348c0;};'use strict';var _=require(_0xb6ba('0x0'));var util=require(_0xb6ba('0x1'));var moment=require(_0xb6ba('0x2'));var BPromise=require(_0xb6ba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6ba('0x4'));var db=require(_0xb6ba('0x5'))['db'];var utils=require(_0xb6ba('0x6'));var logger=require(_0xb6ba('0x7'))(_0xb6ba('0x8'));var config=require('../../config/environment');var jayson=require(_0xb6ba('0x9'));var client=jayson['client'][_0xb6ba('0xa')]({'port':0x232a});config[_0xb6ba('0xb')]=_[_0xb6ba('0xc')](config[_0xb6ba('0xb')],{'host':_0xb6ba('0xd'),'port':0x18eb});var socket=require(_0xb6ba('0xe'))(new Redis(config[_0xb6ba('0xb')]));require(_0xb6ba('0xf'))[_0xb6ba('0x10')](socket);function respondWithRpcPromise(_0x5ae28b,_0x16cb3a,_0x55a4b0){return new BPromise(function(_0x5c4eac,_0x5c556d){return client[_0xb6ba('0x11')](_0x5ae28b,_0x55a4b0)[_0xb6ba('0x12')](function(_0x1cb42c){logger['info'](_0xb6ba('0x13'),_0x16cb3a,_0xb6ba('0x14'));logger[_0xb6ba('0x15')](_0xb6ba('0x16'),_0x16cb3a,_0xb6ba('0x14'),JSON[_0xb6ba('0x17')](_0x1cb42c));if(_0x1cb42c[_0xb6ba('0x18')]){if(_0x1cb42c[_0xb6ba('0x18')][_0xb6ba('0x19')]===0x1f4){logger[_0xb6ba('0x18')](_0xb6ba('0x13'),_0x16cb3a,_0x1cb42c[_0xb6ba('0x18')][_0xb6ba('0x1a')]);return _0x5c556d(_0x1cb42c[_0xb6ba('0x18')][_0xb6ba('0x1a')]);}logger[_0xb6ba('0x18')](_0xb6ba('0x13'),_0x16cb3a,_0x1cb42c[_0xb6ba('0x18')][_0xb6ba('0x1a')]);return _0x5c4eac(_0x1cb42c['error'][_0xb6ba('0x1a')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x16cb3a,_0xb6ba('0x14'));_0x5c4eac(_0x1cb42c[_0xb6ba('0x1b')]['message']);}})[_0xb6ba('0x1c')](function(_0xf1e2f8){logger['error'](_0xb6ba('0x13'),_0x16cb3a,_0xf1e2f8);_0x5c556d(_0xf1e2f8);});});}exports[_0xb6ba('0x1d')]=function(_0x42ead3){var _0x459f9b=this;return new Promise(function(_0x298207,_0x40b66e){return db[_0xb6ba('0x1e')][_0xb6ba('0x1f')]({'raw':_0x42ead3[_0xb6ba('0x20')]?_0x42ead3[_0xb6ba('0x20')][_0xb6ba('0x21')]===undefined?!![]:![]:!![],'where':_0x42ead3[_0xb6ba('0x20')]?_0x42ead3[_0xb6ba('0x20')][_0xb6ba('0x22')]||null:null,'attributes':_0x42ead3[_0xb6ba('0x20')]?_0x42ead3[_0xb6ba('0x20')]['attributes']||null:null,'limit':_0x42ead3['options']?_0x42ead3[_0xb6ba('0x20')]['limit']||null:null,'include':_0x42ead3[_0xb6ba('0x20')]?_0x42ead3[_0xb6ba('0x20')][_0xb6ba('0x23')]?_[_0xb6ba('0x24')](_0x42ead3[_0xb6ba('0x20')]['include'],function(_0x5ce5d7){return{'model':db[_0x5ce5d7[_0xb6ba('0x25')]],'as':_0x5ce5d7['as'],'attributes':_0x5ce5d7['attributes'],'include':_0x5ce5d7[_0xb6ba('0x23')]?_[_0xb6ba('0x24')](_0x5ce5d7[_0xb6ba('0x23')],function(_0xca634){return{'model':db[_0xca634[_0xb6ba('0x25')]],'as':_0xca634['as'],'attributes':_0xca634[_0xb6ba('0x26')],'include':_0xca634[_0xb6ba('0x23')]?_[_0xb6ba('0x24')](_0xca634['include'],function(_0x2d5038){return{'model':db[_0x2d5038['model']],'as':_0x2d5038['as'],'attributes':_0x2d5038[_0xb6ba('0x26')]};}):[]};}):[]};}):[]:[]})[_0xb6ba('0x12')](function(_0x190ee3){logger['info'](_0xb6ba('0x1d'),_0x42ead3);logger['debug'](_0xb6ba('0x1d'),_0x42ead3,JSON[_0xb6ba('0x17')](_0x190ee3));_0x298207(_0x190ee3);})[_0xb6ba('0x1c')](function(_0x2820fd){logger['error']('GetChatQueue',_0x2820fd[_0xb6ba('0x1a')],_0x42ead3);_0x40b66e(_0x459f9b[_0xb6ba('0x18')](0x1f4,_0x2820fd[_0xb6ba('0x1a')]));});});};exports[_0xb6ba('0x27')]=function(_0x1dce2d){var _0x153209=this;return new Promise(function(_0x3361d3,_0x501141){return db['ChatQueue'][_0xb6ba('0x28')]({'raw':_0x1dce2d[_0xb6ba('0x20')]?_0x1dce2d[_0xb6ba('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x1dce2d[_0xb6ba('0x20')]?_0x1dce2d[_0xb6ba('0x20')][_0xb6ba('0x22')]||null:null,'attributes':_0x1dce2d[_0xb6ba('0x20')]?_0x1dce2d[_0xb6ba('0x20')][_0xb6ba('0x26')]||null:null,'include':_0x1dce2d[_0xb6ba('0x20')]?_0x1dce2d['options'][_0xb6ba('0x23')]?_[_0xb6ba('0x24')](_0x1dce2d[_0xb6ba('0x20')][_0xb6ba('0x23')],function(_0x26d0ed){return{'model':db[_0x26d0ed[_0xb6ba('0x25')]],'as':_0x26d0ed['as'],'attributes':_0x26d0ed[_0xb6ba('0x26')],'include':_0x26d0ed['include']?_[_0xb6ba('0x24')](_0x26d0ed[_0xb6ba('0x23')],function(_0x7418b4){return{'model':db[_0x7418b4[_0xb6ba('0x25')]],'as':_0x7418b4['as'],'attributes':_0x7418b4['attributes'],'include':_0x7418b4[_0xb6ba('0x23')]?_['map'](_0x7418b4['include'],function(_0x170b9c){return{'model':db[_0x170b9c[_0xb6ba('0x25')]],'as':_0x170b9c['as'],'attributes':_0x170b9c[_0xb6ba('0x26')]};}):[]};}):[]};}):[]:[]})[_0xb6ba('0x12')](function(_0x1f61f7){logger[_0xb6ba('0x29')]('ShowChatQueue',_0x1dce2d);logger[_0xb6ba('0x15')]('ShowChatQueue',_0x1dce2d,JSON[_0xb6ba('0x17')](_0x1f61f7));_0x3361d3(_0x1f61f7);})[_0xb6ba('0x1c')](function(_0x27c91a){logger['error'](_0xb6ba('0x27'),_0x27c91a[_0xb6ba('0x1a')],_0x1dce2d);_0x501141(_0x153209[_0xb6ba('0x18')](0x1f4,_0x27c91a[_0xb6ba('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 3853ad3..3b9ecdc 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 _0x8d0e=['save','remove','update','emit','removeListener','length','chatQueue:','./chatQueue.events'];(function(_0x2db291,_0x1e49b7){var _0x3be614=function(_0x20e458){while(--_0x20e458){_0x2db291['push'](_0x2db291['shift']());}};_0x3be614(++_0x1e49b7);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x81eac0,_0x414633){_0x81eac0=_0x81eac0-0x0;var _0x3ff4c5=_0x8d0e[_0x81eac0];return _0x3ff4c5;};'use strict';var ChatQueueEvents=require(_0xe8d0('0x0'));var events=[_0xe8d0('0x1'),_0xe8d0('0x2'),_0xe8d0('0x3')];function createListener(_0x2eae0c,_0x3584ab){return function(_0x15521e){_0x3584ab[_0xe8d0('0x4')](_0x2eae0c,_0x15521e);};}function removeListener(_0x32cee9,_0x579cb9){return function(){ChatQueueEvents[_0xe8d0('0x5')](_0x32cee9,_0x579cb9);};}exports['register']=function(_0x560dab){for(var _0x2e2985=0x0,_0x92483d=events[_0xe8d0('0x6')];_0x2e2985<_0x92483d;_0x2e2985++){var _0xcc03d0=events[_0x2e2985];var _0x2b6dce=createListener(_0xe8d0('0x7')+_0xcc03d0,_0x560dab);ChatQueueEvents['on'](_0xcc03d0,_0x2b6dce);}};
\ No newline at end of file
+var _0xe107=['remove','update','removeListener','register','length','./chatQueue.events'];(function(_0x415ea7,_0x3cc1a2){var _0x89a878=function(_0x4ffa95){while(--_0x4ffa95){_0x415ea7['push'](_0x415ea7['shift']());}};_0x89a878(++_0x3cc1a2);}(_0xe107,0xb3));var _0x7e10=function(_0x573dc6,_0x206c5d){_0x573dc6=_0x573dc6-0x0;var _0x36c001=_0xe107[_0x573dc6];return _0x36c001;};'use strict';var ChatQueueEvents=require(_0x7e10('0x0'));var events=['save',_0x7e10('0x1'),_0x7e10('0x2')];function createListener(_0x2871b0,_0x570b2a){return function(_0x31212d){_0x570b2a['emit'](_0x2871b0,_0x31212d);};}function removeListener(_0x4db676,_0x2bdf3c){return function(){ChatQueueEvents[_0x7e10('0x3')](_0x4db676,_0x2bdf3c);};}exports[_0x7e10('0x4')]=function(_0x5be19f){for(var _0x5f1edf=0x0,_0x1dd3de=events[_0x7e10('0x5')];_0x5f1edf<_0x1dd3de;_0x5f1edf++){var _0x156c56=events[_0x5f1edf];var _0x3413f7=createListener('chatQueue:'+_0x156c56,_0x5be19f);ChatQueueEvents['on'](_0x156c56,_0x3413f7);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index cd5c3d6..72ff14f 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(_0x57f01b,_0x581196){var _0xa1ab2=function(_0x19b9ef){while(--_0x19b9ef){_0x57f01b['push'](_0x57f01b['shift']());}};_0xa1ab2(++_0x581196);}(_0x008c,0x188));var _0xc008=function(_0x1de164,_0x1ccf5f){_0x1de164=_0x1de164-0x0;var _0x5613b4=_0x008c[_0x1de164];return _0x5613b4;};'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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x2dffc8,_0x25f505){var _0x5df762=function(_0x532d52){while(--_0x532d52){_0x2dffc8['push'](_0x2dffc8['shift']());}};_0x5df762(++_0x25f505);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 5ba8448..699c89d 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 _0x5d89=['moment','sequelize','exports','STRING','DATE'];(function(_0x1622a0,_0x2b55a9){var _0x2a2308=function(_0x38d05b){while(--_0x38d05b){_0x1622a0['push'](_0x1622a0['shift']());}};_0x2a2308(++_0x2b55a9);}(_0x5d89,0xd7));var _0x95d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d89[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x95d8('0x0'));var Sequelize=require(_0x95d8('0x1'));module[_0x95d8('0x2')]={'uniqueid':{'type':Sequelize[_0x95d8('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x95d8('0x3')]},'joinAt':{'type':Sequelize[_0x95d8('0x4')]},'leaveAt':{'type':Sequelize[_0x95d8('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7243=['STRING','sequelize','exports','DATE'];(function(_0x25260e,_0x4ea9f9){var _0x5d19c6=function(_0x3bb20a){while(--_0x3bb20a){_0x25260e['push'](_0x25260e['shift']());}};_0x5d19c6(++_0x4ea9f9);}(_0x7243,0x7d));var _0x3724=function(_0x82038a,_0x4489a9){_0x82038a=_0x82038a-0x0;var _0x2b0a9c=_0x7243[_0x82038a];return _0x2b0a9c;};'use strict';var moment=require('moment');var Sequelize=require(_0x3724('0x0'));module[_0x3724('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3724('0x2')]},'leaveAt':{'type':Sequelize[_0x3724('0x2')]},'acceptAt':{'type':Sequelize[_0x3724('0x2')]},'exitAt':{'type':Sequelize[_0x3724('0x2')]},'reason':{'type':Sequelize[_0x3724('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index e194bd2..ed466f3 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 _0xb091=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatQueueReport','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv'];(function(_0x33168e,_0x19b020){var _0x24f4cf=function(_0x219e74){while(--_0x219e74){_0x33168e['push'](_0x33168e['shift']());}};_0x24f4cf(++_0x19b020);}(_0xb091,0x16e));var _0x1b09=function(_0x393e2b,_0x10dd05){_0x393e2b=_0x393e2b-0x0;var _0x24153b=_0xb091[_0x393e2b];return _0x24153b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b09('0x0'));var zipdir=require(_0x1b09('0x1'));var jsonpatch=require(_0x1b09('0x2'));var rp=require(_0x1b09('0x3'));var moment=require('moment');var BPromise=require(_0x1b09('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1b09('0x5'));var sox=require(_0x1b09('0x6'));var csv=require('to-csv');var ejs=require(_0x1b09('0x7'));var fs=require('fs');var fs_extra=require(_0x1b09('0x8'));var _=require(_0x1b09('0x9'));var squel=require('squel');var crypto=require(_0x1b09('0xa'));var jsforce=require(_0x1b09('0xb'));var deskjs=require(_0x1b09('0xc'));var toCsv=require(_0x1b09('0xd'));var querystring=require(_0x1b09('0xe'));var Papa=require(_0x1b09('0xf'));var Redis=require(_0x1b09('0x10'));var authService=require(_0x1b09('0x11'));var qs=require(_0x1b09('0x12'));var as=require(_0x1b09('0x13'));var hardwareService=require(_0x1b09('0x14'));var logger=require('../../config/logger')(_0x1b09('0x15'));var utils=require(_0x1b09('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1b09('0x17'))['db'];function respondWithStatusCode(_0x4284ad,_0x3ae4a0){_0x3ae4a0=_0x3ae4a0||0xcc;return function(_0x1046f8){if(_0x1046f8){return _0x4284ad[_0x1b09('0x18')](_0x3ae4a0);}return _0x4284ad[_0x1b09('0x19')](_0x3ae4a0)[_0x1b09('0x1a')]();};}function respondWithResult(_0x58392d,_0x37fdb2){_0x37fdb2=_0x37fdb2||0xc8;return function(_0x515ade){if(_0x515ade){return _0x58392d[_0x1b09('0x19')](_0x37fdb2)[_0x1b09('0x1b')](_0x515ade);}};}function respondWithFilteredResult(_0x11ab46,_0x37673e){return function(_0x10b7eb){if(_0x10b7eb){var _0x1dc96b=typeof _0x37673e[_0x1b09('0x1c')]===_0x1b09('0x1d')&&typeof _0x37673e[_0x1b09('0x1e')]===_0x1b09('0x1d');var _0x311158=_0x10b7eb[_0x1b09('0x1f')];var _0x646575=_0x1dc96b?0x0:_0x37673e['offset'];var _0x214c6b=_0x1dc96b?_0x10b7eb[_0x1b09('0x1f')]:_0x37673e['offset']+_0x37673e['limit'];var _0xe93ac4;if(_0x214c6b>=_0x311158){_0x214c6b=_0x311158;_0xe93ac4=0xc8;}else{_0xe93ac4=0xce;}_0x11ab46['status'](_0xe93ac4);return _0x11ab46[_0x1b09('0x20')]('Content-Range',_0x646575+'-'+_0x214c6b+'/'+_0x311158)[_0x1b09('0x1b')](_0x10b7eb);}return null;};}function patchUpdates(_0x4b2eab){return function(_0x2d6dba){try{jsonpatch[_0x1b09('0x21')](_0x2d6dba,_0x4b2eab,!![]);}catch(_0x29dd70){return BPromise[_0x1b09('0x22')](_0x29dd70);}return _0x2d6dba[_0x1b09('0x23')]();};}function saveUpdates(_0x39e569,_0x48b803){return function(_0x5e2806){if(_0x5e2806){return _0x5e2806[_0x1b09('0x24')](_0x39e569)[_0x1b09('0x25')](function(_0x4ce7dc){return _0x4ce7dc;});}return null;};}function removeEntity(_0x3c0496,_0x11d0d5){return function(_0x6e132c){if(_0x6e132c){return _0x6e132c[_0x1b09('0x26')]()['then'](function(){_0x3c0496[_0x1b09('0x19')](0xcc)[_0x1b09('0x1a')]();});}};}function handleEntityNotFound(_0x4936d0,_0x2d3b86){return function(_0x472d30){if(!_0x472d30){_0x4936d0['sendStatus'](0x194);}return _0x472d30;};}function handleError(_0x13c89c,_0x108d80){_0x108d80=_0x108d80||0x1f4;return function(_0xa71272){logger[_0x1b09('0x27')](_0xa71272['stack']);if(_0xa71272[_0x1b09('0x28')]){delete _0xa71272[_0x1b09('0x28')];}_0x13c89c['status'](_0x108d80)[_0x1b09('0x29')](_0xa71272);};}exports[_0x1b09('0x2a')]=function(_0x26befb,_0x1cbbd5){var _0x11098e={},_0x1aa179={},_0x34620f={'count':0x0,'rows':[]};var _0x5a503d=_[_0x1b09('0x2b')](db[_0x1b09('0x2c')]['rawAttributes'],function(_0x34d912){return{'name':_0x34d912[_0x1b09('0x2d')],'type':_0x34d912[_0x1b09('0x2e')][_0x1b09('0x2f')]};});_0x1aa179[_0x1b09('0x30')]=_['map'](_0x5a503d,_0x1b09('0x28'));_0x1aa179['query']=_[_0x1b09('0x31')](_0x26befb['query']);_0x1aa179[_0x1b09('0x32')]=_[_0x1b09('0x33')](_0x1aa179[_0x1b09('0x30')],_0x1aa179[_0x1b09('0x34')]);_0x11098e[_0x1b09('0x35')]=_[_0x1b09('0x33')](_0x1aa179[_0x1b09('0x30')],qs[_0x1b09('0x36')](_0x26befb[_0x1b09('0x34')][_0x1b09('0x36')]));_0x11098e['attributes']=_0x11098e[_0x1b09('0x35')][_0x1b09('0x37')]?_0x11098e[_0x1b09('0x35')]:_0x1aa179['model'];if(!_0x26befb[_0x1b09('0x34')][_0x1b09('0x38')](_0x1b09('0x39'))){_0x11098e[_0x1b09('0x1e')]=qs[_0x1b09('0x1e')](_0x26befb[_0x1b09('0x34')][_0x1b09('0x1e')]);_0x11098e[_0x1b09('0x1c')]=qs['offset'](_0x26befb[_0x1b09('0x34')]['offset']);}_0x11098e[_0x1b09('0x3a')]=qs['sort'](_0x26befb[_0x1b09('0x34')][_0x1b09('0x3b')]);_0x11098e[_0x1b09('0x3c')]=qs[_0x1b09('0x32')](_[_0x1b09('0x3d')](_0x26befb[_0x1b09('0x34')],_0x1aa179[_0x1b09('0x32')]),_0x5a503d);if(_0x26befb[_0x1b09('0x34')][_0x1b09('0x3e')]){_0x11098e[_0x1b09('0x3c')]=_[_0x1b09('0x3f')](_0x11098e[_0x1b09('0x3c')],{'$or':_[_0x1b09('0x2b')](_0x5a503d,function(_0x4bd6fa){if(_0x4bd6fa['type']!==_0x1b09('0x40')){var _0xb2ef05={};_0xb2ef05[_0x4bd6fa[_0x1b09('0x28')]]={'$like':'%'+_0x26befb[_0x1b09('0x34')][_0x1b09('0x3e')]+'%'};return _0xb2ef05;}})});}_0x11098e=_[_0x1b09('0x3f')]({},_0x11098e,_0x26befb[_0x1b09('0x41')]);var _0x33d697={'where':_0x11098e['where']};return db['ChatQueueReport'][_0x1b09('0x1f')](_0x33d697)['then'](function(_0x966873){_0x34620f[_0x1b09('0x1f')]=_0x966873;if(_0x26befb[_0x1b09('0x34')]['includeAll']){_0x11098e[_0x1b09('0x42')]=[{'all':!![]}];}return db[_0x1b09('0x2c')][_0x1b09('0x43')](_0x11098e);})['then'](function(_0x3edcde){_0x34620f[_0x1b09('0x44')]=_0x3edcde;return _0x34620f;})[_0x1b09('0x25')](respondWithFilteredResult(_0x1cbbd5,_0x11098e))[_0x1b09('0x45')](handleError(_0x1cbbd5,null));};exports['show']=function(_0x36f814,_0x2b2341){var _0x4c0559={'raw':!![],'where':{'id':_0x36f814[_0x1b09('0x46')]['id']}},_0x1c7ec6={};_0x1c7ec6['model']=_['keys'](db['ChatQueueReport']['rawAttributes']);_0x1c7ec6[_0x1b09('0x34')]=_[_0x1b09('0x31')](_0x36f814[_0x1b09('0x34')]);_0x1c7ec6['filters']=_[_0x1b09('0x33')](_0x1c7ec6[_0x1b09('0x30')],_0x1c7ec6['query']);_0x4c0559[_0x1b09('0x35')]=_[_0x1b09('0x33')](_0x1c7ec6[_0x1b09('0x30')],qs[_0x1b09('0x36')](_0x36f814[_0x1b09('0x34')][_0x1b09('0x36')]));_0x4c0559[_0x1b09('0x35')]=_0x4c0559[_0x1b09('0x35')][_0x1b09('0x37')]?_0x4c0559[_0x1b09('0x35')]:_0x1c7ec6['model'];if(_0x36f814[_0x1b09('0x34')][_0x1b09('0x47')]){_0x4c0559[_0x1b09('0x42')]=[{'all':!![]}];}_0x4c0559=_['merge']({},_0x4c0559,_0x36f814[_0x1b09('0x41')]);return db['ChatQueueReport'][_0x1b09('0x48')](_0x4c0559)[_0x1b09('0x25')](handleEntityNotFound(_0x2b2341,null))['then'](respondWithResult(_0x2b2341,null))[_0x1b09('0x45')](handleError(_0x2b2341,null));};exports[_0x1b09('0x49')]=function(_0x3732fb,_0x25443a){return db[_0x1b09('0x2c')][_0x1b09('0x49')](_0x3732fb['body'],{})[_0x1b09('0x25')](respondWithResult(_0x25443a,0xc9))['catch'](handleError(_0x25443a,null));};exports[_0x1b09('0x24')]=function(_0x58a158,_0x50a66c){if(_0x58a158[_0x1b09('0x4a')]['id']){delete _0x58a158[_0x1b09('0x4a')]['id'];}return db[_0x1b09('0x2c')][_0x1b09('0x48')]({'where':{'id':_0x58a158[_0x1b09('0x46')]['id']}})[_0x1b09('0x25')](handleEntityNotFound(_0x50a66c,null))[_0x1b09('0x25')](saveUpdates(_0x58a158[_0x1b09('0x4a')],null))['then'](respondWithResult(_0x50a66c,null))[_0x1b09('0x45')](handleError(_0x50a66c,null));};exports[_0x1b09('0x26')]=function(_0x21b4c2,_0x481147){return db['ChatQueueReport'][_0x1b09('0x48')]({'where':{'id':_0x21b4c2['params']['id']}})[_0x1b09('0x25')](handleEntityNotFound(_0x481147,null))[_0x1b09('0x25')](removeEntity(_0x481147,null))['catch'](handleError(_0x481147,null));};exports[_0x1b09('0x4b')]=function(_0x6f4589,_0x5941df){return db[_0x1b09('0x2c')][_0x1b09('0x4b')]()[_0x1b09('0x25')](respondWithResult(_0x5941df,null))[_0x1b09('0x45')](handleError(_0x5941df,null));};
\ No newline at end of file
+var _0x2e88=['moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','end','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3da46a,_0x580acc){var _0x100234=function(_0x989694){while(--_0x989694){_0x3da46a['push'](_0x3da46a['shift']());}};_0x100234(++_0x580acc);}(_0x2e88,0x95));var _0x82e8=function(_0x38841c,_0x1af0bf){_0x38841c=_0x38841c-0x0;var _0x500610=_0x2e88[_0x38841c];return _0x500610;};'use strict';var emlformat=require(_0x82e8('0x0'));var rimraf=require(_0x82e8('0x1'));var zipdir=require(_0x82e8('0x2'));var jsonpatch=require(_0x82e8('0x3'));var rp=require(_0x82e8('0x4'));var moment=require(_0x82e8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x82e8('0x6'));var util=require(_0x82e8('0x7'));var path=require('path');var sox=require(_0x82e8('0x8'));var csv=require(_0x82e8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x82e8('0xa'));var _=require(_0x82e8('0xb'));var squel=require(_0x82e8('0xc'));var crypto=require(_0x82e8('0xd'));var jsforce=require(_0x82e8('0xe'));var deskjs=require(_0x82e8('0xf'));var toCsv=require(_0x82e8('0x9'));var querystring=require(_0x82e8('0x10'));var Papa=require(_0x82e8('0x11'));var Redis=require(_0x82e8('0x12'));var authService=require(_0x82e8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x82e8('0x14'));var hardwareService=require(_0x82e8('0x15'));var logger=require(_0x82e8('0x16'))(_0x82e8('0x17'));var utils=require(_0x82e8('0x18'));var config=require(_0x82e8('0x19'));var licenseUtil=require(_0x82e8('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x253a36,_0xdf1b65){_0xdf1b65=_0xdf1b65||0xcc;return function(_0xb6d94a){if(_0xb6d94a){return _0x253a36[_0x82e8('0x1b')](_0xdf1b65);}return _0x253a36[_0x82e8('0x1c')](_0xdf1b65)['end']();};}function respondWithResult(_0x3353e0,_0x2c9569){_0x2c9569=_0x2c9569||0xc8;return function(_0xad6055){if(_0xad6055){return _0x3353e0[_0x82e8('0x1c')](_0x2c9569)['json'](_0xad6055);}};}function respondWithFilteredResult(_0x25b60e,_0x461744){return function(_0x3253d2){if(_0x3253d2){var _0xf53214=typeof _0x461744[_0x82e8('0x1d')]==='undefined'&&typeof _0x461744[_0x82e8('0x1e')]===_0x82e8('0x1f');var _0x574ba2=_0x3253d2[_0x82e8('0x20')];var _0xf287da=_0xf53214?0x0:_0x461744[_0x82e8('0x1d')];var _0x380f44=_0xf53214?_0x3253d2[_0x82e8('0x20')]:_0x461744[_0x82e8('0x1d')]+_0x461744[_0x82e8('0x1e')];var _0x5d7986;if(_0x380f44>=_0x574ba2){_0x380f44=_0x574ba2;_0x5d7986=0xc8;}else{_0x5d7986=0xce;}_0x25b60e[_0x82e8('0x1c')](_0x5d7986);return _0x25b60e[_0x82e8('0x21')](_0x82e8('0x22'),_0xf287da+'-'+_0x380f44+'/'+_0x574ba2)[_0x82e8('0x23')](_0x3253d2);}return null;};}function patchUpdates(_0xbfecf2){return function(_0x5db337){try{jsonpatch[_0x82e8('0x24')](_0x5db337,_0xbfecf2,!![]);}catch(_0x497c48){return BPromise[_0x82e8('0x25')](_0x497c48);}return _0x5db337[_0x82e8('0x26')]();};}function saveUpdates(_0x1475cf,_0x3ab5a2){return function(_0x198c3d){if(_0x198c3d){return _0x198c3d[_0x82e8('0x27')](_0x1475cf)[_0x82e8('0x28')](function(_0x591583){return _0x591583;});}return null;};}function removeEntity(_0x2b82eb,_0x57cc9c){return function(_0x4de0d2){if(_0x4de0d2){return _0x4de0d2['destroy']()[_0x82e8('0x28')](function(){_0x2b82eb['status'](0xcc)[_0x82e8('0x29')]();});}};}function handleEntityNotFound(_0x305710,_0xeff996){return function(_0x488b06){if(!_0x488b06){_0x305710[_0x82e8('0x1b')](0x194);}return _0x488b06;};}function handleError(_0x476602,_0x336015){_0x336015=_0x336015||0x1f4;return function(_0x2400c5){logger[_0x82e8('0x2a')](_0x2400c5['stack']);if(_0x2400c5['name']){delete _0x2400c5[_0x82e8('0x2b')];}_0x476602[_0x82e8('0x1c')](_0x336015)[_0x82e8('0x2c')](_0x2400c5);};}exports[_0x82e8('0x2d')]=function(_0x1c2160,_0x4756ac){var _0x14450e={},_0x1e9eee={},_0x1c2173={'count':0x0,'rows':[]};var _0xf52391=_[_0x82e8('0x2e')](db[_0x82e8('0x2f')][_0x82e8('0x30')],function(_0x4902af){return{'name':_0x4902af[_0x82e8('0x31')],'type':_0x4902af[_0x82e8('0x32')][_0x82e8('0x33')]};});_0x1e9eee[_0x82e8('0x34')]=_[_0x82e8('0x2e')](_0xf52391,_0x82e8('0x2b'));_0x1e9eee[_0x82e8('0x35')]=_[_0x82e8('0x36')](_0x1c2160[_0x82e8('0x35')]);_0x1e9eee[_0x82e8('0x37')]=_[_0x82e8('0x38')](_0x1e9eee['model'],_0x1e9eee[_0x82e8('0x35')]);_0x14450e[_0x82e8('0x39')]=_[_0x82e8('0x38')](_0x1e9eee[_0x82e8('0x34')],qs[_0x82e8('0x3a')](_0x1c2160[_0x82e8('0x35')][_0x82e8('0x3a')]));_0x14450e[_0x82e8('0x39')]=_0x14450e['attributes'][_0x82e8('0x3b')]?_0x14450e['attributes']:_0x1e9eee[_0x82e8('0x34')];if(!_0x1c2160[_0x82e8('0x35')]['hasOwnProperty']('nolimit')){_0x14450e[_0x82e8('0x1e')]=qs['limit'](_0x1c2160[_0x82e8('0x35')][_0x82e8('0x1e')]);_0x14450e[_0x82e8('0x1d')]=qs[_0x82e8('0x1d')](_0x1c2160[_0x82e8('0x35')][_0x82e8('0x1d')]);}_0x14450e[_0x82e8('0x3c')]=qs[_0x82e8('0x3d')](_0x1c2160[_0x82e8('0x35')][_0x82e8('0x3d')]);_0x14450e[_0x82e8('0x3e')]=qs[_0x82e8('0x37')](_['pick'](_0x1c2160[_0x82e8('0x35')],_0x1e9eee[_0x82e8('0x37')]),_0xf52391);if(_0x1c2160[_0x82e8('0x35')]['filter']){_0x14450e[_0x82e8('0x3e')]=_[_0x82e8('0x3f')](_0x14450e[_0x82e8('0x3e')],{'$or':_[_0x82e8('0x2e')](_0xf52391,function(_0x28e1b2){if(_0x28e1b2[_0x82e8('0x32')]!==_0x82e8('0x40')){var _0x1eceef={};_0x1eceef[_0x28e1b2[_0x82e8('0x2b')]]={'$like':'%'+_0x1c2160[_0x82e8('0x35')][_0x82e8('0x41')]+'%'};return _0x1eceef;}})});}_0x14450e=_['merge']({},_0x14450e,_0x1c2160[_0x82e8('0x42')]);var _0x3f379d={'where':_0x14450e[_0x82e8('0x3e')]};return db[_0x82e8('0x2f')][_0x82e8('0x20')](_0x3f379d)[_0x82e8('0x28')](function(_0x26c6ad){_0x1c2173[_0x82e8('0x20')]=_0x26c6ad;if(_0x1c2160[_0x82e8('0x35')][_0x82e8('0x43')]){_0x14450e[_0x82e8('0x44')]=[{'all':!![]}];}return db[_0x82e8('0x2f')][_0x82e8('0x45')](_0x14450e);})[_0x82e8('0x28')](function(_0x3878af){_0x1c2173['rows']=_0x3878af;return _0x1c2173;})[_0x82e8('0x28')](respondWithFilteredResult(_0x4756ac,_0x14450e))['catch'](handleError(_0x4756ac,null));};exports[_0x82e8('0x46')]=function(_0x2da19b,_0x8428e1){var _0xc996f7={'raw':!![],'where':{'id':_0x2da19b[_0x82e8('0x47')]['id']}},_0x3ff396={};_0x3ff396['model']=_[_0x82e8('0x36')](db['ChatQueueReport'][_0x82e8('0x30')]);_0x3ff396[_0x82e8('0x35')]=_[_0x82e8('0x36')](_0x2da19b[_0x82e8('0x35')]);_0x3ff396[_0x82e8('0x37')]=_['intersection'](_0x3ff396['model'],_0x3ff396[_0x82e8('0x35')]);_0xc996f7['attributes']=_[_0x82e8('0x38')](_0x3ff396['model'],qs['fields'](_0x2da19b['query']['fields']));_0xc996f7[_0x82e8('0x39')]=_0xc996f7[_0x82e8('0x39')]['length']?_0xc996f7[_0x82e8('0x39')]:_0x3ff396[_0x82e8('0x34')];if(_0x2da19b['query'][_0x82e8('0x43')]){_0xc996f7['include']=[{'all':!![]}];}_0xc996f7=_[_0x82e8('0x3f')]({},_0xc996f7,_0x2da19b[_0x82e8('0x42')]);return db[_0x82e8('0x2f')][_0x82e8('0x48')](_0xc996f7)[_0x82e8('0x28')](handleEntityNotFound(_0x8428e1,null))[_0x82e8('0x28')](respondWithResult(_0x8428e1,null))['catch'](handleError(_0x8428e1,null));};exports[_0x82e8('0x49')]=function(_0x40fcae,_0x33c605){return db[_0x82e8('0x2f')]['create'](_0x40fcae[_0x82e8('0x4a')],{})['then'](respondWithResult(_0x33c605,0xc9))[_0x82e8('0x4b')](handleError(_0x33c605,null));};exports['update']=function(_0x25c206,_0xd3290c){if(_0x25c206[_0x82e8('0x4a')]['id']){delete _0x25c206['body']['id'];}return db[_0x82e8('0x2f')]['find']({'where':{'id':_0x25c206['params']['id']}})[_0x82e8('0x28')](handleEntityNotFound(_0xd3290c,null))[_0x82e8('0x28')](saveUpdates(_0x25c206[_0x82e8('0x4a')],null))['then'](respondWithResult(_0xd3290c,null))[_0x82e8('0x4b')](handleError(_0xd3290c,null));};exports['destroy']=function(_0x5735a2,_0x51710a){return db['ChatQueueReport'][_0x82e8('0x48')]({'where':{'id':_0x5735a2[_0x82e8('0x47')]['id']}})[_0x82e8('0x28')](handleEntityNotFound(_0x51710a,null))[_0x82e8('0x28')](removeEntity(_0x51710a,null))['catch'](handleError(_0x51710a,null));};exports[_0x82e8('0x4c')]=function(_0x7b1c26,_0x17f348){return db[_0x82e8('0x2f')][_0x82e8('0x4c')]()[_0x82e8('0x28')](respondWithResult(_0x17f348,null))['catch'](handleError(_0x17f348,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 5851d30..91c9972 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x51e355,_0x200d69){var _0x3fca78=function(_0x312d18){while(--_0x312d18){_0x51e355['push'](_0x51e355['shift']());}};_0x3fca78(++_0x200d69);}(_0xb7e7,0x121));var _0x7b7e=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xb7e7[_0x50aa2e];return _0x5e07f0;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x71a6e0,_0x19ff83){var _0x264938=function(_0x598f5a){while(--_0x598f5a){_0x71a6e0['push'](_0x71a6e0['shift']());}};_0x264938(++_0x19ff83);}(_0xe706,0xa3));var _0x6e70=function(_0x2159e6,_0x55c285){_0x2159e6=_0x2159e6-0x0;var _0x355dbb=_0xe706[_0x2159e6];return _0x355dbb;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 9b63157..dcf6410 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 _0x6a93=['ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','info','catch','UpdateChatQueueReport','update','where','attributes','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x1f453e,_0x2f2569){var _0x390021=function(_0x5b4923){while(--_0x5b4923){_0x1f453e['push'](_0x1f453e['shift']());}};_0x390021(++_0x2f2569);}(_0x6a93,0x188));var _0x36a9=function(_0x438606,_0xde4e68){_0x438606=_0x438606-0x0;var _0x30b7f4=_0x6a93[_0x438606];return _0x30b7f4;};'use strict';var _=require(_0x36a9('0x0'));var util=require('util');var moment=require(_0x36a9('0x1'));var BPromise=require('bluebird');var rs=require(_0x36a9('0x2'));var fs=require('fs');var Redis=require(_0x36a9('0x3'));var db=require(_0x36a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x36a9('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x36a9('0x6'));var client=jayson[_0x36a9('0x7')][_0x36a9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8dc654,_0x138e7f,_0x2fd9fb){return new BPromise(function(_0x44ff0b,_0x3bfc28){return client[_0x36a9('0x9')](_0x8dc654,_0x2fd9fb)[_0x36a9('0xa')](function(_0x4d4afb){logger['info'](_0x36a9('0xb'),_0x138e7f,_0x36a9('0xc'));logger[_0x36a9('0xd')](_0x36a9('0xe'),_0x138e7f,_0x36a9('0xc'),JSON[_0x36a9('0xf')](_0x4d4afb));if(_0x4d4afb['error']){if(_0x4d4afb[_0x36a9('0x10')][_0x36a9('0x11')]===0x1f4){logger[_0x36a9('0x10')](_0x36a9('0xb'),_0x138e7f,_0x4d4afb[_0x36a9('0x10')][_0x36a9('0x12')]);return _0x3bfc28(_0x4d4afb[_0x36a9('0x10')][_0x36a9('0x12')]);}logger[_0x36a9('0x10')](_0x36a9('0xb'),_0x138e7f,_0x4d4afb[_0x36a9('0x10')]['message']);return _0x44ff0b(_0x4d4afb['error'][_0x36a9('0x12')]);}else{logger['info'](_0x36a9('0xb'),_0x138e7f,_0x36a9('0xc'));_0x44ff0b(_0x4d4afb['result'][_0x36a9('0x12')]);}})['catch'](function(_0x126e2a){logger[_0x36a9('0x10')](_0x36a9('0xb'),_0x138e7f,_0x126e2a);_0x3bfc28(_0x126e2a);});});}exports[_0x36a9('0x13')]=function(_0x180f4c){var _0x369052=this;return new Promise(function(_0x5b0cd9,_0xbc0786){return db[_0x36a9('0x14')][_0x36a9('0x15')](_0x180f4c[_0x36a9('0x16')],{'raw':_0x180f4c[_0x36a9('0x17')]?_0x180f4c[_0x36a9('0x17')][_0x36a9('0x18')]===undefined?!![]:![]:!![]})[_0x36a9('0xa')](function(_0x8ddc07){logger[_0x36a9('0x19')](_0x36a9('0x13'),_0x180f4c);logger[_0x36a9('0xd')](_0x36a9('0x13'),_0x180f4c,JSON[_0x36a9('0xf')](_0x8ddc07));_0x5b0cd9(_0x8ddc07);})[_0x36a9('0x1a')](function(_0x28c214){logger[_0x36a9('0x10')](_0x36a9('0x13'),_0x28c214[_0x36a9('0x12')],_0x180f4c);_0xbc0786(_0x369052[_0x36a9('0x10')](0x1f4,_0x28c214['message']));});});};exports[_0x36a9('0x1b')]=function(_0x182312){var _0x3aea19=this;return new Promise(function(_0x14719f,_0x31034e){return db['ChatQueueReport'][_0x36a9('0x1c')](_0x182312[_0x36a9('0x16')],{'raw':_0x182312[_0x36a9('0x17')]?_0x182312['options'][_0x36a9('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x182312[_0x36a9('0x17')]?_0x182312[_0x36a9('0x17')][_0x36a9('0x1d')]||null:null,'attributes':_0x182312[_0x36a9('0x17')]?_0x182312[_0x36a9('0x17')][_0x36a9('0x1e')]||null:null,'limit':_0x182312[_0x36a9('0x17')]?_0x182312[_0x36a9('0x17')]['limit']||null:null})[_0x36a9('0xa')](function(_0x484649){logger[_0x36a9('0x19')](_0x36a9('0x1b'),_0x182312);logger[_0x36a9('0xd')](_0x36a9('0x1b'),_0x182312,JSON[_0x36a9('0xf')](_0x484649));_0x14719f(_0x484649);})['catch'](function(_0x5f5dd4){logger[_0x36a9('0x10')](_0x36a9('0x1b'),_0x5f5dd4[_0x36a9('0x12')],_0x182312);_0x31034e(_0x3aea19[_0x36a9('0x10')](0x1f4,_0x5f5dd4[_0x36a9('0x12')]));});});};
\ No newline at end of file
+var _0x45de=['UpdateChatQueueReport','update','attributes','limit','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','debug','catch'];(function(_0x11611e,_0x595b41){var _0x1a3024=function(_0x283c07){while(--_0x283c07){_0x11611e['push'](_0x11611e['shift']());}};_0x1a3024(++_0x595b41);}(_0x45de,0xe4));var _0xe45d=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x45de[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe45d('0x0'));var rs=require(_0xe45d('0x1'));var fs=require('fs');var Redis=require(_0xe45d('0x2'));var db=require(_0xe45d('0x3'))['db'];var utils=require(_0xe45d('0x4'));var logger=require(_0xe45d('0x5'))(_0xe45d('0x6'));var config=require(_0xe45d('0x7'));var jayson=require(_0xe45d('0x8'));var client=jayson[_0xe45d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26bff8,_0x2c19c5,_0x44d1f5){return new BPromise(function(_0x2e4d06,_0x464318){return client[_0xe45d('0xa')](_0x26bff8,_0x44d1f5)[_0xe45d('0xb')](function(_0x29455b){logger[_0xe45d('0xc')](_0xe45d('0xd'),_0x2c19c5,_0xe45d('0xe'));logger['debug'](_0xe45d('0xf'),_0x2c19c5,_0xe45d('0xe'),JSON[_0xe45d('0x10')](_0x29455b));if(_0x29455b[_0xe45d('0x11')]){if(_0x29455b[_0xe45d('0x11')][_0xe45d('0x12')]===0x1f4){logger['error'](_0xe45d('0xd'),_0x2c19c5,_0x29455b['error'][_0xe45d('0x13')]);return _0x464318(_0x29455b['error'][_0xe45d('0x13')]);}logger['error'](_0xe45d('0xd'),_0x2c19c5,_0x29455b['error'][_0xe45d('0x13')]);return _0x2e4d06(_0x29455b[_0xe45d('0x11')]['message']);}else{logger[_0xe45d('0xc')](_0xe45d('0xd'),_0x2c19c5,'request\x20sent');_0x2e4d06(_0x29455b[_0xe45d('0x14')][_0xe45d('0x13')]);}})['catch'](function(_0x35c5b6){logger['error'](_0xe45d('0xd'),_0x2c19c5,_0x35c5b6);_0x464318(_0x35c5b6);});});}exports[_0xe45d('0x15')]=function(_0x4daba3){var _0x43682e=this;return new Promise(function(_0x4e6c3b,_0x5aa419){return db[_0xe45d('0x16')][_0xe45d('0x17')](_0x4daba3[_0xe45d('0x18')],{'raw':_0x4daba3[_0xe45d('0x19')]?_0x4daba3['options']['raw']===undefined?!![]:![]:!![]})[_0xe45d('0xb')](function(_0x5cfa6b){logger[_0xe45d('0xc')]('CreateChatQueueReport',_0x4daba3);logger[_0xe45d('0x1a')]('CreateChatQueueReport',_0x4daba3,JSON[_0xe45d('0x10')](_0x5cfa6b));_0x4e6c3b(_0x5cfa6b);})[_0xe45d('0x1b')](function(_0x548011){logger[_0xe45d('0x11')]('CreateChatQueueReport',_0x548011[_0xe45d('0x13')],_0x4daba3);_0x5aa419(_0x43682e['error'](0x1f4,_0x548011[_0xe45d('0x13')]));});});};exports[_0xe45d('0x1c')]=function(_0x301da4){var _0x387de6=this;return new Promise(function(_0x1246b7,_0x375e52){return db[_0xe45d('0x16')][_0xe45d('0x1d')](_0x301da4[_0xe45d('0x18')],{'raw':_0x301da4[_0xe45d('0x19')]?_0x301da4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x301da4[_0xe45d('0x19')]?_0x301da4[_0xe45d('0x19')]['where']||null:null,'attributes':_0x301da4[_0xe45d('0x19')]?_0x301da4['options'][_0xe45d('0x1e')]||null:null,'limit':_0x301da4[_0xe45d('0x19')]?_0x301da4['options'][_0xe45d('0x1f')]||null:null})[_0xe45d('0xb')](function(_0x3daed9){logger['info'](_0xe45d('0x1c'),_0x301da4);logger['debug'](_0xe45d('0x1c'),_0x301da4,JSON[_0xe45d('0x10')](_0x3daed9));_0x1246b7(_0x3daed9);})[_0xe45d('0x1b')](function(_0x25d572){logger[_0xe45d('0x11')]('UpdateChatQueueReport',_0x25d572['message'],_0x301da4);_0x375e52(_0x387de6[_0xe45d('0x11')](0x1f4,_0x25d572[_0xe45d('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index eccf242..b831472 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 _0xcfc8=['show','post','create','put','delete','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','index','get','/:id'];(function(_0x47cec8,_0x212c8f){var _0x4bacd0=function(_0x56ceb5){while(--_0x56ceb5){_0x47cec8['push'](_0x47cec8['shift']());}};_0x4bacd0(++_0x212c8f);}(_0xcfc8,0xd2));var _0x8cfc=function(_0xcf4efc,_0x4a8dcd){_0xcf4efc=_0xcf4efc-0x0;var _0x572ba0=_0xcfc8[_0xcf4efc];return _0x572ba0;};'use strict';var multer=require('multer');var util=require(_0x8cfc('0x0'));var path=require('path');var timeout=require(_0x8cfc('0x1'));var express=require(_0x8cfc('0x2'));var router=express['Router']();var fs_extra=require(_0x8cfc('0x3'));var auth=require(_0x8cfc('0x4'));var interaction=require(_0x8cfc('0x5'));var config=require('../../config/environment');var controller=require(_0x8cfc('0x6'));router['get']('/',auth[_0x8cfc('0x7')](),controller[_0x8cfc('0x8')]);router[_0x8cfc('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x8cfc('0x9')](_0x8cfc('0xa'),auth[_0x8cfc('0x7')](),controller[_0x8cfc('0xb')]);router[_0x8cfc('0xc')]('/',auth['isAuthenticated'](),controller[_0x8cfc('0xd')]);router[_0x8cfc('0xe')](_0x8cfc('0xa'),auth[_0x8cfc('0x7')](),controller['update']);router[_0x8cfc('0xf')](_0x8cfc('0xa'),auth[_0x8cfc('0x7')](),controller['destroy']);module[_0x8cfc('0x10')]=router;
\ No newline at end of file
+var _0xb47d=['post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','get','/describe','describe'];(function(_0x36f1af,_0x520b1b){var _0x5a250b=function(_0x3226a0){while(--_0x3226a0){_0x36f1af['push'](_0x36f1af['shift']());}};_0x5a250b(++_0x520b1b);}(_0xb47d,0x1e7));var _0xdb47=function(_0xd2543c,_0x4ae4d5){_0xd2543c=_0xd2543c-0x0;var _0x5e2e4c=_0xb47d[_0xd2543c];return _0x5e2e4c;};'use strict';var multer=require(_0xdb47('0x0'));var util=require(_0xdb47('0x1'));var path=require(_0xdb47('0x2'));var timeout=require(_0xdb47('0x3'));var express=require('express');var router=express[_0xdb47('0x4')]();var fs_extra=require(_0xdb47('0x5'));var auth=require(_0xdb47('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdb47('0x7'));var controller=require(_0xdb47('0x8'));router['get']('/',auth[_0xdb47('0x9')](),controller['index']);router[_0xdb47('0xa')](_0xdb47('0xb'),auth['isAuthenticated'](),controller[_0xdb47('0xc')]);router[_0xdb47('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xdb47('0xd')]('/',auth[_0xdb47('0x9')](),controller[_0xdb47('0xe')]);router[_0xdb47('0xf')](_0xdb47('0x10'),auth['isAuthenticated'](),controller[_0xdb47('0x11')]);router[_0xdb47('0x12')](_0xdb47('0x10'),auth[_0xdb47('0x9')](),controller['destroy']);module[_0xdb47('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 810680c..582f0d7 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3d28a3,_0x50f384){var _0x25a3cf=function(_0x3de552){while(--_0x3de552){_0x3d28a3['push'](_0x3d28a3['shift']());}};_0x25a3cf(++_0x50f384);}(_0xaa88,0x137));var _0x8aa8=function(_0x5e1b91,_0x236f17){_0x5e1b91=_0x5e1b91-0x0;var _0x59b52f=_0xaa88[_0x5e1b91];return _0x59b52f;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x198b39,_0xf4a35d){var _0x5ec5bd=function(_0x5b73db){while(--_0x5b73db){_0x198b39['push'](_0x198b39['shift']());}};_0x5ec5bd(++_0xf4a35d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x685346,_0x3ef2e5){_0x685346=_0x685346-0x0;var _0x52e15b=_0xcb91[_0x685346];return _0x52e15b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 487ba8b..c340aea 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 _0x4774=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','find','create','update','body','destroy','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','error','name','send','map','ChatTransferReport','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty'];(function(_0x4e1c8d,_0x2157df){var _0x532bb6=function(_0x4c5f2c){while(--_0x4c5f2c){_0x4e1c8d['push'](_0x4e1c8d['shift']());}};_0x532bb6(++_0x2157df);}(_0x4774,0x1e7));var _0x4477=function(_0x535b83,_0x5c4696){_0x535b83=_0x535b83-0x0;var _0x52a7ff=_0x4774[_0x535b83];return _0x52a7ff;};'use strict';var emlformat=require(_0x4477('0x0'));var rimraf=require(_0x4477('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4477('0x2'));var moment=require('moment');var BPromise=require(_0x4477('0x3'));var Mustache=require(_0x4477('0x4'));var util=require(_0x4477('0x5'));var path=require(_0x4477('0x6'));var sox=require(_0x4477('0x7'));var csv=require('to-csv');var ejs=require(_0x4477('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4477('0x9'));var squel=require(_0x4477('0xa'));var crypto=require(_0x4477('0xb'));var jsforce=require(_0x4477('0xc'));var deskjs=require(_0x4477('0xd'));var toCsv=require(_0x4477('0xe'));var querystring=require(_0x4477('0xf'));var Papa=require(_0x4477('0x10'));var Redis=require(_0x4477('0x11'));var authService=require(_0x4477('0x12'));var qs=require(_0x4477('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4477('0x14'));var logger=require(_0x4477('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x4477('0x16'));var licenseUtil=require(_0x4477('0x17'));var db=require(_0x4477('0x18'))['db'];function respondWithStatusCode(_0x1c3118,_0x397ba4){_0x397ba4=_0x397ba4||0xcc;return function(_0x5af841){if(_0x5af841){return _0x1c3118[_0x4477('0x19')](_0x397ba4);}return _0x1c3118['status'](_0x397ba4)['end']();};}function respondWithResult(_0x198712,_0x98cb66){_0x98cb66=_0x98cb66||0xc8;return function(_0x730ec4){if(_0x730ec4){return _0x198712[_0x4477('0x1a')](_0x98cb66)[_0x4477('0x1b')](_0x730ec4);}};}function respondWithFilteredResult(_0x4d37bc,_0x43132b){return function(_0x4d6133){if(_0x4d6133){var _0x25fafc=typeof _0x43132b['offset']===_0x4477('0x1c')&&typeof _0x43132b[_0x4477('0x1d')]===_0x4477('0x1c');var _0x4ade8d=_0x4d6133[_0x4477('0x1e')];var _0x3be50a=_0x25fafc?0x0:_0x43132b[_0x4477('0x1f')];var _0x388e5e=_0x25fafc?_0x4d6133[_0x4477('0x1e')]:_0x43132b[_0x4477('0x1f')]+_0x43132b[_0x4477('0x1d')];var _0x526560;if(_0x388e5e>=_0x4ade8d){_0x388e5e=_0x4ade8d;_0x526560=0xc8;}else{_0x526560=0xce;}_0x4d37bc[_0x4477('0x1a')](_0x526560);return _0x4d37bc[_0x4477('0x20')](_0x4477('0x21'),_0x3be50a+'-'+_0x388e5e+'/'+_0x4ade8d)[_0x4477('0x1b')](_0x4d6133);}return null;};}function patchUpdates(_0x568727){return function(_0x29b64f){try{jsonpatch['apply'](_0x29b64f,_0x568727,!![]);}catch(_0x3ec625){return BPromise[_0x4477('0x22')](_0x3ec625);}return _0x29b64f[_0x4477('0x23')]();};}function saveUpdates(_0x479e73,_0x158b43){return function(_0x497a49){if(_0x497a49){return _0x497a49['update'](_0x479e73)['then'](function(_0x1f889e){return _0x1f889e;});}return null;};}function removeEntity(_0x2b10c8,_0x58ce27){return function(_0x5c40e4){if(_0x5c40e4){return _0x5c40e4['destroy']()[_0x4477('0x24')](function(){_0x2b10c8[_0x4477('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b74ab,_0x1b230c){return function(_0x57b739){if(!_0x57b739){_0x4b74ab[_0x4477('0x19')](0x194);}return _0x57b739;};}function handleError(_0x43ed69,_0x5b4fd7){_0x5b4fd7=_0x5b4fd7||0x1f4;return function(_0x50301d){logger[_0x4477('0x25')](_0x50301d['stack']);if(_0x50301d['name']){delete _0x50301d[_0x4477('0x26')];}_0x43ed69[_0x4477('0x1a')](_0x5b4fd7)[_0x4477('0x27')](_0x50301d);};}exports['index']=function(_0x1795d1,_0x306cd9){var _0x2bd4ce={},_0xcb25a7={},_0x300a2d={'count':0x0,'rows':[]};var _0x3ec427=_[_0x4477('0x28')](db[_0x4477('0x29')]['rawAttributes'],function(_0x156383){return{'name':_0x156383[_0x4477('0x2a')],'type':_0x156383[_0x4477('0x2b')][_0x4477('0x2c')]};});_0xcb25a7['model']=_[_0x4477('0x28')](_0x3ec427,_0x4477('0x26'));_0xcb25a7[_0x4477('0x2d')]=_['keys'](_0x1795d1[_0x4477('0x2d')]);_0xcb25a7[_0x4477('0x2e')]=_[_0x4477('0x2f')](_0xcb25a7[_0x4477('0x30')],_0xcb25a7[_0x4477('0x2d')]);_0x2bd4ce[_0x4477('0x31')]=_['intersection'](_0xcb25a7['model'],qs[_0x4477('0x32')](_0x1795d1[_0x4477('0x2d')][_0x4477('0x32')]));_0x2bd4ce[_0x4477('0x31')]=_0x2bd4ce['attributes']['length']?_0x2bd4ce[_0x4477('0x31')]:_0xcb25a7[_0x4477('0x30')];if(!_0x1795d1[_0x4477('0x2d')][_0x4477('0x33')](_0x4477('0x34'))){_0x2bd4ce[_0x4477('0x1d')]=qs['limit'](_0x1795d1[_0x4477('0x2d')][_0x4477('0x1d')]);_0x2bd4ce['offset']=qs[_0x4477('0x1f')](_0x1795d1['query'][_0x4477('0x1f')]);}_0x2bd4ce[_0x4477('0x35')]=qs[_0x4477('0x36')](_0x1795d1[_0x4477('0x2d')][_0x4477('0x36')]);_0x2bd4ce[_0x4477('0x37')]=qs['filters'](_[_0x4477('0x38')](_0x1795d1[_0x4477('0x2d')],_0xcb25a7['filters']),_0x3ec427);if(_0x1795d1[_0x4477('0x2d')][_0x4477('0x39')]){_0x2bd4ce[_0x4477('0x37')]=_[_0x4477('0x3a')](_0x2bd4ce['where'],{'$or':_['map'](_0x3ec427,function(_0xed7a00){if(_0xed7a00[_0x4477('0x2b')]!==_0x4477('0x3b')){var _0x38576e={};_0x38576e[_0xed7a00['name']]={'$like':'%'+_0x1795d1[_0x4477('0x2d')]['filter']+'%'};return _0x38576e;}})});}_0x2bd4ce=_[_0x4477('0x3a')]({},_0x2bd4ce,_0x1795d1[_0x4477('0x3c')]);var _0x416984={'where':_0x2bd4ce[_0x4477('0x37')]};return db[_0x4477('0x29')][_0x4477('0x1e')](_0x416984)[_0x4477('0x24')](function(_0x7bdd4f){_0x300a2d[_0x4477('0x1e')]=_0x7bdd4f;if(_0x1795d1[_0x4477('0x2d')][_0x4477('0x3d')]){_0x2bd4ce[_0x4477('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x4477('0x3f')](_0x2bd4ce);})[_0x4477('0x24')](function(_0x9c3fa4){_0x300a2d[_0x4477('0x40')]=_0x9c3fa4;return _0x300a2d;})[_0x4477('0x24')](respondWithFilteredResult(_0x306cd9,_0x2bd4ce))[_0x4477('0x41')](handleError(_0x306cd9,null));};exports[_0x4477('0x42')]=function(_0x47104d,_0x42bdf6){var _0x3e304f={'raw':!![],'where':{'id':_0x47104d[_0x4477('0x43')]['id']}},_0x393e91={};_0x393e91[_0x4477('0x30')]=_[_0x4477('0x44')](db[_0x4477('0x29')][_0x4477('0x45')]);_0x393e91[_0x4477('0x2d')]=_['keys'](_0x47104d[_0x4477('0x2d')]);_0x393e91[_0x4477('0x2e')]=_['intersection'](_0x393e91[_0x4477('0x30')],_0x393e91[_0x4477('0x2d')]);_0x3e304f[_0x4477('0x31')]=_['intersection'](_0x393e91['model'],qs[_0x4477('0x32')](_0x47104d[_0x4477('0x2d')]['fields']));_0x3e304f[_0x4477('0x31')]=_0x3e304f[_0x4477('0x31')][_0x4477('0x46')]?_0x3e304f[_0x4477('0x31')]:_0x393e91['model'];if(_0x47104d[_0x4477('0x2d')][_0x4477('0x3d')]){_0x3e304f[_0x4477('0x3e')]=[{'all':!![]}];}_0x3e304f=_[_0x4477('0x3a')]({},_0x3e304f,_0x47104d[_0x4477('0x3c')]);return db[_0x4477('0x29')][_0x4477('0x47')](_0x3e304f)['then'](handleEntityNotFound(_0x42bdf6,null))[_0x4477('0x24')](respondWithResult(_0x42bdf6,null))[_0x4477('0x41')](handleError(_0x42bdf6,null));};exports['create']=function(_0x20da93,_0x1e021f){return db[_0x4477('0x29')][_0x4477('0x48')](_0x20da93['body'],{})[_0x4477('0x24')](respondWithResult(_0x1e021f,0xc9))[_0x4477('0x41')](handleError(_0x1e021f,null));};exports[_0x4477('0x49')]=function(_0x39ff6a,_0x48dae9){if(_0x39ff6a['body']['id']){delete _0x39ff6a['body']['id'];}return db[_0x4477('0x29')][_0x4477('0x47')]({'where':{'id':_0x39ff6a[_0x4477('0x43')]['id']}})[_0x4477('0x24')](handleEntityNotFound(_0x48dae9,null))[_0x4477('0x24')](saveUpdates(_0x39ff6a[_0x4477('0x4a')],null))['then'](respondWithResult(_0x48dae9,null))[_0x4477('0x41')](handleError(_0x48dae9,null));};exports[_0x4477('0x4b')]=function(_0x2355a5,_0x6a8cd5){return db['ChatTransferReport']['find']({'where':{'id':_0x2355a5[_0x4477('0x43')]['id']}})[_0x4477('0x24')](handleEntityNotFound(_0x6a8cd5,null))[_0x4477('0x24')](removeEntity(_0x6a8cd5,null))[_0x4477('0x41')](handleError(_0x6a8cd5,null));};exports[_0x4477('0x4c')]=function(_0x1b1355,_0x5c3fef){return db[_0x4477('0x29')][_0x4477('0x4c')]()[_0x4477('0x24')](respondWithResult(_0x5c3fef,null))[_0x4477('0x41')](handleError(_0x5c3fef,null));};
\ No newline at end of file
+var _0xedc7=['nolimit','order','sort','where','filter','VIRTUAL','merge','options','ChatTransferReport','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length'];(function(_0x3c4206,_0x4dfd90){var _0x16dbaf=function(_0x268f57){while(--_0x268f57){_0x3c4206['push'](_0x3c4206['shift']());}};_0x16dbaf(++_0x4dfd90);}(_0xedc7,0x1f4));var _0x7edc=function(_0x207113,_0x4f0f96){_0x207113=_0x207113-0x0;var _0x1c5789=_0xedc7[_0x207113];return _0x1c5789;};'use strict';var emlformat=require(_0x7edc('0x0'));var rimraf=require(_0x7edc('0x1'));var zipdir=require(_0x7edc('0x2'));var jsonpatch=require(_0x7edc('0x3'));var rp=require(_0x7edc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7edc('0x5'));var path=require(_0x7edc('0x6'));var sox=require(_0x7edc('0x7'));var csv=require('to-csv');var ejs=require(_0x7edc('0x8'));var fs=require('fs');var fs_extra=require(_0x7edc('0x9'));var _=require(_0x7edc('0xa'));var squel=require(_0x7edc('0xb'));var crypto=require(_0x7edc('0xc'));var jsforce=require(_0x7edc('0xd'));var deskjs=require(_0x7edc('0xe'));var toCsv=require(_0x7edc('0xf'));var querystring=require(_0x7edc('0x10'));var Papa=require(_0x7edc('0x11'));var Redis=require(_0x7edc('0x12'));var authService=require(_0x7edc('0x13'));var qs=require(_0x7edc('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7edc('0x15'));var logger=require(_0x7edc('0x16'))(_0x7edc('0x17'));var utils=require(_0x7edc('0x18'));var config=require(_0x7edc('0x19'));var licenseUtil=require(_0x7edc('0x1a'));var db=require(_0x7edc('0x1b'))['db'];function respondWithStatusCode(_0x213aa1,_0x302d99){_0x302d99=_0x302d99||0xcc;return function(_0xe73ad6){if(_0xe73ad6){return _0x213aa1['sendStatus'](_0x302d99);}return _0x213aa1[_0x7edc('0x1c')](_0x302d99)[_0x7edc('0x1d')]();};}function respondWithResult(_0x51019e,_0x4a4a96){_0x4a4a96=_0x4a4a96||0xc8;return function(_0xc170f4){if(_0xc170f4){return _0x51019e[_0x7edc('0x1c')](_0x4a4a96)['json'](_0xc170f4);}};}function respondWithFilteredResult(_0x36e7ac,_0x36401a){return function(_0x4643eb){if(_0x4643eb){var _0x559a8e=typeof _0x36401a['offset']===_0x7edc('0x1e')&&typeof _0x36401a[_0x7edc('0x1f')]===_0x7edc('0x1e');var _0x5617e7=_0x4643eb[_0x7edc('0x20')];var _0x339b01=_0x559a8e?0x0:_0x36401a[_0x7edc('0x21')];var _0x4ea1ac=_0x559a8e?_0x4643eb[_0x7edc('0x20')]:_0x36401a['offset']+_0x36401a['limit'];var _0x5d14a9;if(_0x4ea1ac>=_0x5617e7){_0x4ea1ac=_0x5617e7;_0x5d14a9=0xc8;}else{_0x5d14a9=0xce;}_0x36e7ac['status'](_0x5d14a9);return _0x36e7ac[_0x7edc('0x22')]('Content-Range',_0x339b01+'-'+_0x4ea1ac+'/'+_0x5617e7)[_0x7edc('0x23')](_0x4643eb);}return null;};}function patchUpdates(_0x55aa17){return function(_0x173efa){try{jsonpatch[_0x7edc('0x24')](_0x173efa,_0x55aa17,!![]);}catch(_0x192577){return BPromise[_0x7edc('0x25')](_0x192577);}return _0x173efa[_0x7edc('0x26')]();};}function saveUpdates(_0x222d70,_0x2cbc04){return function(_0x37204f){if(_0x37204f){return _0x37204f[_0x7edc('0x27')](_0x222d70)['then'](function(_0xff9454){return _0xff9454;});}return null;};}function removeEntity(_0x199b1f,_0x5844ac){return function(_0x27a018){if(_0x27a018){return _0x27a018[_0x7edc('0x28')]()[_0x7edc('0x29')](function(){_0x199b1f[_0x7edc('0x1c')](0xcc)[_0x7edc('0x1d')]();});}};}function handleEntityNotFound(_0x3165e0,_0x290772){return function(_0x102496){if(!_0x102496){_0x3165e0[_0x7edc('0x2a')](0x194);}return _0x102496;};}function handleError(_0x3f72c5,_0x159226){_0x159226=_0x159226||0x1f4;return function(_0xbe061b){logger[_0x7edc('0x2b')](_0xbe061b[_0x7edc('0x2c')]);if(_0xbe061b['name']){delete _0xbe061b[_0x7edc('0x2d')];}_0x3f72c5[_0x7edc('0x1c')](_0x159226)[_0x7edc('0x2e')](_0xbe061b);};}exports[_0x7edc('0x2f')]=function(_0x5a914f,_0x332f6f){var _0x565dcc={},_0x662e4e={},_0x26779b={'count':0x0,'rows':[]};var _0x18a399=_[_0x7edc('0x30')](db['ChatTransferReport'][_0x7edc('0x31')],function(_0x33a8c1){return{'name':_0x33a8c1[_0x7edc('0x32')],'type':_0x33a8c1[_0x7edc('0x33')][_0x7edc('0x34')]};});_0x662e4e[_0x7edc('0x35')]=_[_0x7edc('0x30')](_0x18a399,_0x7edc('0x2d'));_0x662e4e[_0x7edc('0x36')]=_['keys'](_0x5a914f['query']);_0x662e4e[_0x7edc('0x37')]=_['intersection'](_0x662e4e['model'],_0x662e4e['query']);_0x565dcc[_0x7edc('0x38')]=_[_0x7edc('0x39')](_0x662e4e['model'],qs[_0x7edc('0x3a')](_0x5a914f[_0x7edc('0x36')]['fields']));_0x565dcc[_0x7edc('0x38')]=_0x565dcc[_0x7edc('0x38')][_0x7edc('0x3b')]?_0x565dcc[_0x7edc('0x38')]:_0x662e4e[_0x7edc('0x35')];if(!_0x5a914f[_0x7edc('0x36')]['hasOwnProperty'](_0x7edc('0x3c'))){_0x565dcc['limit']=qs[_0x7edc('0x1f')](_0x5a914f[_0x7edc('0x36')][_0x7edc('0x1f')]);_0x565dcc['offset']=qs[_0x7edc('0x21')](_0x5a914f['query'][_0x7edc('0x21')]);}_0x565dcc[_0x7edc('0x3d')]=qs[_0x7edc('0x3e')](_0x5a914f[_0x7edc('0x36')][_0x7edc('0x3e')]);_0x565dcc[_0x7edc('0x3f')]=qs[_0x7edc('0x37')](_['pick'](_0x5a914f[_0x7edc('0x36')],_0x662e4e[_0x7edc('0x37')]),_0x18a399);if(_0x5a914f['query'][_0x7edc('0x40')]){_0x565dcc[_0x7edc('0x3f')]=_['merge'](_0x565dcc[_0x7edc('0x3f')],{'$or':_[_0x7edc('0x30')](_0x18a399,function(_0x4db29c){if(_0x4db29c[_0x7edc('0x33')]!==_0x7edc('0x41')){var _0x1d3b30={};_0x1d3b30[_0x4db29c[_0x7edc('0x2d')]]={'$like':'%'+_0x5a914f[_0x7edc('0x36')][_0x7edc('0x40')]+'%'};return _0x1d3b30;}})});}_0x565dcc=_[_0x7edc('0x42')]({},_0x565dcc,_0x5a914f[_0x7edc('0x43')]);var _0x2878e3={'where':_0x565dcc[_0x7edc('0x3f')]};return db[_0x7edc('0x44')][_0x7edc('0x20')](_0x2878e3)[_0x7edc('0x29')](function(_0x1e40e8){_0x26779b['count']=_0x1e40e8;if(_0x5a914f[_0x7edc('0x36')][_0x7edc('0x45')]){_0x565dcc[_0x7edc('0x46')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x565dcc);})[_0x7edc('0x29')](function(_0x3bd7ea){_0x26779b[_0x7edc('0x47')]=_0x3bd7ea;return _0x26779b;})[_0x7edc('0x29')](respondWithFilteredResult(_0x332f6f,_0x565dcc))[_0x7edc('0x48')](handleError(_0x332f6f,null));};exports[_0x7edc('0x49')]=function(_0x52ca89,_0xf0473d){var _0x38586a={'raw':!![],'where':{'id':_0x52ca89[_0x7edc('0x4a')]['id']}},_0x21aa27={};_0x21aa27['model']=_['keys'](db[_0x7edc('0x44')]['rawAttributes']);_0x21aa27[_0x7edc('0x36')]=_[_0x7edc('0x4b')](_0x52ca89['query']);_0x21aa27[_0x7edc('0x37')]=_[_0x7edc('0x39')](_0x21aa27[_0x7edc('0x35')],_0x21aa27['query']);_0x38586a[_0x7edc('0x38')]=_[_0x7edc('0x39')](_0x21aa27['model'],qs['fields'](_0x52ca89[_0x7edc('0x36')][_0x7edc('0x3a')]));_0x38586a[_0x7edc('0x38')]=_0x38586a[_0x7edc('0x38')]['length']?_0x38586a[_0x7edc('0x38')]:_0x21aa27[_0x7edc('0x35')];if(_0x52ca89[_0x7edc('0x36')][_0x7edc('0x45')]){_0x38586a[_0x7edc('0x46')]=[{'all':!![]}];}_0x38586a=_[_0x7edc('0x42')]({},_0x38586a,_0x52ca89[_0x7edc('0x43')]);return db[_0x7edc('0x44')][_0x7edc('0x4c')](_0x38586a)[_0x7edc('0x29')](handleEntityNotFound(_0xf0473d,null))['then'](respondWithResult(_0xf0473d,null))['catch'](handleError(_0xf0473d,null));};exports[_0x7edc('0x4d')]=function(_0xbd05f8,_0x3c284d){return db['ChatTransferReport'][_0x7edc('0x4d')](_0xbd05f8[_0x7edc('0x4e')],{})['then'](respondWithResult(_0x3c284d,0xc9))['catch'](handleError(_0x3c284d,null));};exports[_0x7edc('0x27')]=function(_0x489a20,_0x1f0601){if(_0x489a20[_0x7edc('0x4e')]['id']){delete _0x489a20[_0x7edc('0x4e')]['id'];}return db[_0x7edc('0x44')][_0x7edc('0x4c')]({'where':{'id':_0x489a20[_0x7edc('0x4a')]['id']}})[_0x7edc('0x29')](handleEntityNotFound(_0x1f0601,null))[_0x7edc('0x29')](saveUpdates(_0x489a20[_0x7edc('0x4e')],null))[_0x7edc('0x29')](respondWithResult(_0x1f0601,null))[_0x7edc('0x48')](handleError(_0x1f0601,null));};exports[_0x7edc('0x28')]=function(_0xf4956f,_0x441079){return db[_0x7edc('0x44')][_0x7edc('0x4c')]({'where':{'id':_0xf4956f[_0x7edc('0x4a')]['id']}})[_0x7edc('0x29')](handleEntityNotFound(_0x441079,null))[_0x7edc('0x29')](removeEntity(_0x441079,null))[_0x7edc('0x48')](handleError(_0x441079,null));};exports[_0x7edc('0x4f')]=function(_0x2a0da7,_0x12dfae){return db['ChatTransferReport'][_0x7edc('0x4f')]()[_0x7edc('0x29')](respondWithResult(_0x12dfae,null))[_0x7edc('0x48')](handleError(_0x12dfae,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 73d54ec..bde8792 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 _0x8385=['request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x28d391,_0x1357b3){var _0x3c8bf0=function(_0x55bac9){while(--_0x55bac9){_0x28d391['push'](_0x28d391['shift']());}};_0x3c8bf0(++_0x1357b3);}(_0x8385,0x95));var _0x5838=function(_0x50de21,_0x23b1c3){_0x50de21=_0x50de21-0x0;var _0x200a27=_0x8385[_0x50de21];return _0x200a27;};'use strict';var _=require(_0x5838('0x0'));var util=require(_0x5838('0x1'));var logger=require(_0x5838('0x2'))(_0x5838('0x3'));var moment=require(_0x5838('0x4'));var BPromise=require('bluebird');var rp=require(_0x5838('0x5'));var fs=require('fs');var path=require(_0x5838('0x6'));var rimraf=require(_0x5838('0x7'));var config=require(_0x5838('0x8'));var attributes=require(_0x5838('0x9'));module['exports']=function(_0x5eabda,_0x17ff7f){return _0x5eabda[_0x5838('0xa')](_0x5838('0xb'),attributes,{'tableName':_0x5838('0xc'),'paranoid':![],'indexes':[{'name':_0x5838('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbacc=['api','bluebird','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','lodash'];(function(_0x39b7af,_0x2e78d2){var _0x304290=function(_0x57a662){while(--_0x57a662){_0x39b7af['push'](_0x39b7af['shift']());}};_0x304290(++_0x2e78d2);}(_0xbacc,0x76));var _0xcbac=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xbacc[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0xcbac('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcbac('0x1'));var moment=require('moment');var BPromise=require(_0xcbac('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcbac('0x3'));module[_0xcbac('0x4')]=function(_0x5171e1,_0x1efc1a){return _0x5171e1['define'](_0xcbac('0x5'),attributes,{'tableName':_0xcbac('0x6'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index c9c2ff1..e088f1c 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 _0x53f4=['jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4a4763,_0x2eea44){var _0x433c52=function(_0x3f6af1){while(--_0x3f6af1){_0x4a4763['push'](_0x4a4763['shift']());}};_0x433c52(++_0x2eea44);}(_0x53f4,0x101));var _0x453f=function(_0x10e2ef,_0x590bac){_0x10e2ef=_0x10e2ef-0x0;var _0x28a7cb=_0x53f4[_0x10e2ef];return _0x28a7cb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x453f('0x0'));var BPromise=require(_0x453f('0x1'));var rs=require(_0x453f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x453f('0x3'));var logger=require(_0x453f('0x4'))(_0x453f('0x5'));var config=require(_0x453f('0x6'));var jayson=require(_0x453f('0x7'));var client=jayson[_0x453f('0x8')][_0x453f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2231bb,_0x241190,_0x48c2d9){return new BPromise(function(_0x3beddf,_0x35e725){return client[_0x453f('0xa')](_0x2231bb,_0x48c2d9)[_0x453f('0xb')](function(_0x1431ab){logger['info'](_0x453f('0xc'),_0x241190,_0x453f('0xd'));logger[_0x453f('0xe')](_0x453f('0xf'),_0x241190,_0x453f('0xd'),JSON['stringify'](_0x1431ab));if(_0x1431ab['error']){if(_0x1431ab['error'][_0x453f('0x10')]===0x1f4){logger[_0x453f('0x11')](_0x453f('0xc'),_0x241190,_0x1431ab[_0x453f('0x11')][_0x453f('0x12')]);return _0x35e725(_0x1431ab[_0x453f('0x11')][_0x453f('0x12')]);}logger[_0x453f('0x11')](_0x453f('0xc'),_0x241190,_0x1431ab['error'][_0x453f('0x12')]);return _0x3beddf(_0x1431ab[_0x453f('0x11')][_0x453f('0x12')]);}else{logger[_0x453f('0x13')](_0x453f('0xc'),_0x241190,'request\x20sent');_0x3beddf(_0x1431ab[_0x453f('0x14')][_0x453f('0x12')]);}})[_0x453f('0x15')](function(_0x48d9dc){logger[_0x453f('0x11')](_0x453f('0xc'),_0x241190,_0x48d9dc);_0x35e725(_0x48d9dc);});});}
\ No newline at end of file
+var _0xc001=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x1dbd42,_0x36df05){var _0x1604ec=function(_0x4d00fb){while(--_0x4d00fb){_0x1dbd42['push'](_0x1dbd42['shift']());}};_0x1604ec(++_0x36df05);}(_0xc001,0xc1));var _0x1c00=function(_0x3a8e51,_0x4ff4c3){_0x3a8e51=_0x3a8e51-0x0;var _0x515f8a=_0xc001[_0x3a8e51];return _0x515f8a;};'use strict';var _=require('lodash');var util=require(_0x1c00('0x0'));var moment=require(_0x1c00('0x1'));var BPromise=require(_0x1c00('0x2'));var rs=require(_0x1c00('0x3'));var fs=require('fs');var Redis=require(_0x1c00('0x4'));var db=require(_0x1c00('0x5'))['db'];var utils=require(_0x1c00('0x6'));var logger=require(_0x1c00('0x7'))(_0x1c00('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1c00('0x9')][_0x1c00('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x76c4a9,_0xa41d2e,_0x158026){return new BPromise(function(_0x22b68f,_0x4e1dad){return client[_0x1c00('0xb')](_0x76c4a9,_0x158026)[_0x1c00('0xc')](function(_0x536f38){logger[_0x1c00('0xd')](_0x1c00('0xe'),_0xa41d2e,_0x1c00('0xf'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xa41d2e,_0x1c00('0xf'),JSON[_0x1c00('0x10')](_0x536f38));if(_0x536f38['error']){if(_0x536f38[_0x1c00('0x11')][_0x1c00('0x12')]===0x1f4){logger['error'](_0x1c00('0xe'),_0xa41d2e,_0x536f38[_0x1c00('0x11')]['message']);return _0x4e1dad(_0x536f38[_0x1c00('0x11')][_0x1c00('0x13')]);}logger[_0x1c00('0x11')](_0x1c00('0xe'),_0xa41d2e,_0x536f38[_0x1c00('0x11')]['message']);return _0x22b68f(_0x536f38[_0x1c00('0x11')]['message']);}else{logger[_0x1c00('0xd')](_0x1c00('0xe'),_0xa41d2e,_0x1c00('0xf'));_0x22b68f(_0x536f38[_0x1c00('0x14')][_0x1c00('0x13')]);}})[_0x1c00('0x15')](function(_0x119215){logger[_0x1c00('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0xa41d2e,_0x119215);_0x4e1dad(_0x119215);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 4f7621d..010a040 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 _0xd82a=['./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','show','post','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd82a,0x188));var _0xad82=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xd82a[_0x288f5e];return _0x476cc9;};'use strict';var multer=require(_0xad82('0x0'));var util=require(_0xad82('0x1'));var path=require(_0xad82('0x2'));var timeout=require(_0xad82('0x3'));var express=require('express');var router=express[_0xad82('0x4')]();var fs_extra=require(_0xad82('0x5'));var auth=require(_0xad82('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xad82('0x7'));router['get']('/',auth[_0xad82('0x8')](),controller[_0xad82('0x9')]);router[_0xad82('0xa')](_0xad82('0xb'),auth[_0xad82('0x8')](),controller[_0xad82('0xc')]);router[_0xad82('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xad82('0xd')]);router[_0xad82('0xe')]('/',auth[_0xad82('0x8')](),controller['create']);router['put'](_0xad82('0xf'),auth[_0xad82('0x8')](),controller[_0xad82('0x10')]);router['delete'](_0xad82('0xf'),auth[_0xad82('0x8')](),controller[_0xad82('0x11')]);module[_0xad82('0x12')]=router;
\ No newline at end of file
+var _0x0e2b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x103c20,_0x1299cb){var _0x45f45c=function(_0x56229c){while(--_0x56229c){_0x103c20['push'](_0x103c20['shift']());}};_0x45f45c(++_0x1299cb);}(_0x0e2b,0x1df));var _0xb0e2=function(_0x5c2d49,_0x48be97){_0x5c2d49=_0x5c2d49-0x0;var _0x46b1ac=_0x0e2b[_0x5c2d49];return _0x46b1ac;};'use strict';var multer=require(_0xb0e2('0x0'));var util=require('util');var path=require(_0xb0e2('0x1'));var timeout=require('connect-timeout');var express=require(_0xb0e2('0x2'));var router=express[_0xb0e2('0x3')]();var fs_extra=require(_0xb0e2('0x4'));var auth=require(_0xb0e2('0x5'));var interaction=require(_0xb0e2('0x6'));var config=require(_0xb0e2('0x7'));var controller=require(_0xb0e2('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb0e2('0x9')]);router[_0xb0e2('0xa')](_0xb0e2('0xb'),auth[_0xb0e2('0xc')](),controller[_0xb0e2('0xd')]);router['get'](_0xb0e2('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xb0e2('0xf')]('/',auth[_0xb0e2('0xc')](),controller[_0xb0e2('0x10')]);router[_0xb0e2('0x11')](_0xb0e2('0xe'),auth['isAuthenticated'](),controller[_0xb0e2('0x12')]);router[_0xb0e2('0x13')](_0xb0e2('0xe'),auth[_0xb0e2('0xc')](),controller[_0xb0e2('0x14')]);module[_0xb0e2('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index e8092d9..1f2a0fc 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 _0x96b4=['mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','ENUM','star','name','text','input','getDataValue','onlineForm','parse','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','bottom_right','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x423639,_0x16d5c4){var _0x21f31e=function(_0x3a44a4){while(--_0x3a44a4){_0x423639['push'](_0x423639['shift']());}};_0x21f31e(++_0x16d5c4);}(_0x96b4,0xac));var _0x496b=function(_0x144ac7,_0x78f849){_0x144ac7=_0x144ac7-0x0;var _0x4d7da5=_0x96b4[_0x144ac7];return _0x4d7da5;};'use strict';var Sequelize=require(_0x496b('0x0'));var rs=require(_0x496b('0x1'));module['exports']={'name':{'type':Sequelize[_0x496b('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x496b('0x2')],'allowNull':![],'unique':_0x496b('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x496b('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x496b('0x2')],'allowNull':![],'defaultValue':_0x496b('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x496b('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x496b('0x2')],'allowNull':![],'defaultValue':_0x496b('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x496b('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x496b('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x496b('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x496b('0xa')),'defaultValue':_0x496b('0xb')},'header_online':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0xc')},'start_chat_button':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0xd')},'offline_chat_button':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0xe')},'header_offline':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0xf')},'download_transcript':{'type':Sequelize[_0x496b('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x496b('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x496b('0x11')]},'closingQuestion':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0x14')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x496b('0x15')},'placeholderMessage':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0x16')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x496b('0x17')},'closingMessageButton':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0xe')},'skipMessageButton':{'type':Sequelize[_0x496b('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x496b('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x496b('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x496b('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0x18')},'ratingType':{'type':Sequelize[_0x496b('0x19')](_0x496b('0x1a'),'thumb'),'defaultValue':_0x496b('0x1a')},'ratingStarsNumber':{'type':Sequelize[_0x496b('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x496b('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x496b('0x1b'),'type':_0x496b('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x496b('0x1d'),'props':{'title':_0x496b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x496b('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x496b('0x1e')](_0x496b('0x1f'))?JSON[_0x496b('0x20')](this['getDataValue']('onlineForm')):{};},'set':function(_0x20e191){return this['setDataValue'](_0x496b('0x1f'),JSON[_0x496b('0x21')](_0x20e191));}},'offlineForm':{'type':Sequelize[_0x496b('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x496b('0x1d'),'props':{'title':_0x496b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x496b('0x4'),'type':_0x496b('0x4')},'variable':null},{'type':_0x496b('0x22'),'config':{'placeholder':_0x496b('0x23')},'props':{'title':'Comments','helpText':_0x496b('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x496b('0x1e')]('offlineForm')?JSON[_0x496b('0x20')](this[_0x496b('0x1e')](_0x496b('0x25'))):{};},'set':function(_0x2094bd){return this[_0x496b('0x26')]('offlineForm',JSON[_0x496b('0x21')](_0x2094bd));}},'token':{'type':Sequelize[_0x496b('0x2')],'defaultValue':function(){return rs[_0x496b('0x27')]();}},'autoclose':{'type':Sequelize[_0x496b('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x496b('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x496b('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x496b('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x496b('0x2')]},'waitingTitle':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0x28')},'waitingMessage':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0x29')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x496b('0x2a')},'offlineMessageBody':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0x2b')},'enableUnmanagedNote':{'type':Sequelize[_0x496b('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0x2c')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x496b('0x2d')},'sendUnmanaged':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x496b('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x496b('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x496b('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x496b('0x2')]},'notificationTemplate':{'type':Sequelize[_0x496b('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x496b('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x496b('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x496b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0x2e')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0x2f')},'messagesAlignment':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0x30')},'defaultTitle':{'type':Sequelize[_0x496b('0x2')]},'customerAvatar':{'type':Sequelize[_0x496b('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x496b('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x496b('0x31'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x496b('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x496b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x496b('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x496b('0x2')],'defaultValue':_0x496b('0x32')},'systemAvatar':{'type':Sequelize[_0x496b('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x496b('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x496b('0x33'),'set':function(_0x52b4d4){if(!_0x52b4d4)this[_0x496b('0x26')](_0x496b('0x34'),null);this[_0x496b('0x26')](_0x496b('0x35'),_0x52b4d4);}},'vidaooEscalation':{'type':Sequelize[_0x496b('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x496b('0x2')]},'vidaooTopic':{'type':Sequelize[_0x496b('0x2')],'allowNull':![],'defaultValue':_0x496b('0x36')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x496b('0x37');}},'vidaooMetadata':{'type':Sequelize[_0x496b('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x496b('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x3c6d=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','We\x20are\x20here!','Chat','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','thumb','stringify','input','name','text','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','getDataValue','generate','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.'];(function(_0x485abc,_0x51a488){var _0x4657da=function(_0x2f037a){while(--_0x2f037a){_0x485abc['push'](_0x485abc['shift']());}};_0x4657da(++_0x51a488);}(_0x3c6d,0x110));var _0xd3c6=function(_0x48c654,_0x3232c8){_0x48c654=_0x48c654-0x0;var _0x5378e1=_0x3c6d[_0x48c654];return _0x5378e1;};'use strict';var Sequelize=require(_0xd3c6('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xd3c6('0x1')],'allowNull':![],'unique':_0xd3c6('0x2')},'description':{'type':Sequelize[_0xd3c6('0x1')]},'mapKey':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xd3c6('0x3')},'key':{'type':Sequelize[_0xd3c6('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xd3c6('0x4')},'customerAlias':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd3c6('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd3c6('0x1')],'allowNull':![],'defaultValue':_0xd3c6('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xd3c6('0x1')],'allowNull':![],'defaultValue':_0xd3c6('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd3c6('0x8')]('rounded','squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xd3c6('0x9')},'start_chat_button':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0xa')},'offline_chat_button':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xd3c6('0xb')},'download_transcript':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd3c6('0xc')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xd3c6('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd3c6('0xe')]},'closingQuestion':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0x10')},'noteTitle':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0x11')},'placeholderMessage':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0x12')},'closingMessageButton':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0x13')},'skipMessageButton':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0x14')},'conditionAgreement':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0xd3c6('0x16'),_0xd3c6('0x17')),'defaultValue':_0xd3c6('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xd3c6('0x18')]({'items':[{'type':_0xd3c6('0x19'),'variable':null,'config':{'placeholder':_0xd3c6('0x1a'),'type':_0xd3c6('0x1b'),'required':!![]},'props':{'title':_0xd3c6('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0xd3c6('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xd3c6('0x3'),'type':_0xd3c6('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xd3c6('0x1c'))?JSON[_0xd3c6('0x1d')](this['getDataValue']('onlineForm')):{};},'set':function(_0x321844){return this[_0xd3c6('0x1e')](_0xd3c6('0x1c'),JSON[_0xd3c6('0x18')](_0x321844));}},'offlineForm':{'type':Sequelize[_0xd3c6('0xe')],'defaultValue':function(){return JSON[_0xd3c6('0x18')]({'items':[{'type':_0xd3c6('0x19'),'props':{'title':_0xd3c6('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0xd3c6('0x1f'),'config':{'placeholder':_0xd3c6('0x20')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xd3c6('0x21'))?JSON[_0xd3c6('0x1d')](this[_0xd3c6('0x22')](_0xd3c6('0x21'))):{};},'set':function(_0x402976){return this[_0xd3c6('0x1e')](_0xd3c6('0x21'),JSON[_0xd3c6('0x18')](_0x402976));}},'token':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':function(){return rs[_0xd3c6('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd3c6('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd3c6('0x1')]},'waitingTitle':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0x24')},'offlineMessageSubject':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0x25')},'offlineMessageBody':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0x27')},'skipUnmanaged':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0x14')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xd3c6('0x13')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd3c6('0x1')]},'notificationTemplate':{'type':Sequelize[_0xd3c6('0xe')],'defaultValue':function(){return _0xd3c6('0x28');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd3c6('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd3c6('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0x2a')},'messagesAlignment':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0x2b')},'defaultTitle':{'type':Sequelize[_0xd3c6('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd3c6('0x1')],'allowNull':![],'defaultValue':_0xd3c6('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd3c6('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd3c6('0x1')],'defaultValue':_0xd3c6('0x2d')},'systemAvatar':{'type':Sequelize[_0xd3c6('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd3c6('0xc')],'comment':_0xd3c6('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':![],'comment':_0xd3c6('0x2f'),'set':function(_0x2c1707){if(!_0x2c1707)this[_0xd3c6('0x1e')](_0xd3c6('0x30'),null);this[_0xd3c6('0x1e')](_0xd3c6('0x31'),_0x2c1707);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd3c6('0x1')]},'vidaooTopic':{'type':Sequelize[_0xd3c6('0x1')],'allowNull':![],'defaultValue':_0xd3c6('0x32')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xd3c6('0x33');}},'vidaooMetadata':{'type':Sequelize[_0xd3c6('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd3c6('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd3c6('0xe')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 1989a75..97fe501 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 _0xce1d=['threadId','closed','ChatInteraction','externalUrl','ContactId','interaction','Writing\x20on\x20closed\x20interaction','contact','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','offline','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','files','attachments','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','getSnippet','getProactiveActions','../../config/license/util','getLicense','increment','chatLicenseExceeded','timezone','server/files/chat/iframe.ejs','3.12.1','headers','origin','http://localhost:9000','testWebsiteWithWildcard','x-real-ip','connection','virtual','replace','alignment','verticalAlignment','color_button','backgroundColor','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','getApplications','chatProactiveAction','addProactiveActions','getFields','online','false','offlineForm','onlineForm','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','fs-extra','querystring','ioredis','jayson/promise','../../config/logger','api','../../config/environment','../../errors/api','APINotFoundError','handleError','APIConflictError','url','URL','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','send','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','referer','name','browser','version','format','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','query','keys','attributes','fields','length','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','params','Pause','intersection','includeAll','include','find','create','body','address','split','forEach','trim','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','describe','Disposition','hasOwnProperty','nolimit','order','findAll','removeDispositions','ids','ChatWebsiteId','CannedAnswer','findOne','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','resolve','ifTime','notify','chat','from','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','List','Contacts','ChatApplication','Applications','Interval','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list'];(function(_0x4f160d,_0x907ba8){var _0x534d5b=function(_0x4e87aa){while(--_0x4e87aa){_0x4f160d['push'](_0x4f160d['shift']());}};_0x534d5b(++_0x907ba8);}(_0xce1d,0x7b));var _0xdce1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce1d[_0x3dd15e];return _0x231fd0;};'use strict';var Mustache=require(_0xdce1('0x0'));var util=require(_0xdce1('0x1'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdce1('0x2'));var _=require('lodash');var querystring=require(_0xdce1('0x3'));var htmlToText=require('html-to-text');var Redis=require(_0xdce1('0x4'));var jayson=require(_0xdce1('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0xdce1('0x6'))(_0xdce1('0x7'));var config=require(_0xdce1('0x8'));var APIBadRequestError=require(_0xdce1('0x9'))['APIBadRequestError'];var APINotFoundError=require('../../errors/api')[_0xdce1('0xa')];var APIOutOfIntervalError=require(_0xdce1('0x9'))['APIOutOfIntervalError'];var APIHandleError=require(_0xdce1('0x9'))[_0xdce1('0xb')];var APIConflictError=require(_0xdce1('0x9'))[_0xdce1('0xc')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require(_0xdce1('0xd'))[_0xdce1('0xe')];var db=require(_0xdce1('0xf'))['db'];config[_0xdce1('0x10')]=_[_0xdce1('0x11')](config['redis'],{'host':_0xdce1('0x12'),'port':0x18eb});var socket=require(_0xdce1('0x13'))(new Redis(config[_0xdce1('0x10')]));require(_0xdce1('0x14'))[_0xdce1('0x15')](socket);var client=jayson[_0xdce1('0x16')][_0xdce1('0x17')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson['client'][_0xdce1('0x17')]({'port':0x232b});var client9001=jayson['client'][_0xdce1('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x2ea53f,_0x41a374,_0x386d41,_0x4992a7){return new Promise(function(_0x11e8ff,_0x5a7126){var _0x3375fe=_0x4992a7||client;return _0x3375fe[_0xdce1('0x18')](_0x2ea53f,_0x386d41)[_0xdce1('0x19')](function(_0x22c5bf){logger[_0xdce1('0x1a')](_0xdce1('0x1b'),_0x41a374,_0xdce1('0x1c'));logger[_0xdce1('0x1d')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x41a374,_0xdce1('0x1c'),JSON[_0xdce1('0x1e')](_0x22c5bf));if(_0x22c5bf['error']){if(_0x22c5bf['error'][_0xdce1('0x1f')]===0x1f4){logger['error'](_0xdce1('0x1b'),_0x41a374,_0x22c5bf[_0xdce1('0x20')][_0xdce1('0x21')]);return _0x5a7126(_0x22c5bf['error'][_0xdce1('0x21')]);}logger[_0xdce1('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x41a374,_0x22c5bf['error'][_0xdce1('0x21')]);return _0x11e8ff(_0x22c5bf[_0xdce1('0x20')]['message']);}else{logger[_0xdce1('0x1a')](_0xdce1('0x1b'),_0x41a374,_0xdce1('0x1c'));_0x11e8ff(_0x22c5bf[_0xdce1('0x22')][_0xdce1('0x21')]);}})[_0xdce1('0x23')](function(_0x458571){logger[_0xdce1('0x20')](_0xdce1('0x1b'),_0x41a374,_0x458571);_0x5a7126(_0x458571);});});}function respondWithStatusCode(_0x10ed90,_0x2b7508){_0x2b7508=_0x2b7508||0xcc;return function(_0x14a0ec){if(_0x14a0ec){return _0x10ed90[_0xdce1('0x24')](_0x2b7508);}return _0x10ed90[_0xdce1('0x25')](_0x2b7508)[_0xdce1('0x26')]();};}function respondWithResult(_0x5d1938,_0x329a00){_0x329a00=_0x329a00||0xc8;return function(_0x494532){if(_0x494532){return _0x5d1938[_0xdce1('0x25')](_0x329a00)[_0xdce1('0x27')](_0x494532);}};}function respondWithFilteredResult(_0x44e6f0,_0xb0cc05){return function(_0x45276){if(_0x45276){var _0x41fb54=typeof _0xb0cc05[_0xdce1('0x28')]===_0xdce1('0x29')&&typeof _0xb0cc05['limit']===_0xdce1('0x29');var _0x1a2298=_0x45276[_0xdce1('0x2a')];var _0x1e6795=_0x41fb54?0x0:_0xb0cc05[_0xdce1('0x28')];var _0x168c26=_0x41fb54?_0x45276['count']:_0xb0cc05['offset']+_0xb0cc05[_0xdce1('0x2b')];var _0x46bbd5;if(_0x168c26>=_0x1a2298){_0x168c26=_0x1a2298;_0x46bbd5=0xc8;}else{_0x46bbd5=0xce;}_0x44e6f0[_0xdce1('0x25')](_0x46bbd5);return _0x44e6f0[_0xdce1('0x2c')](_0xdce1('0x2d'),_0x1e6795+'-'+_0x168c26+'/'+_0x1a2298)[_0xdce1('0x27')](_0x45276);}return null;};}function saveUpdates(_0x31ddb4){return function(_0x4f4757){if(_0x4f4757){return _0x4f4757[_0xdce1('0x2e')](_0x31ddb4)[_0xdce1('0x19')](function(_0x153ac1){return _0x153ac1;});}return null;};}function removeEntity(_0x2721d3){return function(_0x9239c2){if(_0x9239c2){return _0x9239c2[_0xdce1('0x2f')]()[_0xdce1('0x19')](function(){var _0x3e42ff=_0x9239c2[_0xdce1('0x30')]({'plain':!![]});var _0x145085=_0xdce1('0x31');return db[_0xdce1('0x32')][_0xdce1('0x2f')]({'where':{'type':_0x145085,'resourceId':_0x3e42ff['id']}})[_0xdce1('0x19')](function(){return _0x9239c2;});})[_0xdce1('0x19')](function(){_0x2721d3[_0xdce1('0x25')](0xcc)[_0xdce1('0x26')]();});}};}function handleEntityNotFound(_0x48966a){return function(_0xbae053){if(!_0xbae053){_0x48966a['sendStatus'](0x194);}return _0xbae053;};}function handleError(_0x167ade,_0x38f4c4){_0x38f4c4=_0x38f4c4||0x1f4;return function(_0x598bb2){logger[_0xdce1('0x20')](_0x598bb2[_0xdce1('0x33')]);if(_0x598bb2['name']){delete _0x598bb2['name'];}_0x167ade[_0xdce1('0x25')](_0x38f4c4)[_0xdce1('0x34')](_0x598bb2);};}function createInteractionObject(_0x239a3d,_0xf677f1,_0x352529,_0x52ec62){var _0x598885=require(_0xdce1('0x35'));var _0x4f1eea=new _0x598885();var _0x159df9=_0x4f1eea[_0xdce1('0x36')](_0x352529['user-agent'])[_0xdce1('0x37')]();var _0x4a80a6=_0xf677f1[_0xdce1('0x38')];if(_0x352529[_0xdce1('0x39')]){_0x4a80a6=_0x352529[_0xdce1('0x39')];}else if(_0x352529[_0xdce1('0x3a')]){_0x4a80a6=_['first'](_0x352529[_0xdce1('0x3a')]['split'](','));}return{'ContactId':_0x52ec62['id'],'ChatWebsiteId':_0x239a3d,'from':(_0x52ec62[_0xdce1('0x3b')]||'')+'\x20'+(_0x52ec62[_0xdce1('0x3c')]||''),'customerIp':_0x4a80a6,'customerPort':_0x352529['x-real-port']?_0x352529[_0xdce1('0x3d')]:null,'referer':_0xf677f1[_0xdce1('0x3e')],'browserName':_0x159df9['browser'][_0xdce1('0x3f')]&&_0x159df9[_0xdce1('0x40')][_0xdce1('0x41')]?util[_0xdce1('0x42')](_0xdce1('0x43'),_0x159df9[_0xdce1('0x40')][_0xdce1('0x3f')],_0x159df9[_0xdce1('0x40')][_0xdce1('0x41')]):_0xdce1('0x44'),'browserVersion':_0x159df9[_0xdce1('0x40')][_0xdce1('0x41')]||_0xdce1('0x44'),'osName':util['format'](_0xdce1('0x43'),_0x159df9['os'][_0xdce1('0x3f')],_0x159df9['os'][_0xdce1('0x41')]),'osVersion':_0x159df9['os'][_0xdce1('0x41')],'deviceModel':_0x159df9[_0xdce1('0x45')][_0xdce1('0x46')]&&_0x159df9[_0xdce1('0x45')][_0xdce1('0x47')]?util[_0xdce1('0x42')](_0xdce1('0x48'),_0x159df9['device']['model'],_0x159df9[_0xdce1('0x45')]['vendor'],_0x159df9['device']['type']):null,'deviceVendor':_0x159df9[_0xdce1('0x45')]['vendor'],'deviceType':_0x159df9[_0xdce1('0x45')]['type'],'formData':JSON['stringify'](_0xf677f1)};}exports[_0xdce1('0x49')]=function(_0x1e0f3c,_0x1bc9d1){var _0x23fecd={'include':[{'model':db['Pause'],'as':_0xdce1('0x4a')}]},_0x26901b={},_0x10aac3={'count':0x0,'rows':[]};var _0x126857=_[_0xdce1('0x4b')](db[_0xdce1('0x4c')][_0xdce1('0x4d')],function(_0x256a44){return{'name':_0x256a44['fieldName'],'type':_0x256a44[_0xdce1('0x4e')][_0xdce1('0x4f')]};});_0x26901b[_0xdce1('0x46')]=_[_0xdce1('0x4b')](_0x126857,'name');_0x26901b[_0xdce1('0x50')]=_[_0xdce1('0x51')](_0x1e0f3c[_0xdce1('0x50')]);_0x26901b['filters']=_['intersection'](_0x26901b[_0xdce1('0x46')],_0x26901b[_0xdce1('0x50')]);_0x23fecd[_0xdce1('0x52')]=_['intersection'](_0x26901b[_0xdce1('0x46')],qs['fields'](_0x1e0f3c[_0xdce1('0x50')][_0xdce1('0x53')]));_0x23fecd['attributes']=_0x23fecd[_0xdce1('0x52')][_0xdce1('0x54')]?_0x23fecd[_0xdce1('0x52')]:_0x26901b[_0xdce1('0x46')];if(!_0x1e0f3c[_0xdce1('0x50')]['hasOwnProperty']('nolimit')){_0x23fecd[_0xdce1('0x2b')]=qs[_0xdce1('0x2b')](_0x1e0f3c[_0xdce1('0x50')]['limit']);_0x23fecd[_0xdce1('0x28')]=qs[_0xdce1('0x28')](_0x1e0f3c[_0xdce1('0x50')][_0xdce1('0x28')]);}_0x23fecd['order']=qs[_0xdce1('0x55')](_0x1e0f3c[_0xdce1('0x50')][_0xdce1('0x55')]);_0x23fecd[_0xdce1('0x56')]=qs[_0xdce1('0x57')](_[_0xdce1('0x58')](_0x1e0f3c[_0xdce1('0x50')],_0x26901b[_0xdce1('0x57')]),_0x126857);if(_0x1e0f3c[_0xdce1('0x50')][_0xdce1('0x59')]){_0x23fecd[_0xdce1('0x56')]=_[_0xdce1('0x5a')](_0x23fecd['where'],{'$or':_[_0xdce1('0x4b')](_0x126857,function(_0x173e5b){if(_0x173e5b[_0xdce1('0x4e')]!==_0xdce1('0x5b')){var _0x2243a9={};_0x2243a9[_0x173e5b['name']]={'$like':'%'+_0x1e0f3c[_0xdce1('0x50')][_0xdce1('0x59')]+'%'};return _0x2243a9;}})});}_0x23fecd=_[_0xdce1('0x5a')]({},_0x23fecd,_0x1e0f3c[_0xdce1('0x5c')]);var _0x31720f={'where':_0x23fecd[_0xdce1('0x56')]};return db[_0xdce1('0x4c')][_0xdce1('0x2a')](_0x31720f)[_0xdce1('0x19')](function(_0x17f660){_0x10aac3[_0xdce1('0x2a')]=_0x17f660;if(_0x1e0f3c[_0xdce1('0x50')]['includeAll']){_0x23fecd['include']=[{'all':!![]}];}return db[_0xdce1('0x4c')]['findAll'](_0x23fecd);})[_0xdce1('0x19')](function(_0x1068f2){_0x10aac3[_0xdce1('0x5d')]=_0x1068f2;return _0x10aac3;})['then'](respondWithFilteredResult(_0x1bc9d1,_0x23fecd))[_0xdce1('0x23')](handleError(_0x1bc9d1,null));};exports['show']=function(_0x18fade,_0x1ea39b){var _0x25a58c={'raw':![],'where':{'id':_0x18fade[_0xdce1('0x5e')]['id']},'include':[{'model':db[_0xdce1('0x5f')],'as':'mandatoryDispositionPause'}]},_0xaa3d98={};_0xaa3d98[_0xdce1('0x46')]=_[_0xdce1('0x51')](db[_0xdce1('0x4c')][_0xdce1('0x4d')]);_0xaa3d98[_0xdce1('0x50')]=_[_0xdce1('0x51')](_0x18fade[_0xdce1('0x50')]);_0xaa3d98[_0xdce1('0x57')]=_['intersection'](_0xaa3d98[_0xdce1('0x46')],_0xaa3d98['query']);_0x25a58c[_0xdce1('0x52')]=_[_0xdce1('0x60')](_0xaa3d98['model'],qs['fields'](_0x18fade[_0xdce1('0x50')]['fields']));_0x25a58c[_0xdce1('0x52')]=_0x25a58c[_0xdce1('0x52')]['length']?_0x25a58c[_0xdce1('0x52')]:_0xaa3d98[_0xdce1('0x46')];if(_0x18fade[_0xdce1('0x50')][_0xdce1('0x61')]){_0x25a58c[_0xdce1('0x62')]=[{'all':!![]}];}_0x25a58c=_['merge']({},_0x25a58c,_0x18fade[_0xdce1('0x5c')]);return db[_0xdce1('0x4c')][_0xdce1('0x63')](_0x25a58c)['then'](handleEntityNotFound(_0x1ea39b,null))[_0xdce1('0x19')](respondWithResult(_0x1ea39b,null))[_0xdce1('0x23')](handleError(_0x1ea39b,null));};exports[_0xdce1('0x64')]=function(_0xd6032e,_0x2940eb){var _0x1f034b=null;_0xd6032e[_0xdce1('0x65')][_0xdce1('0x66')][_0xdce1('0x67')](',')[_0xdce1('0x68')](_0x4dec3b=>{if(_0x4dec3b[_0xdce1('0x69')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x4dec3b[_0xdce1('0x69')]())){_0x1f034b=new APIBadRequestError('\x22'+_0x4dec3b[_0xdce1('0x69')]()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x1f034b){return handleError(_0x2940eb,null)(_0x1f034b);}return db[_0xdce1('0x4c')][_0xdce1('0x64')](_0xd6032e['body'],{})[_0xdce1('0x19')](function(_0x51146e){var _0x906c09=_0xd6032e[_0xdce1('0x6a')]['get']({'plain':!![]});if(!_0x906c09)throw new Error(_0xdce1('0x6b'));if(_0x906c09['role']===_0xdce1('0x6a')){var _0x51d326=_0x51146e[_0xdce1('0x30')]({'plain':!![]});var _0x4841d6=_0xdce1('0x31');return db['UserProfileSection']['find']({'where':{'name':_0x4841d6,'userProfileId':_0x906c09[_0xdce1('0x6c')]},'raw':!![]})[_0xdce1('0x19')](function(_0x321530){if(_0x321530&&_0x321530[_0xdce1('0x6d')]===0x0){return db['UserProfileResource'][_0xdce1('0x64')]({'name':_0x51d326['name'],'resourceId':_0x51d326['id'],'type':_0x321530[_0xdce1('0x3f')],'sectionId':_0x321530['id']},{})['then'](function(){return _0x51146e;});}else{return _0x51146e;}})[_0xdce1('0x23')](function(_0x328b02){logger[_0xdce1('0x20')](_0xdce1('0x6e'),_0x328b02);throw _0x328b02;});}return _0x51146e;})[_0xdce1('0x19')](respondWithResult(_0x2940eb,0xc9))[_0xdce1('0x23')](handleError(_0x2940eb,null));};exports['update']=function(_0xe1bd28,_0x333249){var _0x271930=null;_0xe1bd28[_0xdce1('0x65')][_0xdce1('0x66')][_0xdce1('0x67')](',')['forEach'](_0x1ff675=>{if(_0x1ff675['trim']()!==''&&!wildcardUtils[_0xdce1('0x6f')](_0x1ff675[_0xdce1('0x69')]())){_0x271930=new APIBadRequestError('\x22'+_0x1ff675[_0xdce1('0x69')]()+_0xdce1('0x70'));}});if(_0x271930){return handleError(_0x333249,null)(_0x271930);}if(_0xe1bd28[_0xdce1('0x65')]['id']){delete _0xe1bd28[_0xdce1('0x65')]['id'];}return db[_0xdce1('0x4c')]['find']({'where':{'id':_0xe1bd28[_0xdce1('0x5e')]['id']},'include':[{'model':db[_0xdce1('0x5f')],'as':_0xdce1('0x4a')}]})[_0xdce1('0x19')](handleEntityNotFound(_0x333249,null))['then'](saveUpdates(_0xe1bd28[_0xdce1('0x65')],null))[_0xdce1('0x19')](respondWithResult(_0x333249,null))[_0xdce1('0x23')](handleError(_0x333249,null));};exports[_0xdce1('0x2f')]=function(_0x326006,_0x3db4ab){return db[_0xdce1('0x4c')]['find']({'where':{'id':_0x326006[_0xdce1('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3db4ab,null))[_0xdce1('0x19')](removeEntity(_0x3db4ab,null))[_0xdce1('0x23')](handleError(_0x3db4ab,null));};exports[_0xdce1('0x71')]=function(_0x1aff3d,_0x509a23){return db[_0xdce1('0x4c')][_0xdce1('0x71')]()['then'](respondWithResult(_0x509a23,null))[_0xdce1('0x23')](handleError(_0x509a23,null));};exports['addDisposition']=function(_0x3411fb,_0x16fae4){if(_0x3411fb[_0xdce1('0x65')]['id']){delete _0x3411fb[_0xdce1('0x65')]['id'];}return db[_0xdce1('0x4c')][_0xdce1('0x63')]({'where':{'id':_0x3411fb[_0xdce1('0x5e')]['id']}})['then'](handleEntityNotFound(_0x16fae4,null))['then'](function(_0x24d714){if(_0x24d714){_0x3411fb[_0xdce1('0x65')]['ChatWebsiteId']=_0x24d714['id'];return db[_0xdce1('0x72')][_0xdce1('0x64')](_0x3411fb['body']);}})[_0xdce1('0x19')](respondWithResult(_0x16fae4,null))['catch'](handleError(_0x16fae4,null));};exports['getDispositions']=function(_0x170238,_0x3addd8){var _0x363c41={'raw':![],'where':{}};var _0x1ee2cd={};var _0x17e376={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x170238[_0xdce1('0x5e')]['id']}})[_0xdce1('0x19')](handleEntityNotFound(_0x3addd8,null))[_0xdce1('0x19')](function(_0x2af5ba){if(_0x2af5ba){_0x1ee2cd[_0xdce1('0x46')]=_[_0xdce1('0x51')](db[_0xdce1('0x72')][_0xdce1('0x4d')]);_0x1ee2cd['query']=_[_0xdce1('0x51')](_0x170238[_0xdce1('0x50')]);_0x1ee2cd[_0xdce1('0x57')]=_[_0xdce1('0x60')](_0x1ee2cd[_0xdce1('0x46')],_0x1ee2cd['query']);_0x363c41[_0xdce1('0x52')]=_[_0xdce1('0x60')](_0x1ee2cd[_0xdce1('0x46')],qs[_0xdce1('0x53')](_0x170238[_0xdce1('0x50')][_0xdce1('0x53')]));_0x363c41['attributes']=_0x363c41[_0xdce1('0x52')][_0xdce1('0x54')]?_0x363c41[_0xdce1('0x52')]:_0x1ee2cd[_0xdce1('0x46')];if(!_0x170238[_0xdce1('0x50')][_0xdce1('0x73')](_0xdce1('0x74'))){_0x363c41[_0xdce1('0x2b')]=qs['limit'](_0x170238['query']['limit']);_0x363c41['offset']=qs[_0xdce1('0x28')](_0x170238[_0xdce1('0x50')][_0xdce1('0x28')]);}_0x363c41[_0xdce1('0x75')]=qs[_0xdce1('0x55')](_0x170238['query'][_0xdce1('0x55')]);_0x363c41[_0xdce1('0x56')]=qs[_0xdce1('0x57')](_[_0xdce1('0x58')](_0x170238[_0xdce1('0x50')],_0x1ee2cd[_0xdce1('0x57')]));_0x363c41[_0xdce1('0x56')]['ChatWebsiteId']=_0x2af5ba['id'];if(_0x170238[_0xdce1('0x50')][_0xdce1('0x59')]){_0x363c41[_0xdce1('0x56')]=_[_0xdce1('0x5a')](_0x363c41[_0xdce1('0x56')],{'$or':_['map'](_0x363c41[_0xdce1('0x52')],function(_0x3a58e0){var _0x2ce35f={};_0x2ce35f[_0x3a58e0]={'$like':'%'+_0x170238[_0xdce1('0x50')][_0xdce1('0x59')]+'%'};return _0x2ce35f;})});}_0x363c41=_[_0xdce1('0x5a')]({},_0x363c41,_0x170238[_0xdce1('0x5c')]);return db['Disposition'][_0xdce1('0x2a')]({'where':_0x363c41['where']})['then'](function(_0x5ef702){_0x17e376['count']=_0x5ef702;if(_0x170238[_0xdce1('0x50')][_0xdce1('0x61')]){_0x363c41['include']=[{'all':!![]}];}return db['Disposition'][_0xdce1('0x76')](_0x363c41);})[_0xdce1('0x19')](function(_0x2ec8e5){_0x17e376[_0xdce1('0x5d')]=_0x2ec8e5;return _0x17e376;});}})[_0xdce1('0x19')](respondWithFilteredResult(_0x3addd8,_0x363c41))[_0xdce1('0x23')](handleError(_0x3addd8,null));};exports[_0xdce1('0x77')]=function(_0xcd0517,_0xe5d4bd){return db['ChatWebsite'][_0xdce1('0x63')]({'where':{'id':_0xcd0517['params']['id']}})[_0xdce1('0x19')](handleEntityNotFound(_0xe5d4bd,null))[_0xdce1('0x19')](function(_0x1b48e5){if(_0x1b48e5){return _0x1b48e5[_0xdce1('0x77')](_0xcd0517[_0xdce1('0x50')][_0xdce1('0x78')]);}})[_0xdce1('0x19')](respondWithStatusCode(_0xe5d4bd,null))[_0xdce1('0x23')](handleError(_0xe5d4bd,null));};exports['addAnswer']=function(_0x34c1c6,_0x5cecfb){if(_0x34c1c6[_0xdce1('0x65')]['id']){delete _0x34c1c6[_0xdce1('0x65')]['id'];}return db[_0xdce1('0x4c')][_0xdce1('0x63')]({'where':{'id':_0x34c1c6['params']['id']}})[_0xdce1('0x19')](handleEntityNotFound(_0x5cecfb,null))[_0xdce1('0x19')](function(_0x2b3d16){if(_0x2b3d16){_0x34c1c6[_0xdce1('0x65')][_0xdce1('0x79')]=_0x2b3d16['id'];return db[_0xdce1('0x7a')]['create'](_0x34c1c6['body']);}})[_0xdce1('0x19')](respondWithResult(_0x5cecfb,null))[_0xdce1('0x23')](handleError(_0x5cecfb,null));};exports['getAnswers']=function(_0x1c7ddd,_0x28421b){var _0x1c8ffb={'raw':![],'where':{}};var _0x134871={};var _0x34e54c={'count':0x0,'rows':[]};return db[_0xdce1('0x4c')][_0xdce1('0x7b')]({'where':{'id':_0x1c7ddd['params']['id']}})[_0xdce1('0x19')](handleEntityNotFound(_0x28421b,null))['then'](function(_0x339dac){if(_0x339dac){_0x134871[_0xdce1('0x46')]=_[_0xdce1('0x51')](db[_0xdce1('0x7a')][_0xdce1('0x4d')]);_0x134871[_0xdce1('0x50')]=_[_0xdce1('0x51')](_0x1c7ddd[_0xdce1('0x50')]);_0x134871[_0xdce1('0x57')]=_[_0xdce1('0x60')](_0x134871[_0xdce1('0x46')],_0x134871[_0xdce1('0x50')]);_0x1c8ffb[_0xdce1('0x52')]=_[_0xdce1('0x60')](_0x134871[_0xdce1('0x46')],qs[_0xdce1('0x53')](_0x1c7ddd[_0xdce1('0x50')][_0xdce1('0x53')]));_0x1c8ffb[_0xdce1('0x52')]=_0x1c8ffb[_0xdce1('0x52')][_0xdce1('0x54')]?_0x1c8ffb[_0xdce1('0x52')]:_0x134871[_0xdce1('0x46')];if(!_0x1c7ddd[_0xdce1('0x50')][_0xdce1('0x73')](_0xdce1('0x74'))){_0x1c8ffb[_0xdce1('0x2b')]=qs[_0xdce1('0x2b')](_0x1c7ddd['query'][_0xdce1('0x2b')]);_0x1c8ffb[_0xdce1('0x28')]=qs['offset'](_0x1c7ddd[_0xdce1('0x50')][_0xdce1('0x28')]);}_0x1c8ffb[_0xdce1('0x75')]=qs['sort'](_0x1c7ddd['query'][_0xdce1('0x55')]);_0x1c8ffb[_0xdce1('0x56')]=qs[_0xdce1('0x57')](_['pick'](_0x1c7ddd[_0xdce1('0x50')],_0x134871['filters']));_0x1c8ffb['where']['ChatWebsiteId']=_0x339dac['id'];if(_0x1c7ddd['query'][_0xdce1('0x59')]){_0x1c8ffb['where']=_[_0xdce1('0x5a')](_0x1c8ffb[_0xdce1('0x56')],{'$or':_[_0xdce1('0x4b')](_0x1c8ffb[_0xdce1('0x52')],function(_0x29e596){var _0xd339dd={};_0xd339dd[_0x29e596]={'$like':'%'+_0x1c7ddd[_0xdce1('0x50')]['filter']+'%'};return _0xd339dd;})});}_0x1c8ffb=_[_0xdce1('0x5a')]({},_0x1c8ffb,_0x1c7ddd[_0xdce1('0x5c')]);return db[_0xdce1('0x7a')][_0xdce1('0x2a')]({'where':_0x1c8ffb['where']})['then'](function(_0x2d0414){_0x34e54c['count']=_0x2d0414;if(_0x1c7ddd[_0xdce1('0x50')][_0xdce1('0x61')]){_0x1c8ffb[_0xdce1('0x62')]=[{'all':!![]}];}return db[_0xdce1('0x7a')][_0xdce1('0x76')](_0x1c8ffb);})[_0xdce1('0x19')](function(_0x433e9e){_0x34e54c[_0xdce1('0x5d')]=_0x433e9e;return _0x34e54c;});}})[_0xdce1('0x19')](respondWithFilteredResult(_0x28421b,_0x1c8ffb))[_0xdce1('0x23')](handleError(_0x28421b,null));};exports[_0xdce1('0x7c')]=function(_0xa23a7c,_0x4efa86){return db['ChatWebsite']['find']({'where':{'id':_0xa23a7c[_0xdce1('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4efa86,null))[_0xdce1('0x19')](function(_0x2c25f0){if(_0x2c25f0){return _0x2c25f0[_0xdce1('0x7c')](_0xa23a7c[_0xdce1('0x50')][_0xdce1('0x78')]);}})[_0xdce1('0x19')](respondWithStatusCode(_0x4efa86,null))[_0xdce1('0x23')](handleError(_0x4efa86,null));};exports[_0xdce1('0x7d')]=function(_0x837cd9,_0x47ed6b){_0x837cd9[_0xdce1('0x65')][_0xdce1('0x7e')]=_0x837cd9[_0xdce1('0x7f')][_0xdce1('0x80')];return db[_0xdce1('0x4c')][_0xdce1('0x63')]({'where':{'id':_0x837cd9[_0xdce1('0x5e')]['id']}})[_0xdce1('0x19')](handleEntityNotFound(_0x47ed6b,null))[_0xdce1('0x19')](saveUpdates(_0x837cd9['body'],null))[_0xdce1('0x19')](respondWithResult(_0x47ed6b,null))[_0xdce1('0x23')](handleError(_0x47ed6b,null));};exports['addAvatar']=function(_0x7bdec4,_0xa4263c){_0x7bdec4[_0xdce1('0x65')][_0xdce1('0x81')]=_0x7bdec4[_0xdce1('0x7f')][_0xdce1('0x80')];return db[_0xdce1('0x4c')][_0xdce1('0x63')]({'where':{'id':_0x7bdec4[_0xdce1('0x5e')]['id']}})[_0xdce1('0x19')](handleEntityNotFound(_0xa4263c,null))[_0xdce1('0x19')](saveUpdates(_0x7bdec4['body'],null))[_0xdce1('0x19')](respondWithResult(_0xa4263c,null))[_0xdce1('0x23')](handleError(_0xa4263c,null));};exports[_0xdce1('0x82')]=function(_0x8d1477,_0x35c4e8){_0x8d1477[_0xdce1('0x65')][_0xdce1('0x83')]=_0x8d1477[_0xdce1('0x7f')][_0xdce1('0x80')];return db[_0xdce1('0x4c')][_0xdce1('0x63')]({'where':{'id':_0x8d1477['params']['id']}})[_0xdce1('0x19')](handleEntityNotFound(_0x35c4e8,null))[_0xdce1('0x19')](saveUpdates(_0x8d1477[_0xdce1('0x65')],null))[_0xdce1('0x19')](respondWithResult(_0x35c4e8,null))[_0xdce1('0x23')](handleError(_0x35c4e8,null));};exports['addSystemAvatar']=function(_0x317e41,_0x86384e){_0x317e41['body'][_0xdce1('0x84')]=_0x317e41[_0xdce1('0x7f')][_0xdce1('0x80')];return db['ChatWebsite'][_0xdce1('0x63')]({'where':{'id':_0x317e41[_0xdce1('0x5e')]['id']}})[_0xdce1('0x19')](handleEntityNotFound(_0x86384e,null))[_0xdce1('0x19')](saveUpdates(_0x317e41[_0xdce1('0x65')],null))[_0xdce1('0x19')](respondWithResult(_0x86384e,null))[_0xdce1('0x23')](handleError(_0x86384e,null));};exports[_0xdce1('0x85')]=function(_0x117be8,_0x3ff40b){var _0x43e22d=path[_0xdce1('0x86')](config[_0xdce1('0x87')],_0xdce1('0x88'));var _0x1a7c53={'where':{'id':_0x117be8[_0xdce1('0x5e')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x50559d=![];return require('../../config/license/util')['getLicense']()[_0xdce1('0x19')](function(_0x385081){if(_0x385081){_0x50559d=_0x385081[_0xdce1('0x89')];}})[_0xdce1('0x19')](function(){return db['ChatWebsite']['find'](_0x1a7c53);})['then'](handleEntityNotFound(_0x3ff40b,null))[_0xdce1('0x19')](function(_0x1876c2){if(_0x1876c2){if(!_['isNil'](_0x1876c2[_0xdce1('0x7e')])){if(fs[_0xdce1('0x8a')](path[_0xdce1('0x86')](config[_0xdce1('0x87')],_0xdce1('0x8b'),_0x1876c2[_0xdce1('0x7e')]))&&_0x50559d){_0x43e22d=path[_0xdce1('0x86')](config[_0xdce1('0x87')],_0xdce1('0x8b'),_0x1876c2[_0xdce1('0x7e')]);}}return _0x3ff40b[_0xdce1('0x8c')](_0x43e22d);}})[_0xdce1('0x23')](handleError(_0x3ff40b,null));};exports[_0xdce1('0x8d')]=function(_0x167305,_0x3a1b36){var _0x3996e7=path[_0xdce1('0x86')](config[_0xdce1('0x87')],_0xdce1('0x8e'));var _0x3be7bf={'where':{'id':_0x167305['params']['id']},'attributes':['id',_0xdce1('0x81')],'raw':!![]};return db[_0xdce1('0x4c')][_0xdce1('0x63')](_0x3be7bf)[_0xdce1('0x19')](handleEntityNotFound(_0x3a1b36,null))['then'](function(_0x454c15){if(_0x454c15){if(!_[_0xdce1('0x8f')](_0x454c15[_0xdce1('0x81')])){if(fs['existsSync'](path[_0xdce1('0x86')](config[_0xdce1('0x87')],'server/files/images/avatars/',_0x454c15[_0xdce1('0x81')]))){_0x3996e7=path[_0xdce1('0x86')](config['root'],_0xdce1('0x90'),_0x454c15[_0xdce1('0x81')]);}}return _0x3a1b36[_0xdce1('0x8c')](_0x3996e7);}})[_0xdce1('0x23')](handleError(_0x3a1b36,null));};exports[_0xdce1('0x91')]=function(_0x138dde,_0x541ac1){var _0x21691b=path[_0xdce1('0x86')](config[_0xdce1('0x87')],'server/files/images/avatars/customer_avatar.png');var _0x9f4502={'where':{'id':_0x138dde[_0xdce1('0x5e')]['id']},'attributes':['id',_0xdce1('0x83'),_0xdce1('0x92')],'raw':!![]};return db['ChatWebsite'][_0xdce1('0x63')](_0x9f4502)[_0xdce1('0x19')](handleEntityNotFound(_0x541ac1,null))[_0xdce1('0x19')](function(_0xe92ccc){if(_0xe92ccc){if(!_[_0xdce1('0x8f')](_0xe92ccc[_0xdce1('0x83')])){if(fs['existsSync'](path[_0xdce1('0x86')](config['root'],_0xdce1('0x90'),_0xe92ccc['customerAvatar']))&&_0xe92ccc[_0xdce1('0x92')]){_0x21691b=path[_0xdce1('0x86')](config[_0xdce1('0x87')],_0xdce1('0x90'),_0xe92ccc['customerAvatar']);}}return _0x541ac1[_0xdce1('0x8c')](_0x21691b);}})[_0xdce1('0x23')](handleError(_0x541ac1,null));};exports[_0xdce1('0x93')]=function(_0xb65373,_0x371dab){var _0x344df8=path[_0xdce1('0x86')](config[_0xdce1('0x87')],_0xdce1('0x94'));var _0x4ff671={'where':{'id':_0xb65373[_0xdce1('0x5e')]['id']},'attributes':['id',_0xdce1('0x84')],'raw':!![]};return db[_0xdce1('0x4c')]['find'](_0x4ff671)[_0xdce1('0x19')](handleEntityNotFound(_0x371dab,null))[_0xdce1('0x19')](function(_0x3f3f82){if(_0x3f3f82){if(!_[_0xdce1('0x8f')](_0x3f3f82[_0xdce1('0x84')])){if(fs['existsSync'](path['join'](config[_0xdce1('0x87')],'server/files/images/avatars/',_0x3f3f82['systemAvatar']))){_0x344df8=path[_0xdce1('0x86')](config[_0xdce1('0x87')],_0xdce1('0x90'),_0x3f3f82['systemAvatar']);}}return _0x371dab[_0xdce1('0x8c')](_0x344df8);}})[_0xdce1('0x23')](handleError(_0x371dab,null));};function checkWebsiteInterval(_0x1da68a){var _0x29a074=_0x1da68a['Interval'];if(!_0x29a074){return Promise[_0xdce1('0x95')](_0x1da68a);}var _0x1594a9=_0x1da68a['timezone']||undefined;return _0x29a074[_0xdce1('0x96')](_0x1594a9)['then'](function(_0x4b9c67){if(!_0x4b9c67){throw new APIOutOfIntervalError();}return _0x1da68a;});}exports[_0xdce1('0x97')]=function(_0x4ca9b8,_0x23ca45){var _0x46e860={'body':_0x4ca9b8['body'],'channel':_0xdce1('0x98')};var _0x8236e9=[];var _0x42840a=[];var _0x43fb3d={};var _0x15e366=![];if(_0x4ca9b8[_0xdce1('0x65')]['id']){delete _0x4ca9b8['body']['id'];}if(_[_0xdce1('0x8f')](_0x4ca9b8['body'][_0xdce1('0x99')])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_['isNil'](_0x4ca9b8[_0xdce1('0x65')][_0xdce1('0x9a')])){throw new APIBadRequestError(_0xdce1('0x9b'));}if(_[_0xdce1('0x9c')](_0x4ca9b8[_0xdce1('0x65')][_0xdce1('0x65')])){throw new APIBadRequestError(_0xdce1('0x9d'));}var _0xb6437e=_0x4ca9b8['body'][_0xdce1('0x38')]&&_0x4ca9b8[_0xdce1('0x65')][_0xdce1('0x3e')];return db[_0xdce1('0x9e')][_0xdce1('0x71')]()[_0xdce1('0x19')](function(_0xb748e0){if(!_0xb748e0){throw new Error(_0xdce1('0x9f'));}_0x8236e9=Object[_0xdce1('0x51')](_0xb748e0)[_0xdce1('0x59')](function(_0x4b6daf){return![_0xdce1('0xa0'),_0xdce1('0xa1')][_0xdce1('0xa2')](_0x4b6daf);});_0x42840a=Object[_0xdce1('0x51')](_0xb748e0)[_0xdce1('0x59')](function(_0x3b2817){return![_0xdce1('0xa0'),'updatedAt',_0xdce1('0xa3'),_0xdce1('0xa4')]['includes'](_0x3b2817);});if(!_[_0xdce1('0xa2')](_0x42840a,_0x4ca9b8[_0xdce1('0x65')][_0xdce1('0x9a')])){throw new APIBadRequestError(_0xdce1('0xa5')+_0x42840a[_0xdce1('0x86')](',\x20'));}_0x43fb3d[_0x4ca9b8[_0xdce1('0x65')][_0xdce1('0x9a')]]=_0x4ca9b8[_0xdce1('0x65')][_0xdce1('0x99')];})[_0xdce1('0x19')](function(){return db[_0xdce1('0x4c')][_0xdce1('0x63')]({'where':{'id':_0x4ca9b8[_0xdce1('0x5e')]['id']},'include':[{'model':db['CmList'],'as':_0xdce1('0xa6'),'include':[{'model':db[_0xdce1('0x9e')],'as':_0xdce1('0xa7'),'where':_0x43fb3d,'limit':0x1,'order':[[_0xdce1('0xa1'),'DESC']]}]},{'model':db[_0xdce1('0xa8')],'as':_0xdce1('0xa9')},{'model':db[_0xdce1('0xaa')],'as':_0xdce1('0xaa'),'include':[{'model':db[_0xdce1('0xaa')],'as':_0xdce1('0xab'),'attributes':['id',_0xdce1('0xac')],'raw':!![]}]}]});})[_0xdce1('0x19')](function(_0x4b120c){if(!_0x4b120c){throw new APINotFoundError(util[_0xdce1('0x42')](_0xdce1('0xad'),_0x4ca9b8[_0xdce1('0x5e')]['id']));}if(_0xb6437e){return checkWebsiteInterval(_0x4b120c);}return _0x4b120c;})['then'](function(_0xebcc5f){_0x46e860[_0xdce1('0xae')]=_0xebcc5f;_0x46e860[_0xdce1('0xaf')]=_[_0xdce1('0xb0')](_0xebcc5f[_0xdce1('0xa9')],[_0xdce1('0xb1')],[_0xdce1('0xb2')]);if(_0x46e860[_0xdce1('0xae')][_0xdce1('0xa9')]){delete _0x46e860[_0xdce1('0xae')][_0xdce1('0xa9')];}_0x46e860[_0xdce1('0xb3')]=_0xebcc5f[_0xdce1('0xa6')]||{'id':_0xebcc5f[_0xdce1('0xa4')]};if(_0x46e860[_0xdce1('0xb3')]&&_0x46e860['list']['Contacts']['length']){return _0x46e860['list'][_0xdce1('0xa7')][0x0];}var _0x1de560=_['defaults'](_0x4ca9b8[_0xdce1('0x65')],{'firstName':_0x4ca9b8[_0xdce1('0x65')][_0xdce1('0x99')],'ListId':_0xebcc5f[_0xdce1('0xa4')]});_0x1de560[_0x4ca9b8[_0xdce1('0x65')][_0xdce1('0x9a')]]=_0x4ca9b8[_0xdce1('0x65')][_0xdce1('0x99')];return db[_0xdce1('0x9e')][_0xdce1('0x64')](_0x1de560,{'fields':_0x8236e9,'raw':!![]});})['then'](function(_0x1d1624){_0x46e860['contact']=_0x1d1624;var _0x20e051=createInteractionObject(_0x4ca9b8[_0xdce1('0x5e')]['id'],_0x4ca9b8[_0xdce1('0x65')],_0x4ca9b8['headers'],_0x1d1624);var _0x51ac1f={'ChatWebsiteId':_0x4ca9b8[_0xdce1('0x5e')]['id']};if(_0x4ca9b8['body'][_0xdce1('0xb4')]){_0x51ac1f[_0xdce1('0xb4')]=_0x4ca9b8[_0xdce1('0x65')][_0xdce1('0xb4')];_0x51ac1f[_0xdce1('0xb5')]=![];return db[_0xdce1('0xb6')][_0xdce1('0x63')]({'where':_0x51ac1f})[_0xdce1('0x19')](function(_0x14c821){var _0x2825df=_0x4ca9b8[_0xdce1('0x65')]['customerIp']&&_0x4ca9b8['body'][_0xdce1('0x3e')];if(_0x14c821){_0x15e366=!![];return _0x14c821;}else if(!_0x2825df&&_0x14c821&&_0x14c821[_0xdce1('0xb5')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x20e051[_0xdce1('0xb4')]=_0x4ca9b8['body'][_0xdce1('0xb4')];_0x20e051[_0xdce1('0xb7')]=_0x4ca9b8['body'][_0xdce1('0xb7')];return db['ChatInteraction'][_0xdce1('0x64')](_0x20e051);});}_0x51ac1f[_0xdce1('0xb8')]=_0x1d1624['id'];if(_0x4ca9b8[_0xdce1('0x65')]['interaction']&&_0x4ca9b8[_0xdce1('0x65')]['interaction']['id']){_0x51ac1f['id']=_0x4ca9b8[_0xdce1('0x65')][_0xdce1('0xb9')]['id'];return db[_0xdce1('0xb6')][_0xdce1('0x63')]({'where':_0x51ac1f})[_0xdce1('0x19')](function(_0x1847be){var _0x4c0ce2=_0x4ca9b8[_0xdce1('0x65')]['customerIp']&&_0x4ca9b8[_0xdce1('0x65')][_0xdce1('0x3e')];if(!_0x4c0ce2&&_0x1847be&&_0x1847be['closed']){throw new APIConflictError(_0xdce1('0xba'));}else if(_0x1847be){_0x15e366=!![];return _0x1847be;}else{return db[_0xdce1('0xb6')]['create'](_0x20e051);}});}return db[_0xdce1('0xb6')][_0xdce1('0x64')](_0x20e051);})[_0xdce1('0x19')](function(_0x17b704){if(!_0x15e366){return _0x17b704;}var _0x578b78={'from':(_0x46e860[_0xdce1('0xbb')][_0xdce1('0x3b')]||'')+'\x20'+(_0x46e860[_0xdce1('0xbb')][_0xdce1('0x3c')]||'')};if(_0x4ca9b8[_0xdce1('0x65')][_0xdce1('0xb4')]&&_0x4ca9b8[_0xdce1('0x65')][_0xdce1('0xbc')]&&_0x4ca9b8[_0xdce1('0x65')]['threadId']!=_0x4ca9b8[_0xdce1('0x65')][_0xdce1('0xbc')]){_0x578b78[_0xdce1('0xb4')]=_0x4ca9b8['body'][_0xdce1('0xbc')];}return _0x17b704['update'](_0x578b78);})[_0xdce1('0x19')](function(_0x354319){_0x46e860[_0xdce1('0xb9')]=_0x354319[_0xdce1('0x30')]({'plain':!![]});_0x46e860[_0xdce1('0xb9')][_0xdce1('0xbd')]=!_0x15e366;if(_0x46e860[_0xdce1('0xb9')][_0xdce1('0xbd')]){if(_0x46e860[_0xdce1('0xae')][_0xdce1('0xbe')]){_0x46e860['applications'][_0xdce1('0xbf')]({'id':0x0,'priority':_0x46e860['applications'][_0xdce1('0x54')]+0x1,'app':'close','appdata':_0xdce1('0xc0'),'interval':_0xdce1('0xc1')});}}return db[_0xdce1('0xc2')]['create']({'body':_0x4ca9b8[_0xdce1('0x65')]['body'],'ChatWebsiteId':_0x4ca9b8['params']['id'],'ChatInteractionId':_0x354319['id'],'direction':'in','ContactId':_0x46e860['contact']['id'],'AttachmentId':_0x4ca9b8[_0xdce1('0x65')][_0xdce1('0xc3')]});})[_0xdce1('0x19')](function(_0x1bdf50){_0x46e860[_0xdce1('0x21')]=_0x1bdf50;if(!_0x46e860[_0xdce1('0xb9')][_0xdce1('0xc4')]){return;}return db[_0xdce1('0xc5')][_0xdce1('0x63')]({'attributes':['id',_0xdce1('0x3f')],'where':{'id':_0x46e860[_0xdce1('0xb9')][_0xdce1('0xc4')]}});})['then'](function(_0x24f641){if(_0x24f641){_0x46e860[_0xdce1('0xaf')][_0xdce1('0xc6')]({'id':0x0,'priority':0x0,'app':_0xdce1('0xc7'),'appdata':_0x24f641[_0xdce1('0x3f')]+','+(_0x46e860[_0xdce1('0xae')]['waitForTheAssignedAgent']||0xa),'interval':_0xdce1('0xc1')});_0x46e860[_0xdce1('0xc8')]=!![];}if(!_0x46e860[_0xdce1('0xb9')][_0xdce1('0xc9')]){return;}return db[_0xdce1('0xca')][_0xdce1('0x63')]({'attributes':['id',_0xdce1('0x3f')],'where':{'id':_0x46e860[_0xdce1('0xb9')][_0xdce1('0xc9')]}});})[_0xdce1('0x19')](function(_0x16e5ed){if(_0x16e5ed){_0x46e860['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0xdce1('0xcb'),'appdata':_0x16e5ed[_0xdce1('0x3f')]+','+(_0x46e860[_0xdce1('0xae')][_0xdce1('0xcc')]||0x12c),'interval':_0xdce1('0xc1')});}return respondWithRpcPromise(_0xdce1('0xcd'),_0xdce1('0xce'),_0x46e860);})['then'](function(_0x235171){respondWithRpcPromise('EventManager','EventManager',{'event':_0xdce1('0x97'),'message':_0x235171},client9002);return _0x235171;})[_0xdce1('0x19')](respondWithResult(_0x23ca45,null))['catch'](APIHandleError(_0x23ca45));};exports[_0xdce1('0xcf')]=function(_0x52069e,_0x4dac8c){var _0x1bdcc2,_0x1a5585,_0x4b73ae;var _0x405fb1=[];var _0x48cc02={};var _0x2a707c=_0x52069e['files']||[];var _0x357add=[];var _0x23ea53;return db[_0xdce1('0x9e')][_0xdce1('0x71')]()[_0xdce1('0x19')](function(_0x12d87a){if(!_0x12d87a){throw new db[(_0xdce1('0xd0'))][(_0xdce1('0xd1'))](_0xdce1('0xd2'));}_0x405fb1=_[_0xdce1('0xd3')](_[_0xdce1('0x51')](_0x12d87a),['createdAt',_0xdce1('0xa1'),'CompanyId','ListId']);if(_0x52069e[_0xdce1('0x65')]['id']){delete _0x52069e['body']['id'];}if(_[_0xdce1('0x8f')](_0x52069e[_0xdce1('0x65')][_0xdce1('0x99')])){throw _0x4dac8c['status'](0x1f4)[_0xdce1('0x34')](new db[(_0xdce1('0xd0'))][(_0xdce1('0xd1'))](_0xdce1('0xd4')));}if(_['isNil'](_0x52069e[_0xdce1('0x65')][_0xdce1('0x65')])||_0x52069e['body']['body']===''){throw _0x4dac8c[_0xdce1('0x25')](0x1f4)[_0xdce1('0x34')](new db[(_0xdce1('0xd0'))][(_0xdce1('0xd1'))](_0xdce1('0xd5')));}if(_[_0xdce1('0x8f')](_0x52069e[_0xdce1('0x65')][_0xdce1('0xd6')])){throw _0x4dac8c[_0xdce1('0x25')](0x1f4)[_0xdce1('0x34')](new db[(_0xdce1('0xd0'))]['ValidationError'](_0xdce1('0xd7')+_0x405fb1));}if(!_[_0xdce1('0xa2')](_0x405fb1,_0x52069e[_0xdce1('0x65')]['mapKeyOffline'])){throw _0x4dac8c[_0xdce1('0x25')](0x1f4)[_0xdce1('0x34')](new db[(_0xdce1('0xd0'))][(_0xdce1('0xd1'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x405fb1));}_0x48cc02[_0x52069e[_0xdce1('0x65')][_0xdce1('0xd6')]]=_0x52069e['body'][_0xdce1('0x99')];})[_0xdce1('0x19')](function(){return db[_0xdce1('0x4c')][_0xdce1('0x63')]({'where':{'id':_0x52069e[_0xdce1('0x5e')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0xdce1('0xd8')],'as':_0xdce1('0xd8')}]});})[_0xdce1('0x19')](handleEntityNotFound(_0x4dac8c,null))['then'](function(_0x30bf7b){if(_0x30bf7b&&_0x30bf7b[_0xdce1('0xa6')]){_0x1a5585=_0x30bf7b;var _0x47c373=_[_0xdce1('0x11')](_0x52069e[_0xdce1('0x65')],{'firstName':_0x52069e[_0xdce1('0x65')][_0xdce1('0x99')],'phone':_0x52069e[_0xdce1('0x65')][_0xdce1('0x99')],'ListId':_0x30bf7b[_0xdce1('0xa4')]});_0x47c373[_0x52069e[_0xdce1('0x65')]['mapKeyOffline']]=_0x52069e[_0xdce1('0x65')][_0xdce1('0x99')];return db[_0xdce1('0x9e')]['findOrCreate']({'where':_0x48cc02,'defaults':_0x47c373});}})[_0xdce1('0xd9')](function(_0x26f655){if(_0x26f655){_0x4b73ae=_0x26f655;var _0x35708b=fs[_0xdce1('0xda')](path[_0xdce1('0x86')](config[_0xdce1('0x87')],'server/files/templates/chatOfflineMessage.ejs'),_0xdce1('0xdb'));var _0x2aa2ee=ejs[_0xdce1('0xdc')](_0x35708b,{'body':_[_0xdce1('0xdd')](_0x52069e['body']['body']),'bodyTitle':_0x1a5585[_0xdce1('0xde')]});return db[_0xdce1('0xdf')][_0xdce1('0x64')]({'body':_0x2aa2ee,'plainBody':htmlToText[_0xdce1('0xe0')](_0x2aa2ee),'ContactId':_0x26f655['id'],'ChatWebsiteId':_0x1a5585['id']});}})[_0xdce1('0x19')](function(_0x4770bb){_0x23ea53=_0x4770bb;if(_0x2a707c[_0xdce1('0x54')]){var _0x3a821a=_0x2a707c[_0xdce1('0x4b')](function(_0x10b6ab){return{'name':_0x10b6ab[_0xdce1('0xe1')],'basename':_0x10b6ab[_0xdce1('0x80')],'type':_0x10b6ab['mimetype'],'ChatOfflineMessageId':_0x4770bb['id']};});_0x357add=_0x3a821a[_0xdce1('0x4b')](_0x5b9532=>{var _0x3f0dd0={'filename':_0x5b9532['name'],'path':path[_0xdce1('0x86')](config['root'],_0xdce1('0xe2'),_0xdce1('0xe3'),_0xdce1('0xe4'),_0xdce1('0xe5'),_0x5b9532[_0xdce1('0xe6')])};return _0x3f0dd0;});if(!_0x1a5585['openNewInteraction']){return db[_0xdce1('0xe7')][_0xdce1('0xe8')](function(_0x1512f6){return db[_0xdce1('0xe9')][_0xdce1('0xea')](_0x3a821a,{'transaction':_0x1512f6});});}}})['then'](function(){if(_0x23ea53){_0x1bdcc2=_0x23ea53;return db['MailAccount'][_0xdce1('0x7b')]({'where':{'service':!![]},'include':[{'model':db[_0xdce1('0xeb')],'as':_0xdce1('0xec'),'raw':!![],'include':[{'model':db[_0xdce1('0xed')],'as':_0xdce1('0xed'),'raw':!![]}]}]});}})[_0xdce1('0x19')](function(_0x641ef1){if(_0x641ef1&&_0x641ef1[_0xdce1('0xec')]&&_0x1a5585['forwardOffline']&&_0x1a5585[_0xdce1('0xee')]){var _0x51d132=_0x641ef1['getSmtpOptions']();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x51d132,'message':{'from':util['format'](_0xdce1('0xef'),_0x641ef1[_0xdce1('0x3f')],_0x641ef1[_0xdce1('0xf0')]||_0x641ef1[_0xdce1('0xec')]['user']),'to':_0x1a5585[_0xdce1('0xee')],'subject':_0x1a5585[_0xdce1('0xf1')],'html':_0x1bdcc2[_0xdce1('0x65')],'attachments':_0x357add}},client9003)[_0xdce1('0x19')](function(){return _0x1bdcc2;})[_0xdce1('0x23')](function(_0x614e58){logger[_0xdce1('0x20')](_0x614e58);});}})[_0xdce1('0x19')](function(){if(_0x1a5585&&_0x1a5585['openNewInteraction']&&_0x1a5585[_0xdce1('0xf2')]){var _0x5101e2=[];if(_0x2a707c[_0xdce1('0x54')]){_0x5101e2=_0x2a707c[_0xdce1('0x4b')](function(_0x543ccc){return{'name':_0x543ccc[_0xdce1('0xe1')],'basename':_0x543ccc['filename'],'type':_0x543ccc[_0xdce1('0xf3')],'ChatOfflineMessageId':_0x23ea53['id']};});}var _0x5f534d;if(!_['isNil'](_0x1a5585[_0xdce1('0xf4')])){var _0x5d13ed=_['map'](_0x52069e[_0xdce1('0x65')],function(_0x7a2b1f){return _0x7a2b1f;});var _0x214837=_[_0xdce1('0xf5')](_0x5d13ed)[0x0];var _0x3404a1=_[_0xdce1('0xf6')](_0x214837,function(_0x1be673){return _0x1be673;});_0x5f534d=_0x3404a1[0x1][_0x1a5585[_0xdce1('0xf4')]];}var _0x426a09={'from':_0x4b73ae[_0xdce1('0xf0')],'firstName':_0x4b73ae[_0xdce1('0x3b')],'lastName':_0x4b73ae[_0xdce1('0x3c')],'mapKey':'email','message':{'from':_0x4b73ae['email'],'to':_0x1a5585[_0xdce1('0xd8')][_0xdce1('0xf0')],'cc':'','subject':_[_0xdce1('0x8f')](_0x5f534d)?_0x1a5585[_0xdce1('0xf1')]:_0x5f534d,'messageId':'','sentAt':new Date(),'attach':_0x5101e2[_0xdce1('0x54')],'attachments':_0x5101e2,'originChannel':'Chat','ChatWebsiteId':_0x1a5585['id'],'ChatOfflineMessageId':_0x1bdcc2['id'],'originTo':_0x1a5585[_0xdce1('0xd8')]['email']},'body':_0x1bdcc2['body']};var _0x70856e={'account':{'id':_0x1a5585[_0xdce1('0xf2')]},'body':_0x426a09,'log':_0xdce1('0xf7')};return respondWithRpcPromise(_0xdce1('0xf7'),_0xdce1('0xf8'),_0x70856e,client9001)['then'](function(){return _0x1bdcc2;})['catch'](function(_0x213387){logger[_0xdce1('0x20')](_0x213387);});}return;})[_0xdce1('0x19')](function(){if(_0x1bdcc2){return _0x1bdcc2;}})[_0xdce1('0x19')](respondWithResult(_0x4dac8c,null))[_0xdce1('0x23')](function(){for(var _0x3148c3 of _0x2a707c){var _0x173ba0=path[_0xdce1('0x86')](config[_0xdce1('0x87')],_0xdce1('0xe2'),'files','attachments',_0xdce1('0xe5'),_0x3148c3[_0xdce1('0x80')]);fs_extra[_0xdce1('0xf9')](_0x173ba0)[_0xdce1('0x23')](function(_0x316c64){logger[_0xdce1('0x20')]('Could\x20not\x20remove\x20attachment\x20file',_0x173ba0,_0x316c64);});}});};exports[_0xdce1('0xfa')]=function(_0x1f4381,_0x4dfa8a){return db[_0xdce1('0xb6')]['find']({'where':{'id':_0x1f4381[_0xdce1('0x5e')]['id']}})[_0xdce1('0x19')](handleEntityNotFound(_0x4dfa8a,null))[_0xdce1('0x19')](function(_0x1ec092){if(_0x1ec092){return _0x1ec092[_0xdce1('0xfa')](_0x1f4381[_0xdce1('0x65')]['ids'],_[_0xdce1('0xfb')](_0x1f4381[_0xdce1('0x65')],[_0xdce1('0x78'),'id'])||{});}})[_0xdce1('0x19')](respondWithResult(_0x4dfa8a,null))[_0xdce1('0x23')](handleError(_0x4dfa8a,null));};exports[_0xdce1('0xfc')]=function(_0x21002d,_0x316bfd){var _0x170175={'raw':![],'where':{}};var _0x57d96c={};var _0x4bc975={'count':0x0,'rows':[]};return db[_0xdce1('0x4c')][_0xdce1('0x7b')]({'where':{'id':_0x21002d[_0xdce1('0x5e')]['id']}})[_0xdce1('0x19')](handleEntityNotFound(_0x316bfd,null))[_0xdce1('0x19')](function(_0x47f330){if(_0x47f330){_0x57d96c[_0xdce1('0x46')]=_[_0xdce1('0x51')](db[_0xdce1('0xb6')][_0xdce1('0x4d')]);_0x57d96c['query']=_[_0xdce1('0x51')](_0x21002d['query']);_0x57d96c['filters']=_['intersection'](_0x57d96c[_0xdce1('0x46')],_0x57d96c[_0xdce1('0x50')]);_0x170175[_0xdce1('0x52')]=_[_0xdce1('0x60')](_0x57d96c[_0xdce1('0x46')],qs[_0xdce1('0x53')](_0x21002d[_0xdce1('0x50')]['fields']));_0x170175[_0xdce1('0x52')]=_0x170175[_0xdce1('0x52')][_0xdce1('0x54')]?_0x170175[_0xdce1('0x52')]:_0x57d96c[_0xdce1('0x46')];if(!_0x21002d[_0xdce1('0x50')]['hasOwnProperty'](_0xdce1('0x74'))){_0x170175[_0xdce1('0x2b')]=qs[_0xdce1('0x2b')](_0x21002d[_0xdce1('0x50')][_0xdce1('0x2b')]);_0x170175['offset']=qs['offset'](_0x21002d[_0xdce1('0x50')][_0xdce1('0x28')]);}_0x170175[_0xdce1('0x75')]=qs[_0xdce1('0x55')](_0x21002d[_0xdce1('0x50')][_0xdce1('0x55')]);_0x170175[_0xdce1('0x56')]=qs[_0xdce1('0x57')](_[_0xdce1('0x58')](_0x21002d[_0xdce1('0x50')],_0x57d96c[_0xdce1('0x57')]));_0x170175['where'][_0xdce1('0x79')]=_0x47f330['id'];if(_0x21002d[_0xdce1('0x50')][_0xdce1('0x59')]){_0x170175[_0xdce1('0x56')]=_[_0xdce1('0x5a')](_0x170175[_0xdce1('0x56')],{'$or':_[_0xdce1('0x4b')](_0x170175['attributes'],function(_0x431327){var _0x32eecf={};_0x32eecf[_0x431327]={'$like':'%'+_0x21002d['query'][_0xdce1('0x59')]+'%'};return _0x32eecf;})});}_0x170175=_[_0xdce1('0x5a')]({},_0x170175,_0x21002d[_0xdce1('0x5c')]);return db['ChatInteraction'][_0xdce1('0x2a')]({'where':_0x170175['where']})[_0xdce1('0x19')](function(_0x10738b){_0x4bc975[_0xdce1('0x2a')]=_0x10738b;if(_0x21002d[_0xdce1('0x50')][_0xdce1('0x61')]){_0x170175[_0xdce1('0x62')]=[{'model':db[_0xdce1('0x9e')],'as':_0xdce1('0xfd'),'required':![]},{'model':db[_0xdce1('0xc5')],'as':'Owner','attributes':[_0xdce1('0x3f'),_0xdce1('0xfe'),_0xdce1('0xff')],'required':![]},{'model':db[_0xdce1('0x100')],'as':_0xdce1('0x101'),'attributes':['id',_0xdce1('0x3f'),_0xdce1('0x102')],'where':_0x21002d[_0xdce1('0x50')][_0xdce1('0x103')]?{'id':_0x21002d['query'][_0xdce1('0x103')]}:undefined,'required':_0x21002d['query'][_0xdce1('0x103')]?!![]:![]}];}return db['ChatInteraction'][_0xdce1('0x76')](_0x170175);})[_0xdce1('0x19')](function(_0x195637){_0x4bc975[_0xdce1('0x5d')]=_0x195637;return _0x4bc975;});}})[_0xdce1('0x19')](respondWithFilteredResult(_0x316bfd,_0x170175))[_0xdce1('0x23')](handleError(_0x316bfd,null));};exports[_0xdce1('0x104')]=function(_0x3dc681,_0xcfbe32){var _0x49c44e=0x0;var _0x4e54ba=0x0;var _0x53828a=![];var _0x5a2928;var _0x1186d6;return db[_0xdce1('0x4c')]['find']({'where':{'id':_0x3dc681[_0xdce1('0x5e')]['id']},'include':[{'model':db[_0xdce1('0xaa')],'as':_0xdce1('0xaa'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xdce1('0xac')]}]}]})[_0xdce1('0x19')](handleEntityNotFound(_0xcfbe32,null))[_0xdce1('0x19')](function(_0x1028f6){if(_0x1028f6){_0x5a2928=_0x1028f6;return _0x1028f6[_0xdce1('0x105')]({'raw':!![]});}})[_0xdce1('0x19')](function(_0x1fe22a){if(_0x5a2928){if(_0x1fe22a){_0x1186d6=_0x1fe22a;}}return require(_0xdce1('0x106'))[_0xdce1('0x107')]();})[_0xdce1('0x19')](function(_0x3bf5c0){if(_0x3bf5c0){_0x4e54ba=_0x3bf5c0['virtual'];_0x53828a=_0x3bf5c0[_0xdce1('0x89')];}})[_0xdce1('0x19')](function(){return db[_0xdce1('0xb6')][_0xdce1('0x2a')]({'where':{'closed':![]}});})[_0xdce1('0x19')](function(_0x2dfaf4){_0x49c44e=_0x2dfaf4;if(_0x4e54ba&&_0x2dfaf4>_0x4e54ba){return db['License'][_0xdce1('0x7b')]({'where':{'id':0x1}})['then'](function(_0x5c64c4){if(_0x5c64c4){_0x5c64c4[_0xdce1('0x108')](_0xdce1('0x109'));}});}})[_0xdce1('0x19')](function(){var _0x4e4b57=_0x5a2928[_0xdce1('0xaa')];var _0x5cfa24=_0x5a2928[_0xdce1('0x10a')]||undefined;return _0x4e4b57?_0x4e4b57[_0xdce1('0x96')](_0x5cfa24):!![];})['then'](function(_0x449fb2){var _0x508e76=fs[_0xdce1('0xda')](path[_0xdce1('0x86')](config['root'],_0xdce1('0x10b')),_0xdce1('0xdb'));var _0x3e57bf=_0xdce1('0x10c');var _0x324136=![];var _0x539f40,_0x4b98e3;if(_0x3dc681[_0xdce1('0x10d')][_0xdce1('0x3e')]){_0x539f40=new URL(_0x3dc681[_0xdce1('0x10d')][_0xdce1('0x3e')])[_0xdce1('0x10e')];}else if(_0x3dc681[_0xdce1('0x10d')][_0xdce1('0x10e')]){_0x539f40=new URL(_0x3dc681[_0xdce1('0x10d')][_0xdce1('0x10e')])['origin'];}else{_0x539f40=_0xdce1('0x10f');}_0x4b98e3=typeof _0x5a2928[_0xdce1('0x66')][_0xdce1('0x67')](',')[_0xdce1('0x63')](function(_0x105db8){return wildcardUtils[_0xdce1('0x110')](_0x105db8,_0x539f40);})!=='undefined';var _0x1a455a={'chatVersion':_0x3e57bf,'chatWebsiteAddressOrigin':_0x4b98e3?_0x539f40:_0x5a2928[_0xdce1('0x66')],'remote':_0x5a2928['remote'],'query':querystring[_0xdce1('0x1e')](_[_0xdce1('0x5a')](_0x5a2928[_0xdce1('0x30')]({'plain':!![]}),{'customerIp':_0x3dc681[_0xdce1('0x10d')][_0xdce1('0x3a')]||_0x3dc681['headers'][_0xdce1('0x111')]||_0x3dc681[_0xdce1('0x112')]['remoteAddress']||_0x3dc681['ip'],'referer':_0x3dc681['headers'][_0xdce1('0x3e')],'openedInteractions':_0x49c44e,'maxInteractions':_0x4e54ba,'virtual':_0x53828a[_0xdce1('0x113')],'online':_0x449fb2,'custom':_0x53828a,'address':_0x4b98e3?_0x539f40:null}))[_0xdce1('0x114')](/'/g,'\x5c\x27')};_0xcfbe32['send'](ejs[_0xdce1('0xdc')](Mustache[_0xdce1('0xdc')](_0x508e76,_0x1a455a),{'proactiveActions':_0x1186d6,'alignment':_0x5a2928[_0xdce1('0x115')],'verticalAlignment':_0x5a2928[_0xdce1('0x116')],'div_color':_0x5a2928[_0xdce1('0x102')],'labelText':_0x5a2928['labelText'],'text_color':_0x5a2928['textColor'],'text_button_color':_0x5a2928['textButtonColor'],'button_color':_0x5a2928[_0xdce1('0x117')],'background_color':_0x5a2928[_0xdce1('0x118')],'hideWhenOffline':_0x5a2928[_0xdce1('0x119')],'intervalId':_0x5a2928[_0xdce1('0x11a')],'isDevelopment':_0x324136,'chatVersion':_0x3e57bf}));})['catch'](handleError(_0xcfbe32,null));};exports['addApplications']=function(_0x5a07a2,_0x1c1896){var _0x17b6df=_0x5a07a2[_0xdce1('0x5e')]['id'];var _0x4682bf=_0x5a07a2[_0xdce1('0x65')];var _0x205167=0xc8;var _0x28c6f6=null;return db['sequelize'][_0xdce1('0xe8')]({'isolationLevel':db[_0xdce1('0xe7')][_0xdce1('0x11b')][_0xdce1('0x11c')][_0xdce1('0x11d')]},function(_0x215870){return db[_0xdce1('0x4c')][_0xdce1('0x7b')]({'where':{'id':_0x17b6df},'transaction':_0x215870})['then'](function(_0x2394ff){if(_0x2394ff){return db[_0xdce1('0xa8')][_0xdce1('0x2f')]({'where':{'ChatWebsiteId':_0x17b6df},'transaction':_0x215870})[_0xdce1('0x19')](function(){var _0x5ca20=_[_0xdce1('0x4b')](_0x4682bf,function(_0x1fabbb){_0x1fabbb[_0xdce1('0x79')]=_0x17b6df;return _0x1fabbb;});return db[_0xdce1('0xa8')]['bulkCreate'](_0x5ca20,{'transaction':_0x215870});});}else{_0x205167=0x194;_0x28c6f6=[];}});})[_0xdce1('0x19')](function(){if(_0x205167!==0x194){return db[_0xdce1('0xa8')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x17b6df},'order':_0xdce1('0xb1')})['then'](function(_0x1673ad){_0x28c6f6=_0x1673ad;});}})[_0xdce1('0x23')](function(_0xd421f0){_0x205167=0x1f4;logger[_0xdce1('0x20')](_0xd421f0['stack']);if(_0xd421f0[_0xdce1('0x3f')]){delete _0xd421f0[_0xdce1('0x3f')];}_0x28c6f6=_0xd421f0;})['finally'](function(){if(_0x28c6f6===null){_0x1c1896['sendStatus'](_0x205167);}else{if(_0x205167===0x1f4){_0x1c1896[_0xdce1('0x25')](_0x205167)[_0xdce1('0x34')](_0x28c6f6);}else{_0x1c1896[_0xdce1('0x25')](_0x205167)['json'](_0x28c6f6);}}});};exports[_0xdce1('0x11e')]=function(_0x2734b7,_0x534d7c){var _0xcd1e1a={};var _0x573b8e={};var _0x2a171f;var _0x4d6db8;return db[_0xdce1('0x4c')][_0xdce1('0x7b')]({'where':{'id':_0x2734b7[_0xdce1('0x5e')]['id']}})[_0xdce1('0x19')](handleEntityNotFound(_0x534d7c,null))['then'](function(_0x375886){if(_0x375886){_0x2a171f=_0x375886;_0x573b8e[_0xdce1('0x46')]=_[_0xdce1('0x51')](db[_0xdce1('0xa8')][_0xdce1('0x4d')]);_0x573b8e[_0xdce1('0x50')]=_['keys'](_0x2734b7['query']);_0x573b8e[_0xdce1('0x57')]=_['intersection'](_0x573b8e[_0xdce1('0x46')],_0x573b8e[_0xdce1('0x50')]);_0xcd1e1a[_0xdce1('0x52')]=_[_0xdce1('0x60')](_0x573b8e['model'],qs[_0xdce1('0x53')](_0x2734b7[_0xdce1('0x50')][_0xdce1('0x53')]));_0xcd1e1a[_0xdce1('0x52')]=_0xcd1e1a[_0xdce1('0x52')]['length']?_0xcd1e1a[_0xdce1('0x52')]:_0x573b8e[_0xdce1('0x46')];_0xcd1e1a['order']=qs[_0xdce1('0x55')](_0x2734b7['query'][_0xdce1('0x55')]);_0xcd1e1a[_0xdce1('0x56')]=qs[_0xdce1('0x57')](_[_0xdce1('0x58')](_0x2734b7[_0xdce1('0x50')],_0x573b8e[_0xdce1('0x57')]));if(_0x2734b7[_0xdce1('0x50')][_0xdce1('0x59')]){_0xcd1e1a[_0xdce1('0x56')]=_[_0xdce1('0x5a')](_0xcd1e1a[_0xdce1('0x56')],{'$or':_[_0xdce1('0x4b')](_0xcd1e1a[_0xdce1('0x52')],function(_0x2e9ae1){var _0x29ed4c={};_0x29ed4c[_0x2e9ae1]={'$like':'%'+_0x2734b7[_0xdce1('0x50')][_0xdce1('0x59')]+'%'};return _0x29ed4c;})});}_0xcd1e1a=_['merge']({},_0xcd1e1a,_0x2734b7['options']);return _0x2a171f[_0xdce1('0x11e')](_0xcd1e1a);}})[_0xdce1('0x19')](function(_0x109827){if(_0x109827){_0x4d6db8=_0x109827[_0xdce1('0x54')];if(!_0x2734b7['query'][_0xdce1('0x73')](_0xdce1('0x74'))){_0xcd1e1a[_0xdce1('0x2b')]=qs[_0xdce1('0x2b')](_0x2734b7[_0xdce1('0x50')][_0xdce1('0x2b')]);_0xcd1e1a[_0xdce1('0x28')]=qs[_0xdce1('0x28')](_0x2734b7[_0xdce1('0x50')][_0xdce1('0x28')]);}return _0x2a171f[_0xdce1('0x11e')](_0xcd1e1a);}})['then'](function(_0x4699a8){if(_0x4699a8){return _0x4699a8?{'count':_0x4d6db8,'rows':_0x4699a8}:null;}})[_0xdce1('0x19')](respondWithResult(_0x534d7c,null))[_0xdce1('0x23')](handleError(_0x534d7c,null));};exports['addProactiveActions']=function(_0x44476a,_0x25848a){return db[_0xdce1('0x11f')][_0xdce1('0x63')]({'where':{'id':_0x44476a[_0xdce1('0x5e')]['id']}})[_0xdce1('0x19')](handleEntityNotFound(_0x25848a,null))[_0xdce1('0x19')](function(_0x58fcd9){if(_0x58fcd9){return _0x58fcd9[_0xdce1('0x120')](_0x44476a[_0xdce1('0x65')][_0xdce1('0x78')],_[_0xdce1('0xfb')](_0x44476a[_0xdce1('0x65')],['ids','id'])||{});}})[_0xdce1('0x19')](respondWithResult(_0x25848a,null))[_0xdce1('0x23')](handleError(_0x25848a,null));};exports[_0xdce1('0x105')]=function(_0x570785,_0x2b1192){var _0x422667={};var _0x52b1d6={};var _0x2c57a1;var _0x4ffb79;return db[_0xdce1('0x4c')][_0xdce1('0x7b')]({'where':{'id':_0x570785['params']['id']}})['then'](handleEntityNotFound(_0x2b1192,null))[_0xdce1('0x19')](function(_0x5ae896){if(_0x5ae896){_0x2c57a1=_0x5ae896;_0x52b1d6[_0xdce1('0x46')]=_[_0xdce1('0x51')](db['ChatProactiveAction']['rawAttributes']);_0x52b1d6[_0xdce1('0x50')]=_[_0xdce1('0x51')](_0x570785[_0xdce1('0x50')]);_0x52b1d6[_0xdce1('0x57')]=_[_0xdce1('0x60')](_0x52b1d6[_0xdce1('0x46')],_0x52b1d6['query']);_0x422667['attributes']=_[_0xdce1('0x60')](_0x52b1d6[_0xdce1('0x46')],qs['fields'](_0x570785['query'][_0xdce1('0x53')]));_0x422667['attributes']=_0x422667[_0xdce1('0x52')][_0xdce1('0x54')]?_0x422667['attributes']:_0x52b1d6[_0xdce1('0x46')];_0x422667[_0xdce1('0x75')]=qs[_0xdce1('0x55')](_0x570785['query'][_0xdce1('0x55')]);_0x422667['where']=qs[_0xdce1('0x57')](_[_0xdce1('0x58')](_0x570785[_0xdce1('0x50')],_0x52b1d6[_0xdce1('0x57')]));if(_0x570785[_0xdce1('0x50')][_0xdce1('0x59')]){_0x422667[_0xdce1('0x56')]=_['merge'](_0x422667[_0xdce1('0x56')],{'$or':_['map'](_0x422667[_0xdce1('0x52')],function(_0x1dc268){var _0x48963b={};_0x48963b[_0x1dc268]={'$like':'%'+_0x570785[_0xdce1('0x50')][_0xdce1('0x59')]+'%'};return _0x48963b;})});}_0x422667=_['merge']({},_0x422667,_0x570785[_0xdce1('0x5c')]);return _0x2c57a1[_0xdce1('0x105')](_0x422667);}})[_0xdce1('0x19')](function(_0x1b8764){if(_0x1b8764){_0x4ffb79=_0x1b8764[_0xdce1('0x54')];if(!_0x570785['query']['hasOwnProperty'](_0xdce1('0x74'))){_0x422667[_0xdce1('0x2b')]=qs['limit'](_0x570785['query'][_0xdce1('0x2b')]);_0x422667['offset']=qs[_0xdce1('0x28')](_0x570785['query'][_0xdce1('0x28')]);}return _0x2c57a1[_0xdce1('0x105')](_0x422667);}})[_0xdce1('0x19')](function(_0x320591){if(_0x320591){return _0x320591?{'count':_0x4ffb79,'rows':_0x320591}:null;}})[_0xdce1('0x19')](respondWithResult(_0x2b1192,null))[_0xdce1('0x23')](handleError(_0x2b1192,null));};exports[_0xdce1('0x121')]=function(_0x24753e,_0x34e0c1){var _0x263a51=_0x24753e['query'][_0xdce1('0x122')]===_0xdce1('0x123')?_0xdce1('0x124'):_0xdce1('0x125');return db[_0xdce1('0x4c')][_0xdce1('0x63')]({'attributes':['id',_0x263a51],'where':{'id':_0x24753e[_0xdce1('0x5e')]['id']}})[_0xdce1('0x19')](handleEntityNotFound(_0x34e0c1,null))['then'](function(_0x42e5b7){if(_0x42e5b7){var _0x5ae4f2=_0x42e5b7[_0x263a51];var _0x40c9eb=_0x5ae4f2&&_0x5ae4f2['items']?_0x5ae4f2['items']:[];_0x34e0c1[_0xdce1('0x34')]({'fromKey':_[_0xdce1('0x8f')](_0x5ae4f2[_0xdce1('0x126')])?undefined:_0x5ae4f2[_0xdce1('0x126')],'count':_0x40c9eb['length'],'rows':_0x40c9eb});}})[_0xdce1('0x23')](handleError(_0x34e0c1,null));};exports[_0xdce1('0x127')]=function(_0x4e3be3,_0xced005){var _0x2750cf={'raw':![],'where':{}};var _0x5843f8={};var _0x2c2c81={'count':0x0,'rows':[]};return db[_0xdce1('0x4c')][_0xdce1('0x7b')]({'where':{'id':_0x4e3be3[_0xdce1('0x5e')]['id']}})[_0xdce1('0x19')](handleEntityNotFound(_0xced005,null))[_0xdce1('0x19')](function(_0x2bfcac){if(_0x2bfcac){_0x5843f8[_0xdce1('0x46')]=_[_0xdce1('0x51')](db[_0xdce1('0xdf')]['rawAttributes']);_0x5843f8['query']=_[_0xdce1('0x51')](_0x4e3be3[_0xdce1('0x50')]);_0x5843f8[_0xdce1('0x57')]=_[_0xdce1('0x60')](_0x5843f8[_0xdce1('0x46')],_0x5843f8[_0xdce1('0x50')]);_0x2750cf[_0xdce1('0x52')]=_['intersection'](_0x5843f8['model'],qs[_0xdce1('0x53')](_0x4e3be3[_0xdce1('0x50')][_0xdce1('0x53')]));_0x2750cf[_0xdce1('0x52')]=_0x2750cf[_0xdce1('0x52')][_0xdce1('0x54')]?_0x2750cf['attributes']:_0x5843f8[_0xdce1('0x46')];if(!_0x4e3be3[_0xdce1('0x50')][_0xdce1('0x73')](_0xdce1('0x74'))){_0x2750cf['limit']=qs[_0xdce1('0x2b')](_0x4e3be3[_0xdce1('0x50')][_0xdce1('0x2b')]);_0x2750cf['offset']=qs['offset'](_0x4e3be3[_0xdce1('0x50')][_0xdce1('0x28')]);}_0x2750cf[_0xdce1('0x75')]=qs[_0xdce1('0x55')](_0x4e3be3[_0xdce1('0x50')][_0xdce1('0x55')]);_0x2750cf['where']=qs[_0xdce1('0x57')](_[_0xdce1('0x58')](_0x4e3be3[_0xdce1('0x50')],_0x5843f8[_0xdce1('0x57')]));_0x2750cf['where'][_0xdce1('0x79')]=_0x2bfcac['id'];if(_0x4e3be3[_0xdce1('0x50')]['filter']){_0x2750cf[_0xdce1('0x56')]=_['merge'](_0x2750cf[_0xdce1('0x56')],{'$or':_[_0xdce1('0x4b')](_0x2750cf['attributes'],function(_0x320d3d){var _0x21fdff={};_0x21fdff[_0x320d3d]={'$like':'%'+_0x4e3be3[_0xdce1('0x50')][_0xdce1('0x59')]+'%'};return _0x21fdff;})});}_0x2750cf=_[_0xdce1('0x5a')]({},_0x2750cf,_0x4e3be3[_0xdce1('0x5c')]);return db['ChatOfflineMessage'][_0xdce1('0x2a')]({'where':_0x2750cf[_0xdce1('0x56')]})[_0xdce1('0x19')](function(_0x5abf39){_0x2c2c81[_0xdce1('0x2a')]=_0x5abf39;if(_0x4e3be3['query'][_0xdce1('0x61')]){_0x2750cf['include']=[{'all':!![]}];}else{_0x2750cf[_0xdce1('0x62')]=[{'model':db[_0xdce1('0x9e')],'as':'Contact','required':![]},{'model':db[_0xdce1('0xe9')],'as':'Attachments','required':![]}];}return db[_0xdce1('0xdf')][_0xdce1('0x76')](_0x2750cf);})['then'](function(_0x224adf){_0x2c2c81[_0xdce1('0x5d')]=_0x224adf;return _0x2c2c81;});}})['then'](respondWithFilteredResult(_0xced005,_0x2750cf))[_0xdce1('0x23')](handleError(_0xced005,null));};exports['addAgents']=function(_0x52f0e5,_0x3bc3b4){return db['ChatWebsite']['find']({'where':{'id':_0x52f0e5[_0xdce1('0x5e')]['id']}})[_0xdce1('0x19')](handleEntityNotFound(_0x3bc3b4,null))['then'](function(_0x565917){if(_0x565917){return _0x565917[_0xdce1('0x128')](_0x52f0e5[_0xdce1('0x65')]['ids'],_[_0xdce1('0xfb')](_0x52f0e5[_0xdce1('0x65')],[_0xdce1('0x78'),'id'])||{})[_0xdce1('0xd9')](function(_0x2ddd52){for(var _0x49fe4a=0x0;_0x49fe4a<_0x52f0e5[_0xdce1('0x65')][_0xdce1('0x78')]['length'];_0x49fe4a+=0x1){socket[_0xdce1('0x129')](_0xdce1('0x12a'),{'UserId':Number(_0x52f0e5['body'][_0xdce1('0x78')][_0x49fe4a]),'ChatWebsiteId':Number(_0x52f0e5[_0xdce1('0x5e')]['id'])});}return _0x2ddd52;});}})['then'](respondWithResult(_0x3bc3b4,null))[_0xdce1('0x23')](handleError(_0x3bc3b4,null));};exports[_0xdce1('0x12b')]=function(_0x2dd3b2,_0x2175ce){return db[_0xdce1('0x4c')][_0xdce1('0x63')]({'where':{'id':_0x2dd3b2[_0xdce1('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2175ce,null))[_0xdce1('0x19')](function(_0x237b91){if(_0x237b91){return _0x237b91['removeAgents'](_0x2dd3b2[_0xdce1('0x50')][_0xdce1('0x78')])['then'](function(){if(_[_0xdce1('0x12c')](_0x2dd3b2[_0xdce1('0x50')][_0xdce1('0x78')])){for(var _0x5b4f2e=0x0;_0x5b4f2e<_0x2dd3b2[_0xdce1('0x50')][_0xdce1('0x78')][_0xdce1('0x54')];_0x5b4f2e+=0x1){socket[_0xdce1('0x129')](_0xdce1('0x12d'),{'UserId':Number(_0x2dd3b2[_0xdce1('0x50')]['ids'][_0x5b4f2e]),'ChatWebsiteId':Number(_0x2dd3b2['params']['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x2dd3b2[_0xdce1('0x50')][_0xdce1('0x78')]),'ChatWebsiteId':Number(_0x2dd3b2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2175ce,null))[_0xdce1('0x23')](handleError(_0x2175ce,null));};exports[_0xdce1('0x12e')]=function(_0x2fb279,_0x48c189){var _0x33aa2f={};var _0x43615c={};var _0xc24998;var _0xd985e1;return db[_0xdce1('0x4c')][_0xdce1('0x7b')]({'where':{'id':_0x2fb279[_0xdce1('0x5e')]['id']}})[_0xdce1('0x19')](handleEntityNotFound(_0x48c189,null))[_0xdce1('0x19')](function(_0x302a40){if(_0x302a40){_0xc24998=_0x302a40;_0x43615c[_0xdce1('0x46')]=_['keys'](db[_0xdce1('0xc5')][_0xdce1('0x4d')]);_0x43615c[_0xdce1('0x50')]=_[_0xdce1('0x51')](_0x2fb279[_0xdce1('0x50')]);_0x43615c['filters']=_['intersection'](_0x43615c['model'],_0x43615c[_0xdce1('0x50')]);_0x33aa2f[_0xdce1('0x52')]=_[_0xdce1('0x60')](_0x43615c['model'],qs[_0xdce1('0x53')](_0x2fb279[_0xdce1('0x50')][_0xdce1('0x53')]));_0x33aa2f['attributes']=_0x33aa2f['attributes']['length']?_0x33aa2f[_0xdce1('0x52')]:_0x43615c[_0xdce1('0x46')];_0x33aa2f[_0xdce1('0x75')]=qs[_0xdce1('0x55')](_0x2fb279[_0xdce1('0x50')][_0xdce1('0x55')]);_0x33aa2f[_0xdce1('0x56')]=qs[_0xdce1('0x57')](_['pick'](_0x2fb279[_0xdce1('0x50')],_0x43615c[_0xdce1('0x57')]));if(_0x2fb279[_0xdce1('0x50')][_0xdce1('0x59')]){_0x33aa2f[_0xdce1('0x56')]=_[_0xdce1('0x5a')](_0x33aa2f['where'],{'$or':_[_0xdce1('0x4b')](_0x33aa2f[_0xdce1('0x52')],function(_0x267323){var _0x3ad1ae={};_0x3ad1ae[_0x267323]={'$like':'%'+_0x2fb279[_0xdce1('0x50')][_0xdce1('0x59')]+'%'};return _0x3ad1ae;})});}_0x33aa2f=_[_0xdce1('0x5a')]({},_0x33aa2f,_0x2fb279[_0xdce1('0x5c')]);return _0xc24998['getAgents'](_0x33aa2f);}})[_0xdce1('0x19')](function(_0x4a76b3){if(_0x4a76b3){_0xd985e1=_0x4a76b3[_0xdce1('0x54')];if(!_0x2fb279[_0xdce1('0x50')]['hasOwnProperty']('nolimit')){_0x33aa2f[_0xdce1('0x2b')]=qs[_0xdce1('0x2b')](_0x2fb279[_0xdce1('0x50')]['limit']);_0x33aa2f[_0xdce1('0x28')]=qs[_0xdce1('0x28')](_0x2fb279[_0xdce1('0x50')][_0xdce1('0x28')]);}return _0xc24998['getAgents'](_0x33aa2f);}})[_0xdce1('0x19')](function(_0x1590e7){if(_0x1590e7){return _0x1590e7?{'count':_0xd985e1,'rows':_0x1590e7}:null;}})[_0xdce1('0x19')](respondWithResult(_0x48c189,null))[_0xdce1('0x23')](handleError(_0x48c189,null));};
\ No newline at end of file
+var _0x88a2=['ChatMessage','AttachmentId','UserId','User','unshift','agent','*,*,*,*','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','notify','ValidationError','no\x20available\x20attributes','difference','send','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','utf8','render','ChatOfflineMessage','originalname','mimetype','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','server','files','attachments','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','tag','getSnippet','getProactiveActions','virtual','License','increment','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','3.12.1','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','color','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','path','ejs','lodash','html-to-text','ioredis','jayson/promise','api','../../config/environment','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','URL','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','user-agent-parser','getResult','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','stringify','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','find','address','forEach','testWildcardValidity','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','filename','addAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','Interval','resolve','timezone','ifTime','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','ListId','List','Contacts','ChatApplication','Intervals','interval','account','applications','orderBy','Applications','priority','asc','list','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','interaction','referer','messageId','created','autoclose','close','unmanaged'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x88a2,0x73));var _0x288a=function(_0xaa0c20,_0x5bde1a){_0xaa0c20=_0xaa0c20-0x0;var _0x58afec=_0x88a2[_0xaa0c20];return _0x58afec;};'use strict';var Mustache=require(_0x288a('0x0'));var util=require('util');var path=require(_0x288a('0x1'));var ejs=require(_0x288a('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x288a('0x3'));var querystring=require('querystring');var htmlToText=require(_0x288a('0x4'));var Redis=require(_0x288a('0x5'));var jayson=require(_0x288a('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x288a('0x7'));var config=require(_0x288a('0x8'));var APIBadRequestError=require(_0x288a('0x9'))['APIBadRequestError'];var APINotFoundError=require(_0x288a('0x9'))[_0x288a('0xa')];var APIOutOfIntervalError=require('../../errors/api')[_0x288a('0xb')];var APIHandleError=require(_0x288a('0x9'))[_0x288a('0xc')];var APIConflictError=require(_0x288a('0x9'))['APIConflictError'];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require('url')[_0x288a('0xd')];var db=require(_0x288a('0xe'))['db'];config[_0x288a('0xf')]=_[_0x288a('0x10')](config['redis'],{'host':_0x288a('0x11'),'port':0x18eb});var socket=require(_0x288a('0x12'))(new Redis(config[_0x288a('0xf')]));require('./chatWebsite.socket')[_0x288a('0x13')](socket);var client=jayson[_0x288a('0x14')][_0x288a('0x15')]({'port':0x232c});var client9002=jayson[_0x288a('0x14')][_0x288a('0x15')]({'port':0x232a});var client9003=jayson[_0x288a('0x14')][_0x288a('0x15')]({'port':0x232b});var client9001=jayson['client'][_0x288a('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x1dc05b,_0x3d2c76,_0x5a734e,_0x3d7dc0){return new Promise(function(_0x394241,_0x532d70){var _0x4e2234=_0x3d7dc0||client;return _0x4e2234[_0x288a('0x16')](_0x1dc05b,_0x5a734e)[_0x288a('0x17')](function(_0x37a785){logger['info'](_0x288a('0x18'),_0x3d2c76,_0x288a('0x19'));logger[_0x288a('0x1a')](_0x288a('0x1b'),_0x3d2c76,'request\x20sent',JSON['stringify'](_0x37a785));if(_0x37a785[_0x288a('0x1c')]){if(_0x37a785[_0x288a('0x1c')][_0x288a('0x1d')]===0x1f4){logger[_0x288a('0x1c')](_0x288a('0x18'),_0x3d2c76,_0x37a785[_0x288a('0x1c')][_0x288a('0x1e')]);return _0x532d70(_0x37a785['error'][_0x288a('0x1e')]);}logger[_0x288a('0x1c')](_0x288a('0x18'),_0x3d2c76,_0x37a785[_0x288a('0x1c')]['message']);return _0x394241(_0x37a785[_0x288a('0x1c')][_0x288a('0x1e')]);}else{logger[_0x288a('0x1f')](_0x288a('0x18'),_0x3d2c76,_0x288a('0x19'));_0x394241(_0x37a785[_0x288a('0x20')]['message']);}})[_0x288a('0x21')](function(_0x474c23){logger[_0x288a('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x3d2c76,_0x474c23);_0x532d70(_0x474c23);});});}function respondWithStatusCode(_0x18c10f,_0x407f5b){_0x407f5b=_0x407f5b||0xcc;return function(_0x5df9e0){if(_0x5df9e0){return _0x18c10f['sendStatus'](_0x407f5b);}return _0x18c10f[_0x288a('0x22')](_0x407f5b)[_0x288a('0x23')]();};}function respondWithResult(_0x222ddf,_0x46d38a){_0x46d38a=_0x46d38a||0xc8;return function(_0x51eab4){if(_0x51eab4){return _0x222ddf[_0x288a('0x22')](_0x46d38a)[_0x288a('0x24')](_0x51eab4);}};}function respondWithFilteredResult(_0x5a132f,_0x1bf7f3){return function(_0x4f67b9){if(_0x4f67b9){var _0x5a1133=typeof _0x1bf7f3[_0x288a('0x25')]==='undefined'&&typeof _0x1bf7f3[_0x288a('0x26')]===_0x288a('0x27');var _0x1303b9=_0x4f67b9['count'];var _0xbf0af2=_0x5a1133?0x0:_0x1bf7f3['offset'];var _0x27a2fe=_0x5a1133?_0x4f67b9[_0x288a('0x28')]:_0x1bf7f3[_0x288a('0x25')]+_0x1bf7f3[_0x288a('0x26')];var _0x58e867;if(_0x27a2fe>=_0x1303b9){_0x27a2fe=_0x1303b9;_0x58e867=0xc8;}else{_0x58e867=0xce;}_0x5a132f[_0x288a('0x22')](_0x58e867);return _0x5a132f[_0x288a('0x29')](_0x288a('0x2a'),_0xbf0af2+'-'+_0x27a2fe+'/'+_0x1303b9)['json'](_0x4f67b9);}return null;};}function saveUpdates(_0xa6fd44){return function(_0x4ff301){if(_0x4ff301){return _0x4ff301[_0x288a('0x2b')](_0xa6fd44)[_0x288a('0x17')](function(_0x2dfdbf){return _0x2dfdbf;});}return null;};}function removeEntity(_0x265674){return function(_0xcf9acc){if(_0xcf9acc){return _0xcf9acc[_0x288a('0x2c')]()[_0x288a('0x17')](function(){var _0xf13dcc=_0xcf9acc[_0x288a('0x2d')]({'plain':!![]});var _0x2c3701=_0x288a('0x2e');return db[_0x288a('0x2f')][_0x288a('0x2c')]({'where':{'type':_0x2c3701,'resourceId':_0xf13dcc['id']}})[_0x288a('0x17')](function(){return _0xcf9acc;});})[_0x288a('0x17')](function(){_0x265674[_0x288a('0x22')](0xcc)[_0x288a('0x23')]();});}};}function handleEntityNotFound(_0x4774d7){return function(_0x1724c2){if(!_0x1724c2){_0x4774d7[_0x288a('0x30')](0x194);}return _0x1724c2;};}function handleError(_0x147504,_0x18d475){_0x18d475=_0x18d475||0x1f4;return function(_0x51097a){logger[_0x288a('0x1c')](_0x51097a[_0x288a('0x31')]);if(_0x51097a[_0x288a('0x32')]){delete _0x51097a[_0x288a('0x32')];}_0x147504['status'](_0x18d475)['send'](_0x51097a);};}function createInteractionObject(_0x519e0a,_0x50c8ba,_0x5b89f0,_0x3a8c07){var _0x52e918=require(_0x288a('0x33'));var _0x59aebf=new _0x52e918();var _0x4a553a=_0x59aebf['setUA'](_0x5b89f0['user-agent'])[_0x288a('0x34')]();var _0x2929ca=_0x50c8ba[_0x288a('0x35')];if(_0x5b89f0[_0x288a('0x36')]){_0x2929ca=_0x5b89f0['cf-connecting-ip'];}else if(_0x5b89f0['x-forwarded-for']){_0x2929ca=_[_0x288a('0x37')](_0x5b89f0[_0x288a('0x38')][_0x288a('0x39')](','));}return{'ContactId':_0x3a8c07['id'],'ChatWebsiteId':_0x519e0a,'from':(_0x3a8c07[_0x288a('0x3a')]||'')+'\x20'+(_0x3a8c07[_0x288a('0x3b')]||''),'customerIp':_0x2929ca,'customerPort':_0x5b89f0[_0x288a('0x3c')]?_0x5b89f0[_0x288a('0x3c')]:null,'referer':_0x50c8ba['referer'],'browserName':_0x4a553a[_0x288a('0x3d')][_0x288a('0x32')]&&_0x4a553a[_0x288a('0x3d')][_0x288a('0x3e')]?util[_0x288a('0x3f')](_0x288a('0x40'),_0x4a553a[_0x288a('0x3d')][_0x288a('0x32')],_0x4a553a['browser']['version']):'unknown','browserVersion':_0x4a553a[_0x288a('0x3d')][_0x288a('0x3e')]||_0x288a('0x41'),'osName':util[_0x288a('0x3f')]('%s\x20%s',_0x4a553a['os']['name'],_0x4a553a['os'][_0x288a('0x3e')]),'osVersion':_0x4a553a['os']['version'],'deviceModel':_0x4a553a[_0x288a('0x42')][_0x288a('0x43')]&&_0x4a553a[_0x288a('0x42')][_0x288a('0x44')]?util[_0x288a('0x3f')](_0x288a('0x45'),_0x4a553a['device'][_0x288a('0x43')],_0x4a553a['device'][_0x288a('0x44')],_0x4a553a[_0x288a('0x42')]['type']):null,'deviceVendor':_0x4a553a['device'][_0x288a('0x44')],'deviceType':_0x4a553a[_0x288a('0x42')][_0x288a('0x46')],'formData':JSON[_0x288a('0x47')](_0x50c8ba)};}exports[_0x288a('0x48')]=function(_0x3a14ce,_0xa9ca1){var _0x4bf373={'include':[{'model':db[_0x288a('0x49')],'as':_0x288a('0x4a')}]},_0x420afd={},_0x447bd6={'count':0x0,'rows':[]};var _0x5f5a08=_[_0x288a('0x4b')](db[_0x288a('0x4c')][_0x288a('0x4d')],function(_0x2359a2){return{'name':_0x2359a2[_0x288a('0x4e')],'type':_0x2359a2['type'][_0x288a('0x4f')]};});_0x420afd['model']=_[_0x288a('0x4b')](_0x5f5a08,'name');_0x420afd[_0x288a('0x50')]=_[_0x288a('0x51')](_0x3a14ce[_0x288a('0x50')]);_0x420afd['filters']=_[_0x288a('0x52')](_0x420afd[_0x288a('0x43')],_0x420afd[_0x288a('0x50')]);_0x4bf373[_0x288a('0x53')]=_[_0x288a('0x52')](_0x420afd[_0x288a('0x43')],qs[_0x288a('0x54')](_0x3a14ce[_0x288a('0x50')][_0x288a('0x54')]));_0x4bf373[_0x288a('0x53')]=_0x4bf373['attributes'][_0x288a('0x55')]?_0x4bf373[_0x288a('0x53')]:_0x420afd['model'];if(!_0x3a14ce['query'][_0x288a('0x56')](_0x288a('0x57'))){_0x4bf373[_0x288a('0x26')]=qs[_0x288a('0x26')](_0x3a14ce[_0x288a('0x50')][_0x288a('0x26')]);_0x4bf373[_0x288a('0x25')]=qs[_0x288a('0x25')](_0x3a14ce[_0x288a('0x50')]['offset']);}_0x4bf373[_0x288a('0x58')]=qs[_0x288a('0x59')](_0x3a14ce['query'][_0x288a('0x59')]);_0x4bf373[_0x288a('0x5a')]=qs[_0x288a('0x5b')](_[_0x288a('0x5c')](_0x3a14ce[_0x288a('0x50')],_0x420afd[_0x288a('0x5b')]),_0x5f5a08);if(_0x3a14ce[_0x288a('0x50')]['filter']){_0x4bf373[_0x288a('0x5a')]=_[_0x288a('0x5d')](_0x4bf373['where'],{'$or':_[_0x288a('0x4b')](_0x5f5a08,function(_0xccace0){if(_0xccace0[_0x288a('0x46')]!==_0x288a('0x5e')){var _0x51fb03={};_0x51fb03[_0xccace0[_0x288a('0x32')]]={'$like':'%'+_0x3a14ce['query'][_0x288a('0x5f')]+'%'};return _0x51fb03;}})});}_0x4bf373=_['merge']({},_0x4bf373,_0x3a14ce['options']);var _0x392a16={'where':_0x4bf373[_0x288a('0x5a')]};return db[_0x288a('0x4c')]['count'](_0x392a16)['then'](function(_0x35676d){_0x447bd6[_0x288a('0x28')]=_0x35676d;if(_0x3a14ce[_0x288a('0x50')][_0x288a('0x60')]){_0x4bf373[_0x288a('0x61')]=[{'all':!![]}];}return db[_0x288a('0x4c')][_0x288a('0x62')](_0x4bf373);})[_0x288a('0x17')](function(_0x5a2571){_0x447bd6[_0x288a('0x63')]=_0x5a2571;return _0x447bd6;})[_0x288a('0x17')](respondWithFilteredResult(_0xa9ca1,_0x4bf373))[_0x288a('0x21')](handleError(_0xa9ca1,null));};exports[_0x288a('0x64')]=function(_0x37194c,_0x11c951){var _0x3b8f5c={'raw':![],'where':{'id':_0x37194c[_0x288a('0x65')]['id']},'include':[{'model':db['Pause'],'as':_0x288a('0x4a')}]},_0x3c2a58={};_0x3c2a58['model']=_[_0x288a('0x51')](db[_0x288a('0x4c')][_0x288a('0x4d')]);_0x3c2a58[_0x288a('0x50')]=_[_0x288a('0x51')](_0x37194c['query']);_0x3c2a58['filters']=_[_0x288a('0x52')](_0x3c2a58['model'],_0x3c2a58['query']);_0x3b8f5c[_0x288a('0x53')]=_[_0x288a('0x52')](_0x3c2a58[_0x288a('0x43')],qs['fields'](_0x37194c[_0x288a('0x50')][_0x288a('0x54')]));_0x3b8f5c[_0x288a('0x53')]=_0x3b8f5c[_0x288a('0x53')][_0x288a('0x55')]?_0x3b8f5c[_0x288a('0x53')]:_0x3c2a58[_0x288a('0x43')];if(_0x37194c['query'][_0x288a('0x60')]){_0x3b8f5c[_0x288a('0x61')]=[{'all':!![]}];}_0x3b8f5c=_[_0x288a('0x5d')]({},_0x3b8f5c,_0x37194c[_0x288a('0x66')]);return db[_0x288a('0x4c')][_0x288a('0x67')](_0x3b8f5c)[_0x288a('0x17')](handleEntityNotFound(_0x11c951,null))[_0x288a('0x17')](respondWithResult(_0x11c951,null))[_0x288a('0x21')](handleError(_0x11c951,null));};exports['create']=function(_0x889a50,_0x29aee2){var _0x90fac3=null;_0x889a50['body'][_0x288a('0x68')][_0x288a('0x39')](',')[_0x288a('0x69')](_0x154d5e=>{if(_0x154d5e['trim']()!==''&&!wildcardUtils[_0x288a('0x6a')](_0x154d5e[_0x288a('0x6b')]())){_0x90fac3=new APIBadRequestError('\x22'+_0x154d5e['trim']()+_0x288a('0x6c'));}});if(_0x90fac3){return handleError(_0x29aee2,null)(_0x90fac3);}return db[_0x288a('0x4c')][_0x288a('0x6d')](_0x889a50[_0x288a('0x6e')],{})['then'](function(_0x991be7){var _0x19749a=_0x889a50['user']['get']({'plain':!![]});if(!_0x19749a)throw new Error(_0x288a('0x6f'));if(_0x19749a[_0x288a('0x70')]===_0x288a('0x71')){var _0x1c531a=_0x991be7[_0x288a('0x2d')]({'plain':!![]});var _0x51bc70=_0x288a('0x2e');return db[_0x288a('0x72')][_0x288a('0x67')]({'where':{'name':_0x51bc70,'userProfileId':_0x19749a[_0x288a('0x73')]},'raw':!![]})[_0x288a('0x17')](function(_0x2650db){if(_0x2650db&&_0x2650db[_0x288a('0x74')]===0x0){return db[_0x288a('0x2f')][_0x288a('0x6d')]({'name':_0x1c531a[_0x288a('0x32')],'resourceId':_0x1c531a['id'],'type':_0x2650db[_0x288a('0x32')],'sectionId':_0x2650db['id']},{})[_0x288a('0x17')](function(){return _0x991be7;});}else{return _0x991be7;}})['catch'](function(_0x17ab05){logger[_0x288a('0x1c')](_0x288a('0x75'),_0x17ab05);throw _0x17ab05;});}return _0x991be7;})[_0x288a('0x17')](respondWithResult(_0x29aee2,0xc9))[_0x288a('0x21')](handleError(_0x29aee2,null));};exports[_0x288a('0x2b')]=function(_0x32adac,_0x1c9b1b){var _0x2e36f4=null;_0x32adac['body'][_0x288a('0x68')][_0x288a('0x39')](',')[_0x288a('0x69')](_0x409d2a=>{if(_0x409d2a['trim']()!==''&&!wildcardUtils[_0x288a('0x6a')](_0x409d2a[_0x288a('0x6b')]())){_0x2e36f4=new APIBadRequestError('\x22'+_0x409d2a['trim']()+_0x288a('0x6c'));}});if(_0x2e36f4){return handleError(_0x1c9b1b,null)(_0x2e36f4);}if(_0x32adac['body']['id']){delete _0x32adac[_0x288a('0x6e')]['id'];}return db[_0x288a('0x4c')][_0x288a('0x67')]({'where':{'id':_0x32adac[_0x288a('0x65')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x288a('0x17')](handleEntityNotFound(_0x1c9b1b,null))[_0x288a('0x17')](saveUpdates(_0x32adac[_0x288a('0x6e')],null))['then'](respondWithResult(_0x1c9b1b,null))['catch'](handleError(_0x1c9b1b,null));};exports['destroy']=function(_0x59597d,_0x58adac){return db['ChatWebsite'][_0x288a('0x67')]({'where':{'id':_0x59597d[_0x288a('0x65')]['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x58adac,null))[_0x288a('0x17')](removeEntity(_0x58adac,null))[_0x288a('0x21')](handleError(_0x58adac,null));};exports[_0x288a('0x76')]=function(_0x433157,_0x4b8829){return db['ChatWebsite'][_0x288a('0x76')]()[_0x288a('0x17')](respondWithResult(_0x4b8829,null))['catch'](handleError(_0x4b8829,null));};exports[_0x288a('0x77')]=function(_0x2e6aa6,_0x5c5e00){if(_0x2e6aa6[_0x288a('0x6e')]['id']){delete _0x2e6aa6[_0x288a('0x6e')]['id'];}return db['ChatWebsite'][_0x288a('0x67')]({'where':{'id':_0x2e6aa6['params']['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x5c5e00,null))['then'](function(_0x131134){if(_0x131134){_0x2e6aa6[_0x288a('0x6e')][_0x288a('0x78')]=_0x131134['id'];return db[_0x288a('0x79')]['create'](_0x2e6aa6[_0x288a('0x6e')]);}})['then'](respondWithResult(_0x5c5e00,null))[_0x288a('0x21')](handleError(_0x5c5e00,null));};exports[_0x288a('0x7a')]=function(_0x330631,_0x30dd4b){var _0x44a313={'raw':![],'where':{}};var _0x28b4a2={};var _0x3c05f0={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x288a('0x7b')]({'where':{'id':_0x330631[_0x288a('0x65')]['id']}})['then'](handleEntityNotFound(_0x30dd4b,null))[_0x288a('0x17')](function(_0x59e306){if(_0x59e306){_0x28b4a2[_0x288a('0x43')]=_[_0x288a('0x51')](db[_0x288a('0x79')]['rawAttributes']);_0x28b4a2[_0x288a('0x50')]=_['keys'](_0x330631['query']);_0x28b4a2[_0x288a('0x5b')]=_['intersection'](_0x28b4a2['model'],_0x28b4a2['query']);_0x44a313['attributes']=_['intersection'](_0x28b4a2['model'],qs[_0x288a('0x54')](_0x330631[_0x288a('0x50')][_0x288a('0x54')]));_0x44a313['attributes']=_0x44a313[_0x288a('0x53')]['length']?_0x44a313[_0x288a('0x53')]:_0x28b4a2['model'];if(!_0x330631[_0x288a('0x50')][_0x288a('0x56')](_0x288a('0x57'))){_0x44a313['limit']=qs['limit'](_0x330631['query'][_0x288a('0x26')]);_0x44a313[_0x288a('0x25')]=qs[_0x288a('0x25')](_0x330631[_0x288a('0x50')]['offset']);}_0x44a313['order']=qs['sort'](_0x330631[_0x288a('0x50')][_0x288a('0x59')]);_0x44a313[_0x288a('0x5a')]=qs[_0x288a('0x5b')](_[_0x288a('0x5c')](_0x330631[_0x288a('0x50')],_0x28b4a2['filters']));_0x44a313['where'][_0x288a('0x78')]=_0x59e306['id'];if(_0x330631['query'][_0x288a('0x5f')]){_0x44a313[_0x288a('0x5a')]=_[_0x288a('0x5d')](_0x44a313[_0x288a('0x5a')],{'$or':_['map'](_0x44a313[_0x288a('0x53')],function(_0x39dc04){var _0x2aa547={};_0x2aa547[_0x39dc04]={'$like':'%'+_0x330631[_0x288a('0x50')][_0x288a('0x5f')]+'%'};return _0x2aa547;})});}_0x44a313=_['merge']({},_0x44a313,_0x330631[_0x288a('0x66')]);return db['Disposition'][_0x288a('0x28')]({'where':_0x44a313[_0x288a('0x5a')]})[_0x288a('0x17')](function(_0x178d93){_0x3c05f0[_0x288a('0x28')]=_0x178d93;if(_0x330631['query'][_0x288a('0x60')]){_0x44a313[_0x288a('0x61')]=[{'all':!![]}];}return db[_0x288a('0x79')]['findAll'](_0x44a313);})['then'](function(_0xd08760){_0x3c05f0[_0x288a('0x63')]=_0xd08760;return _0x3c05f0;});}})[_0x288a('0x17')](respondWithFilteredResult(_0x30dd4b,_0x44a313))[_0x288a('0x21')](handleError(_0x30dd4b,null));};exports[_0x288a('0x7c')]=function(_0x514036,_0xbe0016){return db[_0x288a('0x4c')][_0x288a('0x67')]({'where':{'id':_0x514036['params']['id']}})[_0x288a('0x17')](handleEntityNotFound(_0xbe0016,null))[_0x288a('0x17')](function(_0x342006){if(_0x342006){return _0x342006[_0x288a('0x7c')](_0x514036[_0x288a('0x50')]['ids']);}})['then'](respondWithStatusCode(_0xbe0016,null))['catch'](handleError(_0xbe0016,null));};exports[_0x288a('0x7d')]=function(_0xe48476,_0x2c4475){if(_0xe48476[_0x288a('0x6e')]['id']){delete _0xe48476[_0x288a('0x6e')]['id'];}return db[_0x288a('0x4c')][_0x288a('0x67')]({'where':{'id':_0xe48476['params']['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x2c4475,null))['then'](function(_0x3b35a7){if(_0x3b35a7){_0xe48476[_0x288a('0x6e')]['ChatWebsiteId']=_0x3b35a7['id'];return db[_0x288a('0x7e')][_0x288a('0x6d')](_0xe48476['body']);}})[_0x288a('0x17')](respondWithResult(_0x2c4475,null))['catch'](handleError(_0x2c4475,null));};exports[_0x288a('0x7f')]=function(_0x36c897,_0x347506){var _0x25b455={'raw':![],'where':{}};var _0x52d343={};var _0x112839={'count':0x0,'rows':[]};return db[_0x288a('0x4c')][_0x288a('0x7b')]({'where':{'id':_0x36c897[_0x288a('0x65')]['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x347506,null))[_0x288a('0x17')](function(_0x3c8749){if(_0x3c8749){_0x52d343[_0x288a('0x43')]=_[_0x288a('0x51')](db['CannedAnswer'][_0x288a('0x4d')]);_0x52d343[_0x288a('0x50')]=_[_0x288a('0x51')](_0x36c897[_0x288a('0x50')]);_0x52d343['filters']=_['intersection'](_0x52d343[_0x288a('0x43')],_0x52d343[_0x288a('0x50')]);_0x25b455[_0x288a('0x53')]=_[_0x288a('0x52')](_0x52d343[_0x288a('0x43')],qs[_0x288a('0x54')](_0x36c897[_0x288a('0x50')][_0x288a('0x54')]));_0x25b455['attributes']=_0x25b455[_0x288a('0x53')][_0x288a('0x55')]?_0x25b455['attributes']:_0x52d343['model'];if(!_0x36c897[_0x288a('0x50')][_0x288a('0x56')](_0x288a('0x57'))){_0x25b455[_0x288a('0x26')]=qs[_0x288a('0x26')](_0x36c897[_0x288a('0x50')]['limit']);_0x25b455['offset']=qs[_0x288a('0x25')](_0x36c897[_0x288a('0x50')][_0x288a('0x25')]);}_0x25b455[_0x288a('0x58')]=qs['sort'](_0x36c897[_0x288a('0x50')][_0x288a('0x59')]);_0x25b455[_0x288a('0x5a')]=qs[_0x288a('0x5b')](_['pick'](_0x36c897[_0x288a('0x50')],_0x52d343['filters']));_0x25b455[_0x288a('0x5a')]['ChatWebsiteId']=_0x3c8749['id'];if(_0x36c897[_0x288a('0x50')][_0x288a('0x5f')]){_0x25b455[_0x288a('0x5a')]=_[_0x288a('0x5d')](_0x25b455[_0x288a('0x5a')],{'$or':_[_0x288a('0x4b')](_0x25b455[_0x288a('0x53')],function(_0x2eae17){var _0x3c3139={};_0x3c3139[_0x2eae17]={'$like':'%'+_0x36c897['query'][_0x288a('0x5f')]+'%'};return _0x3c3139;})});}_0x25b455=_[_0x288a('0x5d')]({},_0x25b455,_0x36c897[_0x288a('0x66')]);return db[_0x288a('0x7e')][_0x288a('0x28')]({'where':_0x25b455['where']})['then'](function(_0x3db97f){_0x112839[_0x288a('0x28')]=_0x3db97f;if(_0x36c897[_0x288a('0x50')][_0x288a('0x60')]){_0x25b455['include']=[{'all':!![]}];}return db[_0x288a('0x7e')]['findAll'](_0x25b455);})[_0x288a('0x17')](function(_0x1ea96d){_0x112839['rows']=_0x1ea96d;return _0x112839;});}})[_0x288a('0x17')](respondWithFilteredResult(_0x347506,_0x25b455))['catch'](handleError(_0x347506,null));};exports[_0x288a('0x80')]=function(_0x5b9eb7,_0x4d484d){return db[_0x288a('0x4c')][_0x288a('0x67')]({'where':{'id':_0x5b9eb7['params']['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x4d484d,null))[_0x288a('0x17')](function(_0x39521f){if(_0x39521f){return _0x39521f[_0x288a('0x80')](_0x5b9eb7[_0x288a('0x50')][_0x288a('0x81')]);}})[_0x288a('0x17')](respondWithStatusCode(_0x4d484d,null))['catch'](handleError(_0x4d484d,null));};exports[_0x288a('0x82')]=function(_0x1fcdb5,_0x1b6782){_0x1fcdb5[_0x288a('0x6e')][_0x288a('0x83')]=_0x1fcdb5['file'][_0x288a('0x84')];return db['ChatWebsite'][_0x288a('0x67')]({'where':{'id':_0x1fcdb5[_0x288a('0x65')]['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x1b6782,null))[_0x288a('0x17')](saveUpdates(_0x1fcdb5[_0x288a('0x6e')],null))[_0x288a('0x17')](respondWithResult(_0x1b6782,null))[_0x288a('0x21')](handleError(_0x1b6782,null));};exports[_0x288a('0x85')]=function(_0x4362d1,_0x58a0a1){_0x4362d1[_0x288a('0x6e')]['agentAvatar']=_0x4362d1[_0x288a('0x86')][_0x288a('0x84')];return db[_0x288a('0x4c')][_0x288a('0x67')]({'where':{'id':_0x4362d1[_0x288a('0x65')]['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x58a0a1,null))[_0x288a('0x17')](saveUpdates(_0x4362d1[_0x288a('0x6e')],null))[_0x288a('0x17')](respondWithResult(_0x58a0a1,null))[_0x288a('0x21')](handleError(_0x58a0a1,null));};exports[_0x288a('0x87')]=function(_0x41f0d7,_0x555fcb){_0x41f0d7[_0x288a('0x6e')][_0x288a('0x88')]=_0x41f0d7['file'][_0x288a('0x84')];return db['ChatWebsite'][_0x288a('0x67')]({'where':{'id':_0x41f0d7[_0x288a('0x65')]['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x555fcb,null))[_0x288a('0x17')](saveUpdates(_0x41f0d7['body'],null))['then'](respondWithResult(_0x555fcb,null))[_0x288a('0x21')](handleError(_0x555fcb,null));};exports[_0x288a('0x89')]=function(_0x1c1d4a,_0x12296e){_0x1c1d4a['body'][_0x288a('0x8a')]=_0x1c1d4a['file'][_0x288a('0x84')];return db[_0x288a('0x4c')][_0x288a('0x67')]({'where':{'id':_0x1c1d4a[_0x288a('0x65')]['id']}})['then'](handleEntityNotFound(_0x12296e,null))[_0x288a('0x17')](saveUpdates(_0x1c1d4a[_0x288a('0x6e')],null))[_0x288a('0x17')](respondWithResult(_0x12296e,null))['catch'](handleError(_0x12296e,null));};exports[_0x288a('0x8b')]=function(_0x2732c1,_0x35d0e1){var _0x3e733a=path['join'](config[_0x288a('0x8c')],'server/files/images/logos/default_logo.svg');var _0x20b222={'where':{'id':_0x2732c1[_0x288a('0x65')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x3cf2d6=![];return require(_0x288a('0x8d'))[_0x288a('0x8e')]()[_0x288a('0x17')](function(_0x573493){if(_0x573493){_0x3cf2d6=_0x573493[_0x288a('0x8f')];}})[_0x288a('0x17')](function(){return db[_0x288a('0x4c')]['find'](_0x20b222);})['then'](handleEntityNotFound(_0x35d0e1,null))[_0x288a('0x17')](function(_0x5bc22a){if(_0x5bc22a){if(!_[_0x288a('0x90')](_0x5bc22a[_0x288a('0x83')])){if(fs[_0x288a('0x91')](path[_0x288a('0x92')](config['root'],_0x288a('0x93'),_0x5bc22a[_0x288a('0x83')]))&&_0x3cf2d6){_0x3e733a=path[_0x288a('0x92')](config['root'],'server/files/images/logos/',_0x5bc22a[_0x288a('0x83')]);}}return _0x35d0e1[_0x288a('0x94')](_0x3e733a);}})['catch'](handleError(_0x35d0e1,null));};exports[_0x288a('0x95')]=function(_0x107954,_0x4f3630){var _0x47eedc=path[_0x288a('0x92')](config[_0x288a('0x8c')],_0x288a('0x96'));var _0x5f4ef5={'where':{'id':_0x107954[_0x288a('0x65')]['id']},'attributes':['id',_0x288a('0x97')],'raw':!![]};return db['ChatWebsite'][_0x288a('0x67')](_0x5f4ef5)[_0x288a('0x17')](handleEntityNotFound(_0x4f3630,null))['then'](function(_0x51332b){if(_0x51332b){if(!_['isNil'](_0x51332b[_0x288a('0x97')])){if(fs[_0x288a('0x91')](path['join'](config[_0x288a('0x8c')],'server/files/images/avatars/',_0x51332b[_0x288a('0x97')]))){_0x47eedc=path[_0x288a('0x92')](config[_0x288a('0x8c')],_0x288a('0x98'),_0x51332b[_0x288a('0x97')]);}}return _0x4f3630['download'](_0x47eedc);}})[_0x288a('0x21')](handleError(_0x4f3630,null));};exports[_0x288a('0x99')]=function(_0x4eebf8,_0x536e1b){var _0x24823f=path[_0x288a('0x92')](config[_0x288a('0x8c')],'server/files/images/avatars/customer_avatar.png');var _0x547e3d={'where':{'id':_0x4eebf8['params']['id']},'attributes':['id',_0x288a('0x88'),_0x288a('0x9a')],'raw':!![]};return db[_0x288a('0x4c')][_0x288a('0x67')](_0x547e3d)[_0x288a('0x17')](handleEntityNotFound(_0x536e1b,null))[_0x288a('0x17')](function(_0xa7e371){if(_0xa7e371){if(!_[_0x288a('0x90')](_0xa7e371[_0x288a('0x88')])){if(fs['existsSync'](path['join'](config[_0x288a('0x8c')],_0x288a('0x98'),_0xa7e371[_0x288a('0x88')]))&&_0xa7e371[_0x288a('0x9a')]){_0x24823f=path[_0x288a('0x92')](config['root'],_0x288a('0x98'),_0xa7e371[_0x288a('0x88')]);}}return _0x536e1b[_0x288a('0x94')](_0x24823f);}})[_0x288a('0x21')](handleError(_0x536e1b,null));};exports[_0x288a('0x9b')]=function(_0x15ff13,_0x4f04dc){var _0x472955=path['join'](config[_0x288a('0x8c')],'server/files/images/avatars/system_avatar.png');var _0x402fda={'where':{'id':_0x15ff13[_0x288a('0x65')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x288a('0x4c')][_0x288a('0x67')](_0x402fda)[_0x288a('0x17')](handleEntityNotFound(_0x4f04dc,null))[_0x288a('0x17')](function(_0x49818d){if(_0x49818d){if(!_[_0x288a('0x90')](_0x49818d[_0x288a('0x8a')])){if(fs['existsSync'](path[_0x288a('0x92')](config['root'],_0x288a('0x98'),_0x49818d[_0x288a('0x8a')]))){_0x472955=path[_0x288a('0x92')](config['root'],_0x288a('0x98'),_0x49818d[_0x288a('0x8a')]);}}return _0x4f04dc[_0x288a('0x94')](_0x472955);}})['catch'](handleError(_0x4f04dc,null));};function checkWebsiteInterval(_0x4f39e3){var _0x283095=_0x4f39e3[_0x288a('0x9c')];if(!_0x283095){return Promise[_0x288a('0x9d')](_0x4f39e3);}var _0x2ed27c=_0x4f39e3[_0x288a('0x9e')]||undefined;return _0x283095[_0x288a('0x9f')](_0x2ed27c)[_0x288a('0x17')](function(_0x9fd16f){if(!_0x9fd16f){throw new APIOutOfIntervalError();}return _0x4f39e3;});}exports['notify']=function(_0x6414e1,_0x338be9){var _0x1621e9={'body':_0x6414e1[_0x288a('0x6e')],'channel':_0x288a('0xa0')};var _0x24ce47=[];var _0x4c65a9=[];var _0xcdc89a={};var _0x4339f6=![];if(_0x6414e1['body']['id']){delete _0x6414e1[_0x288a('0x6e')]['id'];}if(_['isNil'](_0x6414e1[_0x288a('0x6e')][_0x288a('0xa1')])){throw new APIBadRequestError(_0x288a('0xa2'));}if(_[_0x288a('0x90')](_0x6414e1[_0x288a('0x6e')][_0x288a('0xa3')])){throw new APIBadRequestError(_0x288a('0xa4'));}if(_['isEmpty'](_0x6414e1[_0x288a('0x6e')][_0x288a('0x6e')])){throw new APIBadRequestError(_0x288a('0xa5'));}var _0x115fc0=_0x6414e1[_0x288a('0x6e')][_0x288a('0x35')]&&_0x6414e1[_0x288a('0x6e')]['referer'];return db[_0x288a('0xa6')][_0x288a('0x76')]()[_0x288a('0x17')](function(_0x5049d1){if(!_0x5049d1){throw new Error(_0x288a('0xa7'));}_0x24ce47=Object[_0x288a('0x51')](_0x5049d1)[_0x288a('0x5f')](function(_0x3970c4){return![_0x288a('0xa8'),_0x288a('0xa9')][_0x288a('0xaa')](_0x3970c4);});_0x4c65a9=Object[_0x288a('0x51')](_0x5049d1)[_0x288a('0x5f')](function(_0x46c27a){return![_0x288a('0xa8'),_0x288a('0xa9'),_0x288a('0xab'),_0x288a('0xac')][_0x288a('0xaa')](_0x46c27a);});if(!_[_0x288a('0xaa')](_0x4c65a9,_0x6414e1[_0x288a('0x6e')][_0x288a('0xa3')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x4c65a9[_0x288a('0x92')](',\x20'));}_0xcdc89a[_0x6414e1[_0x288a('0x6e')]['mapKey']]=_0x6414e1[_0x288a('0x6e')]['from'];})[_0x288a('0x17')](function(){return db[_0x288a('0x4c')][_0x288a('0x67')]({'where':{'id':_0x6414e1[_0x288a('0x65')]['id']},'include':[{'model':db['CmList'],'as':_0x288a('0xad'),'include':[{'model':db['CmContact'],'as':_0x288a('0xae'),'where':_0xcdc89a,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x288a('0xaf')],'as':'Applications'},{'model':db[_0x288a('0x9c')],'as':_0x288a('0x9c'),'include':[{'model':db['Interval'],'as':_0x288a('0xb0'),'attributes':['id',_0x288a('0xb1')],'raw':!![]}]}]});})[_0x288a('0x17')](function(_0xb04e30){if(!_0xb04e30){throw new APINotFoundError(util[_0x288a('0x3f')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x6414e1['params']['id']));}if(_0x115fc0){return checkWebsiteInterval(_0xb04e30);}return _0xb04e30;})['then'](function(_0x4bf9e1){_0x1621e9[_0x288a('0xb2')]=_0x4bf9e1;_0x1621e9[_0x288a('0xb3')]=_[_0x288a('0xb4')](_0x4bf9e1[_0x288a('0xb5')],[_0x288a('0xb6')],[_0x288a('0xb7')]);if(_0x1621e9[_0x288a('0xb2')]['Applications']){delete _0x1621e9[_0x288a('0xb2')]['Applications'];}_0x1621e9[_0x288a('0xb8')]=_0x4bf9e1[_0x288a('0xad')]||{'id':_0x4bf9e1[_0x288a('0xac')]};if(_0x1621e9[_0x288a('0xb8')]&&_0x1621e9[_0x288a('0xb8')]['Contacts']['length']){return _0x1621e9['list'][_0x288a('0xae')][0x0];}var _0x41f73d=_[_0x288a('0x10')](_0x6414e1[_0x288a('0x6e')],{'firstName':_0x6414e1[_0x288a('0x6e')][_0x288a('0xa1')],'ListId':_0x4bf9e1[_0x288a('0xac')]});_0x41f73d[_0x6414e1[_0x288a('0x6e')]['mapKey']]=_0x6414e1['body'][_0x288a('0xa1')];return db[_0x288a('0xa6')][_0x288a('0x6d')](_0x41f73d,{'fields':_0x24ce47,'raw':!![]});})[_0x288a('0x17')](function(_0x4f732c){_0x1621e9[_0x288a('0xb9')]=_0x4f732c;var _0x433e8e=createInteractionObject(_0x6414e1[_0x288a('0x65')]['id'],_0x6414e1[_0x288a('0x6e')],_0x6414e1[_0x288a('0xba')],_0x4f732c);var _0x15f8ae={'ChatWebsiteId':_0x6414e1[_0x288a('0x65')]['id']};if(_0x6414e1[_0x288a('0x6e')][_0x288a('0xbb')]){_0x15f8ae[_0x288a('0xbb')]=_0x6414e1[_0x288a('0x6e')][_0x288a('0xbb')];_0x15f8ae[_0x288a('0xbc')]=![];return db[_0x288a('0xbd')][_0x288a('0x67')]({'where':_0x15f8ae})[_0x288a('0x17')](function(_0x344cbf){var _0x38c290=_0x6414e1[_0x288a('0x6e')][_0x288a('0x35')]&&_0x6414e1[_0x288a('0x6e')]['referer'];if(_0x344cbf){_0x4339f6=!![];return _0x344cbf;}else if(!_0x38c290&&_0x344cbf&&_0x344cbf[_0x288a('0xbc')]){throw new APIConflictError(_0x288a('0xbe'));}_0x433e8e['threadId']=_0x6414e1['body'][_0x288a('0xbb')];_0x433e8e[_0x288a('0xbf')]=_0x6414e1['body'][_0x288a('0xbf')];return db['ChatInteraction'][_0x288a('0x6d')](_0x433e8e);});}_0x15f8ae['ContactId']=_0x4f732c['id'];if(_0x6414e1[_0x288a('0x6e')][_0x288a('0xc0')]&&_0x6414e1['body'][_0x288a('0xc0')]['id']){_0x15f8ae['id']=_0x6414e1[_0x288a('0x6e')][_0x288a('0xc0')]['id'];return db[_0x288a('0xbd')][_0x288a('0x67')]({'where':_0x15f8ae})[_0x288a('0x17')](function(_0x57544c){var _0x58f3fb=_0x6414e1['body'][_0x288a('0x35')]&&_0x6414e1[_0x288a('0x6e')][_0x288a('0xc1')];if(!_0x58f3fb&&_0x57544c&&_0x57544c['closed']){throw new APIConflictError(_0x288a('0xbe'));}else if(_0x57544c){_0x4339f6=!![];return _0x57544c;}else{return db[_0x288a('0xbd')][_0x288a('0x6d')](_0x433e8e);}});}return db[_0x288a('0xbd')][_0x288a('0x6d')](_0x433e8e);})[_0x288a('0x17')](function(_0x5e515f){if(!_0x4339f6){return _0x5e515f;}var _0x424421={'from':(_0x1621e9['contact'][_0x288a('0x3a')]||'')+'\x20'+(_0x1621e9[_0x288a('0xb9')]['lastName']||'')};if(_0x6414e1[_0x288a('0x6e')][_0x288a('0xbb')]&&_0x6414e1['body'][_0x288a('0xc2')]&&_0x6414e1[_0x288a('0x6e')][_0x288a('0xbb')]!=_0x6414e1[_0x288a('0x6e')][_0x288a('0xc2')]){_0x424421[_0x288a('0xbb')]=_0x6414e1[_0x288a('0x6e')]['messageId'];}return _0x5e515f[_0x288a('0x2b')](_0x424421);})[_0x288a('0x17')](function(_0x469db9){_0x1621e9[_0x288a('0xc0')]=_0x469db9[_0x288a('0x2d')]({'plain':!![]});_0x1621e9[_0x288a('0xc0')][_0x288a('0xc3')]=!_0x4339f6;if(_0x1621e9[_0x288a('0xc0')]['created']){if(_0x1621e9[_0x288a('0xb2')][_0x288a('0xc4')]){_0x1621e9['applications']['push']({'id':0x0,'priority':_0x1621e9['applications'][_0x288a('0x55')]+0x1,'app':_0x288a('0xc5'),'appdata':_0x288a('0xc6'),'interval':'*,*,*,*'});}}return db[_0x288a('0xc7')][_0x288a('0x6d')]({'body':_0x6414e1[_0x288a('0x6e')][_0x288a('0x6e')],'ChatWebsiteId':_0x6414e1['params']['id'],'ChatInteractionId':_0x469db9['id'],'direction':'in','ContactId':_0x1621e9[_0x288a('0xb9')]['id'],'AttachmentId':_0x6414e1['body'][_0x288a('0xc8')]});})[_0x288a('0x17')](function(_0x4b8ebb){_0x1621e9[_0x288a('0x1e')]=_0x4b8ebb;if(!_0x1621e9[_0x288a('0xc0')][_0x288a('0xc9')]){return;}return db[_0x288a('0xca')][_0x288a('0x67')]({'attributes':['id',_0x288a('0x32')],'where':{'id':_0x1621e9[_0x288a('0xc0')][_0x288a('0xc9')]}});})[_0x288a('0x17')](function(_0x4e984e){if(_0x4e984e){_0x1621e9[_0x288a('0xb3')][_0x288a('0xcb')]({'id':0x0,'priority':0x0,'app':_0x288a('0xcc'),'appdata':_0x4e984e[_0x288a('0x32')]+','+(_0x1621e9['account']['waitForTheAssignedAgent']||0xa),'interval':_0x288a('0xcd')});_0x1621e9[_0x288a('0xce')]=!![];}if(!_0x1621e9['interaction'][_0x288a('0xcf')]){return;}return db[_0x288a('0xd0')][_0x288a('0x67')]({'attributes':['id',_0x288a('0x32')],'where':{'id':_0x1621e9[_0x288a('0xc0')]['queueId']}});})[_0x288a('0x17')](function(_0x5676a5){if(_0x5676a5){_0x1621e9[_0x288a('0xb3')]['unshift']({'id':0x0,'priority':0x1,'app':_0x288a('0xd1'),'appdata':_0x5676a5[_0x288a('0x32')]+','+(_0x1621e9[_0x288a('0xb2')][_0x288a('0xd2')]||0x12c),'interval':_0x288a('0xcd')});}return respondWithRpcPromise(_0x288a('0xd3'),_0x288a('0xd4'),_0x1621e9);})[_0x288a('0x17')](function(_0x3d5968){respondWithRpcPromise('EventManager',_0x288a('0xd5'),{'event':_0x288a('0xd6'),'message':_0x3d5968},client9002);return _0x3d5968;})['then'](respondWithResult(_0x338be9,null))[_0x288a('0x21')](APIHandleError(_0x338be9));};exports['offline']=function(_0xfa5102,_0xfaa365){var _0xbcb3b4,_0xca3cd6,_0x1d21fd;var _0x5dea70=[];var _0x77f8b0={};var _0x1b7172=_0xfa5102['files']||[];var _0x576f69=[];var _0x5df459;return db[_0x288a('0xa6')]['describe']()[_0x288a('0x17')](function(_0x2ad32d){if(!_0x2ad32d){throw new db['Sequelize'][(_0x288a('0xd7'))](_0x288a('0xd8'));}_0x5dea70=_[_0x288a('0xd9')](_[_0x288a('0x51')](_0x2ad32d),[_0x288a('0xa8'),_0x288a('0xa9'),_0x288a('0xab'),_0x288a('0xac')]);if(_0xfa5102[_0x288a('0x6e')]['id']){delete _0xfa5102[_0x288a('0x6e')]['id'];}if(_[_0x288a('0x90')](_0xfa5102['body'][_0x288a('0xa1')])){throw _0xfaa365[_0x288a('0x22')](0x1f4)[_0x288a('0xda')](new db['Sequelize']['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x288a('0x90')](_0xfa5102['body']['body'])||_0xfa5102[_0x288a('0x6e')][_0x288a('0x6e')]===''){throw _0xfaa365[_0x288a('0x22')](0x1f4)[_0x288a('0xda')](new db[(_0x288a('0xdb'))][(_0x288a('0xd7'))](_0x288a('0xdc')));}if(_[_0x288a('0x90')](_0xfa5102[_0x288a('0x6e')][_0x288a('0xdd')])){throw _0xfaa365[_0x288a('0x22')](0x1f4)['send'](new db[(_0x288a('0xdb'))][(_0x288a('0xd7'))](_0x288a('0xde')+_0x5dea70));}if(!_[_0x288a('0xaa')](_0x5dea70,_0xfa5102[_0x288a('0x6e')][_0x288a('0xdd')])){throw _0xfaa365[_0x288a('0x22')](0x1f4)['send'](new db[(_0x288a('0xdb'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5dea70));}_0x77f8b0[_0xfa5102[_0x288a('0x6e')][_0x288a('0xdd')]]=_0xfa5102[_0x288a('0x6e')][_0x288a('0xa1')];})[_0x288a('0x17')](function(){return db[_0x288a('0x4c')][_0x288a('0x67')]({'where':{'id':_0xfa5102['params']['id']},'include':[{'model':db[_0x288a('0xdf')],'as':_0x288a('0xad')},{'model':db[_0x288a('0xe0')],'as':_0x288a('0xe0')}]});})[_0x288a('0x17')](handleEntityNotFound(_0xfaa365,null))[_0x288a('0x17')](function(_0x50b07c){if(_0x50b07c&&_0x50b07c[_0x288a('0xad')]){_0xca3cd6=_0x50b07c;var _0x99a284=_[_0x288a('0x10')](_0xfa5102[_0x288a('0x6e')],{'firstName':_0xfa5102[_0x288a('0x6e')]['from'],'phone':_0xfa5102[_0x288a('0x6e')][_0x288a('0xa1')],'ListId':_0x50b07c[_0x288a('0xac')]});_0x99a284[_0xfa5102[_0x288a('0x6e')][_0x288a('0xdd')]]=_0xfa5102[_0x288a('0x6e')][_0x288a('0xa1')];return db[_0x288a('0xa6')][_0x288a('0xe1')]({'where':_0x77f8b0,'defaults':_0x99a284});}})[_0x288a('0xe2')](function(_0xe85e95){if(_0xe85e95){_0x1d21fd=_0xe85e95;var _0x513e17=fs['readFileSync'](path[_0x288a('0x92')](config[_0x288a('0x8c')],'server/files/templates/chatOfflineMessage.ejs'),_0x288a('0xe3'));var _0x2bd682=ejs[_0x288a('0xe4')](_0x513e17,{'body':_['toPairs'](_0xfa5102['body'][_0x288a('0x6e')]),'bodyTitle':_0xca3cd6['offlineMessageBody']});return db[_0x288a('0xe5')][_0x288a('0x6d')]({'body':_0x2bd682,'plainBody':htmlToText['fromString'](_0x2bd682),'ContactId':_0xe85e95['id'],'ChatWebsiteId':_0xca3cd6['id']});}})[_0x288a('0x17')](function(_0x8f23a8){_0x5df459=_0x8f23a8;if(_0x1b7172[_0x288a('0x55')]){var _0x3bd118=_0x1b7172['map'](function(_0x35d20f){return{'name':_0x35d20f[_0x288a('0xe6')],'basename':_0x35d20f[_0x288a('0x84')],'type':_0x35d20f[_0x288a('0xe7')],'ChatOfflineMessageId':_0x8f23a8['id']};});_0x576f69=_0x3bd118[_0x288a('0x4b')](_0x4c0b00=>{var _0x3da81b={'filename':_0x4c0b00[_0x288a('0x32')],'path':path[_0x288a('0x92')](config[_0x288a('0x8c')],'server','files','attachments',_0x288a('0xe8'),_0x4c0b00[_0x288a('0xe9')])};return _0x3da81b;});if(!_0xca3cd6[_0x288a('0xea')]){return db[_0x288a('0xeb')]['transaction'](function(_0x4bf087){return db[_0x288a('0xec')][_0x288a('0xed')](_0x3bd118,{'transaction':_0x4bf087});});}}})[_0x288a('0x17')](function(){if(_0x5df459){_0xbcb3b4=_0x5df459;return db[_0x288a('0xe0')][_0x288a('0x7b')]({'where':{'service':!![]},'include':[{'model':db[_0x288a('0xee')],'as':_0x288a('0xef'),'raw':!![],'include':[{'model':db[_0x288a('0xf0')],'as':_0x288a('0xf0'),'raw':!![]}]}]});}})[_0x288a('0x17')](function(_0x52c957){if(_0x52c957&&_0x52c957['Smtp']&&_0xca3cd6[_0x288a('0xf1')]&&_0xca3cd6[_0x288a('0xf2')]){var _0x196537=_0x52c957[_0x288a('0xf3')]();return respondWithRpcPromise('SendMail',_0x288a('0xf4'),{'account':_0x196537,'message':{'from':util['format'](_0x288a('0xf5'),_0x52c957[_0x288a('0x32')],_0x52c957[_0x288a('0xf6')]||_0x52c957[_0x288a('0xef')][_0x288a('0x71')]),'to':_0xca3cd6[_0x288a('0xf2')],'subject':_0xca3cd6[_0x288a('0xf7')],'html':_0xbcb3b4[_0x288a('0x6e')],'attachments':_0x576f69}},client9003)[_0x288a('0x17')](function(){return _0xbcb3b4;})[_0x288a('0x21')](function(_0xf572d3){logger[_0x288a('0x1c')](_0xf572d3);});}})['then'](function(){if(_0xca3cd6&&_0xca3cd6[_0x288a('0xea')]&&_0xca3cd6[_0x288a('0xf8')]){var _0x478c3b=[];if(_0x1b7172[_0x288a('0x55')]){_0x478c3b=_0x1b7172[_0x288a('0x4b')](function(_0x156741){return{'name':_0x156741['originalname'],'basename':_0x156741[_0x288a('0x84')],'type':_0x156741[_0x288a('0xe7')],'ChatOfflineMessageId':_0x5df459['id']};});}var _0x24032d;if(!_['isNil'](_0xca3cd6[_0x288a('0xf9')])){var _0x46fa05=_[_0x288a('0x4b')](_0xfa5102[_0x288a('0x6e')],function(_0x2e7919){return _0x2e7919;});var _0x3c1a04=_[_0x288a('0xfa')](_0x46fa05)[0x0];var _0x45d982=_[_0x288a('0xfb')](_0x3c1a04,function(_0x24a6aa){return _0x24a6aa;});_0x24032d=_0x45d982[0x1][_0xca3cd6['subjectOffline']];}var _0x170cfb={'from':_0x1d21fd[_0x288a('0xf6')],'firstName':_0x1d21fd[_0x288a('0x3a')],'lastName':_0x1d21fd['lastName'],'mapKey':'email','message':{'from':_0x1d21fd[_0x288a('0xf6')],'to':_0xca3cd6[_0x288a('0xe0')][_0x288a('0xf6')],'cc':'','subject':_[_0x288a('0x90')](_0x24032d)?_0xca3cd6['offlineMessageSubject']:_0x24032d,'messageId':'','sentAt':new Date(),'attach':_0x478c3b[_0x288a('0x55')],'attachments':_0x478c3b,'originChannel':_0x288a('0xfc'),'ChatWebsiteId':_0xca3cd6['id'],'ChatOfflineMessageId':_0xbcb3b4['id'],'originTo':_0xca3cd6[_0x288a('0xe0')][_0x288a('0xf6')]},'body':_0xbcb3b4[_0x288a('0x6e')]};var _0xd7cafe={'account':{'id':_0xca3cd6[_0x288a('0xf8')]},'body':_0x170cfb,'log':_0x288a('0xfd')};return respondWithRpcPromise(_0x288a('0xfd'),_0x288a('0xfe'),_0xd7cafe,client9001)[_0x288a('0x17')](function(){return _0xbcb3b4;})[_0x288a('0x21')](function(_0x20e5a2){logger[_0x288a('0x1c')](_0x20e5a2);});}return;})['then'](function(){if(_0xbcb3b4){return _0xbcb3b4;}})[_0x288a('0x17')](respondWithResult(_0xfaa365,null))['catch'](function(){for(var _0x280382 of _0x1b7172){var _0x7527bc=path['join'](config[_0x288a('0x8c')],_0x288a('0xff'),_0x288a('0x100'),_0x288a('0x101'),_0x288a('0xe8'),_0x280382[_0x288a('0x84')]);fs_extra['remove'](_0x7527bc)[_0x288a('0x21')](function(_0x1634d2){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x7527bc,_0x1634d2);});}});};exports[_0x288a('0x102')]=function(_0x4cb37f,_0x3be95e){return db[_0x288a('0xbd')][_0x288a('0x67')]({'where':{'id':_0x4cb37f[_0x288a('0x65')]['id']}})['then'](handleEntityNotFound(_0x3be95e,null))[_0x288a('0x17')](function(_0x11f0d6){if(_0x11f0d6){return _0x11f0d6['addInteraction'](_0x4cb37f[_0x288a('0x6e')]['ids'],_[_0x288a('0x103')](_0x4cb37f[_0x288a('0x6e')],['ids','id'])||{});}})['then'](respondWithResult(_0x3be95e,null))['catch'](handleError(_0x3be95e,null));};exports[_0x288a('0x104')]=function(_0x271862,_0x4f244d){var _0x4deb02={'raw':![],'where':{}};var _0x50f60b={};var _0x26cfd6={'count':0x0,'rows':[]};return db[_0x288a('0x4c')][_0x288a('0x7b')]({'where':{'id':_0x271862[_0x288a('0x65')]['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x4f244d,null))[_0x288a('0x17')](function(_0x4a7bb3){if(_0x4a7bb3){_0x50f60b['model']=_[_0x288a('0x51')](db[_0x288a('0xbd')][_0x288a('0x4d')]);_0x50f60b[_0x288a('0x50')]=_[_0x288a('0x51')](_0x271862[_0x288a('0x50')]);_0x50f60b['filters']=_['intersection'](_0x50f60b[_0x288a('0x43')],_0x50f60b[_0x288a('0x50')]);_0x4deb02[_0x288a('0x53')]=_['intersection'](_0x50f60b[_0x288a('0x43')],qs['fields'](_0x271862[_0x288a('0x50')][_0x288a('0x54')]));_0x4deb02[_0x288a('0x53')]=_0x4deb02[_0x288a('0x53')][_0x288a('0x55')]?_0x4deb02[_0x288a('0x53')]:_0x50f60b['model'];if(!_0x271862[_0x288a('0x50')][_0x288a('0x56')](_0x288a('0x57'))){_0x4deb02[_0x288a('0x26')]=qs[_0x288a('0x26')](_0x271862[_0x288a('0x50')]['limit']);_0x4deb02['offset']=qs['offset'](_0x271862['query'][_0x288a('0x25')]);}_0x4deb02[_0x288a('0x58')]=qs[_0x288a('0x59')](_0x271862[_0x288a('0x50')][_0x288a('0x59')]);_0x4deb02[_0x288a('0x5a')]=qs['filters'](_[_0x288a('0x5c')](_0x271862[_0x288a('0x50')],_0x50f60b['filters']));_0x4deb02[_0x288a('0x5a')]['ChatWebsiteId']=_0x4a7bb3['id'];if(_0x271862[_0x288a('0x50')]['filter']){_0x4deb02[_0x288a('0x5a')]=_[_0x288a('0x5d')](_0x4deb02[_0x288a('0x5a')],{'$or':_[_0x288a('0x4b')](_0x4deb02[_0x288a('0x53')],function(_0x30f101){var _0x250b1b={};_0x250b1b[_0x30f101]={'$like':'%'+_0x271862['query'][_0x288a('0x5f')]+'%'};return _0x250b1b;})});}_0x4deb02=_[_0x288a('0x5d')]({},_0x4deb02,_0x271862[_0x288a('0x66')]);return db[_0x288a('0xbd')][_0x288a('0x28')]({'where':_0x4deb02[_0x288a('0x5a')]})['then'](function(_0x436ec7){_0x26cfd6[_0x288a('0x28')]=_0x436ec7;if(_0x271862[_0x288a('0x50')][_0x288a('0x60')]){_0x4deb02[_0x288a('0x61')]=[{'model':db[_0x288a('0xa6')],'as':_0x288a('0x105'),'required':![]},{'model':db[_0x288a('0xca')],'as':_0x288a('0x106'),'attributes':[_0x288a('0x32'),_0x288a('0x107'),'internal'],'required':![]},{'model':db[_0x288a('0x108')],'as':_0x288a('0x109'),'attributes':['id',_0x288a('0x32'),'color'],'where':_0x271862[_0x288a('0x50')]['tag']?{'id':_0x271862[_0x288a('0x50')]['tag']}:undefined,'required':_0x271862[_0x288a('0x50')][_0x288a('0x10a')]?!![]:![]}];}return db[_0x288a('0xbd')][_0x288a('0x62')](_0x4deb02);})[_0x288a('0x17')](function(_0x26a2a0){_0x26cfd6[_0x288a('0x63')]=_0x26a2a0;return _0x26cfd6;});}})['then'](respondWithFilteredResult(_0x4f244d,_0x4deb02))[_0x288a('0x21')](handleError(_0x4f244d,null));};exports[_0x288a('0x10b')]=function(_0x47f7b4,_0x1c7869){var _0x315449=0x0;var _0x3bb691=0x0;var _0x48f8de=![];var _0xb8b897;var _0x4af911;return db[_0x288a('0x4c')][_0x288a('0x67')]({'where':{'id':_0x47f7b4[_0x288a('0x65')]['id']},'include':[{'model':db[_0x288a('0x9c')],'as':'Interval','include':[{'model':db[_0x288a('0x9c')],'as':_0x288a('0xb0'),'attributes':['id',_0x288a('0xb1')]}]}]})[_0x288a('0x17')](handleEntityNotFound(_0x1c7869,null))[_0x288a('0x17')](function(_0x28501e){if(_0x28501e){_0xb8b897=_0x28501e;return _0x28501e[_0x288a('0x10c')]({'raw':!![]});}})[_0x288a('0x17')](function(_0x2604a2){if(_0xb8b897){if(_0x2604a2){_0x4af911=_0x2604a2;}}return require(_0x288a('0x8d'))[_0x288a('0x8e')]();})['then'](function(_0x2f9b6b){if(_0x2f9b6b){_0x3bb691=_0x2f9b6b[_0x288a('0x10d')];_0x48f8de=_0x2f9b6b[_0x288a('0x8f')];}})[_0x288a('0x17')](function(){return db[_0x288a('0xbd')][_0x288a('0x28')]({'where':{'closed':![]}});})['then'](function(_0x452f61){_0x315449=_0x452f61;if(_0x3bb691&&_0x452f61>_0x3bb691){return db[_0x288a('0x10e')][_0x288a('0x7b')]({'where':{'id':0x1}})[_0x288a('0x17')](function(_0x5148a9){if(_0x5148a9){_0x5148a9[_0x288a('0x10f')](_0x288a('0x110'));}});}})[_0x288a('0x17')](function(){var _0x2aa793=_0xb8b897['Interval'];var _0x3d74f8=_0xb8b897[_0x288a('0x9e')]||undefined;return _0x2aa793?_0x2aa793[_0x288a('0x9f')](_0x3d74f8):!![];})[_0x288a('0x17')](function(_0x2c2e74){var _0x4fa6d6=fs[_0x288a('0x111')](path[_0x288a('0x92')](config[_0x288a('0x8c')],_0x288a('0x112')),_0x288a('0xe3'));var _0x227020=_0x288a('0x113');var _0x1a8434=![];var _0x45fdd3,_0x450f42;if(_0x47f7b4[_0x288a('0xba')][_0x288a('0xc1')]){_0x45fdd3=new URL(_0x47f7b4[_0x288a('0xba')][_0x288a('0xc1')])[_0x288a('0x114')];}else if(_0x47f7b4[_0x288a('0xba')][_0x288a('0x114')]){_0x45fdd3=new URL(_0x47f7b4[_0x288a('0xba')][_0x288a('0x114')])[_0x288a('0x114')];}else{_0x45fdd3=_0x288a('0x115');}_0x450f42=typeof _0xb8b897[_0x288a('0x68')]['split'](',')[_0x288a('0x67')](function(_0x1376c1){return wildcardUtils[_0x288a('0x116')](_0x1376c1,_0x45fdd3);})!=='undefined';var _0x57ea42={'chatVersion':_0x227020,'chatWebsiteAddressOrigin':_0x450f42?_0x45fdd3:_0xb8b897[_0x288a('0x68')],'remote':_0xb8b897[_0x288a('0x117')],'query':querystring['stringify'](_['merge'](_0xb8b897[_0x288a('0x2d')]({'plain':!![]}),{'customerIp':_0x47f7b4[_0x288a('0xba')]['x-forwarded-for']||_0x47f7b4['headers'][_0x288a('0x118')]||_0x47f7b4[_0x288a('0x119')][_0x288a('0x11a')]||_0x47f7b4['ip'],'referer':_0x47f7b4['headers'][_0x288a('0xc1')],'openedInteractions':_0x315449,'maxInteractions':_0x3bb691,'virtual':_0x48f8de['virtual'],'online':_0x2c2e74,'custom':_0x48f8de,'address':_0x450f42?_0x45fdd3:null}))[_0x288a('0x11b')](/'/g,'\x5c\x27')};_0x1c7869[_0x288a('0xda')](ejs[_0x288a('0xe4')](Mustache[_0x288a('0xe4')](_0x4fa6d6,_0x57ea42),{'proactiveActions':_0x4af911,'alignment':_0xb8b897[_0x288a('0x11c')],'verticalAlignment':_0xb8b897[_0x288a('0x11d')],'div_color':_0xb8b897[_0x288a('0x11e')],'labelText':_0xb8b897[_0x288a('0x11f')],'text_color':_0xb8b897[_0x288a('0x120')],'text_button_color':_0xb8b897[_0x288a('0x121')],'button_color':_0xb8b897[_0x288a('0x122')],'background_color':_0xb8b897['backgroundColor'],'hideWhenOffline':_0xb8b897[_0x288a('0x123')],'intervalId':_0xb8b897[_0x288a('0x124')],'isDevelopment':_0x1a8434,'chatVersion':_0x227020}));})[_0x288a('0x21')](handleError(_0x1c7869,null));};exports[_0x288a('0x125')]=function(_0x1a9e76,_0x48e0b8){var _0x14277f=_0x1a9e76[_0x288a('0x65')]['id'];var _0xfc454e=_0x1a9e76[_0x288a('0x6e')];var _0x2dc94a=0xc8;var _0x20f288=null;return db[_0x288a('0xeb')][_0x288a('0x126')]({'isolationLevel':db[_0x288a('0xeb')][_0x288a('0x127')][_0x288a('0x128')][_0x288a('0x129')]},function(_0x2e9cd2){return db['ChatWebsite'][_0x288a('0x7b')]({'where':{'id':_0x14277f},'transaction':_0x2e9cd2})[_0x288a('0x17')](function(_0x1df510){if(_0x1df510){return db['ChatApplication'][_0x288a('0x2c')]({'where':{'ChatWebsiteId':_0x14277f},'transaction':_0x2e9cd2})[_0x288a('0x17')](function(){var _0x41cc5a=_[_0x288a('0x4b')](_0xfc454e,function(_0x2e415f){_0x2e415f[_0x288a('0x78')]=_0x14277f;return _0x2e415f;});return db[_0x288a('0xaf')]['bulkCreate'](_0x41cc5a,{'transaction':_0x2e9cd2});});}else{_0x2dc94a=0x194;_0x20f288=[];}});})[_0x288a('0x17')](function(){if(_0x2dc94a!==0x194){return db[_0x288a('0xaf')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x14277f},'order':_0x288a('0xb6')})['then'](function(_0x1a95ce){_0x20f288=_0x1a95ce;});}})['catch'](function(_0x37a1b4){_0x2dc94a=0x1f4;logger[_0x288a('0x1c')](_0x37a1b4[_0x288a('0x31')]);if(_0x37a1b4['name']){delete _0x37a1b4['name'];}_0x20f288=_0x37a1b4;})[_0x288a('0x12a')](function(){if(_0x20f288===null){_0x48e0b8[_0x288a('0x30')](_0x2dc94a);}else{if(_0x2dc94a===0x1f4){_0x48e0b8[_0x288a('0x22')](_0x2dc94a)[_0x288a('0xda')](_0x20f288);}else{_0x48e0b8[_0x288a('0x22')](_0x2dc94a)['json'](_0x20f288);}}});};exports['getApplications']=function(_0x1fcfb5,_0x4f49ad){var _0x2d622b={};var _0x520ac4={};var _0x2b41c6;var _0x1946f0;return db[_0x288a('0x4c')]['findOne']({'where':{'id':_0x1fcfb5['params']['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x4f49ad,null))[_0x288a('0x17')](function(_0xaa0cae){if(_0xaa0cae){_0x2b41c6=_0xaa0cae;_0x520ac4[_0x288a('0x43')]=_[_0x288a('0x51')](db[_0x288a('0xaf')][_0x288a('0x4d')]);_0x520ac4[_0x288a('0x50')]=_[_0x288a('0x51')](_0x1fcfb5[_0x288a('0x50')]);_0x520ac4[_0x288a('0x5b')]=_['intersection'](_0x520ac4[_0x288a('0x43')],_0x520ac4['query']);_0x2d622b['attributes']=_[_0x288a('0x52')](_0x520ac4[_0x288a('0x43')],qs['fields'](_0x1fcfb5[_0x288a('0x50')]['fields']));_0x2d622b[_0x288a('0x53')]=_0x2d622b[_0x288a('0x53')][_0x288a('0x55')]?_0x2d622b['attributes']:_0x520ac4[_0x288a('0x43')];_0x2d622b['order']=qs[_0x288a('0x59')](_0x1fcfb5[_0x288a('0x50')][_0x288a('0x59')]);_0x2d622b[_0x288a('0x5a')]=qs[_0x288a('0x5b')](_[_0x288a('0x5c')](_0x1fcfb5[_0x288a('0x50')],_0x520ac4['filters']));if(_0x1fcfb5[_0x288a('0x50')][_0x288a('0x5f')]){_0x2d622b[_0x288a('0x5a')]=_[_0x288a('0x5d')](_0x2d622b[_0x288a('0x5a')],{'$or':_[_0x288a('0x4b')](_0x2d622b['attributes'],function(_0x4a84c0){var _0x5eafee={};_0x5eafee[_0x4a84c0]={'$like':'%'+_0x1fcfb5['query']['filter']+'%'};return _0x5eafee;})});}_0x2d622b=_[_0x288a('0x5d')]({},_0x2d622b,_0x1fcfb5[_0x288a('0x66')]);return _0x2b41c6[_0x288a('0x12b')](_0x2d622b);}})[_0x288a('0x17')](function(_0x4bf33b){if(_0x4bf33b){_0x1946f0=_0x4bf33b[_0x288a('0x55')];if(!_0x1fcfb5[_0x288a('0x50')][_0x288a('0x56')]('nolimit')){_0x2d622b[_0x288a('0x26')]=qs[_0x288a('0x26')](_0x1fcfb5['query']['limit']);_0x2d622b['offset']=qs[_0x288a('0x25')](_0x1fcfb5[_0x288a('0x50')][_0x288a('0x25')]);}return _0x2b41c6[_0x288a('0x12b')](_0x2d622b);}})[_0x288a('0x17')](function(_0x3e7e18){if(_0x3e7e18){return _0x3e7e18?{'count':_0x1946f0,'rows':_0x3e7e18}:null;}})[_0x288a('0x17')](respondWithResult(_0x4f49ad,null))['catch'](handleError(_0x4f49ad,null));};exports[_0x288a('0x12c')]=function(_0x493368,_0x23ffb8){return db['chatProactiveAction'][_0x288a('0x67')]({'where':{'id':_0x493368[_0x288a('0x65')]['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x23ffb8,null))[_0x288a('0x17')](function(_0x32abd7){if(_0x32abd7){return _0x32abd7['addProactiveActions'](_0x493368[_0x288a('0x6e')][_0x288a('0x81')],_[_0x288a('0x103')](_0x493368[_0x288a('0x6e')],['ids','id'])||{});}})[_0x288a('0x17')](respondWithResult(_0x23ffb8,null))['catch'](handleError(_0x23ffb8,null));};exports[_0x288a('0x10c')]=function(_0x506cc6,_0x38e950){var _0x1954df={};var _0x278207={};var _0x151da9;var _0x3f59de;return db[_0x288a('0x4c')][_0x288a('0x7b')]({'where':{'id':_0x506cc6['params']['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x38e950,null))[_0x288a('0x17')](function(_0x41fbec){if(_0x41fbec){_0x151da9=_0x41fbec;_0x278207[_0x288a('0x43')]=_[_0x288a('0x51')](db[_0x288a('0x12d')]['rawAttributes']);_0x278207[_0x288a('0x50')]=_['keys'](_0x506cc6[_0x288a('0x50')]);_0x278207[_0x288a('0x5b')]=_[_0x288a('0x52')](_0x278207[_0x288a('0x43')],_0x278207[_0x288a('0x50')]);_0x1954df[_0x288a('0x53')]=_[_0x288a('0x52')](_0x278207[_0x288a('0x43')],qs[_0x288a('0x54')](_0x506cc6[_0x288a('0x50')][_0x288a('0x54')]));_0x1954df[_0x288a('0x53')]=_0x1954df[_0x288a('0x53')]['length']?_0x1954df[_0x288a('0x53')]:_0x278207[_0x288a('0x43')];_0x1954df[_0x288a('0x58')]=qs[_0x288a('0x59')](_0x506cc6[_0x288a('0x50')][_0x288a('0x59')]);_0x1954df[_0x288a('0x5a')]=qs[_0x288a('0x5b')](_[_0x288a('0x5c')](_0x506cc6[_0x288a('0x50')],_0x278207[_0x288a('0x5b')]));if(_0x506cc6[_0x288a('0x50')][_0x288a('0x5f')]){_0x1954df[_0x288a('0x5a')]=_[_0x288a('0x5d')](_0x1954df[_0x288a('0x5a')],{'$or':_[_0x288a('0x4b')](_0x1954df[_0x288a('0x53')],function(_0x164d65){var _0x3caffa={};_0x3caffa[_0x164d65]={'$like':'%'+_0x506cc6[_0x288a('0x50')][_0x288a('0x5f')]+'%'};return _0x3caffa;})});}_0x1954df=_['merge']({},_0x1954df,_0x506cc6[_0x288a('0x66')]);return _0x151da9[_0x288a('0x10c')](_0x1954df);}})[_0x288a('0x17')](function(_0x407f59){if(_0x407f59){_0x3f59de=_0x407f59[_0x288a('0x55')];if(!_0x506cc6['query'][_0x288a('0x56')](_0x288a('0x57'))){_0x1954df[_0x288a('0x26')]=qs[_0x288a('0x26')](_0x506cc6[_0x288a('0x50')][_0x288a('0x26')]);_0x1954df['offset']=qs[_0x288a('0x25')](_0x506cc6['query'][_0x288a('0x25')]);}return _0x151da9[_0x288a('0x10c')](_0x1954df);}})[_0x288a('0x17')](function(_0xfe933f){if(_0xfe933f){return _0xfe933f?{'count':_0x3f59de,'rows':_0xfe933f}:null;}})[_0x288a('0x17')](respondWithResult(_0x38e950,null))[_0x288a('0x21')](handleError(_0x38e950,null));};exports[_0x288a('0x12e')]=function(_0x33091f,_0x243833){var _0x5e3701=_0x33091f['query']['online']==='false'?_0x288a('0x12f'):_0x288a('0x130');return db[_0x288a('0x4c')]['find']({'attributes':['id',_0x5e3701],'where':{'id':_0x33091f['params']['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x243833,null))[_0x288a('0x17')](function(_0x373f3c){if(_0x373f3c){var _0x5e71c6=_0x373f3c[_0x5e3701];var _0x2dc265=_0x5e71c6&&_0x5e71c6['items']?_0x5e71c6[_0x288a('0x131')]:[];_0x243833[_0x288a('0xda')]({'fromKey':_['isNil'](_0x5e71c6['fromKey'])?undefined:_0x5e71c6[_0x288a('0x132')],'count':_0x2dc265[_0x288a('0x55')],'rows':_0x2dc265});}})[_0x288a('0x21')](handleError(_0x243833,null));};exports[_0x288a('0x133')]=function(_0x56b511,_0x292795){var _0xf879fd={'raw':![],'where':{}};var _0x23103e={};var _0x52cd8e={'count':0x0,'rows':[]};return db[_0x288a('0x4c')][_0x288a('0x7b')]({'where':{'id':_0x56b511[_0x288a('0x65')]['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x292795,null))['then'](function(_0x3dd59c){if(_0x3dd59c){_0x23103e[_0x288a('0x43')]=_[_0x288a('0x51')](db[_0x288a('0xe5')][_0x288a('0x4d')]);_0x23103e[_0x288a('0x50')]=_['keys'](_0x56b511[_0x288a('0x50')]);_0x23103e[_0x288a('0x5b')]=_[_0x288a('0x52')](_0x23103e[_0x288a('0x43')],_0x23103e[_0x288a('0x50')]);_0xf879fd['attributes']=_['intersection'](_0x23103e[_0x288a('0x43')],qs[_0x288a('0x54')](_0x56b511[_0x288a('0x50')][_0x288a('0x54')]));_0xf879fd[_0x288a('0x53')]=_0xf879fd[_0x288a('0x53')][_0x288a('0x55')]?_0xf879fd[_0x288a('0x53')]:_0x23103e[_0x288a('0x43')];if(!_0x56b511[_0x288a('0x50')][_0x288a('0x56')](_0x288a('0x57'))){_0xf879fd['limit']=qs[_0x288a('0x26')](_0x56b511[_0x288a('0x50')][_0x288a('0x26')]);_0xf879fd[_0x288a('0x25')]=qs[_0x288a('0x25')](_0x56b511[_0x288a('0x50')]['offset']);}_0xf879fd[_0x288a('0x58')]=qs['sort'](_0x56b511[_0x288a('0x50')]['sort']);_0xf879fd['where']=qs[_0x288a('0x5b')](_[_0x288a('0x5c')](_0x56b511[_0x288a('0x50')],_0x23103e['filters']));_0xf879fd['where'][_0x288a('0x78')]=_0x3dd59c['id'];if(_0x56b511['query']['filter']){_0xf879fd[_0x288a('0x5a')]=_[_0x288a('0x5d')](_0xf879fd['where'],{'$or':_['map'](_0xf879fd[_0x288a('0x53')],function(_0x4d80c5){var _0x9a3288={};_0x9a3288[_0x4d80c5]={'$like':'%'+_0x56b511['query'][_0x288a('0x5f')]+'%'};return _0x9a3288;})});}_0xf879fd=_[_0x288a('0x5d')]({},_0xf879fd,_0x56b511[_0x288a('0x66')]);return db['ChatOfflineMessage'][_0x288a('0x28')]({'where':_0xf879fd[_0x288a('0x5a')]})[_0x288a('0x17')](function(_0x407a6){_0x52cd8e[_0x288a('0x28')]=_0x407a6;if(_0x56b511['query'][_0x288a('0x60')]){_0xf879fd[_0x288a('0x61')]=[{'all':!![]}];}else{_0xf879fd[_0x288a('0x61')]=[{'model':db[_0x288a('0xa6')],'as':_0x288a('0x105'),'required':![]},{'model':db['Attachment'],'as':_0x288a('0x134'),'required':![]}];}return db[_0x288a('0xe5')]['findAll'](_0xf879fd);})[_0x288a('0x17')](function(_0x140430){_0x52cd8e['rows']=_0x140430;return _0x52cd8e;});}})['then'](respondWithFilteredResult(_0x292795,_0xf879fd))[_0x288a('0x21')](handleError(_0x292795,null));};exports[_0x288a('0x135')]=function(_0x1d0cb8,_0x4551a9){return db[_0x288a('0x4c')][_0x288a('0x67')]({'where':{'id':_0x1d0cb8['params']['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x4551a9,null))['then'](function(_0x5b0530){if(_0x5b0530){return _0x5b0530['addAgents'](_0x1d0cb8[_0x288a('0x6e')][_0x288a('0x81')],_[_0x288a('0x103')](_0x1d0cb8[_0x288a('0x6e')],['ids','id'])||{})['spread'](function(_0x128aa5){for(var _0x1eed5e=0x0;_0x1eed5e<_0x1d0cb8[_0x288a('0x6e')][_0x288a('0x81')][_0x288a('0x55')];_0x1eed5e+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x1d0cb8[_0x288a('0x6e')]['ids'][_0x1eed5e]),'ChatWebsiteId':Number(_0x1d0cb8['params']['id'])});}return _0x128aa5;});}})[_0x288a('0x17')](respondWithResult(_0x4551a9,null))[_0x288a('0x21')](handleError(_0x4551a9,null));};exports[_0x288a('0x136')]=function(_0x4fc010,_0x320a12){return db[_0x288a('0x4c')][_0x288a('0x67')]({'where':{'id':_0x4fc010['params']['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x320a12,null))[_0x288a('0x17')](function(_0x2d3676){if(_0x2d3676){return _0x2d3676[_0x288a('0x136')](_0x4fc010['query'][_0x288a('0x81')])[_0x288a('0x17')](function(){if(_[_0x288a('0x137')](_0x4fc010['query'][_0x288a('0x81')])){for(var _0x323d8d=0x0;_0x323d8d<_0x4fc010[_0x288a('0x50')][_0x288a('0x81')][_0x288a('0x55')];_0x323d8d+=0x1){socket['emit'](_0x288a('0x138'),{'UserId':Number(_0x4fc010['query'][_0x288a('0x81')][_0x323d8d]),'ChatWebsiteId':Number(_0x4fc010[_0x288a('0x65')]['id'])});}}else{socket['emit'](_0x288a('0x138'),{'UserId':Number(_0x4fc010[_0x288a('0x50')][_0x288a('0x81')]),'ChatWebsiteId':Number(_0x4fc010[_0x288a('0x65')]['id'])});}});}})['then'](respondWithStatusCode(_0x320a12,null))['catch'](handleError(_0x320a12,null));};exports[_0x288a('0x139')]=function(_0x52abd7,_0x57b9fb){var _0x277042={};var _0x5b8eb8={};var _0x1b099b;var _0x65354c;return db[_0x288a('0x4c')][_0x288a('0x7b')]({'where':{'id':_0x52abd7[_0x288a('0x65')]['id']}})[_0x288a('0x17')](handleEntityNotFound(_0x57b9fb,null))[_0x288a('0x17')](function(_0x5791df){if(_0x5791df){_0x1b099b=_0x5791df;_0x5b8eb8[_0x288a('0x43')]=_['keys'](db[_0x288a('0xca')]['rawAttributes']);_0x5b8eb8[_0x288a('0x50')]=_[_0x288a('0x51')](_0x52abd7[_0x288a('0x50')]);_0x5b8eb8[_0x288a('0x5b')]=_[_0x288a('0x52')](_0x5b8eb8[_0x288a('0x43')],_0x5b8eb8['query']);_0x277042[_0x288a('0x53')]=_['intersection'](_0x5b8eb8['model'],qs['fields'](_0x52abd7['query']['fields']));_0x277042['attributes']=_0x277042[_0x288a('0x53')][_0x288a('0x55')]?_0x277042['attributes']:_0x5b8eb8[_0x288a('0x43')];_0x277042[_0x288a('0x58')]=qs[_0x288a('0x59')](_0x52abd7['query'][_0x288a('0x59')]);_0x277042['where']=qs['filters'](_[_0x288a('0x5c')](_0x52abd7[_0x288a('0x50')],_0x5b8eb8[_0x288a('0x5b')]));if(_0x52abd7[_0x288a('0x50')][_0x288a('0x5f')]){_0x277042[_0x288a('0x5a')]=_[_0x288a('0x5d')](_0x277042['where'],{'$or':_[_0x288a('0x4b')](_0x277042[_0x288a('0x53')],function(_0x1ad8fc){var _0x199cd9={};_0x199cd9[_0x1ad8fc]={'$like':'%'+_0x52abd7[_0x288a('0x50')][_0x288a('0x5f')]+'%'};return _0x199cd9;})});}_0x277042=_['merge']({},_0x277042,_0x52abd7[_0x288a('0x66')]);return _0x1b099b[_0x288a('0x139')](_0x277042);}})[_0x288a('0x17')](function(_0x220d24){if(_0x220d24){_0x65354c=_0x220d24[_0x288a('0x55')];if(!_0x52abd7[_0x288a('0x50')][_0x288a('0x56')](_0x288a('0x57'))){_0x277042['limit']=qs[_0x288a('0x26')](_0x52abd7[_0x288a('0x50')][_0x288a('0x26')]);_0x277042[_0x288a('0x25')]=qs[_0x288a('0x25')](_0x52abd7[_0x288a('0x50')][_0x288a('0x25')]);}return _0x1b099b[_0x288a('0x139')](_0x277042);}})[_0x288a('0x17')](function(_0x5e004b){if(_0x5e004b){return _0x5e004b?{'count':_0x65354c,'rows':_0x5e004b}:null;}})[_0x288a('0x17')](respondWithResult(_0x57b9fb,null))['catch'](handleError(_0x57b9fb,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 16db670..07f27bb 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 _0xe599=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x188b59,_0x31709d){var _0x3a7f03=function(_0x3729f9){while(--_0x3729f9){_0x188b59['push'](_0x188b59['shift']());}};_0x3a7f03(++_0x31709d);}(_0xe599,0x1e5));var _0x9e59=function(_0x528576,_0x445613){_0x528576=_0x528576-0x0;var _0x3a4d89=_0xe599[_0x528576];return _0x3a4d89;};'use strict';var EventEmitter=require(_0x9e59('0x0'));var ChatWebsite=require(_0x9e59('0x1'))['db'][_0x9e59('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9e59('0x3')](0x0);var events={'afterCreate':_0x9e59('0x4'),'afterUpdate':_0x9e59('0x5'),'afterDestroy':_0x9e59('0x6')};function emitEvent(_0x296a98){return function(_0x3b40cc,_0x568c08,_0x156af6){ChatWebsiteEvents[_0x9e59('0x7')](_0x296a98+':'+_0x3b40cc['id'],_0x3b40cc);ChatWebsiteEvents['emit'](_0x296a98,_0x3b40cc);_0x156af6(null);};}for(var e in events){if(events[_0x9e59('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x9e59('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xb2b5=['emit','hasOwnProperty','hook','save','update'];(function(_0x38699b,_0x3872cd){var _0x534902=function(_0x5ed6c5){while(--_0x5ed6c5){_0x38699b['push'](_0x38699b['shift']());}};_0x534902(++_0x3872cd);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xb2b5[_0x45d55e];return _0x29812a;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5b2b('0x0'),'afterUpdate':_0x5b2b('0x1'),'afterDestroy':'remove'};function emitEvent(_0x4eee87){return function(_0x31784d,_0x11fae1,_0x51e747){ChatWebsiteEvents[_0x5b2b('0x2')](_0x4eee87+':'+_0x31784d['id'],_0x31784d);ChatWebsiteEvents['emit'](_0x4eee87,_0x31784d);_0x51e747(null);};}for(var e in events){if(events[_0x5b2b('0x3')](e)){var event=events[e];ChatWebsite[_0x5b2b('0x4')](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 faf7481..836022b 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 _0xb681=['rimraf','exports','chat_websites','lodash','util','../../config/logger','moment'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xb681,0xce));var _0x1b68=function(_0xc27c67,_0x9c5393){_0xc27c67=_0xc27c67-0x0;var _0x308291=_0xb681[_0xc27c67];return _0x308291;};'use strict';var _=require(_0x1b68('0x0'));var util=require(_0x1b68('0x1'));var logger=require(_0x1b68('0x2'))('api');var moment=require(_0x1b68('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b68('0x4'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x1b68('0x5')]=function(_0x34e31b,_0x111ffe){return _0x34e31b['define']('ChatWebsite',attributes,{'tableName':_0x1b68('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb39=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','bluebird'];(function(_0x270b9d,_0x8e1c){var _0x32ac0c=function(_0x497809){while(--_0x497809){_0x270b9d['push'](_0x270b9d['shift']());}};_0x32ac0c(++_0x8e1c);}(_0xcb39,0x18f));var _0x9cb3=function(_0x350aeb,_0x3d265a){_0x350aeb=_0x350aeb-0x0;var _0x3c5273=_0xcb39[_0x350aeb];return _0x3c5273;};'use strict';var _=require(_0x9cb3('0x0'));var util=require(_0x9cb3('0x1'));var logger=require(_0x9cb3('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9cb3('0x3'));var rp=require(_0x9cb3('0x4'));var fs=require('fs');var path=require(_0x9cb3('0x5'));var rimraf=require(_0x9cb3('0x6'));var config=require(_0x9cb3('0x7'));var attributes=require(_0x9cb3('0x8'));module[_0x9cb3('0x9')]=function(_0x5441b5,_0x28765c){return _0x5441b5[_0x9cb3('0xa')](_0x9cb3('0xb'),attributes,{'tableName':_0x9cb3('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 fe92000..16193b3 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 _0x15fb=['result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x2181b1,_0x569637){var _0x530548=function(_0x4b31f1){while(--_0x4b31f1){_0x2181b1['push'](_0x2181b1['shift']());}};_0x530548(++_0x569637);}(_0x15fb,0xc9));var _0xb15f=function(_0x933505,_0x59b767){_0x933505=_0x933505-0x0;var _0x44a019=_0x15fb[_0x933505];return _0x44a019;};'use strict';var _=require(_0xb15f('0x0'));var util=require('util');var moment=require(_0xb15f('0x1'));var BPromise=require('bluebird');var rs=require(_0xb15f('0x2'));var fs=require('fs');var Redis=require(_0xb15f('0x3'));var db=require(_0xb15f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb15f('0x5'))('rpc');var config=require(_0xb15f('0x6'));var jayson=require(_0xb15f('0x7'));var client=jayson[_0xb15f('0x8')]['http']({'port':0x232a});config[_0xb15f('0x9')]=_['defaults'](config[_0xb15f('0x9')],{'host':_0xb15f('0xa'),'port':0x18eb});var socket=require(_0xb15f('0xb'))(new Redis(config['redis']));require(_0xb15f('0xc'))[_0xb15f('0xd')](socket);function respondWithRpcPromise(_0x22055d,_0x2af58f,_0x41c1fd){return new BPromise(function(_0x4820be,_0x47a821){return client[_0xb15f('0xe')](_0x22055d,_0x41c1fd)[_0xb15f('0xf')](function(_0x509f81){logger[_0xb15f('0x10')](_0xb15f('0x11'),_0x2af58f,_0xb15f('0x12'));logger[_0xb15f('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2af58f,_0xb15f('0x12'),JSON[_0xb15f('0x14')](_0x509f81));if(_0x509f81['error']){if(_0x509f81[_0xb15f('0x15')][_0xb15f('0x16')]===0x1f4){logger[_0xb15f('0x15')](_0xb15f('0x11'),_0x2af58f,_0x509f81['error'][_0xb15f('0x17')]);return _0x47a821(_0x509f81[_0xb15f('0x15')]['message']);}logger[_0xb15f('0x15')](_0xb15f('0x11'),_0x2af58f,_0x509f81[_0xb15f('0x15')][_0xb15f('0x17')]);return _0x4820be(_0x509f81[_0xb15f('0x15')]['message']);}else{logger[_0xb15f('0x10')](_0xb15f('0x11'),_0x2af58f,_0xb15f('0x12'));_0x4820be(_0x509f81[_0xb15f('0x18')]['message']);}})['catch'](function(_0x288e64){logger[_0xb15f('0x15')](_0xb15f('0x11'),_0x2af58f,_0x288e64);_0x47a821(_0x288e64);});});}
\ No newline at end of file
+var _0xf274=['info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0xef4ef0,_0x3c72f9){var _0x39b60b=function(_0x1d824c){while(--_0x1d824c){_0xef4ef0['push'](_0xef4ef0['shift']());}};_0x39b60b(++_0x3c72f9);}(_0xf274,0x1e2));var _0x4f27=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xf274[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x4f27('0x0'));var util=require(_0x4f27('0x1'));var moment=require(_0x4f27('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f27('0x3'));var fs=require('fs');var Redis=require(_0x4f27('0x4'));var db=require(_0x4f27('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f27('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4f27('0x7'));var client=jayson['client'][_0x4f27('0x8')]({'port':0x232a});config[_0x4f27('0x9')]=_[_0x4f27('0xa')](config[_0x4f27('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4f27('0xb'))(new Redis(config[_0x4f27('0x9')]));require(_0x4f27('0xc'))[_0x4f27('0xd')](socket);function respondWithRpcPromise(_0x48e4a7,_0x1bad82,_0x381d17){return new BPromise(function(_0x1a4fe8,_0x40ca6e){return client[_0x4f27('0xe')](_0x48e4a7,_0x381d17)[_0x4f27('0xf')](function(_0x552560){logger['info'](_0x4f27('0x10'),_0x1bad82,_0x4f27('0x11'));logger[_0x4f27('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1bad82,'request\x20sent',JSON['stringify'](_0x552560));if(_0x552560[_0x4f27('0x13')]){if(_0x552560['error'][_0x4f27('0x14')]===0x1f4){logger[_0x4f27('0x13')](_0x4f27('0x10'),_0x1bad82,_0x552560[_0x4f27('0x13')]['message']);return _0x40ca6e(_0x552560[_0x4f27('0x13')]['message']);}logger[_0x4f27('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x1bad82,_0x552560['error']['message']);return _0x1a4fe8(_0x552560[_0x4f27('0x13')][_0x4f27('0x15')]);}else{logger[_0x4f27('0x16')](_0x4f27('0x10'),_0x1bad82,'request\x20sent');_0x1a4fe8(_0x552560[_0x4f27('0x17')]['message']);}})['catch'](function(_0x2e47e8){logger[_0x4f27('0x13')](_0x4f27('0x10'),_0x1bad82,_0x2e47e8);_0x40ca6e(_0x2e47e8);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 3398d7b..ea680c1 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 _0x73c4=['save','remove','update','emit','length','chatWebsite:','./chatWebsite.events'];(function(_0x24d632,_0x41030b){var _0x4d9e06=function(_0x18c58c){while(--_0x18c58c){_0x24d632['push'](_0x24d632['shift']());}};_0x4d9e06(++_0x41030b);}(_0x73c4,0x1db));var _0x473c=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x73c4[_0x1c546c];return _0x2cc384;};'use strict';var ChatWebsiteEvents=require(_0x473c('0x0'));var events=[_0x473c('0x1'),_0x473c('0x2'),_0x473c('0x3')];function createListener(_0x3a06e8,_0x525a15){return function(_0xc3a617){_0x525a15[_0x473c('0x4')](_0x3a06e8,_0xc3a617);};}function removeListener(_0x1fbdbd,_0x430e88){return function(){ChatWebsiteEvents['removeListener'](_0x1fbdbd,_0x430e88);};}exports['register']=function(_0xe98fe7){for(var _0x4e6ba1=0x0,_0x4a5db3=events[_0x473c('0x5')];_0x4e6ba1<_0x4a5db3;_0x4e6ba1++){var _0x313400=events[_0x4e6ba1];var _0x246aba=createListener(_0x473c('0x6')+_0x313400,_0xe98fe7);ChatWebsiteEvents['on'](_0x313400,_0x246aba);}};
\ No newline at end of file
+var _0x1f43=['save','remove','update','emit','register','length'];(function(_0x4af172,_0x44c861){var _0x4ad3ab=function(_0x4b28eb){while(--_0x4b28eb){_0x4af172['push'](_0x4af172['shift']());}};_0x4ad3ab(++_0x44c861);}(_0x1f43,0x72));var _0x31f4=function(_0x280447,_0x3b2093){_0x280447=_0x280447-0x0;var _0x420280=_0x1f43[_0x280447];return _0x420280;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x31f4('0x0'),_0x31f4('0x1'),_0x31f4('0x2')];function createListener(_0x3b2aef,_0x2882c4){return function(_0xa572f8){_0x2882c4[_0x31f4('0x3')](_0x3b2aef,_0xa572f8);};}function removeListener(_0x217087,_0x23d83c){return function(){ChatWebsiteEvents['removeListener'](_0x217087,_0x23d83c);};}exports[_0x31f4('0x4')]=function(_0x12ed82){for(var _0x5d00fe=0x0,_0x3086ee=events[_0x31f4('0x5')];_0x5d00fe<_0x3086ee;_0x5d00fe++){var _0x597240=events[_0x5d00fe];var _0x4188a6=createListener('chatWebsite:'+_0x597240,_0x12ed82);ChatWebsiteEvents['on'](_0x597240,_0x4188a6);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index 268f15e..201c758 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf417=['url','URL','replace','test','exports','escapeRegExp'];(function(_0x144345,_0x317f74){var _0x6fb2aa=function(_0x4c776e){while(--_0x4c776e){_0x144345['push'](_0x144345['shift']());}};_0x6fb2aa(++_0x317f74);}(_0xf417,0x8f));var _0x7f41=function(_0x274f5d,_0x6874dd){_0x274f5d=_0x274f5d-0x0;var _0x1d21ca=_0xf417[_0x274f5d];return _0x1d21ca;};var escapeRegExp=require('../../../utils/misc')[_0x7f41('0x0')];var URL=require(_0x7f41('0x1'))[_0x7f41('0x2')];function testWildcardValidity(_0x57aab7){var _0x85053=!![];try{new URL(_0x57aab7['replace']('*','localhost'));}catch(_0x2b7d4c){_0x85053=![];}return _0x85053&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0x57aab7);}function testWebsiteWithWildcard(_0x51b0cb,_0x5ad014){var _0x5ecdb2;var _0x1775d8=escapeRegExp(_0x51b0cb['trim']()[_0x7f41('0x3')](/\/$/,''))[_0x7f41('0x3')]('\x5c*','([\x5cw]+)');try{new URL(_0x51b0cb[_0x7f41('0x3')]('\x5c*','localhost'));_0x5ecdb2=new RegExp(_0x1775d8)[_0x7f41('0x4')](_0x5ad014);}catch(_0x5f3a44){_0x5ecdb2=![];}return _0x5ecdb2;}module[_0x7f41('0x5')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x2da6=['URL','replace','localhost','trim','([\x5cw]+)','test','exports','../../../utils/misc','escapeRegExp','url'];(function(_0x453603,_0x26991d){var _0x3f28e3=function(_0x2a0784){while(--_0x2a0784){_0x453603['push'](_0x453603['shift']());}};_0x3f28e3(++_0x26991d);}(_0x2da6,0x1dd));var _0x62da=function(_0x5250a6,_0x435e5a){_0x5250a6=_0x5250a6-0x0;var _0x2fc3f4=_0x2da6[_0x5250a6];return _0x2fc3f4;};var escapeRegExp=require(_0x62da('0x0'))[_0x62da('0x1')];var URL=require(_0x62da('0x2'))[_0x62da('0x3')];function testWildcardValidity(_0xd62c5c){var _0x12b8ad=!![];try{new URL(_0xd62c5c[_0x62da('0x4')]('*',_0x62da('0x5')));}catch(_0x4c079d){_0x12b8ad=![];}return _0x12b8ad&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0xd62c5c);}function testWebsiteWithWildcard(_0xe28204,_0x3163df){var _0x3a59f8;var _0x30437f=escapeRegExp(_0xe28204[_0x62da('0x6')]()[_0x62da('0x4')](/\/$/,''))[_0x62da('0x4')]('\x5c*',_0x62da('0x7'));try{new URL(_0xe28204[_0x62da('0x4')]('\x5c*','localhost'));_0x3a59f8=new RegExp(_0x30437f)[_0x62da('0x8')](_0x3163df);}catch(_0x2a3937){_0x3a59f8=![];}return _0x3a59f8;}module[_0x62da('0x9')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 9d028a9..3ffb6d3 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 _0xc56f=['express','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','now','single','server/files/images/avatars/','originalname','file','addAvatar','addCustomerAvatar','addSystemAvatar','notify','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','multer','util','path','connect-timeout'];(function(_0x353847,_0x5c84de){var _0x40d8a6=function(_0x221958){while(--_0x221958){_0x353847['push'](_0x353847['shift']());}};_0x40d8a6(++_0x5c84de);}(_0xc56f,0x118));var _0xfc56=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xc56f[_0x2faddb];return _0x273c05;};'use strict';var multer=require(_0xfc56('0x0'));var util=require(_0xfc56('0x1'));var path=require(_0xfc56('0x2'));var timeout=require(_0xfc56('0x3'));var express=require(_0xfc56('0x4'));var router=express['Router']();var fs_extra=require(_0xfc56('0x5'));var auth=require(_0xfc56('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfc56('0x7'));var controller=require(_0xfc56('0x8'));router[_0xfc56('0x9')]('/',auth[_0xfc56('0xa')](),controller[_0xfc56('0xb')]);router[_0xfc56('0x9')](_0xfc56('0xc'),auth['isAuthenticated'](),controller[_0xfc56('0xd')]);router[_0xfc56('0x9')](_0xfc56('0xe'),auth[_0xfc56('0xa')](),controller[_0xfc56('0xf')]);router[_0xfc56('0x9')](_0xfc56('0x10'),auth[_0xfc56('0xa')](),controller[_0xfc56('0x11')]);router[_0xfc56('0x9')](_0xfc56('0x12'),auth['isAuthenticated'](),controller[_0xfc56('0x13')]);router['get'](_0xfc56('0x14'),controller[_0xfc56('0x15')]);router[_0xfc56('0x9')](_0xfc56('0x16'),controller[_0xfc56('0x17')]);router['get'](_0xfc56('0x18'),controller[_0xfc56('0x19')]);router[_0xfc56('0x9')](_0xfc56('0x1a'),controller['getSystemAvatar']);router[_0xfc56('0x9')](_0xfc56('0x1b'),auth['isAuthenticated'](),controller[_0xfc56('0x1c')]);router[_0xfc56('0x9')]('/:id/snippet',controller[_0xfc56('0x1d')]);router[_0xfc56('0x9')](_0xfc56('0x1e'),auth[_0xfc56('0xa')](),controller[_0xfc56('0x1f')]);router[_0xfc56('0x9')](_0xfc56('0x20'),auth[_0xfc56('0xa')](),controller[_0xfc56('0x21')]);router[_0xfc56('0x9')]('/:id/fields',controller[_0xfc56('0x22')]);router['get'](_0xfc56('0x23'),auth['isAuthenticated'](),controller[_0xfc56('0x24')]);router['get'](_0xfc56('0x25'),auth[_0xfc56('0xa')](),controller['getAgents']);router[_0xfc56('0x26')]('/',auth[_0xfc56('0xa')](),controller[_0xfc56('0x27')]);router[_0xfc56('0x26')](_0xfc56('0x10'),auth[_0xfc56('0xa')](),controller[_0xfc56('0x28')]);router['post']('/:id/canned_answers',auth[_0xfc56('0xa')](),controller[_0xfc56('0x29')]);var upload=multer({'storage':multer[_0xfc56('0x2a')]({'destination':function(_0x56ef64,_0x3e42ec,_0x564025){_0x564025(null,path[_0xfc56('0x2b')](config[_0xfc56('0x2c')],'server/files/images/logos/'));},'filename':function(_0x458d55,_0x4df009,_0x12e3a1){_0x12e3a1(null,util[_0xfc56('0x2d')](_0xfc56('0x2e'),Date[_0xfc56('0x2f')](),_0x4df009['originalname']));}})});router[_0xfc56('0x26')](_0xfc56('0x14'),upload[_0xfc56('0x30')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xf22686,_0x1f18fd,_0x28346f){_0x28346f(null,path['join'](config[_0xfc56('0x2c')],_0xfc56('0x31')));},'filename':function(_0x55cbc1,_0x5095c1,_0x171b2c){_0x171b2c(null,util['format'](_0xfc56('0x2e'),Date[_0xfc56('0x2f')](),_0x5095c1[_0xfc56('0x32')]));}})});router['post']('/:id/avatar',upload[_0xfc56('0x30')](_0xfc56('0x33')),controller[_0xfc56('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b9a9c,_0x30bac4,_0x14cad2){_0x14cad2(null,path[_0xfc56('0x2b')](config[_0xfc56('0x2c')],_0xfc56('0x31')));},'filename':function(_0x19535d,_0x481205,_0x4eb6d8){_0x4eb6d8(null,util[_0xfc56('0x2d')](_0xfc56('0x2e'),Date[_0xfc56('0x2f')](),_0x481205[_0xfc56('0x32')]));}})});router[_0xfc56('0x26')](_0xfc56('0x18'),upload[_0xfc56('0x30')](_0xfc56('0x33')),controller[_0xfc56('0x35')]);var upload=multer({'storage':multer[_0xfc56('0x2a')]({'destination':function(_0x17e395,_0x6c85e1,_0x5597fe){_0x5597fe(null,path[_0xfc56('0x2b')](config[_0xfc56('0x2c')],_0xfc56('0x31')));},'filename':function(_0x2b9785,_0x37699c,_0x273971){_0x273971(null,util[_0xfc56('0x2d')](_0xfc56('0x2e'),Date[_0xfc56('0x2f')](),_0x37699c[_0xfc56('0x32')]));}})});router[_0xfc56('0x26')](_0xfc56('0x1a'),upload['single']('file'),controller[_0xfc56('0x36')]);router[_0xfc56('0x26')]('/:id/notify',controller[_0xfc56('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0xfc56('0x2a')]({'destination':function(_0x1349f0,_0x2091d1,_0x9ba519){const _0x4e9bdd=path[_0xfc56('0x2b')](config[_0xfc56('0x2c')],'server/files',_0xfc56('0x38'),_0xfc56('0x39'));fs_extra['ensureDir'](_0x4e9bdd,function(){_0x9ba519(null,_0x4e9bdd);});},'filename':function(_0x164359,_0x33b060,_0x2933d2){const _0x4f9d9e=_0x33b060[_0xfc56('0x32')][_0xfc56('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5e8bb1=path[_0xfc56('0x3b')](_0x4f9d9e);const _0x75203a=Date[_0xfc56('0x2f')]()+'-'+_0x4f9d9e[_0xfc56('0x3a')](_0x5e8bb1,'')+_0x5e8bb1;_0x2933d2(null,_0x75203a);}})});router['post'](_0xfc56('0x3c'),offlineUploadMulter[_0xfc56('0x3d')](),controller[_0xfc56('0x3e')]);router[_0xfc56('0x26')](_0xfc56('0x1b'),auth['isAuthenticated'](),controller[_0xfc56('0x3f')]);router['post']('/:id/applications',auth[_0xfc56('0xa')](),controller['addApplications']);router[_0xfc56('0x26')](_0xfc56('0x20'),auth[_0xfc56('0xa')](),controller['addProactiveActions']);router['post'](_0xfc56('0x25'),auth[_0xfc56('0xa')](),controller[_0xfc56('0x40')]);router[_0xfc56('0x41')](_0xfc56('0xe'),auth[_0xfc56('0xa')](),controller[_0xfc56('0x42')]);router[_0xfc56('0x43')]('/:id',auth[_0xfc56('0xa')](),controller[_0xfc56('0x44')]);router[_0xfc56('0x43')]('/:id/dispositions',auth[_0xfc56('0xa')](),controller[_0xfc56('0x45')]);router[_0xfc56('0x43')](_0xfc56('0x12'),auth[_0xfc56('0xa')](),controller['removeAnswers']);router[_0xfc56('0x43')](_0xfc56('0x25'),auth['isAuthenticated'](),controller[_0xfc56('0x46')]);module['exports']=router;
\ No newline at end of file
+var _0xb6af=['root','format','%s-%s','now','/:id/logo','addLogo','diskStorage','server/files/images/avatars/','originalname','single','file','/:id/system_avatar','addSystemAvatar','server/files','attachments','replace','/:id/offline','any','offline','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/users','post','create','addDisposition','join'];(function(_0x443f60,_0x34a688){var _0x22fd0b=function(_0x45bed9){while(--_0x45bed9){_0x443f60['push'](_0x443f60['shift']());}};_0x22fd0b(++_0x34a688);}(_0xb6af,0x1d4));var _0xfb6a=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0xb6af[_0x513545];return _0x18b7c5;};'use strict';var multer=require(_0xfb6a('0x0'));var util=require('util');var path=require(_0xfb6a('0x1'));var timeout=require(_0xfb6a('0x2'));var express=require(_0xfb6a('0x3'));var router=express[_0xfb6a('0x4')]();var fs_extra=require(_0xfb6a('0x5'));var auth=require(_0xfb6a('0x6'));var interaction=require(_0xfb6a('0x7'));var config=require('../../config/environment');var controller=require(_0xfb6a('0x8'));router[_0xfb6a('0x9')]('/',auth[_0xfb6a('0xa')](),controller[_0xfb6a('0xb')]);router[_0xfb6a('0x9')]('/describe',auth[_0xfb6a('0xa')](),controller[_0xfb6a('0xc')]);router[_0xfb6a('0x9')](_0xfb6a('0xd'),auth[_0xfb6a('0xa')](),controller['show']);router['get'](_0xfb6a('0xe'),auth[_0xfb6a('0xa')](),controller[_0xfb6a('0xf')]);router[_0xfb6a('0x9')](_0xfb6a('0x10'),auth['isAuthenticated'](),controller[_0xfb6a('0x11')]);router[_0xfb6a('0x9')]('/:id/logo',controller[_0xfb6a('0x12')]);router[_0xfb6a('0x9')](_0xfb6a('0x13'),controller['getAvatar']);router[_0xfb6a('0x9')](_0xfb6a('0x14'),controller[_0xfb6a('0x15')]);router[_0xfb6a('0x9')]('/:id/system_avatar',controller[_0xfb6a('0x16')]);router['get'](_0xfb6a('0x17'),auth[_0xfb6a('0xa')](),controller[_0xfb6a('0x18')]);router['get'](_0xfb6a('0x19'),controller['getSnippet']);router[_0xfb6a('0x9')](_0xfb6a('0x1a'),auth[_0xfb6a('0xa')](),controller[_0xfb6a('0x1b')]);router['get'](_0xfb6a('0x1c'),auth[_0xfb6a('0xa')](),controller['getProactiveActions']);router[_0xfb6a('0x9')](_0xfb6a('0x1d'),controller[_0xfb6a('0x1e')]);router[_0xfb6a('0x9')]('/:id/offline_messages',auth[_0xfb6a('0xa')](),controller['getOfflineMessages']);router[_0xfb6a('0x9')](_0xfb6a('0x1f'),auth[_0xfb6a('0xa')](),controller['getAgents']);router[_0xfb6a('0x20')]('/',auth[_0xfb6a('0xa')](),controller[_0xfb6a('0x21')]);router[_0xfb6a('0x20')]('/:id/dispositions',auth[_0xfb6a('0xa')](),controller[_0xfb6a('0x22')]);router[_0xfb6a('0x20')]('/:id/canned_answers',auth[_0xfb6a('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4e4b54,_0x3ff44c,_0x27743b){_0x27743b(null,path[_0xfb6a('0x23')](config[_0xfb6a('0x24')],'server/files/images/logos/'));},'filename':function(_0x4be012,_0x377c67,_0x216a39){_0x216a39(null,util[_0xfb6a('0x25')](_0xfb6a('0x26'),Date[_0xfb6a('0x27')](),_0x377c67['originalname']));}})});router['post'](_0xfb6a('0x28'),upload['single']('file'),controller[_0xfb6a('0x29')]);var upload=multer({'storage':multer[_0xfb6a('0x2a')]({'destination':function(_0x42d31f,_0x5d509b,_0x155237){_0x155237(null,path['join'](config[_0xfb6a('0x24')],_0xfb6a('0x2b')));},'filename':function(_0x544e91,_0x3d0512,_0x357347){_0x357347(null,util[_0xfb6a('0x25')](_0xfb6a('0x26'),Date[_0xfb6a('0x27')](),_0x3d0512[_0xfb6a('0x2c')]));}})});router['post']('/:id/avatar',upload[_0xfb6a('0x2d')](_0xfb6a('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer[_0xfb6a('0x2a')]({'destination':function(_0x3bd851,_0x28f557,_0x11bfd2){_0x11bfd2(null,path[_0xfb6a('0x23')](config[_0xfb6a('0x24')],_0xfb6a('0x2b')));},'filename':function(_0x52c21f,_0x1c950c,_0x37b7a0){_0x37b7a0(null,util[_0xfb6a('0x25')](_0xfb6a('0x26'),Date[_0xfb6a('0x27')](),_0x1c950c[_0xfb6a('0x2c')]));}})});router[_0xfb6a('0x20')](_0xfb6a('0x14'),upload[_0xfb6a('0x2d')](_0xfb6a('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xfb6a('0x2a')]({'destination':function(_0x150058,_0x39a4de,_0x353a2a){_0x353a2a(null,path[_0xfb6a('0x23')](config[_0xfb6a('0x24')],_0xfb6a('0x2b')));},'filename':function(_0x481ceb,_0x180a7b,_0x27f0f3){_0x27f0f3(null,util[_0xfb6a('0x25')]('%s-%s',Date[_0xfb6a('0x27')](),_0x180a7b[_0xfb6a('0x2c')]));}})});router['post'](_0xfb6a('0x2f'),upload[_0xfb6a('0x2d')](_0xfb6a('0x2e')),controller[_0xfb6a('0x30')]);router[_0xfb6a('0x20')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xfb6a('0x2a')]({'destination':function(_0x4c10db,_0xd04a8d,_0x32ee91){const _0x1bcea9=path['join'](config[_0xfb6a('0x24')],_0xfb6a('0x31'),_0xfb6a('0x32'),'offline-chat');fs_extra['ensureDir'](_0x1bcea9,function(){_0x32ee91(null,_0x1bcea9);});},'filename':function(_0x3eccf8,_0x5c7622,_0x421c57){const _0x5004af=_0x5c7622['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1a4865=path['extname'](_0x5004af);const _0x445e0b=Date[_0xfb6a('0x27')]()+'-'+_0x5004af[_0xfb6a('0x33')](_0x1a4865,'')+_0x1a4865;_0x421c57(null,_0x445e0b);}})});router[_0xfb6a('0x20')](_0xfb6a('0x34'),offlineUploadMulter[_0xfb6a('0x35')](),controller[_0xfb6a('0x36')]);router[_0xfb6a('0x20')](_0xfb6a('0x17'),auth[_0xfb6a('0xa')](),controller['addInteraction']);router[_0xfb6a('0x20')](_0xfb6a('0x1a'),auth['isAuthenticated'](),controller['addApplications']);router[_0xfb6a('0x20')](_0xfb6a('0x1c'),auth[_0xfb6a('0xa')](),controller['addProactiveActions']);router[_0xfb6a('0x20')](_0xfb6a('0x1f'),auth[_0xfb6a('0xa')](),controller[_0xfb6a('0x37')]);router[_0xfb6a('0x38')]('/:id',auth[_0xfb6a('0xa')](),controller[_0xfb6a('0x39')]);router[_0xfb6a('0x3a')](_0xfb6a('0xd'),auth[_0xfb6a('0xa')](),controller['destroy']);router['delete'](_0xfb6a('0xe'),auth[_0xfb6a('0xa')](),controller[_0xfb6a('0x3b')]);router['delete'](_0xfb6a('0x10'),auth[_0xfb6a('0xa')](),controller[_0xfb6a('0x3c')]);router[_0xfb6a('0x3a')]('/:id/users',auth['isAuthenticated'](),controller[_0xfb6a('0x3d')]);module[_0xfb6a('0x3e')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 9df658e..e4d835f 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 _0x0310=['exports','beaver-logger/server','express','../components/auth/service','../config/environment','env','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated'];(function(_0x34dae3,_0x5d0e71){var _0x974467=function(_0x2cba49){while(--_0x2cba49){_0x34dae3['push'](_0x34dae3['shift']());}};_0x974467(++_0x5d0e71);}(_0x0310,0xe1));var _0x0031=function(_0xc0536c,_0x117641){_0xc0536c=_0xc0536c-0x0;var _0x41a5ca=_0x0310[_0xc0536c];return _0x41a5ca;};var beaverLogger=require(_0x0031('0x0'));var express=require(_0x0031('0x1'));var auth=require(_0x0031('0x2'));var config=require(_0x0031('0x3'));var router=express['Router']();var isProduction=config[_0x0031('0x4')]==='production'||![];function clientSideLogs(_0x134576,_0x3e009e,_0x37e1b2){var _0x5e998b=_0x134576[_0x0031('0x5')][_0x0031('0x6')](_0x0031('0x7'));if(!_0x5e998b){throw new Error(_0x0031('0x8'));}return beaverLogger[_0x0031('0x9')]({'uri':_0x0031('0xa'),'logger':_0x5e998b,'enableCors':!isProduction})(_0x134576,_0x3e009e,_0x37e1b2);}router[_0x0031('0xb')](auth[_0x0031('0xc')](),clientSideLogs);module[_0x0031('0xd')]=router;
\ No newline at end of file
+var _0x82b8=['env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','beaver-logger/server','express','../components/auth/service','../config/environment','Router'];(function(_0x558098,_0x8d2b){var _0x3756e2=function(_0x297e4a){while(--_0x297e4a){_0x558098['push'](_0x558098['shift']());}};_0x3756e2(++_0x8d2b);}(_0x82b8,0x183));var _0x882b=function(_0xed6046,_0x13ef2e){_0xed6046=_0xed6046-0x0;var _0x54b3f6=_0x82b8[_0xed6046];return _0x54b3f6;};var beaverLogger=require(_0x882b('0x0'));var express=require(_0x882b('0x1'));var auth=require(_0x882b('0x2'));var config=require(_0x882b('0x3'));var router=express[_0x882b('0x4')]();var isProduction=config[_0x882b('0x5')]===_0x882b('0x6')||![];function clientSideLogs(_0x48598f,_0x2a03c6,_0x51a562){var _0x17ad41=_0x48598f[_0x882b('0x7')][_0x882b('0x8')](_0x882b('0x9'));if(!_0x17ad41){throw new Error(_0x882b('0xa'));}return beaverLogger['expressEndpoint']({'uri':_0x882b('0xb'),'logger':_0x17ad41,'enableCors':!isProduction})(_0x48598f,_0x2a03c6,_0x51a562);}router[_0x882b('0xc')](auth[_0x882b('0xd')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 3eb682e..84f21b6 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 _0xb77a=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','exports','STRING','ENUM','MicrosoftAzure','Outlook365'];(function(_0x617e1e,_0x30890e){var _0x44b8ae=function(_0x199df4){while(--_0x199df4){_0x617e1e['push'](_0x617e1e['shift']());}};_0x44b8ae(++_0x30890e);}(_0xb77a,0x103));var _0xab77=function(_0x50a651,_0x276aaf){_0x50a651=_0x50a651-0x0;var _0x429c51=_0xb77a[_0x50a651];return _0x429c51;};'use strict';var Sequelize=require('sequelize');module[_0xab77('0x0')]={'name':{'type':Sequelize[_0xab77('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xab77('0x2')]('AmazonAWS','Google',_0xab77('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xab77('0x4'),_0xab77('0x5'))},'data1':{'type':Sequelize['STRING'],'comment':_0xab77('0x6')},'data2':{'type':Sequelize[_0xab77('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xab77('0x1')],'comment':_0xab77('0x7')},'data4':{'type':Sequelize['STRING'],'comment':_0xab77('0x8')},'data5':{'type':Sequelize['TEXT'],'comment':_0xab77('0x9')},'data6':{'type':Sequelize[_0xab77('0xa')],'comment':_0xab77('0xb')},'data7':{'type':Sequelize[_0xab77('0xa')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x2ee7=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x1831ca,_0xd8e5ab){var _0x104c9c=function(_0xe5576d){while(--_0xe5576d){_0x1831ca['push'](_0x1831ca['shift']());}};_0x104c9c(++_0xd8e5ab);}(_0x2ee7,0x146));var _0x72ee=function(_0x398f9a,_0x38c1d1){_0x398f9a=_0x398f9a-0x0;var _0x3a12da=_0x2ee7[_0x398f9a];return _0x3a12da;};'use strict';var Sequelize=require(_0x72ee('0x0'));module[_0x72ee('0x1')]={'name':{'type':Sequelize[_0x72ee('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x72ee('0x3')](_0x72ee('0x4'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x72ee('0x3')]('Outlook365',_0x72ee('0x5'))},'data1':{'type':Sequelize[_0x72ee('0x2')],'comment':_0x72ee('0x6')},'data2':{'type':Sequelize[_0x72ee('0x2')],'comment':_0x72ee('0x7')},'data3':{'type':Sequelize['STRING'],'comment':_0x72ee('0x8')},'data4':{'type':Sequelize[_0x72ee('0x2')],'comment':_0x72ee('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x72ee('0xa')],'comment':_0x72ee('0xb')},'data7':{'type':Sequelize[_0x72ee('0xa')],'comment':_0x72ee('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index c3f6dc0..69605ce 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 _0x1b6c=['CloudProvider','include','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','params','keys','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','update','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','then','destroy','error','stack','name','send','padEnd','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1b6c,0x8c));var _0xc1b6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1b6c[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var Redis=require(_0xc1b6('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0xc1b6('0x1'));var logger=require('../../config/logger')(_0xc1b6('0x2'));var db=require(_0xc1b6('0x3'))['db'];var oauth=require(_0xc1b6('0x4'));config[_0xc1b6('0x5')]=_[_0xc1b6('0x6')](config[_0xc1b6('0x5')],{'host':_0xc1b6('0x7'),'port':0x18eb});var socket=require(_0xc1b6('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0xc1b6('0x5')]);function respondWithStatusCode(_0xaa53cc,_0x2b3897){_0x2b3897=_0x2b3897||0xcc;return function(_0x4afbd3){if(_0x4afbd3){return _0xaa53cc[_0xc1b6('0x9')](_0x2b3897);}return _0xaa53cc['status'](_0x2b3897)[_0xc1b6('0xa')]();};}function respondWithResult(_0x5744b2,_0xb6f7f7){_0xb6f7f7=_0xb6f7f7||0xc8;return function(_0x3740ad){if(_0x3740ad){return _0x5744b2[_0xc1b6('0xb')](_0xb6f7f7)[_0xc1b6('0xc')](_0x3740ad);}};}function respondWithFilteredResult(_0x2c9dc1,_0x4f0e2e){return function(_0x12b3bf){if(_0x12b3bf){var _0x561456=typeof _0x4f0e2e[_0xc1b6('0xd')]==='undefined'&&typeof _0x4f0e2e[_0xc1b6('0xe')]===_0xc1b6('0xf');var _0x491f29=_0x12b3bf[_0xc1b6('0x10')];var _0x99ff18=_0x561456?0x0:_0x4f0e2e[_0xc1b6('0xd')];var _0x53b937=_0x561456?_0x12b3bf[_0xc1b6('0x10')]:_0x4f0e2e['offset']+_0x4f0e2e['limit'];var _0x373327;if(_0x53b937>=_0x491f29){_0x53b937=_0x491f29;_0x373327=0xc8;}else{_0x373327=0xce;}_0x2c9dc1[_0xc1b6('0xb')](_0x373327);return _0x2c9dc1['set'](_0xc1b6('0x11'),_0x99ff18+'-'+_0x53b937+'/'+_0x491f29)[_0xc1b6('0xc')](_0x12b3bf);}return null;};}function saveUpdates(_0xc6b6a7){return function(_0x3254b2){if(_0x3254b2){return _0x3254b2['update'](_0xc6b6a7)[_0xc1b6('0x12')](function(_0x42878d){return _0x42878d;});}return null;};}function removeEntity(_0x376052){return function(_0x5002a0){if(_0x5002a0){return _0x5002a0[_0xc1b6('0x13')]()[_0xc1b6('0x12')](function(){_0x376052[_0xc1b6('0xb')](0xcc)[_0xc1b6('0xa')]();});}};}function handleEntityNotFound(_0xb91bec){return function(_0x4d7713){if(!_0x4d7713){_0xb91bec['sendStatus'](0x194);}return _0x4d7713;};}function handleError(_0x4c13bd,_0x562d9e){_0x562d9e=_0x562d9e||0x1f4;return function(_0x3bcddb){logger[_0xc1b6('0x14')](_0x3bcddb[_0xc1b6('0x15')]);if(_0x3bcddb[_0xc1b6('0x16')]){delete _0x3bcddb[_0xc1b6('0x16')];}_0x4c13bd[_0xc1b6('0xb')](_0x562d9e)[_0xc1b6('0x17')](_0x3bcddb);};}function maskClientSecret(_0x1277cd){return _[_0xc1b6('0x18')](_0x1277cd['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0xfbf336,_0x1729c2){var _0x564d3b={},_0x25a29b={},_0x256b67={'count':0x0,'rows':[]};var _0x4920b8=_[_0xc1b6('0x19')](db['CloudProvider'][_0xc1b6('0x1a')],function(_0x27c7e3){return{'name':_0x27c7e3[_0xc1b6('0x1b')],'type':_0x27c7e3[_0xc1b6('0x1c')][_0xc1b6('0x1d')]};});_0x25a29b[_0xc1b6('0x1e')]=_[_0xc1b6('0x19')](_0x4920b8,_0xc1b6('0x16'));_0x25a29b[_0xc1b6('0x1f')]=_['keys'](_0xfbf336['query']);_0x25a29b['filters']=_[_0xc1b6('0x20')](_0x25a29b[_0xc1b6('0x1e')],_0x25a29b[_0xc1b6('0x1f')]);_0x564d3b[_0xc1b6('0x21')]=_[_0xc1b6('0x20')](_0x25a29b[_0xc1b6('0x1e')],qs[_0xc1b6('0x22')](_0xfbf336[_0xc1b6('0x1f')][_0xc1b6('0x22')]));_0x564d3b[_0xc1b6('0x21')]=_0x564d3b['attributes'][_0xc1b6('0x23')]?_0x564d3b['attributes']:_0x25a29b[_0xc1b6('0x1e')];if(!_0xfbf336[_0xc1b6('0x1f')]['hasOwnProperty'](_0xc1b6('0x24'))){_0x564d3b['limit']=qs['limit'](_0xfbf336[_0xc1b6('0x1f')][_0xc1b6('0xe')]);_0x564d3b[_0xc1b6('0xd')]=qs[_0xc1b6('0xd')](_0xfbf336[_0xc1b6('0x1f')][_0xc1b6('0xd')]);}_0x564d3b[_0xc1b6('0x25')]=qs['sort'](_0xfbf336[_0xc1b6('0x1f')][_0xc1b6('0x26')]);_0x564d3b[_0xc1b6('0x27')]=qs[_0xc1b6('0x28')](_[_0xc1b6('0x29')](_0xfbf336[_0xc1b6('0x1f')],_0x25a29b[_0xc1b6('0x28')]),_0x4920b8);if(_0xfbf336[_0xc1b6('0x1f')][_0xc1b6('0x2a')]){_0x564d3b[_0xc1b6('0x27')]=_[_0xc1b6('0x2b')](_0x564d3b[_0xc1b6('0x27')],{'$or':_[_0xc1b6('0x19')](_0x4920b8,function(_0x1d3987){if(_0x1d3987['type']!==_0xc1b6('0x2c')){var _0x5d719b={};_0x5d719b[_0x1d3987['name']]={'$like':'%'+_0xfbf336[_0xc1b6('0x1f')]['filter']+'%'};return _0x5d719b;}})});}_0x564d3b=_['merge']({},_0x564d3b,_0xfbf336[_0xc1b6('0x2d')]);var _0x457463={'where':_0x564d3b[_0xc1b6('0x27')]};return db[_0xc1b6('0x2e')][_0xc1b6('0x10')](_0x457463)[_0xc1b6('0x12')](function(_0x432aa8){_0x256b67['count']=_0x432aa8;if(_0xfbf336[_0xc1b6('0x1f')]['includeAll']){_0x564d3b[_0xc1b6('0x2f')]=[{'all':!![]}];}return db[_0xc1b6('0x2e')][_0xc1b6('0x30')](_0x564d3b);})[_0xc1b6('0x12')](function(_0x94f45d){_0x256b67['rows']=_[_0xc1b6('0x19')](_0x94f45d,function(_0x3c6607){if(_0x3c6607[_0xc1b6('0x31')]===_0xc1b6('0x32')){var _0x957887=encryptor[_0xc1b6('0x33')](_0x3c6607[_0xc1b6('0x34')]);_0x3c6607[_0xc1b6('0x34')]=maskClientSecret(_0x957887);}return _0x3c6607;});return _0x256b67;})['then'](respondWithFilteredResult(_0x1729c2,_0x564d3b))[_0xc1b6('0x35')](handleError(_0x1729c2,null));};exports[_0xc1b6('0x36')]=function(_0x344de9,_0x4c1c8b){var _0x41a578={'raw':!![],'where':{'id':_0x344de9[_0xc1b6('0x37')]['id']}},_0x12a651={};_0x12a651[_0xc1b6('0x1e')]=_[_0xc1b6('0x38')](db[_0xc1b6('0x2e')][_0xc1b6('0x1a')]);_0x12a651[_0xc1b6('0x1f')]=_[_0xc1b6('0x38')](_0x344de9[_0xc1b6('0x1f')]);_0x12a651[_0xc1b6('0x28')]=_[_0xc1b6('0x20')](_0x12a651[_0xc1b6('0x1e')],_0x12a651['query']);_0x41a578[_0xc1b6('0x21')]=_['intersection'](_0x12a651[_0xc1b6('0x1e')],qs[_0xc1b6('0x22')](_0x344de9['query'][_0xc1b6('0x22')]));_0x41a578[_0xc1b6('0x21')]=_0x41a578[_0xc1b6('0x21')][_0xc1b6('0x23')]?_0x41a578[_0xc1b6('0x21')]:_0x12a651[_0xc1b6('0x1e')];if(_0x344de9[_0xc1b6('0x1f')]['includeAll']){_0x41a578['include']=[{'all':!![]}];}_0x41a578=_['merge']({},_0x41a578,_0x344de9[_0xc1b6('0x2d')]);return db[_0xc1b6('0x2e')][_0xc1b6('0x39')](_0x41a578)[_0xc1b6('0x12')](handleEntityNotFound(_0x4c1c8b,null))['then'](function(_0x5862fb){if(_0x5862fb[_0xc1b6('0x31')]==='MicrosoftAzure'){var _0xb8e41a=encryptor[_0xc1b6('0x33')](_0x5862fb[_0xc1b6('0x34')]);_0x5862fb['data3']=maskClientSecret(_0xb8e41a);}return _0x5862fb;})[_0xc1b6('0x12')](respondWithResult(_0x4c1c8b,null))['catch'](handleError(_0x4c1c8b,null));};exports[_0xc1b6('0x3a')]=function(_0x444ce1,_0x9c49e0){if(!_0x444ce1[_0xc1b6('0x3b')][_0xc1b6('0x16')])throw new Error(_0xc1b6('0x3c'));if(!_0x444ce1[_0xc1b6('0x3b')][_0xc1b6('0x31')])throw new Error(_0xc1b6('0x3d'));var _0xa3b62c=db[_0xc1b6('0x2e')]['rawAttributes'][_0xc1b6('0x31')][_0xc1b6('0x3e')];if(!_0xa3b62c['includes'](_0x444ce1[_0xc1b6('0x3b')][_0xc1b6('0x31')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0xa3b62c['join'](',\x20'));if(_0x444ce1['body'][_0xc1b6('0x31')]==='MicrosoftAzure'&&_0x444ce1['body'][_0xc1b6('0x34')]){_0x444ce1[_0xc1b6('0x3b')]['data3']=encryptor['encryptString'](_0x444ce1[_0xc1b6('0x3b')]['data3']);}return db[_0xc1b6('0x2e')][_0xc1b6('0x3a')](_0x444ce1[_0xc1b6('0x3b')],{})['then'](respondWithResult(_0x9c49e0,0xc9))[_0xc1b6('0x35')](handleError(_0x9c49e0,null));};exports[_0xc1b6('0x3f')]=function(_0xa5bf00,_0xe8a46f){if(_0xa5bf00[_0xc1b6('0x3b')]['id']){delete _0xa5bf00[_0xc1b6('0x3b')]['id'];}return db['CloudProvider'][_0xc1b6('0x39')]({'where':{'id':_0xa5bf00['params']['id']}})[_0xc1b6('0x12')](handleEntityNotFound(_0xe8a46f,null))[_0xc1b6('0x12')](function(_0x3ec733){if(_0x3ec733['service']==='MicrosoftAzure'&&_0xa5bf00['body'][_0xc1b6('0x34')]){_0xa5bf00[_0xc1b6('0x3b')][_0xc1b6('0x34')]=encryptor[_0xc1b6('0x40')](_0xa5bf00['body'][_0xc1b6('0x34')]);}return _0x3ec733;})[_0xc1b6('0x12')](saveUpdates(_0xa5bf00['body'],null))[_0xc1b6('0x12')](respondWithResult(_0xe8a46f,null))[_0xc1b6('0x35')](handleError(_0xe8a46f,null));};exports[_0xc1b6('0x13')]=function(_0x2b04bf,_0x3a9c49){return db[_0xc1b6('0x2e')]['find']({'where':{'id':_0x2b04bf[_0xc1b6('0x37')]['id']}})[_0xc1b6('0x12')](handleEntityNotFound(_0x3a9c49,null))[_0xc1b6('0x12')](removeEntity(_0x3a9c49,null))[_0xc1b6('0x35')](handleError(_0x3a9c49,null));};exports[_0xc1b6('0x41')]=function(_0x33973a,_0x463009){return db[_0xc1b6('0x2e')][_0xc1b6('0x42')]({'where':{'id':_0x33973a[_0xc1b6('0x37')]['id']},'raw':!![]})['then'](function(_0xaee003){if(!_0xaee003)return _0x463009[_0xc1b6('0x9')](0x194);return{'url':oauth[_0xc1b6('0x43')](_0xaee003,_0x33973a['user']['id'])};})['then'](respondWithResult(_0x463009,null))[_0xc1b6('0x35')](handleError(_0x463009,null));};exports[_0xc1b6('0x44')]=function(_0x1fbc09,_0x3f228a){var _0x6996e0=_0x1fbc09[_0xc1b6('0x3b')];var _0x175e8b;var _0x1b542a;if(_0x6996e0[_0xc1b6('0x14')])throw _0x6996e0;redis[_0xc1b6('0x45')](_0x6996e0[_0xc1b6('0x46')])['then'](function(_0x392034){if(!_0x392034)throw new Error(_0xc1b6('0x47'));_0x175e8b=JSON['parse'](_0x392034);var _0x2a52c9=Buffer[_0xc1b6('0x48')](_0x6996e0[_0xc1b6('0x46')],_0xc1b6('0x49'))[_0xc1b6('0x4a')](_0xc1b6('0x4b'));_0x1b542a=JSON['parse'](_0x2a52c9);if(!oauth[_0xc1b6('0x4c')](_0x6996e0[_0xc1b6('0x4d')],_0x175e8b[_0xc1b6('0x4e')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xc1b6('0x4f')](_0x6996e0[_0xc1b6('0x46')]);return oauth[_0xc1b6('0x50')](_0x6996e0[_0xc1b6('0x51')],_0x175e8b);})['then'](function(_0x4cd22b){_0x175e8b['data5']=_0x4cd22b[_0xc1b6('0x52')];_0x175e8b[_0xc1b6('0x53')]=_0x4cd22b[_0xc1b6('0x54')];return db[_0xc1b6('0x2e')][_0xc1b6('0x3f')]({'data5':_0x175e8b[_0xc1b6('0x55')],'data6':_0x175e8b['data6']},{'where':{'id':_0x175e8b['id']}});})['then'](function(){oauth[_0xc1b6('0x56')](_0x175e8b);socket[_0xc1b6('0x57')](_0xc1b6('0x58'),{'id':_0x1b542a['id']});return;})[_0xc1b6('0x12')](respondWithStatusCode(_0x3f228a,null))[_0xc1b6('0x35')](function(_0x487e0e){if(_0x1b542a){socket[_0xc1b6('0x57')](_0xc1b6('0x59'),{'id':_0x1b542a['id']});}if(!_0x175e8b){logger[_0xc1b6('0x14')]('Invalid\x20authentication\x20state\x20parameter',_0x487e0e);return _0x3f228a['status'](0x1f4)[_0xc1b6('0x17')](_0x487e0e[_0xc1b6('0x5a')]);}logger[_0xc1b6('0x14')](_0xc1b6('0x5b'),_0x175e8b['id'],JSON[_0xc1b6('0x5c')](_0x487e0e));});};
\ No newline at end of file
+var _0x635f=['get','state','Invalid\x20state\x20parameter','parse','from','base64','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','sendStatus','name','send','slice','map','CloudProvider','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','options','find','create','Name\x20parameter\x20not\x20specified','body','values','join','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error'];(function(_0x4bdf64,_0x3022b2){var _0x9a1a19=function(_0x4e551b){while(--_0x4e551b){_0x4bdf64['push'](_0x4bdf64['shift']());}};_0x9a1a19(++_0x3022b2);}(_0x635f,0x1d3));var _0xf635=function(_0x5bbd98,_0x1b89c0){_0x5bbd98=_0x5bbd98-0x0;var _0x44346f=_0x635f[_0x5bbd98];return _0x44346f;};'use strict';var _=require(_0xf635('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0xf635('0x1'));var config=require(_0xf635('0x2'));var logger=require(_0xf635('0x3'))(_0xf635('0x4'));var db=require(_0xf635('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_['defaults'](config[_0xf635('0x6')],{'host':_0xf635('0x7'),'port':0x18eb});var socket=require(_0xf635('0x8'))(new Redis(config[_0xf635('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x1aff26,_0x323724){_0x323724=_0x323724||0xcc;return function(_0x3f5651){if(_0x3f5651){return _0x1aff26['sendStatus'](_0x323724);}return _0x1aff26[_0xf635('0x9')](_0x323724)[_0xf635('0xa')]();};}function respondWithResult(_0x588564,_0x584da3){_0x584da3=_0x584da3||0xc8;return function(_0x20ba38){if(_0x20ba38){return _0x588564[_0xf635('0x9')](_0x584da3)[_0xf635('0xb')](_0x20ba38);}};}function respondWithFilteredResult(_0x3a4f4e,_0x4e9d83){return function(_0x1a5b46){if(_0x1a5b46){var _0x3fee8b=typeof _0x4e9d83[_0xf635('0xc')]==='undefined'&&typeof _0x4e9d83['limit']===_0xf635('0xd');var _0xd2932=_0x1a5b46[_0xf635('0xe')];var _0x1a7655=_0x3fee8b?0x0:_0x4e9d83['offset'];var _0x1bd958=_0x3fee8b?_0x1a5b46[_0xf635('0xe')]:_0x4e9d83['offset']+_0x4e9d83[_0xf635('0xf')];var _0x4e25f5;if(_0x1bd958>=_0xd2932){_0x1bd958=_0xd2932;_0x4e25f5=0xc8;}else{_0x4e25f5=0xce;}_0x3a4f4e[_0xf635('0x9')](_0x4e25f5);return _0x3a4f4e[_0xf635('0x10')](_0xf635('0x11'),_0x1a7655+'-'+_0x1bd958+'/'+_0xd2932)[_0xf635('0xb')](_0x1a5b46);}return null;};}function saveUpdates(_0x14d607){return function(_0x11e145){if(_0x11e145){return _0x11e145[_0xf635('0x12')](_0x14d607)[_0xf635('0x13')](function(_0x2bc417){return _0x2bc417;});}return null;};}function removeEntity(_0x3f39d6){return function(_0x995cbd){if(_0x995cbd){return _0x995cbd[_0xf635('0x14')]()[_0xf635('0x13')](function(){_0x3f39d6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a0d4a){return function(_0x49f7f8){if(!_0x49f7f8){_0x2a0d4a[_0xf635('0x15')](0x194);}return _0x49f7f8;};}function handleError(_0x5ade3a,_0x2ddca0){_0x2ddca0=_0x2ddca0||0x1f4;return function(_0x268ce0){logger['error'](_0x268ce0['stack']);if(_0x268ce0[_0xf635('0x16')]){delete _0x268ce0[_0xf635('0x16')];}_0x5ade3a['status'](_0x2ddca0)[_0xf635('0x17')](_0x268ce0);};}function maskClientSecret(_0x51b9d6){return _['padEnd'](_0x51b9d6[_0xf635('0x18')](0x0,0x3),0x14,'*');}exports['index']=function(_0x75d8fc,_0x1c5a5d){var _0x1aca91={},_0x1ddb93={},_0x73ec10={'count':0x0,'rows':[]};var _0x1a4a38=_[_0xf635('0x19')](db[_0xf635('0x1a')][_0xf635('0x1b')],function(_0x1eae81){return{'name':_0x1eae81['fieldName'],'type':_0x1eae81[_0xf635('0x1c')][_0xf635('0x1d')]};});_0x1ddb93[_0xf635('0x1e')]=_[_0xf635('0x19')](_0x1a4a38,'name');_0x1ddb93[_0xf635('0x1f')]=_[_0xf635('0x20')](_0x75d8fc[_0xf635('0x1f')]);_0x1ddb93[_0xf635('0x21')]=_[_0xf635('0x22')](_0x1ddb93['model'],_0x1ddb93[_0xf635('0x1f')]);_0x1aca91[_0xf635('0x23')]=_[_0xf635('0x22')](_0x1ddb93[_0xf635('0x1e')],qs[_0xf635('0x24')](_0x75d8fc['query']['fields']));_0x1aca91['attributes']=_0x1aca91[_0xf635('0x23')][_0xf635('0x25')]?_0x1aca91[_0xf635('0x23')]:_0x1ddb93[_0xf635('0x1e')];if(!_0x75d8fc[_0xf635('0x1f')][_0xf635('0x26')](_0xf635('0x27'))){_0x1aca91['limit']=qs[_0xf635('0xf')](_0x75d8fc[_0xf635('0x1f')][_0xf635('0xf')]);_0x1aca91[_0xf635('0xc')]=qs[_0xf635('0xc')](_0x75d8fc[_0xf635('0x1f')][_0xf635('0xc')]);}_0x1aca91['order']=qs['sort'](_0x75d8fc[_0xf635('0x1f')][_0xf635('0x28')]);_0x1aca91['where']=qs[_0xf635('0x21')](_['pick'](_0x75d8fc[_0xf635('0x1f')],_0x1ddb93[_0xf635('0x21')]),_0x1a4a38);if(_0x75d8fc['query']['filter']){_0x1aca91[_0xf635('0x29')]=_[_0xf635('0x2a')](_0x1aca91[_0xf635('0x29')],{'$or':_[_0xf635('0x19')](_0x1a4a38,function(_0x26ffad){if(_0x26ffad[_0xf635('0x1c')]!==_0xf635('0x2b')){var _0x3112c9={};_0x3112c9[_0x26ffad['name']]={'$like':'%'+_0x75d8fc['query']['filter']+'%'};return _0x3112c9;}})});}_0x1aca91=_['merge']({},_0x1aca91,_0x75d8fc['options']);var _0x51c74b={'where':_0x1aca91[_0xf635('0x29')]};return db[_0xf635('0x1a')]['count'](_0x51c74b)[_0xf635('0x13')](function(_0x811cb8){_0x73ec10[_0xf635('0xe')]=_0x811cb8;if(_0x75d8fc[_0xf635('0x1f')][_0xf635('0x2c')]){_0x1aca91['include']=[{'all':!![]}];}return db[_0xf635('0x1a')][_0xf635('0x2d')](_0x1aca91);})[_0xf635('0x13')](function(_0x51550e){_0x73ec10[_0xf635('0x2e')]=_[_0xf635('0x19')](_0x51550e,function(_0x58fd6f){if(_0x58fd6f[_0xf635('0x2f')]===_0xf635('0x30')){var _0x4cd27d=encryptor[_0xf635('0x31')](_0x58fd6f[_0xf635('0x32')]);_0x58fd6f['data3']=maskClientSecret(_0x4cd27d);}return _0x58fd6f;});return _0x73ec10;})[_0xf635('0x13')](respondWithFilteredResult(_0x1c5a5d,_0x1aca91))[_0xf635('0x33')](handleError(_0x1c5a5d,null));};exports[_0xf635('0x34')]=function(_0xadf949,_0x109d34){var _0x13a1e6={'raw':!![],'where':{'id':_0xadf949[_0xf635('0x35')]['id']}},_0x54ab46={};_0x54ab46[_0xf635('0x1e')]=_['keys'](db[_0xf635('0x1a')][_0xf635('0x1b')]);_0x54ab46[_0xf635('0x1f')]=_[_0xf635('0x20')](_0xadf949[_0xf635('0x1f')]);_0x54ab46[_0xf635('0x21')]=_['intersection'](_0x54ab46[_0xf635('0x1e')],_0x54ab46['query']);_0x13a1e6[_0xf635('0x23')]=_['intersection'](_0x54ab46[_0xf635('0x1e')],qs[_0xf635('0x24')](_0xadf949[_0xf635('0x1f')]['fields']));_0x13a1e6[_0xf635('0x23')]=_0x13a1e6[_0xf635('0x23')][_0xf635('0x25')]?_0x13a1e6[_0xf635('0x23')]:_0x54ab46['model'];if(_0xadf949[_0xf635('0x1f')][_0xf635('0x2c')]){_0x13a1e6['include']=[{'all':!![]}];}_0x13a1e6=_[_0xf635('0x2a')]({},_0x13a1e6,_0xadf949[_0xf635('0x36')]);return db[_0xf635('0x1a')][_0xf635('0x37')](_0x13a1e6)[_0xf635('0x13')](handleEntityNotFound(_0x109d34,null))[_0xf635('0x13')](function(_0xfd989a){if(_0xfd989a[_0xf635('0x2f')]==='MicrosoftAzure'){var _0x31ed0d=encryptor[_0xf635('0x31')](_0xfd989a[_0xf635('0x32')]);_0xfd989a[_0xf635('0x32')]=maskClientSecret(_0x31ed0d);}return _0xfd989a;})['then'](respondWithResult(_0x109d34,null))[_0xf635('0x33')](handleError(_0x109d34,null));};exports[_0xf635('0x38')]=function(_0x44f447,_0x526247){if(!_0x44f447['body'][_0xf635('0x16')])throw new Error(_0xf635('0x39'));if(!_0x44f447[_0xf635('0x3a')][_0xf635('0x2f')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x348048=db[_0xf635('0x1a')][_0xf635('0x1b')][_0xf635('0x2f')][_0xf635('0x3b')];if(!_0x348048['includes'](_0x44f447['body'][_0xf635('0x2f')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x348048[_0xf635('0x3c')](',\x20'));if(_0x44f447[_0xf635('0x3a')][_0xf635('0x2f')]===_0xf635('0x30')&&_0x44f447[_0xf635('0x3a')]['data3']){_0x44f447['body'][_0xf635('0x32')]=encryptor['encryptString'](_0x44f447[_0xf635('0x3a')][_0xf635('0x32')]);}return db[_0xf635('0x1a')][_0xf635('0x38')](_0x44f447[_0xf635('0x3a')],{})[_0xf635('0x13')](respondWithResult(_0x526247,0xc9))[_0xf635('0x33')](handleError(_0x526247,null));};exports[_0xf635('0x12')]=function(_0xebd9be,_0x208030){if(_0xebd9be['body']['id']){delete _0xebd9be[_0xf635('0x3a')]['id'];}return db['CloudProvider'][_0xf635('0x37')]({'where':{'id':_0xebd9be[_0xf635('0x35')]['id']}})[_0xf635('0x13')](handleEntityNotFound(_0x208030,null))[_0xf635('0x13')](function(_0x2fca83){if(_0x2fca83[_0xf635('0x2f')]===_0xf635('0x30')&&_0xebd9be[_0xf635('0x3a')][_0xf635('0x32')]){_0xebd9be[_0xf635('0x3a')][_0xf635('0x32')]=encryptor[_0xf635('0x3d')](_0xebd9be[_0xf635('0x3a')][_0xf635('0x32')]);}return _0x2fca83;})[_0xf635('0x13')](saveUpdates(_0xebd9be[_0xf635('0x3a')],null))[_0xf635('0x13')](respondWithResult(_0x208030,null))[_0xf635('0x33')](handleError(_0x208030,null));};exports['destroy']=function(_0x336c92,_0x3acceb){return db['CloudProvider'][_0xf635('0x37')]({'where':{'id':_0x336c92[_0xf635('0x35')]['id']}})['then'](handleEntityNotFound(_0x3acceb,null))['then'](removeEntity(_0x3acceb,null))['catch'](handleError(_0x3acceb,null));};exports[_0xf635('0x3e')]=function(_0x41ccd5,_0x4b0888){return db[_0xf635('0x1a')]['findOne']({'where':{'id':_0x41ccd5[_0xf635('0x35')]['id']},'raw':!![]})[_0xf635('0x13')](function(_0x8eb455){if(!_0x8eb455)return _0x4b0888[_0xf635('0x15')](0x194);return{'url':oauth[_0xf635('0x3f')](_0x8eb455,_0x41ccd5[_0xf635('0x40')]['id'])};})[_0xf635('0x13')](respondWithResult(_0x4b0888,null))[_0xf635('0x33')](handleError(_0x4b0888,null));};exports[_0xf635('0x41')]=function(_0x3db8d4,_0x4a4e26){var _0x1ea046=_0x3db8d4[_0xf635('0x3a')];var _0x1954a9;var _0x4864f2;if(_0x1ea046[_0xf635('0x42')])throw _0x1ea046;redis[_0xf635('0x43')](_0x1ea046[_0xf635('0x44')])['then'](function(_0x31559b){if(!_0x31559b)throw new Error(_0xf635('0x45'));_0x1954a9=JSON[_0xf635('0x46')](_0x31559b);var _0x239c1c=Buffer[_0xf635('0x47')](_0x1ea046['state'],_0xf635('0x48'))['toString'](_0xf635('0x49'));_0x4864f2=JSON[_0xf635('0x46')](_0x239c1c);if(!oauth['isValidIdToken'](_0x1ea046[_0xf635('0x4a')],_0x1954a9[_0xf635('0x4b')]))throw new Error(_0xf635('0x4c'));redis[_0xf635('0x4d')](_0x1ea046[_0xf635('0x44')]);return oauth['getOauth2MicrosoftAccessToken'](_0x1ea046[_0xf635('0x4e')],_0x1954a9);})[_0xf635('0x13')](function(_0x2c2424){_0x1954a9[_0xf635('0x4f')]=_0x2c2424[_0xf635('0x50')];_0x1954a9['data6']=_0x2c2424[_0xf635('0x51')];return db[_0xf635('0x1a')][_0xf635('0x12')]({'data5':_0x1954a9[_0xf635('0x4f')],'data6':_0x1954a9[_0xf635('0x52')]},{'where':{'id':_0x1954a9['id']}});})['then'](function(){oauth[_0xf635('0x53')](_0x1954a9);socket[_0xf635('0x54')](_0xf635('0x55'),{'id':_0x4864f2['id']});return;})[_0xf635('0x13')](respondWithStatusCode(_0x4a4e26,null))[_0xf635('0x33')](function(_0x34bb1e){if(_0x4864f2){socket[_0xf635('0x54')](_0xf635('0x56'),{'id':_0x4864f2['id']});}if(!_0x1954a9){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x34bb1e);return _0x4a4e26['status'](0x1f4)[_0xf635('0x17')](_0x34bb1e[_0xf635('0x57')]);}logger[_0xf635('0x42')](_0xf635('0x58'),_0x1954a9['id'],JSON['stringify'](_0x34bb1e));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index e7de3f6..a376b20 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 _0x5eae=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x48f8be,_0x2476d2){var _0x38f673=function(_0x47fc38){while(--_0x47fc38){_0x48f8be['push'](_0x48f8be['shift']());}};_0x38f673(++_0x2476d2);}(_0x5eae,0x1bf));var _0xe5ea=function(_0x4620ed,_0x2a1de2){_0x4620ed=_0x4620ed-0x0;var _0x1734ea=_0x5eae[_0x4620ed];return _0x1734ea;};'use strict';var _=require(_0xe5ea('0x0'));var util=require(_0xe5ea('0x1'));var logger=require(_0xe5ea('0x2'))(_0xe5ea('0x3'));var moment=require(_0xe5ea('0x4'));var BPromise=require(_0xe5ea('0x5'));var rp=require(_0xe5ea('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe5ea('0x7'));var config=require('../../config/environment');var attributes=require(_0xe5ea('0x8'));module[_0xe5ea('0x9')]=function(_0x4191b9,_0x5d5789){return _0x4191b9[_0xe5ea('0xa')](_0xe5ea('0xb'),attributes,{'tableName':_0xe5ea('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6115=['./cloudProvider.attributes','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3b75e7,_0x4a4dea){var _0x193814=function(_0x4cf876){while(--_0x4cf876){_0x3b75e7['push'](_0x3b75e7['shift']());}};_0x193814(++_0x4a4dea);}(_0x6115,0x13b));var _0x5611=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6115[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5611('0x0'));var util=require(_0x5611('0x1'));var logger=require(_0x5611('0x2'))(_0x5611('0x3'));var moment=require(_0x5611('0x4'));var BPromise=require('bluebird');var rp=require(_0x5611('0x5'));var fs=require('fs');var path=require(_0x5611('0x6'));var rimraf=require(_0x5611('0x7'));var config=require(_0x5611('0x8'));var attributes=require(_0x5611('0x9'));module['exports']=function(_0x54fd53,_0x85b567){return _0x54fd53['define'](_0x5611('0xa'),attributes,{'tableName':_0x5611('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 7ff9561..363a0b9 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 _0xcee5=['ioredis','request-promise','util','../../components/encryptor','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','map','type','Dynamics365','push','/.default','Outlook365','data7','replace','{TENANT_ID}','code','id_token','from','stringify','toString','randomBytes','client_id','data1','redirect_uri','data4','response_mode','scope','state','nonce','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','findOne','refresh_token','data6','decryptString','POST','data2','data5','access_token','CloudProvider','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','findAll','catch','inspect','exports','lodash','crypto','jsonwebtoken','moment'];(function(_0x4d5143,_0x320103){var _0x5248c9=function(_0x201a29){while(--_0x201a29){_0x4d5143['push'](_0x4d5143['shift']());}};_0x5248c9(++_0x320103);}(_0xcee5,0x182));var _0x5cee=function(_0x209e1c,_0x135210){_0x209e1c=_0x209e1c-0x0;var _0x3f05bd=_0xcee5[_0x209e1c];return _0x3f05bd;};'use strict';var _=require(_0x5cee('0x0'));var crypto=require(_0x5cee('0x1'));var jwt=require(_0x5cee('0x2'));var moment=require(_0x5cee('0x3'));var Redis=require(_0x5cee('0x4'));var rp=require(_0x5cee('0x5'));var util=require(_0x5cee('0x6'));var encryptor=require(_0x5cee('0x7'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x5cee('0x8'))['db'];config[_0x5cee('0x9')]=_[_0x5cee('0xa')](config[_0x5cee('0x9')],{'host':_0x5cee('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x5cee('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x5cee('0xd'),_0x5cee('0xe'),_0x5cee('0xf'),'offline_access',_0x5cee('0x10'),'https://outlook.office.com/POP.AccessAsUser.All',_0x5cee('0x11')],'Dynamics365':[_0x5cee('0xd'),_0x5cee('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0x5cee('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x5cee('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x47957a){var _0x32d3f0=_[_0x5cee('0x15')](AZURE_AUTH_SCOPES[_0x47957a[_0x5cee('0x16')]]);if(_0x47957a[_0x5cee('0x16')]===_0x5cee('0x17'))_0x32d3f0[_0x5cee('0x18')](_0x47957a['data7']+_0x5cee('0x19'));return _0x32d3f0['join']('\x20');}function getAccessTokenScope(_0x1334f1){if(_0x1334f1[_0x5cee('0x16')]===_0x5cee('0x1a'))return _0x5cee('0x10');if(_0x1334f1[_0x5cee('0x16')]===_0x5cee('0x17'))return _0x1334f1[_0x5cee('0x1b')]+_0x5cee('0x19');}function generateMicrosoftAuthorizationUrl(_0xb67016,_0x3574bc){var _0x4b29fb=MICROSOFT_AUTH_URL[_0x5cee('0x1c')](_0x5cee('0x1d'),_0xb67016['data2']);var _0x213dd0=[_0x5cee('0x1e'),_0x5cee('0x1f')];var _0x5e33aa=Buffer[_0x5cee('0x20')](JSON[_0x5cee('0x21')]({'id':_0x3574bc}))[_0x5cee('0x22')]('base64');var _0x53ca87=crypto[_0x5cee('0x23')](0x10)[_0x5cee('0x22')]('hex');var _0x163aec=getAuthorizationScopes(_0xb67016);var _0x93461a=[{'key':_0x5cee('0x24'),'value':_0xb67016[_0x5cee('0x25')]},{'key':'response_type','value':encodeURIComponent(_0x213dd0['join']('\x20'))},{'key':_0x5cee('0x26'),'value':_0xb67016[_0x5cee('0x27')]},{'key':_0x5cee('0x28'),'value':'form_post'},{'key':_0x5cee('0x29'),'value':encodeURIComponent(_0x163aec)},{'key':_0x5cee('0x2a'),'value':_0x5e33aa},{'key':_0x5cee('0x2b'),'value':_0x53ca87},{'key':'prompt','value':'login'}];var _0x2513bd=_0x4b29fb+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x5cee('0x15')](_0x93461a,function(_0x558df3){return _0x558df3[_0x5cee('0x2c')]+'='+_0x558df3[_0x5cee('0x2d')];})['join']('&');_0xb67016[_0x5cee('0x2e')]={'issuer':_0x4b29fb[_0x5cee('0x1c')](_0x5cee('0x2f'),''),'audience':_0xb67016['data1'],'state':_0x5e33aa,'nonce':_0x53ca87};redis[_0x5cee('0x30')](_0x5e33aa,JSON[_0x5cee('0x21')](_0xb67016));return _0x2513bd;}function isValidIdToken(_0x2b10b1,_0x1593e4){try{var _0x31f33e=jwt[_0x5cee('0x31')](_0x2b10b1,{'complete':!![]});var _0x2f38e0=_0x31f33e[_0x5cee('0x32')];if(_0x2f38e0[_0x5cee('0x33')]!==_0x1593e4[_0x5cee('0x34')])return![];if(_0x2f38e0[_0x5cee('0x35')]!==_0x1593e4[_0x5cee('0x36')])return![];if(_0x2f38e0[_0x5cee('0x2b')]!==_0x1593e4[_0x5cee('0x2b')])return![];if(moment()[_0x5cee('0x37')](moment[_0x5cee('0x38')](_0x2f38e0[_0x5cee('0x39')])))return![];return!![];}catch(_0x2b0b75){throw _0x2b0b75;}}function refreshOauth2MicrosoftAccessToken(_0x56e907){return Promise[_0x5cee('0x3a')]()[_0x5cee('0x3b')](function(){if(_0x56e907[_0x5cee('0x3c')])return _0x56e907;return db['CloudProvider'][_0x5cee('0x3d')]({'where':{'id':_0x56e907['id']},'raw':!![]});})[_0x5cee('0x3b')](function(_0x3ccb7d){var _0x3bdd4f={'grant_type':_0x5cee('0x3e'),'refresh_token':_0x3ccb7d[_0x5cee('0x3f')],'scope':getAccessTokenScope(_0x3ccb7d),'redirect_uri':_0x3ccb7d[_0x5cee('0x27')],'client_id':_0x3ccb7d[_0x5cee('0x25')],'client_secret':encryptor[_0x5cee('0x40')](_0x3ccb7d[_0x5cee('0x3c')])};var _0x1020e8={'method':_0x5cee('0x41'),'uri':MICROSOFT_AUTH_URL[_0x5cee('0x1c')](_0x5cee('0x1d'),_0x3ccb7d[_0x5cee('0x42')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3bdd4f,'json':!![]};return rp(_0x1020e8);})[_0x5cee('0x3b')](function(_0x41c0f6){_0x56e907[_0x5cee('0x43')]=_0x41c0f6[_0x5cee('0x44')];_0x56e907[_0x5cee('0x3f')]=_0x41c0f6['refresh_token'];return db[_0x5cee('0x45')][_0x5cee('0x46')]({'data5':_0x56e907[_0x5cee('0x43')],'data6':_0x56e907[_0x5cee('0x3f')]},{'where':{'id':_0x56e907['id']}});})[_0x5cee('0x3b')](function(){return _0x56e907;})['catch'](function(_0x4fbde3){logger[_0x5cee('0x47')](_0x5cee('0x48'),_0x56e907['id'],_0x4fbde3);});}function getOauth2MicrosoftAccessToken(_0x222063,_0x3b2566){var _0x357550={'grant_type':'authorization_code','code':_0x222063,'scope':getAccessTokenScope(_0x3b2566),'redirect_uri':_0x3b2566[_0x5cee('0x27')],'client_id':_0x3b2566[_0x5cee('0x25')],'client_secret':encryptor['decryptString'](_0x3b2566[_0x5cee('0x3c')])};var _0x4c07a6={'method':_0x5cee('0x41'),'uri':MICROSOFT_AUTH_URL[_0x5cee('0x1c')]('{TENANT_ID}',_0x3b2566[_0x5cee('0x42')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x357550,'json':!![]};return rp(_0x4c07a6);}function startRefreshInterval(_0x694cc){var _0x53570b=schedule[_0x5cee('0x49')];if(_0x53570b[_0x694cc['id']])clearInterval(_0x53570b[_0x694cc['id']]);_0x53570b[_0x694cc['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x694cc['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x5cee('0x49')]=_0x53570b;}function startAllRefreshIntervals(){return db[_0x5cee('0x45')][_0x5cee('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x635c30){var _0x1978a4=_0x635c30['map'](function(_0x1fbb69){return refreshOauth2MicrosoftAccessToken(_0x1fbb69)[_0x5cee('0x3b')](function(_0x16548a){startRefreshInterval(_0x16548a);});});return Promise['all'](_0x1978a4);})[_0x5cee('0x4b')](function(_0x45be48){var _0x3973bb=_0x45be48?util[_0x5cee('0x4c')](_0x45be48,{'showHidden':![],'depth':null}):'';logger[_0x5cee('0x47')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x3973bb);});}module[_0x5cee('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x2676=['issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','data6','decryptString','data2','access_token','refresh_token','update','data5','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','ioredis','request-promise','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','/.default','join','Outlook365','data7','replace','{TENANT_ID}','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','response_type','redirect_uri','data4','response_mode','form_post','scope','nonce','prompt','oauth2Claims','oauth2/','data1','set','iss'];(function(_0x430459,_0x58519c){var _0x3a2439=function(_0x27a0b3){while(--_0x27a0b3){_0x430459['push'](_0x430459['shift']());}};_0x3a2439(++_0x58519c);}(_0x2676,0x109));var _0x6267=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2676[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x6267('0x0'));var crypto=require(_0x6267('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x6267('0x2'));var rp=require(_0x6267('0x3'));var util=require('util');var encryptor=require(_0x6267('0x4'));var config=require(_0x6267('0x5'));var logger=require('../../config/logger')(_0x6267('0x6'));var schedule=require(_0x6267('0x7'));var db=require(_0x6267('0x8'))['db'];config[_0x6267('0x9')]=_[_0x6267('0xa')](config[_0x6267('0x9')],{'host':_0x6267('0xb'),'port':0x18eb});var redis=new Redis(config[_0x6267('0x9')]);var MICROSOFT_AUTH_URL=_0x6267('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x6267('0xd'),'profile',_0x6267('0xe'),_0x6267('0xf'),_0x6267('0x10'),'https://outlook.office.com/POP.AccessAsUser.All',_0x6267('0x11')],'Dynamics365':['openid',_0x6267('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x6267('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x6267('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x43e42b){var _0x6f501e=_[_0x6267('0x14')](AZURE_AUTH_SCOPES[_0x43e42b['type']]);if(_0x43e42b[_0x6267('0x15')]===_0x6267('0x16'))_0x6f501e[_0x6267('0x17')](_0x43e42b['data7']+_0x6267('0x18'));return _0x6f501e[_0x6267('0x19')]('\x20');}function getAccessTokenScope(_0x3ee369){if(_0x3ee369[_0x6267('0x15')]===_0x6267('0x1a'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x3ee369[_0x6267('0x15')]===_0x6267('0x16'))return _0x3ee369[_0x6267('0x1b')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x3caf62,_0x4b44ec){var _0x3903fb=MICROSOFT_AUTH_URL[_0x6267('0x1c')](_0x6267('0x1d'),_0x3caf62['data2']);var _0x5781dc=['code',_0x6267('0x1e')];var _0x456a0a=Buffer[_0x6267('0x1f')](JSON[_0x6267('0x20')]({'id':_0x4b44ec}))[_0x6267('0x21')](_0x6267('0x22'));var _0x133acd=crypto[_0x6267('0x23')](0x10)['toString'](_0x6267('0x24'));var _0x1a4db3=getAuthorizationScopes(_0x3caf62);var _0x21ec67=[{'key':_0x6267('0x25'),'value':_0x3caf62['data1']},{'key':_0x6267('0x26'),'value':encodeURIComponent(_0x5781dc[_0x6267('0x19')]('\x20'))},{'key':_0x6267('0x27'),'value':_0x3caf62[_0x6267('0x28')]},{'key':_0x6267('0x29'),'value':_0x6267('0x2a')},{'key':_0x6267('0x2b'),'value':encodeURIComponent(_0x1a4db3)},{'key':'state','value':_0x456a0a},{'key':_0x6267('0x2c'),'value':_0x133acd},{'key':_0x6267('0x2d'),'value':'login'}];var _0x438755=_0x3903fb+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x6267('0x14')](_0x21ec67,function(_0x375920){return _0x375920['key']+'='+_0x375920['value'];})[_0x6267('0x19')]('&');_0x3caf62[_0x6267('0x2e')]={'issuer':_0x3903fb['replace'](_0x6267('0x2f'),''),'audience':_0x3caf62[_0x6267('0x30')],'state':_0x456a0a,'nonce':_0x133acd};redis[_0x6267('0x31')](_0x456a0a,JSON[_0x6267('0x20')](_0x3caf62));return _0x438755;}function isValidIdToken(_0x13ff40,_0x1e8640){try{var _0x55b082=jwt['decode'](_0x13ff40,{'complete':!![]});var _0x3ca7c4=_0x55b082['payload'];if(_0x3ca7c4[_0x6267('0x32')]!==_0x1e8640[_0x6267('0x33')])return![];if(_0x3ca7c4[_0x6267('0x34')]!==_0x1e8640[_0x6267('0x35')])return![];if(_0x3ca7c4[_0x6267('0x2c')]!==_0x1e8640[_0x6267('0x2c')])return![];if(moment()[_0x6267('0x36')](moment[_0x6267('0x37')](_0x3ca7c4[_0x6267('0x38')])))return![];return!![];}catch(_0x10214b){throw _0x10214b;}}function refreshOauth2MicrosoftAccessToken(_0x221a96){return Promise[_0x6267('0x39')]()[_0x6267('0x3a')](function(){if(_0x221a96[_0x6267('0x3b')])return _0x221a96;return db[_0x6267('0x3c')][_0x6267('0x3d')]({'where':{'id':_0x221a96['id']},'raw':!![]});})['then'](function(_0x173116){var _0x296237={'grant_type':'refresh_token','refresh_token':_0x173116[_0x6267('0x3e')],'scope':getAccessTokenScope(_0x173116),'redirect_uri':_0x173116['data4'],'client_id':_0x173116[_0x6267('0x30')],'client_secret':encryptor[_0x6267('0x3f')](_0x173116[_0x6267('0x3b')])};var _0x5b55df={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x6267('0x1d'),_0x173116[_0x6267('0x40')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x296237,'json':!![]};return rp(_0x5b55df);})[_0x6267('0x3a')](function(_0x2ac17c){_0x221a96['data5']=_0x2ac17c[_0x6267('0x41')];_0x221a96['data6']=_0x2ac17c[_0x6267('0x42')];return db[_0x6267('0x3c')][_0x6267('0x43')]({'data5':_0x221a96[_0x6267('0x44')],'data6':_0x221a96[_0x6267('0x3e')]},{'where':{'id':_0x221a96['id']}});})[_0x6267('0x3a')](function(){return _0x221a96;})['catch'](function(_0x22921b){logger['error'](_0x6267('0x45'),_0x221a96['id'],_0x22921b);});}function getOauth2MicrosoftAccessToken(_0x4f1b88,_0x15b55b){var _0x4f3668={'grant_type':_0x6267('0x46'),'code':_0x4f1b88,'scope':getAccessTokenScope(_0x15b55b),'redirect_uri':_0x15b55b[_0x6267('0x28')],'client_id':_0x15b55b[_0x6267('0x30')],'client_secret':encryptor['decryptString'](_0x15b55b[_0x6267('0x3b')])};var _0x15a704={'method':_0x6267('0x47'),'uri':MICROSOFT_AUTH_URL[_0x6267('0x1c')](_0x6267('0x1d'),_0x15b55b[_0x6267('0x40')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4f3668,'json':!![]};return rp(_0x15a704);}function startRefreshInterval(_0x4808b5){var _0x221e5e=schedule[_0x6267('0x48')];if(_0x221e5e[_0x4808b5['id']])clearInterval(_0x221e5e[_0x4808b5['id']]);_0x221e5e[_0x4808b5['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x6267('0x49')](this,{'id':_0x4808b5['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x6267('0x48')]=_0x221e5e;}function startAllRefreshIntervals(){return db[_0x6267('0x3c')][_0x6267('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x6267('0x3a')](function(_0x37d238){var _0x81e251=_0x37d238[_0x6267('0x14')](function(_0x551e69){return refreshOauth2MicrosoftAccessToken(_0x551e69)[_0x6267('0x3a')](function(_0x12705e){startRefreshInterval(_0x12705e);});});return Promise[_0x6267('0x4b')](_0x81e251);})[_0x6267('0x4c')](function(_0x58eb8){var _0x40e706=_0x58eb8?util[_0x6267('0x4d')](_0x58eb8,{'showHidden':![],'depth':null}):'';logger['error'](_0x6267('0x4e'),_0x40e706);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index b17428c..924e9d1 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 _0xaf60=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','error','code','message','info','CloudProvider,\x20%s,\x20%s','lodash','util','moment'];(function(_0x2565e0,_0x45bba1){var _0x5b7c07=function(_0x3d5923){while(--_0x3d5923){_0x2565e0['push'](_0x2565e0['shift']());}};_0x5b7c07(++_0x45bba1);}(_0xaf60,0x82));var _0x0af6=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xaf60[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x0af6('0x0'));var util=require(_0x0af6('0x1'));var moment=require(_0x0af6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0af6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0af6('0x4'))(_0x0af6('0x5'));var config=require(_0x0af6('0x6'));var jayson=require(_0x0af6('0x7'));var client=jayson[_0x0af6('0x8')][_0x0af6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2eb218,_0x52c997,_0x376979){return new BPromise(function(_0x28d620,_0x525bcc){return client[_0x0af6('0xa')](_0x2eb218,_0x376979)[_0x0af6('0xb')](function(_0xe9d01a){logger['info']('CloudProvider,\x20%s,\x20%s',_0x52c997,'request\x20sent');logger[_0x0af6('0xc')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x52c997,_0x0af6('0xd'),JSON['stringify'](_0xe9d01a));if(_0xe9d01a['error']){if(_0xe9d01a[_0x0af6('0xe')][_0x0af6('0xf')]===0x1f4){logger[_0x0af6('0xe')]('CloudProvider,\x20%s,\x20%s',_0x52c997,_0xe9d01a[_0x0af6('0xe')][_0x0af6('0x10')]);return _0x525bcc(_0xe9d01a[_0x0af6('0xe')]['message']);}logger[_0x0af6('0xe')]('CloudProvider,\x20%s,\x20%s',_0x52c997,_0xe9d01a[_0x0af6('0xe')]['message']);return _0x28d620(_0xe9d01a[_0x0af6('0xe')][_0x0af6('0x10')]);}else{logger[_0x0af6('0x11')](_0x0af6('0x12'),_0x52c997,'request\x20sent');_0x28d620(_0xe9d01a['result']['message']);}})['catch'](function(_0x4d5936){logger[_0x0af6('0xe')](_0x0af6('0x12'),_0x52c997,_0x4d5936);_0x525bcc(_0x4d5936);});});}
\ No newline at end of file
+var _0xda81=['then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request'];(function(_0x2f4d7f,_0x62f4b7){var _0x147ba1=function(_0x14ef36){while(--_0x14ef36){_0x2f4d7f['push'](_0x2f4d7f['shift']());}};_0x147ba1(++_0x62f4b7);}(_0xda81,0x1c3));var _0x1da8=function(_0x366c77,_0x5ba3ca){_0x366c77=_0x366c77-0x0;var _0x649e5=_0xda81[_0x366c77];return _0x649e5;};'use strict';var _=require(_0x1da8('0x0'));var util=require(_0x1da8('0x1'));var moment=require(_0x1da8('0x2'));var BPromise=require('bluebird');var rs=require(_0x1da8('0x3'));var fs=require('fs');var Redis=require(_0x1da8('0x4'));var db=require(_0x1da8('0x5'))['db'];var utils=require(_0x1da8('0x6'));var logger=require('../../config/logger')(_0x1da8('0x7'));var config=require(_0x1da8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1da8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x891482,_0x2c2bb4,_0xea1eb1){return new BPromise(function(_0x1a3278,_0x11dc1e){return client[_0x1da8('0xa')](_0x891482,_0xea1eb1)[_0x1da8('0xb')](function(_0x17a7fc){logger[_0x1da8('0xc')]('CloudProvider,\x20%s,\x20%s',_0x2c2bb4,_0x1da8('0xd'));logger[_0x1da8('0xe')](_0x1da8('0xf'),_0x2c2bb4,_0x1da8('0xd'),JSON[_0x1da8('0x10')](_0x17a7fc));if(_0x17a7fc['error']){if(_0x17a7fc[_0x1da8('0x11')]['code']===0x1f4){logger[_0x1da8('0x11')](_0x1da8('0x12'),_0x2c2bb4,_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);return _0x11dc1e(_0x17a7fc[_0x1da8('0x11')]['message']);}logger[_0x1da8('0x11')]('CloudProvider,\x20%s,\x20%s',_0x2c2bb4,_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);return _0x1a3278(_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);}else{logger[_0x1da8('0xc')](_0x1da8('0x12'),_0x2c2bb4,'request\x20sent');_0x1a3278(_0x17a7fc[_0x1da8('0x14')][_0x1da8('0x13')]);}})[_0x1da8('0x15')](function(_0x197b09){logger[_0x1da8('0x11')](_0x1da8('0x12'),_0x2c2bb4,_0x197b09);_0x11dc1e(_0x197b09);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 8fa8f5c..801aada 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 _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x28d28c,_0x9e6c9e){var _0x16717a=function(_0x4dadf9){while(--_0x4dadf9){_0x28d28c['push'](_0x28d28c['shift']());}};_0x16717a(++_0x9e6c9e);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);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(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x1261,0x144));var _0x1126=function(_0x3a7455,_0x46b004){_0x3a7455=_0x3a7455-0x0;var _0x216c72=_0x1261[_0x3a7455];return _0x216c72;};'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 76585ac..73007b5 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 _0xd3bd=['STRING','name'];(function(_0x5741c6,_0x46ffd1){var _0xa7c024=function(_0x513639){while(--_0x513639){_0x5741c6['push'](_0x5741c6['shift']());}};_0xa7c024(++_0x46ffd1);}(_0xd3bd,0xa9));var _0xdd3b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd3bd[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xdd3b('0x0'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xdd3b('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xdd3b('0x1')]},'phone':{'type':Sequelize[_0xdd3b('0x1')]},'fax':{'type':Sequelize[_0xdd3b('0x1')]},'type':{'type':Sequelize[_0xdd3b('0x1')]},'street':{'type':Sequelize[_0xdd3b('0x1')]},'postalCode':{'type':Sequelize[_0xdd3b('0x1')]},'city':{'type':Sequelize[_0xdd3b('0x1')]},'country':{'type':Sequelize[_0xdd3b('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xdd3b('0x1')]},'sStreet':{'type':Sequelize[_0xdd3b('0x1')]},'sPostalCode':{'type':Sequelize[_0xdd3b('0x1')]},'sCity':{'type':Sequelize[_0xdd3b('0x1')]},'sCountry':{'type':Sequelize[_0xdd3b('0x1')]},'description':{'type':Sequelize[_0xdd3b('0x1')]}};
\ No newline at end of file
+var _0x8781=['sequelize','exports','name','STRING'];(function(_0x20d99d,_0x304c85){var _0x3870bc=function(_0x1b0b4f){while(--_0x1b0b4f){_0x20d99d['push'](_0x20d99d['shift']());}};_0x3870bc(++_0x304c85);}(_0x8781,0x118));var _0x1878=function(_0x1ad38b,_0xed3117){_0x1ad38b=_0x1ad38b-0x0;var _0x1d28f9=_0x8781[_0x1ad38b];return _0x1d28f9;};'use strict';var Sequelize=require(_0x1878('0x0'));module[_0x1878('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1878('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1878('0x3')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x1878('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1878('0x3')]},'type':{'type':Sequelize[_0x1878('0x3')]},'street':{'type':Sequelize[_0x1878('0x3')]},'postalCode':{'type':Sequelize[_0x1878('0x3')]},'city':{'type':Sequelize[_0x1878('0x3')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1878('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1878('0x3')]},'sStreet':{'type':Sequelize[_0x1878('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x1878('0x3')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1878('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 3b6df5e..76f1987 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 _0x6367=['query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','map','includeAll','include','catch','show','params','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContact','addContacts','ids','omit','getContacts','findOne','length','options','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','get','Companies','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x6367,0x1c4));var _0x7636=function(_0x2b6600,_0x24c497){_0x2b6600=_0x2b6600-0x0;var _0x912ee2=_0x6367[_0x2b6600];return _0x912ee2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7636('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7636('0x1'));var rp=require(_0x7636('0x2'));var moment=require(_0x7636('0x3'));var BPromise=require(_0x7636('0x4'));var Mustache=require(_0x7636('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7636('0x6'));var csv=require(_0x7636('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7636('0x8'));var _=require('lodash');var squel=require(_0x7636('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7636('0xa'));var toCsv=require('to-csv');var querystring=require(_0x7636('0xb'));var Papa=require(_0x7636('0xc'));var Redis=require(_0x7636('0xd'));var authService=require(_0x7636('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7636('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7636('0x10'));var utils=require(_0x7636('0x11'));var config=require(_0x7636('0x12'));var licenseUtil=require(_0x7636('0x13'));var db=require(_0x7636('0x14'))['db'];function respondWithStatusCode(_0x4b6d8f,_0x25155c){_0x25155c=_0x25155c||0xcc;return function(_0xeddcb){if(_0xeddcb){return _0x4b6d8f['sendStatus'](_0x25155c);}return _0x4b6d8f[_0x7636('0x15')](_0x25155c)[_0x7636('0x16')]();};}function respondWithResult(_0x191a5a,_0x217255){_0x217255=_0x217255||0xc8;return function(_0x4d9d79){if(_0x4d9d79){return _0x191a5a[_0x7636('0x15')](_0x217255)['json'](_0x4d9d79);}};}function respondWithFilteredResult(_0x4156f0,_0x23e6b7){return function(_0x57181d){if(_0x57181d){var _0x145c30=typeof _0x23e6b7['offset']==='undefined'&&typeof _0x23e6b7['limit']===_0x7636('0x17');var _0xbad4f7=_0x57181d[_0x7636('0x18')];var _0x14089f=_0x145c30?0x0:_0x23e6b7['offset'];var _0x113ee3=_0x145c30?_0x57181d[_0x7636('0x18')]:_0x23e6b7['offset']+_0x23e6b7[_0x7636('0x19')];var _0x2d113f;if(_0x113ee3>=_0xbad4f7){_0x113ee3=_0xbad4f7;_0x2d113f=0xc8;}else{_0x2d113f=0xce;}_0x4156f0[_0x7636('0x15')](_0x2d113f);return _0x4156f0[_0x7636('0x1a')]('Content-Range',_0x14089f+'-'+_0x113ee3+'/'+_0xbad4f7)[_0x7636('0x1b')](_0x57181d);}return null;};}function patchUpdates(_0x36b795){return function(_0x57c407){try{jsonpatch[_0x7636('0x1c')](_0x57c407,_0x36b795,!![]);}catch(_0x1d51c1){return BPromise[_0x7636('0x1d')](_0x1d51c1);}return _0x57c407[_0x7636('0x1e')]();};}function saveUpdates(_0x1fdb84,_0x12cb1f){return function(_0x20dc2c){if(_0x20dc2c){return _0x20dc2c[_0x7636('0x1f')](_0x1fdb84)[_0x7636('0x20')](function(_0x426ee6){return _0x426ee6;});}return null;};}function removeEntity(_0x6b4efe,_0x18a5d6){return function(_0x41a746){if(_0x41a746){return _0x41a746[_0x7636('0x21')]()[_0x7636('0x20')](function(){var _0x4b914b=_0x41a746[_0x7636('0x22')]({'plain':!![]});var _0x889964=_0x7636('0x23');return db['UserProfileResource'][_0x7636('0x21')]({'where':{'type':_0x889964,'resourceId':_0x4b914b['id']}})['then'](function(){return _0x41a746;});})['then'](function(){_0x6b4efe[_0x7636('0x15')](0xcc)[_0x7636('0x16')]();});}};}function handleEntityNotFound(_0x42a7f4,_0x2a612d){return function(_0x85f0f5){if(!_0x85f0f5){_0x42a7f4[_0x7636('0x24')](0x194);}return _0x85f0f5;};}function handleError(_0x36eaab,_0x941b8a){_0x941b8a=_0x941b8a||0x1f4;return function(_0x114734){logger[_0x7636('0x25')](_0x114734[_0x7636('0x26')]);if(_0x114734[_0x7636('0x27')]){delete _0x114734[_0x7636('0x27')];}_0x36eaab[_0x7636('0x15')](_0x941b8a)[_0x7636('0x28')](_0x114734);};}exports[_0x7636('0x29')]=function(_0x2a5814,_0x43b223){var _0xfec09d={},_0x9fd638={},_0x37a6c7={'count':0x0,'rows':[]};return db[_0x7636('0x2a')][_0x7636('0x2b')]()[_0x7636('0x20')](function(_0xb73727){_0x9fd638[_0x7636('0x2c')]=_[_0x7636('0x2d')](_0xb73727);_0x9fd638[_0x7636('0x2e')]=_[_0x7636('0x2d')](_0x2a5814['query']);_0x9fd638[_0x7636('0x2f')]=_[_0x7636('0x30')](_0x9fd638[_0x7636('0x2c')],_0x9fd638[_0x7636('0x2e')]);_0xfec09d['attributes']=_[_0x7636('0x30')](_0x9fd638[_0x7636('0x2c')],qs[_0x7636('0x31')](_0x2a5814[_0x7636('0x2e')][_0x7636('0x31')]));_0xfec09d[_0x7636('0x32')]=_0xfec09d[_0x7636('0x32')]['length']?_0xfec09d['attributes']:_0x9fd638[_0x7636('0x2c')];if(!_0x2a5814[_0x7636('0x2e')][_0x7636('0x33')](_0x7636('0x34'))){_0xfec09d[_0x7636('0x19')]=qs[_0x7636('0x19')](_0x2a5814[_0x7636('0x2e')]['limit']);_0xfec09d[_0x7636('0x35')]=qs[_0x7636('0x35')](_0x2a5814[_0x7636('0x2e')][_0x7636('0x35')]);}_0xfec09d[_0x7636('0x36')]=qs[_0x7636('0x37')](_0x2a5814[_0x7636('0x2e')][_0x7636('0x37')]);_0xfec09d[_0x7636('0x38')]=qs['filters'](_[_0x7636('0x39')](_0x2a5814[_0x7636('0x2e')],_0x9fd638[_0x7636('0x2f')]),_0xb73727);if(_0x2a5814[_0x7636('0x2e')][_0x7636('0x3a')]){_0xfec09d[_0x7636('0x38')]=_[_0x7636('0x3b')](_0xfec09d[_0x7636('0x38')],{'$or':_[_0x7636('0x3c')](_0xfec09d[_0x7636('0x32')],function(_0x2306e0){var _0x17e8b6={};_0x17e8b6[_0x2306e0]={'$like':'%'+_0x2a5814[_0x7636('0x2e')][_0x7636('0x3a')]+'%'};return _0x17e8b6;})});}_0xfec09d=_['merge']({},_0xfec09d,_0x2a5814['options']);var _0x1f5eac={'where':_0xfec09d[_0x7636('0x38')]};return db['CmCompany'][_0x7636('0x18')](_0x1f5eac)[_0x7636('0x20')](function(_0x39922c){_0x37a6c7[_0x7636('0x18')]=_0x39922c;if(_0x2a5814['query'][_0x7636('0x3d')]){_0xfec09d[_0x7636('0x3e')]=[{'all':!![]}];}return db[_0x7636('0x2a')]['findAll'](_0xfec09d);})['then'](function(_0x24fea7){_0x37a6c7['rows']=_0x24fea7;return _0x37a6c7;})[_0x7636('0x20')](respondWithFilteredResult(_0x43b223,_0xfec09d))['catch'](handleError(_0x43b223,null));})[_0x7636('0x3f')](handleError(_0x43b223,null));};exports[_0x7636('0x40')]=function(_0x256a6e,_0x461467){var _0x5d9ed3={'raw':![],'where':{'id':_0x256a6e[_0x7636('0x41')]['id']}},_0x31b8b5={};_0x31b8b5[_0x7636('0x2c')]=_['keys'](db['CmCompany'][_0x7636('0x42')]);_0x31b8b5[_0x7636('0x2e')]=_[_0x7636('0x2d')](_0x256a6e[_0x7636('0x2e')]);_0x31b8b5['filters']=_['intersection'](_0x31b8b5[_0x7636('0x2c')],_0x31b8b5[_0x7636('0x2e')]);_0x5d9ed3[_0x7636('0x32')]=_[_0x7636('0x30')](_0x31b8b5[_0x7636('0x2c')],qs[_0x7636('0x31')](_0x256a6e[_0x7636('0x2e')][_0x7636('0x31')]));_0x5d9ed3['attributes']=_0x5d9ed3[_0x7636('0x32')]['length']?_0x5d9ed3[_0x7636('0x32')]:_0x31b8b5[_0x7636('0x2c')];if(_0x256a6e[_0x7636('0x2e')][_0x7636('0x3d')]){_0x5d9ed3[_0x7636('0x3e')]=[{'all':!![]}];}_0x5d9ed3=_['merge']({},_0x5d9ed3,_0x256a6e['options']);return db[_0x7636('0x2a')][_0x7636('0x43')](_0x5d9ed3)[_0x7636('0x20')](handleEntityNotFound(_0x461467,null))['then'](respondWithResult(_0x461467,null))[_0x7636('0x3f')](handleError(_0x461467,null));};exports['create']=function(_0x4a7507,_0x4f8158){return db['CmCompany'][_0x7636('0x44')](_0x4a7507['body'],{})[_0x7636('0x20')](function(_0x493c92){var _0x4c0805=_0x4a7507['user'][_0x7636('0x22')]({'plain':!![]});if(!_0x4c0805)throw new Error(_0x7636('0x45'));if(_0x4c0805[_0x7636('0x46')]===_0x7636('0x47')){var _0x49014d=_0x493c92[_0x7636('0x22')]({'plain':!![]});var _0x1952f3=_0x7636('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x1952f3,'userProfileId':_0x4c0805[_0x7636('0x48')]},'raw':!![]})[_0x7636('0x20')](function(_0x313c93){if(_0x313c93&&_0x313c93['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x49014d[_0x7636('0x27')],'resourceId':_0x49014d['id'],'type':_0x313c93[_0x7636('0x27')],'sectionId':_0x313c93['id']},{})[_0x7636('0x20')](function(){return _0x493c92;});}else{return _0x493c92;}})['catch'](function(_0x494a47){logger[_0x7636('0x25')](_0x7636('0x49'),_0x494a47);throw _0x494a47;});}return _0x493c92;})[_0x7636('0x20')](respondWithResult(_0x4f8158,0xc9))[_0x7636('0x3f')](handleError(_0x4f8158,null));};exports[_0x7636('0x1f')]=function(_0x222760,_0x6b3b51){if(_0x222760['body']['id']){delete _0x222760[_0x7636('0x4a')]['id'];}return db[_0x7636('0x2a')][_0x7636('0x43')]({'where':{'id':_0x222760[_0x7636('0x41')]['id']}})[_0x7636('0x20')](handleEntityNotFound(_0x6b3b51,null))['then'](saveUpdates(_0x222760[_0x7636('0x4a')],null))[_0x7636('0x20')](respondWithResult(_0x6b3b51,null))[_0x7636('0x3f')](handleError(_0x6b3b51,null));};exports[_0x7636('0x21')]=function(_0x29ae39,_0x52ca0e){return db[_0x7636('0x2a')]['find']({'where':{'id':_0x29ae39[_0x7636('0x41')]['id']}})['then'](handleEntityNotFound(_0x52ca0e,null))[_0x7636('0x20')](removeEntity(_0x52ca0e,null))['catch'](handleError(_0x52ca0e,null));};exports[_0x7636('0x2b')]=function(_0x8b9124,_0x23788a){return db[_0x7636('0x2a')][_0x7636('0x2b')]()[_0x7636('0x20')](respondWithResult(_0x23788a,null))[_0x7636('0x3f')](handleError(_0x23788a,null));};exports['addContacts']=function(_0x419c8e,_0x492d3e,_0x38e4a4){return db[_0x7636('0x4b')][_0x7636('0x43')]({'where':{'id':_0x419c8e['params']['id']}})[_0x7636('0x20')](handleEntityNotFound(_0x492d3e,null))[_0x7636('0x20')](function(_0x33848d){if(_0x33848d){return _0x33848d[_0x7636('0x4c')](_0x419c8e[_0x7636('0x4a')][_0x7636('0x4d')],_[_0x7636('0x4e')](_0x419c8e[_0x7636('0x4a')],[_0x7636('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x492d3e,null))[_0x7636('0x3f')](handleError(_0x492d3e,null));};exports[_0x7636('0x4f')]=function(_0x31e585,_0x4d50cf,_0x364ed9){var _0x1d4de9={};var _0x1d4eb3={};var _0x29f2a9;var _0x15e097;return db[_0x7636('0x2a')][_0x7636('0x50')]({'where':{'id':_0x31e585[_0x7636('0x41')]['id']}})[_0x7636('0x20')](handleEntityNotFound(_0x4d50cf,null))['then'](function(_0x4da182){if(_0x4da182){_0x29f2a9=_0x4da182;_0x1d4eb3[_0x7636('0x2c')]=_[_0x7636('0x2d')](db[_0x7636('0x4b')][_0x7636('0x42')]);_0x1d4eb3[_0x7636('0x2e')]=_['keys'](_0x31e585[_0x7636('0x2e')]);_0x1d4eb3['filters']=_[_0x7636('0x30')](_0x1d4eb3[_0x7636('0x2c')],_0x1d4eb3['query']);_0x1d4de9[_0x7636('0x32')]=_[_0x7636('0x30')](_0x1d4eb3[_0x7636('0x2c')],qs['fields'](_0x31e585['query'][_0x7636('0x31')]));_0x1d4de9['attributes']=_0x1d4de9[_0x7636('0x32')][_0x7636('0x51')]?_0x1d4de9[_0x7636('0x32')]:_0x1d4eb3[_0x7636('0x2c')];_0x1d4de9[_0x7636('0x36')]=qs['sort'](_0x31e585['query'][_0x7636('0x37')]);_0x1d4de9[_0x7636('0x38')]=qs['filters'](_['pick'](_0x31e585['query'],_0x1d4eb3['filters']));if(_0x31e585[_0x7636('0x2e')]['filter']){_0x1d4de9[_0x7636('0x38')]=_['merge'](_0x1d4de9[_0x7636('0x38')],{'$or':_[_0x7636('0x3c')](_0x1d4de9[_0x7636('0x32')],function(_0x1ca8cd){var _0x501808={};_0x501808[_0x1ca8cd]={'$like':'%'+_0x31e585[_0x7636('0x2e')][_0x7636('0x3a')]+'%'};return _0x501808;})});}_0x1d4de9=_[_0x7636('0x3b')]({},_0x1d4de9,_0x31e585[_0x7636('0x52')]);return _0x29f2a9['getContacts'](_0x1d4de9);}})[_0x7636('0x20')](function(_0x46fdcb){if(_0x46fdcb){_0x15e097=_0x46fdcb[_0x7636('0x51')];if(!_0x31e585['query']['hasOwnProperty'](_0x7636('0x34'))){_0x1d4de9[_0x7636('0x19')]=qs[_0x7636('0x19')](_0x31e585[_0x7636('0x2e')][_0x7636('0x19')]);_0x1d4de9[_0x7636('0x35')]=qs[_0x7636('0x35')](_0x31e585[_0x7636('0x2e')][_0x7636('0x35')]);}return _0x29f2a9[_0x7636('0x4f')](_0x1d4de9);}})[_0x7636('0x20')](function(_0x14dfa9){if(_0x14dfa9){return _0x14dfa9?{'count':_0x15e097,'rows':_0x14dfa9}:null;}})[_0x7636('0x20')](respondWithResult(_0x4d50cf,null))['catch'](handleError(_0x4d50cf,null));};
\ No newline at end of file
+var _0x44ad=['update','then','destroy','get','Companies','error','stack','name','send','index','describe','model','keys','query','filters','intersection','attributes','length','nolimit','sort','where','pick','filter','map','merge','options','CmCompany','includeAll','include','findAll','rows','catch','params','rawAttributes','fields','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContact','addContacts','omit','getContacts','findOne','order','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save'];(function(_0x2a745a,_0x16d63f){var _0x3d45bc=function(_0x45d3a8){while(--_0x45d3a8){_0x2a745a['push'](_0x2a745a['shift']());}};_0x3d45bc(++_0x16d63f);}(_0x44ad,0x1ee));var _0xd44a=function(_0x572de3,_0x3f4d83){_0x572de3=_0x572de3-0x0;var _0xd9ae3e=_0x44ad[_0x572de3];return _0xd9ae3e;};'use strict';var emlformat=require(_0xd44a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd44a('0x1'));var jsonpatch=require(_0xd44a('0x2'));var rp=require(_0xd44a('0x3'));var moment=require(_0xd44a('0x4'));var BPromise=require(_0xd44a('0x5'));var Mustache=require(_0xd44a('0x6'));var util=require(_0xd44a('0x7'));var path=require(_0xd44a('0x8'));var sox=require(_0xd44a('0x9'));var csv=require(_0xd44a('0xa'));var ejs=require(_0xd44a('0xb'));var fs=require('fs');var fs_extra=require(_0xd44a('0xc'));var _=require('lodash');var squel=require(_0xd44a('0xd'));var crypto=require(_0xd44a('0xe'));var jsforce=require(_0xd44a('0xf'));var deskjs=require(_0xd44a('0x10'));var toCsv=require(_0xd44a('0xa'));var querystring=require(_0xd44a('0x11'));var Papa=require(_0xd44a('0x12'));var Redis=require(_0xd44a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd44a('0x14'));var as=require(_0xd44a('0x15'));var hardwareService=require(_0xd44a('0x16'));var logger=require(_0xd44a('0x17'))(_0xd44a('0x18'));var utils=require(_0xd44a('0x19'));var config=require(_0xd44a('0x1a'));var licenseUtil=require(_0xd44a('0x1b'));var db=require(_0xd44a('0x1c'))['db'];function respondWithStatusCode(_0x7932fb,_0x18441a){_0x18441a=_0x18441a||0xcc;return function(_0x508200){if(_0x508200){return _0x7932fb[_0xd44a('0x1d')](_0x18441a);}return _0x7932fb[_0xd44a('0x1e')](_0x18441a)[_0xd44a('0x1f')]();};}function respondWithResult(_0x34ed42,_0x5d2e50){_0x5d2e50=_0x5d2e50||0xc8;return function(_0x583013){if(_0x583013){return _0x34ed42[_0xd44a('0x1e')](_0x5d2e50)[_0xd44a('0x20')](_0x583013);}};}function respondWithFilteredResult(_0x5506d5,_0x9f7db9){return function(_0x3775a1){if(_0x3775a1){var _0x4ab895=typeof _0x9f7db9[_0xd44a('0x21')]===_0xd44a('0x22')&&typeof _0x9f7db9[_0xd44a('0x23')]==='undefined';var _0x443732=_0x3775a1['count'];var _0x152629=_0x4ab895?0x0:_0x9f7db9['offset'];var _0x11ddf0=_0x4ab895?_0x3775a1[_0xd44a('0x24')]:_0x9f7db9[_0xd44a('0x21')]+_0x9f7db9[_0xd44a('0x23')];var _0x152768;if(_0x11ddf0>=_0x443732){_0x11ddf0=_0x443732;_0x152768=0xc8;}else{_0x152768=0xce;}_0x5506d5['status'](_0x152768);return _0x5506d5['set'](_0xd44a('0x25'),_0x152629+'-'+_0x11ddf0+'/'+_0x443732)[_0xd44a('0x20')](_0x3775a1);}return null;};}function patchUpdates(_0x2adb34){return function(_0x372aa9){try{jsonpatch[_0xd44a('0x26')](_0x372aa9,_0x2adb34,!![]);}catch(_0x66b12a){return BPromise['reject'](_0x66b12a);}return _0x372aa9[_0xd44a('0x27')]();};}function saveUpdates(_0x3337e8,_0x17ff6e){return function(_0x458ed1){if(_0x458ed1){return _0x458ed1[_0xd44a('0x28')](_0x3337e8)[_0xd44a('0x29')](function(_0x4f644d){return _0x4f644d;});}return null;};}function removeEntity(_0x539276,_0x1071d4){return function(_0x17232f){if(_0x17232f){return _0x17232f[_0xd44a('0x2a')]()[_0xd44a('0x29')](function(){var _0x31bef8=_0x17232f[_0xd44a('0x2b')]({'plain':!![]});var _0x46cdba=_0xd44a('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x46cdba,'resourceId':_0x31bef8['id']}})['then'](function(){return _0x17232f;});})[_0xd44a('0x29')](function(){_0x539276[_0xd44a('0x1e')](0xcc)[_0xd44a('0x1f')]();});}};}function handleEntityNotFound(_0x2bd4c1,_0xe467ea){return function(_0x532070){if(!_0x532070){_0x2bd4c1['sendStatus'](0x194);}return _0x532070;};}function handleError(_0x4ec497,_0x11611b){_0x11611b=_0x11611b||0x1f4;return function(_0x3d9eab){logger[_0xd44a('0x2d')](_0x3d9eab[_0xd44a('0x2e')]);if(_0x3d9eab[_0xd44a('0x2f')]){delete _0x3d9eab['name'];}_0x4ec497['status'](_0x11611b)[_0xd44a('0x30')](_0x3d9eab);};}exports[_0xd44a('0x31')]=function(_0x2823e8,_0x3ff08a){var _0x23d9f5={},_0x3b1fb0={},_0x3caf6c={'count':0x0,'rows':[]};return db['CmCompany'][_0xd44a('0x32')]()[_0xd44a('0x29')](function(_0x7cf04b){_0x3b1fb0[_0xd44a('0x33')]=_[_0xd44a('0x34')](_0x7cf04b);_0x3b1fb0[_0xd44a('0x35')]=_['keys'](_0x2823e8[_0xd44a('0x35')]);_0x3b1fb0[_0xd44a('0x36')]=_['intersection'](_0x3b1fb0['model'],_0x3b1fb0[_0xd44a('0x35')]);_0x23d9f5['attributes']=_[_0xd44a('0x37')](_0x3b1fb0[_0xd44a('0x33')],qs['fields'](_0x2823e8['query']['fields']));_0x23d9f5[_0xd44a('0x38')]=_0x23d9f5[_0xd44a('0x38')][_0xd44a('0x39')]?_0x23d9f5[_0xd44a('0x38')]:_0x3b1fb0[_0xd44a('0x33')];if(!_0x2823e8[_0xd44a('0x35')]['hasOwnProperty'](_0xd44a('0x3a'))){_0x23d9f5[_0xd44a('0x23')]=qs[_0xd44a('0x23')](_0x2823e8[_0xd44a('0x35')][_0xd44a('0x23')]);_0x23d9f5['offset']=qs[_0xd44a('0x21')](_0x2823e8[_0xd44a('0x35')][_0xd44a('0x21')]);}_0x23d9f5['order']=qs[_0xd44a('0x3b')](_0x2823e8[_0xd44a('0x35')][_0xd44a('0x3b')]);_0x23d9f5[_0xd44a('0x3c')]=qs[_0xd44a('0x36')](_[_0xd44a('0x3d')](_0x2823e8[_0xd44a('0x35')],_0x3b1fb0['filters']),_0x7cf04b);if(_0x2823e8[_0xd44a('0x35')][_0xd44a('0x3e')]){_0x23d9f5[_0xd44a('0x3c')]=_['merge'](_0x23d9f5['where'],{'$or':_[_0xd44a('0x3f')](_0x23d9f5[_0xd44a('0x38')],function(_0x4674a1){var _0x266f25={};_0x266f25[_0x4674a1]={'$like':'%'+_0x2823e8[_0xd44a('0x35')][_0xd44a('0x3e')]+'%'};return _0x266f25;})});}_0x23d9f5=_[_0xd44a('0x40')]({},_0x23d9f5,_0x2823e8[_0xd44a('0x41')]);var _0x235227={'where':_0x23d9f5[_0xd44a('0x3c')]};return db[_0xd44a('0x42')][_0xd44a('0x24')](_0x235227)[_0xd44a('0x29')](function(_0x5f287d){_0x3caf6c[_0xd44a('0x24')]=_0x5f287d;if(_0x2823e8[_0xd44a('0x35')][_0xd44a('0x43')]){_0x23d9f5[_0xd44a('0x44')]=[{'all':!![]}];}return db[_0xd44a('0x42')][_0xd44a('0x45')](_0x23d9f5);})[_0xd44a('0x29')](function(_0x294e5f){_0x3caf6c[_0xd44a('0x46')]=_0x294e5f;return _0x3caf6c;})['then'](respondWithFilteredResult(_0x3ff08a,_0x23d9f5))[_0xd44a('0x47')](handleError(_0x3ff08a,null));})[_0xd44a('0x47')](handleError(_0x3ff08a,null));};exports['show']=function(_0x1e68be,_0x1af736){var _0x5ad248={'raw':![],'where':{'id':_0x1e68be[_0xd44a('0x48')]['id']}},_0xb05854={};_0xb05854[_0xd44a('0x33')]=_['keys'](db[_0xd44a('0x42')][_0xd44a('0x49')]);_0xb05854['query']=_['keys'](_0x1e68be[_0xd44a('0x35')]);_0xb05854['filters']=_['intersection'](_0xb05854[_0xd44a('0x33')],_0xb05854[_0xd44a('0x35')]);_0x5ad248[_0xd44a('0x38')]=_[_0xd44a('0x37')](_0xb05854[_0xd44a('0x33')],qs[_0xd44a('0x4a')](_0x1e68be['query'][_0xd44a('0x4a')]));_0x5ad248['attributes']=_0x5ad248['attributes'][_0xd44a('0x39')]?_0x5ad248[_0xd44a('0x38')]:_0xb05854[_0xd44a('0x33')];if(_0x1e68be[_0xd44a('0x35')][_0xd44a('0x43')]){_0x5ad248[_0xd44a('0x44')]=[{'all':!![]}];}_0x5ad248=_[_0xd44a('0x40')]({},_0x5ad248,_0x1e68be[_0xd44a('0x41')]);return db[_0xd44a('0x42')][_0xd44a('0x4b')](_0x5ad248)['then'](handleEntityNotFound(_0x1af736,null))[_0xd44a('0x29')](respondWithResult(_0x1af736,null))['catch'](handleError(_0x1af736,null));};exports['create']=function(_0x337667,_0x113014){return db['CmCompany'][_0xd44a('0x4c')](_0x337667['body'],{})['then'](function(_0x12247b){var _0xb7ff5b=_0x337667['user'][_0xd44a('0x2b')]({'plain':!![]});if(!_0xb7ff5b)throw new Error(_0xd44a('0x4d'));if(_0xb7ff5b['role']===_0xd44a('0x4e')){var _0x5e9bb6=_0x12247b[_0xd44a('0x2b')]({'plain':!![]});var _0x127fde='Companies';return db['UserProfileSection']['find']({'where':{'name':_0x127fde,'userProfileId':_0xb7ff5b[_0xd44a('0x4f')]},'raw':!![]})[_0xd44a('0x29')](function(_0x536cc6){if(_0x536cc6&&_0x536cc6['autoAssociation']===0x0){return db[_0xd44a('0x50')][_0xd44a('0x4c')]({'name':_0x5e9bb6[_0xd44a('0x2f')],'resourceId':_0x5e9bb6['id'],'type':_0x536cc6[_0xd44a('0x2f')],'sectionId':_0x536cc6['id']},{})[_0xd44a('0x29')](function(){return _0x12247b;});}else{return _0x12247b;}})[_0xd44a('0x47')](function(_0xf4d17c){logger['error'](_0xd44a('0x51'),_0xf4d17c);throw _0xf4d17c;});}return _0x12247b;})[_0xd44a('0x29')](respondWithResult(_0x113014,0xc9))[_0xd44a('0x47')](handleError(_0x113014,null));};exports['update']=function(_0x165502,_0xe4638f){if(_0x165502['body']['id']){delete _0x165502[_0xd44a('0x52')]['id'];}return db[_0xd44a('0x42')][_0xd44a('0x4b')]({'where':{'id':_0x165502[_0xd44a('0x48')]['id']}})['then'](handleEntityNotFound(_0xe4638f,null))[_0xd44a('0x29')](saveUpdates(_0x165502[_0xd44a('0x52')],null))['then'](respondWithResult(_0xe4638f,null))[_0xd44a('0x47')](handleError(_0xe4638f,null));};exports[_0xd44a('0x2a')]=function(_0x505d8c,_0x1a4c53){return db['CmCompany']['find']({'where':{'id':_0x505d8c['params']['id']}})[_0xd44a('0x29')](handleEntityNotFound(_0x1a4c53,null))[_0xd44a('0x29')](removeEntity(_0x1a4c53,null))['catch'](handleError(_0x1a4c53,null));};exports[_0xd44a('0x32')]=function(_0x177d27,_0x522b14){return db['CmCompany'][_0xd44a('0x32')]()[_0xd44a('0x29')](respondWithResult(_0x522b14,null))[_0xd44a('0x47')](handleError(_0x522b14,null));};exports['addContacts']=function(_0x241611,_0x24d6ee,_0x7d0f52){return db[_0xd44a('0x53')][_0xd44a('0x4b')]({'where':{'id':_0x241611[_0xd44a('0x48')]['id']}})['then'](handleEntityNotFound(_0x24d6ee,null))[_0xd44a('0x29')](function(_0x311fcf){if(_0x311fcf){return _0x311fcf[_0xd44a('0x54')](_0x241611['body']['ids'],_[_0xd44a('0x55')](_0x241611['body'],['ids','id'])||{});}})[_0xd44a('0x29')](respondWithResult(_0x24d6ee,null))[_0xd44a('0x47')](handleError(_0x24d6ee,null));};exports[_0xd44a('0x56')]=function(_0x177543,_0x327b62,_0x4bd93c){var _0x48872a={};var _0x3dbaf5={};var _0x7658ed;var _0x38c11b;return db[_0xd44a('0x42')][_0xd44a('0x57')]({'where':{'id':_0x177543[_0xd44a('0x48')]['id']}})[_0xd44a('0x29')](handleEntityNotFound(_0x327b62,null))[_0xd44a('0x29')](function(_0x171322){if(_0x171322){_0x7658ed=_0x171322;_0x3dbaf5[_0xd44a('0x33')]=_[_0xd44a('0x34')](db[_0xd44a('0x53')][_0xd44a('0x49')]);_0x3dbaf5[_0xd44a('0x35')]=_[_0xd44a('0x34')](_0x177543[_0xd44a('0x35')]);_0x3dbaf5[_0xd44a('0x36')]=_['intersection'](_0x3dbaf5[_0xd44a('0x33')],_0x3dbaf5['query']);_0x48872a['attributes']=_['intersection'](_0x3dbaf5[_0xd44a('0x33')],qs[_0xd44a('0x4a')](_0x177543[_0xd44a('0x35')]['fields']));_0x48872a['attributes']=_0x48872a[_0xd44a('0x38')][_0xd44a('0x39')]?_0x48872a['attributes']:_0x3dbaf5['model'];_0x48872a[_0xd44a('0x58')]=qs[_0xd44a('0x3b')](_0x177543[_0xd44a('0x35')]['sort']);_0x48872a[_0xd44a('0x3c')]=qs[_0xd44a('0x36')](_[_0xd44a('0x3d')](_0x177543[_0xd44a('0x35')],_0x3dbaf5['filters']));if(_0x177543['query'][_0xd44a('0x3e')]){_0x48872a[_0xd44a('0x3c')]=_[_0xd44a('0x40')](_0x48872a[_0xd44a('0x3c')],{'$or':_[_0xd44a('0x3f')](_0x48872a[_0xd44a('0x38')],function(_0x5ccf73){var _0xc0dc7={};_0xc0dc7[_0x5ccf73]={'$like':'%'+_0x177543['query'][_0xd44a('0x3e')]+'%'};return _0xc0dc7;})});}_0x48872a=_[_0xd44a('0x40')]({},_0x48872a,_0x177543[_0xd44a('0x41')]);return _0x7658ed[_0xd44a('0x56')](_0x48872a);}})[_0xd44a('0x29')](function(_0x2ad4bf){if(_0x2ad4bf){_0x38c11b=_0x2ad4bf[_0xd44a('0x39')];if(!_0x177543['query']['hasOwnProperty'](_0xd44a('0x3a'))){_0x48872a['limit']=qs[_0xd44a('0x23')](_0x177543['query'][_0xd44a('0x23')]);_0x48872a[_0xd44a('0x21')]=qs[_0xd44a('0x21')](_0x177543['query'][_0xd44a('0x21')]);}return _0x7658ed[_0xd44a('0x56')](_0x48872a);}})[_0xd44a('0x29')](function(_0x2695d3){if(_0x2695d3){return _0x2695d3?{'count':_0x38c11b,'rows':_0x2695d3}:null;}})[_0xd44a('0x29')](respondWithResult(_0x327b62,null))[_0xd44a('0x47')](handleError(_0x327b62,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 5823592..e9d9b0c 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 _0xdf88=['CmCompany','cm_companies','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf88,0x91));var _0x8df8=function(_0x1340b3,_0x3d52bb){_0x1340b3=_0x1340b3-0x0;var _0x43f7c0=_0xdf88[_0x1340b3];return _0x43f7c0;};'use strict';var _=require(_0x8df8('0x0'));var util=require('util');var logger=require(_0x8df8('0x1'))(_0x8df8('0x2'));var moment=require(_0x8df8('0x3'));var BPromise=require(_0x8df8('0x4'));var rp=require(_0x8df8('0x5'));var fs=require('fs');var path=require(_0x8df8('0x6'));var rimraf=require(_0x8df8('0x7'));var config=require(_0x8df8('0x8'));var attributes=require(_0x8df8('0x9'));module['exports']=function(_0x11319e,_0xa3845a){return _0x11319e[_0x8df8('0xa')](_0x8df8('0xb'),attributes,{'tableName':_0x8df8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbdb4=['lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','define','CmCompany'];(function(_0x517ad3,_0x6181f5){var _0x4dbff4=function(_0x10f378){while(--_0x10f378){_0x517ad3['push'](_0x517ad3['shift']());}};_0x4dbff4(++_0x6181f5);}(_0xbdb4,0x78));var _0x4bdb=function(_0x3893c9,_0x584785){_0x3893c9=_0x3893c9-0x0;var _0xb3ebc2=_0xbdb4[_0x3893c9];return _0xb3ebc2;};'use strict';var _=require(_0x4bdb('0x0'));var util=require('util');var logger=require(_0x4bdb('0x1'))(_0x4bdb('0x2'));var moment=require('moment');var BPromise=require(_0x4bdb('0x3'));var rp=require(_0x4bdb('0x4'));var fs=require('fs');var path=require(_0x4bdb('0x5'));var rimraf=require('rimraf');var config=require(_0x4bdb('0x6'));var attributes=require(_0x4bdb('0x7'));module['exports']=function(_0x59ea2e,_0x4b2232){return _0x59ea2e[_0x4bdb('0x8')](_0x4bdb('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 1d45118..8f36b59 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 _0x1d87=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','stringify','error','code','message','CmCompany,\x20%s,\x20%s','info','result','lodash','util','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d87,0x1cb));var _0x71d8=function(_0x18d5d7,_0x19074b){_0x18d5d7=_0x18d5d7-0x0;var _0x30a9ea=_0x1d87[_0x18d5d7];return _0x30a9ea;};'use strict';var _=require(_0x71d8('0x0'));var util=require(_0x71d8('0x1'));var moment=require('moment');var BPromise=require(_0x71d8('0x2'));var rs=require(_0x71d8('0x3'));var fs=require('fs');var Redis=require(_0x71d8('0x4'));var db=require(_0x71d8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x71d8('0x6'))(_0x71d8('0x7'));var config=require(_0x71d8('0x8'));var jayson=require(_0x71d8('0x9'));var client=jayson[_0x71d8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x169c4e,_0x4531b0,_0x121b06){return new BPromise(function(_0x395e40,_0x393b34){return client[_0x71d8('0xb')](_0x169c4e,_0x121b06)[_0x71d8('0xc')](function(_0x3d4be2){logger['info']('CmCompany,\x20%s,\x20%s',_0x4531b0,_0x71d8('0xd'));logger[_0x71d8('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x4531b0,_0x71d8('0xd'),JSON[_0x71d8('0xf')](_0x3d4be2));if(_0x3d4be2[_0x71d8('0x10')]){if(_0x3d4be2[_0x71d8('0x10')][_0x71d8('0x11')]===0x1f4){logger[_0x71d8('0x10')]('CmCompany,\x20%s,\x20%s',_0x4531b0,_0x3d4be2[_0x71d8('0x10')][_0x71d8('0x12')]);return _0x393b34(_0x3d4be2['error']['message']);}logger['error'](_0x71d8('0x13'),_0x4531b0,_0x3d4be2['error']['message']);return _0x395e40(_0x3d4be2[_0x71d8('0x10')][_0x71d8('0x12')]);}else{logger[_0x71d8('0x14')](_0x71d8('0x13'),_0x4531b0,_0x71d8('0xd'));_0x395e40(_0x3d4be2[_0x71d8('0x15')]['message']);}})['catch'](function(_0x255b1e){logger[_0x71d8('0x10')](_0x71d8('0x13'),_0x4531b0,_0x255b1e);_0x393b34(_0x255b1e);});});}
\ No newline at end of file
+var _0xceca=['lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','request\x20sent','error','code','message','CmCompany,\x20%s,\x20%s','result'];(function(_0x584928,_0x1ce73f){var _0x4811c9=function(_0x114fe5){while(--_0x114fe5){_0x584928['push'](_0x584928['shift']());}};_0x4811c9(++_0x1ce73f);}(_0xceca,0xe1));var _0xacec=function(_0xde9b70,_0x1c0d60){_0xde9b70=_0xde9b70-0x0;var _0x38db14=_0xceca[_0xde9b70];return _0x38db14;};'use strict';var _=require(_0xacec('0x0'));var util=require(_0xacec('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xacec('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xacec('0x3'))['db'];var utils=require(_0xacec('0x4'));var logger=require('../../config/logger')(_0xacec('0x5'));var config=require(_0xacec('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xacec('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3dd9c,_0x1acb40,_0x35d2c6){return new BPromise(function(_0x18088b,_0x49b103){return client['request'](_0x3dd9c,_0x35d2c6)[_0xacec('0x8')](function(_0x1a9d39){logger['info']('CmCompany,\x20%s,\x20%s',_0x1acb40,_0xacec('0x9'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x1acb40,_0xacec('0x9'),JSON['stringify'](_0x1a9d39));if(_0x1a9d39[_0xacec('0xa')]){if(_0x1a9d39['error'][_0xacec('0xb')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x1acb40,_0x1a9d39[_0xacec('0xa')][_0xacec('0xc')]);return _0x49b103(_0x1a9d39[_0xacec('0xa')][_0xacec('0xc')]);}logger[_0xacec('0xa')]('CmCompany,\x20%s,\x20%s',_0x1acb40,_0x1a9d39[_0xacec('0xa')][_0xacec('0xc')]);return _0x18088b(_0x1a9d39['error'][_0xacec('0xc')]);}else{logger['info'](_0xacec('0xd'),_0x1acb40,_0xacec('0x9'));_0x18088b(_0x1a9d39[_0xacec('0xe')]['message']);}})['catch'](function(_0x1c0aa7){logger[_0xacec('0xa')](_0xacec('0xd'),_0x1acb40,_0x1c0aa7);_0x49b103(_0x1c0aa7);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index ca32ffe..7f50b60 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 _0xe49c=['get','isAuthenticated','describe','show','/:id/contacts','getContacts','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x618ad6,_0x4992d2){var _0x277505=function(_0x3bf48c){while(--_0x3bf48c){_0x618ad6['push'](_0x618ad6['shift']());}};_0x277505(++_0x4992d2);}(_0xe49c,0x189));var _0xce49=function(_0x42e013,_0x4e1584){_0x42e013=_0x42e013-0x0;var _0x3e951b=_0xe49c[_0x42e013];return _0x3e951b;};'use strict';var multer=require(_0xce49('0x0'));var util=require(_0xce49('0x1'));var path=require(_0xce49('0x2'));var timeout=require(_0xce49('0x3'));var express=require('express');var router=express[_0xce49('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xce49('0x5'));var config=require(_0xce49('0x6'));var controller=require('./cmCompany.controller');router[_0xce49('0x7')]('/',auth[_0xce49('0x8')](),controller['index']);router[_0xce49('0x7')]('/describe',auth[_0xce49('0x8')](),controller[_0xce49('0x9')]);router[_0xce49('0x7')]('/:id',auth[_0xce49('0x8')](),controller[_0xce49('0xa')]);router[_0xce49('0x7')](_0xce49('0xb'),auth[_0xce49('0x8')](),controller[_0xce49('0xc')]);router[_0xce49('0xd')]('/',auth['isAuthenticated'](),controller[_0xce49('0xe')]);router[_0xce49('0xd')](_0xce49('0xb'),auth[_0xce49('0x8')](),controller['addContacts']);router[_0xce49('0xf')](_0xce49('0x10'),auth[_0xce49('0x8')](),controller['update']);router[_0xce49('0x11')](_0xce49('0x10'),auth[_0xce49('0x8')](),controller[_0xce49('0x12')]);module[_0xce49('0x13')]=router;
\ No newline at end of file
+var _0x49ad=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','destroy','multer','util','express','Router'];(function(_0x374d40,_0x40aea){var _0x50a6fd=function(_0x4c01c5){while(--_0x4c01c5){_0x374d40['push'](_0x374d40['shift']());}};_0x50a6fd(++_0x40aea);}(_0x49ad,0x13e));var _0xd49a=function(_0x1d4934,_0x273e2b){_0x1d4934=_0x1d4934-0x0;var _0x3603f7=_0x49ad[_0x1d4934];return _0x3603f7;};'use strict';var multer=require(_0xd49a('0x0'));var util=require(_0xd49a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd49a('0x2'));var router=express[_0xd49a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd49a('0x4'));var interaction=require(_0xd49a('0x5'));var config=require(_0xd49a('0x6'));var controller=require(_0xd49a('0x7'));router[_0xd49a('0x8')]('/',auth['isAuthenticated'](),controller[_0xd49a('0x9')]);router[_0xd49a('0x8')](_0xd49a('0xa'),auth[_0xd49a('0xb')](),controller[_0xd49a('0xc')]);router['get'](_0xd49a('0xd'),auth[_0xd49a('0xb')](),controller[_0xd49a('0xe')]);router[_0xd49a('0x8')](_0xd49a('0xf'),auth[_0xd49a('0xb')](),controller[_0xd49a('0x10')]);router[_0xd49a('0x11')]('/',auth[_0xd49a('0xb')](),controller[_0xd49a('0x12')]);router[_0xd49a('0x11')](_0xd49a('0xf'),auth[_0xd49a('0xb')](),controller[_0xd49a('0x13')]);router[_0xd49a('0x14')](_0xd49a('0xd'),auth[_0xd49a('0xb')](),controller[_0xd49a('0x15')]);router['delete']('/:id',auth[_0xd49a('0xb')](),controller[_0xd49a('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 20ba0c8..94b2b2a 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 _0xb99d=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','lodash','sequelize'];(function(_0x50521f,_0x4375b3){var _0x29b4be=function(_0x1cb06e){while(--_0x1cb06e){_0x50521f['push'](_0x50521f['shift']());}};_0x29b4be(++_0x4375b3);}(_0xb99d,0x146));var _0xdb99=function(_0x159af1,_0x53820c){_0x159af1=_0x159af1-0x0;var _0x5ef35a=_0xb99d[_0x159af1];return _0x5ef35a;};'use strict';var _=require(_0xdb99('0x0'));var Sequelize=require(_0xdb99('0x1'));module[_0xdb99('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xdb99('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xdb99('0x3')]},'description':{'type':Sequelize[_0xdb99('0x4')]},'phone':{'type':Sequelize[_0xdb99('0x3')]},'mobile':{'type':Sequelize[_0xdb99('0x3')]},'fax':{'type':Sequelize[_0xdb99('0x3')]},'email':{'type':Sequelize[_0xdb99('0x3')]},'url':{'type':Sequelize[_0xdb99('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xdb99('0x3')]},'skype':{'type':Sequelize[_0xdb99('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xdb99('0x3')]},'line':{'type':Sequelize[_0xdb99('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xdb99('0x3')]},'UserId':{'type':Sequelize[_0xdb99('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xdb99('0x5')](0x2)[_0xdb99('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xdb99('0x7')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xdb99('0x5')]}};
\ No newline at end of file
+var _0xa4b6=['lodash','exports','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x4555f1,_0x1aec4d){var _0x414541=function(_0x1ffe89){while(--_0x1ffe89){_0x4555f1['push'](_0x4555f1['shift']());}};_0x414541(++_0x1aec4d);}(_0xa4b6,0x1f2));var _0x6a4b=function(_0x21b5bd,_0xbf9644){_0x21b5bd=_0x21b5bd-0x0;var _0x27ea5c=_0xa4b6[_0x21b5bd];return _0x27ea5c;};'use strict';var _=require(_0x6a4b('0x0'));var Sequelize=require('sequelize');module[_0x6a4b('0x1')]={'firstName':{'type':Sequelize[_0x6a4b('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x6a4b('0x2')]},'street':{'type':Sequelize[_0x6a4b('0x2')]},'postalCode':{'type':Sequelize[_0x6a4b('0x2')]},'city':{'type':Sequelize[_0x6a4b('0x2')]},'country':{'type':Sequelize[_0x6a4b('0x2')]},'dateOfBirth':{'type':Sequelize[_0x6a4b('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x6a4b('0x2')]},'mobile':{'type':Sequelize[_0x6a4b('0x2')]},'fax':{'type':Sequelize[_0x6a4b('0x2')]},'email':{'type':Sequelize[_0x6a4b('0x2')]},'url':{'type':Sequelize[_0x6a4b('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x6a4b('0x2')]},'twitter':{'type':Sequelize[_0x6a4b('0x2')]},'skype':{'type':Sequelize[_0x6a4b('0x2')]},'teams':{'type':Sequelize[_0x6a4b('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x6a4b('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x6a4b('0x2')]},'UserId':{'type':Sequelize[_0x6a4b('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x6a4b('0x2')]},'priority':{'type':Sequelize[_0x6a4b('0x3')](0x2)[_0x6a4b('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x6a4b('0x5')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x6a4b('0x2')]},'utcOffset':{'type':Sequelize[_0x6a4b('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index a79b158..54cb0de 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 _0xc2ad=['mergeWith','join','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','isArray','isNil','dialTimezone','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','ListId','findOrCreate','spread','push','contact','all','Tag','color','ContactItemType','literal','Phones.OrderBy','$and','map','format','cf_%d','timezones','omit','pickBy','startsWith','table','cm_contacts','id\x20=\x20?','toParam','sequelize','text','phone','getTags','findOne','model','rawAttributes','filters','intersection','attributes','fields','order','sort','filter','nolimit','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','create','PHONE','item','ItemType','`ItemType`.OrderBy','CmHopperId','CmHopperAdditionalPhone','getAdditionalPhones','duplicateAdditionalPhones','CmContactId','toContactId','hopperId','getHoppers','pick','ContactId','options','includeAll','include','rows','CmHopperHistory','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','file','parse','meta','import','User','No\x20ListId\x20specified','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','agent','../../components/import/cm/csvUpdates','mail','chat','sms','openchannel','voice','-createdAt','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','callerid','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','UserId','DESC','findAndCountAll','fullname','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','key','Tags','customerIp','deviceModel','osName','ratingMessage','ratingValue','referer','subject','substatus','externalUrl','Interaction','Owner','flatten','sortBy','reverse','value','slice','moment','bluebird','util','path','lodash','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','json','offset','undefined','limit','count','set','update','then','status','end','name','index','describe','getOptions','findAll','user','catch','destroy','CmContact','find','params','tags','keys','cf_','columnName','displayName','query','CmCustomField','length','custom','type','values','info','hasOwnProperty','merge','body','from','get'];(function(_0x3a4b75,_0x2be9a4){var _0x58b661=function(_0x50151f){while(--_0x50151f){_0x3a4b75['push'](_0x3a4b75['shift']());}};_0x58b661(++_0x2be9a4);}(_0xc2ad,0xc1));var _0xdc2a=function(_0x1070c5,_0x758964){_0x1070c5=_0x1070c5-0x0;var _0x3a58ee=_0xc2ad[_0x1070c5];return _0x3a58ee;};'use strict';var moment=require(_0xdc2a('0x0'));var BPromise=require(_0xdc2a('0x1'));var util=require(_0xdc2a('0x2'));var path=require(_0xdc2a('0x3'));var fs=require('fs');var _=require(_0xdc2a('0x4'));var squel=require('squel');var Papa=require(_0xdc2a('0x5'));var Redis=require(_0xdc2a('0x6'));var contacts=require(_0xdc2a('0x7'));var qs=require(_0xdc2a('0x8'));var logger=require(_0xdc2a('0x9'))(_0xdc2a('0xa'));var config=require(_0xdc2a('0xb'));var shared=require(_0xdc2a('0xc'));var db=require(_0xdc2a('0xd'))['db'];config['redis']=_[_0xdc2a('0xe')](config[_0xdc2a('0xf')],{'host':_0xdc2a('0x10'),'port':0x18eb});var socket=require(_0xdc2a('0x11'))(new Redis(config[_0xdc2a('0xf')]));require(_0xdc2a('0x12'))[_0xdc2a('0x13')](socket);function respondWithResult(_0x207e6e,_0xc10b78){_0xc10b78=_0xc10b78||0xc8;return function(_0xbb987){if(_0xbb987){return _0x207e6e['status'](_0xc10b78)[_0xdc2a('0x14')](_0xbb987);}};}function respondWithFilteredResult(_0x97a41b,_0x109bd1){return function(_0x2ba8a9){if(_0x2ba8a9){var _0x2afb24=typeof _0x109bd1[_0xdc2a('0x15')]===_0xdc2a('0x16')&&typeof _0x109bd1[_0xdc2a('0x17')]===_0xdc2a('0x16');var _0x5b2ae3=_0x2ba8a9[_0xdc2a('0x18')];var _0x44f010=_0x2afb24?0x0:_0x109bd1['offset'];var _0xb3783d=_0x2afb24?_0x2ba8a9['count']:_0x109bd1[_0xdc2a('0x15')]+_0x109bd1['limit'];var _0x2174fa;if(_0xb3783d>=_0x5b2ae3){_0xb3783d=_0x5b2ae3;_0x2174fa=0xc8;}else{_0x2174fa=0xce;}_0x97a41b['status'](_0x2174fa);return _0x97a41b[_0xdc2a('0x19')]('Content-Range',_0x44f010+'-'+_0xb3783d+'/'+_0x5b2ae3)[_0xdc2a('0x14')](_0x2ba8a9);}return null;};}function saveUpdates(_0x3775f0){return function(_0x13bc2b){if(_0x13bc2b){return _0x13bc2b[_0xdc2a('0x1a')](_0x3775f0)['then'](function(_0x4282c5){return _0x4282c5;});}return null;};}function removeEntity(_0x8100f){return function(_0x25958e){if(_0x25958e){return _0x25958e['destroy']()[_0xdc2a('0x1b')](function(){_0x8100f[_0xdc2a('0x1c')](0xcc)[_0xdc2a('0x1d')]();});}};}function handleEntityNotFound(_0x4af835){return function(_0x54d392){if(!_0x54d392){_0x4af835['sendStatus'](0x194);}return _0x54d392;};}function handleError(_0x27d247,_0x19acc1){_0x19acc1=_0x19acc1||0x1f4;return function(_0x276150){logger['error'](_0x276150['stack']);if(_0x276150[_0xdc2a('0x1e')]){delete _0x276150[_0xdc2a('0x1e')];}_0x27d247[_0xdc2a('0x1c')](_0x19acc1)['send'](_0x276150);};}exports[_0xdc2a('0x1f')]=function(_0x8afd1b,_0x3eca16){var _0x2b2c02={};return contacts[_0xdc2a('0x20')]()[_0xdc2a('0x1b')](function(_0x39afc3){_0x2b2c02=qs[_0xdc2a('0x21')](_0x39afc3,_0x8afd1b);return contacts[_0xdc2a('0x22')](_0x8afd1b['query'],_0x8afd1b[_0xdc2a('0x23')],_0x2b2c02,_0x39afc3);})['then'](respondWithFilteredResult(_0x3eca16,_0x2b2c02))[_0xdc2a('0x24')](handleError(_0x3eca16,null));};exports[_0xdc2a('0x25')]=function(_0xcddc40,_0x410cb1){return db[_0xdc2a('0x26')][_0xdc2a('0x27')]({'where':{'id':_0xcddc40[_0xdc2a('0x28')]['id']}})[_0xdc2a('0x1b')](handleEntityNotFound(_0x410cb1,null))['then'](removeEntity(_0x410cb1,null))[_0xdc2a('0x24')](handleError(_0x410cb1,null));};exports[_0xdc2a('0x20')]=function(_0x47ad8f,_0x2e6551){return db[_0xdc2a('0x26')][_0xdc2a('0x20')]()[_0xdc2a('0x1b')](function(_0x2247ef){delete _0x2247ef[_0xdc2a('0x29')];for(var _0xb47c3=0x0;_0xb47c3
','Attachments','Title','Data','generateXOAuth2Token','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path'];(function(_0x327f2a,_0x1c3f77){var _0x4c5f93=function(_0x130da8){while(--_0x130da8){_0x327f2a['push'](_0x327f2a['shift']());}};_0x4c5f93(++_0x1c3f77);}(_0x8f68,0x94));var _0x88f6=function(_0x1143ed,_0x417a4c){_0x1143ed=_0x1143ed-0x0;var _0x1cfa91=_0x8f68[_0x1143ed];return _0x1cfa91;};'use strict';var _=require(_0x88f6('0x0'));var moment=require(_0x88f6('0x1'));var random=require(_0x88f6('0x2'));var fs=require('fs');var path=require(_0x88f6('0x3'));var util=require('util');var tnef=require(_0x88f6('0x4'));var logger=require('../../../config/logger')(_0x88f6('0x5'));var config=require('../../../config/environment');function getAddress(_0x1bd098){var _0x164001=_['head'](_0x1bd098[_0x88f6('0x6')]);return _0x164001&&_0x164001[_0x88f6('0x7')]?_0x164001[_0x88f6('0x7')]:_0x88f6('0x8')+random['generate'](0x6)+_0x88f6('0x9');}function getFirstName(_0x31562e){var _0x40d85d=_[_0x88f6('0xa')](_0x31562e[_0x88f6('0x6')]);if(_0x40d85d&&_0x40d85d['name']){if(_0x40d85d['name']==_0x40d85d['address']){return _0x40d85d[_0x88f6('0xb')][_0x88f6('0xc')](0x0,_0x40d85d['name'][_0x88f6('0xd')]('@'));}var _0xd177a4=_0x40d85d['name'][_0x88f6('0xe')](/\s+/);return _0xd177a4[_0x88f6('0xf')]>0x1?_0xd177a4['slice'](0x0,-0x1)[_0x88f6('0x10')]('\x20'):_0x40d85d['name'];}return _0x88f6('0x11');}function getLastName(_0x4bd3e9){var _0x1de01a=_[_0x88f6('0xa')](_0x4bd3e9[_0x88f6('0x6')]);if(_0x1de01a&&_0x1de01a[_0x88f6('0xb')]){var _0x58ca88=_0x1de01a['name']['split'](/\s+/);return _0x58ca88[_0x88f6('0xf')]>0x1?_0x58ca88[_0x88f6('0x12')]():'';}return'';}function getMails(_0x19b397,_0x948b6c){var _0x26bde3='';for(var _0x25c239=0x0;_0x25c239<_0x948b6c[_0x88f6('0x6')][_0x88f6('0xf')];_0x25c239+=0x1){if(_0x948b6c['value'][_0x25c239][_0x88f6('0x7')]!==_0x19b397){if(!_[_0x88f6('0x13')](_0x26bde3)){_0x26bde3+=',';}_0x26bde3+=_0x948b6c[_0x88f6('0x6')][_0x25c239]['name']||_0x948b6c[_0x88f6('0x6')][_0x25c239]['address']||'';_0x26bde3+='\x20<';_0x26bde3+=_0x948b6c['value'][_0x25c239][_0x88f6('0x7')]?_0x948b6c['value'][_0x25c239][_0x88f6('0x7')]:_0x88f6('0x8')+random[_0x88f6('0x14')](0x6)+_0x88f6('0x9');_0x26bde3+='>';}}return _0x26bde3;}function parseEmail(_0x5c807c,_0x6577c7,_0x3d5574){if(_0x6577c7[_0x88f6('0x15')]){var _0x607cc1=/