From: support
Date: Thu, 24 Nov 2022 06:43:45 +0000 (+0000)
Subject: Built motion from commit f091f0c6.|2.6.24
X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=d262c9644f0cd8bff58004fec9cf541402083cf3;p=motion2.git
Built motion from commit f091f0c6.|2.6.24
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 10f7d00..1cb1251 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -1,6 +1,6 @@
define({
"name": "xCALLY Motion API",
- "version": "2.6.23",
+ "version": "2.6.24",
"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-23T13:59:53.734Z",
+ "time": "2022-11-24T06:35:15.232Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 4bcccb2..0687233 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -1,6 +1,6 @@
{
"name": "xCALLY Motion API",
- "version": "2.6.23",
+ "version": "2.6.24",
"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-23T13:59:53.734Z",
+ "time": "2022-11-24T06:35:15.232Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index b9ad350..7ce8e58 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.23",
+ "version": "2.6.24",
"dependencies": {
"@babel/code-frame": {
"version": "7.18.6",
diff --git a/package.json b/package.json
index da326f9..5d06901 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.23",
+ "version": "2.6.24",
"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 0100867..8be8e35 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 _0xe44f=['integration','motionbar','jscripty','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','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]','getDataValue','action','STRING','contactManager'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xe44f,0x95));var _0xfe44=function(_0x5b0c93,_0x4ca03a){_0x5b0c93=_0x5b0c93-0x0;var _0x22acb5=_0xe44f[_0x5b0c93];return _0x22acb5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x7799d9){return this[_0xfe44('0x0')](_0xfe44('0x1'));}},'action':{'type':Sequelize[_0xfe44('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0xfe44('0x3'),_0xfe44('0x4'),_0xfe44('0x5'),_0xfe44('0x6'),_0xfe44('0x7'),'browser',_0xfe44('0x8'),'script']],'msg':_0xfe44('0x9')}},'comment':_0xfe44('0x9')},'data1':{'type':Sequelize[_0xfe44('0x2')](0x1000),'comment':_0xfe44('0xa')},'data2':{'type':Sequelize[_0xfe44('0x2')](0x1000),'comment':_0xfe44('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xfe44('0xc')},'data4':{'type':Sequelize[_0xfe44('0x2')](0x1000),'comments':_0xfe44('0xd')},'data5':{'type':Sequelize[_0xfe44('0x2')](0x1000),'comments':_0xfe44('0xe')},'data6':{'type':Sequelize[_0xfe44('0x2')],'comments':_0xfe44('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':_0xfe44('0x10')}};
\ No newline at end of file
+var _0x1856=['browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward'];(function(_0x1f39b8,_0x38e661){var _0x774782=function(_0x41bef4){while(--_0x41bef4){_0x1f39b8['push'](_0x1f39b8['shift']());}};_0x774782(++_0x38e661);}(_0x1856,0x121));var _0x6185=function(_0x60179,_0x30cb78){_0x60179=_0x60179-0x0;var _0x1ef0f1=_0x1856[_0x60179];return _0x1ef0f1;};'use strict';var Sequelize=require(_0x6185('0x0'));module[_0x6185('0x1')]={'name':{'type':Sequelize[_0x6185('0x2')],'get':function(_0x5aadcc){return this[_0x6185('0x3')](_0x6185('0x4'));}},'action':{'type':Sequelize[_0x6185('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6185('0x6'),_0x6185('0x7'),_0x6185('0x8'),_0x6185('0x9'),_0x6185('0xa'),_0x6185('0xb'),'bot',_0x6185('0xc')]],'msg':_0x6185('0xd')}},'comment':_0x6185('0xd')},'data1':{'type':Sequelize[_0x6185('0x5')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x6185('0x5')](0x1000),'comment':_0x6185('0xe')},'data3':{'type':Sequelize[_0x6185('0x5')](0x1000),'comment':_0x6185('0xf')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x6185('0x5')](0x1000),'comments':_0x6185('0x10')},'data6':{'type':Sequelize[_0x6185('0x5')],'comments':_0x6185('0x11')},'data7':{'type':Sequelize[_0x6185('0x12')],'comments':_0x6185('0x13')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 3384338..dfd1a43 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 _0xfe91=['moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x4812e0,_0x2ccf3c){var _0x252e0f=function(_0x14cdb8){while(--_0x14cdb8){_0x4812e0['push'](_0x4812e0['shift']());}};_0x252e0f(++_0x2ccf3c);}(_0xfe91,0xdc));var _0x1fe9=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0xfe91[_0x19ac6e];return _0x1cdcf3;};'use strict';var emlformat=require(_0x1fe9('0x0'));var rimraf=require(_0x1fe9('0x1'));var zipdir=require(_0x1fe9('0x2'));var jsonpatch=require(_0x1fe9('0x3'));var rp=require(_0x1fe9('0x4'));var moment=require(_0x1fe9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1fe9('0x6'));var path=require('path');var sox=require(_0x1fe9('0x7'));var csv=require(_0x1fe9('0x8'));var ejs=require(_0x1fe9('0x9'));var fs=require('fs');var fs_extra=require(_0x1fe9('0xa'));var _=require(_0x1fe9('0xb'));var squel=require(_0x1fe9('0xc'));var crypto=require(_0x1fe9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1fe9('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1fe9('0xf'));var Papa=require('papaparse');var Redis=require(_0x1fe9('0x10'));var authService=require(_0x1fe9('0x11'));var qs=require(_0x1fe9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1fe9('0x13'));var utils=require('../../config/utils');var config=require(_0x1fe9('0x14'));var licenseUtil=require(_0x1fe9('0x15'));var db=require(_0x1fe9('0x16'))['db'];function respondWithStatusCode(_0x7960cf,_0x5f39ff){_0x5f39ff=_0x5f39ff||0xcc;return function(_0xde69b8){if(_0xde69b8){return _0x7960cf[_0x1fe9('0x17')](_0x5f39ff);}return _0x7960cf[_0x1fe9('0x18')](_0x5f39ff)[_0x1fe9('0x19')]();};}function respondWithResult(_0x3c3764,_0x3f2340){_0x3f2340=_0x3f2340||0xc8;return function(_0x192031){if(_0x192031){return _0x3c3764[_0x1fe9('0x18')](_0x3f2340)[_0x1fe9('0x1a')](_0x192031);}};}function respondWithFilteredResult(_0x3dd7aa,_0x322280){return function(_0x5cf274){if(_0x5cf274){var _0x44a086=typeof _0x322280[_0x1fe9('0x1b')]===_0x1fe9('0x1c')&&typeof _0x322280[_0x1fe9('0x1d')]===_0x1fe9('0x1c');var _0x5f0b8d=_0x5cf274[_0x1fe9('0x1e')];var _0x2262a1=_0x44a086?0x0:_0x322280[_0x1fe9('0x1b')];var _0x22188f=_0x44a086?_0x5cf274['count']:_0x322280[_0x1fe9('0x1b')]+_0x322280[_0x1fe9('0x1d')];var _0x195f0b;if(_0x22188f>=_0x5f0b8d){_0x22188f=_0x5f0b8d;_0x195f0b=0xc8;}else{_0x195f0b=0xce;}_0x3dd7aa[_0x1fe9('0x18')](_0x195f0b);return _0x3dd7aa[_0x1fe9('0x1f')]('Content-Range',_0x2262a1+'-'+_0x22188f+'/'+_0x5f0b8d)[_0x1fe9('0x1a')](_0x5cf274);}return null;};}function patchUpdates(_0x238410){return function(_0x3430ff){try{jsonpatch['apply'](_0x3430ff,_0x238410,!![]);}catch(_0x544567){return BPromise[_0x1fe9('0x20')](_0x544567);}return _0x3430ff[_0x1fe9('0x21')]();};}function saveUpdates(_0x166ef5,_0x4ce214){return function(_0x24d6fb){if(_0x24d6fb){return _0x24d6fb[_0x1fe9('0x22')](_0x166ef5)[_0x1fe9('0x23')](function(_0x192d5e){return _0x192d5e;});}return null;};}function removeEntity(_0x3f9a52,_0x58aead){return function(_0xa3e335){if(_0xa3e335){return _0xa3e335[_0x1fe9('0x24')]()[_0x1fe9('0x23')](function(){_0x3f9a52[_0x1fe9('0x18')](0xcc)[_0x1fe9('0x19')]();});}};}function handleEntityNotFound(_0x4a9bbe,_0x371873){return function(_0x15768f){if(!_0x15768f){_0x4a9bbe[_0x1fe9('0x17')](0x194);}return _0x15768f;};}function handleError(_0x1b69e5,_0x25fc87){_0x25fc87=_0x25fc87||0x1f4;return function(_0x438ca4){logger['error'](_0x438ca4[_0x1fe9('0x25')]);if(_0x438ca4[_0x1fe9('0x26')]){delete _0x438ca4[_0x1fe9('0x26')];}_0x1b69e5[_0x1fe9('0x18')](_0x25fc87)[_0x1fe9('0x27')](_0x438ca4);};}exports[_0x1fe9('0x22')]=function(_0x1a00a4,_0x1a9b4d){if(_0x1a00a4['body']['id']){delete _0x1a00a4[_0x1fe9('0x28')]['id'];}return db[_0x1fe9('0x29')][_0x1fe9('0x2a')]({'where':{'id':_0x1a00a4['params']['id']}})[_0x1fe9('0x23')](handleEntityNotFound(_0x1a9b4d,null))['then'](saveUpdates(_0x1a00a4[_0x1fe9('0x28')],null))['then'](respondWithResult(_0x1a9b4d,null))['catch'](handleError(_0x1a9b4d,null));};exports[_0x1fe9('0x24')]=function(_0x3f1188,_0x3e4bcd){return db['Action']['find']({'where':{'id':_0x3f1188[_0x1fe9('0x2b')]['id']}})[_0x1fe9('0x23')](handleEntityNotFound(_0x3e4bcd,null))['then'](removeEntity(_0x3e4bcd,null))[_0x1fe9('0x2c')](handleError(_0x3e4bcd,null));};
\ No newline at end of file
+var _0x299c=['offset','undefined','count','set','Content-Range','reject','save','then','destroy','error','stack','send','update','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x299c,0x120));var _0xc299=function(_0x24502d,_0x3a7c6f){_0x24502d=_0x24502d-0x0;var _0xd3f48c=_0x299c[_0x24502d];return _0xd3f48c;};'use strict';var emlformat=require(_0xc299('0x0'));var rimraf=require(_0xc299('0x1'));var zipdir=require(_0xc299('0x2'));var jsonpatch=require(_0xc299('0x3'));var rp=require(_0xc299('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc299('0x5'));var csv=require('to-csv');var ejs=require(_0xc299('0x6'));var fs=require('fs');var fs_extra=require(_0xc299('0x7'));var _=require(_0xc299('0x8'));var squel=require('squel');var crypto=require(_0xc299('0x9'));var jsforce=require(_0xc299('0xa'));var deskjs=require(_0xc299('0xb'));var toCsv=require(_0xc299('0xc'));var querystring=require(_0xc299('0xd'));var Papa=require(_0xc299('0xe'));var Redis=require('ioredis');var authService=require(_0xc299('0xf'));var qs=require(_0xc299('0x10'));var as=require(_0xc299('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc299('0x12'));var utils=require(_0xc299('0x13'));var config=require(_0xc299('0x14'));var licenseUtil=require(_0xc299('0x15'));var db=require(_0xc299('0x16'))['db'];function respondWithStatusCode(_0x4096e4,_0x150eaf){_0x150eaf=_0x150eaf||0xcc;return function(_0x3b0209){if(_0x3b0209){return _0x4096e4[_0xc299('0x17')](_0x150eaf);}return _0x4096e4['status'](_0x150eaf)[_0xc299('0x18')]();};}function respondWithResult(_0x3cf260,_0x5135cc){_0x5135cc=_0x5135cc||0xc8;return function(_0x5ec60b){if(_0x5ec60b){return _0x3cf260[_0xc299('0x19')](_0x5135cc)[_0xc299('0x1a')](_0x5ec60b);}};}function respondWithFilteredResult(_0x20ac81,_0x48320e){return function(_0x10d2b6){if(_0x10d2b6){var _0x56b164=typeof _0x48320e[_0xc299('0x1b')]===_0xc299('0x1c')&&typeof _0x48320e['limit']==='undefined';var _0x128700=_0x10d2b6[_0xc299('0x1d')];var _0x374b59=_0x56b164?0x0:_0x48320e['offset'];var _0x5791b3=_0x56b164?_0x10d2b6[_0xc299('0x1d')]:_0x48320e[_0xc299('0x1b')]+_0x48320e['limit'];var _0x17a39f;if(_0x5791b3>=_0x128700){_0x5791b3=_0x128700;_0x17a39f=0xc8;}else{_0x17a39f=0xce;}_0x20ac81[_0xc299('0x19')](_0x17a39f);return _0x20ac81[_0xc299('0x1e')](_0xc299('0x1f'),_0x374b59+'-'+_0x5791b3+'/'+_0x128700)[_0xc299('0x1a')](_0x10d2b6);}return null;};}function patchUpdates(_0x183a34){return function(_0x3a0ba1){try{jsonpatch['apply'](_0x3a0ba1,_0x183a34,!![]);}catch(_0x887826){return BPromise[_0xc299('0x20')](_0x887826);}return _0x3a0ba1[_0xc299('0x21')]();};}function saveUpdates(_0x48a5f5,_0x478f20){return function(_0x3483a8){if(_0x3483a8){return _0x3483a8['update'](_0x48a5f5)[_0xc299('0x22')](function(_0x18ce39){return _0x18ce39;});}return null;};}function removeEntity(_0x4ac818,_0x3b1a7b){return function(_0x38e533){if(_0x38e533){return _0x38e533[_0xc299('0x23')]()[_0xc299('0x22')](function(){_0x4ac818[_0xc299('0x19')](0xcc)[_0xc299('0x18')]();});}};}function handleEntityNotFound(_0x265b30,_0x28617a){return function(_0x21a22e){if(!_0x21a22e){_0x265b30['sendStatus'](0x194);}return _0x21a22e;};}function handleError(_0x3662e8,_0x3b0ac1){_0x3b0ac1=_0x3b0ac1||0x1f4;return function(_0x3a63ca){logger[_0xc299('0x24')](_0x3a63ca[_0xc299('0x25')]);if(_0x3a63ca['name']){delete _0x3a63ca['name'];}_0x3662e8['status'](_0x3b0ac1)[_0xc299('0x26')](_0x3a63ca);};}exports[_0xc299('0x27')]=function(_0x6b89b5,_0x5352dc){if(_0x6b89b5[_0xc299('0x28')]['id']){delete _0x6b89b5['body']['id'];}return db[_0xc299('0x29')][_0xc299('0x2a')]({'where':{'id':_0x6b89b5[_0xc299('0x2b')]['id']}})[_0xc299('0x22')](handleEntityNotFound(_0x5352dc,null))[_0xc299('0x22')](saveUpdates(_0x6b89b5[_0xc299('0x28')],null))['then'](respondWithResult(_0x5352dc,null))[_0xc299('0x2c')](handleError(_0x5352dc,null));};exports[_0xc299('0x23')]=function(_0x30877a,_0x44392f){return db[_0xc299('0x29')][_0xc299('0x2a')]({'where':{'id':_0x30877a[_0xc299('0x2b')]['id']}})[_0xc299('0x22')](handleEntityNotFound(_0x44392f,null))[_0xc299('0x22')](removeEntity(_0x44392f,null))[_0xc299('0x2c')](handleError(_0x44392f,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index b2bc4ef..375ee62 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 _0xa5bf=['moment','bluebird','path','../../config/environment','./action.attributes','exports','tools_actions','lodash','../../config/logger','api'];(function(_0x34d277,_0x16ef66){var _0x5210e=function(_0x314cc4){while(--_0x314cc4){_0x34d277['push'](_0x34d277['shift']());}};_0x5210e(++_0x16ef66);}(_0xa5bf,0x101));var _0xfa5b=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xa5bf[_0x58dc25];return _0x21b0a7;};'use strict';var _=require(_0xfa5b('0x0'));var util=require('util');var logger=require(_0xfa5b('0x1'))(_0xfa5b('0x2'));var moment=require(_0xfa5b('0x3'));var BPromise=require(_0xfa5b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa5b('0x5'));var rimraf=require('rimraf');var config=require(_0xfa5b('0x6'));var attributes=require(_0xfa5b('0x7'));module[_0xfa5b('0x8')]=function(_0x3d46c8,_0x38d68e){return _0x3d46c8['define']('Action',attributes,{'tableName':_0xfa5b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0c68=['rimraf','../../config/environment','exports','define','Action','tools_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3b629c,_0x52a4b7){var _0x9dc71b=function(_0x549101){while(--_0x549101){_0x3b629c['push'](_0x3b629c['shift']());}};_0x9dc71b(++_0x52a4b7);}(_0x0c68,0x165));var _0x80c6=function(_0x45a09a,_0x50c7cd){_0x45a09a=_0x45a09a-0x0;var _0x506ede=_0x0c68[_0x45a09a];return _0x506ede;};'use strict';var _=require(_0x80c6('0x0'));var util=require('util');var logger=require(_0x80c6('0x1'))(_0x80c6('0x2'));var moment=require(_0x80c6('0x3'));var BPromise=require(_0x80c6('0x4'));var rp=require(_0x80c6('0x5'));var fs=require('fs');var path=require(_0x80c6('0x6'));var rimraf=require(_0x80c6('0x7'));var config=require(_0x80c6('0x8'));var attributes=require('./action.attributes');module[_0x80c6('0x9')]=function(_0x2e2914,_0x2156ee){return _0x2e2914[_0x80c6('0xa')](_0x80c6('0xb'),attributes,{'tableName':_0x80c6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 79edcb7..e898e8c 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x7217,0x19e));var _0x7721=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x7217[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x11f2b5,_0x161b25){var _0x2a0d41=function(_0x126ddc){while(--_0x126ddc){_0x11f2b5['push'](_0x11f2b5['shift']());}};_0x2a0d41(++_0x161b25);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 334586c..f216825 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 _0x764a=['../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id','destroy','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x41be4a,_0x16fb7f){var _0xfd0ae1=function(_0x3e94b6){while(--_0x3e94b6){_0x41be4a['push'](_0x41be4a['shift']());}};_0xfd0ae1(++_0x16fb7f);}(_0x764a,0x19f));var _0xa764=function(_0x3ba5fd,_0xbe4159){_0x3ba5fd=_0x3ba5fd-0x0;var _0x3574d3=_0x764a[_0x3ba5fd];return _0x3574d3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa764('0x0'));var router=express[_0xa764('0x1')]();var fs_extra=require(_0xa764('0x2'));var auth=require(_0xa764('0x3'));var interaction=require(_0xa764('0x4'));var config=require(_0xa764('0x5'));var controller=require(_0xa764('0x6'));router[_0xa764('0x7')]('/:id',auth[_0xa764('0x8')](),controller[_0xa764('0x9')]);router[_0xa764('0xa')](_0xa764('0xb'),auth[_0xa764('0x8')](),controller[_0xa764('0xc')]);module[_0xa764('0xd')]=router;
\ No newline at end of file
+var _0x4999=['put','/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0x14f009,_0x4bec47){var _0x3a812f=function(_0x827fa5){while(--_0x827fa5){_0x14f009['push'](_0x14f009['shift']());}};_0x3a812f(++_0x4bec47);}(_0x4999,0x1e6));var _0x9499=function(_0x4d5d28,_0x26bd9b){_0x4d5d28=_0x4d5d28-0x0;var _0x2026b1=_0x4999[_0x4d5d28];return _0x2026b1;};'use strict';var multer=require(_0x9499('0x0'));var util=require(_0x9499('0x1'));var path=require(_0x9499('0x2'));var timeout=require(_0x9499('0x3'));var express=require(_0x9499('0x4'));var router=express[_0x9499('0x5')]();var fs_extra=require(_0x9499('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9499('0x7'));var config=require(_0x9499('0x8'));var controller=require(_0x9499('0x9'));router[_0x9499('0xa')](_0x9499('0xb'),auth[_0x9499('0xc')](),controller[_0x9499('0xd')]);router['delete'](_0x9499('0xb'),auth[_0x9499('0xc')](),controller[_0x9499('0xe')]);module[_0x9499('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 5129e1d..342cfd8 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 _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x297259,_0x17e45d){var _0x2f137c=function(_0x5cb8bf){while(--_0x5cb8bf){_0x297259['push'](_0x297259['shift']());}};_0x2f137c(++_0x17e45d);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
+var _0xf494=['STRING','TEXT','sequelize','exports'];(function(_0x5a4fe4,_0x13daca){var _0x42aa6e=function(_0x42703c){while(--_0x42703c){_0x5a4fe4['push'](_0x5a4fe4['shift']());}};_0x42aa6e(++_0x13daca);}(_0xf494,0x1c6));var _0x4f49=function(_0x40ff4d,_0x72c2dd){_0x40ff4d=_0x40ff4d-0x0;var _0xc6b831=_0xf494[_0x40ff4d];return _0xc6b831;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f49('0x2')]},'table':{'type':Sequelize[_0x4f49('0x2')]},'conditions':{'type':Sequelize[_0x4f49('0x3')]},'joins':{'type':Sequelize[_0x4f49('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 3fa351c..06506e7 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 _0xceff=['foreignTable','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','cross_join','SUM(%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','MetricId','web','fullPath','%s-%s.%s','generate','output','csv','custom','cdr','startDate','endDate','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','DATE(%s)','%s.%s\x20=\x20%s.%s','debug','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','json','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','stack','name','index','AnalyticCustomReport','fieldName','type','key','model','map','keys','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','find','create','body','userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','metric','replace','function','format','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey'];(function(_0x12e451,_0xd5bbdf){var _0x1cbcb7=function(_0x30c11b){while(--_0x30c11b){_0x12e451['push'](_0x12e451['shift']());}};_0x1cbcb7(++_0xd5bbdf);}(_0xceff,0xc5));var _0xfcef=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xceff[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require(_0xfcef('0x0'));var rimraf=require(_0xfcef('0x1'));var zipdir=require(_0xfcef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfcef('0x3'));var moment=require(_0xfcef('0x4'));var BPromise=require(_0xfcef('0x5'));var Mustache=require(_0xfcef('0x6'));var util=require(_0xfcef('0x7'));var path=require(_0xfcef('0x8'));var sox=require(_0xfcef('0x9'));var csv=require(_0xfcef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcef('0xb'));var _=require(_0xfcef('0xc'));var squel=require(_0xfcef('0xd'));var crypto=require(_0xfcef('0xe'));var jsforce=require(_0xfcef('0xf'));var deskjs=require(_0xfcef('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfcef('0x11'));var Papa=require('papaparse');var Redis=require(_0xfcef('0x12'));var authService=require(_0xfcef('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfcef('0x14'));var hardwareService=require(_0xfcef('0x15'));var logger=require('../../config/logger')(_0xfcef('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfcef('0x17'));var db=require(_0xfcef('0x18'))['db'];var dbH=require(_0xfcef('0x18'))['dbH'];function respondWithStatusCode(_0x306bd9,_0x122b03){_0x122b03=_0x122b03||0xcc;return function(_0x157c18){if(_0x157c18){return _0x306bd9[_0xfcef('0x19')](_0x122b03);}return _0x306bd9[_0xfcef('0x1a')](_0x122b03)[_0xfcef('0x1b')]();};}function respondWithResult(_0x557260,_0x106480){_0x106480=_0x106480||0xc8;return function(_0x5958d3){if(_0x5958d3){return _0x557260[_0xfcef('0x1a')](_0x106480)['json'](_0x5958d3);}};}function respondWithFilteredResult(_0x2a9585,_0x27c284){return function(_0x2370c4){if(_0x2370c4){var _0x5c213d=typeof _0x27c284[_0xfcef('0x1c')]==='undefined'&&typeof _0x27c284['limit']===_0xfcef('0x1d');var _0x4adace=_0x2370c4['count'];var _0x217a17=_0x5c213d?0x0:_0x27c284[_0xfcef('0x1c')];var _0x20dae4=_0x5c213d?_0x2370c4[_0xfcef('0x1e')]:_0x27c284[_0xfcef('0x1c')]+_0x27c284[_0xfcef('0x1f')];var _0x5c7d67;if(_0x20dae4>=_0x4adace){_0x20dae4=_0x4adace;_0x5c7d67=0xc8;}else{_0x5c7d67=0xce;}_0x2a9585[_0xfcef('0x1a')](_0x5c7d67);return _0x2a9585['set']('Content-Range',_0x217a17+'-'+_0x20dae4+'/'+_0x4adace)[_0xfcef('0x20')](_0x2370c4);}return null;};}function patchUpdates(_0x5d987b){return function(_0x47a10e){try{jsonpatch[_0xfcef('0x21')](_0x47a10e,_0x5d987b,!![]);}catch(_0x11f194){return BPromise[_0xfcef('0x22')](_0x11f194);}return _0x47a10e[_0xfcef('0x23')]();};}function saveUpdates(_0x59ed14,_0x122197){return function(_0x22bbd3){if(_0x22bbd3){return _0x22bbd3[_0xfcef('0x24')](_0x59ed14)[_0xfcef('0x25')](function(_0x190835){return _0x190835;});}return null;};}function removeEntity(_0xa8e476,_0x33d798){return function(_0x19179f){if(_0x19179f){return _0x19179f[_0xfcef('0x26')]()[_0xfcef('0x25')](function(){var _0x2ddcd8=_0x19179f[_0xfcef('0x27')]({'plain':!![]});var _0x2eca98=_0xfcef('0x28');return db[_0xfcef('0x29')]['destroy']({'where':{'type':_0x2eca98,'resourceId':_0x2ddcd8['id']}})[_0xfcef('0x25')](function(){return _0x19179f;});})[_0xfcef('0x25')](function(){_0xa8e476[_0xfcef('0x1a')](0xcc)[_0xfcef('0x1b')]();});}};}function handleEntityNotFound(_0x323e53,_0x3fb0f2){return function(_0x53f2ea){if(!_0x53f2ea){_0x323e53[_0xfcef('0x19')](0x194);}return _0x53f2ea;};}function handleError(_0x4d6946,_0x5beb6d){_0x5beb6d=_0x5beb6d||0x1f4;return function(_0xd0332b){logger['error'](_0xd0332b[_0xfcef('0x2a')]);if(_0xd0332b[_0xfcef('0x2b')]){delete _0xd0332b[_0xfcef('0x2b')];}_0x4d6946[_0xfcef('0x1a')](_0x5beb6d)['send'](_0xd0332b);};}exports[_0xfcef('0x2c')]=function(_0x1dada5,_0xc677a2){var _0x1a2e29={},_0x10d121={},_0x31cf07={'count':0x0,'rows':[]};var _0x2840da=_['map'](db[_0xfcef('0x2d')]['rawAttributes'],function(_0x682b8c){return{'name':_0x682b8c[_0xfcef('0x2e')],'type':_0x682b8c[_0xfcef('0x2f')][_0xfcef('0x30')]};});_0x10d121[_0xfcef('0x31')]=_[_0xfcef('0x32')](_0x2840da,_0xfcef('0x2b'));_0x10d121['query']=_[_0xfcef('0x33')](_0x1dada5[_0xfcef('0x34')]);_0x10d121['filters']=_['intersection'](_0x10d121[_0xfcef('0x31')],_0x10d121[_0xfcef('0x34')]);_0x1a2e29[_0xfcef('0x35')]=_['intersection'](_0x10d121['model'],qs[_0xfcef('0x36')](_0x1dada5[_0xfcef('0x34')]['fields']));_0x1a2e29['attributes']=_0x1a2e29['attributes'][_0xfcef('0x37')]?_0x1a2e29[_0xfcef('0x35')]:_0x10d121[_0xfcef('0x31')];if(!_0x1dada5[_0xfcef('0x34')][_0xfcef('0x38')](_0xfcef('0x39'))){_0x1a2e29[_0xfcef('0x1f')]=qs[_0xfcef('0x1f')](_0x1dada5['query'][_0xfcef('0x1f')]);_0x1a2e29['offset']=qs['offset'](_0x1dada5[_0xfcef('0x34')][_0xfcef('0x1c')]);}_0x1a2e29['order']=qs[_0xfcef('0x3a')](_0x1dada5[_0xfcef('0x34')][_0xfcef('0x3a')]);_0x1a2e29[_0xfcef('0x3b')]=qs[_0xfcef('0x3c')](_[_0xfcef('0x3d')](_0x1dada5[_0xfcef('0x34')],_0x10d121['filters']),_0x2840da);if(_0x1dada5['query']['filter']){_0x1a2e29[_0xfcef('0x3b')]=_['merge'](_0x1a2e29['where'],{'$or':_[_0xfcef('0x32')](_0x2840da,function(_0x1496d1){if(_0x1496d1['type']!==_0xfcef('0x3e')){var _0x1e8ab1={};_0x1e8ab1[_0x1496d1[_0xfcef('0x2b')]]={'$like':'%'+_0x1dada5[_0xfcef('0x34')][_0xfcef('0x3f')]+'%'};return _0x1e8ab1;}})});}_0x1a2e29=_[_0xfcef('0x40')]({},_0x1a2e29,_0x1dada5[_0xfcef('0x41')]);var _0x4ef584={'where':_0x1a2e29['where']};return db[_0xfcef('0x2d')][_0xfcef('0x1e')](_0x4ef584)[_0xfcef('0x25')](function(_0x23c44c){_0x31cf07[_0xfcef('0x1e')]=_0x23c44c;if(_0x1dada5['query'][_0xfcef('0x42')]){_0x1a2e29[_0xfcef('0x43')]=[{'all':!![]}];}return db[_0xfcef('0x2d')][_0xfcef('0x44')](_0x1a2e29);})[_0xfcef('0x25')](function(_0x240008){_0x31cf07[_0xfcef('0x45')]=_0x240008;return _0x31cf07;})[_0xfcef('0x25')](respondWithFilteredResult(_0xc677a2,_0x1a2e29))['catch'](handleError(_0xc677a2,null));};exports[_0xfcef('0x46')]=function(_0x303129,_0x128a81){var _0x559be7={'raw':![],'where':{'id':_0x303129[_0xfcef('0x47')]['id']}},_0x515ae4={};_0x515ae4[_0xfcef('0x31')]=_[_0xfcef('0x33')](db[_0xfcef('0x2d')][_0xfcef('0x48')]);_0x515ae4[_0xfcef('0x34')]=_[_0xfcef('0x33')](_0x303129[_0xfcef('0x34')]);_0x515ae4[_0xfcef('0x3c')]=_[_0xfcef('0x49')](_0x515ae4['model'],_0x515ae4[_0xfcef('0x34')]);_0x559be7['attributes']=_[_0xfcef('0x49')](_0x515ae4[_0xfcef('0x31')],qs[_0xfcef('0x36')](_0x303129[_0xfcef('0x34')]['fields']));_0x559be7[_0xfcef('0x35')]=_0x559be7['attributes']['length']?_0x559be7[_0xfcef('0x35')]:_0x515ae4[_0xfcef('0x31')];if(_0x303129[_0xfcef('0x34')]['includeAll']){_0x559be7['include']=[{'all':!![]}];}_0x559be7=_[_0xfcef('0x40')]({},_0x559be7,_0x303129[_0xfcef('0x41')]);return db['AnalyticCustomReport'][_0xfcef('0x4a')](_0x559be7)['then'](handleEntityNotFound(_0x128a81,null))[_0xfcef('0x25')](respondWithResult(_0x128a81,null))['catch'](handleError(_0x128a81,null));};exports['create']=function(_0x59c0ea,_0x5014ed){return db[_0xfcef('0x2d')][_0xfcef('0x4b')](_0x59c0ea[_0xfcef('0x4c')],{})[_0xfcef('0x25')](function(_0x2f3dc6){var _0x52440d=_0x59c0ea['user'][_0xfcef('0x27')]({'plain':!![]});if(!_0x52440d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52440d['role']==='user'){var _0x2c429d=_0x2f3dc6[_0xfcef('0x27')]({'plain':!![]});var _0x12186e='Reports';return db['UserProfileSection'][_0xfcef('0x4a')]({'where':{'name':_0x12186e,'userProfileId':_0x52440d[_0xfcef('0x4d')]},'raw':!![]})[_0xfcef('0x25')](function(_0x5e5108){if(_0x5e5108&&_0x5e5108['autoAssociation']===0x0){return db[_0xfcef('0x29')]['create']({'name':_0x2c429d[_0xfcef('0x2b')],'resourceId':_0x2c429d['id'],'type':'CustomReports','sectionId':_0x5e5108['id']},{})[_0xfcef('0x25')](function(){return _0x2f3dc6;});}else{return _0x2f3dc6;}})[_0xfcef('0x4e')](function(_0x331d3b){logger[_0xfcef('0x4f')](_0xfcef('0x50'),_0x331d3b);throw _0x331d3b;});}return _0x2f3dc6;})[_0xfcef('0x25')](respondWithResult(_0x5014ed,0xc9))[_0xfcef('0x4e')](handleError(_0x5014ed,null));};exports[_0xfcef('0x24')]=function(_0x20cc47,_0x3a2f1d){if(_0x20cc47['body']['id']){delete _0x20cc47[_0xfcef('0x4c')]['id'];}return db[_0xfcef('0x2d')][_0xfcef('0x4a')]({'where':{'id':_0x20cc47[_0xfcef('0x47')]['id']}})[_0xfcef('0x25')](handleEntityNotFound(_0x3a2f1d,null))['then'](saveUpdates(_0x20cc47['body'],null))['then'](respondWithResult(_0x3a2f1d,null))['catch'](handleError(_0x3a2f1d,null));};exports[_0xfcef('0x26')]=function(_0x19d984,_0x392296){return db[_0xfcef('0x2d')][_0xfcef('0x4a')]({'where':{'id':_0x19d984[_0xfcef('0x47')]['id']}})[_0xfcef('0x25')](handleEntityNotFound(_0x392296,null))['then'](removeEntity(_0x392296,null))[_0xfcef('0x4e')](handleError(_0x392296,null));};exports[_0xfcef('0x51')]=function(_0x4873c5,_0x3dc98b){var _0x48d05a=0xa;var _0x39e7cd=[_0xfcef('0x52'),'left_join',_0xfcef('0x53'),'cross_join'];var _0x2e3258={'SUM':'SUM(%s)','COUNT':_0xfcef('0x54'),'COUNT DISTINCT':_0xfcef('0x55'),'MAX':'MAX(%s)','MIN':_0xfcef('0x56'),'AVG':_0xfcef('0x57'),'GROUP_CONCAT':_0xfcef('0x58'),'GROUP_CONCAT ASC':_0xfcef('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x583b85={'SEC_TO_TIME':_0xfcef('0x5a'),'DATE':'DATE(%s)','HOUR':_0xfcef('0x5b'),'ROUND':_0xfcef('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4040e2=function(_0x516d91){return!_[_0xfcef('0x5d')]([_0xfcef('0x5e'),_0xfcef('0x5f'),_0xfcef('0x60'),_0xfcef('0x61')],_0x516d91);};var _0x78eaf4=function(_0x19a2bc){if(!_0x19a2bc||!_0x19a2bc[_0xfcef('0x62')][_0xfcef('0x37')]){return'';}for(var _0x2d408d='(',_0xd9d927=0x0;_0xd9d927<_0x19a2bc[_0xfcef('0x62')][_0xfcef('0x37')];_0xd9d927+=0x1){_0xd9d927>0x0&&(_0x2d408d+='\x20'+_0x19a2bc[_0xfcef('0x63')]+'\x20');_0x2d408d+=_0x19a2bc[_0xfcef('0x62')][_0xd9d927][_0xfcef('0x64')]?_0x78eaf4(_0x19a2bc['rules'][_0xd9d927][_0xfcef('0x64')]):_0x19a2bc['rules'][_0xd9d927][_0xfcef('0x65')]+'\x20'+_0x19a2bc[_0xfcef('0x62')][_0xd9d927][_0xfcef('0x66')]+(_0x4040e2(_0x19a2bc[_0xfcef('0x62')][_0xd9d927][_0xfcef('0x66')])?'\x20'+_0x19a2bc[_0xfcef('0x62')][_0xd9d927][_0xfcef('0x67')]:'');}return _0x2d408d+')';};var _0x4818f3={'where':{'id':_0x4873c5[_0xfcef('0x47')]['id']}},_0x4a3e93,_0x400c50,_0x450b12,_0x1f13c8,_0x9bd881;_0x4818f3=_['merge']({},_0x4818f3,_0x4873c5['options']);return db[_0xfcef('0x2d')][_0xfcef('0x4a')](_0x4818f3)['then'](function(_0x2b727c){if(_0x2b727c){_0x4a3e93=_0x2b727c;return _0x2b727c[_0xfcef('0x68')]();}return null;})[_0xfcef('0x25')](function(_0x1a87c5){if(_0x1a87c5){if(!_0x1a87c5[_0xfcef('0x37')]){throw new db[(_0xfcef('0x69'))][(_0xfcef('0x6a'))](_0xfcef('0x6b'),0x193);}_0x400c50=_0x1a87c5;return db[_0xfcef('0x6c')]['findAll']({'raw':!![]});}return null;})[_0xfcef('0x25')](function(_0x1084a9){if(_0x1084a9){_0x450b12=_[_0xfcef('0x6d')](_0x1084a9,'id');var _0x2e2420;var _0x37fffa=squel[_0xfcef('0x6e')]();_0x37fffa[_0xfcef('0x6f')](_0x4a3e93[_0xfcef('0x70')]);for(var _0x3d7601=0x0;_0x3d7601<_0x400c50[_0xfcef('0x37')];_0x3d7601+=0x1){_0x2e2420=_0x400c50[_0x3d7601]['MetricId']?_0x450b12[_0x400c50[_0x3d7601]['MetricId']][_0xfcef('0x71')]:_0x400c50[_0x3d7601][_0xfcef('0x65')];_0x2e2420=_0x400c50[_0x3d7601]['function']?_[_0xfcef('0x72')](_0x2e3258[_0x400c50[_0x3d7601][_0xfcef('0x73')]],'%s',_0x2e2420):_0x2e2420;_0x2e2420=_0x400c50[_0x3d7601][_0xfcef('0x74')]?_[_0xfcef('0x72')](_0x583b85[_0x400c50[_0x3d7601][_0xfcef('0x74')]],'%s',_0x2e2420):_0x2e2420;if(_0x400c50[_0x3d7601][_0xfcef('0x75')]){_0x37fffa[_0xfcef('0x64')](_0x2e2420);}_0x400c50[_0x3d7601][_0xfcef('0x76')]&&_0x37fffa[_0xfcef('0x77')](_0x2e2420,_0x400c50[_0x3d7601][_0xfcef('0x76')]===_0xfcef('0x78')?![]:!![]);_0x37fffa[_0xfcef('0x65')](_0x2e2420,_0x400c50[_0x3d7601][_0xfcef('0x79')]||_0x2e2420);}if(_0x4a3e93[_0xfcef('0x7a')]){_0x4a3e93[_0xfcef('0x7a')]=JSON[_0xfcef('0x7b')](_0x4a3e93[_0xfcef('0x7a')]);for(var _0x11e5ac=0x0;_0x11e5ac<_0x4a3e93[_0xfcef('0x7a')][_0xfcef('0x37')];_0x11e5ac+=0x1){if(_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x2f')]&&_[_0xfcef('0x5d')](_0x39e7cd,_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x2f')])&&_0x4a3e93['joins'][_0x11e5ac][_0xfcef('0x7c')]&&_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x7d')]&&_0x4a3e93['joins'][_0x11e5ac]['foreignKey']){_0x37fffa[_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac]['type']](_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x7d')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4a3e93[_0xfcef('0x70')],_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac]['parentKey'],_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x7d')],_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x7e')]));}}}if(_0x4a3e93[_0xfcef('0x7f')]){_0x4a3e93[_0xfcef('0x7f')]=JSON[_0xfcef('0x7b')](_0x4a3e93[_0xfcef('0x7f')]);_0x37fffa[_0xfcef('0x3b')](_0x78eaf4(_0x4a3e93['conditions'][_0xfcef('0x64')]));}_0x9bd881=_0x37fffa[_0xfcef('0x80')]();_0x37fffa[_0xfcef('0x1f')](_0x48d05a);_0x37fffa['offset'](0x0);logger['debug'](_0xfcef('0x81'),_0x37fffa[_0xfcef('0x82')]());return dbH[_0xfcef('0x83')][_0xfcef('0x34')](_0x37fffa[_0xfcef('0x82')](),{'type':dbH['sequelize'][_0xfcef('0x84')]['SELECT']});}})['then'](respondWithResult(_0x3dc98b,null))[_0xfcef('0x4e')](handleError(_0x3dc98b,null));};function runReport(_0x51a700,_0x42b9b9,_0x2e232e){var _0x12af18=_0x42b9b9[_0xfcef('0x2b')];var _0x207e66=0xa;var _0x5c0030=[_0xfcef('0x52'),_0xfcef('0x85'),_0xfcef('0x53'),_0xfcef('0x86')];var _0x432719={'SUM':_0xfcef('0x87'),'COUNT':_0xfcef('0x54'),'COUNT DISTINCT':_0xfcef('0x55'),'MAX':_0xfcef('0x88'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xfcef('0x89')};var _0x5bb62c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xfcef('0x5b'),'ROUND':_0xfcef('0x5c'),'UNIX_TIMESTAMP':_0xfcef('0x8a')};var _0x19ab04=function(_0xcfba98){return!_[_0xfcef('0x5d')]([_0xfcef('0x5e'),_0xfcef('0x5f'),_0xfcef('0x60'),'IS\x20NOT\x20EMPTY'],_0xcfba98);};var _0x5480dc=function(_0x14d65e){if(!_0x14d65e||!_0x14d65e[_0xfcef('0x62')][_0xfcef('0x37')]){return'';}for(var _0x4ff2dc='(',_0x499471=0x0;_0x499471<_0x14d65e[_0xfcef('0x62')]['length'];_0x499471+=0x1){_0x499471>0x0&&(_0x4ff2dc+='\x20'+_0x14d65e['operator']+'\x20');_0x4ff2dc+=_0x14d65e['rules'][_0x499471][_0xfcef('0x64')]?_0x5480dc(_0x14d65e[_0xfcef('0x62')][_0x499471]['group']):_0x14d65e[_0xfcef('0x62')][_0x499471][_0xfcef('0x65')]+'\x20'+_0x14d65e[_0xfcef('0x62')][_0x499471][_0xfcef('0x66')]+(_0x19ab04(_0x14d65e[_0xfcef('0x62')][_0x499471][_0xfcef('0x66')])?'\x20'+_0x14d65e[_0xfcef('0x62')][_0x499471][_0xfcef('0x67')]:'');}return _0x4ff2dc+')';};var _0x403d45={'where':{'id':_0x51a700['id']}},_0x5548d5,_0x3d6b1b,_0x2c4a5f,_0x4e6aa4,_0x189836;_0x403d45=_['merge']({},_0x403d45,_0x2e232e);return db[_0xfcef('0x2d')][_0xfcef('0x4a')](_0x403d45)[_0xfcef('0x25')](function(_0x548d4f){if(_0x548d4f){_0x5548d5=_0x548d4f;return _0x548d4f[_0xfcef('0x68')]();}return null;})[_0xfcef('0x25')](function(_0x539bfa){if(_0x539bfa){if(!_0x539bfa[_0xfcef('0x37')]){throw new db[(_0xfcef('0x69'))][(_0xfcef('0x6a'))](_0xfcef('0x6b'),0x193);}_0x3d6b1b=_0x539bfa;return db[_0xfcef('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x434976){if(_0x434976){_0x2c4a5f=_['keyBy'](_0x434976,'id');var _0x200549;var _0x48b0d1=squel[_0xfcef('0x6e')]();_0x48b0d1[_0xfcef('0x6f')](_0x5548d5[_0xfcef('0x70')]);for(var _0x15b836=0x0;_0x15b836<_0x3d6b1b[_0xfcef('0x37')];_0x15b836+=0x1){_0x200549=_0x3d6b1b[_0x15b836]['MetricId']?_0x2c4a5f[_0x3d6b1b[_0x15b836][_0xfcef('0x8b')]]['metric']:_0x3d6b1b[_0x15b836][_0xfcef('0x65')];_0x200549=_0x3d6b1b[_0x15b836][_0xfcef('0x73')]?_[_0xfcef('0x72')](_0x432719[_0x3d6b1b[_0x15b836][_0xfcef('0x73')]],'%s',_0x200549):_0x200549;_0x200549=_0x3d6b1b[_0x15b836][_0xfcef('0x74')]?_[_0xfcef('0x72')](_0x5bb62c[_0x3d6b1b[_0x15b836][_0xfcef('0x74')]],'%s',_0x200549):_0x200549;if(_0x3d6b1b[_0x15b836]['groupBy']){_0x48b0d1['group'](_0x200549);}_0x3d6b1b[_0x15b836][_0xfcef('0x76')]&&_0x48b0d1[_0xfcef('0x77')](_0x200549,_0x3d6b1b[_0x15b836][_0xfcef('0x76')]===_0xfcef('0x78')?![]:!![]);_0x48b0d1[_0xfcef('0x65')](_0x200549,_0x3d6b1b[_0x15b836][_0xfcef('0x79')]||_0x200549);}if(_0x5548d5[_0xfcef('0x7a')]){_0x5548d5[_0xfcef('0x7a')]=JSON['parse'](_0x5548d5['joins']);for(var _0x4cb967=0x0;_0x4cb967<_0x5548d5[_0xfcef('0x7a')][_0xfcef('0x37')];_0x4cb967+=0x1){if(_0x5548d5['joins'][_0x4cb967][_0xfcef('0x2f')]&&_['includes'](_0x5c0030,_0x5548d5['joins'][_0x4cb967]['type'])&&_0x5548d5[_0xfcef('0x7a')][_0x4cb967][_0xfcef('0x7c')]&&_0x5548d5[_0xfcef('0x7a')][_0x4cb967][_0xfcef('0x7d')]&&_0x5548d5[_0xfcef('0x7a')][_0x4cb967]['foreignKey']){_0x48b0d1[_0x5548d5[_0xfcef('0x7a')][_0x4cb967][_0xfcef('0x2f')]](_0x5548d5[_0xfcef('0x7a')][_0x4cb967][_0xfcef('0x7d')],null,util[_0xfcef('0x74')]('%s.%s\x20=\x20%s.%s',_0x5548d5[_0xfcef('0x70')],_0x5548d5[_0xfcef('0x7a')][_0x4cb967][_0xfcef('0x7c')],_0x5548d5['joins'][_0x4cb967][_0xfcef('0x7d')],_0x5548d5[_0xfcef('0x7a')][_0x4cb967]['foreignKey']));}}}if(_0x5548d5[_0xfcef('0x7f')]){_0x5548d5[_0xfcef('0x7f')]=JSON[_0xfcef('0x7b')](_0x5548d5['conditions']);_0x48b0d1['where'](_0x5480dc(_0x5548d5[_0xfcef('0x7f')][_0xfcef('0x64')]));}_0x189836=_0x48b0d1[_0xfcef('0x80')]();_0x48b0d1['limit'](_0x207e66);_0x48b0d1['offset'](0x0);return;}})[_0xfcef('0x25')](function(){if(_0x42b9b9['output']===_0xfcef('0x8c')){return null;}var _0x24ef3b=_['merge'](_0x42b9b9,{'name':_0x42b9b9[_0xfcef('0x8d')]||_0x42b9b9[_0xfcef('0x2b')]||_0x5548d5[_0xfcef('0x2b')],'basename':_0x12af18,'savename':util['format'](_0xfcef('0x8e'),_0x42b9b9[_0xfcef('0x2b')]||_0x5548d5[_0xfcef('0x2b')],require('randomstring')[_0xfcef('0x8f')](0x4),_0x42b9b9[_0xfcef('0x90')]||_0xfcef('0x91')),'reportId':_0x5548d5['id'],'reportType':_0xfcef('0x92')});return db['AnalyticExtractedReport'][_0xfcef('0x4b')](_0x24ef3b,{'raw':!![]});})[_0xfcef('0x25')](function(_0x48aea3){if(_0x5548d5[_0xfcef('0x70')]===_0xfcef('0x93')){_0x189836[_0xfcef('0x3b')](_0x5548d5['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x42b9b9[_0xfcef('0x94')],_0x42b9b9[_0xfcef('0x95')]);}else{_0x189836[_0xfcef('0x3b')](_0x5548d5[_0xfcef('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x42b9b9[_0xfcef('0x94')],_0x42b9b9['endDate']);}if(_0x48aea3){logger['info'](_0xfcef('0x96'),_0x189836[_0xfcef('0x82')]());require(_0xfcef('0x97'))['fork'](path['join'](__dirname,_0xfcef('0x98'),_0x48aea3[_0xfcef('0x90')]),[_0x48aea3['id'],_0x189836[_0xfcef('0x82')](),path[_0xfcef('0x52')](__dirname,_0xfcef('0x99'),_0x48aea3[_0xfcef('0x9a')]),_0x12af18]);return _0x48aea3;}else{var _0x2ced8a=squel[_0xfcef('0x6e')]();_0x2ced8a[_0xfcef('0x6f')]('('+_0x189836[_0xfcef('0x82')]()+')',_0xfcef('0x9b'));_0x2ced8a[_0xfcef('0x65')](_0xfcef('0x9c'),_0xfcef('0x1e'));_0x189836[_0xfcef('0x1f')](_0x42b9b9[_0xfcef('0x1f')]||_0x207e66);_0x189836[_0xfcef('0x1c')](_0x42b9b9[_0xfcef('0x1c')]||0x0);return dbH[_0xfcef('0x83')][_0xfcef('0x34')](_0x2ced8a[_0xfcef('0x82')](),{'type':dbH[_0xfcef('0x83')][_0xfcef('0x84')][_0xfcef('0x9d')]})[_0xfcef('0x25')](function(_0x390d87){if(!_0x390d87['length']){_0x4e6aa4=0x0;}else{_0x4e6aa4=_0x390d87[0x0][_0xfcef('0x1e')]||0x0;}return dbH['sequelize'][_0xfcef('0x34')](_0x189836['toString'](),{'type':dbH[_0xfcef('0x83')][_0xfcef('0x84')][_0xfcef('0x9d')]});})[_0xfcef('0x25')](function(_0x1a15bc){return{'rows':_0x1a15bc||[],'count':_0x4e6aa4};});}});}exports['run']=function(_0xe7d43e,_0x311f4a){return runReport(_0xe7d43e[_0xfcef('0x47')],_0xe7d43e[_0xfcef('0x34')],_0xe7d43e[_0xfcef('0x41')])[_0xfcef('0x25')](respondWithResult(_0x311f4a,null))[_0xfcef('0x4e')](handleError(_0x311f4a,null));};exports['runReport']=runReport;exports[_0xfcef('0x34')]=function(_0x3413dc,_0x5e0eb1){var _0x4fef91=0xa;var _0x2e5ab1=[_0xfcef('0x52'),_0xfcef('0x85'),_0xfcef('0x53'),'cross_join'];var _0x30622a={'SUM':_0xfcef('0x87'),'COUNT':_0xfcef('0x54'),'COUNT DISTINCT':_0xfcef('0x55'),'MAX':_0xfcef('0x88'),'MIN':_0xfcef('0x56'),'AVG':_0xfcef('0x57'),'GROUP_CONCAT':_0xfcef('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x474dde={'SEC_TO_TIME':_0xfcef('0x5a'),'DATE':_0xfcef('0x9e'),'HOUR':_0xfcef('0x5b'),'ROUND':_0xfcef('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x552a79=function(_0x162a2e){return!_[_0xfcef('0x5d')]([_0xfcef('0x5e'),_0xfcef('0x5f'),_0xfcef('0x60'),'IS\x20NOT\x20EMPTY'],_0x162a2e);};var _0x3b163a=function(_0xa29368){if(!_0xa29368||!_0xa29368['rules'][_0xfcef('0x37')]){return'';}for(var _0x45e05f='(',_0x4b839d=0x0;_0x4b839d<_0xa29368[_0xfcef('0x62')][_0xfcef('0x37')];_0x4b839d+=0x1){_0x4b839d>0x0&&(_0x45e05f+='\x20'+_0xa29368['operator']+'\x20');_0x45e05f+=_0xa29368['rules'][_0x4b839d][_0xfcef('0x64')]?_0x3b163a(_0xa29368[_0xfcef('0x62')][_0x4b839d][_0xfcef('0x64')]):_0xa29368['rules'][_0x4b839d][_0xfcef('0x65')]+'\x20'+_0xa29368[_0xfcef('0x62')][_0x4b839d][_0xfcef('0x66')]+(_0x552a79(_0xa29368[_0xfcef('0x62')][_0x4b839d][_0xfcef('0x66')])?'\x20'+_0xa29368[_0xfcef('0x62')][_0x4b839d][_0xfcef('0x67')]:'');}return _0x45e05f+')';};var _0x50bec2={'where':{'id':_0x3413dc[_0xfcef('0x47')]['id']}},_0xd29185,_0x45dc86,_0x2f5a99,_0x182085,_0x24c580;_0x50bec2=_[_0xfcef('0x40')]({},_0x50bec2,_0x3413dc['options']);return db[_0xfcef('0x2d')][_0xfcef('0x4a')](_0x50bec2)[_0xfcef('0x25')](function(_0x1fce6b){if(_0x1fce6b){_0xd29185=_0x1fce6b;return _0x1fce6b[_0xfcef('0x68')]();}return null;})[_0xfcef('0x25')](function(_0x596499){if(_0x596499){if(!_0x596499['length']){throw new db[(_0xfcef('0x69'))][(_0xfcef('0x6a'))](_0xfcef('0x6b'),0x193);}_0x45dc86=_0x596499;return db[_0xfcef('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x18f582){if(_0x18f582){_0x2f5a99=_['keyBy'](_0x18f582,'id');var _0x1e41ae;var _0x235173=squel['select']();_0x235173['from'](_0xd29185[_0xfcef('0x70')]);for(var _0x3a9ab4=0x0;_0x3a9ab4<_0x45dc86[_0xfcef('0x37')];_0x3a9ab4+=0x1){_0x1e41ae=_0x45dc86[_0x3a9ab4][_0xfcef('0x8b')]?_0x2f5a99[_0x45dc86[_0x3a9ab4][_0xfcef('0x8b')]][_0xfcef('0x71')]:_0x45dc86[_0x3a9ab4]['field'];_0x1e41ae=_0x45dc86[_0x3a9ab4][_0xfcef('0x73')]?_[_0xfcef('0x72')](_0x30622a[_0x45dc86[_0x3a9ab4][_0xfcef('0x73')]],'%s',_0x1e41ae):_0x1e41ae;_0x1e41ae=_0x45dc86[_0x3a9ab4][_0xfcef('0x74')]?_[_0xfcef('0x72')](_0x474dde[_0x45dc86[_0x3a9ab4][_0xfcef('0x74')]],'%s',_0x1e41ae):_0x1e41ae;if(_0x45dc86[_0x3a9ab4][_0xfcef('0x75')]){_0x235173[_0xfcef('0x64')](_0x1e41ae);}_0x45dc86[_0x3a9ab4][_0xfcef('0x76')]&&_0x235173[_0xfcef('0x77')](_0x1e41ae,_0x45dc86[_0x3a9ab4][_0xfcef('0x76')]===_0xfcef('0x78')?![]:!![]);_0x235173[_0xfcef('0x65')](_0x1e41ae,_0x45dc86[_0x3a9ab4][_0xfcef('0x79')]||_0x1e41ae);}if(_0xd29185[_0xfcef('0x7a')]){_0xd29185['joins']=JSON[_0xfcef('0x7b')](_0xd29185[_0xfcef('0x7a')]);for(var _0x3d4020=0x0;_0x3d4020<_0xd29185[_0xfcef('0x7a')][_0xfcef('0x37')];_0x3d4020+=0x1){if(_0xd29185['joins'][_0x3d4020][_0xfcef('0x2f')]&&_[_0xfcef('0x5d')](_0x2e5ab1,_0xd29185['joins'][_0x3d4020][_0xfcef('0x2f')])&&_0xd29185[_0xfcef('0x7a')][_0x3d4020][_0xfcef('0x7c')]&&_0xd29185[_0xfcef('0x7a')][_0x3d4020][_0xfcef('0x7d')]&&_0xd29185[_0xfcef('0x7a')][_0x3d4020]['foreignKey']){_0x235173[_0xd29185[_0xfcef('0x7a')][_0x3d4020][_0xfcef('0x2f')]](_0xd29185[_0xfcef('0x7a')][_0x3d4020]['foreignTable'],null,util['format'](_0xfcef('0x9f'),_0xd29185[_0xfcef('0x70')],_0xd29185['joins'][_0x3d4020]['parentKey'],_0xd29185['joins'][_0x3d4020]['foreignTable'],_0xd29185[_0xfcef('0x7a')][_0x3d4020][_0xfcef('0x7e')]));}}}if(_0xd29185[_0xfcef('0x7f')]){_0xd29185[_0xfcef('0x7f')]=JSON[_0xfcef('0x7b')](_0xd29185[_0xfcef('0x7f')]);_0x235173[_0xfcef('0x3b')](_0x3b163a(_0xd29185[_0xfcef('0x7f')][_0xfcef('0x64')]));}_0x24c580=_0x235173[_0xfcef('0x80')]();_0x235173['limit'](_0x4fef91);_0x235173['offset'](0x0);logger[_0xfcef('0xa0')](_0xfcef('0x81'),_0x235173[_0xfcef('0x82')]());return dbH[_0xfcef('0x83')]['query'](_0x235173[_0xfcef('0x82')](),{'type':dbH[_0xfcef('0x83')][_0xfcef('0x84')][_0xfcef('0x9d')]});}})[_0xfcef('0x25')](function(){return{'sql':_0x24c580[_0xfcef('0x82')]()};})[_0xfcef('0x25')](respondWithResult(_0x5e0eb1,null))['catch'](handleError(_0x5e0eb1,null));};
\ No newline at end of file
+var _0xcd6f=['name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','joins','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','right_join','COUNT(%s)','Sequelize','DESC','output','fullPath','%s-%s.%s','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','DATE(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','alias','debug','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','get','CustomReports','UserProfileResource','sendStatus','error','stack'];(function(_0x4b4122,_0x1295e6){var _0x167fd1=function(_0x2ceaf3){while(--_0x2ceaf3){_0x4b4122['push'](_0x4b4122['shift']());}};_0x167fd1(++_0x1295e6);}(_0xcd6f,0x73));var _0xfcd6=function(_0x29c53b,_0x1e529d){_0x29c53b=_0x29c53b-0x0;var _0xb07516=_0xcd6f[_0x29c53b];return _0xb07516;};'use strict';var emlformat=require(_0xfcd6('0x0'));var rimraf=require(_0xfcd6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfcd6('0x2'));var rp=require('request-promise');var moment=require(_0xfcd6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfcd6('0x4'));var util=require(_0xfcd6('0x5'));var path=require('path');var sox=require(_0xfcd6('0x6'));var csv=require(_0xfcd6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcd6('0x8'));var _=require(_0xfcd6('0x9'));var squel=require(_0xfcd6('0xa'));var crypto=require(_0xfcd6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfcd6('0xc'));var toCsv=require(_0xfcd6('0x7'));var querystring=require(_0xfcd6('0xd'));var Papa=require(_0xfcd6('0xe'));var Redis=require('ioredis');var authService=require(_0xfcd6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfcd6('0x10'));var hardwareService=require(_0xfcd6('0x11'));var logger=require('../../config/logger')(_0xfcd6('0x12'));var utils=require(_0xfcd6('0x13'));var config=require(_0xfcd6('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xfcd6('0x15'))['db'];var dbH=require(_0xfcd6('0x15'))['dbH'];function respondWithStatusCode(_0x2b8723,_0x269259){_0x269259=_0x269259||0xcc;return function(_0x4da21b){if(_0x4da21b){return _0x2b8723['sendStatus'](_0x269259);}return _0x2b8723['status'](_0x269259)[_0xfcd6('0x16')]();};}function respondWithResult(_0x6df0d5,_0x56ca6b){_0x56ca6b=_0x56ca6b||0xc8;return function(_0x162e91){if(_0x162e91){return _0x6df0d5[_0xfcd6('0x17')](_0x56ca6b)['json'](_0x162e91);}};}function respondWithFilteredResult(_0x5c4e5d,_0x499c74){return function(_0x5150dc){if(_0x5150dc){var _0x46b6b5=typeof _0x499c74[_0xfcd6('0x18')]===_0xfcd6('0x19')&&typeof _0x499c74[_0xfcd6('0x1a')]==='undefined';var _0x275a6f=_0x5150dc['count'];var _0x1eff7e=_0x46b6b5?0x0:_0x499c74[_0xfcd6('0x18')];var _0xf0003a=_0x46b6b5?_0x5150dc[_0xfcd6('0x1b')]:_0x499c74['offset']+_0x499c74[_0xfcd6('0x1a')];var _0x1b72c6;if(_0xf0003a>=_0x275a6f){_0xf0003a=_0x275a6f;_0x1b72c6=0xc8;}else{_0x1b72c6=0xce;}_0x5c4e5d[_0xfcd6('0x17')](_0x1b72c6);return _0x5c4e5d[_0xfcd6('0x1c')](_0xfcd6('0x1d'),_0x1eff7e+'-'+_0xf0003a+'/'+_0x275a6f)[_0xfcd6('0x1e')](_0x5150dc);}return null;};}function patchUpdates(_0x53a8d7){return function(_0x15c101){try{jsonpatch[_0xfcd6('0x1f')](_0x15c101,_0x53a8d7,!![]);}catch(_0xadd9ba){return BPromise[_0xfcd6('0x20')](_0xadd9ba);}return _0x15c101['save']();};}function saveUpdates(_0x2b0664,_0x4feaa2){return function(_0x51d809){if(_0x51d809){return _0x51d809[_0xfcd6('0x21')](_0x2b0664)['then'](function(_0xe83980){return _0xe83980;});}return null;};}function removeEntity(_0x47000b,_0x1985c4){return function(_0x58c328){if(_0x58c328){return _0x58c328[_0xfcd6('0x22')]()[_0xfcd6('0x23')](function(){var _0x1a597c=_0x58c328[_0xfcd6('0x24')]({'plain':!![]});var _0x38d8e0=_0xfcd6('0x25');return db[_0xfcd6('0x26')][_0xfcd6('0x22')]({'where':{'type':_0x38d8e0,'resourceId':_0x1a597c['id']}})[_0xfcd6('0x23')](function(){return _0x58c328;});})[_0xfcd6('0x23')](function(){_0x47000b[_0xfcd6('0x17')](0xcc)[_0xfcd6('0x16')]();});}};}function handleEntityNotFound(_0xc7ddbd,_0x165a60){return function(_0x1ef8b3){if(!_0x1ef8b3){_0xc7ddbd[_0xfcd6('0x27')](0x194);}return _0x1ef8b3;};}function handleError(_0x33395e,_0x5587e3){_0x5587e3=_0x5587e3||0x1f4;return function(_0x2c9ac5){logger[_0xfcd6('0x28')](_0x2c9ac5[_0xfcd6('0x29')]);if(_0x2c9ac5[_0xfcd6('0x2a')]){delete _0x2c9ac5[_0xfcd6('0x2a')];}_0x33395e[_0xfcd6('0x17')](_0x5587e3)[_0xfcd6('0x2b')](_0x2c9ac5);};}exports[_0xfcd6('0x2c')]=function(_0x1c7399,_0x461dc2){var _0x4b6889={},_0x5d074c={},_0x5b8e9f={'count':0x0,'rows':[]};var _0x524fdc=_[_0xfcd6('0x2d')](db[_0xfcd6('0x2e')][_0xfcd6('0x2f')],function(_0x2393c4){return{'name':_0x2393c4[_0xfcd6('0x30')],'type':_0x2393c4[_0xfcd6('0x31')][_0xfcd6('0x32')]};});_0x5d074c[_0xfcd6('0x33')]=_[_0xfcd6('0x2d')](_0x524fdc,_0xfcd6('0x2a'));_0x5d074c[_0xfcd6('0x34')]=_[_0xfcd6('0x35')](_0x1c7399[_0xfcd6('0x34')]);_0x5d074c[_0xfcd6('0x36')]=_[_0xfcd6('0x37')](_0x5d074c[_0xfcd6('0x33')],_0x5d074c[_0xfcd6('0x34')]);_0x4b6889[_0xfcd6('0x38')]=_['intersection'](_0x5d074c[_0xfcd6('0x33')],qs['fields'](_0x1c7399[_0xfcd6('0x34')][_0xfcd6('0x39')]));_0x4b6889['attributes']=_0x4b6889[_0xfcd6('0x38')][_0xfcd6('0x3a')]?_0x4b6889['attributes']:_0x5d074c[_0xfcd6('0x33')];if(!_0x1c7399[_0xfcd6('0x34')][_0xfcd6('0x3b')](_0xfcd6('0x3c'))){_0x4b6889[_0xfcd6('0x1a')]=qs[_0xfcd6('0x1a')](_0x1c7399['query'][_0xfcd6('0x1a')]);_0x4b6889[_0xfcd6('0x18')]=qs[_0xfcd6('0x18')](_0x1c7399[_0xfcd6('0x34')][_0xfcd6('0x18')]);}_0x4b6889[_0xfcd6('0x3d')]=qs[_0xfcd6('0x3e')](_0x1c7399[_0xfcd6('0x34')]['sort']);_0x4b6889[_0xfcd6('0x3f')]=qs['filters'](_[_0xfcd6('0x40')](_0x1c7399['query'],_0x5d074c[_0xfcd6('0x36')]),_0x524fdc);if(_0x1c7399[_0xfcd6('0x34')][_0xfcd6('0x41')]){_0x4b6889[_0xfcd6('0x3f')]=_['merge'](_0x4b6889[_0xfcd6('0x3f')],{'$or':_[_0xfcd6('0x2d')](_0x524fdc,function(_0x37e530){if(_0x37e530[_0xfcd6('0x31')]!=='VIRTUAL'){var _0x1b0d8d={};_0x1b0d8d[_0x37e530['name']]={'$like':'%'+_0x1c7399[_0xfcd6('0x34')][_0xfcd6('0x41')]+'%'};return _0x1b0d8d;}})});}_0x4b6889=_[_0xfcd6('0x42')]({},_0x4b6889,_0x1c7399[_0xfcd6('0x43')]);var _0xed5bbd={'where':_0x4b6889['where']};return db[_0xfcd6('0x2e')][_0xfcd6('0x1b')](_0xed5bbd)[_0xfcd6('0x23')](function(_0x3fbdc4){_0x5b8e9f['count']=_0x3fbdc4;if(_0x1c7399['query'][_0xfcd6('0x44')]){_0x4b6889[_0xfcd6('0x45')]=[{'all':!![]}];}return db[_0xfcd6('0x2e')][_0xfcd6('0x46')](_0x4b6889);})[_0xfcd6('0x23')](function(_0x42c0a4){_0x5b8e9f[_0xfcd6('0x47')]=_0x42c0a4;return _0x5b8e9f;})['then'](respondWithFilteredResult(_0x461dc2,_0x4b6889))[_0xfcd6('0x48')](handleError(_0x461dc2,null));};exports['show']=function(_0x3d7ae0,_0xa66c26){var _0xc59895={'raw':![],'where':{'id':_0x3d7ae0[_0xfcd6('0x49')]['id']}},_0x456a7b={};_0x456a7b[_0xfcd6('0x33')]=_[_0xfcd6('0x35')](db[_0xfcd6('0x2e')]['rawAttributes']);_0x456a7b['query']=_[_0xfcd6('0x35')](_0x3d7ae0[_0xfcd6('0x34')]);_0x456a7b[_0xfcd6('0x36')]=_[_0xfcd6('0x37')](_0x456a7b[_0xfcd6('0x33')],_0x456a7b[_0xfcd6('0x34')]);_0xc59895[_0xfcd6('0x38')]=_[_0xfcd6('0x37')](_0x456a7b[_0xfcd6('0x33')],qs['fields'](_0x3d7ae0['query'][_0xfcd6('0x39')]));_0xc59895[_0xfcd6('0x38')]=_0xc59895[_0xfcd6('0x38')]['length']?_0xc59895[_0xfcd6('0x38')]:_0x456a7b[_0xfcd6('0x33')];if(_0x3d7ae0[_0xfcd6('0x34')]['includeAll']){_0xc59895[_0xfcd6('0x45')]=[{'all':!![]}];}_0xc59895=_[_0xfcd6('0x42')]({},_0xc59895,_0x3d7ae0[_0xfcd6('0x43')]);return db[_0xfcd6('0x2e')][_0xfcd6('0x4a')](_0xc59895)[_0xfcd6('0x23')](handleEntityNotFound(_0xa66c26,null))[_0xfcd6('0x23')](respondWithResult(_0xa66c26,null))[_0xfcd6('0x48')](handleError(_0xa66c26,null));};exports[_0xfcd6('0x4b')]=function(_0xeb7f8f,_0x23c07c){return db[_0xfcd6('0x2e')][_0xfcd6('0x4b')](_0xeb7f8f[_0xfcd6('0x4c')],{})[_0xfcd6('0x23')](function(_0x56cb04){var _0x5a24ef=_0xeb7f8f[_0xfcd6('0x4d')][_0xfcd6('0x24')]({'plain':!![]});if(!_0x5a24ef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a24ef[_0xfcd6('0x4e')]===_0xfcd6('0x4d')){var _0x396088=_0x56cb04[_0xfcd6('0x24')]({'plain':!![]});var _0x582f5d='Reports';return db['UserProfileSection'][_0xfcd6('0x4a')]({'where':{'name':_0x582f5d,'userProfileId':_0x5a24ef[_0xfcd6('0x4f')]},'raw':!![]})[_0xfcd6('0x23')](function(_0x4e0fe1){if(_0x4e0fe1&&_0x4e0fe1['autoAssociation']===0x0){return db['UserProfileResource'][_0xfcd6('0x4b')]({'name':_0x396088['name'],'resourceId':_0x396088['id'],'type':_0xfcd6('0x25'),'sectionId':_0x4e0fe1['id']},{})[_0xfcd6('0x23')](function(){return _0x56cb04;});}else{return _0x56cb04;}})[_0xfcd6('0x48')](function(_0x147c47){logger['error'](_0xfcd6('0x50'),_0x147c47);throw _0x147c47;});}return _0x56cb04;})[_0xfcd6('0x23')](respondWithResult(_0x23c07c,0xc9))[_0xfcd6('0x48')](handleError(_0x23c07c,null));};exports[_0xfcd6('0x21')]=function(_0x27804e,_0x2e3abb){if(_0x27804e[_0xfcd6('0x4c')]['id']){delete _0x27804e[_0xfcd6('0x4c')]['id'];}return db[_0xfcd6('0x2e')][_0xfcd6('0x4a')]({'where':{'id':_0x27804e[_0xfcd6('0x49')]['id']}})[_0xfcd6('0x23')](handleEntityNotFound(_0x2e3abb,null))[_0xfcd6('0x23')](saveUpdates(_0x27804e[_0xfcd6('0x4c')],null))['then'](respondWithResult(_0x2e3abb,null))['catch'](handleError(_0x2e3abb,null));};exports[_0xfcd6('0x22')]=function(_0x8f206a,_0x55f02b){return db[_0xfcd6('0x2e')][_0xfcd6('0x4a')]({'where':{'id':_0x8f206a[_0xfcd6('0x49')]['id']}})['then'](handleEntityNotFound(_0x55f02b,null))['then'](removeEntity(_0x55f02b,null))[_0xfcd6('0x48')](handleError(_0x55f02b,null));};exports['preview']=function(_0x5c339e,_0x37e54a){var _0x2567ea=0xa;var _0x4b8c2e=[_0xfcd6('0x51'),_0xfcd6('0x52'),'right_join','cross_join'];var _0x3b2b82={'SUM':_0xfcd6('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfcd6('0x54'),'MAX':_0xfcd6('0x55'),'MIN':_0xfcd6('0x56'),'AVG':_0xfcd6('0x57'),'GROUP_CONCAT':_0xfcd6('0x58'),'GROUP_CONCAT ASC':_0xfcd6('0x59'),'GROUP_CONCAT DESC':_0xfcd6('0x5a')};var _0x33233b={'SEC_TO_TIME':_0xfcd6('0x5b'),'DATE':'DATE(%s)','HOUR':_0xfcd6('0x5c'),'ROUND':_0xfcd6('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x477f47=function(_0x13a8e9){return!_['includes'](['IS\x20NULL',_0xfcd6('0x5e'),_0xfcd6('0x5f'),_0xfcd6('0x60')],_0x13a8e9);};var _0x29320a=function(_0x32b8d2){if(!_0x32b8d2||!_0x32b8d2['rules'][_0xfcd6('0x3a')]){return'';}for(var _0x3adc51='(',_0x1c1c33=0x0;_0x1c1c33<_0x32b8d2[_0xfcd6('0x61')]['length'];_0x1c1c33+=0x1){_0x1c1c33>0x0&&(_0x3adc51+='\x20'+_0x32b8d2[_0xfcd6('0x62')]+'\x20');_0x3adc51+=_0x32b8d2[_0xfcd6('0x61')][_0x1c1c33][_0xfcd6('0x63')]?_0x29320a(_0x32b8d2['rules'][_0x1c1c33]['group']):_0x32b8d2['rules'][_0x1c1c33]['field']+'\x20'+_0x32b8d2[_0xfcd6('0x61')][_0x1c1c33][_0xfcd6('0x64')]+(_0x477f47(_0x32b8d2[_0xfcd6('0x61')][_0x1c1c33][_0xfcd6('0x64')])?'\x20'+_0x32b8d2[_0xfcd6('0x61')][_0x1c1c33][_0xfcd6('0x65')]:'');}return _0x3adc51+')';};var _0xd77141={'where':{'id':_0x5c339e['params']['id']}},_0x32e61d,_0x530806,_0x5765c8,_0x6bd7a5,_0x5c7140;_0xd77141=_[_0xfcd6('0x42')]({},_0xd77141,_0x5c339e[_0xfcd6('0x43')]);return db[_0xfcd6('0x2e')][_0xfcd6('0x4a')](_0xd77141)['then'](function(_0x542a2e){if(_0x542a2e){_0x32e61d=_0x542a2e;return _0x542a2e[_0xfcd6('0x66')]();}return null;})[_0xfcd6('0x23')](function(_0x20ba7e){if(_0x20ba7e){if(!_0x20ba7e[_0xfcd6('0x3a')]){throw new db['Sequelize'][(_0xfcd6('0x67'))](_0xfcd6('0x68'),0x193);}_0x530806=_0x20ba7e;return db[_0xfcd6('0x69')][_0xfcd6('0x46')]({'raw':!![]});}return null;})['then'](function(_0x15a960){if(_0x15a960){_0x5765c8=_[_0xfcd6('0x6a')](_0x15a960,'id');var _0x5049d9;var _0x25ee04=squel[_0xfcd6('0x6b')]();_0x25ee04[_0xfcd6('0x6c')](_0x32e61d[_0xfcd6('0x6d')]);for(var _0x5af4e0=0x0;_0x5af4e0<_0x530806[_0xfcd6('0x3a')];_0x5af4e0+=0x1){_0x5049d9=_0x530806[_0x5af4e0][_0xfcd6('0x6e')]?_0x5765c8[_0x530806[_0x5af4e0][_0xfcd6('0x6e')]][_0xfcd6('0x6f')]:_0x530806[_0x5af4e0][_0xfcd6('0x70')];_0x5049d9=_0x530806[_0x5af4e0][_0xfcd6('0x71')]?_[_0xfcd6('0x72')](_0x3b2b82[_0x530806[_0x5af4e0]['function']],'%s',_0x5049d9):_0x5049d9;_0x5049d9=_0x530806[_0x5af4e0][_0xfcd6('0x73')]?_[_0xfcd6('0x72')](_0x33233b[_0x530806[_0x5af4e0][_0xfcd6('0x73')]],'%s',_0x5049d9):_0x5049d9;if(_0x530806[_0x5af4e0][_0xfcd6('0x74')]){_0x25ee04[_0xfcd6('0x63')](_0x5049d9);}_0x530806[_0x5af4e0]['orderBy']&&_0x25ee04[_0xfcd6('0x3d')](_0x5049d9,_0x530806[_0x5af4e0][_0xfcd6('0x75')]==='DESC'?![]:!![]);_0x25ee04[_0xfcd6('0x70')](_0x5049d9,_0x530806[_0x5af4e0]['alias']||_0x5049d9);}if(_0x32e61d[_0xfcd6('0x76')]){_0x32e61d[_0xfcd6('0x76')]=JSON['parse'](_0x32e61d[_0xfcd6('0x76')]);for(var _0x2e7f46=0x0;_0x2e7f46<_0x32e61d['joins']['length'];_0x2e7f46+=0x1){if(_0x32e61d['joins'][_0x2e7f46][_0xfcd6('0x31')]&&_[_0xfcd6('0x77')](_0x4b8c2e,_0x32e61d[_0xfcd6('0x76')][_0x2e7f46][_0xfcd6('0x31')])&&_0x32e61d[_0xfcd6('0x76')][_0x2e7f46][_0xfcd6('0x78')]&&_0x32e61d['joins'][_0x2e7f46][_0xfcd6('0x79')]&&_0x32e61d['joins'][_0x2e7f46][_0xfcd6('0x7a')]){_0x25ee04[_0x32e61d[_0xfcd6('0x76')][_0x2e7f46][_0xfcd6('0x31')]](_0x32e61d[_0xfcd6('0x76')][_0x2e7f46][_0xfcd6('0x79')],null,util['format'](_0xfcd6('0x7b'),_0x32e61d[_0xfcd6('0x6d')],_0x32e61d[_0xfcd6('0x76')][_0x2e7f46][_0xfcd6('0x78')],_0x32e61d[_0xfcd6('0x76')][_0x2e7f46][_0xfcd6('0x79')],_0x32e61d[_0xfcd6('0x76')][_0x2e7f46][_0xfcd6('0x7a')]));}}}if(_0x32e61d['conditions']){_0x32e61d[_0xfcd6('0x7c')]=JSON[_0xfcd6('0x7d')](_0x32e61d[_0xfcd6('0x7c')]);_0x25ee04['where'](_0x29320a(_0x32e61d['conditions'][_0xfcd6('0x63')]));}_0x5c7140=_0x25ee04[_0xfcd6('0x7e')]();_0x25ee04[_0xfcd6('0x1a')](_0x2567ea);_0x25ee04[_0xfcd6('0x18')](0x0);logger['debug'](_0xfcd6('0x7f'),_0x25ee04['toString']());return dbH[_0xfcd6('0x80')][_0xfcd6('0x34')](_0x25ee04[_0xfcd6('0x81')](),{'type':dbH['sequelize'][_0xfcd6('0x82')][_0xfcd6('0x83')]});}})[_0xfcd6('0x23')](respondWithResult(_0x37e54a,null))[_0xfcd6('0x48')](handleError(_0x37e54a,null));};function runReport(_0x4619a5,_0x4ff4bb,_0x5f2b8b){var _0x356f9c=_0x4ff4bb[_0xfcd6('0x2a')];var _0x51c84a=0xa;var _0x42c8af=[_0xfcd6('0x51'),_0xfcd6('0x52'),_0xfcd6('0x84'),'cross_join'];var _0x43dde6={'SUM':_0xfcd6('0x53'),'COUNT':_0xfcd6('0x85'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xfcd6('0x57'),'GROUP_CONCAT':_0xfcd6('0x58'),'GROUP_CONCAT ASC':_0xfcd6('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x549cb3={'SEC_TO_TIME':_0xfcd6('0x5b'),'DATE':'DATE(%s)','HOUR':_0xfcd6('0x5c'),'ROUND':_0xfcd6('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5a63bd=function(_0x253778){return!_[_0xfcd6('0x77')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xfcd6('0x5f'),_0xfcd6('0x60')],_0x253778);};var _0x4e0736=function(_0x247b54){if(!_0x247b54||!_0x247b54[_0xfcd6('0x61')][_0xfcd6('0x3a')]){return'';}for(var _0x51ef42='(',_0x38dab0=0x0;_0x38dab0<_0x247b54[_0xfcd6('0x61')][_0xfcd6('0x3a')];_0x38dab0+=0x1){_0x38dab0>0x0&&(_0x51ef42+='\x20'+_0x247b54['operator']+'\x20');_0x51ef42+=_0x247b54['rules'][_0x38dab0][_0xfcd6('0x63')]?_0x4e0736(_0x247b54['rules'][_0x38dab0][_0xfcd6('0x63')]):_0x247b54[_0xfcd6('0x61')][_0x38dab0][_0xfcd6('0x70')]+'\x20'+_0x247b54[_0xfcd6('0x61')][_0x38dab0][_0xfcd6('0x64')]+(_0x5a63bd(_0x247b54[_0xfcd6('0x61')][_0x38dab0][_0xfcd6('0x64')])?'\x20'+_0x247b54[_0xfcd6('0x61')][_0x38dab0]['value']:'');}return _0x51ef42+')';};var _0x5d058e={'where':{'id':_0x4619a5['id']}},_0x537075,_0x3e4285,_0x546ef8,_0x56150f,_0xa25976;_0x5d058e=_['merge']({},_0x5d058e,_0x5f2b8b);return db[_0xfcd6('0x2e')][_0xfcd6('0x4a')](_0x5d058e)[_0xfcd6('0x23')](function(_0x3e7d61){if(_0x3e7d61){_0x537075=_0x3e7d61;return _0x3e7d61['getFields']();}return null;})[_0xfcd6('0x23')](function(_0x164ae8){if(_0x164ae8){if(!_0x164ae8[_0xfcd6('0x3a')]){throw new db[(_0xfcd6('0x86'))][(_0xfcd6('0x67'))](_0xfcd6('0x68'),0x193);}_0x3e4285=_0x164ae8;return db['AnalyticMetric'][_0xfcd6('0x46')]({'raw':!![]});}return null;})[_0xfcd6('0x23')](function(_0x139375){if(_0x139375){_0x546ef8=_[_0xfcd6('0x6a')](_0x139375,'id');var _0x21d055;var _0x491db3=squel[_0xfcd6('0x6b')]();_0x491db3[_0xfcd6('0x6c')](_0x537075[_0xfcd6('0x6d')]);for(var _0x1a6678=0x0;_0x1a6678<_0x3e4285[_0xfcd6('0x3a')];_0x1a6678+=0x1){_0x21d055=_0x3e4285[_0x1a6678][_0xfcd6('0x6e')]?_0x546ef8[_0x3e4285[_0x1a6678][_0xfcd6('0x6e')]][_0xfcd6('0x6f')]:_0x3e4285[_0x1a6678][_0xfcd6('0x70')];_0x21d055=_0x3e4285[_0x1a6678][_0xfcd6('0x71')]?_[_0xfcd6('0x72')](_0x43dde6[_0x3e4285[_0x1a6678][_0xfcd6('0x71')]],'%s',_0x21d055):_0x21d055;_0x21d055=_0x3e4285[_0x1a6678]['format']?_[_0xfcd6('0x72')](_0x549cb3[_0x3e4285[_0x1a6678][_0xfcd6('0x73')]],'%s',_0x21d055):_0x21d055;if(_0x3e4285[_0x1a6678]['groupBy']){_0x491db3[_0xfcd6('0x63')](_0x21d055);}_0x3e4285[_0x1a6678][_0xfcd6('0x75')]&&_0x491db3[_0xfcd6('0x3d')](_0x21d055,_0x3e4285[_0x1a6678]['orderBy']===_0xfcd6('0x87')?![]:!![]);_0x491db3[_0xfcd6('0x70')](_0x21d055,_0x3e4285[_0x1a6678]['alias']||_0x21d055);}if(_0x537075['joins']){_0x537075[_0xfcd6('0x76')]=JSON[_0xfcd6('0x7d')](_0x537075['joins']);for(var _0x138e2e=0x0;_0x138e2e<_0x537075[_0xfcd6('0x76')][_0xfcd6('0x3a')];_0x138e2e+=0x1){if(_0x537075[_0xfcd6('0x76')][_0x138e2e][_0xfcd6('0x31')]&&_[_0xfcd6('0x77')](_0x42c8af,_0x537075[_0xfcd6('0x76')][_0x138e2e][_0xfcd6('0x31')])&&_0x537075[_0xfcd6('0x76')][_0x138e2e][_0xfcd6('0x78')]&&_0x537075[_0xfcd6('0x76')][_0x138e2e][_0xfcd6('0x79')]&&_0x537075[_0xfcd6('0x76')][_0x138e2e][_0xfcd6('0x7a')]){_0x491db3[_0x537075[_0xfcd6('0x76')][_0x138e2e][_0xfcd6('0x31')]](_0x537075[_0xfcd6('0x76')][_0x138e2e][_0xfcd6('0x79')],null,util['format'](_0xfcd6('0x7b'),_0x537075['table'],_0x537075[_0xfcd6('0x76')][_0x138e2e]['parentKey'],_0x537075['joins'][_0x138e2e][_0xfcd6('0x79')],_0x537075['joins'][_0x138e2e]['foreignKey']));}}}if(_0x537075[_0xfcd6('0x7c')]){_0x537075['conditions']=JSON[_0xfcd6('0x7d')](_0x537075[_0xfcd6('0x7c')]);_0x491db3[_0xfcd6('0x3f')](_0x4e0736(_0x537075['conditions'][_0xfcd6('0x63')]));}_0xa25976=_0x491db3[_0xfcd6('0x7e')]();_0x491db3['limit'](_0x51c84a);_0x491db3['offset'](0x0);return;}})['then'](function(){if(_0x4ff4bb[_0xfcd6('0x88')]==='web'){return null;}var _0x47772a=_[_0xfcd6('0x42')](_0x4ff4bb,{'name':_0x4ff4bb[_0xfcd6('0x89')]||_0x4ff4bb[_0xfcd6('0x2a')]||_0x537075['name'],'basename':_0x356f9c,'savename':util['format'](_0xfcd6('0x8a'),_0x4ff4bb[_0xfcd6('0x2a')]||_0x537075[_0xfcd6('0x2a')],require('randomstring')[_0xfcd6('0x8b')](0x4),_0x4ff4bb[_0xfcd6('0x88')]||_0xfcd6('0x8c')),'reportId':_0x537075['id'],'reportType':_0xfcd6('0x8d')});return db['AnalyticExtractedReport']['create'](_0x47772a,{'raw':!![]});})[_0xfcd6('0x23')](function(_0x4b7200){if(_0x537075[_0xfcd6('0x6d')]===_0xfcd6('0x8e')){_0xa25976[_0xfcd6('0x3f')](_0x537075[_0xfcd6('0x6d')]+_0xfcd6('0x8f'),_0x4ff4bb['startDate'],_0x4ff4bb['endDate']);}else{_0xa25976[_0xfcd6('0x3f')](_0x537075[_0xfcd6('0x6d')]+_0xfcd6('0x90'),_0x4ff4bb[_0xfcd6('0x91')],_0x4ff4bb['endDate']);}if(_0x4b7200){logger[_0xfcd6('0x92')](_0xfcd6('0x93'),_0xa25976['toString']());require(_0xfcd6('0x94'))['fork'](path[_0xfcd6('0x51')](__dirname,_0xfcd6('0x95'),_0x4b7200[_0xfcd6('0x88')]),[_0x4b7200['id'],_0xa25976[_0xfcd6('0x81')](),path[_0xfcd6('0x51')](__dirname,'../../files/reports',_0x4b7200[_0xfcd6('0x96')]),_0x356f9c]);return _0x4b7200;}else{var _0x4c91c2=squel[_0xfcd6('0x6b')]();_0x4c91c2[_0xfcd6('0x6c')]('('+_0xa25976[_0xfcd6('0x81')]()+')',_0xfcd6('0x97'));_0x4c91c2['field']('COUNT(*)',_0xfcd6('0x1b'));_0xa25976[_0xfcd6('0x1a')](_0x4ff4bb['limit']||_0x51c84a);_0xa25976[_0xfcd6('0x18')](_0x4ff4bb[_0xfcd6('0x18')]||0x0);return dbH[_0xfcd6('0x80')][_0xfcd6('0x34')](_0x4c91c2['toString'](),{'type':dbH[_0xfcd6('0x80')][_0xfcd6('0x82')][_0xfcd6('0x83')]})['then'](function(_0x39d70c){if(!_0x39d70c[_0xfcd6('0x3a')]){_0x56150f=0x0;}else{_0x56150f=_0x39d70c[0x0]['count']||0x0;}return dbH['sequelize'][_0xfcd6('0x34')](_0xa25976[_0xfcd6('0x81')](),{'type':dbH[_0xfcd6('0x80')][_0xfcd6('0x82')][_0xfcd6('0x83')]});})[_0xfcd6('0x23')](function(_0x5ab089){return{'rows':_0x5ab089||[],'count':_0x56150f};});}});}exports['run']=function(_0x485844,_0x526284){return runReport(_0x485844[_0xfcd6('0x49')],_0x485844[_0xfcd6('0x34')],_0x485844[_0xfcd6('0x43')])[_0xfcd6('0x23')](respondWithResult(_0x526284,null))[_0xfcd6('0x48')](handleError(_0x526284,null));};exports['runReport']=runReport;exports['query']=function(_0x307904,_0x5898fa){var _0x46dc3a=0xa;var _0x3df4b7=[_0xfcd6('0x51'),'left_join','right_join','cross_join'];var _0x2c3ade={'SUM':_0xfcd6('0x53'),'COUNT':_0xfcd6('0x85'),'COUNT DISTINCT':_0xfcd6('0x54'),'MAX':'MAX(%s)','MIN':_0xfcd6('0x56'),'AVG':_0xfcd6('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfcd6('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2426a4={'SEC_TO_TIME':_0xfcd6('0x5b'),'DATE':_0xfcd6('0x98'),'HOUR':_0xfcd6('0x5c'),'ROUND':_0xfcd6('0x5d'),'UNIX_TIMESTAMP':_0xfcd6('0x99')};var _0x19fdf8=function(_0x3a2fcf){return!_[_0xfcd6('0x77')]([_0xfcd6('0x9a'),_0xfcd6('0x5e'),_0xfcd6('0x5f'),_0xfcd6('0x60')],_0x3a2fcf);};var _0x17f584=function(_0x55ded7){if(!_0x55ded7||!_0x55ded7[_0xfcd6('0x61')]['length']){return'';}for(var _0x12dcef='(',_0x2e1ea4=0x0;_0x2e1ea4<_0x55ded7[_0xfcd6('0x61')]['length'];_0x2e1ea4+=0x1){_0x2e1ea4>0x0&&(_0x12dcef+='\x20'+_0x55ded7[_0xfcd6('0x62')]+'\x20');_0x12dcef+=_0x55ded7[_0xfcd6('0x61')][_0x2e1ea4][_0xfcd6('0x63')]?_0x17f584(_0x55ded7[_0xfcd6('0x61')][_0x2e1ea4]['group']):_0x55ded7[_0xfcd6('0x61')][_0x2e1ea4][_0xfcd6('0x70')]+'\x20'+_0x55ded7[_0xfcd6('0x61')][_0x2e1ea4][_0xfcd6('0x64')]+(_0x19fdf8(_0x55ded7[_0xfcd6('0x61')][_0x2e1ea4][_0xfcd6('0x64')])?'\x20'+_0x55ded7[_0xfcd6('0x61')][_0x2e1ea4]['value']:'');}return _0x12dcef+')';};var _0x293fd7={'where':{'id':_0x307904[_0xfcd6('0x49')]['id']}},_0xbd5d78,_0x43f9de,_0x399a0f,_0x3a3a74,_0x2c09e9;_0x293fd7=_[_0xfcd6('0x42')]({},_0x293fd7,_0x307904[_0xfcd6('0x43')]);return db[_0xfcd6('0x2e')][_0xfcd6('0x4a')](_0x293fd7)[_0xfcd6('0x23')](function(_0x5da4b9){if(_0x5da4b9){_0xbd5d78=_0x5da4b9;return _0x5da4b9[_0xfcd6('0x66')]();}return null;})['then'](function(_0x1e7603){if(_0x1e7603){if(!_0x1e7603[_0xfcd6('0x3a')]){throw new db[(_0xfcd6('0x86'))][(_0xfcd6('0x67'))](_0xfcd6('0x68'),0x193);}_0x43f9de=_0x1e7603;return db[_0xfcd6('0x69')]['findAll']({'raw':!![]});}return null;})[_0xfcd6('0x23')](function(_0x5a20fe){if(_0x5a20fe){_0x399a0f=_[_0xfcd6('0x6a')](_0x5a20fe,'id');var _0x1e75e1;var _0x1b7953=squel[_0xfcd6('0x6b')]();_0x1b7953['from'](_0xbd5d78[_0xfcd6('0x6d')]);for(var _0x26c831=0x0;_0x26c831<_0x43f9de[_0xfcd6('0x3a')];_0x26c831+=0x1){_0x1e75e1=_0x43f9de[_0x26c831][_0xfcd6('0x6e')]?_0x399a0f[_0x43f9de[_0x26c831][_0xfcd6('0x6e')]][_0xfcd6('0x6f')]:_0x43f9de[_0x26c831][_0xfcd6('0x70')];_0x1e75e1=_0x43f9de[_0x26c831][_0xfcd6('0x71')]?_[_0xfcd6('0x72')](_0x2c3ade[_0x43f9de[_0x26c831][_0xfcd6('0x71')]],'%s',_0x1e75e1):_0x1e75e1;_0x1e75e1=_0x43f9de[_0x26c831]['format']?_[_0xfcd6('0x72')](_0x2426a4[_0x43f9de[_0x26c831][_0xfcd6('0x73')]],'%s',_0x1e75e1):_0x1e75e1;if(_0x43f9de[_0x26c831]['groupBy']){_0x1b7953[_0xfcd6('0x63')](_0x1e75e1);}_0x43f9de[_0x26c831][_0xfcd6('0x75')]&&_0x1b7953[_0xfcd6('0x3d')](_0x1e75e1,_0x43f9de[_0x26c831][_0xfcd6('0x75')]==='DESC'?![]:!![]);_0x1b7953[_0xfcd6('0x70')](_0x1e75e1,_0x43f9de[_0x26c831][_0xfcd6('0x9b')]||_0x1e75e1);}if(_0xbd5d78[_0xfcd6('0x76')]){_0xbd5d78[_0xfcd6('0x76')]=JSON[_0xfcd6('0x7d')](_0xbd5d78['joins']);for(var _0x22b977=0x0;_0x22b977<_0xbd5d78['joins'][_0xfcd6('0x3a')];_0x22b977+=0x1){if(_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x31')]&&_[_0xfcd6('0x77')](_0x3df4b7,_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x31')])&&_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x78')]&&_0xbd5d78['joins'][_0x22b977][_0xfcd6('0x79')]&&_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x7a')]){_0x1b7953[_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x31')]](_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x79')],null,util[_0xfcd6('0x73')](_0xfcd6('0x7b'),_0xbd5d78['table'],_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x78')],_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x79')],_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x7a')]));}}}if(_0xbd5d78['conditions']){_0xbd5d78[_0xfcd6('0x7c')]=JSON['parse'](_0xbd5d78[_0xfcd6('0x7c')]);_0x1b7953['where'](_0x17f584(_0xbd5d78['conditions']['group']));}_0x2c09e9=_0x1b7953[_0xfcd6('0x7e')]();_0x1b7953[_0xfcd6('0x1a')](_0x46dc3a);_0x1b7953[_0xfcd6('0x18')](0x0);logger[_0xfcd6('0x9c')]('Limited\x20Query:',_0x1b7953['toString']());return dbH[_0xfcd6('0x80')][_0xfcd6('0x34')](_0x1b7953[_0xfcd6('0x81')](),{'type':dbH[_0xfcd6('0x80')]['QueryTypes'][_0xfcd6('0x83')]});}})[_0xfcd6('0x23')](function(){return{'sql':_0x2c09e9[_0xfcd6('0x81')]()};})[_0xfcd6('0x23')](respondWithResult(_0x5898fa,null))[_0xfcd6('0x48')](handleError(_0x5898fa,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 8dc386d..685c1c2 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 _0xd129=['exports','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x463683,_0x403c60){var _0x1c7fa1=function(_0x224c11){while(--_0x224c11){_0x463683['push'](_0x463683['shift']());}};_0x1c7fa1(++_0x403c60);}(_0xd129,0x134));var _0x9d12=function(_0x32594b,_0x528a37){_0x32594b=_0x32594b-0x0;var _0x86c97=_0xd129[_0x32594b];return _0x86c97;};'use strict';var _=require(_0x9d12('0x0'));var util=require('util');var logger=require(_0x9d12('0x1'))(_0x9d12('0x2'));var moment=require(_0x9d12('0x3'));var BPromise=require(_0x9d12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d12('0x5'));var rimraf=require(_0x9d12('0x6'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x9d12('0x7')]=function(_0x44df39,_0x4ce38c){return _0x44df39['define']('AnalyticCustomReport',attributes,{'tableName':_0x9d12('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4807=['../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5e7eb1,_0xeac85b){var _0x4a5384=function(_0x3bb51a){while(--_0x3bb51a){_0x5e7eb1['push'](_0x5e7eb1['shift']());}};_0x4a5384(++_0xeac85b);}(_0x4807,0x126));var _0x7480=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4807[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7480('0x0'))(_0x7480('0x1'));var moment=require(_0x7480('0x2'));var BPromise=require(_0x7480('0x3'));var rp=require(_0x7480('0x4'));var fs=require('fs');var path=require(_0x7480('0x5'));var rimraf=require('rimraf');var config=require(_0x7480('0x6'));var attributes=require(_0x7480('0x7'));module[_0x7480('0x8')]=function(_0x549fe3,_0x656342){return _0x549fe3[_0x7480('0x9')](_0x7480('0xa'),attributes,{'tableName':_0x7480('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 5916de3..47b150e 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 _0x9b51=['rpc','../../config/environment','http','request','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x497acd,_0x90d88){var _0xf8e61c=function(_0xf79d5d){while(--_0xf79d5d){_0x497acd['push'](_0x497acd['shift']());}};_0xf8e61c(++_0x90d88);}(_0x9b51,0xf5));var _0x19b5=function(_0x122da1,_0x158e84){_0x122da1=_0x122da1-0x0;var _0x273065=_0x9b51[_0x122da1];return _0x273065;};'use strict';var _=require(_0x19b5('0x0'));var util=require(_0x19b5('0x1'));var moment=require(_0x19b5('0x2'));var BPromise=require(_0x19b5('0x3'));var rs=require(_0x19b5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x19b5('0x5'));var logger=require(_0x19b5('0x6'))(_0x19b5('0x7'));var config=require(_0x19b5('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x19b5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21f004,_0x5b1637,_0x288cc0){return new BPromise(function(_0x28bc5a,_0x1b0ff7){return client[_0x19b5('0xa')](_0x21f004,_0x288cc0)['then'](function(_0x15bba2){logger[_0x19b5('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5b1637,_0x19b5('0xc'));logger[_0x19b5('0xd')](_0x19b5('0xe'),_0x5b1637,_0x19b5('0xc'),JSON[_0x19b5('0xf')](_0x15bba2));if(_0x15bba2[_0x19b5('0x10')]){if(_0x15bba2[_0x19b5('0x10')][_0x19b5('0x11')]===0x1f4){logger[_0x19b5('0x10')](_0x19b5('0x12'),_0x5b1637,_0x15bba2[_0x19b5('0x10')]['message']);return _0x1b0ff7(_0x15bba2[_0x19b5('0x10')][_0x19b5('0x13')]);}logger[_0x19b5('0x10')](_0x19b5('0x12'),_0x5b1637,_0x15bba2[_0x19b5('0x10')][_0x19b5('0x13')]);return _0x28bc5a(_0x15bba2['error'][_0x19b5('0x13')]);}else{logger[_0x19b5('0xb')](_0x19b5('0x12'),_0x5b1637,_0x19b5('0xc'));_0x28bc5a(_0x15bba2['result'][_0x19b5('0x13')]);}})[_0x19b5('0x14')](function(_0x4cd530){logger[_0x19b5('0x10')](_0x19b5('0x12'),_0x5b1637,_0x4cd530);_0x1b0ff7(_0x4cd530);});});}
\ No newline at end of file
+var _0x0d62=['rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xfb0bf9,_0x17b4a8){var _0x440f17=function(_0xf5282){while(--_0xf5282){_0xfb0bf9['push'](_0xfb0bf9['shift']());}};_0x440f17(++_0x17b4a8);}(_0x0d62,0x6f));var _0x20d6=function(_0xd93b26,_0x12bbf2){_0xd93b26=_0xd93b26-0x0;var _0x25f668=_0x0d62[_0xd93b26];return _0x25f668;};'use strict';var _=require(_0x20d6('0x0'));var util=require(_0x20d6('0x1'));var moment=require(_0x20d6('0x2'));var BPromise=require(_0x20d6('0x3'));var rs=require(_0x20d6('0x4'));var fs=require('fs');var Redis=require(_0x20d6('0x5'));var db=require(_0x20d6('0x6'))['db'];var utils=require(_0x20d6('0x7'));var logger=require(_0x20d6('0x8'))(_0x20d6('0x9'));var config=require(_0x20d6('0xa'));var jayson=require(_0x20d6('0xb'));var client=jayson[_0x20d6('0xc')][_0x20d6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3e411a,_0x20c24f,_0x278cb6){return new BPromise(function(_0x4a97cb,_0x1cdad7){return client['request'](_0x3e411a,_0x278cb6)[_0x20d6('0xe')](function(_0x3412e4){logger[_0x20d6('0xf')](_0x20d6('0x10'),_0x20c24f,_0x20d6('0x11'));logger[_0x20d6('0x12')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x20c24f,_0x20d6('0x11'),JSON[_0x20d6('0x13')](_0x3412e4));if(_0x3412e4['error']){if(_0x3412e4['error']['code']===0x1f4){logger[_0x20d6('0x14')](_0x20d6('0x10'),_0x20c24f,_0x3412e4[_0x20d6('0x14')][_0x20d6('0x15')]);return _0x1cdad7(_0x3412e4[_0x20d6('0x14')]['message']);}logger['error'](_0x20d6('0x10'),_0x20c24f,_0x3412e4[_0x20d6('0x14')][_0x20d6('0x15')]);return _0x4a97cb(_0x3412e4[_0x20d6('0x14')][_0x20d6('0x15')]);}else{logger[_0x20d6('0xf')](_0x20d6('0x10'),_0x20c24f,'request\x20sent');_0x4a97cb(_0x3412e4[_0x20d6('0x16')][_0x20d6('0x15')]);}})[_0x20d6('0x17')](function(_0x5db050){logger[_0x20d6('0x14')](_0x20d6('0x10'),_0x20c24f,_0x5db050);_0x1cdad7(_0x5db050);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index db4ac21..2aec7c2 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 _0x9c69=['/:id/query','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','preview','/:id/run','run'];(function(_0x57ed97,_0x149ea){var _0x9cb533=function(_0x5dd737){while(--_0x5dd737){_0x57ed97['push'](_0x57ed97['shift']());}};_0x9cb533(++_0x149ea);}(_0x9c69,0x14a));var _0x99c6=function(_0x23983a,_0x38947d){_0x23983a=_0x23983a-0x0;var _0x127ff1=_0x9c69[_0x23983a];return _0x127ff1;};'use strict';var multer=require(_0x99c6('0x0'));var util=require(_0x99c6('0x1'));var path=require(_0x99c6('0x2'));var timeout=require(_0x99c6('0x3'));var express=require(_0x99c6('0x4'));var router=express[_0x99c6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x99c6('0x6'));var interaction=require(_0x99c6('0x7'));var config=require(_0x99c6('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x99c6('0x9')]('/',auth[_0x99c6('0xa')](),controller['index']);router['get']('/:id',auth[_0x99c6('0xa')](),controller[_0x99c6('0xb')]);router[_0x99c6('0x9')]('/:id/preview',auth[_0x99c6('0xa')](),controller[_0x99c6('0xc')]);router['get'](_0x99c6('0xd'),auth[_0x99c6('0xa')](),controller[_0x99c6('0xe')]);router[_0x99c6('0x9')](_0x99c6('0xf'),auth[_0x99c6('0xa')](),controller['query']);router[_0x99c6('0x10')]('/',auth['isAuthenticated'](),controller[_0x99c6('0x11')]);router[_0x99c6('0x12')](_0x99c6('0x13'),auth[_0x99c6('0xa')](),controller[_0x99c6('0x14')]);router[_0x99c6('0x15')](_0x99c6('0x13'),auth[_0x99c6('0xa')](),controller[_0x99c6('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x51c6=['/:id','show','/:id/preview','preview','/:id/run','run','query','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index'];(function(_0x2afdcd,_0x1cd724){var _0x2b1314=function(_0x4a05d3){while(--_0x4a05d3){_0x2afdcd['push'](_0x2afdcd['shift']());}};_0x2b1314(++_0x1cd724);}(_0x51c6,0x152));var _0x651c=function(_0x440ff1,_0x1e67d1){_0x440ff1=_0x440ff1-0x0;var _0x4b534d=_0x51c6[_0x440ff1];return _0x4b534d;};'use strict';var multer=require(_0x651c('0x0'));var util=require(_0x651c('0x1'));var path=require(_0x651c('0x2'));var timeout=require(_0x651c('0x3'));var express=require(_0x651c('0x4'));var router=express[_0x651c('0x5')]();var fs_extra=require(_0x651c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x651c('0x7'));var config=require('../../config/environment');var controller=require(_0x651c('0x8'));router[_0x651c('0x9')]('/',auth[_0x651c('0xa')](),controller[_0x651c('0xb')]);router[_0x651c('0x9')](_0x651c('0xc'),auth[_0x651c('0xa')](),controller[_0x651c('0xd')]);router[_0x651c('0x9')](_0x651c('0xe'),auth[_0x651c('0xa')](),controller[_0x651c('0xf')]);router[_0x651c('0x9')](_0x651c('0x10'),auth['isAuthenticated'](),controller[_0x651c('0x11')]);router[_0x651c('0x9')]('/:id/query',auth[_0x651c('0xa')](),controller[_0x651c('0x12')]);router[_0x651c('0x13')]('/',auth[_0x651c('0xa')](),controller[_0x651c('0x14')]);router[_0x651c('0x15')](_0x651c('0xc'),auth[_0x651c('0xa')](),controller[_0x651c('0x16')]);router[_0x651c('0x17')](_0x651c('0xc'),auth['isAuthenticated'](),controller[_0x651c('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index bcd5b1c..f5f28b7 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 _0x4819=['TEXT','exports','STRING'];(function(_0x16bb4b,_0x5fe431){var _0x8aeb84=function(_0x36ba6e){while(--_0x36ba6e){_0x16bb4b['push'](_0x16bb4b['shift']());}};_0x8aeb84(++_0x5fe431);}(_0x4819,0xcd));var _0x9481=function(_0x4df671,_0x12b67f){_0x4df671=_0x4df671-0x0;var _0x3f9658=_0x4819[_0x4df671];return _0x3f9658;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}};
\ No newline at end of file
+var _0xc4aa=['STRING','sequelize','exports'];(function(_0xd38274,_0x2cc06e){var _0x37cc67=function(_0x20cea5){while(--_0x20cea5){_0xd38274['push'](_0xd38274['shift']());}};_0x37cc67(++_0x2cc06e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc4aa[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'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 3134b3a..5b3c286 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(_0x488e86,_0x4acf5e){var _0x2c94c3=function(_0x6647f){while(--_0x6647f){_0x488e86['push'](_0x488e86['shift']());}};_0x2c94c3(++_0x4acf5e);}(_0x1261,0x144));var _0x1126=function(_0x14915a,_0x222f6b){_0x14915a=_0x14915a-0x0;var _0x2f683c=_0x1261[_0x14915a];return _0x2f683c;};'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 _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x40ff3c,_0x1c6580){var _0x16e888=function(_0x1d472f){while(--_0x1d472f){_0x40ff3c['push'](_0x40ff3c['shift']());}};_0x16e888(++_0x1c6580);}(_0x2675,0x75));var _0x5267=function(_0x29c915,_0x3def05){_0x29c915=_0x29c915-0x0;var _0x1b33a6=_0x2675[_0x29c915];return _0x1b33a6;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index a04da64..7f9bd69 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 _0x7027=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','util'];(function(_0x190349,_0x5b508e){var _0x1a236c=function(_0x4b1e56){while(--_0x4b1e56){_0x190349['push'](_0x190349['shift']());}};_0x1a236c(++_0x5b508e);}(_0x7027,0x1af));var _0x7702=function(_0x1076ae,_0x4da4e1){_0x1076ae=_0x1076ae-0x0;var _0x263108=_0x7027[_0x1076ae];return _0x263108;};'use strict';var _=require('lodash');var util=require(_0x7702('0x0'));var logger=require('../../config/logger')(_0x7702('0x1'));var moment=require(_0x7702('0x2'));var BPromise=require(_0x7702('0x3'));var rp=require(_0x7702('0x4'));var fs=require('fs');var path=require(_0x7702('0x5'));var rimraf=require(_0x7702('0x6'));var config=require(_0x7702('0x7'));var attributes=require(_0x7702('0x8'));module[_0x7702('0x9')]=function(_0xb07ec4,_0x1aa36a){return _0xb07ec4[_0x7702('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x7702('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd3e2=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xd3e2,0x196));var _0x2d3e=function(_0x4475ad,_0x322373){_0x4475ad=_0x4475ad-0x0;var _0x414539=_0xd3e2[_0x4475ad];return _0x414539;};'use strict';var _=require(_0x2d3e('0x0'));var util=require(_0x2d3e('0x1'));var logger=require(_0x2d3e('0x2'))(_0x2d3e('0x3'));var moment=require(_0x2d3e('0x4'));var BPromise=require(_0x2d3e('0x5'));var rp=require(_0x2d3e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d3e('0x7'));var config=require(_0x2d3e('0x8'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x5aa4c5,_0x3e5642){return _0x5aa4c5['define'](_0x2d3e('0x9'),attributes,{'tableName':_0x2d3e('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 bdaf87d..c9a4799 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 _0xf5cc=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','then','info','debug'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xf5cc,0x127));var _0xcf5c=function(_0x571c1d,_0x3b0586){_0x571c1d=_0x571c1d-0x0;var _0x33c609=_0xf5cc[_0x571c1d];return _0x33c609;};'use strict';var _=require('lodash');var util=require(_0xcf5c('0x0'));var moment=require(_0xcf5c('0x1'));var BPromise=require(_0xcf5c('0x2'));var rs=require(_0xcf5c('0x3'));var fs=require('fs');var Redis=require(_0xcf5c('0x4'));var db=require(_0xcf5c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcf5c('0x6'));var client=jayson[_0xcf5c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x263938,_0xbf6e20,_0x407c0c){return new BPromise(function(_0x26c5ca,_0x3f7d64){return client['request'](_0x263938,_0x407c0c)[_0xcf5c('0x8')](function(_0x26607c){logger[_0xcf5c('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xbf6e20,'request\x20sent');logger[_0xcf5c('0xa')](_0xcf5c('0xb'),_0xbf6e20,_0xcf5c('0xc'),JSON['stringify'](_0x26607c));if(_0x26607c[_0xcf5c('0xd')]){if(_0x26607c[_0xcf5c('0xd')][_0xcf5c('0xe')]===0x1f4){logger[_0xcf5c('0xd')](_0xcf5c('0xf'),_0xbf6e20,_0x26607c[_0xcf5c('0xd')][_0xcf5c('0x10')]);return _0x3f7d64(_0x26607c[_0xcf5c('0xd')]['message']);}logger[_0xcf5c('0xd')](_0xcf5c('0xf'),_0xbf6e20,_0x26607c[_0xcf5c('0xd')][_0xcf5c('0x10')]);return _0x26c5ca(_0x26607c['error'][_0xcf5c('0x10')]);}else{logger[_0xcf5c('0x9')](_0xcf5c('0xf'),_0xbf6e20,_0xcf5c('0xc'));_0x26c5ca(_0x26607c[_0xcf5c('0x11')]['message']);}})['catch'](function(_0x4e9817){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0xbf6e20,_0x4e9817);_0x3f7d64(_0x4e9817);});});}
\ No newline at end of file
+var _0x058f=['then','info','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x1d3026,_0x4960f3){var _0x2777c6=function(_0x540052){while(--_0x540052){_0x1d3026['push'](_0x1d3026['shift']());}};_0x2777c6(++_0x4960f3);}(_0x058f,0x1ee));var _0xf058=function(_0x25cef5,_0x495238){_0x25cef5=_0x25cef5-0x0;var _0x2ae4a4=_0x058f[_0x25cef5];return _0x2ae4a4;};'use strict';var _=require(_0xf058('0x0'));var util=require('util');var moment=require(_0xf058('0x1'));var BPromise=require(_0xf058('0x2'));var rs=require(_0xf058('0x3'));var fs=require('fs');var Redis=require(_0xf058('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf058('0x5'));var logger=require(_0xf058('0x6'))(_0xf058('0x7'));var config=require(_0xf058('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf058('0x9')][_0xf058('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30f253,_0x218227,_0x35b488){return new BPromise(function(_0x4893c0,_0x1961ad){return client[_0xf058('0xb')](_0x30f253,_0x35b488)[_0xf058('0xc')](function(_0x4b4ae1){logger[_0xf058('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x218227,'request\x20sent');logger[_0xf058('0xe')](_0xf058('0xf'),_0x218227,_0xf058('0x10'),JSON[_0xf058('0x11')](_0x4b4ae1));if(_0x4b4ae1[_0xf058('0x12')]){if(_0x4b4ae1[_0xf058('0x12')]['code']===0x1f4){logger[_0xf058('0x12')](_0xf058('0x13'),_0x218227,_0x4b4ae1[_0xf058('0x12')][_0xf058('0x14')]);return _0x1961ad(_0x4b4ae1['error'][_0xf058('0x14')]);}logger[_0xf058('0x12')](_0xf058('0x13'),_0x218227,_0x4b4ae1[_0xf058('0x12')]['message']);return _0x4893c0(_0x4b4ae1[_0xf058('0x12')][_0xf058('0x14')]);}else{logger['info'](_0xf058('0x13'),_0x218227,'request\x20sent');_0x4893c0(_0x4b4ae1['result'][_0xf058('0x14')]);}})[_0xf058('0x15')](function(_0x33e9bb){logger[_0xf058('0x12')](_0xf058('0x13'),_0x218227,_0x33e9bb);_0x1961ad(_0x33e9bb);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 36e6a57..6de040d 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 _0x68fb=['put','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create'];(function(_0x5749fa,_0x57f51e){var _0x2ffe02=function(_0xb18855){while(--_0xb18855){_0x5749fa['push'](_0x5749fa['shift']());}};_0x2ffe02(++_0x57f51e);}(_0x68fb,0x1d1));var _0xb68f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x68fb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xb68f('0x0'));var path=require('path');var timeout=require(_0xb68f('0x1'));var express=require('express');var router=express[_0xb68f('0x2')]();var fs_extra=require(_0xb68f('0x3'));var auth=require(_0xb68f('0x4'));var interaction=require(_0xb68f('0x5'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xb68f('0x6')]('/',auth[_0xb68f('0x7')](),controller[_0xb68f('0x8')]);router[_0xb68f('0x6')](_0xb68f('0x9'),auth[_0xb68f('0x7')](),controller[_0xb68f('0xa')]);router[_0xb68f('0x6')](_0xb68f('0xb'),auth[_0xb68f('0x7')](),controller[_0xb68f('0xc')]);router[_0xb68f('0x6')](_0xb68f('0xd'),auth[_0xb68f('0x7')](),controller[_0xb68f('0xe')]);router['get'](_0xb68f('0xf'),auth[_0xb68f('0x7')](),controller[_0xb68f('0x10')]);router[_0xb68f('0x11')]('/',auth[_0xb68f('0x7')](),controller[_0xb68f('0x12')]);router[_0xb68f('0x13')](_0xb68f('0x9'),auth[_0xb68f('0x7')](),controller['update']);router[_0xb68f('0x14')](_0xb68f('0x9'),auth[_0xb68f('0x7')](),controller['destroy']);module[_0xb68f('0x15')]=router;
\ No newline at end of file
+var _0xf6e9=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','query','post','create','update','delete','exports','multer'];(function(_0x19a4ac,_0x5d763d){var _0x8f3876=function(_0x26047d){while(--_0x26047d){_0x19a4ac['push'](_0x19a4ac['shift']());}};_0x8f3876(++_0x5d763d);}(_0xf6e9,0x137));var _0x9f6e=function(_0x347e8a,_0x2921ad){_0x347e8a=_0x347e8a-0x0;var _0x2d2354=_0xf6e9[_0x347e8a];return _0x2d2354;};'use strict';var multer=require(_0x9f6e('0x0'));var util=require('util');var path=require(_0x9f6e('0x1'));var timeout=require(_0x9f6e('0x2'));var express=require(_0x9f6e('0x3'));var router=express[_0x9f6e('0x4')]();var fs_extra=require(_0x9f6e('0x5'));var auth=require(_0x9f6e('0x6'));var interaction=require(_0x9f6e('0x7'));var config=require('../../config/environment');var controller=require(_0x9f6e('0x8'));router[_0x9f6e('0x9')]('/',auth['isAuthenticated'](),controller[_0x9f6e('0xa')]);router[_0x9f6e('0x9')](_0x9f6e('0xb'),auth[_0x9f6e('0xc')](),controller[_0x9f6e('0xd')]);router[_0x9f6e('0x9')](_0x9f6e('0xe'),auth[_0x9f6e('0xc')](),controller[_0x9f6e('0xf')]);router[_0x9f6e('0x9')](_0x9f6e('0x10'),auth['isAuthenticated'](),controller[_0x9f6e('0x11')]);router[_0x9f6e('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0x9f6e('0x12')]);router[_0x9f6e('0x13')]('/',auth[_0x9f6e('0xc')](),controller[_0x9f6e('0x14')]);router['put'](_0x9f6e('0xb'),auth[_0x9f6e('0xc')](),controller[_0x9f6e('0x15')]);router[_0x9f6e('0x16')]('/:id',auth[_0x9f6e('0xc')](),controller['destroy']);module[_0x9f6e('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 5a983fc..1ca1118 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 _0x156b=['manual','scheduled','INTEGER','sequelize','moment','exports','STRING','csv','pdf','DATE','Loading','ENUM'];(function(_0x2142f0,_0x4ffea8){var _0x573b7f=function(_0x3c9853){while(--_0x3c9853){_0x2142f0['push'](_0x2142f0['shift']());}};_0x573b7f(++_0x4ffea8);}(_0x156b,0x87));var _0xb156=function(_0x1a1131,_0x404e25){_0x1a1131=_0x1a1131-0x0;var _0x2a73ee=_0x156b[_0x1a1131];return _0x2a73ee;};'use strict';var Sequelize=require(_0xb156('0x0'));var moment=require(_0xb156('0x1'));module[_0xb156('0x2')]={'name':{'type':Sequelize[_0xb156('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xb156('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xb156('0x4'),_0xb156('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0xb156('0x4')},'savename':{'type':Sequelize[_0xb156('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xb156('0x6')]},'endDate':{'type':Sequelize[_0xb156('0x6')]},'status':{'type':Sequelize[_0xb156('0x3')],'defaultValue':_0xb156('0x7')},'type':{'type':Sequelize[_0xb156('0x8')](_0xb156('0x9'),_0xb156('0xa')),'allowNull':![],'defaultValue':_0xb156('0x9')},'reportId':{'type':Sequelize[_0xb156('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xb156('0x3')]}};
\ No newline at end of file
+var _0x2dc1=['moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize'];(function(_0x2325fe,_0x49c18a){var _0x2955cf=function(_0x2d3600){while(--_0x2d3600){_0x2325fe['push'](_0x2325fe['shift']());}};_0x2955cf(++_0x49c18a);}(_0x2dc1,0x7d));var _0x12dc=function(_0x5ce850,_0x28bfe5){_0x5ce850=_0x5ce850-0x0;var _0x12753a=_0x2dc1[_0x5ce850];return _0x12753a;};'use strict';var Sequelize=require(_0x12dc('0x0'));var moment=require(_0x12dc('0x1'));module[_0x12dc('0x2')]={'name':{'type':Sequelize[_0x12dc('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x12dc('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x12dc('0x4')](_0x12dc('0x5'),_0x12dc('0x6'),_0x12dc('0x7')),'allowNull':![],'defaultValue':_0x12dc('0x5')},'savename':{'type':Sequelize[_0x12dc('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x12dc('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x12dc('0x3')],'defaultValue':_0x12dc('0x9')},'type':{'type':Sequelize[_0x12dc('0x4')](_0x12dc('0xa'),_0x12dc('0xb')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x12dc('0xc')](0xb)[_0x12dc('0xd')]},'reportType':{'type':Sequelize[_0x12dc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 99e8a9c..303304f 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 _0x1daf=['apply','reject','save','destroy','then','get','ExtractedReports','UserProfileResource','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','show','params','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','update','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','../../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','undefined','limit','count','offset','Content-Range','json'];(function(_0x2597cc,_0x40b415){var _0xaa509f=function(_0x121adf){while(--_0x121adf){_0x2597cc['push'](_0x2597cc['shift']());}};_0xaa509f(++_0x40b415);}(_0x1daf,0xa0));var _0xf1da=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1daf[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xf1da('0x0'));var rimraf=require(_0xf1da('0x1'));var zipdir=require(_0xf1da('0x2'));var jsonpatch=require(_0xf1da('0x3'));var rp=require(_0xf1da('0x4'));var moment=require(_0xf1da('0x5'));var BPromise=require(_0xf1da('0x6'));var Mustache=require(_0xf1da('0x7'));var util=require('util');var path=require(_0xf1da('0x8'));var sox=require(_0xf1da('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf1da('0xa'));var _=require(_0xf1da('0xb'));var squel=require('squel');var crypto=require(_0xf1da('0xc'));var jsforce=require(_0xf1da('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf1da('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf1da('0xf'));var qs=require(_0xf1da('0x10'));var as=require(_0xf1da('0x11'));var hardwareService=require(_0xf1da('0x12'));var logger=require(_0xf1da('0x13'))(_0xf1da('0x14'));var utils=require(_0xf1da('0x15'));var config=require(_0xf1da('0x16'));var licenseUtil=require(_0xf1da('0x17'));var db=require(_0xf1da('0x18'))['db'];function respondWithStatusCode(_0x17f470,_0x5a71e5){_0x5a71e5=_0x5a71e5||0xcc;return function(_0x2d5aee){if(_0x2d5aee){return _0x17f470[_0xf1da('0x19')](_0x5a71e5);}return _0x17f470[_0xf1da('0x1a')](_0x5a71e5)[_0xf1da('0x1b')]();};}function respondWithResult(_0x1944ce,_0x2e46f4){_0x2e46f4=_0x2e46f4||0xc8;return function(_0x329515){if(_0x329515){return _0x1944ce[_0xf1da('0x1a')](_0x2e46f4)['json'](_0x329515);}};}function respondWithFilteredResult(_0x1f3222,_0x14afb6){return function(_0x511ce7){if(_0x511ce7){var _0x4af491=typeof _0x14afb6['offset']===_0xf1da('0x1c')&&typeof _0x14afb6[_0xf1da('0x1d')]==='undefined';var _0x504b40=_0x511ce7[_0xf1da('0x1e')];var _0x3b1a0c=_0x4af491?0x0:_0x14afb6[_0xf1da('0x1f')];var _0x5e444b=_0x4af491?_0x511ce7['count']:_0x14afb6['offset']+_0x14afb6[_0xf1da('0x1d')];var _0x23ca7a;if(_0x5e444b>=_0x504b40){_0x5e444b=_0x504b40;_0x23ca7a=0xc8;}else{_0x23ca7a=0xce;}_0x1f3222[_0xf1da('0x1a')](_0x23ca7a);return _0x1f3222['set'](_0xf1da('0x20'),_0x3b1a0c+'-'+_0x5e444b+'/'+_0x504b40)[_0xf1da('0x21')](_0x511ce7);}return null;};}function patchUpdates(_0x5eaf15){return function(_0x34e8bd){try{jsonpatch[_0xf1da('0x22')](_0x34e8bd,_0x5eaf15,!![]);}catch(_0x4c5f4a){return BPromise[_0xf1da('0x23')](_0x4c5f4a);}return _0x34e8bd[_0xf1da('0x24')]();};}function saveUpdates(_0x1050c1,_0x46c0bd){return function(_0x111903){if(_0x111903){return _0x111903['update'](_0x1050c1)['then'](function(_0x5c7510){return _0x5c7510;});}return null;};}function removeEntity(_0x52cb0c,_0x411599){return function(_0x57e242){if(_0x57e242){return _0x57e242[_0xf1da('0x25')]()[_0xf1da('0x26')](function(){var _0x529853=_0x57e242[_0xf1da('0x27')]({'plain':!![]});var _0x109844=_0xf1da('0x28');return db[_0xf1da('0x29')][_0xf1da('0x25')]({'where':{'type':_0x109844,'resourceId':_0x529853['id']}})[_0xf1da('0x26')](function(){return _0x57e242;});})[_0xf1da('0x26')](function(){_0x52cb0c['status'](0xcc)[_0xf1da('0x1b')]();});}};}function handleEntityNotFound(_0x38407b,_0x2a7ad1){return function(_0x4af31d){if(!_0x4af31d){_0x38407b[_0xf1da('0x19')](0x194);}return _0x4af31d;};}function handleError(_0x166297,_0x4ae60e){_0x4ae60e=_0x4ae60e||0x1f4;return function(_0x5be13e){logger[_0xf1da('0x2a')](_0x5be13e['stack']);if(_0x5be13e[_0xf1da('0x2b')]){delete _0x5be13e[_0xf1da('0x2b')];}_0x166297[_0xf1da('0x1a')](_0x4ae60e)['send'](_0x5be13e);};}exports[_0xf1da('0x2c')]=function(_0x507b25,_0x23ca4e){var _0x4b667f={},_0xc09377={},_0x497e41={'count':0x0,'rows':[]};var _0xab71b=_[_0xf1da('0x2d')](db['AnalyticExtractedReport'][_0xf1da('0x2e')],function(_0x243e35){return{'name':_0x243e35[_0xf1da('0x2f')],'type':_0x243e35[_0xf1da('0x30')][_0xf1da('0x31')]};});_0xc09377[_0xf1da('0x32')]=_[_0xf1da('0x2d')](_0xab71b,_0xf1da('0x2b'));_0xc09377[_0xf1da('0x33')]=_[_0xf1da('0x34')](_0x507b25[_0xf1da('0x33')]);_0xc09377[_0xf1da('0x35')]=_[_0xf1da('0x36')](_0xc09377['model'],_0xc09377[_0xf1da('0x33')]);_0x4b667f[_0xf1da('0x37')]=_['intersection'](_0xc09377['model'],qs[_0xf1da('0x38')](_0x507b25[_0xf1da('0x33')][_0xf1da('0x38')]));_0x4b667f[_0xf1da('0x37')]=_0x4b667f[_0xf1da('0x37')]['length']?_0x4b667f[_0xf1da('0x37')]:_0xc09377[_0xf1da('0x32')];if(!_0x507b25[_0xf1da('0x33')][_0xf1da('0x39')](_0xf1da('0x3a'))){_0x4b667f[_0xf1da('0x1d')]=qs['limit'](_0x507b25['query'][_0xf1da('0x1d')]);_0x4b667f[_0xf1da('0x1f')]=qs[_0xf1da('0x1f')](_0x507b25[_0xf1da('0x33')][_0xf1da('0x1f')]);}_0x4b667f[_0xf1da('0x3b')]=qs[_0xf1da('0x3c')](_0x507b25[_0xf1da('0x33')][_0xf1da('0x3c')]);_0x4b667f[_0xf1da('0x3d')]=qs[_0xf1da('0x35')](_['pick'](_0x507b25[_0xf1da('0x33')],_0xc09377[_0xf1da('0x35')]),_0xab71b);if(_0x507b25[_0xf1da('0x33')][_0xf1da('0x3e')]){_0x4b667f['where']=_[_0xf1da('0x3f')](_0x4b667f['where'],{'$or':_[_0xf1da('0x2d')](_0xab71b,function(_0x479720){if(_0x479720['type']!==_0xf1da('0x40')){var _0x3bee35={};_0x3bee35[_0x479720['name']]={'$like':'%'+_0x507b25['query'][_0xf1da('0x3e')]+'%'};return _0x3bee35;}})});}_0x4b667f=_[_0xf1da('0x3f')]({},_0x4b667f,_0x507b25['options']);var _0x475b3c={'where':_0x4b667f['where']};return db[_0xf1da('0x41')]['count'](_0x475b3c)['then'](function(_0xbf0f){_0x497e41['count']=_0xbf0f;if(_0x507b25[_0xf1da('0x33')][_0xf1da('0x42')]){_0x4b667f[_0xf1da('0x43')]=[{'all':!![]}];}return db[_0xf1da('0x41')][_0xf1da('0x44')](_0x4b667f);})['then'](function(_0x48a5d0){_0x497e41[_0xf1da('0x45')]=_0x48a5d0;return _0x497e41;})[_0xf1da('0x26')](respondWithFilteredResult(_0x23ca4e,_0x4b667f))[_0xf1da('0x46')](handleError(_0x23ca4e,null));};exports[_0xf1da('0x47')]=function(_0x6407b5,_0x2e0c35){var _0x316949={'raw':!![],'where':{'id':_0x6407b5[_0xf1da('0x48')]['id']}},_0x5a7070={};_0x5a7070[_0xf1da('0x32')]=_[_0xf1da('0x34')](db[_0xf1da('0x41')][_0xf1da('0x2e')]);_0x5a7070[_0xf1da('0x33')]=_[_0xf1da('0x34')](_0x6407b5[_0xf1da('0x33')]);_0x5a7070[_0xf1da('0x35')]=_[_0xf1da('0x36')](_0x5a7070[_0xf1da('0x32')],_0x5a7070[_0xf1da('0x33')]);_0x316949[_0xf1da('0x37')]=_[_0xf1da('0x36')](_0x5a7070[_0xf1da('0x32')],qs[_0xf1da('0x38')](_0x6407b5[_0xf1da('0x33')]['fields']));_0x316949[_0xf1da('0x37')]=_0x316949['attributes'][_0xf1da('0x49')]?_0x316949[_0xf1da('0x37')]:_0x5a7070[_0xf1da('0x32')];if(_0x6407b5['query']['includeAll']){_0x316949[_0xf1da('0x43')]=[{'all':!![]}];}_0x316949=_[_0xf1da('0x3f')]({},_0x316949,_0x6407b5['options']);return db[_0xf1da('0x41')][_0xf1da('0x4a')](_0x316949)[_0xf1da('0x26')](handleEntityNotFound(_0x2e0c35,null))[_0xf1da('0x26')](respondWithResult(_0x2e0c35,null))[_0xf1da('0x46')](handleError(_0x2e0c35,null));};exports['create']=function(_0x25f90b,_0x5d8739){return db[_0xf1da('0x41')]['create'](_0x25f90b[_0xf1da('0x4b')],{})[_0xf1da('0x26')](function(_0x6d798){var _0x4e5540=_0x25f90b[_0xf1da('0x4c')][_0xf1da('0x27')]({'plain':!![]});if(!_0x4e5540)throw new Error(_0xf1da('0x4d'));if(_0x4e5540[_0xf1da('0x4e')]===_0xf1da('0x4c')){var _0x24c714=_0x6d798['get']({'plain':!![]});var _0x1bf52a='ExtractedReports';return db[_0xf1da('0x4f')][_0xf1da('0x4a')]({'where':{'name':_0x1bf52a,'userProfileId':_0x4e5540['userProfileId']},'raw':!![]})[_0xf1da('0x26')](function(_0x22bfbd){if(_0x22bfbd&&_0x22bfbd['autoAssociation']===0x0){return db[_0xf1da('0x29')][_0xf1da('0x50')]({'name':_0x24c714[_0xf1da('0x2b')],'resourceId':_0x24c714['id'],'type':_0x22bfbd[_0xf1da('0x2b')],'sectionId':_0x22bfbd['id']},{})[_0xf1da('0x26')](function(){return _0x6d798;});}else{return _0x6d798;}})[_0xf1da('0x46')](function(_0x187672){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x187672);throw _0x187672;});}return _0x6d798;})[_0xf1da('0x26')](respondWithResult(_0x5d8739,0xc9))['catch'](handleError(_0x5d8739,null));};exports[_0xf1da('0x51')]=function(_0x24ef7a,_0x3336ee){if(_0x24ef7a['body']['id']){delete _0x24ef7a[_0xf1da('0x4b')]['id'];}return db[_0xf1da('0x41')]['find']({'where':{'id':_0x24ef7a[_0xf1da('0x48')]['id']}})[_0xf1da('0x26')](handleEntityNotFound(_0x3336ee,null))[_0xf1da('0x26')](saveUpdates(_0x24ef7a[_0xf1da('0x4b')],null))[_0xf1da('0x26')](respondWithResult(_0x3336ee,null))[_0xf1da('0x46')](handleError(_0x3336ee,null));};exports[_0xf1da('0x25')]=function(_0x3b85dd,_0x3e46c2){return db[_0xf1da('0x41')][_0xf1da('0x4a')]({'where':{'id':_0x3b85dd[_0xf1da('0x48')]['id']}})[_0xf1da('0x26')](handleEntityNotFound(_0x3e46c2,null))['then'](removeEntity(_0x3e46c2,null))['catch'](handleError(_0x3e46c2,null));};exports[_0xf1da('0x52')]=function(_0x549482,_0x254dcb,_0x77874e){return db[_0xf1da('0x41')][_0xf1da('0x4a')]({'where':{'id':_0x549482['params']['id']},'attributes':[_0xf1da('0x2b'),_0xf1da('0x53'),_0xf1da('0x54'),_0xf1da('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x254dcb,null))['then'](function(_0x197d4e){if(_0x197d4e){if(!fs[_0xf1da('0x56')](path[_0xf1da('0x57')](config[_0xf1da('0x58')],_0xf1da('0x59'),_0x197d4e[_0xf1da('0x54')]))){throw new db[(_0xf1da('0x5a'))][(_0xf1da('0x5b'))](_0xf1da('0x5c'));}if(_0x549482[_0xf1da('0x33')][_0xf1da('0x5d')]){return _0x254dcb[_0xf1da('0x19')](0xc8);}return _0x254dcb[_0xf1da('0x52')](path[_0xf1da('0x57')](config[_0xf1da('0x58')],_0xf1da('0x59'),_0x197d4e[_0xf1da('0x54')]),util[_0xf1da('0x5e')](_0xf1da('0x5f'),_0x197d4e[_0xf1da('0x53')]||_0x197d4e[_0xf1da('0x2b')],_0x197d4e['output'][_0xf1da('0x60')]()));}})[_0xf1da('0x46')](handleError(_0x254dcb,null));};
\ No newline at end of file
+var _0xbc08=['mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','sendStatus','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x18674c,_0x3c40f7){var _0x3dc010=function(_0x406283){while(--_0x406283){_0x18674c['push'](_0x18674c['shift']());}};_0x3dc010(++_0x3c40f7);}(_0xbc08,0x169));var _0x8bc0=function(_0x5e92b7,_0x47623){_0x5e92b7=_0x5e92b7-0x0;var _0x2554d0=_0xbc08[_0x5e92b7];return _0x2554d0;};'use strict';var emlformat=require(_0x8bc0('0x0'));var rimraf=require(_0x8bc0('0x1'));var zipdir=require(_0x8bc0('0x2'));var jsonpatch=require(_0x8bc0('0x3'));var rp=require(_0x8bc0('0x4'));var moment=require(_0x8bc0('0x5'));var BPromise=require(_0x8bc0('0x6'));var Mustache=require(_0x8bc0('0x7'));var util=require(_0x8bc0('0x8'));var path=require(_0x8bc0('0x9'));var sox=require('sox');var csv=require(_0x8bc0('0xa'));var ejs=require(_0x8bc0('0xb'));var fs=require('fs');var fs_extra=require(_0x8bc0('0xc'));var _=require(_0x8bc0('0xd'));var squel=require('squel');var crypto=require(_0x8bc0('0xe'));var jsforce=require(_0x8bc0('0xf'));var deskjs=require(_0x8bc0('0x10'));var toCsv=require(_0x8bc0('0xa'));var querystring=require(_0x8bc0('0x11'));var Papa=require(_0x8bc0('0x12'));var Redis=require('ioredis');var authService=require(_0x8bc0('0x13'));var qs=require(_0x8bc0('0x14'));var as=require(_0x8bc0('0x15'));var hardwareService=require(_0x8bc0('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8bc0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8bc0('0x18'))['db'];function respondWithStatusCode(_0x90e162,_0x552f53){_0x552f53=_0x552f53||0xcc;return function(_0x26178b){if(_0x26178b){return _0x90e162['sendStatus'](_0x552f53);}return _0x90e162[_0x8bc0('0x19')](_0x552f53)['end']();};}function respondWithResult(_0x46d02a,_0x1f6a35){_0x1f6a35=_0x1f6a35||0xc8;return function(_0xd70b16){if(_0xd70b16){return _0x46d02a[_0x8bc0('0x19')](_0x1f6a35)[_0x8bc0('0x1a')](_0xd70b16);}};}function respondWithFilteredResult(_0x47ef90,_0x210d2f){return function(_0x49f9ee){if(_0x49f9ee){var _0x47f35a=typeof _0x210d2f['offset']===_0x8bc0('0x1b')&&typeof _0x210d2f[_0x8bc0('0x1c')]===_0x8bc0('0x1b');var _0x6b117=_0x49f9ee['count'];var _0x278da4=_0x47f35a?0x0:_0x210d2f[_0x8bc0('0x1d')];var _0x1a920f=_0x47f35a?_0x49f9ee[_0x8bc0('0x1e')]:_0x210d2f[_0x8bc0('0x1d')]+_0x210d2f[_0x8bc0('0x1c')];var _0x56f365;if(_0x1a920f>=_0x6b117){_0x1a920f=_0x6b117;_0x56f365=0xc8;}else{_0x56f365=0xce;}_0x47ef90[_0x8bc0('0x19')](_0x56f365);return _0x47ef90[_0x8bc0('0x1f')]('Content-Range',_0x278da4+'-'+_0x1a920f+'/'+_0x6b117)[_0x8bc0('0x1a')](_0x49f9ee);}return null;};}function patchUpdates(_0x324268){return function(_0x53d5a6){try{jsonpatch[_0x8bc0('0x20')](_0x53d5a6,_0x324268,!![]);}catch(_0x3c476b){return BPromise[_0x8bc0('0x21')](_0x3c476b);}return _0x53d5a6[_0x8bc0('0x22')]();};}function saveUpdates(_0x29138f,_0x15520f){return function(_0x1ca1dc){if(_0x1ca1dc){return _0x1ca1dc['update'](_0x29138f)[_0x8bc0('0x23')](function(_0x53c25f){return _0x53c25f;});}return null;};}function removeEntity(_0xb8e545,_0x3b177f){return function(_0x3bd98d){if(_0x3bd98d){return _0x3bd98d[_0x8bc0('0x24')]()[_0x8bc0('0x23')](function(){var _0x4c73d6=_0x3bd98d['get']({'plain':!![]});var _0x470197=_0x8bc0('0x25');return db[_0x8bc0('0x26')][_0x8bc0('0x24')]({'where':{'type':_0x470197,'resourceId':_0x4c73d6['id']}})['then'](function(){return _0x3bd98d;});})[_0x8bc0('0x23')](function(){_0xb8e545[_0x8bc0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xea013b,_0x368fdc){return function(_0x3a27ec){if(!_0x3a27ec){_0xea013b['sendStatus'](0x194);}return _0x3a27ec;};}function handleError(_0x5cc47d,_0x35551d){_0x35551d=_0x35551d||0x1f4;return function(_0x300368){logger[_0x8bc0('0x27')](_0x300368[_0x8bc0('0x28')]);if(_0x300368[_0x8bc0('0x29')]){delete _0x300368['name'];}_0x5cc47d[_0x8bc0('0x19')](_0x35551d)[_0x8bc0('0x2a')](_0x300368);};}exports[_0x8bc0('0x2b')]=function(_0x5d2778,_0x2b8ba0){var _0x534bf6={},_0x53057f={},_0x46a69d={'count':0x0,'rows':[]};var _0x41ba43=_[_0x8bc0('0x2c')](db[_0x8bc0('0x2d')]['rawAttributes'],function(_0x2b9958){return{'name':_0x2b9958[_0x8bc0('0x2e')],'type':_0x2b9958['type'][_0x8bc0('0x2f')]};});_0x53057f[_0x8bc0('0x30')]=_[_0x8bc0('0x2c')](_0x41ba43,'name');_0x53057f[_0x8bc0('0x31')]=_[_0x8bc0('0x32')](_0x5d2778[_0x8bc0('0x31')]);_0x53057f[_0x8bc0('0x33')]=_[_0x8bc0('0x34')](_0x53057f['model'],_0x53057f['query']);_0x534bf6[_0x8bc0('0x35')]=_['intersection'](_0x53057f[_0x8bc0('0x30')],qs[_0x8bc0('0x36')](_0x5d2778['query'][_0x8bc0('0x36')]));_0x534bf6[_0x8bc0('0x35')]=_0x534bf6[_0x8bc0('0x35')][_0x8bc0('0x37')]?_0x534bf6[_0x8bc0('0x35')]:_0x53057f[_0x8bc0('0x30')];if(!_0x5d2778['query'][_0x8bc0('0x38')](_0x8bc0('0x39'))){_0x534bf6['limit']=qs[_0x8bc0('0x1c')](_0x5d2778[_0x8bc0('0x31')][_0x8bc0('0x1c')]);_0x534bf6['offset']=qs['offset'](_0x5d2778['query'][_0x8bc0('0x1d')]);}_0x534bf6[_0x8bc0('0x3a')]=qs[_0x8bc0('0x3b')](_0x5d2778[_0x8bc0('0x31')][_0x8bc0('0x3b')]);_0x534bf6[_0x8bc0('0x3c')]=qs[_0x8bc0('0x33')](_['pick'](_0x5d2778[_0x8bc0('0x31')],_0x53057f['filters']),_0x41ba43);if(_0x5d2778['query'][_0x8bc0('0x3d')]){_0x534bf6[_0x8bc0('0x3c')]=_[_0x8bc0('0x3e')](_0x534bf6[_0x8bc0('0x3c')],{'$or':_['map'](_0x41ba43,function(_0x2348d0){if(_0x2348d0[_0x8bc0('0x3f')]!==_0x8bc0('0x40')){var _0x2f9fc5={};_0x2f9fc5[_0x2348d0[_0x8bc0('0x29')]]={'$like':'%'+_0x5d2778[_0x8bc0('0x31')][_0x8bc0('0x3d')]+'%'};return _0x2f9fc5;}})});}_0x534bf6=_[_0x8bc0('0x3e')]({},_0x534bf6,_0x5d2778['options']);var _0x1b62d0={'where':_0x534bf6[_0x8bc0('0x3c')]};return db[_0x8bc0('0x2d')]['count'](_0x1b62d0)[_0x8bc0('0x23')](function(_0x29fd23){_0x46a69d['count']=_0x29fd23;if(_0x5d2778['query']['includeAll']){_0x534bf6[_0x8bc0('0x41')]=[{'all':!![]}];}return db[_0x8bc0('0x2d')][_0x8bc0('0x42')](_0x534bf6);})['then'](function(_0xeea591){_0x46a69d[_0x8bc0('0x43')]=_0xeea591;return _0x46a69d;})[_0x8bc0('0x23')](respondWithFilteredResult(_0x2b8ba0,_0x534bf6))[_0x8bc0('0x44')](handleError(_0x2b8ba0,null));};exports[_0x8bc0('0x45')]=function(_0x4fcd09,_0x322a5c){var _0x3ec3f1={'raw':!![],'where':{'id':_0x4fcd09[_0x8bc0('0x46')]['id']}},_0x5a2be7={};_0x5a2be7[_0x8bc0('0x30')]=_[_0x8bc0('0x32')](db[_0x8bc0('0x2d')]['rawAttributes']);_0x5a2be7[_0x8bc0('0x31')]=_['keys'](_0x4fcd09[_0x8bc0('0x31')]);_0x5a2be7[_0x8bc0('0x33')]=_[_0x8bc0('0x34')](_0x5a2be7[_0x8bc0('0x30')],_0x5a2be7[_0x8bc0('0x31')]);_0x3ec3f1['attributes']=_['intersection'](_0x5a2be7[_0x8bc0('0x30')],qs[_0x8bc0('0x36')](_0x4fcd09[_0x8bc0('0x31')][_0x8bc0('0x36')]));_0x3ec3f1[_0x8bc0('0x35')]=_0x3ec3f1['attributes']['length']?_0x3ec3f1[_0x8bc0('0x35')]:_0x5a2be7[_0x8bc0('0x30')];if(_0x4fcd09[_0x8bc0('0x31')][_0x8bc0('0x47')]){_0x3ec3f1[_0x8bc0('0x41')]=[{'all':!![]}];}_0x3ec3f1=_[_0x8bc0('0x3e')]({},_0x3ec3f1,_0x4fcd09['options']);return db[_0x8bc0('0x2d')][_0x8bc0('0x48')](_0x3ec3f1)[_0x8bc0('0x23')](handleEntityNotFound(_0x322a5c,null))[_0x8bc0('0x23')](respondWithResult(_0x322a5c,null))['catch'](handleError(_0x322a5c,null));};exports[_0x8bc0('0x49')]=function(_0x1f4b4c,_0x29bef5){return db[_0x8bc0('0x2d')]['create'](_0x1f4b4c['body'],{})[_0x8bc0('0x23')](function(_0x3e4f88){var _0x1f1b5b=_0x1f4b4c['user'][_0x8bc0('0x4a')]({'plain':!![]});if(!_0x1f1b5b)throw new Error(_0x8bc0('0x4b'));if(_0x1f1b5b['role']===_0x8bc0('0x4c')){var _0x5d7fdf=_0x3e4f88[_0x8bc0('0x4a')]({'plain':!![]});var _0x450391='ExtractedReports';return db[_0x8bc0('0x4d')][_0x8bc0('0x48')]({'where':{'name':_0x450391,'userProfileId':_0x1f1b5b[_0x8bc0('0x4e')]},'raw':!![]})[_0x8bc0('0x23')](function(_0x572343){if(_0x572343&&_0x572343['autoAssociation']===0x0){return db[_0x8bc0('0x26')]['create']({'name':_0x5d7fdf['name'],'resourceId':_0x5d7fdf['id'],'type':_0x572343['name'],'sectionId':_0x572343['id']},{})[_0x8bc0('0x23')](function(){return _0x3e4f88;});}else{return _0x3e4f88;}})[_0x8bc0('0x44')](function(_0x23a419){logger[_0x8bc0('0x27')](_0x8bc0('0x4f'),_0x23a419);throw _0x23a419;});}return _0x3e4f88;})[_0x8bc0('0x23')](respondWithResult(_0x29bef5,0xc9))[_0x8bc0('0x44')](handleError(_0x29bef5,null));};exports[_0x8bc0('0x50')]=function(_0x4588f6,_0x2671f3){if(_0x4588f6['body']['id']){delete _0x4588f6['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x4588f6['params']['id']}})[_0x8bc0('0x23')](handleEntityNotFound(_0x2671f3,null))[_0x8bc0('0x23')](saveUpdates(_0x4588f6['body'],null))[_0x8bc0('0x23')](respondWithResult(_0x2671f3,null))['catch'](handleError(_0x2671f3,null));};exports[_0x8bc0('0x24')]=function(_0x348750,_0x2e7ab5){return db[_0x8bc0('0x2d')][_0x8bc0('0x48')]({'where':{'id':_0x348750['params']['id']}})['then'](handleEntityNotFound(_0x2e7ab5,null))[_0x8bc0('0x23')](removeEntity(_0x2e7ab5,null))['catch'](handleError(_0x2e7ab5,null));};exports[_0x8bc0('0x51')]=function(_0x1b098a,_0x5408d8,_0x153978){return db['AnalyticExtractedReport'][_0x8bc0('0x48')]({'where':{'id':_0x1b098a[_0x8bc0('0x46')]['id']},'attributes':[_0x8bc0('0x29'),_0x8bc0('0x52'),_0x8bc0('0x53'),_0x8bc0('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x5408d8,null))[_0x8bc0('0x23')](function(_0x9eb889){if(_0x9eb889){if(!fs['existsSync'](path[_0x8bc0('0x55')](config[_0x8bc0('0x56')],_0x8bc0('0x57'),_0x9eb889[_0x8bc0('0x53')]))){throw new db['Sequelize'][(_0x8bc0('0x58'))](_0x8bc0('0x59'));}if(_0x1b098a[_0x8bc0('0x31')]['exists']){return _0x5408d8[_0x8bc0('0x5a')](0xc8);}return _0x5408d8[_0x8bc0('0x51')](path[_0x8bc0('0x55')](config['root'],'server/files/reports',_0x9eb889[_0x8bc0('0x53')]),util['format']('%s.%s',_0x9eb889[_0x8bc0('0x52')]||_0x9eb889[_0x8bc0('0x29')],_0x9eb889[_0x8bc0('0x54')][_0x8bc0('0x5b')]()));}})[_0x8bc0('0x44')](handleError(_0x5408d8,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 8b9eca2..c1487e5 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 _0x8785=['analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x8785,0x1ed));var _0x5878=function(_0x2c9cf1,_0x1cf0f1){_0x2c9cf1=_0x2c9cf1-0x0;var _0x133ef4=_0x8785[_0x2c9cf1];return _0x133ef4;};'use strict';var _=require(_0x5878('0x0'));var util=require(_0x5878('0x1'));var logger=require(_0x5878('0x2'))('api');var moment=require(_0x5878('0x3'));var BPromise=require(_0x5878('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5878('0x5'));var rimraf=require(_0x5878('0x6'));var config=require(_0x5878('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x5878('0x8')]=function(_0x38e90a,_0x3d85f5){return _0x38e90a[_0x5878('0x9')](_0x5878('0xa'),attributes,{'tableName':_0x5878('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb0e1=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb0e1,0xd5));var _0x1b0e=function(_0x5e7ea3,_0x3b4870){_0x5e7ea3=_0x5e7ea3-0x0;var _0x2daabe=_0xb0e1[_0x5e7ea3];return _0x2daabe;};'use strict';var _=require(_0x1b0e('0x0'));var util=require(_0x1b0e('0x1'));var logger=require('../../config/logger')(_0x1b0e('0x2'));var moment=require(_0x1b0e('0x3'));var BPromise=require(_0x1b0e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b0e('0x5'));var attributes=require(_0x1b0e('0x6'));module[_0x1b0e('0x7')]=function(_0x40b7e8,_0x2e52fb){return _0x40b7e8[_0x1b0e('0x8')](_0x1b0e('0x9'),attributes,{'tableName':_0x1b0e('0xa'),'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 078d7b1..6e226dc 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 _0x4c35=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x4c35,0xd9));var _0x54c3=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x4c35[_0x342700];return _0x53406f;};'use strict';var _=require(_0x54c3('0x0'));var util=require('util');var moment=require(_0x54c3('0x1'));var BPromise=require(_0x54c3('0x2'));var rs=require(_0x54c3('0x3'));var fs=require('fs');var Redis=require(_0x54c3('0x4'));var db=require(_0x54c3('0x5'))['db'];var utils=require(_0x54c3('0x6'));var logger=require(_0x54c3('0x7'))('rpc');var config=require(_0x54c3('0x8'));var jayson=require(_0x54c3('0x9'));var client=jayson[_0x54c3('0xa')][_0x54c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bc7cf,_0x5bfa2a,_0x2707c4){return new BPromise(function(_0x3488e9,_0x1c951f){return client['request'](_0x3bc7cf,_0x2707c4)[_0x54c3('0xc')](function(_0x13be2c){logger[_0x54c3('0xd')](_0x54c3('0xe'),_0x5bfa2a,_0x54c3('0xf'));logger[_0x54c3('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x5bfa2a,_0x54c3('0xf'),JSON[_0x54c3('0x11')](_0x13be2c));if(_0x13be2c['error']){if(_0x13be2c[_0x54c3('0x12')][_0x54c3('0x13')]===0x1f4){logger[_0x54c3('0x12')](_0x54c3('0xe'),_0x5bfa2a,_0x13be2c['error'][_0x54c3('0x14')]);return _0x1c951f(_0x13be2c[_0x54c3('0x12')]['message']);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5bfa2a,_0x13be2c['error'][_0x54c3('0x14')]);return _0x3488e9(_0x13be2c[_0x54c3('0x12')][_0x54c3('0x14')]);}else{logger[_0x54c3('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5bfa2a,_0x54c3('0xf'));_0x3488e9(_0x13be2c[_0x54c3('0x15')][_0x54c3('0x14')]);}})[_0x54c3('0x16')](function(_0x2472d3){logger[_0x54c3('0x12')](_0x54c3('0xe'),_0x5bfa2a,_0x2472d3);_0x1c951f(_0x2472d3);});});}
\ No newline at end of file
+var _0x13e3=['error','message','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x13e3,0x6e));var _0x313e=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x13e3[_0x26f702];return _0x11417d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x313e('0x0'));var BPromise=require(_0x313e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x313e('0x2'));var db=require(_0x313e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x313e('0x4'))('rpc');var config=require(_0x313e('0x5'));var jayson=require(_0x313e('0x6'));var client=jayson[_0x313e('0x7')][_0x313e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x113baf,_0x488c20,_0x29519d){return new BPromise(function(_0x159eaf,_0x52e29b){return client['request'](_0x113baf,_0x29519d)['then'](function(_0x1d2da5){logger[_0x313e('0x9')](_0x313e('0xa'),_0x488c20,_0x313e('0xb'));logger[_0x313e('0xc')](_0x313e('0xd'),_0x488c20,_0x313e('0xb'),JSON[_0x313e('0xe')](_0x1d2da5));if(_0x1d2da5['error']){if(_0x1d2da5['error'][_0x313e('0xf')]===0x1f4){logger[_0x313e('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x488c20,_0x1d2da5[_0x313e('0x10')]['message']);return _0x52e29b(_0x1d2da5[_0x313e('0x10')][_0x313e('0x11')]);}logger[_0x313e('0x10')](_0x313e('0xa'),_0x488c20,_0x1d2da5[_0x313e('0x10')][_0x313e('0x11')]);return _0x159eaf(_0x1d2da5[_0x313e('0x10')][_0x313e('0x11')]);}else{logger[_0x313e('0x9')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x488c20,_0x313e('0xb'));_0x159eaf(_0x1d2da5['result'][_0x313e('0x11')]);}})['catch'](function(_0x28ac07){logger['error'](_0x313e('0xa'),_0x488c20,_0x28ac07);_0x52e29b(_0x28ac07);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index ce40ca0..73ee5e2 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 _0xef56=['isAuthenticated','index','/:id','/:id/download','download','post','create','update','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x5e6ea3,_0x9addd2){var _0x4048b5=function(_0x9092e4){while(--_0x9092e4){_0x5e6ea3['push'](_0x5e6ea3['shift']());}};_0x4048b5(++_0x9addd2);}(_0xef56,0xce));var _0x6ef5=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xef56[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require(_0x6ef5('0x0'));var util=require(_0x6ef5('0x1'));var path=require(_0x6ef5('0x2'));var timeout=require('connect-timeout');var express=require(_0x6ef5('0x3'));var router=express[_0x6ef5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6ef5('0x5'));var interaction=require(_0x6ef5('0x6'));var config=require(_0x6ef5('0x7'));var controller=require(_0x6ef5('0x8'));router[_0x6ef5('0x9')]('/',auth[_0x6ef5('0xa')](),controller[_0x6ef5('0xb')]);router[_0x6ef5('0x9')](_0x6ef5('0xc'),auth[_0x6ef5('0xa')](),controller['show']);router['get'](_0x6ef5('0xd'),auth['isAuthenticated'](),controller[_0x6ef5('0xe')]);router[_0x6ef5('0xf')]('/',auth[_0x6ef5('0xa')](),controller[_0x6ef5('0x10')]);router['put']('/:id',auth[_0x6ef5('0xa')](),controller[_0x6ef5('0x11')]);router['delete']('/:id',auth[_0x6ef5('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x20f4=['../../config/environment','./analyticExtractedReport.controller','get','/:id','isAuthenticated','download','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x404dea,_0x49844e){var _0x4d076e=function(_0x234d54){while(--_0x234d54){_0x404dea['push'](_0x404dea['shift']());}};_0x4d076e(++_0x49844e);}(_0x20f4,0x1c4));var _0x420f=function(_0x25e782,_0x55d2dd){_0x25e782=_0x25e782-0x0;var _0x10871f=_0x20f4[_0x25e782];return _0x10871f;};'use strict';var multer=require(_0x420f('0x0'));var util=require(_0x420f('0x1'));var path=require(_0x420f('0x2'));var timeout=require('connect-timeout');var express=require(_0x420f('0x3'));var router=express[_0x420f('0x4')]();var fs_extra=require(_0x420f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x420f('0x6'));var config=require(_0x420f('0x7'));var controller=require(_0x420f('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x420f('0x9')](_0x420f('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x420f('0x9')]('/:id/download',auth[_0x420f('0xb')](),controller[_0x420f('0xc')]);router['post']('/',auth[_0x420f('0xb')](),controller['create']);router[_0x420f('0xd')](_0x420f('0xa'),auth[_0x420f('0xb')](),controller[_0x420f('0xe')]);router[_0x420f('0xf')](_0x420f('0xa'),auth[_0x420f('0xb')](),controller[_0x420f('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 502ac94..e136b78 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 _0xe4eb=['exports','STRING','BOOLEAN','sequelize'];(function(_0x12a890,_0x4f3cb5){var _0x1a79ef=function(_0x5723f4){while(--_0x5723f4){_0x12a890['push'](_0x12a890['shift']());}};_0x1a79ef(++_0x4f3cb5);}(_0xe4eb,0x67));var _0xbe4e=function(_0x3a4c87,_0x3068ff){_0x3a4c87=_0x3a4c87-0x0;var _0x5ef79c=_0xe4eb[_0x3a4c87];return _0x5ef79c;};'use strict';var Sequelize=require(_0xbe4e('0x0'));module[_0xbe4e('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xbe4e('0x2')]},'function':{'type':Sequelize[_0xbe4e('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbe4e('0x2')]},'custom':{'type':Sequelize[_0xbe4e('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x57e7=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2161d8,_0x14e2d2){var _0x3acfb8=function(_0x5095fd){while(--_0x5095fd){_0x2161d8['push'](_0x2161d8['shift']());}};_0x3acfb8(++_0x14e2d2);}(_0x57e7,0x1c4));var _0x757e=function(_0x13f6fc,_0x54fabe){_0x13f6fc=_0x13f6fc-0x0;var _0x4f82ab=_0x57e7[_0x13f6fc];return _0x4f82ab;};'use strict';var Sequelize=require(_0x757e('0x0'));module[_0x757e('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x757e('0x2')]},'function':{'type':Sequelize[_0x757e('0x2')]},'format':{'type':Sequelize[_0x757e('0x2')]},'groupBy':{'type':Sequelize[_0x757e('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x757e('0x2')]},'custom':{'type':Sequelize[_0x757e('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 7e37868..2f7661e 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 _0xa0e9=['fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','filter','merge','map','type','options','AnalyticFieldReport','findAll','catch','show','includeAll','body','bulkCreate','find','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','count','set','Content-Range','save','update','destroy','then','sendStatus','error','stack','name','send','index','rawAttributes'];(function(_0x26dbc0,_0xf2424f){var _0x2a8e66=function(_0x1526d4){while(--_0x1526d4){_0x26dbc0['push'](_0x26dbc0['shift']());}};_0x2a8e66(++_0xf2424f);}(_0xa0e9,0x1eb));var _0x9a0e=function(_0x497274,_0x274702){_0x497274=_0x497274-0x0;var _0x1eb43c=_0xa0e9[_0x497274];return _0x1eb43c;};'use strict';var emlformat=require(_0x9a0e('0x0'));var rimraf=require(_0x9a0e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9a0e('0x2'));var moment=require(_0x9a0e('0x3'));var BPromise=require(_0x9a0e('0x4'));var Mustache=require(_0x9a0e('0x5'));var util=require(_0x9a0e('0x6'));var path=require(_0x9a0e('0x7'));var sox=require('sox');var csv=require(_0x9a0e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a0e('0x9'));var _=require('lodash');var squel=require(_0x9a0e('0xa'));var crypto=require('crypto');var jsforce=require(_0x9a0e('0xb'));var deskjs=require(_0x9a0e('0xc'));var toCsv=require(_0x9a0e('0x8'));var querystring=require('querystring');var Papa=require(_0x9a0e('0xd'));var Redis=require(_0x9a0e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9a0e('0xf'));var hardwareService=require(_0x9a0e('0x10'));var logger=require(_0x9a0e('0x11'))(_0x9a0e('0x12'));var utils=require(_0x9a0e('0x13'));var config=require(_0x9a0e('0x14'));var licenseUtil=require(_0x9a0e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x203dec,_0x41d64d){_0x41d64d=_0x41d64d||0xcc;return function(_0x315f68){if(_0x315f68){return _0x203dec['sendStatus'](_0x41d64d);}return _0x203dec['status'](_0x41d64d)[_0x9a0e('0x16')]();};}function respondWithResult(_0x1b6132,_0x151fbb){_0x151fbb=_0x151fbb||0xc8;return function(_0x2a869){if(_0x2a869){return _0x1b6132[_0x9a0e('0x17')](_0x151fbb)[_0x9a0e('0x18')](_0x2a869);}};}function respondWithFilteredResult(_0x5a25ff,_0x1392e4){return function(_0x329c86){if(_0x329c86){var _0x238741=typeof _0x1392e4[_0x9a0e('0x19')]===_0x9a0e('0x1a')&&typeof _0x1392e4['limit']==='undefined';var _0x311cf4=_0x329c86[_0x9a0e('0x1b')];var _0x5007c4=_0x238741?0x0:_0x1392e4['offset'];var _0x41aa1c=_0x238741?_0x329c86[_0x9a0e('0x1b')]:_0x1392e4[_0x9a0e('0x19')]+_0x1392e4['limit'];var _0xc6d3f6;if(_0x41aa1c>=_0x311cf4){_0x41aa1c=_0x311cf4;_0xc6d3f6=0xc8;}else{_0xc6d3f6=0xce;}_0x5a25ff['status'](_0xc6d3f6);return _0x5a25ff[_0x9a0e('0x1c')](_0x9a0e('0x1d'),_0x5007c4+'-'+_0x41aa1c+'/'+_0x311cf4)[_0x9a0e('0x18')](_0x329c86);}return null;};}function patchUpdates(_0xf6d33){return function(_0x47f6c6){try{jsonpatch['apply'](_0x47f6c6,_0xf6d33,!![]);}catch(_0x3bc6d1){return BPromise['reject'](_0x3bc6d1);}return _0x47f6c6[_0x9a0e('0x1e')]();};}function saveUpdates(_0x28bcb4,_0x282b6){return function(_0x1cdac5){if(_0x1cdac5){return _0x1cdac5[_0x9a0e('0x1f')](_0x28bcb4)['then'](function(_0x1fd478){return _0x1fd478;});}return null;};}function removeEntity(_0x190ed2,_0x4fda96){return function(_0x599e81){if(_0x599e81){return _0x599e81[_0x9a0e('0x20')]()[_0x9a0e('0x21')](function(){_0x190ed2[_0x9a0e('0x17')](0xcc)[_0x9a0e('0x16')]();});}};}function handleEntityNotFound(_0x207aa6,_0x2a000d){return function(_0x1466df){if(!_0x1466df){_0x207aa6[_0x9a0e('0x22')](0x194);}return _0x1466df;};}function handleError(_0x1e1383,_0x5ad194){_0x5ad194=_0x5ad194||0x1f4;return function(_0x36630c){logger[_0x9a0e('0x23')](_0x36630c[_0x9a0e('0x24')]);if(_0x36630c[_0x9a0e('0x25')]){delete _0x36630c[_0x9a0e('0x25')];}_0x1e1383[_0x9a0e('0x17')](_0x5ad194)[_0x9a0e('0x26')](_0x36630c);};}exports[_0x9a0e('0x27')]=function(_0xcbbe7b,_0x2c873){var _0x1af0db={},_0x32340a={},_0x27b1c1={'count':0x0,'rows':[]};var _0x4a31d0=_['map'](db['AnalyticFieldReport'][_0x9a0e('0x28')],function(_0x373a3b){return{'name':_0x373a3b[_0x9a0e('0x29')],'type':_0x373a3b['type'][_0x9a0e('0x2a')]};});_0x32340a[_0x9a0e('0x2b')]=_['map'](_0x4a31d0,_0x9a0e('0x25'));_0x32340a[_0x9a0e('0x2c')]=_[_0x9a0e('0x2d')](_0xcbbe7b[_0x9a0e('0x2c')]);_0x32340a[_0x9a0e('0x2e')]=_[_0x9a0e('0x2f')](_0x32340a['model'],_0x32340a['query']);_0x1af0db[_0x9a0e('0x30')]=_[_0x9a0e('0x2f')](_0x32340a[_0x9a0e('0x2b')],qs[_0x9a0e('0x31')](_0xcbbe7b['query'][_0x9a0e('0x31')]));_0x1af0db[_0x9a0e('0x30')]=_0x1af0db[_0x9a0e('0x30')][_0x9a0e('0x32')]?_0x1af0db['attributes']:_0x32340a[_0x9a0e('0x2b')];if(!_0xcbbe7b[_0x9a0e('0x2c')][_0x9a0e('0x33')]('nolimit')){_0x1af0db['limit']=qs[_0x9a0e('0x34')](_0xcbbe7b[_0x9a0e('0x2c')][_0x9a0e('0x34')]);_0x1af0db[_0x9a0e('0x19')]=qs['offset'](_0xcbbe7b[_0x9a0e('0x2c')][_0x9a0e('0x19')]);}_0x1af0db['order']=qs[_0x9a0e('0x35')](_0xcbbe7b['query']['sort']);_0x1af0db[_0x9a0e('0x36')]=qs[_0x9a0e('0x2e')](_['pick'](_0xcbbe7b[_0x9a0e('0x2c')],_0x32340a[_0x9a0e('0x2e')]),_0x4a31d0);if(_0xcbbe7b[_0x9a0e('0x2c')][_0x9a0e('0x37')]){_0x1af0db[_0x9a0e('0x36')]=_[_0x9a0e('0x38')](_0x1af0db['where'],{'$or':_[_0x9a0e('0x39')](_0x4a31d0,function(_0x59163f){if(_0x59163f[_0x9a0e('0x3a')]!=='VIRTUAL'){var _0x38beea={};_0x38beea[_0x59163f[_0x9a0e('0x25')]]={'$like':'%'+_0xcbbe7b[_0x9a0e('0x2c')][_0x9a0e('0x37')]+'%'};return _0x38beea;}})});}_0x1af0db=_[_0x9a0e('0x38')]({},_0x1af0db,_0xcbbe7b[_0x9a0e('0x3b')]);var _0xbae5e9={'where':_0x1af0db[_0x9a0e('0x36')]};return db['AnalyticFieldReport'][_0x9a0e('0x1b')](_0xbae5e9)[_0x9a0e('0x21')](function(_0x470be2){_0x27b1c1[_0x9a0e('0x1b')]=_0x470be2;if(_0xcbbe7b['query']['includeAll']){_0x1af0db['include']=[{'all':!![]}];}return db[_0x9a0e('0x3c')][_0x9a0e('0x3d')](_0x1af0db);})['then'](function(_0x2e6b88){_0x27b1c1['rows']=_0x2e6b88;return _0x27b1c1;})[_0x9a0e('0x21')](respondWithFilteredResult(_0x2c873,_0x1af0db))[_0x9a0e('0x3e')](handleError(_0x2c873,null));};exports[_0x9a0e('0x3f')]=function(_0x3094ae,_0x1258e4){var _0x291ae7={'raw':![],'where':{'id':_0x3094ae['params']['id']}},_0x279b25={};_0x279b25[_0x9a0e('0x2b')]=_['keys'](db[_0x9a0e('0x3c')][_0x9a0e('0x28')]);_0x279b25['query']=_[_0x9a0e('0x2d')](_0x3094ae[_0x9a0e('0x2c')]);_0x279b25[_0x9a0e('0x2e')]=_[_0x9a0e('0x2f')](_0x279b25['model'],_0x279b25[_0x9a0e('0x2c')]);_0x291ae7[_0x9a0e('0x30')]=_[_0x9a0e('0x2f')](_0x279b25[_0x9a0e('0x2b')],qs[_0x9a0e('0x31')](_0x3094ae['query'][_0x9a0e('0x31')]));_0x291ae7[_0x9a0e('0x30')]=_0x291ae7[_0x9a0e('0x30')]['length']?_0x291ae7[_0x9a0e('0x30')]:_0x279b25['model'];if(_0x3094ae[_0x9a0e('0x2c')][_0x9a0e('0x40')]){_0x291ae7['include']=[{'all':!![]}];}_0x291ae7=_[_0x9a0e('0x38')]({},_0x291ae7,_0x3094ae[_0x9a0e('0x3b')]);return db[_0x9a0e('0x3c')]['find'](_0x291ae7)['then'](handleEntityNotFound(_0x1258e4,null))[_0x9a0e('0x21')](respondWithResult(_0x1258e4,null))[_0x9a0e('0x3e')](handleError(_0x1258e4,null));};exports['create']=function(_0x59da81,_0x39e97f){return db[_0x9a0e('0x3c')]['create'](_0x59da81[_0x9a0e('0x41')],{})[_0x9a0e('0x21')](respondWithResult(_0x39e97f,0xc9))[_0x9a0e('0x3e')](handleError(_0x39e97f,null));};exports[_0x9a0e('0x42')]=function(_0x3285f2,_0x2bf8c5){return db['AnalyticFieldReport'][_0x9a0e('0x42')](_0x3285f2['body'],{'raw':![],'individualHooks':!![]})[_0x9a0e('0x21')](respondWithResult(_0x2bf8c5,0xc9))[_0x9a0e('0x3e')](handleError(_0x2bf8c5,null));};exports[_0x9a0e('0x1f')]=function(_0x2a2e51,_0x3d4edf){if(_0x2a2e51['body']['id']){delete _0x2a2e51[_0x9a0e('0x41')]['id'];}return db[_0x9a0e('0x3c')]['find']({'where':{'id':_0x2a2e51['params']['id']}})['then'](handleEntityNotFound(_0x3d4edf,null))['then'](saveUpdates(_0x2a2e51['body'],null))[_0x9a0e('0x21')](respondWithResult(_0x3d4edf,null))[_0x9a0e('0x3e')](handleError(_0x3d4edf,null));};exports[_0x9a0e('0x20')]=function(_0x2d6a32,_0x86d605){return db['AnalyticFieldReport'][_0x9a0e('0x43')]({'where':{'id':_0x2d6a32[_0x9a0e('0x44')]['id']}})['then'](handleEntityNotFound(_0x86d605,null))[_0x9a0e('0x21')](removeEntity(_0x86d605,null))[_0x9a0e('0x3e')](handleError(_0x86d605,null));};exports[_0x9a0e('0x45')]=function(_0x4659bb,_0xc141f3){return db['AnalyticFieldReport'][_0x9a0e('0x20')]({'where':{'id':_0x4659bb['query'][_0x9a0e('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x9a0e('0x21')](respondWithResult(_0xc141f3,0xcc))[_0x9a0e('0x3e')](handleError(_0xc141f3,null));};exports[_0x9a0e('0x47')]=function(_0x23c737,_0x11ef9c,_0x17b2dc){return db[_0x9a0e('0x48')][_0x9a0e('0x49')]({'where':{'id':_0x23c737['params']['id']}})['then'](handleEntityNotFound(_0x11ef9c,null))[_0x9a0e('0x21')](function(_0x2c0073){if(_0x2c0073){return db['sequelize'][_0x9a0e('0x4a')](function(_0x18bd21){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x23c737[_0x9a0e('0x44')]['id']},'transaction':_0x18bd21})[_0x9a0e('0x21')](function(_0x1ef7db){var _0xa2a549=_['map'](_0x23c737['body'],function(_0x466654){delete _0x466654['id'];_0x466654[_0x9a0e('0x4b')]=_0x23c737[_0x9a0e('0x44')]['id'];return _0x466654;});return db[_0x9a0e('0x3c')][_0x9a0e('0x42')](_0xa2a549,{'transaction':_0x18bd21});});})['then'](function(){return db[_0x9a0e('0x3c')][_0x9a0e('0x3d')]({'where':{'CustomReportId':_0x23c737['params']['id']}});});}})[_0x9a0e('0x21')](respondWithResult(_0x11ef9c,null))[_0x9a0e('0x3e')](handleError(_0x11ef9c,null));};
\ No newline at end of file
+var _0xab3d=['offset','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','find','body','bulkCreate','params','ids','addFields','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','count'];(function(_0x37c07d,_0xdbdb5f){var _0x10dadc=function(_0x2bafb7){while(--_0x2bafb7){_0x37c07d['push'](_0x37c07d['shift']());}};_0x10dadc(++_0xdbdb5f);}(_0xab3d,0x82));var _0xdab3=function(_0x3a64d0,_0x5cfabd){_0x3a64d0=_0x3a64d0-0x0;var _0x4e69f3=_0xab3d[_0x3a64d0];return _0x4e69f3;};'use strict';var emlformat=require(_0xdab3('0x0'));var rimraf=require(_0xdab3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdab3('0x2'));var rp=require(_0xdab3('0x3'));var moment=require(_0xdab3('0x4'));var BPromise=require(_0xdab3('0x5'));var Mustache=require(_0xdab3('0x6'));var util=require(_0xdab3('0x7'));var path=require(_0xdab3('0x8'));var sox=require(_0xdab3('0x9'));var csv=require(_0xdab3('0xa'));var ejs=require(_0xdab3('0xb'));var fs=require('fs');var fs_extra=require(_0xdab3('0xc'));var _=require('lodash');var squel=require(_0xdab3('0xd'));var crypto=require(_0xdab3('0xe'));var jsforce=require(_0xdab3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdab3('0xa'));var querystring=require(_0xdab3('0x10'));var Papa=require(_0xdab3('0x11'));var Redis=require(_0xdab3('0x12'));var authService=require(_0xdab3('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdab3('0x14'))(_0xdab3('0x15'));var utils=require(_0xdab3('0x16'));var config=require(_0xdab3('0x17'));var licenseUtil=require(_0xdab3('0x18'));var db=require(_0xdab3('0x19'))['db'];function respondWithStatusCode(_0x4632e0,_0x2bfaa7){_0x2bfaa7=_0x2bfaa7||0xcc;return function(_0xd20c28){if(_0xd20c28){return _0x4632e0[_0xdab3('0x1a')](_0x2bfaa7);}return _0x4632e0['status'](_0x2bfaa7)['end']();};}function respondWithResult(_0x214871,_0x358e6d){_0x358e6d=_0x358e6d||0xc8;return function(_0x5f424e){if(_0x5f424e){return _0x214871[_0xdab3('0x1b')](_0x358e6d)['json'](_0x5f424e);}};}function respondWithFilteredResult(_0x3a5230,_0x1b6f32){return function(_0x444ded){if(_0x444ded){var _0x1d030a=typeof _0x1b6f32['offset']==='undefined'&&typeof _0x1b6f32[_0xdab3('0x1c')]==='undefined';var _0x26be72=_0x444ded['count'];var _0x49d2c6=_0x1d030a?0x0:_0x1b6f32['offset'];var _0x124f58=_0x1d030a?_0x444ded[_0xdab3('0x1d')]:_0x1b6f32[_0xdab3('0x1e')]+_0x1b6f32['limit'];var _0x15d205;if(_0x124f58>=_0x26be72){_0x124f58=_0x26be72;_0x15d205=0xc8;}else{_0x15d205=0xce;}_0x3a5230[_0xdab3('0x1b')](_0x15d205);return _0x3a5230['set'](_0xdab3('0x1f'),_0x49d2c6+'-'+_0x124f58+'/'+_0x26be72)['json'](_0x444ded);}return null;};}function patchUpdates(_0x535efa){return function(_0x3bef2d){try{jsonpatch['apply'](_0x3bef2d,_0x535efa,!![]);}catch(_0x45579e){return BPromise[_0xdab3('0x20')](_0x45579e);}return _0x3bef2d[_0xdab3('0x21')]();};}function saveUpdates(_0x1551fc,_0x3700be){return function(_0x531e31){if(_0x531e31){return _0x531e31[_0xdab3('0x22')](_0x1551fc)[_0xdab3('0x23')](function(_0x392d41){return _0x392d41;});}return null;};}function removeEntity(_0xd64d08,_0x43087e){return function(_0x4631be){if(_0x4631be){return _0x4631be[_0xdab3('0x24')]()[_0xdab3('0x23')](function(){_0xd64d08['status'](0xcc)[_0xdab3('0x25')]();});}};}function handleEntityNotFound(_0x3fad3a,_0x5de7ea){return function(_0x19ab8c){if(!_0x19ab8c){_0x3fad3a['sendStatus'](0x194);}return _0x19ab8c;};}function handleError(_0x5e3470,_0x558855){_0x558855=_0x558855||0x1f4;return function(_0x170759){logger[_0xdab3('0x26')](_0x170759[_0xdab3('0x27')]);if(_0x170759[_0xdab3('0x28')]){delete _0x170759[_0xdab3('0x28')];}_0x5e3470[_0xdab3('0x1b')](_0x558855)[_0xdab3('0x29')](_0x170759);};}exports[_0xdab3('0x2a')]=function(_0x24c664,_0x2916da){var _0x342dc2={},_0x9933cd={},_0x3cb761={'count':0x0,'rows':[]};var _0x4358df=_[_0xdab3('0x2b')](db[_0xdab3('0x2c')][_0xdab3('0x2d')],function(_0x20587e){return{'name':_0x20587e[_0xdab3('0x2e')],'type':_0x20587e['type']['key']};});_0x9933cd['model']=_[_0xdab3('0x2b')](_0x4358df,_0xdab3('0x28'));_0x9933cd['query']=_[_0xdab3('0x2f')](_0x24c664[_0xdab3('0x30')]);_0x9933cd[_0xdab3('0x31')]=_[_0xdab3('0x32')](_0x9933cd['model'],_0x9933cd[_0xdab3('0x30')]);_0x342dc2[_0xdab3('0x33')]=_[_0xdab3('0x32')](_0x9933cd[_0xdab3('0x34')],qs[_0xdab3('0x35')](_0x24c664[_0xdab3('0x30')][_0xdab3('0x35')]));_0x342dc2[_0xdab3('0x33')]=_0x342dc2[_0xdab3('0x33')][_0xdab3('0x36')]?_0x342dc2['attributes']:_0x9933cd[_0xdab3('0x34')];if(!_0x24c664[_0xdab3('0x30')][_0xdab3('0x37')]('nolimit')){_0x342dc2[_0xdab3('0x1c')]=qs[_0xdab3('0x1c')](_0x24c664[_0xdab3('0x30')][_0xdab3('0x1c')]);_0x342dc2['offset']=qs[_0xdab3('0x1e')](_0x24c664[_0xdab3('0x30')][_0xdab3('0x1e')]);}_0x342dc2[_0xdab3('0x38')]=qs[_0xdab3('0x39')](_0x24c664[_0xdab3('0x30')]['sort']);_0x342dc2[_0xdab3('0x3a')]=qs[_0xdab3('0x31')](_[_0xdab3('0x3b')](_0x24c664[_0xdab3('0x30')],_0x9933cd[_0xdab3('0x31')]),_0x4358df);if(_0x24c664[_0xdab3('0x30')][_0xdab3('0x3c')]){_0x342dc2[_0xdab3('0x3a')]=_['merge'](_0x342dc2['where'],{'$or':_[_0xdab3('0x2b')](_0x4358df,function(_0x38afd6){if(_0x38afd6[_0xdab3('0x3d')]!=='VIRTUAL'){var _0x12e28a={};_0x12e28a[_0x38afd6['name']]={'$like':'%'+_0x24c664[_0xdab3('0x30')][_0xdab3('0x3c')]+'%'};return _0x12e28a;}})});}_0x342dc2=_[_0xdab3('0x3e')]({},_0x342dc2,_0x24c664[_0xdab3('0x3f')]);var _0x386b99={'where':_0x342dc2[_0xdab3('0x3a')]};return db[_0xdab3('0x2c')][_0xdab3('0x1d')](_0x386b99)[_0xdab3('0x23')](function(_0x7c646){_0x3cb761[_0xdab3('0x1d')]=_0x7c646;if(_0x24c664['query'][_0xdab3('0x40')]){_0x342dc2[_0xdab3('0x41')]=[{'all':!![]}];}return db[_0xdab3('0x2c')][_0xdab3('0x42')](_0x342dc2);})[_0xdab3('0x23')](function(_0x344c9d){_0x3cb761[_0xdab3('0x43')]=_0x344c9d;return _0x3cb761;})[_0xdab3('0x23')](respondWithFilteredResult(_0x2916da,_0x342dc2))[_0xdab3('0x44')](handleError(_0x2916da,null));};exports[_0xdab3('0x45')]=function(_0x2dc9b2,_0x34990f){var _0x25f02b={'raw':![],'where':{'id':_0x2dc9b2['params']['id']}},_0x3a59d0={};_0x3a59d0[_0xdab3('0x34')]=_['keys'](db[_0xdab3('0x2c')][_0xdab3('0x2d')]);_0x3a59d0[_0xdab3('0x30')]=_['keys'](_0x2dc9b2[_0xdab3('0x30')]);_0x3a59d0[_0xdab3('0x31')]=_['intersection'](_0x3a59d0['model'],_0x3a59d0[_0xdab3('0x30')]);_0x25f02b[_0xdab3('0x33')]=_[_0xdab3('0x32')](_0x3a59d0[_0xdab3('0x34')],qs[_0xdab3('0x35')](_0x2dc9b2[_0xdab3('0x30')][_0xdab3('0x35')]));_0x25f02b[_0xdab3('0x33')]=_0x25f02b['attributes'][_0xdab3('0x36')]?_0x25f02b[_0xdab3('0x33')]:_0x3a59d0['model'];if(_0x2dc9b2[_0xdab3('0x30')][_0xdab3('0x40')]){_0x25f02b[_0xdab3('0x41')]=[{'all':!![]}];}_0x25f02b=_[_0xdab3('0x3e')]({},_0x25f02b,_0x2dc9b2['options']);return db[_0xdab3('0x2c')][_0xdab3('0x46')](_0x25f02b)[_0xdab3('0x23')](handleEntityNotFound(_0x34990f,null))[_0xdab3('0x23')](respondWithResult(_0x34990f,null))[_0xdab3('0x44')](handleError(_0x34990f,null));};exports['create']=function(_0xd0204c,_0x40f520){return db[_0xdab3('0x2c')]['create'](_0xd0204c[_0xdab3('0x47')],{})[_0xdab3('0x23')](respondWithResult(_0x40f520,0xc9))[_0xdab3('0x44')](handleError(_0x40f520,null));};exports[_0xdab3('0x48')]=function(_0xd9b734,_0x4bfdc9){return db['AnalyticFieldReport'][_0xdab3('0x48')](_0xd9b734[_0xdab3('0x47')],{'raw':![],'individualHooks':!![]})[_0xdab3('0x23')](respondWithResult(_0x4bfdc9,0xc9))[_0xdab3('0x44')](handleError(_0x4bfdc9,null));};exports[_0xdab3('0x22')]=function(_0x2ddbc7,_0x4dd045){if(_0x2ddbc7[_0xdab3('0x47')]['id']){delete _0x2ddbc7[_0xdab3('0x47')]['id'];}return db[_0xdab3('0x2c')][_0xdab3('0x46')]({'where':{'id':_0x2ddbc7[_0xdab3('0x49')]['id']}})[_0xdab3('0x23')](handleEntityNotFound(_0x4dd045,null))['then'](saveUpdates(_0x2ddbc7[_0xdab3('0x47')],null))[_0xdab3('0x23')](respondWithResult(_0x4dd045,null))[_0xdab3('0x44')](handleError(_0x4dd045,null));};exports[_0xdab3('0x24')]=function(_0x19f8f3,_0x3f46cc){return db[_0xdab3('0x2c')][_0xdab3('0x46')]({'where':{'id':_0x19f8f3[_0xdab3('0x49')]['id']}})[_0xdab3('0x23')](handleEntityNotFound(_0x3f46cc,null))['then'](removeEntity(_0x3f46cc,null))['catch'](handleError(_0x3f46cc,null));};exports['bulkDestroy']=function(_0x4e248a,_0x51ec2b){return db['AnalyticFieldReport'][_0xdab3('0x24')]({'where':{'id':_0x4e248a[_0xdab3('0x30')][_0xdab3('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xdab3('0x23')](respondWithResult(_0x51ec2b,0xcc))[_0xdab3('0x44')](handleError(_0x51ec2b,null));};exports[_0xdab3('0x4b')]=function(_0x11e937,_0x1ed504,_0x17743a){return db['AnalyticCustomReport'][_0xdab3('0x4c')]({'where':{'id':_0x11e937[_0xdab3('0x49')]['id']}})['then'](handleEntityNotFound(_0x1ed504,null))[_0xdab3('0x23')](function(_0x320131){if(_0x320131){return db[_0xdab3('0x4d')][_0xdab3('0x4e')](function(_0x46e47f){return db[_0xdab3('0x2c')][_0xdab3('0x24')]({'where':{'CustomReportId':_0x11e937['params']['id']},'transaction':_0x46e47f})[_0xdab3('0x23')](function(_0x43e6f3){var _0x5ed5e2=_[_0xdab3('0x2b')](_0x11e937[_0xdab3('0x47')],function(_0x570495){delete _0x570495['id'];_0x570495[_0xdab3('0x4f')]=_0x11e937['params']['id'];return _0x570495;});return db[_0xdab3('0x2c')][_0xdab3('0x48')](_0x5ed5e2,{'transaction':_0x46e47f});});})[_0xdab3('0x23')](function(){return db[_0xdab3('0x2c')]['findAll']({'where':{'CustomReportId':_0x11e937[_0xdab3('0x49')]['id']}});});}})[_0xdab3('0x23')](respondWithResult(_0x1ed504,null))[_0xdab3('0x44')](handleError(_0x1ed504,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index cd1bb38..702c353 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 _0x6a55=['analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x6a55,0xeb));var _0x56a5=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0x6a55[_0x29df9a];return _0x3a8e96;};'use strict';var _=require(_0x56a5('0x0'));var util=require(_0x56a5('0x1'));var logger=require(_0x56a5('0x2'))(_0x56a5('0x3'));var moment=require(_0x56a5('0x4'));var BPromise=require(_0x56a5('0x5'));var rp=require(_0x56a5('0x6'));var fs=require('fs');var path=require(_0x56a5('0x7'));var rimraf=require('rimraf');var config=require(_0x56a5('0x8'));var attributes=require(_0x56a5('0x9'));module['exports']=function(_0x178644,_0x5a3bd2){return _0x178644[_0x56a5('0xa')](_0x56a5('0xb'),attributes,{'tableName':_0x56a5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1033=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x485abd,_0x32c7c1){var _0x3379f1=function(_0x36b528){while(--_0x36b528){_0x485abd['push'](_0x485abd['shift']());}};_0x3379f1(++_0x32c7c1);}(_0x1033,0x8e));var _0x3103=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x1033[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x3103('0x0'));var util=require('util');var logger=require(_0x3103('0x1'))(_0x3103('0x2'));var moment=require(_0x3103('0x3'));var BPromise=require(_0x3103('0x4'));var rp=require(_0x3103('0x5'));var fs=require('fs');var path=require(_0x3103('0x6'));var rimraf=require(_0x3103('0x7'));var config=require(_0x3103('0x8'));var attributes=require(_0x3103('0x9'));module['exports']=function(_0x2fe282,_0x201561){return _0x2fe282[_0x3103('0xa')](_0x3103('0xb'),attributes,{'tableName':_0x3103('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 8996da5..42aa0cb 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 _0x3fc4=['error','code','message','result','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xdcde19,_0x224474){var _0x44200c=function(_0x39b31c){while(--_0x39b31c){_0xdcde19['push'](_0xdcde19['shift']());}};_0x44200c(++_0x224474);}(_0x3fc4,0x125));var _0x43fc=function(_0x5c66d2,_0x5f220f){_0x5c66d2=_0x5c66d2-0x0;var _0x8ed5e3=_0x3fc4[_0x5c66d2];return _0x8ed5e3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x43fc('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43fc('0x1'));var db=require(_0x43fc('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x43fc('0x3'))('rpc');var config=require(_0x43fc('0x4'));var jayson=require(_0x43fc('0x5'));var client=jayson[_0x43fc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe30928,_0x1be3dc,_0xdc6037){return new BPromise(function(_0x44be1f,_0x5137ea){return client[_0x43fc('0x7')](_0xe30928,_0xdc6037)[_0x43fc('0x8')](function(_0x36f347){logger[_0x43fc('0x9')](_0x43fc('0xa'),_0x1be3dc,'request\x20sent');logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1be3dc,_0x43fc('0xb'),JSON[_0x43fc('0xc')](_0x36f347));if(_0x36f347[_0x43fc('0xd')]){if(_0x36f347[_0x43fc('0xd')][_0x43fc('0xe')]===0x1f4){logger[_0x43fc('0xd')](_0x43fc('0xa'),_0x1be3dc,_0x36f347[_0x43fc('0xd')][_0x43fc('0xf')]);return _0x5137ea(_0x36f347['error']['message']);}logger[_0x43fc('0xd')](_0x43fc('0xa'),_0x1be3dc,_0x36f347[_0x43fc('0xd')][_0x43fc('0xf')]);return _0x44be1f(_0x36f347['error']['message']);}else{logger[_0x43fc('0x9')](_0x43fc('0xa'),_0x1be3dc,_0x43fc('0xb'));_0x44be1f(_0x36f347[_0x43fc('0x10')][_0x43fc('0xf')]);}})['catch'](function(_0x2fa605){logger[_0x43fc('0xd')](_0x43fc('0xa'),_0x1be3dc,_0x2fa605);_0x5137ea(_0x2fa605);});});}
\ No newline at end of file
+var _0x02d6=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x55b307,_0x4c5319){var _0x1b5114=function(_0x4424e0){while(--_0x4424e0){_0x55b307['push'](_0x55b307['shift']());}};_0x1b5114(++_0x4c5319);}(_0x02d6,0x1ce));var _0x602d=function(_0x1d2c3a,_0x249200){_0x1d2c3a=_0x1d2c3a-0x0;var _0x3b5128=_0x02d6[_0x1d2c3a];return _0x3b5128;};'use strict';var _=require(_0x602d('0x0'));var util=require(_0x602d('0x1'));var moment=require(_0x602d('0x2'));var BPromise=require(_0x602d('0x3'));var rs=require(_0x602d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x602d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x602d('0x6'))(_0x602d('0x7'));var config=require(_0x602d('0x8'));var jayson=require(_0x602d('0x9'));var client=jayson['client'][_0x602d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fe431,_0x4f5157,_0x524f99){return new BPromise(function(_0x1822cc,_0x43e21b){return client[_0x602d('0xb')](_0x2fe431,_0x524f99)[_0x602d('0xc')](function(_0x3daef2){logger[_0x602d('0xd')](_0x602d('0xe'),_0x4f5157,_0x602d('0xf'));logger[_0x602d('0x10')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4f5157,_0x602d('0xf'),JSON[_0x602d('0x11')](_0x3daef2));if(_0x3daef2['error']){if(_0x3daef2[_0x602d('0x12')]['code']===0x1f4){logger[_0x602d('0x12')](_0x602d('0xe'),_0x4f5157,_0x3daef2[_0x602d('0x12')][_0x602d('0x13')]);return _0x43e21b(_0x3daef2[_0x602d('0x12')][_0x602d('0x13')]);}logger[_0x602d('0x12')](_0x602d('0xe'),_0x4f5157,_0x3daef2[_0x602d('0x12')][_0x602d('0x13')]);return _0x1822cc(_0x3daef2[_0x602d('0x12')][_0x602d('0x13')]);}else{logger[_0x602d('0xd')](_0x602d('0xe'),_0x4f5157,_0x602d('0xf'));_0x1822cc(_0x3daef2[_0x602d('0x14')][_0x602d('0x13')]);}})['catch'](function(_0x9ce7a){logger[_0x602d('0x12')](_0x602d('0xe'),_0x4f5157,_0x9ce7a);_0x43e21b(_0x9ce7a);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 0c5ef49..5c051e4 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(_0x135c0b,_0x4a8182){var _0x3ff6be=function(_0x43ee7f){while(--_0x43ee7f){_0x135c0b['push'](_0x135c0b['shift']());}};_0x3ff6be(++_0x4a8182);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x4d3d19,_0x35edd6){var _0x14ba6c=function(_0x7ed61f){while(--_0x7ed61f){_0x4d3d19['push'](_0x4d3d19['shift']());}};_0x14ba6c(++_0x35edd6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 a59cae4..29b8089 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 _0x0901=['STRING','name','TEXT','sequelize','exports'];(function(_0x332339,_0x3a98e1){var _0x2d78e9=function(_0x574ea5){while(--_0x574ea5){_0x332339['push'](_0x332339['shift']());}};_0x2d78e9(++_0x3a98e1);}(_0x0901,0x134));var _0x1090=function(_0x36d65a,_0x2f23e9){_0x36d65a=_0x36d65a-0x0;var _0x859c46=_0x0901[_0x36d65a];return _0x859c46;};'use strict';var Sequelize=require(_0x1090('0x0'));module[_0x1090('0x1')]={'name':{'type':Sequelize[_0x1090('0x2')],'allowNull':![],'unique':_0x1090('0x3')},'table':{'type':Sequelize[_0x1090('0x2')]},'metric':{'type':Sequelize[_0x1090('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5b02=['name','sequelize','exports','STRING'];(function(_0x588d09,_0x1b4518){var _0x37b806=function(_0x573eaf){while(--_0x573eaf){_0x588d09['push'](_0x588d09['shift']());}};_0x37b806(++_0x1b4518);}(_0x5b02,0xe9));var _0x25b0=function(_0x5ec26d,_0x46d3e1){_0x5ec26d=_0x5ec26d-0x0;var _0x43a53c=_0x5b02[_0x5ec26d];return _0x43a53c;};'use strict';var Sequelize=require(_0x25b0('0x0'));module[_0x25b0('0x1')]={'name':{'type':Sequelize[_0x25b0('0x2')],'allowNull':![],'unique':_0x25b0('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x25b0('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 91d53e5..f0c5408 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 _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','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','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x18001b,_0x482b75){_0x18001b=_0x18001b-0x0;var _0x16f3f3=_0x1cb9[_0x18001b];return _0x16f3f3;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));};
\ No newline at end of file
+var _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x7da7,0x10d));var _0x77da=function(_0x296754,_0x5befe9){_0x296754=_0x296754-0x0;var _0x1d9f1d=_0x7da7[_0x296754];return _0x1d9f1d;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 399f34c..33744ee 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 _0xd8a5=['analytics_metrics','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x3b80e7,_0x8f4796){var _0x2fdca1=function(_0x446920){while(--_0x446920){_0x3b80e7['push'](_0x3b80e7['shift']());}};_0x2fdca1(++_0x8f4796);}(_0xd8a5,0x160));var _0x5d8a=function(_0x4b187b,_0x431650){_0x4b187b=_0x4b187b-0x0;var _0x321553=_0xd8a5[_0x4b187b];return _0x321553;};'use strict';var _=require(_0x5d8a('0x0'));var util=require('util');var logger=require(_0x5d8a('0x1'))(_0x5d8a('0x2'));var moment=require('moment');var BPromise=require(_0x5d8a('0x3'));var rp=require(_0x5d8a('0x4'));var fs=require('fs');var path=require(_0x5d8a('0x5'));var rimraf=require(_0x5d8a('0x6'));var config=require(_0x5d8a('0x7'));var attributes=require(_0x5d8a('0x8'));module[_0x5d8a('0x9')]=function(_0x38eaa5,_0x1ef405){return _0x38eaa5[_0x5d8a('0xa')](_0x5d8a('0xb'),attributes,{'tableName':_0x5d8a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe2bc=['./analyticMetric.attributes','exports','define','analytics_metrics','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x26bddd,_0x150143){var _0x179b2d=function(_0x2a6edf){while(--_0x2a6edf){_0x26bddd['push'](_0x26bddd['shift']());}};_0x179b2d(++_0x150143);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xe2bc[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require(_0xce2b('0x0'));var util=require('util');var logger=require(_0xce2b('0x1'))('api');var moment=require(_0xce2b('0x2'));var BPromise=require(_0xce2b('0x3'));var rp=require(_0xce2b('0x4'));var fs=require('fs');var path=require(_0xce2b('0x5'));var rimraf=require(_0xce2b('0x6'));var config=require('../../config/environment');var attributes=require(_0xce2b('0x7'));module[_0xce2b('0x8')]=function(_0x3c15d3,_0x343373){return _0x3c15d3[_0xce2b('0x9')]('AnalyticMetric',attributes,{'tableName':_0xce2b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index c0057f5..d6a572a 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 _0x4f5d=['request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s','message','error','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4f9b56,_0x4de94e){var _0x5b1e25=function(_0x4dc9fe){while(--_0x4dc9fe){_0x4f9b56['push'](_0x4f9b56['shift']());}};_0x5b1e25(++_0x4de94e);}(_0x4f5d,0x97));var _0xd4f5=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x4f5d[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd4f5('0x0'));var BPromise=require('bluebird');var rs=require(_0xd4f5('0x1'));var fs=require('fs');var Redis=require(_0xd4f5('0x2'));var db=require(_0xd4f5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd4f5('0x4'))(_0xd4f5('0x5'));var config=require(_0xd4f5('0x6'));var jayson=require(_0xd4f5('0x7'));var client=jayson['client'][_0xd4f5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33ff92,_0x51f8cf,_0x1a4c53){return new BPromise(function(_0x4336f7,_0x405ae3){return client[_0xd4f5('0x9')](_0x33ff92,_0x1a4c53)[_0xd4f5('0xa')](function(_0x1f73cc){logger[_0xd4f5('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x51f8cf,_0xd4f5('0xc'));logger[_0xd4f5('0xd')](_0xd4f5('0xe'),_0x51f8cf,_0xd4f5('0xc'),JSON['stringify'](_0x1f73cc));if(_0x1f73cc['error']){if(_0x1f73cc['error']['code']===0x1f4){logger['error'](_0xd4f5('0xf'),_0x51f8cf,_0x1f73cc['error'][_0xd4f5('0x10')]);return _0x405ae3(_0x1f73cc[_0xd4f5('0x11')][_0xd4f5('0x10')]);}logger[_0xd4f5('0x11')](_0xd4f5('0xf'),_0x51f8cf,_0x1f73cc[_0xd4f5('0x11')][_0xd4f5('0x10')]);return _0x4336f7(_0x1f73cc[_0xd4f5('0x11')][_0xd4f5('0x10')]);}else{logger[_0xd4f5('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x51f8cf,_0xd4f5('0xc'));_0x4336f7(_0x1f73cc[_0xd4f5('0x12')][_0xd4f5('0x10')]);}})[_0xd4f5('0x13')](function(_0x323a5a){logger[_0xd4f5('0x11')](_0xd4f5('0xf'),_0x51f8cf,_0x323a5a);_0x405ae3(_0x323a5a);});});}
\ No newline at end of file
+var _0x23bf=['then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x1cf661,_0x2c4a3c){var _0x2b3877=function(_0x4ca6fb){while(--_0x4ca6fb){_0x1cf661['push'](_0x1cf661['shift']());}};_0x2b3877(++_0x2c4a3c);}(_0x23bf,0x1d8));var _0xf23b=function(_0x27d23c,_0x11fcc7){_0x27d23c=_0x27d23c-0x0;var _0x537ed4=_0x23bf[_0x27d23c];return _0x537ed4;};'use strict';var _=require(_0xf23b('0x0'));var util=require(_0xf23b('0x1'));var moment=require('moment');var BPromise=require(_0xf23b('0x2'));var rs=require(_0xf23b('0x3'));var fs=require('fs');var Redis=require(_0xf23b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf23b('0x5'));var logger=require('../../config/logger')(_0xf23b('0x6'));var config=require(_0xf23b('0x7'));var jayson=require(_0xf23b('0x8'));var client=jayson[_0xf23b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1957ab,_0x16e051,_0x544d5b){return new BPromise(function(_0x291f0d,_0x2792b5){return client[_0xf23b('0xa')](_0x1957ab,_0x544d5b)[_0xf23b('0xb')](function(_0x5506ce){logger[_0xf23b('0xc')](_0xf23b('0xd'),_0x16e051,_0xf23b('0xe'));logger[_0xf23b('0xf')](_0xf23b('0x10'),_0x16e051,_0xf23b('0xe'),JSON[_0xf23b('0x11')](_0x5506ce));if(_0x5506ce[_0xf23b('0x12')]){if(_0x5506ce['error'][_0xf23b('0x13')]===0x1f4){logger[_0xf23b('0x12')](_0xf23b('0xd'),_0x16e051,_0x5506ce[_0xf23b('0x12')][_0xf23b('0x14')]);return _0x2792b5(_0x5506ce['error'][_0xf23b('0x14')]);}logger['error'](_0xf23b('0xd'),_0x16e051,_0x5506ce['error']['message']);return _0x291f0d(_0x5506ce['error'][_0xf23b('0x14')]);}else{logger['info'](_0xf23b('0xd'),_0x16e051,_0xf23b('0xe'));_0x291f0d(_0x5506ce['result'][_0xf23b('0x14')]);}})['catch'](function(_0x39d3c5){logger[_0xf23b('0x12')](_0xf23b('0xd'),_0x16e051,_0x39d3c5);_0x2792b5(_0x39d3c5);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index c02e9c4..387d3c3 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 _0xa261=['./analyticMetric.controller','get','isAuthenticated','index','post','create','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1d0cba,_0x2731b1){var _0xdc3278=function(_0x3b20f5){while(--_0x3b20f5){_0x1d0cba['push'](_0x1d0cba['shift']());}};_0xdc3278(++_0x2731b1);}(_0xa261,0x1a3));var _0x1a26=function(_0x20f563,_0x4a3bf6){_0x20f563=_0x20f563-0x0;var _0x5c15a1=_0xa261[_0x20f563];return _0x5c15a1;};'use strict';var multer=require(_0x1a26('0x0'));var util=require('util');var path=require(_0x1a26('0x1'));var timeout=require(_0x1a26('0x2'));var express=require(_0x1a26('0x3'));var router=express[_0x1a26('0x4')]();var fs_extra=require(_0x1a26('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1a26('0x6'));router[_0x1a26('0x7')]('/',auth[_0x1a26('0x8')](),controller[_0x1a26('0x9')]);router[_0x1a26('0x7')]('/:id',auth[_0x1a26('0x8')](),controller['show']);router[_0x1a26('0xa')]('/',auth[_0x1a26('0x8')](),controller[_0x1a26('0xb')]);router['put'](_0x1a26('0xc'),auth[_0x1a26('0x8')](),controller[_0x1a26('0xd')]);router[_0x1a26('0xe')](_0x1a26('0xc'),auth['isAuthenticated'](),controller[_0x1a26('0xf')]);module[_0x1a26('0x10')]=router;
\ No newline at end of file
+var _0x84e7=['delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','show','create','put','/:id'];(function(_0x4cc18f,_0x3da515){var _0x46bee6=function(_0x1ac75f){while(--_0x1ac75f){_0x4cc18f['push'](_0x4cc18f['shift']());}};_0x46bee6(++_0x3da515);}(_0x84e7,0x122));var _0x784e=function(_0x4d3786,_0x58cb35){_0x4d3786=_0x4d3786-0x0;var _0x3911f7=_0x84e7[_0x4d3786];return _0x3911f7;};'use strict';var multer=require('multer');var util=require(_0x784e('0x0'));var path=require(_0x784e('0x1'));var timeout=require('connect-timeout');var express=require(_0x784e('0x2'));var router=express[_0x784e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x784e('0x4'));var interaction=require(_0x784e('0x5'));var config=require(_0x784e('0x6'));var controller=require(_0x784e('0x7'));router[_0x784e('0x8')]('/',auth[_0x784e('0x9')](),controller['index']);router[_0x784e('0x8')]('/:id',auth[_0x784e('0x9')](),controller[_0x784e('0xa')]);router['post']('/',auth[_0x784e('0x9')](),controller[_0x784e('0xb')]);router[_0x784e('0xc')](_0x784e('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x784e('0xe')](_0x784e('0xd'),auth[_0x784e('0x9')](),controller[_0x784e('0xf')]);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 63847d9..8666816 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 _0x4e05=['exports','sequelize'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x4e05,0x193));var _0x54e0=function(_0x5cd25b,_0x950abb){_0x5cd25b=_0x5cd25b-0x0;var _0x1c57a2=_0x4e05[_0x5cd25b];return _0x1c57a2;};'use strict';var Sequelize=require(_0x54e0('0x0'));module[_0x54e0('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x8c16=['sequelize'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x8c16,0xb3));var _0x68c1=function(_0x1dcce7,_0x33761c){_0x1dcce7=_0x1dcce7-0x0;var _0x350d60=_0x8c16[_0x1dcce7];return _0x350d60;};'use strict';var Sequelize=require(_0x68c1('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 566ddf2..cc0805f 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 _0x153a=['catch','keys','find','create','update','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','AnalyticTreeReport','includeAll','include','findAll','rows'];(function(_0x48c444,_0x5e2c6d){var _0x4304c7=function(_0x18136b){while(--_0x18136b){_0x48c444['push'](_0x48c444['shift']());}};_0x4304c7(++_0x5e2c6d);}(_0x153a,0x138));var _0xa153=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x153a[_0x2aea9e];return _0x430b92;};'use strict';var emlformat=require(_0xa153('0x0'));var rimraf=require(_0xa153('0x1'));var zipdir=require(_0xa153('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa153('0x3'));var moment=require(_0xa153('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa153('0x5'));var util=require(_0xa153('0x6'));var path=require('path');var sox=require(_0xa153('0x7'));var csv=require(_0xa153('0x8'));var ejs=require(_0xa153('0x9'));var fs=require('fs');var fs_extra=require(_0xa153('0xa'));var _=require(_0xa153('0xb'));var squel=require(_0xa153('0xc'));var crypto=require('crypto');var jsforce=require(_0xa153('0xd'));var deskjs=require(_0xa153('0xe'));var toCsv=require(_0xa153('0x8'));var querystring=require(_0xa153('0xf'));var Papa=require(_0xa153('0x10'));var Redis=require(_0xa153('0x11'));var authService=require(_0xa153('0x12'));var qs=require(_0xa153('0x13'));var as=require(_0xa153('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa153('0x15'))(_0xa153('0x16'));var utils=require(_0xa153('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa153('0x18'));var db=require(_0xa153('0x19'))['db'];function respondWithStatusCode(_0x3c041d,_0x412f27){_0x412f27=_0x412f27||0xcc;return function(_0x24a9c7){if(_0x24a9c7){return _0x3c041d['sendStatus'](_0x412f27);}return _0x3c041d[_0xa153('0x1a')](_0x412f27)[_0xa153('0x1b')]();};}function respondWithResult(_0x468c65,_0x2108ff){_0x2108ff=_0x2108ff||0xc8;return function(_0x10f537){if(_0x10f537){return _0x468c65[_0xa153('0x1a')](_0x2108ff)['json'](_0x10f537);}};}function respondWithFilteredResult(_0x4cd52e,_0x21ed69){return function(_0x4353be){if(_0x4353be){var _0x317943=typeof _0x21ed69[_0xa153('0x1c')]===_0xa153('0x1d')&&typeof _0x21ed69[_0xa153('0x1e')]==='undefined';var _0x41f389=_0x4353be[_0xa153('0x1f')];var _0x479bec=_0x317943?0x0:_0x21ed69[_0xa153('0x1c')];var _0xee6dab=_0x317943?_0x4353be[_0xa153('0x1f')]:_0x21ed69[_0xa153('0x1c')]+_0x21ed69['limit'];var _0x12a98e;if(_0xee6dab>=_0x41f389){_0xee6dab=_0x41f389;_0x12a98e=0xc8;}else{_0x12a98e=0xce;}_0x4cd52e['status'](_0x12a98e);return _0x4cd52e['set'](_0xa153('0x20'),_0x479bec+'-'+_0xee6dab+'/'+_0x41f389)[_0xa153('0x21')](_0x4353be);}return null;};}function patchUpdates(_0x3bd8f0){return function(_0x49fe91){try{jsonpatch[_0xa153('0x22')](_0x49fe91,_0x3bd8f0,!![]);}catch(_0x31c30d){return BPromise[_0xa153('0x23')](_0x31c30d);}return _0x49fe91[_0xa153('0x24')]();};}function saveUpdates(_0x35077d,_0x5b497c){return function(_0x3bc7ed){if(_0x3bc7ed){return _0x3bc7ed['update'](_0x35077d)[_0xa153('0x25')](function(_0x1b2e5f){return _0x1b2e5f;});}return null;};}function removeEntity(_0x214f79,_0x1fc3fb){return function(_0x2a61f4){if(_0x2a61f4){return _0x2a61f4['destroy']()[_0xa153('0x25')](function(){_0x214f79[_0xa153('0x1a')](0xcc)[_0xa153('0x1b')]();});}};}function handleEntityNotFound(_0x55d350,_0x45acf4){return function(_0x3abecd){if(!_0x3abecd){_0x55d350[_0xa153('0x26')](0x194);}return _0x3abecd;};}function handleError(_0x156f45,_0x442df1){_0x442df1=_0x442df1||0x1f4;return function(_0x734897){logger[_0xa153('0x27')](_0x734897[_0xa153('0x28')]);if(_0x734897[_0xa153('0x29')]){delete _0x734897[_0xa153('0x29')];}_0x156f45[_0xa153('0x1a')](_0x442df1)[_0xa153('0x2a')](_0x734897);};}exports[_0xa153('0x2b')]=function(_0x36f811,_0x4c20e0){var _0xbbc6ee={},_0x3ce108={},_0x3f2646={'count':0x0,'rows':[]};var _0x5d62f8=_[_0xa153('0x2c')](db['AnalyticTreeReport'][_0xa153('0x2d')],function(_0x3a2aa2){return{'name':_0x3a2aa2['fieldName'],'type':_0x3a2aa2[_0xa153('0x2e')][_0xa153('0x2f')]};});_0x3ce108[_0xa153('0x30')]=_[_0xa153('0x2c')](_0x5d62f8,_0xa153('0x29'));_0x3ce108['query']=_['keys'](_0x36f811[_0xa153('0x31')]);_0x3ce108['filters']=_[_0xa153('0x32')](_0x3ce108[_0xa153('0x30')],_0x3ce108[_0xa153('0x31')]);_0xbbc6ee['attributes']=_['intersection'](_0x3ce108[_0xa153('0x30')],qs[_0xa153('0x33')](_0x36f811[_0xa153('0x31')]['fields']));_0xbbc6ee['attributes']=_0xbbc6ee['attributes'][_0xa153('0x34')]?_0xbbc6ee[_0xa153('0x35')]:_0x3ce108['model'];if(!_0x36f811[_0xa153('0x31')][_0xa153('0x36')](_0xa153('0x37'))){_0xbbc6ee[_0xa153('0x1e')]=qs['limit'](_0x36f811[_0xa153('0x31')][_0xa153('0x1e')]);_0xbbc6ee[_0xa153('0x1c')]=qs[_0xa153('0x1c')](_0x36f811[_0xa153('0x31')][_0xa153('0x1c')]);}_0xbbc6ee['order']=qs[_0xa153('0x38')](_0x36f811[_0xa153('0x31')][_0xa153('0x38')]);_0xbbc6ee[_0xa153('0x39')]=qs[_0xa153('0x3a')](_[_0xa153('0x3b')](_0x36f811['query'],_0x3ce108[_0xa153('0x3a')]),_0x5d62f8);if(_0x36f811[_0xa153('0x31')][_0xa153('0x3c')]){_0xbbc6ee['where']=_[_0xa153('0x3d')](_0xbbc6ee['where'],{'$or':_[_0xa153('0x2c')](_0x5d62f8,function(_0x2cd152){if(_0x2cd152[_0xa153('0x2e')]!=='VIRTUAL'){var _0x478c7f={};_0x478c7f[_0x2cd152['name']]={'$like':'%'+_0x36f811[_0xa153('0x31')]['filter']+'%'};return _0x478c7f;}})});}_0xbbc6ee=_['merge']({},_0xbbc6ee,_0x36f811[_0xa153('0x3e')]);var _0x27a77c={'where':_0xbbc6ee[_0xa153('0x39')]};return db[_0xa153('0x3f')][_0xa153('0x1f')](_0x27a77c)['then'](function(_0xd3df11){_0x3f2646['count']=_0xd3df11;if(_0x36f811[_0xa153('0x31')][_0xa153('0x40')]){_0xbbc6ee[_0xa153('0x41')]=[{'all':!![]}];}return db[_0xa153('0x3f')][_0xa153('0x42')](_0xbbc6ee);})[_0xa153('0x25')](function(_0x3140a2){_0x3f2646[_0xa153('0x43')]=_0x3140a2;return _0x3f2646;})[_0xa153('0x25')](respondWithFilteredResult(_0x4c20e0,_0xbbc6ee))[_0xa153('0x44')](handleError(_0x4c20e0,null));};exports['show']=function(_0x5a70ed,_0x224afd){var _0xfa67db={'raw':!![],'where':{'id':_0x5a70ed['params']['id']}},_0x44e83d={};_0x44e83d[_0xa153('0x30')]=_[_0xa153('0x45')](db['AnalyticTreeReport'][_0xa153('0x2d')]);_0x44e83d[_0xa153('0x31')]=_[_0xa153('0x45')](_0x5a70ed[_0xa153('0x31')]);_0x44e83d[_0xa153('0x3a')]=_['intersection'](_0x44e83d[_0xa153('0x30')],_0x44e83d['query']);_0xfa67db[_0xa153('0x35')]=_['intersection'](_0x44e83d[_0xa153('0x30')],qs['fields'](_0x5a70ed[_0xa153('0x31')][_0xa153('0x33')]));_0xfa67db[_0xa153('0x35')]=_0xfa67db[_0xa153('0x35')][_0xa153('0x34')]?_0xfa67db['attributes']:_0x44e83d['model'];if(_0x5a70ed[_0xa153('0x31')][_0xa153('0x40')]){_0xfa67db[_0xa153('0x41')]=[{'all':!![]}];}_0xfa67db=_[_0xa153('0x3d')]({},_0xfa67db,_0x5a70ed[_0xa153('0x3e')]);return db['AnalyticTreeReport'][_0xa153('0x46')](_0xfa67db)['then'](handleEntityNotFound(_0x224afd,null))[_0xa153('0x25')](respondWithResult(_0x224afd,null))['catch'](handleError(_0x224afd,null));};exports[_0xa153('0x47')]=function(_0x40e46e,_0x4e7fc4){return db[_0xa153('0x3f')]['create'](_0x40e46e['body'],{})[_0xa153('0x25')](respondWithResult(_0x4e7fc4,0xc9))[_0xa153('0x44')](handleError(_0x4e7fc4,null));};exports[_0xa153('0x48')]=function(_0xd18485,_0x456fe3){if(_0xd18485[_0xa153('0x49')]['id']){delete _0xd18485['body']['id'];}return db[_0xa153('0x3f')]['find']({'where':{'id':_0xd18485[_0xa153('0x4a')]['id']}})[_0xa153('0x25')](handleEntityNotFound(_0x456fe3,null))['then'](saveUpdates(_0xd18485[_0xa153('0x49')],null))['then'](respondWithResult(_0x456fe3,null))['catch'](handleError(_0x456fe3,null));};exports[_0xa153('0x4b')]=function(_0x57e33f,_0x50f310){return db[_0xa153('0x3f')][_0xa153('0x46')]({'where':{'id':_0x57e33f['params']['id']}})[_0xa153('0x25')](handleEntityNotFound(_0x50f310,null))[_0xa153('0x25')](removeEntity(_0x50f310,null))[_0xa153('0x44')](handleError(_0x50f310,null));};
\ No newline at end of file
+var _0x9354=['fieldName','type','key','model','query','keys','intersection','attributes','fields','length','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','include','findAll','rows','catch','show','params','includeAll','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x9354,0x69));var _0x4935=function(_0x2134b7,_0x1eb5e2){_0x2134b7=_0x2134b7-0x0;var _0x6c5914=_0x9354[_0x2134b7];return _0x6c5914;};'use strict';var emlformat=require(_0x4935('0x0'));var rimraf=require(_0x4935('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4935('0x2'));var rp=require(_0x4935('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4935('0x4'));var path=require(_0x4935('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4935('0x6'));var fs=require('fs');var fs_extra=require(_0x4935('0x7'));var _=require(_0x4935('0x8'));var squel=require(_0x4935('0x9'));var crypto=require(_0x4935('0xa'));var jsforce=require(_0x4935('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4935('0xc'));var Papa=require(_0x4935('0xd'));var Redis=require(_0x4935('0xe'));var authService=require(_0x4935('0xf'));var qs=require(_0x4935('0x10'));var as=require(_0x4935('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4935('0x12'))(_0x4935('0x13'));var utils=require(_0x4935('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4935('0x15'))['db'];function respondWithStatusCode(_0x43f0bd,_0x58837c){_0x58837c=_0x58837c||0xcc;return function(_0x2a3b47){if(_0x2a3b47){return _0x43f0bd[_0x4935('0x16')](_0x58837c);}return _0x43f0bd[_0x4935('0x17')](_0x58837c)['end']();};}function respondWithResult(_0x33b899,_0x3dc622){_0x3dc622=_0x3dc622||0xc8;return function(_0x196a77){if(_0x196a77){return _0x33b899[_0x4935('0x17')](_0x3dc622)[_0x4935('0x18')](_0x196a77);}};}function respondWithFilteredResult(_0x162d52,_0x2a0de9){return function(_0x3f1b08){if(_0x3f1b08){var _0x36d9f0=typeof _0x2a0de9[_0x4935('0x19')]===_0x4935('0x1a')&&typeof _0x2a0de9['limit']===_0x4935('0x1a');var _0x5000d3=_0x3f1b08[_0x4935('0x1b')];var _0x53b0f4=_0x36d9f0?0x0:_0x2a0de9[_0x4935('0x19')];var _0x2ca23d=_0x36d9f0?_0x3f1b08['count']:_0x2a0de9[_0x4935('0x19')]+_0x2a0de9['limit'];var _0x308459;if(_0x2ca23d>=_0x5000d3){_0x2ca23d=_0x5000d3;_0x308459=0xc8;}else{_0x308459=0xce;}_0x162d52[_0x4935('0x17')](_0x308459);return _0x162d52['set'](_0x4935('0x1c'),_0x53b0f4+'-'+_0x2ca23d+'/'+_0x5000d3)[_0x4935('0x18')](_0x3f1b08);}return null;};}function patchUpdates(_0x1b589e){return function(_0xc7637a){try{jsonpatch[_0x4935('0x1d')](_0xc7637a,_0x1b589e,!![]);}catch(_0x34cca8){return BPromise[_0x4935('0x1e')](_0x34cca8);}return _0xc7637a[_0x4935('0x1f')]();};}function saveUpdates(_0x43c2a5,_0x331324){return function(_0x366793){if(_0x366793){return _0x366793[_0x4935('0x20')](_0x43c2a5)[_0x4935('0x21')](function(_0x5be99e){return _0x5be99e;});}return null;};}function removeEntity(_0x2f5df9,_0x3aa23f){return function(_0x5c96a0){if(_0x5c96a0){return _0x5c96a0[_0x4935('0x22')]()[_0x4935('0x21')](function(){_0x2f5df9[_0x4935('0x17')](0xcc)[_0x4935('0x23')]();});}};}function handleEntityNotFound(_0x1d4579,_0x1945b4){return function(_0x26a759){if(!_0x26a759){_0x1d4579[_0x4935('0x16')](0x194);}return _0x26a759;};}function handleError(_0x10314e,_0x245c6f){_0x245c6f=_0x245c6f||0x1f4;return function(_0x24a0c3){logger[_0x4935('0x24')](_0x24a0c3[_0x4935('0x25')]);if(_0x24a0c3[_0x4935('0x26')]){delete _0x24a0c3['name'];}_0x10314e[_0x4935('0x17')](_0x245c6f)[_0x4935('0x27')](_0x24a0c3);};}exports[_0x4935('0x28')]=function(_0x425595,_0x273205){var _0x5486c8={},_0x44baca={},_0x2d9188={'count':0x0,'rows':[]};var _0x2ce9a0=_[_0x4935('0x29')](db['AnalyticTreeReport'][_0x4935('0x2a')],function(_0x53b37e){return{'name':_0x53b37e[_0x4935('0x2b')],'type':_0x53b37e[_0x4935('0x2c')][_0x4935('0x2d')]};});_0x44baca[_0x4935('0x2e')]=_[_0x4935('0x29')](_0x2ce9a0,_0x4935('0x26'));_0x44baca[_0x4935('0x2f')]=_[_0x4935('0x30')](_0x425595[_0x4935('0x2f')]);_0x44baca['filters']=_[_0x4935('0x31')](_0x44baca[_0x4935('0x2e')],_0x44baca[_0x4935('0x2f')]);_0x5486c8[_0x4935('0x32')]=_[_0x4935('0x31')](_0x44baca['model'],qs[_0x4935('0x33')](_0x425595[_0x4935('0x2f')][_0x4935('0x33')]));_0x5486c8[_0x4935('0x32')]=_0x5486c8[_0x4935('0x32')][_0x4935('0x34')]?_0x5486c8[_0x4935('0x32')]:_0x44baca[_0x4935('0x2e')];if(!_0x425595[_0x4935('0x2f')]['hasOwnProperty']('nolimit')){_0x5486c8[_0x4935('0x35')]=qs[_0x4935('0x35')](_0x425595['query'][_0x4935('0x35')]);_0x5486c8[_0x4935('0x19')]=qs[_0x4935('0x19')](_0x425595['query']['offset']);}_0x5486c8[_0x4935('0x36')]=qs[_0x4935('0x37')](_0x425595[_0x4935('0x2f')][_0x4935('0x37')]);_0x5486c8[_0x4935('0x38')]=qs[_0x4935('0x39')](_[_0x4935('0x3a')](_0x425595[_0x4935('0x2f')],_0x44baca[_0x4935('0x39')]),_0x2ce9a0);if(_0x425595[_0x4935('0x2f')][_0x4935('0x3b')]){_0x5486c8['where']=_[_0x4935('0x3c')](_0x5486c8['where'],{'$or':_['map'](_0x2ce9a0,function(_0x5bbadf){if(_0x5bbadf[_0x4935('0x2c')]!==_0x4935('0x3d')){var _0x21b499={};_0x21b499[_0x5bbadf[_0x4935('0x26')]]={'$like':'%'+_0x425595[_0x4935('0x2f')][_0x4935('0x3b')]+'%'};return _0x21b499;}})});}_0x5486c8=_[_0x4935('0x3c')]({},_0x5486c8,_0x425595[_0x4935('0x3e')]);var _0x53eb99={'where':_0x5486c8['where']};return db[_0x4935('0x3f')][_0x4935('0x1b')](_0x53eb99)[_0x4935('0x21')](function(_0x33bd68){_0x2d9188[_0x4935('0x1b')]=_0x33bd68;if(_0x425595['query']['includeAll']){_0x5486c8[_0x4935('0x40')]=[{'all':!![]}];}return db[_0x4935('0x3f')][_0x4935('0x41')](_0x5486c8);})[_0x4935('0x21')](function(_0x144a0c){_0x2d9188[_0x4935('0x42')]=_0x144a0c;return _0x2d9188;})[_0x4935('0x21')](respondWithFilteredResult(_0x273205,_0x5486c8))[_0x4935('0x43')](handleError(_0x273205,null));};exports[_0x4935('0x44')]=function(_0x195df1,_0x526f3f){var _0x518491={'raw':!![],'where':{'id':_0x195df1[_0x4935('0x45')]['id']}},_0xc6bda3={};_0xc6bda3[_0x4935('0x2e')]=_[_0x4935('0x30')](db[_0x4935('0x3f')]['rawAttributes']);_0xc6bda3['query']=_['keys'](_0x195df1[_0x4935('0x2f')]);_0xc6bda3['filters']=_[_0x4935('0x31')](_0xc6bda3[_0x4935('0x2e')],_0xc6bda3['query']);_0x518491[_0x4935('0x32')]=_[_0x4935('0x31')](_0xc6bda3['model'],qs[_0x4935('0x33')](_0x195df1[_0x4935('0x2f')]['fields']));_0x518491[_0x4935('0x32')]=_0x518491[_0x4935('0x32')]['length']?_0x518491[_0x4935('0x32')]:_0xc6bda3[_0x4935('0x2e')];if(_0x195df1[_0x4935('0x2f')][_0x4935('0x46')]){_0x518491[_0x4935('0x40')]=[{'all':!![]}];}_0x518491=_['merge']({},_0x518491,_0x195df1[_0x4935('0x3e')]);return db[_0x4935('0x3f')]['find'](_0x518491)['then'](handleEntityNotFound(_0x526f3f,null))['then'](respondWithResult(_0x526f3f,null))['catch'](handleError(_0x526f3f,null));};exports['create']=function(_0x17c808,_0x3265f4){return db[_0x4935('0x3f')][_0x4935('0x47')](_0x17c808[_0x4935('0x48')],{})[_0x4935('0x21')](respondWithResult(_0x3265f4,0xc9))[_0x4935('0x43')](handleError(_0x3265f4,null));};exports[_0x4935('0x20')]=function(_0x406c07,_0x108a30){if(_0x406c07[_0x4935('0x48')]['id']){delete _0x406c07[_0x4935('0x48')]['id'];}return db[_0x4935('0x3f')][_0x4935('0x49')]({'where':{'id':_0x406c07['params']['id']}})['then'](handleEntityNotFound(_0x108a30,null))[_0x4935('0x21')](saveUpdates(_0x406c07[_0x4935('0x48')],null))['then'](respondWithResult(_0x108a30,null))[_0x4935('0x43')](handleError(_0x108a30,null));};exports['destroy']=function(_0x4e1838,_0x23cdfc){return db['AnalyticTreeReport'][_0x4935('0x49')]({'where':{'id':_0x4e1838[_0x4935('0x45')]['id']}})[_0x4935('0x21')](handleEntityNotFound(_0x23cdfc,null))[_0x4935('0x21')](removeEntity(_0x23cdfc,null))[_0x4935('0x43')](handleError(_0x23cdfc,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 05be132..29ca64d 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 _0xdc6c=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','util','api','bluebird','request-promise','path','rimraf'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdc6c,0x68));var _0xcdc6=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xdc6c[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require('lodash');var util=require(_0xcdc6('0x0'));var logger=require('../../config/logger')(_0xcdc6('0x1'));var moment=require('moment');var BPromise=require(_0xcdc6('0x2'));var rp=require(_0xcdc6('0x3'));var fs=require('fs');var path=require(_0xcdc6('0x4'));var rimraf=require(_0xcdc6('0x5'));var config=require(_0xcdc6('0x6'));var attributes=require(_0xcdc6('0x7'));module[_0xcdc6('0x8')]=function(_0x306308,_0x450fdf){return _0x306308[_0xcdc6('0x9')](_0xcdc6('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2b57=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','path','./analyticTreeReport.attributes'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x2b57,0x1ec));var _0x72b5=function(_0x2d699c,_0x52281f){_0x2d699c=_0x2d699c-0x0;var _0xb25aa3=_0x2b57[_0x2d699c];return _0xb25aa3;};'use strict';var _=require(_0x72b5('0x0'));var util=require(_0x72b5('0x1'));var logger=require(_0x72b5('0x2'))(_0x72b5('0x3'));var moment=require(_0x72b5('0x4'));var BPromise=require(_0x72b5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x72b5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x72b5('0x7'));module['exports']=function(_0x3f5a40,_0x1206c1){return _0x3f5a40['define'](_0x72b5('0x8'),attributes,{'tableName':_0x72b5('0x9'),'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 be42a80..e3b890f 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x97a80f,_0x3d70d7){var _0x534071=function(_0xd8966e){while(--_0xd8966e){_0x97a80f['push'](_0x97a80f['shift']());}};_0x534071(++_0x3d70d7);}(_0xadb5,0xad));var _0x5adb=function(_0x2622a3,_0x2a099e){_0x2622a3=_0x2622a3-0x0;var _0x1000e7=_0xadb5[_0x2622a3];return _0x1000e7;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x322743,_0x3903b9){var _0x13de4d=function(_0x13a597){while(--_0x13a597){_0x322743['push'](_0x322743['shift']());}};_0x13de4d(++_0x3903b9);}(_0x2ef3,0xba));var _0x32ef=function(_0x28b178,_0x4d8ead){_0x28b178=_0x28b178-0x0;var _0x413f5b=_0x2ef3[_0x28b178];return _0x413f5b;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 57d26b4..7043111 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 _0xa743=['isAuthenticated','get','/:id','show','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa743,0x86));var _0x3a74=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xa743[_0x39e283];return _0x7de89f;};'use strict';var multer=require(_0x3a74('0x0'));var util=require('util');var path=require(_0x3a74('0x1'));var timeout=require(_0x3a74('0x2'));var express=require(_0x3a74('0x3'));var router=express[_0x3a74('0x4')]();var fs_extra=require(_0x3a74('0x5'));var auth=require(_0x3a74('0x6'));var interaction=require(_0x3a74('0x7'));var config=require(_0x3a74('0x8'));var controller=require(_0x3a74('0x9'));router['get']('/',auth[_0x3a74('0xa')](),controller['index']);router[_0x3a74('0xb')](_0x3a74('0xc'),auth[_0x3a74('0xa')](),controller[_0x3a74('0xd')]);router['post']('/',auth[_0x3a74('0xa')](),controller[_0x3a74('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3a74('0xf')](_0x3a74('0xc'),auth[_0x3a74('0xa')](),controller[_0x3a74('0x10')]);module[_0x3a74('0x11')]=router;
\ No newline at end of file
+var _0x4feb=['delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','show','create','put'];(function(_0x2776db,_0xfb2eda){var _0x572930=function(_0x5e1032){while(--_0x5e1032){_0x2776db['push'](_0x2776db['shift']());}};_0x572930(++_0xfb2eda);}(_0x4feb,0x10d));var _0xb4fe=function(_0x2a2c65,_0x22033b){_0x2a2c65=_0x2a2c65-0x0;var _0x413b09=_0x4feb[_0x2a2c65];return _0x413b09;};'use strict';var multer=require(_0xb4fe('0x0'));var util=require('util');var path=require(_0xb4fe('0x1'));var timeout=require(_0xb4fe('0x2'));var express=require('express');var router=express[_0xb4fe('0x3')]();var fs_extra=require(_0xb4fe('0x4'));var auth=require(_0xb4fe('0x5'));var interaction=require(_0xb4fe('0x6'));var config=require(_0xb4fe('0x7'));var controller=require(_0xb4fe('0x8'));router[_0xb4fe('0x9')]('/',auth['isAuthenticated'](),controller[_0xb4fe('0xa')]);router[_0xb4fe('0x9')](_0xb4fe('0xb'),auth[_0xb4fe('0xc')](),controller[_0xb4fe('0xd')]);router['post']('/',auth[_0xb4fe('0xc')](),controller[_0xb4fe('0xe')]);router[_0xb4fe('0xf')](_0xb4fe('0xb'),auth[_0xb4fe('0xc')](),controller['update']);router[_0xb4fe('0x10')](_0xb4fe('0xb'),auth['isAuthenticated'](),controller[_0xb4fe('0x11')]);module[_0xb4fe('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 a537755..b3fbacc 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 _0x057a=['exports','STRING','sequelize'];(function(_0x1081f0,_0x1d5187){var _0x142afa=function(_0x5c9f4b){while(--_0x5c9f4b){_0x1081f0['push'](_0x1081f0['shift']());}};_0x142afa(++_0x1d5187);}(_0x057a,0x1a6));var _0xa057=function(_0x5d53c0,_0x2e113f){_0x5d53c0=_0x5d53c0-0x0;var _0xb29b20=_0x057a[_0x5d53c0];return _0xb29b20;};'use strict';var Sequelize=require(_0xa057('0x0'));module[_0xa057('0x1')]={'name':{'type':Sequelize[_0xa057('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa057('0x2')]}};
\ No newline at end of file
+var _0x01d3=['STRING'];(function(_0x5de214,_0x107e9d){var _0x4df627=function(_0x4199e1){while(--_0x4199e1){_0x5de214['push'](_0x5de214['shift']());}};_0x4df627(++_0x107e9d);}(_0x01d3,0xdb));var _0x301d=function(_0x4c5613,_0x2a18f2){_0x4c5613=_0x4c5613-0x0;var _0x2689da=_0x01d3[_0x4c5613];return _0x2689da;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x301d('0x0')]},'basename':{'type':Sequelize[_0x301d('0x0')]},'type':{'type':Sequelize[_0x301d('0x0')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 3564895..9bfc560 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 _0x3174=['sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','clone','length','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit'];(function(_0x2ee20d,_0x354e70){var _0xade530=function(_0x1db7cc){while(--_0x1db7cc){_0x2ee20d['push'](_0x2ee20d['shift']());}};_0xade530(++_0x354e70);}(_0x3174,0x18c));var _0x4317=function(_0x50df1f,_0x45b8b1){_0x50df1f=_0x50df1f-0x0;var _0x5180e3=_0x3174[_0x50df1f];return _0x5180e3;};'use strict';var emlformat=require(_0x4317('0x0'));var rimraf=require(_0x4317('0x1'));var zipdir=require(_0x4317('0x2'));var jsonpatch=require(_0x4317('0x3'));var rp=require(_0x4317('0x4'));var moment=require('moment');var BPromise=require(_0x4317('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4317('0x6'));var sox=require(_0x4317('0x7'));var csv=require(_0x4317('0x8'));var ejs=require(_0x4317('0x9'));var fs=require('fs');var fs_extra=require(_0x4317('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4317('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4317('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4317('0xd'));var Redis=require(_0x4317('0xe'));var authService=require(_0x4317('0xf'));var qs=require(_0x4317('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4317('0x11'));var logger=require(_0x4317('0x12'))(_0x4317('0x13'));var utils=require(_0x4317('0x14'));var config=require(_0x4317('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4317('0x16'))['db'];function respondWithStatusCode(_0x18a625,_0x33fd1c){_0x33fd1c=_0x33fd1c||0xcc;return function(_0x298aed){if(_0x298aed){return _0x18a625[_0x4317('0x17')](_0x33fd1c);}return _0x18a625[_0x4317('0x18')](_0x33fd1c)[_0x4317('0x19')]();};}function respondWithResult(_0x49920a,_0x26ef32){_0x26ef32=_0x26ef32||0xc8;return function(_0x10024e){if(_0x10024e){return _0x49920a[_0x4317('0x18')](_0x26ef32)[_0x4317('0x1a')](_0x10024e);}};}function respondWithFilteredResult(_0x57901b,_0x250fc3){return function(_0x219adf){if(_0x219adf){var _0x150d36=typeof _0x250fc3[_0x4317('0x1b')]===_0x4317('0x1c')&&typeof _0x250fc3[_0x4317('0x1d')]===_0x4317('0x1c');var _0x17bcf8=_0x219adf['count'];var _0x37aa88=_0x150d36?0x0:_0x250fc3['offset'];var _0x5a4177=_0x150d36?_0x219adf[_0x4317('0x1e')]:_0x250fc3[_0x4317('0x1b')]+_0x250fc3['limit'];var _0x3a9466;if(_0x5a4177>=_0x17bcf8){_0x5a4177=_0x17bcf8;_0x3a9466=0xc8;}else{_0x3a9466=0xce;}_0x57901b[_0x4317('0x18')](_0x3a9466);return _0x57901b[_0x4317('0x1f')](_0x4317('0x20'),_0x37aa88+'-'+_0x5a4177+'/'+_0x17bcf8)[_0x4317('0x1a')](_0x219adf);}return null;};}function patchUpdates(_0x2ea18a){return function(_0xd4cb2c){try{jsonpatch[_0x4317('0x21')](_0xd4cb2c,_0x2ea18a,!![]);}catch(_0x554294){return BPromise['reject'](_0x554294);}return _0xd4cb2c['save']();};}function saveUpdates(_0x2b88cc,_0x5c495a){return function(_0x22d28){if(_0x22d28){return _0x22d28[_0x4317('0x22')](_0x2b88cc)[_0x4317('0x23')](function(_0x35855e){return _0x35855e;});}return null;};}function removeEntity(_0x30360e,_0x2a3eb0){return function(_0x407b6c){if(_0x407b6c){return _0x407b6c[_0x4317('0x24')]()[_0x4317('0x23')](function(){_0x30360e[_0x4317('0x18')](0xcc)[_0x4317('0x19')]();});}};}function handleEntityNotFound(_0x4b179e,_0x3ea927){return function(_0x15c091){if(!_0x15c091){_0x4b179e[_0x4317('0x17')](0x194);}return _0x15c091;};}function handleError(_0x97e718,_0x42c0a6){_0x42c0a6=_0x42c0a6||0x1f4;return function(_0x4c50e7){logger['error'](_0x4c50e7[_0x4317('0x25')]);if(_0x4c50e7[_0x4317('0x26')]){delete _0x4c50e7[_0x4317('0x26')];}_0x97e718[_0x4317('0x18')](_0x42c0a6)['send'](_0x4c50e7);};}exports[_0x4317('0x27')]=function(_0x14ec45,_0x18409e){var _0x36b6d1={},_0x2b21c4={},_0x5702ce={'count':0x0,'rows':[]};var _0xa5b3d3=_[_0x4317('0x28')](db[_0x4317('0x29')][_0x4317('0x2a')],function(_0x260e5f){return{'name':_0x260e5f[_0x4317('0x2b')],'type':_0x260e5f[_0x4317('0x2c')][_0x4317('0x2d')]};});_0x2b21c4['model']=_['map'](_0xa5b3d3,_0x4317('0x26'));_0x2b21c4['query']=_[_0x4317('0x2e')](_0x14ec45[_0x4317('0x2f')]);_0x2b21c4['filters']=_[_0x4317('0x30')](_0x2b21c4[_0x4317('0x31')],_0x2b21c4[_0x4317('0x2f')]);_0x36b6d1[_0x4317('0x32')]=_['intersection'](_0x2b21c4['model'],qs[_0x4317('0x33')](_0x14ec45[_0x4317('0x2f')][_0x4317('0x33')]));_0x36b6d1[_0x4317('0x32')]=_0x36b6d1[_0x4317('0x32')]['length']?_0x36b6d1['attributes']:_0x2b21c4[_0x4317('0x31')];if(!_0x14ec45['query'][_0x4317('0x34')](_0x4317('0x35'))){_0x36b6d1[_0x4317('0x1d')]=qs[_0x4317('0x1d')](_0x14ec45['query'][_0x4317('0x1d')]);_0x36b6d1[_0x4317('0x1b')]=qs[_0x4317('0x1b')](_0x14ec45[_0x4317('0x2f')][_0x4317('0x1b')]);}_0x36b6d1['order']=qs[_0x4317('0x36')](_0x14ec45[_0x4317('0x2f')]['sort']);_0x36b6d1['where']=qs[_0x4317('0x37')](_[_0x4317('0x38')](_0x14ec45[_0x4317('0x2f')],_0x2b21c4[_0x4317('0x37')]),_0xa5b3d3);if(_0x14ec45[_0x4317('0x2f')][_0x4317('0x39')]){_0x36b6d1[_0x4317('0x3a')]=_[_0x4317('0x3b')](_0x36b6d1[_0x4317('0x3a')],{'$or':_['map'](_0xa5b3d3,function(_0x3328d8){if(_0x3328d8[_0x4317('0x2c')]!==_0x4317('0x3c')){var _0xe3e1e7={};_0xe3e1e7[_0x3328d8[_0x4317('0x26')]]={'$like':'%'+_0x14ec45['query']['filter']+'%'};return _0xe3e1e7;}})});}_0x36b6d1=_['merge']({},_0x36b6d1,_0x14ec45[_0x4317('0x3d')]);var _0x344eee={'where':_0x36b6d1[_0x4317('0x3a')]};return db[_0x4317('0x29')]['count'](_0x344eee)[_0x4317('0x23')](function(_0x17a217){_0x5702ce[_0x4317('0x1e')]=_0x17a217;if(_0x14ec45[_0x4317('0x2f')][_0x4317('0x3e')]){_0x36b6d1[_0x4317('0x3f')]=[{'all':!![]}];}return db[_0x4317('0x29')][_0x4317('0x40')](_0x36b6d1);})[_0x4317('0x23')](function(_0x1732d8){_0x5702ce[_0x4317('0x41')]=_0x1732d8;return _0x5702ce;})[_0x4317('0x23')](respondWithFilteredResult(_0x18409e,_0x36b6d1))[_0x4317('0x42')](handleError(_0x18409e,null));};exports[_0x4317('0x43')]=function(_0xe3cf85,_0x5b510b){var _0xc37a78={'raw':!![],'where':{'id':_0xe3cf85[_0x4317('0x44')]['id']}},_0x52f7e0={};_0x52f7e0[_0x4317('0x31')]=_['keys'](db[_0x4317('0x29')][_0x4317('0x2a')]);_0x52f7e0[_0x4317('0x2f')]=_['keys'](_0xe3cf85['query']);_0x52f7e0[_0x4317('0x37')]=_[_0x4317('0x30')](_0x52f7e0[_0x4317('0x31')],_0x52f7e0[_0x4317('0x2f')]);_0xc37a78[_0x4317('0x32')]=_[_0x4317('0x30')](_0x52f7e0[_0x4317('0x31')],qs[_0x4317('0x33')](_0xe3cf85[_0x4317('0x2f')]['fields']));_0xc37a78[_0x4317('0x32')]=_0xc37a78[_0x4317('0x32')]['length']?_0xc37a78[_0x4317('0x32')]:_0x52f7e0[_0x4317('0x31')];if(_0xe3cf85[_0x4317('0x2f')][_0x4317('0x3e')]){_0xc37a78[_0x4317('0x3f')]=[{'all':!![]}];}_0xc37a78=_[_0x4317('0x3b')]({},_0xc37a78,_0xe3cf85[_0x4317('0x3d')]);return db['Attachment'][_0x4317('0x45')](_0xc37a78)[_0x4317('0x23')](handleEntityNotFound(_0x5b510b,null))['then'](respondWithResult(_0x5b510b,null))['catch'](handleError(_0x5b510b,null));};exports[_0x4317('0x46')]=function(_0x501991,_0x5a52a9){var _0x568750={'where':{'id':_0x501991['params']['id']}},_0xfa9647={};_0xfa9647[_0x4317('0x31')]=_[_0x4317('0x2e')](db['Attachment'][_0x4317('0x2a')]);_0x568750['attributes']=_[_0x4317('0x30')](_0xfa9647['model'],qs[_0x4317('0x33')](_0x501991[_0x4317('0x2f')]['fields']));_0x568750[_0x4317('0x32')]=_0x568750[_0x4317('0x32')][_0x4317('0x47')]?_0x568750[_0x4317('0x32')]:_0xfa9647[_0x4317('0x31')];if(_0x501991[_0x4317('0x2f')][_0x4317('0x3e')]){_0x568750[_0x4317('0x3f')]=[{'all':!![]}];}_0x568750=_['merge']({},_0x568750,_0x501991[_0x4317('0x3d')]);return db[_0x4317('0x29')][_0x4317('0x45')](_0x568750)[_0x4317('0x23')](handleEntityNotFound(_0x5a52a9,null))[_0x4317('0x23')](function(_0x41645e){if(_0x41645e){var _0x1fd5d2=_0x41645e[_0x4317('0x48')]({'plain':!![]});_0x1fd5d2=qs[_0x4317('0x49')](_0x1fd5d2,['id',_0x4317('0x4a'),_0x4317('0x4b')]);_0x501991[_0x4317('0x4c')]=_[_0x4317('0x49')](_0x501991[_0x4317('0x4c')],['id',_0x4317('0x4a'),_0x4317('0x4b')]);return db[_0x4317('0x29')][_0x4317('0x4d')](_[_0x4317('0x3b')](_0x1fd5d2,_0x501991[_0x4317('0x4c')]),{'include':_0x501991[_0x4317('0x2f')][_0x4317('0x3e')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x5a52a9,0xc9))[_0x4317('0x42')](handleError(_0x5a52a9,null));};exports[_0x4317('0x22')]=function(_0x4b6176,_0x2f1b2b){if(_0x4b6176[_0x4317('0x4c')]['id']){delete _0x4b6176[_0x4317('0x4c')]['id'];}return db[_0x4317('0x29')][_0x4317('0x45')]({'where':{'id':_0x4b6176['params']['id']}})[_0x4317('0x23')](handleEntityNotFound(_0x2f1b2b,null))['then'](saveUpdates(_0x4b6176[_0x4317('0x4c')],null))[_0x4317('0x23')](respondWithResult(_0x2f1b2b,null))[_0x4317('0x42')](handleError(_0x2f1b2b,null));};exports['destroy']=function(_0x37d421,_0x80cf75){return db[_0x4317('0x29')][_0x4317('0x45')]({'where':{'id':_0x37d421[_0x4317('0x44')]['id']}})['then'](handleEntityNotFound(_0x80cf75,null))[_0x4317('0x23')](removeEntity(_0x80cf75,null))[_0x4317('0x42')](handleError(_0x80cf75,null));};exports['create']=function(_0x4cabe5,_0x345b02,_0x7183ae){_0x4cabe5['body'][_0x4317('0x26')]=_0x4cabe5[_0x4317('0x4e')][_0x4317('0x4f')];_0x4cabe5[_0x4317('0x4c')][_0x4317('0x50')]=_0x4cabe5[_0x4317('0x4e')][_0x4317('0x51')];_0x4cabe5[_0x4317('0x4c')][_0x4317('0x2c')]=_0x4cabe5['file'][_0x4317('0x52')];return db[_0x4317('0x29')][_0x4317('0x4d')](_0x4cabe5[_0x4317('0x4c')])[_0x4317('0x23')](respondWithResult(_0x345b02,0xc9))[_0x4317('0x42')](handleError(_0x345b02,null));};exports['download']=function(_0x46113e,_0x22b46e,_0x5bed47){return db[_0x4317('0x29')][_0x4317('0x53')]({'where':{'id':_0x46113e['params']['id']},'raw':!![]})[_0x4317('0x23')](handleEntityNotFound(_0x22b46e,null))[_0x4317('0x23')](function(_0x52a3f0){if(_0x52a3f0){var _0x45f418=_0x52a3f0[_0x4317('0x54')]!==null;var _0x469ea0=path[_0x4317('0x55')](config[_0x4317('0x56')],_0x4317('0x57'));if(_0x45f418){_0x469ea0=path[_0x4317('0x55')](_0x469ea0,_0x4317('0x58'));}var _0x555a16=path[_0x4317('0x55')](_0x469ea0,_0x52a3f0[_0x4317('0x50')]);return _0x22b46e[_0x4317('0x59')](_0x555a16);}})[_0x4317('0x42')](handleError(_0x22b46e,null));};
\ No newline at end of file
+var _0x10d5=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','filename','mimetype','download','findOne','join','root','server/files/attachments/','basename','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0xeab865,_0x15f419){var _0x1c8000=function(_0x27fb80){while(--_0x27fb80){_0xeab865['push'](_0xeab865['shift']());}};_0x1c8000(++_0x15f419);}(_0x10d5,0x1b6));var _0x510d=function(_0x3dc68d,_0x1c1951){_0x3dc68d=_0x3dc68d-0x0;var _0xdf7f94=_0x10d5[_0x3dc68d];return _0xdf7f94;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x510d('0x0'));var jsonpatch=require(_0x510d('0x1'));var rp=require(_0x510d('0x2'));var moment=require(_0x510d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x510d('0x4'));var util=require(_0x510d('0x5'));var path=require(_0x510d('0x6'));var sox=require(_0x510d('0x7'));var csv=require(_0x510d('0x8'));var ejs=require(_0x510d('0x9'));var fs=require('fs');var fs_extra=require(_0x510d('0xa'));var _=require(_0x510d('0xb'));var squel=require(_0x510d('0xc'));var crypto=require(_0x510d('0xd'));var jsforce=require(_0x510d('0xe'));var deskjs=require(_0x510d('0xf'));var toCsv=require(_0x510d('0x8'));var querystring=require(_0x510d('0x10'));var Papa=require(_0x510d('0x11'));var Redis=require(_0x510d('0x12'));var authService=require(_0x510d('0x13'));var qs=require(_0x510d('0x14'));var as=require(_0x510d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x510d('0x16'))(_0x510d('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x510d('0x18'));var db=require(_0x510d('0x19'))['db'];function respondWithStatusCode(_0x14f51e,_0x27a665){_0x27a665=_0x27a665||0xcc;return function(_0x4d5c9d){if(_0x4d5c9d){return _0x14f51e[_0x510d('0x1a')](_0x27a665);}return _0x14f51e[_0x510d('0x1b')](_0x27a665)[_0x510d('0x1c')]();};}function respondWithResult(_0x288aea,_0x2c9159){_0x2c9159=_0x2c9159||0xc8;return function(_0x40f8d0){if(_0x40f8d0){return _0x288aea[_0x510d('0x1b')](_0x2c9159)[_0x510d('0x1d')](_0x40f8d0);}};}function respondWithFilteredResult(_0x76c13a,_0x335771){return function(_0x1b48e2){if(_0x1b48e2){var _0x27b2df=typeof _0x335771[_0x510d('0x1e')]==='undefined'&&typeof _0x335771[_0x510d('0x1f')]===_0x510d('0x20');var _0x8f506=_0x1b48e2[_0x510d('0x21')];var _0x53d75e=_0x27b2df?0x0:_0x335771[_0x510d('0x1e')];var _0x5716af=_0x27b2df?_0x1b48e2['count']:_0x335771['offset']+_0x335771[_0x510d('0x1f')];var _0x4f924a;if(_0x5716af>=_0x8f506){_0x5716af=_0x8f506;_0x4f924a=0xc8;}else{_0x4f924a=0xce;}_0x76c13a[_0x510d('0x1b')](_0x4f924a);return _0x76c13a[_0x510d('0x22')](_0x510d('0x23'),_0x53d75e+'-'+_0x5716af+'/'+_0x8f506)['json'](_0x1b48e2);}return null;};}function patchUpdates(_0x40b107){return function(_0x1cbba9){try{jsonpatch[_0x510d('0x24')](_0x1cbba9,_0x40b107,!![]);}catch(_0x4cbcdb){return BPromise[_0x510d('0x25')](_0x4cbcdb);}return _0x1cbba9['save']();};}function saveUpdates(_0x277e9e,_0xffb878){return function(_0x3d1424){if(_0x3d1424){return _0x3d1424[_0x510d('0x26')](_0x277e9e)[_0x510d('0x27')](function(_0x419fcd){return _0x419fcd;});}return null;};}function removeEntity(_0x2f1aac,_0x57b85d){return function(_0x21ebaa){if(_0x21ebaa){return _0x21ebaa['destroy']()[_0x510d('0x27')](function(){_0x2f1aac['status'](0xcc)[_0x510d('0x1c')]();});}};}function handleEntityNotFound(_0x17102d,_0x3e8d2c){return function(_0x30966e){if(!_0x30966e){_0x17102d[_0x510d('0x1a')](0x194);}return _0x30966e;};}function handleError(_0x459870,_0x22ec9a){_0x22ec9a=_0x22ec9a||0x1f4;return function(_0x2b115e){logger[_0x510d('0x28')](_0x2b115e[_0x510d('0x29')]);if(_0x2b115e[_0x510d('0x2a')]){delete _0x2b115e[_0x510d('0x2a')];}_0x459870[_0x510d('0x1b')](_0x22ec9a)[_0x510d('0x2b')](_0x2b115e);};}exports[_0x510d('0x2c')]=function(_0x20d534,_0x1231e7){var _0x1a9976={},_0x4f90d3={},_0x415286={'count':0x0,'rows':[]};var _0x518ca6=_['map'](db[_0x510d('0x2d')][_0x510d('0x2e')],function(_0x51d206){return{'name':_0x51d206[_0x510d('0x2f')],'type':_0x51d206[_0x510d('0x30')][_0x510d('0x31')]};});_0x4f90d3[_0x510d('0x32')]=_['map'](_0x518ca6,_0x510d('0x2a'));_0x4f90d3[_0x510d('0x33')]=_['keys'](_0x20d534[_0x510d('0x33')]);_0x4f90d3[_0x510d('0x34')]=_[_0x510d('0x35')](_0x4f90d3[_0x510d('0x32')],_0x4f90d3[_0x510d('0x33')]);_0x1a9976['attributes']=_[_0x510d('0x35')](_0x4f90d3[_0x510d('0x32')],qs[_0x510d('0x36')](_0x20d534[_0x510d('0x33')][_0x510d('0x36')]));_0x1a9976['attributes']=_0x1a9976[_0x510d('0x37')][_0x510d('0x38')]?_0x1a9976[_0x510d('0x37')]:_0x4f90d3[_0x510d('0x32')];if(!_0x20d534[_0x510d('0x33')]['hasOwnProperty']('nolimit')){_0x1a9976['limit']=qs[_0x510d('0x1f')](_0x20d534[_0x510d('0x33')][_0x510d('0x1f')]);_0x1a9976[_0x510d('0x1e')]=qs[_0x510d('0x1e')](_0x20d534[_0x510d('0x33')]['offset']);}_0x1a9976['order']=qs[_0x510d('0x39')](_0x20d534[_0x510d('0x33')][_0x510d('0x39')]);_0x1a9976['where']=qs[_0x510d('0x34')](_['pick'](_0x20d534[_0x510d('0x33')],_0x4f90d3[_0x510d('0x34')]),_0x518ca6);if(_0x20d534['query']['filter']){_0x1a9976[_0x510d('0x3a')]=_[_0x510d('0x3b')](_0x1a9976[_0x510d('0x3a')],{'$or':_[_0x510d('0x3c')](_0x518ca6,function(_0x2f55f1){if(_0x2f55f1[_0x510d('0x30')]!==_0x510d('0x3d')){var _0x1cbf30={};_0x1cbf30[_0x2f55f1['name']]={'$like':'%'+_0x20d534[_0x510d('0x33')][_0x510d('0x3e')]+'%'};return _0x1cbf30;}})});}_0x1a9976=_[_0x510d('0x3b')]({},_0x1a9976,_0x20d534[_0x510d('0x3f')]);var _0x201cae={'where':_0x1a9976[_0x510d('0x3a')]};return db['Attachment'][_0x510d('0x21')](_0x201cae)['then'](function(_0x50eea5){_0x415286[_0x510d('0x21')]=_0x50eea5;if(_0x20d534[_0x510d('0x33')][_0x510d('0x40')]){_0x1a9976[_0x510d('0x41')]=[{'all':!![]}];}return db[_0x510d('0x2d')][_0x510d('0x42')](_0x1a9976);})[_0x510d('0x27')](function(_0x2e5d59){_0x415286[_0x510d('0x43')]=_0x2e5d59;return _0x415286;})['then'](respondWithFilteredResult(_0x1231e7,_0x1a9976))[_0x510d('0x44')](handleError(_0x1231e7,null));};exports[_0x510d('0x45')]=function(_0x2cf613,_0x19d06f){var _0x26ef39={'raw':!![],'where':{'id':_0x2cf613[_0x510d('0x46')]['id']}},_0x33893f={};_0x33893f[_0x510d('0x32')]=_[_0x510d('0x47')](db['Attachment'][_0x510d('0x2e')]);_0x33893f['query']=_['keys'](_0x2cf613['query']);_0x33893f[_0x510d('0x34')]=_[_0x510d('0x35')](_0x33893f[_0x510d('0x32')],_0x33893f[_0x510d('0x33')]);_0x26ef39['attributes']=_[_0x510d('0x35')](_0x33893f[_0x510d('0x32')],qs[_0x510d('0x36')](_0x2cf613[_0x510d('0x33')][_0x510d('0x36')]));_0x26ef39['attributes']=_0x26ef39[_0x510d('0x37')][_0x510d('0x38')]?_0x26ef39[_0x510d('0x37')]:_0x33893f['model'];if(_0x2cf613['query'][_0x510d('0x40')]){_0x26ef39['include']=[{'all':!![]}];}_0x26ef39=_[_0x510d('0x3b')]({},_0x26ef39,_0x2cf613[_0x510d('0x3f')]);return db['Attachment'][_0x510d('0x48')](_0x26ef39)[_0x510d('0x27')](handleEntityNotFound(_0x19d06f,null))[_0x510d('0x27')](respondWithResult(_0x19d06f,null))['catch'](handleError(_0x19d06f,null));};exports[_0x510d('0x49')]=function(_0x6360b3,_0x3e316e){var _0x51fa45={'where':{'id':_0x6360b3[_0x510d('0x46')]['id']}},_0x5683f0={};_0x5683f0[_0x510d('0x32')]=_[_0x510d('0x47')](db[_0x510d('0x2d')]['rawAttributes']);_0x51fa45[_0x510d('0x37')]=_[_0x510d('0x35')](_0x5683f0[_0x510d('0x32')],qs['fields'](_0x6360b3[_0x510d('0x33')][_0x510d('0x36')]));_0x51fa45[_0x510d('0x37')]=_0x51fa45[_0x510d('0x37')][_0x510d('0x38')]?_0x51fa45[_0x510d('0x37')]:_0x5683f0[_0x510d('0x32')];if(_0x6360b3[_0x510d('0x33')][_0x510d('0x40')]){_0x51fa45[_0x510d('0x41')]=[{'all':!![]}];}_0x51fa45=_['merge']({},_0x51fa45,_0x6360b3['options']);return db[_0x510d('0x2d')]['find'](_0x51fa45)[_0x510d('0x27')](handleEntityNotFound(_0x3e316e,null))[_0x510d('0x27')](function(_0x35d7cc){if(_0x35d7cc){var _0x1ae92f=_0x35d7cc[_0x510d('0x4a')]({'plain':!![]});_0x1ae92f=qs[_0x510d('0x4b')](_0x1ae92f,['id',_0x510d('0x4c'),_0x510d('0x4d')]);_0x6360b3[_0x510d('0x4e')]=_['omit'](_0x6360b3[_0x510d('0x4e')],['id','createdAt',_0x510d('0x4d')]);return db['Attachment'][_0x510d('0x4f')](_[_0x510d('0x3b')](_0x1ae92f,_0x6360b3[_0x510d('0x4e')]),{'include':_0x6360b3['query'][_0x510d('0x40')]?[{'all':!![]}]:undefined});}})[_0x510d('0x27')](respondWithResult(_0x3e316e,0xc9))[_0x510d('0x44')](handleError(_0x3e316e,null));};exports[_0x510d('0x26')]=function(_0x279dd0,_0x2a3f8e){if(_0x279dd0['body']['id']){delete _0x279dd0['body']['id'];}return db[_0x510d('0x2d')][_0x510d('0x48')]({'where':{'id':_0x279dd0['params']['id']}})[_0x510d('0x27')](handleEntityNotFound(_0x2a3f8e,null))[_0x510d('0x27')](saveUpdates(_0x279dd0[_0x510d('0x4e')],null))[_0x510d('0x27')](respondWithResult(_0x2a3f8e,null))[_0x510d('0x44')](handleError(_0x2a3f8e,null));};exports['destroy']=function(_0xa86035,_0x469101){return db[_0x510d('0x2d')][_0x510d('0x48')]({'where':{'id':_0xa86035['params']['id']}})[_0x510d('0x27')](handleEntityNotFound(_0x469101,null))[_0x510d('0x27')](removeEntity(_0x469101,null))[_0x510d('0x44')](handleError(_0x469101,null));};exports[_0x510d('0x4f')]=function(_0xe2e0ea,_0x5cd59c,_0x2b7f76){_0xe2e0ea['body']['name']=_0xe2e0ea[_0x510d('0x50')][_0x510d('0x51')];_0xe2e0ea[_0x510d('0x4e')]['basename']=_0xe2e0ea[_0x510d('0x50')][_0x510d('0x52')];_0xe2e0ea[_0x510d('0x4e')][_0x510d('0x30')]=_0xe2e0ea['file'][_0x510d('0x53')];return db[_0x510d('0x2d')][_0x510d('0x4f')](_0xe2e0ea['body'])['then'](respondWithResult(_0x5cd59c,0xc9))[_0x510d('0x44')](handleError(_0x5cd59c,null));};exports[_0x510d('0x54')]=function(_0x2761c5,_0x315fbc,_0x11972a){return db[_0x510d('0x2d')][_0x510d('0x55')]({'where':{'id':_0x2761c5[_0x510d('0x46')]['id']},'raw':!![]})[_0x510d('0x27')](handleEntityNotFound(_0x315fbc,null))['then'](function(_0x432f41){if(_0x432f41){var _0x164d07=_0x432f41['ChatOfflineMessageId']!==null;var _0x4592f1=path[_0x510d('0x56')](config[_0x510d('0x57')],_0x510d('0x58'));if(_0x164d07){_0x4592f1=path[_0x510d('0x56')](_0x4592f1,'offline-chat/');}var _0x2c665c=path[_0x510d('0x56')](_0x4592f1,_0x432f41[_0x510d('0x59')]);return _0x315fbc[_0x510d('0x54')](_0x2c665c);}})[_0x510d('0x44')](handleError(_0x315fbc,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index a29b5b7..ae9c2e3 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 _0xd390=['moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util'];(function(_0x6ea56b,_0x4b98e4){var _0x2ef411=function(_0x4271dd){while(--_0x4271dd){_0x6ea56b['push'](_0x6ea56b['shift']());}};_0x2ef411(++_0x4b98e4);}(_0xd390,0x76));var _0x0d39=function(_0x54f298,_0x5681d4){_0x54f298=_0x54f298-0x0;var _0x489e44=_0xd390[_0x54f298];return _0x489e44;};'use strict';var _=require(_0x0d39('0x0'));var util=require(_0x0d39('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0d39('0x2'));var BPromise=require(_0x0d39('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d39('0x4'));var rimraf=require(_0x0d39('0x5'));var config=require(_0x0d39('0x6'));var attributes=require(_0x0d39('0x7'));module[_0x0d39('0x8')]=function(_0x4cc6e2,_0x176183){return _0x4cc6e2[_0x0d39('0x9')](_0x0d39('0xa'),attributes,{'tableName':_0x0d39('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4d32=['api','bluebird','rimraf','exports','define','Attachment','attachments','lodash','util','../../config/logger'];(function(_0x5e4e54,_0x22683c){var _0x20b557=function(_0x59d565){while(--_0x59d565){_0x5e4e54['push'](_0x5e4e54['shift']());}};_0x20b557(++_0x22683c);}(_0x4d32,0x9d));var _0x24d3=function(_0x283b7c,_0x53bb1f){_0x283b7c=_0x283b7c-0x0;var _0x2a26ea=_0x4d32[_0x283b7c];return _0x2a26ea;};'use strict';var _=require(_0x24d3('0x0'));var util=require(_0x24d3('0x1'));var logger=require(_0x24d3('0x2'))(_0x24d3('0x3'));var moment=require('moment');var BPromise=require(_0x24d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x24d3('0x5'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x24d3('0x6')]=function(_0x153c25,_0x24fe05){return _0x153c25[_0x24d3('0x7')](_0x24d3('0x8'),attributes,{'tableName':_0x24d3('0x9'),'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 50a296e..abd14da 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 _0x7794=['http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','options','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0xa61fd1,_0x934c7b){var _0x82399b=function(_0x4c3878){while(--_0x4c3878){_0xa61fd1['push'](_0xa61fd1['shift']());}};_0x82399b(++_0x934c7b);}(_0x7794,0x7b));var _0x4779=function(_0x305093,_0x1826d0){_0x305093=_0x305093-0x0;var _0x8bc9cd=_0x7794[_0x305093];return _0x8bc9cd;};'use strict';var _=require('lodash');var util=require(_0x4779('0x0'));var moment=require(_0x4779('0x1'));var BPromise=require(_0x4779('0x2'));var rs=require(_0x4779('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4779('0x4'))['db'];var utils=require(_0x4779('0x5'));var logger=require('../../config/logger')(_0x4779('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4779('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x339512,_0x523c93,_0xb3fe18){return new BPromise(function(_0x13bb66,_0x270a5f){return client[_0x4779('0x8')](_0x339512,_0xb3fe18)[_0x4779('0x9')](function(_0x7179e1){logger[_0x4779('0xa')]('Attachment,\x20%s,\x20%s',_0x523c93,_0x4779('0xb'));logger[_0x4779('0xc')](_0x4779('0xd'),_0x523c93,_0x4779('0xb'),JSON[_0x4779('0xe')](_0x7179e1));if(_0x7179e1[_0x4779('0xf')]){if(_0x7179e1[_0x4779('0xf')][_0x4779('0x10')]===0x1f4){logger[_0x4779('0xf')](_0x4779('0x11'),_0x523c93,_0x7179e1['error']['message']);return _0x270a5f(_0x7179e1['error'][_0x4779('0x12')]);}logger[_0x4779('0xf')](_0x4779('0x11'),_0x523c93,_0x7179e1[_0x4779('0xf')]['message']);return _0x13bb66(_0x7179e1[_0x4779('0xf')][_0x4779('0x12')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x523c93,_0x4779('0xb'));_0x13bb66(_0x7179e1[_0x4779('0x13')][_0x4779('0x12')]);}})[_0x4779('0x14')](function(_0x56ec51){logger['error'](_0x4779('0x11'),_0x523c93,_0x56ec51);_0x270a5f(_0x56ec51);});});}exports[_0x4779('0x15')]=function(_0x19fbb6){var _0x582e89=this;return new Promise(function(_0x3dbe70,_0x5d9a58){return db[_0x4779('0x16')][_0x4779('0x17')](_0x19fbb6['body'],{'raw':_0x19fbb6[_0x4779('0x18')]?_0x19fbb6['options'][_0x4779('0x19')]===undefined?!![]:![]:!![]})[_0x4779('0x9')](function(_0x143ef6){logger[_0x4779('0xa')](_0x4779('0x15'),_0x19fbb6);logger[_0x4779('0xc')]('CreateAttachment',_0x19fbb6,JSON[_0x4779('0xe')](_0x143ef6));_0x3dbe70(_0x143ef6);})['catch'](function(_0x4ad246){logger[_0x4779('0xf')](_0x4779('0x15'),_0x4ad246[_0x4779('0x12')],_0x19fbb6);_0x5d9a58(_0x582e89[_0x4779('0xf')](0x1f4,_0x4ad246['message']));});});};
\ No newline at end of file
+var _0x4746=['request','request\x20sent','debug','error','code','message','Attachment,\x20%s,\x20%s','info','catch','Attachment','create','body','options','raw','CreateAttachment','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x5108bf,_0x1e9b2a){var _0x343c7e=function(_0xebcba1){while(--_0xebcba1){_0x5108bf['push'](_0x5108bf['shift']());}};_0x343c7e(++_0x1e9b2a);}(_0x4746,0xc6));var _0x6474=function(_0x1c907e,_0x5d0fcb){_0x1c907e=_0x1c907e-0x0;var _0x20b6f6=_0x4746[_0x1c907e];return _0x20b6f6;};'use strict';var _=require(_0x6474('0x0'));var util=require(_0x6474('0x1'));var moment=require('moment');var BPromise=require(_0x6474('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6474('0x3'));var db=require(_0x6474('0x4'))['db'];var utils=require(_0x6474('0x5'));var logger=require(_0x6474('0x6'))(_0x6474('0x7'));var config=require('../../config/environment');var jayson=require(_0x6474('0x8'));var client=jayson[_0x6474('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x433af9,_0x427f79,_0xcd065e){return new BPromise(function(_0xec3cda,_0x15d4c2){return client[_0x6474('0xa')](_0x433af9,_0xcd065e)['then'](function(_0x1bc38b){logger['info']('Attachment,\x20%s,\x20%s',_0x427f79,_0x6474('0xb'));logger[_0x6474('0xc')]('Attachment,\x20%s,\x20%s,\x20%s',_0x427f79,_0x6474('0xb'),JSON['stringify'](_0x1bc38b));if(_0x1bc38b[_0x6474('0xd')]){if(_0x1bc38b['error'][_0x6474('0xe')]===0x1f4){logger[_0x6474('0xd')]('Attachment,\x20%s,\x20%s',_0x427f79,_0x1bc38b['error']['message']);return _0x15d4c2(_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);}logger[_0x6474('0xd')](_0x6474('0x10'),_0x427f79,_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);return _0xec3cda(_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);}else{logger[_0x6474('0x11')]('Attachment,\x20%s,\x20%s',_0x427f79,'request\x20sent');_0xec3cda(_0x1bc38b['result'][_0x6474('0xf')]);}})[_0x6474('0x12')](function(_0x29c19b){logger[_0x6474('0xd')](_0x6474('0x10'),_0x427f79,_0x29c19b);_0x15d4c2(_0x29c19b);});});}exports['CreateAttachment']=function(_0x1505fc){var _0x7585ed=this;return new Promise(function(_0xb6ecb6,_0xc3448d){return db[_0x6474('0x13')][_0x6474('0x14')](_0x1505fc[_0x6474('0x15')],{'raw':_0x1505fc[_0x6474('0x16')]?_0x1505fc['options'][_0x6474('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0xd23b18){logger[_0x6474('0x11')](_0x6474('0x18'),_0x1505fc);logger[_0x6474('0xc')](_0x6474('0x18'),_0x1505fc,JSON[_0x6474('0x19')](_0xd23b18));_0xb6ecb6(_0xd23b18);})[_0x6474('0x12')](function(_0x5d0e5c){logger[_0x6474('0xd')]('CreateAttachment',_0x5d0e5c[_0x6474('0xf')],_0x1505fc);_0xc3448d(_0x7585ed['error'](0x1f4,_0x5d0e5c['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index efd6272..6a918b6 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 _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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'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
+var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x2dcb4d,_0xe886b3){var _0x2a0cab=function(_0xd1d9b1){while(--_0xd1d9b1){_0x2dcb4d['push'](_0x2dcb4d['shift']());}};_0x2a0cab(++_0xe886b3);}(_0x757a,0xde));var _0xa757=function(_0x53bfae,_0x1f5a14){_0x53bfae=_0x53bfae-0x0;var _0x587fda=_0x757a[_0x53bfae];return _0x587fda;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 0539f41..44f6abf 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 _0x9eb7=['name','password','salt','role','disabled','blocked','blockedAt','online','admin','agent','add','clearBlockUser','getLicense','catch','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','ad-login','Strategy','moment','activedirectory2','bluebird','../../mysqldb','../../config/environment','api','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled'];(function(_0x10488b,_0x3f8915){var _0x15a90a=function(_0x5f380e){while(--_0x5f380e){_0x10488b['push'](_0x10488b['shift']());}};_0x15a90a(++_0x3f8915);}(_0x9eb7,0x117));var _0x79eb=function(_0x3316a0,_0x12f083){_0x3316a0=_0x3316a0-0x0;var _0x30e148=_0x9eb7[_0x3316a0];return _0x30e148;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')[_0x79eb('0x0')];var moment=require(_0x79eb('0x1'));var ActiveDirectory=require(_0x79eb('0x2'));var BPromise=require(_0x79eb('0x3'));var util=require('util');var db=require(_0x79eb('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require(_0x79eb('0x5'));var logger=require('../../config/logger')(_0x79eb('0x6'));function isActiveDirectoryConfigured(_0x492ad5){var _0x333b61=![];if(typeof _0x492ad5[_0x79eb('0x7')]!=='undefined'){_0x333b61=_0x492ad5[_0x79eb('0x7')][_0x79eb('0x8')]&&_0x492ad5[_0x79eb('0x7')][_0x79eb('0x9')]&&_0x492ad5[_0x79eb('0x7')][_0x79eb('0xa')];}return _0x333b61;}function adAuthenticate(_0x3d2c85,_0x20327f,_0x4c4bd1){return new BPromise(function(_0x39a4b0,_0x471aad){try{var _0x356675=new ActiveDirectory(_0x3d2c85);_0x356675[_0x79eb('0xb')](_0x20327f,_0x4c4bd1,function(_0x2a413b,_0x5cac28){if(_0x2a413b){logger[_0x79eb('0xc')](_0x79eb('0xd'),_0x20327f,util[_0x79eb('0xe')](_0x2a413b,{'showHidden':![],'depth':null}));_0x471aad(_0x79eb('0xf'));}else if(!_0x5cac28){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x20327f);_0x471aad(_0x79eb('0xf'));}else{_0x39a4b0(_0x5cac28);}});}catch(_0x173c35){_0x471aad(_0x173c35);}});}function ActiveDirectoryAuthenticate(_0x174134,_0x749dfc,_0x4a567a,_0x298829){var _0x30e8ee,_0x14c767;if(!isActiveDirectoryConfigured(config)){logger[_0x79eb('0xc')](_0x79eb('0x10'),_0x749dfc);return _0x298829(null,![],{'message':_0x79eb('0xf')});}return db[_0x79eb('0x11')]['findOne']({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x79eb('0x12')],'raw':!![]})[_0x79eb('0x13')](function(_0x56b7cb){_0x30e8ee=_0x56b7cb;if(!_0x30e8ee[_0x79eb('0x14')]){logger['error'](_0x79eb('0x15'),_0x749dfc);throw new Error(_0x79eb('0xf'));}return _0x174134['findOne']({'attributes':['id',_0x79eb('0x16'),_0x79eb('0x17'),_0x79eb('0x18'),_0x79eb('0x19'),_0x79eb('0x1a'),_0x79eb('0x1b'),_0x79eb('0x1c'),_0x79eb('0x1d')],'where':{'name':_0x749dfc,'role':{'$or':[_0x79eb('0x1e'),'user',_0x79eb('0x1f')]},'adSsoEnabled':!![]}});})[_0x79eb('0x13')](function(_0x29d075){if(!_0x29d075||_0x29d075&&_0x29d075[_0x79eb('0x16')]!==_0x749dfc){throw new Error(_0x79eb('0xf'));}_0x14c767=_0x29d075;var _0x250490=_0x14c767[_0x79eb('0x16')]+'@'+config[_0x79eb('0x7')][_0x79eb('0xa')];return adAuthenticate(config[_0x79eb('0x7')],_0x250490,_0x4a567a);})['then'](function(_0x563f57){if(_0x14c767[_0x79eb('0x1a')]){throw new Error(_0x79eb('0xf'));}if(_0x30e8ee[_0x79eb('0x12')]>0x0){if(_0x14c767[_0x79eb('0x1b')]){if(moment(_0x14c767[_0x79eb('0x1c')])[_0x79eb('0x20')](_0x30e8ee[_0x79eb('0x12')],'minutes')>moment()){throw new Error(_0x79eb('0xf'));}return utils[_0x79eb('0x21')](_0x14c767,0x0,![],null)['then'](function(){return utils[_0x79eb('0x22')](_0x14c767);})['then'](function(){return _0x298829(null,_0x14c767);});}else{return utils[_0x79eb('0x22')](_0x14c767)[_0x79eb('0x13')](function(){return _0x298829(null,_0x14c767);});}}else{return utils[_0x79eb('0x22')](_0x14c767)['then'](function(){return _0x298829(null,_0x14c767);});}})[_0x79eb('0x23')](function(_0x4cdc6d){return _0x298829(null,![],_0x4cdc6d);});}function handleError(_0x1afc3a,_0xbad17d,_0x42326e){return _0x1afc3a[_0x79eb('0x24')](_0xbad17d||0x1f4)[_0x79eb('0x25')]({'message':_0x42326e?_0x42326e['message']||_0x42326e:''});}exports[_0x79eb('0x26')]=function(_0x132c63,_0x13c1c0,_0x27d022){passport[_0x79eb('0xb')]('ad-login',function(_0x11c99f,_0x22e85f,_0x33f98f){var _0x2fa2f5=_0x11c99f||_0x33f98f;if(_0x2fa2f5){return handleError(_0x13c1c0,0x191,_0x2fa2f5);}if(!_0x22e85f){return handleError(_0x13c1c0,0x194,{'message':_0x79eb('0x27')});}else{var _0x3701a5={'payload':{'id':_0x22e85f['id'],'role':_0x22e85f['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3701a5)[_0x79eb('0x13')](function(_0x6c34e5){_0x13c1c0[_0x79eb('0x28')]({'id':_0x22e85f['id'],'token':_0x6c34e5,'statusCall':'','isAlreadyLogged':_0x22e85f[_0x79eb('0x1d')]});});}})(_0x132c63,_0x13c1c0,_0x27d022);};passport[_0x79eb('0x29')](_0x79eb('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':_0x79eb('0x17')},function(_0x571adb,_0x5d15bf,_0x103f27){return ActiveDirectoryAuthenticate(db['User'],_0x571adb,_0x5d15bf,_0x103f27);}));
\ No newline at end of file
+var _0x5921=['api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt','online','user','agent','disabled','add','minutes','getLicense','catch','status','message','login','ad-login','signToken','use','User','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment'];(function(_0x5c883f,_0x38f092){var _0x4210cc=function(_0x51be71){while(--_0x51be71){_0x5c883f['push'](_0x5c883f['shift']());}};_0x4210cc(++_0x38f092);}(_0x5921,0x16e));var _0x1592=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x5921[_0x4fde08];return _0x12e725;};'use strict';var passport=require(_0x1592('0x0'));var LocalStrategy=require(_0x1592('0x1'))[_0x1592('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x1592('0x3'));var BPromise=require(_0x1592('0x4'));var util=require(_0x1592('0x5'));var db=require(_0x1592('0x6'))['db'];var authService=require(_0x1592('0x7'));var utils=require(_0x1592('0x8'));var config=require(_0x1592('0x9'));var logger=require('../../config/logger')(_0x1592('0xa'));function isActiveDirectoryConfigured(_0xae83ab){var _0x1a232f=![];if(typeof _0xae83ab[_0x1592('0xb')]!==_0x1592('0xc')){_0x1a232f=_0xae83ab[_0x1592('0xb')][_0x1592('0xd')]&&_0xae83ab[_0x1592('0xb')]['url']&&_0xae83ab[_0x1592('0xb')][_0x1592('0xe')];}return _0x1a232f;}function adAuthenticate(_0x3dfcd7,_0x3d3006,_0x6008d8){return new BPromise(function(_0x11a4e3,_0x23765b){try{var _0xd739d2=new ActiveDirectory(_0x3dfcd7);_0xd739d2[_0x1592('0xf')](_0x3d3006,_0x6008d8,function(_0x4de28f,_0x539c43){if(_0x4de28f){logger[_0x1592('0x10')](_0x1592('0x11'),_0x3d3006,util[_0x1592('0x12')](_0x4de28f,{'showHidden':![],'depth':null}));_0x23765b(_0x1592('0x13'));}else if(!_0x539c43){logger[_0x1592('0x10')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3d3006);_0x23765b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x11a4e3(_0x539c43);}});}catch(_0x11242a){_0x23765b(_0x11242a);}});}function ActiveDirectoryAuthenticate(_0x5e61b6,_0x23cb05,_0x2b59d9,_0x13b909){var _0x354905,_0x258ef2;if(!isActiveDirectoryConfigured(config)){logger[_0x1592('0x10')](_0x1592('0x14'),_0x23cb05);return _0x13b909(null,![],{'message':_0x1592('0x13')});}return db['Setting'][_0x1592('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x1592('0x16')],'raw':!![]})[_0x1592('0x17')](function(_0x2682d8){_0x354905=_0x2682d8;if(!_0x354905[_0x1592('0x18')]){logger[_0x1592('0x10')](_0x1592('0x19'),_0x23cb05);throw new Error(_0x1592('0x13'));}return _0x5e61b6['findOne']({'attributes':['id',_0x1592('0x1a'),_0x1592('0x1b'),_0x1592('0x1c'),_0x1592('0x1d'),'disabled',_0x1592('0x1e'),_0x1592('0x1f'),_0x1592('0x20')],'where':{'name':_0x23cb05,'role':{'$or':['admin',_0x1592('0x21'),_0x1592('0x22')]},'adSsoEnabled':!![]}});})[_0x1592('0x17')](function(_0x3cf1bd){if(!_0x3cf1bd||_0x3cf1bd&&_0x3cf1bd[_0x1592('0x1a')]!==_0x23cb05){throw new Error(_0x1592('0x13'));}_0x258ef2=_0x3cf1bd;var _0x4e9c5c=_0x258ef2['name']+'@'+config[_0x1592('0xb')][_0x1592('0xe')];return adAuthenticate(config[_0x1592('0xb')],_0x4e9c5c,_0x2b59d9);})['then'](function(_0x2e30fb){if(_0x258ef2[_0x1592('0x23')]){throw new Error(_0x1592('0x13'));}if(_0x354905[_0x1592('0x16')]>0x0){if(_0x258ef2['blocked']){if(moment(_0x258ef2[_0x1592('0x1f')])[_0x1592('0x24')](_0x354905['blockDuration'],_0x1592('0x25'))>moment()){throw new Error(_0x1592('0x13'));}return utils['clearBlockUser'](_0x258ef2,0x0,![],null)[_0x1592('0x17')](function(){return utils[_0x1592('0x26')](_0x258ef2);})[_0x1592('0x17')](function(){return _0x13b909(null,_0x258ef2);});}else{return utils[_0x1592('0x26')](_0x258ef2)[_0x1592('0x17')](function(){return _0x13b909(null,_0x258ef2);});}}else{return utils[_0x1592('0x26')](_0x258ef2)['then'](function(){return _0x13b909(null,_0x258ef2);});}})[_0x1592('0x27')](function(_0x1b7895){return _0x13b909(null,![],_0x1b7895);});}function handleError(_0x1c400c,_0x10e156,_0x2fdd01){return _0x1c400c[_0x1592('0x28')](_0x10e156||0x1f4)['send']({'message':_0x2fdd01?_0x2fdd01[_0x1592('0x29')]||_0x2fdd01:''});}exports[_0x1592('0x2a')]=function(_0x58b561,_0x1197a1,_0x25c618){passport['authenticate'](_0x1592('0x2b'),function(_0x3d7678,_0x4dc941,_0x1ef5af){var _0x2bd194=_0x3d7678||_0x1ef5af;if(_0x2bd194){return handleError(_0x1197a1,0x191,_0x2bd194);}if(!_0x4dc941){return handleError(_0x1197a1,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xac5cc7={'payload':{'id':_0x4dc941['id'],'role':_0x4dc941[_0x1592('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x1592('0x2c')](_0xac5cc7)['then'](function(_0x38446c){_0x1197a1['json']({'id':_0x4dc941['id'],'token':_0x38446c,'statusCall':'','isAlreadyLogged':_0x4dc941[_0x1592('0x20')]});});}})(_0x58b561,_0x1197a1,_0x25c618);};passport[_0x1592('0x2d')](_0x1592('0x2b'),new LocalStrategy({'usernameField':_0x1592('0x1a'),'passwordField':_0x1592('0x1b')},function(_0x32d6e9,_0x57d565,_0x311a4d){return ActiveDirectoryAuthenticate(db[_0x1592('0x2e')],_0x32d6e9,_0x57d565,_0x311a4d);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 1bd11ce..1265db8 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 _0xbe7a=['Router','./authActiveDirectory.controller','post','login','exports','express'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0xbe7a,0x11f));var _0xabe7=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xbe7a[_0x8a969d];return _0x1d8dc7;};'use strict';var express=require(_0xabe7('0x0'));var router=express[_0xabe7('0x1')]();var controller=require(_0xabe7('0x2'));router[_0xabe7('0x3')]('/',controller[_0xabe7('0x4')]);module[_0xabe7('0x5')]=router;
\ No newline at end of file
+var _0xf407=['Router','./authActiveDirectory.controller','post','login','exports','express'];(function(_0x38854e,_0x23cbc9){var _0x3f8415=function(_0x4e493e){while(--_0x4e493e){_0x38854e['push'](_0x38854e['shift']());}};_0x3f8415(++_0x23cbc9);}(_0xf407,0x7d));var _0x7f40=function(_0x355463,_0x19e319){_0x355463=_0x355463-0x0;var _0xd89c57=_0xf407[_0x355463];return _0xd89c57;};'use strict';var express=require(_0x7f40('0x0'));var router=express[_0x7f40('0x1')]();var controller=require(_0x7f40('0x2'));router[_0x7f40('0x3')]('/',controller[_0x7f40('0x4')]);module[_0x7f40('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 890b6b6..56dc802 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x7a54,0x106));var _0x47a5=function(_0x5b1b95,_0x434da4){_0x5b1b95=_0x5b1b95-0x0;var _0x2347bf=_0x7a54[_0x5b1b95];return _0x2347bf;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x7a54,0x106));var _0x47a5=function(_0x58ab23,_0x9713db){_0x58ab23=_0x58ab23-0x0;var _0x2e8d72=_0x7a54[_0x58ab23];return _0x2e8d72;};'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 d286079..ddc14e3 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 _0xa04c=['isMiddleware','./authGoogle.controller','../user/user.controller.js','get','login','/callback','callback'];(function(_0x176977,_0x597043){var _0x35f50d=function(_0x3db271){while(--_0x3db271){_0x176977['push'](_0x176977['shift']());}};_0x35f50d(++_0x597043);}(_0xa04c,0x151));var _0xca04=function(_0x520621,_0x26e013){_0x520621=_0x520621-0x0;var _0x3d9e0c=_0xa04c[_0x520621];return _0x3d9e0c;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require(_0xca04('0x0'));var userController=require(_0xca04('0x1'));var authService=require('../../components/auth/service');router[_0xca04('0x2')]('/',controller[_0xca04('0x3')]);router[_0xca04('0x2')](_0xca04('0x4'),controller[_0xca04('0x5')],authService[_0xca04('0x6')],userController[_0xca04('0x3')],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
+var _0xcea8=['isMiddleware','setTokenCookie','exports','express','passport','Router','../../components/auth/service','get','login','callback'];(function(_0xb2320d,_0xe69d49){var _0x9db91a=function(_0x5a0878){while(--_0x5a0878){_0xb2320d['push'](_0xb2320d['shift']());}};_0x9db91a(++_0xe69d49);}(_0xcea8,0x1d9));var _0x8cea=function(_0x50aea5,_0x5dd077){_0x50aea5=_0x50aea5-0x0;var _0x4657f1=_0xcea8[_0x50aea5];return _0x4657f1;};'use strict';var express=require(_0x8cea('0x0'));var passport=require(_0x8cea('0x1'));var router=express[_0x8cea('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x8cea('0x3'));router[_0x8cea('0x4')]('/',controller[_0x8cea('0x5')]);router['get']('/callback',controller[_0x8cea('0x6')],authService[_0x8cea('0x7')],userController[_0x8cea('0x5')],authService[_0x8cea('0x8')]);module[_0x8cea('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 484e7d0..1bb01d5 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 _0xf67e=['now','save','xCally\x20Motion\x20Password\x20Reset','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','blocked','loginAttempts','admin','user','agent','then','authenticate','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','\x22%s\x22\x20<%s>','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','body','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf67e,0x171));var _0xef67=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xf67e[_0x1e4360];return _0x31e6b4;};'use strict';var util=require(_0xef67('0x0'));var passport=require(_0xef67('0x1'));var LocalStrategy=require(_0xef67('0x2'))[_0xef67('0x3')];var jayson=require(_0xef67('0x4'));var _=require('lodash');var rs=require(_0xef67('0x5'));var moment=require(_0xef67('0x6'));var db=require(_0xef67('0x7'))['db'];var authService=require(_0xef67('0x8'));var utils=require(_0xef67('0x9'));var client=jayson[_0xef67('0xa')][_0xef67('0xb')]({'port':0x232b});function localAuthenticate(_0x281532,_0x4b3adb,_0x1aed7c,_0x687c6e){var _0x3f849f,_0x212d4c;return db[_0xef67('0xc')][_0xef67('0xd')]({'where':{'id':0x1},'attributes':[_0xef67('0xe'),_0xef67('0xf')],'raw':!![]})['then'](function(_0xc88006){_0x3f849f=_0xc88006;return _0x281532['findOne']({'attributes':['id',_0xef67('0x10'),_0xef67('0x11'),'salt','role','disabled',_0xef67('0x12'),'blockedAt',_0xef67('0x13')],'where':{'name':_0x4b3adb,'role':{'$or':[_0xef67('0x14'),_0xef67('0x15'),_0xef67('0x16')]}}});})[_0xef67('0x17')](function(_0x5c6b7f){if(!_0x5c6b7f||_0x5c6b7f&&_0x5c6b7f[_0xef67('0x10')]!==_0x4b3adb){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x212d4c=_0x5c6b7f;return _0x212d4c;}})['then'](function(){_0x212d4c[_0xef67('0x18')](_0x1aed7c,function(_0x1556c6,_0x1df774){var _0xd4954a=_0x212d4c[_0xef67('0x13')]+0x1;if(_0x1556c6){return _0x687c6e(_0x1556c6);}else if(!_0x1df774){if(_0x212d4c[_0xef67('0x19')]){return _0x687c6e(null,![],{'message':_0xef67('0x1a')});}else if(_0x3f849f[_0xef67('0xe')]>0x0){if(_0x212d4c[_0xef67('0x12')]){if(_0x3f849f[_0xef67('0xf')]>0x0){if(moment(_0x212d4c[_0xef67('0x1b')])[_0xef67('0x1c')](_0x3f849f['blockDuration'],_0xef67('0x1d'))>moment()){return _0x687c6e(null,![],{'message':_0xef67('0x1a')});}else{return utils[_0xef67('0x1e')](_0x212d4c,_0xd4954a,![],null)[_0xef67('0x17')](function(){return _0x687c6e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x687c6e(null,![],{'message':_0xef67('0x1a')});}}else{if(_0xd4954a>=_0x3f849f[_0xef67('0xe')]){return utils[_0xef67('0x1e')](_0x212d4c,0x0,!![],moment())[_0xef67('0x17')](function(){return _0x687c6e(null,![],{'message':_0xef67('0x1a')});});}else{return utils['clearBlockUser'](_0x212d4c,_0xd4954a,![],null)[_0xef67('0x17')](function(){return _0x687c6e(null,![],{'message':_0xef67('0x1a')});});}}}else{return _0x687c6e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x212d4c[_0xef67('0x19')]){return _0x687c6e(null,![],{'message':_0xef67('0x1a')});}else if(_0x3f849f[_0xef67('0xe')]>0x0){if(_0x212d4c[_0xef67('0x12')]){if(_0x3f849f['blockDuration']>0x0){if(moment(_0x212d4c[_0xef67('0x1b')])[_0xef67('0x1c')](_0x3f849f['blockDuration'],_0xef67('0x1d'))>moment()){return _0x687c6e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x212d4c,0x0,![],null)[_0xef67('0x17')](function(){return utils[_0xef67('0x1f')](_0x212d4c);})['then'](function(){return _0x687c6e(null,_0x212d4c);});}}else{return _0x687c6e(null,![],{'message':_0xef67('0x1a')});}}else{return utils['clearBlockUser'](_0x212d4c,0x0,![],null)[_0xef67('0x17')](function(){return utils[_0xef67('0x1f')](_0x212d4c);})[_0xef67('0x17')](function(){return _0x687c6e(null,_0x212d4c);})[_0xef67('0x20')](function(_0x34a333){return _0x687c6e(null,![],_0x34a333);});}}else{if(_0x212d4c['blocked']){return _0x687c6e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xef67('0x1f')](_0x212d4c)['then'](function(){return _0x687c6e(null,_0x212d4c);});}}}});})[_0xef67('0x20')](function(_0x4e2557){return _0x687c6e(null,![],_0x4e2557);});}function sendServiceMail(_0xebf68c){return db[_0xef67('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0xef67('0x10'),_0xef67('0x22')],'include':[{'model':db[_0xef67('0x23')],'as':_0xef67('0x24'),'include':[{'model':db[_0xef67('0x25')],'as':_0xef67('0x25')}]}]})[_0xef67('0x17')](function(_0x1b0786){if(!_0x1b0786){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0xfee50b=_0x1b0786[_0xef67('0x26')]();var _0x57a091={'account':_0xfee50b,'message':_[_0xef67('0x27')]({'from':util['format'](_0xef67('0x28'),_0x1b0786['name'],_0x1b0786[_0xef67('0x22')]||_0x1b0786[_0xef67('0x24')][_0xef67('0x15')])},_0xebf68c)};return client[_0xef67('0x29')]('SendMail',_0x57a091);})[_0xef67('0x17')](function(_0x2ce879){if(_0x2ce879[_0xef67('0x2a')]){throw new Error(util[_0xef67('0x2b')](_0xef67('0x2c'),_0x2ce879['error'][_0xef67('0x2d')]||JSON[_0xef67('0x2e')](_0x2ce879[_0xef67('0x2a')])));}return!![];});}function handleError(_0x707d9,_0x45f4ca,_0x3103f6){return _0x707d9['status'](_0x45f4ca||0x1f4)[_0xef67('0x2f')]({'message':_0x3103f6?_0x3103f6['message']||_0x3103f6:''});}exports[_0xef67('0x30')]=function(_0x2d1b16,_0x44b700,_0x2faccc){passport['authenticate'](_0xef67('0x31'),function(_0x47c1b3,_0x37769c,_0x32ec64){var _0x2c6115=_0x47c1b3||_0x32ec64;if(_0x2c6115){return handleError(_0x44b700,0x191,_0x2c6115);}if(!_0x37769c){return handleError(_0x44b700,0x194,{'message':_0xef67('0x32')});}else{var _0x240166={'payload':{'id':_0x37769c['id'],'role':_0x37769c[_0xef67('0x33')]},'options':{'expiresIn':0x15180}};return authService[_0xef67('0x34')](_0x240166)['then'](function(_0x30cd87){_0x44b700[_0xef67('0x35')]({'id':_0x37769c['id'],'token':_0x30cd87,'statusCall':'','isAlreadyLogged':_0x37769c[_0xef67('0x36')]});});}})(_0x2d1b16,_0x44b700,_0x2faccc);};exports[_0xef67('0x37')]=function(_0x78b690,_0x4f671f){if(!_0x78b690[_0xef67('0x38')][_0xef67('0x22')]){return handleError(_0x4f671f,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x88f569=rs[_0xef67('0x39')]();_0x78b690[_0xef67('0x38')][_0xef67('0x22')]=_0x78b690[_0xef67('0x38')]['email'][_0xef67('0x3a')]()[_0xef67('0x3b')]();var _0x3aef62;return db['Setting'][_0xef67('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xef67('0xf')],'raw':!![]})[_0xef67('0x17')](function(_0x54696d){_0x3aef62=_0x54696d;return db[_0xef67('0x3c')][_0xef67('0x3d')]({'where':{'email':_0x78b690[_0xef67('0x38')]['email']}});})['then'](function(_0x50567f){if(!_0x50567f){throw new Error(_0xef67('0x3e'));}if(_0x50567f[_0xef67('0x19')]){throw new Error(_0xef67('0x3f'));}if(_0x50567f[_0xef67('0x12')]){if(moment(_0x50567f['blockedAt'])['add'](_0x3aef62['blockDuration'],_0xef67('0x1d'))>moment()){throw new Error(_0xef67('0x40'));}else{_0x50567f['blocked']=![];_0x50567f[_0xef67('0x1b')]=null;}}_0x50567f[_0xef67('0x41')]=_0x88f569;_0x50567f['resetPasswordExpires']=Date[_0xef67('0x42')]()+0x36ee80;return _0x50567f[_0xef67('0x43')]();})['then'](function(){return sendServiceMail({'to':_0x78b690[_0xef67('0x38')][_0xef67('0x22')],'subject':_0xef67('0x44'),'text':'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'+_0xef67('0x45')+_0x78b690[_0xef67('0x46')][_0xef67('0x47')]+_0xef67('0x48')+_0x88f569+'\x0a\x0a'+_0xef67('0x49')});})['then'](function(){_0x4f671f[_0xef67('0x4a')](0xc8)[_0xef67('0x2f')]({'message':'Reset\x20Email\x20sent!'});})[_0xef67('0x20')](function(_0x21fe4b){return handleError(_0x4f671f,0x1f4,_0x21fe4b);});};exports[_0xef67('0x4b')]=function(_0x2595fa,_0xeaea89){return db['User'][_0xef67('0x3d')]({'where':{'resetPasswordToken':_0x2595fa[_0xef67('0x4c')][_0xef67('0x4d')],'resetPasswordExpires':{'$gt':Date[_0xef67('0x42')]()}}})['then'](function(_0x13d12e){if(!_0x13d12e){throw new Error(_0xef67('0x4e'));}return db[_0xef67('0xc')]['findOne']({'attributes':['id',_0xef67('0x4f'),_0xef67('0x50'),'passwordHistoryLimit']})[_0xef67('0x17')](function(_0xd1efb2){if(_0xd1efb2[_0xef67('0x4f')])authService['validatePasswordPattern'](_0x2595fa['body'][_0xef67('0x11')]);if(!_0xd1efb2[_0xef67('0x50')]||!_0x13d12e[_0xef67('0x51')])return _0x13d12e;authService[_0xef67('0x52')](_0x2595fa[_0xef67('0x38')][_0xef67('0x11')],_0x13d12e[_0xef67('0x51')],_0xd1efb2[_0xef67('0x53')]);return _0x13d12e;})[_0xef67('0x17')](function(){_0x13d12e[_0xef67('0x11')]=_0x2595fa[_0xef67('0x38')][_0xef67('0x11')];_0x13d12e[_0xef67('0x41')]=null;_0x13d12e[_0xef67('0x54')]=null;return _0x13d12e[_0xef67('0x43')]();});})[_0xef67('0x17')](function(){_0xeaea89[_0xef67('0x4a')](0xc8)[_0xef67('0x2f')]({'message':_0xef67('0x55')});})['catch'](function(_0x14117c){return handleError(_0xeaea89,0x1f4,_0x14117c);});};passport[_0xef67('0x56')](_0xef67('0x31'),new LocalStrategy({'usernameField':_0xef67('0x10'),'passwordField':'password'},function(_0x1a70c2,_0xaa3d08,_0x29ea8e){return localAuthenticate(db[_0xef67('0x3c')],_0x1a70c2,_0xaa3d08,_0x29ea8e);}));
\ No newline at end of file
+var _0xfe75=['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/','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','role','disabled','blocked','blockedAt','admin','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','authenticate','blockDuration','add','minutes','clearBlockUser','allowedLoginAttempts','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','getSmtpOptions','format','\x22%s\x22\x20<%s>','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','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','save'];(function(_0xcc0da2,_0x564102){var _0x45860b=function(_0x38b16f){while(--_0x38b16f){_0xcc0da2['push'](_0xcc0da2['shift']());}};_0x45860b(++_0x564102);}(_0xfe75,0xb5));var _0x5fe7=function(_0xde593a,_0x12d3cf){_0xde593a=_0xde593a-0x0;var _0x365fd1=_0xfe75[_0xde593a];return _0x365fd1;};'use strict';var util=require(_0x5fe7('0x0'));var passport=require(_0x5fe7('0x1'));var LocalStrategy=require(_0x5fe7('0x2'))[_0x5fe7('0x3')];var jayson=require('jayson/promise');var _=require(_0x5fe7('0x4'));var rs=require(_0x5fe7('0x5'));var moment=require(_0x5fe7('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x5fe7('0x7'));var utils=require(_0x5fe7('0x8'));var client=jayson[_0x5fe7('0x9')][_0x5fe7('0xa')]({'port':0x232b});function localAuthenticate(_0x2c77df,_0x35cbd8,_0x2fa2dd,_0x2d51ff){var _0x24d640,_0x3d584a;return db[_0x5fe7('0xb')][_0x5fe7('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x1734a0){_0x24d640=_0x1734a0;return _0x2c77df[_0x5fe7('0xc')]({'attributes':['id','name','password','salt',_0x5fe7('0xd'),_0x5fe7('0xe'),_0x5fe7('0xf'),_0x5fe7('0x10'),'loginAttempts'],'where':{'name':_0x35cbd8,'role':{'$or':[_0x5fe7('0x11'),'user',_0x5fe7('0x12')]}}});})['then'](function(_0x59d9cf){if(!_0x59d9cf||_0x59d9cf&&_0x59d9cf[_0x5fe7('0x13')]!==_0x35cbd8){throw new Error(_0x5fe7('0x14'));}else{_0x3d584a=_0x59d9cf;return _0x3d584a;}})[_0x5fe7('0x15')](function(){_0x3d584a[_0x5fe7('0x16')](_0x2fa2dd,function(_0x30162d,_0xfd2dc0){var _0x1ca764=_0x3d584a['loginAttempts']+0x1;if(_0x30162d){return _0x2d51ff(_0x30162d);}else if(!_0xfd2dc0){if(_0x3d584a[_0x5fe7('0xe')]){return _0x2d51ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x24d640['allowedLoginAttempts']>0x0){if(_0x3d584a['blocked']){if(_0x24d640[_0x5fe7('0x17')]>0x0){if(moment(_0x3d584a[_0x5fe7('0x10')])[_0x5fe7('0x18')](_0x24d640[_0x5fe7('0x17')],_0x5fe7('0x19'))>moment()){return _0x2d51ff(null,![],{'message':_0x5fe7('0x14')});}else{return utils[_0x5fe7('0x1a')](_0x3d584a,_0x1ca764,![],null)[_0x5fe7('0x15')](function(){return _0x2d51ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2d51ff(null,![],{'message':_0x5fe7('0x14')});}}else{if(_0x1ca764>=_0x24d640[_0x5fe7('0x1b')]){return utils[_0x5fe7('0x1a')](_0x3d584a,0x0,!![],moment())[_0x5fe7('0x15')](function(){return _0x2d51ff(null,![],{'message':_0x5fe7('0x14')});});}else{return utils[_0x5fe7('0x1a')](_0x3d584a,_0x1ca764,![],null)[_0x5fe7('0x15')](function(){return _0x2d51ff(null,![],{'message':_0x5fe7('0x14')});});}}}else{return _0x2d51ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3d584a[_0x5fe7('0xe')]){return _0x2d51ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x24d640[_0x5fe7('0x1b')]>0x0){if(_0x3d584a[_0x5fe7('0xf')]){if(_0x24d640['blockDuration']>0x0){if(moment(_0x3d584a[_0x5fe7('0x10')])[_0x5fe7('0x18')](_0x24d640[_0x5fe7('0x17')],'minutes')>moment()){return _0x2d51ff(null,![],{'message':_0x5fe7('0x14')});}else{return utils[_0x5fe7('0x1a')](_0x3d584a,0x0,![],null)['then'](function(){return utils[_0x5fe7('0x1c')](_0x3d584a);})[_0x5fe7('0x15')](function(){return _0x2d51ff(null,_0x3d584a);});}}else{return _0x2d51ff(null,![],{'message':_0x5fe7('0x14')});}}else{return utils[_0x5fe7('0x1a')](_0x3d584a,0x0,![],null)[_0x5fe7('0x15')](function(){return utils['getLicense'](_0x3d584a);})[_0x5fe7('0x15')](function(){return _0x2d51ff(null,_0x3d584a);})['catch'](function(_0x5048e9){return _0x2d51ff(null,![],_0x5048e9);});}}else{if(_0x3d584a['blocked']){return _0x2d51ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5fe7('0x1c')](_0x3d584a)['then'](function(){return _0x2d51ff(null,_0x3d584a);});}}}});})[_0x5fe7('0x1d')](function(_0x422785){return _0x2d51ff(null,![],_0x422785);});}function sendServiceMail(_0xbbee2e){return db[_0x5fe7('0x1e')][_0x5fe7('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x5fe7('0x13'),_0x5fe7('0x20')],'include':[{'model':db['MailServerOut'],'as':_0x5fe7('0x21'),'include':[{'model':db[_0x5fe7('0x22')],'as':'CloudProvider'}]}]})[_0x5fe7('0x15')](function(_0x489ebd){if(!_0x489ebd){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x4d3a70=_0x489ebd[_0x5fe7('0x23')]();var _0x19bb3c={'account':_0x4d3a70,'message':_['merge']({'from':util[_0x5fe7('0x24')](_0x5fe7('0x25'),_0x489ebd[_0x5fe7('0x13')],_0x489ebd[_0x5fe7('0x20')]||_0x489ebd['Smtp'][_0x5fe7('0x26')])},_0xbbee2e)};return client[_0x5fe7('0x27')](_0x5fe7('0x28'),_0x19bb3c);})[_0x5fe7('0x15')](function(_0x11e603){if(_0x11e603[_0x5fe7('0x29')]){throw new Error(util[_0x5fe7('0x24')](_0x5fe7('0x2a'),_0x11e603['error']['message']||JSON[_0x5fe7('0x2b')](_0x11e603[_0x5fe7('0x29')])));}return!![];});}function handleError(_0x157b89,_0x1396b8,_0x5a59a3){return _0x157b89[_0x5fe7('0x2c')](_0x1396b8||0x1f4)[_0x5fe7('0x2d')]({'message':_0x5a59a3?_0x5a59a3[_0x5fe7('0x2e')]||_0x5a59a3:''});}exports['login']=function(_0x41401a,_0x3f27f4,_0x5e21bf){passport[_0x5fe7('0x16')]('local-login',function(_0x4eba4d,_0x12579b,_0x392c91){var _0x50dbf4=_0x4eba4d||_0x392c91;if(_0x50dbf4){return handleError(_0x3f27f4,0x191,_0x50dbf4);}if(!_0x12579b){return handleError(_0x3f27f4,0x194,{'message':_0x5fe7('0x2f')});}else{var _0x236979={'payload':{'id':_0x12579b['id'],'role':_0x12579b[_0x5fe7('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0x5fe7('0x30')](_0x236979)[_0x5fe7('0x15')](function(_0x36f0c2){_0x3f27f4[_0x5fe7('0x31')]({'id':_0x12579b['id'],'token':_0x36f0c2,'statusCall':'','isAlreadyLogged':_0x12579b[_0x5fe7('0x32')]});});}})(_0x41401a,_0x3f27f4,_0x5e21bf);};exports[_0x5fe7('0x33')]=function(_0x43f2f3,_0x458969){if(!_0x43f2f3[_0x5fe7('0x34')]['email']){return handleError(_0x458969,0x1f4,{'message':_0x5fe7('0x35')});}var _0x13a1b5=rs['generate']();_0x43f2f3['body'][_0x5fe7('0x20')]=_0x43f2f3['body'][_0x5fe7('0x20')]['trim']()[_0x5fe7('0x36')]();var _0x4f0d92;return db['Setting'][_0x5fe7('0xc')]({'where':{'id':0x1},'attributes':[_0x5fe7('0x1b'),_0x5fe7('0x17')],'raw':!![]})[_0x5fe7('0x15')](function(_0xe1e814){_0x4f0d92=_0xe1e814;return db[_0x5fe7('0x37')][_0x5fe7('0x1f')]({'where':{'email':_0x43f2f3[_0x5fe7('0x34')][_0x5fe7('0x20')]}});})['then'](function(_0x4024dd){if(!_0x4024dd){throw new Error(_0x5fe7('0x38'));}if(_0x4024dd[_0x5fe7('0xe')]){throw new Error(_0x5fe7('0x39'));}if(_0x4024dd[_0x5fe7('0xf')]){if(moment(_0x4024dd[_0x5fe7('0x10')])[_0x5fe7('0x18')](_0x4f0d92[_0x5fe7('0x17')],'minutes')>moment()){throw new Error(_0x5fe7('0x3a'));}else{_0x4024dd[_0x5fe7('0xf')]=![];_0x4024dd['blockedAt']=null;}}_0x4024dd[_0x5fe7('0x3b')]=_0x13a1b5;_0x4024dd[_0x5fe7('0x3c')]=Date['now']()+0x36ee80;return _0x4024dd[_0x5fe7('0x3d')]();})[_0x5fe7('0x15')](function(){return sendServiceMail({'to':_0x43f2f3[_0x5fe7('0x34')][_0x5fe7('0x20')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x5fe7('0x3e')+_0x5fe7('0x3f')+_0x5fe7('0x40')+_0x43f2f3[_0x5fe7('0x41')][_0x5fe7('0x42')]+_0x5fe7('0x43')+_0x13a1b5+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x5fe7('0x15')](function(){_0x458969[_0x5fe7('0x2c')](0xc8)[_0x5fe7('0x2d')]({'message':_0x5fe7('0x44')});})['catch'](function(_0x3617e8){return handleError(_0x458969,0x1f4,_0x3617e8);});};exports[_0x5fe7('0x45')]=function(_0x2227c8,_0x268b0e){return db['User']['find']({'where':{'resetPasswordToken':_0x2227c8[_0x5fe7('0x46')][_0x5fe7('0x47')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x5fe7('0x15')](function(_0x2e4773){if(!_0x2e4773){throw new Error(_0x5fe7('0x48'));}return db['Setting'][_0x5fe7('0xc')]({'attributes':['id','securePassword',_0x5fe7('0x49'),_0x5fe7('0x4a')]})[_0x5fe7('0x15')](function(_0xa0a9c0){if(_0xa0a9c0[_0x5fe7('0x4b')])authService[_0x5fe7('0x4c')](_0x2227c8['body'][_0x5fe7('0x4d')]);if(!_0xa0a9c0[_0x5fe7('0x49')]||!_0x2e4773[_0x5fe7('0x4e')])return _0x2e4773;authService[_0x5fe7('0x4f')](_0x2227c8[_0x5fe7('0x34')][_0x5fe7('0x4d')],_0x2e4773[_0x5fe7('0x4e')],_0xa0a9c0[_0x5fe7('0x4a')]);return _0x2e4773;})[_0x5fe7('0x15')](function(){_0x2e4773[_0x5fe7('0x4d')]=_0x2227c8[_0x5fe7('0x34')][_0x5fe7('0x4d')];_0x2e4773[_0x5fe7('0x3b')]=null;_0x2e4773[_0x5fe7('0x3c')]=null;return _0x2e4773[_0x5fe7('0x3d')]();});})[_0x5fe7('0x15')](function(){_0x268b0e['status'](0xc8)[_0x5fe7('0x2d')]({'message':_0x5fe7('0x50')});})[_0x5fe7('0x1d')](function(_0x486f22){return handleError(_0x268b0e,0x1f4,_0x486f22);});};passport['use']('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0x5fe7('0x4d')},function(_0x4b78d8,_0x37cee6,_0xfe8ed){return localAuthenticate(db[_0x5fe7('0x37')],_0x4b78d8,_0x37cee6,_0xfe8ed);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index cb1d654..37756ef 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 _0x6b86=['/reset/:token','reset','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x5ef3e5,_0x1df146){var _0x293362=function(_0x5a69ff){while(--_0x5a69ff){_0x5ef3e5['push'](_0x5ef3e5['shift']());}};_0x293362(++_0x1df146);}(_0x6b86,0x152));var _0x66b8=function(_0x576a26,_0x43c6){_0x576a26=_0x576a26-0x0;var _0x231d3a=_0x6b86[_0x576a26];return _0x231d3a;};'use strict';var express=require('express');var router=express[_0x66b8('0x0')]();var controller=require(_0x66b8('0x1'));router[_0x66b8('0x2')]('/',controller[_0x66b8('0x3')]);router[_0x66b8('0x2')](_0x66b8('0x4'),controller[_0x66b8('0x5')]);router[_0x66b8('0x2')](_0x66b8('0x6'),controller[_0x66b8('0x7')]);module['exports']=router;
\ No newline at end of file
+var _0x07ee=['post','login','/reset/:token','exports','express'];(function(_0x1bba92,_0x57636e){var _0x305d56=function(_0x418ef0){while(--_0x418ef0){_0x1bba92['push'](_0x1bba92['shift']());}};_0x305d56(++_0x57636e);}(_0x07ee,0x1b2));var _0xe07e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x07ee[_0x37c22c];return _0x119d79;};'use strict';var express=require(_0xe07e('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0xe07e('0x1')]('/',controller[_0xe07e('0x2')]);router[_0xe07e('0x1')]('/forgot',controller['forgot']);router[_0xe07e('0x1')](_0xe07e('0x3'),controller['reset']);module[_0xe07e('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index aee71e0..4b7e753 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 _0x62f5=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x62f5,0x131));var _0x562f=function(_0x15c9ec,_0x3a5153){_0x15c9ec=_0x15c9ec-0x0;var _0x6369ee=_0x62f5[_0x15c9ec];return _0x6369ee;};'use strict';var Sequelize=require(_0x562f('0x0'));module[_0x562f('0x1')]={'name':{'type':Sequelize[_0x562f('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x562f('0x2')]},'status':{'type':Sequelize[_0x562f('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x562f('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x70b8=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x3dbc81,_0x5758fb){var _0x2f54c9=function(_0x16c516){while(--_0x16c516){_0x3dbc81['push'](_0x3dbc81['shift']());}};_0x2f54c9(++_0x5758fb);}(_0x70b8,0x19d));var _0x870b=function(_0x9af5f8,_0x2aba65){_0x9af5f8=_0x9af5f8-0x0;var _0x16f732=_0x70b8[_0x9af5f8];return _0x16f732;};'use strict';var Sequelize=require(_0x870b('0x0'));module[_0x870b('0x1')]={'name':{'type':Sequelize[_0x870b('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x870b('0x2')]},'status':{'type':Sequelize[_0x870b('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x870b('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 9ffff87..bc5ccae 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 _0x632e=['end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Automation','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','addConditions','Condition','ids','omit','findOne','getConditions','hasOwnProperty','nolimit','addActions','Action','getActions','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x21a286,_0x26db62){var _0x526809=function(_0x18f3b0){while(--_0x18f3b0){_0x21a286['push'](_0x21a286['shift']());}};_0x526809(++_0x26db62);}(_0x632e,0x1ef));var _0xe632=function(_0x32b122,_0x1ad490){_0x32b122=_0x32b122-0x0;var _0x4ad25a=_0x632e[_0x32b122];return _0x4ad25a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe632('0x0'));var jsonpatch=require(_0xe632('0x1'));var rp=require(_0xe632('0x2'));var moment=require(_0xe632('0x3'));var BPromise=require(_0xe632('0x4'));var Mustache=require('mustache');var util=require(_0xe632('0x5'));var path=require(_0xe632('0x6'));var sox=require(_0xe632('0x7'));var csv=require('to-csv');var ejs=require(_0xe632('0x8'));var fs=require('fs');var fs_extra=require(_0xe632('0x9'));var _=require(_0xe632('0xa'));var squel=require(_0xe632('0xb'));var crypto=require(_0xe632('0xc'));var jsforce=require(_0xe632('0xd'));var deskjs=require(_0xe632('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe632('0xf'));var Redis=require(_0xe632('0x10'));var authService=require(_0xe632('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe632('0x12'));var hardwareService=require(_0xe632('0x13'));var logger=require(_0xe632('0x14'))(_0xe632('0x15'));var utils=require(_0xe632('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe632('0x17'));var db=require(_0xe632('0x18'))['db'];function respondWithStatusCode(_0xc1f14a,_0xec6603){_0xec6603=_0xec6603||0xcc;return function(_0x304fbe){if(_0x304fbe){return _0xc1f14a[_0xe632('0x19')](_0xec6603);}return _0xc1f14a[_0xe632('0x1a')](_0xec6603)[_0xe632('0x1b')]();};}function respondWithResult(_0x539791,_0x4bc89f){_0x4bc89f=_0x4bc89f||0xc8;return function(_0xcc4e89){if(_0xcc4e89){return _0x539791[_0xe632('0x1a')](_0x4bc89f)[_0xe632('0x1c')](_0xcc4e89);}};}function respondWithFilteredResult(_0x2e7269,_0x2d67ba){return function(_0x18ded0){if(_0x18ded0){var _0x5ab7b6=typeof _0x2d67ba[_0xe632('0x1d')]===_0xe632('0x1e')&&typeof _0x2d67ba['limit']===_0xe632('0x1e');var _0x4f6634=_0x18ded0[_0xe632('0x1f')];var _0x4757e3=_0x5ab7b6?0x0:_0x2d67ba[_0xe632('0x1d')];var _0x365390=_0x5ab7b6?_0x18ded0[_0xe632('0x1f')]:_0x2d67ba['offset']+_0x2d67ba[_0xe632('0x20')];var _0x1d86d9;if(_0x365390>=_0x4f6634){_0x365390=_0x4f6634;_0x1d86d9=0xc8;}else{_0x1d86d9=0xce;}_0x2e7269[_0xe632('0x1a')](_0x1d86d9);return _0x2e7269[_0xe632('0x21')](_0xe632('0x22'),_0x4757e3+'-'+_0x365390+'/'+_0x4f6634)['json'](_0x18ded0);}return null;};}function patchUpdates(_0x475e96){return function(_0x2acf0b){try{jsonpatch[_0xe632('0x23')](_0x2acf0b,_0x475e96,!![]);}catch(_0x126fce){return BPromise[_0xe632('0x24')](_0x126fce);}return _0x2acf0b[_0xe632('0x25')]();};}function saveUpdates(_0x810713,_0xcb9468){return function(_0x2050e7){if(_0x2050e7){return _0x2050e7[_0xe632('0x26')](_0x810713)[_0xe632('0x27')](function(_0x18952e){return _0x18952e;});}return null;};}function removeEntity(_0x53549b,_0x3ff38e){return function(_0x466b75){if(_0x466b75){return _0x466b75[_0xe632('0x28')]()[_0xe632('0x27')](function(){_0x53549b[_0xe632('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e779f,_0x3af543){return function(_0x177ac6){if(!_0x177ac6){_0x3e779f[_0xe632('0x19')](0x194);}return _0x177ac6;};}function handleError(_0x49d724,_0x5422c5){_0x5422c5=_0x5422c5||0x1f4;return function(_0x5eea04){logger[_0xe632('0x29')](_0x5eea04[_0xe632('0x2a')]);if(_0x5eea04[_0xe632('0x2b')]){delete _0x5eea04[_0xe632('0x2b')];}_0x49d724[_0xe632('0x1a')](_0x5422c5)[_0xe632('0x2c')](_0x5eea04);};}exports['index']=function(_0x439149,_0x1ddc3f){var _0x2eb25d={},_0x3cf90c={},_0x40b26d={'count':0x0,'rows':[]};var _0xa48265=_['map'](db[_0xe632('0x2d')][_0xe632('0x2e')],function(_0x4102a8){return{'name':_0x4102a8[_0xe632('0x2f')],'type':_0x4102a8[_0xe632('0x30')][_0xe632('0x31')]};});_0x3cf90c[_0xe632('0x32')]=_[_0xe632('0x33')](_0xa48265,'name');_0x3cf90c['query']=_[_0xe632('0x34')](_0x439149[_0xe632('0x35')]);_0x3cf90c[_0xe632('0x36')]=_[_0xe632('0x37')](_0x3cf90c['model'],_0x3cf90c[_0xe632('0x35')]);_0x2eb25d['attributes']=_[_0xe632('0x37')](_0x3cf90c[_0xe632('0x32')],qs[_0xe632('0x38')](_0x439149[_0xe632('0x35')][_0xe632('0x38')]));_0x2eb25d[_0xe632('0x39')]=_0x2eb25d[_0xe632('0x39')]['length']?_0x2eb25d[_0xe632('0x39')]:_0x3cf90c[_0xe632('0x32')];if(!_0x439149[_0xe632('0x35')]['hasOwnProperty']('nolimit')){_0x2eb25d['limit']=qs[_0xe632('0x20')](_0x439149['query'][_0xe632('0x20')]);_0x2eb25d[_0xe632('0x1d')]=qs[_0xe632('0x1d')](_0x439149[_0xe632('0x35')]['offset']);}_0x2eb25d[_0xe632('0x3a')]=qs['sort'](_0x439149['query'][_0xe632('0x3b')]);_0x2eb25d[_0xe632('0x3c')]=qs['filters'](_[_0xe632('0x3d')](_0x439149[_0xe632('0x35')],_0x3cf90c['filters']),_0xa48265);if(_0x439149[_0xe632('0x35')][_0xe632('0x3e')]){_0x2eb25d[_0xe632('0x3c')]=_[_0xe632('0x3f')](_0x2eb25d['where'],{'$or':_['map'](_0xa48265,function(_0x367218){if(_0x367218[_0xe632('0x30')]!==_0xe632('0x40')){var _0x19d9ac={};_0x19d9ac[_0x367218['name']]={'$like':'%'+_0x439149[_0xe632('0x35')][_0xe632('0x3e')]+'%'};return _0x19d9ac;}})});}_0x2eb25d=_[_0xe632('0x3f')]({},_0x2eb25d,_0x439149[_0xe632('0x41')]);var _0x4d8700={'where':_0x2eb25d['where']};return db[_0xe632('0x2d')][_0xe632('0x1f')](_0x4d8700)[_0xe632('0x27')](function(_0x516b9a){_0x40b26d['count']=_0x516b9a;if(_0x439149['query'][_0xe632('0x42')]){_0x2eb25d[_0xe632('0x43')]=[{'all':!![]}];}return db[_0xe632('0x2d')][_0xe632('0x44')](_0x2eb25d);})[_0xe632('0x27')](function(_0x34e754){_0x40b26d['rows']=_0x34e754;return _0x40b26d;})[_0xe632('0x27')](respondWithFilteredResult(_0x1ddc3f,_0x2eb25d))[_0xe632('0x45')](handleError(_0x1ddc3f,null));};exports[_0xe632('0x46')]=function(_0x4d9cc5,_0x50b1c2){var _0x4634ab={'raw':![],'where':{'id':_0x4d9cc5[_0xe632('0x47')]['id']}},_0x1dac46={};_0x1dac46[_0xe632('0x32')]=_[_0xe632('0x34')](db[_0xe632('0x2d')][_0xe632('0x2e')]);_0x1dac46[_0xe632('0x35')]=_[_0xe632('0x34')](_0x4d9cc5[_0xe632('0x35')]);_0x1dac46[_0xe632('0x36')]=_[_0xe632('0x37')](_0x1dac46[_0xe632('0x32')],_0x1dac46[_0xe632('0x35')]);_0x4634ab[_0xe632('0x39')]=_['intersection'](_0x1dac46[_0xe632('0x32')],qs['fields'](_0x4d9cc5[_0xe632('0x35')][_0xe632('0x38')]));_0x4634ab['attributes']=_0x4634ab[_0xe632('0x39')][_0xe632('0x48')]?_0x4634ab[_0xe632('0x39')]:_0x1dac46['model'];if(_0x4d9cc5[_0xe632('0x35')][_0xe632('0x42')]){_0x4634ab[_0xe632('0x43')]=[{'all':!![]}];}_0x4634ab=_[_0xe632('0x3f')]({},_0x4634ab,_0x4d9cc5['options']);return db['Automation'][_0xe632('0x49')](_0x4634ab)['then'](handleEntityNotFound(_0x50b1c2,null))[_0xe632('0x27')](respondWithResult(_0x50b1c2,null))[_0xe632('0x45')](handleError(_0x50b1c2,null));};exports[_0xe632('0x4a')]=function(_0xb96944,_0x396c4f){return db['Automation'][_0xe632('0x4a')](_0xb96944[_0xe632('0x4b')],{})[_0xe632('0x27')](respondWithResult(_0x396c4f,0xc9))[_0xe632('0x45')](handleError(_0x396c4f,null));};exports[_0xe632('0x26')]=function(_0xbb9146,_0x45968e){if(_0xbb9146[_0xe632('0x4b')]['id']){delete _0xbb9146[_0xe632('0x4b')]['id'];}return db[_0xe632('0x2d')]['find']({'where':{'id':_0xbb9146[_0xe632('0x47')]['id']}})[_0xe632('0x27')](handleEntityNotFound(_0x45968e,null))[_0xe632('0x27')](saveUpdates(_0xbb9146['body'],null))['then'](respondWithResult(_0x45968e,null))[_0xe632('0x45')](handleError(_0x45968e,null));};exports[_0xe632('0x28')]=function(_0x11b2d0,_0x33d63c){return db['Automation'][_0xe632('0x49')]({'where':{'id':_0x11b2d0[_0xe632('0x47')]['id']}})['then'](handleEntityNotFound(_0x33d63c,null))[_0xe632('0x27')](removeEntity(_0x33d63c,null))[_0xe632('0x45')](handleError(_0x33d63c,null));};exports[_0xe632('0x4c')]=function(_0x1be386,_0x14d320,_0xebdab0){return db[_0xe632('0x4d')][_0xe632('0x49')]({'where':{'id':_0x1be386[_0xe632('0x47')]['id']}})['then'](handleEntityNotFound(_0x14d320,null))[_0xe632('0x27')](function(_0x5a7700){if(_0x5a7700){return _0x5a7700['addConditions'](_0x1be386[_0xe632('0x4b')][_0xe632('0x4e')],_[_0xe632('0x4f')](_0x1be386['body'],[_0xe632('0x4e'),'id'])||{});}})[_0xe632('0x27')](respondWithResult(_0x14d320,null))['catch'](handleError(_0x14d320,null));};exports['getConditions']=function(_0x464943,_0x39dd82,_0x3ddf7c){var _0x50c603={};var _0x5848f6={};var _0x5708d9;var _0x3124a5;return db['Automation'][_0xe632('0x50')]({'where':{'id':_0x464943[_0xe632('0x47')]['id']}})[_0xe632('0x27')](handleEntityNotFound(_0x39dd82,null))['then'](function(_0x2cd0fc){if(_0x2cd0fc){_0x5708d9=_0x2cd0fc;_0x5848f6['model']=_[_0xe632('0x34')](db[_0xe632('0x4d')][_0xe632('0x2e')]);_0x5848f6['query']=_[_0xe632('0x34')](_0x464943[_0xe632('0x35')]);_0x5848f6[_0xe632('0x36')]=_[_0xe632('0x37')](_0x5848f6[_0xe632('0x32')],_0x5848f6[_0xe632('0x35')]);_0x50c603['attributes']=_[_0xe632('0x37')](_0x5848f6[_0xe632('0x32')],qs[_0xe632('0x38')](_0x464943[_0xe632('0x35')]['fields']));_0x50c603[_0xe632('0x39')]=_0x50c603[_0xe632('0x39')][_0xe632('0x48')]?_0x50c603['attributes']:_0x5848f6[_0xe632('0x32')];_0x50c603[_0xe632('0x3a')]=qs['sort'](_0x464943['query'][_0xe632('0x3b')]);_0x50c603['where']=qs[_0xe632('0x36')](_[_0xe632('0x3d')](_0x464943['query'],_0x5848f6[_0xe632('0x36')]));if(_0x464943[_0xe632('0x35')][_0xe632('0x3e')]){_0x50c603[_0xe632('0x3c')]=_[_0xe632('0x3f')](_0x50c603[_0xe632('0x3c')],{'$or':_[_0xe632('0x33')](_0x50c603['attributes'],function(_0x1f72b1){var _0x33741b={};_0x33741b[_0x1f72b1]={'$like':'%'+_0x464943[_0xe632('0x35')][_0xe632('0x3e')]+'%'};return _0x33741b;})});}_0x50c603=_[_0xe632('0x3f')]({},_0x50c603,_0x464943[_0xe632('0x41')]);return _0x5708d9[_0xe632('0x51')](_0x50c603);}})[_0xe632('0x27')](function(_0x460f74){if(_0x460f74){_0x3124a5=_0x460f74['length'];if(!_0x464943['query'][_0xe632('0x52')](_0xe632('0x53'))){_0x50c603[_0xe632('0x20')]=qs[_0xe632('0x20')](_0x464943[_0xe632('0x35')][_0xe632('0x20')]);_0x50c603[_0xe632('0x1d')]=qs['offset'](_0x464943[_0xe632('0x35')][_0xe632('0x1d')]);}return _0x5708d9['getConditions'](_0x50c603);}})['then'](function(_0x374e11){if(_0x374e11){return _0x374e11?{'count':_0x3124a5,'rows':_0x374e11}:null;}})[_0xe632('0x27')](respondWithResult(_0x39dd82,null))[_0xe632('0x45')](handleError(_0x39dd82,null));};exports[_0xe632('0x54')]=function(_0x49693b,_0x247905,_0x362760){return db[_0xe632('0x55')][_0xe632('0x49')]({'where':{'id':_0x49693b[_0xe632('0x47')]['id']}})['then'](handleEntityNotFound(_0x247905,null))['then'](function(_0x42fd20){if(_0x42fd20){return _0x42fd20['addActions'](_0x49693b['body'][_0xe632('0x4e')],_[_0xe632('0x4f')](_0x49693b[_0xe632('0x4b')],[_0xe632('0x4e'),'id'])||{});}})[_0xe632('0x27')](respondWithResult(_0x247905,null))[_0xe632('0x45')](handleError(_0x247905,null));};exports[_0xe632('0x56')]=function(_0x1d9513,_0x12fbe5,_0x1c85ac){var _0x317724={};var _0x44d522={};var _0xd863af;var _0x54b3c6;return db[_0xe632('0x2d')][_0xe632('0x50')]({'where':{'id':_0x1d9513[_0xe632('0x47')]['id']}})[_0xe632('0x27')](handleEntityNotFound(_0x12fbe5,null))[_0xe632('0x27')](function(_0x11ab4b){if(_0x11ab4b){_0xd863af=_0x11ab4b;_0x44d522['model']=_[_0xe632('0x34')](db[_0xe632('0x55')]['rawAttributes']);_0x44d522[_0xe632('0x35')]=_[_0xe632('0x34')](_0x1d9513[_0xe632('0x35')]);_0x44d522[_0xe632('0x36')]=_[_0xe632('0x37')](_0x44d522[_0xe632('0x32')],_0x44d522[_0xe632('0x35')]);_0x317724[_0xe632('0x39')]=_[_0xe632('0x37')](_0x44d522[_0xe632('0x32')],qs[_0xe632('0x38')](_0x1d9513[_0xe632('0x35')][_0xe632('0x38')]));_0x317724[_0xe632('0x39')]=_0x317724[_0xe632('0x39')][_0xe632('0x48')]?_0x317724[_0xe632('0x39')]:_0x44d522[_0xe632('0x32')];_0x317724[_0xe632('0x3a')]=qs[_0xe632('0x3b')](_0x1d9513[_0xe632('0x35')][_0xe632('0x3b')]);_0x317724[_0xe632('0x3c')]=qs[_0xe632('0x36')](_['pick'](_0x1d9513[_0xe632('0x35')],_0x44d522[_0xe632('0x36')]));if(_0x1d9513[_0xe632('0x35')][_0xe632('0x3e')]){_0x317724[_0xe632('0x3c')]=_[_0xe632('0x3f')](_0x317724[_0xe632('0x3c')],{'$or':_[_0xe632('0x33')](_0x317724[_0xe632('0x39')],function(_0x39a344){var _0xf25480={};_0xf25480[_0x39a344]={'$like':'%'+_0x1d9513[_0xe632('0x35')][_0xe632('0x3e')]+'%'};return _0xf25480;})});}_0x317724=_[_0xe632('0x3f')]({},_0x317724,_0x1d9513[_0xe632('0x41')]);return _0xd863af[_0xe632('0x56')](_0x317724);}})['then'](function(_0x4643fc){if(_0x4643fc){_0x54b3c6=_0x4643fc[_0xe632('0x48')];if(!_0x1d9513[_0xe632('0x35')][_0xe632('0x52')](_0xe632('0x53'))){_0x317724[_0xe632('0x20')]=qs['limit'](_0x1d9513[_0xe632('0x35')]['limit']);_0x317724['offset']=qs[_0xe632('0x1d')](_0x1d9513[_0xe632('0x35')]['offset']);}return _0xd863af[_0xe632('0x56')](_0x317724);}})[_0xe632('0x27')](function(_0x129654){if(_0x129654){return _0x129654?{'count':_0x54b3c6,'rows':_0x129654}:null;}})[_0xe632('0x27')](respondWithResult(_0x12fbe5,null))[_0xe632('0x45')](handleError(_0x12fbe5,null));};
\ No newline at end of file
+var _0xd915=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','set','apply','reject','update','then','destroy','error','name','send','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','addConditions','Condition','ids','omit','getConditions','length','Action','addActions','findOne','order','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3abf91,_0x52b83c){var _0x429cae=function(_0xaa4612){while(--_0xaa4612){_0x3abf91['push'](_0x3abf91['shift']());}};_0x429cae(++_0x52b83c);}(_0xd915,0x137));var _0x5d91=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xd915[_0x2a6809];return _0x11c371;};'use strict';var emlformat=require(_0x5d91('0x0'));var rimraf=require(_0x5d91('0x1'));var zipdir=require(_0x5d91('0x2'));var jsonpatch=require(_0x5d91('0x3'));var rp=require(_0x5d91('0x4'));var moment=require('moment');var BPromise=require(_0x5d91('0x5'));var Mustache=require(_0x5d91('0x6'));var util=require(_0x5d91('0x7'));var path=require(_0x5d91('0x8'));var sox=require(_0x5d91('0x9'));var csv=require(_0x5d91('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5d91('0xb'));var _=require(_0x5d91('0xc'));var squel=require(_0x5d91('0xd'));var crypto=require(_0x5d91('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5d91('0xf'));var toCsv=require(_0x5d91('0xa'));var querystring=require(_0x5d91('0x10'));var Papa=require(_0x5d91('0x11'));var Redis=require(_0x5d91('0x12'));var authService=require(_0x5d91('0x13'));var qs=require(_0x5d91('0x14'));var as=require(_0x5d91('0x15'));var hardwareService=require(_0x5d91('0x16'));var logger=require(_0x5d91('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5d91('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f36da,_0x28f2ce){_0x28f2ce=_0x28f2ce||0xcc;return function(_0x15c9f6){if(_0x15c9f6){return _0x2f36da[_0x5d91('0x19')](_0x28f2ce);}return _0x2f36da['status'](_0x28f2ce)[_0x5d91('0x1a')]();};}function respondWithResult(_0x1e7f89,_0xbb7c9e){_0xbb7c9e=_0xbb7c9e||0xc8;return function(_0x2dcb69){if(_0x2dcb69){return _0x1e7f89[_0x5d91('0x1b')](_0xbb7c9e)['json'](_0x2dcb69);}};}function respondWithFilteredResult(_0x332a07,_0x243fa0){return function(_0x73e2d6){if(_0x73e2d6){var _0x122fcb=typeof _0x243fa0['offset']===_0x5d91('0x1c')&&typeof _0x243fa0['limit']===_0x5d91('0x1c');var _0x5e32ae=_0x73e2d6[_0x5d91('0x1d')];var _0x23c7fd=_0x122fcb?0x0:_0x243fa0[_0x5d91('0x1e')];var _0x3c11ca=_0x122fcb?_0x73e2d6[_0x5d91('0x1d')]:_0x243fa0[_0x5d91('0x1e')]+_0x243fa0[_0x5d91('0x1f')];var _0x139cb4;if(_0x3c11ca>=_0x5e32ae){_0x3c11ca=_0x5e32ae;_0x139cb4=0xc8;}else{_0x139cb4=0xce;}_0x332a07[_0x5d91('0x1b')](_0x139cb4);return _0x332a07[_0x5d91('0x20')]('Content-Range',_0x23c7fd+'-'+_0x3c11ca+'/'+_0x5e32ae)['json'](_0x73e2d6);}return null;};}function patchUpdates(_0x2c5d9c){return function(_0x3f55a3){try{jsonpatch[_0x5d91('0x21')](_0x3f55a3,_0x2c5d9c,!![]);}catch(_0x54b9e0){return BPromise[_0x5d91('0x22')](_0x54b9e0);}return _0x3f55a3['save']();};}function saveUpdates(_0x252474,_0x3b19cd){return function(_0xfa179b){if(_0xfa179b){return _0xfa179b[_0x5d91('0x23')](_0x252474)[_0x5d91('0x24')](function(_0x4b8e6c){return _0x4b8e6c;});}return null;};}function removeEntity(_0x1162b5,_0x428c7f){return function(_0x20e8a6){if(_0x20e8a6){return _0x20e8a6[_0x5d91('0x25')]()['then'](function(){_0x1162b5[_0x5d91('0x1b')](0xcc)[_0x5d91('0x1a')]();});}};}function handleEntityNotFound(_0x5a3a6c,_0x41d632){return function(_0x2eac3f){if(!_0x2eac3f){_0x5a3a6c['sendStatus'](0x194);}return _0x2eac3f;};}function handleError(_0x185e30,_0x11fe03){_0x11fe03=_0x11fe03||0x1f4;return function(_0xbf9eb5){logger[_0x5d91('0x26')](_0xbf9eb5['stack']);if(_0xbf9eb5[_0x5d91('0x27')]){delete _0xbf9eb5[_0x5d91('0x27')];}_0x185e30['status'](_0x11fe03)[_0x5d91('0x28')](_0xbf9eb5);};}exports['index']=function(_0x2f925d,_0x34fe10){var _0x49a65c={},_0x4d37f8={},_0xdf6aec={'count':0x0,'rows':[]};var _0x590a62=_[_0x5d91('0x29')](db[_0x5d91('0x2a')][_0x5d91('0x2b')],function(_0x51cbf1){return{'name':_0x51cbf1[_0x5d91('0x2c')],'type':_0x51cbf1[_0x5d91('0x2d')][_0x5d91('0x2e')]};});_0x4d37f8[_0x5d91('0x2f')]=_['map'](_0x590a62,_0x5d91('0x27'));_0x4d37f8[_0x5d91('0x30')]=_[_0x5d91('0x31')](_0x2f925d[_0x5d91('0x30')]);_0x4d37f8['filters']=_[_0x5d91('0x32')](_0x4d37f8[_0x5d91('0x2f')],_0x4d37f8['query']);_0x49a65c[_0x5d91('0x33')]=_[_0x5d91('0x32')](_0x4d37f8[_0x5d91('0x2f')],qs['fields'](_0x2f925d[_0x5d91('0x30')][_0x5d91('0x34')]));_0x49a65c[_0x5d91('0x33')]=_0x49a65c[_0x5d91('0x33')]['length']?_0x49a65c[_0x5d91('0x33')]:_0x4d37f8['model'];if(!_0x2f925d[_0x5d91('0x30')][_0x5d91('0x35')](_0x5d91('0x36'))){_0x49a65c[_0x5d91('0x1f')]=qs[_0x5d91('0x1f')](_0x2f925d[_0x5d91('0x30')][_0x5d91('0x1f')]);_0x49a65c[_0x5d91('0x1e')]=qs[_0x5d91('0x1e')](_0x2f925d[_0x5d91('0x30')][_0x5d91('0x1e')]);}_0x49a65c['order']=qs[_0x5d91('0x37')](_0x2f925d[_0x5d91('0x30')][_0x5d91('0x37')]);_0x49a65c[_0x5d91('0x38')]=qs[_0x5d91('0x39')](_[_0x5d91('0x3a')](_0x2f925d[_0x5d91('0x30')],_0x4d37f8[_0x5d91('0x39')]),_0x590a62);if(_0x2f925d[_0x5d91('0x30')]['filter']){_0x49a65c[_0x5d91('0x38')]=_[_0x5d91('0x3b')](_0x49a65c['where'],{'$or':_[_0x5d91('0x29')](_0x590a62,function(_0x4dccfc){if(_0x4dccfc['type']!=='VIRTUAL'){var _0x504358={};_0x504358[_0x4dccfc[_0x5d91('0x27')]]={'$like':'%'+_0x2f925d[_0x5d91('0x30')][_0x5d91('0x3c')]+'%'};return _0x504358;}})});}_0x49a65c=_['merge']({},_0x49a65c,_0x2f925d[_0x5d91('0x3d')]);var _0x2a10df={'where':_0x49a65c['where']};return db['Automation'][_0x5d91('0x1d')](_0x2a10df)[_0x5d91('0x24')](function(_0x5e3557){_0xdf6aec['count']=_0x5e3557;if(_0x2f925d[_0x5d91('0x30')][_0x5d91('0x3e')]){_0x49a65c[_0x5d91('0x3f')]=[{'all':!![]}];}return db[_0x5d91('0x2a')][_0x5d91('0x40')](_0x49a65c);})['then'](function(_0x21efde){_0xdf6aec[_0x5d91('0x41')]=_0x21efde;return _0xdf6aec;})[_0x5d91('0x24')](respondWithFilteredResult(_0x34fe10,_0x49a65c))[_0x5d91('0x42')](handleError(_0x34fe10,null));};exports[_0x5d91('0x43')]=function(_0x4d4f74,_0x4ae299){var _0x56af87={'raw':![],'where':{'id':_0x4d4f74[_0x5d91('0x44')]['id']}},_0x713703={};_0x713703[_0x5d91('0x2f')]=_['keys'](db[_0x5d91('0x2a')][_0x5d91('0x2b')]);_0x713703[_0x5d91('0x30')]=_[_0x5d91('0x31')](_0x4d4f74['query']);_0x713703['filters']=_[_0x5d91('0x32')](_0x713703[_0x5d91('0x2f')],_0x713703['query']);_0x56af87['attributes']=_['intersection'](_0x713703[_0x5d91('0x2f')],qs[_0x5d91('0x34')](_0x4d4f74['query']['fields']));_0x56af87[_0x5d91('0x33')]=_0x56af87[_0x5d91('0x33')]['length']?_0x56af87['attributes']:_0x713703[_0x5d91('0x2f')];if(_0x4d4f74[_0x5d91('0x30')][_0x5d91('0x3e')]){_0x56af87[_0x5d91('0x3f')]=[{'all':!![]}];}_0x56af87=_['merge']({},_0x56af87,_0x4d4f74[_0x5d91('0x3d')]);return db[_0x5d91('0x2a')][_0x5d91('0x45')](_0x56af87)[_0x5d91('0x24')](handleEntityNotFound(_0x4ae299,null))[_0x5d91('0x24')](respondWithResult(_0x4ae299,null))[_0x5d91('0x42')](handleError(_0x4ae299,null));};exports['create']=function(_0x4ff1a4,_0x2611f6){return db['Automation'][_0x5d91('0x46')](_0x4ff1a4[_0x5d91('0x47')],{})[_0x5d91('0x24')](respondWithResult(_0x2611f6,0xc9))['catch'](handleError(_0x2611f6,null));};exports[_0x5d91('0x23')]=function(_0x727868,_0x3b8c11){if(_0x727868['body']['id']){delete _0x727868[_0x5d91('0x47')]['id'];}return db[_0x5d91('0x2a')]['find']({'where':{'id':_0x727868['params']['id']}})[_0x5d91('0x24')](handleEntityNotFound(_0x3b8c11,null))[_0x5d91('0x24')](saveUpdates(_0x727868[_0x5d91('0x47')],null))['then'](respondWithResult(_0x3b8c11,null))['catch'](handleError(_0x3b8c11,null));};exports[_0x5d91('0x25')]=function(_0x596a35,_0x3006a0){return db['Automation']['find']({'where':{'id':_0x596a35[_0x5d91('0x44')]['id']}})[_0x5d91('0x24')](handleEntityNotFound(_0x3006a0,null))[_0x5d91('0x24')](removeEntity(_0x3006a0,null))['catch'](handleError(_0x3006a0,null));};exports[_0x5d91('0x48')]=function(_0x3e41b3,_0x560620,_0x3018c9){return db[_0x5d91('0x49')][_0x5d91('0x45')]({'where':{'id':_0x3e41b3[_0x5d91('0x44')]['id']}})[_0x5d91('0x24')](handleEntityNotFound(_0x560620,null))[_0x5d91('0x24')](function(_0x4a3099){if(_0x4a3099){return _0x4a3099[_0x5d91('0x48')](_0x3e41b3['body'][_0x5d91('0x4a')],_[_0x5d91('0x4b')](_0x3e41b3[_0x5d91('0x47')],[_0x5d91('0x4a'),'id'])||{});}})[_0x5d91('0x24')](respondWithResult(_0x560620,null))['catch'](handleError(_0x560620,null));};exports[_0x5d91('0x4c')]=function(_0x2dae2e,_0x5021dc,_0x3055ac){var _0x41fe58={};var _0x503c1f={};var _0x2c218b;var _0x554f29;return db[_0x5d91('0x2a')]['findOne']({'where':{'id':_0x2dae2e['params']['id']}})[_0x5d91('0x24')](handleEntityNotFound(_0x5021dc,null))[_0x5d91('0x24')](function(_0x24b2fa){if(_0x24b2fa){_0x2c218b=_0x24b2fa;_0x503c1f['model']=_[_0x5d91('0x31')](db['Condition'][_0x5d91('0x2b')]);_0x503c1f['query']=_['keys'](_0x2dae2e['query']);_0x503c1f[_0x5d91('0x39')]=_[_0x5d91('0x32')](_0x503c1f['model'],_0x503c1f[_0x5d91('0x30')]);_0x41fe58[_0x5d91('0x33')]=_[_0x5d91('0x32')](_0x503c1f[_0x5d91('0x2f')],qs[_0x5d91('0x34')](_0x2dae2e[_0x5d91('0x30')][_0x5d91('0x34')]));_0x41fe58['attributes']=_0x41fe58['attributes']['length']?_0x41fe58[_0x5d91('0x33')]:_0x503c1f[_0x5d91('0x2f')];_0x41fe58['order']=qs[_0x5d91('0x37')](_0x2dae2e[_0x5d91('0x30')][_0x5d91('0x37')]);_0x41fe58['where']=qs[_0x5d91('0x39')](_[_0x5d91('0x3a')](_0x2dae2e['query'],_0x503c1f['filters']));if(_0x2dae2e['query'][_0x5d91('0x3c')]){_0x41fe58[_0x5d91('0x38')]=_['merge'](_0x41fe58[_0x5d91('0x38')],{'$or':_[_0x5d91('0x29')](_0x41fe58[_0x5d91('0x33')],function(_0x32c6e0){var _0x54f14b={};_0x54f14b[_0x32c6e0]={'$like':'%'+_0x2dae2e[_0x5d91('0x30')][_0x5d91('0x3c')]+'%'};return _0x54f14b;})});}_0x41fe58=_[_0x5d91('0x3b')]({},_0x41fe58,_0x2dae2e[_0x5d91('0x3d')]);return _0x2c218b[_0x5d91('0x4c')](_0x41fe58);}})[_0x5d91('0x24')](function(_0x5945ec){if(_0x5945ec){_0x554f29=_0x5945ec[_0x5d91('0x4d')];if(!_0x2dae2e['query']['hasOwnProperty']('nolimit')){_0x41fe58[_0x5d91('0x1f')]=qs[_0x5d91('0x1f')](_0x2dae2e[_0x5d91('0x30')][_0x5d91('0x1f')]);_0x41fe58[_0x5d91('0x1e')]=qs[_0x5d91('0x1e')](_0x2dae2e[_0x5d91('0x30')][_0x5d91('0x1e')]);}return _0x2c218b[_0x5d91('0x4c')](_0x41fe58);}})[_0x5d91('0x24')](function(_0x29ec18){if(_0x29ec18){return _0x29ec18?{'count':_0x554f29,'rows':_0x29ec18}:null;}})['then'](respondWithResult(_0x5021dc,null))[_0x5d91('0x42')](handleError(_0x5021dc,null));};exports['addActions']=function(_0x13f5be,_0x55447b,_0x563342){return db[_0x5d91('0x4e')][_0x5d91('0x45')]({'where':{'id':_0x13f5be[_0x5d91('0x44')]['id']}})[_0x5d91('0x24')](handleEntityNotFound(_0x55447b,null))[_0x5d91('0x24')](function(_0x5d5054){if(_0x5d5054){return _0x5d5054[_0x5d91('0x4f')](_0x13f5be[_0x5d91('0x47')][_0x5d91('0x4a')],_[_0x5d91('0x4b')](_0x13f5be[_0x5d91('0x47')],[_0x5d91('0x4a'),'id'])||{});}})[_0x5d91('0x24')](respondWithResult(_0x55447b,null))[_0x5d91('0x42')](handleError(_0x55447b,null));};exports['getActions']=function(_0x253200,_0x32c996,_0x5e1192){var _0x32eb6d={};var _0x294ce5={};var _0x294ddc;var _0x78384a;return db['Automation'][_0x5d91('0x50')]({'where':{'id':_0x253200[_0x5d91('0x44')]['id']}})[_0x5d91('0x24')](handleEntityNotFound(_0x32c996,null))['then'](function(_0x422a0a){if(_0x422a0a){_0x294ddc=_0x422a0a;_0x294ce5[_0x5d91('0x2f')]=_[_0x5d91('0x31')](db[_0x5d91('0x4e')][_0x5d91('0x2b')]);_0x294ce5[_0x5d91('0x30')]=_['keys'](_0x253200[_0x5d91('0x30')]);_0x294ce5[_0x5d91('0x39')]=_[_0x5d91('0x32')](_0x294ce5[_0x5d91('0x2f')],_0x294ce5[_0x5d91('0x30')]);_0x32eb6d[_0x5d91('0x33')]=_[_0x5d91('0x32')](_0x294ce5[_0x5d91('0x2f')],qs['fields'](_0x253200[_0x5d91('0x30')]['fields']));_0x32eb6d[_0x5d91('0x33')]=_0x32eb6d['attributes'][_0x5d91('0x4d')]?_0x32eb6d[_0x5d91('0x33')]:_0x294ce5['model'];_0x32eb6d[_0x5d91('0x51')]=qs[_0x5d91('0x37')](_0x253200[_0x5d91('0x30')][_0x5d91('0x37')]);_0x32eb6d[_0x5d91('0x38')]=qs[_0x5d91('0x39')](_['pick'](_0x253200['query'],_0x294ce5[_0x5d91('0x39')]));if(_0x253200['query']['filter']){_0x32eb6d[_0x5d91('0x38')]=_['merge'](_0x32eb6d['where'],{'$or':_[_0x5d91('0x29')](_0x32eb6d[_0x5d91('0x33')],function(_0x2f2b24){var _0x406d7e={};_0x406d7e[_0x2f2b24]={'$like':'%'+_0x253200['query'][_0x5d91('0x3c')]+'%'};return _0x406d7e;})});}_0x32eb6d=_[_0x5d91('0x3b')]({},_0x32eb6d,_0x253200[_0x5d91('0x3d')]);return _0x294ddc['getActions'](_0x32eb6d);}})[_0x5d91('0x24')](function(_0x539478){if(_0x539478){_0x78384a=_0x539478[_0x5d91('0x4d')];if(!_0x253200['query'][_0x5d91('0x35')](_0x5d91('0x36'))){_0x32eb6d['limit']=qs[_0x5d91('0x1f')](_0x253200[_0x5d91('0x30')]['limit']);_0x32eb6d['offset']=qs[_0x5d91('0x1e')](_0x253200[_0x5d91('0x30')]['offset']);}return _0x294ddc[_0x5d91('0x52')](_0x32eb6d);}})[_0x5d91('0x24')](function(_0x10147f){if(_0x10147f){return _0x10147f?{'count':_0x78384a,'rows':_0x10147f}:null;}})[_0x5d91('0x24')](respondWithResult(_0x32c996,null))['catch'](handleError(_0x32c996,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 13b68ac..eb1cb19 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 _0x6dea=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','tools_automations','lodash'];(function(_0x4cef57,_0x4da0e4){var _0x3bf7dd=function(_0xe01cb4){while(--_0xe01cb4){_0x4cef57['push'](_0x4cef57['shift']());}};_0x3bf7dd(++_0x4da0e4);}(_0x6dea,0xfb));var _0xa6de=function(_0x27f477,_0x5131b0){_0x27f477=_0x27f477-0x0;var _0x300a6f=_0x6dea[_0x27f477];return _0x300a6f;};'use strict';var _=require(_0xa6de('0x0'));var util=require(_0xa6de('0x1'));var logger=require(_0xa6de('0x2'))(_0xa6de('0x3'));var moment=require(_0xa6de('0x4'));var BPromise=require('bluebird');var rp=require(_0xa6de('0x5'));var fs=require('fs');var path=require(_0xa6de('0x6'));var rimraf=require(_0xa6de('0x7'));var config=require(_0xa6de('0x8'));var attributes=require(_0xa6de('0x9'));module['exports']=function(_0x207318,_0x140d16){return _0x207318[_0xa6de('0xa')]('Automation',attributes,{'tableName':_0xa6de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8afd=['../../config/logger','api','moment','bluebird','path','../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash'];(function(_0x341422,_0x34e3a3){var _0x237b92=function(_0x20cba3){while(--_0x20cba3){_0x341422['push'](_0x341422['shift']());}};_0x237b92(++_0x34e3a3);}(_0x8afd,0x154));var _0xd8af=function(_0x3907d7,_0xdbc834){_0x3907d7=_0x3907d7-0x0;var _0x5b9610=_0x8afd[_0x3907d7];return _0x5b9610;};'use strict';var _=require(_0xd8af('0x0'));var util=require('util');var logger=require(_0xd8af('0x1'))(_0xd8af('0x2'));var moment=require(_0xd8af('0x3'));var BPromise=require(_0xd8af('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8af('0x5'));var rimraf=require('rimraf');var config=require(_0xd8af('0x6'));var attributes=require(_0xd8af('0x7'));module[_0xd8af('0x8')]=function(_0x1ccc17,_0x37faf0){return _0x1ccc17['define'](_0xd8af('0x9'),attributes,{'tableName':_0xd8af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 2808e28..19bcc13 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 _0x7b08=['code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error'];(function(_0x14a0a0,_0x45d0cf){var _0x56b651=function(_0x1fae09){while(--_0x1fae09){_0x14a0a0['push'](_0x14a0a0['shift']());}};_0x56b651(++_0x45d0cf);}(_0x7b08,0x163));var _0x87b0=function(_0x13c8df,_0x102892){_0x13c8df=_0x13c8df-0x0;var _0xc33f48=_0x7b08[_0x13c8df];return _0xc33f48;};'use strict';var _=require(_0x87b0('0x0'));var util=require('util');var moment=require(_0x87b0('0x1'));var BPromise=require(_0x87b0('0x2'));var rs=require(_0x87b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x87b0('0x4'))['db'];var utils=require(_0x87b0('0x5'));var logger=require(_0x87b0('0x6'))(_0x87b0('0x7'));var config=require('../../config/environment');var jayson=require(_0x87b0('0x8'));var client=jayson[_0x87b0('0x9')][_0x87b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x419841,_0x130650,_0x41dcc8){return new BPromise(function(_0x1a7f35,_0x4015e2){return client[_0x87b0('0xb')](_0x419841,_0x41dcc8)[_0x87b0('0xc')](function(_0x52f596){logger[_0x87b0('0xd')](_0x87b0('0xe'),_0x130650,_0x87b0('0xf'));logger[_0x87b0('0x10')](_0x87b0('0x11'),_0x130650,_0x87b0('0xf'),JSON['stringify'](_0x52f596));if(_0x52f596['error']){if(_0x52f596[_0x87b0('0x12')][_0x87b0('0x13')]===0x1f4){logger[_0x87b0('0x12')](_0x87b0('0xe'),_0x130650,_0x52f596[_0x87b0('0x12')][_0x87b0('0x14')]);return _0x4015e2(_0x52f596['error'][_0x87b0('0x14')]);}logger[_0x87b0('0x12')]('Automation,\x20%s,\x20%s',_0x130650,_0x52f596['error'][_0x87b0('0x14')]);return _0x1a7f35(_0x52f596['error']['message']);}else{logger['info'](_0x87b0('0xe'),_0x130650,_0x87b0('0xf'));_0x1a7f35(_0x52f596['result'][_0x87b0('0x14')]);}})[_0x87b0('0x15')](function(_0x2b37d6){logger[_0x87b0('0x12')](_0x87b0('0xe'),_0x130650,_0x2b37d6);_0x4015e2(_0x2b37d6);});});}
\ No newline at end of file
+var _0x4849=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x1a39cc,_0x356cac){var _0x1ccebb=function(_0x207168){while(--_0x207168){_0x1a39cc['push'](_0x1a39cc['shift']());}};_0x1ccebb(++_0x356cac);}(_0x4849,0xf8));var _0x9484=function(_0x248a91,_0x173716){_0x248a91=_0x248a91-0x0;var _0x46cd36=_0x4849[_0x248a91];return _0x46cd36;};'use strict';var _=require(_0x9484('0x0'));var util=require(_0x9484('0x1'));var moment=require(_0x9484('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9484('0x3'));var db=require(_0x9484('0x4'))['db'];var utils=require(_0x9484('0x5'));var logger=require(_0x9484('0x6'))(_0x9484('0x7'));var config=require(_0x9484('0x8'));var jayson=require(_0x9484('0x9'));var client=jayson[_0x9484('0xa')][_0x9484('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x536b43,_0x4a8a70,_0x11f2a1){return new BPromise(function(_0x583079,_0x3929b9){return client[_0x9484('0xc')](_0x536b43,_0x11f2a1)[_0x9484('0xd')](function(_0xe8b216){logger[_0x9484('0xe')](_0x9484('0xf'),_0x4a8a70,_0x9484('0x10'));logger[_0x9484('0x11')](_0x9484('0x12'),_0x4a8a70,_0x9484('0x10'),JSON[_0x9484('0x13')](_0xe8b216));if(_0xe8b216[_0x9484('0x14')]){if(_0xe8b216[_0x9484('0x14')][_0x9484('0x15')]===0x1f4){logger[_0x9484('0x14')]('Automation,\x20%s,\x20%s',_0x4a8a70,_0xe8b216[_0x9484('0x14')]['message']);return _0x3929b9(_0xe8b216[_0x9484('0x14')][_0x9484('0x16')]);}logger[_0x9484('0x14')](_0x9484('0xf'),_0x4a8a70,_0xe8b216[_0x9484('0x14')][_0x9484('0x16')]);return _0x583079(_0xe8b216['error'][_0x9484('0x16')]);}else{logger[_0x9484('0xe')]('Automation,\x20%s,\x20%s',_0x4a8a70,'request\x20sent');_0x583079(_0xe8b216[_0x9484('0x17')]['message']);}})[_0x9484('0x18')](function(_0x4e974f){logger[_0x9484('0x14')](_0x9484('0xf'),_0x4a8a70,_0x4e974f);_0x3929b9(_0x4e974f);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index d830a1a..a4671cc 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 _0x826a=['getActions','post','addConditions','put','update','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions'];(function(_0x6a1321,_0x579f93){var _0x5d84ed=function(_0x477e8d){while(--_0x477e8d){_0x6a1321['push'](_0x6a1321['shift']());}};_0x5d84ed(++_0x579f93);}(_0x826a,0x1aa));var _0xa826=function(_0x21b990,_0x13409d){_0x21b990=_0x21b990-0x0;var _0x42550f=_0x826a[_0x21b990];return _0x42550f;};'use strict';var multer=require('multer');var util=require(_0xa826('0x0'));var path=require('path');var timeout=require(_0xa826('0x1'));var express=require('express');var router=express[_0xa826('0x2')]();var fs_extra=require(_0xa826('0x3'));var auth=require(_0xa826('0x4'));var interaction=require(_0xa826('0x5'));var config=require('../../config/environment');var controller=require(_0xa826('0x6'));router[_0xa826('0x7')]('/',auth[_0xa826('0x8')](),controller[_0xa826('0x9')]);router[_0xa826('0x7')](_0xa826('0xa'),auth[_0xa826('0x8')](),controller[_0xa826('0xb')]);router[_0xa826('0x7')](_0xa826('0xc'),auth[_0xa826('0x8')](),controller[_0xa826('0xd')]);router[_0xa826('0x7')](_0xa826('0xe'),auth[_0xa826('0x8')](),controller[_0xa826('0xf')]);router['post']('/',auth[_0xa826('0x8')](),controller['create']);router[_0xa826('0x10')](_0xa826('0xc'),auth[_0xa826('0x8')](),controller[_0xa826('0x11')]);router[_0xa826('0x10')](_0xa826('0xe'),auth[_0xa826('0x8')](),controller['addActions']);router[_0xa826('0x12')]('/:id',auth[_0xa826('0x8')](),controller[_0xa826('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa826('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x6611=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x6611,0xdd));var _0x1661=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6611[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x1661('0x0'));var path=require(_0x1661('0x1'));var timeout=require(_0x1661('0x2'));var express=require(_0x1661('0x3'));var router=express[_0x1661('0x4')]();var fs_extra=require(_0x1661('0x5'));var auth=require(_0x1661('0x6'));var interaction=require(_0x1661('0x7'));var config=require(_0x1661('0x8'));var controller=require(_0x1661('0x9'));router[_0x1661('0xa')]('/',auth[_0x1661('0xb')](),controller['index']);router['get'](_0x1661('0xc'),auth[_0x1661('0xb')](),controller['show']);router['get'](_0x1661('0xd'),auth[_0x1661('0xb')](),controller[_0x1661('0xe')]);router[_0x1661('0xa')](_0x1661('0xf'),auth[_0x1661('0xb')](),controller[_0x1661('0x10')]);router[_0x1661('0x11')]('/',auth['isAuthenticated'](),controller[_0x1661('0x12')]);router[_0x1661('0x11')]('/:id/conditions',auth[_0x1661('0xb')](),controller['addConditions']);router[_0x1661('0x11')](_0x1661('0xf'),auth[_0x1661('0xb')](),controller[_0x1661('0x13')]);router[_0x1661('0x14')](_0x1661('0xc'),auth[_0x1661('0xb')](),controller[_0x1661('0x15')]);router[_0x1661('0x16')](_0x1661('0xc'),auth[_0x1661('0xb')](),controller[_0x1661('0x17')]);module[_0x1661('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 3fbe1b3..34067a4 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 _0x94b8=['Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','STRING','ENUM','ivr','BOOLEAN','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x94b8,0x111));var _0x894b=function(_0x2a4ea4,_0x5c6b7d){_0x2a4ea4=_0x2a4ea4-0x0;var _0x1d84b3=_0x94b8[_0x2a4ea4];return _0x1d84b3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x894b('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x894b('0x1')](_0x894b('0x2')),'allowNull':![],'defaultValue':_0x894b('0x2')},'description':{'type':Sequelize[_0x894b('0x0')]},'active':{'type':Sequelize[_0x894b('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x894b('0x4')](0x4)[_0x894b('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x894b('0x4')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x894b('0x6')},'dialCongestionMaxRetry':{'type':Sequelize[_0x894b('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x894b('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x894b('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0x894b('0x4')](0x3)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x894b('0x4')](0x3)[_0x894b('0x5')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x894b('0x9')},'dialTimezone':{'type':Sequelize[_0x894b('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x894b('0x0')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x894b('0xa'),_0x894b('0xb'),_0x894b('0xc')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x894b('0x3')],'defaultValue':0x0,'comment':_0x894b('0xd')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x894b('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x894b('0xe')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x894b('0x4')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x894b('0xf')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x894b('0x4')](0x9)[_0x894b('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x894b('0x10')},'dialAMDMinWordLength':{'type':Sequelize[_0x894b('0x4')](0x9)[_0x894b('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x894b('0x4')](0x9)[_0x894b('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x894b('0x11')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x894b('0x12')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x894b('0x4')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x894b('0x13')},'dialOrderByScheduledAt':{'type':Sequelize[_0x894b('0x1')](_0x894b('0x14'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x894b('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x894b('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x894b('0x15')},'dialCutDigit':{'type':Sequelize[_0x894b('0x4')](0x3)[_0x894b('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x894b('0x16')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x894b('0x4')](0x3)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x894b('0x17')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x894b('0x18')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x894b('0x19')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x894b('0x1a')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x894b('0x1b')},'dialMachineMaxRetry':{'type':Sequelize[_0x894b('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x894b('0x1c')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x894b('0x1d')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0xc6df=['Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','INTEGER','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)'];(function(_0x4e1d69,_0x543378){var _0x719b41=function(_0x3db182){while(--_0x3db182){_0x4e1d69['push'](_0x4e1d69['shift']());}};_0x719b41(++_0x543378);}(_0xc6df,0x16a));var _0xfc6d=function(_0x31eaf4,_0x3b2380){_0x31eaf4=_0x31eaf4-0x0;var _0x4df397=_0xc6df[_0x31eaf4];return _0x4df397;};'use strict';var Sequelize=require(_0xfc6d('0x0'));module[_0xfc6d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xfc6d('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0xfc6d('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xfc6d('0x4')],'defaultValue':0x0,'comment':_0xfc6d('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xfc6d('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xfc6d('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfc6d('0x8')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xfc6d('0x8')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc6d('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfc6d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc6d('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfc6d('0xb')](0x5)[_0xfc6d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc6d('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xfc6d('0xb')](0x3)[_0xfc6d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc6d('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xfc6d('0xb')](0x5)[_0xfc6d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc6d('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfc6d('0xb')](0x3)[_0xfc6d('0x6')],'defaultValue':0x3,'comment':_0xfc6d('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc6d('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfc6d('0xb')](0x3)[_0xfc6d('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xfc6d('0x11')},'dialTimezone':{'type':Sequelize[_0xfc6d('0x8')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xfc6d('0x8')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xfc6d('0x12')](_0xfc6d('0x13'),_0xfc6d('0x14'),_0xfc6d('0x15')),'defaultValue':_0xfc6d('0x13')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xfc6d('0xb')](0x9)[_0xfc6d('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xfc6d('0x16')},'dialAMDGreeting':{'type':Sequelize[_0xfc6d('0xb')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfc6d('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xfc6d('0xb')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfc6d('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xfc6d('0xb')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xfc6d('0xb')](0x9)[_0xfc6d('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xfc6d('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfc6d('0xb')](0x9)[_0xfc6d('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xfc6d('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfc6d('0xb')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfc6d('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xfc6d('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfc6d('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xfc6d('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfc6d('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0xfc6d('0x12')](_0xfc6d('0x1e'),_0xfc6d('0x1f')),'defaultValue':_0xfc6d('0x1e')},'dialPrefix':{'type':Sequelize[_0xfc6d('0x8')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xfc6d('0xb')](0x3)[_0xfc6d('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xfc6d('0xb')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfc6d('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xfc6d('0xb')](0x3)[_0xfc6d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xfc6d('0xb')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc6d('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0xfc6d('0xb')](0x3)[_0xfc6d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc6d('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0xfc6d('0xb')](0x5)[_0xfc6d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc6d('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xfc6d('0xb')](0x3)[_0xfc6d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xfc6d('0xb')](0x5)[_0xfc6d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc6d('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfc6d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc6d('0x25')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfc6d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc6d('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfc6d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc6d('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfc6d('0xb')](0x5)[_0xfc6d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 75925fc..f0da8af 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 _0x6f33=['count','offset','Content-Range','apply','reject','update','destroy','get','IvrCampaigns','then','sendStatus','stack','send','index','map','Campaign','rawAttributes','fieldName','key','model','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','where','filters','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','userProfileId','autoAssociation','getHoppers','findOne','CmHopper','nolimit','sort','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','NOW()','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','moment','bluebird','path','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit'];(function(_0x1ac77b,_0x1cbdac){var _0x5c0165=function(_0x22cb2a){while(--_0x22cb2a){_0x1ac77b['push'](_0x1ac77b['shift']());}};_0x5c0165(++_0x1cbdac);}(_0x6f33,0x7a));var _0x36f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f33[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x36f3('0x0'));var rimraf=require(_0x36f3('0x1'));var zipdir=require(_0x36f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x36f3('0x3'));var BPromise=require(_0x36f3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x36f3('0x5'));var sox=require('sox');var csv=require(_0x36f3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36f3('0x7'));var squel=require('squel');var crypto=require(_0x36f3('0x8'));var jsforce=require(_0x36f3('0x9'));var deskjs=require(_0x36f3('0xa'));var toCsv=require(_0x36f3('0x6'));var querystring=require('querystring');var Papa=require(_0x36f3('0xb'));var Redis=require(_0x36f3('0xc'));var authService=require(_0x36f3('0xd'));var qs=require(_0x36f3('0xe'));var as=require(_0x36f3('0xf'));var hardwareService=require(_0x36f3('0x10'));var logger=require(_0x36f3('0x11'))(_0x36f3('0x12'));var utils=require(_0x36f3('0x13'));var config=require(_0x36f3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x36f3('0x15'))['db'];function respondWithStatusCode(_0x47740d,_0x4dda9e){_0x4dda9e=_0x4dda9e||0xcc;return function(_0x424a2f){if(_0x424a2f){return _0x47740d['sendStatus'](_0x4dda9e);}return _0x47740d[_0x36f3('0x16')](_0x4dda9e)[_0x36f3('0x17')]();};}function respondWithResult(_0x112a9d,_0x12eb9b){_0x12eb9b=_0x12eb9b||0xc8;return function(_0x9da06a){if(_0x9da06a){return _0x112a9d['status'](_0x12eb9b)[_0x36f3('0x18')](_0x9da06a);}};}function respondWithFilteredResult(_0x25d29a,_0x2b108e){return function(_0x126414){if(_0x126414){var _0x116c49=typeof _0x2b108e['offset']===_0x36f3('0x19')&&typeof _0x2b108e[_0x36f3('0x1a')]===_0x36f3('0x19');var _0x376216=_0x126414[_0x36f3('0x1b')];var _0x2cc9ea=_0x116c49?0x0:_0x2b108e['offset'];var _0x232fd3=_0x116c49?_0x126414[_0x36f3('0x1b')]:_0x2b108e[_0x36f3('0x1c')]+_0x2b108e[_0x36f3('0x1a')];var _0x3cf8a2;if(_0x232fd3>=_0x376216){_0x232fd3=_0x376216;_0x3cf8a2=0xc8;}else{_0x3cf8a2=0xce;}_0x25d29a['status'](_0x3cf8a2);return _0x25d29a['set'](_0x36f3('0x1d'),_0x2cc9ea+'-'+_0x232fd3+'/'+_0x376216)[_0x36f3('0x18')](_0x126414);}return null;};}function patchUpdates(_0x402dc8){return function(_0x1930f4){try{jsonpatch[_0x36f3('0x1e')](_0x1930f4,_0x402dc8,!![]);}catch(_0xbf3556){return BPromise[_0x36f3('0x1f')](_0xbf3556);}return _0x1930f4['save']();};}function saveUpdates(_0x54f131,_0x57d1c2){return function(_0x496d70){if(_0x496d70){return _0x496d70[_0x36f3('0x20')](_0x54f131)['then'](function(_0x2cb42c){return _0x2cb42c;});}return null;};}function removeEntity(_0x292143,_0x481d99){return function(_0x4c45eb){if(_0x4c45eb){return _0x4c45eb[_0x36f3('0x21')]()['then'](function(){var _0x256f53=_0x4c45eb[_0x36f3('0x22')]({'plain':!![]});var _0x165633=_0x36f3('0x23');return db['UserProfileResource'][_0x36f3('0x21')]({'where':{'type':_0x165633,'resourceId':_0x256f53['id']}})['then'](function(){return _0x4c45eb;});})[_0x36f3('0x24')](function(){_0x292143[_0x36f3('0x16')](0xcc)[_0x36f3('0x17')]();});}};}function handleEntityNotFound(_0x4ba389,_0x58036d){return function(_0x405e24){if(!_0x405e24){_0x4ba389[_0x36f3('0x25')](0x194);}return _0x405e24;};}function handleError(_0x1dd545,_0x145edf){_0x145edf=_0x145edf||0x1f4;return function(_0x188080){logger['error'](_0x188080[_0x36f3('0x26')]);if(_0x188080['name']){delete _0x188080['name'];}_0x1dd545[_0x36f3('0x16')](_0x145edf)[_0x36f3('0x27')](_0x188080);};}exports[_0x36f3('0x28')]=function(_0x276b7c,_0x1809b6){var _0x596497={},_0x89d37a={},_0x26b25e={'count':0x0,'rows':[]};var _0x43e167=_[_0x36f3('0x29')](db[_0x36f3('0x2a')][_0x36f3('0x2b')],function(_0x59e157){return{'name':_0x59e157[_0x36f3('0x2c')],'type':_0x59e157['type'][_0x36f3('0x2d')]};});_0x89d37a[_0x36f3('0x2e')]=_[_0x36f3('0x29')](_0x43e167,_0x36f3('0x2f'));_0x89d37a['query']=_[_0x36f3('0x30')](_0x276b7c[_0x36f3('0x31')]);_0x89d37a['filters']=_[_0x36f3('0x32')](_0x89d37a[_0x36f3('0x2e')],_0x89d37a[_0x36f3('0x31')]);_0x596497[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0x89d37a[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x276b7c[_0x36f3('0x31')][_0x36f3('0x34')]));_0x596497[_0x36f3('0x33')]=_0x596497[_0x36f3('0x33')][_0x36f3('0x35')]?_0x596497[_0x36f3('0x33')]:_0x89d37a[_0x36f3('0x2e')];if(!_0x276b7c[_0x36f3('0x31')][_0x36f3('0x36')]('nolimit')){_0x596497[_0x36f3('0x1a')]=qs['limit'](_0x276b7c[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x596497[_0x36f3('0x1c')]=qs[_0x36f3('0x1c')](_0x276b7c[_0x36f3('0x31')][_0x36f3('0x1c')]);}_0x596497[_0x36f3('0x37')]=qs['sort'](_0x276b7c['query']['sort']);_0x596497[_0x36f3('0x38')]=qs[_0x36f3('0x39')](_['pick'](_0x276b7c[_0x36f3('0x31')],_0x89d37a[_0x36f3('0x39')]),_0x43e167);if(_0x276b7c[_0x36f3('0x31')]['filter']){_0x596497[_0x36f3('0x38')]=_['merge'](_0x596497[_0x36f3('0x38')],{'$or':_['map'](_0x43e167,function(_0x234f73){if(_0x234f73[_0x36f3('0x3a')]!==_0x36f3('0x3b')){var _0x51732b={};_0x51732b[_0x234f73[_0x36f3('0x2f')]]={'$like':'%'+_0x276b7c[_0x36f3('0x31')][_0x36f3('0x3c')]+'%'};return _0x51732b;}})});}_0x596497=_[_0x36f3('0x3d')]({},_0x596497,_0x276b7c[_0x36f3('0x3e')]);var _0x565c52={'where':_0x596497['where']};return db['Campaign'][_0x36f3('0x1b')](_0x565c52)[_0x36f3('0x24')](function(_0x1aabc0){_0x26b25e[_0x36f3('0x1b')]=_0x1aabc0;if(_0x276b7c['query'][_0x36f3('0x3f')]){_0x596497[_0x36f3('0x40')]=[{'all':!![]}];}return db[_0x36f3('0x2a')][_0x36f3('0x41')](_0x596497);})[_0x36f3('0x24')](function(_0xd63988){_0x26b25e[_0x36f3('0x42')]=_0xd63988;return _0x26b25e;})['then'](respondWithFilteredResult(_0x1809b6,_0x596497))['catch'](handleError(_0x1809b6,null));};exports['show']=function(_0x3f8011,_0x5721af){var _0x4255ff={'raw':![],'where':{'id':_0x3f8011[_0x36f3('0x43')]['id']}},_0x277b40={};_0x277b40['model']=_[_0x36f3('0x30')](db[_0x36f3('0x2a')][_0x36f3('0x2b')]);_0x277b40[_0x36f3('0x31')]=_[_0x36f3('0x30')](_0x3f8011[_0x36f3('0x31')]);_0x277b40[_0x36f3('0x39')]=_[_0x36f3('0x32')](_0x277b40[_0x36f3('0x2e')],_0x277b40[_0x36f3('0x31')]);_0x4255ff[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0x277b40[_0x36f3('0x2e')],qs['fields'](_0x3f8011[_0x36f3('0x31')][_0x36f3('0x34')]));_0x4255ff[_0x36f3('0x33')]=_0x4255ff[_0x36f3('0x33')][_0x36f3('0x35')]?_0x4255ff[_0x36f3('0x33')]:_0x277b40[_0x36f3('0x2e')];if(_0x3f8011[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x4255ff['include']=[{'all':!![]}];}_0x4255ff=_[_0x36f3('0x3d')]({},_0x4255ff,_0x3f8011[_0x36f3('0x3e')]);return db[_0x36f3('0x2a')][_0x36f3('0x44')](_0x4255ff)[_0x36f3('0x24')](handleEntityNotFound(_0x5721af,null))[_0x36f3('0x24')](respondWithResult(_0x5721af,null))[_0x36f3('0x45')](handleError(_0x5721af,null));};exports[_0x36f3('0x46')]=function(_0x2be4e0,_0x477cf6){return db[_0x36f3('0x2a')][_0x36f3('0x46')](_0x2be4e0[_0x36f3('0x47')],{})[_0x36f3('0x24')](function(_0x24e2c8){var _0x39dad3=_0x2be4e0[_0x36f3('0x48')][_0x36f3('0x22')]({'plain':!![]});if(!_0x39dad3)throw new Error(_0x36f3('0x49'));if(_0x39dad3['role']===_0x36f3('0x48')){var _0x6f3400=_0x24e2c8[_0x36f3('0x22')]({'plain':!![]});var _0x36960c=_0x36f3('0x23');return db['UserProfileSection'][_0x36f3('0x44')]({'where':{'name':_0x36960c,'userProfileId':_0x39dad3['userProfileId']},'raw':!![]})[_0x36f3('0x24')](function(_0x29d7ac){if(_0x29d7ac&&_0x29d7ac['autoAssociation']===0x0){return db[_0x36f3('0x4a')][_0x36f3('0x46')]({'name':_0x6f3400[_0x36f3('0x2f')],'resourceId':_0x6f3400['id'],'type':_0x29d7ac[_0x36f3('0x2f')],'sectionId':_0x29d7ac['id']},{})['then'](function(){return _0x24e2c8;});}else{return _0x24e2c8;}})[_0x36f3('0x45')](function(_0x167170){logger[_0x36f3('0x4b')](_0x36f3('0x4c'),_0x167170);throw _0x167170;});}return _0x24e2c8;})[_0x36f3('0x24')](respondWithResult(_0x477cf6,0xc9))[_0x36f3('0x45')](handleError(_0x477cf6,null));};exports[_0x36f3('0x4d')]=function(_0x425bc3,_0x2c9fc4){var _0x58c0ec={'where':{'id':_0x425bc3[_0x36f3('0x43')]['id']}},_0x385acd={};_0x385acd[_0x36f3('0x2e')]=_[_0x36f3('0x30')](db[_0x36f3('0x2a')][_0x36f3('0x2b')]);_0x58c0ec[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0x385acd[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x425bc3['query'][_0x36f3('0x34')]));_0x58c0ec['attributes']=_0x58c0ec[_0x36f3('0x33')][_0x36f3('0x35')]?_0x58c0ec[_0x36f3('0x33')]:_0x385acd['model'];if(_0x425bc3[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x58c0ec[_0x36f3('0x40')]=[{'all':!![]}];}_0x58c0ec=_[_0x36f3('0x3d')]({},_0x58c0ec,_0x425bc3[_0x36f3('0x3e')]);return db['Campaign'][_0x36f3('0x44')](_0x58c0ec)['then'](handleEntityNotFound(_0x2c9fc4,null))[_0x36f3('0x24')](function(_0x3b14d6){if(_0x3b14d6){var _0x543f50=_0x3b14d6[_0x36f3('0x22')]({'plain':!![]});_0x543f50=qs[_0x36f3('0x4e')](_0x543f50,['id',_0x36f3('0x4f'),_0x36f3('0x50')]);_0x425bc3[_0x36f3('0x47')]=_[_0x36f3('0x4e')](_0x425bc3['body'],['id',_0x36f3('0x4f'),_0x36f3('0x50')]);return db[_0x36f3('0x2a')][_0x36f3('0x46')](_[_0x36f3('0x3d')](_0x543f50,_0x425bc3['body']),{'include':_0x425bc3[_0x36f3('0x31')][_0x36f3('0x3f')]?[{'all':!![]}]:undefined})['then'](function(_0xa51b26){var _0x49b0fe=_0x425bc3['user'][_0x36f3('0x22')]({'plain':!![]});if(!_0x49b0fe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49b0fe[_0x36f3('0x51')]==='user'){var _0x5b2e50=_0xa51b26[_0x36f3('0x22')]({'plain':!![]});var _0x35303e=_0x36f3('0x23');return db['UserProfileSection'][_0x36f3('0x44')]({'where':{'name':_0x35303e,'userProfileId':_0x49b0fe[_0x36f3('0x52')]},'raw':!![]})[_0x36f3('0x24')](function(_0x42e06e){if(_0x42e06e&&_0x42e06e[_0x36f3('0x53')]===0x0){return db[_0x36f3('0x4a')]['create']({'name':_0x5b2e50[_0x36f3('0x2f')],'resourceId':_0x5b2e50['id'],'type':_0x42e06e[_0x36f3('0x2f')],'sectionId':_0x42e06e['id']},{})[_0x36f3('0x24')](function(){return _0xa51b26;});}else{return _0xa51b26;}})[_0x36f3('0x45')](function(_0x19bc69){logger['error'](_0x36f3('0x4c'),_0x19bc69);throw _0x19bc69;});}return _0xa51b26;});}})[_0x36f3('0x24')](respondWithResult(_0x2c9fc4,0xc9))[_0x36f3('0x45')](handleError(_0x2c9fc4,null));};exports[_0x36f3('0x20')]=function(_0x941d43,_0x5d0b0e){if(_0x941d43[_0x36f3('0x47')]['id']){delete _0x941d43['body']['id'];}return db['Campaign'][_0x36f3('0x44')]({'where':{'id':_0x941d43[_0x36f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d0b0e,null))[_0x36f3('0x24')](saveUpdates(_0x941d43[_0x36f3('0x47')],null))[_0x36f3('0x24')](respondWithResult(_0x5d0b0e,null))['catch'](handleError(_0x5d0b0e,null));};exports[_0x36f3('0x21')]=function(_0x2ec6c2,_0x241835){return db['Campaign']['find']({'where':{'id':_0x2ec6c2[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x241835,null))[_0x36f3('0x24')](removeEntity(_0x241835,null))[_0x36f3('0x45')](handleError(_0x241835,null));};exports[_0x36f3('0x54')]=function(_0x33cc89,_0x34be3b,_0x4be9a5){var _0x174ae6={'raw':!![],'where':{}};var _0x4560e3={};var _0x5bc385={'count':0x0,'rows':[]};return db[_0x36f3('0x2a')][_0x36f3('0x55')]({'where':{'id':_0x33cc89[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x34be3b,null))[_0x36f3('0x24')](function(_0x317add){if(_0x317add){_0x4560e3[_0x36f3('0x2e')]=_['keys'](db[_0x36f3('0x56')][_0x36f3('0x2b')]);_0x4560e3['query']=_[_0x36f3('0x30')](_0x33cc89[_0x36f3('0x31')]);_0x4560e3[_0x36f3('0x39')]=_[_0x36f3('0x32')](_0x4560e3[_0x36f3('0x2e')],_0x4560e3[_0x36f3('0x31')]);_0x174ae6[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0x4560e3['model'],qs['fields'](_0x33cc89['query']['fields']));_0x174ae6[_0x36f3('0x33')]=_0x174ae6[_0x36f3('0x33')][_0x36f3('0x35')]?_0x174ae6[_0x36f3('0x33')]:_0x4560e3[_0x36f3('0x2e')];if(!_0x33cc89[_0x36f3('0x31')][_0x36f3('0x36')](_0x36f3('0x57'))){_0x174ae6[_0x36f3('0x1a')]=qs['limit'](_0x33cc89[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x174ae6['offset']=qs[_0x36f3('0x1c')](_0x33cc89[_0x36f3('0x31')][_0x36f3('0x1c')]);}_0x174ae6[_0x36f3('0x37')]=qs['sort'](_0x33cc89[_0x36f3('0x31')][_0x36f3('0x58')]);_0x174ae6['where']=qs['filters'](_[_0x36f3('0x59')](_0x33cc89[_0x36f3('0x31')],_0x4560e3[_0x36f3('0x39')]));_0x174ae6[_0x36f3('0x38')][_0x36f3('0x5a')]=_0x317add['id'];if(_0x33cc89[_0x36f3('0x31')][_0x36f3('0x3c')]){_0x174ae6[_0x36f3('0x38')]=_[_0x36f3('0x3d')](_0x174ae6[_0x36f3('0x38')],{'$or':_[_0x36f3('0x29')](_0x174ae6['attributes'],function(_0x4a6ea8){var _0x36d33c={};_0x36d33c[_0x4a6ea8]={'$like':'%'+_0x33cc89[_0x36f3('0x31')][_0x36f3('0x3c')]+'%'};return _0x36d33c;})});}_0x174ae6=_[_0x36f3('0x3d')]({},_0x174ae6,_0x33cc89[_0x36f3('0x3e')]);return db[_0x36f3('0x56')][_0x36f3('0x1b')]({'where':_0x174ae6[_0x36f3('0x38')]})[_0x36f3('0x24')](function(_0x4d0f72){_0x5bc385['count']=_0x4d0f72;if(_0x33cc89[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x174ae6['include']=[{'all':!![]}];}return db[_0x36f3('0x56')][_0x36f3('0x41')](_0x174ae6);})['then'](function(_0x3dfbdc){_0x5bc385[_0x36f3('0x42')]=_0x3dfbdc;return _0x5bc385;});}})[_0x36f3('0x24')](respondWithFilteredResult(_0x34be3b,_0x174ae6))[_0x36f3('0x45')](handleError(_0x34be3b,null));};exports[_0x36f3('0x5b')]=function(_0x39fabe,_0x1b8f5e,_0x8ef369){var _0x1474f5={'raw':!![],'where':{}};var _0x503b6d={};var _0x17fe21={'count':0x0,'rows':[]};return db['Campaign'][_0x36f3('0x55')]({'where':{'id':_0x39fabe['params']['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x1b8f5e,null))[_0x36f3('0x24')](function(_0x4694be){if(_0x4694be){_0x503b6d[_0x36f3('0x2e')]=_['keys'](db[_0x36f3('0x5c')][_0x36f3('0x2b')]);_0x503b6d[_0x36f3('0x31')]=_[_0x36f3('0x30')](_0x39fabe[_0x36f3('0x31')]);_0x503b6d[_0x36f3('0x39')]=_['intersection'](_0x503b6d[_0x36f3('0x2e')],_0x503b6d[_0x36f3('0x31')]);_0x1474f5['attributes']=_[_0x36f3('0x32')](_0x503b6d[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x39fabe[_0x36f3('0x31')]['fields']));_0x1474f5['attributes']=_0x1474f5[_0x36f3('0x33')]['length']?_0x1474f5[_0x36f3('0x33')]:_0x503b6d[_0x36f3('0x2e')];if(!_0x39fabe['query'][_0x36f3('0x36')](_0x36f3('0x57'))){_0x1474f5[_0x36f3('0x1a')]=qs[_0x36f3('0x1a')](_0x39fabe[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x1474f5[_0x36f3('0x1c')]=qs[_0x36f3('0x1c')](_0x39fabe[_0x36f3('0x31')][_0x36f3('0x1c')]);}_0x1474f5[_0x36f3('0x37')]=qs[_0x36f3('0x58')](_0x39fabe[_0x36f3('0x31')][_0x36f3('0x58')]);_0x1474f5[_0x36f3('0x38')]=qs['filters'](_[_0x36f3('0x59')](_0x39fabe[_0x36f3('0x31')],_0x503b6d[_0x36f3('0x39')]));_0x1474f5[_0x36f3('0x38')][_0x36f3('0x5a')]=_0x4694be['id'];if(_0x39fabe[_0x36f3('0x31')]['filter']){_0x1474f5['where']=_['merge'](_0x1474f5[_0x36f3('0x38')],{'$or':_[_0x36f3('0x29')](_0x1474f5[_0x36f3('0x33')],function(_0x36fd5b){var _0x5d23d3={};_0x5d23d3[_0x36fd5b]={'$like':'%'+_0x39fabe['query'][_0x36f3('0x3c')]+'%'};return _0x5d23d3;})});}_0x1474f5=_[_0x36f3('0x3d')]({},_0x1474f5,_0x39fabe[_0x36f3('0x3e')]);return db[_0x36f3('0x5c')][_0x36f3('0x1b')]({'where':_0x1474f5['where']})['then'](function(_0x4f45c9){_0x17fe21[_0x36f3('0x1b')]=_0x4f45c9;if(_0x39fabe[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x1474f5[_0x36f3('0x40')]=[{'all':!![]}];}return db[_0x36f3('0x5c')][_0x36f3('0x41')](_0x1474f5);})[_0x36f3('0x24')](function(_0x46e556){_0x17fe21[_0x36f3('0x42')]=_0x46e556;return _0x17fe21;});}})[_0x36f3('0x24')](respondWithFilteredResult(_0x1b8f5e,_0x1474f5))[_0x36f3('0x45')](handleError(_0x1b8f5e,null));};exports[_0x36f3('0x5d')]=function(_0x55d724,_0x5c255e,_0x5a44bd){var _0x39a41e={'raw':!![],'where':{}};var _0x2fcdae={};var _0x24ff28={'count':0x0,'rows':[]};return db[_0x36f3('0x2a')]['findOne']({'where':{'id':_0x55d724[_0x36f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c255e,null))['then'](function(_0x40bc98){if(_0x40bc98){_0x2fcdae[_0x36f3('0x2e')]=_[_0x36f3('0x30')](db['CmHopperFinal'][_0x36f3('0x2b')]);_0x2fcdae[_0x36f3('0x31')]=_[_0x36f3('0x30')](_0x55d724[_0x36f3('0x31')]);_0x2fcdae['filters']=_[_0x36f3('0x32')](_0x2fcdae[_0x36f3('0x2e')],_0x2fcdae[_0x36f3('0x31')]);_0x39a41e[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0x2fcdae[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x55d724[_0x36f3('0x31')][_0x36f3('0x34')]));_0x39a41e[_0x36f3('0x33')]=_0x39a41e['attributes']['length']?_0x39a41e['attributes']:_0x2fcdae['model'];if(!_0x55d724[_0x36f3('0x31')][_0x36f3('0x36')](_0x36f3('0x57'))){_0x39a41e[_0x36f3('0x1a')]=qs[_0x36f3('0x1a')](_0x55d724[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x39a41e[_0x36f3('0x1c')]=qs[_0x36f3('0x1c')](_0x55d724[_0x36f3('0x31')]['offset']);}_0x39a41e[_0x36f3('0x37')]=qs[_0x36f3('0x58')](_0x55d724['query']['sort']);_0x39a41e[_0x36f3('0x38')]=qs[_0x36f3('0x39')](_[_0x36f3('0x59')](_0x55d724[_0x36f3('0x31')],_0x2fcdae['filters']));_0x39a41e[_0x36f3('0x38')]['CampaignId']=_0x40bc98['id'];if(_0x55d724[_0x36f3('0x31')]['filter']){_0x39a41e[_0x36f3('0x38')]=_['merge'](_0x39a41e[_0x36f3('0x38')],{'$or':_[_0x36f3('0x29')](_0x39a41e[_0x36f3('0x33')],function(_0x54e90a){var _0x3f3fe7={};_0x3f3fe7[_0x54e90a]={'$like':'%'+_0x55d724[_0x36f3('0x31')]['filter']+'%'};return _0x3f3fe7;})});}_0x39a41e=_[_0x36f3('0x3d')]({},_0x39a41e,_0x55d724[_0x36f3('0x3e')]);return db[_0x36f3('0x5e')][_0x36f3('0x1b')]({'where':_0x39a41e[_0x36f3('0x38')]})[_0x36f3('0x24')](function(_0x2c819a){_0x24ff28[_0x36f3('0x1b')]=_0x2c819a;if(_0x55d724[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x39a41e[_0x36f3('0x40')]=[{'all':!![]}];}return db[_0x36f3('0x5e')]['findAll'](_0x39a41e);})[_0x36f3('0x24')](function(_0x49e7d3){_0x24ff28[_0x36f3('0x42')]=_0x49e7d3;return _0x24ff28;});}})[_0x36f3('0x24')](respondWithFilteredResult(_0x5c255e,_0x39a41e))[_0x36f3('0x45')](handleError(_0x5c255e,null));};exports[_0x36f3('0x5f')]=function(_0x4b3574,_0x517773,_0x2d8f99){var _0x2c5690={'raw':!![],'where':{}};var _0x81dad4={};var _0x1dd6fd={'count':0x0,'rows':[]};return db[_0x36f3('0x2a')][_0x36f3('0x55')]({'where':{'id':_0x4b3574[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x517773,null))[_0x36f3('0x24')](function(_0x235ecb){if(_0x235ecb){_0x81dad4[_0x36f3('0x2e')]=_['keys'](db['CmHopperBlack'][_0x36f3('0x2b')]);_0x81dad4[_0x36f3('0x31')]=_[_0x36f3('0x30')](_0x4b3574['query']);_0x81dad4[_0x36f3('0x39')]=_[_0x36f3('0x32')](_0x81dad4['model'],_0x81dad4[_0x36f3('0x31')]);_0x2c5690['attributes']=_[_0x36f3('0x32')](_0x81dad4[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x4b3574[_0x36f3('0x31')][_0x36f3('0x34')]));_0x2c5690[_0x36f3('0x33')]=_0x2c5690[_0x36f3('0x33')]['length']?_0x2c5690[_0x36f3('0x33')]:_0x81dad4['model'];if(!_0x4b3574[_0x36f3('0x31')][_0x36f3('0x36')](_0x36f3('0x57'))){_0x2c5690[_0x36f3('0x1a')]=qs[_0x36f3('0x1a')](_0x4b3574[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x2c5690[_0x36f3('0x1c')]=qs['offset'](_0x4b3574[_0x36f3('0x31')][_0x36f3('0x1c')]);}_0x2c5690[_0x36f3('0x37')]=qs[_0x36f3('0x58')](_0x4b3574[_0x36f3('0x31')]['sort']);_0x2c5690[_0x36f3('0x38')]=qs[_0x36f3('0x39')](_[_0x36f3('0x59')](_0x4b3574[_0x36f3('0x31')],_0x81dad4[_0x36f3('0x39')]));_0x2c5690[_0x36f3('0x38')][_0x36f3('0x5a')]=_0x235ecb['id'];if(_0x4b3574[_0x36f3('0x31')][_0x36f3('0x3c')]){_0x2c5690['where']=_[_0x36f3('0x3d')](_0x2c5690[_0x36f3('0x38')],{'$or':_[_0x36f3('0x29')](_0x2c5690[_0x36f3('0x33')],function(_0x36e606){var _0x5e88ce={};_0x5e88ce[_0x36e606]={'$like':'%'+_0x4b3574['query'][_0x36f3('0x3c')]+'%'};return _0x5e88ce;})});}_0x2c5690=_[_0x36f3('0x3d')]({},_0x2c5690,_0x4b3574[_0x36f3('0x3e')]);return db[_0x36f3('0x60')]['count']({'where':_0x2c5690['where']})['then'](function(_0x3ff4c6){_0x1dd6fd[_0x36f3('0x1b')]=_0x3ff4c6;if(_0x4b3574[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x2c5690[_0x36f3('0x40')]=[{'all':!![]}];}return db[_0x36f3('0x60')][_0x36f3('0x41')](_0x2c5690);})[_0x36f3('0x24')](function(_0x3ea5d8){_0x1dd6fd['rows']=_0x3ea5d8;return _0x1dd6fd;});}})[_0x36f3('0x24')](respondWithFilteredResult(_0x517773,_0x2c5690))[_0x36f3('0x45')](handleError(_0x517773,null));};exports[_0x36f3('0x61')]=function(_0x3a5b6b,_0x484f8f,_0x4bc023){var _0x57b113={};var _0x6561e0={};var _0x23f36a;var _0x6d9551;return db[_0x36f3('0x2a')][_0x36f3('0x55')]({'where':{'id':_0x3a5b6b[_0x36f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x484f8f,null))[_0x36f3('0x24')](function(_0x4af77b){if(_0x4af77b){_0x23f36a=_0x4af77b;_0x6561e0[_0x36f3('0x2e')]=_[_0x36f3('0x30')](db[_0x36f3('0x62')][_0x36f3('0x2b')]);_0x6561e0[_0x36f3('0x31')]=_[_0x36f3('0x30')](_0x3a5b6b[_0x36f3('0x31')]);_0x6561e0['filters']=_[_0x36f3('0x32')](_0x6561e0[_0x36f3('0x2e')],_0x6561e0[_0x36f3('0x31')]);_0x57b113[_0x36f3('0x33')]=_['intersection'](_0x6561e0[_0x36f3('0x2e')],qs['fields'](_0x3a5b6b[_0x36f3('0x31')][_0x36f3('0x34')]));_0x57b113['attributes']=_0x57b113['attributes'][_0x36f3('0x35')]?_0x57b113[_0x36f3('0x33')]:_0x6561e0[_0x36f3('0x2e')];_0x57b113['order']=qs['sort'](_0x3a5b6b[_0x36f3('0x31')][_0x36f3('0x58')]);_0x57b113[_0x36f3('0x38')]=qs[_0x36f3('0x39')](_[_0x36f3('0x59')](_0x3a5b6b[_0x36f3('0x31')],_0x6561e0[_0x36f3('0x39')]));if(_0x3a5b6b[_0x36f3('0x31')][_0x36f3('0x3c')]){_0x57b113['where']=_[_0x36f3('0x3d')](_0x57b113[_0x36f3('0x38')],{'$or':_[_0x36f3('0x29')](_0x57b113[_0x36f3('0x33')],function(_0x146f03){var _0x3a3704={};_0x3a3704[_0x146f03]={'$like':'%'+_0x3a5b6b[_0x36f3('0x31')]['filter']+'%'};return _0x3a3704;})});}_0x57b113=_[_0x36f3('0x3d')]({},_0x57b113,_0x3a5b6b[_0x36f3('0x3e')]);return _0x23f36a[_0x36f3('0x61')](_0x57b113);}})[_0x36f3('0x24')](function(_0xedb9e4){if(_0xedb9e4){_0x6d9551=_0xedb9e4[_0x36f3('0x35')];if(!_0x3a5b6b['query']['hasOwnProperty'](_0x36f3('0x57'))){_0x57b113[_0x36f3('0x1a')]=qs['limit'](_0x3a5b6b[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x57b113[_0x36f3('0x1c')]=qs[_0x36f3('0x1c')](_0x3a5b6b['query'][_0x36f3('0x1c')]);}return _0x23f36a[_0x36f3('0x61')](_0x57b113);}})[_0x36f3('0x24')](function(_0x1197bd){if(_0x1197bd){return _0x1197bd?{'count':_0x6d9551,'rows':_0x1197bd}:null;}})['then'](respondWithResult(_0x484f8f,null))[_0x36f3('0x45')](handleError(_0x484f8f,null));};exports[_0x36f3('0x63')]=function(_0x4954ad,_0x473210,_0x44f758){var _0x46c91b,_0x51e520;var _0xc2a3af=[];var _0x2b1ede=moment()[_0x36f3('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x36f3('0x2a')][_0x36f3('0x44')]({'where':{'id':_0x4954ad[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x473210,null))[_0x36f3('0x24')](function(_0x44f7bf){if(_0x44f7bf){_0x51e520=_0x44f7bf;return _0x44f7bf['addLists'](_0x4954ad['body'][_0x36f3('0x65')],_[_0x36f3('0x4e')](_0x4954ad[_0x36f3('0x47')],[_0x36f3('0x65'),'id'])||{});}return null;})[_0x36f3('0x66')](function(_0x1bbef0){var _0xfc72b;var _0x15fe57;_0x46c91b=_0x1bbef0||[];var _0x5e2954=[];if(_0x1bbef0){for(var _0x91c233=0x0;_0x91c233<_0x1bbef0[_0x36f3('0x35')];_0x91c233+=0x1){var _0x59d425=_0x1bbef0[_0x91c233][_0x36f3('0x22')]({'plain':!![]});_0x51e520['dialCheckDuplicateType']=_0x4954ad[_0x36f3('0x47')][_0x36f3('0x67')]?_0x4954ad[_0x36f3('0x47')][_0x36f3('0x67')]:_0x51e520[_0x36f3('0x67')];switch(_0x51e520[_0x36f3('0x67')]){case _0x36f3('0x68'):_0xfc72b=squel['insert']()[_0x36f3('0x69')](_0x36f3('0x6a'))[_0x36f3('0x6b')]([_0x36f3('0x6c'),_0x36f3('0x6d'),_0x36f3('0x6e'),_0x36f3('0x6f'),'CampaignId',_0x36f3('0x4f'),_0x36f3('0x50')],squel[_0x36f3('0x70')]()[_0x36f3('0x71')](_0x36f3('0x6c'),_0x36f3('0x6c'))['field']('NOW()',_0x36f3('0x6d'))[_0x36f3('0x71')]('id',_0x36f3('0x6e'))[_0x36f3('0x71')](_0x59d425['CmListId'][_0x36f3('0x72')](),_0x36f3('0x6f'))[_0x36f3('0x71')](_0x4954ad['params']['id'][_0x36f3('0x72')](),_0x36f3('0x5a'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27',_0x36f3('0x4f'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27',_0x36f3('0x50'))[_0x36f3('0x73')](_0x36f3('0x74'))['where'](_0x36f3('0x75'))[_0x36f3('0x38')](_0x36f3('0x76'),_0x59d425[_0x36f3('0x77')]['toString']())[_0x36f3('0x38')](_0x36f3('0x78'))[_0x36f3('0x38')](_0x36f3('0x79'),squel[_0x36f3('0x70')]()[_0x36f3('0x71')](_0x36f3('0x7a'))[_0x36f3('0x73')]('cm_hopper_final')[_0x36f3('0x38')](_0x36f3('0x7b'),_0x4954ad[_0x36f3('0x43')]['id'][_0x36f3('0x72')]()))['where'](_0x36f3('0x79'),squel[_0x36f3('0x70')]()[_0x36f3('0x71')]('COALESCE(phone,\x27\x27)')[_0x36f3('0x73')]('cm_hopper')[_0x36f3('0x38')](_0x36f3('0x7b'),_0x4954ad[_0x36f3('0x43')]['id'][_0x36f3('0x72')]())))['toString']();break;case _0x36f3('0x7c'):_0xfc72b=squel[_0x36f3('0x7d')]()[_0x36f3('0x69')]('cm_hopper')[_0x36f3('0x6b')]([_0x36f3('0x6c'),_0x36f3('0x6d'),_0x36f3('0x6e'),_0x36f3('0x6f'),'CampaignId','createdAt',_0x36f3('0x50')],squel['select']()['field'](_0x36f3('0x6c'),_0x36f3('0x6c'))[_0x36f3('0x71')](_0x36f3('0x7e'),'scheduledAt')[_0x36f3('0x71')]('id',_0x36f3('0x6e'))[_0x36f3('0x71')](_0x59d425[_0x36f3('0x77')][_0x36f3('0x72')](),_0x36f3('0x6f'))[_0x36f3('0x71')](_0x4954ad[_0x36f3('0x43')]['id']['toString'](),_0x36f3('0x5a'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27',_0x36f3('0x4f'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27','updatedAt')['from'](_0x36f3('0x74'))[_0x36f3('0x38')](_0x36f3('0x75'))[_0x36f3('0x38')](_0x36f3('0x76'),_0x59d425[_0x36f3('0x77')][_0x36f3('0x72')]())[_0x36f3('0x38')]('phone\x20IS\x20NOT\x20NULL')[_0x36f3('0x38')](_0x36f3('0x79'),squel[_0x36f3('0x70')]()['field'](_0x36f3('0x7f'))[_0x36f3('0x73')](_0x36f3('0x6a'))[_0x36f3('0x38')](_0x36f3('0x7b'),_0x4954ad['params']['id'][_0x36f3('0x72')]())))['toString']();break;default:_0xfc72b=squel[_0x36f3('0x7d')]()[_0x36f3('0x69')]('cm_hopper')['fromQuery'](['phone',_0x36f3('0x6d'),'ContactId',_0x36f3('0x6f'),'CampaignId',_0x36f3('0x4f'),_0x36f3('0x50')],squel[_0x36f3('0x70')]()[_0x36f3('0x71')](_0x36f3('0x6c'),_0x36f3('0x6c'))[_0x36f3('0x71')](_0x36f3('0x7e'),_0x36f3('0x6d'))['field']('id',_0x36f3('0x6e'))[_0x36f3('0x71')](_0x59d425['CmListId'][_0x36f3('0x72')](),_0x36f3('0x6f'))[_0x36f3('0x71')](_0x4954ad[_0x36f3('0x43')]['id'][_0x36f3('0x72')](),_0x36f3('0x5a'))['field']('\x27'+_0x2b1ede+'\x27',_0x36f3('0x4f'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27',_0x36f3('0x50'))[_0x36f3('0x73')](_0x36f3('0x74'))[_0x36f3('0x38')]('deletedAt\x20IS\x20NULL')[_0x36f3('0x38')](_0x36f3('0x76'),_0x59d425[_0x36f3('0x77')][_0x36f3('0x72')]())['where'](_0x36f3('0x78')))[_0x36f3('0x72')]();}_0x15fe57=squel['insert']()[_0x36f3('0x69')](_0x36f3('0x80'))['fromQuery']([_0x36f3('0x81'),_0x36f3('0x6d'),_0x36f3('0x6c'),_0x36f3('0x82'),_0x36f3('0x4f'),_0x36f3('0x50')],squel[_0x36f3('0x70')]()['field'](_0x36f3('0x83'),'id')[_0x36f3('0x71')]('NOW()',_0x36f3('0x6d'))['field'](_0x36f3('0x84'),_0x36f3('0x6c'))['field'](_0x36f3('0x85'),_0x36f3('0x82'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27','createdAt')[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27',_0x36f3('0x50'))[_0x36f3('0x73')](_0x36f3('0x86'),'ci')[_0x36f3('0x87')](_0x36f3('0x6a'),'h',_0x36f3('0x88'))[_0x36f3('0x38')](_0x36f3('0x89'),_0x59d425[_0x36f3('0x77')][_0x36f3('0x72')]())[_0x36f3('0x38')](_0x36f3('0x8a'),_0x4954ad[_0x36f3('0x43')]['id'][_0x36f3('0x72')]())[_0x36f3('0x38')](_0x36f3('0x8b'),_0x2b1ede))[_0x36f3('0x72')]();_0x5e2954[_0x36f3('0x8c')](db[_0x36f3('0x8d')][_0x36f3('0x31')](_0xfc72b));_0xc2a3af['push'](db[_0x36f3('0x8d')]['query'](_0x15fe57));}return BPromise['all'](_0x5e2954);}})['then'](function(){return BPromise[_0x36f3('0x8e')](_0xc2a3af);})[_0x36f3('0x24')](function(){return _0x46c91b;})[_0x36f3('0x24')](respondWithResult(_0x473210,null))[_0x36f3('0x45')](handleError(_0x473210,null));};exports[_0x36f3('0x8f')]=function(_0x1bc0a0,_0x3892d0,_0x14e89c){return db[_0x36f3('0x2a')][_0x36f3('0x44')]({'where':{'id':_0x1bc0a0[_0x36f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x3892d0,null))[_0x36f3('0x24')](function(_0x351135){if(_0x351135){return _0x351135['removeLists'](_0x1bc0a0[_0x36f3('0x31')][_0x36f3('0x65')]);}})[_0x36f3('0x24')](function(_0x568d03){if(_0x568d03){return db[_0x36f3('0x56')][_0x36f3('0x21')]({'where':{'ListId':_0x1bc0a0[_0x36f3('0x31')][_0x36f3('0x65')],'CampaignId':_0x1bc0a0[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](function(){return _0x568d03;});}})[_0x36f3('0x24')](respondWithStatusCode(_0x3892d0,null))[_0x36f3('0x45')](handleError(_0x3892d0,null));};exports['getBlackLists']=function(_0x126c2b,_0x19df44,_0x268db3){var _0xb907ef={};var _0xd6df25={};var _0x2971e7;var _0x44b358;return db['Campaign'][_0x36f3('0x55')]({'where':{'id':_0x126c2b[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x19df44,null))[_0x36f3('0x24')](function(_0x511987){if(_0x511987){_0x2971e7=_0x511987;_0xd6df25['model']=_[_0x36f3('0x30')](db['CmList']['rawAttributes']);_0xd6df25['query']=_[_0x36f3('0x30')](_0x126c2b[_0x36f3('0x31')]);_0xd6df25[_0x36f3('0x39')]=_[_0x36f3('0x32')](_0xd6df25[_0x36f3('0x2e')],_0xd6df25[_0x36f3('0x31')]);_0xb907ef[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0xd6df25[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x126c2b[_0x36f3('0x31')][_0x36f3('0x34')]));_0xb907ef['attributes']=_0xb907ef['attributes']['length']?_0xb907ef['attributes']:_0xd6df25['model'];_0xb907ef[_0x36f3('0x37')]=qs[_0x36f3('0x58')](_0x126c2b['query'][_0x36f3('0x58')]);_0xb907ef['where']=qs['filters'](_['pick'](_0x126c2b[_0x36f3('0x31')],_0xd6df25['filters']));if(_0x126c2b[_0x36f3('0x31')][_0x36f3('0x3c')]){_0xb907ef[_0x36f3('0x38')]=_[_0x36f3('0x3d')](_0xb907ef['where'],{'$or':_[_0x36f3('0x29')](_0xb907ef[_0x36f3('0x33')],function(_0x3099bb){var _0x5cdad1={};_0x5cdad1[_0x3099bb]={'$like':'%'+_0x126c2b[_0x36f3('0x31')][_0x36f3('0x3c')]+'%'};return _0x5cdad1;})});}_0xb907ef=_['merge']({},_0xb907ef,_0x126c2b[_0x36f3('0x3e')]);return _0x2971e7['getBlackLists'](_0xb907ef);}})[_0x36f3('0x24')](function(_0x45b91c){if(_0x45b91c){_0x44b358=_0x45b91c[_0x36f3('0x35')];if(!_0x126c2b[_0x36f3('0x31')][_0x36f3('0x36')](_0x36f3('0x57'))){_0xb907ef[_0x36f3('0x1a')]=qs[_0x36f3('0x1a')](_0x126c2b['query'][_0x36f3('0x1a')]);_0xb907ef['offset']=qs[_0x36f3('0x1c')](_0x126c2b[_0x36f3('0x31')]['offset']);}return _0x2971e7[_0x36f3('0x90')](_0xb907ef);}})[_0x36f3('0x24')](function(_0x365b97){if(_0x365b97){return _0x365b97?{'count':_0x44b358,'rows':_0x365b97}:null;}})['then'](respondWithResult(_0x19df44,null))[_0x36f3('0x45')](handleError(_0x19df44,null));};exports[_0x36f3('0x91')]=function(_0x377efa,_0x59671a,_0x1f7cdb){var _0x240087,_0x5dadfc;var _0x399e66=[];var _0x229222=moment()['format'](_0x36f3('0x92'));return db[_0x36f3('0x2a')][_0x36f3('0x44')]({'where':{'id':_0x377efa['params']['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x59671a,null))['then'](function(_0xe7250b){if(_0xe7250b){_0x5dadfc=_0xe7250b;return _0xe7250b['addBlackLists'](_0x377efa[_0x36f3('0x47')]['ids'],_[_0x36f3('0x4e')](_0x377efa[_0x36f3('0x47')],[_0x36f3('0x65'),'id'])||{});}return null;})[_0x36f3('0x66')](function(_0x5aae79){var _0xd6f65b;var _0xcee22d;_0x240087=_0x5aae79||[];var _0x1c983c=[];if(_0x5aae79){for(var _0x2c81b9=0x0;_0x2c81b9<_0x5aae79[_0x36f3('0x35')];_0x2c81b9+=0x1){var _0xc31b5=_0x5aae79[_0x2c81b9][_0x36f3('0x22')]({'plain':!![]});_0xd6f65b=squel[_0x36f3('0x7d')]()[_0x36f3('0x69')](_0x36f3('0x93'))['fromQuery']([_0x36f3('0x6c'),'ContactId',_0x36f3('0x6f'),_0x36f3('0x5a'),_0x36f3('0x4f'),'updatedAt'],squel[_0x36f3('0x70')]()['field'](_0x36f3('0x6c'),_0x36f3('0x6c'))[_0x36f3('0x71')]('id','ContactId')[_0x36f3('0x71')](_0xc31b5[_0x36f3('0x77')][_0x36f3('0x72')](),_0x36f3('0x6f'))[_0x36f3('0x71')](_0x377efa[_0x36f3('0x43')]['id'][_0x36f3('0x72')](),_0x36f3('0x5a'))[_0x36f3('0x71')]('NOW()',_0x36f3('0x4f'))[_0x36f3('0x71')](_0x36f3('0x7e'),_0x36f3('0x50'))[_0x36f3('0x73')](_0x36f3('0x74'))[_0x36f3('0x38')]('deletedAt\x20IS\x20NULL')[_0x36f3('0x38')](_0x36f3('0x76'),_0xc31b5[_0x36f3('0x77')][_0x36f3('0x72')]())['where'](_0x36f3('0x78')))[_0x36f3('0x72')]();_0x1c983c['push'](db['sequelize'][_0x36f3('0x31')](_0xd6f65b));}return BPromise[_0x36f3('0x8e')](_0x1c983c);}})['then'](function(){return _0x240087;})[_0x36f3('0x24')](respondWithResult(_0x59671a,null))[_0x36f3('0x45')](handleError(_0x59671a,null));};exports[_0x36f3('0x94')]=function(_0x18e14c,_0x12d654,_0xfdedbc){return db['Campaign'][_0x36f3('0x44')]({'where':{'id':_0x18e14c[_0x36f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x12d654,null))['then'](function(_0x225fcf){if(_0x225fcf){return _0x225fcf[_0x36f3('0x94')](_0x18e14c[_0x36f3('0x31')][_0x36f3('0x65')]);}})[_0x36f3('0x24')](function(_0x5eb44d){if(_0x5eb44d){return db[_0x36f3('0x60')]['destroy']({'where':{'ListId':_0x18e14c[_0x36f3('0x31')][_0x36f3('0x65')],'CampaignId':_0x18e14c['params']['id']}})['then'](function(){return _0x5eb44d;});}})[_0x36f3('0x24')](respondWithStatusCode(_0x12d654,null))['catch'](handleError(_0x12d654,null));};
\ No newline at end of file
+var _0x8322=['map','Campaign','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','params','create','body','user','IvrCampaigns','UserProfileSection','find','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','findOne','CmHopper','options','count','getHopperHistories','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','format','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ListId','select','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','from','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','insert','ContactId','cm_hopper_additional_phones','fromQuery','cmHopperId','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','error','name','send','index'];(function(_0x6b475b,_0x3b9f10){var _0x472550=function(_0x3af4f2){while(--_0x3af4f2){_0x6b475b['push'](_0x6b475b['shift']());}};_0x472550(++_0x3b9f10);}(_0x8322,0x186));var _0x2832=function(_0x3818c0,_0x542521){_0x3818c0=_0x3818c0-0x0;var _0x55ec33=_0x8322[_0x3818c0];return _0x55ec33;};'use strict';var emlformat=require(_0x2832('0x0'));var rimraf=require(_0x2832('0x1'));var zipdir=require(_0x2832('0x2'));var jsonpatch=require(_0x2832('0x3'));var rp=require(_0x2832('0x4'));var moment=require(_0x2832('0x5'));var BPromise=require(_0x2832('0x6'));var Mustache=require(_0x2832('0x7'));var util=require(_0x2832('0x8'));var path=require(_0x2832('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2832('0xa'));var fs=require('fs');var fs_extra=require(_0x2832('0xb'));var _=require(_0x2832('0xc'));var squel=require(_0x2832('0xd'));var crypto=require(_0x2832('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2832('0xf'));var toCsv=require(_0x2832('0x10'));var querystring=require(_0x2832('0x11'));var Papa=require(_0x2832('0x12'));var Redis=require('ioredis');var authService=require(_0x2832('0x13'));var qs=require(_0x2832('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2832('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2832('0x16'));var licenseUtil=require(_0x2832('0x17'));var db=require(_0x2832('0x18'))['db'];function respondWithStatusCode(_0x362f97,_0x53f53c){_0x53f53c=_0x53f53c||0xcc;return function(_0x2fc06a){if(_0x2fc06a){return _0x362f97[_0x2832('0x19')](_0x53f53c);}return _0x362f97['status'](_0x53f53c)[_0x2832('0x1a')]();};}function respondWithResult(_0x4629fd,_0x285038){_0x285038=_0x285038||0xc8;return function(_0x324a19){if(_0x324a19){return _0x4629fd[_0x2832('0x1b')](_0x285038)[_0x2832('0x1c')](_0x324a19);}};}function respondWithFilteredResult(_0x12dc34,_0x5aa322){return function(_0x1805db){if(_0x1805db){var _0x38f293=typeof _0x5aa322['offset']===_0x2832('0x1d')&&typeof _0x5aa322['limit']===_0x2832('0x1d');var _0x4d11a4=_0x1805db['count'];var _0x1bb3f0=_0x38f293?0x0:_0x5aa322[_0x2832('0x1e')];var _0x2c0355=_0x38f293?_0x1805db['count']:_0x5aa322[_0x2832('0x1e')]+_0x5aa322[_0x2832('0x1f')];var _0x52f067;if(_0x2c0355>=_0x4d11a4){_0x2c0355=_0x4d11a4;_0x52f067=0xc8;}else{_0x52f067=0xce;}_0x12dc34[_0x2832('0x1b')](_0x52f067);return _0x12dc34[_0x2832('0x20')](_0x2832('0x21'),_0x1bb3f0+'-'+_0x2c0355+'/'+_0x4d11a4)[_0x2832('0x1c')](_0x1805db);}return null;};}function patchUpdates(_0x561169){return function(_0x265a6c){try{jsonpatch[_0x2832('0x22')](_0x265a6c,_0x561169,!![]);}catch(_0x3d57f9){return BPromise[_0x2832('0x23')](_0x3d57f9);}return _0x265a6c[_0x2832('0x24')]();};}function saveUpdates(_0x2df647,_0x3f8f4a){return function(_0x22fab6){if(_0x22fab6){return _0x22fab6[_0x2832('0x25')](_0x2df647)[_0x2832('0x26')](function(_0x1ccbd8){return _0x1ccbd8;});}return null;};}function removeEntity(_0x56bb6e,_0x2ac1a7){return function(_0x216357){if(_0x216357){return _0x216357[_0x2832('0x27')]()[_0x2832('0x26')](function(){var _0x24621a=_0x216357[_0x2832('0x28')]({'plain':!![]});var _0x203cd0='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x203cd0,'resourceId':_0x24621a['id']}})[_0x2832('0x26')](function(){return _0x216357;});})[_0x2832('0x26')](function(){_0x56bb6e['status'](0xcc)[_0x2832('0x1a')]();});}};}function handleEntityNotFound(_0x6c1907,_0x4694ac){return function(_0x3703b1){if(!_0x3703b1){_0x6c1907[_0x2832('0x19')](0x194);}return _0x3703b1;};}function handleError(_0x42b595,_0x2469ab){_0x2469ab=_0x2469ab||0x1f4;return function(_0x117b4c){logger[_0x2832('0x29')](_0x117b4c['stack']);if(_0x117b4c[_0x2832('0x2a')]){delete _0x117b4c['name'];}_0x42b595[_0x2832('0x1b')](_0x2469ab)[_0x2832('0x2b')](_0x117b4c);};}exports[_0x2832('0x2c')]=function(_0x2cbd15,_0x23c709){var _0xc472a4={},_0x2e1f81={},_0x57aafa={'count':0x0,'rows':[]};var _0x438735=_[_0x2832('0x2d')](db[_0x2832('0x2e')][_0x2832('0x2f')],function(_0x4db237){return{'name':_0x4db237[_0x2832('0x30')],'type':_0x4db237['type'][_0x2832('0x31')]};});_0x2e1f81['model']=_['map'](_0x438735,_0x2832('0x2a'));_0x2e1f81[_0x2832('0x32')]=_[_0x2832('0x33')](_0x2cbd15[_0x2832('0x32')]);_0x2e1f81[_0x2832('0x34')]=_[_0x2832('0x35')](_0x2e1f81[_0x2832('0x36')],_0x2e1f81[_0x2832('0x32')]);_0xc472a4['attributes']=_[_0x2832('0x35')](_0x2e1f81[_0x2832('0x36')],qs[_0x2832('0x37')](_0x2cbd15['query'][_0x2832('0x37')]));_0xc472a4[_0x2832('0x38')]=_0xc472a4[_0x2832('0x38')][_0x2832('0x39')]?_0xc472a4[_0x2832('0x38')]:_0x2e1f81['model'];if(!_0x2cbd15['query'][_0x2832('0x3a')](_0x2832('0x3b'))){_0xc472a4[_0x2832('0x1f')]=qs['limit'](_0x2cbd15[_0x2832('0x32')][_0x2832('0x1f')]);_0xc472a4[_0x2832('0x1e')]=qs['offset'](_0x2cbd15['query'][_0x2832('0x1e')]);}_0xc472a4[_0x2832('0x3c')]=qs[_0x2832('0x3d')](_0x2cbd15[_0x2832('0x32')][_0x2832('0x3d')]);_0xc472a4[_0x2832('0x3e')]=qs['filters'](_[_0x2832('0x3f')](_0x2cbd15[_0x2832('0x32')],_0x2e1f81[_0x2832('0x34')]),_0x438735);if(_0x2cbd15[_0x2832('0x32')][_0x2832('0x40')]){_0xc472a4['where']=_[_0x2832('0x41')](_0xc472a4[_0x2832('0x3e')],{'$or':_[_0x2832('0x2d')](_0x438735,function(_0x834cae){if(_0x834cae[_0x2832('0x42')]!=='VIRTUAL'){var _0x31b5b1={};_0x31b5b1[_0x834cae['name']]={'$like':'%'+_0x2cbd15[_0x2832('0x32')][_0x2832('0x40')]+'%'};return _0x31b5b1;}})});}_0xc472a4=_[_0x2832('0x41')]({},_0xc472a4,_0x2cbd15['options']);var _0x1300d3={'where':_0xc472a4[_0x2832('0x3e')]};return db['Campaign']['count'](_0x1300d3)[_0x2832('0x26')](function(_0x759be8){_0x57aafa['count']=_0x759be8;if(_0x2cbd15[_0x2832('0x32')][_0x2832('0x43')]){_0xc472a4[_0x2832('0x44')]=[{'all':!![]}];}return db[_0x2832('0x2e')][_0x2832('0x45')](_0xc472a4);})[_0x2832('0x26')](function(_0x18713b){_0x57aafa[_0x2832('0x46')]=_0x18713b;return _0x57aafa;})[_0x2832('0x26')](respondWithFilteredResult(_0x23c709,_0xc472a4))[_0x2832('0x47')](handleError(_0x23c709,null));};exports['show']=function(_0x1c51e9,_0x5f159c){var _0x133b12={'raw':![],'where':{'id':_0x1c51e9[_0x2832('0x48')]['id']}},_0x5b5a20={};_0x5b5a20[_0x2832('0x36')]=_['keys'](db[_0x2832('0x2e')][_0x2832('0x2f')]);_0x5b5a20['query']=_[_0x2832('0x33')](_0x1c51e9['query']);_0x5b5a20[_0x2832('0x34')]=_[_0x2832('0x35')](_0x5b5a20[_0x2832('0x36')],_0x5b5a20[_0x2832('0x32')]);_0x133b12[_0x2832('0x38')]=_[_0x2832('0x35')](_0x5b5a20[_0x2832('0x36')],qs[_0x2832('0x37')](_0x1c51e9['query']['fields']));_0x133b12[_0x2832('0x38')]=_0x133b12[_0x2832('0x38')][_0x2832('0x39')]?_0x133b12[_0x2832('0x38')]:_0x5b5a20[_0x2832('0x36')];if(_0x1c51e9[_0x2832('0x32')][_0x2832('0x43')]){_0x133b12[_0x2832('0x44')]=[{'all':!![]}];}_0x133b12=_[_0x2832('0x41')]({},_0x133b12,_0x1c51e9['options']);return db[_0x2832('0x2e')]['find'](_0x133b12)['then'](handleEntityNotFound(_0x5f159c,null))[_0x2832('0x26')](respondWithResult(_0x5f159c,null))[_0x2832('0x47')](handleError(_0x5f159c,null));};exports[_0x2832('0x49')]=function(_0xea06cf,_0x514707){return db[_0x2832('0x2e')][_0x2832('0x49')](_0xea06cf[_0x2832('0x4a')],{})[_0x2832('0x26')](function(_0x39b483){var _0x43fa8a=_0xea06cf[_0x2832('0x4b')]['get']({'plain':!![]});if(!_0x43fa8a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x43fa8a['role']==='user'){var _0x5a9fc7=_0x39b483['get']({'plain':!![]});var _0x31304b=_0x2832('0x4c');return db[_0x2832('0x4d')][_0x2832('0x4e')]({'where':{'name':_0x31304b,'userProfileId':_0x43fa8a[_0x2832('0x4f')]},'raw':!![]})[_0x2832('0x26')](function(_0x2942a9){if(_0x2942a9&&_0x2942a9[_0x2832('0x50')]===0x0){return db['UserProfileResource'][_0x2832('0x49')]({'name':_0x5a9fc7[_0x2832('0x2a')],'resourceId':_0x5a9fc7['id'],'type':_0x2942a9[_0x2832('0x2a')],'sectionId':_0x2942a9['id']},{})[_0x2832('0x26')](function(){return _0x39b483;});}else{return _0x39b483;}})[_0x2832('0x47')](function(_0x426ab5){logger[_0x2832('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x426ab5);throw _0x426ab5;});}return _0x39b483;})['then'](respondWithResult(_0x514707,0xc9))[_0x2832('0x47')](handleError(_0x514707,null));};exports[_0x2832('0x51')]=function(_0x3baa71,_0x9ee86b){var _0x1b55ed={'where':{'id':_0x3baa71['params']['id']}},_0x296e03={};_0x296e03[_0x2832('0x36')]=_[_0x2832('0x33')](db[_0x2832('0x2e')]['rawAttributes']);_0x1b55ed[_0x2832('0x38')]=_['intersection'](_0x296e03[_0x2832('0x36')],qs['fields'](_0x3baa71[_0x2832('0x32')][_0x2832('0x37')]));_0x1b55ed['attributes']=_0x1b55ed[_0x2832('0x38')]['length']?_0x1b55ed[_0x2832('0x38')]:_0x296e03['model'];if(_0x3baa71[_0x2832('0x32')]['includeAll']){_0x1b55ed['include']=[{'all':!![]}];}_0x1b55ed=_[_0x2832('0x41')]({},_0x1b55ed,_0x3baa71['options']);return db[_0x2832('0x2e')]['find'](_0x1b55ed)[_0x2832('0x26')](handleEntityNotFound(_0x9ee86b,null))[_0x2832('0x26')](function(_0xda9900){if(_0xda9900){var _0x26484e=_0xda9900[_0x2832('0x28')]({'plain':!![]});_0x26484e=qs[_0x2832('0x52')](_0x26484e,['id',_0x2832('0x53'),_0x2832('0x54')]);_0x3baa71[_0x2832('0x4a')]=_[_0x2832('0x52')](_0x3baa71['body'],['id',_0x2832('0x53'),_0x2832('0x54')]);return db[_0x2832('0x2e')][_0x2832('0x49')](_[_0x2832('0x41')](_0x26484e,_0x3baa71[_0x2832('0x4a')]),{'include':_0x3baa71[_0x2832('0x32')][_0x2832('0x43')]?[{'all':!![]}]:undefined})[_0x2832('0x26')](function(_0x97924a){var _0x350fb1=_0x3baa71[_0x2832('0x4b')]['get']({'plain':!![]});if(!_0x350fb1)throw new Error(_0x2832('0x55'));if(_0x350fb1[_0x2832('0x56')]==='user'){var _0xbe55df=_0x97924a['get']({'plain':!![]});var _0xd4f239=_0x2832('0x4c');return db[_0x2832('0x4d')][_0x2832('0x4e')]({'where':{'name':_0xd4f239,'userProfileId':_0x350fb1[_0x2832('0x4f')]},'raw':!![]})[_0x2832('0x26')](function(_0x27db6e){if(_0x27db6e&&_0x27db6e['autoAssociation']===0x0){return db['UserProfileResource'][_0x2832('0x49')]({'name':_0xbe55df['name'],'resourceId':_0xbe55df['id'],'type':_0x27db6e[_0x2832('0x2a')],'sectionId':_0x27db6e['id']},{})[_0x2832('0x26')](function(){return _0x97924a;});}else{return _0x97924a;}})[_0x2832('0x47')](function(_0xbddbc1){logger[_0x2832('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbddbc1);throw _0xbddbc1;});}return _0x97924a;});}})['then'](respondWithResult(_0x9ee86b,0xc9))['catch'](handleError(_0x9ee86b,null));};exports[_0x2832('0x25')]=function(_0x39ad39,_0x1addfa){if(_0x39ad39['body']['id']){delete _0x39ad39[_0x2832('0x4a')]['id'];}return db[_0x2832('0x2e')][_0x2832('0x4e')]({'where':{'id':_0x39ad39[_0x2832('0x48')]['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x1addfa,null))['then'](saveUpdates(_0x39ad39['body'],null))[_0x2832('0x26')](respondWithResult(_0x1addfa,null))[_0x2832('0x47')](handleError(_0x1addfa,null));};exports['destroy']=function(_0x1d7668,_0x105696){return db[_0x2832('0x2e')][_0x2832('0x4e')]({'where':{'id':_0x1d7668[_0x2832('0x48')]['id']}})['then'](handleEntityNotFound(_0x105696,null))[_0x2832('0x26')](removeEntity(_0x105696,null))['catch'](handleError(_0x105696,null));};exports['getHoppers']=function(_0x2ed018,_0x127dd1,_0x1b852a){var _0x2f7fbe={'raw':!![],'where':{}};var _0xf5f1af={};var _0x3f389c={'count':0x0,'rows':[]};return db[_0x2832('0x2e')][_0x2832('0x57')]({'where':{'id':_0x2ed018[_0x2832('0x48')]['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x127dd1,null))['then'](function(_0x312afb){if(_0x312afb){_0xf5f1af[_0x2832('0x36')]=_['keys'](db[_0x2832('0x58')][_0x2832('0x2f')]);_0xf5f1af[_0x2832('0x32')]=_[_0x2832('0x33')](_0x2ed018[_0x2832('0x32')]);_0xf5f1af[_0x2832('0x34')]=_[_0x2832('0x35')](_0xf5f1af[_0x2832('0x36')],_0xf5f1af[_0x2832('0x32')]);_0x2f7fbe[_0x2832('0x38')]=_[_0x2832('0x35')](_0xf5f1af['model'],qs[_0x2832('0x37')](_0x2ed018[_0x2832('0x32')][_0x2832('0x37')]));_0x2f7fbe[_0x2832('0x38')]=_0x2f7fbe[_0x2832('0x38')][_0x2832('0x39')]?_0x2f7fbe[_0x2832('0x38')]:_0xf5f1af[_0x2832('0x36')];if(!_0x2ed018['query'][_0x2832('0x3a')](_0x2832('0x3b'))){_0x2f7fbe[_0x2832('0x1f')]=qs[_0x2832('0x1f')](_0x2ed018['query'][_0x2832('0x1f')]);_0x2f7fbe[_0x2832('0x1e')]=qs[_0x2832('0x1e')](_0x2ed018[_0x2832('0x32')][_0x2832('0x1e')]);}_0x2f7fbe['order']=qs['sort'](_0x2ed018[_0x2832('0x32')]['sort']);_0x2f7fbe['where']=qs[_0x2832('0x34')](_[_0x2832('0x3f')](_0x2ed018['query'],_0xf5f1af[_0x2832('0x34')]));_0x2f7fbe[_0x2832('0x3e')]['CampaignId']=_0x312afb['id'];if(_0x2ed018[_0x2832('0x32')][_0x2832('0x40')]){_0x2f7fbe[_0x2832('0x3e')]=_[_0x2832('0x41')](_0x2f7fbe[_0x2832('0x3e')],{'$or':_[_0x2832('0x2d')](_0x2f7fbe[_0x2832('0x38')],function(_0x301a9b){var _0x150b2e={};_0x150b2e[_0x301a9b]={'$like':'%'+_0x2ed018[_0x2832('0x32')][_0x2832('0x40')]+'%'};return _0x150b2e;})});}_0x2f7fbe=_[_0x2832('0x41')]({},_0x2f7fbe,_0x2ed018[_0x2832('0x59')]);return db[_0x2832('0x58')][_0x2832('0x5a')]({'where':_0x2f7fbe[_0x2832('0x3e')]})[_0x2832('0x26')](function(_0x3444fb){_0x3f389c[_0x2832('0x5a')]=_0x3444fb;if(_0x2ed018[_0x2832('0x32')][_0x2832('0x43')]){_0x2f7fbe[_0x2832('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0x2832('0x45')](_0x2f7fbe);})[_0x2832('0x26')](function(_0xa6b8d6){_0x3f389c['rows']=_0xa6b8d6;return _0x3f389c;});}})[_0x2832('0x26')](respondWithFilteredResult(_0x127dd1,_0x2f7fbe))[_0x2832('0x47')](handleError(_0x127dd1,null));};exports[_0x2832('0x5b')]=function(_0x500467,_0x20b961,_0x1f2f7a){var _0x1f358e={'raw':!![],'where':{}};var _0x4f47ae={};var _0x128d9f={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x500467[_0x2832('0x48')]['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x20b961,null))[_0x2832('0x26')](function(_0x673521){if(_0x673521){_0x4f47ae[_0x2832('0x36')]=_[_0x2832('0x33')](db['CmHopperHistory'][_0x2832('0x2f')]);_0x4f47ae[_0x2832('0x32')]=_[_0x2832('0x33')](_0x500467['query']);_0x4f47ae['filters']=_[_0x2832('0x35')](_0x4f47ae[_0x2832('0x36')],_0x4f47ae[_0x2832('0x32')]);_0x1f358e[_0x2832('0x38')]=_[_0x2832('0x35')](_0x4f47ae['model'],qs['fields'](_0x500467[_0x2832('0x32')][_0x2832('0x37')]));_0x1f358e[_0x2832('0x38')]=_0x1f358e[_0x2832('0x38')][_0x2832('0x39')]?_0x1f358e[_0x2832('0x38')]:_0x4f47ae[_0x2832('0x36')];if(!_0x500467[_0x2832('0x32')]['hasOwnProperty'](_0x2832('0x3b'))){_0x1f358e[_0x2832('0x1f')]=qs[_0x2832('0x1f')](_0x500467[_0x2832('0x32')][_0x2832('0x1f')]);_0x1f358e['offset']=qs[_0x2832('0x1e')](_0x500467[_0x2832('0x32')]['offset']);}_0x1f358e['order']=qs[_0x2832('0x3d')](_0x500467[_0x2832('0x32')]['sort']);_0x1f358e[_0x2832('0x3e')]=qs[_0x2832('0x34')](_[_0x2832('0x3f')](_0x500467['query'],_0x4f47ae['filters']));_0x1f358e[_0x2832('0x3e')][_0x2832('0x5c')]=_0x673521['id'];if(_0x500467[_0x2832('0x32')][_0x2832('0x40')]){_0x1f358e['where']=_[_0x2832('0x41')](_0x1f358e['where'],{'$or':_['map'](_0x1f358e[_0x2832('0x38')],function(_0x252510){var _0xfa577b={};_0xfa577b[_0x252510]={'$like':'%'+_0x500467[_0x2832('0x32')][_0x2832('0x40')]+'%'};return _0xfa577b;})});}_0x1f358e=_['merge']({},_0x1f358e,_0x500467['options']);return db[_0x2832('0x5d')]['count']({'where':_0x1f358e[_0x2832('0x3e')]})[_0x2832('0x26')](function(_0x2fe103){_0x128d9f['count']=_0x2fe103;if(_0x500467[_0x2832('0x32')]['includeAll']){_0x1f358e[_0x2832('0x44')]=[{'all':!![]}];}return db[_0x2832('0x5d')][_0x2832('0x45')](_0x1f358e);})[_0x2832('0x26')](function(_0x90b0fa){_0x128d9f[_0x2832('0x46')]=_0x90b0fa;return _0x128d9f;});}})[_0x2832('0x26')](respondWithFilteredResult(_0x20b961,_0x1f358e))[_0x2832('0x47')](handleError(_0x20b961,null));};exports[_0x2832('0x5e')]=function(_0x431438,_0x3912ea,_0x3d3a9c){var _0x150825={'raw':!![],'where':{}};var _0x3e2800={};var _0xf915b0={'count':0x0,'rows':[]};return db[_0x2832('0x2e')][_0x2832('0x57')]({'where':{'id':_0x431438[_0x2832('0x48')]['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x3912ea,null))[_0x2832('0x26')](function(_0x5954fe){if(_0x5954fe){_0x3e2800[_0x2832('0x36')]=_[_0x2832('0x33')](db[_0x2832('0x5f')][_0x2832('0x2f')]);_0x3e2800['query']=_['keys'](_0x431438[_0x2832('0x32')]);_0x3e2800['filters']=_[_0x2832('0x35')](_0x3e2800[_0x2832('0x36')],_0x3e2800[_0x2832('0x32')]);_0x150825[_0x2832('0x38')]=_['intersection'](_0x3e2800[_0x2832('0x36')],qs[_0x2832('0x37')](_0x431438[_0x2832('0x32')][_0x2832('0x37')]));_0x150825[_0x2832('0x38')]=_0x150825[_0x2832('0x38')]['length']?_0x150825[_0x2832('0x38')]:_0x3e2800['model'];if(!_0x431438[_0x2832('0x32')][_0x2832('0x3a')](_0x2832('0x3b'))){_0x150825[_0x2832('0x1f')]=qs['limit'](_0x431438[_0x2832('0x32')]['limit']);_0x150825['offset']=qs[_0x2832('0x1e')](_0x431438[_0x2832('0x32')]['offset']);}_0x150825['order']=qs[_0x2832('0x3d')](_0x431438[_0x2832('0x32')][_0x2832('0x3d')]);_0x150825[_0x2832('0x3e')]=qs[_0x2832('0x34')](_[_0x2832('0x3f')](_0x431438[_0x2832('0x32')],_0x3e2800[_0x2832('0x34')]));_0x150825[_0x2832('0x3e')][_0x2832('0x5c')]=_0x5954fe['id'];if(_0x431438['query']['filter']){_0x150825[_0x2832('0x3e')]=_[_0x2832('0x41')](_0x150825[_0x2832('0x3e')],{'$or':_[_0x2832('0x2d')](_0x150825['attributes'],function(_0x52999e){var _0x25fb5d={};_0x25fb5d[_0x52999e]={'$like':'%'+_0x431438[_0x2832('0x32')][_0x2832('0x40')]+'%'};return _0x25fb5d;})});}_0x150825=_[_0x2832('0x41')]({},_0x150825,_0x431438[_0x2832('0x59')]);return db[_0x2832('0x5f')][_0x2832('0x5a')]({'where':_0x150825[_0x2832('0x3e')]})[_0x2832('0x26')](function(_0x316c10){_0xf915b0['count']=_0x316c10;if(_0x431438[_0x2832('0x32')][_0x2832('0x43')]){_0x150825['include']=[{'all':!![]}];}return db[_0x2832('0x5f')]['findAll'](_0x150825);})['then'](function(_0x20178c){_0xf915b0[_0x2832('0x46')]=_0x20178c;return _0xf915b0;});}})[_0x2832('0x26')](respondWithFilteredResult(_0x3912ea,_0x150825))['catch'](handleError(_0x3912ea,null));};exports['getHopperBlacks']=function(_0x4c6561,_0xa37246,_0x267ddf){var _0x4efd79={'raw':!![],'where':{}};var _0x1a2da9={};var _0x511545={'count':0x0,'rows':[]};return db[_0x2832('0x2e')][_0x2832('0x57')]({'where':{'id':_0x4c6561['params']['id']}})['then'](handleEntityNotFound(_0xa37246,null))[_0x2832('0x26')](function(_0x5c7ddc){if(_0x5c7ddc){_0x1a2da9[_0x2832('0x36')]=_[_0x2832('0x33')](db['CmHopperBlack'][_0x2832('0x2f')]);_0x1a2da9[_0x2832('0x32')]=_['keys'](_0x4c6561['query']);_0x1a2da9[_0x2832('0x34')]=_[_0x2832('0x35')](_0x1a2da9['model'],_0x1a2da9['query']);_0x4efd79['attributes']=_['intersection'](_0x1a2da9['model'],qs[_0x2832('0x37')](_0x4c6561[_0x2832('0x32')]['fields']));_0x4efd79['attributes']=_0x4efd79[_0x2832('0x38')][_0x2832('0x39')]?_0x4efd79[_0x2832('0x38')]:_0x1a2da9[_0x2832('0x36')];if(!_0x4c6561[_0x2832('0x32')][_0x2832('0x3a')](_0x2832('0x3b'))){_0x4efd79[_0x2832('0x1f')]=qs['limit'](_0x4c6561[_0x2832('0x32')][_0x2832('0x1f')]);_0x4efd79[_0x2832('0x1e')]=qs['offset'](_0x4c6561[_0x2832('0x32')][_0x2832('0x1e')]);}_0x4efd79[_0x2832('0x3c')]=qs[_0x2832('0x3d')](_0x4c6561[_0x2832('0x32')]['sort']);_0x4efd79[_0x2832('0x3e')]=qs['filters'](_[_0x2832('0x3f')](_0x4c6561[_0x2832('0x32')],_0x1a2da9[_0x2832('0x34')]));_0x4efd79[_0x2832('0x3e')][_0x2832('0x5c')]=_0x5c7ddc['id'];if(_0x4c6561[_0x2832('0x32')][_0x2832('0x40')]){_0x4efd79[_0x2832('0x3e')]=_['merge'](_0x4efd79['where'],{'$or':_[_0x2832('0x2d')](_0x4efd79[_0x2832('0x38')],function(_0x251f03){var _0x484669={};_0x484669[_0x251f03]={'$like':'%'+_0x4c6561[_0x2832('0x32')][_0x2832('0x40')]+'%'};return _0x484669;})});}_0x4efd79=_[_0x2832('0x41')]({},_0x4efd79,_0x4c6561['options']);return db[_0x2832('0x60')][_0x2832('0x5a')]({'where':_0x4efd79[_0x2832('0x3e')]})[_0x2832('0x26')](function(_0x35748d){_0x511545['count']=_0x35748d;if(_0x4c6561[_0x2832('0x32')][_0x2832('0x43')]){_0x4efd79[_0x2832('0x44')]=[{'all':!![]}];}return db[_0x2832('0x60')][_0x2832('0x45')](_0x4efd79);})[_0x2832('0x26')](function(_0x4e6cf0){_0x511545[_0x2832('0x46')]=_0x4e6cf0;return _0x511545;});}})['then'](respondWithFilteredResult(_0xa37246,_0x4efd79))[_0x2832('0x47')](handleError(_0xa37246,null));};exports[_0x2832('0x61')]=function(_0x25000e,_0x3e86d9,_0x47e809){var _0x3bbd0b={};var _0x232346={};var _0x1e6710;var _0x9de397;return db[_0x2832('0x2e')]['findOne']({'where':{'id':_0x25000e['params']['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x3e86d9,null))[_0x2832('0x26')](function(_0x5eb7a9){if(_0x5eb7a9){_0x1e6710=_0x5eb7a9;_0x232346[_0x2832('0x36')]=_['keys'](db['CmList']['rawAttributes']);_0x232346[_0x2832('0x32')]=_['keys'](_0x25000e[_0x2832('0x32')]);_0x232346[_0x2832('0x34')]=_[_0x2832('0x35')](_0x232346[_0x2832('0x36')],_0x232346[_0x2832('0x32')]);_0x3bbd0b[_0x2832('0x38')]=_[_0x2832('0x35')](_0x232346['model'],qs['fields'](_0x25000e[_0x2832('0x32')][_0x2832('0x37')]));_0x3bbd0b[_0x2832('0x38')]=_0x3bbd0b[_0x2832('0x38')][_0x2832('0x39')]?_0x3bbd0b[_0x2832('0x38')]:_0x232346[_0x2832('0x36')];_0x3bbd0b[_0x2832('0x3c')]=qs[_0x2832('0x3d')](_0x25000e['query']['sort']);_0x3bbd0b[_0x2832('0x3e')]=qs[_0x2832('0x34')](_[_0x2832('0x3f')](_0x25000e[_0x2832('0x32')],_0x232346[_0x2832('0x34')]));if(_0x25000e['query'][_0x2832('0x40')]){_0x3bbd0b[_0x2832('0x3e')]=_[_0x2832('0x41')](_0x3bbd0b[_0x2832('0x3e')],{'$or':_['map'](_0x3bbd0b[_0x2832('0x38')],function(_0x343b79){var _0x25b82b={};_0x25b82b[_0x343b79]={'$like':'%'+_0x25000e['query']['filter']+'%'};return _0x25b82b;})});}_0x3bbd0b=_[_0x2832('0x41')]({},_0x3bbd0b,_0x25000e[_0x2832('0x59')]);return _0x1e6710[_0x2832('0x61')](_0x3bbd0b);}})[_0x2832('0x26')](function(_0x4903c6){if(_0x4903c6){_0x9de397=_0x4903c6[_0x2832('0x39')];if(!_0x25000e[_0x2832('0x32')][_0x2832('0x3a')](_0x2832('0x3b'))){_0x3bbd0b['limit']=qs[_0x2832('0x1f')](_0x25000e[_0x2832('0x32')][_0x2832('0x1f')]);_0x3bbd0b['offset']=qs['offset'](_0x25000e[_0x2832('0x32')][_0x2832('0x1e')]);}return _0x1e6710[_0x2832('0x61')](_0x3bbd0b);}})['then'](function(_0x3448f0){if(_0x3448f0){return _0x3448f0?{'count':_0x9de397,'rows':_0x3448f0}:null;}})['then'](respondWithResult(_0x3e86d9,null))[_0x2832('0x47')](handleError(_0x3e86d9,null));};exports['addLists']=function(_0x26046b,_0x5c66fd,_0x4af7d8){var _0xc66e98,_0xf37a67;var _0x1f082b=[];var _0x28f435=moment()[_0x2832('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x2832('0x2e')]['find']({'where':{'id':_0x26046b[_0x2832('0x48')]['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x5c66fd,null))['then'](function(_0x56eb8f){if(_0x56eb8f){_0xf37a67=_0x56eb8f;return _0x56eb8f[_0x2832('0x63')](_0x26046b[_0x2832('0x4a')][_0x2832('0x64')],_['omit'](_0x26046b[_0x2832('0x4a')],[_0x2832('0x64'),'id'])||{});}return null;})[_0x2832('0x65')](function(_0x3c7864){var _0x2eb9a9;var _0x1958f2;_0xc66e98=_0x3c7864||[];var _0x2441c0=[];if(_0x3c7864){for(var _0x22bd5c=0x0;_0x22bd5c<_0x3c7864[_0x2832('0x39')];_0x22bd5c+=0x1){var _0x471b58=_0x3c7864[_0x22bd5c]['get']({'plain':!![]});_0xf37a67[_0x2832('0x66')]=_0x26046b[_0x2832('0x4a')][_0x2832('0x66')]?_0x26046b[_0x2832('0x4a')][_0x2832('0x66')]:_0xf37a67['dialCheckDuplicateType'];switch(_0xf37a67[_0x2832('0x66')]){case _0x2832('0x67'):_0x2eb9a9=squel['insert']()[_0x2832('0x68')](_0x2832('0x69'))['fromQuery']([_0x2832('0x6a'),_0x2832('0x6b'),'ContactId',_0x2832('0x6c'),_0x2832('0x5c'),_0x2832('0x53'),'updatedAt'],squel[_0x2832('0x6d')]()['field'](_0x2832('0x6a'),_0x2832('0x6a'))[_0x2832('0x6e')](_0x2832('0x6f'),'scheduledAt')['field']('id','ContactId')[_0x2832('0x6e')](_0x471b58[_0x2832('0x70')][_0x2832('0x71')](),'ListId')['field'](_0x26046b[_0x2832('0x48')]['id'][_0x2832('0x71')](),_0x2832('0x5c'))['field']('\x27'+_0x28f435+'\x27',_0x2832('0x53'))['field']('\x27'+_0x28f435+'\x27',_0x2832('0x54'))['from'](_0x2832('0x72'))['where'](_0x2832('0x73'))['where'](_0x2832('0x74'),_0x471b58[_0x2832('0x70')][_0x2832('0x71')]())[_0x2832('0x3e')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x2832('0x6d')]()[_0x2832('0x6e')](_0x2832('0x75'))['from']('cm_hopper_final')['where'](_0x2832('0x76'),_0x26046b[_0x2832('0x48')]['id'][_0x2832('0x71')]()))[_0x2832('0x3e')](_0x2832('0x77'),squel[_0x2832('0x6d')]()[_0x2832('0x6e')](_0x2832('0x78'))[_0x2832('0x79')](_0x2832('0x69'))['where'](_0x2832('0x76'),_0x26046b[_0x2832('0x48')]['id'][_0x2832('0x71')]())))[_0x2832('0x71')]();break;case _0x2832('0x7a'):_0x2eb9a9=squel['insert']()[_0x2832('0x68')](_0x2832('0x69'))['fromQuery']([_0x2832('0x6a'),_0x2832('0x6b'),'ContactId',_0x2832('0x6c'),_0x2832('0x5c'),_0x2832('0x53'),_0x2832('0x54')],squel['select']()[_0x2832('0x6e')](_0x2832('0x6a'),'phone')[_0x2832('0x6e')](_0x2832('0x6f'),_0x2832('0x6b'))[_0x2832('0x6e')]('id','ContactId')['field'](_0x471b58['CmListId'][_0x2832('0x71')](),'ListId')[_0x2832('0x6e')](_0x26046b[_0x2832('0x48')]['id'][_0x2832('0x71')](),_0x2832('0x5c'))[_0x2832('0x6e')]('\x27'+_0x28f435+'\x27',_0x2832('0x53'))['field']('\x27'+_0x28f435+'\x27','updatedAt')[_0x2832('0x79')](_0x2832('0x72'))[_0x2832('0x3e')]('deletedAt\x20IS\x20NULL')[_0x2832('0x3e')](_0x2832('0x74'),_0x471b58['CmListId'][_0x2832('0x71')]())[_0x2832('0x3e')](_0x2832('0x7b'))[_0x2832('0x3e')](_0x2832('0x77'),squel[_0x2832('0x6d')]()[_0x2832('0x6e')]('COALESCE(phone,\x27\x27)')[_0x2832('0x79')](_0x2832('0x69'))[_0x2832('0x3e')](_0x2832('0x76'),_0x26046b[_0x2832('0x48')]['id'][_0x2832('0x71')]())))[_0x2832('0x71')]();break;default:_0x2eb9a9=squel[_0x2832('0x7c')]()[_0x2832('0x68')](_0x2832('0x69'))['fromQuery'](['phone','scheduledAt',_0x2832('0x7d'),_0x2832('0x6c'),'CampaignId',_0x2832('0x53'),_0x2832('0x54')],squel[_0x2832('0x6d')]()['field'](_0x2832('0x6a'),'phone')[_0x2832('0x6e')](_0x2832('0x6f'),_0x2832('0x6b'))[_0x2832('0x6e')]('id',_0x2832('0x7d'))['field'](_0x471b58[_0x2832('0x70')][_0x2832('0x71')](),'ListId')['field'](_0x26046b[_0x2832('0x48')]['id'][_0x2832('0x71')](),_0x2832('0x5c'))[_0x2832('0x6e')]('\x27'+_0x28f435+'\x27','createdAt')[_0x2832('0x6e')]('\x27'+_0x28f435+'\x27',_0x2832('0x54'))[_0x2832('0x79')](_0x2832('0x72'))[_0x2832('0x3e')](_0x2832('0x73'))[_0x2832('0x3e')](_0x2832('0x74'),_0x471b58[_0x2832('0x70')][_0x2832('0x71')]())[_0x2832('0x3e')](_0x2832('0x7b')))[_0x2832('0x71')]();}_0x1958f2=squel[_0x2832('0x7c')]()['into'](_0x2832('0x7e'))[_0x2832('0x7f')]([_0x2832('0x80'),_0x2832('0x6b'),'phone',_0x2832('0x81'),_0x2832('0x53'),'updatedAt'],squel[_0x2832('0x6d')]()[_0x2832('0x6e')]('h.id','id')[_0x2832('0x6e')]('NOW()',_0x2832('0x6b'))[_0x2832('0x6e')](_0x2832('0x82'),'phone')[_0x2832('0x6e')](_0x2832('0x83'),_0x2832('0x81'))[_0x2832('0x6e')]('\x27'+_0x28f435+'\x27',_0x2832('0x53'))[_0x2832('0x6e')]('\x27'+_0x28f435+'\x27',_0x2832('0x54'))[_0x2832('0x79')](_0x2832('0x84'),'ci')[_0x2832('0x85')](_0x2832('0x69'),'h',_0x2832('0x86'))['where']('h.ListId\x20=\x20?',_0x471b58[_0x2832('0x70')]['toString']())[_0x2832('0x3e')](_0x2832('0x87'),_0x26046b[_0x2832('0x48')]['id'][_0x2832('0x71')]())[_0x2832('0x3e')](_0x2832('0x88'),_0x28f435))[_0x2832('0x71')]();_0x2441c0[_0x2832('0x89')](db[_0x2832('0x8a')]['query'](_0x2eb9a9));_0x1f082b[_0x2832('0x89')](db[_0x2832('0x8a')]['query'](_0x1958f2));}return BPromise[_0x2832('0x8b')](_0x2441c0);}})['then'](function(){return BPromise['all'](_0x1f082b);})['then'](function(){return _0xc66e98;})[_0x2832('0x26')](respondWithResult(_0x5c66fd,null))[_0x2832('0x47')](handleError(_0x5c66fd,null));};exports['removeLists']=function(_0x55032a,_0x2da7ee,_0x275135){return db[_0x2832('0x2e')][_0x2832('0x4e')]({'where':{'id':_0x55032a['params']['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x2da7ee,null))[_0x2832('0x26')](function(_0x5c56b2){if(_0x5c56b2){return _0x5c56b2['removeLists'](_0x55032a[_0x2832('0x32')]['ids']);}})[_0x2832('0x26')](function(_0x4c3932){if(_0x4c3932){return db[_0x2832('0x58')][_0x2832('0x27')]({'where':{'ListId':_0x55032a[_0x2832('0x32')][_0x2832('0x64')],'CampaignId':_0x55032a[_0x2832('0x48')]['id']}})[_0x2832('0x26')](function(){return _0x4c3932;});}})[_0x2832('0x26')](respondWithStatusCode(_0x2da7ee,null))[_0x2832('0x47')](handleError(_0x2da7ee,null));};exports[_0x2832('0x8c')]=function(_0x35a686,_0x58d63a,_0x3f89e4){var _0x14a5de={};var _0x1a298a={};var _0x21b2d1;var _0x17b50f;return db[_0x2832('0x2e')][_0x2832('0x57')]({'where':{'id':_0x35a686[_0x2832('0x48')]['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x58d63a,null))['then'](function(_0x25ef86){if(_0x25ef86){_0x21b2d1=_0x25ef86;_0x1a298a[_0x2832('0x36')]=_[_0x2832('0x33')](db['CmList'][_0x2832('0x2f')]);_0x1a298a[_0x2832('0x32')]=_['keys'](_0x35a686[_0x2832('0x32')]);_0x1a298a[_0x2832('0x34')]=_['intersection'](_0x1a298a['model'],_0x1a298a['query']);_0x14a5de['attributes']=_[_0x2832('0x35')](_0x1a298a[_0x2832('0x36')],qs[_0x2832('0x37')](_0x35a686['query'][_0x2832('0x37')]));_0x14a5de[_0x2832('0x38')]=_0x14a5de[_0x2832('0x38')][_0x2832('0x39')]?_0x14a5de['attributes']:_0x1a298a[_0x2832('0x36')];_0x14a5de[_0x2832('0x3c')]=qs[_0x2832('0x3d')](_0x35a686[_0x2832('0x32')]['sort']);_0x14a5de[_0x2832('0x3e')]=qs[_0x2832('0x34')](_[_0x2832('0x3f')](_0x35a686['query'],_0x1a298a[_0x2832('0x34')]));if(_0x35a686[_0x2832('0x32')][_0x2832('0x40')]){_0x14a5de[_0x2832('0x3e')]=_['merge'](_0x14a5de[_0x2832('0x3e')],{'$or':_[_0x2832('0x2d')](_0x14a5de[_0x2832('0x38')],function(_0x5348de){var _0x31b941={};_0x31b941[_0x5348de]={'$like':'%'+_0x35a686['query'][_0x2832('0x40')]+'%'};return _0x31b941;})});}_0x14a5de=_[_0x2832('0x41')]({},_0x14a5de,_0x35a686[_0x2832('0x59')]);return _0x21b2d1['getBlackLists'](_0x14a5de);}})[_0x2832('0x26')](function(_0x480834){if(_0x480834){_0x17b50f=_0x480834[_0x2832('0x39')];if(!_0x35a686[_0x2832('0x32')]['hasOwnProperty']('nolimit')){_0x14a5de[_0x2832('0x1f')]=qs['limit'](_0x35a686['query'][_0x2832('0x1f')]);_0x14a5de['offset']=qs[_0x2832('0x1e')](_0x35a686[_0x2832('0x32')]['offset']);}return _0x21b2d1[_0x2832('0x8c')](_0x14a5de);}})['then'](function(_0xf2e412){if(_0xf2e412){return _0xf2e412?{'count':_0x17b50f,'rows':_0xf2e412}:null;}})['then'](respondWithResult(_0x58d63a,null))['catch'](handleError(_0x58d63a,null));};exports[_0x2832('0x8d')]=function(_0x330a33,_0x35fe1f,_0x415a1f){var _0x1c11a6,_0x4463ab;var _0x5d342e=[];var _0x16bde5=moment()['format'](_0x2832('0x8e'));return db[_0x2832('0x2e')][_0x2832('0x4e')]({'where':{'id':_0x330a33[_0x2832('0x48')]['id']}})['then'](handleEntityNotFound(_0x35fe1f,null))[_0x2832('0x26')](function(_0x4529a0){if(_0x4529a0){_0x4463ab=_0x4529a0;return _0x4529a0['addBlackLists'](_0x330a33[_0x2832('0x4a')][_0x2832('0x64')],_[_0x2832('0x52')](_0x330a33[_0x2832('0x4a')],['ids','id'])||{});}return null;})[_0x2832('0x65')](function(_0x5da40f){var _0x3cdd31;var _0xd44100;_0x1c11a6=_0x5da40f||[];var _0x555213=[];if(_0x5da40f){for(var _0x2b3648=0x0;_0x2b3648<_0x5da40f[_0x2832('0x39')];_0x2b3648+=0x1){var _0x14172d=_0x5da40f[_0x2b3648]['get']({'plain':!![]});_0x3cdd31=squel[_0x2832('0x7c')]()[_0x2832('0x68')](_0x2832('0x8f'))['fromQuery']([_0x2832('0x6a'),_0x2832('0x7d'),'ListId','CampaignId',_0x2832('0x53'),_0x2832('0x54')],squel[_0x2832('0x6d')]()[_0x2832('0x6e')]('phone',_0x2832('0x6a'))['field']('id',_0x2832('0x7d'))[_0x2832('0x6e')](_0x14172d['CmListId'][_0x2832('0x71')](),_0x2832('0x6c'))[_0x2832('0x6e')](_0x330a33[_0x2832('0x48')]['id'][_0x2832('0x71')](),_0x2832('0x5c'))['field']('NOW()',_0x2832('0x53'))[_0x2832('0x6e')](_0x2832('0x6f'),'updatedAt')[_0x2832('0x79')](_0x2832('0x72'))['where'](_0x2832('0x73'))[_0x2832('0x3e')]('ListId\x20=\x20?',_0x14172d[_0x2832('0x70')]['toString']())[_0x2832('0x3e')](_0x2832('0x7b')))['toString']();_0x555213[_0x2832('0x89')](db['sequelize'][_0x2832('0x32')](_0x3cdd31));}return BPromise[_0x2832('0x8b')](_0x555213);}})['then'](function(){return _0x1c11a6;})[_0x2832('0x26')](respondWithResult(_0x35fe1f,null))['catch'](handleError(_0x35fe1f,null));};exports['removeBlackLists']=function(_0x7151b3,_0x44ec34,_0x9b2fc4){return db[_0x2832('0x2e')][_0x2832('0x4e')]({'where':{'id':_0x7151b3[_0x2832('0x48')]['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x44ec34,null))['then'](function(_0x50f35b){if(_0x50f35b){return _0x50f35b[_0x2832('0x90')](_0x7151b3[_0x2832('0x32')][_0x2832('0x64')]);}})['then'](function(_0x5b6280){if(_0x5b6280){return db[_0x2832('0x60')][_0x2832('0x27')]({'where':{'ListId':_0x7151b3[_0x2832('0x32')]['ids'],'CampaignId':_0x7151b3[_0x2832('0x48')]['id']}})[_0x2832('0x26')](function(){return _0x5b6280;});}})[_0x2832('0x26')](respondWithStatusCode(_0x44ec34,null))[_0x2832('0x47')](handleError(_0x44ec34,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index ce3418d..481ae88 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(_0x4d1f59,_0x4483ec){var _0x468441=function(_0x183185){while(--_0x183185){_0x4d1f59['push'](_0x4d1f59['shift']());}};_0x468441(++_0x4483ec);}(_0x7a54,0x106));var _0x47a5=function(_0x412a12,_0x430906){_0x412a12=_0x412a12-0x0;var _0x18946e=_0x7a54[_0x412a12];return _0x18946e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index c8ed0f3..d691a7e 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 _0x7119=['limit','include','model','map','GetCampaign','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Campaign','options','raw','attributes'];(function(_0x592007,_0x522e94){var _0x2c8434=function(_0x2e98c1){while(--_0x2e98c1){_0x592007['push'](_0x592007['shift']());}};_0x2c8434(++_0x522e94);}(_0x7119,0x1c7));var _0x9711=function(_0x64a51,_0x1c61b7){_0x64a51=_0x64a51-0x0;var _0x1eba45=_0x7119[_0x64a51];return _0x1eba45;};'use strict';var _=require('lodash');var util=require(_0x9711('0x0'));var moment=require('moment');var BPromise=require(_0x9711('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9711('0x2'));var db=require(_0x9711('0x3'))['db'];var utils=require(_0x9711('0x4'));var logger=require(_0x9711('0x5'))('rpc');var config=require(_0x9711('0x6'));var jayson=require(_0x9711('0x7'));var client=jayson[_0x9711('0x8')][_0x9711('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x191701,_0x4c75dd,_0x31af88){return new BPromise(function(_0x3a5f79,_0x132b5b){return client['request'](_0x191701,_0x31af88)[_0x9711('0xa')](function(_0x4b13b9){logger[_0x9711('0xb')](_0x9711('0xc'),_0x4c75dd,_0x9711('0xd'));logger['debug'](_0x9711('0xe'),_0x4c75dd,_0x9711('0xd'),JSON[_0x9711('0xf')](_0x4b13b9));if(_0x4b13b9[_0x9711('0x10')]){if(_0x4b13b9[_0x9711('0x10')][_0x9711('0x11')]===0x1f4){logger[_0x9711('0x10')](_0x9711('0xc'),_0x4c75dd,_0x4b13b9[_0x9711('0x10')][_0x9711('0x12')]);return _0x132b5b(_0x4b13b9[_0x9711('0x10')]['message']);}logger['error'](_0x9711('0xc'),_0x4c75dd,_0x4b13b9[_0x9711('0x10')][_0x9711('0x12')]);return _0x3a5f79(_0x4b13b9[_0x9711('0x10')][_0x9711('0x12')]);}else{logger['info'](_0x9711('0xc'),_0x4c75dd,'request\x20sent');_0x3a5f79(_0x4b13b9[_0x9711('0x13')][_0x9711('0x12')]);}})[_0x9711('0x14')](function(_0x640894){logger[_0x9711('0x10')]('Campaign,\x20%s,\x20%s',_0x4c75dd,_0x640894);_0x132b5b(_0x640894);});});}exports['GetCampaign']=function(_0x2ef16c){var _0x3615c9=this;return new Promise(function(_0x210f8b,_0x4629e2){return db[_0x9711('0x15')]['findAll']({'raw':_0x2ef16c[_0x9711('0x16')]?_0x2ef16c[_0x9711('0x16')][_0x9711('0x17')]===undefined?!![]:![]:!![],'where':_0x2ef16c[_0x9711('0x16')]?_0x2ef16c['options']['where']||null:null,'attributes':_0x2ef16c['options']?_0x2ef16c[_0x9711('0x16')][_0x9711('0x18')]||null:null,'limit':_0x2ef16c[_0x9711('0x16')]?_0x2ef16c['options'][_0x9711('0x19')]||null:null,'include':_0x2ef16c[_0x9711('0x16')]?_0x2ef16c['options'][_0x9711('0x1a')]?_['map'](_0x2ef16c[_0x9711('0x16')]['include'],function(_0x3023cf){return{'model':db[_0x3023cf[_0x9711('0x1b')]],'as':_0x3023cf['as'],'attributes':_0x3023cf['attributes'],'include':_0x3023cf[_0x9711('0x1a')]?_[_0x9711('0x1c')](_0x3023cf[_0x9711('0x1a')],function(_0x2db327){return{'model':db[_0x2db327['model']],'as':_0x2db327['as'],'attributes':_0x2db327['attributes'],'include':_0x2db327[_0x9711('0x1a')]?_[_0x9711('0x1c')](_0x2db327['include'],function(_0x4d16e5){return{'model':db[_0x4d16e5['model']],'as':_0x4d16e5['as'],'attributes':_0x4d16e5['attributes']};}):[]};}):[]};}):[]:[]})[_0x9711('0xa')](function(_0x270da2){logger['info'](_0x9711('0x1d'),_0x2ef16c);logger['debug'](_0x9711('0x1d'),_0x2ef16c,JSON[_0x9711('0xf')](_0x270da2));_0x210f8b(_0x270da2);})['catch'](function(_0x3fc5bb){logger[_0x9711('0x10')](_0x9711('0x1d'),_0x3fc5bb[_0x9711('0x12')],_0x2ef16c);_0x4629e2(_0x3615c9['error'](0x1f4,_0x3fc5bb[_0x9711('0x12')]));});});};
\ No newline at end of file
+var _0xc7e9=['error','code','message','info','result','catch','GetCampaign','Campaign','findAll','options','attributes','include','map','model','debug','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3a544a,_0x73a217){var _0x342f1e=function(_0x519dce){while(--_0x519dce){_0x3a544a['push'](_0x3a544a['shift']());}};_0x342f1e(++_0x73a217);}(_0xc7e9,0x1ef));var _0x9c7e=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xc7e9[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x9c7e('0x0'));var util=require(_0x9c7e('0x1'));var moment=require('moment');var BPromise=require(_0x9c7e('0x2'));var rs=require(_0x9c7e('0x3'));var fs=require('fs');var Redis=require(_0x9c7e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c7e('0x5'));var logger=require(_0x9c7e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9c7e('0x7'));var client=jayson['client'][_0x9c7e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c96a9,_0x15399d,_0x39b04b){return new BPromise(function(_0x54e2c6,_0x2f97c0){return client[_0x9c7e('0x9')](_0x2c96a9,_0x39b04b)[_0x9c7e('0xa')](function(_0x21f6fe){logger['info'](_0x9c7e('0xb'),_0x15399d,_0x9c7e('0xc'));logger['debug'](_0x9c7e('0xd'),_0x15399d,'request\x20sent',JSON[_0x9c7e('0xe')](_0x21f6fe));if(_0x21f6fe[_0x9c7e('0xf')]){if(_0x21f6fe['error'][_0x9c7e('0x10')]===0x1f4){logger['error'](_0x9c7e('0xb'),_0x15399d,_0x21f6fe[_0x9c7e('0xf')][_0x9c7e('0x11')]);return _0x2f97c0(_0x21f6fe[_0x9c7e('0xf')][_0x9c7e('0x11')]);}logger['error'](_0x9c7e('0xb'),_0x15399d,_0x21f6fe[_0x9c7e('0xf')][_0x9c7e('0x11')]);return _0x54e2c6(_0x21f6fe[_0x9c7e('0xf')][_0x9c7e('0x11')]);}else{logger[_0x9c7e('0x12')]('Campaign,\x20%s,\x20%s',_0x15399d,_0x9c7e('0xc'));_0x54e2c6(_0x21f6fe[_0x9c7e('0x13')][_0x9c7e('0x11')]);}})[_0x9c7e('0x14')](function(_0x26871f){logger['error'](_0x9c7e('0xb'),_0x15399d,_0x26871f);_0x2f97c0(_0x26871f);});});}exports[_0x9c7e('0x15')]=function(_0x5af216){var _0x164412=this;return new Promise(function(_0x26dd66,_0x15d639){return db[_0x9c7e('0x16')][_0x9c7e('0x17')]({'raw':_0x5af216['options']?_0x5af216[_0x9c7e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5af216[_0x9c7e('0x18')]?_0x5af216['options']['where']||null:null,'attributes':_0x5af216[_0x9c7e('0x18')]?_0x5af216[_0x9c7e('0x18')][_0x9c7e('0x19')]||null:null,'limit':_0x5af216[_0x9c7e('0x18')]?_0x5af216[_0x9c7e('0x18')]['limit']||null:null,'include':_0x5af216[_0x9c7e('0x18')]?_0x5af216[_0x9c7e('0x18')][_0x9c7e('0x1a')]?_[_0x9c7e('0x1b')](_0x5af216[_0x9c7e('0x18')][_0x9c7e('0x1a')],function(_0x376e0c){return{'model':db[_0x376e0c[_0x9c7e('0x1c')]],'as':_0x376e0c['as'],'attributes':_0x376e0c[_0x9c7e('0x19')],'include':_0x376e0c[_0x9c7e('0x1a')]?_[_0x9c7e('0x1b')](_0x376e0c[_0x9c7e('0x1a')],function(_0x4a8a46){return{'model':db[_0x4a8a46[_0x9c7e('0x1c')]],'as':_0x4a8a46['as'],'attributes':_0x4a8a46[_0x9c7e('0x19')],'include':_0x4a8a46[_0x9c7e('0x1a')]?_[_0x9c7e('0x1b')](_0x4a8a46[_0x9c7e('0x1a')],function(_0x224056){return{'model':db[_0x224056['model']],'as':_0x224056['as'],'attributes':_0x224056['attributes']};}):[]};}):[]};}):[]:[]})[_0x9c7e('0xa')](function(_0x46cfe0){logger[_0x9c7e('0x12')](_0x9c7e('0x15'),_0x5af216);logger[_0x9c7e('0x1d')](_0x9c7e('0x15'),_0x5af216,JSON[_0x9c7e('0xe')](_0x46cfe0));_0x26dd66(_0x46cfe0);})[_0x9c7e('0x14')](function(_0x531544){logger[_0x9c7e('0xf')]('GetCampaign',_0x531544[_0x9c7e('0x11')],_0x5af216);_0x15d639(_0x164412['error'](0x1f4,_0x531544['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 080bc7a..1cc03c3 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 _0xb7ef=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getLists','post','create','/:id/clone','clone','/:id/lists','addLists','/:id/blacklists','delete','destroy','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router'];(function(_0x157db1,_0x5652bf){var _0x169249=function(_0x463401){while(--_0x463401){_0x157db1['push'](_0x157db1['shift']());}};_0x169249(++_0x5652bf);}(_0xb7ef,0x1ac));var _0xfb7e=function(_0x3717a9,_0x17f9bc){_0x3717a9=_0x3717a9-0x0;var _0x485b85=_0xb7ef[_0x3717a9];return _0x485b85;};'use strict';var multer=require(_0xfb7e('0x0'));var util=require(_0xfb7e('0x1'));var path=require(_0xfb7e('0x2'));var timeout=require(_0xfb7e('0x3'));var express=require(_0xfb7e('0x4'));var router=express[_0xfb7e('0x5')]();var fs_extra=require(_0xfb7e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfb7e('0x7'));var config=require(_0xfb7e('0x8'));var controller=require('./campaign.controller');router[_0xfb7e('0x9')]('/',auth[_0xfb7e('0xa')](),controller[_0xfb7e('0xb')]);router[_0xfb7e('0x9')](_0xfb7e('0xc'),auth[_0xfb7e('0xa')](),controller['show']);router[_0xfb7e('0x9')](_0xfb7e('0xd'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0xe')]);router[_0xfb7e('0x9')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0xfb7e('0xf')]);router[_0xfb7e('0x9')](_0xfb7e('0x10'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x11')]);router['get']('/:id/hopper_black',auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x12')]);router[_0xfb7e('0x9')]('/:id/lists',auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x13')]);router[_0xfb7e('0x9')]('/:id/blacklists',auth[_0xfb7e('0xa')](),controller['getBlackLists']);router[_0xfb7e('0x14')]('/',auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x15')]);router[_0xfb7e('0x14')](_0xfb7e('0x16'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x17')]);router[_0xfb7e('0x14')](_0xfb7e('0x18'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x19')]);router[_0xfb7e('0x14')](_0xfb7e('0x1a'),auth[_0xfb7e('0xa')](),controller['addBlackLists']);router['put'](_0xfb7e('0xc'),auth[_0xfb7e('0xa')](),controller['update']);router[_0xfb7e('0x1b')](_0xfb7e('0xc'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x1c')]);router[_0xfb7e('0x1b')](_0xfb7e('0x18'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x1d')]);router['delete'](_0xfb7e('0x1a'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0x3fa4=['addLists','addBlackLists','put','delete','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone'];(function(_0x3020cd,_0x1353ec){var _0x57e0aa=function(_0x4172f9){while(--_0x4172f9){_0x3020cd['push'](_0x3020cd['shift']());}};_0x57e0aa(++_0x1353ec);}(_0x3fa4,0x87));var _0x43fa=function(_0x49d427,_0x4a4ef8){_0x49d427=_0x49d427-0x0;var _0x319910=_0x3fa4[_0x49d427];return _0x319910;};'use strict';var multer=require('multer');var util=require(_0x43fa('0x0'));var path=require(_0x43fa('0x1'));var timeout=require(_0x43fa('0x2'));var express=require(_0x43fa('0x3'));var router=express[_0x43fa('0x4')]();var fs_extra=require(_0x43fa('0x5'));var auth=require(_0x43fa('0x6'));var interaction=require(_0x43fa('0x7'));var config=require(_0x43fa('0x8'));var controller=require(_0x43fa('0x9'));router[_0x43fa('0xa')]('/',auth[_0x43fa('0xb')](),controller['index']);router[_0x43fa('0xa')](_0x43fa('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x43fa('0xd'),auth[_0x43fa('0xb')](),controller[_0x43fa('0xe')]);router[_0x43fa('0xa')](_0x43fa('0xf'),auth[_0x43fa('0xb')](),controller['getHopperHistories']);router[_0x43fa('0xa')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x43fa('0x10')]);router[_0x43fa('0xa')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x43fa('0x11')]);router[_0x43fa('0xa')](_0x43fa('0x12'),auth[_0x43fa('0xb')](),controller[_0x43fa('0x13')]);router[_0x43fa('0xa')](_0x43fa('0x14'),auth[_0x43fa('0xb')](),controller[_0x43fa('0x15')]);router[_0x43fa('0x16')]('/',auth[_0x43fa('0xb')](),controller['create']);router[_0x43fa('0x16')](_0x43fa('0x17'),auth[_0x43fa('0xb')](),controller[_0x43fa('0x18')]);router[_0x43fa('0x16')](_0x43fa('0x12'),auth['isAuthenticated'](),controller[_0x43fa('0x19')]);router[_0x43fa('0x16')](_0x43fa('0x14'),auth[_0x43fa('0xb')](),controller[_0x43fa('0x1a')]);router[_0x43fa('0x1b')](_0x43fa('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43fa('0x1c')](_0x43fa('0xc'),auth[_0x43fa('0xb')](),controller['destroy']);router['delete']('/:id/lists',auth[_0x43fa('0xb')](),controller[_0x43fa('0x1d')]);router[_0x43fa('0x1c')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x43fa('0x1e')]);module[_0x43fa('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 492a4bb..672111a 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 _0x6248=['STRING','VIRTUAL','key','sequelize','TEXT','medium'];(function(_0x598f75,_0x318fbe){var _0x2351c1=function(_0x12f0b0){while(--_0x12f0b0){_0x598f75['push'](_0x598f75['shift']());}};_0x2351c1(++_0x318fbe);}(_0x6248,0x10b));var _0x8624=function(_0x562eca,_0x3fa3b3){_0x562eca=_0x562eca-0x0;var _0x189dc3=_0x6248[_0x562eca];return _0x189dc3;};'use strict';var Sequelize=require(_0x8624('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x8624('0x1')],'length':_0x8624('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x8624('0x3')]},'name':{'type':Sequelize[_0x8624('0x4')],'get':function(){return this['getDataValue'](_0x8624('0x5'));}}};
\ No newline at end of file
+var _0x2273=['key','sequelize','STRING','TEXT','VIRTUAL'];(function(_0x3ca825,_0x47905a){var _0x89f1ca=function(_0x358b32){while(--_0x358b32){_0x3ca825['push'](_0x3ca825['shift']());}};_0x89f1ca(++_0x47905a);}(_0x2273,0xec));var _0x3227=function(_0x2bd20a,_0x1a9924){_0x2bd20a=_0x2bd20a-0x0;var _0x373500=_0x2273[_0x2bd20a];return _0x373500;};'use strict';var Sequelize=require(_0x3227('0x0'));module['exports']={'key':{'type':Sequelize[_0x3227('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x3227('0x2')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x3227('0x1')]},'name':{'type':Sequelize[_0x3227('0x3')],'get':function(){return this['getDataValue'](_0x3227('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 9777d53..af15577 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 _0xa7b4=['key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','CannedAnswers','error','stack','name','send','index','map','CannedAnswer','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','includeAll','include','rows','catch','show','rawAttributes','options','find','body','params','create'];(function(_0x7179ba,_0x37504f){var _0x4ad820=function(_0x131107){while(--_0x131107){_0x7179ba['push'](_0x7179ba['shift']());}};_0x4ad820(++_0x37504f);}(_0xa7b4,0xc9));var _0x4a7b=function(_0x1716c1,_0x4f3a3b){_0x1716c1=_0x1716c1-0x0;var _0x1ca528=_0xa7b4[_0x1716c1];return _0x1ca528;};'use strict';var emlformat=require(_0x4a7b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a7b('0x1'));var jsonpatch=require(_0x4a7b('0x2'));var rp=require(_0x4a7b('0x3'));var moment=require(_0x4a7b('0x4'));var BPromise=require(_0x4a7b('0x5'));var Mustache=require('mustache');var util=require(_0x4a7b('0x6'));var path=require(_0x4a7b('0x7'));var sox=require(_0x4a7b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a7b('0x9'));var squel=require(_0x4a7b('0xa'));var crypto=require('crypto');var jsforce=require(_0x4a7b('0xb'));var deskjs=require(_0x4a7b('0xc'));var toCsv=require(_0x4a7b('0xd'));var querystring=require(_0x4a7b('0xe'));var Papa=require(_0x4a7b('0xf'));var Redis=require(_0x4a7b('0x10'));var authService=require(_0x4a7b('0x11'));var qs=require(_0x4a7b('0x12'));var as=require(_0x4a7b('0x13'));var hardwareService=require(_0x4a7b('0x14'));var logger=require(_0x4a7b('0x15'))(_0x4a7b('0x16'));var utils=require(_0x4a7b('0x17'));var config=require(_0x4a7b('0x18'));var licenseUtil=require(_0x4a7b('0x19'));var db=require(_0x4a7b('0x1a'))['db'];function respondWithStatusCode(_0x1b172f,_0x3b33e1){_0x3b33e1=_0x3b33e1||0xcc;return function(_0x50ad78){if(_0x50ad78){return _0x1b172f[_0x4a7b('0x1b')](_0x3b33e1);}return _0x1b172f[_0x4a7b('0x1c')](_0x3b33e1)[_0x4a7b('0x1d')]();};}function respondWithResult(_0x5c7c08,_0x3b5361){_0x3b5361=_0x3b5361||0xc8;return function(_0x5ba39d){if(_0x5ba39d){return _0x5c7c08['status'](_0x3b5361)['json'](_0x5ba39d);}};}function respondWithFilteredResult(_0x4881f3,_0x204fe7){return function(_0x314285){if(_0x314285){var _0x153d70=typeof _0x204fe7[_0x4a7b('0x1e')]===_0x4a7b('0x1f')&&typeof _0x204fe7[_0x4a7b('0x20')]===_0x4a7b('0x1f');var _0x4a3130=_0x314285[_0x4a7b('0x21')];var _0x6d5a08=_0x153d70?0x0:_0x204fe7['offset'];var _0x25caac=_0x153d70?_0x314285[_0x4a7b('0x21')]:_0x204fe7[_0x4a7b('0x1e')]+_0x204fe7[_0x4a7b('0x20')];var _0x192b47;if(_0x25caac>=_0x4a3130){_0x25caac=_0x4a3130;_0x192b47=0xc8;}else{_0x192b47=0xce;}_0x4881f3['status'](_0x192b47);return _0x4881f3[_0x4a7b('0x22')](_0x4a7b('0x23'),_0x6d5a08+'-'+_0x25caac+'/'+_0x4a3130)[_0x4a7b('0x24')](_0x314285);}return null;};}function patchUpdates(_0x49b0fa){return function(_0x5331bb){try{jsonpatch[_0x4a7b('0x25')](_0x5331bb,_0x49b0fa,!![]);}catch(_0x513164){return BPromise['reject'](_0x513164);}return _0x5331bb[_0x4a7b('0x26')]();};}function saveUpdates(_0x2ab5fd,_0x38a81b){return function(_0x29d759){if(_0x29d759){return _0x29d759[_0x4a7b('0x27')](_0x2ab5fd)[_0x4a7b('0x28')](function(_0x4a4f6d){return _0x4a4f6d;});}return null;};}function removeEntity(_0x5c7d4d,_0x1cef0f){return function(_0x415792){if(_0x415792){return _0x415792[_0x4a7b('0x29')]()[_0x4a7b('0x28')](function(){var _0x3465e8=_0x415792[_0x4a7b('0x2a')]({'plain':!![]});var _0x10d99c=_0x4a7b('0x2b');return db['UserProfileResource'][_0x4a7b('0x29')]({'where':{'type':_0x10d99c,'resourceId':_0x3465e8['id']}})[_0x4a7b('0x28')](function(){return _0x415792;});})[_0x4a7b('0x28')](function(){_0x5c7d4d[_0x4a7b('0x1c')](0xcc)[_0x4a7b('0x1d')]();});}};}function handleEntityNotFound(_0x257f47,_0x3168e1){return function(_0x9572f6){if(!_0x9572f6){_0x257f47[_0x4a7b('0x1b')](0x194);}return _0x9572f6;};}function handleError(_0xb0f608,_0x41e82d){_0x41e82d=_0x41e82d||0x1f4;return function(_0x2748ae){logger[_0x4a7b('0x2c')](_0x2748ae[_0x4a7b('0x2d')]);if(_0x2748ae[_0x4a7b('0x2e')]){delete _0x2748ae[_0x4a7b('0x2e')];}_0xb0f608[_0x4a7b('0x1c')](_0x41e82d)[_0x4a7b('0x2f')](_0x2748ae);};}exports[_0x4a7b('0x30')]=function(_0xd41606,_0x424a39){var _0x33d10d={},_0xe6ca22={},_0x5062a1={'count':0x0,'rows':[]};var _0x51bde7=_[_0x4a7b('0x31')](db[_0x4a7b('0x32')]['rawAttributes'],function(_0x3745b6){return{'name':_0x3745b6['fieldName'],'type':_0x3745b6[_0x4a7b('0x33')]['key']};});_0xe6ca22[_0x4a7b('0x34')]=_['map'](_0x51bde7,_0x4a7b('0x2e'));_0xe6ca22['query']=_[_0x4a7b('0x35')](_0xd41606[_0x4a7b('0x36')]);_0xe6ca22['filters']=_[_0x4a7b('0x37')](_0xe6ca22[_0x4a7b('0x34')],_0xe6ca22[_0x4a7b('0x36')]);_0x33d10d[_0x4a7b('0x38')]=_[_0x4a7b('0x37')](_0xe6ca22[_0x4a7b('0x34')],qs['fields'](_0xd41606['query'][_0x4a7b('0x39')]));_0x33d10d[_0x4a7b('0x38')]=_0x33d10d[_0x4a7b('0x38')][_0x4a7b('0x3a')]?_0x33d10d['attributes']:_0xe6ca22[_0x4a7b('0x34')];if(!_0xd41606[_0x4a7b('0x36')][_0x4a7b('0x3b')](_0x4a7b('0x3c'))){_0x33d10d[_0x4a7b('0x20')]=qs[_0x4a7b('0x20')](_0xd41606[_0x4a7b('0x36')]['limit']);_0x33d10d[_0x4a7b('0x1e')]=qs[_0x4a7b('0x1e')](_0xd41606[_0x4a7b('0x36')][_0x4a7b('0x1e')]);}_0x33d10d[_0x4a7b('0x3d')]=qs['sort'](_0xd41606[_0x4a7b('0x36')]['sort']);_0x33d10d[_0x4a7b('0x3e')]=qs[_0x4a7b('0x3f')](_[_0x4a7b('0x40')](_0xd41606['query'],_0xe6ca22['filters']),_0x51bde7);if(_0xd41606[_0x4a7b('0x36')][_0x4a7b('0x41')]){_0x33d10d[_0x4a7b('0x3e')]=_['merge'](_0x33d10d[_0x4a7b('0x3e')],{'$or':[{'key':{'$like':'%'+_0xd41606['query'][_0x4a7b('0x41')]+'%'}},{'value':{'$like':'%'+_0xd41606[_0x4a7b('0x36')][_0x4a7b('0x41')]+'%'}}]});}_0x33d10d=_[_0x4a7b('0x42')]({},_0x33d10d,_0xd41606['options']);var _0x45f426={'where':_0x33d10d[_0x4a7b('0x3e')]};return db[_0x4a7b('0x32')][_0x4a7b('0x21')](_0x45f426)[_0x4a7b('0x28')](function(_0x131cf5){_0x5062a1[_0x4a7b('0x21')]=_0x131cf5;if(_0xd41606[_0x4a7b('0x36')][_0x4a7b('0x43')]){_0x33d10d[_0x4a7b('0x44')]=[{'all':!![]}];}return db[_0x4a7b('0x32')]['findAll'](_0x33d10d);})['then'](function(_0x2b983d){_0x5062a1[_0x4a7b('0x45')]=_0x2b983d;return _0x5062a1;})[_0x4a7b('0x28')](respondWithFilteredResult(_0x424a39,_0x33d10d))[_0x4a7b('0x46')](handleError(_0x424a39,null));};exports[_0x4a7b('0x47')]=function(_0x461d4e,_0x18d947){var _0x364ba5={'raw':!![],'where':{'id':_0x461d4e['params']['id']}},_0xd7bb25={};_0xd7bb25[_0x4a7b('0x34')]=_[_0x4a7b('0x35')](db['CannedAnswer'][_0x4a7b('0x48')]);_0xd7bb25['query']=_['keys'](_0x461d4e[_0x4a7b('0x36')]);_0xd7bb25[_0x4a7b('0x3f')]=_[_0x4a7b('0x37')](_0xd7bb25[_0x4a7b('0x34')],_0xd7bb25[_0x4a7b('0x36')]);_0x364ba5[_0x4a7b('0x38')]=_[_0x4a7b('0x37')](_0xd7bb25['model'],qs['fields'](_0x461d4e[_0x4a7b('0x36')][_0x4a7b('0x39')]));_0x364ba5['attributes']=_0x364ba5[_0x4a7b('0x38')][_0x4a7b('0x3a')]?_0x364ba5[_0x4a7b('0x38')]:_0xd7bb25[_0x4a7b('0x34')];if(_0x461d4e[_0x4a7b('0x36')][_0x4a7b('0x43')]){_0x364ba5[_0x4a7b('0x44')]=[{'all':!![]}];}_0x364ba5=_[_0x4a7b('0x42')]({},_0x364ba5,_0x461d4e[_0x4a7b('0x49')]);return db[_0x4a7b('0x32')][_0x4a7b('0x4a')](_0x364ba5)[_0x4a7b('0x28')](handleEntityNotFound(_0x18d947,null))[_0x4a7b('0x28')](respondWithResult(_0x18d947,null))[_0x4a7b('0x46')](handleError(_0x18d947,null));};exports['update']=function(_0x208da2,_0x1d818e){if(_0x208da2[_0x4a7b('0x4b')]['id']){delete _0x208da2[_0x4a7b('0x4b')]['id'];}return db[_0x4a7b('0x32')]['find']({'where':{'id':_0x208da2[_0x4a7b('0x4c')]['id']}})[_0x4a7b('0x28')](handleEntityNotFound(_0x1d818e,null))[_0x4a7b('0x28')](saveUpdates(_0x208da2['body'],null))[_0x4a7b('0x28')](respondWithResult(_0x1d818e,null))[_0x4a7b('0x46')](handleError(_0x1d818e,null));};exports[_0x4a7b('0x29')]=function(_0x30bec3,_0x4c6f0e){return db[_0x4a7b('0x32')]['find']({'where':{'id':_0x30bec3[_0x4a7b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4c6f0e,null))[_0x4a7b('0x28')](removeEntity(_0x4c6f0e,null))[_0x4a7b('0x46')](handleError(_0x4c6f0e,null));};exports[_0x4a7b('0x4d')]=function(_0x1b1550,_0x1f5b4e){var _0x52a45f={'key':_0x1b1550['body'][_0x4a7b('0x4e')]};if(_0x1b1550[_0x4a7b('0x4b')][_0x4a7b('0x4f')]){_0x52a45f['MailAccountId']=_0x1b1550[_0x4a7b('0x4b')][_0x4a7b('0x4f')];}else if(_0x1b1550[_0x4a7b('0x4b')]['SmsAccountId']){_0x52a45f['SmsAccountId']=_0x1b1550[_0x4a7b('0x4b')][_0x4a7b('0x50')];}else if(_0x1b1550[_0x4a7b('0x4b')][_0x4a7b('0x51')]){_0x52a45f[_0x4a7b('0x51')]=_0x1b1550[_0x4a7b('0x4b')]['OpenchannelAccountId'];}else if(_0x1b1550[_0x4a7b('0x4b')]['ChatWebsiteId']){_0x52a45f[_0x4a7b('0x52')]=_0x1b1550[_0x4a7b('0x4b')]['ChatWebsiteId'];}return db[_0x4a7b('0x32')][_0x4a7b('0x4a')]({'where':_0x52a45f})['then'](function(_0x1f3427){if(_0x1f3427){throw new db[(_0x4a7b('0x53'))][(_0x4a7b('0x54'))](_0x4a7b('0x55'));}return db[_0x4a7b('0x32')][_0x4a7b('0x4d')](_0x1b1550[_0x4a7b('0x4b')]);})[_0x4a7b('0x28')](function(_0x246e0f){var _0x39811c=_0x1b1550[_0x4a7b('0x56')][_0x4a7b('0x2a')]({'plain':!![]});if(!_0x39811c)throw new Error(_0x4a7b('0x57'));if(_0x39811c['role']===_0x4a7b('0x56')){var _0x32f0fc=_0x246e0f['get']({'plain':!![]});return db[_0x4a7b('0x58')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x39811c[_0x4a7b('0x59')]},'raw':!![]})['then'](function(_0x505b62){if(_0x505b62&&_0x505b62[_0x4a7b('0x5a')]===0x0){return db[_0x4a7b('0x5b')][_0x4a7b('0x4d')]({'name':_0x32f0fc[_0x4a7b('0x2e')],'resourceId':_0x32f0fc['id'],'type':_0x505b62['name'],'sectionId':_0x505b62['id']},{})['then'](function(){return _0x246e0f;});}else{return _0x246e0f;}})[_0x4a7b('0x46')](function(_0x4fa965){logger[_0x4a7b('0x2c')](_0x4a7b('0x5c'),_0x4fa965);throw _0x4fa965;});}return _0x246e0f;})[_0x4a7b('0x28')](respondWithResult(_0x1f5b4e,0xc9))[_0x4a7b('0x46')](handleError(_0x1f5b4e,null));};
\ No newline at end of file
+var _0xaa2e=['catch','show','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','CannedAnswer','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','where','pick','filter','options','includeAll','include','rows'];(function(_0x4b6c62,_0x3a7a89){var _0x377eb6=function(_0x5a1cd6){while(--_0x5a1cd6){_0x4b6c62['push'](_0x4b6c62['shift']());}};_0x377eb6(++_0x3a7a89);}(_0xaa2e,0xc1));var _0xeaa2=function(_0x54fa80,_0x1c2ac9){_0x54fa80=_0x54fa80-0x0;var _0x4c894d=_0xaa2e[_0x54fa80];return _0x4c894d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeaa2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeaa2('0x1'));var BPromise=require(_0xeaa2('0x2'));var Mustache=require(_0xeaa2('0x3'));var util=require(_0xeaa2('0x4'));var path=require('path');var sox=require(_0xeaa2('0x5'));var csv=require(_0xeaa2('0x6'));var ejs=require(_0xeaa2('0x7'));var fs=require('fs');var fs_extra=require(_0xeaa2('0x8'));var _=require(_0xeaa2('0x9'));var squel=require(_0xeaa2('0xa'));var crypto=require('crypto');var jsforce=require(_0xeaa2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xeaa2('0x6'));var querystring=require('querystring');var Papa=require(_0xeaa2('0xc'));var Redis=require(_0xeaa2('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xeaa2('0xe'));var hardwareService=require(_0xeaa2('0xf'));var logger=require(_0xeaa2('0x10'))(_0xeaa2('0x11'));var utils=require(_0xeaa2('0x12'));var config=require(_0xeaa2('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xeaa2('0x14'))['db'];function respondWithStatusCode(_0x42ee49,_0x378a12){_0x378a12=_0x378a12||0xcc;return function(_0x578cfd){if(_0x578cfd){return _0x42ee49[_0xeaa2('0x15')](_0x378a12);}return _0x42ee49[_0xeaa2('0x16')](_0x378a12)[_0xeaa2('0x17')]();};}function respondWithResult(_0x3d2c78,_0x339dea){_0x339dea=_0x339dea||0xc8;return function(_0x54eef6){if(_0x54eef6){return _0x3d2c78[_0xeaa2('0x16')](_0x339dea)[_0xeaa2('0x18')](_0x54eef6);}};}function respondWithFilteredResult(_0x425d4d,_0x1bff0e){return function(_0x316bc5){if(_0x316bc5){var _0x1ad1f7=typeof _0x1bff0e[_0xeaa2('0x19')]==='undefined'&&typeof _0x1bff0e[_0xeaa2('0x1a')]==='undefined';var _0x3b4dd3=_0x316bc5[_0xeaa2('0x1b')];var _0x362794=_0x1ad1f7?0x0:_0x1bff0e['offset'];var _0x23cfe8=_0x1ad1f7?_0x316bc5[_0xeaa2('0x1b')]:_0x1bff0e[_0xeaa2('0x19')]+_0x1bff0e[_0xeaa2('0x1a')];var _0x5f5d30;if(_0x23cfe8>=_0x3b4dd3){_0x23cfe8=_0x3b4dd3;_0x5f5d30=0xc8;}else{_0x5f5d30=0xce;}_0x425d4d[_0xeaa2('0x16')](_0x5f5d30);return _0x425d4d[_0xeaa2('0x1c')](_0xeaa2('0x1d'),_0x362794+'-'+_0x23cfe8+'/'+_0x3b4dd3)[_0xeaa2('0x18')](_0x316bc5);}return null;};}function patchUpdates(_0x3a832a){return function(_0x26c197){try{jsonpatch[_0xeaa2('0x1e')](_0x26c197,_0x3a832a,!![]);}catch(_0x1986b3){return BPromise[_0xeaa2('0x1f')](_0x1986b3);}return _0x26c197[_0xeaa2('0x20')]();};}function saveUpdates(_0x28f166,_0x3ecaa6){return function(_0x4b334b){if(_0x4b334b){return _0x4b334b[_0xeaa2('0x21')](_0x28f166)[_0xeaa2('0x22')](function(_0x4ed7ab){return _0x4ed7ab;});}return null;};}function removeEntity(_0x31b5fc,_0x34c1a7){return function(_0x4a2890){if(_0x4a2890){return _0x4a2890[_0xeaa2('0x23')]()[_0xeaa2('0x22')](function(){var _0x2b18f5=_0x4a2890[_0xeaa2('0x24')]({'plain':!![]});var _0x5df68f='CannedAnswers';return db[_0xeaa2('0x25')][_0xeaa2('0x23')]({'where':{'type':_0x5df68f,'resourceId':_0x2b18f5['id']}})[_0xeaa2('0x22')](function(){return _0x4a2890;});})[_0xeaa2('0x22')](function(){_0x31b5fc['status'](0xcc)[_0xeaa2('0x17')]();});}};}function handleEntityNotFound(_0x2a6309,_0x42ebce){return function(_0x5f4536){if(!_0x5f4536){_0x2a6309[_0xeaa2('0x15')](0x194);}return _0x5f4536;};}function handleError(_0x4e1851,_0x4af6c9){_0x4af6c9=_0x4af6c9||0x1f4;return function(_0x2f5216){logger[_0xeaa2('0x26')](_0x2f5216['stack']);if(_0x2f5216[_0xeaa2('0x27')]){delete _0x2f5216[_0xeaa2('0x27')];}_0x4e1851[_0xeaa2('0x16')](_0x4af6c9)[_0xeaa2('0x28')](_0x2f5216);};}exports['index']=function(_0x1a969d,_0x5230d5){var _0x2959b0={},_0x224bfe={},_0x465a55={'count':0x0,'rows':[]};var _0x24cdaf=_['map'](db[_0xeaa2('0x29')][_0xeaa2('0x2a')],function(_0x1068c7){return{'name':_0x1068c7[_0xeaa2('0x2b')],'type':_0x1068c7[_0xeaa2('0x2c')][_0xeaa2('0x2d')]};});_0x224bfe[_0xeaa2('0x2e')]=_[_0xeaa2('0x2f')](_0x24cdaf,'name');_0x224bfe['query']=_[_0xeaa2('0x30')](_0x1a969d['query']);_0x224bfe[_0xeaa2('0x31')]=_[_0xeaa2('0x32')](_0x224bfe['model'],_0x224bfe['query']);_0x2959b0[_0xeaa2('0x33')]=_['intersection'](_0x224bfe[_0xeaa2('0x2e')],qs[_0xeaa2('0x34')](_0x1a969d['query'][_0xeaa2('0x34')]));_0x2959b0[_0xeaa2('0x33')]=_0x2959b0[_0xeaa2('0x33')][_0xeaa2('0x35')]?_0x2959b0[_0xeaa2('0x33')]:_0x224bfe['model'];if(!_0x1a969d[_0xeaa2('0x36')][_0xeaa2('0x37')](_0xeaa2('0x38'))){_0x2959b0['limit']=qs[_0xeaa2('0x1a')](_0x1a969d['query'][_0xeaa2('0x1a')]);_0x2959b0[_0xeaa2('0x19')]=qs['offset'](_0x1a969d['query'][_0xeaa2('0x19')]);}_0x2959b0[_0xeaa2('0x39')]=qs['sort'](_0x1a969d[_0xeaa2('0x36')]['sort']);_0x2959b0[_0xeaa2('0x3a')]=qs[_0xeaa2('0x31')](_[_0xeaa2('0x3b')](_0x1a969d[_0xeaa2('0x36')],_0x224bfe[_0xeaa2('0x31')]),_0x24cdaf);if(_0x1a969d[_0xeaa2('0x36')][_0xeaa2('0x3c')]){_0x2959b0[_0xeaa2('0x3a')]=_['merge'](_0x2959b0[_0xeaa2('0x3a')],{'$or':[{'key':{'$like':'%'+_0x1a969d[_0xeaa2('0x36')]['filter']+'%'}},{'value':{'$like':'%'+_0x1a969d['query'][_0xeaa2('0x3c')]+'%'}}]});}_0x2959b0=_['merge']({},_0x2959b0,_0x1a969d[_0xeaa2('0x3d')]);var _0x3995bd={'where':_0x2959b0[_0xeaa2('0x3a')]};return db[_0xeaa2('0x29')][_0xeaa2('0x1b')](_0x3995bd)[_0xeaa2('0x22')](function(_0x3360d0){_0x465a55[_0xeaa2('0x1b')]=_0x3360d0;if(_0x1a969d[_0xeaa2('0x36')][_0xeaa2('0x3e')]){_0x2959b0[_0xeaa2('0x3f')]=[{'all':!![]}];}return db[_0xeaa2('0x29')]['findAll'](_0x2959b0);})[_0xeaa2('0x22')](function(_0xa46811){_0x465a55[_0xeaa2('0x40')]=_0xa46811;return _0x465a55;})[_0xeaa2('0x22')](respondWithFilteredResult(_0x5230d5,_0x2959b0))[_0xeaa2('0x41')](handleError(_0x5230d5,null));};exports[_0xeaa2('0x42')]=function(_0x4c4650,_0x5987ec){var _0x44516e={'raw':!![],'where':{'id':_0x4c4650['params']['id']}},_0x53c65d={};_0x53c65d['model']=_[_0xeaa2('0x30')](db['CannedAnswer']['rawAttributes']);_0x53c65d[_0xeaa2('0x36')]=_['keys'](_0x4c4650[_0xeaa2('0x36')]);_0x53c65d[_0xeaa2('0x31')]=_[_0xeaa2('0x32')](_0x53c65d[_0xeaa2('0x2e')],_0x53c65d[_0xeaa2('0x36')]);_0x44516e[_0xeaa2('0x33')]=_['intersection'](_0x53c65d['model'],qs[_0xeaa2('0x34')](_0x4c4650['query'][_0xeaa2('0x34')]));_0x44516e[_0xeaa2('0x33')]=_0x44516e[_0xeaa2('0x33')][_0xeaa2('0x35')]?_0x44516e['attributes']:_0x53c65d[_0xeaa2('0x2e')];if(_0x4c4650['query']['includeAll']){_0x44516e[_0xeaa2('0x3f')]=[{'all':!![]}];}_0x44516e=_['merge']({},_0x44516e,_0x4c4650[_0xeaa2('0x3d')]);return db[_0xeaa2('0x29')]['find'](_0x44516e)[_0xeaa2('0x22')](handleEntityNotFound(_0x5987ec,null))[_0xeaa2('0x22')](respondWithResult(_0x5987ec,null))['catch'](handleError(_0x5987ec,null));};exports[_0xeaa2('0x21')]=function(_0x35e8cf,_0x501b7a){if(_0x35e8cf[_0xeaa2('0x43')]['id']){delete _0x35e8cf['body']['id'];}return db[_0xeaa2('0x29')][_0xeaa2('0x44')]({'where':{'id':_0x35e8cf[_0xeaa2('0x45')]['id']}})[_0xeaa2('0x22')](handleEntityNotFound(_0x501b7a,null))[_0xeaa2('0x22')](saveUpdates(_0x35e8cf['body'],null))[_0xeaa2('0x22')](respondWithResult(_0x501b7a,null))[_0xeaa2('0x41')](handleError(_0x501b7a,null));};exports['destroy']=function(_0x29d710,_0x11f7f8){return db['CannedAnswer'][_0xeaa2('0x44')]({'where':{'id':_0x29d710[_0xeaa2('0x45')]['id']}})['then'](handleEntityNotFound(_0x11f7f8,null))[_0xeaa2('0x22')](removeEntity(_0x11f7f8,null))[_0xeaa2('0x41')](handleError(_0x11f7f8,null));};exports[_0xeaa2('0x46')]=function(_0x40a847,_0x364e42){var _0x44361c={'key':_0x40a847[_0xeaa2('0x43')]['key']};if(_0x40a847[_0xeaa2('0x43')][_0xeaa2('0x47')]){_0x44361c[_0xeaa2('0x47')]=_0x40a847[_0xeaa2('0x43')][_0xeaa2('0x47')];}else if(_0x40a847[_0xeaa2('0x43')]['SmsAccountId']){_0x44361c[_0xeaa2('0x48')]=_0x40a847[_0xeaa2('0x43')][_0xeaa2('0x48')];}else if(_0x40a847[_0xeaa2('0x43')][_0xeaa2('0x49')]){_0x44361c['OpenchannelAccountId']=_0x40a847[_0xeaa2('0x43')][_0xeaa2('0x49')];}else if(_0x40a847[_0xeaa2('0x43')][_0xeaa2('0x4a')]){_0x44361c[_0xeaa2('0x4a')]=_0x40a847[_0xeaa2('0x43')][_0xeaa2('0x4a')];}return db['CannedAnswer']['find']({'where':_0x44361c})[_0xeaa2('0x22')](function(_0x1f484e){if(_0x1f484e){throw new db[(_0xeaa2('0x4b'))][(_0xeaa2('0x4c'))](_0xeaa2('0x4d'));}return db[_0xeaa2('0x29')][_0xeaa2('0x46')](_0x40a847[_0xeaa2('0x43')]);})[_0xeaa2('0x22')](function(_0x912208){var _0x30dd27=_0x40a847[_0xeaa2('0x4e')][_0xeaa2('0x24')]({'plain':!![]});if(!_0x30dd27)throw new Error(_0xeaa2('0x4f'));if(_0x30dd27[_0xeaa2('0x50')]===_0xeaa2('0x4e')){var _0x2d8b1d=_0x912208[_0xeaa2('0x24')]({'plain':!![]});return db[_0xeaa2('0x51')]['find']({'where':{'name':_0xeaa2('0x52'),'userProfileId':_0x30dd27[_0xeaa2('0x53')]},'raw':!![]})['then'](function(_0x54d3d8){if(_0x54d3d8&&_0x54d3d8[_0xeaa2('0x54')]===0x0){return db['UserProfileResource'][_0xeaa2('0x46')]({'name':_0x2d8b1d[_0xeaa2('0x27')],'resourceId':_0x2d8b1d['id'],'type':_0x54d3d8[_0xeaa2('0x27')],'sectionId':_0x54d3d8['id']},{})[_0xeaa2('0x22')](function(){return _0x912208;});}else{return _0x912208;}})[_0xeaa2('0x41')](function(_0x3f6c01){logger['error'](_0xeaa2('0x55'),_0x3f6c01);throw _0x3f6c01;});}return _0x912208;})[_0xeaa2('0x22')](respondWithResult(_0x364e42,0xc9))[_0xeaa2('0x41')](handleError(_0x364e42,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 9a5b990..17d782d 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 _0xee69=['exports','define','CannedAnswer','tools_canned_answers','utf8mb4','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0x149254,_0xafe8da){var _0x249023=function(_0x5d99fd){while(--_0x5d99fd){_0x149254['push'](_0x149254['shift']());}};_0x249023(++_0xafe8da);}(_0xee69,0x91));var _0x9ee6=function(_0x1395e7,_0x1138c2){_0x1395e7=_0x1395e7-0x0;var _0x5d5331=_0xee69[_0x1395e7];return _0x5d5331;};'use strict';var _=require('lodash');var util=require(_0x9ee6('0x0'));var logger=require(_0x9ee6('0x1'))(_0x9ee6('0x2'));var moment=require(_0x9ee6('0x3'));var BPromise=require('bluebird');var rp=require(_0x9ee6('0x4'));var fs=require('fs');var path=require(_0x9ee6('0x5'));var rimraf=require(_0x9ee6('0x6'));var config=require(_0x9ee6('0x7'));var attributes=require(_0x9ee6('0x8'));module[_0x9ee6('0x9')]=function(_0x136381,_0x327327){return _0x136381[_0x9ee6('0xa')](_0x9ee6('0xb'),attributes,{'tableName':_0x9ee6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ee6('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xbbf6=['api','moment','bluebird','path','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x19d2c8,_0x3eaadc){var _0x14805a=function(_0x181afd){while(--_0x181afd){_0x19d2c8['push'](_0x19d2c8['shift']());}};_0x14805a(++_0x3eaadc);}(_0xbbf6,0x143));var _0x6bbf=function(_0x227c85,_0x1f839c){_0x227c85=_0x227c85-0x0;var _0x3de7ca=_0xbbf6[_0x227c85];return _0x3de7ca;};'use strict';var _=require(_0x6bbf('0x0'));var util=require('util');var logger=require(_0x6bbf('0x1'))(_0x6bbf('0x2'));var moment=require(_0x6bbf('0x3'));var BPromise=require(_0x6bbf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6bbf('0x5'));var rimraf=require('rimraf');var config=require(_0x6bbf('0x6'));var attributes=require(_0x6bbf('0x7'));module[_0x6bbf('0x8')]=function(_0x4670a0,_0x37a458){return _0x4670a0[_0x6bbf('0x9')]('CannedAnswer',attributes,{'tableName':_0x6bbf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6bbf('0xb'),'collate':_0x6bbf('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 0e49142..d59e761 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(_0x3ac366,_0x2d6458){var _0x195225=function(_0x4f4e74){while(--_0x4f4e74){_0x3ac366['push'](_0x3ac366['shift']());}};_0x195225(++_0x2d6458);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x1f95a4,_0x16db7c){var _0x9e7049=function(_0x4bbd55){while(--_0x4bbd55){_0x1f95a4['push'](_0x1f95a4['shift']());}};_0x9e7049(++_0x16db7c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 7bbf6b9..0264e5a 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 _0xbdb8=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x50cd41,_0x4874a7){var _0x399475=function(_0x1946da){while(--_0x1946da){_0x50cd41['push'](_0x50cd41['shift']());}};_0x399475(++_0x4874a7);}(_0xbdb8,0xb3));var _0x8bdb=function(_0x137f1a,_0x2887df){_0x137f1a=_0x137f1a-0x0;var _0x439923=_0xbdb8[_0x137f1a];return _0x439923;};'use strict';var multer=require(_0x8bdb('0x0'));var util=require(_0x8bdb('0x1'));var path=require('path');var timeout=require(_0x8bdb('0x2'));var express=require(_0x8bdb('0x3'));var router=express[_0x8bdb('0x4')]();var fs_extra=require(_0x8bdb('0x5'));var auth=require(_0x8bdb('0x6'));var interaction=require(_0x8bdb('0x7'));var config=require(_0x8bdb('0x8'));var controller=require(_0x8bdb('0x9'));router[_0x8bdb('0xa')]('/',auth[_0x8bdb('0xb')](),controller[_0x8bdb('0xc')]);router[_0x8bdb('0xa')](_0x8bdb('0xd'),auth['isAuthenticated'](),controller[_0x8bdb('0xe')]);router[_0x8bdb('0xf')]('/',auth[_0x8bdb('0xb')](),controller[_0x8bdb('0x10')]);router[_0x8bdb('0x11')]('/:id',auth[_0x8bdb('0xb')](),controller[_0x8bdb('0x12')]);router[_0x8bdb('0x13')](_0x8bdb('0xd'),auth[_0x8bdb('0xb')](),controller[_0x8bdb('0x14')]);module[_0x8bdb('0x15')]=router;
\ No newline at end of file
+var _0x3b63=['show','post','create','put','update','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id'];(function(_0x59eefb,_0x2151ce){var _0x1a49e8=function(_0x5a758c){while(--_0x5a758c){_0x59eefb['push'](_0x59eefb['shift']());}};_0x1a49e8(++_0x2151ce);}(_0x3b63,0x96));var _0x33b6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x3b63[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x33b6('0x0'));var util=require(_0x33b6('0x1'));var path=require('path');var timeout=require(_0x33b6('0x2'));var express=require(_0x33b6('0x3'));var router=express['Router']();var fs_extra=require(_0x33b6('0x4'));var auth=require(_0x33b6('0x5'));var interaction=require(_0x33b6('0x6'));var config=require('../../config/environment');var controller=require(_0x33b6('0x7'));router[_0x33b6('0x8')]('/',auth[_0x33b6('0x9')](),controller[_0x33b6('0xa')]);router[_0x33b6('0x8')](_0x33b6('0xb'),auth['isAuthenticated'](),controller[_0x33b6('0xc')]);router[_0x33b6('0xd')]('/',auth[_0x33b6('0x9')](),controller[_0x33b6('0xe')]);router[_0x33b6('0xf')](_0x33b6('0xb'),auth[_0x33b6('0x9')](),controller[_0x33b6('0x10')]);router['delete'](_0x33b6('0xb'),auth[_0x33b6('0x9')](),controller[_0x33b6('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index ad6183b..5c3eb6b 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 _0x225c=['STRING','INTEGER','sequelize','exports'];(function(_0xba5a61,_0x160004){var _0x4eaab4=function(_0x8ccfb7){while(--_0x8ccfb7){_0xba5a61['push'](_0xba5a61['shift']());}};_0x4eaab4(++_0x160004);}(_0x225c,0x106));var _0xc225=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x225c[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xc225('0x0'));module[_0xc225('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xc225('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xc225('0x2')]},'dcontext':{'type':Sequelize[_0xc225('0x2')]},'channel':{'type':Sequelize[_0xc225('0x2')]},'dstchannel':{'type':Sequelize[_0xc225('0x2')]},'lastapp':{'type':Sequelize[_0xc225('0x2')]},'lastdata':{'type':Sequelize[_0xc225('0x2')]},'duration':{'type':Sequelize[_0xc225('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc225('0x2')]},'amaflags':{'type':Sequelize[_0xc225('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xc225('0x2')]},'userfield':{'type':Sequelize[_0xc225('0x2')]},'uniqueid':{'type':Sequelize[_0xc225('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xc225('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc225('0x2')]},'tag':{'type':Sequelize[_0xc225('0x2')]}};
\ No newline at end of file
+var _0xe3ee=['STRING','INTEGER','DATE','1970-01-01\x2000:00:01'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0xe3ee,0x116));var _0xee3e=function(_0x13cda6,_0x599fee){_0x13cda6=_0x13cda6-0x0;var _0x3852b4=_0xe3ee[_0x13cda6];return _0x3852b4;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0xee3e('0x0')],'allowNull':![],'defaultValue':_0xee3e('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xee3e('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xee3e('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xee3e('0x2')]},'duration':{'type':Sequelize[_0xee3e('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xee3e('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xee3e('0x2')]},'amaflags':{'type':Sequelize[_0xee3e('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xee3e('0x2')]},'userfield':{'type':Sequelize[_0xee3e('0x2')]},'uniqueid':{'type':Sequelize[_0xee3e('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xee3e('0x2')]},'peeraccount':{'type':Sequelize[_0xee3e('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xee3e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 10eacdd..9543b34 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 _0xb647=['bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../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','name','send','index','Cdr','rawAttributes','fieldName','type','key','query','filters','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','intersection','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x437e8a,_0x44dfba){var _0x5e9910=function(_0x3b71e1){while(--_0x3b71e1){_0x437e8a['push'](_0x437e8a['shift']());}};_0x5e9910(++_0x44dfba);}(_0xb647,0xdb));var _0x7b64=function(_0x2014d7,_0x3668de){_0x2014d7=_0x2014d7-0x0;var _0x355af3=_0xb647[_0x2014d7];return _0x355af3;};'use strict';var emlformat=require(_0x7b64('0x0'));var rimraf=require(_0x7b64('0x1'));var zipdir=require(_0x7b64('0x2'));var jsonpatch=require(_0x7b64('0x3'));var rp=require(_0x7b64('0x4'));var moment=require(_0x7b64('0x5'));var BPromise=require(_0x7b64('0x6'));var Mustache=require(_0x7b64('0x7'));var util=require('util');var path=require(_0x7b64('0x8'));var sox=require('sox');var csv=require(_0x7b64('0x9'));var ejs=require(_0x7b64('0xa'));var fs=require('fs');var fs_extra=require(_0x7b64('0xb'));var _=require(_0x7b64('0xc'));var squel=require(_0x7b64('0xd'));var crypto=require(_0x7b64('0xe'));var jsforce=require(_0x7b64('0xf'));var deskjs=require(_0x7b64('0x10'));var toCsv=require(_0x7b64('0x9'));var querystring=require('querystring');var Papa=require(_0x7b64('0x11'));var Redis=require('ioredis');var authService=require(_0x7b64('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b64('0x13'));var logger=require(_0x7b64('0x14'))('api');var utils=require(_0x7b64('0x15'));var config=require(_0x7b64('0x16'));var licenseUtil=require(_0x7b64('0x17'));var db=require(_0x7b64('0x18'))['db'];function respondWithStatusCode(_0x25e135,_0x432626){_0x432626=_0x432626||0xcc;return function(_0x5ea1dd){if(_0x5ea1dd){return _0x25e135['sendStatus'](_0x432626);}return _0x25e135[_0x7b64('0x19')](_0x432626)['end']();};}function respondWithResult(_0x530938,_0x2f21d8){_0x2f21d8=_0x2f21d8||0xc8;return function(_0x29a596){if(_0x29a596){return _0x530938[_0x7b64('0x19')](_0x2f21d8)[_0x7b64('0x1a')](_0x29a596);}};}function respondWithFilteredResult(_0x33ebe7,_0x437ddc){return function(_0x306a4e){if(_0x306a4e){var _0x519316=typeof _0x437ddc[_0x7b64('0x1b')]===_0x7b64('0x1c')&&typeof _0x437ddc[_0x7b64('0x1d')]===_0x7b64('0x1c');var _0x157c03=_0x306a4e['count'];var _0x3935c3=_0x519316?0x0:_0x437ddc[_0x7b64('0x1b')];var _0x58517e=_0x519316?_0x306a4e[_0x7b64('0x1e')]:_0x437ddc[_0x7b64('0x1b')]+_0x437ddc['limit'];var _0x23845e;if(_0x58517e>=_0x157c03){_0x58517e=_0x157c03;_0x23845e=0xc8;}else{_0x23845e=0xce;}_0x33ebe7[_0x7b64('0x19')](_0x23845e);return _0x33ebe7[_0x7b64('0x1f')](_0x7b64('0x20'),_0x3935c3+'-'+_0x58517e+'/'+_0x157c03)['json'](_0x306a4e);}return null;};}function patchUpdates(_0x123a3b){return function(_0x5c4135){try{jsonpatch['apply'](_0x5c4135,_0x123a3b,!![]);}catch(_0x3f73cf){return BPromise['reject'](_0x3f73cf);}return _0x5c4135[_0x7b64('0x21')]();};}function saveUpdates(_0x587da6,_0x1bbd87){return function(_0x1ad95f){if(_0x1ad95f){return _0x1ad95f[_0x7b64('0x22')](_0x587da6)[_0x7b64('0x23')](function(_0x450b7e){return _0x450b7e;});}return null;};}function removeEntity(_0x3c0d97,_0x215ea9){return function(_0x3d4bef){if(_0x3d4bef){return _0x3d4bef[_0x7b64('0x24')]()[_0x7b64('0x23')](function(){_0x3c0d97[_0x7b64('0x19')](0xcc)[_0x7b64('0x25')]();});}};}function handleEntityNotFound(_0x24b68e,_0x42efa1){return function(_0x50d06c){if(!_0x50d06c){_0x24b68e[_0x7b64('0x26')](0x194);}return _0x50d06c;};}function handleError(_0x5d9586,_0x1580d0){_0x1580d0=_0x1580d0||0x1f4;return function(_0x21fbd3){logger['error'](_0x21fbd3['stack']);if(_0x21fbd3[_0x7b64('0x27')]){delete _0x21fbd3[_0x7b64('0x27')];}_0x5d9586[_0x7b64('0x19')](_0x1580d0)[_0x7b64('0x28')](_0x21fbd3);};}exports[_0x7b64('0x29')]=function(_0x3c9fad,_0x6740b2){var _0x2729f1={},_0x53e29b={},_0x1616c9={'count':0x0,'rows':[]};var _0x2c4619=_['map'](db[_0x7b64('0x2a')][_0x7b64('0x2b')],function(_0x369402){return{'name':_0x369402[_0x7b64('0x2c')],'type':_0x369402[_0x7b64('0x2d')][_0x7b64('0x2e')]};});_0x53e29b['model']=_['map'](_0x2c4619,_0x7b64('0x27'));_0x53e29b[_0x7b64('0x2f')]=_['keys'](_0x3c9fad['query']);_0x53e29b[_0x7b64('0x30')]=_['intersection'](_0x53e29b[_0x7b64('0x31')],_0x53e29b['query']);_0x2729f1['attributes']=_['intersection'](_0x53e29b[_0x7b64('0x31')],qs[_0x7b64('0x32')](_0x3c9fad[_0x7b64('0x2f')]['fields']));_0x2729f1[_0x7b64('0x33')]=_0x2729f1['attributes'][_0x7b64('0x34')]?_0x2729f1[_0x7b64('0x33')]:_0x53e29b[_0x7b64('0x31')];if(!_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x35')]('nolimit')){_0x2729f1[_0x7b64('0x1d')]=qs[_0x7b64('0x1d')](_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x1d')]);_0x2729f1['offset']=qs[_0x7b64('0x1b')](_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x1b')]);}_0x2729f1[_0x7b64('0x36')]=qs[_0x7b64('0x37')](_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x37')]);_0x2729f1['where']=qs['filters'](_[_0x7b64('0x38')](_0x3c9fad[_0x7b64('0x2f')],_0x53e29b[_0x7b64('0x30')]),_0x2c4619);if(_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x39')]){_0x2729f1[_0x7b64('0x3a')]=_[_0x7b64('0x3b')](_0x2729f1[_0x7b64('0x3a')],{'$or':_[_0x7b64('0x3c')](_0x2c4619,function(_0x5b1278){if(_0x5b1278[_0x7b64('0x2d')]!==_0x7b64('0x3d')){var _0x451f9b={};_0x451f9b[_0x5b1278[_0x7b64('0x27')]]={'$like':'%'+_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x39')]+'%'};return _0x451f9b;}})});}_0x2729f1=_[_0x7b64('0x3b')]({},_0x2729f1,_0x3c9fad[_0x7b64('0x3e')]);var _0x3c4467={'where':_0x2729f1[_0x7b64('0x3a')]};return db[_0x7b64('0x2a')][_0x7b64('0x1e')](_0x3c4467)[_0x7b64('0x23')](function(_0x36cfce){_0x1616c9[_0x7b64('0x1e')]=_0x36cfce;if(_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x3f')]){_0x2729f1[_0x7b64('0x40')]=[{'all':!![]}];}return db[_0x7b64('0x2a')][_0x7b64('0x41')](_0x2729f1);})['then'](function(_0x442d65){_0x1616c9[_0x7b64('0x42')]=_0x442d65;return _0x1616c9;})[_0x7b64('0x23')](respondWithFilteredResult(_0x6740b2,_0x2729f1))['catch'](handleError(_0x6740b2,null));};exports[_0x7b64('0x43')]=function(_0x2e4d0f,_0x55c889){var _0x216c58={'raw':!![],'where':{'id':_0x2e4d0f['params']['id']}},_0xf0d4a1={};_0xf0d4a1[_0x7b64('0x31')]=_['keys'](db[_0x7b64('0x2a')][_0x7b64('0x2b')]);_0xf0d4a1[_0x7b64('0x2f')]=_['keys'](_0x2e4d0f[_0x7b64('0x2f')]);_0xf0d4a1[_0x7b64('0x30')]=_[_0x7b64('0x44')](_0xf0d4a1[_0x7b64('0x31')],_0xf0d4a1[_0x7b64('0x2f')]);_0x216c58[_0x7b64('0x33')]=_['intersection'](_0xf0d4a1[_0x7b64('0x31')],qs[_0x7b64('0x32')](_0x2e4d0f[_0x7b64('0x2f')][_0x7b64('0x32')]));_0x216c58[_0x7b64('0x33')]=_0x216c58['attributes']['length']?_0x216c58['attributes']:_0xf0d4a1['model'];if(_0x2e4d0f[_0x7b64('0x2f')][_0x7b64('0x3f')]){_0x216c58[_0x7b64('0x40')]=[{'all':!![]}];}_0x216c58=_[_0x7b64('0x3b')]({},_0x216c58,_0x2e4d0f[_0x7b64('0x3e')]);return db[_0x7b64('0x2a')][_0x7b64('0x45')](_0x216c58)[_0x7b64('0x23')](handleEntityNotFound(_0x55c889,null))[_0x7b64('0x23')](respondWithResult(_0x55c889,null))[_0x7b64('0x46')](handleError(_0x55c889,null));};exports[_0x7b64('0x47')]=function(_0x38983a,_0x4add4d){return db['Cdr'][_0x7b64('0x47')](_0x38983a[_0x7b64('0x48')],{})[_0x7b64('0x23')](respondWithResult(_0x4add4d,0xc9))[_0x7b64('0x46')](handleError(_0x4add4d,null));};exports[_0x7b64('0x22')]=function(_0x5a8639,_0x3e5321){if(_0x5a8639[_0x7b64('0x48')]['id']){delete _0x5a8639[_0x7b64('0x48')]['id'];}return db['Cdr'][_0x7b64('0x45')]({'where':{'id':_0x5a8639[_0x7b64('0x49')]['id']}})[_0x7b64('0x23')](handleEntityNotFound(_0x3e5321,null))[_0x7b64('0x23')](saveUpdates(_0x5a8639[_0x7b64('0x48')],null))['then'](respondWithResult(_0x3e5321,null))[_0x7b64('0x46')](handleError(_0x3e5321,null));};exports[_0x7b64('0x24')]=function(_0x52b04a,_0x3656b8){return db[_0x7b64('0x2a')]['find']({'where':{'id':_0x52b04a[_0x7b64('0x49')]['id']}})[_0x7b64('0x23')](handleEntityNotFound(_0x3656b8,null))[_0x7b64('0x23')](removeEntity(_0x3656b8,null))[_0x7b64('0x46')](handleError(_0x3656b8,null));};exports[_0x7b64('0x4a')]=function(_0x79cbc9,_0x253b33){return db[_0x7b64('0x2a')][_0x7b64('0x4a')]()[_0x7b64('0x23')](respondWithResult(_0x253b33,null))[_0x7b64('0x46')](handleError(_0x253b33,null));};
\ No newline at end of file
+var _0x0f4d=['query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','type','options','include','findAll','rows','catch','rawAttributes','find','create','body','params','describe','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','index','map','Cdr','model'];(function(_0x2f072f,_0x5803e2){var _0x29aa69=function(_0x4ec359){while(--_0x4ec359){_0x2f072f['push'](_0x2f072f['shift']());}};_0x29aa69(++_0x5803e2);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x1e6428,_0x517bb3){_0x1e6428=_0x1e6428-0x0;var _0x1ff6f4=_0x0f4d[_0x1e6428];return _0x1ff6f4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd0f4('0x0'));var rp=require('request-promise');var moment=require(_0xd0f4('0x1'));var BPromise=require(_0xd0f4('0x2'));var Mustache=require(_0xd0f4('0x3'));var util=require(_0xd0f4('0x4'));var path=require(_0xd0f4('0x5'));var sox=require(_0xd0f4('0x6'));var csv=require(_0xd0f4('0x7'));var ejs=require(_0xd0f4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0f4('0x9'));var squel=require(_0xd0f4('0xa'));var crypto=require('crypto');var jsforce=require(_0xd0f4('0xb'));var deskjs=require(_0xd0f4('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd0f4('0xd'));var Papa=require(_0xd0f4('0xe'));var Redis=require('ioredis');var authService=require(_0xd0f4('0xf'));var qs=require(_0xd0f4('0x10'));var as=require(_0xd0f4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd0f4('0x12'));var utils=require(_0xd0f4('0x13'));var config=require(_0xd0f4('0x14'));var licenseUtil=require(_0xd0f4('0x15'));var db=require(_0xd0f4('0x16'))['db'];function respondWithStatusCode(_0x64232c,_0x134492){_0x134492=_0x134492||0xcc;return function(_0x5679a7){if(_0x5679a7){return _0x64232c[_0xd0f4('0x17')](_0x134492);}return _0x64232c[_0xd0f4('0x18')](_0x134492)['end']();};}function respondWithResult(_0x104d48,_0x536d71){_0x536d71=_0x536d71||0xc8;return function(_0x828792){if(_0x828792){return _0x104d48['status'](_0x536d71)[_0xd0f4('0x19')](_0x828792);}};}function respondWithFilteredResult(_0x4d5aef,_0x4afe4d){return function(_0x54b806){if(_0x54b806){var _0x45b32e=typeof _0x4afe4d[_0xd0f4('0x1a')]===_0xd0f4('0x1b')&&typeof _0x4afe4d[_0xd0f4('0x1c')]===_0xd0f4('0x1b');var _0x10acbe=_0x54b806[_0xd0f4('0x1d')];var _0x35be48=_0x45b32e?0x0:_0x4afe4d[_0xd0f4('0x1a')];var _0x5de07b=_0x45b32e?_0x54b806[_0xd0f4('0x1d')]:_0x4afe4d[_0xd0f4('0x1a')]+_0x4afe4d[_0xd0f4('0x1c')];var _0xa0662;if(_0x5de07b>=_0x10acbe){_0x5de07b=_0x10acbe;_0xa0662=0xc8;}else{_0xa0662=0xce;}_0x4d5aef['status'](_0xa0662);return _0x4d5aef[_0xd0f4('0x1e')](_0xd0f4('0x1f'),_0x35be48+'-'+_0x5de07b+'/'+_0x10acbe)[_0xd0f4('0x19')](_0x54b806);}return null;};}function patchUpdates(_0x208a6f){return function(_0x4e1689){try{jsonpatch[_0xd0f4('0x20')](_0x4e1689,_0x208a6f,!![]);}catch(_0xda1d14){return BPromise[_0xd0f4('0x21')](_0xda1d14);}return _0x4e1689[_0xd0f4('0x22')]();};}function saveUpdates(_0x14ba70,_0x2a1df0){return function(_0x25ee43){if(_0x25ee43){return _0x25ee43['update'](_0x14ba70)[_0xd0f4('0x23')](function(_0x327696){return _0x327696;});}return null;};}function removeEntity(_0x20e0c8,_0x299904){return function(_0x4d49c0){if(_0x4d49c0){return _0x4d49c0[_0xd0f4('0x24')]()['then'](function(){_0x20e0c8[_0xd0f4('0x18')](0xcc)[_0xd0f4('0x25')]();});}};}function handleEntityNotFound(_0x1cf493,_0x567eb4){return function(_0x42d944){if(!_0x42d944){_0x1cf493[_0xd0f4('0x17')](0x194);}return _0x42d944;};}function handleError(_0x459931,_0x1ed6e2){_0x1ed6e2=_0x1ed6e2||0x1f4;return function(_0x366af6){logger['error'](_0x366af6[_0xd0f4('0x26')]);if(_0x366af6[_0xd0f4('0x27')]){delete _0x366af6[_0xd0f4('0x27')];}_0x459931[_0xd0f4('0x18')](_0x1ed6e2)[_0xd0f4('0x28')](_0x366af6);};}exports[_0xd0f4('0x29')]=function(_0x1d3246,_0x33eb58){var _0x3cb97c={},_0x4cff90={},_0x42a44f={'count':0x0,'rows':[]};var _0x2df1ed=_[_0xd0f4('0x2a')](db[_0xd0f4('0x2b')]['rawAttributes'],function(_0x4058d7){return{'name':_0x4058d7['fieldName'],'type':_0x4058d7['type']['key']};});_0x4cff90[_0xd0f4('0x2c')]=_[_0xd0f4('0x2a')](_0x2df1ed,_0xd0f4('0x27'));_0x4cff90[_0xd0f4('0x2d')]=_[_0xd0f4('0x2e')](_0x1d3246[_0xd0f4('0x2d')]);_0x4cff90[_0xd0f4('0x2f')]=_[_0xd0f4('0x30')](_0x4cff90['model'],_0x4cff90[_0xd0f4('0x2d')]);_0x3cb97c['attributes']=_[_0xd0f4('0x30')](_0x4cff90[_0xd0f4('0x2c')],qs['fields'](_0x1d3246['query'][_0xd0f4('0x31')]));_0x3cb97c['attributes']=_0x3cb97c[_0xd0f4('0x32')][_0xd0f4('0x33')]?_0x3cb97c['attributes']:_0x4cff90[_0xd0f4('0x2c')];if(!_0x1d3246[_0xd0f4('0x2d')]['hasOwnProperty']('nolimit')){_0x3cb97c[_0xd0f4('0x1c')]=qs[_0xd0f4('0x1c')](_0x1d3246['query'][_0xd0f4('0x1c')]);_0x3cb97c['offset']=qs[_0xd0f4('0x1a')](_0x1d3246[_0xd0f4('0x2d')]['offset']);}_0x3cb97c[_0xd0f4('0x34')]=qs[_0xd0f4('0x35')](_0x1d3246[_0xd0f4('0x2d')][_0xd0f4('0x35')]);_0x3cb97c[_0xd0f4('0x36')]=qs['filters'](_[_0xd0f4('0x37')](_0x1d3246[_0xd0f4('0x2d')],_0x4cff90[_0xd0f4('0x2f')]),_0x2df1ed);if(_0x1d3246[_0xd0f4('0x2d')]['filter']){_0x3cb97c[_0xd0f4('0x36')]=_[_0xd0f4('0x38')](_0x3cb97c[_0xd0f4('0x36')],{'$or':_[_0xd0f4('0x2a')](_0x2df1ed,function(_0xd109a4){if(_0xd109a4[_0xd0f4('0x39')]!=='VIRTUAL'){var _0x269629={};_0x269629[_0xd109a4[_0xd0f4('0x27')]]={'$like':'%'+_0x1d3246[_0xd0f4('0x2d')]['filter']+'%'};return _0x269629;}})});}_0x3cb97c=_[_0xd0f4('0x38')]({},_0x3cb97c,_0x1d3246[_0xd0f4('0x3a')]);var _0x4bebe8={'where':_0x3cb97c[_0xd0f4('0x36')]};return db[_0xd0f4('0x2b')]['count'](_0x4bebe8)['then'](function(_0x3bb4ab){_0x42a44f[_0xd0f4('0x1d')]=_0x3bb4ab;if(_0x1d3246[_0xd0f4('0x2d')]['includeAll']){_0x3cb97c[_0xd0f4('0x3b')]=[{'all':!![]}];}return db['Cdr'][_0xd0f4('0x3c')](_0x3cb97c);})['then'](function(_0x29439d){_0x42a44f[_0xd0f4('0x3d')]=_0x29439d;return _0x42a44f;})[_0xd0f4('0x23')](respondWithFilteredResult(_0x33eb58,_0x3cb97c))[_0xd0f4('0x3e')](handleError(_0x33eb58,null));};exports['show']=function(_0x10509e,_0x198e47){var _0xb02892={'raw':!![],'where':{'id':_0x10509e['params']['id']}},_0x4c8b9a={};_0x4c8b9a[_0xd0f4('0x2c')]=_[_0xd0f4('0x2e')](db[_0xd0f4('0x2b')][_0xd0f4('0x3f')]);_0x4c8b9a[_0xd0f4('0x2d')]=_[_0xd0f4('0x2e')](_0x10509e[_0xd0f4('0x2d')]);_0x4c8b9a[_0xd0f4('0x2f')]=_[_0xd0f4('0x30')](_0x4c8b9a[_0xd0f4('0x2c')],_0x4c8b9a[_0xd0f4('0x2d')]);_0xb02892[_0xd0f4('0x32')]=_['intersection'](_0x4c8b9a[_0xd0f4('0x2c')],qs[_0xd0f4('0x31')](_0x10509e['query'][_0xd0f4('0x31')]));_0xb02892[_0xd0f4('0x32')]=_0xb02892[_0xd0f4('0x32')][_0xd0f4('0x33')]?_0xb02892[_0xd0f4('0x32')]:_0x4c8b9a[_0xd0f4('0x2c')];if(_0x10509e[_0xd0f4('0x2d')]['includeAll']){_0xb02892[_0xd0f4('0x3b')]=[{'all':!![]}];}_0xb02892=_[_0xd0f4('0x38')]({},_0xb02892,_0x10509e[_0xd0f4('0x3a')]);return db['Cdr'][_0xd0f4('0x40')](_0xb02892)[_0xd0f4('0x23')](handleEntityNotFound(_0x198e47,null))[_0xd0f4('0x23')](respondWithResult(_0x198e47,null))[_0xd0f4('0x3e')](handleError(_0x198e47,null));};exports[_0xd0f4('0x41')]=function(_0x563759,_0x54bb8d){return db['Cdr'][_0xd0f4('0x41')](_0x563759[_0xd0f4('0x42')],{})[_0xd0f4('0x23')](respondWithResult(_0x54bb8d,0xc9))[_0xd0f4('0x3e')](handleError(_0x54bb8d,null));};exports['update']=function(_0x31db89,_0x1b1baa){if(_0x31db89['body']['id']){delete _0x31db89[_0xd0f4('0x42')]['id'];}return db[_0xd0f4('0x2b')][_0xd0f4('0x40')]({'where':{'id':_0x31db89[_0xd0f4('0x43')]['id']}})[_0xd0f4('0x23')](handleEntityNotFound(_0x1b1baa,null))[_0xd0f4('0x23')](saveUpdates(_0x31db89[_0xd0f4('0x42')],null))[_0xd0f4('0x23')](respondWithResult(_0x1b1baa,null))[_0xd0f4('0x3e')](handleError(_0x1b1baa,null));};exports[_0xd0f4('0x24')]=function(_0x431df3,_0x120c17){return db[_0xd0f4('0x2b')]['find']({'where':{'id':_0x431df3[_0xd0f4('0x43')]['id']}})[_0xd0f4('0x23')](handleEntityNotFound(_0x120c17,null))[_0xd0f4('0x23')](removeEntity(_0x120c17,null))['catch'](handleError(_0x120c17,null));};exports[_0xd0f4('0x44')]=function(_0x3f8bcc,_0x1d8543){return db['Cdr'][_0xd0f4('0x44')]()['then'](respondWithResult(_0x1d8543,null))[_0xd0f4('0x3e')](handleError(_0x1d8543,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index ecda3b3..a9f5cfb 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x388113,_0x16cac1){var _0x5c3a72=function(_0x34c96a){while(--_0x34c96a){_0x388113['push'](_0x388113['shift']());}};_0x5c3a72(++_0x16cac1);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3f6987,_0x1ad59a){var _0x5a8248=function(_0xe2a261){while(--_0xe2a261){_0x3f6987['push'](_0x3f6987['shift']());}};_0x5a8248(++_0x1ad59a);}(_0x7a54,0x106));var _0x47a5=function(_0x97d60f,_0x19d958){_0x97d60f=_0x97d60f-0x0;var _0x5ce0c6=_0x7a54[_0x97d60f];return _0x5ce0c6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index b0737e9..05710b6 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 _0x2353=['Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3e6cfe,_0x1943c1){var _0x51799b=function(_0x2e8ac1){while(--_0x2e8ac1){_0x3e6cfe['push'](_0x3e6cfe['shift']());}};_0x51799b(++_0x1943c1);}(_0x2353,0x195));var _0x3235=function(_0x482b0b,_0x37ac86){_0x482b0b=_0x482b0b-0x0;var _0x5e5991=_0x2353[_0x482b0b];return _0x5e5991;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3235('0x0'));var BPromise=require(_0x3235('0x1'));var rs=require(_0x3235('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3235('0x3'))['db'];var utils=require(_0x3235('0x4'));var logger=require('../../config/logger')(_0x3235('0x5'));var config=require(_0x3235('0x6'));var jayson=require(_0x3235('0x7'));var client=jayson[_0x3235('0x8')][_0x3235('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x436c8f,_0x399e66,_0x36d16b){return new BPromise(function(_0x146796,_0x2e36fa){return client[_0x3235('0xa')](_0x436c8f,_0x36d16b)[_0x3235('0xb')](function(_0x3a04e9){logger[_0x3235('0xc')](_0x3235('0xd'),_0x399e66,_0x3235('0xe'));logger[_0x3235('0xf')](_0x3235('0x10'),_0x399e66,'request\x20sent',JSON[_0x3235('0x11')](_0x3a04e9));if(_0x3a04e9[_0x3235('0x12')]){if(_0x3a04e9[_0x3235('0x12')]['code']===0x1f4){logger['error'](_0x3235('0xd'),_0x399e66,_0x3a04e9[_0x3235('0x12')][_0x3235('0x13')]);return _0x2e36fa(_0x3a04e9[_0x3235('0x12')][_0x3235('0x13')]);}logger['error'](_0x3235('0xd'),_0x399e66,_0x3a04e9[_0x3235('0x12')][_0x3235('0x13')]);return _0x146796(_0x3a04e9[_0x3235('0x12')][_0x3235('0x13')]);}else{logger['info'](_0x3235('0xd'),_0x399e66,_0x3235('0xe'));_0x146796(_0x3a04e9[_0x3235('0x14')][_0x3235('0x13')]);}})[_0x3235('0x15')](function(_0x459b2b){logger['error'](_0x3235('0xd'),_0x399e66,_0x459b2b);_0x2e36fa(_0x459b2b);});});}
\ No newline at end of file
+var _0xc0eb=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x462725,_0x2f890b){var _0x581f26=function(_0x126f74){while(--_0x126f74){_0x462725['push'](_0x462725['shift']());}};_0x581f26(++_0x2f890b);}(_0xc0eb,0x1a7));var _0xbc0e=function(_0x25902b,_0x229966){_0x25902b=_0x25902b-0x0;var _0x1884f0=_0xc0eb[_0x25902b];return _0x1884f0;};'use strict';var _=require(_0xbc0e('0x0'));var util=require(_0xbc0e('0x1'));var moment=require('moment');var BPromise=require(_0xbc0e('0x2'));var rs=require(_0xbc0e('0x3'));var fs=require('fs');var Redis=require(_0xbc0e('0x4'));var db=require(_0xbc0e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc0e('0x6'))(_0xbc0e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbc0e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2159a1,_0x188bb1,_0xc48094){return new BPromise(function(_0x2e175d,_0x48b65d){return client[_0xbc0e('0x9')](_0x2159a1,_0xc48094)[_0xbc0e('0xa')](function(_0x222f25){logger[_0xbc0e('0xb')](_0xbc0e('0xc'),_0x188bb1,_0xbc0e('0xd'));logger[_0xbc0e('0xe')](_0xbc0e('0xf'),_0x188bb1,_0xbc0e('0xd'),JSON[_0xbc0e('0x10')](_0x222f25));if(_0x222f25[_0xbc0e('0x11')]){if(_0x222f25['error'][_0xbc0e('0x12')]===0x1f4){logger[_0xbc0e('0x11')](_0xbc0e('0xc'),_0x188bb1,_0x222f25[_0xbc0e('0x11')][_0xbc0e('0x13')]);return _0x48b65d(_0x222f25[_0xbc0e('0x11')][_0xbc0e('0x13')]);}logger['error'](_0xbc0e('0xc'),_0x188bb1,_0x222f25['error'][_0xbc0e('0x13')]);return _0x2e175d(_0x222f25[_0xbc0e('0x11')][_0xbc0e('0x13')]);}else{logger['info'](_0xbc0e('0xc'),_0x188bb1,_0xbc0e('0xd'));_0x2e175d(_0x222f25[_0xbc0e('0x14')][_0xbc0e('0x13')]);}})[_0xbc0e('0x15')](function(_0x525b26){logger[_0xbc0e('0x11')](_0xbc0e('0xc'),_0x188bb1,_0x525b26);_0x48b65d(_0x525b26);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 757dad7..bc71c7f 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(_0x1a4748,_0x40c46e){var _0x28ca99=function(_0x99232c){while(--_0x99232c){_0x1a4748['push'](_0x1a4748['shift']());}};_0x28ca99(++_0x40c46e);}(_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(_0x6bb9,_0x10f2b6){var _0xe3b3bc=function(_0x3438ed){while(--_0x3438ed){_0x6bb9['push'](_0x6bb9['shift']());}};_0xe3b3bc(++_0x10f2b6);}(_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 97dda9a..89133c4 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 _0xadeb=['TEXT','sequelize','exports','STRING'];(function(_0xc2f824,_0x5521e4){var _0x2a601e=function(_0x25315e){while(--_0x25315e){_0xc2f824['push'](_0xc2f824['shift']());}};_0x2a601e(++_0x5521e4);}(_0xadeb,0xad));var _0xbade=function(_0x369cc7,_0x16abfc){_0x369cc7=_0x369cc7-0x0;var _0x53273c=_0xadeb[_0x369cc7];return _0x53273c;};'use strict';var Sequelize=require(_0xbade('0x0'));module[_0xbade('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xbade('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbade('0x3')]()},'description':{'type':Sequelize[_0xbade('0x2')]},'interval':{'type':Sequelize[_0xbade('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x638d=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x3d24f9,_0x5c79b7){var _0x2a0278=function(_0x223f27){while(--_0x223f27){_0x3d24f9['push'](_0x3d24f9['shift']());}};_0x2a0278(++_0x5c79b7);}(_0x638d,0x1e2));var _0xd638=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x638d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd638('0x0'));module[_0xd638('0x1')]={'priority':{'type':Sequelize[_0xd638('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd638('0x3')],'allowNull':![],'defaultValue':_0xd638('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd638('0x3')]},'interval':{'type':Sequelize[_0xd638('0x3')],'defaultValue':_0xd638('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 391de4d..6cedcc0 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 _0xb676=['ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','catch','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','keys'];(function(_0x3ba559,_0x131d7e){var _0x4d76fb=function(_0x504678){while(--_0x504678){_0x3ba559['push'](_0x3ba559['shift']());}};_0x4d76fb(++_0x131d7e);}(_0xb676,0xbc));var _0x6b67=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xb676[_0x2aecb2];return _0x3ebb80;};'use strict';var emlformat=require(_0x6b67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b67('0x1'));var jsonpatch=require(_0x6b67('0x2'));var rp=require(_0x6b67('0x3'));var moment=require(_0x6b67('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6b67('0x5'));var path=require(_0x6b67('0x6'));var sox=require('sox');var csv=require(_0x6b67('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b67('0x8'));var _=require(_0x6b67('0x9'));var squel=require(_0x6b67('0xa'));var crypto=require('crypto');var jsforce=require(_0x6b67('0xb'));var deskjs=require(_0x6b67('0xc'));var toCsv=require(_0x6b67('0x7'));var querystring=require('querystring');var Papa=require(_0x6b67('0xd'));var Redis=require(_0x6b67('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6b67('0xf'));var as=require(_0x6b67('0x10'));var hardwareService=require(_0x6b67('0x11'));var logger=require(_0x6b67('0x12'))('api');var utils=require(_0x6b67('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b67('0x14'));var db=require(_0x6b67('0x15'))['db'];function respondWithStatusCode(_0x1ebceb,_0x2ab6c5){_0x2ab6c5=_0x2ab6c5||0xcc;return function(_0x3e1bc6){if(_0x3e1bc6){return _0x1ebceb[_0x6b67('0x16')](_0x2ab6c5);}return _0x1ebceb[_0x6b67('0x17')](_0x2ab6c5)[_0x6b67('0x18')]();};}function respondWithResult(_0x2de534,_0x5fb6b3){_0x5fb6b3=_0x5fb6b3||0xc8;return function(_0x8a29a2){if(_0x8a29a2){return _0x2de534['status'](_0x5fb6b3)[_0x6b67('0x19')](_0x8a29a2);}};}function respondWithFilteredResult(_0x2213f4,_0x51e798){return function(_0x187fd4){if(_0x187fd4){var _0x1b6c60=typeof _0x51e798[_0x6b67('0x1a')]===_0x6b67('0x1b')&&typeof _0x51e798['limit']===_0x6b67('0x1b');var _0x46c44e=_0x187fd4[_0x6b67('0x1c')];var _0x46d828=_0x1b6c60?0x0:_0x51e798[_0x6b67('0x1a')];var _0x37d964=_0x1b6c60?_0x187fd4['count']:_0x51e798[_0x6b67('0x1a')]+_0x51e798['limit'];var _0x37cf6d;if(_0x37d964>=_0x46c44e){_0x37d964=_0x46c44e;_0x37cf6d=0xc8;}else{_0x37cf6d=0xce;}_0x2213f4[_0x6b67('0x17')](_0x37cf6d);return _0x2213f4[_0x6b67('0x1d')](_0x6b67('0x1e'),_0x46d828+'-'+_0x37d964+'/'+_0x46c44e)['json'](_0x187fd4);}return null;};}function patchUpdates(_0xd36be3){return function(_0x360208){try{jsonpatch[_0x6b67('0x1f')](_0x360208,_0xd36be3,!![]);}catch(_0x50fdfc){return BPromise[_0x6b67('0x20')](_0x50fdfc);}return _0x360208[_0x6b67('0x21')]();};}function saveUpdates(_0x1fedd5,_0x4d48e1){return function(_0xd4fda5){if(_0xd4fda5){return _0xd4fda5[_0x6b67('0x22')](_0x1fedd5)[_0x6b67('0x23')](function(_0x3a0a3f){return _0x3a0a3f;});}return null;};}function removeEntity(_0x393b3d,_0x17d27b){return function(_0x3c89d2){if(_0x3c89d2){return _0x3c89d2[_0x6b67('0x24')]()[_0x6b67('0x23')](function(){_0x393b3d[_0x6b67('0x17')](0xcc)[_0x6b67('0x18')]();});}};}function handleEntityNotFound(_0x47c927,_0x265245){return function(_0x3cffdf){if(!_0x3cffdf){_0x47c927[_0x6b67('0x16')](0x194);}return _0x3cffdf;};}function handleError(_0x5dca55,_0x2b67f6){_0x2b67f6=_0x2b67f6||0x1f4;return function(_0x1c73b0){logger['error'](_0x1c73b0[_0x6b67('0x25')]);if(_0x1c73b0[_0x6b67('0x26')]){delete _0x1c73b0[_0x6b67('0x26')];}_0x5dca55[_0x6b67('0x17')](_0x2b67f6)[_0x6b67('0x27')](_0x1c73b0);};}exports[_0x6b67('0x28')]=function(_0x3b65af,_0x5d9f6d){var _0x320a70={'raw':!![],'where':{'id':_0x3b65af[_0x6b67('0x29')]['id']}},_0x433881={};_0x433881[_0x6b67('0x2a')]=_[_0x6b67('0x2b')](db[_0x6b67('0x2c')][_0x6b67('0x2d')]);_0x433881[_0x6b67('0x2e')]=_['keys'](_0x3b65af[_0x6b67('0x2e')]);_0x433881[_0x6b67('0x2f')]=_[_0x6b67('0x30')](_0x433881[_0x6b67('0x2a')],_0x433881[_0x6b67('0x2e')]);_0x320a70[_0x6b67('0x31')]=_['intersection'](_0x433881['model'],qs[_0x6b67('0x32')](_0x3b65af[_0x6b67('0x2e')][_0x6b67('0x32')]));_0x320a70[_0x6b67('0x31')]=_0x320a70['attributes'][_0x6b67('0x33')]?_0x320a70['attributes']:_0x433881[_0x6b67('0x2a')];if(_0x3b65af[_0x6b67('0x2e')][_0x6b67('0x34')]){_0x320a70['include']=[{'all':!![]}];}_0x320a70=_[_0x6b67('0x35')]({},_0x320a70,_0x3b65af[_0x6b67('0x36')]);return db[_0x6b67('0x2c')]['find'](_0x320a70)[_0x6b67('0x23')](handleEntityNotFound(_0x5d9f6d,null))[_0x6b67('0x23')](respondWithResult(_0x5d9f6d,null))[_0x6b67('0x37')](handleError(_0x5d9f6d,null));};exports[_0x6b67('0x22')]=function(_0x4c3a86,_0x2092f6){if(_0x4c3a86[_0x6b67('0x38')]['id']){delete _0x4c3a86[_0x6b67('0x38')]['id'];}return db[_0x6b67('0x2c')][_0x6b67('0x39')]({'where':{'id':_0x4c3a86[_0x6b67('0x29')]['id']}})[_0x6b67('0x23')](handleEntityNotFound(_0x2092f6,null))[_0x6b67('0x23')](saveUpdates(_0x4c3a86['body'],null))[_0x6b67('0x23')](respondWithResult(_0x2092f6,null))[_0x6b67('0x37')](handleError(_0x2092f6,null));};exports[_0x6b67('0x24')]=function(_0x4d259f,_0x3889ef){return db[_0x6b67('0x2c')][_0x6b67('0x39')]({'where':{'id':_0x4d259f[_0x6b67('0x29')]['id']}})['then'](handleEntityNotFound(_0x3889ef,null))['then'](removeEntity(_0x3889ef,null))[_0x6b67('0x37')](handleError(_0x3889ef,null));};
\ No newline at end of file
+var _0x4584=['ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','find','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x4584,0x1cf));var _0x4458=function(_0x43a1b8,_0x1c90c8){_0x43a1b8=_0x43a1b8-0x0;var _0x324ecc=_0x4584[_0x43a1b8];return _0x324ecc;};'use strict';var emlformat=require(_0x4458('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4458('0x1'));var jsonpatch=require(_0x4458('0x2'));var rp=require(_0x4458('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4458('0x4'));var util=require(_0x4458('0x5'));var path=require(_0x4458('0x6'));var sox=require(_0x4458('0x7'));var csv=require(_0x4458('0x8'));var ejs=require(_0x4458('0x9'));var fs=require('fs');var fs_extra=require(_0x4458('0xa'));var _=require(_0x4458('0xb'));var squel=require(_0x4458('0xc'));var crypto=require('crypto');var jsforce=require(_0x4458('0xd'));var deskjs=require(_0x4458('0xe'));var toCsv=require(_0x4458('0x8'));var querystring=require(_0x4458('0xf'));var Papa=require(_0x4458('0x10'));var Redis=require(_0x4458('0x11'));var authService=require(_0x4458('0x12'));var qs=require(_0x4458('0x13'));var as=require(_0x4458('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4458('0x15'))(_0x4458('0x16'));var utils=require(_0x4458('0x17'));var config=require(_0x4458('0x18'));var licenseUtil=require(_0x4458('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x302552,_0x527809){_0x527809=_0x527809||0xcc;return function(_0x1f13ab){if(_0x1f13ab){return _0x302552['sendStatus'](_0x527809);}return _0x302552[_0x4458('0x1a')](_0x527809)[_0x4458('0x1b')]();};}function respondWithResult(_0x4abaf9,_0x5e2f05){_0x5e2f05=_0x5e2f05||0xc8;return function(_0x42771e){if(_0x42771e){return _0x4abaf9[_0x4458('0x1a')](_0x5e2f05)[_0x4458('0x1c')](_0x42771e);}};}function respondWithFilteredResult(_0x2619ed,_0x30d440){return function(_0x21ff11){if(_0x21ff11){var _0x225679=typeof _0x30d440[_0x4458('0x1d')]==='undefined'&&typeof _0x30d440[_0x4458('0x1e')]==='undefined';var _0x3bb7f4=_0x21ff11[_0x4458('0x1f')];var _0x130d39=_0x225679?0x0:_0x30d440['offset'];var _0x319247=_0x225679?_0x21ff11[_0x4458('0x1f')]:_0x30d440[_0x4458('0x1d')]+_0x30d440[_0x4458('0x1e')];var _0x463809;if(_0x319247>=_0x3bb7f4){_0x319247=_0x3bb7f4;_0x463809=0xc8;}else{_0x463809=0xce;}_0x2619ed[_0x4458('0x1a')](_0x463809);return _0x2619ed[_0x4458('0x20')](_0x4458('0x21'),_0x130d39+'-'+_0x319247+'/'+_0x3bb7f4)[_0x4458('0x1c')](_0x21ff11);}return null;};}function patchUpdates(_0x2dfcf1){return function(_0x531ab6){try{jsonpatch[_0x4458('0x22')](_0x531ab6,_0x2dfcf1,!![]);}catch(_0x24ecd1){return BPromise[_0x4458('0x23')](_0x24ecd1);}return _0x531ab6['save']();};}function saveUpdates(_0xe09a2b,_0x1688f2){return function(_0x58aeca){if(_0x58aeca){return _0x58aeca[_0x4458('0x24')](_0xe09a2b)[_0x4458('0x25')](function(_0x5d3df2){return _0x5d3df2;});}return null;};}function removeEntity(_0xcf668c,_0x17e482){return function(_0x3e7945){if(_0x3e7945){return _0x3e7945['destroy']()[_0x4458('0x25')](function(){_0xcf668c['status'](0xcc)[_0x4458('0x1b')]();});}};}function handleEntityNotFound(_0x504a86,_0x543e21){return function(_0x277b1c){if(!_0x277b1c){_0x504a86[_0x4458('0x26')](0x194);}return _0x277b1c;};}function handleError(_0x1631d3,_0x25ade9){_0x25ade9=_0x25ade9||0x1f4;return function(_0x153a98){logger[_0x4458('0x27')](_0x153a98[_0x4458('0x28')]);if(_0x153a98[_0x4458('0x29')]){delete _0x153a98[_0x4458('0x29')];}_0x1631d3[_0x4458('0x1a')](_0x25ade9)[_0x4458('0x2a')](_0x153a98);};}exports['show']=function(_0x179be7,_0x4e076a){var _0x4579d9={'raw':!![],'where':{'id':_0x179be7[_0x4458('0x2b')]['id']}},_0x5f22be={};_0x5f22be[_0x4458('0x2c')]=_[_0x4458('0x2d')](db[_0x4458('0x2e')][_0x4458('0x2f')]);_0x5f22be[_0x4458('0x30')]=_[_0x4458('0x2d')](_0x179be7[_0x4458('0x30')]);_0x5f22be[_0x4458('0x31')]=_[_0x4458('0x32')](_0x5f22be[_0x4458('0x2c')],_0x5f22be[_0x4458('0x30')]);_0x4579d9[_0x4458('0x33')]=_[_0x4458('0x32')](_0x5f22be['model'],qs[_0x4458('0x34')](_0x179be7[_0x4458('0x30')][_0x4458('0x34')]));_0x4579d9[_0x4458('0x33')]=_0x4579d9[_0x4458('0x33')][_0x4458('0x35')]?_0x4579d9[_0x4458('0x33')]:_0x5f22be[_0x4458('0x2c')];if(_0x179be7['query']['includeAll']){_0x4579d9['include']=[{'all':!![]}];}_0x4579d9=_[_0x4458('0x36')]({},_0x4579d9,_0x179be7[_0x4458('0x37')]);return db[_0x4458('0x2e')][_0x4458('0x38')](_0x4579d9)[_0x4458('0x25')](handleEntityNotFound(_0x4e076a,null))[_0x4458('0x25')](respondWithResult(_0x4e076a,null))[_0x4458('0x39')](handleError(_0x4e076a,null));};exports[_0x4458('0x24')]=function(_0x755e3b,_0xd804f0){if(_0x755e3b[_0x4458('0x3a')]['id']){delete _0x755e3b[_0x4458('0x3a')]['id'];}return db[_0x4458('0x2e')]['find']({'where':{'id':_0x755e3b[_0x4458('0x2b')]['id']}})['then'](handleEntityNotFound(_0xd804f0,null))[_0x4458('0x25')](saveUpdates(_0x755e3b[_0x4458('0x3a')],null))[_0x4458('0x25')](respondWithResult(_0xd804f0,null))[_0x4458('0x39')](handleError(_0xd804f0,null));};exports['destroy']=function(_0x4d08d8,_0x3b573c){return db[_0x4458('0x2e')][_0x4458('0x38')]({'where':{'id':_0x4d08d8['params']['id']}})[_0x4458('0x25')](handleEntityNotFound(_0x3b573c,null))[_0x4458('0x25')](removeEntity(_0x3b573c,null))[_0x4458('0x39')](handleError(_0x3b573c,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 448132d..613d905 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 _0x5e4a=['chat_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x1877a0,_0x5353f6){var _0x49b933=function(_0x288094){while(--_0x288094){_0x1877a0['push'](_0x1877a0['shift']());}};_0x49b933(++_0x5353f6);}(_0x5e4a,0x1b5));var _0xa5e4=function(_0x1e68ef,_0x4546e7){_0x1e68ef=_0x1e68ef-0x0;var _0x547bfa=_0x5e4a[_0x1e68ef];return _0x547bfa;};'use strict';var _=require(_0xa5e4('0x0'));var util=require(_0xa5e4('0x1'));var logger=require(_0xa5e4('0x2'))(_0xa5e4('0x3'));var moment=require(_0xa5e4('0x4'));var BPromise=require(_0xa5e4('0x5'));var rp=require(_0xa5e4('0x6'));var fs=require('fs');var path=require(_0xa5e4('0x7'));var rimraf=require(_0xa5e4('0x8'));var config=require(_0xa5e4('0x9'));var attributes=require(_0xa5e4('0xa'));module[_0xa5e4('0xb')]=function(_0x249dc9,_0x5ca551){return _0x249dc9[_0xa5e4('0xc')]('ChatApplication',attributes,{'tableName':_0xa5e4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa5e4('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xca66=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5f2f8f,_0x13390a){var _0x454a0f=function(_0x2c5b71){while(--_0x2c5b71){_0x5f2f8f['push'](_0x5f2f8f['shift']());}};_0x454a0f(++_0x13390a);}(_0xca66,0xb3));var _0x6ca6=function(_0x18626c,_0x4dc2c1){_0x18626c=_0x18626c-0x0;var _0x4b5de6=_0xca66[_0x18626c];return _0x4b5de6;};'use strict';var _=require(_0x6ca6('0x0'));var util=require('util');var logger=require(_0x6ca6('0x1'))(_0x6ca6('0x2'));var moment=require(_0x6ca6('0x3'));var BPromise=require('bluebird');var rp=require(_0x6ca6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ca6('0x5'));var config=require(_0x6ca6('0x6'));var attributes=require(_0x6ca6('0x7'));module[_0x6ca6('0x8')]=function(_0x132583,_0x4ab56d){return _0x132583['define'](_0x6ca6('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6ca6('0xa'),'collate':_0x6ca6('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 9f359ad..1235526 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 _0x82df=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','bluebird','ioredis','../../mysqldb'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x82df,0xb1));var _0xf82d=function(_0xefd9a0,_0x663dcd){_0xefd9a0=_0xefd9a0-0x0;var _0x355f43=_0x82df[_0xefd9a0];return _0x355f43;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf82d('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf82d('0x1'));var db=require(_0xf82d('0x2'))['db'];var utils=require(_0xf82d('0x3'));var logger=require('../../config/logger')(_0xf82d('0x4'));var config=require(_0xf82d('0x5'));var jayson=require(_0xf82d('0x6'));var client=jayson[_0xf82d('0x7')][_0xf82d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6853b5,_0x4878a0,_0x18ea7a){return new BPromise(function(_0x7d3cd0,_0x5a7bc4){return client[_0xf82d('0x9')](_0x6853b5,_0x18ea7a)[_0xf82d('0xa')](function(_0x300cad){logger['info'](_0xf82d('0xb'),_0x4878a0,_0xf82d('0xc'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4878a0,_0xf82d('0xc'),JSON['stringify'](_0x300cad));if(_0x300cad[_0xf82d('0xd')]){if(_0x300cad[_0xf82d('0xd')]['code']===0x1f4){logger[_0xf82d('0xd')]('ChatApplication,\x20%s,\x20%s',_0x4878a0,_0x300cad['error']['message']);return _0x5a7bc4(_0x300cad[_0xf82d('0xd')][_0xf82d('0xe')]);}logger['error'](_0xf82d('0xb'),_0x4878a0,_0x300cad['error']['message']);return _0x7d3cd0(_0x300cad['error']['message']);}else{logger[_0xf82d('0xf')](_0xf82d('0xb'),_0x4878a0,_0xf82d('0xc'));_0x7d3cd0(_0x300cad[_0xf82d('0x10')][_0xf82d('0xe')]);}})[_0xf82d('0x11')](function(_0x1996b8){logger['error'](_0xf82d('0xb'),_0x4878a0,_0x1996b8);_0x5a7bc4(_0x1996b8);});});}
\ No newline at end of file
+var _0xf5b7=['http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x40bc88,_0x5c07fd){var _0xa87651=function(_0x2170b3){while(--_0x2170b3){_0x40bc88['push'](_0x40bc88['shift']());}};_0xa87651(++_0x5c07fd);}(_0xf5b7,0x76));var _0x7f5b=function(_0x354357,_0x876b35){_0x354357=_0x354357-0x0;var _0x438970=_0xf5b7[_0x354357];return _0x438970;};'use strict';var _=require(_0x7f5b('0x0'));var util=require('util');var moment=require(_0x7f5b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f5b('0x2'));var db=require(_0x7f5b('0x3'))['db'];var utils=require(_0x7f5b('0x4'));var logger=require(_0x7f5b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7f5b('0x6'));var client=jayson[_0x7f5b('0x7')][_0x7f5b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53c05e,_0x221649,_0x195bfa){return new BPromise(function(_0x4ba61e,_0x4eff87){return client[_0x7f5b('0x9')](_0x53c05e,_0x195bfa)[_0x7f5b('0xa')](function(_0x5cc2f9){logger[_0x7f5b('0xb')]('ChatApplication,\x20%s,\x20%s',_0x221649,_0x7f5b('0xc'));logger[_0x7f5b('0xd')](_0x7f5b('0xe'),_0x221649,_0x7f5b('0xc'),JSON['stringify'](_0x5cc2f9));if(_0x5cc2f9[_0x7f5b('0xf')]){if(_0x5cc2f9[_0x7f5b('0xf')][_0x7f5b('0x10')]===0x1f4){logger[_0x7f5b('0xf')](_0x7f5b('0x11'),_0x221649,_0x5cc2f9[_0x7f5b('0xf')][_0x7f5b('0x12')]);return _0x4eff87(_0x5cc2f9[_0x7f5b('0xf')][_0x7f5b('0x12')]);}logger[_0x7f5b('0xf')]('ChatApplication,\x20%s,\x20%s',_0x221649,_0x5cc2f9['error'][_0x7f5b('0x12')]);return _0x4ba61e(_0x5cc2f9['error'][_0x7f5b('0x12')]);}else{logger[_0x7f5b('0xb')](_0x7f5b('0x11'),_0x221649,_0x7f5b('0xc'));_0x4ba61e(_0x5cc2f9[_0x7f5b('0x13')][_0x7f5b('0x12')]);}})[_0x7f5b('0x14')](function(_0x1e3203){logger[_0x7f5b('0xf')](_0x7f5b('0x11'),_0x221649,_0x1e3203);_0x4eff87(_0x1e3203);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 529ca3c..9eab644 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 _0x42de=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x42de,0x9d));var _0xe42d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x42de[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xe42d('0x0'));var util=require(_0xe42d('0x1'));var path=require(_0xe42d('0x2'));var timeout=require(_0xe42d('0x3'));var express=require(_0xe42d('0x4'));var router=express[_0xe42d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe42d('0x6'));var interaction=require(_0xe42d('0x7'));var config=require(_0xe42d('0x8'));var controller=require(_0xe42d('0x9'));router[_0xe42d('0xa')](_0xe42d('0xb'),auth[_0xe42d('0xc')](),controller[_0xe42d('0xd')]);router[_0xe42d('0xe')](_0xe42d('0xb'),auth['isAuthenticated'](),controller[_0xe42d('0xf')]);router[_0xe42d('0x10')](_0xe42d('0xb'),auth['isAuthenticated'](),controller[_0xe42d('0x11')]);module[_0xe42d('0x12')]=router;
\ No newline at end of file
+var _0x30af=['/:id','isAuthenticated','show','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','get'];(function(_0x23002b,_0x33cc05){var _0x54a86c=function(_0x39d003){while(--_0x39d003){_0x23002b['push'](_0x23002b['shift']());}};_0x54a86c(++_0x33cc05);}(_0x30af,0x1c0));var _0xf30a=function(_0x27380a,_0x11b4db){_0x27380a=_0x27380a-0x0;var _0x49557d=_0x30af[_0x27380a];return _0x49557d;};'use strict';var multer=require(_0xf30a('0x0'));var util=require(_0xf30a('0x1'));var path=require(_0xf30a('0x2'));var timeout=require(_0xf30a('0x3'));var express=require(_0xf30a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf30a('0x5'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xf30a('0x6')](_0xf30a('0x7'),auth[_0xf30a('0x8')](),controller[_0xf30a('0x9')]);router['put'](_0xf30a('0x7'),auth['isAuthenticated'](),controller[_0xf30a('0xa')]);router['delete'](_0xf30a('0x7'),auth[_0xf30a('0x8')](),controller[_0xf30a('0xb')]);module[_0xf30a('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index de9bb02..36601b7 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 _0xe0c1=['BOOLEAN','sequelize','exports','STRING'];(function(_0x5c3c83,_0x4929ef){var _0x1713b9=function(_0x1fd80d){while(--_0x1fd80d){_0x5c3c83['push'](_0x5c3c83['shift']());}};_0x1713b9(++_0x4929ef);}(_0xe0c1,0x175));var _0x1e0c=function(_0xa40467,_0x97ce36){_0xa40467=_0xa40467-0x0;var _0x12f835=_0xe0c1[_0xa40467];return _0x12f835;};'use strict';var Sequelize=require(_0x1e0c('0x0'));module[_0x1e0c('0x1')]={'name':{'type':Sequelize[_0x1e0c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1e0c('0x2')]},'write':{'type':Sequelize[_0x1e0c('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x09b1=['exports','STRING','BOOLEAN','sequelize'];(function(_0x17afb2,_0x261563){var _0x4cb006=function(_0x5b3b29){while(--_0x5b3b29){_0x17afb2['push'](_0x17afb2['shift']());}};_0x4cb006(++_0x261563);}(_0x09b1,0xa7));var _0x109b=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x09b1[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0x109b('0x0'));module[_0x109b('0x1')]={'name':{'type':Sequelize[_0x109b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x109b('0x2')]},'write':{'type':Sequelize[_0x109b('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index acf327c..40befe6 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 _0x40e2=['redis','./chatGroup.socket','register','offset','limit','undefined','count','status','Content-Range','json','apply','reject','save','update','then','end','stack','name','map','ChatGroup','rawAttributes','fieldName','type','key','keys','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','destroy','describe','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter'];(function(_0x187399,_0x40c56d){var _0x40fa92=function(_0x36058c){while(--_0x36058c){_0x187399['push'](_0x187399['shift']());}};_0x40fa92(++_0x40c56d);}(_0x40e2,0x15d));var _0x240e=function(_0x42abd1,_0x7d92f2){_0x42abd1=_0x42abd1-0x0;var _0x115bc1=_0x40e2[_0x42abd1];return _0x115bc1;};'use strict';var emlformat=require(_0x240e('0x0'));var rimraf=require(_0x240e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x240e('0x2'));var moment=require(_0x240e('0x3'));var BPromise=require(_0x240e('0x4'));var Mustache=require(_0x240e('0x5'));var util=require('util');var path=require(_0x240e('0x6'));var sox=require(_0x240e('0x7'));var csv=require(_0x240e('0x8'));var ejs=require(_0x240e('0x9'));var fs=require('fs');var fs_extra=require(_0x240e('0xa'));var _=require(_0x240e('0xb'));var squel=require(_0x240e('0xc'));var crypto=require(_0x240e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x240e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x240e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x240e('0x10'));var qs=require(_0x240e('0x11'));var as=require(_0x240e('0x12'));var hardwareService=require(_0x240e('0x13'));var logger=require('../../config/logger')(_0x240e('0x14'));var utils=require(_0x240e('0x15'));var config=require(_0x240e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x240e('0x17'))['db'];config['redis']=_[_0x240e('0x18')](config['redis'],{'host':_0x240e('0x19'),'port':0x18eb});var socket=require(_0x240e('0x1a'))(new Redis(config[_0x240e('0x1b')]));require(_0x240e('0x1c'))[_0x240e('0x1d')](socket);function respondWithStatusCode(_0x4ea60b,_0x117244){_0x117244=_0x117244||0xcc;return function(_0x5db782){if(_0x5db782){return _0x4ea60b['sendStatus'](_0x117244);}return _0x4ea60b['status'](_0x117244)['end']();};}function respondWithResult(_0x189a08,_0x2966ac){_0x2966ac=_0x2966ac||0xc8;return function(_0x44c50c){if(_0x44c50c){return _0x189a08['status'](_0x2966ac)['json'](_0x44c50c);}};}function respondWithFilteredResult(_0x2dc614,_0x1572c8){return function(_0x2b80b4){if(_0x2b80b4){var _0x427c2f=typeof _0x1572c8[_0x240e('0x1e')]==='undefined'&&typeof _0x1572c8[_0x240e('0x1f')]===_0x240e('0x20');var _0x26a4de=_0x2b80b4['count'];var _0x174452=_0x427c2f?0x0:_0x1572c8[_0x240e('0x1e')];var _0x4517e5=_0x427c2f?_0x2b80b4[_0x240e('0x21')]:_0x1572c8[_0x240e('0x1e')]+_0x1572c8[_0x240e('0x1f')];var _0x441f6e;if(_0x4517e5>=_0x26a4de){_0x4517e5=_0x26a4de;_0x441f6e=0xc8;}else{_0x441f6e=0xce;}_0x2dc614[_0x240e('0x22')](_0x441f6e);return _0x2dc614['set'](_0x240e('0x23'),_0x174452+'-'+_0x4517e5+'/'+_0x26a4de)[_0x240e('0x24')](_0x2b80b4);}return null;};}function patchUpdates(_0x170a9c){return function(_0x233bcd){try{jsonpatch[_0x240e('0x25')](_0x233bcd,_0x170a9c,!![]);}catch(_0x38ad95){return BPromise[_0x240e('0x26')](_0x38ad95);}return _0x233bcd[_0x240e('0x27')]();};}function saveUpdates(_0x47fbd1,_0xf1f331){return function(_0x1b4e96){if(_0x1b4e96){return _0x1b4e96[_0x240e('0x28')](_0x47fbd1)[_0x240e('0x29')](function(_0x4fcb21){return _0x4fcb21;});}return null;};}function removeEntity(_0x3c6e9d,_0x14da96){return function(_0xaef70a){if(_0xaef70a){return _0xaef70a['destroy']()[_0x240e('0x29')](function(){_0x3c6e9d[_0x240e('0x22')](0xcc)[_0x240e('0x2a')]();});}};}function handleEntityNotFound(_0x390c98,_0x4953cc){return function(_0x4c8082){if(!_0x4c8082){_0x390c98['sendStatus'](0x194);}return _0x4c8082;};}function handleError(_0x47e1cf,_0x5a5060){_0x5a5060=_0x5a5060||0x1f4;return function(_0x4b9b57){logger['error'](_0x4b9b57[_0x240e('0x2b')]);if(_0x4b9b57[_0x240e('0x2c')]){delete _0x4b9b57[_0x240e('0x2c')];}_0x47e1cf[_0x240e('0x22')](_0x5a5060)['send'](_0x4b9b57);};}exports['index']=function(_0x45217,_0x291b49){var _0x4da16d={},_0x4f78d8={},_0x37a24a={'count':0x0,'rows':[]};var _0x492b4d=_[_0x240e('0x2d')](db[_0x240e('0x2e')][_0x240e('0x2f')],function(_0x172709){return{'name':_0x172709[_0x240e('0x30')],'type':_0x172709[_0x240e('0x31')][_0x240e('0x32')]};});_0x4f78d8['model']=_[_0x240e('0x2d')](_0x492b4d,_0x240e('0x2c'));_0x4f78d8['query']=_[_0x240e('0x33')](_0x45217[_0x240e('0x34')]);_0x4f78d8['filters']=_['intersection'](_0x4f78d8[_0x240e('0x35')],_0x4f78d8['query']);_0x4da16d['attributes']=_[_0x240e('0x36')](_0x4f78d8[_0x240e('0x35')],qs['fields'](_0x45217[_0x240e('0x34')][_0x240e('0x37')]));_0x4da16d[_0x240e('0x38')]=_0x4da16d[_0x240e('0x38')][_0x240e('0x39')]?_0x4da16d[_0x240e('0x38')]:_0x4f78d8[_0x240e('0x35')];if(!_0x45217[_0x240e('0x34')][_0x240e('0x3a')](_0x240e('0x3b'))){_0x4da16d[_0x240e('0x1f')]=qs[_0x240e('0x1f')](_0x45217[_0x240e('0x34')][_0x240e('0x1f')]);_0x4da16d[_0x240e('0x1e')]=qs[_0x240e('0x1e')](_0x45217['query'][_0x240e('0x1e')]);}_0x4da16d[_0x240e('0x3c')]=qs[_0x240e('0x3d')](_0x45217['query'][_0x240e('0x3d')]);_0x4da16d[_0x240e('0x3e')]=qs[_0x240e('0x3f')](_[_0x240e('0x40')](_0x45217['query'],_0x4f78d8[_0x240e('0x3f')]),_0x492b4d);if(_0x45217[_0x240e('0x34')][_0x240e('0x41')]){_0x4da16d['where']=_[_0x240e('0x42')](_0x4da16d['where'],{'$or':_[_0x240e('0x2d')](_0x492b4d,function(_0x5f0ad1){if(_0x5f0ad1['type']!==_0x240e('0x43')){var _0x4f3de5={};_0x4f3de5[_0x5f0ad1[_0x240e('0x2c')]]={'$like':'%'+_0x45217[_0x240e('0x34')][_0x240e('0x41')]+'%'};return _0x4f3de5;}})});}_0x4da16d=_[_0x240e('0x42')]({},_0x4da16d,_0x45217[_0x240e('0x44')]);var _0x45376c={'where':_0x4da16d['where']};return db[_0x240e('0x2e')][_0x240e('0x21')](_0x45376c)[_0x240e('0x29')](function(_0x406d82){_0x37a24a[_0x240e('0x21')]=_0x406d82;if(_0x45217['query'][_0x240e('0x45')]){_0x4da16d['include']=[{'all':!![]}];}return db['ChatGroup'][_0x240e('0x46')](_0x4da16d);})[_0x240e('0x29')](function(_0x394b5e){_0x37a24a['rows']=_0x394b5e;return _0x37a24a;})['then'](respondWithFilteredResult(_0x291b49,_0x4da16d))[_0x240e('0x47')](handleError(_0x291b49,null));};exports[_0x240e('0x48')]=function(_0x756b96,_0x5433e8){var _0x3b7bde={'raw':!![],'where':{'id':_0x756b96[_0x240e('0x49')]['id']}},_0x596658={};_0x596658['model']=_[_0x240e('0x33')](db[_0x240e('0x2e')][_0x240e('0x2f')]);_0x596658[_0x240e('0x34')]=_[_0x240e('0x33')](_0x756b96[_0x240e('0x34')]);_0x596658[_0x240e('0x3f')]=_[_0x240e('0x36')](_0x596658[_0x240e('0x35')],_0x596658['query']);_0x3b7bde[_0x240e('0x38')]=_['intersection'](_0x596658[_0x240e('0x35')],qs['fields'](_0x756b96['query'][_0x240e('0x37')]));_0x3b7bde['attributes']=_0x3b7bde[_0x240e('0x38')][_0x240e('0x39')]?_0x3b7bde[_0x240e('0x38')]:_0x596658[_0x240e('0x35')];if(_0x756b96[_0x240e('0x34')][_0x240e('0x45')]){_0x3b7bde[_0x240e('0x4a')]=[{'all':!![]}];}_0x3b7bde=_[_0x240e('0x42')]({},_0x3b7bde,_0x756b96[_0x240e('0x44')]);return db['ChatGroup'][_0x240e('0x4b')](_0x3b7bde)['then'](handleEntityNotFound(_0x5433e8,null))['then'](respondWithResult(_0x5433e8,null))['catch'](handleError(_0x5433e8,null));};exports[_0x240e('0x4c')]=function(_0x3ff153,_0x19f6e3){return db['ChatGroup'][_0x240e('0x4c')](_0x3ff153[_0x240e('0x4d')],{})[_0x240e('0x29')](respondWithResult(_0x19f6e3,0xc9))[_0x240e('0x47')](handleError(_0x19f6e3,null));};exports[_0x240e('0x28')]=function(_0x2638d1,_0x28e0c6){if(_0x2638d1['body']['id']){delete _0x2638d1[_0x240e('0x4d')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x2638d1['params']['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x28e0c6,null))[_0x240e('0x29')](saveUpdates(_0x2638d1['body'],null))['then'](respondWithResult(_0x28e0c6,null))[_0x240e('0x47')](handleError(_0x28e0c6,null));};exports[_0x240e('0x4e')]=function(_0x4e10c4,_0x3dd92e){return db[_0x240e('0x2e')][_0x240e('0x4b')]({'where':{'id':_0x4e10c4['params']['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x3dd92e,null))[_0x240e('0x29')](removeEntity(_0x3dd92e,null))[_0x240e('0x47')](handleError(_0x3dd92e,null));};exports[_0x240e('0x4f')]=function(_0x34893e,_0x4947da){return db[_0x240e('0x2e')][_0x240e('0x4f')]()['then'](respondWithResult(_0x4947da,null))[_0x240e('0x47')](handleError(_0x4947da,null));};exports['getUnread']=function(_0x5ef313,_0x1d2bae,_0x26aa2f){return db[_0x240e('0x50')]['count']({'where':{'ChatGroupId':_0x5ef313[_0x240e('0x49')]['id'],'ToId':_0x5ef313['user']['id'],'read':![]}})[_0x240e('0x29')](function(_0x316acd){return{'id':_[_0x240e('0x51')](_0x5ef313['params']['id']),'count':_0x316acd};})[_0x240e('0x29')](respondWithResult(_0x1d2bae,null))['catch'](handleError(_0x1d2bae,null));};exports[_0x240e('0x52')]=function(_0x1835a6,_0x409048,_0x48fe52){return db[_0x240e('0x2e')][_0x240e('0x4b')]({'where':{'id':_0x1835a6[_0x240e('0x49')]['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x409048,null))[_0x240e('0x29')](function(_0x540c47){if(_0x540c47){return _0x540c47[_0x240e('0x52')](_0x1835a6[_0x240e('0x4d')][_0x240e('0x53')],_['omit'](_0x1835a6['body'],[_0x240e('0x53'),'id'])||{});}})[_0x240e('0x29')](respondWithResult(_0x409048,null))['catch'](handleError(_0x409048,null));};exports[_0x240e('0x54')]=function(_0x2376e8,_0x1e15f4,_0x596959){var _0x314776={};var _0x3a7c78={};var _0x414ae7;var _0x402fa8;return db['ChatGroup'][_0x240e('0x55')]({'where':{'id':_0x2376e8[_0x240e('0x49')]['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x1e15f4,null))['then'](function(_0x3c1659){if(_0x3c1659){_0x414ae7=_0x3c1659;_0x3a7c78[_0x240e('0x35')]=_[_0x240e('0x33')](db[_0x240e('0x56')][_0x240e('0x2f')]);_0x3a7c78[_0x240e('0x34')]=_[_0x240e('0x33')](_0x2376e8['query']);_0x3a7c78['filters']=_[_0x240e('0x36')](_0x3a7c78['model'],_0x3a7c78[_0x240e('0x34')]);_0x314776[_0x240e('0x38')]=_['intersection'](_0x3a7c78[_0x240e('0x35')],qs[_0x240e('0x37')](_0x2376e8[_0x240e('0x34')][_0x240e('0x37')]));_0x314776[_0x240e('0x38')]=_0x314776[_0x240e('0x38')][_0x240e('0x39')]?_0x314776[_0x240e('0x38')]:_0x3a7c78[_0x240e('0x35')];_0x314776['order']=qs[_0x240e('0x3d')](_0x2376e8['query'][_0x240e('0x3d')]);_0x314776['where']=qs[_0x240e('0x3f')](_[_0x240e('0x40')](_0x2376e8[_0x240e('0x34')],_0x3a7c78[_0x240e('0x3f')]));if(_0x2376e8[_0x240e('0x34')][_0x240e('0x41')]){_0x314776[_0x240e('0x3e')]=_[_0x240e('0x42')](_0x314776[_0x240e('0x3e')],{'$or':_[_0x240e('0x2d')](_0x314776[_0x240e('0x38')],function(_0x19f9e1){var _0x960955={};_0x960955[_0x19f9e1]={'$like':'%'+_0x2376e8[_0x240e('0x34')]['filter']+'%'};return _0x960955;})});}_0x314776=_['merge']({},_0x314776,_0x2376e8[_0x240e('0x44')]);return _0x414ae7[_0x240e('0x54')](_0x314776);}})['then'](function(_0x40353f){if(_0x40353f){_0x402fa8=_0x40353f[_0x240e('0x39')];if(!_0x2376e8[_0x240e('0x34')][_0x240e('0x3a')](_0x240e('0x3b'))){_0x314776['limit']=qs[_0x240e('0x1f')](_0x2376e8['query'][_0x240e('0x1f')]);_0x314776['offset']=qs[_0x240e('0x1e')](_0x2376e8[_0x240e('0x34')][_0x240e('0x1e')]);}return _0x414ae7[_0x240e('0x54')](_0x314776);}})[_0x240e('0x29')](function(_0x1be30d){if(_0x1be30d){return _0x1be30d?{'count':_0x402fa8,'rows':_0x1be30d}:null;}})['then'](respondWithResult(_0x1e15f4,null))[_0x240e('0x47')](handleError(_0x1e15f4,null));};exports[_0x240e('0x57')]=function(_0x5ef2a8,_0x35736e,_0x163d49){return db[_0x240e('0x2e')]['find']({'where':{'id':_0x5ef2a8[_0x240e('0x49')]['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x35736e,null))[_0x240e('0x29')](function(_0x5f2004){if(_0x5f2004){return _0x5f2004[_0x240e('0x57')](_0x5ef2a8[_0x240e('0x34')][_0x240e('0x53')]);}})['then'](respondWithStatusCode(_0x35736e,null))['catch'](handleError(_0x35736e,null));};exports[_0x240e('0x58')]=function(_0x4bd5db,_0x5c5dba,_0x52e7e9){if(_0x4bd5db[_0x240e('0x4d')]['id']){delete _0x4bd5db['body']['id'];}return db[_0x240e('0x2e')][_0x240e('0x4b')]({'where':{'id':_0x4bd5db[_0x240e('0x49')]['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x5c5dba,null))[_0x240e('0x29')](function(_0x9ecc39){if(_0x9ecc39){_0x4bd5db['body'][_0x240e('0x59')]=_0x9ecc39['id'];return db[_0x240e('0x50')][_0x240e('0x4c')](_0x4bd5db['body']);}})[_0x240e('0x29')](respondWithResult(_0x5c5dba,null))[_0x240e('0x47')](handleError(_0x5c5dba,null));};exports['getMessages']=function(_0x3841ec,_0x5e8e55,_0x15e8f6){var _0x322249={};var _0x37a370={};var _0x5a88d4;var _0x3c8773;return db[_0x240e('0x2e')]['findOne']({'where':{'id':_0x3841ec['params']['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x5e8e55,null))[_0x240e('0x29')](function(_0x599b9d){if(_0x599b9d){_0x5a88d4=_0x599b9d;_0x37a370[_0x240e('0x35')]=_[_0x240e('0x33')](db[_0x240e('0x50')][_0x240e('0x2f')]);_0x37a370[_0x240e('0x34')]=_[_0x240e('0x33')](_0x3841ec['query']);_0x37a370[_0x240e('0x3f')]=_[_0x240e('0x36')](_0x37a370['model'],_0x37a370[_0x240e('0x34')]);_0x322249[_0x240e('0x38')]=_['intersection'](_0x37a370['model'],qs[_0x240e('0x37')](_0x3841ec[_0x240e('0x34')]['fields']));_0x322249[_0x240e('0x38')]=_0x322249[_0x240e('0x38')][_0x240e('0x39')]?_0x322249[_0x240e('0x38')]:_0x37a370[_0x240e('0x35')];_0x322249[_0x240e('0x3c')]=qs[_0x240e('0x3d')](_0x3841ec['query'][_0x240e('0x3d')]);_0x322249[_0x240e('0x3e')]=qs[_0x240e('0x3f')](_[_0x240e('0x40')](_0x3841ec[_0x240e('0x34')],_0x37a370[_0x240e('0x3f')]));if(_0x3841ec['query'][_0x240e('0x41')]){_0x322249[_0x240e('0x3e')]=_[_0x240e('0x42')](_0x322249[_0x240e('0x3e')],{'$or':_[_0x240e('0x2d')](_0x322249[_0x240e('0x38')],function(_0x21a7a8){var _0x12e549={};_0x12e549[_0x21a7a8]={'$like':'%'+_0x3841ec['query']['filter']+'%'};return _0x12e549;})});}if(_0x3841ec[_0x240e('0x34')]['$gte']){var _0x5683cf=_0x3841ec[_0x240e('0x34')][_0x240e('0x5a')][_0x240e('0x5b')](',');var _0x33136f={};_0x33136f[_0x5683cf[0x0]]={'$gte':moment(_0x5683cf[0x1])[_0x240e('0x5c')](_0x240e('0x5d'))};_0x322249[_0x240e('0x3e')]=_[_0x240e('0x42')](_0x322249[_0x240e('0x3e')],_0x33136f);}_0x322249=_[_0x240e('0x42')]({},_0x322249,_0x3841ec[_0x240e('0x44')]);return _0x5a88d4['getMessages'](_0x322249);}})[_0x240e('0x29')](function(_0x268dfc){if(_0x268dfc){_0x3c8773=_0x268dfc[_0x240e('0x39')];if(!_0x3841ec[_0x240e('0x34')][_0x240e('0x3a')](_0x240e('0x3b'))){_0x322249[_0x240e('0x1f')]=qs[_0x240e('0x1f')](_0x3841ec[_0x240e('0x34')][_0x240e('0x1f')]);_0x322249[_0x240e('0x1e')]=qs[_0x240e('0x1e')](_0x3841ec[_0x240e('0x34')][_0x240e('0x1e')]);}return _0x5a88d4['getMessages'](_0x322249);}})[_0x240e('0x29')](function(_0xed495c){if(_0xed495c){return _0xed495c?{'count':_0x3c8773,'rows':_0xed495c}:null;}})['then'](respondWithResult(_0x5e8e55,null))[_0x240e('0x47')](handleError(_0x5e8e55,null));};
\ No newline at end of file
+var _0x4197=['create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','order','options','hasOwnProperty','removeMembers','addMessage','ChatGroupId','$gte','split','format','getMessages','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','map','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','ChatGroup','include','findAll','rows','catch','rawAttributes','find'];(function(_0x3f5309,_0x3f30e9){var _0x206858=function(_0x7a7a6f){while(--_0x7a7a6f){_0x3f5309['push'](_0x3f5309['shift']());}};_0x206858(++_0x3f30e9);}(_0x4197,0xd1));var _0x7419=function(_0x55bebc,_0x4dbb47){_0x55bebc=_0x55bebc-0x0;var _0x173674=_0x4197[_0x55bebc];return _0x173674;};'use strict';var emlformat=require(_0x7419('0x0'));var rimraf=require(_0x7419('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7419('0x2'));var rp=require(_0x7419('0x3'));var moment=require(_0x7419('0x4'));var BPromise=require(_0x7419('0x5'));var Mustache=require(_0x7419('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7419('0x7'));var csv=require('to-csv');var ejs=require(_0x7419('0x8'));var fs=require('fs');var fs_extra=require(_0x7419('0x9'));var _=require(_0x7419('0xa'));var squel=require(_0x7419('0xb'));var crypto=require('crypto');var jsforce=require(_0x7419('0xc'));var deskjs=require(_0x7419('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7419('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7419('0xf'));var qs=require(_0x7419('0x10'));var as=require(_0x7419('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7419('0x12'))(_0x7419('0x13'));var utils=require(_0x7419('0x14'));var config=require(_0x7419('0x15'));var licenseUtil=require(_0x7419('0x16'));var db=require('../../mysqldb')['db'];config[_0x7419('0x17')]=_['defaults'](config[_0x7419('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x7419('0x18'))(new Redis(config['redis']));require(_0x7419('0x19'))[_0x7419('0x1a')](socket);function respondWithStatusCode(_0x33c059,_0x4d78e3){_0x4d78e3=_0x4d78e3||0xcc;return function(_0x268342){if(_0x268342){return _0x33c059[_0x7419('0x1b')](_0x4d78e3);}return _0x33c059['status'](_0x4d78e3)[_0x7419('0x1c')]();};}function respondWithResult(_0x49107b,_0x2ccbe5){_0x2ccbe5=_0x2ccbe5||0xc8;return function(_0x57ff95){if(_0x57ff95){return _0x49107b['status'](_0x2ccbe5)['json'](_0x57ff95);}};}function respondWithFilteredResult(_0x5d35e4,_0x4029c8){return function(_0x2364e4){if(_0x2364e4){var _0x11b04c=typeof _0x4029c8['offset']===_0x7419('0x1d')&&typeof _0x4029c8[_0x7419('0x1e')]===_0x7419('0x1d');var _0x9269c2=_0x2364e4[_0x7419('0x1f')];var _0x15db56=_0x11b04c?0x0:_0x4029c8['offset'];var _0x36239c=_0x11b04c?_0x2364e4[_0x7419('0x1f')]:_0x4029c8[_0x7419('0x20')]+_0x4029c8['limit'];var _0x33861b;if(_0x36239c>=_0x9269c2){_0x36239c=_0x9269c2;_0x33861b=0xc8;}else{_0x33861b=0xce;}_0x5d35e4[_0x7419('0x21')](_0x33861b);return _0x5d35e4[_0x7419('0x22')](_0x7419('0x23'),_0x15db56+'-'+_0x36239c+'/'+_0x9269c2)[_0x7419('0x24')](_0x2364e4);}return null;};}function patchUpdates(_0xbb931a){return function(_0x598510){try{jsonpatch[_0x7419('0x25')](_0x598510,_0xbb931a,!![]);}catch(_0x147187){return BPromise[_0x7419('0x26')](_0x147187);}return _0x598510['save']();};}function saveUpdates(_0x151640,_0x52f537){return function(_0x505baf){if(_0x505baf){return _0x505baf[_0x7419('0x27')](_0x151640)['then'](function(_0x175064){return _0x175064;});}return null;};}function removeEntity(_0x53847a,_0x63e87){return function(_0x18f0c1){if(_0x18f0c1){return _0x18f0c1[_0x7419('0x28')]()[_0x7419('0x29')](function(){_0x53847a[_0x7419('0x21')](0xcc)[_0x7419('0x1c')]();});}};}function handleEntityNotFound(_0x4dbde6,_0x2ab777){return function(_0x548fb5){if(!_0x548fb5){_0x4dbde6[_0x7419('0x1b')](0x194);}return _0x548fb5;};}function handleError(_0x10631b,_0x56d966){_0x56d966=_0x56d966||0x1f4;return function(_0x1f291a){logger[_0x7419('0x2a')](_0x1f291a[_0x7419('0x2b')]);if(_0x1f291a['name']){delete _0x1f291a['name'];}_0x10631b[_0x7419('0x21')](_0x56d966)['send'](_0x1f291a);};}exports['index']=function(_0x5d1be1,_0x3e351c){var _0x104eec={},_0x4bc9a3={},_0x224761={'count':0x0,'rows':[]};var _0x6b8e60=_[_0x7419('0x2c')](db['ChatGroup']['rawAttributes'],function(_0x29876b){return{'name':_0x29876b[_0x7419('0x2d')],'type':_0x29876b[_0x7419('0x2e')][_0x7419('0x2f')]};});_0x4bc9a3[_0x7419('0x30')]=_[_0x7419('0x2c')](_0x6b8e60,_0x7419('0x31'));_0x4bc9a3['query']=_[_0x7419('0x32')](_0x5d1be1[_0x7419('0x33')]);_0x4bc9a3[_0x7419('0x34')]=_[_0x7419('0x35')](_0x4bc9a3['model'],_0x4bc9a3[_0x7419('0x33')]);_0x104eec[_0x7419('0x36')]=_[_0x7419('0x35')](_0x4bc9a3[_0x7419('0x30')],qs['fields'](_0x5d1be1[_0x7419('0x33')][_0x7419('0x37')]));_0x104eec[_0x7419('0x36')]=_0x104eec[_0x7419('0x36')][_0x7419('0x38')]?_0x104eec['attributes']:_0x4bc9a3['model'];if(!_0x5d1be1['query']['hasOwnProperty']('nolimit')){_0x104eec['limit']=qs[_0x7419('0x1e')](_0x5d1be1[_0x7419('0x33')][_0x7419('0x1e')]);_0x104eec['offset']=qs[_0x7419('0x20')](_0x5d1be1['query'][_0x7419('0x20')]);}_0x104eec['order']=qs[_0x7419('0x39')](_0x5d1be1['query'][_0x7419('0x39')]);_0x104eec[_0x7419('0x3a')]=qs[_0x7419('0x34')](_[_0x7419('0x3b')](_0x5d1be1[_0x7419('0x33')],_0x4bc9a3['filters']),_0x6b8e60);if(_0x5d1be1[_0x7419('0x33')][_0x7419('0x3c')]){_0x104eec[_0x7419('0x3a')]=_[_0x7419('0x3d')](_0x104eec['where'],{'$or':_[_0x7419('0x2c')](_0x6b8e60,function(_0x10e0d7){if(_0x10e0d7['type']!==_0x7419('0x3e')){var _0x30253d={};_0x30253d[_0x10e0d7[_0x7419('0x31')]]={'$like':'%'+_0x5d1be1[_0x7419('0x33')][_0x7419('0x3c')]+'%'};return _0x30253d;}})});}_0x104eec=_[_0x7419('0x3d')]({},_0x104eec,_0x5d1be1['options']);var _0x1c5e28={'where':_0x104eec[_0x7419('0x3a')]};return db[_0x7419('0x3f')][_0x7419('0x1f')](_0x1c5e28)[_0x7419('0x29')](function(_0x377c58){_0x224761[_0x7419('0x1f')]=_0x377c58;if(_0x5d1be1['query']['includeAll']){_0x104eec[_0x7419('0x40')]=[{'all':!![]}];}return db[_0x7419('0x3f')][_0x7419('0x41')](_0x104eec);})[_0x7419('0x29')](function(_0x427738){_0x224761[_0x7419('0x42')]=_0x427738;return _0x224761;})[_0x7419('0x29')](respondWithFilteredResult(_0x3e351c,_0x104eec))[_0x7419('0x43')](handleError(_0x3e351c,null));};exports['show']=function(_0x75829e,_0x1a867a){var _0x352ac7={'raw':!![],'where':{'id':_0x75829e['params']['id']}},_0x555426={};_0x555426[_0x7419('0x30')]=_[_0x7419('0x32')](db[_0x7419('0x3f')][_0x7419('0x44')]);_0x555426[_0x7419('0x33')]=_[_0x7419('0x32')](_0x75829e['query']);_0x555426[_0x7419('0x34')]=_[_0x7419('0x35')](_0x555426[_0x7419('0x30')],_0x555426[_0x7419('0x33')]);_0x352ac7[_0x7419('0x36')]=_[_0x7419('0x35')](_0x555426[_0x7419('0x30')],qs[_0x7419('0x37')](_0x75829e[_0x7419('0x33')][_0x7419('0x37')]));_0x352ac7[_0x7419('0x36')]=_0x352ac7[_0x7419('0x36')][_0x7419('0x38')]?_0x352ac7[_0x7419('0x36')]:_0x555426[_0x7419('0x30')];if(_0x75829e['query']['includeAll']){_0x352ac7[_0x7419('0x40')]=[{'all':!![]}];}_0x352ac7=_[_0x7419('0x3d')]({},_0x352ac7,_0x75829e['options']);return db[_0x7419('0x3f')][_0x7419('0x45')](_0x352ac7)['then'](handleEntityNotFound(_0x1a867a,null))[_0x7419('0x29')](respondWithResult(_0x1a867a,null))['catch'](handleError(_0x1a867a,null));};exports['create']=function(_0x4c4981,_0x210ff7){return db[_0x7419('0x3f')][_0x7419('0x46')](_0x4c4981[_0x7419('0x47')],{})['then'](respondWithResult(_0x210ff7,0xc9))[_0x7419('0x43')](handleError(_0x210ff7,null));};exports[_0x7419('0x27')]=function(_0x5d31f5,_0x366135){if(_0x5d31f5[_0x7419('0x47')]['id']){delete _0x5d31f5[_0x7419('0x47')]['id'];}return db[_0x7419('0x3f')][_0x7419('0x45')]({'where':{'id':_0x5d31f5['params']['id']}})[_0x7419('0x29')](handleEntityNotFound(_0x366135,null))[_0x7419('0x29')](saveUpdates(_0x5d31f5['body'],null))[_0x7419('0x29')](respondWithResult(_0x366135,null))[_0x7419('0x43')](handleError(_0x366135,null));};exports[_0x7419('0x28')]=function(_0x15206d,_0x43dc5a){return db['ChatGroup'][_0x7419('0x45')]({'where':{'id':_0x15206d[_0x7419('0x48')]['id']}})[_0x7419('0x29')](handleEntityNotFound(_0x43dc5a,null))[_0x7419('0x29')](removeEntity(_0x43dc5a,null))['catch'](handleError(_0x43dc5a,null));};exports[_0x7419('0x49')]=function(_0x151e54,_0x5c7071){return db[_0x7419('0x3f')]['describe']()[_0x7419('0x29')](respondWithResult(_0x5c7071,null))[_0x7419('0x43')](handleError(_0x5c7071,null));};exports[_0x7419('0x4a')]=function(_0x3f5f91,_0xad6424,_0x462ca7){return db[_0x7419('0x4b')][_0x7419('0x1f')]({'where':{'ChatGroupId':_0x3f5f91['params']['id'],'ToId':_0x3f5f91[_0x7419('0x4c')]['id'],'read':![]}})[_0x7419('0x29')](function(_0x14fa47){return{'id':_[_0x7419('0x4d')](_0x3f5f91['params']['id']),'count':_0x14fa47};})[_0x7419('0x29')](respondWithResult(_0xad6424,null))[_0x7419('0x43')](handleError(_0xad6424,null));};exports[_0x7419('0x4e')]=function(_0x176d50,_0x1b1edb,_0x558b4d){return db[_0x7419('0x3f')][_0x7419('0x45')]({'where':{'id':_0x176d50[_0x7419('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b1edb,null))[_0x7419('0x29')](function(_0x34d34d){if(_0x34d34d){return _0x34d34d[_0x7419('0x4e')](_0x176d50[_0x7419('0x47')][_0x7419('0x4f')],_['omit'](_0x176d50['body'],[_0x7419('0x4f'),'id'])||{});}})[_0x7419('0x29')](respondWithResult(_0x1b1edb,null))[_0x7419('0x43')](handleError(_0x1b1edb,null));};exports[_0x7419('0x50')]=function(_0x43f225,_0x202aa4,_0x32646d){var _0x5f8355={};var _0x1dd8d0={};var _0x5a166d;var _0x46bd9e;return db[_0x7419('0x3f')][_0x7419('0x51')]({'where':{'id':_0x43f225[_0x7419('0x48')]['id']}})[_0x7419('0x29')](handleEntityNotFound(_0x202aa4,null))[_0x7419('0x29')](function(_0x4715d7){if(_0x4715d7){_0x5a166d=_0x4715d7;_0x1dd8d0[_0x7419('0x30')]=_['keys'](db['User']['rawAttributes']);_0x1dd8d0[_0x7419('0x33')]=_[_0x7419('0x32')](_0x43f225[_0x7419('0x33')]);_0x1dd8d0[_0x7419('0x34')]=_['intersection'](_0x1dd8d0[_0x7419('0x30')],_0x1dd8d0[_0x7419('0x33')]);_0x5f8355[_0x7419('0x36')]=_['intersection'](_0x1dd8d0[_0x7419('0x30')],qs[_0x7419('0x37')](_0x43f225['query']['fields']));_0x5f8355[_0x7419('0x36')]=_0x5f8355['attributes'][_0x7419('0x38')]?_0x5f8355[_0x7419('0x36')]:_0x1dd8d0[_0x7419('0x30')];_0x5f8355[_0x7419('0x52')]=qs[_0x7419('0x39')](_0x43f225[_0x7419('0x33')][_0x7419('0x39')]);_0x5f8355[_0x7419('0x3a')]=qs[_0x7419('0x34')](_[_0x7419('0x3b')](_0x43f225[_0x7419('0x33')],_0x1dd8d0['filters']));if(_0x43f225['query']['filter']){_0x5f8355[_0x7419('0x3a')]=_[_0x7419('0x3d')](_0x5f8355[_0x7419('0x3a')],{'$or':_[_0x7419('0x2c')](_0x5f8355[_0x7419('0x36')],function(_0x50354f){var _0x1ceb8e={};_0x1ceb8e[_0x50354f]={'$like':'%'+_0x43f225['query'][_0x7419('0x3c')]+'%'};return _0x1ceb8e;})});}_0x5f8355=_[_0x7419('0x3d')]({},_0x5f8355,_0x43f225[_0x7419('0x53')]);return _0x5a166d[_0x7419('0x50')](_0x5f8355);}})['then'](function(_0x21f077){if(_0x21f077){_0x46bd9e=_0x21f077[_0x7419('0x38')];if(!_0x43f225[_0x7419('0x33')][_0x7419('0x54')]('nolimit')){_0x5f8355[_0x7419('0x1e')]=qs['limit'](_0x43f225['query'][_0x7419('0x1e')]);_0x5f8355[_0x7419('0x20')]=qs['offset'](_0x43f225['query'][_0x7419('0x20')]);}return _0x5a166d[_0x7419('0x50')](_0x5f8355);}})[_0x7419('0x29')](function(_0x5a4fb5){if(_0x5a4fb5){return _0x5a4fb5?{'count':_0x46bd9e,'rows':_0x5a4fb5}:null;}})[_0x7419('0x29')](respondWithResult(_0x202aa4,null))['catch'](handleError(_0x202aa4,null));};exports[_0x7419('0x55')]=function(_0x2093df,_0x434534,_0x55e406){return db['ChatGroup'][_0x7419('0x45')]({'where':{'id':_0x2093df[_0x7419('0x48')]['id']}})[_0x7419('0x29')](handleEntityNotFound(_0x434534,null))[_0x7419('0x29')](function(_0x302cc5){if(_0x302cc5){return _0x302cc5[_0x7419('0x55')](_0x2093df[_0x7419('0x33')][_0x7419('0x4f')]);}})['then'](respondWithStatusCode(_0x434534,null))['catch'](handleError(_0x434534,null));};exports[_0x7419('0x56')]=function(_0x28e6db,_0x3d867c,_0x5361a0){if(_0x28e6db['body']['id']){delete _0x28e6db[_0x7419('0x47')]['id'];}return db[_0x7419('0x3f')]['find']({'where':{'id':_0x28e6db['params']['id']}})[_0x7419('0x29')](handleEntityNotFound(_0x3d867c,null))[_0x7419('0x29')](function(_0x88cd14){if(_0x88cd14){_0x28e6db['body'][_0x7419('0x57')]=_0x88cd14['id'];return db[_0x7419('0x4b')][_0x7419('0x46')](_0x28e6db['body']);}})[_0x7419('0x29')](respondWithResult(_0x3d867c,null))['catch'](handleError(_0x3d867c,null));};exports['getMessages']=function(_0x2924a4,_0x494c58,_0x2ef965){var _0xf112d9={};var _0x2d5e0f={};var _0x48de85;var _0x53d2bf;return db['ChatGroup'][_0x7419('0x51')]({'where':{'id':_0x2924a4[_0x7419('0x48')]['id']}})[_0x7419('0x29')](handleEntityNotFound(_0x494c58,null))[_0x7419('0x29')](function(_0x4a6048){if(_0x4a6048){_0x48de85=_0x4a6048;_0x2d5e0f[_0x7419('0x30')]=_['keys'](db['ChatInternalMessage'][_0x7419('0x44')]);_0x2d5e0f[_0x7419('0x33')]=_['keys'](_0x2924a4[_0x7419('0x33')]);_0x2d5e0f['filters']=_[_0x7419('0x35')](_0x2d5e0f['model'],_0x2d5e0f[_0x7419('0x33')]);_0xf112d9[_0x7419('0x36')]=_['intersection'](_0x2d5e0f[_0x7419('0x30')],qs['fields'](_0x2924a4[_0x7419('0x33')][_0x7419('0x37')]));_0xf112d9[_0x7419('0x36')]=_0xf112d9[_0x7419('0x36')][_0x7419('0x38')]?_0xf112d9[_0x7419('0x36')]:_0x2d5e0f[_0x7419('0x30')];_0xf112d9['order']=qs[_0x7419('0x39')](_0x2924a4[_0x7419('0x33')][_0x7419('0x39')]);_0xf112d9[_0x7419('0x3a')]=qs[_0x7419('0x34')](_[_0x7419('0x3b')](_0x2924a4[_0x7419('0x33')],_0x2d5e0f[_0x7419('0x34')]));if(_0x2924a4[_0x7419('0x33')]['filter']){_0xf112d9['where']=_['merge'](_0xf112d9[_0x7419('0x3a')],{'$or':_[_0x7419('0x2c')](_0xf112d9['attributes'],function(_0x3a79d1){var _0x4c6f9e={};_0x4c6f9e[_0x3a79d1]={'$like':'%'+_0x2924a4[_0x7419('0x33')][_0x7419('0x3c')]+'%'};return _0x4c6f9e;})});}if(_0x2924a4[_0x7419('0x33')]['$gte']){var _0x2e14ff=_0x2924a4[_0x7419('0x33')][_0x7419('0x58')][_0x7419('0x59')](',');var _0x17231a={};_0x17231a[_0x2e14ff[0x0]]={'$gte':moment(_0x2e14ff[0x1])[_0x7419('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')};_0xf112d9['where']=_['merge'](_0xf112d9[_0x7419('0x3a')],_0x17231a);}_0xf112d9=_['merge']({},_0xf112d9,_0x2924a4['options']);return _0x48de85[_0x7419('0x5b')](_0xf112d9);}})[_0x7419('0x29')](function(_0x330a7a){if(_0x330a7a){_0x53d2bf=_0x330a7a['length'];if(!_0x2924a4['query']['hasOwnProperty'](_0x7419('0x5c'))){_0xf112d9[_0x7419('0x1e')]=qs[_0x7419('0x1e')](_0x2924a4[_0x7419('0x33')][_0x7419('0x1e')]);_0xf112d9[_0x7419('0x20')]=qs[_0x7419('0x20')](_0x2924a4['query'][_0x7419('0x20')]);}return _0x48de85[_0x7419('0x5b')](_0xf112d9);}})[_0x7419('0x29')](function(_0x1727f3){if(_0x1727f3){return _0x1727f3?{'count':_0x53d2bf,'rows':_0x1727f3}:null;}})[_0x7419('0x29')](respondWithResult(_0x494c58,null))['catch'](handleError(_0x494c58,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index b7658ab..6c8ace6 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 _0x8786=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatGroup'];(function(_0x48ac17,_0x1147b5){var _0x12c118=function(_0x1b9bdc){while(--_0x1b9bdc){_0x48ac17['push'](_0x48ac17['shift']());}};_0x12c118(++_0x1147b5);}(_0x8786,0x153));var _0x6878=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x8786[_0x1035c1];return _0x308d67;};'use strict';var EventEmitter=require(_0x6878('0x0'));var ChatGroup=require(_0x6878('0x1'))['db'][_0x6878('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6878('0x3'),'afterUpdate':_0x6878('0x4'),'afterDestroy':_0x6878('0x5')};function emitEvent(_0x57ff21){return function(_0x347e06,_0x439475,_0x23647a){ChatGroupEvents[_0x6878('0x6')](_0x57ff21+':'+_0x347e06['id'],_0x347e06);ChatGroupEvents['emit'](_0x57ff21,_0x347e06);_0x23647a(null);};}for(var e in events){if(events[_0x6878('0x7')](e)){var event=events[e];ChatGroup[_0x6878('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0xaecc=['events','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xdf3db6,_0x2a1952){var _0x4b7a65=function(_0x2953be){while(--_0x2953be){_0xdf3db6['push'](_0xdf3db6['shift']());}};_0x4b7a65(++_0x2a1952);}(_0xaecc,0x172));var _0xcaec=function(_0x2e0998,_0x2e4b2c){_0x2e0998=_0x2e0998-0x0;var _0x7ce4bc=_0xaecc[_0x2e0998];return _0x7ce4bc;};'use strict';var EventEmitter=require(_0xcaec('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xcaec('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcaec('0x2')](0x0);var events={'afterCreate':_0xcaec('0x3'),'afterUpdate':_0xcaec('0x4'),'afterDestroy':_0xcaec('0x5')};function emitEvent(_0x1b7339){return function(_0x1de6a3,_0x5ab26c,_0x366499){ChatGroupEvents[_0xcaec('0x6')](_0x1b7339+':'+_0x1de6a3['id'],_0x1de6a3);ChatGroupEvents[_0xcaec('0x6')](_0x1b7339,_0x1de6a3);_0x366499(null);};}for(var e in events){if(events[_0xcaec('0x7')](e)){var event=events[e];ChatGroup[_0xcaec('0x8')](e,emitEvent(event));}}module[_0xcaec('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index c6bf1c5..fdfa869 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 _0xf1d5=['lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','ChatGroup'];(function(_0x2a3688,_0x3923aa){var _0x255227=function(_0x5d9443){while(--_0x5d9443){_0x2a3688['push'](_0x2a3688['shift']());}};_0x255227(++_0x3923aa);}(_0xf1d5,0x96));var _0x5f1d=function(_0x222240,_0x465d97){_0x222240=_0x222240-0x0;var _0xbe0206=_0xf1d5[_0x222240];return _0xbe0206;};'use strict';var _=require(_0x5f1d('0x0'));var util=require('util');var logger=require(_0x5f1d('0x1'))(_0x5f1d('0x2'));var moment=require('moment');var BPromise=require(_0x5f1d('0x3'));var rp=require(_0x5f1d('0x4'));var fs=require('fs');var path=require(_0x5f1d('0x5'));var rimraf=require('rimraf');var config=require(_0x5f1d('0x6'));var attributes=require('./chatGroup.attributes');module[_0x5f1d('0x7')]=function(_0x7f1525,_0x29b2f7){return _0x7f1525[_0x5f1d('0x8')](_0x5f1d('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcfd7=['moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','util','api'];(function(_0x507056,_0xe16b72){var _0x4eaecc=function(_0x440b91){while(--_0x440b91){_0x507056['push'](_0x507056['shift']());}};_0x4eaecc(++_0xe16b72);}(_0xcfd7,0x1ac));var _0x7cfd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfd7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7cfd('0x0'));var logger=require('../../config/logger')(_0x7cfd('0x1'));var moment=require(_0x7cfd('0x2'));var BPromise=require('bluebird');var rp=require(_0x7cfd('0x3'));var fs=require('fs');var path=require(_0x7cfd('0x4'));var rimraf=require(_0x7cfd('0x5'));var config=require(_0x7cfd('0x6'));var attributes=require(_0x7cfd('0x7'));module[_0x7cfd('0x8')]=function(_0x25c86d,_0x5dd5a8){return _0x25c86d[_0x7cfd('0x9')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index e4673d8..d176814 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 _0x3148=['ChatGroup,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatGroup.socket','register','request','then','info'];(function(_0x6845ef,_0x3c578b){var _0x57bd16=function(_0x5c5591){while(--_0x5c5591){_0x6845ef['push'](_0x6845ef['shift']());}};_0x57bd16(++_0x3c578b);}(_0x3148,0x1d3));var _0x8314=function(_0x29f82c,_0x5a6380){_0x29f82c=_0x29f82c-0x0;var _0x58a330=_0x3148[_0x29f82c];return _0x58a330;};'use strict';var _=require(_0x8314('0x0'));var util=require(_0x8314('0x1'));var moment=require('moment');var BPromise=require(_0x8314('0x2'));var rs=require(_0x8314('0x3'));var fs=require('fs');var Redis=require(_0x8314('0x4'));var db=require(_0x8314('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8314('0x6'))(_0x8314('0x7'));var config=require(_0x8314('0x8'));var jayson=require(_0x8314('0x9'));var client=jayson[_0x8314('0xa')][_0x8314('0xb')]({'port':0x232a});config[_0x8314('0xc')]=_['defaults'](config[_0x8314('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8314('0xd'))(new Redis(config[_0x8314('0xc')]));require(_0x8314('0xe'))[_0x8314('0xf')](socket);function respondWithRpcPromise(_0x118966,_0x5284ac,_0x5b5459){return new BPromise(function(_0xfaf56c,_0x34b949){return client[_0x8314('0x10')](_0x118966,_0x5b5459)[_0x8314('0x11')](function(_0x5cf1cf){logger[_0x8314('0x12')](_0x8314('0x13'),_0x5284ac,'request\x20sent');logger[_0x8314('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5284ac,'request\x20sent',JSON[_0x8314('0x15')](_0x5cf1cf));if(_0x5cf1cf[_0x8314('0x16')]){if(_0x5cf1cf[_0x8314('0x16')][_0x8314('0x17')]===0x1f4){logger['error'](_0x8314('0x13'),_0x5284ac,_0x5cf1cf[_0x8314('0x16')][_0x8314('0x18')]);return _0x34b949(_0x5cf1cf[_0x8314('0x16')][_0x8314('0x18')]);}logger[_0x8314('0x16')]('ChatGroup,\x20%s,\x20%s',_0x5284ac,_0x5cf1cf['error'][_0x8314('0x18')]);return _0xfaf56c(_0x5cf1cf[_0x8314('0x16')][_0x8314('0x18')]);}else{logger['info'](_0x8314('0x13'),_0x5284ac,_0x8314('0x19'));_0xfaf56c(_0x5cf1cf['result'][_0x8314('0x18')]);}})[_0x8314('0x1a')](function(_0x4ac7c8){logger[_0x8314('0x16')]('ChatGroup,\x20%s,\x20%s',_0x5284ac,_0x4ac7c8);_0x34b949(_0x4ac7c8);});});}
\ No newline at end of file
+var _0x6a93=['client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5822dc,_0x400557){var _0x2df565=function(_0x5e5471){while(--_0x5e5471){_0x5822dc['push'](_0x5822dc['shift']());}};_0x2df565(++_0x400557);}(_0x6a93,0x1d7));var _0x36a9=function(_0x3247cc,_0x513e80){_0x3247cc=_0x3247cc-0x0;var _0x479941=_0x6a93[_0x3247cc];return _0x479941;};'use strict';var _=require(_0x36a9('0x0'));var util=require(_0x36a9('0x1'));var moment=require(_0x36a9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36a9('0x3'));var db=require(_0x36a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x36a9('0x5'))(_0x36a9('0x6'));var config=require(_0x36a9('0x7'));var jayson=require(_0x36a9('0x8'));var client=jayson[_0x36a9('0x9')][_0x36a9('0xa')]({'port':0x232a});config[_0x36a9('0xb')]=_[_0x36a9('0xc')](config[_0x36a9('0xb')],{'host':_0x36a9('0xd'),'port':0x18eb});var socket=require(_0x36a9('0xe'))(new Redis(config['redis']));require(_0x36a9('0xf'))[_0x36a9('0x10')](socket);function respondWithRpcPromise(_0x4abb01,_0x4aaf2f,_0x283a00){return new BPromise(function(_0x116533,_0x1a6db3){return client[_0x36a9('0x11')](_0x4abb01,_0x283a00)[_0x36a9('0x12')](function(_0x220b13){logger[_0x36a9('0x13')](_0x36a9('0x14'),_0x4aaf2f,_0x36a9('0x15'));logger[_0x36a9('0x16')](_0x36a9('0x17'),_0x4aaf2f,_0x36a9('0x15'),JSON[_0x36a9('0x18')](_0x220b13));if(_0x220b13[_0x36a9('0x19')]){if(_0x220b13[_0x36a9('0x19')][_0x36a9('0x1a')]===0x1f4){logger[_0x36a9('0x19')](_0x36a9('0x14'),_0x4aaf2f,_0x220b13[_0x36a9('0x19')]['message']);return _0x1a6db3(_0x220b13[_0x36a9('0x19')]['message']);}logger['error'](_0x36a9('0x14'),_0x4aaf2f,_0x220b13[_0x36a9('0x19')][_0x36a9('0x1b')]);return _0x116533(_0x220b13['error'][_0x36a9('0x1b')]);}else{logger[_0x36a9('0x13')](_0x36a9('0x14'),_0x4aaf2f,_0x36a9('0x15'));_0x116533(_0x220b13[_0x36a9('0x1c')][_0x36a9('0x1b')]);}})[_0x36a9('0x1d')](function(_0x307b15){logger[_0x36a9('0x19')]('ChatGroup,\x20%s,\x20%s',_0x4aaf2f,_0x307b15);_0x1a6db3(_0x307b15);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 99a1a0c..ae36c1d 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 _0x8e53=['length','chatGroup:','./chatGroup.events','update','register'];(function(_0x5f0c5f,_0x1a58ae){var _0x2112e3=function(_0x419017){while(--_0x419017){_0x5f0c5f['push'](_0x5f0c5f['shift']());}};_0x2112e3(++_0x1a58ae);}(_0x8e53,0x1d8));var _0x38e5=function(_0x8522bf,_0x5d0930){_0x8522bf=_0x8522bf-0x0;var _0x32a616=_0x8e53[_0x8522bf];return _0x32a616;};'use strict';var ChatGroupEvents=require(_0x38e5('0x0'));var events=['save','remove',_0x38e5('0x1')];function createListener(_0x20654c,_0x304fed){return function(_0x41c1de){_0x304fed['emit'](_0x20654c,_0x41c1de);};}function removeListener(_0x29c26e,_0x2f0de0){return function(){ChatGroupEvents['removeListener'](_0x29c26e,_0x2f0de0);};}exports[_0x38e5('0x2')]=function(_0x5c692f){for(var _0x132b26=0x0,_0x206e96=events[_0x38e5('0x3')];_0x132b26<_0x206e96;_0x132b26++){var _0xd7b1c5=events[_0x132b26];var _0x4bd88a=createListener(_0x38e5('0x4')+_0xd7b1c5,_0x5c692f);ChatGroupEvents['on'](_0xd7b1c5,_0x4bd88a);}};
\ No newline at end of file
+var _0x7980=['save','remove','update','emit','register','length','chatGroup:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7980,0xd9));var _0x0798=function(_0x32bd26,_0x58dba1){_0x32bd26=_0x32bd26-0x0;var _0x196100=_0x7980[_0x32bd26];return _0x196100;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x0798('0x0'),_0x0798('0x1'),_0x0798('0x2')];function createListener(_0x2f78ae,_0x594115){return function(_0x402a45){_0x594115[_0x0798('0x3')](_0x2f78ae,_0x402a45);};}function removeListener(_0x16d6d8,_0x1fb351){return function(){ChatGroupEvents['removeListener'](_0x16d6d8,_0x1fb351);};}exports[_0x0798('0x4')]=function(_0x5013b4){for(var _0x4bb55e=0x0,_0x399858=events[_0x0798('0x5')];_0x4bb55e<_0x399858;_0x4bb55e++){var _0x2df5c9=events[_0x4bb55e];var _0x54ac85=createListener(_0x0798('0x6')+_0x2df5c9,_0x5013b4);ChatGroupEvents['on'](_0x2df5c9,_0x54ac85);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 4da985b..b7280c8 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 _0x90cc=['../../config/environment','./chatGroup.controller','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','get','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMessage','put','update','delete','removeMembers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x36b9ba,_0x1a935a){var _0x5ad6d3=function(_0x1b44ca){while(--_0x1b44ca){_0x36b9ba['push'](_0x36b9ba['shift']());}};_0x5ad6d3(++_0x1a935a);}(_0x90cc,0xd1));var _0xc90c=function(_0x169c54,_0x5d3841){_0x169c54=_0x169c54-0x0;var _0x928a9b=_0x90cc[_0x169c54];return _0x928a9b;};'use strict';var multer=require('multer');var util=require(_0xc90c('0x0'));var path=require(_0xc90c('0x1'));var timeout=require(_0xc90c('0x2'));var express=require(_0xc90c('0x3'));var router=express[_0xc90c('0x4')]();var fs_extra=require(_0xc90c('0x5'));var auth=require(_0xc90c('0x6'));var interaction=require(_0xc90c('0x7'));var config=require(_0xc90c('0x8'));var controller=require(_0xc90c('0x9'));router['get']('/',auth[_0xc90c('0xa')](),controller[_0xc90c('0xb')]);router['get'](_0xc90c('0xc'),auth[_0xc90c('0xa')](),controller[_0xc90c('0xd')]);router['get'](_0xc90c('0xe'),auth[_0xc90c('0xa')](),controller[_0xc90c('0xf')]);router['get'](_0xc90c('0x10'),auth[_0xc90c('0xa')](),controller[_0xc90c('0x11')]);router[_0xc90c('0x12')](_0xc90c('0x13'),auth['isAuthenticated'](),controller[_0xc90c('0x14')]);router[_0xc90c('0x12')](_0xc90c('0x15'),auth[_0xc90c('0xa')](),controller[_0xc90c('0x16')]);router['post']('/',auth[_0xc90c('0xa')](),controller[_0xc90c('0x17')]);router[_0xc90c('0x18')](_0xc90c('0x13'),auth[_0xc90c('0xa')](),controller['addMembers']);router['post'](_0xc90c('0x15'),auth[_0xc90c('0xa')](),controller[_0xc90c('0x19')]);router[_0xc90c('0x1a')](_0xc90c('0xe'),auth[_0xc90c('0xa')](),controller[_0xc90c('0x1b')]);router[_0xc90c('0x1c')]('/:id',auth[_0xc90c('0xa')](),controller['destroy']);router[_0xc90c('0x1c')](_0xc90c('0x13'),auth['isAuthenticated'](),controller[_0xc90c('0x1d')]);module[_0xc90c('0x1e')]=router;
\ No newline at end of file
+var _0xa42f=['getUnread','getMessages','post','create','/:id/members','addMessage','put','delete','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/unread'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xa42f,0x1e6));var _0xfa42=function(_0x3d44c0,_0x24bcc6){_0x3d44c0=_0x3d44c0-0x0;var _0x3441d0=_0xa42f[_0x3d44c0];return _0x3441d0;};'use strict';var multer=require(_0xfa42('0x0'));var util=require(_0xfa42('0x1'));var path=require(_0xfa42('0x2'));var timeout=require(_0xfa42('0x3'));var express=require(_0xfa42('0x4'));var router=express[_0xfa42('0x5')]();var fs_extra=require(_0xfa42('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfa42('0x7'));var config=require(_0xfa42('0x8'));var controller=require(_0xfa42('0x9'));router['get']('/',auth[_0xfa42('0xa')](),controller[_0xfa42('0xb')]);router[_0xfa42('0xc')](_0xfa42('0xd'),auth[_0xfa42('0xa')](),controller[_0xfa42('0xe')]);router[_0xfa42('0xc')](_0xfa42('0xf'),auth['isAuthenticated'](),controller[_0xfa42('0x10')]);router['get'](_0xfa42('0x11'),auth[_0xfa42('0xa')](),controller[_0xfa42('0x12')]);router[_0xfa42('0xc')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xfa42('0x13')]);router[_0xfa42('0x14')]('/',auth['isAuthenticated'](),controller[_0xfa42('0x15')]);router[_0xfa42('0x14')](_0xfa42('0x16'),auth[_0xfa42('0xa')](),controller['addMembers']);router['post']('/:id/messages',auth[_0xfa42('0xa')](),controller[_0xfa42('0x17')]);router[_0xfa42('0x18')](_0xfa42('0xf'),auth[_0xfa42('0xa')](),controller['update']);router[_0xfa42('0x19')](_0xfa42('0xf'),auth['isAuthenticated'](),controller['destroy']);router[_0xfa42('0x19')](_0xfa42('0x16'),auth[_0xfa42('0xa')](),controller[_0xfa42('0x1a')]);module[_0xfa42('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 d35c8c1..f85d0fb 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 _0x1cdf=['exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','out'];(function(_0x4e9d27,_0x8f7f92){var _0x2b1a38=function(_0xae029d){while(--_0xae029d){_0x4e9d27['push'](_0x4e9d27['shift']());}};_0x2b1a38(++_0x8f7f92);}(_0x1cdf,0xf3));var _0xf1cd=function(_0x46939d,_0xc1b36d){_0x46939d=_0x46939d-0x0;var _0x5105e8=_0x1cdf[_0x46939d];return _0x5105e8;};'use strict';var Sequelize=require('sequelize');module[_0xf1cd('0x0')]={'closed':{'type':Sequelize[_0xf1cd('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf1cd('0x2')]},'ratingType':{'type':Sequelize[_0xf1cd('0x3')](_0xf1cd('0x4'),_0xf1cd('0x5')),'defaultValue':_0xf1cd('0x4')},'ratingMessage':{'type':Sequelize[_0xf1cd('0x6')]},'pathTranscript':{'type':Sequelize[_0xf1cd('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf1cd('0x7')]},'secondDisposition':{'type':Sequelize[_0xf1cd('0x7')]},'thirdDisposition':{'type':Sequelize[_0xf1cd('0x7')]},'note':{'type':Sequelize[_0xf1cd('0x7')]},'browserName':{'type':Sequelize[_0xf1cd('0x7')]},'browserVersion':{'type':Sequelize[_0xf1cd('0x7')]},'osName':{'type':Sequelize[_0xf1cd('0x7')]},'osVersion':{'type':Sequelize[_0xf1cd('0x7')]},'deviceModel':{'type':Sequelize[_0xf1cd('0x7')]},'deviceVendor':{'type':Sequelize[_0xf1cd('0x7')]},'deviceType':{'type':Sequelize[_0xf1cd('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xf1cd('0x7')]},'formData':{'type':Sequelize[_0xf1cd('0x6')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf1cd('0x3')]('in',_0xf1cd('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf1cd('0x7')]},'customerPort':{'type':Sequelize[_0xf1cd('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xf1cd('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xf1cd('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xc072=['INTEGER','ENUM','star','thumb','TEXT','DATE','STRING','long','out','BOOLEAN'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xc072,0x96));var _0x2c07=function(_0x130fe4,_0x140f0c){_0x130fe4=_0x130fe4-0x0;var _0x19880f=_0xc072[_0x130fe4];return _0x19880f;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2c07('0x0')]},'ratingType':{'type':Sequelize[_0x2c07('0x1')](_0x2c07('0x2'),_0x2c07('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x2c07('0x4')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2c07('0x5')]},'disposition':{'type':Sequelize[_0x2c07('0x6')]},'secondDisposition':{'type':Sequelize[_0x2c07('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x2c07('0x6')]},'osName':{'type':Sequelize[_0x2c07('0x6')]},'osVersion':{'type':Sequelize[_0x2c07('0x6')]},'deviceModel':{'type':Sequelize[_0x2c07('0x6')]},'deviceVendor':{'type':Sequelize[_0x2c07('0x6')]},'deviceType':{'type':Sequelize[_0x2c07('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x2c07('0x6')]},'formData':{'type':Sequelize['TEXT'](_0x2c07('0x7'))},'read1stAt':{'type':Sequelize[_0x2c07('0x5')]},'lastMsgAt':{'type':Sequelize[_0x2c07('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x2c07('0x1')]('in',_0x2c07('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x2c07('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x2c07('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x2c07('0x9')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x2c07('0x0')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index fe6b6bc..bbad031 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 _0x5a45=['join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','format','now','pathTranscript','Messages','User','CmContact','ContactId','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','omit','ids','getMessages','hasOwnProperty','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','nolimit','includeAgent','push','alias','rows','addTags','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','Account','Owner','get','mkdirSync','N.A.','closedAt','disposition','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','err','rimraf','bluebird','mustache','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','redis','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','end','stack','name','send','render','merge','body','contact','agent','map','ChatInteraction','rawAttributes','fieldName','type','key','findAll','show','keys','query','filters','intersection','model','attributes','fields','length','includeAll','include','options','create','find','params','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','fullname','user','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','Attachment','attachmentDownload','closed','Unauthorized','attachId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5a45,0x128));var _0x55a4=function(_0x58e8ff,_0x45af96){_0x58e8ff=_0x58e8ff-0x0;var _0x348be2=_0x5a45[_0x58e8ff];return _0x348be2;};'use strict';var rimraf=require(_0x55a4('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x55a4('0x1'));var Mustache=require(_0x55a4('0x2'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x55a4('0x3'));var Redis=require(_0x55a4('0x4'));var interaction=require(_0x55a4('0x5'));var qs=require(_0x55a4('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x55a4('0x7'))(_0x55a4('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x55a4('0x9')]=_['defaults'](config[_0x55a4('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x55a4('0xa'))[_0x55a4('0xb')](socket);var jayson=require(_0x55a4('0xc'));var client=jayson[_0x55a4('0xd')][_0x55a4('0xe')]({'port':0x232b});var client9004=jayson[_0x55a4('0xd')][_0x55a4('0xe')]({'port':0x232c});function respondWithRpcPromise(_0x5c3c05,_0xdd3d7d,_0xe311c1,_0x3c0a9e){return new BPromise(function(_0x562c24,_0x3248da){var _0x541ba0=_0x3c0a9e||client;return _0x541ba0[_0x55a4('0xf')](_0x5c3c05,_0xe311c1)[_0x55a4('0x10')](function(_0x5cca1b){logger[_0x55a4('0x11')](_0x55a4('0x12'),_0xdd3d7d,_0x55a4('0x13'));logger[_0x55a4('0x14')](_0x55a4('0x15'),_0xdd3d7d,'request\x20sent',JSON[_0x55a4('0x16')](_0x5cca1b));if(_0x5cca1b['error']){if(_0x5cca1b[_0x55a4('0x17')]['code']===0x1f4){logger[_0x55a4('0x17')](_0x55a4('0x12'),_0xdd3d7d,_0x5cca1b[_0x55a4('0x17')]['message']);return _0x3248da(_0x5cca1b[_0x55a4('0x17')][_0x55a4('0x18')]);}logger[_0x55a4('0x17')]('ChatInteraction,\x20%s,\x20%s',_0xdd3d7d,_0x5cca1b[_0x55a4('0x17')][_0x55a4('0x18')]);return _0x562c24(_0x5cca1b[_0x55a4('0x17')]['message']);}else{logger[_0x55a4('0x11')](_0x55a4('0x12'),_0xdd3d7d,_0x55a4('0x13'));_0x562c24(_0x5cca1b[_0x55a4('0x19')][_0x55a4('0x18')]);}})[_0x55a4('0x1a')](function(_0x4bd3ab){logger[_0x55a4('0x17')](_0x55a4('0x12'),_0xdd3d7d,_0x4bd3ab);_0x3248da(_0x4bd3ab);});});}function respondWithStatusCode(_0x32760e,_0x5ab941){_0x5ab941=_0x5ab941||0xcc;return function(_0x85b2db){if(_0x85b2db){return _0x32760e[_0x55a4('0x1b')](_0x5ab941);}return _0x32760e[_0x55a4('0x1c')](_0x5ab941)['end']();};}function respondWithResult(_0x58ea4c,_0x40527e){_0x40527e=_0x40527e||0xc8;return function(_0x27b8ba){if(_0x27b8ba){return _0x58ea4c[_0x55a4('0x1c')](_0x40527e)[_0x55a4('0x1d')](_0x27b8ba);}};}function respondWithFilteredResult(_0x2eaba6,_0x991d7e){return function(_0x2b4c1c){if(_0x2b4c1c){var _0x47a26f=typeof _0x991d7e['offset']===_0x55a4('0x1e')&&typeof _0x991d7e[_0x55a4('0x1f')]===_0x55a4('0x1e');var _0x5cb513=_0x2b4c1c[_0x55a4('0x20')];var _0x1b0aa9=_0x47a26f?0x0:_0x991d7e[_0x55a4('0x21')];var _0x1c1f2f=_0x47a26f?_0x2b4c1c['count']:_0x991d7e[_0x55a4('0x21')]+_0x991d7e[_0x55a4('0x1f')];var _0x8f5fde;if(_0x1c1f2f>=_0x5cb513){_0x1c1f2f=_0x5cb513;_0x8f5fde=0xc8;}else{_0x8f5fde=0xce;}_0x2eaba6[_0x55a4('0x1c')](_0x8f5fde);return _0x2eaba6[_0x55a4('0x22')](_0x55a4('0x23'),_0x1b0aa9+'-'+_0x1c1f2f+'/'+_0x5cb513)[_0x55a4('0x1d')](_0x2b4c1c);}return null;};}function saveUpdates(_0x1e846a){return function(_0x1a59de){if(_0x1a59de){return _0x1a59de[_0x55a4('0x24')](_0x1e846a)[_0x55a4('0x10')](function(_0x7f299b){return _0x7f299b;});}return null;};}function removeEntity(_0x2d2d13){return function(_0x5aac7a){if(_0x5aac7a){return _0x5aac7a['destroy']()['then'](function(){_0x2d2d13[_0x55a4('0x1c')](0xcc)[_0x55a4('0x25')]();});}};}function handleEntityNotFound(_0x252e81){return function(_0x214f61){if(!_0x214f61){_0x252e81[_0x55a4('0x1b')](0x194);}return _0x214f61;};}function handleError(_0x46d4aa,_0x3bc04e){_0x3bc04e=_0x3bc04e||0x1f4;return function(_0x24f4a0){logger[_0x55a4('0x17')](_0x24f4a0[_0x55a4('0x26')]);if(_0x24f4a0[_0x55a4('0x27')]){delete _0x24f4a0[_0x55a4('0x27')];}_0x46d4aa[_0x55a4('0x1c')](_0x3bc04e)[_0x55a4('0x28')](_0x24f4a0);};}function getMustacheRender(_0x260612,_0x227695){return Mustache[_0x55a4('0x29')](_0x260612,_[_0x55a4('0x2a')](_0x227695[_0x55a4('0x2b')],{'contact':_0x227695[_0x55a4('0x2c')],'message':_0x227695[_0x55a4('0x18')],'agent':_0x227695[_0x55a4('0x2d')],'interaction':_0x227695['interaction'],'account':_0x227695['account']}))||'';}exports['index']=function(_0x173ddc,_0x396367){var _0x555807={};var _0x4fa371=_[_0x55a4('0x2e')](db[_0x55a4('0x2f')][_0x55a4('0x30')],function(_0x224527){return{'name':_0x224527[_0x55a4('0x31')],'type':_0x224527[_0x55a4('0x32')][_0x55a4('0x33')]};});_0x555807=qs['getOptions'](_0x4fa371,_0x173ddc);return interaction[_0x55a4('0x34')]('chat',_0x173ddc['query'],_0x173ddc['user'],_0x555807,_0x4fa371)['then'](respondWithFilteredResult(_0x396367,_0x555807))[_0x55a4('0x1a')](handleError(_0x396367,null));};exports[_0x55a4('0x35')]=function(_0x1e9b2f,_0x52be91){var _0xe5b93={'raw':![],'where':{'id':_0x1e9b2f['params']['id']}},_0x331a42={};_0x331a42['model']=_[_0x55a4('0x36')](db[_0x55a4('0x2f')][_0x55a4('0x30')]);_0x331a42[_0x55a4('0x37')]=_[_0x55a4('0x36')](_0x1e9b2f[_0x55a4('0x37')]);_0x331a42[_0x55a4('0x38')]=_[_0x55a4('0x39')](_0x331a42[_0x55a4('0x3a')],_0x331a42[_0x55a4('0x37')]);_0xe5b93[_0x55a4('0x3b')]=_[_0x55a4('0x39')](_0x331a42['model'],qs[_0x55a4('0x3c')](_0x1e9b2f[_0x55a4('0x37')][_0x55a4('0x3c')]));_0xe5b93[_0x55a4('0x3b')]=_0xe5b93[_0x55a4('0x3b')][_0x55a4('0x3d')]?_0xe5b93[_0x55a4('0x3b')]:_0x331a42['model'];if(_0x1e9b2f[_0x55a4('0x37')][_0x55a4('0x3e')]){_0xe5b93[_0x55a4('0x3f')]=[{'all':!![]}];}_0xe5b93=_[_0x55a4('0x2a')]({},_0xe5b93,_0x1e9b2f[_0x55a4('0x40')]);return db['ChatInteraction']['find'](_0xe5b93)[_0x55a4('0x10')](handleEntityNotFound(_0x52be91,null))['then'](respondWithResult(_0x52be91,null))[_0x55a4('0x1a')](handleError(_0x52be91,null));};exports[_0x55a4('0x41')]=function(_0x48e915,_0x23c358){return db[_0x55a4('0x2f')]['create'](_0x48e915[_0x55a4('0x2b')],{})[_0x55a4('0x10')](respondWithResult(_0x23c358,0xc9))[_0x55a4('0x1a')](handleError(_0x23c358,null));};exports[_0x55a4('0x24')]=function(_0x2d5eb7,_0x5c2410){if(_0x2d5eb7[_0x55a4('0x2b')]['id']){delete _0x2d5eb7[_0x55a4('0x2b')]['id'];}return db[_0x55a4('0x2f')][_0x55a4('0x42')]({'where':{'id':_0x2d5eb7[_0x55a4('0x43')]['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x5c2410,null))[_0x55a4('0x10')](saveUpdates(_0x2d5eb7['body'],null))['then'](respondWithResult(_0x5c2410,null))['catch'](handleError(_0x5c2410,null));};exports['destroy']=function(_0x2c33e3,_0x30bbdc){return db[_0x55a4('0x2f')][_0x55a4('0x42')]({'where':{'id':_0x2c33e3[_0x55a4('0x43')]['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x30bbdc,null))[_0x55a4('0x10')](removeEntity(_0x30bbdc,null))['catch'](handleError(_0x30bbdc,null));};exports['describe']=function(_0x2457ee,_0x1754ba){return db[_0x55a4('0x2f')]['describe']()[_0x55a4('0x10')](respondWithResult(_0x1754ba,null))['catch'](handleError(_0x1754ba,null));};exports[_0x55a4('0x44')]=function(_0x57a4c9,_0x14e6bf){var _0x55d6f9=_0x57a4c9['params']['id'];var _0x330603;var _0x476347;var _0xff2c74;return db[_0x55a4('0x2f')]['findOne']({'where':{'id':_0x55d6f9}})['then'](function(_0x1110de){_0x330603=_0x1110de;return db[_0x55a4('0x45')][_0x55a4('0x46')]({'where':{'id':_0x1110de[_0x55a4('0x47')]},'attributes':['id',_0x55a4('0x48'),_0x55a4('0x49'),_0x55a4('0x4a'),'vidaooNote',_0x55a4('0x4b')],'raw':!![]});})[_0x55a4('0x10')](function(_0x3ca227){if(_0x3ca227&&_0x3ca227['vidaooApiKey']&&_0x3ca227[_0x55a4('0x49')]){_0x476347=_0x3ca227;var _0x461ff8={'interaction':{'id':_0x55d6f9},'agent':{'id':_0x57a4c9['user']['id'],'name':_0x57a4c9['user'][_0x55a4('0x27')],'fullname':_0x57a4c9['user'][_0x55a4('0x4c')],'email':_0x57a4c9[_0x55a4('0x4d')][_0x55a4('0x4e')]},'contact':_0x57a4c9[_0x55a4('0x2b')][_0x55a4('0x2c')],'account':_0x57a4c9[_0x55a4('0x2b')]['account']};var _0xafaebc={'rejectUnauthorized':![],'method':'POST','url':_0x55a4('0x4f'),'headers':{'X-APIKEY':_0x3ca227[_0x55a4('0x48')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x57a4c9[_0x55a4('0x4d')][_0x55a4('0x4e')]],'buttons':null,'topic':_0x476347[_0x55a4('0x4a')],'note':_[_0x55a4('0x50')](_0x476347['vidaooNote'])?null:getMustacheRender(_0x476347[_0x55a4('0x51')],_0x461ff8),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x55a4('0x50')](_0x476347[_0x55a4('0x4b')])){var _0x34fc6d=getMustacheRender(_0x476347[_0x55a4('0x4b')],_0x461ff8);var _0x1f2997=JSON[_0x55a4('0x52')](_0x34fc6d);_0xafaebc[_0x55a4('0x2b')][_0x55a4('0x53')]=_0x1f2997;}}catch(_0x4c8e07){throw new db[(_0x55a4('0x54'))][(_0x55a4('0x55'))](_0x55a4('0x56'));}return rp(_0xafaebc);}else{throw new db[(_0x55a4('0x54'))][(_0x55a4('0x55'))](_0x55a4('0x57'));}})[_0x55a4('0x10')](function(_0x4540c6){_0xff2c74=_0x4540c6;if(_0xff2c74['id']){var _0x2b8b7f={'body':_0xff2c74['join_url'],'ChatWebsiteId':_0x476347['id'],'ChatInteractionId':_0x330603['id'],'direction':_0x55a4('0x58'),'UserId':_0x57a4c9[_0x55a4('0x4d')]['id']};return db[_0x55a4('0x59')][_0x55a4('0x41')](_0x2b8b7f,{});}else{throw new db[(_0x55a4('0x54'))][(_0x55a4('0x55'))](_0x55a4('0x5a'));}})['then'](function(){return _0x330603[_0x55a4('0x5b')]({'vidaooSessionId':_0xff2c74['id']});})['then'](respondWithResult(_0x14e6bf,null))[_0x55a4('0x1a')](handleError(_0x14e6bf,null));};exports[_0x55a4('0x5c')]=function(_0xb38acb,_0x4f3c60){if(_0xb38acb[_0x55a4('0x2b')]['id']){delete _0xb38acb['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0xb38acb[_0x55a4('0x43')]['id']},'include':[{'model':db['CmContact'],'as':_0x55a4('0x5d')}]})[_0x55a4('0x10')](handleEntityNotFound(_0x4f3c60,null))[_0x55a4('0x10')](saveUpdates(_0xb38acb['body'],null))['then'](respondWithResult(_0x4f3c60,null))['catch'](handleError(_0x4f3c60,null));};exports[_0x55a4('0x5e')]=function(_0x144d80,_0x499a73){if(_0x144d80['body']['id']){delete _0x144d80[_0x55a4('0x2b')]['id'];}return db[_0x55a4('0x2f')]['find']({'where':{'id':_0x144d80['params']['id']}})[_0x55a4('0x10')](function(_0x4cd6ea){if(!_0x4cd6ea){logger[_0x55a4('0x17')](_0x55a4('0x5f'),_0x55a4('0x5e'),0x194,_0x55a4('0x60'));_0x499a73['sendStatus'](0x194);}else{if(_0x4cd6ea[_0x55a4('0x61')]){throw new db['Sequelize']['ValidationError'](_0x55a4('0x62'));}}return _0x4cd6ea;})[_0x55a4('0x10')](function(_0x57dc54){if(_0x57dc54){return _0x57dc54[_0x55a4('0x24')]({'closed':_0x144d80[_0x55a4('0x2b')]['closed'],'disposition':_0x144d80[_0x55a4('0x2b')]['disposition']})[_0x55a4('0x10')](function(_0x4a8d55){return _0x4a8d55;});}})[_0x55a4('0x10')](function(){return respondWithRpcPromise(_0x55a4('0x63'),_0x55a4('0x5e'),_0x144d80['body'],client9004);})['then'](respondWithResult(_0x499a73,null))[_0x55a4('0x1a')](handleError(_0x499a73,null));};exports[_0x55a4('0x64')]=function(_0x22484c,_0x811f6d){_0x22484c[_0x55a4('0x2b')]['name']=_0x22484c['file'][_0x55a4('0x65')];_0x22484c[_0x55a4('0x2b')][_0x55a4('0x66')]=_0x22484c[_0x55a4('0x67')][_0x55a4('0x68')];_0x22484c[_0x55a4('0x2b')]['type']=_0x22484c[_0x55a4('0x67')]['mimetype'];return db[_0x55a4('0x69')][_0x55a4('0x41')](_0x22484c[_0x55a4('0x2b')])[_0x55a4('0x10')](respondWithResult(_0x811f6d,0xc9))[_0x55a4('0x1a')](handleError(_0x811f6d,null));};exports[_0x55a4('0x6a')]=function(_0x203d6e,_0x41dbe7){return db[_0x55a4('0x2f')][_0x55a4('0x46')]({'where':{'id':_0x203d6e['params']['id']},'raw':!![]})[_0x55a4('0x10')](handleEntityNotFound(_0x41dbe7,null))[_0x55a4('0x10')](function(_0x1fdca8){if(_0x1fdca8){if(_0x1fdca8[_0x55a4('0x6b')]){return _0x41dbe7[_0x55a4('0x1c')](0x193)[_0x55a4('0x1d')]({'status':0x193,'message':_0x55a4('0x6c')});}return db[_0x55a4('0x69')][_0x55a4('0x46')]({'where':{'id':_0x203d6e[_0x55a4('0x37')][_0x55a4('0x6d')]},'raw':!![]})[_0x55a4('0x10')](handleEntityNotFound(_0x41dbe7,null));}})['then'](function(_0x540318){if(_0x540318){var _0x17387f=_0x540318['ChatOfflineMessageId']!==null;var _0x2d56f9=path[_0x55a4('0x6e')](config['root'],_0x55a4('0x6f'));if(_0x17387f){_0x2d56f9=path[_0x55a4('0x6e')](_0x2d56f9,_0x55a4('0x70'));}var _0x1b7d98=path['join'](_0x2d56f9,_0x540318['basename']);return _0x41dbe7[_0x55a4('0x71')](_0x1b7d98);}})[_0x55a4('0x1a')](handleError(_0x41dbe7,null));};exports[_0x55a4('0x72')]=function(_0x2b237f,_0x13e270){var _0x5bcdc7=null;var _0x4227f2=null;var _0x328dd9=null;if(_0x2b237f['body']['id']){delete _0x2b237f['body']['id'];}if(_0x2b237f[_0x55a4('0x2b')][_0x55a4('0x73')]){_0x328dd9=path[_0x55a4('0x6e')](config[_0x55a4('0x74')],_0x55a4('0x75'),util[_0x55a4('0x76')]('transcript-%s.txt',Date[_0x55a4('0x77')]()));_0x2b237f[_0x55a4('0x2b')][_0x55a4('0x78')]=_0x328dd9;}return db[_0x55a4('0x2f')][_0x55a4('0x42')]({'where':{'id':_0x2b237f[_0x55a4('0x43')]['id']},'include':[{'model':db[_0x55a4('0x59')],'as':_0x55a4('0x79'),'include':[{'model':db[_0x55a4('0x7a')],'as':_0x55a4('0x7a')}]}]})[_0x55a4('0x10')](handleEntityNotFound(_0x13e270,null))['then'](saveUpdates(_0x2b237f['body'],null))['then'](function(_0x716346){if(_0x716346){_0x5bcdc7=_0x716346;return db[_0x55a4('0x45')][_0x55a4('0x42')]({'where':{'id':_0x5bcdc7['ChatWebsiteId']}});}})[_0x55a4('0x10')](function(_0x1aafc5){if(_0x1aafc5){_0x4227f2=_0x1aafc5;return db[_0x55a4('0x7b')][_0x55a4('0x42')]({'where':{'id':_0x5bcdc7[_0x55a4('0x7c')]}});}})[_0x55a4('0x10')](function(_0x50ad77){if(_0x50ad77){if(_0x328dd9){var _0x5eef13=null;for(var _0x3d62b6=0x1;_0x3d62b6<_0x5bcdc7[_0x55a4('0x79')][_0x55a4('0x3d')];++_0x3d62b6){_0x5eef13=_0x5bcdc7[_0x55a4('0x79')][_0x3d62b6];var _0x282fd3=_0x5eef13['UserId']?util[_0x55a4('0x76')](_0x55a4('0x7d'),_0x4227f2['agentAlias'],_0x5eef13['UserId']):_0x55a4('0x7e');var _0x3eefe5=_0x2b237f[_0x55a4('0x2b')][_0x55a4('0x7f')]||util[_0x55a4('0x76')](_0x55a4('0x7d'),_0x55a4('0x80'),_0x5eef13[_0x55a4('0x7c')]);switch(_0x4227f2[_0x55a4('0x81')]){case _0x55a4('0x82'):_0x282fd3=_0x5eef13[_0x55a4('0x61')]?util[_0x55a4('0x76')](_0x55a4('0x7d'),_0x4227f2[_0x55a4('0x83')],_0x5eef13[_0x55a4('0x61')]):_0x55a4('0x7e');break;case _0x55a4('0x84'):_0x282fd3=_0x5eef13[_0x55a4('0x61')]?_0x5eef13[_0x55a4('0x7a')]['alias']||_0x5eef13[_0x55a4('0x7a')][_0x55a4('0x4c')]:_0x55a4('0x7e');break;case _0x55a4('0x85'):_0x282fd3=_0x5eef13[_0x55a4('0x61')]?_0x5eef13[_0x55a4('0x7a')][_0x55a4('0x4c')]:'System';break;default:_0x282fd3=_0x5eef13[_0x55a4('0x61')]?util[_0x55a4('0x76')](_0x55a4('0x7d'),_0x4227f2['agentAlias'],_0x5eef13['UserId']):'System';}var _0x4f36b7=util[_0x55a4('0x76')](_0x55a4('0x86'),moment(_0x5eef13['createdAt'])[_0x55a4('0x76')](_0x55a4('0x87')),_0x5eef13[_0x55a4('0x88')]==='in'?_0x3eefe5:_0x282fd3,_0x5eef13[_0x55a4('0x2b')]);if(!_0x5eef13[_0x55a4('0x89')]){fs['appendFileSync'](_0x328dd9,_0x4f36b7);}}return db['MailAccount'][_0x55a4('0x46')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x55a4('0x8a'),'raw':!![],'include':[{'model':db[_0x55a4('0x8b')],'as':_0x55a4('0x8b'),'raw':!![]}]}]});}}})[_0x55a4('0x10')](function(_0x132a41){if(!_0x132a41||!_0x132a41['Smtp']||!_0x2b237f[_0x55a4('0x2b')])return _0x5bcdc7;var _0x5d8da3=_0x132a41[_0x55a4('0x8c')]();return respondWithRpcPromise(_0x55a4('0x8d'),_0x55a4('0x8e'),{'account':_0x5d8da3,'message':{'from':util[_0x55a4('0x76')](_0x55a4('0x8f'),_0x132a41[_0x55a4('0x27')],_0x132a41[_0x55a4('0x4e')]||_0x132a41[_0x55a4('0x8a')][_0x55a4('0x4d')]),'to':_0x2b237f[_0x55a4('0x2b')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x55a4('0x76')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x2b237f[_0x55a4('0x2b')]['mailTranscript']),'attachments':[{'path':_0x328dd9}]}})[_0x55a4('0x10')](function(){return _0x5bcdc7;})[_0x55a4('0x1a')](function(_0x1d78ed){logger[_0x55a4('0x17')](_0x1d78ed);});})['then'](respondWithStatusCode(_0x13e270,0xc8))[_0x55a4('0x1a')](handleError(_0x13e270,null));};exports[_0x55a4('0x90')]=function(_0x57b88b,_0x3172b2){return db[_0x55a4('0x59')][_0x55a4('0x42')]({'where':{'id':_0x57b88b['params']['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x3172b2,null))['then'](function(_0x580db2){if(_0x580db2){return _0x580db2[_0x55a4('0x90')](_0x57b88b[_0x55a4('0x2b')]['ids'],_[_0x55a4('0x91')](_0x57b88b[_0x55a4('0x2b')],[_0x55a4('0x92'),'id'])||{});}})[_0x55a4('0x10')](respondWithResult(_0x3172b2,null))[_0x55a4('0x1a')](handleError(_0x3172b2,null));};exports[_0x55a4('0x93')]=function(_0x26877f,_0x33447c){var _0x4a72d3={'raw':![],'where':{}};var _0x585084={};var _0x49d237={'count':0x0,'rows':[]};return db[_0x55a4('0x2f')][_0x55a4('0x46')]({'where':{'id':_0x26877f[_0x55a4('0x43')]['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x33447c,null))[_0x55a4('0x10')](function(_0x41b7c8){if(_0x41b7c8){_0x585084[_0x55a4('0x3a')]=_[_0x55a4('0x36')](db[_0x55a4('0x59')]['rawAttributes']);_0x585084[_0x55a4('0x37')]=_['keys'](_0x26877f[_0x55a4('0x37')]);_0x585084[_0x55a4('0x38')]=_[_0x55a4('0x39')](_0x585084[_0x55a4('0x3a')],_0x585084[_0x55a4('0x37')]);_0x4a72d3[_0x55a4('0x3b')]=_[_0x55a4('0x39')](_0x585084[_0x55a4('0x3a')],qs[_0x55a4('0x3c')](_0x26877f[_0x55a4('0x37')]['fields']));_0x4a72d3[_0x55a4('0x3b')]=_0x4a72d3['attributes']['length']?_0x4a72d3[_0x55a4('0x3b')]:_0x585084['model'];if(!_0x26877f[_0x55a4('0x37')][_0x55a4('0x94')]('nolimit')){_0x4a72d3[_0x55a4('0x1f')]=qs[_0x55a4('0x1f')](_0x26877f[_0x55a4('0x37')]['limit']);_0x4a72d3[_0x55a4('0x21')]=qs['offset'](_0x26877f[_0x55a4('0x37')]['offset']);}_0x4a72d3[_0x55a4('0x95')]=qs[_0x55a4('0x96')](_0x26877f[_0x55a4('0x37')][_0x55a4('0x96')]);_0x4a72d3[_0x55a4('0x97')]=qs[_0x55a4('0x38')](_[_0x55a4('0x98')](_0x26877f[_0x55a4('0x37')],_0x585084[_0x55a4('0x38')]));_0x4a72d3[_0x55a4('0x97')][_0x55a4('0x99')]=_0x41b7c8['id'];if(_0x26877f[_0x55a4('0x37')][_0x55a4('0x9a')]){_0x4a72d3[_0x55a4('0x97')]=_[_0x55a4('0x2a')](_0x4a72d3[_0x55a4('0x97')],{'$or':_[_0x55a4('0x2e')](_0x4a72d3[_0x55a4('0x3b')],function(_0x226d04){var _0x1c9ea5={};_0x1c9ea5[_0x226d04]={'$like':'%'+_0x26877f[_0x55a4('0x37')]['filter']+'%'};return _0x1c9ea5;})});}if(_0x26877f['query'][_0x55a4('0x9b')]){var _0x43b9de=_0x26877f[_0x55a4('0x37')][_0x55a4('0x9b')][_0x55a4('0x9c')](',');var _0x268997={};_0x268997[_0x43b9de[0x0]]={'$gte':moment(_0x43b9de[0x1])['format'](_0x55a4('0x9d'))};_0x4a72d3[_0x55a4('0x97')]=_[_0x55a4('0x2a')](_0x4a72d3[_0x55a4('0x97')],_0x268997);}_0x4a72d3=_[_0x55a4('0x2a')]({},_0x4a72d3,_0x26877f['options']);return db['ChatMessage'][_0x55a4('0x20')]({'where':_0x4a72d3['where']})['then'](function(_0x2b2440){_0x49d237[_0x55a4('0x20')]=_0x2b2440;if(_0x26877f[_0x55a4('0x37')][_0x55a4('0x3e')]){_0x4a72d3[_0x55a4('0x3f')]=[{'all':!![]}];}return db[_0x55a4('0x59')][_0x55a4('0x34')](_0x4a72d3);})[_0x55a4('0x10')](function(_0x448cc2){_0x49d237['rows']=_0x448cc2;return _0x49d237;});}})[_0x55a4('0x10')](respondWithFilteredResult(_0x33447c,_0x4a72d3))[_0x55a4('0x1a')](handleError(_0x33447c,null));};exports[_0x55a4('0x9e')]=function(_0x2f727c,_0x5ab1bf){var _0x57ef7b={'where':{}},_0x4f7e71={},_0x341d47={'count':0x0,'rows':[]};return db[_0x55a4('0x2f')][_0x55a4('0x46')]({'where':{'id':_0x2f727c[_0x55a4('0x43')]['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x5ab1bf,null))[_0x55a4('0x10')](function(_0x79d8b7){if(_0x79d8b7){_0x4f7e71[_0x55a4('0x3a')]=_[_0x55a4('0x36')](db['ChatMessage']['rawAttributes']);_0x4f7e71[_0x55a4('0x37')]=_['keys'](_0x2f727c[_0x55a4('0x37')]);_0x4f7e71[_0x55a4('0x38')]=_['intersection'](_0x4f7e71[_0x55a4('0x3a')],_0x4f7e71[_0x55a4('0x37')]);_0x57ef7b[_0x55a4('0x3b')]=_['intersection'](_0x4f7e71[_0x55a4('0x3a')],qs[_0x55a4('0x3c')](_0x2f727c[_0x55a4('0x37')]['fields']));_0x57ef7b[_0x55a4('0x3b')]=_0x57ef7b[_0x55a4('0x3b')]['length']?_0x57ef7b[_0x55a4('0x3b')]:_0x4f7e71[_0x55a4('0x3a')];if(!_0x2f727c[_0x55a4('0x37')]['hasOwnProperty'](_0x55a4('0x9f'))){_0x57ef7b['limit']=qs[_0x55a4('0x1f')](_0x2f727c['query']['limit']);_0x57ef7b[_0x55a4('0x21')]=qs[_0x55a4('0x21')](_0x2f727c['query'][_0x55a4('0x21')]);}_0x57ef7b[_0x55a4('0x95')]=qs['sort'](_0x2f727c[_0x55a4('0x37')][_0x55a4('0x96')]);_0x57ef7b['where']=qs['filters'](_[_0x55a4('0x98')](_0x2f727c['query'],_0x4f7e71[_0x55a4('0x38')]));_0x57ef7b[_0x55a4('0x97')][_0x55a4('0x99')]=_0x79d8b7['id'];if(_0x2f727c[_0x55a4('0x37')][_0x55a4('0x9a')]){_0x57ef7b[_0x55a4('0x97')]=_[_0x55a4('0x2a')](_0x57ef7b[_0x55a4('0x97')],{'$or':_[_0x55a4('0x2e')](_0x57ef7b[_0x55a4('0x3b')],function(_0x50a9ae){var _0x3c818e={};_0x3c818e[_0x50a9ae]={'$like':'%'+_0x2f727c[_0x55a4('0x37')]['filter']+'%'};return _0x3c818e;})});}_0x57ef7b['where']['secret']=![];if(_0x2f727c['query']['id']){_0x57ef7b[_0x55a4('0x97')]['id']={'$gt':_0x2f727c[_0x55a4('0x37')]['id']};}_0x57ef7b=_[_0x55a4('0x2a')]({},_0x57ef7b,_0x2f727c[_0x55a4('0x40')]);return db['ChatMessage'][_0x55a4('0x20')]({'where':_0x57ef7b[_0x55a4('0x97')]})[_0x55a4('0x10')](function(_0x406598){_0x341d47[_0x55a4('0x20')]=_0x406598;_0x57ef7b['include']=[];if(_0x2f727c[_0x55a4('0x37')][_0x55a4('0xa0')]){_0x57ef7b['include'][_0x55a4('0xa1')]({'model':db['User'],'as':_0x55a4('0x7a'),'attributes':['id',_0x55a4('0x4c'),_0x55a4('0xa2')]});}if(_0x2f727c[_0x55a4('0x37')][_0x55a4('0x3e')]){_0x57ef7b[_0x55a4('0x3f')]=[{'all':!![]}];}return db[_0x55a4('0x59')][_0x55a4('0x34')](_0x57ef7b);})[_0x55a4('0x10')](function(_0x2d97cc){_0x341d47[_0x55a4('0xa3')]=_0x2d97cc;return _0x341d47;});}})['then'](respondWithFilteredResult(_0x5ab1bf,_0x57ef7b))['catch'](handleError(_0x5ab1bf,null));};exports[_0x55a4('0xa4')]=function(_0x134bf9,_0x37fc77){return db[_0x55a4('0x2f')]['find']({'where':{'id':_0x134bf9['params']['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x37fc77,null))[_0x55a4('0x10')](function(_0x4a8c8a){if(_0x4a8c8a){return _0x4a8c8a[_0x55a4('0xa5')](_0x134bf9[_0x55a4('0x2b')][_0x55a4('0x92')],_[_0x55a4('0x91')](_0x134bf9[_0x55a4('0x2b')],[_0x55a4('0x92'),'id'])||{})['spread'](function(){return db[_0x55a4('0xa6')][_0x55a4('0x34')]({'attributes':['id',_0x55a4('0x27'),_0x55a4('0xa7')],'where':{'id':_0x134bf9[_0x55a4('0x2b')][_0x55a4('0x92')]}});})[_0x55a4('0x10')](function(_0x49140a){socket[_0x55a4('0xa8')](_0x55a4('0xa9'),{'id':Number(_0x134bf9['params']['id']),'tags':_0x49140a||[]});return{'id':Number(_0x134bf9[_0x55a4('0x43')]['id']),'tags':_0x49140a||[]};});}})[_0x55a4('0x10')](respondWithResult(_0x37fc77,null))[_0x55a4('0x1a')](handleError(_0x37fc77,null));};exports[_0x55a4('0xaa')]=function(_0x4f9a77,_0x28d96a){return db['ChatInteraction'][_0x55a4('0x42')]({'where':{'id':_0x4f9a77['params']['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x28d96a,null))[_0x55a4('0x10')](function(_0x4477ab){if(_0x4477ab){return _0x4477ab['removeTags'](_0x4f9a77[_0x55a4('0x37')]['ids']);}})[_0x55a4('0x10')](respondWithStatusCode(_0x28d96a,null))[_0x55a4('0x1a')](handleError(_0x28d96a,null));};exports[_0x55a4('0x71')]=function(_0x24d3b2,_0x27c53f){var _0x3f0351=moment()[_0x55a4('0xab')]()[_0x55a4('0xac')]();var _0x262bcf=path[_0x55a4('0x6e')](config['root'],_0x55a4('0xad'),_0x55a4('0xae'),'tmp');var _0x466a78=path[_0x55a4('0x6e')](config[_0x55a4('0x74')],'server',_0x55a4('0xae'),_0x55a4('0xaf'));var _0x234213=path[_0x55a4('0x6e')](_0x262bcf,_0x3f0351);var _0x1b88b6=util[_0x55a4('0x76')](_0x55a4('0xb0'),_0x24d3b2[_0x55a4('0x43')]['id'],_0x3f0351);var _0x25538d=path['join'](_0x262bcf,_0x1b88b6);var _0x52adc1=[];_0x52adc1[_0x55a4('0xa1')]({'model':db[_0x55a4('0x7a')],'as':_0x55a4('0x7a'),'attributes':['id',_0x55a4('0x4c')],'raw':!![]});_0x52adc1[_0x55a4('0xa1')]({'model':db['CmContact'],'as':_0x55a4('0x5d'),'attributes':['id',_0x55a4('0xb1'),_0x55a4('0xb2')],'raw':!![]});if(_0x24d3b2['query']['attachments']){_0x52adc1['push']({'model':db[_0x55a4('0x69')],'as':'Attachment','raw':!![]});}var _0x52c232=[{'model':db['ChatMessage'],'as':_0x55a4('0x79'),'attributes':['id',_0x55a4('0x2b'),_0x55a4('0xb3'),_0x55a4('0x88'),'secret','read'],'include':_0x52adc1}];_0x52c232[_0x55a4('0xa1')]({'model':db['ChatWebsite'],'as':_0x55a4('0xb4'),'attributes':['id',_0x55a4('0x27')]});_0x52c232['push']({'model':db[_0x55a4('0x7a')],'as':_0x55a4('0xb5'),'attributes':['id',_0x55a4('0x4c')]});return db['ChatInteraction']['find']({'where':{'id':_0x24d3b2[_0x55a4('0x43')]['id']},'include':_0x52c232})[_0x55a4('0x10')](handleEntityNotFound(_0x27c53f,null))[_0x55a4('0x10')](function(_0x3a1e6b){if(_0x3a1e6b){var _0x5e6fc4=_0x3a1e6b[_0x55a4('0xb6')]({'plain':!![]});fs[_0x55a4('0xb7')](_0x234213);var _0x27556d={'channel':'Chat','account':_0x5e6fc4[_0x55a4('0xb4')]['name'],'agent':_0x5e6fc4[_0x55a4('0xb5')]?_0x5e6fc4[_0x55a4('0xb5')]['fullname']:_0x55a4('0xb8'),'createdAt':moment(_0x5e6fc4[_0x55a4('0xb3')])[_0x55a4('0x76')](_0x55a4('0x9d'))[_0x55a4('0xac')](),'closedAt':_0x5e6fc4[_0x55a4('0x6b')]?moment(_0x5e6fc4[_0x55a4('0xb9')])[_0x55a4('0x76')](_0x55a4('0x9d'))['toString']():'','disposition':_0x5e6fc4[_0x55a4('0xba')],'chatInfo':{'browser':_0x5e6fc4['browserName'],'os':_0x5e6fc4[_0x55a4('0xbb')],'referer':_0x5e6fc4[_0x55a4('0xbc')],'customerIp':_0x5e6fc4[_0x55a4('0xbd')],'customerPort':_0x5e6fc4['customerPort']?_0x5e6fc4[_0x55a4('0xbe')]:_0x55a4('0xb8')},'messages':_(_0x5e6fc4['Messages'])[_0x55a4('0xbf')]()[_0x55a4('0x9a')]({'secret':![]})[_0x55a4('0x2e')](function(_0x251480){if(_0x251480['Attachment']){var _0x3184c7=path[_0x55a4('0x6e')](_0x466a78,_0x251480['Attachment']['basename']);if(fs[_0x55a4('0xc0')](_0x3184c7)){fs[_0x55a4('0xc1')](_0x3184c7)['pipe'](fs['createWriteStream'](path['join'](_0x234213,_0x251480[_0x55a4('0x69')][_0x55a4('0x66')])));}}return{'date':moment(_0x251480[_0x55a4('0xb3')])['format'](_0x55a4('0x9d'))[_0x55a4('0xac')](),'sender':_0x251480[_0x55a4('0x88')]===_0x55a4('0x58')?_0x251480[_0x55a4('0x7a')]?_0x251480[_0x55a4('0x7a')][_0x55a4('0x4c')]:_0x55a4('0x7e'):_0x251480[_0x55a4('0x5d')][_0x55a4('0xb1')]+(_0x251480['Contact'][_0x55a4('0xb2')]?'\x20'+_0x251480[_0x55a4('0x5d')][_0x55a4('0xb2')]:''),'body':_0x251480[_0x55a4('0x69')]?_0x251480[_0x55a4('0x69')][_0x55a4('0x66')]:_0x251480[_0x55a4('0x2b')],'direction':_0x251480[_0x55a4('0x88')]===_0x55a4('0x58')?'A':'C','secret':_0x251480[_0x55a4('0x89')],'read':_0x251480[_0x55a4('0xc2')],'attachment':_0x251480[_0x55a4('0x69')]};})[_0x55a4('0xc3')]()};return ejs[_0x55a4('0xc4')](path[_0x55a4('0x6e')](config[_0x55a4('0x74')],'server',_0x55a4('0xc5'),_0x55a4('0xc6')),{'interaction':_0x27556d})['then'](function(_0x4d387a){var _0x134c72=path[_0x55a4('0x6e')](_0x234213,_0x55a4('0xc7')+_0x5e6fc4['id']+'-'+_0x3f0351+_0x55a4('0xc8'));var _0x240241={'path':_0x134c72,'channel':_0x55a4('0xc9'),'interactionId':_0x5e6fc4['id']};return pdf['createPdfFromHTML'](_0x4d387a,_0x240241);})[_0x55a4('0x10')](function(){return new Promise(function(_0x1733ac,_0x5501cf){zipdir(_0x234213,{'saveTo':_0x25538d},function(_0x9a10ca,_0x3b17ac){if(_0x9a10ca)return _0x5501cf(_0x9a10ca);return _0x1733ac(_0x3b17ac);});})[_0x55a4('0x10')](function(){return new BPromise(function(_0x19da3e,_0x5c1266){rimraf(_0x234213,function(_0x47e12d){if(_0x47e12d)_0x5c1266(_0x47e12d);return _0x19da3e();});});})[_0x55a4('0x10')](function(){return _0x27c53f[_0x55a4('0x71')](_0x25538d,_0x1b88b6,function(_0x52ddc9){if(_0x52ddc9){logger[_0x55a4('0x17')](_0x55a4('0xca'),_0x52ddc9);}else{fs['unlinkSync'](_0x25538d);}});});});}else{return _0x27c53f[_0x55a4('0x1b')](0xc8);}})['catch'](handleError(_0x27c53f,null));};
\ No newline at end of file
+var _0x0a8a=['map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','find','catch','create','body','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','update','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','attachmentDownload','closed','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages','User','CmContact','ContactId','%s%d','agentAlias','customer','format','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','ids','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','merge','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','options','rows','secret','push','setTags','spread','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','read','Account','Owner','get','Chat','N.A.','toString','browserName','osName','referer','customerPort','existsSync','createReadStream','value','renderFile','views','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','path','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','stack','name','render','agent','interaction','account','index'];(function(_0x3da556,_0x5bd01f){var _0x49fd15=function(_0x5e0372){while(--_0x5e0372){_0x3da556['push'](_0x3da556['shift']());}};_0x49fd15(++_0x5bd01f);}(_0x0a8a,0x16d));var _0xa0a8=function(_0xad4203,_0x5c5fc5){_0xad4203=_0xad4203-0x0;var _0x455ee1=_0x0a8a[_0xad4203];return _0x455ee1;};'use strict';var rimraf=require(_0xa0a8('0x0'));var zipdir=require('zip-dir');var rp=require(_0xa0a8('0x1'));var moment=require(_0xa0a8('0x2'));var BPromise=require(_0xa0a8('0x3'));var Mustache=require(_0xa0a8('0x4'));var util=require(_0xa0a8('0x5'));var path=require(_0xa0a8('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa0a8('0x7'));var Redis=require(_0xa0a8('0x8'));var interaction=require('../../components/interaction/service');var qs=require(_0xa0a8('0x9'));var pdf=require(_0xa0a8('0xa'));var logger=require('../../config/logger')(_0xa0a8('0xb'));var config=require(_0xa0a8('0xc'));var db=require(_0xa0a8('0xd'))['db'];config['redis']=_[_0xa0a8('0xe')](config[_0xa0a8('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0xa0a8('0x10'))(new Redis(config['redis']));require(_0xa0a8('0x11'))['register'](socket);var jayson=require(_0xa0a8('0x12'));var client=jayson[_0xa0a8('0x13')]['http']({'port':0x232b});var client9004=jayson['client'][_0xa0a8('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x188ad,_0x18bc03,_0x1780f5,_0x90779){return new BPromise(function(_0x84ba26,_0x39e23d){var _0x5b0974=_0x90779||client;return _0x5b0974[_0xa0a8('0x15')](_0x188ad,_0x1780f5)[_0xa0a8('0x16')](function(_0x38da7a){logger['info'](_0xa0a8('0x17'),_0x18bc03,_0xa0a8('0x18'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x18bc03,_0xa0a8('0x18'),JSON[_0xa0a8('0x19')](_0x38da7a));if(_0x38da7a[_0xa0a8('0x1a')]){if(_0x38da7a['error'][_0xa0a8('0x1b')]===0x1f4){logger['error'](_0xa0a8('0x17'),_0x18bc03,_0x38da7a[_0xa0a8('0x1a')][_0xa0a8('0x1c')]);return _0x39e23d(_0x38da7a[_0xa0a8('0x1a')][_0xa0a8('0x1c')]);}logger[_0xa0a8('0x1a')](_0xa0a8('0x17'),_0x18bc03,_0x38da7a[_0xa0a8('0x1a')][_0xa0a8('0x1c')]);return _0x84ba26(_0x38da7a[_0xa0a8('0x1a')][_0xa0a8('0x1c')]);}else{logger[_0xa0a8('0x1d')](_0xa0a8('0x17'),_0x18bc03,_0xa0a8('0x18'));_0x84ba26(_0x38da7a[_0xa0a8('0x1e')]['message']);}})['catch'](function(_0x161f49){logger[_0xa0a8('0x1a')](_0xa0a8('0x17'),_0x18bc03,_0x161f49);_0x39e23d(_0x161f49);});});}function respondWithStatusCode(_0x289542,_0x14d47a){_0x14d47a=_0x14d47a||0xcc;return function(_0x31f1de){if(_0x31f1de){return _0x289542[_0xa0a8('0x1f')](_0x14d47a);}return _0x289542[_0xa0a8('0x20')](_0x14d47a)[_0xa0a8('0x21')]();};}function respondWithResult(_0x400631,_0x4ba8ee){_0x4ba8ee=_0x4ba8ee||0xc8;return function(_0x3aea0a){if(_0x3aea0a){return _0x400631[_0xa0a8('0x20')](_0x4ba8ee)[_0xa0a8('0x22')](_0x3aea0a);}};}function respondWithFilteredResult(_0xc44d52,_0xb91cb4){return function(_0x108a60){if(_0x108a60){var _0x4963e1=typeof _0xb91cb4[_0xa0a8('0x23')]===_0xa0a8('0x24')&&typeof _0xb91cb4[_0xa0a8('0x25')]===_0xa0a8('0x24');var _0x29cbbc=_0x108a60[_0xa0a8('0x26')];var _0x404ecc=_0x4963e1?0x0:_0xb91cb4[_0xa0a8('0x23')];var _0x57846f=_0x4963e1?_0x108a60[_0xa0a8('0x26')]:_0xb91cb4[_0xa0a8('0x23')]+_0xb91cb4[_0xa0a8('0x25')];var _0x560cdc;if(_0x57846f>=_0x29cbbc){_0x57846f=_0x29cbbc;_0x560cdc=0xc8;}else{_0x560cdc=0xce;}_0xc44d52[_0xa0a8('0x20')](_0x560cdc);return _0xc44d52[_0xa0a8('0x27')](_0xa0a8('0x28'),_0x404ecc+'-'+_0x57846f+'/'+_0x29cbbc)['json'](_0x108a60);}return null;};}function saveUpdates(_0x18c675){return function(_0x54691d){if(_0x54691d){return _0x54691d['update'](_0x18c675)[_0xa0a8('0x16')](function(_0x43b20f){return _0x43b20f;});}return null;};}function removeEntity(_0x39f80f){return function(_0x2a0e44){if(_0x2a0e44){return _0x2a0e44[_0xa0a8('0x29')]()[_0xa0a8('0x16')](function(){_0x39f80f[_0xa0a8('0x20')](0xcc)[_0xa0a8('0x21')]();});}};}function handleEntityNotFound(_0x300941){return function(_0x19b2b9){if(!_0x19b2b9){_0x300941[_0xa0a8('0x1f')](0x194);}return _0x19b2b9;};}function handleError(_0x54f700,_0x299795){_0x299795=_0x299795||0x1f4;return function(_0x47334e){logger['error'](_0x47334e[_0xa0a8('0x2a')]);if(_0x47334e[_0xa0a8('0x2b')]){delete _0x47334e[_0xa0a8('0x2b')];}_0x54f700['status'](_0x299795)['send'](_0x47334e);};}function getMustacheRender(_0x39e31e,_0x1afb21){return Mustache[_0xa0a8('0x2c')](_0x39e31e,_['merge'](_0x1afb21['body'],{'contact':_0x1afb21['contact'],'message':_0x1afb21[_0xa0a8('0x1c')],'agent':_0x1afb21[_0xa0a8('0x2d')],'interaction':_0x1afb21[_0xa0a8('0x2e')],'account':_0x1afb21[_0xa0a8('0x2f')]}))||'';}exports[_0xa0a8('0x30')]=function(_0x28672b,_0x311981){var _0x38e395={};var _0x4c438c=_[_0xa0a8('0x31')](db[_0xa0a8('0x32')][_0xa0a8('0x33')],function(_0x33087e){return{'name':_0x33087e[_0xa0a8('0x34')],'type':_0x33087e[_0xa0a8('0x35')][_0xa0a8('0x36')]};});_0x38e395=qs[_0xa0a8('0x37')](_0x4c438c,_0x28672b);return interaction[_0xa0a8('0x38')](_0xa0a8('0x39'),_0x28672b[_0xa0a8('0x3a')],_0x28672b[_0xa0a8('0x3b')],_0x38e395,_0x4c438c)[_0xa0a8('0x16')](respondWithFilteredResult(_0x311981,_0x38e395))['catch'](handleError(_0x311981,null));};exports[_0xa0a8('0x3c')]=function(_0x136232,_0x27d55b){var _0x3fa00d={'raw':![],'where':{'id':_0x136232[_0xa0a8('0x3d')]['id']}},_0x3299b8={};_0x3299b8[_0xa0a8('0x3e')]=_[_0xa0a8('0x3f')](db[_0xa0a8('0x32')][_0xa0a8('0x33')]);_0x3299b8[_0xa0a8('0x3a')]=_[_0xa0a8('0x3f')](_0x136232[_0xa0a8('0x3a')]);_0x3299b8[_0xa0a8('0x40')]=_[_0xa0a8('0x41')](_0x3299b8[_0xa0a8('0x3e')],_0x3299b8['query']);_0x3fa00d[_0xa0a8('0x42')]=_[_0xa0a8('0x41')](_0x3299b8[_0xa0a8('0x3e')],qs[_0xa0a8('0x43')](_0x136232[_0xa0a8('0x3a')][_0xa0a8('0x43')]));_0x3fa00d[_0xa0a8('0x42')]=_0x3fa00d[_0xa0a8('0x42')][_0xa0a8('0x44')]?_0x3fa00d['attributes']:_0x3299b8['model'];if(_0x136232[_0xa0a8('0x3a')][_0xa0a8('0x45')]){_0x3fa00d[_0xa0a8('0x46')]=[{'all':!![]}];}_0x3fa00d=_['merge']({},_0x3fa00d,_0x136232['options']);return db['ChatInteraction'][_0xa0a8('0x47')](_0x3fa00d)[_0xa0a8('0x16')](handleEntityNotFound(_0x27d55b,null))[_0xa0a8('0x16')](respondWithResult(_0x27d55b,null))[_0xa0a8('0x48')](handleError(_0x27d55b,null));};exports[_0xa0a8('0x49')]=function(_0x3bfbe0,_0x3c34aa){return db[_0xa0a8('0x32')][_0xa0a8('0x49')](_0x3bfbe0[_0xa0a8('0x4a')],{})['then'](respondWithResult(_0x3c34aa,0xc9))[_0xa0a8('0x48')](handleError(_0x3c34aa,null));};exports['update']=function(_0x1ab5c8,_0x282466){if(_0x1ab5c8[_0xa0a8('0x4a')]['id']){delete _0x1ab5c8[_0xa0a8('0x4a')]['id'];}return db[_0xa0a8('0x32')]['find']({'where':{'id':_0x1ab5c8[_0xa0a8('0x3d')]['id']}})[_0xa0a8('0x16')](handleEntityNotFound(_0x282466,null))[_0xa0a8('0x16')](saveUpdates(_0x1ab5c8[_0xa0a8('0x4a')],null))[_0xa0a8('0x16')](respondWithResult(_0x282466,null))[_0xa0a8('0x48')](handleError(_0x282466,null));};exports['destroy']=function(_0x162557,_0x3d05be){return db['ChatInteraction']['find']({'where':{'id':_0x162557[_0xa0a8('0x3d')]['id']}})[_0xa0a8('0x16')](handleEntityNotFound(_0x3d05be,null))[_0xa0a8('0x16')](removeEntity(_0x3d05be,null))[_0xa0a8('0x48')](handleError(_0x3d05be,null));};exports[_0xa0a8('0x4b')]=function(_0x23c05d,_0xa8b6e7){return db[_0xa0a8('0x32')][_0xa0a8('0x4b')]()[_0xa0a8('0x16')](respondWithResult(_0xa8b6e7,null))[_0xa0a8('0x48')](handleError(_0xa8b6e7,null));};exports['createVidaooSession']=function(_0x3c289a,_0x67c994){var _0x403014=_0x3c289a['params']['id'];var _0x30a35d;var _0x55cb91;var _0x5465b3;return db[_0xa0a8('0x32')][_0xa0a8('0x4c')]({'where':{'id':_0x403014}})[_0xa0a8('0x16')](function(_0x259802){_0x30a35d=_0x259802;return db[_0xa0a8('0x4d')][_0xa0a8('0x4c')]({'where':{'id':_0x259802[_0xa0a8('0x4e')]},'attributes':['id',_0xa0a8('0x4f'),_0xa0a8('0x50'),_0xa0a8('0x51'),_0xa0a8('0x52'),_0xa0a8('0x53')],'raw':!![]});})[_0xa0a8('0x16')](function(_0xdb1a69){if(_0xdb1a69&&_0xdb1a69[_0xa0a8('0x4f')]&&_0xdb1a69[_0xa0a8('0x50')]){_0x55cb91=_0xdb1a69;var _0x255ea3={'interaction':{'id':_0x403014},'agent':{'id':_0x3c289a[_0xa0a8('0x3b')]['id'],'name':_0x3c289a[_0xa0a8('0x3b')][_0xa0a8('0x2b')],'fullname':_0x3c289a[_0xa0a8('0x3b')]['fullname'],'email':_0x3c289a[_0xa0a8('0x3b')][_0xa0a8('0x54')]},'contact':_0x3c289a['body'][_0xa0a8('0x55')],'account':_0x3c289a[_0xa0a8('0x4a')][_0xa0a8('0x2f')]};var _0x84ea4f={'rejectUnauthorized':![],'method':_0xa0a8('0x56'),'url':_0xa0a8('0x57'),'headers':{'X-APIKEY':_0xdb1a69[_0xa0a8('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3c289a[_0xa0a8('0x3b')][_0xa0a8('0x54')]],'buttons':null,'topic':_0x55cb91[_0xa0a8('0x51')],'note':_[_0xa0a8('0x58')](_0x55cb91[_0xa0a8('0x52')])?null:getMustacheRender(_0x55cb91[_0xa0a8('0x52')],_0x255ea3),'metadata':null},'redirect':_0xa0a8('0x59'),'json':!![]};try{if(!_[_0xa0a8('0x58')](_0x55cb91[_0xa0a8('0x53')])){var _0x3b302a=getMustacheRender(_0x55cb91['vidaooMetadata'],_0x255ea3);var _0xbd9866=JSON[_0xa0a8('0x5a')](_0x3b302a);_0x84ea4f[_0xa0a8('0x4a')][_0xa0a8('0x5b')]=_0xbd9866;}}catch(_0x2b230a){throw new db[(_0xa0a8('0x5c'))][(_0xa0a8('0x5d'))](_0xa0a8('0x5e'));}return rp(_0x84ea4f);}else{throw new db['Sequelize']['ValidationError'](_0xa0a8('0x5f'));}})['then'](function(_0x508f1b){_0x5465b3=_0x508f1b;if(_0x5465b3['id']){var _0x299b95={'body':_0x5465b3[_0xa0a8('0x60')],'ChatWebsiteId':_0x55cb91['id'],'ChatInteractionId':_0x30a35d['id'],'direction':_0xa0a8('0x61'),'UserId':_0x3c289a['user']['id']};return db[_0xa0a8('0x62')][_0xa0a8('0x49')](_0x299b95,{});}else{throw new db[(_0xa0a8('0x5c'))][(_0xa0a8('0x5d'))](_0xa0a8('0x63'));}})[_0xa0a8('0x16')](function(){return _0x30a35d[_0xa0a8('0x64')]({'vidaooSessionId':_0x5465b3['id']});})['then'](respondWithResult(_0x67c994,null))['catch'](handleError(_0x67c994,null));};exports[_0xa0a8('0x65')]=function(_0x49de2d,_0x460d0b){if(_0x49de2d[_0xa0a8('0x4a')]['id']){delete _0x49de2d[_0xa0a8('0x4a')]['id'];}return db['ChatInteraction'][_0xa0a8('0x47')]({'where':{'id':_0x49de2d[_0xa0a8('0x3d')]['id']},'include':[{'model':db['CmContact'],'as':_0xa0a8('0x66')}]})[_0xa0a8('0x16')](handleEntityNotFound(_0x460d0b,null))[_0xa0a8('0x16')](saveUpdates(_0x49de2d[_0xa0a8('0x4a')],null))[_0xa0a8('0x16')](respondWithResult(_0x460d0b,null))[_0xa0a8('0x48')](handleError(_0x460d0b,null));};exports[_0xa0a8('0x67')]=function(_0x69cace,_0x2afa5f){if(_0x69cace[_0xa0a8('0x4a')]['id']){delete _0x69cace[_0xa0a8('0x4a')]['id'];}return db['ChatInteraction'][_0xa0a8('0x47')]({'where':{'id':_0x69cace[_0xa0a8('0x3d')]['id']}})[_0xa0a8('0x16')](function(_0x43c5ac){if(!_0x43c5ac){logger[_0xa0a8('0x1a')](_0xa0a8('0x68'),_0xa0a8('0x67'),0x194,_0xa0a8('0x69'));_0x2afa5f['sendStatus'](0x194);}else{if(_0x43c5ac[_0xa0a8('0x6a')]){throw new db[(_0xa0a8('0x5c'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x43c5ac;})[_0xa0a8('0x16')](function(_0x30f581){if(_0x30f581){return _0x30f581[_0xa0a8('0x6b')]({'closed':_0x69cace[_0xa0a8('0x4a')]['closed'],'disposition':_0x69cace[_0xa0a8('0x4a')][_0xa0a8('0x6c')]})[_0xa0a8('0x16')](function(_0x2d2bb7){return _0x2d2bb7;});}})[_0xa0a8('0x16')](function(){return respondWithRpcPromise(_0xa0a8('0x6d'),_0xa0a8('0x67'),_0x69cace[_0xa0a8('0x4a')],client9004);})[_0xa0a8('0x16')](respondWithResult(_0x2afa5f,null))[_0xa0a8('0x48')](handleError(_0x2afa5f,null));};exports[_0xa0a8('0x6e')]=function(_0x333b88,_0x424433){_0x333b88[_0xa0a8('0x4a')][_0xa0a8('0x2b')]=_0x333b88[_0xa0a8('0x6f')][_0xa0a8('0x70')];_0x333b88['body']['basename']=_0x333b88[_0xa0a8('0x6f')][_0xa0a8('0x71')];_0x333b88['body']['type']=_0x333b88[_0xa0a8('0x6f')][_0xa0a8('0x72')];return db['Attachment'][_0xa0a8('0x49')](_0x333b88['body'])[_0xa0a8('0x16')](respondWithResult(_0x424433,0xc9))[_0xa0a8('0x48')](handleError(_0x424433,null));};exports[_0xa0a8('0x73')]=function(_0x5bbd7f,_0x52f298){return db[_0xa0a8('0x32')]['findOne']({'where':{'id':_0x5bbd7f[_0xa0a8('0x3d')]['id']},'raw':!![]})[_0xa0a8('0x16')](handleEntityNotFound(_0x52f298,null))[_0xa0a8('0x16')](function(_0x36a4cf){if(_0x36a4cf){if(_0x36a4cf[_0xa0a8('0x74')]){return _0x52f298[_0xa0a8('0x20')](0x193)[_0xa0a8('0x22')]({'status':0x193,'message':'Unauthorized'});}return db[_0xa0a8('0x75')][_0xa0a8('0x4c')]({'where':{'id':_0x5bbd7f[_0xa0a8('0x3a')][_0xa0a8('0x76')]},'raw':!![]})[_0xa0a8('0x16')](handleEntityNotFound(_0x52f298,null));}})[_0xa0a8('0x16')](function(_0x16776e){if(_0x16776e){var _0x1ee0a8=_0x16776e[_0xa0a8('0x77')]!==null;var _0x527649=path[_0xa0a8('0x78')](config[_0xa0a8('0x79')],'server/files/attachments/');if(_0x1ee0a8){_0x527649=path[_0xa0a8('0x78')](_0x527649,_0xa0a8('0x7a'));}var _0x232b62=path[_0xa0a8('0x78')](_0x527649,_0x16776e[_0xa0a8('0x7b')]);return _0x52f298[_0xa0a8('0x7c')](_0x232b62);}})[_0xa0a8('0x48')](handleError(_0x52f298,null));};exports[_0xa0a8('0x7d')]=function(_0x38df96,_0x484ec3){var _0x1689a7=null;var _0x4d73a4=null;var _0x5a2fe0=null;if(_0x38df96[_0xa0a8('0x4a')]['id']){delete _0x38df96[_0xa0a8('0x4a')]['id'];}if(_0x38df96[_0xa0a8('0x4a')][_0xa0a8('0x7e')]){_0x5a2fe0=path['join'](config[_0xa0a8('0x79')],_0xa0a8('0x7f'),util['format'](_0xa0a8('0x80'),Date['now']()));_0x38df96[_0xa0a8('0x4a')][_0xa0a8('0x81')]=_0x5a2fe0;}return db[_0xa0a8('0x32')][_0xa0a8('0x47')]({'where':{'id':_0x38df96['params']['id']},'include':[{'model':db[_0xa0a8('0x62')],'as':_0xa0a8('0x82'),'include':[{'model':db[_0xa0a8('0x83')],'as':_0xa0a8('0x83')}]}]})[_0xa0a8('0x16')](handleEntityNotFound(_0x484ec3,null))[_0xa0a8('0x16')](saveUpdates(_0x38df96['body'],null))[_0xa0a8('0x16')](function(_0x9be9d6){if(_0x9be9d6){_0x1689a7=_0x9be9d6;return db[_0xa0a8('0x4d')][_0xa0a8('0x47')]({'where':{'id':_0x1689a7[_0xa0a8('0x4e')]}});}})[_0xa0a8('0x16')](function(_0x1944dd){if(_0x1944dd){_0x4d73a4=_0x1944dd;return db[_0xa0a8('0x84')]['find']({'where':{'id':_0x1689a7[_0xa0a8('0x85')]}});}})[_0xa0a8('0x16')](function(_0x2bcd0e){if(_0x2bcd0e){if(_0x5a2fe0){var _0x1a294b=null;for(var _0x50953c=0x1;_0x50953c<_0x1689a7['Messages']['length'];++_0x50953c){_0x1a294b=_0x1689a7[_0xa0a8('0x82')][_0x50953c];var _0x43a90f=_0x1a294b['UserId']?util['format'](_0xa0a8('0x86'),_0x4d73a4[_0xa0a8('0x87')],_0x1a294b[_0xa0a8('0x6a')]):'System';var _0x226c88=_0x38df96[_0xa0a8('0x4a')][_0xa0a8('0x88')]||util[_0xa0a8('0x89')]('%s%d',_0xa0a8('0x8a'),_0x1a294b[_0xa0a8('0x85')]);switch(_0x4d73a4[_0xa0a8('0x8b')]){case _0xa0a8('0x8c'):_0x43a90f=_0x1a294b[_0xa0a8('0x6a')]?util[_0xa0a8('0x89')](_0xa0a8('0x86'),_0x4d73a4[_0xa0a8('0x87')],_0x1a294b['UserId']):_0xa0a8('0x8d');break;case _0xa0a8('0x8e'):_0x43a90f=_0x1a294b['UserId']?_0x1a294b[_0xa0a8('0x83')][_0xa0a8('0x8f')]||_0x1a294b[_0xa0a8('0x83')][_0xa0a8('0x90')]:_0xa0a8('0x8d');break;case'agent_fullname':_0x43a90f=_0x1a294b[_0xa0a8('0x6a')]?_0x1a294b[_0xa0a8('0x83')]['fullname']:_0xa0a8('0x8d');break;default:_0x43a90f=_0x1a294b[_0xa0a8('0x6a')]?util[_0xa0a8('0x89')]('%s%d',_0x4d73a4[_0xa0a8('0x87')],_0x1a294b[_0xa0a8('0x6a')]):'System';}var _0x5e5cb0=util['format'](_0xa0a8('0x91'),moment(_0x1a294b[_0xa0a8('0x92')])[_0xa0a8('0x89')]('MM/DD/YYYY\x20HH:mm:ss'),_0x1a294b['direction']==='in'?_0x226c88:_0x43a90f,_0x1a294b[_0xa0a8('0x4a')]);if(!_0x1a294b['secret']){fs['appendFileSync'](_0x5a2fe0,_0x5e5cb0);}}return db[_0xa0a8('0x93')][_0xa0a8('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0xa0a8('0x94')],'as':_0xa0a8('0x95'),'raw':!![],'include':[{'model':db[_0xa0a8('0x96')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xa0a8('0x16')](function(_0x5a0d7a){if(!_0x5a0d7a||!_0x5a0d7a[_0xa0a8('0x95')]||!_0x38df96['body'])return _0x1689a7;var _0x51f93c=_0x5a0d7a[_0xa0a8('0x97')]();return respondWithRpcPromise(_0xa0a8('0x98'),_0xa0a8('0x99'),{'account':_0x51f93c,'message':{'from':util[_0xa0a8('0x89')](_0xa0a8('0x9a'),_0x5a0d7a[_0xa0a8('0x2b')],_0x5a0d7a[_0xa0a8('0x54')]||_0x5a0d7a[_0xa0a8('0x95')][_0xa0a8('0x3b')]),'to':_0x38df96[_0xa0a8('0x4a')][_0xa0a8('0x7e')],'subject':_0xa0a8('0x9b'),'text':util[_0xa0a8('0x89')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x38df96['body'][_0xa0a8('0x7e')]),'attachments':[{'path':_0x5a2fe0}]}})[_0xa0a8('0x16')](function(){return _0x1689a7;})['catch'](function(_0x548593){logger['error'](_0x548593);});})['then'](respondWithStatusCode(_0x484ec3,0xc8))['catch'](handleError(_0x484ec3,null));};exports[_0xa0a8('0x9c')]=function(_0x30351c,_0x345ccf){return db[_0xa0a8('0x62')][_0xa0a8('0x47')]({'where':{'id':_0x30351c[_0xa0a8('0x3d')]['id']}})[_0xa0a8('0x16')](handleEntityNotFound(_0x345ccf,null))[_0xa0a8('0x16')](function(_0x1f534d){if(_0x1f534d){return _0x1f534d['addMessage'](_0x30351c[_0xa0a8('0x4a')]['ids'],_[_0xa0a8('0x9d')](_0x30351c[_0xa0a8('0x4a')],[_0xa0a8('0x9e'),'id'])||{});}})[_0xa0a8('0x16')](respondWithResult(_0x345ccf,null))[_0xa0a8('0x48')](handleError(_0x345ccf,null));};exports[_0xa0a8('0x9f')]=function(_0x53867f,_0x4c383b){var _0x3364e5={'raw':![],'where':{}};var _0x30496={};var _0xce8f09={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xa0a8('0x4c')]({'where':{'id':_0x53867f[_0xa0a8('0x3d')]['id']}})[_0xa0a8('0x16')](handleEntityNotFound(_0x4c383b,null))[_0xa0a8('0x16')](function(_0x272467){if(_0x272467){_0x30496[_0xa0a8('0x3e')]=_[_0xa0a8('0x3f')](db[_0xa0a8('0x62')][_0xa0a8('0x33')]);_0x30496[_0xa0a8('0x3a')]=_[_0xa0a8('0x3f')](_0x53867f[_0xa0a8('0x3a')]);_0x30496[_0xa0a8('0x40')]=_['intersection'](_0x30496[_0xa0a8('0x3e')],_0x30496[_0xa0a8('0x3a')]);_0x3364e5[_0xa0a8('0x42')]=_['intersection'](_0x30496['model'],qs[_0xa0a8('0x43')](_0x53867f[_0xa0a8('0x3a')][_0xa0a8('0x43')]));_0x3364e5['attributes']=_0x3364e5[_0xa0a8('0x42')][_0xa0a8('0x44')]?_0x3364e5[_0xa0a8('0x42')]:_0x30496[_0xa0a8('0x3e')];if(!_0x53867f[_0xa0a8('0x3a')][_0xa0a8('0xa0')](_0xa0a8('0xa1'))){_0x3364e5[_0xa0a8('0x25')]=qs[_0xa0a8('0x25')](_0x53867f[_0xa0a8('0x3a')][_0xa0a8('0x25')]);_0x3364e5[_0xa0a8('0x23')]=qs[_0xa0a8('0x23')](_0x53867f[_0xa0a8('0x3a')][_0xa0a8('0x23')]);}_0x3364e5[_0xa0a8('0xa2')]=qs[_0xa0a8('0xa3')](_0x53867f['query'][_0xa0a8('0xa3')]);_0x3364e5[_0xa0a8('0xa4')]=qs[_0xa0a8('0x40')](_[_0xa0a8('0xa5')](_0x53867f[_0xa0a8('0x3a')],_0x30496['filters']));_0x3364e5[_0xa0a8('0xa4')][_0xa0a8('0xa6')]=_0x272467['id'];if(_0x53867f[_0xa0a8('0x3a')]['filter']){_0x3364e5[_0xa0a8('0xa4')]=_[_0xa0a8('0xa7')](_0x3364e5['where'],{'$or':_[_0xa0a8('0x31')](_0x3364e5['attributes'],function(_0x5397ef){var _0x39b85e={};_0x39b85e[_0x5397ef]={'$like':'%'+_0x53867f[_0xa0a8('0x3a')][_0xa0a8('0xa8')]+'%'};return _0x39b85e;})});}if(_0x53867f[_0xa0a8('0x3a')][_0xa0a8('0xa9')]){var _0x3be48b=_0x53867f[_0xa0a8('0x3a')][_0xa0a8('0xa9')]['split'](',');var _0x21d64a={};_0x21d64a[_0x3be48b[0x0]]={'$gte':moment(_0x3be48b[0x1])[_0xa0a8('0x89')](_0xa0a8('0xaa'))};_0x3364e5['where']=_['merge'](_0x3364e5[_0xa0a8('0xa4')],_0x21d64a);}_0x3364e5=_[_0xa0a8('0xa7')]({},_0x3364e5,_0x53867f[_0xa0a8('0xab')]);return db[_0xa0a8('0x62')][_0xa0a8('0x26')]({'where':_0x3364e5[_0xa0a8('0xa4')]})[_0xa0a8('0x16')](function(_0xeaf1a0){_0xce8f09['count']=_0xeaf1a0;if(_0x53867f['query'][_0xa0a8('0x45')]){_0x3364e5[_0xa0a8('0x46')]=[{'all':!![]}];}return db[_0xa0a8('0x62')][_0xa0a8('0x38')](_0x3364e5);})['then'](function(_0x406c24){_0xce8f09[_0xa0a8('0xac')]=_0x406c24;return _0xce8f09;});}})[_0xa0a8('0x16')](respondWithFilteredResult(_0x4c383b,_0x3364e5))[_0xa0a8('0x48')](handleError(_0x4c383b,null));};exports['getMyMessages']=function(_0x172a3e,_0x3220ca){var _0x1a0fd6={'where':{}},_0x5e7119={},_0xce83a1={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x172a3e[_0xa0a8('0x3d')]['id']}})[_0xa0a8('0x16')](handleEntityNotFound(_0x3220ca,null))[_0xa0a8('0x16')](function(_0x77be29){if(_0x77be29){_0x5e7119[_0xa0a8('0x3e')]=_[_0xa0a8('0x3f')](db[_0xa0a8('0x62')][_0xa0a8('0x33')]);_0x5e7119['query']=_[_0xa0a8('0x3f')](_0x172a3e[_0xa0a8('0x3a')]);_0x5e7119['filters']=_['intersection'](_0x5e7119[_0xa0a8('0x3e')],_0x5e7119[_0xa0a8('0x3a')]);_0x1a0fd6['attributes']=_[_0xa0a8('0x41')](_0x5e7119[_0xa0a8('0x3e')],qs[_0xa0a8('0x43')](_0x172a3e[_0xa0a8('0x3a')][_0xa0a8('0x43')]));_0x1a0fd6['attributes']=_0x1a0fd6[_0xa0a8('0x42')][_0xa0a8('0x44')]?_0x1a0fd6[_0xa0a8('0x42')]:_0x5e7119[_0xa0a8('0x3e')];if(!_0x172a3e['query'][_0xa0a8('0xa0')]('nolimit')){_0x1a0fd6[_0xa0a8('0x25')]=qs[_0xa0a8('0x25')](_0x172a3e[_0xa0a8('0x3a')]['limit']);_0x1a0fd6['offset']=qs['offset'](_0x172a3e[_0xa0a8('0x3a')][_0xa0a8('0x23')]);}_0x1a0fd6[_0xa0a8('0xa2')]=qs[_0xa0a8('0xa3')](_0x172a3e['query'][_0xa0a8('0xa3')]);_0x1a0fd6['where']=qs[_0xa0a8('0x40')](_[_0xa0a8('0xa5')](_0x172a3e[_0xa0a8('0x3a')],_0x5e7119[_0xa0a8('0x40')]));_0x1a0fd6[_0xa0a8('0xa4')][_0xa0a8('0xa6')]=_0x77be29['id'];if(_0x172a3e[_0xa0a8('0x3a')][_0xa0a8('0xa8')]){_0x1a0fd6[_0xa0a8('0xa4')]=_[_0xa0a8('0xa7')](_0x1a0fd6[_0xa0a8('0xa4')],{'$or':_['map'](_0x1a0fd6[_0xa0a8('0x42')],function(_0x4144f9){var _0x12332f={};_0x12332f[_0x4144f9]={'$like':'%'+_0x172a3e[_0xa0a8('0x3a')][_0xa0a8('0xa8')]+'%'};return _0x12332f;})});}_0x1a0fd6[_0xa0a8('0xa4')][_0xa0a8('0xad')]=![];if(_0x172a3e[_0xa0a8('0x3a')]['id']){_0x1a0fd6[_0xa0a8('0xa4')]['id']={'$gt':_0x172a3e['query']['id']};}_0x1a0fd6=_[_0xa0a8('0xa7')]({},_0x1a0fd6,_0x172a3e[_0xa0a8('0xab')]);return db[_0xa0a8('0x62')][_0xa0a8('0x26')]({'where':_0x1a0fd6[_0xa0a8('0xa4')]})[_0xa0a8('0x16')](function(_0x343a6d){_0xce83a1['count']=_0x343a6d;_0x1a0fd6[_0xa0a8('0x46')]=[];if(_0x172a3e[_0xa0a8('0x3a')]['includeAgent']){_0x1a0fd6[_0xa0a8('0x46')][_0xa0a8('0xae')]({'model':db['User'],'as':_0xa0a8('0x83'),'attributes':['id',_0xa0a8('0x90'),'alias']});}if(_0x172a3e[_0xa0a8('0x3a')][_0xa0a8('0x45')]){_0x1a0fd6[_0xa0a8('0x46')]=[{'all':!![]}];}return db[_0xa0a8('0x62')]['findAll'](_0x1a0fd6);})[_0xa0a8('0x16')](function(_0x26d6ef){_0xce83a1[_0xa0a8('0xac')]=_0x26d6ef;return _0xce83a1;});}})[_0xa0a8('0x16')](respondWithFilteredResult(_0x3220ca,_0x1a0fd6))[_0xa0a8('0x48')](handleError(_0x3220ca,null));};exports['addTags']=function(_0x556efd,_0x25c659){return db[_0xa0a8('0x32')][_0xa0a8('0x47')]({'where':{'id':_0x556efd[_0xa0a8('0x3d')]['id']}})['then'](handleEntityNotFound(_0x25c659,null))[_0xa0a8('0x16')](function(_0x4f659d){if(_0x4f659d){return _0x4f659d[_0xa0a8('0xaf')](_0x556efd[_0xa0a8('0x4a')]['ids'],_[_0xa0a8('0x9d')](_0x556efd[_0xa0a8('0x4a')],[_0xa0a8('0x9e'),'id'])||{})[_0xa0a8('0xb0')](function(){return db['Tag'][_0xa0a8('0x38')]({'attributes':['id',_0xa0a8('0x2b'),'color'],'where':{'id':_0x556efd['body'][_0xa0a8('0x9e')]}});})[_0xa0a8('0x16')](function(_0x1cbb6f){socket['emit']('chatInteractionTags:save',{'id':Number(_0x556efd[_0xa0a8('0x3d')]['id']),'tags':_0x1cbb6f||[]});return{'id':Number(_0x556efd[_0xa0a8('0x3d')]['id']),'tags':_0x1cbb6f||[]};});}})[_0xa0a8('0x16')](respondWithResult(_0x25c659,null))['catch'](handleError(_0x25c659,null));};exports[_0xa0a8('0xb1')]=function(_0x412263,_0x3ba9aa){return db[_0xa0a8('0x32')][_0xa0a8('0x47')]({'where':{'id':_0x412263[_0xa0a8('0x3d')]['id']}})[_0xa0a8('0x16')](handleEntityNotFound(_0x3ba9aa,null))[_0xa0a8('0x16')](function(_0x47f1fb){if(_0x47f1fb){return _0x47f1fb['removeTags'](_0x412263[_0xa0a8('0x3a')][_0xa0a8('0x9e')]);}})['then'](respondWithStatusCode(_0x3ba9aa,null))[_0xa0a8('0x48')](handleError(_0x3ba9aa,null));};exports[_0xa0a8('0x7c')]=function(_0x4d337d,_0x1adad5){var _0x58c51e=moment()[_0xa0a8('0xb2')]()['toString']();var _0x3218bb=path[_0xa0a8('0x78')](config[_0xa0a8('0x79')],_0xa0a8('0xb3'),_0xa0a8('0xb4'),_0xa0a8('0xb5'));var _0x3c9a1e=path[_0xa0a8('0x78')](config[_0xa0a8('0x79')],_0xa0a8('0xb3'),_0xa0a8('0xb4'),_0xa0a8('0xb6'));var _0x2f3928=path[_0xa0a8('0x78')](_0x3218bb,_0x58c51e);var _0x2463ac=util[_0xa0a8('0x89')](_0xa0a8('0xb7'),_0x4d337d[_0xa0a8('0x3d')]['id'],_0x58c51e);var _0xe40df0=path[_0xa0a8('0x78')](_0x3218bb,_0x2463ac);var _0x202ba1=[];_0x202ba1[_0xa0a8('0xae')]({'model':db['User'],'as':_0xa0a8('0x83'),'attributes':['id',_0xa0a8('0x90')],'raw':!![]});_0x202ba1[_0xa0a8('0xae')]({'model':db['CmContact'],'as':_0xa0a8('0x66'),'attributes':['id',_0xa0a8('0xb8'),_0xa0a8('0xb9')],'raw':!![]});if(_0x4d337d[_0xa0a8('0x3a')][_0xa0a8('0xb6')]){_0x202ba1[_0xa0a8('0xae')]({'model':db[_0xa0a8('0x75')],'as':_0xa0a8('0x75'),'raw':!![]});}var _0x575d14=[{'model':db[_0xa0a8('0x62')],'as':_0xa0a8('0x82'),'attributes':['id',_0xa0a8('0x4a'),'createdAt',_0xa0a8('0xba'),_0xa0a8('0xad'),_0xa0a8('0xbb')],'include':_0x202ba1}];_0x575d14[_0xa0a8('0xae')]({'model':db[_0xa0a8('0x4d')],'as':_0xa0a8('0xbc'),'attributes':['id',_0xa0a8('0x2b')]});_0x575d14['push']({'model':db[_0xa0a8('0x83')],'as':_0xa0a8('0xbd'),'attributes':['id',_0xa0a8('0x90')]});return db[_0xa0a8('0x32')][_0xa0a8('0x47')]({'where':{'id':_0x4d337d[_0xa0a8('0x3d')]['id']},'include':_0x575d14})[_0xa0a8('0x16')](handleEntityNotFound(_0x1adad5,null))['then'](function(_0x3ecd23){if(_0x3ecd23){var _0x9366dc=_0x3ecd23[_0xa0a8('0xbe')]({'plain':!![]});fs['mkdirSync'](_0x2f3928);var _0x5b54ac={'channel':_0xa0a8('0xbf'),'account':_0x9366dc[_0xa0a8('0xbc')][_0xa0a8('0x2b')],'agent':_0x9366dc[_0xa0a8('0xbd')]?_0x9366dc[_0xa0a8('0xbd')][_0xa0a8('0x90')]:_0xa0a8('0xc0'),'createdAt':moment(_0x9366dc[_0xa0a8('0x92')])[_0xa0a8('0x89')](_0xa0a8('0xaa'))[_0xa0a8('0xc1')](),'closedAt':_0x9366dc['closed']?moment(_0x9366dc['closedAt'])[_0xa0a8('0x89')](_0xa0a8('0xaa'))[_0xa0a8('0xc1')]():'','disposition':_0x9366dc[_0xa0a8('0x6c')],'chatInfo':{'browser':_0x9366dc[_0xa0a8('0xc2')],'os':_0x9366dc[_0xa0a8('0xc3')],'referer':_0x9366dc[_0xa0a8('0xc4')],'customerIp':_0x9366dc['customerIp'],'customerPort':_0x9366dc[_0xa0a8('0xc5')]?_0x9366dc[_0xa0a8('0xc5')]:_0xa0a8('0xc0')},'messages':_(_0x9366dc['Messages'])['tail']()[_0xa0a8('0xa8')]({'secret':![]})[_0xa0a8('0x31')](function(_0x10942f){if(_0x10942f[_0xa0a8('0x75')]){var _0x2393d2=path[_0xa0a8('0x78')](_0x3c9a1e,_0x10942f['Attachment'][_0xa0a8('0x7b')]);if(fs[_0xa0a8('0xc6')](_0x2393d2)){fs[_0xa0a8('0xc7')](_0x2393d2)['pipe'](fs['createWriteStream'](path[_0xa0a8('0x78')](_0x2f3928,_0x10942f['Attachment'][_0xa0a8('0x7b')])));}}return{'date':moment(_0x10942f[_0xa0a8('0x92')])[_0xa0a8('0x89')](_0xa0a8('0xaa'))[_0xa0a8('0xc1')](),'sender':_0x10942f['direction']===_0xa0a8('0x61')?_0x10942f[_0xa0a8('0x83')]?_0x10942f['User'][_0xa0a8('0x90')]:_0xa0a8('0x8d'):_0x10942f[_0xa0a8('0x66')]['firstName']+(_0x10942f[_0xa0a8('0x66')]['lastName']?'\x20'+_0x10942f[_0xa0a8('0x66')]['lastName']:''),'body':_0x10942f[_0xa0a8('0x75')]?_0x10942f['Attachment'][_0xa0a8('0x7b')]:_0x10942f['body'],'direction':_0x10942f[_0xa0a8('0xba')]==='out'?'A':'C','secret':_0x10942f[_0xa0a8('0xad')],'read':_0x10942f[_0xa0a8('0xbb')],'attachment':_0x10942f[_0xa0a8('0x75')]};})[_0xa0a8('0xc8')]()};return ejs[_0xa0a8('0xc9')](path[_0xa0a8('0x78')](config[_0xa0a8('0x79')],_0xa0a8('0xb3'),_0xa0a8('0xca'),'downloadInteraction.ejs'),{'interaction':_0x5b54ac})[_0xa0a8('0x16')](function(_0x4fe9f5){var _0x2bdb75=path[_0xa0a8('0x78')](_0x2f3928,'transcript-'+_0x9366dc['id']+'-'+_0x58c51e+_0xa0a8('0xcb'));var _0x1774ab={'path':_0x2bdb75,'channel':_0xa0a8('0xbf'),'interactionId':_0x9366dc['id']};return pdf[_0xa0a8('0xcc')](_0x4fe9f5,_0x1774ab);})[_0xa0a8('0x16')](function(){return new Promise(function(_0x72e462,_0x393aeb){zipdir(_0x2f3928,{'saveTo':_0xe40df0},function(_0x1f2bad,_0x42cd90){if(_0x1f2bad)return _0x393aeb(_0x1f2bad);return _0x72e462(_0x42cd90);});})[_0xa0a8('0x16')](function(){return new BPromise(function(_0xd2f2f2,_0x16eaa2){rimraf(_0x2f3928,function(_0xcf8bad){if(_0xcf8bad)_0x16eaa2(_0xcf8bad);return _0xd2f2f2();});});})[_0xa0a8('0x16')](function(){return _0x1adad5[_0xa0a8('0x7c')](_0xe40df0,_0x2463ac,function(_0x3986c0){if(_0x3986c0){logger[_0xa0a8('0x1a')](_0xa0a8('0xcd'),_0x3986c0);}else{fs[_0xa0a8('0xce')](_0xe40df0);}});});});}else{return _0x1adad5[_0xa0a8('0x1f')](0xc8);}})['catch'](handleError(_0x1adad5,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 186b344..f53eca7 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 _0x8c72=['map','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','getUsers','then','setDataValue'];(function(_0x1d1860,_0x55062b){var _0x19ddca=function(_0x2e2b62){while(--_0x2e2b62){_0x1d1860['push'](_0x1d1860['shift']());}};_0x19ddca(++_0x55062b);}(_0x8c72,0x19c));var _0x28c7=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x8c72[_0x119d5a];return _0x15bff4;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x28c7('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x28c7('0x0'))['db'][_0x28c7('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x28c7('0x2')](0x0);var events={'afterCreate':_0x28c7('0x3'),'afterUpdate':_0x28c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3318dd){return function(_0x249068,_0x9f7639,_0x2d7d54){_0x249068[_0x28c7('0x5')]({'attributes':['id'],'raw':!![]})[_0x28c7('0x6')](function(_0x2a1d8c){_0x249068[_0x28c7('0x7')]('Users',_0x2a1d8c[_0x28c7('0x8')](function(_0x1923b1){return{'id':_0x1923b1['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x249068['id'],'direction':'in','read':![]},'raw':!![]});})[_0x28c7('0x6')](function(_0x204754){_0x249068[_0x28c7('0x7')](_0x28c7('0x9'),_0x204754['length']);ChatInteractionEvents['emit'](_0x3318dd+':'+_0x249068['id'],_0x249068);ChatInteractionEvents[_0x28c7('0xa')](_0x3318dd,_0x249068);_0x2d7d54(null);})[_0x28c7('0xb')](_0x2d7d54(null));};}for(var e in events){if(events[_0x28c7('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x28c7('0xd')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xcd08=['events','../../mysqldb','ChatInteraction','save','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x57882a,_0x164508){var _0x12a914=function(_0x38ecb0){while(--_0x38ecb0){_0x57882a['push'](_0x57882a['shift']());}};_0x12a914(++_0x164508);}(_0xcd08,0x16c));var _0x8cd0=function(_0x64a0e8,_0x2c86a5){_0x64a0e8=_0x64a0e8-0x0;var _0xb2f2e2=_0xcd08[_0x64a0e8];return _0xb2f2e2;};'use strict';var EventEmitter=require(_0x8cd0('0x0'));var ChatInteraction=require(_0x8cd0('0x1'))['db'][_0x8cd0('0x2')];var ChatMessage=require(_0x8cd0('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8cd0('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x49f160){return function(_0x208ed6,_0x7b29f5,_0x509731){_0x208ed6['getUsers']({'attributes':['id'],'raw':!![]})[_0x8cd0('0x4')](function(_0x1f7e2a){_0x208ed6[_0x8cd0('0x5')](_0x8cd0('0x6'),_0x1f7e2a['map'](function(_0x1f9928){return{'id':_0x1f9928['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x208ed6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8cd0('0x4')](function(_0x3777f5){_0x208ed6[_0x8cd0('0x5')](_0x8cd0('0x7'),_0x3777f5[_0x8cd0('0x8')]);ChatInteractionEvents['emit'](_0x49f160+':'+_0x208ed6['id'],_0x208ed6);ChatInteractionEvents[_0x8cd0('0x9')](_0x49f160,_0x208ed6);_0x509731(null);})[_0x8cd0('0xa')](_0x509731(null));};}for(var e in events){if(events[_0x8cd0('0xb')](e)){var event=events[e];ChatInteraction[_0x8cd0('0xc')](e,emitEvent(event));}}module[_0x8cd0('0xd')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index aa90c8d..e688243 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 _0x2154=['../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5a0bc9,_0x33e977){var _0xea2e04=function(_0x48f2d9){while(--_0x48f2d9){_0x5a0bc9['push'](_0x5a0bc9['shift']());}};_0xea2e04(++_0x33e977);}(_0x2154,0xa0));var _0x4215=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x2154[_0x1abb09];return _0xea1c07;};'use strict';var _=require('lodash');var util=require(_0x4215('0x0'));var logger=require(_0x4215('0x1'))(_0x4215('0x2'));var moment=require(_0x4215('0x3'));var BPromise=require(_0x4215('0x4'));var rp=require(_0x4215('0x5'));var fs=require('fs');var path=require(_0x4215('0x6'));var rimraf=require(_0x4215('0x7'));var config=require(_0x4215('0x8'));var attributes=require(_0x4215('0x9'));module[_0x4215('0xa')]=function(_0x44fe7d,_0x18ea4f){return _0x44fe7d[_0x4215('0xb')](_0x4215('0xc'),attributes,{'tableName':_0x4215('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x54bf6f,_0x29283f,_0x540479){if(_0x54bf6f[_0x4215('0xe')](_0x4215('0xf'))){_0x54bf6f[_0x4215('0x10')]=moment()[_0x4215('0x11')](_0x4215('0x12'));}_0x540479(null,_0x54bf6f);}},'charset':_0x4215('0x13'),'collate':_0x4215('0x14')});};
\ No newline at end of file
+var _0x0ebb=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','ChatInteraction','chat_interactions','closed','closedAt'];(function(_0x4a0a69,_0x56acd5){var _0x14abbf=function(_0x3e0854){while(--_0x3e0854){_0x4a0a69['push'](_0x4a0a69['shift']());}};_0x14abbf(++_0x56acd5);}(_0x0ebb,0x124));var _0xb0eb=function(_0x4f2861,_0x26eb9e){_0x4f2861=_0x4f2861-0x0;var _0x7504f1=_0x0ebb[_0x4f2861];return _0x7504f1;};'use strict';var _=require(_0xb0eb('0x0'));var util=require('util');var logger=require(_0xb0eb('0x1'))(_0xb0eb('0x2'));var moment=require(_0xb0eb('0x3'));var BPromise=require(_0xb0eb('0x4'));var rp=require(_0xb0eb('0x5'));var fs=require('fs');var path=require(_0xb0eb('0x6'));var rimraf=require(_0xb0eb('0x7'));var config=require(_0xb0eb('0x8'));var attributes=require(_0xb0eb('0x9'));module['exports']=function(_0x3f920a,_0x6083cf){return _0x3f920a['define'](_0xb0eb('0xa'),attributes,{'tableName':_0xb0eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5ce48f,_0x274b38,_0xc05d3e){if(_0x5ce48f['changed'](_0xb0eb('0xc'))){_0x5ce48f[_0xb0eb('0xd')]=moment()[_0xb0eb('0xe')](_0xb0eb('0xf'));}_0xc05d3e(null,_0x5ce48f);}},'charset':'utf8mb4','collate':_0xb0eb('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index c62c64d..b2ba656 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 _0x0f97=['request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','UpdateChatInteraction','ChatInteraction','body','options','raw','where','limit','stringify','catch','AddTagsToChatInteraction','addTags','omit','spread','debug','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x4ff81c,_0x5c0db3){var _0x175291=function(_0x3f14c3){while(--_0x3f14c3){_0x4ff81c['push'](_0x4ff81c['shift']());}};_0x175291(++_0x5c0db3);}(_0x0f97,0xaf));var _0x70f9=function(_0x2d6375,_0x149216){_0x2d6375=_0x2d6375-0x0;var _0x29186f=_0x0f97[_0x2d6375];return _0x29186f;};'use strict';var _=require(_0x70f9('0x0'));var util=require(_0x70f9('0x1'));var moment=require(_0x70f9('0x2'));var BPromise=require('bluebird');var rs=require(_0x70f9('0x3'));var fs=require('fs');var Redis=require(_0x70f9('0x4'));var db=require(_0x70f9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x70f9('0x6'));var config=require(_0x70f9('0x7'));var jayson=require(_0x70f9('0x8'));var client=jayson['client'][_0x70f9('0x9')]({'port':0x232a});config[_0x70f9('0xa')]=_['defaults'](config[_0x70f9('0xa')],{'host':_0x70f9('0xb'),'port':0x18eb});var socket=require(_0x70f9('0xc'))(new Redis(config['redis']));require(_0x70f9('0xd'))[_0x70f9('0xe')](socket);function respondWithRpcPromise(_0xa9bf84,_0x1878bd,_0x108db2){return new BPromise(function(_0x53f04d,_0x229b21){return client[_0x70f9('0xf')](_0xa9bf84,_0x108db2)[_0x70f9('0x10')](function(_0x402489){logger[_0x70f9('0x11')](_0x70f9('0x12'),_0x1878bd,_0x70f9('0x13'));logger['debug'](_0x70f9('0x14'),_0x1878bd,_0x70f9('0x13'),JSON['stringify'](_0x402489));if(_0x402489[_0x70f9('0x15')]){if(_0x402489[_0x70f9('0x15')]['code']===0x1f4){logger['error'](_0x70f9('0x12'),_0x1878bd,_0x402489[_0x70f9('0x15')][_0x70f9('0x16')]);return _0x229b21(_0x402489['error']['message']);}logger[_0x70f9('0x15')](_0x70f9('0x12'),_0x1878bd,_0x402489[_0x70f9('0x15')][_0x70f9('0x16')]);return _0x53f04d(_0x402489[_0x70f9('0x15')]['message']);}else{logger['info'](_0x70f9('0x12'),_0x1878bd,_0x70f9('0x13'));_0x53f04d(_0x402489['result']['message']);}})['catch'](function(_0x3d7757){logger[_0x70f9('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x1878bd,_0x3d7757);_0x229b21(_0x3d7757);});});}exports[_0x70f9('0x17')]=function(_0x5ec653){var _0x33dde5=this;return new Promise(function(_0x50d0c4,_0x5e2276){return db[_0x70f9('0x18')]['update'](_0x5ec653[_0x70f9('0x19')],{'raw':_0x5ec653[_0x70f9('0x1a')]?_0x5ec653['options'][_0x70f9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ec653['options']?_0x5ec653['options'][_0x70f9('0x1c')]||null:null,'attributes':_0x5ec653[_0x70f9('0x1a')]?_0x5ec653['options']['attributes']||null:null,'limit':_0x5ec653[_0x70f9('0x1a')]?_0x5ec653[_0x70f9('0x1a')][_0x70f9('0x1d')]||null:null})[_0x70f9('0x10')](function(_0x163b5a){logger[_0x70f9('0x11')](_0x70f9('0x17'),_0x5ec653);logger['debug']('UpdateChatInteraction',_0x5ec653,JSON[_0x70f9('0x1e')](_0x163b5a));_0x50d0c4(_0x163b5a);})[_0x70f9('0x1f')](function(_0x1c474b){logger[_0x70f9('0x15')]('UpdateChatInteraction',_0x1c474b['message'],_0x5ec653);_0x5e2276(_0x33dde5[_0x70f9('0x15')](0x1f4,_0x1c474b[_0x70f9('0x16')]));});});};exports[_0x70f9('0x20')]=function(_0x83e7d0){return new Promise(function(_0xdeca2,_0x308c14){return db[_0x70f9('0x18')]['find']({'where':_0x83e7d0[_0x70f9('0x1a')]?_0x83e7d0[_0x70f9('0x1a')][_0x70f9('0x1c')]||null:null})[_0x70f9('0x10')](function(_0x5d5d6a){if(_0x5d5d6a){return _0x5d5d6a[_0x70f9('0x21')](_0x83e7d0['body']['ids'],_[_0x70f9('0x22')](_0x83e7d0['body'],['ids','id'])||{});}})[_0x70f9('0x23')](function(_0x29d3a4){logger['info']('AddTags',_0x83e7d0);logger[_0x70f9('0x24')](_0x70f9('0x25'),_0x83e7d0,JSON[_0x70f9('0x1e')](_0x29d3a4));_0xdeca2(_0x29d3a4);})[_0x70f9('0x1f')](function(_0x2aa59b){logger[_0x70f9('0x15')]('AddTags',_0x2aa59b['message'],_0x83e7d0);_0x308c14(_this[_0x70f9('0x15')](0x1f4,_0x2aa59b[_0x70f9('0x16')]));});});};
\ No newline at end of file
+var _0x2c58=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','request\x20sent','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','debug','AddTags','lodash','util','moment'];(function(_0x210603,_0x4adbac){var _0x1bcb7d=function(_0x2cdf89){while(--_0x2cdf89){_0x210603['push'](_0x210603['shift']());}};_0x1bcb7d(++_0x4adbac);}(_0x2c58,0x84));var _0x82c5=function(_0x26745a,_0x1771c7){_0x26745a=_0x26745a-0x0;var _0x7cc231=_0x2c58[_0x26745a];return _0x7cc231;};'use strict';var _=require(_0x82c5('0x0'));var util=require(_0x82c5('0x1'));var moment=require(_0x82c5('0x2'));var BPromise=require('bluebird');var rs=require(_0x82c5('0x3'));var fs=require('fs');var Redis=require(_0x82c5('0x4'));var db=require(_0x82c5('0x5'))['db'];var utils=require(_0x82c5('0x6'));var logger=require(_0x82c5('0x7'))(_0x82c5('0x8'));var config=require(_0x82c5('0x9'));var jayson=require(_0x82c5('0xa'));var client=jayson[_0x82c5('0xb')][_0x82c5('0xc')]({'port':0x232a});config[_0x82c5('0xd')]=_[_0x82c5('0xe')](config[_0x82c5('0xd')],{'host':_0x82c5('0xf'),'port':0x18eb});var socket=require(_0x82c5('0x10'))(new Redis(config[_0x82c5('0xd')]));require(_0x82c5('0x11'))['register'](socket);function respondWithRpcPromise(_0x1c3622,_0x559f9a,_0x4231c0){return new BPromise(function(_0x5ec25d,_0x151d9f){return client[_0x82c5('0x12')](_0x1c3622,_0x4231c0)[_0x82c5('0x13')](function(_0x24203){logger[_0x82c5('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x559f9a,_0x82c5('0x15'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x559f9a,_0x82c5('0x15'),JSON['stringify'](_0x24203));if(_0x24203[_0x82c5('0x16')]){if(_0x24203[_0x82c5('0x16')][_0x82c5('0x17')]===0x1f4){logger[_0x82c5('0x16')](_0x82c5('0x18'),_0x559f9a,_0x24203[_0x82c5('0x16')][_0x82c5('0x19')]);return _0x151d9f(_0x24203[_0x82c5('0x16')][_0x82c5('0x19')]);}logger[_0x82c5('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x559f9a,_0x24203['error'][_0x82c5('0x19')]);return _0x5ec25d(_0x24203['error']['message']);}else{logger[_0x82c5('0x14')](_0x82c5('0x18'),_0x559f9a,_0x82c5('0x15'));_0x5ec25d(_0x24203[_0x82c5('0x1a')][_0x82c5('0x19')]);}})[_0x82c5('0x1b')](function(_0x5ec106){logger[_0x82c5('0x16')](_0x82c5('0x18'),_0x559f9a,_0x5ec106);_0x151d9f(_0x5ec106);});});}exports[_0x82c5('0x1c')]=function(_0x3757e0){var _0x4d3438=this;return new Promise(function(_0x59905f,_0xaae61c){return db[_0x82c5('0x1d')][_0x82c5('0x1e')](_0x3757e0[_0x82c5('0x1f')],{'raw':_0x3757e0[_0x82c5('0x20')]?_0x3757e0['options'][_0x82c5('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3757e0[_0x82c5('0x20')]?_0x3757e0[_0x82c5('0x20')][_0x82c5('0x22')]||null:null,'attributes':_0x3757e0[_0x82c5('0x20')]?_0x3757e0[_0x82c5('0x20')]['attributes']||null:null,'limit':_0x3757e0[_0x82c5('0x20')]?_0x3757e0[_0x82c5('0x20')][_0x82c5('0x23')]||null:null})[_0x82c5('0x13')](function(_0x5dc496){logger[_0x82c5('0x14')](_0x82c5('0x1c'),_0x3757e0);logger['debug']('UpdateChatInteraction',_0x3757e0,JSON[_0x82c5('0x24')](_0x5dc496));_0x59905f(_0x5dc496);})[_0x82c5('0x1b')](function(_0xfe3474){logger[_0x82c5('0x16')](_0x82c5('0x1c'),_0xfe3474[_0x82c5('0x19')],_0x3757e0);_0xaae61c(_0x4d3438[_0x82c5('0x16')](0x1f4,_0xfe3474[_0x82c5('0x19')]));});});};exports[_0x82c5('0x25')]=function(_0x5ed1a0){return new Promise(function(_0x484c29,_0x50f443){return db[_0x82c5('0x1d')][_0x82c5('0x26')]({'where':_0x5ed1a0['options']?_0x5ed1a0['options'][_0x82c5('0x22')]||null:null})[_0x82c5('0x13')](function(_0x31c316){if(_0x31c316){return _0x31c316[_0x82c5('0x27')](_0x5ed1a0[_0x82c5('0x1f')][_0x82c5('0x28')],_[_0x82c5('0x29')](_0x5ed1a0[_0x82c5('0x1f')],[_0x82c5('0x28'),'id'])||{});}})[_0x82c5('0x2a')](function(_0x24194b){logger[_0x82c5('0x14')]('AddTags',_0x5ed1a0);logger[_0x82c5('0x2b')](_0x82c5('0x2c'),_0x5ed1a0,JSON['stringify'](_0x24194b));_0x484c29(_0x24194b);})[_0x82c5('0x1b')](function(_0x3813a5){logger[_0x82c5('0x16')]('AddTags',_0x3813a5[_0x82c5('0x19')],_0x5ed1a0);_0x50f443(_this[_0x82c5('0x16')](0x1f4,_0x3813a5[_0x82c5('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 8927cf8..d60483a 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 _0x98ac=['remove','emit','register','length','chatInteraction:'];(function(_0x47f32a,_0x1dbe9b){var _0x22512d=function(_0x4874a0){while(--_0x4874a0){_0x47f32a['push'](_0x47f32a['shift']());}};_0x22512d(++_0x1dbe9b);}(_0x98ac,0x1d1));var _0xc98a=function(_0x14b1fa,_0x5aa6df){_0x14b1fa=_0x14b1fa-0x0;var _0x5cbea1=_0x98ac[_0x14b1fa];return _0x5cbea1;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0xc98a('0x0'),'update'];function createListener(_0x54c55e,_0x402f8a){return function(_0x434f17){_0x402f8a[_0xc98a('0x1')](_0x54c55e,_0x434f17);};}function removeListener(_0x141041,_0xe44835){return function(){ChatInteractionEvents['removeListener'](_0x141041,_0xe44835);};}exports[_0xc98a('0x2')]=function(_0x3e95c6){for(var _0x531dba=0x0,_0x22a165=events[_0xc98a('0x3')];_0x531dba<_0x22a165;_0x531dba++){var _0x3d9c82=events[_0x531dba];var _0x17fcf8=createListener(_0xc98a('0x4')+_0x3d9c82,_0x3e95c6);ChatInteractionEvents['on'](_0x3d9c82,_0x17fcf8);}};
\ No newline at end of file
+var _0x3aca=['update','emit','removeListener','register','chatInteraction:','./chatInteraction.events'];(function(_0x31ae8c,_0x15dd90){var _0x30e30b=function(_0x33676b){while(--_0x33676b){_0x31ae8c['push'](_0x31ae8c['shift']());}};_0x30e30b(++_0x15dd90);}(_0x3aca,0x83));var _0xa3ac=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0x3aca[_0x5b27da];return _0x3254f4;};'use strict';var ChatInteractionEvents=require(_0xa3ac('0x0'));var events=['save','remove',_0xa3ac('0x1')];function createListener(_0x2e1dde,_0x3e44a3){return function(_0x585e8f){_0x3e44a3[_0xa3ac('0x2')](_0x2e1dde,_0x585e8f);};}function removeListener(_0x1127ed,_0x520276){return function(){ChatInteractionEvents[_0xa3ac('0x3')](_0x1127ed,_0x520276);};}exports[_0xa3ac('0x4')]=function(_0x56c21d){for(var _0x219b27=0x0,_0x5d9b73=events['length'];_0x219b27<_0x5d9b73;_0x219b27++){var _0x389abc=events[_0x219b27];var _0x4da43d=createListener(_0xa3ac('0x5')+_0x389abc,_0x56c21d);ChatInteractionEvents['on'](_0x389abc,_0x4da43d);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index d0560c4..57a2b92 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 _0xcc17=['../../components/auth/service','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','join','format','now','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','/:id/abandon','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','express','Router','fs-extra'];(function(_0x1fe0d4,_0x3e9d58){var _0x49675a=function(_0x1c96e9){while(--_0x1c96e9){_0x1fe0d4['push'](_0x1fe0d4['shift']());}};_0x49675a(++_0x3e9d58);}(_0xcc17,0x10e));var _0x7cc1=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xcc17[_0x166d93];return _0xba708;};'use strict';var multer=require(_0x7cc1('0x0'));var util=require(_0x7cc1('0x1'));var path=require(_0x7cc1('0x2'));var timeout=require('connect-timeout');var express=require(_0x7cc1('0x3'));var router=express[_0x7cc1('0x4')]();var fs_extra=require(_0x7cc1('0x5'));var auth=require(_0x7cc1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7cc1('0x7'));router[_0x7cc1('0x8')]('/',auth[_0x7cc1('0x9')](),controller['index']);router['get'](_0x7cc1('0xa'),auth[_0x7cc1('0x9')](),controller[_0x7cc1('0xb')]);router[_0x7cc1('0x8')](_0x7cc1('0xc'),auth[_0x7cc1('0xd')](),controller[_0x7cc1('0xe')]);router[_0x7cc1('0x8')](_0x7cc1('0xf'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router['get'](_0x7cc1('0x10'),auth[_0x7cc1('0x9')](),controller['getMessages']);router[_0x7cc1('0x8')](_0x7cc1('0x11'),auth[_0x7cc1('0xd')](),controller[_0x7cc1('0x12')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x7cc1('0x13')]);router[_0x7cc1('0x14')]('/',auth[_0x7cc1('0x9')](),controller[_0x7cc1('0x15')]);router[_0x7cc1('0x14')](_0x7cc1('0x16'),auth['isAuthenticated'](),controller[_0x7cc1('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb5148a,_0x537b2d,_0x37beb7){_0x37beb7(null,path[_0x7cc1('0x18')](config['root'],'server/files/attachments/'));},'filename':function(_0x3f7fc5,_0x219443,_0x46b275){_0x46b275(null,util[_0x7cc1('0x19')]('%s-%s',Date[_0x7cc1('0x1a')](),_0x219443['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x7cc1('0x1b'),upload[_0x7cc1('0x1c')](_0x7cc1('0x1d')),controller[_0x7cc1('0x1e')]);router['post'](_0x7cc1('0x10'),auth[_0x7cc1('0xd')](),controller[_0x7cc1('0x1f')]);router[_0x7cc1('0x14')]('/:id/tags',auth[_0x7cc1('0x9')](),interaction[_0x7cc1('0x20')](_0x7cc1('0x21'),_0x7cc1('0x22')),controller[_0x7cc1('0x23')]);router[_0x7cc1('0x24')](_0x7cc1('0xc'),auth[_0x7cc1('0x9')](),interaction[_0x7cc1('0x20')](_0x7cc1('0x21'),'chatinteraction:update'),controller[_0x7cc1('0x25')]);router[_0x7cc1('0x24')](_0x7cc1('0x26'),controller['customUpdate']);router[_0x7cc1('0x24')](_0x7cc1('0x27'),auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0x7cc1('0x24')]('/:id/close',controller['close']);router[_0x7cc1('0x28')]('/:id',auth[_0x7cc1('0x9')](),interaction[_0x7cc1('0x20')](_0x7cc1('0x21'),_0x7cc1('0x29')),controller[_0x7cc1('0x2a')]);router['delete'](_0x7cc1('0x2b'),auth[_0x7cc1('0x9')](),controller[_0x7cc1('0x2c')]);module[_0x7cc1('0x2d')]=router;
\ No newline at end of file
+var _0x15e2=['server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','util','path','express','Router','../../config/environment','./chatInteraction.controller','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','get','/:id/attachment_download','/:id/my_messages','getMyMessages','/:id/download','post','create','createVidaooSession','join'];(function(_0x1ef48d,_0x19781c){var _0x25776c=function(_0x384d0e){while(--_0x384d0e){_0x1ef48d['push'](_0x1ef48d['shift']());}};_0x25776c(++_0x19781c);}(_0x15e2,0xfe));var _0x215e=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x15e2[_0x39d544];return _0x5a5ff2;};'use strict';var multer=require(_0x215e('0x0'));var util=require(_0x215e('0x1'));var path=require(_0x215e('0x2'));var timeout=require('connect-timeout');var express=require(_0x215e('0x3'));var router=express[_0x215e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x215e('0x5'));var controller=require(_0x215e('0x6'));router['get']('/',auth[_0x215e('0x7')](),controller[_0x215e('0x8')]);router['get']('/describe',auth[_0x215e('0x7')](),controller[_0x215e('0x9')]);router['get'](_0x215e('0xa'),auth[_0x215e('0xb')](),controller[_0x215e('0xc')]);router[_0x215e('0xd')](_0x215e('0xe'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0x215e('0xd')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x215e('0xf'),auth[_0x215e('0xb')](),controller[_0x215e('0x10')]);router[_0x215e('0xd')](_0x215e('0x11'),auth[_0x215e('0x7')](),controller['download']);router[_0x215e('0x12')]('/',auth['isAuthenticated'](),controller[_0x215e('0x13')]);router[_0x215e('0x12')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x215e('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d1d82,_0x224a3a,_0x1b5fff){_0x1b5fff(null,path[_0x215e('0x15')](config['root'],_0x215e('0x16')));},'filename':function(_0x2ad1f2,_0x8aa3e1,_0x128baf){_0x128baf(null,util[_0x215e('0x17')](_0x215e('0x18'),Date[_0x215e('0x19')](),_0x8aa3e1['originalname'][_0x215e('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x215e('0x1b'),upload[_0x215e('0x1c')](_0x215e('0x1d')),controller[_0x215e('0x1e')]);router[_0x215e('0x12')](_0x215e('0x1f'),auth[_0x215e('0xb')](),controller[_0x215e('0x20')]);router[_0x215e('0x12')](_0x215e('0x21'),auth[_0x215e('0x7')](),interaction[_0x215e('0x22')](_0x215e('0x23'),_0x215e('0x24')),controller['addTags']);router[_0x215e('0x25')](_0x215e('0xa'),auth[_0x215e('0x7')](),interaction[_0x215e('0x22')](_0x215e('0x23'),'chatinteraction:update'),controller['update']);router['put']('/:id/custom_update',controller[_0x215e('0x26')]);router['put']('/:id/abandon',auth[_0x215e('0xb')](),controller[_0x215e('0x27')]);router[_0x215e('0x25')](_0x215e('0x28'),controller[_0x215e('0x29')]);router[_0x215e('0x2a')](_0x215e('0xa'),auth[_0x215e('0x7')](),interaction['tracked'](_0x215e('0x23'),_0x215e('0x2b')),controller[_0x215e('0x2c')]);router[_0x215e('0x2a')](_0x215e('0x21'),auth['isAuthenticated'](),controller['removeTags']);module[_0x215e('0x2d')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index e3eb276..a3e5ed1 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 _0x2bc9=['TEXT','medium','sequelize','exports'];(function(_0x17590e,_0x426474){var _0x22884e=function(_0x1f9d5f){while(--_0x1f9d5f){_0x17590e['push'](_0x17590e['shift']());}};_0x22884e(++_0x426474);}(_0x2bc9,0x1d6));var _0x92bc=function(_0x2cdd4d,_0x394c2f){_0x2cdd4d=_0x2cdd4d-0x0;var _0x55cbc8=_0x2bc9[_0x2cdd4d];return _0x55cbc8;};'use strict';var Sequelize=require(_0x92bc('0x0'));module[_0x92bc('0x1')]={'body':{'type':Sequelize[_0x92bc('0x2')](_0x92bc('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x3c3c=['TEXT','sequelize','exports'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x3c3c,0x130));var _0xc3c3=function(_0x151dc6,_0x314721){_0x151dc6=_0x151dc6-0x0;var _0x25d2c1=_0x3c3c[_0x151dc6];return _0x25d2c1;};'use strict';var Sequelize=require(_0xc3c3('0x0'));module[_0xc3c3('0x1')]={'body':{'type':Sequelize[_0xc3c3('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 3627c8b..f274df0 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 _0x70ff=['../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','count','set','save','update','then','end','error','stack','name','send','index','ChatInternalMessage','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','rawAttributes','merge','find','catch','create','body','describe','get','lastMessageAt','createdAt','lastMessage','getUsers','User','agent','admin','fullname','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','resourceId','push','messages','ToId','read','-createdAt','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','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/utils'];(function(_0x16c925,_0x16f4c3){var _0x54e4ca=function(_0x13597b){while(--_0x13597b){_0x16c925['push'](_0x16c925['shift']());}};_0x54e4ca(++_0x16f4c3);}(_0x70ff,0x12f));var _0xf70f=function(_0x8d8f23,_0x8c1961){_0x8d8f23=_0x8d8f23-0x0;var _0x22bf54=_0x70ff[_0x8d8f23];return _0x22bf54;};'use strict';var emlformat=require(_0xf70f('0x0'));var rimraf=require(_0xf70f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf70f('0x2'));var rp=require(_0xf70f('0x3'));var moment=require(_0xf70f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf70f('0x5'));var util=require(_0xf70f('0x6'));var path=require('path');var sox=require(_0xf70f('0x7'));var csv=require('to-csv');var ejs=require(_0xf70f('0x8'));var fs=require('fs');var fs_extra=require(_0xf70f('0x9'));var _=require(_0xf70f('0xa'));var squel=require(_0xf70f('0xb'));var crypto=require(_0xf70f('0xc'));var jsforce=require(_0xf70f('0xd'));var deskjs=require(_0xf70f('0xe'));var toCsv=require(_0xf70f('0xf'));var querystring=require(_0xf70f('0x10'));var Papa=require(_0xf70f('0x11'));var Redis=require(_0xf70f('0x12'));var authService=require(_0xf70f('0x13'));var qs=require(_0xf70f('0x14'));var as=require(_0xf70f('0x15'));var hardwareService=require(_0xf70f('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xf70f('0x17'));var config=require(_0xf70f('0x18'));var licenseUtil=require(_0xf70f('0x19'));var db=require(_0xf70f('0x1a'))['db'];config[_0xf70f('0x1b')]=_[_0xf70f('0x1c')](config['redis'],{'host':_0xf70f('0x1d'),'port':0x18eb});var socket=require(_0xf70f('0x1e'))(new Redis(config[_0xf70f('0x1b')]));require(_0xf70f('0x1f'))[_0xf70f('0x20')](socket);function respondWithStatusCode(_0x36808b,_0x195827){_0x195827=_0x195827||0xcc;return function(_0x4257e9){if(_0x4257e9){return _0x36808b[_0xf70f('0x21')](_0x195827);}return _0x36808b[_0xf70f('0x22')](_0x195827)['end']();};}function respondWithResult(_0x159cdf,_0x38ba86){_0x38ba86=_0x38ba86||0xc8;return function(_0x3bfdb1){if(_0x3bfdb1){return _0x159cdf[_0xf70f('0x22')](_0x38ba86)[_0xf70f('0x23')](_0x3bfdb1);}};}function respondWithFilteredResult(_0x20177e,_0x1551a4){return function(_0x290314){if(_0x290314){var _0x516680=typeof _0x1551a4[_0xf70f('0x24')]===_0xf70f('0x25')&&typeof _0x1551a4['limit']==='undefined';var _0x41be77=_0x290314[_0xf70f('0x26')];var _0x378b57=_0x516680?0x0:_0x1551a4[_0xf70f('0x24')];var _0x2c1b3b=_0x516680?_0x290314[_0xf70f('0x26')]:_0x1551a4[_0xf70f('0x24')]+_0x1551a4['limit'];var _0x51f86d;if(_0x2c1b3b>=_0x41be77){_0x2c1b3b=_0x41be77;_0x51f86d=0xc8;}else{_0x51f86d=0xce;}_0x20177e['status'](_0x51f86d);return _0x20177e[_0xf70f('0x27')]('Content-Range',_0x378b57+'-'+_0x2c1b3b+'/'+_0x41be77)[_0xf70f('0x23')](_0x290314);}return null;};}function patchUpdates(_0x2189c2){return function(_0x7c71de){try{jsonpatch['apply'](_0x7c71de,_0x2189c2,!![]);}catch(_0x3afe13){return BPromise['reject'](_0x3afe13);}return _0x7c71de[_0xf70f('0x28')]();};}function saveUpdates(_0x4fd583,_0x553221){return function(_0x3e4bdc){if(_0x3e4bdc){return _0x3e4bdc[_0xf70f('0x29')](_0x4fd583)['then'](function(_0x3278c2){return _0x3278c2;});}return null;};}function removeEntity(_0x15949f,_0x2e6849){return function(_0x197d23){if(_0x197d23){return _0x197d23['destroy']()[_0xf70f('0x2a')](function(){_0x15949f[_0xf70f('0x22')](0xcc)[_0xf70f('0x2b')]();});}};}function handleEntityNotFound(_0xe88ba8,_0x17f8a3){return function(_0x3b0d31){if(!_0x3b0d31){_0xe88ba8['sendStatus'](0x194);}return _0x3b0d31;};}function handleError(_0x3e62cc,_0x43d1f5){_0x43d1f5=_0x43d1f5||0x1f4;return function(_0x5d9dcd){logger[_0xf70f('0x2c')](_0x5d9dcd[_0xf70f('0x2d')]);if(_0x5d9dcd['name']){delete _0x5d9dcd[_0xf70f('0x2e')];}_0x3e62cc[_0xf70f('0x22')](_0x43d1f5)[_0xf70f('0x2f')](_0x5d9dcd);};}exports[_0xf70f('0x30')]=function(_0x20e8fd,_0xb7eaa2){var _0x49732d={},_0x5b5e3c={},_0x424925={'count':0x0,'rows':[]};var _0x447b45=_['map'](db[_0xf70f('0x31')]['rawAttributes'],function(_0x5cfe54){return{'name':_0x5cfe54[_0xf70f('0x32')],'type':_0x5cfe54[_0xf70f('0x33')][_0xf70f('0x34')]};});_0x5b5e3c[_0xf70f('0x35')]=_[_0xf70f('0x36')](_0x447b45,_0xf70f('0x2e'));_0x5b5e3c[_0xf70f('0x37')]=_['keys'](_0x20e8fd['query']);_0x5b5e3c['filters']=_[_0xf70f('0x38')](_0x5b5e3c[_0xf70f('0x35')],_0x5b5e3c['query']);_0x49732d[_0xf70f('0x39')]=_['intersection'](_0x5b5e3c[_0xf70f('0x35')],qs[_0xf70f('0x3a')](_0x20e8fd['query'][_0xf70f('0x3a')]));_0x49732d[_0xf70f('0x39')]=_0x49732d[_0xf70f('0x39')][_0xf70f('0x3b')]?_0x49732d[_0xf70f('0x39')]:_0x5b5e3c[_0xf70f('0x35')];if(!_0x20e8fd[_0xf70f('0x37')][_0xf70f('0x3c')](_0xf70f('0x3d'))){_0x49732d['limit']=qs['limit'](_0x20e8fd[_0xf70f('0x37')]['limit']);_0x49732d[_0xf70f('0x24')]=qs[_0xf70f('0x24')](_0x20e8fd['query'][_0xf70f('0x24')]);}_0x49732d['order']=qs[_0xf70f('0x3e')](_0x20e8fd['query']['sort']);_0x49732d['where']=qs[_0xf70f('0x3f')](_[_0xf70f('0x40')](_0x20e8fd[_0xf70f('0x37')],_0x5b5e3c[_0xf70f('0x3f')]),_0x447b45);if(_0x20e8fd[_0xf70f('0x37')][_0xf70f('0x41')]){_0x49732d[_0xf70f('0x42')]=_['merge'](_0x49732d[_0xf70f('0x42')],{'$or':_[_0xf70f('0x36')](_0x447b45,function(_0x16f3bc){if(_0x16f3bc[_0xf70f('0x33')]!==_0xf70f('0x43')){var _0x330a54={};_0x330a54[_0x16f3bc['name']]={'$like':'%'+_0x20e8fd[_0xf70f('0x37')][_0xf70f('0x41')]+'%'};return _0x330a54;}})});}_0x49732d=_['merge']({},_0x49732d,_0x20e8fd['options']);var _0x36f549={'where':_0x49732d['where']};return db['ChatInternalMessage'][_0xf70f('0x26')](_0x36f549)[_0xf70f('0x2a')](function(_0x37ec2c){_0x424925['count']=_0x37ec2c;if(_0x20e8fd[_0xf70f('0x37')][_0xf70f('0x44')]){_0x49732d[_0xf70f('0x45')]=[{'all':!![]}];}return db[_0xf70f('0x31')][_0xf70f('0x46')](_0x49732d);})[_0xf70f('0x2a')](function(_0xbff51e){_0x424925[_0xf70f('0x47')]=_0xbff51e;return _0x424925;})['then'](respondWithFilteredResult(_0xb7eaa2,_0x49732d))['catch'](handleError(_0xb7eaa2,null));};exports[_0xf70f('0x48')]=function(_0x1cb4ce,_0x4088d9){var _0x73c4f6={'raw':!![],'where':{'id':_0x1cb4ce[_0xf70f('0x49')]['id']}},_0x597210={};_0x597210['model']=_[_0xf70f('0x4a')](db[_0xf70f('0x31')][_0xf70f('0x4b')]);_0x597210[_0xf70f('0x37')]=_[_0xf70f('0x4a')](_0x1cb4ce['query']);_0x597210[_0xf70f('0x3f')]=_[_0xf70f('0x38')](_0x597210[_0xf70f('0x35')],_0x597210['query']);_0x73c4f6[_0xf70f('0x39')]=_['intersection'](_0x597210[_0xf70f('0x35')],qs[_0xf70f('0x3a')](_0x1cb4ce[_0xf70f('0x37')][_0xf70f('0x3a')]));_0x73c4f6[_0xf70f('0x39')]=_0x73c4f6[_0xf70f('0x39')][_0xf70f('0x3b')]?_0x73c4f6[_0xf70f('0x39')]:_0x597210[_0xf70f('0x35')];if(_0x1cb4ce['query'][_0xf70f('0x44')]){_0x73c4f6[_0xf70f('0x45')]=[{'all':!![]}];}_0x73c4f6=_[_0xf70f('0x4c')]({},_0x73c4f6,_0x1cb4ce['options']);return db[_0xf70f('0x31')][_0xf70f('0x4d')](_0x73c4f6)[_0xf70f('0x2a')](handleEntityNotFound(_0x4088d9,null))[_0xf70f('0x2a')](respondWithResult(_0x4088d9,null))[_0xf70f('0x4e')](handleError(_0x4088d9,null));};exports[_0xf70f('0x4f')]=function(_0x3e5fce,_0x1873eb){return db[_0xf70f('0x31')][_0xf70f('0x4f')](_0x3e5fce[_0xf70f('0x50')],{})[_0xf70f('0x2a')](respondWithResult(_0x1873eb,0xc9))[_0xf70f('0x4e')](handleError(_0x1873eb,null));};exports[_0xf70f('0x29')]=function(_0x36e5bd,_0xe02d6b){if(_0x36e5bd[_0xf70f('0x50')]['id']){delete _0x36e5bd[_0xf70f('0x50')]['id'];}return db[_0xf70f('0x31')][_0xf70f('0x4d')]({'where':{'id':_0x36e5bd[_0xf70f('0x49')]['id']}})['then'](handleEntityNotFound(_0xe02d6b,null))['then'](saveUpdates(_0x36e5bd[_0xf70f('0x50')],null))[_0xf70f('0x2a')](respondWithResult(_0xe02d6b,null))[_0xf70f('0x4e')](handleError(_0xe02d6b,null));};exports['destroy']=function(_0xa792fe,_0x497144){return db[_0xf70f('0x31')][_0xf70f('0x4d')]({'where':{'id':_0xa792fe[_0xf70f('0x49')]['id']}})[_0xf70f('0x2a')](handleEntityNotFound(_0x497144,null))[_0xf70f('0x2a')](removeEntity(_0x497144,null))[_0xf70f('0x4e')](handleError(_0x497144,null));};exports['describe']=function(_0x2f8f2e,_0x4cc7c7){return db[_0xf70f('0x31')][_0xf70f('0x51')]()[_0xf70f('0x2a')](respondWithResult(_0x4cc7c7,null))[_0xf70f('0x4e')](handleError(_0x4cc7c7,null));};function wrapUser(_0x530998){return function(_0x58cdc5){var _0x4d167e=_0x530998[_0xf70f('0x52')]({'plain':!![]});_0x4d167e['messages']=[];if(_0x58cdc5){_0x4d167e[_0xf70f('0x53')]=_0x58cdc5[_0xf70f('0x54')];_0x4d167e[_0xf70f('0x55')]=_0x58cdc5;}else{_0x4d167e['lastMessageAt']=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4d167e[_0xf70f('0x55')]={};}return _0x4d167e;};}exports[_0xf70f('0x56')]=function(_0x4fc3d,_0x7e5976,_0x5bdac3){var _0x11cd5f=[];return db[_0xf70f('0x57')][_0xf70f('0x46')]({'where':{'role':[_0xf70f('0x58'),_0xf70f('0x59'),'user']},'attributes':['id',_0xf70f('0x5a'),_0xf70f('0x2e'),'role','userpic',_0xf70f('0x5b'),_0xf70f('0x5c'),_0xf70f('0x5d'),_0xf70f('0x5e'),_0xf70f('0x5f')],'order':qs['sort']('-online'),'include':[{'model':db[_0xf70f('0x60')],'as':_0xf70f('0x61'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0xf70f('0x2a')](function(_0x3a582b){if(_0x3a582b){var _0x4f02ba=_0x4fc3d[_0xf70f('0x62')]['get']({'plain':!![]});if(!_0x4f02ba)throw new Error(_0xf70f('0x63'));if(_0x4f02ba[_0xf70f('0x64')]===_0xf70f('0x62')){return db[_0xf70f('0x65')]['find']({'where':{'name':'Agents','userProfileId':_0x4f02ba['userProfileId']},'raw':!![]})[_0xf70f('0x2a')](function(_0x316e5c){if(_0x316e5c){if(_0x316e5c[_0xf70f('0x66')]===0x0){return db['UserProfileResource'][_0xf70f('0x46')]({'where':{'sectionId':_0x316e5c['id']},'raw':!![]})[_0xf70f('0x2a')](function(_0x4bd7a7){var _0x279d93=[];if(_['isEmpty'](_0x4bd7a7)){_0x279d93=_['filter'](_0x3a582b,function(_0x19559a){if(_0x19559a[_0xf70f('0x64')]!==_0xf70f('0x58')){return _0x19559a;}});return _0x279d93;}else{for(var _0x2a6729=0x0;_0x2a6729<_0x3a582b[_0xf70f('0x3b')];_0x2a6729++){var _0x5c2683=_0x3a582b[_0x2a6729];if(_0x5c2683[_0xf70f('0x64')]===_0xf70f('0x58')){var _0x4ab6af=_[_0xf70f('0x4d')](_0x4bd7a7,function(_0x55ef53){return _0x55ef53[_0xf70f('0x67')]===_0x5c2683['id'];});if(_0x4ab6af)_0x279d93['push'](_0x5c2683);}else{_0x279d93[_0xf70f('0x68')](_0x5c2683);}}return _0x279d93;}});}else{return _0x3a582b;}}else{var _0x1b23cb=_['filter'](_0x3a582b,function(_0x27aa59){if(_0x27aa59[_0xf70f('0x64')]!==_0xf70f('0x58')){return _0x27aa59;}});return _0x1b23cb;}});}else{return _0x3a582b;}}})[_0xf70f('0x2a')](function(_0x40e4bf){var _0xea8cc1=[];if(_0x40e4bf){_0x11cd5f=_0x40e4bf;for(var _0x4af2b0=0x0;_0x4af2b0<_0x40e4bf[_0xf70f('0x3b')];_0x4af2b0+=0x1){_0x11cd5f[_0x4af2b0][_0xf70f('0x69')]=[];_0xea8cc1[_0xf70f('0x68')](db[_0xf70f('0x31')][_0xf70f('0x4d')]({'where':{'FromId':[_0x4fc3d[_0xf70f('0x62')]['id'],_0x40e4bf[_0x4af2b0]['id']],'ToId':[_0x4fc3d['user']['id'],_0x40e4bf[_0x4af2b0]['id']],'ChatGroupId':null},'attributes':['id',_0xf70f('0x54'),'FromId',_0xf70f('0x6a'),_0xf70f('0x6b'),_0xf70f('0x50')],'order':qs['sort'](_0xf70f('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf70f('0x2a')](wrapUser(_0x40e4bf[_0x4af2b0])));}return BPromise['all'](_0xea8cc1);}return[];})[_0xf70f('0x2a')](function(_0x523d0d){return{'rows':_0x523d0d,'count':_0x523d0d[_0xf70f('0x3b')]};})[_0xf70f('0x2a')](respondWithResult(_0x7e5976,null))[_0xf70f('0x4e')](handleError(_0x7e5976,null));};
\ No newline at end of file
+var _0xd2ce=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','end','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','sendStatus','error','stack','name','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','length','find','create','update','body','destroy','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','admin','role','showWebBar','-online'];(function(_0x4bbada,_0x11a75c){var _0x4b0cfa=function(_0x56a719){while(--_0x56a719){_0x4bbada['push'](_0x4bbada['shift']());}};_0x4b0cfa(++_0x11a75c);}(_0xd2ce,0x14a));var _0xed2c=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xd2ce[_0x42245d];return _0x4b211a;};'use strict';var emlformat=require(_0xed2c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed2c('0x1'));var jsonpatch=require(_0xed2c('0x2'));var rp=require(_0xed2c('0x3'));var moment=require(_0xed2c('0x4'));var BPromise=require(_0xed2c('0x5'));var Mustache=require(_0xed2c('0x6'));var util=require('util');var path=require(_0xed2c('0x7'));var sox=require('sox');var csv=require(_0xed2c('0x8'));var ejs=require(_0xed2c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed2c('0xa'));var squel=require(_0xed2c('0xb'));var crypto=require(_0xed2c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xed2c('0xd'));var toCsv=require(_0xed2c('0x8'));var querystring=require(_0xed2c('0xe'));var Papa=require(_0xed2c('0xf'));var Redis=require(_0xed2c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xed2c('0x11'));var as=require(_0xed2c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed2c('0x13'))(_0xed2c('0x14'));var utils=require(_0xed2c('0x15'));var config=require(_0xed2c('0x16'));var licenseUtil=require(_0xed2c('0x17'));var db=require(_0xed2c('0x18'))['db'];config['redis']=_[_0xed2c('0x19')](config[_0xed2c('0x1a')],{'host':_0xed2c('0x1b'),'port':0x18eb});var socket=require(_0xed2c('0x1c'))(new Redis(config[_0xed2c('0x1a')]));require(_0xed2c('0x1d'))[_0xed2c('0x1e')](socket);function respondWithStatusCode(_0x45b7cb,_0x522056){_0x522056=_0x522056||0xcc;return function(_0x320323){if(_0x320323){return _0x45b7cb['sendStatus'](_0x522056);}return _0x45b7cb['status'](_0x522056)[_0xed2c('0x1f')]();};}function respondWithResult(_0x184aa6,_0x12fc1e){_0x12fc1e=_0x12fc1e||0xc8;return function(_0x514c4b){if(_0x514c4b){return _0x184aa6[_0xed2c('0x20')](_0x12fc1e)[_0xed2c('0x21')](_0x514c4b);}};}function respondWithFilteredResult(_0x454728,_0x2ff6dc){return function(_0x122a73){if(_0x122a73){var _0xbe10c2=typeof _0x2ff6dc['offset']==='undefined'&&typeof _0x2ff6dc['limit']===_0xed2c('0x22');var _0x1abe1c=_0x122a73[_0xed2c('0x23')];var _0x12b990=_0xbe10c2?0x0:_0x2ff6dc[_0xed2c('0x24')];var _0x16779e=_0xbe10c2?_0x122a73[_0xed2c('0x23')]:_0x2ff6dc[_0xed2c('0x24')]+_0x2ff6dc[_0xed2c('0x25')];var _0x12504b;if(_0x16779e>=_0x1abe1c){_0x16779e=_0x1abe1c;_0x12504b=0xc8;}else{_0x12504b=0xce;}_0x454728['status'](_0x12504b);return _0x454728[_0xed2c('0x26')](_0xed2c('0x27'),_0x12b990+'-'+_0x16779e+'/'+_0x1abe1c)[_0xed2c('0x21')](_0x122a73);}return null;};}function patchUpdates(_0x26bde3){return function(_0x57eb11){try{jsonpatch['apply'](_0x57eb11,_0x26bde3,!![]);}catch(_0x5717bf){return BPromise[_0xed2c('0x28')](_0x5717bf);}return _0x57eb11[_0xed2c('0x29')]();};}function saveUpdates(_0x2cc46f,_0x79dc6e){return function(_0x229587){if(_0x229587){return _0x229587['update'](_0x2cc46f)[_0xed2c('0x2a')](function(_0x8c77a){return _0x8c77a;});}return null;};}function removeEntity(_0x1ec8f5,_0x2aa194){return function(_0x4b2e4f){if(_0x4b2e4f){return _0x4b2e4f['destroy']()[_0xed2c('0x2a')](function(){_0x1ec8f5[_0xed2c('0x20')](0xcc)[_0xed2c('0x1f')]();});}};}function handleEntityNotFound(_0x28449e,_0x19dc62){return function(_0x1230cc){if(!_0x1230cc){_0x28449e[_0xed2c('0x2b')](0x194);}return _0x1230cc;};}function handleError(_0x1f71fd,_0x17b2e0){_0x17b2e0=_0x17b2e0||0x1f4;return function(_0x4178c9){logger[_0xed2c('0x2c')](_0x4178c9[_0xed2c('0x2d')]);if(_0x4178c9[_0xed2c('0x2e')]){delete _0x4178c9['name'];}_0x1f71fd[_0xed2c('0x20')](_0x17b2e0)['send'](_0x4178c9);};}exports['index']=function(_0x41a434,_0x4534f7){var _0x1d3e58={},_0x2b02ea={},_0xb0eca7={'count':0x0,'rows':[]};var _0x20650e=_[_0xed2c('0x2f')](db[_0xed2c('0x30')][_0xed2c('0x31')],function(_0x2005ce){return{'name':_0x2005ce[_0xed2c('0x32')],'type':_0x2005ce[_0xed2c('0x33')][_0xed2c('0x34')]};});_0x2b02ea['model']=_[_0xed2c('0x2f')](_0x20650e,_0xed2c('0x2e'));_0x2b02ea[_0xed2c('0x35')]=_[_0xed2c('0x36')](_0x41a434[_0xed2c('0x35')]);_0x2b02ea['filters']=_['intersection'](_0x2b02ea[_0xed2c('0x37')],_0x2b02ea[_0xed2c('0x35')]);_0x1d3e58[_0xed2c('0x38')]=_[_0xed2c('0x39')](_0x2b02ea[_0xed2c('0x37')],qs[_0xed2c('0x3a')](_0x41a434['query'][_0xed2c('0x3a')]));_0x1d3e58[_0xed2c('0x38')]=_0x1d3e58[_0xed2c('0x38')]['length']?_0x1d3e58[_0xed2c('0x38')]:_0x2b02ea[_0xed2c('0x37')];if(!_0x41a434[_0xed2c('0x35')][_0xed2c('0x3b')](_0xed2c('0x3c'))){_0x1d3e58[_0xed2c('0x25')]=qs['limit'](_0x41a434[_0xed2c('0x35')][_0xed2c('0x25')]);_0x1d3e58['offset']=qs[_0xed2c('0x24')](_0x41a434[_0xed2c('0x35')][_0xed2c('0x24')]);}_0x1d3e58['order']=qs['sort'](_0x41a434['query'][_0xed2c('0x3d')]);_0x1d3e58[_0xed2c('0x3e')]=qs[_0xed2c('0x3f')](_[_0xed2c('0x40')](_0x41a434[_0xed2c('0x35')],_0x2b02ea[_0xed2c('0x3f')]),_0x20650e);if(_0x41a434[_0xed2c('0x35')][_0xed2c('0x41')]){_0x1d3e58[_0xed2c('0x3e')]=_[_0xed2c('0x42')](_0x1d3e58[_0xed2c('0x3e')],{'$or':_[_0xed2c('0x2f')](_0x20650e,function(_0x5caa2c){if(_0x5caa2c['type']!==_0xed2c('0x43')){var _0xf1a8b7={};_0xf1a8b7[_0x5caa2c['name']]={'$like':'%'+_0x41a434[_0xed2c('0x35')]['filter']+'%'};return _0xf1a8b7;}})});}_0x1d3e58=_[_0xed2c('0x42')]({},_0x1d3e58,_0x41a434[_0xed2c('0x44')]);var _0x30a1ae={'where':_0x1d3e58[_0xed2c('0x3e')]};return db[_0xed2c('0x30')][_0xed2c('0x23')](_0x30a1ae)[_0xed2c('0x2a')](function(_0x56fe58){_0xb0eca7[_0xed2c('0x23')]=_0x56fe58;if(_0x41a434['query'][_0xed2c('0x45')]){_0x1d3e58[_0xed2c('0x46')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xed2c('0x47')](_0x1d3e58);})[_0xed2c('0x2a')](function(_0x573c58){_0xb0eca7['rows']=_0x573c58;return _0xb0eca7;})[_0xed2c('0x2a')](respondWithFilteredResult(_0x4534f7,_0x1d3e58))[_0xed2c('0x48')](handleError(_0x4534f7,null));};exports[_0xed2c('0x49')]=function(_0x55504e,_0x8651c2){var _0x2f6a63={'raw':!![],'where':{'id':_0x55504e['params']['id']}},_0x27f98b={};_0x27f98b[_0xed2c('0x37')]=_[_0xed2c('0x36')](db[_0xed2c('0x30')][_0xed2c('0x31')]);_0x27f98b[_0xed2c('0x35')]=_[_0xed2c('0x36')](_0x55504e['query']);_0x27f98b[_0xed2c('0x3f')]=_[_0xed2c('0x39')](_0x27f98b[_0xed2c('0x37')],_0x27f98b[_0xed2c('0x35')]);_0x2f6a63[_0xed2c('0x38')]=_[_0xed2c('0x39')](_0x27f98b[_0xed2c('0x37')],qs[_0xed2c('0x3a')](_0x55504e[_0xed2c('0x35')][_0xed2c('0x3a')]));_0x2f6a63[_0xed2c('0x38')]=_0x2f6a63[_0xed2c('0x38')][_0xed2c('0x4a')]?_0x2f6a63[_0xed2c('0x38')]:_0x27f98b[_0xed2c('0x37')];if(_0x55504e[_0xed2c('0x35')]['includeAll']){_0x2f6a63[_0xed2c('0x46')]=[{'all':!![]}];}_0x2f6a63=_[_0xed2c('0x42')]({},_0x2f6a63,_0x55504e[_0xed2c('0x44')]);return db[_0xed2c('0x30')][_0xed2c('0x4b')](_0x2f6a63)['then'](handleEntityNotFound(_0x8651c2,null))['then'](respondWithResult(_0x8651c2,null))[_0xed2c('0x48')](handleError(_0x8651c2,null));};exports['create']=function(_0x3d7862,_0x209176){return db[_0xed2c('0x30')][_0xed2c('0x4c')](_0x3d7862['body'],{})['then'](respondWithResult(_0x209176,0xc9))['catch'](handleError(_0x209176,null));};exports[_0xed2c('0x4d')]=function(_0x3d69da,_0x1a345e){if(_0x3d69da[_0xed2c('0x4e')]['id']){delete _0x3d69da[_0xed2c('0x4e')]['id'];}return db[_0xed2c('0x30')][_0xed2c('0x4b')]({'where':{'id':_0x3d69da['params']['id']}})[_0xed2c('0x2a')](handleEntityNotFound(_0x1a345e,null))[_0xed2c('0x2a')](saveUpdates(_0x3d69da['body'],null))[_0xed2c('0x2a')](respondWithResult(_0x1a345e,null))[_0xed2c('0x48')](handleError(_0x1a345e,null));};exports[_0xed2c('0x4f')]=function(_0x44b423,_0x3fea9f){return db[_0xed2c('0x30')][_0xed2c('0x4b')]({'where':{'id':_0x44b423['params']['id']}})[_0xed2c('0x2a')](handleEntityNotFound(_0x3fea9f,null))[_0xed2c('0x2a')](removeEntity(_0x3fea9f,null))[_0xed2c('0x48')](handleError(_0x3fea9f,null));};exports[_0xed2c('0x50')]=function(_0x4bc082,_0x2e1ec8){return db[_0xed2c('0x30')]['describe']()[_0xed2c('0x2a')](respondWithResult(_0x2e1ec8,null))[_0xed2c('0x48')](handleError(_0x2e1ec8,null));};function wrapUser(_0x2e48e4){return function(_0x16fc12){var _0x1726dd=_0x2e48e4[_0xed2c('0x51')]({'plain':!![]});_0x1726dd[_0xed2c('0x52')]=[];if(_0x16fc12){_0x1726dd[_0xed2c('0x53')]=_0x16fc12[_0xed2c('0x54')];_0x1726dd['lastMessage']=_0x16fc12;}else{_0x1726dd[_0xed2c('0x53')]=moment(0x0)[_0xed2c('0x55')](_0xed2c('0x56'));_0x1726dd[_0xed2c('0x57')]={};}return _0x1726dd;};}exports['getUsers']=function(_0x4dd2ce,_0x39ce2b,_0x2d558b){var _0x535797=[];return db[_0xed2c('0x58')][_0xed2c('0x47')]({'where':{'role':[_0xed2c('0x59'),_0xed2c('0x5a'),'user']},'attributes':['id','fullname','name',_0xed2c('0x5b'),'userpic','internal','online','lastLoginAt','allowmessenger',_0xed2c('0x5c')],'order':qs['sort'](_0xed2c('0x5d')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id','name',_0xed2c('0x33')],'through':{'attributes':[]}}]})[_0xed2c('0x2a')](function(_0x364f07){if(_0x364f07){var _0x1f6a9e=_0x4dd2ce[_0xed2c('0x5e')]['get']({'plain':!![]});if(!_0x1f6a9e)throw new Error(_0xed2c('0x5f'));if(_0x1f6a9e[_0xed2c('0x5b')]===_0xed2c('0x5e')){return db[_0xed2c('0x60')][_0xed2c('0x4b')]({'where':{'name':_0xed2c('0x61'),'userProfileId':_0x1f6a9e['userProfileId']},'raw':!![]})[_0xed2c('0x2a')](function(_0x5ae8bc){if(_0x5ae8bc){if(_0x5ae8bc[_0xed2c('0x62')]===0x0){return db[_0xed2c('0x63')][_0xed2c('0x47')]({'where':{'sectionId':_0x5ae8bc['id']},'raw':!![]})[_0xed2c('0x2a')](function(_0x591c66){var _0x19c49c=[];if(_['isEmpty'](_0x591c66)){_0x19c49c=_['filter'](_0x364f07,function(_0x5439ac){if(_0x5439ac['role']!==_0xed2c('0x59')){return _0x5439ac;}});return _0x19c49c;}else{for(var _0x11bdb2=0x0;_0x11bdb2<_0x364f07['length'];_0x11bdb2++){var _0x51e5e2=_0x364f07[_0x11bdb2];if(_0x51e5e2[_0xed2c('0x5b')]==='agent'){var _0x36f59d=_[_0xed2c('0x4b')](_0x591c66,function(_0x1b32b8){return _0x1b32b8[_0xed2c('0x64')]===_0x51e5e2['id'];});if(_0x36f59d)_0x19c49c['push'](_0x51e5e2);}else{_0x19c49c[_0xed2c('0x65')](_0x51e5e2);}}return _0x19c49c;}});}else{return _0x364f07;}}else{var _0x1aaf84=_[_0xed2c('0x41')](_0x364f07,function(_0x5f1c88){if(_0x5f1c88[_0xed2c('0x5b')]!==_0xed2c('0x59')){return _0x5f1c88;}});return _0x1aaf84;}});}else{return _0x364f07;}}})[_0xed2c('0x2a')](function(_0x2f0040){var _0x25f4f9=[];if(_0x2f0040){_0x535797=_0x2f0040;for(var _0x124621=0x0;_0x124621<_0x2f0040[_0xed2c('0x4a')];_0x124621+=0x1){_0x535797[_0x124621][_0xed2c('0x52')]=[];_0x25f4f9[_0xed2c('0x65')](db[_0xed2c('0x30')][_0xed2c('0x4b')]({'where':{'FromId':[_0x4dd2ce['user']['id'],_0x2f0040[_0x124621]['id']],'ToId':[_0x4dd2ce[_0xed2c('0x5e')]['id'],_0x2f0040[_0x124621]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xed2c('0x66'),_0xed2c('0x67'),_0xed2c('0x68'),'body'],'order':qs[_0xed2c('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xed2c('0x2a')](wrapUser(_0x2f0040[_0x124621])));}return BPromise[_0xed2c('0x69')](_0x25f4f9);}return[];})[_0xed2c('0x2a')](function(_0x273149){return{'rows':_0x273149,'count':_0x273149[_0xed2c('0x4a')]};})[_0xed2c('0x2a')](respondWithResult(_0x39ce2b,null))[_0xed2c('0x48')](handleError(_0x39ce2b,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index bb2c476..2163849 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 _0x6043=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update'];(function(_0x19006e,_0x554f02){var _0x2d8060=function(_0x30447d){while(--_0x30447d){_0x19006e['push'](_0x19006e['shift']());}};_0x2d8060(++_0x554f02);}(_0x6043,0x185));var _0x3604=function(_0x73f87f,_0x2eb5c5){_0x73f87f=_0x73f87f-0x0;var _0x11899b=_0x6043[_0x73f87f];return _0x11899b;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x3604('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3604('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3604('0x2'),'afterDestroy':_0x3604('0x3')};function emitEvent(_0x5364a8){return function(_0x506e20,_0x6735da,_0x46d3b3){ChatInternalMessageEvents[_0x3604('0x4')](_0x5364a8+':'+_0x506e20['id'],_0x506e20);ChatInternalMessageEvents[_0x3604('0x4')](_0x5364a8,_0x506e20);_0x46d3b3(null);};}for(var e in events){if(events[_0x3604('0x5')](e)){var event=events[e];ChatInternalMessage[_0x3604('0x6')](e,emitEvent(event));}}module[_0x3604('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xa0a3=['hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','save','update','remove','emit'];(function(_0x341569,_0x1edec3){var _0x2cb5c7=function(_0x50dafc){while(--_0x50dafc){_0x341569['push'](_0x341569['shift']());}};_0x2cb5c7(++_0x1edec3);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x98fd67,_0x4abe55){_0x98fd67=_0x98fd67-0x0;var _0x15b8c3=_0xa0a3[_0x98fd67];return _0x15b8c3;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x3a0a('0x0'))['db'][_0x3a0a('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3a0a('0x2'),'afterUpdate':_0x3a0a('0x3'),'afterDestroy':_0x3a0a('0x4')};function emitEvent(_0x438f82){return function(_0x4f9090,_0x7f2ad7,_0xded829){ChatInternalMessageEvents[_0x3a0a('0x5')](_0x438f82+':'+_0x4f9090['id'],_0x4f9090);ChatInternalMessageEvents[_0x3a0a('0x5')](_0x438f82,_0x4f9090);_0xded829(null);};}for(var e in events){if(events[_0x3a0a('0x6')](e)){var event=events[e];ChatInternalMessage[_0x3a0a('0x7')](e,emitEvent(event));}}module[_0x3a0a('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 53eab5f..39fc00a 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 _0x719f=['chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api','bluebird','path','./chatInternalMessage.attributes','exports','define'];(function(_0x14081a,_0x36ee7c){var _0x1313cf=function(_0x2fae2e){while(--_0x2fae2e){_0x14081a['push'](_0x14081a['shift']());}};_0x1313cf(++_0x36ee7c);}(_0x719f,0x70));var _0xf719=function(_0x512c83,_0x42a67a){_0x512c83=_0x512c83-0x0;var _0x1f7f25=_0x719f[_0x512c83];return _0x1f7f25;};'use strict';var _=require(_0xf719('0x0'));var util=require(_0xf719('0x1'));var logger=require(_0xf719('0x2'))(_0xf719('0x3'));var moment=require('moment');var BPromise=require(_0xf719('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf719('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf719('0x6'));module[_0xf719('0x7')]=function(_0x4df7ac,_0x5e3ad0){return _0x4df7ac[_0xf719('0x8')]('ChatInternalMessage',attributes,{'tableName':_0xf719('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf719('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x89e0=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2af6f0,_0x1e50a3){var _0x4de96f=function(_0x2ba1a2){while(--_0x2ba1a2){_0x2af6f0['push'](_0x2af6f0['shift']());}};_0x4de96f(++_0x1e50a3);}(_0x89e0,0x119));var _0x089e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x89e0[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x089e('0x0'));var util=require(_0x089e('0x1'));var logger=require(_0x089e('0x2'))('api');var moment=require(_0x089e('0x3'));var BPromise=require(_0x089e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x089e('0x5'));var rimraf=require(_0x089e('0x6'));var config=require(_0x089e('0x7'));var attributes=require(_0x089e('0x8'));module['exports']=function(_0x2f2a65,_0x1c94c4){return _0x2f2a65['define'](_0x089e('0x9'),attributes,{'tableName':_0x089e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x089e('0xb'),'collate':_0x089e('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index a2a626d..b2c612f 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 _0xeb6a=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x482c19,_0x456e39){var _0x57dc03=function(_0x23ebed){while(--_0x23ebed){_0x482c19['push'](_0x482c19['shift']());}};_0x57dc03(++_0x456e39);}(_0xeb6a,0x1f4));var _0xaeb6=function(_0x52decf,_0x1bd6bc){_0x52decf=_0x52decf-0x0;var _0x43e3cd=_0xeb6a[_0x52decf];return _0x43e3cd;};'use strict';var _=require(_0xaeb6('0x0'));var util=require(_0xaeb6('0x1'));var moment=require(_0xaeb6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaeb6('0x3'));var db=require(_0xaeb6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaeb6('0x5'))(_0xaeb6('0x6'));var config=require('../../config/environment');var jayson=require(_0xaeb6('0x7'));var client=jayson[_0xaeb6('0x8')][_0xaeb6('0x9')]({'port':0x232a});config[_0xaeb6('0xa')]=_[_0xaeb6('0xb')](config[_0xaeb6('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xaeb6('0xc'))(new Redis(config['redis']));require(_0xaeb6('0xd'))['register'](socket);function respondWithRpcPromise(_0x315ec7,_0x49f280,_0x5d996d){return new BPromise(function(_0x150386,_0x3048bf){return client[_0xaeb6('0xe')](_0x315ec7,_0x5d996d)[_0xaeb6('0xf')](function(_0x5efe69){logger[_0xaeb6('0x10')](_0xaeb6('0x11'),_0x49f280,_0xaeb6('0x12'));logger[_0xaeb6('0x13')](_0xaeb6('0x14'),_0x49f280,'request\x20sent',JSON[_0xaeb6('0x15')](_0x5efe69));if(_0x5efe69['error']){if(_0x5efe69['error'][_0xaeb6('0x16')]===0x1f4){logger[_0xaeb6('0x17')](_0xaeb6('0x11'),_0x49f280,_0x5efe69[_0xaeb6('0x17')]['message']);return _0x3048bf(_0x5efe69[_0xaeb6('0x17')]['message']);}logger[_0xaeb6('0x17')](_0xaeb6('0x11'),_0x49f280,_0x5efe69['error'][_0xaeb6('0x18')]);return _0x150386(_0x5efe69[_0xaeb6('0x17')]['message']);}else{logger[_0xaeb6('0x10')](_0xaeb6('0x11'),_0x49f280,_0xaeb6('0x12'));_0x150386(_0x5efe69['result'][_0xaeb6('0x18')]);}})[_0xaeb6('0x19')](function(_0x199017){logger[_0xaeb6('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x49f280,_0x199017);_0x3048bf(_0x199017);});});}
\ No newline at end of file
+var _0x8ae5=['register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket'];(function(_0x2ee857,_0x51a024){var _0x53ea56=function(_0x5285c4){while(--_0x5285c4){_0x2ee857['push'](_0x2ee857['shift']());}};_0x53ea56(++_0x51a024);}(_0x8ae5,0x1dd));var _0x58ae=function(_0x28e4ea,_0x4856fd){_0x28e4ea=_0x28e4ea-0x0;var _0x545c63=_0x8ae5[_0x28e4ea];return _0x545c63;};'use strict';var _=require(_0x58ae('0x0'));var util=require(_0x58ae('0x1'));var moment=require(_0x58ae('0x2'));var BPromise=require('bluebird');var rs=require(_0x58ae('0x3'));var fs=require('fs');var Redis=require(_0x58ae('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x58ae('0x5'));var logger=require(_0x58ae('0x6'))(_0x58ae('0x7'));var config=require('../../config/environment');var jayson=require(_0x58ae('0x8'));var client=jayson[_0x58ae('0x9')][_0x58ae('0xa')]({'port':0x232a});config[_0x58ae('0xb')]=_[_0x58ae('0xc')](config[_0x58ae('0xb')],{'host':_0x58ae('0xd'),'port':0x18eb});var socket=require(_0x58ae('0xe'))(new Redis(config[_0x58ae('0xb')]));require(_0x58ae('0xf'))[_0x58ae('0x10')](socket);function respondWithRpcPromise(_0x5ecabb,_0x306322,_0x10e440){return new BPromise(function(_0x2d6560,_0x2a8dec){return client[_0x58ae('0x11')](_0x5ecabb,_0x10e440)[_0x58ae('0x12')](function(_0x241363){logger[_0x58ae('0x13')](_0x58ae('0x14'),_0x306322,_0x58ae('0x15'));logger[_0x58ae('0x16')](_0x58ae('0x17'),_0x306322,_0x58ae('0x15'),JSON[_0x58ae('0x18')](_0x241363));if(_0x241363[_0x58ae('0x19')]){if(_0x241363[_0x58ae('0x19')][_0x58ae('0x1a')]===0x1f4){logger['error'](_0x58ae('0x14'),_0x306322,_0x241363[_0x58ae('0x19')][_0x58ae('0x1b')]);return _0x2a8dec(_0x241363[_0x58ae('0x19')][_0x58ae('0x1b')]);}logger[_0x58ae('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x306322,_0x241363[_0x58ae('0x19')]['message']);return _0x2d6560(_0x241363[_0x58ae('0x19')][_0x58ae('0x1b')]);}else{logger[_0x58ae('0x13')](_0x58ae('0x14'),_0x306322,'request\x20sent');_0x2d6560(_0x241363['result']['message']);}})[_0x58ae('0x1c')](function(_0xb242bf){logger[_0x58ae('0x19')](_0x58ae('0x14'),_0x306322,_0xb242bf);_0x2a8dec(_0xb242bf);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 288c956..f97ea89 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 _0x9a5b=['removeListener','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x4f51ca,_0x568e79){var _0x1c0d86=function(_0x5648ae){while(--_0x5648ae){_0x4f51ca['push'](_0x4f51ca['shift']());}};_0x1c0d86(++_0x568e79);}(_0x9a5b,0x1d0));var _0xb9a5=function(_0xdd5006,_0x178b90){_0xdd5006=_0xdd5006-0x0;var _0x3aecea=_0x9a5b[_0xdd5006];return _0x3aecea;};'use strict';var ChatInternalMessageEvents=require(_0xb9a5('0x0'));var events=[_0xb9a5('0x1'),_0xb9a5('0x2'),_0xb9a5('0x3')];function createListener(_0x3206f1,_0xdd6be){return function(_0x2790f6){_0xdd6be['emit'](_0x3206f1,_0x2790f6);};}function removeListener(_0x293e22,_0x562561){return function(){ChatInternalMessageEvents[_0xb9a5('0x4')](_0x293e22,_0x562561);};}exports['register']=function(_0x3af0e1){for(var _0x3a541e=0x0,_0x3e7508=events['length'];_0x3a541e<_0x3e7508;_0x3a541e++){var _0x1c2435=events[_0x3a541e];var _0x6143ea=createListener(_0xb9a5('0x5')+_0x1c2435,_0x3af0e1);ChatInternalMessageEvents['on'](_0x1c2435,_0x6143ea);}};
\ No newline at end of file
+var _0x4472=['./chatInternalMessage.events','save','emit','removeListener','register','chatInternalMessage:'];(function(_0x12b35d,_0x5f3569){var _0x4eb62c=function(_0x564692){while(--_0x564692){_0x12b35d['push'](_0x12b35d['shift']());}};_0x4eb62c(++_0x5f3569);}(_0x4472,0x108));var _0x2447=function(_0x367dbd,_0x106eba){_0x367dbd=_0x367dbd-0x0;var _0x3ddb21=_0x4472[_0x367dbd];return _0x3ddb21;};'use strict';var ChatInternalMessageEvents=require(_0x2447('0x0'));var events=[_0x2447('0x1'),'remove','update'];function createListener(_0xc42efc,_0x55ceba){return function(_0x14bd41){_0x55ceba[_0x2447('0x2')](_0xc42efc,_0x14bd41);};}function removeListener(_0xd22153,_0x27471a){return function(){ChatInternalMessageEvents[_0x2447('0x3')](_0xd22153,_0x27471a);};}exports[_0x2447('0x4')]=function(_0x803e8f){for(var _0x310652=0x0,_0x48081a=events['length'];_0x310652<_0x48081a;_0x310652++){var _0x3d3c7d=events[_0x310652];var _0x333bf2=createListener(_0x2447('0x5')+_0x3d3c7d,_0x803e8f);ChatInternalMessageEvents['on'](_0x3d3c7d,_0x333bf2);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 4d27862..ccbab14 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 _0xe2a6=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/users','getUsers','post','put','/:id','update','delete','destroy','exports','util'];(function(_0x1ed0e1,_0x45098f){var _0x12b97f=function(_0x1e06dd){while(--_0x1e06dd){_0x1ed0e1['push'](_0x1ed0e1['shift']());}};_0x12b97f(++_0x45098f);}(_0xe2a6,0x8b));var _0x6e2a=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0xe2a6[_0x2c0dc0];return _0x4c0990;};'use strict';var multer=require('multer');var util=require(_0x6e2a('0x0'));var path=require(_0x6e2a('0x1'));var timeout=require('connect-timeout');var express=require(_0x6e2a('0x2'));var router=express[_0x6e2a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6e2a('0x4'));var interaction=require(_0x6e2a('0x5'));var config=require(_0x6e2a('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x6e2a('0x7')]('/',auth[_0x6e2a('0x8')](),controller[_0x6e2a('0x9')]);router[_0x6e2a('0x7')]('/describe',auth[_0x6e2a('0x8')](),controller[_0x6e2a('0xa')]);router[_0x6e2a('0x7')](_0x6e2a('0xb'),auth['isAuthenticated'](),controller[_0x6e2a('0xc')]);router[_0x6e2a('0x7')]('/:id',auth[_0x6e2a('0x8')](),controller['show']);router[_0x6e2a('0xd')]('/',auth[_0x6e2a('0x8')](),controller['create']);router[_0x6e2a('0xe')](_0x6e2a('0xf'),controller[_0x6e2a('0x10')]);router[_0x6e2a('0x11')](_0x6e2a('0xf'),auth[_0x6e2a('0x8')](),controller[_0x6e2a('0x12')]);module[_0x6e2a('0x13')]=router;
\ No newline at end of file
+var _0xb01f=['/users','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0xfee9fd,_0x299d5d){var _0x17cd9f=function(_0x343c22){while(--_0x343c22){_0xfee9fd['push'](_0xfee9fd['shift']());}};_0x17cd9f(++_0x299d5d);}(_0xb01f,0x184));var _0xfb01=function(_0x2e124d,_0x31ce4a){_0x2e124d=_0x2e124d-0x0;var _0x1c03d2=_0xb01f[_0x2e124d];return _0x1c03d2;};'use strict';var multer=require(_0xfb01('0x0'));var util=require(_0xfb01('0x1'));var path=require(_0xfb01('0x2'));var timeout=require(_0xfb01('0x3'));var express=require('express');var router=express[_0xfb01('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfb01('0x5'));var interaction=require(_0xfb01('0x6'));var config=require(_0xfb01('0x7'));var controller=require('./chatInternalMessage.controller');router[_0xfb01('0x8')]('/',auth[_0xfb01('0x9')](),controller[_0xfb01('0xa')]);router[_0xfb01('0x8')]('/describe',auth[_0xfb01('0x9')](),controller[_0xfb01('0xb')]);router[_0xfb01('0x8')](_0xfb01('0xc'),auth['isAuthenticated'](),controller['getUsers']);router[_0xfb01('0x8')](_0xfb01('0xd'),auth[_0xfb01('0x9')](),controller[_0xfb01('0xe')]);router[_0xfb01('0xf')]('/',auth[_0xfb01('0x9')](),controller['create']);router['put'](_0xfb01('0xd'),controller[_0xfb01('0x10')]);router[_0xfb01('0x11')](_0xfb01('0xd'),auth[_0xfb01('0x9')](),controller[_0xfb01('0x12')]);module[_0xfb01('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index cac2585..a6f37e5 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 _0x97e7=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x97e7,0x1a1));var _0x797e=function(_0x389342,_0x6658bc){_0x389342=_0x389342-0x0;var _0x5b33e5=_0x97e7[_0x389342];return _0x5b33e5;};'use strict';var Sequelize=require(_0x797e('0x0'));module[_0x797e('0x1')]={'body':{'type':Sequelize[_0x797e('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x797e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x797e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x797e('0x4')]('in',_0x797e('0x5')),'defaultValue':_0x797e('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x797e('0x6')]},'providerName':{'type':Sequelize[_0x797e('0x7')]},'providerResponse':{'type':Sequelize[_0x797e('0x2')]}};
\ No newline at end of file
+var _0xb574=['medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0xa6fd41,_0x5b44e9){var _0xa6ed48=function(_0x3ec7e9){while(--_0x3ec7e9){_0xa6fd41['push'](_0xa6fd41['shift']());}};_0xa6ed48(++_0x5b44e9);}(_0xb574,0x106));var _0x4b57=function(_0x220dba,_0x26ab28){_0x220dba=_0x220dba-0x0;var _0x1abb8b=_0xb574[_0x220dba];return _0x1abb8b;};'use strict';var Sequelize=require(_0x4b57('0x0'));module[_0x4b57('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4b57('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4b57('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4b57('0x4')]('in',_0x4b57('0x5')),'defaultValue':_0x4b57('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4b57('0x6')]},'providerName':{'type':Sequelize[_0x4b57('0x7')]},'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 e68de63..efe8c76 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 _0x216b=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','ChatMessage','findAll','rows','show','params','keys','length','includeAll','options','find','create','body','describe','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','internal','motionChannel','channel','event','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','email','SIP/%s','reject','EventManager','rejectmessage','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatMessage.socket','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','end','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes'];(function(_0x568eef,_0x3494a2){var _0x549955=function(_0x8caa2f){while(--_0x8caa2f){_0x568eef['push'](_0x568eef['shift']());}};_0x549955(++_0x3494a2);}(_0x216b,0x1c8));var _0xb216=function(_0x113302,_0x50f3dd){_0x113302=_0x113302-0x0;var _0xa6343=_0x216b[_0x113302];return _0xa6343;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb216('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb216('0x1'));var rp=require('request-promise');var moment=require(_0xb216('0x2'));var BPromise=require(_0xb216('0x3'));var Mustache=require(_0xb216('0x4'));var util=require(_0xb216('0x5'));var path=require(_0xb216('0x6'));var sox=require(_0xb216('0x7'));var csv=require(_0xb216('0x8'));var ejs=require(_0xb216('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb216('0xa'));var squel=require(_0xb216('0xb'));var crypto=require(_0xb216('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb216('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb216('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb216('0xe'));var hardwareService=require(_0xb216('0xf'));var logger=require(_0xb216('0x10'))(_0xb216('0x11'));var utils=require('../../config/utils');var config=require(_0xb216('0x12'));var licenseUtil=require(_0xb216('0x13'));var db=require(_0xb216('0x14'))['db'];config[_0xb216('0x15')]=_[_0xb216('0x16')](config[_0xb216('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb216('0x15')]));require(_0xb216('0x17'))[_0xb216('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb216('0x19')][_0xb216('0x1a')]({'port':0x232c});var client9002=jayson[_0xb216('0x19')][_0xb216('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x8ea087,_0x51851b,_0x2fcdd6,_0xdd773b){return new BPromise(function(_0x106ccd,_0x3a6618){var _0x2fa920=_0xdd773b||client;return _0x2fa920[_0xb216('0x1b')](_0x8ea087,_0x2fcdd6)[_0xb216('0x1c')](function(_0x1198c3){logger[_0xb216('0x1d')](_0xb216('0x1e'),_0x51851b,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x51851b,'request\x20sent',JSON[_0xb216('0x1f')](_0x1198c3));if(_0x1198c3[_0xb216('0x20')]){if(_0x1198c3[_0xb216('0x20')][_0xb216('0x21')]===0x1f4){logger[_0xb216('0x20')](_0xb216('0x1e'),_0x51851b,_0x1198c3[_0xb216('0x20')][_0xb216('0x22')]);return _0x3a6618(_0x1198c3[_0xb216('0x20')][_0xb216('0x22')]);}logger[_0xb216('0x20')]('ChatMessage,\x20%s,\x20%s',_0x51851b,_0x1198c3[_0xb216('0x20')][_0xb216('0x22')]);return _0x106ccd(_0x1198c3[_0xb216('0x20')][_0xb216('0x22')]);}else{logger[_0xb216('0x1d')]('ChatMessage,\x20%s,\x20%s',_0x51851b,_0xb216('0x23'));_0x106ccd(_0x1198c3[_0xb216('0x24')]['message']);}})[_0xb216('0x25')](function(_0x39c3a8){logger[_0xb216('0x20')](_0xb216('0x1e'),_0x51851b,_0x39c3a8);_0x3a6618(_0x39c3a8);});});}function respondWithStatusCode(_0x13d424,_0x2fa266){_0x2fa266=_0x2fa266||0xcc;return function(_0x459735){if(_0x459735){return _0x13d424[_0xb216('0x26')](_0x2fa266);}return _0x13d424[_0xb216('0x27')](_0x2fa266)['end']();};}function respondWithResult(_0x314988,_0x3da310){_0x3da310=_0x3da310||0xc8;return function(_0x1115a7){if(_0x1115a7){return _0x314988[_0xb216('0x27')](_0x3da310)[_0xb216('0x28')](_0x1115a7);}};}function respondWithFilteredResult(_0x4dfee0,_0x3ffa35){return function(_0x37b0ad){if(_0x37b0ad){var _0x45b89b=typeof _0x3ffa35[_0xb216('0x29')]===_0xb216('0x2a')&&typeof _0x3ffa35['limit']==='undefined';var _0x3385ad=_0x37b0ad[_0xb216('0x2b')];var _0xf31139=_0x45b89b?0x0:_0x3ffa35['offset'];var _0x5cfc62=_0x45b89b?_0x37b0ad[_0xb216('0x2b')]:_0x3ffa35['offset']+_0x3ffa35[_0xb216('0x2c')];var _0x1be53d;if(_0x5cfc62>=_0x3385ad){_0x5cfc62=_0x3385ad;_0x1be53d=0xc8;}else{_0x1be53d=0xce;}_0x4dfee0[_0xb216('0x27')](_0x1be53d);return _0x4dfee0[_0xb216('0x2d')](_0xb216('0x2e'),_0xf31139+'-'+_0x5cfc62+'/'+_0x3385ad)['json'](_0x37b0ad);}return null;};}function patchUpdates(_0x50222a){return function(_0x3e75bb){try{jsonpatch[_0xb216('0x2f')](_0x3e75bb,_0x50222a,!![]);}catch(_0x3d726b){return BPromise['reject'](_0x3d726b);}return _0x3e75bb[_0xb216('0x30')]();};}function saveUpdates(_0x8fdac8,_0x52d851){return function(_0x5a0d49){if(_0x5a0d49){return _0x5a0d49[_0xb216('0x31')](_0x8fdac8)[_0xb216('0x1c')](function(_0x56234d){return _0x56234d;});}return null;};}function removeEntity(_0x98820f,_0x3249d7){return function(_0x39f2fe){if(_0x39f2fe){return _0x39f2fe['destroy']()['then'](function(){_0x98820f['status'](0xcc)[_0xb216('0x32')]();});}};}function handleEntityNotFound(_0x3831aa,_0x5776a3){return function(_0xbf4cf8){if(!_0xbf4cf8){_0x3831aa['sendStatus'](0x194);}return _0xbf4cf8;};}function handleError(_0xe1605a,_0x3e5742){_0x3e5742=_0x3e5742||0x1f4;return function(_0x534720){logger[_0xb216('0x20')](_0x534720[_0xb216('0x33')]);if(_0x534720[_0xb216('0x34')]){delete _0x534720[_0xb216('0x34')];}_0xe1605a[_0xb216('0x27')](_0x3e5742)[_0xb216('0x35')](_0x534720);};}exports[_0xb216('0x36')]=function(_0x30fe71,_0x52c5cf){var _0x234de0={},_0x552590={},_0x3da660={'count':0x0,'rows':[]};var _0x3a9851=_[_0xb216('0x37')](db['ChatMessage'][_0xb216('0x38')],function(_0xc79639){return{'name':_0xc79639[_0xb216('0x39')],'type':_0xc79639['type'][_0xb216('0x3a')]};});_0x552590['model']=_[_0xb216('0x37')](_0x3a9851,'name');_0x552590[_0xb216('0x3b')]=_['keys'](_0x30fe71[_0xb216('0x3b')]);_0x552590[_0xb216('0x3c')]=_[_0xb216('0x3d')](_0x552590[_0xb216('0x3e')],_0x552590[_0xb216('0x3b')]);_0x234de0[_0xb216('0x3f')]=_['intersection'](_0x552590['model'],qs[_0xb216('0x40')](_0x30fe71['query'][_0xb216('0x40')]));_0x234de0[_0xb216('0x3f')]=_0x234de0[_0xb216('0x3f')]['length']?_0x234de0[_0xb216('0x3f')]:_0x552590[_0xb216('0x3e')];if(!_0x30fe71['query'][_0xb216('0x41')](_0xb216('0x42'))){_0x234de0['limit']=qs[_0xb216('0x2c')](_0x30fe71[_0xb216('0x3b')][_0xb216('0x2c')]);_0x234de0[_0xb216('0x29')]=qs[_0xb216('0x29')](_0x30fe71['query'][_0xb216('0x29')]);}_0x234de0[_0xb216('0x43')]=qs[_0xb216('0x44')](_0x30fe71[_0xb216('0x3b')]['sort']);_0x234de0[_0xb216('0x45')]=qs[_0xb216('0x3c')](_[_0xb216('0x46')](_0x30fe71[_0xb216('0x3b')],_0x552590[_0xb216('0x3c')]),_0x3a9851);if(_0x30fe71[_0xb216('0x3b')][_0xb216('0x47')]){_0x234de0['where']=_[_0xb216('0x48')](_0x234de0['where'],{'$or':_[_0xb216('0x37')](_0x3a9851,function(_0x199963){if(_0x199963[_0xb216('0x49')]!==_0xb216('0x4a')){var _0x1adf5a={};_0x1adf5a[_0x199963[_0xb216('0x34')]]={'$like':'%'+_0x30fe71[_0xb216('0x3b')][_0xb216('0x47')]+'%'};return _0x1adf5a;}})});}_0x234de0=_['merge']({},_0x234de0,_0x30fe71['options']);var _0x2be3ac={'where':_0x234de0['where']};return db['ChatMessage'][_0xb216('0x2b')](_0x2be3ac)[_0xb216('0x1c')](function(_0x1de60b){_0x3da660[_0xb216('0x2b')]=_0x1de60b;if(_0x30fe71['query']['includeAll']){_0x234de0[_0xb216('0x4b')]=[{'all':!![]}];}return db[_0xb216('0x4c')][_0xb216('0x4d')](_0x234de0);})[_0xb216('0x1c')](function(_0x2700f4){_0x3da660[_0xb216('0x4e')]=_0x2700f4;return _0x3da660;})[_0xb216('0x1c')](respondWithFilteredResult(_0x52c5cf,_0x234de0))['catch'](handleError(_0x52c5cf,null));};exports[_0xb216('0x4f')]=function(_0x47b6bc,_0x2209e3){var _0x1a01cc={'raw':!![],'where':{'id':_0x47b6bc[_0xb216('0x50')]['id']}},_0x5e8393={};_0x5e8393[_0xb216('0x3e')]=_['keys'](db[_0xb216('0x4c')][_0xb216('0x38')]);_0x5e8393['query']=_[_0xb216('0x51')](_0x47b6bc[_0xb216('0x3b')]);_0x5e8393[_0xb216('0x3c')]=_[_0xb216('0x3d')](_0x5e8393[_0xb216('0x3e')],_0x5e8393[_0xb216('0x3b')]);_0x1a01cc[_0xb216('0x3f')]=_[_0xb216('0x3d')](_0x5e8393[_0xb216('0x3e')],qs['fields'](_0x47b6bc['query'][_0xb216('0x40')]));_0x1a01cc['attributes']=_0x1a01cc[_0xb216('0x3f')][_0xb216('0x52')]?_0x1a01cc[_0xb216('0x3f')]:_0x5e8393[_0xb216('0x3e')];if(_0x47b6bc[_0xb216('0x3b')][_0xb216('0x53')]){_0x1a01cc[_0xb216('0x4b')]=[{'all':!![]}];}_0x1a01cc=_[_0xb216('0x48')]({},_0x1a01cc,_0x47b6bc[_0xb216('0x54')]);return db[_0xb216('0x4c')][_0xb216('0x55')](_0x1a01cc)[_0xb216('0x1c')](handleEntityNotFound(_0x2209e3,null))[_0xb216('0x1c')](respondWithResult(_0x2209e3,null))[_0xb216('0x25')](handleError(_0x2209e3,null));};exports[_0xb216('0x56')]=function(_0x2d2f37,_0x521323){return db['ChatMessage'][_0xb216('0x56')](_0x2d2f37[_0xb216('0x57')],{})[_0xb216('0x1c')](respondWithResult(_0x521323,0xc9))[_0xb216('0x25')](handleError(_0x521323,null));};exports[_0xb216('0x31')]=function(_0xb3bdcf,_0x282012){if(_0xb3bdcf[_0xb216('0x57')]['id']){delete _0xb3bdcf[_0xb216('0x57')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0xb3bdcf[_0xb216('0x50')]['id']}})['then'](handleEntityNotFound(_0x282012,null))['then'](saveUpdates(_0xb3bdcf[_0xb216('0x57')],null))['then'](respondWithResult(_0x282012,null))[_0xb216('0x25')](handleError(_0x282012,null));};exports['destroy']=function(_0x46cd5a,_0x34fcde){return db[_0xb216('0x4c')][_0xb216('0x55')]({'where':{'id':_0x46cd5a[_0xb216('0x50')]['id']}})[_0xb216('0x1c')](handleEntityNotFound(_0x34fcde,null))[_0xb216('0x1c')](removeEntity(_0x34fcde,null))['catch'](handleError(_0x34fcde,null));};exports[_0xb216('0x58')]=function(_0x24ccc0,_0x2023cd){return db['ChatMessage'][_0xb216('0x58')]()[_0xb216('0x1c')](respondWithResult(_0x2023cd,null))['catch'](handleError(_0x2023cd,null));};var interaction_log=require(_0xb216('0x10'))('chat-interactions');exports[_0xb216('0x59')]=function(_0x41067f,_0x5a78e0,_0x3466c9){var _0x58da9f={'agent':{},'channel':_0xb216('0x5a')};if(_0x41067f[_0xb216('0x57')]['id']){delete _0x41067f[_0xb216('0x57')]['id'];}_0x41067f['body'][_0xb216('0x5b')]=!![];_0x41067f[_0xb216('0x57')][_0xb216('0x5c')]=moment()[_0xb216('0x5d')](_0xb216('0x5e'));_0x41067f[_0xb216('0x57')][_0xb216('0x5f')]=_0x41067f['body'][_0xb216('0x5f')]||_0x41067f[_0xb216('0x60')]['id'];_0x58da9f[_0xb216('0x61')]['id']=_0x41067f[_0xb216('0x57')][_0xb216('0x5f')];return db[_0xb216('0x4c')]['find']({'where':{'id':_0x41067f[_0xb216('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5a78e0,null))[_0xb216('0x1c')](saveUpdates(_0x41067f['body'],null))[_0xb216('0x1c')](function(_0x268fa5){if(_0x268fa5){_0x58da9f[_0xb216('0x22')]=_0x268fa5[_0xb216('0x62')]({'plain':!![]});return db[_0xb216('0x63')][_0xb216('0x55')]({'where':{'id':_0x268fa5[_0xb216('0x64')]}});}return null;})[_0xb216('0x1c')](handleEntityNotFound(_0x5a78e0,null))[_0xb216('0x1c')](function(_0xc71487){if(_0xc71487){return _0xc71487[_0xb216('0x31')]({'UserId':_0x41067f[_0xb216('0x57')]['UserId'],'read1stAt':_[_0xb216('0x65')](_0xc71487['read1stAt'])?moment()[_0xb216('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb216('0x1c')](function(_0x34f02a){if(_0x34f02a){_0x58da9f[_0xb216('0x66')]=_0x34f02a[_0xb216('0x62')]({'plain':!![]});interaction_log[_0xb216('0x1d')](_0xb216('0x67'),_0x41067f[_0xb216('0x60')]['id'],_0x41067f[_0xb216('0x60')][_0xb216('0x34')],_0x41067f[_0xb216('0x60')]['role'],_0x58da9f[_0xb216('0x66')]['id'],_0x41067f['body']?JSON[_0xb216('0x1f')](_0x41067f['body']):_0xb216('0x68'));return respondWithRpcPromise('AcceptMessage',_0xb216('0x69'),_0x58da9f);}return null;})[_0xb216('0x1c')](function(_0xd994c4){var _0x49101a=_0xb216('0x6a')+_0xd994c4[_0xb216('0x22')][_0xb216('0x6b')];return db['sequelize'][_0xb216('0x3b')](_0x49101a,{'type':db[_0xb216('0x6c')][_0xb216('0x6d')][_0xb216('0x6e')],'raw':!![]})[_0xb216('0x1c')](function(_0x47c562){return _0x47c562;});})[_0xb216('0x1c')](function(_0x37aab4){if(_0x37aab4){_0x58da9f[_0xb216('0x22')][_0xb216('0x6f')]=_0x37aab4[0x0];if(!_0x41067f[_0xb216('0x57')][_0xb216('0x5f')])return;return db['User'][_0xb216('0x55')]({'where':{'id':_0x41067f['body']['UserId'],'role':_0xb216('0x61')},'attributes':['id',_0xb216('0x34'),_0xb216('0x70'),'email',_0xb216('0x71')],'raw':!![]});}return null;})['then'](function(_0x50e470){if(!_0x50e470)return null;_0x58da9f['message'][_0xb216('0x61')]=_0x50e470;return _0x58da9f;})['then'](function(_0x3197f9){if(_0x3197f9){if(_0x41067f[_0xb216('0x57')]['manual']){_0x58da9f[_0xb216('0x22')]['interface']=util['format']('SIP/%s',_0x41067f['user'][_0xb216('0x34')]);_0x58da9f[_0xb216('0x22')]['channel']=_0x58da9f['channel'];_0x58da9f[_0xb216('0x22')][_0xb216('0x72')]=_0x58da9f[_0xb216('0x73')];_0x58da9f[_0xb216('0x22')][_0xb216('0x74')]=_0xb216('0x59');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xb216('0x75'),'message':_[_0xb216('0x48')](_0x58da9f[_0xb216('0x22')],JSON[_0xb216('0x76')](_0x58da9f['interaction'][_0xb216('0x77')]))},client9002)[_0xb216('0x1c')](function(){return _0x58da9f;});}return _0x58da9f;}return null;})['then'](respondWithResult(_0x5a78e0,null))['catch'](handleError(_0x5a78e0,null));};var interaction_log=require(_0xb216('0x10'))('chat-interactions');exports['reject']=function(_0x4992a7,_0x17f280,_0x363563){var _0x17fb1f={'agent':{},'channel':_0xb216('0x5a')};if(_0x4992a7[_0xb216('0x57')]['id']){delete _0x4992a7['body']['id'];}_0x4992a7['body']['UserId']=_0x4992a7[_0xb216('0x57')][_0xb216('0x5f')]||_0x4992a7[_0xb216('0x60')]['id'];_0x17fb1f[_0xb216('0x61')]['id']=_0x4992a7[_0xb216('0x57')][_0xb216('0x5f')];return db[_0xb216('0x4c')]['find']({'where':{'id':_0x4992a7['params']['id'],'UserId':null}})[_0xb216('0x1c')](handleEntityNotFound(_0x17f280,null))[_0xb216('0x1c')](function(_0x487cad){if(_0x487cad){_0x17fb1f[_0xb216('0x22')]=_0x487cad[_0xb216('0x62')]({'plain':!![]});return db[_0xb216('0x63')][_0xb216('0x55')]({'where':{'id':_0x487cad[_0xb216('0x64')]}});}return null;})[_0xb216('0x1c')](handleEntityNotFound(_0x17f280,null))[_0xb216('0x1c')](function(_0x3c510e){if(_0x3c510e){_0x17fb1f[_0xb216('0x66')]=_0x3c510e[_0xb216('0x62')]({'plain':!![]});interaction_log[_0xb216('0x1d')](_0xb216('0x78'),_0x4992a7[_0xb216('0x60')]['id'],_0x4992a7[_0xb216('0x60')][_0xb216('0x34')],_0x4992a7[_0xb216('0x60')][_0xb216('0x79')],_0x17fb1f['interaction']['id'],_0x4992a7[_0xb216('0x57')]?JSON[_0xb216('0x1f')](_0x4992a7[_0xb216('0x57')]):_0xb216('0x68'));return respondWithRpcPromise(_0xb216('0x7a'),_0xb216('0x7b'),_0x17fb1f);}return null;})[_0xb216('0x1c')](function(_0x22c127){var _0xbf927=_0xb216('0x6a')+_0x22c127[_0xb216('0x22')][_0xb216('0x6b')];return db[_0xb216('0x7c')]['query'](_0xbf927,{'type':db[_0xb216('0x6c')][_0xb216('0x6d')][_0xb216('0x6e')],'raw':!![]})['then'](function(_0x8b9a2f){return _0x8b9a2f;});})['then'](function(_0x5f5e0f){if(_0x5f5e0f){_0x17fb1f[_0xb216('0x22')][_0xb216('0x6f')]=_0x5f5e0f[0x0];if(!_0x4992a7[_0xb216('0x57')][_0xb216('0x5f')])return;return db['User']['find']({'where':{'id':_0x4992a7['body'][_0xb216('0x5f')],'role':_0xb216('0x61')},'attributes':['id',_0xb216('0x34'),_0xb216('0x70'),_0xb216('0x7d'),'internal'],'raw':!![]});}return null;})[_0xb216('0x1c')](function(_0x277ec3){if(!_0x277ec3)return null;_0x17fb1f['message'][_0xb216('0x61')]=_0x277ec3;return _0x17fb1f;})[_0xb216('0x1c')](function(_0x50ee15){if(_0x50ee15){_0x50ee15[_0xb216('0x22')]['interface']=util[_0xb216('0x5d')](_0xb216('0x7e'),_0x4992a7[_0xb216('0x60')][_0xb216('0x34')]);_0x50ee15[_0xb216('0x22')][_0xb216('0x73')]=_0x17fb1f[_0xb216('0x73')];_0x50ee15[_0xb216('0x22')][_0xb216('0x72')]=_0x17fb1f[_0xb216('0x73')];_0x50ee15['message'][_0xb216('0x74')]=_0xb216('0x7f');respondWithRpcPromise('EventManager',_0xb216('0x80'),{'event':_0xb216('0x81'),'message':_[_0xb216('0x48')](_0x17fb1f['message'],JSON[_0xb216('0x76')](_0x17fb1f['interaction'][_0xb216('0x77')]))},client9002);return _0x17fb1f;}return null;})[_0xb216('0x1c')](respondWithResult(_0x17f280,null))['catch'](handleError(_0x17f280,null));};
\ No newline at end of file
+var _0x3580=['agent','ChatInteractionId','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','email','internal','manual','interface','channel','motionChannel','event','EventManager','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','QueryTypes','contact','fullname','SIP/%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','stack','name','index','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','create','body','update','find','describe','chat-interactions','accept','chat','read','readAt','UserId','user'];(function(_0x680821,_0x23e67f){var _0x3f132c=function(_0x1bbcea){while(--_0x1bbcea){_0x680821['push'](_0x680821['shift']());}};_0x3f132c(++_0x23e67f);}(_0x3580,0x1b8));var _0x0358=function(_0x3ef6bb,_0x1bb97f){_0x3ef6bb=_0x3ef6bb-0x0;var _0xa5f12a=_0x3580[_0x3ef6bb];return _0xa5f12a;};'use strict';var emlformat=require(_0x0358('0x0'));var rimraf=require(_0x0358('0x1'));var zipdir=require(_0x0358('0x2'));var jsonpatch=require(_0x0358('0x3'));var rp=require(_0x0358('0x4'));var moment=require('moment');var BPromise=require(_0x0358('0x5'));var Mustache=require(_0x0358('0x6'));var util=require(_0x0358('0x7'));var path=require(_0x0358('0x8'));var sox=require(_0x0358('0x9'));var csv=require('to-csv');var ejs=require(_0x0358('0xa'));var fs=require('fs');var fs_extra=require(_0x0358('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0358('0xc'));var jsforce=require(_0x0358('0xd'));var deskjs=require(_0x0358('0xe'));var toCsv=require(_0x0358('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0358('0x10'));var authService=require(_0x0358('0x11'));var qs=require(_0x0358('0x12'));var as=require(_0x0358('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0358('0x14'))(_0x0358('0x15'));var utils=require(_0x0358('0x16'));var config=require(_0x0358('0x17'));var licenseUtil=require(_0x0358('0x18'));var db=require(_0x0358('0x19'))['db'];config['redis']=_['defaults'](config[_0x0358('0x1a')],{'host':_0x0358('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0358('0x1a')]));require(_0x0358('0x1c'))[_0x0358('0x1d')](socket);var jayson=require(_0x0358('0x1e'));var client=jayson[_0x0358('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x0358('0x1f')][_0x0358('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x55643f,_0x310743,_0x25aaf2,_0x35c55c){return new BPromise(function(_0x375a17,_0x2011a5){var _0x335401=_0x35c55c||client;return _0x335401[_0x0358('0x21')](_0x55643f,_0x25aaf2)[_0x0358('0x22')](function(_0x3e4913){logger[_0x0358('0x23')](_0x0358('0x24'),_0x310743,'request\x20sent');logger['debug'](_0x0358('0x25'),_0x310743,_0x0358('0x26'),JSON[_0x0358('0x27')](_0x3e4913));if(_0x3e4913[_0x0358('0x28')]){if(_0x3e4913[_0x0358('0x28')][_0x0358('0x29')]===0x1f4){logger[_0x0358('0x28')](_0x0358('0x24'),_0x310743,_0x3e4913[_0x0358('0x28')][_0x0358('0x2a')]);return _0x2011a5(_0x3e4913['error'][_0x0358('0x2a')]);}logger[_0x0358('0x28')]('ChatMessage,\x20%s,\x20%s',_0x310743,_0x3e4913[_0x0358('0x28')][_0x0358('0x2a')]);return _0x375a17(_0x3e4913['error'][_0x0358('0x2a')]);}else{logger[_0x0358('0x23')](_0x0358('0x24'),_0x310743,'request\x20sent');_0x375a17(_0x3e4913['result'][_0x0358('0x2a')]);}})[_0x0358('0x2b')](function(_0x583106){logger[_0x0358('0x28')](_0x0358('0x24'),_0x310743,_0x583106);_0x2011a5(_0x583106);});});}function respondWithStatusCode(_0x1bd1fa,_0x21bd46){_0x21bd46=_0x21bd46||0xcc;return function(_0x49c14b){if(_0x49c14b){return _0x1bd1fa[_0x0358('0x2c')](_0x21bd46);}return _0x1bd1fa[_0x0358('0x2d')](_0x21bd46)[_0x0358('0x2e')]();};}function respondWithResult(_0x2a99e9,_0x1020e6){_0x1020e6=_0x1020e6||0xc8;return function(_0x353e4f){if(_0x353e4f){return _0x2a99e9[_0x0358('0x2d')](_0x1020e6)[_0x0358('0x2f')](_0x353e4f);}};}function respondWithFilteredResult(_0x53ccdb,_0x2a9d73){return function(_0x3ef6b8){if(_0x3ef6b8){var _0x39e023=typeof _0x2a9d73[_0x0358('0x30')]===_0x0358('0x31')&&typeof _0x2a9d73['limit']===_0x0358('0x31');var _0x252ee5=_0x3ef6b8['count'];var _0x14592d=_0x39e023?0x0:_0x2a9d73[_0x0358('0x30')];var _0x1622d6=_0x39e023?_0x3ef6b8['count']:_0x2a9d73[_0x0358('0x30')]+_0x2a9d73[_0x0358('0x32')];var _0x224660;if(_0x1622d6>=_0x252ee5){_0x1622d6=_0x252ee5;_0x224660=0xc8;}else{_0x224660=0xce;}_0x53ccdb['status'](_0x224660);return _0x53ccdb[_0x0358('0x33')](_0x0358('0x34'),_0x14592d+'-'+_0x1622d6+'/'+_0x252ee5)[_0x0358('0x2f')](_0x3ef6b8);}return null;};}function patchUpdates(_0xab0630){return function(_0x1676a3){try{jsonpatch[_0x0358('0x35')](_0x1676a3,_0xab0630,!![]);}catch(_0x22d5ae){return BPromise[_0x0358('0x36')](_0x22d5ae);}return _0x1676a3[_0x0358('0x37')]();};}function saveUpdates(_0x8520c0,_0x1a9e41){return function(_0xb2180b){if(_0xb2180b){return _0xb2180b['update'](_0x8520c0)[_0x0358('0x22')](function(_0x2bea06){return _0x2bea06;});}return null;};}function removeEntity(_0x4ea71e,_0x267936){return function(_0x1277c8){if(_0x1277c8){return _0x1277c8[_0x0358('0x38')]()[_0x0358('0x22')](function(){_0x4ea71e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x234c61,_0x59c845){return function(_0x4c7f50){if(!_0x4c7f50){_0x234c61[_0x0358('0x2c')](0x194);}return _0x4c7f50;};}function handleError(_0x38da59,_0x3c3b71){_0x3c3b71=_0x3c3b71||0x1f4;return function(_0x2827f8){logger['error'](_0x2827f8[_0x0358('0x39')]);if(_0x2827f8[_0x0358('0x3a')]){delete _0x2827f8[_0x0358('0x3a')];}_0x38da59[_0x0358('0x2d')](_0x3c3b71)['send'](_0x2827f8);};}exports[_0x0358('0x3b')]=function(_0x12df16,_0x5a9e8a){var _0x17a525={},_0x18f029={},_0x9309ef={'count':0x0,'rows':[]};var _0x10f336=_[_0x0358('0x3c')](db[_0x0358('0x3d')][_0x0358('0x3e')],function(_0x4bad8c){return{'name':_0x4bad8c['fieldName'],'type':_0x4bad8c[_0x0358('0x3f')][_0x0358('0x40')]};});_0x18f029[_0x0358('0x41')]=_[_0x0358('0x3c')](_0x10f336,_0x0358('0x3a'));_0x18f029[_0x0358('0x42')]=_[_0x0358('0x43')](_0x12df16[_0x0358('0x42')]);_0x18f029[_0x0358('0x44')]=_['intersection'](_0x18f029[_0x0358('0x41')],_0x18f029[_0x0358('0x42')]);_0x17a525['attributes']=_[_0x0358('0x45')](_0x18f029['model'],qs[_0x0358('0x46')](_0x12df16[_0x0358('0x42')][_0x0358('0x46')]));_0x17a525['attributes']=_0x17a525[_0x0358('0x47')][_0x0358('0x48')]?_0x17a525['attributes']:_0x18f029[_0x0358('0x41')];if(!_0x12df16[_0x0358('0x42')][_0x0358('0x49')]('nolimit')){_0x17a525[_0x0358('0x32')]=qs[_0x0358('0x32')](_0x12df16[_0x0358('0x42')][_0x0358('0x32')]);_0x17a525[_0x0358('0x30')]=qs['offset'](_0x12df16[_0x0358('0x42')][_0x0358('0x30')]);}_0x17a525[_0x0358('0x4a')]=qs[_0x0358('0x4b')](_0x12df16['query']['sort']);_0x17a525['where']=qs[_0x0358('0x44')](_[_0x0358('0x4c')](_0x12df16['query'],_0x18f029['filters']),_0x10f336);if(_0x12df16[_0x0358('0x42')][_0x0358('0x4d')]){_0x17a525[_0x0358('0x4e')]=_[_0x0358('0x4f')](_0x17a525[_0x0358('0x4e')],{'$or':_['map'](_0x10f336,function(_0x5f3e29){if(_0x5f3e29[_0x0358('0x3f')]!==_0x0358('0x50')){var _0x57d17f={};_0x57d17f[_0x5f3e29['name']]={'$like':'%'+_0x12df16[_0x0358('0x42')][_0x0358('0x4d')]+'%'};return _0x57d17f;}})});}_0x17a525=_['merge']({},_0x17a525,_0x12df16[_0x0358('0x51')]);var _0x3d4390={'where':_0x17a525['where']};return db[_0x0358('0x3d')]['count'](_0x3d4390)['then'](function(_0x272e4a){_0x9309ef[_0x0358('0x52')]=_0x272e4a;if(_0x12df16[_0x0358('0x42')][_0x0358('0x53')]){_0x17a525[_0x0358('0x54')]=[{'all':!![]}];}return db[_0x0358('0x3d')]['findAll'](_0x17a525);})['then'](function(_0x48ce4b){_0x9309ef[_0x0358('0x55')]=_0x48ce4b;return _0x9309ef;})[_0x0358('0x22')](respondWithFilteredResult(_0x5a9e8a,_0x17a525))['catch'](handleError(_0x5a9e8a,null));};exports[_0x0358('0x56')]=function(_0x1c20f9,_0x1c7a81){var _0x1a4610={'raw':!![],'where':{'id':_0x1c20f9[_0x0358('0x57')]['id']}},_0x2c7982={};_0x2c7982['model']=_[_0x0358('0x43')](db['ChatMessage'][_0x0358('0x3e')]);_0x2c7982[_0x0358('0x42')]=_['keys'](_0x1c20f9[_0x0358('0x42')]);_0x2c7982[_0x0358('0x44')]=_[_0x0358('0x45')](_0x2c7982[_0x0358('0x41')],_0x2c7982[_0x0358('0x42')]);_0x1a4610[_0x0358('0x47')]=_[_0x0358('0x45')](_0x2c7982['model'],qs[_0x0358('0x46')](_0x1c20f9[_0x0358('0x42')][_0x0358('0x46')]));_0x1a4610[_0x0358('0x47')]=_0x1a4610['attributes'][_0x0358('0x48')]?_0x1a4610[_0x0358('0x47')]:_0x2c7982[_0x0358('0x41')];if(_0x1c20f9[_0x0358('0x42')][_0x0358('0x53')]){_0x1a4610[_0x0358('0x54')]=[{'all':!![]}];}_0x1a4610=_[_0x0358('0x4f')]({},_0x1a4610,_0x1c20f9[_0x0358('0x51')]);return db[_0x0358('0x3d')]['find'](_0x1a4610)[_0x0358('0x22')](handleEntityNotFound(_0x1c7a81,null))['then'](respondWithResult(_0x1c7a81,null))['catch'](handleError(_0x1c7a81,null));};exports[_0x0358('0x58')]=function(_0x34b6eb,_0x365ca6){return db['ChatMessage']['create'](_0x34b6eb[_0x0358('0x59')],{})['then'](respondWithResult(_0x365ca6,0xc9))['catch'](handleError(_0x365ca6,null));};exports[_0x0358('0x5a')]=function(_0x31392f,_0x2713d3){if(_0x31392f['body']['id']){delete _0x31392f[_0x0358('0x59')]['id'];}return db[_0x0358('0x3d')][_0x0358('0x5b')]({'where':{'id':_0x31392f[_0x0358('0x57')]['id']}})[_0x0358('0x22')](handleEntityNotFound(_0x2713d3,null))['then'](saveUpdates(_0x31392f['body'],null))[_0x0358('0x22')](respondWithResult(_0x2713d3,null))['catch'](handleError(_0x2713d3,null));};exports[_0x0358('0x38')]=function(_0x26817b,_0x1583d7){return db[_0x0358('0x3d')][_0x0358('0x5b')]({'where':{'id':_0x26817b[_0x0358('0x57')]['id']}})['then'](handleEntityNotFound(_0x1583d7,null))[_0x0358('0x22')](removeEntity(_0x1583d7,null))['catch'](handleError(_0x1583d7,null));};exports[_0x0358('0x5c')]=function(_0x1bf7dc,_0x4bf761){return db[_0x0358('0x3d')][_0x0358('0x5c')]()[_0x0358('0x22')](respondWithResult(_0x4bf761,null))[_0x0358('0x2b')](handleError(_0x4bf761,null));};var interaction_log=require(_0x0358('0x14'))(_0x0358('0x5d'));exports[_0x0358('0x5e')]=function(_0x3e1e4a,_0x3532f1,_0x2e220e){var _0x594911={'agent':{},'channel':_0x0358('0x5f')};if(_0x3e1e4a['body']['id']){delete _0x3e1e4a[_0x0358('0x59')]['id'];}_0x3e1e4a['body'][_0x0358('0x60')]=!![];_0x3e1e4a[_0x0358('0x59')][_0x0358('0x61')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3e1e4a[_0x0358('0x59')][_0x0358('0x62')]=_0x3e1e4a[_0x0358('0x59')]['UserId']||_0x3e1e4a[_0x0358('0x63')]['id'];_0x594911[_0x0358('0x64')]['id']=_0x3e1e4a[_0x0358('0x59')][_0x0358('0x62')];return db[_0x0358('0x3d')][_0x0358('0x5b')]({'where':{'id':_0x3e1e4a['params']['id'],'UserId':null}})[_0x0358('0x22')](handleEntityNotFound(_0x3532f1,null))[_0x0358('0x22')](saveUpdates(_0x3e1e4a[_0x0358('0x59')],null))[_0x0358('0x22')](function(_0x2fed87){if(_0x2fed87){_0x594911[_0x0358('0x2a')]=_0x2fed87['get']({'plain':!![]});return db['ChatInteraction'][_0x0358('0x5b')]({'where':{'id':_0x2fed87[_0x0358('0x65')]}});}return null;})[_0x0358('0x22')](handleEntityNotFound(_0x3532f1,null))['then'](function(_0x3c3f5c){if(_0x3c3f5c){return _0x3c3f5c['update']({'UserId':_0x3e1e4a[_0x0358('0x59')]['UserId'],'read1stAt':_['isNil'](_0x3c3f5c[_0x0358('0x66')])?moment()[_0x0358('0x67')](_0x0358('0x68')):undefined});}return null;})['then'](function(_0x1ee4d9){if(_0x1ee4d9){_0x594911[_0x0358('0x69')]=_0x1ee4d9[_0x0358('0x6a')]({'plain':!![]});interaction_log[_0x0358('0x23')](_0x0358('0x6b'),_0x3e1e4a['user']['id'],_0x3e1e4a[_0x0358('0x63')][_0x0358('0x3a')],_0x3e1e4a['user'][_0x0358('0x6c')],_0x594911['interaction']['id'],_0x3e1e4a[_0x0358('0x59')]?JSON['stringify'](_0x3e1e4a['body']):'null');return respondWithRpcPromise(_0x0358('0x6d'),_0x0358('0x6e'),_0x594911);}return null;})[_0x0358('0x22')](function(_0x58a26e){var _0x1f1584=_0x0358('0x6f')+_0x58a26e['message'][_0x0358('0x70')];return db[_0x0358('0x71')][_0x0358('0x42')](_0x1f1584,{'type':db[_0x0358('0x72')]['QueryTypes'][_0x0358('0x73')],'raw':!![]})[_0x0358('0x22')](function(_0x1d6a07){return _0x1d6a07;});})[_0x0358('0x22')](function(_0x396901){if(_0x396901){_0x594911[_0x0358('0x2a')]['contact']=_0x396901[0x0];if(!_0x3e1e4a[_0x0358('0x59')][_0x0358('0x62')])return;return db[_0x0358('0x74')][_0x0358('0x5b')]({'where':{'id':_0x3e1e4a[_0x0358('0x59')][_0x0358('0x62')],'role':_0x0358('0x64')},'attributes':['id',_0x0358('0x3a'),'fullname',_0x0358('0x75'),_0x0358('0x76')],'raw':!![]});}return null;})[_0x0358('0x22')](function(_0x47b244){if(!_0x47b244)return null;_0x594911['message'][_0x0358('0x64')]=_0x47b244;return _0x594911;})[_0x0358('0x22')](function(_0x533249){if(_0x533249){if(_0x3e1e4a[_0x0358('0x59')][_0x0358('0x77')]){_0x594911[_0x0358('0x2a')][_0x0358('0x78')]=util[_0x0358('0x67')]('SIP/%s',_0x3e1e4a[_0x0358('0x63')][_0x0358('0x3a')]);_0x594911['message'][_0x0358('0x79')]=_0x594911[_0x0358('0x79')];_0x594911[_0x0358('0x2a')][_0x0358('0x7a')]=_0x594911['channel'];_0x594911[_0x0358('0x2a')][_0x0358('0x7b')]=_0x0358('0x5e');return respondWithRpcPromise(_0x0358('0x7c'),'EventManager',{'event':'acceptmessage','message':_[_0x0358('0x4f')](_0x594911[_0x0358('0x2a')],JSON[_0x0358('0x7d')](_0x594911[_0x0358('0x69')][_0x0358('0x7e')]))},client9002)[_0x0358('0x22')](function(){return _0x594911;});}return _0x594911;}return null;})[_0x0358('0x22')](respondWithResult(_0x3532f1,null))[_0x0358('0x2b')](handleError(_0x3532f1,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x0358('0x36')]=function(_0x3910c7,_0x1fe6ee,_0x1ea44b){var _0x41e0cf={'agent':{},'channel':_0x0358('0x5f')};if(_0x3910c7[_0x0358('0x59')]['id']){delete _0x3910c7['body']['id'];}_0x3910c7[_0x0358('0x59')][_0x0358('0x62')]=_0x3910c7[_0x0358('0x59')]['UserId']||_0x3910c7[_0x0358('0x63')]['id'];_0x41e0cf[_0x0358('0x64')]['id']=_0x3910c7[_0x0358('0x59')][_0x0358('0x62')];return db[_0x0358('0x3d')][_0x0358('0x5b')]({'where':{'id':_0x3910c7['params']['id'],'UserId':null}})[_0x0358('0x22')](handleEntityNotFound(_0x1fe6ee,null))[_0x0358('0x22')](function(_0x281e27){if(_0x281e27){_0x41e0cf[_0x0358('0x2a')]=_0x281e27[_0x0358('0x6a')]({'plain':!![]});return db[_0x0358('0x7f')][_0x0358('0x5b')]({'where':{'id':_0x281e27[_0x0358('0x65')]}});}return null;})[_0x0358('0x22')](handleEntityNotFound(_0x1fe6ee,null))[_0x0358('0x22')](function(_0x37c6a6){if(_0x37c6a6){_0x41e0cf[_0x0358('0x69')]=_0x37c6a6[_0x0358('0x6a')]({'plain':!![]});interaction_log[_0x0358('0x23')](_0x0358('0x80'),_0x3910c7[_0x0358('0x63')]['id'],_0x3910c7[_0x0358('0x63')][_0x0358('0x3a')],_0x3910c7[_0x0358('0x63')][_0x0358('0x6c')],_0x41e0cf[_0x0358('0x69')]['id'],_0x3910c7['body']?JSON[_0x0358('0x27')](_0x3910c7[_0x0358('0x59')]):_0x0358('0x81'));return respondWithRpcPromise('RejectMessage',_0x0358('0x82'),_0x41e0cf);}return null;})[_0x0358('0x22')](function(_0x4e2cf6){var _0x22cfbe=_0x0358('0x6f')+_0x4e2cf6[_0x0358('0x2a')][_0x0358('0x70')];return db[_0x0358('0x71')][_0x0358('0x42')](_0x22cfbe,{'type':db['Sequelize'][_0x0358('0x83')][_0x0358('0x73')],'raw':!![]})[_0x0358('0x22')](function(_0xeaf15f){return _0xeaf15f;});})[_0x0358('0x22')](function(_0x59c816){if(_0x59c816){_0x41e0cf[_0x0358('0x2a')][_0x0358('0x84')]=_0x59c816[0x0];if(!_0x3910c7[_0x0358('0x59')]['UserId'])return;return db[_0x0358('0x74')]['find']({'where':{'id':_0x3910c7['body'][_0x0358('0x62')],'role':_0x0358('0x64')},'attributes':['id',_0x0358('0x3a'),_0x0358('0x85'),_0x0358('0x75'),_0x0358('0x76')],'raw':!![]});}return null;})[_0x0358('0x22')](function(_0x3a0d43){if(!_0x3a0d43)return null;_0x41e0cf[_0x0358('0x2a')][_0x0358('0x64')]=_0x3a0d43;return _0x41e0cf;})['then'](function(_0x127cda){if(_0x127cda){_0x127cda[_0x0358('0x2a')][_0x0358('0x78')]=util[_0x0358('0x67')](_0x0358('0x86'),_0x3910c7[_0x0358('0x63')][_0x0358('0x3a')]);_0x127cda[_0x0358('0x2a')]['channel']=_0x41e0cf['channel'];_0x127cda['message'][_0x0358('0x7a')]=_0x41e0cf['channel'];_0x127cda[_0x0358('0x2a')][_0x0358('0x7b')]=_0x0358('0x36');respondWithRpcPromise(_0x0358('0x7c'),'EventManager',{'event':'rejectmessage','message':_['merge'](_0x41e0cf[_0x0358('0x2a')],JSON[_0x0358('0x7d')](_0x41e0cf['interaction'][_0x0358('0x7e')]))},client9002);return _0x41e0cf;}return null;})[_0x0358('0x22')](respondWithResult(_0x1fe6ee,null))[_0x0358('0x2b')](handleError(_0x1fe6ee,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 187dd62..1c58226 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 _0x1a83=['hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x511ee8,_0x1934be){var _0x4386d6=function(_0x3dfc6f){while(--_0x3dfc6f){_0x511ee8['push'](_0x511ee8['shift']());}};_0x4386d6(++_0x1934be);}(_0x1a83,0xfe));var _0x31a8=function(_0x5eb1a7,_0x4acae9){_0x5eb1a7=_0x5eb1a7-0x0;var _0x39fdf3=_0x1a83[_0x5eb1a7];return _0x39fdf3;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x31a8('0x0'))['db'][_0x31a8('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x31a8('0x2')](0x0);var events={'afterCreate':_0x31a8('0x3'),'afterUpdate':_0x31a8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1bffcf){return function(_0x431887,_0xa903af,_0x449a3f){ChatMessageEvents[_0x31a8('0x5')](_0x1bffcf+':'+_0x431887['id'],_0x431887);ChatMessageEvents[_0x31a8('0x5')](_0x1bffcf,_0x431887);_0x449a3f(null);};}for(var e in events){if(events[_0x31a8('0x6')](e)){var event=events[e];ChatMessage[_0x31a8('0x7')](e,emitEvent(event));}}module[_0x31a8('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0xb5f4=['update','remove','emit','hook','events','../../mysqldb','setMaxListeners'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xb5f4,0x15b));var _0x4b5f=function(_0x570b17,_0x3e25d4){_0x570b17=_0x570b17-0x0;var _0x230b47=_0xb5f4[_0x570b17];return _0x230b47;};'use strict';var EventEmitter=require(_0x4b5f('0x0'));var ChatMessage=require(_0x4b5f('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x4b5f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4b5f('0x3'),'afterDestroy':_0x4b5f('0x4')};function emitEvent(_0x14a1b0){return function(_0x892dbe,_0x446aa0,_0x3104da){ChatMessageEvents[_0x4b5f('0x5')](_0x14a1b0+':'+_0x892dbe['id'],_0x892dbe);ChatMessageEvents[_0x4b5f('0x5')](_0x14a1b0,_0x892dbe);_0x3104da(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x4b5f('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 5aec8ea..f2a2027 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 _0x3d7e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','../../config/logger'];(function(_0x2ecd91,_0x1f21e8){var _0x3bf737=function(_0x1563d7){while(--_0x1563d7){_0x2ecd91['push'](_0x2ecd91['shift']());}};_0x3bf737(++_0x1f21e8);}(_0x3d7e,0x1ae));var _0xe3d7=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0x3d7e[_0x19a49f];return _0x5351ae;};'use strict';var _=require(_0xe3d7('0x0'));var util=require('util');var logger=require(_0xe3d7('0x1'))('api');var moment=require(_0xe3d7('0x2'));var BPromise=require(_0xe3d7('0x3'));var rp=require(_0xe3d7('0x4'));var fs=require('fs');var path=require(_0xe3d7('0x5'));var rimraf=require(_0xe3d7('0x6'));var config=require(_0xe3d7('0x7'));var attributes=require('./chatMessage.attributes');module[_0xe3d7('0x8')]=function(_0x35e1fc,_0x4498e3){return _0x35e1fc['define'](_0xe3d7('0x9'),attributes,{'tableName':_0xe3d7('0xa'),'paranoid':![],'indexes':[{'name':_0xe3d7('0xb'),'fields':['body'],'type':_0xe3d7('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d6604,_0x173287,_0x428316){var _0x37b6f9=_0x35e1fc[_0xe3d7('0xd')];var _0x5d7586=_0x2d6604[_0xe3d7('0xe')]({'plain':!![]});if(_0x5d7586[_0xe3d7('0xf')][_0xe3d7('0x10')]()==='in'||_0x5d7586[_0xe3d7('0xf')][_0xe3d7('0x10')]()==='out'&&!_0x5d7586[_0xe3d7('0x11')]&&!_['isNil'](_0x5d7586[_0xe3d7('0x12')])){_0x37b6f9[_0xe3d7('0x13')]['findOne']({'where':{'id':_0x5d7586[_0xe3d7('0x14')]}})[_0xe3d7('0x15')](function(_0xb258cc){if(_0xb258cc){_0xb258cc[_0xe3d7('0x16')]({'lastMsgAt':_0x5d7586[_0xe3d7('0x17')],'lastMsgDirection':_0x5d7586[_0xe3d7('0xf')][_0xe3d7('0x10')]()});}})[_0xe3d7('0x18')](function(_0x2efb98){console[_0xe3d7('0x19')](_0x2efb98);});}_0x428316();}},'charset':_0xe3d7('0x1a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xcfe5=['rimraf','../../config/environment','./chatMessage.attributes','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','ChatInteraction','ChatInteractionId','update','utf8mb4_unicode_ci','lodash','util','request-promise'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xcfe5,0x1c9));var _0x5cfe=function(_0x1d0aee,_0x2c4454){_0x1d0aee=_0x1d0aee-0x0;var _0x34ee2c=_0xcfe5[_0x1d0aee];return _0x34ee2c;};'use strict';var _=require(_0x5cfe('0x0'));var util=require(_0x5cfe('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5cfe('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5cfe('0x3'));var config=require(_0x5cfe('0x4'));var attributes=require(_0x5cfe('0x5'));module['exports']=function(_0x26bdda,_0x4a33f0){return _0x26bdda[_0x5cfe('0x6')]('ChatMessage',attributes,{'tableName':_0x5cfe('0x7'),'paranoid':![],'indexes':[{'name':_0x5cfe('0x8'),'fields':[_0x5cfe('0x9')],'type':_0x5cfe('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x73f7b2,_0x19bce2,_0x1f9cb2){var _0x1e9498=_0x26bdda[_0x5cfe('0xb')];var _0x4788da=_0x73f7b2[_0x5cfe('0xc')]({'plain':!![]});if(_0x4788da[_0x5cfe('0xd')]['toLowerCase']()==='in'||_0x4788da[_0x5cfe('0xd')][_0x5cfe('0xe')]()==='out'&&!_0x4788da[_0x5cfe('0xf')]&&!_['isNil'](_0x4788da['UserId'])){_0x1e9498[_0x5cfe('0x10')]['findOne']({'where':{'id':_0x4788da[_0x5cfe('0x11')]}})['then'](function(_0x59de75){if(_0x59de75){_0x59de75[_0x5cfe('0x12')]({'lastMsgAt':_0x4788da['createdAt'],'lastMsgDirection':_0x4788da[_0x5cfe('0xd')]['toLowerCase']()});}})['catch'](function(_0x169bf5){console['error'](_0x169bf5);});}_0x1f9cb2();}},'charset':'utf8mb4','collate':_0x5cfe('0x13')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 2511603..7d6b9e8 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 _0xc5dc=['message','request\x20sent','result','catch','CreateChatMessage','ChatMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','stringify','error','code'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc5dc,0x128));var _0xcc5d=function(_0x52826e,_0x3812c4){_0x52826e=_0x52826e-0x0;var _0x3fecd9=_0xc5dc[_0x52826e];return _0x3fecd9;};'use strict';var _=require(_0xcc5d('0x0'));var util=require(_0xcc5d('0x1'));var moment=require(_0xcc5d('0x2'));var BPromise=require(_0xcc5d('0x3'));var rs=require(_0xcc5d('0x4'));var fs=require('fs');var Redis=require(_0xcc5d('0x5'));var db=require(_0xcc5d('0x6'))['db'];var utils=require(_0xcc5d('0x7'));var logger=require(_0xcc5d('0x8'))(_0xcc5d('0x9'));var config=require(_0xcc5d('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xcc5d('0xb')][_0xcc5d('0xc')]({'port':0x232a});config[_0xcc5d('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcc5d('0xe'))(new Redis(config[_0xcc5d('0xd')]));require(_0xcc5d('0xf'))[_0xcc5d('0x10')](socket);function respondWithRpcPromise(_0x469175,_0x11998d,_0x1030e7){return new BPromise(function(_0x5b78e0,_0x532fc1){return client['request'](_0x469175,_0x1030e7)[_0xcc5d('0x11')](function(_0x7ded01){logger[_0xcc5d('0x12')](_0xcc5d('0x13'),_0x11998d,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x11998d,'request\x20sent',JSON[_0xcc5d('0x14')](_0x7ded01));if(_0x7ded01[_0xcc5d('0x15')]){if(_0x7ded01['error'][_0xcc5d('0x16')]===0x1f4){logger[_0xcc5d('0x15')](_0xcc5d('0x13'),_0x11998d,_0x7ded01['error'][_0xcc5d('0x17')]);return _0x532fc1(_0x7ded01[_0xcc5d('0x15')]['message']);}logger[_0xcc5d('0x15')](_0xcc5d('0x13'),_0x11998d,_0x7ded01[_0xcc5d('0x15')]['message']);return _0x5b78e0(_0x7ded01['error'][_0xcc5d('0x17')]);}else{logger['info'](_0xcc5d('0x13'),_0x11998d,_0xcc5d('0x18'));_0x5b78e0(_0x7ded01[_0xcc5d('0x19')][_0xcc5d('0x17')]);}})[_0xcc5d('0x1a')](function(_0x3f4eea){logger[_0xcc5d('0x15')](_0xcc5d('0x13'),_0x11998d,_0x3f4eea);_0x532fc1(_0x3f4eea);});});}exports[_0xcc5d('0x1b')]=function(_0x306aeb){var _0x302203=this;return new Promise(function(_0x4f2d54,_0x154fea){return db[_0xcc5d('0x1c')]['create'](_0x306aeb['body'],{'raw':_0x306aeb['options']?_0x306aeb['options']['raw']===undefined?!![]:![]:!![]})[_0xcc5d('0x11')](function(_0x2b0ae3){logger['info'](_0xcc5d('0x1b'),_0x306aeb);logger['debug'](_0xcc5d('0x1b'),_0x306aeb,JSON[_0xcc5d('0x14')](_0x2b0ae3));_0x4f2d54(_0x2b0ae3);})[_0xcc5d('0x1a')](function(_0x3c107d){logger[_0xcc5d('0x15')](_0xcc5d('0x1b'),_0x3c107d[_0xcc5d('0x17')],_0x306aeb);_0x154fea(_0x302203[_0xcc5d('0x15')](0x1f4,_0x3c107d[_0xcc5d('0x17')]));});});};
\ No newline at end of file
+var _0x9ed7=['options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','CreateChatMessage','ChatMessage','create','body'];(function(_0x57f6ac,_0xe1e134){var _0x55a690=function(_0x59e6ed){while(--_0x59e6ed){_0x57f6ac['push'](_0x57f6ac['shift']());}};_0x55a690(++_0xe1e134);}(_0x9ed7,0x1a6));var _0x79ed=function(_0x2cacef,_0xba1573){_0x2cacef=_0x2cacef-0x0;var _0x289ba6=_0x9ed7[_0x2cacef];return _0x289ba6;};'use strict';var _=require(_0x79ed('0x0'));var util=require(_0x79ed('0x1'));var moment=require(_0x79ed('0x2'));var BPromise=require('bluebird');var rs=require(_0x79ed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79ed('0x4'))['db'];var utils=require(_0x79ed('0x5'));var logger=require(_0x79ed('0x6'))(_0x79ed('0x7'));var config=require(_0x79ed('0x8'));var jayson=require(_0x79ed('0x9'));var client=jayson[_0x79ed('0xa')]['http']({'port':0x232a});config[_0x79ed('0xb')]=_[_0x79ed('0xc')](config[_0x79ed('0xb')],{'host':_0x79ed('0xd'),'port':0x18eb});var socket=require(_0x79ed('0xe'))(new Redis(config[_0x79ed('0xb')]));require(_0x79ed('0xf'))['register'](socket);function respondWithRpcPromise(_0xc900c6,_0x5d824b,_0x5ed6ba){return new BPromise(function(_0x47cf4f,_0x130dc8){return client[_0x79ed('0x10')](_0xc900c6,_0x5ed6ba)[_0x79ed('0x11')](function(_0xc84329){logger['info']('ChatMessage,\x20%s,\x20%s',_0x5d824b,_0x79ed('0x12'));logger[_0x79ed('0x13')](_0x79ed('0x14'),_0x5d824b,'request\x20sent',JSON[_0x79ed('0x15')](_0xc84329));if(_0xc84329[_0x79ed('0x16')]){if(_0xc84329[_0x79ed('0x16')][_0x79ed('0x17')]===0x1f4){logger[_0x79ed('0x16')](_0x79ed('0x18'),_0x5d824b,_0xc84329[_0x79ed('0x16')]['message']);return _0x130dc8(_0xc84329[_0x79ed('0x16')][_0x79ed('0x19')]);}logger[_0x79ed('0x16')](_0x79ed('0x18'),_0x5d824b,_0xc84329['error'][_0x79ed('0x19')]);return _0x47cf4f(_0xc84329[_0x79ed('0x16')][_0x79ed('0x19')]);}else{logger[_0x79ed('0x1a')](_0x79ed('0x18'),_0x5d824b,_0x79ed('0x12'));_0x47cf4f(_0xc84329[_0x79ed('0x1b')][_0x79ed('0x19')]);}})[_0x79ed('0x1c')](function(_0x22d2f7){logger[_0x79ed('0x16')](_0x79ed('0x18'),_0x5d824b,_0x22d2f7);_0x130dc8(_0x22d2f7);});});}exports[_0x79ed('0x1d')]=function(_0x5e7c58){var _0x11f5df=this;return new Promise(function(_0x58c32a,_0x3dc35){return db[_0x79ed('0x1e')][_0x79ed('0x1f')](_0x5e7c58[_0x79ed('0x20')],{'raw':_0x5e7c58['options']?_0x5e7c58[_0x79ed('0x21')][_0x79ed('0x22')]===undefined?!![]:![]:!![]})[_0x79ed('0x11')](function(_0x25d67e){logger[_0x79ed('0x1a')](_0x79ed('0x1d'),_0x5e7c58);logger[_0x79ed('0x13')](_0x79ed('0x1d'),_0x5e7c58,JSON[_0x79ed('0x15')](_0x25d67e));_0x58c32a(_0x25d67e);})['catch'](function(_0x572c85){logger[_0x79ed('0x16')](_0x79ed('0x1d'),_0x572c85[_0x79ed('0x19')],_0x5e7c58);_0x3dc35(_0x11f5df[_0x79ed('0x16')](0x1f4,_0x572c85[_0x79ed('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 9dff581..61d276a 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 _0x2caf=['removeListener','register','length','chatMessage:','update','emit'];(function(_0x245545,_0x4983b3){var _0x106a5f=function(_0x278277){while(--_0x278277){_0x245545['push'](_0x245545['shift']());}};_0x106a5f(++_0x4983b3);}(_0x2caf,0x6a));var _0xf2ca=function(_0x10c139,_0x356b39){_0x10c139=_0x10c139-0x0;var _0x4dfd12=_0x2caf[_0x10c139];return _0x4dfd12;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save','remove',_0xf2ca('0x0')];function createListener(_0x53a64f,_0x3b2612){return function(_0x36e439){_0x3b2612[_0xf2ca('0x1')](_0x53a64f,_0x36e439);};}function removeListener(_0x375e8b,_0x137501){return function(){ChatMessageEvents[_0xf2ca('0x2')](_0x375e8b,_0x137501);};}exports[_0xf2ca('0x3')]=function(_0x51372a){for(var _0x8ce770=0x0,_0x4292b4=events[_0xf2ca('0x4')];_0x8ce770<_0x4292b4;_0x8ce770++){var _0x57e3e8=events[_0x8ce770];var _0x4ea38c=createListener(_0xf2ca('0x5')+_0x57e3e8,_0x51372a);ChatMessageEvents['on'](_0x57e3e8,_0x4ea38c);}};
\ No newline at end of file
+var _0xf3cc=['update','emit','removeListener','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x1e48d3,_0x5d8c43){var _0x2852b1=function(_0x11d7b3){while(--_0x11d7b3){_0x1e48d3['push'](_0x1e48d3['shift']());}};_0x2852b1(++_0x5d8c43);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x46939d,_0xc1b36d){_0x46939d=_0x46939d-0x0;var _0x5105e8=_0xf3cc[_0x46939d];return _0x5105e8;};'use strict';var ChatMessageEvents=require(_0xcf3c('0x0'));var events=[_0xcf3c('0x1'),_0xcf3c('0x2'),_0xcf3c('0x3')];function createListener(_0x48d2a6,_0x3b60ce){return function(_0x14ec9a){_0x3b60ce[_0xcf3c('0x4')](_0x48d2a6,_0x14ec9a);};}function removeListener(_0x582153,_0x2e0b47){return function(){ChatMessageEvents[_0xcf3c('0x5')](_0x582153,_0x2e0b47);};}exports['register']=function(_0x41f804){for(var _0x2b5cae=0x0,_0x35cb18=events[_0xcf3c('0x6')];_0x2b5cae<_0x35cb18;_0x2b5cae++){var _0x11deda=events[_0x2b5cae];var _0x147e12=createListener(_0xcf3c('0x7')+_0x11deda,_0x41f804);ChatMessageEvents['on'](_0x11deda,_0x147e12);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index fd34c22..d580049 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 _0x33e3=['fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/:id','post','chat','chatmessage:create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x25abad,_0x19f0a3){var _0x3f8903=function(_0x439e08){while(--_0x439e08){_0x25abad['push'](_0x25abad['shift']());}};_0x3f8903(++_0x19f0a3);}(_0x33e3,0x194));var _0x333e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x33e3[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x333e('0x0'));var util=require('util');var path=require(_0x333e('0x1'));var timeout=require(_0x333e('0x2'));var express=require('express');var router=express[_0x333e('0x3')]();var fs_extra=require(_0x333e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x333e('0x5'));var config=require(_0x333e('0x6'));var controller=require(_0x333e('0x7'));router[_0x333e('0x8')]('/',auth[_0x333e('0x9')](),controller[_0x333e('0xa')]);router[_0x333e('0x8')]('/describe',auth[_0x333e('0x9')](),controller['describe']);router[_0x333e('0x8')](_0x333e('0xb'),auth[_0x333e('0x9')](),controller['show']);router[_0x333e('0xc')]('/',auth[_0x333e('0x9')](),interaction['tracked'](_0x333e('0xd'),_0x333e('0xe')),controller['create']);router['put'](_0x333e('0xb'),controller[_0x333e('0xf')]);router[_0x333e('0x10')](_0x333e('0x11'),auth[_0x333e('0x9')](),controller[_0x333e('0x12')]);router['put'](_0x333e('0x13'),auth[_0x333e('0x9')](),controller[_0x333e('0x14')]);router[_0x333e('0x15')](_0x333e('0xb'),auth['isAuthenticated'](),controller[_0x333e('0x16')]);module[_0x333e('0x17')]=router;
\ No newline at end of file
+var _0xf961=['show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x290dc1,_0x27decd){var _0x13d597=function(_0x1f2d11){while(--_0x1f2d11){_0x290dc1['push'](_0x290dc1['shift']());}};_0x13d597(++_0x27decd);}(_0xf961,0x68));var _0x1f96=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xf961[_0x243b2f];return _0xcb3c2d;};'use strict';var multer=require(_0x1f96('0x0'));var util=require(_0x1f96('0x1'));var path=require(_0x1f96('0x2'));var timeout=require(_0x1f96('0x3'));var express=require('express');var router=express[_0x1f96('0x4')]();var fs_extra=require(_0x1f96('0x5'));var auth=require(_0x1f96('0x6'));var interaction=require(_0x1f96('0x7'));var config=require(_0x1f96('0x8'));var controller=require(_0x1f96('0x9'));router[_0x1f96('0xa')]('/',auth[_0x1f96('0xb')](),controller[_0x1f96('0xc')]);router[_0x1f96('0xa')](_0x1f96('0xd'),auth['isAuthenticated'](),controller[_0x1f96('0xe')]);router[_0x1f96('0xa')](_0x1f96('0xf'),auth[_0x1f96('0xb')](),controller[_0x1f96('0x10')]);router[_0x1f96('0x11')]('/',auth[_0x1f96('0xb')](),interaction[_0x1f96('0x12')](_0x1f96('0x13'),_0x1f96('0x14')),controller[_0x1f96('0x15')]);router[_0x1f96('0x16')](_0x1f96('0xf'),controller[_0x1f96('0x17')]);router[_0x1f96('0x16')](_0x1f96('0x18'),auth[_0x1f96('0xb')](),controller[_0x1f96('0x19')]);router[_0x1f96('0x16')]('/:id/reject',auth[_0x1f96('0xb')](),controller[_0x1f96('0x1a')]);router[_0x1f96('0x1b')]('/:id',auth[_0x1f96('0xb')](),controller[_0x1f96('0x1c')]);module[_0x1f96('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 8ab366c..7005f07 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 _0x757a=['exports','TEXT'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x757a,0xde));var _0xa757=function(_0x1f6404,_0x37e8b6){_0x1f6404=_0x1f6404-0x0;var _0x235f56=_0x757a[_0x1f6404];return _0x235f56;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x409682,_0x370090){_0x409682=_0x409682-0x0;var _0x1ee901=_0x0b0e[_0x409682];return _0x1ee901;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 57ae78f..a899547 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x968120,_0x31a9ce){var _0x4925d0=function(_0x5d4834){while(--_0x5d4834){_0x968120['push'](_0x968120['shift']());}};_0x4925d0(++_0x31a9ce);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _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(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x7a54,0x106));var _0x47a5=function(_0x735ea2,_0x25d9cb){_0x735ea2=_0x735ea2-0x0;var _0x271167=_0x7a54[_0x735ea2];return _0x271167;};'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 e4bf32d..989456e 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 _0x39c7=['save','update','remove','hasOwnProperty','hook','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x3e4a34,_0x452723){var _0x2d2d2e=function(_0x1378ec){while(--_0x1378ec){_0x3e4a34['push'](_0x3e4a34['shift']());}};_0x2d2d2e(++_0x452723);}(_0x39c7,0x85));var _0x739c=function(_0x14ec1f,_0x59ef2f){_0x14ec1f=_0x14ec1f-0x0;var _0x5cecb3=_0x39c7[_0x14ec1f];return _0x5cecb3;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x739c('0x0'))['db'][_0x739c('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x739c('0x2')](0x0);var events={'afterCreate':_0x739c('0x3'),'afterUpdate':_0x739c('0x4'),'afterDestroy':_0x739c('0x5')};function emitEvent(_0x48c547){return function(_0x11c0a6,_0xff8215,_0x43dd74){ChatOfflineMessageEvents['emit'](_0x48c547+':'+_0x11c0a6['id'],_0x11c0a6);ChatOfflineMessageEvents['emit'](_0x48c547,_0x11c0a6);_0x43dd74(null);};}for(var e in events){if(events[_0x739c('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x739c('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xab13=['emit','hasOwnProperty','hook','exports','events','ChatOfflineMessage','save','update','remove'];(function(_0x13039,_0x19f3fe){var _0x52a0e3=function(_0x107cc3){while(--_0x107cc3){_0x13039['push'](_0x13039['shift']());}};_0x52a0e3(++_0x19f3fe);}(_0xab13,0x8b));var _0x3ab1=function(_0x11c913,_0x1c6f22){_0x11c913=_0x11c913-0x0;var _0x5ba6eb=_0xab13[_0x11c913];return _0x5ba6eb;};'use strict';var EventEmitter=require(_0x3ab1('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x3ab1('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3ab1('0x2'),'afterUpdate':_0x3ab1('0x3'),'afterDestroy':_0x3ab1('0x4')};function emitEvent(_0x59262c){return function(_0x49ff19,_0x87151e,_0xb90526){ChatOfflineMessageEvents[_0x3ab1('0x5')](_0x59262c+':'+_0x49ff19['id'],_0x49ff19);ChatOfflineMessageEvents[_0x3ab1('0x5')](_0x59262c,_0x49ff19);_0xb90526(null);};}for(var e in events){if(events[_0x3ab1('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x3ab1('0x7')](e,emitEvent(event));}}module[_0x3ab1('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 8a2d7db..404aac7 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 _0x0360=['./chatOfflineMessage.attributes','exports','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x504f4a,_0x523da1){var _0x1b029f=function(_0x3f18a4){while(--_0x3f18a4){_0x504f4a['push'](_0x504f4a['shift']());}};_0x1b029f(++_0x523da1);}(_0x0360,0x15e));var _0x0036=function(_0xd9d48b,_0x5389be){_0xd9d48b=_0xd9d48b-0x0;var _0x44973c=_0x0360[_0xd9d48b];return _0x44973c;};'use strict';var attributes=require(_0x0036('0x0'));module[_0x0036('0x1')]=function(_0x356a41){return _0x356a41['define'](_0x0036('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0036('0x3'),'collate':_0x0036('0x4')});};
\ No newline at end of file
+var _0x0b7d=['utf8mb4','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b7d,0x79));var _0xd0b7=function(_0x50d471,_0x2d9086){_0x50d471=_0x50d471-0x0;var _0x214900=_0x0b7d[_0x50d471];return _0x214900;};'use strict';var attributes=require(_0xd0b7('0x0'));module[_0xd0b7('0x1')]=function(_0x4c21ee){return _0x4c21ee[_0xd0b7('0x2')](_0xd0b7('0x3'),attributes,{'tableName':_0xd0b7('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd0b7('0x5'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 06c3aa7..38809d1 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 _0x55a8=['debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0xab1898,_0x535f14){var _0x3a9c70=function(_0x57bb36){while(--_0x57bb36){_0xab1898['push'](_0xab1898['shift']());}};_0x3a9c70(++_0x535f14);}(_0x55a8,0x148));var _0x855a=function(_0x20af9d,_0x295b){_0x20af9d=_0x20af9d-0x0;var _0x292bf8=_0x55a8[_0x20af9d];return _0x292bf8;};'use strict';var _=require(_0x855a('0x0'));var util=require(_0x855a('0x1'));var moment=require(_0x855a('0x2'));var BPromise=require(_0x855a('0x3'));var rs=require(_0x855a('0x4'));var fs=require('fs');var Redis=require(_0x855a('0x5'));var db=require(_0x855a('0x6'))['db'];var utils=require(_0x855a('0x7'));var logger=require(_0x855a('0x8'))(_0x855a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x855a('0xa')][_0x855a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c579b,_0x5908d6,_0x336987){return new BPromise(function(_0xd30379,_0x3a038b){return client[_0x855a('0xc')](_0x5c579b,_0x336987)[_0x855a('0xd')](function(_0x2b26a6){logger[_0x855a('0xe')](_0x855a('0xf'),_0x5908d6,_0x855a('0x10'));logger[_0x855a('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5908d6,_0x855a('0x10'),JSON[_0x855a('0x12')](_0x2b26a6));if(_0x2b26a6['error']){if(_0x2b26a6[_0x855a('0x13')]['code']===0x1f4){logger[_0x855a('0x13')](_0x855a('0xf'),_0x5908d6,_0x2b26a6[_0x855a('0x13')][_0x855a('0x14')]);return _0x3a038b(_0x2b26a6[_0x855a('0x13')][_0x855a('0x14')]);}logger[_0x855a('0x13')](_0x855a('0xf'),_0x5908d6,_0x2b26a6[_0x855a('0x13')][_0x855a('0x14')]);return _0xd30379(_0x2b26a6[_0x855a('0x13')][_0x855a('0x14')]);}else{logger[_0x855a('0xe')](_0x855a('0xf'),_0x5908d6,_0x855a('0x10'));_0xd30379(_0x2b26a6[_0x855a('0x15')][_0x855a('0x14')]);}})[_0x855a('0x16')](function(_0x33d9cb){logger[_0x855a('0x13')](_0x855a('0xf'),_0x5908d6,_0x33d9cb);_0x3a038b(_0x33d9cb);});});}
\ No newline at end of file
+var _0xde15=['http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client'];(function(_0x7a68b,_0x964789){var _0x110d37=function(_0x482401){while(--_0x482401){_0x7a68b['push'](_0x7a68b['shift']());}};_0x110d37(++_0x964789);}(_0xde15,0x148));var _0x5de1=function(_0x3b4db4,_0x322fb8){_0x3b4db4=_0x3b4db4-0x0;var _0x532180=_0xde15[_0x3b4db4];return _0x532180;};'use strict';var _=require(_0x5de1('0x0'));var util=require('util');var moment=require(_0x5de1('0x1'));var BPromise=require(_0x5de1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5de1('0x3'));var db=require(_0x5de1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5de1('0x5'))(_0x5de1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5de1('0x7')][_0x5de1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x851ac3,_0x391db2,_0x1b3512){return new BPromise(function(_0x3baddc,_0x162350){return client[_0x5de1('0x9')](_0x851ac3,_0x1b3512)[_0x5de1('0xa')](function(_0x3c5133){logger[_0x5de1('0xb')](_0x5de1('0xc'),_0x391db2,_0x5de1('0xd'));logger['debug'](_0x5de1('0xe'),_0x391db2,_0x5de1('0xd'),JSON[_0x5de1('0xf')](_0x3c5133));if(_0x3c5133[_0x5de1('0x10')]){if(_0x3c5133[_0x5de1('0x10')][_0x5de1('0x11')]===0x1f4){logger[_0x5de1('0x10')](_0x5de1('0xc'),_0x391db2,_0x3c5133['error'][_0x5de1('0x12')]);return _0x162350(_0x3c5133['error']['message']);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x391db2,_0x3c5133[_0x5de1('0x10')][_0x5de1('0x12')]);return _0x3baddc(_0x3c5133[_0x5de1('0x10')]['message']);}else{logger[_0x5de1('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x391db2,_0x5de1('0xd'));_0x3baddc(_0x3c5133[_0x5de1('0x13')][_0x5de1('0x12')]);}})[_0x5de1('0x14')](function(_0x132a68){logger[_0x5de1('0x10')](_0x5de1('0xc'),_0x391db2,_0x132a68);_0x162350(_0x132a68);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 32b777c..9cf0b97 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 _0x5bc7=['isAuthenticated','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','describe','/:id'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x5bc7,0x125));var _0x75bc=function(_0x583aa4,_0x42ba7e){_0x583aa4=_0x583aa4-0x0;var _0x4f8b7e=_0x5bc7[_0x583aa4];return _0x4f8b7e;};'use strict';var multer=require(_0x75bc('0x0'));var util=require('util');var path=require(_0x75bc('0x1'));var timeout=require(_0x75bc('0x2'));var express=require(_0x75bc('0x3'));var router=express['Router']();var fs_extra=require(_0x75bc('0x4'));var auth=require(_0x75bc('0x5'));var interaction=require(_0x75bc('0x6'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x75bc('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x75bc('0x7')](_0x75bc('0x8'),auth['isAuthenticated'](),controller[_0x75bc('0x9')]);router['get'](_0x75bc('0xa'),auth[_0x75bc('0xb')](),controller[_0x75bc('0xc')]);router[_0x75bc('0xd')]('/',auth[_0x75bc('0xb')](),controller[_0x75bc('0xe')]);router[_0x75bc('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x75bc('0x10')]);router[_0x75bc('0x11')](_0x75bc('0xa'),auth[_0x75bc('0xb')](),controller['destroy']);module[_0x75bc('0x12')]=router;
\ No newline at end of file
+var _0x73db=['/describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index'];(function(_0x500c0,_0xdb6a03){var _0xdd146f=function(_0x2e8090){while(--_0x2e8090){_0x500c0['push'](_0x500c0['shift']());}};_0xdd146f(++_0xdb6a03);}(_0x73db,0x1ec));var _0xb73d=function(_0x35984f,_0x499c98){_0x35984f=_0x35984f-0x0;var _0x5b7bb3=_0x73db[_0x35984f];return _0x5b7bb3;};'use strict';var multer=require(_0xb73d('0x0'));var util=require('util');var path=require(_0xb73d('0x1'));var timeout=require('connect-timeout');var express=require(_0xb73d('0x2'));var router=express[_0xb73d('0x3')]();var fs_extra=require(_0xb73d('0x4'));var auth=require(_0xb73d('0x5'));var interaction=require(_0xb73d('0x6'));var config=require(_0xb73d('0x7'));var controller=require(_0xb73d('0x8'));router[_0xb73d('0x9')]('/',auth[_0xb73d('0xa')](),controller[_0xb73d('0xb')]);router[_0xb73d('0x9')](_0xb73d('0xc'),auth[_0xb73d('0xa')](),controller['describe']);router[_0xb73d('0x9')](_0xb73d('0xd'),auth[_0xb73d('0xa')](),controller[_0xb73d('0xe')]);router[_0xb73d('0xf')]('/',auth[_0xb73d('0xa')](),controller[_0xb73d('0x10')]);router['put']('/:id',auth[_0xb73d('0xa')](),controller[_0xb73d('0x11')]);router[_0xb73d('0x12')](_0xb73d('0xd'),auth[_0xb73d('0xa')](),controller[_0xb73d('0x13')]);module[_0xb73d('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index c14cb0d..b29ac00 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 _0xec46=['exports','STRING','ENUM','INTEGER','sequelize'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xec46,0xf4));var _0x6ec4=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0xec46[_0x2f5a22];return _0x326b70;};'use strict';var Sequelize=require(_0x6ec4('0x0'));module[_0x6ec4('0x1')]={'name':{'type':Sequelize[_0x6ec4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6ec4('0x3')]('mouseOver','timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x6ec4('0x2')]},'timeout':{'type':Sequelize[_0x6ec4('0x4')]}};
\ No newline at end of file
+var _0x1ebd=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x2c504e,_0x380208){var _0x2fc226=function(_0x4b893a){while(--_0x4b893a){_0x2c504e['push'](_0x2c504e['shift']());}};_0x2fc226(++_0x380208);}(_0x1ebd,0x155));var _0xd1eb=function(_0x5804d7,_0x2461bf){_0x5804d7=_0x5804d7-0x0;var _0x15cad0=_0x1ebd[_0x5804d7];return _0x15cad0;};'use strict';var Sequelize=require(_0xd1eb('0x0'));module[_0xd1eb('0x1')]={'name':{'type':Sequelize[_0xd1eb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd1eb('0x3')](_0xd1eb('0x4'),_0xd1eb('0x5')),'defaultValue':_0xd1eb('0x4')},'selector':{'type':Sequelize[_0xd1eb('0x2')]},'timeout':{'type':Sequelize[_0xd1eb('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 4e358f1..e891936 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 _0x83d3=['bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','show','params','keys','query','intersection','model','attributes','fields','length','includeAll','merge','ChatProactiveAction','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x28c8cb,_0x5895e1){var _0x365af1=function(_0x12b9bd){while(--_0x12b9bd){_0x28c8cb['push'](_0x28c8cb['shift']());}};_0x365af1(++_0x5895e1);}(_0x83d3,0x17c));var _0x383d=function(_0x36da00,_0x5b533b){_0x36da00=_0x36da00-0x0;var _0x4b72c5=_0x83d3[_0x36da00];return _0x4b72c5;};'use strict';var emlformat=require(_0x383d('0x0'));var rimraf=require(_0x383d('0x1'));var zipdir=require(_0x383d('0x2'));var jsonpatch=require(_0x383d('0x3'));var rp=require(_0x383d('0x4'));var moment=require('moment');var BPromise=require(_0x383d('0x5'));var Mustache=require(_0x383d('0x6'));var util=require(_0x383d('0x7'));var path=require(_0x383d('0x8'));var sox=require('sox');var csv=require(_0x383d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x383d('0xa'));var squel=require(_0x383d('0xb'));var crypto=require(_0x383d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x383d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x383d('0xe'));var Redis=require(_0x383d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x383d('0x10'));var as=require(_0x383d('0x11'));var hardwareService=require(_0x383d('0x12'));var logger=require(_0x383d('0x13'))(_0x383d('0x14'));var utils=require(_0x383d('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15e7cf,_0x538c32){_0x538c32=_0x538c32||0xcc;return function(_0x3d5b63){if(_0x3d5b63){return _0x15e7cf[_0x383d('0x16')](_0x538c32);}return _0x15e7cf[_0x383d('0x17')](_0x538c32)[_0x383d('0x18')]();};}function respondWithResult(_0x4c6d4f,_0x556fee){_0x556fee=_0x556fee||0xc8;return function(_0x3999d7){if(_0x3999d7){return _0x4c6d4f['status'](_0x556fee)[_0x383d('0x19')](_0x3999d7);}};}function respondWithFilteredResult(_0x5afc53,_0x531e18){return function(_0x294423){if(_0x294423){var _0x31abf5=typeof _0x531e18['offset']==='undefined'&&typeof _0x531e18[_0x383d('0x1a')]===_0x383d('0x1b');var _0x5be3d7=_0x294423[_0x383d('0x1c')];var _0x18dc97=_0x31abf5?0x0:_0x531e18[_0x383d('0x1d')];var _0xc7868=_0x31abf5?_0x294423[_0x383d('0x1c')]:_0x531e18[_0x383d('0x1d')]+_0x531e18[_0x383d('0x1a')];var _0x55fb74;if(_0xc7868>=_0x5be3d7){_0xc7868=_0x5be3d7;_0x55fb74=0xc8;}else{_0x55fb74=0xce;}_0x5afc53[_0x383d('0x17')](_0x55fb74);return _0x5afc53[_0x383d('0x1e')](_0x383d('0x1f'),_0x18dc97+'-'+_0xc7868+'/'+_0x5be3d7)[_0x383d('0x19')](_0x294423);}return null;};}function patchUpdates(_0x2043e5){return function(_0x45ee85){try{jsonpatch[_0x383d('0x20')](_0x45ee85,_0x2043e5,!![]);}catch(_0x562a28){return BPromise['reject'](_0x562a28);}return _0x45ee85[_0x383d('0x21')]();};}function saveUpdates(_0x28b880,_0x4e3d9e){return function(_0x17d883){if(_0x17d883){return _0x17d883[_0x383d('0x22')](_0x28b880)[_0x383d('0x23')](function(_0x45d1a1){return _0x45d1a1;});}return null;};}function removeEntity(_0x3e36a2,_0x376ea7){return function(_0xcbedc9){if(_0xcbedc9){return _0xcbedc9[_0x383d('0x24')]()[_0x383d('0x23')](function(){_0x3e36a2[_0x383d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x599756,_0x1d5a10){return function(_0x1e5a7f){if(!_0x1e5a7f){_0x599756[_0x383d('0x16')](0x194);}return _0x1e5a7f;};}function handleError(_0x70fdba,_0x267643){_0x267643=_0x267643||0x1f4;return function(_0x1d553b){logger[_0x383d('0x25')](_0x1d553b['stack']);if(_0x1d553b[_0x383d('0x26')]){delete _0x1d553b[_0x383d('0x26')];}_0x70fdba['status'](_0x267643)['send'](_0x1d553b);};}exports[_0x383d('0x27')]=function(_0x3f86e2,_0x13f872){var _0xbe4a1f={'raw':!![],'where':{'id':_0x3f86e2[_0x383d('0x28')]['id']}},_0x202853={};_0x202853['model']=_[_0x383d('0x29')](db['ChatProactiveAction']['rawAttributes']);_0x202853[_0x383d('0x2a')]=_[_0x383d('0x29')](_0x3f86e2[_0x383d('0x2a')]);_0x202853['filters']=_[_0x383d('0x2b')](_0x202853[_0x383d('0x2c')],_0x202853['query']);_0xbe4a1f[_0x383d('0x2d')]=_[_0x383d('0x2b')](_0x202853['model'],qs[_0x383d('0x2e')](_0x3f86e2['query'][_0x383d('0x2e')]));_0xbe4a1f[_0x383d('0x2d')]=_0xbe4a1f['attributes'][_0x383d('0x2f')]?_0xbe4a1f['attributes']:_0x202853[_0x383d('0x2c')];if(_0x3f86e2['query'][_0x383d('0x30')]){_0xbe4a1f['include']=[{'all':!![]}];}_0xbe4a1f=_[_0x383d('0x31')]({},_0xbe4a1f,_0x3f86e2['options']);return db[_0x383d('0x32')][_0x383d('0x33')](_0xbe4a1f)[_0x383d('0x23')](handleEntityNotFound(_0x13f872,null))[_0x383d('0x23')](respondWithResult(_0x13f872,null))['catch'](handleError(_0x13f872,null));};exports[_0x383d('0x34')]=function(_0x5379cc,_0x23aeb4){return db[_0x383d('0x32')][_0x383d('0x34')](_0x5379cc[_0x383d('0x35')],{})[_0x383d('0x23')](respondWithResult(_0x23aeb4,0xc9))[_0x383d('0x36')](handleError(_0x23aeb4,null));};exports['update']=function(_0x386f89,_0x5cc6c4){if(_0x386f89[_0x383d('0x35')]['id']){delete _0x386f89['body']['id'];}return db[_0x383d('0x32')][_0x383d('0x33')]({'where':{'id':_0x386f89[_0x383d('0x28')]['id']}})['then'](handleEntityNotFound(_0x5cc6c4,null))[_0x383d('0x23')](saveUpdates(_0x386f89[_0x383d('0x35')],null))[_0x383d('0x23')](respondWithResult(_0x5cc6c4,null))['catch'](handleError(_0x5cc6c4,null));};exports[_0x383d('0x24')]=function(_0x51aa4c,_0x38f783){return db[_0x383d('0x32')]['find']({'where':{'id':_0x51aa4c['params']['id']}})[_0x383d('0x23')](handleEntityNotFound(_0x38f783,null))[_0x383d('0x23')](removeEntity(_0x38f783,null))[_0x383d('0x36')](handleError(_0x38f783,null));};
\ No newline at end of file
+var _0x0e85=['length','include','options','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0e85,0x7c));var _0x50e8=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x0e85[_0x29d915];return _0x160f86;};'use strict';var emlformat=require(_0x50e8('0x0'));var rimraf=require(_0x50e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50e8('0x2'));var rp=require(_0x50e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50e8('0x4'));var path=require('path');var sox=require(_0x50e8('0x5'));var csv=require(_0x50e8('0x6'));var ejs=require(_0x50e8('0x7'));var fs=require('fs');var fs_extra=require(_0x50e8('0x8'));var _=require('lodash');var squel=require(_0x50e8('0x9'));var crypto=require(_0x50e8('0xa'));var jsforce=require(_0x50e8('0xb'));var deskjs=require(_0x50e8('0xc'));var toCsv=require(_0x50e8('0x6'));var querystring=require(_0x50e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e8('0xe'));var authService=require(_0x50e8('0xf'));var qs=require(_0x50e8('0x10'));var as=require(_0x50e8('0x11'));var hardwareService=require(_0x50e8('0x12'));var logger=require(_0x50e8('0x13'))(_0x50e8('0x14'));var utils=require(_0x50e8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50e8('0x16'))['db'];function respondWithStatusCode(_0x24d381,_0x508377){_0x508377=_0x508377||0xcc;return function(_0x49e02f){if(_0x49e02f){return _0x24d381[_0x50e8('0x17')](_0x508377);}return _0x24d381[_0x50e8('0x18')](_0x508377)[_0x50e8('0x19')]();};}function respondWithResult(_0x473aa7,_0x54efd3){_0x54efd3=_0x54efd3||0xc8;return function(_0x18596f){if(_0x18596f){return _0x473aa7[_0x50e8('0x18')](_0x54efd3)[_0x50e8('0x1a')](_0x18596f);}};}function respondWithFilteredResult(_0x5c3baa,_0x5524a3){return function(_0x30a872){if(_0x30a872){var _0xf02b48=typeof _0x5524a3[_0x50e8('0x1b')]===_0x50e8('0x1c')&&typeof _0x5524a3[_0x50e8('0x1d')]===_0x50e8('0x1c');var _0x5642bf=_0x30a872['count'];var _0x441f25=_0xf02b48?0x0:_0x5524a3[_0x50e8('0x1b')];var _0x40d060=_0xf02b48?_0x30a872[_0x50e8('0x1e')]:_0x5524a3[_0x50e8('0x1b')]+_0x5524a3[_0x50e8('0x1d')];var _0x1a451d;if(_0x40d060>=_0x5642bf){_0x40d060=_0x5642bf;_0x1a451d=0xc8;}else{_0x1a451d=0xce;}_0x5c3baa['status'](_0x1a451d);return _0x5c3baa[_0x50e8('0x1f')]('Content-Range',_0x441f25+'-'+_0x40d060+'/'+_0x5642bf)[_0x50e8('0x1a')](_0x30a872);}return null;};}function patchUpdates(_0xe04a5c){return function(_0xd263d){try{jsonpatch[_0x50e8('0x20')](_0xd263d,_0xe04a5c,!![]);}catch(_0x46af8e){return BPromise['reject'](_0x46af8e);}return _0xd263d[_0x50e8('0x21')]();};}function saveUpdates(_0x1e4e0d,_0x58110d){return function(_0x31d23c){if(_0x31d23c){return _0x31d23c[_0x50e8('0x22')](_0x1e4e0d)['then'](function(_0x1ce7fc){return _0x1ce7fc;});}return null;};}function removeEntity(_0xe7e56c,_0x4f56b7){return function(_0x47a3d8){if(_0x47a3d8){return _0x47a3d8['destroy']()[_0x50e8('0x23')](function(){_0xe7e56c[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();});}};}function handleEntityNotFound(_0x371a1f,_0xc2f832){return function(_0x13b6e9){if(!_0x13b6e9){_0x371a1f['sendStatus'](0x194);}return _0x13b6e9;};}function handleError(_0x3a6442,_0x396611){_0x396611=_0x396611||0x1f4;return function(_0x4b3a09){logger[_0x50e8('0x24')](_0x4b3a09[_0x50e8('0x25')]);if(_0x4b3a09[_0x50e8('0x26')]){delete _0x4b3a09[_0x50e8('0x26')];}_0x3a6442['status'](_0x396611)[_0x50e8('0x27')](_0x4b3a09);};}exports['show']=function(_0x30fedf,_0x39c0c6){var _0x42bbef={'raw':!![],'where':{'id':_0x30fedf[_0x50e8('0x28')]['id']}},_0x4f0b88={};_0x4f0b88[_0x50e8('0x29')]=_[_0x50e8('0x2a')](db[_0x50e8('0x2b')][_0x50e8('0x2c')]);_0x4f0b88[_0x50e8('0x2d')]=_[_0x50e8('0x2a')](_0x30fedf['query']);_0x4f0b88[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](_0x4f0b88['model'],_0x4f0b88['query']);_0x42bbef[_0x50e8('0x30')]=_[_0x50e8('0x2f')](_0x4f0b88[_0x50e8('0x29')],qs['fields'](_0x30fedf['query'][_0x50e8('0x31')]));_0x42bbef[_0x50e8('0x30')]=_0x42bbef['attributes'][_0x50e8('0x32')]?_0x42bbef[_0x50e8('0x30')]:_0x4f0b88[_0x50e8('0x29')];if(_0x30fedf[_0x50e8('0x2d')]['includeAll']){_0x42bbef[_0x50e8('0x33')]=[{'all':!![]}];}_0x42bbef=_['merge']({},_0x42bbef,_0x30fedf[_0x50e8('0x34')]);return db[_0x50e8('0x2b')][_0x50e8('0x35')](_0x42bbef)['then'](handleEntityNotFound(_0x39c0c6,null))[_0x50e8('0x23')](respondWithResult(_0x39c0c6,null))[_0x50e8('0x36')](handleError(_0x39c0c6,null));};exports['create']=function(_0x245b45,_0x1c2fdb){return db[_0x50e8('0x2b')][_0x50e8('0x37')](_0x245b45['body'],{})[_0x50e8('0x23')](respondWithResult(_0x1c2fdb,0xc9))[_0x50e8('0x36')](handleError(_0x1c2fdb,null));};exports[_0x50e8('0x22')]=function(_0x4e2a37,_0x5e556c){if(_0x4e2a37[_0x50e8('0x38')]['id']){delete _0x4e2a37[_0x50e8('0x38')]['id'];}return db[_0x50e8('0x2b')]['find']({'where':{'id':_0x4e2a37['params']['id']}})['then'](handleEntityNotFound(_0x5e556c,null))[_0x50e8('0x23')](saveUpdates(_0x4e2a37[_0x50e8('0x38')],null))[_0x50e8('0x23')](respondWithResult(_0x5e556c,null))[_0x50e8('0x36')](handleError(_0x5e556c,null));};exports[_0x50e8('0x39')]=function(_0x18986f,_0xb566c2){return db[_0x50e8('0x2b')][_0x50e8('0x35')]({'where':{'id':_0x18986f[_0x50e8('0x28')]['id']}})['then'](handleEntityNotFound(_0xb566c2,null))[_0x50e8('0x23')](removeEntity(_0xb566c2,null))[_0x50e8('0x36')](handleError(_0xb566c2,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index ce6a2d6..9466792 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 _0xc491=['./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x95612a,_0x5e6fbc){var _0x38de09=function(_0xaaf990){while(--_0xaaf990){_0x95612a['push'](_0x95612a['shift']());}};_0x38de09(++_0x5e6fbc);}(_0xc491,0x1a8));var _0x1c49=function(_0x2c6810,_0x23c079){_0x2c6810=_0x2c6810-0x0;var _0x213881=_0xc491[_0x2c6810];return _0x213881;};'use strict';var _=require(_0x1c49('0x0'));var util=require(_0x1c49('0x1'));var logger=require(_0x1c49('0x2'))(_0x1c49('0x3'));var moment=require(_0x1c49('0x4'));var BPromise=require(_0x1c49('0x5'));var rp=require(_0x1c49('0x6'));var fs=require('fs');var path=require(_0x1c49('0x7'));var rimraf=require(_0x1c49('0x8'));var config=require(_0x1c49('0x9'));var attributes=require(_0x1c49('0xa'));module['exports']=function(_0x4dde76,_0x308f17){return _0x4dde76[_0x1c49('0xb')](_0x1c49('0xc'),attributes,{'tableName':_0x1c49('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa04e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x167a7,_0x386464){var _0x32991a=function(_0xf6d675){while(--_0xf6d675){_0x167a7['push'](_0x167a7['shift']());}};_0x32991a(++_0x386464);}(_0xa04e,0x1ad));var _0xea04=function(_0x53a142,_0x3498b0){_0x53a142=_0x53a142-0x0;var _0x461127=_0xa04e[_0x53a142];return _0x461127;};'use strict';var _=require(_0xea04('0x0'));var util=require(_0xea04('0x1'));var logger=require(_0xea04('0x2'))(_0xea04('0x3'));var moment=require(_0xea04('0x4'));var BPromise=require(_0xea04('0x5'));var rp=require(_0xea04('0x6'));var fs=require('fs');var path=require(_0xea04('0x7'));var rimraf=require('rimraf');var config=require(_0xea04('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0xea04('0x9')]=function(_0x30d672,_0x973b81){return _0x30d672[_0xea04('0xa')](_0xea04('0xb'),attributes,{'tableName':_0xea04('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index fbb4663..ca991e4 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 _0xf8d2=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x274d4b,_0x128681){var _0x1a1f03=function(_0x420675){while(--_0x420675){_0x274d4b['push'](_0x274d4b['shift']());}};_0x1a1f03(++_0x128681);}(_0xf8d2,0x162));var _0x2f8d=function(_0x3f0a7c,_0x16edda){_0x3f0a7c=_0x3f0a7c-0x0;var _0x2b3a28=_0xf8d2[_0x3f0a7c];return _0x2b3a28;};'use strict';var _=require(_0x2f8d('0x0'));var util=require(_0x2f8d('0x1'));var moment=require(_0x2f8d('0x2'));var BPromise=require(_0x2f8d('0x3'));var rs=require(_0x2f8d('0x4'));var fs=require('fs');var Redis=require(_0x2f8d('0x5'));var db=require(_0x2f8d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f8d('0x7'))(_0x2f8d('0x8'));var config=require(_0x2f8d('0x9'));var jayson=require(_0x2f8d('0xa'));var client=jayson['client'][_0x2f8d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52f9fc,_0x4705b6,_0x2bd0b1){return new BPromise(function(_0x409128,_0x4108b1){return client[_0x2f8d('0xc')](_0x52f9fc,_0x2bd0b1)[_0x2f8d('0xd')](function(_0x10a487){logger[_0x2f8d('0xe')](_0x2f8d('0xf'),_0x4705b6,_0x2f8d('0x10'));logger[_0x2f8d('0x11')](_0x2f8d('0x12'),_0x4705b6,_0x2f8d('0x10'),JSON[_0x2f8d('0x13')](_0x10a487));if(_0x10a487[_0x2f8d('0x14')]){if(_0x10a487[_0x2f8d('0x14')][_0x2f8d('0x15')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4705b6,_0x10a487[_0x2f8d('0x14')]['message']);return _0x4108b1(_0x10a487['error'][_0x2f8d('0x16')]);}logger[_0x2f8d('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x4705b6,_0x10a487[_0x2f8d('0x14')]['message']);return _0x409128(_0x10a487[_0x2f8d('0x14')]['message']);}else{logger['info'](_0x2f8d('0xf'),_0x4705b6,_0x2f8d('0x10'));_0x409128(_0x10a487[_0x2f8d('0x17')][_0x2f8d('0x16')]);}})[_0x2f8d('0x18')](function(_0x516dd5){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4705b6,_0x516dd5);_0x4108b1(_0x516dd5);});});}
\ No newline at end of file
+var _0xbce4=['code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','stringify','error'];(function(_0x11e05d,_0x3a4491){var _0x335588=function(_0x35ec3f){while(--_0x35ec3f){_0x11e05d['push'](_0x11e05d['shift']());}};_0x335588(++_0x3a4491);}(_0xbce4,0x83));var _0x4bce=function(_0x4c13ca,_0xfad5da){_0x4c13ca=_0x4c13ca-0x0;var _0x17b3d6=_0xbce4[_0x4c13ca];return _0x17b3d6;};'use strict';var _=require(_0x4bce('0x0'));var util=require(_0x4bce('0x1'));var moment=require('moment');var BPromise=require(_0x4bce('0x2'));var rs=require(_0x4bce('0x3'));var fs=require('fs');var Redis=require(_0x4bce('0x4'));var db=require(_0x4bce('0x5'))['db'];var utils=require(_0x4bce('0x6'));var logger=require(_0x4bce('0x7'))(_0x4bce('0x8'));var config=require(_0x4bce('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4bce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40e59c,_0x1df39e,_0x14b723){return new BPromise(function(_0x3f193b,_0x2a33f8){return client[_0x4bce('0xb')](_0x40e59c,_0x14b723)['then'](function(_0x3164a1){logger[_0x4bce('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x1df39e,_0x4bce('0xd'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1df39e,_0x4bce('0xd'),JSON[_0x4bce('0xe')](_0x3164a1));if(_0x3164a1[_0x4bce('0xf')]){if(_0x3164a1[_0x4bce('0xf')][_0x4bce('0x10')]===0x1f4){logger[_0x4bce('0xf')](_0x4bce('0x11'),_0x1df39e,_0x3164a1[_0x4bce('0xf')][_0x4bce('0x12')]);return _0x2a33f8(_0x3164a1[_0x4bce('0xf')][_0x4bce('0x12')]);}logger['error'](_0x4bce('0x11'),_0x1df39e,_0x3164a1['error'][_0x4bce('0x12')]);return _0x3f193b(_0x3164a1['error'][_0x4bce('0x12')]);}else{logger['info'](_0x4bce('0x11'),_0x1df39e,_0x4bce('0xd'));_0x3f193b(_0x3164a1[_0x4bce('0x13')]['message']);}})[_0x4bce('0x14')](function(_0x58d449){logger[_0x4bce('0xf')](_0x4bce('0x11'),_0x1df39e,_0x58d449);_0x2a33f8(_0x58d449);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index c0a4b95..b24f071 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 _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util'];(function(_0x52c30a,_0x40107d){var _0x33a05b=function(_0x404d55){while(--_0x404d55){_0x52c30a['push'](_0x52c30a['shift']());}};_0x33a05b(++_0x40107d);}(_0xf494,0x1c6));var _0x4f49=function(_0x326109,_0x2055e0){_0x326109=_0x326109-0x0;var _0x3302d4=_0xf494[_0x326109];return _0x3302d4;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller['destroy']);module[_0x4f49('0x12')]=router;
\ No newline at end of file
+var _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0xf85f5a,_0x4e8dae){var _0x48408a=function(_0x1ce554){while(--_0x1ce554){_0xf85f5a['push'](_0xf85f5a['shift']());}};_0x48408a(++_0x4e8dae);}(_0xd8fb,0x99));var _0xbd8f=function(_0x590789,_0x13eb39){_0x590789=_0x590789-0x0;var _0x1a4abe=_0xd8fb[_0x590789];return _0x1a4abe;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 861ca7d..a93012f 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 _0x57a3=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x57a3,0xc0));var _0x357a=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x57a3[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0x357a('0x0'));module[_0x357a('0x1')]={'name':{'type':Sequelize[_0x357a('0x2')],'unique':_0x357a('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x357a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x357a('0x5')](_0x357a('0x6'),'beepall',_0x357a('0x7'))}};
\ No newline at end of file
+var _0x0021=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x3de7e0,_0x28cbff){var _0x11d0b3=function(_0xd95412){while(--_0xd95412){_0x3de7e0['push'](_0x3de7e0['shift']());}};_0x11d0b3(++_0x28cbff);}(_0x0021,0x1dc));var _0x1002=function(_0x28014d,_0x383e2f){_0x28014d=_0x28014d-0x0;var _0x2572cc=_0x0021[_0x28014d];return _0x2572cc;};'use strict';var Sequelize=require(_0x1002('0x0'));module[_0x1002('0x1')]={'name':{'type':Sequelize[_0x1002('0x2')],'unique':_0x1002('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1002('0x2')]},'timeout':{'type':Sequelize[_0x1002('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1002('0x5')](_0x1002('0x6'),'beepall',_0x1002('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index c205ab0..0b24dfe 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 _0xa578=['chatPause','createdAt','getTeams','Team','length','sort','addTeams','User','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','includes','all','union','value','removeAgents','addAgents','omit','isArray','userChatQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','getOptions','where','include','rows','catch','show','model','keys','filters','intersection','attributes','fields','query','merge','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','order','pick','ChatQueueId','filter','findAll','findAndCountAll','agent','updatedAt','SIP'];(function(_0x3a7f15,_0x48ac0d){var _0x3b7ec9=function(_0x356ad3){while(--_0x356ad3){_0x3a7f15['push'](_0x3a7f15['shift']());}};_0x3b7ec9(++_0x48ac0d);}(_0xa578,0x19d));var _0x8a57=function(_0x47df4c,_0x55115e){_0x47df4c=_0x47df4c-0x0;var _0x3e3610=_0xa578[_0x47df4c];return _0x3e3610;};'use strict';var BPromise=require(_0x8a57('0x0'));var util=require(_0x8a57('0x1'));var _=require(_0x8a57('0x2'));var squel=require(_0x8a57('0x3'));var Redis=require(_0x8a57('0x4'));var qs=require(_0x8a57('0x5'));var logger=require('../../config/logger')('api');var config=require(_0x8a57('0x6'));var db=require(_0x8a57('0x7'))['db'];config[_0x8a57('0x8')]=_['defaults'](config['redis'],{'host':_0x8a57('0x9'),'port':0x18eb});var socket=require(_0x8a57('0xa'))(new Redis(config[_0x8a57('0x8')]));require('./chatQueue.socket')[_0x8a57('0xb')](socket);function respondWithStatusCode(_0x37d3ea,_0x123346){_0x123346=_0x123346||0xcc;return function(_0x4a7841){if(_0x4a7841){return _0x37d3ea[_0x8a57('0xc')](_0x123346);}return _0x37d3ea[_0x8a57('0xd')](_0x123346)[_0x8a57('0xe')]();};}function respondWithResult(_0xd8efb7,_0xe7623f){_0xe7623f=_0xe7623f||0xc8;return function(_0x1437d6){if(_0x1437d6){return _0xd8efb7[_0x8a57('0xd')](_0xe7623f)['json'](_0x1437d6);}};}function respondWithFilteredResult(_0x28d411,_0xe2b24f){return function(_0x326c7c){if(_0x326c7c){var _0x28c2e2=typeof _0xe2b24f[_0x8a57('0xf')]===_0x8a57('0x10')&&typeof _0xe2b24f[_0x8a57('0x11')]===_0x8a57('0x10');var _0x38ec1d=_0x326c7c[_0x8a57('0x12')];var _0x661cfb=_0x28c2e2?0x0:_0xe2b24f['offset'];var _0x31b5af=_0x28c2e2?_0x326c7c[_0x8a57('0x12')]:_0xe2b24f[_0x8a57('0xf')]+_0xe2b24f['limit'];var _0x3f91c9;if(_0x31b5af>=_0x38ec1d){_0x31b5af=_0x38ec1d;_0x3f91c9=0xc8;}else{_0x3f91c9=0xce;}_0x28d411[_0x8a57('0xd')](_0x3f91c9);return _0x28d411['set'](_0x8a57('0x13'),_0x661cfb+'-'+_0x31b5af+'/'+_0x38ec1d)[_0x8a57('0x14')](_0x326c7c);}return null;};}function saveUpdates(_0x13eb4f){return function(_0x1415f3){if(_0x1415f3){return _0x1415f3[_0x8a57('0x15')](_0x13eb4f)[_0x8a57('0x16')](function(_0x430191){return _0x430191;});}return null;};}function removeEntity(_0x4356a5){return function(_0x2a137c){if(_0x2a137c){return _0x2a137c[_0x8a57('0x17')]()[_0x8a57('0x16')](function(){var _0x52e899=_0x2a137c[_0x8a57('0x18')]({'plain':!![]});var _0xb409b4=_0x8a57('0x19');return db[_0x8a57('0x1a')]['destroy']({'where':{'type':_0xb409b4,'resourceId':_0x52e899['id']}})[_0x8a57('0x16')](function(){return _0x2a137c;});})[_0x8a57('0x16')](function(){_0x4356a5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x75c993){return function(_0x2b9f92){if(!_0x2b9f92){_0x75c993[_0x8a57('0xc')](0x194);}return _0x2b9f92;};}function handleError(_0x395588,_0x61eecb){_0x61eecb=_0x61eecb||0x1f4;return function(_0x18d8d5){logger[_0x8a57('0x1b')](_0x18d8d5[_0x8a57('0x1c')]);if(_0x18d8d5['name']){delete _0x18d8d5[_0x8a57('0x1d')];}_0x395588[_0x8a57('0xd')](_0x61eecb)[_0x8a57('0x1e')](_0x18d8d5);};}exports[_0x8a57('0x1f')]=function(_0x3313fb,_0x3fe7b4){var _0x1d7c6e={};var _0x3c7a99={'count':0x0,'rows':[]};var _0x6c35de=_[_0x8a57('0x20')](db[_0x8a57('0x21')][_0x8a57('0x22')],function(_0x5b5b38){return{'name':_0x5b5b38[_0x8a57('0x23')],'type':_0x5b5b38['type'][_0x8a57('0x24')]};});_0x1d7c6e=qs[_0x8a57('0x25')](_0x6c35de,_0x3313fb);var _0x51a971={'where':_0x1d7c6e[_0x8a57('0x26')]};return db[_0x8a57('0x21')][_0x8a57('0x12')](_0x51a971)[_0x8a57('0x16')](function(_0x2750e1){_0x3c7a99[_0x8a57('0x12')]=_0x2750e1;_0x1d7c6e[_0x8a57('0x27')]=qs['include'](_0x3313fb['query']);return db[_0x8a57('0x21')]['findAll'](_0x1d7c6e);})[_0x8a57('0x16')](function(_0x4e63e8){_0x3c7a99[_0x8a57('0x28')]=_0x4e63e8;return _0x3c7a99;})[_0x8a57('0x16')](respondWithFilteredResult(_0x3fe7b4,_0x1d7c6e))[_0x8a57('0x29')](handleError(_0x3fe7b4,null));};exports[_0x8a57('0x2a')]=function(_0xab4948,_0x454f79){var _0x1d9f65={'raw':!![],'where':{'id':_0xab4948['params']['id']}},_0x38f081={};_0x38f081[_0x8a57('0x2b')]=_['keys'](db[_0x8a57('0x21')][_0x8a57('0x22')]);_0x38f081['query']=_[_0x8a57('0x2c')](_0xab4948['query']);_0x38f081[_0x8a57('0x2d')]=_[_0x8a57('0x2e')](_0x38f081['model'],_0x38f081['query']);_0x1d9f65[_0x8a57('0x2f')]=_['intersection'](_0x38f081[_0x8a57('0x2b')],qs[_0x8a57('0x30')](_0xab4948['query']['fields']));_0x1d9f65['attributes']=_0x1d9f65[_0x8a57('0x2f')]['length']?_0x1d9f65['attributes']:_0x38f081['model'];if(_0xab4948[_0x8a57('0x31')]['includeAll']){_0x1d9f65[_0x8a57('0x27')]=[{'all':!![]}];}_0x1d9f65=_[_0x8a57('0x32')]({},_0x1d9f65,_0xab4948[_0x8a57('0x33')]);return db[_0x8a57('0x21')][_0x8a57('0x34')](_0x1d9f65)[_0x8a57('0x16')](handleEntityNotFound(_0x454f79,null))[_0x8a57('0x16')](respondWithResult(_0x454f79,null))['catch'](handleError(_0x454f79,null));};exports[_0x8a57('0x35')]=function(_0x21d01b,_0x4fec2b){return db[_0x8a57('0x21')][_0x8a57('0x35')](_0x21d01b[_0x8a57('0x36')],{})[_0x8a57('0x16')](function(_0x5d2256){var _0x316d6a=_0x21d01b[_0x8a57('0x37')]['get']({'plain':!![]});if(!_0x316d6a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x316d6a[_0x8a57('0x38')]===_0x8a57('0x37')){var _0x17ad4d=_0x5d2256[_0x8a57('0x18')]({'plain':!![]});var _0x1b805e=_0x8a57('0x19');return db[_0x8a57('0x39')]['find']({'where':{'name':_0x1b805e,'userProfileId':_0x316d6a[_0x8a57('0x3a')]},'raw':!![]})[_0x8a57('0x16')](function(_0x52e9d1){if(_0x52e9d1&&_0x52e9d1[_0x8a57('0x3b')]===0x0){return db[_0x8a57('0x1a')]['create']({'name':_0x17ad4d[_0x8a57('0x1d')],'resourceId':_0x17ad4d['id'],'type':_0x52e9d1[_0x8a57('0x1d')],'sectionId':_0x52e9d1['id']},{})[_0x8a57('0x16')](function(){return _0x5d2256;});}else{return _0x5d2256;}})['catch'](function(_0x26e0f5){logger[_0x8a57('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26e0f5);throw _0x26e0f5;});}return _0x5d2256;})[_0x8a57('0x16')](respondWithResult(_0x4fec2b,0xc9))[_0x8a57('0x29')](handleError(_0x4fec2b,null));};exports[_0x8a57('0x15')]=function(_0x50ecfc,_0x24d555){if(_0x50ecfc[_0x8a57('0x36')]['id']){delete _0x50ecfc['body']['id'];}return db[_0x8a57('0x21')][_0x8a57('0x34')]({'where':{'id':_0x50ecfc[_0x8a57('0x3c')]['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x24d555,null))['then'](saveUpdates(_0x50ecfc[_0x8a57('0x36')],null))[_0x8a57('0x16')](respondWithResult(_0x24d555,null))[_0x8a57('0x29')](handleError(_0x24d555,null));};exports['destroy']=function(_0x34f799,_0x4b5004){return db[_0x8a57('0x21')][_0x8a57('0x34')]({'where':{'id':_0x34f799[_0x8a57('0x3c')]['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x4b5004,null))[_0x8a57('0x16')](removeEntity(_0x4b5004,null))[_0x8a57('0x29')](handleError(_0x4b5004,null));};exports['describe']=function(_0x2b95fc,_0x5c2805){return db[_0x8a57('0x21')]['describe']()[_0x8a57('0x16')](respondWithResult(_0x5c2805,null))[_0x8a57('0x29')](handleError(_0x5c2805,null));};exports[_0x8a57('0x3d')]=function(_0x332abc,_0x21d62c){var _0xe0d270={'raw':!![],'where':{}},_0x28b472={},_0x27e44d;return db['ChatQueue'][_0x8a57('0x3e')]({'where':{'id':_0x332abc[_0x8a57('0x3c')]['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x21d62c,null))[_0x8a57('0x16')](function(_0x5921c8){if(_0x5921c8){_0x27e44d=_0x5921c8['get']({'plain':!![]});_0x28b472[_0x8a57('0x2b')]=_['keys'](db[_0x8a57('0x3f')][_0x8a57('0x22')]);_0x28b472[_0x8a57('0x31')]=_[_0x8a57('0x2c')](_0x332abc['query']);_0x28b472[_0x8a57('0x2d')]=_[_0x8a57('0x2e')](_0x28b472['model'],_0x28b472['query']);_0xe0d270['attributes']=_[_0x8a57('0x2e')](_0x28b472[_0x8a57('0x2b')],qs[_0x8a57('0x30')](_0x332abc[_0x8a57('0x31')]['fields']));_0xe0d270['attributes']=_0xe0d270[_0x8a57('0x2f')]['length']?_0xe0d270['attributes']:_0x28b472[_0x8a57('0x2b')];if(!_0x332abc[_0x8a57('0x31')][_0x8a57('0x40')](_0x8a57('0x41'))){_0xe0d270[_0x8a57('0x11')]=qs[_0x8a57('0x11')](_0x332abc[_0x8a57('0x31')][_0x8a57('0x11')]);_0xe0d270[_0x8a57('0xf')]=qs[_0x8a57('0xf')](_0x332abc[_0x8a57('0x31')][_0x8a57('0xf')]);}_0xe0d270[_0x8a57('0x42')]=qs['sort'](_0x332abc[_0x8a57('0x31')]['sort']);_0xe0d270[_0x8a57('0x26')]=qs[_0x8a57('0x2d')](_[_0x8a57('0x43')](_0x332abc[_0x8a57('0x31')],_0x28b472[_0x8a57('0x2d')]));_0xe0d270[_0x8a57('0x26')][_0x8a57('0x44')]=_0x5921c8['id'];if(_0x332abc['query'][_0x8a57('0x45')]){_0xe0d270['where']=_[_0x8a57('0x32')](_0xe0d270[_0x8a57('0x26')],{'$or':_['map'](_0xe0d270[_0x8a57('0x2f')],function(_0x27689b){var _0x3eacc1={};_0x3eacc1[_0x27689b]={'$like':'%'+_0x332abc['query'][_0x8a57('0x45')]+'%'};return _0x3eacc1;})});}_0xe0d270=_['merge']({},_0xe0d270,_0x332abc[_0x8a57('0x33')]);return db[_0x8a57('0x3f')][_0x8a57('0x46')](_0xe0d270);}})[_0x8a57('0x16')](function(_0x24465f){if(_0x24465f){return db['User'][_0x8a57('0x47')]({'where':{'id':_[_0x8a57('0x20')](_0x24465f,'UserId'),'role':_0x8a57('0x48')},'attributes':['id',_0x8a57('0x1d'),'chatPause',_0x8a57('0x49'),'createdAt']});}})[_0x8a57('0x16')](function(_0x5ac7b7){if(_0x5ac7b7){return{'count':_0x5ac7b7[_0x8a57('0x12')],'rows':_[_0x8a57('0x20')](_0x5ac7b7['rows'],function(_0xcd4da5){return{'membername':_0xcd4da5['name'],'UserId':_0xcd4da5['id'],'queue_name':_0x27e44d[_0x8a57('0x1d')],'ChatQueueId':_0x27e44d['id'],'interface':util['format']('%s/%s',_0x8a57('0x4a'),_0xcd4da5[_0x8a57('0x1d')]),'penalty':0x0,'paused':_0xcd4da5[_0x8a57('0x4b')],'createdAt':_0xcd4da5[_0x8a57('0x4c')],'updatedAt':_0xcd4da5[_0x8a57('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8a57('0x16')](respondWithFilteredResult(_0x21d62c,_0xe0d270))['catch'](handleError(_0x21d62c,null));};exports[_0x8a57('0x4d')]=function(_0x49c0c7,_0x15bac){var _0x48b8e5={};var _0x15db5f={};var _0x37279b;var _0x513efc;return db[_0x8a57('0x21')]['findOne']({'where':{'id':_0x49c0c7['params']['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x15bac,null))[_0x8a57('0x16')](function(_0x51bb88){if(_0x51bb88){_0x37279b=_0x51bb88;_0x15db5f[_0x8a57('0x2b')]=_[_0x8a57('0x2c')](db[_0x8a57('0x4e')]['rawAttributes']);_0x15db5f[_0x8a57('0x31')]=_[_0x8a57('0x2c')](_0x49c0c7[_0x8a57('0x31')]);_0x15db5f[_0x8a57('0x2d')]=_['intersection'](_0x15db5f['model'],_0x15db5f[_0x8a57('0x31')]);_0x48b8e5['attributes']=_[_0x8a57('0x2e')](_0x15db5f['model'],qs[_0x8a57('0x30')](_0x49c0c7['query'][_0x8a57('0x30')]));_0x48b8e5['attributes']=_0x48b8e5[_0x8a57('0x2f')][_0x8a57('0x4f')]?_0x48b8e5[_0x8a57('0x2f')]:_0x15db5f[_0x8a57('0x2b')];_0x48b8e5[_0x8a57('0x42')]=qs[_0x8a57('0x50')](_0x49c0c7[_0x8a57('0x31')][_0x8a57('0x50')]);_0x48b8e5[_0x8a57('0x26')]=qs[_0x8a57('0x2d')](_['pick'](_0x49c0c7[_0x8a57('0x31')],_0x15db5f[_0x8a57('0x2d')]));if(_0x49c0c7[_0x8a57('0x31')]['filter']){_0x48b8e5[_0x8a57('0x26')]=_[_0x8a57('0x32')](_0x48b8e5[_0x8a57('0x26')],{'$or':_[_0x8a57('0x20')](_0x48b8e5[_0x8a57('0x2f')],function(_0x1adf82){var _0x3e9507={};_0x3e9507[_0x1adf82]={'$like':'%'+_0x49c0c7[_0x8a57('0x31')][_0x8a57('0x45')]+'%'};return _0x3e9507;})});}_0x48b8e5=_[_0x8a57('0x32')]({},_0x48b8e5,_0x49c0c7[_0x8a57('0x33')]);return _0x37279b[_0x8a57('0x4d')](_0x48b8e5);}})['then'](function(_0x2daffb){if(_0x2daffb){_0x513efc=_0x2daffb['length'];if(!_0x49c0c7[_0x8a57('0x31')][_0x8a57('0x40')]('nolimit')){_0x48b8e5[_0x8a57('0x11')]=qs['limit'](_0x49c0c7[_0x8a57('0x31')][_0x8a57('0x11')]);_0x48b8e5[_0x8a57('0xf')]=qs['offset'](_0x49c0c7[_0x8a57('0x31')][_0x8a57('0xf')]);}return _0x37279b['getTeams'](_0x48b8e5);}})[_0x8a57('0x16')](function(_0xec5a02){if(_0xec5a02){return _0xec5a02?{'count':_0x513efc,'rows':_0xec5a02}:null;}})[_0x8a57('0x16')](respondWithResult(_0x15bac,null))[_0x8a57('0x29')](handleError(_0x15bac,null));};exports[_0x8a57('0x51')]=function(_0x4424db,_0x4c488b){var _0x496a2a=_0x4424db[_0x8a57('0x36')]['ids'];return db['Team'][_0x8a57('0x46')]({'where':{'id':_0x496a2a},'attributes':['id'],'include':[{'model':db[_0x8a57('0x52')],'as':'Agents','attributes':['id',_0x8a57('0x1d'),_0x8a57('0x53'),_0x8a57('0x54'),_0x8a57('0x55')],'raw':!![]}]})['then'](function(_0x41ef34){if(_0x41ef34){var _0x3ceb9c=_[_0x8a57('0x56')](_0x41ef34,function(_0xe84a6b){var _0x22c6e8=_0xe84a6b[_0x8a57('0x18')]({'plain':!![]});return _0x22c6e8[_0x8a57('0x57')];});return db['ChatQueue'][_0x8a57('0x34')]({'where':{'id':_0x4424db[_0x8a57('0x3c')]['id']}})[_0x8a57('0x16')](function(_0x22622a){return db['sequelize'][_0x8a57('0x58')](function(_0x5baa0b){return _0x22622a[_0x8a57('0x51')](_0x496a2a,{'transaction':_0x5baa0b})['then'](function(){return BPromise[_0x8a57('0x59')](_0x3ceb9c,function(_0x4de154){return db[_0x8a57('0x3f')][_0x8a57('0x5a')]({'where':{'UserId':_0x4de154['id'],'ChatQueueId':_0x4424db['params']['id']},'transaction':_0x5baa0b});});})['then'](function(){_0x3ceb9c[_0x8a57('0x5b')](function(_0x451d22){socket[_0x8a57('0x5c')](_0x8a57('0x5d'),{'UserId':_0x451d22['id'],'ChatQueueId':_0x22622a['id']});});});});});}})[_0x8a57('0x16')](respondWithStatusCode(_0x4c488b,null))['catch'](handleError(_0x4c488b,null));};exports[_0x8a57('0x5e')]=function(_0x3c520d,_0x232823){return db[_0x8a57('0x4e')]['findAll']({'where':{'id':_0x3c520d['query'][_0x8a57('0x5f')]},'attributes':['id'],'include':[{'model':db[_0x8a57('0x52')],'as':_0x8a57('0x57'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x232823,null))[_0x8a57('0x16')](function(_0x2e73ae){var _0x107f17=_[_0x8a57('0x20')](_0x2e73ae,'id');var _0x40b548=[];var _0x185dc6=[];var _0x20beed=squel[_0x8a57('0x60')]();_0x20beed[_0x8a57('0x61')](_0x8a57('0x62'))[_0x8a57('0x63')](_0x8a57('0x64'),'tq')[_0x8a57('0x65')]('user_has_teams','ut',_0x8a57('0x66'))[_0x8a57('0x26')](_0x8a57('0x67'),_0x3c520d['params']['id']);for(var _0x56a2ed=0x0;_0x56a2ed<_0x2e73ae[_0x8a57('0x4f')];_0x56a2ed+=0x1){let _0x21b9f4=_0x2e73ae[_0x56a2ed];for(var _0x1a2918=0x0;_0x1a2918<_0x21b9f4[_0x8a57('0x57')][_0x8a57('0x4f')];_0x1a2918+=0x1){let _0x12c3e3=_0x21b9f4['Agents'][_0x1a2918];var _0x37bc14=_0x20beed[_0x8a57('0x68')]();_0x37bc14['where'](_0x8a57('0x69'),_0x12c3e3['id']);_0x185dc6[_0x8a57('0x6a')](db['sequelize'][_0x8a57('0x31')](_0x37bc14[_0x8a57('0x6b')](),{'type':db[_0x8a57('0x6c')][_0x8a57('0x6d')][_0x8a57('0x6e')]})['then'](function(_0x3caecd){if(_0x3caecd[_0x8a57('0x4f')]===0x1){return _0x12c3e3['id'];}else{var _0x2387da=_[_0x8a57('0x6f')](_['map'](_0x3caecd,'TeamId'),function(_0x50671d){return _[_0x8a57('0x70')](_0x107f17,_0x50671d);});if(_0x2387da){return _0x12c3e3['id'];}}}));}}return BPromise[_0x8a57('0x71')](_0x185dc6)[_0x8a57('0x16')](function(_0xdb5ae){_0x40b548=_(_0x40b548)[_0x8a57('0x72')](_0xdb5ae)['compact']()[_0x8a57('0x73')]();return db[_0x8a57('0x21')]['find']({'where':{'id':_0x3c520d[_0x8a57('0x3c')]['id']}})['then'](function(_0x4703f3){return db[_0x8a57('0x6c')][_0x8a57('0x58')](function(_0x462bc6){return _0x4703f3['removeTeams'](_0x3c520d[_0x8a57('0x31')]['ids'],{'transaction':_0x462bc6})[_0x8a57('0x16')](function(){if(!_['isEmpty'](_0x40b548)){return _0x4703f3[_0x8a57('0x74')](_0x40b548,{'transaction':_0x462bc6});}})[_0x8a57('0x16')](function(){_0x40b548['forEach'](function(_0x36ebff){socket['emit']('userChatQueue:remove',{'UserId':_0x36ebff,'ChatQueueId':_0x4703f3['id']});});});});});});})[_0x8a57('0x16')](respondWithStatusCode(_0x232823,null))['catch'](handleError(_0x232823,null));};exports[_0x8a57('0x75')]=function(_0xc1d670,_0x42efe3){return db[_0x8a57('0x21')]['find']({'where':{'id':_0xc1d670['params']['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x42efe3,null))[_0x8a57('0x16')](function(_0x5758f5){if(_0x5758f5){return _0x5758f5[_0x8a57('0x75')](_0xc1d670[_0x8a57('0x36')][_0x8a57('0x5f')],_[_0x8a57('0x76')](_0xc1d670[_0x8a57('0x36')],[_0x8a57('0x5f'),'id'])||{})['spread'](function(_0x61d6a3){for(var _0xb40c58=0x0;_0xb40c58<_0xc1d670[_0x8a57('0x36')][_0x8a57('0x5f')]['length'];_0xb40c58+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0xc1d670[_0x8a57('0x36')][_0x8a57('0x5f')][_0xb40c58]),'ChatQueueId':Number(_0xc1d670[_0x8a57('0x3c')]['id'])});}return _0x61d6a3;});}})[_0x8a57('0x16')](respondWithResult(_0x42efe3,null))[_0x8a57('0x29')](handleError(_0x42efe3,null));};exports['removeAgents']=function(_0x5619a6,_0xe89474){return db['ChatQueue']['find']({'where':{'id':_0x5619a6[_0x8a57('0x3c')]['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0xe89474,null))['then'](function(_0x395599){if(_0x395599){return _0x395599[_0x8a57('0x74')](_0x5619a6[_0x8a57('0x31')][_0x8a57('0x5f')])[_0x8a57('0x16')](function(){if(_[_0x8a57('0x77')](_0x5619a6[_0x8a57('0x31')]['ids'])){for(var _0x7b99f4=0x0;_0x7b99f4<_0x5619a6[_0x8a57('0x31')][_0x8a57('0x5f')][_0x8a57('0x4f')];_0x7b99f4+=0x1){socket[_0x8a57('0x5c')](_0x8a57('0x78'),{'UserId':Number(_0x5619a6[_0x8a57('0x31')][_0x8a57('0x5f')][_0x7b99f4]),'ChatQueueId':Number(_0x5619a6['params']['id'])});}}else{socket[_0x8a57('0x5c')](_0x8a57('0x78'),{'UserId':Number(_0x5619a6['query'][_0x8a57('0x5f')]),'ChatQueueId':Number(_0x5619a6[_0x8a57('0x3c')]['id'])});}});}})[_0x8a57('0x16')](respondWithStatusCode(_0xe89474,null))[_0x8a57('0x29')](handleError(_0xe89474,null));};exports[_0x8a57('0x79')]=function(_0x444598,_0x402e37){var _0x1a87d6={};var _0x334309={};var _0x10073f;var _0x2b6071;return db[_0x8a57('0x21')][_0x8a57('0x3e')]({'where':{'id':_0x444598['params']['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x402e37,null))[_0x8a57('0x16')](function(_0xdd34bb){if(_0xdd34bb){_0x10073f=_0xdd34bb;_0x334309[_0x8a57('0x2b')]=_[_0x8a57('0x2c')](db[_0x8a57('0x52')]['rawAttributes']);_0x334309[_0x8a57('0x31')]=_['keys'](_0x444598['query']);_0x334309[_0x8a57('0x2d')]=_[_0x8a57('0x2e')](_0x334309[_0x8a57('0x2b')],_0x334309[_0x8a57('0x31')]);_0x1a87d6[_0x8a57('0x2f')]=_[_0x8a57('0x2e')](_0x334309[_0x8a57('0x2b')],qs[_0x8a57('0x30')](_0x444598[_0x8a57('0x31')]['fields']));_0x1a87d6[_0x8a57('0x2f')]=_0x1a87d6['attributes'][_0x8a57('0x4f')]?_0x1a87d6['attributes']:_0x334309[_0x8a57('0x2b')];_0x1a87d6[_0x8a57('0x42')]=qs['sort'](_0x444598[_0x8a57('0x31')][_0x8a57('0x50')]);_0x1a87d6['where']=qs[_0x8a57('0x2d')](_[_0x8a57('0x43')](_0x444598[_0x8a57('0x31')],_0x334309[_0x8a57('0x2d')]));if(_0x444598[_0x8a57('0x31')][_0x8a57('0x45')]){_0x1a87d6['where']=_[_0x8a57('0x32')](_0x1a87d6[_0x8a57('0x26')],{'$or':_[_0x8a57('0x20')](_0x1a87d6[_0x8a57('0x2f')],function(_0x242792){var _0x2eadd8={};_0x2eadd8[_0x242792]={'$like':'%'+_0x444598[_0x8a57('0x31')]['filter']+'%'};return _0x2eadd8;})});}_0x1a87d6=_[_0x8a57('0x32')]({},_0x1a87d6,_0x444598['options']);return _0x10073f[_0x8a57('0x79')](_0x1a87d6);}})[_0x8a57('0x16')](function(_0x21af6b){if(_0x21af6b){_0x2b6071=_0x21af6b[_0x8a57('0x4f')];if(!_0x444598[_0x8a57('0x31')][_0x8a57('0x40')](_0x8a57('0x41'))){_0x1a87d6[_0x8a57('0x11')]=qs[_0x8a57('0x11')](_0x444598[_0x8a57('0x31')][_0x8a57('0x11')]);_0x1a87d6[_0x8a57('0xf')]=qs[_0x8a57('0xf')](_0x444598[_0x8a57('0x31')][_0x8a57('0xf')]);}return _0x10073f['getAgents'](_0x1a87d6);}})[_0x8a57('0x16')](function(_0x2a4c6b){if(_0x2a4c6b){return _0x2a4c6b?{'count':_0x2b6071,'rows':_0x2a4c6b}:null;}})[_0x8a57('0x16')](respondWithResult(_0x402e37,null))[_0x8a57('0x29')](handleError(_0x402e37,null));};
\ No newline at end of file
+var _0x29a4=['User','findAndCountAll','chatPause','createdAt','rows','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','flatMap','transaction','each','forEach','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','every','TeamId','compact','value','userChatQueue:remove','addAgents','omit','emit','removeAgents','isArray','getAgents','lodash','ioredis','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','update','then','destroy','ChatQueues','UserProfileResource','sendStatus','error','stack','name','send','map','ChatQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','options','find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','merge','UserChatQueue'];(function(_0x104212,_0x43f4eb){var _0x1376dc=function(_0x4dc731){while(--_0x4dc731){_0x104212['push'](_0x104212['shift']());}};_0x1376dc(++_0x43f4eb);}(_0x29a4,0x1ef));var _0x429a=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x29a4[_0x341e0f];return _0x59555a;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x429a('0x0'));var squel=require('squel');var Redis=require(_0x429a('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x429a('0x2'))('api');var config=require(_0x429a('0x3'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x429a('0x4')](config[_0x429a('0x5')],{'host':_0x429a('0x6'),'port':0x18eb});var socket=require(_0x429a('0x7'))(new Redis(config['redis']));require(_0x429a('0x8'))[_0x429a('0x9')](socket);function respondWithStatusCode(_0x2a31e1,_0x43f526){_0x43f526=_0x43f526||0xcc;return function(_0x4532cd){if(_0x4532cd){return _0x2a31e1['sendStatus'](_0x43f526);}return _0x2a31e1[_0x429a('0xa')](_0x43f526)[_0x429a('0xb')]();};}function respondWithResult(_0x1f9a06,_0x3f70b0){_0x3f70b0=_0x3f70b0||0xc8;return function(_0x36bb71){if(_0x36bb71){return _0x1f9a06[_0x429a('0xa')](_0x3f70b0)['json'](_0x36bb71);}};}function respondWithFilteredResult(_0x564183,_0x5e86f3){return function(_0x314e1a){if(_0x314e1a){var _0x92cecb=typeof _0x5e86f3[_0x429a('0xc')]===_0x429a('0xd')&&typeof _0x5e86f3[_0x429a('0xe')]==='undefined';var _0x2a42ea=_0x314e1a[_0x429a('0xf')];var _0x2f4dcb=_0x92cecb?0x0:_0x5e86f3[_0x429a('0xc')];var _0x5b9ad6=_0x92cecb?_0x314e1a[_0x429a('0xf')]:_0x5e86f3[_0x429a('0xc')]+_0x5e86f3[_0x429a('0xe')];var _0x1d30a2;if(_0x5b9ad6>=_0x2a42ea){_0x5b9ad6=_0x2a42ea;_0x1d30a2=0xc8;}else{_0x1d30a2=0xce;}_0x564183['status'](_0x1d30a2);return _0x564183[_0x429a('0x10')](_0x429a('0x11'),_0x2f4dcb+'-'+_0x5b9ad6+'/'+_0x2a42ea)['json'](_0x314e1a);}return null;};}function saveUpdates(_0x5a0ee1){return function(_0x38a913){if(_0x38a913){return _0x38a913[_0x429a('0x12')](_0x5a0ee1)[_0x429a('0x13')](function(_0x19a335){return _0x19a335;});}return null;};}function removeEntity(_0x17c0f8){return function(_0x4b48d5){if(_0x4b48d5){return _0x4b48d5[_0x429a('0x14')]()[_0x429a('0x13')](function(){var _0x22d3d9=_0x4b48d5['get']({'plain':!![]});var _0xc92608=_0x429a('0x15');return db[_0x429a('0x16')]['destroy']({'where':{'type':_0xc92608,'resourceId':_0x22d3d9['id']}})['then'](function(){return _0x4b48d5;});})[_0x429a('0x13')](function(){_0x17c0f8['status'](0xcc)[_0x429a('0xb')]();});}};}function handleEntityNotFound(_0x592b1e){return function(_0x408f5b){if(!_0x408f5b){_0x592b1e[_0x429a('0x17')](0x194);}return _0x408f5b;};}function handleError(_0xd014a7,_0x11f488){_0x11f488=_0x11f488||0x1f4;return function(_0x460943){logger[_0x429a('0x18')](_0x460943[_0x429a('0x19')]);if(_0x460943['name']){delete _0x460943[_0x429a('0x1a')];}_0xd014a7['status'](_0x11f488)[_0x429a('0x1b')](_0x460943);};}exports['index']=function(_0x444bed,_0x465ba4){var _0x7547e8={};var _0x7353ca={'count':0x0,'rows':[]};var _0x14e24c=_[_0x429a('0x1c')](db[_0x429a('0x1d')][_0x429a('0x1e')],function(_0x50d4b8){return{'name':_0x50d4b8[_0x429a('0x1f')],'type':_0x50d4b8['type'][_0x429a('0x20')]};});_0x7547e8=qs[_0x429a('0x21')](_0x14e24c,_0x444bed);var _0x46b056={'where':_0x7547e8[_0x429a('0x22')]};return db[_0x429a('0x1d')][_0x429a('0xf')](_0x46b056)[_0x429a('0x13')](function(_0x2d5e1a){_0x7353ca[_0x429a('0xf')]=_0x2d5e1a;_0x7547e8['include']=qs[_0x429a('0x23')](_0x444bed[_0x429a('0x24')]);return db[_0x429a('0x1d')][_0x429a('0x25')](_0x7547e8);})[_0x429a('0x13')](function(_0x1e6bfa){_0x7353ca['rows']=_0x1e6bfa;return _0x7353ca;})[_0x429a('0x13')](respondWithFilteredResult(_0x465ba4,_0x7547e8))['catch'](handleError(_0x465ba4,null));};exports[_0x429a('0x26')]=function(_0x4af095,_0x228f71){var _0x1c9a9d={'raw':!![],'where':{'id':_0x4af095[_0x429a('0x27')]['id']}},_0x52f666={};_0x52f666[_0x429a('0x28')]=_[_0x429a('0x29')](db['ChatQueue']['rawAttributes']);_0x52f666[_0x429a('0x24')]=_['keys'](_0x4af095[_0x429a('0x24')]);_0x52f666[_0x429a('0x2a')]=_[_0x429a('0x2b')](_0x52f666[_0x429a('0x28')],_0x52f666[_0x429a('0x24')]);_0x1c9a9d[_0x429a('0x2c')]=_[_0x429a('0x2b')](_0x52f666[_0x429a('0x28')],qs[_0x429a('0x2d')](_0x4af095[_0x429a('0x24')][_0x429a('0x2d')]));_0x1c9a9d['attributes']=_0x1c9a9d['attributes'][_0x429a('0x2e')]?_0x1c9a9d[_0x429a('0x2c')]:_0x52f666['model'];if(_0x4af095[_0x429a('0x24')][_0x429a('0x2f')]){_0x1c9a9d[_0x429a('0x23')]=[{'all':!![]}];}_0x1c9a9d=_['merge']({},_0x1c9a9d,_0x4af095[_0x429a('0x30')]);return db[_0x429a('0x1d')][_0x429a('0x31')](_0x1c9a9d)['then'](handleEntityNotFound(_0x228f71,null))[_0x429a('0x13')](respondWithResult(_0x228f71,null))['catch'](handleError(_0x228f71,null));};exports[_0x429a('0x32')]=function(_0xabd178,_0x1b6b32){return db[_0x429a('0x1d')][_0x429a('0x32')](_0xabd178[_0x429a('0x33')],{})[_0x429a('0x13')](function(_0x2ff172){var _0x2f6595=_0xabd178[_0x429a('0x34')][_0x429a('0x35')]({'plain':!![]});if(!_0x2f6595)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f6595['role']===_0x429a('0x34')){var _0xb6c3e9=_0x2ff172[_0x429a('0x35')]({'plain':!![]});var _0x1549a8=_0x429a('0x15');return db[_0x429a('0x36')]['find']({'where':{'name':_0x1549a8,'userProfileId':_0x2f6595[_0x429a('0x37')]},'raw':!![]})[_0x429a('0x13')](function(_0x58c2a0){if(_0x58c2a0&&_0x58c2a0[_0x429a('0x38')]===0x0){return db['UserProfileResource'][_0x429a('0x32')]({'name':_0xb6c3e9[_0x429a('0x1a')],'resourceId':_0xb6c3e9['id'],'type':_0x58c2a0[_0x429a('0x1a')],'sectionId':_0x58c2a0['id']},{})[_0x429a('0x13')](function(){return _0x2ff172;});}else{return _0x2ff172;}})[_0x429a('0x39')](function(_0x58a9af){logger[_0x429a('0x18')](_0x429a('0x3a'),_0x58a9af);throw _0x58a9af;});}return _0x2ff172;})[_0x429a('0x13')](respondWithResult(_0x1b6b32,0xc9))[_0x429a('0x39')](handleError(_0x1b6b32,null));};exports[_0x429a('0x12')]=function(_0x218357,_0x256d37){if(_0x218357[_0x429a('0x33')]['id']){delete _0x218357['body']['id'];}return db['ChatQueue'][_0x429a('0x31')]({'where':{'id':_0x218357[_0x429a('0x27')]['id']}})[_0x429a('0x13')](handleEntityNotFound(_0x256d37,null))[_0x429a('0x13')](saveUpdates(_0x218357[_0x429a('0x33')],null))[_0x429a('0x13')](respondWithResult(_0x256d37,null))['catch'](handleError(_0x256d37,null));};exports[_0x429a('0x14')]=function(_0x1fa02f,_0x26dbd4){return db[_0x429a('0x1d')][_0x429a('0x31')]({'where':{'id':_0x1fa02f[_0x429a('0x27')]['id']}})['then'](handleEntityNotFound(_0x26dbd4,null))['then'](removeEntity(_0x26dbd4,null))[_0x429a('0x39')](handleError(_0x26dbd4,null));};exports[_0x429a('0x3b')]=function(_0x315aba,_0x40f7d4){return db[_0x429a('0x1d')][_0x429a('0x3b')]()[_0x429a('0x13')](respondWithResult(_0x40f7d4,null))['catch'](handleError(_0x40f7d4,null));};exports[_0x429a('0x3c')]=function(_0xc22b1c,_0x36ac8f){var _0x57af4e={'raw':!![],'where':{}},_0x36b842={},_0x55ba94;return db[_0x429a('0x1d')]['findOne']({'where':{'id':_0xc22b1c[_0x429a('0x27')]['id']}})['then'](handleEntityNotFound(_0x36ac8f,null))[_0x429a('0x13')](function(_0x516dda){if(_0x516dda){_0x55ba94=_0x516dda['get']({'plain':!![]});_0x36b842[_0x429a('0x28')]=_[_0x429a('0x29')](db['UserChatQueue'][_0x429a('0x1e')]);_0x36b842[_0x429a('0x24')]=_['keys'](_0xc22b1c[_0x429a('0x24')]);_0x36b842['filters']=_[_0x429a('0x2b')](_0x36b842['model'],_0x36b842['query']);_0x57af4e[_0x429a('0x2c')]=_[_0x429a('0x2b')](_0x36b842[_0x429a('0x28')],qs[_0x429a('0x2d')](_0xc22b1c[_0x429a('0x24')]['fields']));_0x57af4e[_0x429a('0x2c')]=_0x57af4e[_0x429a('0x2c')][_0x429a('0x2e')]?_0x57af4e[_0x429a('0x2c')]:_0x36b842[_0x429a('0x28')];if(!_0xc22b1c[_0x429a('0x24')][_0x429a('0x3d')](_0x429a('0x3e'))){_0x57af4e[_0x429a('0xe')]=qs[_0x429a('0xe')](_0xc22b1c[_0x429a('0x24')][_0x429a('0xe')]);_0x57af4e[_0x429a('0xc')]=qs['offset'](_0xc22b1c[_0x429a('0x24')]['offset']);}_0x57af4e[_0x429a('0x3f')]=qs['sort'](_0xc22b1c[_0x429a('0x24')][_0x429a('0x40')]);_0x57af4e['where']=qs[_0x429a('0x2a')](_[_0x429a('0x41')](_0xc22b1c['query'],_0x36b842[_0x429a('0x2a')]));_0x57af4e[_0x429a('0x22')][_0x429a('0x42')]=_0x516dda['id'];if(_0xc22b1c['query'][_0x429a('0x43')]){_0x57af4e[_0x429a('0x22')]=_['merge'](_0x57af4e[_0x429a('0x22')],{'$or':_[_0x429a('0x1c')](_0x57af4e[_0x429a('0x2c')],function(_0x526d60){var _0x4d39b0={};_0x4d39b0[_0x526d60]={'$like':'%'+_0xc22b1c['query']['filter']+'%'};return _0x4d39b0;})});}_0x57af4e=_[_0x429a('0x44')]({},_0x57af4e,_0xc22b1c['options']);return db[_0x429a('0x45')]['findAll'](_0x57af4e);}})[_0x429a('0x13')](function(_0x342646){if(_0x342646){return db[_0x429a('0x46')][_0x429a('0x47')]({'where':{'id':_[_0x429a('0x1c')](_0x342646,'UserId'),'role':'agent'},'attributes':['id',_0x429a('0x1a'),_0x429a('0x48'),'updatedAt',_0x429a('0x49')]});}})[_0x429a('0x13')](function(_0x237a66){if(_0x237a66){return{'count':_0x237a66[_0x429a('0xf')],'rows':_[_0x429a('0x1c')](_0x237a66[_0x429a('0x4a')],function(_0x2191c7){return{'membername':_0x2191c7[_0x429a('0x1a')],'UserId':_0x2191c7['id'],'queue_name':_0x55ba94['name'],'ChatQueueId':_0x55ba94['id'],'interface':util[_0x429a('0x4b')](_0x429a('0x4c'),_0x429a('0x4d'),_0x2191c7['name']),'penalty':0x0,'paused':_0x2191c7[_0x429a('0x48')],'createdAt':_0x2191c7[_0x429a('0x49')],'updatedAt':_0x2191c7['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x429a('0x13')](respondWithFilteredResult(_0x36ac8f,_0x57af4e))[_0x429a('0x39')](handleError(_0x36ac8f,null));};exports[_0x429a('0x4e')]=function(_0x160d30,_0x182aef){var _0x480a79={};var _0x4c654d={};var _0x58899c;var _0x3add2b;return db[_0x429a('0x1d')][_0x429a('0x4f')]({'where':{'id':_0x160d30[_0x429a('0x27')]['id']}})[_0x429a('0x13')](handleEntityNotFound(_0x182aef,null))[_0x429a('0x13')](function(_0x333bc0){if(_0x333bc0){_0x58899c=_0x333bc0;_0x4c654d[_0x429a('0x28')]=_['keys'](db[_0x429a('0x50')][_0x429a('0x1e')]);_0x4c654d['query']=_[_0x429a('0x29')](_0x160d30['query']);_0x4c654d[_0x429a('0x2a')]=_[_0x429a('0x2b')](_0x4c654d[_0x429a('0x28')],_0x4c654d[_0x429a('0x24')]);_0x480a79[_0x429a('0x2c')]=_[_0x429a('0x2b')](_0x4c654d[_0x429a('0x28')],qs[_0x429a('0x2d')](_0x160d30['query'][_0x429a('0x2d')]));_0x480a79[_0x429a('0x2c')]=_0x480a79[_0x429a('0x2c')][_0x429a('0x2e')]?_0x480a79[_0x429a('0x2c')]:_0x4c654d[_0x429a('0x28')];_0x480a79[_0x429a('0x3f')]=qs[_0x429a('0x40')](_0x160d30[_0x429a('0x24')][_0x429a('0x40')]);_0x480a79[_0x429a('0x22')]=qs[_0x429a('0x2a')](_[_0x429a('0x41')](_0x160d30[_0x429a('0x24')],_0x4c654d['filters']));if(_0x160d30['query'][_0x429a('0x43')]){_0x480a79[_0x429a('0x22')]=_['merge'](_0x480a79[_0x429a('0x22')],{'$or':_['map'](_0x480a79[_0x429a('0x2c')],function(_0x53c326){var _0x392013={};_0x392013[_0x53c326]={'$like':'%'+_0x160d30[_0x429a('0x24')][_0x429a('0x43')]+'%'};return _0x392013;})});}_0x480a79=_['merge']({},_0x480a79,_0x160d30[_0x429a('0x30')]);return _0x58899c[_0x429a('0x4e')](_0x480a79);}})[_0x429a('0x13')](function(_0x1d7887){if(_0x1d7887){_0x3add2b=_0x1d7887['length'];if(!_0x160d30[_0x429a('0x24')]['hasOwnProperty'](_0x429a('0x3e'))){_0x480a79[_0x429a('0xe')]=qs[_0x429a('0xe')](_0x160d30['query'][_0x429a('0xe')]);_0x480a79[_0x429a('0xc')]=qs[_0x429a('0xc')](_0x160d30['query'][_0x429a('0xc')]);}return _0x58899c[_0x429a('0x4e')](_0x480a79);}})[_0x429a('0x13')](function(_0x13d01b){if(_0x13d01b){return _0x13d01b?{'count':_0x3add2b,'rows':_0x13d01b}:null;}})[_0x429a('0x13')](respondWithResult(_0x182aef,null))[_0x429a('0x39')](handleError(_0x182aef,null));};exports[_0x429a('0x51')]=function(_0x4d0c2d,_0x360c7e){var _0x565eca=_0x4d0c2d['body'][_0x429a('0x52')];return db[_0x429a('0x50')][_0x429a('0x25')]({'where':{'id':_0x565eca},'attributes':['id'],'include':[{'model':db['User'],'as':_0x429a('0x53'),'attributes':['id',_0x429a('0x1a'),_0x429a('0x54'),_0x429a('0x55'),'interface'],'raw':!![]}]})[_0x429a('0x13')](function(_0x21edd1){if(_0x21edd1){var _0x37f6d4=_[_0x429a('0x56')](_0x21edd1,function(_0x38a0c5){var _0x379570=_0x38a0c5[_0x429a('0x35')]({'plain':!![]});return _0x379570['Agents'];});return db[_0x429a('0x1d')][_0x429a('0x31')]({'where':{'id':_0x4d0c2d['params']['id']}})['then'](function(_0x2104f4){return db['sequelize'][_0x429a('0x57')](function(_0x442cb6){return _0x2104f4['addTeams'](_0x565eca,{'transaction':_0x442cb6})['then'](function(){return BPromise[_0x429a('0x58')](_0x37f6d4,function(_0x30f6f5){return db[_0x429a('0x45')]['findOrCreate']({'where':{'UserId':_0x30f6f5['id'],'ChatQueueId':_0x4d0c2d['params']['id']},'transaction':_0x442cb6});});})[_0x429a('0x13')](function(){_0x37f6d4[_0x429a('0x59')](function(_0xe73202){socket['emit'](_0x429a('0x5a'),{'UserId':_0xe73202['id'],'ChatQueueId':_0x2104f4['id']});});});});});}})[_0x429a('0x13')](respondWithStatusCode(_0x360c7e,null))[_0x429a('0x39')](handleError(_0x360c7e,null));};exports[_0x429a('0x5b')]=function(_0x1041a4,_0x25f406){return db[_0x429a('0x50')]['findAll']({'where':{'id':_0x1041a4[_0x429a('0x24')][_0x429a('0x52')]},'attributes':['id'],'include':[{'model':db[_0x429a('0x46')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x429a('0x13')](handleEntityNotFound(_0x25f406,null))[_0x429a('0x13')](function(_0x25bf4c){var _0x378ec1=_[_0x429a('0x1c')](_0x25bf4c,'id');var _0xddca92=[];var _0x182ecc=[];var _0x481de3=squel[_0x429a('0x5c')]();_0x481de3[_0x429a('0x5d')]('tq.TeamId')[_0x429a('0x5e')](_0x429a('0x5f'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x429a('0x22')](_0x429a('0x60'),_0x1041a4[_0x429a('0x27')]['id']);for(var _0x1f79bf=0x0;_0x1f79bf<_0x25bf4c[_0x429a('0x2e')];_0x1f79bf+=0x1){let _0x7750cf=_0x25bf4c[_0x1f79bf];for(var _0x3c5e75=0x0;_0x3c5e75<_0x7750cf['Agents']['length'];_0x3c5e75+=0x1){let _0x193517=_0x7750cf[_0x429a('0x53')][_0x3c5e75];var _0xa8ee2=_0x481de3[_0x429a('0x61')]();_0xa8ee2[_0x429a('0x22')](_0x429a('0x62'),_0x193517['id']);_0x182ecc['push'](db[_0x429a('0x63')][_0x429a('0x24')](_0xa8ee2[_0x429a('0x64')](),{'type':db[_0x429a('0x63')][_0x429a('0x65')]['SELECT']})[_0x429a('0x13')](function(_0x225ee1){if(_0x225ee1[_0x429a('0x2e')]===0x1){return _0x193517['id'];}else{var _0x573531=_[_0x429a('0x66')](_[_0x429a('0x1c')](_0x225ee1,_0x429a('0x67')),function(_0x4cf1b7){return _['includes'](_0x378ec1,_0x4cf1b7);});if(_0x573531){return _0x193517['id'];}}}));}}return BPromise['all'](_0x182ecc)['then'](function(_0x4d6fa2){_0xddca92=_(_0xddca92)['union'](_0x4d6fa2)[_0x429a('0x68')]()[_0x429a('0x69')]();return db[_0x429a('0x1d')][_0x429a('0x31')]({'where':{'id':_0x1041a4[_0x429a('0x27')]['id']}})[_0x429a('0x13')](function(_0x4ce60f){return db[_0x429a('0x63')]['transaction'](function(_0x4f770d){return _0x4ce60f[_0x429a('0x5b')](_0x1041a4[_0x429a('0x24')][_0x429a('0x52')],{'transaction':_0x4f770d})[_0x429a('0x13')](function(){if(!_['isEmpty'](_0xddca92)){return _0x4ce60f['removeAgents'](_0xddca92,{'transaction':_0x4f770d});}})[_0x429a('0x13')](function(){_0xddca92[_0x429a('0x59')](function(_0x44f19f){socket['emit'](_0x429a('0x6a'),{'UserId':_0x44f19f,'ChatQueueId':_0x4ce60f['id']});});});});});});})[_0x429a('0x13')](respondWithStatusCode(_0x25f406,null))[_0x429a('0x39')](handleError(_0x25f406,null));};exports[_0x429a('0x6b')]=function(_0x179fca,_0x2407eb){return db[_0x429a('0x1d')][_0x429a('0x31')]({'where':{'id':_0x179fca[_0x429a('0x27')]['id']}})[_0x429a('0x13')](handleEntityNotFound(_0x2407eb,null))[_0x429a('0x13')](function(_0x3b6697){if(_0x3b6697){return _0x3b6697[_0x429a('0x6b')](_0x179fca['body'][_0x429a('0x52')],_[_0x429a('0x6c')](_0x179fca[_0x429a('0x33')],['ids','id'])||{})['spread'](function(_0xf478bc){for(var _0x3c55bd=0x0;_0x3c55bd<_0x179fca[_0x429a('0x33')][_0x429a('0x52')][_0x429a('0x2e')];_0x3c55bd+=0x1){socket[_0x429a('0x6d')](_0x429a('0x5a'),{'UserId':Number(_0x179fca[_0x429a('0x33')][_0x429a('0x52')][_0x3c55bd]),'ChatQueueId':Number(_0x179fca[_0x429a('0x27')]['id'])});}return _0xf478bc;});}})[_0x429a('0x13')](respondWithResult(_0x2407eb,null))[_0x429a('0x39')](handleError(_0x2407eb,null));};exports[_0x429a('0x6e')]=function(_0x3d25bf,_0x1bb97c){return db[_0x429a('0x1d')][_0x429a('0x31')]({'where':{'id':_0x3d25bf['params']['id']}})['then'](handleEntityNotFound(_0x1bb97c,null))[_0x429a('0x13')](function(_0x172c24){if(_0x172c24){return _0x172c24['removeAgents'](_0x3d25bf['query'][_0x429a('0x52')])['then'](function(){if(_[_0x429a('0x6f')](_0x3d25bf[_0x429a('0x24')][_0x429a('0x52')])){for(var _0x1570ec=0x0;_0x1570ec<_0x3d25bf[_0x429a('0x24')]['ids'][_0x429a('0x2e')];_0x1570ec+=0x1){socket[_0x429a('0x6d')]('userChatQueue:remove',{'UserId':Number(_0x3d25bf[_0x429a('0x24')][_0x429a('0x52')][_0x1570ec]),'ChatQueueId':Number(_0x3d25bf[_0x429a('0x27')]['id'])});}}else{socket[_0x429a('0x6d')](_0x429a('0x6a'),{'UserId':Number(_0x3d25bf['query'][_0x429a('0x52')]),'ChatQueueId':Number(_0x3d25bf['params']['id'])});}});}})[_0x429a('0x13')](respondWithStatusCode(_0x1bb97c,null))['catch'](handleError(_0x1bb97c,null));};exports[_0x429a('0x70')]=function(_0x761779,_0x1ba74a){var _0x37dbb3={};var _0x15a429={};var _0x95617e;var _0x4f4c77;return db['ChatQueue']['findOne']({'where':{'id':_0x761779[_0x429a('0x27')]['id']}})[_0x429a('0x13')](handleEntityNotFound(_0x1ba74a,null))['then'](function(_0x3e7ef4){if(_0x3e7ef4){_0x95617e=_0x3e7ef4;_0x15a429[_0x429a('0x28')]=_[_0x429a('0x29')](db[_0x429a('0x46')][_0x429a('0x1e')]);_0x15a429[_0x429a('0x24')]=_[_0x429a('0x29')](_0x761779[_0x429a('0x24')]);_0x15a429[_0x429a('0x2a')]=_[_0x429a('0x2b')](_0x15a429[_0x429a('0x28')],_0x15a429[_0x429a('0x24')]);_0x37dbb3[_0x429a('0x2c')]=_['intersection'](_0x15a429['model'],qs[_0x429a('0x2d')](_0x761779['query'][_0x429a('0x2d')]));_0x37dbb3['attributes']=_0x37dbb3[_0x429a('0x2c')]['length']?_0x37dbb3[_0x429a('0x2c')]:_0x15a429[_0x429a('0x28')];_0x37dbb3[_0x429a('0x3f')]=qs[_0x429a('0x40')](_0x761779[_0x429a('0x24')][_0x429a('0x40')]);_0x37dbb3['where']=qs[_0x429a('0x2a')](_[_0x429a('0x41')](_0x761779[_0x429a('0x24')],_0x15a429[_0x429a('0x2a')]));if(_0x761779[_0x429a('0x24')][_0x429a('0x43')]){_0x37dbb3['where']=_[_0x429a('0x44')](_0x37dbb3[_0x429a('0x22')],{'$or':_['map'](_0x37dbb3['attributes'],function(_0x15d48b){var _0x14dbb7={};_0x14dbb7[_0x15d48b]={'$like':'%'+_0x761779[_0x429a('0x24')][_0x429a('0x43')]+'%'};return _0x14dbb7;})});}_0x37dbb3=_[_0x429a('0x44')]({},_0x37dbb3,_0x761779[_0x429a('0x30')]);return _0x95617e['getAgents'](_0x37dbb3);}})[_0x429a('0x13')](function(_0x232182){if(_0x232182){_0x4f4c77=_0x232182[_0x429a('0x2e')];if(!_0x761779[_0x429a('0x24')][_0x429a('0x3d')](_0x429a('0x3e'))){_0x37dbb3['limit']=qs[_0x429a('0xe')](_0x761779[_0x429a('0x24')][_0x429a('0xe')]);_0x37dbb3[_0x429a('0xc')]=qs[_0x429a('0xc')](_0x761779[_0x429a('0x24')]['offset']);}return _0x95617e[_0x429a('0x70')](_0x37dbb3);}})['then'](function(_0x1ea080){if(_0x1ea080){return _0x1ea080?{'count':_0x4f4c77,'rows':_0x1ea080}:null;}})[_0x429a('0x13')](respondWithResult(_0x1ba74a,null))['catch'](handleError(_0x1ba74a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 6f9a340..e951df3 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 _0xccfc=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x5a3ed8,_0x4cf865){var _0x1a894c=function(_0x1d179c){while(--_0x1d179c){_0x5a3ed8['push'](_0x5a3ed8['shift']());}};_0x1a894c(++_0x4cf865);}(_0xccfc,0x19a));var _0xcccf=function(_0x15f0ae,_0x2c4264){_0x15f0ae=_0x15f0ae-0x0;var _0xf4842=_0xccfc[_0x15f0ae];return _0xf4842;};'use strict';var EventEmitter=require(_0xcccf('0x0'));var ChatQueue=require(_0xcccf('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xcccf('0x2')](0x0);var events={'afterCreate':_0xcccf('0x3'),'afterUpdate':_0xcccf('0x4'),'afterDestroy':_0xcccf('0x5')};function emitEvent(_0x431940){return function(_0x7425b5,_0x56ca5b,_0x2685a8){ChatQueueEvents['emit'](_0x431940+':'+_0x7425b5['id'],_0x7425b5);ChatQueueEvents['emit'](_0x431940,_0x7425b5);_0x2685a8(null);};}for(var e in events){if(events[_0xcccf('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xcccf('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x56c7=['emit','hook','exports','events','ChatQueue','update','remove'];(function(_0xd93cf7,_0xc8445b){var _0x2791eb=function(_0x8ddfc1){while(--_0x8ddfc1){_0xd93cf7['push'](_0xd93cf7['shift']());}};_0x2791eb(++_0xc8445b);}(_0x56c7,0x14c));var _0x756c=function(_0xd9c529,_0x19f8cc){_0xd9c529=_0xd9c529-0x0;var _0x146760=_0x56c7[_0xd9c529];return _0x146760;};'use strict';var EventEmitter=require(_0x756c('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x756c('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x756c('0x2'),'afterDestroy':_0x756c('0x3')};function emitEvent(_0x45d7a9){return function(_0x323d10,_0x2df6f5,_0x3c29d7){ChatQueueEvents[_0x756c('0x4')](_0x45d7a9+':'+_0x323d10['id'],_0x323d10);ChatQueueEvents[_0x756c('0x4')](_0x45d7a9,_0x323d10);_0x3c29d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x756c('0x5')](e,emitEvent(event));}}module[_0x756c('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 628c77c..2e135fe 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 _0x237c=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues'];(function(_0x1a91f0,_0x11e203){var _0x12f862=function(_0x48983c){while(--_0x48983c){_0x1a91f0['push'](_0x1a91f0['shift']());}};_0x12f862(++_0x11e203);}(_0x237c,0x179));var _0xc237=function(_0x3eeaa9,_0x18f2c1){_0x3eeaa9=_0x3eeaa9-0x0;var _0x40dfde=_0x237c[_0x3eeaa9];return _0x40dfde;};'use strict';var _=require(_0xc237('0x0'));var util=require(_0xc237('0x1'));var logger=require(_0xc237('0x2'))(_0xc237('0x3'));var moment=require('moment');var BPromise=require(_0xc237('0x4'));var rp=require(_0xc237('0x5'));var fs=require('fs');var path=require(_0xc237('0x6'));var rimraf=require(_0xc237('0x7'));var config=require(_0xc237('0x8'));var attributes=require('./chatQueue.attributes');module[_0xc237('0x9')]=function(_0x133f01,_0x17d044){return _0x133f01[_0xc237('0xa')](_0xc237('0xb'),attributes,{'tableName':_0xc237('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf1aa=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues'];(function(_0x3a2373,_0x2ef4fe){var _0x177352=function(_0x53cd26){while(--_0x53cd26){_0x3a2373['push'](_0x3a2373['shift']());}};_0x177352(++_0x2ef4fe);}(_0xf1aa,0x15e));var _0xaf1a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf1aa[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xaf1a('0x0'));var util=require(_0xaf1a('0x1'));var logger=require(_0xaf1a('0x2'))(_0xaf1a('0x3'));var moment=require(_0xaf1a('0x4'));var BPromise=require('bluebird');var rp=require(_0xaf1a('0x5'));var fs=require('fs');var path=require(_0xaf1a('0x6'));var rimraf=require(_0xaf1a('0x7'));var config=require(_0xaf1a('0x8'));var attributes=require(_0xaf1a('0x9'));module[_0xaf1a('0xa')]=function(_0x3d739d,_0x4fb2dd){return _0x3d739d[_0xaf1a('0xb')](_0xaf1a('0xc'),attributes,{'tableName':_0xaf1a('0xd'),'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 33d75e8..1b23a34 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 _0x6f54=['find','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','debug','ShowChatQueue','ChatQueue'];(function(_0x568e42,_0x1e6554){var _0x4f05be=function(_0x4447b6){while(--_0x4447b6){_0x568e42['push'](_0x568e42['shift']());}};_0x4f05be(++_0x1e6554);}(_0x6f54,0xcf));var _0x46f5=function(_0x4bdd47,_0x15f10e){_0x4bdd47=_0x4bdd47-0x0;var _0x2975df=_0x6f54[_0x4bdd47];return _0x2975df;};'use strict';var _=require(_0x46f5('0x0'));var util=require(_0x46f5('0x1'));var moment=require(_0x46f5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46f5('0x3'));var db=require(_0x46f5('0x4'))['db'];var utils=require(_0x46f5('0x5'));var logger=require(_0x46f5('0x6'))('rpc');var config=require(_0x46f5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x46f5('0x8')]({'port':0x232a});config['redis']=_[_0x46f5('0x9')](config[_0x46f5('0xa')],{'host':_0x46f5('0xb'),'port':0x18eb});var socket=require(_0x46f5('0xc'))(new Redis(config[_0x46f5('0xa')]));require(_0x46f5('0xd'))[_0x46f5('0xe')](socket);function respondWithRpcPromise(_0x22fe4e,_0x1a6660,_0x356a21){return new BPromise(function(_0x359b6e,_0x18fdc3){return client[_0x46f5('0xf')](_0x22fe4e,_0x356a21)[_0x46f5('0x10')](function(_0x4b946d){logger[_0x46f5('0x11')](_0x46f5('0x12'),_0x1a6660,_0x46f5('0x13'));logger['debug'](_0x46f5('0x14'),_0x1a6660,_0x46f5('0x13'),JSON['stringify'](_0x4b946d));if(_0x4b946d[_0x46f5('0x15')]){if(_0x4b946d[_0x46f5('0x15')][_0x46f5('0x16')]===0x1f4){logger[_0x46f5('0x15')]('ChatQueue,\x20%s,\x20%s',_0x1a6660,_0x4b946d['error'][_0x46f5('0x17')]);return _0x18fdc3(_0x4b946d[_0x46f5('0x15')][_0x46f5('0x17')]);}logger[_0x46f5('0x15')](_0x46f5('0x12'),_0x1a6660,_0x4b946d[_0x46f5('0x15')][_0x46f5('0x17')]);return _0x359b6e(_0x4b946d[_0x46f5('0x15')][_0x46f5('0x17')]);}else{logger[_0x46f5('0x11')](_0x46f5('0x12'),_0x1a6660,'request\x20sent');_0x359b6e(_0x4b946d[_0x46f5('0x18')][_0x46f5('0x17')]);}})[_0x46f5('0x19')](function(_0x9f9165){logger['error'](_0x46f5('0x12'),_0x1a6660,_0x9f9165);_0x18fdc3(_0x9f9165);});});}exports[_0x46f5('0x1a')]=function(_0x2511d8){var _0x2094b0=this;return new Promise(function(_0xf3a7e9,_0x425a2e){return db['ChatQueue'][_0x46f5('0x1b')]({'raw':_0x2511d8[_0x46f5('0x1c')]?_0x2511d8[_0x46f5('0x1c')][_0x46f5('0x1d')]===undefined?!![]:![]:!![],'where':_0x2511d8['options']?_0x2511d8['options'][_0x46f5('0x1e')]||null:null,'attributes':_0x2511d8[_0x46f5('0x1c')]?_0x2511d8[_0x46f5('0x1c')][_0x46f5('0x1f')]||null:null,'limit':_0x2511d8['options']?_0x2511d8['options'][_0x46f5('0x20')]||null:null,'include':_0x2511d8['options']?_0x2511d8[_0x46f5('0x1c')][_0x46f5('0x21')]?_['map'](_0x2511d8[_0x46f5('0x1c')][_0x46f5('0x21')],function(_0x21374d){return{'model':db[_0x21374d[_0x46f5('0x22')]],'as':_0x21374d['as'],'attributes':_0x21374d['attributes'],'include':_0x21374d['include']?_[_0x46f5('0x23')](_0x21374d[_0x46f5('0x21')],function(_0x4b2769){return{'model':db[_0x4b2769['model']],'as':_0x4b2769['as'],'attributes':_0x4b2769[_0x46f5('0x1f')],'include':_0x4b2769[_0x46f5('0x21')]?_[_0x46f5('0x23')](_0x4b2769['include'],function(_0x48b761){return{'model':db[_0x48b761['model']],'as':_0x48b761['as'],'attributes':_0x48b761[_0x46f5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x46f5('0x10')](function(_0x42837f){logger['info'](_0x46f5('0x1a'),_0x2511d8);logger[_0x46f5('0x24')]('GetChatQueue',_0x2511d8,JSON['stringify'](_0x42837f));_0xf3a7e9(_0x42837f);})[_0x46f5('0x19')](function(_0x456c02){logger[_0x46f5('0x15')](_0x46f5('0x1a'),_0x456c02[_0x46f5('0x17')],_0x2511d8);_0x425a2e(_0x2094b0['error'](0x1f4,_0x456c02[_0x46f5('0x17')]));});});};exports[_0x46f5('0x25')]=function(_0x131f15){var _0x503262=this;return new Promise(function(_0x491aff,_0x5d0c51){return db[_0x46f5('0x26')][_0x46f5('0x27')]({'raw':_0x131f15[_0x46f5('0x1c')]?_0x131f15['options'][_0x46f5('0x1d')]===undefined?!![]:![]:!![],'where':_0x131f15[_0x46f5('0x1c')]?_0x131f15['options'][_0x46f5('0x1e')]||null:null,'attributes':_0x131f15[_0x46f5('0x1c')]?_0x131f15[_0x46f5('0x1c')][_0x46f5('0x1f')]||null:null,'include':_0x131f15['options']?_0x131f15[_0x46f5('0x1c')]['include']?_[_0x46f5('0x23')](_0x131f15['options'][_0x46f5('0x21')],function(_0x1dd293){return{'model':db[_0x1dd293[_0x46f5('0x22')]],'as':_0x1dd293['as'],'attributes':_0x1dd293['attributes'],'include':_0x1dd293[_0x46f5('0x21')]?_[_0x46f5('0x23')](_0x1dd293[_0x46f5('0x21')],function(_0x1ad90c){return{'model':db[_0x1ad90c[_0x46f5('0x22')]],'as':_0x1ad90c['as'],'attributes':_0x1ad90c['attributes'],'include':_0x1ad90c[_0x46f5('0x21')]?_[_0x46f5('0x23')](_0x1ad90c[_0x46f5('0x21')],function(_0x232e68){return{'model':db[_0x232e68['model']],'as':_0x232e68['as'],'attributes':_0x232e68[_0x46f5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x46f5('0x10')](function(_0xcb164c){logger['info'](_0x46f5('0x25'),_0x131f15);logger[_0x46f5('0x24')](_0x46f5('0x25'),_0x131f15,JSON[_0x46f5('0x28')](_0xcb164c));_0x491aff(_0xcb164c);})[_0x46f5('0x19')](function(_0x5257ce){logger[_0x46f5('0x15')](_0x46f5('0x25'),_0x5257ce[_0x46f5('0x17')],_0x131f15);_0x5d0c51(_0x503262[_0x46f5('0x15')](0x1f4,_0x5257ce[_0x46f5('0x17')]));});});};
\ No newline at end of file
+var _0x2e16=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatQueue','options','raw','where','attributes','limit','include','map','model','debug','GetChatQueue','catch','ShowChatQueue','lodash','randomstring','ioredis'];(function(_0x434c9e,_0xba1333){var _0x5b7169=function(_0x5cd22c){while(--_0x5cd22c){_0x434c9e['push'](_0x434c9e['shift']());}};_0x5b7169(++_0xba1333);}(_0x2e16,0x8d));var _0x62e1=function(_0xb40024,_0x26f783){_0xb40024=_0xb40024-0x0;var _0x57ecb4=_0x2e16[_0xb40024];return _0x57ecb4;};'use strict';var _=require(_0x62e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x62e1('0x1'));var fs=require('fs');var Redis=require(_0x62e1('0x2'));var db=require(_0x62e1('0x3'))['db'];var utils=require(_0x62e1('0x4'));var logger=require('../../config/logger')(_0x62e1('0x5'));var config=require(_0x62e1('0x6'));var jayson=require(_0x62e1('0x7'));var client=jayson[_0x62e1('0x8')][_0x62e1('0x9')]({'port':0x232a});config[_0x62e1('0xa')]=_[_0x62e1('0xb')](config[_0x62e1('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x62e1('0xc'))(new Redis(config[_0x62e1('0xa')]));require('./chatQueue.socket')[_0x62e1('0xd')](socket);function respondWithRpcPromise(_0x528ec6,_0x4f66e4,_0x2bd27c){return new BPromise(function(_0xbc14e4,_0x3d741f){return client[_0x62e1('0xe')](_0x528ec6,_0x2bd27c)[_0x62e1('0xf')](function(_0xab7486){logger[_0x62e1('0x10')](_0x62e1('0x11'),_0x4f66e4,_0x62e1('0x12'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4f66e4,_0x62e1('0x12'),JSON[_0x62e1('0x13')](_0xab7486));if(_0xab7486[_0x62e1('0x14')]){if(_0xab7486[_0x62e1('0x14')][_0x62e1('0x15')]===0x1f4){logger[_0x62e1('0x14')]('ChatQueue,\x20%s,\x20%s',_0x4f66e4,_0xab7486[_0x62e1('0x14')][_0x62e1('0x16')]);return _0x3d741f(_0xab7486['error'][_0x62e1('0x16')]);}logger[_0x62e1('0x14')]('ChatQueue,\x20%s,\x20%s',_0x4f66e4,_0xab7486[_0x62e1('0x14')][_0x62e1('0x16')]);return _0xbc14e4(_0xab7486['error'][_0x62e1('0x16')]);}else{logger['info'](_0x62e1('0x11'),_0x4f66e4,_0x62e1('0x12'));_0xbc14e4(_0xab7486['result']['message']);}})['catch'](function(_0x4d63a0){logger[_0x62e1('0x14')](_0x62e1('0x11'),_0x4f66e4,_0x4d63a0);_0x3d741f(_0x4d63a0);});});}exports['GetChatQueue']=function(_0x295f93){var _0x3bdf8e=this;return new Promise(function(_0x5d1142,_0x3a232a){return db[_0x62e1('0x17')]['findAll']({'raw':_0x295f93[_0x62e1('0x18')]?_0x295f93[_0x62e1('0x18')][_0x62e1('0x19')]===undefined?!![]:![]:!![],'where':_0x295f93['options']?_0x295f93[_0x62e1('0x18')][_0x62e1('0x1a')]||null:null,'attributes':_0x295f93[_0x62e1('0x18')]?_0x295f93[_0x62e1('0x18')][_0x62e1('0x1b')]||null:null,'limit':_0x295f93[_0x62e1('0x18')]?_0x295f93[_0x62e1('0x18')][_0x62e1('0x1c')]||null:null,'include':_0x295f93[_0x62e1('0x18')]?_0x295f93['options'][_0x62e1('0x1d')]?_['map'](_0x295f93[_0x62e1('0x18')][_0x62e1('0x1d')],function(_0xba9310){return{'model':db[_0xba9310['model']],'as':_0xba9310['as'],'attributes':_0xba9310[_0x62e1('0x1b')],'include':_0xba9310[_0x62e1('0x1d')]?_[_0x62e1('0x1e')](_0xba9310['include'],function(_0x563338){return{'model':db[_0x563338['model']],'as':_0x563338['as'],'attributes':_0x563338['attributes'],'include':_0x563338[_0x62e1('0x1d')]?_[_0x62e1('0x1e')](_0x563338[_0x62e1('0x1d')],function(_0x48cb73){return{'model':db[_0x48cb73[_0x62e1('0x1f')]],'as':_0x48cb73['as'],'attributes':_0x48cb73[_0x62e1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x62e1('0xf')](function(_0x9b39f2){logger[_0x62e1('0x10')]('GetChatQueue',_0x295f93);logger[_0x62e1('0x20')](_0x62e1('0x21'),_0x295f93,JSON[_0x62e1('0x13')](_0x9b39f2));_0x5d1142(_0x9b39f2);})[_0x62e1('0x22')](function(_0x4482d8){logger['error'](_0x62e1('0x21'),_0x4482d8[_0x62e1('0x16')],_0x295f93);_0x3a232a(_0x3bdf8e[_0x62e1('0x14')](0x1f4,_0x4482d8[_0x62e1('0x16')]));});});};exports[_0x62e1('0x23')]=function(_0x4c0d52){var _0x24cdb5=this;return new Promise(function(_0x405981,_0x48cb78){return db[_0x62e1('0x17')]['find']({'raw':_0x4c0d52[_0x62e1('0x18')]?_0x4c0d52['options'][_0x62e1('0x19')]===undefined?!![]:![]:!![],'where':_0x4c0d52[_0x62e1('0x18')]?_0x4c0d52[_0x62e1('0x18')][_0x62e1('0x1a')]||null:null,'attributes':_0x4c0d52[_0x62e1('0x18')]?_0x4c0d52[_0x62e1('0x18')][_0x62e1('0x1b')]||null:null,'include':_0x4c0d52[_0x62e1('0x18')]?_0x4c0d52['options'][_0x62e1('0x1d')]?_[_0x62e1('0x1e')](_0x4c0d52['options'][_0x62e1('0x1d')],function(_0x421d76){return{'model':db[_0x421d76[_0x62e1('0x1f')]],'as':_0x421d76['as'],'attributes':_0x421d76[_0x62e1('0x1b')],'include':_0x421d76[_0x62e1('0x1d')]?_[_0x62e1('0x1e')](_0x421d76[_0x62e1('0x1d')],function(_0x5393c2){return{'model':db[_0x5393c2[_0x62e1('0x1f')]],'as':_0x5393c2['as'],'attributes':_0x5393c2[_0x62e1('0x1b')],'include':_0x5393c2[_0x62e1('0x1d')]?_['map'](_0x5393c2[_0x62e1('0x1d')],function(_0x4a5b91){return{'model':db[_0x4a5b91[_0x62e1('0x1f')]],'as':_0x4a5b91['as'],'attributes':_0x4a5b91[_0x62e1('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35e413){logger['info'](_0x62e1('0x23'),_0x4c0d52);logger[_0x62e1('0x20')]('ShowChatQueue',_0x4c0d52,JSON[_0x62e1('0x13')](_0x35e413));_0x405981(_0x35e413);})[_0x62e1('0x22')](function(_0x28a416){logger['error'](_0x62e1('0x23'),_0x28a416[_0x62e1('0x16')],_0x4c0d52);_0x48cb78(_0x24cdb5[_0x62e1('0x14')](0x1f4,_0x28a416[_0x62e1('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index ba01ef5..7c7a57f 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 _0xb903=['update','emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x40dd56,_0x726ca5){var _0x4f850f=function(_0x5f899e){while(--_0x5f899e){_0x40dd56['push'](_0x40dd56['shift']());}};_0x4f850f(++_0x726ca5);}(_0xb903,0x185));var _0x3b90=function(_0x29b37a,_0x5debfe){_0x29b37a=_0x29b37a-0x0;var _0x5d9d3f=_0xb903[_0x29b37a];return _0x5d9d3f;};'use strict';var ChatQueueEvents=require(_0x3b90('0x0'));var events=[_0x3b90('0x1'),_0x3b90('0x2'),_0x3b90('0x3')];function createListener(_0x5191d8,_0x3312ca){return function(_0xf414f4){_0x3312ca[_0x3b90('0x4')](_0x5191d8,_0xf414f4);};}function removeListener(_0x1cd5d8,_0x30d8db){return function(){ChatQueueEvents[_0x3b90('0x5')](_0x1cd5d8,_0x30d8db);};}exports[_0x3b90('0x6')]=function(_0x5acd76){for(var _0x15b68f=0x0,_0x5e845a=events['length'];_0x15b68f<_0x5e845a;_0x15b68f++){var _0x153283=events[_0x15b68f];var _0x2e4c06=createListener(_0x3b90('0x7')+_0x153283,_0x5acd76);ChatQueueEvents['on'](_0x153283,_0x2e4c06);}};
\ No newline at end of file
+var _0x9a19=['removeListener','register','chatQueue:','./chatQueue.events','save','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a19,0x114));var _0x99a1=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x9a19[_0x2b9b7f];return _0x4ed19a;};'use strict';var ChatQueueEvents=require(_0x99a1('0x0'));var events=[_0x99a1('0x1'),_0x99a1('0x2'),'update'];function createListener(_0x16fd8b,_0x2ba463){return function(_0x112bcc){_0x2ba463[_0x99a1('0x3')](_0x16fd8b,_0x112bcc);};}function removeListener(_0x214082,_0x3d73c5){return function(){ChatQueueEvents[_0x99a1('0x4')](_0x214082,_0x3d73c5);};}exports[_0x99a1('0x5')]=function(_0x3eff4a){for(var _0xff0240=0x0,_0x65045d=events['length'];_0xff0240<_0x65045d;_0xff0240++){var _0x4d2a5c=events[_0xff0240];var _0x5aa6c2=createListener(_0x99a1('0x6')+_0x4d2a5c,_0x3eff4a);ChatQueueEvents['on'](_0x4d2a5c,_0x5aa6c2);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index b5766ab..7365171 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x5e60dd,_0x117397){var _0x2fd44e=function(_0x15f7a4){while(--_0x15f7a4){_0x5e60dd['push'](_0x5e60dd['shift']());}};_0x2fd44e(++_0x117397);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x36a00a,_0x86031f){var _0x4fba83=function(_0x5574f2){while(--_0x5574f2){_0x36a00a['push'](_0x36a00a['shift']());}};_0x4fba83(++_0x86031f);}(_0x7217,0x19e));var _0x7721=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x7217[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 8978c59..e0b62b7 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 _0x20ae=['moment','sequelize','STRING','DATE'];(function(_0x31e482,_0x183b9c){var _0x214aa8=function(_0x281c79){while(--_0x281c79){_0x31e482['push'](_0x31e482['shift']());}};_0x214aa8(++_0x183b9c);}(_0x20ae,0x120));var _0xe20a=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x20ae[_0x167cc1];return _0x10bc4b;};'use strict';var moment=require(_0xe20a('0x0'));var Sequelize=require(_0xe20a('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe20a('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe20a('0x3')]},'leaveAt':{'type':Sequelize[_0xe20a('0x3')]},'acceptAt':{'type':Sequelize[_0xe20a('0x3')]},'exitAt':{'type':Sequelize[_0xe20a('0x3')]},'reason':{'type':Sequelize[_0xe20a('0x2')]}};
\ No newline at end of file
+var _0x3954=['DATE','moment','sequelize','STRING'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3954,0x16d));var _0x4395=function(_0x5c2c9d,_0x4fafe1){_0x5c2c9d=_0x5c2c9d-0x0;var _0x20cda4=_0x3954[_0x5c2c9d];return _0x20cda4;};'use strict';var moment=require(_0x4395('0x0'));var Sequelize=require(_0x4395('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x4395('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x4395('0x3')]},'leaveAt':{'type':Sequelize[_0x4395('0x3')]},'acceptAt':{'type':Sequelize[_0x4395('0x3')]},'exitAt':{'type':Sequelize[_0x4395('0x3')]},'reason':{'type':Sequelize[_0x4395('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index f6945d4..ba6fee8 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 _0x7b84=['map','ChatQueueReport','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x7b84,0x167));var _0x47b8=function(_0x49f3c3,_0x1c2be1){_0x49f3c3=_0x49f3c3-0x0;var _0x32e69b=_0x7b84[_0x49f3c3];return _0x32e69b;};'use strict';var emlformat=require(_0x47b8('0x0'));var rimraf=require(_0x47b8('0x1'));var zipdir=require(_0x47b8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x47b8('0x3'));var BPromise=require(_0x47b8('0x4'));var Mustache=require(_0x47b8('0x5'));var util=require(_0x47b8('0x6'));var path=require(_0x47b8('0x7'));var sox=require(_0x47b8('0x8'));var csv=require(_0x47b8('0x9'));var ejs=require(_0x47b8('0xa'));var fs=require('fs');var fs_extra=require(_0x47b8('0xb'));var _=require(_0x47b8('0xc'));var squel=require(_0x47b8('0xd'));var crypto=require(_0x47b8('0xe'));var jsforce=require(_0x47b8('0xf'));var deskjs=require(_0x47b8('0x10'));var toCsv=require(_0x47b8('0x9'));var querystring=require(_0x47b8('0x11'));var Papa=require(_0x47b8('0x12'));var Redis=require(_0x47b8('0x13'));var authService=require(_0x47b8('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x47b8('0x15'));var logger=require(_0x47b8('0x16'))(_0x47b8('0x17'));var utils=require(_0x47b8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x47b8('0x19'));var db=require(_0x47b8('0x1a'))['db'];function respondWithStatusCode(_0x50ff5e,_0x1c3cfd){_0x1c3cfd=_0x1c3cfd||0xcc;return function(_0x4e843f){if(_0x4e843f){return _0x50ff5e[_0x47b8('0x1b')](_0x1c3cfd);}return _0x50ff5e[_0x47b8('0x1c')](_0x1c3cfd)[_0x47b8('0x1d')]();};}function respondWithResult(_0x49834d,_0x59388e){_0x59388e=_0x59388e||0xc8;return function(_0x1b1bc4){if(_0x1b1bc4){return _0x49834d['status'](_0x59388e)[_0x47b8('0x1e')](_0x1b1bc4);}};}function respondWithFilteredResult(_0x30fc0b,_0x105e29){return function(_0x1db4de){if(_0x1db4de){var _0x67a4=typeof _0x105e29[_0x47b8('0x1f')]===_0x47b8('0x20')&&typeof _0x105e29[_0x47b8('0x21')]===_0x47b8('0x20');var _0x5dfacd=_0x1db4de[_0x47b8('0x22')];var _0x4c1c0b=_0x67a4?0x0:_0x105e29[_0x47b8('0x1f')];var _0x3da863=_0x67a4?_0x1db4de[_0x47b8('0x22')]:_0x105e29['offset']+_0x105e29[_0x47b8('0x21')];var _0x50f1ae;if(_0x3da863>=_0x5dfacd){_0x3da863=_0x5dfacd;_0x50f1ae=0xc8;}else{_0x50f1ae=0xce;}_0x30fc0b['status'](_0x50f1ae);return _0x30fc0b[_0x47b8('0x23')]('Content-Range',_0x4c1c0b+'-'+_0x3da863+'/'+_0x5dfacd)[_0x47b8('0x1e')](_0x1db4de);}return null;};}function patchUpdates(_0x227cd7){return function(_0x347306){try{jsonpatch[_0x47b8('0x24')](_0x347306,_0x227cd7,!![]);}catch(_0x3a764c){return BPromise[_0x47b8('0x25')](_0x3a764c);}return _0x347306[_0x47b8('0x26')]();};}function saveUpdates(_0x3a45c6,_0x51b6b9){return function(_0x153159){if(_0x153159){return _0x153159[_0x47b8('0x27')](_0x3a45c6)[_0x47b8('0x28')](function(_0x556a09){return _0x556a09;});}return null;};}function removeEntity(_0x3423e2,_0x1f1dd3){return function(_0x251756){if(_0x251756){return _0x251756['destroy']()[_0x47b8('0x28')](function(){_0x3423e2['status'](0xcc)[_0x47b8('0x1d')]();});}};}function handleEntityNotFound(_0x511dbd,_0x62c5db){return function(_0x3e40a1){if(!_0x3e40a1){_0x511dbd[_0x47b8('0x1b')](0x194);}return _0x3e40a1;};}function handleError(_0x177d5c,_0x287ce5){_0x287ce5=_0x287ce5||0x1f4;return function(_0x1dcd63){logger[_0x47b8('0x29')](_0x1dcd63[_0x47b8('0x2a')]);if(_0x1dcd63[_0x47b8('0x2b')]){delete _0x1dcd63[_0x47b8('0x2b')];}_0x177d5c[_0x47b8('0x1c')](_0x287ce5)[_0x47b8('0x2c')](_0x1dcd63);};}exports[_0x47b8('0x2d')]=function(_0x19a605,_0x573c69){var _0x541e0a={},_0x23a317={},_0x9edecd={'count':0x0,'rows':[]};var _0x3e7406=_[_0x47b8('0x2e')](db[_0x47b8('0x2f')]['rawAttributes'],function(_0x4ddef7){return{'name':_0x4ddef7[_0x47b8('0x30')],'type':_0x4ddef7['type'][_0x47b8('0x31')]};});_0x23a317[_0x47b8('0x32')]=_[_0x47b8('0x2e')](_0x3e7406,'name');_0x23a317[_0x47b8('0x33')]=_['keys'](_0x19a605[_0x47b8('0x33')]);_0x23a317['filters']=_[_0x47b8('0x34')](_0x23a317[_0x47b8('0x32')],_0x23a317['query']);_0x541e0a['attributes']=_[_0x47b8('0x34')](_0x23a317['model'],qs[_0x47b8('0x35')](_0x19a605[_0x47b8('0x33')][_0x47b8('0x35')]));_0x541e0a[_0x47b8('0x36')]=_0x541e0a[_0x47b8('0x36')][_0x47b8('0x37')]?_0x541e0a['attributes']:_0x23a317[_0x47b8('0x32')];if(!_0x19a605[_0x47b8('0x33')][_0x47b8('0x38')](_0x47b8('0x39'))){_0x541e0a[_0x47b8('0x21')]=qs[_0x47b8('0x21')](_0x19a605[_0x47b8('0x33')][_0x47b8('0x21')]);_0x541e0a['offset']=qs[_0x47b8('0x1f')](_0x19a605['query'][_0x47b8('0x1f')]);}_0x541e0a[_0x47b8('0x3a')]=qs[_0x47b8('0x3b')](_0x19a605[_0x47b8('0x33')][_0x47b8('0x3b')]);_0x541e0a[_0x47b8('0x3c')]=qs[_0x47b8('0x3d')](_[_0x47b8('0x3e')](_0x19a605[_0x47b8('0x33')],_0x23a317['filters']),_0x3e7406);if(_0x19a605['query'][_0x47b8('0x3f')]){_0x541e0a[_0x47b8('0x3c')]=_['merge'](_0x541e0a[_0x47b8('0x3c')],{'$or':_[_0x47b8('0x2e')](_0x3e7406,function(_0x52155b){if(_0x52155b[_0x47b8('0x40')]!==_0x47b8('0x41')){var _0x290c0a={};_0x290c0a[_0x52155b[_0x47b8('0x2b')]]={'$like':'%'+_0x19a605[_0x47b8('0x33')]['filter']+'%'};return _0x290c0a;}})});}_0x541e0a=_['merge']({},_0x541e0a,_0x19a605[_0x47b8('0x42')]);var _0xe80645={'where':_0x541e0a[_0x47b8('0x3c')]};return db[_0x47b8('0x2f')][_0x47b8('0x22')](_0xe80645)[_0x47b8('0x28')](function(_0x98aadb){_0x9edecd['count']=_0x98aadb;if(_0x19a605[_0x47b8('0x33')][_0x47b8('0x43')]){_0x541e0a[_0x47b8('0x44')]=[{'all':!![]}];}return db[_0x47b8('0x2f')][_0x47b8('0x45')](_0x541e0a);})[_0x47b8('0x28')](function(_0x576f23){_0x9edecd[_0x47b8('0x46')]=_0x576f23;return _0x9edecd;})[_0x47b8('0x28')](respondWithFilteredResult(_0x573c69,_0x541e0a))[_0x47b8('0x47')](handleError(_0x573c69,null));};exports[_0x47b8('0x48')]=function(_0x331a1d,_0x4a85be){var _0x56c59d={'raw':!![],'where':{'id':_0x331a1d['params']['id']}},_0x99ded6={};_0x99ded6[_0x47b8('0x32')]=_[_0x47b8('0x49')](db['ChatQueueReport'][_0x47b8('0x4a')]);_0x99ded6['query']=_[_0x47b8('0x49')](_0x331a1d[_0x47b8('0x33')]);_0x99ded6[_0x47b8('0x3d')]=_[_0x47b8('0x34')](_0x99ded6[_0x47b8('0x32')],_0x99ded6['query']);_0x56c59d[_0x47b8('0x36')]=_[_0x47b8('0x34')](_0x99ded6['model'],qs[_0x47b8('0x35')](_0x331a1d[_0x47b8('0x33')][_0x47b8('0x35')]));_0x56c59d[_0x47b8('0x36')]=_0x56c59d[_0x47b8('0x36')][_0x47b8('0x37')]?_0x56c59d[_0x47b8('0x36')]:_0x99ded6[_0x47b8('0x32')];if(_0x331a1d[_0x47b8('0x33')][_0x47b8('0x43')]){_0x56c59d[_0x47b8('0x44')]=[{'all':!![]}];}_0x56c59d=_['merge']({},_0x56c59d,_0x331a1d[_0x47b8('0x42')]);return db[_0x47b8('0x2f')][_0x47b8('0x4b')](_0x56c59d)['then'](handleEntityNotFound(_0x4a85be,null))[_0x47b8('0x28')](respondWithResult(_0x4a85be,null))['catch'](handleError(_0x4a85be,null));};exports[_0x47b8('0x4c')]=function(_0x4aed88,_0x35f4db){return db[_0x47b8('0x2f')][_0x47b8('0x4c')](_0x4aed88[_0x47b8('0x4d')],{})['then'](respondWithResult(_0x35f4db,0xc9))[_0x47b8('0x47')](handleError(_0x35f4db,null));};exports[_0x47b8('0x27')]=function(_0x165a31,_0x140df1){if(_0x165a31['body']['id']){delete _0x165a31[_0x47b8('0x4d')]['id'];}return db[_0x47b8('0x2f')][_0x47b8('0x4b')]({'where':{'id':_0x165a31[_0x47b8('0x4e')]['id']}})[_0x47b8('0x28')](handleEntityNotFound(_0x140df1,null))[_0x47b8('0x28')](saveUpdates(_0x165a31['body'],null))[_0x47b8('0x28')](respondWithResult(_0x140df1,null))[_0x47b8('0x47')](handleError(_0x140df1,null));};exports[_0x47b8('0x4f')]=function(_0x562eff,_0x411b23){return db[_0x47b8('0x2f')][_0x47b8('0x4b')]({'where':{'id':_0x562eff[_0x47b8('0x4e')]['id']}})['then'](handleEntityNotFound(_0x411b23,null))['then'](removeEntity(_0x411b23,null))[_0x47b8('0x47')](handleError(_0x411b23,null));};exports[_0x47b8('0x50')]=function(_0x814e6c,_0x9e4104){return db[_0x47b8('0x2f')][_0x47b8('0x50')]()[_0x47b8('0x28')](respondWithResult(_0x9e4104,null))[_0x47b8('0x47')](handleError(_0x9e4104,null));};
\ No newline at end of file
+var _0x1115=['crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatQueueReport','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1115,0x1b6));var _0x5111=function(_0x5ec706,_0x60f8df){_0x5ec706=_0x5ec706-0x0;var _0x391992=_0x1115[_0x5ec706];return _0x391992;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5111('0x0'));var zipdir=require(_0x5111('0x1'));var jsonpatch=require(_0x5111('0x2'));var rp=require(_0x5111('0x3'));var moment=require(_0x5111('0x4'));var BPromise=require(_0x5111('0x5'));var Mustache=require(_0x5111('0x6'));var util=require(_0x5111('0x7'));var path=require(_0x5111('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5111('0x9'));var fs=require('fs');var fs_extra=require(_0x5111('0xa'));var _=require('lodash');var squel=require(_0x5111('0xb'));var crypto=require(_0x5111('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5111('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5111('0xe'));var Papa=require(_0x5111('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5111('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5111('0x11'));var logger=require('../../config/logger')(_0x5111('0x12'));var utils=require(_0x5111('0x13'));var config=require(_0x5111('0x14'));var licenseUtil=require(_0x5111('0x15'));var db=require(_0x5111('0x16'))['db'];function respondWithStatusCode(_0x54f83a,_0x266625){_0x266625=_0x266625||0xcc;return function(_0x14b4e3){if(_0x14b4e3){return _0x54f83a[_0x5111('0x17')](_0x266625);}return _0x54f83a[_0x5111('0x18')](_0x266625)[_0x5111('0x19')]();};}function respondWithResult(_0x62ce44,_0x264703){_0x264703=_0x264703||0xc8;return function(_0x3e60b5){if(_0x3e60b5){return _0x62ce44[_0x5111('0x18')](_0x264703)[_0x5111('0x1a')](_0x3e60b5);}};}function respondWithFilteredResult(_0x77ddfd,_0x45052e){return function(_0x478b68){if(_0x478b68){var _0x1ac606=typeof _0x45052e['offset']==='undefined'&&typeof _0x45052e[_0x5111('0x1b')]===_0x5111('0x1c');var _0x638470=_0x478b68['count'];var _0x367f8d=_0x1ac606?0x0:_0x45052e[_0x5111('0x1d')];var _0x52c614=_0x1ac606?_0x478b68[_0x5111('0x1e')]:_0x45052e[_0x5111('0x1d')]+_0x45052e[_0x5111('0x1b')];var _0x1b3b45;if(_0x52c614>=_0x638470){_0x52c614=_0x638470;_0x1b3b45=0xc8;}else{_0x1b3b45=0xce;}_0x77ddfd['status'](_0x1b3b45);return _0x77ddfd[_0x5111('0x1f')](_0x5111('0x20'),_0x367f8d+'-'+_0x52c614+'/'+_0x638470)[_0x5111('0x1a')](_0x478b68);}return null;};}function patchUpdates(_0x1b3136){return function(_0x22c7cd){try{jsonpatch[_0x5111('0x21')](_0x22c7cd,_0x1b3136,!![]);}catch(_0x3e8de1){return BPromise[_0x5111('0x22')](_0x3e8de1);}return _0x22c7cd[_0x5111('0x23')]();};}function saveUpdates(_0x3a3fae,_0x4b73ce){return function(_0x3f462d){if(_0x3f462d){return _0x3f462d[_0x5111('0x24')](_0x3a3fae)[_0x5111('0x25')](function(_0x5bf534){return _0x5bf534;});}return null;};}function removeEntity(_0x28cc87,_0x20a4f7){return function(_0x2d9446){if(_0x2d9446){return _0x2d9446[_0x5111('0x26')]()[_0x5111('0x25')](function(){_0x28cc87[_0x5111('0x18')](0xcc)[_0x5111('0x19')]();});}};}function handleEntityNotFound(_0x316b39,_0x382bd0){return function(_0x1a5793){if(!_0x1a5793){_0x316b39['sendStatus'](0x194);}return _0x1a5793;};}function handleError(_0x1bdd54,_0x3d6825){_0x3d6825=_0x3d6825||0x1f4;return function(_0x151b67){logger[_0x5111('0x27')](_0x151b67[_0x5111('0x28')]);if(_0x151b67[_0x5111('0x29')]){delete _0x151b67[_0x5111('0x29')];}_0x1bdd54['status'](_0x3d6825)[_0x5111('0x2a')](_0x151b67);};}exports[_0x5111('0x2b')]=function(_0x25a75a,_0x5efec6){var _0xdf9031={},_0x28efc1={},_0x16107a={'count':0x0,'rows':[]};var _0x48379a=_['map'](db[_0x5111('0x2c')]['rawAttributes'],function(_0xbacf9e){return{'name':_0xbacf9e['fieldName'],'type':_0xbacf9e[_0x5111('0x2d')]['key']};});_0x28efc1['model']=_['map'](_0x48379a,_0x5111('0x29'));_0x28efc1[_0x5111('0x2e')]=_[_0x5111('0x2f')](_0x25a75a[_0x5111('0x2e')]);_0x28efc1[_0x5111('0x30')]=_[_0x5111('0x31')](_0x28efc1[_0x5111('0x32')],_0x28efc1['query']);_0xdf9031[_0x5111('0x33')]=_[_0x5111('0x31')](_0x28efc1[_0x5111('0x32')],qs[_0x5111('0x34')](_0x25a75a['query']['fields']));_0xdf9031[_0x5111('0x33')]=_0xdf9031[_0x5111('0x33')][_0x5111('0x35')]?_0xdf9031[_0x5111('0x33')]:_0x28efc1[_0x5111('0x32')];if(!_0x25a75a[_0x5111('0x2e')][_0x5111('0x36')](_0x5111('0x37'))){_0xdf9031['limit']=qs[_0x5111('0x1b')](_0x25a75a[_0x5111('0x2e')][_0x5111('0x1b')]);_0xdf9031['offset']=qs[_0x5111('0x1d')](_0x25a75a[_0x5111('0x2e')][_0x5111('0x1d')]);}_0xdf9031['order']=qs['sort'](_0x25a75a['query'][_0x5111('0x38')]);_0xdf9031[_0x5111('0x39')]=qs[_0x5111('0x30')](_[_0x5111('0x3a')](_0x25a75a[_0x5111('0x2e')],_0x28efc1['filters']),_0x48379a);if(_0x25a75a[_0x5111('0x2e')][_0x5111('0x3b')]){_0xdf9031[_0x5111('0x39')]=_[_0x5111('0x3c')](_0xdf9031['where'],{'$or':_[_0x5111('0x3d')](_0x48379a,function(_0x444d82){if(_0x444d82[_0x5111('0x2d')]!==_0x5111('0x3e')){var _0x2f0224={};_0x2f0224[_0x444d82[_0x5111('0x29')]]={'$like':'%'+_0x25a75a[_0x5111('0x2e')][_0x5111('0x3b')]+'%'};return _0x2f0224;}})});}_0xdf9031=_[_0x5111('0x3c')]({},_0xdf9031,_0x25a75a[_0x5111('0x3f')]);var _0x35c3b5={'where':_0xdf9031[_0x5111('0x39')]};return db[_0x5111('0x2c')]['count'](_0x35c3b5)[_0x5111('0x25')](function(_0xf00f9){_0x16107a['count']=_0xf00f9;if(_0x25a75a[_0x5111('0x2e')][_0x5111('0x40')]){_0xdf9031[_0x5111('0x41')]=[{'all':!![]}];}return db[_0x5111('0x2c')][_0x5111('0x42')](_0xdf9031);})[_0x5111('0x25')](function(_0x1f1534){_0x16107a['rows']=_0x1f1534;return _0x16107a;})[_0x5111('0x25')](respondWithFilteredResult(_0x5efec6,_0xdf9031))[_0x5111('0x43')](handleError(_0x5efec6,null));};exports[_0x5111('0x44')]=function(_0x1c2e17,_0x96893c){var _0x49307f={'raw':!![],'where':{'id':_0x1c2e17[_0x5111('0x45')]['id']}},_0x50a293={};_0x50a293[_0x5111('0x32')]=_['keys'](db[_0x5111('0x2c')][_0x5111('0x46')]);_0x50a293[_0x5111('0x2e')]=_[_0x5111('0x2f')](_0x1c2e17[_0x5111('0x2e')]);_0x50a293[_0x5111('0x30')]=_[_0x5111('0x31')](_0x50a293[_0x5111('0x32')],_0x50a293[_0x5111('0x2e')]);_0x49307f[_0x5111('0x33')]=_['intersection'](_0x50a293['model'],qs[_0x5111('0x34')](_0x1c2e17[_0x5111('0x2e')][_0x5111('0x34')]));_0x49307f[_0x5111('0x33')]=_0x49307f[_0x5111('0x33')][_0x5111('0x35')]?_0x49307f['attributes']:_0x50a293[_0x5111('0x32')];if(_0x1c2e17[_0x5111('0x2e')][_0x5111('0x40')]){_0x49307f[_0x5111('0x41')]=[{'all':!![]}];}_0x49307f=_['merge']({},_0x49307f,_0x1c2e17[_0x5111('0x3f')]);return db[_0x5111('0x2c')][_0x5111('0x47')](_0x49307f)['then'](handleEntityNotFound(_0x96893c,null))[_0x5111('0x25')](respondWithResult(_0x96893c,null))[_0x5111('0x43')](handleError(_0x96893c,null));};exports[_0x5111('0x48')]=function(_0x2d64de,_0x5cd7a5){return db['ChatQueueReport'][_0x5111('0x48')](_0x2d64de['body'],{})['then'](respondWithResult(_0x5cd7a5,0xc9))[_0x5111('0x43')](handleError(_0x5cd7a5,null));};exports[_0x5111('0x24')]=function(_0x4aa934,_0x296f87){if(_0x4aa934[_0x5111('0x49')]['id']){delete _0x4aa934[_0x5111('0x49')]['id'];}return db[_0x5111('0x2c')][_0x5111('0x47')]({'where':{'id':_0x4aa934[_0x5111('0x45')]['id']}})[_0x5111('0x25')](handleEntityNotFound(_0x296f87,null))[_0x5111('0x25')](saveUpdates(_0x4aa934[_0x5111('0x49')],null))[_0x5111('0x25')](respondWithResult(_0x296f87,null))[_0x5111('0x43')](handleError(_0x296f87,null));};exports[_0x5111('0x26')]=function(_0x53d631,_0x79427d){return db[_0x5111('0x2c')][_0x5111('0x47')]({'where':{'id':_0x53d631[_0x5111('0x45')]['id']}})[_0x5111('0x25')](handleEntityNotFound(_0x79427d,null))[_0x5111('0x25')](removeEntity(_0x79427d,null))[_0x5111('0x43')](handleError(_0x79427d,null));};exports['describe']=function(_0x55cba5,_0x13fe1b){return db['ChatQueueReport'][_0x5111('0x4a')]()[_0x5111('0x25')](respondWithResult(_0x13fe1b,null))[_0x5111('0x43')](handleError(_0x13fe1b,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 336656a..9854054 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x5071d9,_0x2dcf15){var _0x4b92d1=function(_0x2dfdd7){while(--_0x2dfdd7){_0x5071d9['push'](_0x5071d9['shift']());}};_0x4b92d1(++_0x2dcf15);}(_0xb7e7,0x121));var _0x7b7e=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xb7e7[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x19f9e6,_0x4f59a6){var _0x45c862=function(_0x3447fb){while(--_0x3447fb){_0x19f9e6['push'](_0x19f9e6['shift']());}};_0x45c862(++_0x4f59a6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index f6966b8..4a33dfe 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 _0x2b88=['jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','update','body','where','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1a9d06,_0x4c70e3){var _0x7776b9=function(_0x37dfc0){while(--_0x37dfc0){_0x1a9d06['push'](_0x1a9d06['shift']());}};_0x7776b9(++_0x4c70e3);}(_0x2b88,0x1b1));var _0x82b8=function(_0x5d5c49,_0x528f94){_0x5d5c49=_0x5d5c49-0x0;var _0x41cb72=_0x2b88[_0x5d5c49];return _0x41cb72;};'use strict';var _=require(_0x82b8('0x0'));var util=require(_0x82b8('0x1'));var moment=require('moment');var BPromise=require(_0x82b8('0x2'));var rs=require(_0x82b8('0x3'));var fs=require('fs');var Redis=require(_0x82b8('0x4'));var db=require(_0x82b8('0x5'))['db'];var utils=require(_0x82b8('0x6'));var logger=require('../../config/logger')(_0x82b8('0x7'));var config=require(_0x82b8('0x8'));var jayson=require(_0x82b8('0x9'));var client=jayson['client'][_0x82b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13f2d0,_0x41f35f,_0xccf541){return new BPromise(function(_0x30231a,_0x531491){return client[_0x82b8('0xb')](_0x13f2d0,_0xccf541)[_0x82b8('0xc')](function(_0x33a04a){logger[_0x82b8('0xd')](_0x82b8('0xe'),_0x41f35f,_0x82b8('0xf'));logger[_0x82b8('0x10')](_0x82b8('0x11'),_0x41f35f,_0x82b8('0xf'),JSON[_0x82b8('0x12')](_0x33a04a));if(_0x33a04a[_0x82b8('0x13')]){if(_0x33a04a[_0x82b8('0x13')][_0x82b8('0x14')]===0x1f4){logger[_0x82b8('0x13')](_0x82b8('0xe'),_0x41f35f,_0x33a04a[_0x82b8('0x13')][_0x82b8('0x15')]);return _0x531491(_0x33a04a[_0x82b8('0x13')]['message']);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x41f35f,_0x33a04a[_0x82b8('0x13')][_0x82b8('0x15')]);return _0x30231a(_0x33a04a[_0x82b8('0x13')]['message']);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x41f35f,'request\x20sent');_0x30231a(_0x33a04a[_0x82b8('0x16')][_0x82b8('0x15')]);}})[_0x82b8('0x17')](function(_0x35b09c){logger['error'](_0x82b8('0xe'),_0x41f35f,_0x35b09c);_0x531491(_0x35b09c);});});}exports[_0x82b8('0x18')]=function(_0x49a755){var _0x35324c=this;return new Promise(function(_0x2161e1,_0x33e945){return db[_0x82b8('0x19')][_0x82b8('0x1a')](_0x49a755['body'],{'raw':_0x49a755[_0x82b8('0x1b')]?_0x49a755['options'][_0x82b8('0x1c')]===undefined?!![]:![]:!![]})[_0x82b8('0xc')](function(_0x2fce2f){logger['info'](_0x82b8('0x18'),_0x49a755);logger[_0x82b8('0x10')]('CreateChatQueueReport',_0x49a755,JSON[_0x82b8('0x12')](_0x2fce2f));_0x2161e1(_0x2fce2f);})[_0x82b8('0x17')](function(_0x1c54d8){logger[_0x82b8('0x13')](_0x82b8('0x18'),_0x1c54d8[_0x82b8('0x15')],_0x49a755);_0x33e945(_0x35324c['error'](0x1f4,_0x1c54d8[_0x82b8('0x15')]));});});};exports[_0x82b8('0x1d')]=function(_0x20b7cd){var _0x5831c3=this;return new Promise(function(_0x9aa23c,_0x3315d5){return db[_0x82b8('0x19')][_0x82b8('0x1e')](_0x20b7cd[_0x82b8('0x1f')],{'raw':_0x20b7cd[_0x82b8('0x1b')]?_0x20b7cd['options'][_0x82b8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20b7cd[_0x82b8('0x1b')]?_0x20b7cd['options'][_0x82b8('0x20')]||null:null,'attributes':_0x20b7cd[_0x82b8('0x1b')]?_0x20b7cd[_0x82b8('0x1b')][_0x82b8('0x21')]||null:null,'limit':_0x20b7cd['options']?_0x20b7cd[_0x82b8('0x1b')]['limit']||null:null})[_0x82b8('0xc')](function(_0x9263aa){logger[_0x82b8('0xd')](_0x82b8('0x1d'),_0x20b7cd);logger[_0x82b8('0x10')]('UpdateChatQueueReport',_0x20b7cd,JSON[_0x82b8('0x12')](_0x9263aa));_0x9aa23c(_0x9263aa);})[_0x82b8('0x17')](function(_0x58b4b0){logger[_0x82b8('0x13')]('UpdateChatQueueReport',_0x58b4b0[_0x82b8('0x15')],_0x20b7cd);_0x3315d5(_0x5831c3[_0x82b8('0x13')](0x1f4,_0x58b4b0['message']));});});};
\ No newline at end of file
+var _0xf0b0=['UpdateChatQueueReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateChatQueueReport','create','body','options','raw','ChatQueueReport','update','where','attributes','limit'];(function(_0x31144e,_0x14fc9e){var _0x44553c=function(_0x4431c1){while(--_0x4431c1){_0x31144e['push'](_0x31144e['shift']());}};_0x44553c(++_0x14fc9e);}(_0xf0b0,0x16c));var _0x0f0b=function(_0x2e26eb,_0x49afba){_0x2e26eb=_0x2e26eb-0x0;var _0x432e15=_0xf0b0[_0x2e26eb];return _0x432e15;};'use strict';var _=require('lodash');var util=require(_0x0f0b('0x0'));var moment=require(_0x0f0b('0x1'));var BPromise=require(_0x0f0b('0x2'));var rs=require(_0x0f0b('0x3'));var fs=require('fs');var Redis=require(_0x0f0b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f0b('0x5'));var logger=require(_0x0f0b('0x6'))(_0x0f0b('0x7'));var config=require(_0x0f0b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0f0b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fcbb9,_0x444876,_0x34712e){return new BPromise(function(_0x2bd5f5,_0x4f497d){return client[_0x0f0b('0xa')](_0x1fcbb9,_0x34712e)[_0x0f0b('0xb')](function(_0x259167){logger[_0x0f0b('0xc')](_0x0f0b('0xd'),_0x444876,'request\x20sent');logger[_0x0f0b('0xe')](_0x0f0b('0xf'),_0x444876,'request\x20sent',JSON[_0x0f0b('0x10')](_0x259167));if(_0x259167[_0x0f0b('0x11')]){if(_0x259167[_0x0f0b('0x11')][_0x0f0b('0x12')]===0x1f4){logger[_0x0f0b('0x11')](_0x0f0b('0xd'),_0x444876,_0x259167['error'][_0x0f0b('0x13')]);return _0x4f497d(_0x259167['error'][_0x0f0b('0x13')]);}logger[_0x0f0b('0x11')](_0x0f0b('0xd'),_0x444876,_0x259167[_0x0f0b('0x11')][_0x0f0b('0x13')]);return _0x2bd5f5(_0x259167[_0x0f0b('0x11')][_0x0f0b('0x13')]);}else{logger[_0x0f0b('0xc')](_0x0f0b('0xd'),_0x444876,_0x0f0b('0x14'));_0x2bd5f5(_0x259167['result'][_0x0f0b('0x13')]);}})[_0x0f0b('0x15')](function(_0x5eeb66){logger[_0x0f0b('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x444876,_0x5eeb66);_0x4f497d(_0x5eeb66);});});}exports[_0x0f0b('0x16')]=function(_0x2c03a6){var _0x5d8fa1=this;return new Promise(function(_0x3d0572,_0x2f52a5){return db['ChatQueueReport'][_0x0f0b('0x17')](_0x2c03a6[_0x0f0b('0x18')],{'raw':_0x2c03a6[_0x0f0b('0x19')]?_0x2c03a6[_0x0f0b('0x19')][_0x0f0b('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x365c76){logger[_0x0f0b('0xc')]('CreateChatQueueReport',_0x2c03a6);logger[_0x0f0b('0xe')](_0x0f0b('0x16'),_0x2c03a6,JSON[_0x0f0b('0x10')](_0x365c76));_0x3d0572(_0x365c76);})['catch'](function(_0x3b5a54){logger[_0x0f0b('0x11')]('CreateChatQueueReport',_0x3b5a54['message'],_0x2c03a6);_0x2f52a5(_0x5d8fa1['error'](0x1f4,_0x3b5a54[_0x0f0b('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x69d616){var _0x1fdbb4=this;return new Promise(function(_0xe34c31,_0x2be5d6){return db[_0x0f0b('0x1b')][_0x0f0b('0x1c')](_0x69d616[_0x0f0b('0x18')],{'raw':_0x69d616['options']?_0x69d616[_0x0f0b('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x69d616[_0x0f0b('0x19')]?_0x69d616['options'][_0x0f0b('0x1d')]||null:null,'attributes':_0x69d616[_0x0f0b('0x19')]?_0x69d616[_0x0f0b('0x19')][_0x0f0b('0x1e')]||null:null,'limit':_0x69d616[_0x0f0b('0x19')]?_0x69d616[_0x0f0b('0x19')][_0x0f0b('0x1f')]||null:null})['then'](function(_0xa62c01){logger[_0x0f0b('0xc')](_0x0f0b('0x20'),_0x69d616);logger[_0x0f0b('0xe')]('UpdateChatQueueReport',_0x69d616,JSON['stringify'](_0xa62c01));_0xe34c31(_0xa62c01);})[_0x0f0b('0x15')](function(_0x52cd58){logger[_0x0f0b('0x11')]('UpdateChatQueueReport',_0x52cd58[_0x0f0b('0x13')],_0x69d616);_0x2be5d6(_0x1fdbb4[_0x0f0b('0x11')](0x1f4,_0x52cd58[_0x0f0b('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 90df9ed..d167297 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 _0x7732=['create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x42b515,_0x30b55e){var _0x1de82b=function(_0x1c4e81){while(--_0x1c4e81){_0x42b515['push'](_0x42b515['shift']());}};_0x1de82b(++_0x30b55e);}(_0x7732,0xb1));var _0x2773=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x7732[_0x2112d4];return _0x434972;};'use strict';var multer=require(_0x2773('0x0'));var util=require(_0x2773('0x1'));var path=require(_0x2773('0x2'));var timeout=require('connect-timeout');var express=require(_0x2773('0x3'));var router=express[_0x2773('0x4')]();var fs_extra=require(_0x2773('0x5'));var auth=require(_0x2773('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2773('0x7'));router[_0x2773('0x8')]('/',auth[_0x2773('0x9')](),controller['index']);router[_0x2773('0x8')](_0x2773('0xa'),auth[_0x2773('0x9')](),controller[_0x2773('0xb')]);router[_0x2773('0x8')](_0x2773('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x2773('0x9')](),controller[_0x2773('0xd')]);router[_0x2773('0xe')]('/:id',auth[_0x2773('0x9')](),controller[_0x2773('0xf')]);router[_0x2773('0x10')](_0x2773('0xc'),auth[_0x2773('0x9')](),controller[_0x2773('0x11')]);module[_0x2773('0x12')]=router;
\ No newline at end of file
+var _0x381a=['../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x34412f,_0x116bea){var _0x4b4b5a=function(_0x56fc5b){while(--_0x56fc5b){_0x34412f['push'](_0x34412f['shift']());}};_0x4b4b5a(++_0x116bea);}(_0x381a,0x13a));var _0xa381=function(_0x5127f4,_0xf5363b){_0x5127f4=_0x5127f4-0x0;var _0x3cdbcc=_0x381a[_0x5127f4];return _0x3cdbcc;};'use strict';var multer=require(_0xa381('0x0'));var util=require(_0xa381('0x1'));var path=require(_0xa381('0x2'));var timeout=require('connect-timeout');var express=require(_0xa381('0x3'));var router=express[_0xa381('0x4')]();var fs_extra=require(_0xa381('0x5'));var auth=require(_0xa381('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa381('0x7'));var controller=require('./chatQueueReport.controller');router[_0xa381('0x8')]('/',auth[_0xa381('0x9')](),controller['index']);router[_0xa381('0x8')](_0xa381('0xa'),auth[_0xa381('0x9')](),controller['describe']);router['get'](_0xa381('0xb'),auth['isAuthenticated'](),controller[_0xa381('0xc')]);router[_0xa381('0xd')]('/',auth[_0xa381('0x9')](),controller[_0xa381('0xe')]);router[_0xa381('0xf')](_0xa381('0xb'),auth[_0xa381('0x9')](),controller[_0xa381('0x10')]);router[_0xa381('0x11')](_0xa381('0xb'),auth[_0xa381('0x9')](),controller[_0xa381('0x12')]);module[_0xa381('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 7e97a76..881990e 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x4d04d6,_0x38ae19){var _0x2e937a=function(_0x4961c8){while(--_0x4961c8){_0x4d04d6['push'](_0x4d04d6['shift']());}};_0x2e937a(++_0x38ae19);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x4843f9,_0x4af459){var _0x193c6a=function(_0x51eca9){while(--_0x51eca9){_0x4843f9['push'](_0x4843f9['shift']());}};_0x193c6a(++_0x4af459);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1cb077,_0x32990d){_0x1cb077=_0x1cb077-0x0;var _0x46750a=_0xb43b[_0x1cb077];return _0x46750a;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 369519f..ba0c96f 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 _0x29c1=['length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys'];(function(_0x4e9dcb,_0xd1fb87){var _0x5105fc=function(_0x2df827){while(--_0x2df827){_0x4e9dcb['push'](_0x4e9dcb['shift']());}};_0x5105fc(++_0xd1fb87);}(_0x29c1,0x1c7));var _0x129c=function(_0x781647,_0x18edc0){_0x781647=_0x781647-0x0;var _0x56fcdb=_0x29c1[_0x781647];return _0x56fcdb;};'use strict';var emlformat=require(_0x129c('0x0'));var rimraf=require(_0x129c('0x1'));var zipdir=require(_0x129c('0x2'));var jsonpatch=require(_0x129c('0x3'));var rp=require(_0x129c('0x4'));var moment=require(_0x129c('0x5'));var BPromise=require(_0x129c('0x6'));var Mustache=require(_0x129c('0x7'));var util=require(_0x129c('0x8'));var path=require(_0x129c('0x9'));var sox=require(_0x129c('0xa'));var csv=require('to-csv');var ejs=require(_0x129c('0xb'));var fs=require('fs');var fs_extra=require(_0x129c('0xc'));var _=require(_0x129c('0xd'));var squel=require(_0x129c('0xe'));var crypto=require(_0x129c('0xf'));var jsforce=require(_0x129c('0x10'));var deskjs=require(_0x129c('0x11'));var toCsv=require(_0x129c('0x12'));var querystring=require('querystring');var Papa=require(_0x129c('0x13'));var Redis=require(_0x129c('0x14'));var authService=require(_0x129c('0x15'));var qs=require(_0x129c('0x16'));var as=require(_0x129c('0x17'));var hardwareService=require(_0x129c('0x18'));var logger=require(_0x129c('0x19'))(_0x129c('0x1a'));var utils=require('../../config/utils');var config=require(_0x129c('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48f3b3,_0x56a63b){_0x56a63b=_0x56a63b||0xcc;return function(_0x24785a){if(_0x24785a){return _0x48f3b3['sendStatus'](_0x56a63b);}return _0x48f3b3[_0x129c('0x1c')](_0x56a63b)[_0x129c('0x1d')]();};}function respondWithResult(_0x14bd93,_0x51d514){_0x51d514=_0x51d514||0xc8;return function(_0x3d08b2){if(_0x3d08b2){return _0x14bd93[_0x129c('0x1c')](_0x51d514)[_0x129c('0x1e')](_0x3d08b2);}};}function respondWithFilteredResult(_0x326890,_0x400f8c){return function(_0x54f8ce){if(_0x54f8ce){var _0x4c4bce=typeof _0x400f8c['offset']===_0x129c('0x1f')&&typeof _0x400f8c[_0x129c('0x20')]===_0x129c('0x1f');var _0x2b7939=_0x54f8ce[_0x129c('0x21')];var _0x34ee0b=_0x4c4bce?0x0:_0x400f8c[_0x129c('0x22')];var _0x201359=_0x4c4bce?_0x54f8ce[_0x129c('0x21')]:_0x400f8c[_0x129c('0x22')]+_0x400f8c[_0x129c('0x20')];var _0x1309b8;if(_0x201359>=_0x2b7939){_0x201359=_0x2b7939;_0x1309b8=0xc8;}else{_0x1309b8=0xce;}_0x326890['status'](_0x1309b8);return _0x326890['set'](_0x129c('0x23'),_0x34ee0b+'-'+_0x201359+'/'+_0x2b7939)[_0x129c('0x1e')](_0x54f8ce);}return null;};}function patchUpdates(_0x4b1003){return function(_0x3cbffa){try{jsonpatch['apply'](_0x3cbffa,_0x4b1003,!![]);}catch(_0x116381){return BPromise[_0x129c('0x24')](_0x116381);}return _0x3cbffa[_0x129c('0x25')]();};}function saveUpdates(_0x3a7b40,_0x1e363b){return function(_0x3cab81){if(_0x3cab81){return _0x3cab81[_0x129c('0x26')](_0x3a7b40)[_0x129c('0x27')](function(_0xed5304){return _0xed5304;});}return null;};}function removeEntity(_0x5abf95,_0x17ba8c){return function(_0x22c772){if(_0x22c772){return _0x22c772[_0x129c('0x28')]()[_0x129c('0x27')](function(){_0x5abf95[_0x129c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x158bca,_0x5406d2){return function(_0xbf9fac){if(!_0xbf9fac){_0x158bca['sendStatus'](0x194);}return _0xbf9fac;};}function handleError(_0x12c650,_0x1d3b7c){_0x1d3b7c=_0x1d3b7c||0x1f4;return function(_0x1b4d59){logger[_0x129c('0x29')](_0x1b4d59[_0x129c('0x2a')]);if(_0x1b4d59['name']){delete _0x1b4d59[_0x129c('0x2b')];}_0x12c650[_0x129c('0x1c')](_0x1d3b7c)[_0x129c('0x2c')](_0x1b4d59);};}exports['index']=function(_0x383ad1,_0x2462b4){var _0x5259e6={},_0x4e8193={},_0x5d7110={'count':0x0,'rows':[]};var _0x16a0fe=_[_0x129c('0x2d')](db[_0x129c('0x2e')][_0x129c('0x2f')],function(_0xc6ad63){return{'name':_0xc6ad63[_0x129c('0x30')],'type':_0xc6ad63[_0x129c('0x31')][_0x129c('0x32')]};});_0x4e8193[_0x129c('0x33')]=_[_0x129c('0x2d')](_0x16a0fe,_0x129c('0x2b'));_0x4e8193[_0x129c('0x34')]=_['keys'](_0x383ad1['query']);_0x4e8193[_0x129c('0x35')]=_[_0x129c('0x36')](_0x4e8193['model'],_0x4e8193[_0x129c('0x34')]);_0x5259e6[_0x129c('0x37')]=_[_0x129c('0x36')](_0x4e8193[_0x129c('0x33')],qs[_0x129c('0x38')](_0x383ad1[_0x129c('0x34')][_0x129c('0x38')]));_0x5259e6[_0x129c('0x37')]=_0x5259e6[_0x129c('0x37')]['length']?_0x5259e6[_0x129c('0x37')]:_0x4e8193[_0x129c('0x33')];if(!_0x383ad1[_0x129c('0x34')][_0x129c('0x39')]('nolimit')){_0x5259e6[_0x129c('0x20')]=qs[_0x129c('0x20')](_0x383ad1['query'][_0x129c('0x20')]);_0x5259e6[_0x129c('0x22')]=qs['offset'](_0x383ad1[_0x129c('0x34')][_0x129c('0x22')]);}_0x5259e6['order']=qs[_0x129c('0x3a')](_0x383ad1[_0x129c('0x34')][_0x129c('0x3a')]);_0x5259e6[_0x129c('0x3b')]=qs['filters'](_[_0x129c('0x3c')](_0x383ad1[_0x129c('0x34')],_0x4e8193['filters']),_0x16a0fe);if(_0x383ad1[_0x129c('0x34')]['filter']){_0x5259e6[_0x129c('0x3b')]=_[_0x129c('0x3d')](_0x5259e6['where'],{'$or':_[_0x129c('0x2d')](_0x16a0fe,function(_0x3882b5){if(_0x3882b5[_0x129c('0x31')]!==_0x129c('0x3e')){var _0x82d237={};_0x82d237[_0x3882b5[_0x129c('0x2b')]]={'$like':'%'+_0x383ad1['query']['filter']+'%'};return _0x82d237;}})});}_0x5259e6=_[_0x129c('0x3d')]({},_0x5259e6,_0x383ad1[_0x129c('0x3f')]);var _0x59eb15={'where':_0x5259e6[_0x129c('0x3b')]};return db[_0x129c('0x2e')][_0x129c('0x21')](_0x59eb15)[_0x129c('0x27')](function(_0x21b957){_0x5d7110[_0x129c('0x21')]=_0x21b957;if(_0x383ad1[_0x129c('0x34')][_0x129c('0x40')]){_0x5259e6[_0x129c('0x41')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x5259e6);})[_0x129c('0x27')](function(_0x47e4ef){_0x5d7110[_0x129c('0x42')]=_0x47e4ef;return _0x5d7110;})[_0x129c('0x27')](respondWithFilteredResult(_0x2462b4,_0x5259e6))[_0x129c('0x43')](handleError(_0x2462b4,null));};exports['show']=function(_0x3fed51,_0x3e0b62){var _0x2e262a={'raw':!![],'where':{'id':_0x3fed51[_0x129c('0x44')]['id']}},_0x34a84d={};_0x34a84d[_0x129c('0x33')]=_[_0x129c('0x45')](db[_0x129c('0x2e')][_0x129c('0x2f')]);_0x34a84d[_0x129c('0x34')]=_['keys'](_0x3fed51[_0x129c('0x34')]);_0x34a84d[_0x129c('0x35')]=_[_0x129c('0x36')](_0x34a84d[_0x129c('0x33')],_0x34a84d[_0x129c('0x34')]);_0x2e262a[_0x129c('0x37')]=_[_0x129c('0x36')](_0x34a84d[_0x129c('0x33')],qs['fields'](_0x3fed51[_0x129c('0x34')][_0x129c('0x38')]));_0x2e262a[_0x129c('0x37')]=_0x2e262a[_0x129c('0x37')][_0x129c('0x46')]?_0x2e262a[_0x129c('0x37')]:_0x34a84d[_0x129c('0x33')];if(_0x3fed51['query'][_0x129c('0x40')]){_0x2e262a[_0x129c('0x41')]=[{'all':!![]}];}_0x2e262a=_[_0x129c('0x3d')]({},_0x2e262a,_0x3fed51[_0x129c('0x3f')]);return db[_0x129c('0x2e')][_0x129c('0x47')](_0x2e262a)[_0x129c('0x27')](handleEntityNotFound(_0x3e0b62,null))[_0x129c('0x27')](respondWithResult(_0x3e0b62,null))['catch'](handleError(_0x3e0b62,null));};exports[_0x129c('0x48')]=function(_0x5b28a7,_0x306f30){return db[_0x129c('0x2e')]['create'](_0x5b28a7[_0x129c('0x49')],{})['then'](respondWithResult(_0x306f30,0xc9))[_0x129c('0x43')](handleError(_0x306f30,null));};exports[_0x129c('0x26')]=function(_0x18aa0e,_0x4722f5){if(_0x18aa0e['body']['id']){delete _0x18aa0e[_0x129c('0x49')]['id'];}return db['ChatTransferReport'][_0x129c('0x47')]({'where':{'id':_0x18aa0e[_0x129c('0x44')]['id']}})[_0x129c('0x27')](handleEntityNotFound(_0x4722f5,null))[_0x129c('0x27')](saveUpdates(_0x18aa0e['body'],null))[_0x129c('0x27')](respondWithResult(_0x4722f5,null))[_0x129c('0x43')](handleError(_0x4722f5,null));};exports[_0x129c('0x28')]=function(_0x3bec16,_0x1750b7){return db[_0x129c('0x2e')][_0x129c('0x47')]({'where':{'id':_0x3bec16[_0x129c('0x44')]['id']}})[_0x129c('0x27')](handleEntityNotFound(_0x1750b7,null))[_0x129c('0x27')](removeEntity(_0x1750b7,null))[_0x129c('0x43')](handleError(_0x1750b7,null));};exports[_0x129c('0x4a')]=function(_0x446023,_0x202151){return db[_0x129c('0x2e')][_0x129c('0x4a')]()[_0x129c('0x27')](respondWithResult(_0x202151,null))['catch'](handleError(_0x202151,null));};
\ No newline at end of file
+var _0x88a2=['../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','include','findAll','catch','show','params','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x23aa23,_0x4268a0){var _0x28b5e9=function(_0x12dcc2){while(--_0x12dcc2){_0x23aa23['push'](_0x23aa23['shift']());}};_0x28b5e9(++_0x4268a0);}(_0x88a2,0x1b0));var _0x288a=function(_0x28f4c2,_0x1479c4){_0x28f4c2=_0x28f4c2-0x0;var _0x12d573=_0x88a2[_0x28f4c2];return _0x12d573;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x288a('0x0'));var zipdir=require(_0x288a('0x1'));var jsonpatch=require(_0x288a('0x2'));var rp=require('request-promise');var moment=require(_0x288a('0x3'));var BPromise=require(_0x288a('0x4'));var Mustache=require(_0x288a('0x5'));var util=require(_0x288a('0x6'));var path=require(_0x288a('0x7'));var sox=require('sox');var csv=require(_0x288a('0x8'));var ejs=require(_0x288a('0x9'));var fs=require('fs');var fs_extra=require(_0x288a('0xa'));var _=require(_0x288a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x288a('0x8'));var querystring=require(_0x288a('0xc'));var Papa=require(_0x288a('0xd'));var Redis=require(_0x288a('0xe'));var authService=require(_0x288a('0xf'));var qs=require(_0x288a('0x10'));var as=require(_0x288a('0x11'));var hardwareService=require(_0x288a('0x12'));var logger=require(_0x288a('0x13'))(_0x288a('0x14'));var utils=require(_0x288a('0x15'));var config=require(_0x288a('0x16'));var licenseUtil=require(_0x288a('0x17'));var db=require(_0x288a('0x18'))['db'];function respondWithStatusCode(_0x40a5b9,_0x2dd036){_0x2dd036=_0x2dd036||0xcc;return function(_0x5e90eb){if(_0x5e90eb){return _0x40a5b9[_0x288a('0x19')](_0x2dd036);}return _0x40a5b9['status'](_0x2dd036)[_0x288a('0x1a')]();};}function respondWithResult(_0x3d705c,_0x1a11f1){_0x1a11f1=_0x1a11f1||0xc8;return function(_0x3ade07){if(_0x3ade07){return _0x3d705c[_0x288a('0x1b')](_0x1a11f1)[_0x288a('0x1c')](_0x3ade07);}};}function respondWithFilteredResult(_0x50e8e8,_0x5f2849){return function(_0x180c3e){if(_0x180c3e){var _0xcee1c2=typeof _0x5f2849[_0x288a('0x1d')]===_0x288a('0x1e')&&typeof _0x5f2849[_0x288a('0x1f')]===_0x288a('0x1e');var _0x369f5b=_0x180c3e[_0x288a('0x20')];var _0x527603=_0xcee1c2?0x0:_0x5f2849['offset'];var _0x408c8a=_0xcee1c2?_0x180c3e[_0x288a('0x20')]:_0x5f2849['offset']+_0x5f2849[_0x288a('0x1f')];var _0x1e557f;if(_0x408c8a>=_0x369f5b){_0x408c8a=_0x369f5b;_0x1e557f=0xc8;}else{_0x1e557f=0xce;}_0x50e8e8['status'](_0x1e557f);return _0x50e8e8[_0x288a('0x21')](_0x288a('0x22'),_0x527603+'-'+_0x408c8a+'/'+_0x369f5b)['json'](_0x180c3e);}return null;};}function patchUpdates(_0xd23bc3){return function(_0x21fc06){try{jsonpatch[_0x288a('0x23')](_0x21fc06,_0xd23bc3,!![]);}catch(_0x46438b){return BPromise[_0x288a('0x24')](_0x46438b);}return _0x21fc06[_0x288a('0x25')]();};}function saveUpdates(_0x636238,_0x352546){return function(_0x4b1f6d){if(_0x4b1f6d){return _0x4b1f6d[_0x288a('0x26')](_0x636238)[_0x288a('0x27')](function(_0x164bf9){return _0x164bf9;});}return null;};}function removeEntity(_0x40add,_0x1c7a02){return function(_0x480a8e){if(_0x480a8e){return _0x480a8e[_0x288a('0x28')]()['then'](function(){_0x40add[_0x288a('0x1b')](0xcc)[_0x288a('0x1a')]();});}};}function handleEntityNotFound(_0x1c4930,_0x2ab9e3){return function(_0x1ace88){if(!_0x1ace88){_0x1c4930[_0x288a('0x19')](0x194);}return _0x1ace88;};}function handleError(_0x18c960,_0x3a70a4){_0x3a70a4=_0x3a70a4||0x1f4;return function(_0x3eedbf){logger[_0x288a('0x29')](_0x3eedbf['stack']);if(_0x3eedbf[_0x288a('0x2a')]){delete _0x3eedbf['name'];}_0x18c960[_0x288a('0x1b')](_0x3a70a4)[_0x288a('0x2b')](_0x3eedbf);};}exports['index']=function(_0x537c14,_0xe75bec){var _0x5dfd48={},_0x31c5ea={},_0x5dd930={'count':0x0,'rows':[]};var _0xbd2007=_[_0x288a('0x2c')](db['ChatTransferReport'][_0x288a('0x2d')],function(_0x467207){return{'name':_0x467207[_0x288a('0x2e')],'type':_0x467207['type'][_0x288a('0x2f')]};});_0x31c5ea[_0x288a('0x30')]=_[_0x288a('0x2c')](_0xbd2007,_0x288a('0x2a'));_0x31c5ea[_0x288a('0x31')]=_[_0x288a('0x32')](_0x537c14[_0x288a('0x31')]);_0x31c5ea[_0x288a('0x33')]=_['intersection'](_0x31c5ea[_0x288a('0x30')],_0x31c5ea[_0x288a('0x31')]);_0x5dfd48[_0x288a('0x34')]=_[_0x288a('0x35')](_0x31c5ea[_0x288a('0x30')],qs[_0x288a('0x36')](_0x537c14[_0x288a('0x31')]['fields']));_0x5dfd48[_0x288a('0x34')]=_0x5dfd48[_0x288a('0x34')][_0x288a('0x37')]?_0x5dfd48[_0x288a('0x34')]:_0x31c5ea[_0x288a('0x30')];if(!_0x537c14[_0x288a('0x31')][_0x288a('0x38')](_0x288a('0x39'))){_0x5dfd48[_0x288a('0x1f')]=qs[_0x288a('0x1f')](_0x537c14[_0x288a('0x31')]['limit']);_0x5dfd48[_0x288a('0x1d')]=qs[_0x288a('0x1d')](_0x537c14[_0x288a('0x31')][_0x288a('0x1d')]);}_0x5dfd48['order']=qs[_0x288a('0x3a')](_0x537c14[_0x288a('0x31')][_0x288a('0x3a')]);_0x5dfd48[_0x288a('0x3b')]=qs['filters'](_[_0x288a('0x3c')](_0x537c14[_0x288a('0x31')],_0x31c5ea[_0x288a('0x33')]),_0xbd2007);if(_0x537c14[_0x288a('0x31')][_0x288a('0x3d')]){_0x5dfd48[_0x288a('0x3b')]=_[_0x288a('0x3e')](_0x5dfd48[_0x288a('0x3b')],{'$or':_[_0x288a('0x2c')](_0xbd2007,function(_0x2615aa){if(_0x2615aa['type']!==_0x288a('0x3f')){var _0x32f831={};_0x32f831[_0x2615aa[_0x288a('0x2a')]]={'$like':'%'+_0x537c14['query'][_0x288a('0x3d')]+'%'};return _0x32f831;}})});}_0x5dfd48=_[_0x288a('0x3e')]({},_0x5dfd48,_0x537c14[_0x288a('0x40')]);var _0x2b52ec={'where':_0x5dfd48['where']};return db[_0x288a('0x41')][_0x288a('0x20')](_0x2b52ec)['then'](function(_0x442f3f){_0x5dd930['count']=_0x442f3f;if(_0x537c14[_0x288a('0x31')]['includeAll']){_0x5dfd48[_0x288a('0x42')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x288a('0x43')](_0x5dfd48);})[_0x288a('0x27')](function(_0x24015f){_0x5dd930['rows']=_0x24015f;return _0x5dd930;})[_0x288a('0x27')](respondWithFilteredResult(_0xe75bec,_0x5dfd48))[_0x288a('0x44')](handleError(_0xe75bec,null));};exports[_0x288a('0x45')]=function(_0x820684,_0x46ae7a){var _0x4d8ffc={'raw':!![],'where':{'id':_0x820684[_0x288a('0x46')]['id']}},_0x30c4d2={};_0x30c4d2[_0x288a('0x30')]=_[_0x288a('0x32')](db[_0x288a('0x41')][_0x288a('0x2d')]);_0x30c4d2[_0x288a('0x31')]=_['keys'](_0x820684['query']);_0x30c4d2['filters']=_[_0x288a('0x35')](_0x30c4d2['model'],_0x30c4d2[_0x288a('0x31')]);_0x4d8ffc[_0x288a('0x34')]=_[_0x288a('0x35')](_0x30c4d2['model'],qs[_0x288a('0x36')](_0x820684[_0x288a('0x31')]['fields']));_0x4d8ffc[_0x288a('0x34')]=_0x4d8ffc[_0x288a('0x34')][_0x288a('0x37')]?_0x4d8ffc['attributes']:_0x30c4d2[_0x288a('0x30')];if(_0x820684['query'][_0x288a('0x47')]){_0x4d8ffc[_0x288a('0x42')]=[{'all':!![]}];}_0x4d8ffc=_['merge']({},_0x4d8ffc,_0x820684[_0x288a('0x40')]);return db[_0x288a('0x41')][_0x288a('0x48')](_0x4d8ffc)[_0x288a('0x27')](handleEntityNotFound(_0x46ae7a,null))[_0x288a('0x27')](respondWithResult(_0x46ae7a,null))['catch'](handleError(_0x46ae7a,null));};exports[_0x288a('0x49')]=function(_0x247508,_0x7f48a7){return db['ChatTransferReport'][_0x288a('0x49')](_0x247508[_0x288a('0x4a')],{})[_0x288a('0x27')](respondWithResult(_0x7f48a7,0xc9))[_0x288a('0x44')](handleError(_0x7f48a7,null));};exports['update']=function(_0x2ed4f2,_0x36d00f){if(_0x2ed4f2[_0x288a('0x4a')]['id']){delete _0x2ed4f2['body']['id'];}return db[_0x288a('0x41')]['find']({'where':{'id':_0x2ed4f2[_0x288a('0x46')]['id']}})[_0x288a('0x27')](handleEntityNotFound(_0x36d00f,null))[_0x288a('0x27')](saveUpdates(_0x2ed4f2[_0x288a('0x4a')],null))['then'](respondWithResult(_0x36d00f,null))[_0x288a('0x44')](handleError(_0x36d00f,null));};exports['destroy']=function(_0x68cf92,_0x218f7c){return db[_0x288a('0x41')][_0x288a('0x48')]({'where':{'id':_0x68cf92[_0x288a('0x46')]['id']}})[_0x288a('0x27')](handleEntityNotFound(_0x218f7c,null))[_0x288a('0x27')](removeEntity(_0x218f7c,null))[_0x288a('0x44')](handleError(_0x218f7c,null));};exports[_0x288a('0x4b')]=function(_0x673190,_0x2faa67){return db[_0x288a('0x41')][_0x288a('0x4b')]()[_0x288a('0x27')](respondWithResult(_0x2faa67,null))[_0x288a('0x44')](handleError(_0x2faa67,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 61bef34..7cd5be0 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 _0xcb3d=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','report_chat_transfer','uniqueid','util'];(function(_0x14a468,_0x63dcdf){var _0x4305c6=function(_0x5e1b0e){while(--_0x5e1b0e){_0x14a468['push'](_0x14a468['shift']());}};_0x4305c6(++_0x63dcdf);}(_0xcb3d,0x9f));var _0xdcb3=function(_0x55642e,_0x3f7ab6){_0x55642e=_0x55642e-0x0;var _0x3e5fc9=_0xcb3d[_0x55642e];return _0x3e5fc9;};'use strict';var _=require('lodash');var util=require(_0xdcb3('0x0'));var logger=require(_0xdcb3('0x1'))(_0xdcb3('0x2'));var moment=require('moment');var BPromise=require(_0xdcb3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdcb3('0x4'));var rimraf=require(_0xdcb3('0x5'));var config=require(_0xdcb3('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0xdcb3('0x7')]=function(_0x26e449,_0x52a5a7){return _0x26e449['define']('ChatTransferReport',attributes,{'tableName':_0xdcb3('0x8'),'paranoid':![],'indexes':[{'name':_0xdcb3('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe6e5=['uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatTransferReport'];(function(_0x6a557,_0x3902d3){var _0x16b815=function(_0x3d8da2){while(--_0x3d8da2){_0x6a557['push'](_0x6a557['shift']());}};_0x16b815(++_0x3902d3);}(_0xe6e5,0xb7));var _0x5e6e=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xe6e5[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0x5e6e('0x0'));var util=require(_0x5e6e('0x1'));var logger=require('../../config/logger')(_0x5e6e('0x2'));var moment=require(_0x5e6e('0x3'));var BPromise=require(_0x5e6e('0x4'));var rp=require(_0x5e6e('0x5'));var fs=require('fs');var path=require(_0x5e6e('0x6'));var rimraf=require(_0x5e6e('0x7'));var config=require(_0x5e6e('0x8'));var attributes=require('./chatTransferReport.attributes');module[_0x5e6e('0x9')]=function(_0x1ba775,_0x17d96d){return _0x1ba775[_0x5e6e('0xa')](_0x5e6e('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x5e6e('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index d04c985..b37add0 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 _0xf51c=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x1fe3c8,_0x2be277){var _0x5bdac=function(_0x24cdb0){while(--_0x24cdb0){_0x1fe3c8['push'](_0x1fe3c8['shift']());}};_0x5bdac(++_0x2be277);}(_0xf51c,0x1e8));var _0xcf51=function(_0x1e209e,_0x29d879){_0x1e209e=_0x1e209e-0x0;var _0x1a8e54=_0xf51c[_0x1e209e];return _0x1a8e54;};'use strict';var _=require(_0xcf51('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcf51('0x1'));var rs=require(_0xcf51('0x2'));var fs=require('fs');var Redis=require(_0xcf51('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf51('0x4'));var logger=require(_0xcf51('0x5'))(_0xcf51('0x6'));var config=require(_0xcf51('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcf51('0x8')][_0xcf51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7b8439,_0x1e6f2e,_0x54b8b4){return new BPromise(function(_0x1fc514,_0x37949f){return client[_0xcf51('0xa')](_0x7b8439,_0x54b8b4)[_0xcf51('0xb')](function(_0x4be8f0){logger[_0xcf51('0xc')](_0xcf51('0xd'),_0x1e6f2e,_0xcf51('0xe'));logger['debug'](_0xcf51('0xf'),_0x1e6f2e,'request\x20sent',JSON['stringify'](_0x4be8f0));if(_0x4be8f0[_0xcf51('0x10')]){if(_0x4be8f0[_0xcf51('0x10')]['code']===0x1f4){logger[_0xcf51('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x1e6f2e,_0x4be8f0['error'][_0xcf51('0x11')]);return _0x37949f(_0x4be8f0['error'][_0xcf51('0x11')]);}logger[_0xcf51('0x10')](_0xcf51('0xd'),_0x1e6f2e,_0x4be8f0[_0xcf51('0x10')][_0xcf51('0x11')]);return _0x1fc514(_0x4be8f0[_0xcf51('0x10')][_0xcf51('0x11')]);}else{logger[_0xcf51('0xc')](_0xcf51('0xd'),_0x1e6f2e,_0xcf51('0xe'));_0x1fc514(_0x4be8f0[_0xcf51('0x12')][_0xcf51('0x11')]);}})[_0xcf51('0x13')](function(_0x2823a3){logger[_0xcf51('0x10')](_0xcf51('0xd'),_0x1e6f2e,_0x2823a3);_0x37949f(_0x2823a3);});});}
\ No newline at end of file
+var _0x9908=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x9908,0x11f));var _0x8990=function(_0x51f632,_0x5a14d5){_0x51f632=_0x51f632-0x0;var _0x24cf36=_0x9908[_0x51f632];return _0x24cf36;};'use strict';var _=require(_0x8990('0x0'));var util=require(_0x8990('0x1'));var moment=require(_0x8990('0x2'));var BPromise=require(_0x8990('0x3'));var rs=require(_0x8990('0x4'));var fs=require('fs');var Redis=require(_0x8990('0x5'));var db=require(_0x8990('0x6'))['db'];var utils=require(_0x8990('0x7'));var logger=require(_0x8990('0x8'))(_0x8990('0x9'));var config=require(_0x8990('0xa'));var jayson=require(_0x8990('0xb'));var client=jayson[_0x8990('0xc')][_0x8990('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2715fd,_0x1f947f,_0x25ec39){return new BPromise(function(_0x396a6b,_0x3593a9){return client[_0x8990('0xe')](_0x2715fd,_0x25ec39)[_0x8990('0xf')](function(_0x1d3201){logger[_0x8990('0x10')](_0x8990('0x11'),_0x1f947f,'request\x20sent');logger['debug'](_0x8990('0x12'),_0x1f947f,_0x8990('0x13'),JSON[_0x8990('0x14')](_0x1d3201));if(_0x1d3201[_0x8990('0x15')]){if(_0x1d3201['error']['code']===0x1f4){logger[_0x8990('0x15')](_0x8990('0x11'),_0x1f947f,_0x1d3201['error']['message']);return _0x3593a9(_0x1d3201['error'][_0x8990('0x16')]);}logger[_0x8990('0x15')](_0x8990('0x11'),_0x1f947f,_0x1d3201[_0x8990('0x15')][_0x8990('0x16')]);return _0x396a6b(_0x1d3201[_0x8990('0x15')][_0x8990('0x16')]);}else{logger[_0x8990('0x10')](_0x8990('0x11'),_0x1f947f,_0x8990('0x13'));_0x396a6b(_0x1d3201['result'][_0x8990('0x16')]);}})[_0x8990('0x17')](function(_0x23bbb9){logger[_0x8990('0x15')](_0x8990('0x11'),_0x1f947f,_0x23bbb9);_0x3593a9(_0x23bbb9);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 4d9fb27..137facd 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 _0x5c72=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./chatTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','destroy'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0x5c72,0x156));var _0x25c7=function(_0x595f10,_0x9ac872){_0x595f10=_0x595f10-0x0;var _0x53770b=_0x5c72[_0x595f10];return _0x53770b;};'use strict';var multer=require(_0x25c7('0x0'));var util=require(_0x25c7('0x1'));var path=require(_0x25c7('0x2'));var timeout=require(_0x25c7('0x3'));var express=require(_0x25c7('0x4'));var router=express['Router']();var fs_extra=require(_0x25c7('0x5'));var auth=require(_0x25c7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x25c7('0x7'));router['get']('/',auth[_0x25c7('0x8')](),controller[_0x25c7('0x9')]);router[_0x25c7('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x25c7('0xb')]);router[_0x25c7('0xa')](_0x25c7('0xc'),auth[_0x25c7('0x8')](),controller[_0x25c7('0xd')]);router[_0x25c7('0xe')]('/',auth[_0x25c7('0x8')](),controller[_0x25c7('0xf')]);router[_0x25c7('0x10')](_0x25c7('0xc'),auth[_0x25c7('0x8')](),controller[_0x25c7('0x11')]);router['delete'](_0x25c7('0xc'),auth[_0x25c7('0x8')](),controller[_0x25c7('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xa34c=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x1cac19,_0x4c902d){var _0x147fe9=function(_0xd52416){while(--_0xd52416){_0x1cac19['push'](_0x1cac19['shift']());}};_0x147fe9(++_0x4c902d);}(_0xa34c,0x13a));var _0xca34=function(_0x5e9794,_0x106c22){_0x5e9794=_0x5e9794-0x0;var _0x4f4840=_0xa34c[_0x5e9794];return _0x4f4840;};'use strict';var multer=require(_0xca34('0x0'));var util=require(_0xca34('0x1'));var path=require(_0xca34('0x2'));var timeout=require(_0xca34('0x3'));var express=require('express');var router=express[_0xca34('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xca34('0x5'));var interaction=require(_0xca34('0x6'));var config=require('../../config/environment');var controller=require(_0xca34('0x7'));router[_0xca34('0x8')]('/',auth[_0xca34('0x9')](),controller[_0xca34('0xa')]);router['get'](_0xca34('0xb'),auth['isAuthenticated'](),controller[_0xca34('0xc')]);router[_0xca34('0x8')](_0xca34('0xd'),auth[_0xca34('0x9')](),controller[_0xca34('0xe')]);router[_0xca34('0xf')]('/',auth['isAuthenticated'](),controller[_0xca34('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xca34('0x11')]);router[_0xca34('0x12')](_0xca34('0xd'),auth['isAuthenticated'](),controller[_0xca34('0x13')]);module[_0xca34('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 789452e..d3a0986 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 _0x3e40=['Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','TEXT','input','name','getDataValue','parse','onlineForm','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'];(function(_0x5b80ff,_0x38517e){var _0x3cb5f5=function(_0x5566dd){while(--_0x5566dd){_0x5b80ff['push'](_0x5b80ff['shift']());}};_0x3cb5f5(++_0x38517e);}(_0x3e40,0x131));var _0x03e4=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x3e40[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0x03e4('0x0'));var rs=require(_0x03e4('0x1'));module[_0x03e4('0x2')]={'name':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x03e4('0x3')]},'mapKey':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x4')},'mapKeyOffline':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x4')},'key':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'defaultValue':_0x03e4('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x03e4('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x03e4('0x3')]},'animation':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x03e4('0x8')](_0x03e4('0x9'),'squared'),'defaultValue':_0x03e4('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xa')},'offline_chat_button':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xb')},'header_offline':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xc')},'download_transcript':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x03e4('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x10')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x03e4('0x11')},'placeholderMessage':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x12')},'closingMessage':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x13')},'closingMessageButton':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xb')},'skipMessageButton':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x14')},'conditionAgreement':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x03e4('0x15'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x03e4('0x16')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x03e4('0x17'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x03e4('0x18'),'helpText':''}},{'type':'input','props':{'title':_0x03e4('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x03e4('0x4'),'type':_0x03e4('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x03e4('0x19')]('onlineForm')?JSON[_0x03e4('0x1a')](this[_0x03e4('0x19')](_0x03e4('0x1b'))):{};},'set':function(_0x218201){return this[_0x03e4('0x1c')](_0x03e4('0x1b'),JSON[_0x03e4('0x1d')](_0x218201));}},'offlineForm':{'type':Sequelize[_0x03e4('0x16')],'defaultValue':function(){return JSON[_0x03e4('0x1d')]({'items':[{'type':_0x03e4('0x17'),'props':{'title':_0x03e4('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x03e4('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x03e4('0x1e')},'props':{'title':_0x03e4('0x1e'),'helpText':_0x03e4('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0x03e4('0x19')]('offlineForm')?JSON[_0x03e4('0x1a')](this[_0x03e4('0x19')](_0x03e4('0x20'))):{};},'set':function(_0x14f51c){return this[_0x03e4('0x1c')]('offlineForm',JSON['stringify'](_0x14f51c));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x03e4('0x21')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x03e4('0x3')]},'forwardOffline':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x03e4('0x3')]},'waitingTitle':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x22')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x03e4('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x24')},'offlineMessageBody':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x26')},'skipUnmanaged':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x03e4('0x16')]},'showAgentAvatar':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x03e4('0x3')]},'notificationTemplate':{'type':Sequelize[_0x03e4('0x16')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x03e4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x28')},'verticalAlignment':{'type':Sequelize[_0x03e4('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x29')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x03e4('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x03e4('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'defaultValue':_0x03e4('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x03e4('0x6')],'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[_0x03e4('0x3')],'defaultValue':_0x03e4('0x2b')},'systemAvatar':{'type':Sequelize[_0x03e4('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x03e4('0x6')],'comment':_0x03e4('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![],'comment':_0x03e4('0x2d'),'set':function(_0x576549){if(!_0x576549)this[_0x03e4('0x1c')](_0x03e4('0x2e'),null);this['setDataValue'](_0x03e4('0x2f'),_0x576549);}},'vidaooEscalation':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x03e4('0x3')]},'vidaooTopic':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':function(){return _0x03e4('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x03e4('0x16')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x8d93=['#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Send','Skip','Feedback','star','thumb','stringify','text','name','onlineForm','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','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.','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','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x8d93,0x199));var _0x38d9=function(_0x1db481,_0x1627b2){_0x1db481=_0x1db481-0x0;var _0x3db95b=_0x8d93[_0x1db481];return _0x3db95b;};'use strict';var Sequelize=require(_0x38d9('0x0'));var rs=require(_0x38d9('0x1'));module[_0x38d9('0x2')]={'name':{'type':Sequelize[_0x38d9('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x38d9('0x3')],'allowNull':![],'unique':_0x38d9('0x4')},'description':{'type':Sequelize[_0x38d9('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x38d9('0x5')},'mapKeyOffline':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x5')},'key':{'type':Sequelize[_0x38d9('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x38d9('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x38d9('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x38d9('0x3')],'allowNull':![],'defaultValue':_0x38d9('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x38d9('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x38d9('0x3')]},'animation':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x38d9('0xb')](_0x38d9('0xc'),_0x38d9('0xd')),'defaultValue':_0x38d9('0xc')},'header_online':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0xe')},'start_chat_button':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0xf')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x38d9('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x38d9('0x11')]},'closingQuestion':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x38d9('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x14')},'placeholderMessage':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x15')},'closingMessage':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x16')},'skipMessageButton':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x18')},'ratingType':{'type':Sequelize[_0x38d9('0xb')](_0x38d9('0x19'),_0x38d9('0x1a')),'defaultValue':_0x38d9('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x38d9('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x38d9('0x11')],'defaultValue':function(){return JSON[_0x38d9('0x1b')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':_0x38d9('0x1c'),'required':!![]},'props':{'title':_0x38d9('0x1d'),'helpText':''}},{'type':'input','props':{'title':_0x38d9('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x38d9('0x5'),'type':_0x38d9('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x38d9('0x1e'))?JSON['parse'](this[_0x38d9('0x1f')](_0x38d9('0x1e'))):{};},'set':function(_0x47148c){return this[_0x38d9('0x20')](_0x38d9('0x1e'),JSON['stringify'](_0x47148c));}},'offlineForm':{'type':Sequelize[_0x38d9('0x11')],'defaultValue':function(){return JSON[_0x38d9('0x1b')]({'items':[{'type':'input','props':{'title':_0x38d9('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x38d9('0x5'),'type':_0x38d9('0x5')},'variable':null},{'type':_0x38d9('0x21'),'config':{'placeholder':_0x38d9('0x22')},'props':{'title':'Comments','helpText':_0x38d9('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x38d9('0x24'))?JSON[_0x38d9('0x25')](this[_0x38d9('0x1f')](_0x38d9('0x24'))):{};},'set':function(_0x4b87c5){return this['setDataValue'](_0x38d9('0x24'),JSON[_0x38d9('0x1b')](_0x4b87c5));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x38d9('0x26')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x38d9('0x27')},'waitingMessage':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x28')},'offlineMessageSubject':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x17')},'sendUnmanaged':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x38d9('0x2b');}},'notificationSound':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x38d9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x38d9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x2d')},'verticalAlignment':{'type':Sequelize[_0x38d9('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x2e')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x38d9('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x38d9('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x38d9('0x3')],'allowNull':![],'defaultValue':_0x38d9('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x38d9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x38d9('0x9')],'comment':_0x38d9('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![],'comment':_0x38d9('0x31'),'set':function(_0x2c038a){if(!_0x2c038a)this[_0x38d9('0x20')]('mandatoryDispositionPauseId',null);this[_0x38d9('0x20')]('mandatoryDisposition',_0x2c038a);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x38d9('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x38d9('0x32')},'vidaooNote':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':function(){return _0x38d9('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x38d9('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 3ee4a82..69febc3 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 _0x72c8=['timezone','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','OFFLINE','No\x20timezone','map','Interval','Intervals','all','some','user-agent-parser','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','unknown','%s\x20%s','device','model','type','vendor','index','Pause','mandatoryDispositionPause','rawAttributes','key','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','ChatWebsite','includeAll','include','findAll','rows','show','keys','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ChatWebsiteId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','order','removeAnswers','addLogo','filename','addAvatar','agentAvatar','file','addCustomerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','sitepic','custom','existsSync','join','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','server/files/images/avatars/','download','getSystemAvatar','systemAvatar','notify','chat','CmContact','Sequelize','no\x20available\x20attributes','createdAt','difference','updatedAt','ListId','from','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','Applications','spread','priority','account','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','applications','close','unmanaged','AttachmentId','unshift','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','files','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','email','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','User','Owner','fullname','Tag','color','tag','getSnippet','../../config/license/util','License','server/files/chat/iframe.ejs','utf8','URL','address','origin','3.5.0','remote','x-real-ip','connection','virtual','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIOutOfIntervalError','handleError','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','offset','undefined','limit','count','set','update','destroy','get','UserProfileResource','end','sendStatus','name','send','Command','format','iftime\x20%s,%s'];(function(_0x5e7644,_0x560054){var _0x3cd663=function(_0x44687f){while(--_0x44687f){_0x5e7644['push'](_0x5e7644['shift']());}};_0x3cd663(++_0x560054);}(_0x72c8,0xf9));var _0x872c=function(_0x3e2849,_0x8d6597){_0x3e2849=_0x3e2849-0x0;var _0x392ef7=_0x72c8[_0x3e2849];return _0x392ef7;};'use strict';var Mustache=require('mustache');var util=require(_0x872c('0x0'));var path=require(_0x872c('0x1'));var ejs=require(_0x872c('0x2'));var fs=require('fs');var fs_extra=require(_0x872c('0x3'));var _=require('lodash');var querystring=require('querystring');var htmlToText=require(_0x872c('0x4'));var Redis=require(_0x872c('0x5'));var jayson=require(_0x872c('0x6'));var url=require('url');var qs=require(_0x872c('0x7'));var logger=require(_0x872c('0x8'))('api');var config=require(_0x872c('0x9'));var APIOutOfIntervalError=require(_0x872c('0xa'))[_0x872c('0xb')];var APINotFoundError=require(_0x872c('0xa'))['APINotFoundError'];var APIHandleError=require(_0x872c('0xa'))[_0x872c('0xc')];var db=require(_0x872c('0xd'))['db'];config[_0x872c('0xe')]=_[_0x872c('0xf')](config['redis'],{'host':_0x872c('0x10'),'port':0x18eb});var socket=require(_0x872c('0x11'))(new Redis(config[_0x872c('0xe')]));require(_0x872c('0x12'))[_0x872c('0x13')](socket);var client=jayson[_0x872c('0x14')][_0x872c('0x15')]({'port':0x232c});var client9002=jayson['client'][_0x872c('0x15')]({'port':0x232a});var client9003=jayson[_0x872c('0x14')]['http']({'port':0x232b});var client9001=jayson[_0x872c('0x14')][_0x872c('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x23d0f4,_0x5d6759,_0x27baf9,_0x437a26){return new Promise(function(_0x1a39f8,_0x251277){var _0x4e161c=_0x437a26||client;return _0x4e161c['request'](_0x23d0f4,_0x27baf9)[_0x872c('0x16')](function(_0x7b0f3f){logger[_0x872c('0x17')](_0x872c('0x18'),_0x5d6759,_0x872c('0x19'));logger[_0x872c('0x1a')](_0x872c('0x1b'),_0x5d6759,'request\x20sent',JSON[_0x872c('0x1c')](_0x7b0f3f));if(_0x7b0f3f['error']){if(_0x7b0f3f[_0x872c('0x1d')][_0x872c('0x1e')]===0x1f4){logger[_0x872c('0x1d')](_0x872c('0x18'),_0x5d6759,_0x7b0f3f['error'][_0x872c('0x1f')]);return _0x251277(_0x7b0f3f[_0x872c('0x1d')][_0x872c('0x1f')]);}logger[_0x872c('0x1d')](_0x872c('0x18'),_0x5d6759,_0x7b0f3f[_0x872c('0x1d')]['message']);return _0x1a39f8(_0x7b0f3f[_0x872c('0x1d')]['message']);}else{logger[_0x872c('0x17')](_0x872c('0x18'),_0x5d6759,'request\x20sent');_0x1a39f8(_0x7b0f3f['result']['message']);}})[_0x872c('0x20')](function(_0x4e8aaf){logger[_0x872c('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x5d6759,_0x4e8aaf);_0x251277(_0x4e8aaf);});});}function respondWithStatusCode(_0x3b1855,_0x315768){_0x315768=_0x315768||0xcc;return function(_0x540811){if(_0x540811){return _0x3b1855['sendStatus'](_0x315768);}return _0x3b1855[_0x872c('0x21')](_0x315768)['end']();};}function respondWithResult(_0x3afb7f,_0x2bc0e2){_0x2bc0e2=_0x2bc0e2||0xc8;return function(_0x15f1b0){if(_0x15f1b0){return _0x3afb7f['status'](_0x2bc0e2)[_0x872c('0x22')](_0x15f1b0);}};}function respondWithFilteredResult(_0x1651b9,_0x1290bc){return function(_0x300538){if(_0x300538){var _0x1db7ee=typeof _0x1290bc[_0x872c('0x23')]===_0x872c('0x24')&&typeof _0x1290bc[_0x872c('0x25')]==='undefined';var _0x483217=_0x300538[_0x872c('0x26')];var _0x194a16=_0x1db7ee?0x0:_0x1290bc[_0x872c('0x23')];var _0x5e088e=_0x1db7ee?_0x300538[_0x872c('0x26')]:_0x1290bc['offset']+_0x1290bc[_0x872c('0x25')];var _0xc5b701;if(_0x5e088e>=_0x483217){_0x5e088e=_0x483217;_0xc5b701=0xc8;}else{_0xc5b701=0xce;}_0x1651b9[_0x872c('0x21')](_0xc5b701);return _0x1651b9[_0x872c('0x27')]('Content-Range',_0x194a16+'-'+_0x5e088e+'/'+_0x483217)['json'](_0x300538);}return null;};}function saveUpdates(_0x2589b0){return function(_0x4223bb){if(_0x4223bb){return _0x4223bb[_0x872c('0x28')](_0x2589b0)[_0x872c('0x16')](function(_0x5ef16c){return _0x5ef16c;});}return null;};}function removeEntity(_0x55d9b0){return function(_0x1b3876){if(_0x1b3876){return _0x1b3876[_0x872c('0x29')]()['then'](function(){var _0x225673=_0x1b3876[_0x872c('0x2a')]({'plain':!![]});var _0x59a3af='ChatWebsites';return db[_0x872c('0x2b')][_0x872c('0x29')]({'where':{'type':_0x59a3af,'resourceId':_0x225673['id']}})[_0x872c('0x16')](function(){return _0x1b3876;});})[_0x872c('0x16')](function(){_0x55d9b0['status'](0xcc)[_0x872c('0x2c')]();});}};}function handleEntityNotFound(_0x4d828c){return function(_0x25bca8){if(!_0x25bca8){_0x4d828c[_0x872c('0x2d')](0x194);}return _0x25bca8;};}function handleError(_0x33cb11,_0x4dd56d){_0x4dd56d=_0x4dd56d||0x1f4;return function(_0x5a75b6){logger[_0x872c('0x1d')](_0x5a75b6['stack']);if(_0x5a75b6[_0x872c('0x2e')]){delete _0x5a75b6[_0x872c('0x2e')];}_0x33cb11[_0x872c('0x21')](_0x4dd56d)[_0x872c('0x2f')](_0x5a75b6);};}function iftimePromise(_0x462488,_0x49e929){return respondWithRpcPromise(_0x872c('0x30'),'getSnippet',{'command':_0x49e929['timezone']?util[_0x872c('0x31')](_0x872c('0x32'),_0x462488['interval'],_0x49e929[_0x872c('0x33')]):util[_0x872c('0x31')](_0x872c('0x34'),_0x462488['interval'])},client9002)['then'](function(_0x46fa00){var _0x277e0d=_0x46fa00&&_0x46fa00[_0x872c('0x35')]('true')>=0x0?!![]:![];logger[_0x872c('0x17')](_0x872c('0x36'),_0x49e929['id'],_0x462488['id'],_0x462488[_0x872c('0x37')],_0x277e0d?_0x872c('0x38'):_0x872c('0x39'),_0x49e929[_0x872c('0x33')]?_0x49e929[_0x872c('0x33')]:_0x872c('0x3a'));return _0x277e0d;})[_0x872c('0x20')](function(_0x319346){logger[_0x872c('0x1d')](_0x872c('0x36'),_0x49e929['id'],_0x462488['id'],_0x462488[_0x872c('0x37')],util['inspect'](_0x319346,{'showHidden':![],'depth':null}),_0x49e929['timezone']?_0x49e929[_0x872c('0x33')]:_0x872c('0x3a'));return![];});}function checkWebsiteIntervals(_0x56ad93){var _0xb0c839=_[_0x872c('0x3b')](_0x56ad93[_0x872c('0x3c')][_0x872c('0x3d')],function(_0x9b847b){var _0x43c684=_0x9b847b[_0x872c('0x2a')]({'plain':!![]});return iftimePromise(_0x43c684,_0x56ad93);});return Promise[_0x872c('0x3e')](_0xb0c839)[_0x872c('0x16')](function(_0x149252){return _[_0x872c('0x3f')](_0x149252);});}function createInteractionObject(_0x466845,_0x37bf1f,_0x12a1aa,_0x63fc4a){var _0x117b15=require(_0x872c('0x40'));var _0x337b42=new _0x117b15();var _0x2ec63b=_0x337b42['setUA'](_0x12a1aa['user-agent'])[_0x872c('0x41')]();var _0x3cba9e=_0x37bf1f[_0x872c('0x42')];if(_0x12a1aa[_0x872c('0x43')]){_0x3cba9e=_0x12a1aa[_0x872c('0x43')];}else if(_0x12a1aa[_0x872c('0x44')]){_0x3cba9e=_[_0x872c('0x45')](_0x12a1aa[_0x872c('0x44')][_0x872c('0x46')](','));}return{'ContactId':_0x63fc4a['id'],'ChatWebsiteId':_0x466845,'from':(_0x63fc4a[_0x872c('0x47')]||'')+'\x20'+(_0x63fc4a[_0x872c('0x48')]||''),'customerIp':_0x3cba9e,'customerPort':_0x12a1aa[_0x872c('0x49')]?_0x12a1aa[_0x872c('0x49')]:null,'referer':_0x37bf1f[_0x872c('0x4a')],'browserName':_0x2ec63b['browser'][_0x872c('0x2e')]&&_0x2ec63b[_0x872c('0x4b')][_0x872c('0x4c')]?util[_0x872c('0x31')]('%s\x20%s',_0x2ec63b[_0x872c('0x4b')][_0x872c('0x2e')],_0x2ec63b['browser'][_0x872c('0x4c')]):_0x872c('0x4d'),'browserVersion':_0x2ec63b[_0x872c('0x4b')]['version']||_0x872c('0x4d'),'osName':util[_0x872c('0x31')](_0x872c('0x4e'),_0x2ec63b['os'][_0x872c('0x2e')],_0x2ec63b['os'][_0x872c('0x4c')]),'osVersion':_0x2ec63b['os'][_0x872c('0x4c')],'deviceModel':_0x2ec63b[_0x872c('0x4f')][_0x872c('0x50')]&&_0x2ec63b[_0x872c('0x4f')]['vendor']?util['format']('%s\x20%s\x20%s',_0x2ec63b[_0x872c('0x4f')][_0x872c('0x50')],_0x2ec63b[_0x872c('0x4f')]['vendor'],_0x2ec63b[_0x872c('0x4f')][_0x872c('0x51')]):null,'deviceVendor':_0x2ec63b[_0x872c('0x4f')][_0x872c('0x52')],'deviceType':_0x2ec63b[_0x872c('0x4f')]['type'],'formData':JSON[_0x872c('0x1c')](_0x37bf1f)};}exports[_0x872c('0x53')]=function(_0x361539,_0x27fa07){var _0x4a180b={'include':[{'model':db[_0x872c('0x54')],'as':_0x872c('0x55')}]},_0x505519={},_0x5d3c38={'count':0x0,'rows':[]};var _0x4f162e=_[_0x872c('0x3b')](db['ChatWebsite'][_0x872c('0x56')],function(_0x22a3a8){return{'name':_0x22a3a8['fieldName'],'type':_0x22a3a8[_0x872c('0x51')][_0x872c('0x57')]};});_0x505519[_0x872c('0x50')]=_['map'](_0x4f162e,_0x872c('0x2e'));_0x505519[_0x872c('0x58')]=_['keys'](_0x361539[_0x872c('0x58')]);_0x505519[_0x872c('0x59')]=_['intersection'](_0x505519['model'],_0x505519['query']);_0x4a180b[_0x872c('0x5a')]=_[_0x872c('0x5b')](_0x505519[_0x872c('0x50')],qs[_0x872c('0x5c')](_0x361539[_0x872c('0x58')][_0x872c('0x5c')]));_0x4a180b['attributes']=_0x4a180b[_0x872c('0x5a')][_0x872c('0x5d')]?_0x4a180b['attributes']:_0x505519[_0x872c('0x50')];if(!_0x361539[_0x872c('0x58')][_0x872c('0x5e')](_0x872c('0x5f'))){_0x4a180b['limit']=qs[_0x872c('0x25')](_0x361539[_0x872c('0x58')][_0x872c('0x25')]);_0x4a180b[_0x872c('0x23')]=qs[_0x872c('0x23')](_0x361539['query'][_0x872c('0x23')]);}_0x4a180b['order']=qs[_0x872c('0x60')](_0x361539[_0x872c('0x58')][_0x872c('0x60')]);_0x4a180b['where']=qs[_0x872c('0x59')](_['pick'](_0x361539[_0x872c('0x58')],_0x505519[_0x872c('0x59')]),_0x4f162e);if(_0x361539[_0x872c('0x58')][_0x872c('0x61')]){_0x4a180b[_0x872c('0x62')]=_['merge'](_0x4a180b[_0x872c('0x62')],{'$or':_[_0x872c('0x3b')](_0x4f162e,function(_0x3025aa){if(_0x3025aa[_0x872c('0x51')]!==_0x872c('0x63')){var _0x10c0d9={};_0x10c0d9[_0x3025aa['name']]={'$like':'%'+_0x361539[_0x872c('0x58')]['filter']+'%'};return _0x10c0d9;}})});}_0x4a180b=_['merge']({},_0x4a180b,_0x361539['options']);var _0x3fe0d5={'where':_0x4a180b[_0x872c('0x62')]};return db[_0x872c('0x64')][_0x872c('0x26')](_0x3fe0d5)[_0x872c('0x16')](function(_0x557787){_0x5d3c38['count']=_0x557787;if(_0x361539['query'][_0x872c('0x65')]){_0x4a180b[_0x872c('0x66')]=[{'all':!![]}];}return db[_0x872c('0x64')][_0x872c('0x67')](_0x4a180b);})[_0x872c('0x16')](function(_0x4ad721){_0x5d3c38[_0x872c('0x68')]=_0x4ad721;return _0x5d3c38;})[_0x872c('0x16')](respondWithFilteredResult(_0x27fa07,_0x4a180b))[_0x872c('0x20')](handleError(_0x27fa07,null));};exports[_0x872c('0x69')]=function(_0x1ccc1b,_0xb82f4){var _0x1d1125={'raw':![],'where':{'id':_0x1ccc1b['params']['id']},'include':[{'model':db[_0x872c('0x54')],'as':'mandatoryDispositionPause'}]},_0xdb7266={};_0xdb7266[_0x872c('0x50')]=_[_0x872c('0x6a')](db['ChatWebsite'][_0x872c('0x56')]);_0xdb7266[_0x872c('0x58')]=_[_0x872c('0x6a')](_0x1ccc1b[_0x872c('0x58')]);_0xdb7266[_0x872c('0x59')]=_[_0x872c('0x5b')](_0xdb7266[_0x872c('0x50')],_0xdb7266[_0x872c('0x58')]);_0x1d1125['attributes']=_[_0x872c('0x5b')](_0xdb7266[_0x872c('0x50')],qs[_0x872c('0x5c')](_0x1ccc1b[_0x872c('0x58')]['fields']));_0x1d1125[_0x872c('0x5a')]=_0x1d1125[_0x872c('0x5a')][_0x872c('0x5d')]?_0x1d1125['attributes']:_0xdb7266[_0x872c('0x50')];if(_0x1ccc1b[_0x872c('0x58')][_0x872c('0x65')]){_0x1d1125['include']=[{'all':!![]}];}_0x1d1125=_[_0x872c('0x6b')]({},_0x1d1125,_0x1ccc1b[_0x872c('0x6c')]);return db['ChatWebsite']['find'](_0x1d1125)[_0x872c('0x16')](handleEntityNotFound(_0xb82f4,null))[_0x872c('0x16')](respondWithResult(_0xb82f4,null))['catch'](handleError(_0xb82f4,null));};exports[_0x872c('0x6d')]=function(_0x36412e,_0x31a52f){return db['ChatWebsite'][_0x872c('0x6d')](_0x36412e[_0x872c('0x6e')],{})[_0x872c('0x16')](function(_0x36a1e8){var _0x341c88=_0x36412e[_0x872c('0x6f')][_0x872c('0x2a')]({'plain':!![]});if(!_0x341c88)throw new Error(_0x872c('0x70'));if(_0x341c88[_0x872c('0x71')]==='user'){var _0xc92436=_0x36a1e8[_0x872c('0x2a')]({'plain':!![]});var _0x4c9aca=_0x872c('0x72');return db['UserProfileSection'][_0x872c('0x73')]({'where':{'name':_0x4c9aca,'userProfileId':_0x341c88['userProfileId']},'raw':!![]})['then'](function(_0x202195){if(_0x202195&&_0x202195[_0x872c('0x74')]===0x0){return db[_0x872c('0x2b')][_0x872c('0x6d')]({'name':_0xc92436[_0x872c('0x2e')],'resourceId':_0xc92436['id'],'type':_0x202195[_0x872c('0x2e')],'sectionId':_0x202195['id']},{})[_0x872c('0x16')](function(){return _0x36a1e8;});}else{return _0x36a1e8;}})[_0x872c('0x20')](function(_0x64460d){logger[_0x872c('0x1d')](_0x872c('0x75'),_0x64460d);throw _0x64460d;});}return _0x36a1e8;})['then'](respondWithResult(_0x31a52f,0xc9))[_0x872c('0x20')](handleError(_0x31a52f,null));};exports[_0x872c('0x28')]=function(_0x1652d7,_0x49e90a){if(_0x1652d7['body']['id']){delete _0x1652d7['body']['id'];}return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0x1652d7[_0x872c('0x76')]['id']},'include':[{'model':db[_0x872c('0x54')],'as':'mandatoryDispositionPause'}]})[_0x872c('0x16')](handleEntityNotFound(_0x49e90a,null))[_0x872c('0x16')](saveUpdates(_0x1652d7[_0x872c('0x6e')],null))[_0x872c('0x16')](respondWithResult(_0x49e90a,null))[_0x872c('0x20')](handleError(_0x49e90a,null));};exports[_0x872c('0x29')]=function(_0x41106b,_0x57d018){return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0x41106b[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x57d018,null))[_0x872c('0x16')](removeEntity(_0x57d018,null))[_0x872c('0x20')](handleError(_0x57d018,null));};exports['describe']=function(_0x4da7f9,_0x3d13a4){return db['ChatWebsite'][_0x872c('0x77')]()[_0x872c('0x16')](respondWithResult(_0x3d13a4,null))[_0x872c('0x20')](handleError(_0x3d13a4,null));};exports['addDisposition']=function(_0x25f969,_0x94f246){if(_0x25f969[_0x872c('0x6e')]['id']){delete _0x25f969[_0x872c('0x6e')]['id'];}return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0x25f969[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x94f246,null))['then'](function(_0x56dc02){if(_0x56dc02){_0x25f969[_0x872c('0x6e')][_0x872c('0x78')]=_0x56dc02['id'];return db[_0x872c('0x79')]['create'](_0x25f969[_0x872c('0x6e')]);}})[_0x872c('0x16')](respondWithResult(_0x94f246,null))['catch'](handleError(_0x94f246,null));};exports[_0x872c('0x7a')]=function(_0x474849,_0x3d592c){var _0x1760f3={'raw':![],'where':{}};var _0x295ed3={};var _0x421c74={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x872c('0x7b')]({'where':{'id':_0x474849[_0x872c('0x76')]['id']}})['then'](handleEntityNotFound(_0x3d592c,null))['then'](function(_0x74d79b){if(_0x74d79b){_0x295ed3[_0x872c('0x50')]=_[_0x872c('0x6a')](db['Disposition'][_0x872c('0x56')]);_0x295ed3['query']=_[_0x872c('0x6a')](_0x474849[_0x872c('0x58')]);_0x295ed3[_0x872c('0x59')]=_[_0x872c('0x5b')](_0x295ed3[_0x872c('0x50')],_0x295ed3[_0x872c('0x58')]);_0x1760f3[_0x872c('0x5a')]=_[_0x872c('0x5b')](_0x295ed3[_0x872c('0x50')],qs[_0x872c('0x5c')](_0x474849[_0x872c('0x58')][_0x872c('0x5c')]));_0x1760f3[_0x872c('0x5a')]=_0x1760f3['attributes'][_0x872c('0x5d')]?_0x1760f3[_0x872c('0x5a')]:_0x295ed3['model'];if(!_0x474849[_0x872c('0x58')][_0x872c('0x5e')](_0x872c('0x5f'))){_0x1760f3[_0x872c('0x25')]=qs[_0x872c('0x25')](_0x474849[_0x872c('0x58')]['limit']);_0x1760f3[_0x872c('0x23')]=qs[_0x872c('0x23')](_0x474849['query']['offset']);}_0x1760f3['order']=qs[_0x872c('0x60')](_0x474849[_0x872c('0x58')][_0x872c('0x60')]);_0x1760f3['where']=qs['filters'](_[_0x872c('0x7c')](_0x474849[_0x872c('0x58')],_0x295ed3[_0x872c('0x59')]));_0x1760f3[_0x872c('0x62')][_0x872c('0x78')]=_0x74d79b['id'];if(_0x474849['query'][_0x872c('0x61')]){_0x1760f3['where']=_[_0x872c('0x6b')](_0x1760f3['where'],{'$or':_['map'](_0x1760f3[_0x872c('0x5a')],function(_0x95941e){var _0x187cfe={};_0x187cfe[_0x95941e]={'$like':'%'+_0x474849[_0x872c('0x58')][_0x872c('0x61')]+'%'};return _0x187cfe;})});}_0x1760f3=_[_0x872c('0x6b')]({},_0x1760f3,_0x474849[_0x872c('0x6c')]);return db[_0x872c('0x79')][_0x872c('0x26')]({'where':_0x1760f3[_0x872c('0x62')]})['then'](function(_0x52bf7f){_0x421c74['count']=_0x52bf7f;if(_0x474849['query'][_0x872c('0x65')]){_0x1760f3['include']=[{'all':!![]}];}return db[_0x872c('0x79')][_0x872c('0x67')](_0x1760f3);})['then'](function(_0x7db5f5){_0x421c74[_0x872c('0x68')]=_0x7db5f5;return _0x421c74;});}})[_0x872c('0x16')](respondWithFilteredResult(_0x3d592c,_0x1760f3))[_0x872c('0x20')](handleError(_0x3d592c,null));};exports[_0x872c('0x7d')]=function(_0xe40925,_0x433772){return db[_0x872c('0x64')]['find']({'where':{'id':_0xe40925[_0x872c('0x76')]['id']}})['then'](handleEntityNotFound(_0x433772,null))[_0x872c('0x16')](function(_0x362554){if(_0x362554){return _0x362554['removeDispositions'](_0xe40925['query'][_0x872c('0x7e')]);}})[_0x872c('0x16')](respondWithStatusCode(_0x433772,null))['catch'](handleError(_0x433772,null));};exports[_0x872c('0x7f')]=function(_0x3dc64f,_0xb6c2af){if(_0x3dc64f[_0x872c('0x6e')]['id']){delete _0x3dc64f[_0x872c('0x6e')]['id'];}return db[_0x872c('0x64')]['find']({'where':{'id':_0x3dc64f[_0x872c('0x76')]['id']}})['then'](handleEntityNotFound(_0xb6c2af,null))['then'](function(_0x4e9dca){if(_0x4e9dca){_0x3dc64f['body'][_0x872c('0x78')]=_0x4e9dca['id'];return db['CannedAnswer']['create'](_0x3dc64f['body']);}})['then'](respondWithResult(_0xb6c2af,null))[_0x872c('0x20')](handleError(_0xb6c2af,null));};exports[_0x872c('0x80')]=function(_0x61d42d,_0x4a1c8b){var _0x1fc281={'raw':![],'where':{}};var _0x1f26b8={};var _0x409ab3={'count':0x0,'rows':[]};return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x61d42d[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x4a1c8b,null))[_0x872c('0x16')](function(_0x340006){if(_0x340006){_0x1f26b8[_0x872c('0x50')]=_[_0x872c('0x6a')](db[_0x872c('0x81')][_0x872c('0x56')]);_0x1f26b8[_0x872c('0x58')]=_[_0x872c('0x6a')](_0x61d42d['query']);_0x1f26b8['filters']=_[_0x872c('0x5b')](_0x1f26b8['model'],_0x1f26b8[_0x872c('0x58')]);_0x1fc281[_0x872c('0x5a')]=_[_0x872c('0x5b')](_0x1f26b8[_0x872c('0x50')],qs['fields'](_0x61d42d['query'][_0x872c('0x5c')]));_0x1fc281['attributes']=_0x1fc281[_0x872c('0x5a')]['length']?_0x1fc281[_0x872c('0x5a')]:_0x1f26b8['model'];if(!_0x61d42d[_0x872c('0x58')]['hasOwnProperty'](_0x872c('0x5f'))){_0x1fc281[_0x872c('0x25')]=qs['limit'](_0x61d42d[_0x872c('0x58')]['limit']);_0x1fc281[_0x872c('0x23')]=qs[_0x872c('0x23')](_0x61d42d['query'][_0x872c('0x23')]);}_0x1fc281[_0x872c('0x82')]=qs['sort'](_0x61d42d[_0x872c('0x58')][_0x872c('0x60')]);_0x1fc281[_0x872c('0x62')]=qs[_0x872c('0x59')](_[_0x872c('0x7c')](_0x61d42d['query'],_0x1f26b8['filters']));_0x1fc281['where']['ChatWebsiteId']=_0x340006['id'];if(_0x61d42d[_0x872c('0x58')][_0x872c('0x61')]){_0x1fc281['where']=_['merge'](_0x1fc281[_0x872c('0x62')],{'$or':_[_0x872c('0x3b')](_0x1fc281['attributes'],function(_0x2df526){var _0x2b7f70={};_0x2b7f70[_0x2df526]={'$like':'%'+_0x61d42d[_0x872c('0x58')]['filter']+'%'};return _0x2b7f70;})});}_0x1fc281=_['merge']({},_0x1fc281,_0x61d42d[_0x872c('0x6c')]);return db[_0x872c('0x81')][_0x872c('0x26')]({'where':_0x1fc281[_0x872c('0x62')]})[_0x872c('0x16')](function(_0x443e9a){_0x409ab3[_0x872c('0x26')]=_0x443e9a;if(_0x61d42d[_0x872c('0x58')][_0x872c('0x65')]){_0x1fc281[_0x872c('0x66')]=[{'all':!![]}];}return db[_0x872c('0x81')][_0x872c('0x67')](_0x1fc281);})[_0x872c('0x16')](function(_0xfb5aad){_0x409ab3[_0x872c('0x68')]=_0xfb5aad;return _0x409ab3;});}})[_0x872c('0x16')](respondWithFilteredResult(_0x4a1c8b,_0x1fc281))[_0x872c('0x20')](handleError(_0x4a1c8b,null));};exports[_0x872c('0x83')]=function(_0x2156bd,_0x26696d){return db[_0x872c('0x64')]['find']({'where':{'id':_0x2156bd[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x26696d,null))[_0x872c('0x16')](function(_0x38e7d6){if(_0x38e7d6){return _0x38e7d6[_0x872c('0x83')](_0x2156bd[_0x872c('0x58')][_0x872c('0x7e')]);}})[_0x872c('0x16')](respondWithStatusCode(_0x26696d,null))['catch'](handleError(_0x26696d,null));};exports[_0x872c('0x84')]=function(_0xe2fe12,_0x230c4f){_0xe2fe12[_0x872c('0x6e')]['sitepic']=_0xe2fe12['file'][_0x872c('0x85')];return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0xe2fe12[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x230c4f,null))[_0x872c('0x16')](saveUpdates(_0xe2fe12[_0x872c('0x6e')],null))[_0x872c('0x16')](respondWithResult(_0x230c4f,null))[_0x872c('0x20')](handleError(_0x230c4f,null));};exports[_0x872c('0x86')]=function(_0xd04d90,_0x144d63){_0xd04d90[_0x872c('0x6e')][_0x872c('0x87')]=_0xd04d90[_0x872c('0x88')][_0x872c('0x85')];return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0xd04d90[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x144d63,null))[_0x872c('0x16')](saveUpdates(_0xd04d90[_0x872c('0x6e')],null))[_0x872c('0x16')](respondWithResult(_0x144d63,null))[_0x872c('0x20')](handleError(_0x144d63,null));};exports[_0x872c('0x89')]=function(_0x2503ad,_0x32c603){_0x2503ad[_0x872c('0x6e')]['customerAvatar']=_0x2503ad[_0x872c('0x88')][_0x872c('0x85')];return db['ChatWebsite']['find']({'where':{'id':_0x2503ad[_0x872c('0x76')]['id']}})['then'](handleEntityNotFound(_0x32c603,null))[_0x872c('0x16')](saveUpdates(_0x2503ad['body'],null))[_0x872c('0x16')](respondWithResult(_0x32c603,null))[_0x872c('0x20')](handleError(_0x32c603,null));};exports[_0x872c('0x8a')]=function(_0x48f97a,_0x5e0c3e){_0x48f97a[_0x872c('0x6e')]['systemAvatar']=_0x48f97a[_0x872c('0x88')][_0x872c('0x85')];return db['ChatWebsite'][_0x872c('0x73')]({'where':{'id':_0x48f97a[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x5e0c3e,null))[_0x872c('0x16')](saveUpdates(_0x48f97a[_0x872c('0x6e')],null))[_0x872c('0x16')](respondWithResult(_0x5e0c3e,null))['catch'](handleError(_0x5e0c3e,null));};exports[_0x872c('0x8b')]=function(_0x21da88,_0x333639){var _0x5b08cc=path['join'](config[_0x872c('0x8c')],_0x872c('0x8d'));var _0x406639={'where':{'id':_0x21da88[_0x872c('0x76')]['id']},'attributes':['id',_0x872c('0x8e')],'raw':!![]};var _0x283a08=![];return require('../../config/license/util')['getLicense']()['then'](function(_0x18b9bd){if(_0x18b9bd){_0x283a08=_0x18b9bd[_0x872c('0x8f')];}})[_0x872c('0x16')](function(){return db[_0x872c('0x64')][_0x872c('0x73')](_0x406639);})[_0x872c('0x16')](handleEntityNotFound(_0x333639,null))[_0x872c('0x16')](function(_0x78a629){if(_0x78a629){if(!_['isNil'](_0x78a629[_0x872c('0x8e')])){if(fs[_0x872c('0x90')](path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0x92'),_0x78a629[_0x872c('0x8e')]))&&_0x283a08){_0x5b08cc=path[_0x872c('0x91')](config['root'],_0x872c('0x92'),_0x78a629[_0x872c('0x8e')]);}}return _0x333639['download'](_0x5b08cc);}})[_0x872c('0x20')](handleError(_0x333639,null));};exports[_0x872c('0x93')]=function(_0xeae151,_0x4b168d){var _0x350f96=path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0x94'));var _0x2d28ed={'where':{'id':_0xeae151[_0x872c('0x76')]['id']},'attributes':['id',_0x872c('0x87')],'raw':!![]};return db[_0x872c('0x64')][_0x872c('0x73')](_0x2d28ed)['then'](handleEntityNotFound(_0x4b168d,null))[_0x872c('0x16')](function(_0x316e8f){if(_0x316e8f){if(!_[_0x872c('0x95')](_0x316e8f[_0x872c('0x87')])){if(fs[_0x872c('0x90')](path['join'](config[_0x872c('0x8c')],'server/files/images/avatars/',_0x316e8f[_0x872c('0x87')]))){_0x350f96=path[_0x872c('0x91')](config[_0x872c('0x8c')],'server/files/images/avatars/',_0x316e8f[_0x872c('0x87')]);}}return _0x4b168d['download'](_0x350f96);}})[_0x872c('0x20')](handleError(_0x4b168d,null));};exports['getCustomerAvatar']=function(_0x4e5d10,_0x2e2c0b){var _0x44125a=path[_0x872c('0x91')](config['root'],_0x872c('0x96'));var _0x402c58={'where':{'id':_0x4e5d10[_0x872c('0x76')]['id']},'attributes':['id','customerAvatar',_0x872c('0x97')],'raw':!![]};return db['ChatWebsite']['find'](_0x402c58)[_0x872c('0x16')](handleEntityNotFound(_0x2e2c0b,null))[_0x872c('0x16')](function(_0x52f967){if(_0x52f967){if(!_[_0x872c('0x95')](_0x52f967[_0x872c('0x98')])){if(fs['existsSync'](path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0x99'),_0x52f967['customerAvatar']))&&_0x52f967['showCustomerAvatar']){_0x44125a=path[_0x872c('0x91')](config['root'],_0x872c('0x99'),_0x52f967[_0x872c('0x98')]);}}return _0x2e2c0b[_0x872c('0x9a')](_0x44125a);}})[_0x872c('0x20')](handleError(_0x2e2c0b,null));};exports[_0x872c('0x9b')]=function(_0xd8c4e9,_0x291a82){var _0x2a735f=path['join'](config['root'],'server/files/images/avatars/system_avatar.png');var _0x4cb52c={'where':{'id':_0xd8c4e9['params']['id']},'attributes':['id',_0x872c('0x9c')],'raw':!![]};return db['ChatWebsite']['find'](_0x4cb52c)[_0x872c('0x16')](handleEntityNotFound(_0x291a82,null))[_0x872c('0x16')](function(_0x2242b7){if(_0x2242b7){if(!_['isNil'](_0x2242b7[_0x872c('0x9c')])){if(fs['existsSync'](path[_0x872c('0x91')](config['root'],_0x872c('0x99'),_0x2242b7[_0x872c('0x9c')]))){_0x2a735f=path[_0x872c('0x91')](config['root'],_0x872c('0x99'),_0x2242b7['systemAvatar']);}}return _0x291a82[_0x872c('0x9a')](_0x2a735f);}})[_0x872c('0x20')](handleError(_0x291a82,null));};exports[_0x872c('0x9d')]=function(_0x3137b5,_0x2344be){var _0x2c39bb={'body':_0x3137b5[_0x872c('0x6e')],'channel':_0x872c('0x9e')};var _0x210c08=[];var _0x4bf733=[];var _0xa5556e={};var _0x425f1c=![];return db[_0x872c('0x9f')]['describe']()['then'](function(_0x49e5e8){if(!_0x49e5e8){throw new db[(_0x872c('0xa0'))]['ValidationError'](_0x872c('0xa1'));}_0x210c08=_['difference'](_[_0x872c('0x6a')](_0x49e5e8),[_0x872c('0xa2'),'updatedAt']);_0x4bf733=_[_0x872c('0xa3')](_[_0x872c('0x6a')](_0x49e5e8),[_0x872c('0xa2'),_0x872c('0xa4'),'CompanyId',_0x872c('0xa5')]);if(_0x3137b5[_0x872c('0x6e')]['id']){delete _0x3137b5['body']['id'];}if(_[_0x872c('0x95')](_0x3137b5[_0x872c('0x6e')][_0x872c('0xa6')])){throw new db[(_0x872c('0xa0'))]['ValidationError'](_0x872c('0xa7'));}if(_[_0x872c('0x95')](_0x3137b5[_0x872c('0x6e')]['body'])||_0x3137b5[_0x872c('0x6e')]['body']===''){throw new db[(_0x872c('0xa0'))][(_0x872c('0xa8'))](_0x872c('0xa9'));}if(_[_0x872c('0x95')](_0x3137b5[_0x872c('0x6e')][_0x872c('0xaa')])){throw new db['Sequelize'][(_0x872c('0xa8'))](_0x872c('0xab')+_0x4bf733);}if(!_['includes'](_0x4bf733,_0x3137b5[_0x872c('0x6e')][_0x872c('0xaa')])){throw new db[(_0x872c('0xa0'))][(_0x872c('0xa8'))](_0x872c('0xac')+_0x4bf733);}_0xa5556e[_0x3137b5['body'][_0x872c('0xaa')]]=_0x3137b5[_0x872c('0x6e')][_0x872c('0xa6')];})[_0x872c('0x16')](function(){return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0x3137b5[_0x872c('0x76')]['id']},'include':[{'model':db['CmList'],'as':_0x872c('0xad'),'include':[{'model':db[_0x872c('0x9f')],'as':_0x872c('0xae'),'where':_0xa5556e,'limit':0x1,'order':[['updatedAt',_0x872c('0xaf')]]}]},{'model':db[_0x872c('0xb0')],'as':_0x872c('0xb1')},{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x872c('0x3c')],'as':_0x872c('0x3d'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x872c('0x16')](function(_0x65d1a5){if(!_0x65d1a5)throw new APINotFoundError(util['format']('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x3137b5['params']['id']));if(!_0x65d1a5['Interval']||!_0x65d1a5[_0x872c('0x3c')]['Intervals'])return[_0x65d1a5,!![]];return[_0x65d1a5,checkWebsiteIntervals(_0x65d1a5)];})[_0x872c('0xb2')](function(_0x2892d7,_0x1281bc){if(!_0x1281bc)throw new APIOutOfIntervalError();if(!_0x2892d7['List'])return;_0x2c39bb['account']=_0x2892d7;_0x2c39bb['list']=_0x2892d7[_0x872c('0xad')];_0x2c39bb['applications']=_['orderBy'](_0x2892d7[_0x872c('0xb1')],[_0x872c('0xb3')],['asc']);if(_0x2c39bb[_0x872c('0xb4')][_0x872c('0xb1')]){delete _0x2c39bb[_0x872c('0xb4')][_0x872c('0xb1')];}if(_0x2c39bb[_0x872c('0xb4')][_0x872c('0xad')]&&_0x2c39bb[_0x872c('0xb4')][_0x872c('0xad')][_0x872c('0xae')][_0x872c('0x5d')]){return _0x2c39bb[_0x872c('0xb4')][_0x872c('0xad')][_0x872c('0xae')][0x0];}var _0x10b0e4=_[_0x872c('0xf')](_0x3137b5[_0x872c('0x6e')],{'firstName':_0x3137b5[_0x872c('0x6e')][_0x872c('0xa6')],'ListId':_0x2892d7[_0x872c('0xa5')]});_0x10b0e4[_0x3137b5[_0x872c('0x6e')][_0x872c('0xaa')]]=_0x3137b5[_0x872c('0x6e')][_0x872c('0xa6')];return db[_0x872c('0x9f')][_0x872c('0x6d')](_0x10b0e4,{'fields':_0x210c08,'raw':!![]});})[_0x872c('0x16')](function(_0x4e235b){_0x2c39bb[_0x872c('0xb5')]=_0x4e235b;var _0x1a737a=createInteractionObject(_0x3137b5[_0x872c('0x76')]['id'],_0x3137b5['body'],_0x3137b5[_0x872c('0xb6')],_0x4e235b);var _0x502c78={'ChatWebsiteId':_0x3137b5[_0x872c('0x76')]['id'],'closed':![]};if(_0x3137b5[_0x872c('0x6e')][_0x872c('0xb7')]){_0x502c78[_0x872c('0xb7')]=_0x3137b5['body'][_0x872c('0xb7')];return db[_0x872c('0xb8')][_0x872c('0x73')]({'where':_0x502c78})[_0x872c('0x16')](function(_0xfcce36){if(_0xfcce36){_0x425f1c=!![];return _0xfcce36;}_0x1a737a[_0x872c('0xb7')]=_0x3137b5[_0x872c('0x6e')]['threadId'];_0x1a737a['externalUrl']=_0x3137b5['body'][_0x872c('0xb9')];return db['ChatInteraction']['create'](_0x1a737a);});}_0x502c78[_0x872c('0xba')]=_0x4e235b['id'];if(_0x3137b5['body'][_0x872c('0xbb')]&&_0x3137b5[_0x872c('0x6e')]['interaction']['id']){_0x502c78['id']=_0x3137b5[_0x872c('0x6e')][_0x872c('0xbb')]['id'];return db[_0x872c('0xb8')][_0x872c('0x73')]({'where':_0x502c78})[_0x872c('0x16')](function(_0x575f53){if(_0x575f53){_0x425f1c=!![];return _0x575f53;}return db[_0x872c('0xb8')][_0x872c('0x6d')](_0x1a737a);});}return db[_0x872c('0xb8')]['create'](_0x1a737a);})[_0x872c('0x16')](function(_0x10ab74){if(!_0x425f1c)return _0x10ab74;var _0x46ad09={'from':(_0x2c39bb[_0x872c('0xb5')][_0x872c('0x47')]||'')+'\x20'+(_0x2c39bb[_0x872c('0xb5')][_0x872c('0x48')]||'')};if(_0x3137b5[_0x872c('0x6e')][_0x872c('0xb7')]&&_0x3137b5[_0x872c('0x6e')][_0x872c('0xbc')]&&_0x3137b5[_0x872c('0x6e')][_0x872c('0xb7')]!=_0x3137b5[_0x872c('0x6e')]['messageId']){_0x46ad09['threadId']=_0x3137b5['body'][_0x872c('0xbc')];}return _0x10ab74[_0x872c('0x28')](_0x46ad09);})[_0x872c('0x16')](function(_0xe18644){_0x2c39bb[_0x872c('0xbb')]=_0xe18644['get']({'plain':!![]});_0x2c39bb[_0x872c('0xbb')][_0x872c('0xbd')]=!_0x425f1c;if(_0x2c39bb[_0x872c('0xbb')][_0x872c('0xbd')]){if(_0x2c39bb[_0x872c('0xb4')][_0x872c('0xbe')]){_0x2c39bb['applications'][_0x872c('0xbf')]({'id':0x0,'priority':_0x2c39bb[_0x872c('0xc0')]['length']+0x1,'app':_0x872c('0xc1'),'appdata':_0x872c('0xc2'),'interval':'*,*,*,*'});}}return db['ChatMessage']['create']({'body':_0x3137b5[_0x872c('0x6e')][_0x872c('0x6e')],'ChatWebsiteId':_0x3137b5[_0x872c('0x76')]['id'],'ChatInteractionId':_0xe18644['id'],'direction':'in','ContactId':_0x2c39bb[_0x872c('0xb5')]['id'],'AttachmentId':_0x3137b5[_0x872c('0x6e')][_0x872c('0xc3')]});})[_0x872c('0x16')](function(_0x30777b){_0x2c39bb[_0x872c('0x1f')]=_0x30777b;if(!_0x2c39bb[_0x872c('0xbb')]['UserId']){return;}return db['User'][_0x872c('0x73')]({'attributes':['id',_0x872c('0x2e')],'where':{'id':_0x2c39bb[_0x872c('0xbb')]['UserId']}});})[_0x872c('0x16')](function(_0x4e846f){if(_0x4e846f){_0x2c39bb[_0x872c('0xc0')][_0x872c('0xc4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4e846f[_0x872c('0x2e')]+','+(_0x2c39bb[_0x872c('0xb4')][_0x872c('0xc5')]||0xa),'interval':_0x872c('0xc6')});_0x2c39bb[_0x872c('0xc7')]=!![];}if(!_0x2c39bb['interaction']['queueId']){return;}return db[_0x872c('0xc8')][_0x872c('0x73')]({'attributes':['id',_0x872c('0x2e')],'where':{'id':_0x2c39bb[_0x872c('0xbb')]['queueId']}});})[_0x872c('0x16')](function(_0x4dc75c){if(_0x4dc75c){_0x2c39bb[_0x872c('0xc0')]['unshift']({'id':0x0,'priority':0x1,'app':_0x872c('0xc9'),'appdata':_0x4dc75c[_0x872c('0x2e')]+','+(_0x2c39bb['account'][_0x872c('0xca')]||0x12c),'interval':_0x872c('0xc6')});}return respondWithRpcPromise(_0x872c('0xcb'),_0x872c('0xcc'),_0x2c39bb);})[_0x872c('0x16')](function(_0x1fa142){respondWithRpcPromise(_0x872c('0xcd'),_0x872c('0xcd'),{'event':_0x872c('0x9d'),'message':_0x1fa142},client9002);return _0x1fa142;})[_0x872c('0x16')](respondWithResult(_0x2344be,null))[_0x872c('0x20')](APIHandleError(_0x2344be));};exports['offline']=function(_0xec875b,_0x305247){var _0x24cbb6,_0x5a5906,_0x4a0eb1;var _0xd48f05=[];var _0x599044={};var _0x144373=_0xec875b[_0x872c('0xce')]||[];var _0x227098=[];var _0x519f53;return db[_0x872c('0x9f')]['describe']()[_0x872c('0x16')](function(_0x2a2183){if(!_0x2a2183){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0xd48f05=_['difference'](_[_0x872c('0x6a')](_0x2a2183),[_0x872c('0xa2'),_0x872c('0xa4'),_0x872c('0xcf'),_0x872c('0xa5')]);if(_0xec875b['body']['id']){delete _0xec875b['body']['id'];}if(_[_0x872c('0x95')](_0xec875b[_0x872c('0x6e')]['from'])){throw _0x305247[_0x872c('0x21')](0x1f4)[_0x872c('0x2f')](new db[(_0x872c('0xa0'))][(_0x872c('0xa8'))](_0x872c('0xa7')));}if(_[_0x872c('0x95')](_0xec875b[_0x872c('0x6e')]['body'])||_0xec875b[_0x872c('0x6e')][_0x872c('0x6e')]===''){throw _0x305247['status'](0x1f4)[_0x872c('0x2f')](new db[(_0x872c('0xa0'))][(_0x872c('0xa8'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x872c('0x95')](_0xec875b[_0x872c('0x6e')][_0x872c('0xd0')])){throw _0x305247['status'](0x1f4)[_0x872c('0x2f')](new db[(_0x872c('0xa0'))][(_0x872c('0xa8'))](_0x872c('0xd1')+_0xd48f05));}if(!_['includes'](_0xd48f05,_0xec875b[_0x872c('0x6e')][_0x872c('0xd0')])){throw _0x305247[_0x872c('0x21')](0x1f4)[_0x872c('0x2f')](new db['Sequelize']['ValidationError'](_0x872c('0xd2')+_0xd48f05));}_0x599044[_0xec875b[_0x872c('0x6e')][_0x872c('0xd0')]]=_0xec875b['body'][_0x872c('0xa6')];})['then'](function(){return db[_0x872c('0x64')]['find']({'where':{'id':_0xec875b['params']['id']},'include':[{'model':db[_0x872c('0xd3')],'as':_0x872c('0xad')},{'model':db[_0x872c('0xd4')],'as':_0x872c('0xd4')}]});})[_0x872c('0x16')](handleEntityNotFound(_0x305247,null))['then'](function(_0x16958e){if(_0x16958e&&_0x16958e[_0x872c('0xad')]){_0x5a5906=_0x16958e;var _0x3b71e7=_[_0x872c('0xf')](_0xec875b['body'],{'firstName':_0xec875b[_0x872c('0x6e')][_0x872c('0xa6')],'phone':_0xec875b[_0x872c('0x6e')][_0x872c('0xa6')],'ListId':_0x16958e['ListId']});_0x3b71e7[_0xec875b[_0x872c('0x6e')][_0x872c('0xd0')]]=_0xec875b[_0x872c('0x6e')][_0x872c('0xa6')];return db[_0x872c('0x9f')]['findOrCreate']({'where':_0x599044,'defaults':_0x3b71e7});}})[_0x872c('0xb2')](function(_0x39a920){if(_0x39a920){_0x4a0eb1=_0x39a920;var _0x376e0e=fs[_0x872c('0xd5')](path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0xd6')),'utf8');var _0x181c99=ejs[_0x872c('0xd7')](_0x376e0e,{'body':_[_0x872c('0xd8')](_0xec875b[_0x872c('0x6e')][_0x872c('0x6e')]),'bodyTitle':_0x5a5906[_0x872c('0xd9')]});return db[_0x872c('0xda')][_0x872c('0x6d')]({'body':_0x181c99,'plainBody':htmlToText[_0x872c('0xdb')](_0x181c99),'ContactId':_0x39a920['id'],'ChatWebsiteId':_0x5a5906['id']});}})['then'](function(_0x51c7e6){_0x519f53=_0x51c7e6;if(_0x144373[_0x872c('0x5d')]){var _0x1397d7=_0x144373['map'](function(_0x20a6a0){return{'name':_0x20a6a0[_0x872c('0xdc')],'basename':_0x20a6a0[_0x872c('0x85')],'type':_0x20a6a0['mimetype'],'ChatOfflineMessageId':_0x51c7e6['id']};});_0x227098=_0x1397d7[_0x872c('0x3b')](_0x263ce1=>{var _0x56e6f0={'filename':_0x263ce1[_0x872c('0x2e')],'path':path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0xdd'),_0x872c('0xce'),_0x872c('0xde'),_0x872c('0xdf'),_0x263ce1['basename'])};return _0x56e6f0;});if(!_0x5a5906[_0x872c('0xe0')]){return db[_0x872c('0xe1')][_0x872c('0xe2')](function(_0x2133a9){return db[_0x872c('0xe3')][_0x872c('0xe4')](_0x1397d7,{'transaction':_0x2133a9});});}}})[_0x872c('0x16')](function(){if(_0x519f53){_0x24cbb6=_0x519f53;return db[_0x872c('0xd4')][_0x872c('0x7b')]({'where':{'service':!![]},'include':[{'model':db[_0x872c('0xe5')],'as':_0x872c('0xe6'),'raw':!![],'include':[{'model':db[_0x872c('0xe7')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x872c('0x16')](function(_0xf4331b){if(_0xf4331b&&_0xf4331b[_0x872c('0xe6')]&&_0x5a5906['forwardOffline']&&_0x5a5906['forwardOfflineAddress']){var _0x53436a=_0xf4331b[_0x872c('0xe8')]();return respondWithRpcPromise(_0x872c('0xe9'),_0x872c('0xea'),{'account':_0x53436a,'message':{'from':util[_0x872c('0x31')]('\x22%s\x22\x20<%s>',_0xf4331b[_0x872c('0x2e')],_0xf4331b[_0x872c('0xeb')]||_0xf4331b[_0x872c('0xe6')][_0x872c('0x6f')]),'to':_0x5a5906['forwardOfflineAddress'],'subject':_0x5a5906['offlineMessageSubject'],'html':_0x24cbb6[_0x872c('0x6e')],'attachments':_0x227098}},client9003)[_0x872c('0x16')](function(){return _0x24cbb6;})[_0x872c('0x20')](function(_0x360398){logger[_0x872c('0x1d')](_0x360398);});}})[_0x872c('0x16')](function(){if(_0x5a5906&&_0x5a5906['openNewInteraction']&&_0x5a5906[_0x872c('0xec')]){var _0x129deb=[];if(_0x144373[_0x872c('0x5d')]){_0x129deb=_0x144373['map'](function(_0x55ea70){return{'name':_0x55ea70[_0x872c('0xdc')],'basename':_0x55ea70[_0x872c('0x85')],'type':_0x55ea70[_0x872c('0xed')],'ChatOfflineMessageId':_0x519f53['id']};});}var _0x134d40;if(!_['isNil'](_0x5a5906[_0x872c('0xee')])){var _0x118b8a=_['map'](_0xec875b[_0x872c('0x6e')],function(_0x45dadc){return _0x45dadc;});var _0x5b0d06=_[_0x872c('0xef')](_0x118b8a)[0x0];var _0xa1cd9=_[_0x872c('0xf0')](_0x5b0d06,function(_0x502801){return _0x502801;});_0x134d40=_0xa1cd9[0x1][_0x5a5906[_0x872c('0xee')]];}var _0x2e77b7={'from':_0x4a0eb1['email'],'firstName':_0x4a0eb1[_0x872c('0x47')],'lastName':_0x4a0eb1[_0x872c('0x48')],'mapKey':'email','message':{'from':_0x4a0eb1[_0x872c('0xeb')],'to':_0x5a5906[_0x872c('0xd4')][_0x872c('0xeb')],'cc':'','subject':_[_0x872c('0x95')](_0x134d40)?_0x5a5906[_0x872c('0xf1')]:_0x134d40,'messageId':'','sentAt':new Date(),'attach':_0x129deb[_0x872c('0x5d')],'attachments':_0x129deb,'originChannel':_0x872c('0xf2'),'ChatWebsiteId':_0x5a5906['id'],'ChatOfflineMessageId':_0x24cbb6['id'],'originTo':_0x5a5906['MailAccount']['email']},'body':_0x24cbb6[_0x872c('0x6e')]};var _0x39d5af={'account':{'id':_0x5a5906[_0x872c('0xec')]},'body':_0x2e77b7,'log':_0x872c('0xf3')};return respondWithRpcPromise(_0x872c('0xf3'),'notifyMail',_0x39d5af,client9001)['then'](function(){return _0x24cbb6;})['catch'](function(_0x2e6e95){logger[_0x872c('0x1d')](_0x2e6e95);});}return;})[_0x872c('0x16')](function(){if(_0x24cbb6){return _0x24cbb6;}})[_0x872c('0x16')](respondWithResult(_0x305247,null))['catch'](function(){for(var _0x1b9832 of _0x144373){var _0x1c9151=path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0xdd'),_0x872c('0xce'),'attachments','offline-chat',_0x1b9832['filename']);fs_extra['remove'](_0x1c9151)['catch'](function(_0x3348f5){logger[_0x872c('0x1d')](_0x872c('0xf4'),_0x1c9151,_0x3348f5);});}});};exports[_0x872c('0xf5')]=function(_0xf4f5ad,_0xcd2bca){return db['ChatInteraction']['find']({'where':{'id':_0xf4f5ad[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0xcd2bca,null))['then'](function(_0x7c9f59){if(_0x7c9f59){return _0x7c9f59[_0x872c('0xf5')](_0xf4f5ad[_0x872c('0x6e')][_0x872c('0x7e')],_[_0x872c('0xf6')](_0xf4f5ad[_0x872c('0x6e')],['ids','id'])||{});}})[_0x872c('0x16')](respondWithResult(_0xcd2bca,null))[_0x872c('0x20')](handleError(_0xcd2bca,null));};exports['getInteractions']=function(_0x1cf9bd,_0x1ff4d8){var _0x8b4fa1={'raw':![],'where':{}};var _0x271c89={};var _0x348740={'count':0x0,'rows':[]};return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x1cf9bd[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x1ff4d8,null))[_0x872c('0x16')](function(_0x488169){if(_0x488169){_0x271c89[_0x872c('0x50')]=_[_0x872c('0x6a')](db[_0x872c('0xb8')][_0x872c('0x56')]);_0x271c89['query']=_[_0x872c('0x6a')](_0x1cf9bd[_0x872c('0x58')]);_0x271c89[_0x872c('0x59')]=_[_0x872c('0x5b')](_0x271c89[_0x872c('0x50')],_0x271c89['query']);_0x8b4fa1[_0x872c('0x5a')]=_['intersection'](_0x271c89[_0x872c('0x50')],qs[_0x872c('0x5c')](_0x1cf9bd['query']['fields']));_0x8b4fa1['attributes']=_0x8b4fa1[_0x872c('0x5a')][_0x872c('0x5d')]?_0x8b4fa1[_0x872c('0x5a')]:_0x271c89[_0x872c('0x50')];if(!_0x1cf9bd[_0x872c('0x58')]['hasOwnProperty']('nolimit')){_0x8b4fa1[_0x872c('0x25')]=qs[_0x872c('0x25')](_0x1cf9bd[_0x872c('0x58')][_0x872c('0x25')]);_0x8b4fa1['offset']=qs[_0x872c('0x23')](_0x1cf9bd[_0x872c('0x58')]['offset']);}_0x8b4fa1[_0x872c('0x82')]=qs[_0x872c('0x60')](_0x1cf9bd[_0x872c('0x58')][_0x872c('0x60')]);_0x8b4fa1[_0x872c('0x62')]=qs[_0x872c('0x59')](_[_0x872c('0x7c')](_0x1cf9bd[_0x872c('0x58')],_0x271c89[_0x872c('0x59')]));_0x8b4fa1[_0x872c('0x62')]['ChatWebsiteId']=_0x488169['id'];if(_0x1cf9bd[_0x872c('0x58')]['filter']){_0x8b4fa1[_0x872c('0x62')]=_['merge'](_0x8b4fa1[_0x872c('0x62')],{'$or':_['map'](_0x8b4fa1[_0x872c('0x5a')],function(_0x49f8ea){var _0x31138a={};_0x31138a[_0x49f8ea]={'$like':'%'+_0x1cf9bd[_0x872c('0x58')][_0x872c('0x61')]+'%'};return _0x31138a;})});}_0x8b4fa1=_[_0x872c('0x6b')]({},_0x8b4fa1,_0x1cf9bd['options']);return db[_0x872c('0xb8')]['count']({'where':_0x8b4fa1[_0x872c('0x62')]})[_0x872c('0x16')](function(_0x3c0d91){_0x348740['count']=_0x3c0d91;if(_0x1cf9bd['query'][_0x872c('0x65')]){_0x8b4fa1[_0x872c('0x66')]=[{'model':db[_0x872c('0x9f')],'as':_0x872c('0xf7'),'required':![]},{'model':db[_0x872c('0xf8')],'as':_0x872c('0xf9'),'attributes':[_0x872c('0x2e'),_0x872c('0xfa'),'internal'],'required':![]},{'model':db[_0x872c('0xfb')],'as':'Tags','attributes':['id',_0x872c('0x2e'),_0x872c('0xfc')],'where':_0x1cf9bd[_0x872c('0x58')][_0x872c('0xfd')]?{'id':_0x1cf9bd[_0x872c('0x58')]['tag']}:undefined,'required':_0x1cf9bd[_0x872c('0x58')]['tag']?!![]:![]}];}return db[_0x872c('0xb8')][_0x872c('0x67')](_0x8b4fa1);})[_0x872c('0x16')](function(_0x15f4b7){_0x348740[_0x872c('0x68')]=_0x15f4b7;return _0x348740;});}})[_0x872c('0x16')](respondWithFilteredResult(_0x1ff4d8,_0x8b4fa1))[_0x872c('0x20')](handleError(_0x1ff4d8,null));};exports[_0x872c('0xfe')]=function(_0x33ad57,_0x2a2fac){var _0x1e7cb6=0x0;var _0x1454a8=0x0;var _0x509c3b=![];var _0x123d10;var _0x4ff137;return db[_0x872c('0x64')]['find']({'where':{'id':_0x33ad57[_0x872c('0x76')]['id']},'include':[{'model':db[_0x872c('0x3c')],'as':_0x872c('0x3c'),'include':[{'model':db[_0x872c('0x3c')],'as':_0x872c('0x3d'),'attributes':['id',_0x872c('0x37')]}]}]})[_0x872c('0x16')](handleEntityNotFound(_0x2a2fac,null))[_0x872c('0x16')](function(_0x1c7195){if(_0x1c7195){_0x123d10=_0x1c7195;return _0x1c7195['getProactiveActions']({'raw':!![]});}})['then'](function(_0x59c0d4){if(_0x123d10){if(_0x59c0d4){_0x4ff137=_0x59c0d4;}}return require(_0x872c('0xff'))['getLicense']();})['then'](function(_0x301eb1){if(_0x301eb1){_0x1454a8=_0x301eb1['virtual'];_0x509c3b=_0x301eb1['custom'];}})['then'](function(){return db[_0x872c('0xb8')][_0x872c('0x26')]({'where':{'closed':![]}});})[_0x872c('0x16')](function(_0x575cfe){_0x1e7cb6=_0x575cfe;if(_0x1454a8&&_0x575cfe>_0x1454a8){return db[_0x872c('0x100')][_0x872c('0x7b')]({'where':{'id':0x1}})[_0x872c('0x16')](function(_0x1f11bc){if(_0x1f11bc){_0x1f11bc['increment']('chatLicenseExceeded');}});}})[_0x872c('0x16')](function(){if(!_0x123d10[_0x872c('0x3c')]||!_0x123d10[_0x872c('0x3c')][_0x872c('0x3d')])return!![];return checkWebsiteIntervals(_0x123d10);})[_0x872c('0x16')](function(_0x1276bf){var _0x2cd27b=fs[_0x872c('0xd5')](path[_0x872c('0x91')](config['root'],_0x872c('0x101')),_0x872c('0x102'));var _0x4182ff=new url[(_0x872c('0x103'))](_0x123d10[_0x872c('0x104')])[_0x872c('0x105')];var _0x334bd3=_0x872c('0x106');var _0x12ea20=![];var _0x24a032={'chatVersion':_0x334bd3,'chatWebsiteAddressOrigin':_0x4182ff,'remote':_0x123d10[_0x872c('0x107')],'query':querystring[_0x872c('0x1c')](_[_0x872c('0x6b')](_0x123d10[_0x872c('0x2a')]({'plain':!![]}),{'customerIp':_0x33ad57[_0x872c('0xb6')][_0x872c('0x44')]||_0x33ad57[_0x872c('0xb6')][_0x872c('0x108')]||_0x33ad57[_0x872c('0x109')]['remoteAddress']||_0x33ad57['ip'],'referer':_0x33ad57[_0x872c('0xb6')][_0x872c('0x4a')],'openedInteractions':_0x1e7cb6,'maxInteractions':_0x1454a8,'virtual':_0x509c3b[_0x872c('0x10a')],'online':_0x1276bf,'custom':_0x509c3b}))['replace'](/'/g,'\x5c\x27')};_0x2a2fac[_0x872c('0x2f')](ejs[_0x872c('0xd7')](Mustache[_0x872c('0xd7')](_0x2cd27b,_0x24a032),{'proactiveActions':_0x4ff137,'alignment':_0x123d10[_0x872c('0x10b')],'verticalAlignment':_0x123d10[_0x872c('0x10c')],'div_color':_0x123d10[_0x872c('0xfc')],'labelText':_0x123d10[_0x872c('0x10d')],'text_color':_0x123d10[_0x872c('0x10e')],'text_button_color':_0x123d10[_0x872c('0x10f')],'button_color':_0x123d10[_0x872c('0x110')],'background_color':_0x123d10['backgroundColor'],'hideWhenOffline':_0x123d10[_0x872c('0x111')],'intervalId':_0x123d10[_0x872c('0x112')],'isDevelopment':_0x12ea20,'chatVersion':_0x334bd3}));})[_0x872c('0x20')](handleError(_0x2a2fac,null));};exports[_0x872c('0x113')]=function(_0x136729,_0x148551){var _0x1645e4=_0x136729[_0x872c('0x76')]['id'];var _0x4d3d6d=_0x136729[_0x872c('0x6e')];var _0xb3bf6c=0xc8;var _0x5ccb5d=null;return db[_0x872c('0xe1')][_0x872c('0xe2')]({'isolationLevel':db['sequelize'][_0x872c('0x114')][_0x872c('0x115')][_0x872c('0x116')]},function(_0x4439be){return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x1645e4},'transaction':_0x4439be})['then'](function(_0x19e050){if(_0x19e050){return db[_0x872c('0xb0')][_0x872c('0x29')]({'where':{'ChatWebsiteId':_0x1645e4},'transaction':_0x4439be})[_0x872c('0x16')](function(){var _0x6aaec6=_[_0x872c('0x3b')](_0x4d3d6d,function(_0x5e7186){_0x5e7186[_0x872c('0x78')]=_0x1645e4;return _0x5e7186;});return db[_0x872c('0xb0')][_0x872c('0xe4')](_0x6aaec6,{'transaction':_0x4439be});});}else{_0xb3bf6c=0x194;_0x5ccb5d=[];}});})['then'](function(){if(_0xb3bf6c!==0x194){return db[_0x872c('0xb0')][_0x872c('0x117')]({'where':{'ChatWebsiteId':_0x1645e4},'order':_0x872c('0xb3')})[_0x872c('0x16')](function(_0x2d0a1c){_0x5ccb5d=_0x2d0a1c;});}})['catch'](function(_0x20e6db){_0xb3bf6c=0x1f4;logger[_0x872c('0x1d')](_0x20e6db['stack']);if(_0x20e6db['name']){delete _0x20e6db[_0x872c('0x2e')];}_0x5ccb5d=_0x20e6db;})[_0x872c('0x118')](function(){if(_0x5ccb5d===null){_0x148551[_0x872c('0x2d')](_0xb3bf6c);}else{if(_0xb3bf6c===0x1f4){_0x148551[_0x872c('0x21')](_0xb3bf6c)[_0x872c('0x2f')](_0x5ccb5d);}else{_0x148551[_0x872c('0x21')](_0xb3bf6c)[_0x872c('0x22')](_0x5ccb5d);}}});};exports[_0x872c('0x119')]=function(_0x20f6c1,_0x118ff9){var _0x178ee7={};var _0x8dac6b={};var _0x26a035;var _0x56ab33;return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x20f6c1[_0x872c('0x76')]['id']}})['then'](handleEntityNotFound(_0x118ff9,null))['then'](function(_0x505f63){if(_0x505f63){_0x26a035=_0x505f63;_0x8dac6b[_0x872c('0x50')]=_[_0x872c('0x6a')](db[_0x872c('0xb0')][_0x872c('0x56')]);_0x8dac6b['query']=_[_0x872c('0x6a')](_0x20f6c1[_0x872c('0x58')]);_0x8dac6b[_0x872c('0x59')]=_['intersection'](_0x8dac6b[_0x872c('0x50')],_0x8dac6b[_0x872c('0x58')]);_0x178ee7[_0x872c('0x5a')]=_['intersection'](_0x8dac6b[_0x872c('0x50')],qs['fields'](_0x20f6c1[_0x872c('0x58')][_0x872c('0x5c')]));_0x178ee7['attributes']=_0x178ee7[_0x872c('0x5a')][_0x872c('0x5d')]?_0x178ee7[_0x872c('0x5a')]:_0x8dac6b[_0x872c('0x50')];_0x178ee7[_0x872c('0x82')]=qs[_0x872c('0x60')](_0x20f6c1[_0x872c('0x58')][_0x872c('0x60')]);_0x178ee7[_0x872c('0x62')]=qs['filters'](_['pick'](_0x20f6c1[_0x872c('0x58')],_0x8dac6b[_0x872c('0x59')]));if(_0x20f6c1[_0x872c('0x58')]['filter']){_0x178ee7[_0x872c('0x62')]=_[_0x872c('0x6b')](_0x178ee7['where'],{'$or':_[_0x872c('0x3b')](_0x178ee7[_0x872c('0x5a')],function(_0x653260){var _0x944729={};_0x944729[_0x653260]={'$like':'%'+_0x20f6c1[_0x872c('0x58')]['filter']+'%'};return _0x944729;})});}_0x178ee7=_[_0x872c('0x6b')]({},_0x178ee7,_0x20f6c1['options']);return _0x26a035[_0x872c('0x119')](_0x178ee7);}})[_0x872c('0x16')](function(_0x3b475b){if(_0x3b475b){_0x56ab33=_0x3b475b[_0x872c('0x5d')];if(!_0x20f6c1[_0x872c('0x58')][_0x872c('0x5e')](_0x872c('0x5f'))){_0x178ee7['limit']=qs[_0x872c('0x25')](_0x20f6c1[_0x872c('0x58')][_0x872c('0x25')]);_0x178ee7[_0x872c('0x23')]=qs['offset'](_0x20f6c1[_0x872c('0x58')][_0x872c('0x23')]);}return _0x26a035[_0x872c('0x119')](_0x178ee7);}})['then'](function(_0x2615af){if(_0x2615af){return _0x2615af?{'count':_0x56ab33,'rows':_0x2615af}:null;}})[_0x872c('0x16')](respondWithResult(_0x118ff9,null))['catch'](handleError(_0x118ff9,null));};exports[_0x872c('0x11a')]=function(_0x5b4604,_0x54c7a1){return db['chatProactiveAction'][_0x872c('0x73')]({'where':{'id':_0x5b4604[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x54c7a1,null))[_0x872c('0x16')](function(_0x404c13){if(_0x404c13){return _0x404c13['addProactiveActions'](_0x5b4604[_0x872c('0x6e')]['ids'],_[_0x872c('0xf6')](_0x5b4604['body'],[_0x872c('0x7e'),'id'])||{});}})[_0x872c('0x16')](respondWithResult(_0x54c7a1,null))[_0x872c('0x20')](handleError(_0x54c7a1,null));};exports[_0x872c('0x11b')]=function(_0x2b71fa,_0x269b3c){var _0xb06672={};var _0x255886={};var _0x5cefce;var _0x5d21dd;return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x2b71fa['params']['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x269b3c,null))[_0x872c('0x16')](function(_0x4bdd93){if(_0x4bdd93){_0x5cefce=_0x4bdd93;_0x255886[_0x872c('0x50')]=_[_0x872c('0x6a')](db[_0x872c('0x11c')]['rawAttributes']);_0x255886[_0x872c('0x58')]=_[_0x872c('0x6a')](_0x2b71fa[_0x872c('0x58')]);_0x255886[_0x872c('0x59')]=_[_0x872c('0x5b')](_0x255886['model'],_0x255886[_0x872c('0x58')]);_0xb06672['attributes']=_[_0x872c('0x5b')](_0x255886[_0x872c('0x50')],qs[_0x872c('0x5c')](_0x2b71fa[_0x872c('0x58')][_0x872c('0x5c')]));_0xb06672['attributes']=_0xb06672[_0x872c('0x5a')][_0x872c('0x5d')]?_0xb06672[_0x872c('0x5a')]:_0x255886[_0x872c('0x50')];_0xb06672['order']=qs[_0x872c('0x60')](_0x2b71fa[_0x872c('0x58')][_0x872c('0x60')]);_0xb06672[_0x872c('0x62')]=qs[_0x872c('0x59')](_[_0x872c('0x7c')](_0x2b71fa['query'],_0x255886[_0x872c('0x59')]));if(_0x2b71fa[_0x872c('0x58')]['filter']){_0xb06672['where']=_['merge'](_0xb06672[_0x872c('0x62')],{'$or':_['map'](_0xb06672['attributes'],function(_0x25f2fc){var _0x3163b5={};_0x3163b5[_0x25f2fc]={'$like':'%'+_0x2b71fa['query'][_0x872c('0x61')]+'%'};return _0x3163b5;})});}_0xb06672=_['merge']({},_0xb06672,_0x2b71fa[_0x872c('0x6c')]);return _0x5cefce[_0x872c('0x11b')](_0xb06672);}})['then'](function(_0x212a38){if(_0x212a38){_0x5d21dd=_0x212a38['length'];if(!_0x2b71fa[_0x872c('0x58')][_0x872c('0x5e')]('nolimit')){_0xb06672[_0x872c('0x25')]=qs[_0x872c('0x25')](_0x2b71fa[_0x872c('0x58')][_0x872c('0x25')]);_0xb06672[_0x872c('0x23')]=qs[_0x872c('0x23')](_0x2b71fa[_0x872c('0x58')]['offset']);}return _0x5cefce['getProactiveActions'](_0xb06672);}})['then'](function(_0x395211){if(_0x395211){return _0x395211?{'count':_0x5d21dd,'rows':_0x395211}:null;}})['then'](respondWithResult(_0x269b3c,null))[_0x872c('0x20')](handleError(_0x269b3c,null));};exports[_0x872c('0x11d')]=function(_0x3f3a49,_0x129037){var _0x4e6d0e=_0x3f3a49[_0x872c('0x58')][_0x872c('0x11e')]===_0x872c('0x11f')?_0x872c('0x120'):_0x872c('0x121');return db[_0x872c('0x64')][_0x872c('0x73')]({'attributes':['id',_0x4e6d0e],'where':{'id':_0x3f3a49[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x129037,null))[_0x872c('0x16')](function(_0xa6333a){if(_0xa6333a){var _0x1ec9ac=_0xa6333a[_0x4e6d0e];var _0x1eae07=_0x1ec9ac&&_0x1ec9ac['items']?_0x1ec9ac[_0x872c('0x122')]:[];_0x129037[_0x872c('0x2f')]({'fromKey':_[_0x872c('0x95')](_0x1ec9ac[_0x872c('0x123')])?undefined:_0x1ec9ac['fromKey'],'count':_0x1eae07[_0x872c('0x5d')],'rows':_0x1eae07});}})['catch'](handleError(_0x129037,null));};exports[_0x872c('0x124')]=function(_0x2328a4,_0x5135d8){var _0x1c8e31={'raw':![],'where':{}};var _0x3a7d2e={};var _0x67a052={'count':0x0,'rows':[]};return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x2328a4[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x5135d8,null))[_0x872c('0x16')](function(_0x5aae44){if(_0x5aae44){_0x3a7d2e[_0x872c('0x50')]=_[_0x872c('0x6a')](db['ChatOfflineMessage']['rawAttributes']);_0x3a7d2e[_0x872c('0x58')]=_['keys'](_0x2328a4[_0x872c('0x58')]);_0x3a7d2e[_0x872c('0x59')]=_[_0x872c('0x5b')](_0x3a7d2e[_0x872c('0x50')],_0x3a7d2e[_0x872c('0x58')]);_0x1c8e31[_0x872c('0x5a')]=_['intersection'](_0x3a7d2e['model'],qs['fields'](_0x2328a4[_0x872c('0x58')][_0x872c('0x5c')]));_0x1c8e31['attributes']=_0x1c8e31[_0x872c('0x5a')]['length']?_0x1c8e31[_0x872c('0x5a')]:_0x3a7d2e[_0x872c('0x50')];if(!_0x2328a4['query']['hasOwnProperty'](_0x872c('0x5f'))){_0x1c8e31[_0x872c('0x25')]=qs[_0x872c('0x25')](_0x2328a4[_0x872c('0x58')][_0x872c('0x25')]);_0x1c8e31[_0x872c('0x23')]=qs[_0x872c('0x23')](_0x2328a4[_0x872c('0x58')][_0x872c('0x23')]);}_0x1c8e31[_0x872c('0x82')]=qs[_0x872c('0x60')](_0x2328a4[_0x872c('0x58')][_0x872c('0x60')]);_0x1c8e31[_0x872c('0x62')]=qs['filters'](_['pick'](_0x2328a4['query'],_0x3a7d2e[_0x872c('0x59')]));_0x1c8e31[_0x872c('0x62')][_0x872c('0x78')]=_0x5aae44['id'];if(_0x2328a4['query'][_0x872c('0x61')]){_0x1c8e31[_0x872c('0x62')]=_[_0x872c('0x6b')](_0x1c8e31[_0x872c('0x62')],{'$or':_[_0x872c('0x3b')](_0x1c8e31[_0x872c('0x5a')],function(_0x2c2053){var _0xf24e18={};_0xf24e18[_0x2c2053]={'$like':'%'+_0x2328a4[_0x872c('0x58')][_0x872c('0x61')]+'%'};return _0xf24e18;})});}_0x1c8e31=_[_0x872c('0x6b')]({},_0x1c8e31,_0x2328a4[_0x872c('0x6c')]);return db[_0x872c('0xda')][_0x872c('0x26')]({'where':_0x1c8e31[_0x872c('0x62')]})['then'](function(_0x3f7c67){_0x67a052[_0x872c('0x26')]=_0x3f7c67;if(_0x2328a4['query'][_0x872c('0x65')]){_0x1c8e31[_0x872c('0x66')]=[{'all':!![]}];}else{_0x1c8e31[_0x872c('0x66')]=[{'model':db[_0x872c('0x9f')],'as':_0x872c('0xf7'),'required':![]},{'model':db[_0x872c('0xe3')],'as':_0x872c('0x125'),'required':![]}];}return db[_0x872c('0xda')][_0x872c('0x67')](_0x1c8e31);})['then'](function(_0x2ec01c){_0x67a052[_0x872c('0x68')]=_0x2ec01c;return _0x67a052;});}})['then'](respondWithFilteredResult(_0x5135d8,_0x1c8e31))['catch'](handleError(_0x5135d8,null));};exports[_0x872c('0x126')]=function(_0x1f88d8,_0x19ce18){return db['ChatWebsite'][_0x872c('0x73')]({'where':{'id':_0x1f88d8[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x19ce18,null))[_0x872c('0x16')](function(_0x46c2bb){if(_0x46c2bb){return _0x46c2bb[_0x872c('0x126')](_0x1f88d8[_0x872c('0x6e')][_0x872c('0x7e')],_[_0x872c('0xf6')](_0x1f88d8[_0x872c('0x6e')],[_0x872c('0x7e'),'id'])||{})[_0x872c('0xb2')](function(_0x4e43b3){for(var _0x2bba36=0x0;_0x2bba36<_0x1f88d8[_0x872c('0x6e')]['ids'][_0x872c('0x5d')];_0x2bba36+=0x1){socket[_0x872c('0x127')]('userChatWebsite:save',{'UserId':Number(_0x1f88d8[_0x872c('0x6e')][_0x872c('0x7e')][_0x2bba36]),'ChatWebsiteId':Number(_0x1f88d8[_0x872c('0x76')]['id'])});}return _0x4e43b3;});}})[_0x872c('0x16')](respondWithResult(_0x19ce18,null))[_0x872c('0x20')](handleError(_0x19ce18,null));};exports[_0x872c('0x128')]=function(_0x2b8fa9,_0x36b00b){return db['ChatWebsite'][_0x872c('0x73')]({'where':{'id':_0x2b8fa9['params']['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x36b00b,null))[_0x872c('0x16')](function(_0x5ccd77){if(_0x5ccd77){return _0x5ccd77[_0x872c('0x128')](_0x2b8fa9['query'][_0x872c('0x7e')])['then'](function(){if(_[_0x872c('0x129')](_0x2b8fa9['query']['ids'])){for(var _0x2ad92c=0x0;_0x2ad92c<_0x2b8fa9[_0x872c('0x58')][_0x872c('0x7e')][_0x872c('0x5d')];_0x2ad92c+=0x1){socket[_0x872c('0x127')]('userChatWebsite:remove',{'UserId':Number(_0x2b8fa9[_0x872c('0x58')][_0x872c('0x7e')][_0x2ad92c]),'ChatWebsiteId':Number(_0x2b8fa9[_0x872c('0x76')]['id'])});}}else{socket[_0x872c('0x127')](_0x872c('0x12a'),{'UserId':Number(_0x2b8fa9[_0x872c('0x58')][_0x872c('0x7e')]),'ChatWebsiteId':Number(_0x2b8fa9['params']['id'])});}});}})[_0x872c('0x16')](respondWithStatusCode(_0x36b00b,null))[_0x872c('0x20')](handleError(_0x36b00b,null));};exports[_0x872c('0x12b')]=function(_0x491f86,_0x369225){var _0x4ffc14={};var _0x43ef84={};var _0x3d5689;var _0x6c55eb;return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x491f86['params']['id']}})['then'](handleEntityNotFound(_0x369225,null))['then'](function(_0x2fd5e8){if(_0x2fd5e8){_0x3d5689=_0x2fd5e8;_0x43ef84[_0x872c('0x50')]=_[_0x872c('0x6a')](db[_0x872c('0xf8')][_0x872c('0x56')]);_0x43ef84[_0x872c('0x58')]=_[_0x872c('0x6a')](_0x491f86[_0x872c('0x58')]);_0x43ef84[_0x872c('0x59')]=_[_0x872c('0x5b')](_0x43ef84[_0x872c('0x50')],_0x43ef84[_0x872c('0x58')]);_0x4ffc14['attributes']=_['intersection'](_0x43ef84['model'],qs['fields'](_0x491f86[_0x872c('0x58')][_0x872c('0x5c')]));_0x4ffc14[_0x872c('0x5a')]=_0x4ffc14[_0x872c('0x5a')][_0x872c('0x5d')]?_0x4ffc14[_0x872c('0x5a')]:_0x43ef84[_0x872c('0x50')];_0x4ffc14['order']=qs['sort'](_0x491f86[_0x872c('0x58')][_0x872c('0x60')]);_0x4ffc14[_0x872c('0x62')]=qs[_0x872c('0x59')](_[_0x872c('0x7c')](_0x491f86[_0x872c('0x58')],_0x43ef84[_0x872c('0x59')]));if(_0x491f86['query']['filter']){_0x4ffc14['where']=_[_0x872c('0x6b')](_0x4ffc14['where'],{'$or':_[_0x872c('0x3b')](_0x4ffc14[_0x872c('0x5a')],function(_0x21b156){var _0x560d62={};_0x560d62[_0x21b156]={'$like':'%'+_0x491f86['query'][_0x872c('0x61')]+'%'};return _0x560d62;})});}_0x4ffc14=_[_0x872c('0x6b')]({},_0x4ffc14,_0x491f86['options']);return _0x3d5689[_0x872c('0x12b')](_0x4ffc14);}})['then'](function(_0x352b0b){if(_0x352b0b){_0x6c55eb=_0x352b0b['length'];if(!_0x491f86[_0x872c('0x58')][_0x872c('0x5e')](_0x872c('0x5f'))){_0x4ffc14[_0x872c('0x25')]=qs[_0x872c('0x25')](_0x491f86[_0x872c('0x58')][_0x872c('0x25')]);_0x4ffc14['offset']=qs[_0x872c('0x23')](_0x491f86['query']['offset']);}return _0x3d5689['getAgents'](_0x4ffc14);}})['then'](function(_0x3f0134){if(_0x3f0134){return _0x3f0134?{'count':_0x6c55eb,'rows':_0x3f0134}:null;}})[_0x872c('0x16')](respondWithResult(_0x369225,null))[_0x872c('0x20')](handleError(_0x369225,null));};
\ No newline at end of file
+var _0x81dc=['order','removeAnswers','addLogo','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','sitepic','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','createdAt','updatedAt','includes','CompanyId','ListId','CmList','Contacts','ChatApplication','Applications','Interval','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','timezone','List','list','applications','orderBy','priority','asc','account','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','firstName','messageId','created','autoclose','push','close','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','ChatQueue','queueId','queue','*,*,*,*','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','difference','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','user','forwardOfflineAddress','MailAccountId','toPairsIn','mapValues','subjectOffline','offlineMessageSubject','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','internal','Tag','Tags','color','tag','getSnippet','getProactiveActions','License','findOne','increment','chatLicenseExceeded','ifTime','readFileSync','URL','address','origin','3.8.0','remote','x-real-ip','connection','remoteAddress','virtual','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','ejs','fs-extra','lodash','querystring','html-to-text','jayson/promise','url','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','destroy','get','ChatWebsites','stack','send','user-agent-parser','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','lastName','x-real-port','referer','browser','version','name','unknown','%s\x20%s','model','format','%s\x20%s\x20%s','device','vendor','type','mandatoryDispositionPause','map','fieldName','key','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','Pause','ChatWebsite','rawAttributes','length','create','body','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','removeDispositions','ids','CannedAnswer'];(function(_0x33e4a1,_0x135a24){var _0x4b06c4=function(_0xb3fc66){while(--_0xb3fc66){_0x33e4a1['push'](_0x33e4a1['shift']());}};_0x4b06c4(++_0x135a24);}(_0x81dc,0xbe));var _0xc81d=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x81dc[_0x59162a];return _0x35e50d;};'use strict';var Mustache=require(_0xc81d('0x0'));var util=require(_0xc81d('0x1'));var path=require('path');var ejs=require(_0xc81d('0x2'));var fs=require('fs');var fs_extra=require(_0xc81d('0x3'));var _=require(_0xc81d('0x4'));var querystring=require(_0xc81d('0x5'));var htmlToText=require(_0xc81d('0x6'));var Redis=require('ioredis');var jayson=require(_0xc81d('0x7'));var url=require(_0xc81d('0x8'));var qs=require(_0xc81d('0x9'));var logger=require(_0xc81d('0xa'))(_0xc81d('0xb'));var config=require(_0xc81d('0xc'));var APIBadRequestError=require('../../errors/api')['APIBadRequestError'];var APINotFoundError=require(_0xc81d('0xd'))[_0xc81d('0xe')];var APIOutOfIntervalError=require('../../errors/api')[_0xc81d('0xf')];var APIHandleError=require(_0xc81d('0xd'))[_0xc81d('0x10')];var db=require('../../mysqldb')['db'];config['redis']=_[_0xc81d('0x11')](config[_0xc81d('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0xc81d('0x13'))(new Redis(config['redis']));require(_0xc81d('0x14'))[_0xc81d('0x15')](socket);var client=jayson[_0xc81d('0x16')][_0xc81d('0x17')]({'port':0x232c});var client9002=jayson[_0xc81d('0x16')][_0xc81d('0x17')]({'port':0x232a});var client9003=jayson[_0xc81d('0x16')][_0xc81d('0x17')]({'port':0x232b});var client9001=jayson[_0xc81d('0x16')][_0xc81d('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x3b934a,_0x4e9706,_0x186254,_0x2d4646){return new Promise(function(_0x1fdcd2,_0x21e267){var _0x5e7830=_0x2d4646||client;return _0x5e7830['request'](_0x3b934a,_0x186254)[_0xc81d('0x18')](function(_0x395c2a){logger[_0xc81d('0x19')](_0xc81d('0x1a'),_0x4e9706,_0xc81d('0x1b'));logger[_0xc81d('0x1c')](_0xc81d('0x1d'),_0x4e9706,_0xc81d('0x1b'),JSON[_0xc81d('0x1e')](_0x395c2a));if(_0x395c2a['error']){if(_0x395c2a['error'][_0xc81d('0x1f')]===0x1f4){logger[_0xc81d('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x4e9706,_0x395c2a[_0xc81d('0x20')]['message']);return _0x21e267(_0x395c2a['error']['message']);}logger['error'](_0xc81d('0x1a'),_0x4e9706,_0x395c2a[_0xc81d('0x20')][_0xc81d('0x21')]);return _0x1fdcd2(_0x395c2a['error'][_0xc81d('0x21')]);}else{logger[_0xc81d('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x4e9706,_0xc81d('0x1b'));_0x1fdcd2(_0x395c2a['result']['message']);}})[_0xc81d('0x22')](function(_0x513f0d){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4e9706,_0x513f0d);_0x21e267(_0x513f0d);});});}function respondWithStatusCode(_0x325241,_0x3f2d2e){_0x3f2d2e=_0x3f2d2e||0xcc;return function(_0x4f9158){if(_0x4f9158){return _0x325241[_0xc81d('0x23')](_0x3f2d2e);}return _0x325241[_0xc81d('0x24')](_0x3f2d2e)[_0xc81d('0x25')]();};}function respondWithResult(_0x3f83ea,_0x4a45e7){_0x4a45e7=_0x4a45e7||0xc8;return function(_0x2c6afc){if(_0x2c6afc){return _0x3f83ea[_0xc81d('0x24')](_0x4a45e7)[_0xc81d('0x26')](_0x2c6afc);}};}function respondWithFilteredResult(_0x5ad00b,_0x365eeb){return function(_0x4399a0){if(_0x4399a0){var _0x10d21e=typeof _0x365eeb[_0xc81d('0x27')]===_0xc81d('0x28')&&typeof _0x365eeb[_0xc81d('0x29')]===_0xc81d('0x28');var _0x5404f6=_0x4399a0[_0xc81d('0x2a')];var _0x567819=_0x10d21e?0x0:_0x365eeb['offset'];var _0x47a794=_0x10d21e?_0x4399a0[_0xc81d('0x2a')]:_0x365eeb[_0xc81d('0x27')]+_0x365eeb[_0xc81d('0x29')];var _0x2d42c4;if(_0x47a794>=_0x5404f6){_0x47a794=_0x5404f6;_0x2d42c4=0xc8;}else{_0x2d42c4=0xce;}_0x5ad00b[_0xc81d('0x24')](_0x2d42c4);return _0x5ad00b['set'](_0xc81d('0x2b'),_0x567819+'-'+_0x47a794+'/'+_0x5404f6)[_0xc81d('0x26')](_0x4399a0);}return null;};}function saveUpdates(_0x491892){return function(_0x4c18c6){if(_0x4c18c6){return _0x4c18c6[_0xc81d('0x2c')](_0x491892)[_0xc81d('0x18')](function(_0x1fd674){return _0x1fd674;});}return null;};}function removeEntity(_0x38d2e6){return function(_0x5aab3b){if(_0x5aab3b){return _0x5aab3b[_0xc81d('0x2d')]()[_0xc81d('0x18')](function(){var _0x13f12a=_0x5aab3b[_0xc81d('0x2e')]({'plain':!![]});var _0x55a70=_0xc81d('0x2f');return db['UserProfileResource'][_0xc81d('0x2d')]({'where':{'type':_0x55a70,'resourceId':_0x13f12a['id']}})[_0xc81d('0x18')](function(){return _0x5aab3b;});})['then'](function(){_0x38d2e6[_0xc81d('0x24')](0xcc)[_0xc81d('0x25')]();});}};}function handleEntityNotFound(_0x563dbe){return function(_0x52af82){if(!_0x52af82){_0x563dbe['sendStatus'](0x194);}return _0x52af82;};}function handleError(_0x48478e,_0xd28508){_0xd28508=_0xd28508||0x1f4;return function(_0x3445a3){logger['error'](_0x3445a3[_0xc81d('0x30')]);if(_0x3445a3['name']){delete _0x3445a3['name'];}_0x48478e[_0xc81d('0x24')](_0xd28508)[_0xc81d('0x31')](_0x3445a3);};}function createInteractionObject(_0x5d8ec0,_0x4da75b,_0x21d400,_0x2c63be){var _0xbbb2f3=require(_0xc81d('0x32'));var _0x87358=new _0xbbb2f3();var _0x4b6d92=_0x87358[_0xc81d('0x33')](_0x21d400[_0xc81d('0x34')])[_0xc81d('0x35')]();var _0x19592c=_0x4da75b[_0xc81d('0x36')];if(_0x21d400[_0xc81d('0x37')]){_0x19592c=_0x21d400[_0xc81d('0x37')];}else if(_0x21d400[_0xc81d('0x38')]){_0x19592c=_['first'](_0x21d400[_0xc81d('0x38')]['split'](','));}return{'ContactId':_0x2c63be['id'],'ChatWebsiteId':_0x5d8ec0,'from':(_0x2c63be['firstName']||'')+'\x20'+(_0x2c63be[_0xc81d('0x39')]||''),'customerIp':_0x19592c,'customerPort':_0x21d400[_0xc81d('0x3a')]?_0x21d400['x-real-port']:null,'referer':_0x4da75b[_0xc81d('0x3b')],'browserName':_0x4b6d92[_0xc81d('0x3c')]['name']&&_0x4b6d92[_0xc81d('0x3c')][_0xc81d('0x3d')]?util['format']('%s\x20%s',_0x4b6d92[_0xc81d('0x3c')][_0xc81d('0x3e')],_0x4b6d92['browser'][_0xc81d('0x3d')]):_0xc81d('0x3f'),'browserVersion':_0x4b6d92[_0xc81d('0x3c')][_0xc81d('0x3d')]||'unknown','osName':util['format'](_0xc81d('0x40'),_0x4b6d92['os']['name'],_0x4b6d92['os'][_0xc81d('0x3d')]),'osVersion':_0x4b6d92['os'][_0xc81d('0x3d')],'deviceModel':_0x4b6d92['device'][_0xc81d('0x41')]&&_0x4b6d92['device']['vendor']?util[_0xc81d('0x42')](_0xc81d('0x43'),_0x4b6d92[_0xc81d('0x44')][_0xc81d('0x41')],_0x4b6d92['device'][_0xc81d('0x45')],_0x4b6d92['device'][_0xc81d('0x46')]):null,'deviceVendor':_0x4b6d92['device'][_0xc81d('0x45')],'deviceType':_0x4b6d92[_0xc81d('0x44')][_0xc81d('0x46')],'formData':JSON['stringify'](_0x4da75b)};}exports['index']=function(_0x20d5ab,_0x831218){var _0x4f9df2={'include':[{'model':db['Pause'],'as':_0xc81d('0x47')}]},_0x554255={},_0xf9cda8={'count':0x0,'rows':[]};var _0x2890f2=_[_0xc81d('0x48')](db['ChatWebsite']['rawAttributes'],function(_0x974d70){return{'name':_0x974d70[_0xc81d('0x49')],'type':_0x974d70[_0xc81d('0x46')][_0xc81d('0x4a')]};});_0x554255[_0xc81d('0x41')]=_['map'](_0x2890f2,'name');_0x554255[_0xc81d('0x4b')]=_[_0xc81d('0x4c')](_0x20d5ab[_0xc81d('0x4b')]);_0x554255[_0xc81d('0x4d')]=_['intersection'](_0x554255['model'],_0x554255['query']);_0x4f9df2['attributes']=_[_0xc81d('0x4e')](_0x554255['model'],qs[_0xc81d('0x4f')](_0x20d5ab[_0xc81d('0x4b')][_0xc81d('0x4f')]));_0x4f9df2['attributes']=_0x4f9df2['attributes']['length']?_0x4f9df2[_0xc81d('0x50')]:_0x554255[_0xc81d('0x41')];if(!_0x20d5ab[_0xc81d('0x4b')][_0xc81d('0x51')](_0xc81d('0x52'))){_0x4f9df2[_0xc81d('0x29')]=qs['limit'](_0x20d5ab['query'][_0xc81d('0x29')]);_0x4f9df2[_0xc81d('0x27')]=qs['offset'](_0x20d5ab[_0xc81d('0x4b')][_0xc81d('0x27')]);}_0x4f9df2['order']=qs[_0xc81d('0x53')](_0x20d5ab['query']['sort']);_0x4f9df2[_0xc81d('0x54')]=qs[_0xc81d('0x4d')](_[_0xc81d('0x55')](_0x20d5ab[_0xc81d('0x4b')],_0x554255[_0xc81d('0x4d')]),_0x2890f2);if(_0x20d5ab['query'][_0xc81d('0x56')]){_0x4f9df2['where']=_[_0xc81d('0x57')](_0x4f9df2[_0xc81d('0x54')],{'$or':_[_0xc81d('0x48')](_0x2890f2,function(_0x34caca){if(_0x34caca['type']!==_0xc81d('0x58')){var _0x5b9cba={};_0x5b9cba[_0x34caca['name']]={'$like':'%'+_0x20d5ab[_0xc81d('0x4b')]['filter']+'%'};return _0x5b9cba;}})});}_0x4f9df2=_['merge']({},_0x4f9df2,_0x20d5ab[_0xc81d('0x59')]);var _0xba4370={'where':_0x4f9df2[_0xc81d('0x54')]};return db['ChatWebsite'][_0xc81d('0x2a')](_0xba4370)[_0xc81d('0x18')](function(_0x22365f){_0xf9cda8[_0xc81d('0x2a')]=_0x22365f;if(_0x20d5ab[_0xc81d('0x4b')][_0xc81d('0x5a')]){_0x4f9df2[_0xc81d('0x5b')]=[{'all':!![]}];}return db['ChatWebsite'][_0xc81d('0x5c')](_0x4f9df2);})[_0xc81d('0x18')](function(_0x5c76ed){_0xf9cda8[_0xc81d('0x5d')]=_0x5c76ed;return _0xf9cda8;})[_0xc81d('0x18')](respondWithFilteredResult(_0x831218,_0x4f9df2))[_0xc81d('0x22')](handleError(_0x831218,null));};exports['show']=function(_0x5ad556,_0x766882){var _0x68f4ce={'raw':![],'where':{'id':_0x5ad556[_0xc81d('0x5e')]['id']},'include':[{'model':db[_0xc81d('0x5f')],'as':_0xc81d('0x47')}]},_0x584c40={};_0x584c40[_0xc81d('0x41')]=_[_0xc81d('0x4c')](db[_0xc81d('0x60')][_0xc81d('0x61')]);_0x584c40[_0xc81d('0x4b')]=_[_0xc81d('0x4c')](_0x5ad556[_0xc81d('0x4b')]);_0x584c40[_0xc81d('0x4d')]=_[_0xc81d('0x4e')](_0x584c40[_0xc81d('0x41')],_0x584c40[_0xc81d('0x4b')]);_0x68f4ce[_0xc81d('0x50')]=_[_0xc81d('0x4e')](_0x584c40[_0xc81d('0x41')],qs[_0xc81d('0x4f')](_0x5ad556[_0xc81d('0x4b')][_0xc81d('0x4f')]));_0x68f4ce['attributes']=_0x68f4ce['attributes'][_0xc81d('0x62')]?_0x68f4ce[_0xc81d('0x50')]:_0x584c40[_0xc81d('0x41')];if(_0x5ad556[_0xc81d('0x4b')][_0xc81d('0x5a')]){_0x68f4ce[_0xc81d('0x5b')]=[{'all':!![]}];}_0x68f4ce=_[_0xc81d('0x57')]({},_0x68f4ce,_0x5ad556['options']);return db[_0xc81d('0x60')]['find'](_0x68f4ce)[_0xc81d('0x18')](handleEntityNotFound(_0x766882,null))[_0xc81d('0x18')](respondWithResult(_0x766882,null))['catch'](handleError(_0x766882,null));};exports['create']=function(_0x127f74,_0x44d0cc){return db[_0xc81d('0x60')][_0xc81d('0x63')](_0x127f74[_0xc81d('0x64')],{})[_0xc81d('0x18')](function(_0x54b771){var _0x58c3ad=_0x127f74['user'][_0xc81d('0x2e')]({'plain':!![]});if(!_0x58c3ad)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58c3ad[_0xc81d('0x65')]==='user'){var _0x11d1c5=_0x54b771[_0xc81d('0x2e')]({'plain':!![]});var _0x9ec1f9='ChatWebsites';return db['UserProfileSection'][_0xc81d('0x66')]({'where':{'name':_0x9ec1f9,'userProfileId':_0x58c3ad[_0xc81d('0x67')]},'raw':!![]})[_0xc81d('0x18')](function(_0x44b005){if(_0x44b005&&_0x44b005[_0xc81d('0x68')]===0x0){return db['UserProfileResource'][_0xc81d('0x63')]({'name':_0x11d1c5[_0xc81d('0x3e')],'resourceId':_0x11d1c5['id'],'type':_0x44b005[_0xc81d('0x3e')],'sectionId':_0x44b005['id']},{})['then'](function(){return _0x54b771;});}else{return _0x54b771;}})['catch'](function(_0xe8e6bd){logger[_0xc81d('0x20')](_0xc81d('0x69'),_0xe8e6bd);throw _0xe8e6bd;});}return _0x54b771;})['then'](respondWithResult(_0x44d0cc,0xc9))[_0xc81d('0x22')](handleError(_0x44d0cc,null));};exports[_0xc81d('0x2c')]=function(_0x3d53a2,_0x3d8c9b){if(_0x3d53a2[_0xc81d('0x64')]['id']){delete _0x3d53a2[_0xc81d('0x64')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x3d53a2['params']['id']},'include':[{'model':db[_0xc81d('0x5f')],'as':_0xc81d('0x47')}]})[_0xc81d('0x18')](handleEntityNotFound(_0x3d8c9b,null))['then'](saveUpdates(_0x3d53a2[_0xc81d('0x64')],null))[_0xc81d('0x18')](respondWithResult(_0x3d8c9b,null))[_0xc81d('0x22')](handleError(_0x3d8c9b,null));};exports[_0xc81d('0x2d')]=function(_0xb30286,_0x544652){return db[_0xc81d('0x60')][_0xc81d('0x66')]({'where':{'id':_0xb30286[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x544652,null))[_0xc81d('0x18')](removeEntity(_0x544652,null))[_0xc81d('0x22')](handleError(_0x544652,null));};exports[_0xc81d('0x6a')]=function(_0x2622f9,_0x38944a){return db[_0xc81d('0x60')][_0xc81d('0x6a')]()[_0xc81d('0x18')](respondWithResult(_0x38944a,null))['catch'](handleError(_0x38944a,null));};exports[_0xc81d('0x6b')]=function(_0xc303da,_0x20115d){if(_0xc303da[_0xc81d('0x64')]['id']){delete _0xc303da[_0xc81d('0x64')]['id'];}return db[_0xc81d('0x60')]['find']({'where':{'id':_0xc303da[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x20115d,null))[_0xc81d('0x18')](function(_0x4bbf56){if(_0x4bbf56){_0xc303da['body'][_0xc81d('0x6c')]=_0x4bbf56['id'];return db[_0xc81d('0x6d')][_0xc81d('0x63')](_0xc303da[_0xc81d('0x64')]);}})[_0xc81d('0x18')](respondWithResult(_0x20115d,null))[_0xc81d('0x22')](handleError(_0x20115d,null));};exports[_0xc81d('0x6e')]=function(_0xb164c4,_0x14ebca){var _0xafb769={'raw':![],'where':{}};var _0x5b588b={};var _0x501191={'count':0x0,'rows':[]};return db[_0xc81d('0x60')]['findOne']({'where':{'id':_0xb164c4['params']['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x14ebca,null))[_0xc81d('0x18')](function(_0x41d63f){if(_0x41d63f){_0x5b588b[_0xc81d('0x41')]=_[_0xc81d('0x4c')](db[_0xc81d('0x6d')][_0xc81d('0x61')]);_0x5b588b[_0xc81d('0x4b')]=_[_0xc81d('0x4c')](_0xb164c4['query']);_0x5b588b[_0xc81d('0x4d')]=_['intersection'](_0x5b588b[_0xc81d('0x41')],_0x5b588b[_0xc81d('0x4b')]);_0xafb769[_0xc81d('0x50')]=_[_0xc81d('0x4e')](_0x5b588b['model'],qs[_0xc81d('0x4f')](_0xb164c4[_0xc81d('0x4b')][_0xc81d('0x4f')]));_0xafb769['attributes']=_0xafb769[_0xc81d('0x50')][_0xc81d('0x62')]?_0xafb769[_0xc81d('0x50')]:_0x5b588b['model'];if(!_0xb164c4[_0xc81d('0x4b')][_0xc81d('0x51')]('nolimit')){_0xafb769[_0xc81d('0x29')]=qs[_0xc81d('0x29')](_0xb164c4[_0xc81d('0x4b')][_0xc81d('0x29')]);_0xafb769[_0xc81d('0x27')]=qs[_0xc81d('0x27')](_0xb164c4[_0xc81d('0x4b')]['offset']);}_0xafb769['order']=qs[_0xc81d('0x53')](_0xb164c4[_0xc81d('0x4b')][_0xc81d('0x53')]);_0xafb769[_0xc81d('0x54')]=qs[_0xc81d('0x4d')](_[_0xc81d('0x55')](_0xb164c4[_0xc81d('0x4b')],_0x5b588b[_0xc81d('0x4d')]));_0xafb769[_0xc81d('0x54')][_0xc81d('0x6c')]=_0x41d63f['id'];if(_0xb164c4[_0xc81d('0x4b')]['filter']){_0xafb769[_0xc81d('0x54')]=_[_0xc81d('0x57')](_0xafb769['where'],{'$or':_[_0xc81d('0x48')](_0xafb769[_0xc81d('0x50')],function(_0x545db4){var _0x5c8b17={};_0x5c8b17[_0x545db4]={'$like':'%'+_0xb164c4[_0xc81d('0x4b')][_0xc81d('0x56')]+'%'};return _0x5c8b17;})});}_0xafb769=_['merge']({},_0xafb769,_0xb164c4[_0xc81d('0x59')]);return db[_0xc81d('0x6d')][_0xc81d('0x2a')]({'where':_0xafb769[_0xc81d('0x54')]})['then'](function(_0xc2a165){_0x501191[_0xc81d('0x2a')]=_0xc2a165;if(_0xb164c4[_0xc81d('0x4b')]['includeAll']){_0xafb769[_0xc81d('0x5b')]=[{'all':!![]}];}return db['Disposition'][_0xc81d('0x5c')](_0xafb769);})[_0xc81d('0x18')](function(_0x4b8a88){_0x501191[_0xc81d('0x5d')]=_0x4b8a88;return _0x501191;});}})[_0xc81d('0x18')](respondWithFilteredResult(_0x14ebca,_0xafb769))[_0xc81d('0x22')](handleError(_0x14ebca,null));};exports[_0xc81d('0x6f')]=function(_0x5759c0,_0x178e4c){return db[_0xc81d('0x60')][_0xc81d('0x66')]({'where':{'id':_0x5759c0['params']['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x178e4c,null))[_0xc81d('0x18')](function(_0x13b60f){if(_0x13b60f){return _0x13b60f[_0xc81d('0x6f')](_0x5759c0[_0xc81d('0x4b')][_0xc81d('0x70')]);}})[_0xc81d('0x18')](respondWithStatusCode(_0x178e4c,null))[_0xc81d('0x22')](handleError(_0x178e4c,null));};exports['addAnswer']=function(_0x2ba75c,_0x122da5){if(_0x2ba75c[_0xc81d('0x64')]['id']){delete _0x2ba75c[_0xc81d('0x64')]['id'];}return db['ChatWebsite'][_0xc81d('0x66')]({'where':{'id':_0x2ba75c[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x122da5,null))[_0xc81d('0x18')](function(_0x11711e){if(_0x11711e){_0x2ba75c[_0xc81d('0x64')][_0xc81d('0x6c')]=_0x11711e['id'];return db[_0xc81d('0x71')]['create'](_0x2ba75c[_0xc81d('0x64')]);}})[_0xc81d('0x18')](respondWithResult(_0x122da5,null))['catch'](handleError(_0x122da5,null));};exports['getAnswers']=function(_0x5b422a,_0x5711f2){var _0x3ea02a={'raw':![],'where':{}};var _0x301911={};var _0x528b55={'count':0x0,'rows':[]};return db[_0xc81d('0x60')]['findOne']({'where':{'id':_0x5b422a[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x5711f2,null))['then'](function(_0x3c4d3a){if(_0x3c4d3a){_0x301911[_0xc81d('0x41')]=_[_0xc81d('0x4c')](db[_0xc81d('0x71')][_0xc81d('0x61')]);_0x301911['query']=_[_0xc81d('0x4c')](_0x5b422a[_0xc81d('0x4b')]);_0x301911[_0xc81d('0x4d')]=_[_0xc81d('0x4e')](_0x301911[_0xc81d('0x41')],_0x301911[_0xc81d('0x4b')]);_0x3ea02a[_0xc81d('0x50')]=_['intersection'](_0x301911[_0xc81d('0x41')],qs[_0xc81d('0x4f')](_0x5b422a[_0xc81d('0x4b')][_0xc81d('0x4f')]));_0x3ea02a[_0xc81d('0x50')]=_0x3ea02a['attributes'][_0xc81d('0x62')]?_0x3ea02a[_0xc81d('0x50')]:_0x301911['model'];if(!_0x5b422a[_0xc81d('0x4b')][_0xc81d('0x51')](_0xc81d('0x52'))){_0x3ea02a[_0xc81d('0x29')]=qs[_0xc81d('0x29')](_0x5b422a['query'][_0xc81d('0x29')]);_0x3ea02a[_0xc81d('0x27')]=qs[_0xc81d('0x27')](_0x5b422a[_0xc81d('0x4b')][_0xc81d('0x27')]);}_0x3ea02a[_0xc81d('0x72')]=qs[_0xc81d('0x53')](_0x5b422a[_0xc81d('0x4b')][_0xc81d('0x53')]);_0x3ea02a[_0xc81d('0x54')]=qs[_0xc81d('0x4d')](_[_0xc81d('0x55')](_0x5b422a[_0xc81d('0x4b')],_0x301911[_0xc81d('0x4d')]));_0x3ea02a[_0xc81d('0x54')]['ChatWebsiteId']=_0x3c4d3a['id'];if(_0x5b422a[_0xc81d('0x4b')][_0xc81d('0x56')]){_0x3ea02a[_0xc81d('0x54')]=_[_0xc81d('0x57')](_0x3ea02a['where'],{'$or':_[_0xc81d('0x48')](_0x3ea02a['attributes'],function(_0x4796e1){var _0x5ac618={};_0x5ac618[_0x4796e1]={'$like':'%'+_0x5b422a['query'][_0xc81d('0x56')]+'%'};return _0x5ac618;})});}_0x3ea02a=_[_0xc81d('0x57')]({},_0x3ea02a,_0x5b422a[_0xc81d('0x59')]);return db[_0xc81d('0x71')]['count']({'where':_0x3ea02a[_0xc81d('0x54')]})[_0xc81d('0x18')](function(_0x34b5aa){_0x528b55[_0xc81d('0x2a')]=_0x34b5aa;if(_0x5b422a['query'][_0xc81d('0x5a')]){_0x3ea02a['include']=[{'all':!![]}];}return db[_0xc81d('0x71')][_0xc81d('0x5c')](_0x3ea02a);})['then'](function(_0xb3f5e0){_0x528b55[_0xc81d('0x5d')]=_0xb3f5e0;return _0x528b55;});}})[_0xc81d('0x18')](respondWithFilteredResult(_0x5711f2,_0x3ea02a))[_0xc81d('0x22')](handleError(_0x5711f2,null));};exports[_0xc81d('0x73')]=function(_0x1dded3,_0x4bf238){return db[_0xc81d('0x60')]['find']({'where':{'id':_0x1dded3[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x4bf238,null))[_0xc81d('0x18')](function(_0x392cdf){if(_0x392cdf){return _0x392cdf[_0xc81d('0x73')](_0x1dded3[_0xc81d('0x4b')][_0xc81d('0x70')]);}})['then'](respondWithStatusCode(_0x4bf238,null))[_0xc81d('0x22')](handleError(_0x4bf238,null));};exports[_0xc81d('0x74')]=function(_0x1dfb3a,_0x27a61c){_0x1dfb3a['body']['sitepic']=_0x1dfb3a['file'][_0xc81d('0x75')];return db['ChatWebsite']['find']({'where':{'id':_0x1dfb3a[_0xc81d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x27a61c,null))[_0xc81d('0x18')](saveUpdates(_0x1dfb3a[_0xc81d('0x64')],null))[_0xc81d('0x18')](respondWithResult(_0x27a61c,null))[_0xc81d('0x22')](handleError(_0x27a61c,null));};exports[_0xc81d('0x76')]=function(_0x28becc,_0x108a09){_0x28becc[_0xc81d('0x64')][_0xc81d('0x77')]=_0x28becc[_0xc81d('0x78')][_0xc81d('0x75')];return db['ChatWebsite'][_0xc81d('0x66')]({'where':{'id':_0x28becc[_0xc81d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x108a09,null))[_0xc81d('0x18')](saveUpdates(_0x28becc[_0xc81d('0x64')],null))['then'](respondWithResult(_0x108a09,null))['catch'](handleError(_0x108a09,null));};exports[_0xc81d('0x79')]=function(_0x5ab4cc,_0x2294bf){_0x5ab4cc[_0xc81d('0x64')][_0xc81d('0x7a')]=_0x5ab4cc['file'][_0xc81d('0x75')];return db[_0xc81d('0x60')][_0xc81d('0x66')]({'where':{'id':_0x5ab4cc[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x2294bf,null))[_0xc81d('0x18')](saveUpdates(_0x5ab4cc[_0xc81d('0x64')],null))[_0xc81d('0x18')](respondWithResult(_0x2294bf,null))[_0xc81d('0x22')](handleError(_0x2294bf,null));};exports[_0xc81d('0x7b')]=function(_0x1a352f,_0x2d82dd){_0x1a352f[_0xc81d('0x64')][_0xc81d('0x7c')]=_0x1a352f[_0xc81d('0x78')][_0xc81d('0x75')];return db[_0xc81d('0x60')][_0xc81d('0x66')]({'where':{'id':_0x1a352f[_0xc81d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2d82dd,null))[_0xc81d('0x18')](saveUpdates(_0x1a352f['body'],null))[_0xc81d('0x18')](respondWithResult(_0x2d82dd,null))['catch'](handleError(_0x2d82dd,null));};exports[_0xc81d('0x7d')]=function(_0x240294,_0x536477){var _0x4e8c89=path[_0xc81d('0x7e')](config[_0xc81d('0x7f')],_0xc81d('0x80'));var _0xb7f045={'where':{'id':_0x240294['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x101fae=![];return require(_0xc81d('0x81'))[_0xc81d('0x82')]()[_0xc81d('0x18')](function(_0x4a37df){if(_0x4a37df){_0x101fae=_0x4a37df[_0xc81d('0x83')];}})['then'](function(){return db[_0xc81d('0x60')][_0xc81d('0x66')](_0xb7f045);})[_0xc81d('0x18')](handleEntityNotFound(_0x536477,null))[_0xc81d('0x18')](function(_0x27e696){if(_0x27e696){if(!_[_0xc81d('0x84')](_0x27e696[_0xc81d('0x85')])){if(fs[_0xc81d('0x86')](path['join'](config[_0xc81d('0x7f')],_0xc81d('0x87'),_0x27e696[_0xc81d('0x85')]))&&_0x101fae){_0x4e8c89=path[_0xc81d('0x7e')](config['root'],_0xc81d('0x87'),_0x27e696[_0xc81d('0x85')]);}}return _0x536477[_0xc81d('0x88')](_0x4e8c89);}})[_0xc81d('0x22')](handleError(_0x536477,null));};exports[_0xc81d('0x89')]=function(_0x3c8c58,_0x4265a6){var _0x52270a=path['join'](config['root'],_0xc81d('0x8a'));var _0x3983d3={'where':{'id':_0x3c8c58[_0xc81d('0x5e')]['id']},'attributes':['id',_0xc81d('0x77')],'raw':!![]};return db['ChatWebsite']['find'](_0x3983d3)[_0xc81d('0x18')](handleEntityNotFound(_0x4265a6,null))['then'](function(_0x32f306){if(_0x32f306){if(!_[_0xc81d('0x84')](_0x32f306[_0xc81d('0x77')])){if(fs[_0xc81d('0x86')](path[_0xc81d('0x7e')](config[_0xc81d('0x7f')],_0xc81d('0x8b'),_0x32f306[_0xc81d('0x77')]))){_0x52270a=path['join'](config[_0xc81d('0x7f')],_0xc81d('0x8b'),_0x32f306[_0xc81d('0x77')]);}}return _0x4265a6['download'](_0x52270a);}})[_0xc81d('0x22')](handleError(_0x4265a6,null));};exports['getCustomerAvatar']=function(_0x50e6cd,_0x1bf038){var _0x4c9f9d=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x2a0db8={'where':{'id':_0x50e6cd[_0xc81d('0x5e')]['id']},'attributes':['id',_0xc81d('0x7a'),_0xc81d('0x8c')],'raw':!![]};return db[_0xc81d('0x60')][_0xc81d('0x66')](_0x2a0db8)['then'](handleEntityNotFound(_0x1bf038,null))[_0xc81d('0x18')](function(_0x2e6520){if(_0x2e6520){if(!_[_0xc81d('0x84')](_0x2e6520[_0xc81d('0x7a')])){if(fs['existsSync'](path[_0xc81d('0x7e')](config[_0xc81d('0x7f')],_0xc81d('0x8b'),_0x2e6520[_0xc81d('0x7a')]))&&_0x2e6520['showCustomerAvatar']){_0x4c9f9d=path[_0xc81d('0x7e')](config['root'],_0xc81d('0x8b'),_0x2e6520[_0xc81d('0x7a')]);}}return _0x1bf038[_0xc81d('0x88')](_0x4c9f9d);}})[_0xc81d('0x22')](handleError(_0x1bf038,null));};exports['getSystemAvatar']=function(_0x8e301a,_0x17464d){var _0x28fc75=path[_0xc81d('0x7e')](config['root'],_0xc81d('0x8d'));var _0xfd2beb={'where':{'id':_0x8e301a[_0xc81d('0x5e')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0xc81d('0x66')](_0xfd2beb)[_0xc81d('0x18')](handleEntityNotFound(_0x17464d,null))[_0xc81d('0x18')](function(_0x316fc0){if(_0x316fc0){if(!_[_0xc81d('0x84')](_0x316fc0[_0xc81d('0x7c')])){if(fs[_0xc81d('0x86')](path[_0xc81d('0x7e')](config[_0xc81d('0x7f')],'server/files/images/avatars/',_0x316fc0[_0xc81d('0x7c')]))){_0x28fc75=path[_0xc81d('0x7e')](config[_0xc81d('0x7f')],_0xc81d('0x8b'),_0x316fc0[_0xc81d('0x7c')]);}}return _0x17464d[_0xc81d('0x88')](_0x28fc75);}})[_0xc81d('0x22')](handleError(_0x17464d,null));};exports[_0xc81d('0x8e')]=function(_0x2d9088,_0x2eb15a){var _0x20ee4f={'body':_0x2d9088[_0xc81d('0x64')],'channel':'chat'};var _0x4a1cf5=[];var _0x390851=[];var _0x344b56={};var _0x572812=![];if(_0x2d9088[_0xc81d('0x64')]['id']){delete _0x2d9088[_0xc81d('0x64')]['id'];}if(_[_0xc81d('0x84')](_0x2d9088['body'][_0xc81d('0x8f')])){throw new APIBadRequestError(_0xc81d('0x90'));}if(_['isNil'](_0x2d9088['body'][_0xc81d('0x91')])){throw new APIBadRequestError(_0xc81d('0x92'));}if(_[_0xc81d('0x93')](_0x2d9088[_0xc81d('0x64')][_0xc81d('0x64')])){throw new APIBadRequestError(_0xc81d('0x94'));}return db[_0xc81d('0x95')][_0xc81d('0x6a')]()['then'](function(_0x22a76e){if(!_0x22a76e){throw new Error('No\x20available\x20attributes');}_0x4a1cf5=Object[_0xc81d('0x4c')](_0x22a76e)[_0xc81d('0x56')](function(_0x298df6){return![_0xc81d('0x96'),_0xc81d('0x97')][_0xc81d('0x98')](_0x298df6);});_0x390851=Object[_0xc81d('0x4c')](_0x22a76e)[_0xc81d('0x56')](function(_0x5480f4){return!['createdAt',_0xc81d('0x97'),_0xc81d('0x99'),_0xc81d('0x9a')][_0xc81d('0x98')](_0x5480f4);});if(!_[_0xc81d('0x98')](_0x390851,_0x2d9088[_0xc81d('0x64')]['mapKey'])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x390851['join'](',\x20'));}_0x344b56[_0x2d9088[_0xc81d('0x64')][_0xc81d('0x91')]]=_0x2d9088['body'][_0xc81d('0x8f')];})[_0xc81d('0x18')](function(){return db[_0xc81d('0x60')]['find']({'where':{'id':_0x2d9088[_0xc81d('0x5e')]['id']},'include':[{'model':db[_0xc81d('0x9b')],'as':'List','include':[{'model':db[_0xc81d('0x95')],'as':_0xc81d('0x9c'),'where':_0x344b56,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xc81d('0x9d')],'as':_0xc81d('0x9e')},{'model':db[_0xc81d('0x9f')],'as':_0xc81d('0x9f'),'include':[{'model':db[_0xc81d('0x9f')],'as':_0xc81d('0xa0'),'attributes':['id',_0xc81d('0xa1')],'raw':!![]}]}]});})[_0xc81d('0x18')](function(_0x4ebc67){if(!_0x4ebc67){throw new APINotFoundError(util['format'](_0xc81d('0xa2'),_0x2d9088[_0xc81d('0x5e')]['id']));}var _0x18780c=_0x4ebc67[_0xc81d('0x9f')];if(_0x18780c){var _0x1dbec7=_0x4ebc67[_0xc81d('0xa3')]||undefined;return _0x18780c['ifTime'](_0x1dbec7)[_0xc81d('0x18')](function(_0x2f9942){if(!_0x2f9942){throw new APIOutOfIntervalError();}return _0x4ebc67;});}else{return _0x4ebc67;}})['then'](function(_0x5a827a){if(!_0x5a827a[_0xc81d('0xa4')]){return;}_0x20ee4f['account']=_0x5a827a;_0x20ee4f[_0xc81d('0xa5')]=_0x5a827a['List'];_0x20ee4f[_0xc81d('0xa6')]=_[_0xc81d('0xa7')](_0x5a827a[_0xc81d('0x9e')],[_0xc81d('0xa8')],[_0xc81d('0xa9')]);if(_0x20ee4f[_0xc81d('0xaa')]['Applications']){delete _0x20ee4f[_0xc81d('0xaa')][_0xc81d('0x9e')];}if(_0x20ee4f[_0xc81d('0xaa')][_0xc81d('0xa4')]&&_0x20ee4f[_0xc81d('0xaa')][_0xc81d('0xa4')][_0xc81d('0x9c')][_0xc81d('0x62')]){return _0x20ee4f[_0xc81d('0xaa')]['List']['Contacts'][0x0];}var _0x4024a3=_[_0xc81d('0x11')](_0x2d9088[_0xc81d('0x64')],{'firstName':_0x2d9088[_0xc81d('0x64')][_0xc81d('0x8f')],'ListId':_0x5a827a[_0xc81d('0x9a')]});_0x4024a3[_0x2d9088[_0xc81d('0x64')]['mapKey']]=_0x2d9088[_0xc81d('0x64')]['from'];return db[_0xc81d('0x95')][_0xc81d('0x63')](_0x4024a3,{'fields':_0x4a1cf5,'raw':!![]});})[_0xc81d('0x18')](function(_0x4a7741){_0x20ee4f[_0xc81d('0xab')]=_0x4a7741;var _0x48fc07=createInteractionObject(_0x2d9088[_0xc81d('0x5e')]['id'],_0x2d9088[_0xc81d('0x64')],_0x2d9088[_0xc81d('0xac')],_0x4a7741);var _0x4dc643={'ChatWebsiteId':_0x2d9088['params']['id'],'closed':![]};if(_0x2d9088[_0xc81d('0x64')]['threadId']){_0x4dc643[_0xc81d('0xad')]=_0x2d9088[_0xc81d('0x64')][_0xc81d('0xad')];return db[_0xc81d('0xae')][_0xc81d('0x66')]({'where':_0x4dc643})[_0xc81d('0x18')](function(_0x197d52){if(_0x197d52){_0x572812=!![];return _0x197d52;}_0x48fc07[_0xc81d('0xad')]=_0x2d9088[_0xc81d('0x64')][_0xc81d('0xad')];_0x48fc07[_0xc81d('0xaf')]=_0x2d9088[_0xc81d('0x64')][_0xc81d('0xaf')];return db['ChatInteraction'][_0xc81d('0x63')](_0x48fc07);});}_0x4dc643[_0xc81d('0xb0')]=_0x4a7741['id'];if(_0x2d9088[_0xc81d('0x64')][_0xc81d('0xb1')]&&_0x2d9088[_0xc81d('0x64')][_0xc81d('0xb1')]['id']){_0x4dc643['id']=_0x2d9088[_0xc81d('0x64')][_0xc81d('0xb1')]['id'];return db[_0xc81d('0xae')][_0xc81d('0x66')]({'where':_0x4dc643})[_0xc81d('0x18')](function(_0x35b785){if(_0x35b785){_0x572812=!![];return _0x35b785;}return db['ChatInteraction'][_0xc81d('0x63')](_0x48fc07);});}return db[_0xc81d('0xae')][_0xc81d('0x63')](_0x48fc07);})[_0xc81d('0x18')](function(_0x184609){if(!_0x572812){return _0x184609;}var _0x2c6c70={'from':(_0x20ee4f[_0xc81d('0xab')][_0xc81d('0xb2')]||'')+'\x20'+(_0x20ee4f['contact'][_0xc81d('0x39')]||'')};if(_0x2d9088[_0xc81d('0x64')]['threadId']&&_0x2d9088['body'][_0xc81d('0xb3')]&&_0x2d9088[_0xc81d('0x64')][_0xc81d('0xad')]!=_0x2d9088['body'][_0xc81d('0xb3')]){_0x2c6c70[_0xc81d('0xad')]=_0x2d9088['body'][_0xc81d('0xb3')];}return _0x184609[_0xc81d('0x2c')](_0x2c6c70);})[_0xc81d('0x18')](function(_0x28b397){_0x20ee4f[_0xc81d('0xb1')]=_0x28b397['get']({'plain':!![]});_0x20ee4f[_0xc81d('0xb1')][_0xc81d('0xb4')]=!_0x572812;if(_0x20ee4f[_0xc81d('0xb1')][_0xc81d('0xb4')]){if(_0x20ee4f['account'][_0xc81d('0xb5')]){_0x20ee4f[_0xc81d('0xa6')][_0xc81d('0xb6')]({'id':0x0,'priority':_0x20ee4f['applications'][_0xc81d('0x62')]+0x1,'app':_0xc81d('0xb7'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xc81d('0xb8')][_0xc81d('0x63')]({'body':_0x2d9088['body']['body'],'ChatWebsiteId':_0x2d9088[_0xc81d('0x5e')]['id'],'ChatInteractionId':_0x28b397['id'],'direction':'in','ContactId':_0x20ee4f[_0xc81d('0xab')]['id'],'AttachmentId':_0x2d9088[_0xc81d('0x64')][_0xc81d('0xb9')]});})[_0xc81d('0x18')](function(_0x1394a4){_0x20ee4f[_0xc81d('0x21')]=_0x1394a4;if(!_0x20ee4f[_0xc81d('0xb1')][_0xc81d('0xba')]){return;}return db[_0xc81d('0xbb')][_0xc81d('0x66')]({'attributes':['id',_0xc81d('0x3e')],'where':{'id':_0x20ee4f['interaction']['UserId']}});})[_0xc81d('0x18')](function(_0x1cc3e2){if(_0x1cc3e2){_0x20ee4f[_0xc81d('0xa6')][_0xc81d('0xbc')]({'id':0x0,'priority':0x0,'app':_0xc81d('0xbd'),'appdata':_0x1cc3e2[_0xc81d('0x3e')]+','+(_0x20ee4f[_0xc81d('0xaa')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x20ee4f[_0xc81d('0xbe')]=!![];}if(!_0x20ee4f['interaction']['queueId']){return;}return db[_0xc81d('0xbf')][_0xc81d('0x66')]({'attributes':['id',_0xc81d('0x3e')],'where':{'id':_0x20ee4f['interaction'][_0xc81d('0xc0')]}});})[_0xc81d('0x18')](function(_0xe42b6c){if(_0xe42b6c){_0x20ee4f[_0xc81d('0xa6')][_0xc81d('0xbc')]({'id':0x0,'priority':0x1,'app':_0xc81d('0xc1'),'appdata':_0xe42b6c[_0xc81d('0x3e')]+','+(_0x20ee4f[_0xc81d('0xaa')]['waitForTheAssignedQueue']||0x12c),'interval':_0xc81d('0xc2')});}return respondWithRpcPromise(_0xc81d('0xc3'),_0xc81d('0xc4'),_0x20ee4f);})[_0xc81d('0x18')](function(_0x2a0e60){respondWithRpcPromise(_0xc81d('0xc5'),_0xc81d('0xc5'),{'event':_0xc81d('0x8e'),'message':_0x2a0e60},client9002);return _0x2a0e60;})['then'](respondWithResult(_0x2eb15a,null))[_0xc81d('0x22')](APIHandleError(_0x2eb15a));};exports[_0xc81d('0xc6')]=function(_0x3d6804,_0x5a9d5a){var _0x1799d7,_0x51f639,_0x4e7320;var _0x502443=[];var _0x5a88fd={};var _0xd87f0d=_0x3d6804[_0xc81d('0xc7')]||[];var _0x2407db=[];var _0x21c939;return db[_0xc81d('0x95')][_0xc81d('0x6a')]()[_0xc81d('0x18')](function(_0x586728){if(!_0x586728){throw new db['Sequelize']['ValidationError'](_0xc81d('0xc8'));}_0x502443=_[_0xc81d('0xc9')](_[_0xc81d('0x4c')](_0x586728),[_0xc81d('0x96'),_0xc81d('0x97'),_0xc81d('0x99'),_0xc81d('0x9a')]);if(_0x3d6804[_0xc81d('0x64')]['id']){delete _0x3d6804[_0xc81d('0x64')]['id'];}if(_[_0xc81d('0x84')](_0x3d6804['body'][_0xc81d('0x8f')])){throw _0x5a9d5a[_0xc81d('0x24')](0x1f4)['send'](new db[(_0xc81d('0xca'))][(_0xc81d('0xcb'))](_0xc81d('0xcc')));}if(_[_0xc81d('0x84')](_0x3d6804['body'][_0xc81d('0x64')])||_0x3d6804['body'][_0xc81d('0x64')]===''){throw _0x5a9d5a[_0xc81d('0x24')](0x1f4)[_0xc81d('0x31')](new db['Sequelize'][(_0xc81d('0xcb'))](_0xc81d('0xcd')));}if(_[_0xc81d('0x84')](_0x3d6804[_0xc81d('0x64')][_0xc81d('0xce')])){throw _0x5a9d5a[_0xc81d('0x24')](0x1f4)[_0xc81d('0x31')](new db[(_0xc81d('0xca'))][(_0xc81d('0xcb'))](_0xc81d('0xcf')+_0x502443));}if(!_[_0xc81d('0x98')](_0x502443,_0x3d6804['body'][_0xc81d('0xce')])){throw _0x5a9d5a[_0xc81d('0x24')](0x1f4)[_0xc81d('0x31')](new db['Sequelize'][(_0xc81d('0xcb'))](_0xc81d('0xd0')+_0x502443));}_0x5a88fd[_0x3d6804['body'][_0xc81d('0xce')]]=_0x3d6804['body']['from'];})[_0xc81d('0x18')](function(){return db[_0xc81d('0x60')][_0xc81d('0x66')]({'where':{'id':_0x3d6804['params']['id']},'include':[{'model':db['CmList'],'as':_0xc81d('0xa4')},{'model':db['MailAccount'],'as':_0xc81d('0xd1')}]});})[_0xc81d('0x18')](handleEntityNotFound(_0x5a9d5a,null))[_0xc81d('0x18')](function(_0x68ecd3){if(_0x68ecd3&&_0x68ecd3[_0xc81d('0xa4')]){_0x51f639=_0x68ecd3;var _0xde2730=_[_0xc81d('0x11')](_0x3d6804[_0xc81d('0x64')],{'firstName':_0x3d6804['body'][_0xc81d('0x8f')],'phone':_0x3d6804[_0xc81d('0x64')][_0xc81d('0x8f')],'ListId':_0x68ecd3['ListId']});_0xde2730[_0x3d6804['body']['mapKeyOffline']]=_0x3d6804['body'][_0xc81d('0x8f')];return db['CmContact'][_0xc81d('0xd2')]({'where':_0x5a88fd,'defaults':_0xde2730});}})['spread'](function(_0x3a5452){if(_0x3a5452){_0x4e7320=_0x3a5452;var _0x42d39e=fs['readFileSync'](path[_0xc81d('0x7e')](config[_0xc81d('0x7f')],_0xc81d('0xd3')),_0xc81d('0xd4'));var _0x2713ee=ejs[_0xc81d('0xd5')](_0x42d39e,{'body':_[_0xc81d('0xd6')](_0x3d6804[_0xc81d('0x64')][_0xc81d('0x64')]),'bodyTitle':_0x51f639[_0xc81d('0xd7')]});return db[_0xc81d('0xd8')]['create']({'body':_0x2713ee,'plainBody':htmlToText[_0xc81d('0xd9')](_0x2713ee),'ContactId':_0x3a5452['id'],'ChatWebsiteId':_0x51f639['id']});}})['then'](function(_0x3890f0){_0x21c939=_0x3890f0;if(_0xd87f0d['length']){var _0x40a060=_0xd87f0d['map'](function(_0x3b98b5){return{'name':_0x3b98b5[_0xc81d('0xda')],'basename':_0x3b98b5[_0xc81d('0x75')],'type':_0x3b98b5[_0xc81d('0xdb')],'ChatOfflineMessageId':_0x3890f0['id']};});_0x2407db=_0x40a060[_0xc81d('0x48')](_0x48a84f=>{var _0x13aba0={'filename':_0x48a84f[_0xc81d('0x3e')],'path':path[_0xc81d('0x7e')](config['root'],_0xc81d('0xdc'),_0xc81d('0xc7'),_0xc81d('0xdd'),_0xc81d('0xde'),_0x48a84f[_0xc81d('0xdf')])};return _0x13aba0;});if(!_0x51f639[_0xc81d('0xe0')]){return db[_0xc81d('0xe1')][_0xc81d('0xe2')](function(_0x292154){return db[_0xc81d('0xe3')]['bulkCreate'](_0x40a060,{'transaction':_0x292154});});}}})[_0xc81d('0x18')](function(){if(_0x21c939){_0x1799d7=_0x21c939;return db[_0xc81d('0xd1')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xc81d('0xe4')],'as':_0xc81d('0xe5'),'raw':!![],'include':[{'model':db[_0xc81d('0xe6')],'as':_0xc81d('0xe6'),'raw':!![]}]}]});}})[_0xc81d('0x18')](function(_0x19c60c){if(_0x19c60c&&_0x19c60c[_0xc81d('0xe5')]&&_0x51f639[_0xc81d('0xe7')]&&_0x51f639['forwardOfflineAddress']){var _0x2a2f42=_0x19c60c[_0xc81d('0xe8')]();return respondWithRpcPromise(_0xc81d('0xe9'),'sendMail',{'account':_0x2a2f42,'message':{'from':util[_0xc81d('0x42')](_0xc81d('0xea'),_0x19c60c[_0xc81d('0x3e')],_0x19c60c[_0xc81d('0xeb')]||_0x19c60c[_0xc81d('0xe5')][_0xc81d('0xec')]),'to':_0x51f639[_0xc81d('0xed')],'subject':_0x51f639['offlineMessageSubject'],'html':_0x1799d7[_0xc81d('0x64')],'attachments':_0x2407db}},client9003)[_0xc81d('0x18')](function(){return _0x1799d7;})['catch'](function(_0x156da3){logger['error'](_0x156da3);});}})[_0xc81d('0x18')](function(){if(_0x51f639&&_0x51f639['openNewInteraction']&&_0x51f639[_0xc81d('0xee')]){var _0x1232a3=[];if(_0xd87f0d[_0xc81d('0x62')]){_0x1232a3=_0xd87f0d[_0xc81d('0x48')](function(_0x1b4ef4){return{'name':_0x1b4ef4[_0xc81d('0xda')],'basename':_0x1b4ef4['filename'],'type':_0x1b4ef4[_0xc81d('0xdb')],'ChatOfflineMessageId':_0x21c939['id']};});}var _0x29350e;if(!_[_0xc81d('0x84')](_0x51f639['subjectOffline'])){var _0x2755c2=_[_0xc81d('0x48')](_0x3d6804[_0xc81d('0x64')],function(_0x40c638){return _0x40c638;});var _0x29d387=_[_0xc81d('0xef')](_0x2755c2)[0x0];var _0xf5cadf=_[_0xc81d('0xf0')](_0x29d387,function(_0x2f0773){return _0x2f0773;});_0x29350e=_0xf5cadf[0x1][_0x51f639[_0xc81d('0xf1')]];}var _0x1f674c={'from':_0x4e7320[_0xc81d('0xeb')],'firstName':_0x4e7320[_0xc81d('0xb2')],'lastName':_0x4e7320[_0xc81d('0x39')],'mapKey':'email','message':{'from':_0x4e7320[_0xc81d('0xeb')],'to':_0x51f639[_0xc81d('0xd1')][_0xc81d('0xeb')],'cc':'','subject':_[_0xc81d('0x84')](_0x29350e)?_0x51f639[_0xc81d('0xf2')]:_0x29350e,'messageId':'','sentAt':new Date(),'attach':_0x1232a3['length'],'attachments':_0x1232a3,'originChannel':'Chat','ChatWebsiteId':_0x51f639['id'],'ChatOfflineMessageId':_0x1799d7['id'],'originTo':_0x51f639[_0xc81d('0xd1')][_0xc81d('0xeb')]},'body':_0x1799d7[_0xc81d('0x64')]};var _0x697a4c={'account':{'id':_0x51f639[_0xc81d('0xee')]},'body':_0x1f674c,'log':_0xc81d('0xf3')};return respondWithRpcPromise(_0xc81d('0xf3'),'notifyMail',_0x697a4c,client9001)[_0xc81d('0x18')](function(){return _0x1799d7;})[_0xc81d('0x22')](function(_0x34b87f){logger[_0xc81d('0x20')](_0x34b87f);});}return;})['then'](function(){if(_0x1799d7){return _0x1799d7;}})[_0xc81d('0x18')](respondWithResult(_0x5a9d5a,null))['catch'](function(){for(var _0x1d1440 of _0xd87f0d){var _0x3f6bd3=path[_0xc81d('0x7e')](config[_0xc81d('0x7f')],'server',_0xc81d('0xc7'),_0xc81d('0xdd'),'offline-chat',_0x1d1440[_0xc81d('0x75')]);fs_extra[_0xc81d('0xf4')](_0x3f6bd3)[_0xc81d('0x22')](function(_0x3dbd3b){logger[_0xc81d('0x20')](_0xc81d('0xf5'),_0x3f6bd3,_0x3dbd3b);});}});};exports[_0xc81d('0xf6')]=function(_0x4b6a83,_0x5b3aa1){return db['ChatInteraction'][_0xc81d('0x66')]({'where':{'id':_0x4b6a83[_0xc81d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5b3aa1,null))[_0xc81d('0x18')](function(_0x366897){if(_0x366897){return _0x366897[_0xc81d('0xf6')](_0x4b6a83['body'][_0xc81d('0x70')],_[_0xc81d('0xf7')](_0x4b6a83[_0xc81d('0x64')],[_0xc81d('0x70'),'id'])||{});}})['then'](respondWithResult(_0x5b3aa1,null))[_0xc81d('0x22')](handleError(_0x5b3aa1,null));};exports['getInteractions']=function(_0x534a1e,_0x4e0f1c){var _0x9d3fcd={'raw':![],'where':{}};var _0x59e421={};var _0x1b7d3f={'count':0x0,'rows':[]};return db[_0xc81d('0x60')]['findOne']({'where':{'id':_0x534a1e['params']['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x4e0f1c,null))[_0xc81d('0x18')](function(_0x487583){if(_0x487583){_0x59e421[_0xc81d('0x41')]=_['keys'](db['ChatInteraction'][_0xc81d('0x61')]);_0x59e421[_0xc81d('0x4b')]=_[_0xc81d('0x4c')](_0x534a1e[_0xc81d('0x4b')]);_0x59e421[_0xc81d('0x4d')]=_[_0xc81d('0x4e')](_0x59e421[_0xc81d('0x41')],_0x59e421[_0xc81d('0x4b')]);_0x9d3fcd[_0xc81d('0x50')]=_[_0xc81d('0x4e')](_0x59e421['model'],qs[_0xc81d('0x4f')](_0x534a1e[_0xc81d('0x4b')][_0xc81d('0x4f')]));_0x9d3fcd[_0xc81d('0x50')]=_0x9d3fcd[_0xc81d('0x50')]['length']?_0x9d3fcd['attributes']:_0x59e421[_0xc81d('0x41')];if(!_0x534a1e[_0xc81d('0x4b')]['hasOwnProperty']('nolimit')){_0x9d3fcd[_0xc81d('0x29')]=qs[_0xc81d('0x29')](_0x534a1e[_0xc81d('0x4b')]['limit']);_0x9d3fcd['offset']=qs[_0xc81d('0x27')](_0x534a1e[_0xc81d('0x4b')]['offset']);}_0x9d3fcd[_0xc81d('0x72')]=qs[_0xc81d('0x53')](_0x534a1e[_0xc81d('0x4b')][_0xc81d('0x53')]);_0x9d3fcd['where']=qs[_0xc81d('0x4d')](_[_0xc81d('0x55')](_0x534a1e[_0xc81d('0x4b')],_0x59e421[_0xc81d('0x4d')]));_0x9d3fcd['where'][_0xc81d('0x6c')]=_0x487583['id'];if(_0x534a1e[_0xc81d('0x4b')][_0xc81d('0x56')]){_0x9d3fcd['where']=_['merge'](_0x9d3fcd[_0xc81d('0x54')],{'$or':_['map'](_0x9d3fcd[_0xc81d('0x50')],function(_0x540fec){var _0x300ff6={};_0x300ff6[_0x540fec]={'$like':'%'+_0x534a1e[_0xc81d('0x4b')][_0xc81d('0x56')]+'%'};return _0x300ff6;})});}_0x9d3fcd=_['merge']({},_0x9d3fcd,_0x534a1e[_0xc81d('0x59')]);return db[_0xc81d('0xae')][_0xc81d('0x2a')]({'where':_0x9d3fcd[_0xc81d('0x54')]})[_0xc81d('0x18')](function(_0x97188){_0x1b7d3f[_0xc81d('0x2a')]=_0x97188;if(_0x534a1e[_0xc81d('0x4b')][_0xc81d('0x5a')]){_0x9d3fcd['include']=[{'model':db['CmContact'],'as':_0xc81d('0xf8'),'required':![]},{'model':db[_0xc81d('0xbb')],'as':'Owner','attributes':['name','fullname',_0xc81d('0xf9')],'required':![]},{'model':db[_0xc81d('0xfa')],'as':_0xc81d('0xfb'),'attributes':['id',_0xc81d('0x3e'),_0xc81d('0xfc')],'where':_0x534a1e['query'][_0xc81d('0xfd')]?{'id':_0x534a1e[_0xc81d('0x4b')][_0xc81d('0xfd')]}:undefined,'required':_0x534a1e[_0xc81d('0x4b')]['tag']?!![]:![]}];}return db[_0xc81d('0xae')]['findAll'](_0x9d3fcd);})['then'](function(_0x2c5d2c){_0x1b7d3f[_0xc81d('0x5d')]=_0x2c5d2c;return _0x1b7d3f;});}})['then'](respondWithFilteredResult(_0x4e0f1c,_0x9d3fcd))[_0xc81d('0x22')](handleError(_0x4e0f1c,null));};exports[_0xc81d('0xfe')]=function(_0x2724ee,_0x3b6af0){var _0x355fff=0x0;var _0x5d7cc2=0x0;var _0x372995=![];var _0x104a72;var _0x3323c8;return db[_0xc81d('0x60')][_0xc81d('0x66')]({'where':{'id':_0x2724ee[_0xc81d('0x5e')]['id']},'include':[{'model':db[_0xc81d('0x9f')],'as':_0xc81d('0x9f'),'include':[{'model':db[_0xc81d('0x9f')],'as':_0xc81d('0xa0'),'attributes':['id',_0xc81d('0xa1')]}]}]})['then'](handleEntityNotFound(_0x3b6af0,null))[_0xc81d('0x18')](function(_0x259191){if(_0x259191){_0x104a72=_0x259191;return _0x259191[_0xc81d('0xff')]({'raw':!![]});}})['then'](function(_0x57bbbb){if(_0x104a72){if(_0x57bbbb){_0x3323c8=_0x57bbbb;}}return require(_0xc81d('0x81'))['getLicense']();})[_0xc81d('0x18')](function(_0x3671ba){if(_0x3671ba){_0x5d7cc2=_0x3671ba['virtual'];_0x372995=_0x3671ba['custom'];}})['then'](function(){return db[_0xc81d('0xae')][_0xc81d('0x2a')]({'where':{'closed':![]}});})[_0xc81d('0x18')](function(_0x34819f){_0x355fff=_0x34819f;if(_0x5d7cc2&&_0x34819f>_0x5d7cc2){return db[_0xc81d('0x100')][_0xc81d('0x101')]({'where':{'id':0x1}})['then'](function(_0xe61322){if(_0xe61322){_0xe61322[_0xc81d('0x102')](_0xc81d('0x103'));}});}})[_0xc81d('0x18')](function(){var _0x36716e=_0x104a72[_0xc81d('0x9f')];var _0x33e665=_0x104a72[_0xc81d('0xa3')]||undefined;return _0x36716e?_0x36716e[_0xc81d('0x104')](_0x33e665):!![];})[_0xc81d('0x18')](function(_0x4fc108){var _0x5524bc=fs[_0xc81d('0x105')](path[_0xc81d('0x7e')](config[_0xc81d('0x7f')],'server/files/chat/iframe.ejs'),'utf8');var _0x391123=new url[(_0xc81d('0x106'))](_0x104a72[_0xc81d('0x107')])[_0xc81d('0x108')];var _0x2d47c0=_0xc81d('0x109');var _0x3bc9eb=![];var _0x4124c7={'chatVersion':_0x2d47c0,'chatWebsiteAddressOrigin':_0x391123,'remote':_0x104a72[_0xc81d('0x10a')],'query':querystring[_0xc81d('0x1e')](_[_0xc81d('0x57')](_0x104a72[_0xc81d('0x2e')]({'plain':!![]}),{'customerIp':_0x2724ee['headers']['x-forwarded-for']||_0x2724ee[_0xc81d('0xac')][_0xc81d('0x10b')]||_0x2724ee[_0xc81d('0x10c')][_0xc81d('0x10d')]||_0x2724ee['ip'],'referer':_0x2724ee[_0xc81d('0xac')][_0xc81d('0x3b')],'openedInteractions':_0x355fff,'maxInteractions':_0x5d7cc2,'virtual':_0x372995[_0xc81d('0x10e')],'online':_0x4fc108,'custom':_0x372995}))[_0xc81d('0x10f')](/'/g,'\x5c\x27')};_0x3b6af0[_0xc81d('0x31')](ejs[_0xc81d('0xd5')](Mustache[_0xc81d('0xd5')](_0x5524bc,_0x4124c7),{'proactiveActions':_0x3323c8,'alignment':_0x104a72[_0xc81d('0x110')],'verticalAlignment':_0x104a72[_0xc81d('0x111')],'div_color':_0x104a72['color'],'labelText':_0x104a72[_0xc81d('0x112')],'text_color':_0x104a72[_0xc81d('0x113')],'text_button_color':_0x104a72[_0xc81d('0x114')],'button_color':_0x104a72[_0xc81d('0x115')],'background_color':_0x104a72[_0xc81d('0x116')],'hideWhenOffline':_0x104a72[_0xc81d('0x117')],'intervalId':_0x104a72[_0xc81d('0x118')],'isDevelopment':_0x3bc9eb,'chatVersion':_0x2d47c0}));})[_0xc81d('0x22')](handleError(_0x3b6af0,null));};exports['addApplications']=function(_0x2a6c67,_0x1273b2){var _0x58d6f2=_0x2a6c67[_0xc81d('0x5e')]['id'];var _0x17ecc7=_0x2a6c67['body'];var _0x385ccd=0xc8;var _0x36ab63=null;return db[_0xc81d('0xe1')]['transaction']({'isolationLevel':db['sequelize'][_0xc81d('0x119')][_0xc81d('0x11a')][_0xc81d('0x11b')]},function(_0x2255db){return db[_0xc81d('0x60')][_0xc81d('0x101')]({'where':{'id':_0x58d6f2},'transaction':_0x2255db})[_0xc81d('0x18')](function(_0x45349d){if(_0x45349d){return db[_0xc81d('0x9d')][_0xc81d('0x2d')]({'where':{'ChatWebsiteId':_0x58d6f2},'transaction':_0x2255db})[_0xc81d('0x18')](function(){var _0x51e936=_[_0xc81d('0x48')](_0x17ecc7,function(_0x22090e){_0x22090e[_0xc81d('0x6c')]=_0x58d6f2;return _0x22090e;});return db[_0xc81d('0x9d')][_0xc81d('0x11c')](_0x51e936,{'transaction':_0x2255db});});}else{_0x385ccd=0x194;_0x36ab63=[];}});})[_0xc81d('0x18')](function(){if(_0x385ccd!==0x194){return db[_0xc81d('0x9d')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x58d6f2},'order':'priority'})[_0xc81d('0x18')](function(_0xd9d900){_0x36ab63=_0xd9d900;});}})[_0xc81d('0x22')](function(_0x3c54c8){_0x385ccd=0x1f4;logger[_0xc81d('0x20')](_0x3c54c8['stack']);if(_0x3c54c8[_0xc81d('0x3e')]){delete _0x3c54c8[_0xc81d('0x3e')];}_0x36ab63=_0x3c54c8;})[_0xc81d('0x11d')](function(){if(_0x36ab63===null){_0x1273b2[_0xc81d('0x23')](_0x385ccd);}else{if(_0x385ccd===0x1f4){_0x1273b2[_0xc81d('0x24')](_0x385ccd)[_0xc81d('0x31')](_0x36ab63);}else{_0x1273b2['status'](_0x385ccd)[_0xc81d('0x26')](_0x36ab63);}}});};exports['getApplications']=function(_0xdcd67b,_0x3bcda0){var _0x3cc2f3={};var _0x426e63={};var _0x3228f3;var _0x327ead;return db[_0xc81d('0x60')]['findOne']({'where':{'id':_0xdcd67b['params']['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x3bcda0,null))['then'](function(_0x393de6){if(_0x393de6){_0x3228f3=_0x393de6;_0x426e63['model']=_[_0xc81d('0x4c')](db[_0xc81d('0x9d')][_0xc81d('0x61')]);_0x426e63[_0xc81d('0x4b')]=_[_0xc81d('0x4c')](_0xdcd67b[_0xc81d('0x4b')]);_0x426e63[_0xc81d('0x4d')]=_['intersection'](_0x426e63[_0xc81d('0x41')],_0x426e63['query']);_0x3cc2f3[_0xc81d('0x50')]=_['intersection'](_0x426e63[_0xc81d('0x41')],qs[_0xc81d('0x4f')](_0xdcd67b[_0xc81d('0x4b')]['fields']));_0x3cc2f3[_0xc81d('0x50')]=_0x3cc2f3[_0xc81d('0x50')][_0xc81d('0x62')]?_0x3cc2f3[_0xc81d('0x50')]:_0x426e63['model'];_0x3cc2f3[_0xc81d('0x72')]=qs['sort'](_0xdcd67b[_0xc81d('0x4b')][_0xc81d('0x53')]);_0x3cc2f3[_0xc81d('0x54')]=qs['filters'](_[_0xc81d('0x55')](_0xdcd67b['query'],_0x426e63[_0xc81d('0x4d')]));if(_0xdcd67b[_0xc81d('0x4b')]['filter']){_0x3cc2f3[_0xc81d('0x54')]=_[_0xc81d('0x57')](_0x3cc2f3[_0xc81d('0x54')],{'$or':_[_0xc81d('0x48')](_0x3cc2f3[_0xc81d('0x50')],function(_0xf2e010){var _0xa0e89d={};_0xa0e89d[_0xf2e010]={'$like':'%'+_0xdcd67b[_0xc81d('0x4b')][_0xc81d('0x56')]+'%'};return _0xa0e89d;})});}_0x3cc2f3=_[_0xc81d('0x57')]({},_0x3cc2f3,_0xdcd67b[_0xc81d('0x59')]);return _0x3228f3[_0xc81d('0x11e')](_0x3cc2f3);}})['then'](function(_0x443e69){if(_0x443e69){_0x327ead=_0x443e69[_0xc81d('0x62')];if(!_0xdcd67b[_0xc81d('0x4b')][_0xc81d('0x51')](_0xc81d('0x52'))){_0x3cc2f3[_0xc81d('0x29')]=qs[_0xc81d('0x29')](_0xdcd67b[_0xc81d('0x4b')][_0xc81d('0x29')]);_0x3cc2f3[_0xc81d('0x27')]=qs[_0xc81d('0x27')](_0xdcd67b[_0xc81d('0x4b')][_0xc81d('0x27')]);}return _0x3228f3[_0xc81d('0x11e')](_0x3cc2f3);}})[_0xc81d('0x18')](function(_0x5295d7){if(_0x5295d7){return _0x5295d7?{'count':_0x327ead,'rows':_0x5295d7}:null;}})[_0xc81d('0x18')](respondWithResult(_0x3bcda0,null))[_0xc81d('0x22')](handleError(_0x3bcda0,null));};exports['addProactiveActions']=function(_0x1a131d,_0x37318e){return db[_0xc81d('0x11f')][_0xc81d('0x66')]({'where':{'id':_0x1a131d[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x37318e,null))[_0xc81d('0x18')](function(_0x490b20){if(_0x490b20){return _0x490b20[_0xc81d('0x120')](_0x1a131d['body'][_0xc81d('0x70')],_[_0xc81d('0xf7')](_0x1a131d[_0xc81d('0x64')],['ids','id'])||{});}})['then'](respondWithResult(_0x37318e,null))['catch'](handleError(_0x37318e,null));};exports[_0xc81d('0xff')]=function(_0x3e4770,_0x144920){var _0x1c8584={};var _0x559411={};var _0x1d1ae6;var _0x4bd6ad;return db[_0xc81d('0x60')][_0xc81d('0x101')]({'where':{'id':_0x3e4770[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x144920,null))[_0xc81d('0x18')](function(_0x401324){if(_0x401324){_0x1d1ae6=_0x401324;_0x559411['model']=_[_0xc81d('0x4c')](db[_0xc81d('0x121')][_0xc81d('0x61')]);_0x559411['query']=_[_0xc81d('0x4c')](_0x3e4770[_0xc81d('0x4b')]);_0x559411[_0xc81d('0x4d')]=_[_0xc81d('0x4e')](_0x559411[_0xc81d('0x41')],_0x559411['query']);_0x1c8584[_0xc81d('0x50')]=_[_0xc81d('0x4e')](_0x559411[_0xc81d('0x41')],qs['fields'](_0x3e4770['query']['fields']));_0x1c8584[_0xc81d('0x50')]=_0x1c8584[_0xc81d('0x50')]['length']?_0x1c8584['attributes']:_0x559411['model'];_0x1c8584['order']=qs[_0xc81d('0x53')](_0x3e4770[_0xc81d('0x4b')][_0xc81d('0x53')]);_0x1c8584[_0xc81d('0x54')]=qs[_0xc81d('0x4d')](_[_0xc81d('0x55')](_0x3e4770[_0xc81d('0x4b')],_0x559411[_0xc81d('0x4d')]));if(_0x3e4770[_0xc81d('0x4b')][_0xc81d('0x56')]){_0x1c8584[_0xc81d('0x54')]=_[_0xc81d('0x57')](_0x1c8584[_0xc81d('0x54')],{'$or':_['map'](_0x1c8584[_0xc81d('0x50')],function(_0x5331aa){var _0x12fb34={};_0x12fb34[_0x5331aa]={'$like':'%'+_0x3e4770['query']['filter']+'%'};return _0x12fb34;})});}_0x1c8584=_[_0xc81d('0x57')]({},_0x1c8584,_0x3e4770[_0xc81d('0x59')]);return _0x1d1ae6[_0xc81d('0xff')](_0x1c8584);}})[_0xc81d('0x18')](function(_0x48c0cf){if(_0x48c0cf){_0x4bd6ad=_0x48c0cf[_0xc81d('0x62')];if(!_0x3e4770[_0xc81d('0x4b')][_0xc81d('0x51')](_0xc81d('0x52'))){_0x1c8584[_0xc81d('0x29')]=qs[_0xc81d('0x29')](_0x3e4770[_0xc81d('0x4b')][_0xc81d('0x29')]);_0x1c8584['offset']=qs['offset'](_0x3e4770[_0xc81d('0x4b')][_0xc81d('0x27')]);}return _0x1d1ae6[_0xc81d('0xff')](_0x1c8584);}})['then'](function(_0x349388){if(_0x349388){return _0x349388?{'count':_0x4bd6ad,'rows':_0x349388}:null;}})[_0xc81d('0x18')](respondWithResult(_0x144920,null))[_0xc81d('0x22')](handleError(_0x144920,null));};exports[_0xc81d('0x122')]=function(_0x2ace7e,_0x57f7df){var _0x4113df=_0x2ace7e[_0xc81d('0x4b')]['online']===_0xc81d('0x123')?_0xc81d('0x124'):_0xc81d('0x125');return db['ChatWebsite'][_0xc81d('0x66')]({'attributes':['id',_0x4113df],'where':{'id':_0x2ace7e[_0xc81d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x57f7df,null))[_0xc81d('0x18')](function(_0x51735e){if(_0x51735e){var _0x1b06a1=_0x51735e[_0x4113df];var _0x5f158f=_0x1b06a1&&_0x1b06a1['items']?_0x1b06a1['items']:[];_0x57f7df[_0xc81d('0x31')]({'fromKey':_['isNil'](_0x1b06a1[_0xc81d('0x126')])?undefined:_0x1b06a1[_0xc81d('0x126')],'count':_0x5f158f[_0xc81d('0x62')],'rows':_0x5f158f});}})['catch'](handleError(_0x57f7df,null));};exports[_0xc81d('0x127')]=function(_0x1cc09c,_0x506c7a){var _0x47eef9={'raw':![],'where':{}};var _0x5371e9={};var _0x1c423f={'count':0x0,'rows':[]};return db[_0xc81d('0x60')][_0xc81d('0x101')]({'where':{'id':_0x1cc09c[_0xc81d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x506c7a,null))[_0xc81d('0x18')](function(_0x6dc3c8){if(_0x6dc3c8){_0x5371e9[_0xc81d('0x41')]=_['keys'](db['ChatOfflineMessage'][_0xc81d('0x61')]);_0x5371e9[_0xc81d('0x4b')]=_[_0xc81d('0x4c')](_0x1cc09c[_0xc81d('0x4b')]);_0x5371e9['filters']=_[_0xc81d('0x4e')](_0x5371e9[_0xc81d('0x41')],_0x5371e9[_0xc81d('0x4b')]);_0x47eef9[_0xc81d('0x50')]=_[_0xc81d('0x4e')](_0x5371e9['model'],qs[_0xc81d('0x4f')](_0x1cc09c[_0xc81d('0x4b')][_0xc81d('0x4f')]));_0x47eef9[_0xc81d('0x50')]=_0x47eef9[_0xc81d('0x50')][_0xc81d('0x62')]?_0x47eef9['attributes']:_0x5371e9[_0xc81d('0x41')];if(!_0x1cc09c[_0xc81d('0x4b')][_0xc81d('0x51')](_0xc81d('0x52'))){_0x47eef9[_0xc81d('0x29')]=qs[_0xc81d('0x29')](_0x1cc09c[_0xc81d('0x4b')]['limit']);_0x47eef9[_0xc81d('0x27')]=qs['offset'](_0x1cc09c['query'][_0xc81d('0x27')]);}_0x47eef9[_0xc81d('0x72')]=qs['sort'](_0x1cc09c['query']['sort']);_0x47eef9[_0xc81d('0x54')]=qs[_0xc81d('0x4d')](_['pick'](_0x1cc09c[_0xc81d('0x4b')],_0x5371e9[_0xc81d('0x4d')]));_0x47eef9[_0xc81d('0x54')]['ChatWebsiteId']=_0x6dc3c8['id'];if(_0x1cc09c[_0xc81d('0x4b')][_0xc81d('0x56')]){_0x47eef9[_0xc81d('0x54')]=_['merge'](_0x47eef9[_0xc81d('0x54')],{'$or':_[_0xc81d('0x48')](_0x47eef9[_0xc81d('0x50')],function(_0x5908dd){var _0x500f93={};_0x500f93[_0x5908dd]={'$like':'%'+_0x1cc09c[_0xc81d('0x4b')]['filter']+'%'};return _0x500f93;})});}_0x47eef9=_[_0xc81d('0x57')]({},_0x47eef9,_0x1cc09c['options']);return db[_0xc81d('0xd8')][_0xc81d('0x2a')]({'where':_0x47eef9[_0xc81d('0x54')]})[_0xc81d('0x18')](function(_0x3b03ff){_0x1c423f['count']=_0x3b03ff;if(_0x1cc09c[_0xc81d('0x4b')][_0xc81d('0x5a')]){_0x47eef9[_0xc81d('0x5b')]=[{'all':!![]}];}else{_0x47eef9[_0xc81d('0x5b')]=[{'model':db['CmContact'],'as':_0xc81d('0xf8'),'required':![]},{'model':db[_0xc81d('0xe3')],'as':_0xc81d('0x128'),'required':![]}];}return db[_0xc81d('0xd8')][_0xc81d('0x5c')](_0x47eef9);})[_0xc81d('0x18')](function(_0x21d20c){_0x1c423f['rows']=_0x21d20c;return _0x1c423f;});}})['then'](respondWithFilteredResult(_0x506c7a,_0x47eef9))[_0xc81d('0x22')](handleError(_0x506c7a,null));};exports[_0xc81d('0x129')]=function(_0x1c71be,_0x266365){return db['ChatWebsite'][_0xc81d('0x66')]({'where':{'id':_0x1c71be[_0xc81d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x266365,null))['then'](function(_0x10f2fd){if(_0x10f2fd){return _0x10f2fd[_0xc81d('0x129')](_0x1c71be[_0xc81d('0x64')][_0xc81d('0x70')],_[_0xc81d('0xf7')](_0x1c71be[_0xc81d('0x64')],[_0xc81d('0x70'),'id'])||{})['spread'](function(_0x3be846){for(var _0x4e6601=0x0;_0x4e6601<_0x1c71be[_0xc81d('0x64')][_0xc81d('0x70')]['length'];_0x4e6601+=0x1){socket[_0xc81d('0x12a')](_0xc81d('0x12b'),{'UserId':Number(_0x1c71be[_0xc81d('0x64')]['ids'][_0x4e6601]),'ChatWebsiteId':Number(_0x1c71be[_0xc81d('0x5e')]['id'])});}return _0x3be846;});}})[_0xc81d('0x18')](respondWithResult(_0x266365,null))['catch'](handleError(_0x266365,null));};exports[_0xc81d('0x12c')]=function(_0x4a62,_0x37ecf8){return db[_0xc81d('0x60')]['find']({'where':{'id':_0x4a62[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x37ecf8,null))['then'](function(_0x4eecb1){if(_0x4eecb1){return _0x4eecb1[_0xc81d('0x12c')](_0x4a62[_0xc81d('0x4b')][_0xc81d('0x70')])[_0xc81d('0x18')](function(){if(_[_0xc81d('0x12d')](_0x4a62[_0xc81d('0x4b')][_0xc81d('0x70')])){for(var _0x534af4=0x0;_0x534af4<_0x4a62['query'][_0xc81d('0x70')][_0xc81d('0x62')];_0x534af4+=0x1){socket[_0xc81d('0x12a')](_0xc81d('0x12e'),{'UserId':Number(_0x4a62[_0xc81d('0x4b')][_0xc81d('0x70')][_0x534af4]),'ChatWebsiteId':Number(_0x4a62['params']['id'])});}}else{socket[_0xc81d('0x12a')]('userChatWebsite:remove',{'UserId':Number(_0x4a62[_0xc81d('0x4b')][_0xc81d('0x70')]),'ChatWebsiteId':Number(_0x4a62[_0xc81d('0x5e')]['id'])});}});}})[_0xc81d('0x18')](respondWithStatusCode(_0x37ecf8,null))[_0xc81d('0x22')](handleError(_0x37ecf8,null));};exports[_0xc81d('0x12f')]=function(_0x3b04d8,_0x447c63){var _0x5cfe19={};var _0x2e78ba={};var _0x327be4;var _0x33edce;return db[_0xc81d('0x60')][_0xc81d('0x101')]({'where':{'id':_0x3b04d8['params']['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x447c63,null))[_0xc81d('0x18')](function(_0x5412a2){if(_0x5412a2){_0x327be4=_0x5412a2;_0x2e78ba['model']=_['keys'](db[_0xc81d('0xbb')][_0xc81d('0x61')]);_0x2e78ba[_0xc81d('0x4b')]=_[_0xc81d('0x4c')](_0x3b04d8[_0xc81d('0x4b')]);_0x2e78ba[_0xc81d('0x4d')]=_[_0xc81d('0x4e')](_0x2e78ba[_0xc81d('0x41')],_0x2e78ba[_0xc81d('0x4b')]);_0x5cfe19[_0xc81d('0x50')]=_[_0xc81d('0x4e')](_0x2e78ba[_0xc81d('0x41')],qs['fields'](_0x3b04d8[_0xc81d('0x4b')][_0xc81d('0x4f')]));_0x5cfe19[_0xc81d('0x50')]=_0x5cfe19[_0xc81d('0x50')][_0xc81d('0x62')]?_0x5cfe19['attributes']:_0x2e78ba['model'];_0x5cfe19[_0xc81d('0x72')]=qs[_0xc81d('0x53')](_0x3b04d8[_0xc81d('0x4b')]['sort']);_0x5cfe19[_0xc81d('0x54')]=qs['filters'](_['pick'](_0x3b04d8[_0xc81d('0x4b')],_0x2e78ba['filters']));if(_0x3b04d8[_0xc81d('0x4b')]['filter']){_0x5cfe19['where']=_['merge'](_0x5cfe19[_0xc81d('0x54')],{'$or':_[_0xc81d('0x48')](_0x5cfe19[_0xc81d('0x50')],function(_0x120868){var _0x5a13e2={};_0x5a13e2[_0x120868]={'$like':'%'+_0x3b04d8['query'][_0xc81d('0x56')]+'%'};return _0x5a13e2;})});}_0x5cfe19=_[_0xc81d('0x57')]({},_0x5cfe19,_0x3b04d8[_0xc81d('0x59')]);return _0x327be4['getAgents'](_0x5cfe19);}})[_0xc81d('0x18')](function(_0x502bc3){if(_0x502bc3){_0x33edce=_0x502bc3[_0xc81d('0x62')];if(!_0x3b04d8[_0xc81d('0x4b')][_0xc81d('0x51')](_0xc81d('0x52'))){_0x5cfe19['limit']=qs[_0xc81d('0x29')](_0x3b04d8[_0xc81d('0x4b')][_0xc81d('0x29')]);_0x5cfe19['offset']=qs[_0xc81d('0x27')](_0x3b04d8['query'][_0xc81d('0x27')]);}return _0x327be4[_0xc81d('0x12f')](_0x5cfe19);}})[_0xc81d('0x18')](function(_0x5dbbca){if(_0x5dbbca){return _0x5dbbca?{'count':_0x33edce,'rows':_0x5dbbca}:null;}})[_0xc81d('0x18')](respondWithResult(_0x447c63,null))[_0xc81d('0x22')](handleError(_0x447c63,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 17af6d9..abb3d08 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 _0xe198=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x17de8e,_0x41ad4c){var _0x39aba5=function(_0x255320){while(--_0x255320){_0x17de8e['push'](_0x17de8e['shift']());}};_0x39aba5(++_0x41ad4c);}(_0xe198,0x6f));var _0x8e19=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe198[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x8e19('0x0'));var ChatWebsite=require(_0x8e19('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8e19('0x2'),'afterUpdate':_0x8e19('0x3'),'afterDestroy':_0x8e19('0x4')};function emitEvent(_0x529200){return function(_0x32f52f,_0x4e3f58,_0x23383d){ChatWebsiteEvents[_0x8e19('0x5')](_0x529200+':'+_0x32f52f['id'],_0x32f52f);ChatWebsiteEvents[_0x8e19('0x5')](_0x529200,_0x32f52f);_0x23383d(null);};}for(var e in events){if(events[_0x8e19('0x6')](e)){var event=events[e];ChatWebsite[_0x8e19('0x7')](e,emitEvent(event));}}module[_0x8e19('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xaefc=['events','../../mysqldb','ChatWebsite','save','update','emit','hasOwnProperty','exports'];(function(_0x2f0f16,_0x42d05a){var _0x4fbc2a=function(_0x46c91a){while(--_0x46c91a){_0x2f0f16['push'](_0x2f0f16['shift']());}};_0x4fbc2a(++_0x42d05a);}(_0xaefc,0xc8));var _0xcaef=function(_0x4eddb9,_0x10d308){_0x4eddb9=_0x4eddb9-0x0;var _0x4aebd3=_0xaefc[_0x4eddb9];return _0x4aebd3;};'use strict';var EventEmitter=require(_0xcaef('0x0'));var ChatWebsite=require(_0xcaef('0x1'))['db'][_0xcaef('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcaef('0x3'),'afterUpdate':_0xcaef('0x4'),'afterDestroy':'remove'};function emitEvent(_0x575523){return function(_0x37a134,_0x46a35e,_0x5f160f){ChatWebsiteEvents['emit'](_0x575523+':'+_0x37a134['id'],_0x37a134);ChatWebsiteEvents[_0xcaef('0x5')](_0x575523,_0x37a134);_0x5f160f(null);};}for(var e in events){if(events[_0xcaef('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xcaef('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index ee42be4..8234f4e 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 _0xc80e=['moment','bluebird','path','rimraf','../../config/environment','exports','define','chat_websites','lodash','util','api'];(function(_0x3fa569,_0xf425fe){var _0x44ed1d=function(_0x5801c3){while(--_0x5801c3){_0x3fa569['push'](_0x3fa569['shift']());}};_0x44ed1d(++_0xf425fe);}(_0xc80e,0x152));var _0xec80=function(_0x5a2299,_0x3e2922){_0x5a2299=_0x5a2299-0x0;var _0xedff0f=_0xc80e[_0x5a2299];return _0xedff0f;};'use strict';var _=require(_0xec80('0x0'));var util=require(_0xec80('0x1'));var logger=require('../../config/logger')(_0xec80('0x2'));var moment=require(_0xec80('0x3'));var BPromise=require(_0xec80('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec80('0x5'));var rimraf=require(_0xec80('0x6'));var config=require(_0xec80('0x7'));var attributes=require('./chatWebsite.attributes');module[_0xec80('0x8')]=function(_0x1448b9,_0x1742e3){return _0x1448b9[_0xec80('0x9')]('ChatWebsite',attributes,{'tableName':_0xec80('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a17=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x27e7f5,_0x593031){var _0xdfad9c=function(_0x37b89d){while(--_0x37b89d){_0x27e7f5['push'](_0x27e7f5['shift']());}};_0xdfad9c(++_0x593031);}(_0x7a17,0x17e));var _0x77a1=function(_0x400cd8,_0x302f62){_0x400cd8=_0x400cd8-0x0;var _0x39f4e2=_0x7a17[_0x400cd8];return _0x39f4e2;};'use strict';var _=require('lodash');var util=require(_0x77a1('0x0'));var logger=require(_0x77a1('0x1'))(_0x77a1('0x2'));var moment=require(_0x77a1('0x3'));var BPromise=require(_0x77a1('0x4'));var rp=require(_0x77a1('0x5'));var fs=require('fs');var path=require(_0x77a1('0x6'));var rimraf=require('rimraf');var config=require(_0x77a1('0x7'));var attributes=require(_0x77a1('0x8'));module[_0x77a1('0x9')]=function(_0x4bd3fd,_0x4dfbda){return _0x4bd3fd[_0x77a1('0xa')](_0x77a1('0xb'),attributes,{'tableName':_0x77a1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 1707400..1c18c0f 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 _0x89ee=['stringify','code','error','message','result','catch','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x23f2a7,_0x3bc14f){var _0x547933=function(_0x4137e0){while(--_0x4137e0){_0x23f2a7['push'](_0x23f2a7['shift']());}};_0x547933(++_0x3bc14f);}(_0x89ee,0x14b));var _0xe89e=function(_0x9b2e01,_0x13c214){_0x9b2e01=_0x9b2e01-0x0;var _0x141a4d=_0x89ee[_0x9b2e01];return _0x141a4d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe89e('0x0'));var BPromise=require(_0xe89e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe89e('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xe89e('0x3'))('rpc');var config=require(_0xe89e('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xe89e('0x5')][_0xe89e('0x6')]({'port':0x232a});config[_0xe89e('0x7')]=_[_0xe89e('0x8')](config['redis'],{'host':_0xe89e('0x9'),'port':0x18eb});var socket=require(_0xe89e('0xa'))(new Redis(config[_0xe89e('0x7')]));require(_0xe89e('0xb'))[_0xe89e('0xc')](socket);function respondWithRpcPromise(_0x564978,_0xfc5150,_0x8a9762){return new BPromise(function(_0x58faf5,_0x24e107){return client[_0xe89e('0xd')](_0x564978,_0x8a9762)[_0xe89e('0xe')](function(_0x57de9d){logger[_0xe89e('0xf')](_0xe89e('0x10'),_0xfc5150,_0xe89e('0x11'));logger['debug'](_0xe89e('0x12'),_0xfc5150,_0xe89e('0x11'),JSON[_0xe89e('0x13')](_0x57de9d));if(_0x57de9d['error']){if(_0x57de9d['error'][_0xe89e('0x14')]===0x1f4){logger[_0xe89e('0x15')](_0xe89e('0x10'),_0xfc5150,_0x57de9d['error'][_0xe89e('0x16')]);return _0x24e107(_0x57de9d[_0xe89e('0x15')][_0xe89e('0x16')]);}logger[_0xe89e('0x15')](_0xe89e('0x10'),_0xfc5150,_0x57de9d[_0xe89e('0x15')]['message']);return _0x58faf5(_0x57de9d['error']['message']);}else{logger['info'](_0xe89e('0x10'),_0xfc5150,_0xe89e('0x11'));_0x58faf5(_0x57de9d[_0xe89e('0x17')][_0xe89e('0x16')]);}})[_0xe89e('0x18')](function(_0x37596f){logger[_0xe89e('0x15')]('ChatWebsite,\x20%s,\x20%s',_0xfc5150,_0x37596f);_0x24e107(_0x37596f);});});}
\ No newline at end of file
+var _0x63f6=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x444d51,_0x398e25){var _0x37a214=function(_0x11e5a6){while(--_0x11e5a6){_0x444d51['push'](_0x444d51['shift']());}};_0x37a214(++_0x398e25);}(_0x63f6,0x1a2));var _0x663f=function(_0x5a0c3e,_0x5f3780){_0x5a0c3e=_0x5a0c3e-0x0;var _0x318886=_0x63f6[_0x5a0c3e];return _0x318886;};'use strict';var _=require(_0x663f('0x0'));var util=require(_0x663f('0x1'));var moment=require(_0x663f('0x2'));var BPromise=require(_0x663f('0x3'));var rs=require(_0x663f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x663f('0x5'))['db'];var utils=require(_0x663f('0x6'));var logger=require(_0x663f('0x7'))(_0x663f('0x8'));var config=require(_0x663f('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x663f('0xa')]({'port':0x232a});config[_0x663f('0xb')]=_[_0x663f('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x663f('0xb')]));require(_0x663f('0xd'))[_0x663f('0xe')](socket);function respondWithRpcPromise(_0x3e5397,_0x427209,_0x51ea85){return new BPromise(function(_0x522844,_0x37a2f2){return client['request'](_0x3e5397,_0x51ea85)[_0x663f('0xf')](function(_0x1cdc5a){logger[_0x663f('0x10')](_0x663f('0x11'),_0x427209,_0x663f('0x12'));logger[_0x663f('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x427209,_0x663f('0x12'),JSON[_0x663f('0x14')](_0x1cdc5a));if(_0x1cdc5a['error']){if(_0x1cdc5a[_0x663f('0x15')][_0x663f('0x16')]===0x1f4){logger[_0x663f('0x15')](_0x663f('0x11'),_0x427209,_0x1cdc5a[_0x663f('0x15')][_0x663f('0x17')]);return _0x37a2f2(_0x1cdc5a[_0x663f('0x15')]['message']);}logger[_0x663f('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x427209,_0x1cdc5a[_0x663f('0x15')][_0x663f('0x17')]);return _0x522844(_0x1cdc5a['error'][_0x663f('0x17')]);}else{logger[_0x663f('0x10')](_0x663f('0x11'),_0x427209,_0x663f('0x12'));_0x522844(_0x1cdc5a[_0x663f('0x18')]['message']);}})[_0x663f('0x19')](function(_0x385e5f){logger['error'](_0x663f('0x11'),_0x427209,_0x385e5f);_0x37a2f2(_0x385e5f);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index cd9257f..9edf55c 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 _0x6188=['chatWebsite:','remove','update','emit','removeListener','register','length'];(function(_0x114e69,_0x48ee4b){var _0x481772=function(_0x5b2a60){while(--_0x5b2a60){_0x114e69['push'](_0x114e69['shift']());}};_0x481772(++_0x48ee4b);}(_0x6188,0x1b3));var _0x8618=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x6188[_0x525c7b];return _0x27b33e;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0x8618('0x0'),_0x8618('0x1')];function createListener(_0x28d4c5,_0x73b45e){return function(_0x1ff4cf){_0x73b45e[_0x8618('0x2')](_0x28d4c5,_0x1ff4cf);};}function removeListener(_0x216b6d,_0xd93a0e){return function(){ChatWebsiteEvents[_0x8618('0x3')](_0x216b6d,_0xd93a0e);};}exports[_0x8618('0x4')]=function(_0x471ec1){for(var _0xbfce31=0x0,_0xa220c3=events[_0x8618('0x5')];_0xbfce31<_0xa220c3;_0xbfce31++){var _0x1b8fa8=events[_0xbfce31];var _0x47a640=createListener(_0x8618('0x6')+_0x1b8fa8,_0x471ec1);ChatWebsiteEvents['on'](_0x1b8fa8,_0x47a640);}};
\ No newline at end of file
+var _0x288a=['remove','removeListener','./chatWebsite.events','save'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x288a,0x1b2));var _0xa288=function(_0x10e061,_0x3c25ec){_0x10e061=_0x10e061-0x0;var _0x5f46a3=_0x288a[_0x10e061];return _0x5f46a3;};'use strict';var ChatWebsiteEvents=require(_0xa288('0x0'));var events=[_0xa288('0x1'),_0xa288('0x2'),'update'];function createListener(_0x13f32c,_0x56390a){return function(_0x5f5d71){_0x56390a['emit'](_0x13f32c,_0x5f5d71);};}function removeListener(_0x14be09,_0x368b17){return function(){ChatWebsiteEvents[_0xa288('0x3')](_0x14be09,_0x368b17);};}exports['register']=function(_0x417d4a){for(var _0x3a8ee3=0x0,_0x5b1881=events['length'];_0x3a8ee3<_0x5b1881;_0x3a8ee3++){var _0x1f98ad=events[_0x3a8ee3];var _0x2875e7=createListener('chatWebsite:'+_0x1f98ad,_0x417d4a);ChatWebsiteEvents['on'](_0x1f98ad,_0x2875e7);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 849e147..48dfe9a 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 _0x8368=['/:id/interactions','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','join','root','server/files/images/logos/','%s-%s','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','addAvatar','addCustomerAvatar','format','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','offline','addInteraction','addApplications','addProactiveActions','addAgents','update','delete','/:id','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','get','/describe','describe','show','/:id/dispositions','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar'];(function(_0x6352a6,_0xdbe9b9){var _0x2b473c=function(_0x330739){while(--_0x330739){_0x6352a6['push'](_0x6352a6['shift']());}};_0x2b473c(++_0xdbe9b9);}(_0x8368,0x186));var _0x8836=function(_0x1ec626,_0x22bba4){_0x1ec626=_0x1ec626-0x0;var _0x128ba3=_0x8368[_0x1ec626];return _0x128ba3;};'use strict';var multer=require(_0x8836('0x0'));var util=require(_0x8836('0x1'));var path=require(_0x8836('0x2'));var timeout=require(_0x8836('0x3'));var express=require(_0x8836('0x4'));var router=express[_0x8836('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8836('0x6'));var config=require(_0x8836('0x7'));var controller=require(_0x8836('0x8'));router['get']('/',auth[_0x8836('0x9')](),controller['index']);router[_0x8836('0xa')](_0x8836('0xb'),auth[_0x8836('0x9')](),controller[_0x8836('0xc')]);router[_0x8836('0xa')]('/:id',auth[_0x8836('0x9')](),controller[_0x8836('0xd')]);router[_0x8836('0xa')](_0x8836('0xe'),auth[_0x8836('0x9')](),controller[_0x8836('0xf')]);router[_0x8836('0xa')]('/:id/canned_answers',auth[_0x8836('0x9')](),controller['getAnswers']);router[_0x8836('0xa')](_0x8836('0x10'),controller[_0x8836('0x11')]);router[_0x8836('0xa')](_0x8836('0x12'),controller[_0x8836('0x13')]);router[_0x8836('0xa')](_0x8836('0x14'),controller[_0x8836('0x15')]);router[_0x8836('0xa')](_0x8836('0x16'),controller[_0x8836('0x17')]);router['get'](_0x8836('0x18'),auth[_0x8836('0x9')](),controller[_0x8836('0x19')]);router[_0x8836('0xa')](_0x8836('0x1a'),controller['getSnippet']);router[_0x8836('0xa')]('/:id/applications',auth['isAuthenticated'](),controller[_0x8836('0x1b')]);router[_0x8836('0xa')](_0x8836('0x1c'),auth[_0x8836('0x9')](),controller[_0x8836('0x1d')]);router[_0x8836('0xa')](_0x8836('0x1e'),controller[_0x8836('0x1f')]);router['get']('/:id/offline_messages',auth[_0x8836('0x9')](),controller[_0x8836('0x20')]);router['get'](_0x8836('0x21'),auth['isAuthenticated'](),controller['getAgents']);router[_0x8836('0x22')]('/',auth[_0x8836('0x9')](),controller[_0x8836('0x23')]);router[_0x8836('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8836('0x24')]);router[_0x8836('0x22')]('/:id/canned_answers',auth[_0x8836('0x9')](),controller[_0x8836('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4807b9,_0x54852b,_0x5ee6a0){_0x5ee6a0(null,path[_0x8836('0x26')](config[_0x8836('0x27')],_0x8836('0x28')));},'filename':function(_0x3d29e8,_0xc435ec,_0x1acb0f){_0x1acb0f(null,util['format'](_0x8836('0x29'),Date[_0x8836('0x2a')](),_0xc435ec[_0x8836('0x2b')]));}})});router['post']('/:id/logo',upload[_0x8836('0x2c')](_0x8836('0x2d')),controller[_0x8836('0x2e')]);var upload=multer({'storage':multer[_0x8836('0x2f')]({'destination':function(_0x9c0ba,_0x552e8f,_0x5943a6){_0x5943a6(null,path[_0x8836('0x26')](config[_0x8836('0x27')],_0x8836('0x30')));},'filename':function(_0x47aa75,_0x11b1f0,_0xf9dd54){_0xf9dd54(null,util['format'](_0x8836('0x29'),Date[_0x8836('0x2a')](),_0x11b1f0[_0x8836('0x2b')]));}})});router[_0x8836('0x22')](_0x8836('0x12'),upload[_0x8836('0x2c')](_0x8836('0x2d')),controller[_0x8836('0x31')]);var upload=multer({'storage':multer[_0x8836('0x2f')]({'destination':function(_0x11d7c6,_0x642f13,_0x211c33){_0x211c33(null,path[_0x8836('0x26')](config[_0x8836('0x27')],_0x8836('0x30')));},'filename':function(_0x5a55c9,_0x206c9a,_0x37dc2a){_0x37dc2a(null,util['format']('%s-%s',Date[_0x8836('0x2a')](),_0x206c9a['originalname']));}})});router[_0x8836('0x22')](_0x8836('0x14'),upload['single'](_0x8836('0x2d')),controller[_0x8836('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x45f488,_0xfefdc6,_0x1aa25f){_0x1aa25f(null,path['join'](config[_0x8836('0x27')],_0x8836('0x30')));},'filename':function(_0x5034ae,_0xddce44,_0x26e064){_0x26e064(null,util[_0x8836('0x33')]('%s-%s',Date[_0x8836('0x2a')](),_0xddce44['originalname']));}})});router['post'](_0x8836('0x16'),upload['single'](_0x8836('0x2d')),controller[_0x8836('0x34')]);router[_0x8836('0x22')](_0x8836('0x35'),controller[_0x8836('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x8836('0x2f')]({'destination':function(_0x773826,_0x380111,_0x5c6184){const _0x7d9bfa=path[_0x8836('0x26')](config[_0x8836('0x27')],_0x8836('0x37'),_0x8836('0x38'),'offline-chat');fs_extra[_0x8836('0x39')](_0x7d9bfa,function(){_0x5c6184(null,_0x7d9bfa);});},'filename':function(_0x1c22ee,_0x8059fc,_0x37c0a2){const _0x348db9=_0x8059fc[_0x8836('0x2b')][_0x8836('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xff5c97=path['extname'](_0x348db9);const _0x1dfa7e=Date[_0x8836('0x2a')]()+'-'+_0x348db9[_0x8836('0x3a')](_0xff5c97,'')+_0xff5c97;_0x37c0a2(null,_0x1dfa7e);}})});router[_0x8836('0x22')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x8836('0x3b')]);router[_0x8836('0x22')](_0x8836('0x18'),auth['isAuthenticated'](),controller[_0x8836('0x3c')]);router[_0x8836('0x22')]('/:id/applications',auth[_0x8836('0x9')](),controller[_0x8836('0x3d')]);router[_0x8836('0x22')]('/:id/proactive_actions',auth[_0x8836('0x9')](),controller[_0x8836('0x3e')]);router[_0x8836('0x22')]('/:id/users',auth[_0x8836('0x9')](),controller[_0x8836('0x3f')]);router['put']('/:id',auth[_0x8836('0x9')](),controller[_0x8836('0x40')]);router[_0x8836('0x41')](_0x8836('0x42'),auth[_0x8836('0x9')](),controller['destroy']);router[_0x8836('0x41')]('/:id/dispositions',auth[_0x8836('0x9')](),controller['removeDispositions']);router[_0x8836('0x41')]('/:id/canned_answers',auth[_0x8836('0x9')](),controller[_0x8836('0x43')]);router[_0x8836('0x41')](_0x8836('0x21'),auth[_0x8836('0x9')](),controller['removeAgents']);module[_0x8836('0x44')]=router;
\ No newline at end of file
+var _0xdf0f=['/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','extname','replace','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar'];(function(_0x5bf2b3,_0xfcd364){var _0x5e8a9b=function(_0x43546b){while(--_0x43546b){_0x5bf2b3['push'](_0x5bf2b3['shift']());}};_0x5e8a9b(++_0xfcd364);}(_0xdf0f,0x1cc));var _0xfdf0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xdf0f[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xfdf0('0x0'));var util=require(_0xfdf0('0x1'));var path=require(_0xfdf0('0x2'));var timeout=require(_0xfdf0('0x3'));var express=require(_0xfdf0('0x4'));var router=express['Router']();var fs_extra=require(_0xfdf0('0x5'));var auth=require(_0xfdf0('0x6'));var interaction=require(_0xfdf0('0x7'));var config=require(_0xfdf0('0x8'));var controller=require('./chatWebsite.controller');router[_0xfdf0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfdf0('0x9')](_0xfdf0('0xa'),auth[_0xfdf0('0xb')](),controller[_0xfdf0('0xc')]);router[_0xfdf0('0x9')](_0xfdf0('0xd'),auth[_0xfdf0('0xb')](),controller[_0xfdf0('0xe')]);router[_0xfdf0('0x9')](_0xfdf0('0xf'),auth[_0xfdf0('0xb')](),controller['getDispositions']);router[_0xfdf0('0x9')](_0xfdf0('0x10'),auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x11')]);router[_0xfdf0('0x9')](_0xfdf0('0x12'),controller['getLogo']);router[_0xfdf0('0x9')](_0xfdf0('0x13'),controller[_0xfdf0('0x14')]);router['get'](_0xfdf0('0x15'),controller[_0xfdf0('0x16')]);router[_0xfdf0('0x9')](_0xfdf0('0x17'),controller[_0xfdf0('0x18')]);router[_0xfdf0('0x9')]('/:id/interactions',auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x19')]);router['get'](_0xfdf0('0x1a'),controller['getSnippet']);router[_0xfdf0('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0xfdf0('0x1b')]);router[_0xfdf0('0x9')](_0xfdf0('0x1c'),auth[_0xfdf0('0xb')](),controller['getProactiveActions']);router[_0xfdf0('0x9')](_0xfdf0('0x1d'),controller[_0xfdf0('0x1e')]);router[_0xfdf0('0x9')](_0xfdf0('0x1f'),auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x20')]);router['get']('/:id/users',auth[_0xfdf0('0xb')](),controller['getAgents']);router[_0xfdf0('0x21')]('/',auth[_0xfdf0('0xb')](),controller['create']);router[_0xfdf0('0x21')](_0xfdf0('0xf'),auth['isAuthenticated'](),controller[_0xfdf0('0x22')]);router[_0xfdf0('0x21')]('/:id/canned_answers',auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x23')]);var upload=multer({'storage':multer[_0xfdf0('0x24')]({'destination':function(_0x4c9e06,_0x1792d6,_0x2f1fa1){_0x2f1fa1(null,path[_0xfdf0('0x25')](config[_0xfdf0('0x26')],_0xfdf0('0x27')));},'filename':function(_0x2014a9,_0x58a200,_0x34501f){_0x34501f(null,util[_0xfdf0('0x28')](_0xfdf0('0x29'),Date[_0xfdf0('0x2a')](),_0x58a200[_0xfdf0('0x2b')]));}})});router[_0xfdf0('0x21')](_0xfdf0('0x12'),upload[_0xfdf0('0x2c')](_0xfdf0('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0xfdf0('0x24')]({'destination':function(_0x2ff7b8,_0x3d5dde,_0x34b5e0){_0x34b5e0(null,path['join'](config[_0xfdf0('0x26')],_0xfdf0('0x2e')));},'filename':function(_0x1618c3,_0x38b1a8,_0x382777){_0x382777(null,util[_0xfdf0('0x28')](_0xfdf0('0x29'),Date[_0xfdf0('0x2a')](),_0x38b1a8['originalname']));}})});router[_0xfdf0('0x21')](_0xfdf0('0x13'),upload[_0xfdf0('0x2c')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0xfdf0('0x24')]({'destination':function(_0x2e0795,_0x11f028,_0x5cc05e){_0x5cc05e(null,path[_0xfdf0('0x25')](config[_0xfdf0('0x26')],_0xfdf0('0x2e')));},'filename':function(_0x1986fb,_0x17b683,_0x51bea2){_0x51bea2(null,util['format']('%s-%s',Date[_0xfdf0('0x2a')](),_0x17b683[_0xfdf0('0x2b')]));}})});router[_0xfdf0('0x21')](_0xfdf0('0x15'),upload['single']('file'),controller[_0xfdf0('0x2f')]);var upload=multer({'storage':multer[_0xfdf0('0x24')]({'destination':function(_0x5d30cc,_0x5db01a,_0x275a17){_0x275a17(null,path[_0xfdf0('0x25')](config['root'],_0xfdf0('0x2e')));},'filename':function(_0xe25b3d,_0x218655,_0x427205){_0x427205(null,util[_0xfdf0('0x28')]('%s-%s',Date[_0xfdf0('0x2a')](),_0x218655['originalname']));}})});router['post'](_0xfdf0('0x17'),upload[_0xfdf0('0x2c')](_0xfdf0('0x2d')),controller[_0xfdf0('0x30')]);router[_0xfdf0('0x21')](_0xfdf0('0x31'),controller[_0xfdf0('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0xfdf0('0x24')]({'destination':function(_0x4f134f,_0x2a3f0c,_0x2d5652){const _0x58ecbd=path['join'](config['root'],'server/files',_0xfdf0('0x33'),_0xfdf0('0x34'));fs_extra[_0xfdf0('0x35')](_0x58ecbd,function(){_0x2d5652(null,_0x58ecbd);});},'filename':function(_0x5a2ff0,_0x18d93d,_0x358c1e){const _0x121d4e=_0x18d93d['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4dea0f=path[_0xfdf0('0x36')](_0x121d4e);const _0x9b71ac=Date[_0xfdf0('0x2a')]()+'-'+_0x121d4e[_0xfdf0('0x37')](_0x4dea0f,'')+_0x4dea0f;_0x358c1e(null,_0x9b71ac);}})});router[_0xfdf0('0x21')]('/:id/offline',offlineUploadMulter[_0xfdf0('0x38')](),controller[_0xfdf0('0x39')]);router[_0xfdf0('0x21')]('/:id/interactions',auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x3a')]);router[_0xfdf0('0x21')]('/:id/applications',auth['isAuthenticated'](),controller[_0xfdf0('0x3b')]);router[_0xfdf0('0x21')]('/:id/proactive_actions',auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x3c')]);router[_0xfdf0('0x21')](_0xfdf0('0x3d'),auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x3e')]);router['put'](_0xfdf0('0xd'),auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x3f')]);router[_0xfdf0('0x40')](_0xfdf0('0xd'),auth['isAuthenticated'](),controller[_0xfdf0('0x41')]);router[_0xfdf0('0x40')]('/:id/dispositions',auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x42')]);router['delete'](_0xfdf0('0x10'),auth['isAuthenticated'](),controller[_0xfdf0('0x43')]);router[_0xfdf0('0x40')](_0xfdf0('0x3d'),auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x44')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index bf97744..3b45e16 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 _0xf016=['production','get','client-side-logger','/client-logs','use','isAuthenticated','exports','express','../components/auth/service','../config/environment','Router','env'];(function(_0x2caf3a,_0x1d65d6){var _0x34f044=function(_0x31410c){while(--_0x31410c){_0x2caf3a['push'](_0x2caf3a['shift']());}};_0x34f044(++_0x1d65d6);}(_0xf016,0xdf));var _0x6f01=function(_0x36980d,_0x266c7f){_0x36980d=_0x36980d-0x0;var _0x18555d=_0xf016[_0x36980d];return _0x18555d;};var beaverLogger=require('beaver-logger/server');var express=require(_0x6f01('0x0'));var auth=require(_0x6f01('0x1'));var config=require(_0x6f01('0x2'));var router=express[_0x6f01('0x3')]();var isProduction=config[_0x6f01('0x4')]===_0x6f01('0x5')||![];function clientSideLogs(_0x4212de,_0x1aa1b1,_0xada4d2){var _0x4ce592=_0x4212de['app'][_0x6f01('0x6')](_0x6f01('0x7'));if(!_0x4ce592){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger['expressEndpoint']({'uri':_0x6f01('0x8'),'logger':_0x4ce592,'enableCors':!isProduction})(_0x4212de,_0x1aa1b1,_0xada4d2);}router[_0x6f01('0x9')](auth[_0x6f01('0xa')](),clientSideLogs);module[_0x6f01('0xb')]=router;
\ No newline at end of file
+var _0xc73e=['env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','Router'];(function(_0x1e356c,_0x1761c5){var _0x386592=function(_0x55e079){while(--_0x55e079){_0x1e356c['push'](_0x1e356c['shift']());}};_0x386592(++_0x1761c5);}(_0xc73e,0x1c3));var _0xec73=function(_0x13fcd8,_0x54681a){_0x13fcd8=_0x13fcd8-0x0;var _0x19cd5b=_0xc73e[_0x13fcd8];return _0x19cd5b;};var beaverLogger=require(_0xec73('0x0'));var express=require(_0xec73('0x1'));var auth=require(_0xec73('0x2'));var config=require('../config/environment');var router=express[_0xec73('0x3')]();var isProduction=config[_0xec73('0x4')]===_0xec73('0x5')||![];function clientSideLogs(_0x16995b,_0x504062,_0x32b314){var _0x2f315b=_0x16995b[_0xec73('0x6')][_0xec73('0x7')](_0xec73('0x8'));if(!_0x2f315b){throw new Error(_0xec73('0x9'));}return beaverLogger[_0xec73('0xa')]({'uri':'/client-logs','logger':_0x2f315b,'enableCors':!isProduction})(_0x16995b,_0x504062,_0x32b314);}router['use'](auth[_0xec73('0xb')](),clientSideLogs);module[_0xec73('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 0aa6b89..6957367 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 _0xba9f=['MicrosoftAzure\x20=>\x20access_token','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x5d8f86,_0x238cd9){var _0xfece95=function(_0x196473){while(--_0x196473){_0x5d8f86['push'](_0x5d8f86['shift']());}};_0xfece95(++_0x238cd9);}(_0xba9f,0x143));var _0xfba9=function(_0x59af48,_0x54de5c){_0x59af48=_0x59af48-0x0;var _0x386bc6=_0xba9f[_0x59af48];return _0x386bc6;};'use strict';var Sequelize=require(_0xfba9('0x0'));module[_0xfba9('0x1')]={'name':{'type':Sequelize[_0xfba9('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xfba9('0x3')](_0xfba9('0x4'),_0xfba9('0x5'),_0xfba9('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xfba9('0x3')](_0xfba9('0x7'),_0xfba9('0x8'))},'data1':{'type':Sequelize[_0xfba9('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xfba9('0x2')],'comment':_0xfba9('0x9')},'data3':{'type':Sequelize[_0xfba9('0x2')],'comment':_0xfba9('0xa')},'data4':{'type':Sequelize[_0xfba9('0x2')],'comment':_0xfba9('0xb')},'data5':{'type':Sequelize[_0xfba9('0xc')],'comment':_0xfba9('0xd')},'data6':{'type':Sequelize[_0xfba9('0xc')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x6f85=['MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x490dfe,_0x37a166){var _0x25acd6=function(_0x13b554){while(--_0x13b554){_0x490dfe['push'](_0x490dfe['shift']());}};_0x25acd6(++_0x37a166);}(_0x6f85,0xa2));var _0x56f8=function(_0x54b0f3,_0x1fe2f7){_0x54b0f3=_0x54b0f3-0x0;var _0x5ae957=_0x6f85[_0x54b0f3];return _0x5ae957;};'use strict';var Sequelize=require(_0x56f8('0x0'));module[_0x56f8('0x1')]={'name':{'type':Sequelize[_0x56f8('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x56f8('0x3')](_0x56f8('0x4'),_0x56f8('0x5'),_0x56f8('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x56f8('0x3')](_0x56f8('0x7'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0x56f8('0x8')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x56f8('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x56f8('0x2')],'comment':_0x56f8('0x9')},'data5':{'type':Sequelize[_0x56f8('0xa')],'comment':_0x56f8('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':_0x56f8('0xc')},'data7':{'type':Sequelize[_0x56f8('0xa')],'comment':_0x56f8('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 189e0a7..b2e43a8 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 _0x7586=['Invalid\x20state\x20parameter','from','state','base64','toString','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','./cloudProvider.oauth','defaults','redis','localhost','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','then','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','service','decryptString','data3','catch','params','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','update','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get'];(function(_0x5b3c61,_0x3eb2aa){var _0x153389=function(_0x2a1a99){while(--_0x2a1a99){_0x5b3c61['push'](_0x5b3c61['shift']());}};_0x153389(++_0x3eb2aa);}(_0x7586,0xcc));var _0x6758=function(_0x5168e3,_0x4b9c51){_0x5168e3=_0x5168e3-0x0;var _0x3112c3=_0x7586[_0x5168e3];return _0x3112c3;};'use strict';var _=require(_0x6758('0x0'));var Redis=require('ioredis');var qs=require(_0x6758('0x1'));var encryptor=require(_0x6758('0x2'));var config=require(_0x6758('0x3'));var logger=require(_0x6758('0x4'))('api');var db=require('../../mysqldb')['db'];var oauth=require(_0x6758('0x5'));config['redis']=_[_0x6758('0x6')](config[_0x6758('0x7')],{'host':_0x6758('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6758('0x7')]));var redis=new Redis(config[_0x6758('0x7')]);function respondWithStatusCode(_0x2f9c03,_0x20e32b){_0x20e32b=_0x20e32b||0xcc;return function(_0xe9817c){if(_0xe9817c){return _0x2f9c03[_0x6758('0x9')](_0x20e32b);}return _0x2f9c03[_0x6758('0xa')](_0x20e32b)[_0x6758('0xb')]();};}function respondWithResult(_0x454b04,_0x261774){_0x261774=_0x261774||0xc8;return function(_0x577929){if(_0x577929){return _0x454b04['status'](_0x261774)[_0x6758('0xc')](_0x577929);}};}function respondWithFilteredResult(_0x7c5652,_0x13a6f7){return function(_0xdc858b){if(_0xdc858b){var _0x260583=typeof _0x13a6f7[_0x6758('0xd')]===_0x6758('0xe')&&typeof _0x13a6f7[_0x6758('0xf')]==='undefined';var _0x21a6f0=_0xdc858b[_0x6758('0x10')];var _0x196b66=_0x260583?0x0:_0x13a6f7[_0x6758('0xd')];var _0x5c0fcf=_0x260583?_0xdc858b[_0x6758('0x10')]:_0x13a6f7[_0x6758('0xd')]+_0x13a6f7[_0x6758('0xf')];var _0x8c885c;if(_0x5c0fcf>=_0x21a6f0){_0x5c0fcf=_0x21a6f0;_0x8c885c=0xc8;}else{_0x8c885c=0xce;}_0x7c5652[_0x6758('0xa')](_0x8c885c);return _0x7c5652['set'](_0x6758('0x11'),_0x196b66+'-'+_0x5c0fcf+'/'+_0x21a6f0)[_0x6758('0xc')](_0xdc858b);}return null;};}function saveUpdates(_0x34f05e){return function(_0xd1b264){if(_0xd1b264){return _0xd1b264['update'](_0x34f05e)[_0x6758('0x12')](function(_0x51f2b3){return _0x51f2b3;});}return null;};}function removeEntity(_0x374534){return function(_0x4d329b){if(_0x4d329b){return _0x4d329b['destroy']()['then'](function(){_0x374534['status'](0xcc)[_0x6758('0xb')]();});}};}function handleEntityNotFound(_0x4035c3){return function(_0x2e9308){if(!_0x2e9308){_0x4035c3['sendStatus'](0x194);}return _0x2e9308;};}function handleError(_0x236c25,_0x218a89){_0x218a89=_0x218a89||0x1f4;return function(_0x3dcfe8){logger['error'](_0x3dcfe8['stack']);if(_0x3dcfe8['name']){delete _0x3dcfe8[_0x6758('0x13')];}_0x236c25[_0x6758('0xa')](_0x218a89)[_0x6758('0x14')](_0x3dcfe8);};}function maskClientSecret(_0xb1bc03){return _[_0x6758('0x15')](_0xb1bc03[_0x6758('0x16')](0x0,0x3),0x14,'*');}exports[_0x6758('0x17')]=function(_0x962d0c,_0x1e9d70){var _0x2134e7={},_0x215983={},_0x31cad2={'count':0x0,'rows':[]};var _0x4ec5b4=_[_0x6758('0x18')](db[_0x6758('0x19')][_0x6758('0x1a')],function(_0x41bc7d){return{'name':_0x41bc7d['fieldName'],'type':_0x41bc7d[_0x6758('0x1b')]['key']};});_0x215983[_0x6758('0x1c')]=_[_0x6758('0x18')](_0x4ec5b4,_0x6758('0x13'));_0x215983[_0x6758('0x1d')]=_[_0x6758('0x1e')](_0x962d0c['query']);_0x215983[_0x6758('0x1f')]=_[_0x6758('0x20')](_0x215983['model'],_0x215983[_0x6758('0x1d')]);_0x2134e7['attributes']=_[_0x6758('0x20')](_0x215983[_0x6758('0x1c')],qs[_0x6758('0x21')](_0x962d0c[_0x6758('0x1d')]['fields']));_0x2134e7[_0x6758('0x22')]=_0x2134e7[_0x6758('0x22')][_0x6758('0x23')]?_0x2134e7['attributes']:_0x215983[_0x6758('0x1c')];if(!_0x962d0c[_0x6758('0x1d')][_0x6758('0x24')](_0x6758('0x25'))){_0x2134e7[_0x6758('0xf')]=qs[_0x6758('0xf')](_0x962d0c[_0x6758('0x1d')][_0x6758('0xf')]);_0x2134e7[_0x6758('0xd')]=qs[_0x6758('0xd')](_0x962d0c['query']['offset']);}_0x2134e7[_0x6758('0x26')]=qs[_0x6758('0x27')](_0x962d0c[_0x6758('0x1d')][_0x6758('0x27')]);_0x2134e7[_0x6758('0x28')]=qs['filters'](_[_0x6758('0x29')](_0x962d0c['query'],_0x215983['filters']),_0x4ec5b4);if(_0x962d0c[_0x6758('0x1d')][_0x6758('0x2a')]){_0x2134e7['where']=_['merge'](_0x2134e7[_0x6758('0x28')],{'$or':_[_0x6758('0x18')](_0x4ec5b4,function(_0x26e07a){if(_0x26e07a[_0x6758('0x1b')]!==_0x6758('0x2b')){var _0x49327a={};_0x49327a[_0x26e07a[_0x6758('0x13')]]={'$like':'%'+_0x962d0c[_0x6758('0x1d')][_0x6758('0x2a')]+'%'};return _0x49327a;}})});}_0x2134e7=_[_0x6758('0x2c')]({},_0x2134e7,_0x962d0c[_0x6758('0x2d')]);var _0x9270cf={'where':_0x2134e7['where']};return db[_0x6758('0x19')][_0x6758('0x10')](_0x9270cf)[_0x6758('0x12')](function(_0x14fd97){_0x31cad2[_0x6758('0x10')]=_0x14fd97;if(_0x962d0c[_0x6758('0x1d')]['includeAll']){_0x2134e7[_0x6758('0x2e')]=[{'all':!![]}];}return db[_0x6758('0x19')][_0x6758('0x2f')](_0x2134e7);})[_0x6758('0x12')](function(_0x547863){_0x31cad2[_0x6758('0x30')]=_[_0x6758('0x18')](_0x547863,function(_0x47207c){if(_0x47207c[_0x6758('0x31')]==='MicrosoftAzure'){var _0x2ec7b9=encryptor[_0x6758('0x32')](_0x47207c[_0x6758('0x33')]);_0x47207c[_0x6758('0x33')]=maskClientSecret(_0x2ec7b9);}return _0x47207c;});return _0x31cad2;})[_0x6758('0x12')](respondWithFilteredResult(_0x1e9d70,_0x2134e7))[_0x6758('0x34')](handleError(_0x1e9d70,null));};exports['show']=function(_0x57eb7d,_0x368eb7){var _0x4499de={'raw':!![],'where':{'id':_0x57eb7d[_0x6758('0x35')]['id']}},_0x405ca5={};_0x405ca5['model']=_[_0x6758('0x1e')](db['CloudProvider'][_0x6758('0x1a')]);_0x405ca5[_0x6758('0x1d')]=_[_0x6758('0x1e')](_0x57eb7d[_0x6758('0x1d')]);_0x405ca5[_0x6758('0x1f')]=_[_0x6758('0x20')](_0x405ca5[_0x6758('0x1c')],_0x405ca5['query']);_0x4499de['attributes']=_[_0x6758('0x20')](_0x405ca5[_0x6758('0x1c')],qs[_0x6758('0x21')](_0x57eb7d[_0x6758('0x1d')]['fields']));_0x4499de[_0x6758('0x22')]=_0x4499de[_0x6758('0x22')]['length']?_0x4499de['attributes']:_0x405ca5[_0x6758('0x1c')];if(_0x57eb7d[_0x6758('0x1d')]['includeAll']){_0x4499de['include']=[{'all':!![]}];}_0x4499de=_['merge']({},_0x4499de,_0x57eb7d['options']);return db[_0x6758('0x19')][_0x6758('0x36')](_0x4499de)[_0x6758('0x12')](handleEntityNotFound(_0x368eb7,null))[_0x6758('0x12')](function(_0x2afbd4){if(_0x2afbd4[_0x6758('0x31')]===_0x6758('0x37')){var _0x46cc7a=encryptor[_0x6758('0x32')](_0x2afbd4[_0x6758('0x33')]);_0x2afbd4['data3']=maskClientSecret(_0x46cc7a);}return _0x2afbd4;})['then'](respondWithResult(_0x368eb7,null))['catch'](handleError(_0x368eb7,null));};exports[_0x6758('0x38')]=function(_0x1a5760,_0x4dea1f){if(!_0x1a5760[_0x6758('0x39')][_0x6758('0x13')])throw new Error(_0x6758('0x3a'));if(!_0x1a5760[_0x6758('0x39')][_0x6758('0x31')])throw new Error(_0x6758('0x3b'));var _0x41c0d6=db[_0x6758('0x19')][_0x6758('0x1a')]['service']['values'];if(!_0x41c0d6[_0x6758('0x3c')](_0x1a5760[_0x6758('0x39')][_0x6758('0x31')]))throw new Error(_0x6758('0x3d')+_0x41c0d6[_0x6758('0x3e')](',\x20'));if(_0x1a5760['body'][_0x6758('0x31')]==='MicrosoftAzure'&&_0x1a5760[_0x6758('0x39')]['data3']){_0x1a5760[_0x6758('0x39')]['data3']=encryptor['encryptString'](_0x1a5760[_0x6758('0x39')]['data3']);}return db[_0x6758('0x19')][_0x6758('0x38')](_0x1a5760['body'],{})[_0x6758('0x12')](respondWithResult(_0x4dea1f,0xc9))[_0x6758('0x34')](handleError(_0x4dea1f,null));};exports[_0x6758('0x3f')]=function(_0x252937,_0x3b5850){if(_0x252937[_0x6758('0x39')]['id']){delete _0x252937[_0x6758('0x39')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x252937[_0x6758('0x35')]['id']}})[_0x6758('0x12')](handleEntityNotFound(_0x3b5850,null))['then'](function(_0x4cdd76){if(_0x4cdd76[_0x6758('0x31')]===_0x6758('0x37')&&_0x252937[_0x6758('0x39')][_0x6758('0x33')]){_0x252937[_0x6758('0x39')][_0x6758('0x33')]=encryptor['encryptString'](_0x252937[_0x6758('0x39')]['data3']);}return _0x4cdd76;})[_0x6758('0x12')](saveUpdates(_0x252937['body'],null))['then'](respondWithResult(_0x3b5850,null))[_0x6758('0x34')](handleError(_0x3b5850,null));};exports[_0x6758('0x40')]=function(_0x41ac59,_0x1c66bc){return db['CloudProvider'][_0x6758('0x36')]({'where':{'id':_0x41ac59[_0x6758('0x35')]['id']}})['then'](handleEntityNotFound(_0x1c66bc,null))[_0x6758('0x12')](removeEntity(_0x1c66bc,null))[_0x6758('0x34')](handleError(_0x1c66bc,null));};exports[_0x6758('0x41')]=function(_0x25fbc6,_0x548ec6){return db[_0x6758('0x19')][_0x6758('0x42')]({'where':{'id':_0x25fbc6[_0x6758('0x35')]['id']},'raw':!![]})[_0x6758('0x12')](function(_0x3f3bac){if(!_0x3f3bac)return _0x548ec6[_0x6758('0x9')](0x194);return{'url':oauth[_0x6758('0x43')](_0x3f3bac,_0x25fbc6[_0x6758('0x44')]['id'])};})['then'](respondWithResult(_0x548ec6,null))[_0x6758('0x34')](handleError(_0x548ec6,null));};exports[_0x6758('0x45')]=function(_0x4dbece,_0xd9dbfd){var _0x560e16=_0x4dbece[_0x6758('0x39')];var _0x14c2f3;var _0x6a412e;if(_0x560e16[_0x6758('0x46')])throw _0x560e16;redis[_0x6758('0x47')](_0x560e16['state'])[_0x6758('0x12')](function(_0x1f451c){if(!_0x1f451c)throw new Error(_0x6758('0x48'));_0x14c2f3=JSON['parse'](_0x1f451c);var _0x3c6885=Buffer[_0x6758('0x49')](_0x560e16[_0x6758('0x4a')],_0x6758('0x4b'))[_0x6758('0x4c')]('ascii');_0x6a412e=JSON['parse'](_0x3c6885);if(!oauth[_0x6758('0x4d')](_0x560e16['id_token'],_0x14c2f3[_0x6758('0x4e')]))throw new Error(_0x6758('0x4f'));redis['del'](_0x560e16[_0x6758('0x4a')]);return oauth[_0x6758('0x50')](_0x560e16[_0x6758('0x51')],_0x14c2f3);})[_0x6758('0x12')](function(_0x29f9bc){_0x14c2f3[_0x6758('0x52')]=_0x29f9bc['access_token'];_0x14c2f3[_0x6758('0x53')]=_0x29f9bc[_0x6758('0x54')];return db[_0x6758('0x19')][_0x6758('0x3f')]({'data5':_0x14c2f3[_0x6758('0x52')],'data6':_0x14c2f3[_0x6758('0x53')]},{'where':{'id':_0x14c2f3['id']}});})[_0x6758('0x12')](function(){oauth[_0x6758('0x55')](_0x14c2f3);socket[_0x6758('0x56')](_0x6758('0x57'),{'id':_0x6a412e['id']});return;})['then'](respondWithStatusCode(_0xd9dbfd,null))[_0x6758('0x34')](function(_0x13d5e6){if(_0x6a412e){socket[_0x6758('0x56')](_0x6758('0x58'),{'id':_0x6a412e['id']});}if(!_0x14c2f3){logger[_0x6758('0x46')](_0x6758('0x59'),_0x13d5e6);return _0xd9dbfd[_0x6758('0xa')](0x1f4)['send'](_0x13d5e6[_0x6758('0x5a')]);}logger[_0x6758('0x46')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x14c2f3['id'],JSON[_0x6758('0x5b')](_0x13d5e6));});};
\ No newline at end of file
+var _0x4daa=['join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','base64','ascii','del','state','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','../../mysqldb','redis','defaults','localhost','end','status','offset','limit','undefined','count','set','update','then','destroy','sendStatus','error','stack','name','send','padEnd','slice','map','CloudProvider','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','params','keys','rawAttributes','include','find','catch','create','body','Name\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'];(function(_0x4d88f6,_0x52f758){var _0x2041c8=function(_0x16f556){while(--_0x16f556){_0x4d88f6['push'](_0x4d88f6['shift']());}};_0x2041c8(++_0x52f758);}(_0x4daa,0xd7));var _0xa4da=function(_0x389cda,_0x31155c){_0x389cda=_0x389cda-0x0;var _0x5889bc=_0x4daa[_0x389cda];return _0x5889bc;};'use strict';var _=require(_0xa4da('0x0'));var Redis=require(_0xa4da('0x1'));var qs=require(_0xa4da('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0xa4da('0x3'));var logger=require(_0xa4da('0x4'))('api');var db=require(_0xa4da('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0xa4da('0x6')]=_[_0xa4da('0x7')](config[_0xa4da('0x6')],{'host':_0xa4da('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4da('0x6')]));var redis=new Redis(config[_0xa4da('0x6')]);function respondWithStatusCode(_0x51930f,_0xe23d45){_0xe23d45=_0xe23d45||0xcc;return function(_0x3e964f){if(_0x3e964f){return _0x51930f['sendStatus'](_0xe23d45);}return _0x51930f['status'](_0xe23d45)[_0xa4da('0x9')]();};}function respondWithResult(_0x49fa26,_0x301f30){_0x301f30=_0x301f30||0xc8;return function(_0x2af756){if(_0x2af756){return _0x49fa26[_0xa4da('0xa')](_0x301f30)['json'](_0x2af756);}};}function respondWithFilteredResult(_0x2d1840,_0x7a64b2){return function(_0x2e4728){if(_0x2e4728){var _0x32bc64=typeof _0x7a64b2[_0xa4da('0xb')]==='undefined'&&typeof _0x7a64b2[_0xa4da('0xc')]===_0xa4da('0xd');var _0x588f0d=_0x2e4728[_0xa4da('0xe')];var _0x344f66=_0x32bc64?0x0:_0x7a64b2[_0xa4da('0xb')];var _0x38c282=_0x32bc64?_0x2e4728['count']:_0x7a64b2['offset']+_0x7a64b2[_0xa4da('0xc')];var _0x5e041e;if(_0x38c282>=_0x588f0d){_0x38c282=_0x588f0d;_0x5e041e=0xc8;}else{_0x5e041e=0xce;}_0x2d1840[_0xa4da('0xa')](_0x5e041e);return _0x2d1840[_0xa4da('0xf')]('Content-Range',_0x344f66+'-'+_0x38c282+'/'+_0x588f0d)['json'](_0x2e4728);}return null;};}function saveUpdates(_0x3dcbca){return function(_0xfdd21b){if(_0xfdd21b){return _0xfdd21b[_0xa4da('0x10')](_0x3dcbca)[_0xa4da('0x11')](function(_0x550aab){return _0x550aab;});}return null;};}function removeEntity(_0x245465){return function(_0x199fbb){if(_0x199fbb){return _0x199fbb[_0xa4da('0x12')]()[_0xa4da('0x11')](function(){_0x245465[_0xa4da('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x176aa1){return function(_0x3ee147){if(!_0x3ee147){_0x176aa1[_0xa4da('0x13')](0x194);}return _0x3ee147;};}function handleError(_0x2a668e,_0x5e845e){_0x5e845e=_0x5e845e||0x1f4;return function(_0x2c9e77){logger[_0xa4da('0x14')](_0x2c9e77[_0xa4da('0x15')]);if(_0x2c9e77[_0xa4da('0x16')]){delete _0x2c9e77[_0xa4da('0x16')];}_0x2a668e[_0xa4da('0xa')](_0x5e845e)[_0xa4da('0x17')](_0x2c9e77);};}function maskClientSecret(_0x56ffe4){return _[_0xa4da('0x18')](_0x56ffe4[_0xa4da('0x19')](0x0,0x3),0x14,'*');}exports['index']=function(_0x4dd4d8,_0x54a764){var _0x23a855={},_0x15f992={},_0x3a3e5d={'count':0x0,'rows':[]};var _0x4e7fcb=_[_0xa4da('0x1a')](db[_0xa4da('0x1b')]['rawAttributes'],function(_0x3180c0){return{'name':_0x3180c0[_0xa4da('0x1c')],'type':_0x3180c0[_0xa4da('0x1d')]['key']};});_0x15f992[_0xa4da('0x1e')]=_['map'](_0x4e7fcb,_0xa4da('0x16'));_0x15f992[_0xa4da('0x1f')]=_['keys'](_0x4dd4d8['query']);_0x15f992[_0xa4da('0x20')]=_[_0xa4da('0x21')](_0x15f992[_0xa4da('0x1e')],_0x15f992[_0xa4da('0x1f')]);_0x23a855[_0xa4da('0x22')]=_[_0xa4da('0x21')](_0x15f992['model'],qs[_0xa4da('0x23')](_0x4dd4d8[_0xa4da('0x1f')][_0xa4da('0x23')]));_0x23a855[_0xa4da('0x22')]=_0x23a855[_0xa4da('0x22')][_0xa4da('0x24')]?_0x23a855[_0xa4da('0x22')]:_0x15f992[_0xa4da('0x1e')];if(!_0x4dd4d8['query'][_0xa4da('0x25')](_0xa4da('0x26'))){_0x23a855[_0xa4da('0xc')]=qs[_0xa4da('0xc')](_0x4dd4d8[_0xa4da('0x1f')]['limit']);_0x23a855[_0xa4da('0xb')]=qs[_0xa4da('0xb')](_0x4dd4d8[_0xa4da('0x1f')][_0xa4da('0xb')]);}_0x23a855[_0xa4da('0x27')]=qs[_0xa4da('0x28')](_0x4dd4d8[_0xa4da('0x1f')][_0xa4da('0x28')]);_0x23a855['where']=qs['filters'](_[_0xa4da('0x29')](_0x4dd4d8[_0xa4da('0x1f')],_0x15f992['filters']),_0x4e7fcb);if(_0x4dd4d8['query'][_0xa4da('0x2a')]){_0x23a855[_0xa4da('0x2b')]=_[_0xa4da('0x2c')](_0x23a855[_0xa4da('0x2b')],{'$or':_[_0xa4da('0x1a')](_0x4e7fcb,function(_0x57a168){if(_0x57a168[_0xa4da('0x1d')]!==_0xa4da('0x2d')){var _0x3f1239={};_0x3f1239[_0x57a168[_0xa4da('0x16')]]={'$like':'%'+_0x4dd4d8[_0xa4da('0x1f')][_0xa4da('0x2a')]+'%'};return _0x3f1239;}})});}_0x23a855=_[_0xa4da('0x2c')]({},_0x23a855,_0x4dd4d8[_0xa4da('0x2e')]);var _0x18c8e6={'where':_0x23a855[_0xa4da('0x2b')]};return db[_0xa4da('0x1b')]['count'](_0x18c8e6)[_0xa4da('0x11')](function(_0x10be09){_0x3a3e5d['count']=_0x10be09;if(_0x4dd4d8['query'][_0xa4da('0x2f')]){_0x23a855['include']=[{'all':!![]}];}return db[_0xa4da('0x1b')][_0xa4da('0x30')](_0x23a855);})[_0xa4da('0x11')](function(_0x150d38){_0x3a3e5d[_0xa4da('0x31')]=_['map'](_0x150d38,function(_0xacecde){if(_0xacecde[_0xa4da('0x32')]===_0xa4da('0x33')){var _0x4a89d4=encryptor[_0xa4da('0x34')](_0xacecde[_0xa4da('0x35')]);_0xacecde[_0xa4da('0x35')]=maskClientSecret(_0x4a89d4);}return _0xacecde;});return _0x3a3e5d;})[_0xa4da('0x11')](respondWithFilteredResult(_0x54a764,_0x23a855))['catch'](handleError(_0x54a764,null));};exports[_0xa4da('0x36')]=function(_0x343098,_0x193b72){var _0x4ef36a={'raw':!![],'where':{'id':_0x343098[_0xa4da('0x37')]['id']}},_0x57492c={};_0x57492c[_0xa4da('0x1e')]=_[_0xa4da('0x38')](db['CloudProvider'][_0xa4da('0x39')]);_0x57492c['query']=_['keys'](_0x343098[_0xa4da('0x1f')]);_0x57492c[_0xa4da('0x20')]=_[_0xa4da('0x21')](_0x57492c[_0xa4da('0x1e')],_0x57492c[_0xa4da('0x1f')]);_0x4ef36a[_0xa4da('0x22')]=_[_0xa4da('0x21')](_0x57492c[_0xa4da('0x1e')],qs['fields'](_0x343098[_0xa4da('0x1f')]['fields']));_0x4ef36a[_0xa4da('0x22')]=_0x4ef36a[_0xa4da('0x22')]['length']?_0x4ef36a[_0xa4da('0x22')]:_0x57492c[_0xa4da('0x1e')];if(_0x343098['query']['includeAll']){_0x4ef36a[_0xa4da('0x3a')]=[{'all':!![]}];}_0x4ef36a=_[_0xa4da('0x2c')]({},_0x4ef36a,_0x343098[_0xa4da('0x2e')]);return db[_0xa4da('0x1b')][_0xa4da('0x3b')](_0x4ef36a)['then'](handleEntityNotFound(_0x193b72,null))['then'](function(_0x3a2d64){if(_0x3a2d64[_0xa4da('0x32')]===_0xa4da('0x33')){var _0x2c3cdd=encryptor[_0xa4da('0x34')](_0x3a2d64['data3']);_0x3a2d64[_0xa4da('0x35')]=maskClientSecret(_0x2c3cdd);}return _0x3a2d64;})[_0xa4da('0x11')](respondWithResult(_0x193b72,null))[_0xa4da('0x3c')](handleError(_0x193b72,null));};exports[_0xa4da('0x3d')]=function(_0x1fa6e1,_0x3ce0be){if(!_0x1fa6e1[_0xa4da('0x3e')][_0xa4da('0x16')])throw new Error(_0xa4da('0x3f'));if(!_0x1fa6e1['body'][_0xa4da('0x32')])throw new Error('Service\x20parameter\x20not\x20specified');var _0xe4265=db['CloudProvider'][_0xa4da('0x39')][_0xa4da('0x32')][_0xa4da('0x40')];if(!_0xe4265[_0xa4da('0x41')](_0x1fa6e1[_0xa4da('0x3e')][_0xa4da('0x32')]))throw new Error(_0xa4da('0x42')+_0xe4265[_0xa4da('0x43')](',\x20'));if(_0x1fa6e1[_0xa4da('0x3e')][_0xa4da('0x32')]==='MicrosoftAzure'&&_0x1fa6e1[_0xa4da('0x3e')][_0xa4da('0x35')]){_0x1fa6e1[_0xa4da('0x3e')]['data3']=encryptor[_0xa4da('0x44')](_0x1fa6e1[_0xa4da('0x3e')][_0xa4da('0x35')]);}return db[_0xa4da('0x1b')]['create'](_0x1fa6e1[_0xa4da('0x3e')],{})[_0xa4da('0x11')](respondWithResult(_0x3ce0be,0xc9))[_0xa4da('0x3c')](handleError(_0x3ce0be,null));};exports['update']=function(_0x32407a,_0x23495b){if(_0x32407a[_0xa4da('0x3e')]['id']){delete _0x32407a[_0xa4da('0x3e')]['id'];}return db[_0xa4da('0x1b')][_0xa4da('0x3b')]({'where':{'id':_0x32407a[_0xa4da('0x37')]['id']}})[_0xa4da('0x11')](handleEntityNotFound(_0x23495b,null))[_0xa4da('0x11')](function(_0xc78927){if(_0xc78927[_0xa4da('0x32')]==='MicrosoftAzure'&&_0x32407a[_0xa4da('0x3e')]['data3']){_0x32407a[_0xa4da('0x3e')]['data3']=encryptor[_0xa4da('0x44')](_0x32407a[_0xa4da('0x3e')]['data3']);}return _0xc78927;})[_0xa4da('0x11')](saveUpdates(_0x32407a[_0xa4da('0x3e')],null))[_0xa4da('0x11')](respondWithResult(_0x23495b,null))[_0xa4da('0x3c')](handleError(_0x23495b,null));};exports[_0xa4da('0x12')]=function(_0x27dab2,_0x3b5c36){return db['CloudProvider'][_0xa4da('0x3b')]({'where':{'id':_0x27dab2[_0xa4da('0x37')]['id']}})[_0xa4da('0x11')](handleEntityNotFound(_0x3b5c36,null))[_0xa4da('0x11')](removeEntity(_0x3b5c36,null))[_0xa4da('0x3c')](handleError(_0x3b5c36,null));};exports[_0xa4da('0x45')]=function(_0x57b7a0,_0x2b32f3){return db[_0xa4da('0x1b')][_0xa4da('0x46')]({'where':{'id':_0x57b7a0[_0xa4da('0x37')]['id']},'raw':!![]})[_0xa4da('0x11')](function(_0x59de18){if(!_0x59de18)return _0x2b32f3[_0xa4da('0x13')](0x194);return{'url':oauth[_0xa4da('0x47')](_0x59de18,_0x57b7a0[_0xa4da('0x48')]['id'])};})[_0xa4da('0x11')](respondWithResult(_0x2b32f3,null))[_0xa4da('0x3c')](handleError(_0x2b32f3,null));};exports[_0xa4da('0x49')]=function(_0x3f85ed,_0xcd254d){var _0x32b119=_0x3f85ed[_0xa4da('0x3e')];var _0x3e05cb;var _0x5a0d0b;if(_0x32b119[_0xa4da('0x14')])throw _0x32b119;redis[_0xa4da('0x4a')](_0x32b119['state'])[_0xa4da('0x11')](function(_0x2031eb){if(!_0x2031eb)throw new Error(_0xa4da('0x4b'));_0x3e05cb=JSON[_0xa4da('0x4c')](_0x2031eb);var _0x1c313d=Buffer[_0xa4da('0x4d')](_0x32b119['state'],_0xa4da('0x4e'))['toString'](_0xa4da('0x4f'));_0x5a0d0b=JSON[_0xa4da('0x4c')](_0x1c313d);if(!oauth['isValidIdToken'](_0x32b119['id_token'],_0x3e05cb['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xa4da('0x50')](_0x32b119[_0xa4da('0x51')]);return oauth[_0xa4da('0x52')](_0x32b119[_0xa4da('0x53')],_0x3e05cb);})[_0xa4da('0x11')](function(_0x1be52b){_0x3e05cb[_0xa4da('0x54')]=_0x1be52b[_0xa4da('0x55')];_0x3e05cb['data6']=_0x1be52b[_0xa4da('0x56')];return db['CloudProvider'][_0xa4da('0x10')]({'data5':_0x3e05cb['data5'],'data6':_0x3e05cb[_0xa4da('0x57')]},{'where':{'id':_0x3e05cb['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x3e05cb);socket[_0xa4da('0x58')]('microsoftAuthorization:success',{'id':_0x5a0d0b['id']});return;})['then'](respondWithStatusCode(_0xcd254d,null))[_0xa4da('0x3c')](function(_0x1af8de){if(_0x5a0d0b){socket[_0xa4da('0x58')](_0xa4da('0x59'),{'id':_0x5a0d0b['id']});}if(!_0x3e05cb){logger[_0xa4da('0x14')](_0xa4da('0x5a'),_0x1af8de);return _0xcd254d['status'](0x1f4)['send'](_0x1af8de[_0xa4da('0x5b')]);}logger[_0xa4da('0x14')](_0xa4da('0x5c'),_0x3e05cb['id'],JSON[_0xa4da('0x5d')](_0x1af8de));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 84f2a3a..f905e5c 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 _0x62ab=['exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cloudProvider.attributes'];(function(_0x3d38ae,_0x51102b){var _0x3757ee=function(_0x22bac8){while(--_0x22bac8){_0x3d38ae['push'](_0x3d38ae['shift']());}};_0x3757ee(++_0x51102b);}(_0x62ab,0xd6));var _0xb62a=function(_0x2c8ab8,_0xb3663e){_0x2c8ab8=_0x2c8ab8-0x0;var _0x1bcbe3=_0x62ab[_0x2c8ab8];return _0x1bcbe3;};'use strict';var _=require(_0xb62a('0x0'));var util=require(_0xb62a('0x1'));var logger=require(_0xb62a('0x2'))(_0xb62a('0x3'));var moment=require(_0xb62a('0x4'));var BPromise=require(_0xb62a('0x5'));var rp=require(_0xb62a('0x6'));var fs=require('fs');var path=require(_0xb62a('0x7'));var rimraf=require(_0xb62a('0x8'));var config=require('../../config/environment');var attributes=require(_0xb62a('0x9'));module[_0xb62a('0xa')]=function(_0x48d711,_0x61ed74){return _0x48d711[_0xb62a('0xb')](_0xb62a('0xc'),attributes,{'tableName':_0xb62a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2e35=['rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x17d64d,_0x327d53){var _0x17eb46=function(_0x89f708){while(--_0x89f708){_0x17d64d['push'](_0x17d64d['shift']());}};_0x17eb46(++_0x327d53);}(_0x2e35,0xe6));var _0x52e3=function(_0x561913,_0x2f3c72){_0x561913=_0x561913-0x0;var _0x23487f=_0x2e35[_0x561913];return _0x23487f;};'use strict';var _=require(_0x52e3('0x0'));var util=require(_0x52e3('0x1'));var logger=require(_0x52e3('0x2'))(_0x52e3('0x3'));var moment=require(_0x52e3('0x4'));var BPromise=require(_0x52e3('0x5'));var rp=require(_0x52e3('0x6'));var fs=require('fs');var path=require(_0x52e3('0x7'));var rimraf=require(_0x52e3('0x8'));var config=require(_0x52e3('0x9'));var attributes=require(_0x52e3('0xa'));module['exports']=function(_0x2c2a04,_0x55326f){return _0x2c2a04[_0x52e3('0xb')](_0x52e3('0xc'),attributes,{'tableName':_0x52e3('0xd'),'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 489848f..d57eff4 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 _0x8d6b=['https://outlook.office.com/POP.AccessAsUser.All','/authorize','type','Dynamics365','data7','/.default','join','Outlook365','{TENANT_ID}','data2','id_token','stringify','toString','hex','client_id','data1','response_type','redirect_uri','form_post','state','nonce','prompt','map','key','value','replace','set','iss','issuer','aud','audience','isAfter','unix','exp','data3','CloudProvider','findOne','then','data6','data4','POST','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','bind','intervals','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','util','../../components/encryptor','../../config/environment','../../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'];(function(_0x739bf5,_0x50002d){var _0x36510b=function(_0x210c62){while(--_0x210c62){_0x739bf5['push'](_0x739bf5['shift']());}};_0x36510b(++_0x50002d);}(_0x8d6b,0x1a4));var _0xb8d6=function(_0x3f9e3a,_0x524ef1){_0x3f9e3a=_0x3f9e3a-0x0;var _0xd1c420=_0x8d6b[_0x3f9e3a];return _0xd1c420;};'use strict';var _=require(_0xb8d6('0x0'));var crypto=require('crypto');var jwt=require(_0xb8d6('0x1'));var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0xb8d6('0x2'));var encryptor=require(_0xb8d6('0x3'));var config=require(_0xb8d6('0x4'));var logger=require(_0xb8d6('0x5'))(_0xb8d6('0x6'));var schedule=require(_0xb8d6('0x7'));var db=require(_0xb8d6('0x8'))['db'];config[_0xb8d6('0x9')]=_[_0xb8d6('0xa')](config[_0xb8d6('0x9')],{'host':_0xb8d6('0xb'),'port':0x18eb});var redis=new Redis(config[_0xb8d6('0x9')]);var MICROSOFT_AUTH_URL=_0xb8d6('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xb8d6('0xd'),_0xb8d6('0xe'),_0xb8d6('0xf'),_0xb8d6('0x10'),_0xb8d6('0x11'),_0xb8d6('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xb8d6('0xd'),_0xb8d6('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0xb8d6('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x431463){var _0x380cd5=_['map'](AZURE_AUTH_SCOPES[_0x431463[_0xb8d6('0x14')]]);if(_0x431463[_0xb8d6('0x14')]===_0xb8d6('0x15'))_0x380cd5['push'](_0x431463[_0xb8d6('0x16')]+_0xb8d6('0x17'));return _0x380cd5[_0xb8d6('0x18')]('\x20');}function getAccessTokenScope(_0x172434){if(_0x172434[_0xb8d6('0x14')]===_0xb8d6('0x19'))return _0xb8d6('0x11');if(_0x172434[_0xb8d6('0x14')]===_0xb8d6('0x15'))return _0x172434[_0xb8d6('0x16')]+_0xb8d6('0x17');}function generateMicrosoftAuthorizationUrl(_0x3bf2ec,_0x2963f1){var _0x42e286=MICROSOFT_AUTH_URL['replace'](_0xb8d6('0x1a'),_0x3bf2ec[_0xb8d6('0x1b')]);var _0x1f8739=['code',_0xb8d6('0x1c')];var _0x48e7e2=Buffer['from'](JSON[_0xb8d6('0x1d')]({'id':_0x2963f1}))['toString']('base64');var _0x4b38c7=crypto['randomBytes'](0x10)[_0xb8d6('0x1e')](_0xb8d6('0x1f'));var _0x278dd5=getAuthorizationScopes(_0x3bf2ec);var _0x1c643c=[{'key':_0xb8d6('0x20'),'value':_0x3bf2ec[_0xb8d6('0x21')]},{'key':_0xb8d6('0x22'),'value':encodeURIComponent(_0x1f8739[_0xb8d6('0x18')]('\x20'))},{'key':_0xb8d6('0x23'),'value':_0x3bf2ec['data4']},{'key':'response_mode','value':_0xb8d6('0x24')},{'key':'scope','value':encodeURIComponent(_0x278dd5)},{'key':_0xb8d6('0x25'),'value':_0x48e7e2},{'key':_0xb8d6('0x26'),'value':_0x4b38c7},{'key':_0xb8d6('0x27'),'value':'login'}];var _0x4bea7b=_0x42e286+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb8d6('0x28')](_0x1c643c,function(_0x17d751){return _0x17d751[_0xb8d6('0x29')]+'='+_0x17d751[_0xb8d6('0x2a')];})[_0xb8d6('0x18')]('&');_0x3bf2ec['oauth2Claims']={'issuer':_0x42e286[_0xb8d6('0x2b')]('oauth2/',''),'audience':_0x3bf2ec[_0xb8d6('0x21')],'state':_0x48e7e2,'nonce':_0x4b38c7};redis[_0xb8d6('0x2c')](_0x48e7e2,JSON[_0xb8d6('0x1d')](_0x3bf2ec));return _0x4bea7b;}function isValidIdToken(_0x88c3a1,_0x3080dc){try{var _0x56f77a=jwt['decode'](_0x88c3a1,{'complete':!![]});var _0x40e12b=_0x56f77a['payload'];if(_0x40e12b[_0xb8d6('0x2d')]!==_0x3080dc[_0xb8d6('0x2e')])return![];if(_0x40e12b[_0xb8d6('0x2f')]!==_0x3080dc[_0xb8d6('0x30')])return![];if(_0x40e12b['nonce']!==_0x3080dc[_0xb8d6('0x26')])return![];if(moment()[_0xb8d6('0x31')](moment[_0xb8d6('0x32')](_0x40e12b[_0xb8d6('0x33')])))return![];return!![];}catch(_0x51d7cb){throw _0x51d7cb;}}function refreshOauth2MicrosoftAccessToken(_0x3f3ee0){return Promise['resolve']()['then'](function(){if(_0x3f3ee0[_0xb8d6('0x34')])return _0x3f3ee0;return db[_0xb8d6('0x35')][_0xb8d6('0x36')]({'where':{'id':_0x3f3ee0['id']},'raw':!![]});})[_0xb8d6('0x37')](function(_0x2f16fc){var _0x5bebc1={'grant_type':'refresh_token','refresh_token':_0x2f16fc[_0xb8d6('0x38')],'scope':getAccessTokenScope(_0x2f16fc),'redirect_uri':_0x2f16fc[_0xb8d6('0x39')],'client_id':_0x2f16fc[_0xb8d6('0x21')],'client_secret':encryptor['decryptString'](_0x2f16fc[_0xb8d6('0x34')])};var _0x167dca={'method':_0xb8d6('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xb8d6('0x2b')](_0xb8d6('0x1a'),_0x2f16fc['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5bebc1,'json':!![]};return rp(_0x167dca);})[_0xb8d6('0x37')](function(_0x47e367){_0x3f3ee0[_0xb8d6('0x3b')]=_0x47e367[_0xb8d6('0x3c')];_0x3f3ee0[_0xb8d6('0x38')]=_0x47e367['refresh_token'];return db['CloudProvider'][_0xb8d6('0x3d')]({'data5':_0x3f3ee0['data5'],'data6':_0x3f3ee0[_0xb8d6('0x38')]},{'where':{'id':_0x3f3ee0['id']}});})[_0xb8d6('0x37')](function(){return _0x3f3ee0;})[_0xb8d6('0x3e')](function(_0x3e0e6e){logger[_0xb8d6('0x3f')](_0xb8d6('0x40'),_0x3f3ee0['id'],_0x3e0e6e);});}function getOauth2MicrosoftAccessToken(_0xd17c4,_0x199fd8){var _0x2e8dc2={'grant_type':_0xb8d6('0x41'),'code':_0xd17c4,'scope':getAccessTokenScope(_0x199fd8),'redirect_uri':_0x199fd8[_0xb8d6('0x39')],'client_id':_0x199fd8[_0xb8d6('0x21')],'client_secret':encryptor[_0xb8d6('0x42')](_0x199fd8[_0xb8d6('0x34')])};var _0xf341bc={'method':_0xb8d6('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xb8d6('0x2b')](_0xb8d6('0x1a'),_0x199fd8[_0xb8d6('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2e8dc2,'json':!![]};return rp(_0xf341bc);}function startRefreshInterval(_0x56f827){var _0x310758=schedule['intervals'];if(_0x310758[_0x56f827['id']])clearInterval(_0x310758[_0x56f827['id']]);_0x310758[_0x56f827['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xb8d6('0x43')](this,{'id':_0x56f827['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xb8d6('0x44')]=_0x310758;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xb8d6('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x18aa20){var _0x4cb686=_0x18aa20[_0xb8d6('0x28')](function(_0x19f94d){return refreshOauth2MicrosoftAccessToken(_0x19f94d)[_0xb8d6('0x37')](function(_0x462641){startRefreshInterval(_0x462641);});});return Promise[_0xb8d6('0x46')](_0x4cb686);})[_0xb8d6('0x3e')](function(_0x3e6a1c){var _0x333195=_0x3e6a1c?util['inspect'](_0x3e6a1c,{'showHidden':![],'depth':null}):'';logger[_0xb8d6('0x3f')](_0xb8d6('0x47'),_0x333195);});}module[_0xb8d6('0x48')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x0433=['hex','client_id','response_type','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','replace','oauth2/','data1','set','decode','payload','issuer','aud','audience','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','data4','decryptString','data3','data2','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','inspect','exports','lodash','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','api','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','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','Outlook365','{TENANT_ID}','id_token','from','stringify','base64','randomBytes'];(function(_0x420ab0,_0x500c31){var _0x5b29dd=function(_0x48dab0){while(--_0x48dab0){_0x420ab0['push'](_0x420ab0['shift']());}};_0x5b29dd(++_0x500c31);}(_0x0433,0xd5));var _0x3043=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x0433[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0x3043('0x0'));var crypto=require('crypto');var jwt=require(_0x3043('0x1'));var moment=require(_0x3043('0x2'));var Redis=require(_0x3043('0x3'));var rp=require(_0x3043('0x4'));var util=require(_0x3043('0x5'));var encryptor=require(_0x3043('0x6'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x3043('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x3043('0x8'))['db'];config[_0x3043('0x9')]=_[_0x3043('0xa')](config[_0x3043('0x9')],{'host':_0x3043('0xb'),'port':0x18eb});var redis=new Redis(config[_0x3043('0x9')]);var MICROSOFT_AUTH_URL=_0x3043('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x3043('0xd'),'profile','email',_0x3043('0xe'),_0x3043('0xf'),_0x3043('0x10'),_0x3043('0x11')],'Dynamics365':[_0x3043('0xd'),_0x3043('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x3043('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x3043('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x841923){var _0x2ca88e=_[_0x3043('0x14')](AZURE_AUTH_SCOPES[_0x841923[_0x3043('0x15')]]);if(_0x841923['type']===_0x3043('0x16'))_0x2ca88e[_0x3043('0x17')](_0x841923['data7']+_0x3043('0x18'));return _0x2ca88e[_0x3043('0x19')]('\x20');}function getAccessTokenScope(_0xda3a23){if(_0xda3a23[_0x3043('0x15')]===_0x3043('0x1a'))return _0x3043('0xf');if(_0xda3a23[_0x3043('0x15')]===_0x3043('0x16'))return _0xda3a23['data7']+_0x3043('0x18');}function generateMicrosoftAuthorizationUrl(_0x7c3a66,_0x26e90e){var _0x4d3568=MICROSOFT_AUTH_URL['replace'](_0x3043('0x1b'),_0x7c3a66['data2']);var _0x27c23e=['code',_0x3043('0x1c')];var _0x1b74b6=Buffer[_0x3043('0x1d')](JSON[_0x3043('0x1e')]({'id':_0x26e90e}))['toString'](_0x3043('0x1f'));var _0x1dc9cf=crypto[_0x3043('0x20')](0x10)['toString'](_0x3043('0x21'));var _0xc49a70=getAuthorizationScopes(_0x7c3a66);var _0x4e226c=[{'key':_0x3043('0x22'),'value':_0x7c3a66['data1']},{'key':_0x3043('0x23'),'value':encodeURIComponent(_0x27c23e[_0x3043('0x19')]('\x20'))},{'key':_0x3043('0x24'),'value':_0x7c3a66['data4']},{'key':_0x3043('0x25'),'value':_0x3043('0x26')},{'key':_0x3043('0x27'),'value':encodeURIComponent(_0xc49a70)},{'key':_0x3043('0x28'),'value':_0x1b74b6},{'key':_0x3043('0x29'),'value':_0x1dc9cf},{'key':_0x3043('0x2a'),'value':_0x3043('0x2b')}];var _0x1aef41=_0x4d3568+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x4e226c,function(_0x1f395d){return _0x1f395d[_0x3043('0x2c')]+'='+_0x1f395d[_0x3043('0x2d')];})[_0x3043('0x19')]('&');_0x7c3a66[_0x3043('0x2e')]={'issuer':_0x4d3568[_0x3043('0x2f')](_0x3043('0x30'),''),'audience':_0x7c3a66[_0x3043('0x31')],'state':_0x1b74b6,'nonce':_0x1dc9cf};redis[_0x3043('0x32')](_0x1b74b6,JSON[_0x3043('0x1e')](_0x7c3a66));return _0x1aef41;}function isValidIdToken(_0x1b0220,_0x26d0d9){try{var _0x3d66ea=jwt[_0x3043('0x33')](_0x1b0220,{'complete':!![]});var _0x24c081=_0x3d66ea[_0x3043('0x34')];if(_0x24c081['iss']!==_0x26d0d9[_0x3043('0x35')])return![];if(_0x24c081[_0x3043('0x36')]!==_0x26d0d9[_0x3043('0x37')])return![];if(_0x24c081[_0x3043('0x29')]!==_0x26d0d9[_0x3043('0x29')])return![];if(moment()['isAfter'](moment[_0x3043('0x38')](_0x24c081[_0x3043('0x39')])))return![];return!![];}catch(_0x4972bb){throw _0x4972bb;}}function refreshOauth2MicrosoftAccessToken(_0x3466e7){return Promise[_0x3043('0x3a')]()[_0x3043('0x3b')](function(){if(_0x3466e7['data3'])return _0x3466e7;return db[_0x3043('0x3c')][_0x3043('0x3d')]({'where':{'id':_0x3466e7['id']},'raw':!![]});})[_0x3043('0x3b')](function(_0x2c3dce){var _0xe78a2={'grant_type':_0x3043('0x3e'),'refresh_token':_0x2c3dce[_0x3043('0x3f')],'scope':getAccessTokenScope(_0x2c3dce),'redirect_uri':_0x2c3dce[_0x3043('0x40')],'client_id':_0x2c3dce['data1'],'client_secret':encryptor[_0x3043('0x41')](_0x2c3dce[_0x3043('0x42')])};var _0x342c90={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x3043('0x1b'),_0x2c3dce[_0x3043('0x43')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xe78a2,'json':!![]};return rp(_0x342c90);})[_0x3043('0x3b')](function(_0x12581c){_0x3466e7[_0x3043('0x44')]=_0x12581c[_0x3043('0x45')];_0x3466e7[_0x3043('0x3f')]=_0x12581c[_0x3043('0x3e')];return db[_0x3043('0x3c')][_0x3043('0x46')]({'data5':_0x3466e7[_0x3043('0x44')],'data6':_0x3466e7[_0x3043('0x3f')]},{'where':{'id':_0x3466e7['id']}});})[_0x3043('0x3b')](function(){return _0x3466e7;})[_0x3043('0x47')](function(_0x318de2){logger[_0x3043('0x48')](_0x3043('0x49'),_0x3466e7['id'],_0x318de2);});}function getOauth2MicrosoftAccessToken(_0x4e98d1,_0xb75226){var _0x33bfbd={'grant_type':_0x3043('0x4a'),'code':_0x4e98d1,'scope':getAccessTokenScope(_0xb75226),'redirect_uri':_0xb75226[_0x3043('0x40')],'client_id':_0xb75226[_0x3043('0x31')],'client_secret':encryptor['decryptString'](_0xb75226[_0x3043('0x42')])};var _0x105f89={'method':_0x3043('0x4b'),'uri':MICROSOFT_AUTH_URL['replace'](_0x3043('0x1b'),_0xb75226[_0x3043('0x43')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x33bfbd,'json':!![]};return rp(_0x105f89);}function startRefreshInterval(_0x13326f){var _0x46a3f3=schedule[_0x3043('0x4c')];if(_0x46a3f3[_0x13326f['id']])clearInterval(_0x46a3f3[_0x13326f['id']]);_0x46a3f3[_0x13326f['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x3043('0x4d')](this,{'id':_0x13326f['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x3043('0x4c')]=_0x46a3f3;}function startAllRefreshIntervals(){return db[_0x3043('0x3c')][_0x3043('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x3043('0x3b')](function(_0x278744){var _0x73221f=_0x278744[_0x3043('0x14')](function(_0x3c865e){return refreshOauth2MicrosoftAccessToken(_0x3c865e)['then'](function(_0x55b145){startRefreshInterval(_0x55b145);});});return Promise[_0x3043('0x4f')](_0x73221f);})[_0x3043('0x47')](function(_0x36ac9c){var _0x152e5a=_0x36ac9c?util[_0x3043('0x50')](_0x36ac9c,{'showHidden':![],'depth':null}):'';logger['error']('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x152e5a);});}module[_0x3043('0x51')]={'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 6d4668a..7240584 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 _0x6ac2=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6ac2,0x184));var _0x26ac=function(_0x34d0e2,_0x5af29d){_0x34d0e2=_0x34d0e2-0x0;var _0x47004f=_0x6ac2[_0x34d0e2];return _0x47004f;};'use strict';var _=require(_0x26ac('0x0'));var util=require('util');var moment=require(_0x26ac('0x1'));var BPromise=require(_0x26ac('0x2'));var rs=require(_0x26ac('0x3'));var fs=require('fs');var Redis=require(_0x26ac('0x4'));var db=require(_0x26ac('0x5'))['db'];var utils=require(_0x26ac('0x6'));var logger=require('../../config/logger')(_0x26ac('0x7'));var config=require('../../config/environment');var jayson=require(_0x26ac('0x8'));var client=jayson[_0x26ac('0x9')][_0x26ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x159ba6,_0x36389c,_0x444ca1){return new BPromise(function(_0x1906d0,_0xd8b1e5){return client['request'](_0x159ba6,_0x444ca1)['then'](function(_0x27ff15){logger[_0x26ac('0xb')](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));logger['debug'](_0x26ac('0xe'),_0x36389c,_0x26ac('0xd'),JSON[_0x26ac('0xf')](_0x27ff15));if(_0x27ff15[_0x26ac('0x10')]){if(_0x27ff15['error']['code']===0x1f4){logger[_0x26ac('0x10')](_0x26ac('0xc'),_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0xd8b1e5(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}logger[_0x26ac('0x10')]('CloudProvider,\x20%s,\x20%s',_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0x1906d0(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}else{logger['info'](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));_0x1906d0(_0x27ff15['result'][_0x26ac('0x11')]);}})[_0x26ac('0x12')](function(_0x3b7c5d){logger[_0x26ac('0x10')]('CloudProvider,\x20%s,\x20%s',_0x36389c,_0x3b7c5d);_0xd8b1e5(_0x3b7c5d);});});}
\ No newline at end of file
+var _0xb511=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x263c58,_0x252bb8){var _0x5232aa=function(_0x25febe){while(--_0x25febe){_0x263c58['push'](_0x263c58['shift']());}};_0x5232aa(++_0x252bb8);}(_0xb511,0x165));var _0x1b51=function(_0x182192,_0x28f6fa){_0x182192=_0x182192-0x0;var _0x1a1293=_0xb511[_0x182192];return _0x1a1293;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var moment=require(_0x1b51('0x2'));var BPromise=require('bluebird');var rs=require(_0x1b51('0x3'));var fs=require('fs');var Redis=require(_0x1b51('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b51('0x5'));var logger=require(_0x1b51('0x6'))(_0x1b51('0x7'));var config=require('../../config/environment');var jayson=require(_0x1b51('0x8'));var client=jayson[_0x1b51('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x475add,_0x43c14c,_0x5e7ece){return new BPromise(function(_0xfa46a3,_0x1690c9){return client[_0x1b51('0xa')](_0x475add,_0x5e7ece)[_0x1b51('0xb')](function(_0x3ceabe){logger[_0x1b51('0xc')](_0x1b51('0xd'),_0x43c14c,_0x1b51('0xe'));logger['debug'](_0x1b51('0xf'),_0x43c14c,_0x1b51('0xe'),JSON[_0x1b51('0x10')](_0x3ceabe));if(_0x3ceabe[_0x1b51('0x11')]){if(_0x3ceabe[_0x1b51('0x11')][_0x1b51('0x12')]===0x1f4){logger['error'](_0x1b51('0xd'),_0x43c14c,_0x3ceabe[_0x1b51('0x11')][_0x1b51('0x13')]);return _0x1690c9(_0x3ceabe[_0x1b51('0x11')][_0x1b51('0x13')]);}logger[_0x1b51('0x11')](_0x1b51('0xd'),_0x43c14c,_0x3ceabe['error'][_0x1b51('0x13')]);return _0xfa46a3(_0x3ceabe['error']['message']);}else{logger[_0x1b51('0xc')](_0x1b51('0xd'),_0x43c14c,'request\x20sent');_0xfa46a3(_0x3ceabe[_0x1b51('0x14')][_0x1b51('0x13')]);}})[_0x1b51('0x15')](function(_0x4ea5e3){logger[_0x1b51('0x11')](_0x1b51('0xd'),_0x43c14c,_0x4ea5e3);_0x1690c9(_0x4ea5e3);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 7a07dc0..24a6f9b 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 _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x271fe0,_0x2b0c22){var _0x318b44=function(_0x7c8214){while(--_0x7c8214){_0x271fe0['push'](_0x271fe0['shift']());}};_0x318b44(++_0x2b0c22);}(_0xadb5,0xad));var _0x5adb=function(_0x4e17a8,_0x204391){_0x4e17a8=_0x4e17a8-0x0;var _0x4a53c2=_0xadb5[_0x4e17a8];return _0x4a53c2;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
+var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x4b8f43,_0x2534d2){var _0x39d806=function(_0x38490d){while(--_0x38490d){_0x4b8f43['push'](_0x4b8f43['shift']());}};_0x39d806(++_0x2534d2);}(_0xdb28,0x106));var _0x8db2=function(_0xd97d1f,_0xc5377f){_0xd97d1f=_0xd97d1f-0x0;var _0x57cd28=_0xdb28[_0xd97d1f];return _0x57cd28;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 0901a09..8a4ceea 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 _0x2aff=['STRING','name','exports'];(function(_0x265b59,_0x42b00e){var _0x5d81b9=function(_0x17445f){while(--_0x17445f){_0x265b59['push'](_0x265b59['shift']());}};_0x5d81b9(++_0x42b00e);}(_0x2aff,0x6b));var _0xf2af=function(_0x14adfc,_0x2f05fa){_0x14adfc=_0x14adfc-0x0;var _0x384191=_0x2aff[_0x14adfc];return _0x384191;};'use strict';var Sequelize=require('sequelize');module[_0xf2af('0x0')]={'name':{'type':Sequelize[_0xf2af('0x1')],'unique':_0xf2af('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf2af('0x1')]},'companyId':{'type':Sequelize[_0xf2af('0x1')]},'website':{'type':Sequelize[_0xf2af('0x1')]},'phone':{'type':Sequelize[_0xf2af('0x1')]},'fax':{'type':Sequelize[_0xf2af('0x1')]},'type':{'type':Sequelize[_0xf2af('0x1')]},'street':{'type':Sequelize[_0xf2af('0x1')]},'postalCode':{'type':Sequelize[_0xf2af('0x1')]},'city':{'type':Sequelize[_0xf2af('0x1')]},'country':{'type':Sequelize[_0xf2af('0x1')]},'email':{'type':Sequelize[_0xf2af('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf2af('0x1')]},'sStreet':{'type':Sequelize[_0xf2af('0x1')]},'sPostalCode':{'type':Sequelize[_0xf2af('0x1')]},'sCity':{'type':Sequelize[_0xf2af('0x1')]},'sCountry':{'type':Sequelize[_0xf2af('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3687=['STRING','name','sequelize'];(function(_0x251300,_0x26dc28){var _0xbe458=function(_0x1b73c8){while(--_0x1b73c8){_0x251300['push'](_0x251300['shift']());}};_0xbe458(++_0x26dc28);}(_0x3687,0x188));var _0x7368=function(_0x10dc3a,_0x274aa8){_0x10dc3a=_0x10dc3a-0x0;var _0x66550b=_0x3687[_0x10dc3a];return _0x66550b;};'use strict';var Sequelize=require(_0x7368('0x0'));module['exports']={'name':{'type':Sequelize[_0x7368('0x1')],'unique':_0x7368('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7368('0x1')]},'companyId':{'type':Sequelize[_0x7368('0x1')]},'website':{'type':Sequelize[_0x7368('0x1')]},'phone':{'type':Sequelize[_0x7368('0x1')]},'fax':{'type':Sequelize[_0x7368('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x7368('0x1')]},'city':{'type':Sequelize[_0x7368('0x1')]},'country':{'type':Sequelize[_0x7368('0x1')]},'email':{'type':Sequelize[_0x7368('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x7368('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7368('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index e0fe10f..12f061e 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 _0xd245=['length','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','addContacts','CmContact','ids','omit','getContacts','findOne','pick','eml-format','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','sendStatus','error','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields'];(function(_0x3de6ad,_0x56ddd2){var _0x5c7ff3=function(_0x2591c5){while(--_0x2591c5){_0x3de6ad['push'](_0x3de6ad['shift']());}};_0x5c7ff3(++_0x56ddd2);}(_0xd245,0x77));var _0x5d24=function(_0x1709e7,_0x2ced21){_0x1709e7=_0x1709e7-0x0;var _0x402819=_0xd245[_0x1709e7];return _0x402819;};'use strict';var emlformat=require(_0x5d24('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5d24('0x1'));var rp=require(_0x5d24('0x2'));var moment=require('moment');var BPromise=require(_0x5d24('0x3'));var Mustache=require('mustache');var util=require(_0x5d24('0x4'));var path=require(_0x5d24('0x5'));var sox=require('sox');var csv=require(_0x5d24('0x6'));var ejs=require(_0x5d24('0x7'));var fs=require('fs');var fs_extra=require(_0x5d24('0x8'));var _=require(_0x5d24('0x9'));var squel=require(_0x5d24('0xa'));var crypto=require(_0x5d24('0xb'));var jsforce=require(_0x5d24('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5d24('0xd'));var Papa=require('papaparse');var Redis=require(_0x5d24('0xe'));var authService=require(_0x5d24('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5d24('0x10'));var hardwareService=require(_0x5d24('0x11'));var logger=require(_0x5d24('0x12'))(_0x5d24('0x13'));var utils=require(_0x5d24('0x14'));var config=require(_0x5d24('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d24('0x16'))['db'];function respondWithStatusCode(_0x3da550,_0x2dc999){_0x2dc999=_0x2dc999||0xcc;return function(_0x5c272e){if(_0x5c272e){return _0x3da550['sendStatus'](_0x2dc999);}return _0x3da550['status'](_0x2dc999)[_0x5d24('0x17')]();};}function respondWithResult(_0xb0ee71,_0x94fbde){_0x94fbde=_0x94fbde||0xc8;return function(_0x2b4dde){if(_0x2b4dde){return _0xb0ee71[_0x5d24('0x18')](_0x94fbde)[_0x5d24('0x19')](_0x2b4dde);}};}function respondWithFilteredResult(_0x39109b,_0x2cf044){return function(_0x54a18c){if(_0x54a18c){var _0x64fd1e=typeof _0x2cf044['offset']===_0x5d24('0x1a')&&typeof _0x2cf044['limit']===_0x5d24('0x1a');var _0x44cb4a=_0x54a18c[_0x5d24('0x1b')];var _0x5cf1e8=_0x64fd1e?0x0:_0x2cf044[_0x5d24('0x1c')];var _0x10a9ae=_0x64fd1e?_0x54a18c[_0x5d24('0x1b')]:_0x2cf044[_0x5d24('0x1c')]+_0x2cf044['limit'];var _0x448569;if(_0x10a9ae>=_0x44cb4a){_0x10a9ae=_0x44cb4a;_0x448569=0xc8;}else{_0x448569=0xce;}_0x39109b[_0x5d24('0x18')](_0x448569);return _0x39109b['set'](_0x5d24('0x1d'),_0x5cf1e8+'-'+_0x10a9ae+'/'+_0x44cb4a)['json'](_0x54a18c);}return null;};}function patchUpdates(_0x52605a){return function(_0x2d6b1f){try{jsonpatch[_0x5d24('0x1e')](_0x2d6b1f,_0x52605a,!![]);}catch(_0x4d1690){return BPromise[_0x5d24('0x1f')](_0x4d1690);}return _0x2d6b1f[_0x5d24('0x20')]();};}function saveUpdates(_0x2388aa,_0x5e41ea){return function(_0x40e116){if(_0x40e116){return _0x40e116[_0x5d24('0x21')](_0x2388aa)[_0x5d24('0x22')](function(_0x2eb778){return _0x2eb778;});}return null;};}function removeEntity(_0x3d9c4d,_0x139d35){return function(_0x5873e2){if(_0x5873e2){return _0x5873e2['destroy']()['then'](function(){var _0x889391=_0x5873e2['get']({'plain':!![]});var _0x4b5964='Companies';return db[_0x5d24('0x23')][_0x5d24('0x24')]({'where':{'type':_0x4b5964,'resourceId':_0x889391['id']}})[_0x5d24('0x22')](function(){return _0x5873e2;});})[_0x5d24('0x22')](function(){_0x3d9c4d[_0x5d24('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcf3fc1,_0x1652cd){return function(_0x9c4f2b){if(!_0x9c4f2b){_0xcf3fc1[_0x5d24('0x25')](0x194);}return _0x9c4f2b;};}function handleError(_0x2b8b20,_0x2488bd){_0x2488bd=_0x2488bd||0x1f4;return function(_0x134c95){logger[_0x5d24('0x26')](_0x134c95['stack']);if(_0x134c95[_0x5d24('0x27')]){delete _0x134c95[_0x5d24('0x27')];}_0x2b8b20[_0x5d24('0x18')](_0x2488bd)[_0x5d24('0x28')](_0x134c95);};}exports[_0x5d24('0x29')]=function(_0x38b722,_0x4190eb){var _0x48d6fc={},_0x116eaa={},_0x28f80a={'count':0x0,'rows':[]};return db[_0x5d24('0x2a')][_0x5d24('0x2b')]()[_0x5d24('0x22')](function(_0x505918){_0x116eaa[_0x5d24('0x2c')]=_[_0x5d24('0x2d')](_0x505918);_0x116eaa['query']=_['keys'](_0x38b722[_0x5d24('0x2e')]);_0x116eaa[_0x5d24('0x2f')]=_[_0x5d24('0x30')](_0x116eaa['model'],_0x116eaa[_0x5d24('0x2e')]);_0x48d6fc[_0x5d24('0x31')]=_[_0x5d24('0x30')](_0x116eaa['model'],qs[_0x5d24('0x32')](_0x38b722[_0x5d24('0x2e')][_0x5d24('0x32')]));_0x48d6fc['attributes']=_0x48d6fc[_0x5d24('0x31')][_0x5d24('0x33')]?_0x48d6fc[_0x5d24('0x31')]:_0x116eaa[_0x5d24('0x2c')];if(!_0x38b722[_0x5d24('0x2e')][_0x5d24('0x34')](_0x5d24('0x35'))){_0x48d6fc['limit']=qs[_0x5d24('0x36')](_0x38b722[_0x5d24('0x2e')][_0x5d24('0x36')]);_0x48d6fc[_0x5d24('0x1c')]=qs[_0x5d24('0x1c')](_0x38b722[_0x5d24('0x2e')][_0x5d24('0x1c')]);}_0x48d6fc[_0x5d24('0x37')]=qs[_0x5d24('0x38')](_0x38b722[_0x5d24('0x2e')][_0x5d24('0x38')]);_0x48d6fc[_0x5d24('0x39')]=qs[_0x5d24('0x2f')](_['pick'](_0x38b722[_0x5d24('0x2e')],_0x116eaa[_0x5d24('0x2f')]),_0x505918);if(_0x38b722[_0x5d24('0x2e')][_0x5d24('0x3a')]){_0x48d6fc[_0x5d24('0x39')]=_['merge'](_0x48d6fc[_0x5d24('0x39')],{'$or':_[_0x5d24('0x3b')](_0x48d6fc[_0x5d24('0x31')],function(_0x15ca3b){var _0x149938={};_0x149938[_0x15ca3b]={'$like':'%'+_0x38b722[_0x5d24('0x2e')][_0x5d24('0x3a')]+'%'};return _0x149938;})});}_0x48d6fc=_[_0x5d24('0x3c')]({},_0x48d6fc,_0x38b722[_0x5d24('0x3d')]);var _0x56bc01={'where':_0x48d6fc[_0x5d24('0x39')]};return db[_0x5d24('0x2a')][_0x5d24('0x1b')](_0x56bc01)['then'](function(_0x39ca5c){_0x28f80a['count']=_0x39ca5c;if(_0x38b722[_0x5d24('0x2e')][_0x5d24('0x3e')]){_0x48d6fc[_0x5d24('0x3f')]=[{'all':!![]}];}return db[_0x5d24('0x2a')][_0x5d24('0x40')](_0x48d6fc);})[_0x5d24('0x22')](function(_0x35b446){_0x28f80a['rows']=_0x35b446;return _0x28f80a;})[_0x5d24('0x22')](respondWithFilteredResult(_0x4190eb,_0x48d6fc))['catch'](handleError(_0x4190eb,null));})[_0x5d24('0x41')](handleError(_0x4190eb,null));};exports[_0x5d24('0x42')]=function(_0x382e75,_0x461c23){var _0x1905ee={'raw':![],'where':{'id':_0x382e75[_0x5d24('0x43')]['id']}},_0x1fc4fd={};_0x1fc4fd[_0x5d24('0x2c')]=_[_0x5d24('0x2d')](db[_0x5d24('0x2a')][_0x5d24('0x44')]);_0x1fc4fd['query']=_[_0x5d24('0x2d')](_0x382e75[_0x5d24('0x2e')]);_0x1fc4fd['filters']=_[_0x5d24('0x30')](_0x1fc4fd[_0x5d24('0x2c')],_0x1fc4fd[_0x5d24('0x2e')]);_0x1905ee[_0x5d24('0x31')]=_['intersection'](_0x1fc4fd[_0x5d24('0x2c')],qs[_0x5d24('0x32')](_0x382e75[_0x5d24('0x2e')][_0x5d24('0x32')]));_0x1905ee['attributes']=_0x1905ee[_0x5d24('0x31')][_0x5d24('0x33')]?_0x1905ee[_0x5d24('0x31')]:_0x1fc4fd[_0x5d24('0x2c')];if(_0x382e75[_0x5d24('0x2e')]['includeAll']){_0x1905ee['include']=[{'all':!![]}];}_0x1905ee=_[_0x5d24('0x3c')]({},_0x1905ee,_0x382e75[_0x5d24('0x3d')]);return db['CmCompany'][_0x5d24('0x45')](_0x1905ee)[_0x5d24('0x22')](handleEntityNotFound(_0x461c23,null))[_0x5d24('0x22')](respondWithResult(_0x461c23,null))['catch'](handleError(_0x461c23,null));};exports[_0x5d24('0x46')]=function(_0x5a4740,_0x44bf85){return db[_0x5d24('0x2a')]['create'](_0x5a4740[_0x5d24('0x47')],{})['then'](function(_0x21f322){var _0x226913=_0x5a4740['user'][_0x5d24('0x48')]({'plain':!![]});if(!_0x226913)throw new Error(_0x5d24('0x49'));if(_0x226913[_0x5d24('0x4a')]===_0x5d24('0x4b')){var _0x3e4eab=_0x21f322[_0x5d24('0x48')]({'plain':!![]});var _0x58e987='Companies';return db[_0x5d24('0x4c')][_0x5d24('0x45')]({'where':{'name':_0x58e987,'userProfileId':_0x226913['userProfileId']},'raw':!![]})[_0x5d24('0x22')](function(_0x5c368b){if(_0x5c368b&&_0x5c368b[_0x5d24('0x4d')]===0x0){return db[_0x5d24('0x23')][_0x5d24('0x46')]({'name':_0x3e4eab[_0x5d24('0x27')],'resourceId':_0x3e4eab['id'],'type':_0x5c368b[_0x5d24('0x27')],'sectionId':_0x5c368b['id']},{})['then'](function(){return _0x21f322;});}else{return _0x21f322;}})[_0x5d24('0x41')](function(_0x3b1c77){logger[_0x5d24('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b1c77);throw _0x3b1c77;});}return _0x21f322;})[_0x5d24('0x22')](respondWithResult(_0x44bf85,0xc9))[_0x5d24('0x41')](handleError(_0x44bf85,null));};exports['update']=function(_0x82aa80,_0x1d0501){if(_0x82aa80[_0x5d24('0x47')]['id']){delete _0x82aa80[_0x5d24('0x47')]['id'];}return db['CmCompany'][_0x5d24('0x45')]({'where':{'id':_0x82aa80[_0x5d24('0x43')]['id']}})[_0x5d24('0x22')](handleEntityNotFound(_0x1d0501,null))[_0x5d24('0x22')](saveUpdates(_0x82aa80[_0x5d24('0x47')],null))[_0x5d24('0x22')](respondWithResult(_0x1d0501,null))[_0x5d24('0x41')](handleError(_0x1d0501,null));};exports['destroy']=function(_0x2e5444,_0x229a4d){return db['CmCompany'][_0x5d24('0x45')]({'where':{'id':_0x2e5444['params']['id']}})[_0x5d24('0x22')](handleEntityNotFound(_0x229a4d,null))[_0x5d24('0x22')](removeEntity(_0x229a4d,null))[_0x5d24('0x41')](handleError(_0x229a4d,null));};exports[_0x5d24('0x2b')]=function(_0x2f7d73,_0x23dedc){return db['CmCompany'][_0x5d24('0x2b')]()[_0x5d24('0x22')](respondWithResult(_0x23dedc,null))[_0x5d24('0x41')](handleError(_0x23dedc,null));};exports[_0x5d24('0x4e')]=function(_0x129e6a,_0x1ad52f,_0x4b283f){return db[_0x5d24('0x4f')][_0x5d24('0x45')]({'where':{'id':_0x129e6a['params']['id']}})[_0x5d24('0x22')](handleEntityNotFound(_0x1ad52f,null))[_0x5d24('0x22')](function(_0x102a30){if(_0x102a30){return _0x102a30['addContacts'](_0x129e6a[_0x5d24('0x47')][_0x5d24('0x50')],_[_0x5d24('0x51')](_0x129e6a[_0x5d24('0x47')],[_0x5d24('0x50'),'id'])||{});}})[_0x5d24('0x22')](respondWithResult(_0x1ad52f,null))[_0x5d24('0x41')](handleError(_0x1ad52f,null));};exports[_0x5d24('0x52')]=function(_0x17e55b,_0x268b22,_0xf57e1d){var _0x582034={};var _0x55e221={};var _0x41bdbd;var _0x1a5a94;return db[_0x5d24('0x2a')][_0x5d24('0x53')]({'where':{'id':_0x17e55b[_0x5d24('0x43')]['id']}})['then'](handleEntityNotFound(_0x268b22,null))[_0x5d24('0x22')](function(_0x246304){if(_0x246304){_0x41bdbd=_0x246304;_0x55e221[_0x5d24('0x2c')]=_['keys'](db['CmContact'][_0x5d24('0x44')]);_0x55e221[_0x5d24('0x2e')]=_[_0x5d24('0x2d')](_0x17e55b[_0x5d24('0x2e')]);_0x55e221['filters']=_[_0x5d24('0x30')](_0x55e221[_0x5d24('0x2c')],_0x55e221[_0x5d24('0x2e')]);_0x582034[_0x5d24('0x31')]=_[_0x5d24('0x30')](_0x55e221['model'],qs[_0x5d24('0x32')](_0x17e55b[_0x5d24('0x2e')][_0x5d24('0x32')]));_0x582034[_0x5d24('0x31')]=_0x582034[_0x5d24('0x31')][_0x5d24('0x33')]?_0x582034[_0x5d24('0x31')]:_0x55e221[_0x5d24('0x2c')];_0x582034[_0x5d24('0x37')]=qs[_0x5d24('0x38')](_0x17e55b[_0x5d24('0x2e')]['sort']);_0x582034['where']=qs[_0x5d24('0x2f')](_[_0x5d24('0x54')](_0x17e55b['query'],_0x55e221['filters']));if(_0x17e55b[_0x5d24('0x2e')][_0x5d24('0x3a')]){_0x582034[_0x5d24('0x39')]=_[_0x5d24('0x3c')](_0x582034[_0x5d24('0x39')],{'$or':_['map'](_0x582034[_0x5d24('0x31')],function(_0x4f90fd){var _0x2d8dfd={};_0x2d8dfd[_0x4f90fd]={'$like':'%'+_0x17e55b['query']['filter']+'%'};return _0x2d8dfd;})});}_0x582034=_[_0x5d24('0x3c')]({},_0x582034,_0x17e55b[_0x5d24('0x3d')]);return _0x41bdbd[_0x5d24('0x52')](_0x582034);}})['then'](function(_0x2617e4){if(_0x2617e4){_0x1a5a94=_0x2617e4[_0x5d24('0x33')];if(!_0x17e55b[_0x5d24('0x2e')]['hasOwnProperty'](_0x5d24('0x35'))){_0x582034[_0x5d24('0x36')]=qs['limit'](_0x17e55b[_0x5d24('0x2e')][_0x5d24('0x36')]);_0x582034[_0x5d24('0x1c')]=qs['offset'](_0x17e55b[_0x5d24('0x2e')][_0x5d24('0x1c')]);}return _0x41bdbd[_0x5d24('0x52')](_0x582034);}})['then'](function(_0x2afe8f){if(_0x2afe8f){return _0x2afe8f?{'count':_0x1a5a94,'rows':_0x2afe8f}:null;}})[_0x5d24('0x22')](respondWithResult(_0x268b22,null))[_0x5d24('0x41')](handleError(_0x268b22,null));};
\ No newline at end of file
+var _0x52f7=['status','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','map','options','includeAll','include','catch','show','rawAttributes','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','update','body','params','addContacts','CmContact','omit','ids','findOne','filter','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','count','set','apply','reject','save','then','get','Companies','UserProfileResource','destroy'];(function(_0x41e509,_0x33ab91){var _0x522164=function(_0xc05c2b){while(--_0xc05c2b){_0x41e509['push'](_0x41e509['shift']());}};_0x522164(++_0x33ab91);}(_0x52f7,0xdc));var _0x752f=function(_0x2944d8,_0x2af76d){_0x2944d8=_0x2944d8-0x0;var _0x1245e1=_0x52f7[_0x2944d8];return _0x1245e1;};'use strict';var emlformat=require(_0x752f('0x0'));var rimraf=require(_0x752f('0x1'));var zipdir=require(_0x752f('0x2'));var jsonpatch=require(_0x752f('0x3'));var rp=require(_0x752f('0x4'));var moment=require(_0x752f('0x5'));var BPromise=require(_0x752f('0x6'));var Mustache=require(_0x752f('0x7'));var util=require(_0x752f('0x8'));var path=require(_0x752f('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x752f('0xa'));var fs=require('fs');var fs_extra=require(_0x752f('0xb'));var _=require(_0x752f('0xc'));var squel=require(_0x752f('0xd'));var crypto=require(_0x752f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x752f('0xf'));var toCsv=require(_0x752f('0x10'));var querystring=require(_0x752f('0x11'));var Papa=require(_0x752f('0x12'));var Redis=require('ioredis');var authService=require(_0x752f('0x13'));var qs=require(_0x752f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x752f('0x15'));var logger=require('../../config/logger')(_0x752f('0x16'));var utils=require(_0x752f('0x17'));var config=require(_0x752f('0x18'));var licenseUtil=require(_0x752f('0x19'));var db=require(_0x752f('0x1a'))['db'];function respondWithStatusCode(_0x4bbb45,_0xd9142f){_0xd9142f=_0xd9142f||0xcc;return function(_0x4e83a9){if(_0x4e83a9){return _0x4bbb45[_0x752f('0x1b')](_0xd9142f);}return _0x4bbb45['status'](_0xd9142f)[_0x752f('0x1c')]();};}function respondWithResult(_0x3a7c12,_0x3afba1){_0x3afba1=_0x3afba1||0xc8;return function(_0x183d59){if(_0x183d59){return _0x3a7c12['status'](_0x3afba1)[_0x752f('0x1d')](_0x183d59);}};}function respondWithFilteredResult(_0x516846,_0x4feb83){return function(_0x593777){if(_0x593777){var _0x2a7ae1=typeof _0x4feb83[_0x752f('0x1e')]==='undefined'&&typeof _0x4feb83['limit']==='undefined';var _0xf24bba=_0x593777[_0x752f('0x1f')];var _0x487110=_0x2a7ae1?0x0:_0x4feb83[_0x752f('0x1e')];var _0x6df19d=_0x2a7ae1?_0x593777[_0x752f('0x1f')]:_0x4feb83[_0x752f('0x1e')]+_0x4feb83['limit'];var _0x300bcf;if(_0x6df19d>=_0xf24bba){_0x6df19d=_0xf24bba;_0x300bcf=0xc8;}else{_0x300bcf=0xce;}_0x516846['status'](_0x300bcf);return _0x516846[_0x752f('0x20')]('Content-Range',_0x487110+'-'+_0x6df19d+'/'+_0xf24bba)[_0x752f('0x1d')](_0x593777);}return null;};}function patchUpdates(_0x47eb6a){return function(_0xc320e){try{jsonpatch[_0x752f('0x21')](_0xc320e,_0x47eb6a,!![]);}catch(_0x38a273){return BPromise[_0x752f('0x22')](_0x38a273);}return _0xc320e[_0x752f('0x23')]();};}function saveUpdates(_0x450ccf,_0x5a5fdc){return function(_0x446e93){if(_0x446e93){return _0x446e93['update'](_0x450ccf)['then'](function(_0x6c179){return _0x6c179;});}return null;};}function removeEntity(_0x432375,_0x3a91c8){return function(_0x194add){if(_0x194add){return _0x194add['destroy']()[_0x752f('0x24')](function(){var _0x425847=_0x194add[_0x752f('0x25')]({'plain':!![]});var _0x28bc4d=_0x752f('0x26');return db[_0x752f('0x27')][_0x752f('0x28')]({'where':{'type':_0x28bc4d,'resourceId':_0x425847['id']}})[_0x752f('0x24')](function(){return _0x194add;});})[_0x752f('0x24')](function(){_0x432375[_0x752f('0x29')](0xcc)[_0x752f('0x1c')]();});}};}function handleEntityNotFound(_0x1519e4,_0x3bfe37){return function(_0x46de19){if(!_0x46de19){_0x1519e4[_0x752f('0x1b')](0x194);}return _0x46de19;};}function handleError(_0x7fbf73,_0x1c346b){_0x1c346b=_0x1c346b||0x1f4;return function(_0x210ecd){logger[_0x752f('0x2a')](_0x210ecd[_0x752f('0x2b')]);if(_0x210ecd['name']){delete _0x210ecd[_0x752f('0x2c')];}_0x7fbf73[_0x752f('0x29')](_0x1c346b)[_0x752f('0x2d')](_0x210ecd);};}exports[_0x752f('0x2e')]=function(_0x576e6d,_0x40ec34){var _0x55c14c={},_0x152b07={},_0x5898dc={'count':0x0,'rows':[]};return db[_0x752f('0x2f')][_0x752f('0x30')]()[_0x752f('0x24')](function(_0x4f54d4){_0x152b07[_0x752f('0x31')]=_[_0x752f('0x32')](_0x4f54d4);_0x152b07[_0x752f('0x33')]=_['keys'](_0x576e6d[_0x752f('0x33')]);_0x152b07[_0x752f('0x34')]=_[_0x752f('0x35')](_0x152b07['model'],_0x152b07[_0x752f('0x33')]);_0x55c14c[_0x752f('0x36')]=_['intersection'](_0x152b07['model'],qs[_0x752f('0x37')](_0x576e6d[_0x752f('0x33')][_0x752f('0x37')]));_0x55c14c[_0x752f('0x36')]=_0x55c14c['attributes'][_0x752f('0x38')]?_0x55c14c['attributes']:_0x152b07[_0x752f('0x31')];if(!_0x576e6d[_0x752f('0x33')][_0x752f('0x39')](_0x752f('0x3a'))){_0x55c14c[_0x752f('0x3b')]=qs['limit'](_0x576e6d[_0x752f('0x33')][_0x752f('0x3b')]);_0x55c14c[_0x752f('0x1e')]=qs['offset'](_0x576e6d[_0x752f('0x33')][_0x752f('0x1e')]);}_0x55c14c[_0x752f('0x3c')]=qs[_0x752f('0x3d')](_0x576e6d[_0x752f('0x33')][_0x752f('0x3d')]);_0x55c14c['where']=qs['filters'](_['pick'](_0x576e6d['query'],_0x152b07['filters']),_0x4f54d4);if(_0x576e6d[_0x752f('0x33')]['filter']){_0x55c14c[_0x752f('0x3e')]=_[_0x752f('0x3f')](_0x55c14c[_0x752f('0x3e')],{'$or':_[_0x752f('0x40')](_0x55c14c[_0x752f('0x36')],function(_0x3577f6){var _0x46015f={};_0x46015f[_0x3577f6]={'$like':'%'+_0x576e6d[_0x752f('0x33')]['filter']+'%'};return _0x46015f;})});}_0x55c14c=_[_0x752f('0x3f')]({},_0x55c14c,_0x576e6d[_0x752f('0x41')]);var _0x35f3e0={'where':_0x55c14c[_0x752f('0x3e')]};return db[_0x752f('0x2f')][_0x752f('0x1f')](_0x35f3e0)['then'](function(_0x4b8ab7){_0x5898dc[_0x752f('0x1f')]=_0x4b8ab7;if(_0x576e6d[_0x752f('0x33')][_0x752f('0x42')]){_0x55c14c[_0x752f('0x43')]=[{'all':!![]}];}return db[_0x752f('0x2f')]['findAll'](_0x55c14c);})[_0x752f('0x24')](function(_0x523b4c){_0x5898dc['rows']=_0x523b4c;return _0x5898dc;})[_0x752f('0x24')](respondWithFilteredResult(_0x40ec34,_0x55c14c))[_0x752f('0x44')](handleError(_0x40ec34,null));})[_0x752f('0x44')](handleError(_0x40ec34,null));};exports[_0x752f('0x45')]=function(_0xbebd1b,_0x367b3b){var _0x3c41d6={'raw':![],'where':{'id':_0xbebd1b['params']['id']}},_0x3fe7fc={};_0x3fe7fc['model']=_[_0x752f('0x32')](db[_0x752f('0x2f')][_0x752f('0x46')]);_0x3fe7fc[_0x752f('0x33')]=_[_0x752f('0x32')](_0xbebd1b[_0x752f('0x33')]);_0x3fe7fc[_0x752f('0x34')]=_[_0x752f('0x35')](_0x3fe7fc[_0x752f('0x31')],_0x3fe7fc[_0x752f('0x33')]);_0x3c41d6[_0x752f('0x36')]=_[_0x752f('0x35')](_0x3fe7fc[_0x752f('0x31')],qs[_0x752f('0x37')](_0xbebd1b[_0x752f('0x33')][_0x752f('0x37')]));_0x3c41d6[_0x752f('0x36')]=_0x3c41d6['attributes']['length']?_0x3c41d6[_0x752f('0x36')]:_0x3fe7fc[_0x752f('0x31')];if(_0xbebd1b['query'][_0x752f('0x42')]){_0x3c41d6[_0x752f('0x43')]=[{'all':!![]}];}_0x3c41d6=_[_0x752f('0x3f')]({},_0x3c41d6,_0xbebd1b[_0x752f('0x41')]);return db[_0x752f('0x2f')]['find'](_0x3c41d6)[_0x752f('0x24')](handleEntityNotFound(_0x367b3b,null))['then'](respondWithResult(_0x367b3b,null))[_0x752f('0x44')](handleError(_0x367b3b,null));};exports['create']=function(_0x2588fb,_0x11b8d2){return db[_0x752f('0x2f')][_0x752f('0x47')](_0x2588fb['body'],{})[_0x752f('0x24')](function(_0x197a8d){var _0x185d6d=_0x2588fb['user'][_0x752f('0x25')]({'plain':!![]});if(!_0x185d6d)throw new Error(_0x752f('0x48'));if(_0x185d6d[_0x752f('0x49')]==='user'){var _0x4566b9=_0x197a8d[_0x752f('0x25')]({'plain':!![]});var _0xc6d7d6=_0x752f('0x26');return db[_0x752f('0x4a')][_0x752f('0x4b')]({'where':{'name':_0xc6d7d6,'userProfileId':_0x185d6d['userProfileId']},'raw':!![]})['then'](function(_0x1f4de3){if(_0x1f4de3&&_0x1f4de3[_0x752f('0x4c')]===0x0){return db[_0x752f('0x27')][_0x752f('0x47')]({'name':_0x4566b9[_0x752f('0x2c')],'resourceId':_0x4566b9['id'],'type':_0x1f4de3[_0x752f('0x2c')],'sectionId':_0x1f4de3['id']},{})['then'](function(){return _0x197a8d;});}else{return _0x197a8d;}})[_0x752f('0x44')](function(_0x1bc947){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1bc947);throw _0x1bc947;});}return _0x197a8d;})[_0x752f('0x24')](respondWithResult(_0x11b8d2,0xc9))['catch'](handleError(_0x11b8d2,null));};exports[_0x752f('0x4d')]=function(_0x5a33df,_0x3ae86b){if(_0x5a33df['body']['id']){delete _0x5a33df[_0x752f('0x4e')]['id'];}return db[_0x752f('0x2f')][_0x752f('0x4b')]({'where':{'id':_0x5a33df['params']['id']}})[_0x752f('0x24')](handleEntityNotFound(_0x3ae86b,null))[_0x752f('0x24')](saveUpdates(_0x5a33df[_0x752f('0x4e')],null))['then'](respondWithResult(_0x3ae86b,null))[_0x752f('0x44')](handleError(_0x3ae86b,null));};exports[_0x752f('0x28')]=function(_0x274927,_0x3ee261){return db[_0x752f('0x2f')][_0x752f('0x4b')]({'where':{'id':_0x274927[_0x752f('0x4f')]['id']}})[_0x752f('0x24')](handleEntityNotFound(_0x3ee261,null))[_0x752f('0x24')](removeEntity(_0x3ee261,null))[_0x752f('0x44')](handleError(_0x3ee261,null));};exports[_0x752f('0x30')]=function(_0x5de34c,_0x2af29f){return db[_0x752f('0x2f')][_0x752f('0x30')]()[_0x752f('0x24')](respondWithResult(_0x2af29f,null))[_0x752f('0x44')](handleError(_0x2af29f,null));};exports[_0x752f('0x50')]=function(_0x330233,_0x428bda,_0x45ebe2){return db[_0x752f('0x51')][_0x752f('0x4b')]({'where':{'id':_0x330233[_0x752f('0x4f')]['id']}})[_0x752f('0x24')](handleEntityNotFound(_0x428bda,null))['then'](function(_0x52e6e2){if(_0x52e6e2){return _0x52e6e2[_0x752f('0x50')](_0x330233[_0x752f('0x4e')]['ids'],_[_0x752f('0x52')](_0x330233['body'],[_0x752f('0x53'),'id'])||{});}})[_0x752f('0x24')](respondWithResult(_0x428bda,null))[_0x752f('0x44')](handleError(_0x428bda,null));};exports['getContacts']=function(_0x3362fc,_0x5a4dda,_0x327d00){var _0x199706={};var _0x3d50ee={};var _0x20bde8;var _0x503ec8;return db[_0x752f('0x2f')][_0x752f('0x54')]({'where':{'id':_0x3362fc[_0x752f('0x4f')]['id']}})[_0x752f('0x24')](handleEntityNotFound(_0x5a4dda,null))['then'](function(_0x157cb4){if(_0x157cb4){_0x20bde8=_0x157cb4;_0x3d50ee[_0x752f('0x31')]=_[_0x752f('0x32')](db['CmContact'][_0x752f('0x46')]);_0x3d50ee[_0x752f('0x33')]=_[_0x752f('0x32')](_0x3362fc[_0x752f('0x33')]);_0x3d50ee['filters']=_[_0x752f('0x35')](_0x3d50ee['model'],_0x3d50ee[_0x752f('0x33')]);_0x199706[_0x752f('0x36')]=_[_0x752f('0x35')](_0x3d50ee[_0x752f('0x31')],qs[_0x752f('0x37')](_0x3362fc[_0x752f('0x33')]['fields']));_0x199706['attributes']=_0x199706['attributes']['length']?_0x199706[_0x752f('0x36')]:_0x3d50ee[_0x752f('0x31')];_0x199706[_0x752f('0x3c')]=qs[_0x752f('0x3d')](_0x3362fc[_0x752f('0x33')][_0x752f('0x3d')]);_0x199706[_0x752f('0x3e')]=qs[_0x752f('0x34')](_['pick'](_0x3362fc['query'],_0x3d50ee[_0x752f('0x34')]));if(_0x3362fc[_0x752f('0x33')][_0x752f('0x55')]){_0x199706['where']=_[_0x752f('0x3f')](_0x199706[_0x752f('0x3e')],{'$or':_[_0x752f('0x40')](_0x199706['attributes'],function(_0x1c6746){var _0x1d721d={};_0x1d721d[_0x1c6746]={'$like':'%'+_0x3362fc[_0x752f('0x33')][_0x752f('0x55')]+'%'};return _0x1d721d;})});}_0x199706=_[_0x752f('0x3f')]({},_0x199706,_0x3362fc['options']);return _0x20bde8[_0x752f('0x56')](_0x199706);}})['then'](function(_0xd1c4b3){if(_0xd1c4b3){_0x503ec8=_0xd1c4b3[_0x752f('0x38')];if(!_0x3362fc['query'][_0x752f('0x39')](_0x752f('0x3a'))){_0x199706[_0x752f('0x3b')]=qs[_0x752f('0x3b')](_0x3362fc['query']['limit']);_0x199706['offset']=qs[_0x752f('0x1e')](_0x3362fc['query'][_0x752f('0x1e')]);}return _0x20bde8['getContacts'](_0x199706);}})[_0x752f('0x24')](function(_0x13ed7d){if(_0x13ed7d){return _0x13ed7d?{'count':_0x503ec8,'rows':_0x13ed7d}:null;}})[_0x752f('0x24')](respondWithResult(_0x5a4dda,null))[_0x752f('0x44')](handleError(_0x5a4dda,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 5ef59f5..6d6bf96 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 _0x1db5=['cm_companies','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x5f2ece,_0x54639e){var _0x3a4986=function(_0xcfbff0){while(--_0xcfbff0){_0x5f2ece['push'](_0x5f2ece['shift']());}};_0x3a4986(++_0x54639e);}(_0x1db5,0x91));var _0x51db=function(_0x9bbc39,_0x19d669){_0x9bbc39=_0x9bbc39-0x0;var _0xdbc706=_0x1db5[_0x9bbc39];return _0xdbc706;};'use strict';var _=require(_0x51db('0x0'));var util=require('util');var logger=require(_0x51db('0x1'))('api');var moment=require(_0x51db('0x2'));var BPromise=require(_0x51db('0x3'));var rp=require(_0x51db('0x4'));var fs=require('fs');var path=require(_0x51db('0x5'));var rimraf=require('rimraf');var config=require(_0x51db('0x6'));var attributes=require(_0x51db('0x7'));module[_0x51db('0x8')]=function(_0x16d5d1,_0xd7ac2){return _0x16d5d1[_0x51db('0x9')](_0x51db('0xa'),attributes,{'tableName':_0x51db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc923=['define','cm_companies','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x28acc5,_0x34d628){var _0x5ea8e0=function(_0xef8ea5){while(--_0xef8ea5){_0x28acc5['push'](_0x28acc5['shift']());}};_0x5ea8e0(++_0x34d628);}(_0xc923,0x1c5));var _0x3c92=function(_0x4f4707,_0x445387){_0x4f4707=_0x4f4707-0x0;var _0x7731d1=_0xc923[_0x4f4707];return _0x7731d1;};'use strict';var _=require(_0x3c92('0x0'));var util=require('util');var logger=require(_0x3c92('0x1'))('api');var moment=require(_0x3c92('0x2'));var BPromise=require(_0x3c92('0x3'));var rp=require(_0x3c92('0x4'));var fs=require('fs');var path=require(_0x3c92('0x5'));var rimraf=require(_0x3c92('0x6'));var config=require(_0x3c92('0x7'));var attributes=require(_0x3c92('0x8'));module['exports']=function(_0x2b5104,_0x5b070f){return _0x2b5104[_0x3c92('0x9')]('CmCompany',attributes,{'tableName':_0x3c92('0xa'),'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 d78acec..63810f1 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 _0xd37d=['../../config/utils','rpc','jayson/promise','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(_0x564242,_0x4159f7){var _0x2906fb=function(_0xed2acc){while(--_0xed2acc){_0x564242['push'](_0x564242['shift']());}};_0x2906fb(++_0x4159f7);}(_0xd37d,0xb6));var _0xdd37=function(_0x33e864,_0x2d8439){_0x33e864=_0x33e864-0x0;var _0x1787d7=_0xd37d[_0x33e864];return _0x1787d7;};'use strict';var _=require(_0xdd37('0x0'));var util=require(_0xdd37('0x1'));var moment=require(_0xdd37('0x2'));var BPromise=require(_0xdd37('0x3'));var rs=require(_0xdd37('0x4'));var fs=require('fs');var Redis=require(_0xdd37('0x5'));var db=require(_0xdd37('0x6'))['db'];var utils=require(_0xdd37('0x7'));var logger=require('../../config/logger')(_0xdd37('0x8'));var config=require('../../config/environment');var jayson=require(_0xdd37('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47c6d1,_0x1ff1de,_0x538515){return new BPromise(function(_0x252a38,_0x385641){return client['request'](_0x47c6d1,_0x538515)[_0xdd37('0xa')](function(_0x27c481){logger[_0xdd37('0xb')](_0xdd37('0xc'),_0x1ff1de,_0xdd37('0xd'));logger['debug'](_0xdd37('0xe'),_0x1ff1de,_0xdd37('0xd'),JSON[_0xdd37('0xf')](_0x27c481));if(_0x27c481['error']){if(_0x27c481[_0xdd37('0x10')][_0xdd37('0x11')]===0x1f4){logger[_0xdd37('0x10')](_0xdd37('0xc'),_0x1ff1de,_0x27c481[_0xdd37('0x10')][_0xdd37('0x12')]);return _0x385641(_0x27c481[_0xdd37('0x10')]['message']);}logger[_0xdd37('0x10')](_0xdd37('0xc'),_0x1ff1de,_0x27c481[_0xdd37('0x10')][_0xdd37('0x12')]);return _0x252a38(_0x27c481[_0xdd37('0x10')]['message']);}else{logger[_0xdd37('0xb')](_0xdd37('0xc'),_0x1ff1de,_0xdd37('0xd'));_0x252a38(_0x27c481[_0xdd37('0x13')]['message']);}})[_0xdd37('0x14')](function(_0x58c586){logger['error'](_0xdd37('0xc'),_0x1ff1de,_0x58c586);_0x385641(_0x58c586);});});}
\ No newline at end of file
+var _0x83e5=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x83e5,0x130));var _0x583e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x83e5[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x583e('0x0'));var util=require('util');var moment=require(_0x583e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x583e('0x2'));var db=require(_0x583e('0x3'))['db'];var utils=require(_0x583e('0x4'));var logger=require('../../config/logger')(_0x583e('0x5'));var config=require(_0x583e('0x6'));var jayson=require(_0x583e('0x7'));var client=jayson[_0x583e('0x8')][_0x583e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x555368,_0xae3e5a,_0x5bc2f2){return new BPromise(function(_0x541ff0,_0x19a736){return client['request'](_0x555368,_0x5bc2f2)[_0x583e('0xa')](function(_0x97d4a6){logger[_0x583e('0xb')](_0x583e('0xc'),_0xae3e5a,_0x583e('0xd'));logger[_0x583e('0xe')](_0x583e('0xf'),_0xae3e5a,'request\x20sent',JSON[_0x583e('0x10')](_0x97d4a6));if(_0x97d4a6[_0x583e('0x11')]){if(_0x97d4a6[_0x583e('0x11')][_0x583e('0x12')]===0x1f4){logger['error'](_0x583e('0xc'),_0xae3e5a,_0x97d4a6['error'][_0x583e('0x13')]);return _0x19a736(_0x97d4a6[_0x583e('0x11')]['message']);}logger[_0x583e('0x11')](_0x583e('0xc'),_0xae3e5a,_0x97d4a6[_0x583e('0x11')]['message']);return _0x541ff0(_0x97d4a6[_0x583e('0x11')][_0x583e('0x13')]);}else{logger[_0x583e('0xb')](_0x583e('0xc'),_0xae3e5a,'request\x20sent');_0x541ff0(_0x97d4a6[_0x583e('0x14')][_0x583e('0x13')]);}})[_0x583e('0x15')](function(_0x3a2985){logger[_0x583e('0x11')](_0x583e('0xc'),_0xae3e5a,_0x3a2985);_0x19a736(_0x3a2985);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index d7b650f..6d87995 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 _0x6829=['describe','show','/:id/contacts','getContacts','post','create','addContacts','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6829,0xf3));var _0x9682=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6829[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x9682('0x0'));var util=require(_0x9682('0x1'));var path=require(_0x9682('0x2'));var timeout=require(_0x9682('0x3'));var express=require(_0x9682('0x4'));var router=express[_0x9682('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9682('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x9682('0x7')]('/',auth[_0x9682('0x8')](),controller['index']);router[_0x9682('0x7')]('/describe',auth[_0x9682('0x8')](),controller[_0x9682('0x9')]);router[_0x9682('0x7')]('/:id',auth[_0x9682('0x8')](),controller[_0x9682('0xa')]);router[_0x9682('0x7')](_0x9682('0xb'),auth[_0x9682('0x8')](),controller[_0x9682('0xc')]);router[_0x9682('0xd')]('/',auth[_0x9682('0x8')](),controller[_0x9682('0xe')]);router['post'](_0x9682('0xb'),auth[_0x9682('0x8')](),controller[_0x9682('0xf')]);router[_0x9682('0x10')](_0x9682('0x11'),auth[_0x9682('0x8')](),controller[_0x9682('0x12')]);router[_0x9682('0x13')]('/:id',auth[_0x9682('0x8')](),controller[_0x9682('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x1a58=['describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe'];(function(_0x55bdd1,_0x440615){var _0x18f9e9=function(_0x3c1c6e){while(--_0x3c1c6e){_0x55bdd1['push'](_0x55bdd1['shift']());}};_0x18f9e9(++_0x440615);}(_0x1a58,0xfe));var _0x81a5=function(_0xa2c37d,_0x644ba2){_0xa2c37d=_0xa2c37d-0x0;var _0x469aca=_0x1a58[_0xa2c37d];return _0x469aca;};'use strict';var multer=require(_0x81a5('0x0'));var util=require('util');var path=require(_0x81a5('0x1'));var timeout=require('connect-timeout');var express=require(_0x81a5('0x2'));var router=express['Router']();var fs_extra=require(_0x81a5('0x3'));var auth=require(_0x81a5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x81a5('0x5'));var controller=require(_0x81a5('0x6'));router[_0x81a5('0x7')]('/',auth[_0x81a5('0x8')](),controller['index']);router['get'](_0x81a5('0x9'),auth[_0x81a5('0x8')](),controller[_0x81a5('0xa')]);router['get'](_0x81a5('0xb'),auth[_0x81a5('0x8')](),controller[_0x81a5('0xc')]);router[_0x81a5('0x7')](_0x81a5('0xd'),auth[_0x81a5('0x8')](),controller[_0x81a5('0xe')]);router[_0x81a5('0xf')]('/',auth[_0x81a5('0x8')](),controller[_0x81a5('0x10')]);router[_0x81a5('0xf')]('/:id/contacts',auth[_0x81a5('0x8')](),controller[_0x81a5('0x11')]);router['put'](_0x81a5('0xb'),auth[_0x81a5('0x8')](),controller[_0x81a5('0x12')]);router[_0x81a5('0x13')](_0x81a5('0xb'),auth[_0x81a5('0x8')](),controller[_0x81a5('0x14')]);module[_0x81a5('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 4c2a9db..3ded97b 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 _0xb0d1=['DATE','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x42f981,_0x3a8798){var _0x55b62a=function(_0x39ce44){while(--_0x39ce44){_0x42f981['push'](_0x42f981['shift']());}};_0x55b62a(++_0x3a8798);}(_0xb0d1,0x159));var _0x1b0d=function(_0x2d04cf,_0x5706ff){_0x2d04cf=_0x2d04cf-0x0;var _0xc2f0e=_0xb0d1[_0x2d04cf];return _0xc2f0e;};'use strict';var _=require(_0x1b0d('0x0'));var Sequelize=require(_0x1b0d('0x1'));module[_0x1b0d('0x2')]={'firstName':{'type':Sequelize[_0x1b0d('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1b0d('0x3')]},'street':{'type':Sequelize[_0x1b0d('0x3')]},'postalCode':{'type':Sequelize[_0x1b0d('0x3')]},'city':{'type':Sequelize[_0x1b0d('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x1b0d('0x3')]},'description':{'type':Sequelize[_0x1b0d('0x4')]},'phone':{'type':Sequelize[_0x1b0d('0x3')]},'mobile':{'type':Sequelize[_0x1b0d('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1b0d('0x3')]},'url':{'type':Sequelize[_0x1b0d('0x3')]},'facebook':{'type':Sequelize[_0x1b0d('0x3')]},'fb_data':{'type':Sequelize[_0x1b0d('0x3')]},'twitter':{'type':Sequelize[_0x1b0d('0x3')]},'skype':{'type':Sequelize[_0x1b0d('0x3')]},'teams':{'type':Sequelize[_0x1b0d('0x3')]},'viber':{'type':Sequelize[_0x1b0d('0x3')]},'line':{'type':Sequelize[_0x1b0d('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x1b0d('0x3')]},'UserId':{'type':Sequelize[_0x1b0d('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x1b0d('0x3')]},'priority':{'type':Sequelize[_0x1b0d('0x5')](0x2)[_0x1b0d('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1b0d('0x7')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x1b0d('0x5')]}};
\ No newline at end of file
+var _0xecac=['UNSIGNED','DATE','lodash','sequelize','exports','STRING','INTEGER'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xecac,0x1a6));var _0xceca=function(_0xb59fda,_0x1f7181){_0xb59fda=_0xb59fda-0x0;var _0x563988=_0xecac[_0xb59fda];return _0x563988;};'use strict';var _=require(_0xceca('0x0'));var Sequelize=require(_0xceca('0x1'));module[_0xceca('0x2')]={'firstName':{'type':Sequelize[_0xceca('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xceca('0x3')]},'postalCode':{'type':Sequelize[_0xceca('0x3')]},'city':{'type':Sequelize[_0xceca('0x3')]},'country':{'type':Sequelize[_0xceca('0x3')]},'dateOfBirth':{'type':Sequelize[_0xceca('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xceca('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xceca('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xceca('0x3')]},'facebook':{'type':Sequelize[_0xceca('0x3')]},'fb_data':{'type':Sequelize[_0xceca('0x3')]},'twitter':{'type':Sequelize[_0xceca('0x3')]},'skype':{'type':Sequelize[_0xceca('0x3')]},'teams':{'type':Sequelize[_0xceca('0x3')]},'viber':{'type':Sequelize[_0xceca('0x3')]},'line':{'type':Sequelize[_0xceca('0x3')]},'wechat':{'type':Sequelize[_0xceca('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xceca('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xceca('0x3')]},'priority':{'type':Sequelize[_0xceca('0x4')](0x2)[_0xceca('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xceca('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xceca('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 75362fa..8ea4e0d 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 _0x409d=['CmContact','find','tags','keys','length','startsWith','columnName','displayName','analytics','CmCustomField','findAll','cf_','custom','type','values','hasOwnProperty','merge','body','from','get','mergeWith','isArray','CmHopper','info','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmContactHasItem','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','push','ListId','findOrCreate','all','show','params','color','tag','Phones','ItemType','sequelize','literal','Phones.OrderBy','$and','omit','map','format','pickBy','cf_%d','isEmpty','setFields','id\x20=\x20?','toParam','text','phone','findOne','model','rawAttributes','filters','attributes','intersection','fields','order','sort','pick','filter','setTags','ids','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','`ItemType`.OrderBy','CmHopperId','item','ItemType.OrderBy','getAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','options','count','includeAll','include','rows','getHopperHistories','getHopperFinals','CmHopperFinal','getJscriptySessions','nolimit','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','filename','chmodSync','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','parse','meta','agent','binding','No\x20phone\x20column\x20specified','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','User','child_process','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','note','createdAt','userDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','disposition','secondDisposition','thirdDisposition','key','Owner','Tag','Tags','browserName','customerIp','customerPort','deviceModel','ratingValue','referer','substatus','Interaction','flatten','sortBy','reverse','value','slice','moment','path','lodash','squel','papaparse','../../components/contacts','../../components/parsers/qs','../../config/environment/shared','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','json','offset','undefined','limit','status','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','describe','getOptions','query','user','catch'];(function(_0x5393a6,_0x3c972d){var _0x477463=function(_0x5d6f37){while(--_0x5d6f37){_0x5393a6['push'](_0x5393a6['shift']());}};_0x477463(++_0x3c972d);}(_0x409d,0xdb));var _0xd409=function(_0x3e54d0,_0x1ce9a9){_0x3e54d0=_0x3e54d0-0x0;var _0x444d03=_0x409d[_0x3e54d0];return _0x444d03;};'use strict';var moment=require(_0xd409('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xd409('0x1'));var fs=require('fs');var _=require(_0xd409('0x2'));var squel=require(_0xd409('0x3'));var Papa=require(_0xd409('0x4'));var Redis=require('ioredis');var contacts=require(_0xd409('0x5'));var qs=require(_0xd409('0x6'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var shared=require(_0xd409('0x7'));var db=require(_0xd409('0x8'))['db'];config[_0xd409('0x9')]=_[_0xd409('0xa')](config[_0xd409('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xd409('0xb'))(new Redis(config['redis']));require(_0xd409('0xc'))[_0xd409('0xd')](socket);function respondWithResult(_0xdc12a8,_0x1104a6){_0x1104a6=_0x1104a6||0xc8;return function(_0x403e18){if(_0x403e18){return _0xdc12a8['status'](_0x1104a6)[_0xd409('0xe')](_0x403e18);}};}function respondWithFilteredResult(_0x24aed6,_0x1c6eca){return function(_0x3bf5e6){if(_0x3bf5e6){var _0x3ca069=typeof _0x1c6eca[_0xd409('0xf')]===_0xd409('0x10')&&typeof _0x1c6eca[_0xd409('0x11')]==='undefined';var _0x43e33e=_0x3bf5e6['count'];var _0xd903cf=_0x3ca069?0x0:_0x1c6eca[_0xd409('0xf')];var _0x1deb69=_0x3ca069?_0x3bf5e6['count']:_0x1c6eca[_0xd409('0xf')]+_0x1c6eca[_0xd409('0x11')];var _0x50f866;if(_0x1deb69>=_0x43e33e){_0x1deb69=_0x43e33e;_0x50f866=0xc8;}else{_0x50f866=0xce;}_0x24aed6[_0xd409('0x12')](_0x50f866);return _0x24aed6[_0xd409('0x13')](_0xd409('0x14'),_0xd903cf+'-'+_0x1deb69+'/'+_0x43e33e)['json'](_0x3bf5e6);}return null;};}function saveUpdates(_0x2532e9){return function(_0x5ae8a9){if(_0x5ae8a9){return _0x5ae8a9[_0xd409('0x15')](_0x2532e9)[_0xd409('0x16')](function(_0x21ae6f){return _0x21ae6f;});}return null;};}function removeEntity(_0x5155c1){return function(_0x51de57){if(_0x51de57){return _0x51de57[_0xd409('0x17')]()[_0xd409('0x16')](function(){_0x5155c1[_0xd409('0x12')](0xcc)[_0xd409('0x18')]();});}};}function handleEntityNotFound(_0x3e43e6){return function(_0x1313f2){if(!_0x1313f2){_0x3e43e6[_0xd409('0x19')](0x194);}return _0x1313f2;};}function handleError(_0x532ca0,_0x53924b){_0x53924b=_0x53924b||0x1f4;return function(_0x3d9a3e){logger[_0xd409('0x1a')](_0x3d9a3e[_0xd409('0x1b')]);if(_0x3d9a3e['name']){delete _0x3d9a3e[_0xd409('0x1c')];}_0x532ca0[_0xd409('0x12')](_0x53924b)[_0xd409('0x1d')](_0x3d9a3e);};}exports[_0xd409('0x1e')]=function(_0x2ba777,_0x370a72){var _0x34f601={};return contacts[_0xd409('0x1f')]()[_0xd409('0x16')](function(_0x2ee8f2){_0x34f601=qs[_0xd409('0x20')](_0x2ee8f2,_0x2ba777);return contacts['findAll'](_0x2ba777[_0xd409('0x21')],_0x2ba777[_0xd409('0x22')],_0x34f601,_0x2ee8f2);})[_0xd409('0x16')](respondWithFilteredResult(_0x370a72,_0x34f601))[_0xd409('0x23')](handleError(_0x370a72,null));};exports['destroy']=function(_0x9e1559,_0x2d6b93){return db[_0xd409('0x24')][_0xd409('0x25')]({'where':{'id':_0x9e1559['params']['id']}})['then'](handleEntityNotFound(_0x2d6b93,null))['then'](removeEntity(_0x2d6b93,null))['catch'](handleError(_0x2d6b93,null));};exports[_0xd409('0x1f')]=function(_0xabb3d8,_0x1f4e80){return db[_0xd409('0x24')][_0xd409('0x1f')]()[_0xd409('0x16')](function(_0x5b745b){delete _0x5b745b[_0xd409('0x26')];for(var _0x424264=0x0;_0x424264
','Attachments','Data','generateXOAuth2Token','user='];(function(_0x3474ac,_0x22d0f7){var _0x5345ec=function(_0x45056e){while(--_0x45056e){_0x3474ac['push'](_0x3474ac['shift']());}};_0x5345ec(++_0x22d0f7);}(_0xc896,0x123));var _0x6c89=function(_0x214c7e,_0x3d3093){_0x214c7e=_0x214c7e-0x0;var _0x226d54=_0xc896[_0x214c7e];return _0x226d54;};'use strict';var _=require(_0x6c89('0x0'));var moment=require(_0x6c89('0x1'));var random=require(_0x6c89('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x6c89('0x3'));var tnef=require('node-tnef');var logger=require(_0x6c89('0x4'))(_0x6c89('0x5'));var config=require(_0x6c89('0x6'));function getAddress(_0x4e19ef){var _0x29d334=_[_0x6c89('0x7')](_0x4e19ef[_0x6c89('0x8')]);return _0x29d334&&_0x29d334[_0x6c89('0x9')]?_0x29d334[_0x6c89('0x9')]:'anonymous'+random[_0x6c89('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x37a22f){var _0x220573=_[_0x6c89('0x7')](_0x37a22f[_0x6c89('0x8')]);if(_0x220573&&_0x220573[_0x6c89('0xb')]){if(_0x220573[_0x6c89('0xb')]==_0x220573[_0x6c89('0x9')]){return _0x220573[_0x6c89('0xb')][_0x6c89('0xc')](0x0,_0x220573[_0x6c89('0xb')][_0x6c89('0xd')]('@'));}var _0x4a2e17=_0x220573[_0x6c89('0xb')]['split'](/\s+/);return _0x4a2e17[_0x6c89('0xe')]>0x1?_0x4a2e17[_0x6c89('0xf')](0x0,-0x1)[_0x6c89('0x10')]('\x20'):_0x220573[_0x6c89('0xb')];}return'Anonymous';}function getLastName(_0x4670e9){var _0x5a0683=_[_0x6c89('0x7')](_0x4670e9[_0x6c89('0x8')]);if(_0x5a0683&&_0x5a0683[_0x6c89('0xb')]){var _0x53bc4b=_0x5a0683[_0x6c89('0xb')]['split'](/\s+/);return _0x53bc4b['length']>0x1?_0x53bc4b[_0x6c89('0x11')]():'';}return'';}function getMails(_0x2e11a9,_0x324c68){var _0x4678d7='';for(var _0x285a71=0x0;_0x285a71<_0x324c68[_0x6c89('0x8')][_0x6c89('0xe')];_0x285a71+=0x1){if(_0x324c68[_0x6c89('0x8')][_0x285a71][_0x6c89('0x9')]!==_0x2e11a9){if(!_['isEmpty'](_0x4678d7)){_0x4678d7+=',';}_0x4678d7+=_0x324c68[_0x6c89('0x8')][_0x285a71][_0x6c89('0xb')]||_0x324c68[_0x6c89('0x8')][_0x285a71]['address']||'';_0x4678d7+='\x20<';_0x4678d7+=_0x324c68[_0x6c89('0x8')][_0x285a71]['address']?_0x324c68[_0x6c89('0x8')][_0x285a71]['address']:_0x6c89('0x12')+random[_0x6c89('0xa')](0x6)+_0x6c89('0x13');_0x4678d7+='>';}}return _0x4678d7;}function parseEmail(_0x2f50de,_0x54a5a0,_0x5a14d3){if(_0x54a5a0['html']){var _0x717a73=/