From: support
Date: Tue, 15 Nov 2022 09:42:36 +0000 (+0000)
Subject: Built motion from commit 57b9429b.|2.6.20
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22%7B%7Blicense.chat?a=commitdiff_plain;h=325de9342f7aa86f3dacc435010d0a525fca5f5c;p=motion2.git
Built motion from commit 57b9429b.|2.6.20
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 8067c71..e49d24b 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -1,6 +1,6 @@
define({
"name": "xCALLY Motion API",
- "version": "2.6.19",
+ "version": "2.6.20",
"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": "2022-11-15T09:18:58.678Z",
+ "time": "2022-11-15T09:33:27.365Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 7a26cf5..75bfca4 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -1,6 +1,6 @@
{
"name": "xCALLY Motion API",
- "version": "2.6.19",
+ "version": "2.6.20",
"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": "2022-11-15T09:18:58.678Z",
+ "time": "2022-11-15T09:33:27.365Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 0549b25..1ceedbc 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.19",
+ "version": "2.6.20",
"dependencies": {
"@babel/code-frame": {
"version": "7.18.6",
diff --git a/package.json b/package.json
index f66562f..79e37a8 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.19",
+ "version": "2.6.20",
"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/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 21087b0..8f57521 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 _0x8015=['urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','STRING','integration','jscripty'];(function(_0x58bc0d,_0x33c72a){var _0x2ebf4a=function(_0x8b6841){while(--_0x8b6841){_0x58bc0d['push'](_0x58bc0d['shift']());}};_0x2ebf4a(++_0x33c72a);}(_0x8015,0x1c9));var _0x5801=function(_0xb0fee0,_0x862292){_0xb0fee0=_0xb0fee0-0x0;var _0x3ab619=_0x8015[_0xb0fee0];return _0x3ab619;};'use strict';var Sequelize=require(_0x5801('0x0'));module['exports']={'name':{'type':Sequelize[_0x5801('0x1')],'get':function(_0x1d70af){return this[_0x5801('0x2')](_0x5801('0x3'));}},'action':{'type':Sequelize[_0x5801('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x5801('0x5'),'motionbar',_0x5801('0x6'),_0x5801('0x7'),'browser',_0x5801('0x8'),_0x5801('0x9')]],'msg':_0x5801('0xa')}},'comment':_0x5801('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x5801('0xb')},'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[_0x5801('0x4')](0x1000),'comment':_0x5801('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x5801('0xd')},'data5':{'type':Sequelize[_0x5801('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x5801('0x4')],'comments':_0x5801('0xe')},'data7':{'type':Sequelize['TEXT'],'comments':_0x5801('0xf')}};
\ No newline at end of file
+var _0x71cb=['urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[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]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','integration','motionbar','jscripty'];(function(_0xe51964,_0x433b90){var _0x2c2366=function(_0x1bc95c){while(--_0x1bc95c){_0xe51964['push'](_0xe51964['shift']());}};_0x2c2366(++_0x433b90);}(_0x71cb,0x1ad));var _0xb71c=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x71cb[_0x2f3848];return _0x102668;};'use strict';var Sequelize=require(_0xb71c('0x0'));module[_0xb71c('0x1')]={'name':{'type':Sequelize[_0xb71c('0x2')],'get':function(_0x5f0230){return this[_0xb71c('0x3')](_0xb71c('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xb71c('0x5'),_0xb71c('0x6'),_0xb71c('0x7'),_0xb71c('0x8'),_0xb71c('0x9'),_0xb71c('0xa'),'script']],'msg':_0xb71c('0xb')}},'comment':_0xb71c('0xb')},'data1':{'type':Sequelize[_0xb71c('0xc')](0x1000),'comment':_0xb71c('0xd')},'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['STRING'](0x1000),'comment':_0xb71c('0xe')},'data4':{'type':Sequelize[_0xb71c('0xc')](0x1000),'comments':_0xb71c('0xf')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xb71c('0x10')},'data6':{'type':Sequelize[_0xb71c('0xc')],'comments':_0xb71c('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':_0xb71c('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index a991bcb..e9c8ead 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 _0x1ec6=['undefined','limit','count','Content-Range','save','update','then','destroy','name','body','find','params','catch','Action','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1ec6,0x110));var _0x61ec=function(_0x58e1d8,_0x376aa8){_0x58e1d8=_0x58e1d8-0x0;var _0x566728=_0x1ec6[_0x58e1d8];return _0x566728;};'use strict';var emlformat=require(_0x61ec('0x0'));var rimraf=require(_0x61ec('0x1'));var zipdir=require(_0x61ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x61ec('0x3'));var moment=require(_0x61ec('0x4'));var BPromise=require(_0x61ec('0x5'));var Mustache=require(_0x61ec('0x6'));var util=require('util');var path=require(_0x61ec('0x7'));var sox=require(_0x61ec('0x8'));var csv=require(_0x61ec('0x9'));var ejs=require(_0x61ec('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x61ec('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x61ec('0xc'));var deskjs=require(_0x61ec('0xd'));var toCsv=require(_0x61ec('0x9'));var querystring=require(_0x61ec('0xe'));var Papa=require('papaparse');var Redis=require(_0x61ec('0xf'));var authService=require(_0x61ec('0x10'));var qs=require(_0x61ec('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x61ec('0x12'));var logger=require(_0x61ec('0x13'))(_0x61ec('0x14'));var utils=require(_0x61ec('0x15'));var config=require(_0x61ec('0x16'));var licenseUtil=require(_0x61ec('0x17'));var db=require(_0x61ec('0x18'))['db'];function respondWithStatusCode(_0x2dc463,_0xaf0c03){_0xaf0c03=_0xaf0c03||0xcc;return function(_0x106bcf){if(_0x106bcf){return _0x2dc463[_0x61ec('0x19')](_0xaf0c03);}return _0x2dc463[_0x61ec('0x1a')](_0xaf0c03)['end']();};}function respondWithResult(_0x29bf24,_0x5e9d49){_0x5e9d49=_0x5e9d49||0xc8;return function(_0x3d5415){if(_0x3d5415){return _0x29bf24[_0x61ec('0x1a')](_0x5e9d49)[_0x61ec('0x1b')](_0x3d5415);}};}function respondWithFilteredResult(_0x1c3a53,_0x9c75a5){return function(_0x1be619){if(_0x1be619){var _0xb09db0=typeof _0x9c75a5[_0x61ec('0x1c')]===_0x61ec('0x1d')&&typeof _0x9c75a5[_0x61ec('0x1e')]===_0x61ec('0x1d');var _0x19edcf=_0x1be619[_0x61ec('0x1f')];var _0x2ab11c=_0xb09db0?0x0:_0x9c75a5[_0x61ec('0x1c')];var _0x4eb783=_0xb09db0?_0x1be619['count']:_0x9c75a5[_0x61ec('0x1c')]+_0x9c75a5[_0x61ec('0x1e')];var _0x4d8bf5;if(_0x4eb783>=_0x19edcf){_0x4eb783=_0x19edcf;_0x4d8bf5=0xc8;}else{_0x4d8bf5=0xce;}_0x1c3a53['status'](_0x4d8bf5);return _0x1c3a53['set'](_0x61ec('0x20'),_0x2ab11c+'-'+_0x4eb783+'/'+_0x19edcf)['json'](_0x1be619);}return null;};}function patchUpdates(_0x41c3de){return function(_0x392323){try{jsonpatch['apply'](_0x392323,_0x41c3de,!![]);}catch(_0x1275e1){return BPromise['reject'](_0x1275e1);}return _0x392323[_0x61ec('0x21')]();};}function saveUpdates(_0x3e5227,_0x452c97){return function(_0x5a8812){if(_0x5a8812){return _0x5a8812[_0x61ec('0x22')](_0x3e5227)[_0x61ec('0x23')](function(_0x41439d){return _0x41439d;});}return null;};}function removeEntity(_0x3df01d,_0x411415){return function(_0x5b0794){if(_0x5b0794){return _0x5b0794[_0x61ec('0x24')]()[_0x61ec('0x23')](function(){_0x3df01d[_0x61ec('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35be32,_0x7b7a7f){return function(_0x28146d){if(!_0x28146d){_0x35be32[_0x61ec('0x19')](0x194);}return _0x28146d;};}function handleError(_0x184472,_0x3f289e){_0x3f289e=_0x3f289e||0x1f4;return function(_0x4a4bd7){logger['error'](_0x4a4bd7['stack']);if(_0x4a4bd7[_0x61ec('0x25')]){delete _0x4a4bd7['name'];}_0x184472[_0x61ec('0x1a')](_0x3f289e)['send'](_0x4a4bd7);};}exports[_0x61ec('0x22')]=function(_0x858c74,_0x3f0580){if(_0x858c74['body']['id']){delete _0x858c74[_0x61ec('0x26')]['id'];}return db['Action'][_0x61ec('0x27')]({'where':{'id':_0x858c74[_0x61ec('0x28')]['id']}})[_0x61ec('0x23')](handleEntityNotFound(_0x3f0580,null))[_0x61ec('0x23')](saveUpdates(_0x858c74[_0x61ec('0x26')],null))[_0x61ec('0x23')](respondWithResult(_0x3f0580,null))[_0x61ec('0x29')](handleError(_0x3f0580,null));};exports[_0x61ec('0x24')]=function(_0x30f09f,_0x800ac9){return db[_0x61ec('0x2a')][_0x61ec('0x27')]({'where':{'id':_0x30f09f[_0x61ec('0x28')]['id']}})['then'](handleEntityNotFound(_0x800ac9,null))[_0x61ec('0x23')](removeEntity(_0x800ac9,null))[_0x61ec('0x29')](handleError(_0x800ac9,null));};
\ No newline at end of file
+var _0xa55b=['reject','save','update','destroy','then','end','sendStatus','name','send','body','Action','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x36d1af,_0xd5b07f){var _0x4db072=function(_0x12cbe7){while(--_0x12cbe7){_0x36d1af['push'](_0x36d1af['shift']());}};_0x4db072(++_0xd5b07f);}(_0xa55b,0x12d));var _0xba55=function(_0x10b20e,_0x3749a3){_0x10b20e=_0x10b20e-0x0;var _0x316ab3=_0xa55b[_0x10b20e];return _0x316ab3;};'use strict';var emlformat=require(_0xba55('0x0'));var rimraf=require(_0xba55('0x1'));var zipdir=require(_0xba55('0x2'));var jsonpatch=require(_0xba55('0x3'));var rp=require('request-promise');var moment=require(_0xba55('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xba55('0x5'));var util=require('util');var path=require(_0xba55('0x6'));var sox=require(_0xba55('0x7'));var csv=require(_0xba55('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba55('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xba55('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba55('0x8'));var querystring=require(_0xba55('0xb'));var Papa=require(_0xba55('0xc'));var Redis=require(_0xba55('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xba55('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xba55('0xf'))(_0xba55('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xba55('0x11'))['db'];function respondWithStatusCode(_0x3eda7a,_0x548826){_0x548826=_0x548826||0xcc;return function(_0x1ed503){if(_0x1ed503){return _0x3eda7a['sendStatus'](_0x548826);}return _0x3eda7a[_0xba55('0x12')](_0x548826)['end']();};}function respondWithResult(_0x2eea84,_0x2366ad){_0x2366ad=_0x2366ad||0xc8;return function(_0x1ef7c6){if(_0x1ef7c6){return _0x2eea84[_0xba55('0x12')](_0x2366ad)[_0xba55('0x13')](_0x1ef7c6);}};}function respondWithFilteredResult(_0x3c7206,_0x4b3dd4){return function(_0x293674){if(_0x293674){var _0x3c72e8=typeof _0x4b3dd4[_0xba55('0x14')]===_0xba55('0x15')&&typeof _0x4b3dd4[_0xba55('0x16')]===_0xba55('0x15');var _0x367744=_0x293674[_0xba55('0x17')];var _0x38a3b2=_0x3c72e8?0x0:_0x4b3dd4['offset'];var _0x4e283a=_0x3c72e8?_0x293674[_0xba55('0x17')]:_0x4b3dd4[_0xba55('0x14')]+_0x4b3dd4[_0xba55('0x16')];var _0x12ef9b;if(_0x4e283a>=_0x367744){_0x4e283a=_0x367744;_0x12ef9b=0xc8;}else{_0x12ef9b=0xce;}_0x3c7206['status'](_0x12ef9b);return _0x3c7206[_0xba55('0x18')](_0xba55('0x19'),_0x38a3b2+'-'+_0x4e283a+'/'+_0x367744)['json'](_0x293674);}return null;};}function patchUpdates(_0xde57b2){return function(_0x292f06){try{jsonpatch[_0xba55('0x1a')](_0x292f06,_0xde57b2,!![]);}catch(_0x1faea0){return BPromise[_0xba55('0x1b')](_0x1faea0);}return _0x292f06[_0xba55('0x1c')]();};}function saveUpdates(_0x20e6f3,_0x4370e9){return function(_0x47a340){if(_0x47a340){return _0x47a340[_0xba55('0x1d')](_0x20e6f3)['then'](function(_0x1f7db3){return _0x1f7db3;});}return null;};}function removeEntity(_0x514c77,_0x43f311){return function(_0x330018){if(_0x330018){return _0x330018[_0xba55('0x1e')]()[_0xba55('0x1f')](function(){_0x514c77['status'](0xcc)[_0xba55('0x20')]();});}};}function handleEntityNotFound(_0x40e4a4,_0x440ddc){return function(_0x5d88f6){if(!_0x5d88f6){_0x40e4a4[_0xba55('0x21')](0x194);}return _0x5d88f6;};}function handleError(_0x1361bb,_0x303a30){_0x303a30=_0x303a30||0x1f4;return function(_0x5cfa8b){logger['error'](_0x5cfa8b['stack']);if(_0x5cfa8b[_0xba55('0x22')]){delete _0x5cfa8b['name'];}_0x1361bb[_0xba55('0x12')](_0x303a30)[_0xba55('0x23')](_0x5cfa8b);};}exports[_0xba55('0x1d')]=function(_0x1daa5a,_0x199ce4){if(_0x1daa5a[_0xba55('0x24')]['id']){delete _0x1daa5a[_0xba55('0x24')]['id'];}return db[_0xba55('0x25')][_0xba55('0x26')]({'where':{'id':_0x1daa5a['params']['id']}})['then'](handleEntityNotFound(_0x199ce4,null))[_0xba55('0x1f')](saveUpdates(_0x1daa5a['body'],null))[_0xba55('0x1f')](respondWithResult(_0x199ce4,null))[_0xba55('0x27')](handleError(_0x199ce4,null));};exports[_0xba55('0x1e')]=function(_0x3d0c68,_0x4c1265){return db['Action'][_0xba55('0x26')]({'where':{'id':_0x3d0c68[_0xba55('0x28')]['id']}})[_0xba55('0x1f')](handleEntityNotFound(_0x4c1265,null))[_0xba55('0x1f')](removeEntity(_0x4c1265,null))[_0xba55('0x27')](handleError(_0x4c1265,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 8bd57c4..3ecaf47 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 _0x9e07=['exports','Action','lodash','util','moment','request-promise','rimraf','../../config/environment','./action.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9e07,0x1a0));var _0x79e0=function(_0x6fd6a5,_0x4df3ce){_0x6fd6a5=_0x6fd6a5-0x0;var _0x53036f=_0x9e07[_0x6fd6a5];return _0x53036f;};'use strict';var _=require(_0x79e0('0x0'));var util=require(_0x79e0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x79e0('0x2'));var BPromise=require('bluebird');var rp=require(_0x79e0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79e0('0x4'));var config=require(_0x79e0('0x5'));var attributes=require(_0x79e0('0x6'));module[_0x79e0('0x7')]=function(_0x194d54,_0x211e6c){return _0x194d54['define'](_0x79e0('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0706=['tools_actions','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes','define','Action'];(function(_0x50d4b5,_0x183b95){var _0x29f3a2=function(_0x3298d6){while(--_0x3298d6){_0x50d4b5['push'](_0x50d4b5['shift']());}};_0x29f3a2(++_0x183b95);}(_0x0706,0x91));var _0x6070=function(_0x240c42,_0x33f5c1){_0x240c42=_0x240c42-0x0;var _0x53d6e2=_0x0706[_0x240c42];return _0x53d6e2;};'use strict';var _=require(_0x6070('0x0'));var util=require('util');var logger=require(_0x6070('0x1'))(_0x6070('0x2'));var moment=require(_0x6070('0x3'));var BPromise=require('bluebird');var rp=require(_0x6070('0x4'));var fs=require('fs');var path=require(_0x6070('0x5'));var rimraf=require(_0x6070('0x6'));var config=require(_0x6070('0x7'));var attributes=require(_0x6070('0x8'));module['exports']=function(_0x57f651,_0x35b3b2){return _0x57f651[_0x6070('0x9')](_0x6070('0xa'),attributes,{'tableName':_0x6070('0xb'),'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 5469366..383964a 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x51a98d,_0x1d2e28){var _0x3ffd96=function(_0x4c27d9){while(--_0x4c27d9){_0x51a98d['push'](_0x51a98d['shift']());}};_0x3ffd96(++_0x1d2e28);}(_0x5fc3,0xa8));var _0x35fc=function(_0x303c30,_0x16edcb){_0x303c30=_0x303c30-0x0;var _0x43161b=_0x5fc3[_0x303c30];return _0x43161b;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
+var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1c7537,_0x430bef){_0x1c7537=_0x1c7537-0x0;var _0x3ec507=_0x1cb9[_0x1c7537];return _0x3ec507;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index ef03399..b92a3af 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 _0x3403=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete'];(function(_0x329adf,_0x430dea){var _0x480b67=function(_0x5d8728){while(--_0x5d8728){_0x329adf['push'](_0x329adf['shift']());}};_0x480b67(++_0x430dea);}(_0x3403,0x169));var _0x3340=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3403[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x3340('0x0'));var util=require(_0x3340('0x1'));var path=require(_0x3340('0x2'));var timeout=require('connect-timeout');var express=require(_0x3340('0x3'));var router=express[_0x3340('0x4')]();var fs_extra=require(_0x3340('0x5'));var auth=require(_0x3340('0x6'));var interaction=require(_0x3340('0x7'));var config=require(_0x3340('0x8'));var controller=require(_0x3340('0x9'));router[_0x3340('0xa')](_0x3340('0xb'),auth[_0x3340('0xc')](),controller['update']);router[_0x3340('0xd')]('/:id',auth[_0x3340('0xc')](),controller['destroy']);module[_0x3340('0xe')]=router;
\ No newline at end of file
+var _0xbe9f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','delete','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4640f3,_0x2637a4){var _0x4e1a6c=function(_0x42e872){while(--_0x42e872){_0x4640f3['push'](_0x4640f3['shift']());}};_0x4e1a6c(++_0x2637a4);}(_0xbe9f,0x8a));var _0xfbe9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xbe9f[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xfbe9('0x0'));var util=require(_0xfbe9('0x1'));var path=require(_0xfbe9('0x2'));var timeout=require(_0xfbe9('0x3'));var express=require(_0xfbe9('0x4'));var router=express[_0xfbe9('0x5')]();var fs_extra=require(_0xfbe9('0x6'));var auth=require(_0xfbe9('0x7'));var interaction=require(_0xfbe9('0x8'));var config=require(_0xfbe9('0x9'));var controller=require(_0xfbe9('0xa'));router['put'](_0xfbe9('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xfbe9('0xc')](_0xfbe9('0xb'),auth[_0xfbe9('0xd')](),controller[_0xfbe9('0xe')]);module[_0xfbe9('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 7b5531b..c3def4a 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x58a4ca,_0x339bea){var _0x188c2a=function(_0x57713c){while(--_0x57713c){_0x58a4ca['push'](_0x58a4ca['shift']());}};_0x188c2a(++_0x339bea);}(_0xeff8,0x186));var _0x8eff=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xeff8[_0x3e5086];return _0xfeb102;};'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 _0xee14=['STRING','TEXT'];(function(_0x2c732c,_0x3ad39a){var _0x2ccda3=function(_0x33ffb2){while(--_0x33ffb2){_0x2c732c['push'](_0x2c732c['shift']());}};_0x2ccda3(++_0x3ad39a);}(_0xee14,0x13a));var _0x4ee1=function(_0x44f657,_0x48083a){_0x44f657=_0x44f657-0x0;var _0x222d57=_0xee14[_0x44f657];return _0x222d57;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 5cfc2a8..c53f702 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 _0xf819=['crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','options','includeAll','include','rows','show','params','rawAttributes','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','find','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel'];(function(_0x110b95,_0x46a106){var _0x5b78d2=function(_0x503f58){while(--_0x503f58){_0x110b95['push'](_0x110b95['shift']());}};_0x5b78d2(++_0x46a106);}(_0xf819,0x9d));var _0x9f81=function(_0x1f6e37,_0x560390){_0x1f6e37=_0x1f6e37-0x0;var _0x3d17ad=_0xf819[_0x1f6e37];return _0x3d17ad;};'use strict';var emlformat=require(_0x9f81('0x0'));var rimraf=require(_0x9f81('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9f81('0x2'));var rp=require(_0x9f81('0x3'));var moment=require(_0x9f81('0x4'));var BPromise=require(_0x9f81('0x5'));var Mustache=require(_0x9f81('0x6'));var util=require('util');var path=require(_0x9f81('0x7'));var sox=require('sox');var csv=require(_0x9f81('0x8'));var ejs=require(_0x9f81('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f81('0xa'));var squel=require(_0x9f81('0xb'));var crypto=require(_0x9f81('0xc'));var jsforce=require(_0x9f81('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9f81('0x8'));var querystring=require(_0x9f81('0xe'));var Papa=require(_0x9f81('0xf'));var Redis=require('ioredis');var authService=require(_0x9f81('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9f81('0x11'));var hardwareService=require(_0x9f81('0x12'));var logger=require('../../config/logger')(_0x9f81('0x13'));var utils=require('../../config/utils');var config=require(_0x9f81('0x14'));var licenseUtil=require(_0x9f81('0x15'));var db=require(_0x9f81('0x16'))['db'];var dbH=require(_0x9f81('0x16'))[_0x9f81('0x17')];function respondWithStatusCode(_0x196840,_0x3c1f6c){_0x3c1f6c=_0x3c1f6c||0xcc;return function(_0x24683f){if(_0x24683f){return _0x196840[_0x9f81('0x18')](_0x3c1f6c);}return _0x196840[_0x9f81('0x19')](_0x3c1f6c)[_0x9f81('0x1a')]();};}function respondWithResult(_0x578404,_0x1b9410){_0x1b9410=_0x1b9410||0xc8;return function(_0x65d21d){if(_0x65d21d){return _0x578404['status'](_0x1b9410)[_0x9f81('0x1b')](_0x65d21d);}};}function respondWithFilteredResult(_0x3fd3aa,_0xa282){return function(_0x10155b){if(_0x10155b){var _0x216a93=typeof _0xa282['offset']===_0x9f81('0x1c')&&typeof _0xa282[_0x9f81('0x1d')]===_0x9f81('0x1c');var _0x4d0c97=_0x10155b[_0x9f81('0x1e')];var _0x53925b=_0x216a93?0x0:_0xa282[_0x9f81('0x1f')];var _0x2a1851=_0x216a93?_0x10155b[_0x9f81('0x1e')]:_0xa282[_0x9f81('0x1f')]+_0xa282[_0x9f81('0x1d')];var _0x4e5200;if(_0x2a1851>=_0x4d0c97){_0x2a1851=_0x4d0c97;_0x4e5200=0xc8;}else{_0x4e5200=0xce;}_0x3fd3aa['status'](_0x4e5200);return _0x3fd3aa['set'](_0x9f81('0x20'),_0x53925b+'-'+_0x2a1851+'/'+_0x4d0c97)[_0x9f81('0x1b')](_0x10155b);}return null;};}function patchUpdates(_0x30f809){return function(_0x15a88c){try{jsonpatch[_0x9f81('0x21')](_0x15a88c,_0x30f809,!![]);}catch(_0x538e17){return BPromise[_0x9f81('0x22')](_0x538e17);}return _0x15a88c[_0x9f81('0x23')]();};}function saveUpdates(_0x4604d5,_0x6799ad){return function(_0x210200){if(_0x210200){return _0x210200[_0x9f81('0x24')](_0x4604d5)[_0x9f81('0x25')](function(_0x1abb9f){return _0x1abb9f;});}return null;};}function removeEntity(_0x4e0c03,_0x3f1a82){return function(_0x298ea7){if(_0x298ea7){return _0x298ea7[_0x9f81('0x26')]()[_0x9f81('0x25')](function(){var _0x3a4d7a=_0x298ea7[_0x9f81('0x27')]({'plain':!![]});var _0x3f8509=_0x9f81('0x28');return db[_0x9f81('0x29')]['destroy']({'where':{'type':_0x3f8509,'resourceId':_0x3a4d7a['id']}})[_0x9f81('0x25')](function(){return _0x298ea7;});})['then'](function(){_0x4e0c03[_0x9f81('0x19')](0xcc)[_0x9f81('0x1a')]();});}};}function handleEntityNotFound(_0x3dd520,_0x270c5f){return function(_0xaba8c4){if(!_0xaba8c4){_0x3dd520[_0x9f81('0x18')](0x194);}return _0xaba8c4;};}function handleError(_0x25f745,_0x53b61d){_0x53b61d=_0x53b61d||0x1f4;return function(_0x3545ab){logger[_0x9f81('0x2a')](_0x3545ab[_0x9f81('0x2b')]);if(_0x3545ab[_0x9f81('0x2c')]){delete _0x3545ab['name'];}_0x25f745[_0x9f81('0x19')](_0x53b61d)[_0x9f81('0x2d')](_0x3545ab);};}exports[_0x9f81('0x2e')]=function(_0x1129e3,_0x476755){var _0x3a90a9={},_0x1e89f6={},_0x107372={'count':0x0,'rows':[]};var _0x973142=_[_0x9f81('0x2f')](db[_0x9f81('0x30')]['rawAttributes'],function(_0x872a0e){return{'name':_0x872a0e[_0x9f81('0x31')],'type':_0x872a0e[_0x9f81('0x32')][_0x9f81('0x33')]};});_0x1e89f6['model']=_[_0x9f81('0x2f')](_0x973142,'name');_0x1e89f6[_0x9f81('0x34')]=_[_0x9f81('0x35')](_0x1129e3[_0x9f81('0x34')]);_0x1e89f6['filters']=_[_0x9f81('0x36')](_0x1e89f6[_0x9f81('0x37')],_0x1e89f6[_0x9f81('0x34')]);_0x3a90a9['attributes']=_[_0x9f81('0x36')](_0x1e89f6[_0x9f81('0x37')],qs[_0x9f81('0x38')](_0x1129e3[_0x9f81('0x34')][_0x9f81('0x38')]));_0x3a90a9[_0x9f81('0x39')]=_0x3a90a9['attributes'][_0x9f81('0x3a')]?_0x3a90a9[_0x9f81('0x39')]:_0x1e89f6[_0x9f81('0x37')];if(!_0x1129e3[_0x9f81('0x34')][_0x9f81('0x3b')](_0x9f81('0x3c'))){_0x3a90a9[_0x9f81('0x1d')]=qs[_0x9f81('0x1d')](_0x1129e3[_0x9f81('0x34')][_0x9f81('0x1d')]);_0x3a90a9[_0x9f81('0x1f')]=qs[_0x9f81('0x1f')](_0x1129e3[_0x9f81('0x34')][_0x9f81('0x1f')]);}_0x3a90a9[_0x9f81('0x3d')]=qs[_0x9f81('0x3e')](_0x1129e3[_0x9f81('0x34')][_0x9f81('0x3e')]);_0x3a90a9['where']=qs[_0x9f81('0x3f')](_['pick'](_0x1129e3['query'],_0x1e89f6[_0x9f81('0x3f')]),_0x973142);if(_0x1129e3['query']['filter']){_0x3a90a9[_0x9f81('0x40')]=_[_0x9f81('0x41')](_0x3a90a9[_0x9f81('0x40')],{'$or':_[_0x9f81('0x2f')](_0x973142,function(_0x40acdc){if(_0x40acdc[_0x9f81('0x32')]!=='VIRTUAL'){var _0x340597={};_0x340597[_0x40acdc[_0x9f81('0x2c')]]={'$like':'%'+_0x1129e3[_0x9f81('0x34')]['filter']+'%'};return _0x340597;}})});}_0x3a90a9=_['merge']({},_0x3a90a9,_0x1129e3[_0x9f81('0x42')]);var _0x318fcd={'where':_0x3a90a9[_0x9f81('0x40')]};return db['AnalyticCustomReport'][_0x9f81('0x1e')](_0x318fcd)[_0x9f81('0x25')](function(_0x4dcff5){_0x107372[_0x9f81('0x1e')]=_0x4dcff5;if(_0x1129e3[_0x9f81('0x34')][_0x9f81('0x43')]){_0x3a90a9[_0x9f81('0x44')]=[{'all':!![]}];}return db[_0x9f81('0x30')]['findAll'](_0x3a90a9);})[_0x9f81('0x25')](function(_0x4175f2){_0x107372[_0x9f81('0x45')]=_0x4175f2;return _0x107372;})[_0x9f81('0x25')](respondWithFilteredResult(_0x476755,_0x3a90a9))['catch'](handleError(_0x476755,null));};exports[_0x9f81('0x46')]=function(_0x400265,_0x431a0b){var _0x3cc132={'raw':![],'where':{'id':_0x400265[_0x9f81('0x47')]['id']}},_0xdeca88={};_0xdeca88[_0x9f81('0x37')]=_[_0x9f81('0x35')](db['AnalyticCustomReport'][_0x9f81('0x48')]);_0xdeca88['query']=_[_0x9f81('0x35')](_0x400265[_0x9f81('0x34')]);_0xdeca88[_0x9f81('0x3f')]=_[_0x9f81('0x36')](_0xdeca88[_0x9f81('0x37')],_0xdeca88[_0x9f81('0x34')]);_0x3cc132[_0x9f81('0x39')]=_['intersection'](_0xdeca88[_0x9f81('0x37')],qs[_0x9f81('0x38')](_0x400265[_0x9f81('0x34')]['fields']));_0x3cc132[_0x9f81('0x39')]=_0x3cc132[_0x9f81('0x39')][_0x9f81('0x3a')]?_0x3cc132[_0x9f81('0x39')]:_0xdeca88[_0x9f81('0x37')];if(_0x400265[_0x9f81('0x34')][_0x9f81('0x43')]){_0x3cc132[_0x9f81('0x44')]=[{'all':!![]}];}_0x3cc132=_[_0x9f81('0x41')]({},_0x3cc132,_0x400265[_0x9f81('0x42')]);return db['AnalyticCustomReport']['find'](_0x3cc132)['then'](handleEntityNotFound(_0x431a0b,null))[_0x9f81('0x25')](respondWithResult(_0x431a0b,null))[_0x9f81('0x49')](handleError(_0x431a0b,null));};exports[_0x9f81('0x4a')]=function(_0x3a65fb,_0x30aa26){return db[_0x9f81('0x30')]['create'](_0x3a65fb[_0x9f81('0x4b')],{})[_0x9f81('0x25')](function(_0x324a00){var _0x3cda85=_0x3a65fb['user'][_0x9f81('0x27')]({'plain':!![]});if(!_0x3cda85)throw new Error(_0x9f81('0x4c'));if(_0x3cda85[_0x9f81('0x4d')]===_0x9f81('0x4e')){var _0xe679f9=_0x324a00[_0x9f81('0x27')]({'plain':!![]});var _0x4f57fa=_0x9f81('0x4f');return db[_0x9f81('0x50')]['find']({'where':{'name':_0x4f57fa,'userProfileId':_0x3cda85[_0x9f81('0x51')]},'raw':!![]})[_0x9f81('0x25')](function(_0x177496){if(_0x177496&&_0x177496[_0x9f81('0x52')]===0x0){return db[_0x9f81('0x29')][_0x9f81('0x4a')]({'name':_0xe679f9[_0x9f81('0x2c')],'resourceId':_0xe679f9['id'],'type':_0x9f81('0x28'),'sectionId':_0x177496['id']},{})[_0x9f81('0x25')](function(){return _0x324a00;});}else{return _0x324a00;}})[_0x9f81('0x49')](function(_0x2e55fa){logger[_0x9f81('0x2a')](_0x9f81('0x53'),_0x2e55fa);throw _0x2e55fa;});}return _0x324a00;})[_0x9f81('0x25')](respondWithResult(_0x30aa26,0xc9))[_0x9f81('0x49')](handleError(_0x30aa26,null));};exports['update']=function(_0x3d9ea3,_0x1e5006){if(_0x3d9ea3[_0x9f81('0x4b')]['id']){delete _0x3d9ea3[_0x9f81('0x4b')]['id'];}return db[_0x9f81('0x30')]['find']({'where':{'id':_0x3d9ea3['params']['id']}})[_0x9f81('0x25')](handleEntityNotFound(_0x1e5006,null))[_0x9f81('0x25')](saveUpdates(_0x3d9ea3[_0x9f81('0x4b')],null))[_0x9f81('0x25')](respondWithResult(_0x1e5006,null))[_0x9f81('0x49')](handleError(_0x1e5006,null));};exports[_0x9f81('0x26')]=function(_0x252026,_0xbafe0f){return db[_0x9f81('0x30')]['find']({'where':{'id':_0x252026['params']['id']}})[_0x9f81('0x25')](handleEntityNotFound(_0xbafe0f,null))['then'](removeEntity(_0xbafe0f,null))['catch'](handleError(_0xbafe0f,null));};exports[_0x9f81('0x54')]=function(_0x38908a,_0x292b43){var _0x301d58=0xa;var _0x3bcafb=[_0x9f81('0x55'),_0x9f81('0x56'),_0x9f81('0x57'),_0x9f81('0x58')];var _0x223c20={'SUM':_0x9f81('0x59'),'COUNT':_0x9f81('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9f81('0x5b'),'MIN':_0x9f81('0x5c'),'AVG':_0x9f81('0x5d'),'GROUP_CONCAT':_0x9f81('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9f81('0x5f')};var _0x2f4dd8={'SEC_TO_TIME':_0x9f81('0x60'),'DATE':_0x9f81('0x61'),'HOUR':_0x9f81('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x444358=function(_0x189348){return!_[_0x9f81('0x63')]([_0x9f81('0x64'),_0x9f81('0x65'),_0x9f81('0x66'),'IS\x20NOT\x20EMPTY'],_0x189348);};var _0x2741a5=function(_0x3d0ff9){if(!_0x3d0ff9||!_0x3d0ff9['rules'][_0x9f81('0x3a')]){return'';}for(var _0x1c8f15='(',_0x40fd3b=0x0;_0x40fd3b<_0x3d0ff9[_0x9f81('0x67')][_0x9f81('0x3a')];_0x40fd3b+=0x1){_0x40fd3b>0x0&&(_0x1c8f15+='\x20'+_0x3d0ff9['operator']+'\x20');_0x1c8f15+=_0x3d0ff9[_0x9f81('0x67')][_0x40fd3b][_0x9f81('0x68')]?_0x2741a5(_0x3d0ff9[_0x9f81('0x67')][_0x40fd3b][_0x9f81('0x68')]):_0x3d0ff9[_0x9f81('0x67')][_0x40fd3b]['field']+'\x20'+_0x3d0ff9[_0x9f81('0x67')][_0x40fd3b][_0x9f81('0x69')]+(_0x444358(_0x3d0ff9[_0x9f81('0x67')][_0x40fd3b][_0x9f81('0x69')])?'\x20'+_0x3d0ff9['rules'][_0x40fd3b][_0x9f81('0x6a')]:'');}return _0x1c8f15+')';};var _0x3a1cb7={'where':{'id':_0x38908a[_0x9f81('0x47')]['id']}},_0x57823c,_0xaf49a2,_0x512ac3,_0x1fd796,_0x1f0d86;_0x3a1cb7=_[_0x9f81('0x41')]({},_0x3a1cb7,_0x38908a[_0x9f81('0x42')]);return db[_0x9f81('0x30')]['find'](_0x3a1cb7)['then'](function(_0x25d666){if(_0x25d666){_0x57823c=_0x25d666;return _0x25d666[_0x9f81('0x6b')]();}return null;})[_0x9f81('0x25')](function(_0x5a25e3){if(_0x5a25e3){if(!_0x5a25e3[_0x9f81('0x3a')]){throw new db[(_0x9f81('0x6c'))][(_0x9f81('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaf49a2=_0x5a25e3;return db[_0x9f81('0x6e')][_0x9f81('0x6f')]({'raw':!![]});}return null;})[_0x9f81('0x25')](function(_0x9383ad){if(_0x9383ad){_0x512ac3=_[_0x9f81('0x70')](_0x9383ad,'id');var _0x1e8e86;var _0x45a316=squel[_0x9f81('0x71')]();_0x45a316[_0x9f81('0x72')](_0x57823c[_0x9f81('0x73')]);for(var _0x27d8c0=0x0;_0x27d8c0<_0xaf49a2[_0x9f81('0x3a')];_0x27d8c0+=0x1){_0x1e8e86=_0xaf49a2[_0x27d8c0]['MetricId']?_0x512ac3[_0xaf49a2[_0x27d8c0][_0x9f81('0x74')]][_0x9f81('0x75')]:_0xaf49a2[_0x27d8c0][_0x9f81('0x76')];_0x1e8e86=_0xaf49a2[_0x27d8c0][_0x9f81('0x77')]?_[_0x9f81('0x78')](_0x223c20[_0xaf49a2[_0x27d8c0][_0x9f81('0x77')]],'%s',_0x1e8e86):_0x1e8e86;_0x1e8e86=_0xaf49a2[_0x27d8c0][_0x9f81('0x79')]?_[_0x9f81('0x78')](_0x2f4dd8[_0xaf49a2[_0x27d8c0]['format']],'%s',_0x1e8e86):_0x1e8e86;if(_0xaf49a2[_0x27d8c0][_0x9f81('0x7a')]){_0x45a316[_0x9f81('0x68')](_0x1e8e86);}_0xaf49a2[_0x27d8c0][_0x9f81('0x7b')]&&_0x45a316['order'](_0x1e8e86,_0xaf49a2[_0x27d8c0][_0x9f81('0x7b')]===_0x9f81('0x7c')?![]:!![]);_0x45a316[_0x9f81('0x76')](_0x1e8e86,_0xaf49a2[_0x27d8c0][_0x9f81('0x7d')]||_0x1e8e86);}if(_0x57823c[_0x9f81('0x7e')]){_0x57823c[_0x9f81('0x7e')]=JSON[_0x9f81('0x7f')](_0x57823c[_0x9f81('0x7e')]);for(var _0x50a81a=0x0;_0x50a81a<_0x57823c['joins'][_0x9f81('0x3a')];_0x50a81a+=0x1){if(_0x57823c[_0x9f81('0x7e')][_0x50a81a][_0x9f81('0x32')]&&_['includes'](_0x3bcafb,_0x57823c[_0x9f81('0x7e')][_0x50a81a][_0x9f81('0x32')])&&_0x57823c[_0x9f81('0x7e')][_0x50a81a][_0x9f81('0x80')]&&_0x57823c[_0x9f81('0x7e')][_0x50a81a]['foreignTable']&&_0x57823c[_0x9f81('0x7e')][_0x50a81a][_0x9f81('0x81')]){_0x45a316[_0x57823c['joins'][_0x50a81a][_0x9f81('0x32')]](_0x57823c[_0x9f81('0x7e')][_0x50a81a][_0x9f81('0x82')],null,util[_0x9f81('0x79')](_0x9f81('0x83'),_0x57823c[_0x9f81('0x73')],_0x57823c[_0x9f81('0x7e')][_0x50a81a][_0x9f81('0x80')],_0x57823c[_0x9f81('0x7e')][_0x50a81a][_0x9f81('0x82')],_0x57823c[_0x9f81('0x7e')][_0x50a81a]['foreignKey']));}}}if(_0x57823c['conditions']){_0x57823c[_0x9f81('0x84')]=JSON['parse'](_0x57823c['conditions']);_0x45a316[_0x9f81('0x40')](_0x2741a5(_0x57823c[_0x9f81('0x84')]['group']));}_0x1f0d86=_0x45a316[_0x9f81('0x85')]();_0x45a316[_0x9f81('0x1d')](_0x301d58);_0x45a316['offset'](0x0);logger[_0x9f81('0x86')](_0x9f81('0x87'),_0x45a316['toString']());return dbH['sequelize'][_0x9f81('0x34')](_0x45a316[_0x9f81('0x88')](),{'type':dbH[_0x9f81('0x89')][_0x9f81('0x8a')][_0x9f81('0x8b')]});}})[_0x9f81('0x25')](respondWithResult(_0x292b43,null))[_0x9f81('0x49')](handleError(_0x292b43,null));};function runReport(_0x378e61,_0xd44535,_0x5b99e8){var _0x37a59b=_0xd44535['name'];var _0x24ffd6=0xa;var _0x18ab7b=[_0x9f81('0x55'),_0x9f81('0x56'),_0x9f81('0x57'),'cross_join'];var _0x351010={'SUM':'SUM(%s)','COUNT':_0x9f81('0x5a'),'COUNT DISTINCT':_0x9f81('0x8c'),'MAX':_0x9f81('0x5b'),'MIN':'MIN(%s)','AVG':_0x9f81('0x5d'),'GROUP_CONCAT':_0x9f81('0x5e'),'GROUP_CONCAT ASC':_0x9f81('0x8d'),'GROUP_CONCAT DESC':_0x9f81('0x5f')};var _0x23cafb={'SEC_TO_TIME':_0x9f81('0x60'),'DATE':_0x9f81('0x61'),'HOUR':_0x9f81('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9f81('0x8e')};var _0x693d17=function(_0x1fd9f8){return!_['includes']([_0x9f81('0x64'),_0x9f81('0x65'),_0x9f81('0x66'),_0x9f81('0x8f')],_0x1fd9f8);};var _0xf3ae3b=function(_0x577c7f){if(!_0x577c7f||!_0x577c7f[_0x9f81('0x67')][_0x9f81('0x3a')]){return'';}for(var _0xa6fbc4='(',_0x12e33a=0x0;_0x12e33a<_0x577c7f[_0x9f81('0x67')][_0x9f81('0x3a')];_0x12e33a+=0x1){_0x12e33a>0x0&&(_0xa6fbc4+='\x20'+_0x577c7f[_0x9f81('0x90')]+'\x20');_0xa6fbc4+=_0x577c7f[_0x9f81('0x67')][_0x12e33a][_0x9f81('0x68')]?_0xf3ae3b(_0x577c7f[_0x9f81('0x67')][_0x12e33a]['group']):_0x577c7f[_0x9f81('0x67')][_0x12e33a][_0x9f81('0x76')]+'\x20'+_0x577c7f[_0x9f81('0x67')][_0x12e33a][_0x9f81('0x69')]+(_0x693d17(_0x577c7f[_0x9f81('0x67')][_0x12e33a]['condition'])?'\x20'+_0x577c7f[_0x9f81('0x67')][_0x12e33a][_0x9f81('0x6a')]:'');}return _0xa6fbc4+')';};var _0xe02cad={'where':{'id':_0x378e61['id']}},_0x34baf3,_0x462f0c,_0x14fb9b,_0x49f01f,_0x4649f0;_0xe02cad=_[_0x9f81('0x41')]({},_0xe02cad,_0x5b99e8);return db[_0x9f81('0x30')][_0x9f81('0x91')](_0xe02cad)[_0x9f81('0x25')](function(_0x10417d){if(_0x10417d){_0x34baf3=_0x10417d;return _0x10417d[_0x9f81('0x6b')]();}return null;})[_0x9f81('0x25')](function(_0x5edc25){if(_0x5edc25){if(!_0x5edc25[_0x9f81('0x3a')]){throw new db[(_0x9f81('0x6c'))][(_0x9f81('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x462f0c=_0x5edc25;return db['AnalyticMetric'][_0x9f81('0x6f')]({'raw':!![]});}return null;})[_0x9f81('0x25')](function(_0x195d0f){if(_0x195d0f){_0x14fb9b=_['keyBy'](_0x195d0f,'id');var _0x143478;var _0x40aea1=squel[_0x9f81('0x71')]();_0x40aea1[_0x9f81('0x72')](_0x34baf3[_0x9f81('0x73')]);for(var _0x1fd322=0x0;_0x1fd322<_0x462f0c[_0x9f81('0x3a')];_0x1fd322+=0x1){_0x143478=_0x462f0c[_0x1fd322][_0x9f81('0x74')]?_0x14fb9b[_0x462f0c[_0x1fd322][_0x9f81('0x74')]][_0x9f81('0x75')]:_0x462f0c[_0x1fd322]['field'];_0x143478=_0x462f0c[_0x1fd322]['function']?_[_0x9f81('0x78')](_0x351010[_0x462f0c[_0x1fd322][_0x9f81('0x77')]],'%s',_0x143478):_0x143478;_0x143478=_0x462f0c[_0x1fd322]['format']?_[_0x9f81('0x78')](_0x23cafb[_0x462f0c[_0x1fd322]['format']],'%s',_0x143478):_0x143478;if(_0x462f0c[_0x1fd322]['groupBy']){_0x40aea1[_0x9f81('0x68')](_0x143478);}_0x462f0c[_0x1fd322][_0x9f81('0x7b')]&&_0x40aea1[_0x9f81('0x3d')](_0x143478,_0x462f0c[_0x1fd322][_0x9f81('0x7b')]===_0x9f81('0x7c')?![]:!![]);_0x40aea1[_0x9f81('0x76')](_0x143478,_0x462f0c[_0x1fd322][_0x9f81('0x7d')]||_0x143478);}if(_0x34baf3[_0x9f81('0x7e')]){_0x34baf3[_0x9f81('0x7e')]=JSON[_0x9f81('0x7f')](_0x34baf3[_0x9f81('0x7e')]);for(var _0x35108=0x0;_0x35108<_0x34baf3[_0x9f81('0x7e')][_0x9f81('0x3a')];_0x35108+=0x1){if(_0x34baf3['joins'][_0x35108][_0x9f81('0x32')]&&_[_0x9f81('0x63')](_0x18ab7b,_0x34baf3[_0x9f81('0x7e')][_0x35108][_0x9f81('0x32')])&&_0x34baf3[_0x9f81('0x7e')][_0x35108][_0x9f81('0x80')]&&_0x34baf3[_0x9f81('0x7e')][_0x35108][_0x9f81('0x82')]&&_0x34baf3[_0x9f81('0x7e')][_0x35108][_0x9f81('0x81')]){_0x40aea1[_0x34baf3['joins'][_0x35108][_0x9f81('0x32')]](_0x34baf3[_0x9f81('0x7e')][_0x35108][_0x9f81('0x82')],null,util[_0x9f81('0x79')](_0x9f81('0x83'),_0x34baf3[_0x9f81('0x73')],_0x34baf3['joins'][_0x35108][_0x9f81('0x80')],_0x34baf3[_0x9f81('0x7e')][_0x35108][_0x9f81('0x82')],_0x34baf3['joins'][_0x35108][_0x9f81('0x81')]));}}}if(_0x34baf3[_0x9f81('0x84')]){_0x34baf3[_0x9f81('0x84')]=JSON[_0x9f81('0x7f')](_0x34baf3['conditions']);_0x40aea1['where'](_0xf3ae3b(_0x34baf3[_0x9f81('0x84')][_0x9f81('0x68')]));}_0x4649f0=_0x40aea1[_0x9f81('0x85')]();_0x40aea1[_0x9f81('0x1d')](_0x24ffd6);_0x40aea1[_0x9f81('0x1f')](0x0);return;}})[_0x9f81('0x25')](function(){if(_0xd44535['output']===_0x9f81('0x92')){return null;}var _0x20316e=_['merge'](_0xd44535,{'name':_0xd44535[_0x9f81('0x93')]||_0xd44535['name']||_0x34baf3[_0x9f81('0x2c')],'basename':_0x37a59b,'savename':util[_0x9f81('0x79')](_0x9f81('0x94'),_0xd44535['name']||_0x34baf3['name'],require(_0x9f81('0x95'))[_0x9f81('0x96')](0x4),_0xd44535[_0x9f81('0x97')]||_0x9f81('0x98')),'reportId':_0x34baf3['id'],'reportType':'custom'});return db[_0x9f81('0x99')][_0x9f81('0x4a')](_0x20316e,{'raw':!![]});})[_0x9f81('0x25')](function(_0xdcb871){if(_0x34baf3[_0x9f81('0x73')]===_0x9f81('0x9a')){_0x4649f0[_0x9f81('0x40')](_0x34baf3[_0x9f81('0x73')]+_0x9f81('0x9b'),_0xd44535['startDate'],_0xd44535['endDate']);}else{_0x4649f0['where'](_0x34baf3['table']+_0x9f81('0x9c'),_0xd44535[_0x9f81('0x9d')],_0xd44535[_0x9f81('0x9e')]);}if(_0xdcb871){logger[_0x9f81('0x9f')](_0x9f81('0xa0'),_0x4649f0[_0x9f81('0x88')]());require(_0x9f81('0xa1'))[_0x9f81('0xa2')](path['join'](__dirname,_0x9f81('0xa3'),_0xdcb871[_0x9f81('0x97')]),[_0xdcb871['id'],_0x4649f0['toString'](),path['join'](__dirname,_0x9f81('0xa4'),_0xdcb871[_0x9f81('0xa5')]),_0x37a59b]);return _0xdcb871;}else{var _0x4f04e3=squel[_0x9f81('0x71')]();_0x4f04e3[_0x9f81('0x72')]('('+_0x4649f0[_0x9f81('0x88')]()+')',_0x9f81('0xa6'));_0x4f04e3[_0x9f81('0x76')]('COUNT(*)',_0x9f81('0x1e'));_0x4649f0[_0x9f81('0x1d')](_0xd44535['limit']||_0x24ffd6);_0x4649f0[_0x9f81('0x1f')](_0xd44535[_0x9f81('0x1f')]||0x0);return dbH['sequelize']['query'](_0x4f04e3[_0x9f81('0x88')](),{'type':dbH['sequelize'][_0x9f81('0x8a')][_0x9f81('0x8b')]})['then'](function(_0x9577c7){if(!_0x9577c7[_0x9f81('0x3a')]){_0x49f01f=0x0;}else{_0x49f01f=_0x9577c7[0x0][_0x9f81('0x1e')]||0x0;}return dbH[_0x9f81('0x89')]['query'](_0x4649f0['toString'](),{'type':dbH[_0x9f81('0x89')][_0x9f81('0x8a')][_0x9f81('0x8b')]});})['then'](function(_0x53ae59){return{'rows':_0x53ae59||[],'count':_0x49f01f};});}});}exports[_0x9f81('0xa7')]=function(_0x14e8a7,_0x2fb6c3){return runReport(_0x14e8a7[_0x9f81('0x47')],_0x14e8a7[_0x9f81('0x34')],_0x14e8a7[_0x9f81('0x42')])[_0x9f81('0x25')](respondWithResult(_0x2fb6c3,null))[_0x9f81('0x49')](handleError(_0x2fb6c3,null));};exports[_0x9f81('0xa8')]=runReport;exports['query']=function(_0x3a505d,_0x65855b){var _0x3af989=0xa;var _0x57f6a8=[_0x9f81('0x55'),_0x9f81('0x56'),'right_join','cross_join'];var _0x239dd3={'SUM':_0x9f81('0x59'),'COUNT':_0x9f81('0x5a'),'COUNT DISTINCT':_0x9f81('0x8c'),'MAX':_0x9f81('0x5b'),'MIN':_0x9f81('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9f81('0x5e'),'GROUP_CONCAT ASC':_0x9f81('0x8d'),'GROUP_CONCAT DESC':_0x9f81('0x5f')};var _0x2361ff={'SEC_TO_TIME':_0x9f81('0x60'),'DATE':'DATE(%s)','HOUR':_0x9f81('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9f81('0x8e')};var _0x5b34d1=function(_0x351b8c){return!_[_0x9f81('0x63')](['IS\x20NULL',_0x9f81('0x65'),_0x9f81('0x66'),'IS\x20NOT\x20EMPTY'],_0x351b8c);};var _0x2f0086=function(_0x25af5c){if(!_0x25af5c||!_0x25af5c['rules'][_0x9f81('0x3a')]){return'';}for(var _0x33b085='(',_0xe9a9c6=0x0;_0xe9a9c6<_0x25af5c[_0x9f81('0x67')][_0x9f81('0x3a')];_0xe9a9c6+=0x1){_0xe9a9c6>0x0&&(_0x33b085+='\x20'+_0x25af5c['operator']+'\x20');_0x33b085+=_0x25af5c[_0x9f81('0x67')][_0xe9a9c6][_0x9f81('0x68')]?_0x2f0086(_0x25af5c['rules'][_0xe9a9c6][_0x9f81('0x68')]):_0x25af5c['rules'][_0xe9a9c6]['field']+'\x20'+_0x25af5c[_0x9f81('0x67')][_0xe9a9c6]['condition']+(_0x5b34d1(_0x25af5c['rules'][_0xe9a9c6][_0x9f81('0x69')])?'\x20'+_0x25af5c['rules'][_0xe9a9c6][_0x9f81('0x6a')]:'');}return _0x33b085+')';};var _0x7830f1={'where':{'id':_0x3a505d['params']['id']}},_0x58d1d6,_0x1bd746,_0x4ee575,_0x8232e4,_0x2c2e95;_0x7830f1=_['merge']({},_0x7830f1,_0x3a505d[_0x9f81('0x42')]);return db[_0x9f81('0x30')][_0x9f81('0x91')](_0x7830f1)[_0x9f81('0x25')](function(_0x25fdfb){if(_0x25fdfb){_0x58d1d6=_0x25fdfb;return _0x25fdfb[_0x9f81('0x6b')]();}return null;})[_0x9f81('0x25')](function(_0x43dbd4){if(_0x43dbd4){if(!_0x43dbd4[_0x9f81('0x3a')]){throw new db[(_0x9f81('0x6c'))][(_0x9f81('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1bd746=_0x43dbd4;return db['AnalyticMetric'][_0x9f81('0x6f')]({'raw':!![]});}return null;})[_0x9f81('0x25')](function(_0x4579e3){if(_0x4579e3){_0x4ee575=_[_0x9f81('0x70')](_0x4579e3,'id');var _0x1f79f9;var _0x35a466=squel[_0x9f81('0x71')]();_0x35a466[_0x9f81('0x72')](_0x58d1d6[_0x9f81('0x73')]);for(var _0x5c39ed=0x0;_0x5c39ed<_0x1bd746[_0x9f81('0x3a')];_0x5c39ed+=0x1){_0x1f79f9=_0x1bd746[_0x5c39ed]['MetricId']?_0x4ee575[_0x1bd746[_0x5c39ed]['MetricId']]['metric']:_0x1bd746[_0x5c39ed][_0x9f81('0x76')];_0x1f79f9=_0x1bd746[_0x5c39ed][_0x9f81('0x77')]?_[_0x9f81('0x78')](_0x239dd3[_0x1bd746[_0x5c39ed][_0x9f81('0x77')]],'%s',_0x1f79f9):_0x1f79f9;_0x1f79f9=_0x1bd746[_0x5c39ed][_0x9f81('0x79')]?_['replace'](_0x2361ff[_0x1bd746[_0x5c39ed][_0x9f81('0x79')]],'%s',_0x1f79f9):_0x1f79f9;if(_0x1bd746[_0x5c39ed]['groupBy']){_0x35a466[_0x9f81('0x68')](_0x1f79f9);}_0x1bd746[_0x5c39ed][_0x9f81('0x7b')]&&_0x35a466[_0x9f81('0x3d')](_0x1f79f9,_0x1bd746[_0x5c39ed]['orderBy']===_0x9f81('0x7c')?![]:!![]);_0x35a466[_0x9f81('0x76')](_0x1f79f9,_0x1bd746[_0x5c39ed][_0x9f81('0x7d')]||_0x1f79f9);}if(_0x58d1d6[_0x9f81('0x7e')]){_0x58d1d6['joins']=JSON[_0x9f81('0x7f')](_0x58d1d6[_0x9f81('0x7e')]);for(var _0x249b03=0x0;_0x249b03<_0x58d1d6[_0x9f81('0x7e')]['length'];_0x249b03+=0x1){if(_0x58d1d6[_0x9f81('0x7e')][_0x249b03][_0x9f81('0x32')]&&_[_0x9f81('0x63')](_0x57f6a8,_0x58d1d6[_0x9f81('0x7e')][_0x249b03][_0x9f81('0x32')])&&_0x58d1d6['joins'][_0x249b03]['parentKey']&&_0x58d1d6[_0x9f81('0x7e')][_0x249b03][_0x9f81('0x82')]&&_0x58d1d6[_0x9f81('0x7e')][_0x249b03][_0x9f81('0x81')]){_0x35a466[_0x58d1d6['joins'][_0x249b03][_0x9f81('0x32')]](_0x58d1d6['joins'][_0x249b03][_0x9f81('0x82')],null,util[_0x9f81('0x79')](_0x9f81('0x83'),_0x58d1d6['table'],_0x58d1d6[_0x9f81('0x7e')][_0x249b03]['parentKey'],_0x58d1d6[_0x9f81('0x7e')][_0x249b03][_0x9f81('0x82')],_0x58d1d6['joins'][_0x249b03]['foreignKey']));}}}if(_0x58d1d6[_0x9f81('0x84')]){_0x58d1d6[_0x9f81('0x84')]=JSON[_0x9f81('0x7f')](_0x58d1d6[_0x9f81('0x84')]);_0x35a466[_0x9f81('0x40')](_0x2f0086(_0x58d1d6[_0x9f81('0x84')][_0x9f81('0x68')]));}_0x2c2e95=_0x35a466['clone']();_0x35a466['limit'](_0x3af989);_0x35a466[_0x9f81('0x1f')](0x0);logger['debug'](_0x9f81('0x87'),_0x35a466['toString']());return dbH[_0x9f81('0x89')][_0x9f81('0x34')](_0x35a466[_0x9f81('0x88')](),{'type':dbH[_0x9f81('0x89')][_0x9f81('0x8a')]['SELECT']});}})[_0x9f81('0x25')](function(){return{'sql':_0x2c2e95['toString']()};})[_0x9f81('0x25')](respondWithResult(_0x65855b,null))['catch'](handleError(_0x65855b,null));};
\ No newline at end of file
+var _0x62ba=['limit','count','status','set','Content-Range','update','then','destroy','get','UserProfileResource','sendStatus','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','fields','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','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)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','joins','includes','parentKey','foreignKey','foreignTable','parse','clone','debug','sequelize','toString','QueryTypes','MIN(%s)','AVG(%s)','IS\x20NOT\x20EMPTY','operator','AnalyticMetric','DESC','alias','%s.%s\x20=\x20%s.%s','conditions','web','%s-%s.%s','randomstring','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','SELECT','run','runReport','left_join','ROUND(%s)','keyBy','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined'];(function(_0x5eb593,_0x43c687){var _0x237928=function(_0x2816fc){while(--_0x2816fc){_0x5eb593['push'](_0x5eb593['shift']());}};_0x237928(++_0x43c687);}(_0x62ba,0x1cd));var _0xa62b=function(_0x4767b2,_0x58d23f){_0x4767b2=_0x4767b2-0x0;var _0x485ba0=_0x62ba[_0x4767b2];return _0x485ba0;};'use strict';var emlformat=require(_0xa62b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa62b('0x1'));var jsonpatch=require(_0xa62b('0x2'));var rp=require(_0xa62b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa62b('0x4'));var util=require(_0xa62b('0x5'));var path=require('path');var sox=require(_0xa62b('0x6'));var csv=require(_0xa62b('0x7'));var ejs=require(_0xa62b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa62b('0x9'));var squel=require(_0xa62b('0xa'));var crypto=require(_0xa62b('0xb'));var jsforce=require(_0xa62b('0xc'));var deskjs=require(_0xa62b('0xd'));var toCsv=require(_0xa62b('0x7'));var querystring=require(_0xa62b('0xe'));var Papa=require('papaparse');var Redis=require(_0xa62b('0xf'));var authService=require(_0xa62b('0x10'));var qs=require(_0xa62b('0x11'));var as=require(_0xa62b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa62b('0x13'))('api');var utils=require(_0xa62b('0x14'));var config=require(_0xa62b('0x15'));var licenseUtil=require(_0xa62b('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0xa62b('0x17'))['dbH'];function respondWithStatusCode(_0x16b16f,_0x5efe6c){_0x5efe6c=_0x5efe6c||0xcc;return function(_0x1e0f3a){if(_0x1e0f3a){return _0x16b16f['sendStatus'](_0x5efe6c);}return _0x16b16f['status'](_0x5efe6c)[_0xa62b('0x18')]();};}function respondWithResult(_0x580c87,_0x57ea7f){_0x57ea7f=_0x57ea7f||0xc8;return function(_0x3c61b5){if(_0x3c61b5){return _0x580c87['status'](_0x57ea7f)[_0xa62b('0x19')](_0x3c61b5);}};}function respondWithFilteredResult(_0x50e164,_0x5e2c98){return function(_0x40adcf){if(_0x40adcf){var _0x529405=typeof _0x5e2c98[_0xa62b('0x1a')]===_0xa62b('0x1b')&&typeof _0x5e2c98[_0xa62b('0x1c')]==='undefined';var _0xe01f06=_0x40adcf[_0xa62b('0x1d')];var _0x30a267=_0x529405?0x0:_0x5e2c98[_0xa62b('0x1a')];var _0x18b769=_0x529405?_0x40adcf[_0xa62b('0x1d')]:_0x5e2c98[_0xa62b('0x1a')]+_0x5e2c98[_0xa62b('0x1c')];var _0x5cc198;if(_0x18b769>=_0xe01f06){_0x18b769=_0xe01f06;_0x5cc198=0xc8;}else{_0x5cc198=0xce;}_0x50e164[_0xa62b('0x1e')](_0x5cc198);return _0x50e164[_0xa62b('0x1f')](_0xa62b('0x20'),_0x30a267+'-'+_0x18b769+'/'+_0xe01f06)['json'](_0x40adcf);}return null;};}function patchUpdates(_0x1c4e1f){return function(_0x5c47c9){try{jsonpatch['apply'](_0x5c47c9,_0x1c4e1f,!![]);}catch(_0x37dc69){return BPromise['reject'](_0x37dc69);}return _0x5c47c9['save']();};}function saveUpdates(_0x327851,_0x169ca3){return function(_0x238487){if(_0x238487){return _0x238487[_0xa62b('0x21')](_0x327851)[_0xa62b('0x22')](function(_0xb48827){return _0xb48827;});}return null;};}function removeEntity(_0x6aa24a,_0x42a4b4){return function(_0x3e263b){if(_0x3e263b){return _0x3e263b[_0xa62b('0x23')]()['then'](function(){var _0x4d57a5=_0x3e263b[_0xa62b('0x24')]({'plain':!![]});var _0x20a323='CustomReports';return db[_0xa62b('0x25')]['destroy']({'where':{'type':_0x20a323,'resourceId':_0x4d57a5['id']}})[_0xa62b('0x22')](function(){return _0x3e263b;});})[_0xa62b('0x22')](function(){_0x6aa24a[_0xa62b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d86a0,_0x25f2f5){return function(_0x133857){if(!_0x133857){_0x3d86a0[_0xa62b('0x26')](0x194);}return _0x133857;};}function handleError(_0x5c6b2c,_0x571304){_0x571304=_0x571304||0x1f4;return function(_0x2c1915){logger[_0xa62b('0x27')](_0x2c1915['stack']);if(_0x2c1915[_0xa62b('0x28')]){delete _0x2c1915[_0xa62b('0x28')];}_0x5c6b2c[_0xa62b('0x1e')](_0x571304)[_0xa62b('0x29')](_0x2c1915);};}exports[_0xa62b('0x2a')]=function(_0x1622de,_0x1b5753){var _0x5dfc33={},_0x14de0e={},_0x1a14d3={'count':0x0,'rows':[]};var _0x4f01cf=_[_0xa62b('0x2b')](db[_0xa62b('0x2c')][_0xa62b('0x2d')],function(_0x39ee64){return{'name':_0x39ee64[_0xa62b('0x2e')],'type':_0x39ee64[_0xa62b('0x2f')][_0xa62b('0x30')]};});_0x14de0e[_0xa62b('0x31')]=_[_0xa62b('0x2b')](_0x4f01cf,'name');_0x14de0e['query']=_[_0xa62b('0x32')](_0x1622de['query']);_0x14de0e[_0xa62b('0x33')]=_[_0xa62b('0x34')](_0x14de0e[_0xa62b('0x31')],_0x14de0e[_0xa62b('0x35')]);_0x5dfc33[_0xa62b('0x36')]=_[_0xa62b('0x34')](_0x14de0e[_0xa62b('0x31')],qs['fields'](_0x1622de[_0xa62b('0x35')]['fields']));_0x5dfc33[_0xa62b('0x36')]=_0x5dfc33['attributes'][_0xa62b('0x37')]?_0x5dfc33[_0xa62b('0x36')]:_0x14de0e[_0xa62b('0x31')];if(!_0x1622de[_0xa62b('0x35')]['hasOwnProperty'](_0xa62b('0x38'))){_0x5dfc33['limit']=qs[_0xa62b('0x1c')](_0x1622de[_0xa62b('0x35')]['limit']);_0x5dfc33[_0xa62b('0x1a')]=qs[_0xa62b('0x1a')](_0x1622de[_0xa62b('0x35')][_0xa62b('0x1a')]);}_0x5dfc33[_0xa62b('0x39')]=qs[_0xa62b('0x3a')](_0x1622de[_0xa62b('0x35')]['sort']);_0x5dfc33['where']=qs[_0xa62b('0x33')](_[_0xa62b('0x3b')](_0x1622de[_0xa62b('0x35')],_0x14de0e[_0xa62b('0x33')]),_0x4f01cf);if(_0x1622de[_0xa62b('0x35')]['filter']){_0x5dfc33[_0xa62b('0x3c')]=_[_0xa62b('0x3d')](_0x5dfc33[_0xa62b('0x3c')],{'$or':_[_0xa62b('0x2b')](_0x4f01cf,function(_0x5d3af9){if(_0x5d3af9[_0xa62b('0x2f')]!==_0xa62b('0x3e')){var _0x181120={};_0x181120[_0x5d3af9[_0xa62b('0x28')]]={'$like':'%'+_0x1622de[_0xa62b('0x35')][_0xa62b('0x3f')]+'%'};return _0x181120;}})});}_0x5dfc33=_[_0xa62b('0x3d')]({},_0x5dfc33,_0x1622de[_0xa62b('0x40')]);var _0x23b99f={'where':_0x5dfc33[_0xa62b('0x3c')]};return db['AnalyticCustomReport'][_0xa62b('0x1d')](_0x23b99f)[_0xa62b('0x22')](function(_0x1b7ce1){_0x1a14d3['count']=_0x1b7ce1;if(_0x1622de[_0xa62b('0x35')][_0xa62b('0x41')]){_0x5dfc33[_0xa62b('0x42')]=[{'all':!![]}];}return db[_0xa62b('0x2c')][_0xa62b('0x43')](_0x5dfc33);})[_0xa62b('0x22')](function(_0x45ddc2){_0x1a14d3[_0xa62b('0x44')]=_0x45ddc2;return _0x1a14d3;})[_0xa62b('0x22')](respondWithFilteredResult(_0x1b5753,_0x5dfc33))['catch'](handleError(_0x1b5753,null));};exports['show']=function(_0x28b95d,_0x32ddd6){var _0x2fdac2={'raw':![],'where':{'id':_0x28b95d['params']['id']}},_0x21d184={};_0x21d184[_0xa62b('0x31')]=_[_0xa62b('0x32')](db[_0xa62b('0x2c')][_0xa62b('0x2d')]);_0x21d184['query']=_[_0xa62b('0x32')](_0x28b95d[_0xa62b('0x35')]);_0x21d184[_0xa62b('0x33')]=_[_0xa62b('0x34')](_0x21d184[_0xa62b('0x31')],_0x21d184['query']);_0x2fdac2[_0xa62b('0x36')]=_[_0xa62b('0x34')](_0x21d184['model'],qs[_0xa62b('0x45')](_0x28b95d[_0xa62b('0x35')][_0xa62b('0x45')]));_0x2fdac2[_0xa62b('0x36')]=_0x2fdac2[_0xa62b('0x36')]['length']?_0x2fdac2[_0xa62b('0x36')]:_0x21d184['model'];if(_0x28b95d[_0xa62b('0x35')]['includeAll']){_0x2fdac2[_0xa62b('0x42')]=[{'all':!![]}];}_0x2fdac2=_['merge']({},_0x2fdac2,_0x28b95d[_0xa62b('0x40')]);return db[_0xa62b('0x2c')]['find'](_0x2fdac2)['then'](handleEntityNotFound(_0x32ddd6,null))['then'](respondWithResult(_0x32ddd6,null))[_0xa62b('0x46')](handleError(_0x32ddd6,null));};exports[_0xa62b('0x47')]=function(_0x1f8ad1,_0x20f05f){return db[_0xa62b('0x2c')][_0xa62b('0x47')](_0x1f8ad1['body'],{})[_0xa62b('0x22')](function(_0x27e8e0){var _0xfe364f=_0x1f8ad1['user'][_0xa62b('0x24')]({'plain':!![]});if(!_0xfe364f)throw new Error(_0xa62b('0x48'));if(_0xfe364f['role']===_0xa62b('0x49')){var _0x40942e=_0x27e8e0[_0xa62b('0x24')]({'plain':!![]});var _0x1d1481=_0xa62b('0x4a');return db[_0xa62b('0x4b')]['find']({'where':{'name':_0x1d1481,'userProfileId':_0xfe364f[_0xa62b('0x4c')]},'raw':!![]})[_0xa62b('0x22')](function(_0x3084be){if(_0x3084be&&_0x3084be[_0xa62b('0x4d')]===0x0){return db[_0xa62b('0x25')][_0xa62b('0x47')]({'name':_0x40942e[_0xa62b('0x28')],'resourceId':_0x40942e['id'],'type':_0xa62b('0x4e'),'sectionId':_0x3084be['id']},{})[_0xa62b('0x22')](function(){return _0x27e8e0;});}else{return _0x27e8e0;}})[_0xa62b('0x46')](function(_0x2e4bd5){logger['error'](_0xa62b('0x4f'),_0x2e4bd5);throw _0x2e4bd5;});}return _0x27e8e0;})[_0xa62b('0x22')](respondWithResult(_0x20f05f,0xc9))[_0xa62b('0x46')](handleError(_0x20f05f,null));};exports['update']=function(_0x547916,_0x521e86){if(_0x547916[_0xa62b('0x50')]['id']){delete _0x547916[_0xa62b('0x50')]['id'];}return db[_0xa62b('0x2c')][_0xa62b('0x51')]({'where':{'id':_0x547916[_0xa62b('0x52')]['id']}})[_0xa62b('0x22')](handleEntityNotFound(_0x521e86,null))['then'](saveUpdates(_0x547916[_0xa62b('0x50')],null))[_0xa62b('0x22')](respondWithResult(_0x521e86,null))[_0xa62b('0x46')](handleError(_0x521e86,null));};exports[_0xa62b('0x23')]=function(_0x2f993b,_0x3df75c){return db[_0xa62b('0x2c')][_0xa62b('0x51')]({'where':{'id':_0x2f993b['params']['id']}})[_0xa62b('0x22')](handleEntityNotFound(_0x3df75c,null))[_0xa62b('0x22')](removeEntity(_0x3df75c,null))[_0xa62b('0x46')](handleError(_0x3df75c,null));};exports['preview']=function(_0x2be91f,_0x40407c){var _0x38545d=0xa;var _0x58fd69=[_0xa62b('0x53'),'left_join',_0xa62b('0x54'),_0xa62b('0x55')];var _0x38dbda={'SUM':_0xa62b('0x56'),'COUNT':_0xa62b('0x57'),'COUNT DISTINCT':_0xa62b('0x58'),'MAX':_0xa62b('0x59'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xa62b('0x5a'),'GROUP_CONCAT ASC':_0xa62b('0x5b'),'GROUP_CONCAT DESC':_0xa62b('0x5c')};var _0xf1531c={'SEC_TO_TIME':_0xa62b('0x5d'),'DATE':_0xa62b('0x5e'),'HOUR':_0xa62b('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa62b('0x60')};var _0xa347ea=function(_0x33a181){return!_['includes']([_0xa62b('0x61'),_0xa62b('0x62'),_0xa62b('0x63'),'IS\x20NOT\x20EMPTY'],_0x33a181);};var _0x142f86=function(_0x5c401e){if(!_0x5c401e||!_0x5c401e['rules'][_0xa62b('0x37')]){return'';}for(var _0x31f14c='(',_0x4c1658=0x0;_0x4c1658<_0x5c401e[_0xa62b('0x64')][_0xa62b('0x37')];_0x4c1658+=0x1){_0x4c1658>0x0&&(_0x31f14c+='\x20'+_0x5c401e['operator']+'\x20');_0x31f14c+=_0x5c401e[_0xa62b('0x64')][_0x4c1658][_0xa62b('0x65')]?_0x142f86(_0x5c401e[_0xa62b('0x64')][_0x4c1658]['group']):_0x5c401e[_0xa62b('0x64')][_0x4c1658][_0xa62b('0x66')]+'\x20'+_0x5c401e[_0xa62b('0x64')][_0x4c1658][_0xa62b('0x67')]+(_0xa347ea(_0x5c401e[_0xa62b('0x64')][_0x4c1658][_0xa62b('0x67')])?'\x20'+_0x5c401e[_0xa62b('0x64')][_0x4c1658][_0xa62b('0x68')]:'');}return _0x31f14c+')';};var _0x13fc8b={'where':{'id':_0x2be91f[_0xa62b('0x52')]['id']}},_0x59555d,_0x1cc9fe,_0x558717,_0x43a1ae,_0x208037;_0x13fc8b=_[_0xa62b('0x3d')]({},_0x13fc8b,_0x2be91f[_0xa62b('0x40')]);return db['AnalyticCustomReport'][_0xa62b('0x51')](_0x13fc8b)[_0xa62b('0x22')](function(_0x3e02dd){if(_0x3e02dd){_0x59555d=_0x3e02dd;return _0x3e02dd[_0xa62b('0x69')]();}return null;})[_0xa62b('0x22')](function(_0x357fc2){if(_0x357fc2){if(!_0x357fc2['length']){throw new db[(_0xa62b('0x6a'))][(_0xa62b('0x6b'))](_0xa62b('0x6c'),0x193);}_0x1cc9fe=_0x357fc2;return db['AnalyticMetric'][_0xa62b('0x43')]({'raw':!![]});}return null;})[_0xa62b('0x22')](function(_0x282934){if(_0x282934){_0x558717=_['keyBy'](_0x282934,'id');var _0x266c79;var _0x4f360d=squel[_0xa62b('0x6d')]();_0x4f360d[_0xa62b('0x6e')](_0x59555d[_0xa62b('0x6f')]);for(var _0x2c60af=0x0;_0x2c60af<_0x1cc9fe[_0xa62b('0x37')];_0x2c60af+=0x1){_0x266c79=_0x1cc9fe[_0x2c60af]['MetricId']?_0x558717[_0x1cc9fe[_0x2c60af][_0xa62b('0x70')]][_0xa62b('0x71')]:_0x1cc9fe[_0x2c60af]['field'];_0x266c79=_0x1cc9fe[_0x2c60af]['function']?_['replace'](_0x38dbda[_0x1cc9fe[_0x2c60af][_0xa62b('0x72')]],'%s',_0x266c79):_0x266c79;_0x266c79=_0x1cc9fe[_0x2c60af][_0xa62b('0x73')]?_[_0xa62b('0x74')](_0xf1531c[_0x1cc9fe[_0x2c60af]['format']],'%s',_0x266c79):_0x266c79;if(_0x1cc9fe[_0x2c60af][_0xa62b('0x75')]){_0x4f360d[_0xa62b('0x65')](_0x266c79);}_0x1cc9fe[_0x2c60af][_0xa62b('0x76')]&&_0x4f360d[_0xa62b('0x39')](_0x266c79,_0x1cc9fe[_0x2c60af][_0xa62b('0x76')]==='DESC'?![]:!![]);_0x4f360d[_0xa62b('0x66')](_0x266c79,_0x1cc9fe[_0x2c60af]['alias']||_0x266c79);}if(_0x59555d['joins']){_0x59555d[_0xa62b('0x77')]=JSON['parse'](_0x59555d['joins']);for(var _0x43d1db=0x0;_0x43d1db<_0x59555d[_0xa62b('0x77')][_0xa62b('0x37')];_0x43d1db+=0x1){if(_0x59555d[_0xa62b('0x77')][_0x43d1db]['type']&&_[_0xa62b('0x78')](_0x58fd69,_0x59555d['joins'][_0x43d1db]['type'])&&_0x59555d[_0xa62b('0x77')][_0x43d1db][_0xa62b('0x79')]&&_0x59555d[_0xa62b('0x77')][_0x43d1db]['foreignTable']&&_0x59555d[_0xa62b('0x77')][_0x43d1db][_0xa62b('0x7a')]){_0x4f360d[_0x59555d[_0xa62b('0x77')][_0x43d1db][_0xa62b('0x2f')]](_0x59555d[_0xa62b('0x77')][_0x43d1db][_0xa62b('0x7b')],null,util[_0xa62b('0x73')]('%s.%s\x20=\x20%s.%s',_0x59555d[_0xa62b('0x6f')],_0x59555d[_0xa62b('0x77')][_0x43d1db][_0xa62b('0x79')],_0x59555d[_0xa62b('0x77')][_0x43d1db]['foreignTable'],_0x59555d[_0xa62b('0x77')][_0x43d1db]['foreignKey']));}}}if(_0x59555d['conditions']){_0x59555d['conditions']=JSON[_0xa62b('0x7c')](_0x59555d['conditions']);_0x4f360d[_0xa62b('0x3c')](_0x142f86(_0x59555d['conditions'][_0xa62b('0x65')]));}_0x208037=_0x4f360d[_0xa62b('0x7d')]();_0x4f360d['limit'](_0x38545d);_0x4f360d['offset'](0x0);logger[_0xa62b('0x7e')]('Limited\x20Query:',_0x4f360d['toString']());return dbH[_0xa62b('0x7f')][_0xa62b('0x35')](_0x4f360d[_0xa62b('0x80')](),{'type':dbH[_0xa62b('0x7f')][_0xa62b('0x81')]['SELECT']});}})['then'](respondWithResult(_0x40407c,null))[_0xa62b('0x46')](handleError(_0x40407c,null));};function runReport(_0x53f0a8,_0xc2cc45,_0x4ba1dd){var _0x26435b=_0xc2cc45[_0xa62b('0x28')];var _0x4765fa=0xa;var _0x56eb1b=[_0xa62b('0x53'),'left_join',_0xa62b('0x54'),'cross_join'];var _0x4764f5={'SUM':'SUM(%s)','COUNT':_0xa62b('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa62b('0x59'),'MIN':_0xa62b('0x82'),'AVG':_0xa62b('0x83'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa62b('0x5c')};var _0x162d31={'SEC_TO_TIME':_0xa62b('0x5d'),'DATE':_0xa62b('0x5e'),'HOUR':_0xa62b('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x51fef1=function(_0x501a3e){return!_[_0xa62b('0x78')]([_0xa62b('0x61'),_0xa62b('0x62'),'IS\x20EMPTY',_0xa62b('0x84')],_0x501a3e);};var _0x4c78ac=function(_0x57ede7){if(!_0x57ede7||!_0x57ede7[_0xa62b('0x64')][_0xa62b('0x37')]){return'';}for(var _0xb3855f='(',_0x4b9e0e=0x0;_0x4b9e0e<_0x57ede7[_0xa62b('0x64')][_0xa62b('0x37')];_0x4b9e0e+=0x1){_0x4b9e0e>0x0&&(_0xb3855f+='\x20'+_0x57ede7[_0xa62b('0x85')]+'\x20');_0xb3855f+=_0x57ede7[_0xa62b('0x64')][_0x4b9e0e][_0xa62b('0x65')]?_0x4c78ac(_0x57ede7['rules'][_0x4b9e0e][_0xa62b('0x65')]):_0x57ede7[_0xa62b('0x64')][_0x4b9e0e]['field']+'\x20'+_0x57ede7[_0xa62b('0x64')][_0x4b9e0e]['condition']+(_0x51fef1(_0x57ede7[_0xa62b('0x64')][_0x4b9e0e][_0xa62b('0x67')])?'\x20'+_0x57ede7['rules'][_0x4b9e0e][_0xa62b('0x68')]:'');}return _0xb3855f+')';};var _0x3fc3f7={'where':{'id':_0x53f0a8['id']}},_0x31e997,_0x265ab2,_0x57a229,_0x17a620,_0x125fca;_0x3fc3f7=_[_0xa62b('0x3d')]({},_0x3fc3f7,_0x4ba1dd);return db[_0xa62b('0x2c')][_0xa62b('0x51')](_0x3fc3f7)[_0xa62b('0x22')](function(_0x5e1fac){if(_0x5e1fac){_0x31e997=_0x5e1fac;return _0x5e1fac[_0xa62b('0x69')]();}return null;})[_0xa62b('0x22')](function(_0x570291){if(_0x570291){if(!_0x570291['length']){throw new db[(_0xa62b('0x6a'))][(_0xa62b('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x265ab2=_0x570291;return db[_0xa62b('0x86')][_0xa62b('0x43')]({'raw':!![]});}return null;})['then'](function(_0x61f3ee){if(_0x61f3ee){_0x57a229=_['keyBy'](_0x61f3ee,'id');var _0x28cb75;var _0x5650b0=squel[_0xa62b('0x6d')]();_0x5650b0[_0xa62b('0x6e')](_0x31e997[_0xa62b('0x6f')]);for(var _0x2db5f5=0x0;_0x2db5f5<_0x265ab2[_0xa62b('0x37')];_0x2db5f5+=0x1){_0x28cb75=_0x265ab2[_0x2db5f5][_0xa62b('0x70')]?_0x57a229[_0x265ab2[_0x2db5f5][_0xa62b('0x70')]][_0xa62b('0x71')]:_0x265ab2[_0x2db5f5]['field'];_0x28cb75=_0x265ab2[_0x2db5f5][_0xa62b('0x72')]?_[_0xa62b('0x74')](_0x4764f5[_0x265ab2[_0x2db5f5]['function']],'%s',_0x28cb75):_0x28cb75;_0x28cb75=_0x265ab2[_0x2db5f5][_0xa62b('0x73')]?_[_0xa62b('0x74')](_0x162d31[_0x265ab2[_0x2db5f5][_0xa62b('0x73')]],'%s',_0x28cb75):_0x28cb75;if(_0x265ab2[_0x2db5f5][_0xa62b('0x75')]){_0x5650b0[_0xa62b('0x65')](_0x28cb75);}_0x265ab2[_0x2db5f5][_0xa62b('0x76')]&&_0x5650b0[_0xa62b('0x39')](_0x28cb75,_0x265ab2[_0x2db5f5][_0xa62b('0x76')]===_0xa62b('0x87')?![]:!![]);_0x5650b0[_0xa62b('0x66')](_0x28cb75,_0x265ab2[_0x2db5f5][_0xa62b('0x88')]||_0x28cb75);}if(_0x31e997['joins']){_0x31e997[_0xa62b('0x77')]=JSON['parse'](_0x31e997[_0xa62b('0x77')]);for(var _0x1e46d0=0x0;_0x1e46d0<_0x31e997[_0xa62b('0x77')][_0xa62b('0x37')];_0x1e46d0+=0x1){if(_0x31e997['joins'][_0x1e46d0][_0xa62b('0x2f')]&&_[_0xa62b('0x78')](_0x56eb1b,_0x31e997[_0xa62b('0x77')][_0x1e46d0][_0xa62b('0x2f')])&&_0x31e997[_0xa62b('0x77')][_0x1e46d0][_0xa62b('0x79')]&&_0x31e997[_0xa62b('0x77')][_0x1e46d0][_0xa62b('0x7b')]&&_0x31e997[_0xa62b('0x77')][_0x1e46d0][_0xa62b('0x7a')]){_0x5650b0[_0x31e997[_0xa62b('0x77')][_0x1e46d0][_0xa62b('0x2f')]](_0x31e997[_0xa62b('0x77')][_0x1e46d0][_0xa62b('0x7b')],null,util['format'](_0xa62b('0x89'),_0x31e997[_0xa62b('0x6f')],_0x31e997[_0xa62b('0x77')][_0x1e46d0][_0xa62b('0x79')],_0x31e997[_0xa62b('0x77')][_0x1e46d0][_0xa62b('0x7b')],_0x31e997['joins'][_0x1e46d0][_0xa62b('0x7a')]));}}}if(_0x31e997[_0xa62b('0x8a')]){_0x31e997[_0xa62b('0x8a')]=JSON[_0xa62b('0x7c')](_0x31e997[_0xa62b('0x8a')]);_0x5650b0[_0xa62b('0x3c')](_0x4c78ac(_0x31e997[_0xa62b('0x8a')][_0xa62b('0x65')]));}_0x125fca=_0x5650b0[_0xa62b('0x7d')]();_0x5650b0[_0xa62b('0x1c')](_0x4765fa);_0x5650b0['offset'](0x0);return;}})['then'](function(){if(_0xc2cc45['output']===_0xa62b('0x8b')){return null;}var _0x4e4d88=_[_0xa62b('0x3d')](_0xc2cc45,{'name':_0xc2cc45['fullPath']||_0xc2cc45[_0xa62b('0x28')]||_0x31e997[_0xa62b('0x28')],'basename':_0x26435b,'savename':util['format'](_0xa62b('0x8c'),_0xc2cc45[_0xa62b('0x28')]||_0x31e997[_0xa62b('0x28')],require(_0xa62b('0x8d'))['generate'](0x4),_0xc2cc45[_0xa62b('0x8e')]||_0xa62b('0x8f')),'reportId':_0x31e997['id'],'reportType':'custom'});return db[_0xa62b('0x90')]['create'](_0x4e4d88,{'raw':!![]});})[_0xa62b('0x22')](function(_0x586acc){if(_0x31e997[_0xa62b('0x6f')]===_0xa62b('0x91')){_0x125fca[_0xa62b('0x3c')](_0x31e997[_0xa62b('0x6f')]+_0xa62b('0x92'),_0xc2cc45[_0xa62b('0x93')],_0xc2cc45[_0xa62b('0x94')]);}else{_0x125fca[_0xa62b('0x3c')](_0x31e997[_0xa62b('0x6f')]+_0xa62b('0x95'),_0xc2cc45[_0xa62b('0x93')],_0xc2cc45[_0xa62b('0x94')]);}if(_0x586acc){logger[_0xa62b('0x96')](_0xa62b('0x97'),_0x125fca['toString']());require('child_process')[_0xa62b('0x98')](path[_0xa62b('0x53')](__dirname,_0xa62b('0x99'),_0x586acc[_0xa62b('0x8e')]),[_0x586acc['id'],_0x125fca[_0xa62b('0x80')](),path['join'](__dirname,_0xa62b('0x9a'),_0x586acc['savename']),_0x26435b]);return _0x586acc;}else{var _0x2cd77b=squel['select']();_0x2cd77b['from']('('+_0x125fca[_0xa62b('0x80')]()+')',_0xa62b('0x9b'));_0x2cd77b[_0xa62b('0x66')](_0xa62b('0x9c'),_0xa62b('0x1d'));_0x125fca[_0xa62b('0x1c')](_0xc2cc45[_0xa62b('0x1c')]||_0x4765fa);_0x125fca['offset'](_0xc2cc45[_0xa62b('0x1a')]||0x0);return dbH[_0xa62b('0x7f')][_0xa62b('0x35')](_0x2cd77b[_0xa62b('0x80')](),{'type':dbH[_0xa62b('0x7f')]['QueryTypes']['SELECT']})['then'](function(_0x354bd2){if(!_0x354bd2[_0xa62b('0x37')]){_0x17a620=0x0;}else{_0x17a620=_0x354bd2[0x0][_0xa62b('0x1d')]||0x0;}return dbH['sequelize']['query'](_0x125fca[_0xa62b('0x80')](),{'type':dbH[_0xa62b('0x7f')][_0xa62b('0x81')][_0xa62b('0x9d')]});})[_0xa62b('0x22')](function(_0x148d95){return{'rows':_0x148d95||[],'count':_0x17a620};});}});}exports[_0xa62b('0x9e')]=function(_0x117647,_0x42af89){return runReport(_0x117647[_0xa62b('0x52')],_0x117647['query'],_0x117647['options'])[_0xa62b('0x22')](respondWithResult(_0x42af89,null))['catch'](handleError(_0x42af89,null));};exports[_0xa62b('0x9f')]=runReport;exports[_0xa62b('0x35')]=function(_0x2e01d7,_0x22feb4){var _0x247045=0xa;var _0x32d9ac=[_0xa62b('0x53'),_0xa62b('0xa0'),_0xa62b('0x54'),_0xa62b('0x55')];var _0x35d1d0={'SUM':_0xa62b('0x56'),'COUNT':_0xa62b('0x57'),'COUNT DISTINCT':_0xa62b('0x58'),'MAX':_0xa62b('0x59'),'MIN':_0xa62b('0x82'),'AVG':_0xa62b('0x83'),'GROUP_CONCAT':_0xa62b('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa62b('0x5c')};var _0x226c56={'SEC_TO_TIME':_0xa62b('0x5d'),'DATE':_0xa62b('0x5e'),'HOUR':_0xa62b('0x5f'),'ROUND':_0xa62b('0xa1'),'UNIX_TIMESTAMP':_0xa62b('0x60')};var _0x54cfc2=function(_0x17f834){return!_['includes']([_0xa62b('0x61'),_0xa62b('0x62'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x17f834);};var _0x12385b=function(_0x4037e5){if(!_0x4037e5||!_0x4037e5[_0xa62b('0x64')][_0xa62b('0x37')]){return'';}for(var _0x5680d6='(',_0x4f7c61=0x0;_0x4f7c61<_0x4037e5[_0xa62b('0x64')][_0xa62b('0x37')];_0x4f7c61+=0x1){_0x4f7c61>0x0&&(_0x5680d6+='\x20'+_0x4037e5['operator']+'\x20');_0x5680d6+=_0x4037e5['rules'][_0x4f7c61][_0xa62b('0x65')]?_0x12385b(_0x4037e5[_0xa62b('0x64')][_0x4f7c61][_0xa62b('0x65')]):_0x4037e5[_0xa62b('0x64')][_0x4f7c61][_0xa62b('0x66')]+'\x20'+_0x4037e5[_0xa62b('0x64')][_0x4f7c61]['condition']+(_0x54cfc2(_0x4037e5[_0xa62b('0x64')][_0x4f7c61][_0xa62b('0x67')])?'\x20'+_0x4037e5[_0xa62b('0x64')][_0x4f7c61]['value']:'');}return _0x5680d6+')';};var _0x4b3294={'where':{'id':_0x2e01d7[_0xa62b('0x52')]['id']}},_0x580779,_0x4d2911,_0x145443,_0xc5abea,_0x3db3b3;_0x4b3294=_['merge']({},_0x4b3294,_0x2e01d7['options']);return db[_0xa62b('0x2c')][_0xa62b('0x51')](_0x4b3294)[_0xa62b('0x22')](function(_0x4a9118){if(_0x4a9118){_0x580779=_0x4a9118;return _0x4a9118[_0xa62b('0x69')]();}return null;})['then'](function(_0x12fae){if(_0x12fae){if(!_0x12fae[_0xa62b('0x37')]){throw new db[(_0xa62b('0x6a'))]['ValidationErrorItem'](_0xa62b('0x6c'),0x193);}_0x4d2911=_0x12fae;return db[_0xa62b('0x86')][_0xa62b('0x43')]({'raw':!![]});}return null;})['then'](function(_0x126859){if(_0x126859){_0x145443=_[_0xa62b('0xa2')](_0x126859,'id');var _0x12873d;var _0xb4f985=squel[_0xa62b('0x6d')]();_0xb4f985[_0xa62b('0x6e')](_0x580779[_0xa62b('0x6f')]);for(var _0x28e0dd=0x0;_0x28e0dd<_0x4d2911[_0xa62b('0x37')];_0x28e0dd+=0x1){_0x12873d=_0x4d2911[_0x28e0dd][_0xa62b('0x70')]?_0x145443[_0x4d2911[_0x28e0dd][_0xa62b('0x70')]][_0xa62b('0x71')]:_0x4d2911[_0x28e0dd][_0xa62b('0x66')];_0x12873d=_0x4d2911[_0x28e0dd][_0xa62b('0x72')]?_[_0xa62b('0x74')](_0x35d1d0[_0x4d2911[_0x28e0dd][_0xa62b('0x72')]],'%s',_0x12873d):_0x12873d;_0x12873d=_0x4d2911[_0x28e0dd][_0xa62b('0x73')]?_[_0xa62b('0x74')](_0x226c56[_0x4d2911[_0x28e0dd][_0xa62b('0x73')]],'%s',_0x12873d):_0x12873d;if(_0x4d2911[_0x28e0dd][_0xa62b('0x75')]){_0xb4f985[_0xa62b('0x65')](_0x12873d);}_0x4d2911[_0x28e0dd][_0xa62b('0x76')]&&_0xb4f985[_0xa62b('0x39')](_0x12873d,_0x4d2911[_0x28e0dd]['orderBy']===_0xa62b('0x87')?![]:!![]);_0xb4f985[_0xa62b('0x66')](_0x12873d,_0x4d2911[_0x28e0dd][_0xa62b('0x88')]||_0x12873d);}if(_0x580779['joins']){_0x580779['joins']=JSON[_0xa62b('0x7c')](_0x580779[_0xa62b('0x77')]);for(var _0x4b87b3=0x0;_0x4b87b3<_0x580779['joins'][_0xa62b('0x37')];_0x4b87b3+=0x1){if(_0x580779[_0xa62b('0x77')][_0x4b87b3]['type']&&_['includes'](_0x32d9ac,_0x580779[_0xa62b('0x77')][_0x4b87b3][_0xa62b('0x2f')])&&_0x580779['joins'][_0x4b87b3]['parentKey']&&_0x580779['joins'][_0x4b87b3][_0xa62b('0x7b')]&&_0x580779['joins'][_0x4b87b3][_0xa62b('0x7a')]){_0xb4f985[_0x580779['joins'][_0x4b87b3][_0xa62b('0x2f')]](_0x580779[_0xa62b('0x77')][_0x4b87b3][_0xa62b('0x7b')],null,util[_0xa62b('0x73')](_0xa62b('0x89'),_0x580779[_0xa62b('0x6f')],_0x580779['joins'][_0x4b87b3][_0xa62b('0x79')],_0x580779[_0xa62b('0x77')][_0x4b87b3]['foreignTable'],_0x580779['joins'][_0x4b87b3][_0xa62b('0x7a')]));}}}if(_0x580779['conditions']){_0x580779['conditions']=JSON[_0xa62b('0x7c')](_0x580779[_0xa62b('0x8a')]);_0xb4f985['where'](_0x12385b(_0x580779[_0xa62b('0x8a')][_0xa62b('0x65')]));}_0x3db3b3=_0xb4f985[_0xa62b('0x7d')]();_0xb4f985['limit'](_0x247045);_0xb4f985[_0xa62b('0x1a')](0x0);logger[_0xa62b('0x7e')]('Limited\x20Query:',_0xb4f985[_0xa62b('0x80')]());return dbH[_0xa62b('0x7f')][_0xa62b('0x35')](_0xb4f985['toString'](),{'type':dbH[_0xa62b('0x7f')][_0xa62b('0x81')][_0xa62b('0x9d')]});}})[_0xa62b('0x22')](function(){return{'sql':_0x3db3b3['toString']()};})[_0xa62b('0x22')](respondWithResult(_0x22feb4,null))[_0xa62b('0x46')](handleError(_0x22feb4,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index aae7242..93c1bb9 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 _0xaaab=['rimraf','../../config/environment','exports','define','AnalyticCustomReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x30ed3b,_0x4b2d6e){var _0x3a1347=function(_0x27ade3){while(--_0x27ade3){_0x30ed3b['push'](_0x30ed3b['shift']());}};_0x3a1347(++_0x4b2d6e);}(_0xaaab,0x171));var _0xbaaa=function(_0x1f44a3,_0x5c0c99){_0x1f44a3=_0x1f44a3-0x0;var _0x4e653e=_0xaaab[_0x1f44a3];return _0x4e653e;};'use strict';var _=require(_0xbaaa('0x0'));var util=require(_0xbaaa('0x1'));var logger=require(_0xbaaa('0x2'))(_0xbaaa('0x3'));var moment=require(_0xbaaa('0x4'));var BPromise=require(_0xbaaa('0x5'));var rp=require(_0xbaaa('0x6'));var fs=require('fs');var path=require(_0xbaaa('0x7'));var rimraf=require(_0xbaaa('0x8'));var config=require(_0xbaaa('0x9'));var attributes=require('./analyticCustomReport.attributes');module[_0xbaaa('0xa')]=function(_0x3a96c0,_0x431c50){return _0x3a96c0[_0xbaaa('0xb')](_0xbaaa('0xc'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3029=['path','rimraf','./analyticCustomReport.attributes','define','AnalyticCustomReport','lodash','util','../../config/logger','api','moment'];(function(_0x5431b1,_0x2ab234){var _0x5c1570=function(_0x1d6962){while(--_0x1d6962){_0x5431b1['push'](_0x5431b1['shift']());}};_0x5c1570(++_0x2ab234);}(_0x3029,0x13b));var _0x9302=function(_0x5dfee3,_0x5e3bbe){_0x5dfee3=_0x5dfee3-0x0;var _0x1e1785=_0x3029[_0x5dfee3];return _0x1e1785;};'use strict';var _=require(_0x9302('0x0'));var util=require(_0x9302('0x1'));var logger=require(_0x9302('0x2'))(_0x9302('0x3'));var moment=require(_0x9302('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9302('0x5'));var rimraf=require(_0x9302('0x6'));var config=require('../../config/environment');var attributes=require(_0x9302('0x7'));module['exports']=function(_0x4b6726,_0x347f2b){return _0x4b6726[_0x9302('0x8')](_0x9302('0x9'),attributes,{'tableName':'analytics_custom_reports','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 d77b1b1..4003f9d 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 _0xf5bf=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x10a2ea,_0x487cf2){var _0x347b66=function(_0x592edb){while(--_0x592edb){_0x10a2ea['push'](_0x10a2ea['shift']());}};_0x347b66(++_0x487cf2);}(_0xf5bf,0x1db));var _0xff5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf5bf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xff5b('0x0'));var BPromise=require(_0xff5b('0x1'));var rs=require(_0xff5b('0x2'));var fs=require('fs');var Redis=require(_0xff5b('0x3'));var db=require(_0xff5b('0x4'))['db'];var utils=require(_0xff5b('0x5'));var logger=require('../../config/logger')(_0xff5b('0x6'));var config=require(_0xff5b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xff5b('0x8')][_0xff5b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x162077,_0x1ff16f,_0x48fce3){return new BPromise(function(_0x13adf4,_0x3529ca){return client[_0xff5b('0xa')](_0x162077,_0x48fce3)[_0xff5b('0xb')](function(_0x5d3d4b){logger[_0xff5b('0xc')](_0xff5b('0xd'),_0x1ff16f,_0xff5b('0xe'));logger[_0xff5b('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x1ff16f,_0xff5b('0xe'),JSON[_0xff5b('0x10')](_0x5d3d4b));if(_0x5d3d4b[_0xff5b('0x11')]){if(_0x5d3d4b[_0xff5b('0x11')][_0xff5b('0x12')]===0x1f4){logger[_0xff5b('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1ff16f,_0x5d3d4b[_0xff5b('0x11')][_0xff5b('0x13')]);return _0x3529ca(_0x5d3d4b[_0xff5b('0x11')]['message']);}logger[_0xff5b('0x11')](_0xff5b('0xd'),_0x1ff16f,_0x5d3d4b['error'][_0xff5b('0x13')]);return _0x13adf4(_0x5d3d4b['error'][_0xff5b('0x13')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x1ff16f,_0xff5b('0xe'));_0x13adf4(_0x5d3d4b[_0xff5b('0x14')][_0xff5b('0x13')]);}})[_0xff5b('0x15')](function(_0x182272){logger[_0xff5b('0x11')](_0xff5b('0xd'),_0x1ff16f,_0x182272);_0x3529ca(_0x182272);});});}
\ No newline at end of file
+var _0x9526=['AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info'];(function(_0x343609,_0x452635){var _0x1c5221=function(_0x4fb227){while(--_0x4fb227){_0x343609['push'](_0x343609['shift']());}};_0x1c5221(++_0x452635);}(_0x9526,0x127));var _0x6952=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9526[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x6952('0x0'));var util=require(_0x6952('0x1'));var moment=require(_0x6952('0x2'));var BPromise=require('bluebird');var rs=require(_0x6952('0x3'));var fs=require('fs');var Redis=require(_0x6952('0x4'));var db=require(_0x6952('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6952('0x6'))(_0x6952('0x7'));var config=require(_0x6952('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6952('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x503551,_0x44fc27,_0x4327c7){return new BPromise(function(_0x4f4719,_0x58eb2a){return client[_0x6952('0xa')](_0x503551,_0x4327c7)[_0x6952('0xb')](function(_0xc0cdc8){logger[_0x6952('0xc')](_0x6952('0xd'),_0x44fc27,_0x6952('0xe'));logger[_0x6952('0xf')](_0x6952('0x10'),_0x44fc27,'request\x20sent',JSON[_0x6952('0x11')](_0xc0cdc8));if(_0xc0cdc8[_0x6952('0x12')]){if(_0xc0cdc8[_0x6952('0x12')][_0x6952('0x13')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x44fc27,_0xc0cdc8[_0x6952('0x12')][_0x6952('0x14')]);return _0x58eb2a(_0xc0cdc8[_0x6952('0x12')][_0x6952('0x14')]);}logger[_0x6952('0x12')](_0x6952('0xd'),_0x44fc27,_0xc0cdc8['error']['message']);return _0x4f4719(_0xc0cdc8[_0x6952('0x12')][_0x6952('0x14')]);}else{logger[_0x6952('0xc')](_0x6952('0xd'),_0x44fc27,_0x6952('0xe'));_0x4f4719(_0xc0cdc8[_0x6952('0x15')]['message']);}})['catch'](function(_0x564bdd){logger[_0x6952('0x12')](_0x6952('0xd'),_0x44fc27,_0x564bdd);_0x58eb2a(_0x564bdd);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index b85ef8b..440a8c5 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 _0x4ace=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','query','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x363b63,_0x2b4dbc){var _0x145809=function(_0x10ed37){while(--_0x10ed37){_0x363b63['push'](_0x363b63['shift']());}};_0x145809(++_0x2b4dbc);}(_0x4ace,0x1a4));var _0xe4ac=function(_0xef9fc3,_0x1e461b){_0xef9fc3=_0xef9fc3-0x0;var _0x300391=_0x4ace[_0xef9fc3];return _0x300391;};'use strict';var multer=require(_0xe4ac('0x0'));var util=require(_0xe4ac('0x1'));var path=require('path');var timeout=require(_0xe4ac('0x2'));var express=require(_0xe4ac('0x3'));var router=express[_0xe4ac('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe4ac('0x5'));var interaction=require(_0xe4ac('0x6'));var config=require(_0xe4ac('0x7'));var controller=require(_0xe4ac('0x8'));router[_0xe4ac('0x9')]('/',auth[_0xe4ac('0xa')](),controller[_0xe4ac('0xb')]);router[_0xe4ac('0x9')](_0xe4ac('0xc'),auth[_0xe4ac('0xa')](),controller[_0xe4ac('0xd')]);router[_0xe4ac('0x9')](_0xe4ac('0xe'),auth[_0xe4ac('0xa')](),controller[_0xe4ac('0xf')]);router[_0xe4ac('0x9')](_0xe4ac('0x10'),auth[_0xe4ac('0xa')](),controller[_0xe4ac('0x11')]);router['get']('/:id/query',auth[_0xe4ac('0xa')](),controller[_0xe4ac('0x12')]);router[_0xe4ac('0x13')]('/',auth['isAuthenticated'](),controller[_0xe4ac('0x14')]);router[_0xe4ac('0x15')](_0xe4ac('0xc'),auth[_0xe4ac('0xa')](),controller[_0xe4ac('0x16')]);router[_0xe4ac('0x17')](_0xe4ac('0xc'),auth['isAuthenticated'](),controller[_0xe4ac('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x29ec=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2ab48e,_0x5154f5){var _0x57db24=function(_0x454100){while(--_0x454100){_0x2ab48e['push'](_0x2ab48e['shift']());}};_0x57db24(++_0x5154f5);}(_0x29ec,0x1b4));var _0xc29e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29ec[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xc29e('0x0'));var path=require(_0xc29e('0x1'));var timeout=require(_0xc29e('0x2'));var express=require(_0xc29e('0x3'));var router=express[_0xc29e('0x4')]();var fs_extra=require(_0xc29e('0x5'));var auth=require(_0xc29e('0x6'));var interaction=require(_0xc29e('0x7'));var config=require(_0xc29e('0x8'));var controller=require(_0xc29e('0x9'));router[_0xc29e('0xa')]('/',auth[_0xc29e('0xb')](),controller['index']);router[_0xc29e('0xa')]('/:id',auth[_0xc29e('0xb')](),controller[_0xc29e('0xc')]);router['get'](_0xc29e('0xd'),auth[_0xc29e('0xb')](),controller[_0xc29e('0xe')]);router['get'](_0xc29e('0xf'),auth[_0xc29e('0xb')](),controller[_0xc29e('0x10')]);router['get'](_0xc29e('0x11'),auth[_0xc29e('0xb')](),controller[_0xc29e('0x12')]);router[_0xc29e('0x13')]('/',auth[_0xc29e('0xb')](),controller[_0xc29e('0x14')]);router[_0xc29e('0x15')](_0xc29e('0x16'),auth[_0xc29e('0xb')](),controller[_0xc29e('0x17')]);router[_0xc29e('0x18')](_0xc29e('0x16'),auth[_0xc29e('0xb')](),controller['destroy']);module[_0xc29e('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index f2e4b31..7ca0142 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 _0xee14=['STRING','TEXT'];(function(_0x17fbde,_0x3ab873){var _0x455516=function(_0x3ace41){while(--_0x3ace41){_0x17fbde['push'](_0x17fbde['shift']());}};_0x455516(++_0x3ab873);}(_0xee14,0x13a));var _0x4ee1=function(_0x36eb56,_0xb61cc9){_0x36eb56=_0x36eb56-0x0;var _0x26bd7e=_0xee14[_0x36eb56];return _0x26bd7e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}};
\ No newline at end of file
+var _0x2eb2=['TEXT','exports','STRING'];(function(_0x4186fa,_0x26a01c){var _0x136990=function(_0x13324f){while(--_0x13324f){_0x4186fa['push'](_0x4186fa['shift']());}};_0x136990(++_0x26a01c);}(_0x2eb2,0x19f));var _0x22eb=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x2eb2[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'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 37965f5..dce2d97 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 _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x109468,_0x1a47a2){var _0x2dc299=function(_0x126e29){while(--_0x126e29){_0x109468['push'](_0x109468['shift']());}};_0x2dc299(++_0x1a47a2);}(_0x1261,0x144));var _0x1126=function(_0x3f52ee,_0x468aab){_0x3f52ee=_0x3f52ee-0x0;var _0x4f7924=_0x1261[_0x3f52ee];return _0x4f7924;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));};
\ No newline at end of file
+var _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x3db2db,_0x577bc0){var _0x5905a4=function(_0x4a7385){while(--_0x4a7385){_0x3db2db['push'](_0x3db2db['shift']());}};_0x5905a4(++_0x577bc0);}(_0xf494,0x1c6));var _0x4f49=function(_0x50388b,_0x276225){_0x50388b=_0x50388b-0x0;var _0x6037b=_0xf494[_0x50388b];return _0x6037b;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index edc17d2..90cd398 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 _0xb79b=['./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x142504,_0x351032){var _0x1bc24a=function(_0x3ff32f){while(--_0x3ff32f){_0x142504['push'](_0x142504['shift']());}};_0x1bc24a(++_0x351032);}(_0xb79b,0x88));var _0xbb79=function(_0x97c5fa,_0x32aa7c){_0x97c5fa=_0x97c5fa-0x0;var _0x1e9d94=_0xb79b[_0x97c5fa];return _0x1e9d94;};'use strict';var _=require('lodash');var util=require(_0xbb79('0x0'));var logger=require(_0xbb79('0x1'))(_0xbb79('0x2'));var moment=require(_0xbb79('0x3'));var BPromise=require(_0xbb79('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb79('0x5'));var rimraf=require(_0xbb79('0x6'));var config=require(_0xbb79('0x7'));var attributes=require(_0xbb79('0x8'));module[_0xbb79('0x9')]=function(_0x2010b5,_0x161b77){return _0x2010b5['define'](_0xbb79('0xa'),attributes,{'tableName':_0xbb79('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4e39=['request-promise','path','rimraf','../../config/environment','define','AnalyticDefaultReport','analytics_default_reports','util','api','moment','bluebird'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0x4e39,0xf9));var _0x94e3=function(_0x5b3b9b,_0x1c71b0){_0x5b3b9b=_0x5b3b9b-0x0;var _0x47c1d7=_0x4e39[_0x5b3b9b];return _0x47c1d7;};'use strict';var _=require('lodash');var util=require(_0x94e3('0x0'));var logger=require('../../config/logger')(_0x94e3('0x1'));var moment=require(_0x94e3('0x2'));var BPromise=require(_0x94e3('0x3'));var rp=require(_0x94e3('0x4'));var fs=require('fs');var path=require(_0x94e3('0x5'));var rimraf=require(_0x94e3('0x6'));var config=require(_0x94e3('0x7'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x5e7da8,_0x2a7bf1){return _0x5e7da8[_0x94e3('0x8')](_0x94e3('0x9'),attributes,{'tableName':_0x94e3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index ceec864..f311d52 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 _0x709e=['then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x1443ad,_0x353e8e){var _0x4ab7e6=function(_0x139525){while(--_0x139525){_0x1443ad['push'](_0x1443ad['shift']());}};_0x4ab7e6(++_0x353e8e);}(_0x709e,0x16b));var _0xe709=function(_0x2dd30f,_0x458a88){_0x2dd30f=_0x2dd30f-0x0;var _0x4d5d48=_0x709e[_0x2dd30f];return _0x4d5d48;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe709('0x0'));var BPromise=require(_0xe709('0x1'));var rs=require(_0xe709('0x2'));var fs=require('fs');var Redis=require(_0xe709('0x3'));var db=require(_0xe709('0x4'))['db'];var utils=require(_0xe709('0x5'));var logger=require(_0xe709('0x6'))(_0xe709('0x7'));var config=require(_0xe709('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe709('0x9')][_0xe709('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e878c,_0x57d87a,_0x17ffba){return new BPromise(function(_0x221047,_0x5124bf){return client['request'](_0x1e878c,_0x17ffba)[_0xe709('0xb')](function(_0x22ea67){logger['info'](_0xe709('0xc'),_0x57d87a,_0xe709('0xd'));logger[_0xe709('0xe')](_0xe709('0xf'),_0x57d87a,_0xe709('0xd'),JSON['stringify'](_0x22ea67));if(_0x22ea67['error']){if(_0x22ea67['error'][_0xe709('0x10')]===0x1f4){logger[_0xe709('0x11')](_0xe709('0xc'),_0x57d87a,_0x22ea67[_0xe709('0x11')][_0xe709('0x12')]);return _0x5124bf(_0x22ea67['error'][_0xe709('0x12')]);}logger[_0xe709('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x57d87a,_0x22ea67[_0xe709('0x11')]['message']);return _0x221047(_0x22ea67[_0xe709('0x11')][_0xe709('0x12')]);}else{logger[_0xe709('0x13')](_0xe709('0xc'),_0x57d87a,_0xe709('0xd'));_0x221047(_0x22ea67[_0xe709('0x14')][_0xe709('0x12')]);}})[_0xe709('0x15')](function(_0x3d7cc2){logger[_0xe709('0x11')](_0xe709('0xc'),_0x57d87a,_0x3d7cc2);_0x5124bf(_0x3d7cc2);});});}
\ No newline at end of file
+var _0x1733=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment'];(function(_0x256c8c,_0xe780c7){var _0x5f3bb=function(_0x170d04){while(--_0x170d04){_0x256c8c['push'](_0x256c8c['shift']());}};_0x5f3bb(++_0xe780c7);}(_0x1733,0x110));var _0x3173=function(_0x3b2534,_0x4d55a5){_0x3b2534=_0x3b2534-0x0;var _0x3cbe9a=_0x1733[_0x3b2534];return _0x3cbe9a;};'use strict';var _=require(_0x3173('0x0'));var util=require(_0x3173('0x1'));var moment=require(_0x3173('0x2'));var BPromise=require(_0x3173('0x3'));var rs=require(_0x3173('0x4'));var fs=require('fs');var Redis=require(_0x3173('0x5'));var db=require(_0x3173('0x6'))['db'];var utils=require(_0x3173('0x7'));var logger=require(_0x3173('0x8'))(_0x3173('0x9'));var config=require(_0x3173('0xa'));var jayson=require(_0x3173('0xb'));var client=jayson[_0x3173('0xc')][_0x3173('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x542be6,_0x2c6aa1,_0x4b6033){return new BPromise(function(_0x5e2bba,_0x16465e){return client[_0x3173('0xe')](_0x542be6,_0x4b6033)[_0x3173('0xf')](function(_0x36b279){logger['info'](_0x3173('0x10'),_0x2c6aa1,_0x3173('0x11'));logger[_0x3173('0x12')](_0x3173('0x13'),_0x2c6aa1,_0x3173('0x11'),JSON[_0x3173('0x14')](_0x36b279));if(_0x36b279[_0x3173('0x15')]){if(_0x36b279['error'][_0x3173('0x16')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2c6aa1,_0x36b279[_0x3173('0x15')][_0x3173('0x17')]);return _0x16465e(_0x36b279[_0x3173('0x15')][_0x3173('0x17')]);}logger[_0x3173('0x15')](_0x3173('0x10'),_0x2c6aa1,_0x36b279['error'][_0x3173('0x17')]);return _0x5e2bba(_0x36b279[_0x3173('0x15')][_0x3173('0x17')]);}else{logger[_0x3173('0x18')](_0x3173('0x10'),_0x2c6aa1,'request\x20sent');_0x5e2bba(_0x36b279['result'][_0x3173('0x17')]);}})['catch'](function(_0x2e5920){logger[_0x3173('0x15')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2c6aa1,_0x2e5920);_0x16465e(_0x2e5920);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 872789b..e11a02b 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 _0x0bfd=['fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','/:id/query','query','post','create','put','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x0bfd,0x10f));var _0xd0bf=function(_0x4f906e,_0x2f3c6b){_0x4f906e=_0x4f906e-0x0;var _0x4d68e5=_0x0bfd[_0x4f906e];return _0x4d68e5;};'use strict';var multer=require(_0xd0bf('0x0'));var util=require(_0xd0bf('0x1'));var path=require('path');var timeout=require(_0xd0bf('0x2'));var express=require(_0xd0bf('0x3'));var router=express[_0xd0bf('0x4')]();var fs_extra=require(_0xd0bf('0x5'));var auth=require(_0xd0bf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd0bf('0x7'));var controller=require(_0xd0bf('0x8'));router[_0xd0bf('0x9')]('/',auth[_0xd0bf('0xa')](),controller[_0xd0bf('0xb')]);router['get'](_0xd0bf('0xc'),auth['isAuthenticated'](),controller[_0xd0bf('0xd')]);router['get']('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0xd0bf('0x9')](_0xd0bf('0xe'),auth['isAuthenticated'](),controller[_0xd0bf('0xf')]);router[_0xd0bf('0x9')](_0xd0bf('0x10'),auth[_0xd0bf('0xa')](),controller[_0xd0bf('0x11')]);router[_0xd0bf('0x12')]('/',auth['isAuthenticated'](),controller[_0xd0bf('0x13')]);router[_0xd0bf('0x14')](_0xd0bf('0xc'),auth[_0xd0bf('0xa')](),controller['update']);router['delete'](_0xd0bf('0xc'),auth[_0xd0bf('0xa')](),controller[_0xd0bf('0x15')]);module[_0xd0bf('0x16')]=router;
\ No newline at end of file
+var _0xf59d=['preview','/:id/run','isAuthenticated','/:id/query','query','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','/:id/preview'];(function(_0x212bf5,_0x165cbd){var _0xfcad21=function(_0x4a4e6e){while(--_0x4a4e6e){_0x212bf5['push'](_0x212bf5['shift']());}};_0xfcad21(++_0x165cbd);}(_0xf59d,0x13f));var _0xdf59=function(_0x5a69ab,_0x610049){_0x5a69ab=_0x5a69ab-0x0;var _0x27f2f7=_0xf59d[_0x5a69ab];return _0x27f2f7;};'use strict';var multer=require(_0xdf59('0x0'));var util=require('util');var path=require(_0xdf59('0x1'));var timeout=require(_0xdf59('0x2'));var express=require(_0xdf59('0x3'));var router=express[_0xdf59('0x4')]();var fs_extra=require(_0xdf59('0x5'));var auth=require(_0xdf59('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdf59('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0xdf59('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdf59('0x8')](_0xdf59('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xdf59('0x8')](_0xdf59('0xa'),auth['isAuthenticated'](),controller[_0xdf59('0xb')]);router[_0xdf59('0x8')](_0xdf59('0xc'),auth[_0xdf59('0xd')](),controller['run']);router['get'](_0xdf59('0xe'),auth['isAuthenticated'](),controller[_0xdf59('0xf')]);router[_0xdf59('0x10')]('/',auth[_0xdf59('0xd')](),controller[_0xdf59('0x11')]);router[_0xdf59('0x12')](_0xdf59('0x9'),auth['isAuthenticated'](),controller[_0xdf59('0x13')]);router[_0xdf59('0x14')](_0xdf59('0x9'),auth[_0xdf59('0xd')](),controller['destroy']);module[_0xdf59('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index eb3a148..65f7e48 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 _0x4578=['Loading','ENUM','manual','UNSIGNED','sequelize','exports','STRING','csv','pdf','xlsx','DATE'];(function(_0xf7e53b,_0x203bf2){var _0x15734b=function(_0x5b9153){while(--_0x5b9153){_0xf7e53b['push'](_0xf7e53b['shift']());}};_0x15734b(++_0x203bf2);}(_0x4578,0x1f3));var _0x8457=function(_0x43cd9f,_0x57d758){_0x43cd9f=_0x43cd9f-0x0;var _0x5cf244=_0x4578[_0x43cd9f];return _0x5cf244;};'use strict';var Sequelize=require(_0x8457('0x0'));var moment=require('moment');module[_0x8457('0x1')]={'name':{'type':Sequelize[_0x8457('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x8457('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x8457('0x3'),_0x8457('0x4'),_0x8457('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x8457('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x8457('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x8457('0x7')},'type':{'type':Sequelize[_0x8457('0x8')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x8457('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x8457('0xa')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb4b9=['manual','scheduled','INTEGER','exports','ENUM','csv','xlsx','STRING'];(function(_0x5a6881,_0x2ee48b){var _0x530c8c=function(_0x102b10){while(--_0x102b10){_0x5a6881['push'](_0x5a6881['shift']());}};_0x530c8c(++_0x2ee48b);}(_0xb4b9,0xe3));var _0x9b4b=function(_0x2f0444,_0x591d1c){_0x2f0444=_0x2f0444-0x0;var _0x2f2bc5=_0xb4b9[_0x2f0444];return _0x2f2bc5;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x9b4b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x9b4b('0x1')](_0x9b4b('0x2'),'pdf',_0x9b4b('0x3')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x9b4b('0x4')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x9b4b('0x4')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x9b4b('0x1')](_0x9b4b('0x5'),_0x9b4b('0x6')),'allowNull':![],'defaultValue':_0x9b4b('0x5')},'reportId':{'type':Sequelize[_0x9b4b('0x7')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x9b4b('0x4')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 09c2bb9..8fc7ddf 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 _0x257e=['nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','%s.%s','output','toLowerCase','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','get','UserProfileResource','destroy','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty'];(function(_0x48051b,_0x339115){var _0x2a4f6e=function(_0x5b7756){while(--_0x5b7756){_0x48051b['push'](_0x48051b['shift']());}};_0x2a4f6e(++_0x339115);}(_0x257e,0x1e5));var _0xe257=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x257e[_0x39c734];return _0xb2a2f9;};'use strict';var emlformat=require(_0xe257('0x0'));var rimraf=require(_0xe257('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe257('0x2'));var moment=require('moment');var BPromise=require(_0xe257('0x3'));var Mustache=require('mustache');var util=require(_0xe257('0x4'));var path=require(_0xe257('0x5'));var sox=require(_0xe257('0x6'));var csv=require(_0xe257('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe257('0x8'));var _=require(_0xe257('0x9'));var squel=require(_0xe257('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe257('0x7'));var querystring=require(_0xe257('0xb'));var Papa=require(_0xe257('0xc'));var Redis=require(_0xe257('0xd'));var authService=require(_0xe257('0xe'));var qs=require(_0xe257('0xf'));var as=require(_0xe257('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe257('0x11'))(_0xe257('0x12'));var utils=require(_0xe257('0x13'));var config=require(_0xe257('0x14'));var licenseUtil=require(_0xe257('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39ca75,_0x4692c5){_0x4692c5=_0x4692c5||0xcc;return function(_0x2e0bb9){if(_0x2e0bb9){return _0x39ca75[_0xe257('0x16')](_0x4692c5);}return _0x39ca75[_0xe257('0x17')](_0x4692c5)[_0xe257('0x18')]();};}function respondWithResult(_0x2f1fb9,_0x3c2402){_0x3c2402=_0x3c2402||0xc8;return function(_0x3eef32){if(_0x3eef32){return _0x2f1fb9['status'](_0x3c2402)[_0xe257('0x19')](_0x3eef32);}};}function respondWithFilteredResult(_0x3298d9,_0x27c490){return function(_0x2baaf0){if(_0x2baaf0){var _0x59c15f=typeof _0x27c490[_0xe257('0x1a')]===_0xe257('0x1b')&&typeof _0x27c490[_0xe257('0x1c')]===_0xe257('0x1b');var _0x32d1bf=_0x2baaf0['count'];var _0x10d90f=_0x59c15f?0x0:_0x27c490[_0xe257('0x1a')];var _0x1bc084=_0x59c15f?_0x2baaf0[_0xe257('0x1d')]:_0x27c490[_0xe257('0x1a')]+_0x27c490[_0xe257('0x1c')];var _0x3aac92;if(_0x1bc084>=_0x32d1bf){_0x1bc084=_0x32d1bf;_0x3aac92=0xc8;}else{_0x3aac92=0xce;}_0x3298d9['status'](_0x3aac92);return _0x3298d9['set']('Content-Range',_0x10d90f+'-'+_0x1bc084+'/'+_0x32d1bf)[_0xe257('0x19')](_0x2baaf0);}return null;};}function patchUpdates(_0x3601f5){return function(_0x2fe0b0){try{jsonpatch[_0xe257('0x1e')](_0x2fe0b0,_0x3601f5,!![]);}catch(_0x519109){return BPromise[_0xe257('0x1f')](_0x519109);}return _0x2fe0b0['save']();};}function saveUpdates(_0x2f6f8b,_0x39526e){return function(_0x5d498e){if(_0x5d498e){return _0x5d498e[_0xe257('0x20')](_0x2f6f8b)['then'](function(_0x2f87ac){return _0x2f87ac;});}return null;};}function removeEntity(_0x20708b,_0x5de55b){return function(_0x2e5f6e){if(_0x2e5f6e){return _0x2e5f6e['destroy']()[_0xe257('0x21')](function(){var _0x2101ac=_0x2e5f6e[_0xe257('0x22')]({'plain':!![]});var _0x4e99ef='ExtractedReports';return db[_0xe257('0x23')][_0xe257('0x24')]({'where':{'type':_0x4e99ef,'resourceId':_0x2101ac['id']}})[_0xe257('0x21')](function(){return _0x2e5f6e;});})['then'](function(){_0x20708b[_0xe257('0x17')](0xcc)[_0xe257('0x18')]();});}};}function handleEntityNotFound(_0x557f13,_0x49a67c){return function(_0x4c5b21){if(!_0x4c5b21){_0x557f13[_0xe257('0x16')](0x194);}return _0x4c5b21;};}function handleError(_0x2f18f3,_0x103935){_0x103935=_0x103935||0x1f4;return function(_0x418405){logger[_0xe257('0x25')](_0x418405['stack']);if(_0x418405[_0xe257('0x26')]){delete _0x418405[_0xe257('0x26')];}_0x2f18f3[_0xe257('0x17')](_0x103935)[_0xe257('0x27')](_0x418405);};}exports[_0xe257('0x28')]=function(_0x6bc037,_0x54978b){var _0x1ff781={},_0x3264b4={},_0x167e6c={'count':0x0,'rows':[]};var _0xa20955=_[_0xe257('0x29')](db[_0xe257('0x2a')][_0xe257('0x2b')],function(_0x24bb91){return{'name':_0x24bb91[_0xe257('0x2c')],'type':_0x24bb91[_0xe257('0x2d')][_0xe257('0x2e')]};});_0x3264b4[_0xe257('0x2f')]=_['map'](_0xa20955,_0xe257('0x26'));_0x3264b4['query']=_[_0xe257('0x30')](_0x6bc037[_0xe257('0x31')]);_0x3264b4[_0xe257('0x32')]=_['intersection'](_0x3264b4[_0xe257('0x2f')],_0x3264b4['query']);_0x1ff781[_0xe257('0x33')]=_['intersection'](_0x3264b4[_0xe257('0x2f')],qs['fields'](_0x6bc037[_0xe257('0x31')][_0xe257('0x34')]));_0x1ff781[_0xe257('0x33')]=_0x1ff781[_0xe257('0x33')][_0xe257('0x35')]?_0x1ff781[_0xe257('0x33')]:_0x3264b4[_0xe257('0x2f')];if(!_0x6bc037['query'][_0xe257('0x36')](_0xe257('0x37'))){_0x1ff781[_0xe257('0x1c')]=qs[_0xe257('0x1c')](_0x6bc037['query'][_0xe257('0x1c')]);_0x1ff781[_0xe257('0x1a')]=qs[_0xe257('0x1a')](_0x6bc037[_0xe257('0x31')][_0xe257('0x1a')]);}_0x1ff781[_0xe257('0x38')]=qs[_0xe257('0x39')](_0x6bc037[_0xe257('0x31')]['sort']);_0x1ff781[_0xe257('0x3a')]=qs[_0xe257('0x32')](_['pick'](_0x6bc037['query'],_0x3264b4[_0xe257('0x32')]),_0xa20955);if(_0x6bc037[_0xe257('0x31')][_0xe257('0x3b')]){_0x1ff781['where']=_[_0xe257('0x3c')](_0x1ff781[_0xe257('0x3a')],{'$or':_['map'](_0xa20955,function(_0x679863){if(_0x679863[_0xe257('0x2d')]!==_0xe257('0x3d')){var _0x35a352={};_0x35a352[_0x679863['name']]={'$like':'%'+_0x6bc037[_0xe257('0x31')][_0xe257('0x3b')]+'%'};return _0x35a352;}})});}_0x1ff781=_[_0xe257('0x3c')]({},_0x1ff781,_0x6bc037[_0xe257('0x3e')]);var _0x2b4317={'where':_0x1ff781[_0xe257('0x3a')]};return db[_0xe257('0x2a')][_0xe257('0x1d')](_0x2b4317)[_0xe257('0x21')](function(_0x32c707){_0x167e6c[_0xe257('0x1d')]=_0x32c707;if(_0x6bc037[_0xe257('0x31')]['includeAll']){_0x1ff781[_0xe257('0x3f')]=[{'all':!![]}];}return db[_0xe257('0x2a')]['findAll'](_0x1ff781);})[_0xe257('0x21')](function(_0x10f611){_0x167e6c['rows']=_0x10f611;return _0x167e6c;})[_0xe257('0x21')](respondWithFilteredResult(_0x54978b,_0x1ff781))[_0xe257('0x40')](handleError(_0x54978b,null));};exports[_0xe257('0x41')]=function(_0x37d7dd,_0x58e5f5){var _0x2122a8={'raw':!![],'where':{'id':_0x37d7dd[_0xe257('0x42')]['id']}},_0x103dbf={};_0x103dbf[_0xe257('0x2f')]=_[_0xe257('0x30')](db[_0xe257('0x2a')][_0xe257('0x2b')]);_0x103dbf['query']=_[_0xe257('0x30')](_0x37d7dd[_0xe257('0x31')]);_0x103dbf[_0xe257('0x32')]=_['intersection'](_0x103dbf[_0xe257('0x2f')],_0x103dbf[_0xe257('0x31')]);_0x2122a8[_0xe257('0x33')]=_['intersection'](_0x103dbf[_0xe257('0x2f')],qs[_0xe257('0x34')](_0x37d7dd[_0xe257('0x31')][_0xe257('0x34')]));_0x2122a8[_0xe257('0x33')]=_0x2122a8[_0xe257('0x33')][_0xe257('0x35')]?_0x2122a8[_0xe257('0x33')]:_0x103dbf[_0xe257('0x2f')];if(_0x37d7dd[_0xe257('0x31')][_0xe257('0x43')]){_0x2122a8[_0xe257('0x3f')]=[{'all':!![]}];}_0x2122a8=_[_0xe257('0x3c')]({},_0x2122a8,_0x37d7dd[_0xe257('0x3e')]);return db[_0xe257('0x2a')]['find'](_0x2122a8)[_0xe257('0x21')](handleEntityNotFound(_0x58e5f5,null))['then'](respondWithResult(_0x58e5f5,null))['catch'](handleError(_0x58e5f5,null));};exports[_0xe257('0x44')]=function(_0x301e53,_0x5d8c0e){return db['AnalyticExtractedReport'][_0xe257('0x44')](_0x301e53[_0xe257('0x45')],{})[_0xe257('0x21')](function(_0x587292){var _0x2ae1fe=_0x301e53['user'][_0xe257('0x22')]({'plain':!![]});if(!_0x2ae1fe)throw new Error(_0xe257('0x46'));if(_0x2ae1fe[_0xe257('0x47')]===_0xe257('0x48')){var _0x511b8c=_0x587292[_0xe257('0x22')]({'plain':!![]});var _0x57dfce=_0xe257('0x49');return db[_0xe257('0x4a')]['find']({'where':{'name':_0x57dfce,'userProfileId':_0x2ae1fe['userProfileId']},'raw':!![]})[_0xe257('0x21')](function(_0x56f2ab){if(_0x56f2ab&&_0x56f2ab[_0xe257('0x4b')]===0x0){return db['UserProfileResource'][_0xe257('0x44')]({'name':_0x511b8c[_0xe257('0x26')],'resourceId':_0x511b8c['id'],'type':_0x56f2ab[_0xe257('0x26')],'sectionId':_0x56f2ab['id']},{})[_0xe257('0x21')](function(){return _0x587292;});}else{return _0x587292;}})['catch'](function(_0x3d96c8){logger[_0xe257('0x25')](_0xe257('0x4c'),_0x3d96c8);throw _0x3d96c8;});}return _0x587292;})['then'](respondWithResult(_0x5d8c0e,0xc9))['catch'](handleError(_0x5d8c0e,null));};exports['update']=function(_0x4a94aa,_0x5d0b31){if(_0x4a94aa[_0xe257('0x45')]['id']){delete _0x4a94aa[_0xe257('0x45')]['id'];}return db[_0xe257('0x2a')][_0xe257('0x4d')]({'where':{'id':_0x4a94aa[_0xe257('0x42')]['id']}})[_0xe257('0x21')](handleEntityNotFound(_0x5d0b31,null))['then'](saveUpdates(_0x4a94aa[_0xe257('0x45')],null))[_0xe257('0x21')](respondWithResult(_0x5d0b31,null))['catch'](handleError(_0x5d0b31,null));};exports['destroy']=function(_0x37a9b0,_0x572a78){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x37a9b0[_0xe257('0x42')]['id']}})[_0xe257('0x21')](handleEntityNotFound(_0x572a78,null))[_0xe257('0x21')](removeEntity(_0x572a78,null))['catch'](handleError(_0x572a78,null));};exports[_0xe257('0x4e')]=function(_0x347456,_0x4aa567,_0x2b8572){return db[_0xe257('0x2a')][_0xe257('0x4d')]({'where':{'id':_0x347456['params']['id']},'attributes':['name',_0xe257('0x4f'),_0xe257('0x50'),'output'],'raw':!![]})[_0xe257('0x21')](handleEntityNotFound(_0x4aa567,null))[_0xe257('0x21')](function(_0x29d263){if(_0x29d263){if(!fs[_0xe257('0x51')](path[_0xe257('0x52')](config[_0xe257('0x53')],_0xe257('0x54'),_0x29d263['savename']))){throw new db[(_0xe257('0x55'))][(_0xe257('0x56'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x347456[_0xe257('0x31')]['exists']){return _0x4aa567['sendStatus'](0xc8);}return _0x4aa567['download'](path[_0xe257('0x52')](config[_0xe257('0x53')],_0xe257('0x54'),_0x29d263['savename']),util['format'](_0xe257('0x57'),_0x29d263[_0xe257('0x4f')]||_0x29d263['name'],_0x29d263[_0xe257('0x58')][_0xe257('0x59')]()));}})[_0xe257('0x40')](handleError(_0x4aa567,null));};
\ No newline at end of file
+var _0xbb24=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','savename','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox'];(function(_0x5c84a5,_0x50392b){var _0xf8b167=function(_0x4328b6){while(--_0x4328b6){_0x5c84a5['push'](_0x5c84a5['shift']());}};_0xf8b167(++_0x50392b);}(_0xbb24,0xc3));var _0x4bb2=function(_0x33318f,_0xbead0){_0x33318f=_0x33318f-0x0;var _0x4348d0=_0xbb24[_0x33318f];return _0x4348d0;};'use strict';var emlformat=require(_0x4bb2('0x0'));var rimraf=require(_0x4bb2('0x1'));var zipdir=require(_0x4bb2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4bb2('0x3'));var moment=require(_0x4bb2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4bb2('0x5'));var util=require(_0x4bb2('0x6'));var path=require(_0x4bb2('0x7'));var sox=require(_0x4bb2('0x8'));var csv=require(_0x4bb2('0x9'));var ejs=require(_0x4bb2('0xa'));var fs=require('fs');var fs_extra=require(_0x4bb2('0xb'));var _=require(_0x4bb2('0xc'));var squel=require(_0x4bb2('0xd'));var crypto=require(_0x4bb2('0xe'));var jsforce=require(_0x4bb2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4bb2('0x10'));var Papa=require(_0x4bb2('0x11'));var Redis=require(_0x4bb2('0x12'));var authService=require(_0x4bb2('0x13'));var qs=require(_0x4bb2('0x14'));var as=require(_0x4bb2('0x15'));var hardwareService=require(_0x4bb2('0x16'));var logger=require('../../config/logger')(_0x4bb2('0x17'));var utils=require(_0x4bb2('0x18'));var config=require(_0x4bb2('0x19'));var licenseUtil=require(_0x4bb2('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x514d89,_0x19ca0a){_0x19ca0a=_0x19ca0a||0xcc;return function(_0x879038){if(_0x879038){return _0x514d89['sendStatus'](_0x19ca0a);}return _0x514d89[_0x4bb2('0x1b')](_0x19ca0a)['end']();};}function respondWithResult(_0x467a97,_0x54f67b){_0x54f67b=_0x54f67b||0xc8;return function(_0x4e3ac4){if(_0x4e3ac4){return _0x467a97[_0x4bb2('0x1b')](_0x54f67b)[_0x4bb2('0x1c')](_0x4e3ac4);}};}function respondWithFilteredResult(_0x371f5e,_0xee36a5){return function(_0x2d472e){if(_0x2d472e){var _0x1d825e=typeof _0xee36a5[_0x4bb2('0x1d')]===_0x4bb2('0x1e')&&typeof _0xee36a5[_0x4bb2('0x1f')]==='undefined';var _0x154ed3=_0x2d472e[_0x4bb2('0x20')];var _0x5b6f3b=_0x1d825e?0x0:_0xee36a5['offset'];var _0x1153f0=_0x1d825e?_0x2d472e[_0x4bb2('0x20')]:_0xee36a5[_0x4bb2('0x1d')]+_0xee36a5[_0x4bb2('0x1f')];var _0xf96f13;if(_0x1153f0>=_0x154ed3){_0x1153f0=_0x154ed3;_0xf96f13=0xc8;}else{_0xf96f13=0xce;}_0x371f5e['status'](_0xf96f13);return _0x371f5e[_0x4bb2('0x21')](_0x4bb2('0x22'),_0x5b6f3b+'-'+_0x1153f0+'/'+_0x154ed3)[_0x4bb2('0x1c')](_0x2d472e);}return null;};}function patchUpdates(_0x44e173){return function(_0x5b8548){try{jsonpatch[_0x4bb2('0x23')](_0x5b8548,_0x44e173,!![]);}catch(_0x45c918){return BPromise[_0x4bb2('0x24')](_0x45c918);}return _0x5b8548[_0x4bb2('0x25')]();};}function saveUpdates(_0x1c440f,_0x1cd421){return function(_0x5ce308){if(_0x5ce308){return _0x5ce308[_0x4bb2('0x26')](_0x1c440f)[_0x4bb2('0x27')](function(_0x1fe082){return _0x1fe082;});}return null;};}function removeEntity(_0x54697e,_0x2a5150){return function(_0x3b0a2d){if(_0x3b0a2d){return _0x3b0a2d[_0x4bb2('0x28')]()['then'](function(){var _0x13cff9=_0x3b0a2d[_0x4bb2('0x29')]({'plain':!![]});var _0x4225fc=_0x4bb2('0x2a');return db[_0x4bb2('0x2b')][_0x4bb2('0x28')]({'where':{'type':_0x4225fc,'resourceId':_0x13cff9['id']}})[_0x4bb2('0x27')](function(){return _0x3b0a2d;});})[_0x4bb2('0x27')](function(){_0x54697e[_0x4bb2('0x1b')](0xcc)[_0x4bb2('0x2c')]();});}};}function handleEntityNotFound(_0x1c5133,_0x36bc6e){return function(_0xad2ea7){if(!_0xad2ea7){_0x1c5133[_0x4bb2('0x2d')](0x194);}return _0xad2ea7;};}function handleError(_0x3aceca,_0x5cb612){_0x5cb612=_0x5cb612||0x1f4;return function(_0x3cb75b){logger[_0x4bb2('0x2e')](_0x3cb75b[_0x4bb2('0x2f')]);if(_0x3cb75b[_0x4bb2('0x30')]){delete _0x3cb75b['name'];}_0x3aceca[_0x4bb2('0x1b')](_0x5cb612)[_0x4bb2('0x31')](_0x3cb75b);};}exports[_0x4bb2('0x32')]=function(_0x23bfd1,_0x2780ef){var _0x440c84={},_0x560219={},_0x4f9943={'count':0x0,'rows':[]};var _0x4c1f9a=_[_0x4bb2('0x33')](db[_0x4bb2('0x34')][_0x4bb2('0x35')],function(_0x377d2c){return{'name':_0x377d2c[_0x4bb2('0x36')],'type':_0x377d2c[_0x4bb2('0x37')][_0x4bb2('0x38')]};});_0x560219[_0x4bb2('0x39')]=_[_0x4bb2('0x33')](_0x4c1f9a,'name');_0x560219['query']=_[_0x4bb2('0x3a')](_0x23bfd1['query']);_0x560219[_0x4bb2('0x3b')]=_['intersection'](_0x560219[_0x4bb2('0x39')],_0x560219[_0x4bb2('0x3c')]);_0x440c84[_0x4bb2('0x3d')]=_[_0x4bb2('0x3e')](_0x560219[_0x4bb2('0x39')],qs[_0x4bb2('0x3f')](_0x23bfd1[_0x4bb2('0x3c')][_0x4bb2('0x3f')]));_0x440c84[_0x4bb2('0x3d')]=_0x440c84[_0x4bb2('0x3d')][_0x4bb2('0x40')]?_0x440c84[_0x4bb2('0x3d')]:_0x560219['model'];if(!_0x23bfd1['query'][_0x4bb2('0x41')](_0x4bb2('0x42'))){_0x440c84[_0x4bb2('0x1f')]=qs[_0x4bb2('0x1f')](_0x23bfd1[_0x4bb2('0x3c')][_0x4bb2('0x1f')]);_0x440c84[_0x4bb2('0x1d')]=qs[_0x4bb2('0x1d')](_0x23bfd1[_0x4bb2('0x3c')][_0x4bb2('0x1d')]);}_0x440c84['order']=qs[_0x4bb2('0x43')](_0x23bfd1[_0x4bb2('0x3c')][_0x4bb2('0x43')]);_0x440c84[_0x4bb2('0x44')]=qs[_0x4bb2('0x3b')](_[_0x4bb2('0x45')](_0x23bfd1[_0x4bb2('0x3c')],_0x560219[_0x4bb2('0x3b')]),_0x4c1f9a);if(_0x23bfd1[_0x4bb2('0x3c')][_0x4bb2('0x46')]){_0x440c84[_0x4bb2('0x44')]=_[_0x4bb2('0x47')](_0x440c84[_0x4bb2('0x44')],{'$or':_[_0x4bb2('0x33')](_0x4c1f9a,function(_0x664866){if(_0x664866[_0x4bb2('0x37')]!==_0x4bb2('0x48')){var _0x12a4d1={};_0x12a4d1[_0x664866[_0x4bb2('0x30')]]={'$like':'%'+_0x23bfd1[_0x4bb2('0x3c')][_0x4bb2('0x46')]+'%'};return _0x12a4d1;}})});}_0x440c84=_['merge']({},_0x440c84,_0x23bfd1[_0x4bb2('0x49')]);var _0x494fb8={'where':_0x440c84[_0x4bb2('0x44')]};return db[_0x4bb2('0x34')]['count'](_0x494fb8)['then'](function(_0x594d01){_0x4f9943[_0x4bb2('0x20')]=_0x594d01;if(_0x23bfd1['query']['includeAll']){_0x440c84[_0x4bb2('0x4a')]=[{'all':!![]}];}return db[_0x4bb2('0x34')][_0x4bb2('0x4b')](_0x440c84);})[_0x4bb2('0x27')](function(_0x28cef3){_0x4f9943[_0x4bb2('0x4c')]=_0x28cef3;return _0x4f9943;})[_0x4bb2('0x27')](respondWithFilteredResult(_0x2780ef,_0x440c84))[_0x4bb2('0x4d')](handleError(_0x2780ef,null));};exports[_0x4bb2('0x4e')]=function(_0x53ad20,_0x160dc8){var _0x387e08={'raw':!![],'where':{'id':_0x53ad20[_0x4bb2('0x4f')]['id']}},_0x13baf6={};_0x13baf6[_0x4bb2('0x39')]=_[_0x4bb2('0x3a')](db[_0x4bb2('0x34')][_0x4bb2('0x35')]);_0x13baf6[_0x4bb2('0x3c')]=_[_0x4bb2('0x3a')](_0x53ad20['query']);_0x13baf6['filters']=_['intersection'](_0x13baf6[_0x4bb2('0x39')],_0x13baf6[_0x4bb2('0x3c')]);_0x387e08[_0x4bb2('0x3d')]=_['intersection'](_0x13baf6[_0x4bb2('0x39')],qs['fields'](_0x53ad20[_0x4bb2('0x3c')][_0x4bb2('0x3f')]));_0x387e08[_0x4bb2('0x3d')]=_0x387e08['attributes'][_0x4bb2('0x40')]?_0x387e08[_0x4bb2('0x3d')]:_0x13baf6[_0x4bb2('0x39')];if(_0x53ad20['query'][_0x4bb2('0x50')]){_0x387e08[_0x4bb2('0x4a')]=[{'all':!![]}];}_0x387e08=_['merge']({},_0x387e08,_0x53ad20[_0x4bb2('0x49')]);return db[_0x4bb2('0x34')][_0x4bb2('0x51')](_0x387e08)[_0x4bb2('0x27')](handleEntityNotFound(_0x160dc8,null))[_0x4bb2('0x27')](respondWithResult(_0x160dc8,null))['catch'](handleError(_0x160dc8,null));};exports[_0x4bb2('0x52')]=function(_0x1461bc,_0x2a2ba2){return db[_0x4bb2('0x34')][_0x4bb2('0x52')](_0x1461bc[_0x4bb2('0x53')],{})[_0x4bb2('0x27')](function(_0xc93ba1){var _0x447179=_0x1461bc['user'][_0x4bb2('0x29')]({'plain':!![]});if(!_0x447179)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x447179[_0x4bb2('0x54')]===_0x4bb2('0x55')){var _0x597511=_0xc93ba1[_0x4bb2('0x29')]({'plain':!![]});var _0xf55cc9=_0x4bb2('0x2a');return db[_0x4bb2('0x56')]['find']({'where':{'name':_0xf55cc9,'userProfileId':_0x447179['userProfileId']},'raw':!![]})[_0x4bb2('0x27')](function(_0x2bd24b){if(_0x2bd24b&&_0x2bd24b[_0x4bb2('0x57')]===0x0){return db[_0x4bb2('0x2b')]['create']({'name':_0x597511['name'],'resourceId':_0x597511['id'],'type':_0x2bd24b[_0x4bb2('0x30')],'sectionId':_0x2bd24b['id']},{})[_0x4bb2('0x27')](function(){return _0xc93ba1;});}else{return _0xc93ba1;}})[_0x4bb2('0x4d')](function(_0x5577c4){logger[_0x4bb2('0x2e')](_0x4bb2('0x58'),_0x5577c4);throw _0x5577c4;});}return _0xc93ba1;})[_0x4bb2('0x27')](respondWithResult(_0x2a2ba2,0xc9))[_0x4bb2('0x4d')](handleError(_0x2a2ba2,null));};exports[_0x4bb2('0x26')]=function(_0x37b7d9,_0x4adc1c){if(_0x37b7d9[_0x4bb2('0x53')]['id']){delete _0x37b7d9[_0x4bb2('0x53')]['id'];}return db[_0x4bb2('0x34')][_0x4bb2('0x51')]({'where':{'id':_0x37b7d9[_0x4bb2('0x4f')]['id']}})[_0x4bb2('0x27')](handleEntityNotFound(_0x4adc1c,null))[_0x4bb2('0x27')](saveUpdates(_0x37b7d9[_0x4bb2('0x53')],null))['then'](respondWithResult(_0x4adc1c,null))[_0x4bb2('0x4d')](handleError(_0x4adc1c,null));};exports[_0x4bb2('0x28')]=function(_0x535f8d,_0x5475cd){return db[_0x4bb2('0x34')]['find']({'where':{'id':_0x535f8d[_0x4bb2('0x4f')]['id']}})[_0x4bb2('0x27')](handleEntityNotFound(_0x5475cd,null))[_0x4bb2('0x27')](removeEntity(_0x5475cd,null))['catch'](handleError(_0x5475cd,null));};exports[_0x4bb2('0x59')]=function(_0x2155eb,_0x4d94fe,_0x157433){return db[_0x4bb2('0x34')]['find']({'where':{'id':_0x2155eb[_0x4bb2('0x4f')]['id']},'attributes':['name','basename','savename',_0x4bb2('0x5a')],'raw':!![]})[_0x4bb2('0x27')](handleEntityNotFound(_0x4d94fe,null))['then'](function(_0x390ddf){if(_0x390ddf){if(!fs[_0x4bb2('0x5b')](path[_0x4bb2('0x5c')](config['root'],_0x4bb2('0x5d'),_0x390ddf['savename']))){throw new db[(_0x4bb2('0x5e'))][(_0x4bb2('0x5f'))](_0x4bb2('0x60'));}if(_0x2155eb[_0x4bb2('0x3c')][_0x4bb2('0x61')]){return _0x4d94fe['sendStatus'](0xc8);}return _0x4d94fe[_0x4bb2('0x59')](path[_0x4bb2('0x5c')](config['root'],_0x4bb2('0x5d'),_0x390ddf[_0x4bb2('0x62')]),util[_0x4bb2('0x63')](_0x4bb2('0x64'),_0x390ddf['basename']||_0x390ddf[_0x4bb2('0x30')],_0x390ddf['output'][_0x4bb2('0x65')]()));}})[_0x4bb2('0x4d')](handleError(_0x4d94fe,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 51c26aa..d2dfd27 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 _0x0959=['api','moment','bluebird','request-promise','path','rimraf','exports','define','analytics_extracted_reports','util','../../config/logger'];(function(_0x11f78f,_0xbe78fb){var _0x5cd7a7=function(_0x1c87a6){while(--_0x1c87a6){_0x11f78f['push'](_0x11f78f['shift']());}};_0x5cd7a7(++_0xbe78fb);}(_0x0959,0x11c));var _0x9095=function(_0x2c0a62,_0x45d0b9){_0x2c0a62=_0x2c0a62-0x0;var _0x1d6922=_0x0959[_0x2c0a62];return _0x1d6922;};'use strict';var _=require('lodash');var util=require(_0x9095('0x0'));var logger=require(_0x9095('0x1'))(_0x9095('0x2'));var moment=require(_0x9095('0x3'));var BPromise=require(_0x9095('0x4'));var rp=require(_0x9095('0x5'));var fs=require('fs');var path=require(_0x9095('0x6'));var rimraf=require(_0x9095('0x7'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0x9095('0x8')]=function(_0x362bd3,_0x4a7708){return _0x362bd3[_0x9095('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0x9095('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xad06=['api','moment','bluebird','path','rimraf','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','../../config/logger'];(function(_0x362046,_0x5cf93f){var _0x419ffe=function(_0x18cb42){while(--_0x18cb42){_0x362046['push'](_0x362046['shift']());}};_0x419ffe(++_0x5cf93f);}(_0xad06,0x155));var _0x6ad0=function(_0x42b72f,_0x326cc9){_0x42b72f=_0x42b72f-0x0;var _0x2fd490=_0xad06[_0x42b72f];return _0x2fd490;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6ad0('0x0'))(_0x6ad0('0x1'));var moment=require(_0x6ad0('0x2'));var BPromise=require(_0x6ad0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ad0('0x4'));var rimraf=require(_0x6ad0('0x5'));var config=require('../../config/environment');var attributes=require(_0x6ad0('0x6'));module['exports']=function(_0x22fb63,_0x2144b8){return _0x22fb63['define'](_0x6ad0('0x7'),attributes,{'tableName':_0x6ad0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index bdd8e7b..fffefeb 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 _0x0176=['jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/environment'];(function(_0x4d934b,_0x52f8e9){var _0xc0338b=function(_0x1a356c){while(--_0x1a356c){_0x4d934b['push'](_0x4d934b['shift']());}};_0xc0338b(++_0x52f8e9);}(_0x0176,0x14f));var _0x6017=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0176[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6017('0x0'));var util=require('util');var moment=require(_0x6017('0x1'));var BPromise=require('bluebird');var rs=require(_0x6017('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6017('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6017('0x4'));var jayson=require(_0x6017('0x5'));var client=jayson[_0x6017('0x6')][_0x6017('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e0e12,_0x26f6e7,_0x311051){return new BPromise(function(_0x47bd7d,_0x5935df){return client['request'](_0x4e0e12,_0x311051)[_0x6017('0x8')](function(_0x155a89){logger[_0x6017('0x9')](_0x6017('0xa'),_0x26f6e7,_0x6017('0xb'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x26f6e7,_0x6017('0xb'),JSON[_0x6017('0xc')](_0x155a89));if(_0x155a89[_0x6017('0xd')]){if(_0x155a89[_0x6017('0xd')][_0x6017('0xe')]===0x1f4){logger['error'](_0x6017('0xa'),_0x26f6e7,_0x155a89[_0x6017('0xd')][_0x6017('0xf')]);return _0x5935df(_0x155a89[_0x6017('0xd')][_0x6017('0xf')]);}logger['error'](_0x6017('0xa'),_0x26f6e7,_0x155a89['error'][_0x6017('0xf')]);return _0x47bd7d(_0x155a89[_0x6017('0xd')][_0x6017('0xf')]);}else{logger[_0x6017('0x9')](_0x6017('0xa'),_0x26f6e7,_0x6017('0xb'));_0x47bd7d(_0x155a89[_0x6017('0x10')][_0x6017('0xf')]);}})['catch'](function(_0x147ee9){logger[_0x6017('0xd')](_0x6017('0xa'),_0x26f6e7,_0x147ee9);_0x5935df(_0x147ee9);});});}
\ No newline at end of file
+var _0x0ac0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0ac0,0x130));var _0x00ac=function(_0x650e11,_0x284f86){_0x650e11=_0x650e11-0x0;var _0x1a9b47=_0x0ac0[_0x650e11];return _0x1a9b47;};'use strict';var _=require(_0x00ac('0x0'));var util=require(_0x00ac('0x1'));var moment=require(_0x00ac('0x2'));var BPromise=require('bluebird');var rs=require(_0x00ac('0x3'));var fs=require('fs');var Redis=require(_0x00ac('0x4'));var db=require(_0x00ac('0x5'))['db'];var utils=require(_0x00ac('0x6'));var logger=require(_0x00ac('0x7'))(_0x00ac('0x8'));var config=require(_0x00ac('0x9'));var jayson=require(_0x00ac('0xa'));var client=jayson['client'][_0x00ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa2a17e,_0x3546f0,_0x282faa){return new BPromise(function(_0x4427de,_0x121a9e){return client[_0x00ac('0xc')](_0xa2a17e,_0x282faa)['then'](function(_0x48c47e){logger[_0x00ac('0xd')](_0x00ac('0xe'),_0x3546f0,_0x00ac('0xf'));logger[_0x00ac('0x10')](_0x00ac('0x11'),_0x3546f0,'request\x20sent',JSON[_0x00ac('0x12')](_0x48c47e));if(_0x48c47e['error']){if(_0x48c47e[_0x00ac('0x13')]['code']===0x1f4){logger[_0x00ac('0x13')](_0x00ac('0xe'),_0x3546f0,_0x48c47e[_0x00ac('0x13')][_0x00ac('0x14')]);return _0x121a9e(_0x48c47e['error']['message']);}logger[_0x00ac('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3546f0,_0x48c47e['error'][_0x00ac('0x14')]);return _0x4427de(_0x48c47e[_0x00ac('0x13')]['message']);}else{logger[_0x00ac('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3546f0,'request\x20sent');_0x4427de(_0x48c47e[_0x00ac('0x15')][_0x00ac('0x14')]);}})['catch'](function(_0x66e4ba){logger[_0x00ac('0x13')](_0x00ac('0xe'),_0x3546f0,_0x66e4ba);_0x121a9e(_0x66e4ba);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index e2bd430..06e931e 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 _0x87a2=['util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','/:id/download','download','post','update','delete','destroy','exports'];(function(_0x5001b4,_0x362ed5){var _0x44ffa7=function(_0x3a0a8e){while(--_0x3a0a8e){_0x5001b4['push'](_0x5001b4['shift']());}};_0x44ffa7(++_0x362ed5);}(_0x87a2,0xea));var _0x287a=function(_0x183256,_0x1a596d){_0x183256=_0x183256-0x0;var _0x5394a2=_0x87a2[_0x183256];return _0x5394a2;};'use strict';var multer=require('multer');var util=require(_0x287a('0x0'));var path=require('path');var timeout=require(_0x287a('0x1'));var express=require(_0x287a('0x2'));var router=express['Router']();var fs_extra=require(_0x287a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x287a('0x4'));var config=require(_0x287a('0x5'));var controller=require(_0x287a('0x6'));router['get']('/',auth[_0x287a('0x7')](),controller[_0x287a('0x8')]);router[_0x287a('0x9')](_0x287a('0xa'),auth[_0x287a('0x7')](),controller['show']);router[_0x287a('0x9')](_0x287a('0xb'),auth[_0x287a('0x7')](),controller[_0x287a('0xc')]);router[_0x287a('0xd')]('/',auth[_0x287a('0x7')](),controller['create']);router['put'](_0x287a('0xa'),auth[_0x287a('0x7')](),controller[_0x287a('0xe')]);router[_0x287a('0xf')](_0x287a('0xa'),auth['isAuthenticated'](),controller[_0x287a('0x10')]);module[_0x287a('0x11')]=router;
\ No newline at end of file
+var _0x9959=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post'];(function(_0x5a14f3,_0x303051){var _0x57de5d=function(_0xfcb8c5){while(--_0xfcb8c5){_0x5a14f3['push'](_0x5a14f3['shift']());}};_0x57de5d(++_0x303051);}(_0x9959,0x108));var _0x9995=function(_0x1a2603,_0x43182e){_0x1a2603=_0x1a2603-0x0;var _0x10f23a=_0x9959[_0x1a2603];return _0x10f23a;};'use strict';var multer=require(_0x9995('0x0'));var util=require(_0x9995('0x1'));var path=require(_0x9995('0x2'));var timeout=require(_0x9995('0x3'));var express=require(_0x9995('0x4'));var router=express[_0x9995('0x5')]();var fs_extra=require(_0x9995('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9995('0x7'));var config=require('../../config/environment');var controller=require(_0x9995('0x8'));router[_0x9995('0x9')]('/',auth[_0x9995('0xa')](),controller[_0x9995('0xb')]);router[_0x9995('0x9')](_0x9995('0xc'),auth[_0x9995('0xa')](),controller['show']);router['get'](_0x9995('0xd'),auth[_0x9995('0xa')](),controller[_0x9995('0xe')]);router[_0x9995('0xf')]('/',auth[_0x9995('0xa')](),controller['create']);router[_0x9995('0x10')](_0x9995('0xc'),auth[_0x9995('0xa')](),controller[_0x9995('0x11')]);router[_0x9995('0x12')](_0x9995('0xc'),auth[_0x9995('0xa')](),controller['destroy']);module[_0x9995('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 6ddd46d..0884119 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 _0x8741=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x294cf1,_0x5d6a40){var _0x334402=function(_0x5b07f0){while(--_0x5b07f0){_0x294cf1['push'](_0x294cf1['shift']());}};_0x334402(++_0x5d6a40);}(_0x8741,0x145));var _0x1874=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8741[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1874('0x0'));module[_0x1874('0x1')]={'field':{'type':Sequelize[_0x1874('0x2')]},'alias':{'type':Sequelize[_0x1874('0x3')]},'function':{'type':Sequelize[_0x1874('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x1874('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1874('0x3')]},'custom':{'type':Sequelize[_0x1874('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xa3cf=['TEXT','STRING','BOOLEAN'];(function(_0x3978e9,_0x202fbf){var _0x4c6581=function(_0x5016d1){while(--_0x5016d1){_0x3978e9['push'](_0x3978e9['shift']());}};_0x4c6581(++_0x202fbf);}(_0xa3cf,0xab));var _0xfa3c=function(_0x412163,_0x26445b){_0x412163=_0x412163-0x0;var _0x25cee9=_0xa3cf[_0x412163];return _0x25cee9;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize[_0xfa3c('0x0')]},'alias':{'type':Sequelize[_0xfa3c('0x1')]},'function':{'type':Sequelize[_0xfa3c('0x1')]},'format':{'type':Sequelize[_0xfa3c('0x1')]},'groupBy':{'type':Sequelize[_0xfa3c('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xfa3c('0x1')]},'custom':{'type':Sequelize[_0xfa3c('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index de2a043..743c875 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 _0x8b86=['bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','zip-dir','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','AnalyticFieldReport','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkCreate'];(function(_0x2daa0f,_0x55d9a7){var _0x54c30a=function(_0x4c29f7){while(--_0x4c29f7){_0x2daa0f['push'](_0x2daa0f['shift']());}};_0x54c30a(++_0x55d9a7);}(_0x8b86,0x140));var _0x68b8=function(_0x515f8e,_0x4aef2c){_0x515f8e=_0x515f8e-0x0;var _0x5553cd=_0x8b86[_0x515f8e];return _0x5553cd;};'use strict';var emlformat=require(_0x68b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x68b8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x68b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x68b8('0x3'));var util=require(_0x68b8('0x4'));var path=require(_0x68b8('0x5'));var sox=require(_0x68b8('0x6'));var csv=require('to-csv');var ejs=require(_0x68b8('0x7'));var fs=require('fs');var fs_extra=require(_0x68b8('0x8'));var _=require(_0x68b8('0x9'));var squel=require(_0x68b8('0xa'));var crypto=require(_0x68b8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x68b8('0xc'));var querystring=require(_0x68b8('0xd'));var Papa=require(_0x68b8('0xe'));var Redis=require('ioredis');var authService=require(_0x68b8('0xf'));var qs=require(_0x68b8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68b8('0x11'));var logger=require('../../config/logger')(_0x68b8('0x12'));var utils=require('../../config/utils');var config=require(_0x68b8('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2674b3,_0x316138){_0x316138=_0x316138||0xcc;return function(_0x22e25b){if(_0x22e25b){return _0x2674b3['sendStatus'](_0x316138);}return _0x2674b3[_0x68b8('0x14')](_0x316138)[_0x68b8('0x15')]();};}function respondWithResult(_0x4ae1cb,_0x29b876){_0x29b876=_0x29b876||0xc8;return function(_0x348adc){if(_0x348adc){return _0x4ae1cb['status'](_0x29b876)[_0x68b8('0x16')](_0x348adc);}};}function respondWithFilteredResult(_0x228545,_0xb53a03){return function(_0x2a5171){if(_0x2a5171){var _0x54433e=typeof _0xb53a03['offset']==='undefined'&&typeof _0xb53a03[_0x68b8('0x17')]===_0x68b8('0x18');var _0x49fd9d=_0x2a5171[_0x68b8('0x19')];var _0x3abc13=_0x54433e?0x0:_0xb53a03[_0x68b8('0x1a')];var _0x3ff8e0=_0x54433e?_0x2a5171['count']:_0xb53a03[_0x68b8('0x1a')]+_0xb53a03[_0x68b8('0x17')];var _0xca00b1;if(_0x3ff8e0>=_0x49fd9d){_0x3ff8e0=_0x49fd9d;_0xca00b1=0xc8;}else{_0xca00b1=0xce;}_0x228545[_0x68b8('0x14')](_0xca00b1);return _0x228545['set'](_0x68b8('0x1b'),_0x3abc13+'-'+_0x3ff8e0+'/'+_0x49fd9d)[_0x68b8('0x16')](_0x2a5171);}return null;};}function patchUpdates(_0x1583ea){return function(_0x270727){try{jsonpatch[_0x68b8('0x1c')](_0x270727,_0x1583ea,!![]);}catch(_0x4c6a0e){return BPromise['reject'](_0x4c6a0e);}return _0x270727[_0x68b8('0x1d')]();};}function saveUpdates(_0x49977a,_0x4a162b){return function(_0x317c65){if(_0x317c65){return _0x317c65[_0x68b8('0x1e')](_0x49977a)[_0x68b8('0x1f')](function(_0x131905){return _0x131905;});}return null;};}function removeEntity(_0xcba36e,_0x1e4802){return function(_0x1f4291){if(_0x1f4291){return _0x1f4291['destroy']()[_0x68b8('0x1f')](function(){_0xcba36e[_0x68b8('0x14')](0xcc)[_0x68b8('0x15')]();});}};}function handleEntityNotFound(_0x8d41d2,_0x23e7de){return function(_0x1e9498){if(!_0x1e9498){_0x8d41d2[_0x68b8('0x20')](0x194);}return _0x1e9498;};}function handleError(_0x32fe5f,_0x25f41d){_0x25f41d=_0x25f41d||0x1f4;return function(_0x4d0f93){logger[_0x68b8('0x21')](_0x4d0f93[_0x68b8('0x22')]);if(_0x4d0f93[_0x68b8('0x23')]){delete _0x4d0f93[_0x68b8('0x23')];}_0x32fe5f[_0x68b8('0x14')](_0x25f41d)[_0x68b8('0x24')](_0x4d0f93);};}exports['index']=function(_0x316441,_0x8c71f9){var _0x2bb59c={},_0x256fee={},_0x332ac6={'count':0x0,'rows':[]};var _0x6b779a=_['map'](db[_0x68b8('0x25')]['rawAttributes'],function(_0x1b7855){return{'name':_0x1b7855[_0x68b8('0x26')],'type':_0x1b7855[_0x68b8('0x27')][_0x68b8('0x28')]};});_0x256fee['model']=_[_0x68b8('0x29')](_0x6b779a,_0x68b8('0x23'));_0x256fee[_0x68b8('0x2a')]=_[_0x68b8('0x2b')](_0x316441['query']);_0x256fee[_0x68b8('0x2c')]=_[_0x68b8('0x2d')](_0x256fee[_0x68b8('0x2e')],_0x256fee[_0x68b8('0x2a')]);_0x2bb59c[_0x68b8('0x2f')]=_[_0x68b8('0x2d')](_0x256fee['model'],qs[_0x68b8('0x30')](_0x316441['query'][_0x68b8('0x30')]));_0x2bb59c[_0x68b8('0x2f')]=_0x2bb59c[_0x68b8('0x2f')][_0x68b8('0x31')]?_0x2bb59c[_0x68b8('0x2f')]:_0x256fee[_0x68b8('0x2e')];if(!_0x316441[_0x68b8('0x2a')][_0x68b8('0x32')](_0x68b8('0x33'))){_0x2bb59c['limit']=qs['limit'](_0x316441[_0x68b8('0x2a')][_0x68b8('0x17')]);_0x2bb59c[_0x68b8('0x1a')]=qs[_0x68b8('0x1a')](_0x316441['query'][_0x68b8('0x1a')]);}_0x2bb59c[_0x68b8('0x34')]=qs[_0x68b8('0x35')](_0x316441[_0x68b8('0x2a')][_0x68b8('0x35')]);_0x2bb59c[_0x68b8('0x36')]=qs[_0x68b8('0x2c')](_[_0x68b8('0x37')](_0x316441[_0x68b8('0x2a')],_0x256fee[_0x68b8('0x2c')]),_0x6b779a);if(_0x316441[_0x68b8('0x2a')]['filter']){_0x2bb59c[_0x68b8('0x36')]=_[_0x68b8('0x38')](_0x2bb59c[_0x68b8('0x36')],{'$or':_[_0x68b8('0x29')](_0x6b779a,function(_0xbee65e){if(_0xbee65e['type']!==_0x68b8('0x39')){var _0x34409e={};_0x34409e[_0xbee65e['name']]={'$like':'%'+_0x316441[_0x68b8('0x2a')]['filter']+'%'};return _0x34409e;}})});}_0x2bb59c=_[_0x68b8('0x38')]({},_0x2bb59c,_0x316441[_0x68b8('0x3a')]);var _0x1c5b9c={'where':_0x2bb59c[_0x68b8('0x36')]};return db[_0x68b8('0x25')]['count'](_0x1c5b9c)['then'](function(_0x29fefc){_0x332ac6[_0x68b8('0x19')]=_0x29fefc;if(_0x316441['query'][_0x68b8('0x3b')]){_0x2bb59c[_0x68b8('0x3c')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x68b8('0x3d')](_0x2bb59c);})['then'](function(_0x40698c){_0x332ac6[_0x68b8('0x3e')]=_0x40698c;return _0x332ac6;})['then'](respondWithFilteredResult(_0x8c71f9,_0x2bb59c))[_0x68b8('0x3f')](handleError(_0x8c71f9,null));};exports[_0x68b8('0x40')]=function(_0xe80897,_0x1aac17){var _0x5f4252={'raw':![],'where':{'id':_0xe80897[_0x68b8('0x41')]['id']}},_0xe27123={};_0xe27123['model']=_[_0x68b8('0x2b')](db[_0x68b8('0x25')]['rawAttributes']);_0xe27123[_0x68b8('0x2a')]=_[_0x68b8('0x2b')](_0xe80897[_0x68b8('0x2a')]);_0xe27123[_0x68b8('0x2c')]=_[_0x68b8('0x2d')](_0xe27123[_0x68b8('0x2e')],_0xe27123[_0x68b8('0x2a')]);_0x5f4252[_0x68b8('0x2f')]=_[_0x68b8('0x2d')](_0xe27123[_0x68b8('0x2e')],qs[_0x68b8('0x30')](_0xe80897[_0x68b8('0x2a')][_0x68b8('0x30')]));_0x5f4252[_0x68b8('0x2f')]=_0x5f4252['attributes'][_0x68b8('0x31')]?_0x5f4252[_0x68b8('0x2f')]:_0xe27123[_0x68b8('0x2e')];if(_0xe80897[_0x68b8('0x2a')]['includeAll']){_0x5f4252[_0x68b8('0x3c')]=[{'all':!![]}];}_0x5f4252=_[_0x68b8('0x38')]({},_0x5f4252,_0xe80897['options']);return db[_0x68b8('0x25')][_0x68b8('0x42')](_0x5f4252)[_0x68b8('0x1f')](handleEntityNotFound(_0x1aac17,null))[_0x68b8('0x1f')](respondWithResult(_0x1aac17,null))[_0x68b8('0x3f')](handleError(_0x1aac17,null));};exports[_0x68b8('0x43')]=function(_0x25d1d8,_0x36b66b){return db[_0x68b8('0x25')][_0x68b8('0x43')](_0x25d1d8[_0x68b8('0x44')],{})[_0x68b8('0x1f')](respondWithResult(_0x36b66b,0xc9))[_0x68b8('0x3f')](handleError(_0x36b66b,null));};exports[_0x68b8('0x45')]=function(_0x277315,_0x4ec60f){return db[_0x68b8('0x25')][_0x68b8('0x45')](_0x277315[_0x68b8('0x44')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4ec60f,0xc9))[_0x68b8('0x3f')](handleError(_0x4ec60f,null));};exports['update']=function(_0x5e9644,_0xaa81b6){if(_0x5e9644['body']['id']){delete _0x5e9644[_0x68b8('0x44')]['id'];}return db['AnalyticFieldReport'][_0x68b8('0x42')]({'where':{'id':_0x5e9644['params']['id']}})[_0x68b8('0x1f')](handleEntityNotFound(_0xaa81b6,null))[_0x68b8('0x1f')](saveUpdates(_0x5e9644[_0x68b8('0x44')],null))[_0x68b8('0x1f')](respondWithResult(_0xaa81b6,null))[_0x68b8('0x3f')](handleError(_0xaa81b6,null));};exports['destroy']=function(_0x205135,_0xba471d){return db[_0x68b8('0x25')][_0x68b8('0x42')]({'where':{'id':_0x205135['params']['id']}})[_0x68b8('0x1f')](handleEntityNotFound(_0xba471d,null))[_0x68b8('0x1f')](removeEntity(_0xba471d,null))[_0x68b8('0x3f')](handleError(_0xba471d,null));};exports[_0x68b8('0x46')]=function(_0xb98765,_0x3498ce){return db[_0x68b8('0x25')][_0x68b8('0x47')]({'where':{'id':_0xb98765['query'][_0x68b8('0x48')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3498ce,0xcc))[_0x68b8('0x3f')](handleError(_0x3498ce,null));};exports[_0x68b8('0x49')]=function(_0x3e95a5,_0xd42b22,_0x1f289a){return db[_0x68b8('0x4a')]['findOne']({'where':{'id':_0x3e95a5[_0x68b8('0x41')]['id']}})[_0x68b8('0x1f')](handleEntityNotFound(_0xd42b22,null))['then'](function(_0x55917d){if(_0x55917d){return db[_0x68b8('0x4b')][_0x68b8('0x4c')](function(_0x53e40b){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x3e95a5[_0x68b8('0x41')]['id']},'transaction':_0x53e40b})[_0x68b8('0x1f')](function(_0xd54b89){var _0x61a72d=_[_0x68b8('0x29')](_0x3e95a5[_0x68b8('0x44')],function(_0x5c8674){delete _0x5c8674['id'];_0x5c8674[_0x68b8('0x4d')]=_0x3e95a5[_0x68b8('0x41')]['id'];return _0x5c8674;});return db[_0x68b8('0x25')][_0x68b8('0x45')](_0x61a72d,{'transaction':_0x53e40b});});})[_0x68b8('0x1f')](function(){return db[_0x68b8('0x25')]['findAll']({'where':{'CustomReportId':_0x3e95a5[_0x68b8('0x41')]['id']}});});}})[_0x68b8('0x1f')](respondWithResult(_0xd42b22,null))[_0x68b8('0x3f')](handleError(_0xd42b22,null));};
\ No newline at end of file
+var _0x577d=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','reject','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkCreate','update','bulkDestroy','destroy','AnalyticCustomReport','findOne','sequelize','transaction','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x485201,_0x3c533a){var _0x9ca98a=function(_0x418ef0){while(--_0x418ef0){_0x485201['push'](_0x485201['shift']());}};_0x9ca98a(++_0x3c533a);}(_0x577d,0xe1));var _0xd577=function(_0x3c7f07,_0x1e7d35){_0x3c7f07=_0x3c7f07-0x0;var _0x3788dc=_0x577d[_0x3c7f07];return _0x3788dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd577('0x0'));var zipdir=require(_0xd577('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd577('0x2'));var moment=require(_0xd577('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd577('0x4'));var util=require(_0xd577('0x5'));var path=require(_0xd577('0x6'));var sox=require(_0xd577('0x7'));var csv=require(_0xd577('0x8'));var ejs=require(_0xd577('0x9'));var fs=require('fs');var fs_extra=require(_0xd577('0xa'));var _=require(_0xd577('0xb'));var squel=require(_0xd577('0xc'));var crypto=require('crypto');var jsforce=require(_0xd577('0xd'));var deskjs=require(_0xd577('0xe'));var toCsv=require(_0xd577('0x8'));var querystring=require(_0xd577('0xf'));var Papa=require(_0xd577('0x10'));var Redis=require(_0xd577('0x11'));var authService=require(_0xd577('0x12'));var qs=require(_0xd577('0x13'));var as=require(_0xd577('0x14'));var hardwareService=require(_0xd577('0x15'));var logger=require('../../config/logger')(_0xd577('0x16'));var utils=require(_0xd577('0x17'));var config=require(_0xd577('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd577('0x19'))['db'];function respondWithStatusCode(_0x5972a8,_0x5c602b){_0x5c602b=_0x5c602b||0xcc;return function(_0x46466){if(_0x46466){return _0x5972a8[_0xd577('0x1a')](_0x5c602b);}return _0x5972a8['status'](_0x5c602b)[_0xd577('0x1b')]();};}function respondWithResult(_0x4d6920,_0x16bbbe){_0x16bbbe=_0x16bbbe||0xc8;return function(_0x27812b){if(_0x27812b){return _0x4d6920[_0xd577('0x1c')](_0x16bbbe)[_0xd577('0x1d')](_0x27812b);}};}function respondWithFilteredResult(_0x117a45,_0x5c3175){return function(_0x514246){if(_0x514246){var _0x432210=typeof _0x5c3175[_0xd577('0x1e')]===_0xd577('0x1f')&&typeof _0x5c3175[_0xd577('0x20')]==='undefined';var _0x3d6b12=_0x514246['count'];var _0x3f588c=_0x432210?0x0:_0x5c3175[_0xd577('0x1e')];var _0x4ce98f=_0x432210?_0x514246[_0xd577('0x21')]:_0x5c3175['offset']+_0x5c3175[_0xd577('0x20')];var _0x43e37f;if(_0x4ce98f>=_0x3d6b12){_0x4ce98f=_0x3d6b12;_0x43e37f=0xc8;}else{_0x43e37f=0xce;}_0x117a45[_0xd577('0x1c')](_0x43e37f);return _0x117a45['set']('Content-Range',_0x3f588c+'-'+_0x4ce98f+'/'+_0x3d6b12)[_0xd577('0x1d')](_0x514246);}return null;};}function patchUpdates(_0x3b1595){return function(_0x4c329a){try{jsonpatch['apply'](_0x4c329a,_0x3b1595,!![]);}catch(_0x2a16c2){return BPromise[_0xd577('0x22')](_0x2a16c2);}return _0x4c329a['save']();};}function saveUpdates(_0x38fb31,_0x1c86b2){return function(_0x2bad8e){if(_0x2bad8e){return _0x2bad8e['update'](_0x38fb31)[_0xd577('0x23')](function(_0x309b68){return _0x309b68;});}return null;};}function removeEntity(_0x52bc84,_0x3a5a90){return function(_0x344455){if(_0x344455){return _0x344455['destroy']()[_0xd577('0x23')](function(){_0x52bc84['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f92a2,_0xe87406){return function(_0xddbb){if(!_0xddbb){_0x3f92a2['sendStatus'](0x194);}return _0xddbb;};}function handleError(_0x2c7a75,_0x4539f1){_0x4539f1=_0x4539f1||0x1f4;return function(_0x1e2cad){logger[_0xd577('0x24')](_0x1e2cad[_0xd577('0x25')]);if(_0x1e2cad[_0xd577('0x26')]){delete _0x1e2cad[_0xd577('0x26')];}_0x2c7a75[_0xd577('0x1c')](_0x4539f1)[_0xd577('0x27')](_0x1e2cad);};}exports[_0xd577('0x28')]=function(_0x23cc73,_0x2be5c7){var _0x1f67c4={},_0x5c972c={},_0x3cd0d5={'count':0x0,'rows':[]};var _0x330d27=_[_0xd577('0x29')](db[_0xd577('0x2a')][_0xd577('0x2b')],function(_0xfe5635){return{'name':_0xfe5635[_0xd577('0x2c')],'type':_0xfe5635[_0xd577('0x2d')]['key']};});_0x5c972c['model']=_['map'](_0x330d27,_0xd577('0x26'));_0x5c972c[_0xd577('0x2e')]=_[_0xd577('0x2f')](_0x23cc73[_0xd577('0x2e')]);_0x5c972c[_0xd577('0x30')]=_[_0xd577('0x31')](_0x5c972c['model'],_0x5c972c[_0xd577('0x2e')]);_0x1f67c4[_0xd577('0x32')]=_['intersection'](_0x5c972c[_0xd577('0x33')],qs[_0xd577('0x34')](_0x23cc73['query'][_0xd577('0x34')]));_0x1f67c4[_0xd577('0x32')]=_0x1f67c4[_0xd577('0x32')][_0xd577('0x35')]?_0x1f67c4[_0xd577('0x32')]:_0x5c972c[_0xd577('0x33')];if(!_0x23cc73[_0xd577('0x2e')][_0xd577('0x36')](_0xd577('0x37'))){_0x1f67c4[_0xd577('0x20')]=qs['limit'](_0x23cc73['query']['limit']);_0x1f67c4[_0xd577('0x1e')]=qs[_0xd577('0x1e')](_0x23cc73[_0xd577('0x2e')][_0xd577('0x1e')]);}_0x1f67c4[_0xd577('0x38')]=qs['sort'](_0x23cc73[_0xd577('0x2e')][_0xd577('0x39')]);_0x1f67c4[_0xd577('0x3a')]=qs[_0xd577('0x30')](_['pick'](_0x23cc73[_0xd577('0x2e')],_0x5c972c['filters']),_0x330d27);if(_0x23cc73[_0xd577('0x2e')]['filter']){_0x1f67c4[_0xd577('0x3a')]=_[_0xd577('0x3b')](_0x1f67c4[_0xd577('0x3a')],{'$or':_[_0xd577('0x29')](_0x330d27,function(_0x20e44f){if(_0x20e44f['type']!==_0xd577('0x3c')){var _0x5a46ab={};_0x5a46ab[_0x20e44f['name']]={'$like':'%'+_0x23cc73[_0xd577('0x2e')][_0xd577('0x3d')]+'%'};return _0x5a46ab;}})});}_0x1f67c4=_['merge']({},_0x1f67c4,_0x23cc73[_0xd577('0x3e')]);var _0x75a60a={'where':_0x1f67c4[_0xd577('0x3a')]};return db[_0xd577('0x2a')]['count'](_0x75a60a)[_0xd577('0x23')](function(_0x30b979){_0x3cd0d5[_0xd577('0x21')]=_0x30b979;if(_0x23cc73[_0xd577('0x2e')][_0xd577('0x3f')]){_0x1f67c4[_0xd577('0x40')]=[{'all':!![]}];}return db[_0xd577('0x2a')][_0xd577('0x41')](_0x1f67c4);})['then'](function(_0x5f1bdc){_0x3cd0d5[_0xd577('0x42')]=_0x5f1bdc;return _0x3cd0d5;})[_0xd577('0x23')](respondWithFilteredResult(_0x2be5c7,_0x1f67c4))[_0xd577('0x43')](handleError(_0x2be5c7,null));};exports[_0xd577('0x44')]=function(_0x4e8839,_0x490ed4){var _0x3cbda2={'raw':![],'where':{'id':_0x4e8839[_0xd577('0x45')]['id']}},_0x22ea7d={};_0x22ea7d[_0xd577('0x33')]=_[_0xd577('0x2f')](db[_0xd577('0x2a')]['rawAttributes']);_0x22ea7d[_0xd577('0x2e')]=_[_0xd577('0x2f')](_0x4e8839[_0xd577('0x2e')]);_0x22ea7d[_0xd577('0x30')]=_['intersection'](_0x22ea7d[_0xd577('0x33')],_0x22ea7d[_0xd577('0x2e')]);_0x3cbda2[_0xd577('0x32')]=_['intersection'](_0x22ea7d[_0xd577('0x33')],qs[_0xd577('0x34')](_0x4e8839[_0xd577('0x2e')]['fields']));_0x3cbda2['attributes']=_0x3cbda2[_0xd577('0x32')][_0xd577('0x35')]?_0x3cbda2[_0xd577('0x32')]:_0x22ea7d[_0xd577('0x33')];if(_0x4e8839['query']['includeAll']){_0x3cbda2[_0xd577('0x40')]=[{'all':!![]}];}_0x3cbda2=_['merge']({},_0x3cbda2,_0x4e8839[_0xd577('0x3e')]);return db[_0xd577('0x2a')][_0xd577('0x46')](_0x3cbda2)[_0xd577('0x23')](handleEntityNotFound(_0x490ed4,null))['then'](respondWithResult(_0x490ed4,null))['catch'](handleError(_0x490ed4,null));};exports[_0xd577('0x47')]=function(_0x21d6ba,_0x2c17dd){return db['AnalyticFieldReport']['create'](_0x21d6ba[_0xd577('0x48')],{})['then'](respondWithResult(_0x2c17dd,0xc9))['catch'](handleError(_0x2c17dd,null));};exports[_0xd577('0x49')]=function(_0x5bf5f7,_0x467aa4){return db[_0xd577('0x2a')][_0xd577('0x49')](_0x5bf5f7[_0xd577('0x48')],{'raw':![],'individualHooks':!![]})[_0xd577('0x23')](respondWithResult(_0x467aa4,0xc9))[_0xd577('0x43')](handleError(_0x467aa4,null));};exports[_0xd577('0x4a')]=function(_0x4d0689,_0x3b4ed2){if(_0x4d0689[_0xd577('0x48')]['id']){delete _0x4d0689['body']['id'];}return db[_0xd577('0x2a')][_0xd577('0x46')]({'where':{'id':_0x4d0689[_0xd577('0x45')]['id']}})[_0xd577('0x23')](handleEntityNotFound(_0x3b4ed2,null))[_0xd577('0x23')](saveUpdates(_0x4d0689['body'],null))['then'](respondWithResult(_0x3b4ed2,null))[_0xd577('0x43')](handleError(_0x3b4ed2,null));};exports['destroy']=function(_0x2ec923,_0x12e7fd){return db['AnalyticFieldReport']['find']({'where':{'id':_0x2ec923[_0xd577('0x45')]['id']}})[_0xd577('0x23')](handleEntityNotFound(_0x12e7fd,null))[_0xd577('0x23')](removeEntity(_0x12e7fd,null))[_0xd577('0x43')](handleError(_0x12e7fd,null));};exports[_0xd577('0x4b')]=function(_0x2d8ba1,_0x577bf1){return db['AnalyticFieldReport'][_0xd577('0x4c')]({'where':{'id':_0x2d8ba1['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x577bf1,0xcc))[_0xd577('0x43')](handleError(_0x577bf1,null));};exports['addFields']=function(_0x5e1475,_0x878715,_0x41dec2){return db[_0xd577('0x4d')][_0xd577('0x4e')]({'where':{'id':_0x5e1475[_0xd577('0x45')]['id']}})['then'](handleEntityNotFound(_0x878715,null))['then'](function(_0x403324){if(_0x403324){return db[_0xd577('0x4f')][_0xd577('0x50')](function(_0x42fe39){return db[_0xd577('0x2a')]['destroy']({'where':{'CustomReportId':_0x5e1475['params']['id']},'transaction':_0x42fe39})[_0xd577('0x23')](function(_0x42d3db){var _0x23baa1=_['map'](_0x5e1475[_0xd577('0x48')],function(_0x8f0d3e){delete _0x8f0d3e['id'];_0x8f0d3e['CustomReportId']=_0x5e1475[_0xd577('0x45')]['id'];return _0x8f0d3e;});return db[_0xd577('0x2a')][_0xd577('0x49')](_0x23baa1,{'transaction':_0x42fe39});});})[_0xd577('0x23')](function(){return db[_0xd577('0x2a')][_0xd577('0x41')]({'where':{'CustomReportId':_0x5e1475[_0xd577('0x45')]['id']}});});}})['then'](respondWithResult(_0x878715,null))['catch'](handleError(_0x878715,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index da27a11..dbd0bab 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 _0xf76c=['api','moment','bluebird','path','rimraf','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger'];(function(_0x255036,_0xf94145){var _0x3c4c56=function(_0x50a35c){while(--_0x50a35c){_0x255036['push'](_0x255036['shift']());}};_0x3c4c56(++_0xf94145);}(_0xf76c,0x1d7));var _0xcf76=function(_0x159f8e,_0x258d08){_0x159f8e=_0x159f8e-0x0;var _0x458e17=_0xf76c[_0x159f8e];return _0x458e17;};'use strict';var _=require('lodash');var util=require(_0xcf76('0x0'));var logger=require(_0xcf76('0x1'))(_0xcf76('0x2'));var moment=require(_0xcf76('0x3'));var BPromise=require(_0xcf76('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf76('0x5'));var rimraf=require(_0xcf76('0x6'));var config=require('../../config/environment');var attributes=require(_0xcf76('0x7'));module['exports']=function(_0x4f70f7,_0x3e34dd){return _0x4f70f7[_0xcf76('0x8')](_0xcf76('0x9'),attributes,{'tableName':_0xcf76('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7835=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','lodash','util','../../config/logger','api'];(function(_0x3d4518,_0x34ecbc){var _0x199aaf=function(_0x7e4f73){while(--_0x7e4f73){_0x3d4518['push'](_0x3d4518['shift']());}};_0x199aaf(++_0x34ecbc);}(_0x7835,0x128));var _0x5783=function(_0x4bf140,_0x254476){_0x4bf140=_0x4bf140-0x0;var _0x3ce70c=_0x7835[_0x4bf140];return _0x3ce70c;};'use strict';var _=require(_0x5783('0x0'));var util=require(_0x5783('0x1'));var logger=require(_0x5783('0x2'))(_0x5783('0x3'));var moment=require(_0x5783('0x4'));var BPromise=require(_0x5783('0x5'));var rp=require(_0x5783('0x6'));var fs=require('fs');var path=require(_0x5783('0x7'));var rimraf=require(_0x5783('0x8'));var config=require(_0x5783('0x9'));var attributes=require(_0x5783('0xa'));module['exports']=function(_0x1685e9,_0x2cd0e3){return _0x1685e9[_0x5783('0xb')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','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 92c2d10..69894b8 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 _0x9192=['AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x26b5ff,_0x92009a){var _0x58603e=function(_0x4454ff){while(--_0x4454ff){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x58603e(++_0x92009a);}(_0x9192,0x1a7));var _0x2919=function(_0x5a4c93,_0x283aa8){_0x5a4c93=_0x5a4c93-0x0;var _0x421ff4=_0x9192[_0x5a4c93];return _0x421ff4;};'use strict';var _=require(_0x2919('0x0'));var util=require(_0x2919('0x1'));var moment=require(_0x2919('0x2'));var BPromise=require(_0x2919('0x3'));var rs=require(_0x2919('0x4'));var fs=require('fs');var Redis=require(_0x2919('0x5'));var db=require(_0x2919('0x6'))['db'];var utils=require(_0x2919('0x7'));var logger=require('../../config/logger')(_0x2919('0x8'));var config=require('../../config/environment');var jayson=require(_0x2919('0x9'));var client=jayson[_0x2919('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f964a,_0x44a748,_0x157585){return new BPromise(function(_0x1e44c7,_0x160fb8){return client[_0x2919('0xb')](_0x3f964a,_0x157585)['then'](function(_0x30c549){logger[_0x2919('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44a748,_0x2919('0xd'));logger['debug'](_0x2919('0xe'),_0x44a748,'request\x20sent',JSON[_0x2919('0xf')](_0x30c549));if(_0x30c549[_0x2919('0x10')]){if(_0x30c549[_0x2919('0x10')]['code']===0x1f4){logger[_0x2919('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44a748,_0x30c549['error'][_0x2919('0x11')]);return _0x160fb8(_0x30c549[_0x2919('0x10')][_0x2919('0x11')]);}logger[_0x2919('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44a748,_0x30c549[_0x2919('0x10')][_0x2919('0x11')]);return _0x1e44c7(_0x30c549[_0x2919('0x10')][_0x2919('0x11')]);}else{logger[_0x2919('0xc')](_0x2919('0x12'),_0x44a748,_0x2919('0xd'));_0x1e44c7(_0x30c549[_0x2919('0x13')][_0x2919('0x11')]);}})[_0x2919('0x14')](function(_0x10438d){logger[_0x2919('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44a748,_0x10438d);_0x160fb8(_0x10438d);});});}
\ No newline at end of file
+var _0x8139=['then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0xac8470,_0x3e40e6){var _0x41696d=function(_0x435645){while(--_0x435645){_0xac8470['push'](_0xac8470['shift']());}};_0x41696d(++_0x3e40e6);}(_0x8139,0x113));var _0x9813=function(_0x12b8fc,_0x4deb28){_0x12b8fc=_0x12b8fc-0x0;var _0xa6c4c4=_0x8139[_0x12b8fc];return _0xa6c4c4;};'use strict';var _=require(_0x9813('0x0'));var util=require(_0x9813('0x1'));var moment=require(_0x9813('0x2'));var BPromise=require(_0x9813('0x3'));var rs=require(_0x9813('0x4'));var fs=require('fs');var Redis=require(_0x9813('0x5'));var db=require(_0x9813('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9813('0x7'))(_0x9813('0x8'));var config=require(_0x9813('0x9'));var jayson=require(_0x9813('0xa'));var client=jayson['client'][_0x9813('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x122c32,_0x36bb3d,_0x57747f){return new BPromise(function(_0x37481b,_0x445bd7){return client[_0x9813('0xc')](_0x122c32,_0x57747f)[_0x9813('0xd')](function(_0x7c23e3){logger['info'](_0x9813('0xe'),_0x36bb3d,_0x9813('0xf'));logger['debug'](_0x9813('0x10'),_0x36bb3d,_0x9813('0xf'),JSON[_0x9813('0x11')](_0x7c23e3));if(_0x7c23e3[_0x9813('0x12')]){if(_0x7c23e3[_0x9813('0x12')][_0x9813('0x13')]===0x1f4){logger[_0x9813('0x12')](_0x9813('0xe'),_0x36bb3d,_0x7c23e3[_0x9813('0x12')]['message']);return _0x445bd7(_0x7c23e3[_0x9813('0x12')]['message']);}logger[_0x9813('0x12')](_0x9813('0xe'),_0x36bb3d,_0x7c23e3[_0x9813('0x12')][_0x9813('0x14')]);return _0x37481b(_0x7c23e3[_0x9813('0x12')][_0x9813('0x14')]);}else{logger[_0x9813('0x15')](_0x9813('0xe'),_0x36bb3d,_0x9813('0xf'));_0x37481b(_0x7c23e3[_0x9813('0x16')][_0x9813('0x14')]);}})[_0x9813('0x17')](function(_0x189c39){logger['error'](_0x9813('0xe'),_0x36bb3d,_0x189c39);_0x445bd7(_0x189c39);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index ade5e7e..9b91dcd 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(_0x782825,_0x586c89){var _0x3630e2=function(_0x567f92){while(--_0x567f92){_0x782825['push'](_0x782825['shift']());}};_0x3630e2(++_0x586c89);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0x2918fb,_0x1ac725){var _0xef01f8=function(_0xd97c6){while(--_0xd97c6){_0x2918fb['push'](_0x2918fb['shift']());}};_0xef01f8(++_0x1ac725);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 4f40ca7..4093ed9 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 _0xee5b=['sequelize','STRING','name','TEXT'];(function(_0x18e333,_0x1caf42){var _0x41c26e=function(_0x3e3606){while(--_0x3e3606){_0x18e333['push'](_0x18e333['shift']());}};_0x41c26e(++_0x1caf42);}(_0xee5b,0x1f4));var _0xbee5=function(_0x3830df,_0x4c4f05){_0x3830df=_0x3830df-0x0;var _0x451da5=_0xee5b[_0x3830df];return _0x451da5;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'name':{'type':Sequelize[_0xbee5('0x1')],'allowNull':![],'unique':_0xbee5('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xbee5('0x3')]},'description':{'type':Sequelize[_0xbee5('0x1')]}};
\ No newline at end of file
+var _0xd624=['name','sequelize','exports'];(function(_0x48f79a,_0x3d329c){var _0x45bbd4=function(_0x25091e){while(--_0x25091e){_0x48f79a['push'](_0x48f79a['shift']());}};_0x45bbd4(++_0x3d329c);}(_0xd624,0x124));var _0x4d62=function(_0x127e58,_0x535a4d){_0x127e58=_0x127e58-0x0;var _0x5bd654=_0xd624[_0x127e58];return _0x5bd654;};'use strict';var Sequelize=require(_0x4d62('0x0'));module[_0x4d62('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4d62('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 0e1866a..0dd3126 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 _0x46ed=['where','pick','filter','merge','map','type','options','count','includeAll','include','findAll','rows','params','keys','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x3730ef,_0x15fdc6){var _0x151173=function(_0x499aa5){while(--_0x499aa5){_0x3730ef['push'](_0x3730ef['shift']());}};_0x151173(++_0x15fdc6);}(_0x46ed,0x168));var _0xd46e=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x46ed[_0x29d94e];return _0x106237;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];function respondWithStatusCode(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xcc;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0x1a')](_0x48550b);}return _0x5bc1da['status'](_0x48550b)['end']();};}function respondWithResult(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0xc8;return function(_0x1e9aae){if(_0x1e9aae){return _0xacd799[_0xd46e('0x1b')](_0x4688ae)['json'](_0x1e9aae);}};}function respondWithFilteredResult(_0x3b6d25,_0x44a620){return function(_0x417402){if(_0x417402){var _0x3d72ce=typeof _0x44a620[_0xd46e('0x1c')]==='undefined'&&typeof _0x44a620[_0xd46e('0x1d')]===_0xd46e('0x1e');var _0x3583a5=_0x417402['count'];var _0x5ddd04=_0x3d72ce?0x0:_0x44a620[_0xd46e('0x1c')];var _0x1bd574=_0x3d72ce?_0x417402['count']:_0x44a620['offset']+_0x44a620[_0xd46e('0x1d')];var _0x2f2571;if(_0x1bd574>=_0x3583a5){_0x1bd574=_0x3583a5;_0x2f2571=0xc8;}else{_0x2f2571=0xce;}_0x3b6d25[_0xd46e('0x1b')](_0x2f2571);return _0x3b6d25[_0xd46e('0x1f')](_0xd46e('0x20'),_0x5ddd04+'-'+_0x1bd574+'/'+_0x3583a5)[_0xd46e('0x21')](_0x417402);}return null;};}function patchUpdates(_0x3b5fa4){return function(_0x327b7e){try{jsonpatch[_0xd46e('0x22')](_0x327b7e,_0x3b5fa4,!![]);}catch(_0x3c7e91){return BPromise[_0xd46e('0x23')](_0x3c7e91);}return _0x327b7e['save']();};}function saveUpdates(_0x259072,_0x1c83fa){return function(_0x79aa51){if(_0x79aa51){return _0x79aa51[_0xd46e('0x24')](_0x259072)[_0xd46e('0x25')](function(_0xc1af7f){return _0xc1af7f;});}return null;};}function removeEntity(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(_0x62dea5){return _0x62dea5['destroy']()[_0xd46e('0x25')](function(){var _0x5424e5=_0x62dea5['get']({'plain':!![]});var _0x371054=_0xd46e('0x26');return db[_0xd46e('0x27')][_0xd46e('0x28')]({'where':{'type':_0x371054,'resourceId':_0x5424e5['id']}})[_0xd46e('0x25')](function(){return _0x62dea5;});})[_0xd46e('0x25')](function(){_0x33c2e0[_0xd46e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45d789,_0x3c301a){return function(_0xddbce9){if(!_0xddbce9){_0x45d789[_0xd46e('0x1a')](0x194);}return _0xddbce9;};}function handleError(_0x96f15c,_0x16e941){_0x16e941=_0x16e941||0x1f4;return function(_0x58aeef){logger[_0xd46e('0x29')](_0x58aeef[_0xd46e('0x2a')]);if(_0x58aeef[_0xd46e('0x2b')]){delete _0x58aeef[_0xd46e('0x2b')];}_0x96f15c[_0xd46e('0x1b')](_0x16e941)[_0xd46e('0x2c')](_0x58aeef);};}exports[_0xd46e('0x2d')]=function(_0x2c5ec7,_0x18f060){var _0x45ea47={},_0x2ff785={},_0x504324={'count':0x0,'rows':[]};var _0x2f4a1b=_['map'](db[_0xd46e('0x2e')][_0xd46e('0x2f')],function(_0x4f5718){return{'name':_0x4f5718[_0xd46e('0x30')],'type':_0x4f5718['type'][_0xd46e('0x31')]};});_0x2ff785[_0xd46e('0x32')]=_['map'](_0x2f4a1b,_0xd46e('0x2b'));_0x2ff785[_0xd46e('0x33')]=_['keys'](_0x2c5ec7[_0xd46e('0x33')]);_0x2ff785[_0xd46e('0x34')]=_[_0xd46e('0x35')](_0x2ff785['model'],_0x2ff785['query']);_0x45ea47[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x2ff785[_0xd46e('0x32')],qs[_0xd46e('0x37')](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x37')]));_0x45ea47[_0xd46e('0x36')]=_0x45ea47[_0xd46e('0x36')]['length']?_0x45ea47[_0xd46e('0x36')]:_0x2ff785[_0xd46e('0x32')];if(!_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x38')](_0xd46e('0x39'))){_0x45ea47[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x2c5ec7['query'][_0xd46e('0x1d')]);_0x45ea47[_0xd46e('0x1c')]=qs['offset'](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x1c')]);}_0x45ea47[_0xd46e('0x3a')]=qs[_0xd46e('0x3b')](_0x2c5ec7['query'][_0xd46e('0x3b')]);_0x45ea47[_0xd46e('0x3c')]=qs[_0xd46e('0x34')](_[_0xd46e('0x3d')](_0x2c5ec7[_0xd46e('0x33')],_0x2ff785[_0xd46e('0x34')]),_0x2f4a1b);if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x3e')]){_0x45ea47['where']=_[_0xd46e('0x3f')](_0x45ea47[_0xd46e('0x3c')],{'$or':_[_0xd46e('0x40')](_0x2f4a1b,function(_0x25657a){if(_0x25657a[_0xd46e('0x41')]!=='VIRTUAL'){var _0x964c66={};_0x964c66[_0x25657a['name']]={'$like':'%'+_0x2c5ec7['query']['filter']+'%'};return _0x964c66;}})});}_0x45ea47=_['merge']({},_0x45ea47,_0x2c5ec7[_0xd46e('0x42')]);var _0x54949f={'where':_0x45ea47[_0xd46e('0x3c')]};return db[_0xd46e('0x2e')]['count'](_0x54949f)[_0xd46e('0x25')](function(_0x4114e6){_0x504324[_0xd46e('0x43')]=_0x4114e6;if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x44')]){_0x45ea47[_0xd46e('0x45')]=[{'all':!![]}];}return db[_0xd46e('0x2e')][_0xd46e('0x46')](_0x45ea47);})[_0xd46e('0x25')](function(_0xec367d){_0x504324[_0xd46e('0x47')]=_0xec367d;return _0x504324;})['then'](respondWithFilteredResult(_0x18f060,_0x45ea47))['catch'](handleError(_0x18f060,null));};exports['show']=function(_0x2b4a5a,_0x4e1d94){var _0x168d35={'raw':!![],'where':{'id':_0x2b4a5a[_0xd46e('0x48')]['id']}},_0x272f5f={};_0x272f5f[_0xd46e('0x32')]=_[_0xd46e('0x49')](db[_0xd46e('0x2e')][_0xd46e('0x2f')]);_0x272f5f[_0xd46e('0x33')]=_['keys'](_0x2b4a5a[_0xd46e('0x33')]);_0x272f5f['filters']=_[_0xd46e('0x35')](_0x272f5f[_0xd46e('0x32')],_0x272f5f[_0xd46e('0x33')]);_0x168d35[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x272f5f['model'],qs[_0xd46e('0x37')](_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x37')]));_0x168d35[_0xd46e('0x36')]=_0x168d35[_0xd46e('0x36')]['length']?_0x168d35[_0xd46e('0x36')]:_0x272f5f[_0xd46e('0x32')];if(_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x44')]){_0x168d35[_0xd46e('0x45')]=[{'all':!![]}];}_0x168d35=_['merge']({},_0x168d35,_0x2b4a5a[_0xd46e('0x42')]);return db[_0xd46e('0x2e')][_0xd46e('0x4a')](_0x168d35)[_0xd46e('0x25')](handleEntityNotFound(_0x4e1d94,null))[_0xd46e('0x25')](respondWithResult(_0x4e1d94,null))[_0xd46e('0x4b')](handleError(_0x4e1d94,null));};exports[_0xd46e('0x4c')]=function(_0x440dcc,_0x5188f6){return db[_0xd46e('0x2e')][_0xd46e('0x4c')](_0x440dcc[_0xd46e('0x4d')],{})[_0xd46e('0x25')](function(_0x1f1941){var _0x4e84c8=_0x440dcc['user'][_0xd46e('0x4e')]({'plain':!![]});if(!_0x4e84c8)throw new Error(_0xd46e('0x4f'));if(_0x4e84c8[_0xd46e('0x50')]==='user'){var _0x479711=_0x1f1941[_0xd46e('0x4e')]({'plain':!![]});var _0x9d8638='Metrics';return db[_0xd46e('0x51')][_0xd46e('0x4a')]({'where':{'name':_0x9d8638,'userProfileId':_0x4e84c8[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x25')](function(_0x1bd8a5){if(_0x1bd8a5&&_0x1bd8a5[_0xd46e('0x53')]===0x0){return db[_0xd46e('0x27')][_0xd46e('0x4c')]({'name':_0x479711['name'],'resourceId':_0x479711['id'],'type':_0x1bd8a5[_0xd46e('0x2b')],'sectionId':_0x1bd8a5['id']},{})[_0xd46e('0x25')](function(){return _0x1f1941;});}else{return _0x1f1941;}})[_0xd46e('0x4b')](function(_0x63ee74){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x63ee74);throw _0x63ee74;});}return _0x1f1941;})[_0xd46e('0x25')](respondWithResult(_0x5188f6,0xc9))['catch'](handleError(_0x5188f6,null));};exports[_0xd46e('0x24')]=function(_0x2af20b,_0x393cb9){if(_0x2af20b[_0xd46e('0x4d')]['id']){delete _0x2af20b[_0xd46e('0x4d')]['id'];}return db[_0xd46e('0x2e')]['find']({'where':{'id':_0x2af20b[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x393cb9,null))[_0xd46e('0x25')](saveUpdates(_0x2af20b['body'],null))[_0xd46e('0x25')](respondWithResult(_0x393cb9,null))[_0xd46e('0x4b')](handleError(_0x393cb9,null));};exports[_0xd46e('0x28')]=function(_0x2042d4,_0x1886e6){return db[_0xd46e('0x2e')][_0xd46e('0x4a')]({'where':{'id':_0x2042d4[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x1886e6,null))[_0xd46e('0x25')](removeEntity(_0x1886e6,null))[_0xd46e('0x4b')](handleError(_0x1886e6,null));};
\ No newline at end of file
+var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x9cda45,_0xb96ab0){var _0x45a8e5=function(_0x20e621){while(--_0x20e621){_0x9cda45['push'](_0x9cda45['shift']());}};_0x45a8e5(++_0xb96ab0);}(_0x008c,0x188));var _0xc008=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0x008c[_0x4d7f3f];return _0x5d67cc;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 511967d..a069d56 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 _0x81d4=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0xf1603b,_0x257c11){var _0x298fab=function(_0x5a96fd){while(--_0x5a96fd){_0xf1603b['push'](_0xf1603b['shift']());}};_0x298fab(++_0x257c11);}(_0x81d4,0x197));var _0x481d=function(_0x50af94,_0x2af691){_0x50af94=_0x50af94-0x0;var _0x2c54a0=_0x81d4[_0x50af94];return _0x2c54a0;};'use strict';var _=require('lodash');var util=require(_0x481d('0x0'));var logger=require(_0x481d('0x1'))('api');var moment=require(_0x481d('0x2'));var BPromise=require(_0x481d('0x3'));var rp=require(_0x481d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x481d('0x5'));var attributes=require(_0x481d('0x6'));module[_0x481d('0x7')]=function(_0x5c0761,_0x1ef8ca){return _0x5c0761[_0x481d('0x8')](_0x481d('0x9'),attributes,{'tableName':_0x481d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3eea=['exports','AnalyticMetric','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x3cb722,_0x186d29){var _0xd7b020=function(_0xc87738){while(--_0xc87738){_0x3cb722['push'](_0x3cb722['shift']());}};_0xd7b020(++_0x186d29);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x302130,_0x16db6b){_0x302130=_0x302130-0x0;var _0x2a1bd2=_0x3eea[_0x302130];return _0x2a1bd2;};'use strict';var _=require(_0xa3ee('0x0'));var util=require('util');var logger=require(_0xa3ee('0x1'))(_0xa3ee('0x2'));var moment=require(_0xa3ee('0x3'));var BPromise=require(_0xa3ee('0x4'));var rp=require(_0xa3ee('0x5'));var fs=require('fs');var path=require(_0xa3ee('0x6'));var rimraf=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var attributes=require(_0xa3ee('0x9'));module[_0xa3ee('0xa')]=function(_0xb93cdb,_0x5776bb){return _0xb93cdb['define'](_0xa3ee('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index b294cf4..c237584 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 _0x5f4f=['message','info','result','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x425355,_0x53d26b){var _0x4a3d30=function(_0x51b9a7){while(--_0x51b9a7){_0x425355['push'](_0x425355['shift']());}};_0x4a3d30(++_0x53d26b);}(_0x5f4f,0xc9));var _0xf5f4=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x5f4f[_0x342700];return _0x53406f;};'use strict';var _=require('lodash');var util=require(_0xf5f4('0x0'));var moment=require('moment');var BPromise=require(_0xf5f4('0x1'));var rs=require(_0xf5f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5f4('0x3'))['db'];var utils=require(_0xf5f4('0x4'));var logger=require(_0xf5f4('0x5'))(_0xf5f4('0x6'));var config=require(_0xf5f4('0x7'));var jayson=require(_0xf5f4('0x8'));var client=jayson[_0xf5f4('0x9')][_0xf5f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36d4b1,_0x2acd7e,_0x2ac63c){return new BPromise(function(_0x3236a8,_0x4da1bf){return client[_0xf5f4('0xb')](_0x36d4b1,_0x2ac63c)[_0xf5f4('0xc')](function(_0xa212c4){logger['info'](_0xf5f4('0xd'),_0x2acd7e,_0xf5f4('0xe'));logger[_0xf5f4('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x2acd7e,'request\x20sent',JSON[_0xf5f4('0x10')](_0xa212c4));if(_0xa212c4['error']){if(_0xa212c4[_0xf5f4('0x11')][_0xf5f4('0x12')]===0x1f4){logger['error'](_0xf5f4('0xd'),_0x2acd7e,_0xa212c4['error']['message']);return _0x4da1bf(_0xa212c4[_0xf5f4('0x11')][_0xf5f4('0x13')]);}logger['error'](_0xf5f4('0xd'),_0x2acd7e,_0xa212c4[_0xf5f4('0x11')][_0xf5f4('0x13')]);return _0x3236a8(_0xa212c4[_0xf5f4('0x11')]['message']);}else{logger[_0xf5f4('0x14')](_0xf5f4('0xd'),_0x2acd7e,_0xf5f4('0xe'));_0x3236a8(_0xa212c4[_0xf5f4('0x15')]['message']);}})['catch'](function(_0x35ac00){logger[_0xf5f4('0x11')](_0xf5f4('0xd'),_0x2acd7e,_0x35ac00);_0x4da1bf(_0x35ac00);});});}
\ No newline at end of file
+var _0x589e=['message','info','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x181e4e,_0x3f7d88){var _0x1bfc24=function(_0x52e430){while(--_0x52e430){_0x181e4e['push'](_0x181e4e['shift']());}};_0x1bfc24(++_0x3f7d88);}(_0x589e,0x10c));var _0xe589=function(_0x416875,_0x1e3125){_0x416875=_0x416875-0x0;var _0x360d6b=_0x589e[_0x416875];return _0x360d6b;};'use strict';var _=require(_0xe589('0x0'));var util=require(_0xe589('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe589('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe589('0x3'))['db'];var utils=require(_0xe589('0x4'));var logger=require(_0xe589('0x5'))(_0xe589('0x6'));var config=require('../../config/environment');var jayson=require(_0xe589('0x7'));var client=jayson[_0xe589('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x230f44,_0x2d5759,_0x26e18a){return new BPromise(function(_0x42992c,_0xafbd58){return client[_0xe589('0x9')](_0x230f44,_0x26e18a)[_0xe589('0xa')](function(_0x5bb373){logger['info'](_0xe589('0xb'),_0x2d5759,_0xe589('0xc'));logger[_0xe589('0xd')](_0xe589('0xe'),_0x2d5759,_0xe589('0xc'),JSON[_0xe589('0xf')](_0x5bb373));if(_0x5bb373[_0xe589('0x10')]){if(_0x5bb373[_0xe589('0x10')][_0xe589('0x11')]===0x1f4){logger[_0xe589('0x10')](_0xe589('0xb'),_0x2d5759,_0x5bb373[_0xe589('0x10')][_0xe589('0x12')]);return _0xafbd58(_0x5bb373[_0xe589('0x10')]['message']);}logger['error'](_0xe589('0xb'),_0x2d5759,_0x5bb373['error'][_0xe589('0x12')]);return _0x42992c(_0x5bb373['error']['message']);}else{logger[_0xe589('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x2d5759,_0xe589('0xc'));_0x42992c(_0x5bb373[_0xe589('0x14')][_0xe589('0x12')]);}})[_0xe589('0x15')](function(_0x54fd5){logger[_0xe589('0x10')](_0xe589('0xb'),_0x2d5759,_0x54fd5);_0xafbd58(_0x54fd5);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 234ae3d..3970d17 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 _0x004c=['../../components/interaction/service','./analyticMetric.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x350539,_0x12db43){var _0xabd4ad=function(_0x33436f){while(--_0x33436f){_0x350539['push'](_0x350539['shift']());}};_0xabd4ad(++_0x12db43);}(_0x004c,0x85));var _0xc004=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x004c[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0xc004('0x0'));var util=require(_0xc004('0x1'));var path=require(_0xc004('0x2'));var timeout=require(_0xc004('0x3'));var express=require('express');var router=express[_0xc004('0x4')]();var fs_extra=require(_0xc004('0x5'));var auth=require(_0xc004('0x6'));var interaction=require(_0xc004('0x7'));var config=require('../../config/environment');var controller=require(_0xc004('0x8'));router['get']('/',auth[_0xc004('0x9')](),controller[_0xc004('0xa')]);router[_0xc004('0xb')]('/:id',auth[_0xc004('0x9')](),controller[_0xc004('0xc')]);router[_0xc004('0xd')]('/',auth[_0xc004('0x9')](),controller['create']);router[_0xc004('0xe')](_0xc004('0xf'),auth[_0xc004('0x9')](),controller[_0xc004('0x10')]);router[_0xc004('0x11')](_0xc004('0xf'),auth[_0xc004('0x9')](),controller[_0xc004('0x12')]);module[_0xc004('0x13')]=router;
\ No newline at end of file
+var _0x00e0=['put','update','delete','multer','util','path','express','fs-extra','get','isAuthenticated','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00e0,0x1e3));var _0x000e=function(_0x4ce36d,_0x477757){_0x4ce36d=_0x4ce36d-0x0;var _0x46c13b=_0x00e0[_0x4ce36d];return _0x46c13b;};'use strict';var multer=require(_0x000e('0x0'));var util=require(_0x000e('0x1'));var path=require(_0x000e('0x2'));var timeout=require('connect-timeout');var express=require(_0x000e('0x3'));var router=express['Router']();var fs_extra=require(_0x000e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0x000e('0x5')]('/',auth[_0x000e('0x6')](),controller['index']);router[_0x000e('0x5')](_0x000e('0x7'),auth[_0x000e('0x6')](),controller[_0x000e('0x8')]);router['post']('/',auth[_0x000e('0x6')](),controller['create']);router[_0x000e('0x9')](_0x000e('0x7'),auth[_0x000e('0x6')](),controller[_0x000e('0xa')]);router[_0x000e('0xb')](_0x000e('0x7'),auth[_0x000e('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index c661a3c..fbf1569 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 _0x13be=['sequelize','TEXT'];(function(_0x534f8f,_0x9471f8){var _0x2c9ba2=function(_0x57bbf4){while(--_0x57bbf4){_0x534f8f['push'](_0x534f8f['shift']());}};_0x2c9ba2(++_0x9471f8);}(_0x13be,0xae));var _0xe13b=function(_0xb08995,_0x2ca3fd){_0xb08995=_0xb08995-0x0;var _0x4af313=_0x13be[_0xb08995];return _0x4af313;};'use strict';var Sequelize=require(_0xe13b('0x0'));module['exports']={'tree':{'type':Sequelize[_0xe13b('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xf25a=['sequelize','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf25a,0x195));var _0xaf25=function(_0x15a828,_0x447b10){_0x15a828=_0x15a828-0x0;var _0x1b009b=_0xf25a[_0x15a828];return _0x1b009b;};'use strict';var Sequelize=require(_0xaf25('0x0'));module[_0xaf25('0x1')]={'tree':{'type':Sequelize[_0xaf25('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 e1d8b94..9ecdf93 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 _0x9741=['merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','error','name','send','index','AnalyticTreeReport','type','map','query','keys','filters','intersection','attributes','model','fields','length','order','pick','filter','where'];(function(_0x3b4dfd,_0x1f5e49){var _0x4cf56a=function(_0x27e3f0){while(--_0x27e3f0){_0x3b4dfd['push'](_0x3b4dfd['shift']());}};_0x4cf56a(++_0x1f5e49);}(_0x9741,0xd4));var _0x1974=function(_0x2990b8,_0x298c4c){_0x2990b8=_0x2990b8-0x0;var _0x1afa08=_0x9741[_0x2990b8];return _0x1afa08;};'use strict';var emlformat=require(_0x1974('0x0'));var rimraf=require(_0x1974('0x1'));var zipdir=require(_0x1974('0x2'));var jsonpatch=require(_0x1974('0x3'));var rp=require('request-promise');var moment=require(_0x1974('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1974('0x5'));var util=require(_0x1974('0x6'));var path=require(_0x1974('0x7'));var sox=require(_0x1974('0x8'));var csv=require(_0x1974('0x9'));var ejs=require(_0x1974('0xa'));var fs=require('fs');var fs_extra=require(_0x1974('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1974('0xc'));var jsforce=require(_0x1974('0xd'));var deskjs=require(_0x1974('0xe'));var toCsv=require(_0x1974('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1974('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1974('0x10'));var logger=require(_0x1974('0x11'))('api');var utils=require(_0x1974('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1974('0x13'));var db=require(_0x1974('0x14'))['db'];function respondWithStatusCode(_0x47960e,_0x248ed1){_0x248ed1=_0x248ed1||0xcc;return function(_0x19f167){if(_0x19f167){return _0x47960e['sendStatus'](_0x248ed1);}return _0x47960e[_0x1974('0x15')](_0x248ed1)[_0x1974('0x16')]();};}function respondWithResult(_0x4415f9,_0x35437c){_0x35437c=_0x35437c||0xc8;return function(_0x175249){if(_0x175249){return _0x4415f9['status'](_0x35437c)[_0x1974('0x17')](_0x175249);}};}function respondWithFilteredResult(_0x223c4f,_0x5d975d){return function(_0x542a41){if(_0x542a41){var _0x4c94e5=typeof _0x5d975d[_0x1974('0x18')]===_0x1974('0x19')&&typeof _0x5d975d[_0x1974('0x1a')]===_0x1974('0x19');var _0x319827=_0x542a41['count'];var _0x36b546=_0x4c94e5?0x0:_0x5d975d[_0x1974('0x18')];var _0x1e478c=_0x4c94e5?_0x542a41[_0x1974('0x1b')]:_0x5d975d[_0x1974('0x18')]+_0x5d975d[_0x1974('0x1a')];var _0xa2e67b;if(_0x1e478c>=_0x319827){_0x1e478c=_0x319827;_0xa2e67b=0xc8;}else{_0xa2e67b=0xce;}_0x223c4f[_0x1974('0x15')](_0xa2e67b);return _0x223c4f['set']('Content-Range',_0x36b546+'-'+_0x1e478c+'/'+_0x319827)[_0x1974('0x17')](_0x542a41);}return null;};}function patchUpdates(_0x33f245){return function(_0x4ac8e7){try{jsonpatch[_0x1974('0x1c')](_0x4ac8e7,_0x33f245,!![]);}catch(_0x4728d1){return BPromise['reject'](_0x4728d1);}return _0x4ac8e7[_0x1974('0x1d')]();};}function saveUpdates(_0x24799e,_0x42068a){return function(_0x5e25dd){if(_0x5e25dd){return _0x5e25dd[_0x1974('0x1e')](_0x24799e)[_0x1974('0x1f')](function(_0x76fa36){return _0x76fa36;});}return null;};}function removeEntity(_0x3e506e,_0x3d25cc){return function(_0x30aacd){if(_0x30aacd){return _0x30aacd[_0x1974('0x20')]()[_0x1974('0x1f')](function(){_0x3e506e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x232001,_0x3b6286){return function(_0x59e016){if(!_0x59e016){_0x232001['sendStatus'](0x194);}return _0x59e016;};}function handleError(_0xc4a0d6,_0x49e005){_0x49e005=_0x49e005||0x1f4;return function(_0x3940e3){logger[_0x1974('0x21')](_0x3940e3['stack']);if(_0x3940e3[_0x1974('0x22')]){delete _0x3940e3[_0x1974('0x22')];}_0xc4a0d6['status'](_0x49e005)[_0x1974('0x23')](_0x3940e3);};}exports[_0x1974('0x24')]=function(_0x83e424,_0x477ce8){var _0x3b556a={},_0x44b403={},_0x5d7944={'count':0x0,'rows':[]};var _0x5c5eb3=_['map'](db[_0x1974('0x25')]['rawAttributes'],function(_0x3716d7){return{'name':_0x3716d7['fieldName'],'type':_0x3716d7[_0x1974('0x26')]['key']};});_0x44b403['model']=_[_0x1974('0x27')](_0x5c5eb3,'name');_0x44b403[_0x1974('0x28')]=_[_0x1974('0x29')](_0x83e424[_0x1974('0x28')]);_0x44b403[_0x1974('0x2a')]=_[_0x1974('0x2b')](_0x44b403['model'],_0x44b403['query']);_0x3b556a[_0x1974('0x2c')]=_[_0x1974('0x2b')](_0x44b403[_0x1974('0x2d')],qs['fields'](_0x83e424[_0x1974('0x28')][_0x1974('0x2e')]));_0x3b556a[_0x1974('0x2c')]=_0x3b556a[_0x1974('0x2c')][_0x1974('0x2f')]?_0x3b556a[_0x1974('0x2c')]:_0x44b403[_0x1974('0x2d')];if(!_0x83e424[_0x1974('0x28')]['hasOwnProperty']('nolimit')){_0x3b556a[_0x1974('0x1a')]=qs[_0x1974('0x1a')](_0x83e424['query'][_0x1974('0x1a')]);_0x3b556a[_0x1974('0x18')]=qs['offset'](_0x83e424['query'][_0x1974('0x18')]);}_0x3b556a[_0x1974('0x30')]=qs['sort'](_0x83e424['query']['sort']);_0x3b556a['where']=qs['filters'](_[_0x1974('0x31')](_0x83e424['query'],_0x44b403[_0x1974('0x2a')]),_0x5c5eb3);if(_0x83e424['query'][_0x1974('0x32')]){_0x3b556a[_0x1974('0x33')]=_[_0x1974('0x34')](_0x3b556a[_0x1974('0x33')],{'$or':_[_0x1974('0x27')](_0x5c5eb3,function(_0x33998d){if(_0x33998d['type']!==_0x1974('0x35')){var _0x366d60={};_0x366d60[_0x33998d[_0x1974('0x22')]]={'$like':'%'+_0x83e424[_0x1974('0x28')][_0x1974('0x32')]+'%'};return _0x366d60;}})});}_0x3b556a=_['merge']({},_0x3b556a,_0x83e424[_0x1974('0x36')]);var _0x2d458e={'where':_0x3b556a[_0x1974('0x33')]};return db['AnalyticTreeReport']['count'](_0x2d458e)[_0x1974('0x1f')](function(_0x46457e){_0x5d7944['count']=_0x46457e;if(_0x83e424[_0x1974('0x28')][_0x1974('0x37')]){_0x3b556a[_0x1974('0x38')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x1974('0x39')](_0x3b556a);})[_0x1974('0x1f')](function(_0x59a847){_0x5d7944[_0x1974('0x3a')]=_0x59a847;return _0x5d7944;})[_0x1974('0x1f')](respondWithFilteredResult(_0x477ce8,_0x3b556a))['catch'](handleError(_0x477ce8,null));};exports[_0x1974('0x3b')]=function(_0x518896,_0x4abd63){var _0x17faba={'raw':!![],'where':{'id':_0x518896[_0x1974('0x3c')]['id']}},_0x31ee39={};_0x31ee39[_0x1974('0x2d')]=_[_0x1974('0x29')](db[_0x1974('0x25')][_0x1974('0x3d')]);_0x31ee39[_0x1974('0x28')]=_[_0x1974('0x29')](_0x518896[_0x1974('0x28')]);_0x31ee39[_0x1974('0x2a')]=_['intersection'](_0x31ee39['model'],_0x31ee39[_0x1974('0x28')]);_0x17faba[_0x1974('0x2c')]=_['intersection'](_0x31ee39[_0x1974('0x2d')],qs[_0x1974('0x2e')](_0x518896[_0x1974('0x28')][_0x1974('0x2e')]));_0x17faba['attributes']=_0x17faba[_0x1974('0x2c')][_0x1974('0x2f')]?_0x17faba[_0x1974('0x2c')]:_0x31ee39['model'];if(_0x518896[_0x1974('0x28')][_0x1974('0x37')]){_0x17faba[_0x1974('0x38')]=[{'all':!![]}];}_0x17faba=_['merge']({},_0x17faba,_0x518896[_0x1974('0x36')]);return db[_0x1974('0x25')]['find'](_0x17faba)[_0x1974('0x1f')](handleEntityNotFound(_0x4abd63,null))[_0x1974('0x1f')](respondWithResult(_0x4abd63,null))[_0x1974('0x3e')](handleError(_0x4abd63,null));};exports[_0x1974('0x3f')]=function(_0x518721,_0xc7cd3a){return db['AnalyticTreeReport'][_0x1974('0x3f')](_0x518721['body'],{})[_0x1974('0x1f')](respondWithResult(_0xc7cd3a,0xc9))[_0x1974('0x3e')](handleError(_0xc7cd3a,null));};exports[_0x1974('0x1e')]=function(_0x3d670d,_0x443fb6){if(_0x3d670d['body']['id']){delete _0x3d670d[_0x1974('0x40')]['id'];}return db[_0x1974('0x25')][_0x1974('0x41')]({'where':{'id':_0x3d670d[_0x1974('0x3c')]['id']}})[_0x1974('0x1f')](handleEntityNotFound(_0x443fb6,null))['then'](saveUpdates(_0x3d670d[_0x1974('0x40')],null))[_0x1974('0x1f')](respondWithResult(_0x443fb6,null))[_0x1974('0x3e')](handleError(_0x443fb6,null));};exports['destroy']=function(_0x2ea7ea,_0xa24757){return db[_0x1974('0x25')][_0x1974('0x41')]({'where':{'id':_0x2ea7ea[_0x1974('0x3c')]['id']}})[_0x1974('0x1f')](handleEntityNotFound(_0xa24757,null))[_0x1974('0x1f')](removeEntity(_0xa24757,null))[_0x1974('0x3e')](handleError(_0xa24757,null));};
\ No newline at end of file
+var _0x73aa=['sort','where','pick','filters','filter','includeAll','include','findAll','merge','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x73aa,0xf2));var _0xa73a=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0x73aa[_0x291f8b];return _0x275171;};'use strict';var emlformat=require(_0xa73a('0x0'));var rimraf=require(_0xa73a('0x1'));var zipdir=require(_0xa73a('0x2'));var jsonpatch=require(_0xa73a('0x3'));var rp=require('request-promise');var moment=require(_0xa73a('0x4'));var BPromise=require(_0xa73a('0x5'));var Mustache=require(_0xa73a('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa73a('0x7'));var fs=require('fs');var fs_extra=require(_0xa73a('0x8'));var _=require(_0xa73a('0x9'));var squel=require(_0xa73a('0xa'));var crypto=require(_0xa73a('0xb'));var jsforce=require(_0xa73a('0xc'));var deskjs=require(_0xa73a('0xd'));var toCsv=require(_0xa73a('0xe'));var querystring=require(_0xa73a('0xf'));var Papa=require(_0xa73a('0x10'));var Redis=require(_0xa73a('0x11'));var authService=require(_0xa73a('0x12'));var qs=require(_0xa73a('0x13'));var as=require(_0xa73a('0x14'));var hardwareService=require(_0xa73a('0x15'));var logger=require(_0xa73a('0x16'))('api');var utils=require(_0xa73a('0x17'));var config=require(_0xa73a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa73a('0x19'))['db'];function respondWithStatusCode(_0x24aada,_0xa00ca4){_0xa00ca4=_0xa00ca4||0xcc;return function(_0x3b46a6){if(_0x3b46a6){return _0x24aada[_0xa73a('0x1a')](_0xa00ca4);}return _0x24aada[_0xa73a('0x1b')](_0xa00ca4)[_0xa73a('0x1c')]();};}function respondWithResult(_0x56f211,_0x33e342){_0x33e342=_0x33e342||0xc8;return function(_0x3d7083){if(_0x3d7083){return _0x56f211[_0xa73a('0x1b')](_0x33e342)['json'](_0x3d7083);}};}function respondWithFilteredResult(_0x30e772,_0x392b9f){return function(_0x49b59d){if(_0x49b59d){var _0x3701af=typeof _0x392b9f[_0xa73a('0x1d')]===_0xa73a('0x1e')&&typeof _0x392b9f[_0xa73a('0x1f')]===_0xa73a('0x1e');var _0x431e96=_0x49b59d['count'];var _0x1a1166=_0x3701af?0x0:_0x392b9f[_0xa73a('0x1d')];var _0x793f4b=_0x3701af?_0x49b59d[_0xa73a('0x20')]:_0x392b9f[_0xa73a('0x1d')]+_0x392b9f[_0xa73a('0x1f')];var _0x48cacd;if(_0x793f4b>=_0x431e96){_0x793f4b=_0x431e96;_0x48cacd=0xc8;}else{_0x48cacd=0xce;}_0x30e772['status'](_0x48cacd);return _0x30e772[_0xa73a('0x21')](_0xa73a('0x22'),_0x1a1166+'-'+_0x793f4b+'/'+_0x431e96)[_0xa73a('0x23')](_0x49b59d);}return null;};}function patchUpdates(_0x35a38d){return function(_0x117310){try{jsonpatch[_0xa73a('0x24')](_0x117310,_0x35a38d,!![]);}catch(_0x1a34f3){return BPromise[_0xa73a('0x25')](_0x1a34f3);}return _0x117310[_0xa73a('0x26')]();};}function saveUpdates(_0x13cb3f,_0x48bc8c){return function(_0xc6cc68){if(_0xc6cc68){return _0xc6cc68[_0xa73a('0x27')](_0x13cb3f)[_0xa73a('0x28')](function(_0x51edbb){return _0x51edbb;});}return null;};}function removeEntity(_0x1208df,_0x5b14d2){return function(_0x13af7e){if(_0x13af7e){return _0x13af7e[_0xa73a('0x29')]()[_0xa73a('0x28')](function(){_0x1208df[_0xa73a('0x1b')](0xcc)[_0xa73a('0x1c')]();});}};}function handleEntityNotFound(_0x4c7718,_0x57f935){return function(_0x3e0b99){if(!_0x3e0b99){_0x4c7718[_0xa73a('0x1a')](0x194);}return _0x3e0b99;};}function handleError(_0x38c755,_0x4141ac){_0x4141ac=_0x4141ac||0x1f4;return function(_0x3a9723){logger[_0xa73a('0x2a')](_0x3a9723[_0xa73a('0x2b')]);if(_0x3a9723[_0xa73a('0x2c')]){delete _0x3a9723['name'];}_0x38c755[_0xa73a('0x1b')](_0x4141ac)[_0xa73a('0x2d')](_0x3a9723);};}exports[_0xa73a('0x2e')]=function(_0x18bb8f,_0x1fde4a){var _0x524d16={},_0x5c0f6e={},_0x504825={'count':0x0,'rows':[]};var _0x40a266=_[_0xa73a('0x2f')](db[_0xa73a('0x30')][_0xa73a('0x31')],function(_0x46e3b5){return{'name':_0x46e3b5[_0xa73a('0x32')],'type':_0x46e3b5[_0xa73a('0x33')][_0xa73a('0x34')]};});_0x5c0f6e[_0xa73a('0x35')]=_[_0xa73a('0x2f')](_0x40a266,_0xa73a('0x2c'));_0x5c0f6e[_0xa73a('0x36')]=_[_0xa73a('0x37')](_0x18bb8f[_0xa73a('0x36')]);_0x5c0f6e['filters']=_['intersection'](_0x5c0f6e[_0xa73a('0x35')],_0x5c0f6e[_0xa73a('0x36')]);_0x524d16[_0xa73a('0x38')]=_[_0xa73a('0x39')](_0x5c0f6e[_0xa73a('0x35')],qs['fields'](_0x18bb8f[_0xa73a('0x36')][_0xa73a('0x3a')]));_0x524d16[_0xa73a('0x38')]=_0x524d16[_0xa73a('0x38')][_0xa73a('0x3b')]?_0x524d16['attributes']:_0x5c0f6e[_0xa73a('0x35')];if(!_0x18bb8f[_0xa73a('0x36')][_0xa73a('0x3c')]('nolimit')){_0x524d16[_0xa73a('0x1f')]=qs['limit'](_0x18bb8f[_0xa73a('0x36')][_0xa73a('0x1f')]);_0x524d16['offset']=qs[_0xa73a('0x1d')](_0x18bb8f['query']['offset']);}_0x524d16[_0xa73a('0x3d')]=qs['sort'](_0x18bb8f['query'][_0xa73a('0x3e')]);_0x524d16[_0xa73a('0x3f')]=qs['filters'](_[_0xa73a('0x40')](_0x18bb8f['query'],_0x5c0f6e[_0xa73a('0x41')]),_0x40a266);if(_0x18bb8f[_0xa73a('0x36')][_0xa73a('0x42')]){_0x524d16[_0xa73a('0x3f')]=_['merge'](_0x524d16[_0xa73a('0x3f')],{'$or':_[_0xa73a('0x2f')](_0x40a266,function(_0x3c9c2a){if(_0x3c9c2a[_0xa73a('0x33')]!=='VIRTUAL'){var _0x2818b9={};_0x2818b9[_0x3c9c2a[_0xa73a('0x2c')]]={'$like':'%'+_0x18bb8f[_0xa73a('0x36')][_0xa73a('0x42')]+'%'};return _0x2818b9;}})});}_0x524d16=_['merge']({},_0x524d16,_0x18bb8f['options']);var _0x43f655={'where':_0x524d16['where']};return db[_0xa73a('0x30')][_0xa73a('0x20')](_0x43f655)[_0xa73a('0x28')](function(_0x1d453b){_0x504825[_0xa73a('0x20')]=_0x1d453b;if(_0x18bb8f[_0xa73a('0x36')][_0xa73a('0x43')]){_0x524d16[_0xa73a('0x44')]=[{'all':!![]}];}return db[_0xa73a('0x30')][_0xa73a('0x45')](_0x524d16);})['then'](function(_0x38b0bd){_0x504825['rows']=_0x38b0bd;return _0x504825;})[_0xa73a('0x28')](respondWithFilteredResult(_0x1fde4a,_0x524d16))['catch'](handleError(_0x1fde4a,null));};exports['show']=function(_0x7bade1,_0x4e6fa6){var _0x375039={'raw':!![],'where':{'id':_0x7bade1['params']['id']}},_0x557323={};_0x557323[_0xa73a('0x35')]=_[_0xa73a('0x37')](db['AnalyticTreeReport'][_0xa73a('0x31')]);_0x557323[_0xa73a('0x36')]=_['keys'](_0x7bade1['query']);_0x557323[_0xa73a('0x41')]=_['intersection'](_0x557323[_0xa73a('0x35')],_0x557323[_0xa73a('0x36')]);_0x375039[_0xa73a('0x38')]=_[_0xa73a('0x39')](_0x557323['model'],qs[_0xa73a('0x3a')](_0x7bade1['query']['fields']));_0x375039[_0xa73a('0x38')]=_0x375039['attributes'][_0xa73a('0x3b')]?_0x375039[_0xa73a('0x38')]:_0x557323[_0xa73a('0x35')];if(_0x7bade1[_0xa73a('0x36')][_0xa73a('0x43')]){_0x375039[_0xa73a('0x44')]=[{'all':!![]}];}_0x375039=_[_0xa73a('0x46')]({},_0x375039,_0x7bade1['options']);return db['AnalyticTreeReport'][_0xa73a('0x47')](_0x375039)[_0xa73a('0x28')](handleEntityNotFound(_0x4e6fa6,null))[_0xa73a('0x28')](respondWithResult(_0x4e6fa6,null))[_0xa73a('0x48')](handleError(_0x4e6fa6,null));};exports[_0xa73a('0x49')]=function(_0x339adc,_0x30754d){return db[_0xa73a('0x30')][_0xa73a('0x49')](_0x339adc[_0xa73a('0x4a')],{})[_0xa73a('0x28')](respondWithResult(_0x30754d,0xc9))['catch'](handleError(_0x30754d,null));};exports[_0xa73a('0x27')]=function(_0xc2584,_0x4989c9){if(_0xc2584['body']['id']){delete _0xc2584[_0xa73a('0x4a')]['id'];}return db[_0xa73a('0x30')]['find']({'where':{'id':_0xc2584[_0xa73a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4989c9,null))[_0xa73a('0x28')](saveUpdates(_0xc2584[_0xa73a('0x4a')],null))[_0xa73a('0x28')](respondWithResult(_0x4989c9,null))[_0xa73a('0x48')](handleError(_0x4989c9,null));};exports[_0xa73a('0x29')]=function(_0x48033e,_0x17ce82){return db[_0xa73a('0x30')][_0xa73a('0x47')]({'where':{'id':_0x48033e[_0xa73a('0x4b')]['id']}})[_0xa73a('0x28')](handleEntityNotFound(_0x17ce82,null))['then'](removeEntity(_0x17ce82,null))[_0xa73a('0x48')](handleError(_0x17ce82,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 391c7bd..f9c8ae0 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 _0xb35e=['util','../../config/logger','bluebird','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x442dbc,_0x27fe32){var _0x175985=function(_0x34a0e7){while(--_0x34a0e7){_0x442dbc['push'](_0x442dbc['shift']());}};_0x175985(++_0x27fe32);}(_0xb35e,0x86));var _0xeb35=function(_0x587f34,_0x2721b5){_0x587f34=_0x587f34-0x0;var _0x157d40=_0xb35e[_0x587f34];return _0x157d40;};'use strict';var _=require(_0xeb35('0x0'));var util=require(_0xeb35('0x1'));var logger=require(_0xeb35('0x2'))('api');var moment=require('moment');var BPromise=require(_0xeb35('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeb35('0x4'));var attributes=require(_0xeb35('0x5'));module['exports']=function(_0x2f2813,_0x458e9a){return _0x2f2813[_0xeb35('0x6')](_0xeb35('0x7'),attributes,{'tableName':_0xeb35('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe3a3=['api','moment','bluebird','request-promise','path','rimraf','exports','define','AnalyticTreeReport','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe3a3,0xe5));var _0x3e3a=function(_0x183ef6,_0x402099){_0x183ef6=_0x183ef6-0x0;var _0x26a7fb=_0xe3a3[_0x183ef6];return _0x26a7fb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3e3a('0x0'))(_0x3e3a('0x1'));var moment=require(_0x3e3a('0x2'));var BPromise=require(_0x3e3a('0x3'));var rp=require(_0x3e3a('0x4'));var fs=require('fs');var path=require(_0x3e3a('0x5'));var rimraf=require(_0x3e3a('0x6'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x3e3a('0x7')]=function(_0x43d1be,_0x1e23b5){return _0x43d1be[_0x3e3a('0x8')](_0x3e3a('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 03ec32e..38c2f66 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(_0x3a480c,_0x1b345b){var _0x22a120=function(_0x3bcd69){while(--_0x3bcd69){_0x3a480c['push'](_0x3a480c['shift']());}};_0x22a120(++_0x1b345b);}(_0x5f2f,0x73));var _0xf5f2=function(_0xb81b30,_0x3c5427){_0xb81b30=_0xb81b30-0x0;var _0x48cd70=_0x5f2f[_0xb81b30];return _0x48cd70;};'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(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x3ff8a7,_0x1f3d77){_0x3ff8a7=_0x3ff8a7-0x0;var _0x112ef5=_0x7a54[_0x3ff8a7];return _0x112ef5;};'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 29afcf7..dc8253e 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 _0x2f18=['delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','/:id','isAuthenticated','show','post','put'];(function(_0x231a47,_0x46a963){var _0x48d7c9=function(_0x1e69b1){while(--_0x1e69b1){_0x231a47['push'](_0x231a47['shift']());}};_0x48d7c9(++_0x46a963);}(_0x2f18,0x191));var _0x82f1=function(_0x2a00a7,_0x1fdf20){_0x2a00a7=_0x2a00a7-0x0;var _0x4674ae=_0x2f18[_0x2a00a7];return _0x4674ae;};'use strict';var multer=require('multer');var util=require(_0x82f1('0x0'));var path=require(_0x82f1('0x1'));var timeout=require(_0x82f1('0x2'));var express=require(_0x82f1('0x3'));var router=express[_0x82f1('0x4')]();var fs_extra=require(_0x82f1('0x5'));var auth=require(_0x82f1('0x6'));var interaction=require(_0x82f1('0x7'));var config=require(_0x82f1('0x8'));var controller=require(_0x82f1('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x82f1('0xa')]);router[_0x82f1('0xb')](_0x82f1('0xc'),auth[_0x82f1('0xd')](),controller[_0x82f1('0xe')]);router[_0x82f1('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x82f1('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x82f1('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x82f1('0x12')]=router;
\ No newline at end of file
+var _0xab63=['connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','isAuthenticated','show','post','create','put','update','/:id','destroy','exports','multer','util','path'];(function(_0x23302f,_0x132d22){var _0x2e61a7=function(_0x42a952){while(--_0x42a952){_0x23302f['push'](_0x23302f['shift']());}};_0x2e61a7(++_0x132d22);}(_0xab63,0x95));var _0x3ab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab63[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3ab6('0x0'));var util=require(_0x3ab6('0x1'));var path=require(_0x3ab6('0x2'));var timeout=require(_0x3ab6('0x3'));var express=require(_0x3ab6('0x4'));var router=express[_0x3ab6('0x5')]();var fs_extra=require(_0x3ab6('0x6'));var auth=require(_0x3ab6('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x3ab6('0x8')]('/',auth['isAuthenticated'](),controller[_0x3ab6('0x9')]);router[_0x3ab6('0x8')]('/:id',auth[_0x3ab6('0xa')](),controller[_0x3ab6('0xb')]);router[_0x3ab6('0xc')]('/',auth[_0x3ab6('0xa')](),controller[_0x3ab6('0xd')]);router[_0x3ab6('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x3ab6('0xf')]);router['delete'](_0x3ab6('0x10'),auth['isAuthenticated'](),controller[_0x3ab6('0x11')]);module[_0x3ab6('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index bc13882..1ebe295 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 _0xc43c=['exports','STRING','sequelize'];(function(_0x269fcd,_0x33c0a2){var _0x1831c1=function(_0x35b5c1){while(--_0x35b5c1){_0x269fcd['push'](_0x269fcd['shift']());}};_0x1831c1(++_0x33c0a2);}(_0xc43c,0x152));var _0xcc43=function(_0x398bdc,_0x12dd6a){_0x398bdc=_0x398bdc-0x0;var _0x3fe3b7=_0xc43c[_0x398bdc];return _0x3fe3b7;};'use strict';var Sequelize=require(_0xcc43('0x0'));module[_0xcc43('0x1')]={'name':{'type':Sequelize[_0xcc43('0x2')]},'basename':{'type':Sequelize[_0xcc43('0x2')]},'type':{'type':Sequelize[_0xcc43('0x2')]}};
\ No newline at end of file
+var _0x4ab0=['STRING','exports'];(function(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0x4ab0,0xd5));var _0x04ab=function(_0xc3f462,_0x4fdbee){_0xc3f462=_0xc3f462-0x0;var _0x3470fc=_0x4ab0[_0xc3f462];return _0x3470fc;};'use strict';var Sequelize=require('sequelize');module[_0x04ab('0x0')]={'name':{'type':Sequelize[_0x04ab('0x1')]},'basename':{'type':Sequelize[_0x04ab('0x1')]},'type':{'type':Sequelize[_0x04ab('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 16fa609..4ad20fe 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 _0x325a=['options','Attachment','includeAll','findAll','rows','catch','show','params','include','clone','omit','updatedAt','body','createdAt','update','find','file','basename','create','download','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','then','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge'];(function(_0x217661,_0x1fbc3f){var _0x4ae813=function(_0x11173b){while(--_0x11173b){_0x217661['push'](_0x217661['shift']());}};_0x4ae813(++_0x1fbc3f);}(_0x325a,0x11d));var _0xa325=function(_0x466943,_0x310f20){_0x466943=_0x466943-0x0;var _0x573a01=_0x325a[_0x466943];return _0x573a01;};'use strict';var emlformat=require(_0xa325('0x0'));var rimraf=require(_0xa325('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa325('0x2'));var rp=require(_0xa325('0x3'));var moment=require(_0xa325('0x4'));var BPromise=require(_0xa325('0x5'));var Mustache=require(_0xa325('0x6'));var util=require(_0xa325('0x7'));var path=require(_0xa325('0x8'));var sox=require(_0xa325('0x9'));var csv=require(_0xa325('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa325('0xb'));var _=require(_0xa325('0xc'));var squel=require(_0xa325('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa325('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa325('0xf'));var Papa=require(_0xa325('0x10'));var Redis=require(_0xa325('0x11'));var authService=require(_0xa325('0x12'));var qs=require(_0xa325('0x13'));var as=require(_0xa325('0x14'));var hardwareService=require(_0xa325('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa325('0x16'));var licenseUtil=require(_0xa325('0x17'));var db=require(_0xa325('0x18'))['db'];function respondWithStatusCode(_0xf4645b,_0x173975){_0x173975=_0x173975||0xcc;return function(_0x443a39){if(_0x443a39){return _0xf4645b['sendStatus'](_0x173975);}return _0xf4645b[_0xa325('0x19')](_0x173975)[_0xa325('0x1a')]();};}function respondWithResult(_0x3da9ff,_0x48b970){_0x48b970=_0x48b970||0xc8;return function(_0x1714e8){if(_0x1714e8){return _0x3da9ff['status'](_0x48b970)['json'](_0x1714e8);}};}function respondWithFilteredResult(_0x54cc20,_0xd86b91){return function(_0x46e8f0){if(_0x46e8f0){var _0x9d0a92=typeof _0xd86b91[_0xa325('0x1b')]===_0xa325('0x1c')&&typeof _0xd86b91[_0xa325('0x1d')]===_0xa325('0x1c');var _0x59873b=_0x46e8f0['count'];var _0x20af51=_0x9d0a92?0x0:_0xd86b91['offset'];var _0x18118e=_0x9d0a92?_0x46e8f0[_0xa325('0x1e')]:_0xd86b91[_0xa325('0x1b')]+_0xd86b91[_0xa325('0x1d')];var _0x31f335;if(_0x18118e>=_0x59873b){_0x18118e=_0x59873b;_0x31f335=0xc8;}else{_0x31f335=0xce;}_0x54cc20[_0xa325('0x19')](_0x31f335);return _0x54cc20[_0xa325('0x1f')]('Content-Range',_0x20af51+'-'+_0x18118e+'/'+_0x59873b)[_0xa325('0x20')](_0x46e8f0);}return null;};}function patchUpdates(_0x1f46ce){return function(_0x2fefd3){try{jsonpatch[_0xa325('0x21')](_0x2fefd3,_0x1f46ce,!![]);}catch(_0x5b182f){return BPromise[_0xa325('0x22')](_0x5b182f);}return _0x2fefd3[_0xa325('0x23')]();};}function saveUpdates(_0x37def8,_0x3ecd06){return function(_0x55e6f8){if(_0x55e6f8){return _0x55e6f8['update'](_0x37def8)[_0xa325('0x24')](function(_0x437057){return _0x437057;});}return null;};}function removeEntity(_0x1e13ed,_0x2254d3){return function(_0x1cf570){if(_0x1cf570){return _0x1cf570['destroy']()[_0xa325('0x24')](function(){_0x1e13ed[_0xa325('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x339e33,_0x551a49){return function(_0x19a3fa){if(!_0x19a3fa){_0x339e33[_0xa325('0x25')](0x194);}return _0x19a3fa;};}function handleError(_0x39eb6d,_0x4ac7dd){_0x4ac7dd=_0x4ac7dd||0x1f4;return function(_0x5dc3d0){logger[_0xa325('0x26')](_0x5dc3d0['stack']);if(_0x5dc3d0[_0xa325('0x27')]){delete _0x5dc3d0['name'];}_0x39eb6d[_0xa325('0x19')](_0x4ac7dd)[_0xa325('0x28')](_0x5dc3d0);};}exports[_0xa325('0x29')]=function(_0x5dd5cc,_0x5f2506){var _0x26882e={},_0xa9b2e2={},_0x26331e={'count':0x0,'rows':[]};var _0x56deff=_['map'](db['Attachment'][_0xa325('0x2a')],function(_0x3745bc){return{'name':_0x3745bc[_0xa325('0x2b')],'type':_0x3745bc[_0xa325('0x2c')][_0xa325('0x2d')]};});_0xa9b2e2['model']=_[_0xa325('0x2e')](_0x56deff,'name');_0xa9b2e2[_0xa325('0x2f')]=_[_0xa325('0x30')](_0x5dd5cc[_0xa325('0x2f')]);_0xa9b2e2['filters']=_[_0xa325('0x31')](_0xa9b2e2[_0xa325('0x32')],_0xa9b2e2['query']);_0x26882e['attributes']=_['intersection'](_0xa9b2e2[_0xa325('0x32')],qs[_0xa325('0x33')](_0x5dd5cc['query'][_0xa325('0x33')]));_0x26882e[_0xa325('0x34')]=_0x26882e['attributes'][_0xa325('0x35')]?_0x26882e[_0xa325('0x34')]:_0xa9b2e2[_0xa325('0x32')];if(!_0x5dd5cc['query']['hasOwnProperty'](_0xa325('0x36'))){_0x26882e[_0xa325('0x1d')]=qs['limit'](_0x5dd5cc[_0xa325('0x2f')][_0xa325('0x1d')]);_0x26882e[_0xa325('0x1b')]=qs[_0xa325('0x1b')](_0x5dd5cc[_0xa325('0x2f')]['offset']);}_0x26882e[_0xa325('0x37')]=qs[_0xa325('0x38')](_0x5dd5cc['query'][_0xa325('0x38')]);_0x26882e[_0xa325('0x39')]=qs[_0xa325('0x3a')](_[_0xa325('0x3b')](_0x5dd5cc[_0xa325('0x2f')],_0xa9b2e2[_0xa325('0x3a')]),_0x56deff);if(_0x5dd5cc[_0xa325('0x2f')]['filter']){_0x26882e[_0xa325('0x39')]=_['merge'](_0x26882e[_0xa325('0x39')],{'$or':_['map'](_0x56deff,function(_0x1b8cfc){if(_0x1b8cfc[_0xa325('0x2c')]!==_0xa325('0x3c')){var _0x21c4f7={};_0x21c4f7[_0x1b8cfc[_0xa325('0x27')]]={'$like':'%'+_0x5dd5cc[_0xa325('0x2f')][_0xa325('0x3d')]+'%'};return _0x21c4f7;}})});}_0x26882e=_[_0xa325('0x3e')]({},_0x26882e,_0x5dd5cc[_0xa325('0x3f')]);var _0x27c8ab={'where':_0x26882e[_0xa325('0x39')]};return db[_0xa325('0x40')][_0xa325('0x1e')](_0x27c8ab)[_0xa325('0x24')](function(_0x29c728){_0x26331e[_0xa325('0x1e')]=_0x29c728;if(_0x5dd5cc['query'][_0xa325('0x41')]){_0x26882e['include']=[{'all':!![]}];}return db[_0xa325('0x40')][_0xa325('0x42')](_0x26882e);})[_0xa325('0x24')](function(_0x44d382){_0x26331e[_0xa325('0x43')]=_0x44d382;return _0x26331e;})[_0xa325('0x24')](respondWithFilteredResult(_0x5f2506,_0x26882e))[_0xa325('0x44')](handleError(_0x5f2506,null));};exports[_0xa325('0x45')]=function(_0x27bf9c,_0x361786){var _0x5d8e99={'raw':!![],'where':{'id':_0x27bf9c[_0xa325('0x46')]['id']}},_0x5ce503={};_0x5ce503[_0xa325('0x32')]=_[_0xa325('0x30')](db[_0xa325('0x40')][_0xa325('0x2a')]);_0x5ce503[_0xa325('0x2f')]=_['keys'](_0x27bf9c[_0xa325('0x2f')]);_0x5ce503['filters']=_['intersection'](_0x5ce503[_0xa325('0x32')],_0x5ce503['query']);_0x5d8e99[_0xa325('0x34')]=_[_0xa325('0x31')](_0x5ce503['model'],qs[_0xa325('0x33')](_0x27bf9c[_0xa325('0x2f')][_0xa325('0x33')]));_0x5d8e99[_0xa325('0x34')]=_0x5d8e99[_0xa325('0x34')][_0xa325('0x35')]?_0x5d8e99[_0xa325('0x34')]:_0x5ce503[_0xa325('0x32')];if(_0x27bf9c[_0xa325('0x2f')][_0xa325('0x41')]){_0x5d8e99[_0xa325('0x47')]=[{'all':!![]}];}_0x5d8e99=_[_0xa325('0x3e')]({},_0x5d8e99,_0x27bf9c[_0xa325('0x3f')]);return db[_0xa325('0x40')]['find'](_0x5d8e99)['then'](handleEntityNotFound(_0x361786,null))[_0xa325('0x24')](respondWithResult(_0x361786,null))['catch'](handleError(_0x361786,null));};exports[_0xa325('0x48')]=function(_0x15736e,_0x4821ec){var _0x401e95={'where':{'id':_0x15736e['params']['id']}},_0x60d3a2={};_0x60d3a2[_0xa325('0x32')]=_[_0xa325('0x30')](db['Attachment'][_0xa325('0x2a')]);_0x401e95[_0xa325('0x34')]=_['intersection'](_0x60d3a2[_0xa325('0x32')],qs[_0xa325('0x33')](_0x15736e[_0xa325('0x2f')][_0xa325('0x33')]));_0x401e95[_0xa325('0x34')]=_0x401e95['attributes'][_0xa325('0x35')]?_0x401e95[_0xa325('0x34')]:_0x60d3a2[_0xa325('0x32')];if(_0x15736e[_0xa325('0x2f')]['includeAll']){_0x401e95['include']=[{'all':!![]}];}_0x401e95=_[_0xa325('0x3e')]({},_0x401e95,_0x15736e[_0xa325('0x3f')]);return db['Attachment']['find'](_0x401e95)[_0xa325('0x24')](handleEntityNotFound(_0x4821ec,null))[_0xa325('0x24')](function(_0x5779fb){if(_0x5779fb){var _0x169108=_0x5779fb['get']({'plain':!![]});_0x169108=qs[_0xa325('0x49')](_0x169108,['id','createdAt',_0xa325('0x4a')]);_0x15736e[_0xa325('0x4b')]=_[_0xa325('0x49')](_0x15736e['body'],['id',_0xa325('0x4c'),_0xa325('0x4a')]);return db['Attachment']['create'](_['merge'](_0x169108,_0x15736e[_0xa325('0x4b')]),{'include':_0x15736e['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0xa325('0x24')](respondWithResult(_0x4821ec,0xc9))[_0xa325('0x44')](handleError(_0x4821ec,null));};exports[_0xa325('0x4d')]=function(_0x4663a3,_0x53ad7f){if(_0x4663a3[_0xa325('0x4b')]['id']){delete _0x4663a3[_0xa325('0x4b')]['id'];}return db['Attachment'][_0xa325('0x4e')]({'where':{'id':_0x4663a3[_0xa325('0x46')]['id']}})['then'](handleEntityNotFound(_0x53ad7f,null))[_0xa325('0x24')](saveUpdates(_0x4663a3[_0xa325('0x4b')],null))[_0xa325('0x24')](respondWithResult(_0x53ad7f,null))[_0xa325('0x44')](handleError(_0x53ad7f,null));};exports['destroy']=function(_0x4785d9,_0x2ac7a1){return db['Attachment'][_0xa325('0x4e')]({'where':{'id':_0x4785d9[_0xa325('0x46')]['id']}})[_0xa325('0x24')](handleEntityNotFound(_0x2ac7a1,null))[_0xa325('0x24')](removeEntity(_0x2ac7a1,null))[_0xa325('0x44')](handleError(_0x2ac7a1,null));};exports['create']=function(_0x162478,_0x2a4222,_0x362f92){_0x162478[_0xa325('0x4b')][_0xa325('0x27')]=_0x162478[_0xa325('0x4f')]['originalname'];_0x162478[_0xa325('0x4b')][_0xa325('0x50')]=_0x162478[_0xa325('0x4f')]['filename'];_0x162478[_0xa325('0x4b')][_0xa325('0x2c')]=_0x162478[_0xa325('0x4f')]['mimetype'];return db['Attachment'][_0xa325('0x51')](_0x162478[_0xa325('0x4b')])[_0xa325('0x24')](respondWithResult(_0x2a4222,0xc9))[_0xa325('0x44')](handleError(_0x2a4222,null));};exports[_0xa325('0x52')]=function(_0x36234e,_0x223a44,_0x476d1c){return db[_0xa325('0x40')]['findOne']({'where':{'id':_0x36234e[_0xa325('0x46')]['id']},'raw':!![]})[_0xa325('0x24')](handleEntityNotFound(_0x223a44,null))[_0xa325('0x24')](function(_0x1630ab){if(_0x1630ab){var _0xfc2d11=_0x1630ab['ChatOfflineMessageId']!==null;var _0x428c05=path['join'](config[_0xa325('0x53')],_0xa325('0x54'));if(_0xfc2d11){_0x428c05=path[_0xa325('0x55')](_0x428c05,_0xa325('0x56'));}var _0x3f9050=path[_0xa325('0x55')](_0x428c05,_0x1630ab['basename']);return _0x223a44[_0xa325('0x52')](_0x3f9050);}})[_0xa325('0x44')](handleError(_0x223a44,null));};
\ No newline at end of file
+var _0x0c5e=['Attachment','includeAll','include','findAll','show','params','rawAttributes','intersection','find','catch','clone','merge','get','omit','createdAt','updatedAt','body','create','file','originalname','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','options'];(function(_0x34752d,_0x3e18e1){var _0x3d5b99=function(_0x452ab6){while(--_0x452ab6){_0x34752d['push'](_0x34752d['shift']());}};_0x3d5b99(++_0x3e18e1);}(_0x0c5e,0x1f0));var _0xe0c5=function(_0x1c66f1,_0x53c85c){_0x1c66f1=_0x1c66f1-0x0;var _0x682d89=_0x0c5e[_0x1c66f1];return _0x682d89;};'use strict';var emlformat=require(_0xe0c5('0x0'));var rimraf=require(_0xe0c5('0x1'));var zipdir=require(_0xe0c5('0x2'));var jsonpatch=require(_0xe0c5('0x3'));var rp=require('request-promise');var moment=require(_0xe0c5('0x4'));var BPromise=require(_0xe0c5('0x5'));var Mustache=require(_0xe0c5('0x6'));var util=require(_0xe0c5('0x7'));var path=require(_0xe0c5('0x8'));var sox=require(_0xe0c5('0x9'));var csv=require(_0xe0c5('0xa'));var ejs=require(_0xe0c5('0xb'));var fs=require('fs');var fs_extra=require(_0xe0c5('0xc'));var _=require(_0xe0c5('0xd'));var squel=require('squel');var crypto=require(_0xe0c5('0xe'));var jsforce=require(_0xe0c5('0xf'));var deskjs=require(_0xe0c5('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe0c5('0x11'));var Papa=require(_0xe0c5('0x12'));var Redis=require(_0xe0c5('0x13'));var authService=require(_0xe0c5('0x14'));var qs=require(_0xe0c5('0x15'));var as=require(_0xe0c5('0x16'));var hardwareService=require(_0xe0c5('0x17'));var logger=require(_0xe0c5('0x18'))(_0xe0c5('0x19'));var utils=require(_0xe0c5('0x1a'));var config=require(_0xe0c5('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0c5('0x1c'))['db'];function respondWithStatusCode(_0x372423,_0x1a591d){_0x1a591d=_0x1a591d||0xcc;return function(_0x47a361){if(_0x47a361){return _0x372423[_0xe0c5('0x1d')](_0x1a591d);}return _0x372423[_0xe0c5('0x1e')](_0x1a591d)[_0xe0c5('0x1f')]();};}function respondWithResult(_0x52a896,_0xa69806){_0xa69806=_0xa69806||0xc8;return function(_0x2fc07f){if(_0x2fc07f){return _0x52a896[_0xe0c5('0x1e')](_0xa69806)[_0xe0c5('0x20')](_0x2fc07f);}};}function respondWithFilteredResult(_0xb68d5f,_0x5e9ab0){return function(_0x278f07){if(_0x278f07){var _0x13347f=typeof _0x5e9ab0[_0xe0c5('0x21')]==='undefined'&&typeof _0x5e9ab0['limit']===_0xe0c5('0x22');var _0x4cf76b=_0x278f07[_0xe0c5('0x23')];var _0x5b5b7d=_0x13347f?0x0:_0x5e9ab0[_0xe0c5('0x21')];var _0x18bf26=_0x13347f?_0x278f07['count']:_0x5e9ab0[_0xe0c5('0x21')]+_0x5e9ab0['limit'];var _0x2cd058;if(_0x18bf26>=_0x4cf76b){_0x18bf26=_0x4cf76b;_0x2cd058=0xc8;}else{_0x2cd058=0xce;}_0xb68d5f[_0xe0c5('0x1e')](_0x2cd058);return _0xb68d5f[_0xe0c5('0x24')](_0xe0c5('0x25'),_0x5b5b7d+'-'+_0x18bf26+'/'+_0x4cf76b)[_0xe0c5('0x20')](_0x278f07);}return null;};}function patchUpdates(_0x4803cc){return function(_0x5470d0){try{jsonpatch[_0xe0c5('0x26')](_0x5470d0,_0x4803cc,!![]);}catch(_0xf574ac){return BPromise[_0xe0c5('0x27')](_0xf574ac);}return _0x5470d0[_0xe0c5('0x28')]();};}function saveUpdates(_0x4d5f2c,_0x17bdfb){return function(_0x22e999){if(_0x22e999){return _0x22e999[_0xe0c5('0x29')](_0x4d5f2c)[_0xe0c5('0x2a')](function(_0x25d129){return _0x25d129;});}return null;};}function removeEntity(_0x4fe8bf,_0x145663){return function(_0x3b1d2e){if(_0x3b1d2e){return _0x3b1d2e[_0xe0c5('0x2b')]()[_0xe0c5('0x2a')](function(){_0x4fe8bf[_0xe0c5('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d9845,_0x3f2259){return function(_0x4bc390){if(!_0x4bc390){_0x3d9845[_0xe0c5('0x1d')](0x194);}return _0x4bc390;};}function handleError(_0x16bd3b,_0x1298ca){_0x1298ca=_0x1298ca||0x1f4;return function(_0x3bf03b){logger[_0xe0c5('0x2c')](_0x3bf03b[_0xe0c5('0x2d')]);if(_0x3bf03b[_0xe0c5('0x2e')]){delete _0x3bf03b[_0xe0c5('0x2e')];}_0x16bd3b[_0xe0c5('0x1e')](_0x1298ca)[_0xe0c5('0x2f')](_0x3bf03b);};}exports['index']=function(_0x4a8bbc,_0x12453f){var _0x5c7f41={},_0x18883e={},_0x1b6df8={'count':0x0,'rows':[]};var _0x4bdbba=_[_0xe0c5('0x30')](db['Attachment']['rawAttributes'],function(_0x1c77b2){return{'name':_0x1c77b2[_0xe0c5('0x31')],'type':_0x1c77b2[_0xe0c5('0x32')][_0xe0c5('0x33')]};});_0x18883e[_0xe0c5('0x34')]=_[_0xe0c5('0x30')](_0x4bdbba,'name');_0x18883e['query']=_[_0xe0c5('0x35')](_0x4a8bbc[_0xe0c5('0x36')]);_0x18883e[_0xe0c5('0x37')]=_['intersection'](_0x18883e['model'],_0x18883e[_0xe0c5('0x36')]);_0x5c7f41[_0xe0c5('0x38')]=_['intersection'](_0x18883e['model'],qs[_0xe0c5('0x39')](_0x4a8bbc[_0xe0c5('0x36')]['fields']));_0x5c7f41['attributes']=_0x5c7f41[_0xe0c5('0x38')][_0xe0c5('0x3a')]?_0x5c7f41[_0xe0c5('0x38')]:_0x18883e[_0xe0c5('0x34')];if(!_0x4a8bbc['query'][_0xe0c5('0x3b')](_0xe0c5('0x3c'))){_0x5c7f41[_0xe0c5('0x3d')]=qs[_0xe0c5('0x3d')](_0x4a8bbc[_0xe0c5('0x36')][_0xe0c5('0x3d')]);_0x5c7f41[_0xe0c5('0x21')]=qs[_0xe0c5('0x21')](_0x4a8bbc[_0xe0c5('0x36')][_0xe0c5('0x21')]);}_0x5c7f41[_0xe0c5('0x3e')]=qs[_0xe0c5('0x3f')](_0x4a8bbc['query'][_0xe0c5('0x3f')]);_0x5c7f41[_0xe0c5('0x40')]=qs[_0xe0c5('0x37')](_[_0xe0c5('0x41')](_0x4a8bbc[_0xe0c5('0x36')],_0x18883e[_0xe0c5('0x37')]),_0x4bdbba);if(_0x4a8bbc[_0xe0c5('0x36')][_0xe0c5('0x42')]){_0x5c7f41[_0xe0c5('0x40')]=_['merge'](_0x5c7f41[_0xe0c5('0x40')],{'$or':_[_0xe0c5('0x30')](_0x4bdbba,function(_0x4771dc){if(_0x4771dc[_0xe0c5('0x32')]!=='VIRTUAL'){var _0x540fb9={};_0x540fb9[_0x4771dc[_0xe0c5('0x2e')]]={'$like':'%'+_0x4a8bbc['query'][_0xe0c5('0x42')]+'%'};return _0x540fb9;}})});}_0x5c7f41=_['merge']({},_0x5c7f41,_0x4a8bbc[_0xe0c5('0x43')]);var _0x2c3219={'where':_0x5c7f41[_0xe0c5('0x40')]};return db[_0xe0c5('0x44')][_0xe0c5('0x23')](_0x2c3219)[_0xe0c5('0x2a')](function(_0x542d22){_0x1b6df8[_0xe0c5('0x23')]=_0x542d22;if(_0x4a8bbc['query'][_0xe0c5('0x45')]){_0x5c7f41[_0xe0c5('0x46')]=[{'all':!![]}];}return db[_0xe0c5('0x44')][_0xe0c5('0x47')](_0x5c7f41);})['then'](function(_0x4e9636){_0x1b6df8['rows']=_0x4e9636;return _0x1b6df8;})['then'](respondWithFilteredResult(_0x12453f,_0x5c7f41))['catch'](handleError(_0x12453f,null));};exports[_0xe0c5('0x48')]=function(_0x4920ab,_0x5c7166){var _0x5610e9={'raw':!![],'where':{'id':_0x4920ab[_0xe0c5('0x49')]['id']}},_0x2adb08={};_0x2adb08[_0xe0c5('0x34')]=_[_0xe0c5('0x35')](db[_0xe0c5('0x44')][_0xe0c5('0x4a')]);_0x2adb08[_0xe0c5('0x36')]=_[_0xe0c5('0x35')](_0x4920ab[_0xe0c5('0x36')]);_0x2adb08[_0xe0c5('0x37')]=_[_0xe0c5('0x4b')](_0x2adb08[_0xe0c5('0x34')],_0x2adb08[_0xe0c5('0x36')]);_0x5610e9['attributes']=_[_0xe0c5('0x4b')](_0x2adb08[_0xe0c5('0x34')],qs[_0xe0c5('0x39')](_0x4920ab['query'][_0xe0c5('0x39')]));_0x5610e9['attributes']=_0x5610e9[_0xe0c5('0x38')][_0xe0c5('0x3a')]?_0x5610e9[_0xe0c5('0x38')]:_0x2adb08[_0xe0c5('0x34')];if(_0x4920ab[_0xe0c5('0x36')][_0xe0c5('0x45')]){_0x5610e9['include']=[{'all':!![]}];}_0x5610e9=_['merge']({},_0x5610e9,_0x4920ab['options']);return db[_0xe0c5('0x44')][_0xe0c5('0x4c')](_0x5610e9)[_0xe0c5('0x2a')](handleEntityNotFound(_0x5c7166,null))[_0xe0c5('0x2a')](respondWithResult(_0x5c7166,null))[_0xe0c5('0x4d')](handleError(_0x5c7166,null));};exports[_0xe0c5('0x4e')]=function(_0x57e433,_0x5aa38e){var _0x3228bd={'where':{'id':_0x57e433[_0xe0c5('0x49')]['id']}},_0x17af23={};_0x17af23[_0xe0c5('0x34')]=_['keys'](db[_0xe0c5('0x44')][_0xe0c5('0x4a')]);_0x3228bd[_0xe0c5('0x38')]=_[_0xe0c5('0x4b')](_0x17af23['model'],qs[_0xe0c5('0x39')](_0x57e433[_0xe0c5('0x36')][_0xe0c5('0x39')]));_0x3228bd[_0xe0c5('0x38')]=_0x3228bd[_0xe0c5('0x38')]['length']?_0x3228bd[_0xe0c5('0x38')]:_0x17af23[_0xe0c5('0x34')];if(_0x57e433[_0xe0c5('0x36')][_0xe0c5('0x45')]){_0x3228bd[_0xe0c5('0x46')]=[{'all':!![]}];}_0x3228bd=_[_0xe0c5('0x4f')]({},_0x3228bd,_0x57e433[_0xe0c5('0x43')]);return db[_0xe0c5('0x44')][_0xe0c5('0x4c')](_0x3228bd)[_0xe0c5('0x2a')](handleEntityNotFound(_0x5aa38e,null))[_0xe0c5('0x2a')](function(_0x1e42fe){if(_0x1e42fe){var _0xcc2c62=_0x1e42fe[_0xe0c5('0x50')]({'plain':!![]});_0xcc2c62=qs[_0xe0c5('0x51')](_0xcc2c62,['id',_0xe0c5('0x52'),_0xe0c5('0x53')]);_0x57e433['body']=_[_0xe0c5('0x51')](_0x57e433[_0xe0c5('0x54')],['id',_0xe0c5('0x52'),'updatedAt']);return db[_0xe0c5('0x44')][_0xe0c5('0x55')](_['merge'](_0xcc2c62,_0x57e433[_0xe0c5('0x54')]),{'include':_0x57e433[_0xe0c5('0x36')][_0xe0c5('0x45')]?[{'all':!![]}]:undefined});}})[_0xe0c5('0x2a')](respondWithResult(_0x5aa38e,0xc9))[_0xe0c5('0x4d')](handleError(_0x5aa38e,null));};exports[_0xe0c5('0x29')]=function(_0x1cfeff,_0x510f0d){if(_0x1cfeff['body']['id']){delete _0x1cfeff[_0xe0c5('0x54')]['id'];}return db[_0xe0c5('0x44')][_0xe0c5('0x4c')]({'where':{'id':_0x1cfeff[_0xe0c5('0x49')]['id']}})[_0xe0c5('0x2a')](handleEntityNotFound(_0x510f0d,null))[_0xe0c5('0x2a')](saveUpdates(_0x1cfeff[_0xe0c5('0x54')],null))[_0xe0c5('0x2a')](respondWithResult(_0x510f0d,null))[_0xe0c5('0x4d')](handleError(_0x510f0d,null));};exports['destroy']=function(_0xde88ba,_0x4f1387){return db['Attachment']['find']({'where':{'id':_0xde88ba[_0xe0c5('0x49')]['id']}})[_0xe0c5('0x2a')](handleEntityNotFound(_0x4f1387,null))[_0xe0c5('0x2a')](removeEntity(_0x4f1387,null))[_0xe0c5('0x4d')](handleError(_0x4f1387,null));};exports[_0xe0c5('0x55')]=function(_0x1ae708,_0x38b504,_0x2bf540){_0x1ae708[_0xe0c5('0x54')][_0xe0c5('0x2e')]=_0x1ae708[_0xe0c5('0x56')][_0xe0c5('0x57')];_0x1ae708[_0xe0c5('0x54')]['basename']=_0x1ae708[_0xe0c5('0x56')]['filename'];_0x1ae708[_0xe0c5('0x54')][_0xe0c5('0x32')]=_0x1ae708['file']['mimetype'];return db[_0xe0c5('0x44')][_0xe0c5('0x55')](_0x1ae708[_0xe0c5('0x54')])[_0xe0c5('0x2a')](respondWithResult(_0x38b504,0xc9))['catch'](handleError(_0x38b504,null));};exports['download']=function(_0x74c4db,_0x4925cb,_0x3be766){return db[_0xe0c5('0x44')]['findOne']({'where':{'id':_0x74c4db[_0xe0c5('0x49')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4925cb,null))['then'](function(_0x4f4045){if(_0x4f4045){var _0x4b9147=_0x4f4045[_0xe0c5('0x58')]!==null;var _0x859515=path[_0xe0c5('0x59')](config[_0xe0c5('0x5a')],_0xe0c5('0x5b'));if(_0x4b9147){_0x859515=path[_0xe0c5('0x59')](_0x859515,_0xe0c5('0x5c'));}var _0x40e6b1=path[_0xe0c5('0x59')](_0x859515,_0x4f4045['basename']);return _0x4925cb[_0xe0c5('0x5d')](_0x40e6b1);}})[_0xe0c5('0x4d')](handleError(_0x4925cb,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 83955f0..e23dd2a 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 _0xe352=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','lodash'];(function(_0x38ce4c,_0xfdbe8c){var _0x5d4544=function(_0x503537){while(--_0x503537){_0x38ce4c['push'](_0x38ce4c['shift']());}};_0x5d4544(++_0xfdbe8c);}(_0xe352,0x1ca));var _0x2e35=function(_0x1ec679,_0x242cbb){_0x1ec679=_0x1ec679-0x0;var _0x410733=_0xe352[_0x1ec679];return _0x410733;};'use strict';var _=require(_0x2e35('0x0'));var util=require('util');var logger=require(_0x2e35('0x1'))('api');var moment=require(_0x2e35('0x2'));var BPromise=require('bluebird');var rp=require(_0x2e35('0x3'));var fs=require('fs');var path=require(_0x2e35('0x4'));var rimraf=require(_0x2e35('0x5'));var config=require(_0x2e35('0x6'));var attributes=require(_0x2e35('0x7'));module[_0x2e35('0x8')]=function(_0x1217a2,_0x465af3){return _0x1217a2['define']('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7169=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','Attachment'];(function(_0x1b0fc9,_0x1282b9){var _0x314cc3=function(_0x4f5c4c){while(--_0x4f5c4c){_0x1b0fc9['push'](_0x1b0fc9['shift']());}};_0x314cc3(++_0x1282b9);}(_0x7169,0x197));var _0x9716=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x7169[_0x58afd5];return _0x3e503b;};'use strict';var _=require(_0x9716('0x0'));var util=require(_0x9716('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9716('0x2'));var BPromise=require(_0x9716('0x3'));var rp=require(_0x9716('0x4'));var fs=require('fs');var path=require(_0x9716('0x5'));var rimraf=require(_0x9716('0x6'));var config=require(_0x9716('0x7'));var attributes=require(_0x9716('0x8'));module[_0x9716('0x9')]=function(_0x33ae38,_0x2e83df){return _0x33ae38['define'](_0x9716('0xa'),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 5c3f03b..f62b775 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 _0xe13a=['request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateAttachment','Attachment','body','options','raw','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x639772,_0x19d681){var _0x54da9f=function(_0x1ef32b){while(--_0x1ef32b){_0x639772['push'](_0x639772['shift']());}};_0x54da9f(++_0x19d681);}(_0xe13a,0x178));var _0xae13=function(_0x1e604e,_0x3384af){_0x1e604e=_0x1e604e-0x0;var _0x1383ce=_0xe13a[_0x1e604e];return _0x1383ce;};'use strict';var _=require('lodash');var util=require(_0xae13('0x0'));var moment=require(_0xae13('0x1'));var BPromise=require(_0xae13('0x2'));var rs=require(_0xae13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae13('0x4'))['db'];var utils=require(_0xae13('0x5'));var logger=require(_0xae13('0x6'))(_0xae13('0x7'));var config=require(_0xae13('0x8'));var jayson=require(_0xae13('0x9'));var client=jayson[_0xae13('0xa')][_0xae13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x341ba4,_0x4ae51f,_0x2f6d10){return new BPromise(function(_0x2b2e1f,_0x27fefd){return client[_0xae13('0xc')](_0x341ba4,_0x2f6d10)[_0xae13('0xd')](function(_0x41bf44){logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));logger['debug'](_0xae13('0x11'),_0x4ae51f,_0xae13('0x10'),JSON[_0xae13('0x12')](_0x41bf44));if(_0x41bf44[_0xae13('0x13')]){if(_0x41bf44[_0xae13('0x13')][_0xae13('0x14')]===0x1f4){logger[_0xae13('0x13')]('Attachment,\x20%s,\x20%s',_0x4ae51f,_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);return _0x27fefd(_0x41bf44['error']['message']);}logger['error']('Attachment,\x20%s,\x20%s',_0x4ae51f,_0x41bf44['error'][_0xae13('0x15')]);return _0x2b2e1f(_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);}else{logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));_0x2b2e1f(_0x41bf44['result'][_0xae13('0x15')]);}})['catch'](function(_0xe10aab){logger[_0xae13('0x13')](_0xae13('0xf'),_0x4ae51f,_0xe10aab);_0x27fefd(_0xe10aab);});});}exports[_0xae13('0x16')]=function(_0x1a9c07){var _0x1b33b7=this;return new Promise(function(_0x32dcbe,_0x326471){return db[_0xae13('0x17')]['create'](_0x1a9c07[_0xae13('0x18')],{'raw':_0x1a9c07['options']?_0x1a9c07[_0xae13('0x19')][_0xae13('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x25a195){logger[_0xae13('0xe')](_0xae13('0x16'),_0x1a9c07);logger[_0xae13('0x1b')](_0xae13('0x16'),_0x1a9c07,JSON[_0xae13('0x12')](_0x25a195));_0x32dcbe(_0x25a195);})['catch'](function(_0x520692){logger[_0xae13('0x13')](_0xae13('0x16'),_0x520692['message'],_0x1a9c07);_0x326471(_0x1b33b7[_0xae13('0x13')](0x1f4,_0x520692['message']));});});};
\ No newline at end of file
+var _0x9221=['jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','Attachment','options','raw','then','CreateAttachment','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1ae663,_0x17c8d2){var _0x2e576b=function(_0x4ec93a){while(--_0x4ec93a){_0x1ae663['push'](_0x1ae663['shift']());}};_0x2e576b(++_0x17c8d2);}(_0x9221,0x64));var _0x1922=function(_0x9fce47,_0x38c3e6){_0x9fce47=_0x9fce47-0x0;var _0x29e671=_0x9221[_0x9fce47];return _0x29e671;};'use strict';var _=require('lodash');var util=require(_0x1922('0x0'));var moment=require(_0x1922('0x1'));var BPromise=require('bluebird');var rs=require(_0x1922('0x2'));var fs=require('fs');var Redis=require(_0x1922('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1922('0x4'));var logger=require(_0x1922('0x5'))(_0x1922('0x6'));var config=require(_0x1922('0x7'));var jayson=require(_0x1922('0x8'));var client=jayson[_0x1922('0x9')][_0x1922('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5aa05c,_0x116227,_0x3cfd98){return new BPromise(function(_0x195fa4,_0x47c225){return client[_0x1922('0xb')](_0x5aa05c,_0x3cfd98)['then'](function(_0x2b6c51){logger[_0x1922('0xc')](_0x1922('0xd'),_0x116227,'request\x20sent');logger[_0x1922('0xe')](_0x1922('0xf'),_0x116227,'request\x20sent',JSON[_0x1922('0x10')](_0x2b6c51));if(_0x2b6c51['error']){if(_0x2b6c51[_0x1922('0x11')]['code']===0x1f4){logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x2b6c51[_0x1922('0x11')]['message']);return _0x47c225(_0x2b6c51['error'][_0x1922('0x12')]);}logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x2b6c51[_0x1922('0x11')][_0x1922('0x12')]);return _0x195fa4(_0x2b6c51['error'][_0x1922('0x12')]);}else{logger['info'](_0x1922('0xd'),_0x116227,_0x1922('0x13'));_0x195fa4(_0x2b6c51[_0x1922('0x14')][_0x1922('0x12')]);}})['catch'](function(_0x459511){logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x459511);_0x47c225(_0x459511);});});}exports['CreateAttachment']=function(_0x482f68){var _0x372875=this;return new Promise(function(_0x51acda,_0x3c6f9a){return db[_0x1922('0x15')]['create'](_0x482f68['body'],{'raw':_0x482f68[_0x1922('0x16')]?_0x482f68['options'][_0x1922('0x17')]===undefined?!![]:![]:!![]})[_0x1922('0x18')](function(_0x1fb6a4){logger[_0x1922('0xc')]('CreateAttachment',_0x482f68);logger[_0x1922('0xe')](_0x1922('0x19'),_0x482f68,JSON[_0x1922('0x10')](_0x1fb6a4));_0x51acda(_0x1fb6a4);})[_0x1922('0x1a')](function(_0x554f8b){logger[_0x1922('0x11')](_0x1922('0x19'),_0x554f8b[_0x1922('0x12')],_0x482f68);_0x3c6f9a(_0x372875['error'](0x1f4,_0x554f8b[_0x1922('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 9bd8853..3c9c686 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x1f7294,_0x1f5fe6){var _0x557fbd=function(_0x547403){while(--_0x547403){_0x1f7294['push'](_0x1f7294['shift']());}};_0x557fbd(++_0x1f5fe6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4962ca,_0x48d6b8){_0x4962ca=_0x4962ca-0x0;var _0x40bd29=_0x5f2f[_0x4962ca];return _0x40bd29;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index d4fa508..5c47f7a 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 _0xac4e=['online','admin','user','add','minutes','getLicense','catch','status','send','message','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','use','passport','passport-local','Strategy','moment','bluebird','util','../../components/auth/service','../../config/environment','api','activedirectory','undefined','url','domain','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled','blocked','blockedAt'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xac4e,0x19a));var _0xeac4=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xac4e[_0x501510];return _0x1e6ee5;};'use strict';var passport=require(_0xeac4('0x0'));var LocalStrategy=require(_0xeac4('0x1'))[_0xeac4('0x2')];var moment=require(_0xeac4('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xeac4('0x4'));var util=require(_0xeac4('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xeac4('0x6'));var utils=require('../../config/utils');var config=require(_0xeac4('0x7'));var logger=require('../../config/logger')(_0xeac4('0x8'));function isActiveDirectoryConfigured(_0x47f5dc){var _0xdef2ab=![];if(typeof _0x47f5dc[_0xeac4('0x9')]!==_0xeac4('0xa')){_0xdef2ab=_0x47f5dc[_0xeac4('0x9')]['baseDN']&&_0x47f5dc['activedirectory'][_0xeac4('0xb')]&&_0x47f5dc[_0xeac4('0x9')][_0xeac4('0xc')];}return _0xdef2ab;}function adAuthenticate(_0x155082,_0xbe5ebf,_0x25a4c6){return new BPromise(function(_0x5a8a84,_0x52ac02){try{var _0x34d87d=new ActiveDirectory(_0x155082);_0x34d87d['authenticate'](_0xbe5ebf,_0x25a4c6,function(_0x16a868,_0x11b95a){if(_0x16a868){logger['error'](_0xeac4('0xd'),_0xbe5ebf,util[_0xeac4('0xe')](_0x16a868,{'showHidden':![],'depth':null}));_0x52ac02(_0xeac4('0xf'));}else if(!_0x11b95a){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0xbe5ebf);_0x52ac02('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5a8a84(_0x11b95a);}});}catch(_0x2900f7){_0x52ac02(_0x2900f7);}});}function ActiveDirectoryAuthenticate(_0x6b3769,_0x5ed1d0,_0x11d7d7,_0x39ade2){var _0x13b59a,_0xa5a5e7;if(!isActiveDirectoryConfigured(config)){logger[_0xeac4('0x10')](_0xeac4('0x11'),_0x5ed1d0);return _0x39ade2(null,![],{'message':_0xeac4('0xf')});}return db[_0xeac4('0x12')][_0xeac4('0x13')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xeac4('0x14')],'raw':!![]})[_0xeac4('0x15')](function(_0x38af0e){_0x13b59a=_0x38af0e;if(!_0x13b59a[_0xeac4('0x16')]){logger['error'](_0xeac4('0x17'),_0x5ed1d0);throw new Error(_0xeac4('0xf'));}return _0x6b3769[_0xeac4('0x13')]({'attributes':['id',_0xeac4('0x18'),_0xeac4('0x19'),'salt',_0xeac4('0x1a'),_0xeac4('0x1b'),_0xeac4('0x1c'),_0xeac4('0x1d'),_0xeac4('0x1e')],'where':{'name':_0x5ed1d0,'role':{'$or':[_0xeac4('0x1f'),_0xeac4('0x20'),'agent']},'adSsoEnabled':!![]}});})[_0xeac4('0x15')](function(_0x91fed7){if(!_0x91fed7||_0x91fed7&&_0x91fed7[_0xeac4('0x18')]!==_0x5ed1d0){throw new Error(_0xeac4('0xf'));}_0xa5a5e7=_0x91fed7;var _0x256298=_0xa5a5e7[_0xeac4('0x18')]+'@'+config[_0xeac4('0x9')]['domain'];return adAuthenticate(config[_0xeac4('0x9')],_0x256298,_0x11d7d7);})[_0xeac4('0x15')](function(_0x5f5c10){if(_0xa5a5e7[_0xeac4('0x1b')]){throw new Error(_0xeac4('0xf'));}if(_0x13b59a['blockDuration']>0x0){if(_0xa5a5e7[_0xeac4('0x1c')]){if(moment(_0xa5a5e7['blockedAt'])[_0xeac4('0x21')](_0x13b59a[_0xeac4('0x14')],_0xeac4('0x22'))>moment()){throw new Error(_0xeac4('0xf'));}return utils['clearBlockUser'](_0xa5a5e7,0x0,![],null)['then'](function(){return utils['getLicense'](_0xa5a5e7);})[_0xeac4('0x15')](function(){return _0x39ade2(null,_0xa5a5e7);});}else{return utils[_0xeac4('0x23')](_0xa5a5e7)[_0xeac4('0x15')](function(){return _0x39ade2(null,_0xa5a5e7);});}}else{return utils[_0xeac4('0x23')](_0xa5a5e7)['then'](function(){return _0x39ade2(null,_0xa5a5e7);});}})[_0xeac4('0x24')](function(_0x5c6a09){return _0x39ade2(null,![],_0x5c6a09);});}function handleError(_0x119f3f,_0x102930,_0xcd25ee){return _0x119f3f[_0xeac4('0x25')](_0x102930||0x1f4)[_0xeac4('0x26')]({'message':_0xcd25ee?_0xcd25ee[_0xeac4('0x27')]||_0xcd25ee:''});}exports['login']=function(_0x53d2ef,_0x14f533,_0x1831a8){passport[_0xeac4('0x28')](_0xeac4('0x29'),function(_0x1d81f3,_0x4c62e1,_0x524c2d){var _0x439c77=_0x1d81f3||_0x524c2d;if(_0x439c77){return handleError(_0x14f533,0x191,_0x439c77);}if(!_0x4c62e1){return handleError(_0x14f533,0x194,{'message':_0xeac4('0x2a')});}else{var _0x51d9c9={'payload':{'id':_0x4c62e1['id'],'role':_0x4c62e1['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x51d9c9)[_0xeac4('0x15')](function(_0x4f051a){_0x14f533['json']({'id':_0x4c62e1['id'],'token':_0x4f051a,'statusCall':'','isAlreadyLogged':_0x4c62e1[_0xeac4('0x1e')]});});}})(_0x53d2ef,_0x14f533,_0x1831a8);};passport[_0xeac4('0x2b')](_0xeac4('0x29'),new LocalStrategy({'usernameField':_0xeac4('0x18'),'passwordField':'password'},function(_0x3128fc,_0x552bb0,_0x2f978){return ActiveDirectoryAuthenticate(db['User'],_0x3128fc,_0x552bb0,_0x2f978);}));
\ No newline at end of file
+var _0xa391=['bluebird','../../mysqldb','../../components/auth/service','../../config/utils','activedirectory','baseDN','url','domain','error','Error\x20authenticate\x20%s:\x20%s','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','password','salt','disabled','blocked','blockedAt','online','admin','user','agent','name','add','minutes','clearBlockUser','getLicense','catch','status','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','ad-login','User','passport-local','moment','activedirectory2'];(function(_0x5d6046,_0x12e649){var _0x5de9d5=function(_0x1a6045){while(--_0x1a6045){_0x5d6046['push'](_0x5d6046['shift']());}};_0x5de9d5(++_0x12e649);}(_0xa391,0x138));var _0x1a39=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xa391[_0x1d1779];return _0x2377e9;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x1a39('0x0'))['Strategy'];var moment=require(_0x1a39('0x1'));var ActiveDirectory=require(_0x1a39('0x2'));var BPromise=require(_0x1a39('0x3'));var util=require('util');var db=require(_0x1a39('0x4'))['db'];var authService=require(_0x1a39('0x5'));var utils=require(_0x1a39('0x6'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x177375){var _0x4240ce=![];if(typeof _0x177375[_0x1a39('0x7')]!=='undefined'){_0x4240ce=_0x177375[_0x1a39('0x7')][_0x1a39('0x8')]&&_0x177375[_0x1a39('0x7')][_0x1a39('0x9')]&&_0x177375[_0x1a39('0x7')][_0x1a39('0xa')];}return _0x4240ce;}function adAuthenticate(_0x1cb66f,_0x30d2d5,_0x411e36){return new BPromise(function(_0x301673,_0xedd5fe){try{var _0x4d8b99=new ActiveDirectory(_0x1cb66f);_0x4d8b99['authenticate'](_0x30d2d5,_0x411e36,function(_0xf8a776,_0x3910b2){if(_0xf8a776){logger[_0x1a39('0xb')](_0x1a39('0xc'),_0x30d2d5,util['inspect'](_0xf8a776,{'showHidden':![],'depth':null}));_0xedd5fe('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x3910b2){logger[_0x1a39('0xb')](_0x1a39('0xd'),_0x30d2d5);_0xedd5fe(_0x1a39('0xe'));}else{_0x301673(_0x3910b2);}});}catch(_0x4abc8c){_0xedd5fe(_0x4abc8c);}});}function ActiveDirectoryAuthenticate(_0x15e573,_0x1f7641,_0x5a7858,_0x4c33e2){var _0x37c323,_0x538343;if(!isActiveDirectoryConfigured(config)){logger[_0x1a39('0xb')](_0x1a39('0xf'),_0x1f7641);return _0x4c33e2(null,![],{'message':_0x1a39('0xe')});}return db[_0x1a39('0x10')]['findOne']({'where':{'id':0x1},'attributes':[_0x1a39('0x11'),_0x1a39('0x12')],'raw':!![]})[_0x1a39('0x13')](function(_0x16703c){_0x37c323=_0x16703c;if(!_0x37c323[_0x1a39('0x11')]){logger[_0x1a39('0xb')](_0x1a39('0x14'),_0x1f7641);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x15e573[_0x1a39('0x15')]({'attributes':['id','name',_0x1a39('0x16'),_0x1a39('0x17'),'role',_0x1a39('0x18'),_0x1a39('0x19'),_0x1a39('0x1a'),_0x1a39('0x1b')],'where':{'name':_0x1f7641,'role':{'$or':[_0x1a39('0x1c'),_0x1a39('0x1d'),_0x1a39('0x1e')]},'adSsoEnabled':!![]}});})[_0x1a39('0x13')](function(_0x3a0d9b){if(!_0x3a0d9b||_0x3a0d9b&&_0x3a0d9b[_0x1a39('0x1f')]!==_0x1f7641){throw new Error(_0x1a39('0xe'));}_0x538343=_0x3a0d9b;var _0x54802d=_0x538343[_0x1a39('0x1f')]+'@'+config[_0x1a39('0x7')][_0x1a39('0xa')];return adAuthenticate(config[_0x1a39('0x7')],_0x54802d,_0x5a7858);})[_0x1a39('0x13')](function(_0x49d5f7){if(_0x538343['disabled']){throw new Error(_0x1a39('0xe'));}if(_0x37c323[_0x1a39('0x12')]>0x0){if(_0x538343[_0x1a39('0x19')]){if(moment(_0x538343[_0x1a39('0x1a')])[_0x1a39('0x20')](_0x37c323[_0x1a39('0x12')],_0x1a39('0x21'))>moment()){throw new Error(_0x1a39('0xe'));}return utils[_0x1a39('0x22')](_0x538343,0x0,![],null)[_0x1a39('0x13')](function(){return utils[_0x1a39('0x23')](_0x538343);})[_0x1a39('0x13')](function(){return _0x4c33e2(null,_0x538343);});}else{return utils[_0x1a39('0x23')](_0x538343)[_0x1a39('0x13')](function(){return _0x4c33e2(null,_0x538343);});}}else{return utils[_0x1a39('0x23')](_0x538343)[_0x1a39('0x13')](function(){return _0x4c33e2(null,_0x538343);});}})[_0x1a39('0x24')](function(_0x4c7ec7){return _0x4c33e2(null,![],_0x4c7ec7);});}function handleError(_0x3ef016,_0xc05151,_0x23fed5){return _0x3ef016[_0x1a39('0x25')](_0xc05151||0x1f4)['send']({'message':_0x23fed5?_0x23fed5['message']||_0x23fed5:''});}exports[_0x1a39('0x26')]=function(_0x5f549c,_0x5ddc8d,_0x34b345){passport[_0x1a39('0x27')]('ad-login',function(_0x134b36,_0xc0bee5,_0x2f67ec){var _0x423fd7=_0x134b36||_0x2f67ec;if(_0x423fd7){return handleError(_0x5ddc8d,0x191,_0x423fd7);}if(!_0xc0bee5){return handleError(_0x5ddc8d,0x194,{'message':_0x1a39('0x28')});}else{var _0x5c909a={'payload':{'id':_0xc0bee5['id'],'role':_0xc0bee5[_0x1a39('0x29')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5c909a)[_0x1a39('0x13')](function(_0x100947){_0x5ddc8d[_0x1a39('0x2a')]({'id':_0xc0bee5['id'],'token':_0x100947,'statusCall':'','isAlreadyLogged':_0xc0bee5[_0x1a39('0x1b')]});});}})(_0x5f549c,_0x5ddc8d,_0x34b345);};passport['use'](_0x1a39('0x2b'),new LocalStrategy({'usernameField':_0x1a39('0x1f'),'passwordField':_0x1a39('0x16')},function(_0x167245,_0x5dc0ea,_0x1fafe4){return ActiveDirectoryAuthenticate(db[_0x1a39('0x2c')],_0x167245,_0x5dc0ea,_0x1fafe4);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 85306c3..6dad782 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 _0xeb0c=['express','Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x3be081,_0x1a0666){var _0x2ff0d8=function(_0x7572e6){while(--_0x7572e6){_0x3be081['push'](_0x3be081['shift']());}};_0x2ff0d8(++_0x1a0666);}(_0xeb0c,0x1ec));var _0xceb0=function(_0x43a6cd,_0x503d1a){_0x43a6cd=_0x43a6cd-0x0;var _0x5acb36=_0xeb0c[_0x43a6cd];return _0x5acb36;};'use strict';var express=require(_0xceb0('0x0'));var router=express[_0xceb0('0x1')]();var controller=require(_0xceb0('0x2'));router[_0xceb0('0x3')]('/',controller[_0xceb0('0x4')]);module[_0xceb0('0x5')]=router;
\ No newline at end of file
+var _0x38c3=['Router','./authActiveDirectory.controller','post','exports'];(function(_0x53dbbb,_0x302838){var _0x6c293c=function(_0x37e675){while(--_0x37e675){_0x53dbbb['push'](_0x53dbbb['shift']());}};_0x6c293c(++_0x302838);}(_0x38c3,0x94));var _0x338c=function(_0x39d518,_0x32b600){_0x39d518=_0x39d518-0x0;var _0x2feade=_0x38c3[_0x39d518];return _0x2feade;};'use strict';var express=require('express');var router=express[_0x338c('0x0')]();var controller=require(_0x338c('0x1'));router[_0x338c('0x2')]('/',controller['login']);module[_0x338c('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 1f8d946..4c1cc06 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(_0x1b725c,_0x150300){var _0x24e08c=function(_0x3688dd){while(--_0x3688dd){_0x1b725c['push'](_0x1b725c['shift']());}};_0x24e08c(++_0x150300);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x7a54,0x106));var _0x47a5=function(_0x3f5cc6,_0x499845){_0x3f5cc6=_0x3f5cc6-0x0;var _0x4a2052=_0x7a54[_0x3f5cc6];return _0x4a2052;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 6a2d127..bbdfd63 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 _0x2d05=['Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','isMiddleware','setTokenCookie','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d05,0x144));var _0x52d0=function(_0x1286c7,_0x443a6b){_0x1286c7=_0x1286c7-0x0;var _0x9331ca=_0x2d05[_0x1286c7];return _0x9331ca;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0x52d0('0x0')]();var controller=require(_0x52d0('0x1'));var userController=require(_0x52d0('0x2'));var authService=require(_0x52d0('0x3'));router[_0x52d0('0x4')]('/',controller[_0x52d0('0x5')]);router[_0x52d0('0x4')]('/callback',controller['callback'],authService[_0x52d0('0x6')],userController[_0x52d0('0x5')],authService[_0x52d0('0x7')]);module[_0x52d0('0x8')]=router;
\ No newline at end of file
+var _0x96b7=['../../components/auth/service','login','get','callback','exports','express','passport','Router','./authGoogle.controller'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0x96b7,0x149));var _0x796b=function(_0x3984a6,_0x4adaba){_0x3984a6=_0x3984a6-0x0;var _0x2cc75f=_0x96b7[_0x3984a6];return _0x2cc75f;};'use strict';var express=require(_0x796b('0x0'));var passport=require(_0x796b('0x1'));var router=express[_0x796b('0x2')]();var controller=require(_0x796b('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x796b('0x4'));router['get']('/',controller[_0x796b('0x5')]);router[_0x796b('0x6')]('/callback',controller[_0x796b('0x7')],authService['isMiddleware'],userController['login'],authService['setTokenCookie']);module[_0x796b('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 b07c854..5ee4e20 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 _0xeaa3=['previousPasswords','validatePasswordHistory','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','client','findOne','allowedLoginAttempts','blockDuration','then','salt','role','blocked','blockedAt','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','disabled','add','minutes','clearBlockUser','getLicense','catch','find','email','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','local-login','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeaa3,0x1a8));var _0x3eaa=function(_0x4da56f,_0x2be505){_0x4da56f=_0x4da56f-0x0;var _0x2fd5ab=_0xeaa3[_0x4da56f];return _0x2fd5ab;};'use strict';var util=require('util');var passport=require(_0x3eaa('0x0'));var LocalStrategy=require(_0x3eaa('0x1'))[_0x3eaa('0x2')];var jayson=require(_0x3eaa('0x3'));var _=require(_0x3eaa('0x4'));var rs=require('randomstring');var moment=require(_0x3eaa('0x5'));var db=require(_0x3eaa('0x6'))['db'];var authService=require(_0x3eaa('0x7'));var utils=require('../../config/utils');var client=jayson[_0x3eaa('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x2a52b6,_0x1740ec,_0x5a10e9,_0x34d36d){var _0x9e0ba0,_0x35dc07;return db['Setting'][_0x3eaa('0x9')]({'where':{'id':0x1},'attributes':[_0x3eaa('0xa'),_0x3eaa('0xb')],'raw':!![]})[_0x3eaa('0xc')](function(_0x2e7130){_0x9e0ba0=_0x2e7130;return _0x2a52b6[_0x3eaa('0x9')]({'attributes':['id','name','password',_0x3eaa('0xd'),_0x3eaa('0xe'),'disabled',_0x3eaa('0xf'),_0x3eaa('0x10'),'loginAttempts'],'where':{'name':_0x1740ec,'role':{'$or':[_0x3eaa('0x11'),_0x3eaa('0x12'),_0x3eaa('0x13')]}}});})[_0x3eaa('0xc')](function(_0x3b5b8c){if(!_0x3b5b8c||_0x3b5b8c&&_0x3b5b8c[_0x3eaa('0x14')]!==_0x1740ec){throw new Error(_0x3eaa('0x15'));}else{_0x35dc07=_0x3b5b8c;return _0x35dc07;}})[_0x3eaa('0xc')](function(){_0x35dc07[_0x3eaa('0x16')](_0x5a10e9,function(_0x51db2c,_0x1e1614){var _0x5d0700=_0x35dc07[_0x3eaa('0x17')]+0x1;if(_0x51db2c){return _0x34d36d(_0x51db2c);}else if(!_0x1e1614){if(_0x35dc07[_0x3eaa('0x18')]){return _0x34d36d(null,![],{'message':_0x3eaa('0x15')});}else if(_0x9e0ba0['allowedLoginAttempts']>0x0){if(_0x35dc07['blocked']){if(_0x9e0ba0[_0x3eaa('0xb')]>0x0){if(moment(_0x35dc07[_0x3eaa('0x10')])[_0x3eaa('0x19')](_0x9e0ba0['blockDuration'],_0x3eaa('0x1a'))>moment()){return _0x34d36d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3eaa('0x1b')](_0x35dc07,_0x5d0700,![],null)['then'](function(){return _0x34d36d(null,![],{'message':_0x3eaa('0x15')});});}}else{return _0x34d36d(null,![],{'message':_0x3eaa('0x15')});}}else{if(_0x5d0700>=_0x9e0ba0[_0x3eaa('0xa')]){return utils['clearBlockUser'](_0x35dc07,0x0,!![],moment())[_0x3eaa('0xc')](function(){return _0x34d36d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x35dc07,_0x5d0700,![],null)[_0x3eaa('0xc')](function(){return _0x34d36d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x34d36d(null,![],{'message':_0x3eaa('0x15')});}}else{if(_0x35dc07[_0x3eaa('0x18')]){return _0x34d36d(null,![],{'message':_0x3eaa('0x15')});}else if(_0x9e0ba0[_0x3eaa('0xa')]>0x0){if(_0x35dc07[_0x3eaa('0xf')]){if(_0x9e0ba0[_0x3eaa('0xb')]>0x0){if(moment(_0x35dc07[_0x3eaa('0x10')])[_0x3eaa('0x19')](_0x9e0ba0[_0x3eaa('0xb')],_0x3eaa('0x1a'))>moment()){return _0x34d36d(null,![],{'message':_0x3eaa('0x15')});}else{return utils[_0x3eaa('0x1b')](_0x35dc07,0x0,![],null)[_0x3eaa('0xc')](function(){return utils[_0x3eaa('0x1c')](_0x35dc07);})[_0x3eaa('0xc')](function(){return _0x34d36d(null,_0x35dc07);});}}else{return _0x34d36d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x3eaa('0x1b')](_0x35dc07,0x0,![],null)[_0x3eaa('0xc')](function(){return utils['getLicense'](_0x35dc07);})[_0x3eaa('0xc')](function(){return _0x34d36d(null,_0x35dc07);})['catch'](function(_0x52217a){return _0x34d36d(null,![],_0x52217a);});}}else{if(_0x35dc07[_0x3eaa('0xf')]){return _0x34d36d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x35dc07)[_0x3eaa('0xc')](function(){return _0x34d36d(null,_0x35dc07);});}}}});})[_0x3eaa('0x1d')](function(_0x597e23){return _0x34d36d(null,![],_0x597e23);});}function sendServiceMail(_0x341fab){return db['MailAccount'][_0x3eaa('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x3eaa('0x14'),_0x3eaa('0x1f')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x3eaa('0x20')],'as':'CloudProvider'}]}]})[_0x3eaa('0xc')](function(_0x3b7b16){if(!_0x3b7b16){throw new Error(_0x3eaa('0x21'));}var _0x10acac=_0x3b7b16['getSmtpOptions']();var _0xa4359a={'account':_0x10acac,'message':_[_0x3eaa('0x22')]({'from':util[_0x3eaa('0x23')](_0x3eaa('0x24'),_0x3b7b16[_0x3eaa('0x14')],_0x3b7b16[_0x3eaa('0x1f')]||_0x3b7b16[_0x3eaa('0x25')][_0x3eaa('0x12')])},_0x341fab)};return client[_0x3eaa('0x26')](_0x3eaa('0x27'),_0xa4359a);})[_0x3eaa('0xc')](function(_0x1905df){if(_0x1905df[_0x3eaa('0x28')]){throw new Error(util[_0x3eaa('0x23')](_0x3eaa('0x29'),_0x1905df[_0x3eaa('0x28')]['message']||JSON[_0x3eaa('0x2a')](_0x1905df[_0x3eaa('0x28')])));}return!![];});}function handleError(_0x2afaed,_0x4d5048,_0x2f351c){return _0x2afaed[_0x3eaa('0x2b')](_0x4d5048||0x1f4)[_0x3eaa('0x2c')]({'message':_0x2f351c?_0x2f351c[_0x3eaa('0x2d')]||_0x2f351c:''});}exports[_0x3eaa('0x2e')]=function(_0x43f7ec,_0x468346,_0x5da94e){passport[_0x3eaa('0x16')](_0x3eaa('0x2f'),function(_0x496a2c,_0x3ae08b,_0x3ba143){var _0x33526a=_0x496a2c||_0x3ba143;if(_0x33526a){return handleError(_0x468346,0x191,_0x33526a);}if(!_0x3ae08b){return handleError(_0x468346,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xad6629={'payload':{'id':_0x3ae08b['id'],'role':_0x3ae08b[_0x3eaa('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x3eaa('0x30')](_0xad6629)[_0x3eaa('0xc')](function(_0x2f61a2){_0x468346[_0x3eaa('0x31')]({'id':_0x3ae08b['id'],'token':_0x2f61a2,'statusCall':'','isAlreadyLogged':_0x3ae08b[_0x3eaa('0x32')]});});}})(_0x43f7ec,_0x468346,_0x5da94e);};exports[_0x3eaa('0x33')]=function(_0x447049,_0x4af8ea){if(!_0x447049[_0x3eaa('0x34')]['email']){return handleError(_0x4af8ea,0x1f4,{'message':_0x3eaa('0x35')});}var _0x3e901c=rs['generate']();_0x447049[_0x3eaa('0x34')]['email']=_0x447049[_0x3eaa('0x34')][_0x3eaa('0x1f')][_0x3eaa('0x36')]()[_0x3eaa('0x37')]();var _0x55ab35;return db[_0x3eaa('0x38')][_0x3eaa('0x9')]({'where':{'id':0x1},'attributes':[_0x3eaa('0xa'),_0x3eaa('0xb')],'raw':!![]})['then'](function(_0x2f8c04){_0x55ab35=_0x2f8c04;return db[_0x3eaa('0x39')][_0x3eaa('0x1e')]({'where':{'email':_0x447049[_0x3eaa('0x34')]['email']}});})[_0x3eaa('0xc')](function(_0x1ad1c8){if(!_0x1ad1c8){throw new Error(_0x3eaa('0x3a'));}if(_0x1ad1c8[_0x3eaa('0x18')]){throw new Error(_0x3eaa('0x3b'));}if(_0x1ad1c8[_0x3eaa('0xf')]){if(moment(_0x1ad1c8['blockedAt'])[_0x3eaa('0x19')](_0x55ab35[_0x3eaa('0xb')],_0x3eaa('0x1a'))>moment()){throw new Error(_0x3eaa('0x3c'));}else{_0x1ad1c8[_0x3eaa('0xf')]=![];_0x1ad1c8[_0x3eaa('0x10')]=null;}}_0x1ad1c8[_0x3eaa('0x3d')]=_0x3e901c;_0x1ad1c8[_0x3eaa('0x3e')]=Date['now']()+0x36ee80;return _0x1ad1c8[_0x3eaa('0x3f')]();})[_0x3eaa('0xc')](function(){return sendServiceMail({'to':_0x447049[_0x3eaa('0x34')][_0x3eaa('0x1f')],'subject':_0x3eaa('0x40'),'text':_0x3eaa('0x41')+_0x3eaa('0x42')+_0x3eaa('0x43')+_0x447049[_0x3eaa('0x44')][_0x3eaa('0x45')]+_0x3eaa('0x46')+_0x3e901c+'\x0a\x0a'+_0x3eaa('0x47')});})[_0x3eaa('0xc')](function(){_0x4af8ea[_0x3eaa('0x2b')](0xc8)['send']({'message':_0x3eaa('0x48')});})['catch'](function(_0xeacc28){return handleError(_0x4af8ea,0x1f4,_0xeacc28);});};exports['reset']=function(_0x182c7c,_0x1ce15e){return db['User'][_0x3eaa('0x1e')]({'where':{'resetPasswordToken':_0x182c7c[_0x3eaa('0x49')]['token'],'resetPasswordExpires':{'$gt':Date[_0x3eaa('0x4a')]()}}})['then'](function(_0x239bf6){if(!_0x239bf6){throw new Error(_0x3eaa('0x4b'));}return db['Setting']['findOne']({'attributes':['id',_0x3eaa('0x4c'),_0x3eaa('0x4d'),_0x3eaa('0x4e')]})[_0x3eaa('0xc')](function(_0x38fd01){if(_0x38fd01[_0x3eaa('0x4c')])authService['validatePasswordPattern'](_0x182c7c[_0x3eaa('0x34')][_0x3eaa('0x4f')]);if(!_0x38fd01[_0x3eaa('0x4d')]||!_0x239bf6[_0x3eaa('0x50')])return _0x239bf6;authService[_0x3eaa('0x51')](_0x182c7c[_0x3eaa('0x34')][_0x3eaa('0x4f')],_0x239bf6[_0x3eaa('0x50')],_0x38fd01['passwordHistoryLimit']);return _0x239bf6;})[_0x3eaa('0xc')](function(){_0x239bf6[_0x3eaa('0x4f')]=_0x182c7c[_0x3eaa('0x34')][_0x3eaa('0x4f')];_0x239bf6['resetPasswordToken']=null;_0x239bf6['resetPasswordExpires']=null;return _0x239bf6[_0x3eaa('0x3f')]();});})[_0x3eaa('0xc')](function(){_0x1ce15e['status'](0xc8)[_0x3eaa('0x2c')]({'message':_0x3eaa('0x52')});})[_0x3eaa('0x1d')](function(_0x33deba){return handleError(_0x1ce15e,0x1f4,_0x33deba);});};passport[_0x3eaa('0x53')](_0x3eaa('0x2f'),new LocalStrategy({'usernameField':_0x3eaa('0x14'),'passwordField':'password'},function(_0x70f250,_0x310062,_0x15aac4){return localAuthenticate(db['User'],_0x70f250,_0x310062,_0x15aac4);}));
\ No newline at end of file
+var _0xffc2=['MailAccount','find','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','format','email','user','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../config/utils','http','Setting','findOne','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','agent','authenticate','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0xffc2,0x7e));var _0x2ffc=function(_0xc9cd47,_0x35a546){_0xc9cd47=_0xc9cd47-0x0;var _0x26827e=_0xffc2[_0xc9cd47];return _0x26827e;};'use strict';var util=require(_0x2ffc('0x0'));var passport=require(_0x2ffc('0x1'));var LocalStrategy=require(_0x2ffc('0x2'))[_0x2ffc('0x3')];var jayson=require(_0x2ffc('0x4'));var _=require(_0x2ffc('0x5'));var rs=require('randomstring');var moment=require(_0x2ffc('0x6'));var db=require(_0x2ffc('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x2ffc('0x8'));var client=jayson['client'][_0x2ffc('0x9')]({'port':0x232b});function localAuthenticate(_0x5c5117,_0x397b9f,_0x3bce48,_0x4c9028){var _0x4939d5,_0xde2b5f;return db[_0x2ffc('0xa')][_0x2ffc('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x2ffc('0xc')],'raw':!![]})[_0x2ffc('0xd')](function(_0x465458){_0x4939d5=_0x465458;return _0x5c5117[_0x2ffc('0xb')]({'attributes':['id',_0x2ffc('0xe'),_0x2ffc('0xf'),_0x2ffc('0x10'),_0x2ffc('0x11'),_0x2ffc('0x12'),_0x2ffc('0x13'),_0x2ffc('0x14'),'loginAttempts'],'where':{'name':_0x397b9f,'role':{'$or':[_0x2ffc('0x15'),'user',_0x2ffc('0x16')]}}});})['then'](function(_0xefa6a3){if(!_0xefa6a3||_0xefa6a3&&_0xefa6a3[_0x2ffc('0xe')]!==_0x397b9f){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xde2b5f=_0xefa6a3;return _0xde2b5f;}})['then'](function(){_0xde2b5f[_0x2ffc('0x17')](_0x3bce48,function(_0x3f65da,_0x447f5d){var _0x3bce4c=_0xde2b5f[_0x2ffc('0x18')]+0x1;if(_0x3f65da){return _0x4c9028(_0x3f65da);}else if(!_0x447f5d){if(_0xde2b5f[_0x2ffc('0x12')]){return _0x4c9028(null,![],{'message':_0x2ffc('0x19')});}else if(_0x4939d5[_0x2ffc('0x1a')]>0x0){if(_0xde2b5f[_0x2ffc('0x13')]){if(_0x4939d5[_0x2ffc('0xc')]>0x0){if(moment(_0xde2b5f[_0x2ffc('0x14')])[_0x2ffc('0x1b')](_0x4939d5['blockDuration'],_0x2ffc('0x1c'))>moment()){return _0x4c9028(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x2ffc('0x1d')](_0xde2b5f,_0x3bce4c,![],null)[_0x2ffc('0xd')](function(){return _0x4c9028(null,![],{'message':_0x2ffc('0x19')});});}}else{return _0x4c9028(null,![],{'message':_0x2ffc('0x19')});}}else{if(_0x3bce4c>=_0x4939d5[_0x2ffc('0x1a')]){return utils[_0x2ffc('0x1d')](_0xde2b5f,0x0,!![],moment())[_0x2ffc('0xd')](function(){return _0x4c9028(null,![],{'message':_0x2ffc('0x19')});});}else{return utils[_0x2ffc('0x1d')](_0xde2b5f,_0x3bce4c,![],null)[_0x2ffc('0xd')](function(){return _0x4c9028(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x4c9028(null,![],{'message':_0x2ffc('0x19')});}}else{if(_0xde2b5f['disabled']){return _0x4c9028(null,![],{'message':_0x2ffc('0x19')});}else if(_0x4939d5[_0x2ffc('0x1a')]>0x0){if(_0xde2b5f[_0x2ffc('0x13')]){if(_0x4939d5['blockDuration']>0x0){if(moment(_0xde2b5f[_0x2ffc('0x14')])['add'](_0x4939d5[_0x2ffc('0xc')],_0x2ffc('0x1c'))>moment()){return _0x4c9028(null,![],{'message':_0x2ffc('0x19')});}else{return utils[_0x2ffc('0x1d')](_0xde2b5f,0x0,![],null)[_0x2ffc('0xd')](function(){return utils[_0x2ffc('0x1e')](_0xde2b5f);})['then'](function(){return _0x4c9028(null,_0xde2b5f);});}}else{return _0x4c9028(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0xde2b5f,0x0,![],null)[_0x2ffc('0xd')](function(){return utils[_0x2ffc('0x1e')](_0xde2b5f);})[_0x2ffc('0xd')](function(){return _0x4c9028(null,_0xde2b5f);})[_0x2ffc('0x1f')](function(_0x2ee724){return _0x4c9028(null,![],_0x2ee724);});}}else{if(_0xde2b5f[_0x2ffc('0x13')]){return _0x4c9028(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x2ffc('0x1e')](_0xde2b5f)[_0x2ffc('0xd')](function(){return _0x4c9028(null,_0xde2b5f);});}}}});})[_0x2ffc('0x1f')](function(_0x92c1ee){return _0x4c9028(null,![],_0x92c1ee);});}function sendServiceMail(_0x580a3f){return db[_0x2ffc('0x20')][_0x2ffc('0x21')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x2ffc('0x22')],'as':_0x2ffc('0x23'),'include':[{'model':db[_0x2ffc('0x24')],'as':'CloudProvider'}]}]})['then'](function(_0x56652e){if(!_0x56652e){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x556abb=_0x56652e[_0x2ffc('0x25')]();var _0x56da0c={'account':_0x556abb,'message':_[_0x2ffc('0x26')]({'from':util[_0x2ffc('0x27')]('\x22%s\x22\x20<%s>',_0x56652e[_0x2ffc('0xe')],_0x56652e[_0x2ffc('0x28')]||_0x56652e['Smtp'][_0x2ffc('0x29')])},_0x580a3f)};return client['request']('SendMail',_0x56da0c);})['then'](function(_0x17b49a){if(_0x17b49a['error']){throw new Error(util[_0x2ffc('0x27')](_0x2ffc('0x2a'),_0x17b49a[_0x2ffc('0x2b')][_0x2ffc('0x2c')]||JSON[_0x2ffc('0x2d')](_0x17b49a[_0x2ffc('0x2b')])));}return!![];});}function handleError(_0x4824ba,_0x57c74d,_0x11f591){return _0x4824ba['status'](_0x57c74d||0x1f4)[_0x2ffc('0x2e')]({'message':_0x11f591?_0x11f591[_0x2ffc('0x2c')]||_0x11f591:''});}exports[_0x2ffc('0x2f')]=function(_0x1f7c09,_0x4659cd,_0x1df542){passport[_0x2ffc('0x17')]('local-login',function(_0x4d89a0,_0x5f56a6,_0x138bf7){var _0x45fa59=_0x4d89a0||_0x138bf7;if(_0x45fa59){return handleError(_0x4659cd,0x191,_0x45fa59);}if(!_0x5f56a6){return handleError(_0x4659cd,0x194,{'message':_0x2ffc('0x30')});}else{var _0x16ed3f={'payload':{'id':_0x5f56a6['id'],'role':_0x5f56a6[_0x2ffc('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x2ffc('0x31')](_0x16ed3f)[_0x2ffc('0xd')](function(_0x4e48b7){_0x4659cd['json']({'id':_0x5f56a6['id'],'token':_0x4e48b7,'statusCall':'','isAlreadyLogged':_0x5f56a6['online']});});}})(_0x1f7c09,_0x4659cd,_0x1df542);};exports[_0x2ffc('0x32')]=function(_0x438b9c,_0x4b861a){if(!_0x438b9c[_0x2ffc('0x33')]['email']){return handleError(_0x4b861a,0x1f4,{'message':_0x2ffc('0x34')});}var _0x2fcc0e=rs['generate']();_0x438b9c[_0x2ffc('0x33')][_0x2ffc('0x28')]=_0x438b9c[_0x2ffc('0x33')][_0x2ffc('0x28')][_0x2ffc('0x35')]()[_0x2ffc('0x36')]();var _0x32a03e;return db[_0x2ffc('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x2ffc('0xc')],'raw':!![]})[_0x2ffc('0xd')](function(_0x59daf4){_0x32a03e=_0x59daf4;return db[_0x2ffc('0x37')][_0x2ffc('0x21')]({'where':{'email':_0x438b9c['body'][_0x2ffc('0x28')]}});})['then'](function(_0x43907c){if(!_0x43907c){throw new Error(_0x2ffc('0x38'));}if(_0x43907c['disabled']){throw new Error(_0x2ffc('0x39'));}if(_0x43907c['blocked']){if(moment(_0x43907c[_0x2ffc('0x14')])[_0x2ffc('0x1b')](_0x32a03e[_0x2ffc('0xc')],_0x2ffc('0x1c'))>moment()){throw new Error(_0x2ffc('0x3a'));}else{_0x43907c[_0x2ffc('0x13')]=![];_0x43907c[_0x2ffc('0x14')]=null;}}_0x43907c[_0x2ffc('0x3b')]=_0x2fcc0e;_0x43907c[_0x2ffc('0x3c')]=Date[_0x2ffc('0x3d')]()+0x36ee80;return _0x43907c[_0x2ffc('0x3e')]();})[_0x2ffc('0xd')](function(){return sendServiceMail({'to':_0x438b9c[_0x2ffc('0x33')][_0x2ffc('0x28')],'subject':_0x2ffc('0x3f'),'text':_0x2ffc('0x40')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x2ffc('0x41')+_0x438b9c[_0x2ffc('0x42')][_0x2ffc('0x43')]+'/reset/'+_0x2fcc0e+'\x0a\x0a'+_0x2ffc('0x44')});})['then'](function(){_0x4b861a[_0x2ffc('0x45')](0xc8)[_0x2ffc('0x2e')]({'message':_0x2ffc('0x46')});})['catch'](function(_0x83f082){return handleError(_0x4b861a,0x1f4,_0x83f082);});};exports['reset']=function(_0x11c3c6,_0x30eb01){return db[_0x2ffc('0x37')][_0x2ffc('0x21')]({'where':{'resetPasswordToken':_0x11c3c6['params'][_0x2ffc('0x47')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x31c55b){if(!_0x31c55b){throw new Error(_0x2ffc('0x48'));}return db[_0x2ffc('0xa')][_0x2ffc('0xb')]({'attributes':['id','securePassword',_0x2ffc('0x49'),_0x2ffc('0x4a')]})[_0x2ffc('0xd')](function(_0x101f13){if(_0x101f13[_0x2ffc('0x4b')])authService['validatePasswordPattern'](_0x11c3c6[_0x2ffc('0x33')][_0x2ffc('0xf')]);if(!_0x101f13['enforcePasswordHistory']||!_0x31c55b[_0x2ffc('0x4c')])return _0x31c55b;authService[_0x2ffc('0x4d')](_0x11c3c6['body']['password'],_0x31c55b[_0x2ffc('0x4c')],_0x101f13[_0x2ffc('0x4a')]);return _0x31c55b;})[_0x2ffc('0xd')](function(){_0x31c55b[_0x2ffc('0xf')]=_0x11c3c6[_0x2ffc('0x33')][_0x2ffc('0xf')];_0x31c55b[_0x2ffc('0x3b')]=null;_0x31c55b[_0x2ffc('0x3c')]=null;return _0x31c55b[_0x2ffc('0x3e')]();});})['then'](function(){_0x30eb01[_0x2ffc('0x45')](0xc8)[_0x2ffc('0x2e')]({'message':_0x2ffc('0x4e')});})[_0x2ffc('0x1f')](function(_0xa3bff3){return handleError(_0x30eb01,0x1f4,_0xa3bff3);});};passport['use']('local-login',new LocalStrategy({'usernameField':_0x2ffc('0xe'),'passwordField':_0x2ffc('0xf')},function(_0x4bca2f,_0x1991e6,_0x3c8743){return localAuthenticate(db[_0x2ffc('0x37')],_0x4bca2f,_0x1991e6,_0x3c8743);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index f86d4c1..3624618 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 _0xdd5a=['Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x4a5570,_0x4895b6){var _0x2ae198=function(_0x4d34ab){while(--_0x4d34ab){_0x4a5570['push'](_0x4a5570['shift']());}};_0x2ae198(++_0x4895b6);}(_0xdd5a,0x1c2));var _0xadd5=function(_0x2b7bd8,_0x27eaf4){_0x2b7bd8=_0x2b7bd8-0x0;var _0x1ca608=_0xdd5a[_0x2b7bd8];return _0x1ca608;};'use strict';var express=require('express');var router=express[_0xadd5('0x0')]();var controller=require(_0xadd5('0x1'));router[_0xadd5('0x2')]('/',controller[_0xadd5('0x3')]);router[_0xadd5('0x2')](_0xadd5('0x4'),controller[_0xadd5('0x5')]);router[_0xadd5('0x2')](_0xadd5('0x6'),controller[_0xadd5('0x7')]);module[_0xadd5('0x8')]=router;
\ No newline at end of file
+var _0xf398=['Router','./authLocal.controller','login','post','/forgot','/reset/:token','reset','exports','express'];(function(_0x543c51,_0xff0084){var _0x360555=function(_0x2a0801){while(--_0x2a0801){_0x543c51['push'](_0x543c51['shift']());}};_0x360555(++_0xff0084);}(_0xf398,0x170));var _0x8f39=function(_0x56e6f3,_0x21a3c3){_0x56e6f3=_0x56e6f3-0x0;var _0x551fca=_0xf398[_0x56e6f3];return _0x551fca;};'use strict';var express=require(_0x8f39('0x0'));var router=express[_0x8f39('0x1')]();var controller=require(_0x8f39('0x2'));router['post']('/',controller[_0x8f39('0x3')]);router[_0x8f39('0x4')](_0x8f39('0x5'),controller['forgot']);router['post'](_0x8f39('0x6'),controller[_0x8f39('0x7')]);module[_0x8f39('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 8f72c73..9bf1b41 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 _0x686b=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x20d7a4,_0x140fc3){var _0x56cdc8=function(_0x178f82){while(--_0x178f82){_0x20d7a4['push'](_0x20d7a4['shift']());}};_0x56cdc8(++_0x140fc3);}(_0x686b,0xf3));var _0xb686=function(_0x18a846,_0x1261f1){_0x18a846=_0x18a846-0x0;var _0x374e2b=_0x686b[_0x18a846];return _0x374e2b;};'use strict';var Sequelize=require(_0xb686('0x0'));module[_0xb686('0x1')]={'name':{'type':Sequelize[_0xb686('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb686('0x2')]},'description':{'type':Sequelize[_0xb686('0x2')]},'status':{'type':Sequelize[_0xb686('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb686('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x37bf=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x3281b3,_0x52a344){var _0x3adae8=function(_0x3de81b){while(--_0x3de81b){_0x3281b3['push'](_0x3281b3['shift']());}};_0x3adae8(++_0x52a344);}(_0x37bf,0x1c7));var _0xf37b=function(_0x293c3d,_0x201198){_0x293c3d=_0x293c3d-0x0;var _0x1a1ffd=_0x37bf[_0x293c3d];return _0x1a1ffd;};'use strict';var Sequelize=require('sequelize');module[_0xf37b('0x0')]={'name':{'type':Sequelize[_0xf37b('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xf37b('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xf37b('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf37b('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index a0ca286..d7d39e6 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 _0x1127=['update','body','find','destroy','addConditions','ids','omit','findOne','getConditions','addActions','Action','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','show','params','includeAll','merge','catch','create'];(function(_0x3b63d9,_0x581a7d){var _0x4b7ad4=function(_0x515c16){while(--_0x515c16){_0x3b63d9['push'](_0x3b63d9['shift']());}};_0x4b7ad4(++_0x581a7d);}(_0x1127,0x110));var _0x7112=function(_0x304320,_0x232a69){_0x304320=_0x304320-0x0;var _0xe607da=_0x1127[_0x304320];return _0xe607da;};'use strict';var emlformat=require(_0x7112('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7112('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7112('0x2'));var moment=require(_0x7112('0x3'));var BPromise=require(_0x7112('0x4'));var Mustache=require('mustache');var util=require(_0x7112('0x5'));var path=require(_0x7112('0x6'));var sox=require(_0x7112('0x7'));var csv=require(_0x7112('0x8'));var ejs=require(_0x7112('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7112('0xa'));var squel=require(_0x7112('0xb'));var crypto=require(_0x7112('0xc'));var jsforce=require(_0x7112('0xd'));var deskjs=require(_0x7112('0xe'));var toCsv=require(_0x7112('0x8'));var querystring=require(_0x7112('0xf'));var Papa=require(_0x7112('0x10'));var Redis=require('ioredis');var authService=require(_0x7112('0x11'));var qs=require(_0x7112('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7112('0x13'));var logger=require(_0x7112('0x14'))(_0x7112('0x15'));var utils=require(_0x7112('0x16'));var config=require(_0x7112('0x17'));var licenseUtil=require(_0x7112('0x18'));var db=require(_0x7112('0x19'))['db'];function respondWithStatusCode(_0x1fcf4f,_0x276129){_0x276129=_0x276129||0xcc;return function(_0x4847ea){if(_0x4847ea){return _0x1fcf4f[_0x7112('0x1a')](_0x276129);}return _0x1fcf4f[_0x7112('0x1b')](_0x276129)[_0x7112('0x1c')]();};}function respondWithResult(_0x5a1fc7,_0x29e072){_0x29e072=_0x29e072||0xc8;return function(_0x1caafb){if(_0x1caafb){return _0x5a1fc7[_0x7112('0x1b')](_0x29e072)[_0x7112('0x1d')](_0x1caafb);}};}function respondWithFilteredResult(_0x16f65e,_0x29cde4){return function(_0x4bd0c6){if(_0x4bd0c6){var _0x5f0ae5=typeof _0x29cde4[_0x7112('0x1e')]===_0x7112('0x1f')&&typeof _0x29cde4[_0x7112('0x20')]===_0x7112('0x1f');var _0x3d815a=_0x4bd0c6[_0x7112('0x21')];var _0x244c0b=_0x5f0ae5?0x0:_0x29cde4['offset'];var _0x5f0d0d=_0x5f0ae5?_0x4bd0c6['count']:_0x29cde4[_0x7112('0x1e')]+_0x29cde4[_0x7112('0x20')];var _0x134a26;if(_0x5f0d0d>=_0x3d815a){_0x5f0d0d=_0x3d815a;_0x134a26=0xc8;}else{_0x134a26=0xce;}_0x16f65e[_0x7112('0x1b')](_0x134a26);return _0x16f65e[_0x7112('0x22')](_0x7112('0x23'),_0x244c0b+'-'+_0x5f0d0d+'/'+_0x3d815a)[_0x7112('0x1d')](_0x4bd0c6);}return null;};}function patchUpdates(_0x38c6f5){return function(_0x1f9828){try{jsonpatch[_0x7112('0x24')](_0x1f9828,_0x38c6f5,!![]);}catch(_0x4896e3){return BPromise['reject'](_0x4896e3);}return _0x1f9828[_0x7112('0x25')]();};}function saveUpdates(_0x55efb3,_0x448dc0){return function(_0x4cdd8b){if(_0x4cdd8b){return _0x4cdd8b['update'](_0x55efb3)[_0x7112('0x26')](function(_0x648a6f){return _0x648a6f;});}return null;};}function removeEntity(_0x418148,_0x1f7cf1){return function(_0x39e062){if(_0x39e062){return _0x39e062['destroy']()['then'](function(){_0x418148['status'](0xcc)[_0x7112('0x1c')]();});}};}function handleEntityNotFound(_0x7f0be0,_0x23c56d){return function(_0x4d2830){if(!_0x4d2830){_0x7f0be0[_0x7112('0x1a')](0x194);}return _0x4d2830;};}function handleError(_0xcc1e9b,_0x32b494){_0x32b494=_0x32b494||0x1f4;return function(_0x2a5bfe){logger[_0x7112('0x27')](_0x2a5bfe[_0x7112('0x28')]);if(_0x2a5bfe['name']){delete _0x2a5bfe[_0x7112('0x29')];}_0xcc1e9b[_0x7112('0x1b')](_0x32b494)[_0x7112('0x2a')](_0x2a5bfe);};}exports[_0x7112('0x2b')]=function(_0xd16d36,_0x3c33b2){var _0x38b622={},_0x5e1610={},_0x26f387={'count':0x0,'rows':[]};var _0x314960=_[_0x7112('0x2c')](db[_0x7112('0x2d')][_0x7112('0x2e')],function(_0x3a720c){return{'name':_0x3a720c[_0x7112('0x2f')],'type':_0x3a720c[_0x7112('0x30')][_0x7112('0x31')]};});_0x5e1610[_0x7112('0x32')]=_[_0x7112('0x2c')](_0x314960,_0x7112('0x29'));_0x5e1610['query']=_[_0x7112('0x33')](_0xd16d36[_0x7112('0x34')]);_0x5e1610[_0x7112('0x35')]=_[_0x7112('0x36')](_0x5e1610['model'],_0x5e1610[_0x7112('0x34')]);_0x38b622[_0x7112('0x37')]=_[_0x7112('0x36')](_0x5e1610[_0x7112('0x32')],qs[_0x7112('0x38')](_0xd16d36[_0x7112('0x34')][_0x7112('0x38')]));_0x38b622[_0x7112('0x37')]=_0x38b622[_0x7112('0x37')][_0x7112('0x39')]?_0x38b622[_0x7112('0x37')]:_0x5e1610[_0x7112('0x32')];if(!_0xd16d36[_0x7112('0x34')][_0x7112('0x3a')](_0x7112('0x3b'))){_0x38b622[_0x7112('0x20')]=qs[_0x7112('0x20')](_0xd16d36['query']['limit']);_0x38b622['offset']=qs[_0x7112('0x1e')](_0xd16d36[_0x7112('0x34')][_0x7112('0x1e')]);}_0x38b622[_0x7112('0x3c')]=qs[_0x7112('0x3d')](_0xd16d36[_0x7112('0x34')][_0x7112('0x3d')]);_0x38b622[_0x7112('0x3e')]=qs[_0x7112('0x35')](_[_0x7112('0x3f')](_0xd16d36[_0x7112('0x34')],_0x5e1610[_0x7112('0x35')]),_0x314960);if(_0xd16d36[_0x7112('0x34')][_0x7112('0x40')]){_0x38b622[_0x7112('0x3e')]=_['merge'](_0x38b622['where'],{'$or':_[_0x7112('0x2c')](_0x314960,function(_0x24aa77){if(_0x24aa77[_0x7112('0x30')]!==_0x7112('0x41')){var _0x5445d1={};_0x5445d1[_0x24aa77[_0x7112('0x29')]]={'$like':'%'+_0xd16d36[_0x7112('0x34')]['filter']+'%'};return _0x5445d1;}})});}_0x38b622=_['merge']({},_0x38b622,_0xd16d36[_0x7112('0x42')]);var _0x51c04d={'where':_0x38b622[_0x7112('0x3e')]};return db[_0x7112('0x2d')][_0x7112('0x21')](_0x51c04d)[_0x7112('0x26')](function(_0x4baa67){_0x26f387[_0x7112('0x21')]=_0x4baa67;if(_0xd16d36[_0x7112('0x34')]['includeAll']){_0x38b622[_0x7112('0x43')]=[{'all':!![]}];}return db[_0x7112('0x2d')][_0x7112('0x44')](_0x38b622);})['then'](function(_0x22de1a){_0x26f387[_0x7112('0x45')]=_0x22de1a;return _0x26f387;})['then'](respondWithFilteredResult(_0x3c33b2,_0x38b622))['catch'](handleError(_0x3c33b2,null));};exports[_0x7112('0x46')]=function(_0x459489,_0x3b9922){var _0x283964={'raw':![],'where':{'id':_0x459489[_0x7112('0x47')]['id']}},_0x17f4a7={};_0x17f4a7[_0x7112('0x32')]=_[_0x7112('0x33')](db[_0x7112('0x2d')][_0x7112('0x2e')]);_0x17f4a7[_0x7112('0x34')]=_[_0x7112('0x33')](_0x459489[_0x7112('0x34')]);_0x17f4a7[_0x7112('0x35')]=_[_0x7112('0x36')](_0x17f4a7[_0x7112('0x32')],_0x17f4a7[_0x7112('0x34')]);_0x283964[_0x7112('0x37')]=_[_0x7112('0x36')](_0x17f4a7[_0x7112('0x32')],qs[_0x7112('0x38')](_0x459489[_0x7112('0x34')]['fields']));_0x283964['attributes']=_0x283964[_0x7112('0x37')][_0x7112('0x39')]?_0x283964[_0x7112('0x37')]:_0x17f4a7[_0x7112('0x32')];if(_0x459489['query'][_0x7112('0x48')]){_0x283964[_0x7112('0x43')]=[{'all':!![]}];}_0x283964=_[_0x7112('0x49')]({},_0x283964,_0x459489[_0x7112('0x42')]);return db[_0x7112('0x2d')]['find'](_0x283964)[_0x7112('0x26')](handleEntityNotFound(_0x3b9922,null))['then'](respondWithResult(_0x3b9922,null))[_0x7112('0x4a')](handleError(_0x3b9922,null));};exports['create']=function(_0x574a34,_0x56567a){return db['Automation'][_0x7112('0x4b')](_0x574a34['body'],{})['then'](respondWithResult(_0x56567a,0xc9))[_0x7112('0x4a')](handleError(_0x56567a,null));};exports[_0x7112('0x4c')]=function(_0x52a85a,_0x48b27a){if(_0x52a85a['body']['id']){delete _0x52a85a[_0x7112('0x4d')]['id'];}return db[_0x7112('0x2d')][_0x7112('0x4e')]({'where':{'id':_0x52a85a['params']['id']}})[_0x7112('0x26')](handleEntityNotFound(_0x48b27a,null))[_0x7112('0x26')](saveUpdates(_0x52a85a['body'],null))[_0x7112('0x26')](respondWithResult(_0x48b27a,null))[_0x7112('0x4a')](handleError(_0x48b27a,null));};exports[_0x7112('0x4f')]=function(_0x4f5e85,_0x5c28cc){return db[_0x7112('0x2d')][_0x7112('0x4e')]({'where':{'id':_0x4f5e85[_0x7112('0x47')]['id']}})[_0x7112('0x26')](handleEntityNotFound(_0x5c28cc,null))[_0x7112('0x26')](removeEntity(_0x5c28cc,null))[_0x7112('0x4a')](handleError(_0x5c28cc,null));};exports[_0x7112('0x50')]=function(_0x44789a,_0x154401,_0xdb130b){return db['Condition'][_0x7112('0x4e')]({'where':{'id':_0x44789a[_0x7112('0x47')]['id']}})['then'](handleEntityNotFound(_0x154401,null))[_0x7112('0x26')](function(_0xe71a07){if(_0xe71a07){return _0xe71a07[_0x7112('0x50')](_0x44789a[_0x7112('0x4d')][_0x7112('0x51')],_[_0x7112('0x52')](_0x44789a[_0x7112('0x4d')],[_0x7112('0x51'),'id'])||{});}})[_0x7112('0x26')](respondWithResult(_0x154401,null))[_0x7112('0x4a')](handleError(_0x154401,null));};exports['getConditions']=function(_0x4f532b,_0x4a3fee,_0x12f42b){var _0x2ca0a9={};var _0x32ff19={};var _0x2c4e00;var _0x575648;return db[_0x7112('0x2d')][_0x7112('0x53')]({'where':{'id':_0x4f532b[_0x7112('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a3fee,null))[_0x7112('0x26')](function(_0x3eb84b){if(_0x3eb84b){_0x2c4e00=_0x3eb84b;_0x32ff19[_0x7112('0x32')]=_[_0x7112('0x33')](db['Condition'][_0x7112('0x2e')]);_0x32ff19['query']=_[_0x7112('0x33')](_0x4f532b['query']);_0x32ff19[_0x7112('0x35')]=_[_0x7112('0x36')](_0x32ff19['model'],_0x32ff19[_0x7112('0x34')]);_0x2ca0a9[_0x7112('0x37')]=_[_0x7112('0x36')](_0x32ff19[_0x7112('0x32')],qs[_0x7112('0x38')](_0x4f532b[_0x7112('0x34')][_0x7112('0x38')]));_0x2ca0a9[_0x7112('0x37')]=_0x2ca0a9[_0x7112('0x37')][_0x7112('0x39')]?_0x2ca0a9[_0x7112('0x37')]:_0x32ff19[_0x7112('0x32')];_0x2ca0a9[_0x7112('0x3c')]=qs['sort'](_0x4f532b[_0x7112('0x34')]['sort']);_0x2ca0a9[_0x7112('0x3e')]=qs[_0x7112('0x35')](_[_0x7112('0x3f')](_0x4f532b[_0x7112('0x34')],_0x32ff19[_0x7112('0x35')]));if(_0x4f532b[_0x7112('0x34')]['filter']){_0x2ca0a9['where']=_[_0x7112('0x49')](_0x2ca0a9[_0x7112('0x3e')],{'$or':_['map'](_0x2ca0a9['attributes'],function(_0x423c0d){var _0x1bf3fc={};_0x1bf3fc[_0x423c0d]={'$like':'%'+_0x4f532b[_0x7112('0x34')][_0x7112('0x40')]+'%'};return _0x1bf3fc;})});}_0x2ca0a9=_[_0x7112('0x49')]({},_0x2ca0a9,_0x4f532b['options']);return _0x2c4e00[_0x7112('0x54')](_0x2ca0a9);}})[_0x7112('0x26')](function(_0x43b4fa){if(_0x43b4fa){_0x575648=_0x43b4fa[_0x7112('0x39')];if(!_0x4f532b[_0x7112('0x34')][_0x7112('0x3a')](_0x7112('0x3b'))){_0x2ca0a9[_0x7112('0x20')]=qs['limit'](_0x4f532b[_0x7112('0x34')][_0x7112('0x20')]);_0x2ca0a9[_0x7112('0x1e')]=qs[_0x7112('0x1e')](_0x4f532b[_0x7112('0x34')][_0x7112('0x1e')]);}return _0x2c4e00[_0x7112('0x54')](_0x2ca0a9);}})[_0x7112('0x26')](function(_0x378a2f){if(_0x378a2f){return _0x378a2f?{'count':_0x575648,'rows':_0x378a2f}:null;}})[_0x7112('0x26')](respondWithResult(_0x4a3fee,null))[_0x7112('0x4a')](handleError(_0x4a3fee,null));};exports[_0x7112('0x55')]=function(_0x50bedc,_0x541b91,_0x351db4){return db[_0x7112('0x56')]['find']({'where':{'id':_0x50bedc[_0x7112('0x47')]['id']}})['then'](handleEntityNotFound(_0x541b91,null))[_0x7112('0x26')](function(_0xd65300){if(_0xd65300){return _0xd65300['addActions'](_0x50bedc[_0x7112('0x4d')][_0x7112('0x51')],_[_0x7112('0x52')](_0x50bedc[_0x7112('0x4d')],[_0x7112('0x51'),'id'])||{});}})['then'](respondWithResult(_0x541b91,null))[_0x7112('0x4a')](handleError(_0x541b91,null));};exports['getActions']=function(_0x1bcc08,_0x2c4ab8,_0xf51850){var _0x5c5e72={};var _0x3062b9={};var _0x9c68a4;var _0x1130c2;return db[_0x7112('0x2d')][_0x7112('0x53')]({'where':{'id':_0x1bcc08[_0x7112('0x47')]['id']}})['then'](handleEntityNotFound(_0x2c4ab8,null))[_0x7112('0x26')](function(_0x213c1f){if(_0x213c1f){_0x9c68a4=_0x213c1f;_0x3062b9['model']=_[_0x7112('0x33')](db[_0x7112('0x56')][_0x7112('0x2e')]);_0x3062b9[_0x7112('0x34')]=_[_0x7112('0x33')](_0x1bcc08[_0x7112('0x34')]);_0x3062b9[_0x7112('0x35')]=_[_0x7112('0x36')](_0x3062b9[_0x7112('0x32')],_0x3062b9[_0x7112('0x34')]);_0x5c5e72[_0x7112('0x37')]=_[_0x7112('0x36')](_0x3062b9['model'],qs[_0x7112('0x38')](_0x1bcc08[_0x7112('0x34')][_0x7112('0x38')]));_0x5c5e72['attributes']=_0x5c5e72[_0x7112('0x37')]['length']?_0x5c5e72['attributes']:_0x3062b9['model'];_0x5c5e72[_0x7112('0x3c')]=qs['sort'](_0x1bcc08['query'][_0x7112('0x3d')]);_0x5c5e72[_0x7112('0x3e')]=qs[_0x7112('0x35')](_[_0x7112('0x3f')](_0x1bcc08[_0x7112('0x34')],_0x3062b9[_0x7112('0x35')]));if(_0x1bcc08[_0x7112('0x34')][_0x7112('0x40')]){_0x5c5e72[_0x7112('0x3e')]=_[_0x7112('0x49')](_0x5c5e72[_0x7112('0x3e')],{'$or':_[_0x7112('0x2c')](_0x5c5e72['attributes'],function(_0x470aae){var _0x52af95={};_0x52af95[_0x470aae]={'$like':'%'+_0x1bcc08[_0x7112('0x34')]['filter']+'%'};return _0x52af95;})});}_0x5c5e72=_['merge']({},_0x5c5e72,_0x1bcc08[_0x7112('0x42')]);return _0x9c68a4['getActions'](_0x5c5e72);}})[_0x7112('0x26')](function(_0x493719){if(_0x493719){_0x1130c2=_0x493719[_0x7112('0x39')];if(!_0x1bcc08['query'][_0x7112('0x3a')](_0x7112('0x3b'))){_0x5c5e72['limit']=qs[_0x7112('0x20')](_0x1bcc08['query']['limit']);_0x5c5e72[_0x7112('0x1e')]=qs[_0x7112('0x1e')](_0x1bcc08[_0x7112('0x34')]['offset']);}return _0x9c68a4['getActions'](_0x5c5e72);}})[_0x7112('0x26')](function(_0x6b7664){if(_0x6b7664){return _0x6b7664?{'count':_0x1130c2,'rows':_0x6b7664}:null;}})[_0x7112('0x26')](respondWithResult(_0x2c4ab8,null))[_0x7112('0x4a')](handleError(_0x2c4ab8,null));};
\ No newline at end of file
+var _0x6984=['moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','send','map','Automation','rawAttributes','type','key','model','name','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','find','create','body','Condition','omit','ids','getConditions','keys','sort','addActions','findOne','Action','getActions','rimraf','fast-json-patch','request-promise'];(function(_0x55d332,_0x549069){var _0x584ba6=function(_0x367e6b){while(--_0x367e6b){_0x55d332['push'](_0x55d332['shift']());}};_0x584ba6(++_0x549069);}(_0x6984,0x9d));var _0x4698=function(_0xfc514d,_0x54c4db){_0xfc514d=_0xfc514d-0x0;var _0x306239=_0x6984[_0xfc514d];return _0x306239;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4698('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4698('0x1'));var rp=require(_0x4698('0x2'));var moment=require(_0x4698('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4698('0x4'));var util=require(_0x4698('0x5'));var path=require('path');var sox=require(_0x4698('0x6'));var csv=require(_0x4698('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4698('0x8'));var _=require(_0x4698('0x9'));var squel=require(_0x4698('0xa'));var crypto=require(_0x4698('0xb'));var jsforce=require(_0x4698('0xc'));var deskjs=require(_0x4698('0xd'));var toCsv=require(_0x4698('0x7'));var querystring=require(_0x4698('0xe'));var Papa=require('papaparse');var Redis=require(_0x4698('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4698('0x10'));var as=require(_0x4698('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4698('0x12'))(_0x4698('0x13'));var utils=require(_0x4698('0x14'));var config=require(_0x4698('0x15'));var licenseUtil=require(_0x4698('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b8f39,_0x1e6d42){_0x1e6d42=_0x1e6d42||0xcc;return function(_0x516400){if(_0x516400){return _0x1b8f39['sendStatus'](_0x1e6d42);}return _0x1b8f39[_0x4698('0x17')](_0x1e6d42)[_0x4698('0x18')]();};}function respondWithResult(_0x4e1de9,_0x405440){_0x405440=_0x405440||0xc8;return function(_0x1a9561){if(_0x1a9561){return _0x4e1de9[_0x4698('0x17')](_0x405440)[_0x4698('0x19')](_0x1a9561);}};}function respondWithFilteredResult(_0x381c9e,_0x7230ae){return function(_0x5181cd){if(_0x5181cd){var _0x360342=typeof _0x7230ae['offset']===_0x4698('0x1a')&&typeof _0x7230ae[_0x4698('0x1b')]===_0x4698('0x1a');var _0x3f85ab=_0x5181cd[_0x4698('0x1c')];var _0x5c7aae=_0x360342?0x0:_0x7230ae[_0x4698('0x1d')];var _0x1d3aa5=_0x360342?_0x5181cd[_0x4698('0x1c')]:_0x7230ae[_0x4698('0x1d')]+_0x7230ae['limit'];var _0x4596b0;if(_0x1d3aa5>=_0x3f85ab){_0x1d3aa5=_0x3f85ab;_0x4596b0=0xc8;}else{_0x4596b0=0xce;}_0x381c9e[_0x4698('0x17')](_0x4596b0);return _0x381c9e[_0x4698('0x1e')](_0x4698('0x1f'),_0x5c7aae+'-'+_0x1d3aa5+'/'+_0x3f85ab)[_0x4698('0x19')](_0x5181cd);}return null;};}function patchUpdates(_0x19f9df){return function(_0x101695){try{jsonpatch['apply'](_0x101695,_0x19f9df,!![]);}catch(_0x38b51a){return BPromise[_0x4698('0x20')](_0x38b51a);}return _0x101695['save']();};}function saveUpdates(_0xd5db26,_0x3b5616){return function(_0x532af6){if(_0x532af6){return _0x532af6[_0x4698('0x21')](_0xd5db26)[_0x4698('0x22')](function(_0x203859){return _0x203859;});}return null;};}function removeEntity(_0x24378a,_0x41935b){return function(_0x1a573f){if(_0x1a573f){return _0x1a573f[_0x4698('0x23')]()[_0x4698('0x22')](function(){_0x24378a[_0x4698('0x17')](0xcc)[_0x4698('0x18')]();});}};}function handleEntityNotFound(_0x157211,_0x105184){return function(_0x1ee308){if(!_0x1ee308){_0x157211[_0x4698('0x24')](0x194);}return _0x1ee308;};}function handleError(_0x4c9d7a,_0x474114){_0x474114=_0x474114||0x1f4;return function(_0x398469){logger[_0x4698('0x25')](_0x398469[_0x4698('0x26')]);if(_0x398469['name']){delete _0x398469['name'];}_0x4c9d7a['status'](_0x474114)[_0x4698('0x27')](_0x398469);};}exports['index']=function(_0x5f4592,_0x4648aa){var _0x44081b={},_0x6791f1={},_0x88a115={'count':0x0,'rows':[]};var _0x2b3ba7=_[_0x4698('0x28')](db[_0x4698('0x29')][_0x4698('0x2a')],function(_0x233abd){return{'name':_0x233abd['fieldName'],'type':_0x233abd[_0x4698('0x2b')][_0x4698('0x2c')]};});_0x6791f1[_0x4698('0x2d')]=_[_0x4698('0x28')](_0x2b3ba7,_0x4698('0x2e'));_0x6791f1[_0x4698('0x2f')]=_['keys'](_0x5f4592[_0x4698('0x2f')]);_0x6791f1['filters']=_[_0x4698('0x30')](_0x6791f1[_0x4698('0x2d')],_0x6791f1[_0x4698('0x2f')]);_0x44081b[_0x4698('0x31')]=_[_0x4698('0x30')](_0x6791f1[_0x4698('0x2d')],qs['fields'](_0x5f4592[_0x4698('0x2f')][_0x4698('0x32')]));_0x44081b[_0x4698('0x31')]=_0x44081b[_0x4698('0x31')]['length']?_0x44081b[_0x4698('0x31')]:_0x6791f1[_0x4698('0x2d')];if(!_0x5f4592[_0x4698('0x2f')][_0x4698('0x33')](_0x4698('0x34'))){_0x44081b[_0x4698('0x1b')]=qs[_0x4698('0x1b')](_0x5f4592[_0x4698('0x2f')]['limit']);_0x44081b['offset']=qs[_0x4698('0x1d')](_0x5f4592['query'][_0x4698('0x1d')]);}_0x44081b[_0x4698('0x35')]=qs['sort'](_0x5f4592['query']['sort']);_0x44081b[_0x4698('0x36')]=qs[_0x4698('0x37')](_[_0x4698('0x38')](_0x5f4592[_0x4698('0x2f')],_0x6791f1[_0x4698('0x37')]),_0x2b3ba7);if(_0x5f4592[_0x4698('0x2f')][_0x4698('0x39')]){_0x44081b[_0x4698('0x36')]=_[_0x4698('0x3a')](_0x44081b['where'],{'$or':_[_0x4698('0x28')](_0x2b3ba7,function(_0x246fa2){if(_0x246fa2[_0x4698('0x2b')]!==_0x4698('0x3b')){var _0x22c972={};_0x22c972[_0x246fa2[_0x4698('0x2e')]]={'$like':'%'+_0x5f4592[_0x4698('0x2f')]['filter']+'%'};return _0x22c972;}})});}_0x44081b=_[_0x4698('0x3a')]({},_0x44081b,_0x5f4592[_0x4698('0x3c')]);var _0x53f9d7={'where':_0x44081b[_0x4698('0x36')]};return db['Automation']['count'](_0x53f9d7)[_0x4698('0x22')](function(_0x19bb7a){_0x88a115[_0x4698('0x1c')]=_0x19bb7a;if(_0x5f4592['query']['includeAll']){_0x44081b[_0x4698('0x3d')]=[{'all':!![]}];}return db[_0x4698('0x29')][_0x4698('0x3e')](_0x44081b);})[_0x4698('0x22')](function(_0x1cd21e){_0x88a115['rows']=_0x1cd21e;return _0x88a115;})['then'](respondWithFilteredResult(_0x4648aa,_0x44081b))[_0x4698('0x3f')](handleError(_0x4648aa,null));};exports[_0x4698('0x40')]=function(_0x240e9a,_0x506c04){var _0x11d718={'raw':![],'where':{'id':_0x240e9a[_0x4698('0x41')]['id']}},_0x5c7fbd={};_0x5c7fbd['model']=_['keys'](db[_0x4698('0x29')][_0x4698('0x2a')]);_0x5c7fbd[_0x4698('0x2f')]=_['keys'](_0x240e9a[_0x4698('0x2f')]);_0x5c7fbd[_0x4698('0x37')]=_[_0x4698('0x30')](_0x5c7fbd[_0x4698('0x2d')],_0x5c7fbd[_0x4698('0x2f')]);_0x11d718['attributes']=_[_0x4698('0x30')](_0x5c7fbd[_0x4698('0x2d')],qs['fields'](_0x240e9a[_0x4698('0x2f')]['fields']));_0x11d718[_0x4698('0x31')]=_0x11d718[_0x4698('0x31')][_0x4698('0x42')]?_0x11d718[_0x4698('0x31')]:_0x5c7fbd[_0x4698('0x2d')];if(_0x240e9a[_0x4698('0x2f')]['includeAll']){_0x11d718[_0x4698('0x3d')]=[{'all':!![]}];}_0x11d718=_[_0x4698('0x3a')]({},_0x11d718,_0x240e9a[_0x4698('0x3c')]);return db['Automation'][_0x4698('0x43')](_0x11d718)[_0x4698('0x22')](handleEntityNotFound(_0x506c04,null))[_0x4698('0x22')](respondWithResult(_0x506c04,null))[_0x4698('0x3f')](handleError(_0x506c04,null));};exports[_0x4698('0x44')]=function(_0x2f773c,_0x1bf35e){return db['Automation'][_0x4698('0x44')](_0x2f773c[_0x4698('0x45')],{})[_0x4698('0x22')](respondWithResult(_0x1bf35e,0xc9))[_0x4698('0x3f')](handleError(_0x1bf35e,null));};exports[_0x4698('0x21')]=function(_0xd761f5,_0x526883){if(_0xd761f5[_0x4698('0x45')]['id']){delete _0xd761f5[_0x4698('0x45')]['id'];}return db[_0x4698('0x29')][_0x4698('0x43')]({'where':{'id':_0xd761f5[_0x4698('0x41')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x526883,null))['then'](saveUpdates(_0xd761f5[_0x4698('0x45')],null))[_0x4698('0x22')](respondWithResult(_0x526883,null))['catch'](handleError(_0x526883,null));};exports['destroy']=function(_0x124051,_0x1a286e){return db['Automation'][_0x4698('0x43')]({'where':{'id':_0x124051[_0x4698('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a286e,null))[_0x4698('0x22')](removeEntity(_0x1a286e,null))[_0x4698('0x3f')](handleError(_0x1a286e,null));};exports['addConditions']=function(_0xc9bbcd,_0x5efcb5,_0x130917){return db[_0x4698('0x46')][_0x4698('0x43')]({'where':{'id':_0xc9bbcd['params']['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x5efcb5,null))[_0x4698('0x22')](function(_0xc07ec0){if(_0xc07ec0){return _0xc07ec0['addConditions'](_0xc9bbcd['body']['ids'],_[_0x4698('0x47')](_0xc9bbcd['body'],[_0x4698('0x48'),'id'])||{});}})[_0x4698('0x22')](respondWithResult(_0x5efcb5,null))[_0x4698('0x3f')](handleError(_0x5efcb5,null));};exports[_0x4698('0x49')]=function(_0x90da86,_0x29c41e,_0x64c73c){var _0x4b7354={};var _0x50c732={};var _0x3b0d8b;var _0x1953e9;return db[_0x4698('0x29')]['findOne']({'where':{'id':_0x90da86['params']['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x29c41e,null))['then'](function(_0x25c73f){if(_0x25c73f){_0x3b0d8b=_0x25c73f;_0x50c732['model']=_[_0x4698('0x4a')](db[_0x4698('0x46')][_0x4698('0x2a')]);_0x50c732[_0x4698('0x2f')]=_['keys'](_0x90da86[_0x4698('0x2f')]);_0x50c732[_0x4698('0x37')]=_[_0x4698('0x30')](_0x50c732[_0x4698('0x2d')],_0x50c732[_0x4698('0x2f')]);_0x4b7354['attributes']=_[_0x4698('0x30')](_0x50c732[_0x4698('0x2d')],qs[_0x4698('0x32')](_0x90da86[_0x4698('0x2f')]['fields']));_0x4b7354['attributes']=_0x4b7354[_0x4698('0x31')][_0x4698('0x42')]?_0x4b7354[_0x4698('0x31')]:_0x50c732[_0x4698('0x2d')];_0x4b7354['order']=qs['sort'](_0x90da86['query'][_0x4698('0x4b')]);_0x4b7354['where']=qs[_0x4698('0x37')](_['pick'](_0x90da86['query'],_0x50c732[_0x4698('0x37')]));if(_0x90da86[_0x4698('0x2f')]['filter']){_0x4b7354[_0x4698('0x36')]=_[_0x4698('0x3a')](_0x4b7354[_0x4698('0x36')],{'$or':_[_0x4698('0x28')](_0x4b7354['attributes'],function(_0x34972d){var _0x2a1883={};_0x2a1883[_0x34972d]={'$like':'%'+_0x90da86[_0x4698('0x2f')][_0x4698('0x39')]+'%'};return _0x2a1883;})});}_0x4b7354=_[_0x4698('0x3a')]({},_0x4b7354,_0x90da86[_0x4698('0x3c')]);return _0x3b0d8b[_0x4698('0x49')](_0x4b7354);}})[_0x4698('0x22')](function(_0x4f2e9a){if(_0x4f2e9a){_0x1953e9=_0x4f2e9a['length'];if(!_0x90da86[_0x4698('0x2f')]['hasOwnProperty']('nolimit')){_0x4b7354[_0x4698('0x1b')]=qs['limit'](_0x90da86[_0x4698('0x2f')][_0x4698('0x1b')]);_0x4b7354[_0x4698('0x1d')]=qs[_0x4698('0x1d')](_0x90da86[_0x4698('0x2f')][_0x4698('0x1d')]);}return _0x3b0d8b[_0x4698('0x49')](_0x4b7354);}})[_0x4698('0x22')](function(_0x49140a){if(_0x49140a){return _0x49140a?{'count':_0x1953e9,'rows':_0x49140a}:null;}})[_0x4698('0x22')](respondWithResult(_0x29c41e,null))[_0x4698('0x3f')](handleError(_0x29c41e,null));};exports[_0x4698('0x4c')]=function(_0x591a08,_0x49310d,_0x3d7503){return db['Action'][_0x4698('0x43')]({'where':{'id':_0x591a08['params']['id']}})['then'](handleEntityNotFound(_0x49310d,null))['then'](function(_0x3e7707){if(_0x3e7707){return _0x3e7707[_0x4698('0x4c')](_0x591a08['body'][_0x4698('0x48')],_['omit'](_0x591a08['body'],['ids','id'])||{});}})[_0x4698('0x22')](respondWithResult(_0x49310d,null))[_0x4698('0x3f')](handleError(_0x49310d,null));};exports['getActions']=function(_0x2099c0,_0x3a7137,_0x2f9fdf){var _0x38faa0={};var _0x33a2ab={};var _0x79f6a7;var _0x2d7851;return db[_0x4698('0x29')][_0x4698('0x4d')]({'where':{'id':_0x2099c0[_0x4698('0x41')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x3a7137,null))[_0x4698('0x22')](function(_0x104162){if(_0x104162){_0x79f6a7=_0x104162;_0x33a2ab[_0x4698('0x2d')]=_[_0x4698('0x4a')](db[_0x4698('0x4e')][_0x4698('0x2a')]);_0x33a2ab[_0x4698('0x2f')]=_[_0x4698('0x4a')](_0x2099c0['query']);_0x33a2ab['filters']=_[_0x4698('0x30')](_0x33a2ab[_0x4698('0x2d')],_0x33a2ab[_0x4698('0x2f')]);_0x38faa0[_0x4698('0x31')]=_[_0x4698('0x30')](_0x33a2ab[_0x4698('0x2d')],qs[_0x4698('0x32')](_0x2099c0[_0x4698('0x2f')][_0x4698('0x32')]));_0x38faa0['attributes']=_0x38faa0['attributes'][_0x4698('0x42')]?_0x38faa0[_0x4698('0x31')]:_0x33a2ab[_0x4698('0x2d')];_0x38faa0[_0x4698('0x35')]=qs[_0x4698('0x4b')](_0x2099c0[_0x4698('0x2f')]['sort']);_0x38faa0['where']=qs[_0x4698('0x37')](_[_0x4698('0x38')](_0x2099c0['query'],_0x33a2ab['filters']));if(_0x2099c0[_0x4698('0x2f')][_0x4698('0x39')]){_0x38faa0[_0x4698('0x36')]=_[_0x4698('0x3a')](_0x38faa0[_0x4698('0x36')],{'$or':_['map'](_0x38faa0[_0x4698('0x31')],function(_0x2c1534){var _0x2365f7={};_0x2365f7[_0x2c1534]={'$like':'%'+_0x2099c0[_0x4698('0x2f')][_0x4698('0x39')]+'%'};return _0x2365f7;})});}_0x38faa0=_[_0x4698('0x3a')]({},_0x38faa0,_0x2099c0[_0x4698('0x3c')]);return _0x79f6a7['getActions'](_0x38faa0);}})[_0x4698('0x22')](function(_0x5407e5){if(_0x5407e5){_0x2d7851=_0x5407e5['length'];if(!_0x2099c0[_0x4698('0x2f')]['hasOwnProperty'](_0x4698('0x34'))){_0x38faa0['limit']=qs[_0x4698('0x1b')](_0x2099c0[_0x4698('0x2f')][_0x4698('0x1b')]);_0x38faa0['offset']=qs[_0x4698('0x1d')](_0x2099c0[_0x4698('0x2f')][_0x4698('0x1d')]);}return _0x79f6a7[_0x4698('0x4f')](_0x38faa0);}})[_0x4698('0x22')](function(_0x24d0a3){if(_0x24d0a3){return _0x24d0a3?{'count':_0x2d7851,'rows':_0x24d0a3}:null;}})[_0x4698('0x22')](respondWithResult(_0x3a7137,null))[_0x4698('0x3f')](handleError(_0x3a7137,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index c41ac01..2a66f6b 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 _0x7731=['path','rimraf','../../config/environment','./automation.attributes','exports','tools_automations','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2db6fa,_0x4ac467){var _0xd2b1=function(_0x278694){while(--_0x278694){_0x2db6fa['push'](_0x2db6fa['shift']());}};_0xd2b1(++_0x4ac467);}(_0x7731,0x1d4));var _0x1773=function(_0x27aa38,_0x2b4490){_0x27aa38=_0x27aa38-0x0;var _0x3e1199=_0x7731[_0x27aa38];return _0x3e1199;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1773('0x0'))(_0x1773('0x1'));var moment=require(_0x1773('0x2'));var BPromise=require(_0x1773('0x3'));var rp=require(_0x1773('0x4'));var fs=require('fs');var path=require(_0x1773('0x5'));var rimraf=require(_0x1773('0x6'));var config=require(_0x1773('0x7'));var attributes=require(_0x1773('0x8'));module[_0x1773('0x9')]=function(_0x12a59d,_0x4977cf){return _0x12a59d['define']('Automation',attributes,{'tableName':_0x1773('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1b46=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1b46,0x137));var _0x61b4=function(_0x89f63,_0x4d8c95){_0x89f63=_0x89f63-0x0;var _0x2adbf8=_0x1b46[_0x89f63];return _0x2adbf8;};'use strict';var _=require('lodash');var util=require(_0x61b4('0x0'));var logger=require(_0x61b4('0x1'))('api');var moment=require(_0x61b4('0x2'));var BPromise=require(_0x61b4('0x3'));var rp=require(_0x61b4('0x4'));var fs=require('fs');var path=require(_0x61b4('0x5'));var rimraf=require(_0x61b4('0x6'));var config=require(_0x61b4('0x7'));var attributes=require(_0x61b4('0x8'));module[_0x61b4('0x9')]=function(_0x51da86,_0x14c5de){return _0x51da86[_0x61b4('0xa')](_0x61b4('0xb'),attributes,{'tableName':_0x61b4('0xc'),'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 4d7223f..1da9619 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 _0xe0dd=['../../config/utils','../../config/logger','jayson/promise','client','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xe0dd,0x163));var _0xde0d=function(_0x7c0074,_0x1ffdcf){_0x7c0074=_0x7c0074-0x0;var _0x13e95b=_0xe0dd[_0x7c0074];return _0x13e95b;};'use strict';var _=require(_0xde0d('0x0'));var util=require(_0xde0d('0x1'));var moment=require('moment');var BPromise=require(_0xde0d('0x2'));var rs=require(_0xde0d('0x3'));var fs=require('fs');var Redis=require(_0xde0d('0x4'));var db=require(_0xde0d('0x5'))['db'];var utils=require(_0xde0d('0x6'));var logger=require(_0xde0d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xde0d('0x8'));var client=jayson[_0xde0d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x323200,_0x3ce23c,_0x33a644){return new BPromise(function(_0x570b78,_0x25f0fe){return client['request'](_0x323200,_0x33a644)[_0xde0d('0xa')](function(_0x5e6588){logger[_0xde0d('0xb')](_0xde0d('0xc'),_0x3ce23c,_0xde0d('0xd'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x3ce23c,'request\x20sent',JSON[_0xde0d('0xe')](_0x5e6588));if(_0x5e6588[_0xde0d('0xf')]){if(_0x5e6588[_0xde0d('0xf')]['code']===0x1f4){logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x5e6588['error'][_0xde0d('0x10')]);return _0x25f0fe(_0x5e6588[_0xde0d('0xf')][_0xde0d('0x10')]);}logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x5e6588['error'][_0xde0d('0x10')]);return _0x570b78(_0x5e6588['error'][_0xde0d('0x10')]);}else{logger['info'](_0xde0d('0xc'),_0x3ce23c,'request\x20sent');_0x570b78(_0x5e6588[_0xde0d('0x11')][_0xde0d('0x10')]);}})[_0xde0d('0x12')](function(_0x228666){logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x228666);_0x25f0fe(_0x228666);});});}
\ No newline at end of file
+var _0xa32b=['message','info','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','error','Automation,\x20%s,\x20%s'];(function(_0x4a5cce,_0x34265f){var _0x347252=function(_0x7d6755){while(--_0x7d6755){_0x4a5cce['push'](_0x4a5cce['shift']());}};_0x347252(++_0x34265f);}(_0xa32b,0x68));var _0xba32=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0xa32b[_0x1992f1];return _0x413dfe;};'use strict';var _=require(_0xba32('0x0'));var util=require('util');var moment=require(_0xba32('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba32('0x2'));var db=require(_0xba32('0x3'))['db'];var utils=require(_0xba32('0x4'));var logger=require('../../config/logger')(_0xba32('0x5'));var config=require(_0xba32('0x6'));var jayson=require(_0xba32('0x7'));var client=jayson[_0xba32('0x8')][_0xba32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c5a59,_0x1b1332,_0x4edbc6){return new BPromise(function(_0xcdcc5b,_0x13395b){return client[_0xba32('0xa')](_0x5c5a59,_0x4edbc6)[_0xba32('0xb')](function(_0x5d8f64){logger['info']('Automation,\x20%s,\x20%s',_0x1b1332,'request\x20sent');logger[_0xba32('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x1b1332,_0xba32('0xd'),JSON['stringify'](_0x5d8f64));if(_0x5d8f64[_0xba32('0xe')]){if(_0x5d8f64['error']['code']===0x1f4){logger[_0xba32('0xe')](_0xba32('0xf'),_0x1b1332,_0x5d8f64[_0xba32('0xe')][_0xba32('0x10')]);return _0x13395b(_0x5d8f64[_0xba32('0xe')]['message']);}logger[_0xba32('0xe')](_0xba32('0xf'),_0x1b1332,_0x5d8f64[_0xba32('0xe')][_0xba32('0x10')]);return _0xcdcc5b(_0x5d8f64[_0xba32('0xe')][_0xba32('0x10')]);}else{logger[_0xba32('0x11')]('Automation,\x20%s,\x20%s',_0x1b1332,_0xba32('0xd'));_0xcdcc5b(_0x5d8f64[_0xba32('0x12')][_0xba32('0x10')]);}})[_0xba32('0x13')](function(_0x310dee){logger['error']('Automation,\x20%s,\x20%s',_0x1b1332,_0x310dee);_0x13395b(_0x310dee);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 2576b9d..d4336ea 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 _0x20ce=['../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','update','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x4d7379,_0x4b4e63){var _0x46d7cf=function(_0x53f5f0){while(--_0x53f5f0){_0x4d7379['push'](_0x4d7379['shift']());}};_0x46d7cf(++_0x4b4e63);}(_0x20ce,0x10d));var _0xe20c=function(_0x2472ce,_0x22d9b3){_0x2472ce=_0x2472ce-0x0;var _0x373ed8=_0x20ce[_0x2472ce];return _0x373ed8;};'use strict';var multer=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var path=require(_0xe20c('0x2'));var timeout=require('connect-timeout');var express=require(_0xe20c('0x3'));var router=express[_0xe20c('0x4')]();var fs_extra=require(_0xe20c('0x5'));var auth=require(_0xe20c('0x6'));var interaction=require(_0xe20c('0x7'));var config=require(_0xe20c('0x8'));var controller=require(_0xe20c('0x9'));router[_0xe20c('0xa')]('/',auth[_0xe20c('0xb')](),controller[_0xe20c('0xc')]);router[_0xe20c('0xa')](_0xe20c('0xd'),auth[_0xe20c('0xb')](),controller[_0xe20c('0xe')]);router[_0xe20c('0xa')](_0xe20c('0xf'),auth[_0xe20c('0xb')](),controller[_0xe20c('0x10')]);router[_0xe20c('0xa')](_0xe20c('0x11'),auth[_0xe20c('0xb')](),controller[_0xe20c('0x12')]);router[_0xe20c('0x13')]('/',auth[_0xe20c('0xb')](),controller['create']);router[_0xe20c('0x13')](_0xe20c('0xf'),auth[_0xe20c('0xb')](),controller[_0xe20c('0x14')]);router[_0xe20c('0x13')]('/:id/actions',auth[_0xe20c('0xb')](),controller[_0xe20c('0x15')]);router['put'](_0xe20c('0xd'),auth[_0xe20c('0xb')](),controller[_0xe20c('0x16')]);router['delete'](_0xe20c('0xd'),auth[_0xe20c('0xb')](),controller[_0xe20c('0x17')]);module[_0xe20c('0x18')]=router;
\ No newline at end of file
+var _0x117d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4af95c,_0x40708f){var _0x28c01f=function(_0x3fae4e){while(--_0x3fae4e){_0x4af95c['push'](_0x4af95c['shift']());}};_0x28c01f(++_0x40708f);}(_0x117d,0xac));var _0xd117=function(_0x47568e,_0x5ccdaf){_0x47568e=_0x47568e-0x0;var _0x33815b=_0x117d[_0x47568e];return _0x33815b;};'use strict';var multer=require(_0xd117('0x0'));var util=require(_0xd117('0x1'));var path=require(_0xd117('0x2'));var timeout=require('connect-timeout');var express=require(_0xd117('0x3'));var router=express[_0xd117('0x4')]();var fs_extra=require(_0xd117('0x5'));var auth=require(_0xd117('0x6'));var interaction=require(_0xd117('0x7'));var config=require('../../config/environment');var controller=require(_0xd117('0x8'));router[_0xd117('0x9')]('/',auth[_0xd117('0xa')](),controller[_0xd117('0xb')]);router['get']('/:id',auth[_0xd117('0xa')](),controller[_0xd117('0xc')]);router[_0xd117('0x9')](_0xd117('0xd'),auth[_0xd117('0xa')](),controller[_0xd117('0xe')]);router[_0xd117('0x9')](_0xd117('0xf'),auth[_0xd117('0xa')](),controller[_0xd117('0x10')]);router[_0xd117('0x11')]('/',auth[_0xd117('0xa')](),controller[_0xd117('0x12')]);router['post'](_0xd117('0xd'),auth[_0xd117('0xa')](),controller[_0xd117('0x13')]);router[_0xd117('0x11')](_0xd117('0xf'),auth['isAuthenticated'](),controller['addActions']);router[_0xd117('0x14')]('/:id',auth[_0xd117('0xa')](),controller[_0xd117('0x15')]);router[_0xd117('0x16')]('/:id',auth[_0xd117('0xa')](),controller[_0xd117('0x17')]);module[_0xd117('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index b887200..215bbe0 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 _0xc576=['ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC'];(function(_0x22b2ba,_0x5733c7){var _0x2d159a=function(_0x37b177){while(--_0x37b177){_0x22b2ba['push'](_0x22b2ba['shift']());}};_0x2d159a(++_0x5733c7);}(_0xc576,0xf9));var _0x6c57=function(_0x3fb5eb,_0x5947a6){_0x3fb5eb=_0x3fb5eb-0x0;var _0x481291=_0xc576[_0x3fb5eb];return _0x481291;};'use strict';var Sequelize=require(_0x6c57('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x6c57('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x6c57('0x2')](_0x6c57('0x3')),'allowNull':![],'defaultValue':_0x6c57('0x3')},'description':{'type':Sequelize[_0x6c57('0x4')]},'active':{'type':Sequelize[_0x6c57('0x5')],'defaultValue':0x0,'comment':_0x6c57('0x6')},'limitCalls':{'type':Sequelize[_0x6c57('0x7')](0x4)[_0x6c57('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x6c57('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6c57('0x4')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x6c57('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c57('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x6c57('0x7')](0x3)[_0x6c57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c57('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6c57('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6c57('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x6c57('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c57('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x6c57('0x7')](0x5)[_0x6c57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x6c57('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x6c57('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6c57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x6c57('0x7')](0x3)[_0x6c57('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x6c57('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6c57('0x4')],'defaultValue':_0x6c57('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x6c57('0x2')]('always',_0x6c57('0xf'),'onlyIfOpen'),'defaultValue':_0x6c57('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x6c57('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x6c57('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x6c57('0x7')](0x9)[_0x6c57('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6c57('0x7')](0x9)[_0x6c57('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6c57('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x6c57('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x6c57('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6c57('0x13')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x6c57('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6c57('0x7')](0x9)[_0x6c57('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x6c57('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6c57('0x14')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x6c57('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6c57('0x15')},'dialOrderByScheduledAt':{'type':Sequelize[_0x6c57('0x2')](_0x6c57('0x16'),_0x6c57('0x17')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x6c57('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6c57('0x7')](0x3)[_0x6c57('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6c57('0x18')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x6c57('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6c57('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6c57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x6c57('0x7')](0x3)[_0x6c57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c57('0x1a')},'dialDropRetryFrequency':{'type':Sequelize[_0x6c57('0x7')](0x5)[_0x6c57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6c57('0x1b')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6c57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c57('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6c57('0x1d')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c57('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize[_0x6c57('0x7')](0x5)[_0x6c57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6c57('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6c57('0x7')](0x3)[_0x6c57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c57('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6c57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6c57('0x21')}};
\ No newline at end of file
+var _0x99de=['onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','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)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','never'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x99de,0x194));var _0xe99d=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0x99de[_0xe30e17];return _0x2342c9;};'use strict';var Sequelize=require(_0xe99d('0x0'));module['exports']={'name':{'type':Sequelize[_0xe99d('0x1')],'unique':_0xe99d('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0xe99d('0x3')},'description':{'type':Sequelize[_0xe99d('0x1')]},'active':{'type':Sequelize[_0xe99d('0x4')],'defaultValue':0x0,'comment':_0xe99d('0x5')},'limitCalls':{'type':Sequelize[_0xe99d('0x6')](0x4)[_0xe99d('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xe99d('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe99d('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xe99d('0x6')](0x3)[_0xe99d('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe99d('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe99d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe99d('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe99d('0x6')](0x5)[_0xe99d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe99d('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xe99d('0x6')](0x3)[_0xe99d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xe99d('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe99d('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe99d('0x6')](0x3)[_0xe99d('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe99d('0x6')](0x5)[_0xe99d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe99d('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe99d('0xc')},'dialTimezone':{'type':Sequelize[_0xe99d('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xe99d('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0xe99d('0xe')]('always',_0xe99d('0xf'),_0xe99d('0x10')),'defaultValue':_0xe99d('0x11')},'dialAMDActive':{'type':Sequelize[_0xe99d('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xe99d('0x6')](0x9)[_0xe99d('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe99d('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xe99d('0x6')](0x9)[_0xe99d('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe99d('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe99d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe99d('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe99d('0x6')](0x9)[_0xe99d('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe99d('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xe99d('0x6')](0x9)[_0xe99d('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe99d('0x6')](0x9)[_0xe99d('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe99d('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe99d('0x6')](0x9)[_0xe99d('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe99d('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xe99d('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe99d('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe99d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe99d('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe99d('0xe')]('DESC',_0xe99d('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xe99d('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe99d('0x6')](0x3)[_0xe99d('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe99d('0x1b')},'dialCutDigit':{'type':Sequelize[_0xe99d('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe99d('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe99d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe99d('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe99d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe99d('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe99d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe99d('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe99d('0x6')](0x3)[_0xe99d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe99d('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xe99d('0x6')](0x3)[_0xe99d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe99d('0x20')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe99d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe99d('0x6')](0x3)[_0xe99d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe99d('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe99d('0x6')](0x5)[_0xe99d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe99d('0x22')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 1d3f74a..825faee 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 _0xbc5e=['../../config/utils','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','options','includeAll','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','include','merge','updatedAt','omit','createdAt','update','getHoppers','CmHopper','getHopperHistories','findOne','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','dialCheckDuplicateType','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','ContactId','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','NOW()','phone\x20NOT\x20IN\x20(?)','cm_hopper_additional_phones','OrderBy','h.id','ci.item','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','YYYY-MM-DD\x20HH:mm:ss','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0xa277de,_0x2ad712){var _0x27c2da=function(_0x349646){while(--_0x349646){_0xa277de['push'](_0xa277de['shift']());}};_0x27c2da(++_0x2ad712);}(_0xbc5e,0x7d));var _0xebc5=function(_0xd84fcd,_0x317f0f){_0xd84fcd=_0xd84fcd-0x0;var _0x20eb2b=_0xbc5e[_0xd84fcd];return _0x20eb2b;};'use strict';var emlformat=require(_0xebc5('0x0'));var rimraf=require(_0xebc5('0x1'));var zipdir=require(_0xebc5('0x2'));var jsonpatch=require(_0xebc5('0x3'));var rp=require(_0xebc5('0x4'));var moment=require(_0xebc5('0x5'));var BPromise=require(_0xebc5('0x6'));var Mustache=require(_0xebc5('0x7'));var util=require(_0xebc5('0x8'));var path=require('path');var sox=require(_0xebc5('0x9'));var csv=require(_0xebc5('0xa'));var ejs=require(_0xebc5('0xb'));var fs=require('fs');var fs_extra=require(_0xebc5('0xc'));var _=require(_0xebc5('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xebc5('0xe'));var deskjs=require(_0xebc5('0xf'));var toCsv=require(_0xebc5('0xa'));var querystring=require(_0xebc5('0x10'));var Papa=require('papaparse');var Redis=require(_0xebc5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xebc5('0x12'));var as=require(_0xebc5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xebc5('0x14'))(_0xebc5('0x15'));var utils=require(_0xebc5('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x564553,_0x477bc4){_0x477bc4=_0x477bc4||0xcc;return function(_0x30e6f4){if(_0x30e6f4){return _0x564553[_0xebc5('0x17')](_0x477bc4);}return _0x564553[_0xebc5('0x18')](_0x477bc4)[_0xebc5('0x19')]();};}function respondWithResult(_0x23805a,_0x5ba6c1){_0x5ba6c1=_0x5ba6c1||0xc8;return function(_0x375e29){if(_0x375e29){return _0x23805a['status'](_0x5ba6c1)[_0xebc5('0x1a')](_0x375e29);}};}function respondWithFilteredResult(_0x5eff85,_0x4ae3c6){return function(_0x3e903f){if(_0x3e903f){var _0x5489e9=typeof _0x4ae3c6['offset']===_0xebc5('0x1b')&&typeof _0x4ae3c6[_0xebc5('0x1c')]===_0xebc5('0x1b');var _0x21cbdf=_0x3e903f[_0xebc5('0x1d')];var _0x38d629=_0x5489e9?0x0:_0x4ae3c6['offset'];var _0x1aeef3=_0x5489e9?_0x3e903f[_0xebc5('0x1d')]:_0x4ae3c6['offset']+_0x4ae3c6[_0xebc5('0x1c')];var _0x1b1584;if(_0x1aeef3>=_0x21cbdf){_0x1aeef3=_0x21cbdf;_0x1b1584=0xc8;}else{_0x1b1584=0xce;}_0x5eff85['status'](_0x1b1584);return _0x5eff85[_0xebc5('0x1e')](_0xebc5('0x1f'),_0x38d629+'-'+_0x1aeef3+'/'+_0x21cbdf)[_0xebc5('0x1a')](_0x3e903f);}return null;};}function patchUpdates(_0x2170b6){return function(_0x3aff8d){try{jsonpatch['apply'](_0x3aff8d,_0x2170b6,!![]);}catch(_0x4f0a7f){return BPromise['reject'](_0x4f0a7f);}return _0x3aff8d[_0xebc5('0x20')]();};}function saveUpdates(_0x4af3d1,_0x257754){return function(_0x37ac8d){if(_0x37ac8d){return _0x37ac8d['update'](_0x4af3d1)[_0xebc5('0x21')](function(_0x1b247f){return _0x1b247f;});}return null;};}function removeEntity(_0x582541,_0x2be067){return function(_0x3ce69b){if(_0x3ce69b){return _0x3ce69b[_0xebc5('0x22')]()[_0xebc5('0x21')](function(){var _0x46394c=_0x3ce69b[_0xebc5('0x23')]({'plain':!![]});var _0x33bf29='IvrCampaigns';return db[_0xebc5('0x24')]['destroy']({'where':{'type':_0x33bf29,'resourceId':_0x46394c['id']}})[_0xebc5('0x21')](function(){return _0x3ce69b;});})[_0xebc5('0x21')](function(){_0x582541[_0xebc5('0x18')](0xcc)[_0xebc5('0x19')]();});}};}function handleEntityNotFound(_0x5b6127,_0x193cfe){return function(_0x5dfe9f){if(!_0x5dfe9f){_0x5b6127[_0xebc5('0x17')](0x194);}return _0x5dfe9f;};}function handleError(_0x255b72,_0x36faa3){_0x36faa3=_0x36faa3||0x1f4;return function(_0x46a04e){logger[_0xebc5('0x25')](_0x46a04e[_0xebc5('0x26')]);if(_0x46a04e[_0xebc5('0x27')]){delete _0x46a04e[_0xebc5('0x27')];}_0x255b72[_0xebc5('0x18')](_0x36faa3)[_0xebc5('0x28')](_0x46a04e);};}exports[_0xebc5('0x29')]=function(_0x3e53d0,_0x2acf91){var _0x204113={},_0x531ec2={},_0x120574={'count':0x0,'rows':[]};var _0x55579d=_[_0xebc5('0x2a')](db[_0xebc5('0x2b')][_0xebc5('0x2c')],function(_0x9e791f){return{'name':_0x9e791f[_0xebc5('0x2d')],'type':_0x9e791f[_0xebc5('0x2e')][_0xebc5('0x2f')]};});_0x531ec2[_0xebc5('0x30')]=_[_0xebc5('0x2a')](_0x55579d,'name');_0x531ec2['query']=_['keys'](_0x3e53d0[_0xebc5('0x31')]);_0x531ec2['filters']=_[_0xebc5('0x32')](_0x531ec2[_0xebc5('0x30')],_0x531ec2['query']);_0x204113['attributes']=_['intersection'](_0x531ec2[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x33')]));_0x204113['attributes']=_0x204113[_0xebc5('0x34')]['length']?_0x204113[_0xebc5('0x34')]:_0x531ec2[_0xebc5('0x30')];if(!_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x35')](_0xebc5('0x36'))){_0x204113[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0x3e53d0[_0xebc5('0x31')]['limit']);_0x204113[_0xebc5('0x37')]=qs[_0xebc5('0x37')](_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x37')]);}_0x204113[_0xebc5('0x38')]=qs['sort'](_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x39')]);_0x204113[_0xebc5('0x3a')]=qs[_0xebc5('0x3b')](_[_0xebc5('0x3c')](_0x3e53d0[_0xebc5('0x31')],_0x531ec2[_0xebc5('0x3b')]),_0x55579d);if(_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x3d')]){_0x204113['where']=_['merge'](_0x204113[_0xebc5('0x3a')],{'$or':_[_0xebc5('0x2a')](_0x55579d,function(_0x191f1){if(_0x191f1['type']!=='VIRTUAL'){var _0x509adc={};_0x509adc[_0x191f1['name']]={'$like':'%'+_0x3e53d0[_0xebc5('0x31')]['filter']+'%'};return _0x509adc;}})});}_0x204113=_['merge']({},_0x204113,_0x3e53d0[_0xebc5('0x3e')]);var _0x25201a={'where':_0x204113[_0xebc5('0x3a')]};return db[_0xebc5('0x2b')][_0xebc5('0x1d')](_0x25201a)['then'](function(_0x529d35){_0x120574['count']=_0x529d35;if(_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x204113['include']=[{'all':!![]}];}return db[_0xebc5('0x2b')][_0xebc5('0x40')](_0x204113);})[_0xebc5('0x21')](function(_0x1135b9){_0x120574[_0xebc5('0x41')]=_0x1135b9;return _0x120574;})['then'](respondWithFilteredResult(_0x2acf91,_0x204113))[_0xebc5('0x42')](handleError(_0x2acf91,null));};exports[_0xebc5('0x43')]=function(_0x13640e,_0x476200){var _0x3c4801={'raw':![],'where':{'id':_0x13640e[_0xebc5('0x44')]['id']}},_0x4d802b={};_0x4d802b[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x2b')][_0xebc5('0x2c')]);_0x4d802b[_0xebc5('0x31')]=_[_0xebc5('0x45')](_0x13640e[_0xebc5('0x31')]);_0x4d802b[_0xebc5('0x3b')]=_[_0xebc5('0x32')](_0x4d802b[_0xebc5('0x30')],_0x4d802b[_0xebc5('0x31')]);_0x3c4801[_0xebc5('0x34')]=_['intersection'](_0x4d802b[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x13640e['query'][_0xebc5('0x33')]));_0x3c4801[_0xebc5('0x34')]=_0x3c4801[_0xebc5('0x34')]['length']?_0x3c4801['attributes']:_0x4d802b['model'];if(_0x13640e[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x3c4801['include']=[{'all':!![]}];}_0x3c4801=_['merge']({},_0x3c4801,_0x13640e[_0xebc5('0x3e')]);return db['Campaign'][_0xebc5('0x46')](_0x3c4801)[_0xebc5('0x21')](handleEntityNotFound(_0x476200,null))[_0xebc5('0x21')](respondWithResult(_0x476200,null))[_0xebc5('0x42')](handleError(_0x476200,null));};exports[_0xebc5('0x47')]=function(_0x2fb8b2,_0x5eff33){return db[_0xebc5('0x2b')][_0xebc5('0x47')](_0x2fb8b2[_0xebc5('0x48')],{})[_0xebc5('0x21')](function(_0x340c3e){var _0x3f9054=_0x2fb8b2[_0xebc5('0x49')][_0xebc5('0x23')]({'plain':!![]});if(!_0x3f9054)throw new Error(_0xebc5('0x4a'));if(_0x3f9054[_0xebc5('0x4b')]===_0xebc5('0x49')){var _0x57bbc9=_0x340c3e[_0xebc5('0x23')]({'plain':!![]});var _0x30242a=_0xebc5('0x4c');return db[_0xebc5('0x4d')][_0xebc5('0x46')]({'where':{'name':_0x30242a,'userProfileId':_0x3f9054[_0xebc5('0x4e')]},'raw':!![]})[_0xebc5('0x21')](function(_0x278810){if(_0x278810&&_0x278810[_0xebc5('0x4f')]===0x0){return db['UserProfileResource'][_0xebc5('0x47')]({'name':_0x57bbc9['name'],'resourceId':_0x57bbc9['id'],'type':_0x278810['name'],'sectionId':_0x278810['id']},{})[_0xebc5('0x21')](function(){return _0x340c3e;});}else{return _0x340c3e;}})[_0xebc5('0x42')](function(_0x456c82){logger[_0xebc5('0x25')](_0xebc5('0x50'),_0x456c82);throw _0x456c82;});}return _0x340c3e;})[_0xebc5('0x21')](respondWithResult(_0x5eff33,0xc9))[_0xebc5('0x42')](handleError(_0x5eff33,null));};exports[_0xebc5('0x51')]=function(_0x2d5eb0,_0x2f9d7e){var _0x160ba6={'where':{'id':_0x2d5eb0[_0xebc5('0x44')]['id']}},_0x3e68a9={};_0x3e68a9[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x2b')]['rawAttributes']);_0x160ba6[_0xebc5('0x34')]=_[_0xebc5('0x32')](_0x3e68a9[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x2d5eb0[_0xebc5('0x31')][_0xebc5('0x33')]));_0x160ba6[_0xebc5('0x34')]=_0x160ba6[_0xebc5('0x34')][_0xebc5('0x52')]?_0x160ba6[_0xebc5('0x34')]:_0x3e68a9[_0xebc5('0x30')];if(_0x2d5eb0[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x160ba6[_0xebc5('0x53')]=[{'all':!![]}];}_0x160ba6=_[_0xebc5('0x54')]({},_0x160ba6,_0x2d5eb0[_0xebc5('0x3e')]);return db[_0xebc5('0x2b')][_0xebc5('0x46')](_0x160ba6)[_0xebc5('0x21')](handleEntityNotFound(_0x2f9d7e,null))[_0xebc5('0x21')](function(_0x423615){if(_0x423615){var _0x1c49e2=_0x423615[_0xebc5('0x23')]({'plain':!![]});_0x1c49e2=qs['omit'](_0x1c49e2,['id','createdAt',_0xebc5('0x55')]);_0x2d5eb0[_0xebc5('0x48')]=_[_0xebc5('0x56')](_0x2d5eb0['body'],['id',_0xebc5('0x57'),_0xebc5('0x55')]);return db[_0xebc5('0x2b')][_0xebc5('0x47')](_[_0xebc5('0x54')](_0x1c49e2,_0x2d5eb0[_0xebc5('0x48')]),{'include':_0x2d5eb0[_0xebc5('0x31')][_0xebc5('0x3f')]?[{'all':!![]}]:undefined})[_0xebc5('0x21')](function(_0x37c1f5){var _0x467ace=_0x2d5eb0[_0xebc5('0x49')][_0xebc5('0x23')]({'plain':!![]});if(!_0x467ace)throw new Error(_0xebc5('0x4a'));if(_0x467ace[_0xebc5('0x4b')]==='user'){var _0x369fad=_0x37c1f5[_0xebc5('0x23')]({'plain':!![]});var _0x1d0cdd=_0xebc5('0x4c');return db[_0xebc5('0x4d')][_0xebc5('0x46')]({'where':{'name':_0x1d0cdd,'userProfileId':_0x467ace[_0xebc5('0x4e')]},'raw':!![]})[_0xebc5('0x21')](function(_0x2400bc){if(_0x2400bc&&_0x2400bc['autoAssociation']===0x0){return db['UserProfileResource'][_0xebc5('0x47')]({'name':_0x369fad[_0xebc5('0x27')],'resourceId':_0x369fad['id'],'type':_0x2400bc[_0xebc5('0x27')],'sectionId':_0x2400bc['id']},{})[_0xebc5('0x21')](function(){return _0x37c1f5;});}else{return _0x37c1f5;}})[_0xebc5('0x42')](function(_0x257c4f){logger[_0xebc5('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x257c4f);throw _0x257c4f;});}return _0x37c1f5;});}})[_0xebc5('0x21')](respondWithResult(_0x2f9d7e,0xc9))['catch'](handleError(_0x2f9d7e,null));};exports[_0xebc5('0x58')]=function(_0x5b9b89,_0x455776){if(_0x5b9b89[_0xebc5('0x48')]['id']){delete _0x5b9b89[_0xebc5('0x48')]['id'];}return db[_0xebc5('0x2b')][_0xebc5('0x46')]({'where':{'id':_0x5b9b89[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x455776,null))['then'](saveUpdates(_0x5b9b89[_0xebc5('0x48')],null))['then'](respondWithResult(_0x455776,null))['catch'](handleError(_0x455776,null));};exports[_0xebc5('0x22')]=function(_0x3fde32,_0x16ed66){return db[_0xebc5('0x2b')]['find']({'where':{'id':_0x3fde32[_0xebc5('0x44')]['id']}})['then'](handleEntityNotFound(_0x16ed66,null))[_0xebc5('0x21')](removeEntity(_0x16ed66,null))[_0xebc5('0x42')](handleError(_0x16ed66,null));};exports[_0xebc5('0x59')]=function(_0x1045ed,_0xaa81fe,_0x24b593){var _0x5ad9ca={'raw':!![],'where':{}};var _0x5bd876={};var _0x446431={'count':0x0,'rows':[]};return db[_0xebc5('0x2b')]['findOne']({'where':{'id':_0x1045ed[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0xaa81fe,null))[_0xebc5('0x21')](function(_0x539777){if(_0x539777){_0x5bd876[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x5a')][_0xebc5('0x2c')]);_0x5bd876['query']=_[_0xebc5('0x45')](_0x1045ed[_0xebc5('0x31')]);_0x5bd876[_0xebc5('0x3b')]=_[_0xebc5('0x32')](_0x5bd876['model'],_0x5bd876[_0xebc5('0x31')]);_0x5ad9ca[_0xebc5('0x34')]=_[_0xebc5('0x32')](_0x5bd876[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x1045ed['query']['fields']));_0x5ad9ca[_0xebc5('0x34')]=_0x5ad9ca[_0xebc5('0x34')][_0xebc5('0x52')]?_0x5ad9ca['attributes']:_0x5bd876[_0xebc5('0x30')];if(!_0x1045ed[_0xebc5('0x31')][_0xebc5('0x35')](_0xebc5('0x36'))){_0x5ad9ca[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0x1045ed[_0xebc5('0x31')][_0xebc5('0x1c')]);_0x5ad9ca[_0xebc5('0x37')]=qs[_0xebc5('0x37')](_0x1045ed[_0xebc5('0x31')][_0xebc5('0x37')]);}_0x5ad9ca[_0xebc5('0x38')]=qs[_0xebc5('0x39')](_0x1045ed[_0xebc5('0x31')][_0xebc5('0x39')]);_0x5ad9ca[_0xebc5('0x3a')]=qs[_0xebc5('0x3b')](_[_0xebc5('0x3c')](_0x1045ed[_0xebc5('0x31')],_0x5bd876['filters']));_0x5ad9ca[_0xebc5('0x3a')]['CampaignId']=_0x539777['id'];if(_0x1045ed[_0xebc5('0x31')]['filter']){_0x5ad9ca[_0xebc5('0x3a')]=_[_0xebc5('0x54')](_0x5ad9ca[_0xebc5('0x3a')],{'$or':_['map'](_0x5ad9ca[_0xebc5('0x34')],function(_0x22c5b1){var _0xd9d7cd={};_0xd9d7cd[_0x22c5b1]={'$like':'%'+_0x1045ed[_0xebc5('0x31')][_0xebc5('0x3d')]+'%'};return _0xd9d7cd;})});}_0x5ad9ca=_[_0xebc5('0x54')]({},_0x5ad9ca,_0x1045ed[_0xebc5('0x3e')]);return db[_0xebc5('0x5a')]['count']({'where':_0x5ad9ca['where']})[_0xebc5('0x21')](function(_0x312e74){_0x446431[_0xebc5('0x1d')]=_0x312e74;if(_0x1045ed[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x5ad9ca[_0xebc5('0x53')]=[{'all':!![]}];}return db['CmHopper'][_0xebc5('0x40')](_0x5ad9ca);})['then'](function(_0x210c2e){_0x446431['rows']=_0x210c2e;return _0x446431;});}})[_0xebc5('0x21')](respondWithFilteredResult(_0xaa81fe,_0x5ad9ca))[_0xebc5('0x42')](handleError(_0xaa81fe,null));};exports[_0xebc5('0x5b')]=function(_0x489c71,_0x35cb37,_0x3f12a5){var _0x191376={'raw':!![],'where':{}};var _0x40cbd4={};var _0x44bbd6={'count':0x0,'rows':[]};return db[_0xebc5('0x2b')][_0xebc5('0x5c')]({'where':{'id':_0x489c71[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x35cb37,null))['then'](function(_0x340692){if(_0x340692){_0x40cbd4[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x5d')][_0xebc5('0x2c')]);_0x40cbd4['query']=_[_0xebc5('0x45')](_0x489c71[_0xebc5('0x31')]);_0x40cbd4[_0xebc5('0x3b')]=_[_0xebc5('0x32')](_0x40cbd4[_0xebc5('0x30')],_0x40cbd4[_0xebc5('0x31')]);_0x191376[_0xebc5('0x34')]=_[_0xebc5('0x32')](_0x40cbd4[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x489c71[_0xebc5('0x31')][_0xebc5('0x33')]));_0x191376[_0xebc5('0x34')]=_0x191376['attributes']['length']?_0x191376[_0xebc5('0x34')]:_0x40cbd4['model'];if(!_0x489c71['query'][_0xebc5('0x35')](_0xebc5('0x36'))){_0x191376[_0xebc5('0x1c')]=qs['limit'](_0x489c71[_0xebc5('0x31')][_0xebc5('0x1c')]);_0x191376[_0xebc5('0x37')]=qs[_0xebc5('0x37')](_0x489c71[_0xebc5('0x31')][_0xebc5('0x37')]);}_0x191376[_0xebc5('0x38')]=qs[_0xebc5('0x39')](_0x489c71['query'][_0xebc5('0x39')]);_0x191376[_0xebc5('0x3a')]=qs['filters'](_[_0xebc5('0x3c')](_0x489c71['query'],_0x40cbd4[_0xebc5('0x3b')]));_0x191376[_0xebc5('0x3a')][_0xebc5('0x5e')]=_0x340692['id'];if(_0x489c71[_0xebc5('0x31')][_0xebc5('0x3d')]){_0x191376[_0xebc5('0x3a')]=_[_0xebc5('0x54')](_0x191376[_0xebc5('0x3a')],{'$or':_[_0xebc5('0x2a')](_0x191376[_0xebc5('0x34')],function(_0x2ba010){var _0x125536={};_0x125536[_0x2ba010]={'$like':'%'+_0x489c71[_0xebc5('0x31')][_0xebc5('0x3d')]+'%'};return _0x125536;})});}_0x191376=_[_0xebc5('0x54')]({},_0x191376,_0x489c71['options']);return db['CmHopperHistory'][_0xebc5('0x1d')]({'where':_0x191376[_0xebc5('0x3a')]})[_0xebc5('0x21')](function(_0x1b8346){_0x44bbd6[_0xebc5('0x1d')]=_0x1b8346;if(_0x489c71['query'][_0xebc5('0x3f')]){_0x191376['include']=[{'all':!![]}];}return db[_0xebc5('0x5d')]['findAll'](_0x191376);})['then'](function(_0x1f10f5){_0x44bbd6[_0xebc5('0x41')]=_0x1f10f5;return _0x44bbd6;});}})[_0xebc5('0x21')](respondWithFilteredResult(_0x35cb37,_0x191376))[_0xebc5('0x42')](handleError(_0x35cb37,null));};exports[_0xebc5('0x5f')]=function(_0x520d0a,_0x58c769,_0x2755c0){var _0x15dc05={'raw':!![],'where':{}};var _0x19cdf0={};var _0x3dabd3={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x520d0a[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x58c769,null))[_0xebc5('0x21')](function(_0x32b7f7){if(_0x32b7f7){_0x19cdf0[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x60')][_0xebc5('0x2c')]);_0x19cdf0['query']=_[_0xebc5('0x45')](_0x520d0a[_0xebc5('0x31')]);_0x19cdf0[_0xebc5('0x3b')]=_['intersection'](_0x19cdf0[_0xebc5('0x30')],_0x19cdf0[_0xebc5('0x31')]);_0x15dc05[_0xebc5('0x34')]=_['intersection'](_0x19cdf0[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x520d0a[_0xebc5('0x31')]['fields']));_0x15dc05[_0xebc5('0x34')]=_0x15dc05[_0xebc5('0x34')][_0xebc5('0x52')]?_0x15dc05[_0xebc5('0x34')]:_0x19cdf0['model'];if(!_0x520d0a[_0xebc5('0x31')][_0xebc5('0x35')](_0xebc5('0x36'))){_0x15dc05[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0x520d0a[_0xebc5('0x31')][_0xebc5('0x1c')]);_0x15dc05[_0xebc5('0x37')]=qs['offset'](_0x520d0a[_0xebc5('0x31')]['offset']);}_0x15dc05['order']=qs[_0xebc5('0x39')](_0x520d0a[_0xebc5('0x31')]['sort']);_0x15dc05[_0xebc5('0x3a')]=qs[_0xebc5('0x3b')](_[_0xebc5('0x3c')](_0x520d0a[_0xebc5('0x31')],_0x19cdf0[_0xebc5('0x3b')]));_0x15dc05[_0xebc5('0x3a')][_0xebc5('0x5e')]=_0x32b7f7['id'];if(_0x520d0a['query'][_0xebc5('0x3d')]){_0x15dc05[_0xebc5('0x3a')]=_['merge'](_0x15dc05[_0xebc5('0x3a')],{'$or':_['map'](_0x15dc05[_0xebc5('0x34')],function(_0xaf8aaa){var _0xd7840c={};_0xd7840c[_0xaf8aaa]={'$like':'%'+_0x520d0a[_0xebc5('0x31')][_0xebc5('0x3d')]+'%'};return _0xd7840c;})});}_0x15dc05=_['merge']({},_0x15dc05,_0x520d0a[_0xebc5('0x3e')]);return db['CmHopperFinal'][_0xebc5('0x1d')]({'where':_0x15dc05[_0xebc5('0x3a')]})[_0xebc5('0x21')](function(_0x124749){_0x3dabd3[_0xebc5('0x1d')]=_0x124749;if(_0x520d0a[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x15dc05[_0xebc5('0x53')]=[{'all':!![]}];}return db[_0xebc5('0x60')][_0xebc5('0x40')](_0x15dc05);})[_0xebc5('0x21')](function(_0x4f74c4){_0x3dabd3[_0xebc5('0x41')]=_0x4f74c4;return _0x3dabd3;});}})[_0xebc5('0x21')](respondWithFilteredResult(_0x58c769,_0x15dc05))[_0xebc5('0x42')](handleError(_0x58c769,null));};exports[_0xebc5('0x61')]=function(_0xb158c5,_0x461354,_0xe6b6f2){var _0x47f258={'raw':!![],'where':{}};var _0xbf1bca={};var _0x404401={'count':0x0,'rows':[]};return db[_0xebc5('0x2b')][_0xebc5('0x5c')]({'where':{'id':_0xb158c5[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x461354,null))['then'](function(_0x2aa8bd){if(_0x2aa8bd){_0xbf1bca[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x62')][_0xebc5('0x2c')]);_0xbf1bca['query']=_[_0xebc5('0x45')](_0xb158c5['query']);_0xbf1bca[_0xebc5('0x3b')]=_['intersection'](_0xbf1bca[_0xebc5('0x30')],_0xbf1bca[_0xebc5('0x31')]);_0x47f258[_0xebc5('0x34')]=_[_0xebc5('0x32')](_0xbf1bca[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0xb158c5['query'][_0xebc5('0x33')]));_0x47f258[_0xebc5('0x34')]=_0x47f258[_0xebc5('0x34')][_0xebc5('0x52')]?_0x47f258['attributes']:_0xbf1bca[_0xebc5('0x30')];if(!_0xb158c5[_0xebc5('0x31')][_0xebc5('0x35')](_0xebc5('0x36'))){_0x47f258[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0xb158c5['query'][_0xebc5('0x1c')]);_0x47f258[_0xebc5('0x37')]=qs[_0xebc5('0x37')](_0xb158c5[_0xebc5('0x31')][_0xebc5('0x37')]);}_0x47f258['order']=qs[_0xebc5('0x39')](_0xb158c5[_0xebc5('0x31')][_0xebc5('0x39')]);_0x47f258[_0xebc5('0x3a')]=qs[_0xebc5('0x3b')](_[_0xebc5('0x3c')](_0xb158c5[_0xebc5('0x31')],_0xbf1bca[_0xebc5('0x3b')]));_0x47f258['where'][_0xebc5('0x5e')]=_0x2aa8bd['id'];if(_0xb158c5[_0xebc5('0x31')][_0xebc5('0x3d')]){_0x47f258[_0xebc5('0x3a')]=_['merge'](_0x47f258[_0xebc5('0x3a')],{'$or':_['map'](_0x47f258[_0xebc5('0x34')],function(_0x140882){var _0x21d567={};_0x21d567[_0x140882]={'$like':'%'+_0xb158c5[_0xebc5('0x31')][_0xebc5('0x3d')]+'%'};return _0x21d567;})});}_0x47f258=_[_0xebc5('0x54')]({},_0x47f258,_0xb158c5[_0xebc5('0x3e')]);return db[_0xebc5('0x62')][_0xebc5('0x1d')]({'where':_0x47f258[_0xebc5('0x3a')]})[_0xebc5('0x21')](function(_0xddda9e){_0x404401[_0xebc5('0x1d')]=_0xddda9e;if(_0xb158c5['query'][_0xebc5('0x3f')]){_0x47f258[_0xebc5('0x53')]=[{'all':!![]}];}return db[_0xebc5('0x62')][_0xebc5('0x40')](_0x47f258);})[_0xebc5('0x21')](function(_0x406f51){_0x404401[_0xebc5('0x41')]=_0x406f51;return _0x404401;});}})[_0xebc5('0x21')](respondWithFilteredResult(_0x461354,_0x47f258))[_0xebc5('0x42')](handleError(_0x461354,null));};exports[_0xebc5('0x63')]=function(_0x4eca5f,_0x7d7580,_0x5c4438){var _0x4e61e8={};var _0xea1b61={};var _0x1bafa8;var _0x27e7d2;return db['Campaign'][_0xebc5('0x5c')]({'where':{'id':_0x4eca5f[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x7d7580,null))[_0xebc5('0x21')](function(_0x987003){if(_0x987003){_0x1bafa8=_0x987003;_0xea1b61[_0xebc5('0x30')]=_[_0xebc5('0x45')](db['CmList'][_0xebc5('0x2c')]);_0xea1b61[_0xebc5('0x31')]=_['keys'](_0x4eca5f[_0xebc5('0x31')]);_0xea1b61['filters']=_[_0xebc5('0x32')](_0xea1b61['model'],_0xea1b61[_0xebc5('0x31')]);_0x4e61e8['attributes']=_[_0xebc5('0x32')](_0xea1b61[_0xebc5('0x30')],qs['fields'](_0x4eca5f[_0xebc5('0x31')][_0xebc5('0x33')]));_0x4e61e8[_0xebc5('0x34')]=_0x4e61e8[_0xebc5('0x34')]['length']?_0x4e61e8['attributes']:_0xea1b61[_0xebc5('0x30')];_0x4e61e8[_0xebc5('0x38')]=qs[_0xebc5('0x39')](_0x4eca5f['query'][_0xebc5('0x39')]);_0x4e61e8[_0xebc5('0x3a')]=qs['filters'](_[_0xebc5('0x3c')](_0x4eca5f['query'],_0xea1b61[_0xebc5('0x3b')]));if(_0x4eca5f[_0xebc5('0x31')][_0xebc5('0x3d')]){_0x4e61e8[_0xebc5('0x3a')]=_[_0xebc5('0x54')](_0x4e61e8[_0xebc5('0x3a')],{'$or':_[_0xebc5('0x2a')](_0x4e61e8[_0xebc5('0x34')],function(_0x89c32e){var _0x2b763a={};_0x2b763a[_0x89c32e]={'$like':'%'+_0x4eca5f[_0xebc5('0x31')]['filter']+'%'};return _0x2b763a;})});}_0x4e61e8=_[_0xebc5('0x54')]({},_0x4e61e8,_0x4eca5f['options']);return _0x1bafa8[_0xebc5('0x63')](_0x4e61e8);}})['then'](function(_0x51f7d9){if(_0x51f7d9){_0x27e7d2=_0x51f7d9['length'];if(!_0x4eca5f[_0xebc5('0x31')]['hasOwnProperty'](_0xebc5('0x36'))){_0x4e61e8[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0x4eca5f[_0xebc5('0x31')][_0xebc5('0x1c')]);_0x4e61e8['offset']=qs['offset'](_0x4eca5f[_0xebc5('0x31')]['offset']);}return _0x1bafa8['getLists'](_0x4e61e8);}})[_0xebc5('0x21')](function(_0x2ef453){if(_0x2ef453){return _0x2ef453?{'count':_0x27e7d2,'rows':_0x2ef453}:null;}})[_0xebc5('0x21')](respondWithResult(_0x7d7580,null))[_0xebc5('0x42')](handleError(_0x7d7580,null));};exports[_0xebc5('0x64')]=function(_0x25e1f6,_0x11faa5,_0x162861){var _0x3d20a8,_0x190ae7;var _0x4c0071=[];var _0x3a7c0d=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0xebc5('0x2b')][_0xebc5('0x46')]({'where':{'id':_0x25e1f6[_0xebc5('0x44')]['id']}})['then'](handleEntityNotFound(_0x11faa5,null))['then'](function(_0x518b9d){if(_0x518b9d){_0x190ae7=_0x518b9d;return _0x518b9d[_0xebc5('0x64')](_0x25e1f6[_0xebc5('0x48')][_0xebc5('0x65')],_[_0xebc5('0x56')](_0x25e1f6['body'],[_0xebc5('0x65'),'id'])||{});}return null;})['spread'](function(_0x5f555e){var _0x5b0cb3;var _0x37af1a;_0x3d20a8=_0x5f555e||[];var _0xdd9934=[];if(_0x5f555e){for(var _0x23a30b=0x0;_0x23a30b<_0x5f555e[_0xebc5('0x52')];_0x23a30b+=0x1){var _0x4ebbbe=_0x5f555e[_0x23a30b]['get']({'plain':!![]});_0x190ae7[_0xebc5('0x66')]=_0x25e1f6[_0xebc5('0x48')][_0xebc5('0x66')]?_0x25e1f6[_0xebc5('0x48')]['dialCheckDuplicateType']:_0x190ae7['dialCheckDuplicateType'];switch(_0x190ae7[_0xebc5('0x66')]){case'always':_0x5b0cb3=squel['insert']()[_0xebc5('0x67')](_0xebc5('0x68'))[_0xebc5('0x69')]([_0xebc5('0x6a'),_0xebc5('0x6b'),'ContactId',_0xebc5('0x6c'),'CampaignId',_0xebc5('0x57'),_0xebc5('0x55')],squel[_0xebc5('0x6d')]()['field'](_0xebc5('0x6a'),'phone')['field']('NOW()',_0xebc5('0x6b'))[_0xebc5('0x6e')]('id',_0xebc5('0x6f'))[_0xebc5('0x6e')](_0x4ebbbe[_0xebc5('0x70')][_0xebc5('0x71')](),_0xebc5('0x6c'))[_0xebc5('0x6e')](_0x25e1f6[_0xebc5('0x44')]['id'][_0xebc5('0x71')](),_0xebc5('0x5e'))[_0xebc5('0x6e')]('\x27'+_0x3a7c0d+'\x27',_0xebc5('0x57'))[_0xebc5('0x6e')]('\x27'+_0x3a7c0d+'\x27',_0xebc5('0x55'))['from'](_0xebc5('0x72'))[_0xebc5('0x3a')](_0xebc5('0x73'))['where'](_0xebc5('0x74'),_0x4ebbbe['CmListId']['toString']())[_0xebc5('0x3a')](_0xebc5('0x75'))[_0xebc5('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xebc5('0x6d')]()['field'](_0xebc5('0x76'))[_0xebc5('0x77')](_0xebc5('0x78'))[_0xebc5('0x3a')](_0xebc5('0x79'),_0x25e1f6[_0xebc5('0x44')]['id']['toString']()))[_0xebc5('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xebc5('0x6d')]()[_0xebc5('0x6e')](_0xebc5('0x7a'))['from']('cm_hopper')[_0xebc5('0x3a')]('CampaignId\x20=\x20?',_0x25e1f6[_0xebc5('0x44')]['id'][_0xebc5('0x71')]())))[_0xebc5('0x71')]();break;case _0xebc5('0x7b'):_0x5b0cb3=squel[_0xebc5('0x7c')]()[_0xebc5('0x67')]('cm_hopper')[_0xebc5('0x69')]([_0xebc5('0x6a'),_0xebc5('0x6b'),'ContactId',_0xebc5('0x6c'),_0xebc5('0x5e'),'createdAt',_0xebc5('0x55')],squel['select']()[_0xebc5('0x6e')](_0xebc5('0x6a'),'phone')[_0xebc5('0x6e')](_0xebc5('0x7d'),_0xebc5('0x6b'))[_0xebc5('0x6e')]('id',_0xebc5('0x6f'))[_0xebc5('0x6e')](_0x4ebbbe[_0xebc5('0x70')]['toString'](),_0xebc5('0x6c'))[_0xebc5('0x6e')](_0x25e1f6[_0xebc5('0x44')]['id'][_0xebc5('0x71')](),_0xebc5('0x5e'))[_0xebc5('0x6e')]('\x27'+_0x3a7c0d+'\x27',_0xebc5('0x57'))[_0xebc5('0x6e')]('\x27'+_0x3a7c0d+'\x27',_0xebc5('0x55'))[_0xebc5('0x77')]('cm_contacts')[_0xebc5('0x3a')](_0xebc5('0x73'))[_0xebc5('0x3a')](_0xebc5('0x74'),_0x4ebbbe['CmListId'][_0xebc5('0x71')]())[_0xebc5('0x3a')](_0xebc5('0x75'))[_0xebc5('0x3a')](_0xebc5('0x7e'),squel[_0xebc5('0x6d')]()[_0xebc5('0x6e')]('COALESCE(phone,\x27\x27)')[_0xebc5('0x77')](_0xebc5('0x68'))['where'](_0xebc5('0x79'),_0x25e1f6['params']['id'][_0xebc5('0x71')]())))[_0xebc5('0x71')]();break;default:_0x5b0cb3=squel[_0xebc5('0x7c')]()[_0xebc5('0x67')](_0xebc5('0x68'))[_0xebc5('0x69')]([_0xebc5('0x6a'),_0xebc5('0x6b'),_0xebc5('0x6f'),_0xebc5('0x6c'),_0xebc5('0x5e'),_0xebc5('0x57'),_0xebc5('0x55')],squel[_0xebc5('0x6d')]()[_0xebc5('0x6e')](_0xebc5('0x6a'),_0xebc5('0x6a'))[_0xebc5('0x6e')]('NOW()',_0xebc5('0x6b'))['field']('id','ContactId')[_0xebc5('0x6e')](_0x4ebbbe['CmListId']['toString'](),'ListId')[_0xebc5('0x6e')](_0x25e1f6[_0xebc5('0x44')]['id'][_0xebc5('0x71')](),'CampaignId')[_0xebc5('0x6e')]('\x27'+_0x3a7c0d+'\x27','createdAt')['field']('\x27'+_0x3a7c0d+'\x27',_0xebc5('0x55'))['from'](_0xebc5('0x72'))['where'](_0xebc5('0x73'))[_0xebc5('0x3a')](_0xebc5('0x74'),_0x4ebbbe[_0xebc5('0x70')][_0xebc5('0x71')]())[_0xebc5('0x3a')](_0xebc5('0x75')))['toString']();}_0x37af1a=squel['insert']()[_0xebc5('0x67')](_0xebc5('0x7f'))[_0xebc5('0x69')](['cmHopperId',_0xebc5('0x6b'),_0xebc5('0x6a'),_0xebc5('0x80'),'createdAt',_0xebc5('0x55')],squel[_0xebc5('0x6d')]()[_0xebc5('0x6e')](_0xebc5('0x81'),'id')['field'](_0xebc5('0x7d'),_0xebc5('0x6b'))['field'](_0xebc5('0x82'),_0xebc5('0x6a'))[_0xebc5('0x6e')]('ci.OrderBY',_0xebc5('0x80'))['field']('\x27'+_0x3a7c0d+'\x27',_0xebc5('0x57'))[_0xebc5('0x6e')]('\x27'+_0x3a7c0d+'\x27','updatedAt')[_0xebc5('0x77')]('cm_contact_has_items','ci')[_0xebc5('0x83')](_0xebc5('0x68'),'h',_0xebc5('0x84'))[_0xebc5('0x3a')](_0xebc5('0x85'),_0x4ebbbe[_0xebc5('0x70')]['toString']())[_0xebc5('0x3a')](_0xebc5('0x86'),_0x25e1f6[_0xebc5('0x44')]['id'][_0xebc5('0x71')]())['where'](_0xebc5('0x87'),_0x3a7c0d))[_0xebc5('0x71')]();_0xdd9934[_0xebc5('0x88')](db[_0xebc5('0x89')][_0xebc5('0x31')](_0x5b0cb3));_0x4c0071[_0xebc5('0x88')](db['sequelize'][_0xebc5('0x31')](_0x37af1a));}return BPromise[_0xebc5('0x8a')](_0xdd9934);}})[_0xebc5('0x21')](function(){return BPromise['all'](_0x4c0071);})[_0xebc5('0x21')](function(){return _0x3d20a8;})[_0xebc5('0x21')](respondWithResult(_0x11faa5,null))[_0xebc5('0x42')](handleError(_0x11faa5,null));};exports[_0xebc5('0x8b')]=function(_0x261921,_0x576ede,_0x3f32ec){return db[_0xebc5('0x2b')][_0xebc5('0x46')]({'where':{'id':_0x261921['params']['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x576ede,null))['then'](function(_0x5be550){if(_0x5be550){return _0x5be550[_0xebc5('0x8b')](_0x261921[_0xebc5('0x31')][_0xebc5('0x65')]);}})['then'](function(_0x508c87){if(_0x508c87){return db[_0xebc5('0x5a')][_0xebc5('0x22')]({'where':{'ListId':_0x261921[_0xebc5('0x31')][_0xebc5('0x65')],'CampaignId':_0x261921['params']['id']}})['then'](function(){return _0x508c87;});}})['then'](respondWithStatusCode(_0x576ede,null))[_0xebc5('0x42')](handleError(_0x576ede,null));};exports[_0xebc5('0x8c')]=function(_0x2d5050,_0x3bef86,_0x10d8a4){var _0x3f9d3b={};var _0x265d87={};var _0x35754a;var _0x4e4566;return db[_0xebc5('0x2b')][_0xebc5('0x5c')]({'where':{'id':_0x2d5050[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x3bef86,null))[_0xebc5('0x21')](function(_0x16833d){if(_0x16833d){_0x35754a=_0x16833d;_0x265d87[_0xebc5('0x30')]=_['keys'](db['CmList'][_0xebc5('0x2c')]);_0x265d87[_0xebc5('0x31')]=_['keys'](_0x2d5050[_0xebc5('0x31')]);_0x265d87[_0xebc5('0x3b')]=_[_0xebc5('0x32')](_0x265d87[_0xebc5('0x30')],_0x265d87[_0xebc5('0x31')]);_0x3f9d3b[_0xebc5('0x34')]=_[_0xebc5('0x32')](_0x265d87[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x2d5050[_0xebc5('0x31')][_0xebc5('0x33')]));_0x3f9d3b[_0xebc5('0x34')]=_0x3f9d3b[_0xebc5('0x34')][_0xebc5('0x52')]?_0x3f9d3b[_0xebc5('0x34')]:_0x265d87[_0xebc5('0x30')];_0x3f9d3b[_0xebc5('0x38')]=qs[_0xebc5('0x39')](_0x2d5050[_0xebc5('0x31')]['sort']);_0x3f9d3b['where']=qs[_0xebc5('0x3b')](_['pick'](_0x2d5050[_0xebc5('0x31')],_0x265d87[_0xebc5('0x3b')]));if(_0x2d5050[_0xebc5('0x31')][_0xebc5('0x3d')]){_0x3f9d3b[_0xebc5('0x3a')]=_[_0xebc5('0x54')](_0x3f9d3b[_0xebc5('0x3a')],{'$or':_['map'](_0x3f9d3b[_0xebc5('0x34')],function(_0x279afe){var _0x3a0e72={};_0x3a0e72[_0x279afe]={'$like':'%'+_0x2d5050[_0xebc5('0x31')]['filter']+'%'};return _0x3a0e72;})});}_0x3f9d3b=_[_0xebc5('0x54')]({},_0x3f9d3b,_0x2d5050['options']);return _0x35754a[_0xebc5('0x8c')](_0x3f9d3b);}})[_0xebc5('0x21')](function(_0x30d0a4){if(_0x30d0a4){_0x4e4566=_0x30d0a4[_0xebc5('0x52')];if(!_0x2d5050[_0xebc5('0x31')]['hasOwnProperty']('nolimit')){_0x3f9d3b[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0x2d5050[_0xebc5('0x31')]['limit']);_0x3f9d3b[_0xebc5('0x37')]=qs['offset'](_0x2d5050[_0xebc5('0x31')][_0xebc5('0x37')]);}return _0x35754a[_0xebc5('0x8c')](_0x3f9d3b);}})[_0xebc5('0x21')](function(_0x239824){if(_0x239824){return _0x239824?{'count':_0x4e4566,'rows':_0x239824}:null;}})[_0xebc5('0x21')](respondWithResult(_0x3bef86,null))[_0xebc5('0x42')](handleError(_0x3bef86,null));};exports[_0xebc5('0x8d')]=function(_0x5c3ea2,_0x449e52,_0x2ec2e8){var _0x27cb8d,_0x3a24cf;var _0x5db25d=[];var _0x4791f3=moment()[_0xebc5('0x8e')](_0xebc5('0x8f'));return db[_0xebc5('0x2b')]['find']({'where':{'id':_0x5c3ea2[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x449e52,null))[_0xebc5('0x21')](function(_0x331f10){if(_0x331f10){_0x3a24cf=_0x331f10;return _0x331f10['addBlackLists'](_0x5c3ea2['body']['ids'],_[_0xebc5('0x56')](_0x5c3ea2['body'],[_0xebc5('0x65'),'id'])||{});}return null;})[_0xebc5('0x90')](function(_0x2d93b7){var _0x41a87e;var _0x556f16;_0x27cb8d=_0x2d93b7||[];var _0x2e5278=[];if(_0x2d93b7){for(var _0x24bb90=0x0;_0x24bb90<_0x2d93b7[_0xebc5('0x52')];_0x24bb90+=0x1){var _0x5c7c05=_0x2d93b7[_0x24bb90][_0xebc5('0x23')]({'plain':!![]});_0x41a87e=squel['insert']()[_0xebc5('0x67')](_0xebc5('0x91'))['fromQuery']([_0xebc5('0x6a'),_0xebc5('0x6f'),_0xebc5('0x6c'),'CampaignId',_0xebc5('0x57'),_0xebc5('0x55')],squel[_0xebc5('0x6d')]()[_0xebc5('0x6e')](_0xebc5('0x6a'),'phone')[_0xebc5('0x6e')]('id',_0xebc5('0x6f'))[_0xebc5('0x6e')](_0x5c7c05[_0xebc5('0x70')][_0xebc5('0x71')](),_0xebc5('0x6c'))['field'](_0x5c3ea2[_0xebc5('0x44')]['id'][_0xebc5('0x71')](),'CampaignId')[_0xebc5('0x6e')]('NOW()',_0xebc5('0x57'))['field']('NOW()',_0xebc5('0x55'))['from']('cm_contacts')['where'](_0xebc5('0x73'))[_0xebc5('0x3a')](_0xebc5('0x74'),_0x5c7c05[_0xebc5('0x70')]['toString']())[_0xebc5('0x3a')](_0xebc5('0x75')))[_0xebc5('0x71')]();_0x2e5278['push'](db[_0xebc5('0x89')][_0xebc5('0x31')](_0x41a87e));}return BPromise[_0xebc5('0x8a')](_0x2e5278);}})[_0xebc5('0x21')](function(){return _0x27cb8d;})['then'](respondWithResult(_0x449e52,null))[_0xebc5('0x42')](handleError(_0x449e52,null));};exports['removeBlackLists']=function(_0x4faa15,_0x260fa8,_0x62c7bc){return db[_0xebc5('0x2b')][_0xebc5('0x46')]({'where':{'id':_0x4faa15[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x260fa8,null))[_0xebc5('0x21')](function(_0x3d2f8b){if(_0x3d2f8b){return _0x3d2f8b[_0xebc5('0x92')](_0x4faa15[_0xebc5('0x31')][_0xebc5('0x65')]);}})[_0xebc5('0x21')](function(_0x200531){if(_0x200531){return db['CmHopperBlack'][_0xebc5('0x22')]({'where':{'ListId':_0x4faa15[_0xebc5('0x31')][_0xebc5('0x65')],'CampaignId':_0x4faa15[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](function(){return _0x200531;});}})[_0xebc5('0x21')](respondWithStatusCode(_0x260fa8,null))[_0xebc5('0x42')](handleError(_0x260fa8,null));};
\ No newline at end of file
+var _0x1226=['sequelize','all','removeLists','getBlackLists','format','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','UserProfileResource','then','stack','name','send','index','map','Campaign','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','merge','options','rows','catch','show','params','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','userProfileId','autoAssociation','error','includeAll','omit','createdAt','updatedAt','body','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmHopper','CampaignId','findAll','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','push'];(function(_0x78d78d,_0x4e73f0){var _0x14e121=function(_0x1f80a1){while(--_0x1f80a1){_0x78d78d['push'](_0x78d78d['shift']());}};_0x14e121(++_0x4e73f0);}(_0x1226,0x1c1));var _0x6122=function(_0x4ca057,_0x4ef66c){_0x4ca057=_0x4ca057-0x0;var _0x378bb5=_0x1226[_0x4ca057];return _0x378bb5;};'use strict';var emlformat=require(_0x6122('0x0'));var rimraf=require(_0x6122('0x1'));var zipdir=require(_0x6122('0x2'));var jsonpatch=require(_0x6122('0x3'));var rp=require(_0x6122('0x4'));var moment=require(_0x6122('0x5'));var BPromise=require(_0x6122('0x6'));var Mustache=require(_0x6122('0x7'));var util=require(_0x6122('0x8'));var path=require('path');var sox=require(_0x6122('0x9'));var csv=require(_0x6122('0xa'));var ejs=require(_0x6122('0xb'));var fs=require('fs');var fs_extra=require(_0x6122('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6122('0xd'));var jsforce=require(_0x6122('0xe'));var deskjs=require(_0x6122('0xf'));var toCsv=require(_0x6122('0xa'));var querystring=require(_0x6122('0x10'));var Papa=require(_0x6122('0x11'));var Redis=require(_0x6122('0x12'));var authService=require(_0x6122('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6122('0x14'));var hardwareService=require(_0x6122('0x15'));var logger=require('../../config/logger')(_0x6122('0x16'));var utils=require(_0x6122('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6122('0x18'));var db=require(_0x6122('0x19'))['db'];function respondWithStatusCode(_0x3738a4,_0x10eea1){_0x10eea1=_0x10eea1||0xcc;return function(_0x2e0a31){if(_0x2e0a31){return _0x3738a4[_0x6122('0x1a')](_0x10eea1);}return _0x3738a4['status'](_0x10eea1)[_0x6122('0x1b')]();};}function respondWithResult(_0x24116e,_0x9a39cd){_0x9a39cd=_0x9a39cd||0xc8;return function(_0x320b46){if(_0x320b46){return _0x24116e[_0x6122('0x1c')](_0x9a39cd)['json'](_0x320b46);}};}function respondWithFilteredResult(_0x2023d1,_0x4cd8fb){return function(_0x5d9678){if(_0x5d9678){var _0x7dd3fe=typeof _0x4cd8fb[_0x6122('0x1d')]===_0x6122('0x1e')&&typeof _0x4cd8fb[_0x6122('0x1f')]===_0x6122('0x1e');var _0x15f72c=_0x5d9678[_0x6122('0x20')];var _0x15ee1d=_0x7dd3fe?0x0:_0x4cd8fb['offset'];var _0xcfd359=_0x7dd3fe?_0x5d9678[_0x6122('0x20')]:_0x4cd8fb['offset']+_0x4cd8fb[_0x6122('0x1f')];var _0x2a5908;if(_0xcfd359>=_0x15f72c){_0xcfd359=_0x15f72c;_0x2a5908=0xc8;}else{_0x2a5908=0xce;}_0x2023d1[_0x6122('0x1c')](_0x2a5908);return _0x2023d1[_0x6122('0x21')](_0x6122('0x22'),_0x15ee1d+'-'+_0xcfd359+'/'+_0x15f72c)['json'](_0x5d9678);}return null;};}function patchUpdates(_0x3f6cd2){return function(_0x5bd8ff){try{jsonpatch[_0x6122('0x23')](_0x5bd8ff,_0x3f6cd2,!![]);}catch(_0x29de92){return BPromise[_0x6122('0x24')](_0x29de92);}return _0x5bd8ff[_0x6122('0x25')]();};}function saveUpdates(_0x25aff5,_0x194357){return function(_0x2980e8){if(_0x2980e8){return _0x2980e8[_0x6122('0x26')](_0x25aff5)['then'](function(_0x2c9967){return _0x2c9967;});}return null;};}function removeEntity(_0x558bc0,_0x7de029){return function(_0x3a3efa){if(_0x3a3efa){return _0x3a3efa[_0x6122('0x27')]()['then'](function(){var _0x4ea2fb=_0x3a3efa['get']({'plain':!![]});var _0x12df5a='IvrCampaigns';return db[_0x6122('0x28')][_0x6122('0x27')]({'where':{'type':_0x12df5a,'resourceId':_0x4ea2fb['id']}})[_0x6122('0x29')](function(){return _0x3a3efa;});})['then'](function(){_0x558bc0[_0x6122('0x1c')](0xcc)[_0x6122('0x1b')]();});}};}function handleEntityNotFound(_0x472411,_0x5660af){return function(_0x503843){if(!_0x503843){_0x472411[_0x6122('0x1a')](0x194);}return _0x503843;};}function handleError(_0x5ee15a,_0x19487c){_0x19487c=_0x19487c||0x1f4;return function(_0x549c0e){logger['error'](_0x549c0e[_0x6122('0x2a')]);if(_0x549c0e[_0x6122('0x2b')]){delete _0x549c0e[_0x6122('0x2b')];}_0x5ee15a[_0x6122('0x1c')](_0x19487c)[_0x6122('0x2c')](_0x549c0e);};}exports[_0x6122('0x2d')]=function(_0x45b1df,_0x128135){var _0x16fcbd={},_0x540fff={},_0x5ba87e={'count':0x0,'rows':[]};var _0x3cc864=_[_0x6122('0x2e')](db[_0x6122('0x2f')][_0x6122('0x30')],function(_0x341d62){return{'name':_0x341d62['fieldName'],'type':_0x341d62['type'][_0x6122('0x31')]};});_0x540fff[_0x6122('0x32')]=_[_0x6122('0x2e')](_0x3cc864,_0x6122('0x2b'));_0x540fff[_0x6122('0x33')]=_[_0x6122('0x34')](_0x45b1df['query']);_0x540fff[_0x6122('0x35')]=_[_0x6122('0x36')](_0x540fff[_0x6122('0x32')],_0x540fff[_0x6122('0x33')]);_0x16fcbd[_0x6122('0x37')]=_['intersection'](_0x540fff[_0x6122('0x32')],qs[_0x6122('0x38')](_0x45b1df[_0x6122('0x33')][_0x6122('0x38')]));_0x16fcbd[_0x6122('0x37')]=_0x16fcbd['attributes'][_0x6122('0x39')]?_0x16fcbd[_0x6122('0x37')]:_0x540fff[_0x6122('0x32')];if(!_0x45b1df[_0x6122('0x33')][_0x6122('0x3a')](_0x6122('0x3b'))){_0x16fcbd[_0x6122('0x1f')]=qs[_0x6122('0x1f')](_0x45b1df[_0x6122('0x33')]['limit']);_0x16fcbd[_0x6122('0x1d')]=qs[_0x6122('0x1d')](_0x45b1df[_0x6122('0x33')][_0x6122('0x1d')]);}_0x16fcbd[_0x6122('0x3c')]=qs['sort'](_0x45b1df[_0x6122('0x33')][_0x6122('0x3d')]);_0x16fcbd[_0x6122('0x3e')]=qs['filters'](_[_0x6122('0x3f')](_0x45b1df[_0x6122('0x33')],_0x540fff[_0x6122('0x35')]),_0x3cc864);if(_0x45b1df['query']['filter']){_0x16fcbd[_0x6122('0x3e')]=_['merge'](_0x16fcbd[_0x6122('0x3e')],{'$or':_[_0x6122('0x2e')](_0x3cc864,function(_0x52f1ec){if(_0x52f1ec[_0x6122('0x40')]!=='VIRTUAL'){var _0x520753={};_0x520753[_0x52f1ec[_0x6122('0x2b')]]={'$like':'%'+_0x45b1df['query'][_0x6122('0x41')]+'%'};return _0x520753;}})});}_0x16fcbd=_[_0x6122('0x42')]({},_0x16fcbd,_0x45b1df[_0x6122('0x43')]);var _0x5055d8={'where':_0x16fcbd[_0x6122('0x3e')]};return db['Campaign'][_0x6122('0x20')](_0x5055d8)['then'](function(_0x3b2ad3){_0x5ba87e[_0x6122('0x20')]=_0x3b2ad3;if(_0x45b1df[_0x6122('0x33')]['includeAll']){_0x16fcbd['include']=[{'all':!![]}];}return db[_0x6122('0x2f')]['findAll'](_0x16fcbd);})[_0x6122('0x29')](function(_0x5463e4){_0x5ba87e[_0x6122('0x44')]=_0x5463e4;return _0x5ba87e;})[_0x6122('0x29')](respondWithFilteredResult(_0x128135,_0x16fcbd))[_0x6122('0x45')](handleError(_0x128135,null));};exports[_0x6122('0x46')]=function(_0x23422b,_0x39f0b9){var _0x4e3aff={'raw':![],'where':{'id':_0x23422b[_0x6122('0x47')]['id']}},_0x1f2d10={};_0x1f2d10['model']=_[_0x6122('0x34')](db[_0x6122('0x2f')][_0x6122('0x30')]);_0x1f2d10[_0x6122('0x33')]=_['keys'](_0x23422b[_0x6122('0x33')]);_0x1f2d10[_0x6122('0x35')]=_[_0x6122('0x36')](_0x1f2d10['model'],_0x1f2d10[_0x6122('0x33')]);_0x4e3aff['attributes']=_[_0x6122('0x36')](_0x1f2d10['model'],qs[_0x6122('0x38')](_0x23422b['query'][_0x6122('0x38')]));_0x4e3aff[_0x6122('0x37')]=_0x4e3aff[_0x6122('0x37')]['length']?_0x4e3aff[_0x6122('0x37')]:_0x1f2d10[_0x6122('0x32')];if(_0x23422b['query']['includeAll']){_0x4e3aff[_0x6122('0x48')]=[{'all':!![]}];}_0x4e3aff=_[_0x6122('0x42')]({},_0x4e3aff,_0x23422b['options']);return db[_0x6122('0x2f')][_0x6122('0x49')](_0x4e3aff)[_0x6122('0x29')](handleEntityNotFound(_0x39f0b9,null))[_0x6122('0x29')](respondWithResult(_0x39f0b9,null))[_0x6122('0x45')](handleError(_0x39f0b9,null));};exports[_0x6122('0x4a')]=function(_0x46907a,_0x21ae83){return db[_0x6122('0x2f')][_0x6122('0x4a')](_0x46907a['body'],{})[_0x6122('0x29')](function(_0x563da1){var _0x5d773b=_0x46907a[_0x6122('0x4b')][_0x6122('0x4c')]({'plain':!![]});if(!_0x5d773b)throw new Error(_0x6122('0x4d'));if(_0x5d773b['role']===_0x6122('0x4b')){var _0x319675=_0x563da1[_0x6122('0x4c')]({'plain':!![]});var _0x1b5258=_0x6122('0x4e');return db['UserProfileSection'][_0x6122('0x49')]({'where':{'name':_0x1b5258,'userProfileId':_0x5d773b[_0x6122('0x4f')]},'raw':!![]})[_0x6122('0x29')](function(_0x537525){if(_0x537525&&_0x537525[_0x6122('0x50')]===0x0){return db[_0x6122('0x28')][_0x6122('0x4a')]({'name':_0x319675['name'],'resourceId':_0x319675['id'],'type':_0x537525[_0x6122('0x2b')],'sectionId':_0x537525['id']},{})[_0x6122('0x29')](function(){return _0x563da1;});}else{return _0x563da1;}})['catch'](function(_0x371b74){logger[_0x6122('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x371b74);throw _0x371b74;});}return _0x563da1;})['then'](respondWithResult(_0x21ae83,0xc9))['catch'](handleError(_0x21ae83,null));};exports['clone']=function(_0x366b51,_0x4c99c3){var _0x578ff3={'where':{'id':_0x366b51[_0x6122('0x47')]['id']}},_0x5c7ca6={};_0x5c7ca6[_0x6122('0x32')]=_[_0x6122('0x34')](db[_0x6122('0x2f')][_0x6122('0x30')]);_0x578ff3['attributes']=_['intersection'](_0x5c7ca6[_0x6122('0x32')],qs[_0x6122('0x38')](_0x366b51[_0x6122('0x33')][_0x6122('0x38')]));_0x578ff3[_0x6122('0x37')]=_0x578ff3['attributes'][_0x6122('0x39')]?_0x578ff3['attributes']:_0x5c7ca6['model'];if(_0x366b51['query'][_0x6122('0x52')]){_0x578ff3[_0x6122('0x48')]=[{'all':!![]}];}_0x578ff3=_[_0x6122('0x42')]({},_0x578ff3,_0x366b51[_0x6122('0x43')]);return db[_0x6122('0x2f')][_0x6122('0x49')](_0x578ff3)['then'](handleEntityNotFound(_0x4c99c3,null))['then'](function(_0x112fd4){if(_0x112fd4){var _0x5290be=_0x112fd4[_0x6122('0x4c')]({'plain':!![]});_0x5290be=qs[_0x6122('0x53')](_0x5290be,['id',_0x6122('0x54'),_0x6122('0x55')]);_0x366b51[_0x6122('0x56')]=_[_0x6122('0x53')](_0x366b51[_0x6122('0x56')],['id',_0x6122('0x54'),_0x6122('0x55')]);return db[_0x6122('0x2f')][_0x6122('0x4a')](_[_0x6122('0x42')](_0x5290be,_0x366b51[_0x6122('0x56')]),{'include':_0x366b51[_0x6122('0x33')][_0x6122('0x52')]?[{'all':!![]}]:undefined})[_0x6122('0x29')](function(_0xeffe8d){var _0x5d05f7=_0x366b51[_0x6122('0x4b')][_0x6122('0x4c')]({'plain':!![]});if(!_0x5d05f7)throw new Error(_0x6122('0x4d'));if(_0x5d05f7['role']==='user'){var _0x1bee71=_0xeffe8d[_0x6122('0x4c')]({'plain':!![]});var _0x244168=_0x6122('0x4e');return db[_0x6122('0x57')][_0x6122('0x49')]({'where':{'name':_0x244168,'userProfileId':_0x5d05f7['userProfileId']},'raw':!![]})[_0x6122('0x29')](function(_0x41fb3f){if(_0x41fb3f&&_0x41fb3f[_0x6122('0x50')]===0x0){return db[_0x6122('0x28')][_0x6122('0x4a')]({'name':_0x1bee71[_0x6122('0x2b')],'resourceId':_0x1bee71['id'],'type':_0x41fb3f[_0x6122('0x2b')],'sectionId':_0x41fb3f['id']},{})['then'](function(){return _0xeffe8d;});}else{return _0xeffe8d;}})[_0x6122('0x45')](function(_0x569e4a){logger[_0x6122('0x51')](_0x6122('0x58'),_0x569e4a);throw _0x569e4a;});}return _0xeffe8d;});}})[_0x6122('0x29')](respondWithResult(_0x4c99c3,0xc9))[_0x6122('0x45')](handleError(_0x4c99c3,null));};exports[_0x6122('0x26')]=function(_0x4dd9f8,_0x1c7c13){if(_0x4dd9f8[_0x6122('0x56')]['id']){delete _0x4dd9f8[_0x6122('0x56')]['id'];}return db[_0x6122('0x2f')]['find']({'where':{'id':_0x4dd9f8[_0x6122('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c7c13,null))[_0x6122('0x29')](saveUpdates(_0x4dd9f8[_0x6122('0x56')],null))[_0x6122('0x29')](respondWithResult(_0x1c7c13,null))[_0x6122('0x45')](handleError(_0x1c7c13,null));};exports[_0x6122('0x27')]=function(_0x5a17d6,_0x1a71ea){return db[_0x6122('0x2f')][_0x6122('0x49')]({'where':{'id':_0x5a17d6['params']['id']}})[_0x6122('0x29')](handleEntityNotFound(_0x1a71ea,null))[_0x6122('0x29')](removeEntity(_0x1a71ea,null))[_0x6122('0x45')](handleError(_0x1a71ea,null));};exports['getHoppers']=function(_0x24ffea,_0x71a8f2,_0x45fd5c){var _0x1b5b81={'raw':!![],'where':{}};var _0x459a3b={};var _0x43700d={'count':0x0,'rows':[]};return db[_0x6122('0x2f')]['findOne']({'where':{'id':_0x24ffea['params']['id']}})['then'](handleEntityNotFound(_0x71a8f2,null))[_0x6122('0x29')](function(_0x5e101e){if(_0x5e101e){_0x459a3b[_0x6122('0x32')]=_[_0x6122('0x34')](db[_0x6122('0x59')][_0x6122('0x30')]);_0x459a3b[_0x6122('0x33')]=_[_0x6122('0x34')](_0x24ffea[_0x6122('0x33')]);_0x459a3b[_0x6122('0x35')]=_[_0x6122('0x36')](_0x459a3b[_0x6122('0x32')],_0x459a3b[_0x6122('0x33')]);_0x1b5b81['attributes']=_[_0x6122('0x36')](_0x459a3b['model'],qs[_0x6122('0x38')](_0x24ffea[_0x6122('0x33')][_0x6122('0x38')]));_0x1b5b81[_0x6122('0x37')]=_0x1b5b81['attributes'][_0x6122('0x39')]?_0x1b5b81[_0x6122('0x37')]:_0x459a3b['model'];if(!_0x24ffea[_0x6122('0x33')][_0x6122('0x3a')]('nolimit')){_0x1b5b81[_0x6122('0x1f')]=qs['limit'](_0x24ffea['query'][_0x6122('0x1f')]);_0x1b5b81[_0x6122('0x1d')]=qs['offset'](_0x24ffea['query'][_0x6122('0x1d')]);}_0x1b5b81[_0x6122('0x3c')]=qs[_0x6122('0x3d')](_0x24ffea[_0x6122('0x33')][_0x6122('0x3d')]);_0x1b5b81[_0x6122('0x3e')]=qs[_0x6122('0x35')](_['pick'](_0x24ffea[_0x6122('0x33')],_0x459a3b[_0x6122('0x35')]));_0x1b5b81[_0x6122('0x3e')][_0x6122('0x5a')]=_0x5e101e['id'];if(_0x24ffea['query'][_0x6122('0x41')]){_0x1b5b81[_0x6122('0x3e')]=_[_0x6122('0x42')](_0x1b5b81['where'],{'$or':_[_0x6122('0x2e')](_0x1b5b81[_0x6122('0x37')],function(_0x46b6db){var _0x34e102={};_0x34e102[_0x46b6db]={'$like':'%'+_0x24ffea[_0x6122('0x33')][_0x6122('0x41')]+'%'};return _0x34e102;})});}_0x1b5b81=_[_0x6122('0x42')]({},_0x1b5b81,_0x24ffea[_0x6122('0x43')]);return db[_0x6122('0x59')]['count']({'where':_0x1b5b81[_0x6122('0x3e')]})[_0x6122('0x29')](function(_0x45809b){_0x43700d['count']=_0x45809b;if(_0x24ffea[_0x6122('0x33')][_0x6122('0x52')]){_0x1b5b81[_0x6122('0x48')]=[{'all':!![]}];}return db[_0x6122('0x59')][_0x6122('0x5b')](_0x1b5b81);})[_0x6122('0x29')](function(_0x255221){_0x43700d[_0x6122('0x44')]=_0x255221;return _0x43700d;});}})[_0x6122('0x29')](respondWithFilteredResult(_0x71a8f2,_0x1b5b81))[_0x6122('0x45')](handleError(_0x71a8f2,null));};exports[_0x6122('0x5c')]=function(_0x2cae5f,_0x5e03de,_0x534ece){var _0xf00aee={'raw':!![],'where':{}};var _0x14ce13={};var _0x218d1e={'count':0x0,'rows':[]};return db[_0x6122('0x2f')][_0x6122('0x5d')]({'where':{'id':_0x2cae5f[_0x6122('0x47')]['id']}})[_0x6122('0x29')](handleEntityNotFound(_0x5e03de,null))[_0x6122('0x29')](function(_0x38cfcf){if(_0x38cfcf){_0x14ce13[_0x6122('0x32')]=_[_0x6122('0x34')](db['CmHopperHistory'][_0x6122('0x30')]);_0x14ce13[_0x6122('0x33')]=_[_0x6122('0x34')](_0x2cae5f[_0x6122('0x33')]);_0x14ce13[_0x6122('0x35')]=_[_0x6122('0x36')](_0x14ce13[_0x6122('0x32')],_0x14ce13[_0x6122('0x33')]);_0xf00aee['attributes']=_['intersection'](_0x14ce13[_0x6122('0x32')],qs[_0x6122('0x38')](_0x2cae5f[_0x6122('0x33')]['fields']));_0xf00aee['attributes']=_0xf00aee['attributes'][_0x6122('0x39')]?_0xf00aee[_0x6122('0x37')]:_0x14ce13[_0x6122('0x32')];if(!_0x2cae5f[_0x6122('0x33')][_0x6122('0x3a')](_0x6122('0x3b'))){_0xf00aee['limit']=qs[_0x6122('0x1f')](_0x2cae5f['query'][_0x6122('0x1f')]);_0xf00aee[_0x6122('0x1d')]=qs[_0x6122('0x1d')](_0x2cae5f['query'][_0x6122('0x1d')]);}_0xf00aee[_0x6122('0x3c')]=qs['sort'](_0x2cae5f[_0x6122('0x33')]['sort']);_0xf00aee[_0x6122('0x3e')]=qs[_0x6122('0x35')](_[_0x6122('0x3f')](_0x2cae5f[_0x6122('0x33')],_0x14ce13[_0x6122('0x35')]));_0xf00aee[_0x6122('0x3e')]['CampaignId']=_0x38cfcf['id'];if(_0x2cae5f[_0x6122('0x33')][_0x6122('0x41')]){_0xf00aee[_0x6122('0x3e')]=_[_0x6122('0x42')](_0xf00aee[_0x6122('0x3e')],{'$or':_[_0x6122('0x2e')](_0xf00aee[_0x6122('0x37')],function(_0x35519d){var _0x4a0739={};_0x4a0739[_0x35519d]={'$like':'%'+_0x2cae5f['query'][_0x6122('0x41')]+'%'};return _0x4a0739;})});}_0xf00aee=_[_0x6122('0x42')]({},_0xf00aee,_0x2cae5f[_0x6122('0x43')]);return db[_0x6122('0x5e')][_0x6122('0x20')]({'where':_0xf00aee[_0x6122('0x3e')]})['then'](function(_0x1b15c1){_0x218d1e['count']=_0x1b15c1;if(_0x2cae5f[_0x6122('0x33')]['includeAll']){_0xf00aee[_0x6122('0x48')]=[{'all':!![]}];}return db[_0x6122('0x5e')][_0x6122('0x5b')](_0xf00aee);})[_0x6122('0x29')](function(_0x565841){_0x218d1e[_0x6122('0x44')]=_0x565841;return _0x218d1e;});}})[_0x6122('0x29')](respondWithFilteredResult(_0x5e03de,_0xf00aee))[_0x6122('0x45')](handleError(_0x5e03de,null));};exports[_0x6122('0x5f')]=function(_0x5571ef,_0xc3abed,_0x590104){var _0x114fa4={'raw':!![],'where':{}};var _0x109902={};var _0x19c43c={'count':0x0,'rows':[]};return db[_0x6122('0x2f')][_0x6122('0x5d')]({'where':{'id':_0x5571ef[_0x6122('0x47')]['id']}})['then'](handleEntityNotFound(_0xc3abed,null))[_0x6122('0x29')](function(_0x7092e2){if(_0x7092e2){_0x109902[_0x6122('0x32')]=_[_0x6122('0x34')](db[_0x6122('0x60')][_0x6122('0x30')]);_0x109902[_0x6122('0x33')]=_[_0x6122('0x34')](_0x5571ef[_0x6122('0x33')]);_0x109902['filters']=_[_0x6122('0x36')](_0x109902['model'],_0x109902[_0x6122('0x33')]);_0x114fa4[_0x6122('0x37')]=_[_0x6122('0x36')](_0x109902[_0x6122('0x32')],qs[_0x6122('0x38')](_0x5571ef[_0x6122('0x33')][_0x6122('0x38')]));_0x114fa4[_0x6122('0x37')]=_0x114fa4[_0x6122('0x37')]['length']?_0x114fa4[_0x6122('0x37')]:_0x109902[_0x6122('0x32')];if(!_0x5571ef['query'][_0x6122('0x3a')](_0x6122('0x3b'))){_0x114fa4[_0x6122('0x1f')]=qs[_0x6122('0x1f')](_0x5571ef[_0x6122('0x33')]['limit']);_0x114fa4[_0x6122('0x1d')]=qs[_0x6122('0x1d')](_0x5571ef[_0x6122('0x33')][_0x6122('0x1d')]);}_0x114fa4['order']=qs[_0x6122('0x3d')](_0x5571ef[_0x6122('0x33')][_0x6122('0x3d')]);_0x114fa4[_0x6122('0x3e')]=qs['filters'](_[_0x6122('0x3f')](_0x5571ef[_0x6122('0x33')],_0x109902[_0x6122('0x35')]));_0x114fa4[_0x6122('0x3e')]['CampaignId']=_0x7092e2['id'];if(_0x5571ef['query'][_0x6122('0x41')]){_0x114fa4[_0x6122('0x3e')]=_[_0x6122('0x42')](_0x114fa4[_0x6122('0x3e')],{'$or':_[_0x6122('0x2e')](_0x114fa4[_0x6122('0x37')],function(_0x48bb32){var _0x526a14={};_0x526a14[_0x48bb32]={'$like':'%'+_0x5571ef[_0x6122('0x33')][_0x6122('0x41')]+'%'};return _0x526a14;})});}_0x114fa4=_[_0x6122('0x42')]({},_0x114fa4,_0x5571ef[_0x6122('0x43')]);return db[_0x6122('0x60')][_0x6122('0x20')]({'where':_0x114fa4['where']})[_0x6122('0x29')](function(_0x593d7c){_0x19c43c['count']=_0x593d7c;if(_0x5571ef[_0x6122('0x33')][_0x6122('0x52')]){_0x114fa4[_0x6122('0x48')]=[{'all':!![]}];}return db[_0x6122('0x60')][_0x6122('0x5b')](_0x114fa4);})['then'](function(_0x5dc304){_0x19c43c[_0x6122('0x44')]=_0x5dc304;return _0x19c43c;});}})['then'](respondWithFilteredResult(_0xc3abed,_0x114fa4))[_0x6122('0x45')](handleError(_0xc3abed,null));};exports['getHopperBlacks']=function(_0x29c346,_0x4bd4a5,_0x1f300e){var _0x52f9db={'raw':!![],'where':{}};var _0xa9d4e0={};var _0x3d18d2={'count':0x0,'rows':[]};return db[_0x6122('0x2f')][_0x6122('0x5d')]({'where':{'id':_0x29c346[_0x6122('0x47')]['id']}})['then'](handleEntityNotFound(_0x4bd4a5,null))[_0x6122('0x29')](function(_0x233bc5){if(_0x233bc5){_0xa9d4e0[_0x6122('0x32')]=_[_0x6122('0x34')](db[_0x6122('0x61')][_0x6122('0x30')]);_0xa9d4e0[_0x6122('0x33')]=_['keys'](_0x29c346[_0x6122('0x33')]);_0xa9d4e0[_0x6122('0x35')]=_[_0x6122('0x36')](_0xa9d4e0[_0x6122('0x32')],_0xa9d4e0[_0x6122('0x33')]);_0x52f9db[_0x6122('0x37')]=_[_0x6122('0x36')](_0xa9d4e0[_0x6122('0x32')],qs[_0x6122('0x38')](_0x29c346['query'][_0x6122('0x38')]));_0x52f9db[_0x6122('0x37')]=_0x52f9db[_0x6122('0x37')][_0x6122('0x39')]?_0x52f9db[_0x6122('0x37')]:_0xa9d4e0['model'];if(!_0x29c346[_0x6122('0x33')]['hasOwnProperty'](_0x6122('0x3b'))){_0x52f9db['limit']=qs['limit'](_0x29c346[_0x6122('0x33')][_0x6122('0x1f')]);_0x52f9db[_0x6122('0x1d')]=qs[_0x6122('0x1d')](_0x29c346['query'][_0x6122('0x1d')]);}_0x52f9db[_0x6122('0x3c')]=qs['sort'](_0x29c346['query'][_0x6122('0x3d')]);_0x52f9db[_0x6122('0x3e')]=qs[_0x6122('0x35')](_[_0x6122('0x3f')](_0x29c346[_0x6122('0x33')],_0xa9d4e0[_0x6122('0x35')]));_0x52f9db[_0x6122('0x3e')]['CampaignId']=_0x233bc5['id'];if(_0x29c346[_0x6122('0x33')][_0x6122('0x41')]){_0x52f9db[_0x6122('0x3e')]=_[_0x6122('0x42')](_0x52f9db[_0x6122('0x3e')],{'$or':_[_0x6122('0x2e')](_0x52f9db[_0x6122('0x37')],function(_0x1a800b){var _0x2cf82f={};_0x2cf82f[_0x1a800b]={'$like':'%'+_0x29c346[_0x6122('0x33')][_0x6122('0x41')]+'%'};return _0x2cf82f;})});}_0x52f9db=_['merge']({},_0x52f9db,_0x29c346[_0x6122('0x43')]);return db['CmHopperBlack']['count']({'where':_0x52f9db['where']})[_0x6122('0x29')](function(_0x50ad73){_0x3d18d2[_0x6122('0x20')]=_0x50ad73;if(_0x29c346[_0x6122('0x33')][_0x6122('0x52')]){_0x52f9db[_0x6122('0x48')]=[{'all':!![]}];}return db[_0x6122('0x61')][_0x6122('0x5b')](_0x52f9db);})[_0x6122('0x29')](function(_0x20663b){_0x3d18d2[_0x6122('0x44')]=_0x20663b;return _0x3d18d2;});}})[_0x6122('0x29')](respondWithFilteredResult(_0x4bd4a5,_0x52f9db))[_0x6122('0x45')](handleError(_0x4bd4a5,null));};exports[_0x6122('0x62')]=function(_0x168686,_0x4ca6b1,_0x5e5b6b){var _0x3193ba={};var _0x1d6836={};var _0x421a58;var _0x548499;return db[_0x6122('0x2f')][_0x6122('0x5d')]({'where':{'id':_0x168686[_0x6122('0x47')]['id']}})[_0x6122('0x29')](handleEntityNotFound(_0x4ca6b1,null))[_0x6122('0x29')](function(_0xcc995){if(_0xcc995){_0x421a58=_0xcc995;_0x1d6836['model']=_['keys'](db[_0x6122('0x63')][_0x6122('0x30')]);_0x1d6836['query']=_[_0x6122('0x34')](_0x168686[_0x6122('0x33')]);_0x1d6836[_0x6122('0x35')]=_[_0x6122('0x36')](_0x1d6836[_0x6122('0x32')],_0x1d6836[_0x6122('0x33')]);_0x3193ba[_0x6122('0x37')]=_['intersection'](_0x1d6836[_0x6122('0x32')],qs['fields'](_0x168686[_0x6122('0x33')][_0x6122('0x38')]));_0x3193ba[_0x6122('0x37')]=_0x3193ba[_0x6122('0x37')][_0x6122('0x39')]?_0x3193ba['attributes']:_0x1d6836[_0x6122('0x32')];_0x3193ba[_0x6122('0x3c')]=qs[_0x6122('0x3d')](_0x168686[_0x6122('0x33')][_0x6122('0x3d')]);_0x3193ba['where']=qs[_0x6122('0x35')](_[_0x6122('0x3f')](_0x168686[_0x6122('0x33')],_0x1d6836[_0x6122('0x35')]));if(_0x168686[_0x6122('0x33')][_0x6122('0x41')]){_0x3193ba[_0x6122('0x3e')]=_[_0x6122('0x42')](_0x3193ba[_0x6122('0x3e')],{'$or':_['map'](_0x3193ba['attributes'],function(_0x19116d){var _0x30d4c1={};_0x30d4c1[_0x19116d]={'$like':'%'+_0x168686[_0x6122('0x33')][_0x6122('0x41')]+'%'};return _0x30d4c1;})});}_0x3193ba=_[_0x6122('0x42')]({},_0x3193ba,_0x168686[_0x6122('0x43')]);return _0x421a58[_0x6122('0x62')](_0x3193ba);}})[_0x6122('0x29')](function(_0x4f83e4){if(_0x4f83e4){_0x548499=_0x4f83e4[_0x6122('0x39')];if(!_0x168686[_0x6122('0x33')][_0x6122('0x3a')](_0x6122('0x3b'))){_0x3193ba[_0x6122('0x1f')]=qs[_0x6122('0x1f')](_0x168686[_0x6122('0x33')][_0x6122('0x1f')]);_0x3193ba[_0x6122('0x1d')]=qs[_0x6122('0x1d')](_0x168686[_0x6122('0x33')][_0x6122('0x1d')]);}return _0x421a58[_0x6122('0x62')](_0x3193ba);}})['then'](function(_0x5b330d){if(_0x5b330d){return _0x5b330d?{'count':_0x548499,'rows':_0x5b330d}:null;}})[_0x6122('0x29')](respondWithResult(_0x4ca6b1,null))[_0x6122('0x45')](handleError(_0x4ca6b1,null));};exports[_0x6122('0x64')]=function(_0x5f112d,_0x3d1c66,_0x592f67){var _0x4c26e7,_0x1825bf;var _0x36bae2=[];var _0x9233d1=moment()['format'](_0x6122('0x65'));return db[_0x6122('0x2f')][_0x6122('0x49')]({'where':{'id':_0x5f112d[_0x6122('0x47')]['id']}})[_0x6122('0x29')](handleEntityNotFound(_0x3d1c66,null))[_0x6122('0x29')](function(_0x362796){if(_0x362796){_0x1825bf=_0x362796;return _0x362796[_0x6122('0x64')](_0x5f112d[_0x6122('0x56')][_0x6122('0x66')],_[_0x6122('0x53')](_0x5f112d[_0x6122('0x56')],[_0x6122('0x66'),'id'])||{});}return null;})[_0x6122('0x67')](function(_0x15487a){var _0x242fc0;var _0x483638;_0x4c26e7=_0x15487a||[];var _0x2faa3c=[];if(_0x15487a){for(var _0x2404da=0x0;_0x2404da<_0x15487a[_0x6122('0x39')];_0x2404da+=0x1){var _0x45ccef=_0x15487a[_0x2404da][_0x6122('0x4c')]({'plain':!![]});_0x1825bf[_0x6122('0x68')]=_0x5f112d['body'][_0x6122('0x68')]?_0x5f112d[_0x6122('0x56')][_0x6122('0x68')]:_0x1825bf[_0x6122('0x68')];switch(_0x1825bf[_0x6122('0x68')]){case'always':_0x242fc0=squel[_0x6122('0x69')]()['into'](_0x6122('0x6a'))[_0x6122('0x6b')]([_0x6122('0x6c'),_0x6122('0x6d'),_0x6122('0x6e'),_0x6122('0x6f'),_0x6122('0x5a'),_0x6122('0x54'),_0x6122('0x55')],squel[_0x6122('0x70')]()[_0x6122('0x71')]('phone',_0x6122('0x6c'))[_0x6122('0x71')](_0x6122('0x72'),_0x6122('0x6d'))[_0x6122('0x71')]('id','ContactId')['field'](_0x45ccef[_0x6122('0x73')]['toString'](),_0x6122('0x6f'))[_0x6122('0x71')](_0x5f112d[_0x6122('0x47')]['id'][_0x6122('0x74')](),'CampaignId')['field']('\x27'+_0x9233d1+'\x27','createdAt')[_0x6122('0x71')]('\x27'+_0x9233d1+'\x27','updatedAt')[_0x6122('0x75')](_0x6122('0x76'))['where'](_0x6122('0x77'))['where'](_0x6122('0x78'),_0x45ccef[_0x6122('0x73')][_0x6122('0x74')]())['where'](_0x6122('0x79'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x6122('0x70')]()[_0x6122('0x71')](_0x6122('0x7a'))[_0x6122('0x75')](_0x6122('0x7b'))[_0x6122('0x3e')](_0x6122('0x7c'),_0x5f112d['params']['id'][_0x6122('0x74')]()))['where'](_0x6122('0x7d'),squel['select']()[_0x6122('0x71')](_0x6122('0x7e'))[_0x6122('0x75')]('cm_hopper')[_0x6122('0x3e')](_0x6122('0x7c'),_0x5f112d[_0x6122('0x47')]['id'][_0x6122('0x74')]())))['toString']();break;case _0x6122('0x7f'):_0x242fc0=squel[_0x6122('0x69')]()[_0x6122('0x80')](_0x6122('0x6a'))['fromQuery'](['phone',_0x6122('0x6d'),_0x6122('0x6e'),_0x6122('0x6f'),'CampaignId',_0x6122('0x54'),_0x6122('0x55')],squel[_0x6122('0x70')]()[_0x6122('0x71')](_0x6122('0x6c'),_0x6122('0x6c'))['field']('NOW()',_0x6122('0x6d'))[_0x6122('0x71')]('id','ContactId')[_0x6122('0x71')](_0x45ccef['CmListId'][_0x6122('0x74')](),'ListId')['field'](_0x5f112d['params']['id'][_0x6122('0x74')](),'CampaignId')[_0x6122('0x71')]('\x27'+_0x9233d1+'\x27','createdAt')[_0x6122('0x71')]('\x27'+_0x9233d1+'\x27',_0x6122('0x55'))['from'](_0x6122('0x76'))[_0x6122('0x3e')](_0x6122('0x77'))[_0x6122('0x3e')](_0x6122('0x78'),_0x45ccef['CmListId'][_0x6122('0x74')]())['where'](_0x6122('0x79'))[_0x6122('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6122('0x70')]()[_0x6122('0x71')]('COALESCE(phone,\x27\x27)')[_0x6122('0x75')]('cm_hopper')[_0x6122('0x3e')](_0x6122('0x7c'),_0x5f112d[_0x6122('0x47')]['id'][_0x6122('0x74')]())))['toString']();break;default:_0x242fc0=squel[_0x6122('0x69')]()['into']('cm_hopper')['fromQuery']([_0x6122('0x6c'),'scheduledAt',_0x6122('0x6e'),_0x6122('0x6f'),_0x6122('0x5a'),_0x6122('0x54'),_0x6122('0x55')],squel['select']()['field'](_0x6122('0x6c'),_0x6122('0x6c'))[_0x6122('0x71')]('NOW()',_0x6122('0x6d'))[_0x6122('0x71')]('id',_0x6122('0x6e'))[_0x6122('0x71')](_0x45ccef[_0x6122('0x73')][_0x6122('0x74')](),_0x6122('0x6f'))[_0x6122('0x71')](_0x5f112d[_0x6122('0x47')]['id'][_0x6122('0x74')](),_0x6122('0x5a'))[_0x6122('0x71')]('\x27'+_0x9233d1+'\x27',_0x6122('0x54'))['field']('\x27'+_0x9233d1+'\x27',_0x6122('0x55'))[_0x6122('0x75')](_0x6122('0x76'))[_0x6122('0x3e')](_0x6122('0x77'))[_0x6122('0x3e')](_0x6122('0x78'),_0x45ccef[_0x6122('0x73')][_0x6122('0x74')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x6122('0x74')]();}_0x483638=squel['insert']()[_0x6122('0x80')](_0x6122('0x81'))['fromQuery'](['cmHopperId',_0x6122('0x6d'),'phone',_0x6122('0x82'),'createdAt','updatedAt'],squel['select']()[_0x6122('0x71')](_0x6122('0x83'),'id')[_0x6122('0x71')](_0x6122('0x72'),'scheduledAt')[_0x6122('0x71')](_0x6122('0x84'),_0x6122('0x6c'))[_0x6122('0x71')](_0x6122('0x85'),_0x6122('0x82'))[_0x6122('0x71')]('\x27'+_0x9233d1+'\x27',_0x6122('0x54'))[_0x6122('0x71')]('\x27'+_0x9233d1+'\x27','updatedAt')['from'](_0x6122('0x86'),'ci')[_0x6122('0x87')](_0x6122('0x6a'),'h',_0x6122('0x88'))[_0x6122('0x3e')](_0x6122('0x89'),_0x45ccef[_0x6122('0x73')][_0x6122('0x74')]())[_0x6122('0x3e')]('h.CampaignId=?',_0x5f112d['params']['id'][_0x6122('0x74')]())[_0x6122('0x3e')]('h.createdAt\x20=\x20?',_0x9233d1))[_0x6122('0x74')]();_0x2faa3c[_0x6122('0x8a')](db[_0x6122('0x8b')][_0x6122('0x33')](_0x242fc0));_0x36bae2[_0x6122('0x8a')](db[_0x6122('0x8b')]['query'](_0x483638));}return BPromise[_0x6122('0x8c')](_0x2faa3c);}})[_0x6122('0x29')](function(){return BPromise[_0x6122('0x8c')](_0x36bae2);})[_0x6122('0x29')](function(){return _0x4c26e7;})['then'](respondWithResult(_0x3d1c66,null))[_0x6122('0x45')](handleError(_0x3d1c66,null));};exports[_0x6122('0x8d')]=function(_0x5c34e2,_0x220598,_0x124494){return db[_0x6122('0x2f')][_0x6122('0x49')]({'where':{'id':_0x5c34e2['params']['id']}})[_0x6122('0x29')](handleEntityNotFound(_0x220598,null))[_0x6122('0x29')](function(_0x40bf20){if(_0x40bf20){return _0x40bf20[_0x6122('0x8d')](_0x5c34e2[_0x6122('0x33')]['ids']);}})[_0x6122('0x29')](function(_0x586340){if(_0x586340){return db[_0x6122('0x59')][_0x6122('0x27')]({'where':{'ListId':_0x5c34e2['query'][_0x6122('0x66')],'CampaignId':_0x5c34e2[_0x6122('0x47')]['id']}})['then'](function(){return _0x586340;});}})[_0x6122('0x29')](respondWithStatusCode(_0x220598,null))[_0x6122('0x45')](handleError(_0x220598,null));};exports[_0x6122('0x8e')]=function(_0x4e6715,_0x184c5e,_0x4c408a){var _0x29c532={};var _0x54b0a2={};var _0x39a7f7;var _0x5c4646;return db['Campaign'][_0x6122('0x5d')]({'where':{'id':_0x4e6715[_0x6122('0x47')]['id']}})['then'](handleEntityNotFound(_0x184c5e,null))[_0x6122('0x29')](function(_0x32ef98){if(_0x32ef98){_0x39a7f7=_0x32ef98;_0x54b0a2['model']=_[_0x6122('0x34')](db[_0x6122('0x63')][_0x6122('0x30')]);_0x54b0a2[_0x6122('0x33')]=_[_0x6122('0x34')](_0x4e6715['query']);_0x54b0a2[_0x6122('0x35')]=_['intersection'](_0x54b0a2['model'],_0x54b0a2[_0x6122('0x33')]);_0x29c532[_0x6122('0x37')]=_[_0x6122('0x36')](_0x54b0a2[_0x6122('0x32')],qs[_0x6122('0x38')](_0x4e6715[_0x6122('0x33')][_0x6122('0x38')]));_0x29c532['attributes']=_0x29c532['attributes']['length']?_0x29c532['attributes']:_0x54b0a2[_0x6122('0x32')];_0x29c532[_0x6122('0x3c')]=qs['sort'](_0x4e6715[_0x6122('0x33')][_0x6122('0x3d')]);_0x29c532[_0x6122('0x3e')]=qs[_0x6122('0x35')](_[_0x6122('0x3f')](_0x4e6715[_0x6122('0x33')],_0x54b0a2[_0x6122('0x35')]));if(_0x4e6715[_0x6122('0x33')]['filter']){_0x29c532[_0x6122('0x3e')]=_['merge'](_0x29c532[_0x6122('0x3e')],{'$or':_[_0x6122('0x2e')](_0x29c532[_0x6122('0x37')],function(_0x281740){var _0x2f09c3={};_0x2f09c3[_0x281740]={'$like':'%'+_0x4e6715[_0x6122('0x33')]['filter']+'%'};return _0x2f09c3;})});}_0x29c532=_[_0x6122('0x42')]({},_0x29c532,_0x4e6715[_0x6122('0x43')]);return _0x39a7f7[_0x6122('0x8e')](_0x29c532);}})['then'](function(_0x1fccdf){if(_0x1fccdf){_0x5c4646=_0x1fccdf['length'];if(!_0x4e6715[_0x6122('0x33')]['hasOwnProperty']('nolimit')){_0x29c532['limit']=qs['limit'](_0x4e6715[_0x6122('0x33')][_0x6122('0x1f')]);_0x29c532[_0x6122('0x1d')]=qs[_0x6122('0x1d')](_0x4e6715[_0x6122('0x33')][_0x6122('0x1d')]);}return _0x39a7f7[_0x6122('0x8e')](_0x29c532);}})['then'](function(_0x45a3b5){if(_0x45a3b5){return _0x45a3b5?{'count':_0x5c4646,'rows':_0x45a3b5}:null;}})[_0x6122('0x29')](respondWithResult(_0x184c5e,null))[_0x6122('0x45')](handleError(_0x184c5e,null));};exports['addBlackLists']=function(_0x1b0357,_0x451bf7,_0x12cd3a){var _0x58390e,_0xf4ea04;var _0x3be502=[];var _0x4f92c5=moment()[_0x6122('0x8f')](_0x6122('0x65'));return db[_0x6122('0x2f')][_0x6122('0x49')]({'where':{'id':_0x1b0357[_0x6122('0x47')]['id']}})[_0x6122('0x29')](handleEntityNotFound(_0x451bf7,null))['then'](function(_0x127836){if(_0x127836){_0xf4ea04=_0x127836;return _0x127836[_0x6122('0x90')](_0x1b0357[_0x6122('0x56')][_0x6122('0x66')],_[_0x6122('0x53')](_0x1b0357['body'],[_0x6122('0x66'),'id'])||{});}return null;})[_0x6122('0x67')](function(_0x3ddade){var _0x4c8e9c;var _0x45edc7;_0x58390e=_0x3ddade||[];var _0x1d465c=[];if(_0x3ddade){for(var _0x2ef407=0x0;_0x2ef407<_0x3ddade[_0x6122('0x39')];_0x2ef407+=0x1){var _0x5d05bb=_0x3ddade[_0x2ef407][_0x6122('0x4c')]({'plain':!![]});_0x4c8e9c=squel['insert']()['into'](_0x6122('0x91'))['fromQuery']([_0x6122('0x6c'),'ContactId','ListId',_0x6122('0x5a'),_0x6122('0x54'),_0x6122('0x55')],squel[_0x6122('0x70')]()[_0x6122('0x71')]('phone',_0x6122('0x6c'))['field']('id',_0x6122('0x6e'))['field'](_0x5d05bb[_0x6122('0x73')][_0x6122('0x74')](),'ListId')[_0x6122('0x71')](_0x1b0357[_0x6122('0x47')]['id'][_0x6122('0x74')](),_0x6122('0x5a'))[_0x6122('0x71')](_0x6122('0x72'),'createdAt')[_0x6122('0x71')](_0x6122('0x72'),_0x6122('0x55'))[_0x6122('0x75')]('cm_contacts')[_0x6122('0x3e')](_0x6122('0x77'))[_0x6122('0x3e')](_0x6122('0x78'),_0x5d05bb[_0x6122('0x73')][_0x6122('0x74')]())[_0x6122('0x3e')](_0x6122('0x79')))[_0x6122('0x74')]();_0x1d465c['push'](db[_0x6122('0x8b')][_0x6122('0x33')](_0x4c8e9c));}return BPromise[_0x6122('0x8c')](_0x1d465c);}})['then'](function(){return _0x58390e;})[_0x6122('0x29')](respondWithResult(_0x451bf7,null))['catch'](handleError(_0x451bf7,null));};exports[_0x6122('0x92')]=function(_0x1a7cbf,_0x487590,_0x3f5322){return db[_0x6122('0x2f')][_0x6122('0x49')]({'where':{'id':_0x1a7cbf[_0x6122('0x47')]['id']}})[_0x6122('0x29')](handleEntityNotFound(_0x487590,null))[_0x6122('0x29')](function(_0x4beb96){if(_0x4beb96){return _0x4beb96[_0x6122('0x92')](_0x1a7cbf['query'][_0x6122('0x66')]);}})[_0x6122('0x29')](function(_0x156d9b){if(_0x156d9b){return db[_0x6122('0x61')][_0x6122('0x27')]({'where':{'ListId':_0x1a7cbf[_0x6122('0x33')][_0x6122('0x66')],'CampaignId':_0x1a7cbf['params']['id']}})[_0x6122('0x29')](function(){return _0x156d9b;});}})[_0x6122('0x29')](respondWithStatusCode(_0x487590,null))[_0x6122('0x45')](handleError(_0x487590,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index e689345..a458427 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x41229c,_0x32fc89){var _0x1ce6c7=function(_0x9f4b40){while(--_0x9f4b40){_0x41229c['push'](_0x41229c['shift']());}};_0x1ce6c7(++_0x32fc89);}(_0x7a54,0x106));var _0x47a5=function(_0x56c2b6,_0x1b7a71){_0x56c2b6=_0x56c2b6-0x0;var _0x15dfb7=_0x7a54[_0x56c2b6];return _0x15dfb7;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x55eb57,_0x1011e2){var _0x55ca29=function(_0xad5a1d){while(--_0xad5a1d){_0x55eb57['push'](_0x55eb57['shift']());}};_0x55ca29(++_0x1011e2);}(_0x7a54,0x106));var _0x47a5=function(_0x391582,_0x49efa7){_0x391582=_0x391582-0x0;var _0x8f3d97=_0x7a54[_0x391582];return _0x8f3d97;};'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 bd95814..6b4058c 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 _0x2209=['Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','findAll','raw','options','where','attributes','limit','include','model','map','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x112ebd,_0x533fea){var _0x27e060=function(_0x578906){while(--_0x578906){_0x112ebd['push'](_0x112ebd['shift']());}};_0x27e060(++_0x533fea);}(_0x2209,0x95));var _0x9220=function(_0x31a819,_0x4e92b0){_0x31a819=_0x31a819-0x0;var _0x1f3a09=_0x2209[_0x31a819];return _0x1f3a09;};'use strict';var _=require(_0x9220('0x0'));var util=require(_0x9220('0x1'));var moment=require(_0x9220('0x2'));var BPromise=require(_0x9220('0x3'));var rs=require(_0x9220('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9220('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9220('0x6'))(_0x9220('0x7'));var config=require(_0x9220('0x8'));var jayson=require(_0x9220('0x9'));var client=jayson[_0x9220('0xa')][_0x9220('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x463d59,_0x243ea6,_0x1081b9){return new BPromise(function(_0x58e7f5,_0x21d055){return client[_0x9220('0xc')](_0x463d59,_0x1081b9)['then'](function(_0x242b73){logger[_0x9220('0xd')](_0x9220('0xe'),_0x243ea6,_0x9220('0xf'));logger['debug'](_0x9220('0x10'),_0x243ea6,_0x9220('0xf'),JSON[_0x9220('0x11')](_0x242b73));if(_0x242b73[_0x9220('0x12')]){if(_0x242b73[_0x9220('0x12')][_0x9220('0x13')]===0x1f4){logger[_0x9220('0x12')](_0x9220('0xe'),_0x243ea6,_0x242b73['error'][_0x9220('0x14')]);return _0x21d055(_0x242b73['error'][_0x9220('0x14')]);}logger['error'](_0x9220('0xe'),_0x243ea6,_0x242b73['error'][_0x9220('0x14')]);return _0x58e7f5(_0x242b73[_0x9220('0x12')][_0x9220('0x14')]);}else{logger[_0x9220('0xd')]('Campaign,\x20%s,\x20%s',_0x243ea6,_0x9220('0xf'));_0x58e7f5(_0x242b73[_0x9220('0x15')]['message']);}})['catch'](function(_0x3c3473){logger['error'](_0x9220('0xe'),_0x243ea6,_0x3c3473);_0x21d055(_0x3c3473);});});}exports[_0x9220('0x16')]=function(_0x44713f){var _0x56e0c8=this;return new Promise(function(_0x4a9507,_0x3dbfeb){return db['Campaign'][_0x9220('0x17')]({'raw':_0x44713f['options']?_0x44713f['options'][_0x9220('0x18')]===undefined?!![]:![]:!![],'where':_0x44713f[_0x9220('0x19')]?_0x44713f[_0x9220('0x19')][_0x9220('0x1a')]||null:null,'attributes':_0x44713f[_0x9220('0x19')]?_0x44713f[_0x9220('0x19')][_0x9220('0x1b')]||null:null,'limit':_0x44713f[_0x9220('0x19')]?_0x44713f[_0x9220('0x19')][_0x9220('0x1c')]||null:null,'include':_0x44713f[_0x9220('0x19')]?_0x44713f[_0x9220('0x19')][_0x9220('0x1d')]?_['map'](_0x44713f[_0x9220('0x19')][_0x9220('0x1d')],function(_0x48ee62){return{'model':db[_0x48ee62[_0x9220('0x1e')]],'as':_0x48ee62['as'],'attributes':_0x48ee62['attributes'],'include':_0x48ee62[_0x9220('0x1d')]?_[_0x9220('0x1f')](_0x48ee62[_0x9220('0x1d')],function(_0x284ed7){return{'model':db[_0x284ed7[_0x9220('0x1e')]],'as':_0x284ed7['as'],'attributes':_0x284ed7[_0x9220('0x1b')],'include':_0x284ed7['include']?_[_0x9220('0x1f')](_0x284ed7[_0x9220('0x1d')],function(_0x41769c){return{'model':db[_0x41769c[_0x9220('0x1e')]],'as':_0x41769c['as'],'attributes':_0x41769c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x330268){logger[_0x9220('0xd')](_0x9220('0x16'),_0x44713f);logger['debug']('GetCampaign',_0x44713f,JSON[_0x9220('0x11')](_0x330268));_0x4a9507(_0x330268);})[_0x9220('0x20')](function(_0x51cf57){logger[_0x9220('0x12')](_0x9220('0x16'),_0x51cf57[_0x9220('0x14')],_0x44713f);_0x3dbfeb(_0x56e0c8['error'](0x1f4,_0x51cf57[_0x9220('0x14')]));});});};
\ No newline at end of file
+var _0x9649=['Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','catch','GetCampaign','findAll','options','raw','where','attributes','limit','map','include','model','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','debug'];(function(_0x70a4e2,_0x1b833a){var _0x4d1d1e=function(_0x479208){while(--_0x479208){_0x70a4e2['push'](_0x70a4e2['shift']());}};_0x4d1d1e(++_0x1b833a);}(_0x9649,0x19f));var _0x9964=function(_0x21d821,_0x44aec5){_0x21d821=_0x21d821-0x0;var _0x5ae04f=_0x9649[_0x21d821];return _0x5ae04f;};'use strict';var _=require(_0x9964('0x0'));var util=require(_0x9964('0x1'));var moment=require(_0x9964('0x2'));var BPromise=require(_0x9964('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9964('0x4'));var db=require(_0x9964('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9964('0x6'))('rpc');var config=require(_0x9964('0x7'));var jayson=require(_0x9964('0x8'));var client=jayson[_0x9964('0x9')][_0x9964('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40c60b,_0x1338e7,_0x3fa639){return new BPromise(function(_0x4bec88,_0x45dda7){return client[_0x9964('0xb')](_0x40c60b,_0x3fa639)['then'](function(_0x10b88b){logger[_0x9964('0xc')]('Campaign,\x20%s,\x20%s',_0x1338e7,'request\x20sent');logger[_0x9964('0xd')](_0x9964('0xe'),_0x1338e7,_0x9964('0xf'),JSON[_0x9964('0x10')](_0x10b88b));if(_0x10b88b[_0x9964('0x11')]){if(_0x10b88b['error'][_0x9964('0x12')]===0x1f4){logger['error'](_0x9964('0x13'),_0x1338e7,_0x10b88b[_0x9964('0x11')]['message']);return _0x45dda7(_0x10b88b[_0x9964('0x11')][_0x9964('0x14')]);}logger['error'](_0x9964('0x13'),_0x1338e7,_0x10b88b[_0x9964('0x11')][_0x9964('0x14')]);return _0x4bec88(_0x10b88b[_0x9964('0x11')][_0x9964('0x14')]);}else{logger['info'](_0x9964('0x13'),_0x1338e7,_0x9964('0xf'));_0x4bec88(_0x10b88b['result'][_0x9964('0x14')]);}})[_0x9964('0x15')](function(_0x57fe55){logger[_0x9964('0x11')](_0x9964('0x13'),_0x1338e7,_0x57fe55);_0x45dda7(_0x57fe55);});});}exports[_0x9964('0x16')]=function(_0x4c18a4){var _0x4f2f68=this;return new Promise(function(_0x40b3dd,_0x931a0f){return db['Campaign'][_0x9964('0x17')]({'raw':_0x4c18a4[_0x9964('0x18')]?_0x4c18a4[_0x9964('0x18')][_0x9964('0x19')]===undefined?!![]:![]:!![],'where':_0x4c18a4[_0x9964('0x18')]?_0x4c18a4[_0x9964('0x18')][_0x9964('0x1a')]||null:null,'attributes':_0x4c18a4[_0x9964('0x18')]?_0x4c18a4[_0x9964('0x18')][_0x9964('0x1b')]||null:null,'limit':_0x4c18a4['options']?_0x4c18a4[_0x9964('0x18')][_0x9964('0x1c')]||null:null,'include':_0x4c18a4['options']?_0x4c18a4[_0x9964('0x18')]['include']?_[_0x9964('0x1d')](_0x4c18a4[_0x9964('0x18')][_0x9964('0x1e')],function(_0x167525){return{'model':db[_0x167525[_0x9964('0x1f')]],'as':_0x167525['as'],'attributes':_0x167525[_0x9964('0x1b')],'include':_0x167525['include']?_[_0x9964('0x1d')](_0x167525[_0x9964('0x1e')],function(_0x5961e9){return{'model':db[_0x5961e9[_0x9964('0x1f')]],'as':_0x5961e9['as'],'attributes':_0x5961e9[_0x9964('0x1b')],'include':_0x5961e9[_0x9964('0x1e')]?_[_0x9964('0x1d')](_0x5961e9[_0x9964('0x1e')],function(_0x5a5793){return{'model':db[_0x5a5793[_0x9964('0x1f')]],'as':_0x5a5793['as'],'attributes':_0x5a5793['attributes']};}):[]};}):[]};}):[]:[]})[_0x9964('0x20')](function(_0x512f6b){logger[_0x9964('0xc')]('GetCampaign',_0x4c18a4);logger[_0x9964('0xd')](_0x9964('0x16'),_0x4c18a4,JSON[_0x9964('0x10')](_0x512f6b));_0x40b3dd(_0x512f6b);})[_0x9964('0x15')](function(_0x11cdce){logger[_0x9964('0x11')](_0x9964('0x16'),_0x11cdce[_0x9964('0x14')],_0x4c18a4);_0x931a0f(_0x4f2f68[_0x9964('0x11')](0x1f4,_0x11cdce['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 972b388..3f27699 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 _0xe526=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xe526,0x6c));var _0x6e52=function(_0x44692d,_0x4b9979){_0x44692d=_0x44692d-0x0;var _0xcf41c5=_0xe526[_0x44692d];return _0xcf41c5;};'use strict';var multer=require('multer');var util=require(_0x6e52('0x0'));var path=require('path');var timeout=require(_0x6e52('0x1'));var express=require('express');var router=express[_0x6e52('0x2')]();var fs_extra=require(_0x6e52('0x3'));var auth=require(_0x6e52('0x4'));var interaction=require(_0x6e52('0x5'));var config=require(_0x6e52('0x6'));var controller=require(_0x6e52('0x7'));router['get']('/',auth[_0x6e52('0x8')](),controller[_0x6e52('0x9')]);router[_0x6e52('0xa')](_0x6e52('0xb'),auth['isAuthenticated'](),controller[_0x6e52('0xc')]);router[_0x6e52('0xa')](_0x6e52('0xd'),auth[_0x6e52('0x8')](),controller[_0x6e52('0xe')]);router[_0x6e52('0xa')](_0x6e52('0xf'),auth[_0x6e52('0x8')](),controller[_0x6e52('0x10')]);router[_0x6e52('0xa')](_0x6e52('0x11'),auth[_0x6e52('0x8')](),controller['getHopperFinals']);router[_0x6e52('0xa')](_0x6e52('0x12'),auth[_0x6e52('0x8')](),controller[_0x6e52('0x13')]);router[_0x6e52('0xa')](_0x6e52('0x14'),auth[_0x6e52('0x8')](),controller[_0x6e52('0x15')]);router[_0x6e52('0xa')](_0x6e52('0x16'),auth[_0x6e52('0x8')](),controller[_0x6e52('0x17')]);router[_0x6e52('0x18')]('/',auth['isAuthenticated'](),controller[_0x6e52('0x19')]);router[_0x6e52('0x18')](_0x6e52('0x1a'),auth[_0x6e52('0x8')](),controller[_0x6e52('0x1b')]);router[_0x6e52('0x18')](_0x6e52('0x14'),auth['isAuthenticated'](),controller[_0x6e52('0x1c')]);router[_0x6e52('0x18')]('/:id/blacklists',auth[_0x6e52('0x8')](),controller[_0x6e52('0x1d')]);router[_0x6e52('0x1e')](_0x6e52('0xb'),auth[_0x6e52('0x8')](),controller['update']);router[_0x6e52('0x1f')](_0x6e52('0xb'),auth[_0x6e52('0x8')](),controller[_0x6e52('0x20')]);router[_0x6e52('0x1f')](_0x6e52('0x14'),auth[_0x6e52('0x8')](),controller[_0x6e52('0x21')]);router[_0x6e52('0x1f')]('/:id/blacklists',auth[_0x6e52('0x8')](),controller[_0x6e52('0x22')]);module[_0x6e52('0x23')]=router;
\ No newline at end of file
+var _0x0a8d=['index','/:id','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_black','getHopperBlacks','getBlackLists','create','/:id/clone','post','/:id/lists','addLists','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeBlackLists','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x51bfb2,_0x273636){var _0x15e037=function(_0x176764){while(--_0x176764){_0x51bfb2['push'](_0x51bfb2['shift']());}};_0x15e037(++_0x273636);}(_0x0a8d,0x89));var _0xd0a8=function(_0x1b2664,_0x197517){_0x1b2664=_0x1b2664-0x0;var _0x1c5397=_0x0a8d[_0x1b2664];return _0x1c5397;};'use strict';var multer=require(_0xd0a8('0x0'));var util=require(_0xd0a8('0x1'));var path=require('path');var timeout=require(_0xd0a8('0x2'));var express=require(_0xd0a8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd0a8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd0a8('0x5'));var controller=require('./campaign.controller');router[_0xd0a8('0x6')]('/',auth[_0xd0a8('0x7')](),controller[_0xd0a8('0x8')]);router['get'](_0xd0a8('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0xd0a8('0xa'),auth[_0xd0a8('0x7')](),controller[_0xd0a8('0xb')]);router[_0xd0a8('0x6')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0xd0a8('0xc')]);router[_0xd0a8('0x6')]('/:id/hopper_finals',auth[_0xd0a8('0x7')](),controller['getHopperFinals']);router[_0xd0a8('0x6')](_0xd0a8('0xd'),auth[_0xd0a8('0x7')](),controller[_0xd0a8('0xe')]);router[_0xd0a8('0x6')]('/:id/lists',auth[_0xd0a8('0x7')](),controller['getLists']);router[_0xd0a8('0x6')]('/:id/blacklists',auth[_0xd0a8('0x7')](),controller[_0xd0a8('0xf')]);router['post']('/',auth[_0xd0a8('0x7')](),controller[_0xd0a8('0x10')]);router['post'](_0xd0a8('0x11'),auth[_0xd0a8('0x7')](),controller['clone']);router[_0xd0a8('0x12')](_0xd0a8('0x13'),auth[_0xd0a8('0x7')](),controller[_0xd0a8('0x14')]);router[_0xd0a8('0x12')](_0xd0a8('0x15'),auth[_0xd0a8('0x7')](),controller[_0xd0a8('0x16')]);router[_0xd0a8('0x17')](_0xd0a8('0x9'),auth[_0xd0a8('0x7')](),controller[_0xd0a8('0x18')]);router[_0xd0a8('0x19')](_0xd0a8('0x9'),auth[_0xd0a8('0x7')](),controller[_0xd0a8('0x1a')]);router[_0xd0a8('0x19')](_0xd0a8('0x13'),auth[_0xd0a8('0x7')](),controller['removeLists']);router[_0xd0a8('0x19')](_0xd0a8('0x15'),auth[_0xd0a8('0x7')](),controller[_0xd0a8('0x1b')]);module[_0xd0a8('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 66a5a9d..54f0e8a 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 _0x9160=['STRING','TEXT','medium','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0xcce0d2,_0x553582){var _0x18144e=function(_0x1acfd0){while(--_0x1acfd0){_0xcce0d2['push'](_0xcce0d2['shift']());}};_0x18144e(++_0x553582);}(_0x9160,0x106));var _0x0916=function(_0x150ff1,_0x182895){_0x150ff1=_0x150ff1-0x0;var _0x4a3647=_0x9160[_0x150ff1];return _0x4a3647;};'use strict';var Sequelize=require(_0x0916('0x0'));module[_0x0916('0x1')]={'key':{'type':Sequelize[_0x0916('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x0916('0x3')],'length':_0x0916('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x0916('0x5')],'get':function(){return this[_0x0916('0x6')](_0x0916('0x7'));}}};
\ No newline at end of file
+var _0x83a5=['getDataValue','sequelize','exports','STRING','TEXT','medium','VIRTUAL'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0x83a5,0x8d));var _0x583a=function(_0x532c88,_0x493d7c){_0x532c88=_0x532c88-0x0;var _0x4c6b26=_0x83a5[_0x532c88];return _0x4c6b26;};'use strict';var Sequelize=require(_0x583a('0x0'));module[_0x583a('0x1')]={'key':{'type':Sequelize[_0x583a('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x583a('0x3')],'length':_0x583a('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x583a('0x2')]},'name':{'type':Sequelize[_0x583a('0x5')],'get':function(){return this[_0x583a('0x6')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 4dc5f2f..ac0f823 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 _0x06b0=['findAll','rows','catch','show','params','keys','intersection','length','include','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','stack','send','index','map','rawAttributes','type','key','model','name','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','filter','options','includeAll','CannedAnswer'];(function(_0x132558,_0x521d93){var _0x34f138=function(_0x3e3541){while(--_0x3e3541){_0x132558['push'](_0x132558['shift']());}};_0x34f138(++_0x521d93);}(_0x06b0,0x178));var _0x006b=function(_0x4e7da7,_0xda1a3b){_0x4e7da7=_0x4e7da7-0x0;var _0xa368ea=_0x06b0[_0x4e7da7];return _0xa368ea;};'use strict';var emlformat=require(_0x006b('0x0'));var rimraf=require(_0x006b('0x1'));var zipdir=require(_0x006b('0x2'));var jsonpatch=require(_0x006b('0x3'));var rp=require(_0x006b('0x4'));var moment=require(_0x006b('0x5'));var BPromise=require(_0x006b('0x6'));var Mustache=require(_0x006b('0x7'));var util=require('util');var path=require(_0x006b('0x8'));var sox=require(_0x006b('0x9'));var csv=require(_0x006b('0xa'));var ejs=require(_0x006b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x006b('0xc'));var squel=require(_0x006b('0xd'));var crypto=require(_0x006b('0xe'));var jsforce=require(_0x006b('0xf'));var deskjs=require(_0x006b('0x10'));var toCsv=require(_0x006b('0xa'));var querystring=require(_0x006b('0x11'));var Papa=require(_0x006b('0x12'));var Redis=require(_0x006b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x006b('0x14'));var as=require(_0x006b('0x15'));var hardwareService=require(_0x006b('0x16'));var logger=require('../../config/logger')(_0x006b('0x17'));var utils=require(_0x006b('0x18'));var config=require(_0x006b('0x19'));var licenseUtil=require(_0x006b('0x1a'));var db=require(_0x006b('0x1b'))['db'];function respondWithStatusCode(_0x5882db,_0x49f633){_0x49f633=_0x49f633||0xcc;return function(_0x4910be){if(_0x4910be){return _0x5882db[_0x006b('0x1c')](_0x49f633);}return _0x5882db[_0x006b('0x1d')](_0x49f633)[_0x006b('0x1e')]();};}function respondWithResult(_0x664fb6,_0xf0b1d2){_0xf0b1d2=_0xf0b1d2||0xc8;return function(_0x5638a3){if(_0x5638a3){return _0x664fb6[_0x006b('0x1d')](_0xf0b1d2)[_0x006b('0x1f')](_0x5638a3);}};}function respondWithFilteredResult(_0x422b0b,_0x3f69c4){return function(_0x25cb02){if(_0x25cb02){var _0x2da7ab=typeof _0x3f69c4['offset']===_0x006b('0x20')&&typeof _0x3f69c4[_0x006b('0x21')]===_0x006b('0x20');var _0x4aa4b5=_0x25cb02['count'];var _0x4f3a97=_0x2da7ab?0x0:_0x3f69c4[_0x006b('0x22')];var _0x7ae223=_0x2da7ab?_0x25cb02[_0x006b('0x23')]:_0x3f69c4['offset']+_0x3f69c4[_0x006b('0x21')];var _0x1c0b7d;if(_0x7ae223>=_0x4aa4b5){_0x7ae223=_0x4aa4b5;_0x1c0b7d=0xc8;}else{_0x1c0b7d=0xce;}_0x422b0b[_0x006b('0x1d')](_0x1c0b7d);return _0x422b0b[_0x006b('0x24')]('Content-Range',_0x4f3a97+'-'+_0x7ae223+'/'+_0x4aa4b5)[_0x006b('0x1f')](_0x25cb02);}return null;};}function patchUpdates(_0x49f557){return function(_0x4fa660){try{jsonpatch[_0x006b('0x25')](_0x4fa660,_0x49f557,!![]);}catch(_0x1c4c05){return BPromise[_0x006b('0x26')](_0x1c4c05);}return _0x4fa660[_0x006b('0x27')]();};}function saveUpdates(_0x58d195,_0x1d721d){return function(_0x2a5e28){if(_0x2a5e28){return _0x2a5e28[_0x006b('0x28')](_0x58d195)[_0x006b('0x29')](function(_0x5457f4){return _0x5457f4;});}return null;};}function removeEntity(_0x212523,_0x12bcac){return function(_0x275b20){if(_0x275b20){return _0x275b20[_0x006b('0x2a')]()[_0x006b('0x29')](function(){var _0x5f384a=_0x275b20[_0x006b('0x2b')]({'plain':!![]});var _0x153c64=_0x006b('0x2c');return db[_0x006b('0x2d')][_0x006b('0x2a')]({'where':{'type':_0x153c64,'resourceId':_0x5f384a['id']}})[_0x006b('0x29')](function(){return _0x275b20;});})['then'](function(){_0x212523[_0x006b('0x1d')](0xcc)[_0x006b('0x1e')]();});}};}function handleEntityNotFound(_0x448a25,_0x4804ca){return function(_0x274bc2){if(!_0x274bc2){_0x448a25['sendStatus'](0x194);}return _0x274bc2;};}function handleError(_0x2bde5b,_0x49537f){_0x49537f=_0x49537f||0x1f4;return function(_0x2f83c4){logger['error'](_0x2f83c4[_0x006b('0x2e')]);if(_0x2f83c4['name']){delete _0x2f83c4['name'];}_0x2bde5b[_0x006b('0x1d')](_0x49537f)[_0x006b('0x2f')](_0x2f83c4);};}exports[_0x006b('0x30')]=function(_0x26e1f8,_0x328462){var _0x41d583={},_0x20e268={},_0x4cc101={'count':0x0,'rows':[]};var _0x5e649f=_[_0x006b('0x31')](db['CannedAnswer'][_0x006b('0x32')],function(_0x3a343a){return{'name':_0x3a343a['fieldName'],'type':_0x3a343a[_0x006b('0x33')][_0x006b('0x34')]};});_0x20e268[_0x006b('0x35')]=_[_0x006b('0x31')](_0x5e649f,_0x006b('0x36'));_0x20e268[_0x006b('0x37')]=_['keys'](_0x26e1f8['query']);_0x20e268[_0x006b('0x38')]=_['intersection'](_0x20e268['model'],_0x20e268[_0x006b('0x37')]);_0x41d583[_0x006b('0x39')]=_['intersection'](_0x20e268[_0x006b('0x35')],qs[_0x006b('0x3a')](_0x26e1f8[_0x006b('0x37')][_0x006b('0x3a')]));_0x41d583['attributes']=_0x41d583['attributes']['length']?_0x41d583['attributes']:_0x20e268[_0x006b('0x35')];if(!_0x26e1f8[_0x006b('0x37')][_0x006b('0x3b')](_0x006b('0x3c'))){_0x41d583[_0x006b('0x21')]=qs[_0x006b('0x21')](_0x26e1f8[_0x006b('0x37')]['limit']);_0x41d583[_0x006b('0x22')]=qs[_0x006b('0x22')](_0x26e1f8[_0x006b('0x37')]['offset']);}_0x41d583[_0x006b('0x3d')]=qs['sort'](_0x26e1f8[_0x006b('0x37')][_0x006b('0x3e')]);_0x41d583['where']=qs[_0x006b('0x38')](_[_0x006b('0x3f')](_0x26e1f8['query'],_0x20e268[_0x006b('0x38')]),_0x5e649f);if(_0x26e1f8[_0x006b('0x37')]['filter']){_0x41d583['where']=_[_0x006b('0x40')](_0x41d583['where'],{'$or':[{'key':{'$like':'%'+_0x26e1f8[_0x006b('0x37')][_0x006b('0x41')]+'%'}},{'value':{'$like':'%'+_0x26e1f8['query'][_0x006b('0x41')]+'%'}}]});}_0x41d583=_[_0x006b('0x40')]({},_0x41d583,_0x26e1f8[_0x006b('0x42')]);var _0x251d9f={'where':_0x41d583['where']};return db['CannedAnswer'][_0x006b('0x23')](_0x251d9f)[_0x006b('0x29')](function(_0xb9d918){_0x4cc101[_0x006b('0x23')]=_0xb9d918;if(_0x26e1f8[_0x006b('0x37')][_0x006b('0x43')]){_0x41d583['include']=[{'all':!![]}];}return db[_0x006b('0x44')][_0x006b('0x45')](_0x41d583);})['then'](function(_0x56f85b){_0x4cc101[_0x006b('0x46')]=_0x56f85b;return _0x4cc101;})[_0x006b('0x29')](respondWithFilteredResult(_0x328462,_0x41d583))[_0x006b('0x47')](handleError(_0x328462,null));};exports[_0x006b('0x48')]=function(_0x2c4b31,_0x4b001f){var _0x3470ca={'raw':!![],'where':{'id':_0x2c4b31[_0x006b('0x49')]['id']}},_0x122411={};_0x122411[_0x006b('0x35')]=_[_0x006b('0x4a')](db[_0x006b('0x44')][_0x006b('0x32')]);_0x122411[_0x006b('0x37')]=_[_0x006b('0x4a')](_0x2c4b31[_0x006b('0x37')]);_0x122411[_0x006b('0x38')]=_[_0x006b('0x4b')](_0x122411[_0x006b('0x35')],_0x122411[_0x006b('0x37')]);_0x3470ca[_0x006b('0x39')]=_[_0x006b('0x4b')](_0x122411[_0x006b('0x35')],qs[_0x006b('0x3a')](_0x2c4b31['query']['fields']));_0x3470ca['attributes']=_0x3470ca[_0x006b('0x39')][_0x006b('0x4c')]?_0x3470ca['attributes']:_0x122411['model'];if(_0x2c4b31[_0x006b('0x37')][_0x006b('0x43')]){_0x3470ca[_0x006b('0x4d')]=[{'all':!![]}];}_0x3470ca=_[_0x006b('0x40')]({},_0x3470ca,_0x2c4b31[_0x006b('0x42')]);return db['CannedAnswer']['find'](_0x3470ca)[_0x006b('0x29')](handleEntityNotFound(_0x4b001f,null))['then'](respondWithResult(_0x4b001f,null))[_0x006b('0x47')](handleError(_0x4b001f,null));};exports[_0x006b('0x28')]=function(_0x427948,_0x2d451b){if(_0x427948['body']['id']){delete _0x427948[_0x006b('0x4e')]['id'];}return db[_0x006b('0x44')][_0x006b('0x4f')]({'where':{'id':_0x427948[_0x006b('0x49')]['id']}})[_0x006b('0x29')](handleEntityNotFound(_0x2d451b,null))[_0x006b('0x29')](saveUpdates(_0x427948['body'],null))['then'](respondWithResult(_0x2d451b,null))[_0x006b('0x47')](handleError(_0x2d451b,null));};exports[_0x006b('0x2a')]=function(_0x265c2c,_0x261d07){return db[_0x006b('0x44')][_0x006b('0x4f')]({'where':{'id':_0x265c2c[_0x006b('0x49')]['id']}})[_0x006b('0x29')](handleEntityNotFound(_0x261d07,null))[_0x006b('0x29')](removeEntity(_0x261d07,null))[_0x006b('0x47')](handleError(_0x261d07,null));};exports[_0x006b('0x50')]=function(_0x3807ad,_0x522522){var _0x2dbac5={'key':_0x3807ad[_0x006b('0x4e')][_0x006b('0x34')]};if(_0x3807ad[_0x006b('0x4e')][_0x006b('0x51')]){_0x2dbac5[_0x006b('0x51')]=_0x3807ad[_0x006b('0x4e')][_0x006b('0x51')];}else if(_0x3807ad[_0x006b('0x4e')][_0x006b('0x52')]){_0x2dbac5['SmsAccountId']=_0x3807ad[_0x006b('0x4e')][_0x006b('0x52')];}else if(_0x3807ad['body'][_0x006b('0x53')]){_0x2dbac5[_0x006b('0x53')]=_0x3807ad[_0x006b('0x4e')][_0x006b('0x53')];}else if(_0x3807ad[_0x006b('0x4e')][_0x006b('0x54')]){_0x2dbac5[_0x006b('0x54')]=_0x3807ad[_0x006b('0x4e')][_0x006b('0x54')];}return db[_0x006b('0x44')][_0x006b('0x4f')]({'where':_0x2dbac5})[_0x006b('0x29')](function(_0xce5412){if(_0xce5412){throw new db['Sequelize']['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x006b('0x44')][_0x006b('0x50')](_0x3807ad[_0x006b('0x4e')]);})[_0x006b('0x29')](function(_0x534d20){var _0x340182=_0x3807ad[_0x006b('0x55')][_0x006b('0x2b')]({'plain':!![]});if(!_0x340182)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x340182['role']===_0x006b('0x55')){var _0xd4beb2=_0x534d20['get']({'plain':!![]});return db[_0x006b('0x56')][_0x006b('0x4f')]({'where':{'name':_0x006b('0x2c'),'userProfileId':_0x340182[_0x006b('0x57')]},'raw':!![]})[_0x006b('0x29')](function(_0x438723){if(_0x438723&&_0x438723['autoAssociation']===0x0){return db[_0x006b('0x2d')][_0x006b('0x50')]({'name':_0xd4beb2[_0x006b('0x36')],'resourceId':_0xd4beb2['id'],'type':_0x438723['name'],'sectionId':_0x438723['id']},{})['then'](function(){return _0x534d20;});}else{return _0x534d20;}})[_0x006b('0x47')](function(_0x4ab036){logger['error'](_0x006b('0x58'),_0x4ab036);throw _0x4ab036;});}return _0x534d20;})['then'](respondWithResult(_0x522522,0xc9))[_0x006b('0x47')](handleError(_0x522522,null));};
\ No newline at end of file
+var _0xe52c=['path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','map','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','options','CannedAnswer','includeAll','include','rows','catch','show','merge','find','update','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','eml-format','rimraf','fast-json-patch','moment','mustache'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0xe52c,0xa7));var _0xce52=function(_0x3e57cc,_0x432089){_0x3e57cc=_0x3e57cc-0x0;var _0x4737a0=_0xe52c[_0x3e57cc];return _0x4737a0;};'use strict';var emlformat=require(_0xce52('0x0'));var rimraf=require(_0xce52('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce52('0x2'));var rp=require('request-promise');var moment=require(_0xce52('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xce52('0x4'));var util=require('util');var path=require(_0xce52('0x5'));var sox=require(_0xce52('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce52('0x7'));var _=require(_0xce52('0x8'));var squel=require(_0xce52('0x9'));var crypto=require(_0xce52('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xce52('0xb'));var toCsv=require(_0xce52('0xc'));var querystring=require(_0xce52('0xd'));var Papa=require('papaparse');var Redis=require(_0xce52('0xe'));var authService=require(_0xce52('0xf'));var qs=require(_0xce52('0x10'));var as=require(_0xce52('0x11'));var hardwareService=require(_0xce52('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xce52('0x13'));var config=require(_0xce52('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xce52('0x15'))['db'];function respondWithStatusCode(_0x1d3137,_0x1472ea){_0x1472ea=_0x1472ea||0xcc;return function(_0x135adf){if(_0x135adf){return _0x1d3137['sendStatus'](_0x1472ea);}return _0x1d3137[_0xce52('0x16')](_0x1472ea)[_0xce52('0x17')]();};}function respondWithResult(_0xaacb6,_0x35b5c5){_0x35b5c5=_0x35b5c5||0xc8;return function(_0x3fa8a1){if(_0x3fa8a1){return _0xaacb6[_0xce52('0x16')](_0x35b5c5)[_0xce52('0x18')](_0x3fa8a1);}};}function respondWithFilteredResult(_0x4fc0bc,_0x4bfbb1){return function(_0x483511){if(_0x483511){var _0x7f9ea9=typeof _0x4bfbb1[_0xce52('0x19')]===_0xce52('0x1a')&&typeof _0x4bfbb1[_0xce52('0x1b')]===_0xce52('0x1a');var _0x5c5267=_0x483511[_0xce52('0x1c')];var _0x40be60=_0x7f9ea9?0x0:_0x4bfbb1['offset'];var _0x528c0b=_0x7f9ea9?_0x483511[_0xce52('0x1c')]:_0x4bfbb1[_0xce52('0x19')]+_0x4bfbb1[_0xce52('0x1b')];var _0x343abc;if(_0x528c0b>=_0x5c5267){_0x528c0b=_0x5c5267;_0x343abc=0xc8;}else{_0x343abc=0xce;}_0x4fc0bc['status'](_0x343abc);return _0x4fc0bc[_0xce52('0x1d')]('Content-Range',_0x40be60+'-'+_0x528c0b+'/'+_0x5c5267)[_0xce52('0x18')](_0x483511);}return null;};}function patchUpdates(_0x525a2f){return function(_0x3c3bae){try{jsonpatch[_0xce52('0x1e')](_0x3c3bae,_0x525a2f,!![]);}catch(_0x5e446d){return BPromise[_0xce52('0x1f')](_0x5e446d);}return _0x3c3bae[_0xce52('0x20')]();};}function saveUpdates(_0x520692,_0x27ed10){return function(_0x3d03e5){if(_0x3d03e5){return _0x3d03e5['update'](_0x520692)[_0xce52('0x21')](function(_0x3d4ca4){return _0x3d4ca4;});}return null;};}function removeEntity(_0x5271fc,_0x36d193){return function(_0x3f4686){if(_0x3f4686){return _0x3f4686[_0xce52('0x22')]()['then'](function(){var _0x1e52d6=_0x3f4686[_0xce52('0x23')]({'plain':!![]});var _0x20d557=_0xce52('0x24');return db[_0xce52('0x25')]['destroy']({'where':{'type':_0x20d557,'resourceId':_0x1e52d6['id']}})[_0xce52('0x21')](function(){return _0x3f4686;});})['then'](function(){_0x5271fc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ad6bb,_0x575788){return function(_0x26caf2){if(!_0x26caf2){_0x3ad6bb[_0xce52('0x26')](0x194);}return _0x26caf2;};}function handleError(_0x16eb0f,_0x38ee66){_0x38ee66=_0x38ee66||0x1f4;return function(_0x6f8e3f){logger[_0xce52('0x27')](_0x6f8e3f[_0xce52('0x28')]);if(_0x6f8e3f[_0xce52('0x29')]){delete _0x6f8e3f[_0xce52('0x29')];}_0x16eb0f[_0xce52('0x16')](_0x38ee66)[_0xce52('0x2a')](_0x6f8e3f);};}exports[_0xce52('0x2b')]=function(_0x43941b,_0x568a9e){var _0x317e33={},_0x458889={},_0x25e08f={'count':0x0,'rows':[]};var _0x30eb82=_[_0xce52('0x2c')](db['CannedAnswer']['rawAttributes'],function(_0x584a3a){return{'name':_0x584a3a['fieldName'],'type':_0x584a3a[_0xce52('0x2d')][_0xce52('0x2e')]};});_0x458889['model']=_['map'](_0x30eb82,_0xce52('0x29'));_0x458889[_0xce52('0x2f')]=_[_0xce52('0x30')](_0x43941b['query']);_0x458889[_0xce52('0x31')]=_[_0xce52('0x32')](_0x458889[_0xce52('0x33')],_0x458889[_0xce52('0x2f')]);_0x317e33[_0xce52('0x34')]=_['intersection'](_0x458889['model'],qs[_0xce52('0x35')](_0x43941b[_0xce52('0x2f')][_0xce52('0x35')]));_0x317e33[_0xce52('0x34')]=_0x317e33[_0xce52('0x34')][_0xce52('0x36')]?_0x317e33[_0xce52('0x34')]:_0x458889[_0xce52('0x33')];if(!_0x43941b[_0xce52('0x2f')][_0xce52('0x37')]('nolimit')){_0x317e33[_0xce52('0x1b')]=qs[_0xce52('0x1b')](_0x43941b[_0xce52('0x2f')]['limit']);_0x317e33[_0xce52('0x19')]=qs[_0xce52('0x19')](_0x43941b[_0xce52('0x2f')]['offset']);}_0x317e33[_0xce52('0x38')]=qs[_0xce52('0x39')](_0x43941b[_0xce52('0x2f')][_0xce52('0x39')]);_0x317e33['where']=qs[_0xce52('0x31')](_[_0xce52('0x3a')](_0x43941b[_0xce52('0x2f')],_0x458889[_0xce52('0x31')]),_0x30eb82);if(_0x43941b[_0xce52('0x2f')][_0xce52('0x3b')]){_0x317e33[_0xce52('0x3c')]=_['merge'](_0x317e33['where'],{'$or':[{'key':{'$like':'%'+_0x43941b[_0xce52('0x2f')][_0xce52('0x3b')]+'%'}},{'value':{'$like':'%'+_0x43941b[_0xce52('0x2f')][_0xce52('0x3b')]+'%'}}]});}_0x317e33=_['merge']({},_0x317e33,_0x43941b[_0xce52('0x3d')]);var _0x18821e={'where':_0x317e33[_0xce52('0x3c')]};return db[_0xce52('0x3e')][_0xce52('0x1c')](_0x18821e)[_0xce52('0x21')](function(_0x1e833d){_0x25e08f['count']=_0x1e833d;if(_0x43941b['query'][_0xce52('0x3f')]){_0x317e33[_0xce52('0x40')]=[{'all':!![]}];}return db[_0xce52('0x3e')]['findAll'](_0x317e33);})[_0xce52('0x21')](function(_0x1097c7){_0x25e08f[_0xce52('0x41')]=_0x1097c7;return _0x25e08f;})[_0xce52('0x21')](respondWithFilteredResult(_0x568a9e,_0x317e33))[_0xce52('0x42')](handleError(_0x568a9e,null));};exports[_0xce52('0x43')]=function(_0x2db2c1,_0x1f8f09){var _0x5f87d4={'raw':!![],'where':{'id':_0x2db2c1['params']['id']}},_0x32b157={};_0x32b157[_0xce52('0x33')]=_[_0xce52('0x30')](db['CannedAnswer']['rawAttributes']);_0x32b157[_0xce52('0x2f')]=_['keys'](_0x2db2c1[_0xce52('0x2f')]);_0x32b157[_0xce52('0x31')]=_['intersection'](_0x32b157['model'],_0x32b157[_0xce52('0x2f')]);_0x5f87d4[_0xce52('0x34')]=_[_0xce52('0x32')](_0x32b157['model'],qs['fields'](_0x2db2c1[_0xce52('0x2f')][_0xce52('0x35')]));_0x5f87d4[_0xce52('0x34')]=_0x5f87d4[_0xce52('0x34')][_0xce52('0x36')]?_0x5f87d4[_0xce52('0x34')]:_0x32b157['model'];if(_0x2db2c1[_0xce52('0x2f')][_0xce52('0x3f')]){_0x5f87d4['include']=[{'all':!![]}];}_0x5f87d4=_[_0xce52('0x44')]({},_0x5f87d4,_0x2db2c1[_0xce52('0x3d')]);return db[_0xce52('0x3e')][_0xce52('0x45')](_0x5f87d4)[_0xce52('0x21')](handleEntityNotFound(_0x1f8f09,null))['then'](respondWithResult(_0x1f8f09,null))[_0xce52('0x42')](handleError(_0x1f8f09,null));};exports[_0xce52('0x46')]=function(_0x324ce8,_0x2c9d5f){if(_0x324ce8['body']['id']){delete _0x324ce8[_0xce52('0x47')]['id'];}return db[_0xce52('0x3e')][_0xce52('0x45')]({'where':{'id':_0x324ce8[_0xce52('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c9d5f,null))['then'](saveUpdates(_0x324ce8[_0xce52('0x47')],null))[_0xce52('0x21')](respondWithResult(_0x2c9d5f,null))[_0xce52('0x42')](handleError(_0x2c9d5f,null));};exports[_0xce52('0x22')]=function(_0x28a172,_0x262f5a){return db[_0xce52('0x3e')][_0xce52('0x45')]({'where':{'id':_0x28a172[_0xce52('0x48')]['id']}})['then'](handleEntityNotFound(_0x262f5a,null))[_0xce52('0x21')](removeEntity(_0x262f5a,null))['catch'](handleError(_0x262f5a,null));};exports[_0xce52('0x49')]=function(_0x2a48fe,_0x428abb){var _0x2153a7={'key':_0x2a48fe[_0xce52('0x47')][_0xce52('0x2e')]};if(_0x2a48fe['body']['MailAccountId']){_0x2153a7[_0xce52('0x4a')]=_0x2a48fe['body']['MailAccountId'];}else if(_0x2a48fe[_0xce52('0x47')][_0xce52('0x4b')]){_0x2153a7['SmsAccountId']=_0x2a48fe[_0xce52('0x47')][_0xce52('0x4b')];}else if(_0x2a48fe['body'][_0xce52('0x4c')]){_0x2153a7['OpenchannelAccountId']=_0x2a48fe[_0xce52('0x47')][_0xce52('0x4c')];}else if(_0x2a48fe[_0xce52('0x47')][_0xce52('0x4d')]){_0x2153a7[_0xce52('0x4d')]=_0x2a48fe[_0xce52('0x47')]['ChatWebsiteId'];}return db['CannedAnswer'][_0xce52('0x45')]({'where':_0x2153a7})[_0xce52('0x21')](function(_0x5d4f61){if(_0x5d4f61){throw new db[(_0xce52('0x4e'))][(_0xce52('0x4f'))](_0xce52('0x50'));}return db[_0xce52('0x3e')]['create'](_0x2a48fe[_0xce52('0x47')]);})[_0xce52('0x21')](function(_0x3f0a0b){var _0x34e23d=_0x2a48fe[_0xce52('0x51')][_0xce52('0x23')]({'plain':!![]});if(!_0x34e23d)throw new Error(_0xce52('0x52'));if(_0x34e23d[_0xce52('0x53')]==='user'){var _0x4b76d1=_0x3f0a0b['get']({'plain':!![]});return db[_0xce52('0x54')]['find']({'where':{'name':_0xce52('0x24'),'userProfileId':_0x34e23d[_0xce52('0x55')]},'raw':!![]})[_0xce52('0x21')](function(_0x1c2799){if(_0x1c2799&&_0x1c2799['autoAssociation']===0x0){return db['UserProfileResource'][_0xce52('0x49')]({'name':_0x4b76d1[_0xce52('0x29')],'resourceId':_0x4b76d1['id'],'type':_0x1c2799[_0xce52('0x29')],'sectionId':_0x1c2799['id']},{})[_0xce52('0x21')](function(){return _0x3f0a0b;});}else{return _0x3f0a0b;}})[_0xce52('0x42')](function(_0x498c81){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x498c81);throw _0x498c81;});}return _0x3f0a0b;})[_0xce52('0x21')](respondWithResult(_0x428abb,0xc9))[_0xce52('0x42')](handleError(_0x428abb,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index bae50af..4c49d7a 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 _0x3ef0=['utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','tools_canned_answers'];(function(_0x267a92,_0x144bb1){var _0x41c589=function(_0x4ceae2){while(--_0x4ceae2){_0x267a92['push'](_0x267a92['shift']());}};_0x41c589(++_0x144bb1);}(_0x3ef0,0x141));var _0x03ef=function(_0x4a73ce,_0xa7c114){_0x4a73ce=_0x4a73ce-0x0;var _0x142f7c=_0x3ef0[_0x4a73ce];return _0x142f7c;};'use strict';var _=require(_0x03ef('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x03ef('0x1'));var BPromise=require(_0x03ef('0x2'));var rp=require(_0x03ef('0x3'));var fs=require('fs');var path=require(_0x03ef('0x4'));var rimraf=require(_0x03ef('0x5'));var config=require(_0x03ef('0x6'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x4b2a0d,_0x8158b5){return _0x4b2a0d[_0x03ef('0x7')]('CannedAnswer',attributes,{'tableName':_0x03ef('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x03ef('0x9')});};
\ No newline at end of file
+var _0x4552=['bluebird','path','rimraf','../../config/environment','exports','define','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0xc85fbd,_0x21d671){var _0x64f2d9=function(_0x4eb22d){while(--_0x4eb22d){_0xc85fbd['push'](_0xc85fbd['shift']());}};_0x64f2d9(++_0x21d671);}(_0x4552,0x1eb));var _0x2455=function(_0x9163f3,_0x3952eb){_0x9163f3=_0x9163f3-0x0;var _0x1b3790=_0x4552[_0x9163f3];return _0x1b3790;};'use strict';var _=require(_0x2455('0x0'));var util=require(_0x2455('0x1'));var logger=require(_0x2455('0x2'))('api');var moment=require(_0x2455('0x3'));var BPromise=require(_0x2455('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2455('0x5'));var rimraf=require(_0x2455('0x6'));var config=require(_0x2455('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x2455('0x8')]=function(_0x436101,_0x2d6b84){return _0x436101[_0x2455('0x9')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2455('0xa')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index d6babb7..8bb8153 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(_0x290b2a,_0x5170e8){var _0x105734=function(_0xd7dbd5){while(--_0xd7dbd5){_0x290b2a['push'](_0x290b2a['shift']());}};_0x105734(++_0x5170e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x24e637,_0x2c67d5){var _0x145d36=function(_0x3c5c69){while(--_0x3c5c69){_0x24e637['push'](_0x24e637['shift']());}};_0x145d36(++_0x2c67d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 3a8ff66..d602ca5 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 _0xe772=['index','/:id','post','create','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe772,0x185));var _0x2e77=function(_0x3124f8,_0x1a8b23){_0x3124f8=_0x3124f8-0x0;var _0x5bab5f=_0xe772[_0x3124f8];return _0x5bab5f;};'use strict';var multer=require(_0x2e77('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2e77('0x1'));var router=express[_0x2e77('0x2')]();var fs_extra=require(_0x2e77('0x3'));var auth=require(_0x2e77('0x4'));var interaction=require(_0x2e77('0x5'));var config=require(_0x2e77('0x6'));var controller=require(_0x2e77('0x7'));router[_0x2e77('0x8')]('/',auth[_0x2e77('0x9')](),controller[_0x2e77('0xa')]);router['get'](_0x2e77('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x2e77('0xc')]('/',auth[_0x2e77('0x9')](),controller[_0x2e77('0xd')]);router[_0x2e77('0xe')]('/:id',auth[_0x2e77('0x9')](),controller[_0x2e77('0xf')]);router[_0x2e77('0x10')]('/:id',auth[_0x2e77('0x9')](),controller[_0x2e77('0x11')]);module[_0x2e77('0x12')]=router;
\ No newline at end of file
+var _0x2773=['post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show'];(function(_0x20723b,_0x48e22e){var _0x103d08=function(_0x7b211e){while(--_0x7b211e){_0x20723b['push'](_0x20723b['shift']());}};_0x103d08(++_0x48e22e);}(_0x2773,0x65));var _0x3277=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2773[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x3277('0x0'));var util=require(_0x3277('0x1'));var path=require(_0x3277('0x2'));var timeout=require('connect-timeout');var express=require(_0x3277('0x3'));var router=express[_0x3277('0x4')]();var fs_extra=require(_0x3277('0x5'));var auth=require(_0x3277('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3277('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x3277('0x8')](),controller[_0x3277('0x9')]);router[_0x3277('0xa')](_0x3277('0xb'),auth[_0x3277('0x8')](),controller[_0x3277('0xc')]);router[_0x3277('0xd')]('/',auth[_0x3277('0x8')](),controller[_0x3277('0xe')]);router[_0x3277('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3277('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3277('0x11')]);module[_0x3277('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index b875aca..08e6e22 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 _0xc2d0=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x4cee82,_0x208e67){var _0x200c1d=function(_0x372584){while(--_0x372584){_0x4cee82['push'](_0x4cee82['shift']());}};_0x200c1d(++_0x208e67);}(_0xc2d0,0x9f));var _0x0c2d=function(_0x53c506,_0x1c0fe8){_0x53c506=_0x53c506-0x0;var _0x165888=_0xc2d0[_0x53c506];return _0x165888;};'use strict';var Sequelize=require(_0x0c2d('0x0'));module[_0x0c2d('0x1')]={'calldate':{'type':Sequelize[_0x0c2d('0x2')],'allowNull':![],'defaultValue':_0x0c2d('0x3')},'clid':{'type':Sequelize[_0x0c2d('0x4')]},'src':{'type':Sequelize[_0x0c2d('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x0c2d('0x4')]},'lastapp':{'type':Sequelize[_0x0c2d('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0c2d('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0c2d('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0c2d('0x4')]},'amaflags':{'type':Sequelize[_0x0c2d('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0c2d('0x4')]},'userfield':{'type':Sequelize[_0x0c2d('0x4')]},'uniqueid':{'type':Sequelize[_0x0c2d('0x4')]},'linkedid':{'type':Sequelize[_0x0c2d('0x4')]},'sequence':{'type':Sequelize[_0x0c2d('0x4')]},'peeraccount':{'type':Sequelize[_0x0c2d('0x4')]},'type':{'type':Sequelize[_0x0c2d('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb910=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb910,0x12b));var _0x0b91=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xb910[_0x46d0c9];return _0x174506;};'use strict';var Sequelize=require(_0x0b91('0x0'));module[_0x0b91('0x1')]={'calldate':{'type':Sequelize[_0x0b91('0x2')],'allowNull':![],'defaultValue':_0x0b91('0x3')},'clid':{'type':Sequelize[_0x0b91('0x4')]},'src':{'type':Sequelize[_0x0b91('0x4')]},'dst':{'type':Sequelize[_0x0b91('0x4')]},'dcontext':{'type':Sequelize[_0x0b91('0x4')]},'channel':{'type':Sequelize[_0x0b91('0x4')]},'dstchannel':{'type':Sequelize[_0x0b91('0x4')]},'lastapp':{'type':Sequelize[_0x0b91('0x4')]},'lastdata':{'type':Sequelize[_0x0b91('0x4')]},'duration':{'type':Sequelize[_0x0b91('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0b91('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x0b91('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0b91('0x4')]},'userfield':{'type':Sequelize[_0x0b91('0x4')]},'uniqueid':{'type':Sequelize[_0x0b91('0x4')]},'linkedid':{'type':Sequelize[_0x0b91('0x4')]},'sequence':{'type':Sequelize[_0x0b91('0x4')]},'peeraccount':{'type':Sequelize[_0x0b91('0x4')]},'type':{'type':Sequelize[_0x0b91('0x4')]},'tag':{'type':Sequelize[_0x0b91('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index bb626b8..44aa8ac 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 _0x723e=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','sendStatus','error','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Cdr','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch'];(function(_0x5ddfc7,_0x3103bd){var _0x4cf397=function(_0x3a7ac3){while(--_0x3a7ac3){_0x5ddfc7['push'](_0x5ddfc7['shift']());}};_0x4cf397(++_0x3103bd);}(_0x723e,0x179));var _0xe723=function(_0x270913,_0xb25fb4){_0x270913=_0x270913-0x0;var _0x1e1dba=_0x723e[_0x270913];return _0x1e1dba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe723('0x0'));var zipdir=require(_0xe723('0x1'));var jsonpatch=require(_0xe723('0x2'));var rp=require(_0xe723('0x3'));var moment=require(_0xe723('0x4'));var BPromise=require(_0xe723('0x5'));var Mustache=require(_0xe723('0x6'));var util=require(_0xe723('0x7'));var path=require(_0xe723('0x8'));var sox=require(_0xe723('0x9'));var csv=require('to-csv');var ejs=require(_0xe723('0xa'));var fs=require('fs');var fs_extra=require(_0xe723('0xb'));var _=require(_0xe723('0xc'));var squel=require(_0xe723('0xd'));var crypto=require(_0xe723('0xe'));var jsforce=require(_0xe723('0xf'));var deskjs=require(_0xe723('0x10'));var toCsv=require(_0xe723('0x11'));var querystring=require('querystring');var Papa=require(_0xe723('0x12'));var Redis=require(_0xe723('0x13'));var authService=require(_0xe723('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe723('0x15'));var hardwareService=require(_0xe723('0x16'));var logger=require(_0xe723('0x17'))('api');var utils=require(_0xe723('0x18'));var config=require(_0xe723('0x19'));var licenseUtil=require(_0xe723('0x1a'));var db=require(_0xe723('0x1b'))['db'];function respondWithStatusCode(_0x236b69,_0x5c066c){_0x5c066c=_0x5c066c||0xcc;return function(_0x29a1e){if(_0x29a1e){return _0x236b69['sendStatus'](_0x5c066c);}return _0x236b69['status'](_0x5c066c)['end']();};}function respondWithResult(_0x57bc0e,_0x75c12c){_0x75c12c=_0x75c12c||0xc8;return function(_0x30b2ba){if(_0x30b2ba){return _0x57bc0e[_0xe723('0x1c')](_0x75c12c)[_0xe723('0x1d')](_0x30b2ba);}};}function respondWithFilteredResult(_0xf29a39,_0x5aec97){return function(_0x23d0b2){if(_0x23d0b2){var _0xbf5ca3=typeof _0x5aec97[_0xe723('0x1e')]===_0xe723('0x1f')&&typeof _0x5aec97[_0xe723('0x20')]===_0xe723('0x1f');var _0x2cd7ca=_0x23d0b2[_0xe723('0x21')];var _0x17e2c1=_0xbf5ca3?0x0:_0x5aec97[_0xe723('0x1e')];var _0x2057d7=_0xbf5ca3?_0x23d0b2[_0xe723('0x21')]:_0x5aec97[_0xe723('0x1e')]+_0x5aec97[_0xe723('0x20')];var _0x5e8a90;if(_0x2057d7>=_0x2cd7ca){_0x2057d7=_0x2cd7ca;_0x5e8a90=0xc8;}else{_0x5e8a90=0xce;}_0xf29a39['status'](_0x5e8a90);return _0xf29a39[_0xe723('0x22')](_0xe723('0x23'),_0x17e2c1+'-'+_0x2057d7+'/'+_0x2cd7ca)['json'](_0x23d0b2);}return null;};}function patchUpdates(_0x28caca){return function(_0x2762e2){try{jsonpatch['apply'](_0x2762e2,_0x28caca,!![]);}catch(_0x472502){return BPromise['reject'](_0x472502);}return _0x2762e2[_0xe723('0x24')]();};}function saveUpdates(_0x43ccfc,_0x3b82b2){return function(_0x1fe43d){if(_0x1fe43d){return _0x1fe43d[_0xe723('0x25')](_0x43ccfc)[_0xe723('0x26')](function(_0x25f7d2){return _0x25f7d2;});}return null;};}function removeEntity(_0x15196c,_0x1228f2){return function(_0x19bd0c){if(_0x19bd0c){return _0x19bd0c[_0xe723('0x27')]()[_0xe723('0x26')](function(){_0x15196c['status'](0xcc)[_0xe723('0x28')]();});}};}function handleEntityNotFound(_0x59f095,_0xa258f3){return function(_0x3ffa15){if(!_0x3ffa15){_0x59f095[_0xe723('0x29')](0x194);}return _0x3ffa15;};}function handleError(_0xe7e271,_0x1f81ec){_0x1f81ec=_0x1f81ec||0x1f4;return function(_0x598f15){logger[_0xe723('0x2a')](_0x598f15['stack']);if(_0x598f15['name']){delete _0x598f15[_0xe723('0x2b')];}_0xe7e271['status'](_0x1f81ec)[_0xe723('0x2c')](_0x598f15);};}exports[_0xe723('0x2d')]=function(_0x335c66,_0x4d55cc){var _0x1edbb2={},_0x45e162={},_0x48a97a={'count':0x0,'rows':[]};var _0x3c8c56=_['map'](db['Cdr'][_0xe723('0x2e')],function(_0x2c2240){return{'name':_0x2c2240[_0xe723('0x2f')],'type':_0x2c2240[_0xe723('0x30')]['key']};});_0x45e162['model']=_[_0xe723('0x31')](_0x3c8c56,'name');_0x45e162[_0xe723('0x32')]=_[_0xe723('0x33')](_0x335c66[_0xe723('0x32')]);_0x45e162[_0xe723('0x34')]=_[_0xe723('0x35')](_0x45e162[_0xe723('0x36')],_0x45e162[_0xe723('0x32')]);_0x1edbb2[_0xe723('0x37')]=_[_0xe723('0x35')](_0x45e162[_0xe723('0x36')],qs[_0xe723('0x38')](_0x335c66[_0xe723('0x32')][_0xe723('0x38')]));_0x1edbb2[_0xe723('0x37')]=_0x1edbb2['attributes'][_0xe723('0x39')]?_0x1edbb2['attributes']:_0x45e162[_0xe723('0x36')];if(!_0x335c66[_0xe723('0x32')]['hasOwnProperty']('nolimit')){_0x1edbb2[_0xe723('0x20')]=qs[_0xe723('0x20')](_0x335c66[_0xe723('0x32')][_0xe723('0x20')]);_0x1edbb2[_0xe723('0x1e')]=qs[_0xe723('0x1e')](_0x335c66['query'][_0xe723('0x1e')]);}_0x1edbb2[_0xe723('0x3a')]=qs[_0xe723('0x3b')](_0x335c66[_0xe723('0x32')][_0xe723('0x3b')]);_0x1edbb2[_0xe723('0x3c')]=qs[_0xe723('0x34')](_[_0xe723('0x3d')](_0x335c66[_0xe723('0x32')],_0x45e162[_0xe723('0x34')]),_0x3c8c56);if(_0x335c66[_0xe723('0x32')][_0xe723('0x3e')]){_0x1edbb2[_0xe723('0x3c')]=_[_0xe723('0x3f')](_0x1edbb2[_0xe723('0x3c')],{'$or':_[_0xe723('0x31')](_0x3c8c56,function(_0x5c5027){if(_0x5c5027[_0xe723('0x30')]!==_0xe723('0x40')){var _0x68eda5={};_0x68eda5[_0x5c5027[_0xe723('0x2b')]]={'$like':'%'+_0x335c66['query']['filter']+'%'};return _0x68eda5;}})});}_0x1edbb2=_[_0xe723('0x3f')]({},_0x1edbb2,_0x335c66[_0xe723('0x41')]);var _0xc0c2c7={'where':_0x1edbb2[_0xe723('0x3c')]};return db['Cdr']['count'](_0xc0c2c7)[_0xe723('0x26')](function(_0x2f1618){_0x48a97a[_0xe723('0x21')]=_0x2f1618;if(_0x335c66[_0xe723('0x32')][_0xe723('0x42')]){_0x1edbb2[_0xe723('0x43')]=[{'all':!![]}];}return db[_0xe723('0x44')][_0xe723('0x45')](_0x1edbb2);})[_0xe723('0x26')](function(_0x5b0c89){_0x48a97a['rows']=_0x5b0c89;return _0x48a97a;})[_0xe723('0x26')](respondWithFilteredResult(_0x4d55cc,_0x1edbb2))['catch'](handleError(_0x4d55cc,null));};exports['show']=function(_0x18f4a1,_0x55530b){var _0x36272={'raw':!![],'where':{'id':_0x18f4a1[_0xe723('0x46')]['id']}},_0x42bd2f={};_0x42bd2f[_0xe723('0x36')]=_[_0xe723('0x33')](db[_0xe723('0x44')][_0xe723('0x2e')]);_0x42bd2f['query']=_['keys'](_0x18f4a1[_0xe723('0x32')]);_0x42bd2f['filters']=_[_0xe723('0x35')](_0x42bd2f['model'],_0x42bd2f[_0xe723('0x32')]);_0x36272[_0xe723('0x37')]=_[_0xe723('0x35')](_0x42bd2f[_0xe723('0x36')],qs[_0xe723('0x38')](_0x18f4a1[_0xe723('0x32')][_0xe723('0x38')]));_0x36272[_0xe723('0x37')]=_0x36272[_0xe723('0x37')]['length']?_0x36272['attributes']:_0x42bd2f[_0xe723('0x36')];if(_0x18f4a1[_0xe723('0x32')][_0xe723('0x42')]){_0x36272['include']=[{'all':!![]}];}_0x36272=_['merge']({},_0x36272,_0x18f4a1['options']);return db[_0xe723('0x44')][_0xe723('0x47')](_0x36272)[_0xe723('0x26')](handleEntityNotFound(_0x55530b,null))['then'](respondWithResult(_0x55530b,null))[_0xe723('0x48')](handleError(_0x55530b,null));};exports[_0xe723('0x49')]=function(_0x1cb2b2,_0x38bd1a){return db[_0xe723('0x44')]['create'](_0x1cb2b2[_0xe723('0x4a')],{})['then'](respondWithResult(_0x38bd1a,0xc9))[_0xe723('0x48')](handleError(_0x38bd1a,null));};exports['update']=function(_0x52f42e,_0x1590fe){if(_0x52f42e[_0xe723('0x4a')]['id']){delete _0x52f42e[_0xe723('0x4a')]['id'];}return db['Cdr'][_0xe723('0x47')]({'where':{'id':_0x52f42e['params']['id']}})[_0xe723('0x26')](handleEntityNotFound(_0x1590fe,null))[_0xe723('0x26')](saveUpdates(_0x52f42e[_0xe723('0x4a')],null))[_0xe723('0x26')](respondWithResult(_0x1590fe,null))[_0xe723('0x48')](handleError(_0x1590fe,null));};exports[_0xe723('0x27')]=function(_0x41e1c4,_0x16cb50){return db[_0xe723('0x44')]['find']({'where':{'id':_0x41e1c4[_0xe723('0x46')]['id']}})[_0xe723('0x26')](handleEntityNotFound(_0x16cb50,null))['then'](removeEntity(_0x16cb50,null))[_0xe723('0x48')](handleError(_0x16cb50,null));};exports[_0xe723('0x4b')]=function(_0x56e92a,_0x126ca5){return db['Cdr']['describe']()[_0xe723('0x26')](respondWithResult(_0x126ca5,null))[_0xe723('0x48')](handleError(_0x126ca5,null));};
\ No newline at end of file
+var _0x4074=['params','rawAttributes','intersection','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','error','stack','name','index','fieldName','type','key','model','map','query','keys','attributes','fields','length','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','Cdr','then','includeAll','findAll','rows','show'];(function(_0x474206,_0x19f660){var _0xd15ae9=function(_0x314cad){while(--_0x314cad){_0x474206['push'](_0x474206['shift']());}};_0xd15ae9(++_0x19f660);}(_0x4074,0xf0));var _0x4407=function(_0x1d5b11,_0x2fd422){_0x1d5b11=_0x1d5b11-0x0;var _0x9ef9c=_0x4074[_0x1d5b11];return _0x9ef9c;};'use strict';var emlformat=require(_0x4407('0x0'));var rimraf=require(_0x4407('0x1'));var zipdir=require(_0x4407('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4407('0x3'));var moment=require(_0x4407('0x4'));var BPromise=require(_0x4407('0x5'));var Mustache=require(_0x4407('0x6'));var util=require(_0x4407('0x7'));var path=require(_0x4407('0x8'));var sox=require(_0x4407('0x9'));var csv=require(_0x4407('0xa'));var ejs=require(_0x4407('0xb'));var fs=require('fs');var fs_extra=require(_0x4407('0xc'));var _=require('lodash');var squel=require(_0x4407('0xd'));var crypto=require('crypto');var jsforce=require(_0x4407('0xe'));var deskjs=require(_0x4407('0xf'));var toCsv=require(_0x4407('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4407('0x10'));var qs=require(_0x4407('0x11'));var as=require(_0x4407('0x12'));var hardwareService=require(_0x4407('0x13'));var logger=require(_0x4407('0x14'))(_0x4407('0x15'));var utils=require(_0x4407('0x16'));var config=require(_0x4407('0x17'));var licenseUtil=require(_0x4407('0x18'));var db=require(_0x4407('0x19'))['db'];function respondWithStatusCode(_0x14f398,_0x5d0c41){_0x5d0c41=_0x5d0c41||0xcc;return function(_0x3f8f23){if(_0x3f8f23){return _0x14f398[_0x4407('0x1a')](_0x5d0c41);}return _0x14f398['status'](_0x5d0c41)[_0x4407('0x1b')]();};}function respondWithResult(_0x4c62b9,_0x1d2ec8){_0x1d2ec8=_0x1d2ec8||0xc8;return function(_0x27724a){if(_0x27724a){return _0x4c62b9[_0x4407('0x1c')](_0x1d2ec8)[_0x4407('0x1d')](_0x27724a);}};}function respondWithFilteredResult(_0x1840dd,_0x417e19){return function(_0x1c5a0c){if(_0x1c5a0c){var _0x2e709f=typeof _0x417e19['offset']===_0x4407('0x1e')&&typeof _0x417e19[_0x4407('0x1f')]===_0x4407('0x1e');var _0x367d55=_0x1c5a0c[_0x4407('0x20')];var _0x5b50b7=_0x2e709f?0x0:_0x417e19[_0x4407('0x21')];var _0x54caa1=_0x2e709f?_0x1c5a0c[_0x4407('0x20')]:_0x417e19[_0x4407('0x21')]+_0x417e19[_0x4407('0x1f')];var _0x2db8b2;if(_0x54caa1>=_0x367d55){_0x54caa1=_0x367d55;_0x2db8b2=0xc8;}else{_0x2db8b2=0xce;}_0x1840dd[_0x4407('0x1c')](_0x2db8b2);return _0x1840dd['set'](_0x4407('0x22'),_0x5b50b7+'-'+_0x54caa1+'/'+_0x367d55)['json'](_0x1c5a0c);}return null;};}function patchUpdates(_0x36a948){return function(_0x28bb2c){try{jsonpatch[_0x4407('0x23')](_0x28bb2c,_0x36a948,!![]);}catch(_0x445fe6){return BPromise['reject'](_0x445fe6);}return _0x28bb2c[_0x4407('0x24')]();};}function saveUpdates(_0x1fa9f1,_0x137f8e){return function(_0x2c880a){if(_0x2c880a){return _0x2c880a[_0x4407('0x25')](_0x1fa9f1)['then'](function(_0xa7265d){return _0xa7265d;});}return null;};}function removeEntity(_0x16272f,_0x5e214c){return function(_0x21b048){if(_0x21b048){return _0x21b048[_0x4407('0x26')]()['then'](function(){_0x16272f[_0x4407('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309274,_0x5386f4){return function(_0x40fb1e){if(!_0x40fb1e){_0x309274['sendStatus'](0x194);}return _0x40fb1e;};}function handleError(_0x374754,_0x4bf227){_0x4bf227=_0x4bf227||0x1f4;return function(_0x57ba27){logger[_0x4407('0x27')](_0x57ba27[_0x4407('0x28')]);if(_0x57ba27[_0x4407('0x29')]){delete _0x57ba27['name'];}_0x374754['status'](_0x4bf227)['send'](_0x57ba27);};}exports[_0x4407('0x2a')]=function(_0x2feb6b,_0x1f9828){var _0x84a8a={},_0x1d6b3d={},_0x37fba1={'count':0x0,'rows':[]};var _0x182bd9=_['map'](db['Cdr']['rawAttributes'],function(_0x28e99e){return{'name':_0x28e99e[_0x4407('0x2b')],'type':_0x28e99e[_0x4407('0x2c')][_0x4407('0x2d')]};});_0x1d6b3d[_0x4407('0x2e')]=_[_0x4407('0x2f')](_0x182bd9,_0x4407('0x29'));_0x1d6b3d[_0x4407('0x30')]=_[_0x4407('0x31')](_0x2feb6b[_0x4407('0x30')]);_0x1d6b3d['filters']=_['intersection'](_0x1d6b3d[_0x4407('0x2e')],_0x1d6b3d[_0x4407('0x30')]);_0x84a8a[_0x4407('0x32')]=_['intersection'](_0x1d6b3d[_0x4407('0x2e')],qs[_0x4407('0x33')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x33')]));_0x84a8a[_0x4407('0x32')]=_0x84a8a['attributes'][_0x4407('0x34')]?_0x84a8a['attributes']:_0x1d6b3d[_0x4407('0x2e')];if(!_0x2feb6b['query']['hasOwnProperty'](_0x4407('0x35'))){_0x84a8a[_0x4407('0x1f')]=qs[_0x4407('0x1f')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x1f')]);_0x84a8a[_0x4407('0x21')]=qs[_0x4407('0x21')](_0x2feb6b['query'][_0x4407('0x21')]);}_0x84a8a[_0x4407('0x36')]=qs[_0x4407('0x37')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x37')]);_0x84a8a['where']=qs[_0x4407('0x38')](_['pick'](_0x2feb6b[_0x4407('0x30')],_0x1d6b3d[_0x4407('0x38')]),_0x182bd9);if(_0x2feb6b[_0x4407('0x30')][_0x4407('0x39')]){_0x84a8a['where']=_[_0x4407('0x3a')](_0x84a8a[_0x4407('0x3b')],{'$or':_[_0x4407('0x2f')](_0x182bd9,function(_0x1bf4e2){if(_0x1bf4e2[_0x4407('0x2c')]!==_0x4407('0x3c')){var _0x30de66={};_0x30de66[_0x1bf4e2[_0x4407('0x29')]]={'$like':'%'+_0x2feb6b[_0x4407('0x30')]['filter']+'%'};return _0x30de66;}})});}_0x84a8a=_['merge']({},_0x84a8a,_0x2feb6b[_0x4407('0x3d')]);var _0xc47d0e={'where':_0x84a8a[_0x4407('0x3b')]};return db[_0x4407('0x3e')]['count'](_0xc47d0e)[_0x4407('0x3f')](function(_0x2cb65e){_0x37fba1[_0x4407('0x20')]=_0x2cb65e;if(_0x2feb6b['query'][_0x4407('0x40')]){_0x84a8a['include']=[{'all':!![]}];}return db['Cdr'][_0x4407('0x41')](_0x84a8a);})[_0x4407('0x3f')](function(_0x234fa5){_0x37fba1[_0x4407('0x42')]=_0x234fa5;return _0x37fba1;})[_0x4407('0x3f')](respondWithFilteredResult(_0x1f9828,_0x84a8a))['catch'](handleError(_0x1f9828,null));};exports[_0x4407('0x43')]=function(_0xf79768,_0x819b8b){var _0x15ba7b={'raw':!![],'where':{'id':_0xf79768[_0x4407('0x44')]['id']}},_0x5b41cf={};_0x5b41cf[_0x4407('0x2e')]=_[_0x4407('0x31')](db[_0x4407('0x3e')][_0x4407('0x45')]);_0x5b41cf['query']=_[_0x4407('0x31')](_0xf79768['query']);_0x5b41cf['filters']=_[_0x4407('0x46')](_0x5b41cf[_0x4407('0x2e')],_0x5b41cf['query']);_0x15ba7b[_0x4407('0x32')]=_[_0x4407('0x46')](_0x5b41cf[_0x4407('0x2e')],qs[_0x4407('0x33')](_0xf79768['query'][_0x4407('0x33')]));_0x15ba7b[_0x4407('0x32')]=_0x15ba7b[_0x4407('0x32')][_0x4407('0x34')]?_0x15ba7b[_0x4407('0x32')]:_0x5b41cf['model'];if(_0xf79768[_0x4407('0x30')][_0x4407('0x40')]){_0x15ba7b[_0x4407('0x47')]=[{'all':!![]}];}_0x15ba7b=_[_0x4407('0x3a')]({},_0x15ba7b,_0xf79768[_0x4407('0x3d')]);return db['Cdr'][_0x4407('0x48')](_0x15ba7b)[_0x4407('0x3f')](handleEntityNotFound(_0x819b8b,null))[_0x4407('0x3f')](respondWithResult(_0x819b8b,null))[_0x4407('0x49')](handleError(_0x819b8b,null));};exports['create']=function(_0x18ff16,_0x2b18b8){return db['Cdr'][_0x4407('0x4a')](_0x18ff16[_0x4407('0x4b')],{})['then'](respondWithResult(_0x2b18b8,0xc9))[_0x4407('0x49')](handleError(_0x2b18b8,null));};exports[_0x4407('0x25')]=function(_0x5ea36,_0x4fbc1f){if(_0x5ea36[_0x4407('0x4b')]['id']){delete _0x5ea36['body']['id'];}return db['Cdr'][_0x4407('0x48')]({'where':{'id':_0x5ea36[_0x4407('0x44')]['id']}})['then'](handleEntityNotFound(_0x4fbc1f,null))[_0x4407('0x3f')](saveUpdates(_0x5ea36[_0x4407('0x4b')],null))[_0x4407('0x3f')](respondWithResult(_0x4fbc1f,null))[_0x4407('0x49')](handleError(_0x4fbc1f,null));};exports[_0x4407('0x26')]=function(_0x5a2c2b,_0x39865e){return db[_0x4407('0x3e')][_0x4407('0x48')]({'where':{'id':_0x5a2c2b[_0x4407('0x44')]['id']}})[_0x4407('0x3f')](handleEntityNotFound(_0x39865e,null))[_0x4407('0x3f')](removeEntity(_0x39865e,null))[_0x4407('0x49')](handleError(_0x39865e,null));};exports[_0x4407('0x4c')]=function(_0xd1dd66,_0x55f0ef){return db[_0x4407('0x3e')]['describe']()[_0x4407('0x3f')](respondWithResult(_0x55f0ef,null))[_0x4407('0x49')](handleError(_0x55f0ef,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 4af4241..b19fc1f 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(_0x5ba705,_0x4d0557){var _0x4d7501=function(_0x29c5c7){while(--_0x29c5c7){_0x5ba705['push'](_0x5ba705['shift']());}};_0x4d7501(++_0x4d0557);}(_0x7a54,0x106));var _0x47a5=function(_0x440976,_0x46064c){_0x440976=_0x440976-0x0;var _0x2e4117=_0x7a54[_0x440976];return _0x2e4117;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x407313,_0x2f01e8){var _0x1c2d7c=function(_0x208c7f){while(--_0x208c7f){_0x407313['push'](_0x407313['shift']());}};_0x1c2d7c(++_0x2f01e8);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 12d2a0b..d377d9c 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 _0x61de=['Cdr,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3929c4,_0x36f17c){var _0x473ff9=function(_0x63d4da){while(--_0x63d4da){_0x3929c4['push'](_0x3929c4['shift']());}};_0x473ff9(++_0x36f17c);}(_0x61de,0x1e8));var _0xe61d=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x61de[_0xe66cf2];return _0x2d84e7;};'use strict';var _=require(_0xe61d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe61d('0x1'));var rs=require(_0xe61d('0x2'));var fs=require('fs');var Redis=require(_0xe61d('0x3'));var db=require(_0xe61d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe61d('0x5'))(_0xe61d('0x6'));var config=require(_0xe61d('0x7'));var jayson=require(_0xe61d('0x8'));var client=jayson[_0xe61d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e8b71,_0x544313,_0x338f96){return new BPromise(function(_0x304ff7,_0x57f0b){return client[_0xe61d('0xa')](_0x1e8b71,_0x338f96)[_0xe61d('0xb')](function(_0x6729cb){logger[_0xe61d('0xc')](_0xe61d('0xd'),_0x544313,_0xe61d('0xe'));logger[_0xe61d('0xf')](_0xe61d('0x10'),_0x544313,_0xe61d('0xe'),JSON['stringify'](_0x6729cb));if(_0x6729cb[_0xe61d('0x11')]){if(_0x6729cb[_0xe61d('0x11')]['code']===0x1f4){logger[_0xe61d('0x11')](_0xe61d('0xd'),_0x544313,_0x6729cb[_0xe61d('0x11')][_0xe61d('0x12')]);return _0x57f0b(_0x6729cb[_0xe61d('0x11')][_0xe61d('0x12')]);}logger['error'](_0xe61d('0xd'),_0x544313,_0x6729cb[_0xe61d('0x11')][_0xe61d('0x12')]);return _0x304ff7(_0x6729cb[_0xe61d('0x11')][_0xe61d('0x12')]);}else{logger[_0xe61d('0xc')](_0xe61d('0xd'),_0x544313,_0xe61d('0xe'));_0x304ff7(_0x6729cb[_0xe61d('0x13')][_0xe61d('0x12')]);}})[_0xe61d('0x14')](function(_0x419d5c){logger['error'](_0xe61d('0xd'),_0x544313,_0x419d5c);_0x57f0b(_0x419d5c);});});}
\ No newline at end of file
+var _0x7548=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','bluebird','randomstring'];(function(_0x2899b6,_0x3bce12){var _0x46fb7e=function(_0x28e8a3){while(--_0x28e8a3){_0x2899b6['push'](_0x2899b6['shift']());}};_0x46fb7e(++_0x3bce12);}(_0x7548,0x137));var _0x8754=function(_0x2e5f73,_0x43fa11){_0x2e5f73=_0x2e5f73-0x0;var _0x2daba0=_0x7548[_0x2e5f73];return _0x2daba0;};'use strict';var _=require(_0x8754('0x0'));var util=require(_0x8754('0x1'));var moment=require('moment');var BPromise=require(_0x8754('0x2'));var rs=require(_0x8754('0x3'));var fs=require('fs');var Redis=require(_0x8754('0x4'));var db=require(_0x8754('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8754('0x6'));var config=require(_0x8754('0x7'));var jayson=require(_0x8754('0x8'));var client=jayson[_0x8754('0x9')][_0x8754('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b7223,_0x348926,_0x2c29ef){return new BPromise(function(_0x112d7d,_0x3d1ceb){return client[_0x8754('0xb')](_0x1b7223,_0x2c29ef)[_0x8754('0xc')](function(_0x409649){logger[_0x8754('0xd')](_0x8754('0xe'),_0x348926,_0x8754('0xf'));logger[_0x8754('0x10')](_0x8754('0x11'),_0x348926,_0x8754('0xf'),JSON[_0x8754('0x12')](_0x409649));if(_0x409649[_0x8754('0x13')]){if(_0x409649[_0x8754('0x13')]['code']===0x1f4){logger[_0x8754('0x13')]('Cdr,\x20%s,\x20%s',_0x348926,_0x409649[_0x8754('0x13')]['message']);return _0x3d1ceb(_0x409649['error'][_0x8754('0x14')]);}logger[_0x8754('0x13')](_0x8754('0xe'),_0x348926,_0x409649['error']['message']);return _0x112d7d(_0x409649[_0x8754('0x13')][_0x8754('0x14')]);}else{logger[_0x8754('0xd')](_0x8754('0xe'),_0x348926,_0x8754('0xf'));_0x112d7d(_0x409649['result'][_0x8754('0x14')]);}})['catch'](function(_0x4f634e){logger[_0x8754('0x13')]('Cdr,\x20%s,\x20%s',_0x348926,_0x4f634e);_0x3d1ceb(_0x4f634e);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index b7d45e7..059e3ef 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x45937f,_0x256a25){var _0x5bf5d1=function(_0x4300bd){while(--_0x4300bd){_0x45937f['push'](_0x45937f['shift']());}};_0x5bf5d1(++_0x256a25);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+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(_0x295811,_0x2825f4){var _0x147146=function(_0x939636){while(--_0x939636){_0x295811['push'](_0x295811['shift']());}};_0x147146(++_0x2825f4);}(_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 20097ea..6effafd 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 _0x4c4f=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x1bc66e,_0x21ade8){var _0x409dd5=function(_0x197d69){while(--_0x197d69){_0x1bc66e['push'](_0x1bc66e['shift']());}};_0x409dd5(++_0x21ade8);}(_0x4c4f,0x1e9));var _0xf4c4=function(_0x2b38d0,_0x425d79){_0x2b38d0=_0x2b38d0-0x0;var _0xcc9c29=_0x4c4f[_0x2b38d0];return _0xcc9c29;};'use strict';var Sequelize=require(_0xf4c4('0x0'));module[_0xf4c4('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf4c4('0x2')],'allowNull':![],'defaultValue':_0xf4c4('0x3')},'appdata':{'type':Sequelize[_0xf4c4('0x4')]()},'description':{'type':Sequelize[_0xf4c4('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf4c4('0x5')}};
\ No newline at end of file
+var _0xc880=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xc880,0x1ee));var _0x0c88=function(_0x5ab0fa,_0x12ee6e){_0x5ab0fa=_0x5ab0fa-0x0;var _0x1db0d9=_0xc880[_0x5ab0fa];return _0x1db0d9;};'use strict';var Sequelize=require(_0x0c88('0x0'));module[_0x0c88('0x1')]={'priority':{'type':Sequelize[_0x0c88('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0c88('0x3')],'allowNull':![],'defaultValue':_0x0c88('0x4')},'appdata':{'type':Sequelize[_0x0c88('0x5')]()},'description':{'type':Sequelize[_0x0c88('0x3')]},'interval':{'type':Sequelize[_0x0c88('0x3')],'defaultValue':_0x0c88('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 5bb62ba..a8f0f4c 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 _0x3f8c=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','show','model','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','catch','body','params','destroy','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x48accc,_0x3142e9){var _0x460cc4=function(_0x4af897){while(--_0x4af897){_0x48accc['push'](_0x48accc['shift']());}};_0x460cc4(++_0x3142e9);}(_0x3f8c,0x104));var _0xc3f8=function(_0x14c72c,_0x4812da){_0x14c72c=_0x14c72c-0x0;var _0xf9dec8=_0x3f8c[_0x14c72c];return _0xf9dec8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc3f8('0x0'));var jsonpatch=require(_0xc3f8('0x1'));var rp=require(_0xc3f8('0x2'));var moment=require(_0xc3f8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3f8('0x4'));var ejs=require(_0xc3f8('0x5'));var fs=require('fs');var fs_extra=require(_0xc3f8('0x6'));var _=require(_0xc3f8('0x7'));var squel=require(_0xc3f8('0x8'));var crypto=require(_0xc3f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc3f8('0xa'));var toCsv=require(_0xc3f8('0x4'));var querystring=require(_0xc3f8('0xb'));var Papa=require(_0xc3f8('0xc'));var Redis=require(_0xc3f8('0xd'));var authService=require(_0xc3f8('0xe'));var qs=require(_0xc3f8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f8('0x10'));var logger=require(_0xc3f8('0x11'))(_0xc3f8('0x12'));var utils=require(_0xc3f8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc3f8('0x14'));var db=require(_0xc3f8('0x15'))['db'];function respondWithStatusCode(_0x256e3d,_0x155c80){_0x155c80=_0x155c80||0xcc;return function(_0x511763){if(_0x511763){return _0x256e3d[_0xc3f8('0x16')](_0x155c80);}return _0x256e3d[_0xc3f8('0x17')](_0x155c80)[_0xc3f8('0x18')]();};}function respondWithResult(_0x44632a,_0x6155e9){_0x6155e9=_0x6155e9||0xc8;return function(_0x47754c){if(_0x47754c){return _0x44632a[_0xc3f8('0x17')](_0x6155e9)[_0xc3f8('0x19')](_0x47754c);}};}function respondWithFilteredResult(_0x12b141,_0x2fd8e8){return function(_0x3cb28a){if(_0x3cb28a){var _0x2a9f64=typeof _0x2fd8e8[_0xc3f8('0x1a')]==='undefined'&&typeof _0x2fd8e8[_0xc3f8('0x1b')]==='undefined';var _0x51807b=_0x3cb28a[_0xc3f8('0x1c')];var _0x2e7c0f=_0x2a9f64?0x0:_0x2fd8e8[_0xc3f8('0x1a')];var _0xb4ab67=_0x2a9f64?_0x3cb28a['count']:_0x2fd8e8[_0xc3f8('0x1a')]+_0x2fd8e8[_0xc3f8('0x1b')];var _0x5df6f9;if(_0xb4ab67>=_0x51807b){_0xb4ab67=_0x51807b;_0x5df6f9=0xc8;}else{_0x5df6f9=0xce;}_0x12b141[_0xc3f8('0x17')](_0x5df6f9);return _0x12b141['set'](_0xc3f8('0x1d'),_0x2e7c0f+'-'+_0xb4ab67+'/'+_0x51807b)[_0xc3f8('0x19')](_0x3cb28a);}return null;};}function patchUpdates(_0x3b2e98){return function(_0x53ada5){try{jsonpatch['apply'](_0x53ada5,_0x3b2e98,!![]);}catch(_0x113cd2){return BPromise[_0xc3f8('0x1e')](_0x113cd2);}return _0x53ada5[_0xc3f8('0x1f')]();};}function saveUpdates(_0x25a4c7,_0x6522e9){return function(_0x251bf7){if(_0x251bf7){return _0x251bf7[_0xc3f8('0x20')](_0x25a4c7)[_0xc3f8('0x21')](function(_0x49aeea){return _0x49aeea;});}return null;};}function removeEntity(_0x571f92,_0x4b83f0){return function(_0x2559a4){if(_0x2559a4){return _0x2559a4['destroy']()[_0xc3f8('0x21')](function(){_0x571f92[_0xc3f8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4569c2,_0x327b2d){return function(_0x2d237e){if(!_0x2d237e){_0x4569c2[_0xc3f8('0x16')](0x194);}return _0x2d237e;};}function handleError(_0x25088f,_0x9d43b4){_0x9d43b4=_0x9d43b4||0x1f4;return function(_0xf1d460){logger[_0xc3f8('0x22')](_0xf1d460[_0xc3f8('0x23')]);if(_0xf1d460[_0xc3f8('0x24')]){delete _0xf1d460[_0xc3f8('0x24')];}_0x25088f[_0xc3f8('0x17')](_0x9d43b4)[_0xc3f8('0x25')](_0xf1d460);};}exports[_0xc3f8('0x26')]=function(_0x59e4dd,_0x58b303){var _0x2909f8={'raw':!![],'where':{'id':_0x59e4dd['params']['id']}},_0x218029={};_0x218029[_0xc3f8('0x27')]=_['keys'](db[_0xc3f8('0x28')][_0xc3f8('0x29')]);_0x218029['query']=_['keys'](_0x59e4dd[_0xc3f8('0x2a')]);_0x218029[_0xc3f8('0x2b')]=_[_0xc3f8('0x2c')](_0x218029[_0xc3f8('0x27')],_0x218029[_0xc3f8('0x2a')]);_0x2909f8[_0xc3f8('0x2d')]=_[_0xc3f8('0x2c')](_0x218029[_0xc3f8('0x27')],qs[_0xc3f8('0x2e')](_0x59e4dd[_0xc3f8('0x2a')]['fields']));_0x2909f8[_0xc3f8('0x2d')]=_0x2909f8[_0xc3f8('0x2d')][_0xc3f8('0x2f')]?_0x2909f8[_0xc3f8('0x2d')]:_0x218029[_0xc3f8('0x27')];if(_0x59e4dd['query']['includeAll']){_0x2909f8[_0xc3f8('0x30')]=[{'all':!![]}];}_0x2909f8=_[_0xc3f8('0x31')]({},_0x2909f8,_0x59e4dd[_0xc3f8('0x32')]);return db[_0xc3f8('0x28')][_0xc3f8('0x33')](_0x2909f8)['then'](handleEntityNotFound(_0x58b303,null))[_0xc3f8('0x21')](respondWithResult(_0x58b303,null))[_0xc3f8('0x34')](handleError(_0x58b303,null));};exports[_0xc3f8('0x20')]=function(_0x5a72c1,_0x213c00){if(_0x5a72c1[_0xc3f8('0x35')]['id']){delete _0x5a72c1[_0xc3f8('0x35')]['id'];}return db['ChatApplication'][_0xc3f8('0x33')]({'where':{'id':_0x5a72c1[_0xc3f8('0x36')]['id']}})['then'](handleEntityNotFound(_0x213c00,null))[_0xc3f8('0x21')](saveUpdates(_0x5a72c1[_0xc3f8('0x35')],null))[_0xc3f8('0x21')](respondWithResult(_0x213c00,null))[_0xc3f8('0x34')](handleError(_0x213c00,null));};exports[_0xc3f8('0x37')]=function(_0x1fddc7,_0x48bc0e){return db[_0xc3f8('0x28')][_0xc3f8('0x33')]({'where':{'id':_0x1fddc7[_0xc3f8('0x36')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x48bc0e,null))[_0xc3f8('0x21')](removeEntity(_0x48bc0e,null))['catch'](handleError(_0x48bc0e,null));};
\ No newline at end of file
+var _0xd3a8=['limit','count','Content-Range','json','apply','save','then','destroy','error','stack','send','show','params','model','keys','rawAttributes','query','filters','attributes','fields','length','includeAll','merge','options','ChatApplication','find','catch','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','offset'];(function(_0x3119b6,_0x4f596e){var _0x12aff0=function(_0x44e446){while(--_0x44e446){_0x3119b6['push'](_0x3119b6['shift']());}};_0x12aff0(++_0x4f596e);}(_0xd3a8,0x135));var _0x8d3a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xd3a8[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0x8d3a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d3a('0x1'));var jsonpatch=require(_0x8d3a('0x2'));var rp=require(_0x8d3a('0x3'));var moment=require(_0x8d3a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8d3a('0x5'));var util=require(_0x8d3a('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8d3a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8d3a('0x8'));var crypto=require(_0x8d3a('0x9'));var jsforce=require(_0x8d3a('0xa'));var deskjs=require(_0x8d3a('0xb'));var toCsv=require(_0x8d3a('0xc'));var querystring=require(_0x8d3a('0xd'));var Papa=require(_0x8d3a('0xe'));var Redis=require(_0x8d3a('0xf'));var authService=require(_0x8d3a('0x10'));var qs=require(_0x8d3a('0x11'));var as=require(_0x8d3a('0x12'));var hardwareService=require(_0x8d3a('0x13'));var logger=require(_0x8d3a('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8d3a('0x15'));var db=require(_0x8d3a('0x16'))['db'];function respondWithStatusCode(_0xc834ec,_0x43b1ca){_0x43b1ca=_0x43b1ca||0xcc;return function(_0x4759cd){if(_0x4759cd){return _0xc834ec[_0x8d3a('0x17')](_0x43b1ca);}return _0xc834ec['status'](_0x43b1ca)[_0x8d3a('0x18')]();};}function respondWithResult(_0xb66692,_0x5c6ed1){_0x5c6ed1=_0x5c6ed1||0xc8;return function(_0x4c11b3){if(_0x4c11b3){return _0xb66692[_0x8d3a('0x19')](_0x5c6ed1)['json'](_0x4c11b3);}};}function respondWithFilteredResult(_0x14db8,_0x4225d9){return function(_0x10f582){if(_0x10f582){var _0x4c915d=typeof _0x4225d9[_0x8d3a('0x1a')]==='undefined'&&typeof _0x4225d9[_0x8d3a('0x1b')]==='undefined';var _0x3217a2=_0x10f582[_0x8d3a('0x1c')];var _0xb24d92=_0x4c915d?0x0:_0x4225d9['offset'];var _0x499f25=_0x4c915d?_0x10f582[_0x8d3a('0x1c')]:_0x4225d9[_0x8d3a('0x1a')]+_0x4225d9[_0x8d3a('0x1b')];var _0x3478ee;if(_0x499f25>=_0x3217a2){_0x499f25=_0x3217a2;_0x3478ee=0xc8;}else{_0x3478ee=0xce;}_0x14db8[_0x8d3a('0x19')](_0x3478ee);return _0x14db8['set'](_0x8d3a('0x1d'),_0xb24d92+'-'+_0x499f25+'/'+_0x3217a2)[_0x8d3a('0x1e')](_0x10f582);}return null;};}function patchUpdates(_0x3dc3c1){return function(_0xd390c2){try{jsonpatch[_0x8d3a('0x1f')](_0xd390c2,_0x3dc3c1,!![]);}catch(_0x1b562b){return BPromise['reject'](_0x1b562b);}return _0xd390c2[_0x8d3a('0x20')]();};}function saveUpdates(_0x3ca6a9,_0x46fcf1){return function(_0x412126){if(_0x412126){return _0x412126['update'](_0x3ca6a9)[_0x8d3a('0x21')](function(_0x2187dd){return _0x2187dd;});}return null;};}function removeEntity(_0x246275,_0x53916d){return function(_0x10b997){if(_0x10b997){return _0x10b997[_0x8d3a('0x22')]()[_0x8d3a('0x21')](function(){_0x246275[_0x8d3a('0x19')](0xcc)[_0x8d3a('0x18')]();});}};}function handleEntityNotFound(_0xb9ba91,_0x3bff9e){return function(_0x4f6551){if(!_0x4f6551){_0xb9ba91[_0x8d3a('0x17')](0x194);}return _0x4f6551;};}function handleError(_0x4749d6,_0x2204a7){_0x2204a7=_0x2204a7||0x1f4;return function(_0x45451e){logger[_0x8d3a('0x23')](_0x45451e[_0x8d3a('0x24')]);if(_0x45451e['name']){delete _0x45451e['name'];}_0x4749d6[_0x8d3a('0x19')](_0x2204a7)[_0x8d3a('0x25')](_0x45451e);};}exports[_0x8d3a('0x26')]=function(_0x2ab876,_0x1c6ff6){var _0x24e990={'raw':!![],'where':{'id':_0x2ab876[_0x8d3a('0x27')]['id']}},_0x497328={};_0x497328[_0x8d3a('0x28')]=_[_0x8d3a('0x29')](db['ChatApplication'][_0x8d3a('0x2a')]);_0x497328[_0x8d3a('0x2b')]=_[_0x8d3a('0x29')](_0x2ab876['query']);_0x497328[_0x8d3a('0x2c')]=_['intersection'](_0x497328[_0x8d3a('0x28')],_0x497328[_0x8d3a('0x2b')]);_0x24e990[_0x8d3a('0x2d')]=_['intersection'](_0x497328[_0x8d3a('0x28')],qs['fields'](_0x2ab876['query'][_0x8d3a('0x2e')]));_0x24e990[_0x8d3a('0x2d')]=_0x24e990['attributes'][_0x8d3a('0x2f')]?_0x24e990['attributes']:_0x497328['model'];if(_0x2ab876[_0x8d3a('0x2b')][_0x8d3a('0x30')]){_0x24e990['include']=[{'all':!![]}];}_0x24e990=_[_0x8d3a('0x31')]({},_0x24e990,_0x2ab876[_0x8d3a('0x32')]);return db[_0x8d3a('0x33')][_0x8d3a('0x34')](_0x24e990)[_0x8d3a('0x21')](handleEntityNotFound(_0x1c6ff6,null))[_0x8d3a('0x21')](respondWithResult(_0x1c6ff6,null))[_0x8d3a('0x35')](handleError(_0x1c6ff6,null));};exports[_0x8d3a('0x36')]=function(_0x4569ca,_0x17aa45){if(_0x4569ca['body']['id']){delete _0x4569ca[_0x8d3a('0x37')]['id'];}return db[_0x8d3a('0x33')]['find']({'where':{'id':_0x4569ca['params']['id']}})[_0x8d3a('0x21')](handleEntityNotFound(_0x17aa45,null))[_0x8d3a('0x21')](saveUpdates(_0x4569ca[_0x8d3a('0x37')],null))['then'](respondWithResult(_0x17aa45,null))[_0x8d3a('0x35')](handleError(_0x17aa45,null));};exports[_0x8d3a('0x22')]=function(_0x50d381,_0x3d3250){return db[_0x8d3a('0x33')][_0x8d3a('0x34')]({'where':{'id':_0x50d381[_0x8d3a('0x27')]['id']}})[_0x8d3a('0x21')](handleEntityNotFound(_0x3d3250,null))[_0x8d3a('0x21')](removeEntity(_0x3d3250,null))['catch'](handleError(_0x3d3250,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index bfb95d8..f850727 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 _0x19cf=['define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x4f5b67,_0x3354df){var _0x53ee0a=function(_0x4abb49){while(--_0x4abb49){_0x4f5b67['push'](_0x4f5b67['shift']());}};_0x53ee0a(++_0x3354df);}(_0x19cf,0x124));var _0xf19c=function(_0x299166,_0x5715d8){_0x299166=_0x299166-0x0;var _0x3bbf55=_0x19cf[_0x299166];return _0x3bbf55;};'use strict';var _=require(_0xf19c('0x0'));var util=require('util');var logger=require(_0xf19c('0x1'))(_0xf19c('0x2'));var moment=require(_0xf19c('0x3'));var BPromise=require(_0xf19c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf19c('0x5'));var rimraf=require('rimraf');var config=require(_0xf19c('0x6'));var attributes=require('./chatApplication.attributes');module[_0xf19c('0x7')]=function(_0x550c9e,_0xd508e9){return _0x550c9e[_0xf19c('0x8')](_0xf19c('0x9'),attributes,{'tableName':_0xf19c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf19c('0xb')});};
\ No newline at end of file
+var _0x7be1=['bluebird','path','../../config/environment','./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x1a0985,_0x2e7a69){var _0x18fb0d=function(_0x44c77d){while(--_0x44c77d){_0x1a0985['push'](_0x1a0985['shift']());}};_0x18fb0d(++_0x2e7a69);}(_0x7be1,0x98));var _0x17be=function(_0x38f5f8,_0xefe164){_0x38f5f8=_0x38f5f8-0x0;var _0x34e820=_0x7be1[_0x38f5f8];return _0x34e820;};'use strict';var _=require('lodash');var util=require(_0x17be('0x0'));var logger=require(_0x17be('0x1'))(_0x17be('0x2'));var moment=require(_0x17be('0x3'));var BPromise=require(_0x17be('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x17be('0x5'));var rimraf=require('rimraf');var config=require(_0x17be('0x6'));var attributes=require(_0x17be('0x7'));module[_0x17be('0x8')]=function(_0x108618,_0x4a9b31){return _0x108618[_0x17be('0x9')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x17be('0xa'),'collate':_0x17be('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index f813e3f..474c5d1 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 _0xce38=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xce38,0x13c));var _0x8ce3=function(_0x3a081b,_0x516437){_0x3a081b=_0x3a081b-0x0;var _0xb166c4=_0xce38[_0x3a081b];return _0xb166c4;};'use strict';var _=require('lodash');var util=require(_0x8ce3('0x0'));var moment=require(_0x8ce3('0x1'));var BPromise=require(_0x8ce3('0x2'));var rs=require(_0x8ce3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ce3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ce3('0x5'))(_0x8ce3('0x6'));var config=require(_0x8ce3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8ce3('0x8')][_0x8ce3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6df552,_0x53088a,_0x2dfbe8){return new BPromise(function(_0x4e569d,_0x18ca2c){return client[_0x8ce3('0xa')](_0x6df552,_0x2dfbe8)[_0x8ce3('0xb')](function(_0x5a0e2f){logger['info'](_0x8ce3('0xc'),_0x53088a,_0x8ce3('0xd'));logger[_0x8ce3('0xe')](_0x8ce3('0xf'),_0x53088a,_0x8ce3('0xd'),JSON[_0x8ce3('0x10')](_0x5a0e2f));if(_0x5a0e2f[_0x8ce3('0x11')]){if(_0x5a0e2f[_0x8ce3('0x11')][_0x8ce3('0x12')]===0x1f4){logger[_0x8ce3('0x11')](_0x8ce3('0xc'),_0x53088a,_0x5a0e2f[_0x8ce3('0x11')][_0x8ce3('0x13')]);return _0x18ca2c(_0x5a0e2f[_0x8ce3('0x11')]['message']);}logger[_0x8ce3('0x11')](_0x8ce3('0xc'),_0x53088a,_0x5a0e2f['error'][_0x8ce3('0x13')]);return _0x4e569d(_0x5a0e2f['error'][_0x8ce3('0x13')]);}else{logger[_0x8ce3('0x14')](_0x8ce3('0xc'),_0x53088a,_0x8ce3('0xd'));_0x4e569d(_0x5a0e2f[_0x8ce3('0x15')][_0x8ce3('0x13')]);}})['catch'](function(_0x27446d){logger[_0x8ce3('0x11')]('ChatApplication,\x20%s,\x20%s',_0x53088a,_0x27446d);_0x18ca2c(_0x27446d);});});}
\ No newline at end of file
+var _0xef03=['lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch'];(function(_0xa26908,_0x4abfbb){var _0x48b115=function(_0x12db7a){while(--_0x12db7a){_0xa26908['push'](_0xa26908['shift']());}};_0x48b115(++_0x4abfbb);}(_0xef03,0x150));var _0x3ef0=function(_0x288889,_0x208b44){_0x288889=_0x288889-0x0;var _0x18f361=_0xef03[_0x288889];return _0x18f361;};'use strict';var _=require(_0x3ef0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3ef0('0x1'));var rs=require(_0x3ef0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ef0('0x3'))['db'];var utils=require(_0x3ef0('0x4'));var logger=require('../../config/logger')(_0x3ef0('0x5'));var config=require(_0x3ef0('0x6'));var jayson=require(_0x3ef0('0x7'));var client=jayson[_0x3ef0('0x8')][_0x3ef0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14c08e,_0x29ed13,_0xddd1d0){return new BPromise(function(_0x399980,_0xcfab30){return client[_0x3ef0('0xa')](_0x14c08e,_0xddd1d0)[_0x3ef0('0xb')](function(_0x15ee85){logger[_0x3ef0('0xc')](_0x3ef0('0xd'),_0x29ed13,'request\x20sent');logger[_0x3ef0('0xe')](_0x3ef0('0xf'),_0x29ed13,_0x3ef0('0x10'),JSON[_0x3ef0('0x11')](_0x15ee85));if(_0x15ee85[_0x3ef0('0x12')]){if(_0x15ee85['error']['code']===0x1f4){logger[_0x3ef0('0x12')](_0x3ef0('0xd'),_0x29ed13,_0x15ee85['error']['message']);return _0xcfab30(_0x15ee85[_0x3ef0('0x12')][_0x3ef0('0x13')]);}logger[_0x3ef0('0x12')](_0x3ef0('0xd'),_0x29ed13,_0x15ee85['error'][_0x3ef0('0x13')]);return _0x399980(_0x15ee85['error'][_0x3ef0('0x13')]);}else{logger[_0x3ef0('0xc')](_0x3ef0('0xd'),_0x29ed13,'request\x20sent');_0x399980(_0x15ee85['result'][_0x3ef0('0x13')]);}})[_0x3ef0('0x14')](function(_0x3dda64){logger['error']('ChatApplication,\x20%s,\x20%s',_0x29ed13,_0x3dda64);_0xcfab30(_0x3dda64);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index c8bbf87..9d0cdce 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 _0xbc26=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','put','destroy','multer','util'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xbc26,0x1b0));var _0x6bc2=function(_0x763a8e,_0x3d0f98){_0x763a8e=_0x763a8e-0x0;var _0x48c2eb=_0xbc26[_0x763a8e];return _0x48c2eb;};'use strict';var multer=require(_0x6bc2('0x0'));var util=require(_0x6bc2('0x1'));var path=require(_0x6bc2('0x2'));var timeout=require(_0x6bc2('0x3'));var express=require(_0x6bc2('0x4'));var router=express['Router']();var fs_extra=require(_0x6bc2('0x5'));var auth=require(_0x6bc2('0x6'));var interaction=require(_0x6bc2('0x7'));var config=require(_0x6bc2('0x8'));var controller=require('./chatApplication.controller');router['get'](_0x6bc2('0x9'),auth[_0x6bc2('0xa')](),controller[_0x6bc2('0xb')]);router[_0x6bc2('0xc')](_0x6bc2('0x9'),auth[_0x6bc2('0xa')](),controller['update']);router['delete'](_0x6bc2('0x9'),auth[_0x6bc2('0xa')](),controller[_0x6bc2('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xaa3e=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','put','update'];(function(_0x20e164,_0x24d0ca){var _0x3432b9=function(_0x2654cb){while(--_0x2654cb){_0x20e164['push'](_0x20e164['shift']());}};_0x3432b9(++_0x24d0ca);}(_0xaa3e,0x1bd));var _0xeaa3=function(_0x5a4400,_0xfae3b6){_0x5a4400=_0x5a4400-0x0;var _0xf9b532=_0xaa3e[_0x5a4400];return _0xf9b532;};'use strict';var multer=require(_0xeaa3('0x0'));var util=require(_0xeaa3('0x1'));var path=require(_0xeaa3('0x2'));var timeout=require(_0xeaa3('0x3'));var express=require(_0xeaa3('0x4'));var router=express[_0xeaa3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xeaa3('0x6'));var interaction=require(_0xeaa3('0x7'));var config=require(_0xeaa3('0x8'));var controller=require(_0xeaa3('0x9'));router['get'](_0xeaa3('0xa'),auth[_0xeaa3('0xb')](),controller['show']);router[_0xeaa3('0xc')](_0xeaa3('0xa'),auth[_0xeaa3('0xb')](),controller[_0xeaa3('0xd')]);router[_0xeaa3('0xe')]('/:id',auth[_0xeaa3('0xb')](),controller[_0xeaa3('0xf')]);module[_0xeaa3('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 544d4d1..702bd03 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 _0xb7a9=['STRING','BOOLEAN','exports'];(function(_0x50588e,_0x405d5d){var _0x10af9d=function(_0x1f3d66){while(--_0x1f3d66){_0x50588e['push'](_0x50588e['shift']());}};_0x10af9d(++_0x405d5d);}(_0xb7a9,0x110));var _0x9b7a=function(_0x49a556,_0x5682d5){_0x49a556=_0x49a556-0x0;var _0x5cd974=_0xb7a9[_0x49a556];return _0x5cd974;};'use strict';var Sequelize=require('sequelize');module[_0x9b7a('0x0')]={'name':{'type':Sequelize[_0x9b7a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9b7a('0x1')]},'write':{'type':Sequelize[_0x9b7a('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x80d3=['STRING'];(function(_0x404c20,_0x1a8fa4){var _0xbf3067=function(_0x233a69){while(--_0x233a69){_0x404c20['push'](_0x404c20['shift']());}};_0xbf3067(++_0x1a8fa4);}(_0x80d3,0x122));var _0x380d=function(_0x4f645a,_0x65a067){_0x4f645a=_0x4f645a-0x0;var _0x12c258=_0x80d3[_0x4f645a];return _0x12c258;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x380d('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x380d('0x0')]},'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 44f8da1..d034bcb 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 _0x6462=['sendStatus','error','stack','name','send','map','ChatGroup','rawAttributes','fieldName','type','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','params','keys','create','body','find','describe','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','nolimit','removeMembers','ChatGroupId','$gte','YYYY-MM-DD\x20HH:mm:ss','getMessages','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy'];(function(_0x48f498,_0x3d3d6c){var _0x57e817=function(_0x1753bb){while(--_0x1753bb){_0x48f498['push'](_0x48f498['shift']());}};_0x57e817(++_0x3d3d6c);}(_0x6462,0x195));var _0x2646=function(_0x463304,_0x2a29ae){_0x463304=_0x463304-0x0;var _0x3ee5f6=_0x6462[_0x463304];return _0x3ee5f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2646('0x0'));var zipdir=require(_0x2646('0x1'));var jsonpatch=require(_0x2646('0x2'));var rp=require(_0x2646('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2646('0x4'));var path=require(_0x2646('0x5'));var sox=require(_0x2646('0x6'));var csv=require(_0x2646('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2646('0x8'));var _=require(_0x2646('0x9'));var squel=require(_0x2646('0xa'));var crypto=require('crypto');var jsforce=require(_0x2646('0xb'));var deskjs=require(_0x2646('0xc'));var toCsv=require(_0x2646('0x7'));var querystring=require(_0x2646('0xd'));var Papa=require('papaparse');var Redis=require(_0x2646('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2646('0xf'))(_0x2646('0x10'));var utils=require(_0x2646('0x11'));var config=require(_0x2646('0x12'));var licenseUtil=require(_0x2646('0x13'));var db=require(_0x2646('0x14'))['db'];config[_0x2646('0x15')]=_[_0x2646('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2646('0x17'))(new Redis(config[_0x2646('0x15')]));require(_0x2646('0x18'))[_0x2646('0x19')](socket);function respondWithStatusCode(_0x29ecfd,_0x1949ac){_0x1949ac=_0x1949ac||0xcc;return function(_0x544390){if(_0x544390){return _0x29ecfd['sendStatus'](_0x1949ac);}return _0x29ecfd['status'](_0x1949ac)[_0x2646('0x1a')]();};}function respondWithResult(_0x2e098f,_0x41153e){_0x41153e=_0x41153e||0xc8;return function(_0x2a865a){if(_0x2a865a){return _0x2e098f[_0x2646('0x1b')](_0x41153e)[_0x2646('0x1c')](_0x2a865a);}};}function respondWithFilteredResult(_0x1407b0,_0x5b851b){return function(_0x5532b1){if(_0x5532b1){var _0x4e119d=typeof _0x5b851b['offset']===_0x2646('0x1d')&&typeof _0x5b851b[_0x2646('0x1e')]===_0x2646('0x1d');var _0x4da371=_0x5532b1[_0x2646('0x1f')];var _0x20e649=_0x4e119d?0x0:_0x5b851b['offset'];var _0x1d010f=_0x4e119d?_0x5532b1[_0x2646('0x1f')]:_0x5b851b[_0x2646('0x20')]+_0x5b851b[_0x2646('0x1e')];var _0xbefa4d;if(_0x1d010f>=_0x4da371){_0x1d010f=_0x4da371;_0xbefa4d=0xc8;}else{_0xbefa4d=0xce;}_0x1407b0['status'](_0xbefa4d);return _0x1407b0[_0x2646('0x21')]('Content-Range',_0x20e649+'-'+_0x1d010f+'/'+_0x4da371)['json'](_0x5532b1);}return null;};}function patchUpdates(_0x1d2c63){return function(_0x4133a4){try{jsonpatch[_0x2646('0x22')](_0x4133a4,_0x1d2c63,!![]);}catch(_0x4e8331){return BPromise[_0x2646('0x23')](_0x4e8331);}return _0x4133a4[_0x2646('0x24')]();};}function saveUpdates(_0x248ea9,_0x51fbba){return function(_0x2955e3){if(_0x2955e3){return _0x2955e3[_0x2646('0x25')](_0x248ea9)[_0x2646('0x26')](function(_0x1e0a9c){return _0x1e0a9c;});}return null;};}function removeEntity(_0x33c4a5,_0x5718b4){return function(_0x33c93f){if(_0x33c93f){return _0x33c93f[_0x2646('0x27')]()['then'](function(){_0x33c4a5[_0x2646('0x1b')](0xcc)[_0x2646('0x1a')]();});}};}function handleEntityNotFound(_0x28b1ee,_0x37810e){return function(_0x4aaf21){if(!_0x4aaf21){_0x28b1ee[_0x2646('0x28')](0x194);}return _0x4aaf21;};}function handleError(_0x3c759a,_0x53d84a){_0x53d84a=_0x53d84a||0x1f4;return function(_0xed1e62){logger[_0x2646('0x29')](_0xed1e62[_0x2646('0x2a')]);if(_0xed1e62[_0x2646('0x2b')]){delete _0xed1e62[_0x2646('0x2b')];}_0x3c759a[_0x2646('0x1b')](_0x53d84a)[_0x2646('0x2c')](_0xed1e62);};}exports['index']=function(_0x3d1a2c,_0x1533bc){var _0x5770f3={},_0x13052c={},_0x418f9a={'count':0x0,'rows':[]};var _0x267207=_[_0x2646('0x2d')](db[_0x2646('0x2e')][_0x2646('0x2f')],function(_0x339e38){return{'name':_0x339e38[_0x2646('0x30')],'type':_0x339e38[_0x2646('0x31')]['key']};});_0x13052c[_0x2646('0x32')]=_['map'](_0x267207,'name');_0x13052c[_0x2646('0x33')]=_['keys'](_0x3d1a2c[_0x2646('0x33')]);_0x13052c[_0x2646('0x34')]=_[_0x2646('0x35')](_0x13052c[_0x2646('0x32')],_0x13052c[_0x2646('0x33')]);_0x5770f3['attributes']=_['intersection'](_0x13052c[_0x2646('0x32')],qs[_0x2646('0x36')](_0x3d1a2c[_0x2646('0x33')]['fields']));_0x5770f3['attributes']=_0x5770f3['attributes'][_0x2646('0x37')]?_0x5770f3[_0x2646('0x38')]:_0x13052c['model'];if(!_0x3d1a2c[_0x2646('0x33')][_0x2646('0x39')]('nolimit')){_0x5770f3[_0x2646('0x1e')]=qs[_0x2646('0x1e')](_0x3d1a2c[_0x2646('0x33')][_0x2646('0x1e')]);_0x5770f3['offset']=qs[_0x2646('0x20')](_0x3d1a2c[_0x2646('0x33')]['offset']);}_0x5770f3[_0x2646('0x3a')]=qs[_0x2646('0x3b')](_0x3d1a2c['query']['sort']);_0x5770f3[_0x2646('0x3c')]=qs['filters'](_[_0x2646('0x3d')](_0x3d1a2c[_0x2646('0x33')],_0x13052c[_0x2646('0x34')]),_0x267207);if(_0x3d1a2c['query']['filter']){_0x5770f3[_0x2646('0x3c')]=_[_0x2646('0x3e')](_0x5770f3[_0x2646('0x3c')],{'$or':_[_0x2646('0x2d')](_0x267207,function(_0x16bc85){if(_0x16bc85[_0x2646('0x31')]!==_0x2646('0x3f')){var _0x2d8343={};_0x2d8343[_0x16bc85[_0x2646('0x2b')]]={'$like':'%'+_0x3d1a2c[_0x2646('0x33')][_0x2646('0x40')]+'%'};return _0x2d8343;}})});}_0x5770f3=_[_0x2646('0x3e')]({},_0x5770f3,_0x3d1a2c[_0x2646('0x41')]);var _0x543c27={'where':_0x5770f3['where']};return db[_0x2646('0x2e')][_0x2646('0x1f')](_0x543c27)['then'](function(_0x4662ef){_0x418f9a[_0x2646('0x1f')]=_0x4662ef;if(_0x3d1a2c[_0x2646('0x33')][_0x2646('0x42')]){_0x5770f3[_0x2646('0x43')]=[{'all':!![]}];}return db[_0x2646('0x2e')]['findAll'](_0x5770f3);})[_0x2646('0x26')](function(_0x5dd105){_0x418f9a['rows']=_0x5dd105;return _0x418f9a;})[_0x2646('0x26')](respondWithFilteredResult(_0x1533bc,_0x5770f3))[_0x2646('0x44')](handleError(_0x1533bc,null));};exports['show']=function(_0x463b63,_0x218021){var _0x55c1ac={'raw':!![],'where':{'id':_0x463b63[_0x2646('0x45')]['id']}},_0x492c88={};_0x492c88['model']=_[_0x2646('0x46')](db[_0x2646('0x2e')][_0x2646('0x2f')]);_0x492c88[_0x2646('0x33')]=_[_0x2646('0x46')](_0x463b63[_0x2646('0x33')]);_0x492c88[_0x2646('0x34')]=_['intersection'](_0x492c88[_0x2646('0x32')],_0x492c88[_0x2646('0x33')]);_0x55c1ac[_0x2646('0x38')]=_['intersection'](_0x492c88[_0x2646('0x32')],qs['fields'](_0x463b63[_0x2646('0x33')][_0x2646('0x36')]));_0x55c1ac['attributes']=_0x55c1ac[_0x2646('0x38')][_0x2646('0x37')]?_0x55c1ac[_0x2646('0x38')]:_0x492c88[_0x2646('0x32')];if(_0x463b63['query'][_0x2646('0x42')]){_0x55c1ac[_0x2646('0x43')]=[{'all':!![]}];}_0x55c1ac=_[_0x2646('0x3e')]({},_0x55c1ac,_0x463b63[_0x2646('0x41')]);return db[_0x2646('0x2e')]['find'](_0x55c1ac)['then'](handleEntityNotFound(_0x218021,null))[_0x2646('0x26')](respondWithResult(_0x218021,null))[_0x2646('0x44')](handleError(_0x218021,null));};exports[_0x2646('0x47')]=function(_0x30e603,_0xdf3e45){return db['ChatGroup'][_0x2646('0x47')](_0x30e603[_0x2646('0x48')],{})[_0x2646('0x26')](respondWithResult(_0xdf3e45,0xc9))['catch'](handleError(_0xdf3e45,null));};exports[_0x2646('0x25')]=function(_0x16c792,_0x58efa9){if(_0x16c792['body']['id']){delete _0x16c792[_0x2646('0x48')]['id'];}return db[_0x2646('0x2e')][_0x2646('0x49')]({'where':{'id':_0x16c792[_0x2646('0x45')]['id']}})[_0x2646('0x26')](handleEntityNotFound(_0x58efa9,null))[_0x2646('0x26')](saveUpdates(_0x16c792[_0x2646('0x48')],null))[_0x2646('0x26')](respondWithResult(_0x58efa9,null))[_0x2646('0x44')](handleError(_0x58efa9,null));};exports[_0x2646('0x27')]=function(_0x4f2b39,_0x4864b0){return db[_0x2646('0x2e')][_0x2646('0x49')]({'where':{'id':_0x4f2b39[_0x2646('0x45')]['id']}})[_0x2646('0x26')](handleEntityNotFound(_0x4864b0,null))[_0x2646('0x26')](removeEntity(_0x4864b0,null))[_0x2646('0x44')](handleError(_0x4864b0,null));};exports['describe']=function(_0x285d45,_0x180e9e){return db['ChatGroup'][_0x2646('0x4a')]()[_0x2646('0x26')](respondWithResult(_0x180e9e,null))[_0x2646('0x44')](handleError(_0x180e9e,null));};exports['getUnread']=function(_0x7a88ad,_0x1446eb,_0x3556db){return db[_0x2646('0x4b')][_0x2646('0x1f')]({'where':{'ChatGroupId':_0x7a88ad[_0x2646('0x45')]['id'],'ToId':_0x7a88ad[_0x2646('0x4c')]['id'],'read':![]}})[_0x2646('0x26')](function(_0x12e16a){return{'id':_[_0x2646('0x4d')](_0x7a88ad[_0x2646('0x45')]['id']),'count':_0x12e16a};})[_0x2646('0x26')](respondWithResult(_0x1446eb,null))[_0x2646('0x44')](handleError(_0x1446eb,null));};exports['addMembers']=function(_0x2c82d8,_0x42e3a5,_0x58b55c){return db[_0x2646('0x2e')][_0x2646('0x49')]({'where':{'id':_0x2c82d8['params']['id']}})['then'](handleEntityNotFound(_0x42e3a5,null))[_0x2646('0x26')](function(_0x2acd9d){if(_0x2acd9d){return _0x2acd9d[_0x2646('0x4e')](_0x2c82d8[_0x2646('0x48')][_0x2646('0x4f')],_['omit'](_0x2c82d8['body'],[_0x2646('0x4f'),'id'])||{});}})[_0x2646('0x26')](respondWithResult(_0x42e3a5,null))['catch'](handleError(_0x42e3a5,null));};exports[_0x2646('0x50')]=function(_0x17dbb0,_0x42bb22,_0x398e39){var _0x924f99={};var _0x3dc18f={};var _0x4a6dee;var _0xde56c5;return db[_0x2646('0x2e')][_0x2646('0x51')]({'where':{'id':_0x17dbb0['params']['id']}})[_0x2646('0x26')](handleEntityNotFound(_0x42bb22,null))[_0x2646('0x26')](function(_0x31de10){if(_0x31de10){_0x4a6dee=_0x31de10;_0x3dc18f[_0x2646('0x32')]=_['keys'](db[_0x2646('0x52')][_0x2646('0x2f')]);_0x3dc18f[_0x2646('0x33')]=_[_0x2646('0x46')](_0x17dbb0[_0x2646('0x33')]);_0x3dc18f[_0x2646('0x34')]=_[_0x2646('0x35')](_0x3dc18f[_0x2646('0x32')],_0x3dc18f['query']);_0x924f99[_0x2646('0x38')]=_[_0x2646('0x35')](_0x3dc18f['model'],qs[_0x2646('0x36')](_0x17dbb0[_0x2646('0x33')][_0x2646('0x36')]));_0x924f99[_0x2646('0x38')]=_0x924f99[_0x2646('0x38')]['length']?_0x924f99[_0x2646('0x38')]:_0x3dc18f[_0x2646('0x32')];_0x924f99[_0x2646('0x3a')]=qs[_0x2646('0x3b')](_0x17dbb0[_0x2646('0x33')][_0x2646('0x3b')]);_0x924f99[_0x2646('0x3c')]=qs['filters'](_[_0x2646('0x3d')](_0x17dbb0['query'],_0x3dc18f[_0x2646('0x34')]));if(_0x17dbb0[_0x2646('0x33')][_0x2646('0x40')]){_0x924f99[_0x2646('0x3c')]=_[_0x2646('0x3e')](_0x924f99[_0x2646('0x3c')],{'$or':_[_0x2646('0x2d')](_0x924f99[_0x2646('0x38')],function(_0x5a8a3b){var _0x16a169={};_0x16a169[_0x5a8a3b]={'$like':'%'+_0x17dbb0[_0x2646('0x33')][_0x2646('0x40')]+'%'};return _0x16a169;})});}_0x924f99=_[_0x2646('0x3e')]({},_0x924f99,_0x17dbb0['options']);return _0x4a6dee[_0x2646('0x50')](_0x924f99);}})[_0x2646('0x26')](function(_0x522e3e){if(_0x522e3e){_0xde56c5=_0x522e3e[_0x2646('0x37')];if(!_0x17dbb0[_0x2646('0x33')]['hasOwnProperty'](_0x2646('0x53'))){_0x924f99[_0x2646('0x1e')]=qs[_0x2646('0x1e')](_0x17dbb0['query'][_0x2646('0x1e')]);_0x924f99['offset']=qs[_0x2646('0x20')](_0x17dbb0[_0x2646('0x33')][_0x2646('0x20')]);}return _0x4a6dee[_0x2646('0x50')](_0x924f99);}})[_0x2646('0x26')](function(_0x2e5396){if(_0x2e5396){return _0x2e5396?{'count':_0xde56c5,'rows':_0x2e5396}:null;}})[_0x2646('0x26')](respondWithResult(_0x42bb22,null))[_0x2646('0x44')](handleError(_0x42bb22,null));};exports[_0x2646('0x54')]=function(_0x23af3d,_0x4983ba,_0x5cef5b){return db['ChatGroup'][_0x2646('0x49')]({'where':{'id':_0x23af3d[_0x2646('0x45')]['id']}})[_0x2646('0x26')](handleEntityNotFound(_0x4983ba,null))[_0x2646('0x26')](function(_0x46d53c){if(_0x46d53c){return _0x46d53c['removeMembers'](_0x23af3d[_0x2646('0x33')][_0x2646('0x4f')]);}})[_0x2646('0x26')](respondWithStatusCode(_0x4983ba,null))['catch'](handleError(_0x4983ba,null));};exports['addMessage']=function(_0x2a8007,_0x20d18b,_0x2b1a5c){if(_0x2a8007[_0x2646('0x48')]['id']){delete _0x2a8007['body']['id'];}return db['ChatGroup'][_0x2646('0x49')]({'where':{'id':_0x2a8007[_0x2646('0x45')]['id']}})['then'](handleEntityNotFound(_0x20d18b,null))[_0x2646('0x26')](function(_0x5aa311){if(_0x5aa311){_0x2a8007[_0x2646('0x48')][_0x2646('0x55')]=_0x5aa311['id'];return db[_0x2646('0x4b')][_0x2646('0x47')](_0x2a8007['body']);}})[_0x2646('0x26')](respondWithResult(_0x20d18b,null))[_0x2646('0x44')](handleError(_0x20d18b,null));};exports['getMessages']=function(_0x3a99ce,_0x59a49f,_0x3e843d){var _0x26fac8={};var _0x8dfefd={};var _0x1793d1;var _0x9340ce;return db[_0x2646('0x2e')][_0x2646('0x51')]({'where':{'id':_0x3a99ce[_0x2646('0x45')]['id']}})['then'](handleEntityNotFound(_0x59a49f,null))['then'](function(_0x442883){if(_0x442883){_0x1793d1=_0x442883;_0x8dfefd['model']=_['keys'](db[_0x2646('0x4b')]['rawAttributes']);_0x8dfefd[_0x2646('0x33')]=_[_0x2646('0x46')](_0x3a99ce[_0x2646('0x33')]);_0x8dfefd[_0x2646('0x34')]=_['intersection'](_0x8dfefd[_0x2646('0x32')],_0x8dfefd[_0x2646('0x33')]);_0x26fac8['attributes']=_[_0x2646('0x35')](_0x8dfefd[_0x2646('0x32')],qs[_0x2646('0x36')](_0x3a99ce[_0x2646('0x33')]['fields']));_0x26fac8[_0x2646('0x38')]=_0x26fac8['attributes'][_0x2646('0x37')]?_0x26fac8['attributes']:_0x8dfefd[_0x2646('0x32')];_0x26fac8[_0x2646('0x3a')]=qs[_0x2646('0x3b')](_0x3a99ce[_0x2646('0x33')][_0x2646('0x3b')]);_0x26fac8[_0x2646('0x3c')]=qs[_0x2646('0x34')](_['pick'](_0x3a99ce[_0x2646('0x33')],_0x8dfefd[_0x2646('0x34')]));if(_0x3a99ce[_0x2646('0x33')][_0x2646('0x40')]){_0x26fac8[_0x2646('0x3c')]=_['merge'](_0x26fac8['where'],{'$or':_['map'](_0x26fac8['attributes'],function(_0x571f32){var _0x61294b={};_0x61294b[_0x571f32]={'$like':'%'+_0x3a99ce[_0x2646('0x33')][_0x2646('0x40')]+'%'};return _0x61294b;})});}if(_0x3a99ce['query'][_0x2646('0x56')]){var _0x35dd83=_0x3a99ce[_0x2646('0x33')][_0x2646('0x56')]['split'](',');var _0x3c049b={};_0x3c049b[_0x35dd83[0x0]]={'$gte':moment(_0x35dd83[0x1])['format'](_0x2646('0x57'))};_0x26fac8[_0x2646('0x3c')]=_[_0x2646('0x3e')](_0x26fac8['where'],_0x3c049b);}_0x26fac8=_['merge']({},_0x26fac8,_0x3a99ce['options']);return _0x1793d1[_0x2646('0x58')](_0x26fac8);}})[_0x2646('0x26')](function(_0x5751bc){if(_0x5751bc){_0x9340ce=_0x5751bc['length'];if(!_0x3a99ce['query'][_0x2646('0x39')](_0x2646('0x53'))){_0x26fac8[_0x2646('0x1e')]=qs[_0x2646('0x1e')](_0x3a99ce[_0x2646('0x33')][_0x2646('0x1e')]);_0x26fac8[_0x2646('0x20')]=qs['offset'](_0x3a99ce[_0x2646('0x33')][_0x2646('0x20')]);}return _0x1793d1['getMessages'](_0x26fac8);}})['then'](function(_0x1d8e3b){if(_0x1d8e3b){return _0x1d8e3b?{'count':_0x9340ce,'rows':_0x1d8e3b}:null;}})['then'](respondWithResult(_0x59a49f,null))['catch'](handleError(_0x59a49f,null));};
\ No newline at end of file
+var _0x8bd7=['to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','end','error','stack','name','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','keys','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','update','catch','describe','getUnread','user','toInteger','ids','omit','User','length','getMembers','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0x8bd7,0x11d));var _0x78bd=function(_0xa38167,_0x5d12b6){_0xa38167=_0xa38167-0x0;var _0x409f8d=_0x8bd7[_0xa38167];return _0x409f8d;};'use strict';var emlformat=require(_0x78bd('0x0'));var rimraf=require(_0x78bd('0x1'));var zipdir=require(_0x78bd('0x2'));var jsonpatch=require(_0x78bd('0x3'));var rp=require(_0x78bd('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x78bd('0x5'));var util=require(_0x78bd('0x6'));var path=require(_0x78bd('0x7'));var sox=require(_0x78bd('0x8'));var csv=require(_0x78bd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x78bd('0xa'));var crypto=require(_0x78bd('0xb'));var jsforce=require(_0x78bd('0xc'));var deskjs=require(_0x78bd('0xd'));var toCsv=require(_0x78bd('0x9'));var querystring=require('querystring');var Papa=require(_0x78bd('0xe'));var Redis=require(_0x78bd('0xf'));var authService=require(_0x78bd('0x10'));var qs=require(_0x78bd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78bd('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x78bd('0x13'));var config=require(_0x78bd('0x14'));var licenseUtil=require(_0x78bd('0x15'));var db=require(_0x78bd('0x16'))['db'];config[_0x78bd('0x17')]=_[_0x78bd('0x18')](config[_0x78bd('0x17')],{'host':_0x78bd('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x78bd('0x17')]));require(_0x78bd('0x1a'))['register'](socket);function respondWithStatusCode(_0xb01357,_0xace10f){_0xace10f=_0xace10f||0xcc;return function(_0x56bfb7){if(_0x56bfb7){return _0xb01357[_0x78bd('0x1b')](_0xace10f);}return _0xb01357[_0x78bd('0x1c')](_0xace10f)['end']();};}function respondWithResult(_0x40a8b3,_0x39ee42){_0x39ee42=_0x39ee42||0xc8;return function(_0x2c75ca){if(_0x2c75ca){return _0x40a8b3[_0x78bd('0x1c')](_0x39ee42)['json'](_0x2c75ca);}};}function respondWithFilteredResult(_0x579f89,_0x44e606){return function(_0x212885){if(_0x212885){var _0x5cb613=typeof _0x44e606[_0x78bd('0x1d')]===_0x78bd('0x1e')&&typeof _0x44e606[_0x78bd('0x1f')]===_0x78bd('0x1e');var _0x3b150c=_0x212885[_0x78bd('0x20')];var _0x280837=_0x5cb613?0x0:_0x44e606[_0x78bd('0x1d')];var _0x9fc140=_0x5cb613?_0x212885['count']:_0x44e606[_0x78bd('0x1d')]+_0x44e606['limit'];var _0xe95e28;if(_0x9fc140>=_0x3b150c){_0x9fc140=_0x3b150c;_0xe95e28=0xc8;}else{_0xe95e28=0xce;}_0x579f89['status'](_0xe95e28);return _0x579f89[_0x78bd('0x21')](_0x78bd('0x22'),_0x280837+'-'+_0x9fc140+'/'+_0x3b150c)[_0x78bd('0x23')](_0x212885);}return null;};}function patchUpdates(_0x3cf9dd){return function(_0x358313){try{jsonpatch[_0x78bd('0x24')](_0x358313,_0x3cf9dd,!![]);}catch(_0x8697d1){return BPromise['reject'](_0x8697d1);}return _0x358313[_0x78bd('0x25')]();};}function saveUpdates(_0x222bb2,_0x37b8cc){return function(_0x4765e1){if(_0x4765e1){return _0x4765e1['update'](_0x222bb2)[_0x78bd('0x26')](function(_0x5c5c50){return _0x5c5c50;});}return null;};}function removeEntity(_0x9445b7,_0x2bcd41){return function(_0x81ad20){if(_0x81ad20){return _0x81ad20[_0x78bd('0x27')]()[_0x78bd('0x26')](function(){_0x9445b7[_0x78bd('0x1c')](0xcc)[_0x78bd('0x28')]();});}};}function handleEntityNotFound(_0x58efd7,_0x20ec65){return function(_0x176085){if(!_0x176085){_0x58efd7[_0x78bd('0x1b')](0x194);}return _0x176085;};}function handleError(_0x48376d,_0xa3032c){_0xa3032c=_0xa3032c||0x1f4;return function(_0x4ab3e9){logger[_0x78bd('0x29')](_0x4ab3e9[_0x78bd('0x2a')]);if(_0x4ab3e9['name']){delete _0x4ab3e9[_0x78bd('0x2b')];}_0x48376d[_0x78bd('0x1c')](_0xa3032c)['send'](_0x4ab3e9);};}exports[_0x78bd('0x2c')]=function(_0x5c0578,_0x155b5a){var _0x15994c={},_0x197ff3={},_0x64539a={'count':0x0,'rows':[]};var _0x5a6248=_['map'](db[_0x78bd('0x2d')][_0x78bd('0x2e')],function(_0xbe7f3c){return{'name':_0xbe7f3c[_0x78bd('0x2f')],'type':_0xbe7f3c[_0x78bd('0x30')][_0x78bd('0x31')]};});_0x197ff3[_0x78bd('0x32')]=_[_0x78bd('0x33')](_0x5a6248,_0x78bd('0x2b'));_0x197ff3['query']=_[_0x78bd('0x34')](_0x5c0578['query']);_0x197ff3[_0x78bd('0x35')]=_['intersection'](_0x197ff3[_0x78bd('0x32')],_0x197ff3[_0x78bd('0x36')]);_0x15994c[_0x78bd('0x37')]=_[_0x78bd('0x38')](_0x197ff3['model'],qs[_0x78bd('0x39')](_0x5c0578['query'][_0x78bd('0x39')]));_0x15994c['attributes']=_0x15994c['attributes']['length']?_0x15994c[_0x78bd('0x37')]:_0x197ff3[_0x78bd('0x32')];if(!_0x5c0578[_0x78bd('0x36')][_0x78bd('0x3a')](_0x78bd('0x3b'))){_0x15994c[_0x78bd('0x1f')]=qs[_0x78bd('0x1f')](_0x5c0578[_0x78bd('0x36')][_0x78bd('0x1f')]);_0x15994c[_0x78bd('0x1d')]=qs[_0x78bd('0x1d')](_0x5c0578['query'][_0x78bd('0x1d')]);}_0x15994c[_0x78bd('0x3c')]=qs[_0x78bd('0x3d')](_0x5c0578[_0x78bd('0x36')][_0x78bd('0x3d')]);_0x15994c[_0x78bd('0x3e')]=qs['filters'](_[_0x78bd('0x3f')](_0x5c0578[_0x78bd('0x36')],_0x197ff3['filters']),_0x5a6248);if(_0x5c0578[_0x78bd('0x36')][_0x78bd('0x40')]){_0x15994c[_0x78bd('0x3e')]=_[_0x78bd('0x41')](_0x15994c[_0x78bd('0x3e')],{'$or':_[_0x78bd('0x33')](_0x5a6248,function(_0x21dc98){if(_0x21dc98[_0x78bd('0x30')]!==_0x78bd('0x42')){var _0x97bad5={};_0x97bad5[_0x21dc98['name']]={'$like':'%'+_0x5c0578[_0x78bd('0x36')][_0x78bd('0x40')]+'%'};return _0x97bad5;}})});}_0x15994c=_[_0x78bd('0x41')]({},_0x15994c,_0x5c0578[_0x78bd('0x43')]);var _0x12b653={'where':_0x15994c[_0x78bd('0x3e')]};return db['ChatGroup'][_0x78bd('0x20')](_0x12b653)[_0x78bd('0x26')](function(_0x3dc495){_0x64539a[_0x78bd('0x20')]=_0x3dc495;if(_0x5c0578[_0x78bd('0x36')][_0x78bd('0x44')]){_0x15994c[_0x78bd('0x45')]=[{'all':!![]}];}return db['ChatGroup'][_0x78bd('0x46')](_0x15994c);})[_0x78bd('0x26')](function(_0x2cce23){_0x64539a[_0x78bd('0x47')]=_0x2cce23;return _0x64539a;})['then'](respondWithFilteredResult(_0x155b5a,_0x15994c))['catch'](handleError(_0x155b5a,null));};exports[_0x78bd('0x48')]=function(_0x537b1f,_0x48cfeb){var _0x23c434={'raw':!![],'where':{'id':_0x537b1f[_0x78bd('0x49')]['id']}},_0x328bbe={};_0x328bbe[_0x78bd('0x32')]=_['keys'](db['ChatGroup'][_0x78bd('0x2e')]);_0x328bbe['query']=_[_0x78bd('0x34')](_0x537b1f[_0x78bd('0x36')]);_0x328bbe[_0x78bd('0x35')]=_[_0x78bd('0x38')](_0x328bbe[_0x78bd('0x32')],_0x328bbe[_0x78bd('0x36')]);_0x23c434[_0x78bd('0x37')]=_[_0x78bd('0x38')](_0x328bbe[_0x78bd('0x32')],qs['fields'](_0x537b1f[_0x78bd('0x36')][_0x78bd('0x39')]));_0x23c434[_0x78bd('0x37')]=_0x23c434[_0x78bd('0x37')]['length']?_0x23c434[_0x78bd('0x37')]:_0x328bbe[_0x78bd('0x32')];if(_0x537b1f[_0x78bd('0x36')]['includeAll']){_0x23c434[_0x78bd('0x45')]=[{'all':!![]}];}_0x23c434=_[_0x78bd('0x41')]({},_0x23c434,_0x537b1f[_0x78bd('0x43')]);return db[_0x78bd('0x2d')][_0x78bd('0x4a')](_0x23c434)[_0x78bd('0x26')](handleEntityNotFound(_0x48cfeb,null))[_0x78bd('0x26')](respondWithResult(_0x48cfeb,null))['catch'](handleError(_0x48cfeb,null));};exports[_0x78bd('0x4b')]=function(_0x508edb,_0x1e0fcb){return db[_0x78bd('0x2d')][_0x78bd('0x4b')](_0x508edb[_0x78bd('0x4c')],{})[_0x78bd('0x26')](respondWithResult(_0x1e0fcb,0xc9))['catch'](handleError(_0x1e0fcb,null));};exports[_0x78bd('0x4d')]=function(_0x1304ed,_0x463771){if(_0x1304ed['body']['id']){delete _0x1304ed[_0x78bd('0x4c')]['id'];}return db[_0x78bd('0x2d')]['find']({'where':{'id':_0x1304ed['params']['id']}})[_0x78bd('0x26')](handleEntityNotFound(_0x463771,null))[_0x78bd('0x26')](saveUpdates(_0x1304ed['body'],null))['then'](respondWithResult(_0x463771,null))[_0x78bd('0x4e')](handleError(_0x463771,null));};exports[_0x78bd('0x27')]=function(_0x5a304b,_0x24394f){return db[_0x78bd('0x2d')][_0x78bd('0x4a')]({'where':{'id':_0x5a304b['params']['id']}})[_0x78bd('0x26')](handleEntityNotFound(_0x24394f,null))[_0x78bd('0x26')](removeEntity(_0x24394f,null))[_0x78bd('0x4e')](handleError(_0x24394f,null));};exports['describe']=function(_0x296ee9,_0x416b5a){return db[_0x78bd('0x2d')][_0x78bd('0x4f')]()[_0x78bd('0x26')](respondWithResult(_0x416b5a,null))[_0x78bd('0x4e')](handleError(_0x416b5a,null));};exports[_0x78bd('0x50')]=function(_0x2aeac3,_0x56ed14,_0x56d6cd){return db['ChatInternalMessage'][_0x78bd('0x20')]({'where':{'ChatGroupId':_0x2aeac3[_0x78bd('0x49')]['id'],'ToId':_0x2aeac3[_0x78bd('0x51')]['id'],'read':![]}})[_0x78bd('0x26')](function(_0x3be7c0){return{'id':_[_0x78bd('0x52')](_0x2aeac3['params']['id']),'count':_0x3be7c0};})['then'](respondWithResult(_0x56ed14,null))['catch'](handleError(_0x56ed14,null));};exports['addMembers']=function(_0x5162f0,_0x14eafd,_0x5af770){return db[_0x78bd('0x2d')][_0x78bd('0x4a')]({'where':{'id':_0x5162f0['params']['id']}})['then'](handleEntityNotFound(_0x14eafd,null))['then'](function(_0x48a09a){if(_0x48a09a){return _0x48a09a['addMembers'](_0x5162f0[_0x78bd('0x4c')][_0x78bd('0x53')],_[_0x78bd('0x54')](_0x5162f0[_0x78bd('0x4c')],[_0x78bd('0x53'),'id'])||{});}})[_0x78bd('0x26')](respondWithResult(_0x14eafd,null))[_0x78bd('0x4e')](handleError(_0x14eafd,null));};exports['getMembers']=function(_0x3f2328,_0x1c1671,_0x173318){var _0x3fede0={};var _0x1f47eb={};var _0x48cdd1;var _0x126ce7;return db[_0x78bd('0x2d')]['findOne']({'where':{'id':_0x3f2328['params']['id']}})[_0x78bd('0x26')](handleEntityNotFound(_0x1c1671,null))[_0x78bd('0x26')](function(_0x4e41ae){if(_0x4e41ae){_0x48cdd1=_0x4e41ae;_0x1f47eb[_0x78bd('0x32')]=_['keys'](db[_0x78bd('0x55')][_0x78bd('0x2e')]);_0x1f47eb[_0x78bd('0x36')]=_[_0x78bd('0x34')](_0x3f2328[_0x78bd('0x36')]);_0x1f47eb[_0x78bd('0x35')]=_[_0x78bd('0x38')](_0x1f47eb['model'],_0x1f47eb[_0x78bd('0x36')]);_0x3fede0['attributes']=_[_0x78bd('0x38')](_0x1f47eb[_0x78bd('0x32')],qs[_0x78bd('0x39')](_0x3f2328['query'][_0x78bd('0x39')]));_0x3fede0[_0x78bd('0x37')]=_0x3fede0[_0x78bd('0x37')][_0x78bd('0x56')]?_0x3fede0[_0x78bd('0x37')]:_0x1f47eb['model'];_0x3fede0['order']=qs[_0x78bd('0x3d')](_0x3f2328[_0x78bd('0x36')][_0x78bd('0x3d')]);_0x3fede0[_0x78bd('0x3e')]=qs[_0x78bd('0x35')](_['pick'](_0x3f2328[_0x78bd('0x36')],_0x1f47eb[_0x78bd('0x35')]));if(_0x3f2328[_0x78bd('0x36')]['filter']){_0x3fede0[_0x78bd('0x3e')]=_[_0x78bd('0x41')](_0x3fede0[_0x78bd('0x3e')],{'$or':_[_0x78bd('0x33')](_0x3fede0[_0x78bd('0x37')],function(_0x525dba){var _0x4a8787={};_0x4a8787[_0x525dba]={'$like':'%'+_0x3f2328[_0x78bd('0x36')][_0x78bd('0x40')]+'%'};return _0x4a8787;})});}_0x3fede0=_[_0x78bd('0x41')]({},_0x3fede0,_0x3f2328[_0x78bd('0x43')]);return _0x48cdd1[_0x78bd('0x57')](_0x3fede0);}})[_0x78bd('0x26')](function(_0x5cc56b){if(_0x5cc56b){_0x126ce7=_0x5cc56b[_0x78bd('0x56')];if(!_0x3f2328[_0x78bd('0x36')][_0x78bd('0x3a')]('nolimit')){_0x3fede0[_0x78bd('0x1f')]=qs['limit'](_0x3f2328[_0x78bd('0x36')]['limit']);_0x3fede0[_0x78bd('0x1d')]=qs[_0x78bd('0x1d')](_0x3f2328[_0x78bd('0x36')][_0x78bd('0x1d')]);}return _0x48cdd1[_0x78bd('0x57')](_0x3fede0);}})[_0x78bd('0x26')](function(_0x192f68){if(_0x192f68){return _0x192f68?{'count':_0x126ce7,'rows':_0x192f68}:null;}})['then'](respondWithResult(_0x1c1671,null))[_0x78bd('0x4e')](handleError(_0x1c1671,null));};exports[_0x78bd('0x58')]=function(_0x39758c,_0x5c43be,_0x49bced){return db[_0x78bd('0x2d')]['find']({'where':{'id':_0x39758c[_0x78bd('0x49')]['id']}})[_0x78bd('0x26')](handleEntityNotFound(_0x5c43be,null))[_0x78bd('0x26')](function(_0x6d5b21){if(_0x6d5b21){return _0x6d5b21['removeMembers'](_0x39758c[_0x78bd('0x36')]['ids']);}})['then'](respondWithStatusCode(_0x5c43be,null))[_0x78bd('0x4e')](handleError(_0x5c43be,null));};exports[_0x78bd('0x59')]=function(_0x16ef03,_0xc0bbe5,_0x5e512a){if(_0x16ef03['body']['id']){delete _0x16ef03[_0x78bd('0x4c')]['id'];}return db[_0x78bd('0x2d')][_0x78bd('0x4a')]({'where':{'id':_0x16ef03[_0x78bd('0x49')]['id']}})[_0x78bd('0x26')](handleEntityNotFound(_0xc0bbe5,null))['then'](function(_0x47fc65){if(_0x47fc65){_0x16ef03[_0x78bd('0x4c')][_0x78bd('0x5a')]=_0x47fc65['id'];return db[_0x78bd('0x5b')][_0x78bd('0x4b')](_0x16ef03[_0x78bd('0x4c')]);}})['then'](respondWithResult(_0xc0bbe5,null))['catch'](handleError(_0xc0bbe5,null));};exports[_0x78bd('0x5c')]=function(_0x4c0deb,_0x5ee58a,_0x3bbc21){var _0x29d414={};var _0x4a395b={};var _0x221860;var _0x4b3726;return db[_0x78bd('0x2d')][_0x78bd('0x5d')]({'where':{'id':_0x4c0deb[_0x78bd('0x49')]['id']}})['then'](handleEntityNotFound(_0x5ee58a,null))[_0x78bd('0x26')](function(_0x1c3f3a){if(_0x1c3f3a){_0x221860=_0x1c3f3a;_0x4a395b[_0x78bd('0x32')]=_[_0x78bd('0x34')](db[_0x78bd('0x5b')]['rawAttributes']);_0x4a395b[_0x78bd('0x36')]=_[_0x78bd('0x34')](_0x4c0deb['query']);_0x4a395b[_0x78bd('0x35')]=_[_0x78bd('0x38')](_0x4a395b[_0x78bd('0x32')],_0x4a395b[_0x78bd('0x36')]);_0x29d414[_0x78bd('0x37')]=_['intersection'](_0x4a395b['model'],qs['fields'](_0x4c0deb['query'][_0x78bd('0x39')]));_0x29d414[_0x78bd('0x37')]=_0x29d414[_0x78bd('0x37')][_0x78bd('0x56')]?_0x29d414[_0x78bd('0x37')]:_0x4a395b[_0x78bd('0x32')];_0x29d414[_0x78bd('0x3c')]=qs[_0x78bd('0x3d')](_0x4c0deb[_0x78bd('0x36')]['sort']);_0x29d414[_0x78bd('0x3e')]=qs[_0x78bd('0x35')](_['pick'](_0x4c0deb[_0x78bd('0x36')],_0x4a395b[_0x78bd('0x35')]));if(_0x4c0deb[_0x78bd('0x36')][_0x78bd('0x40')]){_0x29d414[_0x78bd('0x3e')]=_[_0x78bd('0x41')](_0x29d414['where'],{'$or':_['map'](_0x29d414[_0x78bd('0x37')],function(_0x2b540c){var _0xed0026={};_0xed0026[_0x2b540c]={'$like':'%'+_0x4c0deb[_0x78bd('0x36')][_0x78bd('0x40')]+'%'};return _0xed0026;})});}if(_0x4c0deb[_0x78bd('0x36')][_0x78bd('0x5e')]){var _0x23bdf3=_0x4c0deb[_0x78bd('0x36')]['$gte'][_0x78bd('0x5f')](',');var _0x1670cf={};_0x1670cf[_0x23bdf3[0x0]]={'$gte':moment(_0x23bdf3[0x1])[_0x78bd('0x60')](_0x78bd('0x61'))};_0x29d414['where']=_[_0x78bd('0x41')](_0x29d414[_0x78bd('0x3e')],_0x1670cf);}_0x29d414=_[_0x78bd('0x41')]({},_0x29d414,_0x4c0deb[_0x78bd('0x43')]);return _0x221860[_0x78bd('0x5c')](_0x29d414);}})[_0x78bd('0x26')](function(_0x3162ea){if(_0x3162ea){_0x4b3726=_0x3162ea[_0x78bd('0x56')];if(!_0x4c0deb['query'][_0x78bd('0x3a')]('nolimit')){_0x29d414[_0x78bd('0x1f')]=qs[_0x78bd('0x1f')](_0x4c0deb[_0x78bd('0x36')][_0x78bd('0x1f')]);_0x29d414['offset']=qs[_0x78bd('0x1d')](_0x4c0deb[_0x78bd('0x36')][_0x78bd('0x1d')]);}return _0x221860[_0x78bd('0x5c')](_0x29d414);}})[_0x78bd('0x26')](function(_0x4d831f){if(_0x4d831f){return _0x4d831f?{'count':_0x4b3726,'rows':_0x4d831f}:null;}})['then'](respondWithResult(_0x5ee58a,null))[_0x78bd('0x4e')](handleError(_0x5ee58a,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index c32132f..4d8cbc3 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 _0x14a0=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1d03fb,_0x8a62a1){var _0x39a977=function(_0x58de83){while(--_0x58de83){_0x1d03fb['push'](_0x1d03fb['shift']());}};_0x39a977(++_0x8a62a1);}(_0x14a0,0x109));var _0x014a=function(_0x3339cb,_0x4813c7){_0x3339cb=_0x3339cb-0x0;var _0x15b7c8=_0x14a0[_0x3339cb];return _0x15b7c8;};'use strict';var EventEmitter=require(_0x014a('0x0'));var ChatGroup=require(_0x014a('0x1'))['db'][_0x014a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x014a('0x3')](0x0);var events={'afterCreate':_0x014a('0x4'),'afterUpdate':_0x014a('0x5'),'afterDestroy':_0x014a('0x6')};function emitEvent(_0x349a0d){return function(_0x1cf6f3,_0x56d55d,_0x3cb762){ChatGroupEvents[_0x014a('0x7')](_0x349a0d+':'+_0x1cf6f3['id'],_0x1cf6f3);ChatGroupEvents['emit'](_0x349a0d,_0x1cf6f3);_0x3cb762(null);};}for(var e in events){if(events[_0x014a('0x8')](e)){var event=events[e];ChatGroup[_0x014a('0x9')](e,emitEvent(event));}}module[_0x014a('0xa')]=ChatGroupEvents;
\ No newline at end of file
+var _0x2172=['save','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2172,0x15b));var _0x2217=function(_0x4801c0,_0x35d200){_0x4801c0=_0x4801c0-0x0;var _0x8b28e5=_0x2172[_0x4801c0];return _0x8b28e5;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x2217('0x0'))['db'][_0x2217('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2217('0x2')](0x0);var events={'afterCreate':_0x2217('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x37b96a){return function(_0xd6fb71,_0x40863f,_0x57c819){ChatGroupEvents['emit'](_0x37b96a+':'+_0xd6fb71['id'],_0xd6fb71);ChatGroupEvents['emit'](_0x37b96a,_0xd6fb71);_0x57c819(null);};}for(var e in events){if(events[_0x2217('0x4')](e)){var event=events[e];ChatGroup[_0x2217('0x5')](e,emitEvent(event));}}module[_0x2217('0x6')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 0c13e49..d2e78ab 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 _0xd257=['rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','../../config/logger','api','moment','request-promise','path'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xd257,0x7c));var _0x7d25=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0xd257[_0x5538d5];return _0x323b1a;};'use strict';var _=require('lodash');var util=require(_0x7d25('0x0'));var logger=require(_0x7d25('0x1'))(_0x7d25('0x2'));var moment=require(_0x7d25('0x3'));var BPromise=require('bluebird');var rp=require(_0x7d25('0x4'));var fs=require('fs');var path=require(_0x7d25('0x5'));var rimraf=require(_0x7d25('0x6'));var config=require(_0x7d25('0x7'));var attributes=require(_0x7d25('0x8'));module[_0x7d25('0x9')]=function(_0x4f2663,_0x456e9e){return _0x4f2663[_0x7d25('0xa')](_0x7d25('0xb'),attributes,{'tableName':_0x7d25('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd7d7=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd7d7,0xd1));var _0x7d7d=function(_0x155d89,_0x24d2e9){_0x155d89=_0x155d89-0x0;var _0x4b0806=_0xd7d7[_0x155d89];return _0x4b0806;};'use strict';var _=require(_0x7d7d('0x0'));var util=require(_0x7d7d('0x1'));var logger=require(_0x7d7d('0x2'))(_0x7d7d('0x3'));var moment=require(_0x7d7d('0x4'));var BPromise=require(_0x7d7d('0x5'));var rp=require(_0x7d7d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d7d('0x7'));var config=require(_0x7d7d('0x8'));var attributes=require(_0x7d7d('0x9'));module[_0x7d7d('0xa')]=function(_0x3d7ccc,_0x4bafb8){return _0x3d7ccc[_0x7d7d('0xb')](_0x7d7d('0xc'),attributes,{'tableName':_0x7d7d('0xd'),'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 64d3cd1..e4eade1 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 _0xe799=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4e13b0,_0x1ca561){var _0x5c2a63=function(_0xc1d181){while(--_0xc1d181){_0x4e13b0['push'](_0x4e13b0['shift']());}};_0x5c2a63(++_0x1ca561);}(_0xe799,0x170));var _0x9e79=function(_0x743ca2,_0x3ef14b){_0x743ca2=_0x743ca2-0x0;var _0x1d4b58=_0xe799[_0x743ca2];return _0x1d4b58;};'use strict';var _=require(_0x9e79('0x0'));var util=require('util');var moment=require(_0x9e79('0x1'));var BPromise=require('bluebird');var rs=require(_0x9e79('0x2'));var fs=require('fs');var Redis=require(_0x9e79('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e79('0x4'));var logger=require(_0x9e79('0x5'))(_0x9e79('0x6'));var config=require('../../config/environment');var jayson=require(_0x9e79('0x7'));var client=jayson['client'][_0x9e79('0x8')]({'port':0x232a});config[_0x9e79('0x9')]=_[_0x9e79('0xa')](config['redis'],{'host':_0x9e79('0xb'),'port':0x18eb});var socket=require(_0x9e79('0xc'))(new Redis(config['redis']));require(_0x9e79('0xd'))[_0x9e79('0xe')](socket);function respondWithRpcPromise(_0xc46eed,_0x6464d6,_0x502f36){return new BPromise(function(_0x43bd7a,_0x15efc4){return client['request'](_0xc46eed,_0x502f36)[_0x9e79('0xf')](function(_0x127c92){logger[_0x9e79('0x10')](_0x9e79('0x11'),_0x6464d6,_0x9e79('0x12'));logger['debug'](_0x9e79('0x13'),_0x6464d6,_0x9e79('0x12'),JSON[_0x9e79('0x14')](_0x127c92));if(_0x127c92[_0x9e79('0x15')]){if(_0x127c92[_0x9e79('0x15')][_0x9e79('0x16')]===0x1f4){logger[_0x9e79('0x15')](_0x9e79('0x11'),_0x6464d6,_0x127c92[_0x9e79('0x15')][_0x9e79('0x17')]);return _0x15efc4(_0x127c92[_0x9e79('0x15')][_0x9e79('0x17')]);}logger['error'](_0x9e79('0x11'),_0x6464d6,_0x127c92['error'][_0x9e79('0x17')]);return _0x43bd7a(_0x127c92[_0x9e79('0x15')]['message']);}else{logger[_0x9e79('0x10')](_0x9e79('0x11'),_0x6464d6,'request\x20sent');_0x43bd7a(_0x127c92['result'][_0x9e79('0x17')]);}})[_0x9e79('0x18')](function(_0x33e7a2){logger[_0x9e79('0x15')](_0x9e79('0x11'),_0x6464d6,_0x33e7a2);_0x15efc4(_0x33e7a2);});});}
\ No newline at end of file
+var _0x9f60=['request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','then','ChatGroup,\x20%s,\x20%s'];(function(_0x3cae69,_0x233c38){var _0x3128eb=function(_0x21d64e){while(--_0x21d64e){_0x3cae69['push'](_0x3cae69['shift']());}};_0x3128eb(++_0x233c38);}(_0x9f60,0x1ae));var _0x09f6=function(_0x14deb4,_0x32297e){_0x14deb4=_0x14deb4-0x0;var _0x26aa7d=_0x9f60[_0x14deb4];return _0x26aa7d;};'use strict';var _=require(_0x09f6('0x0'));var util=require('util');var moment=require(_0x09f6('0x1'));var BPromise=require(_0x09f6('0x2'));var rs=require(_0x09f6('0x3'));var fs=require('fs');var Redis=require(_0x09f6('0x4'));var db=require(_0x09f6('0x5'))['db'];var utils=require(_0x09f6('0x6'));var logger=require(_0x09f6('0x7'))('rpc');var config=require(_0x09f6('0x8'));var jayson=require(_0x09f6('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x09f6('0xa')](config[_0x09f6('0xb')],{'host':_0x09f6('0xc'),'port':0x18eb});var socket=require(_0x09f6('0xd'))(new Redis(config[_0x09f6('0xb')]));require(_0x09f6('0xe'))[_0x09f6('0xf')](socket);function respondWithRpcPromise(_0x2e1bb3,_0x5b5038,_0x14d079){return new BPromise(function(_0x978b31,_0x1e10e2){return client['request'](_0x2e1bb3,_0x14d079)[_0x09f6('0x10')](function(_0x3a9988){logger['info'](_0x09f6('0x11'),_0x5b5038,_0x09f6('0x12'));logger[_0x09f6('0x13')](_0x09f6('0x14'),_0x5b5038,_0x09f6('0x12'),JSON[_0x09f6('0x15')](_0x3a9988));if(_0x3a9988[_0x09f6('0x16')]){if(_0x3a9988[_0x09f6('0x16')][_0x09f6('0x17')]===0x1f4){logger[_0x09f6('0x16')]('ChatGroup,\x20%s,\x20%s',_0x5b5038,_0x3a9988[_0x09f6('0x16')][_0x09f6('0x18')]);return _0x1e10e2(_0x3a9988['error'][_0x09f6('0x18')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x5b5038,_0x3a9988[_0x09f6('0x16')][_0x09f6('0x18')]);return _0x978b31(_0x3a9988['error'][_0x09f6('0x18')]);}else{logger[_0x09f6('0x19')]('ChatGroup,\x20%s,\x20%s',_0x5b5038,_0x09f6('0x12'));_0x978b31(_0x3a9988[_0x09f6('0x1a')][_0x09f6('0x18')]);}})[_0x09f6('0x1b')](function(_0x1ab9f6){logger['error']('ChatGroup,\x20%s,\x20%s',_0x5b5038,_0x1ab9f6);_0x1e10e2(_0x1ab9f6);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 3bf0304..6946e72 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 _0x8419=['emit','register','length','save','remove','update'];(function(_0x1c578a,_0x4be67d){var _0x447ac8=function(_0x324c69){while(--_0x324c69){_0x1c578a['push'](_0x1c578a['shift']());}};_0x447ac8(++_0x4be67d);}(_0x8419,0x1ef));var _0x9841=function(_0x208a50,_0x53ec1e){_0x208a50=_0x208a50-0x0;var _0xd62dfa=_0x8419[_0x208a50];return _0xd62dfa;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x9841('0x0'),_0x9841('0x1'),_0x9841('0x2')];function createListener(_0x3b6707,_0x518168){return function(_0x2c3f21){_0x518168[_0x9841('0x3')](_0x3b6707,_0x2c3f21);};}function removeListener(_0x5aff1f,_0x40e5dc){return function(){ChatGroupEvents['removeListener'](_0x5aff1f,_0x40e5dc);};}exports[_0x9841('0x4')]=function(_0x254e5f){for(var _0x1033e7=0x0,_0x2d588a=events[_0x9841('0x5')];_0x1033e7<_0x2d588a;_0x1033e7++){var _0x53365e=events[_0x1033e7];var _0x19a4a9=createListener('chatGroup:'+_0x53365e,_0x254e5f);ChatGroupEvents['on'](_0x53365e,_0x19a4a9);}};
\ No newline at end of file
+var _0x430f=['remove','removeListener','register','length','./chatGroup.events','save'];(function(_0x354e4e,_0x74f187){var _0x1ca266=function(_0x5772d3){while(--_0x5772d3){_0x354e4e['push'](_0x354e4e['shift']());}};_0x1ca266(++_0x74f187);}(_0x430f,0xb2));var _0xf430=function(_0x47a8e9,_0x3bddb2){_0x47a8e9=_0x47a8e9-0x0;var _0x2fadb5=_0x430f[_0x47a8e9];return _0x2fadb5;};'use strict';var ChatGroupEvents=require(_0xf430('0x0'));var events=[_0xf430('0x1'),_0xf430('0x2'),'update'];function createListener(_0x1ec010,_0x4fdbcd){return function(_0x53a54c){_0x4fdbcd['emit'](_0x1ec010,_0x53a54c);};}function removeListener(_0x370e7b,_0x5c5c18){return function(){ChatGroupEvents[_0xf430('0x3')](_0x370e7b,_0x5c5c18);};}exports[_0xf430('0x4')]=function(_0x1f7de0){for(var _0x44bcdc=0x0,_0x4dda0e=events[_0xf430('0x5')];_0x44bcdc<_0x4dda0e;_0x44bcdc++){var _0x372dae=events[_0x44bcdc];var _0x54f990=createListener('chatGroup:'+_0x372dae,_0x1f7de0);ChatGroupEvents['on'](_0x372dae,_0x54f990);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 9318259..d008fde 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 _0xd877=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMessage','put','/:id','update','delete','destroy'];(function(_0x14a9f4,_0x1b86c6){var _0x3700c6=function(_0x6e6eea){while(--_0x6e6eea){_0x14a9f4['push'](_0x14a9f4['shift']());}};_0x3700c6(++_0x1b86c6);}(_0xd877,0x1a5));var _0x7d87=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xd877[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x7d87('0x0'));var util=require('util');var path=require(_0x7d87('0x1'));var timeout=require(_0x7d87('0x2'));var express=require(_0x7d87('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7d87('0x4'));var interaction=require(_0x7d87('0x5'));var config=require(_0x7d87('0x6'));var controller=require(_0x7d87('0x7'));router[_0x7d87('0x8')]('/',auth[_0x7d87('0x9')](),controller[_0x7d87('0xa')]);router[_0x7d87('0x8')](_0x7d87('0xb'),auth[_0x7d87('0x9')](),controller[_0x7d87('0xc')]);router[_0x7d87('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7d87('0xd')]);router[_0x7d87('0x8')](_0x7d87('0xe'),auth[_0x7d87('0x9')](),controller[_0x7d87('0xf')]);router[_0x7d87('0x8')](_0x7d87('0x10'),auth['isAuthenticated'](),controller[_0x7d87('0x11')]);router[_0x7d87('0x8')](_0x7d87('0x12'),auth[_0x7d87('0x9')](),controller[_0x7d87('0x13')]);router[_0x7d87('0x14')]('/',auth[_0x7d87('0x9')](),controller['create']);router['post'](_0x7d87('0x10'),auth[_0x7d87('0x9')](),controller['addMembers']);router[_0x7d87('0x14')](_0x7d87('0x12'),auth[_0x7d87('0x9')](),controller[_0x7d87('0x15')]);router[_0x7d87('0x16')](_0x7d87('0x17'),auth[_0x7d87('0x9')](),controller[_0x7d87('0x18')]);router[_0x7d87('0x19')](_0x7d87('0x17'),auth[_0x7d87('0x9')](),controller[_0x7d87('0x1a')]);router[_0x7d87('0x19')]('/:id/members',auth[_0x7d87('0x9')](),controller['removeMembers']);module[_0x7d87('0x1b')]=router;
\ No newline at end of file
+var _0x335f=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','update','delete','exports','multer','util'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0x335f,0x8a));var _0xf335=function(_0x458c2a,_0x531b2e){_0x458c2a=_0x458c2a-0x0;var _0x1be615=_0x335f[_0x458c2a];return _0x1be615;};'use strict';var multer=require(_0xf335('0x0'));var util=require(_0xf335('0x1'));var path=require(_0xf335('0x2'));var timeout=require('connect-timeout');var express=require(_0xf335('0x3'));var router=express[_0xf335('0x4')]();var fs_extra=require(_0xf335('0x5'));var auth=require(_0xf335('0x6'));var interaction=require(_0xf335('0x7'));var config=require(_0xf335('0x8'));var controller=require(_0xf335('0x9'));router[_0xf335('0xa')]('/',auth[_0xf335('0xb')](),controller[_0xf335('0xc')]);router[_0xf335('0xa')](_0xf335('0xd'),auth[_0xf335('0xb')](),controller[_0xf335('0xe')]);router[_0xf335('0xa')](_0xf335('0xf'),auth[_0xf335('0xb')](),controller[_0xf335('0x10')]);router[_0xf335('0xa')]('/:id/unread',auth[_0xf335('0xb')](),controller[_0xf335('0x11')]);router[_0xf335('0xa')](_0xf335('0x12'),auth[_0xf335('0xb')](),controller[_0xf335('0x13')]);router[_0xf335('0xa')](_0xf335('0x14'),auth[_0xf335('0xb')](),controller[_0xf335('0x15')]);router[_0xf335('0x16')]('/',auth['isAuthenticated'](),controller[_0xf335('0x17')]);router[_0xf335('0x16')](_0xf335('0x12'),auth['isAuthenticated'](),controller['addMembers']);router[_0xf335('0x16')](_0xf335('0x14'),auth[_0xf335('0xb')](),controller[_0xf335('0x18')]);router['put'](_0xf335('0xf'),auth[_0xf335('0xb')](),controller[_0xf335('0x19')]);router[_0xf335('0x1a')](_0xf335('0xf'),auth[_0xf335('0xb')](),controller['destroy']);router[_0xf335('0x1a')](_0xf335('0x12'),auth[_0xf335('0xb')](),controller['removeMembers']);module[_0xf335('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index f07f013..d1c5167 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 _0x8871=['thumb','STRING','TEXT','DATE','out','sequelize','exports','INTEGER','ENUM','star'];(function(_0x2db796,_0x3f2e05){var _0x1c2196=function(_0x25ecec){while(--_0x25ecec){_0x2db796['push'](_0x2db796['shift']());}};_0x1c2196(++_0x3f2e05);}(_0x8871,0x109));var _0x1887=function(_0x5945d3,_0x42c4a1){_0x5945d3=_0x5945d3-0x0;var _0xe3819a=_0x8871[_0x5945d3];return _0xe3819a;};'use strict';var Sequelize=require(_0x1887('0x0'));module[_0x1887('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x1887('0x2')]},'ratingType':{'type':Sequelize[_0x1887('0x3')](_0x1887('0x4'),_0x1887('0x5')),'defaultValue':_0x1887('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x1887('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1887('0x6')]},'secondDisposition':{'type':Sequelize[_0x1887('0x6')]},'thirdDisposition':{'type':Sequelize[_0x1887('0x6')]},'note':{'type':Sequelize[_0x1887('0x6')]},'browserName':{'type':Sequelize[_0x1887('0x6')]},'browserVersion':{'type':Sequelize[_0x1887('0x6')]},'osName':{'type':Sequelize[_0x1887('0x6')]},'osVersion':{'type':Sequelize[_0x1887('0x6')]},'deviceModel':{'type':Sequelize[_0x1887('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x1887('0x7')]},'customerIp':{'type':Sequelize[_0x1887('0x6')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize[_0x1887('0x8')]},'lastMsgAt':{'type':Sequelize[_0x1887('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x1887('0x3')]('in',_0x1887('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x1887('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xbd3a=['out','INTEGER','sequelize','BOOLEAN','ENUM','star','thumb','TEXT','DATE','STRING','long'];(function(_0xa81ce1,_0x1c5c59){var _0x4cb9fe=function(_0x525e92){while(--_0x525e92){_0xa81ce1['push'](_0xa81ce1['shift']());}};_0x4cb9fe(++_0x1c5c59);}(_0xbd3a,0x10a));var _0xabd3=function(_0x58c043,_0x267d07){_0x58c043=_0x58c043-0x0;var _0x19a4c4=_0xbd3a[_0x58c043];return _0x19a4c4;};'use strict';var Sequelize=require(_0xabd3('0x0'));module['exports']={'closed':{'type':Sequelize[_0xabd3('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xabd3('0x2')](_0xabd3('0x3'),_0xabd3('0x4')),'defaultValue':_0xabd3('0x3')},'ratingMessage':{'type':Sequelize[_0xabd3('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xabd3('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xabd3('0x7')]},'note':{'type':Sequelize[_0xabd3('0x7')]},'browserName':{'type':Sequelize[_0xabd3('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xabd3('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xabd3('0x5')]},'customerIp':{'type':Sequelize[_0xabd3('0x7')]},'formData':{'type':Sequelize[_0xabd3('0x5')](_0xabd3('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xabd3('0x2')]('in',_0xabd3('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xabd3('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xabd3('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xabd3('0xa')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index ad7c632..f3ce2ac 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 _0x46cd=['include','find','create','body','update','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','follow','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','closed','disposition','attachmentUpload','file','filename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','basename','download','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','User','Messages','%s%d','System','customer','ContactId','agentIdentifier','website_alias','agentAlias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','hasOwnProperty','nolimit','limit','order','sort','pick','ChatInteractionId','filter','where','map','$gte','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','includeAgent','push','rows','addTags','spread','Tag','emit','chatInteractionTags:save','removeTags','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','secret','read','Account','Owner','get','mkdirSync','Chat','N.A.','toString','closedAt','browserName','osName','referer','customerPort','existsSync','createReadStream','pipe','createWriteStream','direction','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','end','json','offset','undefined','count','set','destroy','sendStatus','stack','name','render','merge','contact','agent','interaction','account','ChatInteraction','rawAttributes','getOptions','findAll','chat','query','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll'];(function(_0x107f10,_0x5529f2){var _0x811cab=function(_0xc160ea){while(--_0xc160ea){_0x107f10['push'](_0x107f10['shift']());}};_0x811cab(++_0x5529f2);}(_0x46cd,0x159));var _0xd46c=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x46cd[_0xfa634c];return _0x73e478;};'use strict';var rimraf=require(_0xd46c('0x0'));var zipdir=require(_0xd46c('0x1'));var rp=require(_0xd46c('0x2'));var moment=require(_0xd46c('0x3'));var BPromise=require(_0xd46c('0x4'));var Mustache=require(_0xd46c('0x5'));var util=require('util');var path=require(_0xd46c('0x6'));var ejs=require(_0xd46c('0x7'));var fs=require('fs');var _=require(_0xd46c('0x8'));var Redis=require(_0xd46c('0x9'));var interaction=require(_0xd46c('0xa'));var qs=require(_0xd46c('0xb'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0xd46c('0xc'));var config=require(_0xd46c('0xd'));var db=require(_0xd46c('0xe'))['db'];config['redis']=_[_0xd46c('0xf')](config[_0xd46c('0x10')],{'host':'localhost','port':0x18eb});var socket=require(_0xd46c('0x11'))(new Redis(config[_0xd46c('0x10')]));require(_0xd46c('0x12'))['register'](socket);var jayson=require(_0xd46c('0x13'));var client=jayson[_0xd46c('0x14')][_0xd46c('0x15')]({'port':0x232b});var client9004=jayson[_0xd46c('0x14')][_0xd46c('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x9b2116,_0x2b59a6,_0x2f6535,_0x4e2b64){return new BPromise(function(_0x53461c,_0x3852d5){var _0x121560=_0x4e2b64||client;return _0x121560['request'](_0x9b2116,_0x2f6535)[_0xd46c('0x16')](function(_0x38dc3c){logger[_0xd46c('0x17')](_0xd46c('0x18'),_0x2b59a6,_0xd46c('0x19'));logger[_0xd46c('0x1a')](_0xd46c('0x1b'),_0x2b59a6,_0xd46c('0x19'),JSON[_0xd46c('0x1c')](_0x38dc3c));if(_0x38dc3c['error']){if(_0x38dc3c[_0xd46c('0x1d')]['code']===0x1f4){logger[_0xd46c('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x2b59a6,_0x38dc3c['error']['message']);return _0x3852d5(_0x38dc3c[_0xd46c('0x1d')]['message']);}logger[_0xd46c('0x1d')](_0xd46c('0x18'),_0x2b59a6,_0x38dc3c[_0xd46c('0x1d')][_0xd46c('0x1e')]);return _0x53461c(_0x38dc3c[_0xd46c('0x1d')][_0xd46c('0x1e')]);}else{logger['info'](_0xd46c('0x18'),_0x2b59a6,_0xd46c('0x19'));_0x53461c(_0x38dc3c['result']['message']);}})[_0xd46c('0x1f')](function(_0x95a1fe){logger[_0xd46c('0x1d')](_0xd46c('0x18'),_0x2b59a6,_0x95a1fe);_0x3852d5(_0x95a1fe);});});}function respondWithStatusCode(_0x2965d3,_0x5e5833){_0x5e5833=_0x5e5833||0xcc;return function(_0x3a9b10){if(_0x3a9b10){return _0x2965d3['sendStatus'](_0x5e5833);}return _0x2965d3[_0xd46c('0x20')](_0x5e5833)[_0xd46c('0x21')]();};}function respondWithResult(_0x1796b7,_0x41b34a){_0x41b34a=_0x41b34a||0xc8;return function(_0x5a700a){if(_0x5a700a){return _0x1796b7['status'](_0x41b34a)[_0xd46c('0x22')](_0x5a700a);}};}function respondWithFilteredResult(_0x1a4e8f,_0x28a642){return function(_0x30719a){if(_0x30719a){var _0x4c1575=typeof _0x28a642[_0xd46c('0x23')]===_0xd46c('0x24')&&typeof _0x28a642['limit']===_0xd46c('0x24');var _0x256978=_0x30719a[_0xd46c('0x25')];var _0x4c4db5=_0x4c1575?0x0:_0x28a642[_0xd46c('0x23')];var _0x32e7f9=_0x4c1575?_0x30719a[_0xd46c('0x25')]:_0x28a642[_0xd46c('0x23')]+_0x28a642['limit'];var _0x4ac483;if(_0x32e7f9>=_0x256978){_0x32e7f9=_0x256978;_0x4ac483=0xc8;}else{_0x4ac483=0xce;}_0x1a4e8f['status'](_0x4ac483);return _0x1a4e8f[_0xd46c('0x26')]('Content-Range',_0x4c4db5+'-'+_0x32e7f9+'/'+_0x256978)[_0xd46c('0x22')](_0x30719a);}return null;};}function saveUpdates(_0x41d1ac){return function(_0x129f15){if(_0x129f15){return _0x129f15['update'](_0x41d1ac)[_0xd46c('0x16')](function(_0x3b7eb5){return _0x3b7eb5;});}return null;};}function removeEntity(_0x16cb81){return function(_0x5eed71){if(_0x5eed71){return _0x5eed71[_0xd46c('0x27')]()[_0xd46c('0x16')](function(){_0x16cb81[_0xd46c('0x20')](0xcc)[_0xd46c('0x21')]();});}};}function handleEntityNotFound(_0xd317f1){return function(_0x33b722){if(!_0x33b722){_0xd317f1[_0xd46c('0x28')](0x194);}return _0x33b722;};}function handleError(_0xe617a8,_0xb69334){_0xb69334=_0xb69334||0x1f4;return function(_0x276a8d){logger['error'](_0x276a8d[_0xd46c('0x29')]);if(_0x276a8d[_0xd46c('0x2a')]){delete _0x276a8d[_0xd46c('0x2a')];}_0xe617a8[_0xd46c('0x20')](_0xb69334)['send'](_0x276a8d);};}function getMustacheRender(_0x4ac681,_0x142740){return Mustache[_0xd46c('0x2b')](_0x4ac681,_[_0xd46c('0x2c')](_0x142740['body'],{'contact':_0x142740[_0xd46c('0x2d')],'message':_0x142740[_0xd46c('0x1e')],'agent':_0x142740[_0xd46c('0x2e')],'interaction':_0x142740[_0xd46c('0x2f')],'account':_0x142740[_0xd46c('0x30')]}))||'';}exports['index']=function(_0xf34dd6,_0x3a67c8){var _0x488f5a={};var _0x2779db=_['map'](db[_0xd46c('0x31')][_0xd46c('0x32')],function(_0x203a1c){return{'name':_0x203a1c['fieldName'],'type':_0x203a1c['type']['key']};});_0x488f5a=qs[_0xd46c('0x33')](_0x2779db,_0xf34dd6);return interaction[_0xd46c('0x34')](_0xd46c('0x35'),_0xf34dd6[_0xd46c('0x36')],_0xf34dd6['user'],_0x488f5a,_0x2779db)['then'](respondWithFilteredResult(_0x3a67c8,_0x488f5a))[_0xd46c('0x1f')](handleError(_0x3a67c8,null));};exports[_0xd46c('0x37')]=function(_0xa1dc2c,_0x45858b){var _0x2c55df={'raw':![],'where':{'id':_0xa1dc2c[_0xd46c('0x38')]['id']}},_0x1d75fe={};_0x1d75fe['model']=_[_0xd46c('0x39')](db[_0xd46c('0x31')][_0xd46c('0x32')]);_0x1d75fe[_0xd46c('0x36')]=_['keys'](_0xa1dc2c['query']);_0x1d75fe[_0xd46c('0x3a')]=_[_0xd46c('0x3b')](_0x1d75fe[_0xd46c('0x3c')],_0x1d75fe[_0xd46c('0x36')]);_0x2c55df[_0xd46c('0x3d')]=_[_0xd46c('0x3b')](_0x1d75fe[_0xd46c('0x3c')],qs[_0xd46c('0x3e')](_0xa1dc2c[_0xd46c('0x36')][_0xd46c('0x3e')]));_0x2c55df['attributes']=_0x2c55df[_0xd46c('0x3d')][_0xd46c('0x3f')]?_0x2c55df[_0xd46c('0x3d')]:_0x1d75fe['model'];if(_0xa1dc2c['query'][_0xd46c('0x40')]){_0x2c55df[_0xd46c('0x41')]=[{'all':!![]}];}_0x2c55df=_[_0xd46c('0x2c')]({},_0x2c55df,_0xa1dc2c['options']);return db[_0xd46c('0x31')][_0xd46c('0x42')](_0x2c55df)['then'](handleEntityNotFound(_0x45858b,null))[_0xd46c('0x16')](respondWithResult(_0x45858b,null))[_0xd46c('0x1f')](handleError(_0x45858b,null));};exports[_0xd46c('0x43')]=function(_0x6eb1aa,_0x6c4c4c){return db['ChatInteraction'][_0xd46c('0x43')](_0x6eb1aa[_0xd46c('0x44')],{})[_0xd46c('0x16')](respondWithResult(_0x6c4c4c,0xc9))[_0xd46c('0x1f')](handleError(_0x6c4c4c,null));};exports[_0xd46c('0x45')]=function(_0x4c814f,_0x174273){if(_0x4c814f[_0xd46c('0x44')]['id']){delete _0x4c814f['body']['id'];}return db['ChatInteraction'][_0xd46c('0x42')]({'where':{'id':_0x4c814f[_0xd46c('0x38')]['id']}})['then'](handleEntityNotFound(_0x174273,null))[_0xd46c('0x16')](saveUpdates(_0x4c814f[_0xd46c('0x44')],null))['then'](respondWithResult(_0x174273,null))['catch'](handleError(_0x174273,null));};exports[_0xd46c('0x27')]=function(_0x422ce4,_0x446864){return db[_0xd46c('0x31')][_0xd46c('0x42')]({'where':{'id':_0x422ce4['params']['id']}})[_0xd46c('0x16')](handleEntityNotFound(_0x446864,null))[_0xd46c('0x16')](removeEntity(_0x446864,null))[_0xd46c('0x1f')](handleError(_0x446864,null));};exports['describe']=function(_0x29958e,_0x293a0b){return db['ChatInteraction']['describe']()[_0xd46c('0x16')](respondWithResult(_0x293a0b,null))[_0xd46c('0x1f')](handleError(_0x293a0b,null));};exports[_0xd46c('0x46')]=function(_0x9bd5c5,_0x4c1735){var _0x46f791=_0x9bd5c5[_0xd46c('0x38')]['id'];var _0x2adf26;var _0x31bae3;var _0x360eef;return db[_0xd46c('0x31')][_0xd46c('0x47')]({'where':{'id':_0x46f791}})['then'](function(_0xc09054){_0x2adf26=_0xc09054;return db[_0xd46c('0x48')]['findOne']({'where':{'id':_0xc09054[_0xd46c('0x49')]},'attributes':['id',_0xd46c('0x4a'),_0xd46c('0x4b'),_0xd46c('0x4c'),_0xd46c('0x4d'),_0xd46c('0x4e')],'raw':!![]});})['then'](function(_0x42b2ec){if(_0x42b2ec&&_0x42b2ec['vidaooApiKey']&&_0x42b2ec[_0xd46c('0x4b')]){_0x31bae3=_0x42b2ec;var _0x551d9f={'interaction':{'id':_0x46f791},'agent':{'id':_0x9bd5c5[_0xd46c('0x4f')]['id'],'name':_0x9bd5c5[_0xd46c('0x4f')][_0xd46c('0x2a')],'fullname':_0x9bd5c5['user'][_0xd46c('0x50')],'email':_0x9bd5c5[_0xd46c('0x4f')]['email']},'contact':_0x9bd5c5[_0xd46c('0x44')][_0xd46c('0x2d')],'account':_0x9bd5c5[_0xd46c('0x44')][_0xd46c('0x30')]};var _0x59e667={'rejectUnauthorized':![],'method':_0xd46c('0x51'),'url':_0xd46c('0x52'),'headers':{'X-APIKEY':_0x42b2ec[_0xd46c('0x4a')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x9bd5c5['user'][_0xd46c('0x53')]],'buttons':null,'topic':_0x31bae3[_0xd46c('0x4c')],'note':_['isNull'](_0x31bae3[_0xd46c('0x4d')])?null:getMustacheRender(_0x31bae3[_0xd46c('0x4d')],_0x551d9f),'metadata':null},'redirect':_0xd46c('0x54'),'json':!![]};try{if(!_[_0xd46c('0x55')](_0x31bae3[_0xd46c('0x4e')])){var _0xb240b5=getMustacheRender(_0x31bae3['vidaooMetadata'],_0x551d9f);var _0x51f03c=JSON[_0xd46c('0x56')](_0xb240b5);_0x59e667[_0xd46c('0x44')][_0xd46c('0x57')]=_0x51f03c;}}catch(_0x185be9){throw new db[(_0xd46c('0x58'))][(_0xd46c('0x59'))](_0xd46c('0x5a'));}return rp(_0x59e667);}else{throw new db[(_0xd46c('0x58'))][(_0xd46c('0x59'))](_0xd46c('0x5b'));}})[_0xd46c('0x16')](function(_0x31b85b){_0x360eef=_0x31b85b;if(_0x360eef['id']){var _0xe4f86b={'body':_0x360eef[_0xd46c('0x5c')],'ChatWebsiteId':_0x31bae3['id'],'ChatInteractionId':_0x2adf26['id'],'direction':_0xd46c('0x5d'),'UserId':_0x9bd5c5[_0xd46c('0x4f')]['id']};return db['ChatMessage'][_0xd46c('0x43')](_0xe4f86b,{});}else{throw new db[(_0xd46c('0x58'))][(_0xd46c('0x59'))](_0xd46c('0x5e'));}})[_0xd46c('0x16')](function(){return _0x2adf26[_0xd46c('0x5f')]({'vidaooSessionId':_0x360eef['id']});})[_0xd46c('0x16')](respondWithResult(_0x4c1735,null))[_0xd46c('0x1f')](handleError(_0x4c1735,null));};exports['customUpdate']=function(_0x59e87b,_0x441c88){if(_0x59e87b[_0xd46c('0x44')]['id']){delete _0x59e87b['body']['id'];}return db[_0xd46c('0x31')]['find']({'where':{'id':_0x59e87b[_0xd46c('0x38')]['id']},'include':[{'model':db[_0xd46c('0x60')],'as':_0xd46c('0x61')}]})[_0xd46c('0x16')](handleEntityNotFound(_0x441c88,null))[_0xd46c('0x16')](saveUpdates(_0x59e87b['body'],null))[_0xd46c('0x16')](respondWithResult(_0x441c88,null))[_0xd46c('0x1f')](handleError(_0x441c88,null));};exports[_0xd46c('0x62')]=function(_0x240f50,_0x251192){if(_0x240f50['body']['id']){delete _0x240f50[_0xd46c('0x44')]['id'];}return db[_0xd46c('0x31')]['find']({'where':{'id':_0x240f50[_0xd46c('0x38')]['id']}})[_0xd46c('0x16')](function(_0x31d5cf){if(!_0x31d5cf){logger[_0xd46c('0x1d')](_0xd46c('0x63'),_0xd46c('0x62'),0x194,'entity\x20not\x20found');_0x251192[_0xd46c('0x28')](0x194);}else{if(_0x31d5cf[_0xd46c('0x64')]){throw new db[(_0xd46c('0x58'))][(_0xd46c('0x59'))]('Interaction\x20already\x20assigned');}}return _0x31d5cf;})['then'](function(_0x3ab6fd){if(_0x3ab6fd){return _0x3ab6fd[_0xd46c('0x45')]({'closed':_0x240f50[_0xd46c('0x44')][_0xd46c('0x65')],'disposition':_0x240f50[_0xd46c('0x44')][_0xd46c('0x66')]})[_0xd46c('0x16')](function(_0x278f11){return _0x278f11;});}})[_0xd46c('0x16')](function(){return respondWithRpcPromise('AbandonInteraction',_0xd46c('0x62'),_0x240f50['body'],client9004);})[_0xd46c('0x16')](respondWithResult(_0x251192,null))[_0xd46c('0x1f')](handleError(_0x251192,null));};exports[_0xd46c('0x67')]=function(_0x5c5885,_0x13ab5d){_0x5c5885['body'][_0xd46c('0x2a')]=_0x5c5885[_0xd46c('0x68')]['originalname'];_0x5c5885[_0xd46c('0x44')]['basename']=_0x5c5885[_0xd46c('0x68')][_0xd46c('0x69')];_0x5c5885[_0xd46c('0x44')]['type']=_0x5c5885[_0xd46c('0x68')][_0xd46c('0x6a')];return db[_0xd46c('0x6b')][_0xd46c('0x43')](_0x5c5885[_0xd46c('0x44')])[_0xd46c('0x16')](respondWithResult(_0x13ab5d,0xc9))[_0xd46c('0x1f')](handleError(_0x13ab5d,null));};exports['attachmentDownload']=function(_0x5ae616,_0x9e16bd){return db['ChatInteraction'][_0xd46c('0x47')]({'where':{'id':_0x5ae616[_0xd46c('0x38')]['id']},'raw':!![]})[_0xd46c('0x16')](handleEntityNotFound(_0x9e16bd,null))['then'](function(_0xbeeb3f){if(_0xbeeb3f){if(_0xbeeb3f['closed']){return _0x9e16bd['status'](0x193)[_0xd46c('0x22')]({'status':0x193,'message':_0xd46c('0x6c')});}return db[_0xd46c('0x6b')]['findOne']({'where':{'id':_0x5ae616[_0xd46c('0x36')][_0xd46c('0x6d')]},'raw':!![]})[_0xd46c('0x16')](handleEntityNotFound(_0x9e16bd,null));}})[_0xd46c('0x16')](function(_0x1ecc38){if(_0x1ecc38){var _0x36e344=_0x1ecc38[_0xd46c('0x6e')]!==null;var _0x39b29c=path[_0xd46c('0x6f')](config[_0xd46c('0x70')],_0xd46c('0x71'));if(_0x36e344){_0x39b29c=path[_0xd46c('0x6f')](_0x39b29c,'offline-chat/');}var _0x4341d8=path[_0xd46c('0x6f')](_0x39b29c,_0x1ecc38[_0xd46c('0x72')]);return _0x9e16bd[_0xd46c('0x73')](_0x4341d8);}})[_0xd46c('0x1f')](handleError(_0x9e16bd,null));};exports[_0xd46c('0x74')]=function(_0x185745,_0x5ac508){var _0x4225c3=null;var _0x168d74=null;var _0x25de03=null;if(_0x185745['body']['id']){delete _0x185745[_0xd46c('0x44')]['id'];}if(_0x185745[_0xd46c('0x44')]['mailTranscript']){_0x25de03=path[_0xd46c('0x6f')](config[_0xd46c('0x70')],_0xd46c('0x75'),util[_0xd46c('0x76')](_0xd46c('0x77'),Date[_0xd46c('0x78')]()));_0x185745[_0xd46c('0x44')][_0xd46c('0x79')]=_0x25de03;}return db[_0xd46c('0x31')]['find']({'where':{'id':_0x185745[_0xd46c('0x38')]['id']},'include':[{'model':db[_0xd46c('0x7a')],'as':'Messages','include':[{'model':db[_0xd46c('0x7b')],'as':_0xd46c('0x7b')}]}]})['then'](handleEntityNotFound(_0x5ac508,null))[_0xd46c('0x16')](saveUpdates(_0x185745['body'],null))[_0xd46c('0x16')](function(_0x253a95){if(_0x253a95){_0x4225c3=_0x253a95;return db[_0xd46c('0x48')][_0xd46c('0x42')]({'where':{'id':_0x4225c3['ChatWebsiteId']}});}})['then'](function(_0x5dd220){if(_0x5dd220){_0x168d74=_0x5dd220;return db[_0xd46c('0x60')][_0xd46c('0x42')]({'where':{'id':_0x4225c3['ContactId']}});}})[_0xd46c('0x16')](function(_0x26d5e8){if(_0x26d5e8){if(_0x25de03){var _0x1c1805=null;for(var _0x3641ce=0x1;_0x3641ce<_0x4225c3[_0xd46c('0x7c')][_0xd46c('0x3f')];++_0x3641ce){_0x1c1805=_0x4225c3['Messages'][_0x3641ce];var _0x24a7c1=_0x1c1805['UserId']?util[_0xd46c('0x76')](_0xd46c('0x7d'),_0x168d74['agentAlias'],_0x1c1805['UserId']):_0xd46c('0x7e');var _0x2a7da5=_0x185745[_0xd46c('0x44')][_0xd46c('0x7f')]||util[_0xd46c('0x76')](_0xd46c('0x7d'),'Visitor',_0x1c1805[_0xd46c('0x80')]);switch(_0x168d74[_0xd46c('0x81')]){case _0xd46c('0x82'):_0x24a7c1=_0x1c1805['UserId']?util[_0xd46c('0x76')](_0xd46c('0x7d'),_0x168d74[_0xd46c('0x83')],_0x1c1805[_0xd46c('0x64')]):_0xd46c('0x7e');break;case _0xd46c('0x84'):_0x24a7c1=_0x1c1805['UserId']?_0x1c1805['User'][_0xd46c('0x85')]||_0x1c1805['User'][_0xd46c('0x50')]:'System';break;case'agent_fullname':_0x24a7c1=_0x1c1805[_0xd46c('0x64')]?_0x1c1805[_0xd46c('0x7b')]['fullname']:_0xd46c('0x7e');break;default:_0x24a7c1=_0x1c1805['UserId']?util['format'](_0xd46c('0x7d'),_0x168d74[_0xd46c('0x83')],_0x1c1805[_0xd46c('0x64')]):_0xd46c('0x7e');}var _0x190400=util[_0xd46c('0x76')](_0xd46c('0x86'),moment(_0x1c1805['createdAt'])['format'](_0xd46c('0x87')),_0x1c1805['direction']==='in'?_0x2a7da5:_0x24a7c1,_0x1c1805[_0xd46c('0x44')]);if(!_0x1c1805['secret']){fs[_0xd46c('0x88')](_0x25de03,_0x190400);}}return db[_0xd46c('0x89')][_0xd46c('0x47')]({'where':{'service':!![]},'include':[{'model':db[_0xd46c('0x8a')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xd46c('0x8b')],'as':_0xd46c('0x8b'),'raw':!![]}]}]});}}})[_0xd46c('0x16')](function(_0x41bdaf){if(!_0x41bdaf||!_0x41bdaf[_0xd46c('0x8c')]||!_0x185745[_0xd46c('0x44')])return _0x4225c3;var _0x34f02e=_0x41bdaf[_0xd46c('0x8d')]();return respondWithRpcPromise(_0xd46c('0x8e'),'sendMail',{'account':_0x34f02e,'message':{'from':util[_0xd46c('0x76')](_0xd46c('0x8f'),_0x41bdaf[_0xd46c('0x2a')],_0x41bdaf[_0xd46c('0x53')]||_0x41bdaf[_0xd46c('0x8c')][_0xd46c('0x4f')]),'to':_0x185745['body']['mailTranscript'],'subject':_0xd46c('0x90'),'text':util[_0xd46c('0x76')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x185745[_0xd46c('0x44')]['mailTranscript']),'attachments':[{'path':_0x25de03}]}})[_0xd46c('0x16')](function(){return _0x4225c3;})['catch'](function(_0x476609){logger[_0xd46c('0x1d')](_0x476609);});})[_0xd46c('0x16')](respondWithStatusCode(_0x5ac508,0xc8))[_0xd46c('0x1f')](handleError(_0x5ac508,null));};exports[_0xd46c('0x91')]=function(_0x56dab4,_0x21074d){return db[_0xd46c('0x7a')][_0xd46c('0x42')]({'where':{'id':_0x56dab4[_0xd46c('0x38')]['id']}})[_0xd46c('0x16')](handleEntityNotFound(_0x21074d,null))[_0xd46c('0x16')](function(_0x4f625d){if(_0x4f625d){return _0x4f625d[_0xd46c('0x91')](_0x56dab4[_0xd46c('0x44')][_0xd46c('0x92')],_[_0xd46c('0x93')](_0x56dab4[_0xd46c('0x44')],[_0xd46c('0x92'),'id'])||{});}})['then'](respondWithResult(_0x21074d,null))[_0xd46c('0x1f')](handleError(_0x21074d,null));};exports['getMessages']=function(_0x11eddc,_0x5f37d9){var _0x420f4b={'raw':![],'where':{}};var _0x2455d5={};var _0x5d2d22={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xd46c('0x47')]({'where':{'id':_0x11eddc[_0xd46c('0x38')]['id']}})['then'](handleEntityNotFound(_0x5f37d9,null))[_0xd46c('0x16')](function(_0x596b75){if(_0x596b75){_0x2455d5[_0xd46c('0x3c')]=_[_0xd46c('0x39')](db[_0xd46c('0x7a')][_0xd46c('0x32')]);_0x2455d5[_0xd46c('0x36')]=_[_0xd46c('0x39')](_0x11eddc[_0xd46c('0x36')]);_0x2455d5[_0xd46c('0x3a')]=_[_0xd46c('0x3b')](_0x2455d5[_0xd46c('0x3c')],_0x2455d5['query']);_0x420f4b[_0xd46c('0x3d')]=_[_0xd46c('0x3b')](_0x2455d5['model'],qs['fields'](_0x11eddc[_0xd46c('0x36')][_0xd46c('0x3e')]));_0x420f4b[_0xd46c('0x3d')]=_0x420f4b[_0xd46c('0x3d')][_0xd46c('0x3f')]?_0x420f4b[_0xd46c('0x3d')]:_0x2455d5[_0xd46c('0x3c')];if(!_0x11eddc[_0xd46c('0x36')][_0xd46c('0x94')](_0xd46c('0x95'))){_0x420f4b[_0xd46c('0x96')]=qs[_0xd46c('0x96')](_0x11eddc[_0xd46c('0x36')]['limit']);_0x420f4b[_0xd46c('0x23')]=qs['offset'](_0x11eddc['query'][_0xd46c('0x23')]);}_0x420f4b[_0xd46c('0x97')]=qs[_0xd46c('0x98')](_0x11eddc[_0xd46c('0x36')][_0xd46c('0x98')]);_0x420f4b['where']=qs[_0xd46c('0x3a')](_[_0xd46c('0x99')](_0x11eddc[_0xd46c('0x36')],_0x2455d5[_0xd46c('0x3a')]));_0x420f4b['where'][_0xd46c('0x9a')]=_0x596b75['id'];if(_0x11eddc[_0xd46c('0x36')][_0xd46c('0x9b')]){_0x420f4b[_0xd46c('0x9c')]=_['merge'](_0x420f4b[_0xd46c('0x9c')],{'$or':_[_0xd46c('0x9d')](_0x420f4b['attributes'],function(_0x411b58){var _0x16e332={};_0x16e332[_0x411b58]={'$like':'%'+_0x11eddc['query'][_0xd46c('0x9b')]+'%'};return _0x16e332;})});}if(_0x11eddc[_0xd46c('0x36')]['$gte']){var _0x476cf5=_0x11eddc['query'][_0xd46c('0x9e')]['split'](',');var _0x485e8e={};_0x485e8e[_0x476cf5[0x0]]={'$gte':moment(_0x476cf5[0x1])[_0xd46c('0x76')](_0xd46c('0x9f'))};_0x420f4b[_0xd46c('0x9c')]=_[_0xd46c('0x2c')](_0x420f4b[_0xd46c('0x9c')],_0x485e8e);}_0x420f4b=_[_0xd46c('0x2c')]({},_0x420f4b,_0x11eddc[_0xd46c('0xa0')]);return db[_0xd46c('0x7a')][_0xd46c('0x25')]({'where':_0x420f4b[_0xd46c('0x9c')]})[_0xd46c('0x16')](function(_0x3fbc0f){_0x5d2d22[_0xd46c('0x25')]=_0x3fbc0f;if(_0x11eddc['query'][_0xd46c('0x40')]){_0x420f4b[_0xd46c('0x41')]=[{'all':!![]}];}return db['ChatMessage'][_0xd46c('0x34')](_0x420f4b);})[_0xd46c('0x16')](function(_0x367aa8){_0x5d2d22['rows']=_0x367aa8;return _0x5d2d22;});}})[_0xd46c('0x16')](respondWithFilteredResult(_0x5f37d9,_0x420f4b))['catch'](handleError(_0x5f37d9,null));};exports[_0xd46c('0xa1')]=function(_0x156433,_0x23b64a){var _0x148565={'where':{}},_0x554719={},_0x3657a4={'count':0x0,'rows':[]};return db[_0xd46c('0x31')][_0xd46c('0x47')]({'where':{'id':_0x156433[_0xd46c('0x38')]['id']}})[_0xd46c('0x16')](handleEntityNotFound(_0x23b64a,null))[_0xd46c('0x16')](function(_0x574229){if(_0x574229){_0x554719['model']=_[_0xd46c('0x39')](db[_0xd46c('0x7a')][_0xd46c('0x32')]);_0x554719[_0xd46c('0x36')]=_[_0xd46c('0x39')](_0x156433[_0xd46c('0x36')]);_0x554719[_0xd46c('0x3a')]=_['intersection'](_0x554719[_0xd46c('0x3c')],_0x554719[_0xd46c('0x36')]);_0x148565[_0xd46c('0x3d')]=_['intersection'](_0x554719[_0xd46c('0x3c')],qs[_0xd46c('0x3e')](_0x156433['query'][_0xd46c('0x3e')]));_0x148565[_0xd46c('0x3d')]=_0x148565[_0xd46c('0x3d')]['length']?_0x148565['attributes']:_0x554719[_0xd46c('0x3c')];if(!_0x156433['query'][_0xd46c('0x94')](_0xd46c('0x95'))){_0x148565[_0xd46c('0x96')]=qs[_0xd46c('0x96')](_0x156433[_0xd46c('0x36')][_0xd46c('0x96')]);_0x148565['offset']=qs[_0xd46c('0x23')](_0x156433[_0xd46c('0x36')][_0xd46c('0x23')]);}_0x148565['order']=qs[_0xd46c('0x98')](_0x156433[_0xd46c('0x36')][_0xd46c('0x98')]);_0x148565['where']=qs[_0xd46c('0x3a')](_['pick'](_0x156433['query'],_0x554719[_0xd46c('0x3a')]));_0x148565[_0xd46c('0x9c')][_0xd46c('0x9a')]=_0x574229['id'];if(_0x156433[_0xd46c('0x36')][_0xd46c('0x9b')]){_0x148565[_0xd46c('0x9c')]=_['merge'](_0x148565[_0xd46c('0x9c')],{'$or':_[_0xd46c('0x9d')](_0x148565[_0xd46c('0x3d')],function(_0x7231db){var _0x2e9641={};_0x2e9641[_0x7231db]={'$like':'%'+_0x156433[_0xd46c('0x36')]['filter']+'%'};return _0x2e9641;})});}_0x148565['where']['secret']=![];if(_0x156433[_0xd46c('0x36')]['id']){_0x148565[_0xd46c('0x9c')]['id']={'$gt':_0x156433['query']['id']};}_0x148565=_[_0xd46c('0x2c')]({},_0x148565,_0x156433[_0xd46c('0xa0')]);return db[_0xd46c('0x7a')][_0xd46c('0x25')]({'where':_0x148565[_0xd46c('0x9c')]})[_0xd46c('0x16')](function(_0x51ee21){_0x3657a4[_0xd46c('0x25')]=_0x51ee21;_0x148565['include']=[];if(_0x156433[_0xd46c('0x36')][_0xd46c('0xa2')]){_0x148565[_0xd46c('0x41')][_0xd46c('0xa3')]({'model':db['User'],'as':_0xd46c('0x7b'),'attributes':['id','fullname',_0xd46c('0x85')]});}if(_0x156433[_0xd46c('0x36')][_0xd46c('0x40')]){_0x148565['include']=[{'all':!![]}];}return db[_0xd46c('0x7a')][_0xd46c('0x34')](_0x148565);})['then'](function(_0x5b99f1){_0x3657a4[_0xd46c('0xa4')]=_0x5b99f1;return _0x3657a4;});}})[_0xd46c('0x16')](respondWithFilteredResult(_0x23b64a,_0x148565))[_0xd46c('0x1f')](handleError(_0x23b64a,null));};exports[_0xd46c('0xa5')]=function(_0x1842a4,_0x4c2ade){return db[_0xd46c('0x31')]['find']({'where':{'id':_0x1842a4[_0xd46c('0x38')]['id']}})[_0xd46c('0x16')](handleEntityNotFound(_0x4c2ade,null))[_0xd46c('0x16')](function(_0x3a2006){if(_0x3a2006){return _0x3a2006['setTags'](_0x1842a4[_0xd46c('0x44')][_0xd46c('0x92')],_[_0xd46c('0x93')](_0x1842a4[_0xd46c('0x44')],['ids','id'])||{})[_0xd46c('0xa6')](function(){return db[_0xd46c('0xa7')]['findAll']({'attributes':['id',_0xd46c('0x2a'),'color'],'where':{'id':_0x1842a4['body']['ids']}});})[_0xd46c('0x16')](function(_0x50ef21){socket[_0xd46c('0xa8')](_0xd46c('0xa9'),{'id':Number(_0x1842a4[_0xd46c('0x38')]['id']),'tags':_0x50ef21||[]});return{'id':Number(_0x1842a4[_0xd46c('0x38')]['id']),'tags':_0x50ef21||[]};});}})[_0xd46c('0x16')](respondWithResult(_0x4c2ade,null))[_0xd46c('0x1f')](handleError(_0x4c2ade,null));};exports[_0xd46c('0xaa')]=function(_0x3b2391,_0x1d9174){return db['ChatInteraction'][_0xd46c('0x42')]({'where':{'id':_0x3b2391[_0xd46c('0x38')]['id']}})[_0xd46c('0x16')](handleEntityNotFound(_0x1d9174,null))[_0xd46c('0x16')](function(_0x188f39){if(_0x188f39){return _0x188f39[_0xd46c('0xaa')](_0x3b2391[_0xd46c('0x36')][_0xd46c('0x92')]);}})[_0xd46c('0x16')](respondWithStatusCode(_0x1d9174,null))[_0xd46c('0x1f')](handleError(_0x1d9174,null));};exports[_0xd46c('0x73')]=function(_0x3037ef,_0x2a7e65){var _0x3389cd=moment()['unix']()['toString']();var _0x2d22a2=path[_0xd46c('0x6f')](config[_0xd46c('0x70')],_0xd46c('0xab'),'files','tmp');var _0x1aeaf1=path[_0xd46c('0x6f')](config[_0xd46c('0x70')],_0xd46c('0xab'),_0xd46c('0xac'),_0xd46c('0xad'));var _0x472f75=path[_0xd46c('0x6f')](_0x2d22a2,_0x3389cd);var _0x578902=util[_0xd46c('0x76')](_0xd46c('0xae'),_0x3037ef[_0xd46c('0x38')]['id'],_0x3389cd);var _0x435133=path[_0xd46c('0x6f')](_0x2d22a2,_0x578902);var _0x36007f=[];_0x36007f[_0xd46c('0xa3')]({'model':db['User'],'as':_0xd46c('0x7b'),'attributes':['id','fullname'],'raw':!![]});_0x36007f[_0xd46c('0xa3')]({'model':db[_0xd46c('0x60')],'as':_0xd46c('0x61'),'attributes':['id',_0xd46c('0xaf'),_0xd46c('0xb0')],'raw':!![]});if(_0x3037ef[_0xd46c('0x36')][_0xd46c('0xad')]){_0x36007f['push']({'model':db[_0xd46c('0x6b')],'as':_0xd46c('0x6b'),'raw':!![]});}var _0x486e94=[{'model':db[_0xd46c('0x7a')],'as':_0xd46c('0x7c'),'attributes':['id',_0xd46c('0x44'),_0xd46c('0xb1'),'direction',_0xd46c('0xb2'),_0xd46c('0xb3')],'include':_0x36007f}];_0x486e94[_0xd46c('0xa3')]({'model':db[_0xd46c('0x48')],'as':_0xd46c('0xb4'),'attributes':['id',_0xd46c('0x2a')]});_0x486e94[_0xd46c('0xa3')]({'model':db[_0xd46c('0x7b')],'as':_0xd46c('0xb5'),'attributes':['id',_0xd46c('0x50')]});return db[_0xd46c('0x31')][_0xd46c('0x42')]({'where':{'id':_0x3037ef[_0xd46c('0x38')]['id']},'include':_0x486e94})[_0xd46c('0x16')](handleEntityNotFound(_0x2a7e65,null))['then'](function(_0x22acdf){if(_0x22acdf){var _0x20bd4b=_0x22acdf[_0xd46c('0xb6')]({'plain':!![]});fs[_0xd46c('0xb7')](_0x472f75);var _0x4a21d4={'channel':_0xd46c('0xb8'),'account':_0x20bd4b[_0xd46c('0xb4')][_0xd46c('0x2a')],'agent':_0x20bd4b['Owner']?_0x20bd4b['Owner'][_0xd46c('0x50')]:_0xd46c('0xb9'),'createdAt':moment(_0x20bd4b['createdAt'])[_0xd46c('0x76')](_0xd46c('0x9f'))[_0xd46c('0xba')](),'closedAt':_0x20bd4b[_0xd46c('0x65')]?moment(_0x20bd4b[_0xd46c('0xbb')])[_0xd46c('0x76')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd46c('0xba')]():'','disposition':_0x20bd4b[_0xd46c('0x66')],'chatInfo':{'browser':_0x20bd4b[_0xd46c('0xbc')],'os':_0x20bd4b[_0xd46c('0xbd')],'referer':_0x20bd4b[_0xd46c('0xbe')],'customerIp':_0x20bd4b['customerIp'],'customerPort':_0x20bd4b[_0xd46c('0xbf')]?_0x20bd4b['customerPort']:_0xd46c('0xb9')},'messages':_(_0x20bd4b[_0xd46c('0x7c')])['tail']()[_0xd46c('0x9b')]({'secret':![]})[_0xd46c('0x9d')](function(_0x32dc17){if(_0x32dc17[_0xd46c('0x6b')]){var _0x285d4f=path[_0xd46c('0x6f')](_0x1aeaf1,_0x32dc17[_0xd46c('0x6b')][_0xd46c('0x72')]);if(fs[_0xd46c('0xc0')](_0x285d4f)){fs[_0xd46c('0xc1')](_0x285d4f)[_0xd46c('0xc2')](fs[_0xd46c('0xc3')](path[_0xd46c('0x6f')](_0x472f75,_0x32dc17[_0xd46c('0x6b')][_0xd46c('0x72')])));}}return{'date':moment(_0x32dc17[_0xd46c('0xb1')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd46c('0xba')](),'sender':_0x32dc17[_0xd46c('0xc4')]===_0xd46c('0x5d')?_0x32dc17['User']?_0x32dc17[_0xd46c('0x7b')]['fullname']:_0xd46c('0x7e'):_0x32dc17[_0xd46c('0x61')]['firstName']+(_0x32dc17[_0xd46c('0x61')]['lastName']?'\x20'+_0x32dc17[_0xd46c('0x61')][_0xd46c('0xb0')]:''),'body':_0x32dc17[_0xd46c('0x6b')]?_0x32dc17['Attachment'][_0xd46c('0x72')]:_0x32dc17['body'],'direction':_0x32dc17[_0xd46c('0xc4')]===_0xd46c('0x5d')?'A':'C','secret':_0x32dc17[_0xd46c('0xb2')],'read':_0x32dc17['read'],'attachment':_0x32dc17[_0xd46c('0x6b')]};})[_0xd46c('0xc5')]()};return ejs[_0xd46c('0xc6')](path['join'](config['root'],_0xd46c('0xab'),_0xd46c('0xc7'),_0xd46c('0xc8')),{'interaction':_0x4a21d4})[_0xd46c('0x16')](function(_0x152de0){var _0x434f20=path['join'](_0x472f75,_0xd46c('0xc9')+_0x20bd4b['id']+'-'+_0x3389cd+_0xd46c('0xca'));var _0x293ce8={'path':_0x434f20,'channel':_0xd46c('0xb8'),'interactionId':_0x20bd4b['id']};return pdf['createPdfFromHTML'](_0x152de0,_0x293ce8);})[_0xd46c('0x16')](function(){return new Promise(function(_0x1854e7,_0x1c0d5d){zipdir(_0x472f75,{'saveTo':_0x435133},function(_0xea0465,_0x53028c){if(_0xea0465)return _0x1c0d5d(_0xea0465);return _0x1854e7(_0x53028c);});})[_0xd46c('0x16')](function(){return new BPromise(function(_0x3b6ff9,_0x469e2f){rimraf(_0x472f75,function(_0x3ff754){if(_0x3ff754)_0x469e2f(_0x3ff754);return _0x3b6ff9();});});})[_0xd46c('0x16')](function(){return _0x2a7e65[_0xd46c('0x73')](_0x435133,_0x578902,function(_0x5f054d){if(_0x5f054d){logger[_0xd46c('0x1d')](_0xd46c('0xcb'),_0x5f054d);}else{fs[_0xd46c('0xcc')](_0x435133);}});});});}else{return _0x2a7e65['sendStatus'](0xc8);}})[_0xd46c('0x1f')](handleError(_0x2a7e65,null));};
\ No newline at end of file
+var _0xd762=['../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','defaults','socket.io-emitter','./chatInteraction.socket','register','client','http','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','limit','count','set','Content-Range','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','map','rawAttributes','type','key','getOptions','findAll','query','user','show','keys','ChatInteraction','filters','intersection','model','attributes','fields','length','includeAll','include','options','create','find','params','describe','createVidaooSession','findOne','vidaooTopic','vidaooNote','vidaooApiKey','vidaooEscalation','fullname','email','POST','isNull','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','offline-chat/','join','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','%s%d','agentAlias','customer','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','push','alias','addTags','setTags','spread','color','chatInteractionTags:save','removeTags','toString','server','tmp','attachments','firstName','lastName','read','ChatWebsite','Owner','get','mkdirSync','Account','N.A.','browserName','referer','customerIp','customerPort','tail','basename','existsSync','createReadStream','createWriteStream','System','value','views','downloadInteraction.ejs','transcript-','.pdf','Chat','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','lodash','ioredis'];(function(_0x275745,_0x2df1dd){var _0xb260c1=function(_0x1ccbb8){while(--_0x1ccbb8){_0x275745['push'](_0x275745['shift']());}};_0xb260c1(++_0x2df1dd);}(_0xd762,0xc1));var _0x2d76=function(_0x296079,_0x14e860){_0x296079=_0x296079-0x0;var _0x268dda=_0xd762[_0x296079];return _0x268dda;};'use strict';var rimraf=require(_0x2d76('0x0'));var zipdir=require(_0x2d76('0x1'));var rp=require(_0x2d76('0x2'));var moment=require(_0x2d76('0x3'));var BPromise=require(_0x2d76('0x4'));var Mustache=require('mustache');var util=require(_0x2d76('0x5'));var path=require(_0x2d76('0x6'));var ejs=require(_0x2d76('0x7'));var fs=require('fs');var _=require(_0x2d76('0x8'));var Redis=require(_0x2d76('0x9'));var interaction=require('../../components/interaction/service');var qs=require(_0x2d76('0xa'));var pdf=require(_0x2d76('0xb'));var logger=require(_0x2d76('0xc'))(_0x2d76('0xd'));var config=require('../../config/environment');var db=require(_0x2d76('0xe'))['db'];config['redis']=_[_0x2d76('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2d76('0x10'))(new Redis(config['redis']));require(_0x2d76('0x11'))[_0x2d76('0x12')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2d76('0x13')][_0x2d76('0x14')]({'port':0x232b});var client9004=jayson[_0x2d76('0x13')][_0x2d76('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x355d92,_0x321277,_0x2282e2,_0x5976ec){return new BPromise(function(_0x5288df,_0x509f72){var _0x47d865=_0x5976ec||client;return _0x47d865['request'](_0x355d92,_0x2282e2)[_0x2d76('0x15')](function(_0x5d3b73){logger[_0x2d76('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x321277,_0x2d76('0x17'));logger[_0x2d76('0x18')](_0x2d76('0x19'),_0x321277,_0x2d76('0x17'),JSON[_0x2d76('0x1a')](_0x5d3b73));if(_0x5d3b73[_0x2d76('0x1b')]){if(_0x5d3b73[_0x2d76('0x1b')]['code']===0x1f4){logger['error'](_0x2d76('0x1c'),_0x321277,_0x5d3b73[_0x2d76('0x1b')]['message']);return _0x509f72(_0x5d3b73[_0x2d76('0x1b')][_0x2d76('0x1d')]);}logger[_0x2d76('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x321277,_0x5d3b73[_0x2d76('0x1b')][_0x2d76('0x1d')]);return _0x5288df(_0x5d3b73['error'][_0x2d76('0x1d')]);}else{logger[_0x2d76('0x16')](_0x2d76('0x1c'),_0x321277,_0x2d76('0x17'));_0x5288df(_0x5d3b73[_0x2d76('0x1e')][_0x2d76('0x1d')]);}})[_0x2d76('0x1f')](function(_0x566982){logger['error'](_0x2d76('0x1c'),_0x321277,_0x566982);_0x509f72(_0x566982);});});}function respondWithStatusCode(_0x19a4af,_0x49d666){_0x49d666=_0x49d666||0xcc;return function(_0x86a49f){if(_0x86a49f){return _0x19a4af[_0x2d76('0x20')](_0x49d666);}return _0x19a4af['status'](_0x49d666)[_0x2d76('0x21')]();};}function respondWithResult(_0x3df81c,_0x5cbc46){_0x5cbc46=_0x5cbc46||0xc8;return function(_0x4e2dae){if(_0x4e2dae){return _0x3df81c[_0x2d76('0x22')](_0x5cbc46)[_0x2d76('0x23')](_0x4e2dae);}};}function respondWithFilteredResult(_0x12622a,_0x48c276){return function(_0x2e99ab){if(_0x2e99ab){var _0x34a32c=typeof _0x48c276[_0x2d76('0x24')]==='undefined'&&typeof _0x48c276[_0x2d76('0x25')]==='undefined';var _0x13c81c=_0x2e99ab[_0x2d76('0x26')];var _0xcce04e=_0x34a32c?0x0:_0x48c276['offset'];var _0x1c8482=_0x34a32c?_0x2e99ab['count']:_0x48c276[_0x2d76('0x24')]+_0x48c276[_0x2d76('0x25')];var _0x48d348;if(_0x1c8482>=_0x13c81c){_0x1c8482=_0x13c81c;_0x48d348=0xc8;}else{_0x48d348=0xce;}_0x12622a[_0x2d76('0x22')](_0x48d348);return _0x12622a[_0x2d76('0x27')](_0x2d76('0x28'),_0xcce04e+'-'+_0x1c8482+'/'+_0x13c81c)['json'](_0x2e99ab);}return null;};}function saveUpdates(_0x2dccb2){return function(_0x2be574){if(_0x2be574){return _0x2be574[_0x2d76('0x29')](_0x2dccb2)[_0x2d76('0x15')](function(_0x611f04){return _0x611f04;});}return null;};}function removeEntity(_0x3f46ae){return function(_0x46ef14){if(_0x46ef14){return _0x46ef14[_0x2d76('0x2a')]()[_0x2d76('0x15')](function(){_0x3f46ae[_0x2d76('0x22')](0xcc)[_0x2d76('0x21')]();});}};}function handleEntityNotFound(_0x42a3d7){return function(_0x1db2c3){if(!_0x1db2c3){_0x42a3d7['sendStatus'](0x194);}return _0x1db2c3;};}function handleError(_0x2a13c3,_0xf2910b){_0xf2910b=_0xf2910b||0x1f4;return function(_0xfe895e){logger['error'](_0xfe895e[_0x2d76('0x2b')]);if(_0xfe895e[_0x2d76('0x2c')]){delete _0xfe895e['name'];}_0x2a13c3[_0x2d76('0x22')](_0xf2910b)[_0x2d76('0x2d')](_0xfe895e);};}function getMustacheRender(_0x45c27a,_0x1c6fbc){return Mustache[_0x2d76('0x2e')](_0x45c27a,_[_0x2d76('0x2f')](_0x1c6fbc[_0x2d76('0x30')],{'contact':_0x1c6fbc[_0x2d76('0x31')],'message':_0x1c6fbc[_0x2d76('0x1d')],'agent':_0x1c6fbc[_0x2d76('0x32')],'interaction':_0x1c6fbc[_0x2d76('0x33')],'account':_0x1c6fbc[_0x2d76('0x34')]}))||'';}exports['index']=function(_0x24a55c,_0x445299){var _0xd2202c={};var _0x56c004=_[_0x2d76('0x35')](db['ChatInteraction'][_0x2d76('0x36')],function(_0x25230c){return{'name':_0x25230c['fieldName'],'type':_0x25230c[_0x2d76('0x37')][_0x2d76('0x38')]};});_0xd2202c=qs[_0x2d76('0x39')](_0x56c004,_0x24a55c);return interaction[_0x2d76('0x3a')]('chat',_0x24a55c[_0x2d76('0x3b')],_0x24a55c[_0x2d76('0x3c')],_0xd2202c,_0x56c004)[_0x2d76('0x15')](respondWithFilteredResult(_0x445299,_0xd2202c))['catch'](handleError(_0x445299,null));};exports[_0x2d76('0x3d')]=function(_0x75e966,_0x54220c){var _0x335dca={'raw':![],'where':{'id':_0x75e966['params']['id']}},_0x5bbe9f={};_0x5bbe9f['model']=_[_0x2d76('0x3e')](db[_0x2d76('0x3f')]['rawAttributes']);_0x5bbe9f['query']=_[_0x2d76('0x3e')](_0x75e966[_0x2d76('0x3b')]);_0x5bbe9f[_0x2d76('0x40')]=_[_0x2d76('0x41')](_0x5bbe9f[_0x2d76('0x42')],_0x5bbe9f[_0x2d76('0x3b')]);_0x335dca[_0x2d76('0x43')]=_[_0x2d76('0x41')](_0x5bbe9f[_0x2d76('0x42')],qs[_0x2d76('0x44')](_0x75e966[_0x2d76('0x3b')][_0x2d76('0x44')]));_0x335dca[_0x2d76('0x43')]=_0x335dca[_0x2d76('0x43')][_0x2d76('0x45')]?_0x335dca['attributes']:_0x5bbe9f['model'];if(_0x75e966['query'][_0x2d76('0x46')]){_0x335dca[_0x2d76('0x47')]=[{'all':!![]}];}_0x335dca=_[_0x2d76('0x2f')]({},_0x335dca,_0x75e966[_0x2d76('0x48')]);return db['ChatInteraction']['find'](_0x335dca)[_0x2d76('0x15')](handleEntityNotFound(_0x54220c,null))[_0x2d76('0x15')](respondWithResult(_0x54220c,null))[_0x2d76('0x1f')](handleError(_0x54220c,null));};exports[_0x2d76('0x49')]=function(_0x4bafe1,_0x89e954){return db[_0x2d76('0x3f')][_0x2d76('0x49')](_0x4bafe1['body'],{})[_0x2d76('0x15')](respondWithResult(_0x89e954,0xc9))[_0x2d76('0x1f')](handleError(_0x89e954,null));};exports[_0x2d76('0x29')]=function(_0x22b54e,_0xbaa8cd){if(_0x22b54e[_0x2d76('0x30')]['id']){delete _0x22b54e[_0x2d76('0x30')]['id'];}return db['ChatInteraction'][_0x2d76('0x4a')]({'where':{'id':_0x22b54e[_0x2d76('0x4b')]['id']}})[_0x2d76('0x15')](handleEntityNotFound(_0xbaa8cd,null))[_0x2d76('0x15')](saveUpdates(_0x22b54e[_0x2d76('0x30')],null))[_0x2d76('0x15')](respondWithResult(_0xbaa8cd,null))['catch'](handleError(_0xbaa8cd,null));};exports[_0x2d76('0x2a')]=function(_0x2be3d7,_0x27b0b3){return db[_0x2d76('0x3f')][_0x2d76('0x4a')]({'where':{'id':_0x2be3d7[_0x2d76('0x4b')]['id']}})[_0x2d76('0x15')](handleEntityNotFound(_0x27b0b3,null))[_0x2d76('0x15')](removeEntity(_0x27b0b3,null))[_0x2d76('0x1f')](handleError(_0x27b0b3,null));};exports[_0x2d76('0x4c')]=function(_0x4910a9,_0x498629){return db['ChatInteraction'][_0x2d76('0x4c')]()[_0x2d76('0x15')](respondWithResult(_0x498629,null))[_0x2d76('0x1f')](handleError(_0x498629,null));};exports[_0x2d76('0x4d')]=function(_0x9d7308,_0x169fd9){var _0x2c50d3=_0x9d7308[_0x2d76('0x4b')]['id'];var _0x5e5963;var _0x281ccf;var _0x1ec588;return db[_0x2d76('0x3f')][_0x2d76('0x4e')]({'where':{'id':_0x2c50d3}})[_0x2d76('0x15')](function(_0x9c81e6){_0x5e5963=_0x9c81e6;return db['ChatWebsite']['findOne']({'where':{'id':_0x9c81e6['ChatWebsiteId']},'attributes':['id','vidaooApiKey','vidaooEscalation',_0x2d76('0x4f'),_0x2d76('0x50'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x3049c2){if(_0x3049c2&&_0x3049c2[_0x2d76('0x51')]&&_0x3049c2[_0x2d76('0x52')]){_0x281ccf=_0x3049c2;var _0x1f76de={'interaction':{'id':_0x2c50d3},'agent':{'id':_0x9d7308[_0x2d76('0x3c')]['id'],'name':_0x9d7308[_0x2d76('0x3c')][_0x2d76('0x2c')],'fullname':_0x9d7308[_0x2d76('0x3c')][_0x2d76('0x53')],'email':_0x9d7308[_0x2d76('0x3c')][_0x2d76('0x54')]},'contact':_0x9d7308['body']['contact'],'account':_0x9d7308['body'][_0x2d76('0x34')]};var _0x1ec0f1={'rejectUnauthorized':![],'method':_0x2d76('0x55'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3049c2[_0x2d76('0x51')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x9d7308[_0x2d76('0x3c')]['email']],'buttons':null,'topic':_0x281ccf[_0x2d76('0x4f')],'note':_[_0x2d76('0x56')](_0x281ccf[_0x2d76('0x50')])?null:getMustacheRender(_0x281ccf[_0x2d76('0x50')],_0x1f76de),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x2d76('0x56')](_0x281ccf[_0x2d76('0x57')])){var _0x5c1a38=getMustacheRender(_0x281ccf[_0x2d76('0x57')],_0x1f76de);var _0x1b174f=JSON['parse'](_0x5c1a38);_0x1ec0f1[_0x2d76('0x30')][_0x2d76('0x58')]=_0x1b174f;}}catch(_0x8239e0){throw new db[(_0x2d76('0x59'))][(_0x2d76('0x5a'))](_0x2d76('0x5b'));}return rp(_0x1ec0f1);}else{throw new db[(_0x2d76('0x59'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x2d76('0x15')](function(_0x190267){_0x1ec588=_0x190267;if(_0x1ec588['id']){var _0x278619={'body':_0x1ec588[_0x2d76('0x5c')],'ChatWebsiteId':_0x281ccf['id'],'ChatInteractionId':_0x5e5963['id'],'direction':_0x2d76('0x5d'),'UserId':_0x9d7308['user']['id']};return db[_0x2d76('0x5e')]['create'](_0x278619,{});}else{throw new db[(_0x2d76('0x59'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x2d76('0x15')](function(){return _0x5e5963[_0x2d76('0x5f')]({'vidaooSessionId':_0x1ec588['id']});})[_0x2d76('0x15')](respondWithResult(_0x169fd9,null))[_0x2d76('0x1f')](handleError(_0x169fd9,null));};exports[_0x2d76('0x60')]=function(_0x55284f,_0x2bc062){if(_0x55284f[_0x2d76('0x30')]['id']){delete _0x55284f[_0x2d76('0x30')]['id'];}return db[_0x2d76('0x3f')]['find']({'where':{'id':_0x55284f[_0x2d76('0x4b')]['id']},'include':[{'model':db[_0x2d76('0x61')],'as':_0x2d76('0x62')}]})[_0x2d76('0x15')](handleEntityNotFound(_0x2bc062,null))[_0x2d76('0x15')](saveUpdates(_0x55284f[_0x2d76('0x30')],null))[_0x2d76('0x15')](respondWithResult(_0x2bc062,null))[_0x2d76('0x1f')](handleError(_0x2bc062,null));};exports[_0x2d76('0x63')]=function(_0x443308,_0x4afbda){if(_0x443308[_0x2d76('0x30')]['id']){delete _0x443308[_0x2d76('0x30')]['id'];}return db[_0x2d76('0x3f')][_0x2d76('0x4a')]({'where':{'id':_0x443308['params']['id']}})[_0x2d76('0x15')](function(_0x1cc6fb){if(!_0x1cc6fb){logger[_0x2d76('0x1b')](_0x2d76('0x64'),_0x2d76('0x63'),0x194,_0x2d76('0x65'));_0x4afbda[_0x2d76('0x20')](0x194);}else{if(_0x1cc6fb[_0x2d76('0x66')]){throw new db[(_0x2d76('0x59'))][(_0x2d76('0x5a'))](_0x2d76('0x67'));}}return _0x1cc6fb;})[_0x2d76('0x15')](function(_0x4d5949){if(_0x4d5949){return _0x4d5949['update']({'closed':_0x443308[_0x2d76('0x30')][_0x2d76('0x68')],'disposition':_0x443308['body'][_0x2d76('0x69')]})[_0x2d76('0x15')](function(_0x418647){return _0x418647;});}})[_0x2d76('0x15')](function(){return respondWithRpcPromise(_0x2d76('0x6a'),'abandon',_0x443308[_0x2d76('0x30')],client9004);})['then'](respondWithResult(_0x4afbda,null))[_0x2d76('0x1f')](handleError(_0x4afbda,null));};exports[_0x2d76('0x6b')]=function(_0xba05af,_0x3d1cc1){_0xba05af[_0x2d76('0x30')][_0x2d76('0x2c')]=_0xba05af[_0x2d76('0x6c')][_0x2d76('0x6d')];_0xba05af['body']['basename']=_0xba05af['file'][_0x2d76('0x6e')];_0xba05af[_0x2d76('0x30')]['type']=_0xba05af['file'][_0x2d76('0x6f')];return db[_0x2d76('0x70')][_0x2d76('0x49')](_0xba05af[_0x2d76('0x30')])[_0x2d76('0x15')](respondWithResult(_0x3d1cc1,0xc9))[_0x2d76('0x1f')](handleError(_0x3d1cc1,null));};exports[_0x2d76('0x71')]=function(_0xf7be3c,_0x1f5019){return db[_0x2d76('0x3f')][_0x2d76('0x4e')]({'where':{'id':_0xf7be3c['params']['id']},'raw':!![]})[_0x2d76('0x15')](handleEntityNotFound(_0x1f5019,null))[_0x2d76('0x15')](function(_0xa03891){if(_0xa03891){if(_0xa03891[_0x2d76('0x68')]){return _0x1f5019[_0x2d76('0x22')](0x193)[_0x2d76('0x23')]({'status':0x193,'message':_0x2d76('0x72')});}return db[_0x2d76('0x70')][_0x2d76('0x4e')]({'where':{'id':_0xf7be3c[_0x2d76('0x3b')]['attachId']},'raw':!![]})[_0x2d76('0x15')](handleEntityNotFound(_0x1f5019,null));}})[_0x2d76('0x15')](function(_0x392a8f){if(_0x392a8f){var _0x3297fb=_0x392a8f[_0x2d76('0x73')]!==null;var _0x5b553e=path['join'](config['root'],'server/files/attachments/');if(_0x3297fb){_0x5b553e=path['join'](_0x5b553e,_0x2d76('0x74'));}var _0x590340=path[_0x2d76('0x75')](_0x5b553e,_0x392a8f['basename']);return _0x1f5019[_0x2d76('0x76')](_0x590340);}})['catch'](handleError(_0x1f5019,null));};exports[_0x2d76('0x77')]=function(_0x13ddac,_0x9ce99){var _0x562c4d=null;var _0x31015f=null;var _0x48103d=null;if(_0x13ddac[_0x2d76('0x30')]['id']){delete _0x13ddac[_0x2d76('0x30')]['id'];}if(_0x13ddac[_0x2d76('0x30')][_0x2d76('0x78')]){_0x48103d=path['join'](config[_0x2d76('0x79')],_0x2d76('0x7a'),util[_0x2d76('0x7b')](_0x2d76('0x7c'),Date[_0x2d76('0x7d')]()));_0x13ddac[_0x2d76('0x30')][_0x2d76('0x7e')]=_0x48103d;}return db[_0x2d76('0x3f')][_0x2d76('0x4a')]({'where':{'id':_0x13ddac[_0x2d76('0x4b')]['id']},'include':[{'model':db[_0x2d76('0x5e')],'as':_0x2d76('0x7f'),'include':[{'model':db[_0x2d76('0x80')],'as':'User'}]}]})[_0x2d76('0x15')](handleEntityNotFound(_0x9ce99,null))['then'](saveUpdates(_0x13ddac[_0x2d76('0x30')],null))['then'](function(_0x3b7b24){if(_0x3b7b24){_0x562c4d=_0x3b7b24;return db['ChatWebsite'][_0x2d76('0x4a')]({'where':{'id':_0x562c4d['ChatWebsiteId']}});}})[_0x2d76('0x15')](function(_0x5c2efb){if(_0x5c2efb){_0x31015f=_0x5c2efb;return db[_0x2d76('0x61')][_0x2d76('0x4a')]({'where':{'id':_0x562c4d[_0x2d76('0x81')]}});}})['then'](function(_0x4cf3bc){if(_0x4cf3bc){if(_0x48103d){var _0x4fa6fd=null;for(var _0x1255dd=0x1;_0x1255dd<_0x562c4d[_0x2d76('0x7f')][_0x2d76('0x45')];++_0x1255dd){_0x4fa6fd=_0x562c4d[_0x2d76('0x7f')][_0x1255dd];var _0x2c6f47=_0x4fa6fd['UserId']?util[_0x2d76('0x7b')](_0x2d76('0x82'),_0x31015f[_0x2d76('0x83')],_0x4fa6fd['UserId']):'System';var _0x4ad94b=_0x13ddac['body'][_0x2d76('0x84')]||util['format'](_0x2d76('0x82'),'Visitor',_0x4fa6fd[_0x2d76('0x81')]);switch(_0x31015f['agentIdentifier']){case _0x2d76('0x85'):_0x2c6f47=_0x4fa6fd['UserId']?util['format'](_0x2d76('0x82'),_0x31015f[_0x2d76('0x83')],_0x4fa6fd['UserId']):'System';break;case _0x2d76('0x86'):_0x2c6f47=_0x4fa6fd['UserId']?_0x4fa6fd[_0x2d76('0x80')]['alias']||_0x4fa6fd[_0x2d76('0x80')][_0x2d76('0x53')]:'System';break;case _0x2d76('0x87'):_0x2c6f47=_0x4fa6fd[_0x2d76('0x66')]?_0x4fa6fd[_0x2d76('0x80')][_0x2d76('0x53')]:'System';break;default:_0x2c6f47=_0x4fa6fd[_0x2d76('0x66')]?util['format'](_0x2d76('0x82'),_0x31015f['agentAlias'],_0x4fa6fd[_0x2d76('0x66')]):'System';}var _0x2bb942=util[_0x2d76('0x7b')](_0x2d76('0x88'),moment(_0x4fa6fd[_0x2d76('0x89')])[_0x2d76('0x7b')](_0x2d76('0x8a')),_0x4fa6fd[_0x2d76('0x8b')]==='in'?_0x4ad94b:_0x2c6f47,_0x4fa6fd[_0x2d76('0x30')]);if(!_0x4fa6fd[_0x2d76('0x8c')]){fs['appendFileSync'](_0x48103d,_0x2bb942);}}return db[_0x2d76('0x8d')][_0x2d76('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x2d76('0x8e')],'as':_0x2d76('0x8f'),'raw':!![],'include':[{'model':db[_0x2d76('0x90')],'as':_0x2d76('0x90'),'raw':!![]}]}]});}}})[_0x2d76('0x15')](function(_0x359721){if(!_0x359721||!_0x359721[_0x2d76('0x8f')]||!_0x13ddac[_0x2d76('0x30')])return _0x562c4d;var _0x531e31=_0x359721['getSmtpOptions']();return respondWithRpcPromise(_0x2d76('0x91'),_0x2d76('0x92'),{'account':_0x531e31,'message':{'from':util[_0x2d76('0x7b')]('\x22%s\x22\x20<%s>',_0x359721[_0x2d76('0x2c')],_0x359721[_0x2d76('0x54')]||_0x359721[_0x2d76('0x8f')][_0x2d76('0x3c')]),'to':_0x13ddac[_0x2d76('0x30')][_0x2d76('0x78')],'subject':_0x2d76('0x93'),'text':util[_0x2d76('0x7b')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x13ddac['body']['mailTranscript']),'attachments':[{'path':_0x48103d}]}})[_0x2d76('0x15')](function(){return _0x562c4d;})['catch'](function(_0x56f272){logger['error'](_0x56f272);});})[_0x2d76('0x15')](respondWithStatusCode(_0x9ce99,0xc8))['catch'](handleError(_0x9ce99,null));};exports[_0x2d76('0x94')]=function(_0x577af6,_0x5a864b){return db['ChatMessage'][_0x2d76('0x4a')]({'where':{'id':_0x577af6['params']['id']}})[_0x2d76('0x15')](handleEntityNotFound(_0x5a864b,null))[_0x2d76('0x15')](function(_0x47dc74){if(_0x47dc74){return _0x47dc74[_0x2d76('0x94')](_0x577af6[_0x2d76('0x30')][_0x2d76('0x95')],_[_0x2d76('0x96')](_0x577af6[_0x2d76('0x30')],[_0x2d76('0x95'),'id'])||{});}})[_0x2d76('0x15')](respondWithResult(_0x5a864b,null))[_0x2d76('0x1f')](handleError(_0x5a864b,null));};exports[_0x2d76('0x97')]=function(_0x1c664d,_0xd98011){var _0x456894={'raw':![],'where':{}};var _0x18eb1f={};var _0x987363={'count':0x0,'rows':[]};return db[_0x2d76('0x3f')][_0x2d76('0x4e')]({'where':{'id':_0x1c664d['params']['id']}})[_0x2d76('0x15')](handleEntityNotFound(_0xd98011,null))[_0x2d76('0x15')](function(_0x2dff98){if(_0x2dff98){_0x18eb1f[_0x2d76('0x42')]=_[_0x2d76('0x3e')](db[_0x2d76('0x5e')][_0x2d76('0x36')]);_0x18eb1f['query']=_[_0x2d76('0x3e')](_0x1c664d[_0x2d76('0x3b')]);_0x18eb1f[_0x2d76('0x40')]=_[_0x2d76('0x41')](_0x18eb1f[_0x2d76('0x42')],_0x18eb1f[_0x2d76('0x3b')]);_0x456894[_0x2d76('0x43')]=_[_0x2d76('0x41')](_0x18eb1f[_0x2d76('0x42')],qs[_0x2d76('0x44')](_0x1c664d[_0x2d76('0x3b')]['fields']));_0x456894[_0x2d76('0x43')]=_0x456894['attributes'][_0x2d76('0x45')]?_0x456894['attributes']:_0x18eb1f[_0x2d76('0x42')];if(!_0x1c664d['query'][_0x2d76('0x98')](_0x2d76('0x99'))){_0x456894['limit']=qs[_0x2d76('0x25')](_0x1c664d[_0x2d76('0x3b')]['limit']);_0x456894[_0x2d76('0x24')]=qs['offset'](_0x1c664d[_0x2d76('0x3b')][_0x2d76('0x24')]);}_0x456894[_0x2d76('0x9a')]=qs['sort'](_0x1c664d[_0x2d76('0x3b')][_0x2d76('0x9b')]);_0x456894[_0x2d76('0x9c')]=qs['filters'](_[_0x2d76('0x9d')](_0x1c664d['query'],_0x18eb1f[_0x2d76('0x40')]));_0x456894[_0x2d76('0x9c')]['ChatInteractionId']=_0x2dff98['id'];if(_0x1c664d[_0x2d76('0x3b')][_0x2d76('0x9e')]){_0x456894['where']=_['merge'](_0x456894['where'],{'$or':_[_0x2d76('0x35')](_0x456894[_0x2d76('0x43')],function(_0x18c846){var _0xe1a121={};_0xe1a121[_0x18c846]={'$like':'%'+_0x1c664d[_0x2d76('0x3b')][_0x2d76('0x9e')]+'%'};return _0xe1a121;})});}if(_0x1c664d[_0x2d76('0x3b')][_0x2d76('0x9f')]){var _0x38c5fd=_0x1c664d[_0x2d76('0x3b')][_0x2d76('0x9f')][_0x2d76('0xa0')](',');var _0x216df3={};_0x216df3[_0x38c5fd[0x0]]={'$gte':moment(_0x38c5fd[0x1])[_0x2d76('0x7b')](_0x2d76('0xa1'))};_0x456894[_0x2d76('0x9c')]=_[_0x2d76('0x2f')](_0x456894[_0x2d76('0x9c')],_0x216df3);}_0x456894=_[_0x2d76('0x2f')]({},_0x456894,_0x1c664d[_0x2d76('0x48')]);return db[_0x2d76('0x5e')][_0x2d76('0x26')]({'where':_0x456894[_0x2d76('0x9c')]})[_0x2d76('0x15')](function(_0x1969e5){_0x987363[_0x2d76('0x26')]=_0x1969e5;if(_0x1c664d[_0x2d76('0x3b')][_0x2d76('0x46')]){_0x456894[_0x2d76('0x47')]=[{'all':!![]}];}return db[_0x2d76('0x5e')][_0x2d76('0x3a')](_0x456894);})[_0x2d76('0x15')](function(_0x5d68c8){_0x987363[_0x2d76('0xa2')]=_0x5d68c8;return _0x987363;});}})['then'](respondWithFilteredResult(_0xd98011,_0x456894))['catch'](handleError(_0xd98011,null));};exports[_0x2d76('0xa3')]=function(_0x5582d8,_0x33b431){var _0x32fdd0={'where':{}},_0x34f062={},_0x669b8c={'count':0x0,'rows':[]};return db[_0x2d76('0x3f')][_0x2d76('0x4e')]({'where':{'id':_0x5582d8['params']['id']}})[_0x2d76('0x15')](handleEntityNotFound(_0x33b431,null))[_0x2d76('0x15')](function(_0x5e7bb5){if(_0x5e7bb5){_0x34f062[_0x2d76('0x42')]=_[_0x2d76('0x3e')](db[_0x2d76('0x5e')][_0x2d76('0x36')]);_0x34f062['query']=_['keys'](_0x5582d8[_0x2d76('0x3b')]);_0x34f062[_0x2d76('0x40')]=_[_0x2d76('0x41')](_0x34f062[_0x2d76('0x42')],_0x34f062[_0x2d76('0x3b')]);_0x32fdd0['attributes']=_[_0x2d76('0x41')](_0x34f062[_0x2d76('0x42')],qs[_0x2d76('0x44')](_0x5582d8['query'][_0x2d76('0x44')]));_0x32fdd0[_0x2d76('0x43')]=_0x32fdd0[_0x2d76('0x43')][_0x2d76('0x45')]?_0x32fdd0['attributes']:_0x34f062[_0x2d76('0x42')];if(!_0x5582d8[_0x2d76('0x3b')][_0x2d76('0x98')](_0x2d76('0x99'))){_0x32fdd0[_0x2d76('0x25')]=qs[_0x2d76('0x25')](_0x5582d8[_0x2d76('0x3b')][_0x2d76('0x25')]);_0x32fdd0[_0x2d76('0x24')]=qs[_0x2d76('0x24')](_0x5582d8[_0x2d76('0x3b')]['offset']);}_0x32fdd0['order']=qs['sort'](_0x5582d8[_0x2d76('0x3b')][_0x2d76('0x9b')]);_0x32fdd0['where']=qs[_0x2d76('0x40')](_[_0x2d76('0x9d')](_0x5582d8[_0x2d76('0x3b')],_0x34f062[_0x2d76('0x40')]));_0x32fdd0[_0x2d76('0x9c')]['ChatInteractionId']=_0x5e7bb5['id'];if(_0x5582d8[_0x2d76('0x3b')]['filter']){_0x32fdd0[_0x2d76('0x9c')]=_[_0x2d76('0x2f')](_0x32fdd0[_0x2d76('0x9c')],{'$or':_[_0x2d76('0x35')](_0x32fdd0['attributes'],function(_0x33a1a5){var _0x27e791={};_0x27e791[_0x33a1a5]={'$like':'%'+_0x5582d8[_0x2d76('0x3b')]['filter']+'%'};return _0x27e791;})});}_0x32fdd0[_0x2d76('0x9c')][_0x2d76('0x8c')]=![];if(_0x5582d8[_0x2d76('0x3b')]['id']){_0x32fdd0[_0x2d76('0x9c')]['id']={'$gt':_0x5582d8[_0x2d76('0x3b')]['id']};}_0x32fdd0=_[_0x2d76('0x2f')]({},_0x32fdd0,_0x5582d8[_0x2d76('0x48')]);return db[_0x2d76('0x5e')][_0x2d76('0x26')]({'where':_0x32fdd0[_0x2d76('0x9c')]})['then'](function(_0x82f306){_0x669b8c[_0x2d76('0x26')]=_0x82f306;_0x32fdd0[_0x2d76('0x47')]=[];if(_0x5582d8['query']['includeAgent']){_0x32fdd0[_0x2d76('0x47')][_0x2d76('0xa4')]({'model':db[_0x2d76('0x80')],'as':_0x2d76('0x80'),'attributes':['id',_0x2d76('0x53'),_0x2d76('0xa5')]});}if(_0x5582d8['query']['includeAll']){_0x32fdd0['include']=[{'all':!![]}];}return db[_0x2d76('0x5e')][_0x2d76('0x3a')](_0x32fdd0);})['then'](function(_0x206879){_0x669b8c[_0x2d76('0xa2')]=_0x206879;return _0x669b8c;});}})[_0x2d76('0x15')](respondWithFilteredResult(_0x33b431,_0x32fdd0))[_0x2d76('0x1f')](handleError(_0x33b431,null));};exports[_0x2d76('0xa6')]=function(_0x3dd41c,_0x4e32ee){return db['ChatInteraction'][_0x2d76('0x4a')]({'where':{'id':_0x3dd41c[_0x2d76('0x4b')]['id']}})[_0x2d76('0x15')](handleEntityNotFound(_0x4e32ee,null))[_0x2d76('0x15')](function(_0xa7cb56){if(_0xa7cb56){return _0xa7cb56[_0x2d76('0xa7')](_0x3dd41c[_0x2d76('0x30')][_0x2d76('0x95')],_['omit'](_0x3dd41c[_0x2d76('0x30')],[_0x2d76('0x95'),'id'])||{})[_0x2d76('0xa8')](function(){return db['Tag']['findAll']({'attributes':['id',_0x2d76('0x2c'),_0x2d76('0xa9')],'where':{'id':_0x3dd41c[_0x2d76('0x30')][_0x2d76('0x95')]}});})[_0x2d76('0x15')](function(_0x4019af){socket['emit'](_0x2d76('0xaa'),{'id':Number(_0x3dd41c['params']['id']),'tags':_0x4019af||[]});return{'id':Number(_0x3dd41c[_0x2d76('0x4b')]['id']),'tags':_0x4019af||[]};});}})[_0x2d76('0x15')](respondWithResult(_0x4e32ee,null))[_0x2d76('0x1f')](handleError(_0x4e32ee,null));};exports['removeTags']=function(_0x1b6f1d,_0x2143fb){return db[_0x2d76('0x3f')][_0x2d76('0x4a')]({'where':{'id':_0x1b6f1d[_0x2d76('0x4b')]['id']}})[_0x2d76('0x15')](handleEntityNotFound(_0x2143fb,null))[_0x2d76('0x15')](function(_0x555f9e){if(_0x555f9e){return _0x555f9e[_0x2d76('0xab')](_0x1b6f1d[_0x2d76('0x3b')]['ids']);}})[_0x2d76('0x15')](respondWithStatusCode(_0x2143fb,null))['catch'](handleError(_0x2143fb,null));};exports[_0x2d76('0x76')]=function(_0x1c9f70,_0x22ff76){var _0x1ed890=moment()['unix']()[_0x2d76('0xac')]();var _0x9142d4=path[_0x2d76('0x75')](config['root'],_0x2d76('0xad'),'files',_0x2d76('0xae'));var _0x2439ca=path['join'](config[_0x2d76('0x79')],_0x2d76('0xad'),'files',_0x2d76('0xaf'));var _0x57952=path['join'](_0x9142d4,_0x1ed890);var _0x247fec=util[_0x2d76('0x7b')]('transcript-%d-%s.zip',_0x1c9f70[_0x2d76('0x4b')]['id'],_0x1ed890);var _0x3d35d8=path['join'](_0x9142d4,_0x247fec);var _0x5889ab=[];_0x5889ab[_0x2d76('0xa4')]({'model':db[_0x2d76('0x80')],'as':_0x2d76('0x80'),'attributes':['id',_0x2d76('0x53')],'raw':!![]});_0x5889ab[_0x2d76('0xa4')]({'model':db[_0x2d76('0x61')],'as':_0x2d76('0x62'),'attributes':['id',_0x2d76('0xb0'),_0x2d76('0xb1')],'raw':!![]});if(_0x1c9f70[_0x2d76('0x3b')]['attachments']){_0x5889ab['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x3d2542=[{'model':db[_0x2d76('0x5e')],'as':_0x2d76('0x7f'),'attributes':['id','body',_0x2d76('0x89'),_0x2d76('0x8b'),'secret',_0x2d76('0xb2')],'include':_0x5889ab}];_0x3d2542['push']({'model':db[_0x2d76('0xb3')],'as':'Account','attributes':['id',_0x2d76('0x2c')]});_0x3d2542[_0x2d76('0xa4')]({'model':db[_0x2d76('0x80')],'as':_0x2d76('0xb4'),'attributes':['id','fullname']});return db[_0x2d76('0x3f')][_0x2d76('0x4a')]({'where':{'id':_0x1c9f70[_0x2d76('0x4b')]['id']},'include':_0x3d2542})[_0x2d76('0x15')](handleEntityNotFound(_0x22ff76,null))[_0x2d76('0x15')](function(_0x2f3fab){if(_0x2f3fab){var _0x3af6b=_0x2f3fab[_0x2d76('0xb5')]({'plain':!![]});fs[_0x2d76('0xb6')](_0x57952);var _0x5822f2={'channel':'Chat','account':_0x3af6b[_0x2d76('0xb7')][_0x2d76('0x2c')],'agent':_0x3af6b[_0x2d76('0xb4')]?_0x3af6b[_0x2d76('0xb4')]['fullname']:_0x2d76('0xb8'),'createdAt':moment(_0x3af6b['createdAt'])[_0x2d76('0x7b')](_0x2d76('0xa1'))[_0x2d76('0xac')](),'closedAt':_0x3af6b[_0x2d76('0x68')]?moment(_0x3af6b['closedAt'])[_0x2d76('0x7b')](_0x2d76('0xa1'))[_0x2d76('0xac')]():'','disposition':_0x3af6b[_0x2d76('0x69')],'chatInfo':{'browser':_0x3af6b[_0x2d76('0xb9')],'os':_0x3af6b['osName'],'referer':_0x3af6b[_0x2d76('0xba')],'customerIp':_0x3af6b[_0x2d76('0xbb')],'customerPort':_0x3af6b[_0x2d76('0xbc')]?_0x3af6b['customerPort']:'N.A.'},'messages':_(_0x3af6b[_0x2d76('0x7f')])[_0x2d76('0xbd')]()[_0x2d76('0x9e')]({'secret':![]})['map'](function(_0x5d5c44){if(_0x5d5c44[_0x2d76('0x70')]){var _0x119cd0=path[_0x2d76('0x75')](_0x2439ca,_0x5d5c44['Attachment'][_0x2d76('0xbe')]);if(fs[_0x2d76('0xbf')](_0x119cd0)){fs[_0x2d76('0xc0')](_0x119cd0)['pipe'](fs[_0x2d76('0xc1')](path[_0x2d76('0x75')](_0x57952,_0x5d5c44[_0x2d76('0x70')]['basename'])));}}return{'date':moment(_0x5d5c44[_0x2d76('0x89')])[_0x2d76('0x7b')](_0x2d76('0xa1'))[_0x2d76('0xac')](),'sender':_0x5d5c44[_0x2d76('0x8b')]===_0x2d76('0x5d')?_0x5d5c44[_0x2d76('0x80')]?_0x5d5c44[_0x2d76('0x80')]['fullname']:_0x2d76('0xc2'):_0x5d5c44[_0x2d76('0x62')][_0x2d76('0xb0')]+(_0x5d5c44[_0x2d76('0x62')]['lastName']?'\x20'+_0x5d5c44[_0x2d76('0x62')][_0x2d76('0xb1')]:''),'body':_0x5d5c44[_0x2d76('0x70')]?_0x5d5c44['Attachment']['basename']:_0x5d5c44['body'],'direction':_0x5d5c44[_0x2d76('0x8b')]===_0x2d76('0x5d')?'A':'C','secret':_0x5d5c44[_0x2d76('0x8c')],'read':_0x5d5c44[_0x2d76('0xb2')],'attachment':_0x5d5c44[_0x2d76('0x70')]};})[_0x2d76('0xc3')]()};return ejs['renderFile'](path[_0x2d76('0x75')](config['root'],_0x2d76('0xad'),_0x2d76('0xc4'),_0x2d76('0xc5')),{'interaction':_0x5822f2})[_0x2d76('0x15')](function(_0x4fdfa9){var _0x315e74=path[_0x2d76('0x75')](_0x57952,_0x2d76('0xc6')+_0x3af6b['id']+'-'+_0x1ed890+_0x2d76('0xc7'));var _0x489167={'path':_0x315e74,'channel':_0x2d76('0xc8'),'interactionId':_0x3af6b['id']};return pdf['createPdfFromHTML'](_0x4fdfa9,_0x489167);})[_0x2d76('0x15')](function(){return new Promise(function(_0x6d7cc8,_0x554d68){zipdir(_0x57952,{'saveTo':_0x3d35d8},function(_0x280b57,_0x1e6225){if(_0x280b57)return _0x554d68(_0x280b57);return _0x6d7cc8(_0x1e6225);});})['then'](function(){return new BPromise(function(_0xa3d2d3,_0x467dc7){rimraf(_0x57952,function(_0xfd4f82){if(_0xfd4f82)_0x467dc7(_0xfd4f82);return _0xa3d2d3();});});})[_0x2d76('0x15')](function(){return _0x22ff76[_0x2d76('0x76')](_0x3d35d8,_0x247fec,function(_0x14a75d){if(_0x14a75d){logger[_0x2d76('0x1b')](_0x2d76('0xc9'),_0x14a75d);}else{fs[_0x2d76('0xca')](_0x3d35d8);}});});});}else{return _0x22ff76[_0x2d76('0x20')](0xc8);}})[_0x2d76('0x1f')](handleError(_0x22ff76,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index e347cee..85032f5 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 _0x3a85=['ChatInteraction','save','update','remove','then','setDataValue','Users','map','findAll','length','emit','hook','exports','events','../../mysqldb'];(function(_0x181b23,_0x3ed1a2){var _0x29bd87=function(_0x5a522a){while(--_0x5a522a){_0x181b23['push'](_0x181b23['shift']());}};_0x29bd87(++_0x3ed1a2);}(_0x3a85,0xb2));var _0x53a8=function(_0xb79b1a,_0x87ee78){_0xb79b1a=_0xb79b1a-0x0;var _0x1c28a7=_0x3a85[_0xb79b1a];return _0x1c28a7;};'use strict';var EventEmitter=require(_0x53a8('0x0'));var ChatInteraction=require(_0x53a8('0x1'))['db'][_0x53a8('0x2')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x53a8('0x3'),'afterUpdate':_0x53a8('0x4'),'afterDestroy':_0x53a8('0x5')};function emitEvent(_0x5589b3){return function(_0x193d44,_0xb6e903,_0x5e93d8){_0x193d44['getUsers']({'attributes':['id'],'raw':!![]})[_0x53a8('0x6')](function(_0x4bd398){_0x193d44[_0x53a8('0x7')](_0x53a8('0x8'),_0x4bd398[_0x53a8('0x9')](function(_0x2c94eb){return{'id':_0x2c94eb['id']};}));return ChatMessage[_0x53a8('0xa')]({'where':{'ChatInteractionId':_0x193d44['id'],'direction':'in','read':![]},'raw':!![]});})[_0x53a8('0x6')](function(_0x53cdf1){_0x193d44[_0x53a8('0x7')]('unreadMessages',_0x53cdf1[_0x53a8('0xb')]);ChatInteractionEvents[_0x53a8('0xc')](_0x5589b3+':'+_0x193d44['id'],_0x193d44);ChatInteractionEvents[_0x53a8('0xc')](_0x5589b3,_0x193d44);_0x5e93d8(null);})['catch'](_0x5e93d8(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x53a8('0xd')](e,emitEvent(event));}}module[_0x53a8('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xc629=['Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','getUsers','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc629,0xb6));var _0x9c62=function(_0x63a69b,_0x296888){_0x63a69b=_0x63a69b-0x0;var _0x425fa1=_0xc629[_0x63a69b];return _0x425fa1;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x9c62('0x0'))['db'][_0x9c62('0x1')];var ChatMessage=require(_0x9c62('0x0'))['db'][_0x9c62('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x9c62('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9c62('0x4'),'afterDestroy':_0x9c62('0x5')};function emitEvent(_0x43843b){return function(_0x467a62,_0x4e479f,_0x233cf6){_0x467a62[_0x9c62('0x6')]({'attributes':['id'],'raw':!![]})[_0x9c62('0x7')](function(_0xc5ec41){_0x467a62['setDataValue'](_0x9c62('0x8'),_0xc5ec41[_0x9c62('0x9')](function(_0x30e90b){return{'id':_0x30e90b['id']};}));return ChatMessage[_0x9c62('0xa')]({'where':{'ChatInteractionId':_0x467a62['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9c62('0x7')](function(_0x5d662a){_0x467a62[_0x9c62('0xb')](_0x9c62('0xc'),_0x5d662a[_0x9c62('0xd')]);ChatInteractionEvents[_0x9c62('0xe')](_0x43843b+':'+_0x467a62['id'],_0x467a62);ChatInteractionEvents[_0x9c62('0xe')](_0x43843b,_0x467a62);_0x233cf6(null);})[_0x9c62('0xf')](_0x233cf6(null));};}for(var e in events){if(events[_0x9c62('0x10')](e)){var event=events[e];ChatInteraction[_0x9c62('0x11')](e,emitEvent(event));}}module[_0x9c62('0x12')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 27f0de5..d8e95d8 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 _0xd45c=['exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xd45c,0x19a));var _0xcd45=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd45c[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xcd45('0x0'));var util=require('util');var logger=require(_0xcd45('0x1'))(_0xcd45('0x2'));var moment=require(_0xcd45('0x3'));var BPromise=require('bluebird');var rp=require(_0xcd45('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd45('0x5'));var config=require(_0xcd45('0x6'));var attributes=require(_0xcd45('0x7'));module[_0xcd45('0x8')]=function(_0x50ab5c,_0xfe4299){return _0x50ab5c[_0xcd45('0x9')](_0xcd45('0xa'),attributes,{'tableName':_0xcd45('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x176dc6,_0x230051,_0x111c95){if(_0x176dc6[_0xcd45('0xc')](_0xcd45('0xd'))){_0x176dc6[_0xcd45('0xe')]=moment()[_0xcd45('0xf')](_0xcd45('0x10'));}_0x111c95(null,_0x176dc6);}},'charset':_0xcd45('0x11'),'collate':_0xcd45('0x12')});};
\ No newline at end of file
+var _0xf9fb=['ChatInteraction','changed','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','api','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf9fb,0x147));var _0xbf9f=function(_0x53934d,_0xaba2c){_0x53934d=_0x53934d-0x0;var _0x169c7d=_0xf9fb[_0x53934d];return _0x169c7d;};'use strict';var _=require(_0xbf9f('0x0'));var util=require(_0xbf9f('0x1'));var logger=require('../../config/logger')(_0xbf9f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf9f('0x3'));var rimraf=require(_0xbf9f('0x4'));var config=require(_0xbf9f('0x5'));var attributes=require(_0xbf9f('0x6'));module[_0xbf9f('0x7')]=function(_0x4782ea,_0x212aef){return _0x4782ea[_0xbf9f('0x8')](_0xbf9f('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x96edc8,_0x487edf,_0x1295b2){if(_0x96edc8[_0xbf9f('0xa')](_0xbf9f('0xb'))){_0x96edc8['closedAt']=moment()['format'](_0xbf9f('0xc'));}_0x1295b2(null,_0x96edc8);}},'charset':'utf8mb4','collate':_0xbf9f('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 0eab88f..90bd4b3 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 _0x7ae6=['attributes','limit','then','stringify','AddTagsToChatInteraction','find','addTags','body','ids','omit','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','redis','localhost','./chatInteraction.socket','request','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message','info','result','UpdateChatInteraction','ChatInteraction','update','options','where'];(function(_0x2f4897,_0xd541c5){var _0x4221b1=function(_0x535bb0){while(--_0x535bb0){_0x2f4897['push'](_0x2f4897['shift']());}};_0x4221b1(++_0xd541c5);}(_0x7ae6,0x159));var _0x67ae=function(_0xb52dca,_0x4bfc45){_0xb52dca=_0xb52dca-0x0;var _0x494531=_0x7ae6[_0xb52dca];return _0x494531;};'use strict';var _=require('lodash');var util=require(_0x67ae('0x0'));var moment=require(_0x67ae('0x1'));var BPromise=require('bluebird');var rs=require(_0x67ae('0x2'));var fs=require('fs');var Redis=require(_0x67ae('0x3'));var db=require(_0x67ae('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x67ae('0x5'));var jayson=require(_0x67ae('0x6'));var client=jayson['client'][_0x67ae('0x7')]({'port':0x232a});config[_0x67ae('0x8')]=_['defaults'](config[_0x67ae('0x8')],{'host':_0x67ae('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x67ae('0xa'))['register'](socket);function respondWithRpcPromise(_0x5d703b,_0x50476d,_0x1efe71){return new BPromise(function(_0x246d9b,_0x110357){return client[_0x67ae('0xb')](_0x5d703b,_0x1efe71)['then'](function(_0xa2bfb0){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x50476d,_0x67ae('0xc'));logger[_0x67ae('0xd')](_0x67ae('0xe'),_0x50476d,_0x67ae('0xc'),JSON['stringify'](_0xa2bfb0));if(_0xa2bfb0[_0x67ae('0xf')]){if(_0xa2bfb0[_0x67ae('0xf')]['code']===0x1f4){logger[_0x67ae('0xf')](_0x67ae('0x10'),_0x50476d,_0xa2bfb0[_0x67ae('0xf')][_0x67ae('0x11')]);return _0x110357(_0xa2bfb0[_0x67ae('0xf')]['message']);}logger[_0x67ae('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x50476d,_0xa2bfb0[_0x67ae('0xf')][_0x67ae('0x11')]);return _0x246d9b(_0xa2bfb0[_0x67ae('0xf')]['message']);}else{logger[_0x67ae('0x12')](_0x67ae('0x10'),_0x50476d,_0x67ae('0xc'));_0x246d9b(_0xa2bfb0[_0x67ae('0x13')][_0x67ae('0x11')]);}})['catch'](function(_0x30be29){logger[_0x67ae('0xf')](_0x67ae('0x10'),_0x50476d,_0x30be29);_0x110357(_0x30be29);});});}exports[_0x67ae('0x14')]=function(_0x581649){var _0x41914f=this;return new Promise(function(_0xfd3e7f,_0x36977c){return db[_0x67ae('0x15')][_0x67ae('0x16')](_0x581649['body'],{'raw':_0x581649[_0x67ae('0x17')]?_0x581649[_0x67ae('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x581649[_0x67ae('0x17')]?_0x581649['options'][_0x67ae('0x18')]||null:null,'attributes':_0x581649[_0x67ae('0x17')]?_0x581649[_0x67ae('0x17')][_0x67ae('0x19')]||null:null,'limit':_0x581649['options']?_0x581649['options'][_0x67ae('0x1a')]||null:null})[_0x67ae('0x1b')](function(_0x562828){logger[_0x67ae('0x12')]('UpdateChatInteraction',_0x581649);logger['debug'](_0x67ae('0x14'),_0x581649,JSON[_0x67ae('0x1c')](_0x562828));_0xfd3e7f(_0x562828);})['catch'](function(_0xcc18f0){logger[_0x67ae('0xf')]('UpdateChatInteraction',_0xcc18f0['message'],_0x581649);_0x36977c(_0x41914f[_0x67ae('0xf')](0x1f4,_0xcc18f0[_0x67ae('0x11')]));});});};exports[_0x67ae('0x1d')]=function(_0x20c2ac){return new Promise(function(_0x318183,_0x1db719){return db[_0x67ae('0x15')][_0x67ae('0x1e')]({'where':_0x20c2ac[_0x67ae('0x17')]?_0x20c2ac[_0x67ae('0x17')][_0x67ae('0x18')]||null:null})[_0x67ae('0x1b')](function(_0x551593){if(_0x551593){return _0x551593[_0x67ae('0x1f')](_0x20c2ac[_0x67ae('0x20')][_0x67ae('0x21')],_[_0x67ae('0x22')](_0x20c2ac[_0x67ae('0x20')],[_0x67ae('0x21'),'id'])||{});}})[_0x67ae('0x23')](function(_0x49fbfd){logger[_0x67ae('0x12')](_0x67ae('0x24'),_0x20c2ac);logger['debug']('AddTags',_0x20c2ac,JSON[_0x67ae('0x1c')](_0x49fbfd));_0x318183(_0x49fbfd);})['catch'](function(_0x50497e){logger[_0x67ae('0xf')](_0x67ae('0x24'),_0x50497e[_0x67ae('0x11')],_0x20c2ac);_0x1db719(_this[_0x67ae('0xf')](0x1f4,_0x50497e[_0x67ae('0x11')]));});});};
\ No newline at end of file
+var _0xc2c6=['../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','info','result','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x49cf57,_0x428742){var _0x15eca3=function(_0x3c8468){while(--_0x3c8468){_0x49cf57['push'](_0x49cf57['shift']());}};_0x15eca3(++_0x428742);}(_0xc2c6,0x1b1));var _0x6c2c=function(_0x1601ad,_0x4e4a92){_0x1601ad=_0x1601ad-0x0;var _0x3973aa=_0xc2c6[_0x1601ad];return _0x3973aa;};'use strict';var _=require(_0x6c2c('0x0'));var util=require(_0x6c2c('0x1'));var moment=require(_0x6c2c('0x2'));var BPromise=require(_0x6c2c('0x3'));var rs=require(_0x6c2c('0x4'));var fs=require('fs');var Redis=require(_0x6c2c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c2c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6c2c('0x7'));var jayson=require(_0x6c2c('0x8'));var client=jayson[_0x6c2c('0x9')]['http']({'port':0x232a});config[_0x6c2c('0xa')]=_['defaults'](config[_0x6c2c('0xa')],{'host':_0x6c2c('0xb'),'port':0x18eb});var socket=require(_0x6c2c('0xc'))(new Redis(config['redis']));require(_0x6c2c('0xd'))[_0x6c2c('0xe')](socket);function respondWithRpcPromise(_0x5c28de,_0x482322,_0x241b1e){return new BPromise(function(_0x12a9d5,_0x43ebed){return client[_0x6c2c('0xf')](_0x5c28de,_0x241b1e)[_0x6c2c('0x10')](function(_0x5c8244){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x482322,_0x6c2c('0x11'));logger[_0x6c2c('0x12')](_0x6c2c('0x13'),_0x482322,_0x6c2c('0x11'),JSON['stringify'](_0x5c8244));if(_0x5c8244[_0x6c2c('0x14')]){if(_0x5c8244[_0x6c2c('0x14')][_0x6c2c('0x15')]===0x1f4){logger['error'](_0x6c2c('0x16'),_0x482322,_0x5c8244['error']['message']);return _0x43ebed(_0x5c8244['error']['message']);}logger['error'](_0x6c2c('0x16'),_0x482322,_0x5c8244[_0x6c2c('0x14')]['message']);return _0x12a9d5(_0x5c8244[_0x6c2c('0x14')]['message']);}else{logger[_0x6c2c('0x17')](_0x6c2c('0x16'),_0x482322,'request\x20sent');_0x12a9d5(_0x5c8244[_0x6c2c('0x18')][_0x6c2c('0x19')]);}})[_0x6c2c('0x1a')](function(_0xb704bf){logger[_0x6c2c('0x14')](_0x6c2c('0x16'),_0x482322,_0xb704bf);_0x43ebed(_0xb704bf);});});}exports[_0x6c2c('0x1b')]=function(_0x55cb4a){var _0x25d8ba=this;return new Promise(function(_0x2506da,_0x1573a2){return db[_0x6c2c('0x1c')][_0x6c2c('0x1d')](_0x55cb4a[_0x6c2c('0x1e')],{'raw':_0x55cb4a[_0x6c2c('0x1f')]?_0x55cb4a[_0x6c2c('0x1f')][_0x6c2c('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55cb4a[_0x6c2c('0x1f')]?_0x55cb4a[_0x6c2c('0x1f')][_0x6c2c('0x21')]||null:null,'attributes':_0x55cb4a[_0x6c2c('0x1f')]?_0x55cb4a[_0x6c2c('0x1f')][_0x6c2c('0x22')]||null:null,'limit':_0x55cb4a['options']?_0x55cb4a['options'][_0x6c2c('0x23')]||null:null})['then'](function(_0xfd9896){logger[_0x6c2c('0x17')](_0x6c2c('0x1b'),_0x55cb4a);logger[_0x6c2c('0x12')](_0x6c2c('0x1b'),_0x55cb4a,JSON[_0x6c2c('0x24')](_0xfd9896));_0x2506da(_0xfd9896);})[_0x6c2c('0x1a')](function(_0x51f8fc){logger[_0x6c2c('0x14')]('UpdateChatInteraction',_0x51f8fc[_0x6c2c('0x19')],_0x55cb4a);_0x1573a2(_0x25d8ba['error'](0x1f4,_0x51f8fc[_0x6c2c('0x19')]));});});};exports[_0x6c2c('0x25')]=function(_0x38119b){return new Promise(function(_0xfca7fc,_0x22b1c0){return db[_0x6c2c('0x1c')][_0x6c2c('0x26')]({'where':_0x38119b[_0x6c2c('0x1f')]?_0x38119b[_0x6c2c('0x1f')][_0x6c2c('0x21')]||null:null})['then'](function(_0x1e343e){if(_0x1e343e){return _0x1e343e[_0x6c2c('0x27')](_0x38119b[_0x6c2c('0x1e')][_0x6c2c('0x28')],_[_0x6c2c('0x29')](_0x38119b[_0x6c2c('0x1e')],[_0x6c2c('0x28'),'id'])||{});}})[_0x6c2c('0x2a')](function(_0x4682b5){logger[_0x6c2c('0x17')](_0x6c2c('0x2b'),_0x38119b);logger['debug'](_0x6c2c('0x2b'),_0x38119b,JSON[_0x6c2c('0x24')](_0x4682b5));_0xfca7fc(_0x4682b5);})[_0x6c2c('0x1a')](function(_0xbfae19){logger[_0x6c2c('0x14')](_0x6c2c('0x2b'),_0xbfae19[_0x6c2c('0x19')],_0x38119b);_0x22b1c0(_this[_0x6c2c('0x14')](0x1f4,_0xbfae19['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index f9a88d2..fc3ec53 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 _0x7da1=['./chatInteraction.events','save','remove','emit','removeListener','register','chatInteraction:'];(function(_0x17e658,_0x64e00){var _0x1250e5=function(_0x193801){while(--_0x193801){_0x17e658['push'](_0x17e658['shift']());}};_0x1250e5(++_0x64e00);}(_0x7da1,0xee));var _0x17da=function(_0x10046a,_0x2a03a4){_0x10046a=_0x10046a-0x0;var _0x106ed4=_0x7da1[_0x10046a];return _0x106ed4;};'use strict';var ChatInteractionEvents=require(_0x17da('0x0'));var events=[_0x17da('0x1'),_0x17da('0x2'),'update'];function createListener(_0x3f0f2f,_0x2950d3){return function(_0x4a25c2){_0x2950d3[_0x17da('0x3')](_0x3f0f2f,_0x4a25c2);};}function removeListener(_0x468374,_0x515366){return function(){ChatInteractionEvents[_0x17da('0x4')](_0x468374,_0x515366);};}exports[_0x17da('0x5')]=function(_0x20e201){for(var _0x1c333d=0x0,_0x354bb8=events['length'];_0x1c333d<_0x354bb8;_0x1c333d++){var _0x5397a7=events[_0x1c333d];var _0x5a41d7=createListener(_0x17da('0x6')+_0x5397a7,_0x20e201);ChatInteractionEvents['on'](_0x5397a7,_0x5a41d7);}};
\ No newline at end of file
+var _0xb9c5=['removeListener','chatInteraction:','remove','update','emit'];(function(_0x3b53b0,_0x23dc58){var _0x4eddc6=function(_0x46254f){while(--_0x46254f){_0x3b53b0['push'](_0x3b53b0['shift']());}};_0x4eddc6(++_0x23dc58);}(_0xb9c5,0x14c));var _0x5b9c=function(_0x38b4fe,_0x4f84d){_0x38b4fe=_0x38b4fe-0x0;var _0x1be3a3=_0xb9c5[_0x38b4fe];return _0x1be3a3;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x5b9c('0x0'),_0x5b9c('0x1')];function createListener(_0x219f9e,_0x71a54d){return function(_0x7a8d0e){_0x71a54d[_0x5b9c('0x2')](_0x219f9e,_0x7a8d0e);};}function removeListener(_0x8b9804,_0x1e6874){return function(){ChatInteractionEvents[_0x5b9c('0x3')](_0x8b9804,_0x1e6874);};}exports['register']=function(_0xfeef37){for(var _0x45007d=0x0,_0x3259c2=events['length'];_0x45007d<_0x3259c2;_0x45007d++){var _0x2a9fd6=events[_0x45007d];var _0x3f43b5=createListener(_0x5b9c('0x4')+_0x2a9fd6,_0xfeef37);ChatInteractionEvents['on'](_0x2a9fd6,_0x3f43b5);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 16a6796..c63031b 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 _0x15d2=['download','post','create','createVidaooSession','diskStorage','root','server/files/attachments/','now','originalname','replace','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','customUpdate','abandon','close','delete','chatinteraction:destroy','/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages'];(function(_0x4aa162,_0xf301ea){var _0x35b9c6=function(_0x38712a){while(--_0x38712a){_0x4aa162['push'](_0x4aa162['shift']());}};_0x35b9c6(++_0xf301ea);}(_0x15d2,0x134));var _0x215d=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x15d2[_0x411add];return _0x238242;};'use strict';var multer=require(_0x215d('0x0'));var util=require(_0x215d('0x1'));var path=require('path');var timeout=require(_0x215d('0x2'));var express=require(_0x215d('0x3'));var router=express[_0x215d('0x4')]();var fs_extra=require(_0x215d('0x5'));var auth=require(_0x215d('0x6'));var interaction=require(_0x215d('0x7'));var config=require(_0x215d('0x8'));var controller=require('./chatInteraction.controller');router[_0x215d('0x9')]('/',auth[_0x215d('0xa')](),controller['index']);router[_0x215d('0x9')](_0x215d('0xb'),auth[_0x215d('0xa')](),controller['describe']);router[_0x215d('0x9')](_0x215d('0xc'),auth[_0x215d('0xd')](),controller[_0x215d('0xe')]);router[_0x215d('0x9')](_0x215d('0xf'),auth[_0x215d('0xd')](),controller[_0x215d('0x10')]);router[_0x215d('0x9')](_0x215d('0x11'),auth[_0x215d('0xa')](),controller[_0x215d('0x12')]);router['get'](_0x215d('0x13'),auth[_0x215d('0xd')](),controller[_0x215d('0x14')]);router[_0x215d('0x9')]('/:id/download',auth[_0x215d('0xa')](),controller[_0x215d('0x15')]);router[_0x215d('0x16')]('/',auth['isAuthenticated'](),controller[_0x215d('0x17')]);router[_0x215d('0x16')]('/:id/vidaoo',auth[_0x215d('0xa')](),controller[_0x215d('0x18')]);var upload=multer({'storage':multer[_0x215d('0x19')]({'destination':function(_0x5505d8,_0x2c8a84,_0x28a50b){_0x28a50b(null,path['join'](config[_0x215d('0x1a')],_0x215d('0x1b')));},'filename':function(_0x3f0121,_0x426caa,_0x121126){_0x121126(null,util['format']('%s-%s',Date[_0x215d('0x1c')](),_0x426caa[_0x215d('0x1d')][_0x215d('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload['single'](_0x215d('0x1f')),controller[_0x215d('0x20')]);router[_0x215d('0x16')](_0x215d('0x11'),auth[_0x215d('0xd')](),controller[_0x215d('0x21')]);router[_0x215d('0x16')]('/:id/tags',auth[_0x215d('0xa')](),interaction[_0x215d('0x22')](_0x215d('0x23'),_0x215d('0x24')),controller['addTags']);router[_0x215d('0x25')]('/:id',auth[_0x215d('0xa')](),interaction['tracked'](_0x215d('0x23'),_0x215d('0x26')),controller['update']);router[_0x215d('0x25')]('/:id/custom_update',controller[_0x215d('0x27')]);router[_0x215d('0x25')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x215d('0x28')]);router['put']('/:id/close',controller[_0x215d('0x29')]);router[_0x215d('0x2a')](_0x215d('0xc'),auth[_0x215d('0xa')](),interaction['tracked'](_0x215d('0x23'),_0x215d('0x2b')),controller['destroy']);router[_0x215d('0x2a')](_0x215d('0x2c'),auth[_0x215d('0xa')](),controller[_0x215d('0x2d')]);module[_0x215d('0x2e')]=router;
\ No newline at end of file
+var _0x082c=['attachmentUpload','/:id/messages','/:id/tags','tracked','addTags','put','/:id','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','join','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x082c,0x13c));var _0xc082=function(_0x12ab97,_0x43a673){_0x12ab97=_0x12ab97-0x0;var _0x338e43=_0x082c[_0x12ab97];return _0x338e43;};'use strict';var multer=require('multer');var util=require(_0xc082('0x0'));var path=require(_0xc082('0x1'));var timeout=require(_0xc082('0x2'));var express=require(_0xc082('0x3'));var router=express[_0xc082('0x4')]();var fs_extra=require(_0xc082('0x5'));var auth=require(_0xc082('0x6'));var interaction=require(_0xc082('0x7'));var config=require(_0xc082('0x8'));var controller=require(_0xc082('0x9'));router[_0xc082('0xa')]('/',auth[_0xc082('0xb')](),controller[_0xc082('0xc')]);router[_0xc082('0xa')]('/describe',auth[_0xc082('0xb')](),controller['describe']);router[_0xc082('0xa')]('/:id',auth[_0xc082('0xd')](),controller[_0xc082('0xe')]);router[_0xc082('0xa')](_0xc082('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xc082('0x10')]);router[_0xc082('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0xc082('0x11')]);router['get']('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0xc082('0x12')]);router[_0xc082('0xa')](_0xc082('0x13'),auth[_0xc082('0xb')](),controller[_0xc082('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc082('0x15')]);router[_0xc082('0x16')](_0xc082('0x17'),auth[_0xc082('0xb')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x27a6c4,_0x346abc,_0x3b97cb){_0x3b97cb(null,path[_0xc082('0x18')](config[_0xc082('0x19')],_0xc082('0x1a')));},'filename':function(_0x2504d5,_0x9b02e8,_0x4552d2){_0x4552d2(null,util['format'](_0xc082('0x1b'),Date[_0xc082('0x1c')](),_0x9b02e8[_0xc082('0x1d')][_0xc082('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc082('0x16')](_0xc082('0x1f'),upload[_0xc082('0x20')](_0xc082('0x21')),controller[_0xc082('0x22')]);router[_0xc082('0x16')](_0xc082('0x23'),auth[_0xc082('0xd')](),controller['addMessage']);router['post'](_0xc082('0x24'),auth[_0xc082('0xb')](),interaction[_0xc082('0x25')]('chat','chatinteraction:addtags'),controller[_0xc082('0x26')]);router[_0xc082('0x27')](_0xc082('0x28'),auth[_0xc082('0xb')](),interaction[_0xc082('0x25')]('chat','chatinteraction:update'),controller['update']);router[_0xc082('0x27')]('/:id/custom_update',controller[_0xc082('0x29')]);router[_0xc082('0x27')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xc082('0x2a')]);router[_0xc082('0x27')](_0xc082('0x2b'),controller[_0xc082('0x2c')]);router[_0xc082('0x2d')](_0xc082('0x28'),auth['isAuthenticated'](),interaction[_0xc082('0x25')]('chat',_0xc082('0x2e')),controller[_0xc082('0x2f')]);router[_0xc082('0x2d')](_0xc082('0x24'),auth[_0xc082('0xb')](),controller[_0xc082('0x30')]);module[_0xc082('0x31')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index b772308..785abdf 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 _0xa441=['medium','exports','TEXT'];(function(_0x1f4c8f,_0x5633af){var _0x156ab8=function(_0x180334){while(--_0x180334){_0x1f4c8f['push'](_0x1f4c8f['shift']());}};_0x156ab8(++_0x5633af);}(_0xa441,0xe8));var _0x1a44=function(_0x2f672d,_0x5a2171){_0x2f672d=_0x2f672d-0x0;var _0x5953a5=_0xa441[_0x2f672d];return _0x5953a5;};'use strict';var Sequelize=require('sequelize');module[_0x1a44('0x0')]={'body':{'type':Sequelize[_0x1a44('0x1')](_0x1a44('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xe20e=['medium','BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x2b582c,_0xce9b8b){var _0x13323e=function(_0x403087){while(--_0x403087){_0x2b582c['push'](_0x2b582c['shift']());}};_0x13323e(++_0xce9b8b);}(_0xe20e,0x171));var _0xee20=function(_0x127a60,_0x37f33a){_0x127a60=_0x127a60-0x0;var _0xc1f6a3=_0xe20e[_0x127a60];return _0xc1f6a3;};'use strict';var Sequelize=require(_0xee20('0x0'));module[_0xee20('0x1')]={'body':{'type':Sequelize[_0xee20('0x2')](_0xee20('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xee20('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xee20('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index bef7999..16dd7b0 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 _0x4bef=['ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','order','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','findAll','rows','find','create','body','catch','update','params','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','sort','VoiceQueues','role','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0xf43a1e,_0x28a2b5){var _0x14da71=function(_0x49cffb){while(--_0x49cffb){_0xf43a1e['push'](_0xf43a1e['shift']());}};_0x14da71(++_0x28a2b5);}(_0x4bef,0xd3));var _0xf4be=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0x4bef[_0x33bc64];return _0x3fdd34;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf4be('0x0'));var zipdir=require(_0xf4be('0x1'));var jsonpatch=require(_0xf4be('0x2'));var rp=require(_0xf4be('0x3'));var moment=require(_0xf4be('0x4'));var BPromise=require(_0xf4be('0x5'));var Mustache=require(_0xf4be('0x6'));var util=require('util');var path=require(_0xf4be('0x7'));var sox=require(_0xf4be('0x8'));var csv=require('to-csv');var ejs=require(_0xf4be('0x9'));var fs=require('fs');var fs_extra=require(_0xf4be('0xa'));var _=require(_0xf4be('0xb'));var squel=require(_0xf4be('0xc'));var crypto=require(_0xf4be('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf4be('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf4be('0xf'));var Papa=require(_0xf4be('0x10'));var Redis=require(_0xf4be('0x11'));var authService=require(_0xf4be('0x12'));var qs=require(_0xf4be('0x13'));var as=require(_0xf4be('0x14'));var hardwareService=require(_0xf4be('0x15'));var logger=require(_0xf4be('0x16'))(_0xf4be('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf4be('0x18'))['db'];config['redis']=_[_0xf4be('0x19')](config[_0xf4be('0x1a')],{'host':_0xf4be('0x1b'),'port':0x18eb});var socket=require(_0xf4be('0x1c'))(new Redis(config[_0xf4be('0x1a')]));require(_0xf4be('0x1d'))[_0xf4be('0x1e')](socket);function respondWithStatusCode(_0x26a26b,_0x4f3060){_0x4f3060=_0x4f3060||0xcc;return function(_0x3ed657){if(_0x3ed657){return _0x26a26b[_0xf4be('0x1f')](_0x4f3060);}return _0x26a26b[_0xf4be('0x20')](_0x4f3060)[_0xf4be('0x21')]();};}function respondWithResult(_0x3ac81c,_0x1f1a6a){_0x1f1a6a=_0x1f1a6a||0xc8;return function(_0x541873){if(_0x541873){return _0x3ac81c[_0xf4be('0x20')](_0x1f1a6a)[_0xf4be('0x22')](_0x541873);}};}function respondWithFilteredResult(_0x517a97,_0x2cb07a){return function(_0x121a6c){if(_0x121a6c){var _0x325de9=typeof _0x2cb07a[_0xf4be('0x23')]===_0xf4be('0x24')&&typeof _0x2cb07a[_0xf4be('0x25')]==='undefined';var _0x3063ab=_0x121a6c[_0xf4be('0x26')];var _0x15a882=_0x325de9?0x0:_0x2cb07a[_0xf4be('0x23')];var _0x292ee7=_0x325de9?_0x121a6c['count']:_0x2cb07a[_0xf4be('0x23')]+_0x2cb07a[_0xf4be('0x25')];var _0x3ce2ce;if(_0x292ee7>=_0x3063ab){_0x292ee7=_0x3063ab;_0x3ce2ce=0xc8;}else{_0x3ce2ce=0xce;}_0x517a97[_0xf4be('0x20')](_0x3ce2ce);return _0x517a97['set'](_0xf4be('0x27'),_0x15a882+'-'+_0x292ee7+'/'+_0x3063ab)[_0xf4be('0x22')](_0x121a6c);}return null;};}function patchUpdates(_0x2297cd){return function(_0x4ea5e3){try{jsonpatch[_0xf4be('0x28')](_0x4ea5e3,_0x2297cd,!![]);}catch(_0x3405c6){return BPromise[_0xf4be('0x29')](_0x3405c6);}return _0x4ea5e3['save']();};}function saveUpdates(_0x4ff486,_0x2c5788){return function(_0x23ef0b){if(_0x23ef0b){return _0x23ef0b['update'](_0x4ff486)[_0xf4be('0x2a')](function(_0x531a65){return _0x531a65;});}return null;};}function removeEntity(_0x3e3cee,_0x1de168){return function(_0x3d39f1){if(_0x3d39f1){return _0x3d39f1[_0xf4be('0x2b')]()[_0xf4be('0x2a')](function(){_0x3e3cee['status'](0xcc)[_0xf4be('0x21')]();});}};}function handleEntityNotFound(_0x57e156,_0x95232b){return function(_0x137328){if(!_0x137328){_0x57e156[_0xf4be('0x1f')](0x194);}return _0x137328;};}function handleError(_0x183494,_0x3337fc){_0x3337fc=_0x3337fc||0x1f4;return function(_0x4eedec){logger['error'](_0x4eedec[_0xf4be('0x2c')]);if(_0x4eedec['name']){delete _0x4eedec[_0xf4be('0x2d')];}_0x183494[_0xf4be('0x20')](_0x3337fc)[_0xf4be('0x2e')](_0x4eedec);};}exports[_0xf4be('0x2f')]=function(_0x398b7e,_0x4c928c){var _0x48e6d9={},_0x5db9b9={},_0x251413={'count':0x0,'rows':[]};var _0x50b40f=_[_0xf4be('0x30')](db['ChatInternalMessage'][_0xf4be('0x31')],function(_0x3db85d){return{'name':_0x3db85d[_0xf4be('0x32')],'type':_0x3db85d[_0xf4be('0x33')]['key']};});_0x5db9b9[_0xf4be('0x34')]=_[_0xf4be('0x30')](_0x50b40f,'name');_0x5db9b9[_0xf4be('0x35')]=_[_0xf4be('0x36')](_0x398b7e[_0xf4be('0x35')]);_0x5db9b9[_0xf4be('0x37')]=_['intersection'](_0x5db9b9[_0xf4be('0x34')],_0x5db9b9[_0xf4be('0x35')]);_0x48e6d9[_0xf4be('0x38')]=_[_0xf4be('0x39')](_0x5db9b9[_0xf4be('0x34')],qs[_0xf4be('0x3a')](_0x398b7e[_0xf4be('0x35')][_0xf4be('0x3a')]));_0x48e6d9[_0xf4be('0x38')]=_0x48e6d9[_0xf4be('0x38')][_0xf4be('0x3b')]?_0x48e6d9[_0xf4be('0x38')]:_0x5db9b9['model'];if(!_0x398b7e['query']['hasOwnProperty']('nolimit')){_0x48e6d9['limit']=qs[_0xf4be('0x25')](_0x398b7e[_0xf4be('0x35')][_0xf4be('0x25')]);_0x48e6d9[_0xf4be('0x23')]=qs['offset'](_0x398b7e['query'][_0xf4be('0x23')]);}_0x48e6d9[_0xf4be('0x3c')]=qs['sort'](_0x398b7e[_0xf4be('0x35')]['sort']);_0x48e6d9[_0xf4be('0x3d')]=qs[_0xf4be('0x37')](_[_0xf4be('0x3e')](_0x398b7e[_0xf4be('0x35')],_0x5db9b9[_0xf4be('0x37')]),_0x50b40f);if(_0x398b7e[_0xf4be('0x35')][_0xf4be('0x3f')]){_0x48e6d9[_0xf4be('0x3d')]=_[_0xf4be('0x40')](_0x48e6d9['where'],{'$or':_[_0xf4be('0x30')](_0x50b40f,function(_0x5d5e12){if(_0x5d5e12[_0xf4be('0x33')]!==_0xf4be('0x41')){var _0x419270={};_0x419270[_0x5d5e12[_0xf4be('0x2d')]]={'$like':'%'+_0x398b7e[_0xf4be('0x35')][_0xf4be('0x3f')]+'%'};return _0x419270;}})});}_0x48e6d9=_[_0xf4be('0x40')]({},_0x48e6d9,_0x398b7e[_0xf4be('0x42')]);var _0x26fbd2={'where':_0x48e6d9[_0xf4be('0x3d')]};return db[_0xf4be('0x43')][_0xf4be('0x26')](_0x26fbd2)['then'](function(_0x179c25){_0x251413['count']=_0x179c25;if(_0x398b7e[_0xf4be('0x35')][_0xf4be('0x44')]){_0x48e6d9['include']=[{'all':!![]}];}return db[_0xf4be('0x43')][_0xf4be('0x45')](_0x48e6d9);})[_0xf4be('0x2a')](function(_0x446aa3){_0x251413[_0xf4be('0x46')]=_0x446aa3;return _0x251413;})[_0xf4be('0x2a')](respondWithFilteredResult(_0x4c928c,_0x48e6d9))['catch'](handleError(_0x4c928c,null));};exports['show']=function(_0x530d8f,_0xa1b4f8){var _0x3d0ca9={'raw':!![],'where':{'id':_0x530d8f['params']['id']}},_0x2b103a={};_0x2b103a['model']=_[_0xf4be('0x36')](db[_0xf4be('0x43')][_0xf4be('0x31')]);_0x2b103a[_0xf4be('0x35')]=_[_0xf4be('0x36')](_0x530d8f['query']);_0x2b103a[_0xf4be('0x37')]=_[_0xf4be('0x39')](_0x2b103a['model'],_0x2b103a[_0xf4be('0x35')]);_0x3d0ca9[_0xf4be('0x38')]=_[_0xf4be('0x39')](_0x2b103a[_0xf4be('0x34')],qs['fields'](_0x530d8f[_0xf4be('0x35')][_0xf4be('0x3a')]));_0x3d0ca9[_0xf4be('0x38')]=_0x3d0ca9[_0xf4be('0x38')][_0xf4be('0x3b')]?_0x3d0ca9[_0xf4be('0x38')]:_0x2b103a['model'];if(_0x530d8f[_0xf4be('0x35')][_0xf4be('0x44')]){_0x3d0ca9['include']=[{'all':!![]}];}_0x3d0ca9=_[_0xf4be('0x40')]({},_0x3d0ca9,_0x530d8f[_0xf4be('0x42')]);return db[_0xf4be('0x43')][_0xf4be('0x47')](_0x3d0ca9)[_0xf4be('0x2a')](handleEntityNotFound(_0xa1b4f8,null))[_0xf4be('0x2a')](respondWithResult(_0xa1b4f8,null))['catch'](handleError(_0xa1b4f8,null));};exports[_0xf4be('0x48')]=function(_0x27022b,_0x1f0935){return db[_0xf4be('0x43')][_0xf4be('0x48')](_0x27022b[_0xf4be('0x49')],{})[_0xf4be('0x2a')](respondWithResult(_0x1f0935,0xc9))[_0xf4be('0x4a')](handleError(_0x1f0935,null));};exports[_0xf4be('0x4b')]=function(_0x538a3d,_0x10ea00){if(_0x538a3d[_0xf4be('0x49')]['id']){delete _0x538a3d[_0xf4be('0x49')]['id'];}return db[_0xf4be('0x43')]['find']({'where':{'id':_0x538a3d[_0xf4be('0x4c')]['id']}})[_0xf4be('0x2a')](handleEntityNotFound(_0x10ea00,null))['then'](saveUpdates(_0x538a3d['body'],null))[_0xf4be('0x2a')](respondWithResult(_0x10ea00,null))[_0xf4be('0x4a')](handleError(_0x10ea00,null));};exports[_0xf4be('0x2b')]=function(_0xa1af99,_0x532469){return db[_0xf4be('0x43')][_0xf4be('0x47')]({'where':{'id':_0xa1af99['params']['id']}})[_0xf4be('0x2a')](handleEntityNotFound(_0x532469,null))[_0xf4be('0x2a')](removeEntity(_0x532469,null))['catch'](handleError(_0x532469,null));};exports[_0xf4be('0x4d')]=function(_0x37ab60,_0x244441){return db[_0xf4be('0x43')]['describe']()[_0xf4be('0x2a')](respondWithResult(_0x244441,null))[_0xf4be('0x4a')](handleError(_0x244441,null));};function wrapUser(_0x159e72){return function(_0x434741){var _0x3558a2=_0x159e72[_0xf4be('0x4e')]({'plain':!![]});_0x3558a2[_0xf4be('0x4f')]=[];if(_0x434741){_0x3558a2[_0xf4be('0x50')]=_0x434741[_0xf4be('0x51')];_0x3558a2['lastMessage']=_0x434741;}else{_0x3558a2[_0xf4be('0x50')]=moment(0x0)[_0xf4be('0x52')](_0xf4be('0x53'));_0x3558a2['lastMessage']={};}return _0x3558a2;};}exports[_0xf4be('0x54')]=function(_0x4d4e80,_0x2515d7,_0x4164d3){var _0x10c089=[];return db[_0xf4be('0x55')][_0xf4be('0x45')]({'where':{'role':[_0xf4be('0x56'),'admin',_0xf4be('0x57')]},'attributes':['id',_0xf4be('0x58'),_0xf4be('0x2d'),'role',_0xf4be('0x59'),_0xf4be('0x5a'),_0xf4be('0x5b'),_0xf4be('0x5c'),_0xf4be('0x5d'),_0xf4be('0x5e')],'order':qs[_0xf4be('0x5f')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0xf4be('0x60'),'attributes':['id',_0xf4be('0x2d'),_0xf4be('0x33')],'through':{'attributes':[]}}]})[_0xf4be('0x2a')](function(_0x179e41){if(_0x179e41){var _0x215d06=_0x4d4e80['user'][_0xf4be('0x4e')]({'plain':!![]});if(!_0x215d06)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x215d06[_0xf4be('0x61')]===_0xf4be('0x57')){return db[_0xf4be('0x62')][_0xf4be('0x47')]({'where':{'name':_0xf4be('0x63'),'userProfileId':_0x215d06[_0xf4be('0x64')]},'raw':!![]})[_0xf4be('0x2a')](function(_0x17071c){if(_0x17071c){if(_0x17071c[_0xf4be('0x65')]===0x0){return db['UserProfileResource'][_0xf4be('0x45')]({'where':{'sectionId':_0x17071c['id']},'raw':!![]})[_0xf4be('0x2a')](function(_0x110cd8){var _0x1fc978=[];if(_[_0xf4be('0x66')](_0x110cd8)){_0x1fc978=_[_0xf4be('0x3f')](_0x179e41,function(_0x24c308){if(_0x24c308[_0xf4be('0x61')]!==_0xf4be('0x56')){return _0x24c308;}});return _0x1fc978;}else{for(var _0x451f18=0x0;_0x451f18<_0x179e41[_0xf4be('0x3b')];_0x451f18++){var _0x1af3df=_0x179e41[_0x451f18];if(_0x1af3df[_0xf4be('0x61')]==='agent'){var _0x5bb545=_[_0xf4be('0x47')](_0x110cd8,function(_0x224d80){return _0x224d80[_0xf4be('0x67')]===_0x1af3df['id'];});if(_0x5bb545)_0x1fc978['push'](_0x1af3df);}else{_0x1fc978[_0xf4be('0x68')](_0x1af3df);}}return _0x1fc978;}});}else{return _0x179e41;}}else{var _0x3497f1=_[_0xf4be('0x3f')](_0x179e41,function(_0x2773e8){if(_0x2773e8['role']!==_0xf4be('0x56')){return _0x2773e8;}});return _0x3497f1;}});}else{return _0x179e41;}}})[_0xf4be('0x2a')](function(_0x677f52){var _0x25e4c8=[];if(_0x677f52){_0x10c089=_0x677f52;for(var _0x723f1e=0x0;_0x723f1e<_0x677f52[_0xf4be('0x3b')];_0x723f1e+=0x1){_0x10c089[_0x723f1e][_0xf4be('0x4f')]=[];_0x25e4c8[_0xf4be('0x68')](db['ChatInternalMessage'][_0xf4be('0x47')]({'where':{'FromId':[_0x4d4e80[_0xf4be('0x57')]['id'],_0x677f52[_0x723f1e]['id']],'ToId':[_0x4d4e80[_0xf4be('0x57')]['id'],_0x677f52[_0x723f1e]['id']],'ChatGroupId':null},'attributes':['id',_0xf4be('0x51'),_0xf4be('0x69'),_0xf4be('0x6a'),_0xf4be('0x6b'),_0xf4be('0x49')],'order':qs[_0xf4be('0x5f')](_0xf4be('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf4be('0x2a')](wrapUser(_0x677f52[_0x723f1e])));}return BPromise[_0xf4be('0x6d')](_0x25e4c8);}return[];})[_0xf4be('0x2a')](function(_0x70ef37){return{'rows':_0x70ef37,'count':_0x70ef37['length']};})[_0xf4be('0x2a')](respondWithResult(_0x2515d7,null))['catch'](handleError(_0x2515d7,null));};
\ No newline at end of file
+var _0xbd08=['agent','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','messages','push','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','moment','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','name','send','index','ChatInternalMessage','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','get','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers'];(function(_0x58506e,_0x369f9d){var _0x4cd297=function(_0x3d251f){while(--_0x3d251f){_0x58506e['push'](_0x58506e['shift']());}};_0x4cd297(++_0x369f9d);}(_0xbd08,0x163));var _0x8bd0=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xbd08[_0x35885a];return _0xe86249;};'use strict';var emlformat=require(_0x8bd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8bd0('0x1'));var jsonpatch=require(_0x8bd0('0x2'));var rp=require('request-promise');var moment=require(_0x8bd0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8bd0('0x4'));var path=require(_0x8bd0('0x5'));var sox=require('sox');var csv=require(_0x8bd0('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8bd0('0x7'));var _=require(_0x8bd0('0x8'));var squel=require(_0x8bd0('0x9'));var crypto=require(_0x8bd0('0xa'));var jsforce=require(_0x8bd0('0xb'));var deskjs=require(_0x8bd0('0xc'));var toCsv=require(_0x8bd0('0x6'));var querystring=require(_0x8bd0('0xd'));var Papa=require('papaparse');var Redis=require(_0x8bd0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8bd0('0xf'));var as=require(_0x8bd0('0x10'));var hardwareService=require(_0x8bd0('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x8bd0('0x12'));var config=require(_0x8bd0('0x13'));var licenseUtil=require(_0x8bd0('0x14'));var db=require('../../mysqldb')['db'];config[_0x8bd0('0x15')]=_['defaults'](config[_0x8bd0('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x8bd0('0x16'))(new Redis(config[_0x8bd0('0x15')]));require(_0x8bd0('0x17'))[_0x8bd0('0x18')](socket);function respondWithStatusCode(_0x53c763,_0x47a69b){_0x47a69b=_0x47a69b||0xcc;return function(_0x4cef03){if(_0x4cef03){return _0x53c763[_0x8bd0('0x19')](_0x47a69b);}return _0x53c763[_0x8bd0('0x1a')](_0x47a69b)['end']();};}function respondWithResult(_0x1f79e0,_0x47ae26){_0x47ae26=_0x47ae26||0xc8;return function(_0x3875f0){if(_0x3875f0){return _0x1f79e0['status'](_0x47ae26)[_0x8bd0('0x1b')](_0x3875f0);}};}function respondWithFilteredResult(_0x2c19ec,_0x243d06){return function(_0x5ac561){if(_0x5ac561){var _0x56ed9d=typeof _0x243d06[_0x8bd0('0x1c')]===_0x8bd0('0x1d')&&typeof _0x243d06[_0x8bd0('0x1e')]===_0x8bd0('0x1d');var _0x308deb=_0x5ac561[_0x8bd0('0x1f')];var _0x590ed=_0x56ed9d?0x0:_0x243d06['offset'];var _0x1b1a3c=_0x56ed9d?_0x5ac561['count']:_0x243d06['offset']+_0x243d06[_0x8bd0('0x1e')];var _0x5b1c87;if(_0x1b1a3c>=_0x308deb){_0x1b1a3c=_0x308deb;_0x5b1c87=0xc8;}else{_0x5b1c87=0xce;}_0x2c19ec[_0x8bd0('0x1a')](_0x5b1c87);return _0x2c19ec[_0x8bd0('0x20')](_0x8bd0('0x21'),_0x590ed+'-'+_0x1b1a3c+'/'+_0x308deb)[_0x8bd0('0x1b')](_0x5ac561);}return null;};}function patchUpdates(_0x3d3b3d){return function(_0x4331b3){try{jsonpatch[_0x8bd0('0x22')](_0x4331b3,_0x3d3b3d,!![]);}catch(_0x4725ee){return BPromise[_0x8bd0('0x23')](_0x4725ee);}return _0x4331b3[_0x8bd0('0x24')]();};}function saveUpdates(_0x2ec05d,_0x4ce4b1){return function(_0x196115){if(_0x196115){return _0x196115['update'](_0x2ec05d)[_0x8bd0('0x25')](function(_0x53faa6){return _0x53faa6;});}return null;};}function removeEntity(_0x1dde3a,_0x1aa286){return function(_0x23ebbd){if(_0x23ebbd){return _0x23ebbd[_0x8bd0('0x26')]()[_0x8bd0('0x25')](function(){_0x1dde3a[_0x8bd0('0x1a')](0xcc)[_0x8bd0('0x27')]();});}};}function handleEntityNotFound(_0x4a2875,_0x3277fa){return function(_0x15ab81){if(!_0x15ab81){_0x4a2875[_0x8bd0('0x19')](0x194);}return _0x15ab81;};}function handleError(_0x2a4fb3,_0x6910c1){_0x6910c1=_0x6910c1||0x1f4;return function(_0x11fb38){logger['error'](_0x11fb38['stack']);if(_0x11fb38[_0x8bd0('0x28')]){delete _0x11fb38[_0x8bd0('0x28')];}_0x2a4fb3[_0x8bd0('0x1a')](_0x6910c1)[_0x8bd0('0x29')](_0x11fb38);};}exports[_0x8bd0('0x2a')]=function(_0x227bc7,_0x370369){var _0x172f39={},_0x4f74ec={},_0x1545b5={'count':0x0,'rows':[]};var _0x4ff3d4=_['map'](db[_0x8bd0('0x2b')][_0x8bd0('0x2c')],function(_0x23e115){return{'name':_0x23e115[_0x8bd0('0x2d')],'type':_0x23e115['type'][_0x8bd0('0x2e')]};});_0x4f74ec[_0x8bd0('0x2f')]=_[_0x8bd0('0x30')](_0x4ff3d4,_0x8bd0('0x28'));_0x4f74ec[_0x8bd0('0x31')]=_['keys'](_0x227bc7[_0x8bd0('0x31')]);_0x4f74ec['filters']=_[_0x8bd0('0x32')](_0x4f74ec[_0x8bd0('0x2f')],_0x4f74ec[_0x8bd0('0x31')]);_0x172f39[_0x8bd0('0x33')]=_[_0x8bd0('0x32')](_0x4f74ec[_0x8bd0('0x2f')],qs[_0x8bd0('0x34')](_0x227bc7[_0x8bd0('0x31')][_0x8bd0('0x34')]));_0x172f39[_0x8bd0('0x33')]=_0x172f39['attributes'][_0x8bd0('0x35')]?_0x172f39[_0x8bd0('0x33')]:_0x4f74ec['model'];if(!_0x227bc7[_0x8bd0('0x31')][_0x8bd0('0x36')]('nolimit')){_0x172f39[_0x8bd0('0x1e')]=qs[_0x8bd0('0x1e')](_0x227bc7[_0x8bd0('0x31')][_0x8bd0('0x1e')]);_0x172f39[_0x8bd0('0x1c')]=qs[_0x8bd0('0x1c')](_0x227bc7[_0x8bd0('0x31')][_0x8bd0('0x1c')]);}_0x172f39[_0x8bd0('0x37')]=qs[_0x8bd0('0x38')](_0x227bc7[_0x8bd0('0x31')][_0x8bd0('0x38')]);_0x172f39[_0x8bd0('0x39')]=qs['filters'](_[_0x8bd0('0x3a')](_0x227bc7[_0x8bd0('0x31')],_0x4f74ec[_0x8bd0('0x3b')]),_0x4ff3d4);if(_0x227bc7[_0x8bd0('0x31')][_0x8bd0('0x3c')]){_0x172f39['where']=_[_0x8bd0('0x3d')](_0x172f39['where'],{'$or':_['map'](_0x4ff3d4,function(_0x173ec7){if(_0x173ec7[_0x8bd0('0x3e')]!==_0x8bd0('0x3f')){var _0x5e2907={};_0x5e2907[_0x173ec7[_0x8bd0('0x28')]]={'$like':'%'+_0x227bc7['query'][_0x8bd0('0x3c')]+'%'};return _0x5e2907;}})});}_0x172f39=_[_0x8bd0('0x3d')]({},_0x172f39,_0x227bc7[_0x8bd0('0x40')]);var _0xf8c260={'where':_0x172f39['where']};return db['ChatInternalMessage'][_0x8bd0('0x1f')](_0xf8c260)['then'](function(_0x5347c0){_0x1545b5['count']=_0x5347c0;if(_0x227bc7[_0x8bd0('0x31')][_0x8bd0('0x41')]){_0x172f39[_0x8bd0('0x42')]=[{'all':!![]}];}return db[_0x8bd0('0x2b')][_0x8bd0('0x43')](_0x172f39);})['then'](function(_0x4203ed){_0x1545b5[_0x8bd0('0x44')]=_0x4203ed;return _0x1545b5;})[_0x8bd0('0x25')](respondWithFilteredResult(_0x370369,_0x172f39))[_0x8bd0('0x45')](handleError(_0x370369,null));};exports[_0x8bd0('0x46')]=function(_0x5c48d9,_0x1299fc){var _0x109953={'raw':!![],'where':{'id':_0x5c48d9[_0x8bd0('0x47')]['id']}},_0x54f8bf={};_0x54f8bf['model']=_['keys'](db[_0x8bd0('0x2b')][_0x8bd0('0x2c')]);_0x54f8bf['query']=_[_0x8bd0('0x48')](_0x5c48d9[_0x8bd0('0x31')]);_0x54f8bf[_0x8bd0('0x3b')]=_[_0x8bd0('0x32')](_0x54f8bf[_0x8bd0('0x2f')],_0x54f8bf[_0x8bd0('0x31')]);_0x109953[_0x8bd0('0x33')]=_[_0x8bd0('0x32')](_0x54f8bf[_0x8bd0('0x2f')],qs[_0x8bd0('0x34')](_0x5c48d9['query'][_0x8bd0('0x34')]));_0x109953[_0x8bd0('0x33')]=_0x109953[_0x8bd0('0x33')]['length']?_0x109953['attributes']:_0x54f8bf[_0x8bd0('0x2f')];if(_0x5c48d9['query']['includeAll']){_0x109953['include']=[{'all':!![]}];}_0x109953=_[_0x8bd0('0x3d')]({},_0x109953,_0x5c48d9[_0x8bd0('0x40')]);return db[_0x8bd0('0x2b')][_0x8bd0('0x49')](_0x109953)['then'](handleEntityNotFound(_0x1299fc,null))[_0x8bd0('0x25')](respondWithResult(_0x1299fc,null))[_0x8bd0('0x45')](handleError(_0x1299fc,null));};exports[_0x8bd0('0x4a')]=function(_0x1fb3c8,_0x3e35b8){return db[_0x8bd0('0x2b')][_0x8bd0('0x4a')](_0x1fb3c8[_0x8bd0('0x4b')],{})[_0x8bd0('0x25')](respondWithResult(_0x3e35b8,0xc9))[_0x8bd0('0x45')](handleError(_0x3e35b8,null));};exports[_0x8bd0('0x4c')]=function(_0x42f987,_0x322ad9){if(_0x42f987[_0x8bd0('0x4b')]['id']){delete _0x42f987[_0x8bd0('0x4b')]['id'];}return db[_0x8bd0('0x2b')]['find']({'where':{'id':_0x42f987['params']['id']}})[_0x8bd0('0x25')](handleEntityNotFound(_0x322ad9,null))[_0x8bd0('0x25')](saveUpdates(_0x42f987[_0x8bd0('0x4b')],null))[_0x8bd0('0x25')](respondWithResult(_0x322ad9,null))['catch'](handleError(_0x322ad9,null));};exports[_0x8bd0('0x26')]=function(_0x3258aa,_0x2f7f80){return db[_0x8bd0('0x2b')][_0x8bd0('0x49')]({'where':{'id':_0x3258aa[_0x8bd0('0x47')]['id']}})[_0x8bd0('0x25')](handleEntityNotFound(_0x2f7f80,null))[_0x8bd0('0x25')](removeEntity(_0x2f7f80,null))[_0x8bd0('0x45')](handleError(_0x2f7f80,null));};exports[_0x8bd0('0x4d')]=function(_0x50b2a1,_0x26da61){return db[_0x8bd0('0x2b')]['describe']()[_0x8bd0('0x25')](respondWithResult(_0x26da61,null))[_0x8bd0('0x45')](handleError(_0x26da61,null));};function wrapUser(_0x31462a){return function(_0xb07ffd){var _0x59279c=_0x31462a[_0x8bd0('0x4e')]({'plain':!![]});_0x59279c['messages']=[];if(_0xb07ffd){_0x59279c[_0x8bd0('0x4f')]=_0xb07ffd[_0x8bd0('0x50')];_0x59279c['lastMessage']=_0xb07ffd;}else{_0x59279c[_0x8bd0('0x4f')]=moment(0x0)[_0x8bd0('0x51')](_0x8bd0('0x52'));_0x59279c[_0x8bd0('0x53')]={};}return _0x59279c;};}exports[_0x8bd0('0x54')]=function(_0x4b05bf,_0x4cfeff,_0x4f3de3){var _0x4ecf68=[];return db['User'][_0x8bd0('0x43')]({'where':{'role':[_0x8bd0('0x55'),_0x8bd0('0x56'),_0x8bd0('0x57')]},'attributes':['id','fullname',_0x8bd0('0x28'),_0x8bd0('0x58'),_0x8bd0('0x59'),_0x8bd0('0x5a'),_0x8bd0('0x5b'),_0x8bd0('0x5c'),_0x8bd0('0x5d'),_0x8bd0('0x5e')],'order':qs[_0x8bd0('0x38')]('-online'),'include':[{'model':db[_0x8bd0('0x5f')],'as':_0x8bd0('0x60'),'attributes':['id','name',_0x8bd0('0x3e')],'through':{'attributes':[]}}]})['then'](function(_0x5e893d){if(_0x5e893d){var _0x5030de=_0x4b05bf[_0x8bd0('0x57')][_0x8bd0('0x4e')]({'plain':!![]});if(!_0x5030de)throw new Error(_0x8bd0('0x61'));if(_0x5030de[_0x8bd0('0x58')]===_0x8bd0('0x57')){return db[_0x8bd0('0x62')][_0x8bd0('0x49')]({'where':{'name':_0x8bd0('0x63'),'userProfileId':_0x5030de[_0x8bd0('0x64')]},'raw':!![]})['then'](function(_0x11afd4){if(_0x11afd4){if(_0x11afd4[_0x8bd0('0x65')]===0x0){return db[_0x8bd0('0x66')][_0x8bd0('0x43')]({'where':{'sectionId':_0x11afd4['id']},'raw':!![]})['then'](function(_0x91b4eb){var _0x13d2c7=[];if(_[_0x8bd0('0x67')](_0x91b4eb)){_0x13d2c7=_[_0x8bd0('0x3c')](_0x5e893d,function(_0xf1afce){if(_0xf1afce[_0x8bd0('0x58')]!==_0x8bd0('0x55')){return _0xf1afce;}});return _0x13d2c7;}else{for(var _0x7b947a=0x0;_0x7b947a<_0x5e893d[_0x8bd0('0x35')];_0x7b947a++){var _0x6ac35a=_0x5e893d[_0x7b947a];if(_0x6ac35a[_0x8bd0('0x58')]===_0x8bd0('0x55')){var _0x2b52eb=_[_0x8bd0('0x49')](_0x91b4eb,function(_0x53d82f){return _0x53d82f['resourceId']===_0x6ac35a['id'];});if(_0x2b52eb)_0x13d2c7['push'](_0x6ac35a);}else{_0x13d2c7['push'](_0x6ac35a);}}return _0x13d2c7;}});}else{return _0x5e893d;}}else{var _0x5e9906=_[_0x8bd0('0x3c')](_0x5e893d,function(_0x4160a8){if(_0x4160a8[_0x8bd0('0x58')]!==_0x8bd0('0x55')){return _0x4160a8;}});return _0x5e9906;}});}else{return _0x5e893d;}}})[_0x8bd0('0x25')](function(_0x2bab9a){var _0x39b26a=[];if(_0x2bab9a){_0x4ecf68=_0x2bab9a;for(var _0x86bfee=0x0;_0x86bfee<_0x2bab9a[_0x8bd0('0x35')];_0x86bfee+=0x1){_0x4ecf68[_0x86bfee][_0x8bd0('0x68')]=[];_0x39b26a[_0x8bd0('0x69')](db[_0x8bd0('0x2b')][_0x8bd0('0x49')]({'where':{'FromId':[_0x4b05bf[_0x8bd0('0x57')]['id'],_0x2bab9a[_0x86bfee]['id']],'ToId':[_0x4b05bf[_0x8bd0('0x57')]['id'],_0x2bab9a[_0x86bfee]['id']],'ChatGroupId':null},'attributes':['id',_0x8bd0('0x50'),'FromId',_0x8bd0('0x6a'),_0x8bd0('0x6b'),_0x8bd0('0x4b')],'order':qs[_0x8bd0('0x38')](_0x8bd0('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8bd0('0x25')](wrapUser(_0x2bab9a[_0x86bfee])));}return BPromise[_0x8bd0('0x6d')](_0x39b26a);}return[];})[_0x8bd0('0x25')](function(_0x5b41f6){return{'rows':_0x5b41f6,'count':_0x5b41f6[_0x8bd0('0x35')]};})[_0x8bd0('0x25')](respondWithResult(_0x4cfeff,null))[_0x8bd0('0x45')](handleError(_0x4cfeff,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index b3219de..7c5516e 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 _0xb3f0=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatInternalMessage'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xb3f0,0x103));var _0x0b3f=function(_0x39772f,_0x5605cb){_0x39772f=_0x39772f-0x0;var _0xc9edbf=_0xb3f0[_0x39772f];return _0xc9edbf;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x0b3f('0x0'))['db'][_0x0b3f('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0b3f('0x2')](0x0);var events={'afterCreate':_0x0b3f('0x3'),'afterUpdate':_0x0b3f('0x4'),'afterDestroy':_0x0b3f('0x5')};function emitEvent(_0x33604f){return function(_0x46b6b0,_0x439e99,_0x1b780f){ChatInternalMessageEvents[_0x0b3f('0x6')](_0x33604f+':'+_0x46b6b0['id'],_0x46b6b0);ChatInternalMessageEvents['emit'](_0x33604f,_0x46b6b0);_0x1b780f(null);};}for(var e in events){if(events[_0x0b3f('0x7')](e)){var event=events[e];ChatInternalMessage[_0x0b3f('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x3c9a=['../../mysqldb','ChatInternalMessage','save','emit','hasOwnProperty','events'];(function(_0x595d29,_0x3cab2a){var _0x254cdf=function(_0x2f3b9c){while(--_0x2f3b9c){_0x595d29['push'](_0x595d29['shift']());}};_0x254cdf(++_0x3cab2a);}(_0x3c9a,0x131));var _0xa3c9=function(_0x19ad71,_0x5e9627){_0x19ad71=_0x19ad71-0x0;var _0x1994e6=_0x3c9a[_0x19ad71];return _0x1994e6;};'use strict';var EventEmitter=require(_0xa3c9('0x0'));var ChatInternalMessage=require(_0xa3c9('0x1'))['db'][_0xa3c9('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa3c9('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x7db66d){return function(_0x9cc2f3,_0x4ec896,_0x392856){ChatInternalMessageEvents[_0xa3c9('0x4')](_0x7db66d+':'+_0x9cc2f3['id'],_0x9cc2f3);ChatInternalMessageEvents['emit'](_0x7db66d,_0x9cc2f3);_0x392856(null);};}for(var e in events){if(events[_0xa3c9('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index bc59e10..2cfe1f3 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 _0x43d0=['exports','define','chat_internal_messages','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatInternalMessage.attributes'];(function(_0x109409,_0x531e67){var _0x841581=function(_0x17f5e0){while(--_0x17f5e0){_0x109409['push'](_0x109409['shift']());}};_0x841581(++_0x531e67);}(_0x43d0,0xc4));var _0x043d=function(_0x25c326,_0x250137){_0x25c326=_0x25c326-0x0;var _0x762452=_0x43d0[_0x25c326];return _0x762452;};'use strict';var _=require(_0x043d('0x0'));var util=require('util');var logger=require(_0x043d('0x1'))(_0x043d('0x2'));var moment=require(_0x043d('0x3'));var BPromise=require(_0x043d('0x4'));var rp=require(_0x043d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x043d('0x6'));var config=require('../../config/environment');var attributes=require(_0x043d('0x7'));module[_0x043d('0x8')]=function(_0x2fc4cc,_0x45e622){return _0x2fc4cc[_0x043d('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x043d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x043d('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb83d=['bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x6c172e,_0x168af6){var _0x1428dd=function(_0x16753d){while(--_0x16753d){_0x6c172e['push'](_0x6c172e['shift']());}};_0x1428dd(++_0x168af6);}(_0xb83d,0x8c));var _0xdb83=function(_0x24c07c,_0x4889c5){_0x24c07c=_0x24c07c-0x0;var _0x413a44=_0xb83d[_0x24c07c];return _0x413a44;};'use strict';var _=require(_0xdb83('0x0'));var util=require(_0xdb83('0x1'));var logger=require('../../config/logger')(_0xdb83('0x2'));var moment=require(_0xdb83('0x3'));var BPromise=require(_0xdb83('0x4'));var rp=require(_0xdb83('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb83('0x6'));var config=require(_0xdb83('0x7'));var attributes=require(_0xdb83('0x8'));module['exports']=function(_0x3fb8bd,_0x3a3e72){return _0x3fb8bd[_0xdb83('0x9')](_0xdb83('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xdb83('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index abd689b..9f19f31 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 _0x0725=['./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3a72db,_0x4ced16){var _0x5952d6=function(_0x592db5){while(--_0x592db5){_0x3a72db['push'](_0x3a72db['shift']());}};_0x5952d6(++_0x4ced16);}(_0x0725,0x167));var _0x5072=function(_0x43a5c8,_0x4b86b4){_0x43a5c8=_0x43a5c8-0x0;var _0x1d78f2=_0x0725[_0x43a5c8];return _0x1d78f2;};'use strict';var _=require('lodash');var util=require(_0x5072('0x0'));var moment=require('moment');var BPromise=require(_0x5072('0x1'));var rs=require(_0x5072('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5072('0x3'))['db'];var utils=require(_0x5072('0x4'));var logger=require(_0x5072('0x5'))('rpc');var config=require(_0x5072('0x6'));var jayson=require(_0x5072('0x7'));var client=jayson[_0x5072('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5072('0x9'))[_0x5072('0xa')](socket);function respondWithRpcPromise(_0x52dd41,_0x59bfb1,_0x13f75c){return new BPromise(function(_0x393bf8,_0x8deb0d){return client[_0x5072('0xb')](_0x52dd41,_0x13f75c)[_0x5072('0xc')](function(_0x25f834){logger[_0x5072('0xd')](_0x5072('0xe'),_0x59bfb1,_0x5072('0xf'));logger[_0x5072('0x10')](_0x5072('0x11'),_0x59bfb1,_0x5072('0xf'),JSON['stringify'](_0x25f834));if(_0x25f834['error']){if(_0x25f834[_0x5072('0x12')][_0x5072('0x13')]===0x1f4){logger['error'](_0x5072('0xe'),_0x59bfb1,_0x25f834['error'][_0x5072('0x14')]);return _0x8deb0d(_0x25f834[_0x5072('0x12')][_0x5072('0x14')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x59bfb1,_0x25f834[_0x5072('0x12')][_0x5072('0x14')]);return _0x393bf8(_0x25f834[_0x5072('0x12')][_0x5072('0x14')]);}else{logger[_0x5072('0xd')](_0x5072('0xe'),_0x59bfb1,_0x5072('0xf'));_0x393bf8(_0x25f834[_0x5072('0x15')]['message']);}})[_0x5072('0x16')](function(_0x3074e3){logger[_0x5072('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x59bfb1,_0x3074e3);_0x8deb0d(_0x3074e3);});});}
\ No newline at end of file
+var _0x5915=['code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','client','http','defaults','redis','localhost','socket.io-emitter','register','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2c3c23,_0x3609b5){var _0x24e0ee=function(_0x510410){while(--_0x510410){_0x2c3c23['push'](_0x2c3c23['shift']());}};_0x24e0ee(++_0x3609b5);}(_0x5915,0x14a));var _0x5591=function(_0x4c666d,_0x41cb12){_0x4c666d=_0x4c666d-0x0;var _0x1ad479=_0x5915[_0x4c666d];return _0x1ad479;};'use strict';var _=require(_0x5591('0x0'));var util=require(_0x5591('0x1'));var moment=require(_0x5591('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5591('0x3'));var db=require(_0x5591('0x4'))['db'];var utils=require(_0x5591('0x5'));var logger=require('../../config/logger')(_0x5591('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5591('0x7')][_0x5591('0x8')]({'port':0x232a});config['redis']=_[_0x5591('0x9')](config[_0x5591('0xa')],{'host':_0x5591('0xb'),'port':0x18eb});var socket=require(_0x5591('0xc'))(new Redis(config[_0x5591('0xa')]));require('./chatInternalMessage.socket')[_0x5591('0xd')](socket);function respondWithRpcPromise(_0x3ca61c,_0x5a964e,_0xa9a68f){return new BPromise(function(_0x5d8375,_0x1636d3){return client[_0x5591('0xe')](_0x3ca61c,_0xa9a68f)['then'](function(_0x2b97a3){logger['info'](_0x5591('0xf'),_0x5a964e,_0x5591('0x10'));logger['debug'](_0x5591('0x11'),_0x5a964e,_0x5591('0x10'),JSON[_0x5591('0x12')](_0x2b97a3));if(_0x2b97a3[_0x5591('0x13')]){if(_0x2b97a3[_0x5591('0x13')][_0x5591('0x14')]===0x1f4){logger['error'](_0x5591('0xf'),_0x5a964e,_0x2b97a3[_0x5591('0x13')]['message']);return _0x1636d3(_0x2b97a3[_0x5591('0x13')][_0x5591('0x15')]);}logger[_0x5591('0x13')](_0x5591('0xf'),_0x5a964e,_0x2b97a3['error'][_0x5591('0x15')]);return _0x5d8375(_0x2b97a3[_0x5591('0x13')][_0x5591('0x15')]);}else{logger[_0x5591('0x16')](_0x5591('0xf'),_0x5a964e,_0x5591('0x10'));_0x5d8375(_0x2b97a3[_0x5591('0x17')][_0x5591('0x15')]);}})[_0x5591('0x18')](function(_0xf8fd40){logger[_0x5591('0x13')](_0x5591('0xf'),_0x5a964e,_0xf8fd40);_0x1636d3(_0xf8fd40);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 2df5cb8..3d1f0d9 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 _0xc997=['register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit','removeListener'];(function(_0x3a132e,_0xb39c16){var _0x303f27=function(_0xe58afb){while(--_0xe58afb){_0x3a132e['push'](_0x3a132e['shift']());}};_0x303f27(++_0xb39c16);}(_0xc997,0x83));var _0x7c99=function(_0x2b40b3,_0x471270){_0x2b40b3=_0x2b40b3-0x0;var _0x44423f=_0xc997[_0x2b40b3];return _0x44423f;};'use strict';var ChatInternalMessageEvents=require(_0x7c99('0x0'));var events=['save',_0x7c99('0x1'),_0x7c99('0x2')];function createListener(_0xd4db9a,_0x40067f){return function(_0x3f119c){_0x40067f[_0x7c99('0x3')](_0xd4db9a,_0x3f119c);};}function removeListener(_0xaf85bc,_0x5baf61){return function(){ChatInternalMessageEvents[_0x7c99('0x4')](_0xaf85bc,_0x5baf61);};}exports[_0x7c99('0x5')]=function(_0xc085d1){for(var _0x202022=0x0,_0x2e591d=events[_0x7c99('0x6')];_0x202022<_0x2e591d;_0x202022++){var _0x4c6a62=events[_0x202022];var _0x15c37e=createListener(_0x7c99('0x7')+_0x4c6a62,_0xc085d1);ChatInternalMessageEvents['on'](_0x4c6a62,_0x15c37e);}};
\ No newline at end of file
+var _0xb98e=['chatInternalMessage:','save','remove','emit','removeListener','length'];(function(_0x437b50,_0x45e934){var _0x28c321=function(_0x333824){while(--_0x333824){_0x437b50['push'](_0x437b50['shift']());}};_0x28c321(++_0x45e934);}(_0xb98e,0x1d5));var _0xeb98=function(_0x3d1254,_0xb758c8){_0x3d1254=_0x3d1254-0x0;var _0x22b82a=_0xb98e[_0x3d1254];return _0x22b82a;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xeb98('0x0'),_0xeb98('0x1'),'update'];function createListener(_0x4940f6,_0x1fb859){return function(_0x185a70){_0x1fb859[_0xeb98('0x2')](_0x4940f6,_0x185a70);};}function removeListener(_0x27b78e,_0xbb84f8){return function(){ChatInternalMessageEvents[_0xeb98('0x3')](_0x27b78e,_0xbb84f8);};}exports['register']=function(_0x5568bf){for(var _0xabe588=0x0,_0x30f1ab=events[_0xeb98('0x4')];_0xabe588<_0x30f1ab;_0xabe588++){var _0x37bdc7=events[_0xabe588];var _0x75a00a=createListener(_0xeb98('0x5')+_0x37bdc7,_0x5568bf);ChatInternalMessageEvents['on'](_0x37bdc7,_0x75a00a);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 2d1f113..8706d3b 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 _0xbf38=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','/users','getUsers','/:id','show'];(function(_0x4b7af6,_0x2bb0cd){var _0x4215b5=function(_0x3572cc){while(--_0x3572cc){_0x4b7af6['push'](_0x4b7af6['shift']());}};_0x4215b5(++_0x2bb0cd);}(_0xbf38,0xfa));var _0x8bf3=function(_0x9bd3c1,_0x11dc72){_0x9bd3c1=_0x9bd3c1-0x0;var _0x33aa72=_0xbf38[_0x9bd3c1];return _0x33aa72;};'use strict';var multer=require(_0x8bf3('0x0'));var util=require(_0x8bf3('0x1'));var path=require(_0x8bf3('0x2'));var timeout=require(_0x8bf3('0x3'));var express=require(_0x8bf3('0x4'));var router=express[_0x8bf3('0x5')]();var fs_extra=require(_0x8bf3('0x6'));var auth=require(_0x8bf3('0x7'));var interaction=require(_0x8bf3('0x8'));var config=require(_0x8bf3('0x9'));var controller=require(_0x8bf3('0xa'));router[_0x8bf3('0xb')]('/',auth['isAuthenticated'](),controller[_0x8bf3('0xc')]);router[_0x8bf3('0xb')](_0x8bf3('0xd'),auth[_0x8bf3('0xe')](),controller[_0x8bf3('0xf')]);router['get'](_0x8bf3('0x10'),auth['isAuthenticated'](),controller[_0x8bf3('0x11')]);router[_0x8bf3('0xb')](_0x8bf3('0x12'),auth[_0x8bf3('0xe')](),controller[_0x8bf3('0x13')]);router[_0x8bf3('0x14')]('/',auth[_0x8bf3('0xe')](),controller[_0x8bf3('0x15')]);router[_0x8bf3('0x16')]('/:id',controller[_0x8bf3('0x17')]);router[_0x8bf3('0x18')](_0x8bf3('0x12'),auth[_0x8bf3('0xe')](),controller[_0x8bf3('0x19')]);module[_0x8bf3('0x1a')]=router;
\ No newline at end of file
+var _0x94f9=['isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatInternalMessage.controller','get'];(function(_0x290638,_0x1fa809){var _0x5d9530=function(_0x4c0214){while(--_0x4c0214){_0x290638['push'](_0x290638['shift']());}};_0x5d9530(++_0x1fa809);}(_0x94f9,0x11d));var _0x994f=function(_0x11e496,_0x550762){_0x11e496=_0x11e496-0x0;var _0x4b2c4b=_0x94f9[_0x11e496];return _0x4b2c4b;};'use strict';var multer=require('multer');var util=require(_0x994f('0x0'));var path=require(_0x994f('0x1'));var timeout=require(_0x994f('0x2'));var express=require(_0x994f('0x3'));var router=express[_0x994f('0x4')]();var fs_extra=require(_0x994f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x994f('0x6'));var config=require('../../config/environment');var controller=require(_0x994f('0x7'));router[_0x994f('0x8')]('/',auth[_0x994f('0x9')](),controller[_0x994f('0xa')]);router[_0x994f('0x8')](_0x994f('0xb'),auth[_0x994f('0x9')](),controller[_0x994f('0xc')]);router[_0x994f('0x8')](_0x994f('0xd'),auth[_0x994f('0x9')](),controller[_0x994f('0xe')]);router[_0x994f('0x8')](_0x994f('0xf'),auth[_0x994f('0x9')](),controller[_0x994f('0x10')]);router[_0x994f('0x11')]('/',auth[_0x994f('0x9')](),controller['create']);router[_0x994f('0x12')]('/:id',controller['update']);router[_0x994f('0x13')]('/:id',auth[_0x994f('0x9')](),controller['destroy']);module[_0x994f('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index a0af48c..d953fbd 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 _0x390a=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x4c7d79,_0xa1ebef){var _0x4644ac=function(_0x5af985){while(--_0x5af985){_0x4c7d79['push'](_0x4c7d79['shift']());}};_0x4644ac(++_0xa1ebef);}(_0x390a,0xc9));var _0xa390=function(_0x18dc8b,_0x330b0b){_0x18dc8b=_0x18dc8b-0x0;var _0x5c27a2=_0x390a[_0x18dc8b];return _0x5c27a2;};'use strict';var Sequelize=require(_0xa390('0x0'));module[_0xa390('0x1')]={'body':{'type':Sequelize[_0xa390('0x2')](_0xa390('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xa390('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa390('0x5')]('in',_0xa390('0x6')),'defaultValue':_0xa390('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xa390('0x7')]},'providerResponse':{'type':Sequelize[_0xa390('0x2')]}};
\ No newline at end of file
+var _0x8603=['medium','ENUM','out','STRING','exports','TEXT'];(function(_0xe5b349,_0x5f06e4){var _0x26b0ad=function(_0x1a97f1){while(--_0x1a97f1){_0xe5b349['push'](_0xe5b349['shift']());}};_0x26b0ad(++_0x5f06e4);}(_0x8603,0x190));var _0x3860=function(_0x56ed5d,_0x222353){_0x56ed5d=_0x56ed5d-0x0;var _0x3391a6=_0x8603[_0x56ed5d];return _0x3391a6;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'body':{'type':Sequelize[_0x3860('0x1')](_0x3860('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3860('0x3')]('in',_0x3860('0x4')),'defaultValue':_0x3860('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x3860('0x5')]},'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 18e1ed6..23ab3a0 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 _0xb2d5=['ChatMessage','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','describe','chat-interactions','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User','fullname','email','internal','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','SELECT','SIP/%s','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','destroy','then','end','stack','name','send','index','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options'];(function(_0xedc061,_0x35a113){var _0x2eef4e=function(_0x316a81){while(--_0x316a81){_0xedc061['push'](_0xedc061['shift']());}};_0x2eef4e(++_0x35a113);}(_0xb2d5,0x1c2));var _0x5b2d=function(_0x312090,_0x30f8b8){_0x312090=_0x312090-0x0;var _0x426f08=_0xb2d5[_0x312090];return _0x426f08;};'use strict';var emlformat=require(_0x5b2d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5b2d('0x1'));var jsonpatch=require(_0x5b2d('0x2'));var rp=require(_0x5b2d('0x3'));var moment=require(_0x5b2d('0x4'));var BPromise=require(_0x5b2d('0x5'));var Mustache=require('mustache');var util=require(_0x5b2d('0x6'));var path=require(_0x5b2d('0x7'));var sox=require('sox');var csv=require(_0x5b2d('0x8'));var ejs=require(_0x5b2d('0x9'));var fs=require('fs');var fs_extra=require(_0x5b2d('0xa'));var _=require(_0x5b2d('0xb'));var squel=require('squel');var crypto=require(_0x5b2d('0xc'));var jsforce=require(_0x5b2d('0xd'));var deskjs=require(_0x5b2d('0xe'));var toCsv=require(_0x5b2d('0x8'));var querystring=require(_0x5b2d('0xf'));var Papa=require(_0x5b2d('0x10'));var Redis=require('ioredis');var authService=require(_0x5b2d('0x11'));var qs=require(_0x5b2d('0x12'));var as=require(_0x5b2d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b2d('0x14'))(_0x5b2d('0x15'));var utils=require(_0x5b2d('0x16'));var config=require(_0x5b2d('0x17'));var licenseUtil=require(_0x5b2d('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x5b2d('0x19')],{'host':_0x5b2d('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5b2d('0x19')]));require(_0x5b2d('0x1b'))[_0x5b2d('0x1c')](socket);var jayson=require(_0x5b2d('0x1d'));var client=jayson[_0x5b2d('0x1e')][_0x5b2d('0x1f')]({'port':0x232c});var client9002=jayson[_0x5b2d('0x1e')][_0x5b2d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2b50ae,_0x4bc8cc,_0x5aa61e,_0x593442){return new BPromise(function(_0xac220b,_0x3293e1){var _0x16b5e0=_0x593442||client;return _0x16b5e0['request'](_0x2b50ae,_0x5aa61e)['then'](function(_0xdb996a){logger[_0x5b2d('0x20')](_0x5b2d('0x21'),_0x4bc8cc,'request\x20sent');logger[_0x5b2d('0x22')](_0x5b2d('0x23'),_0x4bc8cc,'request\x20sent',JSON[_0x5b2d('0x24')](_0xdb996a));if(_0xdb996a[_0x5b2d('0x25')]){if(_0xdb996a['error'][_0x5b2d('0x26')]===0x1f4){logger[_0x5b2d('0x25')](_0x5b2d('0x21'),_0x4bc8cc,_0xdb996a['error'][_0x5b2d('0x27')]);return _0x3293e1(_0xdb996a['error'][_0x5b2d('0x27')]);}logger[_0x5b2d('0x25')](_0x5b2d('0x21'),_0x4bc8cc,_0xdb996a[_0x5b2d('0x25')]['message']);return _0xac220b(_0xdb996a[_0x5b2d('0x25')][_0x5b2d('0x27')]);}else{logger[_0x5b2d('0x20')](_0x5b2d('0x21'),_0x4bc8cc,_0x5b2d('0x28'));_0xac220b(_0xdb996a[_0x5b2d('0x29')][_0x5b2d('0x27')]);}})[_0x5b2d('0x2a')](function(_0x5ba403){logger[_0x5b2d('0x25')](_0x5b2d('0x21'),_0x4bc8cc,_0x5ba403);_0x3293e1(_0x5ba403);});});}function respondWithStatusCode(_0x385488,_0x567f3e){_0x567f3e=_0x567f3e||0xcc;return function(_0x50c590){if(_0x50c590){return _0x385488[_0x5b2d('0x2b')](_0x567f3e);}return _0x385488[_0x5b2d('0x2c')](_0x567f3e)['end']();};}function respondWithResult(_0xcdab52,_0x215001){_0x215001=_0x215001||0xc8;return function(_0x58c8e0){if(_0x58c8e0){return _0xcdab52[_0x5b2d('0x2c')](_0x215001)[_0x5b2d('0x2d')](_0x58c8e0);}};}function respondWithFilteredResult(_0xda8e38,_0x1632b9){return function(_0x38bfd0){if(_0x38bfd0){var _0x54ea84=typeof _0x1632b9[_0x5b2d('0x2e')]==='undefined'&&typeof _0x1632b9[_0x5b2d('0x2f')]===_0x5b2d('0x30');var _0x5306d7=_0x38bfd0[_0x5b2d('0x31')];var _0x432ae0=_0x54ea84?0x0:_0x1632b9[_0x5b2d('0x2e')];var _0x5793eb=_0x54ea84?_0x38bfd0[_0x5b2d('0x31')]:_0x1632b9[_0x5b2d('0x2e')]+_0x1632b9[_0x5b2d('0x2f')];var _0x3e3c0c;if(_0x5793eb>=_0x5306d7){_0x5793eb=_0x5306d7;_0x3e3c0c=0xc8;}else{_0x3e3c0c=0xce;}_0xda8e38[_0x5b2d('0x2c')](_0x3e3c0c);return _0xda8e38['set'](_0x5b2d('0x32'),_0x432ae0+'-'+_0x5793eb+'/'+_0x5306d7)[_0x5b2d('0x2d')](_0x38bfd0);}return null;};}function patchUpdates(_0x11b3a9){return function(_0x399491){try{jsonpatch['apply'](_0x399491,_0x11b3a9,!![]);}catch(_0x4022eb){return BPromise[_0x5b2d('0x33')](_0x4022eb);}return _0x399491[_0x5b2d('0x34')]();};}function saveUpdates(_0x1d686e,_0x209cf0){return function(_0x3b4384){if(_0x3b4384){return _0x3b4384[_0x5b2d('0x35')](_0x1d686e)['then'](function(_0x52bcf0){return _0x52bcf0;});}return null;};}function removeEntity(_0x50b166,_0x361514){return function(_0x19ad4f){if(_0x19ad4f){return _0x19ad4f[_0x5b2d('0x36')]()[_0x5b2d('0x37')](function(){_0x50b166[_0x5b2d('0x2c')](0xcc)[_0x5b2d('0x38')]();});}};}function handleEntityNotFound(_0x369042,_0xff236){return function(_0x237eb6){if(!_0x237eb6){_0x369042[_0x5b2d('0x2b')](0x194);}return _0x237eb6;};}function handleError(_0x4f1960,_0x3a8824){_0x3a8824=_0x3a8824||0x1f4;return function(_0x2f992a){logger['error'](_0x2f992a[_0x5b2d('0x39')]);if(_0x2f992a['name']){delete _0x2f992a[_0x5b2d('0x3a')];}_0x4f1960['status'](_0x3a8824)[_0x5b2d('0x3b')](_0x2f992a);};}exports[_0x5b2d('0x3c')]=function(_0x22cc8b,_0x31863a){var _0x56ec51={},_0x21698f={},_0x43112c={'count':0x0,'rows':[]};var _0x78ff00=_['map'](db['ChatMessage']['rawAttributes'],function(_0x3505a0){return{'name':_0x3505a0['fieldName'],'type':_0x3505a0['type']['key']};});_0x21698f[_0x5b2d('0x3d')]=_['map'](_0x78ff00,_0x5b2d('0x3a'));_0x21698f[_0x5b2d('0x3e')]=_[_0x5b2d('0x3f')](_0x22cc8b[_0x5b2d('0x3e')]);_0x21698f[_0x5b2d('0x40')]=_[_0x5b2d('0x41')](_0x21698f[_0x5b2d('0x3d')],_0x21698f[_0x5b2d('0x3e')]);_0x56ec51[_0x5b2d('0x42')]=_['intersection'](_0x21698f[_0x5b2d('0x3d')],qs[_0x5b2d('0x43')](_0x22cc8b[_0x5b2d('0x3e')][_0x5b2d('0x43')]));_0x56ec51[_0x5b2d('0x42')]=_0x56ec51['attributes'][_0x5b2d('0x44')]?_0x56ec51[_0x5b2d('0x42')]:_0x21698f[_0x5b2d('0x3d')];if(!_0x22cc8b[_0x5b2d('0x3e')][_0x5b2d('0x45')]('nolimit')){_0x56ec51[_0x5b2d('0x2f')]=qs[_0x5b2d('0x2f')](_0x22cc8b[_0x5b2d('0x3e')][_0x5b2d('0x2f')]);_0x56ec51[_0x5b2d('0x2e')]=qs[_0x5b2d('0x2e')](_0x22cc8b[_0x5b2d('0x3e')]['offset']);}_0x56ec51[_0x5b2d('0x46')]=qs[_0x5b2d('0x47')](_0x22cc8b[_0x5b2d('0x3e')]['sort']);_0x56ec51[_0x5b2d('0x48')]=qs['filters'](_['pick'](_0x22cc8b['query'],_0x21698f[_0x5b2d('0x40')]),_0x78ff00);if(_0x22cc8b[_0x5b2d('0x3e')][_0x5b2d('0x49')]){_0x56ec51[_0x5b2d('0x48')]=_[_0x5b2d('0x4a')](_0x56ec51[_0x5b2d('0x48')],{'$or':_['map'](_0x78ff00,function(_0xeb5ddd){if(_0xeb5ddd[_0x5b2d('0x4b')]!==_0x5b2d('0x4c')){var _0x429f78={};_0x429f78[_0xeb5ddd[_0x5b2d('0x3a')]]={'$like':'%'+_0x22cc8b[_0x5b2d('0x3e')][_0x5b2d('0x49')]+'%'};return _0x429f78;}})});}_0x56ec51=_['merge']({},_0x56ec51,_0x22cc8b[_0x5b2d('0x4d')]);var _0x5d905d={'where':_0x56ec51[_0x5b2d('0x48')]};return db[_0x5b2d('0x4e')]['count'](_0x5d905d)[_0x5b2d('0x37')](function(_0x117e04){_0x43112c[_0x5b2d('0x31')]=_0x117e04;if(_0x22cc8b[_0x5b2d('0x3e')][_0x5b2d('0x4f')]){_0x56ec51[_0x5b2d('0x50')]=[{'all':!![]}];}return db[_0x5b2d('0x4e')][_0x5b2d('0x51')](_0x56ec51);})[_0x5b2d('0x37')](function(_0x32b8f6){_0x43112c[_0x5b2d('0x52')]=_0x32b8f6;return _0x43112c;})[_0x5b2d('0x37')](respondWithFilteredResult(_0x31863a,_0x56ec51))[_0x5b2d('0x2a')](handleError(_0x31863a,null));};exports[_0x5b2d('0x53')]=function(_0x16d958,_0x34f6f5){var _0x440921={'raw':!![],'where':{'id':_0x16d958[_0x5b2d('0x54')]['id']}},_0x1da2e3={};_0x1da2e3['model']=_[_0x5b2d('0x3f')](db[_0x5b2d('0x4e')][_0x5b2d('0x55')]);_0x1da2e3[_0x5b2d('0x3e')]=_[_0x5b2d('0x3f')](_0x16d958[_0x5b2d('0x3e')]);_0x1da2e3[_0x5b2d('0x40')]=_[_0x5b2d('0x41')](_0x1da2e3['model'],_0x1da2e3['query']);_0x440921[_0x5b2d('0x42')]=_['intersection'](_0x1da2e3['model'],qs['fields'](_0x16d958['query']['fields']));_0x440921[_0x5b2d('0x42')]=_0x440921[_0x5b2d('0x42')][_0x5b2d('0x44')]?_0x440921[_0x5b2d('0x42')]:_0x1da2e3['model'];if(_0x16d958['query'][_0x5b2d('0x4f')]){_0x440921[_0x5b2d('0x50')]=[{'all':!![]}];}_0x440921=_[_0x5b2d('0x4a')]({},_0x440921,_0x16d958[_0x5b2d('0x4d')]);return db[_0x5b2d('0x4e')][_0x5b2d('0x56')](_0x440921)[_0x5b2d('0x37')](handleEntityNotFound(_0x34f6f5,null))[_0x5b2d('0x37')](respondWithResult(_0x34f6f5,null))[_0x5b2d('0x2a')](handleError(_0x34f6f5,null));};exports[_0x5b2d('0x57')]=function(_0xa93c7,_0x4f65c0){return db['ChatMessage'][_0x5b2d('0x57')](_0xa93c7[_0x5b2d('0x58')],{})['then'](respondWithResult(_0x4f65c0,0xc9))[_0x5b2d('0x2a')](handleError(_0x4f65c0,null));};exports[_0x5b2d('0x35')]=function(_0x1e1cad,_0x31614d){if(_0x1e1cad[_0x5b2d('0x58')]['id']){delete _0x1e1cad['body']['id'];}return db[_0x5b2d('0x4e')][_0x5b2d('0x56')]({'where':{'id':_0x1e1cad[_0x5b2d('0x54')]['id']}})['then'](handleEntityNotFound(_0x31614d,null))[_0x5b2d('0x37')](saveUpdates(_0x1e1cad[_0x5b2d('0x58')],null))[_0x5b2d('0x37')](respondWithResult(_0x31614d,null))[_0x5b2d('0x2a')](handleError(_0x31614d,null));};exports[_0x5b2d('0x36')]=function(_0x35d0f5,_0x1221b1){return db[_0x5b2d('0x4e')][_0x5b2d('0x56')]({'where':{'id':_0x35d0f5['params']['id']}})['then'](handleEntityNotFound(_0x1221b1,null))[_0x5b2d('0x37')](removeEntity(_0x1221b1,null))[_0x5b2d('0x2a')](handleError(_0x1221b1,null));};exports['describe']=function(_0x52d4c4,_0x370579){return db[_0x5b2d('0x4e')][_0x5b2d('0x59')]()[_0x5b2d('0x37')](respondWithResult(_0x370579,null))[_0x5b2d('0x2a')](handleError(_0x370579,null));};var interaction_log=require('../../config/logger')(_0x5b2d('0x5a'));exports['accept']=function(_0x162714,_0x5c5e4d,_0x3596e1){var _0x5bf68e={'agent':{},'channel':_0x5b2d('0x5b')};if(_0x162714['body']['id']){delete _0x162714[_0x5b2d('0x58')]['id'];}_0x162714[_0x5b2d('0x58')]['read']=!![];_0x162714['body']['readAt']=moment()[_0x5b2d('0x5c')](_0x5b2d('0x5d'));_0x162714[_0x5b2d('0x58')][_0x5b2d('0x5e')]=_0x162714[_0x5b2d('0x58')][_0x5b2d('0x5e')]||_0x162714[_0x5b2d('0x5f')]['id'];_0x5bf68e[_0x5b2d('0x60')]['id']=_0x162714[_0x5b2d('0x58')][_0x5b2d('0x5e')];return db['ChatMessage'][_0x5b2d('0x56')]({'where':{'id':_0x162714[_0x5b2d('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5c5e4d,null))[_0x5b2d('0x37')](saveUpdates(_0x162714[_0x5b2d('0x58')],null))[_0x5b2d('0x37')](function(_0x572c36){if(_0x572c36){_0x5bf68e[_0x5b2d('0x27')]=_0x572c36[_0x5b2d('0x61')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x572c36[_0x5b2d('0x62')]}});}return null;})[_0x5b2d('0x37')](handleEntityNotFound(_0x5c5e4d,null))[_0x5b2d('0x37')](function(_0x56e19e){if(_0x56e19e){return _0x56e19e[_0x5b2d('0x35')]({'UserId':_0x162714[_0x5b2d('0x58')]['UserId'],'read1stAt':_[_0x5b2d('0x63')](_0x56e19e[_0x5b2d('0x64')])?moment()[_0x5b2d('0x5c')](_0x5b2d('0x5d')):undefined});}return null;})[_0x5b2d('0x37')](function(_0x28ef01){if(_0x28ef01){_0x5bf68e[_0x5b2d('0x65')]=_0x28ef01['get']({'plain':!![]});interaction_log[_0x5b2d('0x20')](_0x5b2d('0x66'),_0x162714[_0x5b2d('0x5f')]['id'],_0x162714[_0x5b2d('0x5f')][_0x5b2d('0x3a')],_0x162714[_0x5b2d('0x5f')][_0x5b2d('0x67')],_0x5bf68e['interaction']['id'],_0x162714[_0x5b2d('0x58')]?JSON[_0x5b2d('0x24')](_0x162714[_0x5b2d('0x58')]):_0x5b2d('0x68'));return respondWithRpcPromise(_0x5b2d('0x69'),_0x5b2d('0x6a'),_0x5bf68e);}return null;})['then'](function(_0x259094){var _0x5dadb0=_0x5b2d('0x6b')+_0x259094[_0x5b2d('0x27')][_0x5b2d('0x6c')];return db[_0x5b2d('0x6d')][_0x5b2d('0x3e')](_0x5dadb0,{'type':db['Sequelize'][_0x5b2d('0x6e')]['SELECT'],'raw':!![]})[_0x5b2d('0x37')](function(_0x4a0efc){return _0x4a0efc;});})[_0x5b2d('0x37')](function(_0x548c7c){if(_0x548c7c){_0x5bf68e['message'][_0x5b2d('0x6f')]=_0x548c7c[0x0];if(!_0x162714[_0x5b2d('0x58')][_0x5b2d('0x5e')])return;return db[_0x5b2d('0x70')]['find']({'where':{'id':_0x162714['body'][_0x5b2d('0x5e')],'role':_0x5b2d('0x60')},'attributes':['id',_0x5b2d('0x3a'),_0x5b2d('0x71'),_0x5b2d('0x72'),_0x5b2d('0x73')],'raw':!![]});}return null;})[_0x5b2d('0x37')](function(_0x2cf682){if(!_0x2cf682)return null;_0x5bf68e[_0x5b2d('0x27')][_0x5b2d('0x60')]=_0x2cf682;return _0x5bf68e;})[_0x5b2d('0x37')](function(_0x302e92){if(_0x302e92){if(_0x162714['body']['manual']){_0x5bf68e[_0x5b2d('0x27')]['interface']=util[_0x5b2d('0x5c')]('SIP/%s',_0x162714[_0x5b2d('0x5f')][_0x5b2d('0x3a')]);_0x5bf68e['message'][_0x5b2d('0x74')]=_0x5bf68e[_0x5b2d('0x74')];_0x5bf68e['message'][_0x5b2d('0x75')]=_0x5bf68e[_0x5b2d('0x74')];_0x5bf68e[_0x5b2d('0x27')][_0x5b2d('0x76')]=_0x5b2d('0x77');return respondWithRpcPromise(_0x5b2d('0x78'),_0x5b2d('0x78'),{'event':_0x5b2d('0x79'),'message':_['merge'](_0x5bf68e['message'],JSON[_0x5b2d('0x7a')](_0x5bf68e[_0x5b2d('0x65')][_0x5b2d('0x7b')]))},client9002)['then'](function(){return _0x5bf68e;});}return _0x5bf68e;}return null;})[_0x5b2d('0x37')](respondWithResult(_0x5c5e4d,null))['catch'](handleError(_0x5c5e4d,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x5b2d('0x33')]=function(_0x5c070a,_0x3b57b1,_0x201cd4){var _0x5224ee={'agent':{},'channel':_0x5b2d('0x5b')};if(_0x5c070a[_0x5b2d('0x58')]['id']){delete _0x5c070a[_0x5b2d('0x58')]['id'];}_0x5c070a['body'][_0x5b2d('0x5e')]=_0x5c070a[_0x5b2d('0x58')][_0x5b2d('0x5e')]||_0x5c070a[_0x5b2d('0x5f')]['id'];_0x5224ee[_0x5b2d('0x60')]['id']=_0x5c070a[_0x5b2d('0x58')][_0x5b2d('0x5e')];return db[_0x5b2d('0x4e')][_0x5b2d('0x56')]({'where':{'id':_0x5c070a[_0x5b2d('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3b57b1,null))['then'](function(_0x35ca0d){if(_0x35ca0d){_0x5224ee[_0x5b2d('0x27')]=_0x35ca0d[_0x5b2d('0x61')]({'plain':!![]});return db[_0x5b2d('0x7c')][_0x5b2d('0x56')]({'where':{'id':_0x35ca0d['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3b57b1,null))['then'](function(_0x2df031){if(_0x2df031){_0x5224ee['interaction']=_0x2df031[_0x5b2d('0x61')]({'plain':!![]});interaction_log['info'](_0x5b2d('0x7d'),_0x5c070a[_0x5b2d('0x5f')]['id'],_0x5c070a[_0x5b2d('0x5f')][_0x5b2d('0x3a')],_0x5c070a[_0x5b2d('0x5f')][_0x5b2d('0x67')],_0x5224ee[_0x5b2d('0x65')]['id'],_0x5c070a[_0x5b2d('0x58')]?JSON['stringify'](_0x5c070a['body']):_0x5b2d('0x68'));return respondWithRpcPromise(_0x5b2d('0x7e'),_0x5b2d('0x7f'),_0x5224ee);}return null;})['then'](function(_0x25bcd4){var _0x46f5c1=_0x5b2d('0x6b')+_0x25bcd4[_0x5b2d('0x27')]['ContactId'];return db[_0x5b2d('0x6d')][_0x5b2d('0x3e')](_0x46f5c1,{'type':db[_0x5b2d('0x80')][_0x5b2d('0x6e')][_0x5b2d('0x81')],'raw':!![]})[_0x5b2d('0x37')](function(_0x446694){return _0x446694;});})['then'](function(_0x1d5ac5){if(_0x1d5ac5){_0x5224ee['message'][_0x5b2d('0x6f')]=_0x1d5ac5[0x0];if(!_0x5c070a[_0x5b2d('0x58')][_0x5b2d('0x5e')])return;return db[_0x5b2d('0x70')][_0x5b2d('0x56')]({'where':{'id':_0x5c070a['body'][_0x5b2d('0x5e')],'role':_0x5b2d('0x60')},'attributes':['id',_0x5b2d('0x3a'),'fullname',_0x5b2d('0x72'),'internal'],'raw':!![]});}return null;})[_0x5b2d('0x37')](function(_0x16bf1d){if(!_0x16bf1d)return null;_0x5224ee[_0x5b2d('0x27')]['agent']=_0x16bf1d;return _0x5224ee;})[_0x5b2d('0x37')](function(_0x549ed1){if(_0x549ed1){_0x549ed1[_0x5b2d('0x27')]['interface']=util[_0x5b2d('0x5c')](_0x5b2d('0x82'),_0x5c070a[_0x5b2d('0x5f')][_0x5b2d('0x3a')]);_0x549ed1[_0x5b2d('0x27')][_0x5b2d('0x74')]=_0x5224ee[_0x5b2d('0x74')];_0x549ed1['message']['motionChannel']=_0x5224ee[_0x5b2d('0x74')];_0x549ed1[_0x5b2d('0x27')][_0x5b2d('0x76')]='reject';respondWithRpcPromise(_0x5b2d('0x78'),'EventManager',{'event':_0x5b2d('0x83'),'message':_[_0x5b2d('0x4a')](_0x5224ee[_0x5b2d('0x27')],JSON[_0x5b2d('0x7a')](_0x5224ee[_0x5b2d('0x65')]['formData']))},client9002);return _0x5224ee;}return null;})[_0x5b2d('0x37')](respondWithResult(_0x3b57b1,null))[_0x5b2d('0x2a')](handleError(_0x3b57b1,null));};
\ No newline at end of file
+var _0xa369=['fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','offset','undefined','count','limit','set','json','reject','save','update','destroy','sendStatus','name','send','index','map','ChatMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','show','params','fields','find','create','body','describe','../../config/logger','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','ChatInteraction','role','RejectMessage','rejectMessage','rejectmessage','rimraf'];(function(_0x482790,_0x280ef1){var _0x1ea5c8=function(_0x2925fd){while(--_0x2925fd){_0x482790['push'](_0x482790['shift']());}};_0x1ea5c8(++_0x280ef1);}(_0xa369,0x107));var _0x9a36=function(_0x434b43,_0x2e0a0d){_0x434b43=_0x434b43-0x0;var _0x179ecc=_0xa369[_0x434b43];return _0x179ecc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a36('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a36('0x1'));var rp=require(_0x9a36('0x2'));var moment=require(_0x9a36('0x3'));var BPromise=require(_0x9a36('0x4'));var Mustache=require(_0x9a36('0x5'));var util=require(_0x9a36('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9a36('0x7'));var fs=require('fs');var fs_extra=require(_0x9a36('0x8'));var _=require(_0x9a36('0x9'));var squel=require(_0x9a36('0xa'));var crypto=require(_0x9a36('0xb'));var jsforce=require(_0x9a36('0xc'));var deskjs=require(_0x9a36('0xd'));var toCsv=require(_0x9a36('0xe'));var querystring=require(_0x9a36('0xf'));var Papa=require(_0x9a36('0x10'));var Redis=require(_0x9a36('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9a36('0x12'));var as=require(_0x9a36('0x13'));var hardwareService=require(_0x9a36('0x14'));var logger=require('../../config/logger')(_0x9a36('0x15'));var utils=require('../../config/utils');var config=require(_0x9a36('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a36('0x17'))['db'];config[_0x9a36('0x18')]=_[_0x9a36('0x19')](config[_0x9a36('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x9a36('0x1a'))(new Redis(config[_0x9a36('0x18')]));require('./chatMessage.socket')[_0x9a36('0x1b')](socket);var jayson=require(_0x9a36('0x1c'));var client=jayson[_0x9a36('0x1d')][_0x9a36('0x1e')]({'port':0x232c});var client9002=jayson[_0x9a36('0x1d')][_0x9a36('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5f4b85,_0x350dab,_0x4a1333,_0x398035){return new BPromise(function(_0x2081ec,_0xafa2ec){var _0x4b13cd=_0x398035||client;return _0x4b13cd[_0x9a36('0x1f')](_0x5f4b85,_0x4a1333)[_0x9a36('0x20')](function(_0x1d5499){logger[_0x9a36('0x21')](_0x9a36('0x22'),_0x350dab,_0x9a36('0x23'));logger[_0x9a36('0x24')](_0x9a36('0x25'),_0x350dab,'request\x20sent',JSON[_0x9a36('0x26')](_0x1d5499));if(_0x1d5499[_0x9a36('0x27')]){if(_0x1d5499['error'][_0x9a36('0x28')]===0x1f4){logger[_0x9a36('0x27')](_0x9a36('0x22'),_0x350dab,_0x1d5499[_0x9a36('0x27')][_0x9a36('0x29')]);return _0xafa2ec(_0x1d5499['error'][_0x9a36('0x29')]);}logger[_0x9a36('0x27')]('ChatMessage,\x20%s,\x20%s',_0x350dab,_0x1d5499[_0x9a36('0x27')][_0x9a36('0x29')]);return _0x2081ec(_0x1d5499['error']['message']);}else{logger[_0x9a36('0x21')](_0x9a36('0x22'),_0x350dab,_0x9a36('0x23'));_0x2081ec(_0x1d5499['result']['message']);}})[_0x9a36('0x2a')](function(_0x1a117e){logger[_0x9a36('0x27')]('ChatMessage,\x20%s,\x20%s',_0x350dab,_0x1a117e);_0xafa2ec(_0x1a117e);});});}function respondWithStatusCode(_0x521546,_0x4bcc13){_0x4bcc13=_0x4bcc13||0xcc;return function(_0x11a99d){if(_0x11a99d){return _0x521546['sendStatus'](_0x4bcc13);}return _0x521546[_0x9a36('0x2b')](_0x4bcc13)['end']();};}function respondWithResult(_0x463d8d,_0x417b62){_0x417b62=_0x417b62||0xc8;return function(_0x40196e){if(_0x40196e){return _0x463d8d[_0x9a36('0x2b')](_0x417b62)['json'](_0x40196e);}};}function respondWithFilteredResult(_0x3747f1,_0x45a2d2){return function(_0x2bff7b){if(_0x2bff7b){var _0x1fcf0a=typeof _0x45a2d2[_0x9a36('0x2c')]===_0x9a36('0x2d')&&typeof _0x45a2d2['limit']===_0x9a36('0x2d');var _0x3df796=_0x2bff7b[_0x9a36('0x2e')];var _0x50b1f6=_0x1fcf0a?0x0:_0x45a2d2[_0x9a36('0x2c')];var _0x328b21=_0x1fcf0a?_0x2bff7b[_0x9a36('0x2e')]:_0x45a2d2['offset']+_0x45a2d2[_0x9a36('0x2f')];var _0x156d00;if(_0x328b21>=_0x3df796){_0x328b21=_0x3df796;_0x156d00=0xc8;}else{_0x156d00=0xce;}_0x3747f1['status'](_0x156d00);return _0x3747f1[_0x9a36('0x30')]('Content-Range',_0x50b1f6+'-'+_0x328b21+'/'+_0x3df796)[_0x9a36('0x31')](_0x2bff7b);}return null;};}function patchUpdates(_0x24c62a){return function(_0x1a3407){try{jsonpatch['apply'](_0x1a3407,_0x24c62a,!![]);}catch(_0x20f8db){return BPromise[_0x9a36('0x32')](_0x20f8db);}return _0x1a3407[_0x9a36('0x33')]();};}function saveUpdates(_0x4b4d1d,_0x3fdfc4){return function(_0xda446e){if(_0xda446e){return _0xda446e[_0x9a36('0x34')](_0x4b4d1d)[_0x9a36('0x20')](function(_0x4b59fe){return _0x4b59fe;});}return null;};}function removeEntity(_0x25fa90,_0x38461b){return function(_0x1908c8){if(_0x1908c8){return _0x1908c8[_0x9a36('0x35')]()['then'](function(){_0x25fa90[_0x9a36('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x619848,_0x78336a){return function(_0x4eb519){if(!_0x4eb519){_0x619848[_0x9a36('0x36')](0x194);}return _0x4eb519;};}function handleError(_0x3abee4,_0x29777c){_0x29777c=_0x29777c||0x1f4;return function(_0x48c3eb){logger[_0x9a36('0x27')](_0x48c3eb['stack']);if(_0x48c3eb[_0x9a36('0x37')]){delete _0x48c3eb['name'];}_0x3abee4[_0x9a36('0x2b')](_0x29777c)[_0x9a36('0x38')](_0x48c3eb);};}exports[_0x9a36('0x39')]=function(_0x5f1f72,_0x178b47){var _0x46dc9e={},_0x5c883d={},_0x4e69d0={'count':0x0,'rows':[]};var _0x19a59e=_[_0x9a36('0x3a')](db[_0x9a36('0x3b')][_0x9a36('0x3c')],function(_0x20c67d){return{'name':_0x20c67d[_0x9a36('0x3d')],'type':_0x20c67d['type']['key']};});_0x5c883d[_0x9a36('0x3e')]=_[_0x9a36('0x3a')](_0x19a59e,_0x9a36('0x37'));_0x5c883d[_0x9a36('0x3f')]=_[_0x9a36('0x40')](_0x5f1f72[_0x9a36('0x3f')]);_0x5c883d[_0x9a36('0x41')]=_['intersection'](_0x5c883d[_0x9a36('0x3e')],_0x5c883d[_0x9a36('0x3f')]);_0x46dc9e['attributes']=_[_0x9a36('0x42')](_0x5c883d[_0x9a36('0x3e')],qs['fields'](_0x5f1f72[_0x9a36('0x3f')]['fields']));_0x46dc9e['attributes']=_0x46dc9e['attributes'][_0x9a36('0x43')]?_0x46dc9e[_0x9a36('0x44')]:_0x5c883d[_0x9a36('0x3e')];if(!_0x5f1f72['query'][_0x9a36('0x45')](_0x9a36('0x46'))){_0x46dc9e[_0x9a36('0x2f')]=qs[_0x9a36('0x2f')](_0x5f1f72[_0x9a36('0x3f')][_0x9a36('0x2f')]);_0x46dc9e[_0x9a36('0x2c')]=qs['offset'](_0x5f1f72['query'][_0x9a36('0x2c')]);}_0x46dc9e[_0x9a36('0x47')]=qs[_0x9a36('0x48')](_0x5f1f72['query'][_0x9a36('0x48')]);_0x46dc9e[_0x9a36('0x49')]=qs['filters'](_[_0x9a36('0x4a')](_0x5f1f72['query'],_0x5c883d[_0x9a36('0x41')]),_0x19a59e);if(_0x5f1f72[_0x9a36('0x3f')]['filter']){_0x46dc9e['where']=_[_0x9a36('0x4b')](_0x46dc9e[_0x9a36('0x49')],{'$or':_[_0x9a36('0x3a')](_0x19a59e,function(_0x41d72f){if(_0x41d72f[_0x9a36('0x4c')]!==_0x9a36('0x4d')){var _0x5c282e={};_0x5c282e[_0x41d72f[_0x9a36('0x37')]]={'$like':'%'+_0x5f1f72[_0x9a36('0x3f')][_0x9a36('0x4e')]+'%'};return _0x5c282e;}})});}_0x46dc9e=_['merge']({},_0x46dc9e,_0x5f1f72[_0x9a36('0x4f')]);var _0x3fe872={'where':_0x46dc9e[_0x9a36('0x49')]};return db[_0x9a36('0x3b')]['count'](_0x3fe872)[_0x9a36('0x20')](function(_0x1edbce){_0x4e69d0['count']=_0x1edbce;if(_0x5f1f72[_0x9a36('0x3f')][_0x9a36('0x50')]){_0x46dc9e[_0x9a36('0x51')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x46dc9e);})['then'](function(_0x3b66cd){_0x4e69d0[_0x9a36('0x52')]=_0x3b66cd;return _0x4e69d0;})['then'](respondWithFilteredResult(_0x178b47,_0x46dc9e))[_0x9a36('0x2a')](handleError(_0x178b47,null));};exports[_0x9a36('0x53')]=function(_0x391b1f,_0x2775ce){var _0x164cf3={'raw':!![],'where':{'id':_0x391b1f[_0x9a36('0x54')]['id']}},_0x400074={};_0x400074[_0x9a36('0x3e')]=_['keys'](db['ChatMessage'][_0x9a36('0x3c')]);_0x400074[_0x9a36('0x3f')]=_['keys'](_0x391b1f['query']);_0x400074[_0x9a36('0x41')]=_[_0x9a36('0x42')](_0x400074['model'],_0x400074[_0x9a36('0x3f')]);_0x164cf3['attributes']=_[_0x9a36('0x42')](_0x400074[_0x9a36('0x3e')],qs[_0x9a36('0x55')](_0x391b1f[_0x9a36('0x3f')][_0x9a36('0x55')]));_0x164cf3[_0x9a36('0x44')]=_0x164cf3['attributes'][_0x9a36('0x43')]?_0x164cf3[_0x9a36('0x44')]:_0x400074['model'];if(_0x391b1f[_0x9a36('0x3f')][_0x9a36('0x50')]){_0x164cf3[_0x9a36('0x51')]=[{'all':!![]}];}_0x164cf3=_[_0x9a36('0x4b')]({},_0x164cf3,_0x391b1f[_0x9a36('0x4f')]);return db['ChatMessage'][_0x9a36('0x56')](_0x164cf3)[_0x9a36('0x20')](handleEntityNotFound(_0x2775ce,null))[_0x9a36('0x20')](respondWithResult(_0x2775ce,null))[_0x9a36('0x2a')](handleError(_0x2775ce,null));};exports[_0x9a36('0x57')]=function(_0x38b477,_0x4e7873){return db['ChatMessage']['create'](_0x38b477[_0x9a36('0x58')],{})[_0x9a36('0x20')](respondWithResult(_0x4e7873,0xc9))[_0x9a36('0x2a')](handleError(_0x4e7873,null));};exports[_0x9a36('0x34')]=function(_0x52fd56,_0xe0818a){if(_0x52fd56['body']['id']){delete _0x52fd56[_0x9a36('0x58')]['id'];}return db[_0x9a36('0x3b')][_0x9a36('0x56')]({'where':{'id':_0x52fd56[_0x9a36('0x54')]['id']}})['then'](handleEntityNotFound(_0xe0818a,null))[_0x9a36('0x20')](saveUpdates(_0x52fd56[_0x9a36('0x58')],null))[_0x9a36('0x20')](respondWithResult(_0xe0818a,null))[_0x9a36('0x2a')](handleError(_0xe0818a,null));};exports['destroy']=function(_0x36ce2b,_0x30408a){return db[_0x9a36('0x3b')]['find']({'where':{'id':_0x36ce2b[_0x9a36('0x54')]['id']}})[_0x9a36('0x20')](handleEntityNotFound(_0x30408a,null))[_0x9a36('0x20')](removeEntity(_0x30408a,null))[_0x9a36('0x2a')](handleError(_0x30408a,null));};exports['describe']=function(_0x2ef047,_0x4d6e73){return db[_0x9a36('0x3b')][_0x9a36('0x59')]()[_0x9a36('0x20')](respondWithResult(_0x4d6e73,null))['catch'](handleError(_0x4d6e73,null));};var interaction_log=require(_0x9a36('0x5a'))(_0x9a36('0x5b'));exports[_0x9a36('0x5c')]=function(_0x307079,_0x331345,_0x30d067){var _0x21e3c6={'agent':{},'channel':_0x9a36('0x5d')};if(_0x307079[_0x9a36('0x58')]['id']){delete _0x307079[_0x9a36('0x58')]['id'];}_0x307079[_0x9a36('0x58')]['read']=!![];_0x307079['body'][_0x9a36('0x5e')]=moment()[_0x9a36('0x5f')](_0x9a36('0x60'));_0x307079['body']['UserId']=_0x307079[_0x9a36('0x58')][_0x9a36('0x61')]||_0x307079[_0x9a36('0x62')]['id'];_0x21e3c6[_0x9a36('0x63')]['id']=_0x307079[_0x9a36('0x58')][_0x9a36('0x61')];return db[_0x9a36('0x3b')]['find']({'where':{'id':_0x307079['params']['id'],'UserId':null}})[_0x9a36('0x20')](handleEntityNotFound(_0x331345,null))[_0x9a36('0x20')](saveUpdates(_0x307079[_0x9a36('0x58')],null))['then'](function(_0x49fd0d){if(_0x49fd0d){_0x21e3c6[_0x9a36('0x29')]=_0x49fd0d[_0x9a36('0x64')]({'plain':!![]});return db['ChatInteraction'][_0x9a36('0x56')]({'where':{'id':_0x49fd0d[_0x9a36('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x331345,null))[_0x9a36('0x20')](function(_0x4987d5){if(_0x4987d5){return _0x4987d5[_0x9a36('0x34')]({'UserId':_0x307079[_0x9a36('0x58')]['UserId'],'read1stAt':_['isNil'](_0x4987d5[_0x9a36('0x66')])?moment()['format'](_0x9a36('0x60')):undefined});}return null;})[_0x9a36('0x20')](function(_0x23687c){if(_0x23687c){_0x21e3c6[_0x9a36('0x67')]=_0x23687c[_0x9a36('0x64')]({'plain':!![]});interaction_log[_0x9a36('0x21')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x307079['user']['id'],_0x307079[_0x9a36('0x62')][_0x9a36('0x37')],_0x307079['user']['role'],_0x21e3c6['interaction']['id'],_0x307079[_0x9a36('0x58')]?JSON[_0x9a36('0x26')](_0x307079[_0x9a36('0x58')]):_0x9a36('0x68'));return respondWithRpcPromise(_0x9a36('0x69'),_0x9a36('0x6a'),_0x21e3c6);}return null;})[_0x9a36('0x20')](function(_0x26ecd6){var _0x11a234=_0x9a36('0x6b')+_0x26ecd6[_0x9a36('0x29')][_0x9a36('0x6c')];return db[_0x9a36('0x6d')][_0x9a36('0x3f')](_0x11a234,{'type':db[_0x9a36('0x6e')][_0x9a36('0x6f')][_0x9a36('0x70')],'raw':!![]})[_0x9a36('0x20')](function(_0x31cd7d){return _0x31cd7d;});})['then'](function(_0x189d42){if(_0x189d42){_0x21e3c6[_0x9a36('0x29')][_0x9a36('0x71')]=_0x189d42[0x0];if(!_0x307079[_0x9a36('0x58')][_0x9a36('0x61')])return;return db['User'][_0x9a36('0x56')]({'where':{'id':_0x307079[_0x9a36('0x58')][_0x9a36('0x61')],'role':_0x9a36('0x63')},'attributes':['id',_0x9a36('0x37'),_0x9a36('0x72'),_0x9a36('0x73'),_0x9a36('0x74')],'raw':!![]});}return null;})[_0x9a36('0x20')](function(_0x54cad4){if(!_0x54cad4)return null;_0x21e3c6[_0x9a36('0x29')][_0x9a36('0x63')]=_0x54cad4;return _0x21e3c6;})[_0x9a36('0x20')](function(_0x399492){if(_0x399492){if(_0x307079[_0x9a36('0x58')][_0x9a36('0x75')]){_0x21e3c6[_0x9a36('0x29')][_0x9a36('0x76')]=util[_0x9a36('0x5f')](_0x9a36('0x77'),_0x307079[_0x9a36('0x62')][_0x9a36('0x37')]);_0x21e3c6[_0x9a36('0x29')][_0x9a36('0x78')]=_0x21e3c6['channel'];_0x21e3c6[_0x9a36('0x29')][_0x9a36('0x79')]=_0x21e3c6['channel'];_0x21e3c6[_0x9a36('0x29')][_0x9a36('0x7a')]='accept';return respondWithRpcPromise('EventManager',_0x9a36('0x7b'),{'event':_0x9a36('0x7c'),'message':_[_0x9a36('0x4b')](_0x21e3c6['message'],JSON[_0x9a36('0x7d')](_0x21e3c6['interaction'][_0x9a36('0x7e')]))},client9002)[_0x9a36('0x20')](function(){return _0x21e3c6;});}return _0x21e3c6;}return null;})[_0x9a36('0x20')](respondWithResult(_0x331345,null))[_0x9a36('0x2a')](handleError(_0x331345,null));};var interaction_log=require(_0x9a36('0x5a'))('chat-interactions');exports[_0x9a36('0x32')]=function(_0x55f984,_0x48e637,_0x9ac26e){var _0x1b195a={'agent':{},'channel':'chat'};if(_0x55f984['body']['id']){delete _0x55f984['body']['id'];}_0x55f984[_0x9a36('0x58')][_0x9a36('0x61')]=_0x55f984[_0x9a36('0x58')][_0x9a36('0x61')]||_0x55f984[_0x9a36('0x62')]['id'];_0x1b195a['agent']['id']=_0x55f984[_0x9a36('0x58')]['UserId'];return db[_0x9a36('0x3b')]['find']({'where':{'id':_0x55f984[_0x9a36('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48e637,null))['then'](function(_0x40b09a){if(_0x40b09a){_0x1b195a[_0x9a36('0x29')]=_0x40b09a[_0x9a36('0x64')]({'plain':!![]});return db[_0x9a36('0x7f')][_0x9a36('0x56')]({'where':{'id':_0x40b09a[_0x9a36('0x65')]}});}return null;})[_0x9a36('0x20')](handleEntityNotFound(_0x48e637,null))['then'](function(_0x436385){if(_0x436385){_0x1b195a['interaction']=_0x436385[_0x9a36('0x64')]({'plain':!![]});interaction_log[_0x9a36('0x21')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x55f984[_0x9a36('0x62')]['id'],_0x55f984['user'][_0x9a36('0x37')],_0x55f984[_0x9a36('0x62')][_0x9a36('0x80')],_0x1b195a[_0x9a36('0x67')]['id'],_0x55f984[_0x9a36('0x58')]?JSON[_0x9a36('0x26')](_0x55f984['body']):_0x9a36('0x68'));return respondWithRpcPromise(_0x9a36('0x81'),_0x9a36('0x82'),_0x1b195a);}return null;})[_0x9a36('0x20')](function(_0x1e855d){var _0xc7c0c4=_0x9a36('0x6b')+_0x1e855d[_0x9a36('0x29')][_0x9a36('0x6c')];return db[_0x9a36('0x6d')][_0x9a36('0x3f')](_0xc7c0c4,{'type':db[_0x9a36('0x6e')]['QueryTypes']['SELECT'],'raw':!![]})[_0x9a36('0x20')](function(_0x19bbc8){return _0x19bbc8;});})['then'](function(_0x24421c){if(_0x24421c){_0x1b195a[_0x9a36('0x29')]['contact']=_0x24421c[0x0];if(!_0x55f984[_0x9a36('0x58')][_0x9a36('0x61')])return;return db['User'][_0x9a36('0x56')]({'where':{'id':_0x55f984[_0x9a36('0x58')]['UserId'],'role':'agent'},'attributes':['id',_0x9a36('0x37'),_0x9a36('0x72'),_0x9a36('0x73'),'internal'],'raw':!![]});}return null;})['then'](function(_0x325792){if(!_0x325792)return null;_0x1b195a[_0x9a36('0x29')][_0x9a36('0x63')]=_0x325792;return _0x1b195a;})[_0x9a36('0x20')](function(_0x54b5c9){if(_0x54b5c9){_0x54b5c9['message'][_0x9a36('0x76')]=util[_0x9a36('0x5f')](_0x9a36('0x77'),_0x55f984['user'][_0x9a36('0x37')]);_0x54b5c9[_0x9a36('0x29')][_0x9a36('0x78')]=_0x1b195a[_0x9a36('0x78')];_0x54b5c9[_0x9a36('0x29')][_0x9a36('0x79')]=_0x1b195a[_0x9a36('0x78')];_0x54b5c9[_0x9a36('0x29')][_0x9a36('0x7a')]=_0x9a36('0x32');respondWithRpcPromise('EventManager','EventManager',{'event':_0x9a36('0x83'),'message':_[_0x9a36('0x4b')](_0x1b195a[_0x9a36('0x29')],JSON[_0x9a36('0x7d')](_0x1b195a[_0x9a36('0x67')][_0x9a36('0x7e')]))},client9002);return _0x1b195a;}return null;})[_0x9a36('0x20')](respondWithResult(_0x48e637,null))[_0x9a36('0x2a')](handleError(_0x48e637,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 27e1de5..04f5cb0 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 _0x67c4=['ChatMessage','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x5c2871,_0x9f21e6){var _0x4d962d=function(_0x4069dc){while(--_0x4069dc){_0x5c2871['push'](_0x5c2871['shift']());}};_0x4d962d(++_0x9f21e6);}(_0x67c4,0x179));var _0x467c=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x67c4[_0x178e48];return _0x440d7e;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x467c('0x0'))['db'][_0x467c('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x467c('0x2')](0x0);var events={'afterCreate':_0x467c('0x3'),'afterUpdate':_0x467c('0x4'),'afterDestroy':_0x467c('0x5')};function emitEvent(_0x133ee6){return function(_0x280361,_0x1b0f80,_0x785dec){ChatMessageEvents['emit'](_0x133ee6+':'+_0x280361['id'],_0x280361);ChatMessageEvents['emit'](_0x133ee6,_0x280361);_0x785dec(null);};}for(var e in events){if(events[_0x467c('0x6')](e)){var event=events[e];ChatMessage[_0x467c('0x7')](e,emitEvent(event));}}module[_0x467c('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x4626=['hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','emit'];(function(_0x50d6f7,_0x15a219){var _0x10c70b=function(_0x311e0a){while(--_0x311e0a){_0x50d6f7['push'](_0x50d6f7['shift']());}};_0x10c70b(++_0x15a219);}(_0x4626,0x122));var _0x6462=function(_0x3ab32e,_0x375413){_0x3ab32e=_0x3ab32e-0x0;var _0x3c75ed=_0x4626[_0x3ab32e];return _0x3c75ed;};'use strict';var EventEmitter=require(_0x6462('0x0'));var ChatMessage=require(_0x6462('0x1'))['db'][_0x6462('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6462('0x3')](0x0);var events={'afterCreate':_0x6462('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x23e7f5){return function(_0x21da51,_0x49afc0,_0x1900ed){ChatMessageEvents[_0x6462('0x5')](_0x23e7f5+':'+_0x21da51['id'],_0x21da51);ChatMessageEvents[_0x6462('0x5')](_0x23e7f5,_0x21da51);_0x1900ed(null);};}for(var e in events){if(events[_0x6462('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x6462('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 c486a48..19d6dcb 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 _0xa364=['ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId'];(function(_0x40fd0b,_0xd176ee){var _0x54cbf6=function(_0x153a66){while(--_0x153a66){_0x40fd0b['push'](_0x40fd0b['shift']());}};_0x54cbf6(++_0xd176ee);}(_0xa364,0x133));var _0x4a36=function(_0x43277c,_0xc46b2f){_0x43277c=_0x43277c-0x0;var _0x690371=_0xa364[_0x43277c];return _0x690371;};'use strict';var _=require(_0x4a36('0x0'));var util=require('util');var logger=require(_0x4a36('0x1'))(_0x4a36('0x2'));var moment=require(_0x4a36('0x3'));var BPromise=require(_0x4a36('0x4'));var rp=require(_0x4a36('0x5'));var fs=require('fs');var path=require(_0x4a36('0x6'));var rimraf=require(_0x4a36('0x7'));var config=require('../../config/environment');var attributes=require(_0x4a36('0x8'));module[_0x4a36('0x9')]=function(_0x38d557,_0x4dcf7d){return _0x38d557[_0x4a36('0xa')](_0x4a36('0xb'),attributes,{'tableName':_0x4a36('0xc'),'paranoid':![],'indexes':[{'name':_0x4a36('0xd'),'fields':['body'],'type':_0x4a36('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x215872,_0x75fd00,_0x5f5251){var _0x38a793=_0x38d557[_0x4a36('0xf')];var _0x49f2cc=_0x215872[_0x4a36('0x10')]({'plain':!![]});if(_0x49f2cc['direction'][_0x4a36('0x11')]()==='in'||_0x49f2cc[_0x4a36('0x12')][_0x4a36('0x11')]()===_0x4a36('0x13')&&!_0x49f2cc[_0x4a36('0x14')]&&!_[_0x4a36('0x15')](_0x49f2cc[_0x4a36('0x16')])){_0x38a793[_0x4a36('0x17')][_0x4a36('0x18')]({'where':{'id':_0x49f2cc[_0x4a36('0x19')]}})[_0x4a36('0x1a')](function(_0x400803){if(_0x400803){_0x400803[_0x4a36('0x1b')]({'lastMsgAt':_0x49f2cc[_0x4a36('0x1c')],'lastMsgDirection':_0x49f2cc['direction'][_0x4a36('0x11')]()});}})[_0x4a36('0x1d')](function(_0x3feab7){console[_0x4a36('0x1e')](_0x3feab7);});}_0x5f5251();}},'charset':_0x4a36('0x1f'),'collate':_0x4a36('0x20')});};
\ No newline at end of file
+var _0x3182=['update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','path','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne'];(function(_0x33644b,_0x19371b){var _0x49c65f=function(_0x5e732b){while(--_0x5e732b){_0x33644b['push'](_0x33644b['shift']());}};_0x49c65f(++_0x19371b);}(_0x3182,0x1b6));var _0x2318=function(_0x46e6b3,_0x1f5410){_0x46e6b3=_0x46e6b3-0x0;var _0x3fe8ec=_0x3182[_0x46e6b3];return _0x3fe8ec;};'use strict';var _=require(_0x2318('0x0'));var util=require(_0x2318('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2318('0x2'));var rp=require(_0x2318('0x3'));var fs=require('fs');var path=require(_0x2318('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2318('0x5'));module[_0x2318('0x6')]=function(_0x25a9d7,_0xbb67af){return _0x25a9d7[_0x2318('0x7')]('ChatMessage',attributes,{'tableName':_0x2318('0x8'),'paranoid':![],'indexes':[{'name':_0x2318('0x9'),'fields':['body'],'type':_0x2318('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f2bb2,_0x40acc4,_0x4e9b24){var _0x278127=_0x25a9d7[_0x2318('0xb')];var _0x2cac30=_0x1f2bb2[_0x2318('0xc')]({'plain':!![]});if(_0x2cac30[_0x2318('0xd')]['toLowerCase']()==='in'||_0x2cac30[_0x2318('0xd')][_0x2318('0xe')]()===_0x2318('0xf')&&!_0x2cac30[_0x2318('0x10')]&&!_[_0x2318('0x11')](_0x2cac30[_0x2318('0x12')])){_0x278127[_0x2318('0x13')][_0x2318('0x14')]({'where':{'id':_0x2cac30['ChatInteractionId']}})['then'](function(_0x3ef71d){if(_0x3ef71d){_0x3ef71d[_0x2318('0x15')]({'lastMsgAt':_0x2cac30[_0x2318('0x16')],'lastMsgDirection':_0x2cac30[_0x2318('0xd')][_0x2318('0xe')]()});}})[_0x2318('0x17')](function(_0x19edb3){console[_0x2318('0x18')](_0x19edb3);});}_0x4e9b24();}},'charset':_0x2318('0x19'),'collate':_0x2318('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index f604856..cfe1d86 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 _0xcb32=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ChatMessage','create','body','options','CreateChatMessage','stringify','util','moment'];(function(_0xed90ba,_0x523f6b){var _0x176fee=function(_0x33c54b){while(--_0x33c54b){_0xed90ba['push'](_0xed90ba['shift']());}};_0x176fee(++_0x523f6b);}(_0xcb32,0x177));var _0x2cb3=function(_0x5220cf,_0x1310e3){_0x5220cf=_0x5220cf-0x0;var _0x3535a1=_0xcb32[_0x5220cf];return _0x3535a1;};'use strict';var _=require('lodash');var util=require(_0x2cb3('0x0'));var moment=require(_0x2cb3('0x1'));var BPromise=require('bluebird');var rs=require(_0x2cb3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2cb3('0x3'));var logger=require(_0x2cb3('0x4'))(_0x2cb3('0x5'));var config=require('../../config/environment');var jayson=require(_0x2cb3('0x6'));var client=jayson['client'][_0x2cb3('0x7')]({'port':0x232a});config[_0x2cb3('0x8')]=_[_0x2cb3('0x9')](config[_0x2cb3('0x8')],{'host':_0x2cb3('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2cb3('0x8')]));require(_0x2cb3('0xb'))['register'](socket);function respondWithRpcPromise(_0x2ce70a,_0x3f0ecf,_0x166265){return new BPromise(function(_0xb9e38e,_0x1a6fc2){return client[_0x2cb3('0xc')](_0x2ce70a,_0x166265)[_0x2cb3('0xd')](function(_0x95e600){logger[_0x2cb3('0xe')](_0x2cb3('0xf'),_0x3f0ecf,_0x2cb3('0x10'));logger[_0x2cb3('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3f0ecf,'request\x20sent',JSON['stringify'](_0x95e600));if(_0x95e600[_0x2cb3('0x12')]){if(_0x95e600[_0x2cb3('0x12')][_0x2cb3('0x13')]===0x1f4){logger[_0x2cb3('0x12')](_0x2cb3('0xf'),_0x3f0ecf,_0x95e600[_0x2cb3('0x12')][_0x2cb3('0x14')]);return _0x1a6fc2(_0x95e600[_0x2cb3('0x12')][_0x2cb3('0x14')]);}logger[_0x2cb3('0x12')](_0x2cb3('0xf'),_0x3f0ecf,_0x95e600[_0x2cb3('0x12')][_0x2cb3('0x14')]);return _0xb9e38e(_0x95e600[_0x2cb3('0x12')]['message']);}else{logger[_0x2cb3('0xe')](_0x2cb3('0xf'),_0x3f0ecf,_0x2cb3('0x10'));_0xb9e38e(_0x95e600[_0x2cb3('0x15')][_0x2cb3('0x14')]);}})[_0x2cb3('0x16')](function(_0x3a20d6){logger['error']('ChatMessage,\x20%s,\x20%s',_0x3f0ecf,_0x3a20d6);_0x1a6fc2(_0x3a20d6);});});}exports['CreateChatMessage']=function(_0x3628c0){var _0xdf680d=this;return new Promise(function(_0x2fc2d3,_0x2e1164){return db[_0x2cb3('0x17')][_0x2cb3('0x18')](_0x3628c0[_0x2cb3('0x19')],{'raw':_0x3628c0[_0x2cb3('0x1a')]?_0x3628c0[_0x2cb3('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x2cb3('0xd')](function(_0x358257){logger['info'](_0x2cb3('0x1b'),_0x3628c0);logger[_0x2cb3('0x11')](_0x2cb3('0x1b'),_0x3628c0,JSON[_0x2cb3('0x1c')](_0x358257));_0x2fc2d3(_0x358257);})['catch'](function(_0x21dd1b){logger[_0x2cb3('0x12')](_0x2cb3('0x1b'),_0x21dd1b[_0x2cb3('0x14')],_0x3628c0);_0x2e1164(_0xdf680d[_0x2cb3('0x12')](0x1f4,_0x21dd1b[_0x2cb3('0x14')]));});});};
\ No newline at end of file
+var _0x8c29=['request\x20sent','debug','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s'];(function(_0x4c2b80,_0x2d9078){var _0x21ecf9=function(_0x41b90d){while(--_0x41b90d){_0x4c2b80['push'](_0x4c2b80['shift']());}};_0x21ecf9(++_0x2d9078);}(_0x8c29,0x14c));var _0x98c2=function(_0x4c70a0,_0x22ab1d){_0x4c70a0=_0x4c70a0-0x0;var _0x486e65=_0x8c29[_0x4c70a0];return _0x486e65;};'use strict';var _=require(_0x98c2('0x0'));var util=require(_0x98c2('0x1'));var moment=require(_0x98c2('0x2'));var BPromise=require(_0x98c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98c2('0x4'));var db=require(_0x98c2('0x5'))['db'];var utils=require(_0x98c2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x98c2('0x7'));var jayson=require(_0x98c2('0x8'));var client=jayson[_0x98c2('0x9')][_0x98c2('0xa')]({'port':0x232a});config['redis']=_[_0x98c2('0xb')](config[_0x98c2('0xc')],{'host':_0x98c2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x98c2('0xc')]));require(_0x98c2('0xe'))[_0x98c2('0xf')](socket);function respondWithRpcPromise(_0x1849e0,_0x3351db,_0x360f5f){return new BPromise(function(_0x279234,_0x1614fc){return client[_0x98c2('0x10')](_0x1849e0,_0x360f5f)[_0x98c2('0x11')](function(_0x4c641e){logger[_0x98c2('0x12')](_0x98c2('0x13'),_0x3351db,_0x98c2('0x14'));logger[_0x98c2('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3351db,_0x98c2('0x14'),JSON[_0x98c2('0x16')](_0x4c641e));if(_0x4c641e[_0x98c2('0x17')]){if(_0x4c641e['error']['code']===0x1f4){logger[_0x98c2('0x17')](_0x98c2('0x13'),_0x3351db,_0x4c641e[_0x98c2('0x17')][_0x98c2('0x18')]);return _0x1614fc(_0x4c641e[_0x98c2('0x17')][_0x98c2('0x18')]);}logger[_0x98c2('0x17')](_0x98c2('0x13'),_0x3351db,_0x4c641e[_0x98c2('0x17')][_0x98c2('0x18')]);return _0x279234(_0x4c641e['error'][_0x98c2('0x18')]);}else{logger[_0x98c2('0x12')](_0x98c2('0x13'),_0x3351db,_0x98c2('0x14'));_0x279234(_0x4c641e[_0x98c2('0x19')][_0x98c2('0x18')]);}})[_0x98c2('0x1a')](function(_0x59a008){logger[_0x98c2('0x17')]('ChatMessage,\x20%s,\x20%s',_0x3351db,_0x59a008);_0x1614fc(_0x59a008);});});}exports[_0x98c2('0x1b')]=function(_0x4b0e5f){var _0x5e2e09=this;return new Promise(function(_0x430638,_0x480309){return db[_0x98c2('0x1c')][_0x98c2('0x1d')](_0x4b0e5f['body'],{'raw':_0x4b0e5f['options']?_0x4b0e5f[_0x98c2('0x1e')][_0x98c2('0x1f')]===undefined?!![]:![]:!![]})[_0x98c2('0x11')](function(_0x1a7e63){logger['info'](_0x98c2('0x1b'),_0x4b0e5f);logger[_0x98c2('0x15')](_0x98c2('0x1b'),_0x4b0e5f,JSON[_0x98c2('0x16')](_0x1a7e63));_0x430638(_0x1a7e63);})[_0x98c2('0x1a')](function(_0x394cbc){logger[_0x98c2('0x17')](_0x98c2('0x1b'),_0x394cbc['message'],_0x4b0e5f);_0x480309(_0x5e2e09['error'](0x1f4,_0x394cbc[_0x98c2('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 1d5fd51..51624c3 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 _0xac31=['remove','update','length','chatMessage:','./chatMessage.events','save'];(function(_0x27ccb6,_0x103913){var _0x412043=function(_0x3c1624){while(--_0x3c1624){_0x27ccb6['push'](_0x27ccb6['shift']());}};_0x412043(++_0x103913);}(_0xac31,0xca));var _0x1ac3=function(_0x4ade9b,_0x4ea857){_0x4ade9b=_0x4ade9b-0x0;var _0xbae091=_0xac31[_0x4ade9b];return _0xbae091;};'use strict';var ChatMessageEvents=require(_0x1ac3('0x0'));var events=[_0x1ac3('0x1'),_0x1ac3('0x2'),_0x1ac3('0x3')];function createListener(_0xd6934,_0x11dd6d){return function(_0x95548d){_0x11dd6d['emit'](_0xd6934,_0x95548d);};}function removeListener(_0x33b5ab,_0x434b5e){return function(){ChatMessageEvents['removeListener'](_0x33b5ab,_0x434b5e);};}exports['register']=function(_0xbe22b7){for(var _0x20027f=0x0,_0x2bf9b1=events[_0x1ac3('0x4')];_0x20027f<_0x2bf9b1;_0x20027f++){var _0x157604=events[_0x20027f];var _0x57893c=createListener(_0x1ac3('0x5')+_0x157604,_0xbe22b7);ChatMessageEvents['on'](_0x157604,_0x57893c);}};
\ No newline at end of file
+var _0xc949=['chatMessage:','./chatMessage.events','remove','update','emit','removeListener','register','length'];(function(_0x38f411,_0x5864cc){var _0x2a6132=function(_0x206d69){while(--_0x206d69){_0x38f411['push'](_0x38f411['shift']());}};_0x2a6132(++_0x5864cc);}(_0xc949,0x181));var _0x9c94=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xc949[_0x2160a9];return _0xa88cf7;};'use strict';var ChatMessageEvents=require(_0x9c94('0x0'));var events=['save',_0x9c94('0x1'),_0x9c94('0x2')];function createListener(_0x209cd8,_0x27613f){return function(_0x54facf){_0x27613f[_0x9c94('0x3')](_0x209cd8,_0x54facf);};}function removeListener(_0x231762,_0x528a17){return function(){ChatMessageEvents[_0x9c94('0x4')](_0x231762,_0x528a17);};}exports[_0x9c94('0x5')]=function(_0x46d560){for(var _0x1357ac=0x0,_0x57fcd7=events[_0x9c94('0x6')];_0x1357ac<_0x57fcd7;_0x1357ac++){var _0x360e7b=events[_0x1357ac];var _0x25ecd0=createListener(_0x9c94('0x7')+_0x360e7b,_0x46d560);ChatMessageEvents['on'](_0x360e7b,_0x25ecd0);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index c337105..b0cebee 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 _0x24a4=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','chatmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x24a4,0xf9));var _0x424a=function(_0x665aa7,_0x1f3e3f){_0x665aa7=_0x665aa7-0x0;var _0x4b5e0b=_0x24a4[_0x665aa7];return _0x4b5e0b;};'use strict';var multer=require(_0x424a('0x0'));var util=require(_0x424a('0x1'));var path=require(_0x424a('0x2'));var timeout=require(_0x424a('0x3'));var express=require('express');var router=express[_0x424a('0x4')]();var fs_extra=require(_0x424a('0x5'));var auth=require(_0x424a('0x6'));var interaction=require(_0x424a('0x7'));var config=require(_0x424a('0x8'));var controller=require(_0x424a('0x9'));router['get']('/',auth[_0x424a('0xa')](),controller[_0x424a('0xb')]);router[_0x424a('0xc')](_0x424a('0xd'),auth[_0x424a('0xa')](),controller[_0x424a('0xe')]);router[_0x424a('0xc')](_0x424a('0xf'),auth[_0x424a('0xa')](),controller[_0x424a('0x10')]);router[_0x424a('0x11')]('/',auth[_0x424a('0xa')](),interaction['tracked']('chat',_0x424a('0x12')),controller[_0x424a('0x13')]);router[_0x424a('0x14')](_0x424a('0xf'),controller[_0x424a('0x15')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x424a('0x16')]);router['put'](_0x424a('0x17'),auth[_0x424a('0xa')](),controller[_0x424a('0x18')]);router[_0x424a('0x19')]('/:id',auth[_0x424a('0xa')](),controller[_0x424a('0x1a')]);module[_0x424a('0x1b')]=router;
\ No newline at end of file
+var _0x4327=['show','post','tracked','create','put','accept','/:id/reject','reject','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x1023b2,_0x4afae8){var _0xd9e85c=function(_0x4c968f){while(--_0x4c968f){_0x1023b2['push'](_0x1023b2['shift']());}};_0xd9e85c(++_0x4afae8);}(_0x4327,0x1d2));var _0x7432=function(_0x2859f2,_0x1e3102){_0x2859f2=_0x2859f2-0x0;var _0x4974cd=_0x4327[_0x2859f2];return _0x4974cd;};'use strict';var multer=require('multer');var util=require(_0x7432('0x0'));var path=require(_0x7432('0x1'));var timeout=require(_0x7432('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7432('0x3'));var auth=require(_0x7432('0x4'));var interaction=require(_0x7432('0x5'));var config=require(_0x7432('0x6'));var controller=require(_0x7432('0x7'));router[_0x7432('0x8')]('/',auth[_0x7432('0x9')](),controller[_0x7432('0xa')]);router['get'](_0x7432('0xb'),auth['isAuthenticated'](),controller[_0x7432('0xc')]);router[_0x7432('0x8')](_0x7432('0xd'),auth[_0x7432('0x9')](),controller[_0x7432('0xe')]);router[_0x7432('0xf')]('/',auth[_0x7432('0x9')](),interaction[_0x7432('0x10')]('chat','chatmessage:create'),controller[_0x7432('0x11')]);router[_0x7432('0x12')](_0x7432('0xd'),controller['update']);router[_0x7432('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x7432('0x13')]);router[_0x7432('0x12')](_0x7432('0x14'),auth[_0x7432('0x9')](),controller[_0x7432('0x15')]);router['delete']('/:id',auth[_0x7432('0x9')](),controller[_0x7432('0x16')]);module[_0x7432('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 8a55e9d..9f0e839 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['medium','TEXT','exports'];(function(_0x32ffb1,_0xa1cbe8){var _0x6dfa2d=function(_0x200caa){while(--_0x200caa){_0x32ffb1['push'](_0x32ffb1['shift']());}};_0x6dfa2d(++_0xa1cbe8);}(_0xadb5,0xad));var _0x5adb=function(_0x4afe35,_0x379c2a){_0x4afe35=_0x4afe35-0x0;var _0x3b0b5e=_0xadb5[_0x4afe35];return _0x3b0b5e;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x132477,_0x42d24b){var _0x95b79f=function(_0x291f1c){while(--_0x291f1c){_0x132477['push'](_0x132477['shift']());}};_0x95b79f(++_0x42d24b);}(_0xdb28,0x106));var _0x8db2=function(_0xebf7da,_0x1fc65e){_0xebf7da=_0xebf7da-0x0;var _0x1df326=_0xdb28[_0xebf7da];return _0x1df326;};'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 92b42e0..e1a7996 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x7a54,0x106));var _0x47a5=function(_0x258368,_0x1bad34){_0x258368=_0x258368-0x0;var _0x1e5f94=_0x7a54[_0x258368];return _0x1e5f94;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x7a54,0x106));var _0x47a5=function(_0xe98c5f,_0x26267f){_0xe98c5f=_0xe98c5f-0x0;var _0x9e8d98=_0x7a54[_0xe98c5f];return _0x9e8d98;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index a12bd1b..9abf282 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 _0xb19a=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x32d8f6,_0x153146){var _0x4d6740=function(_0x5e41a6){while(--_0x5e41a6){_0x32d8f6['push'](_0x32d8f6['shift']());}};_0x4d6740(++_0x153146);}(_0xb19a,0x12c));var _0xab19=function(_0x2bfefd,_0x4b2c0f){_0x2bfefd=_0x2bfefd-0x0;var _0x11e4ef=_0xb19a[_0x2bfefd];return _0x11e4ef;};'use strict';var EventEmitter=require(_0xab19('0x0'));var ChatOfflineMessage=require(_0xab19('0x1'))['db'][_0xab19('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xab19('0x3')](0x0);var events={'afterCreate':_0xab19('0x4'),'afterUpdate':_0xab19('0x5'),'afterDestroy':_0xab19('0x6')};function emitEvent(_0x2e98f4){return function(_0x95bc5a,_0x30a40c,_0x5f5be6){ChatOfflineMessageEvents['emit'](_0x2e98f4+':'+_0x95bc5a['id'],_0x95bc5a);ChatOfflineMessageEvents[_0xab19('0x7')](_0x2e98f4,_0x95bc5a);_0x5f5be6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xab19('0x8')](e,emitEvent(event));}}module[_0xab19('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xfb50=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','save','update'];(function(_0xa475c7,_0x3b1a88){var _0x4d53ed=function(_0x575e25){while(--_0x575e25){_0xa475c7['push'](_0xa475c7['shift']());}};_0x4d53ed(++_0x3b1a88);}(_0xfb50,0x1ec));var _0x0fb5=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0xfb50[_0x38537f];return _0x141e23;};'use strict';var EventEmitter=require(_0x0fb5('0x0'));var ChatOfflineMessage=require(_0x0fb5('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0fb5('0x2'),'afterUpdate':_0x0fb5('0x3'),'afterDestroy':_0x0fb5('0x4')};function emitEvent(_0x4b1ff2){return function(_0x4f13a1,_0x729778,_0x2e10b6){ChatOfflineMessageEvents['emit'](_0x4b1ff2+':'+_0x4f13a1['id'],_0x4f13a1);ChatOfflineMessageEvents['emit'](_0x4b1ff2,_0x4f13a1);_0x2e10b6(null);};}for(var e in events){if(events[_0x0fb5('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x0fb5('0x6')](e,emitEvent(event));}}module[_0x0fb5('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index fcee337..9cf4c81 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 _0x36a0=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x5ca59d,_0x15831e){var _0x2eb302=function(_0x512519){while(--_0x512519){_0x5ca59d['push'](_0x5ca59d['shift']());}};_0x2eb302(++_0x15831e);}(_0x36a0,0x79));var _0x036a=function(_0x342b98,_0x3768f5){_0x342b98=_0x342b98-0x0;var _0x424d19=_0x36a0[_0x342b98];return _0x424d19;};'use strict';var attributes=require(_0x036a('0x0'));module[_0x036a('0x1')]=function(_0x4fe8f6){return _0x4fe8f6[_0x036a('0x2')](_0x036a('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x036a('0x4')});};
\ No newline at end of file
+var _0x35f2=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','exports'];(function(_0x236c65,_0x23b8ee){var _0x5c2b0b=function(_0x556ed1){while(--_0x556ed1){_0x236c65['push'](_0x236c65['shift']());}};_0x5c2b0b(++_0x23b8ee);}(_0x35f2,0x68));var _0x235f=function(_0xd209e7,_0x1224b4){_0xd209e7=_0xd209e7-0x0;var _0x55a4f1=_0x35f2[_0xd209e7];return _0x55a4f1;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x235f('0x0')]=function(_0x42a76e){return _0x42a76e[_0x235f('0x1')](_0x235f('0x2'),attributes,{'tableName':_0x235f('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x235f('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 99ad7b0..a0dfc0f 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 _0xabbc=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabbc,0x1bc));var _0xcabb=function(_0x65e3dc,_0x10fd05){_0x65e3dc=_0x65e3dc-0x0;var _0x5d475b=_0xabbc[_0x65e3dc];return _0x5d475b;};'use strict';var _=require(_0xcabb('0x0'));var util=require(_0xcabb('0x1'));var moment=require('moment');var BPromise=require(_0xcabb('0x2'));var rs=require(_0xcabb('0x3'));var fs=require('fs');var Redis=require(_0xcabb('0x4'));var db=require(_0xcabb('0x5'))['db'];var utils=require(_0xcabb('0x6'));var logger=require(_0xcabb('0x7'))(_0xcabb('0x8'));var config=require(_0xcabb('0x9'));var jayson=require(_0xcabb('0xa'));var client=jayson[_0xcabb('0xb')][_0xcabb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe861f7,_0x48a504,_0x59ecbc){return new BPromise(function(_0x5964c0,_0xfddad7){return client[_0xcabb('0xd')](_0xe861f7,_0x59ecbc)[_0xcabb('0xe')](function(_0xfac589){logger['info'](_0xcabb('0xf'),_0x48a504,'request\x20sent');logger[_0xcabb('0x10')](_0xcabb('0x11'),_0x48a504,_0xcabb('0x12'),JSON[_0xcabb('0x13')](_0xfac589));if(_0xfac589['error']){if(_0xfac589[_0xcabb('0x14')][_0xcabb('0x15')]===0x1f4){logger[_0xcabb('0x14')](_0xcabb('0xf'),_0x48a504,_0xfac589['error'][_0xcabb('0x16')]);return _0xfddad7(_0xfac589[_0xcabb('0x14')][_0xcabb('0x16')]);}logger[_0xcabb('0x14')](_0xcabb('0xf'),_0x48a504,_0xfac589[_0xcabb('0x14')]['message']);return _0x5964c0(_0xfac589[_0xcabb('0x14')][_0xcabb('0x16')]);}else{logger[_0xcabb('0x17')]('ChatOfflineMessage,\x20%s,\x20%s',_0x48a504,_0xcabb('0x12'));_0x5964c0(_0xfac589[_0xcabb('0x18')][_0xcabb('0x16')]);}})[_0xcabb('0x19')](function(_0x1b09f0){logger[_0xcabb('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x48a504,_0x1b09f0);_0xfddad7(_0x1b09f0);});});}
\ No newline at end of file
+var _0x7303=['../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x41bf55,_0x5ce76d){var _0x3aa827=function(_0x37639f){while(--_0x37639f){_0x41bf55['push'](_0x41bf55['shift']());}};_0x3aa827(++_0x5ce76d);}(_0x7303,0xa3));var _0x3730=function(_0xb1dcb1,_0x1ca3fe){_0xb1dcb1=_0xb1dcb1-0x0;var _0x36cffb=_0x7303[_0xb1dcb1];return _0x36cffb;};'use strict';var _=require(_0x3730('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3730('0x1'));var rs=require(_0x3730('0x2'));var fs=require('fs');var Redis=require(_0x3730('0x3'));var db=require(_0x3730('0x4'))['db'];var utils=require(_0x3730('0x5'));var logger=require('../../config/logger')(_0x3730('0x6'));var config=require(_0x3730('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3730('0x8')][_0x3730('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x238a0b,_0x228202,_0xa9e149){return new BPromise(function(_0x493b0b,_0x2130d9){return client[_0x3730('0xa')](_0x238a0b,_0xa9e149)[_0x3730('0xb')](function(_0x120db6){logger[_0x3730('0xc')](_0x3730('0xd'),_0x228202,_0x3730('0xe'));logger['debug'](_0x3730('0xf'),_0x228202,'request\x20sent',JSON[_0x3730('0x10')](_0x120db6));if(_0x120db6['error']){if(_0x120db6[_0x3730('0x11')]['code']===0x1f4){logger[_0x3730('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x228202,_0x120db6[_0x3730('0x11')]['message']);return _0x2130d9(_0x120db6[_0x3730('0x11')][_0x3730('0x12')]);}logger[_0x3730('0x11')](_0x3730('0xd'),_0x228202,_0x120db6['error'][_0x3730('0x12')]);return _0x493b0b(_0x120db6[_0x3730('0x11')]['message']);}else{logger[_0x3730('0xc')](_0x3730('0xd'),_0x228202,_0x3730('0xe'));_0x493b0b(_0x120db6[_0x3730('0x13')]['message']);}})[_0x3730('0x14')](function(_0x2a758d){logger['error'](_0x3730('0xd'),_0x228202,_0x2a758d);_0x2130d9(_0x2a758d);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 70ec862..b552876 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 _0x7667=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','isAuthenticated','describe','show','create','delete','/:id','exports'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x7667,0xd8));var _0x7766=function(_0x3e3aa3,_0x43b147){_0x3e3aa3=_0x3e3aa3-0x0;var _0x32bf2d=_0x7667[_0x3e3aa3];return _0x32bf2d;};'use strict';var multer=require(_0x7766('0x0'));var util=require(_0x7766('0x1'));var path=require(_0x7766('0x2'));var timeout=require(_0x7766('0x3'));var express=require(_0x7766('0x4'));var router=express[_0x7766('0x5')]();var fs_extra=require(_0x7766('0x6'));var auth=require(_0x7766('0x7'));var interaction=require(_0x7766('0x8'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7766('0x9')]);router[_0x7766('0xa')]('/describe',auth[_0x7766('0xb')](),controller[_0x7766('0xc')]);router[_0x7766('0xa')]('/:id',auth[_0x7766('0xb')](),controller[_0x7766('0xd')]);router['post']('/',auth[_0x7766('0xb')](),controller[_0x7766('0xe')]);router['put']('/:id',auth[_0x7766('0xb')](),controller['update']);router[_0x7766('0xf')](_0x7766('0x10'),auth[_0x7766('0xb')](),controller['destroy']);module[_0x7766('0x11')]=router;
\ No newline at end of file
+var _0xffc6=['show','post','create','put','delete','/:id','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x12b00b,_0x1e11e1){var _0x1748da=function(_0x2a2f46){while(--_0x2a2f46){_0x12b00b['push'](_0x12b00b['shift']());}};_0x1748da(++_0x1e11e1);}(_0xffc6,0x15e));var _0x6ffc=function(_0x2cd9f6,_0x450d32){_0x2cd9f6=_0x2cd9f6-0x0;var _0x35182a=_0xffc6[_0x2cd9f6];return _0x35182a;};'use strict';var multer=require('multer');var util=require(_0x6ffc('0x0'));var path=require(_0x6ffc('0x1'));var timeout=require(_0x6ffc('0x2'));var express=require(_0x6ffc('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6ffc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ffc('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0x6ffc('0x6')]('/',auth[_0x6ffc('0x7')](),controller[_0x6ffc('0x8')]);router[_0x6ffc('0x6')](_0x6ffc('0x9'),auth[_0x6ffc('0x7')](),controller[_0x6ffc('0xa')]);router[_0x6ffc('0x6')]('/:id',auth[_0x6ffc('0x7')](),controller[_0x6ffc('0xb')]);router[_0x6ffc('0xc')]('/',auth['isAuthenticated'](),controller[_0x6ffc('0xd')]);router[_0x6ffc('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6ffc('0xf')](_0x6ffc('0x10'),auth[_0x6ffc('0x7')](),controller[_0x6ffc('0x11')]);module[_0x6ffc('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 6ccc7ad..df6c522 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 _0xa7a5=['mouseOver','STRING','exports'];(function(_0x24ae03,_0x334660){var _0x38a29e=function(_0x25e64b){while(--_0x25e64b){_0x24ae03['push'](_0x24ae03['shift']());}};_0x38a29e(++_0x334660);}(_0xa7a5,0x8c));var _0x5a7a=function(_0x4612a6,_0x2c9678){_0x4612a6=_0x4612a6-0x0;var _0x4940b8=_0xa7a5[_0x4612a6];return _0x4940b8;};'use strict';var Sequelize=require('sequelize');module[_0x5a7a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':_0x5a7a('0x1')},'selector':{'type':Sequelize[_0x5a7a('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x8abd=['STRING','timeout','mouseOver','INTEGER','exports'];(function(_0x3a213b,_0x2539b1){var _0x48552c=function(_0x26db9d){while(--_0x26db9d){_0x3a213b['push'](_0x3a213b['shift']());}};_0x48552c(++_0x2539b1);}(_0x8abd,0x18a));var _0xd8ab=function(_0x211f55,_0x520aea){_0x211f55=_0x211f55-0x0;var _0x5d7628=_0x8abd[_0x211f55];return _0x5d7628;};'use strict';var Sequelize=require('sequelize');module[_0xd8ab('0x0')]={'name':{'type':Sequelize[_0xd8ab('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0xd8ab('0x2')),'defaultValue':_0xd8ab('0x3')},'selector':{'type':Sequelize[_0xd8ab('0x1')]},'timeout':{'type':Sequelize[_0xd8ab('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index cb8b815..c9f06e1 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 _0x9a6b=['find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','apply','reject','update','destroy','error','stack','name','send','params','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','then','create','body','catch'];(function(_0x5d5ad9,_0x9fe65c){var _0x461f64=function(_0x97c064){while(--_0x97c064){_0x5d5ad9['push'](_0x5d5ad9['shift']());}};_0x461f64(++_0x9fe65c);}(_0x9a6b,0x77));var _0xb9a6=function(_0x1f1634,_0x2424e7){_0x1f1634=_0x1f1634-0x0;var _0x72b827=_0x9a6b[_0x1f1634];return _0x72b827;};'use strict';var emlformat=require(_0xb9a6('0x0'));var rimraf=require(_0xb9a6('0x1'));var zipdir=require(_0xb9a6('0x2'));var jsonpatch=require(_0xb9a6('0x3'));var rp=require(_0xb9a6('0x4'));var moment=require(_0xb9a6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb9a6('0x6'));var util=require('util');var path=require(_0xb9a6('0x7'));var sox=require(_0xb9a6('0x8'));var csv=require(_0xb9a6('0x9'));var ejs=require(_0xb9a6('0xa'));var fs=require('fs');var fs_extra=require(_0xb9a6('0xb'));var _=require(_0xb9a6('0xc'));var squel=require(_0xb9a6('0xd'));var crypto=require(_0xb9a6('0xe'));var jsforce=require(_0xb9a6('0xf'));var deskjs=require(_0xb9a6('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb9a6('0x11'));var Papa=require(_0xb9a6('0x12'));var Redis=require('ioredis');var authService=require(_0xb9a6('0x13'));var qs=require(_0xb9a6('0x14'));var as=require(_0xb9a6('0x15'));var hardwareService=require(_0xb9a6('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb9a6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb9a6('0x18'))['db'];function respondWithStatusCode(_0x57b620,_0x3f4ce1){_0x3f4ce1=_0x3f4ce1||0xcc;return function(_0x21a637){if(_0x21a637){return _0x57b620[_0xb9a6('0x19')](_0x3f4ce1);}return _0x57b620[_0xb9a6('0x1a')](_0x3f4ce1)[_0xb9a6('0x1b')]();};}function respondWithResult(_0x6cbcc4,_0x3e140e){_0x3e140e=_0x3e140e||0xc8;return function(_0x158d6c){if(_0x158d6c){return _0x6cbcc4[_0xb9a6('0x1a')](_0x3e140e)['json'](_0x158d6c);}};}function respondWithFilteredResult(_0x463f33,_0x136d5d){return function(_0x414f37){if(_0x414f37){var _0x3342d2=typeof _0x136d5d['offset']===_0xb9a6('0x1c')&&typeof _0x136d5d[_0xb9a6('0x1d')]===_0xb9a6('0x1c');var _0x5b3395=_0x414f37[_0xb9a6('0x1e')];var _0x3b9a3b=_0x3342d2?0x0:_0x136d5d[_0xb9a6('0x1f')];var _0x1843e2=_0x3342d2?_0x414f37[_0xb9a6('0x1e')]:_0x136d5d['offset']+_0x136d5d[_0xb9a6('0x1d')];var _0x28e01a;if(_0x1843e2>=_0x5b3395){_0x1843e2=_0x5b3395;_0x28e01a=0xc8;}else{_0x28e01a=0xce;}_0x463f33[_0xb9a6('0x1a')](_0x28e01a);return _0x463f33[_0xb9a6('0x20')]('Content-Range',_0x3b9a3b+'-'+_0x1843e2+'/'+_0x5b3395)['json'](_0x414f37);}return null;};}function patchUpdates(_0x1cb89e){return function(_0x449b39){try{jsonpatch[_0xb9a6('0x21')](_0x449b39,_0x1cb89e,!![]);}catch(_0x49c74b){return BPromise[_0xb9a6('0x22')](_0x49c74b);}return _0x449b39['save']();};}function saveUpdates(_0xc15e48,_0x36c6c1){return function(_0x50d3d4){if(_0x50d3d4){return _0x50d3d4[_0xb9a6('0x23')](_0xc15e48)['then'](function(_0x526721){return _0x526721;});}return null;};}function removeEntity(_0x3bc642,_0x1b838a){return function(_0x73dee3){if(_0x73dee3){return _0x73dee3[_0xb9a6('0x24')]()['then'](function(){_0x3bc642[_0xb9a6('0x1a')](0xcc)[_0xb9a6('0x1b')]();});}};}function handleEntityNotFound(_0x373f62,_0x1d36e3){return function(_0x4b0be8){if(!_0x4b0be8){_0x373f62[_0xb9a6('0x19')](0x194);}return _0x4b0be8;};}function handleError(_0x3896c1,_0x3ebdcd){_0x3ebdcd=_0x3ebdcd||0x1f4;return function(_0x427890){logger[_0xb9a6('0x25')](_0x427890[_0xb9a6('0x26')]);if(_0x427890[_0xb9a6('0x27')]){delete _0x427890['name'];}_0x3896c1[_0xb9a6('0x1a')](_0x3ebdcd)[_0xb9a6('0x28')](_0x427890);};}exports['show']=function(_0x429830,_0x4c2abb){var _0x1fdb38={'raw':!![],'where':{'id':_0x429830[_0xb9a6('0x29')]['id']}},_0x5d75ce={};_0x5d75ce[_0xb9a6('0x2a')]=_['keys'](db[_0xb9a6('0x2b')][_0xb9a6('0x2c')]);_0x5d75ce[_0xb9a6('0x2d')]=_[_0xb9a6('0x2e')](_0x429830[_0xb9a6('0x2d')]);_0x5d75ce[_0xb9a6('0x2f')]=_[_0xb9a6('0x30')](_0x5d75ce['model'],_0x5d75ce[_0xb9a6('0x2d')]);_0x1fdb38[_0xb9a6('0x31')]=_[_0xb9a6('0x30')](_0x5d75ce[_0xb9a6('0x2a')],qs['fields'](_0x429830[_0xb9a6('0x2d')][_0xb9a6('0x32')]));_0x1fdb38['attributes']=_0x1fdb38[_0xb9a6('0x31')][_0xb9a6('0x33')]?_0x1fdb38[_0xb9a6('0x31')]:_0x5d75ce[_0xb9a6('0x2a')];if(_0x429830[_0xb9a6('0x2d')][_0xb9a6('0x34')]){_0x1fdb38[_0xb9a6('0x35')]=[{'all':!![]}];}_0x1fdb38=_['merge']({},_0x1fdb38,_0x429830['options']);return db['ChatProactiveAction']['find'](_0x1fdb38)['then'](handleEntityNotFound(_0x4c2abb,null))[_0xb9a6('0x36')](respondWithResult(_0x4c2abb,null))['catch'](handleError(_0x4c2abb,null));};exports[_0xb9a6('0x37')]=function(_0x56945d,_0x287329){return db[_0xb9a6('0x2b')][_0xb9a6('0x37')](_0x56945d[_0xb9a6('0x38')],{})[_0xb9a6('0x36')](respondWithResult(_0x287329,0xc9))[_0xb9a6('0x39')](handleError(_0x287329,null));};exports[_0xb9a6('0x23')]=function(_0xc96b8,_0x1e2835){if(_0xc96b8[_0xb9a6('0x38')]['id']){delete _0xc96b8[_0xb9a6('0x38')]['id'];}return db[_0xb9a6('0x2b')][_0xb9a6('0x3a')]({'where':{'id':_0xc96b8[_0xb9a6('0x29')]['id']}})[_0xb9a6('0x36')](handleEntityNotFound(_0x1e2835,null))[_0xb9a6('0x36')](saveUpdates(_0xc96b8[_0xb9a6('0x38')],null))['then'](respondWithResult(_0x1e2835,null))[_0xb9a6('0x39')](handleError(_0x1e2835,null));};exports[_0xb9a6('0x24')]=function(_0xdc704f,_0x5a8bf2){return db[_0xb9a6('0x2b')][_0xb9a6('0x3a')]({'where':{'id':_0xdc704f[_0xb9a6('0x29')]['id']}})[_0xb9a6('0x36')](handleEntityNotFound(_0x5a8bf2,null))[_0xb9a6('0x36')](removeEntity(_0x5a8bf2,null))[_0xb9a6('0x39')](handleError(_0x5a8bf2,null));};
\ No newline at end of file
+var _0x8255=['Content-Range','reject','save','then','error','stack','name','send','params','model','ChatProactiveAction','keys','filters','query','attributes','intersection','fields','length','include','merge','options','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set'];(function(_0x2730eb,_0x231d72){var _0x2678ca=function(_0x530e56){while(--_0x530e56){_0x2730eb['push'](_0x2730eb['shift']());}};_0x2678ca(++_0x231d72);}(_0x8255,0x176));var _0x5825=function(_0x3efe54,_0x27c823){_0x3efe54=_0x3efe54-0x0;var _0x2a4efc=_0x8255[_0x3efe54];return _0x2a4efc;};'use strict';var emlformat=require(_0x5825('0x0'));var rimraf=require(_0x5825('0x1'));var zipdir=require(_0x5825('0x2'));var jsonpatch=require(_0x5825('0x3'));var rp=require(_0x5825('0x4'));var moment=require(_0x5825('0x5'));var BPromise=require(_0x5825('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5825('0x7'));var csv=require(_0x5825('0x8'));var ejs=require(_0x5825('0x9'));var fs=require('fs');var fs_extra=require(_0x5825('0xa'));var _=require(_0x5825('0xb'));var squel=require(_0x5825('0xc'));var crypto=require(_0x5825('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5825('0x8'));var querystring=require(_0x5825('0xe'));var Papa=require(_0x5825('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5825('0x10'));var as=require(_0x5825('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5825('0x12'))(_0x5825('0x13'));var utils=require('../../config/utils');var config=require(_0x5825('0x14'));var licenseUtil=require(_0x5825('0x15'));var db=require(_0x5825('0x16'))['db'];function respondWithStatusCode(_0x592725,_0x4d948e){_0x4d948e=_0x4d948e||0xcc;return function(_0x325034){if(_0x325034){return _0x592725[_0x5825('0x17')](_0x4d948e);}return _0x592725[_0x5825('0x18')](_0x4d948e)[_0x5825('0x19')]();};}function respondWithResult(_0x5bb480,_0x473eb0){_0x473eb0=_0x473eb0||0xc8;return function(_0x53687f){if(_0x53687f){return _0x5bb480[_0x5825('0x18')](_0x473eb0)[_0x5825('0x1a')](_0x53687f);}};}function respondWithFilteredResult(_0x35a8dd,_0x1e2751){return function(_0xb9fc6c){if(_0xb9fc6c){var _0x5ecffa=typeof _0x1e2751['offset']===_0x5825('0x1b')&&typeof _0x1e2751[_0x5825('0x1c')]===_0x5825('0x1b');var _0x1247b6=_0xb9fc6c['count'];var _0x4c59a1=_0x5ecffa?0x0:_0x1e2751[_0x5825('0x1d')];var _0x1fc690=_0x5ecffa?_0xb9fc6c[_0x5825('0x1e')]:_0x1e2751[_0x5825('0x1d')]+_0x1e2751['limit'];var _0x36bf06;if(_0x1fc690>=_0x1247b6){_0x1fc690=_0x1247b6;_0x36bf06=0xc8;}else{_0x36bf06=0xce;}_0x35a8dd[_0x5825('0x18')](_0x36bf06);return _0x35a8dd[_0x5825('0x1f')](_0x5825('0x20'),_0x4c59a1+'-'+_0x1fc690+'/'+_0x1247b6)[_0x5825('0x1a')](_0xb9fc6c);}return null;};}function patchUpdates(_0x12517c){return function(_0x54ca58){try{jsonpatch['apply'](_0x54ca58,_0x12517c,!![]);}catch(_0x43a216){return BPromise[_0x5825('0x21')](_0x43a216);}return _0x54ca58[_0x5825('0x22')]();};}function saveUpdates(_0x47913e,_0x141c77){return function(_0x310546){if(_0x310546){return _0x310546['update'](_0x47913e)[_0x5825('0x23')](function(_0x2787d5){return _0x2787d5;});}return null;};}function removeEntity(_0x271695,_0x4d0abb){return function(_0x5e0f40){if(_0x5e0f40){return _0x5e0f40['destroy']()['then'](function(){_0x271695[_0x5825('0x18')](0xcc)[_0x5825('0x19')]();});}};}function handleEntityNotFound(_0x6b07dd,_0x23b3ef){return function(_0x3502ce){if(!_0x3502ce){_0x6b07dd[_0x5825('0x17')](0x194);}return _0x3502ce;};}function handleError(_0x5e1f78,_0x1f27fd){_0x1f27fd=_0x1f27fd||0x1f4;return function(_0x3c8dec){logger[_0x5825('0x24')](_0x3c8dec[_0x5825('0x25')]);if(_0x3c8dec[_0x5825('0x26')]){delete _0x3c8dec[_0x5825('0x26')];}_0x5e1f78[_0x5825('0x18')](_0x1f27fd)[_0x5825('0x27')](_0x3c8dec);};}exports['show']=function(_0x589411,_0x3725dc){var _0x45e941={'raw':!![],'where':{'id':_0x589411[_0x5825('0x28')]['id']}},_0x582f12={};_0x582f12[_0x5825('0x29')]=_['keys'](db[_0x5825('0x2a')]['rawAttributes']);_0x582f12['query']=_[_0x5825('0x2b')](_0x589411['query']);_0x582f12[_0x5825('0x2c')]=_['intersection'](_0x582f12['model'],_0x582f12[_0x5825('0x2d')]);_0x45e941[_0x5825('0x2e')]=_[_0x5825('0x2f')](_0x582f12[_0x5825('0x29')],qs[_0x5825('0x30')](_0x589411[_0x5825('0x2d')][_0x5825('0x30')]));_0x45e941[_0x5825('0x2e')]=_0x45e941[_0x5825('0x2e')][_0x5825('0x31')]?_0x45e941[_0x5825('0x2e')]:_0x582f12['model'];if(_0x589411[_0x5825('0x2d')]['includeAll']){_0x45e941[_0x5825('0x32')]=[{'all':!![]}];}_0x45e941=_[_0x5825('0x33')]({},_0x45e941,_0x589411[_0x5825('0x34')]);return db[_0x5825('0x2a')][_0x5825('0x35')](_0x45e941)[_0x5825('0x23')](handleEntityNotFound(_0x3725dc,null))[_0x5825('0x23')](respondWithResult(_0x3725dc,null))[_0x5825('0x36')](handleError(_0x3725dc,null));};exports[_0x5825('0x37')]=function(_0xe8d01b,_0x1fa9a3){return db[_0x5825('0x2a')][_0x5825('0x37')](_0xe8d01b[_0x5825('0x38')],{})[_0x5825('0x23')](respondWithResult(_0x1fa9a3,0xc9))[_0x5825('0x36')](handleError(_0x1fa9a3,null));};exports[_0x5825('0x39')]=function(_0x53a43c,_0x4f4ab9){if(_0x53a43c['body']['id']){delete _0x53a43c[_0x5825('0x38')]['id'];}return db[_0x5825('0x2a')][_0x5825('0x35')]({'where':{'id':_0x53a43c[_0x5825('0x28')]['id']}})[_0x5825('0x23')](handleEntityNotFound(_0x4f4ab9,null))['then'](saveUpdates(_0x53a43c[_0x5825('0x38')],null))[_0x5825('0x23')](respondWithResult(_0x4f4ab9,null))[_0x5825('0x36')](handleError(_0x4f4ab9,null));};exports['destroy']=function(_0x1465c0,_0x56e758){return db[_0x5825('0x2a')][_0x5825('0x35')]({'where':{'id':_0x1465c0[_0x5825('0x28')]['id']}})[_0x5825('0x23')](handleEntityNotFound(_0x56e758,null))[_0x5825('0x23')](removeEntity(_0x56e758,null))[_0x5825('0x36')](handleError(_0x56e758,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index c4d313d..b6f472a 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 _0x206c=['api','bluebird','request-promise','path','rimraf','exports','ChatProactiveAction','lodash','util','../../config/logger'];(function(_0x4965ff,_0xd24226){var _0x763d61=function(_0x2b14e1){while(--_0x2b14e1){_0x4965ff['push'](_0x4965ff['shift']());}};_0x763d61(++_0xd24226);}(_0x206c,0x129));var _0xc206=function(_0x7ca77d,_0x3ad1ed){_0x7ca77d=_0x7ca77d-0x0;var _0x40e85b=_0x206c[_0x7ca77d];return _0x40e85b;};'use strict';var _=require(_0xc206('0x0'));var util=require(_0xc206('0x1'));var logger=require(_0xc206('0x2'))(_0xc206('0x3'));var moment=require('moment');var BPromise=require(_0xc206('0x4'));var rp=require(_0xc206('0x5'));var fs=require('fs');var path=require(_0xc206('0x6'));var rimraf=require(_0xc206('0x7'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0xc206('0x8')]=function(_0x2bdb1f,_0x591e71){return _0x2bdb1f['define'](_0xc206('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x968f=['request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','bluebird'];(function(_0x407064,_0x2be626){var _0x3323d1=function(_0x20ae00){while(--_0x20ae00){_0x407064['push'](_0x407064['shift']());}};_0x3323d1(++_0x2be626);}(_0x968f,0x89));var _0xf968=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x968f[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xf968('0x0'));var util=require(_0xf968('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf968('0x2'));var rp=require(_0xf968('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf968('0x4'));var config=require(_0xf968('0x5'));var attributes=require(_0xf968('0x6'));module[_0xf968('0x7')]=function(_0x5cad3a,_0x6b446d){return _0x5cad3a[_0xf968('0x8')]('ChatProactiveAction',attributes,{'tableName':_0xf968('0x9'),'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 d866b95..c63b6fa 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 _0xc28c=['client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x374228,_0x5e071f){var _0x5b8764=function(_0x45398f){while(--_0x45398f){_0x374228['push'](_0x374228['shift']());}};_0x5b8764(++_0x5e071f);}(_0xc28c,0x133));var _0xcc28=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xc28c[_0x2aecb2];return _0x3ebb80;};'use strict';var _=require(_0xcc28('0x0'));var util=require(_0xcc28('0x1'));var moment=require(_0xcc28('0x2'));var BPromise=require('bluebird');var rs=require(_0xcc28('0x3'));var fs=require('fs');var Redis=require(_0xcc28('0x4'));var db=require(_0xcc28('0x5'))['db'];var utils=require(_0xcc28('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcc28('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcc28('0x8')][_0xcc28('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12785a,_0x15e8e3,_0x3088f2){return new BPromise(function(_0x36ac46,_0x5e0f6d){return client[_0xcc28('0xa')](_0x12785a,_0x3088f2)[_0xcc28('0xb')](function(_0x21e31c){logger[_0xcc28('0xc')](_0xcc28('0xd'),_0x15e8e3,_0xcc28('0xe'));logger[_0xcc28('0xf')](_0xcc28('0x10'),_0x15e8e3,_0xcc28('0xe'),JSON[_0xcc28('0x11')](_0x21e31c));if(_0x21e31c['error']){if(_0x21e31c[_0xcc28('0x12')]['code']===0x1f4){logger['error'](_0xcc28('0xd'),_0x15e8e3,_0x21e31c[_0xcc28('0x12')][_0xcc28('0x13')]);return _0x5e0f6d(_0x21e31c['error'][_0xcc28('0x13')]);}logger['error'](_0xcc28('0xd'),_0x15e8e3,_0x21e31c[_0xcc28('0x12')]['message']);return _0x36ac46(_0x21e31c[_0xcc28('0x12')][_0xcc28('0x13')]);}else{logger[_0xcc28('0xc')](_0xcc28('0xd'),_0x15e8e3,_0xcc28('0xe'));_0x36ac46(_0x21e31c[_0xcc28('0x14')]['message']);}})['catch'](function(_0x5d31e6){logger[_0xcc28('0x12')](_0xcc28('0xd'),_0x15e8e3,_0x5d31e6);_0x5e0f6d(_0x5d31e6);});});}
\ No newline at end of file
+var _0x2a7b=['message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4f06be,_0x321c80){var _0x1c0a92=function(_0x33a1e5){while(--_0x33a1e5){_0x4f06be['push'](_0x4f06be['shift']());}};_0x1c0a92(++_0x321c80);}(_0x2a7b,0x8d));var _0xb2a7=function(_0x492071,_0x24e16e){_0x492071=_0x492071-0x0;var _0x26ae90=_0x2a7b[_0x492071];return _0x26ae90;};'use strict';var _=require(_0xb2a7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb2a7('0x1'));var rs=require(_0xb2a7('0x2'));var fs=require('fs');var Redis=require(_0xb2a7('0x3'));var db=require(_0xb2a7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb2a7('0x5'))(_0xb2a7('0x6'));var config=require(_0xb2a7('0x7'));var jayson=require(_0xb2a7('0x8'));var client=jayson[_0xb2a7('0x9')][_0xb2a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd9bc20,_0x44c0d1,_0x1e20d1){return new BPromise(function(_0x36aeef,_0x5119cb){return client[_0xb2a7('0xb')](_0xd9bc20,_0x1e20d1)[_0xb2a7('0xc')](function(_0x9d5e64){logger[_0xb2a7('0xd')](_0xb2a7('0xe'),_0x44c0d1,'request\x20sent');logger[_0xb2a7('0xf')](_0xb2a7('0x10'),_0x44c0d1,_0xb2a7('0x11'),JSON[_0xb2a7('0x12')](_0x9d5e64));if(_0x9d5e64[_0xb2a7('0x13')]){if(_0x9d5e64[_0xb2a7('0x13')]['code']===0x1f4){logger[_0xb2a7('0x13')](_0xb2a7('0xe'),_0x44c0d1,_0x9d5e64[_0xb2a7('0x13')]['message']);return _0x5119cb(_0x9d5e64[_0xb2a7('0x13')][_0xb2a7('0x14')]);}logger[_0xb2a7('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x44c0d1,_0x9d5e64[_0xb2a7('0x13')][_0xb2a7('0x14')]);return _0x36aeef(_0x9d5e64[_0xb2a7('0x13')][_0xb2a7('0x14')]);}else{logger[_0xb2a7('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x44c0d1,_0xb2a7('0x11'));_0x36aeef(_0x9d5e64[_0xb2a7('0x15')]['message']);}})[_0xb2a7('0x16')](function(_0x4bb5f4){logger[_0xb2a7('0x13')](_0xb2a7('0xe'),_0x44c0d1,_0x4bb5f4);_0x5119cb(_0x4bb5f4);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 2334d60..d48e5cb 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 _0x5fc3=['create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','get','show','isAuthenticated'];(function(_0x5153dc,_0x479007){var _0xd13e22=function(_0x58d998){while(--_0x58d998){_0x5153dc['push'](_0x5153dc['shift']());}};_0xd13e22(++_0x479007);}(_0x5fc3,0xa8));var _0x35fc=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x5fc3[_0x469a3c];return _0x968f4;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x35fc('0xa')]);router['post']('/',auth[_0x35fc('0xb')](),controller[_0x35fc('0xc')]);router[_0x35fc('0xd')](_0x35fc('0xe'),auth[_0x35fc('0xb')](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xb')](),controller[_0x35fc('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x2675=['../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','delete','exports','multer','express','Router'];(function(_0x20d6f0,_0x5bf6b8){var _0x4cdb25=function(_0x2f7773){while(--_0x2f7773){_0x20d6f0['push'](_0x20d6f0['shift']());}};_0x4cdb25(++_0x5bf6b8);}(_0x2675,0x75));var _0x5267=function(_0x4ef8c2,_0x19a834){_0x4ef8c2=_0x4ef8c2-0x0;var _0x38dce9=_0x2675[_0x4ef8c2];return _0x38dce9;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5267('0x3'));var interaction=require(_0x5267('0x4'));var config=require('../../config/environment');var controller=require(_0x5267('0x5'));router[_0x5267('0x6')](_0x5267('0x7'),auth[_0x5267('0x8')](),controller[_0x5267('0x9')]);router[_0x5267('0xa')]('/',auth['isAuthenticated'](),controller[_0x5267('0xb')]);router[_0x5267('0xc')]('/:id',auth[_0x5267('0x8')](),controller['update']);router[_0x5267('0xd')](_0x5267('0x7'),auth[_0x5267('0x8')](),controller['destroy']);module[_0x5267('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index be5f6c6..1751152 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 _0x2aeb=['sequelize','exports','STRING','name','rrmemory','roundrobin'];(function(_0x24bb57,_0x4b43f4){var _0x329956=function(_0x1c1fb3){while(--_0x1c1fb3){_0x24bb57['push'](_0x24bb57['shift']());}};_0x329956(++_0x4b43f4);}(_0x2aeb,0x1f2));var _0xb2ae=function(_0x4a257a,_0x4f2b42){_0x4a257a=_0x4a257a-0x0;var _0x34cd09=_0x2aeb[_0x4a257a];return _0x34cd09;};'use strict';var Sequelize=require(_0xb2ae('0x0'));module[_0xb2ae('0x1')]={'name':{'type':Sequelize[_0xb2ae('0x2')],'unique':_0xb2ae('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['ENUM'](_0xb2ae('0x4'),'beepall',_0xb2ae('0x5'))}};
\ No newline at end of file
+var _0x2b56=['name','STRING','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x490ff6,_0x5e5554){var _0x2ccce5=function(_0x36743d){while(--_0x36743d){_0x490ff6['push'](_0x490ff6['shift']());}};_0x2ccce5(++_0x5e5554);}(_0x2b56,0xa0));var _0x62b5=function(_0x542291,_0x3733d4){_0x542291=_0x542291-0x0;var _0x3a021c=_0x2b56[_0x542291];return _0x3a021c;};'use strict';var Sequelize=require(_0x62b5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x62b5('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x62b5('0x2')]},'timeout':{'type':Sequelize[_0x62b5('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x62b5('0x4')](_0x62b5('0x5'),_0x62b5('0x6'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 6cfa8ac..c458e5d 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 _0xa029=['omit','spread','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','index','map','ChatQueue','fieldName','key','getOptions','where','include','query','findAll','catch','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','includeAll','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','body','describe','getMembers','findOne','UserChatQueue','length','hasOwnProperty','sort','pick','ChatQueueId','filter','User','findAndCountAll','agent','updatedAt','createdAt','rows','format','%s/%s','chatPause','getTeams','Team','order','nolimit','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','union','compact','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents'];(function(_0x2a7812,_0x1ce83a){var _0x3e1342=function(_0x3ff9fb){while(--_0x3ff9fb){_0x2a7812['push'](_0x2a7812['shift']());}};_0x3e1342(++_0x1ce83a);}(_0xa029,0x7c));var _0x9a02=function(_0x48d36c,_0x501a68){_0x48d36c=_0x48d36c-0x0;var _0x320a53=_0xa029[_0x48d36c];return _0x320a53;};'use strict';var BPromise=require(_0x9a02('0x0'));var util=require(_0x9a02('0x1'));var _=require(_0x9a02('0x2'));var squel=require('squel');var Redis=require(_0x9a02('0x3'));var qs=require(_0x9a02('0x4'));var logger=require(_0x9a02('0x5'))(_0x9a02('0x6'));var config=require(_0x9a02('0x7'));var db=require(_0x9a02('0x8'))['db'];config[_0x9a02('0x9')]=_[_0x9a02('0xa')](config[_0x9a02('0x9')],{'host':_0x9a02('0xb'),'port':0x18eb});var socket=require(_0x9a02('0xc'))(new Redis(config[_0x9a02('0x9')]));require('./chatQueue.socket')['register'](socket);function respondWithStatusCode(_0x2d9dbf,_0x494a23){_0x494a23=_0x494a23||0xcc;return function(_0x966e1b){if(_0x966e1b){return _0x2d9dbf[_0x9a02('0xd')](_0x494a23);}return _0x2d9dbf[_0x9a02('0xe')](_0x494a23)[_0x9a02('0xf')]();};}function respondWithResult(_0x51512a,_0x29b245){_0x29b245=_0x29b245||0xc8;return function(_0x4ed3ef){if(_0x4ed3ef){return _0x51512a['status'](_0x29b245)['json'](_0x4ed3ef);}};}function respondWithFilteredResult(_0xa487c3,_0x186c42){return function(_0x176d36){if(_0x176d36){var _0x7b37d3=typeof _0x186c42[_0x9a02('0x10')]===_0x9a02('0x11')&&typeof _0x186c42[_0x9a02('0x12')]===_0x9a02('0x11');var _0x24ee7e=_0x176d36[_0x9a02('0x13')];var _0x1565b2=_0x7b37d3?0x0:_0x186c42[_0x9a02('0x10')];var _0x44d3aa=_0x7b37d3?_0x176d36[_0x9a02('0x13')]:_0x186c42[_0x9a02('0x10')]+_0x186c42[_0x9a02('0x12')];var _0x789bee;if(_0x44d3aa>=_0x24ee7e){_0x44d3aa=_0x24ee7e;_0x789bee=0xc8;}else{_0x789bee=0xce;}_0xa487c3[_0x9a02('0xe')](_0x789bee);return _0xa487c3['set'](_0x9a02('0x14'),_0x1565b2+'-'+_0x44d3aa+'/'+_0x24ee7e)['json'](_0x176d36);}return null;};}function saveUpdates(_0x40c93f){return function(_0x410759){if(_0x410759){return _0x410759[_0x9a02('0x15')](_0x40c93f)[_0x9a02('0x16')](function(_0x268c6d){return _0x268c6d;});}return null;};}function removeEntity(_0x570889){return function(_0x29cded){if(_0x29cded){return _0x29cded[_0x9a02('0x17')]()['then'](function(){var _0x29b8a6=_0x29cded[_0x9a02('0x18')]({'plain':!![]});var _0x23dd35=_0x9a02('0x19');return db[_0x9a02('0x1a')][_0x9a02('0x17')]({'where':{'type':_0x23dd35,'resourceId':_0x29b8a6['id']}})['then'](function(){return _0x29cded;});})[_0x9a02('0x16')](function(){_0x570889['status'](0xcc)[_0x9a02('0xf')]();});}};}function handleEntityNotFound(_0x58a800){return function(_0x5de3b1){if(!_0x5de3b1){_0x58a800[_0x9a02('0xd')](0x194);}return _0x5de3b1;};}function handleError(_0x1a2e8f,_0x17a4cf){_0x17a4cf=_0x17a4cf||0x1f4;return function(_0x10695c){logger[_0x9a02('0x1b')](_0x10695c[_0x9a02('0x1c')]);if(_0x10695c[_0x9a02('0x1d')]){delete _0x10695c['name'];}_0x1a2e8f[_0x9a02('0xe')](_0x17a4cf)['send'](_0x10695c);};}exports[_0x9a02('0x1e')]=function(_0x5c1e43,_0x342a8a){var _0x4a6e0e={};var _0x515c13={'count':0x0,'rows':[]};var _0xdb142a=_[_0x9a02('0x1f')](db[_0x9a02('0x20')]['rawAttributes'],function(_0x58ca93){return{'name':_0x58ca93[_0x9a02('0x21')],'type':_0x58ca93['type'][_0x9a02('0x22')]};});_0x4a6e0e=qs[_0x9a02('0x23')](_0xdb142a,_0x5c1e43);var _0xa192b9={'where':_0x4a6e0e[_0x9a02('0x24')]};return db[_0x9a02('0x20')][_0x9a02('0x13')](_0xa192b9)[_0x9a02('0x16')](function(_0x12211a){_0x515c13[_0x9a02('0x13')]=_0x12211a;_0x4a6e0e[_0x9a02('0x25')]=qs[_0x9a02('0x25')](_0x5c1e43[_0x9a02('0x26')]);return db['ChatQueue'][_0x9a02('0x27')](_0x4a6e0e);})[_0x9a02('0x16')](function(_0x593531){_0x515c13['rows']=_0x593531;return _0x515c13;})['then'](respondWithFilteredResult(_0x342a8a,_0x4a6e0e))[_0x9a02('0x28')](handleError(_0x342a8a,null));};exports[_0x9a02('0x29')]=function(_0x55892b,_0x451c9c){var _0x5d42a5={'raw':!![],'where':{'id':_0x55892b[_0x9a02('0x2a')]['id']}},_0xea0e42={};_0xea0e42[_0x9a02('0x2b')]=_[_0x9a02('0x2c')](db[_0x9a02('0x20')][_0x9a02('0x2d')]);_0xea0e42[_0x9a02('0x26')]=_[_0x9a02('0x2c')](_0x55892b[_0x9a02('0x26')]);_0xea0e42[_0x9a02('0x2e')]=_[_0x9a02('0x2f')](_0xea0e42['model'],_0xea0e42[_0x9a02('0x26')]);_0x5d42a5[_0x9a02('0x30')]=_[_0x9a02('0x2f')](_0xea0e42[_0x9a02('0x2b')],qs[_0x9a02('0x31')](_0x55892b[_0x9a02('0x26')][_0x9a02('0x31')]));_0x5d42a5[_0x9a02('0x30')]=_0x5d42a5[_0x9a02('0x30')]['length']?_0x5d42a5[_0x9a02('0x30')]:_0xea0e42['model'];if(_0x55892b['query'][_0x9a02('0x32')]){_0x5d42a5['include']=[{'all':!![]}];}_0x5d42a5=_[_0x9a02('0x33')]({},_0x5d42a5,_0x55892b[_0x9a02('0x34')]);return db['ChatQueue'][_0x9a02('0x35')](_0x5d42a5)['then'](handleEntityNotFound(_0x451c9c,null))['then'](respondWithResult(_0x451c9c,null))[_0x9a02('0x28')](handleError(_0x451c9c,null));};exports[_0x9a02('0x36')]=function(_0x1cb5fe,_0x420711){return db[_0x9a02('0x20')][_0x9a02('0x36')](_0x1cb5fe['body'],{})[_0x9a02('0x16')](function(_0x224e12){var _0x55e418=_0x1cb5fe['user'][_0x9a02('0x18')]({'plain':!![]});if(!_0x55e418)throw new Error(_0x9a02('0x37'));if(_0x55e418[_0x9a02('0x38')]===_0x9a02('0x39')){var _0x489c31=_0x224e12[_0x9a02('0x18')]({'plain':!![]});var _0x5a63b5=_0x9a02('0x19');return db[_0x9a02('0x3a')][_0x9a02('0x35')]({'where':{'name':_0x5a63b5,'userProfileId':_0x55e418[_0x9a02('0x3b')]},'raw':!![]})[_0x9a02('0x16')](function(_0x251602){if(_0x251602&&_0x251602['autoAssociation']===0x0){return db[_0x9a02('0x1a')]['create']({'name':_0x489c31['name'],'resourceId':_0x489c31['id'],'type':_0x251602[_0x9a02('0x1d')],'sectionId':_0x251602['id']},{})[_0x9a02('0x16')](function(){return _0x224e12;});}else{return _0x224e12;}})[_0x9a02('0x28')](function(_0x345ca6){logger[_0x9a02('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x345ca6);throw _0x345ca6;});}return _0x224e12;})[_0x9a02('0x16')](respondWithResult(_0x420711,0xc9))[_0x9a02('0x28')](handleError(_0x420711,null));};exports[_0x9a02('0x15')]=function(_0xd2c058,_0x24fe41){if(_0xd2c058['body']['id']){delete _0xd2c058[_0x9a02('0x3c')]['id'];}return db[_0x9a02('0x20')][_0x9a02('0x35')]({'where':{'id':_0xd2c058[_0x9a02('0x2a')]['id']}})['then'](handleEntityNotFound(_0x24fe41,null))[_0x9a02('0x16')](saveUpdates(_0xd2c058[_0x9a02('0x3c')],null))['then'](respondWithResult(_0x24fe41,null))['catch'](handleError(_0x24fe41,null));};exports[_0x9a02('0x17')]=function(_0x4ecf7a,_0x3652ee){return db[_0x9a02('0x20')][_0x9a02('0x35')]({'where':{'id':_0x4ecf7a[_0x9a02('0x2a')]['id']}})[_0x9a02('0x16')](handleEntityNotFound(_0x3652ee,null))[_0x9a02('0x16')](removeEntity(_0x3652ee,null))[_0x9a02('0x28')](handleError(_0x3652ee,null));};exports[_0x9a02('0x3d')]=function(_0x1ca6a7,_0x275d32){return db[_0x9a02('0x20')][_0x9a02('0x3d')]()[_0x9a02('0x16')](respondWithResult(_0x275d32,null))[_0x9a02('0x28')](handleError(_0x275d32,null));};exports[_0x9a02('0x3e')]=function(_0x516ecf,_0x1e8553){var _0x18cf86={'raw':!![],'where':{}},_0x275623={},_0x4a7039;return db[_0x9a02('0x20')][_0x9a02('0x3f')]({'where':{'id':_0x516ecf[_0x9a02('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1e8553,null))[_0x9a02('0x16')](function(_0x378be6){if(_0x378be6){_0x4a7039=_0x378be6[_0x9a02('0x18')]({'plain':!![]});_0x275623[_0x9a02('0x2b')]=_['keys'](db[_0x9a02('0x40')][_0x9a02('0x2d')]);_0x275623[_0x9a02('0x26')]=_['keys'](_0x516ecf[_0x9a02('0x26')]);_0x275623[_0x9a02('0x2e')]=_[_0x9a02('0x2f')](_0x275623[_0x9a02('0x2b')],_0x275623['query']);_0x18cf86['attributes']=_[_0x9a02('0x2f')](_0x275623[_0x9a02('0x2b')],qs[_0x9a02('0x31')](_0x516ecf[_0x9a02('0x26')][_0x9a02('0x31')]));_0x18cf86[_0x9a02('0x30')]=_0x18cf86[_0x9a02('0x30')][_0x9a02('0x41')]?_0x18cf86[_0x9a02('0x30')]:_0x275623[_0x9a02('0x2b')];if(!_0x516ecf[_0x9a02('0x26')][_0x9a02('0x42')]('nolimit')){_0x18cf86[_0x9a02('0x12')]=qs['limit'](_0x516ecf[_0x9a02('0x26')][_0x9a02('0x12')]);_0x18cf86[_0x9a02('0x10')]=qs['offset'](_0x516ecf[_0x9a02('0x26')][_0x9a02('0x10')]);}_0x18cf86['order']=qs[_0x9a02('0x43')](_0x516ecf['query'][_0x9a02('0x43')]);_0x18cf86[_0x9a02('0x24')]=qs['filters'](_[_0x9a02('0x44')](_0x516ecf['query'],_0x275623[_0x9a02('0x2e')]));_0x18cf86['where'][_0x9a02('0x45')]=_0x378be6['id'];if(_0x516ecf[_0x9a02('0x26')][_0x9a02('0x46')]){_0x18cf86['where']=_[_0x9a02('0x33')](_0x18cf86[_0x9a02('0x24')],{'$or':_[_0x9a02('0x1f')](_0x18cf86[_0x9a02('0x30')],function(_0x1dad1c){var _0x136ea3={};_0x136ea3[_0x1dad1c]={'$like':'%'+_0x516ecf[_0x9a02('0x26')][_0x9a02('0x46')]+'%'};return _0x136ea3;})});}_0x18cf86=_['merge']({},_0x18cf86,_0x516ecf[_0x9a02('0x34')]);return db[_0x9a02('0x40')][_0x9a02('0x27')](_0x18cf86);}})[_0x9a02('0x16')](function(_0x4a93c7){if(_0x4a93c7){return db[_0x9a02('0x47')][_0x9a02('0x48')]({'where':{'id':_[_0x9a02('0x1f')](_0x4a93c7,'UserId'),'role':_0x9a02('0x49')},'attributes':['id',_0x9a02('0x1d'),'chatPause',_0x9a02('0x4a'),_0x9a02('0x4b')]});}})[_0x9a02('0x16')](function(_0x4b3a4b){if(_0x4b3a4b){return{'count':_0x4b3a4b[_0x9a02('0x13')],'rows':_[_0x9a02('0x1f')](_0x4b3a4b[_0x9a02('0x4c')],function(_0x34b6b0){return{'membername':_0x34b6b0[_0x9a02('0x1d')],'UserId':_0x34b6b0['id'],'queue_name':_0x4a7039['name'],'ChatQueueId':_0x4a7039['id'],'interface':util[_0x9a02('0x4d')](_0x9a02('0x4e'),'SIP',_0x34b6b0[_0x9a02('0x1d')]),'penalty':0x0,'paused':_0x34b6b0[_0x9a02('0x4f')],'createdAt':_0x34b6b0[_0x9a02('0x4b')],'updatedAt':_0x34b6b0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1e8553,_0x18cf86))[_0x9a02('0x28')](handleError(_0x1e8553,null));};exports[_0x9a02('0x50')]=function(_0x5c981d,_0x1d4c48){var _0x2d25ea={};var _0x354391={};var _0x3b2264;var _0x37428c;return db[_0x9a02('0x20')][_0x9a02('0x3f')]({'where':{'id':_0x5c981d[_0x9a02('0x2a')]['id']}})[_0x9a02('0x16')](handleEntityNotFound(_0x1d4c48,null))[_0x9a02('0x16')](function(_0x44406f){if(_0x44406f){_0x3b2264=_0x44406f;_0x354391[_0x9a02('0x2b')]=_[_0x9a02('0x2c')](db[_0x9a02('0x51')][_0x9a02('0x2d')]);_0x354391[_0x9a02('0x26')]=_['keys'](_0x5c981d['query']);_0x354391[_0x9a02('0x2e')]=_['intersection'](_0x354391[_0x9a02('0x2b')],_0x354391['query']);_0x2d25ea[_0x9a02('0x30')]=_['intersection'](_0x354391[_0x9a02('0x2b')],qs[_0x9a02('0x31')](_0x5c981d[_0x9a02('0x26')][_0x9a02('0x31')]));_0x2d25ea[_0x9a02('0x30')]=_0x2d25ea[_0x9a02('0x30')][_0x9a02('0x41')]?_0x2d25ea[_0x9a02('0x30')]:_0x354391['model'];_0x2d25ea[_0x9a02('0x52')]=qs[_0x9a02('0x43')](_0x5c981d['query'][_0x9a02('0x43')]);_0x2d25ea['where']=qs[_0x9a02('0x2e')](_[_0x9a02('0x44')](_0x5c981d[_0x9a02('0x26')],_0x354391[_0x9a02('0x2e')]));if(_0x5c981d[_0x9a02('0x26')]['filter']){_0x2d25ea['where']=_[_0x9a02('0x33')](_0x2d25ea[_0x9a02('0x24')],{'$or':_[_0x9a02('0x1f')](_0x2d25ea['attributes'],function(_0x4961c4){var _0x453f72={};_0x453f72[_0x4961c4]={'$like':'%'+_0x5c981d[_0x9a02('0x26')]['filter']+'%'};return _0x453f72;})});}_0x2d25ea=_[_0x9a02('0x33')]({},_0x2d25ea,_0x5c981d[_0x9a02('0x34')]);return _0x3b2264[_0x9a02('0x50')](_0x2d25ea);}})[_0x9a02('0x16')](function(_0x4aed83){if(_0x4aed83){_0x37428c=_0x4aed83['length'];if(!_0x5c981d[_0x9a02('0x26')][_0x9a02('0x42')](_0x9a02('0x53'))){_0x2d25ea['limit']=qs[_0x9a02('0x12')](_0x5c981d[_0x9a02('0x26')]['limit']);_0x2d25ea['offset']=qs[_0x9a02('0x10')](_0x5c981d[_0x9a02('0x26')][_0x9a02('0x10')]);}return _0x3b2264[_0x9a02('0x50')](_0x2d25ea);}})[_0x9a02('0x16')](function(_0x478f78){if(_0x478f78){return _0x478f78?{'count':_0x37428c,'rows':_0x478f78}:null;}})[_0x9a02('0x16')](respondWithResult(_0x1d4c48,null))[_0x9a02('0x28')](handleError(_0x1d4c48,null));};exports[_0x9a02('0x54')]=function(_0x297e5f,_0x192322){var _0x478b53=_0x297e5f['body'][_0x9a02('0x55')];return db[_0x9a02('0x51')][_0x9a02('0x27')]({'where':{'id':_0x478b53},'attributes':['id'],'include':[{'model':db[_0x9a02('0x47')],'as':_0x9a02('0x56'),'attributes':['id',_0x9a02('0x1d'),_0x9a02('0x57'),_0x9a02('0x58'),_0x9a02('0x59')],'raw':!![]}]})[_0x9a02('0x16')](function(_0x4b4fac){if(_0x4b4fac){var _0x5ae69f=_[_0x9a02('0x5a')](_0x4b4fac,function(_0x43b692){var _0x4b7af0=_0x43b692['get']({'plain':!![]});return _0x4b7af0[_0x9a02('0x56')];});return db[_0x9a02('0x20')][_0x9a02('0x35')]({'where':{'id':_0x297e5f[_0x9a02('0x2a')]['id']}})[_0x9a02('0x16')](function(_0x1e09de){return db[_0x9a02('0x5b')]['transaction'](function(_0x31bc70){return _0x1e09de['addTeams'](_0x478b53,{'transaction':_0x31bc70})[_0x9a02('0x16')](function(){return BPromise[_0x9a02('0x5c')](_0x5ae69f,function(_0x97fd7c){return db[_0x9a02('0x40')][_0x9a02('0x5d')]({'where':{'UserId':_0x97fd7c['id'],'ChatQueueId':_0x297e5f['params']['id']},'transaction':_0x31bc70});});})[_0x9a02('0x16')](function(){_0x5ae69f[_0x9a02('0x5e')](function(_0x43e995){socket[_0x9a02('0x5f')](_0x9a02('0x60'),{'UserId':_0x43e995['id'],'ChatQueueId':_0x1e09de['id']});});});});});}})['then'](respondWithStatusCode(_0x192322,null))[_0x9a02('0x28')](handleError(_0x192322,null));};exports[_0x9a02('0x61')]=function(_0x1a148d,_0x180f3f){return db['Team'][_0x9a02('0x27')]({'where':{'id':_0x1a148d[_0x9a02('0x26')][_0x9a02('0x55')]},'attributes':['id'],'include':[{'model':db[_0x9a02('0x47')],'as':_0x9a02('0x56'),'attributes':['id'],'raw':!![]}]})[_0x9a02('0x16')](handleEntityNotFound(_0x180f3f,null))['then'](function(_0x563a08){var _0x454009=_[_0x9a02('0x1f')](_0x563a08,'id');var _0x5797b6=[];var _0x257b40=[];var _0x26c729=squel['select']();_0x26c729[_0x9a02('0x62')](_0x9a02('0x63'))['from'](_0x9a02('0x64'),'tq')[_0x9a02('0x65')](_0x9a02('0x66'),'ut',_0x9a02('0x67'))[_0x9a02('0x24')]('ChatQueueId\x20=\x20?',_0x1a148d[_0x9a02('0x2a')]['id']);for(var _0x4d071e=0x0;_0x4d071e<_0x563a08['length'];_0x4d071e+=0x1){let _0xa9633c=_0x563a08[_0x4d071e];for(var _0x220ef3=0x0;_0x220ef3<_0xa9633c[_0x9a02('0x56')][_0x9a02('0x41')];_0x220ef3+=0x1){let _0xc0cc50=_0xa9633c['Agents'][_0x220ef3];var _0x1592ea=_0x26c729['clone']();_0x1592ea[_0x9a02('0x24')](_0x9a02('0x68'),_0xc0cc50['id']);_0x257b40[_0x9a02('0x69')](db[_0x9a02('0x5b')][_0x9a02('0x26')](_0x1592ea[_0x9a02('0x6a')](),{'type':db['sequelize']['QueryTypes'][_0x9a02('0x6b')]})['then'](function(_0x35cb1f){if(_0x35cb1f[_0x9a02('0x41')]===0x1){return _0xc0cc50['id'];}else{var _0x2fba86=_[_0x9a02('0x6c')](_['map'](_0x35cb1f,_0x9a02('0x6d')),function(_0x45422c){return _['includes'](_0x454009,_0x45422c);});if(_0x2fba86){return _0xc0cc50['id'];}}}));}}return BPromise['all'](_0x257b40)[_0x9a02('0x16')](function(_0x470cd4){_0x5797b6=_(_0x5797b6)[_0x9a02('0x6e')](_0x470cd4)[_0x9a02('0x6f')]()[_0x9a02('0x70')]();return db[_0x9a02('0x20')][_0x9a02('0x35')]({'where':{'id':_0x1a148d[_0x9a02('0x2a')]['id']}})[_0x9a02('0x16')](function(_0x121e2c){return db[_0x9a02('0x5b')][_0x9a02('0x71')](function(_0x2154d0){return _0x121e2c['removeTeams'](_0x1a148d[_0x9a02('0x26')]['ids'],{'transaction':_0x2154d0})[_0x9a02('0x16')](function(){if(!_[_0x9a02('0x72')](_0x5797b6)){return _0x121e2c[_0x9a02('0x73')](_0x5797b6,{'transaction':_0x2154d0});}})[_0x9a02('0x16')](function(){_0x5797b6[_0x9a02('0x5e')](function(_0x2b88f){socket[_0x9a02('0x5f')](_0x9a02('0x74'),{'UserId':_0x2b88f,'ChatQueueId':_0x121e2c['id']});});});});});});})[_0x9a02('0x16')](respondWithStatusCode(_0x180f3f,null))[_0x9a02('0x28')](handleError(_0x180f3f,null));};exports[_0x9a02('0x75')]=function(_0x5a6637,_0x242315){return db[_0x9a02('0x20')][_0x9a02('0x35')]({'where':{'id':_0x5a6637[_0x9a02('0x2a')]['id']}})[_0x9a02('0x16')](handleEntityNotFound(_0x242315,null))['then'](function(_0x1b3a1f){if(_0x1b3a1f){return _0x1b3a1f[_0x9a02('0x75')](_0x5a6637['body'][_0x9a02('0x55')],_[_0x9a02('0x76')](_0x5a6637['body'],[_0x9a02('0x55'),'id'])||{})[_0x9a02('0x77')](function(_0x33d17b){for(var _0xb55d9f=0x0;_0xb55d9f<_0x5a6637[_0x9a02('0x3c')][_0x9a02('0x55')][_0x9a02('0x41')];_0xb55d9f+=0x1){socket[_0x9a02('0x5f')](_0x9a02('0x60'),{'UserId':Number(_0x5a6637[_0x9a02('0x3c')][_0x9a02('0x55')][_0xb55d9f]),'ChatQueueId':Number(_0x5a6637[_0x9a02('0x2a')]['id'])});}return _0x33d17b;});}})[_0x9a02('0x16')](respondWithResult(_0x242315,null))[_0x9a02('0x28')](handleError(_0x242315,null));};exports[_0x9a02('0x73')]=function(_0x3a028b,_0x2a18e8){return db[_0x9a02('0x20')][_0x9a02('0x35')]({'where':{'id':_0x3a028b[_0x9a02('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2a18e8,null))['then'](function(_0x3b2e4b){if(_0x3b2e4b){return _0x3b2e4b['removeAgents'](_0x3a028b[_0x9a02('0x26')][_0x9a02('0x55')])[_0x9a02('0x16')](function(){if(_['isArray'](_0x3a028b[_0x9a02('0x26')]['ids'])){for(var _0x830527=0x0;_0x830527<_0x3a028b['query']['ids'][_0x9a02('0x41')];_0x830527+=0x1){socket[_0x9a02('0x5f')](_0x9a02('0x74'),{'UserId':Number(_0x3a028b[_0x9a02('0x26')]['ids'][_0x830527]),'ChatQueueId':Number(_0x3a028b['params']['id'])});}}else{socket[_0x9a02('0x5f')](_0x9a02('0x74'),{'UserId':Number(_0x3a028b[_0x9a02('0x26')]['ids']),'ChatQueueId':Number(_0x3a028b[_0x9a02('0x2a')]['id'])});}});}})[_0x9a02('0x16')](respondWithStatusCode(_0x2a18e8,null))[_0x9a02('0x28')](handleError(_0x2a18e8,null));};exports['getAgents']=function(_0xa1f51a,_0x57b75c){var _0x24b2b4={};var _0x4c2886={};var _0x381a03;var _0x2ab13b;return db[_0x9a02('0x20')][_0x9a02('0x3f')]({'where':{'id':_0xa1f51a[_0x9a02('0x2a')]['id']}})[_0x9a02('0x16')](handleEntityNotFound(_0x57b75c,null))[_0x9a02('0x16')](function(_0x3f5889){if(_0x3f5889){_0x381a03=_0x3f5889;_0x4c2886[_0x9a02('0x2b')]=_['keys'](db[_0x9a02('0x47')][_0x9a02('0x2d')]);_0x4c2886[_0x9a02('0x26')]=_[_0x9a02('0x2c')](_0xa1f51a[_0x9a02('0x26')]);_0x4c2886['filters']=_['intersection'](_0x4c2886[_0x9a02('0x2b')],_0x4c2886[_0x9a02('0x26')]);_0x24b2b4['attributes']=_[_0x9a02('0x2f')](_0x4c2886[_0x9a02('0x2b')],qs[_0x9a02('0x31')](_0xa1f51a[_0x9a02('0x26')][_0x9a02('0x31')]));_0x24b2b4[_0x9a02('0x30')]=_0x24b2b4[_0x9a02('0x30')][_0x9a02('0x41')]?_0x24b2b4[_0x9a02('0x30')]:_0x4c2886['model'];_0x24b2b4['order']=qs[_0x9a02('0x43')](_0xa1f51a[_0x9a02('0x26')][_0x9a02('0x43')]);_0x24b2b4[_0x9a02('0x24')]=qs[_0x9a02('0x2e')](_[_0x9a02('0x44')](_0xa1f51a['query'],_0x4c2886[_0x9a02('0x2e')]));if(_0xa1f51a[_0x9a02('0x26')]['filter']){_0x24b2b4[_0x9a02('0x24')]=_['merge'](_0x24b2b4['where'],{'$or':_[_0x9a02('0x1f')](_0x24b2b4[_0x9a02('0x30')],function(_0x3aca43){var _0x4eb7bd={};_0x4eb7bd[_0x3aca43]={'$like':'%'+_0xa1f51a[_0x9a02('0x26')][_0x9a02('0x46')]+'%'};return _0x4eb7bd;})});}_0x24b2b4=_['merge']({},_0x24b2b4,_0xa1f51a['options']);return _0x381a03['getAgents'](_0x24b2b4);}})[_0x9a02('0x16')](function(_0x5b643b){if(_0x5b643b){_0x2ab13b=_0x5b643b['length'];if(!_0xa1f51a['query'][_0x9a02('0x42')](_0x9a02('0x53'))){_0x24b2b4[_0x9a02('0x12')]=qs['limit'](_0xa1f51a[_0x9a02('0x26')][_0x9a02('0x12')]);_0x24b2b4[_0x9a02('0x10')]=qs[_0x9a02('0x10')](_0xa1f51a[_0x9a02('0x26')]['offset']);}return _0x381a03[_0x9a02('0x78')](_0x24b2b4);}})[_0x9a02('0x16')](function(_0x387274){if(_0x387274){return _0x387274?{'count':_0x2ab13b,'rows':_0x387274}:null;}})[_0x9a02('0x16')](respondWithResult(_0x57b75c,null))['catch'](handleError(_0x57b75c,null));};
\ No newline at end of file
+var _0xd3ea=['format','%s/%s','createdAt','getTeams','Team','order','ids','online','voicePause','interface','flatMap','Agents','transaction','addTeams','each','findOrCreate','forEach','userChatQueue:save','removeTeams','field','tq.TeamId','from','join','user_has_teams','clone','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','spread','isArray','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','key','where','include','ChatQueue','findAll','rows','catch','show','params','model','keys','query','filters','attributes','intersection','fields','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','rawAttributes','length','hasOwnProperty','nolimit','sort','pick','ChatQueueId','filter','merge','User','UserId','chatPause','updatedAt'];(function(_0x1dab5f,_0x10cd21){var _0x40c2f3=function(_0x325a0d){while(--_0x325a0d){_0x1dab5f['push'](_0x1dab5f['shift']());}};_0x40c2f3(++_0x10cd21);}(_0xd3ea,0x117));var _0xad3e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xd3ea[_0x411add];return _0x238242;};'use strict';var BPromise=require('bluebird');var util=require(_0xad3e('0x0'));var _=require(_0xad3e('0x1'));var squel=require(_0xad3e('0x2'));var Redis=require(_0xad3e('0x3'));var qs=require(_0xad3e('0x4'));var logger=require(_0xad3e('0x5'))(_0xad3e('0x6'));var config=require(_0xad3e('0x7'));var db=require(_0xad3e('0x8'))['db'];config[_0xad3e('0x9')]=_['defaults'](config[_0xad3e('0x9')],{'host':_0xad3e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xad3e('0x9')]));require(_0xad3e('0xb'))[_0xad3e('0xc')](socket);function respondWithStatusCode(_0xd26996,_0x279e65){_0x279e65=_0x279e65||0xcc;return function(_0x17891d){if(_0x17891d){return _0xd26996[_0xad3e('0xd')](_0x279e65);}return _0xd26996[_0xad3e('0xe')](_0x279e65)[_0xad3e('0xf')]();};}function respondWithResult(_0x193929,_0x74f391){_0x74f391=_0x74f391||0xc8;return function(_0x499da7){if(_0x499da7){return _0x193929['status'](_0x74f391)[_0xad3e('0x10')](_0x499da7);}};}function respondWithFilteredResult(_0x412fcb,_0x3e9852){return function(_0x409fa5){if(_0x409fa5){var _0x4dd82c=typeof _0x3e9852[_0xad3e('0x11')]===_0xad3e('0x12')&&typeof _0x3e9852[_0xad3e('0x13')]===_0xad3e('0x12');var _0x1c751d=_0x409fa5[_0xad3e('0x14')];var _0x43183c=_0x4dd82c?0x0:_0x3e9852[_0xad3e('0x11')];var _0x1f220b=_0x4dd82c?_0x409fa5['count']:_0x3e9852[_0xad3e('0x11')]+_0x3e9852[_0xad3e('0x13')];var _0x11aa33;if(_0x1f220b>=_0x1c751d){_0x1f220b=_0x1c751d;_0x11aa33=0xc8;}else{_0x11aa33=0xce;}_0x412fcb[_0xad3e('0xe')](_0x11aa33);return _0x412fcb['set'](_0xad3e('0x15'),_0x43183c+'-'+_0x1f220b+'/'+_0x1c751d)[_0xad3e('0x10')](_0x409fa5);}return null;};}function saveUpdates(_0x54fa7e){return function(_0x1e1223){if(_0x1e1223){return _0x1e1223[_0xad3e('0x16')](_0x54fa7e)[_0xad3e('0x17')](function(_0x20f6b0){return _0x20f6b0;});}return null;};}function removeEntity(_0x5619c1){return function(_0x112770){if(_0x112770){return _0x112770[_0xad3e('0x18')]()[_0xad3e('0x17')](function(){var _0x4aa536=_0x112770[_0xad3e('0x19')]({'plain':!![]});var _0x1bdef3=_0xad3e('0x1a');return db[_0xad3e('0x1b')][_0xad3e('0x18')]({'where':{'type':_0x1bdef3,'resourceId':_0x4aa536['id']}})[_0xad3e('0x17')](function(){return _0x112770;});})[_0xad3e('0x17')](function(){_0x5619c1[_0xad3e('0xe')](0xcc)[_0xad3e('0xf')]();});}};}function handleEntityNotFound(_0x174445){return function(_0xa2dffe){if(!_0xa2dffe){_0x174445['sendStatus'](0x194);}return _0xa2dffe;};}function handleError(_0x29a774,_0xa9bf60){_0xa9bf60=_0xa9bf60||0x1f4;return function(_0x30ee19){logger['error'](_0x30ee19['stack']);if(_0x30ee19[_0xad3e('0x1c')]){delete _0x30ee19['name'];}_0x29a774[_0xad3e('0xe')](_0xa9bf60)[_0xad3e('0x1d')](_0x30ee19);};}exports[_0xad3e('0x1e')]=function(_0xfb6b9a,_0xfdf539){var _0x2842f5={};var _0x34fbb4={'count':0x0,'rows':[]};var _0x48dae4=_[_0xad3e('0x1f')](db['ChatQueue']['rawAttributes'],function(_0x115bf8){return{'name':_0x115bf8['fieldName'],'type':_0x115bf8['type'][_0xad3e('0x20')]};});_0x2842f5=qs['getOptions'](_0x48dae4,_0xfb6b9a);var _0x55361b={'where':_0x2842f5[_0xad3e('0x21')]};return db['ChatQueue']['count'](_0x55361b)[_0xad3e('0x17')](function(_0x441eb3){_0x34fbb4[_0xad3e('0x14')]=_0x441eb3;_0x2842f5[_0xad3e('0x22')]=qs[_0xad3e('0x22')](_0xfb6b9a['query']);return db[_0xad3e('0x23')][_0xad3e('0x24')](_0x2842f5);})[_0xad3e('0x17')](function(_0x22e88b){_0x34fbb4[_0xad3e('0x25')]=_0x22e88b;return _0x34fbb4;})[_0xad3e('0x17')](respondWithFilteredResult(_0xfdf539,_0x2842f5))[_0xad3e('0x26')](handleError(_0xfdf539,null));};exports[_0xad3e('0x27')]=function(_0x5921c5,_0x651b9e){var _0x198e4c={'raw':!![],'where':{'id':_0x5921c5[_0xad3e('0x28')]['id']}},_0x13cf97={};_0x13cf97[_0xad3e('0x29')]=_[_0xad3e('0x2a')](db[_0xad3e('0x23')]['rawAttributes']);_0x13cf97[_0xad3e('0x2b')]=_['keys'](_0x5921c5[_0xad3e('0x2b')]);_0x13cf97[_0xad3e('0x2c')]=_['intersection'](_0x13cf97[_0xad3e('0x29')],_0x13cf97[_0xad3e('0x2b')]);_0x198e4c[_0xad3e('0x2d')]=_[_0xad3e('0x2e')](_0x13cf97['model'],qs['fields'](_0x5921c5['query'][_0xad3e('0x2f')]));_0x198e4c[_0xad3e('0x2d')]=_0x198e4c[_0xad3e('0x2d')]['length']?_0x198e4c['attributes']:_0x13cf97[_0xad3e('0x29')];if(_0x5921c5['query'][_0xad3e('0x30')]){_0x198e4c[_0xad3e('0x22')]=[{'all':!![]}];}_0x198e4c=_['merge']({},_0x198e4c,_0x5921c5[_0xad3e('0x31')]);return db[_0xad3e('0x23')][_0xad3e('0x32')](_0x198e4c)[_0xad3e('0x17')](handleEntityNotFound(_0x651b9e,null))['then'](respondWithResult(_0x651b9e,null))['catch'](handleError(_0x651b9e,null));};exports['create']=function(_0x22c077,_0x58e474){return db['ChatQueue'][_0xad3e('0x33')](_0x22c077[_0xad3e('0x34')],{})[_0xad3e('0x17')](function(_0xfaa1e7){var _0x8d3513=_0x22c077['user'][_0xad3e('0x19')]({'plain':!![]});if(!_0x8d3513)throw new Error(_0xad3e('0x35'));if(_0x8d3513['role']===_0xad3e('0x36')){var _0x3b5feb=_0xfaa1e7['get']({'plain':!![]});var _0x4f5139=_0xad3e('0x1a');return db[_0xad3e('0x37')][_0xad3e('0x32')]({'where':{'name':_0x4f5139,'userProfileId':_0x8d3513['userProfileId']},'raw':!![]})[_0xad3e('0x17')](function(_0xa63950){if(_0xa63950&&_0xa63950[_0xad3e('0x38')]===0x0){return db[_0xad3e('0x1b')][_0xad3e('0x33')]({'name':_0x3b5feb[_0xad3e('0x1c')],'resourceId':_0x3b5feb['id'],'type':_0xa63950[_0xad3e('0x1c')],'sectionId':_0xa63950['id']},{})[_0xad3e('0x17')](function(){return _0xfaa1e7;});}else{return _0xfaa1e7;}})[_0xad3e('0x26')](function(_0x10f52d){logger[_0xad3e('0x39')](_0xad3e('0x3a'),_0x10f52d);throw _0x10f52d;});}return _0xfaa1e7;})[_0xad3e('0x17')](respondWithResult(_0x58e474,0xc9))[_0xad3e('0x26')](handleError(_0x58e474,null));};exports[_0xad3e('0x16')]=function(_0xd440dc,_0x39a6a3){if(_0xd440dc[_0xad3e('0x34')]['id']){delete _0xd440dc['body']['id'];}return db[_0xad3e('0x23')]['find']({'where':{'id':_0xd440dc[_0xad3e('0x28')]['id']}})[_0xad3e('0x17')](handleEntityNotFound(_0x39a6a3,null))['then'](saveUpdates(_0xd440dc[_0xad3e('0x34')],null))['then'](respondWithResult(_0x39a6a3,null))[_0xad3e('0x26')](handleError(_0x39a6a3,null));};exports[_0xad3e('0x18')]=function(_0x43bcf0,_0x3bdda2){return db[_0xad3e('0x23')][_0xad3e('0x32')]({'where':{'id':_0x43bcf0[_0xad3e('0x28')]['id']}})[_0xad3e('0x17')](handleEntityNotFound(_0x3bdda2,null))[_0xad3e('0x17')](removeEntity(_0x3bdda2,null))[_0xad3e('0x26')](handleError(_0x3bdda2,null));};exports[_0xad3e('0x3b')]=function(_0x2f25f8,_0x49181a){return db[_0xad3e('0x23')]['describe']()[_0xad3e('0x17')](respondWithResult(_0x49181a,null))[_0xad3e('0x26')](handleError(_0x49181a,null));};exports['getMembers']=function(_0x478a80,_0x47676e){var _0x11d245={'raw':!![],'where':{}},_0xf456bf={},_0x5668c7;return db[_0xad3e('0x23')][_0xad3e('0x3c')]({'where':{'id':_0x478a80[_0xad3e('0x28')]['id']}})[_0xad3e('0x17')](handleEntityNotFound(_0x47676e,null))[_0xad3e('0x17')](function(_0x346622){if(_0x346622){_0x5668c7=_0x346622[_0xad3e('0x19')]({'plain':!![]});_0xf456bf[_0xad3e('0x29')]=_[_0xad3e('0x2a')](db[_0xad3e('0x3d')][_0xad3e('0x3e')]);_0xf456bf['query']=_['keys'](_0x478a80[_0xad3e('0x2b')]);_0xf456bf[_0xad3e('0x2c')]=_['intersection'](_0xf456bf[_0xad3e('0x29')],_0xf456bf['query']);_0x11d245['attributes']=_[_0xad3e('0x2e')](_0xf456bf['model'],qs[_0xad3e('0x2f')](_0x478a80[_0xad3e('0x2b')]['fields']));_0x11d245[_0xad3e('0x2d')]=_0x11d245[_0xad3e('0x2d')][_0xad3e('0x3f')]?_0x11d245[_0xad3e('0x2d')]:_0xf456bf[_0xad3e('0x29')];if(!_0x478a80['query'][_0xad3e('0x40')](_0xad3e('0x41'))){_0x11d245[_0xad3e('0x13')]=qs[_0xad3e('0x13')](_0x478a80['query'][_0xad3e('0x13')]);_0x11d245[_0xad3e('0x11')]=qs[_0xad3e('0x11')](_0x478a80['query']['offset']);}_0x11d245['order']=qs[_0xad3e('0x42')](_0x478a80[_0xad3e('0x2b')]['sort']);_0x11d245[_0xad3e('0x21')]=qs['filters'](_[_0xad3e('0x43')](_0x478a80[_0xad3e('0x2b')],_0xf456bf[_0xad3e('0x2c')]));_0x11d245['where'][_0xad3e('0x44')]=_0x346622['id'];if(_0x478a80[_0xad3e('0x2b')][_0xad3e('0x45')]){_0x11d245[_0xad3e('0x21')]=_[_0xad3e('0x46')](_0x11d245['where'],{'$or':_[_0xad3e('0x1f')](_0x11d245[_0xad3e('0x2d')],function(_0x2c0532){var _0x2b5d84={};_0x2b5d84[_0x2c0532]={'$like':'%'+_0x478a80['query'][_0xad3e('0x45')]+'%'};return _0x2b5d84;})});}_0x11d245=_[_0xad3e('0x46')]({},_0x11d245,_0x478a80['options']);return db[_0xad3e('0x3d')][_0xad3e('0x24')](_0x11d245);}})['then'](function(_0x276609){if(_0x276609){return db[_0xad3e('0x47')]['findAndCountAll']({'where':{'id':_['map'](_0x276609,_0xad3e('0x48')),'role':'agent'},'attributes':['id',_0xad3e('0x1c'),_0xad3e('0x49'),_0xad3e('0x4a'),'createdAt']});}})['then'](function(_0x2704bb){if(_0x2704bb){return{'count':_0x2704bb[_0xad3e('0x14')],'rows':_[_0xad3e('0x1f')](_0x2704bb[_0xad3e('0x25')],function(_0x3cf1fb){return{'membername':_0x3cf1fb[_0xad3e('0x1c')],'UserId':_0x3cf1fb['id'],'queue_name':_0x5668c7[_0xad3e('0x1c')],'ChatQueueId':_0x5668c7['id'],'interface':util[_0xad3e('0x4b')](_0xad3e('0x4c'),'SIP',_0x3cf1fb[_0xad3e('0x1c')]),'penalty':0x0,'paused':_0x3cf1fb['chatPause'],'createdAt':_0x3cf1fb[_0xad3e('0x4d')],'updatedAt':_0x3cf1fb['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xad3e('0x17')](respondWithFilteredResult(_0x47676e,_0x11d245))['catch'](handleError(_0x47676e,null));};exports[_0xad3e('0x4e')]=function(_0x2e53a8,_0x2584ff){var _0x4fd8c6={};var _0x4431ec={};var _0x4b9c64;var _0x2f31a8;return db[_0xad3e('0x23')][_0xad3e('0x3c')]({'where':{'id':_0x2e53a8['params']['id']}})[_0xad3e('0x17')](handleEntityNotFound(_0x2584ff,null))['then'](function(_0xae5de){if(_0xae5de){_0x4b9c64=_0xae5de;_0x4431ec[_0xad3e('0x29')]=_['keys'](db[_0xad3e('0x4f')]['rawAttributes']);_0x4431ec[_0xad3e('0x2b')]=_[_0xad3e('0x2a')](_0x2e53a8['query']);_0x4431ec[_0xad3e('0x2c')]=_[_0xad3e('0x2e')](_0x4431ec[_0xad3e('0x29')],_0x4431ec[_0xad3e('0x2b')]);_0x4fd8c6[_0xad3e('0x2d')]=_[_0xad3e('0x2e')](_0x4431ec[_0xad3e('0x29')],qs[_0xad3e('0x2f')](_0x2e53a8[_0xad3e('0x2b')][_0xad3e('0x2f')]));_0x4fd8c6[_0xad3e('0x2d')]=_0x4fd8c6['attributes'][_0xad3e('0x3f')]?_0x4fd8c6[_0xad3e('0x2d')]:_0x4431ec[_0xad3e('0x29')];_0x4fd8c6[_0xad3e('0x50')]=qs[_0xad3e('0x42')](_0x2e53a8['query'][_0xad3e('0x42')]);_0x4fd8c6[_0xad3e('0x21')]=qs['filters'](_[_0xad3e('0x43')](_0x2e53a8[_0xad3e('0x2b')],_0x4431ec[_0xad3e('0x2c')]));if(_0x2e53a8['query'][_0xad3e('0x45')]){_0x4fd8c6[_0xad3e('0x21')]=_[_0xad3e('0x46')](_0x4fd8c6['where'],{'$or':_[_0xad3e('0x1f')](_0x4fd8c6['attributes'],function(_0x30f127){var _0x7e9661={};_0x7e9661[_0x30f127]={'$like':'%'+_0x2e53a8[_0xad3e('0x2b')][_0xad3e('0x45')]+'%'};return _0x7e9661;})});}_0x4fd8c6=_[_0xad3e('0x46')]({},_0x4fd8c6,_0x2e53a8[_0xad3e('0x31')]);return _0x4b9c64[_0xad3e('0x4e')](_0x4fd8c6);}})[_0xad3e('0x17')](function(_0x6ca786){if(_0x6ca786){_0x2f31a8=_0x6ca786[_0xad3e('0x3f')];if(!_0x2e53a8[_0xad3e('0x2b')][_0xad3e('0x40')]('nolimit')){_0x4fd8c6[_0xad3e('0x13')]=qs['limit'](_0x2e53a8[_0xad3e('0x2b')][_0xad3e('0x13')]);_0x4fd8c6['offset']=qs['offset'](_0x2e53a8['query'][_0xad3e('0x11')]);}return _0x4b9c64[_0xad3e('0x4e')](_0x4fd8c6);}})[_0xad3e('0x17')](function(_0x34d033){if(_0x34d033){return _0x34d033?{'count':_0x2f31a8,'rows':_0x34d033}:null;}})['then'](respondWithResult(_0x2584ff,null))[_0xad3e('0x26')](handleError(_0x2584ff,null));};exports['addTeams']=function(_0xde52d6,_0x24ca93){var _0x100595=_0xde52d6[_0xad3e('0x34')][_0xad3e('0x51')];return db['Team'][_0xad3e('0x24')]({'where':{'id':_0x100595},'attributes':['id'],'include':[{'model':db[_0xad3e('0x47')],'as':'Agents','attributes':['id',_0xad3e('0x1c'),_0xad3e('0x52'),_0xad3e('0x53'),_0xad3e('0x54')],'raw':!![]}]})[_0xad3e('0x17')](function(_0x283f21){if(_0x283f21){var _0x581106=_[_0xad3e('0x55')](_0x283f21,function(_0x5734ec){var _0x40e69a=_0x5734ec[_0xad3e('0x19')]({'plain':!![]});return _0x40e69a[_0xad3e('0x56')];});return db[_0xad3e('0x23')][_0xad3e('0x32')]({'where':{'id':_0xde52d6[_0xad3e('0x28')]['id']}})[_0xad3e('0x17')](function(_0x5be351){return db['sequelize'][_0xad3e('0x57')](function(_0x2db83f){return _0x5be351[_0xad3e('0x58')](_0x100595,{'transaction':_0x2db83f})[_0xad3e('0x17')](function(){return BPromise[_0xad3e('0x59')](_0x581106,function(_0x8d48a9){return db[_0xad3e('0x3d')][_0xad3e('0x5a')]({'where':{'UserId':_0x8d48a9['id'],'ChatQueueId':_0xde52d6[_0xad3e('0x28')]['id']},'transaction':_0x2db83f});});})[_0xad3e('0x17')](function(){_0x581106[_0xad3e('0x5b')](function(_0x20b767){socket['emit'](_0xad3e('0x5c'),{'UserId':_0x20b767['id'],'ChatQueueId':_0x5be351['id']});});});});});}})[_0xad3e('0x17')](respondWithStatusCode(_0x24ca93,null))[_0xad3e('0x26')](handleError(_0x24ca93,null));};exports[_0xad3e('0x5d')]=function(_0x450aed,_0x12c4cd){return db[_0xad3e('0x4f')][_0xad3e('0x24')]({'where':{'id':_0x450aed[_0xad3e('0x2b')][_0xad3e('0x51')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x12c4cd,null))[_0xad3e('0x17')](function(_0x6c68b7){var _0x407f75=_[_0xad3e('0x1f')](_0x6c68b7,'id');var _0x1e6a32=[];var _0x4d6e5f=[];var _0x277aa8=squel['select']();_0x277aa8[_0xad3e('0x5e')](_0xad3e('0x5f'))[_0xad3e('0x60')]('team_has_chat_queues','tq')[_0xad3e('0x61')](_0xad3e('0x62'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xad3e('0x21')]('ChatQueueId\x20=\x20?',_0x450aed[_0xad3e('0x28')]['id']);for(var _0x27de95=0x0;_0x27de95<_0x6c68b7[_0xad3e('0x3f')];_0x27de95+=0x1){let _0x174da6=_0x6c68b7[_0x27de95];for(var _0x5cb843=0x0;_0x5cb843<_0x174da6['Agents']['length'];_0x5cb843+=0x1){let _0x27a9c4=_0x174da6[_0xad3e('0x56')][_0x5cb843];var _0x19b8e4=_0x277aa8[_0xad3e('0x63')]();_0x19b8e4[_0xad3e('0x21')]('ut.UserId\x20=\x20?',_0x27a9c4['id']);_0x4d6e5f[_0xad3e('0x64')](db[_0xad3e('0x65')][_0xad3e('0x2b')](_0x19b8e4[_0xad3e('0x66')](),{'type':db[_0xad3e('0x65')][_0xad3e('0x67')]['SELECT']})[_0xad3e('0x17')](function(_0x185ff1){if(_0x185ff1[_0xad3e('0x3f')]===0x1){return _0x27a9c4['id'];}else{var _0x46570e=_[_0xad3e('0x68')](_[_0xad3e('0x1f')](_0x185ff1,_0xad3e('0x69')),function(_0x1ca05b){return _[_0xad3e('0x6a')](_0x407f75,_0x1ca05b);});if(_0x46570e){return _0x27a9c4['id'];}}}));}}return BPromise[_0xad3e('0x6b')](_0x4d6e5f)[_0xad3e('0x17')](function(_0x5bae7a){_0x1e6a32=_(_0x1e6a32)['union'](_0x5bae7a)[_0xad3e('0x6c')]()[_0xad3e('0x6d')]();return db['ChatQueue'][_0xad3e('0x32')]({'where':{'id':_0x450aed[_0xad3e('0x28')]['id']}})['then'](function(_0x18b5b0){return db[_0xad3e('0x65')][_0xad3e('0x57')](function(_0x503d7f){return _0x18b5b0[_0xad3e('0x5d')](_0x450aed[_0xad3e('0x2b')][_0xad3e('0x51')],{'transaction':_0x503d7f})[_0xad3e('0x17')](function(){if(!_[_0xad3e('0x6e')](_0x1e6a32)){return _0x18b5b0[_0xad3e('0x6f')](_0x1e6a32,{'transaction':_0x503d7f});}})[_0xad3e('0x17')](function(){_0x1e6a32[_0xad3e('0x5b')](function(_0x40b080){socket[_0xad3e('0x70')](_0xad3e('0x71'),{'UserId':_0x40b080,'ChatQueueId':_0x18b5b0['id']});});});});});});})[_0xad3e('0x17')](respondWithStatusCode(_0x12c4cd,null))[_0xad3e('0x26')](handleError(_0x12c4cd,null));};exports['addAgents']=function(_0x591f63,_0x44e6ce){return db[_0xad3e('0x23')][_0xad3e('0x32')]({'where':{'id':_0x591f63['params']['id']}})[_0xad3e('0x17')](handleEntityNotFound(_0x44e6ce,null))[_0xad3e('0x17')](function(_0x323584){if(_0x323584){return _0x323584[_0xad3e('0x72')](_0x591f63['body'][_0xad3e('0x51')],_['omit'](_0x591f63[_0xad3e('0x34')],['ids','id'])||{})[_0xad3e('0x73')](function(_0x3106cf){for(var _0xcd6372=0x0;_0xcd6372<_0x591f63[_0xad3e('0x34')]['ids'][_0xad3e('0x3f')];_0xcd6372+=0x1){socket[_0xad3e('0x70')](_0xad3e('0x5c'),{'UserId':Number(_0x591f63[_0xad3e('0x34')][_0xad3e('0x51')][_0xcd6372]),'ChatQueueId':Number(_0x591f63[_0xad3e('0x28')]['id'])});}return _0x3106cf;});}})['then'](respondWithResult(_0x44e6ce,null))['catch'](handleError(_0x44e6ce,null));};exports[_0xad3e('0x6f')]=function(_0x381672,_0x5e904a){return db[_0xad3e('0x23')]['find']({'where':{'id':_0x381672[_0xad3e('0x28')]['id']}})[_0xad3e('0x17')](handleEntityNotFound(_0x5e904a,null))[_0xad3e('0x17')](function(_0x37281a){if(_0x37281a){return _0x37281a[_0xad3e('0x6f')](_0x381672['query'][_0xad3e('0x51')])[_0xad3e('0x17')](function(){if(_[_0xad3e('0x74')](_0x381672[_0xad3e('0x2b')][_0xad3e('0x51')])){for(var _0x235131=0x0;_0x235131<_0x381672[_0xad3e('0x2b')][_0xad3e('0x51')][_0xad3e('0x3f')];_0x235131+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x381672[_0xad3e('0x2b')][_0xad3e('0x51')][_0x235131]),'ChatQueueId':Number(_0x381672[_0xad3e('0x28')]['id'])});}}else{socket[_0xad3e('0x70')](_0xad3e('0x71'),{'UserId':Number(_0x381672[_0xad3e('0x2b')][_0xad3e('0x51')]),'ChatQueueId':Number(_0x381672[_0xad3e('0x28')]['id'])});}});}})[_0xad3e('0x17')](respondWithStatusCode(_0x5e904a,null))[_0xad3e('0x26')](handleError(_0x5e904a,null));};exports[_0xad3e('0x75')]=function(_0xd0bc74,_0x5ec18f){var _0x541ce6={};var _0x4ff3cb={};var _0x1cabdd;var _0x1c6199;return db[_0xad3e('0x23')][_0xad3e('0x3c')]({'where':{'id':_0xd0bc74['params']['id']}})[_0xad3e('0x17')](handleEntityNotFound(_0x5ec18f,null))[_0xad3e('0x17')](function(_0x4cf5ed){if(_0x4cf5ed){_0x1cabdd=_0x4cf5ed;_0x4ff3cb[_0xad3e('0x29')]=_[_0xad3e('0x2a')](db[_0xad3e('0x47')][_0xad3e('0x3e')]);_0x4ff3cb[_0xad3e('0x2b')]=_[_0xad3e('0x2a')](_0xd0bc74[_0xad3e('0x2b')]);_0x4ff3cb['filters']=_['intersection'](_0x4ff3cb[_0xad3e('0x29')],_0x4ff3cb[_0xad3e('0x2b')]);_0x541ce6[_0xad3e('0x2d')]=_[_0xad3e('0x2e')](_0x4ff3cb[_0xad3e('0x29')],qs[_0xad3e('0x2f')](_0xd0bc74[_0xad3e('0x2b')][_0xad3e('0x2f')]));_0x541ce6[_0xad3e('0x2d')]=_0x541ce6[_0xad3e('0x2d')][_0xad3e('0x3f')]?_0x541ce6[_0xad3e('0x2d')]:_0x4ff3cb[_0xad3e('0x29')];_0x541ce6[_0xad3e('0x50')]=qs[_0xad3e('0x42')](_0xd0bc74[_0xad3e('0x2b')][_0xad3e('0x42')]);_0x541ce6[_0xad3e('0x21')]=qs[_0xad3e('0x2c')](_['pick'](_0xd0bc74[_0xad3e('0x2b')],_0x4ff3cb['filters']));if(_0xd0bc74[_0xad3e('0x2b')][_0xad3e('0x45')]){_0x541ce6[_0xad3e('0x21')]=_['merge'](_0x541ce6['where'],{'$or':_['map'](_0x541ce6['attributes'],function(_0x437481){var _0x2668d2={};_0x2668d2[_0x437481]={'$like':'%'+_0xd0bc74['query'][_0xad3e('0x45')]+'%'};return _0x2668d2;})});}_0x541ce6=_[_0xad3e('0x46')]({},_0x541ce6,_0xd0bc74[_0xad3e('0x31')]);return _0x1cabdd[_0xad3e('0x75')](_0x541ce6);}})[_0xad3e('0x17')](function(_0x21280c){if(_0x21280c){_0x1c6199=_0x21280c['length'];if(!_0xd0bc74[_0xad3e('0x2b')][_0xad3e('0x40')](_0xad3e('0x41'))){_0x541ce6[_0xad3e('0x13')]=qs[_0xad3e('0x13')](_0xd0bc74['query'][_0xad3e('0x13')]);_0x541ce6[_0xad3e('0x11')]=qs[_0xad3e('0x11')](_0xd0bc74[_0xad3e('0x2b')][_0xad3e('0x11')]);}return _0x1cabdd['getAgents'](_0x541ce6);}})['then'](function(_0x16f921){if(_0x16f921){return _0x16f921?{'count':_0x1c6199,'rows':_0x16f921}:null;}})['then'](respondWithResult(_0x5ec18f,null))[_0xad3e('0x26')](handleError(_0x5ec18f,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index d6454c0..027ec62 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 _0x3f32=['exports','events','../../mysqldb','ChatQueue','save','update','emit','hasOwnProperty','hook'];(function(_0x245e64,_0xa8a1a1){var _0x282143=function(_0x126275){while(--_0x126275){_0x245e64['push'](_0x245e64['shift']());}};_0x282143(++_0xa8a1a1);}(_0x3f32,0x160));var _0x23f3=function(_0xa9dc6f,_0x27d8f0){_0xa9dc6f=_0xa9dc6f-0x0;var _0x201588=_0x3f32[_0xa9dc6f];return _0x201588;};'use strict';var EventEmitter=require(_0x23f3('0x0'));var ChatQueue=require(_0x23f3('0x1'))['db'][_0x23f3('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x23f3('0x3'),'afterUpdate':_0x23f3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x22eaa1){return function(_0x2d9d16,_0x13e453,_0x435c8a){ChatQueueEvents[_0x23f3('0x5')](_0x22eaa1+':'+_0x2d9d16['id'],_0x2d9d16);ChatQueueEvents[_0x23f3('0x5')](_0x22eaa1,_0x2d9d16);_0x435c8a(null);};}for(var e in events){if(events[_0x23f3('0x6')](e)){var event=events[e];ChatQueue[_0x23f3('0x7')](e,emitEvent(event));}}module[_0x23f3('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x0f3c=['exports','events','../../mysqldb','update','remove','emit','hook'];(function(_0x34ca44,_0xc10a82){var _0xcb3f34=function(_0x45f09f){while(--_0x45f09f){_0x34ca44['push'](_0x34ca44['shift']());}};_0xcb3f34(++_0xc10a82);}(_0x0f3c,0x189));var _0xc0f3=function(_0x177405,_0x101922){_0x177405=_0x177405-0x0;var _0x7b025f=_0x0f3c[_0x177405];return _0x7b025f;};'use strict';var EventEmitter=require(_0xc0f3('0x0'));var ChatQueue=require(_0xc0f3('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc0f3('0x2'),'afterDestroy':_0xc0f3('0x3')};function emitEvent(_0xa6a874){return function(_0x2d1f5d,_0x1be43d,_0x279717){ChatQueueEvents[_0xc0f3('0x4')](_0xa6a874+':'+_0x2d1f5d['id'],_0x2d1f5d);ChatQueueEvents[_0xc0f3('0x4')](_0xa6a874,_0x2d1f5d);_0x279717(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xc0f3('0x5')](e,emitEvent(event));}}module[_0xc0f3('0x6')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index b8a8b7a..97fad0a 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 _0x3544=['api','bluebird','path','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util'];(function(_0x2b0c18,_0x5b0e08){var _0xc328b9=function(_0x2667d3){while(--_0x2667d3){_0x2b0c18['push'](_0x2b0c18['shift']());}};_0xc328b9(++_0x5b0e08);}(_0x3544,0x8b));var _0x4354=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x3544[_0x47a349];return _0x18ab75;};'use strict';var _=require('lodash');var util=require(_0x4354('0x0'));var logger=require('../../config/logger')(_0x4354('0x1'));var moment=require('moment');var BPromise=require(_0x4354('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4354('0x3'));var rimraf=require('rimraf');var config=require(_0x4354('0x4'));var attributes=require(_0x4354('0x5'));module[_0x4354('0x6')]=function(_0x5721bf,_0xd71222){return _0x5721bf[_0x4354('0x7')](_0x4354('0x8'),attributes,{'tableName':_0x4354('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2b74=['define','chat_queues','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2b74,0x115));var _0x42b7=function(_0x45eb29,_0x309e77){_0x45eb29=_0x45eb29-0x0;var _0x2339af=_0x2b74[_0x45eb29];return _0x2339af;};'use strict';var _=require('lodash');var util=require(_0x42b7('0x0'));var logger=require(_0x42b7('0x1'))('api');var moment=require('moment');var BPromise=require(_0x42b7('0x2'));var rp=require(_0x42b7('0x3'));var fs=require('fs');var path=require(_0x42b7('0x4'));var rimraf=require(_0x42b7('0x5'));var config=require(_0x42b7('0x6'));var attributes=require(_0x42b7('0x7'));module[_0x42b7('0x8')]=function(_0x38544e,_0x1cc24f){return _0x38544e[_0x42b7('0x9')]('ChatQueue',attributes,{'tableName':_0x42b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 8f36f89..aac6887 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 _0xf5c4=['raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','model','debug','catch','ShowChatQueue','find'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf5c4,0x1ae));var _0x4f5c=function(_0x4e1b31,_0x326739){_0x4e1b31=_0x4e1b31-0x0;var _0x3a6df9=_0xf5c4[_0x4e1b31];return _0x3a6df9;};'use strict';var _=require(_0x4f5c('0x0'));var util=require(_0x4f5c('0x1'));var moment=require(_0x4f5c('0x2'));var BPromise=require(_0x4f5c('0x3'));var rs=require(_0x4f5c('0x4'));var fs=require('fs');var Redis=require(_0x4f5c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f5c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4f5c('0x7'));var jayson=require(_0x4f5c('0x8'));var client=jayson[_0x4f5c('0x9')]['http']({'port':0x232a});config[_0x4f5c('0xa')]=_[_0x4f5c('0xb')](config['redis'],{'host':_0x4f5c('0xc'),'port':0x18eb});var socket=require(_0x4f5c('0xd'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x4f5c('0xe')](socket);function respondWithRpcPromise(_0x4164a7,_0x3ff2f6,_0x1cb5b5){return new BPromise(function(_0x497ca3,_0x3dde08){return client['request'](_0x4164a7,_0x1cb5b5)[_0x4f5c('0xf')](function(_0x221386){logger[_0x4f5c('0x10')](_0x4f5c('0x11'),_0x3ff2f6,_0x4f5c('0x12'));logger['debug'](_0x4f5c('0x13'),_0x3ff2f6,'request\x20sent',JSON[_0x4f5c('0x14')](_0x221386));if(_0x221386[_0x4f5c('0x15')]){if(_0x221386['error']['code']===0x1f4){logger[_0x4f5c('0x15')](_0x4f5c('0x11'),_0x3ff2f6,_0x221386[_0x4f5c('0x15')]['message']);return _0x3dde08(_0x221386[_0x4f5c('0x15')][_0x4f5c('0x16')]);}logger['error'](_0x4f5c('0x11'),_0x3ff2f6,_0x221386[_0x4f5c('0x15')][_0x4f5c('0x16')]);return _0x497ca3(_0x221386[_0x4f5c('0x15')][_0x4f5c('0x16')]);}else{logger['info'](_0x4f5c('0x11'),_0x3ff2f6,_0x4f5c('0x12'));_0x497ca3(_0x221386[_0x4f5c('0x17')][_0x4f5c('0x16')]);}})['catch'](function(_0x43b178){logger[_0x4f5c('0x15')]('ChatQueue,\x20%s,\x20%s',_0x3ff2f6,_0x43b178);_0x3dde08(_0x43b178);});});}exports[_0x4f5c('0x18')]=function(_0x3e3c50){var _0x50d99f=this;return new Promise(function(_0x21f318,_0x300410){return db[_0x4f5c('0x19')][_0x4f5c('0x1a')]({'raw':_0x3e3c50[_0x4f5c('0x1b')]?_0x3e3c50[_0x4f5c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3e3c50['options']?_0x3e3c50[_0x4f5c('0x1b')][_0x4f5c('0x1c')]||null:null,'attributes':_0x3e3c50[_0x4f5c('0x1b')]?_0x3e3c50[_0x4f5c('0x1b')][_0x4f5c('0x1d')]||null:null,'limit':_0x3e3c50[_0x4f5c('0x1b')]?_0x3e3c50[_0x4f5c('0x1b')][_0x4f5c('0x1e')]||null:null,'include':_0x3e3c50[_0x4f5c('0x1b')]?_0x3e3c50['options'][_0x4f5c('0x1f')]?_[_0x4f5c('0x20')](_0x3e3c50['options'][_0x4f5c('0x1f')],function(_0x93f18){return{'model':db[_0x93f18[_0x4f5c('0x21')]],'as':_0x93f18['as'],'attributes':_0x93f18[_0x4f5c('0x1d')],'include':_0x93f18[_0x4f5c('0x1f')]?_[_0x4f5c('0x20')](_0x93f18[_0x4f5c('0x1f')],function(_0xf4910b){return{'model':db[_0xf4910b[_0x4f5c('0x21')]],'as':_0xf4910b['as'],'attributes':_0xf4910b[_0x4f5c('0x1d')],'include':_0xf4910b[_0x4f5c('0x1f')]?_['map'](_0xf4910b[_0x4f5c('0x1f')],function(_0x208695){return{'model':db[_0x208695[_0x4f5c('0x21')]],'as':_0x208695['as'],'attributes':_0x208695[_0x4f5c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4f5c('0xf')](function(_0x1fe00f){logger['info'](_0x4f5c('0x18'),_0x3e3c50);logger[_0x4f5c('0x22')](_0x4f5c('0x18'),_0x3e3c50,JSON['stringify'](_0x1fe00f));_0x21f318(_0x1fe00f);})[_0x4f5c('0x23')](function(_0x5ea0b6){logger['error'](_0x4f5c('0x18'),_0x5ea0b6[_0x4f5c('0x16')],_0x3e3c50);_0x300410(_0x50d99f[_0x4f5c('0x15')](0x1f4,_0x5ea0b6['message']));});});};exports[_0x4f5c('0x24')]=function(_0x553b3d){var _0x773f8c=this;return new Promise(function(_0x1600b1,_0x2d1db0){return db[_0x4f5c('0x19')][_0x4f5c('0x25')]({'raw':_0x553b3d[_0x4f5c('0x1b')]?_0x553b3d[_0x4f5c('0x1b')][_0x4f5c('0x26')]===undefined?!![]:![]:!![],'where':_0x553b3d['options']?_0x553b3d[_0x4f5c('0x1b')][_0x4f5c('0x1c')]||null:null,'attributes':_0x553b3d[_0x4f5c('0x1b')]?_0x553b3d[_0x4f5c('0x1b')]['attributes']||null:null,'include':_0x553b3d[_0x4f5c('0x1b')]?_0x553b3d[_0x4f5c('0x1b')][_0x4f5c('0x1f')]?_[_0x4f5c('0x20')](_0x553b3d[_0x4f5c('0x1b')][_0x4f5c('0x1f')],function(_0x3e12c1){return{'model':db[_0x3e12c1[_0x4f5c('0x21')]],'as':_0x3e12c1['as'],'attributes':_0x3e12c1[_0x4f5c('0x1d')],'include':_0x3e12c1['include']?_[_0x4f5c('0x20')](_0x3e12c1[_0x4f5c('0x1f')],function(_0x10aa2f){return{'model':db[_0x10aa2f[_0x4f5c('0x21')]],'as':_0x10aa2f['as'],'attributes':_0x10aa2f['attributes'],'include':_0x10aa2f[_0x4f5c('0x1f')]?_[_0x4f5c('0x20')](_0x10aa2f[_0x4f5c('0x1f')],function(_0x20acde){return{'model':db[_0x20acde['model']],'as':_0x20acde['as'],'attributes':_0x20acde['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f5c('0xf')](function(_0x252842){logger[_0x4f5c('0x10')](_0x4f5c('0x24'),_0x553b3d);logger[_0x4f5c('0x22')]('ShowChatQueue',_0x553b3d,JSON['stringify'](_0x252842));_0x1600b1(_0x252842);})[_0x4f5c('0x23')](function(_0x64746d){logger['error'](_0x4f5c('0x24'),_0x64746d[_0x4f5c('0x16')],_0x553b3d);_0x2d1db0(_0x773f8c[_0x4f5c('0x15')](0x1f4,_0x64746d[_0x4f5c('0x16')]));});});};
\ No newline at end of file
+var _0x53aa=['where','attributes','limit','include','map','model','ShowChatQueue','find','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options'];(function(_0x1a8469,_0x2ffccf){var _0x19c2dd=function(_0x5e18c1){while(--_0x5e18c1){_0x1a8469['push'](_0x1a8469['shift']());}};_0x19c2dd(++_0x2ffccf);}(_0x53aa,0x167));var _0xa53a=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x53aa[_0x3070dc];return _0x431489;};'use strict';var _=require(_0xa53a('0x0'));var util=require(_0xa53a('0x1'));var moment=require(_0xa53a('0x2'));var BPromise=require(_0xa53a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa53a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa53a('0x5'))(_0xa53a('0x6'));var config=require(_0xa53a('0x7'));var jayson=require(_0xa53a('0x8'));var client=jayson[_0xa53a('0x9')]['http']({'port':0x232a});config[_0xa53a('0xa')]=_[_0xa53a('0xb')](config['redis'],{'host':_0xa53a('0xc'),'port':0x18eb});var socket=require(_0xa53a('0xd'))(new Redis(config[_0xa53a('0xa')]));require('./chatQueue.socket')[_0xa53a('0xe')](socket);function respondWithRpcPromise(_0x5785a9,_0x422fb3,_0x1a79a1){return new BPromise(function(_0x40bd10,_0x5d1e46){return client[_0xa53a('0xf')](_0x5785a9,_0x1a79a1)[_0xa53a('0x10')](function(_0x18eba9){logger[_0xa53a('0x11')](_0xa53a('0x12'),_0x422fb3,'request\x20sent');logger[_0xa53a('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x422fb3,_0xa53a('0x14'),JSON[_0xa53a('0x15')](_0x18eba9));if(_0x18eba9[_0xa53a('0x16')]){if(_0x18eba9[_0xa53a('0x16')][_0xa53a('0x17')]===0x1f4){logger[_0xa53a('0x16')](_0xa53a('0x12'),_0x422fb3,_0x18eba9[_0xa53a('0x16')][_0xa53a('0x18')]);return _0x5d1e46(_0x18eba9[_0xa53a('0x16')][_0xa53a('0x18')]);}logger[_0xa53a('0x16')]('ChatQueue,\x20%s,\x20%s',_0x422fb3,_0x18eba9[_0xa53a('0x16')][_0xa53a('0x18')]);return _0x40bd10(_0x18eba9['error'][_0xa53a('0x18')]);}else{logger[_0xa53a('0x11')](_0xa53a('0x12'),_0x422fb3,_0xa53a('0x14'));_0x40bd10(_0x18eba9[_0xa53a('0x19')][_0xa53a('0x18')]);}})[_0xa53a('0x1a')](function(_0x344350){logger[_0xa53a('0x16')](_0xa53a('0x12'),_0x422fb3,_0x344350);_0x5d1e46(_0x344350);});});}exports[_0xa53a('0x1b')]=function(_0x1a50bd){var _0x2311ba=this;return new Promise(function(_0xaecd04,_0x584c4e){return db[_0xa53a('0x1c')][_0xa53a('0x1d')]({'raw':_0x1a50bd['options']?_0x1a50bd[_0xa53a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1a50bd[_0xa53a('0x1e')]?_0x1a50bd[_0xa53a('0x1e')][_0xa53a('0x1f')]||null:null,'attributes':_0x1a50bd[_0xa53a('0x1e')]?_0x1a50bd[_0xa53a('0x1e')][_0xa53a('0x20')]||null:null,'limit':_0x1a50bd['options']?_0x1a50bd[_0xa53a('0x1e')][_0xa53a('0x21')]||null:null,'include':_0x1a50bd['options']?_0x1a50bd[_0xa53a('0x1e')][_0xa53a('0x22')]?_[_0xa53a('0x23')](_0x1a50bd[_0xa53a('0x1e')][_0xa53a('0x22')],function(_0x401aae){return{'model':db[_0x401aae[_0xa53a('0x24')]],'as':_0x401aae['as'],'attributes':_0x401aae['attributes'],'include':_0x401aae['include']?_[_0xa53a('0x23')](_0x401aae[_0xa53a('0x22')],function(_0x512d96){return{'model':db[_0x512d96[_0xa53a('0x24')]],'as':_0x512d96['as'],'attributes':_0x512d96[_0xa53a('0x20')],'include':_0x512d96[_0xa53a('0x22')]?_[_0xa53a('0x23')](_0x512d96[_0xa53a('0x22')],function(_0x1e796b){return{'model':db[_0x1e796b['model']],'as':_0x1e796b['as'],'attributes':_0x1e796b[_0xa53a('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa53a('0x10')](function(_0xde3502){logger['info']('GetChatQueue',_0x1a50bd);logger[_0xa53a('0x13')](_0xa53a('0x1b'),_0x1a50bd,JSON[_0xa53a('0x15')](_0xde3502));_0xaecd04(_0xde3502);})['catch'](function(_0x2d78eb){logger[_0xa53a('0x16')](_0xa53a('0x1b'),_0x2d78eb[_0xa53a('0x18')],_0x1a50bd);_0x584c4e(_0x2311ba['error'](0x1f4,_0x2d78eb['message']));});});};exports[_0xa53a('0x25')]=function(_0x25d4f3){var _0x22d998=this;return new Promise(function(_0x315dc6,_0x3461ae){return db[_0xa53a('0x1c')][_0xa53a('0x26')]({'raw':_0x25d4f3[_0xa53a('0x1e')]?_0x25d4f3[_0xa53a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x25d4f3[_0xa53a('0x1e')]?_0x25d4f3['options'][_0xa53a('0x1f')]||null:null,'attributes':_0x25d4f3[_0xa53a('0x1e')]?_0x25d4f3[_0xa53a('0x1e')][_0xa53a('0x20')]||null:null,'include':_0x25d4f3[_0xa53a('0x1e')]?_0x25d4f3[_0xa53a('0x1e')][_0xa53a('0x22')]?_[_0xa53a('0x23')](_0x25d4f3[_0xa53a('0x1e')]['include'],function(_0x351860){return{'model':db[_0x351860['model']],'as':_0x351860['as'],'attributes':_0x351860['attributes'],'include':_0x351860[_0xa53a('0x22')]?_[_0xa53a('0x23')](_0x351860[_0xa53a('0x22')],function(_0x4993df){return{'model':db[_0x4993df[_0xa53a('0x24')]],'as':_0x4993df['as'],'attributes':_0x4993df['attributes'],'include':_0x4993df[_0xa53a('0x22')]?_[_0xa53a('0x23')](_0x4993df['include'],function(_0x295898){return{'model':db[_0x295898[_0xa53a('0x24')]],'as':_0x295898['as'],'attributes':_0x295898[_0xa53a('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x109276){logger[_0xa53a('0x11')]('ShowChatQueue',_0x25d4f3);logger[_0xa53a('0x13')](_0xa53a('0x25'),_0x25d4f3,JSON[_0xa53a('0x15')](_0x109276));_0x315dc6(_0x109276);})[_0xa53a('0x1a')](function(_0x13dc01){logger['error'](_0xa53a('0x25'),_0x13dc01[_0xa53a('0x18')],_0x25d4f3);_0x3461ae(_0x22d998['error'](0x1f4,_0x13dc01[_0xa53a('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 14cc683..4303af0 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 _0xda55=['chatQueue:','./chatQueue.events','save','emit','removeListener','length'];(function(_0x409416,_0x26d390){var _0x5aa3a0=function(_0x3c285c){while(--_0x3c285c){_0x409416['push'](_0x409416['shift']());}};_0x5aa3a0(++_0x26d390);}(_0xda55,0x6d));var _0x5da5=function(_0x5c0b22,_0x56d46a){_0x5c0b22=_0x5c0b22-0x0;var _0x16a8a6=_0xda55[_0x5c0b22];return _0x16a8a6;};'use strict';var ChatQueueEvents=require(_0x5da5('0x0'));var events=[_0x5da5('0x1'),'remove','update'];function createListener(_0x13ecbc,_0x240a49){return function(_0x26a443){_0x240a49[_0x5da5('0x2')](_0x13ecbc,_0x26a443);};}function removeListener(_0x1c3afd,_0x5da254){return function(){ChatQueueEvents[_0x5da5('0x3')](_0x1c3afd,_0x5da254);};}exports['register']=function(_0x356a37){for(var _0x58e7b3=0x0,_0x2fd877=events[_0x5da5('0x4')];_0x58e7b3<_0x2fd877;_0x58e7b3++){var _0x71b187=events[_0x58e7b3];var _0x46290d=createListener(_0x5da5('0x5')+_0x71b187,_0x356a37);ChatQueueEvents['on'](_0x71b187,_0x46290d);}};
\ No newline at end of file
+var _0x9bde=['chatQueue:','save','update','emit','removeListener','register','length'];(function(_0x4ef734,_0x5826d){var _0x33a7cb=function(_0x127a2b){while(--_0x127a2b){_0x4ef734['push'](_0x4ef734['shift']());}};_0x33a7cb(++_0x5826d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x53ff2e,_0x4aa0c7){_0x53ff2e=_0x53ff2e-0x0;var _0x1cfc81=_0x9bde[_0x53ff2e];return _0x1cfc81;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe9bd('0x0'),'remove',_0xe9bd('0x1')];function createListener(_0x4c63ca,_0x51786f){return function(_0x3005aa){_0x51786f[_0xe9bd('0x2')](_0x4c63ca,_0x3005aa);};}function removeListener(_0x1c1b34,_0x10822d){return function(){ChatQueueEvents[_0xe9bd('0x3')](_0x1c1b34,_0x10822d);};}exports[_0xe9bd('0x4')]=function(_0x4fd7b8){for(var _0x4763e9=0x0,_0x5f18fe=events[_0xe9bd('0x5')];_0x4763e9<_0x5f18fe;_0x4763e9++){var _0xa66ae2=events[_0x4763e9];var _0x2d5c75=createListener(_0xe9bd('0x6')+_0xa66ae2,_0x4fd7b8);ChatQueueEvents['on'](_0xa66ae2,_0x2d5c75);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 874c00e..92345e9 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(_0xf8c661,_0x419a83){var _0x32589b=function(_0x5f3b4f){while(--_0x5f3b4f){_0xf8c661['push'](_0xf8c661['shift']());}};_0x32589b(++_0x419a83);}(_0x008c,0x188));var _0xc008=function(_0x20e5e2,_0x57c3b1){_0x20e5e2=_0x20e5e2-0x0;var _0x803951=_0x008c[_0x20e5e2];return _0x803951;};'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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3e74,0x175));var _0x43e7=function(_0x3e9e57,_0x28a34c){_0x3e9e57=_0x3e9e57-0x0;var _0xf7c9fd=_0x3e74[_0x3e9e57];return _0xf7c9fd;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 0725f47..3ffde6c 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 _0x9123=['DATE','sequelize','exports','STRING'];(function(_0x4301f5,_0x25b02a){var _0x2fd3d2=function(_0x284afb){while(--_0x284afb){_0x4301f5['push'](_0x4301f5['shift']());}};_0x2fd3d2(++_0x25b02a);}(_0x9123,0x119));var _0x3912=function(_0x56a53a,_0x4f74f1){_0x56a53a=_0x56a53a-0x0;var _0x4ab5ee=_0x9123[_0x56a53a];return _0x4ab5ee;};'use strict';var moment=require('moment');var Sequelize=require(_0x3912('0x0'));module[_0x3912('0x1')]={'uniqueid':{'type':Sequelize[_0x3912('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3912('0x2')]},'joinAt':{'type':Sequelize[_0x3912('0x3')]},'leaveAt':{'type':Sequelize[_0x3912('0x3')]},'acceptAt':{'type':Sequelize[_0x3912('0x3')]},'exitAt':{'type':Sequelize[_0x3912('0x3')]},'reason':{'type':Sequelize[_0x3912('0x2')]}};
\ No newline at end of file
+var _0x02b2=['STRING','DATE','moment','sequelize','exports'];(function(_0x56e311,_0x110a84){var _0x1f6451=function(_0x3f2c8f){while(--_0x3f2c8f){_0x56e311['push'](_0x56e311['shift']());}};_0x1f6451(++_0x110a84);}(_0x02b2,0x1b5));var _0x202b=function(_0x282fc6,_0x255c25){_0x282fc6=_0x282fc6-0x0;var _0x132425=_0x02b2[_0x282fc6];return _0x132425;};'use strict';var moment=require(_0x202b('0x0'));var Sequelize=require(_0x202b('0x1'));module[_0x202b('0x2')]={'uniqueid':{'type':Sequelize[_0x202b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x202b('0x3')]},'joinAt':{'type':Sequelize[_0x202b('0x4')]},'leaveAt':{'type':Sequelize[_0x202b('0x4')]},'acceptAt':{'type':Sequelize[_0x202b('0x4')]},'exitAt':{'type':Sequelize[_0x202b('0x4')]},'reason':{'type':Sequelize[_0x202b('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 9b3347f..6a06aec 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 _0x4c60=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','ChatQueueReport','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x54f6a6,_0xde810f){var _0x37a293=function(_0x3dad2c){while(--_0x3dad2c){_0x54f6a6['push'](_0x54f6a6['shift']());}};_0x37a293(++_0xde810f);}(_0x4c60,0xc1));var _0x04c6=function(_0x4fb6e2,_0x16933b){_0x4fb6e2=_0x4fb6e2-0x0;var _0x52127c=_0x4c60[_0x4fb6e2];return _0x52127c;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['ChatQueueReport'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':!![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['ChatQueueReport'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['ChatQueueReport'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')](_0x2bd045['body'],{})[_0x04c6('0x1f')](respondWithResult(_0x4ef366,0xc9))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0xee2822,_0x4cfde2){if(_0xee2822[_0x04c6('0x44')]['id']){delete _0xee2822[_0x04c6('0x44')]['id'];}return db[_0x04c6('0x27')][_0x04c6('0x41')]({'where':{'id':_0xee2822['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x4cfde2,null))[_0x04c6('0x1f')](saveUpdates(_0xee2822[_0x04c6('0x44')],null))[_0x04c6('0x1f')](respondWithResult(_0x4cfde2,null))['catch'](handleError(_0x4cfde2,null));};exports[_0x04c6('0x20')]=function(_0x42273e,_0x15ec61){return db['ChatQueueReport'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));};exports[_0x04c6('0x46')]=function(_0x1b8fa4,_0x160f91){return db[_0x04c6('0x27')][_0x04c6('0x46')]()[_0x04c6('0x1f')](respondWithResult(_0x160f91,null))[_0x04c6('0x3e')](handleError(_0x160f91,null));};
\ No newline at end of file
+var _0x0e76=['util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','json','limit','count','offset','status','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','ChatQueueReport','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','find','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache'];(function(_0x16f775,_0x45b10f){var _0x17d9e2=function(_0x3d2ccf){while(--_0x3d2ccf){_0x16f775['push'](_0x16f775['shift']());}};_0x17d9e2(++_0x45b10f);}(_0x0e76,0xc4));var _0x60e7=function(_0x4d6624,_0x78b606){_0x4d6624=_0x4d6624-0x0;var _0x5dbb01=_0x0e76[_0x4d6624];return _0x5dbb01;};'use strict';var emlformat=require(_0x60e7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x60e7('0x1'));var rp=require('request-promise');var moment=require(_0x60e7('0x2'));var BPromise=require(_0x60e7('0x3'));var Mustache=require(_0x60e7('0x4'));var util=require(_0x60e7('0x5'));var path=require(_0x60e7('0x6'));var sox=require('sox');var csv=require(_0x60e7('0x7'));var ejs=require(_0x60e7('0x8'));var fs=require('fs');var fs_extra=require(_0x60e7('0x9'));var _=require(_0x60e7('0xa'));var squel=require(_0x60e7('0xb'));var crypto=require(_0x60e7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x60e7('0xd'));var toCsv=require(_0x60e7('0x7'));var querystring=require(_0x60e7('0xe'));var Papa=require('papaparse');var Redis=require(_0x60e7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x60e7('0x10'));var as=require(_0x60e7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x60e7('0x12'))('api');var utils=require(_0x60e7('0x13'));var config=require(_0x60e7('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d43cd,_0x274959){_0x274959=_0x274959||0xcc;return function(_0x243280){if(_0x243280){return _0x3d43cd[_0x60e7('0x15')](_0x274959);}return _0x3d43cd['status'](_0x274959)[_0x60e7('0x16')]();};}function respondWithResult(_0x4ff2fe,_0x1d4c68){_0x1d4c68=_0x1d4c68||0xc8;return function(_0x1d97a5){if(_0x1d97a5){return _0x4ff2fe['status'](_0x1d4c68)[_0x60e7('0x17')](_0x1d97a5);}};}function respondWithFilteredResult(_0x589b22,_0x25bcd9){return function(_0x388cd8){if(_0x388cd8){var _0xbe8f55=typeof _0x25bcd9['offset']==='undefined'&&typeof _0x25bcd9[_0x60e7('0x18')]==='undefined';var _0x22c978=_0x388cd8[_0x60e7('0x19')];var _0x2a136a=_0xbe8f55?0x0:_0x25bcd9[_0x60e7('0x1a')];var _0x54a701=_0xbe8f55?_0x388cd8[_0x60e7('0x19')]:_0x25bcd9['offset']+_0x25bcd9[_0x60e7('0x18')];var _0x128ef1;if(_0x54a701>=_0x22c978){_0x54a701=_0x22c978;_0x128ef1=0xc8;}else{_0x128ef1=0xce;}_0x589b22[_0x60e7('0x1b')](_0x128ef1);return _0x589b22[_0x60e7('0x1c')](_0x60e7('0x1d'),_0x2a136a+'-'+_0x54a701+'/'+_0x22c978)[_0x60e7('0x17')](_0x388cd8);}return null;};}function patchUpdates(_0x2c602d){return function(_0x878467){try{jsonpatch['apply'](_0x878467,_0x2c602d,!![]);}catch(_0x3dfbce){return BPromise[_0x60e7('0x1e')](_0x3dfbce);}return _0x878467['save']();};}function saveUpdates(_0x3841f2,_0x507a9b){return function(_0x3d8a3b){if(_0x3d8a3b){return _0x3d8a3b[_0x60e7('0x1f')](_0x3841f2)[_0x60e7('0x20')](function(_0x334bd9){return _0x334bd9;});}return null;};}function removeEntity(_0x40c7b0,_0x4258a2){return function(_0x54e17b){if(_0x54e17b){return _0x54e17b[_0x60e7('0x21')]()[_0x60e7('0x20')](function(){_0x40c7b0[_0x60e7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a0605,_0x3ecb2e){return function(_0x34da5e){if(!_0x34da5e){_0x4a0605[_0x60e7('0x15')](0x194);}return _0x34da5e;};}function handleError(_0xda9aa1,_0x598fb2){_0x598fb2=_0x598fb2||0x1f4;return function(_0x3c8084){logger[_0x60e7('0x22')](_0x3c8084[_0x60e7('0x23')]);if(_0x3c8084[_0x60e7('0x24')]){delete _0x3c8084[_0x60e7('0x24')];}_0xda9aa1['status'](_0x598fb2)[_0x60e7('0x25')](_0x3c8084);};}exports[_0x60e7('0x26')]=function(_0x24896b,_0xebd04c){var _0x9f4c09={},_0x311c17={},_0x532ab2={'count':0x0,'rows':[]};var _0xdc50fe=_['map'](db[_0x60e7('0x27')]['rawAttributes'],function(_0xdd5824){return{'name':_0xdd5824[_0x60e7('0x28')],'type':_0xdd5824[_0x60e7('0x29')][_0x60e7('0x2a')]};});_0x311c17[_0x60e7('0x2b')]=_[_0x60e7('0x2c')](_0xdc50fe,_0x60e7('0x24'));_0x311c17['query']=_[_0x60e7('0x2d')](_0x24896b['query']);_0x311c17[_0x60e7('0x2e')]=_[_0x60e7('0x2f')](_0x311c17[_0x60e7('0x2b')],_0x311c17[_0x60e7('0x30')]);_0x9f4c09[_0x60e7('0x31')]=_[_0x60e7('0x2f')](_0x311c17[_0x60e7('0x2b')],qs[_0x60e7('0x32')](_0x24896b['query'][_0x60e7('0x32')]));_0x9f4c09['attributes']=_0x9f4c09[_0x60e7('0x31')]['length']?_0x9f4c09['attributes']:_0x311c17['model'];if(!_0x24896b['query']['hasOwnProperty']('nolimit')){_0x9f4c09['limit']=qs[_0x60e7('0x18')](_0x24896b['query'][_0x60e7('0x18')]);_0x9f4c09[_0x60e7('0x1a')]=qs[_0x60e7('0x1a')](_0x24896b[_0x60e7('0x30')][_0x60e7('0x1a')]);}_0x9f4c09[_0x60e7('0x33')]=qs[_0x60e7('0x34')](_0x24896b[_0x60e7('0x30')][_0x60e7('0x34')]);_0x9f4c09['where']=qs[_0x60e7('0x2e')](_['pick'](_0x24896b[_0x60e7('0x30')],_0x311c17[_0x60e7('0x2e')]),_0xdc50fe);if(_0x24896b[_0x60e7('0x30')][_0x60e7('0x35')]){_0x9f4c09['where']=_[_0x60e7('0x36')](_0x9f4c09[_0x60e7('0x37')],{'$or':_[_0x60e7('0x2c')](_0xdc50fe,function(_0x1747e3){if(_0x1747e3[_0x60e7('0x29')]!==_0x60e7('0x38')){var _0x4c48f3={};_0x4c48f3[_0x1747e3[_0x60e7('0x24')]]={'$like':'%'+_0x24896b[_0x60e7('0x30')][_0x60e7('0x35')]+'%'};return _0x4c48f3;}})});}_0x9f4c09=_[_0x60e7('0x36')]({},_0x9f4c09,_0x24896b[_0x60e7('0x39')]);var _0x388187={'where':_0x9f4c09[_0x60e7('0x37')]};return db[_0x60e7('0x27')][_0x60e7('0x19')](_0x388187)[_0x60e7('0x20')](function(_0x2b949f){_0x532ab2[_0x60e7('0x19')]=_0x2b949f;if(_0x24896b[_0x60e7('0x30')][_0x60e7('0x3a')]){_0x9f4c09[_0x60e7('0x3b')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x9f4c09);})[_0x60e7('0x20')](function(_0x2899c0){_0x532ab2['rows']=_0x2899c0;return _0x532ab2;})[_0x60e7('0x20')](respondWithFilteredResult(_0xebd04c,_0x9f4c09))[_0x60e7('0x3c')](handleError(_0xebd04c,null));};exports[_0x60e7('0x3d')]=function(_0x2ec96e,_0x5dc8ce){var _0x16df05={'raw':!![],'where':{'id':_0x2ec96e[_0x60e7('0x3e')]['id']}},_0x186552={};_0x186552[_0x60e7('0x2b')]=_['keys'](db[_0x60e7('0x27')][_0x60e7('0x3f')]);_0x186552[_0x60e7('0x30')]=_[_0x60e7('0x2d')](_0x2ec96e[_0x60e7('0x30')]);_0x186552[_0x60e7('0x2e')]=_[_0x60e7('0x2f')](_0x186552[_0x60e7('0x2b')],_0x186552['query']);_0x16df05[_0x60e7('0x31')]=_[_0x60e7('0x2f')](_0x186552[_0x60e7('0x2b')],qs['fields'](_0x2ec96e[_0x60e7('0x30')][_0x60e7('0x32')]));_0x16df05['attributes']=_0x16df05[_0x60e7('0x31')]['length']?_0x16df05[_0x60e7('0x31')]:_0x186552['model'];if(_0x2ec96e[_0x60e7('0x30')]['includeAll']){_0x16df05[_0x60e7('0x3b')]=[{'all':!![]}];}_0x16df05=_[_0x60e7('0x36')]({},_0x16df05,_0x2ec96e[_0x60e7('0x39')]);return db[_0x60e7('0x27')][_0x60e7('0x40')](_0x16df05)[_0x60e7('0x20')](handleEntityNotFound(_0x5dc8ce,null))[_0x60e7('0x20')](respondWithResult(_0x5dc8ce,null))[_0x60e7('0x3c')](handleError(_0x5dc8ce,null));};exports['create']=function(_0x16762a,_0x46fe16){return db['ChatQueueReport']['create'](_0x16762a[_0x60e7('0x41')],{})['then'](respondWithResult(_0x46fe16,0xc9))[_0x60e7('0x3c')](handleError(_0x46fe16,null));};exports['update']=function(_0x59fef9,_0x52911b){if(_0x59fef9[_0x60e7('0x41')]['id']){delete _0x59fef9[_0x60e7('0x41')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x59fef9['params']['id']}})[_0x60e7('0x20')](handleEntityNotFound(_0x52911b,null))[_0x60e7('0x20')](saveUpdates(_0x59fef9[_0x60e7('0x41')],null))[_0x60e7('0x20')](respondWithResult(_0x52911b,null))[_0x60e7('0x3c')](handleError(_0x52911b,null));};exports[_0x60e7('0x21')]=function(_0x2c574d,_0x1a334d){return db['ChatQueueReport']['find']({'where':{'id':_0x2c574d[_0x60e7('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1a334d,null))[_0x60e7('0x20')](removeEntity(_0x1a334d,null))[_0x60e7('0x3c')](handleError(_0x1a334d,null));};exports[_0x60e7('0x42')]=function(_0x13e25e,_0x4cd92c){return db['ChatQueueReport']['describe']()['then'](respondWithResult(_0x4cd92c,null))[_0x60e7('0x3c')](handleError(_0x4cd92c,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index a10da8a..deb8c7b 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x7f3667,_0x30c3f1){var _0x2c4c24=function(_0xf070f3){while(--_0xf070f3){_0x7f3667['push'](_0x7f3667['shift']());}};_0x2c4c24(++_0x30c3f1);}(_0xb10b,0x12a));var _0xbb10=function(_0x5dbc86,_0xcdbb86){_0x5dbc86=_0x5dbc86-0x0;var _0x1f80e3=_0xb10b[_0x5dbc86];return _0x1f80e3;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x29173b,_0x31c7f6){var _0xb3f709=function(_0x5f0ce4){while(--_0x5f0ce4){_0x29173b['push'](_0x29173b['shift']());}};_0xb3f709(++_0x31c7f6);}(_0x757a,0xde));var _0xa757=function(_0x29c3e3,_0x5a9636){_0x29c3e3=_0x29c3e3-0x0;var _0x3973b6=_0x757a[_0x29c3e3];return _0x3973b6;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index f875cf5..06c8913 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 _0x960f=['request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ChatQueueReport','create','options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','where','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http'];(function(_0x5c9c66,_0x5b2b0a){var _0x21a30a=function(_0x48b56c){while(--_0x48b56c){_0x5c9c66['push'](_0x5c9c66['shift']());}};_0x21a30a(++_0x5b2b0a);}(_0x960f,0x1a8));var _0xf960=function(_0x52598d,_0x10fb73){_0x52598d=_0x52598d-0x0;var _0x170309=_0x960f[_0x52598d];return _0x170309;};'use strict';var _=require(_0xf960('0x0'));var util=require(_0xf960('0x1'));var moment=require(_0xf960('0x2'));var BPromise=require(_0xf960('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf960('0x4'));var db=require(_0xf960('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf960('0x6'))(_0xf960('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf960('0x8')][_0xf960('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e776d,_0x50ea12,_0x1b60f4){return new BPromise(function(_0x48d464,_0x45aaaa){return client[_0xf960('0xa')](_0x2e776d,_0x1b60f4)[_0xf960('0xb')](function(_0xb8418){logger[_0xf960('0xc')](_0xf960('0xd'),_0x50ea12,'request\x20sent');logger[_0xf960('0xe')](_0xf960('0xf'),_0x50ea12,_0xf960('0x10'),JSON[_0xf960('0x11')](_0xb8418));if(_0xb8418[_0xf960('0x12')]){if(_0xb8418[_0xf960('0x12')][_0xf960('0x13')]===0x1f4){logger[_0xf960('0x12')](_0xf960('0xd'),_0x50ea12,_0xb8418[_0xf960('0x12')][_0xf960('0x14')]);return _0x45aaaa(_0xb8418[_0xf960('0x12')][_0xf960('0x14')]);}logger[_0xf960('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x50ea12,_0xb8418['error'][_0xf960('0x14')]);return _0x48d464(_0xb8418[_0xf960('0x12')]['message']);}else{logger[_0xf960('0xc')](_0xf960('0xd'),_0x50ea12,'request\x20sent');_0x48d464(_0xb8418['result'][_0xf960('0x14')]);}})[_0xf960('0x15')](function(_0x357c94){logger[_0xf960('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x50ea12,_0x357c94);_0x45aaaa(_0x357c94);});});}exports['CreateChatQueueReport']=function(_0x1c923d){var _0x3aff1a=this;return new Promise(function(_0x2f8776,_0x474d94){return db[_0xf960('0x16')][_0xf960('0x17')](_0x1c923d['body'],{'raw':_0x1c923d['options']?_0x1c923d[_0xf960('0x18')][_0xf960('0x19')]===undefined?!![]:![]:!![]})[_0xf960('0xb')](function(_0x372e18){logger[_0xf960('0xc')](_0xf960('0x1a'),_0x1c923d);logger[_0xf960('0xe')](_0xf960('0x1a'),_0x1c923d,JSON[_0xf960('0x11')](_0x372e18));_0x2f8776(_0x372e18);})[_0xf960('0x15')](function(_0x5964f6){logger[_0xf960('0x12')](_0xf960('0x1a'),_0x5964f6[_0xf960('0x14')],_0x1c923d);_0x474d94(_0x3aff1a[_0xf960('0x12')](0x1f4,_0x5964f6[_0xf960('0x14')]));});});};exports[_0xf960('0x1b')]=function(_0x1df44d){var _0x2d78a8=this;return new Promise(function(_0x4e2496,_0x35845f){return db['ChatQueueReport'][_0xf960('0x1c')](_0x1df44d['body'],{'raw':_0x1df44d[_0xf960('0x18')]?_0x1df44d[_0xf960('0x18')][_0xf960('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1df44d['options']?_0x1df44d[_0xf960('0x18')][_0xf960('0x1d')]||null:null,'attributes':_0x1df44d[_0xf960('0x18')]?_0x1df44d['options'][_0xf960('0x1e')]||null:null,'limit':_0x1df44d[_0xf960('0x18')]?_0x1df44d[_0xf960('0x18')]['limit']||null:null})[_0xf960('0xb')](function(_0x51937e){logger['info'](_0xf960('0x1b'),_0x1df44d);logger[_0xf960('0xe')]('UpdateChatQueueReport',_0x1df44d,JSON['stringify'](_0x51937e));_0x4e2496(_0x51937e);})[_0xf960('0x15')](function(_0x3e751f){logger['error'](_0xf960('0x1b'),_0x3e751f[_0xf960('0x14')],_0x1df44d);_0x35845f(_0x2d78a8[_0xf960('0x12')](0x1f4,_0x3e751f[_0xf960('0x14')]));});});};
\ No newline at end of file
+var _0x2739=['message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','then','UpdateChatQueueReport','update','raw','where','attributes','limit','info','lodash','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2739,0x8b));var _0x9273=function(_0x1acbea,_0x52c5b5){_0x1acbea=_0x1acbea-0x0;var _0x5e790a=_0x2739[_0x1acbea];return _0x5e790a;};'use strict';var _=require(_0x9273('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9273('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9273('0x2'));var logger=require(_0x9273('0x3'))('rpc');var config=require(_0x9273('0x4'));var jayson=require(_0x9273('0x5'));var client=jayson[_0x9273('0x6')][_0x9273('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xfe2742,_0x2f56cb,_0x63aa14){return new BPromise(function(_0x5287b2,_0x82109d){return client[_0x9273('0x8')](_0xfe2742,_0x63aa14)['then'](function(_0x538c6f){logger['info'](_0x9273('0x9'),_0x2f56cb,_0x9273('0xa'));logger[_0x9273('0xb')](_0x9273('0xc'),_0x2f56cb,_0x9273('0xa'),JSON[_0x9273('0xd')](_0x538c6f));if(_0x538c6f[_0x9273('0xe')]){if(_0x538c6f[_0x9273('0xe')][_0x9273('0xf')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x2f56cb,_0x538c6f[_0x9273('0xe')][_0x9273('0x10')]);return _0x82109d(_0x538c6f[_0x9273('0xe')]['message']);}logger[_0x9273('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x2f56cb,_0x538c6f['error'][_0x9273('0x10')]);return _0x5287b2(_0x538c6f[_0x9273('0xe')][_0x9273('0x10')]);}else{logger['info'](_0x9273('0x9'),_0x2f56cb,_0x9273('0xa'));_0x5287b2(_0x538c6f[_0x9273('0x11')][_0x9273('0x10')]);}})[_0x9273('0x12')](function(_0x19cfa7){logger[_0x9273('0xe')](_0x9273('0x9'),_0x2f56cb,_0x19cfa7);_0x82109d(_0x19cfa7);});});}exports[_0x9273('0x13')]=function(_0x541da4){var _0x3f555a=this;return new Promise(function(_0x4f33df,_0x399cf4){return db[_0x9273('0x14')][_0x9273('0x15')](_0x541da4['body'],{'raw':_0x541da4['options']?_0x541da4[_0x9273('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x9273('0x17')](function(_0xf612c5){logger['info']('CreateChatQueueReport',_0x541da4);logger[_0x9273('0xb')](_0x9273('0x13'),_0x541da4,JSON[_0x9273('0xd')](_0xf612c5));_0x4f33df(_0xf612c5);})['catch'](function(_0x5cbf21){logger[_0x9273('0xe')](_0x9273('0x13'),_0x5cbf21[_0x9273('0x10')],_0x541da4);_0x399cf4(_0x3f555a[_0x9273('0xe')](0x1f4,_0x5cbf21[_0x9273('0x10')]));});});};exports[_0x9273('0x18')]=function(_0x17b6f4){var _0x2632a5=this;return new Promise(function(_0x28131e,_0x4f42f2){return db[_0x9273('0x14')][_0x9273('0x19')](_0x17b6f4['body'],{'raw':_0x17b6f4[_0x9273('0x16')]?_0x17b6f4[_0x9273('0x16')][_0x9273('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17b6f4[_0x9273('0x16')]?_0x17b6f4[_0x9273('0x16')][_0x9273('0x1b')]||null:null,'attributes':_0x17b6f4['options']?_0x17b6f4[_0x9273('0x16')][_0x9273('0x1c')]||null:null,'limit':_0x17b6f4[_0x9273('0x16')]?_0x17b6f4['options'][_0x9273('0x1d')]||null:null})[_0x9273('0x17')](function(_0x1dd207){logger[_0x9273('0x1e')](_0x9273('0x18'),_0x17b6f4);logger[_0x9273('0xb')](_0x9273('0x18'),_0x17b6f4,JSON[_0x9273('0xd')](_0x1dd207));_0x28131e(_0x1dd207);})[_0x9273('0x12')](function(_0x255424){logger[_0x9273('0xe')](_0x9273('0x18'),_0x255424[_0x9273('0x10')],_0x17b6f4);_0x4f42f2(_0x2632a5[_0x9273('0xe')](0x1f4,_0x255424[_0x9273('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 5ea5eab..2e3d112 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 _0x9db3=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','show','create','put','/:id','destroy','exports','express','Router'];(function(_0x5bb818,_0x57780a){var _0xc56b13=function(_0x3de0a8){while(--_0x3de0a8){_0x5bb818['push'](_0x5bb818['shift']());}};_0xc56b13(++_0x57780a);}(_0x9db3,0xd0));var _0x39db=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9db3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x39db('0x0'));var router=express[_0x39db('0x1')]();var fs_extra=require(_0x39db('0x2'));var auth=require(_0x39db('0x3'));var interaction=require(_0x39db('0x4'));var config=require('../../config/environment');var controller=require(_0x39db('0x5'));router[_0x39db('0x6')]('/',auth[_0x39db('0x7')](),controller['index']);router[_0x39db('0x6')]('/describe',auth[_0x39db('0x7')](),controller['describe']);router['get']('/:id',auth[_0x39db('0x7')](),controller[_0x39db('0x8')]);router['post']('/',auth[_0x39db('0x7')](),controller[_0x39db('0x9')]);router[_0x39db('0xa')](_0x39db('0xb'),auth[_0x39db('0x7')](),controller['update']);router['delete'](_0x39db('0xb'),auth[_0x39db('0x7')](),controller[_0x39db('0xc')]);module[_0x39db('0xd')]=router;
\ No newline at end of file
+var _0x7f85=['../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','describe','show','isAuthenticated','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x47631c,_0x39f5ca){var _0x773db2=function(_0x1dfbbb){while(--_0x1dfbbb){_0x47631c['push'](_0x47631c['shift']());}};_0x773db2(++_0x39f5ca);}(_0x7f85,0x173));var _0x57f8=function(_0x361b7e,_0x2d6399){_0x361b7e=_0x361b7e-0x0;var _0x37448e=_0x7f85[_0x361b7e];return _0x37448e;};'use strict';var multer=require(_0x57f8('0x0'));var util=require(_0x57f8('0x1'));var path=require(_0x57f8('0x2'));var timeout=require(_0x57f8('0x3'));var express=require(_0x57f8('0x4'));var router=express[_0x57f8('0x5')]();var fs_extra=require(_0x57f8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x57f8('0x7'));var config=require(_0x57f8('0x8'));var controller=require(_0x57f8('0x9'));router[_0x57f8('0xa')]('/',auth['isAuthenticated'](),controller[_0x57f8('0xb')]);router['get'](_0x57f8('0xc'),auth['isAuthenticated'](),controller[_0x57f8('0xd')]);router[_0x57f8('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x57f8('0xe')]);router['post']('/',auth[_0x57f8('0xf')](),controller[_0x57f8('0x10')]);router['put'](_0x57f8('0x11'),auth[_0x57f8('0xf')](),controller[_0x57f8('0x12')]);router[_0x57f8('0x13')](_0x57f8('0x11'),auth[_0x57f8('0xf')](),controller['destroy']);module[_0x57f8('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index e75b43d..b850717 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5d7754,_0x1e16d4){var _0x2d60c5=function(_0xb09554){while(--_0xb09554){_0x5d7754['push'](_0x5d7754['shift']());}};_0x2d60c5(++_0x1e16d4);}(_0x008c,0x188));var _0xc008=function(_0xa6cb09,_0x39410f){_0xa6cb09=_0xa6cb09-0x0;var _0x12b437=_0x008c[_0xa6cb09];return _0x12b437;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
+var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x783834,_0x38c810){var _0x22055f=function(_0x6a6998){while(--_0x6a6998){_0x783834['push'](_0x783834['shift']());}};_0x22055f(++_0x38c810);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 97b3903..fb5bfe9 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 _0x22fb=['name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack'];(function(_0x13aefe,_0xda72e9){var _0x152b1d=function(_0x58531b){while(--_0x58531b){_0x13aefe['push'](_0x13aefe['shift']());}};_0x152b1d(++_0xda72e9);}(_0x22fb,0x18f));var _0xb22f=function(_0x2eb23f,_0xa28d0f){_0x2eb23f=_0x2eb23f-0x0;var _0x688f42=_0x22fb[_0x2eb23f];return _0x688f42;};'use strict';var emlformat=require(_0xb22f('0x0'));var rimraf=require(_0xb22f('0x1'));var zipdir=require(_0xb22f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb22f('0x3'));var moment=require(_0xb22f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb22f('0x5'));var util=require(_0xb22f('0x6'));var path=require(_0xb22f('0x7'));var sox=require(_0xb22f('0x8'));var csv=require(_0xb22f('0x9'));var ejs=require(_0xb22f('0xa'));var fs=require('fs');var fs_extra=require(_0xb22f('0xb'));var _=require('lodash');var squel=require(_0xb22f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb22f('0xd'));var toCsv=require(_0xb22f('0x9'));var querystring=require('querystring');var Papa=require(_0xb22f('0xe'));var Redis=require(_0xb22f('0xf'));var authService=require(_0xb22f('0x10'));var qs=require(_0xb22f('0x11'));var as=require(_0xb22f('0x12'));var hardwareService=require(_0xb22f('0x13'));var logger=require(_0xb22f('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb22f('0x15'));var db=require(_0xb22f('0x16'))['db'];function respondWithStatusCode(_0x436000,_0x1fc5fd){_0x1fc5fd=_0x1fc5fd||0xcc;return function(_0x5c475a){if(_0x5c475a){return _0x436000['sendStatus'](_0x1fc5fd);}return _0x436000[_0xb22f('0x17')](_0x1fc5fd)[_0xb22f('0x18')]();};}function respondWithResult(_0x4153ce,_0x2fcaf7){_0x2fcaf7=_0x2fcaf7||0xc8;return function(_0x14c4ef){if(_0x14c4ef){return _0x4153ce['status'](_0x2fcaf7)[_0xb22f('0x19')](_0x14c4ef);}};}function respondWithFilteredResult(_0x4da342,_0x113471){return function(_0x38345d){if(_0x38345d){var _0x34e275=typeof _0x113471[_0xb22f('0x1a')]===_0xb22f('0x1b')&&typeof _0x113471[_0xb22f('0x1c')]===_0xb22f('0x1b');var _0x55f289=_0x38345d[_0xb22f('0x1d')];var _0x4e23fb=_0x34e275?0x0:_0x113471[_0xb22f('0x1a')];var _0x2472a8=_0x34e275?_0x38345d[_0xb22f('0x1d')]:_0x113471[_0xb22f('0x1a')]+_0x113471[_0xb22f('0x1c')];var _0x1d2846;if(_0x2472a8>=_0x55f289){_0x2472a8=_0x55f289;_0x1d2846=0xc8;}else{_0x1d2846=0xce;}_0x4da342['status'](_0x1d2846);return _0x4da342['set'](_0xb22f('0x1e'),_0x4e23fb+'-'+_0x2472a8+'/'+_0x55f289)[_0xb22f('0x19')](_0x38345d);}return null;};}function patchUpdates(_0xf126f2){return function(_0x41115a){try{jsonpatch[_0xb22f('0x1f')](_0x41115a,_0xf126f2,!![]);}catch(_0x2795cc){return BPromise[_0xb22f('0x20')](_0x2795cc);}return _0x41115a[_0xb22f('0x21')]();};}function saveUpdates(_0x9609dd,_0x3b185b){return function(_0xb1e5af){if(_0xb1e5af){return _0xb1e5af[_0xb22f('0x22')](_0x9609dd)[_0xb22f('0x23')](function(_0x3b074e){return _0x3b074e;});}return null;};}function removeEntity(_0x190a0a,_0x219d3b){return function(_0x3fbfeb){if(_0x3fbfeb){return _0x3fbfeb[_0xb22f('0x24')]()[_0xb22f('0x23')](function(){_0x190a0a[_0xb22f('0x17')](0xcc)[_0xb22f('0x18')]();});}};}function handleEntityNotFound(_0x228627,_0x22befe){return function(_0x2084e3){if(!_0x2084e3){_0x228627[_0xb22f('0x25')](0x194);}return _0x2084e3;};}function handleError(_0x47d3f1,_0x53d12f){_0x53d12f=_0x53d12f||0x1f4;return function(_0x4ff759){logger['error'](_0x4ff759[_0xb22f('0x26')]);if(_0x4ff759['name']){delete _0x4ff759[_0xb22f('0x27')];}_0x47d3f1[_0xb22f('0x17')](_0x53d12f)[_0xb22f('0x28')](_0x4ff759);};}exports[_0xb22f('0x29')]=function(_0x143f56,_0x5a5951){var _0x527dc0={},_0x56999e={},_0x22a328={'count':0x0,'rows':[]};var _0xbbf67=_[_0xb22f('0x2a')](db[_0xb22f('0x2b')][_0xb22f('0x2c')],function(_0x37cde7){return{'name':_0x37cde7[_0xb22f('0x2d')],'type':_0x37cde7[_0xb22f('0x2e')][_0xb22f('0x2f')]};});_0x56999e[_0xb22f('0x30')]=_[_0xb22f('0x2a')](_0xbbf67,_0xb22f('0x27'));_0x56999e[_0xb22f('0x31')]=_[_0xb22f('0x32')](_0x143f56[_0xb22f('0x31')]);_0x56999e[_0xb22f('0x33')]=_[_0xb22f('0x34')](_0x56999e[_0xb22f('0x30')],_0x56999e[_0xb22f('0x31')]);_0x527dc0[_0xb22f('0x35')]=_[_0xb22f('0x34')](_0x56999e[_0xb22f('0x30')],qs['fields'](_0x143f56[_0xb22f('0x31')][_0xb22f('0x36')]));_0x527dc0[_0xb22f('0x35')]=_0x527dc0[_0xb22f('0x35')][_0xb22f('0x37')]?_0x527dc0['attributes']:_0x56999e[_0xb22f('0x30')];if(!_0x143f56[_0xb22f('0x31')][_0xb22f('0x38')](_0xb22f('0x39'))){_0x527dc0[_0xb22f('0x1c')]=qs[_0xb22f('0x1c')](_0x143f56[_0xb22f('0x31')][_0xb22f('0x1c')]);_0x527dc0[_0xb22f('0x1a')]=qs[_0xb22f('0x1a')](_0x143f56[_0xb22f('0x31')][_0xb22f('0x1a')]);}_0x527dc0[_0xb22f('0x3a')]=qs[_0xb22f('0x3b')](_0x143f56['query']['sort']);_0x527dc0[_0xb22f('0x3c')]=qs[_0xb22f('0x33')](_[_0xb22f('0x3d')](_0x143f56[_0xb22f('0x31')],_0x56999e[_0xb22f('0x33')]),_0xbbf67);if(_0x143f56[_0xb22f('0x31')][_0xb22f('0x3e')]){_0x527dc0['where']=_['merge'](_0x527dc0[_0xb22f('0x3c')],{'$or':_[_0xb22f('0x2a')](_0xbbf67,function(_0x5644f3){if(_0x5644f3[_0xb22f('0x2e')]!=='VIRTUAL'){var _0x21b777={};_0x21b777[_0x5644f3['name']]={'$like':'%'+_0x143f56[_0xb22f('0x31')][_0xb22f('0x3e')]+'%'};return _0x21b777;}})});}_0x527dc0=_[_0xb22f('0x3f')]({},_0x527dc0,_0x143f56[_0xb22f('0x40')]);var _0x298ac1={'where':_0x527dc0[_0xb22f('0x3c')]};return db[_0xb22f('0x2b')][_0xb22f('0x1d')](_0x298ac1)['then'](function(_0x25a73a){_0x22a328[_0xb22f('0x1d')]=_0x25a73a;if(_0x143f56[_0xb22f('0x31')][_0xb22f('0x41')]){_0x527dc0['include']=[{'all':!![]}];}return db[_0xb22f('0x2b')]['findAll'](_0x527dc0);})[_0xb22f('0x23')](function(_0x1b7416){_0x22a328['rows']=_0x1b7416;return _0x22a328;})[_0xb22f('0x23')](respondWithFilteredResult(_0x5a5951,_0x527dc0))[_0xb22f('0x42')](handleError(_0x5a5951,null));};exports[_0xb22f('0x43')]=function(_0x47e0b1,_0x3af948){var _0x12a6ce={'raw':!![],'where':{'id':_0x47e0b1[_0xb22f('0x44')]['id']}},_0x4d682a={};_0x4d682a[_0xb22f('0x30')]=_[_0xb22f('0x32')](db[_0xb22f('0x2b')][_0xb22f('0x2c')]);_0x4d682a[_0xb22f('0x31')]=_[_0xb22f('0x32')](_0x47e0b1[_0xb22f('0x31')]);_0x4d682a[_0xb22f('0x33')]=_[_0xb22f('0x34')](_0x4d682a['model'],_0x4d682a[_0xb22f('0x31')]);_0x12a6ce[_0xb22f('0x35')]=_[_0xb22f('0x34')](_0x4d682a['model'],qs[_0xb22f('0x36')](_0x47e0b1[_0xb22f('0x31')][_0xb22f('0x36')]));_0x12a6ce[_0xb22f('0x35')]=_0x12a6ce[_0xb22f('0x35')]['length']?_0x12a6ce[_0xb22f('0x35')]:_0x4d682a[_0xb22f('0x30')];if(_0x47e0b1[_0xb22f('0x31')][_0xb22f('0x41')]){_0x12a6ce['include']=[{'all':!![]}];}_0x12a6ce=_[_0xb22f('0x3f')]({},_0x12a6ce,_0x47e0b1[_0xb22f('0x40')]);return db[_0xb22f('0x2b')][_0xb22f('0x45')](_0x12a6ce)[_0xb22f('0x23')](handleEntityNotFound(_0x3af948,null))[_0xb22f('0x23')](respondWithResult(_0x3af948,null))['catch'](handleError(_0x3af948,null));};exports[_0xb22f('0x46')]=function(_0x562c74,_0x34604e){return db['ChatTransferReport']['create'](_0x562c74[_0xb22f('0x47')],{})[_0xb22f('0x23')](respondWithResult(_0x34604e,0xc9))[_0xb22f('0x42')](handleError(_0x34604e,null));};exports['update']=function(_0x392cde,_0x49b5cb){if(_0x392cde[_0xb22f('0x47')]['id']){delete _0x392cde['body']['id'];}return db[_0xb22f('0x2b')][_0xb22f('0x45')]({'where':{'id':_0x392cde['params']['id']}})[_0xb22f('0x23')](handleEntityNotFound(_0x49b5cb,null))[_0xb22f('0x23')](saveUpdates(_0x392cde[_0xb22f('0x47')],null))['then'](respondWithResult(_0x49b5cb,null))[_0xb22f('0x42')](handleError(_0x49b5cb,null));};exports[_0xb22f('0x24')]=function(_0x4dfcd,_0x3c6e6a){return db['ChatTransferReport'][_0xb22f('0x45')]({'where':{'id':_0x4dfcd[_0xb22f('0x44')]['id']}})[_0xb22f('0x23')](handleEntityNotFound(_0x3c6e6a,null))['then'](removeEntity(_0x3c6e6a,null))['catch'](handleError(_0x3c6e6a,null));};exports[_0xb22f('0x48')]=function(_0x4bbeb6,_0x42610f){return db['ChatTransferReport'][_0xb22f('0x48')]()[_0xb22f('0x23')](respondWithResult(_0x42610f,null))[_0xb22f('0x42')](handleError(_0x42610f,null));};
\ No newline at end of file
+var _0xad29=['nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','find','catch','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xad29,0xe7));var _0x9ad2=function(_0x552c27,_0x478dc2){_0x552c27=_0x552c27-0x0;var _0x2a0922=_0xad29[_0x552c27];return _0x2a0922;};'use strict';var emlformat=require(_0x9ad2('0x0'));var rimraf=require(_0x9ad2('0x1'));var zipdir=require(_0x9ad2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ad2('0x3'));var moment=require(_0x9ad2('0x4'));var BPromise=require(_0x9ad2('0x5'));var Mustache=require(_0x9ad2('0x6'));var util=require(_0x9ad2('0x7'));var path=require(_0x9ad2('0x8'));var sox=require(_0x9ad2('0x9'));var csv=require(_0x9ad2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9ad2('0xb'));var _=require(_0x9ad2('0xc'));var squel=require('squel');var crypto=require(_0x9ad2('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9ad2('0xa'));var querystring=require(_0x9ad2('0xe'));var Papa=require(_0x9ad2('0xf'));var Redis=require(_0x9ad2('0x10'));var authService=require(_0x9ad2('0x11'));var qs=require(_0x9ad2('0x12'));var as=require(_0x9ad2('0x13'));var hardwareService=require(_0x9ad2('0x14'));var logger=require('../../config/logger')(_0x9ad2('0x15'));var utils=require(_0x9ad2('0x16'));var config=require(_0x9ad2('0x17'));var licenseUtil=require(_0x9ad2('0x18'));var db=require(_0x9ad2('0x19'))['db'];function respondWithStatusCode(_0x166857,_0x14abfa){_0x14abfa=_0x14abfa||0xcc;return function(_0xe78ede){if(_0xe78ede){return _0x166857[_0x9ad2('0x1a')](_0x14abfa);}return _0x166857['status'](_0x14abfa)[_0x9ad2('0x1b')]();};}function respondWithResult(_0x3db5a7,_0x3540ad){_0x3540ad=_0x3540ad||0xc8;return function(_0xc135c8){if(_0xc135c8){return _0x3db5a7[_0x9ad2('0x1c')](_0x3540ad)[_0x9ad2('0x1d')](_0xc135c8);}};}function respondWithFilteredResult(_0x3af1a0,_0x741154){return function(_0x2fa845){if(_0x2fa845){var _0x268c5f=typeof _0x741154[_0x9ad2('0x1e')]===_0x9ad2('0x1f')&&typeof _0x741154[_0x9ad2('0x20')]===_0x9ad2('0x1f');var _0x380620=_0x2fa845[_0x9ad2('0x21')];var _0x57b72c=_0x268c5f?0x0:_0x741154[_0x9ad2('0x1e')];var _0x4fc3af=_0x268c5f?_0x2fa845['count']:_0x741154[_0x9ad2('0x1e')]+_0x741154[_0x9ad2('0x20')];var _0x16492b;if(_0x4fc3af>=_0x380620){_0x4fc3af=_0x380620;_0x16492b=0xc8;}else{_0x16492b=0xce;}_0x3af1a0[_0x9ad2('0x1c')](_0x16492b);return _0x3af1a0[_0x9ad2('0x22')](_0x9ad2('0x23'),_0x57b72c+'-'+_0x4fc3af+'/'+_0x380620)[_0x9ad2('0x1d')](_0x2fa845);}return null;};}function patchUpdates(_0x4d5045){return function(_0x471eca){try{jsonpatch['apply'](_0x471eca,_0x4d5045,!![]);}catch(_0x99e30e){return BPromise[_0x9ad2('0x24')](_0x99e30e);}return _0x471eca[_0x9ad2('0x25')]();};}function saveUpdates(_0x54514f,_0x2933a1){return function(_0x425e56){if(_0x425e56){return _0x425e56[_0x9ad2('0x26')](_0x54514f)[_0x9ad2('0x27')](function(_0x591563){return _0x591563;});}return null;};}function removeEntity(_0x3514fe,_0x4a5684){return function(_0x276edc){if(_0x276edc){return _0x276edc[_0x9ad2('0x28')]()[_0x9ad2('0x27')](function(){_0x3514fe[_0x9ad2('0x1c')](0xcc)[_0x9ad2('0x1b')]();});}};}function handleEntityNotFound(_0x31b299,_0x602795){return function(_0x2c030a){if(!_0x2c030a){_0x31b299[_0x9ad2('0x1a')](0x194);}return _0x2c030a;};}function handleError(_0xcbaca6,_0x65b942){_0x65b942=_0x65b942||0x1f4;return function(_0x573aaf){logger['error'](_0x573aaf['stack']);if(_0x573aaf[_0x9ad2('0x29')]){delete _0x573aaf[_0x9ad2('0x29')];}_0xcbaca6[_0x9ad2('0x1c')](_0x65b942)['send'](_0x573aaf);};}exports[_0x9ad2('0x2a')]=function(_0x4131dc,_0x302cce){var _0x58e079={},_0x300e69={},_0x63d608={'count':0x0,'rows':[]};var _0x390ffe=_[_0x9ad2('0x2b')](db[_0x9ad2('0x2c')][_0x9ad2('0x2d')],function(_0x2a93fe){return{'name':_0x2a93fe[_0x9ad2('0x2e')],'type':_0x2a93fe[_0x9ad2('0x2f')]['key']};});_0x300e69[_0x9ad2('0x30')]=_['map'](_0x390ffe,_0x9ad2('0x29'));_0x300e69[_0x9ad2('0x31')]=_[_0x9ad2('0x32')](_0x4131dc[_0x9ad2('0x31')]);_0x300e69[_0x9ad2('0x33')]=_[_0x9ad2('0x34')](_0x300e69[_0x9ad2('0x30')],_0x300e69[_0x9ad2('0x31')]);_0x58e079[_0x9ad2('0x35')]=_['intersection'](_0x300e69[_0x9ad2('0x30')],qs[_0x9ad2('0x36')](_0x4131dc[_0x9ad2('0x31')][_0x9ad2('0x36')]));_0x58e079[_0x9ad2('0x35')]=_0x58e079['attributes'][_0x9ad2('0x37')]?_0x58e079[_0x9ad2('0x35')]:_0x300e69[_0x9ad2('0x30')];if(!_0x4131dc['query'][_0x9ad2('0x38')](_0x9ad2('0x39'))){_0x58e079[_0x9ad2('0x20')]=qs[_0x9ad2('0x20')](_0x4131dc[_0x9ad2('0x31')][_0x9ad2('0x20')]);_0x58e079[_0x9ad2('0x1e')]=qs['offset'](_0x4131dc[_0x9ad2('0x31')][_0x9ad2('0x1e')]);}_0x58e079[_0x9ad2('0x3a')]=qs[_0x9ad2('0x3b')](_0x4131dc[_0x9ad2('0x31')][_0x9ad2('0x3b')]);_0x58e079[_0x9ad2('0x3c')]=qs[_0x9ad2('0x33')](_['pick'](_0x4131dc[_0x9ad2('0x31')],_0x300e69['filters']),_0x390ffe);if(_0x4131dc[_0x9ad2('0x31')][_0x9ad2('0x3d')]){_0x58e079[_0x9ad2('0x3c')]=_[_0x9ad2('0x3e')](_0x58e079[_0x9ad2('0x3c')],{'$or':_[_0x9ad2('0x2b')](_0x390ffe,function(_0x41d941){if(_0x41d941['type']!=='VIRTUAL'){var _0xab1bc3={};_0xab1bc3[_0x41d941[_0x9ad2('0x29')]]={'$like':'%'+_0x4131dc['query']['filter']+'%'};return _0xab1bc3;}})});}_0x58e079=_[_0x9ad2('0x3e')]({},_0x58e079,_0x4131dc[_0x9ad2('0x3f')]);var _0x1bb92f={'where':_0x58e079[_0x9ad2('0x3c')]};return db[_0x9ad2('0x2c')][_0x9ad2('0x21')](_0x1bb92f)['then'](function(_0x446d44){_0x63d608[_0x9ad2('0x21')]=_0x446d44;if(_0x4131dc[_0x9ad2('0x31')][_0x9ad2('0x40')]){_0x58e079[_0x9ad2('0x41')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x9ad2('0x42')](_0x58e079);})[_0x9ad2('0x27')](function(_0x1ff8ba){_0x63d608[_0x9ad2('0x43')]=_0x1ff8ba;return _0x63d608;})['then'](respondWithFilteredResult(_0x302cce,_0x58e079))['catch'](handleError(_0x302cce,null));};exports['show']=function(_0x104535,_0x4518b7){var _0xb1f06b={'raw':!![],'where':{'id':_0x104535['params']['id']}},_0x315328={};_0x315328['model']=_['keys'](db[_0x9ad2('0x2c')][_0x9ad2('0x2d')]);_0x315328[_0x9ad2('0x31')]=_[_0x9ad2('0x32')](_0x104535['query']);_0x315328[_0x9ad2('0x33')]=_['intersection'](_0x315328['model'],_0x315328['query']);_0xb1f06b[_0x9ad2('0x35')]=_['intersection'](_0x315328[_0x9ad2('0x30')],qs[_0x9ad2('0x36')](_0x104535[_0x9ad2('0x31')][_0x9ad2('0x36')]));_0xb1f06b[_0x9ad2('0x35')]=_0xb1f06b['attributes'][_0x9ad2('0x37')]?_0xb1f06b[_0x9ad2('0x35')]:_0x315328[_0x9ad2('0x30')];if(_0x104535[_0x9ad2('0x31')][_0x9ad2('0x40')]){_0xb1f06b['include']=[{'all':!![]}];}_0xb1f06b=_[_0x9ad2('0x3e')]({},_0xb1f06b,_0x104535[_0x9ad2('0x3f')]);return db['ChatTransferReport'][_0x9ad2('0x44')](_0xb1f06b)[_0x9ad2('0x27')](handleEntityNotFound(_0x4518b7,null))[_0x9ad2('0x27')](respondWithResult(_0x4518b7,null))[_0x9ad2('0x45')](handleError(_0x4518b7,null));};exports['create']=function(_0x5c72e8,_0x441577){return db[_0x9ad2('0x2c')]['create'](_0x5c72e8[_0x9ad2('0x46')],{})[_0x9ad2('0x27')](respondWithResult(_0x441577,0xc9))['catch'](handleError(_0x441577,null));};exports[_0x9ad2('0x26')]=function(_0x54370d,_0xddb0d0){if(_0x54370d[_0x9ad2('0x46')]['id']){delete _0x54370d[_0x9ad2('0x46')]['id'];}return db[_0x9ad2('0x2c')][_0x9ad2('0x44')]({'where':{'id':_0x54370d[_0x9ad2('0x47')]['id']}})[_0x9ad2('0x27')](handleEntityNotFound(_0xddb0d0,null))[_0x9ad2('0x27')](saveUpdates(_0x54370d[_0x9ad2('0x46')],null))['then'](respondWithResult(_0xddb0d0,null))['catch'](handleError(_0xddb0d0,null));};exports[_0x9ad2('0x28')]=function(_0x22d2c8,_0x32c68c){return db[_0x9ad2('0x2c')]['find']({'where':{'id':_0x22d2c8[_0x9ad2('0x47')]['id']}})[_0x9ad2('0x27')](handleEntityNotFound(_0x32c68c,null))[_0x9ad2('0x27')](removeEntity(_0x32c68c,null))['catch'](handleError(_0x32c68c,null));};exports['describe']=function(_0x5b0039,_0x3a78e9){return db[_0x9ad2('0x2c')]['describe']()[_0x9ad2('0x27')](respondWithResult(_0x3a78e9,null))[_0x9ad2('0x45')](handleError(_0x3a78e9,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 665b12d..023484d 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 _0x4b5b=['./chatTransferReport.attributes','define','uniqueid','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0xf01961,_0x17c74f){var _0xd983c4=function(_0x62a217){while(--_0x62a217){_0xf01961['push'](_0xf01961['shift']());}};_0xd983c4(++_0x17c74f);}(_0x4b5b,0xb7));var _0xb4b5=function(_0x3368b7,_0x55f847){_0x3368b7=_0x3368b7-0x0;var _0x40fbe8=_0x4b5b[_0x3368b7];return _0x40fbe8;};'use strict';var _=require('lodash');var util=require(_0xb4b5('0x0'));var logger=require(_0xb4b5('0x1'))(_0xb4b5('0x2'));var moment=require('moment');var BPromise=require(_0xb4b5('0x3'));var rp=require(_0xb4b5('0x4'));var fs=require('fs');var path=require(_0xb4b5('0x5'));var rimraf=require(_0xb4b5('0x6'));var config=require('../../config/environment');var attributes=require(_0xb4b5('0x7'));module['exports']=function(_0x506b39,_0x59ca8d){return _0x506b39[_0xb4b5('0x8')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xb4b5('0x9'),'fields':[_0xb4b5('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xac2a=['request-promise','path','exports','define','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3312a3,_0x3f9cdb){var _0x262560=function(_0x51880a){while(--_0x51880a){_0x3312a3['push'](_0x3312a3['shift']());}};_0x262560(++_0x3f9cdb);}(_0xac2a,0x1b3));var _0xaac2=function(_0x1fb3d2,_0x21c700){_0x1fb3d2=_0x1fb3d2-0x0;var _0x8aef6c=_0xac2a[_0x1fb3d2];return _0x8aef6c;};'use strict';var _=require(_0xaac2('0x0'));var util=require(_0xaac2('0x1'));var logger=require(_0xaac2('0x2'))('api');var moment=require(_0xaac2('0x3'));var BPromise=require(_0xaac2('0x4'));var rp=require(_0xaac2('0x5'));var fs=require('fs');var path=require(_0xaac2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0xaac2('0x7')]=function(_0x441372,_0x1c90d4){return _0x441372[_0xaac2('0x8')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xaac2('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index d5b4fef..27cd6a1 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 _0xd3d1=['then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x19fc2f,_0x2509a1){var _0x24a68f=function(_0x544062){while(--_0x544062){_0x19fc2f['push'](_0x19fc2f['shift']());}};_0x24a68f(++_0x2509a1);}(_0xd3d1,0x109));var _0x1d3d=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd3d1[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var moment=require(_0x1d3d('0x2'));var BPromise=require('bluebird');var rs=require(_0x1d3d('0x3'));var fs=require('fs');var Redis=require(_0x1d3d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1d3d('0x5'));var config=require(_0x1d3d('0x6'));var jayson=require(_0x1d3d('0x7'));var client=jayson[_0x1d3d('0x8')][_0x1d3d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22eab2,_0x3c1b42,_0xb1ea09){return new BPromise(function(_0x104f0f,_0x73453){return client[_0x1d3d('0xa')](_0x22eab2,_0xb1ea09)[_0x1d3d('0xb')](function(_0x509396){logger[_0x1d3d('0xc')](_0x1d3d('0xd'),_0x3c1b42,'request\x20sent');logger[_0x1d3d('0xe')](_0x1d3d('0xf'),_0x3c1b42,_0x1d3d('0x10'),JSON[_0x1d3d('0x11')](_0x509396));if(_0x509396[_0x1d3d('0x12')]){if(_0x509396[_0x1d3d('0x12')][_0x1d3d('0x13')]===0x1f4){logger[_0x1d3d('0x12')](_0x1d3d('0xd'),_0x3c1b42,_0x509396[_0x1d3d('0x12')][_0x1d3d('0x14')]);return _0x73453(_0x509396['error'][_0x1d3d('0x14')]);}logger[_0x1d3d('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x3c1b42,_0x509396[_0x1d3d('0x12')][_0x1d3d('0x14')]);return _0x104f0f(_0x509396[_0x1d3d('0x12')][_0x1d3d('0x14')]);}else{logger[_0x1d3d('0xc')](_0x1d3d('0xd'),_0x3c1b42,'request\x20sent');_0x104f0f(_0x509396[_0x1d3d('0x15')]['message']);}})[_0x1d3d('0x16')](function(_0x232913){logger[_0x1d3d('0x12')](_0x1d3d('0xd'),_0x3c1b42,_0x232913);_0x73453(_0x232913);});});}
\ No newline at end of file
+var _0x9b26=['../../config/logger','rpc','../../config/environment','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x51f077,_0x2705f7){var _0x50e2c3=function(_0x17b488){while(--_0x17b488){_0x51f077['push'](_0x51f077['shift']());}};_0x50e2c3(++_0x2705f7);}(_0x9b26,0x6d));var _0x69b2=function(_0x5dc489,_0x1d3f9f){_0x5dc489=_0x5dc489-0x0;var _0x482ba1=_0x9b26[_0x5dc489];return _0x482ba1;};'use strict';var _=require(_0x69b2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x69b2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69b2('0x2'));var db=require(_0x69b2('0x3'))['db'];var utils=require(_0x69b2('0x4'));var logger=require(_0x69b2('0x5'))(_0x69b2('0x6'));var config=require(_0x69b2('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x536e47,_0x149072,_0x4bda45){return new BPromise(function(_0xb8ff13,_0x207a99){return client['request'](_0x536e47,_0x4bda45)['then'](function(_0x17e973){logger[_0x69b2('0x8')](_0x69b2('0x9'),_0x149072,_0x69b2('0xa'));logger[_0x69b2('0xb')](_0x69b2('0xc'),_0x149072,_0x69b2('0xa'),JSON[_0x69b2('0xd')](_0x17e973));if(_0x17e973[_0x69b2('0xe')]){if(_0x17e973[_0x69b2('0xe')][_0x69b2('0xf')]===0x1f4){logger[_0x69b2('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x149072,_0x17e973['error'][_0x69b2('0x10')]);return _0x207a99(_0x17e973[_0x69b2('0xe')][_0x69b2('0x10')]);}logger[_0x69b2('0xe')](_0x69b2('0x9'),_0x149072,_0x17e973[_0x69b2('0xe')][_0x69b2('0x10')]);return _0xb8ff13(_0x17e973[_0x69b2('0xe')][_0x69b2('0x10')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x149072,_0x69b2('0xa'));_0xb8ff13(_0x17e973[_0x69b2('0x11')][_0x69b2('0x10')]);}})[_0x69b2('0x12')](function(_0x1bd865){logger[_0x69b2('0xe')](_0x69b2('0x9'),_0x149072,_0x1bd865);_0x207a99(_0x1bd865);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 667a09b..60c863a 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 _0x2c2f=['create','put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','isAuthenticated','/:id','show','post'];(function(_0x57417c,_0x23441d){var _0xdff4f5=function(_0x4b8756){while(--_0x4b8756){_0x57417c['push'](_0x57417c['shift']());}};_0xdff4f5(++_0x23441d);}(_0x2c2f,0xb9));var _0xf2c2=function(_0x7ecbfc,_0x39da18){_0x7ecbfc=_0x7ecbfc-0x0;var _0x38bde1=_0x2c2f[_0x7ecbfc];return _0x38bde1;};'use strict';var multer=require('multer');var util=require(_0xf2c2('0x0'));var path=require(_0xf2c2('0x1'));var timeout=require('connect-timeout');var express=require(_0xf2c2('0x2'));var router=express[_0xf2c2('0x3')]();var fs_extra=require(_0xf2c2('0x4'));var auth=require(_0xf2c2('0x5'));var interaction=require(_0xf2c2('0x6'));var config=require(_0xf2c2('0x7'));var controller=require(_0xf2c2('0x8'));router[_0xf2c2('0x9')]('/',auth['isAuthenticated'](),controller[_0xf2c2('0xa')]);router[_0xf2c2('0x9')]('/describe',auth[_0xf2c2('0xb')](),controller['describe']);router['get'](_0xf2c2('0xc'),auth[_0xf2c2('0xb')](),controller[_0xf2c2('0xd')]);router[_0xf2c2('0xe')]('/',auth[_0xf2c2('0xb')](),controller[_0xf2c2('0xf')]);router[_0xf2c2('0x10')](_0xf2c2('0xc'),auth[_0xf2c2('0xb')](),controller[_0xf2c2('0x11')]);router['delete'](_0xf2c2('0xc'),auth[_0xf2c2('0xb')](),controller[_0xf2c2('0x12')]);module[_0xf2c2('0x13')]=router;
\ No newline at end of file
+var _0xf54a=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','util','path'];(function(_0x4a563b,_0x36f42d){var _0x2935ef=function(_0x32593f){while(--_0x32593f){_0x4a563b['push'](_0x4a563b['shift']());}};_0x2935ef(++_0x36f42d);}(_0xf54a,0x75));var _0xaf54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf54a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xaf54('0x0'));var util=require(_0xaf54('0x1'));var path=require(_0xaf54('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaf54('0x3')]();var fs_extra=require(_0xaf54('0x4'));var auth=require(_0xaf54('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaf54('0x6'));var controller=require(_0xaf54('0x7'));router[_0xaf54('0x8')]('/',auth[_0xaf54('0x9')](),controller[_0xaf54('0xa')]);router[_0xaf54('0x8')](_0xaf54('0xb'),auth[_0xaf54('0x9')](),controller[_0xaf54('0xc')]);router[_0xaf54('0x8')](_0xaf54('0xd'),auth[_0xaf54('0x9')](),controller[_0xaf54('0xe')]);router['post']('/',auth[_0xaf54('0x9')](),controller[_0xaf54('0xf')]);router[_0xaf54('0x10')]('/:id',auth[_0xaf54('0x9')](),controller['update']);router[_0xaf54('0x11')](_0xaf54('0xd'),auth['isAuthenticated'](),controller[_0xaf54('0x12')]);module[_0xaf54('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index d830dd5..a05ed70 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 _0xb746=['We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','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.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','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','ENUM','rounded'];(function(_0x1f4f26,_0x16c293){var _0x4e8d43=function(_0x9af0d1){while(--_0x9af0d1){_0x1f4f26['push'](_0x1f4f26['shift']());}};_0x4e8d43(++_0x16c293);}(_0xb746,0x1c8));var _0x6b74=function(_0x4ed64f,_0x681116){_0x4ed64f=_0x4ed64f-0x0;var _0x4536fd=_0xb746[_0x4ed64f];return _0x4536fd;};'use strict';var Sequelize=require(_0x6b74('0x0'));var rs=require(_0x6b74('0x1'));module['exports']={'name':{'type':Sequelize[_0x6b74('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x6b74('0x2')],'allowNull':![],'unique':_0x6b74('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x4')},'mapKeyOffline':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x4')},'key':{'type':Sequelize[_0x6b74('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x6b74('0x5')},'customerAlias':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6b74('0x2')],'allowNull':![],'defaultValue':_0x6b74('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6b74('0x2')],'allowNull':![],'defaultValue':_0x6b74('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6b74('0x2')],'allowNull':![],'defaultValue':_0x6b74('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b74('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6b74('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6b74('0x2')]},'animation':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6b74('0xa')](_0x6b74('0xb'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x6b74('0xd')},'offline_chat_button':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0xe')},'header_offline':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0xf')},'download_transcript':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6b74('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6b74('0x11')]},'closingQuestion':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6b74('0x14')},'placeholderMessage':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6b74('0x16')},'closingMessageButton':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0xe')},'skipMessageButton':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x17')},'conditionAgreement':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x18')},'ratingType':{'type':Sequelize[_0x6b74('0xa')](_0x6b74('0x19'),_0x6b74('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x6b74('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6b74('0x11')],'defaultValue':function(){return JSON[_0x6b74('0x1b')]({'items':[{'type':_0x6b74('0x1c'),'variable':null,'config':{'placeholder':_0x6b74('0x1d'),'type':'text','required':!![]},'props':{'title':_0x6b74('0x1d'),'helpText':''}},{'type':_0x6b74('0x1c'),'props':{'title':_0x6b74('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x6b74('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6b74('0x1e')](_0x6b74('0x1f'))?JSON['parse'](this[_0x6b74('0x1e')](_0x6b74('0x1f'))):{};},'set':function(_0x3dbfe8){return this['setDataValue'](_0x6b74('0x1f'),JSON['stringify'](_0x3dbfe8));}},'offlineForm':{'type':Sequelize[_0x6b74('0x11')],'defaultValue':function(){return JSON[_0x6b74('0x1b')]({'items':[{'type':'input','props':{'title':_0x6b74('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x6b74('0x4')},'variable':null},{'type':_0x6b74('0x20'),'config':{'placeholder':_0x6b74('0x21')},'props':{'title':_0x6b74('0x21'),'helpText':_0x6b74('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x6b74('0x1e')](_0x6b74('0x23'))?JSON[_0x6b74('0x24')](this['getDataValue'](_0x6b74('0x23'))):{};},'set':function(_0x585e57){return this['setDataValue']('offlineForm',JSON[_0x6b74('0x1b')](_0x585e57));}},'token':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':function(){return rs[_0x6b74('0x25')]();}},'autoclose':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6b74('0x2')]},'waitingTitle':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x27')},'offlineMessageBody':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x29')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x6b74('0x17')},'sendUnmanaged':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6b74('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6b74('0x11')],'defaultValue':function(){return _0x6b74('0x2a');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x6b74('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6b74('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x2c')},'verticalAlignment':{'type':Sequelize[_0x6b74('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x6b74('0x2e')},'defaultTitle':{'type':Sequelize[_0x6b74('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6b74('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6b74('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6b74('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x2f')},'systemAvatar':{'type':Sequelize[_0x6b74('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6b74('0x8')],'comment':_0x6b74('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3b6050){if(!_0x3b6050)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x6b74('0x31')]('mandatoryDisposition',_0x3b6050);}},'vidaooEscalation':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b74('0x32')},'vidaooNote':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':function(){return _0x6b74('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x6b74('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6b74('0x11')]}};
\ No newline at end of file
+var _0xac83=['star','thumb','stringify','input','text','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Skip','Feedback','ENUM'];(function(_0x4ef677,_0x22beb1){var _0x430cc8=function(_0x2389ab){while(--_0x2389ab){_0x4ef677['push'](_0x4ef677['shift']());}};_0x430cc8(++_0x22beb1);}(_0xac83,0x180));var _0x3ac8=function(_0x494f7f,_0x34a09b){_0x494f7f=_0x494f7f-0x0;var _0x18ebe4=_0xac83[_0x494f7f];return _0x18ebe4;};'use strict';var Sequelize=require(_0x3ac8('0x0'));var rs=require(_0x3ac8('0x1'));module[_0x3ac8('0x2')]={'name':{'type':Sequelize[_0x3ac8('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x3ac8('0x3')],'allowNull':![],'unique':_0x3ac8('0x4')},'description':{'type':Sequelize[_0x3ac8('0x3')]},'mapKey':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x3ac8('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3ac8('0x3')],'allowNull':![],'defaultValue':_0x3ac8('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3ac8('0x3')],'allowNull':![],'defaultValue':_0x3ac8('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3ac8('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3ac8('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3ac8('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3ac8('0x3')]},'animation':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x3ac8('0xa'),_0x3ac8('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x3ac8('0xc')},'start_chat_button':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x3ac8('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3ac8('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3ac8('0x10')]},'closingQuestion':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x13')},'noteTitle':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x14')},'placeholderMessage':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x3ac8('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x3ac8('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x16')},'ratingType':{'type':Sequelize[_0x3ac8('0x17')](_0x3ac8('0x18'),_0x3ac8('0x19')),'defaultValue':_0x3ac8('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x3ac8('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x3ac8('0x10')],'defaultValue':function(){return JSON[_0x3ac8('0x1a')]({'items':[{'type':_0x3ac8('0x1b'),'variable':null,'config':{'placeholder':'name','type':_0x3ac8('0x1c'),'required':!![]},'props':{'title':_0x3ac8('0x1d'),'helpText':''}},{'type':_0x3ac8('0x1b'),'props':{'title':_0x3ac8('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3ac8('0x5'),'type':_0x3ac8('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3ac8('0x1e')](_0x3ac8('0x1f'))?JSON[_0x3ac8('0x20')](this['getDataValue'](_0x3ac8('0x1f'))):{};},'set':function(_0x561292){return this[_0x3ac8('0x21')](_0x3ac8('0x1f'),JSON['stringify'](_0x561292));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x3ac8('0x1a')]({'items':[{'type':_0x3ac8('0x1b'),'props':{'title':_0x3ac8('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3ac8('0x5'),'type':_0x3ac8('0x5')},'variable':null},{'type':_0x3ac8('0x22'),'config':{'placeholder':_0x3ac8('0x23')},'props':{'title':_0x3ac8('0x23'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x3ac8('0x24'))?JSON['parse'](this[_0x3ac8('0x1e')](_0x3ac8('0x24'))):{};},'set':function(_0x4313a8){return this['setDataValue'](_0x3ac8('0x24'),JSON[_0x3ac8('0x1a')](_0x4313a8));}},'token':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':function(){return rs[_0x3ac8('0x25')]();}},'autoclose':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x3ac8('0x3')]},'forwardOffline':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3ac8('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3ac8('0x26')},'waitingMessage':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x3ac8('0x29')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x3ac8('0x15')},'sendUnmanaged':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3ac8('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3ac8('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x3ac8('0x2b');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x3ac8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3ac8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x3ac8('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x2d')},'messagesAlignment':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x3ac8('0x3')]},'customerAvatar':{'type':Sequelize[_0x3ac8('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3ac8('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3ac8('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3ac8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x2e')},'systemAvatar':{'type':Sequelize[_0x3ac8('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3ac8('0x8')],'comment':_0x3ac8('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3ac8('0x30'),'set':function(_0x86e165){if(!_0x86e165)this[_0x3ac8('0x21')]('mandatoryDispositionPauseId',null);this[_0x3ac8('0x21')](_0x3ac8('0x31'),_0x86e165);}},'vidaooEscalation':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3ac8('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':function(){return _0x3ac8('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x3ac8('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3ac8('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 13ff677..a46314c 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 _0x2376=['VIRTUAL','merge','includeAll','include','findAll','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Pause','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','addLogo','sitepic','filename','addAvatar','addCustomerAvatar','customerAvatar','file','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','existsSync','server/files/images/logos/','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','download','notify','chat','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','from','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','ChatApplication','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','priority','asc','ListId','threadId','ChatInteraction','externalUrl','interaction','contact','messageId','created','autoclose','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','ChatQueue','*,*,*,*','Start','offline','files','CompanyId','mapKeyOffline','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','NotifyMailAccount','notifyMail','addInteraction','omit','getInteractions','Contact','Owner','Tag','tag','getSnippet','getProactiveActions','../../config/license/util','virtual','custom','server/files/chat/iframe.ejs','address','origin','3.5.0','remote','headers','connection','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','ejs','fs-extra','lodash','querystring','jayson/promise','url','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APINotFoundError','handleError','../../mysqldb','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','UserProfileResource','stack','name','send','Command','format','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','catch','map','Interval','Intervals','get','all','user-agent-parser','setUA','getResult','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','model','type','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where'];(function(_0x21e71a,_0xf0b818){var _0x174f46=function(_0x2dd53e){while(--_0x2dd53e){_0x21e71a['push'](_0x21e71a['shift']());}};_0x174f46(++_0xf0b818);}(_0x2376,0x1e3));var _0x6237=function(_0x5347d5,_0x31ed96){_0x5347d5=_0x5347d5-0x0;var _0x3e1da8=_0x2376[_0x5347d5];return _0x3e1da8;};'use strict';var Mustache=require(_0x6237('0x0'));var util=require('util');var path=require('path');var ejs=require(_0x6237('0x1'));var fs=require('fs');var fs_extra=require(_0x6237('0x2'));var _=require(_0x6237('0x3'));var querystring=require(_0x6237('0x4'));var htmlToText=require('html-to-text');var Redis=require('ioredis');var jayson=require(_0x6237('0x5'));var url=require(_0x6237('0x6'));var qs=require(_0x6237('0x7'));var logger=require(_0x6237('0x8'))('api');var config=require(_0x6237('0x9'));var APIOutOfIntervalError=require(_0x6237('0xa'))['APIOutOfIntervalError'];var APINotFoundError=require(_0x6237('0xa'))[_0x6237('0xb')];var APIHandleError=require('../../errors/api')[_0x6237('0xc')];var db=require(_0x6237('0xd'))['db'];config['redis']=_[_0x6237('0xe')](config[_0x6237('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x6237('0x10'))(new Redis(config['redis']));require(_0x6237('0x11'))[_0x6237('0x12')](socket);var client=jayson[_0x6237('0x13')]['http']({'port':0x232c});var client9002=jayson[_0x6237('0x13')]['http']({'port':0x232a});var client9003=jayson['client'][_0x6237('0x14')]({'port':0x232b});var client9001=jayson[_0x6237('0x13')][_0x6237('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x330e8d,_0x57ed86,_0x215a7b,_0x202fda){return new Promise(function(_0x1c2bac,_0x41b2d3){var _0x2858a3=_0x202fda||client;return _0x2858a3[_0x6237('0x15')](_0x330e8d,_0x215a7b)[_0x6237('0x16')](function(_0x2a225f){logger[_0x6237('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x57ed86,_0x6237('0x18'));logger[_0x6237('0x19')](_0x6237('0x1a'),_0x57ed86,_0x6237('0x18'),JSON[_0x6237('0x1b')](_0x2a225f));if(_0x2a225f[_0x6237('0x1c')]){if(_0x2a225f[_0x6237('0x1c')][_0x6237('0x1d')]===0x1f4){logger[_0x6237('0x1c')](_0x6237('0x1e'),_0x57ed86,_0x2a225f['error'][_0x6237('0x1f')]);return _0x41b2d3(_0x2a225f[_0x6237('0x1c')][_0x6237('0x1f')]);}logger[_0x6237('0x1c')](_0x6237('0x1e'),_0x57ed86,_0x2a225f[_0x6237('0x1c')][_0x6237('0x1f')]);return _0x1c2bac(_0x2a225f[_0x6237('0x1c')]['message']);}else{logger[_0x6237('0x17')](_0x6237('0x1e'),_0x57ed86,_0x6237('0x18'));_0x1c2bac(_0x2a225f[_0x6237('0x20')][_0x6237('0x1f')]);}})['catch'](function(_0x4dc59b){logger[_0x6237('0x1c')](_0x6237('0x1e'),_0x57ed86,_0x4dc59b);_0x41b2d3(_0x4dc59b);});});}function respondWithStatusCode(_0x5bd6d6,_0x51864c){_0x51864c=_0x51864c||0xcc;return function(_0x176c9d){if(_0x176c9d){return _0x5bd6d6[_0x6237('0x21')](_0x51864c);}return _0x5bd6d6['status'](_0x51864c)[_0x6237('0x22')]();};}function respondWithResult(_0x4eb9d7,_0x8e072c){_0x8e072c=_0x8e072c||0xc8;return function(_0x1b8778){if(_0x1b8778){return _0x4eb9d7[_0x6237('0x23')](_0x8e072c)[_0x6237('0x24')](_0x1b8778);}};}function respondWithFilteredResult(_0x54543e,_0x6c3b78){return function(_0x906872){if(_0x906872){var _0x11b11f=typeof _0x6c3b78[_0x6237('0x25')]==='undefined'&&typeof _0x6c3b78[_0x6237('0x26')]===_0x6237('0x27');var _0x299aa1=_0x906872[_0x6237('0x28')];var _0x1e1b67=_0x11b11f?0x0:_0x6c3b78['offset'];var _0x53884a=_0x11b11f?_0x906872[_0x6237('0x28')]:_0x6c3b78['offset']+_0x6c3b78[_0x6237('0x26')];var _0x2fea19;if(_0x53884a>=_0x299aa1){_0x53884a=_0x299aa1;_0x2fea19=0xc8;}else{_0x2fea19=0xce;}_0x54543e[_0x6237('0x23')](_0x2fea19);return _0x54543e[_0x6237('0x29')](_0x6237('0x2a'),_0x1e1b67+'-'+_0x53884a+'/'+_0x299aa1)[_0x6237('0x24')](_0x906872);}return null;};}function saveUpdates(_0x4bb44){return function(_0xd0e0fb){if(_0xd0e0fb){return _0xd0e0fb[_0x6237('0x2b')](_0x4bb44)[_0x6237('0x16')](function(_0x1b707a){return _0x1b707a;});}return null;};}function removeEntity(_0x4edcf8){return function(_0x2ebaff){if(_0x2ebaff){return _0x2ebaff[_0x6237('0x2c')]()['then'](function(){var _0x47850f=_0x2ebaff['get']({'plain':!![]});var _0x325ecd='ChatWebsites';return db[_0x6237('0x2d')][_0x6237('0x2c')]({'where':{'type':_0x325ecd,'resourceId':_0x47850f['id']}})[_0x6237('0x16')](function(){return _0x2ebaff;});})['then'](function(){_0x4edcf8[_0x6237('0x23')](0xcc)[_0x6237('0x22')]();});}};}function handleEntityNotFound(_0x404e5b){return function(_0x18f133){if(!_0x18f133){_0x404e5b[_0x6237('0x21')](0x194);}return _0x18f133;};}function handleError(_0x445bfa,_0x1b531c){_0x1b531c=_0x1b531c||0x1f4;return function(_0x3ca750){logger['error'](_0x3ca750[_0x6237('0x2e')]);if(_0x3ca750[_0x6237('0x2f')]){delete _0x3ca750[_0x6237('0x2f')];}_0x445bfa[_0x6237('0x23')](_0x1b531c)[_0x6237('0x30')](_0x3ca750);};}function iftimePromise(_0x18b88f,_0x4bc608){return respondWithRpcPromise(_0x6237('0x31'),'getSnippet',{'command':_0x4bc608['timezone']?util[_0x6237('0x32')](_0x6237('0x33'),_0x18b88f[_0x6237('0x34')],_0x4bc608[_0x6237('0x35')]):util[_0x6237('0x32')](_0x6237('0x36'),_0x18b88f[_0x6237('0x34')])},client9002)[_0x6237('0x16')](function(_0x1d4a64){var _0x6abc36=_0x1d4a64&&_0x1d4a64[_0x6237('0x37')]('true')>=0x0?!![]:![];logger[_0x6237('0x17')](_0x6237('0x38'),_0x4bc608['id'],_0x18b88f['id'],_0x18b88f[_0x6237('0x34')],_0x6abc36?_0x6237('0x39'):_0x6237('0x3a'),_0x4bc608[_0x6237('0x35')]?_0x4bc608[_0x6237('0x35')]:_0x6237('0x3b'));return _0x6abc36;})[_0x6237('0x3c')](function(_0x461e4a){logger[_0x6237('0x1c')](_0x6237('0x38'),_0x4bc608['id'],_0x18b88f['id'],_0x18b88f[_0x6237('0x34')],util['inspect'](_0x461e4a,{'showHidden':![],'depth':null}),_0x4bc608[_0x6237('0x35')]?_0x4bc608[_0x6237('0x35')]:_0x6237('0x3b'));return![];});}function checkWebsiteIntervals(_0x581200){var _0x32330e=_[_0x6237('0x3d')](_0x581200[_0x6237('0x3e')][_0x6237('0x3f')],function(_0x38fb7c){var _0x15f778=_0x38fb7c[_0x6237('0x40')]({'plain':!![]});return iftimePromise(_0x15f778,_0x581200);});return Promise[_0x6237('0x41')](_0x32330e)['then'](function(_0x2c92d9){return _['some'](_0x2c92d9);});}function createInteractionObject(_0xb595d5,_0x1d2e4b,_0x403822,_0x86edc4){var _0x55811d=require(_0x6237('0x42'));var _0x377b95=new _0x55811d();var _0x4a19c3=_0x377b95[_0x6237('0x43')](_0x403822['user-agent'])[_0x6237('0x44')]();var _0x1645ab=_0x1d2e4b['customerIp'];if(_0x403822[_0x6237('0x45')]){_0x1645ab=_0x403822[_0x6237('0x45')];}else if(_0x403822[_0x6237('0x46')]){_0x1645ab=_[_0x6237('0x47')](_0x403822[_0x6237('0x46')][_0x6237('0x48')](','));}return{'ContactId':_0x86edc4['id'],'ChatWebsiteId':_0xb595d5,'from':(_0x86edc4[_0x6237('0x49')]||'')+'\x20'+(_0x86edc4[_0x6237('0x4a')]||''),'customerIp':_0x1645ab,'customerPort':_0x403822['x-real-port']?_0x403822[_0x6237('0x4b')]:null,'referer':_0x1d2e4b[_0x6237('0x4c')],'browserName':_0x4a19c3[_0x6237('0x4d')][_0x6237('0x2f')]&&_0x4a19c3['browser'][_0x6237('0x4e')]?util[_0x6237('0x32')](_0x6237('0x4f'),_0x4a19c3[_0x6237('0x4d')][_0x6237('0x2f')],_0x4a19c3[_0x6237('0x4d')]['version']):'unknown','browserVersion':_0x4a19c3[_0x6237('0x4d')][_0x6237('0x4e')]||_0x6237('0x50'),'osName':util['format']('%s\x20%s',_0x4a19c3['os'][_0x6237('0x2f')],_0x4a19c3['os'][_0x6237('0x4e')]),'osVersion':_0x4a19c3['os'][_0x6237('0x4e')],'deviceModel':_0x4a19c3[_0x6237('0x51')]['model']&&_0x4a19c3[_0x6237('0x51')][_0x6237('0x52')]?util[_0x6237('0x32')](_0x6237('0x53'),_0x4a19c3['device'][_0x6237('0x54')],_0x4a19c3[_0x6237('0x51')]['vendor'],_0x4a19c3[_0x6237('0x51')][_0x6237('0x55')]):null,'deviceVendor':_0x4a19c3['device']['vendor'],'deviceType':_0x4a19c3[_0x6237('0x51')]['type'],'formData':JSON[_0x6237('0x1b')](_0x1d2e4b)};}exports[_0x6237('0x56')]=function(_0xb6875a,_0x392ad6){var _0x199744={'include':[{'model':db['Pause'],'as':_0x6237('0x57')}]},_0xe38cfb={},_0x3bdaa2={'count':0x0,'rows':[]};var _0x5422dc=_[_0x6237('0x3d')](db[_0x6237('0x58')][_0x6237('0x59')],function(_0x318351){return{'name':_0x318351[_0x6237('0x5a')],'type':_0x318351['type'][_0x6237('0x5b')]};});_0xe38cfb[_0x6237('0x54')]=_[_0x6237('0x3d')](_0x5422dc,_0x6237('0x2f'));_0xe38cfb[_0x6237('0x5c')]=_[_0x6237('0x5d')](_0xb6875a[_0x6237('0x5c')]);_0xe38cfb[_0x6237('0x5e')]=_[_0x6237('0x5f')](_0xe38cfb[_0x6237('0x54')],_0xe38cfb[_0x6237('0x5c')]);_0x199744[_0x6237('0x60')]=_[_0x6237('0x5f')](_0xe38cfb[_0x6237('0x54')],qs[_0x6237('0x61')](_0xb6875a[_0x6237('0x5c')]['fields']));_0x199744[_0x6237('0x60')]=_0x199744['attributes'][_0x6237('0x62')]?_0x199744['attributes']:_0xe38cfb[_0x6237('0x54')];if(!_0xb6875a[_0x6237('0x5c')]['hasOwnProperty'](_0x6237('0x63'))){_0x199744['limit']=qs['limit'](_0xb6875a[_0x6237('0x5c')][_0x6237('0x26')]);_0x199744['offset']=qs[_0x6237('0x25')](_0xb6875a[_0x6237('0x5c')][_0x6237('0x25')]);}_0x199744[_0x6237('0x64')]=qs[_0x6237('0x65')](_0xb6875a[_0x6237('0x5c')][_0x6237('0x65')]);_0x199744['where']=qs[_0x6237('0x5e')](_[_0x6237('0x66')](_0xb6875a[_0x6237('0x5c')],_0xe38cfb['filters']),_0x5422dc);if(_0xb6875a[_0x6237('0x5c')][_0x6237('0x67')]){_0x199744[_0x6237('0x68')]=_['merge'](_0x199744[_0x6237('0x68')],{'$or':_[_0x6237('0x3d')](_0x5422dc,function(_0x3597a8){if(_0x3597a8[_0x6237('0x55')]!==_0x6237('0x69')){var _0x3e53fa={};_0x3e53fa[_0x3597a8['name']]={'$like':'%'+_0xb6875a[_0x6237('0x5c')][_0x6237('0x67')]+'%'};return _0x3e53fa;}})});}_0x199744=_[_0x6237('0x6a')]({},_0x199744,_0xb6875a['options']);var _0x2de065={'where':_0x199744[_0x6237('0x68')]};return db[_0x6237('0x58')][_0x6237('0x28')](_0x2de065)[_0x6237('0x16')](function(_0x5803e2){_0x3bdaa2[_0x6237('0x28')]=_0x5803e2;if(_0xb6875a[_0x6237('0x5c')][_0x6237('0x6b')]){_0x199744[_0x6237('0x6c')]=[{'all':!![]}];}return db[_0x6237('0x58')][_0x6237('0x6d')](_0x199744);})[_0x6237('0x16')](function(_0x118c46){_0x3bdaa2['rows']=_0x118c46;return _0x3bdaa2;})['then'](respondWithFilteredResult(_0x392ad6,_0x199744))[_0x6237('0x3c')](handleError(_0x392ad6,null));};exports[_0x6237('0x6e')]=function(_0x22e637,_0x35a91f){var _0x259254={'raw':![],'where':{'id':_0x22e637[_0x6237('0x6f')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2ff92f={};_0x2ff92f[_0x6237('0x54')]=_[_0x6237('0x5d')](db['ChatWebsite'][_0x6237('0x59')]);_0x2ff92f['query']=_[_0x6237('0x5d')](_0x22e637[_0x6237('0x5c')]);_0x2ff92f[_0x6237('0x5e')]=_[_0x6237('0x5f')](_0x2ff92f[_0x6237('0x54')],_0x2ff92f[_0x6237('0x5c')]);_0x259254['attributes']=_[_0x6237('0x5f')](_0x2ff92f[_0x6237('0x54')],qs[_0x6237('0x61')](_0x22e637[_0x6237('0x5c')]['fields']));_0x259254[_0x6237('0x60')]=_0x259254['attributes'][_0x6237('0x62')]?_0x259254[_0x6237('0x60')]:_0x2ff92f[_0x6237('0x54')];if(_0x22e637['query']['includeAll']){_0x259254[_0x6237('0x6c')]=[{'all':!![]}];}_0x259254=_[_0x6237('0x6a')]({},_0x259254,_0x22e637[_0x6237('0x70')]);return db[_0x6237('0x58')][_0x6237('0x71')](_0x259254)[_0x6237('0x16')](handleEntityNotFound(_0x35a91f,null))[_0x6237('0x16')](respondWithResult(_0x35a91f,null))[_0x6237('0x3c')](handleError(_0x35a91f,null));};exports[_0x6237('0x72')]=function(_0x107715,_0x1dd0db){return db[_0x6237('0x58')][_0x6237('0x72')](_0x107715[_0x6237('0x73')],{})[_0x6237('0x16')](function(_0x52c435){var _0x15a89c=_0x107715[_0x6237('0x74')][_0x6237('0x40')]({'plain':!![]});if(!_0x15a89c)throw new Error(_0x6237('0x75'));if(_0x15a89c['role']===_0x6237('0x74')){var _0xc39592=_0x52c435[_0x6237('0x40')]({'plain':!![]});var _0x250817='ChatWebsites';return db[_0x6237('0x76')][_0x6237('0x71')]({'where':{'name':_0x250817,'userProfileId':_0x15a89c[_0x6237('0x77')]},'raw':!![]})[_0x6237('0x16')](function(_0x41a9cf){if(_0x41a9cf&&_0x41a9cf[_0x6237('0x78')]===0x0){return db['UserProfileResource']['create']({'name':_0xc39592['name'],'resourceId':_0xc39592['id'],'type':_0x41a9cf[_0x6237('0x2f')],'sectionId':_0x41a9cf['id']},{})[_0x6237('0x16')](function(){return _0x52c435;});}else{return _0x52c435;}})[_0x6237('0x3c')](function(_0x348a0c){logger[_0x6237('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x348a0c);throw _0x348a0c;});}return _0x52c435;})[_0x6237('0x16')](respondWithResult(_0x1dd0db,0xc9))[_0x6237('0x3c')](handleError(_0x1dd0db,null));};exports[_0x6237('0x2b')]=function(_0x322008,_0x2777a){if(_0x322008[_0x6237('0x73')]['id']){delete _0x322008[_0x6237('0x73')]['id'];}return db['ChatWebsite'][_0x6237('0x71')]({'where':{'id':_0x322008[_0x6237('0x6f')]['id']},'include':[{'model':db[_0x6237('0x79')],'as':_0x6237('0x57')}]})[_0x6237('0x16')](handleEntityNotFound(_0x2777a,null))['then'](saveUpdates(_0x322008[_0x6237('0x73')],null))[_0x6237('0x16')](respondWithResult(_0x2777a,null))[_0x6237('0x3c')](handleError(_0x2777a,null));};exports[_0x6237('0x2c')]=function(_0x460a7d,_0x4182e4){return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x460a7d[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x4182e4,null))['then'](removeEntity(_0x4182e4,null))['catch'](handleError(_0x4182e4,null));};exports['describe']=function(_0x11ace7,_0x27fdef){return db[_0x6237('0x58')]['describe']()['then'](respondWithResult(_0x27fdef,null))['catch'](handleError(_0x27fdef,null));};exports[_0x6237('0x7a')]=function(_0x323381,_0x42b071){if(_0x323381['body']['id']){delete _0x323381[_0x6237('0x73')]['id'];}return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x323381[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x42b071,null))[_0x6237('0x16')](function(_0x5c789c){if(_0x5c789c){_0x323381['body'][_0x6237('0x7b')]=_0x5c789c['id'];return db[_0x6237('0x7c')][_0x6237('0x72')](_0x323381[_0x6237('0x73')]);}})[_0x6237('0x16')](respondWithResult(_0x42b071,null))[_0x6237('0x3c')](handleError(_0x42b071,null));};exports[_0x6237('0x7d')]=function(_0x466d79,_0x56aeda){var _0x16f99d={'raw':![],'where':{}};var _0x396f82={};var _0x1b7885={'count':0x0,'rows':[]};return db[_0x6237('0x58')][_0x6237('0x7e')]({'where':{'id':_0x466d79[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x56aeda,null))['then'](function(_0x1486c5){if(_0x1486c5){_0x396f82['model']=_[_0x6237('0x5d')](db[_0x6237('0x7c')]['rawAttributes']);_0x396f82[_0x6237('0x5c')]=_['keys'](_0x466d79[_0x6237('0x5c')]);_0x396f82[_0x6237('0x5e')]=_['intersection'](_0x396f82[_0x6237('0x54')],_0x396f82[_0x6237('0x5c')]);_0x16f99d[_0x6237('0x60')]=_[_0x6237('0x5f')](_0x396f82['model'],qs[_0x6237('0x61')](_0x466d79['query'][_0x6237('0x61')]));_0x16f99d['attributes']=_0x16f99d[_0x6237('0x60')]['length']?_0x16f99d[_0x6237('0x60')]:_0x396f82[_0x6237('0x54')];if(!_0x466d79[_0x6237('0x5c')]['hasOwnProperty'](_0x6237('0x63'))){_0x16f99d['limit']=qs[_0x6237('0x26')](_0x466d79['query']['limit']);_0x16f99d[_0x6237('0x25')]=qs[_0x6237('0x25')](_0x466d79[_0x6237('0x5c')]['offset']);}_0x16f99d[_0x6237('0x64')]=qs[_0x6237('0x65')](_0x466d79[_0x6237('0x5c')][_0x6237('0x65')]);_0x16f99d['where']=qs[_0x6237('0x5e')](_[_0x6237('0x66')](_0x466d79['query'],_0x396f82['filters']));_0x16f99d['where'][_0x6237('0x7b')]=_0x1486c5['id'];if(_0x466d79[_0x6237('0x5c')][_0x6237('0x67')]){_0x16f99d[_0x6237('0x68')]=_[_0x6237('0x6a')](_0x16f99d['where'],{'$or':_['map'](_0x16f99d[_0x6237('0x60')],function(_0x21a6a6){var _0x28688c={};_0x28688c[_0x21a6a6]={'$like':'%'+_0x466d79[_0x6237('0x5c')]['filter']+'%'};return _0x28688c;})});}_0x16f99d=_['merge']({},_0x16f99d,_0x466d79[_0x6237('0x70')]);return db[_0x6237('0x7c')][_0x6237('0x28')]({'where':_0x16f99d[_0x6237('0x68')]})['then'](function(_0x23a7b5){_0x1b7885[_0x6237('0x28')]=_0x23a7b5;if(_0x466d79[_0x6237('0x5c')][_0x6237('0x6b')]){_0x16f99d[_0x6237('0x6c')]=[{'all':!![]}];}return db[_0x6237('0x7c')][_0x6237('0x6d')](_0x16f99d);})[_0x6237('0x16')](function(_0x337296){_0x1b7885[_0x6237('0x7f')]=_0x337296;return _0x1b7885;});}})[_0x6237('0x16')](respondWithFilteredResult(_0x56aeda,_0x16f99d))[_0x6237('0x3c')](handleError(_0x56aeda,null));};exports[_0x6237('0x80')]=function(_0x1ccded,_0x57f581){return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x1ccded[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x57f581,null))[_0x6237('0x16')](function(_0x17ed0f){if(_0x17ed0f){return _0x17ed0f[_0x6237('0x80')](_0x1ccded[_0x6237('0x5c')][_0x6237('0x81')]);}})[_0x6237('0x16')](respondWithStatusCode(_0x57f581,null))['catch'](handleError(_0x57f581,null));};exports[_0x6237('0x82')]=function(_0x5c8595,_0x274463){if(_0x5c8595['body']['id']){delete _0x5c8595[_0x6237('0x73')]['id'];}return db['ChatWebsite'][_0x6237('0x71')]({'where':{'id':_0x5c8595[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x274463,null))['then'](function(_0x122025){if(_0x122025){_0x5c8595[_0x6237('0x73')][_0x6237('0x7b')]=_0x122025['id'];return db[_0x6237('0x83')][_0x6237('0x72')](_0x5c8595[_0x6237('0x73')]);}})[_0x6237('0x16')](respondWithResult(_0x274463,null))[_0x6237('0x3c')](handleError(_0x274463,null));};exports[_0x6237('0x84')]=function(_0x4e14a6,_0x4a53a1){var _0x89480f={'raw':![],'where':{}};var _0x1e6ed4={};var _0x31acda={'count':0x0,'rows':[]};return db[_0x6237('0x58')][_0x6237('0x7e')]({'where':{'id':_0x4e14a6[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x4a53a1,null))[_0x6237('0x16')](function(_0x22d7c8){if(_0x22d7c8){_0x1e6ed4[_0x6237('0x54')]=_[_0x6237('0x5d')](db['CannedAnswer']['rawAttributes']);_0x1e6ed4[_0x6237('0x5c')]=_[_0x6237('0x5d')](_0x4e14a6[_0x6237('0x5c')]);_0x1e6ed4[_0x6237('0x5e')]=_[_0x6237('0x5f')](_0x1e6ed4[_0x6237('0x54')],_0x1e6ed4[_0x6237('0x5c')]);_0x89480f[_0x6237('0x60')]=_[_0x6237('0x5f')](_0x1e6ed4[_0x6237('0x54')],qs[_0x6237('0x61')](_0x4e14a6[_0x6237('0x5c')][_0x6237('0x61')]));_0x89480f['attributes']=_0x89480f[_0x6237('0x60')][_0x6237('0x62')]?_0x89480f[_0x6237('0x60')]:_0x1e6ed4[_0x6237('0x54')];if(!_0x4e14a6[_0x6237('0x5c')][_0x6237('0x85')]('nolimit')){_0x89480f[_0x6237('0x26')]=qs[_0x6237('0x26')](_0x4e14a6[_0x6237('0x5c')][_0x6237('0x26')]);_0x89480f[_0x6237('0x25')]=qs[_0x6237('0x25')](_0x4e14a6[_0x6237('0x5c')][_0x6237('0x25')]);}_0x89480f['order']=qs[_0x6237('0x65')](_0x4e14a6[_0x6237('0x5c')][_0x6237('0x65')]);_0x89480f[_0x6237('0x68')]=qs[_0x6237('0x5e')](_[_0x6237('0x66')](_0x4e14a6[_0x6237('0x5c')],_0x1e6ed4[_0x6237('0x5e')]));_0x89480f[_0x6237('0x68')]['ChatWebsiteId']=_0x22d7c8['id'];if(_0x4e14a6[_0x6237('0x5c')][_0x6237('0x67')]){_0x89480f['where']=_[_0x6237('0x6a')](_0x89480f['where'],{'$or':_[_0x6237('0x3d')](_0x89480f[_0x6237('0x60')],function(_0x2aa28a){var _0x4c6c4a={};_0x4c6c4a[_0x2aa28a]={'$like':'%'+_0x4e14a6['query']['filter']+'%'};return _0x4c6c4a;})});}_0x89480f=_[_0x6237('0x6a')]({},_0x89480f,_0x4e14a6[_0x6237('0x70')]);return db[_0x6237('0x83')]['count']({'where':_0x89480f[_0x6237('0x68')]})['then'](function(_0x1c3774){_0x31acda['count']=_0x1c3774;if(_0x4e14a6[_0x6237('0x5c')][_0x6237('0x6b')]){_0x89480f['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x6237('0x6d')](_0x89480f);})['then'](function(_0x22ac7d){_0x31acda[_0x6237('0x7f')]=_0x22ac7d;return _0x31acda;});}})[_0x6237('0x16')](respondWithFilteredResult(_0x4a53a1,_0x89480f))[_0x6237('0x3c')](handleError(_0x4a53a1,null));};exports[_0x6237('0x86')]=function(_0xf6815,_0x45d977){return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0xf6815[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x45d977,null))[_0x6237('0x16')](function(_0x286513){if(_0x286513){return _0x286513[_0x6237('0x86')](_0xf6815[_0x6237('0x5c')][_0x6237('0x81')]);}})['then'](respondWithStatusCode(_0x45d977,null))['catch'](handleError(_0x45d977,null));};exports[_0x6237('0x87')]=function(_0x35f723,_0x3a2dee){_0x35f723['body'][_0x6237('0x88')]=_0x35f723['file'][_0x6237('0x89')];return db['ChatWebsite'][_0x6237('0x71')]({'where':{'id':_0x35f723[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x3a2dee,null))['then'](saveUpdates(_0x35f723['body'],null))[_0x6237('0x16')](respondWithResult(_0x3a2dee,null))[_0x6237('0x3c')](handleError(_0x3a2dee,null));};exports[_0x6237('0x8a')]=function(_0x58823a,_0x897cd1){_0x58823a[_0x6237('0x73')]['agentAvatar']=_0x58823a['file']['filename'];return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x58823a[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x897cd1,null))['then'](saveUpdates(_0x58823a[_0x6237('0x73')],null))['then'](respondWithResult(_0x897cd1,null))['catch'](handleError(_0x897cd1,null));};exports[_0x6237('0x8b')]=function(_0x2b6549,_0x297609){_0x2b6549['body'][_0x6237('0x8c')]=_0x2b6549[_0x6237('0x8d')][_0x6237('0x89')];return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x2b6549[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x297609,null))[_0x6237('0x16')](saveUpdates(_0x2b6549[_0x6237('0x73')],null))[_0x6237('0x16')](respondWithResult(_0x297609,null))['catch'](handleError(_0x297609,null));};exports['addSystemAvatar']=function(_0x1fe62a,_0x10e1f3){_0x1fe62a[_0x6237('0x73')][_0x6237('0x8e')]=_0x1fe62a[_0x6237('0x8d')][_0x6237('0x89')];return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x1fe62a[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x10e1f3,null))[_0x6237('0x16')](saveUpdates(_0x1fe62a[_0x6237('0x73')],null))[_0x6237('0x16')](respondWithResult(_0x10e1f3,null))[_0x6237('0x3c')](handleError(_0x10e1f3,null));};exports[_0x6237('0x8f')]=function(_0x362fe3,_0x5efcef){var _0x11a5a6=path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0x92'));var _0x3ac902={'where':{'id':_0x362fe3[_0x6237('0x6f')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x1ad886=![];return require('../../config/license/util')[_0x6237('0x93')]()[_0x6237('0x16')](function(_0xc2e95e){if(_0xc2e95e){_0x1ad886=_0xc2e95e['custom'];}})['then'](function(){return db[_0x6237('0x58')]['find'](_0x3ac902);})[_0x6237('0x16')](handleEntityNotFound(_0x5efcef,null))['then'](function(_0x169d28){if(_0x169d28){if(!_[_0x6237('0x94')](_0x169d28['sitepic'])){if(fs[_0x6237('0x95')](path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0x96'),_0x169d28[_0x6237('0x88')]))&&_0x1ad886){_0x11a5a6=path['join'](config[_0x6237('0x91')],_0x6237('0x96'),_0x169d28[_0x6237('0x88')]);}}return _0x5efcef['download'](_0x11a5a6);}})[_0x6237('0x3c')](handleError(_0x5efcef,null));};exports['getAvatar']=function(_0x77fb4e,_0x59fd7e){var _0x3d5097=path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0x97'));var _0x5e585f={'where':{'id':_0x77fb4e[_0x6237('0x6f')]['id']},'attributes':['id',_0x6237('0x98')],'raw':!![]};return db['ChatWebsite'][_0x6237('0x71')](_0x5e585f)[_0x6237('0x16')](handleEntityNotFound(_0x59fd7e,null))[_0x6237('0x16')](function(_0x57a85d){if(_0x57a85d){if(!_['isNil'](_0x57a85d[_0x6237('0x98')])){if(fs[_0x6237('0x95')](path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0x99'),_0x57a85d[_0x6237('0x98')]))){_0x3d5097=path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0x99'),_0x57a85d[_0x6237('0x98')]);}}return _0x59fd7e['download'](_0x3d5097);}})[_0x6237('0x3c')](handleError(_0x59fd7e,null));};exports[_0x6237('0x9a')]=function(_0x5982d0,_0x83567f){var _0x35a167=path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0x9b'));var _0x209ff4={'where':{'id':_0x5982d0['params']['id']},'attributes':['id',_0x6237('0x8c'),_0x6237('0x9c')],'raw':!![]};return db[_0x6237('0x58')][_0x6237('0x71')](_0x209ff4)[_0x6237('0x16')](handleEntityNotFound(_0x83567f,null))[_0x6237('0x16')](function(_0x1e1835){if(_0x1e1835){if(!_[_0x6237('0x94')](_0x1e1835[_0x6237('0x8c')])){if(fs[_0x6237('0x95')](path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0x99'),_0x1e1835[_0x6237('0x8c')]))&&_0x1e1835[_0x6237('0x9c')]){_0x35a167=path[_0x6237('0x90')](config['root'],_0x6237('0x99'),_0x1e1835[_0x6237('0x8c')]);}}return _0x83567f['download'](_0x35a167);}})[_0x6237('0x3c')](handleError(_0x83567f,null));};exports['getSystemAvatar']=function(_0x1520b5,_0x5c71b5){var _0xa62ad4=path['join'](config[_0x6237('0x91')],_0x6237('0x9d'));var _0x3e37b9={'where':{'id':_0x1520b5[_0x6237('0x6f')]['id']},'attributes':['id',_0x6237('0x8e')],'raw':!![]};return db[_0x6237('0x58')][_0x6237('0x71')](_0x3e37b9)[_0x6237('0x16')](handleEntityNotFound(_0x5c71b5,null))['then'](function(_0x1b281f){if(_0x1b281f){if(!_['isNil'](_0x1b281f[_0x6237('0x8e')])){if(fs[_0x6237('0x95')](path[_0x6237('0x90')](config[_0x6237('0x91')],'server/files/images/avatars/',_0x1b281f[_0x6237('0x8e')]))){_0xa62ad4=path[_0x6237('0x90')](config[_0x6237('0x91')],'server/files/images/avatars/',_0x1b281f[_0x6237('0x8e')]);}}return _0x5c71b5[_0x6237('0x9e')](_0xa62ad4);}})[_0x6237('0x3c')](handleError(_0x5c71b5,null));};exports[_0x6237('0x9f')]=function(_0x53ea1b,_0x88623e){var _0x1a4755={'body':_0x53ea1b[_0x6237('0x73')],'channel':_0x6237('0xa0')};var _0x1ab052=[];var _0x5af553=[];var _0x44d3b9={};var _0x1706fa=![];return db[_0x6237('0xa1')][_0x6237('0xa2')]()[_0x6237('0x16')](function(_0x4b2d3a){if(!_0x4b2d3a){throw new db[(_0x6237('0xa3'))]['ValidationError'](_0x6237('0xa4'));}_0x1ab052=_[_0x6237('0xa5')](_['keys'](_0x4b2d3a),[_0x6237('0xa6'),_0x6237('0xa7')]);_0x5af553=_[_0x6237('0xa5')](_['keys'](_0x4b2d3a),[_0x6237('0xa6'),'updatedAt','CompanyId','ListId']);if(_0x53ea1b['body']['id']){delete _0x53ea1b[_0x6237('0x73')]['id'];}if(_[_0x6237('0x94')](_0x53ea1b[_0x6237('0x73')][_0x6237('0xa8')])){throw new db[(_0x6237('0xa3'))][(_0x6237('0xa9'))](_0x6237('0xaa'));}if(_[_0x6237('0x94')](_0x53ea1b[_0x6237('0x73')]['body'])||_0x53ea1b['body']['body']===''){throw new db[(_0x6237('0xa3'))][(_0x6237('0xa9'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6237('0x94')](_0x53ea1b[_0x6237('0x73')][_0x6237('0xab')])){throw new db[(_0x6237('0xa3'))]['ValidationError'](_0x6237('0xac')+_0x5af553);}if(!_['includes'](_0x5af553,_0x53ea1b[_0x6237('0x73')][_0x6237('0xab')])){throw new db[(_0x6237('0xa3'))][(_0x6237('0xa9'))](_0x6237('0xad')+_0x5af553);}_0x44d3b9[_0x53ea1b[_0x6237('0x73')]['mapKey']]=_0x53ea1b[_0x6237('0x73')][_0x6237('0xa8')];})[_0x6237('0x16')](function(){return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x53ea1b['params']['id']},'include':[{'model':db['CmList'],'as':_0x6237('0xae'),'include':[{'model':db[_0x6237('0xa1')],'as':_0x6237('0xaf'),'where':_0x44d3b9,'limit':0x1,'order':[[_0x6237('0xa7'),'DESC']]}]},{'model':db[_0x6237('0xb0')],'as':_0x6237('0xb1')},{'model':db[_0x6237('0x3e')],'as':'Interval','include':[{'model':db[_0x6237('0x3e')],'as':_0x6237('0x3f'),'attributes':['id',_0x6237('0x34')],'raw':!![]}]}]});})[_0x6237('0x16')](function(_0x3bf0d3){if(!_0x3bf0d3)throw new APINotFoundError(util['format'](_0x6237('0xb2'),_0x53ea1b['params']['id']));if(!_0x3bf0d3[_0x6237('0x3e')]||!_0x3bf0d3[_0x6237('0x3e')]['Intervals'])return[_0x3bf0d3,!![]];return[_0x3bf0d3,checkWebsiteIntervals(_0x3bf0d3)];})[_0x6237('0xb3')](function(_0x545222,_0x307bcf){if(!_0x307bcf)throw new APIOutOfIntervalError();if(!_0x545222[_0x6237('0xae')])return;_0x1a4755[_0x6237('0xb4')]=_0x545222;_0x1a4755[_0x6237('0xb5')]=_0x545222[_0x6237('0xae')];_0x1a4755[_0x6237('0xb6')]=_[_0x6237('0xb7')](_0x545222['Applications'],[_0x6237('0xb8')],[_0x6237('0xb9')]);if(_0x1a4755[_0x6237('0xb4')][_0x6237('0xb1')]){delete _0x1a4755['account']['Applications'];}if(_0x1a4755[_0x6237('0xb4')][_0x6237('0xae')]&&_0x1a4755[_0x6237('0xb4')][_0x6237('0xae')][_0x6237('0xaf')][_0x6237('0x62')]){return _0x1a4755[_0x6237('0xb4')][_0x6237('0xae')][_0x6237('0xaf')][0x0];}var _0x454f29=_[_0x6237('0xe')](_0x53ea1b[_0x6237('0x73')],{'firstName':_0x53ea1b[_0x6237('0x73')]['from'],'ListId':_0x545222[_0x6237('0xba')]});_0x454f29[_0x53ea1b[_0x6237('0x73')]['mapKey']]=_0x53ea1b[_0x6237('0x73')][_0x6237('0xa8')];return db['CmContact'][_0x6237('0x72')](_0x454f29,{'fields':_0x1ab052,'raw':!![]});})[_0x6237('0x16')](function(_0xe4fbf2){_0x1a4755['contact']=_0xe4fbf2;var _0x4d7d8d=createInteractionObject(_0x53ea1b[_0x6237('0x6f')]['id'],_0x53ea1b[_0x6237('0x73')],_0x53ea1b['headers'],_0xe4fbf2);var _0x23f4c0={'ChatWebsiteId':_0x53ea1b['params']['id'],'closed':![]};if(_0x53ea1b[_0x6237('0x73')][_0x6237('0xbb')]){_0x23f4c0[_0x6237('0xbb')]=_0x53ea1b[_0x6237('0x73')]['threadId'];return db[_0x6237('0xbc')][_0x6237('0x71')]({'where':_0x23f4c0})['then'](function(_0x3e25a2){if(_0x3e25a2){_0x1706fa=!![];return _0x3e25a2;}_0x4d7d8d[_0x6237('0xbb')]=_0x53ea1b[_0x6237('0x73')]['threadId'];_0x4d7d8d[_0x6237('0xbd')]=_0x53ea1b[_0x6237('0x73')][_0x6237('0xbd')];return db['ChatInteraction'][_0x6237('0x72')](_0x4d7d8d);});}_0x23f4c0['ContactId']=_0xe4fbf2['id'];if(_0x53ea1b[_0x6237('0x73')][_0x6237('0xbe')]&&_0x53ea1b[_0x6237('0x73')][_0x6237('0xbe')]['id']){_0x23f4c0['id']=_0x53ea1b[_0x6237('0x73')][_0x6237('0xbe')]['id'];return db['ChatInteraction'][_0x6237('0x71')]({'where':_0x23f4c0})[_0x6237('0x16')](function(_0x533a06){if(_0x533a06){_0x1706fa=!![];return _0x533a06;}return db[_0x6237('0xbc')][_0x6237('0x72')](_0x4d7d8d);});}return db[_0x6237('0xbc')][_0x6237('0x72')](_0x4d7d8d);})[_0x6237('0x16')](function(_0x3852ff){if(!_0x1706fa)return _0x3852ff;var _0x377541={'from':(_0x1a4755[_0x6237('0xbf')][_0x6237('0x49')]||'')+'\x20'+(_0x1a4755['contact'][_0x6237('0x4a')]||'')};if(_0x53ea1b['body'][_0x6237('0xbb')]&&_0x53ea1b[_0x6237('0x73')][_0x6237('0xc0')]&&_0x53ea1b[_0x6237('0x73')][_0x6237('0xbb')]!=_0x53ea1b[_0x6237('0x73')][_0x6237('0xc0')]){_0x377541[_0x6237('0xbb')]=_0x53ea1b[_0x6237('0x73')][_0x6237('0xc0')];}return _0x3852ff[_0x6237('0x2b')](_0x377541);})[_0x6237('0x16')](function(_0x1752ef){_0x1a4755['interaction']=_0x1752ef[_0x6237('0x40')]({'plain':!![]});_0x1a4755[_0x6237('0xbe')][_0x6237('0xc1')]=!_0x1706fa;if(_0x1a4755[_0x6237('0xbe')][_0x6237('0xc1')]){if(_0x1a4755[_0x6237('0xb4')][_0x6237('0xc2')]){_0x1a4755[_0x6237('0xb6')]['push']({'id':0x0,'priority':_0x1a4755[_0x6237('0xb6')][_0x6237('0x62')]+0x1,'app':'close','appdata':_0x6237('0xc3'),'interval':'*,*,*,*'});}}return db[_0x6237('0xc4')][_0x6237('0x72')]({'body':_0x53ea1b['body'][_0x6237('0x73')],'ChatWebsiteId':_0x53ea1b[_0x6237('0x6f')]['id'],'ChatInteractionId':_0x1752ef['id'],'direction':'in','ContactId':_0x1a4755[_0x6237('0xbf')]['id'],'AttachmentId':_0x53ea1b[_0x6237('0x73')][_0x6237('0xc5')]});})[_0x6237('0x16')](function(_0xdcdb1){_0x1a4755[_0x6237('0x1f')]=_0xdcdb1;if(!_0x1a4755[_0x6237('0xbe')][_0x6237('0xc6')]){return;}return db[_0x6237('0xc7')]['find']({'attributes':['id',_0x6237('0x2f')],'where':{'id':_0x1a4755[_0x6237('0xbe')]['UserId']}});})[_0x6237('0x16')](function(_0x226cfb){if(_0x226cfb){_0x1a4755[_0x6237('0xb6')][_0x6237('0xc8')]({'id':0x0,'priority':0x0,'app':_0x6237('0xc9'),'appdata':_0x226cfb[_0x6237('0x2f')]+','+(_0x1a4755['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x1a4755[_0x6237('0xca')]=!![];}if(!_0x1a4755['interaction']['queueId']){return;}return db[_0x6237('0xcb')][_0x6237('0x71')]({'attributes':['id',_0x6237('0x2f')],'where':{'id':_0x1a4755[_0x6237('0xbe')]['queueId']}});})[_0x6237('0x16')](function(_0xf148de){if(_0xf148de){_0x1a4755[_0x6237('0xb6')][_0x6237('0xc8')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0xf148de[_0x6237('0x2f')]+','+(_0x1a4755['account']['waitForTheAssignedQueue']||0x12c),'interval':_0x6237('0xcc')});}return respondWithRpcPromise(_0x6237('0xcd'),'startRouting',_0x1a4755);})['then'](function(_0x536c1f){respondWithRpcPromise('EventManager','EventManager',{'event':_0x6237('0x9f'),'message':_0x536c1f},client9002);return _0x536c1f;})[_0x6237('0x16')](respondWithResult(_0x88623e,null))['catch'](APIHandleError(_0x88623e));};exports[_0x6237('0xce')]=function(_0xee4ac3,_0x4b64d3){var _0x3de1f8,_0x4d13fb,_0x40dbde;var _0x4977c6=[];var _0x4d7ae6={};var _0x3f2b16=_0xee4ac3[_0x6237('0xcf')]||[];var _0xab4c9c=[];var _0x593ebb;return db[_0x6237('0xa1')][_0x6237('0xa2')]()[_0x6237('0x16')](function(_0x385356){if(!_0x385356){throw new db[(_0x6237('0xa3'))]['ValidationError'](_0x6237('0xa4'));}_0x4977c6=_[_0x6237('0xa5')](_[_0x6237('0x5d')](_0x385356),[_0x6237('0xa6'),'updatedAt',_0x6237('0xd0'),_0x6237('0xba')]);if(_0xee4ac3['body']['id']){delete _0xee4ac3[_0x6237('0x73')]['id'];}if(_[_0x6237('0x94')](_0xee4ac3[_0x6237('0x73')][_0x6237('0xa8')])){throw _0x4b64d3[_0x6237('0x23')](0x1f4)['send'](new db[(_0x6237('0xa3'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x6237('0x94')](_0xee4ac3[_0x6237('0x73')][_0x6237('0x73')])||_0xee4ac3['body'][_0x6237('0x73')]===''){throw _0x4b64d3[_0x6237('0x23')](0x1f4)['send'](new db[(_0x6237('0xa3'))][(_0x6237('0xa9'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x6237('0x94')](_0xee4ac3[_0x6237('0x73')][_0x6237('0xd1')])){throw _0x4b64d3[_0x6237('0x23')](0x1f4)[_0x6237('0x30')](new db[(_0x6237('0xa3'))][(_0x6237('0xa9'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4977c6));}if(!_[_0x6237('0xd2')](_0x4977c6,_0xee4ac3['body'][_0x6237('0xd1')])){throw _0x4b64d3[_0x6237('0x23')](0x1f4)['send'](new db[(_0x6237('0xa3'))][(_0x6237('0xa9'))](_0x6237('0xd3')+_0x4977c6));}_0x4d7ae6[_0xee4ac3[_0x6237('0x73')][_0x6237('0xd1')]]=_0xee4ac3['body'][_0x6237('0xa8')];})[_0x6237('0x16')](function(){return db['ChatWebsite'][_0x6237('0x71')]({'where':{'id':_0xee4ac3[_0x6237('0x6f')]['id']},'include':[{'model':db['CmList'],'as':_0x6237('0xae')},{'model':db[_0x6237('0xd4')],'as':_0x6237('0xd4')}]});})[_0x6237('0x16')](handleEntityNotFound(_0x4b64d3,null))[_0x6237('0x16')](function(_0x374dfd){if(_0x374dfd&&_0x374dfd[_0x6237('0xae')]){_0x4d13fb=_0x374dfd;var _0x238c60=_[_0x6237('0xe')](_0xee4ac3['body'],{'firstName':_0xee4ac3[_0x6237('0x73')][_0x6237('0xa8')],'phone':_0xee4ac3[_0x6237('0x73')]['from'],'ListId':_0x374dfd[_0x6237('0xba')]});_0x238c60[_0xee4ac3[_0x6237('0x73')][_0x6237('0xd1')]]=_0xee4ac3[_0x6237('0x73')]['from'];return db[_0x6237('0xa1')]['findOrCreate']({'where':_0x4d7ae6,'defaults':_0x238c60});}})[_0x6237('0xb3')](function(_0xa136e){if(_0xa136e){_0x40dbde=_0xa136e;var _0x20c102=fs['readFileSync'](path[_0x6237('0x90')](config[_0x6237('0x91')],'server/files/templates/chatOfflineMessage.ejs'),_0x6237('0xd5'));var _0xef466d=ejs[_0x6237('0xd6')](_0x20c102,{'body':_[_0x6237('0xd7')](_0xee4ac3['body'][_0x6237('0x73')]),'bodyTitle':_0x4d13fb[_0x6237('0xd8')]});return db[_0x6237('0xd9')][_0x6237('0x72')]({'body':_0xef466d,'plainBody':htmlToText[_0x6237('0xda')](_0xef466d),'ContactId':_0xa136e['id'],'ChatWebsiteId':_0x4d13fb['id']});}})[_0x6237('0x16')](function(_0x305ca9){_0x593ebb=_0x305ca9;if(_0x3f2b16[_0x6237('0x62')]){var _0x188008=_0x3f2b16[_0x6237('0x3d')](function(_0xc69516){return{'name':_0xc69516[_0x6237('0xdb')],'basename':_0xc69516[_0x6237('0x89')],'type':_0xc69516[_0x6237('0xdc')],'ChatOfflineMessageId':_0x305ca9['id']};});_0xab4c9c=_0x188008[_0x6237('0x3d')](_0x3ea4b0=>{var _0x173eba={'filename':_0x3ea4b0[_0x6237('0x2f')],'path':path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0xdd'),_0x6237('0xcf'),_0x6237('0xde'),_0x6237('0xdf'),_0x3ea4b0[_0x6237('0xe0')])};return _0x173eba;});if(!_0x4d13fb[_0x6237('0xe1')]){return db['sequelize'][_0x6237('0xe2')](function(_0x6ec48){return db['Attachment'][_0x6237('0xe3')](_0x188008,{'transaction':_0x6ec48});});}}})[_0x6237('0x16')](function(){if(_0x593ebb){_0x3de1f8=_0x593ebb;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x6237('0xe4')],'as':_0x6237('0xe5'),'raw':!![],'include':[{'model':db[_0x6237('0xe6')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x4e3fe1){if(_0x4e3fe1&&_0x4e3fe1['Smtp']&&_0x4d13fb[_0x6237('0xe7')]&&_0x4d13fb['forwardOfflineAddress']){var _0xb5082a=_0x4e3fe1['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x6237('0xe8'),{'account':_0xb5082a,'message':{'from':util[_0x6237('0x32')](_0x6237('0xe9'),_0x4e3fe1[_0x6237('0x2f')],_0x4e3fe1[_0x6237('0xea')]||_0x4e3fe1[_0x6237('0xe5')][_0x6237('0x74')]),'to':_0x4d13fb[_0x6237('0xeb')],'subject':_0x4d13fb[_0x6237('0xec')],'html':_0x3de1f8['body'],'attachments':_0xab4c9c}},client9003)['then'](function(){return _0x3de1f8;})[_0x6237('0x3c')](function(_0x59e536){logger[_0x6237('0x1c')](_0x59e536);});}})['then'](function(){if(_0x4d13fb&&_0x4d13fb['openNewInteraction']&&_0x4d13fb[_0x6237('0xed')]){var _0x51817d=[];if(_0x3f2b16[_0x6237('0x62')]){_0x51817d=_0x3f2b16['map'](function(_0x1a4053){return{'name':_0x1a4053['originalname'],'basename':_0x1a4053[_0x6237('0x89')],'type':_0x1a4053[_0x6237('0xdc')],'ChatOfflineMessageId':_0x593ebb['id']};});}var _0x2327e8;if(!_[_0x6237('0x94')](_0x4d13fb[_0x6237('0xee')])){var _0x1291e1=_[_0x6237('0x3d')](_0xee4ac3[_0x6237('0x73')],function(_0x362061){return _0x362061;});var _0x54bdef=_[_0x6237('0xef')](_0x1291e1)[0x0];var _0x3d0511=_['mapValues'](_0x54bdef,function(_0x3084c3){return _0x3084c3;});_0x2327e8=_0x3d0511[0x1][_0x4d13fb[_0x6237('0xee')]];}var _0xdf61da={'from':_0x40dbde['email'],'firstName':_0x40dbde[_0x6237('0x49')],'lastName':_0x40dbde[_0x6237('0x4a')],'mapKey':_0x6237('0xea'),'message':{'from':_0x40dbde[_0x6237('0xea')],'to':_0x4d13fb['MailAccount']['email'],'cc':'','subject':_[_0x6237('0x94')](_0x2327e8)?_0x4d13fb[_0x6237('0xec')]:_0x2327e8,'messageId':'','sentAt':new Date(),'attach':_0x51817d[_0x6237('0x62')],'attachments':_0x51817d,'originChannel':'Chat','ChatWebsiteId':_0x4d13fb['id'],'ChatOfflineMessageId':_0x3de1f8['id'],'originTo':_0x4d13fb[_0x6237('0xd4')][_0x6237('0xea')]},'body':_0x3de1f8[_0x6237('0x73')]};var _0x29f3fa={'account':{'id':_0x4d13fb[_0x6237('0xed')]},'body':_0xdf61da,'log':_0x6237('0xf0')};return respondWithRpcPromise(_0x6237('0xf0'),_0x6237('0xf1'),_0x29f3fa,client9001)[_0x6237('0x16')](function(){return _0x3de1f8;})[_0x6237('0x3c')](function(_0x24fc8a){logger[_0x6237('0x1c')](_0x24fc8a);});}return;})['then'](function(){if(_0x3de1f8){return _0x3de1f8;}})[_0x6237('0x16')](respondWithResult(_0x4b64d3,null))[_0x6237('0x3c')](function(){for(var _0x2cd168 of _0x3f2b16){var _0x42c13b=path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0xdd'),_0x6237('0xcf'),'attachments',_0x6237('0xdf'),_0x2cd168[_0x6237('0x89')]);fs_extra['remove'](_0x42c13b)['catch'](function(_0x31b59c){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x42c13b,_0x31b59c);});}});};exports[_0x6237('0xf2')]=function(_0xbef797,_0x2a483e){return db[_0x6237('0xbc')][_0x6237('0x71')]({'where':{'id':_0xbef797[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x2a483e,null))['then'](function(_0x2dc6ad){if(_0x2dc6ad){return _0x2dc6ad[_0x6237('0xf2')](_0xbef797['body'][_0x6237('0x81')],_[_0x6237('0xf3')](_0xbef797[_0x6237('0x73')],[_0x6237('0x81'),'id'])||{});}})['then'](respondWithResult(_0x2a483e,null))[_0x6237('0x3c')](handleError(_0x2a483e,null));};exports[_0x6237('0xf4')]=function(_0x344656,_0x59e113){var _0x28d652={'raw':![],'where':{}};var _0xf0fa8e={};var _0x2addfa={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6237('0x7e')]({'where':{'id':_0x344656[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x59e113,null))[_0x6237('0x16')](function(_0x588e21){if(_0x588e21){_0xf0fa8e[_0x6237('0x54')]=_[_0x6237('0x5d')](db[_0x6237('0xbc')]['rawAttributes']);_0xf0fa8e[_0x6237('0x5c')]=_[_0x6237('0x5d')](_0x344656[_0x6237('0x5c')]);_0xf0fa8e[_0x6237('0x5e')]=_[_0x6237('0x5f')](_0xf0fa8e[_0x6237('0x54')],_0xf0fa8e[_0x6237('0x5c')]);_0x28d652[_0x6237('0x60')]=_[_0x6237('0x5f')](_0xf0fa8e['model'],qs[_0x6237('0x61')](_0x344656[_0x6237('0x5c')][_0x6237('0x61')]));_0x28d652[_0x6237('0x60')]=_0x28d652['attributes'][_0x6237('0x62')]?_0x28d652['attributes']:_0xf0fa8e['model'];if(!_0x344656[_0x6237('0x5c')][_0x6237('0x85')](_0x6237('0x63'))){_0x28d652[_0x6237('0x26')]=qs[_0x6237('0x26')](_0x344656[_0x6237('0x5c')]['limit']);_0x28d652[_0x6237('0x25')]=qs[_0x6237('0x25')](_0x344656[_0x6237('0x5c')][_0x6237('0x25')]);}_0x28d652[_0x6237('0x64')]=qs[_0x6237('0x65')](_0x344656['query'][_0x6237('0x65')]);_0x28d652['where']=qs[_0x6237('0x5e')](_['pick'](_0x344656[_0x6237('0x5c')],_0xf0fa8e[_0x6237('0x5e')]));_0x28d652[_0x6237('0x68')][_0x6237('0x7b')]=_0x588e21['id'];if(_0x344656[_0x6237('0x5c')][_0x6237('0x67')]){_0x28d652[_0x6237('0x68')]=_['merge'](_0x28d652[_0x6237('0x68')],{'$or':_[_0x6237('0x3d')](_0x28d652['attributes'],function(_0x53583c){var _0x38e222={};_0x38e222[_0x53583c]={'$like':'%'+_0x344656[_0x6237('0x5c')][_0x6237('0x67')]+'%'};return _0x38e222;})});}_0x28d652=_['merge']({},_0x28d652,_0x344656[_0x6237('0x70')]);return db[_0x6237('0xbc')][_0x6237('0x28')]({'where':_0x28d652[_0x6237('0x68')]})[_0x6237('0x16')](function(_0x2e4892){_0x2addfa['count']=_0x2e4892;if(_0x344656[_0x6237('0x5c')][_0x6237('0x6b')]){_0x28d652[_0x6237('0x6c')]=[{'model':db[_0x6237('0xa1')],'as':_0x6237('0xf5'),'required':![]},{'model':db[_0x6237('0xc7')],'as':_0x6237('0xf6'),'attributes':[_0x6237('0x2f'),'fullname','internal'],'required':![]},{'model':db[_0x6237('0xf7')],'as':'Tags','attributes':['id','name','color'],'where':_0x344656[_0x6237('0x5c')][_0x6237('0xf8')]?{'id':_0x344656[_0x6237('0x5c')][_0x6237('0xf8')]}:undefined,'required':_0x344656[_0x6237('0x5c')][_0x6237('0xf8')]?!![]:![]}];}return db['ChatInteraction'][_0x6237('0x6d')](_0x28d652);})[_0x6237('0x16')](function(_0x5046dc){_0x2addfa['rows']=_0x5046dc;return _0x2addfa;});}})[_0x6237('0x16')](respondWithFilteredResult(_0x59e113,_0x28d652))[_0x6237('0x3c')](handleError(_0x59e113,null));};exports[_0x6237('0xf9')]=function(_0x5c280d,_0x3933c0){var _0x91247d=0x0;var _0x2df18b=0x0;var _0xbb0cb6=![];var _0x207f3a;var _0x43a152;return db[_0x6237('0x58')]['find']({'where':{'id':_0x5c280d[_0x6237('0x6f')]['id']},'include':[{'model':db[_0x6237('0x3e')],'as':_0x6237('0x3e'),'include':[{'model':db['Interval'],'as':_0x6237('0x3f'),'attributes':['id',_0x6237('0x34')]}]}]})['then'](handleEntityNotFound(_0x3933c0,null))[_0x6237('0x16')](function(_0x4e11b2){if(_0x4e11b2){_0x207f3a=_0x4e11b2;return _0x4e11b2[_0x6237('0xfa')]({'raw':!![]});}})[_0x6237('0x16')](function(_0x182443){if(_0x207f3a){if(_0x182443){_0x43a152=_0x182443;}}return require(_0x6237('0xfb'))['getLicense']();})[_0x6237('0x16')](function(_0x18afb5){if(_0x18afb5){_0x2df18b=_0x18afb5[_0x6237('0xfc')];_0xbb0cb6=_0x18afb5[_0x6237('0xfd')];}})[_0x6237('0x16')](function(){return db[_0x6237('0xbc')][_0x6237('0x28')]({'where':{'closed':![]}});})['then'](function(_0xeb0cd4){_0x91247d=_0xeb0cd4;if(_0x2df18b&&_0xeb0cd4>_0x2df18b){return db['License'][_0x6237('0x7e')]({'where':{'id':0x1}})['then'](function(_0x5c3e88){if(_0x5c3e88){_0x5c3e88['increment']('chatLicenseExceeded');}});}})[_0x6237('0x16')](function(){if(!_0x207f3a[_0x6237('0x3e')]||!_0x207f3a[_0x6237('0x3e')]['Intervals'])return!![];return checkWebsiteIntervals(_0x207f3a);})[_0x6237('0x16')](function(_0x453e4b){var _0x20ff5c=fs['readFileSync'](path['join'](config['root'],_0x6237('0xfe')),_0x6237('0xd5'));var _0xd9193a=new url['URL'](_0x207f3a[_0x6237('0xff')])[_0x6237('0x100')];var _0x52ad58=_0x6237('0x101');var _0xe3451a=![];var _0x21f023={'chatVersion':_0x52ad58,'chatWebsiteAddressOrigin':_0xd9193a,'remote':_0x207f3a[_0x6237('0x102')],'query':querystring[_0x6237('0x1b')](_[_0x6237('0x6a')](_0x207f3a[_0x6237('0x40')]({'plain':!![]}),{'customerIp':_0x5c280d[_0x6237('0x103')][_0x6237('0x46')]||_0x5c280d[_0x6237('0x103')]['x-real-ip']||_0x5c280d[_0x6237('0x104')]['remoteAddress']||_0x5c280d['ip'],'referer':_0x5c280d[_0x6237('0x103')][_0x6237('0x4c')],'openedInteractions':_0x91247d,'maxInteractions':_0x2df18b,'virtual':_0xbb0cb6[_0x6237('0xfc')],'online':_0x453e4b,'custom':_0xbb0cb6}))[_0x6237('0x105')](/'/g,'\x5c\x27')};_0x3933c0[_0x6237('0x30')](ejs[_0x6237('0xd6')](Mustache['render'](_0x20ff5c,_0x21f023),{'proactiveActions':_0x43a152,'alignment':_0x207f3a[_0x6237('0x106')],'verticalAlignment':_0x207f3a[_0x6237('0x107')],'div_color':_0x207f3a['color'],'labelText':_0x207f3a[_0x6237('0x108')],'text_color':_0x207f3a[_0x6237('0x109')],'text_button_color':_0x207f3a['textButtonColor'],'button_color':_0x207f3a[_0x6237('0x10a')],'background_color':_0x207f3a[_0x6237('0x10b')],'hideWhenOffline':_0x207f3a['hideWhenOffline'],'intervalId':_0x207f3a['IntervalId'],'isDevelopment':_0xe3451a,'chatVersion':_0x52ad58}));})[_0x6237('0x3c')](handleError(_0x3933c0,null));};exports[_0x6237('0x10c')]=function(_0x15748f,_0x3b20f6){var _0x1814e2=_0x15748f[_0x6237('0x6f')]['id'];var _0x5ba9c8=_0x15748f[_0x6237('0x73')];var _0x1e43cf=0xc8;var _0x3cb043=null;return db[_0x6237('0x10d')][_0x6237('0xe2')]({'isolationLevel':db[_0x6237('0x10d')][_0x6237('0x10e')][_0x6237('0x10f')][_0x6237('0x110')]},function(_0x595e10){return db[_0x6237('0x58')][_0x6237('0x7e')]({'where':{'id':_0x1814e2},'transaction':_0x595e10})[_0x6237('0x16')](function(_0x14c7d1){if(_0x14c7d1){return db[_0x6237('0xb0')][_0x6237('0x2c')]({'where':{'ChatWebsiteId':_0x1814e2},'transaction':_0x595e10})[_0x6237('0x16')](function(){var _0x174911=_['map'](_0x5ba9c8,function(_0x7e45d3){_0x7e45d3['ChatWebsiteId']=_0x1814e2;return _0x7e45d3;});return db[_0x6237('0xb0')]['bulkCreate'](_0x174911,{'transaction':_0x595e10});});}else{_0x1e43cf=0x194;_0x3cb043=[];}});})[_0x6237('0x16')](function(){if(_0x1e43cf!==0x194){return db[_0x6237('0xb0')][_0x6237('0x111')]({'where':{'ChatWebsiteId':_0x1814e2},'order':_0x6237('0xb8')})[_0x6237('0x16')](function(_0x2ac63f){_0x3cb043=_0x2ac63f;});}})[_0x6237('0x3c')](function(_0x2811a9){_0x1e43cf=0x1f4;logger['error'](_0x2811a9['stack']);if(_0x2811a9[_0x6237('0x2f')]){delete _0x2811a9[_0x6237('0x2f')];}_0x3cb043=_0x2811a9;})[_0x6237('0x112')](function(){if(_0x3cb043===null){_0x3b20f6[_0x6237('0x21')](_0x1e43cf);}else{if(_0x1e43cf===0x1f4){_0x3b20f6[_0x6237('0x23')](_0x1e43cf)[_0x6237('0x30')](_0x3cb043);}else{_0x3b20f6[_0x6237('0x23')](_0x1e43cf)[_0x6237('0x24')](_0x3cb043);}}});};exports[_0x6237('0x113')]=function(_0x4afa87,_0x31c20c){var _0x4c10e1={};var _0x174e48={};var _0x1df0fe;var _0x5969ce;return db[_0x6237('0x58')]['findOne']({'where':{'id':_0x4afa87[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x31c20c,null))['then'](function(_0x154044){if(_0x154044){_0x1df0fe=_0x154044;_0x174e48[_0x6237('0x54')]=_['keys'](db[_0x6237('0xb0')][_0x6237('0x59')]);_0x174e48['query']=_[_0x6237('0x5d')](_0x4afa87[_0x6237('0x5c')]);_0x174e48[_0x6237('0x5e')]=_[_0x6237('0x5f')](_0x174e48[_0x6237('0x54')],_0x174e48[_0x6237('0x5c')]);_0x4c10e1[_0x6237('0x60')]=_[_0x6237('0x5f')](_0x174e48['model'],qs[_0x6237('0x61')](_0x4afa87[_0x6237('0x5c')]['fields']));_0x4c10e1[_0x6237('0x60')]=_0x4c10e1[_0x6237('0x60')][_0x6237('0x62')]?_0x4c10e1[_0x6237('0x60')]:_0x174e48[_0x6237('0x54')];_0x4c10e1['order']=qs[_0x6237('0x65')](_0x4afa87[_0x6237('0x5c')][_0x6237('0x65')]);_0x4c10e1[_0x6237('0x68')]=qs[_0x6237('0x5e')](_['pick'](_0x4afa87[_0x6237('0x5c')],_0x174e48[_0x6237('0x5e')]));if(_0x4afa87[_0x6237('0x5c')]['filter']){_0x4c10e1[_0x6237('0x68')]=_[_0x6237('0x6a')](_0x4c10e1[_0x6237('0x68')],{'$or':_[_0x6237('0x3d')](_0x4c10e1[_0x6237('0x60')],function(_0x3bdba2){var _0x4ab127={};_0x4ab127[_0x3bdba2]={'$like':'%'+_0x4afa87[_0x6237('0x5c')][_0x6237('0x67')]+'%'};return _0x4ab127;})});}_0x4c10e1=_[_0x6237('0x6a')]({},_0x4c10e1,_0x4afa87[_0x6237('0x70')]);return _0x1df0fe[_0x6237('0x113')](_0x4c10e1);}})[_0x6237('0x16')](function(_0x3b2490){if(_0x3b2490){_0x5969ce=_0x3b2490[_0x6237('0x62')];if(!_0x4afa87['query']['hasOwnProperty'](_0x6237('0x63'))){_0x4c10e1[_0x6237('0x26')]=qs[_0x6237('0x26')](_0x4afa87[_0x6237('0x5c')][_0x6237('0x26')]);_0x4c10e1['offset']=qs[_0x6237('0x25')](_0x4afa87[_0x6237('0x5c')][_0x6237('0x25')]);}return _0x1df0fe[_0x6237('0x113')](_0x4c10e1);}})[_0x6237('0x16')](function(_0x5ea748){if(_0x5ea748){return _0x5ea748?{'count':_0x5969ce,'rows':_0x5ea748}:null;}})[_0x6237('0x16')](respondWithResult(_0x31c20c,null))[_0x6237('0x3c')](handleError(_0x31c20c,null));};exports[_0x6237('0x114')]=function(_0x36b554,_0x32c4c9){return db['chatProactiveAction'][_0x6237('0x71')]({'where':{'id':_0x36b554[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x32c4c9,null))[_0x6237('0x16')](function(_0x316cd5){if(_0x316cd5){return _0x316cd5[_0x6237('0x114')](_0x36b554[_0x6237('0x73')][_0x6237('0x81')],_[_0x6237('0xf3')](_0x36b554[_0x6237('0x73')],[_0x6237('0x81'),'id'])||{});}})[_0x6237('0x16')](respondWithResult(_0x32c4c9,null))[_0x6237('0x3c')](handleError(_0x32c4c9,null));};exports[_0x6237('0xfa')]=function(_0x5bc763,_0x5ddad1){var _0x17f443={};var _0x233995={};var _0x495b2a;var _0x43ccc9;return db[_0x6237('0x58')]['findOne']({'where':{'id':_0x5bc763[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x5ddad1,null))['then'](function(_0x22ec5a){if(_0x22ec5a){_0x495b2a=_0x22ec5a;_0x233995[_0x6237('0x54')]=_[_0x6237('0x5d')](db[_0x6237('0x115')][_0x6237('0x59')]);_0x233995['query']=_[_0x6237('0x5d')](_0x5bc763[_0x6237('0x5c')]);_0x233995[_0x6237('0x5e')]=_[_0x6237('0x5f')](_0x233995[_0x6237('0x54')],_0x233995[_0x6237('0x5c')]);_0x17f443['attributes']=_[_0x6237('0x5f')](_0x233995['model'],qs[_0x6237('0x61')](_0x5bc763['query'][_0x6237('0x61')]));_0x17f443[_0x6237('0x60')]=_0x17f443['attributes'][_0x6237('0x62')]?_0x17f443[_0x6237('0x60')]:_0x233995[_0x6237('0x54')];_0x17f443['order']=qs[_0x6237('0x65')](_0x5bc763[_0x6237('0x5c')][_0x6237('0x65')]);_0x17f443[_0x6237('0x68')]=qs[_0x6237('0x5e')](_[_0x6237('0x66')](_0x5bc763['query'],_0x233995['filters']));if(_0x5bc763['query'][_0x6237('0x67')]){_0x17f443[_0x6237('0x68')]=_['merge'](_0x17f443[_0x6237('0x68')],{'$or':_['map'](_0x17f443[_0x6237('0x60')],function(_0x5dacdd){var _0x177d20={};_0x177d20[_0x5dacdd]={'$like':'%'+_0x5bc763[_0x6237('0x5c')][_0x6237('0x67')]+'%'};return _0x177d20;})});}_0x17f443=_['merge']({},_0x17f443,_0x5bc763[_0x6237('0x70')]);return _0x495b2a['getProactiveActions'](_0x17f443);}})[_0x6237('0x16')](function(_0x2385e8){if(_0x2385e8){_0x43ccc9=_0x2385e8[_0x6237('0x62')];if(!_0x5bc763[_0x6237('0x5c')][_0x6237('0x85')](_0x6237('0x63'))){_0x17f443[_0x6237('0x26')]=qs[_0x6237('0x26')](_0x5bc763[_0x6237('0x5c')]['limit']);_0x17f443[_0x6237('0x25')]=qs[_0x6237('0x25')](_0x5bc763[_0x6237('0x5c')][_0x6237('0x25')]);}return _0x495b2a[_0x6237('0xfa')](_0x17f443);}})[_0x6237('0x16')](function(_0x4f6373){if(_0x4f6373){return _0x4f6373?{'count':_0x43ccc9,'rows':_0x4f6373}:null;}})[_0x6237('0x16')](respondWithResult(_0x5ddad1,null))[_0x6237('0x3c')](handleError(_0x5ddad1,null));};exports[_0x6237('0x116')]=function(_0x5ae87a,_0x2f742a){var _0x53bf73=_0x5ae87a[_0x6237('0x5c')][_0x6237('0x117')]===_0x6237('0x118')?_0x6237('0x119'):_0x6237('0x11a');return db[_0x6237('0x58')][_0x6237('0x71')]({'attributes':['id',_0x53bf73],'where':{'id':_0x5ae87a['params']['id']}})['then'](handleEntityNotFound(_0x2f742a,null))[_0x6237('0x16')](function(_0x17f105){if(_0x17f105){var _0x1ad08a=_0x17f105[_0x53bf73];var _0x498c82=_0x1ad08a&&_0x1ad08a[_0x6237('0x11b')]?_0x1ad08a[_0x6237('0x11b')]:[];_0x2f742a['send']({'fromKey':_[_0x6237('0x94')](_0x1ad08a[_0x6237('0x11c')])?undefined:_0x1ad08a[_0x6237('0x11c')],'count':_0x498c82['length'],'rows':_0x498c82});}})['catch'](handleError(_0x2f742a,null));};exports[_0x6237('0x11d')]=function(_0x4aad03,_0x22a266){var _0x1b14bd={'raw':![],'where':{}};var _0x1b78db={};var _0x1d28ba={'count':0x0,'rows':[]};return db[_0x6237('0x58')][_0x6237('0x7e')]({'where':{'id':_0x4aad03[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x22a266,null))['then'](function(_0x3dab01){if(_0x3dab01){_0x1b78db[_0x6237('0x54')]=_[_0x6237('0x5d')](db[_0x6237('0xd9')]['rawAttributes']);_0x1b78db['query']=_[_0x6237('0x5d')](_0x4aad03[_0x6237('0x5c')]);_0x1b78db['filters']=_[_0x6237('0x5f')](_0x1b78db[_0x6237('0x54')],_0x1b78db[_0x6237('0x5c')]);_0x1b14bd[_0x6237('0x60')]=_[_0x6237('0x5f')](_0x1b78db['model'],qs[_0x6237('0x61')](_0x4aad03['query'][_0x6237('0x61')]));_0x1b14bd[_0x6237('0x60')]=_0x1b14bd[_0x6237('0x60')][_0x6237('0x62')]?_0x1b14bd[_0x6237('0x60')]:_0x1b78db['model'];if(!_0x4aad03[_0x6237('0x5c')]['hasOwnProperty'](_0x6237('0x63'))){_0x1b14bd['limit']=qs['limit'](_0x4aad03[_0x6237('0x5c')]['limit']);_0x1b14bd[_0x6237('0x25')]=qs[_0x6237('0x25')](_0x4aad03['query'][_0x6237('0x25')]);}_0x1b14bd[_0x6237('0x64')]=qs[_0x6237('0x65')](_0x4aad03[_0x6237('0x5c')][_0x6237('0x65')]);_0x1b14bd['where']=qs['filters'](_['pick'](_0x4aad03[_0x6237('0x5c')],_0x1b78db['filters']));_0x1b14bd['where'][_0x6237('0x7b')]=_0x3dab01['id'];if(_0x4aad03[_0x6237('0x5c')][_0x6237('0x67')]){_0x1b14bd[_0x6237('0x68')]=_[_0x6237('0x6a')](_0x1b14bd[_0x6237('0x68')],{'$or':_[_0x6237('0x3d')](_0x1b14bd['attributes'],function(_0x5cf82a){var _0x1f0e63={};_0x1f0e63[_0x5cf82a]={'$like':'%'+_0x4aad03[_0x6237('0x5c')][_0x6237('0x67')]+'%'};return _0x1f0e63;})});}_0x1b14bd=_['merge']({},_0x1b14bd,_0x4aad03[_0x6237('0x70')]);return db[_0x6237('0xd9')]['count']({'where':_0x1b14bd['where']})[_0x6237('0x16')](function(_0x3d8862){_0x1d28ba['count']=_0x3d8862;if(_0x4aad03['query'][_0x6237('0x6b')]){_0x1b14bd['include']=[{'all':!![]}];}else{_0x1b14bd[_0x6237('0x6c')]=[{'model':db[_0x6237('0xa1')],'as':_0x6237('0xf5'),'required':![]},{'model':db[_0x6237('0x11e')],'as':_0x6237('0x11f'),'required':![]}];}return db[_0x6237('0xd9')][_0x6237('0x6d')](_0x1b14bd);})[_0x6237('0x16')](function(_0x5c72b3){_0x1d28ba[_0x6237('0x7f')]=_0x5c72b3;return _0x1d28ba;});}})[_0x6237('0x16')](respondWithFilteredResult(_0x22a266,_0x1b14bd))[_0x6237('0x3c')](handleError(_0x22a266,null));};exports[_0x6237('0x120')]=function(_0x15bc24,_0x9684f8){return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x15bc24['params']['id']}})['then'](handleEntityNotFound(_0x9684f8,null))['then'](function(_0x42955a){if(_0x42955a){return _0x42955a[_0x6237('0x120')](_0x15bc24[_0x6237('0x73')]['ids'],_[_0x6237('0xf3')](_0x15bc24['body'],[_0x6237('0x81'),'id'])||{})[_0x6237('0xb3')](function(_0x1f1ce2){for(var _0x50bfef=0x0;_0x50bfef<_0x15bc24[_0x6237('0x73')][_0x6237('0x81')][_0x6237('0x62')];_0x50bfef+=0x1){socket[_0x6237('0x121')]('userChatWebsite:save',{'UserId':Number(_0x15bc24[_0x6237('0x73')][_0x6237('0x81')][_0x50bfef]),'ChatWebsiteId':Number(_0x15bc24['params']['id'])});}return _0x1f1ce2;});}})[_0x6237('0x16')](respondWithResult(_0x9684f8,null))[_0x6237('0x3c')](handleError(_0x9684f8,null));};exports[_0x6237('0x122')]=function(_0x3317fd,_0x1a59b8){return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x3317fd['params']['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x1a59b8,null))[_0x6237('0x16')](function(_0x676e46){if(_0x676e46){return _0x676e46[_0x6237('0x122')](_0x3317fd[_0x6237('0x5c')][_0x6237('0x81')])[_0x6237('0x16')](function(){if(_[_0x6237('0x123')](_0x3317fd[_0x6237('0x5c')][_0x6237('0x81')])){for(var _0x3b8d0b=0x0;_0x3b8d0b<_0x3317fd[_0x6237('0x5c')]['ids'][_0x6237('0x62')];_0x3b8d0b+=0x1){socket['emit'](_0x6237('0x124'),{'UserId':Number(_0x3317fd[_0x6237('0x5c')]['ids'][_0x3b8d0b]),'ChatWebsiteId':Number(_0x3317fd['params']['id'])});}}else{socket[_0x6237('0x121')]('userChatWebsite:remove',{'UserId':Number(_0x3317fd[_0x6237('0x5c')][_0x6237('0x81')]),'ChatWebsiteId':Number(_0x3317fd[_0x6237('0x6f')]['id'])});}});}})[_0x6237('0x16')](respondWithStatusCode(_0x1a59b8,null))[_0x6237('0x3c')](handleError(_0x1a59b8,null));};exports[_0x6237('0x125')]=function(_0x26c116,_0x279821){var _0x19fe86={};var _0x2ca8a1={};var _0x57e996;var _0x91ac35;return db[_0x6237('0x58')][_0x6237('0x7e')]({'where':{'id':_0x26c116[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x279821,null))[_0x6237('0x16')](function(_0x5dca8d){if(_0x5dca8d){_0x57e996=_0x5dca8d;_0x2ca8a1[_0x6237('0x54')]=_[_0x6237('0x5d')](db['User'][_0x6237('0x59')]);_0x2ca8a1[_0x6237('0x5c')]=_['keys'](_0x26c116[_0x6237('0x5c')]);_0x2ca8a1[_0x6237('0x5e')]=_['intersection'](_0x2ca8a1[_0x6237('0x54')],_0x2ca8a1[_0x6237('0x5c')]);_0x19fe86[_0x6237('0x60')]=_[_0x6237('0x5f')](_0x2ca8a1[_0x6237('0x54')],qs[_0x6237('0x61')](_0x26c116['query'][_0x6237('0x61')]));_0x19fe86[_0x6237('0x60')]=_0x19fe86[_0x6237('0x60')][_0x6237('0x62')]?_0x19fe86[_0x6237('0x60')]:_0x2ca8a1[_0x6237('0x54')];_0x19fe86[_0x6237('0x64')]=qs['sort'](_0x26c116['query'][_0x6237('0x65')]);_0x19fe86['where']=qs[_0x6237('0x5e')](_['pick'](_0x26c116['query'],_0x2ca8a1[_0x6237('0x5e')]));if(_0x26c116[_0x6237('0x5c')][_0x6237('0x67')]){_0x19fe86[_0x6237('0x68')]=_[_0x6237('0x6a')](_0x19fe86[_0x6237('0x68')],{'$or':_['map'](_0x19fe86[_0x6237('0x60')],function(_0x3a544a){var _0x197780={};_0x197780[_0x3a544a]={'$like':'%'+_0x26c116[_0x6237('0x5c')][_0x6237('0x67')]+'%'};return _0x197780;})});}_0x19fe86=_['merge']({},_0x19fe86,_0x26c116[_0x6237('0x70')]);return _0x57e996[_0x6237('0x125')](_0x19fe86);}})['then'](function(_0x5c2b87){if(_0x5c2b87){_0x91ac35=_0x5c2b87[_0x6237('0x62')];if(!_0x26c116['query'][_0x6237('0x85')](_0x6237('0x63'))){_0x19fe86[_0x6237('0x26')]=qs[_0x6237('0x26')](_0x26c116[_0x6237('0x5c')][_0x6237('0x26')]);_0x19fe86['offset']=qs['offset'](_0x26c116[_0x6237('0x5c')][_0x6237('0x25')]);}return _0x57e996['getAgents'](_0x19fe86);}})[_0x6237('0x16')](function(_0x3b938c){if(_0x3b938c){return _0x3b938c?{'count':_0x91ac35,'rows':_0x3b938c}:null;}})['then'](respondWithResult(_0x279821,null))[_0x6237('0x3c')](handleError(_0x279821,null));};
\ No newline at end of file
+var _0xbff2=['message','result','catch','end','json','offset','undefined','limit','count','status','destroy','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','Command','getSnippet','format','timezone','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','map','Interval','Intervals','all','some','user-agent-parser','setUA','user-agent','getResult','customerIp','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','%s\x20%s','version','unknown','device','model','%s\x20%s\x20%s','vendor','type','Pause','ChatWebsite','rawAttributes','key','keys','query','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','order','removeDispositions','ChatWebsiteId','CannedAnswer','getAnswers','hasOwnProperty','nolimit','removeAnswers','ids','sitepic','filename','addAvatar','agentAvatar','file','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','Sequelize','ValidationError','difference','updatedAt','CompanyId','ListId','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','applications','priority','asc','defaults','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','firstName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','offline','files','no\x20available\x20attributes','createdAt','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','MailServerOut','CloudProvider','Smtp','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','Contact','Owner','fullname','internal','Tag','color','tag','virtual','increment','chatLicenseExceeded','URL','address','origin','3.6.0','x-real-ip','connection','remoteAddress','replace','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','online','false','offlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','url','../../components/parsers/qs','../../errors/api','APIOutOfIntervalError','APINotFoundError','../../mysqldb','localhost','redis','./chatWebsite.socket','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xf4b27e,_0x525244){var _0x42166d=function(_0x102790){while(--_0x102790){_0xf4b27e['push'](_0xf4b27e['shift']());}};_0x42166d(++_0x525244);}(_0xbff2,0x10e));var _0x2bff=function(_0x20c764,_0x940bff){_0x20c764=_0x20c764-0x0;var _0xf2c5eb=_0xbff2[_0x20c764];return _0xf2c5eb;};'use strict';var Mustache=require(_0x2bff('0x0'));var util=require(_0x2bff('0x1'));var path=require(_0x2bff('0x2'));var ejs=require(_0x2bff('0x3'));var fs=require('fs');var fs_extra=require(_0x2bff('0x4'));var _=require(_0x2bff('0x5'));var querystring=require(_0x2bff('0x6'));var htmlToText=require(_0x2bff('0x7'));var Redis=require(_0x2bff('0x8'));var jayson=require('jayson/promise');var url=require(_0x2bff('0x9'));var qs=require(_0x2bff('0xa'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var APIOutOfIntervalError=require(_0x2bff('0xb'))[_0x2bff('0xc')];var APINotFoundError=require('../../errors/api')[_0x2bff('0xd')];var APIHandleError=require('../../errors/api')['handleError'];var db=require(_0x2bff('0xe'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x2bff('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2bff('0x10')]));require(_0x2bff('0x11'))['register'](socket);var client=jayson[_0x2bff('0x12')][_0x2bff('0x13')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0x2bff('0x12')][_0x2bff('0x13')]({'port':0x232b});var client9001=jayson['client'][_0x2bff('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x2af98f,_0x48f9f8,_0x3d3e90,_0x3e8399){return new Promise(function(_0x430fd0,_0x46a93c){var _0x5cf3c1=_0x3e8399||client;return _0x5cf3c1[_0x2bff('0x14')](_0x2af98f,_0x3d3e90)[_0x2bff('0x15')](function(_0x25f978){logger[_0x2bff('0x16')](_0x2bff('0x17'),_0x48f9f8,_0x2bff('0x18'));logger['debug'](_0x2bff('0x19'),_0x48f9f8,_0x2bff('0x18'),JSON[_0x2bff('0x1a')](_0x25f978));if(_0x25f978['error']){if(_0x25f978[_0x2bff('0x1b')][_0x2bff('0x1c')]===0x1f4){logger['error'](_0x2bff('0x17'),_0x48f9f8,_0x25f978[_0x2bff('0x1b')][_0x2bff('0x1d')]);return _0x46a93c(_0x25f978['error']['message']);}logger[_0x2bff('0x1b')](_0x2bff('0x17'),_0x48f9f8,_0x25f978['error'][_0x2bff('0x1d')]);return _0x430fd0(_0x25f978['error']['message']);}else{logger[_0x2bff('0x16')](_0x2bff('0x17'),_0x48f9f8,_0x2bff('0x18'));_0x430fd0(_0x25f978[_0x2bff('0x1e')][_0x2bff('0x1d')]);}})[_0x2bff('0x1f')](function(_0x33ab51){logger[_0x2bff('0x1b')](_0x2bff('0x17'),_0x48f9f8,_0x33ab51);_0x46a93c(_0x33ab51);});});}function respondWithStatusCode(_0x42c9c2,_0x3b3a66){_0x3b3a66=_0x3b3a66||0xcc;return function(_0x3ecb73){if(_0x3ecb73){return _0x42c9c2['sendStatus'](_0x3b3a66);}return _0x42c9c2['status'](_0x3b3a66)[_0x2bff('0x20')]();};}function respondWithResult(_0x314717,_0x4c6a91){_0x4c6a91=_0x4c6a91||0xc8;return function(_0x170a8f){if(_0x170a8f){return _0x314717['status'](_0x4c6a91)[_0x2bff('0x21')](_0x170a8f);}};}function respondWithFilteredResult(_0x59147b,_0x23dcd6){return function(_0x235523){if(_0x235523){var _0x551a59=typeof _0x23dcd6[_0x2bff('0x22')]===_0x2bff('0x23')&&typeof _0x23dcd6[_0x2bff('0x24')]===_0x2bff('0x23');var _0x2204ad=_0x235523[_0x2bff('0x25')];var _0x5a93fa=_0x551a59?0x0:_0x23dcd6['offset'];var _0x5e8c69=_0x551a59?_0x235523[_0x2bff('0x25')]:_0x23dcd6[_0x2bff('0x22')]+_0x23dcd6[_0x2bff('0x24')];var _0x35eaf2;if(_0x5e8c69>=_0x2204ad){_0x5e8c69=_0x2204ad;_0x35eaf2=0xc8;}else{_0x35eaf2=0xce;}_0x59147b[_0x2bff('0x26')](_0x35eaf2);return _0x59147b['set']('Content-Range',_0x5a93fa+'-'+_0x5e8c69+'/'+_0x2204ad)['json'](_0x235523);}return null;};}function saveUpdates(_0x180aa6){return function(_0x502efb){if(_0x502efb){return _0x502efb['update'](_0x180aa6)['then'](function(_0x3713ff){return _0x3713ff;});}return null;};}function removeEntity(_0x273acf){return function(_0x339156){if(_0x339156){return _0x339156[_0x2bff('0x27')]()[_0x2bff('0x15')](function(){var _0x2f74c4=_0x339156[_0x2bff('0x28')]({'plain':!![]});var _0x33fa97=_0x2bff('0x29');return db[_0x2bff('0x2a')][_0x2bff('0x27')]({'where':{'type':_0x33fa97,'resourceId':_0x2f74c4['id']}})[_0x2bff('0x15')](function(){return _0x339156;});})[_0x2bff('0x15')](function(){_0x273acf[_0x2bff('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14df84){return function(_0x17657c){if(!_0x17657c){_0x14df84[_0x2bff('0x2b')](0x194);}return _0x17657c;};}function handleError(_0x4c4fb4,_0x3ec81a){_0x3ec81a=_0x3ec81a||0x1f4;return function(_0x4a5dad){logger[_0x2bff('0x1b')](_0x4a5dad[_0x2bff('0x2c')]);if(_0x4a5dad[_0x2bff('0x2d')]){delete _0x4a5dad[_0x2bff('0x2d')];}_0x4c4fb4[_0x2bff('0x26')](_0x3ec81a)['send'](_0x4a5dad);};}function iftimePromise(_0x1150c4,_0x192c93){return respondWithRpcPromise(_0x2bff('0x2e'),_0x2bff('0x2f'),{'command':_0x192c93['timezone']?util[_0x2bff('0x30')]('iftime\x20%s,%s',_0x1150c4['interval'],_0x192c93[_0x2bff('0x31')]):util['format']('iftime\x20%s',_0x1150c4[_0x2bff('0x32')])},client9002)[_0x2bff('0x15')](function(_0x317958){var _0x25e2cc=_0x317958&&_0x317958['indexOf'](_0x2bff('0x33'))>=0x0?!![]:![];logger[_0x2bff('0x16')](_0x2bff('0x34'),_0x192c93['id'],_0x1150c4['id'],_0x1150c4['interval'],_0x25e2cc?_0x2bff('0x35'):_0x2bff('0x36'),_0x192c93[_0x2bff('0x31')]?_0x192c93[_0x2bff('0x31')]:'No\x20timezone');return _0x25e2cc;})[_0x2bff('0x1f')](function(_0x42a764){logger['error'](_0x2bff('0x34'),_0x192c93['id'],_0x1150c4['id'],_0x1150c4[_0x2bff('0x32')],util[_0x2bff('0x37')](_0x42a764,{'showHidden':![],'depth':null}),_0x192c93[_0x2bff('0x31')]?_0x192c93[_0x2bff('0x31')]:_0x2bff('0x38'));return![];});}function checkWebsiteIntervals(_0x2a2ba0){var _0x30ff26=_[_0x2bff('0x39')](_0x2a2ba0[_0x2bff('0x3a')][_0x2bff('0x3b')],function(_0x24217b){var _0xf4396e=_0x24217b[_0x2bff('0x28')]({'plain':!![]});return iftimePromise(_0xf4396e,_0x2a2ba0);});return Promise[_0x2bff('0x3c')](_0x30ff26)[_0x2bff('0x15')](function(_0x1c53c2){return _[_0x2bff('0x3d')](_0x1c53c2);});}function createInteractionObject(_0x14be36,_0x1369a9,_0x390762,_0x54cd71){var _0x243e55=require(_0x2bff('0x3e'));var _0x1f52c4=new _0x243e55();var _0x1284f8=_0x1f52c4[_0x2bff('0x3f')](_0x390762[_0x2bff('0x40')])[_0x2bff('0x41')]();var _0x396f19=_0x1369a9[_0x2bff('0x42')];if(_0x390762['cf-connecting-ip']){_0x396f19=_0x390762['cf-connecting-ip'];}else if(_0x390762[_0x2bff('0x43')]){_0x396f19=_[_0x2bff('0x44')](_0x390762[_0x2bff('0x43')][_0x2bff('0x45')](','));}return{'ContactId':_0x54cd71['id'],'ChatWebsiteId':_0x14be36,'from':(_0x54cd71['firstName']||'')+'\x20'+(_0x54cd71[_0x2bff('0x46')]||''),'customerIp':_0x396f19,'customerPort':_0x390762[_0x2bff('0x47')]?_0x390762[_0x2bff('0x47')]:null,'referer':_0x1369a9[_0x2bff('0x48')],'browserName':_0x1284f8[_0x2bff('0x49')]['name']&&_0x1284f8[_0x2bff('0x49')]['version']?util[_0x2bff('0x30')](_0x2bff('0x4a'),_0x1284f8[_0x2bff('0x49')][_0x2bff('0x2d')],_0x1284f8['browser']['version']):'unknown','browserVersion':_0x1284f8['browser'][_0x2bff('0x4b')]||_0x2bff('0x4c'),'osName':util[_0x2bff('0x30')]('%s\x20%s',_0x1284f8['os'][_0x2bff('0x2d')],_0x1284f8['os'][_0x2bff('0x4b')]),'osVersion':_0x1284f8['os'][_0x2bff('0x4b')],'deviceModel':_0x1284f8[_0x2bff('0x4d')][_0x2bff('0x4e')]&&_0x1284f8[_0x2bff('0x4d')]['vendor']?util[_0x2bff('0x30')](_0x2bff('0x4f'),_0x1284f8[_0x2bff('0x4d')][_0x2bff('0x4e')],_0x1284f8[_0x2bff('0x4d')][_0x2bff('0x50')],_0x1284f8[_0x2bff('0x4d')]['type']):null,'deviceVendor':_0x1284f8[_0x2bff('0x4d')]['vendor'],'deviceType':_0x1284f8[_0x2bff('0x4d')][_0x2bff('0x51')],'formData':JSON[_0x2bff('0x1a')](_0x1369a9)};}exports['index']=function(_0x9ea4fc,_0x4c82e7){var _0x5d12cc={'include':[{'model':db[_0x2bff('0x52')],'as':'mandatoryDispositionPause'}]},_0x21ec1f={},_0x298308={'count':0x0,'rows':[]};var _0x125c22=_['map'](db[_0x2bff('0x53')][_0x2bff('0x54')],function(_0x5a8dfa){return{'name':_0x5a8dfa['fieldName'],'type':_0x5a8dfa[_0x2bff('0x51')][_0x2bff('0x55')]};});_0x21ec1f[_0x2bff('0x4e')]=_[_0x2bff('0x39')](_0x125c22,_0x2bff('0x2d'));_0x21ec1f['query']=_[_0x2bff('0x56')](_0x9ea4fc[_0x2bff('0x57')]);_0x21ec1f[_0x2bff('0x58')]=_[_0x2bff('0x59')](_0x21ec1f['model'],_0x21ec1f[_0x2bff('0x57')]);_0x5d12cc[_0x2bff('0x5a')]=_[_0x2bff('0x59')](_0x21ec1f['model'],qs[_0x2bff('0x5b')](_0x9ea4fc[_0x2bff('0x57')]['fields']));_0x5d12cc[_0x2bff('0x5a')]=_0x5d12cc[_0x2bff('0x5a')][_0x2bff('0x5c')]?_0x5d12cc['attributes']:_0x21ec1f['model'];if(!_0x9ea4fc[_0x2bff('0x57')]['hasOwnProperty']('nolimit')){_0x5d12cc[_0x2bff('0x24')]=qs[_0x2bff('0x24')](_0x9ea4fc[_0x2bff('0x57')]['limit']);_0x5d12cc[_0x2bff('0x22')]=qs[_0x2bff('0x22')](_0x9ea4fc[_0x2bff('0x57')][_0x2bff('0x22')]);}_0x5d12cc['order']=qs[_0x2bff('0x5d')](_0x9ea4fc[_0x2bff('0x57')][_0x2bff('0x5d')]);_0x5d12cc['where']=qs[_0x2bff('0x58')](_[_0x2bff('0x5e')](_0x9ea4fc[_0x2bff('0x57')],_0x21ec1f['filters']),_0x125c22);if(_0x9ea4fc[_0x2bff('0x57')][_0x2bff('0x5f')]){_0x5d12cc[_0x2bff('0x60')]=_[_0x2bff('0x61')](_0x5d12cc['where'],{'$or':_[_0x2bff('0x39')](_0x125c22,function(_0x564642){if(_0x564642['type']!==_0x2bff('0x62')){var _0x261863={};_0x261863[_0x564642[_0x2bff('0x2d')]]={'$like':'%'+_0x9ea4fc[_0x2bff('0x57')][_0x2bff('0x5f')]+'%'};return _0x261863;}})});}_0x5d12cc=_[_0x2bff('0x61')]({},_0x5d12cc,_0x9ea4fc[_0x2bff('0x63')]);var _0x465a67={'where':_0x5d12cc[_0x2bff('0x60')]};return db['ChatWebsite']['count'](_0x465a67)['then'](function(_0x3e8bc8){_0x298308['count']=_0x3e8bc8;if(_0x9ea4fc[_0x2bff('0x57')]['includeAll']){_0x5d12cc[_0x2bff('0x64')]=[{'all':!![]}];}return db[_0x2bff('0x53')][_0x2bff('0x65')](_0x5d12cc);})[_0x2bff('0x15')](function(_0x428e7a){_0x298308[_0x2bff('0x66')]=_0x428e7a;return _0x298308;})['then'](respondWithFilteredResult(_0x4c82e7,_0x5d12cc))['catch'](handleError(_0x4c82e7,null));};exports['show']=function(_0x39111b,_0x23b383){var _0x4040a6={'raw':![],'where':{'id':_0x39111b[_0x2bff('0x67')]['id']},'include':[{'model':db[_0x2bff('0x52')],'as':'mandatoryDispositionPause'}]},_0x2a29a5={};_0x2a29a5['model']=_['keys'](db['ChatWebsite'][_0x2bff('0x54')]);_0x2a29a5['query']=_['keys'](_0x39111b['query']);_0x2a29a5[_0x2bff('0x58')]=_[_0x2bff('0x59')](_0x2a29a5[_0x2bff('0x4e')],_0x2a29a5[_0x2bff('0x57')]);_0x4040a6[_0x2bff('0x5a')]=_[_0x2bff('0x59')](_0x2a29a5[_0x2bff('0x4e')],qs[_0x2bff('0x5b')](_0x39111b['query']['fields']));_0x4040a6[_0x2bff('0x5a')]=_0x4040a6[_0x2bff('0x5a')][_0x2bff('0x5c')]?_0x4040a6[_0x2bff('0x5a')]:_0x2a29a5[_0x2bff('0x4e')];if(_0x39111b[_0x2bff('0x57')][_0x2bff('0x68')]){_0x4040a6[_0x2bff('0x64')]=[{'all':!![]}];}_0x4040a6=_['merge']({},_0x4040a6,_0x39111b[_0x2bff('0x63')]);return db[_0x2bff('0x53')]['find'](_0x4040a6)[_0x2bff('0x15')](handleEntityNotFound(_0x23b383,null))[_0x2bff('0x15')](respondWithResult(_0x23b383,null))[_0x2bff('0x1f')](handleError(_0x23b383,null));};exports[_0x2bff('0x69')]=function(_0x4ca979,_0x5c2e39){return db[_0x2bff('0x53')][_0x2bff('0x69')](_0x4ca979[_0x2bff('0x6a')],{})[_0x2bff('0x15')](function(_0x11afef){var _0xec052c=_0x4ca979[_0x2bff('0x6b')]['get']({'plain':!![]});if(!_0xec052c)throw new Error(_0x2bff('0x6c'));if(_0xec052c['role']===_0x2bff('0x6b')){var _0x50561e=_0x11afef['get']({'plain':!![]});var _0x34b4e9=_0x2bff('0x29');return db[_0x2bff('0x6d')][_0x2bff('0x6e')]({'where':{'name':_0x34b4e9,'userProfileId':_0xec052c[_0x2bff('0x6f')]},'raw':!![]})[_0x2bff('0x15')](function(_0x25ce6d){if(_0x25ce6d&&_0x25ce6d[_0x2bff('0x70')]===0x0){return db[_0x2bff('0x2a')][_0x2bff('0x69')]({'name':_0x50561e['name'],'resourceId':_0x50561e['id'],'type':_0x25ce6d[_0x2bff('0x2d')],'sectionId':_0x25ce6d['id']},{})[_0x2bff('0x15')](function(){return _0x11afef;});}else{return _0x11afef;}})[_0x2bff('0x1f')](function(_0x47f859){logger[_0x2bff('0x1b')](_0x2bff('0x71'),_0x47f859);throw _0x47f859;});}return _0x11afef;})['then'](respondWithResult(_0x5c2e39,0xc9))[_0x2bff('0x1f')](handleError(_0x5c2e39,null));};exports['update']=function(_0x212a71,_0x3c8dd8){if(_0x212a71['body']['id']){delete _0x212a71[_0x2bff('0x6a')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x212a71[_0x2bff('0x67')]['id']},'include':[{'model':db[_0x2bff('0x52')],'as':'mandatoryDispositionPause'}]})[_0x2bff('0x15')](handleEntityNotFound(_0x3c8dd8,null))[_0x2bff('0x15')](saveUpdates(_0x212a71['body'],null))['then'](respondWithResult(_0x3c8dd8,null))[_0x2bff('0x1f')](handleError(_0x3c8dd8,null));};exports['destroy']=function(_0x5a3fd3,_0x289f40){return db[_0x2bff('0x53')]['find']({'where':{'id':_0x5a3fd3[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x289f40,null))[_0x2bff('0x15')](removeEntity(_0x289f40,null))[_0x2bff('0x1f')](handleError(_0x289f40,null));};exports['describe']=function(_0x20c1d3,_0x40c2b3){return db[_0x2bff('0x53')][_0x2bff('0x72')]()[_0x2bff('0x15')](respondWithResult(_0x40c2b3,null))['catch'](handleError(_0x40c2b3,null));};exports['addDisposition']=function(_0x4d9edf,_0x3f2639){if(_0x4d9edf['body']['id']){delete _0x4d9edf[_0x2bff('0x6a')]['id'];}return db[_0x2bff('0x53')]['find']({'where':{'id':_0x4d9edf[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x3f2639,null))['then'](function(_0x2751e9){if(_0x2751e9){_0x4d9edf['body']['ChatWebsiteId']=_0x2751e9['id'];return db[_0x2bff('0x73')]['create'](_0x4d9edf['body']);}})[_0x2bff('0x15')](respondWithResult(_0x3f2639,null))[_0x2bff('0x1f')](handleError(_0x3f2639,null));};exports[_0x2bff('0x74')]=function(_0x495113,_0x2dcb75){var _0xd2bdac={'raw':![],'where':{}};var _0x4e1919={};var _0x163e0f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2bff('0x75')]({'where':{'id':_0x495113[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x2dcb75,null))[_0x2bff('0x15')](function(_0x4d2a26){if(_0x4d2a26){_0x4e1919['model']=_[_0x2bff('0x56')](db[_0x2bff('0x73')][_0x2bff('0x54')]);_0x4e1919[_0x2bff('0x57')]=_[_0x2bff('0x56')](_0x495113[_0x2bff('0x57')]);_0x4e1919[_0x2bff('0x58')]=_['intersection'](_0x4e1919[_0x2bff('0x4e')],_0x4e1919[_0x2bff('0x57')]);_0xd2bdac['attributes']=_[_0x2bff('0x59')](_0x4e1919[_0x2bff('0x4e')],qs[_0x2bff('0x5b')](_0x495113[_0x2bff('0x57')][_0x2bff('0x5b')]));_0xd2bdac[_0x2bff('0x5a')]=_0xd2bdac[_0x2bff('0x5a')][_0x2bff('0x5c')]?_0xd2bdac[_0x2bff('0x5a')]:_0x4e1919['model'];if(!_0x495113[_0x2bff('0x57')]['hasOwnProperty']('nolimit')){_0xd2bdac['limit']=qs[_0x2bff('0x24')](_0x495113['query'][_0x2bff('0x24')]);_0xd2bdac[_0x2bff('0x22')]=qs[_0x2bff('0x22')](_0x495113[_0x2bff('0x57')][_0x2bff('0x22')]);}_0xd2bdac[_0x2bff('0x76')]=qs[_0x2bff('0x5d')](_0x495113[_0x2bff('0x57')][_0x2bff('0x5d')]);_0xd2bdac[_0x2bff('0x60')]=qs[_0x2bff('0x58')](_[_0x2bff('0x5e')](_0x495113[_0x2bff('0x57')],_0x4e1919[_0x2bff('0x58')]));_0xd2bdac[_0x2bff('0x60')]['ChatWebsiteId']=_0x4d2a26['id'];if(_0x495113[_0x2bff('0x57')][_0x2bff('0x5f')]){_0xd2bdac[_0x2bff('0x60')]=_[_0x2bff('0x61')](_0xd2bdac[_0x2bff('0x60')],{'$or':_[_0x2bff('0x39')](_0xd2bdac['attributes'],function(_0x41ac8){var _0x90afd5={};_0x90afd5[_0x41ac8]={'$like':'%'+_0x495113['query'][_0x2bff('0x5f')]+'%'};return _0x90afd5;})});}_0xd2bdac=_[_0x2bff('0x61')]({},_0xd2bdac,_0x495113['options']);return db['Disposition'][_0x2bff('0x25')]({'where':_0xd2bdac[_0x2bff('0x60')]})[_0x2bff('0x15')](function(_0x39b988){_0x163e0f[_0x2bff('0x25')]=_0x39b988;if(_0x495113[_0x2bff('0x57')][_0x2bff('0x68')]){_0xd2bdac[_0x2bff('0x64')]=[{'all':!![]}];}return db[_0x2bff('0x73')]['findAll'](_0xd2bdac);})[_0x2bff('0x15')](function(_0x2da863){_0x163e0f[_0x2bff('0x66')]=_0x2da863;return _0x163e0f;});}})[_0x2bff('0x15')](respondWithFilteredResult(_0x2dcb75,_0xd2bdac))[_0x2bff('0x1f')](handleError(_0x2dcb75,null));};exports[_0x2bff('0x77')]=function(_0x48e44a,_0x2179bf){return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x48e44a[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x2179bf,null))[_0x2bff('0x15')](function(_0x1f6e8c){if(_0x1f6e8c){return _0x1f6e8c['removeDispositions'](_0x48e44a[_0x2bff('0x57')]['ids']);}})[_0x2bff('0x15')](respondWithStatusCode(_0x2179bf,null))[_0x2bff('0x1f')](handleError(_0x2179bf,null));};exports['addAnswer']=function(_0x3cb156,_0x1c78b1){if(_0x3cb156[_0x2bff('0x6a')]['id']){delete _0x3cb156[_0x2bff('0x6a')]['id'];}return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x3cb156[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x1c78b1,null))[_0x2bff('0x15')](function(_0x10ae75){if(_0x10ae75){_0x3cb156['body'][_0x2bff('0x78')]=_0x10ae75['id'];return db[_0x2bff('0x79')][_0x2bff('0x69')](_0x3cb156[_0x2bff('0x6a')]);}})['then'](respondWithResult(_0x1c78b1,null))[_0x2bff('0x1f')](handleError(_0x1c78b1,null));};exports[_0x2bff('0x7a')]=function(_0x92e93,_0x23d30b){var _0x3f3856={'raw':![],'where':{}};var _0x5920ad={};var _0x4ca62a={'count':0x0,'rows':[]};return db[_0x2bff('0x53')][_0x2bff('0x75')]({'where':{'id':_0x92e93['params']['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x23d30b,null))[_0x2bff('0x15')](function(_0x17ef3f){if(_0x17ef3f){_0x5920ad[_0x2bff('0x4e')]=_['keys'](db[_0x2bff('0x79')]['rawAttributes']);_0x5920ad['query']=_[_0x2bff('0x56')](_0x92e93[_0x2bff('0x57')]);_0x5920ad['filters']=_[_0x2bff('0x59')](_0x5920ad[_0x2bff('0x4e')],_0x5920ad[_0x2bff('0x57')]);_0x3f3856[_0x2bff('0x5a')]=_[_0x2bff('0x59')](_0x5920ad[_0x2bff('0x4e')],qs[_0x2bff('0x5b')](_0x92e93[_0x2bff('0x57')][_0x2bff('0x5b')]));_0x3f3856[_0x2bff('0x5a')]=_0x3f3856[_0x2bff('0x5a')][_0x2bff('0x5c')]?_0x3f3856[_0x2bff('0x5a')]:_0x5920ad[_0x2bff('0x4e')];if(!_0x92e93[_0x2bff('0x57')][_0x2bff('0x7b')](_0x2bff('0x7c'))){_0x3f3856[_0x2bff('0x24')]=qs['limit'](_0x92e93[_0x2bff('0x57')][_0x2bff('0x24')]);_0x3f3856['offset']=qs[_0x2bff('0x22')](_0x92e93[_0x2bff('0x57')]['offset']);}_0x3f3856[_0x2bff('0x76')]=qs[_0x2bff('0x5d')](_0x92e93['query'][_0x2bff('0x5d')]);_0x3f3856[_0x2bff('0x60')]=qs[_0x2bff('0x58')](_['pick'](_0x92e93[_0x2bff('0x57')],_0x5920ad['filters']));_0x3f3856[_0x2bff('0x60')]['ChatWebsiteId']=_0x17ef3f['id'];if(_0x92e93['query']['filter']){_0x3f3856[_0x2bff('0x60')]=_[_0x2bff('0x61')](_0x3f3856[_0x2bff('0x60')],{'$or':_[_0x2bff('0x39')](_0x3f3856[_0x2bff('0x5a')],function(_0x2db529){var _0x2c31a3={};_0x2c31a3[_0x2db529]={'$like':'%'+_0x92e93[_0x2bff('0x57')]['filter']+'%'};return _0x2c31a3;})});}_0x3f3856=_[_0x2bff('0x61')]({},_0x3f3856,_0x92e93[_0x2bff('0x63')]);return db['CannedAnswer'][_0x2bff('0x25')]({'where':_0x3f3856[_0x2bff('0x60')]})[_0x2bff('0x15')](function(_0x25046a){_0x4ca62a[_0x2bff('0x25')]=_0x25046a;if(_0x92e93[_0x2bff('0x57')][_0x2bff('0x68')]){_0x3f3856[_0x2bff('0x64')]=[{'all':!![]}];}return db[_0x2bff('0x79')][_0x2bff('0x65')](_0x3f3856);})['then'](function(_0x28c337){_0x4ca62a['rows']=_0x28c337;return _0x4ca62a;});}})['then'](respondWithFilteredResult(_0x23d30b,_0x3f3856))[_0x2bff('0x1f')](handleError(_0x23d30b,null));};exports['removeAnswers']=function(_0x1a7fbb,_0x20f82e){return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x1a7fbb[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x20f82e,null))['then'](function(_0x628300){if(_0x628300){return _0x628300[_0x2bff('0x7d')](_0x1a7fbb['query'][_0x2bff('0x7e')]);}})['then'](respondWithStatusCode(_0x20f82e,null))['catch'](handleError(_0x20f82e,null));};exports['addLogo']=function(_0x203d0c,_0x1112a0){_0x203d0c[_0x2bff('0x6a')][_0x2bff('0x7f')]=_0x203d0c['file'][_0x2bff('0x80')];return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x203d0c['params']['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x1112a0,null))[_0x2bff('0x15')](saveUpdates(_0x203d0c[_0x2bff('0x6a')],null))['then'](respondWithResult(_0x1112a0,null))[_0x2bff('0x1f')](handleError(_0x1112a0,null));};exports[_0x2bff('0x81')]=function(_0x37f61e,_0x13a2be){_0x37f61e[_0x2bff('0x6a')][_0x2bff('0x82')]=_0x37f61e[_0x2bff('0x83')][_0x2bff('0x80')];return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x37f61e[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x13a2be,null))['then'](saveUpdates(_0x37f61e['body'],null))[_0x2bff('0x15')](respondWithResult(_0x13a2be,null))[_0x2bff('0x1f')](handleError(_0x13a2be,null));};exports['addCustomerAvatar']=function(_0x476152,_0x16d47c){_0x476152[_0x2bff('0x6a')]['customerAvatar']=_0x476152[_0x2bff('0x83')]['filename'];return db['ChatWebsite'][_0x2bff('0x6e')]({'where':{'id':_0x476152[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x16d47c,null))[_0x2bff('0x15')](saveUpdates(_0x476152[_0x2bff('0x6a')],null))[_0x2bff('0x15')](respondWithResult(_0x16d47c,null))[_0x2bff('0x1f')](handleError(_0x16d47c,null));};exports[_0x2bff('0x84')]=function(_0x7be39e,_0x286c0d){_0x7be39e[_0x2bff('0x6a')][_0x2bff('0x85')]=_0x7be39e[_0x2bff('0x83')][_0x2bff('0x80')];return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x7be39e[_0x2bff('0x67')]['id']}})['then'](handleEntityNotFound(_0x286c0d,null))[_0x2bff('0x15')](saveUpdates(_0x7be39e[_0x2bff('0x6a')],null))[_0x2bff('0x15')](respondWithResult(_0x286c0d,null))[_0x2bff('0x1f')](handleError(_0x286c0d,null));};exports[_0x2bff('0x86')]=function(_0x5be965,_0x99c3b2){var _0x4cc1b3=path['join'](config[_0x2bff('0x87')],_0x2bff('0x88'));var _0x302c6d={'where':{'id':_0x5be965['params']['id']},'attributes':['id',_0x2bff('0x7f')],'raw':!![]};var _0x1e2d4f=![];return require(_0x2bff('0x89'))[_0x2bff('0x8a')]()['then'](function(_0x5742c5){if(_0x5742c5){_0x1e2d4f=_0x5742c5[_0x2bff('0x8b')];}})[_0x2bff('0x15')](function(){return db[_0x2bff('0x53')][_0x2bff('0x6e')](_0x302c6d);})[_0x2bff('0x15')](handleEntityNotFound(_0x99c3b2,null))[_0x2bff('0x15')](function(_0x1883e4){if(_0x1883e4){if(!_[_0x2bff('0x8c')](_0x1883e4['sitepic'])){if(fs[_0x2bff('0x8d')](path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0x8f'),_0x1883e4[_0x2bff('0x7f')]))&&_0x1e2d4f){_0x4cc1b3=path[_0x2bff('0x8e')](config['root'],_0x2bff('0x8f'),_0x1883e4[_0x2bff('0x7f')]);}}return _0x99c3b2[_0x2bff('0x90')](_0x4cc1b3);}})[_0x2bff('0x1f')](handleError(_0x99c3b2,null));};exports[_0x2bff('0x91')]=function(_0x6d3362,_0x45c77d){var _0x5c68de=path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0x92'));var _0xaaf628={'where':{'id':_0x6d3362[_0x2bff('0x67')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x2bff('0x53')][_0x2bff('0x6e')](_0xaaf628)[_0x2bff('0x15')](handleEntityNotFound(_0x45c77d,null))['then'](function(_0x2684eb){if(_0x2684eb){if(!_['isNil'](_0x2684eb[_0x2bff('0x82')])){if(fs[_0x2bff('0x8d')](path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0x93'),_0x2684eb[_0x2bff('0x82')]))){_0x5c68de=path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0x93'),_0x2684eb[_0x2bff('0x82')]);}}return _0x45c77d[_0x2bff('0x90')](_0x5c68de);}})[_0x2bff('0x1f')](handleError(_0x45c77d,null));};exports[_0x2bff('0x94')]=function(_0x5b7cb2,_0x28ff35){var _0x22d0f4=path[_0x2bff('0x8e')](config[_0x2bff('0x87')],'server/files/images/avatars/customer_avatar.png');var _0x492eb4={'where':{'id':_0x5b7cb2['params']['id']},'attributes':['id',_0x2bff('0x95'),_0x2bff('0x96')],'raw':!![]};return db[_0x2bff('0x53')][_0x2bff('0x6e')](_0x492eb4)[_0x2bff('0x15')](handleEntityNotFound(_0x28ff35,null))[_0x2bff('0x15')](function(_0xc6967e){if(_0xc6967e){if(!_[_0x2bff('0x8c')](_0xc6967e[_0x2bff('0x95')])){if(fs['existsSync'](path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0x93'),_0xc6967e['customerAvatar']))&&_0xc6967e[_0x2bff('0x96')]){_0x22d0f4=path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0x93'),_0xc6967e['customerAvatar']);}}return _0x28ff35[_0x2bff('0x90')](_0x22d0f4);}})[_0x2bff('0x1f')](handleError(_0x28ff35,null));};exports[_0x2bff('0x97')]=function(_0x4b6604,_0x437df5){var _0xb7d8a4=path['join'](config['root'],_0x2bff('0x98'));var _0x229ef7={'where':{'id':_0x4b6604[_0x2bff('0x67')]['id']},'attributes':['id',_0x2bff('0x85')],'raw':!![]};return db[_0x2bff('0x53')][_0x2bff('0x6e')](_0x229ef7)[_0x2bff('0x15')](handleEntityNotFound(_0x437df5,null))['then'](function(_0x1ae266){if(_0x1ae266){if(!_[_0x2bff('0x8c')](_0x1ae266[_0x2bff('0x85')])){if(fs['existsSync'](path[_0x2bff('0x8e')](config['root'],'server/files/images/avatars/',_0x1ae266[_0x2bff('0x85')]))){_0xb7d8a4=path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0x93'),_0x1ae266[_0x2bff('0x85')]);}}return _0x437df5[_0x2bff('0x90')](_0xb7d8a4);}})[_0x2bff('0x1f')](handleError(_0x437df5,null));};exports[_0x2bff('0x99')]=function(_0x57b296,_0x38bd71){var _0x364aae={'body':_0x57b296['body'],'channel':_0x2bff('0x9a')};var _0x4c28f1=[];var _0x1ca298=[];var _0x10f82f={};var _0x3fe972=![];return db[_0x2bff('0x9b')][_0x2bff('0x72')]()['then'](function(_0x1d339a){if(!_0x1d339a){throw new db[(_0x2bff('0x9c'))][(_0x2bff('0x9d'))]('no\x20available\x20attributes');}_0x4c28f1=_['difference'](_[_0x2bff('0x56')](_0x1d339a),['createdAt','updatedAt']);_0x1ca298=_[_0x2bff('0x9e')](_[_0x2bff('0x56')](_0x1d339a),['createdAt',_0x2bff('0x9f'),_0x2bff('0xa0'),_0x2bff('0xa1')]);if(_0x57b296[_0x2bff('0x6a')]['id']){delete _0x57b296[_0x2bff('0x6a')]['id'];}if(_[_0x2bff('0x8c')](_0x57b296[_0x2bff('0x6a')]['from'])){throw new db['Sequelize'][(_0x2bff('0x9d'))]('from\x20is\x20mandatory');}if(_[_0x2bff('0x8c')](_0x57b296['body'][_0x2bff('0x6a')])||_0x57b296[_0x2bff('0x6a')]['body']===''){throw new db[(_0x2bff('0x9c'))][(_0x2bff('0x9d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2bff('0x8c')](_0x57b296[_0x2bff('0x6a')][_0x2bff('0xa2')])){throw new db[(_0x2bff('0x9c'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1ca298);}if(!_[_0x2bff('0xa3')](_0x1ca298,_0x57b296[_0x2bff('0x6a')][_0x2bff('0xa2')])){throw new db['Sequelize'][(_0x2bff('0x9d'))](_0x2bff('0xa4')+_0x1ca298);}_0x10f82f[_0x57b296[_0x2bff('0x6a')][_0x2bff('0xa2')]]=_0x57b296[_0x2bff('0x6a')][_0x2bff('0xa5')];})[_0x2bff('0x15')](function(){return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x57b296[_0x2bff('0x67')]['id']},'include':[{'model':db[_0x2bff('0xa6')],'as':_0x2bff('0xa7'),'include':[{'model':db[_0x2bff('0x9b')],'as':_0x2bff('0xa8'),'where':_0x10f82f,'limit':0x1,'order':[[_0x2bff('0x9f'),_0x2bff('0xa9')]]}]},{'model':db['ChatApplication'],'as':_0x2bff('0xaa')},{'model':db['Interval'],'as':_0x2bff('0x3a'),'include':[{'model':db[_0x2bff('0x3a')],'as':_0x2bff('0x3b'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x2bff('0x15')](function(_0x33c7b4){if(!_0x33c7b4)throw new APINotFoundError(util[_0x2bff('0x30')](_0x2bff('0xab'),_0x57b296[_0x2bff('0x67')]['id']));if(!_0x33c7b4[_0x2bff('0x3a')]||!_0x33c7b4[_0x2bff('0x3a')][_0x2bff('0x3b')])return[_0x33c7b4,!![]];return[_0x33c7b4,checkWebsiteIntervals(_0x33c7b4)];})[_0x2bff('0xac')](function(_0x90e90f,_0x217740){if(!_0x217740)throw new APIOutOfIntervalError();if(!_0x90e90f['List'])return;_0x364aae[_0x2bff('0xad')]=_0x90e90f;_0x364aae['list']=_0x90e90f[_0x2bff('0xa7')];_0x364aae[_0x2bff('0xae')]=_['orderBy'](_0x90e90f[_0x2bff('0xaa')],[_0x2bff('0xaf')],[_0x2bff('0xb0')]);if(_0x364aae[_0x2bff('0xad')][_0x2bff('0xaa')]){delete _0x364aae[_0x2bff('0xad')]['Applications'];}if(_0x364aae['account']['List']&&_0x364aae['account'][_0x2bff('0xa7')]['Contacts'][_0x2bff('0x5c')]){return _0x364aae[_0x2bff('0xad')][_0x2bff('0xa7')][_0x2bff('0xa8')][0x0];}var _0x4b69d8=_[_0x2bff('0xb1')](_0x57b296[_0x2bff('0x6a')],{'firstName':_0x57b296['body'][_0x2bff('0xa5')],'ListId':_0x90e90f[_0x2bff('0xa1')]});_0x4b69d8[_0x57b296[_0x2bff('0x6a')][_0x2bff('0xa2')]]=_0x57b296[_0x2bff('0x6a')]['from'];return db[_0x2bff('0x9b')]['create'](_0x4b69d8,{'fields':_0x4c28f1,'raw':!![]});})[_0x2bff('0x15')](function(_0x3000c5){_0x364aae[_0x2bff('0xb2')]=_0x3000c5;var _0x3b131d=createInteractionObject(_0x57b296[_0x2bff('0x67')]['id'],_0x57b296[_0x2bff('0x6a')],_0x57b296[_0x2bff('0xb3')],_0x3000c5);var _0x3c5e05={'ChatWebsiteId':_0x57b296['params']['id'],'closed':![]};if(_0x57b296['body'][_0x2bff('0xb4')]){_0x3c5e05[_0x2bff('0xb4')]=_0x57b296['body'][_0x2bff('0xb4')];return db[_0x2bff('0xb5')][_0x2bff('0x6e')]({'where':_0x3c5e05})['then'](function(_0x4b2137){if(_0x4b2137){_0x3fe972=!![];return _0x4b2137;}_0x3b131d[_0x2bff('0xb4')]=_0x57b296[_0x2bff('0x6a')][_0x2bff('0xb4')];_0x3b131d['externalUrl']=_0x57b296[_0x2bff('0x6a')][_0x2bff('0xb6')];return db['ChatInteraction'][_0x2bff('0x69')](_0x3b131d);});}_0x3c5e05[_0x2bff('0xb7')]=_0x3000c5['id'];if(_0x57b296[_0x2bff('0x6a')]['interaction']&&_0x57b296['body'][_0x2bff('0xb8')]['id']){_0x3c5e05['id']=_0x57b296['body'][_0x2bff('0xb8')]['id'];return db[_0x2bff('0xb5')]['find']({'where':_0x3c5e05})[_0x2bff('0x15')](function(_0x8f1149){if(_0x8f1149){_0x3fe972=!![];return _0x8f1149;}return db[_0x2bff('0xb5')][_0x2bff('0x69')](_0x3b131d);});}return db[_0x2bff('0xb5')][_0x2bff('0x69')](_0x3b131d);})[_0x2bff('0x15')](function(_0x5239d0){if(!_0x3fe972)return _0x5239d0;var _0x43c38b={'from':(_0x364aae[_0x2bff('0xb2')][_0x2bff('0xb9')]||'')+'\x20'+(_0x364aae[_0x2bff('0xb2')][_0x2bff('0x46')]||'')};if(_0x57b296[_0x2bff('0x6a')][_0x2bff('0xb4')]&&_0x57b296['body'][_0x2bff('0xba')]&&_0x57b296[_0x2bff('0x6a')][_0x2bff('0xb4')]!=_0x57b296[_0x2bff('0x6a')][_0x2bff('0xba')]){_0x43c38b[_0x2bff('0xb4')]=_0x57b296['body'][_0x2bff('0xba')];}return _0x5239d0['update'](_0x43c38b);})[_0x2bff('0x15')](function(_0x5c4c6a){_0x364aae[_0x2bff('0xb8')]=_0x5c4c6a[_0x2bff('0x28')]({'plain':!![]});_0x364aae[_0x2bff('0xb8')][_0x2bff('0xbb')]=!_0x3fe972;if(_0x364aae[_0x2bff('0xb8')][_0x2bff('0xbb')]){if(_0x364aae['account'][_0x2bff('0xbc')]){_0x364aae[_0x2bff('0xae')][_0x2bff('0xbd')]({'id':0x0,'priority':_0x364aae[_0x2bff('0xae')][_0x2bff('0x5c')]+0x1,'app':_0x2bff('0xbe'),'appdata':_0x2bff('0xbf'),'interval':_0x2bff('0xc0')});}}return db['ChatMessage'][_0x2bff('0x69')]({'body':_0x57b296['body'][_0x2bff('0x6a')],'ChatWebsiteId':_0x57b296[_0x2bff('0x67')]['id'],'ChatInteractionId':_0x5c4c6a['id'],'direction':'in','ContactId':_0x364aae[_0x2bff('0xb2')]['id'],'AttachmentId':_0x57b296['body'][_0x2bff('0xc1')]});})['then'](function(_0x4d7ecf){_0x364aae[_0x2bff('0x1d')]=_0x4d7ecf;if(!_0x364aae[_0x2bff('0xb8')]['UserId']){return;}return db[_0x2bff('0xc2')][_0x2bff('0x6e')]({'attributes':['id',_0x2bff('0x2d')],'where':{'id':_0x364aae[_0x2bff('0xb8')][_0x2bff('0xc3')]}});})[_0x2bff('0x15')](function(_0x9e5373){if(_0x9e5373){_0x364aae[_0x2bff('0xae')][_0x2bff('0xc4')]({'id':0x0,'priority':0x0,'app':_0x2bff('0xc5'),'appdata':_0x9e5373[_0x2bff('0x2d')]+','+(_0x364aae[_0x2bff('0xad')][_0x2bff('0xc6')]||0xa),'interval':_0x2bff('0xc0')});_0x364aae[_0x2bff('0xc7')]=!![];}if(!_0x364aae[_0x2bff('0xb8')][_0x2bff('0xc8')]){return;}return db[_0x2bff('0xc9')][_0x2bff('0x6e')]({'attributes':['id',_0x2bff('0x2d')],'where':{'id':_0x364aae['interaction']['queueId']}});})['then'](function(_0x507153){if(_0x507153){_0x364aae[_0x2bff('0xae')][_0x2bff('0xc4')]({'id':0x0,'priority':0x1,'app':_0x2bff('0xca'),'appdata':_0x507153[_0x2bff('0x2d')]+','+(_0x364aae['account'][_0x2bff('0xcb')]||0x12c),'interval':_0x2bff('0xc0')});}return respondWithRpcPromise(_0x2bff('0xcc'),_0x2bff('0xcd'),_0x364aae);})['then'](function(_0x2f92d8){respondWithRpcPromise('EventManager','EventManager',{'event':_0x2bff('0x99'),'message':_0x2f92d8},client9002);return _0x2f92d8;})[_0x2bff('0x15')](respondWithResult(_0x38bd71,null))[_0x2bff('0x1f')](APIHandleError(_0x38bd71));};exports[_0x2bff('0xce')]=function(_0x245c21,_0x51523e){var _0x4d3c3a,_0x35da45,_0x233f90;var _0x1256bb=[];var _0x547e90={};var _0xe8a7c9=_0x245c21[_0x2bff('0xcf')]||[];var _0xc0a20d=[];var _0x3a984f;return db['CmContact'][_0x2bff('0x72')]()[_0x2bff('0x15')](function(_0x76c09a){if(!_0x76c09a){throw new db[(_0x2bff('0x9c'))][(_0x2bff('0x9d'))](_0x2bff('0xd0'));}_0x1256bb=_[_0x2bff('0x9e')](_[_0x2bff('0x56')](_0x76c09a),[_0x2bff('0xd1'),_0x2bff('0x9f'),_0x2bff('0xa0'),'ListId']);if(_0x245c21[_0x2bff('0x6a')]['id']){delete _0x245c21[_0x2bff('0x6a')]['id'];}if(_[_0x2bff('0x8c')](_0x245c21['body'][_0x2bff('0xa5')])){throw _0x51523e['status'](0x1f4)[_0x2bff('0xd2')](new db['Sequelize'][(_0x2bff('0x9d'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x245c21[_0x2bff('0x6a')][_0x2bff('0x6a')])||_0x245c21['body']['body']===''){throw _0x51523e[_0x2bff('0x26')](0x1f4)[_0x2bff('0xd2')](new db[(_0x2bff('0x9c'))][(_0x2bff('0x9d'))](_0x2bff('0xd3')));}if(_[_0x2bff('0x8c')](_0x245c21[_0x2bff('0x6a')]['mapKeyOffline'])){throw _0x51523e['status'](0x1f4)[_0x2bff('0xd2')](new db[(_0x2bff('0x9c'))][(_0x2bff('0x9d'))](_0x2bff('0xd4')+_0x1256bb));}if(!_[_0x2bff('0xa3')](_0x1256bb,_0x245c21[_0x2bff('0x6a')][_0x2bff('0xd5')])){throw _0x51523e[_0x2bff('0x26')](0x1f4)[_0x2bff('0xd2')](new db[(_0x2bff('0x9c'))][(_0x2bff('0x9d'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1256bb));}_0x547e90[_0x245c21[_0x2bff('0x6a')][_0x2bff('0xd5')]]=_0x245c21[_0x2bff('0x6a')][_0x2bff('0xa5')];})[_0x2bff('0x15')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x245c21[_0x2bff('0x67')]['id']},'include':[{'model':db[_0x2bff('0xa6')],'as':'List'},{'model':db[_0x2bff('0xd6')],'as':_0x2bff('0xd6')}]});})['then'](handleEntityNotFound(_0x51523e,null))['then'](function(_0x55ea5c){if(_0x55ea5c&&_0x55ea5c[_0x2bff('0xa7')]){_0x35da45=_0x55ea5c;var _0x34b276=_[_0x2bff('0xb1')](_0x245c21[_0x2bff('0x6a')],{'firstName':_0x245c21[_0x2bff('0x6a')][_0x2bff('0xa5')],'phone':_0x245c21[_0x2bff('0x6a')][_0x2bff('0xa5')],'ListId':_0x55ea5c['ListId']});_0x34b276[_0x245c21[_0x2bff('0x6a')][_0x2bff('0xd5')]]=_0x245c21['body'][_0x2bff('0xa5')];return db[_0x2bff('0x9b')][_0x2bff('0xd7')]({'where':_0x547e90,'defaults':_0x34b276});}})[_0x2bff('0xac')](function(_0x840292){if(_0x840292){_0x233f90=_0x840292;var _0xd7a0b4=fs[_0x2bff('0xd8')](path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0xd9')),_0x2bff('0xda'));var _0x25316e=ejs[_0x2bff('0xdb')](_0xd7a0b4,{'body':_[_0x2bff('0xdc')](_0x245c21[_0x2bff('0x6a')][_0x2bff('0x6a')]),'bodyTitle':_0x35da45[_0x2bff('0xdd')]});return db['ChatOfflineMessage']['create']({'body':_0x25316e,'plainBody':htmlToText['fromString'](_0x25316e),'ContactId':_0x840292['id'],'ChatWebsiteId':_0x35da45['id']});}})[_0x2bff('0x15')](function(_0x30dae9){_0x3a984f=_0x30dae9;if(_0xe8a7c9[_0x2bff('0x5c')]){var _0x99cb66=_0xe8a7c9['map'](function(_0x147810){return{'name':_0x147810[_0x2bff('0xde')],'basename':_0x147810[_0x2bff('0x80')],'type':_0x147810[_0x2bff('0xdf')],'ChatOfflineMessageId':_0x30dae9['id']};});_0xc0a20d=_0x99cb66[_0x2bff('0x39')](_0x106487=>{var _0x8016e={'filename':_0x106487[_0x2bff('0x2d')],'path':path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0xe0'),_0x2bff('0xcf'),_0x2bff('0xe1'),_0x2bff('0xe2'),_0x106487[_0x2bff('0xe3')])};return _0x8016e;});if(!_0x35da45[_0x2bff('0xe4')]){return db[_0x2bff('0xe5')]['transaction'](function(_0xde922c){return db['Attachment']['bulkCreate'](_0x99cb66,{'transaction':_0xde922c});});}}})['then'](function(){if(_0x3a984f){_0x4d3c3a=_0x3a984f;return db[_0x2bff('0xd6')][_0x2bff('0x75')]({'where':{'service':!![]},'include':[{'model':db[_0x2bff('0xe6')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x2bff('0xe7')],'as':_0x2bff('0xe7'),'raw':!![]}]}]});}})[_0x2bff('0x15')](function(_0x2407fd){if(_0x2407fd&&_0x2407fd[_0x2bff('0xe8')]&&_0x35da45['forwardOffline']&&_0x35da45[_0x2bff('0xe9')]){var _0x32820a=_0x2407fd[_0x2bff('0xea')]();return respondWithRpcPromise(_0x2bff('0xeb'),_0x2bff('0xec'),{'account':_0x32820a,'message':{'from':util[_0x2bff('0x30')]('\x22%s\x22\x20<%s>',_0x2407fd[_0x2bff('0x2d')],_0x2407fd[_0x2bff('0xed')]||_0x2407fd[_0x2bff('0xe8')][_0x2bff('0x6b')]),'to':_0x35da45['forwardOfflineAddress'],'subject':_0x35da45[_0x2bff('0xee')],'html':_0x4d3c3a[_0x2bff('0x6a')],'attachments':_0xc0a20d}},client9003)[_0x2bff('0x15')](function(){return _0x4d3c3a;})[_0x2bff('0x1f')](function(_0x21c3b9){logger[_0x2bff('0x1b')](_0x21c3b9);});}})[_0x2bff('0x15')](function(){if(_0x35da45&&_0x35da45['openNewInteraction']&&_0x35da45[_0x2bff('0xef')]){var _0x5bdb9c=[];if(_0xe8a7c9[_0x2bff('0x5c')]){_0x5bdb9c=_0xe8a7c9[_0x2bff('0x39')](function(_0x481182){return{'name':_0x481182[_0x2bff('0xde')],'basename':_0x481182[_0x2bff('0x80')],'type':_0x481182[_0x2bff('0xdf')],'ChatOfflineMessageId':_0x3a984f['id']};});}var _0x353eb0;if(!_['isNil'](_0x35da45[_0x2bff('0xf0')])){var _0x343928=_['map'](_0x245c21['body'],function(_0x1125d5){return _0x1125d5;});var _0x31cfdd=_[_0x2bff('0xf1')](_0x343928)[0x0];var _0xe56304=_[_0x2bff('0xf2')](_0x31cfdd,function(_0x53c058){return _0x53c058;});_0x353eb0=_0xe56304[0x1][_0x35da45['subjectOffline']];}var _0x317a4f={'from':_0x233f90[_0x2bff('0xed')],'firstName':_0x233f90[_0x2bff('0xb9')],'lastName':_0x233f90[_0x2bff('0x46')],'mapKey':_0x2bff('0xed'),'message':{'from':_0x233f90[_0x2bff('0xed')],'to':_0x35da45[_0x2bff('0xd6')]['email'],'cc':'','subject':_[_0x2bff('0x8c')](_0x353eb0)?_0x35da45[_0x2bff('0xee')]:_0x353eb0,'messageId':'','sentAt':new Date(),'attach':_0x5bdb9c[_0x2bff('0x5c')],'attachments':_0x5bdb9c,'originChannel':_0x2bff('0xf3'),'ChatWebsiteId':_0x35da45['id'],'ChatOfflineMessageId':_0x4d3c3a['id'],'originTo':_0x35da45[_0x2bff('0xd6')][_0x2bff('0xed')]},'body':_0x4d3c3a[_0x2bff('0x6a')]};var _0x120186={'account':{'id':_0x35da45[_0x2bff('0xef')]},'body':_0x317a4f,'log':_0x2bff('0xf4')};return respondWithRpcPromise(_0x2bff('0xf4'),_0x2bff('0xf5'),_0x120186,client9001)[_0x2bff('0x15')](function(){return _0x4d3c3a;})[_0x2bff('0x1f')](function(_0x1dd021){logger[_0x2bff('0x1b')](_0x1dd021);});}return;})[_0x2bff('0x15')](function(){if(_0x4d3c3a){return _0x4d3c3a;}})[_0x2bff('0x15')](respondWithResult(_0x51523e,null))['catch'](function(){for(var _0xd05e0b of _0xe8a7c9){var _0x4be99e=path['join'](config['root'],_0x2bff('0xe0'),_0x2bff('0xcf'),_0x2bff('0xe1'),_0x2bff('0xe2'),_0xd05e0b['filename']);fs_extra[_0x2bff('0xf6')](_0x4be99e)[_0x2bff('0x1f')](function(_0x5b62fc){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x4be99e,_0x5b62fc);});}});};exports[_0x2bff('0xf7')]=function(_0x969cdd,_0x5351bc){return db[_0x2bff('0xb5')]['find']({'where':{'id':_0x969cdd[_0x2bff('0x67')]['id']}})['then'](handleEntityNotFound(_0x5351bc,null))[_0x2bff('0x15')](function(_0x4b4e9a){if(_0x4b4e9a){return _0x4b4e9a[_0x2bff('0xf7')](_0x969cdd['body']['ids'],_[_0x2bff('0xf8')](_0x969cdd[_0x2bff('0x6a')],[_0x2bff('0x7e'),'id'])||{});}})[_0x2bff('0x15')](respondWithResult(_0x5351bc,null))[_0x2bff('0x1f')](handleError(_0x5351bc,null));};exports['getInteractions']=function(_0x3c138d,_0x2e6e4b){var _0x2ae31a={'raw':![],'where':{}};var _0x16e837={};var _0x137e70={'count':0x0,'rows':[]};return db[_0x2bff('0x53')][_0x2bff('0x75')]({'where':{'id':_0x3c138d['params']['id']}})['then'](handleEntityNotFound(_0x2e6e4b,null))[_0x2bff('0x15')](function(_0x4ba82e){if(_0x4ba82e){_0x16e837[_0x2bff('0x4e')]=_[_0x2bff('0x56')](db[_0x2bff('0xb5')][_0x2bff('0x54')]);_0x16e837[_0x2bff('0x57')]=_[_0x2bff('0x56')](_0x3c138d[_0x2bff('0x57')]);_0x16e837['filters']=_[_0x2bff('0x59')](_0x16e837[_0x2bff('0x4e')],_0x16e837[_0x2bff('0x57')]);_0x2ae31a['attributes']=_['intersection'](_0x16e837[_0x2bff('0x4e')],qs[_0x2bff('0x5b')](_0x3c138d[_0x2bff('0x57')]['fields']));_0x2ae31a[_0x2bff('0x5a')]=_0x2ae31a['attributes'][_0x2bff('0x5c')]?_0x2ae31a[_0x2bff('0x5a')]:_0x16e837['model'];if(!_0x3c138d[_0x2bff('0x57')][_0x2bff('0x7b')](_0x2bff('0x7c'))){_0x2ae31a[_0x2bff('0x24')]=qs['limit'](_0x3c138d['query'][_0x2bff('0x24')]);_0x2ae31a['offset']=qs[_0x2bff('0x22')](_0x3c138d[_0x2bff('0x57')]['offset']);}_0x2ae31a[_0x2bff('0x76')]=qs[_0x2bff('0x5d')](_0x3c138d[_0x2bff('0x57')][_0x2bff('0x5d')]);_0x2ae31a['where']=qs[_0x2bff('0x58')](_[_0x2bff('0x5e')](_0x3c138d[_0x2bff('0x57')],_0x16e837[_0x2bff('0x58')]));_0x2ae31a[_0x2bff('0x60')]['ChatWebsiteId']=_0x4ba82e['id'];if(_0x3c138d[_0x2bff('0x57')]['filter']){_0x2ae31a[_0x2bff('0x60')]=_['merge'](_0x2ae31a[_0x2bff('0x60')],{'$or':_['map'](_0x2ae31a[_0x2bff('0x5a')],function(_0x50ed9e){var _0xda666f={};_0xda666f[_0x50ed9e]={'$like':'%'+_0x3c138d[_0x2bff('0x57')][_0x2bff('0x5f')]+'%'};return _0xda666f;})});}_0x2ae31a=_[_0x2bff('0x61')]({},_0x2ae31a,_0x3c138d['options']);return db[_0x2bff('0xb5')]['count']({'where':_0x2ae31a['where']})[_0x2bff('0x15')](function(_0x1cb33c){_0x137e70[_0x2bff('0x25')]=_0x1cb33c;if(_0x3c138d[_0x2bff('0x57')][_0x2bff('0x68')]){_0x2ae31a[_0x2bff('0x64')]=[{'model':db[_0x2bff('0x9b')],'as':_0x2bff('0xf9'),'required':![]},{'model':db['User'],'as':_0x2bff('0xfa'),'attributes':[_0x2bff('0x2d'),_0x2bff('0xfb'),_0x2bff('0xfc')],'required':![]},{'model':db[_0x2bff('0xfd')],'as':'Tags','attributes':['id',_0x2bff('0x2d'),_0x2bff('0xfe')],'where':_0x3c138d[_0x2bff('0x57')]['tag']?{'id':_0x3c138d[_0x2bff('0x57')][_0x2bff('0xff')]}:undefined,'required':_0x3c138d[_0x2bff('0x57')][_0x2bff('0xff')]?!![]:![]}];}return db['ChatInteraction'][_0x2bff('0x65')](_0x2ae31a);})[_0x2bff('0x15')](function(_0x33a47c){_0x137e70[_0x2bff('0x66')]=_0x33a47c;return _0x137e70;});}})[_0x2bff('0x15')](respondWithFilteredResult(_0x2e6e4b,_0x2ae31a))[_0x2bff('0x1f')](handleError(_0x2e6e4b,null));};exports[_0x2bff('0x2f')]=function(_0x22a79a,_0x42aaea){var _0x2d6540=0x0;var _0x441712=0x0;var _0x519bac=![];var _0x2f3623;var _0x3e911d;return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x22a79a[_0x2bff('0x67')]['id']},'include':[{'model':db[_0x2bff('0x3a')],'as':_0x2bff('0x3a'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x2bff('0x32')]}]}]})[_0x2bff('0x15')](handleEntityNotFound(_0x42aaea,null))[_0x2bff('0x15')](function(_0x45785d){if(_0x45785d){_0x2f3623=_0x45785d;return _0x45785d['getProactiveActions']({'raw':!![]});}})[_0x2bff('0x15')](function(_0x1f4aa5){if(_0x2f3623){if(_0x1f4aa5){_0x3e911d=_0x1f4aa5;}}return require('../../config/license/util')[_0x2bff('0x8a')]();})['then'](function(_0x514e2f){if(_0x514e2f){_0x441712=_0x514e2f[_0x2bff('0x100')];_0x519bac=_0x514e2f[_0x2bff('0x8b')];}})[_0x2bff('0x15')](function(){return db[_0x2bff('0xb5')][_0x2bff('0x25')]({'where':{'closed':![]}});})[_0x2bff('0x15')](function(_0x1bbe97){_0x2d6540=_0x1bbe97;if(_0x441712&&_0x1bbe97>_0x441712){return db['License']['findOne']({'where':{'id':0x1}})[_0x2bff('0x15')](function(_0x3beac8){if(_0x3beac8){_0x3beac8[_0x2bff('0x101')](_0x2bff('0x102'));}});}})[_0x2bff('0x15')](function(){if(!_0x2f3623[_0x2bff('0x3a')]||!_0x2f3623['Interval'][_0x2bff('0x3b')])return!![];return checkWebsiteIntervals(_0x2f3623);})['then'](function(_0x29b888){var _0x22810e=fs[_0x2bff('0xd8')](path[_0x2bff('0x8e')](config[_0x2bff('0x87')],'server/files/chat/iframe.ejs'),_0x2bff('0xda'));var _0x4aff0c=new url[(_0x2bff('0x103'))](_0x2f3623[_0x2bff('0x104')])[_0x2bff('0x105')];var _0x55aab5=_0x2bff('0x106');var _0x5cdec4=![];var _0x143684={'chatVersion':_0x55aab5,'chatWebsiteAddressOrigin':_0x4aff0c,'remote':_0x2f3623['remote'],'query':querystring[_0x2bff('0x1a')](_[_0x2bff('0x61')](_0x2f3623[_0x2bff('0x28')]({'plain':!![]}),{'customerIp':_0x22a79a['headers'][_0x2bff('0x43')]||_0x22a79a['headers'][_0x2bff('0x107')]||_0x22a79a[_0x2bff('0x108')][_0x2bff('0x109')]||_0x22a79a['ip'],'referer':_0x22a79a[_0x2bff('0xb3')]['referer'],'openedInteractions':_0x2d6540,'maxInteractions':_0x441712,'virtual':_0x519bac['virtual'],'online':_0x29b888,'custom':_0x519bac}))[_0x2bff('0x10a')](/'/g,'\x5c\x27')};_0x42aaea[_0x2bff('0xd2')](ejs[_0x2bff('0xdb')](Mustache[_0x2bff('0xdb')](_0x22810e,_0x143684),{'proactiveActions':_0x3e911d,'alignment':_0x2f3623['alignment'],'verticalAlignment':_0x2f3623['verticalAlignment'],'div_color':_0x2f3623[_0x2bff('0xfe')],'labelText':_0x2f3623[_0x2bff('0x10b')],'text_color':_0x2f3623[_0x2bff('0x10c')],'text_button_color':_0x2f3623[_0x2bff('0x10d')],'button_color':_0x2f3623[_0x2bff('0x10e')],'background_color':_0x2f3623[_0x2bff('0x10f')],'hideWhenOffline':_0x2f3623[_0x2bff('0x110')],'intervalId':_0x2f3623[_0x2bff('0x111')],'isDevelopment':_0x5cdec4,'chatVersion':_0x55aab5}));})['catch'](handleError(_0x42aaea,null));};exports['addApplications']=function(_0x440667,_0x10b6f8){var _0x2da60c=_0x440667[_0x2bff('0x67')]['id'];var _0x28f352=_0x440667['body'];var _0x371dba=0xc8;var _0x184410=null;return db[_0x2bff('0xe5')][_0x2bff('0x112')]({'isolationLevel':db[_0x2bff('0xe5')]['Transaction'][_0x2bff('0x113')][_0x2bff('0x114')]},function(_0x4042f8){return db[_0x2bff('0x53')][_0x2bff('0x75')]({'where':{'id':_0x2da60c},'transaction':_0x4042f8})[_0x2bff('0x15')](function(_0x1259b9){if(_0x1259b9){return db[_0x2bff('0x115')]['destroy']({'where':{'ChatWebsiteId':_0x2da60c},'transaction':_0x4042f8})['then'](function(){var _0x51b87f=_[_0x2bff('0x39')](_0x28f352,function(_0x2a0298){_0x2a0298['ChatWebsiteId']=_0x2da60c;return _0x2a0298;});return db['ChatApplication'][_0x2bff('0x116')](_0x51b87f,{'transaction':_0x4042f8});});}else{_0x371dba=0x194;_0x184410=[];}});})['then'](function(){if(_0x371dba!==0x194){return db[_0x2bff('0x115')][_0x2bff('0x117')]({'where':{'ChatWebsiteId':_0x2da60c},'order':_0x2bff('0xaf')})[_0x2bff('0x15')](function(_0x4ed5fd){_0x184410=_0x4ed5fd;});}})[_0x2bff('0x1f')](function(_0x4b06e6){_0x371dba=0x1f4;logger[_0x2bff('0x1b')](_0x4b06e6[_0x2bff('0x2c')]);if(_0x4b06e6[_0x2bff('0x2d')]){delete _0x4b06e6['name'];}_0x184410=_0x4b06e6;})['finally'](function(){if(_0x184410===null){_0x10b6f8['sendStatus'](_0x371dba);}else{if(_0x371dba===0x1f4){_0x10b6f8[_0x2bff('0x26')](_0x371dba)[_0x2bff('0xd2')](_0x184410);}else{_0x10b6f8[_0x2bff('0x26')](_0x371dba)[_0x2bff('0x21')](_0x184410);}}});};exports[_0x2bff('0x118')]=function(_0x539578,_0x5938b1){var _0x3bf140={};var _0x18b821={};var _0x327090;var _0x25afc8;return db[_0x2bff('0x53')][_0x2bff('0x75')]({'where':{'id':_0x539578[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x5938b1,null))[_0x2bff('0x15')](function(_0xd793c2){if(_0xd793c2){_0x327090=_0xd793c2;_0x18b821[_0x2bff('0x4e')]=_[_0x2bff('0x56')](db[_0x2bff('0x115')]['rawAttributes']);_0x18b821['query']=_[_0x2bff('0x56')](_0x539578[_0x2bff('0x57')]);_0x18b821['filters']=_[_0x2bff('0x59')](_0x18b821[_0x2bff('0x4e')],_0x18b821['query']);_0x3bf140[_0x2bff('0x5a')]=_['intersection'](_0x18b821[_0x2bff('0x4e')],qs[_0x2bff('0x5b')](_0x539578[_0x2bff('0x57')][_0x2bff('0x5b')]));_0x3bf140[_0x2bff('0x5a')]=_0x3bf140[_0x2bff('0x5a')][_0x2bff('0x5c')]?_0x3bf140[_0x2bff('0x5a')]:_0x18b821[_0x2bff('0x4e')];_0x3bf140[_0x2bff('0x76')]=qs[_0x2bff('0x5d')](_0x539578[_0x2bff('0x57')]['sort']);_0x3bf140['where']=qs[_0x2bff('0x58')](_[_0x2bff('0x5e')](_0x539578['query'],_0x18b821['filters']));if(_0x539578[_0x2bff('0x57')][_0x2bff('0x5f')]){_0x3bf140[_0x2bff('0x60')]=_[_0x2bff('0x61')](_0x3bf140[_0x2bff('0x60')],{'$or':_['map'](_0x3bf140[_0x2bff('0x5a')],function(_0x2b0c29){var _0x522ad7={};_0x522ad7[_0x2b0c29]={'$like':'%'+_0x539578[_0x2bff('0x57')]['filter']+'%'};return _0x522ad7;})});}_0x3bf140=_[_0x2bff('0x61')]({},_0x3bf140,_0x539578[_0x2bff('0x63')]);return _0x327090[_0x2bff('0x118')](_0x3bf140);}})[_0x2bff('0x15')](function(_0x29c307){if(_0x29c307){_0x25afc8=_0x29c307[_0x2bff('0x5c')];if(!_0x539578[_0x2bff('0x57')][_0x2bff('0x7b')](_0x2bff('0x7c'))){_0x3bf140[_0x2bff('0x24')]=qs[_0x2bff('0x24')](_0x539578['query'][_0x2bff('0x24')]);_0x3bf140[_0x2bff('0x22')]=qs['offset'](_0x539578[_0x2bff('0x57')][_0x2bff('0x22')]);}return _0x327090[_0x2bff('0x118')](_0x3bf140);}})['then'](function(_0x1a2f5a){if(_0x1a2f5a){return _0x1a2f5a?{'count':_0x25afc8,'rows':_0x1a2f5a}:null;}})['then'](respondWithResult(_0x5938b1,null))['catch'](handleError(_0x5938b1,null));};exports[_0x2bff('0x119')]=function(_0x59ec93,_0x4d4748){return db[_0x2bff('0x11a')][_0x2bff('0x6e')]({'where':{'id':_0x59ec93['params']['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x4d4748,null))['then'](function(_0x8d0a59){if(_0x8d0a59){return _0x8d0a59[_0x2bff('0x119')](_0x59ec93[_0x2bff('0x6a')][_0x2bff('0x7e')],_[_0x2bff('0xf8')](_0x59ec93[_0x2bff('0x6a')],[_0x2bff('0x7e'),'id'])||{});}})[_0x2bff('0x15')](respondWithResult(_0x4d4748,null))[_0x2bff('0x1f')](handleError(_0x4d4748,null));};exports[_0x2bff('0x11b')]=function(_0x38efa4,_0x16182c){var _0x1df7cb={};var _0x2d71cf={};var _0x4a576f;var _0x4932cd;return db[_0x2bff('0x53')][_0x2bff('0x75')]({'where':{'id':_0x38efa4[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x16182c,null))[_0x2bff('0x15')](function(_0x25bc13){if(_0x25bc13){_0x4a576f=_0x25bc13;_0x2d71cf[_0x2bff('0x4e')]=_[_0x2bff('0x56')](db[_0x2bff('0x11c')]['rawAttributes']);_0x2d71cf[_0x2bff('0x57')]=_[_0x2bff('0x56')](_0x38efa4[_0x2bff('0x57')]);_0x2d71cf['filters']=_[_0x2bff('0x59')](_0x2d71cf[_0x2bff('0x4e')],_0x2d71cf[_0x2bff('0x57')]);_0x1df7cb[_0x2bff('0x5a')]=_[_0x2bff('0x59')](_0x2d71cf[_0x2bff('0x4e')],qs['fields'](_0x38efa4['query']['fields']));_0x1df7cb[_0x2bff('0x5a')]=_0x1df7cb[_0x2bff('0x5a')][_0x2bff('0x5c')]?_0x1df7cb[_0x2bff('0x5a')]:_0x2d71cf[_0x2bff('0x4e')];_0x1df7cb[_0x2bff('0x76')]=qs[_0x2bff('0x5d')](_0x38efa4['query'][_0x2bff('0x5d')]);_0x1df7cb['where']=qs[_0x2bff('0x58')](_[_0x2bff('0x5e')](_0x38efa4[_0x2bff('0x57')],_0x2d71cf['filters']));if(_0x38efa4[_0x2bff('0x57')]['filter']){_0x1df7cb[_0x2bff('0x60')]=_[_0x2bff('0x61')](_0x1df7cb['where'],{'$or':_['map'](_0x1df7cb[_0x2bff('0x5a')],function(_0x26ba85){var _0x2e7789={};_0x2e7789[_0x26ba85]={'$like':'%'+_0x38efa4['query']['filter']+'%'};return _0x2e7789;})});}_0x1df7cb=_[_0x2bff('0x61')]({},_0x1df7cb,_0x38efa4[_0x2bff('0x63')]);return _0x4a576f['getProactiveActions'](_0x1df7cb);}})['then'](function(_0x31e97b){if(_0x31e97b){_0x4932cd=_0x31e97b[_0x2bff('0x5c')];if(!_0x38efa4[_0x2bff('0x57')]['hasOwnProperty'](_0x2bff('0x7c'))){_0x1df7cb[_0x2bff('0x24')]=qs[_0x2bff('0x24')](_0x38efa4['query']['limit']);_0x1df7cb[_0x2bff('0x22')]=qs['offset'](_0x38efa4[_0x2bff('0x57')]['offset']);}return _0x4a576f['getProactiveActions'](_0x1df7cb);}})[_0x2bff('0x15')](function(_0x150a44){if(_0x150a44){return _0x150a44?{'count':_0x4932cd,'rows':_0x150a44}:null;}})['then'](respondWithResult(_0x16182c,null))['catch'](handleError(_0x16182c,null));};exports['getFields']=function(_0x3bfeda,_0x845aa6){var _0x337c03=_0x3bfeda['query'][_0x2bff('0x11d')]===_0x2bff('0x11e')?_0x2bff('0x11f'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x337c03],'where':{'id':_0x3bfeda[_0x2bff('0x67')]['id']}})['then'](handleEntityNotFound(_0x845aa6,null))['then'](function(_0xdfb139){if(_0xdfb139){var _0x8eea5d=_0xdfb139[_0x337c03];var _0x55a0b4=_0x8eea5d&&_0x8eea5d[_0x2bff('0x120')]?_0x8eea5d[_0x2bff('0x120')]:[];_0x845aa6['send']({'fromKey':_[_0x2bff('0x8c')](_0x8eea5d[_0x2bff('0x121')])?undefined:_0x8eea5d['fromKey'],'count':_0x55a0b4[_0x2bff('0x5c')],'rows':_0x55a0b4});}})[_0x2bff('0x1f')](handleError(_0x845aa6,null));};exports['getOfflineMessages']=function(_0x29f677,_0x4ea39f){var _0x40c93c={'raw':![],'where':{}};var _0x246d30={};var _0x1325f0={'count':0x0,'rows':[]};return db[_0x2bff('0x53')][_0x2bff('0x75')]({'where':{'id':_0x29f677[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x4ea39f,null))[_0x2bff('0x15')](function(_0x8fb2c8){if(_0x8fb2c8){_0x246d30[_0x2bff('0x4e')]=_['keys'](db[_0x2bff('0x122')]['rawAttributes']);_0x246d30[_0x2bff('0x57')]=_[_0x2bff('0x56')](_0x29f677[_0x2bff('0x57')]);_0x246d30[_0x2bff('0x58')]=_[_0x2bff('0x59')](_0x246d30[_0x2bff('0x4e')],_0x246d30[_0x2bff('0x57')]);_0x40c93c[_0x2bff('0x5a')]=_[_0x2bff('0x59')](_0x246d30['model'],qs[_0x2bff('0x5b')](_0x29f677[_0x2bff('0x57')][_0x2bff('0x5b')]));_0x40c93c['attributes']=_0x40c93c['attributes'][_0x2bff('0x5c')]?_0x40c93c[_0x2bff('0x5a')]:_0x246d30['model'];if(!_0x29f677['query'][_0x2bff('0x7b')](_0x2bff('0x7c'))){_0x40c93c[_0x2bff('0x24')]=qs[_0x2bff('0x24')](_0x29f677[_0x2bff('0x57')][_0x2bff('0x24')]);_0x40c93c['offset']=qs[_0x2bff('0x22')](_0x29f677[_0x2bff('0x57')][_0x2bff('0x22')]);}_0x40c93c[_0x2bff('0x76')]=qs[_0x2bff('0x5d')](_0x29f677[_0x2bff('0x57')][_0x2bff('0x5d')]);_0x40c93c[_0x2bff('0x60')]=qs[_0x2bff('0x58')](_[_0x2bff('0x5e')](_0x29f677[_0x2bff('0x57')],_0x246d30[_0x2bff('0x58')]));_0x40c93c['where'][_0x2bff('0x78')]=_0x8fb2c8['id'];if(_0x29f677['query'][_0x2bff('0x5f')]){_0x40c93c[_0x2bff('0x60')]=_[_0x2bff('0x61')](_0x40c93c[_0x2bff('0x60')],{'$or':_['map'](_0x40c93c[_0x2bff('0x5a')],function(_0x580f80){var _0x18ff45={};_0x18ff45[_0x580f80]={'$like':'%'+_0x29f677[_0x2bff('0x57')]['filter']+'%'};return _0x18ff45;})});}_0x40c93c=_[_0x2bff('0x61')]({},_0x40c93c,_0x29f677[_0x2bff('0x63')]);return db[_0x2bff('0x122')][_0x2bff('0x25')]({'where':_0x40c93c[_0x2bff('0x60')]})['then'](function(_0x587d24){_0x1325f0[_0x2bff('0x25')]=_0x587d24;if(_0x29f677[_0x2bff('0x57')]['includeAll']){_0x40c93c['include']=[{'all':!![]}];}else{_0x40c93c[_0x2bff('0x64')]=[{'model':db[_0x2bff('0x9b')],'as':_0x2bff('0xf9'),'required':![]},{'model':db['Attachment'],'as':_0x2bff('0x123'),'required':![]}];}return db[_0x2bff('0x122')][_0x2bff('0x65')](_0x40c93c);})['then'](function(_0x1dcde5){_0x1325f0[_0x2bff('0x66')]=_0x1dcde5;return _0x1325f0;});}})[_0x2bff('0x15')](respondWithFilteredResult(_0x4ea39f,_0x40c93c))[_0x2bff('0x1f')](handleError(_0x4ea39f,null));};exports['addAgents']=function(_0x2b5442,_0x1c3d2f){return db[_0x2bff('0x53')]['find']({'where':{'id':_0x2b5442[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x1c3d2f,null))[_0x2bff('0x15')](function(_0xec859f){if(_0xec859f){return _0xec859f[_0x2bff('0x124')](_0x2b5442['body'][_0x2bff('0x7e')],_[_0x2bff('0xf8')](_0x2b5442[_0x2bff('0x6a')],[_0x2bff('0x7e'),'id'])||{})[_0x2bff('0xac')](function(_0x4e30af){for(var _0x3515fd=0x0;_0x3515fd<_0x2b5442['body'][_0x2bff('0x7e')][_0x2bff('0x5c')];_0x3515fd+=0x1){socket[_0x2bff('0x125')](_0x2bff('0x126'),{'UserId':Number(_0x2b5442[_0x2bff('0x6a')]['ids'][_0x3515fd]),'ChatWebsiteId':Number(_0x2b5442[_0x2bff('0x67')]['id'])});}return _0x4e30af;});}})[_0x2bff('0x15')](respondWithResult(_0x1c3d2f,null))[_0x2bff('0x1f')](handleError(_0x1c3d2f,null));};exports[_0x2bff('0x127')]=function(_0x261ea2,_0x3edfb9){return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x261ea2[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x3edfb9,null))[_0x2bff('0x15')](function(_0x466d87){if(_0x466d87){return _0x466d87[_0x2bff('0x127')](_0x261ea2['query']['ids'])[_0x2bff('0x15')](function(){if(_[_0x2bff('0x128')](_0x261ea2[_0x2bff('0x57')][_0x2bff('0x7e')])){for(var _0xd00ccc=0x0;_0xd00ccc<_0x261ea2[_0x2bff('0x57')][_0x2bff('0x7e')][_0x2bff('0x5c')];_0xd00ccc+=0x1){socket[_0x2bff('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x261ea2['query']['ids'][_0xd00ccc]),'ChatWebsiteId':Number(_0x261ea2[_0x2bff('0x67')]['id'])});}}else{socket[_0x2bff('0x125')](_0x2bff('0x129'),{'UserId':Number(_0x261ea2[_0x2bff('0x57')]['ids']),'ChatWebsiteId':Number(_0x261ea2['params']['id'])});}});}})[_0x2bff('0x15')](respondWithStatusCode(_0x3edfb9,null))[_0x2bff('0x1f')](handleError(_0x3edfb9,null));};exports[_0x2bff('0x12a')]=function(_0x54ba2a,_0x252b49){var _0x2c6aad={};var _0x1e710b={};var _0x494710;var _0x3200e2;return db[_0x2bff('0x53')][_0x2bff('0x75')]({'where':{'id':_0x54ba2a[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x252b49,null))[_0x2bff('0x15')](function(_0x3bfa5b){if(_0x3bfa5b){_0x494710=_0x3bfa5b;_0x1e710b[_0x2bff('0x4e')]=_[_0x2bff('0x56')](db[_0x2bff('0xc2')][_0x2bff('0x54')]);_0x1e710b[_0x2bff('0x57')]=_[_0x2bff('0x56')](_0x54ba2a[_0x2bff('0x57')]);_0x1e710b[_0x2bff('0x58')]=_[_0x2bff('0x59')](_0x1e710b[_0x2bff('0x4e')],_0x1e710b[_0x2bff('0x57')]);_0x2c6aad['attributes']=_['intersection'](_0x1e710b[_0x2bff('0x4e')],qs['fields'](_0x54ba2a[_0x2bff('0x57')][_0x2bff('0x5b')]));_0x2c6aad[_0x2bff('0x5a')]=_0x2c6aad[_0x2bff('0x5a')][_0x2bff('0x5c')]?_0x2c6aad[_0x2bff('0x5a')]:_0x1e710b['model'];_0x2c6aad['order']=qs[_0x2bff('0x5d')](_0x54ba2a[_0x2bff('0x57')][_0x2bff('0x5d')]);_0x2c6aad[_0x2bff('0x60')]=qs[_0x2bff('0x58')](_[_0x2bff('0x5e')](_0x54ba2a['query'],_0x1e710b['filters']));if(_0x54ba2a[_0x2bff('0x57')][_0x2bff('0x5f')]){_0x2c6aad[_0x2bff('0x60')]=_['merge'](_0x2c6aad['where'],{'$or':_[_0x2bff('0x39')](_0x2c6aad['attributes'],function(_0x2b91c0){var _0x2280af={};_0x2280af[_0x2b91c0]={'$like':'%'+_0x54ba2a[_0x2bff('0x57')][_0x2bff('0x5f')]+'%'};return _0x2280af;})});}_0x2c6aad=_[_0x2bff('0x61')]({},_0x2c6aad,_0x54ba2a[_0x2bff('0x63')]);return _0x494710[_0x2bff('0x12a')](_0x2c6aad);}})['then'](function(_0x312cbb){if(_0x312cbb){_0x3200e2=_0x312cbb[_0x2bff('0x5c')];if(!_0x54ba2a[_0x2bff('0x57')][_0x2bff('0x7b')](_0x2bff('0x7c'))){_0x2c6aad[_0x2bff('0x24')]=qs[_0x2bff('0x24')](_0x54ba2a['query']['limit']);_0x2c6aad[_0x2bff('0x22')]=qs['offset'](_0x54ba2a[_0x2bff('0x57')]['offset']);}return _0x494710[_0x2bff('0x12a')](_0x2c6aad);}})[_0x2bff('0x15')](function(_0x20460d){if(_0x20460d){return _0x20460d?{'count':_0x3200e2,'rows':_0x20460d}:null;}})[_0x2bff('0x15')](respondWithResult(_0x252b49,null))[_0x2bff('0x1f')](handleError(_0x252b49,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index e64e501..97d8b88 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 _0x62da=['hasOwnProperty','hook','exports','events','ChatWebsite','setMaxListeners','save','update','emit'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x62da,0xc0));var _0xa62d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x62da[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xa62d('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xa62d('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa62d('0x2')](0x0);var events={'afterCreate':_0xa62d('0x3'),'afterUpdate':_0xa62d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3ef284){return function(_0x3911f7,_0x11821d,_0x41182c){ChatWebsiteEvents[_0xa62d('0x5')](_0x3ef284+':'+_0x3911f7['id'],_0x3911f7);ChatWebsiteEvents[_0xa62d('0x5')](_0x3ef284,_0x3911f7);_0x41182c(null);};}for(var e in events){if(events[_0xa62d('0x6')](e)){var event=events[e];ChatWebsite[_0xa62d('0x7')](e,emitEvent(event));}}module[_0xa62d('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x9c5a=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4d62ef,_0x48684c){var _0x5bcdd0=function(_0x4e2cbd){while(--_0x4e2cbd){_0x4d62ef['push'](_0x4d62ef['shift']());}};_0x5bcdd0(++_0x48684c);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0xa7181e,_0x40196d){_0xa7181e=_0xa7181e-0x0;var _0xfe038=_0x9c5a[_0xa7181e];return _0xfe038;};'use strict';var EventEmitter=require(_0xa9c5('0x0'));var ChatWebsite=require(_0xa9c5('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa9c5('0x2')](0x0);var events={'afterCreate':_0xa9c5('0x3'),'afterUpdate':_0xa9c5('0x4'),'afterDestroy':_0xa9c5('0x5')};function emitEvent(_0x4f5552){return function(_0x2acfaf,_0x3051b1,_0x4e9403){ChatWebsiteEvents[_0xa9c5('0x6')](_0x4f5552+':'+_0x2acfaf['id'],_0x2acfaf);ChatWebsiteEvents['emit'](_0x4f5552,_0x2acfaf);_0x4e9403(null);};}for(var e in events){if(events[_0xa9c5('0x7')](e)){var event=events[e];ChatWebsite[_0xa9c5('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 7459bb1..232eb58 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 _0xaf78=['chat_websites','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x2b7f28,_0x537177){var _0x214ed9=function(_0x504d22){while(--_0x504d22){_0x2b7f28['push'](_0x2b7f28['shift']());}};_0x214ed9(++_0x537177);}(_0xaf78,0x155));var _0x8af7=function(_0xd98838,_0x26da2c){_0xd98838=_0xd98838-0x0;var _0x448911=_0xaf78[_0xd98838];return _0x448911;};'use strict';var _=require(_0x8af7('0x0'));var util=require('util');var logger=require(_0x8af7('0x1'))(_0x8af7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8af7('0x3'));var fs=require('fs');var path=require(_0x8af7('0x4'));var rimraf=require(_0x8af7('0x5'));var config=require(_0x8af7('0x6'));var attributes=require(_0x8af7('0x7'));module[_0x8af7('0x8')]=function(_0x84070a,_0x4004d4){return _0x84070a['define']('ChatWebsite',attributes,{'tableName':_0x8af7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x954c=['bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','lodash','util','api','moment'];(function(_0x247d68,_0x2bc004){var _0x56f5ce=function(_0x625206){while(--_0x625206){_0x247d68['push'](_0x247d68['shift']());}};_0x56f5ce(++_0x2bc004);}(_0x954c,0xc8));var _0xc954=function(_0x4f3e66,_0x5770b4){_0x4f3e66=_0x4f3e66-0x0;var _0x46aa77=_0x954c[_0x4f3e66];return _0x46aa77;};'use strict';var _=require(_0xc954('0x0'));var util=require(_0xc954('0x1'));var logger=require('../../config/logger')(_0xc954('0x2'));var moment=require(_0xc954('0x3'));var BPromise=require(_0xc954('0x4'));var rp=require(_0xc954('0x5'));var fs=require('fs');var path=require(_0xc954('0x6'));var rimraf=require(_0xc954('0x7'));var config=require(_0xc954('0x8'));var attributes=require(_0xc954('0x9'));module[_0xc954('0xa')]=function(_0x25da4f,_0xc7f72c){return _0x25da4f[_0xc954('0xb')]('ChatWebsite',attributes,{'tableName':'chat_websites','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 ae52ee8..ec6d72c 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 _0x18ac=['bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','redis','defaults','./chatWebsite.socket','register','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x18ac,0x14f));var _0xc18a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x18ac[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc18a('0x0'));var BPromise=require(_0xc18a('0x1'));var rs=require(_0xc18a('0x2'));var fs=require('fs');var Redis=require(_0xc18a('0x3'));var db=require(_0xc18a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc18a('0x5'));var jayson=require(_0xc18a('0x6'));var client=jayson['client'][_0xc18a('0x7')]({'port':0x232a});config[_0xc18a('0x8')]=_[_0xc18a('0x9')](config[_0xc18a('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc18a('0x8')]));require(_0xc18a('0xa'))[_0xc18a('0xb')](socket);function respondWithRpcPromise(_0x2fd9ec,_0x978666,_0x45af23){return new BPromise(function(_0x237106,_0x492063){return client['request'](_0x2fd9ec,_0x45af23)['then'](function(_0x4ed86f){logger[_0xc18a('0xc')](_0xc18a('0xd'),_0x978666,'request\x20sent');logger[_0xc18a('0xe')](_0xc18a('0xf'),_0x978666,_0xc18a('0x10'),JSON['stringify'](_0x4ed86f));if(_0x4ed86f['error']){if(_0x4ed86f[_0xc18a('0x11')][_0xc18a('0x12')]===0x1f4){logger[_0xc18a('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x978666,_0x4ed86f['error'][_0xc18a('0x13')]);return _0x492063(_0x4ed86f[_0xc18a('0x11')][_0xc18a('0x13')]);}logger[_0xc18a('0x11')](_0xc18a('0xd'),_0x978666,_0x4ed86f[_0xc18a('0x11')]['message']);return _0x237106(_0x4ed86f[_0xc18a('0x11')][_0xc18a('0x13')]);}else{logger[_0xc18a('0xc')]('ChatWebsite,\x20%s,\x20%s',_0x978666,_0xc18a('0x10'));_0x237106(_0x4ed86f[_0xc18a('0x14')]['message']);}})['catch'](function(_0x4a430c){logger['error'](_0xc18a('0xd'),_0x978666,_0x4a430c);_0x492063(_0x4a430c);});});}
\ No newline at end of file
+var _0xada8=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./chatWebsite.socket','request','then','info','request\x20sent','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x467e51,_0x1aeca6){var _0x4b12b8=function(_0x8ae57a){while(--_0x8ae57a){_0x467e51['push'](_0x467e51['shift']());}};_0x4b12b8(++_0x1aeca6);}(_0xada8,0x14b));var _0x8ada=function(_0x41e316,_0x38ebcb){_0x41e316=_0x41e316-0x0;var _0x494aef=_0xada8[_0x41e316];return _0x494aef;};'use strict';var _=require(_0x8ada('0x0'));var util=require(_0x8ada('0x1'));var moment=require('moment');var BPromise=require(_0x8ada('0x2'));var rs=require(_0x8ada('0x3'));var fs=require('fs');var Redis=require(_0x8ada('0x4'));var db=require(_0x8ada('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8ada('0x6'));var config=require(_0x8ada('0x7'));var jayson=require(_0x8ada('0x8'));var client=jayson[_0x8ada('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x8ada('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ada('0xb'))(new Redis(config[_0x8ada('0xa')]));require(_0x8ada('0xc'))['register'](socket);function respondWithRpcPromise(_0x10a066,_0x1e18ab,_0x4f4002){return new BPromise(function(_0x57da7a,_0xbc1059){return client[_0x8ada('0xd')](_0x10a066,_0x4f4002)[_0x8ada('0xe')](function(_0x13a7a0){logger[_0x8ada('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x1e18ab,_0x8ada('0x10'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1e18ab,'request\x20sent',JSON[_0x8ada('0x11')](_0x13a7a0));if(_0x13a7a0[_0x8ada('0x12')]){if(_0x13a7a0[_0x8ada('0x12')][_0x8ada('0x13')]===0x1f4){logger[_0x8ada('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x1e18ab,_0x13a7a0[_0x8ada('0x12')]['message']);return _0xbc1059(_0x13a7a0[_0x8ada('0x12')][_0x8ada('0x14')]);}logger['error'](_0x8ada('0x15'),_0x1e18ab,_0x13a7a0[_0x8ada('0x12')]['message']);return _0x57da7a(_0x13a7a0['error'][_0x8ada('0x14')]);}else{logger['info'](_0x8ada('0x15'),_0x1e18ab,'request\x20sent');_0x57da7a(_0x13a7a0[_0x8ada('0x16')][_0x8ada('0x14')]);}})[_0x8ada('0x17')](function(_0x31189f){logger[_0x8ada('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x1e18ab,_0x31189f);_0xbc1059(_0x31189f);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index a28fcb2..a887774 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 _0xe639=['update','removeListener','register','length','chatWebsite:','./chatWebsite.events','remove'];(function(_0x468d0b,_0x594101){var _0x36f743=function(_0x57de8d){while(--_0x57de8d){_0x468d0b['push'](_0x468d0b['shift']());}};_0x36f743(++_0x594101);}(_0xe639,0xc2));var _0x9e63=function(_0x15180e,_0x24dacd){_0x15180e=_0x15180e-0x0;var _0x52324b=_0xe639[_0x15180e];return _0x52324b;};'use strict';var ChatWebsiteEvents=require(_0x9e63('0x0'));var events=['save',_0x9e63('0x1'),_0x9e63('0x2')];function createListener(_0xd23159,_0x5e68db){return function(_0x29a333){_0x5e68db['emit'](_0xd23159,_0x29a333);};}function removeListener(_0x44639a,_0x2fd520){return function(){ChatWebsiteEvents[_0x9e63('0x3')](_0x44639a,_0x2fd520);};}exports[_0x9e63('0x4')]=function(_0x8b84c7){for(var _0x5d3e53=0x0,_0x18b12b=events[_0x9e63('0x5')];_0x5d3e53<_0x18b12b;_0x5d3e53++){var _0x5496b2=events[_0x5d3e53];var _0x4423eb=createListener(_0x9e63('0x6')+_0x5496b2,_0x8b84c7);ChatWebsiteEvents['on'](_0x5496b2,_0x4423eb);}};
\ No newline at end of file
+var _0xbd80=['save','remove','removeListener','length','./chatWebsite.events'];(function(_0xf1ea4a,_0x371699){var _0x3a2c01=function(_0x503b2d){while(--_0x503b2d){_0xf1ea4a['push'](_0xf1ea4a['shift']());}};_0x3a2c01(++_0x371699);}(_0xbd80,0xf4));var _0x0bd8=function(_0x5eaea6,_0x5dd93b){_0x5eaea6=_0x5eaea6-0x0;var _0x4a0695=_0xbd80[_0x5eaea6];return _0x4a0695;};'use strict';var ChatWebsiteEvents=require(_0x0bd8('0x0'));var events=[_0x0bd8('0x1'),_0x0bd8('0x2'),'update'];function createListener(_0x6b4c2a,_0x1b5fca){return function(_0x21dc22){_0x1b5fca['emit'](_0x6b4c2a,_0x21dc22);};}function removeListener(_0x194913,_0x301d71){return function(){ChatWebsiteEvents[_0x0bd8('0x3')](_0x194913,_0x301d71);};}exports['register']=function(_0x5ba391){for(var _0x43a70c=0x0,_0xa3b6c9=events[_0x0bd8('0x4')];_0x43a70c<_0xa3b6c9;_0x43a70c++){var _0x3c596b=events[_0x43a70c];var _0x758642=createListener('chatWebsite:'+_0x3c596b,_0x5ba391);ChatWebsiteEvents['on'](_0x3c596b,_0x758642);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 67356db..bff0988 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 _0xb55d=['offline','addApplications','addProactiveActions','addAgents','delete','destroy','removeAnswers','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getCustomerAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','getOfflineMessages','/:id/users','create','post','addDisposition','addAnswer','diskStorage','root','now','originalname','file','join','server/files/images/avatars/','%s-%s','single','addAvatar','/:id/customer_avatar','addCustomerAvatar','format','/:id/system_avatar','server/files','attachments','offline-chat','replace','/:id/offline','any'];(function(_0x134589,_0x3908da){var _0x508e05=function(_0x3b1f58){while(--_0x3b1f58){_0x134589['push'](_0x134589['shift']());}};_0x508e05(++_0x3908da);}(_0xb55d,0x10c));var _0xdb55=function(_0x56d626,_0x5ba0a3){_0x56d626=_0x56d626-0x0;var _0x2aab38=_0xb55d[_0x56d626];return _0x2aab38;};'use strict';var multer=require(_0xdb55('0x0'));var util=require(_0xdb55('0x1'));var path=require(_0xdb55('0x2'));var timeout=require('connect-timeout');var express=require(_0xdb55('0x3'));var router=express[_0xdb55('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdb55('0x5'));var interaction=require(_0xdb55('0x6'));var config=require(_0xdb55('0x7'));var controller=require(_0xdb55('0x8'));router[_0xdb55('0x9')]('/',auth[_0xdb55('0xa')](),controller['index']);router[_0xdb55('0x9')](_0xdb55('0xb'),auth[_0xdb55('0xa')](),controller[_0xdb55('0xc')]);router[_0xdb55('0x9')](_0xdb55('0xd'),auth[_0xdb55('0xa')](),controller[_0xdb55('0xe')]);router['get'](_0xdb55('0xf'),auth[_0xdb55('0xa')](),controller[_0xdb55('0x10')]);router[_0xdb55('0x9')](_0xdb55('0x11'),auth[_0xdb55('0xa')](),controller[_0xdb55('0x12')]);router[_0xdb55('0x9')](_0xdb55('0x13'),controller[_0xdb55('0x14')]);router[_0xdb55('0x9')](_0xdb55('0x15'),controller['getAvatar']);router[_0xdb55('0x9')]('/:id/customer_avatar',controller[_0xdb55('0x16')]);router['get']('/:id/system_avatar',controller['getSystemAvatar']);router[_0xdb55('0x9')](_0xdb55('0x17'),auth[_0xdb55('0xa')](),controller[_0xdb55('0x18')]);router['get'](_0xdb55('0x19'),controller[_0xdb55('0x1a')]);router[_0xdb55('0x9')](_0xdb55('0x1b'),auth['isAuthenticated'](),controller[_0xdb55('0x1c')]);router[_0xdb55('0x9')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xdb55('0x1d')]);router['get']('/:id/fields',controller[_0xdb55('0x1e')]);router[_0xdb55('0x9')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xdb55('0x1f')]);router[_0xdb55('0x9')](_0xdb55('0x20'),auth[_0xdb55('0xa')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xdb55('0x21')]);router[_0xdb55('0x22')](_0xdb55('0xf'),auth[_0xdb55('0xa')](),controller[_0xdb55('0x23')]);router[_0xdb55('0x22')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xdb55('0x24')]);var upload=multer({'storage':multer[_0xdb55('0x25')]({'destination':function(_0x584bb7,_0x1919a7,_0x3dd261){_0x3dd261(null,path['join'](config[_0xdb55('0x26')],'server/files/images/logos/'));},'filename':function(_0x40c4a4,_0x192ef2,_0x56e8c8){_0x56e8c8(null,util['format']('%s-%s',Date[_0xdb55('0x27')](),_0x192ef2[_0xdb55('0x28')]));}})});router[_0xdb55('0x22')](_0xdb55('0x13'),upload['single'](_0xdb55('0x29')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f8c2a,_0x41c67f,_0xf9aa19){_0xf9aa19(null,path[_0xdb55('0x2a')](config[_0xdb55('0x26')],_0xdb55('0x2b')));},'filename':function(_0x17f379,_0xa1b587,_0x9046c5){_0x9046c5(null,util['format'](_0xdb55('0x2c'),Date[_0xdb55('0x27')](),_0xa1b587['originalname']));}})});router[_0xdb55('0x22')](_0xdb55('0x15'),upload[_0xdb55('0x2d')](_0xdb55('0x29')),controller[_0xdb55('0x2e')]);var upload=multer({'storage':multer[_0xdb55('0x25')]({'destination':function(_0x316f73,_0x1c79b7,_0x57780a){_0x57780a(null,path[_0xdb55('0x2a')](config['root'],_0xdb55('0x2b')));},'filename':function(_0x4895cb,_0x27f85e,_0x6468fc){_0x6468fc(null,util['format'](_0xdb55('0x2c'),Date[_0xdb55('0x27')](),_0x27f85e[_0xdb55('0x28')]));}})});router['post'](_0xdb55('0x2f'),upload[_0xdb55('0x2d')]('file'),controller[_0xdb55('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x34f324,_0x51fc5d,_0x5d67f3){_0x5d67f3(null,path[_0xdb55('0x2a')](config[_0xdb55('0x26')],_0xdb55('0x2b')));},'filename':function(_0x1bd063,_0x1ef1ce,_0x3363c2){_0x3363c2(null,util[_0xdb55('0x31')](_0xdb55('0x2c'),Date['now'](),_0x1ef1ce[_0xdb55('0x28')]));}})});router[_0xdb55('0x22')](_0xdb55('0x32'),upload[_0xdb55('0x2d')](_0xdb55('0x29')),controller['addSystemAvatar']);router[_0xdb55('0x22')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xdb55('0x25')]({'destination':function(_0xb36c42,_0x1a463c,_0x148c51){const _0x156be1=path[_0xdb55('0x2a')](config['root'],_0xdb55('0x33'),_0xdb55('0x34'),_0xdb55('0x35'));fs_extra['ensureDir'](_0x156be1,function(){_0x148c51(null,_0x156be1);});},'filename':function(_0x16a13f,_0x2ef0fd,_0x36c114){const _0x1ed3d4=_0x2ef0fd[_0xdb55('0x28')][_0xdb55('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xed4989=path['extname'](_0x1ed3d4);const _0x5dc480=Date[_0xdb55('0x27')]()+'-'+_0x1ed3d4[_0xdb55('0x36')](_0xed4989,'')+_0xed4989;_0x36c114(null,_0x5dc480);}})});router['post'](_0xdb55('0x37'),offlineUploadMulter[_0xdb55('0x38')](),controller[_0xdb55('0x39')]);router[_0xdb55('0x22')](_0xdb55('0x17'),auth[_0xdb55('0xa')](),controller['addInteraction']);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xdb55('0x3a')]);router[_0xdb55('0x22')]('/:id/proactive_actions',auth[_0xdb55('0xa')](),controller[_0xdb55('0x3b')]);router[_0xdb55('0x22')](_0xdb55('0x20'),auth[_0xdb55('0xa')](),controller[_0xdb55('0x3c')]);router['put'](_0xdb55('0xd'),auth[_0xdb55('0xa')](),controller['update']);router[_0xdb55('0x3d')]('/:id',auth[_0xdb55('0xa')](),controller[_0xdb55('0x3e')]);router[_0xdb55('0x3d')]('/:id/dispositions',auth[_0xdb55('0xa')](),controller['removeDispositions']);router[_0xdb55('0x3d')](_0xdb55('0x11'),auth[_0xdb55('0xa')](),controller[_0xdb55('0x3f')]);router[_0xdb55('0x3d')](_0xdb55('0x20'),auth[_0xdb55('0xa')](),controller['removeAgents']);module[_0xdb55('0x40')]=router;
\ No newline at end of file
+var _0xf4be=['addApplications','addProactiveActions','/:id/users','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/dispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','getOfflineMessages','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','root','format','%s-%s','originalname','single','addLogo','join','server/files/images/avatars/','now','addAvatar','file','addCustomerAvatar','addSystemAvatar','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','/:id/applications'];(function(_0x1e059f,_0x4d49f9){var _0x352098=function(_0x5325cd){while(--_0x5325cd){_0x1e059f['push'](_0x1e059f['shift']());}};_0x352098(++_0x4d49f9);}(_0xf4be,0xa1));var _0xef4b=function(_0x1932cc,_0x253440){_0x1932cc=_0x1932cc-0x0;var _0x46ee54=_0xf4be[_0x1932cc];return _0x46ee54;};'use strict';var multer=require(_0xef4b('0x0'));var util=require(_0xef4b('0x1'));var path=require(_0xef4b('0x2'));var timeout=require(_0xef4b('0x3'));var express=require(_0xef4b('0x4'));var router=express[_0xef4b('0x5')]();var fs_extra=require(_0xef4b('0x6'));var auth=require(_0xef4b('0x7'));var interaction=require(_0xef4b('0x8'));var config=require(_0xef4b('0x9'));var controller=require(_0xef4b('0xa'));router['get']('/',auth[_0xef4b('0xb')](),controller[_0xef4b('0xc')]);router[_0xef4b('0xd')](_0xef4b('0xe'),auth[_0xef4b('0xb')](),controller[_0xef4b('0xf')]);router[_0xef4b('0xd')](_0xef4b('0x10'),auth[_0xef4b('0xb')](),controller['show']);router[_0xef4b('0xd')](_0xef4b('0x11'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xef4b('0xd')]('/:id/canned_answers',auth[_0xef4b('0xb')](),controller[_0xef4b('0x12')]);router[_0xef4b('0xd')](_0xef4b('0x13'),controller[_0xef4b('0x14')]);router['get'](_0xef4b('0x15'),controller[_0xef4b('0x16')]);router[_0xef4b('0xd')](_0xef4b('0x17'),controller[_0xef4b('0x18')]);router[_0xef4b('0xd')](_0xef4b('0x19'),controller[_0xef4b('0x1a')]);router[_0xef4b('0xd')](_0xef4b('0x1b'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x1c')]);router[_0xef4b('0xd')]('/:id/snippet',controller[_0xef4b('0x1d')]);router[_0xef4b('0xd')]('/:id/applications',auth[_0xef4b('0xb')](),controller[_0xef4b('0x1e')]);router[_0xef4b('0xd')](_0xef4b('0x1f'),auth['isAuthenticated'](),controller[_0xef4b('0x20')]);router['get']('/:id/fields',controller['getFields']);router[_0xef4b('0xd')]('/:id/offline_messages',auth[_0xef4b('0xb')](),controller[_0xef4b('0x21')]);router[_0xef4b('0xd')]('/:id/users',auth[_0xef4b('0xb')](),controller[_0xef4b('0x22')]);router[_0xef4b('0x23')]('/',auth[_0xef4b('0xb')](),controller['create']);router[_0xef4b('0x23')](_0xef4b('0x11'),auth['isAuthenticated'](),controller[_0xef4b('0x24')]);router[_0xef4b('0x23')](_0xef4b('0x25'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x26')]);var upload=multer({'storage':multer[_0xef4b('0x27')]({'destination':function(_0x358529,_0x114894,_0x4b4876){_0x4b4876(null,path['join'](config[_0xef4b('0x28')],'server/files/images/logos/'));},'filename':function(_0x12dde9,_0x2d7a3,_0x24baad){_0x24baad(null,util[_0xef4b('0x29')](_0xef4b('0x2a'),Date['now'](),_0x2d7a3[_0xef4b('0x2b')]));}})});router[_0xef4b('0x23')](_0xef4b('0x13'),upload[_0xef4b('0x2c')]('file'),controller[_0xef4b('0x2d')]);var upload=multer({'storage':multer[_0xef4b('0x27')]({'destination':function(_0x33df43,_0x4a515a,_0x4036ea){_0x4036ea(null,path[_0xef4b('0x2e')](config[_0xef4b('0x28')],_0xef4b('0x2f')));},'filename':function(_0x154740,_0x323c12,_0x458bfa){_0x458bfa(null,util[_0xef4b('0x29')](_0xef4b('0x2a'),Date[_0xef4b('0x30')](),_0x323c12[_0xef4b('0x2b')]));}})});router[_0xef4b('0x23')](_0xef4b('0x15'),upload['single']('file'),controller[_0xef4b('0x31')]);var upload=multer({'storage':multer[_0xef4b('0x27')]({'destination':function(_0x45ec73,_0x55b603,_0x23c4f3){_0x23c4f3(null,path['join'](config['root'],_0xef4b('0x2f')));},'filename':function(_0x167b70,_0x5b6528,_0x5bdf14){_0x5bdf14(null,util[_0xef4b('0x29')]('%s-%s',Date[_0xef4b('0x30')](),_0x5b6528[_0xef4b('0x2b')]));}})});router['post'](_0xef4b('0x17'),upload[_0xef4b('0x2c')](_0xef4b('0x32')),controller[_0xef4b('0x33')]);var upload=multer({'storage':multer[_0xef4b('0x27')]({'destination':function(_0x413ca3,_0x2781f7,_0x277a01){_0x277a01(null,path[_0xef4b('0x2e')](config[_0xef4b('0x28')],_0xef4b('0x2f')));},'filename':function(_0x148957,_0x275b12,_0x1e1150){_0x1e1150(null,util[_0xef4b('0x29')]('%s-%s',Date[_0xef4b('0x30')](),_0x275b12[_0xef4b('0x2b')]));}})});router[_0xef4b('0x23')](_0xef4b('0x19'),upload[_0xef4b('0x2c')]('file'),controller[_0xef4b('0x34')]);router[_0xef4b('0x23')]('/:id/notify',controller[_0xef4b('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xef4b('0x27')]({'destination':function(_0x4696f5,_0x198ba8,_0xa68faa){const _0x9b6eb2=path[_0xef4b('0x2e')](config['root'],_0xef4b('0x36'),'attachments',_0xef4b('0x37'));fs_extra[_0xef4b('0x38')](_0x9b6eb2,function(){_0xa68faa(null,_0x9b6eb2);});},'filename':function(_0x42708c,_0x2414a9,_0x251db7){const _0x2ff50d=_0x2414a9[_0xef4b('0x2b')][_0xef4b('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x7052a9=path[_0xef4b('0x3a')](_0x2ff50d);const _0x77493c=Date[_0xef4b('0x30')]()+'-'+_0x2ff50d[_0xef4b('0x39')](_0x7052a9,'')+_0x7052a9;_0x251db7(null,_0x77493c);}})});router['post'](_0xef4b('0x3b'),offlineUploadMulter[_0xef4b('0x3c')](),controller[_0xef4b('0x3d')]);router[_0xef4b('0x23')](_0xef4b('0x1b'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x3e')]);router[_0xef4b('0x23')](_0xef4b('0x3f'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x40')]);router[_0xef4b('0x23')](_0xef4b('0x1f'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x41')]);router[_0xef4b('0x23')](_0xef4b('0x42'),auth[_0xef4b('0xb')](),controller['addAgents']);router[_0xef4b('0x43')](_0xef4b('0x10'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x44')]);router['delete'](_0xef4b('0x10'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x45')]);router[_0xef4b('0x46')](_0xef4b('0x11'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x47')]);router[_0xef4b('0x46')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xef4b('0x48')]);router[_0xef4b('0x46')](_0xef4b('0x42'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x49')]);module[_0xef4b('0x4a')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 8cfc14a..fb79de7 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 _0x871c=['../config/environment','Router','env','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express'];(function(_0x36dac2,_0x209df){var _0x1f31b5=function(_0x1b47a6){while(--_0x1b47a6){_0x36dac2['push'](_0x36dac2['shift']());}};_0x1f31b5(++_0x209df);}(_0x871c,0x10f));var _0xc871=function(_0x3db9ed,_0x5ddcc2){_0x3db9ed=_0x3db9ed-0x0;var _0x24f169=_0x871c[_0x3db9ed];return _0x24f169;};var beaverLogger=require(_0xc871('0x0'));var express=require(_0xc871('0x1'));var auth=require('../components/auth/service');var config=require(_0xc871('0x2'));var router=express[_0xc871('0x3')]();var isProduction=config[_0xc871('0x4')]==='production'||![];function clientSideLogs(_0xff187c,_0x1d218f,_0x5370f5){var _0xbf7307=_0xff187c[_0xc871('0x5')][_0xc871('0x6')](_0xc871('0x7'));if(!_0xbf7307){throw new Error(_0xc871('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0xc871('0x9'),'logger':_0xbf7307,'enableCors':!isProduction})(_0xff187c,_0x1d218f,_0x5370f5);}router[_0xc871('0xa')](auth[_0xc871('0xb')](),clientSideLogs);module[_0xc871('0xc')]=router;
\ No newline at end of file
+var _0x650c=['../config/environment','env','production','app','client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server'];(function(_0x433f08,_0x3d915b){var _0x253741=function(_0x406547){while(--_0x406547){_0x433f08['push'](_0x433f08['shift']());}};_0x253741(++_0x3d915b);}(_0x650c,0xf1));var _0xc650=function(_0x4e7dd7,_0x3e7134){_0x4e7dd7=_0x4e7dd7-0x0;var _0x4f4461=_0x650c[_0x4e7dd7];return _0x4f4461;};var beaverLogger=require(_0xc650('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0xc650('0x1'));var router=express['Router']();var isProduction=config[_0xc650('0x2')]===_0xc650('0x3')||![];function clientSideLogs(_0x2b4c31,_0x160fd9,_0x29d8c4){var _0x557f4a=_0x2b4c31[_0xc650('0x4')]['get'](_0xc650('0x5'));if(!_0x557f4a){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xc650('0x6')]({'uri':_0xc650('0x7'),'logger':_0x557f4a,'enableCors':!isProduction})(_0x2b4c31,_0x160fd9,_0x29d8c4);}router[_0xc650('0x8')](auth[_0xc650('0x9')](),clientSideLogs);module[_0xc650('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 32a5cef..fa71eda 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 _0xd7fa=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','AmazonAWS','MicrosoftAzure','ENUM','STRING','MicrosoftAzure\x20=>\x20client_id'];(function(_0x54393c,_0x5b34bc){var _0x1db30e=function(_0x54321e){while(--_0x54321e){_0x54393c['push'](_0x54393c['shift']());}};_0x1db30e(++_0x5b34bc);}(_0xd7fa,0x17f));var _0xad7f=function(_0x349b8a,_0x35b021){_0x349b8a=_0x349b8a-0x0;var _0x1d5645=_0xd7fa[_0x349b8a];return _0x1d5645;};'use strict';var Sequelize=require(_0xad7f('0x0'));module[_0xad7f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xad7f('0x2'),'Google',_0xad7f('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xad7f('0x4')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0xad7f('0x5')],'comment':_0xad7f('0x6')},'data2':{'type':Sequelize[_0xad7f('0x5')],'comment':_0xad7f('0x7')},'data3':{'type':Sequelize[_0xad7f('0x5')],'comment':_0xad7f('0x8')},'data4':{'type':Sequelize[_0xad7f('0x5')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xad7f('0x9')],'comment':_0xad7f('0xa')},'data6':{'type':Sequelize[_0xad7f('0x9')],'comment':_0xad7f('0xb')},'data7':{'type':Sequelize[_0xad7f('0x9')],'comment':_0xad7f('0xc')}};
\ No newline at end of file
+var _0x098f=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x1a9302,_0x13ce80){var _0x4d79f0=function(_0x104240){while(--_0x104240){_0x1a9302['push'](_0x1a9302['shift']());}};_0x4d79f0(++_0x13ce80);}(_0x098f,0x1c7));var _0xf098=function(_0x1ad188,_0x48b9ab){_0x1ad188=_0x1ad188-0x0;var _0x5742ac=_0x098f[_0x1ad188];return _0x5742ac;};'use strict';var Sequelize=require(_0xf098('0x0'));module[_0xf098('0x1')]={'name':{'type':Sequelize[_0xf098('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf098('0x3')](_0xf098('0x4'),_0xf098('0x5'),_0xf098('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf098('0x3')](_0xf098('0x7'),_0xf098('0x8'))},'data1':{'type':Sequelize[_0xf098('0x2')],'comment':_0xf098('0x9')},'data2':{'type':Sequelize[_0xf098('0x2')],'comment':_0xf098('0xa')},'data3':{'type':Sequelize[_0xf098('0x2')],'comment':_0xf098('0xb')},'data4':{'type':Sequelize[_0xf098('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':_0xf098('0xc')},'data6':{'type':Sequelize[_0xf098('0xd')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xf098('0xd')],'comment':_0xf098('0xe')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index af32a38..5ee0dda 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 _0x6ccb=['del','getOauth2MicrosoftAccessToken','code','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','update','destroy','then','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','service','decryptString','data3','catch','show','params','include','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','find','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','isValidIdToken','id_token','oauth2Claims'];(function(_0x287589,_0xdacf0c){var _0x3b4bfe=function(_0x17b296){while(--_0x17b296){_0x287589['push'](_0x287589['shift']());}};_0x3b4bfe(++_0xdacf0c);}(_0x6ccb,0xce));var _0xb6cc=function(_0x19cebb,_0x5d4762){_0x19cebb=_0x19cebb-0x0;var _0x1a046d=_0x6ccb[_0x19cebb];return _0x1a046d;};'use strict';var _=require(_0xb6cc('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0xb6cc('0x1'));var config=require(_0xb6cc('0x2'));var logger=require(_0xb6cc('0x3'))(_0xb6cc('0x4'));var db=require(_0xb6cc('0x5'))['db'];var oauth=require(_0xb6cc('0x6'));config[_0xb6cc('0x7')]=_[_0xb6cc('0x8')](config[_0xb6cc('0x7')],{'host':_0xb6cc('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0xb6cc('0x7')]);function respondWithStatusCode(_0xee85c0,_0x1ef446){_0x1ef446=_0x1ef446||0xcc;return function(_0x5b8e05){if(_0x5b8e05){return _0xee85c0[_0xb6cc('0xa')](_0x1ef446);}return _0xee85c0['status'](_0x1ef446)[_0xb6cc('0xb')]();};}function respondWithResult(_0x5c9ea4,_0x216a75){_0x216a75=_0x216a75||0xc8;return function(_0x4dd09d){if(_0x4dd09d){return _0x5c9ea4[_0xb6cc('0xc')](_0x216a75)[_0xb6cc('0xd')](_0x4dd09d);}};}function respondWithFilteredResult(_0x5a1e1f,_0x2f3c1b){return function(_0x2eabab){if(_0x2eabab){var _0x1929c8=typeof _0x2f3c1b[_0xb6cc('0xe')]==='undefined'&&typeof _0x2f3c1b['limit']===_0xb6cc('0xf');var _0x3f81d5=_0x2eabab[_0xb6cc('0x10')];var _0x42a5f8=_0x1929c8?0x0:_0x2f3c1b[_0xb6cc('0xe')];var _0x248dbe=_0x1929c8?_0x2eabab[_0xb6cc('0x10')]:_0x2f3c1b[_0xb6cc('0xe')]+_0x2f3c1b[_0xb6cc('0x11')];var _0xa5f466;if(_0x248dbe>=_0x3f81d5){_0x248dbe=_0x3f81d5;_0xa5f466=0xc8;}else{_0xa5f466=0xce;}_0x5a1e1f[_0xb6cc('0xc')](_0xa5f466);return _0x5a1e1f['set'](_0xb6cc('0x12'),_0x42a5f8+'-'+_0x248dbe+'/'+_0x3f81d5)[_0xb6cc('0xd')](_0x2eabab);}return null;};}function saveUpdates(_0x4b8d0b){return function(_0x1c8aa1){if(_0x1c8aa1){return _0x1c8aa1[_0xb6cc('0x13')](_0x4b8d0b)['then'](function(_0x5bec55){return _0x5bec55;});}return null;};}function removeEntity(_0x54a801){return function(_0x1044e2){if(_0x1044e2){return _0x1044e2[_0xb6cc('0x14')]()[_0xb6cc('0x15')](function(){_0x54a801['status'](0xcc)[_0xb6cc('0xb')]();});}};}function handleEntityNotFound(_0x2b44c8){return function(_0x696c1d){if(!_0x696c1d){_0x2b44c8[_0xb6cc('0xa')](0x194);}return _0x696c1d;};}function handleError(_0x1862bd,_0x14da3d){_0x14da3d=_0x14da3d||0x1f4;return function(_0x24095e){logger[_0xb6cc('0x16')](_0x24095e[_0xb6cc('0x17')]);if(_0x24095e['name']){delete _0x24095e[_0xb6cc('0x18')];}_0x1862bd[_0xb6cc('0xc')](_0x14da3d)[_0xb6cc('0x19')](_0x24095e);};}function maskClientSecret(_0x1f3992){return _[_0xb6cc('0x1a')](_0x1f3992[_0xb6cc('0x1b')](0x0,0x3),0x14,'*');}exports[_0xb6cc('0x1c')]=function(_0x5d3bf6,_0x583811){var _0x1fd8d6={},_0x47cb02={},_0x10d1d4={'count':0x0,'rows':[]};var _0x5da883=_[_0xb6cc('0x1d')](db[_0xb6cc('0x1e')][_0xb6cc('0x1f')],function(_0xe2eee1){return{'name':_0xe2eee1[_0xb6cc('0x20')],'type':_0xe2eee1[_0xb6cc('0x21')]['key']};});_0x47cb02['model']=_['map'](_0x5da883,_0xb6cc('0x18'));_0x47cb02['query']=_[_0xb6cc('0x22')](_0x5d3bf6[_0xb6cc('0x23')]);_0x47cb02[_0xb6cc('0x24')]=_['intersection'](_0x47cb02[_0xb6cc('0x25')],_0x47cb02[_0xb6cc('0x23')]);_0x1fd8d6[_0xb6cc('0x26')]=_[_0xb6cc('0x27')](_0x47cb02[_0xb6cc('0x25')],qs[_0xb6cc('0x28')](_0x5d3bf6[_0xb6cc('0x23')][_0xb6cc('0x28')]));_0x1fd8d6['attributes']=_0x1fd8d6[_0xb6cc('0x26')][_0xb6cc('0x29')]?_0x1fd8d6['attributes']:_0x47cb02[_0xb6cc('0x25')];if(!_0x5d3bf6[_0xb6cc('0x23')][_0xb6cc('0x2a')](_0xb6cc('0x2b'))){_0x1fd8d6[_0xb6cc('0x11')]=qs[_0xb6cc('0x11')](_0x5d3bf6['query'][_0xb6cc('0x11')]);_0x1fd8d6[_0xb6cc('0xe')]=qs['offset'](_0x5d3bf6[_0xb6cc('0x23')]['offset']);}_0x1fd8d6['order']=qs[_0xb6cc('0x2c')](_0x5d3bf6[_0xb6cc('0x23')]['sort']);_0x1fd8d6[_0xb6cc('0x2d')]=qs['filters'](_[_0xb6cc('0x2e')](_0x5d3bf6[_0xb6cc('0x23')],_0x47cb02[_0xb6cc('0x24')]),_0x5da883);if(_0x5d3bf6['query'][_0xb6cc('0x2f')]){_0x1fd8d6[_0xb6cc('0x2d')]=_[_0xb6cc('0x30')](_0x1fd8d6['where'],{'$or':_[_0xb6cc('0x1d')](_0x5da883,function(_0x59fab0){if(_0x59fab0[_0xb6cc('0x21')]!=='VIRTUAL'){var _0x5aa55d={};_0x5aa55d[_0x59fab0[_0xb6cc('0x18')]]={'$like':'%'+_0x5d3bf6[_0xb6cc('0x23')]['filter']+'%'};return _0x5aa55d;}})});}_0x1fd8d6=_[_0xb6cc('0x30')]({},_0x1fd8d6,_0x5d3bf6[_0xb6cc('0x31')]);var _0x17a407={'where':_0x1fd8d6[_0xb6cc('0x2d')]};return db[_0xb6cc('0x1e')][_0xb6cc('0x10')](_0x17a407)[_0xb6cc('0x15')](function(_0x1b36ef){_0x10d1d4[_0xb6cc('0x10')]=_0x1b36ef;if(_0x5d3bf6[_0xb6cc('0x23')][_0xb6cc('0x32')]){_0x1fd8d6['include']=[{'all':!![]}];}return db[_0xb6cc('0x1e')][_0xb6cc('0x33')](_0x1fd8d6);})['then'](function(_0x4cc675){_0x10d1d4[_0xb6cc('0x34')]=_[_0xb6cc('0x1d')](_0x4cc675,function(_0x47e841){if(_0x47e841[_0xb6cc('0x35')]==='MicrosoftAzure'){var _0x2d65ad=encryptor[_0xb6cc('0x36')](_0x47e841[_0xb6cc('0x37')]);_0x47e841[_0xb6cc('0x37')]=maskClientSecret(_0x2d65ad);}return _0x47e841;});return _0x10d1d4;})['then'](respondWithFilteredResult(_0x583811,_0x1fd8d6))[_0xb6cc('0x38')](handleError(_0x583811,null));};exports[_0xb6cc('0x39')]=function(_0x5061a2,_0x24fc83){var _0x312504={'raw':!![],'where':{'id':_0x5061a2[_0xb6cc('0x3a')]['id']}},_0x3e50bd={};_0x3e50bd[_0xb6cc('0x25')]=_[_0xb6cc('0x22')](db['CloudProvider'][_0xb6cc('0x1f')]);_0x3e50bd[_0xb6cc('0x23')]=_[_0xb6cc('0x22')](_0x5061a2[_0xb6cc('0x23')]);_0x3e50bd[_0xb6cc('0x24')]=_['intersection'](_0x3e50bd[_0xb6cc('0x25')],_0x3e50bd['query']);_0x312504[_0xb6cc('0x26')]=_[_0xb6cc('0x27')](_0x3e50bd['model'],qs[_0xb6cc('0x28')](_0x5061a2[_0xb6cc('0x23')]['fields']));_0x312504['attributes']=_0x312504[_0xb6cc('0x26')][_0xb6cc('0x29')]?_0x312504[_0xb6cc('0x26')]:_0x3e50bd[_0xb6cc('0x25')];if(_0x5061a2[_0xb6cc('0x23')]['includeAll']){_0x312504[_0xb6cc('0x3b')]=[{'all':!![]}];}_0x312504=_[_0xb6cc('0x30')]({},_0x312504,_0x5061a2[_0xb6cc('0x31')]);return db[_0xb6cc('0x1e')]['find'](_0x312504)['then'](handleEntityNotFound(_0x24fc83,null))[_0xb6cc('0x15')](function(_0x3370c4){if(_0x3370c4[_0xb6cc('0x35')]===_0xb6cc('0x3c')){var _0xd347cd=encryptor[_0xb6cc('0x36')](_0x3370c4[_0xb6cc('0x37')]);_0x3370c4[_0xb6cc('0x37')]=maskClientSecret(_0xd347cd);}return _0x3370c4;})[_0xb6cc('0x15')](respondWithResult(_0x24fc83,null))[_0xb6cc('0x38')](handleError(_0x24fc83,null));};exports[_0xb6cc('0x3d')]=function(_0x8958e1,_0x2bebd0){if(!_0x8958e1[_0xb6cc('0x3e')][_0xb6cc('0x18')])throw new Error(_0xb6cc('0x3f'));if(!_0x8958e1[_0xb6cc('0x3e')][_0xb6cc('0x35')])throw new Error(_0xb6cc('0x40'));var _0x5b479f=db[_0xb6cc('0x1e')]['rawAttributes'][_0xb6cc('0x35')][_0xb6cc('0x41')];if(!_0x5b479f[_0xb6cc('0x42')](_0x8958e1[_0xb6cc('0x3e')][_0xb6cc('0x35')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x5b479f[_0xb6cc('0x43')](',\x20'));if(_0x8958e1[_0xb6cc('0x3e')][_0xb6cc('0x35')]===_0xb6cc('0x3c')&&_0x8958e1['body'][_0xb6cc('0x37')]){_0x8958e1[_0xb6cc('0x3e')][_0xb6cc('0x37')]=encryptor[_0xb6cc('0x44')](_0x8958e1[_0xb6cc('0x3e')][_0xb6cc('0x37')]);}return db[_0xb6cc('0x1e')][_0xb6cc('0x3d')](_0x8958e1[_0xb6cc('0x3e')],{})[_0xb6cc('0x15')](respondWithResult(_0x2bebd0,0xc9))[_0xb6cc('0x38')](handleError(_0x2bebd0,null));};exports['update']=function(_0x25e97b,_0x51e1fc){if(_0x25e97b[_0xb6cc('0x3e')]['id']){delete _0x25e97b[_0xb6cc('0x3e')]['id'];}return db[_0xb6cc('0x1e')][_0xb6cc('0x45')]({'where':{'id':_0x25e97b['params']['id']}})[_0xb6cc('0x15')](handleEntityNotFound(_0x51e1fc,null))[_0xb6cc('0x15')](function(_0x1aaf1f){if(_0x1aaf1f[_0xb6cc('0x35')]==='MicrosoftAzure'&&_0x25e97b[_0xb6cc('0x3e')][_0xb6cc('0x37')]){_0x25e97b['body'][_0xb6cc('0x37')]=encryptor[_0xb6cc('0x44')](_0x25e97b[_0xb6cc('0x3e')][_0xb6cc('0x37')]);}return _0x1aaf1f;})[_0xb6cc('0x15')](saveUpdates(_0x25e97b[_0xb6cc('0x3e')],null))[_0xb6cc('0x15')](respondWithResult(_0x51e1fc,null))[_0xb6cc('0x38')](handleError(_0x51e1fc,null));};exports[_0xb6cc('0x14')]=function(_0x53e4a2,_0x45f4a2){return db[_0xb6cc('0x1e')][_0xb6cc('0x45')]({'where':{'id':_0x53e4a2[_0xb6cc('0x3a')]['id']}})[_0xb6cc('0x15')](handleEntityNotFound(_0x45f4a2,null))['then'](removeEntity(_0x45f4a2,null))['catch'](handleError(_0x45f4a2,null));};exports[_0xb6cc('0x46')]=function(_0xf0ead2,_0x31376a){return db['CloudProvider'][_0xb6cc('0x47')]({'where':{'id':_0xf0ead2[_0xb6cc('0x3a')]['id']},'raw':!![]})['then'](function(_0xa0bb23){if(!_0xa0bb23)return _0x31376a[_0xb6cc('0xa')](0x194);return{'url':oauth[_0xb6cc('0x48')](_0xa0bb23,_0xf0ead2[_0xb6cc('0x49')]['id'])};})['then'](respondWithResult(_0x31376a,null))[_0xb6cc('0x38')](handleError(_0x31376a,null));};exports[_0xb6cc('0x4a')]=function(_0x5aa51f,_0x48fbca){var _0x59c9d1=_0x5aa51f[_0xb6cc('0x3e')];var _0x26a18f;var _0x40e411;if(_0x59c9d1[_0xb6cc('0x16')])throw _0x59c9d1;redis[_0xb6cc('0x4b')](_0x59c9d1[_0xb6cc('0x4c')])[_0xb6cc('0x15')](function(_0x437617){if(!_0x437617)throw new Error(_0xb6cc('0x4d'));_0x26a18f=JSON[_0xb6cc('0x4e')](_0x437617);var _0x4fe93b=Buffer[_0xb6cc('0x4f')](_0x59c9d1[_0xb6cc('0x4c')],_0xb6cc('0x50'))[_0xb6cc('0x51')]('ascii');_0x40e411=JSON[_0xb6cc('0x4e')](_0x4fe93b);if(!oauth[_0xb6cc('0x52')](_0x59c9d1[_0xb6cc('0x53')],_0x26a18f[_0xb6cc('0x54')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xb6cc('0x55')](_0x59c9d1[_0xb6cc('0x4c')]);return oauth[_0xb6cc('0x56')](_0x59c9d1[_0xb6cc('0x57')],_0x26a18f);})['then'](function(_0x305308){_0x26a18f['data5']=_0x305308['access_token'];_0x26a18f['data6']=_0x305308[_0xb6cc('0x58')];return db[_0xb6cc('0x1e')][_0xb6cc('0x13')]({'data5':_0x26a18f['data5'],'data6':_0x26a18f[_0xb6cc('0x59')]},{'where':{'id':_0x26a18f['id']}});})[_0xb6cc('0x15')](function(){oauth[_0xb6cc('0x5a')](_0x26a18f);socket[_0xb6cc('0x5b')](_0xb6cc('0x5c'),{'id':_0x40e411['id']});return;})[_0xb6cc('0x15')](respondWithStatusCode(_0x48fbca,null))[_0xb6cc('0x38')](function(_0x23f25c){if(_0x40e411){socket[_0xb6cc('0x5b')](_0xb6cc('0x5d'),{'id':_0x40e411['id']});}if(!_0x26a18f){logger[_0xb6cc('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x23f25c);return _0x48fbca[_0xb6cc('0xc')](0x1f4)['send'](_0x23f25c[_0xb6cc('0x5e')]);}logger[_0xb6cc('0x16')](_0xb6cc('0x5f'),_0x26a18f['id'],JSON[_0xb6cc('0x60')](_0x23f25c));});};
\ No newline at end of file
+var _0xf8b4=['data5','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','json','undefined','limit','count','offset','set','destroy','then','end','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','nolimit','sort','where','pick','filters','merge','VIRTUAL','options','includeAll','include','findAll','decryptString','data3','show','params','length','find','service','MicrosoftAzure','catch','create','body','Service\x20parameter\x20not\x20specified','join','update','encryptString','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','state','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token'];(function(_0x80d733,_0x266211){var _0x435868=function(_0x2ae0f0){while(--_0x2ae0f0){_0x80d733['push'](_0x80d733['shift']());}};_0x435868(++_0x266211);}(_0xf8b4,0x1d4));var _0x4f8b=function(_0x398e6f,_0x12af3b){_0x398e6f=_0x398e6f-0x0;var _0xb0b189=_0xf8b4[_0x398e6f];return _0xb0b189;};'use strict';var _=require(_0x4f8b('0x0'));var Redis=require('ioredis');var qs=require(_0x4f8b('0x1'));var encryptor=require(_0x4f8b('0x2'));var config=require('../../config/environment');var logger=require(_0x4f8b('0x3'))(_0x4f8b('0x4'));var db=require(_0x4f8b('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_['defaults'](config[_0x4f8b('0x6')],{'host':_0x4f8b('0x7'),'port':0x18eb});var socket=require(_0x4f8b('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0x4f8b('0x6')]);function respondWithStatusCode(_0x223c6c,_0x25d13b){_0x25d13b=_0x25d13b||0xcc;return function(_0x97d742){if(_0x97d742){return _0x223c6c[_0x4f8b('0x9')](_0x25d13b);}return _0x223c6c[_0x4f8b('0xa')](_0x25d13b)['end']();};}function respondWithResult(_0x4948a3,_0x12bede){_0x12bede=_0x12bede||0xc8;return function(_0xd6be55){if(_0xd6be55){return _0x4948a3[_0x4f8b('0xa')](_0x12bede)[_0x4f8b('0xb')](_0xd6be55);}};}function respondWithFilteredResult(_0x5e4ba2,_0x337867){return function(_0x3469f8){if(_0x3469f8){var _0x8abeb2=typeof _0x337867['offset']===_0x4f8b('0xc')&&typeof _0x337867[_0x4f8b('0xd')]==='undefined';var _0x48be8d=_0x3469f8[_0x4f8b('0xe')];var _0x58435c=_0x8abeb2?0x0:_0x337867[_0x4f8b('0xf')];var _0x139d11=_0x8abeb2?_0x3469f8[_0x4f8b('0xe')]:_0x337867[_0x4f8b('0xf')]+_0x337867[_0x4f8b('0xd')];var _0x45f1ac;if(_0x139d11>=_0x48be8d){_0x139d11=_0x48be8d;_0x45f1ac=0xc8;}else{_0x45f1ac=0xce;}_0x5e4ba2[_0x4f8b('0xa')](_0x45f1ac);return _0x5e4ba2[_0x4f8b('0x10')]('Content-Range',_0x58435c+'-'+_0x139d11+'/'+_0x48be8d)[_0x4f8b('0xb')](_0x3469f8);}return null;};}function saveUpdates(_0x20b360){return function(_0x1046b2){if(_0x1046b2){return _0x1046b2['update'](_0x20b360)['then'](function(_0x4222c4){return _0x4222c4;});}return null;};}function removeEntity(_0x4b75cb){return function(_0x4d3494){if(_0x4d3494){return _0x4d3494[_0x4f8b('0x11')]()[_0x4f8b('0x12')](function(){_0x4b75cb[_0x4f8b('0xa')](0xcc)[_0x4f8b('0x13')]();});}};}function handleEntityNotFound(_0x21d1da){return function(_0x38f218){if(!_0x38f218){_0x21d1da['sendStatus'](0x194);}return _0x38f218;};}function handleError(_0x51c504,_0x141779){_0x141779=_0x141779||0x1f4;return function(_0x356616){logger[_0x4f8b('0x14')](_0x356616[_0x4f8b('0x15')]);if(_0x356616[_0x4f8b('0x16')]){delete _0x356616['name'];}_0x51c504[_0x4f8b('0xa')](_0x141779)[_0x4f8b('0x17')](_0x356616);};}function maskClientSecret(_0x2da326){return _[_0x4f8b('0x18')](_0x2da326[_0x4f8b('0x19')](0x0,0x3),0x14,'*');}exports[_0x4f8b('0x1a')]=function(_0x2ce973,_0x5d395f){var _0x541912={},_0x16615d={},_0x57fdba={'count':0x0,'rows':[]};var _0x3f0254=_[_0x4f8b('0x1b')](db[_0x4f8b('0x1c')][_0x4f8b('0x1d')],function(_0x57f49f){return{'name':_0x57f49f[_0x4f8b('0x1e')],'type':_0x57f49f[_0x4f8b('0x1f')][_0x4f8b('0x20')]};});_0x16615d[_0x4f8b('0x21')]=_[_0x4f8b('0x1b')](_0x3f0254,'name');_0x16615d['query']=_[_0x4f8b('0x22')](_0x2ce973[_0x4f8b('0x23')]);_0x16615d['filters']=_[_0x4f8b('0x24')](_0x16615d[_0x4f8b('0x21')],_0x16615d['query']);_0x541912[_0x4f8b('0x25')]=_['intersection'](_0x16615d['model'],qs[_0x4f8b('0x26')](_0x2ce973[_0x4f8b('0x23')][_0x4f8b('0x26')]));_0x541912[_0x4f8b('0x25')]=_0x541912[_0x4f8b('0x25')]['length']?_0x541912['attributes']:_0x16615d[_0x4f8b('0x21')];if(!_0x2ce973[_0x4f8b('0x23')]['hasOwnProperty'](_0x4f8b('0x27'))){_0x541912[_0x4f8b('0xd')]=qs['limit'](_0x2ce973['query']['limit']);_0x541912['offset']=qs['offset'](_0x2ce973[_0x4f8b('0x23')]['offset']);}_0x541912['order']=qs[_0x4f8b('0x28')](_0x2ce973[_0x4f8b('0x23')]['sort']);_0x541912[_0x4f8b('0x29')]=qs['filters'](_[_0x4f8b('0x2a')](_0x2ce973[_0x4f8b('0x23')],_0x16615d[_0x4f8b('0x2b')]),_0x3f0254);if(_0x2ce973[_0x4f8b('0x23')]['filter']){_0x541912[_0x4f8b('0x29')]=_[_0x4f8b('0x2c')](_0x541912[_0x4f8b('0x29')],{'$or':_[_0x4f8b('0x1b')](_0x3f0254,function(_0x1e17e1){if(_0x1e17e1[_0x4f8b('0x1f')]!==_0x4f8b('0x2d')){var _0x2b1f9f={};_0x2b1f9f[_0x1e17e1['name']]={'$like':'%'+_0x2ce973[_0x4f8b('0x23')]['filter']+'%'};return _0x2b1f9f;}})});}_0x541912=_[_0x4f8b('0x2c')]({},_0x541912,_0x2ce973[_0x4f8b('0x2e')]);var _0x677581={'where':_0x541912[_0x4f8b('0x29')]};return db[_0x4f8b('0x1c')][_0x4f8b('0xe')](_0x677581)[_0x4f8b('0x12')](function(_0x42d2de){_0x57fdba[_0x4f8b('0xe')]=_0x42d2de;if(_0x2ce973[_0x4f8b('0x23')][_0x4f8b('0x2f')]){_0x541912[_0x4f8b('0x30')]=[{'all':!![]}];}return db[_0x4f8b('0x1c')][_0x4f8b('0x31')](_0x541912);})[_0x4f8b('0x12')](function(_0x33bdba){_0x57fdba['rows']=_[_0x4f8b('0x1b')](_0x33bdba,function(_0x15c3b8){if(_0x15c3b8['service']==='MicrosoftAzure'){var _0x3039e2=encryptor[_0x4f8b('0x32')](_0x15c3b8[_0x4f8b('0x33')]);_0x15c3b8['data3']=maskClientSecret(_0x3039e2);}return _0x15c3b8;});return _0x57fdba;})[_0x4f8b('0x12')](respondWithFilteredResult(_0x5d395f,_0x541912))['catch'](handleError(_0x5d395f,null));};exports[_0x4f8b('0x34')]=function(_0x591603,_0x492b94){var _0x1bc1be={'raw':!![],'where':{'id':_0x591603[_0x4f8b('0x35')]['id']}},_0x254abd={};_0x254abd[_0x4f8b('0x21')]=_['keys'](db[_0x4f8b('0x1c')][_0x4f8b('0x1d')]);_0x254abd['query']=_[_0x4f8b('0x22')](_0x591603[_0x4f8b('0x23')]);_0x254abd[_0x4f8b('0x2b')]=_[_0x4f8b('0x24')](_0x254abd['model'],_0x254abd['query']);_0x1bc1be[_0x4f8b('0x25')]=_[_0x4f8b('0x24')](_0x254abd[_0x4f8b('0x21')],qs[_0x4f8b('0x26')](_0x591603[_0x4f8b('0x23')][_0x4f8b('0x26')]));_0x1bc1be[_0x4f8b('0x25')]=_0x1bc1be['attributes'][_0x4f8b('0x36')]?_0x1bc1be['attributes']:_0x254abd['model'];if(_0x591603[_0x4f8b('0x23')][_0x4f8b('0x2f')]){_0x1bc1be[_0x4f8b('0x30')]=[{'all':!![]}];}_0x1bc1be=_['merge']({},_0x1bc1be,_0x591603[_0x4f8b('0x2e')]);return db[_0x4f8b('0x1c')][_0x4f8b('0x37')](_0x1bc1be)[_0x4f8b('0x12')](handleEntityNotFound(_0x492b94,null))['then'](function(_0x936af6){if(_0x936af6[_0x4f8b('0x38')]===_0x4f8b('0x39')){var _0x53b0dc=encryptor[_0x4f8b('0x32')](_0x936af6[_0x4f8b('0x33')]);_0x936af6['data3']=maskClientSecret(_0x53b0dc);}return _0x936af6;})['then'](respondWithResult(_0x492b94,null))[_0x4f8b('0x3a')](handleError(_0x492b94,null));};exports[_0x4f8b('0x3b')]=function(_0x1d8c69,_0x5a653a){if(!_0x1d8c69[_0x4f8b('0x3c')][_0x4f8b('0x16')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x1d8c69[_0x4f8b('0x3c')][_0x4f8b('0x38')])throw new Error(_0x4f8b('0x3d'));var _0x266198=db[_0x4f8b('0x1c')]['rawAttributes'][_0x4f8b('0x38')]['values'];if(!_0x266198['includes'](_0x1d8c69[_0x4f8b('0x3c')][_0x4f8b('0x38')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x266198[_0x4f8b('0x3e')](',\x20'));if(_0x1d8c69[_0x4f8b('0x3c')]['service']===_0x4f8b('0x39')&&_0x1d8c69[_0x4f8b('0x3c')][_0x4f8b('0x33')]){_0x1d8c69[_0x4f8b('0x3c')][_0x4f8b('0x33')]=encryptor['encryptString'](_0x1d8c69[_0x4f8b('0x3c')][_0x4f8b('0x33')]);}return db[_0x4f8b('0x1c')][_0x4f8b('0x3b')](_0x1d8c69[_0x4f8b('0x3c')],{})[_0x4f8b('0x12')](respondWithResult(_0x5a653a,0xc9))[_0x4f8b('0x3a')](handleError(_0x5a653a,null));};exports[_0x4f8b('0x3f')]=function(_0x8f2254,_0x13de44){if(_0x8f2254['body']['id']){delete _0x8f2254[_0x4f8b('0x3c')]['id'];}return db[_0x4f8b('0x1c')]['find']({'where':{'id':_0x8f2254[_0x4f8b('0x35')]['id']}})['then'](handleEntityNotFound(_0x13de44,null))[_0x4f8b('0x12')](function(_0x387321){if(_0x387321[_0x4f8b('0x38')]===_0x4f8b('0x39')&&_0x8f2254[_0x4f8b('0x3c')][_0x4f8b('0x33')]){_0x8f2254[_0x4f8b('0x3c')][_0x4f8b('0x33')]=encryptor[_0x4f8b('0x40')](_0x8f2254[_0x4f8b('0x3c')][_0x4f8b('0x33')]);}return _0x387321;})['then'](saveUpdates(_0x8f2254[_0x4f8b('0x3c')],null))[_0x4f8b('0x12')](respondWithResult(_0x13de44,null))[_0x4f8b('0x3a')](handleError(_0x13de44,null));};exports['destroy']=function(_0x72d8b1,_0x2cafdc){return db[_0x4f8b('0x1c')]['find']({'where':{'id':_0x72d8b1[_0x4f8b('0x35')]['id']}})[_0x4f8b('0x12')](handleEntityNotFound(_0x2cafdc,null))[_0x4f8b('0x12')](removeEntity(_0x2cafdc,null))['catch'](handleError(_0x2cafdc,null));};exports[_0x4f8b('0x41')]=function(_0x2df79c,_0x4ad4d8){return db['CloudProvider'][_0x4f8b('0x42')]({'where':{'id':_0x2df79c['params']['id']},'raw':!![]})[_0x4f8b('0x12')](function(_0x4c79f2){if(!_0x4c79f2)return _0x4ad4d8[_0x4f8b('0x9')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x4c79f2,_0x2df79c[_0x4f8b('0x43')]['id'])};})['then'](respondWithResult(_0x4ad4d8,null))[_0x4f8b('0x3a')](handleError(_0x4ad4d8,null));};exports[_0x4f8b('0x44')]=function(_0x17afe1,_0xaa716e){var _0x34e8e9=_0x17afe1[_0x4f8b('0x3c')];var _0x329c1e;var _0xdf989a;if(_0x34e8e9[_0x4f8b('0x14')])throw _0x34e8e9;redis[_0x4f8b('0x45')](_0x34e8e9['state'])[_0x4f8b('0x12')](function(_0x1860fd){if(!_0x1860fd)throw new Error(_0x4f8b('0x46'));_0x329c1e=JSON[_0x4f8b('0x47')](_0x1860fd);var _0x2c00bd=Buffer['from'](_0x34e8e9[_0x4f8b('0x48')],'base64')['toString'](_0x4f8b('0x49'));_0xdf989a=JSON[_0x4f8b('0x47')](_0x2c00bd);if(!oauth[_0x4f8b('0x4a')](_0x34e8e9[_0x4f8b('0x4b')],_0x329c1e[_0x4f8b('0x4c')]))throw new Error(_0x4f8b('0x4d'));redis[_0x4f8b('0x4e')](_0x34e8e9[_0x4f8b('0x48')]);return oauth[_0x4f8b('0x4f')](_0x34e8e9[_0x4f8b('0x50')],_0x329c1e);})[_0x4f8b('0x12')](function(_0x4e556f){_0x329c1e['data5']=_0x4e556f[_0x4f8b('0x51')];_0x329c1e[_0x4f8b('0x52')]=_0x4e556f[_0x4f8b('0x53')];return db['CloudProvider'][_0x4f8b('0x3f')]({'data5':_0x329c1e[_0x4f8b('0x54')],'data6':_0x329c1e[_0x4f8b('0x52')]},{'where':{'id':_0x329c1e['id']}});})[_0x4f8b('0x12')](function(){oauth[_0x4f8b('0x55')](_0x329c1e);socket['emit'](_0x4f8b('0x56'),{'id':_0xdf989a['id']});return;})[_0x4f8b('0x12')](respondWithStatusCode(_0xaa716e,null))[_0x4f8b('0x3a')](function(_0x4e28a0){if(_0xdf989a){socket[_0x4f8b('0x57')](_0x4f8b('0x58'),{'id':_0xdf989a['id']});}if(!_0x329c1e){logger[_0x4f8b('0x14')](_0x4f8b('0x59'),_0x4e28a0);return _0xaa716e[_0x4f8b('0xa')](0x1f4)[_0x4f8b('0x17')](_0x4e28a0[_0x4f8b('0x5a')]);}logger[_0x4f8b('0x14')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x329c1e['id'],JSON[_0x4f8b('0x5b')](_0x4e28a0));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 7460beb..2c20a1b 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 _0xa6b4=['../../config/environment','./cloudProvider.attributes','exports','cloud_providers','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xb964d0,_0x2c1f84){var _0x429eed=function(_0x4f150f){while(--_0x4f150f){_0xb964d0['push'](_0xb964d0['shift']());}};_0x429eed(++_0x2c1f84);}(_0xa6b4,0x1bc));var _0x4a6b=function(_0x300860,_0x509371){_0x300860=_0x300860-0x0;var _0x2094ad=_0xa6b4[_0x300860];return _0x2094ad;};'use strict';var _=require(_0x4a6b('0x0'));var util=require(_0x4a6b('0x1'));var logger=require(_0x4a6b('0x2'))('api');var moment=require(_0x4a6b('0x3'));var BPromise=require(_0x4a6b('0x4'));var rp=require(_0x4a6b('0x5'));var fs=require('fs');var path=require(_0x4a6b('0x6'));var rimraf=require('rimraf');var config=require(_0x4a6b('0x7'));var attributes=require(_0x4a6b('0x8'));module[_0x4a6b('0x9')]=function(_0x1382f0,_0xa41435){return _0x1382f0['define']('CloudProvider',attributes,{'tableName':_0x4a6b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4b16=['bluebird','path','rimraf','../../config/environment','exports','define','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b16,0x1dc));var _0x64b1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b16[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x64b1('0x0'));var logger=require(_0x64b1('0x1'))(_0x64b1('0x2'));var moment=require(_0x64b1('0x3'));var BPromise=require(_0x64b1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64b1('0x5'));var rimraf=require(_0x64b1('0x6'));var config=require(_0x64b1('0x7'));var attributes=require('./cloudProvider.attributes');module[_0x64b1('0x8')]=function(_0x15479a,_0x5bef82){return _0x15479a[_0x64b1('0x9')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index a06169f..3fc7b2f 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 _0x7fcc=['data4','form_post','prompt','map','key','value','oauth2Claims','replace','set','payload','iss','issuer','aud','audience','nonce','isAfter','unix','exp','resolve','data3','CloudProvider','findOne','then','refresh_token','data6','POST','access_token','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','bind','all','inspect','exports','lodash','crypto','ioredis','util','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','join','/.default','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','data1','response_type'];(function(_0x2f731a,_0x150958){var _0x297cb5=function(_0x2ae071){while(--_0x2ae071){_0x2f731a['push'](_0x2f731a['shift']());}};_0x297cb5(++_0x150958);}(_0x7fcc,0xc0));var _0xc7fc=function(_0x399469,_0x3618a0){_0x399469=_0x399469-0x0;var _0x1a4cc4=_0x7fcc[_0x399469];return _0x1a4cc4;};'use strict';var _=require(_0xc7fc('0x0'));var crypto=require(_0xc7fc('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0xc7fc('0x2'));var rp=require('request-promise');var util=require(_0xc7fc('0x3'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0xc7fc('0x4'))(_0xc7fc('0x5'));var schedule=require(_0xc7fc('0x6'));var db=require(_0xc7fc('0x7'))['db'];config[_0xc7fc('0x8')]=_[_0xc7fc('0x9')](config[_0xc7fc('0x8')],{'host':_0xc7fc('0xa'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xc7fc('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xc7fc('0xc'),_0xc7fc('0xd'),_0xc7fc('0xe'),_0xc7fc('0xf'),_0xc7fc('0x10'),_0xc7fc('0x11'),_0xc7fc('0x12')],'Dynamics365':[_0xc7fc('0xc'),_0xc7fc('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0xc7fc('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xc7fc('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x595435){var _0x35a166=_['map'](AZURE_AUTH_SCOPES[_0x595435['type']]);if(_0x595435[_0xc7fc('0x15')]===_0xc7fc('0x16'))_0x35a166[_0xc7fc('0x17')](_0x595435[_0xc7fc('0x18')]+'/.default');return _0x35a166[_0xc7fc('0x19')]('\x20');}function getAccessTokenScope(_0x30276b){if(_0x30276b[_0xc7fc('0x15')]==='Outlook365')return _0xc7fc('0x10');if(_0x30276b[_0xc7fc('0x15')]==='Dynamics365')return _0x30276b[_0xc7fc('0x18')]+_0xc7fc('0x1a');}function generateMicrosoftAuthorizationUrl(_0x1a78d4,_0x1e2141){var _0x4187fd=MICROSOFT_AUTH_URL['replace'](_0xc7fc('0x1b'),_0x1a78d4[_0xc7fc('0x1c')]);var _0x5d6543=[_0xc7fc('0x1d'),_0xc7fc('0x1e')];var _0x1d8eca=Buffer[_0xc7fc('0x1f')](JSON[_0xc7fc('0x20')]({'id':_0x1e2141}))[_0xc7fc('0x21')](_0xc7fc('0x22'));var _0x1fee47=crypto[_0xc7fc('0x23')](0x10)[_0xc7fc('0x21')](_0xc7fc('0x24'));var _0x533679=getAuthorizationScopes(_0x1a78d4);var _0x54bb17=[{'key':'client_id','value':_0x1a78d4[_0xc7fc('0x25')]},{'key':_0xc7fc('0x26'),'value':encodeURIComponent(_0x5d6543[_0xc7fc('0x19')]('\x20'))},{'key':'redirect_uri','value':_0x1a78d4[_0xc7fc('0x27')]},{'key':'response_mode','value':_0xc7fc('0x28')},{'key':'scope','value':encodeURIComponent(_0x533679)},{'key':'state','value':_0x1d8eca},{'key':'nonce','value':_0x1fee47},{'key':_0xc7fc('0x29'),'value':'login'}];var _0x11e550=_0x4187fd+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xc7fc('0x2a')](_0x54bb17,function(_0x2285f9){return _0x2285f9[_0xc7fc('0x2b')]+'='+_0x2285f9[_0xc7fc('0x2c')];})[_0xc7fc('0x19')]('&');_0x1a78d4[_0xc7fc('0x2d')]={'issuer':_0x4187fd[_0xc7fc('0x2e')]('oauth2/',''),'audience':_0x1a78d4[_0xc7fc('0x25')],'state':_0x1d8eca,'nonce':_0x1fee47};redis[_0xc7fc('0x2f')](_0x1d8eca,JSON[_0xc7fc('0x20')](_0x1a78d4));return _0x11e550;}function isValidIdToken(_0x469bf0,_0x291230){try{var _0x25b5f6=jwt['decode'](_0x469bf0,{'complete':!![]});var _0x39c9b7=_0x25b5f6[_0xc7fc('0x30')];if(_0x39c9b7[_0xc7fc('0x31')]!==_0x291230[_0xc7fc('0x32')])return![];if(_0x39c9b7[_0xc7fc('0x33')]!==_0x291230[_0xc7fc('0x34')])return![];if(_0x39c9b7[_0xc7fc('0x35')]!==_0x291230[_0xc7fc('0x35')])return![];if(moment()[_0xc7fc('0x36')](moment[_0xc7fc('0x37')](_0x39c9b7[_0xc7fc('0x38')])))return![];return!![];}catch(_0x50ae33){throw _0x50ae33;}}function refreshOauth2MicrosoftAccessToken(_0x4d6194){return Promise[_0xc7fc('0x39')]()['then'](function(){if(_0x4d6194[_0xc7fc('0x3a')])return _0x4d6194;return db[_0xc7fc('0x3b')][_0xc7fc('0x3c')]({'where':{'id':_0x4d6194['id']},'raw':!![]});})[_0xc7fc('0x3d')](function(_0x5516db){var _0x24c398={'grant_type':_0xc7fc('0x3e'),'refresh_token':_0x5516db[_0xc7fc('0x3f')],'scope':getAccessTokenScope(_0x5516db),'redirect_uri':_0x5516db['data4'],'client_id':_0x5516db[_0xc7fc('0x25')],'client_secret':encryptor['decryptString'](_0x5516db['data3'])};var _0x1c6fa3={'method':_0xc7fc('0x40'),'uri':MICROSOFT_AUTH_URL[_0xc7fc('0x2e')](_0xc7fc('0x1b'),_0x5516db[_0xc7fc('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x24c398,'json':!![]};return rp(_0x1c6fa3);})[_0xc7fc('0x3d')](function(_0x4ba7ed){_0x4d6194['data5']=_0x4ba7ed[_0xc7fc('0x41')];_0x4d6194[_0xc7fc('0x3f')]=_0x4ba7ed[_0xc7fc('0x3e')];return db['CloudProvider'][_0xc7fc('0x42')]({'data5':_0x4d6194[_0xc7fc('0x43')],'data6':_0x4d6194[_0xc7fc('0x3f')]},{'where':{'id':_0x4d6194['id']}});})['then'](function(){return _0x4d6194;})[_0xc7fc('0x44')](function(_0x51811a){logger[_0xc7fc('0x45')](_0xc7fc('0x46'),_0x4d6194['id'],_0x51811a);});}function getOauth2MicrosoftAccessToken(_0x19b205,_0x12d180){var _0x25b832={'grant_type':_0xc7fc('0x47'),'code':_0x19b205,'scope':getAccessTokenScope(_0x12d180),'redirect_uri':_0x12d180[_0xc7fc('0x27')],'client_id':_0x12d180[_0xc7fc('0x25')],'client_secret':encryptor[_0xc7fc('0x48')](_0x12d180[_0xc7fc('0x3a')])};var _0x4dc316={'method':'POST','uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x12d180[_0xc7fc('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x25b832,'json':!![]};return rp(_0x4dc316);}function startRefreshInterval(_0x5e207f){var _0x4ed879=schedule['intervals'];if(_0x4ed879[_0x5e207f['id']])clearInterval(_0x4ed879[_0x5e207f['id']]);_0x4ed879[_0x5e207f['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xc7fc('0x49')](this,{'id':_0x5e207f['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x4ed879;}function startAllRefreshIntervals(){return db[_0xc7fc('0x3b')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xc7fc('0x3d')](function(_0x3fa01e){var _0x476303=_0x3fa01e['map'](function(_0x21b36b){return refreshOauth2MicrosoftAccessToken(_0x21b36b)[_0xc7fc('0x3d')](function(_0x5c58b5){startRefreshInterval(_0x5c58b5);});});return Promise[_0xc7fc('0x4a')](_0x476303);})[_0xc7fc('0x44')](function(_0x3cbda4){var _0x5d9991=_0x3cbda4?util[_0xc7fc('0x4b')](_0x3cbda4,{'showHidden':![],'depth':null}):'';logger[_0xc7fc('0x45')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x5d9991);});}module[_0xc7fc('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x90b4=['util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','/.default','join','replace','{TENANT_ID}','data2','code','id_token','stringify','base64','toString','hex','client_id','data1','response_type','redirect_uri','response_mode','scope','nonce','login','key','value','oauth2Claims','set','payload','iss','issuer','aud','audience','unix','resolve','CloudProvider','refresh_token','data6','data4','decryptString','data3','then','data5','catch','authorization_code','POST','intervals','all','inspect','error','exports','lodash','crypto','ioredis','request-promise'];(function(_0x5bf691,_0x5d34c9){var _0x1be7ab=function(_0x4b5d01){while(--_0x4b5d01){_0x5bf691['push'](_0x5bf691['shift']());}};_0x1be7ab(++_0x5d34c9);}(_0x90b4,0xd4));var _0x490b=function(_0x5bd418,_0x3991f8){_0x5bd418=_0x5bd418-0x0;var _0x10f4f0=_0x90b4[_0x5bd418];return _0x10f4f0;};'use strict';var _=require(_0x490b('0x0'));var crypto=require(_0x490b('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x490b('0x2'));var rp=require(_0x490b('0x3'));var util=require(_0x490b('0x4'));var encryptor=require(_0x490b('0x5'));var config=require(_0x490b('0x6'));var logger=require('../../config/logger')(_0x490b('0x7'));var schedule=require(_0x490b('0x8'));var db=require(_0x490b('0x9'))['db'];config[_0x490b('0xa')]=_['defaults'](config['redis'],{'host':_0x490b('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x490b('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x490b('0xd'),_0x490b('0xe'),_0x490b('0xf'),_0x490b('0x10'),_0x490b('0x11'),_0x490b('0x12'),_0x490b('0x13')],'Dynamics365':[_0x490b('0xd'),_0x490b('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x490b('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x490b('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x145c42){var _0x13520e=_[_0x490b('0x16')](AZURE_AUTH_SCOPES[_0x145c42[_0x490b('0x17')]]);if(_0x145c42[_0x490b('0x17')]===_0x490b('0x18'))_0x13520e[_0x490b('0x19')](_0x145c42['data7']+_0x490b('0x1a'));return _0x13520e[_0x490b('0x1b')]('\x20');}function getAccessTokenScope(_0x52e55d){if(_0x52e55d[_0x490b('0x17')]==='Outlook365')return _0x490b('0x11');if(_0x52e55d[_0x490b('0x17')]==='Dynamics365')return _0x52e55d['data7']+_0x490b('0x1a');}function generateMicrosoftAuthorizationUrl(_0x1b53b1,_0x1456b2){var _0x22faa6=MICROSOFT_AUTH_URL[_0x490b('0x1c')](_0x490b('0x1d'),_0x1b53b1[_0x490b('0x1e')]);var _0x47d164=[_0x490b('0x1f'),_0x490b('0x20')];var _0x72e73=Buffer['from'](JSON[_0x490b('0x21')]({'id':_0x1456b2}))['toString'](_0x490b('0x22'));var _0x360b28=crypto['randomBytes'](0x10)[_0x490b('0x23')](_0x490b('0x24'));var _0x1b2e83=getAuthorizationScopes(_0x1b53b1);var _0x49c81a=[{'key':_0x490b('0x25'),'value':_0x1b53b1[_0x490b('0x26')]},{'key':_0x490b('0x27'),'value':encodeURIComponent(_0x47d164[_0x490b('0x1b')]('\x20'))},{'key':_0x490b('0x28'),'value':_0x1b53b1['data4']},{'key':_0x490b('0x29'),'value':'form_post'},{'key':_0x490b('0x2a'),'value':encodeURIComponent(_0x1b2e83)},{'key':'state','value':_0x72e73},{'key':_0x490b('0x2b'),'value':_0x360b28},{'key':'prompt','value':_0x490b('0x2c')}];var _0x323a9a=_0x22faa6+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x490b('0x16')](_0x49c81a,function(_0x38477a){return _0x38477a[_0x490b('0x2d')]+'='+_0x38477a[_0x490b('0x2e')];})[_0x490b('0x1b')]('&');_0x1b53b1[_0x490b('0x2f')]={'issuer':_0x22faa6[_0x490b('0x1c')]('oauth2/',''),'audience':_0x1b53b1[_0x490b('0x26')],'state':_0x72e73,'nonce':_0x360b28};redis[_0x490b('0x30')](_0x72e73,JSON[_0x490b('0x21')](_0x1b53b1));return _0x323a9a;}function isValidIdToken(_0x8f10d8,_0x2903e3){try{var _0x19577d=jwt['decode'](_0x8f10d8,{'complete':!![]});var _0x4f3804=_0x19577d[_0x490b('0x31')];if(_0x4f3804[_0x490b('0x32')]!==_0x2903e3[_0x490b('0x33')])return![];if(_0x4f3804[_0x490b('0x34')]!==_0x2903e3[_0x490b('0x35')])return![];if(_0x4f3804['nonce']!==_0x2903e3['nonce'])return![];if(moment()['isAfter'](moment[_0x490b('0x36')](_0x4f3804['exp'])))return![];return!![];}catch(_0x6d2ab2){throw _0x6d2ab2;}}function refreshOauth2MicrosoftAccessToken(_0x578775){return Promise[_0x490b('0x37')]()['then'](function(){if(_0x578775['data3'])return _0x578775;return db[_0x490b('0x38')]['findOne']({'where':{'id':_0x578775['id']},'raw':!![]});})['then'](function(_0xf6e531){var _0x997116={'grant_type':_0x490b('0x39'),'refresh_token':_0xf6e531[_0x490b('0x3a')],'scope':getAccessTokenScope(_0xf6e531),'redirect_uri':_0xf6e531[_0x490b('0x3b')],'client_id':_0xf6e531[_0x490b('0x26')],'client_secret':encryptor[_0x490b('0x3c')](_0xf6e531[_0x490b('0x3d')])};var _0x80124a={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x490b('0x1c')]('{TENANT_ID}',_0xf6e531[_0x490b('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x997116,'json':!![]};return rp(_0x80124a);})[_0x490b('0x3e')](function(_0x1be07e){_0x578775[_0x490b('0x3f')]=_0x1be07e['access_token'];_0x578775[_0x490b('0x3a')]=_0x1be07e[_0x490b('0x39')];return db['CloudProvider']['update']({'data5':_0x578775[_0x490b('0x3f')],'data6':_0x578775[_0x490b('0x3a')]},{'where':{'id':_0x578775['id']}});})[_0x490b('0x3e')](function(){return _0x578775;})[_0x490b('0x40')](function(_0x2af881){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x578775['id'],_0x2af881);});}function getOauth2MicrosoftAccessToken(_0x7d9e52,_0xe74340){var _0x3da2d2={'grant_type':_0x490b('0x41'),'code':_0x7d9e52,'scope':getAccessTokenScope(_0xe74340),'redirect_uri':_0xe74340['data4'],'client_id':_0xe74340[_0x490b('0x26')],'client_secret':encryptor['decryptString'](_0xe74340[_0x490b('0x3d')])};var _0x418b85={'method':_0x490b('0x42'),'uri':MICROSOFT_AUTH_URL['replace'](_0x490b('0x1d'),_0xe74340[_0x490b('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3da2d2,'json':!![]};return rp(_0x418b85);}function startRefreshInterval(_0x436cbe){var _0x31d73b=schedule[_0x490b('0x43')];if(_0x31d73b[_0x436cbe['id']])clearInterval(_0x31d73b[_0x436cbe['id']]);_0x31d73b[_0x436cbe['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x436cbe['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x31d73b;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x490b('0x3e')](function(_0x5ce3e0){var _0x4f9b6f=_0x5ce3e0[_0x490b('0x16')](function(_0x31dd00){return refreshOauth2MicrosoftAccessToken(_0x31dd00)['then'](function(_0x171666){startRefreshInterval(_0x171666);});});return Promise[_0x490b('0x44')](_0x4f9b6f);})[_0x490b('0x40')](function(_0x9d2914){var _0x12bba3=_0x9d2914?util[_0x490b('0x45')](_0x9d2914,{'showHidden':![],'depth':null}):'';logger[_0x490b('0x46')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x12bba3);});}module[_0x490b('0x47')]={'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 116e690..47b3fb5 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 _0x419f=['CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent'];(function(_0x26a29d,_0x126177){var _0x30c60d=function(_0x3ddc95){while(--_0x3ddc95){_0x26a29d['push'](_0x26a29d['shift']());}};_0x30c60d(++_0x126177);}(_0x419f,0x176));var _0xf419=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x419f[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xf419('0x0'));var util=require(_0xf419('0x1'));var moment=require(_0xf419('0x2'));var BPromise=require(_0xf419('0x3'));var rs=require(_0xf419('0x4'));var fs=require('fs');var Redis=require(_0xf419('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf419('0x6'));var logger=require('../../config/logger')(_0xf419('0x7'));var config=require(_0xf419('0x8'));var jayson=require(_0xf419('0x9'));var client=jayson[_0xf419('0xa')][_0xf419('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b5526,_0x4082de,_0x2e42a8){return new BPromise(function(_0x3f0c3e,_0x4bb5fd){return client[_0xf419('0xc')](_0x2b5526,_0x2e42a8)[_0xf419('0xd')](function(_0x5ab7d3){logger[_0xf419('0xe')](_0xf419('0xf'),_0x4082de,_0xf419('0x10'));logger['debug'](_0xf419('0x11'),_0x4082de,_0xf419('0x10'),JSON[_0xf419('0x12')](_0x5ab7d3));if(_0x5ab7d3[_0xf419('0x13')]){if(_0x5ab7d3[_0xf419('0x13')]['code']===0x1f4){logger['error'](_0xf419('0xf'),_0x4082de,_0x5ab7d3[_0xf419('0x13')][_0xf419('0x14')]);return _0x4bb5fd(_0x5ab7d3[_0xf419('0x13')][_0xf419('0x14')]);}logger['error'](_0xf419('0xf'),_0x4082de,_0x5ab7d3[_0xf419('0x13')][_0xf419('0x14')]);return _0x3f0c3e(_0x5ab7d3[_0xf419('0x13')][_0xf419('0x14')]);}else{logger[_0xf419('0xe')]('CloudProvider,\x20%s,\x20%s',_0x4082de,_0xf419('0x10'));_0x3f0c3e(_0x5ab7d3[_0xf419('0x15')]['message']);}})[_0xf419('0x16')](function(_0x19660e){logger[_0xf419('0x13')]('CloudProvider,\x20%s,\x20%s',_0x4082de,_0x19660e);_0x4bb5fd(_0x19660e);});});}
\ No newline at end of file
+var _0xdaa8=['client','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../config/environment','jayson/promise'];(function(_0x1100ec,_0x4c97b1){var _0x9d4dee=function(_0x2bf8a9){while(--_0x2bf8a9){_0x1100ec['push'](_0x1100ec['shift']());}};_0x9d4dee(++_0x4c97b1);}(_0xdaa8,0xe4));var _0x8daa=function(_0x219e3d,_0x5e287e){_0x219e3d=_0x219e3d-0x0;var _0x28474c=_0xdaa8[_0x219e3d];return _0x28474c;};'use strict';var _=require(_0x8daa('0x0'));var util=require(_0x8daa('0x1'));var moment=require(_0x8daa('0x2'));var BPromise=require(_0x8daa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8daa('0x4'));var jayson=require(_0x8daa('0x5'));var client=jayson[_0x8daa('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e8116,_0x1f5a97,_0x48bf41){return new BPromise(function(_0x41de3e,_0x2df1a0){return client[_0x8daa('0x7')](_0x4e8116,_0x48bf41)[_0x8daa('0x8')](function(_0x207291){logger['info'](_0x8daa('0x9'),_0x1f5a97,_0x8daa('0xa'));logger[_0x8daa('0xb')](_0x8daa('0xc'),_0x1f5a97,_0x8daa('0xa'),JSON[_0x8daa('0xd')](_0x207291));if(_0x207291[_0x8daa('0xe')]){if(_0x207291[_0x8daa('0xe')][_0x8daa('0xf')]===0x1f4){logger[_0x8daa('0xe')](_0x8daa('0x9'),_0x1f5a97,_0x207291['error'][_0x8daa('0x10')]);return _0x2df1a0(_0x207291[_0x8daa('0xe')][_0x8daa('0x10')]);}logger['error'](_0x8daa('0x9'),_0x1f5a97,_0x207291['error'][_0x8daa('0x10')]);return _0x41de3e(_0x207291[_0x8daa('0xe')][_0x8daa('0x10')]);}else{logger['info'](_0x8daa('0x9'),_0x1f5a97,_0x8daa('0xa'));_0x41de3e(_0x207291['result']['message']);}})[_0x8daa('0x11')](function(_0x2fc822){logger[_0x8daa('0xe')](_0x8daa('0x9'),_0x1f5a97,_0x2fc822);_0x2df1a0(_0x2fc822);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 04c71a6..9606091 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 _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5d17ad,_0x5dab65){_0x5d17ad=_0x5d17ad-0x0;var _0x43aa32=_0x5f2f[_0x5d17ad];return _0x43aa32;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
+var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x369adf,_0x1e4428){_0x369adf=_0x369adf-0x0;var _0x164b44=_0x5f2f[_0x369adf];return _0x164b44;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index fddbbed..542cf9f 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 _0xc015=['name','sequelize','exports','STRING'];(function(_0x1d6d75,_0x31ef4){var _0x1e7cd0=function(_0x786041){while(--_0x786041){_0x1d6d75['push'](_0x1d6d75['shift']());}};_0x1e7cd0(++_0x31ef4);}(_0xc015,0x81));var _0x5c01=function(_0x36d25e,_0x1a047d){_0x36d25e=_0x36d25e-0x0;var _0x4b95b8=_0xc015[_0x36d25e];return _0x4b95b8;};'use strict';var Sequelize=require(_0x5c01('0x0'));module[_0x5c01('0x1')]={'name':{'type':Sequelize[_0x5c01('0x2')],'unique':_0x5c01('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x5c01('0x2')]},'companyId':{'type':Sequelize[_0x5c01('0x2')]},'website':{'type':Sequelize[_0x5c01('0x2')]},'phone':{'type':Sequelize[_0x5c01('0x2')]},'fax':{'type':Sequelize[_0x5c01('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x5c01('0x2')]},'postalCode':{'type':Sequelize[_0x5c01('0x2')]},'city':{'type':Sequelize[_0x5c01('0x2')]},'country':{'type':Sequelize[_0x5c01('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x5c01('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x5c01('0x2')]},'sCountry':{'type':Sequelize[_0x5c01('0x2')]},'description':{'type':Sequelize[_0x5c01('0x2')]}};
\ No newline at end of file
+var _0xa33b=['sequelize','exports','STRING','name'];(function(_0x423836,_0x2d438d){var _0x1d9500=function(_0x805dd0){while(--_0x805dd0){_0x423836['push'](_0x423836['shift']());}};_0x1d9500(++_0x2d438d);}(_0xa33b,0x68));var _0xba33=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xa33b[_0x17b6e3];return _0x3906f3;};'use strict';var Sequelize=require(_0xba33('0x0'));module[_0xba33('0x1')]={'name':{'type':Sequelize[_0xba33('0x2')],'unique':_0xba33('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xba33('0x2')]},'companyId':{'type':Sequelize[_0xba33('0x2')]},'website':{'type':Sequelize[_0xba33('0x2')]},'phone':{'type':Sequelize[_0xba33('0x2')]},'fax':{'type':Sequelize[_0xba33('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xba33('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xba33('0x2')]},'country':{'type':Sequelize[_0xba33('0x2')]},'email':{'type':Sequelize[_0xba33('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xba33('0x2')]},'sStreet':{'type':Sequelize[_0xba33('0x2')]},'sPostalCode':{'type':Sequelize[_0xba33('0x2')]},'sCity':{'type':Sequelize[_0xba33('0x2')]},'sCountry':{'type':Sequelize[_0xba33('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 9ed42f7..8b74ded 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 _0xbea0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','send','CmCompany','describe','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','includeAll','findAll','rows','catch','params','intersection','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','order','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','crypto','desk.js','querystring'];(function(_0x47ea24,_0x763e97){var _0xe5a240=function(_0x2e1f7f){while(--_0x2e1f7f){_0x47ea24['push'](_0x47ea24['shift']());}};_0xe5a240(++_0x763e97);}(_0xbea0,0xec));var _0x0bea=function(_0x23e1a3,_0x1ff0c8){_0x23e1a3=_0x23e1a3-0x0;var _0x2dbba6=_0xbea0[_0x23e1a3];return _0x2dbba6;};'use strict';var emlformat=require(_0x0bea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0bea('0x1'));var jsonpatch=require(_0x0bea('0x2'));var rp=require(_0x0bea('0x3'));var moment=require('moment');var BPromise=require(_0x0bea('0x4'));var Mustache=require(_0x0bea('0x5'));var util=require(_0x0bea('0x6'));var path=require('path');var sox=require(_0x0bea('0x7'));var csv=require(_0x0bea('0x8'));var ejs=require(_0x0bea('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0bea('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0bea('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0bea('0xc'));var Papa=require(_0x0bea('0xd'));var Redis=require(_0x0bea('0xe'));var authService=require(_0x0bea('0xf'));var qs=require(_0x0bea('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bea('0x11'));var logger=require(_0x0bea('0x12'))(_0x0bea('0x13'));var utils=require(_0x0bea('0x14'));var config=require(_0x0bea('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0bea('0x16'))['db'];function respondWithStatusCode(_0x4ea548,_0x4c5b42){_0x4c5b42=_0x4c5b42||0xcc;return function(_0x3ea765){if(_0x3ea765){return _0x4ea548[_0x0bea('0x17')](_0x4c5b42);}return _0x4ea548['status'](_0x4c5b42)[_0x0bea('0x18')]();};}function respondWithResult(_0x2486eb,_0x5291ee){_0x5291ee=_0x5291ee||0xc8;return function(_0x18e6e7){if(_0x18e6e7){return _0x2486eb[_0x0bea('0x19')](_0x5291ee)[_0x0bea('0x1a')](_0x18e6e7);}};}function respondWithFilteredResult(_0x10947a,_0x27c99d){return function(_0x4b81e0){if(_0x4b81e0){var _0x282813=typeof _0x27c99d['offset']==='undefined'&&typeof _0x27c99d['limit']==='undefined';var _0x32ebc3=_0x4b81e0[_0x0bea('0x1b')];var _0x20ce44=_0x282813?0x0:_0x27c99d['offset'];var _0x482526=_0x282813?_0x4b81e0[_0x0bea('0x1b')]:_0x27c99d[_0x0bea('0x1c')]+_0x27c99d[_0x0bea('0x1d')];var _0x490a16;if(_0x482526>=_0x32ebc3){_0x482526=_0x32ebc3;_0x490a16=0xc8;}else{_0x490a16=0xce;}_0x10947a[_0x0bea('0x19')](_0x490a16);return _0x10947a[_0x0bea('0x1e')](_0x0bea('0x1f'),_0x20ce44+'-'+_0x482526+'/'+_0x32ebc3)['json'](_0x4b81e0);}return null;};}function patchUpdates(_0x418c9e){return function(_0x2f2833){try{jsonpatch['apply'](_0x2f2833,_0x418c9e,!![]);}catch(_0x76f1d4){return BPromise['reject'](_0x76f1d4);}return _0x2f2833[_0x0bea('0x20')]();};}function saveUpdates(_0x56d8bd,_0x22210b){return function(_0x13c597){if(_0x13c597){return _0x13c597[_0x0bea('0x21')](_0x56d8bd)[_0x0bea('0x22')](function(_0x4fb972){return _0x4fb972;});}return null;};}function removeEntity(_0x22ebe6,_0xf93519){return function(_0x5a0da9){if(_0x5a0da9){return _0x5a0da9[_0x0bea('0x23')]()['then'](function(){var _0x4a202a=_0x5a0da9[_0x0bea('0x24')]({'plain':!![]});var _0x2d9d1f=_0x0bea('0x25');return db[_0x0bea('0x26')][_0x0bea('0x23')]({'where':{'type':_0x2d9d1f,'resourceId':_0x4a202a['id']}})[_0x0bea('0x22')](function(){return _0x5a0da9;});})[_0x0bea('0x22')](function(){_0x22ebe6['status'](0xcc)[_0x0bea('0x18')]();});}};}function handleEntityNotFound(_0x356880,_0x139784){return function(_0x3932e5){if(!_0x3932e5){_0x356880[_0x0bea('0x17')](0x194);}return _0x3932e5;};}function handleError(_0x4a67aa,_0x429008){_0x429008=_0x429008||0x1f4;return function(_0xd4be92){logger[_0x0bea('0x27')](_0xd4be92[_0x0bea('0x28')]);if(_0xd4be92['name']){delete _0xd4be92['name'];}_0x4a67aa[_0x0bea('0x19')](_0x429008)[_0x0bea('0x29')](_0xd4be92);};}exports['index']=function(_0x1c85b3,_0x1b76a4){var _0x11271f={},_0x334954={},_0x17b073={'count':0x0,'rows':[]};return db[_0x0bea('0x2a')][_0x0bea('0x2b')]()[_0x0bea('0x22')](function(_0x2a8382){_0x334954[_0x0bea('0x2c')]=_[_0x0bea('0x2d')](_0x2a8382);_0x334954[_0x0bea('0x2e')]=_[_0x0bea('0x2d')](_0x1c85b3['query']);_0x334954['filters']=_['intersection'](_0x334954[_0x0bea('0x2c')],_0x334954[_0x0bea('0x2e')]);_0x11271f[_0x0bea('0x2f')]=_['intersection'](_0x334954[_0x0bea('0x2c')],qs[_0x0bea('0x30')](_0x1c85b3[_0x0bea('0x2e')][_0x0bea('0x30')]));_0x11271f[_0x0bea('0x2f')]=_0x11271f['attributes'][_0x0bea('0x31')]?_0x11271f[_0x0bea('0x2f')]:_0x334954['model'];if(!_0x1c85b3[_0x0bea('0x2e')][_0x0bea('0x32')](_0x0bea('0x33'))){_0x11271f[_0x0bea('0x1d')]=qs[_0x0bea('0x1d')](_0x1c85b3[_0x0bea('0x2e')][_0x0bea('0x1d')]);_0x11271f[_0x0bea('0x1c')]=qs[_0x0bea('0x1c')](_0x1c85b3[_0x0bea('0x2e')]['offset']);}_0x11271f['order']=qs[_0x0bea('0x34')](_0x1c85b3['query'][_0x0bea('0x34')]);_0x11271f[_0x0bea('0x35')]=qs[_0x0bea('0x36')](_[_0x0bea('0x37')](_0x1c85b3['query'],_0x334954[_0x0bea('0x36')]),_0x2a8382);if(_0x1c85b3[_0x0bea('0x2e')][_0x0bea('0x38')]){_0x11271f[_0x0bea('0x35')]=_[_0x0bea('0x39')](_0x11271f[_0x0bea('0x35')],{'$or':_[_0x0bea('0x3a')](_0x11271f['attributes'],function(_0x5b5350){var _0x11ddc1={};_0x11ddc1[_0x5b5350]={'$like':'%'+_0x1c85b3[_0x0bea('0x2e')][_0x0bea('0x38')]+'%'};return _0x11ddc1;})});}_0x11271f=_[_0x0bea('0x39')]({},_0x11271f,_0x1c85b3['options']);var _0x2b1801={'where':_0x11271f[_0x0bea('0x35')]};return db['CmCompany'][_0x0bea('0x1b')](_0x2b1801)[_0x0bea('0x22')](function(_0x172e66){_0x17b073[_0x0bea('0x1b')]=_0x172e66;if(_0x1c85b3[_0x0bea('0x2e')][_0x0bea('0x3b')]){_0x11271f['include']=[{'all':!![]}];}return db['CmCompany'][_0x0bea('0x3c')](_0x11271f);})[_0x0bea('0x22')](function(_0x3e67d4){_0x17b073[_0x0bea('0x3d')]=_0x3e67d4;return _0x17b073;})[_0x0bea('0x22')](respondWithFilteredResult(_0x1b76a4,_0x11271f))['catch'](handleError(_0x1b76a4,null));})[_0x0bea('0x3e')](handleError(_0x1b76a4,null));};exports['show']=function(_0x4e0dbc,_0x364ab1){var _0x1e7b12={'raw':![],'where':{'id':_0x4e0dbc[_0x0bea('0x3f')]['id']}},_0x6c28f2={};_0x6c28f2[_0x0bea('0x2c')]=_[_0x0bea('0x2d')](db['CmCompany']['rawAttributes']);_0x6c28f2[_0x0bea('0x2e')]=_[_0x0bea('0x2d')](_0x4e0dbc['query']);_0x6c28f2[_0x0bea('0x36')]=_[_0x0bea('0x40')](_0x6c28f2['model'],_0x6c28f2[_0x0bea('0x2e')]);_0x1e7b12['attributes']=_[_0x0bea('0x40')](_0x6c28f2[_0x0bea('0x2c')],qs[_0x0bea('0x30')](_0x4e0dbc[_0x0bea('0x2e')][_0x0bea('0x30')]));_0x1e7b12['attributes']=_0x1e7b12[_0x0bea('0x2f')][_0x0bea('0x31')]?_0x1e7b12[_0x0bea('0x2f')]:_0x6c28f2['model'];if(_0x4e0dbc[_0x0bea('0x2e')]['includeAll']){_0x1e7b12['include']=[{'all':!![]}];}_0x1e7b12=_[_0x0bea('0x39')]({},_0x1e7b12,_0x4e0dbc[_0x0bea('0x41')]);return db[_0x0bea('0x2a')][_0x0bea('0x42')](_0x1e7b12)[_0x0bea('0x22')](handleEntityNotFound(_0x364ab1,null))[_0x0bea('0x22')](respondWithResult(_0x364ab1,null))[_0x0bea('0x3e')](handleError(_0x364ab1,null));};exports['create']=function(_0x529d84,_0x2103b1){return db[_0x0bea('0x2a')][_0x0bea('0x43')](_0x529d84[_0x0bea('0x44')],{})[_0x0bea('0x22')](function(_0x41a840){var _0x491b86=_0x529d84[_0x0bea('0x45')][_0x0bea('0x24')]({'plain':!![]});if(!_0x491b86)throw new Error(_0x0bea('0x46'));if(_0x491b86[_0x0bea('0x47')]==='user'){var _0x3d49de=_0x41a840[_0x0bea('0x24')]({'plain':!![]});var _0x24b868=_0x0bea('0x25');return db['UserProfileSection'][_0x0bea('0x42')]({'where':{'name':_0x24b868,'userProfileId':_0x491b86[_0x0bea('0x48')]},'raw':!![]})[_0x0bea('0x22')](function(_0x5ae2df){if(_0x5ae2df&&_0x5ae2df['autoAssociation']===0x0){return db[_0x0bea('0x26')]['create']({'name':_0x3d49de[_0x0bea('0x49')],'resourceId':_0x3d49de['id'],'type':_0x5ae2df[_0x0bea('0x49')],'sectionId':_0x5ae2df['id']},{})[_0x0bea('0x22')](function(){return _0x41a840;});}else{return _0x41a840;}})[_0x0bea('0x3e')](function(_0x18e0da){logger[_0x0bea('0x27')](_0x0bea('0x4a'),_0x18e0da);throw _0x18e0da;});}return _0x41a840;})[_0x0bea('0x22')](respondWithResult(_0x2103b1,0xc9))['catch'](handleError(_0x2103b1,null));};exports[_0x0bea('0x21')]=function(_0x55443a,_0x5e3936){if(_0x55443a[_0x0bea('0x44')]['id']){delete _0x55443a[_0x0bea('0x44')]['id'];}return db['CmCompany'][_0x0bea('0x42')]({'where':{'id':_0x55443a['params']['id']}})[_0x0bea('0x22')](handleEntityNotFound(_0x5e3936,null))[_0x0bea('0x22')](saveUpdates(_0x55443a[_0x0bea('0x44')],null))[_0x0bea('0x22')](respondWithResult(_0x5e3936,null))['catch'](handleError(_0x5e3936,null));};exports[_0x0bea('0x23')]=function(_0x5be5e1,_0x2fc2d5){return db[_0x0bea('0x2a')][_0x0bea('0x42')]({'where':{'id':_0x5be5e1['params']['id']}})[_0x0bea('0x22')](handleEntityNotFound(_0x2fc2d5,null))[_0x0bea('0x22')](removeEntity(_0x2fc2d5,null))[_0x0bea('0x3e')](handleError(_0x2fc2d5,null));};exports['describe']=function(_0x270b5d,_0x20705d){return db[_0x0bea('0x2a')][_0x0bea('0x2b')]()[_0x0bea('0x22')](respondWithResult(_0x20705d,null))[_0x0bea('0x3e')](handleError(_0x20705d,null));};exports[_0x0bea('0x4b')]=function(_0x2d2403,_0x41e315,_0x403f15){return db[_0x0bea('0x4c')]['find']({'where':{'id':_0x2d2403[_0x0bea('0x3f')]['id']}})['then'](handleEntityNotFound(_0x41e315,null))[_0x0bea('0x22')](function(_0x35e93){if(_0x35e93){return _0x35e93[_0x0bea('0x4b')](_0x2d2403[_0x0bea('0x44')][_0x0bea('0x4d')],_[_0x0bea('0x4e')](_0x2d2403[_0x0bea('0x44')],[_0x0bea('0x4d'),'id'])||{});}})[_0x0bea('0x22')](respondWithResult(_0x41e315,null))['catch'](handleError(_0x41e315,null));};exports[_0x0bea('0x4f')]=function(_0x440aa9,_0x656a95,_0xebbe73){var _0x1d7bb1={};var _0x118899={};var _0x3cb8b5;var _0x5cb606;return db['CmCompany'][_0x0bea('0x50')]({'where':{'id':_0x440aa9[_0x0bea('0x3f')]['id']}})['then'](handleEntityNotFound(_0x656a95,null))[_0x0bea('0x22')](function(_0x2bb853){if(_0x2bb853){_0x3cb8b5=_0x2bb853;_0x118899[_0x0bea('0x2c')]=_[_0x0bea('0x2d')](db[_0x0bea('0x4c')][_0x0bea('0x51')]);_0x118899[_0x0bea('0x2e')]=_[_0x0bea('0x2d')](_0x440aa9[_0x0bea('0x2e')]);_0x118899['filters']=_[_0x0bea('0x40')](_0x118899[_0x0bea('0x2c')],_0x118899[_0x0bea('0x2e')]);_0x1d7bb1[_0x0bea('0x2f')]=_[_0x0bea('0x40')](_0x118899['model'],qs[_0x0bea('0x30')](_0x440aa9['query'][_0x0bea('0x30')]));_0x1d7bb1[_0x0bea('0x2f')]=_0x1d7bb1[_0x0bea('0x2f')][_0x0bea('0x31')]?_0x1d7bb1[_0x0bea('0x2f')]:_0x118899[_0x0bea('0x2c')];_0x1d7bb1[_0x0bea('0x52')]=qs[_0x0bea('0x34')](_0x440aa9[_0x0bea('0x2e')][_0x0bea('0x34')]);_0x1d7bb1[_0x0bea('0x35')]=qs['filters'](_[_0x0bea('0x37')](_0x440aa9[_0x0bea('0x2e')],_0x118899[_0x0bea('0x36')]));if(_0x440aa9['query'][_0x0bea('0x38')]){_0x1d7bb1[_0x0bea('0x35')]=_['merge'](_0x1d7bb1['where'],{'$or':_[_0x0bea('0x3a')](_0x1d7bb1[_0x0bea('0x2f')],function(_0x32a5c2){var _0x288ba4={};_0x288ba4[_0x32a5c2]={'$like':'%'+_0x440aa9[_0x0bea('0x2e')][_0x0bea('0x38')]+'%'};return _0x288ba4;})});}_0x1d7bb1=_[_0x0bea('0x39')]({},_0x1d7bb1,_0x440aa9[_0x0bea('0x41')]);return _0x3cb8b5[_0x0bea('0x4f')](_0x1d7bb1);}})[_0x0bea('0x22')](function(_0x1d68b9){if(_0x1d68b9){_0x5cb606=_0x1d68b9['length'];if(!_0x440aa9[_0x0bea('0x2e')][_0x0bea('0x32')](_0x0bea('0x33'))){_0x1d7bb1[_0x0bea('0x1d')]=qs['limit'](_0x440aa9[_0x0bea('0x2e')][_0x0bea('0x1d')]);_0x1d7bb1['offset']=qs[_0x0bea('0x1c')](_0x440aa9[_0x0bea('0x2e')]['offset']);}return _0x3cb8b5[_0x0bea('0x4f')](_0x1d7bb1);}})[_0x0bea('0x22')](function(_0x20a6f4){if(_0x20a6f4){return _0x20a6f4?{'count':_0x5cb606,'rows':_0x20a6f4}:null;}})[_0x0bea('0x22')](respondWithResult(_0x656a95,null))['catch'](handleError(_0x656a95,null));};
\ No newline at end of file
+var _0x9e8d=['merge','map','filter','options','include','CmCompany','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','addContacts','ids','getContacts','pick','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','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','status','end','offset','undefined','count','limit','json','apply','reject','save','then','get','Companies','UserProfileResource','destroy','name','send','index','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x1fe0b5,_0x2d5ddc){var _0x14ee7c=function(_0x5103cc){while(--_0x5103cc){_0x1fe0b5['push'](_0x1fe0b5['shift']());}};_0x14ee7c(++_0x2d5ddc);}(_0x9e8d,0x11d));var _0xd9e8=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x9e8d[_0x311c35];return _0x5cc50c;};'use strict';var emlformat=require(_0xd9e8('0x0'));var rimraf=require(_0xd9e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9e8('0x2'));var rp=require('request-promise');var moment=require(_0xd9e8('0x3'));var BPromise=require(_0xd9e8('0x4'));var Mustache=require(_0xd9e8('0x5'));var util=require(_0xd9e8('0x6'));var path=require(_0xd9e8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9e8('0x8'));var _=require(_0xd9e8('0x9'));var squel=require(_0xd9e8('0xa'));var crypto=require('crypto');var jsforce=require(_0xd9e8('0xb'));var deskjs=require(_0xd9e8('0xc'));var toCsv=require(_0xd9e8('0xd'));var querystring=require('querystring');var Papa=require(_0xd9e8('0xe'));var Redis=require(_0xd9e8('0xf'));var authService=require(_0xd9e8('0x10'));var qs=require(_0xd9e8('0x11'));var as=require(_0xd9e8('0x12'));var hardwareService=require(_0xd9e8('0x13'));var logger=require(_0xd9e8('0x14'))(_0xd9e8('0x15'));var utils=require(_0xd9e8('0x16'));var config=require(_0xd9e8('0x17'));var licenseUtil=require(_0xd9e8('0x18'));var db=require(_0xd9e8('0x19'))['db'];function respondWithStatusCode(_0x296e7e,_0x255a84){_0x255a84=_0x255a84||0xcc;return function(_0x5db990){if(_0x5db990){return _0x296e7e[_0xd9e8('0x1a')](_0x255a84);}return _0x296e7e[_0xd9e8('0x1b')](_0x255a84)[_0xd9e8('0x1c')]();};}function respondWithResult(_0x262a62,_0x3e1948){_0x3e1948=_0x3e1948||0xc8;return function(_0x1f8573){if(_0x1f8573){return _0x262a62[_0xd9e8('0x1b')](_0x3e1948)['json'](_0x1f8573);}};}function respondWithFilteredResult(_0x2daea7,_0xf35f7){return function(_0x5fc99a){if(_0x5fc99a){var _0x452df0=typeof _0xf35f7[_0xd9e8('0x1d')]===_0xd9e8('0x1e')&&typeof _0xf35f7['limit']===_0xd9e8('0x1e');var _0x30f90c=_0x5fc99a['count'];var _0x24b160=_0x452df0?0x0:_0xf35f7[_0xd9e8('0x1d')];var _0x25f8e2=_0x452df0?_0x5fc99a[_0xd9e8('0x1f')]:_0xf35f7[_0xd9e8('0x1d')]+_0xf35f7[_0xd9e8('0x20')];var _0x444ea3;if(_0x25f8e2>=_0x30f90c){_0x25f8e2=_0x30f90c;_0x444ea3=0xc8;}else{_0x444ea3=0xce;}_0x2daea7['status'](_0x444ea3);return _0x2daea7['set']('Content-Range',_0x24b160+'-'+_0x25f8e2+'/'+_0x30f90c)[_0xd9e8('0x21')](_0x5fc99a);}return null;};}function patchUpdates(_0x4a8f68){return function(_0x2bbe5e){try{jsonpatch[_0xd9e8('0x22')](_0x2bbe5e,_0x4a8f68,!![]);}catch(_0xae273b){return BPromise[_0xd9e8('0x23')](_0xae273b);}return _0x2bbe5e[_0xd9e8('0x24')]();};}function saveUpdates(_0x4bc41e,_0x56ca9a){return function(_0x404bab){if(_0x404bab){return _0x404bab['update'](_0x4bc41e)[_0xd9e8('0x25')](function(_0x778724){return _0x778724;});}return null;};}function removeEntity(_0x177644,_0x5c84c8){return function(_0x1953c8){if(_0x1953c8){return _0x1953c8['destroy']()[_0xd9e8('0x25')](function(){var _0x41c3e7=_0x1953c8[_0xd9e8('0x26')]({'plain':!![]});var _0x4272bd=_0xd9e8('0x27');return db[_0xd9e8('0x28')][_0xd9e8('0x29')]({'where':{'type':_0x4272bd,'resourceId':_0x41c3e7['id']}})[_0xd9e8('0x25')](function(){return _0x1953c8;});})['then'](function(){_0x177644[_0xd9e8('0x1b')](0xcc)[_0xd9e8('0x1c')]();});}};}function handleEntityNotFound(_0x29dec4,_0x2cd68e){return function(_0x2bfbeb){if(!_0x2bfbeb){_0x29dec4[_0xd9e8('0x1a')](0x194);}return _0x2bfbeb;};}function handleError(_0x10b980,_0x48c939){_0x48c939=_0x48c939||0x1f4;return function(_0x21965e){logger['error'](_0x21965e['stack']);if(_0x21965e[_0xd9e8('0x2a')]){delete _0x21965e['name'];}_0x10b980[_0xd9e8('0x1b')](_0x48c939)[_0xd9e8('0x2b')](_0x21965e);};}exports[_0xd9e8('0x2c')]=function(_0x4fb3fb,_0x421ac3){var _0x3587bf={},_0x1825c4={},_0x3d712d={'count':0x0,'rows':[]};return db['CmCompany'][_0xd9e8('0x2d')]()[_0xd9e8('0x25')](function(_0x983d9d){_0x1825c4[_0xd9e8('0x2e')]=_['keys'](_0x983d9d);_0x1825c4['query']=_[_0xd9e8('0x2f')](_0x4fb3fb[_0xd9e8('0x30')]);_0x1825c4['filters']=_[_0xd9e8('0x31')](_0x1825c4[_0xd9e8('0x2e')],_0x1825c4[_0xd9e8('0x30')]);_0x3587bf[_0xd9e8('0x32')]=_['intersection'](_0x1825c4['model'],qs['fields'](_0x4fb3fb['query'][_0xd9e8('0x33')]));_0x3587bf['attributes']=_0x3587bf[_0xd9e8('0x32')][_0xd9e8('0x34')]?_0x3587bf[_0xd9e8('0x32')]:_0x1825c4[_0xd9e8('0x2e')];if(!_0x4fb3fb[_0xd9e8('0x30')][_0xd9e8('0x35')](_0xd9e8('0x36'))){_0x3587bf[_0xd9e8('0x20')]=qs['limit'](_0x4fb3fb['query'][_0xd9e8('0x20')]);_0x3587bf['offset']=qs[_0xd9e8('0x1d')](_0x4fb3fb[_0xd9e8('0x30')][_0xd9e8('0x1d')]);}_0x3587bf[_0xd9e8('0x37')]=qs[_0xd9e8('0x38')](_0x4fb3fb[_0xd9e8('0x30')][_0xd9e8('0x38')]);_0x3587bf[_0xd9e8('0x39')]=qs[_0xd9e8('0x3a')](_['pick'](_0x4fb3fb['query'],_0x1825c4[_0xd9e8('0x3a')]),_0x983d9d);if(_0x4fb3fb[_0xd9e8('0x30')]['filter']){_0x3587bf['where']=_[_0xd9e8('0x3b')](_0x3587bf[_0xd9e8('0x39')],{'$or':_[_0xd9e8('0x3c')](_0x3587bf[_0xd9e8('0x32')],function(_0x58f3f0){var _0x5e1070={};_0x5e1070[_0x58f3f0]={'$like':'%'+_0x4fb3fb['query'][_0xd9e8('0x3d')]+'%'};return _0x5e1070;})});}_0x3587bf=_[_0xd9e8('0x3b')]({},_0x3587bf,_0x4fb3fb[_0xd9e8('0x3e')]);var _0x54b8be={'where':_0x3587bf['where']};return db['CmCompany'][_0xd9e8('0x1f')](_0x54b8be)[_0xd9e8('0x25')](function(_0x4acf14){_0x3d712d[_0xd9e8('0x1f')]=_0x4acf14;if(_0x4fb3fb[_0xd9e8('0x30')]['includeAll']){_0x3587bf[_0xd9e8('0x3f')]=[{'all':!![]}];}return db[_0xd9e8('0x40')][_0xd9e8('0x41')](_0x3587bf);})['then'](function(_0x5be945){_0x3d712d[_0xd9e8('0x42')]=_0x5be945;return _0x3d712d;})[_0xd9e8('0x25')](respondWithFilteredResult(_0x421ac3,_0x3587bf))[_0xd9e8('0x43')](handleError(_0x421ac3,null));})[_0xd9e8('0x43')](handleError(_0x421ac3,null));};exports[_0xd9e8('0x44')]=function(_0x4c835b,_0x274a06){var _0x5b1e96={'raw':![],'where':{'id':_0x4c835b[_0xd9e8('0x45')]['id']}},_0x26b769={};_0x26b769['model']=_[_0xd9e8('0x2f')](db[_0xd9e8('0x40')][_0xd9e8('0x46')]);_0x26b769[_0xd9e8('0x30')]=_['keys'](_0x4c835b[_0xd9e8('0x30')]);_0x26b769[_0xd9e8('0x3a')]=_['intersection'](_0x26b769[_0xd9e8('0x2e')],_0x26b769[_0xd9e8('0x30')]);_0x5b1e96['attributes']=_['intersection'](_0x26b769[_0xd9e8('0x2e')],qs[_0xd9e8('0x33')](_0x4c835b['query'][_0xd9e8('0x33')]));_0x5b1e96[_0xd9e8('0x32')]=_0x5b1e96[_0xd9e8('0x32')][_0xd9e8('0x34')]?_0x5b1e96[_0xd9e8('0x32')]:_0x26b769[_0xd9e8('0x2e')];if(_0x4c835b['query']['includeAll']){_0x5b1e96[_0xd9e8('0x3f')]=[{'all':!![]}];}_0x5b1e96=_[_0xd9e8('0x3b')]({},_0x5b1e96,_0x4c835b['options']);return db[_0xd9e8('0x40')][_0xd9e8('0x47')](_0x5b1e96)['then'](handleEntityNotFound(_0x274a06,null))[_0xd9e8('0x25')](respondWithResult(_0x274a06,null))['catch'](handleError(_0x274a06,null));};exports['create']=function(_0x5a3fd0,_0x5a4ec5){return db[_0xd9e8('0x40')][_0xd9e8('0x48')](_0x5a3fd0[_0xd9e8('0x49')],{})[_0xd9e8('0x25')](function(_0xeb1bd7){var _0x4c7dd0=_0x5a3fd0[_0xd9e8('0x4a')][_0xd9e8('0x26')]({'plain':!![]});if(!_0x4c7dd0)throw new Error(_0xd9e8('0x4b'));if(_0x4c7dd0['role']===_0xd9e8('0x4a')){var _0x5733ad=_0xeb1bd7[_0xd9e8('0x26')]({'plain':!![]});var _0x5d6a30='Companies';return db[_0xd9e8('0x4c')][_0xd9e8('0x47')]({'where':{'name':_0x5d6a30,'userProfileId':_0x4c7dd0['userProfileId']},'raw':!![]})[_0xd9e8('0x25')](function(_0x38c550){if(_0x38c550&&_0x38c550[_0xd9e8('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5733ad[_0xd9e8('0x2a')],'resourceId':_0x5733ad['id'],'type':_0x38c550[_0xd9e8('0x2a')],'sectionId':_0x38c550['id']},{})[_0xd9e8('0x25')](function(){return _0xeb1bd7;});}else{return _0xeb1bd7;}})['catch'](function(_0x333ce4){logger[_0xd9e8('0x4e')](_0xd9e8('0x4f'),_0x333ce4);throw _0x333ce4;});}return _0xeb1bd7;})['then'](respondWithResult(_0x5a4ec5,0xc9))[_0xd9e8('0x43')](handleError(_0x5a4ec5,null));};exports[_0xd9e8('0x50')]=function(_0x5d95be,_0x28dc02){if(_0x5d95be[_0xd9e8('0x49')]['id']){delete _0x5d95be[_0xd9e8('0x49')]['id'];}return db[_0xd9e8('0x40')][_0xd9e8('0x47')]({'where':{'id':_0x5d95be[_0xd9e8('0x45')]['id']}})[_0xd9e8('0x25')](handleEntityNotFound(_0x28dc02,null))[_0xd9e8('0x25')](saveUpdates(_0x5d95be[_0xd9e8('0x49')],null))[_0xd9e8('0x25')](respondWithResult(_0x28dc02,null))['catch'](handleError(_0x28dc02,null));};exports['destroy']=function(_0x8abb1c,_0x440d2e){return db[_0xd9e8('0x40')]['find']({'where':{'id':_0x8abb1c[_0xd9e8('0x45')]['id']}})[_0xd9e8('0x25')](handleEntityNotFound(_0x440d2e,null))[_0xd9e8('0x25')](removeEntity(_0x440d2e,null))[_0xd9e8('0x43')](handleError(_0x440d2e,null));};exports[_0xd9e8('0x2d')]=function(_0x5ca157,_0x45ad6d){return db[_0xd9e8('0x40')][_0xd9e8('0x2d')]()[_0xd9e8('0x25')](respondWithResult(_0x45ad6d,null))[_0xd9e8('0x43')](handleError(_0x45ad6d,null));};exports['addContacts']=function(_0x50bd1b,_0x5a5ac3,_0xd08bde){return db[_0xd9e8('0x51')][_0xd9e8('0x47')]({'where':{'id':_0x50bd1b[_0xd9e8('0x45')]['id']}})[_0xd9e8('0x25')](handleEntityNotFound(_0x5a5ac3,null))[_0xd9e8('0x25')](function(_0x5e80c7){if(_0x5e80c7){return _0x5e80c7[_0xd9e8('0x52')](_0x50bd1b['body'][_0xd9e8('0x53')],_['omit'](_0x50bd1b[_0xd9e8('0x49')],[_0xd9e8('0x53'),'id'])||{});}})['then'](respondWithResult(_0x5a5ac3,null))['catch'](handleError(_0x5a5ac3,null));};exports[_0xd9e8('0x54')]=function(_0x2317d2,_0x8a65a6,_0xc87c4b){var _0x3f2291={};var _0x5f3afb={};var _0x2973ce;var _0x44250f;return db[_0xd9e8('0x40')]['findOne']({'where':{'id':_0x2317d2[_0xd9e8('0x45')]['id']}})[_0xd9e8('0x25')](handleEntityNotFound(_0x8a65a6,null))['then'](function(_0x39c03e){if(_0x39c03e){_0x2973ce=_0x39c03e;_0x5f3afb[_0xd9e8('0x2e')]=_[_0xd9e8('0x2f')](db['CmContact'][_0xd9e8('0x46')]);_0x5f3afb['query']=_[_0xd9e8('0x2f')](_0x2317d2[_0xd9e8('0x30')]);_0x5f3afb[_0xd9e8('0x3a')]=_[_0xd9e8('0x31')](_0x5f3afb[_0xd9e8('0x2e')],_0x5f3afb[_0xd9e8('0x30')]);_0x3f2291[_0xd9e8('0x32')]=_[_0xd9e8('0x31')](_0x5f3afb[_0xd9e8('0x2e')],qs['fields'](_0x2317d2[_0xd9e8('0x30')][_0xd9e8('0x33')]));_0x3f2291['attributes']=_0x3f2291[_0xd9e8('0x32')]['length']?_0x3f2291[_0xd9e8('0x32')]:_0x5f3afb[_0xd9e8('0x2e')];_0x3f2291[_0xd9e8('0x37')]=qs[_0xd9e8('0x38')](_0x2317d2['query']['sort']);_0x3f2291[_0xd9e8('0x39')]=qs[_0xd9e8('0x3a')](_[_0xd9e8('0x55')](_0x2317d2[_0xd9e8('0x30')],_0x5f3afb[_0xd9e8('0x3a')]));if(_0x2317d2['query'][_0xd9e8('0x3d')]){_0x3f2291[_0xd9e8('0x39')]=_['merge'](_0x3f2291[_0xd9e8('0x39')],{'$or':_[_0xd9e8('0x3c')](_0x3f2291[_0xd9e8('0x32')],function(_0x4f2877){var _0xf1569a={};_0xf1569a[_0x4f2877]={'$like':'%'+_0x2317d2[_0xd9e8('0x30')][_0xd9e8('0x3d')]+'%'};return _0xf1569a;})});}_0x3f2291=_['merge']({},_0x3f2291,_0x2317d2[_0xd9e8('0x3e')]);return _0x2973ce[_0xd9e8('0x54')](_0x3f2291);}})[_0xd9e8('0x25')](function(_0x81e34c){if(_0x81e34c){_0x44250f=_0x81e34c[_0xd9e8('0x34')];if(!_0x2317d2[_0xd9e8('0x30')]['hasOwnProperty'](_0xd9e8('0x36'))){_0x3f2291['limit']=qs[_0xd9e8('0x20')](_0x2317d2[_0xd9e8('0x30')]['limit']);_0x3f2291[_0xd9e8('0x1d')]=qs[_0xd9e8('0x1d')](_0x2317d2[_0xd9e8('0x30')]['offset']);}return _0x2973ce[_0xd9e8('0x54')](_0x3f2291);}})[_0xd9e8('0x25')](function(_0x210c41){if(_0x210c41){return _0x210c41?{'count':_0x44250f,'rows':_0x210c41}:null;}})[_0xd9e8('0x25')](respondWithResult(_0x8a65a6,null))[_0xd9e8('0x43')](handleError(_0x8a65a6,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 8334f65..629fa40 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 _0xd699=['CmCompany','cm_companies','lodash','util','api','bluebird','path','rimraf','exports','define'];(function(_0x3e3f78,_0x1327e6){var _0x114b74=function(_0x1d0477){while(--_0x1d0477){_0x3e3f78['push'](_0x3e3f78['shift']());}};_0x114b74(++_0x1327e6);}(_0xd699,0xac));var _0x9d69=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xd699[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x9d69('0x0'));var util=require(_0x9d69('0x1'));var logger=require('../../config/logger')(_0x9d69('0x2'));var moment=require('moment');var BPromise=require(_0x9d69('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d69('0x4'));var rimraf=require(_0x9d69('0x5'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x9d69('0x6')]=function(_0x47019c,_0x4e7613){return _0x47019c[_0x9d69('0x7')](_0x9d69('0x8'),attributes,{'tableName':_0x9d69('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfe49=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','CmCompany','lodash','util'];(function(_0x1719e2,_0x31d2ab){var _0xe57b79=function(_0x3d6a4e){while(--_0x3d6a4e){_0x1719e2['push'](_0x1719e2['shift']());}};_0xe57b79(++_0x31d2ab);}(_0xfe49,0x1b6));var _0x9fe4=function(_0x332606,_0xb754ed){_0x332606=_0x332606-0x0;var _0x19736e=_0xfe49[_0x332606];return _0x19736e;};'use strict';var _=require(_0x9fe4('0x0'));var util=require(_0x9fe4('0x1'));var logger=require(_0x9fe4('0x2'))(_0x9fe4('0x3'));var moment=require('moment');var BPromise=require(_0x9fe4('0x4'));var rp=require(_0x9fe4('0x5'));var fs=require('fs');var path=require(_0x9fe4('0x6'));var rimraf=require('rimraf');var config=require(_0x9fe4('0x7'));var attributes=require('./cmCompany.attributes');module[_0x9fe4('0x8')]=function(_0x33aa39,_0x33f5c9){return _0x33aa39[_0x9fe4('0x9')](_0x9fe4('0xa'),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 ff42c88..759168b 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 _0xeec4=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x56fb02,_0x179d7a){var _0x177f5b=function(_0x47e149){while(--_0x47e149){_0x56fb02['push'](_0x56fb02['shift']());}};_0x177f5b(++_0x179d7a);}(_0xeec4,0x76));var _0x4eec=function(_0x2a18b7,_0x5041c8){_0x2a18b7=_0x2a18b7-0x0;var _0x45e74e=_0xeec4[_0x2a18b7];return _0x45e74e;};'use strict';var _=require(_0x4eec('0x0'));var util=require(_0x4eec('0x1'));var moment=require(_0x4eec('0x2'));var BPromise=require(_0x4eec('0x3'));var rs=require(_0x4eec('0x4'));var fs=require('fs');var Redis=require(_0x4eec('0x5'));var db=require(_0x4eec('0x6'))['db'];var utils=require(_0x4eec('0x7'));var logger=require('../../config/logger')(_0x4eec('0x8'));var config=require(_0x4eec('0x9'));var jayson=require(_0x4eec('0xa'));var client=jayson[_0x4eec('0xb')][_0x4eec('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x547bf6,_0x4d9ab5,_0x5cbdc0){return new BPromise(function(_0x1662e5,_0x3eb6e2){return client[_0x4eec('0xd')](_0x547bf6,_0x5cbdc0)[_0x4eec('0xe')](function(_0x16fc86){logger[_0x4eec('0xf')](_0x4eec('0x10'),_0x4d9ab5,_0x4eec('0x11'));logger['debug'](_0x4eec('0x12'),_0x4d9ab5,'request\x20sent',JSON[_0x4eec('0x13')](_0x16fc86));if(_0x16fc86[_0x4eec('0x14')]){if(_0x16fc86[_0x4eec('0x14')][_0x4eec('0x15')]===0x1f4){logger[_0x4eec('0x14')](_0x4eec('0x10'),_0x4d9ab5,_0x16fc86[_0x4eec('0x14')][_0x4eec('0x16')]);return _0x3eb6e2(_0x16fc86[_0x4eec('0x14')][_0x4eec('0x16')]);}logger[_0x4eec('0x14')]('CmCompany,\x20%s,\x20%s',_0x4d9ab5,_0x16fc86[_0x4eec('0x14')][_0x4eec('0x16')]);return _0x1662e5(_0x16fc86['error']['message']);}else{logger[_0x4eec('0xf')]('CmCompany,\x20%s,\x20%s',_0x4d9ab5,_0x4eec('0x11'));_0x1662e5(_0x16fc86[_0x4eec('0x17')]['message']);}})[_0x4eec('0x18')](function(_0x53fa85){logger['error'](_0x4eec('0x10'),_0x4d9ab5,_0x53fa85);_0x3eb6e2(_0x53fa85);});});}
\ No newline at end of file
+var _0x71d5=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x71d5,0x18d));var _0x571d=function(_0xe86606,_0x2804a3){_0xe86606=_0xe86606-0x0;var _0x7cbd97=_0x71d5[_0xe86606];return _0x7cbd97;};'use strict';var _=require(_0x571d('0x0'));var util=require(_0x571d('0x1'));var moment=require(_0x571d('0x2'));var BPromise=require('bluebird');var rs=require(_0x571d('0x3'));var fs=require('fs');var Redis=require(_0x571d('0x4'));var db=require(_0x571d('0x5'))['db'];var utils=require(_0x571d('0x6'));var logger=require('../../config/logger')(_0x571d('0x7'));var config=require(_0x571d('0x8'));var jayson=require(_0x571d('0x9'));var client=jayson[_0x571d('0xa')][_0x571d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x117a1d,_0x57a47a,_0x474589){return new BPromise(function(_0x401d25,_0x42cf4f){return client[_0x571d('0xc')](_0x117a1d,_0x474589)[_0x571d('0xd')](function(_0x23ded4){logger[_0x571d('0xe')]('CmCompany,\x20%s,\x20%s',_0x57a47a,_0x571d('0xf'));logger[_0x571d('0x10')](_0x571d('0x11'),_0x57a47a,_0x571d('0xf'),JSON[_0x571d('0x12')](_0x23ded4));if(_0x23ded4['error']){if(_0x23ded4[_0x571d('0x13')][_0x571d('0x14')]===0x1f4){logger['error'](_0x571d('0x15'),_0x57a47a,_0x23ded4[_0x571d('0x13')][_0x571d('0x16')]);return _0x42cf4f(_0x23ded4['error'][_0x571d('0x16')]);}logger[_0x571d('0x13')](_0x571d('0x15'),_0x57a47a,_0x23ded4['error']['message']);return _0x401d25(_0x23ded4[_0x571d('0x13')][_0x571d('0x16')]);}else{logger[_0x571d('0xe')]('CmCompany,\x20%s,\x20%s',_0x57a47a,'request\x20sent');_0x401d25(_0x23ded4[_0x571d('0x17')][_0x571d('0x16')]);}})[_0x571d('0x18')](function(_0x12a94a){logger['error']('CmCompany,\x20%s,\x20%s',_0x57a47a,_0x12a94a);_0x42cf4f(_0x12a94a);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index ec3f0f2..aa6a907 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 _0x7896=['fs-extra','../../config/environment','get','isAuthenticated','index','describe','/:id','post','create','/:id/contacts','addContacts','put','update','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x313945,_0x375b2d){var _0x3cb194=function(_0x4dbf23){while(--_0x4dbf23){_0x313945['push'](_0x313945['shift']());}};_0x3cb194(++_0x375b2d);}(_0x7896,0x127));var _0x6789=function(_0x1f6553,_0x278aa0){_0x1f6553=_0x1f6553-0x0;var _0x5206da=_0x7896[_0x1f6553];return _0x5206da;};'use strict';var multer=require(_0x6789('0x0'));var util=require('util');var path=require(_0x6789('0x1'));var timeout=require(_0x6789('0x2'));var express=require(_0x6789('0x3'));var router=express[_0x6789('0x4')]();var fs_extra=require(_0x6789('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6789('0x6'));var controller=require('./cmCompany.controller');router[_0x6789('0x7')]('/',auth[_0x6789('0x8')](),controller[_0x6789('0x9')]);router[_0x6789('0x7')]('/describe',auth[_0x6789('0x8')](),controller[_0x6789('0xa')]);router['get'](_0x6789('0xb'),auth[_0x6789('0x8')](),controller['show']);router[_0x6789('0x7')]('/:id/contacts',auth[_0x6789('0x8')](),controller['getContacts']);router[_0x6789('0xc')]('/',auth['isAuthenticated'](),controller[_0x6789('0xd')]);router[_0x6789('0xc')](_0x6789('0xe'),auth[_0x6789('0x8')](),controller[_0x6789('0xf')]);router[_0x6789('0x10')](_0x6789('0xb'),auth[_0x6789('0x8')](),controller[_0x6789('0x11')]);router[_0x6789('0x12')](_0x6789('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x6789('0x13')]=router;
\ No newline at end of file
+var _0x0913=['addContacts','put','update','delete','/:id','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts','post','create'];(function(_0x503817,_0x3e41e6){var _0x3cdb5b=function(_0x18d283){while(--_0x18d283){_0x503817['push'](_0x503817['shift']());}};_0x3cdb5b(++_0x3e41e6);}(_0x0913,0x1a5));var _0x3091=function(_0x3efd26,_0xcdb922){_0x3efd26=_0x3efd26-0x0;var _0x490209=_0x0913[_0x3efd26];return _0x490209;};'use strict';var multer=require(_0x3091('0x0'));var util=require(_0x3091('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3091('0x2'));var auth=require(_0x3091('0x3'));var interaction=require(_0x3091('0x4'));var config=require(_0x3091('0x5'));var controller=require('./cmCompany.controller');router[_0x3091('0x6')]('/',auth[_0x3091('0x7')](),controller[_0x3091('0x8')]);router[_0x3091('0x6')](_0x3091('0x9'),auth['isAuthenticated'](),controller[_0x3091('0xa')]);router[_0x3091('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x3091('0xb')]);router['get'](_0x3091('0xc'),auth[_0x3091('0x7')](),controller[_0x3091('0xd')]);router[_0x3091('0xe')]('/',auth[_0x3091('0x7')](),controller[_0x3091('0xf')]);router[_0x3091('0xe')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x3091('0x10')]);router[_0x3091('0x11')]('/:id',auth[_0x3091('0x7')](),controller[_0x3091('0x12')]);router[_0x3091('0x13')](_0x3091('0x14'),auth[_0x3091('0x7')](),controller[_0x3091('0x15')]);module[_0x3091('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 3ac74b5..dcd2b4a 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 _0x09ca=['STRING','INTEGER','UNSIGNED','NOW','lodash'];(function(_0x2d1438,_0x192bf1){var _0x4f5233=function(_0x10bb0f){while(--_0x10bb0f){_0x2d1438['push'](_0x2d1438['shift']());}};_0x4f5233(++_0x192bf1);}(_0x09ca,0x8b));var _0xa09c=function(_0x5a024a,_0x5e682f){_0x5a024a=_0x5a024a-0x0;var _0x5b2b06=_0x09ca[_0x5a024a];return _0x5b2b06;};'use strict';var _=require(_0xa09c('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0xa09c('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0xa09c('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa09c('0x1')]},'country':{'type':Sequelize[_0xa09c('0x1')]},'dateOfBirth':{'type':Sequelize[_0xa09c('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xa09c('0x1')]},'mobile':{'type':Sequelize[_0xa09c('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa09c('0x1')]},'url':{'type':Sequelize[_0xa09c('0x1')]},'facebook':{'type':Sequelize[_0xa09c('0x1')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xa09c('0x1')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xa09c('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xa09c('0x1')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xa09c('0x1')]},'UserId':{'type':Sequelize[_0xa09c('0x2')]},'AdditionalPhones':{'type':Sequelize[_0xa09c('0x1')]},'priority':{'type':Sequelize[_0xa09c('0x2')](0x2)[_0xa09c('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xa09c('0x4')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xc509=['lodash','sequelize','exports','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x5871a3,_0x5e9b24){var _0x52b7a9=function(_0x1fe38c){while(--_0x1fe38c){_0x5871a3['push'](_0x5871a3['shift']());}};_0x52b7a9(++_0x5e9b24);}(_0xc509,0x188));var _0x9c50=function(_0x788728,_0xeb5e4e){_0x788728=_0x788728-0x0;var _0x46bd2b=_0xc509[_0x788728];return _0x46bd2b;};'use strict';var _=require(_0x9c50('0x0'));var Sequelize=require(_0x9c50('0x1'));module[_0x9c50('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x9c50('0x3')]},'street':{'type':Sequelize[_0x9c50('0x3')]},'postalCode':{'type':Sequelize[_0x9c50('0x3')]},'city':{'type':Sequelize[_0x9c50('0x3')]},'country':{'type':Sequelize[_0x9c50('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x9c50('0x3')]},'mobile':{'type':Sequelize[_0x9c50('0x3')]},'fax':{'type':Sequelize[_0x9c50('0x3')]},'email':{'type':Sequelize[_0x9c50('0x3')]},'url':{'type':Sequelize[_0x9c50('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x9c50('0x3')]},'skype':{'type':Sequelize[_0x9c50('0x3')]},'teams':{'type':Sequelize[_0x9c50('0x3')]},'viber':{'type':Sequelize[_0x9c50('0x3')]},'line':{'type':Sequelize[_0x9c50('0x3')]},'wechat':{'type':Sequelize[_0x9c50('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x9c50('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x9c50('0x3')]},'priority':{'type':Sequelize[_0x9c50('0x4')](0x2)[_0x9c50('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9c50('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x9c50('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 3a6c922..5257ab5 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 _0xd331=['each','duplicates','$or','push','where','ListId','spread','contact','all','show','Tag','Tags','tag','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','isNil','$and','omit','map','format','cf_%d','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','text','values','phone','getTags','findOne','model','rawAttributes','intersection','attributes','fields','order','sort','filters','pick','filter','options','nolimit','limit','setTags','ids','setAdditionalPhones','CmContactHasItem','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','bulkCreate','getAdditionalPhones','PHONE','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','getHoppers','ContactId','includeAll','include','rows','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','send','createReadStream','parse','meta','import','No\x20ListId\x20specified','binding','stringify','message','start\x20child\x20process\x20correctly!','importUpdates','User','agent','../../components/import/cm/csvUpdates','error\x20child\x20process','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','type','source','destination','starttime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','VoiceCallReport','findAndCountAll','chat','Account','closed','closedAt','note','secondDisposition','thirdDisposition','key','Owner','customerPort','ratingType','ratingValue','referer','substatus','threadId','Interaction','sortBy','reverse','slice','bluebird','path','lodash','papaparse','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','register','status','undefined','count','offset','set','Content-Range','json','update','then','destroy','end','stack','name','index','describe','findAll','user','find','params','catch','CmContact','tags','keys','startsWith','cf_','columnName','displayName','query','analytics','CmCustomField','length','alias','custom','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ChatQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','create','dialTimezone','timezones','utcOffset','additionalPhones'];(function(_0x30fffc,_0x23cca9){var _0x3ae152=function(_0x1c6b2a){while(--_0x1c6b2a){_0x30fffc['push'](_0x30fffc['shift']());}};_0x3ae152(++_0x23cca9);}(_0xd331,0x19a));var _0x1d33=function(_0x48c787,_0x5cb427){_0x48c787=_0x48c787-0x0;var _0x5b44ad=_0xd331[_0x48c787];return _0x5b44ad;};'use strict';var moment=require('moment');var BPromise=require(_0x1d33('0x0'));var util=require('util');var path=require(_0x1d33('0x1'));var fs=require('fs');var _=require(_0x1d33('0x2'));var squel=require('squel');var Papa=require(_0x1d33('0x3'));var Redis=require('ioredis');var contacts=require(_0x1d33('0x4'));var qs=require(_0x1d33('0x5'));var logger=require(_0x1d33('0x6'))(_0x1d33('0x7'));var config=require(_0x1d33('0x8'));var shared=require(_0x1d33('0x9'));var db=require('../../mysqldb')['db'];config[_0x1d33('0xa')]=_[_0x1d33('0xb')](config[_0x1d33('0xa')],{'host':_0x1d33('0xc'),'port':0x18eb});var socket=require(_0x1d33('0xd'))(new Redis(config['redis']));require('./cmContact.socket')[_0x1d33('0xe')](socket);function respondWithResult(_0x3f236b,_0x4c079d){_0x4c079d=_0x4c079d||0xc8;return function(_0x411d35){if(_0x411d35){return _0x3f236b[_0x1d33('0xf')](_0x4c079d)['json'](_0x411d35);}};}function respondWithFilteredResult(_0x3a3248,_0x34def1){return function(_0x5e18a8){if(_0x5e18a8){var _0x24c8aa=typeof _0x34def1['offset']===_0x1d33('0x10')&&typeof _0x34def1['limit']===_0x1d33('0x10');var _0x378894=_0x5e18a8[_0x1d33('0x11')];var _0x50378b=_0x24c8aa?0x0:_0x34def1[_0x1d33('0x12')];var _0x17025b=_0x24c8aa?_0x5e18a8['count']:_0x34def1['offset']+_0x34def1['limit'];var _0x1b1b37;if(_0x17025b>=_0x378894){_0x17025b=_0x378894;_0x1b1b37=0xc8;}else{_0x1b1b37=0xce;}_0x3a3248[_0x1d33('0xf')](_0x1b1b37);return _0x3a3248[_0x1d33('0x13')](_0x1d33('0x14'),_0x50378b+'-'+_0x17025b+'/'+_0x378894)[_0x1d33('0x15')](_0x5e18a8);}return null;};}function saveUpdates(_0x26a220){return function(_0x51716d){if(_0x51716d){return _0x51716d[_0x1d33('0x16')](_0x26a220)[_0x1d33('0x17')](function(_0x43655e){return _0x43655e;});}return null;};}function removeEntity(_0x4b70bc){return function(_0x1bb91a){if(_0x1bb91a){return _0x1bb91a[_0x1d33('0x18')]()[_0x1d33('0x17')](function(){_0x4b70bc[_0x1d33('0xf')](0xcc)[_0x1d33('0x19')]();});}};}function handleEntityNotFound(_0x2f2db2){return function(_0x2e8dca){if(!_0x2e8dca){_0x2f2db2['sendStatus'](0x194);}return _0x2e8dca;};}function handleError(_0x50e58b,_0x3cc14e){_0x3cc14e=_0x3cc14e||0x1f4;return function(_0x3cdceb){logger['error'](_0x3cdceb[_0x1d33('0x1a')]);if(_0x3cdceb[_0x1d33('0x1b')]){delete _0x3cdceb[_0x1d33('0x1b')];}_0x50e58b[_0x1d33('0xf')](_0x3cc14e)['send'](_0x3cdceb);};}exports[_0x1d33('0x1c')]=function(_0x15d7f1,_0x1423f9){var _0x1634de={};return contacts[_0x1d33('0x1d')]()['then'](function(_0x3b8440){_0x1634de=qs['getOptions'](_0x3b8440,_0x15d7f1);return contacts[_0x1d33('0x1e')](_0x15d7f1['query'],_0x15d7f1[_0x1d33('0x1f')],_0x1634de,_0x3b8440);})[_0x1d33('0x17')](respondWithFilteredResult(_0x1423f9,_0x1634de))['catch'](handleError(_0x1423f9,null));};exports[_0x1d33('0x18')]=function(_0x236da2,_0x17f21e){return db['CmContact'][_0x1d33('0x20')]({'where':{'id':_0x236da2[_0x1d33('0x21')]['id']}})[_0x1d33('0x17')](handleEntityNotFound(_0x17f21e,null))['then'](removeEntity(_0x17f21e,null))[_0x1d33('0x22')](handleError(_0x17f21e,null));};exports[_0x1d33('0x1d')]=function(_0x132278,_0x14aa20){return db[_0x1d33('0x23')][_0x1d33('0x1d')]()[_0x1d33('0x17')](function(_0x22f985){delete _0x22f985[_0x1d33('0x24')];for(var _0x101b6d=0x0;_0x101b6d
','auth=Bearer\x20'];(function(_0x83a9c5,_0x5c73e2){var _0x5b758c=function(_0x458e5c){while(--_0x458e5c){_0x83a9c5['push'](_0x83a9c5['shift']());}};_0x5b758c(++_0x5c73e2);}(_0x1bb5,0xcb));var _0x51bb=function(_0x5bacf1,_0x5bae9a){_0x5bacf1=_0x5bacf1-0x0;var _0x4b65d3=_0x1bb5[_0x5bacf1];return _0x4b65d3;};'use strict';var _=require(_0x51bb('0x0'));var moment=require(_0x51bb('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x51bb('0x2'));var util=require(_0x51bb('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x51bb('0x4'));var config=require('../../../config/environment');function getAddress(_0x48c49d){var _0x2bf695=_[_0x51bb('0x5')](_0x48c49d[_0x51bb('0x6')]);return _0x2bf695&&_0x2bf695[_0x51bb('0x7')]?_0x2bf695[_0x51bb('0x7')]:'anonymous'+random[_0x51bb('0x8')](0x6)+_0x51bb('0x9');}function getFirstName(_0x4ea2ac){var _0xbeea9c=_[_0x51bb('0x5')](_0x4ea2ac['value']);if(_0xbeea9c&&_0xbeea9c[_0x51bb('0xa')]){if(_0xbeea9c[_0x51bb('0xa')]==_0xbeea9c['address']){return _0xbeea9c[_0x51bb('0xa')][_0x51bb('0xb')](0x0,_0xbeea9c[_0x51bb('0xa')]['indexOf']('@'));}var _0x59e102=_0xbeea9c[_0x51bb('0xa')][_0x51bb('0xc')](/\s+/);return _0x59e102['length']>0x1?_0x59e102[_0x51bb('0xd')](0x0,-0x1)[_0x51bb('0xe')]('\x20'):_0xbeea9c['name'];}return'Anonymous';}function getLastName(_0x10601f){var _0x58f370=_['head'](_0x10601f[_0x51bb('0x6')]);if(_0x58f370&&_0x58f370[_0x51bb('0xa')]){var _0x4cd99d=_0x58f370[_0x51bb('0xa')][_0x51bb('0xc')](/\s+/);return _0x4cd99d[_0x51bb('0xf')]>0x1?_0x4cd99d[_0x51bb('0x10')]():'';}return'';}function getMails(_0x4737b6,_0x7f79f8){var _0x2aed54='';for(var _0x5093f5=0x0;_0x5093f5<_0x7f79f8[_0x51bb('0x6')]['length'];_0x5093f5+=0x1){if(_0x7f79f8[_0x51bb('0x6')][_0x5093f5][_0x51bb('0x7')]!==_0x4737b6){if(!_[_0x51bb('0x11')](_0x2aed54)){_0x2aed54+=',';}_0x2aed54+=_0x7f79f8[_0x51bb('0x6')][_0x5093f5]['name']||_0x7f79f8[_0x51bb('0x6')][_0x5093f5][_0x51bb('0x7')]||'';_0x2aed54+='\x20<';_0x2aed54+=_0x7f79f8[_0x51bb('0x6')][_0x5093f5][_0x51bb('0x7')]?_0x7f79f8[_0x51bb('0x6')][_0x5093f5][_0x51bb('0x7')]:'anonymous'+random[_0x51bb('0x8')](0x6)+'@xcally.com';_0x2aed54+='>';}}return _0x2aed54;}function parseEmail(_0x3c0458,_0x23b93d,_0x24c6b8){if(_0x23b93d['html']){var _0x5ea79d=/