From: support
Date: Tue, 4 Apr 2023 07:36:48 +0000 (+0000)
Subject: Built motion from commit 511216ff.|2.6.34
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png//%22%27?a=commitdiff_plain;h=d49179b33ee0d68ac7fe8d7a72ddb052882650b3;p=motion2.git
Built motion from commit 511216ff.|2.6.34
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 87dbaf3..137a5a3 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-03-28T09:17:06.964Z",
+ "time": "2023-04-04T07:25:29.663Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index ae8e355..5317a45 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-03-28T09:17:06.964Z",
+ "time": "2023-04-04T07:25:29.663Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 22e1ad1..31ddbb1 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.33",
+ "version": "2.6.34",
"dependencies": {
"@babel/code-frame": {
"version": "7.18.6",
diff --git a/package.json b/package.json
index b4c0db1..d3f1a90 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.33",
+ "version": "2.6.34",
"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 9897251..62c3afe 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 _0x9b25=['contactManager','motionbar','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','STRING'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x9b25,0x175));var _0x59b2=function(_0xbfe8e9,_0x5a8b43){_0xbfe8e9=_0xbfe8e9-0x0;var _0x2a278f=_0x9b25[_0xbfe8e9];return _0x2a278f;};'use strict';var Sequelize=require(_0x59b2('0x0'));module[_0x59b2('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xed1df0){return this[_0x59b2('0x2')](_0x59b2('0x3'));}},'action':{'type':Sequelize[_0x59b2('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x59b2('0x5'),'integration',_0x59b2('0x6'),'jscripty','urlForward',_0x59b2('0x7'),_0x59b2('0x8'),_0x59b2('0x9')]],'msg':_0x59b2('0xa')}},'comment':_0x59b2('0xa')},'data1':{'type':Sequelize[_0x59b2('0x4')](0x1000),'comment':_0x59b2('0xb')},'data2':{'type':Sequelize[_0x59b2('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x59b2('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x59b2('0xd')},'data5':{'type':Sequelize[_0x59b2('0x4')](0x1000),'comments':_0x59b2('0xe')},'data6':{'type':Sequelize[_0x59b2('0x4')],'comments':_0x59b2('0xf')},'data7':{'type':Sequelize[_0x59b2('0x10')],'comments':_0x59b2('0x11')}};
\ No newline at end of file
+var _0x5ff9=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','action','contactManager','integration','motionbar','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING'];(function(_0x3da096,_0x59b644){var _0x144fbf=function(_0x14c243){while(--_0x14c243){_0x3da096['push'](_0x3da096['shift']());}};_0x144fbf(++_0x59b644);}(_0x5ff9,0x155));var _0x95ff=function(_0x3262c5,_0x2773e0){_0x3262c5=_0x3262c5-0x0;var _0x2737da=_0x5ff9[_0x3262c5];return _0x2737da;};'use strict';var Sequelize=require(_0x95ff('0x0'));module[_0x95ff('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x312ecc){return this['getDataValue'](_0x95ff('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x95ff('0x3'),_0x95ff('0x4'),_0x95ff('0x5'),_0x95ff('0x6'),'urlForward','browser',_0x95ff('0x7'),_0x95ff('0x8')]],'msg':_0x95ff('0x9')}},'comment':_0x95ff('0x9')},'data1':{'type':Sequelize[_0x95ff('0xa')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x95ff('0xa')](0x1000),'comment':_0x95ff('0xb')},'data3':{'type':Sequelize[_0x95ff('0xa')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x95ff('0xa')](0x1000),'comments':_0x95ff('0xc')},'data5':{'type':Sequelize[_0x95ff('0xa')](0x1000),'comments':_0x95ff('0xd')},'data6':{'type':Sequelize[_0x95ff('0xa')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x95ff('0xe')],'comments':_0x95ff('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index e7451fb..5d8ae06 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 _0x4130=['params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','body','Action','find','catch'];(function(_0x4f51c9,_0x7d55fa){var _0x5e1d6b=function(_0x36e5b0){while(--_0x36e5b0){_0x4f51c9['push'](_0x4f51c9['shift']());}};_0x5e1d6b(++_0x7d55fa);}(_0x4130,0x1a8));var _0x0413=function(_0x5a5939,_0x5af371){_0x5a5939=_0x5a5939-0x0;var _0x336804=_0x4130[_0x5a5939];return _0x336804;};'use strict';var emlformat=require(_0x0413('0x0'));var rimraf=require(_0x0413('0x1'));var zipdir=require(_0x0413('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0413('0x3'));var moment=require(_0x0413('0x4'));var BPromise=require(_0x0413('0x5'));var Mustache=require(_0x0413('0x6'));var util=require(_0x0413('0x7'));var path=require(_0x0413('0x8'));var sox=require('sox');var csv=require(_0x0413('0x9'));var ejs=require(_0x0413('0xa'));var fs=require('fs');var fs_extra=require(_0x0413('0xb'));var _=require('lodash');var squel=require(_0x0413('0xc'));var crypto=require(_0x0413('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0413('0x9'));var querystring=require(_0x0413('0xe'));var Papa=require(_0x0413('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0413('0x10'));var logger=require(_0x0413('0x11'))(_0x0413('0x12'));var utils=require(_0x0413('0x13'));var config=require(_0x0413('0x14'));var licenseUtil=require(_0x0413('0x15'));var db=require(_0x0413('0x16'))['db'];function respondWithStatusCode(_0x3a704c,_0xcb1e70){_0xcb1e70=_0xcb1e70||0xcc;return function(_0x1c966e){if(_0x1c966e){return _0x3a704c[_0x0413('0x17')](_0xcb1e70);}return _0x3a704c['status'](_0xcb1e70)['end']();};}function respondWithResult(_0xfd7e13,_0x380e93){_0x380e93=_0x380e93||0xc8;return function(_0x368635){if(_0x368635){return _0xfd7e13[_0x0413('0x18')](_0x380e93)[_0x0413('0x19')](_0x368635);}};}function respondWithFilteredResult(_0x501d42,_0x232e86){return function(_0x41c548){if(_0x41c548){var _0xc6200e=typeof _0x232e86['offset']==='undefined'&&typeof _0x232e86[_0x0413('0x1a')]===_0x0413('0x1b');var _0x3a87b0=_0x41c548['count'];var _0x115429=_0xc6200e?0x0:_0x232e86[_0x0413('0x1c')];var _0x48d42a=_0xc6200e?_0x41c548[_0x0413('0x1d')]:_0x232e86[_0x0413('0x1c')]+_0x232e86[_0x0413('0x1a')];var _0x1ad095;if(_0x48d42a>=_0x3a87b0){_0x48d42a=_0x3a87b0;_0x1ad095=0xc8;}else{_0x1ad095=0xce;}_0x501d42[_0x0413('0x18')](_0x1ad095);return _0x501d42[_0x0413('0x1e')](_0x0413('0x1f'),_0x115429+'-'+_0x48d42a+'/'+_0x3a87b0)[_0x0413('0x19')](_0x41c548);}return null;};}function patchUpdates(_0x33969b){return function(_0x11024f){try{jsonpatch[_0x0413('0x20')](_0x11024f,_0x33969b,!![]);}catch(_0x3ebcaa){return BPromise[_0x0413('0x21')](_0x3ebcaa);}return _0x11024f[_0x0413('0x22')]();};}function saveUpdates(_0x1559ce,_0x50a481){return function(_0x2b50b9){if(_0x2b50b9){return _0x2b50b9[_0x0413('0x23')](_0x1559ce)[_0x0413('0x24')](function(_0x32e31b){return _0x32e31b;});}return null;};}function removeEntity(_0xb3f479,_0x23297d){return function(_0x7643d4){if(_0x7643d4){return _0x7643d4[_0x0413('0x25')]()[_0x0413('0x24')](function(){_0xb3f479[_0x0413('0x18')](0xcc)[_0x0413('0x26')]();});}};}function handleEntityNotFound(_0x175feb,_0x84d03a){return function(_0x45c541){if(!_0x45c541){_0x175feb[_0x0413('0x17')](0x194);}return _0x45c541;};}function handleError(_0x268be9,_0xf9bd31){_0xf9bd31=_0xf9bd31||0x1f4;return function(_0x21d191){logger[_0x0413('0x27')](_0x21d191['stack']);if(_0x21d191[_0x0413('0x28')]){delete _0x21d191['name'];}_0x268be9[_0x0413('0x18')](_0xf9bd31)[_0x0413('0x29')](_0x21d191);};}exports[_0x0413('0x23')]=function(_0x535051,_0x1ef9f4){if(_0x535051['body']['id']){delete _0x535051[_0x0413('0x2a')]['id'];}return db[_0x0413('0x2b')][_0x0413('0x2c')]({'where':{'id':_0x535051['params']['id']}})['then'](handleEntityNotFound(_0x1ef9f4,null))['then'](saveUpdates(_0x535051[_0x0413('0x2a')],null))[_0x0413('0x24')](respondWithResult(_0x1ef9f4,null))[_0x0413('0x2d')](handleError(_0x1ef9f4,null));};exports[_0x0413('0x25')]=function(_0x2e876a,_0xc374ab){return db['Action']['find']({'where':{'id':_0x2e876a[_0x0413('0x2e')]['id']}})[_0x0413('0x24')](handleEntityNotFound(_0xc374ab,null))[_0x0413('0x24')](removeEntity(_0xc374ab,null))[_0x0413('0x2d')](handleError(_0xc374ab,null));};
\ No newline at end of file
+var _0x5709=['apply','reject','save','update','then','destroy','end','error','stack','name','body','params','catch','Action','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','count','offset','limit','json'];(function(_0x11a83e,_0x1533ee){var _0xbd3bd5=function(_0xc15afd){while(--_0xc15afd){_0x11a83e['push'](_0x11a83e['shift']());}};_0xbd3bd5(++_0x1533ee);}(_0x5709,0x158));var _0x9570=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5709[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9570('0x0'));var rimraf=require(_0x9570('0x1'));var zipdir=require(_0x9570('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9570('0x3'));var moment=require(_0x9570('0x4'));var BPromise=require(_0x9570('0x5'));var Mustache=require('mustache');var util=require(_0x9570('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9570('0x7'));var ejs=require(_0x9570('0x8'));var fs=require('fs');var fs_extra=require(_0x9570('0x9'));var _=require(_0x9570('0xa'));var squel=require(_0x9570('0xb'));var crypto=require(_0x9570('0xc'));var jsforce=require(_0x9570('0xd'));var deskjs=require(_0x9570('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9570('0xf'));var Redis=require(_0x9570('0x10'));var authService=require(_0x9570('0x11'));var qs=require(_0x9570('0x12'));var as=require(_0x9570('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9570('0x14'))(_0x9570('0x15'));var utils=require(_0x9570('0x16'));var config=require(_0x9570('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9570('0x18'))['db'];function respondWithStatusCode(_0x4e1e96,_0x2575c5){_0x2575c5=_0x2575c5||0xcc;return function(_0x588aa5){if(_0x588aa5){return _0x4e1e96[_0x9570('0x19')](_0x2575c5);}return _0x4e1e96[_0x9570('0x1a')](_0x2575c5)['end']();};}function respondWithResult(_0x26b898,_0x43a3cd){_0x43a3cd=_0x43a3cd||0xc8;return function(_0xb8d323){if(_0xb8d323){return _0x26b898[_0x9570('0x1a')](_0x43a3cd)['json'](_0xb8d323);}};}function respondWithFilteredResult(_0x29dff8,_0x1e628d){return function(_0x44fad0){if(_0x44fad0){var _0x362ebd=typeof _0x1e628d['offset']===_0x9570('0x1b')&&typeof _0x1e628d['limit']==='undefined';var _0x2c8cac=_0x44fad0[_0x9570('0x1c')];var _0x1ca5ec=_0x362ebd?0x0:_0x1e628d[_0x9570('0x1d')];var _0x8a3dc8=_0x362ebd?_0x44fad0[_0x9570('0x1c')]:_0x1e628d[_0x9570('0x1d')]+_0x1e628d[_0x9570('0x1e')];var _0x427ce3;if(_0x8a3dc8>=_0x2c8cac){_0x8a3dc8=_0x2c8cac;_0x427ce3=0xc8;}else{_0x427ce3=0xce;}_0x29dff8[_0x9570('0x1a')](_0x427ce3);return _0x29dff8['set']('Content-Range',_0x1ca5ec+'-'+_0x8a3dc8+'/'+_0x2c8cac)[_0x9570('0x1f')](_0x44fad0);}return null;};}function patchUpdates(_0x21807d){return function(_0x43cf3e){try{jsonpatch[_0x9570('0x20')](_0x43cf3e,_0x21807d,!![]);}catch(_0x4b0f0a){return BPromise[_0x9570('0x21')](_0x4b0f0a);}return _0x43cf3e[_0x9570('0x22')]();};}function saveUpdates(_0x4508f1,_0x4c7493){return function(_0xaac112){if(_0xaac112){return _0xaac112[_0x9570('0x23')](_0x4508f1)[_0x9570('0x24')](function(_0x5f069){return _0x5f069;});}return null;};}function removeEntity(_0x1104f8,_0x5066bc){return function(_0x2f5032){if(_0x2f5032){return _0x2f5032[_0x9570('0x25')]()[_0x9570('0x24')](function(){_0x1104f8[_0x9570('0x1a')](0xcc)[_0x9570('0x26')]();});}};}function handleEntityNotFound(_0x2c0664,_0x3717b1){return function(_0x48f3bf){if(!_0x48f3bf){_0x2c0664[_0x9570('0x19')](0x194);}return _0x48f3bf;};}function handleError(_0xb402c0,_0xcd2097){_0xcd2097=_0xcd2097||0x1f4;return function(_0x1e7378){logger[_0x9570('0x27')](_0x1e7378[_0x9570('0x28')]);if(_0x1e7378['name']){delete _0x1e7378[_0x9570('0x29')];}_0xb402c0[_0x9570('0x1a')](_0xcd2097)['send'](_0x1e7378);};}exports[_0x9570('0x23')]=function(_0x3ccb08,_0x170a51){if(_0x3ccb08[_0x9570('0x2a')]['id']){delete _0x3ccb08[_0x9570('0x2a')]['id'];}return db['Action']['find']({'where':{'id':_0x3ccb08[_0x9570('0x2b')]['id']}})['then'](handleEntityNotFound(_0x170a51,null))[_0x9570('0x24')](saveUpdates(_0x3ccb08[_0x9570('0x2a')],null))['then'](respondWithResult(_0x170a51,null))[_0x9570('0x2c')](handleError(_0x170a51,null));};exports[_0x9570('0x25')]=function(_0x53edaf,_0x463aa6){return db[_0x9570('0x2d')][_0x9570('0x2e')]({'where':{'id':_0x53edaf[_0x9570('0x2b')]['id']}})[_0x9570('0x24')](handleEntityNotFound(_0x463aa6,null))[_0x9570('0x24')](removeEntity(_0x463aa6,null))[_0x9570('0x2c')](handleError(_0x463aa6,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 9d9546c..3d40cef 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 _0x9605=['define','Action','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x3f3a34,_0x3456ef){var _0x27328b=function(_0x36cf83){while(--_0x36cf83){_0x3f3a34['push'](_0x3f3a34['shift']());}};_0x27328b(++_0x3456ef);}(_0x9605,0xde));var _0x5960=function(_0x18ff1f,_0x4cb2c0){_0x18ff1f=_0x18ff1f-0x0;var _0x3c67fa=_0x9605[_0x18ff1f];return _0x3c67fa;};'use strict';var _=require(_0x5960('0x0'));var util=require('util');var logger=require(_0x5960('0x1'))('api');var moment=require(_0x5960('0x2'));var BPromise=require(_0x5960('0x3'));var rp=require(_0x5960('0x4'));var fs=require('fs');var path=require(_0x5960('0x5'));var rimraf=require(_0x5960('0x6'));var config=require(_0x5960('0x7'));var attributes=require(_0x5960('0x8'));module['exports']=function(_0x57d502,_0x1e4248){return _0x57d502[_0x5960('0x9')](_0x5960('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4d41=['path','rimraf','./action.attributes','exports','define','Action','lodash','../../config/logger','moment','bluebird'];(function(_0x5b734f,_0x474dbe){var _0x50ce5c=function(_0x144911){while(--_0x144911){_0x5b734f['push'](_0x5b734f['shift']());}};_0x50ce5c(++_0x474dbe);}(_0x4d41,0x1a0));var _0x14d4=function(_0x3a833e,_0x5a1878){_0x3a833e=_0x3a833e-0x0;var _0xdff445=_0x4d41[_0x3a833e];return _0xdff445;};'use strict';var _=require(_0x14d4('0x0'));var util=require('util');var logger=require(_0x14d4('0x1'))('api');var moment=require(_0x14d4('0x2'));var BPromise=require(_0x14d4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x14d4('0x4'));var rimraf=require(_0x14d4('0x5'));var config=require('../../config/environment');var attributes=require(_0x14d4('0x6'));module[_0x14d4('0x7')]=function(_0x2b1c1d,_0x2fb9b5){return _0x2b1c1d[_0x14d4('0x8')](_0x14d4('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 93d27d0..6e87f51 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(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x7217,0x19e));var _0x7721=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x7217[_0x37c22c];return _0x119d79;};'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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2091fd,_0x54cb51){var _0x1169e6=function(_0x205526){while(--_0x205526){_0x2091fd['push'](_0x2091fd['shift']());}};_0x1169e6(++_0x54cb51);}(_0x1261,0x144));var _0x1126=function(_0x1c3b41,_0x50f776){_0x1c3b41=_0x1c3b41-0x0;var _0x41e3fe=_0x1261[_0x1c3b41];return _0x41e3fe;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index db2260a..6df1b26 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 _0x8246=['exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./action.controller','put','isAuthenticated','delete','/:id','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8246,0x9d));var _0x6824=function(_0x32855c,_0x1733cb){_0x32855c=_0x32855c-0x0;var _0x783e1c=_0x8246[_0x32855c];return _0x783e1c;};'use strict';var multer=require(_0x6824('0x0'));var util=require(_0x6824('0x1'));var path=require('path');var timeout=require(_0x6824('0x2'));var express=require(_0x6824('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6824('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6824('0x5'));var controller=require(_0x6824('0x6'));router[_0x6824('0x7')]('/:id',auth[_0x6824('0x8')](),controller['update']);router[_0x6824('0x9')](_0x6824('0xa'),auth[_0x6824('0x8')](),controller[_0x6824('0xb')]);module[_0x6824('0xc')]=router;
\ No newline at end of file
+var _0xd3af=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','multer','path'];(function(_0x4291bc,_0x153760){var _0x7167ed=function(_0x433d5c){while(--_0x433d5c){_0x4291bc['push'](_0x4291bc['shift']());}};_0x7167ed(++_0x153760);}(_0xd3af,0x8a));var _0xfd3a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd3af[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xfd3a('0x0'));var util=require('util');var path=require(_0xfd3a('0x1'));var timeout=require('connect-timeout');var express=require(_0xfd3a('0x2'));var router=express[_0xfd3a('0x3')]();var fs_extra=require(_0xfd3a('0x4'));var auth=require(_0xfd3a('0x5'));var interaction=require(_0xfd3a('0x6'));var config=require(_0xfd3a('0x7'));var controller=require(_0xfd3a('0x8'));router['put'](_0xfd3a('0x9'),auth[_0xfd3a('0xa')](),controller[_0xfd3a('0xb')]);router[_0xfd3a('0xc')](_0xfd3a('0x9'),auth['isAuthenticated'](),controller[_0xfd3a('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index ae92a6a..3c7549c 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 _0xda19=['exports','STRING','TEXT'];(function(_0x4a1195,_0x253862){var _0x360fa1=function(_0x207882){while(--_0x207882){_0x4a1195['push'](_0x4a1195['shift']());}};_0x360fa1(++_0x253862);}(_0xda19,0xd5));var _0x9da1=function(_0x152240,_0x4da254){_0x152240=_0x152240-0x0;var _0x48da00=_0xda19[_0x152240];return _0x48da00;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x31f0=['sequelize','STRING','TEXT'];(function(_0x2ce6ea,_0x4f06f6){var _0x512085=function(_0x315de3){while(--_0x315de3){_0x2ce6ea['push'](_0x2ce6ea['shift']());}};_0x512085(++_0x4f06f6);}(_0x31f0,0xb7));var _0x031f=function(_0x1447fd,_0x313162){_0x1447fd=_0x1447fd-0x0;var _0x721a7e=_0x31f0[_0x1447fd];return _0x721a7e;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 32046bd..1e6d013 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 _0x0c74=['value','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','fork','../../components/export/','countTable','COUNT(*)','run','runReport','MAX(%s)','AVG(%s)','UNIX_TIMESTAMP(%s)','debug','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','IS\x20EMPTY'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0x0c74,0xc1));var _0x40c7=function(_0x1c60bd,_0x207c9b){_0x1c60bd=_0x1c60bd-0x0;var _0xc46ef9=_0x0c74[_0x1c60bd];return _0xc46ef9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x40c7('0x0'));var zipdir=require(_0x40c7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x40c7('0x2'));var moment=require(_0x40c7('0x3'));var BPromise=require(_0x40c7('0x4'));var Mustache=require(_0x40c7('0x5'));var util=require('util');var path=require(_0x40c7('0x6'));var sox=require('sox');var csv=require(_0x40c7('0x7'));var ejs=require(_0x40c7('0x8'));var fs=require('fs');var fs_extra=require(_0x40c7('0x9'));var _=require('lodash');var squel=require(_0x40c7('0xa'));var crypto=require(_0x40c7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x40c7('0xc'));var toCsv=require(_0x40c7('0x7'));var querystring=require(_0x40c7('0xd'));var Papa=require(_0x40c7('0xe'));var Redis=require(_0x40c7('0xf'));var authService=require(_0x40c7('0x10'));var qs=require(_0x40c7('0x11'));var as=require(_0x40c7('0x12'));var hardwareService=require(_0x40c7('0x13'));var logger=require(_0x40c7('0x14'))(_0x40c7('0x15'));var utils=require(_0x40c7('0x16'));var config=require(_0x40c7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x40c7('0x18'))['db'];var dbH=require('../../mysqldb')[_0x40c7('0x19')];function respondWithStatusCode(_0x164c1,_0x3c86e8){_0x3c86e8=_0x3c86e8||0xcc;return function(_0x302ea4){if(_0x302ea4){return _0x164c1['sendStatus'](_0x3c86e8);}return _0x164c1[_0x40c7('0x1a')](_0x3c86e8)[_0x40c7('0x1b')]();};}function respondWithResult(_0x2bde2a,_0x32e6ca){_0x32e6ca=_0x32e6ca||0xc8;return function(_0x16a10f){if(_0x16a10f){return _0x2bde2a[_0x40c7('0x1a')](_0x32e6ca)['json'](_0x16a10f);}};}function respondWithFilteredResult(_0x586a75,_0x326b01){return function(_0x151697){if(_0x151697){var _0x54a863=typeof _0x326b01['offset']===_0x40c7('0x1c')&&typeof _0x326b01[_0x40c7('0x1d')]===_0x40c7('0x1c');var _0x2cd6f9=_0x151697['count'];var _0x41decf=_0x54a863?0x0:_0x326b01[_0x40c7('0x1e')];var _0x35eaee=_0x54a863?_0x151697[_0x40c7('0x1f')]:_0x326b01['offset']+_0x326b01['limit'];var _0x2b8df4;if(_0x35eaee>=_0x2cd6f9){_0x35eaee=_0x2cd6f9;_0x2b8df4=0xc8;}else{_0x2b8df4=0xce;}_0x586a75[_0x40c7('0x1a')](_0x2b8df4);return _0x586a75[_0x40c7('0x20')](_0x40c7('0x21'),_0x41decf+'-'+_0x35eaee+'/'+_0x2cd6f9)[_0x40c7('0x22')](_0x151697);}return null;};}function patchUpdates(_0x53decd){return function(_0x39b8cc){try{jsonpatch[_0x40c7('0x23')](_0x39b8cc,_0x53decd,!![]);}catch(_0x2eddf9){return BPromise[_0x40c7('0x24')](_0x2eddf9);}return _0x39b8cc[_0x40c7('0x25')]();};}function saveUpdates(_0x1b658b,_0xb8e270){return function(_0x2be352){if(_0x2be352){return _0x2be352[_0x40c7('0x26')](_0x1b658b)['then'](function(_0x1c8bfa){return _0x1c8bfa;});}return null;};}function removeEntity(_0x3b1ec2,_0x46ec11){return function(_0x28ba63){if(_0x28ba63){return _0x28ba63[_0x40c7('0x27')]()[_0x40c7('0x28')](function(){var _0xe0b88c=_0x28ba63[_0x40c7('0x29')]({'plain':!![]});var _0x26377c=_0x40c7('0x2a');return db[_0x40c7('0x2b')]['destroy']({'where':{'type':_0x26377c,'resourceId':_0xe0b88c['id']}})[_0x40c7('0x28')](function(){return _0x28ba63;});})[_0x40c7('0x28')](function(){_0x3b1ec2['status'](0xcc)[_0x40c7('0x1b')]();});}};}function handleEntityNotFound(_0x53cfe2,_0xb02519){return function(_0x52789a){if(!_0x52789a){_0x53cfe2['sendStatus'](0x194);}return _0x52789a;};}function handleError(_0x5e3306,_0x8e8964){_0x8e8964=_0x8e8964||0x1f4;return function(_0x2ef31f){logger[_0x40c7('0x2c')](_0x2ef31f[_0x40c7('0x2d')]);if(_0x2ef31f['name']){delete _0x2ef31f[_0x40c7('0x2e')];}_0x5e3306['status'](_0x8e8964)[_0x40c7('0x2f')](_0x2ef31f);};}exports['index']=function(_0x48ddcb,_0x56337f){var _0x3d179f={},_0x4cee00={},_0x2d588f={'count':0x0,'rows':[]};var _0x27cd86=_[_0x40c7('0x30')](db[_0x40c7('0x31')][_0x40c7('0x32')],function(_0x31906a){return{'name':_0x31906a[_0x40c7('0x33')],'type':_0x31906a[_0x40c7('0x34')][_0x40c7('0x35')]};});_0x4cee00[_0x40c7('0x36')]=_[_0x40c7('0x30')](_0x27cd86,_0x40c7('0x2e'));_0x4cee00['query']=_[_0x40c7('0x37')](_0x48ddcb[_0x40c7('0x38')]);_0x4cee00[_0x40c7('0x39')]=_[_0x40c7('0x3a')](_0x4cee00[_0x40c7('0x36')],_0x4cee00[_0x40c7('0x38')]);_0x3d179f[_0x40c7('0x3b')]=_[_0x40c7('0x3a')](_0x4cee00[_0x40c7('0x36')],qs[_0x40c7('0x3c')](_0x48ddcb[_0x40c7('0x38')]['fields']));_0x3d179f['attributes']=_0x3d179f['attributes'][_0x40c7('0x3d')]?_0x3d179f[_0x40c7('0x3b')]:_0x4cee00['model'];if(!_0x48ddcb[_0x40c7('0x38')][_0x40c7('0x3e')](_0x40c7('0x3f'))){_0x3d179f[_0x40c7('0x1d')]=qs[_0x40c7('0x1d')](_0x48ddcb[_0x40c7('0x38')][_0x40c7('0x1d')]);_0x3d179f[_0x40c7('0x1e')]=qs[_0x40c7('0x1e')](_0x48ddcb['query'][_0x40c7('0x1e')]);}_0x3d179f[_0x40c7('0x40')]=qs[_0x40c7('0x41')](_0x48ddcb[_0x40c7('0x38')][_0x40c7('0x41')]);_0x3d179f[_0x40c7('0x42')]=qs[_0x40c7('0x39')](_[_0x40c7('0x43')](_0x48ddcb['query'],_0x4cee00['filters']),_0x27cd86);if(_0x48ddcb[_0x40c7('0x38')][_0x40c7('0x44')]){_0x3d179f[_0x40c7('0x42')]=_[_0x40c7('0x45')](_0x3d179f[_0x40c7('0x42')],{'$or':_['map'](_0x27cd86,function(_0x4145f5){if(_0x4145f5['type']!==_0x40c7('0x46')){var _0x6c855c={};_0x6c855c[_0x4145f5[_0x40c7('0x2e')]]={'$like':'%'+_0x48ddcb['query']['filter']+'%'};return _0x6c855c;}})});}_0x3d179f=_[_0x40c7('0x45')]({},_0x3d179f,_0x48ddcb[_0x40c7('0x47')]);var _0x1e078f={'where':_0x3d179f[_0x40c7('0x42')]};return db[_0x40c7('0x31')][_0x40c7('0x1f')](_0x1e078f)[_0x40c7('0x28')](function(_0x26c16d){_0x2d588f[_0x40c7('0x1f')]=_0x26c16d;if(_0x48ddcb[_0x40c7('0x38')][_0x40c7('0x48')]){_0x3d179f[_0x40c7('0x49')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x40c7('0x4a')](_0x3d179f);})[_0x40c7('0x28')](function(_0x4bf927){_0x2d588f[_0x40c7('0x4b')]=_0x4bf927;return _0x2d588f;})[_0x40c7('0x28')](respondWithFilteredResult(_0x56337f,_0x3d179f))[_0x40c7('0x4c')](handleError(_0x56337f,null));};exports[_0x40c7('0x4d')]=function(_0x28e2b2,_0x4d2cb9){var _0x1dbcc4={'raw':![],'where':{'id':_0x28e2b2[_0x40c7('0x4e')]['id']}},_0x3f266b={};_0x3f266b[_0x40c7('0x36')]=_['keys'](db[_0x40c7('0x31')]['rawAttributes']);_0x3f266b[_0x40c7('0x38')]=_['keys'](_0x28e2b2['query']);_0x3f266b['filters']=_[_0x40c7('0x3a')](_0x3f266b[_0x40c7('0x36')],_0x3f266b[_0x40c7('0x38')]);_0x1dbcc4[_0x40c7('0x3b')]=_['intersection'](_0x3f266b[_0x40c7('0x36')],qs['fields'](_0x28e2b2['query'][_0x40c7('0x3c')]));_0x1dbcc4[_0x40c7('0x3b')]=_0x1dbcc4[_0x40c7('0x3b')][_0x40c7('0x3d')]?_0x1dbcc4[_0x40c7('0x3b')]:_0x3f266b['model'];if(_0x28e2b2[_0x40c7('0x38')][_0x40c7('0x48')]){_0x1dbcc4['include']=[{'all':!![]}];}_0x1dbcc4=_[_0x40c7('0x45')]({},_0x1dbcc4,_0x28e2b2[_0x40c7('0x47')]);return db['AnalyticCustomReport'][_0x40c7('0x4f')](_0x1dbcc4)[_0x40c7('0x28')](handleEntityNotFound(_0x4d2cb9,null))['then'](respondWithResult(_0x4d2cb9,null))[_0x40c7('0x4c')](handleError(_0x4d2cb9,null));};exports['create']=function(_0x28fc4d,_0x3315c3){return db['AnalyticCustomReport']['create'](_0x28fc4d['body'],{})['then'](function(_0x5ad102){var _0x5735dc=_0x28fc4d[_0x40c7('0x50')]['get']({'plain':!![]});if(!_0x5735dc)throw new Error(_0x40c7('0x51'));if(_0x5735dc[_0x40c7('0x52')]===_0x40c7('0x50')){var _0x5e3433=_0x5ad102['get']({'plain':!![]});var _0x574803=_0x40c7('0x53');return db['UserProfileSection'][_0x40c7('0x4f')]({'where':{'name':_0x574803,'userProfileId':_0x5735dc[_0x40c7('0x54')]},'raw':!![]})[_0x40c7('0x28')](function(_0x8b1776){if(_0x8b1776&&_0x8b1776[_0x40c7('0x55')]===0x0){return db[_0x40c7('0x2b')][_0x40c7('0x56')]({'name':_0x5e3433[_0x40c7('0x2e')],'resourceId':_0x5e3433['id'],'type':_0x40c7('0x2a'),'sectionId':_0x8b1776['id']},{})['then'](function(){return _0x5ad102;});}else{return _0x5ad102;}})[_0x40c7('0x4c')](function(_0x1d911b){logger[_0x40c7('0x2c')](_0x40c7('0x57'),_0x1d911b);throw _0x1d911b;});}return _0x5ad102;})[_0x40c7('0x28')](respondWithResult(_0x3315c3,0xc9))['catch'](handleError(_0x3315c3,null));};exports[_0x40c7('0x26')]=function(_0x4c4d28,_0x507d76){if(_0x4c4d28[_0x40c7('0x58')]['id']){delete _0x4c4d28[_0x40c7('0x58')]['id'];}return db[_0x40c7('0x31')][_0x40c7('0x4f')]({'where':{'id':_0x4c4d28[_0x40c7('0x4e')]['id']}})[_0x40c7('0x28')](handleEntityNotFound(_0x507d76,null))[_0x40c7('0x28')](saveUpdates(_0x4c4d28['body'],null))[_0x40c7('0x28')](respondWithResult(_0x507d76,null))[_0x40c7('0x4c')](handleError(_0x507d76,null));};exports[_0x40c7('0x27')]=function(_0x28eb9b,_0x58c99d){return db['AnalyticCustomReport'][_0x40c7('0x4f')]({'where':{'id':_0x28eb9b['params']['id']}})[_0x40c7('0x28')](handleEntityNotFound(_0x58c99d,null))[_0x40c7('0x28')](removeEntity(_0x58c99d,null))[_0x40c7('0x4c')](handleError(_0x58c99d,null));};exports[_0x40c7('0x59')]=function(_0x15e596,_0x54f952){var _0x50d744=0xa;var _0xd82fba=[_0x40c7('0x5a'),_0x40c7('0x5b'),_0x40c7('0x5c'),_0x40c7('0x5d')];var _0x37c826={'SUM':_0x40c7('0x5e'),'COUNT':_0x40c7('0x5f'),'COUNT DISTINCT':_0x40c7('0x60'),'MAX':'MAX(%s)','MIN':_0x40c7('0x61'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x40c7('0x62'),'GROUP_CONCAT DESC':_0x40c7('0x63')};var _0x58ebb0={'SEC_TO_TIME':_0x40c7('0x64'),'DATE':_0x40c7('0x65'),'HOUR':_0x40c7('0x66'),'ROUND':_0x40c7('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1e93d2=function(_0xb1cfb8){return!_[_0x40c7('0x68')]([_0x40c7('0x69'),_0x40c7('0x6a'),'IS\x20EMPTY',_0x40c7('0x6b')],_0xb1cfb8);};var _0xe41013=function(_0xc379b3){if(!_0xc379b3||!_0xc379b3[_0x40c7('0x6c')]['length']){return'';}for(var _0x27677d='(',_0x4289bb=0x0;_0x4289bb<_0xc379b3[_0x40c7('0x6c')][_0x40c7('0x3d')];_0x4289bb+=0x1){_0x4289bb>0x0&&(_0x27677d+='\x20'+_0xc379b3[_0x40c7('0x6d')]+'\x20');_0x27677d+=_0xc379b3[_0x40c7('0x6c')][_0x4289bb][_0x40c7('0x6e')]?_0xe41013(_0xc379b3['rules'][_0x4289bb][_0x40c7('0x6e')]):_0xc379b3[_0x40c7('0x6c')][_0x4289bb][_0x40c7('0x6f')]+'\x20'+_0xc379b3[_0x40c7('0x6c')][_0x4289bb][_0x40c7('0x70')]+(_0x1e93d2(_0xc379b3[_0x40c7('0x6c')][_0x4289bb]['condition'])?'\x20'+_0xc379b3['rules'][_0x4289bb]['value']:'');}return _0x27677d+')';};var _0x53b854={'where':{'id':_0x15e596[_0x40c7('0x4e')]['id']}},_0x457cb0,_0x2c76da,_0x147506,_0x1557ef,_0x3dc9be;_0x53b854=_[_0x40c7('0x45')]({},_0x53b854,_0x15e596[_0x40c7('0x47')]);return db[_0x40c7('0x31')][_0x40c7('0x4f')](_0x53b854)['then'](function(_0x4745c7){if(_0x4745c7){_0x457cb0=_0x4745c7;return _0x4745c7[_0x40c7('0x71')]();}return null;})[_0x40c7('0x28')](function(_0x26951f){if(_0x26951f){if(!_0x26951f[_0x40c7('0x3d')]){throw new db[(_0x40c7('0x72'))][(_0x40c7('0x73'))](_0x40c7('0x74'),0x193);}_0x2c76da=_0x26951f;return db[_0x40c7('0x75')][_0x40c7('0x4a')]({'raw':!![]});}return null;})['then'](function(_0x553fb9){if(_0x553fb9){_0x147506=_[_0x40c7('0x76')](_0x553fb9,'id');var _0x2054aa;var _0x13ee44=squel[_0x40c7('0x77')]();_0x13ee44[_0x40c7('0x78')](_0x457cb0[_0x40c7('0x79')]);for(var _0x353b11=0x0;_0x353b11<_0x2c76da['length'];_0x353b11+=0x1){_0x2054aa=_0x2c76da[_0x353b11][_0x40c7('0x7a')]?_0x147506[_0x2c76da[_0x353b11][_0x40c7('0x7a')]][_0x40c7('0x7b')]:_0x2c76da[_0x353b11][_0x40c7('0x6f')];_0x2054aa=_0x2c76da[_0x353b11][_0x40c7('0x7c')]?_[_0x40c7('0x7d')](_0x37c826[_0x2c76da[_0x353b11]['function']],'%s',_0x2054aa):_0x2054aa;_0x2054aa=_0x2c76da[_0x353b11][_0x40c7('0x7e')]?_[_0x40c7('0x7d')](_0x58ebb0[_0x2c76da[_0x353b11][_0x40c7('0x7e')]],'%s',_0x2054aa):_0x2054aa;if(_0x2c76da[_0x353b11][_0x40c7('0x7f')]){_0x13ee44[_0x40c7('0x6e')](_0x2054aa);}_0x2c76da[_0x353b11][_0x40c7('0x80')]&&_0x13ee44[_0x40c7('0x40')](_0x2054aa,_0x2c76da[_0x353b11][_0x40c7('0x80')]===_0x40c7('0x81')?![]:!![]);_0x13ee44['field'](_0x2054aa,_0x2c76da[_0x353b11][_0x40c7('0x82')]||_0x2054aa);}if(_0x457cb0['joins']){_0x457cb0[_0x40c7('0x83')]=JSON['parse'](_0x457cb0[_0x40c7('0x83')]);for(var _0xd6184c=0x0;_0xd6184c<_0x457cb0['joins'][_0x40c7('0x3d')];_0xd6184c+=0x1){if(_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x34')]&&_[_0x40c7('0x68')](_0xd82fba,_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x34')])&&_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x84')]&&_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x85')]&&_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x86')]){_0x13ee44[_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x34')]](_0x457cb0['joins'][_0xd6184c]['foreignTable'],null,util[_0x40c7('0x7e')](_0x40c7('0x87'),_0x457cb0[_0x40c7('0x79')],_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x84')],_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x85')],_0x457cb0[_0x40c7('0x83')][_0xd6184c][_0x40c7('0x86')]));}}}if(_0x457cb0[_0x40c7('0x88')]){_0x457cb0[_0x40c7('0x88')]=JSON[_0x40c7('0x89')](_0x457cb0[_0x40c7('0x88')]);_0x13ee44['where'](_0xe41013(_0x457cb0[_0x40c7('0x88')][_0x40c7('0x6e')]));}_0x3dc9be=_0x13ee44['clone']();_0x13ee44[_0x40c7('0x1d')](_0x50d744);_0x13ee44['offset'](0x0);logger['debug'](_0x40c7('0x8a'),_0x13ee44[_0x40c7('0x8b')]());return dbH[_0x40c7('0x8c')][_0x40c7('0x38')](_0x13ee44[_0x40c7('0x8b')](),{'type':dbH[_0x40c7('0x8c')][_0x40c7('0x8d')][_0x40c7('0x8e')]});}})[_0x40c7('0x28')](respondWithResult(_0x54f952,null))[_0x40c7('0x4c')](handleError(_0x54f952,null));};function runReport(_0x46068d,_0x1bc791,_0x183f17){var _0xcc758e=_0x1bc791[_0x40c7('0x2e')];var _0x3b6310=0xa;var _0x5b1931=['join',_0x40c7('0x5b'),_0x40c7('0x5c'),_0x40c7('0x5d')];var _0x2d43e2={'SUM':_0x40c7('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x40c7('0x60'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x40c7('0x8f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x40c7('0x63')};var _0x550d87={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x40c7('0x65'),'HOUR':_0x40c7('0x66'),'ROUND':_0x40c7('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1e9=function(_0x41f304){return!_[_0x40c7('0x68')]([_0x40c7('0x69'),'IS\x20NOT\x20NULL',_0x40c7('0x90'),'IS\x20NOT\x20EMPTY'],_0x41f304);};var _0x205753=function(_0x39c482){if(!_0x39c482||!_0x39c482['rules']['length']){return'';}for(var _0x1bd470='(',_0x2a1cdb=0x0;_0x2a1cdb<_0x39c482['rules']['length'];_0x2a1cdb+=0x1){_0x2a1cdb>0x0&&(_0x1bd470+='\x20'+_0x39c482['operator']+'\x20');_0x1bd470+=_0x39c482[_0x40c7('0x6c')][_0x2a1cdb][_0x40c7('0x6e')]?_0x205753(_0x39c482[_0x40c7('0x6c')][_0x2a1cdb][_0x40c7('0x6e')]):_0x39c482[_0x40c7('0x6c')][_0x2a1cdb]['field']+'\x20'+_0x39c482[_0x40c7('0x6c')][_0x2a1cdb]['condition']+(_0x34c1e9(_0x39c482[_0x40c7('0x6c')][_0x2a1cdb][_0x40c7('0x70')])?'\x20'+_0x39c482['rules'][_0x2a1cdb][_0x40c7('0x91')]:'');}return _0x1bd470+')';};var _0x2ae098={'where':{'id':_0x46068d['id']}},_0x3a179c,_0x1a33a2,_0x25ebfe,_0x433f0a,_0x3a2bc6;_0x2ae098=_[_0x40c7('0x45')]({},_0x2ae098,_0x183f17);return db['AnalyticCustomReport'][_0x40c7('0x4f')](_0x2ae098)[_0x40c7('0x28')](function(_0x5c60f1){if(_0x5c60f1){_0x3a179c=_0x5c60f1;return _0x5c60f1[_0x40c7('0x71')]();}return null;})['then'](function(_0x3d4b47){if(_0x3d4b47){if(!_0x3d4b47[_0x40c7('0x3d')]){throw new db['Sequelize'][(_0x40c7('0x73'))](_0x40c7('0x74'),0x193);}_0x1a33a2=_0x3d4b47;return db['AnalyticMetric'][_0x40c7('0x4a')]({'raw':!![]});}return null;})['then'](function(_0x207518){if(_0x207518){_0x25ebfe=_[_0x40c7('0x76')](_0x207518,'id');var _0x52c54c;var _0x3b989e=squel[_0x40c7('0x77')]();_0x3b989e[_0x40c7('0x78')](_0x3a179c[_0x40c7('0x79')]);for(var _0x348025=0x0;_0x348025<_0x1a33a2[_0x40c7('0x3d')];_0x348025+=0x1){_0x52c54c=_0x1a33a2[_0x348025][_0x40c7('0x7a')]?_0x25ebfe[_0x1a33a2[_0x348025][_0x40c7('0x7a')]][_0x40c7('0x7b')]:_0x1a33a2[_0x348025][_0x40c7('0x6f')];_0x52c54c=_0x1a33a2[_0x348025][_0x40c7('0x7c')]?_[_0x40c7('0x7d')](_0x2d43e2[_0x1a33a2[_0x348025]['function']],'%s',_0x52c54c):_0x52c54c;_0x52c54c=_0x1a33a2[_0x348025][_0x40c7('0x7e')]?_[_0x40c7('0x7d')](_0x550d87[_0x1a33a2[_0x348025][_0x40c7('0x7e')]],'%s',_0x52c54c):_0x52c54c;if(_0x1a33a2[_0x348025][_0x40c7('0x7f')]){_0x3b989e[_0x40c7('0x6e')](_0x52c54c);}_0x1a33a2[_0x348025]['orderBy']&&_0x3b989e[_0x40c7('0x40')](_0x52c54c,_0x1a33a2[_0x348025][_0x40c7('0x80')]===_0x40c7('0x81')?![]:!![]);_0x3b989e['field'](_0x52c54c,_0x1a33a2[_0x348025][_0x40c7('0x82')]||_0x52c54c);}if(_0x3a179c[_0x40c7('0x83')]){_0x3a179c[_0x40c7('0x83')]=JSON['parse'](_0x3a179c[_0x40c7('0x83')]);for(var _0x3c3e99=0x0;_0x3c3e99<_0x3a179c[_0x40c7('0x83')][_0x40c7('0x3d')];_0x3c3e99+=0x1){if(_0x3a179c[_0x40c7('0x83')][_0x3c3e99][_0x40c7('0x34')]&&_['includes'](_0x5b1931,_0x3a179c['joins'][_0x3c3e99][_0x40c7('0x34')])&&_0x3a179c[_0x40c7('0x83')][_0x3c3e99][_0x40c7('0x84')]&&_0x3a179c[_0x40c7('0x83')][_0x3c3e99][_0x40c7('0x85')]&&_0x3a179c['joins'][_0x3c3e99]['foreignKey']){_0x3b989e[_0x3a179c[_0x40c7('0x83')][_0x3c3e99]['type']](_0x3a179c[_0x40c7('0x83')][_0x3c3e99][_0x40c7('0x85')],null,util[_0x40c7('0x7e')](_0x40c7('0x87'),_0x3a179c[_0x40c7('0x79')],_0x3a179c['joins'][_0x3c3e99][_0x40c7('0x84')],_0x3a179c[_0x40c7('0x83')][_0x3c3e99][_0x40c7('0x85')],_0x3a179c[_0x40c7('0x83')][_0x3c3e99][_0x40c7('0x86')]));}}}if(_0x3a179c[_0x40c7('0x88')]){_0x3a179c[_0x40c7('0x88')]=JSON[_0x40c7('0x89')](_0x3a179c[_0x40c7('0x88')]);_0x3b989e[_0x40c7('0x42')](_0x205753(_0x3a179c[_0x40c7('0x88')][_0x40c7('0x6e')]));}_0x3a2bc6=_0x3b989e[_0x40c7('0x92')]();_0x3b989e[_0x40c7('0x1d')](_0x3b6310);_0x3b989e[_0x40c7('0x1e')](0x0);return;}})[_0x40c7('0x28')](function(){if(_0x1bc791[_0x40c7('0x93')]===_0x40c7('0x94')){return null;}var _0x14c8b9=_['merge'](_0x1bc791,{'name':_0x1bc791[_0x40c7('0x95')]||_0x1bc791[_0x40c7('0x2e')]||_0x3a179c[_0x40c7('0x2e')],'basename':_0xcc758e,'savename':util['format'](_0x40c7('0x96'),_0x1bc791[_0x40c7('0x2e')]||_0x3a179c[_0x40c7('0x2e')],require(_0x40c7('0x97'))[_0x40c7('0x98')](0x4),_0x1bc791[_0x40c7('0x93')]||_0x40c7('0x99')),'reportId':_0x3a179c['id'],'reportType':_0x40c7('0x9a')});return db[_0x40c7('0x9b')][_0x40c7('0x56')](_0x14c8b9,{'raw':!![]});})[_0x40c7('0x28')](function(_0x15afec){if(_0x3a179c[_0x40c7('0x79')]==='cdr'){_0x3a2bc6['where'](_0x3a179c[_0x40c7('0x79')]+_0x40c7('0x9c'),_0x1bc791['startDate'],_0x1bc791[_0x40c7('0x9d')]);}else{_0x3a2bc6[_0x40c7('0x42')](_0x3a179c['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1bc791[_0x40c7('0x9e')],_0x1bc791['endDate']);}if(_0x15afec){logger['info']('Run\x20Query:',_0x3a2bc6[_0x40c7('0x8b')]());require('child_process')[_0x40c7('0x9f')](path[_0x40c7('0x5a')](__dirname,_0x40c7('0xa0'),_0x15afec['output']),[_0x15afec['id'],_0x3a2bc6[_0x40c7('0x8b')](),path['join'](__dirname,'../../files/reports',_0x15afec['savename']),_0xcc758e]);return _0x15afec;}else{var _0x392ce9=squel[_0x40c7('0x77')]();_0x392ce9['from']('('+_0x3a2bc6[_0x40c7('0x8b')]()+')',_0x40c7('0xa1'));_0x392ce9['field'](_0x40c7('0xa2'),_0x40c7('0x1f'));_0x3a2bc6[_0x40c7('0x1d')](_0x1bc791[_0x40c7('0x1d')]||_0x3b6310);_0x3a2bc6[_0x40c7('0x1e')](_0x1bc791[_0x40c7('0x1e')]||0x0);return dbH[_0x40c7('0x8c')][_0x40c7('0x38')](_0x392ce9[_0x40c7('0x8b')](),{'type':dbH['sequelize'][_0x40c7('0x8d')][_0x40c7('0x8e')]})[_0x40c7('0x28')](function(_0x18795d){if(!_0x18795d[_0x40c7('0x3d')]){_0x433f0a=0x0;}else{_0x433f0a=_0x18795d[0x0][_0x40c7('0x1f')]||0x0;}return dbH[_0x40c7('0x8c')][_0x40c7('0x38')](_0x3a2bc6[_0x40c7('0x8b')](),{'type':dbH['sequelize'][_0x40c7('0x8d')][_0x40c7('0x8e')]});})[_0x40c7('0x28')](function(_0x2a2ae8){return{'rows':_0x2a2ae8||[],'count':_0x433f0a};});}});}exports[_0x40c7('0xa3')]=function(_0x389e64,_0x399349){return runReport(_0x389e64[_0x40c7('0x4e')],_0x389e64[_0x40c7('0x38')],_0x389e64[_0x40c7('0x47')])[_0x40c7('0x28')](respondWithResult(_0x399349,null))[_0x40c7('0x4c')](handleError(_0x399349,null));};exports[_0x40c7('0xa4')]=runReport;exports[_0x40c7('0x38')]=function(_0x4d8c1f,_0x138f19){var _0x1c49e2=0xa;var _0x503267=[_0x40c7('0x5a'),_0x40c7('0x5b'),_0x40c7('0x5c'),_0x40c7('0x5d')];var _0x39fcc0={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x40c7('0x60'),'MAX':_0x40c7('0xa5'),'MIN':_0x40c7('0x61'),'AVG':_0x40c7('0xa6'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x40c7('0x62'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x12db73={'SEC_TO_TIME':_0x40c7('0x64'),'DATE':_0x40c7('0x65'),'HOUR':_0x40c7('0x66'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x40c7('0xa7')};var _0x255ddb=function(_0x18c899){return!_[_0x40c7('0x68')]([_0x40c7('0x69'),_0x40c7('0x6a'),_0x40c7('0x90'),'IS\x20NOT\x20EMPTY'],_0x18c899);};var _0x2b936c=function(_0x138ed3){if(!_0x138ed3||!_0x138ed3[_0x40c7('0x6c')][_0x40c7('0x3d')]){return'';}for(var _0x51ee73='(',_0x16572e=0x0;_0x16572e<_0x138ed3[_0x40c7('0x6c')]['length'];_0x16572e+=0x1){_0x16572e>0x0&&(_0x51ee73+='\x20'+_0x138ed3[_0x40c7('0x6d')]+'\x20');_0x51ee73+=_0x138ed3[_0x40c7('0x6c')][_0x16572e][_0x40c7('0x6e')]?_0x2b936c(_0x138ed3[_0x40c7('0x6c')][_0x16572e][_0x40c7('0x6e')]):_0x138ed3[_0x40c7('0x6c')][_0x16572e][_0x40c7('0x6f')]+'\x20'+_0x138ed3[_0x40c7('0x6c')][_0x16572e][_0x40c7('0x70')]+(_0x255ddb(_0x138ed3[_0x40c7('0x6c')][_0x16572e][_0x40c7('0x70')])?'\x20'+_0x138ed3[_0x40c7('0x6c')][_0x16572e][_0x40c7('0x91')]:'');}return _0x51ee73+')';};var _0x16e1fc={'where':{'id':_0x4d8c1f['params']['id']}},_0x5034ad,_0x4cdf28,_0x55e111,_0x4567fc,_0xeb3b6;_0x16e1fc=_[_0x40c7('0x45')]({},_0x16e1fc,_0x4d8c1f[_0x40c7('0x47')]);return db[_0x40c7('0x31')][_0x40c7('0x4f')](_0x16e1fc)[_0x40c7('0x28')](function(_0x3d4a6b){if(_0x3d4a6b){_0x5034ad=_0x3d4a6b;return _0x3d4a6b['getFields']();}return null;})[_0x40c7('0x28')](function(_0x3b6c1b){if(_0x3b6c1b){if(!_0x3b6c1b[_0x40c7('0x3d')]){throw new db['Sequelize'][(_0x40c7('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cdf28=_0x3b6c1b;return db['AnalyticMetric'][_0x40c7('0x4a')]({'raw':!![]});}return null;})[_0x40c7('0x28')](function(_0x557f06){if(_0x557f06){_0x55e111=_['keyBy'](_0x557f06,'id');var _0x1319ae;var _0x2e1407=squel[_0x40c7('0x77')]();_0x2e1407[_0x40c7('0x78')](_0x5034ad[_0x40c7('0x79')]);for(var _0x50c065=0x0;_0x50c065<_0x4cdf28[_0x40c7('0x3d')];_0x50c065+=0x1){_0x1319ae=_0x4cdf28[_0x50c065][_0x40c7('0x7a')]?_0x55e111[_0x4cdf28[_0x50c065][_0x40c7('0x7a')]][_0x40c7('0x7b')]:_0x4cdf28[_0x50c065][_0x40c7('0x6f')];_0x1319ae=_0x4cdf28[_0x50c065][_0x40c7('0x7c')]?_[_0x40c7('0x7d')](_0x39fcc0[_0x4cdf28[_0x50c065]['function']],'%s',_0x1319ae):_0x1319ae;_0x1319ae=_0x4cdf28[_0x50c065][_0x40c7('0x7e')]?_['replace'](_0x12db73[_0x4cdf28[_0x50c065]['format']],'%s',_0x1319ae):_0x1319ae;if(_0x4cdf28[_0x50c065][_0x40c7('0x7f')]){_0x2e1407[_0x40c7('0x6e')](_0x1319ae);}_0x4cdf28[_0x50c065][_0x40c7('0x80')]&&_0x2e1407[_0x40c7('0x40')](_0x1319ae,_0x4cdf28[_0x50c065][_0x40c7('0x80')]===_0x40c7('0x81')?![]:!![]);_0x2e1407[_0x40c7('0x6f')](_0x1319ae,_0x4cdf28[_0x50c065][_0x40c7('0x82')]||_0x1319ae);}if(_0x5034ad[_0x40c7('0x83')]){_0x5034ad[_0x40c7('0x83')]=JSON['parse'](_0x5034ad[_0x40c7('0x83')]);for(var _0x31c259=0x0;_0x31c259<_0x5034ad[_0x40c7('0x83')][_0x40c7('0x3d')];_0x31c259+=0x1){if(_0x5034ad[_0x40c7('0x83')][_0x31c259][_0x40c7('0x34')]&&_['includes'](_0x503267,_0x5034ad[_0x40c7('0x83')][_0x31c259][_0x40c7('0x34')])&&_0x5034ad['joins'][_0x31c259][_0x40c7('0x84')]&&_0x5034ad['joins'][_0x31c259][_0x40c7('0x85')]&&_0x5034ad['joins'][_0x31c259][_0x40c7('0x86')]){_0x2e1407[_0x5034ad['joins'][_0x31c259][_0x40c7('0x34')]](_0x5034ad[_0x40c7('0x83')][_0x31c259][_0x40c7('0x85')],null,util[_0x40c7('0x7e')]('%s.%s\x20=\x20%s.%s',_0x5034ad[_0x40c7('0x79')],_0x5034ad['joins'][_0x31c259][_0x40c7('0x84')],_0x5034ad[_0x40c7('0x83')][_0x31c259]['foreignTable'],_0x5034ad[_0x40c7('0x83')][_0x31c259][_0x40c7('0x86')]));}}}if(_0x5034ad[_0x40c7('0x88')]){_0x5034ad[_0x40c7('0x88')]=JSON['parse'](_0x5034ad[_0x40c7('0x88')]);_0x2e1407['where'](_0x2b936c(_0x5034ad['conditions'][_0x40c7('0x6e')]));}_0xeb3b6=_0x2e1407['clone']();_0x2e1407['limit'](_0x1c49e2);_0x2e1407[_0x40c7('0x1e')](0x0);logger[_0x40c7('0xa8')]('Limited\x20Query:',_0x2e1407[_0x40c7('0x8b')]());return dbH[_0x40c7('0x8c')]['query'](_0x2e1407[_0x40c7('0x8b')](),{'type':dbH[_0x40c7('0x8c')][_0x40c7('0x8d')][_0x40c7('0x8e')]});}})[_0x40c7('0x28')](function(){return{'sql':_0xeb3b6[_0x40c7('0x8b')]()};})[_0x40c7('0x28')](respondWithResult(_0x138f19,null))['catch'](handleError(_0x138f19,null));};
\ No newline at end of file
+var _0x1aac=['right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','replace','function','format','groupBy','orderBy','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','toString','sequelize','QueryTypes','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','select','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','SELECT','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','IS\x20NOT\x20NULL','DESC','alias','debug','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','get','CustomReports','UserProfileResource','error','name','send','map','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join'];(function(_0x40b3f2,_0x2c4f5f){var _0x4ce90c=function(_0x516f31){while(--_0x516f31){_0x40b3f2['push'](_0x40b3f2['shift']());}};_0x4ce90c(++_0x2c4f5f);}(_0x1aac,0xf7));var _0xc1aa=function(_0x33eb9b,_0x58cfb6){_0x33eb9b=_0x33eb9b-0x0;var _0x4ee9bd=_0x1aac[_0x33eb9b];return _0x4ee9bd;};'use strict';var emlformat=require(_0xc1aa('0x0'));var rimraf=require(_0xc1aa('0x1'));var zipdir=require(_0xc1aa('0x2'));var jsonpatch=require(_0xc1aa('0x3'));var rp=require(_0xc1aa('0x4'));var moment=require('moment');var BPromise=require(_0xc1aa('0x5'));var Mustache=require(_0xc1aa('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc1aa('0x7'));var csv=require(_0xc1aa('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1aa('0x9'));var squel=require('squel');var crypto=require(_0xc1aa('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc1aa('0x8'));var querystring=require(_0xc1aa('0xb'));var Papa=require(_0xc1aa('0xc'));var Redis=require(_0xc1aa('0xd'));var authService=require(_0xc1aa('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1aa('0xf'));var logger=require(_0xc1aa('0x10'))(_0xc1aa('0x11'));var utils=require(_0xc1aa('0x12'));var config=require(_0xc1aa('0x13'));var licenseUtil=require(_0xc1aa('0x14'));var db=require(_0xc1aa('0x15'))['db'];var dbH=require('../../mysqldb')[_0xc1aa('0x16')];function respondWithStatusCode(_0x44eeb3,_0x41a57c){_0x41a57c=_0x41a57c||0xcc;return function(_0xb69689){if(_0xb69689){return _0x44eeb3[_0xc1aa('0x17')](_0x41a57c);}return _0x44eeb3[_0xc1aa('0x18')](_0x41a57c)['end']();};}function respondWithResult(_0x393fb2,_0x4a8859){_0x4a8859=_0x4a8859||0xc8;return function(_0x28ce5b){if(_0x28ce5b){return _0x393fb2['status'](_0x4a8859)['json'](_0x28ce5b);}};}function respondWithFilteredResult(_0x224a68,_0x441d00){return function(_0x46ae13){if(_0x46ae13){var _0x14a4a0=typeof _0x441d00[_0xc1aa('0x19')]===_0xc1aa('0x1a')&&typeof _0x441d00[_0xc1aa('0x1b')]===_0xc1aa('0x1a');var _0xa8a1b5=_0x46ae13[_0xc1aa('0x1c')];var _0x9a33b8=_0x14a4a0?0x0:_0x441d00[_0xc1aa('0x19')];var _0x3d3ae7=_0x14a4a0?_0x46ae13[_0xc1aa('0x1c')]:_0x441d00[_0xc1aa('0x19')]+_0x441d00[_0xc1aa('0x1b')];var _0x455c5b;if(_0x3d3ae7>=_0xa8a1b5){_0x3d3ae7=_0xa8a1b5;_0x455c5b=0xc8;}else{_0x455c5b=0xce;}_0x224a68['status'](_0x455c5b);return _0x224a68[_0xc1aa('0x1d')](_0xc1aa('0x1e'),_0x9a33b8+'-'+_0x3d3ae7+'/'+_0xa8a1b5)[_0xc1aa('0x1f')](_0x46ae13);}return null;};}function patchUpdates(_0x7596b0){return function(_0x351a87){try{jsonpatch[_0xc1aa('0x20')](_0x351a87,_0x7596b0,!![]);}catch(_0x3b0867){return BPromise['reject'](_0x3b0867);}return _0x351a87[_0xc1aa('0x21')]();};}function saveUpdates(_0x16d0c0,_0x831d12){return function(_0x372848){if(_0x372848){return _0x372848['update'](_0x16d0c0)[_0xc1aa('0x22')](function(_0x4ad892){return _0x4ad892;});}return null;};}function removeEntity(_0x277907,_0x477e84){return function(_0x413d26){if(_0x413d26){return _0x413d26[_0xc1aa('0x23')]()[_0xc1aa('0x22')](function(){var _0x14dc74=_0x413d26[_0xc1aa('0x24')]({'plain':!![]});var _0x49396d=_0xc1aa('0x25');return db[_0xc1aa('0x26')]['destroy']({'where':{'type':_0x49396d,'resourceId':_0x14dc74['id']}})['then'](function(){return _0x413d26;});})[_0xc1aa('0x22')](function(){_0x277907[_0xc1aa('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11eaa9,_0xc3d52){return function(_0x4a6858){if(!_0x4a6858){_0x11eaa9[_0xc1aa('0x17')](0x194);}return _0x4a6858;};}function handleError(_0x21ff83,_0x68f243){_0x68f243=_0x68f243||0x1f4;return function(_0x4fac78){logger[_0xc1aa('0x27')](_0x4fac78['stack']);if(_0x4fac78[_0xc1aa('0x28')]){delete _0x4fac78['name'];}_0x21ff83['status'](_0x68f243)[_0xc1aa('0x29')](_0x4fac78);};}exports['index']=function(_0x56b21b,_0x23186e){var _0x242f8d={},_0x227aee={},_0x1c3e9b={'count':0x0,'rows':[]};var _0xae966e=_[_0xc1aa('0x2a')](db['AnalyticCustomReport']['rawAttributes'],function(_0x39c00c){return{'name':_0x39c00c['fieldName'],'type':_0x39c00c['type'][_0xc1aa('0x2b')]};});_0x227aee['model']=_[_0xc1aa('0x2a')](_0xae966e,'name');_0x227aee[_0xc1aa('0x2c')]=_['keys'](_0x56b21b[_0xc1aa('0x2c')]);_0x227aee[_0xc1aa('0x2d')]=_[_0xc1aa('0x2e')](_0x227aee[_0xc1aa('0x2f')],_0x227aee[_0xc1aa('0x2c')]);_0x242f8d[_0xc1aa('0x30')]=_[_0xc1aa('0x2e')](_0x227aee[_0xc1aa('0x2f')],qs[_0xc1aa('0x31')](_0x56b21b[_0xc1aa('0x2c')][_0xc1aa('0x31')]));_0x242f8d[_0xc1aa('0x30')]=_0x242f8d[_0xc1aa('0x30')][_0xc1aa('0x32')]?_0x242f8d[_0xc1aa('0x30')]:_0x227aee['model'];if(!_0x56b21b['query'][_0xc1aa('0x33')]('nolimit')){_0x242f8d[_0xc1aa('0x1b')]=qs['limit'](_0x56b21b[_0xc1aa('0x2c')][_0xc1aa('0x1b')]);_0x242f8d[_0xc1aa('0x19')]=qs[_0xc1aa('0x19')](_0x56b21b[_0xc1aa('0x2c')]['offset']);}_0x242f8d[_0xc1aa('0x34')]=qs[_0xc1aa('0x35')](_0x56b21b[_0xc1aa('0x2c')][_0xc1aa('0x35')]);_0x242f8d[_0xc1aa('0x36')]=qs[_0xc1aa('0x2d')](_[_0xc1aa('0x37')](_0x56b21b['query'],_0x227aee[_0xc1aa('0x2d')]),_0xae966e);if(_0x56b21b[_0xc1aa('0x2c')][_0xc1aa('0x38')]){_0x242f8d[_0xc1aa('0x36')]=_[_0xc1aa('0x39')](_0x242f8d['where'],{'$or':_[_0xc1aa('0x2a')](_0xae966e,function(_0x2735df){if(_0x2735df['type']!==_0xc1aa('0x3a')){var _0x2d7bfe={};_0x2d7bfe[_0x2735df[_0xc1aa('0x28')]]={'$like':'%'+_0x56b21b['query'][_0xc1aa('0x38')]+'%'};return _0x2d7bfe;}})});}_0x242f8d=_[_0xc1aa('0x39')]({},_0x242f8d,_0x56b21b[_0xc1aa('0x3b')]);var _0x30a5ed={'where':_0x242f8d['where']};return db[_0xc1aa('0x3c')]['count'](_0x30a5ed)[_0xc1aa('0x22')](function(_0x2c782b){_0x1c3e9b[_0xc1aa('0x1c')]=_0x2c782b;if(_0x56b21b['query'][_0xc1aa('0x3d')]){_0x242f8d[_0xc1aa('0x3e')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xc1aa('0x3f')](_0x242f8d);})[_0xc1aa('0x22')](function(_0xa07b3a){_0x1c3e9b[_0xc1aa('0x40')]=_0xa07b3a;return _0x1c3e9b;})[_0xc1aa('0x22')](respondWithFilteredResult(_0x23186e,_0x242f8d))[_0xc1aa('0x41')](handleError(_0x23186e,null));};exports[_0xc1aa('0x42')]=function(_0xeebe07,_0x2ef2bc){var _0x19334e={'raw':![],'where':{'id':_0xeebe07[_0xc1aa('0x43')]['id']}},_0x7c124={};_0x7c124[_0xc1aa('0x2f')]=_[_0xc1aa('0x44')](db[_0xc1aa('0x3c')][_0xc1aa('0x45')]);_0x7c124[_0xc1aa('0x2c')]=_[_0xc1aa('0x44')](_0xeebe07[_0xc1aa('0x2c')]);_0x7c124['filters']=_[_0xc1aa('0x2e')](_0x7c124[_0xc1aa('0x2f')],_0x7c124[_0xc1aa('0x2c')]);_0x19334e[_0xc1aa('0x30')]=_[_0xc1aa('0x2e')](_0x7c124['model'],qs[_0xc1aa('0x31')](_0xeebe07[_0xc1aa('0x2c')][_0xc1aa('0x31')]));_0x19334e[_0xc1aa('0x30')]=_0x19334e['attributes'][_0xc1aa('0x32')]?_0x19334e[_0xc1aa('0x30')]:_0x7c124[_0xc1aa('0x2f')];if(_0xeebe07[_0xc1aa('0x2c')][_0xc1aa('0x3d')]){_0x19334e[_0xc1aa('0x3e')]=[{'all':!![]}];}_0x19334e=_[_0xc1aa('0x39')]({},_0x19334e,_0xeebe07[_0xc1aa('0x3b')]);return db['AnalyticCustomReport'][_0xc1aa('0x46')](_0x19334e)['then'](handleEntityNotFound(_0x2ef2bc,null))[_0xc1aa('0x22')](respondWithResult(_0x2ef2bc,null))[_0xc1aa('0x41')](handleError(_0x2ef2bc,null));};exports[_0xc1aa('0x47')]=function(_0x56ce29,_0x150180){return db[_0xc1aa('0x3c')][_0xc1aa('0x47')](_0x56ce29['body'],{})[_0xc1aa('0x22')](function(_0x9ce796){var _0x30a113=_0x56ce29[_0xc1aa('0x48')][_0xc1aa('0x24')]({'plain':!![]});if(!_0x30a113)throw new Error(_0xc1aa('0x49'));if(_0x30a113[_0xc1aa('0x4a')]===_0xc1aa('0x48')){var _0x42383e=_0x9ce796[_0xc1aa('0x24')]({'plain':!![]});var _0x3d6bc5=_0xc1aa('0x4b');return db[_0xc1aa('0x4c')][_0xc1aa('0x46')]({'where':{'name':_0x3d6bc5,'userProfileId':_0x30a113[_0xc1aa('0x4d')]},'raw':!![]})[_0xc1aa('0x22')](function(_0xb27003){if(_0xb27003&&_0xb27003[_0xc1aa('0x4e')]===0x0){return db[_0xc1aa('0x26')][_0xc1aa('0x47')]({'name':_0x42383e[_0xc1aa('0x28')],'resourceId':_0x42383e['id'],'type':'CustomReports','sectionId':_0xb27003['id']},{})['then'](function(){return _0x9ce796;});}else{return _0x9ce796;}})[_0xc1aa('0x41')](function(_0x4083fe){logger[_0xc1aa('0x27')](_0xc1aa('0x4f'),_0x4083fe);throw _0x4083fe;});}return _0x9ce796;})[_0xc1aa('0x22')](respondWithResult(_0x150180,0xc9))[_0xc1aa('0x41')](handleError(_0x150180,null));};exports[_0xc1aa('0x50')]=function(_0x2ff238,_0x50877c){if(_0x2ff238[_0xc1aa('0x51')]['id']){delete _0x2ff238[_0xc1aa('0x51')]['id'];}return db[_0xc1aa('0x3c')][_0xc1aa('0x46')]({'where':{'id':_0x2ff238[_0xc1aa('0x43')]['id']}})[_0xc1aa('0x22')](handleEntityNotFound(_0x50877c,null))[_0xc1aa('0x22')](saveUpdates(_0x2ff238['body'],null))[_0xc1aa('0x22')](respondWithResult(_0x50877c,null))[_0xc1aa('0x41')](handleError(_0x50877c,null));};exports['destroy']=function(_0x3f873c,_0x288362){return db['AnalyticCustomReport'][_0xc1aa('0x46')]({'where':{'id':_0x3f873c[_0xc1aa('0x43')]['id']}})[_0xc1aa('0x22')](handleEntityNotFound(_0x288362,null))[_0xc1aa('0x22')](removeEntity(_0x288362,null))[_0xc1aa('0x41')](handleError(_0x288362,null));};exports[_0xc1aa('0x52')]=function(_0x24980f,_0x572060){var _0x53cd73=0xa;var _0x5843e7=[_0xc1aa('0x53'),_0xc1aa('0x54'),_0xc1aa('0x55'),_0xc1aa('0x56')];var _0x157d9f={'SUM':_0xc1aa('0x57'),'COUNT':_0xc1aa('0x58'),'COUNT DISTINCT':_0xc1aa('0x59'),'MAX':_0xc1aa('0x5a'),'MIN':_0xc1aa('0x5b'),'AVG':_0xc1aa('0x5c'),'GROUP_CONCAT':_0xc1aa('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x423ad3={'SEC_TO_TIME':_0xc1aa('0x5e'),'DATE':_0xc1aa('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xc1aa('0x60'),'UNIX_TIMESTAMP':_0xc1aa('0x61')};var _0x547c3c=function(_0x35e814){return!_[_0xc1aa('0x62')]([_0xc1aa('0x63'),'IS\x20NOT\x20NULL',_0xc1aa('0x64'),_0xc1aa('0x65')],_0x35e814);};var _0x5dae7d=function(_0x35f8d8){if(!_0x35f8d8||!_0x35f8d8[_0xc1aa('0x66')][_0xc1aa('0x32')]){return'';}for(var _0x4c1db4='(',_0x1fc32a=0x0;_0x1fc32a<_0x35f8d8[_0xc1aa('0x66')][_0xc1aa('0x32')];_0x1fc32a+=0x1){_0x1fc32a>0x0&&(_0x4c1db4+='\x20'+_0x35f8d8[_0xc1aa('0x67')]+'\x20');_0x4c1db4+=_0x35f8d8[_0xc1aa('0x66')][_0x1fc32a][_0xc1aa('0x68')]?_0x5dae7d(_0x35f8d8['rules'][_0x1fc32a][_0xc1aa('0x68')]):_0x35f8d8['rules'][_0x1fc32a][_0xc1aa('0x69')]+'\x20'+_0x35f8d8[_0xc1aa('0x66')][_0x1fc32a]['condition']+(_0x547c3c(_0x35f8d8[_0xc1aa('0x66')][_0x1fc32a][_0xc1aa('0x6a')])?'\x20'+_0x35f8d8[_0xc1aa('0x66')][_0x1fc32a][_0xc1aa('0x6b')]:'');}return _0x4c1db4+')';};var _0x28769c={'where':{'id':_0x24980f['params']['id']}},_0x3fe7ce,_0x529171,_0x3389b1,_0x21e802,_0x4e509c;_0x28769c=_['merge']({},_0x28769c,_0x24980f[_0xc1aa('0x3b')]);return db[_0xc1aa('0x3c')]['find'](_0x28769c)[_0xc1aa('0x22')](function(_0x336eb0){if(_0x336eb0){_0x3fe7ce=_0x336eb0;return _0x336eb0[_0xc1aa('0x6c')]();}return null;})['then'](function(_0x13548c){if(_0x13548c){if(!_0x13548c[_0xc1aa('0x32')]){throw new db[(_0xc1aa('0x6d'))][(_0xc1aa('0x6e'))](_0xc1aa('0x6f'),0x193);}_0x529171=_0x13548c;return db[_0xc1aa('0x70')][_0xc1aa('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x3da79d){if(_0x3da79d){_0x3389b1=_[_0xc1aa('0x71')](_0x3da79d,'id');var _0x6d94f5;var _0xb1505=squel['select']();_0xb1505[_0xc1aa('0x72')](_0x3fe7ce[_0xc1aa('0x73')]);for(var _0x40fb18=0x0;_0x40fb18<_0x529171[_0xc1aa('0x32')];_0x40fb18+=0x1){_0x6d94f5=_0x529171[_0x40fb18][_0xc1aa('0x74')]?_0x3389b1[_0x529171[_0x40fb18][_0xc1aa('0x74')]]['metric']:_0x529171[_0x40fb18][_0xc1aa('0x69')];_0x6d94f5=_0x529171[_0x40fb18]['function']?_[_0xc1aa('0x75')](_0x157d9f[_0x529171[_0x40fb18][_0xc1aa('0x76')]],'%s',_0x6d94f5):_0x6d94f5;_0x6d94f5=_0x529171[_0x40fb18][_0xc1aa('0x77')]?_['replace'](_0x423ad3[_0x529171[_0x40fb18][_0xc1aa('0x77')]],'%s',_0x6d94f5):_0x6d94f5;if(_0x529171[_0x40fb18][_0xc1aa('0x78')]){_0xb1505[_0xc1aa('0x68')](_0x6d94f5);}_0x529171[_0x40fb18]['orderBy']&&_0xb1505[_0xc1aa('0x34')](_0x6d94f5,_0x529171[_0x40fb18][_0xc1aa('0x79')]==='DESC'?![]:!![]);_0xb1505[_0xc1aa('0x69')](_0x6d94f5,_0x529171[_0x40fb18]['alias']||_0x6d94f5);}if(_0x3fe7ce[_0xc1aa('0x7a')]){_0x3fe7ce[_0xc1aa('0x7a')]=JSON[_0xc1aa('0x7b')](_0x3fe7ce[_0xc1aa('0x7a')]);for(var _0x613e01=0x0;_0x613e01<_0x3fe7ce[_0xc1aa('0x7a')][_0xc1aa('0x32')];_0x613e01+=0x1){if(_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01][_0xc1aa('0x7c')]&&_[_0xc1aa('0x62')](_0x5843e7,_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01]['type'])&&_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01][_0xc1aa('0x7d')]&&_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01][_0xc1aa('0x7e')]&&_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01][_0xc1aa('0x7f')]){_0xb1505[_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01][_0xc1aa('0x7c')]](_0x3fe7ce['joins'][_0x613e01][_0xc1aa('0x7e')],null,util['format'](_0xc1aa('0x80'),_0x3fe7ce[_0xc1aa('0x73')],_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01]['parentKey'],_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01][_0xc1aa('0x7e')],_0x3fe7ce[_0xc1aa('0x7a')][_0x613e01]['foreignKey']));}}}if(_0x3fe7ce['conditions']){_0x3fe7ce[_0xc1aa('0x81')]=JSON[_0xc1aa('0x7b')](_0x3fe7ce[_0xc1aa('0x81')]);_0xb1505[_0xc1aa('0x36')](_0x5dae7d(_0x3fe7ce[_0xc1aa('0x81')][_0xc1aa('0x68')]));}_0x4e509c=_0xb1505[_0xc1aa('0x82')]();_0xb1505['limit'](_0x53cd73);_0xb1505['offset'](0x0);logger['debug']('Limited\x20Query:',_0xb1505[_0xc1aa('0x83')]());return dbH['sequelize']['query'](_0xb1505[_0xc1aa('0x83')](),{'type':dbH[_0xc1aa('0x84')][_0xc1aa('0x85')]['SELECT']});}})[_0xc1aa('0x22')](respondWithResult(_0x572060,null))[_0xc1aa('0x41')](handleError(_0x572060,null));};function runReport(_0x3ec401,_0x256293,_0x312047){var _0x407622=_0x256293['name'];var _0x476337=0xa;var _0x1a93de=[_0xc1aa('0x53'),_0xc1aa('0x54'),_0xc1aa('0x55'),_0xc1aa('0x56')];var _0x582f89={'SUM':_0xc1aa('0x57'),'COUNT':_0xc1aa('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc1aa('0x5a'),'MIN':_0xc1aa('0x5b'),'AVG':_0xc1aa('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc1aa('0x86')};var _0x1cccb8={'SEC_TO_TIME':_0xc1aa('0x5e'),'DATE':_0xc1aa('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xc1aa('0x60'),'UNIX_TIMESTAMP':_0xc1aa('0x61')};var _0x5d3d67=function(_0x14213e){return!_[_0xc1aa('0x62')]([_0xc1aa('0x63'),'IS\x20NOT\x20NULL',_0xc1aa('0x64'),_0xc1aa('0x65')],_0x14213e);};var _0x37a967=function(_0x122cd4){if(!_0x122cd4||!_0x122cd4[_0xc1aa('0x66')][_0xc1aa('0x32')]){return'';}for(var _0x295fcd='(',_0x320227=0x0;_0x320227<_0x122cd4['rules'][_0xc1aa('0x32')];_0x320227+=0x1){_0x320227>0x0&&(_0x295fcd+='\x20'+_0x122cd4[_0xc1aa('0x67')]+'\x20');_0x295fcd+=_0x122cd4[_0xc1aa('0x66')][_0x320227][_0xc1aa('0x68')]?_0x37a967(_0x122cd4['rules'][_0x320227][_0xc1aa('0x68')]):_0x122cd4[_0xc1aa('0x66')][_0x320227][_0xc1aa('0x69')]+'\x20'+_0x122cd4[_0xc1aa('0x66')][_0x320227]['condition']+(_0x5d3d67(_0x122cd4[_0xc1aa('0x66')][_0x320227][_0xc1aa('0x6a')])?'\x20'+_0x122cd4['rules'][_0x320227][_0xc1aa('0x6b')]:'');}return _0x295fcd+')';};var _0x800f31={'where':{'id':_0x3ec401['id']}},_0x5886af,_0x2952e5,_0x42987d,_0x259f7e,_0x5abd74;_0x800f31=_[_0xc1aa('0x39')]({},_0x800f31,_0x312047);return db[_0xc1aa('0x3c')][_0xc1aa('0x46')](_0x800f31)[_0xc1aa('0x22')](function(_0x243fd8){if(_0x243fd8){_0x5886af=_0x243fd8;return _0x243fd8[_0xc1aa('0x6c')]();}return null;})[_0xc1aa('0x22')](function(_0xc63595){if(_0xc63595){if(!_0xc63595[_0xc1aa('0x32')]){throw new db[(_0xc1aa('0x6d'))][(_0xc1aa('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2952e5=_0xc63595;return db['AnalyticMetric'][_0xc1aa('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x4973b8){if(_0x4973b8){_0x42987d=_[_0xc1aa('0x71')](_0x4973b8,'id');var _0xd860ba;var _0x91a980=squel[_0xc1aa('0x87')]();_0x91a980[_0xc1aa('0x72')](_0x5886af[_0xc1aa('0x73')]);for(var _0x573fc9=0x0;_0x573fc9<_0x2952e5[_0xc1aa('0x32')];_0x573fc9+=0x1){_0xd860ba=_0x2952e5[_0x573fc9][_0xc1aa('0x74')]?_0x42987d[_0x2952e5[_0x573fc9]['MetricId']][_0xc1aa('0x88')]:_0x2952e5[_0x573fc9]['field'];_0xd860ba=_0x2952e5[_0x573fc9][_0xc1aa('0x76')]?_['replace'](_0x582f89[_0x2952e5[_0x573fc9][_0xc1aa('0x76')]],'%s',_0xd860ba):_0xd860ba;_0xd860ba=_0x2952e5[_0x573fc9][_0xc1aa('0x77')]?_[_0xc1aa('0x75')](_0x1cccb8[_0x2952e5[_0x573fc9][_0xc1aa('0x77')]],'%s',_0xd860ba):_0xd860ba;if(_0x2952e5[_0x573fc9]['groupBy']){_0x91a980[_0xc1aa('0x68')](_0xd860ba);}_0x2952e5[_0x573fc9][_0xc1aa('0x79')]&&_0x91a980[_0xc1aa('0x34')](_0xd860ba,_0x2952e5[_0x573fc9][_0xc1aa('0x79')]==='DESC'?![]:!![]);_0x91a980[_0xc1aa('0x69')](_0xd860ba,_0x2952e5[_0x573fc9]['alias']||_0xd860ba);}if(_0x5886af['joins']){_0x5886af[_0xc1aa('0x7a')]=JSON[_0xc1aa('0x7b')](_0x5886af[_0xc1aa('0x7a')]);for(var _0x5ea8f4=0x0;_0x5ea8f4<_0x5886af[_0xc1aa('0x7a')]['length'];_0x5ea8f4+=0x1){if(_0x5886af[_0xc1aa('0x7a')][_0x5ea8f4]['type']&&_[_0xc1aa('0x62')](_0x1a93de,_0x5886af[_0xc1aa('0x7a')][_0x5ea8f4][_0xc1aa('0x7c')])&&_0x5886af[_0xc1aa('0x7a')][_0x5ea8f4][_0xc1aa('0x7d')]&&_0x5886af['joins'][_0x5ea8f4][_0xc1aa('0x7e')]&&_0x5886af[_0xc1aa('0x7a')][_0x5ea8f4]['foreignKey']){_0x91a980[_0x5886af[_0xc1aa('0x7a')][_0x5ea8f4][_0xc1aa('0x7c')]](_0x5886af['joins'][_0x5ea8f4][_0xc1aa('0x7e')],null,util[_0xc1aa('0x77')](_0xc1aa('0x80'),_0x5886af[_0xc1aa('0x73')],_0x5886af['joins'][_0x5ea8f4][_0xc1aa('0x7d')],_0x5886af[_0xc1aa('0x7a')][_0x5ea8f4]['foreignTable'],_0x5886af[_0xc1aa('0x7a')][_0x5ea8f4]['foreignKey']));}}}if(_0x5886af[_0xc1aa('0x81')]){_0x5886af[_0xc1aa('0x81')]=JSON[_0xc1aa('0x7b')](_0x5886af[_0xc1aa('0x81')]);_0x91a980[_0xc1aa('0x36')](_0x37a967(_0x5886af[_0xc1aa('0x81')][_0xc1aa('0x68')]));}_0x5abd74=_0x91a980[_0xc1aa('0x82')]();_0x91a980['limit'](_0x476337);_0x91a980[_0xc1aa('0x19')](0x0);return;}})[_0xc1aa('0x22')](function(){if(_0x256293[_0xc1aa('0x89')]===_0xc1aa('0x8a')){return null;}var _0x5297d6=_[_0xc1aa('0x39')](_0x256293,{'name':_0x256293[_0xc1aa('0x8b')]||_0x256293[_0xc1aa('0x28')]||_0x5886af[_0xc1aa('0x28')],'basename':_0x407622,'savename':util[_0xc1aa('0x77')](_0xc1aa('0x8c'),_0x256293[_0xc1aa('0x28')]||_0x5886af[_0xc1aa('0x28')],require(_0xc1aa('0x8d'))[_0xc1aa('0x8e')](0x4),_0x256293[_0xc1aa('0x89')]||_0xc1aa('0x8f')),'reportId':_0x5886af['id'],'reportType':'custom'});return db[_0xc1aa('0x90')][_0xc1aa('0x47')](_0x5297d6,{'raw':!![]});})[_0xc1aa('0x22')](function(_0x3f8f3e){if(_0x5886af['table']===_0xc1aa('0x91')){_0x5abd74[_0xc1aa('0x36')](_0x5886af[_0xc1aa('0x73')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x256293[_0xc1aa('0x92')],_0x256293[_0xc1aa('0x93')]);}else{_0x5abd74[_0xc1aa('0x36')](_0x5886af['table']+_0xc1aa('0x94'),_0x256293[_0xc1aa('0x92')],_0x256293[_0xc1aa('0x93')]);}if(_0x3f8f3e){logger['info'](_0xc1aa('0x95'),_0x5abd74[_0xc1aa('0x83')]());require(_0xc1aa('0x96'))[_0xc1aa('0x97')](path[_0xc1aa('0x53')](__dirname,_0xc1aa('0x98'),_0x3f8f3e[_0xc1aa('0x89')]),[_0x3f8f3e['id'],_0x5abd74[_0xc1aa('0x83')](),path[_0xc1aa('0x53')](__dirname,'../../files/reports',_0x3f8f3e[_0xc1aa('0x99')]),_0x407622]);return _0x3f8f3e;}else{var _0x9af7fc=squel['select']();_0x9af7fc[_0xc1aa('0x72')]('('+_0x5abd74[_0xc1aa('0x83')]()+')',_0xc1aa('0x9a'));_0x9af7fc['field'](_0xc1aa('0x9b'),_0xc1aa('0x1c'));_0x5abd74['limit'](_0x256293[_0xc1aa('0x1b')]||_0x476337);_0x5abd74[_0xc1aa('0x19')](_0x256293['offset']||0x0);return dbH[_0xc1aa('0x84')][_0xc1aa('0x2c')](_0x9af7fc['toString'](),{'type':dbH[_0xc1aa('0x84')][_0xc1aa('0x85')][_0xc1aa('0x9c')]})[_0xc1aa('0x22')](function(_0x5f1303){if(!_0x5f1303[_0xc1aa('0x32')]){_0x259f7e=0x0;}else{_0x259f7e=_0x5f1303[0x0]['count']||0x0;}return dbH[_0xc1aa('0x84')]['query'](_0x5abd74[_0xc1aa('0x83')](),{'type':dbH['sequelize'][_0xc1aa('0x85')][_0xc1aa('0x9c')]});})[_0xc1aa('0x22')](function(_0x1b5b00){return{'rows':_0x1b5b00||[],'count':_0x259f7e};});}});}exports[_0xc1aa('0x9d')]=function(_0x82d754,_0x2cca8b){return runReport(_0x82d754[_0xc1aa('0x43')],_0x82d754[_0xc1aa('0x2c')],_0x82d754[_0xc1aa('0x3b')])['then'](respondWithResult(_0x2cca8b,null))[_0xc1aa('0x41')](handleError(_0x2cca8b,null));};exports[_0xc1aa('0x9e')]=runReport;exports[_0xc1aa('0x2c')]=function(_0x2c9511,_0x22cd7d){var _0x3a83f6=0xa;var _0x5d6c2c=[_0xc1aa('0x53'),_0xc1aa('0x54'),_0xc1aa('0x55'),_0xc1aa('0x56')];var _0x4ec664={'SUM':_0xc1aa('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc1aa('0x59'),'MAX':_0xc1aa('0x5a'),'MIN':'MIN(%s)','AVG':_0xc1aa('0x5c'),'GROUP_CONCAT':_0xc1aa('0x5d'),'GROUP_CONCAT ASC':_0xc1aa('0x9f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x151873={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc1aa('0x5f'),'HOUR':_0xc1aa('0xa0'),'ROUND':_0xc1aa('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x426980=function(_0x10af7a){return!_[_0xc1aa('0x62')](['IS\x20NULL',_0xc1aa('0xa1'),_0xc1aa('0x64'),_0xc1aa('0x65')],_0x10af7a);};var _0x4cb823=function(_0x360a10){if(!_0x360a10||!_0x360a10[_0xc1aa('0x66')][_0xc1aa('0x32')]){return'';}for(var _0x3aa935='(',_0x535ef3=0x0;_0x535ef3<_0x360a10[_0xc1aa('0x66')][_0xc1aa('0x32')];_0x535ef3+=0x1){_0x535ef3>0x0&&(_0x3aa935+='\x20'+_0x360a10['operator']+'\x20');_0x3aa935+=_0x360a10[_0xc1aa('0x66')][_0x535ef3][_0xc1aa('0x68')]?_0x4cb823(_0x360a10['rules'][_0x535ef3][_0xc1aa('0x68')]):_0x360a10[_0xc1aa('0x66')][_0x535ef3][_0xc1aa('0x69')]+'\x20'+_0x360a10['rules'][_0x535ef3]['condition']+(_0x426980(_0x360a10[_0xc1aa('0x66')][_0x535ef3][_0xc1aa('0x6a')])?'\x20'+_0x360a10['rules'][_0x535ef3][_0xc1aa('0x6b')]:'');}return _0x3aa935+')';};var _0x4bd2cc={'where':{'id':_0x2c9511[_0xc1aa('0x43')]['id']}},_0x5e3ed6,_0x1551c5,_0x1d189c,_0x26e98f,_0x4c9c7f;_0x4bd2cc=_[_0xc1aa('0x39')]({},_0x4bd2cc,_0x2c9511[_0xc1aa('0x3b')]);return db[_0xc1aa('0x3c')][_0xc1aa('0x46')](_0x4bd2cc)[_0xc1aa('0x22')](function(_0x5a893e){if(_0x5a893e){_0x5e3ed6=_0x5a893e;return _0x5a893e['getFields']();}return null;})['then'](function(_0x222a3f){if(_0x222a3f){if(!_0x222a3f['length']){throw new db[(_0xc1aa('0x6d'))][(_0xc1aa('0x6e'))](_0xc1aa('0x6f'),0x193);}_0x1551c5=_0x222a3f;return db[_0xc1aa('0x70')][_0xc1aa('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x5a6188){if(_0x5a6188){_0x1d189c=_[_0xc1aa('0x71')](_0x5a6188,'id');var _0x1f1a31;var _0x2fc693=squel['select']();_0x2fc693[_0xc1aa('0x72')](_0x5e3ed6['table']);for(var _0x52b978=0x0;_0x52b978<_0x1551c5[_0xc1aa('0x32')];_0x52b978+=0x1){_0x1f1a31=_0x1551c5[_0x52b978][_0xc1aa('0x74')]?_0x1d189c[_0x1551c5[_0x52b978][_0xc1aa('0x74')]][_0xc1aa('0x88')]:_0x1551c5[_0x52b978][_0xc1aa('0x69')];_0x1f1a31=_0x1551c5[_0x52b978]['function']?_['replace'](_0x4ec664[_0x1551c5[_0x52b978][_0xc1aa('0x76')]],'%s',_0x1f1a31):_0x1f1a31;_0x1f1a31=_0x1551c5[_0x52b978][_0xc1aa('0x77')]?_[_0xc1aa('0x75')](_0x151873[_0x1551c5[_0x52b978][_0xc1aa('0x77')]],'%s',_0x1f1a31):_0x1f1a31;if(_0x1551c5[_0x52b978][_0xc1aa('0x78')]){_0x2fc693[_0xc1aa('0x68')](_0x1f1a31);}_0x1551c5[_0x52b978][_0xc1aa('0x79')]&&_0x2fc693[_0xc1aa('0x34')](_0x1f1a31,_0x1551c5[_0x52b978][_0xc1aa('0x79')]===_0xc1aa('0xa2')?![]:!![]);_0x2fc693[_0xc1aa('0x69')](_0x1f1a31,_0x1551c5[_0x52b978][_0xc1aa('0xa3')]||_0x1f1a31);}if(_0x5e3ed6[_0xc1aa('0x7a')]){_0x5e3ed6['joins']=JSON[_0xc1aa('0x7b')](_0x5e3ed6['joins']);for(var _0x335994=0x0;_0x335994<_0x5e3ed6[_0xc1aa('0x7a')][_0xc1aa('0x32')];_0x335994+=0x1){if(_0x5e3ed6[_0xc1aa('0x7a')][_0x335994]['type']&&_[_0xc1aa('0x62')](_0x5d6c2c,_0x5e3ed6[_0xc1aa('0x7a')][_0x335994][_0xc1aa('0x7c')])&&_0x5e3ed6[_0xc1aa('0x7a')][_0x335994]['parentKey']&&_0x5e3ed6[_0xc1aa('0x7a')][_0x335994][_0xc1aa('0x7e')]&&_0x5e3ed6[_0xc1aa('0x7a')][_0x335994][_0xc1aa('0x7f')]){_0x2fc693[_0x5e3ed6[_0xc1aa('0x7a')][_0x335994]['type']](_0x5e3ed6['joins'][_0x335994][_0xc1aa('0x7e')],null,util['format'](_0xc1aa('0x80'),_0x5e3ed6[_0xc1aa('0x73')],_0x5e3ed6[_0xc1aa('0x7a')][_0x335994]['parentKey'],_0x5e3ed6[_0xc1aa('0x7a')][_0x335994][_0xc1aa('0x7e')],_0x5e3ed6[_0xc1aa('0x7a')][_0x335994][_0xc1aa('0x7f')]));}}}if(_0x5e3ed6[_0xc1aa('0x81')]){_0x5e3ed6[_0xc1aa('0x81')]=JSON['parse'](_0x5e3ed6[_0xc1aa('0x81')]);_0x2fc693[_0xc1aa('0x36')](_0x4cb823(_0x5e3ed6[_0xc1aa('0x81')][_0xc1aa('0x68')]));}_0x4c9c7f=_0x2fc693['clone']();_0x2fc693['limit'](_0x3a83f6);_0x2fc693[_0xc1aa('0x19')](0x0);logger[_0xc1aa('0xa4')](_0xc1aa('0xa5'),_0x2fc693[_0xc1aa('0x83')]());return dbH[_0xc1aa('0x84')]['query'](_0x2fc693[_0xc1aa('0x83')](),{'type':dbH['sequelize'][_0xc1aa('0x85')][_0xc1aa('0x9c')]});}})[_0xc1aa('0x22')](function(){return{'sql':_0x4c9c7f['toString']()};})[_0xc1aa('0x22')](respondWithResult(_0x22cd7d,null))[_0xc1aa('0x41')](handleError(_0x22cd7d,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index edf7764..5170c20 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 _0x0e11=['path','../../config/environment','./analyticCustomReport.attributes','analytics_custom_reports','../../config/logger','moment'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x0e11,0xac));var _0x10e1=function(_0x2c14dc,_0xccf442){_0x2c14dc=_0x2c14dc-0x0;var _0x1f18e5=_0x0e11[_0x2c14dc];return _0x1f18e5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x10e1('0x0'))('api');var moment=require(_0x10e1('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x10e1('0x2'));var rimraf=require('rimraf');var config=require(_0x10e1('0x3'));var attributes=require(_0x10e1('0x4'));module['exports']=function(_0x3dfd3e,_0x45a19c){return _0x3dfd3e['define']('AnalyticCustomReport',attributes,{'tableName':_0x10e1('0x5'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x434d=['util','../../config/logger','api','moment','request-promise','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x434d,0x11f));var _0xd434=function(_0x657cd3,_0x52504f){_0x657cd3=_0x657cd3-0x0;var _0x4671d4=_0x434d[_0x657cd3];return _0x4671d4;};'use strict';var _=require(_0xd434('0x0'));var util=require(_0xd434('0x1'));var logger=require(_0xd434('0x2'))(_0xd434('0x3'));var moment=require(_0xd434('0x4'));var BPromise=require('bluebird');var rp=require(_0xd434('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd434('0x6'));var config=require('../../config/environment');var attributes=require(_0xd434('0x7'));module[_0xd434('0x8')]=function(_0x31057e,_0x335500){return _0x31057e[_0xd434('0x9')](_0xd434('0xa'),attributes,{'tableName':_0xd434('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 b81d571..c0e9db5 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 _0xc762=['jayson/promise','client','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x23f132,_0x5d919e){var _0x2b10bf=function(_0x396c0d){while(--_0x396c0d){_0x23f132['push'](_0x23f132['shift']());}};_0x2b10bf(++_0x5d919e);}(_0xc762,0x19d));var _0x2c76=function(_0x126f47,_0x2199e9){_0x126f47=_0x126f47-0x0;var _0x49508a=_0xc762[_0x126f47];return _0x49508a;};'use strict';var _=require(_0x2c76('0x0'));var util=require(_0x2c76('0x1'));var moment=require('moment');var BPromise=require(_0x2c76('0x2'));var rs=require(_0x2c76('0x3'));var fs=require('fs');var Redis=require(_0x2c76('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c76('0x5'));var logger=require('../../config/logger')(_0x2c76('0x6'));var config=require('../../config/environment');var jayson=require(_0x2c76('0x7'));var client=jayson[_0x2c76('0x8')][_0x2c76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x539f86,_0x214c57,_0x474187){return new BPromise(function(_0x3acafe,_0x321529){return client['request'](_0x539f86,_0x474187)[_0x2c76('0xa')](function(_0x5578d9){logger['info'](_0x2c76('0xb'),_0x214c57,_0x2c76('0xc'));logger[_0x2c76('0xd')](_0x2c76('0xe'),_0x214c57,'request\x20sent',JSON['stringify'](_0x5578d9));if(_0x5578d9['error']){if(_0x5578d9['error']['code']===0x1f4){logger[_0x2c76('0xf')](_0x2c76('0xb'),_0x214c57,_0x5578d9[_0x2c76('0xf')][_0x2c76('0x10')]);return _0x321529(_0x5578d9['error']['message']);}logger['error'](_0x2c76('0xb'),_0x214c57,_0x5578d9[_0x2c76('0xf')][_0x2c76('0x10')]);return _0x3acafe(_0x5578d9['error'][_0x2c76('0x10')]);}else{logger[_0x2c76('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x214c57,_0x2c76('0xc'));_0x3acafe(_0x5578d9[_0x2c76('0x12')][_0x2c76('0x10')]);}})[_0x2c76('0x13')](function(_0x2ca778){logger['error'](_0x2c76('0xb'),_0x214c57,_0x2ca778);_0x321529(_0x2ca778);});});}
\ No newline at end of file
+var _0x272c=['debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x272c,0x196));var _0xc272=function(_0x44c5ca,_0x2148fe){_0x44c5ca=_0x44c5ca-0x0;var _0x2c4085=_0x272c[_0x44c5ca];return _0x2c4085;};'use strict';var _=require(_0xc272('0x0'));var util=require(_0xc272('0x1'));var moment=require(_0xc272('0x2'));var BPromise=require(_0xc272('0x3'));var rs=require(_0xc272('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc272('0x5'));var logger=require(_0xc272('0x6'))('rpc');var config=require(_0xc272('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc272('0x8')][_0xc272('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45eb0d,_0x4034f6,_0x1e7943){return new BPromise(function(_0x5938a4,_0x159eb4){return client['request'](_0x45eb0d,_0x1e7943)[_0xc272('0xa')](function(_0x256325){logger[_0xc272('0xb')](_0xc272('0xc'),_0x4034f6,_0xc272('0xd'));logger[_0xc272('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x4034f6,'request\x20sent',JSON[_0xc272('0xf')](_0x256325));if(_0x256325[_0xc272('0x10')]){if(_0x256325['error']['code']===0x1f4){logger[_0xc272('0x10')](_0xc272('0xc'),_0x4034f6,_0x256325[_0xc272('0x10')][_0xc272('0x11')]);return _0x159eb4(_0x256325['error']['message']);}logger[_0xc272('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4034f6,_0x256325[_0xc272('0x10')][_0xc272('0x11')]);return _0x5938a4(_0x256325['error'][_0xc272('0x11')]);}else{logger['info'](_0xc272('0xc'),_0x4034f6,'request\x20sent');_0x5938a4(_0x256325[_0xc272('0x12')][_0xc272('0x11')]);}})[_0xc272('0x13')](function(_0x291d98){logger[_0xc272('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4034f6,_0x291d98);_0x159eb4(_0x291d98);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index d180093..1d7bb64 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 _0x050b=['/:id/query','query','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run'];(function(_0x35d753,_0x49b3d8){var _0x206b94=function(_0x7ddf74){while(--_0x7ddf74){_0x35d753['push'](_0x35d753['shift']());}};_0x206b94(++_0x49b3d8);}(_0x050b,0xc6));var _0xb050=function(_0x522d54,_0x30e08f){_0x522d54=_0x522d54-0x0;var _0x28eec0=_0x050b[_0x522d54];return _0x28eec0;};'use strict';var multer=require(_0xb050('0x0'));var util=require('util');var path=require(_0xb050('0x1'));var timeout=require(_0xb050('0x2'));var express=require(_0xb050('0x3'));var router=express[_0xb050('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb050('0x5'));var interaction=require(_0xb050('0x6'));var config=require(_0xb050('0x7'));var controller=require(_0xb050('0x8'));router['get']('/',auth[_0xb050('0x9')](),controller[_0xb050('0xa')]);router[_0xb050('0xb')](_0xb050('0xc'),auth['isAuthenticated'](),controller[_0xb050('0xd')]);router[_0xb050('0xb')](_0xb050('0xe'),auth[_0xb050('0x9')](),controller[_0xb050('0xf')]);router[_0xb050('0xb')](_0xb050('0x10'),auth[_0xb050('0x9')](),controller[_0xb050('0x11')]);router['get'](_0xb050('0x12'),auth[_0xb050('0x9')](),controller[_0xb050('0x13')]);router[_0xb050('0x14')]('/',auth[_0xb050('0x9')](),controller[_0xb050('0x15')]);router[_0xb050('0x16')]('/:id',auth[_0xb050('0x9')](),controller[_0xb050('0x17')]);router[_0xb050('0x18')](_0xb050('0xc'),auth[_0xb050('0x9')](),controller[_0xb050('0x19')]);module[_0xb050('0x1a')]=router;
\ No newline at end of file
+var _0x283a=['show','/:id/preview','preview','run','query','post','create','put','destroy','multer','util','connect-timeout','express','Router','get','isAuthenticated','/:id'];(function(_0x2a93b1,_0x3563d9){var _0xfb1537=function(_0x5e12f1){while(--_0x5e12f1){_0x2a93b1['push'](_0x2a93b1['shift']());}};_0xfb1537(++_0x3563d9);}(_0x283a,0xe6));var _0xa283=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0x283a[_0x4c1ec2];return _0x3f6f1c;};'use strict';var multer=require(_0xa283('0x0'));var util=require(_0xa283('0x1'));var path=require('path');var timeout=require(_0xa283('0x2'));var express=require(_0xa283('0x3'));var router=express[_0xa283('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xa283('0x5')]('/',auth[_0xa283('0x6')](),controller['index']);router['get'](_0xa283('0x7'),auth['isAuthenticated'](),controller[_0xa283('0x8')]);router[_0xa283('0x5')](_0xa283('0x9'),auth[_0xa283('0x6')](),controller[_0xa283('0xa')]);router[_0xa283('0x5')]('/:id/run',auth[_0xa283('0x6')](),controller[_0xa283('0xb')]);router[_0xa283('0x5')]('/:id/query',auth['isAuthenticated'](),controller[_0xa283('0xc')]);router[_0xa283('0xd')]('/',auth[_0xa283('0x6')](),controller[_0xa283('0xe')]);router[_0xa283('0xf')](_0xa283('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xa283('0x7'),auth[_0xa283('0x6')](),controller[_0xa283('0x10')]);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 8be04e1..d65d34c 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 _0xc4aa=['STRING','sequelize','exports'];(function(_0x3840fe,_0x4c9105){var _0xfbc02=function(_0x4796c1){while(--_0x4796c1){_0x3840fe['push'](_0x3840fe['shift']());}};_0xfbc02(++_0x4c9105);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'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
+var _0x326f=['STRING','TEXT','sequelize'];(function(_0x1ed19e,_0x48e01c){var _0x53a7e3=function(_0x37c41b){while(--_0x37c41b){_0x1ed19e['push'](_0x1ed19e['shift']());}};_0x53a7e3(++_0x48e01c);}(_0x326f,0xd1));var _0xf326=function(_0x141eb8,_0x4e2201){_0x141eb8=_0x141eb8-0x0;var _0x139f8d=_0x326f[_0x141eb8];return _0x139f8d;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index dd5ecf3..36aef66 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 _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x347ea8,_0x2ac098){var _0x2e83f4=function(_0x430d5f){while(--_0x430d5f){_0x347ea8['push'](_0x347ea8['shift']());}};_0x2e83f4(++_0x2ac098);}(_0xda19,0xd5));var _0x9da1=function(_0x2df852,_0x1bba56){_0x2df852=_0x2df852-0x0;var _0x539ff8=_0xda19[_0x2df852];return _0x539ff8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));};
\ No newline at end of file
+var _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x5bdc18,_0x57552b){var _0x4fb79e=function(_0x565faf){while(--_0x565faf){_0x5bdc18['push'](_0x5bdc18['shift']());}};_0x4fb79e(++_0x57552b);}(_0x814b,0x1a2));var _0xb814=function(_0x2abd13,_0x501317){_0x2abd13=_0x2abd13-0x0;var _0x5ad645=_0x814b[_0x2abd13];return _0x5ad645;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index b60eb38..7f35440 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 _0x7fe0=['request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','bluebird'];(function(_0x38b02e,_0x5177cf){var _0x5cd622=function(_0x251d79){while(--_0x251d79){_0x38b02e['push'](_0x38b02e['shift']());}};_0x5cd622(++_0x5177cf);}(_0x7fe0,0xb1));var _0x07fe=function(_0x3bb12e,_0x5ebafa){_0x3bb12e=_0x3bb12e-0x0;var _0x536b9a=_0x7fe0[_0x3bb12e];return _0x536b9a;};'use strict';var _=require(_0x07fe('0x0'));var util=require(_0x07fe('0x1'));var logger=require('../../config/logger')(_0x07fe('0x2'));var moment=require(_0x07fe('0x3'));var BPromise=require(_0x07fe('0x4'));var rp=require(_0x07fe('0x5'));var fs=require('fs');var path=require(_0x07fe('0x6'));var rimraf=require(_0x07fe('0x7'));var config=require(_0x07fe('0x8'));var attributes=require(_0x07fe('0x9'));module[_0x07fe('0xa')]=function(_0x450ac1,_0x154a0a){return _0x450ac1[_0x07fe('0xb')](_0x07fe('0xc'),attributes,{'tableName':_0x07fe('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x594f=['exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','bluebird','path','./analyticDefaultReport.attributes'];(function(_0x3a76e4,_0x82586d){var _0x56fd7c=function(_0x5ab5af){while(--_0x5ab5af){_0x3a76e4['push'](_0x3a76e4['shift']());}};_0x56fd7c(++_0x82586d);}(_0x594f,0x78));var _0xf594=function(_0xb27b4b,_0x17546c){_0xb27b4b=_0xb27b4b-0x0;var _0x2dc7a9=_0x594f[_0xb27b4b];return _0x2dc7a9;};'use strict';var _=require(_0xf594('0x0'));var util=require(_0xf594('0x1'));var logger=require(_0xf594('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf594('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf594('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf594('0x5'));module[_0xf594('0x6')]=function(_0x3c25eb,_0x2303f4){return _0x3c25eb[_0xf594('0x7')](_0xf594('0x8'),attributes,{'tableName':'analytics_default_reports','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 d8bc02b..5c85172 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 _0xadd6=['info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x4c1a15,_0x36abe4){var _0x195acb=function(_0x1104ee){while(--_0x1104ee){_0x4c1a15['push'](_0x4c1a15['shift']());}};_0x195acb(++_0x36abe4);}(_0xadd6,0x75));var _0x6add=function(_0x35e290,_0x1156b1){_0x35e290=_0x35e290-0x0;var _0x19dd62=_0xadd6[_0x35e290];return _0x19dd62;};'use strict';var _=require(_0x6add('0x0'));var util=require('util');var moment=require(_0x6add('0x1'));var BPromise=require('bluebird');var rs=require(_0x6add('0x2'));var fs=require('fs');var Redis=require(_0x6add('0x3'));var db=require(_0x6add('0x4'))['db'];var utils=require(_0x6add('0x5'));var logger=require('../../config/logger')(_0x6add('0x6'));var config=require(_0x6add('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6add('0x8')][_0x6add('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14570d,_0x465e11,_0x5ac775){return new BPromise(function(_0x4ec15f,_0x35b981){return client['request'](_0x14570d,_0x5ac775)['then'](function(_0x5df483){logger['info'](_0x6add('0xa'),_0x465e11,'request\x20sent');logger[_0x6add('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x465e11,_0x6add('0xc'),JSON['stringify'](_0x5df483));if(_0x5df483[_0x6add('0xd')]){if(_0x5df483[_0x6add('0xd')][_0x6add('0xe')]===0x1f4){logger[_0x6add('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x465e11,_0x5df483[_0x6add('0xd')][_0x6add('0xf')]);return _0x35b981(_0x5df483[_0x6add('0xd')][_0x6add('0xf')]);}logger[_0x6add('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x465e11,_0x5df483['error'][_0x6add('0xf')]);return _0x4ec15f(_0x5df483['error'][_0x6add('0xf')]);}else{logger[_0x6add('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x465e11,_0x6add('0xc'));_0x4ec15f(_0x5df483[_0x6add('0x11')][_0x6add('0xf')]);}})[_0x6add('0x12')](function(_0x196974){logger[_0x6add('0xd')](_0x6add('0xa'),_0x465e11,_0x196974);_0x35b981(_0x196974);});});}
\ No newline at end of file
+var _0x338c=['then','info','request\x20sent','debug','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x1dfdd5,_0x3e2af3){var _0x4524b6=function(_0x45a29b){while(--_0x45a29b){_0x1dfdd5['push'](_0x1dfdd5['shift']());}};_0x4524b6(++_0x3e2af3);}(_0x338c,0xf1));var _0xc338=function(_0x4ea1bb,_0x35efe8){_0x4ea1bb=_0x4ea1bb-0x0;var _0x2b6fab=_0x338c[_0x4ea1bb];return _0x2b6fab;};'use strict';var _=require(_0xc338('0x0'));var util=require('util');var moment=require(_0xc338('0x1'));var BPromise=require(_0xc338('0x2'));var rs=require(_0xc338('0x3'));var fs=require('fs');var Redis=require(_0xc338('0x4'));var db=require(_0xc338('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc338('0x6'))('rpc');var config=require(_0xc338('0x7'));var jayson=require(_0xc338('0x8'));var client=jayson[_0xc338('0x9')][_0xc338('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1eaa24,_0x305e74,_0x10cad0){return new BPromise(function(_0x30f9cb,_0xd3d3a1){return client[_0xc338('0xb')](_0x1eaa24,_0x10cad0)[_0xc338('0xc')](function(_0x20da44){logger[_0xc338('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x305e74,_0xc338('0xe'));logger[_0xc338('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x305e74,'request\x20sent',JSON[_0xc338('0x10')](_0x20da44));if(_0x20da44[_0xc338('0x11')]){if(_0x20da44[_0xc338('0x11')][_0xc338('0x12')]===0x1f4){logger['error'](_0xc338('0x13'),_0x305e74,_0x20da44[_0xc338('0x11')][_0xc338('0x14')]);return _0xd3d3a1(_0x20da44[_0xc338('0x11')][_0xc338('0x14')]);}logger[_0xc338('0x11')](_0xc338('0x13'),_0x305e74,_0x20da44[_0xc338('0x11')]['message']);return _0x30f9cb(_0x20da44['error']['message']);}else{logger[_0xc338('0xd')](_0xc338('0x13'),_0x305e74,'request\x20sent');_0x30f9cb(_0x20da44[_0xc338('0x15')][_0xc338('0x14')]);}})[_0xc338('0x16')](function(_0x58cc19){logger[_0xc338('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x305e74,_0x58cc19);_0xd3d3a1(_0x58cc19);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index a9fc632..f6825bc 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 _0x3600=['/:id/run','run','/:id/query','query','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show'];(function(_0x851fe,_0x25657a){var _0x2778ac=function(_0x3f94a7){while(--_0x3f94a7){_0x851fe['push'](_0x851fe['shift']());}};_0x2778ac(++_0x25657a);}(_0x3600,0x142));var _0x0360=function(_0x5b3906,_0x44dd0b){_0x5b3906=_0x5b3906-0x0;var _0x1c5844=_0x3600[_0x5b3906];return _0x1c5844;};'use strict';var multer=require(_0x0360('0x0'));var util=require(_0x0360('0x1'));var path=require(_0x0360('0x2'));var timeout=require(_0x0360('0x3'));var express=require(_0x0360('0x4'));var router=express[_0x0360('0x5')]();var fs_extra=require(_0x0360('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0360('0x7'));var config=require(_0x0360('0x8'));var controller=require(_0x0360('0x9'));router[_0x0360('0xa')]('/',auth[_0x0360('0xb')](),controller['index']);router[_0x0360('0xa')](_0x0360('0xc'),auth[_0x0360('0xb')](),controller[_0x0360('0xd')]);router[_0x0360('0xa')]('/:id/preview',auth[_0x0360('0xb')](),controller['preview']);router[_0x0360('0xa')](_0x0360('0xe'),auth[_0x0360('0xb')](),controller[_0x0360('0xf')]);router['get'](_0x0360('0x10'),auth[_0x0360('0xb')](),controller[_0x0360('0x11')]);router[_0x0360('0x12')]('/',auth[_0x0360('0xb')](),controller[_0x0360('0x13')]);router['put']('/:id',auth[_0x0360('0xb')](),controller[_0x0360('0x14')]);router[_0x0360('0x15')](_0x0360('0xc'),auth[_0x0360('0xb')](),controller[_0x0360('0x16')]);module[_0x0360('0x17')]=router;
\ No newline at end of file
+var _0x8c25=['../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','show','/:id/preview','preview','run','get','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x51ef6c,_0x1ecc7c){var _0x4ae3a5=function(_0x34b006){while(--_0x34b006){_0x51ef6c['push'](_0x51ef6c['shift']());}};_0x4ae3a5(++_0x1ecc7c);}(_0x8c25,0xe2));var _0x58c2=function(_0x5508a6,_0x41cb72){_0x5508a6=_0x5508a6-0x0;var _0x4660a1=_0x8c25[_0x5508a6];return _0x4660a1;};'use strict';var multer=require('multer');var util=require(_0x58c2('0x0'));var path=require('path');var timeout=require(_0x58c2('0x1'));var express=require(_0x58c2('0x2'));var router=express[_0x58c2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x58c2('0x4'));var config=require(_0x58c2('0x5'));var controller=require(_0x58c2('0x6'));router['get']('/',auth[_0x58c2('0x7')](),controller[_0x58c2('0x8')]);router['get']('/:id',auth[_0x58c2('0x7')](),controller[_0x58c2('0x9')]);router['get'](_0x58c2('0xa'),auth[_0x58c2('0x7')](),controller[_0x58c2('0xb')]);router['get']('/:id/run',auth[_0x58c2('0x7')](),controller[_0x58c2('0xc')]);router[_0x58c2('0xd')]('/:id/query',auth[_0x58c2('0x7')](),controller['query']);router['post']('/',auth[_0x58c2('0x7')](),controller[_0x58c2('0xe')]);router[_0x58c2('0xf')](_0x58c2('0x10'),auth[_0x58c2('0x7')](),controller[_0x58c2('0x11')]);router[_0x58c2('0x12')]('/:id',auth[_0x58c2('0x7')](),controller[_0x58c2('0x13')]);module[_0x58c2('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 7d65b0b..f9ccae4 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 _0x1a03=['exports','STRING','csv','pdf','xlsx','DATE','ENUM','manual','UNSIGNED','moment'];(function(_0x5965c7,_0x1ab31d){var _0x111855=function(_0x2b7ced){while(--_0x2b7ced){_0x5965c7['push'](_0x5965c7['shift']());}};_0x111855(++_0x1ab31d);}(_0x1a03,0x149));var _0x31a0=function(_0x403f5f,_0x283f67){_0x403f5f=_0x403f5f-0x0;var _0x15b1cd=_0x1a03[_0x403f5f];return _0x15b1cd;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x31a0('0x0'));module[_0x31a0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x31a0('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x31a0('0x3'),_0x31a0('0x4'),_0x31a0('0x5')),'allowNull':![],'defaultValue':_0x31a0('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x31a0('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x31a0('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x31a0('0x7')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x31a0('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x31a0('0x9')]},'reportType':{'type':Sequelize[_0x31a0('0x2')]}};
\ No newline at end of file
+var _0xe3f7=['sequelize','moment','STRING','pdf','xlsx','csv','DATE','Loading','ENUM','manual','scheduled','INTEGER'];(function(_0x38043c,_0x46d1ec){var _0x32088d=function(_0x56d01a){while(--_0x56d01a){_0x38043c['push'](_0x38043c['shift']());}};_0x32088d(++_0x46d1ec);}(_0xe3f7,0x1ec));var _0x7e3f=function(_0xfc2c73,_0x2a6325){_0xfc2c73=_0xfc2c73-0x0;var _0x2c0ba5=_0xe3f7[_0xfc2c73];return _0x2c0ba5;};'use strict';var Sequelize=require(_0x7e3f('0x0'));var moment=require(_0x7e3f('0x1'));module['exports']={'name':{'type':Sequelize[_0x7e3f('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0x7e3f('0x3'),_0x7e3f('0x4')),'allowNull':![],'defaultValue':_0x7e3f('0x5')},'savename':{'type':Sequelize[_0x7e3f('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x7e3f('0x6')]},'status':{'type':Sequelize[_0x7e3f('0x2')],'defaultValue':_0x7e3f('0x7')},'type':{'type':Sequelize[_0x7e3f('0x8')](_0x7e3f('0x9'),_0x7e3f('0xa')),'allowNull':![],'defaultValue':_0x7e3f('0x9')},'reportId':{'type':Sequelize[_0x7e3f('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x7e3f('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 7f358d0..5e3c851 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 _0x606c=['eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','ExtractedReports','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','order','sort','where','filters','filter','merge','options','include','findAll','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','download','output','existsSync','join','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','format','%s.%s','basename','toLowerCase'];(function(_0x5233d4,_0x323ed8){var _0x1b7f4f=function(_0x1b41b4){while(--_0x1b41b4){_0x5233d4['push'](_0x5233d4['shift']());}};_0x1b7f4f(++_0x323ed8);}(_0x606c,0x16c));var _0xc606=function(_0x12b83d,_0x4bcec7){_0x12b83d=_0x12b83d-0x0;var _0x1fd39d=_0x606c[_0x12b83d];return _0x1fd39d;};'use strict';var emlformat=require(_0xc606('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc606('0x1'));var jsonpatch=require(_0xc606('0x2'));var rp=require(_0xc606('0x3'));var moment=require(_0xc606('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc606('0x5'));var util=require('util');var path=require(_0xc606('0x6'));var sox=require(_0xc606('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc606('0x8'));var squel=require('squel');var crypto=require(_0xc606('0x9'));var jsforce=require(_0xc606('0xa'));var deskjs=require(_0xc606('0xb'));var toCsv=require(_0xc606('0xc'));var querystring=require('querystring');var Papa=require(_0xc606('0xd'));var Redis=require(_0xc606('0xe'));var authService=require(_0xc606('0xf'));var qs=require(_0xc606('0x10'));var as=require(_0xc606('0x11'));var hardwareService=require(_0xc606('0x12'));var logger=require('../../config/logger')(_0xc606('0x13'));var utils=require(_0xc606('0x14'));var config=require(_0xc606('0x15'));var licenseUtil=require(_0xc606('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1305e1,_0x9f6164){_0x9f6164=_0x9f6164||0xcc;return function(_0x338e43){if(_0x338e43){return _0x1305e1[_0xc606('0x17')](_0x9f6164);}return _0x1305e1[_0xc606('0x18')](_0x9f6164)[_0xc606('0x19')]();};}function respondWithResult(_0x4e7cf3,_0x35249d){_0x35249d=_0x35249d||0xc8;return function(_0x228e0a){if(_0x228e0a){return _0x4e7cf3[_0xc606('0x18')](_0x35249d)[_0xc606('0x1a')](_0x228e0a);}};}function respondWithFilteredResult(_0x20c4ec,_0x502420){return function(_0x1da617){if(_0x1da617){var _0x51d26c=typeof _0x502420[_0xc606('0x1b')]==='undefined'&&typeof _0x502420[_0xc606('0x1c')]===_0xc606('0x1d');var _0x3c53d3=_0x1da617[_0xc606('0x1e')];var _0xbaed22=_0x51d26c?0x0:_0x502420[_0xc606('0x1b')];var _0x3d04e1=_0x51d26c?_0x1da617[_0xc606('0x1e')]:_0x502420[_0xc606('0x1b')]+_0x502420[_0xc606('0x1c')];var _0x2ed9dd;if(_0x3d04e1>=_0x3c53d3){_0x3d04e1=_0x3c53d3;_0x2ed9dd=0xc8;}else{_0x2ed9dd=0xce;}_0x20c4ec[_0xc606('0x18')](_0x2ed9dd);return _0x20c4ec[_0xc606('0x1f')]('Content-Range',_0xbaed22+'-'+_0x3d04e1+'/'+_0x3c53d3)['json'](_0x1da617);}return null;};}function patchUpdates(_0x424b1e){return function(_0x58216c){try{jsonpatch[_0xc606('0x20')](_0x58216c,_0x424b1e,!![]);}catch(_0x461a9b){return BPromise[_0xc606('0x21')](_0x461a9b);}return _0x58216c[_0xc606('0x22')]();};}function saveUpdates(_0x5192d6,_0x4c6575){return function(_0x13b8c0){if(_0x13b8c0){return _0x13b8c0[_0xc606('0x23')](_0x5192d6)['then'](function(_0x34320b){return _0x34320b;});}return null;};}function removeEntity(_0x4da495,_0x54c1b9){return function(_0x35ec90){if(_0x35ec90){return _0x35ec90['destroy']()[_0xc606('0x24')](function(){var _0x3fdfcd=_0x35ec90['get']({'plain':!![]});var _0x2e434a=_0xc606('0x25');return db[_0xc606('0x26')]['destroy']({'where':{'type':_0x2e434a,'resourceId':_0x3fdfcd['id']}})['then'](function(){return _0x35ec90;});})['then'](function(){_0x4da495['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fd144,_0x13e5a6){return function(_0x3563f6){if(!_0x3563f6){_0x3fd144[_0xc606('0x17')](0x194);}return _0x3563f6;};}function handleError(_0x5131da,_0x4aacd6){_0x4aacd6=_0x4aacd6||0x1f4;return function(_0x2df772){logger[_0xc606('0x27')](_0x2df772['stack']);if(_0x2df772[_0xc606('0x28')]){delete _0x2df772[_0xc606('0x28')];}_0x5131da[_0xc606('0x18')](_0x4aacd6)[_0xc606('0x29')](_0x2df772);};}exports[_0xc606('0x2a')]=function(_0x5558c8,_0x22bb47){var _0x5413f6={},_0x3829ee={},_0x2e1c9a={'count':0x0,'rows':[]};var _0x57ccae=_[_0xc606('0x2b')](db[_0xc606('0x2c')][_0xc606('0x2d')],function(_0x39c5a1){return{'name':_0x39c5a1[_0xc606('0x2e')],'type':_0x39c5a1[_0xc606('0x2f')]['key']};});_0x3829ee[_0xc606('0x30')]=_[_0xc606('0x2b')](_0x57ccae,_0xc606('0x28'));_0x3829ee[_0xc606('0x31')]=_[_0xc606('0x32')](_0x5558c8[_0xc606('0x31')]);_0x3829ee['filters']=_[_0xc606('0x33')](_0x3829ee[_0xc606('0x30')],_0x3829ee['query']);_0x5413f6[_0xc606('0x34')]=_['intersection'](_0x3829ee[_0xc606('0x30')],qs[_0xc606('0x35')](_0x5558c8[_0xc606('0x31')]['fields']));_0x5413f6[_0xc606('0x34')]=_0x5413f6['attributes']['length']?_0x5413f6[_0xc606('0x34')]:_0x3829ee[_0xc606('0x30')];if(!_0x5558c8[_0xc606('0x31')]['hasOwnProperty']('nolimit')){_0x5413f6[_0xc606('0x1c')]=qs[_0xc606('0x1c')](_0x5558c8['query'][_0xc606('0x1c')]);_0x5413f6['offset']=qs['offset'](_0x5558c8[_0xc606('0x31')][_0xc606('0x1b')]);}_0x5413f6[_0xc606('0x36')]=qs['sort'](_0x5558c8['query'][_0xc606('0x37')]);_0x5413f6[_0xc606('0x38')]=qs[_0xc606('0x39')](_['pick'](_0x5558c8[_0xc606('0x31')],_0x3829ee[_0xc606('0x39')]),_0x57ccae);if(_0x5558c8[_0xc606('0x31')][_0xc606('0x3a')]){_0x5413f6[_0xc606('0x38')]=_[_0xc606('0x3b')](_0x5413f6[_0xc606('0x38')],{'$or':_[_0xc606('0x2b')](_0x57ccae,function(_0x3c1963){if(_0x3c1963[_0xc606('0x2f')]!=='VIRTUAL'){var _0x6c5930={};_0x6c5930[_0x3c1963[_0xc606('0x28')]]={'$like':'%'+_0x5558c8[_0xc606('0x31')][_0xc606('0x3a')]+'%'};return _0x6c5930;}})});}_0x5413f6=_[_0xc606('0x3b')]({},_0x5413f6,_0x5558c8[_0xc606('0x3c')]);var _0x56fd1b={'where':_0x5413f6[_0xc606('0x38')]};return db[_0xc606('0x2c')][_0xc606('0x1e')](_0x56fd1b)['then'](function(_0x45b98d){_0x2e1c9a['count']=_0x45b98d;if(_0x5558c8[_0xc606('0x31')]['includeAll']){_0x5413f6[_0xc606('0x3d')]=[{'all':!![]}];}return db[_0xc606('0x2c')][_0xc606('0x3e')](_0x5413f6);})['then'](function(_0x1d78d6){_0x2e1c9a['rows']=_0x1d78d6;return _0x2e1c9a;})[_0xc606('0x24')](respondWithFilteredResult(_0x22bb47,_0x5413f6))['catch'](handleError(_0x22bb47,null));};exports['show']=function(_0x3c93c7,_0x4ec9b6){var _0x25d2fe={'raw':!![],'where':{'id':_0x3c93c7['params']['id']}},_0x15acbd={};_0x15acbd[_0xc606('0x30')]=_['keys'](db[_0xc606('0x2c')]['rawAttributes']);_0x15acbd['query']=_[_0xc606('0x32')](_0x3c93c7['query']);_0x15acbd[_0xc606('0x39')]=_[_0xc606('0x33')](_0x15acbd['model'],_0x15acbd[_0xc606('0x31')]);_0x25d2fe[_0xc606('0x34')]=_[_0xc606('0x33')](_0x15acbd['model'],qs[_0xc606('0x35')](_0x3c93c7[_0xc606('0x31')][_0xc606('0x35')]));_0x25d2fe['attributes']=_0x25d2fe[_0xc606('0x34')][_0xc606('0x3f')]?_0x25d2fe['attributes']:_0x15acbd[_0xc606('0x30')];if(_0x3c93c7['query'][_0xc606('0x40')]){_0x25d2fe[_0xc606('0x3d')]=[{'all':!![]}];}_0x25d2fe=_[_0xc606('0x3b')]({},_0x25d2fe,_0x3c93c7[_0xc606('0x3c')]);return db[_0xc606('0x2c')][_0xc606('0x41')](_0x25d2fe)[_0xc606('0x24')](handleEntityNotFound(_0x4ec9b6,null))[_0xc606('0x24')](respondWithResult(_0x4ec9b6,null))[_0xc606('0x42')](handleError(_0x4ec9b6,null));};exports[_0xc606('0x43')]=function(_0x4ef4cf,_0x479669){return db[_0xc606('0x2c')][_0xc606('0x43')](_0x4ef4cf[_0xc606('0x44')],{})[_0xc606('0x24')](function(_0x353e46){var _0x2b6793=_0x4ef4cf[_0xc606('0x45')]['get']({'plain':!![]});if(!_0x2b6793)throw new Error(_0xc606('0x46'));if(_0x2b6793[_0xc606('0x47')]===_0xc606('0x45')){var _0x131ceb=_0x353e46[_0xc606('0x48')]({'plain':!![]});var _0x58e081=_0xc606('0x25');return db[_0xc606('0x49')]['find']({'where':{'name':_0x58e081,'userProfileId':_0x2b6793[_0xc606('0x4a')]},'raw':!![]})[_0xc606('0x24')](function(_0x89704){if(_0x89704&&_0x89704['autoAssociation']===0x0){return db[_0xc606('0x26')][_0xc606('0x43')]({'name':_0x131ceb[_0xc606('0x28')],'resourceId':_0x131ceb['id'],'type':_0x89704['name'],'sectionId':_0x89704['id']},{})[_0xc606('0x24')](function(){return _0x353e46;});}else{return _0x353e46;}})[_0xc606('0x42')](function(_0x1d6f3c){logger['error'](_0xc606('0x4b'),_0x1d6f3c);throw _0x1d6f3c;});}return _0x353e46;})[_0xc606('0x24')](respondWithResult(_0x479669,0xc9))[_0xc606('0x42')](handleError(_0x479669,null));};exports[_0xc606('0x23')]=function(_0x1a9a97,_0x1549b8){if(_0x1a9a97[_0xc606('0x44')]['id']){delete _0x1a9a97[_0xc606('0x44')]['id'];}return db['AnalyticExtractedReport'][_0xc606('0x41')]({'where':{'id':_0x1a9a97[_0xc606('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1549b8,null))[_0xc606('0x24')](saveUpdates(_0x1a9a97[_0xc606('0x44')],null))[_0xc606('0x24')](respondWithResult(_0x1549b8,null))['catch'](handleError(_0x1549b8,null));};exports[_0xc606('0x4d')]=function(_0x17fba7,_0xe0b8cf){return db[_0xc606('0x2c')][_0xc606('0x41')]({'where':{'id':_0x17fba7['params']['id']}})[_0xc606('0x24')](handleEntityNotFound(_0xe0b8cf,null))['then'](removeEntity(_0xe0b8cf,null))['catch'](handleError(_0xe0b8cf,null));};exports[_0xc606('0x4e')]=function(_0x5a3146,_0xdac000,_0x344420){return db[_0xc606('0x2c')][_0xc606('0x41')]({'where':{'id':_0x5a3146[_0xc606('0x4c')]['id']},'attributes':[_0xc606('0x28'),'basename','savename',_0xc606('0x4f')],'raw':!![]})[_0xc606('0x24')](handleEntityNotFound(_0xdac000,null))[_0xc606('0x24')](function(_0x353583){if(_0x353583){if(!fs[_0xc606('0x50')](path[_0xc606('0x51')](config[_0xc606('0x52')],_0xc606('0x53'),_0x353583[_0xc606('0x54')]))){throw new db['Sequelize'][(_0xc606('0x55'))](_0xc606('0x56'));}if(_0x5a3146['query']['exists']){return _0xdac000[_0xc606('0x17')](0xc8);}return _0xdac000['download'](path['join'](config['root'],_0xc606('0x53'),_0x353583[_0xc606('0x54')]),util[_0xc606('0x57')](_0xc606('0x58'),_0x353583[_0xc606('0x59')]||_0x353583[_0xc606('0x28')],_0x353583['output'][_0xc606('0x5a')]()));}})[_0xc606('0x42')](handleError(_0xdac000,null));};
\ No newline at end of file
+var _0xaf76=['sox','fs-extra','lodash','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','ExtractedReports','destroy','then','stack','name','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','%s.%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x123599,_0x374e14){var _0x3bf01d=function(_0x60b9bc){while(--_0x60b9bc){_0x123599['push'](_0x123599['shift']());}};_0x3bf01d(++_0x374e14);}(_0xaf76,0xb0));var _0x6af7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf76[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6af7('0x0'));var rimraf=require(_0x6af7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6af7('0x2'));var rp=require(_0x6af7('0x3'));var moment=require(_0x6af7('0x4'));var BPromise=require(_0x6af7('0x5'));var Mustache=require('mustache');var util=require(_0x6af7('0x6'));var path=require(_0x6af7('0x7'));var sox=require(_0x6af7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6af7('0x9'));var _=require(_0x6af7('0xa'));var squel=require('squel');var crypto=require(_0x6af7('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6af7('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6af7('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x6af7('0xe'));var hardwareService=require(_0x6af7('0xf'));var logger=require(_0x6af7('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x6af7('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x6af7('0x12'))['db'];function respondWithStatusCode(_0x22135d,_0x1c3604){_0x1c3604=_0x1c3604||0xcc;return function(_0x3d4301){if(_0x3d4301){return _0x22135d[_0x6af7('0x13')](_0x1c3604);}return _0x22135d[_0x6af7('0x14')](_0x1c3604)[_0x6af7('0x15')]();};}function respondWithResult(_0x447ccf,_0x1f4eef){_0x1f4eef=_0x1f4eef||0xc8;return function(_0x507372){if(_0x507372){return _0x447ccf['status'](_0x1f4eef)[_0x6af7('0x16')](_0x507372);}};}function respondWithFilteredResult(_0x3a94a4,_0x4e7f76){return function(_0x432896){if(_0x432896){var _0x3fa345=typeof _0x4e7f76[_0x6af7('0x17')]===_0x6af7('0x18')&&typeof _0x4e7f76[_0x6af7('0x19')]===_0x6af7('0x18');var _0x57d79d=_0x432896[_0x6af7('0x1a')];var _0x351fdb=_0x3fa345?0x0:_0x4e7f76[_0x6af7('0x17')];var _0x495c75=_0x3fa345?_0x432896[_0x6af7('0x1a')]:_0x4e7f76[_0x6af7('0x17')]+_0x4e7f76[_0x6af7('0x19')];var _0x4a071a;if(_0x495c75>=_0x57d79d){_0x495c75=_0x57d79d;_0x4a071a=0xc8;}else{_0x4a071a=0xce;}_0x3a94a4[_0x6af7('0x14')](_0x4a071a);return _0x3a94a4[_0x6af7('0x1b')]('Content-Range',_0x351fdb+'-'+_0x495c75+'/'+_0x57d79d)[_0x6af7('0x16')](_0x432896);}return null;};}function patchUpdates(_0x50e996){return function(_0x499567){try{jsonpatch[_0x6af7('0x1c')](_0x499567,_0x50e996,!![]);}catch(_0x202e4c){return BPromise[_0x6af7('0x1d')](_0x202e4c);}return _0x499567[_0x6af7('0x1e')]();};}function saveUpdates(_0x54ecdf,_0x3b550d){return function(_0x23e8b5){if(_0x23e8b5){return _0x23e8b5[_0x6af7('0x1f')](_0x54ecdf)['then'](function(_0xb93ce2){return _0xb93ce2;});}return null;};}function removeEntity(_0xd8eb5b,_0x1243d6){return function(_0x38b97c){if(_0x38b97c){return _0x38b97c['destroy']()['then'](function(){var _0x32642f=_0x38b97c['get']({'plain':!![]});var _0x40c380=_0x6af7('0x20');return db['UserProfileResource'][_0x6af7('0x21')]({'where':{'type':_0x40c380,'resourceId':_0x32642f['id']}})['then'](function(){return _0x38b97c;});})[_0x6af7('0x22')](function(){_0xd8eb5b[_0x6af7('0x14')](0xcc)[_0x6af7('0x15')]();});}};}function handleEntityNotFound(_0x15d50d,_0x262654){return function(_0x46e99f){if(!_0x46e99f){_0x15d50d[_0x6af7('0x13')](0x194);}return _0x46e99f;};}function handleError(_0x57023e,_0x7b6191){_0x7b6191=_0x7b6191||0x1f4;return function(_0x435cc6){logger['error'](_0x435cc6[_0x6af7('0x23')]);if(_0x435cc6[_0x6af7('0x24')]){delete _0x435cc6[_0x6af7('0x24')];}_0x57023e[_0x6af7('0x14')](_0x7b6191)['send'](_0x435cc6);};}exports[_0x6af7('0x25')]=function(_0x3304a3,_0x1adb71){var _0x1648f5={},_0x489c22={},_0xf562fe={'count':0x0,'rows':[]};var _0x26ace8=_[_0x6af7('0x26')](db[_0x6af7('0x27')]['rawAttributes'],function(_0x56a35b){return{'name':_0x56a35b[_0x6af7('0x28')],'type':_0x56a35b[_0x6af7('0x29')][_0x6af7('0x2a')]};});_0x489c22[_0x6af7('0x2b')]=_[_0x6af7('0x26')](_0x26ace8,_0x6af7('0x24'));_0x489c22[_0x6af7('0x2c')]=_[_0x6af7('0x2d')](_0x3304a3[_0x6af7('0x2c')]);_0x489c22[_0x6af7('0x2e')]=_['intersection'](_0x489c22['model'],_0x489c22[_0x6af7('0x2c')]);_0x1648f5[_0x6af7('0x2f')]=_[_0x6af7('0x30')](_0x489c22['model'],qs[_0x6af7('0x31')](_0x3304a3['query'][_0x6af7('0x31')]));_0x1648f5[_0x6af7('0x2f')]=_0x1648f5[_0x6af7('0x2f')][_0x6af7('0x32')]?_0x1648f5[_0x6af7('0x2f')]:_0x489c22['model'];if(!_0x3304a3[_0x6af7('0x2c')][_0x6af7('0x33')](_0x6af7('0x34'))){_0x1648f5[_0x6af7('0x19')]=qs[_0x6af7('0x19')](_0x3304a3[_0x6af7('0x2c')][_0x6af7('0x19')]);_0x1648f5[_0x6af7('0x17')]=qs[_0x6af7('0x17')](_0x3304a3[_0x6af7('0x2c')][_0x6af7('0x17')]);}_0x1648f5[_0x6af7('0x35')]=qs[_0x6af7('0x36')](_0x3304a3[_0x6af7('0x2c')][_0x6af7('0x36')]);_0x1648f5[_0x6af7('0x37')]=qs[_0x6af7('0x2e')](_[_0x6af7('0x38')](_0x3304a3[_0x6af7('0x2c')],_0x489c22[_0x6af7('0x2e')]),_0x26ace8);if(_0x3304a3['query'][_0x6af7('0x39')]){_0x1648f5['where']=_[_0x6af7('0x3a')](_0x1648f5[_0x6af7('0x37')],{'$or':_[_0x6af7('0x26')](_0x26ace8,function(_0x10cda5){if(_0x10cda5['type']!=='VIRTUAL'){var _0x106fa5={};_0x106fa5[_0x10cda5[_0x6af7('0x24')]]={'$like':'%'+_0x3304a3[_0x6af7('0x2c')][_0x6af7('0x39')]+'%'};return _0x106fa5;}})});}_0x1648f5=_[_0x6af7('0x3a')]({},_0x1648f5,_0x3304a3[_0x6af7('0x3b')]);var _0x37a6bd={'where':_0x1648f5[_0x6af7('0x37')]};return db[_0x6af7('0x27')][_0x6af7('0x1a')](_0x37a6bd)[_0x6af7('0x22')](function(_0x2426b5){_0xf562fe[_0x6af7('0x1a')]=_0x2426b5;if(_0x3304a3[_0x6af7('0x2c')][_0x6af7('0x3c')]){_0x1648f5['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x6af7('0x3d')](_0x1648f5);})[_0x6af7('0x22')](function(_0x193cc4){_0xf562fe[_0x6af7('0x3e')]=_0x193cc4;return _0xf562fe;})['then'](respondWithFilteredResult(_0x1adb71,_0x1648f5))[_0x6af7('0x3f')](handleError(_0x1adb71,null));};exports[_0x6af7('0x40')]=function(_0x335c51,_0x1a4515){var _0x45bb37={'raw':!![],'where':{'id':_0x335c51[_0x6af7('0x41')]['id']}},_0x1d5a76={};_0x1d5a76[_0x6af7('0x2b')]=_[_0x6af7('0x2d')](db[_0x6af7('0x27')]['rawAttributes']);_0x1d5a76[_0x6af7('0x2c')]=_[_0x6af7('0x2d')](_0x335c51['query']);_0x1d5a76[_0x6af7('0x2e')]=_['intersection'](_0x1d5a76['model'],_0x1d5a76[_0x6af7('0x2c')]);_0x45bb37[_0x6af7('0x2f')]=_[_0x6af7('0x30')](_0x1d5a76[_0x6af7('0x2b')],qs[_0x6af7('0x31')](_0x335c51[_0x6af7('0x2c')][_0x6af7('0x31')]));_0x45bb37[_0x6af7('0x2f')]=_0x45bb37[_0x6af7('0x2f')][_0x6af7('0x32')]?_0x45bb37[_0x6af7('0x2f')]:_0x1d5a76[_0x6af7('0x2b')];if(_0x335c51[_0x6af7('0x2c')][_0x6af7('0x3c')]){_0x45bb37[_0x6af7('0x42')]=[{'all':!![]}];}_0x45bb37=_[_0x6af7('0x3a')]({},_0x45bb37,_0x335c51['options']);return db['AnalyticExtractedReport'][_0x6af7('0x43')](_0x45bb37)['then'](handleEntityNotFound(_0x1a4515,null))[_0x6af7('0x22')](respondWithResult(_0x1a4515,null))[_0x6af7('0x3f')](handleError(_0x1a4515,null));};exports[_0x6af7('0x44')]=function(_0x4e73c9,_0x3f738f){return db[_0x6af7('0x27')][_0x6af7('0x44')](_0x4e73c9[_0x6af7('0x45')],{})[_0x6af7('0x22')](function(_0x4e0e50){var _0x43ccf5=_0x4e73c9['user']['get']({'plain':!![]});if(!_0x43ccf5)throw new Error(_0x6af7('0x46'));if(_0x43ccf5[_0x6af7('0x47')]===_0x6af7('0x48')){var _0x3c737d=_0x4e0e50[_0x6af7('0x49')]({'plain':!![]});var _0x59ffbc='ExtractedReports';return db[_0x6af7('0x4a')][_0x6af7('0x43')]({'where':{'name':_0x59ffbc,'userProfileId':_0x43ccf5[_0x6af7('0x4b')]},'raw':!![]})[_0x6af7('0x22')](function(_0x332a60){if(_0x332a60&&_0x332a60[_0x6af7('0x4c')]===0x0){return db[_0x6af7('0x4d')]['create']({'name':_0x3c737d[_0x6af7('0x24')],'resourceId':_0x3c737d['id'],'type':_0x332a60[_0x6af7('0x24')],'sectionId':_0x332a60['id']},{})[_0x6af7('0x22')](function(){return _0x4e0e50;});}else{return _0x4e0e50;}})[_0x6af7('0x3f')](function(_0x3acb42){logger[_0x6af7('0x4e')](_0x6af7('0x4f'),_0x3acb42);throw _0x3acb42;});}return _0x4e0e50;})[_0x6af7('0x22')](respondWithResult(_0x3f738f,0xc9))[_0x6af7('0x3f')](handleError(_0x3f738f,null));};exports[_0x6af7('0x1f')]=function(_0xaf09b1,_0x36528f){if(_0xaf09b1[_0x6af7('0x45')]['id']){delete _0xaf09b1['body']['id'];}return db[_0x6af7('0x27')][_0x6af7('0x43')]({'where':{'id':_0xaf09b1[_0x6af7('0x41')]['id']}})['then'](handleEntityNotFound(_0x36528f,null))[_0x6af7('0x22')](saveUpdates(_0xaf09b1['body'],null))['then'](respondWithResult(_0x36528f,null))[_0x6af7('0x3f')](handleError(_0x36528f,null));};exports[_0x6af7('0x21')]=function(_0x24534a,_0x1e7e73){return db[_0x6af7('0x27')][_0x6af7('0x43')]({'where':{'id':_0x24534a[_0x6af7('0x41')]['id']}})[_0x6af7('0x22')](handleEntityNotFound(_0x1e7e73,null))[_0x6af7('0x22')](removeEntity(_0x1e7e73,null))[_0x6af7('0x3f')](handleError(_0x1e7e73,null));};exports[_0x6af7('0x50')]=function(_0x584c14,_0x423e86,_0x21e1cb){return db[_0x6af7('0x27')][_0x6af7('0x43')]({'where':{'id':_0x584c14[_0x6af7('0x41')]['id']},'attributes':[_0x6af7('0x24'),_0x6af7('0x51'),_0x6af7('0x52'),'output'],'raw':!![]})[_0x6af7('0x22')](handleEntityNotFound(_0x423e86,null))['then'](function(_0x3e2a4e){if(_0x3e2a4e){if(!fs[_0x6af7('0x53')](path[_0x6af7('0x54')](config[_0x6af7('0x55')],'server/files/reports',_0x3e2a4e[_0x6af7('0x52')]))){throw new db[(_0x6af7('0x56'))][(_0x6af7('0x57'))](_0x6af7('0x58'));}if(_0x584c14[_0x6af7('0x2c')][_0x6af7('0x59')]){return _0x423e86[_0x6af7('0x13')](0xc8);}return _0x423e86[_0x6af7('0x50')](path[_0x6af7('0x54')](config[_0x6af7('0x55')],_0x6af7('0x5a'),_0x3e2a4e['savename']),util['format'](_0x6af7('0x5b'),_0x3e2a4e[_0x6af7('0x51')]||_0x3e2a4e[_0x6af7('0x24')],_0x3e2a4e['output']['toLowerCase']()));}})[_0x6af7('0x3f')](handleError(_0x423e86,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 146311c..d3abc2b 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 _0x6567=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x1e2072,_0x145d84){var _0x1a72ce=function(_0xd30383){while(--_0xd30383){_0x1e2072['push'](_0x1e2072['shift']());}};_0x1a72ce(++_0x145d84);}(_0x6567,0x168));var _0x7656=function(_0xfacbc8,_0x3cf35b){_0xfacbc8=_0xfacbc8-0x0;var _0x512376=_0x6567[_0xfacbc8];return _0x512376;};'use strict';var _=require(_0x7656('0x0'));var util=require(_0x7656('0x1'));var logger=require(_0x7656('0x2'))(_0x7656('0x3'));var moment=require(_0x7656('0x4'));var BPromise=require(_0x7656('0x5'));var rp=require(_0x7656('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7656('0x7'));var config=require(_0x7656('0x8'));var attributes=require(_0x7656('0x9'));module['exports']=function(_0x3b9092,_0x19e3d3){return _0x3b9092[_0x7656('0xa')](_0x7656('0xb'),attributes,{'tableName':_0x7656('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa02f=['analytics_extracted_reports','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x998637,_0x16e418){var _0x32e308=function(_0x4ad169){while(--_0x4ad169){_0x998637['push'](_0x998637['shift']());}};_0x32e308(++_0x16e418);}(_0xa02f,0xbc));var _0xfa02=function(_0x427bee,_0x173029){_0x427bee=_0x427bee-0x0;var _0x1d7f7a=_0xa02f[_0x427bee];return _0x1d7f7a;};'use strict';var _=require(_0xfa02('0x0'));var util=require(_0xfa02('0x1'));var logger=require(_0xfa02('0x2'))('api');var moment=require('moment');var BPromise=require(_0xfa02('0x3'));var rp=require(_0xfa02('0x4'));var fs=require('fs');var path=require(_0xfa02('0x5'));var rimraf=require(_0xfa02('0x6'));var config=require(_0xfa02('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0xfa02('0x8')]=function(_0x492275,_0x19af77){return _0x492275[_0xfa02('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0xfa02('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 d09f2a0..27060ef 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 _0xcc98=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xcc98,0xb2));var _0x8cc9=function(_0x382492,_0x2b8cde){_0x382492=_0x382492-0x0;var _0xbaaf9d=_0xcc98[_0x382492];return _0xbaaf9d;};'use strict';var _=require(_0x8cc9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8cc9('0x1'));var rs=require(_0x8cc9('0x2'));var fs=require('fs');var Redis=require(_0x8cc9('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8cc9('0x4'))(_0x8cc9('0x5'));var config=require(_0x8cc9('0x6'));var jayson=require(_0x8cc9('0x7'));var client=jayson[_0x8cc9('0x8')][_0x8cc9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cd59d,_0x365276,_0x189baa){return new BPromise(function(_0x13b48c,_0x167350){return client['request'](_0x3cd59d,_0x189baa)[_0x8cc9('0xa')](function(_0xeabd12){logger[_0x8cc9('0xb')](_0x8cc9('0xc'),_0x365276,_0x8cc9('0xd'));logger['debug'](_0x8cc9('0xe'),_0x365276,_0x8cc9('0xd'),JSON[_0x8cc9('0xf')](_0xeabd12));if(_0xeabd12[_0x8cc9('0x10')]){if(_0xeabd12[_0x8cc9('0x10')][_0x8cc9('0x11')]===0x1f4){logger[_0x8cc9('0x10')](_0x8cc9('0xc'),_0x365276,_0xeabd12[_0x8cc9('0x10')][_0x8cc9('0x12')]);return _0x167350(_0xeabd12['error'][_0x8cc9('0x12')]);}logger[_0x8cc9('0x10')](_0x8cc9('0xc'),_0x365276,_0xeabd12[_0x8cc9('0x10')][_0x8cc9('0x12')]);return _0x13b48c(_0xeabd12['error']['message']);}else{logger[_0x8cc9('0xb')](_0x8cc9('0xc'),_0x365276,_0x8cc9('0xd'));_0x13b48c(_0xeabd12[_0x8cc9('0x13')][_0x8cc9('0x12')]);}})[_0x8cc9('0x14')](function(_0x2ad65f){logger[_0x8cc9('0x10')](_0x8cc9('0xc'),_0x365276,_0x2ad65f);_0x167350(_0x2ad65f);});});}
\ No newline at end of file
+var _0x8748=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x52ab80,_0x3878bd){var _0x3ba0bb=function(_0x362694){while(--_0x362694){_0x52ab80['push'](_0x52ab80['shift']());}};_0x3ba0bb(++_0x3878bd);}(_0x8748,0x9e));var _0x8874=function(_0x1d2323,_0x2b56f1){_0x1d2323=_0x1d2323-0x0;var _0x36cdd8=_0x8748[_0x1d2323];return _0x36cdd8;};'use strict';var _=require(_0x8874('0x0'));var util=require(_0x8874('0x1'));var moment=require(_0x8874('0x2'));var BPromise=require(_0x8874('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8874('0x4'));var db=require(_0x8874('0x5'))['db'];var utils=require(_0x8874('0x6'));var logger=require(_0x8874('0x7'))(_0x8874('0x8'));var config=require(_0x8874('0x9'));var jayson=require(_0x8874('0xa'));var client=jayson['client'][_0x8874('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b372a,_0x1f57b3,_0x482f29){return new BPromise(function(_0x548467,_0x424872){return client['request'](_0x5b372a,_0x482f29)[_0x8874('0xc')](function(_0x21b54d){logger[_0x8874('0xd')](_0x8874('0xe'),_0x1f57b3,_0x8874('0xf'));logger[_0x8874('0x10')](_0x8874('0x11'),_0x1f57b3,_0x8874('0xf'),JSON[_0x8874('0x12')](_0x21b54d));if(_0x21b54d[_0x8874('0x13')]){if(_0x21b54d[_0x8874('0x13')][_0x8874('0x14')]===0x1f4){logger[_0x8874('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f57b3,_0x21b54d[_0x8874('0x13')][_0x8874('0x15')]);return _0x424872(_0x21b54d['error'][_0x8874('0x15')]);}logger['error'](_0x8874('0xe'),_0x1f57b3,_0x21b54d[_0x8874('0x13')][_0x8874('0x15')]);return _0x548467(_0x21b54d[_0x8874('0x13')]['message']);}else{logger[_0x8874('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f57b3,_0x8874('0xf'));_0x548467(_0x21b54d[_0x8874('0x16')][_0x8874('0x15')]);}})['catch'](function(_0x1b0501){logger['error'](_0x8874('0xe'),_0x1f57b3,_0x1b0501);_0x424872(_0x1b0501);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index a5fc1a4..a806e7b 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 _0xade5=['../../config/environment','get','index','/:id','show','/:id/download','isAuthenticated','download','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x7ad6cb,_0xffee6c){var _0x22a0ba=function(_0x47f291){while(--_0x47f291){_0x7ad6cb['push'](_0x7ad6cb['shift']());}};_0x22a0ba(++_0xffee6c);}(_0xade5,0x172));var _0x5ade=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xade5[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x5ade('0x0'));var util=require(_0x5ade('0x1'));var path=require(_0x5ade('0x2'));var timeout=require(_0x5ade('0x3'));var express=require(_0x5ade('0x4'));var router=express[_0x5ade('0x5')]();var fs_extra=require(_0x5ade('0x6'));var auth=require(_0x5ade('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5ade('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0x5ade('0x9')]('/',auth['isAuthenticated'](),controller[_0x5ade('0xa')]);router['get'](_0x5ade('0xb'),auth['isAuthenticated'](),controller[_0x5ade('0xc')]);router['get'](_0x5ade('0xd'),auth[_0x5ade('0xe')](),controller[_0x5ade('0xf')]);router[_0x5ade('0x10')]('/',auth[_0x5ade('0xe')](),controller[_0x5ade('0x11')]);router['put'](_0x5ade('0xb'),auth['isAuthenticated'](),controller[_0x5ade('0x12')]);router[_0x5ade('0x13')](_0x5ade('0xb'),auth[_0x5ade('0xe')](),controller['destroy']);module[_0x5ade('0x14')]=router;
\ No newline at end of file
+var _0x539f=['index','/:id','show','/:id/download','post','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated'];(function(_0x270a54,_0x307ff6){var _0x4d07d0=function(_0x59ac5a){while(--_0x59ac5a){_0x270a54['push'](_0x270a54['shift']());}};_0x4d07d0(++_0x307ff6);}(_0x539f,0x100));var _0xf539=function(_0x592b77,_0x5b35f1){_0x592b77=_0x592b77-0x0;var _0x3a4849=_0x539f[_0x592b77];return _0x3a4849;};'use strict';var multer=require(_0xf539('0x0'));var util=require(_0xf539('0x1'));var path=require(_0xf539('0x2'));var timeout=require(_0xf539('0x3'));var express=require('express');var router=express[_0xf539('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf539('0x5'));var interaction=require(_0xf539('0x6'));var config=require(_0xf539('0x7'));var controller=require(_0xf539('0x8'));router['get']('/',auth[_0xf539('0x9')](),controller[_0xf539('0xa')]);router['get'](_0xf539('0xb'),auth[_0xf539('0x9')](),controller[_0xf539('0xc')]);router['get'](_0xf539('0xd'),auth[_0xf539('0x9')](),controller['download']);router[_0xf539('0xe')]('/',auth[_0xf539('0x9')](),controller['create']);router['put'](_0xf539('0xb'),auth[_0xf539('0x9')](),controller[_0xf539('0xf')]);router[_0xf539('0x10')](_0xf539('0xb'),auth['isAuthenticated'](),controller[_0xf539('0x11')]);module[_0xf539('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 8f5b37a..494a0e5 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 _0x2fd8=['sequelize','TEXT','STRING'];(function(_0x41a127,_0x546a15){var _0x526801=function(_0x3a936d){while(--_0x3a936d){_0x41a127['push'](_0x41a127['shift']());}};_0x526801(++_0x546a15);}(_0x2fd8,0xc3));var _0x82fd=function(_0x412cf9,_0x1a4932){_0x412cf9=_0x412cf9-0x0;var _0x9d24e4=_0x2fd8[_0x412cf9];return _0x9d24e4;};'use strict';var Sequelize=require(_0x82fd('0x0'));module['exports']={'field':{'type':Sequelize[_0x82fd('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x82fd('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x82fd('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x1b9b=['exports','TEXT','STRING','BOOLEAN'];(function(_0x964d16,_0x22e8b2){var _0x5af22b=function(_0x16bcb9){while(--_0x16bcb9){_0x964d16['push'](_0x964d16['shift']());}};_0x5af22b(++_0x22e8b2);}(_0x1b9b,0x1dc));var _0xb1b9=function(_0x17809c,_0xa6ceb9){_0x17809c=_0x17809c-0x0;var _0x144a29=_0x1b9b[_0x17809c];return _0x144a29;};'use strict';var Sequelize=require('sequelize');module[_0xb1b9('0x0')]={'field':{'type':Sequelize[_0xb1b9('0x1')]},'alias':{'type':Sequelize[_0xb1b9('0x2')]},'function':{'type':Sequelize[_0xb1b9('0x2')]},'format':{'type':Sequelize[_0xb1b9('0x2')]},'groupBy':{'type':Sequelize[_0xb1b9('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb1b9('0x2')]},'custom':{'type':Sequelize[_0xb1b9('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 3a22be6..403a6ea 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 _0x91cd=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','AnalyticFieldReport','then','includeAll','include','findAll','catch','show','length','options','find','create','body','bulkCreate','params','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x48f94e,_0x62515d){var _0x25be89=function(_0x37bdd4){while(--_0x37bdd4){_0x48f94e['push'](_0x48f94e['shift']());}};_0x25be89(++_0x62515d);}(_0x91cd,0x12d));var _0xd91c=function(_0x4dbba7,_0x34d6d1){_0x4dbba7=_0x4dbba7-0x0;var _0x43ef83=_0x91cd[_0x4dbba7];return _0x43ef83;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd91c('0x0'));var zipdir=require(_0xd91c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd91c('0x2'));var moment=require(_0xd91c('0x3'));var BPromise=require(_0xd91c('0x4'));var Mustache=require('mustache');var util=require(_0xd91c('0x5'));var path=require('path');var sox=require(_0xd91c('0x6'));var csv=require(_0xd91c('0x7'));var ejs=require(_0xd91c('0x8'));var fs=require('fs');var fs_extra=require(_0xd91c('0x9'));var _=require(_0xd91c('0xa'));var squel=require(_0xd91c('0xb'));var crypto=require(_0xd91c('0xc'));var jsforce=require(_0xd91c('0xd'));var deskjs=require(_0xd91c('0xe'));var toCsv=require(_0xd91c('0x7'));var querystring=require('querystring');var Papa=require(_0xd91c('0xf'));var Redis=require(_0xd91c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd91c('0x11'));var as=require(_0xd91c('0x12'));var hardwareService=require(_0xd91c('0x13'));var logger=require(_0xd91c('0x14'))(_0xd91c('0x15'));var utils=require('../../config/utils');var config=require(_0xd91c('0x16'));var licenseUtil=require(_0xd91c('0x17'));var db=require(_0xd91c('0x18'))['db'];function respondWithStatusCode(_0xa62588,_0x1a8263){_0x1a8263=_0x1a8263||0xcc;return function(_0x47fc56){if(_0x47fc56){return _0xa62588[_0xd91c('0x19')](_0x1a8263);}return _0xa62588[_0xd91c('0x1a')](_0x1a8263)[_0xd91c('0x1b')]();};}function respondWithResult(_0x5a9a34,_0x321d51){_0x321d51=_0x321d51||0xc8;return function(_0x43a300){if(_0x43a300){return _0x5a9a34[_0xd91c('0x1a')](_0x321d51)[_0xd91c('0x1c')](_0x43a300);}};}function respondWithFilteredResult(_0x445732,_0x43f01a){return function(_0x1f749a){if(_0x1f749a){var _0xf83191=typeof _0x43f01a[_0xd91c('0x1d')]===_0xd91c('0x1e')&&typeof _0x43f01a[_0xd91c('0x1f')]===_0xd91c('0x1e');var _0x2494c6=_0x1f749a[_0xd91c('0x20')];var _0x56fef=_0xf83191?0x0:_0x43f01a[_0xd91c('0x1d')];var _0x53ca16=_0xf83191?_0x1f749a[_0xd91c('0x20')]:_0x43f01a[_0xd91c('0x1d')]+_0x43f01a[_0xd91c('0x1f')];var _0x2c3317;if(_0x53ca16>=_0x2494c6){_0x53ca16=_0x2494c6;_0x2c3317=0xc8;}else{_0x2c3317=0xce;}_0x445732['status'](_0x2c3317);return _0x445732[_0xd91c('0x21')](_0xd91c('0x22'),_0x56fef+'-'+_0x53ca16+'/'+_0x2494c6)['json'](_0x1f749a);}return null;};}function patchUpdates(_0x13e6f0){return function(_0x43a577){try{jsonpatch[_0xd91c('0x23')](_0x43a577,_0x13e6f0,!![]);}catch(_0x5b48f1){return BPromise[_0xd91c('0x24')](_0x5b48f1);}return _0x43a577[_0xd91c('0x25')]();};}function saveUpdates(_0x38895a,_0x53a6bc){return function(_0x22b0d4){if(_0x22b0d4){return _0x22b0d4[_0xd91c('0x26')](_0x38895a)['then'](function(_0x149399){return _0x149399;});}return null;};}function removeEntity(_0x3f976d,_0x3fc434){return function(_0x42b4e3){if(_0x42b4e3){return _0x42b4e3['destroy']()['then'](function(){_0x3f976d['status'](0xcc)[_0xd91c('0x1b')]();});}};}function handleEntityNotFound(_0x105097,_0x32c93e){return function(_0x3a16c4){if(!_0x3a16c4){_0x105097[_0xd91c('0x19')](0x194);}return _0x3a16c4;};}function handleError(_0x39ffc2,_0x20e06e){_0x20e06e=_0x20e06e||0x1f4;return function(_0x3a430d){logger[_0xd91c('0x27')](_0x3a430d[_0xd91c('0x28')]);if(_0x3a430d[_0xd91c('0x29')]){delete _0x3a430d['name'];}_0x39ffc2[_0xd91c('0x1a')](_0x20e06e)[_0xd91c('0x2a')](_0x3a430d);};}exports[_0xd91c('0x2b')]=function(_0x40091c,_0x1606cd){var _0x47d829={},_0x1492b7={},_0x4c3284={'count':0x0,'rows':[]};var _0x523582=_['map'](db['AnalyticFieldReport'][_0xd91c('0x2c')],function(_0x100fda){return{'name':_0x100fda['fieldName'],'type':_0x100fda[_0xd91c('0x2d')][_0xd91c('0x2e')]};});_0x1492b7[_0xd91c('0x2f')]=_[_0xd91c('0x30')](_0x523582,'name');_0x1492b7['query']=_[_0xd91c('0x31')](_0x40091c[_0xd91c('0x32')]);_0x1492b7[_0xd91c('0x33')]=_[_0xd91c('0x34')](_0x1492b7[_0xd91c('0x2f')],_0x1492b7[_0xd91c('0x32')]);_0x47d829[_0xd91c('0x35')]=_['intersection'](_0x1492b7['model'],qs[_0xd91c('0x36')](_0x40091c['query'][_0xd91c('0x36')]));_0x47d829[_0xd91c('0x35')]=_0x47d829[_0xd91c('0x35')]['length']?_0x47d829[_0xd91c('0x35')]:_0x1492b7['model'];if(!_0x40091c[_0xd91c('0x32')][_0xd91c('0x37')]('nolimit')){_0x47d829[_0xd91c('0x1f')]=qs[_0xd91c('0x1f')](_0x40091c[_0xd91c('0x32')][_0xd91c('0x1f')]);_0x47d829[_0xd91c('0x1d')]=qs[_0xd91c('0x1d')](_0x40091c[_0xd91c('0x32')][_0xd91c('0x1d')]);}_0x47d829['order']=qs[_0xd91c('0x38')](_0x40091c[_0xd91c('0x32')]['sort']);_0x47d829[_0xd91c('0x39')]=qs[_0xd91c('0x33')](_[_0xd91c('0x3a')](_0x40091c[_0xd91c('0x32')],_0x1492b7[_0xd91c('0x33')]),_0x523582);if(_0x40091c[_0xd91c('0x32')]['filter']){_0x47d829[_0xd91c('0x39')]=_[_0xd91c('0x3b')](_0x47d829[_0xd91c('0x39')],{'$or':_['map'](_0x523582,function(_0x286f1c){if(_0x286f1c['type']!=='VIRTUAL'){var _0x3188b6={};_0x3188b6[_0x286f1c[_0xd91c('0x29')]]={'$like':'%'+_0x40091c['query']['filter']+'%'};return _0x3188b6;}})});}_0x47d829=_['merge']({},_0x47d829,_0x40091c['options']);var _0x15659f={'where':_0x47d829[_0xd91c('0x39')]};return db[_0xd91c('0x3c')]['count'](_0x15659f)[_0xd91c('0x3d')](function(_0x5f01a3){_0x4c3284[_0xd91c('0x20')]=_0x5f01a3;if(_0x40091c[_0xd91c('0x32')][_0xd91c('0x3e')]){_0x47d829[_0xd91c('0x3f')]=[{'all':!![]}];}return db[_0xd91c('0x3c')][_0xd91c('0x40')](_0x47d829);})[_0xd91c('0x3d')](function(_0x1ce662){_0x4c3284['rows']=_0x1ce662;return _0x4c3284;})['then'](respondWithFilteredResult(_0x1606cd,_0x47d829))[_0xd91c('0x41')](handleError(_0x1606cd,null));};exports[_0xd91c('0x42')]=function(_0x1af82c,_0x452811){var _0x5862fb={'raw':![],'where':{'id':_0x1af82c['params']['id']}},_0x4730d8={};_0x4730d8[_0xd91c('0x2f')]=_[_0xd91c('0x31')](db[_0xd91c('0x3c')][_0xd91c('0x2c')]);_0x4730d8[_0xd91c('0x32')]=_['keys'](_0x1af82c['query']);_0x4730d8[_0xd91c('0x33')]=_['intersection'](_0x4730d8[_0xd91c('0x2f')],_0x4730d8[_0xd91c('0x32')]);_0x5862fb['attributes']=_[_0xd91c('0x34')](_0x4730d8[_0xd91c('0x2f')],qs[_0xd91c('0x36')](_0x1af82c[_0xd91c('0x32')][_0xd91c('0x36')]));_0x5862fb[_0xd91c('0x35')]=_0x5862fb[_0xd91c('0x35')][_0xd91c('0x43')]?_0x5862fb[_0xd91c('0x35')]:_0x4730d8[_0xd91c('0x2f')];if(_0x1af82c[_0xd91c('0x32')][_0xd91c('0x3e')]){_0x5862fb[_0xd91c('0x3f')]=[{'all':!![]}];}_0x5862fb=_['merge']({},_0x5862fb,_0x1af82c[_0xd91c('0x44')]);return db['AnalyticFieldReport'][_0xd91c('0x45')](_0x5862fb)['then'](handleEntityNotFound(_0x452811,null))[_0xd91c('0x3d')](respondWithResult(_0x452811,null))['catch'](handleError(_0x452811,null));};exports[_0xd91c('0x46')]=function(_0x2194cf,_0x56ae1){return db[_0xd91c('0x3c')][_0xd91c('0x46')](_0x2194cf[_0xd91c('0x47')],{})[_0xd91c('0x3d')](respondWithResult(_0x56ae1,0xc9))[_0xd91c('0x41')](handleError(_0x56ae1,null));};exports[_0xd91c('0x48')]=function(_0x1dedaf,_0x2f7baa){return db[_0xd91c('0x3c')][_0xd91c('0x48')](_0x1dedaf[_0xd91c('0x47')],{'raw':![],'individualHooks':!![]})[_0xd91c('0x3d')](respondWithResult(_0x2f7baa,0xc9))['catch'](handleError(_0x2f7baa,null));};exports['update']=function(_0x4871db,_0x51daab){if(_0x4871db['body']['id']){delete _0x4871db[_0xd91c('0x47')]['id'];}return db[_0xd91c('0x3c')][_0xd91c('0x45')]({'where':{'id':_0x4871db[_0xd91c('0x49')]['id']}})[_0xd91c('0x3d')](handleEntityNotFound(_0x51daab,null))[_0xd91c('0x3d')](saveUpdates(_0x4871db[_0xd91c('0x47')],null))['then'](respondWithResult(_0x51daab,null))[_0xd91c('0x41')](handleError(_0x51daab,null));};exports[_0xd91c('0x4a')]=function(_0x21c1d9,_0x2ef4a4){return db['AnalyticFieldReport']['find']({'where':{'id':_0x21c1d9[_0xd91c('0x49')]['id']}})[_0xd91c('0x3d')](handleEntityNotFound(_0x2ef4a4,null))[_0xd91c('0x3d')](removeEntity(_0x2ef4a4,null))['catch'](handleError(_0x2ef4a4,null));};exports[_0xd91c('0x4b')]=function(_0x10a734,_0x302211){return db[_0xd91c('0x3c')][_0xd91c('0x4a')]({'where':{'id':_0x10a734[_0xd91c('0x32')][_0xd91c('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xd91c('0x3d')](respondWithResult(_0x302211,0xcc))['catch'](handleError(_0x302211,null));};exports[_0xd91c('0x4d')]=function(_0x20b0ed,_0x2a60ed,_0x24518b){return db[_0xd91c('0x4e')]['findOne']({'where':{'id':_0x20b0ed[_0xd91c('0x49')]['id']}})[_0xd91c('0x3d')](handleEntityNotFound(_0x2a60ed,null))[_0xd91c('0x3d')](function(_0x1c5af2){if(_0x1c5af2){return db[_0xd91c('0x4f')][_0xd91c('0x50')](function(_0x1ca515){return db[_0xd91c('0x3c')][_0xd91c('0x4a')]({'where':{'CustomReportId':_0x20b0ed[_0xd91c('0x49')]['id']},'transaction':_0x1ca515})[_0xd91c('0x3d')](function(_0x1db69a){var _0x55a5f6=_[_0xd91c('0x30')](_0x20b0ed[_0xd91c('0x47')],function(_0x476591){delete _0x476591['id'];_0x476591[_0xd91c('0x51')]=_0x20b0ed[_0xd91c('0x49')]['id'];return _0x476591;});return db[_0xd91c('0x3c')][_0xd91c('0x48')](_0x55a5f6,{'transaction':_0x1ca515});});})[_0xd91c('0x3d')](function(){return db['AnalyticFieldReport'][_0xd91c('0x40')]({'where':{'CustomReportId':_0x20b0ed[_0xd91c('0x49')]['id']}});});}})[_0xd91c('0x3d')](respondWithResult(_0x2a60ed,null))[_0xd91c('0x41')](handleError(_0x2a60ed,null));};
\ No newline at end of file
+var _0xc6af=['json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','index','map','AnalyticFieldReport','fieldName','key','keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0xc6af,0x137));var _0xfc6a=function(_0x4ea38e,_0xc50e8a){_0x4ea38e=_0x4ea38e-0x0;var _0x31dc07=_0xc6af[_0x4ea38e];return _0x31dc07;};'use strict';var emlformat=require(_0xfc6a('0x0'));var rimraf=require(_0xfc6a('0x1'));var zipdir=require(_0xfc6a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc6a('0x3'));var moment=require(_0xfc6a('0x4'));var BPromise=require(_0xfc6a('0x5'));var Mustache=require(_0xfc6a('0x6'));var util=require(_0xfc6a('0x7'));var path=require(_0xfc6a('0x8'));var sox=require(_0xfc6a('0x9'));var csv=require(_0xfc6a('0xa'));var ejs=require(_0xfc6a('0xb'));var fs=require('fs');var fs_extra=require(_0xfc6a('0xc'));var _=require(_0xfc6a('0xd'));var squel=require('squel');var crypto=require(_0xfc6a('0xe'));var jsforce=require(_0xfc6a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xfc6a('0xa'));var querystring=require(_0xfc6a('0x10'));var Papa=require('papaparse');var Redis=require(_0xfc6a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfc6a('0x12'));var as=require(_0xfc6a('0x13'));var hardwareService=require(_0xfc6a('0x14'));var logger=require(_0xfc6a('0x15'))(_0xfc6a('0x16'));var utils=require(_0xfc6a('0x17'));var config=require(_0xfc6a('0x18'));var licenseUtil=require(_0xfc6a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a6321,_0x304cd4){_0x304cd4=_0x304cd4||0xcc;return function(_0x3156a5){if(_0x3156a5){return _0x2a6321[_0xfc6a('0x1a')](_0x304cd4);}return _0x2a6321[_0xfc6a('0x1b')](_0x304cd4)[_0xfc6a('0x1c')]();};}function respondWithResult(_0x39fb0a,_0x33461e){_0x33461e=_0x33461e||0xc8;return function(_0x566647){if(_0x566647){return _0x39fb0a[_0xfc6a('0x1b')](_0x33461e)[_0xfc6a('0x1d')](_0x566647);}};}function respondWithFilteredResult(_0x39d866,_0x50881b){return function(_0x433210){if(_0x433210){var _0x322eab=typeof _0x50881b[_0xfc6a('0x1e')]===_0xfc6a('0x1f')&&typeof _0x50881b[_0xfc6a('0x20')]===_0xfc6a('0x1f');var _0x4f1709=_0x433210[_0xfc6a('0x21')];var _0x2a7868=_0x322eab?0x0:_0x50881b['offset'];var _0x2dc33d=_0x322eab?_0x433210[_0xfc6a('0x21')]:_0x50881b['offset']+_0x50881b[_0xfc6a('0x20')];var _0x5d51cb;if(_0x2dc33d>=_0x4f1709){_0x2dc33d=_0x4f1709;_0x5d51cb=0xc8;}else{_0x5d51cb=0xce;}_0x39d866[_0xfc6a('0x1b')](_0x5d51cb);return _0x39d866[_0xfc6a('0x22')](_0xfc6a('0x23'),_0x2a7868+'-'+_0x2dc33d+'/'+_0x4f1709)[_0xfc6a('0x1d')](_0x433210);}return null;};}function patchUpdates(_0x142c8f){return function(_0x5938e5){try{jsonpatch['apply'](_0x5938e5,_0x142c8f,!![]);}catch(_0x7bee97){return BPromise['reject'](_0x7bee97);}return _0x5938e5[_0xfc6a('0x24')]();};}function saveUpdates(_0x3fcf99,_0x21cfdf){return function(_0x23119f){if(_0x23119f){return _0x23119f[_0xfc6a('0x25')](_0x3fcf99)[_0xfc6a('0x26')](function(_0x4d3c6a){return _0x4d3c6a;});}return null;};}function removeEntity(_0x3a3e70,_0x1ad5e9){return function(_0x5f4c1e){if(_0x5f4c1e){return _0x5f4c1e[_0xfc6a('0x27')]()[_0xfc6a('0x26')](function(){_0x3a3e70['status'](0xcc)[_0xfc6a('0x1c')]();});}};}function handleEntityNotFound(_0x8c8cde,_0x37d2a4){return function(_0x45537a){if(!_0x45537a){_0x8c8cde[_0xfc6a('0x1a')](0x194);}return _0x45537a;};}function handleError(_0x569392,_0x4ae030){_0x4ae030=_0x4ae030||0x1f4;return function(_0x40f8bc){logger[_0xfc6a('0x28')](_0x40f8bc['stack']);if(_0x40f8bc[_0xfc6a('0x29')]){delete _0x40f8bc[_0xfc6a('0x29')];}_0x569392[_0xfc6a('0x1b')](_0x4ae030)[_0xfc6a('0x2a')](_0x40f8bc);};}exports[_0xfc6a('0x2b')]=function(_0x141134,_0x7b7923){var _0x1b74c5={},_0x1a700f={},_0x3e0fa3={'count':0x0,'rows':[]};var _0x5bbda2=_[_0xfc6a('0x2c')](db[_0xfc6a('0x2d')]['rawAttributes'],function(_0x4852ec){return{'name':_0x4852ec[_0xfc6a('0x2e')],'type':_0x4852ec['type'][_0xfc6a('0x2f')]};});_0x1a700f['model']=_[_0xfc6a('0x2c')](_0x5bbda2,_0xfc6a('0x29'));_0x1a700f['query']=_[_0xfc6a('0x30')](_0x141134['query']);_0x1a700f[_0xfc6a('0x31')]=_['intersection'](_0x1a700f[_0xfc6a('0x32')],_0x1a700f[_0xfc6a('0x33')]);_0x1b74c5[_0xfc6a('0x34')]=_[_0xfc6a('0x35')](_0x1a700f['model'],qs[_0xfc6a('0x36')](_0x141134[_0xfc6a('0x33')][_0xfc6a('0x36')]));_0x1b74c5[_0xfc6a('0x34')]=_0x1b74c5[_0xfc6a('0x34')][_0xfc6a('0x37')]?_0x1b74c5[_0xfc6a('0x34')]:_0x1a700f[_0xfc6a('0x32')];if(!_0x141134[_0xfc6a('0x33')][_0xfc6a('0x38')](_0xfc6a('0x39'))){_0x1b74c5[_0xfc6a('0x20')]=qs[_0xfc6a('0x20')](_0x141134['query'][_0xfc6a('0x20')]);_0x1b74c5[_0xfc6a('0x1e')]=qs[_0xfc6a('0x1e')](_0x141134['query']['offset']);}_0x1b74c5[_0xfc6a('0x3a')]=qs[_0xfc6a('0x3b')](_0x141134[_0xfc6a('0x33')][_0xfc6a('0x3b')]);_0x1b74c5['where']=qs[_0xfc6a('0x31')](_['pick'](_0x141134[_0xfc6a('0x33')],_0x1a700f[_0xfc6a('0x31')]),_0x5bbda2);if(_0x141134[_0xfc6a('0x33')][_0xfc6a('0x3c')]){_0x1b74c5[_0xfc6a('0x3d')]=_[_0xfc6a('0x3e')](_0x1b74c5[_0xfc6a('0x3d')],{'$or':_['map'](_0x5bbda2,function(_0x5069d7){if(_0x5069d7[_0xfc6a('0x3f')]!==_0xfc6a('0x40')){var _0x3ae67e={};_0x3ae67e[_0x5069d7[_0xfc6a('0x29')]]={'$like':'%'+_0x141134[_0xfc6a('0x33')][_0xfc6a('0x3c')]+'%'};return _0x3ae67e;}})});}_0x1b74c5=_[_0xfc6a('0x3e')]({},_0x1b74c5,_0x141134[_0xfc6a('0x41')]);var _0x49910b={'where':_0x1b74c5[_0xfc6a('0x3d')]};return db[_0xfc6a('0x2d')][_0xfc6a('0x21')](_0x49910b)[_0xfc6a('0x26')](function(_0x1b1008){_0x3e0fa3[_0xfc6a('0x21')]=_0x1b1008;if(_0x141134[_0xfc6a('0x33')][_0xfc6a('0x42')]){_0x1b74c5[_0xfc6a('0x43')]=[{'all':!![]}];}return db[_0xfc6a('0x2d')][_0xfc6a('0x44')](_0x1b74c5);})[_0xfc6a('0x26')](function(_0x3c9225){_0x3e0fa3['rows']=_0x3c9225;return _0x3e0fa3;})[_0xfc6a('0x26')](respondWithFilteredResult(_0x7b7923,_0x1b74c5))[_0xfc6a('0x45')](handleError(_0x7b7923,null));};exports[_0xfc6a('0x46')]=function(_0x5c055d,_0x14004b){var _0x3c17e3={'raw':![],'where':{'id':_0x5c055d[_0xfc6a('0x47')]['id']}},_0x42f972={};_0x42f972[_0xfc6a('0x32')]=_[_0xfc6a('0x30')](db[_0xfc6a('0x2d')][_0xfc6a('0x48')]);_0x42f972['query']=_[_0xfc6a('0x30')](_0x5c055d[_0xfc6a('0x33')]);_0x42f972[_0xfc6a('0x31')]=_[_0xfc6a('0x35')](_0x42f972[_0xfc6a('0x32')],_0x42f972['query']);_0x3c17e3[_0xfc6a('0x34')]=_[_0xfc6a('0x35')](_0x42f972[_0xfc6a('0x32')],qs['fields'](_0x5c055d[_0xfc6a('0x33')][_0xfc6a('0x36')]));_0x3c17e3[_0xfc6a('0x34')]=_0x3c17e3[_0xfc6a('0x34')]['length']?_0x3c17e3['attributes']:_0x42f972[_0xfc6a('0x32')];if(_0x5c055d[_0xfc6a('0x33')][_0xfc6a('0x42')]){_0x3c17e3[_0xfc6a('0x43')]=[{'all':!![]}];}_0x3c17e3=_[_0xfc6a('0x3e')]({},_0x3c17e3,_0x5c055d[_0xfc6a('0x41')]);return db[_0xfc6a('0x2d')][_0xfc6a('0x49')](_0x3c17e3)['then'](handleEntityNotFound(_0x14004b,null))[_0xfc6a('0x26')](respondWithResult(_0x14004b,null))['catch'](handleError(_0x14004b,null));};exports['create']=function(_0x40da92,_0x19e293){return db[_0xfc6a('0x2d')][_0xfc6a('0x4a')](_0x40da92[_0xfc6a('0x4b')],{})['then'](respondWithResult(_0x19e293,0xc9))[_0xfc6a('0x45')](handleError(_0x19e293,null));};exports['bulkCreate']=function(_0x27d782,_0x5dfe5e){return db['AnalyticFieldReport'][_0xfc6a('0x4c')](_0x27d782[_0xfc6a('0x4b')],{'raw':![],'individualHooks':!![]})[_0xfc6a('0x26')](respondWithResult(_0x5dfe5e,0xc9))[_0xfc6a('0x45')](handleError(_0x5dfe5e,null));};exports[_0xfc6a('0x25')]=function(_0x13ce17,_0x52ab42){if(_0x13ce17['body']['id']){delete _0x13ce17[_0xfc6a('0x4b')]['id'];}return db[_0xfc6a('0x2d')]['find']({'where':{'id':_0x13ce17[_0xfc6a('0x47')]['id']}})[_0xfc6a('0x26')](handleEntityNotFound(_0x52ab42,null))[_0xfc6a('0x26')](saveUpdates(_0x13ce17['body'],null))[_0xfc6a('0x26')](respondWithResult(_0x52ab42,null))[_0xfc6a('0x45')](handleError(_0x52ab42,null));};exports[_0xfc6a('0x27')]=function(_0x159f9f,_0x3dff6a){return db[_0xfc6a('0x2d')][_0xfc6a('0x49')]({'where':{'id':_0x159f9f[_0xfc6a('0x47')]['id']}})[_0xfc6a('0x26')](handleEntityNotFound(_0x3dff6a,null))['then'](removeEntity(_0x3dff6a,null))[_0xfc6a('0x45')](handleError(_0x3dff6a,null));};exports[_0xfc6a('0x4d')]=function(_0x134a92,_0x31efcc){return db[_0xfc6a('0x2d')][_0xfc6a('0x27')]({'where':{'id':_0x134a92[_0xfc6a('0x33')][_0xfc6a('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xfc6a('0x26')](respondWithResult(_0x31efcc,0xcc))[_0xfc6a('0x45')](handleError(_0x31efcc,null));};exports[_0xfc6a('0x4f')]=function(_0x37ae5a,_0x5a258c,_0x68b9b4){return db[_0xfc6a('0x50')][_0xfc6a('0x51')]({'where':{'id':_0x37ae5a[_0xfc6a('0x47')]['id']}})[_0xfc6a('0x26')](handleEntityNotFound(_0x5a258c,null))['then'](function(_0x1d354c){if(_0x1d354c){return db[_0xfc6a('0x52')][_0xfc6a('0x53')](function(_0x12c002){return db['AnalyticFieldReport'][_0xfc6a('0x27')]({'where':{'CustomReportId':_0x37ae5a['params']['id']},'transaction':_0x12c002})['then'](function(_0x4de021){var _0x2dad31=_[_0xfc6a('0x2c')](_0x37ae5a[_0xfc6a('0x4b')],function(_0x5c0328){delete _0x5c0328['id'];_0x5c0328[_0xfc6a('0x54')]=_0x37ae5a[_0xfc6a('0x47')]['id'];return _0x5c0328;});return db[_0xfc6a('0x2d')][_0xfc6a('0x4c')](_0x2dad31,{'transaction':_0x12c002});});})['then'](function(){return db[_0xfc6a('0x2d')]['findAll']({'where':{'CustomReportId':_0x37ae5a[_0xfc6a('0x47')]['id']}});});}})[_0xfc6a('0x26')](respondWithResult(_0x5a258c,null))[_0xfc6a('0x45')](handleError(_0x5a258c,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index a509dbe..5fbb89e 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 _0xd204=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','bluebird','rimraf','./analyticFieldReport.attributes'];(function(_0x26996f,_0x295984){var _0x3ab19c=function(_0x2a86d2){while(--_0x2a86d2){_0x26996f['push'](_0x26996f['shift']());}};_0x3ab19c(++_0x295984);}(_0xd204,0x1ea));var _0x4d20=function(_0x1854ef,_0x4fe295){_0x1854ef=_0x1854ef-0x0;var _0x4cbe36=_0xd204[_0x1854ef];return _0x4cbe36;};'use strict';var _=require(_0x4d20('0x0'));var util=require(_0x4d20('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4d20('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4d20('0x3'));var config=require('../../config/environment');var attributes=require(_0x4d20('0x4'));module[_0x4d20('0x5')]=function(_0x3379bb,_0x265a10){return _0x3379bb[_0x4d20('0x6')](_0x4d20('0x7'),attributes,{'tableName':_0x4d20('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb0cb=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','define'];(function(_0x253b7b,_0x5f4bf9){var _0xab484=function(_0x12ef6f){while(--_0x12ef6f){_0x253b7b['push'](_0x253b7b['shift']());}};_0xab484(++_0x5f4bf9);}(_0xb0cb,0x17b));var _0xbb0c=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xb0cb[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0xbb0c('0x0'));var util=require(_0xbb0c('0x1'));var logger=require(_0xbb0c('0x2'))(_0xbb0c('0x3'));var moment=require(_0xbb0c('0x4'));var BPromise=require(_0xbb0c('0x5'));var rp=require(_0xbb0c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb0c('0x7'));var config=require(_0xbb0c('0x8'));var attributes=require(_0xbb0c('0x9'));module['exports']=function(_0x1a19f0,_0x49bc9f){return _0x1a19f0[_0xbb0c('0xa')](_0xbb0c('0xb'),attributes,{'tableName':_0xbb0c('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 4e487a6..580cb3e 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 _0x35f0=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x35f0,0x80));var _0x035f=function(_0x27183b,_0x4f8348){_0x27183b=_0x27183b-0x0;var _0x5a5f9f=_0x35f0[_0x27183b];return _0x5a5f9f;};'use strict';var _=require(_0x035f('0x0'));var util=require('util');var moment=require(_0x035f('0x1'));var BPromise=require(_0x035f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x035f('0x3'));var db=require(_0x035f('0x4'))['db'];var utils=require(_0x035f('0x5'));var logger=require(_0x035f('0x6'))(_0x035f('0x7'));var config=require('../../config/environment');var jayson=require(_0x035f('0x8'));var client=jayson[_0x035f('0x9')][_0x035f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3320f4,_0x793abe,_0x5b1ec4){return new BPromise(function(_0x4f0890,_0x449b99){return client['request'](_0x3320f4,_0x5b1ec4)['then'](function(_0x4d8e47){logger[_0x035f('0xb')](_0x035f('0xc'),_0x793abe,_0x035f('0xd'));logger[_0x035f('0xe')](_0x035f('0xf'),_0x793abe,'request\x20sent',JSON[_0x035f('0x10')](_0x4d8e47));if(_0x4d8e47['error']){if(_0x4d8e47[_0x035f('0x11')][_0x035f('0x12')]===0x1f4){logger[_0x035f('0x11')](_0x035f('0xc'),_0x793abe,_0x4d8e47['error'][_0x035f('0x13')]);return _0x449b99(_0x4d8e47[_0x035f('0x11')][_0x035f('0x13')]);}logger[_0x035f('0x11')](_0x035f('0xc'),_0x793abe,_0x4d8e47[_0x035f('0x11')][_0x035f('0x13')]);return _0x4f0890(_0x4d8e47[_0x035f('0x11')][_0x035f('0x13')]);}else{logger['info'](_0x035f('0xc'),_0x793abe,'request\x20sent');_0x4f0890(_0x4d8e47[_0x035f('0x14')][_0x035f('0x13')]);}})[_0x035f('0x15')](function(_0x78ede1){logger[_0x035f('0x11')](_0x035f('0xc'),_0x793abe,_0x78ede1);_0x449b99(_0x78ede1);});});}
\ No newline at end of file
+var _0x374e=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x374e,0xba));var _0xe374=function(_0x1f2e32,_0x5eb322){_0x1f2e32=_0x1f2e32-0x0;var _0x4e0b6d=_0x374e[_0x1f2e32];return _0x4e0b6d;};'use strict';var _=require(_0xe374('0x0'));var util=require('util');var moment=require(_0xe374('0x1'));var BPromise=require(_0xe374('0x2'));var rs=require(_0xe374('0x3'));var fs=require('fs');var Redis=require(_0xe374('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe374('0x5'));var logger=require(_0xe374('0x6'))('rpc');var config=require(_0xe374('0x7'));var jayson=require(_0xe374('0x8'));var client=jayson[_0xe374('0x9')][_0xe374('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x227423,_0x3b9afd,_0x39fea0){return new BPromise(function(_0x37922a,_0x4f31e3){return client[_0xe374('0xb')](_0x227423,_0x39fea0)[_0xe374('0xc')](function(_0x3da1d1){logger[_0xe374('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3b9afd,'request\x20sent');logger[_0xe374('0xe')](_0xe374('0xf'),_0x3b9afd,_0xe374('0x10'),JSON[_0xe374('0x11')](_0x3da1d1));if(_0x3da1d1[_0xe374('0x12')]){if(_0x3da1d1[_0xe374('0x12')][_0xe374('0x13')]===0x1f4){logger[_0xe374('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3b9afd,_0x3da1d1[_0xe374('0x12')]['message']);return _0x4f31e3(_0x3da1d1[_0xe374('0x12')][_0xe374('0x14')]);}logger[_0xe374('0x12')](_0xe374('0x15'),_0x3b9afd,_0x3da1d1['error'][_0xe374('0x14')]);return _0x37922a(_0x3da1d1['error'][_0xe374('0x14')]);}else{logger[_0xe374('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3b9afd,_0xe374('0x10'));_0x37922a(_0x3da1d1[_0xe374('0x16')]['message']);}})[_0xe374('0x17')](function(_0x58ddc4){logger[_0xe374('0x12')](_0xe374('0x15'),_0x3b9afd,_0x58ddc4);_0x4f31e3(_0x58ddc4);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 1791f4d..17bc258 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(_0x2b3a60,_0x146ec1){var _0xd21365=function(_0x59ad5a){while(--_0x59ad5a){_0x2b3a60['push'](_0x2b3a60['shift']());}};_0xd21365(++_0x146ec1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x1d638b,_0x52dd72){var _0x492ad9=function(_0x4ae4d7){while(--_0x4ae4d7){_0x1d638b['push'](_0x1d638b['shift']());}};_0x492ad9(++_0x52dd72);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 c7fdc8e..7e17130 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 _0xa74f=['STRING','TEXT'];(function(_0x3d1f60,_0x166b36){var _0x4f68ec=function(_0xd8d6f0){while(--_0xd8d6f0){_0x3d1f60['push'](_0x3d1f60['shift']());}};_0x4f68ec(++_0x166b36);}(_0xa74f,0x9a));var _0xfa74=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0xa74f[_0x424357];return _0x29c68e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfa74('0x0')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xfa74('0x1')]},'description':{'type':Sequelize[_0xfa74('0x0')]}};
\ No newline at end of file
+var _0xede3=['exports','name','STRING','TEXT'];(function(_0xdba210,_0x17d434){var _0x5c7712=function(_0x36ad83){while(--_0x36ad83){_0xdba210['push'](_0xdba210['shift']());}};_0x5c7712(++_0x17d434);}(_0xede3,0xc0));var _0x3ede=function(_0x1f1ea6,_0x51eb08){_0x1f1ea6=_0x1f1ea6-0x0;var _0x4ead57=_0xede3[_0x1f1ea6];return _0x4ead57;};'use strict';var Sequelize=require('sequelize');module[_0x3ede('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3ede('0x1')},'table':{'type':Sequelize[_0x3ede('0x2')]},'metric':{'type':Sequelize[_0x3ede('0x3')]},'description':{'type':Sequelize[_0x3ede('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 080d1a3..4ca3d27 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 _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x17259a,_0x44b48f){var _0x1ed9cd=function(_0x1f216a){while(--_0x1f216a){_0x17259a['push'](_0x17259a['shift']());}};_0x1ed9cd(++_0x44b48f);}(_0xdc97,0x13b));var _0x7dc9=function(_0x129b3a,_0x32828f){_0x129b3a=_0x129b3a-0x0;var _0x52ee3c=_0xdc97[_0x129b3a];return _0x52ee3c;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));};
\ No newline at end of file
+var _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x6c1057,_0x1e35a6){var _0x515a94=function(_0x355b51){while(--_0x355b51){_0x6c1057['push'](_0x6c1057['shift']());}};_0x515a94(++_0x1e35a6);}(_0x98a8,0x12c));var _0x898a=function(_0xf84bc9,_0x27d951){_0xf84bc9=_0xf84bc9-0x0;var _0x55fc35=_0x98a8[_0xf84bc9];return _0x55fc35;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 07013cb..6c84d39 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 _0x6869=['rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util','../../config/logger','moment','path'];(function(_0x4f310a,_0x2a5f79){var _0x3c7876=function(_0x4fcb41){while(--_0x4fcb41){_0x4f310a['push'](_0x4f310a['shift']());}};_0x3c7876(++_0x2a5f79);}(_0x6869,0xe2));var _0x9686=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x6869[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x9686('0x0'));var util=require(_0x9686('0x1'));var logger=require(_0x9686('0x2'))('api');var moment=require(_0x9686('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9686('0x4'));var rimraf=require(_0x9686('0x5'));var config=require(_0x9686('0x6'));var attributes=require(_0x9686('0x7'));module[_0x9686('0x8')]=function(_0x4a0657,_0x35591e){return _0x4a0657[_0x9686('0x9')](_0x9686('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdfa0=['path','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x214ec2,_0x3a437b){var _0x18b531=function(_0x48234f){while(--_0x48234f){_0x214ec2['push'](_0x214ec2['shift']());}};_0x18b531(++_0x3a437b);}(_0xdfa0,0x69));var _0x0dfa=function(_0x2761f8,_0x54996e){_0x2761f8=_0x2761f8-0x0;var _0x33f750=_0xdfa0[_0x2761f8];return _0x33f750;};'use strict';var _=require(_0x0dfa('0x0'));var util=require('util');var logger=require(_0x0dfa('0x1'))(_0x0dfa('0x2'));var moment=require('moment');var BPromise=require(_0x0dfa('0x3'));var rp=require(_0x0dfa('0x4'));var fs=require('fs');var path=require(_0x0dfa('0x5'));var rimraf=require('rimraf');var config=require(_0x0dfa('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x0dfa('0x7')]=function(_0x2efe20,_0x4830b6){return _0x2efe20[_0x0dfa('0x8')](_0x0dfa('0x9'),attributes,{'tableName':_0x0dfa('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 eab39ad..f434bec 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 _0x9c50=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment'];(function(_0x12b207,_0x3d4861){var _0x217e94=function(_0x4873f1){while(--_0x4873f1){_0x12b207['push'](_0x12b207['shift']());}};_0x217e94(++_0x3d4861);}(_0x9c50,0x67));var _0x09c5=function(_0x4156eb,_0x17ec35){_0x4156eb=_0x4156eb-0x0;var _0x4e6c64=_0x9c50[_0x4156eb];return _0x4e6c64;};'use strict';var _=require('lodash');var util=require(_0x09c5('0x0'));var moment=require(_0x09c5('0x1'));var BPromise=require(_0x09c5('0x2'));var rs=require(_0x09c5('0x3'));var fs=require('fs');var Redis=require(_0x09c5('0x4'));var db=require(_0x09c5('0x5'))['db'];var utils=require(_0x09c5('0x6'));var logger=require(_0x09c5('0x7'))(_0x09c5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x09c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e211e,_0x4d1f00,_0x264bbb){return new BPromise(function(_0x18f886,_0x3286b7){return client[_0x09c5('0xa')](_0x1e211e,_0x264bbb)['then'](function(_0x4fdf97){logger[_0x09c5('0xb')](_0x09c5('0xc'),_0x4d1f00,_0x09c5('0xd'));logger[_0x09c5('0xe')](_0x09c5('0xf'),_0x4d1f00,_0x09c5('0xd'),JSON['stringify'](_0x4fdf97));if(_0x4fdf97[_0x09c5('0x10')]){if(_0x4fdf97[_0x09c5('0x10')][_0x09c5('0x11')]===0x1f4){logger[_0x09c5('0x10')](_0x09c5('0xc'),_0x4d1f00,_0x4fdf97[_0x09c5('0x10')][_0x09c5('0x12')]);return _0x3286b7(_0x4fdf97[_0x09c5('0x10')][_0x09c5('0x12')]);}logger[_0x09c5('0x10')](_0x09c5('0xc'),_0x4d1f00,_0x4fdf97['error'][_0x09c5('0x12')]);return _0x18f886(_0x4fdf97['error']['message']);}else{logger['info'](_0x09c5('0xc'),_0x4d1f00,_0x09c5('0xd'));_0x18f886(_0x4fdf97[_0x09c5('0x13')][_0x09c5('0x12')]);}})[_0x09c5('0x14')](function(_0x1fa006){logger['error'](_0x09c5('0xc'),_0x4d1f00,_0x1fa006);_0x3286b7(_0x1fa006);});});}
\ No newline at end of file
+var _0xff84=['rpc','../../config/environment','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x26d720,_0x25c8eb){var _0x37fcc1=function(_0x40b59e){while(--_0x40b59e){_0x26d720['push'](_0x26d720['shift']());}};_0x37fcc1(++_0x25c8eb);}(_0xff84,0x120));var _0x4ff8=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xff84[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x4ff8('0x0'));var moment=require(_0x4ff8('0x1'));var BPromise=require(_0x4ff8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ff8('0x3'));var db=require(_0x4ff8('0x4'))['db'];var utils=require(_0x4ff8('0x5'));var logger=require('../../config/logger')(_0x4ff8('0x6'));var config=require(_0x4ff8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4ff8('0x8')][_0x4ff8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cabe5,_0x2effc6,_0x811f5f){return new BPromise(function(_0x11a6db,_0x4bb5ef){return client['request'](_0x5cabe5,_0x811f5f)[_0x4ff8('0xa')](function(_0x3037c7){logger[_0x4ff8('0xb')](_0x4ff8('0xc'),_0x2effc6,_0x4ff8('0xd'));logger['debug'](_0x4ff8('0xe'),_0x2effc6,'request\x20sent',JSON[_0x4ff8('0xf')](_0x3037c7));if(_0x3037c7['error']){if(_0x3037c7[_0x4ff8('0x10')][_0x4ff8('0x11')]===0x1f4){logger[_0x4ff8('0x10')](_0x4ff8('0xc'),_0x2effc6,_0x3037c7['error']['message']);return _0x4bb5ef(_0x3037c7[_0x4ff8('0x10')][_0x4ff8('0x12')]);}logger[_0x4ff8('0x10')](_0x4ff8('0xc'),_0x2effc6,_0x3037c7[_0x4ff8('0x10')][_0x4ff8('0x12')]);return _0x11a6db(_0x3037c7[_0x4ff8('0x10')]['message']);}else{logger[_0x4ff8('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x2effc6,_0x4ff8('0xd'));_0x11a6db(_0x3037c7[_0x4ff8('0x13')]['message']);}})[_0x4ff8('0x14')](function(_0x2843b3){logger[_0x4ff8('0x10')](_0x4ff8('0xc'),_0x2effc6,_0x2843b3);_0x4bb5ef(_0x2843b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 4620235..7ff0441 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 _0x5395=['index','/:id','post','create','put','destroy','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated'];(function(_0x7457fe,_0x564a5e){var _0x57a6e4=function(_0x566577){while(--_0x566577){_0x7457fe['push'](_0x7457fe['shift']());}};_0x57a6e4(++_0x564a5e);}(_0x5395,0x150));var _0x5539=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5395[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x5539('0x0'));var util=require('util');var path=require(_0x5539('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5539('0x2')]();var fs_extra=require(_0x5539('0x3'));var auth=require(_0x5539('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5539('0x5'));var controller=require(_0x5539('0x6'));router[_0x5539('0x7')]('/',auth[_0x5539('0x8')](),controller[_0x5539('0x9')]);router[_0x5539('0x7')](_0x5539('0xa'),auth[_0x5539('0x8')](),controller['show']);router[_0x5539('0xb')]('/',auth[_0x5539('0x8')](),controller[_0x5539('0xc')]);router[_0x5539('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x5539('0xa'),auth['isAuthenticated'](),controller[_0x5539('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x37a7=['util','Router','fs-extra','./analyticMetric.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer'];(function(_0x2de753,_0x4a544d){var _0x8e70a5=function(_0x498455){while(--_0x498455){_0x2de753['push'](_0x2de753['shift']());}};_0x8e70a5(++_0x4a544d);}(_0x37a7,0x6f));var _0x737a=function(_0x4cf382,_0x1533d4){_0x4cf382=_0x4cf382-0x0;var _0x1fed91=_0x37a7[_0x4cf382];return _0x1fed91;};'use strict';var multer=require(_0x737a('0x0'));var util=require(_0x737a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x737a('0x2')]();var fs_extra=require(_0x737a('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x737a('0x4'));router[_0x737a('0x5')]('/',auth[_0x737a('0x6')](),controller[_0x737a('0x7')]);router[_0x737a('0x5')]('/:id',auth[_0x737a('0x6')](),controller[_0x737a('0x8')]);router[_0x737a('0x9')]('/',auth[_0x737a('0x6')](),controller['create']);router[_0x737a('0xa')](_0x737a('0xb'),auth['isAuthenticated'](),controller[_0x737a('0xc')]);router[_0x737a('0xd')](_0x737a('0xb'),auth[_0x737a('0x6')](),controller[_0x737a('0xe')]);module[_0x737a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 866825c..8a6dd55 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 _0xa690=['sequelize','TEXT'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa690,0xc4));var _0x0a69=function(_0x3c858f,_0x235201){_0x3c858f=_0x3c858f-0x0;var _0x198090=_0xa690[_0x3c858f];return _0x198090;};'use strict';var Sequelize=require(_0x0a69('0x0'));module['exports']={'tree':{'type':Sequelize[_0x0a69('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xdedc=['TEXT','sequelize'];(function(_0x2dcefe,_0x1b804a){var _0x47c352=function(_0x1a4fdf){while(--_0x1a4fdf){_0x2dcefe['push'](_0x2dcefe['shift']());}};_0x47c352(++_0x1b804a);}(_0xdedc,0x151));var _0xcded=function(_0x4b078b,_0x53030c){_0x4b078b=_0x4b078b-0x0;var _0x4bc65c=_0xdedc[_0x4b078b];return _0x4bc65c;};'use strict';var Sequelize=require(_0xcded('0x0'));module['exports']={'tree':{'type':Sequelize[_0xcded('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index cc54aad..14476c5 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 _0xa6dc=['params','length','options','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','show'];(function(_0x4f5eb1,_0x3ababf){var _0x14bcb1=function(_0x105091){while(--_0x105091){_0x4f5eb1['push'](_0x4f5eb1['shift']());}};_0x14bcb1(++_0x3ababf);}(_0xa6dc,0x11e));var _0xca6d=function(_0x371bd7,_0x27a8c7){_0x371bd7=_0x371bd7-0x0;var _0x54b744=_0xa6dc[_0x371bd7];return _0x54b744;};'use strict';var emlformat=require(_0xca6d('0x0'));var rimraf=require(_0xca6d('0x1'));var zipdir=require(_0xca6d('0x2'));var jsonpatch=require(_0xca6d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xca6d('0x4'));var path=require(_0xca6d('0x5'));var sox=require(_0xca6d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca6d('0x7'));var _=require(_0xca6d('0x8'));var squel=require('squel');var crypto=require(_0xca6d('0x9'));var jsforce=require(_0xca6d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xca6d('0xb'));var querystring=require(_0xca6d('0xc'));var Papa=require(_0xca6d('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xca6d('0xe'));var as=require(_0xca6d('0xf'));var hardwareService=require(_0xca6d('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xca6d('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xca6d('0x12'));var db=require(_0xca6d('0x13'))['db'];function respondWithStatusCode(_0x314b98,_0x2224ca){_0x2224ca=_0x2224ca||0xcc;return function(_0x41c433){if(_0x41c433){return _0x314b98[_0xca6d('0x14')](_0x2224ca);}return _0x314b98['status'](_0x2224ca)[_0xca6d('0x15')]();};}function respondWithResult(_0x3b2063,_0x2f9bf5){_0x2f9bf5=_0x2f9bf5||0xc8;return function(_0x298df0){if(_0x298df0){return _0x3b2063[_0xca6d('0x16')](_0x2f9bf5)[_0xca6d('0x17')](_0x298df0);}};}function respondWithFilteredResult(_0x533f72,_0x5464ab){return function(_0x3baab7){if(_0x3baab7){var _0x16f54a=typeof _0x5464ab[_0xca6d('0x18')]==='undefined'&&typeof _0x5464ab[_0xca6d('0x19')]===_0xca6d('0x1a');var _0x172de0=_0x3baab7['count'];var _0x540422=_0x16f54a?0x0:_0x5464ab[_0xca6d('0x18')];var _0x35b91f=_0x16f54a?_0x3baab7[_0xca6d('0x1b')]:_0x5464ab[_0xca6d('0x18')]+_0x5464ab[_0xca6d('0x19')];var _0x1e9aeb;if(_0x35b91f>=_0x172de0){_0x35b91f=_0x172de0;_0x1e9aeb=0xc8;}else{_0x1e9aeb=0xce;}_0x533f72[_0xca6d('0x16')](_0x1e9aeb);return _0x533f72['set'](_0xca6d('0x1c'),_0x540422+'-'+_0x35b91f+'/'+_0x172de0)[_0xca6d('0x17')](_0x3baab7);}return null;};}function patchUpdates(_0x1b0f7e){return function(_0x32cf01){try{jsonpatch[_0xca6d('0x1d')](_0x32cf01,_0x1b0f7e,!![]);}catch(_0x1f7c08){return BPromise[_0xca6d('0x1e')](_0x1f7c08);}return _0x32cf01[_0xca6d('0x1f')]();};}function saveUpdates(_0x485280,_0x1ecabc){return function(_0x5bdf90){if(_0x5bdf90){return _0x5bdf90[_0xca6d('0x20')](_0x485280)[_0xca6d('0x21')](function(_0x2e0577){return _0x2e0577;});}return null;};}function removeEntity(_0x15c980,_0xb199de){return function(_0x163f31){if(_0x163f31){return _0x163f31['destroy']()[_0xca6d('0x21')](function(){_0x15c980[_0xca6d('0x16')](0xcc)[_0xca6d('0x15')]();});}};}function handleEntityNotFound(_0x499aa7,_0x5acb38){return function(_0x4d1be7){if(!_0x4d1be7){_0x499aa7[_0xca6d('0x14')](0x194);}return _0x4d1be7;};}function handleError(_0x1b6f66,_0x3b91b0){_0x3b91b0=_0x3b91b0||0x1f4;return function(_0x4cda46){logger[_0xca6d('0x22')](_0x4cda46[_0xca6d('0x23')]);if(_0x4cda46[_0xca6d('0x24')]){delete _0x4cda46['name'];}_0x1b6f66[_0xca6d('0x16')](_0x3b91b0)[_0xca6d('0x25')](_0x4cda46);};}exports[_0xca6d('0x26')]=function(_0x506689,_0x225c9d){var _0x24265c={},_0x1a3f09={},_0x3ef101={'count':0x0,'rows':[]};var _0x5d0391=_[_0xca6d('0x27')](db[_0xca6d('0x28')][_0xca6d('0x29')],function(_0x3fef4f){return{'name':_0x3fef4f[_0xca6d('0x2a')],'type':_0x3fef4f['type'][_0xca6d('0x2b')]};});_0x1a3f09[_0xca6d('0x2c')]=_[_0xca6d('0x27')](_0x5d0391,'name');_0x1a3f09[_0xca6d('0x2d')]=_[_0xca6d('0x2e')](_0x506689['query']);_0x1a3f09[_0xca6d('0x2f')]=_[_0xca6d('0x30')](_0x1a3f09[_0xca6d('0x2c')],_0x1a3f09['query']);_0x24265c[_0xca6d('0x31')]=_[_0xca6d('0x30')](_0x1a3f09[_0xca6d('0x2c')],qs[_0xca6d('0x32')](_0x506689[_0xca6d('0x2d')][_0xca6d('0x32')]));_0x24265c[_0xca6d('0x31')]=_0x24265c[_0xca6d('0x31')]['length']?_0x24265c['attributes']:_0x1a3f09[_0xca6d('0x2c')];if(!_0x506689['query'][_0xca6d('0x33')]('nolimit')){_0x24265c['limit']=qs[_0xca6d('0x19')](_0x506689['query'][_0xca6d('0x19')]);_0x24265c[_0xca6d('0x18')]=qs['offset'](_0x506689[_0xca6d('0x2d')][_0xca6d('0x18')]);}_0x24265c[_0xca6d('0x34')]=qs['sort'](_0x506689[_0xca6d('0x2d')][_0xca6d('0x35')]);_0x24265c[_0xca6d('0x36')]=qs[_0xca6d('0x2f')](_[_0xca6d('0x37')](_0x506689[_0xca6d('0x2d')],_0x1a3f09[_0xca6d('0x2f')]),_0x5d0391);if(_0x506689['query']['filter']){_0x24265c['where']=_[_0xca6d('0x38')](_0x24265c[_0xca6d('0x36')],{'$or':_[_0xca6d('0x27')](_0x5d0391,function(_0x4b447b){if(_0x4b447b[_0xca6d('0x39')]!==_0xca6d('0x3a')){var _0x54208b={};_0x54208b[_0x4b447b[_0xca6d('0x24')]]={'$like':'%'+_0x506689[_0xca6d('0x2d')][_0xca6d('0x3b')]+'%'};return _0x54208b;}})});}_0x24265c=_[_0xca6d('0x38')]({},_0x24265c,_0x506689['options']);var _0x22e335={'where':_0x24265c[_0xca6d('0x36')]};return db[_0xca6d('0x28')]['count'](_0x22e335)['then'](function(_0x12ab55){_0x3ef101['count']=_0x12ab55;if(_0x506689[_0xca6d('0x2d')][_0xca6d('0x3c')]){_0x24265c[_0xca6d('0x3d')]=[{'all':!![]}];}return db[_0xca6d('0x28')][_0xca6d('0x3e')](_0x24265c);})['then'](function(_0x50028a){_0x3ef101['rows']=_0x50028a;return _0x3ef101;})[_0xca6d('0x21')](respondWithFilteredResult(_0x225c9d,_0x24265c))['catch'](handleError(_0x225c9d,null));};exports[_0xca6d('0x3f')]=function(_0x1c888c,_0x23eb75){var _0x5eddf3={'raw':!![],'where':{'id':_0x1c888c[_0xca6d('0x40')]['id']}},_0x192f24={};_0x192f24['model']=_[_0xca6d('0x2e')](db[_0xca6d('0x28')][_0xca6d('0x29')]);_0x192f24[_0xca6d('0x2d')]=_[_0xca6d('0x2e')](_0x1c888c[_0xca6d('0x2d')]);_0x192f24[_0xca6d('0x2f')]=_[_0xca6d('0x30')](_0x192f24[_0xca6d('0x2c')],_0x192f24['query']);_0x5eddf3[_0xca6d('0x31')]=_['intersection'](_0x192f24[_0xca6d('0x2c')],qs[_0xca6d('0x32')](_0x1c888c['query'][_0xca6d('0x32')]));_0x5eddf3[_0xca6d('0x31')]=_0x5eddf3['attributes'][_0xca6d('0x41')]?_0x5eddf3[_0xca6d('0x31')]:_0x192f24[_0xca6d('0x2c')];if(_0x1c888c[_0xca6d('0x2d')][_0xca6d('0x3c')]){_0x5eddf3['include']=[{'all':!![]}];}_0x5eddf3=_['merge']({},_0x5eddf3,_0x1c888c[_0xca6d('0x42')]);return db[_0xca6d('0x28')][_0xca6d('0x43')](_0x5eddf3)['then'](handleEntityNotFound(_0x23eb75,null))[_0xca6d('0x21')](respondWithResult(_0x23eb75,null))['catch'](handleError(_0x23eb75,null));};exports['create']=function(_0x4eba59,_0x41e0d9){return db[_0xca6d('0x28')]['create'](_0x4eba59[_0xca6d('0x44')],{})['then'](respondWithResult(_0x41e0d9,0xc9))['catch'](handleError(_0x41e0d9,null));};exports[_0xca6d('0x20')]=function(_0x2df1eb,_0x34cf4b){if(_0x2df1eb[_0xca6d('0x44')]['id']){delete _0x2df1eb[_0xca6d('0x44')]['id'];}return db[_0xca6d('0x28')]['find']({'where':{'id':_0x2df1eb[_0xca6d('0x40')]['id']}})['then'](handleEntityNotFound(_0x34cf4b,null))[_0xca6d('0x21')](saveUpdates(_0x2df1eb[_0xca6d('0x44')],null))[_0xca6d('0x21')](respondWithResult(_0x34cf4b,null))[_0xca6d('0x45')](handleError(_0x34cf4b,null));};exports['destroy']=function(_0x4656a5,_0xc4658){return db['AnalyticTreeReport'][_0xca6d('0x43')]({'where':{'id':_0x4656a5[_0xca6d('0x40')]['id']}})[_0xca6d('0x21')](handleEntityNotFound(_0xc4658,null))[_0xca6d('0x21')](removeEntity(_0xc4658,null))[_0xca6d('0x45')](handleError(_0xc4658,null));};
\ No newline at end of file
+var _0x610c=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','json','apply','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','attributes','intersection','fields','length','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','include','AnalyticTreeReport','findAll','rows','show','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x610c,0x1b4));var _0xc610=function(_0x31281a,_0x10040e){_0x31281a=_0x31281a-0x0;var _0x23aa3f=_0x610c[_0x31281a];return _0x23aa3f;};'use strict';var emlformat=require(_0xc610('0x0'));var rimraf=require(_0xc610('0x1'));var zipdir=require(_0xc610('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc610('0x3'));var moment=require(_0xc610('0x4'));var BPromise=require(_0xc610('0x5'));var Mustache=require(_0xc610('0x6'));var util=require(_0xc610('0x7'));var path=require(_0xc610('0x8'));var sox=require(_0xc610('0x9'));var csv=require('to-csv');var ejs=require(_0xc610('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc610('0xb'));var squel=require(_0xc610('0xc'));var crypto=require(_0xc610('0xd'));var jsforce=require(_0xc610('0xe'));var deskjs=require(_0xc610('0xf'));var toCsv=require(_0xc610('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc610('0x11'));var authService=require(_0xc610('0x12'));var qs=require(_0xc610('0x13'));var as=require(_0xc610('0x14'));var hardwareService=require(_0xc610('0x15'));var logger=require('../../config/logger')(_0xc610('0x16'));var utils=require(_0xc610('0x17'));var config=require(_0xc610('0x18'));var licenseUtil=require(_0xc610('0x19'));var db=require(_0xc610('0x1a'))['db'];function respondWithStatusCode(_0x88bac0,_0x26f697){_0x26f697=_0x26f697||0xcc;return function(_0x449b69){if(_0x449b69){return _0x88bac0[_0xc610('0x1b')](_0x26f697);}return _0x88bac0[_0xc610('0x1c')](_0x26f697)[_0xc610('0x1d')]();};}function respondWithResult(_0x2b4070,_0x28ef86){_0x28ef86=_0x28ef86||0xc8;return function(_0x494c1c){if(_0x494c1c){return _0x2b4070[_0xc610('0x1c')](_0x28ef86)['json'](_0x494c1c);}};}function respondWithFilteredResult(_0xa1eefc,_0x178373){return function(_0x3d9d17){if(_0x3d9d17){var _0x1432ef=typeof _0x178373['offset']===_0xc610('0x1e')&&typeof _0x178373[_0xc610('0x1f')]===_0xc610('0x1e');var _0x3441de=_0x3d9d17[_0xc610('0x20')];var _0x2caa07=_0x1432ef?0x0:_0x178373[_0xc610('0x21')];var _0x139e16=_0x1432ef?_0x3d9d17[_0xc610('0x20')]:_0x178373[_0xc610('0x21')]+_0x178373['limit'];var _0x114dab;if(_0x139e16>=_0x3441de){_0x139e16=_0x3441de;_0x114dab=0xc8;}else{_0x114dab=0xce;}_0xa1eefc[_0xc610('0x1c')](_0x114dab);return _0xa1eefc['set']('Content-Range',_0x2caa07+'-'+_0x139e16+'/'+_0x3441de)[_0xc610('0x22')](_0x3d9d17);}return null;};}function patchUpdates(_0x171e79){return function(_0x376d8f){try{jsonpatch[_0xc610('0x23')](_0x376d8f,_0x171e79,!![]);}catch(_0x2b2f4e){return BPromise[_0xc610('0x24')](_0x2b2f4e);}return _0x376d8f[_0xc610('0x25')]();};}function saveUpdates(_0x5986b8,_0x55a19f){return function(_0x436826){if(_0x436826){return _0x436826[_0xc610('0x26')](_0x5986b8)[_0xc610('0x27')](function(_0x59f3fb){return _0x59f3fb;});}return null;};}function removeEntity(_0x1a9aa4,_0x4e2180){return function(_0x4d2471){if(_0x4d2471){return _0x4d2471[_0xc610('0x28')]()[_0xc610('0x27')](function(){_0x1a9aa4[_0xc610('0x1c')](0xcc)[_0xc610('0x1d')]();});}};}function handleEntityNotFound(_0x4ef396,_0x55a7fd){return function(_0x3e202e){if(!_0x3e202e){_0x4ef396[_0xc610('0x1b')](0x194);}return _0x3e202e;};}function handleError(_0x3ad415,_0x472403){_0x472403=_0x472403||0x1f4;return function(_0x1dd4a9){logger['error'](_0x1dd4a9[_0xc610('0x29')]);if(_0x1dd4a9[_0xc610('0x2a')]){delete _0x1dd4a9[_0xc610('0x2a')];}_0x3ad415[_0xc610('0x1c')](_0x472403)[_0xc610('0x2b')](_0x1dd4a9);};}exports[_0xc610('0x2c')]=function(_0x285839,_0x225ffd){var _0x3353de={},_0x311cdb={},_0x1d70e3={'count':0x0,'rows':[]};var _0x3dde9f=_['map'](db['AnalyticTreeReport'][_0xc610('0x2d')],function(_0x23ad48){return{'name':_0x23ad48[_0xc610('0x2e')],'type':_0x23ad48['type'][_0xc610('0x2f')]};});_0x311cdb[_0xc610('0x30')]=_[_0xc610('0x31')](_0x3dde9f,_0xc610('0x2a'));_0x311cdb[_0xc610('0x32')]=_[_0xc610('0x33')](_0x285839[_0xc610('0x32')]);_0x311cdb['filters']=_['intersection'](_0x311cdb['model'],_0x311cdb[_0xc610('0x32')]);_0x3353de[_0xc610('0x34')]=_[_0xc610('0x35')](_0x311cdb[_0xc610('0x30')],qs[_0xc610('0x36')](_0x285839[_0xc610('0x32')][_0xc610('0x36')]));_0x3353de[_0xc610('0x34')]=_0x3353de[_0xc610('0x34')][_0xc610('0x37')]?_0x3353de[_0xc610('0x34')]:_0x311cdb[_0xc610('0x30')];if(!_0x285839['query']['hasOwnProperty'](_0xc610('0x38'))){_0x3353de[_0xc610('0x1f')]=qs[_0xc610('0x1f')](_0x285839['query'][_0xc610('0x1f')]);_0x3353de['offset']=qs[_0xc610('0x21')](_0x285839[_0xc610('0x32')]['offset']);}_0x3353de['order']=qs[_0xc610('0x39')](_0x285839[_0xc610('0x32')][_0xc610('0x39')]);_0x3353de[_0xc610('0x3a')]=qs[_0xc610('0x3b')](_['pick'](_0x285839['query'],_0x311cdb[_0xc610('0x3b')]),_0x3dde9f);if(_0x285839[_0xc610('0x32')][_0xc610('0x3c')]){_0x3353de[_0xc610('0x3a')]=_[_0xc610('0x3d')](_0x3353de['where'],{'$or':_[_0xc610('0x31')](_0x3dde9f,function(_0x35fa6c){if(_0x35fa6c[_0xc610('0x3e')]!==_0xc610('0x3f')){var _0x34e365={};_0x34e365[_0x35fa6c[_0xc610('0x2a')]]={'$like':'%'+_0x285839[_0xc610('0x32')]['filter']+'%'};return _0x34e365;}})});}_0x3353de=_[_0xc610('0x3d')]({},_0x3353de,_0x285839['options']);var _0x56e4ac={'where':_0x3353de[_0xc610('0x3a')]};return db['AnalyticTreeReport'][_0xc610('0x20')](_0x56e4ac)[_0xc610('0x27')](function(_0x1e1fd7){_0x1d70e3[_0xc610('0x20')]=_0x1e1fd7;if(_0x285839[_0xc610('0x32')][_0xc610('0x40')]){_0x3353de[_0xc610('0x41')]=[{'all':!![]}];}return db[_0xc610('0x42')][_0xc610('0x43')](_0x3353de);})['then'](function(_0x30f7f4){_0x1d70e3[_0xc610('0x44')]=_0x30f7f4;return _0x1d70e3;})['then'](respondWithFilteredResult(_0x225ffd,_0x3353de))['catch'](handleError(_0x225ffd,null));};exports[_0xc610('0x45')]=function(_0x4c1717,_0x5e476e){var _0x2aad46={'raw':!![],'where':{'id':_0x4c1717[_0xc610('0x46')]['id']}},_0x4bbe4f={};_0x4bbe4f[_0xc610('0x30')]=_[_0xc610('0x33')](db['AnalyticTreeReport']['rawAttributes']);_0x4bbe4f[_0xc610('0x32')]=_[_0xc610('0x33')](_0x4c1717[_0xc610('0x32')]);_0x4bbe4f[_0xc610('0x3b')]=_[_0xc610('0x35')](_0x4bbe4f['model'],_0x4bbe4f['query']);_0x2aad46[_0xc610('0x34')]=_[_0xc610('0x35')](_0x4bbe4f[_0xc610('0x30')],qs[_0xc610('0x36')](_0x4c1717[_0xc610('0x32')][_0xc610('0x36')]));_0x2aad46[_0xc610('0x34')]=_0x2aad46[_0xc610('0x34')][_0xc610('0x37')]?_0x2aad46[_0xc610('0x34')]:_0x4bbe4f[_0xc610('0x30')];if(_0x4c1717['query'][_0xc610('0x40')]){_0x2aad46[_0xc610('0x41')]=[{'all':!![]}];}_0x2aad46=_[_0xc610('0x3d')]({},_0x2aad46,_0x4c1717[_0xc610('0x47')]);return db[_0xc610('0x42')][_0xc610('0x48')](_0x2aad46)[_0xc610('0x27')](handleEntityNotFound(_0x5e476e,null))['then'](respondWithResult(_0x5e476e,null))[_0xc610('0x49')](handleError(_0x5e476e,null));};exports[_0xc610('0x4a')]=function(_0x4c1135,_0x455f70){return db[_0xc610('0x42')][_0xc610('0x4a')](_0x4c1135[_0xc610('0x4b')],{})[_0xc610('0x27')](respondWithResult(_0x455f70,0xc9))[_0xc610('0x49')](handleError(_0x455f70,null));};exports[_0xc610('0x26')]=function(_0x47b94a,_0x42b85a){if(_0x47b94a[_0xc610('0x4b')]['id']){delete _0x47b94a[_0xc610('0x4b')]['id'];}return db[_0xc610('0x42')]['find']({'where':{'id':_0x47b94a[_0xc610('0x46')]['id']}})['then'](handleEntityNotFound(_0x42b85a,null))[_0xc610('0x27')](saveUpdates(_0x47b94a[_0xc610('0x4b')],null))['then'](respondWithResult(_0x42b85a,null))[_0xc610('0x49')](handleError(_0x42b85a,null));};exports[_0xc610('0x28')]=function(_0x10c1bb,_0x48ff77){return db[_0xc610('0x42')][_0xc610('0x48')]({'where':{'id':_0x10c1bb[_0xc610('0x46')]['id']}})[_0xc610('0x27')](handleEntityNotFound(_0x48ff77,null))[_0xc610('0x27')](removeEntity(_0x48ff77,null))[_0xc610('0x49')](handleError(_0x48ff77,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 59601ba..e187928 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 _0xb586=['define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x42cca6,_0x5b96e0){var _0x1c4d12=function(_0xf0f7ba){while(--_0xf0f7ba){_0x42cca6['push'](_0x42cca6['shift']());}};_0x1c4d12(++_0x5b96e0);}(_0xb586,0x8a));var _0x6b58=function(_0x5bf420,_0x2d068d){_0x5bf420=_0x5bf420-0x0;var _0x1c5255=_0xb586[_0x5bf420];return _0x1c5255;};'use strict';var _=require(_0x6b58('0x0'));var util=require(_0x6b58('0x1'));var logger=require(_0x6b58('0x2'))(_0x6b58('0x3'));var moment=require(_0x6b58('0x4'));var BPromise=require(_0x6b58('0x5'));var rp=require(_0x6b58('0x6'));var fs=require('fs');var path=require(_0x6b58('0x7'));var rimraf=require(_0x6b58('0x8'));var config=require(_0x6b58('0x9'));var attributes=require(_0x6b58('0xa'));module[_0x6b58('0xb')]=function(_0x5adeec,_0x2f2a0b){return _0x5adeec[_0x6b58('0xc')](_0x6b58('0xd'),attributes,{'tableName':_0x6b58('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b9=['AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define'];(function(_0xd250ec,_0x446153){var _0x108b01=function(_0x3ce68f){while(--_0x3ce68f){_0xd250ec['push'](_0xd250ec['shift']());}};_0x108b01(++_0x446153);}(_0xd8b9,0x6a));var _0x9d8b=function(_0x25b4b7,_0x315052){_0x25b4b7=_0x25b4b7-0x0;var _0x5edf88=_0xd8b9[_0x25b4b7];return _0x5edf88;};'use strict';var _=require(_0x9d8b('0x0'));var util=require('util');var logger=require(_0x9d8b('0x1'))(_0x9d8b('0x2'));var moment=require(_0x9d8b('0x3'));var BPromise=require(_0x9d8b('0x4'));var rp=require(_0x9d8b('0x5'));var fs=require('fs');var path=require(_0x9d8b('0x6'));var rimraf=require(_0x9d8b('0x7'));var config=require(_0x9d8b('0x8'));var attributes=require(_0x9d8b('0x9'));module['exports']=function(_0x21b3fd,_0x4813ab){return _0x21b3fd[_0x9d8b('0xa')](_0x9d8b('0xb'),attributes,{'tableName':_0x9d8b('0xc'),'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 ec9d8b5..edab94f 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x22b47c,_0x5568b5){var _0x29d752=function(_0x443a64){while(--_0x443a64){_0x22b47c['push'](_0x22b47c['shift']());}};_0x29d752(++_0x5568b5);}(_0xdb28,0x106));var _0x8db2=function(_0x4be889,_0x191f81){_0x4be889=_0x4be889-0x0;var _0x3d7067=_0xdb28[_0x4be889];return _0x3d7067;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x5516a1,_0x215ca4){var _0x4a957b=function(_0x39b0e6){while(--_0x39b0e6){_0x5516a1['push'](_0x5516a1['shift']());}};_0x4a957b(++_0x215ca4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xc4aa[_0x1694f5];return _0x5b4321;};'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')]('AnalyticTreeReport,\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/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 09ee15a..7a0ffdf 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 _0xba99=['update','delete','/:id','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x57a51c,_0x55bcea){var _0x573a22=function(_0x17e475){while(--_0x17e475){_0x57a51c['push'](_0x57a51c['shift']());}};_0x573a22(++_0x55bcea);}(_0xba99,0x1cf));var _0x9ba9=function(_0x23a477,_0x36bd86){_0x23a477=_0x23a477-0x0;var _0x1a6fb2=_0xba99[_0x23a477];return _0x1a6fb2;};'use strict';var multer=require(_0x9ba9('0x0'));var util=require('util');var path=require(_0x9ba9('0x1'));var timeout=require(_0x9ba9('0x2'));var express=require(_0x9ba9('0x3'));var router=express[_0x9ba9('0x4')]();var fs_extra=require(_0x9ba9('0x5'));var auth=require(_0x9ba9('0x6'));var interaction=require(_0x9ba9('0x7'));var config=require(_0x9ba9('0x8'));var controller=require(_0x9ba9('0x9'));router[_0x9ba9('0xa')]('/',auth[_0x9ba9('0xb')](),controller[_0x9ba9('0xc')]);router[_0x9ba9('0xa')]('/:id',auth[_0x9ba9('0xb')](),controller[_0x9ba9('0xd')]);router[_0x9ba9('0xe')]('/',auth[_0x9ba9('0xb')](),controller[_0x9ba9('0xf')]);router[_0x9ba9('0x10')]('/:id',auth[_0x9ba9('0xb')](),controller[_0x9ba9('0x11')]);router[_0x9ba9('0x12')](_0x9ba9('0x13'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xc03d=['/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get'];(function(_0x3fdf10,_0x420bb1){var _0x3acf07=function(_0x7dd2ea){while(--_0x7dd2ea){_0x3fdf10['push'](_0x3fdf10['shift']());}};_0x3acf07(++_0x420bb1);}(_0xc03d,0xef));var _0xdc03=function(_0x3d76e8,_0x1f965d){_0x3d76e8=_0x3d76e8-0x0;var _0x198af2=_0xc03d[_0x3d76e8];return _0x198af2;};'use strict';var multer=require(_0xdc03('0x0'));var util=require(_0xdc03('0x1'));var path=require(_0xdc03('0x2'));var timeout=require(_0xdc03('0x3'));var express=require(_0xdc03('0x4'));var router=express[_0xdc03('0x5')]();var fs_extra=require(_0xdc03('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdc03('0x7'));var config=require(_0xdc03('0x8'));var controller=require(_0xdc03('0x9'));router['get']('/',auth[_0xdc03('0xa')](),controller[_0xdc03('0xb')]);router[_0xdc03('0xc')](_0xdc03('0xd'),auth[_0xdc03('0xa')](),controller[_0xdc03('0xe')]);router[_0xdc03('0xf')]('/',auth[_0xdc03('0xa')](),controller[_0xdc03('0x10')]);router[_0xdc03('0x11')](_0xdc03('0xd'),auth[_0xdc03('0xa')](),controller[_0xdc03('0x12')]);router[_0xdc03('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xdc03('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index b696283..5920897 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 _0x86dd=['exports','STRING'];(function(_0x168900,_0x3a06f2){var _0x3f3845=function(_0x33164b){while(--_0x33164b){_0x168900['push'](_0x168900['shift']());}};_0x3f3845(++_0x3a06f2);}(_0x86dd,0x1ee));var _0xd86d=function(_0x11a0b1,_0x12a2f9){_0x11a0b1=_0x11a0b1-0x0;var _0x5ac291=_0x86dd[_0x11a0b1];return _0x5ac291;};'use strict';var Sequelize=require('sequelize');module[_0xd86d('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xd86d('0x1')]},'type':{'type':Sequelize[_0xd86d('0x1')]}};
\ No newline at end of file
+var _0x2d17=['STRING','sequelize','exports'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x2d17,0x17e));var _0x72d1=function(_0x5bcae4,_0x5f56d0){_0x5bcae4=_0x5bcae4-0x0;var _0x18289d=_0x2d17[_0x5bcae4];return _0x18289d;};'use strict';var Sequelize=require(_0x72d1('0x0'));module[_0x72d1('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x72d1('0x2')]},'type':{'type':Sequelize[_0x72d1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index a0ae660..87a5140 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 _0x2f54=['end','json','offset','undefined','limit','count','set','apply','save','then','destroy','stack','send','index','rawAttributes','fieldName','type','key','model','map','name','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','Attachment','findAll','catch','show','params','keys','length','includeAll','include','merge','options','find','clone','get','omit','updatedAt','body','createdAt','create','update','file','originalname','basename','filename','mimetype','findOne','root','server/files/attachments/','join','download','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x2f54,0x197));var _0x42f5=function(_0x5ee748,_0x552a2b){_0x5ee748=_0x5ee748-0x0;var _0x36da37=_0x2f54[_0x5ee748];return _0x36da37;};'use strict';var emlformat=require(_0x42f5('0x0'));var rimraf=require(_0x42f5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x42f5('0x2'));var moment=require('moment');var BPromise=require(_0x42f5('0x3'));var Mustache=require(_0x42f5('0x4'));var util=require(_0x42f5('0x5'));var path=require(_0x42f5('0x6'));var sox=require(_0x42f5('0x7'));var csv=require(_0x42f5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x42f5('0x9'));var squel=require(_0x42f5('0xa'));var crypto=require(_0x42f5('0xb'));var jsforce=require(_0x42f5('0xc'));var deskjs=require(_0x42f5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x42f5('0xe'));var Papa=require(_0x42f5('0xf'));var Redis=require(_0x42f5('0x10'));var authService=require(_0x42f5('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x42f5('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x42f5('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x42f5('0x14'))['db'];function respondWithStatusCode(_0x1ffb2c,_0x18158b){_0x18158b=_0x18158b||0xcc;return function(_0x2fda62){if(_0x2fda62){return _0x1ffb2c[_0x42f5('0x15')](_0x18158b);}return _0x1ffb2c[_0x42f5('0x16')](_0x18158b)[_0x42f5('0x17')]();};}function respondWithResult(_0x4f9d0e,_0x5b0fac){_0x5b0fac=_0x5b0fac||0xc8;return function(_0x2a3976){if(_0x2a3976){return _0x4f9d0e[_0x42f5('0x16')](_0x5b0fac)[_0x42f5('0x18')](_0x2a3976);}};}function respondWithFilteredResult(_0x12e4c5,_0x53f794){return function(_0x20a442){if(_0x20a442){var _0x3b7d36=typeof _0x53f794[_0x42f5('0x19')]===_0x42f5('0x1a')&&typeof _0x53f794[_0x42f5('0x1b')]===_0x42f5('0x1a');var _0x38a237=_0x20a442[_0x42f5('0x1c')];var _0x30d2c7=_0x3b7d36?0x0:_0x53f794[_0x42f5('0x19')];var _0xef75f8=_0x3b7d36?_0x20a442[_0x42f5('0x1c')]:_0x53f794[_0x42f5('0x19')]+_0x53f794[_0x42f5('0x1b')];var _0x1b8c12;if(_0xef75f8>=_0x38a237){_0xef75f8=_0x38a237;_0x1b8c12=0xc8;}else{_0x1b8c12=0xce;}_0x12e4c5[_0x42f5('0x16')](_0x1b8c12);return _0x12e4c5[_0x42f5('0x1d')]('Content-Range',_0x30d2c7+'-'+_0xef75f8+'/'+_0x38a237)['json'](_0x20a442);}return null;};}function patchUpdates(_0x245701){return function(_0xede24e){try{jsonpatch[_0x42f5('0x1e')](_0xede24e,_0x245701,!![]);}catch(_0x445130){return BPromise['reject'](_0x445130);}return _0xede24e[_0x42f5('0x1f')]();};}function saveUpdates(_0x433c00,_0x497363){return function(_0x42f6e4){if(_0x42f6e4){return _0x42f6e4['update'](_0x433c00)[_0x42f5('0x20')](function(_0x1f3ece){return _0x1f3ece;});}return null;};}function removeEntity(_0x4e275d,_0x38ff24){return function(_0x5ac26b){if(_0x5ac26b){return _0x5ac26b[_0x42f5('0x21')]()[_0x42f5('0x20')](function(){_0x4e275d[_0x42f5('0x16')](0xcc)[_0x42f5('0x17')]();});}};}function handleEntityNotFound(_0x50d577,_0x1b9387){return function(_0xf5d7e0){if(!_0xf5d7e0){_0x50d577[_0x42f5('0x15')](0x194);}return _0xf5d7e0;};}function handleError(_0x1cd2f0,_0x32ef05){_0x32ef05=_0x32ef05||0x1f4;return function(_0x4e43b0){logger['error'](_0x4e43b0[_0x42f5('0x22')]);if(_0x4e43b0['name']){delete _0x4e43b0['name'];}_0x1cd2f0[_0x42f5('0x16')](_0x32ef05)[_0x42f5('0x23')](_0x4e43b0);};}exports[_0x42f5('0x24')]=function(_0x45b504,_0x2c4d50){var _0x220d51={},_0x2920b1={},_0x5a7c2a={'count':0x0,'rows':[]};var _0x35c57c=_['map'](db['Attachment'][_0x42f5('0x25')],function(_0xc7d89){return{'name':_0xc7d89[_0x42f5('0x26')],'type':_0xc7d89[_0x42f5('0x27')][_0x42f5('0x28')]};});_0x2920b1[_0x42f5('0x29')]=_[_0x42f5('0x2a')](_0x35c57c,_0x42f5('0x2b'));_0x2920b1['query']=_['keys'](_0x45b504[_0x42f5('0x2c')]);_0x2920b1['filters']=_['intersection'](_0x2920b1['model'],_0x2920b1[_0x42f5('0x2c')]);_0x220d51[_0x42f5('0x2d')]=_[_0x42f5('0x2e')](_0x2920b1['model'],qs[_0x42f5('0x2f')](_0x45b504[_0x42f5('0x2c')][_0x42f5('0x2f')]));_0x220d51[_0x42f5('0x2d')]=_0x220d51['attributes']['length']?_0x220d51[_0x42f5('0x2d')]:_0x2920b1['model'];if(!_0x45b504[_0x42f5('0x2c')][_0x42f5('0x30')](_0x42f5('0x31'))){_0x220d51[_0x42f5('0x1b')]=qs[_0x42f5('0x1b')](_0x45b504['query']['limit']);_0x220d51['offset']=qs['offset'](_0x45b504['query']['offset']);}_0x220d51[_0x42f5('0x32')]=qs[_0x42f5('0x33')](_0x45b504[_0x42f5('0x2c')][_0x42f5('0x33')]);_0x220d51[_0x42f5('0x34')]=qs[_0x42f5('0x35')](_['pick'](_0x45b504[_0x42f5('0x2c')],_0x2920b1[_0x42f5('0x35')]),_0x35c57c);if(_0x45b504[_0x42f5('0x2c')][_0x42f5('0x36')]){_0x220d51[_0x42f5('0x34')]=_['merge'](_0x220d51['where'],{'$or':_[_0x42f5('0x2a')](_0x35c57c,function(_0xbcd444){if(_0xbcd444['type']!==_0x42f5('0x37')){var _0x3335a1={};_0x3335a1[_0xbcd444[_0x42f5('0x2b')]]={'$like':'%'+_0x45b504[_0x42f5('0x2c')][_0x42f5('0x36')]+'%'};return _0x3335a1;}})});}_0x220d51=_['merge']({},_0x220d51,_0x45b504['options']);var _0x22fff2={'where':_0x220d51[_0x42f5('0x34')]};return db[_0x42f5('0x38')][_0x42f5('0x1c')](_0x22fff2)[_0x42f5('0x20')](function(_0x42218e){_0x5a7c2a[_0x42f5('0x1c')]=_0x42218e;if(_0x45b504[_0x42f5('0x2c')]['includeAll']){_0x220d51['include']=[{'all':!![]}];}return db['Attachment'][_0x42f5('0x39')](_0x220d51);})[_0x42f5('0x20')](function(_0x2c9bb3){_0x5a7c2a['rows']=_0x2c9bb3;return _0x5a7c2a;})[_0x42f5('0x20')](respondWithFilteredResult(_0x2c4d50,_0x220d51))[_0x42f5('0x3a')](handleError(_0x2c4d50,null));};exports[_0x42f5('0x3b')]=function(_0x4d9ddb,_0x4a9c2d){var _0x4e7381={'raw':!![],'where':{'id':_0x4d9ddb[_0x42f5('0x3c')]['id']}},_0xba5293={};_0xba5293[_0x42f5('0x29')]=_['keys'](db[_0x42f5('0x38')][_0x42f5('0x25')]);_0xba5293[_0x42f5('0x2c')]=_[_0x42f5('0x3d')](_0x4d9ddb[_0x42f5('0x2c')]);_0xba5293[_0x42f5('0x35')]=_['intersection'](_0xba5293[_0x42f5('0x29')],_0xba5293[_0x42f5('0x2c')]);_0x4e7381[_0x42f5('0x2d')]=_[_0x42f5('0x2e')](_0xba5293[_0x42f5('0x29')],qs[_0x42f5('0x2f')](_0x4d9ddb[_0x42f5('0x2c')][_0x42f5('0x2f')]));_0x4e7381['attributes']=_0x4e7381[_0x42f5('0x2d')][_0x42f5('0x3e')]?_0x4e7381[_0x42f5('0x2d')]:_0xba5293[_0x42f5('0x29')];if(_0x4d9ddb[_0x42f5('0x2c')][_0x42f5('0x3f')]){_0x4e7381[_0x42f5('0x40')]=[{'all':!![]}];}_0x4e7381=_[_0x42f5('0x41')]({},_0x4e7381,_0x4d9ddb[_0x42f5('0x42')]);return db[_0x42f5('0x38')][_0x42f5('0x43')](_0x4e7381)['then'](handleEntityNotFound(_0x4a9c2d,null))[_0x42f5('0x20')](respondWithResult(_0x4a9c2d,null))[_0x42f5('0x3a')](handleError(_0x4a9c2d,null));};exports[_0x42f5('0x44')]=function(_0x48625f,_0x18c8b4){var _0x1370ee={'where':{'id':_0x48625f[_0x42f5('0x3c')]['id']}},_0x36b62b={};_0x36b62b[_0x42f5('0x29')]=_['keys'](db[_0x42f5('0x38')]['rawAttributes']);_0x1370ee['attributes']=_[_0x42f5('0x2e')](_0x36b62b[_0x42f5('0x29')],qs[_0x42f5('0x2f')](_0x48625f[_0x42f5('0x2c')][_0x42f5('0x2f')]));_0x1370ee[_0x42f5('0x2d')]=_0x1370ee[_0x42f5('0x2d')][_0x42f5('0x3e')]?_0x1370ee[_0x42f5('0x2d')]:_0x36b62b[_0x42f5('0x29')];if(_0x48625f[_0x42f5('0x2c')][_0x42f5('0x3f')]){_0x1370ee['include']=[{'all':!![]}];}_0x1370ee=_[_0x42f5('0x41')]({},_0x1370ee,_0x48625f[_0x42f5('0x42')]);return db[_0x42f5('0x38')][_0x42f5('0x43')](_0x1370ee)[_0x42f5('0x20')](handleEntityNotFound(_0x18c8b4,null))['then'](function(_0x4c56d1){if(_0x4c56d1){var _0x2c8977=_0x4c56d1[_0x42f5('0x45')]({'plain':!![]});_0x2c8977=qs[_0x42f5('0x46')](_0x2c8977,['id','createdAt',_0x42f5('0x47')]);_0x48625f[_0x42f5('0x48')]=_[_0x42f5('0x46')](_0x48625f[_0x42f5('0x48')],['id',_0x42f5('0x49'),'updatedAt']);return db['Attachment'][_0x42f5('0x4a')](_[_0x42f5('0x41')](_0x2c8977,_0x48625f[_0x42f5('0x48')]),{'include':_0x48625f[_0x42f5('0x2c')][_0x42f5('0x3f')]?[{'all':!![]}]:undefined});}})[_0x42f5('0x20')](respondWithResult(_0x18c8b4,0xc9))[_0x42f5('0x3a')](handleError(_0x18c8b4,null));};exports[_0x42f5('0x4b')]=function(_0x42cb32,_0x44960d){if(_0x42cb32[_0x42f5('0x48')]['id']){delete _0x42cb32['body']['id'];}return db[_0x42f5('0x38')]['find']({'where':{'id':_0x42cb32[_0x42f5('0x3c')]['id']}})[_0x42f5('0x20')](handleEntityNotFound(_0x44960d,null))[_0x42f5('0x20')](saveUpdates(_0x42cb32['body'],null))[_0x42f5('0x20')](respondWithResult(_0x44960d,null))[_0x42f5('0x3a')](handleError(_0x44960d,null));};exports[_0x42f5('0x21')]=function(_0x3402aa,_0x3184c3){return db[_0x42f5('0x38')][_0x42f5('0x43')]({'where':{'id':_0x3402aa[_0x42f5('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3184c3,null))[_0x42f5('0x20')](removeEntity(_0x3184c3,null))['catch'](handleError(_0x3184c3,null));};exports['create']=function(_0x40f64a,_0x151573,_0x16d94e){_0x40f64a[_0x42f5('0x48')]['name']=_0x40f64a[_0x42f5('0x4c')][_0x42f5('0x4d')];_0x40f64a[_0x42f5('0x48')][_0x42f5('0x4e')]=_0x40f64a[_0x42f5('0x4c')][_0x42f5('0x4f')];_0x40f64a[_0x42f5('0x48')][_0x42f5('0x27')]=_0x40f64a[_0x42f5('0x4c')][_0x42f5('0x50')];return db[_0x42f5('0x38')][_0x42f5('0x4a')](_0x40f64a[_0x42f5('0x48')])[_0x42f5('0x20')](respondWithResult(_0x151573,0xc9))[_0x42f5('0x3a')](handleError(_0x151573,null));};exports['download']=function(_0x1c2ba5,_0x1ab3a5,_0x197ed6){return db['Attachment'][_0x42f5('0x51')]({'where':{'id':_0x1c2ba5[_0x42f5('0x3c')]['id']},'raw':!![]})[_0x42f5('0x20')](handleEntityNotFound(_0x1ab3a5,null))[_0x42f5('0x20')](function(_0x520f16){if(_0x520f16){var _0x381217=_0x520f16['ChatOfflineMessageId']!==null;var _0x533295=path['join'](config[_0x42f5('0x52')],_0x42f5('0x53'));if(_0x381217){_0x533295=path[_0x42f5('0x54')](_0x533295,'offline-chat/');}var _0x1a7731=path[_0x42f5('0x54')](_0x533295,_0x520f16[_0x42f5('0x4e')]);return _0x1ab3a5[_0x42f5('0x55')](_0x1a7731);}})[_0x42f5('0x3a')](handleError(_0x1ab3a5,null));};
\ No newline at end of file
+var _0xe5fd=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','rows','catch','keys','rawAttributes','length','merge','find','clone','params','omit','updatedAt','body','createdAt','create','file','originalname','basename','mimetype','findOne','root','server/files/attachments/','join','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Attachment','fieldName','type','key','model','query','filters','intersection'];(function(_0x372d95,_0x14b2e8){var _0x258f8e=function(_0x62d3c0){while(--_0x62d3c0){_0x372d95['push'](_0x372d95['shift']());}};_0x258f8e(++_0x14b2e8);}(_0xe5fd,0x7d));var _0xde5f=function(_0x23a6b7,_0x5a3533){_0x23a6b7=_0x23a6b7-0x0;var _0x43bf1f=_0xe5fd[_0x23a6b7];return _0x43bf1f;};'use strict';var emlformat=require(_0xde5f('0x0'));var rimraf=require(_0xde5f('0x1'));var zipdir=require(_0xde5f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde5f('0x3'));var moment=require(_0xde5f('0x4'));var BPromise=require(_0xde5f('0x5'));var Mustache=require(_0xde5f('0x6'));var util=require(_0xde5f('0x7'));var path=require(_0xde5f('0x8'));var sox=require(_0xde5f('0x9'));var csv=require(_0xde5f('0xa'));var ejs=require(_0xde5f('0xb'));var fs=require('fs');var fs_extra=require(_0xde5f('0xc'));var _=require(_0xde5f('0xd'));var squel=require('squel');var crypto=require(_0xde5f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xde5f('0xf'));var toCsv=require(_0xde5f('0xa'));var querystring=require(_0xde5f('0x10'));var Papa=require(_0xde5f('0x11'));var Redis=require(_0xde5f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xde5f('0x13'));var hardwareService=require(_0xde5f('0x14'));var logger=require(_0xde5f('0x15'))('api');var utils=require(_0xde5f('0x16'));var config=require(_0xde5f('0x17'));var licenseUtil=require(_0xde5f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44eb64,_0x586236){_0x586236=_0x586236||0xcc;return function(_0x5f3ae1){if(_0x5f3ae1){return _0x44eb64['sendStatus'](_0x586236);}return _0x44eb64[_0xde5f('0x19')](_0x586236)['end']();};}function respondWithResult(_0x5f18a5,_0x1251b5){_0x1251b5=_0x1251b5||0xc8;return function(_0x34f433){if(_0x34f433){return _0x5f18a5['status'](_0x1251b5)['json'](_0x34f433);}};}function respondWithFilteredResult(_0x85ac7c,_0x20215c){return function(_0x4312e8){if(_0x4312e8){var _0x9bac3a=typeof _0x20215c[_0xde5f('0x1a')]===_0xde5f('0x1b')&&typeof _0x20215c[_0xde5f('0x1c')]==='undefined';var _0x56c110=_0x4312e8['count'];var _0x23a19f=_0x9bac3a?0x0:_0x20215c['offset'];var _0xf232c8=_0x9bac3a?_0x4312e8[_0xde5f('0x1d')]:_0x20215c[_0xde5f('0x1a')]+_0x20215c[_0xde5f('0x1c')];var _0x44f842;if(_0xf232c8>=_0x56c110){_0xf232c8=_0x56c110;_0x44f842=0xc8;}else{_0x44f842=0xce;}_0x85ac7c[_0xde5f('0x19')](_0x44f842);return _0x85ac7c[_0xde5f('0x1e')]('Content-Range',_0x23a19f+'-'+_0xf232c8+'/'+_0x56c110)[_0xde5f('0x1f')](_0x4312e8);}return null;};}function patchUpdates(_0x4ddec9){return function(_0x2ade30){try{jsonpatch[_0xde5f('0x20')](_0x2ade30,_0x4ddec9,!![]);}catch(_0x333918){return BPromise[_0xde5f('0x21')](_0x333918);}return _0x2ade30[_0xde5f('0x22')]();};}function saveUpdates(_0x32c71e,_0x7adf){return function(_0x41c58f){if(_0x41c58f){return _0x41c58f[_0xde5f('0x23')](_0x32c71e)[_0xde5f('0x24')](function(_0x397dd3){return _0x397dd3;});}return null;};}function removeEntity(_0x16fcf,_0x6180ed){return function(_0x586ec3){if(_0x586ec3){return _0x586ec3[_0xde5f('0x25')]()['then'](function(){_0x16fcf[_0xde5f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb013e9,_0x385869){return function(_0xadbd4b){if(!_0xadbd4b){_0xb013e9[_0xde5f('0x26')](0x194);}return _0xadbd4b;};}function handleError(_0x545874,_0x31b07e){_0x31b07e=_0x31b07e||0x1f4;return function(_0x288c90){logger[_0xde5f('0x27')](_0x288c90[_0xde5f('0x28')]);if(_0x288c90[_0xde5f('0x29')]){delete _0x288c90[_0xde5f('0x29')];}_0x545874[_0xde5f('0x19')](_0x31b07e)[_0xde5f('0x2a')](_0x288c90);};}exports[_0xde5f('0x2b')]=function(_0x17ad3c,_0x7f0eb7){var _0x95006e={},_0x391384={},_0x18d335={'count':0x0,'rows':[]};var _0x50f094=_[_0xde5f('0x2c')](db[_0xde5f('0x2d')]['rawAttributes'],function(_0x575366){return{'name':_0x575366[_0xde5f('0x2e')],'type':_0x575366[_0xde5f('0x2f')][_0xde5f('0x30')]};});_0x391384[_0xde5f('0x31')]=_[_0xde5f('0x2c')](_0x50f094,_0xde5f('0x29'));_0x391384['query']=_['keys'](_0x17ad3c[_0xde5f('0x32')]);_0x391384[_0xde5f('0x33')]=_[_0xde5f('0x34')](_0x391384[_0xde5f('0x31')],_0x391384[_0xde5f('0x32')]);_0x95006e[_0xde5f('0x35')]=_[_0xde5f('0x34')](_0x391384[_0xde5f('0x31')],qs[_0xde5f('0x36')](_0x17ad3c[_0xde5f('0x32')][_0xde5f('0x36')]));_0x95006e['attributes']=_0x95006e[_0xde5f('0x35')]['length']?_0x95006e[_0xde5f('0x35')]:_0x391384[_0xde5f('0x31')];if(!_0x17ad3c[_0xde5f('0x32')][_0xde5f('0x37')](_0xde5f('0x38'))){_0x95006e[_0xde5f('0x1c')]=qs[_0xde5f('0x1c')](_0x17ad3c[_0xde5f('0x32')][_0xde5f('0x1c')]);_0x95006e[_0xde5f('0x1a')]=qs[_0xde5f('0x1a')](_0x17ad3c[_0xde5f('0x32')][_0xde5f('0x1a')]);}_0x95006e[_0xde5f('0x39')]=qs[_0xde5f('0x3a')](_0x17ad3c['query']['sort']);_0x95006e[_0xde5f('0x3b')]=qs[_0xde5f('0x33')](_[_0xde5f('0x3c')](_0x17ad3c[_0xde5f('0x32')],_0x391384[_0xde5f('0x33')]),_0x50f094);if(_0x17ad3c[_0xde5f('0x32')]['filter']){_0x95006e[_0xde5f('0x3b')]=_['merge'](_0x95006e[_0xde5f('0x3b')],{'$or':_[_0xde5f('0x2c')](_0x50f094,function(_0x5a80a1){if(_0x5a80a1[_0xde5f('0x2f')]!==_0xde5f('0x3d')){var _0x4fa755={};_0x4fa755[_0x5a80a1[_0xde5f('0x29')]]={'$like':'%'+_0x17ad3c[_0xde5f('0x32')][_0xde5f('0x3e')]+'%'};return _0x4fa755;}})});}_0x95006e=_['merge']({},_0x95006e,_0x17ad3c[_0xde5f('0x3f')]);var _0x2741c3={'where':_0x95006e[_0xde5f('0x3b')]};return db['Attachment'][_0xde5f('0x1d')](_0x2741c3)[_0xde5f('0x24')](function(_0x46c204){_0x18d335[_0xde5f('0x1d')]=_0x46c204;if(_0x17ad3c[_0xde5f('0x32')][_0xde5f('0x40')]){_0x95006e[_0xde5f('0x41')]=[{'all':!![]}];}return db[_0xde5f('0x2d')]['findAll'](_0x95006e);})['then'](function(_0x24df70){_0x18d335[_0xde5f('0x42')]=_0x24df70;return _0x18d335;})[_0xde5f('0x24')](respondWithFilteredResult(_0x7f0eb7,_0x95006e))[_0xde5f('0x43')](handleError(_0x7f0eb7,null));};exports['show']=function(_0x47b6aa,_0x5e41ce){var _0x2556f7={'raw':!![],'where':{'id':_0x47b6aa['params']['id']}},_0x5503d1={};_0x5503d1[_0xde5f('0x31')]=_[_0xde5f('0x44')](db[_0xde5f('0x2d')][_0xde5f('0x45')]);_0x5503d1[_0xde5f('0x32')]=_[_0xde5f('0x44')](_0x47b6aa['query']);_0x5503d1[_0xde5f('0x33')]=_[_0xde5f('0x34')](_0x5503d1[_0xde5f('0x31')],_0x5503d1[_0xde5f('0x32')]);_0x2556f7[_0xde5f('0x35')]=_['intersection'](_0x5503d1[_0xde5f('0x31')],qs['fields'](_0x47b6aa[_0xde5f('0x32')][_0xde5f('0x36')]));_0x2556f7[_0xde5f('0x35')]=_0x2556f7[_0xde5f('0x35')][_0xde5f('0x46')]?_0x2556f7[_0xde5f('0x35')]:_0x5503d1['model'];if(_0x47b6aa[_0xde5f('0x32')]['includeAll']){_0x2556f7['include']=[{'all':!![]}];}_0x2556f7=_[_0xde5f('0x47')]({},_0x2556f7,_0x47b6aa['options']);return db['Attachment'][_0xde5f('0x48')](_0x2556f7)[_0xde5f('0x24')](handleEntityNotFound(_0x5e41ce,null))[_0xde5f('0x24')](respondWithResult(_0x5e41ce,null))[_0xde5f('0x43')](handleError(_0x5e41ce,null));};exports[_0xde5f('0x49')]=function(_0xf9b310,_0x3f99ca){var _0x1a6676={'where':{'id':_0xf9b310[_0xde5f('0x4a')]['id']}},_0xdaef1a={};_0xdaef1a[_0xde5f('0x31')]=_['keys'](db[_0xde5f('0x2d')][_0xde5f('0x45')]);_0x1a6676[_0xde5f('0x35')]=_[_0xde5f('0x34')](_0xdaef1a[_0xde5f('0x31')],qs[_0xde5f('0x36')](_0xf9b310[_0xde5f('0x32')][_0xde5f('0x36')]));_0x1a6676[_0xde5f('0x35')]=_0x1a6676[_0xde5f('0x35')][_0xde5f('0x46')]?_0x1a6676[_0xde5f('0x35')]:_0xdaef1a[_0xde5f('0x31')];if(_0xf9b310['query'][_0xde5f('0x40')]){_0x1a6676[_0xde5f('0x41')]=[{'all':!![]}];}_0x1a6676=_[_0xde5f('0x47')]({},_0x1a6676,_0xf9b310[_0xde5f('0x3f')]);return db[_0xde5f('0x2d')][_0xde5f('0x48')](_0x1a6676)['then'](handleEntityNotFound(_0x3f99ca,null))[_0xde5f('0x24')](function(_0x2f3a53){if(_0x2f3a53){var _0xbe17d4=_0x2f3a53['get']({'plain':!![]});_0xbe17d4=qs[_0xde5f('0x4b')](_0xbe17d4,['id','createdAt',_0xde5f('0x4c')]);_0xf9b310[_0xde5f('0x4d')]=_[_0xde5f('0x4b')](_0xf9b310[_0xde5f('0x4d')],['id',_0xde5f('0x4e'),_0xde5f('0x4c')]);return db[_0xde5f('0x2d')][_0xde5f('0x4f')](_[_0xde5f('0x47')](_0xbe17d4,_0xf9b310[_0xde5f('0x4d')]),{'include':_0xf9b310['query'][_0xde5f('0x40')]?[{'all':!![]}]:undefined});}})[_0xde5f('0x24')](respondWithResult(_0x3f99ca,0xc9))[_0xde5f('0x43')](handleError(_0x3f99ca,null));};exports[_0xde5f('0x23')]=function(_0x3d24ed,_0xc7c722){if(_0x3d24ed['body']['id']){delete _0x3d24ed[_0xde5f('0x4d')]['id'];}return db[_0xde5f('0x2d')][_0xde5f('0x48')]({'where':{'id':_0x3d24ed[_0xde5f('0x4a')]['id']}})[_0xde5f('0x24')](handleEntityNotFound(_0xc7c722,null))['then'](saveUpdates(_0x3d24ed[_0xde5f('0x4d')],null))['then'](respondWithResult(_0xc7c722,null))[_0xde5f('0x43')](handleError(_0xc7c722,null));};exports[_0xde5f('0x25')]=function(_0x390e96,_0x4e173f){return db['Attachment'][_0xde5f('0x48')]({'where':{'id':_0x390e96[_0xde5f('0x4a')]['id']}})[_0xde5f('0x24')](handleEntityNotFound(_0x4e173f,null))['then'](removeEntity(_0x4e173f,null))[_0xde5f('0x43')](handleError(_0x4e173f,null));};exports[_0xde5f('0x4f')]=function(_0x3b9925,_0x2170b4,_0x5b334b){_0x3b9925[_0xde5f('0x4d')][_0xde5f('0x29')]=_0x3b9925[_0xde5f('0x50')][_0xde5f('0x51')];_0x3b9925['body'][_0xde5f('0x52')]=_0x3b9925[_0xde5f('0x50')]['filename'];_0x3b9925[_0xde5f('0x4d')][_0xde5f('0x2f')]=_0x3b9925['file'][_0xde5f('0x53')];return db[_0xde5f('0x2d')][_0xde5f('0x4f')](_0x3b9925[_0xde5f('0x4d')])['then'](respondWithResult(_0x2170b4,0xc9))[_0xde5f('0x43')](handleError(_0x2170b4,null));};exports['download']=function(_0x587178,_0x5b6b14,_0xd5c96d){return db[_0xde5f('0x2d')][_0xde5f('0x54')]({'where':{'id':_0x587178[_0xde5f('0x4a')]['id']},'raw':!![]})[_0xde5f('0x24')](handleEntityNotFound(_0x5b6b14,null))[_0xde5f('0x24')](function(_0x45ec1e){if(_0x45ec1e){var _0x430b69=_0x45ec1e['ChatOfflineMessageId']!==null;var _0x4b4205=path['join'](config[_0xde5f('0x55')],_0xde5f('0x56'));if(_0x430b69){_0x4b4205=path[_0xde5f('0x57')](_0x4b4205,'offline-chat/');}var _0x223512=path[_0xde5f('0x57')](_0x4b4205,_0x45ec1e[_0xde5f('0x52')]);return _0x5b6b14[_0xde5f('0x58')](_0x223512);}})[_0xde5f('0x43')](handleError(_0x5b6b14,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 95bf8c7..0679cc1 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 _0xbb64=['util','moment','bluebird','request-promise','../../config/environment','./attachment.attributes','define','Attachment','lodash'];(function(_0x52f1a7,_0x4da82f){var _0x227c86=function(_0x1e8686){while(--_0x1e8686){_0x52f1a7['push'](_0x52f1a7['shift']());}};_0x227c86(++_0x4da82f);}(_0xbb64,0x1dc));var _0x4bb6=function(_0x27bc7b,_0xb3a76d){_0x27bc7b=_0x27bc7b-0x0;var _0x348d71=_0xbb64[_0x27bc7b];return _0x348d71;};'use strict';var _=require(_0x4bb6('0x0'));var util=require(_0x4bb6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4bb6('0x2'));var BPromise=require(_0x4bb6('0x3'));var rp=require(_0x4bb6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4bb6('0x5'));var attributes=require(_0x4bb6('0x6'));module['exports']=function(_0x59ac41,_0x5d59f1){return _0x59ac41[_0x4bb6('0x7')](_0x4bb6('0x8'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8438=['./attachment.attributes','exports','define','attachments','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5292ed,_0x74bd26){var _0x2a2bc7=function(_0x5b3dbe){while(--_0x5b3dbe){_0x5292ed['push'](_0x5292ed['shift']());}};_0x2a2bc7(++_0x74bd26);}(_0x8438,0x13c));var _0x8843=function(_0xe94610,_0x2e3b8b){_0xe94610=_0xe94610-0x0;var _0x9b6f20=_0x8438[_0xe94610];return _0x9b6f20;};'use strict';var _=require(_0x8843('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8843('0x1'));var moment=require(_0x8843('0x2'));var BPromise=require(_0x8843('0x3'));var rp=require(_0x8843('0x4'));var fs=require('fs');var path=require(_0x8843('0x5'));var rimraf=require(_0x8843('0x6'));var config=require(_0x8843('0x7'));var attributes=require(_0x8843('0x8'));module[_0x8843('0x9')]=function(_0x5ee512,_0x213ddc){return _0x5ee512[_0x8843('0xa')]('Attachment',attributes,{'tableName':_0x8843('0xb'),'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 7564502..d071351 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 _0xe13e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateAttachment','Attachment','body','options','raw','moment','bluebird'];(function(_0x580ff5,_0xd4a51a){var _0x2ea54f=function(_0xa7771c){while(--_0xa7771c){_0x580ff5['push'](_0x580ff5['shift']());}};_0x2ea54f(++_0xd4a51a);}(_0xe13e,0xde));var _0xee13=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe13e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xee13('0x0'));var BPromise=require(_0xee13('0x1'));var rs=require(_0xee13('0x2'));var fs=require('fs');var Redis=require(_0xee13('0x3'));var db=require(_0xee13('0x4'))['db'];var utils=require(_0xee13('0x5'));var logger=require(_0xee13('0x6'))(_0xee13('0x7'));var config=require(_0xee13('0x8'));var jayson=require(_0xee13('0x9'));var client=jayson[_0xee13('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8f606d,_0x3ae6e2,_0xfdb836){return new BPromise(function(_0x64ee02,_0x4810bd){return client[_0xee13('0xb')](_0x8f606d,_0xfdb836)[_0xee13('0xc')](function(_0x1cc55b){logger[_0xee13('0xd')](_0xee13('0xe'),_0x3ae6e2,'request\x20sent');logger[_0xee13('0xf')](_0xee13('0x10'),_0x3ae6e2,'request\x20sent',JSON[_0xee13('0x11')](_0x1cc55b));if(_0x1cc55b['error']){if(_0x1cc55b['error']['code']===0x1f4){logger[_0xee13('0x12')]('Attachment,\x20%s,\x20%s',_0x3ae6e2,_0x1cc55b[_0xee13('0x12')][_0xee13('0x13')]);return _0x4810bd(_0x1cc55b[_0xee13('0x12')][_0xee13('0x13')]);}logger[_0xee13('0x12')](_0xee13('0xe'),_0x3ae6e2,_0x1cc55b[_0xee13('0x12')]['message']);return _0x64ee02(_0x1cc55b[_0xee13('0x12')][_0xee13('0x13')]);}else{logger[_0xee13('0xd')]('Attachment,\x20%s,\x20%s',_0x3ae6e2,_0xee13('0x14'));_0x64ee02(_0x1cc55b[_0xee13('0x15')]['message']);}})[_0xee13('0x16')](function(_0xcd1482){logger[_0xee13('0x12')](_0xee13('0xe'),_0x3ae6e2,_0xcd1482);_0x4810bd(_0xcd1482);});});}exports[_0xee13('0x17')]=function(_0x3a5819){var _0xd353d0=this;return new Promise(function(_0x33bd9c,_0x3806b0){return db[_0xee13('0x18')]['create'](_0x3a5819[_0xee13('0x19')],{'raw':_0x3a5819[_0xee13('0x1a')]?_0x3a5819['options'][_0xee13('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x17e664){logger['info'](_0xee13('0x17'),_0x3a5819);logger[_0xee13('0xf')]('CreateAttachment',_0x3a5819,JSON[_0xee13('0x11')](_0x17e664));_0x33bd9c(_0x17e664);})[_0xee13('0x16')](function(_0x3f9dfd){logger[_0xee13('0x12')](_0xee13('0x17'),_0x3f9dfd['message'],_0x3a5819);_0x3806b0(_0xd353d0[_0xee13('0x12')](0x1f4,_0x3f9dfd[_0xee13('0x13')]));});});};
\ No newline at end of file
+var _0x202c=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateAttachment','Attachment','options','raw','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x1e896c,_0x3f9948){var _0xd149d9=function(_0x3281e5){while(--_0x3281e5){_0x1e896c['push'](_0x1e896c['shift']());}};_0xd149d9(++_0x3f9948);}(_0x202c,0x178));var _0xc202=function(_0x5e5d33,_0x3f76f5){_0x5e5d33=_0x5e5d33-0x0;var _0x8d2331=_0x202c[_0x5e5d33];return _0x8d2331;};'use strict';var _=require(_0xc202('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc202('0x1'));var rs=require(_0xc202('0x2'));var fs=require('fs');var Redis=require(_0xc202('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc202('0x4'));var logger=require(_0xc202('0x5'))(_0xc202('0x6'));var config=require(_0xc202('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc202('0x8')][_0xc202('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59563a,_0xc2b3eb,_0x574549){return new BPromise(function(_0x872c1a,_0x5978fe){return client[_0xc202('0xa')](_0x59563a,_0x574549)[_0xc202('0xb')](function(_0x36fcb7){logger[_0xc202('0xc')](_0xc202('0xd'),_0xc2b3eb,_0xc202('0xe'));logger[_0xc202('0xf')](_0xc202('0x10'),_0xc2b3eb,_0xc202('0xe'),JSON[_0xc202('0x11')](_0x36fcb7));if(_0x36fcb7[_0xc202('0x12')]){if(_0x36fcb7['error'][_0xc202('0x13')]===0x1f4){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);return _0x5978fe(_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);}logger['error'](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')]['message']);return _0x872c1a(_0x36fcb7['error']['message']);}else{logger[_0xc202('0xc')]('Attachment,\x20%s,\x20%s',_0xc2b3eb,_0xc202('0xe'));_0x872c1a(_0x36fcb7['result'][_0xc202('0x14')]);}})[_0xc202('0x15')](function(_0x3018c8){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x3018c8);_0x5978fe(_0x3018c8);});});}exports[_0xc202('0x16')]=function(_0x9620a0){var _0x591ecc=this;return new Promise(function(_0x16ec7c,_0x2c5557){return db[_0xc202('0x17')]['create'](_0x9620a0['body'],{'raw':_0x9620a0[_0xc202('0x18')]?_0x9620a0[_0xc202('0x18')][_0xc202('0x19')]===undefined?!![]:![]:!![]})[_0xc202('0xb')](function(_0x2ae3c1){logger['info']('CreateAttachment',_0x9620a0);logger[_0xc202('0xf')]('CreateAttachment',_0x9620a0,JSON[_0xc202('0x11')](_0x2ae3c1));_0x16ec7c(_0x2ae3c1);})[_0xc202('0x15')](function(_0x56e979){logger['error'](_0xc202('0x16'),_0x56e979['message'],_0x9620a0);_0x2c5557(_0x591ecc[_0xc202('0x12')](0x1f4,_0x56e979[_0xc202('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index cbc5888..88f0783 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x12aba8,_0x40a036){_0x12aba8=_0x12aba8-0x0;var _0x2aac66=_0x0b0e[_0x12aba8];return _0x2aac66;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x509e7f,_0x2d9f99){var _0x28a735=function(_0x1c080a){while(--_0x1c080a){_0x509e7f['push'](_0x509e7f['shift']());}};_0x28a735(++_0x2d9f99);}(_0xb10b,0x12a));var _0xbb10=function(_0x14eb9e,_0x29fe9e){_0x14eb9e=_0x14eb9e-0x0;var _0x4c59c4=_0xb10b[_0x14eb9e];return _0x4c59c4;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 7c268ad..071b8b7 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 _0x8d5d=['adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','role','disabled','blockedAt','online','admin','user','agent','blocked','add','minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','name','User','passport','passport-local','Strategy','moment','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','api','undefined','activedirectory','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then'];(function(_0x5f4b36,_0x18cb34){var _0x4765ec=function(_0x2a6c85){while(--_0x2a6c85){_0x5f4b36['push'](_0x5f4b36['shift']());}};_0x4765ec(++_0x18cb34);}(_0x8d5d,0x10e));var _0xd8d5=function(_0x5bb3f0,_0x263eea){_0x5bb3f0=_0x5bb3f0-0x0;var _0x4a3015=_0x8d5d[_0x5bb3f0];return _0x4a3015;};'use strict';var passport=require(_0xd8d5('0x0'));var LocalStrategy=require(_0xd8d5('0x1'))[_0xd8d5('0x2')];var moment=require(_0xd8d5('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xd8d5('0x4'));var util=require(_0xd8d5('0x5'));var db=require(_0xd8d5('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xd8d5('0x7'));var config=require(_0xd8d5('0x8'));var logger=require('../../config/logger')(_0xd8d5('0x9'));function isActiveDirectoryConfigured(_0x144466){var _0x56d620=![];if(typeof _0x144466['activedirectory']!==_0xd8d5('0xa')){_0x56d620=_0x144466[_0xd8d5('0xb')]['baseDN']&&_0x144466[_0xd8d5('0xb')][_0xd8d5('0xc')]&&_0x144466[_0xd8d5('0xb')]['domain'];}return _0x56d620;}function adAuthenticate(_0x3aab7f,_0x4f6f51,_0x7e3601){return new BPromise(function(_0x3423ba,_0x5ad02c){try{var _0x2c5efa=new ActiveDirectory(_0x3aab7f);_0x2c5efa[_0xd8d5('0xd')](_0x4f6f51,_0x7e3601,function(_0x45a0f4,_0x31ebe6){if(_0x45a0f4){logger[_0xd8d5('0xe')](_0xd8d5('0xf'),_0x4f6f51,util[_0xd8d5('0x10')](_0x45a0f4,{'showHidden':![],'depth':null}));_0x5ad02c(_0xd8d5('0x11'));}else if(!_0x31ebe6){logger[_0xd8d5('0xe')](_0xd8d5('0x12'),_0x4f6f51);_0x5ad02c(_0xd8d5('0x11'));}else{_0x3423ba(_0x31ebe6);}});}catch(_0x4bca58){_0x5ad02c(_0x4bca58);}});}function ActiveDirectoryAuthenticate(_0x507dd3,_0x5b0b8a,_0x37ae00,_0x327417){var _0x2e5c3f,_0x115852;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xd8d5('0x13'),_0x5b0b8a);return _0x327417(null,![],{'message':_0xd8d5('0x11')});}return db[_0xd8d5('0x14')][_0xd8d5('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xd8d5('0x16')],'raw':!![]})[_0xd8d5('0x17')](function(_0x4d28ae){_0x2e5c3f=_0x4d28ae;if(!_0x2e5c3f[_0xd8d5('0x18')]){logger[_0xd8d5('0xe')](_0xd8d5('0x19'),_0x5b0b8a);throw new Error(_0xd8d5('0x11'));}return _0x507dd3[_0xd8d5('0x15')]({'attributes':['id','name',_0xd8d5('0x1a'),'salt',_0xd8d5('0x1b'),_0xd8d5('0x1c'),'blocked',_0xd8d5('0x1d'),_0xd8d5('0x1e')],'where':{'name':_0x5b0b8a,'role':{'$or':[_0xd8d5('0x1f'),_0xd8d5('0x20'),_0xd8d5('0x21')]},'adSsoEnabled':!![]}});})[_0xd8d5('0x17')](function(_0xdf5921){if(!_0xdf5921||_0xdf5921&&_0xdf5921['name']!==_0x5b0b8a){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x115852=_0xdf5921;var _0x4c8d98=_0x115852['name']+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0xd8d5('0xb')],_0x4c8d98,_0x37ae00);})[_0xd8d5('0x17')](function(_0x12c113){if(_0x115852['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x2e5c3f[_0xd8d5('0x16')]>0x0){if(_0x115852[_0xd8d5('0x22')]){if(moment(_0x115852[_0xd8d5('0x1d')])[_0xd8d5('0x23')](_0x2e5c3f['blockDuration'],_0xd8d5('0x24'))>moment()){throw new Error(_0xd8d5('0x11'));}return utils[_0xd8d5('0x25')](_0x115852,0x0,![],null)[_0xd8d5('0x17')](function(){return utils[_0xd8d5('0x26')](_0x115852);})[_0xd8d5('0x17')](function(){return _0x327417(null,_0x115852);});}else{return utils['getLicense'](_0x115852)['then'](function(){return _0x327417(null,_0x115852);});}}else{return utils[_0xd8d5('0x26')](_0x115852)['then'](function(){return _0x327417(null,_0x115852);});}})[_0xd8d5('0x27')](function(_0x51e77b){return _0x327417(null,![],_0x51e77b);});}function handleError(_0x444f5b,_0x4238c3,_0x54d56b){return _0x444f5b[_0xd8d5('0x28')](_0x4238c3||0x1f4)['send']({'message':_0x54d56b?_0x54d56b[_0xd8d5('0x29')]||_0x54d56b:''});}exports[_0xd8d5('0x2a')]=function(_0x5a5335,_0x2daee2,_0x379737){passport[_0xd8d5('0xd')](_0xd8d5('0x2b'),function(_0x2c24e3,_0x5ad95e,_0x1326ad){var _0x29a93b=_0x2c24e3||_0x1326ad;if(_0x29a93b){return handleError(_0x2daee2,0x191,_0x29a93b);}if(!_0x5ad95e){return handleError(_0x2daee2,0x194,{'message':_0xd8d5('0x2c')});}else{var _0x4481d6={'payload':{'id':_0x5ad95e['id'],'role':_0x5ad95e[_0xd8d5('0x1b')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4481d6)[_0xd8d5('0x17')](function(_0x100270){_0x2daee2[_0xd8d5('0x2d')]({'id':_0x5ad95e['id'],'token':_0x100270,'statusCall':'','isAlreadyLogged':_0x5ad95e[_0xd8d5('0x1e')]});});}})(_0x5a5335,_0x2daee2,_0x379737);};passport[_0xd8d5('0x2e')]('ad-login',new LocalStrategy({'usernameField':_0xd8d5('0x2f'),'passwordField':_0xd8d5('0x1a')},function(_0x2c2c50,_0x56a25f,_0x13f18a){return ActiveDirectoryAuthenticate(db[_0xd8d5('0x30')],_0x2c2c50,_0x56a25f,_0x13f18a);}));
\ No newline at end of file
+var _0x8ba5=['../../mysqldb','../../components/auth/service','../../config/logger','activedirectory','undefined','baseDN','url','domain','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','user','then','getLicense','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','util'];(function(_0x426bdf,_0x45f9be){var _0x5aad3a=function(_0x2ead03){while(--_0x2ead03){_0x426bdf['push'](_0x426bdf['shift']());}};_0x5aad3a(++_0x45f9be);}(_0x8ba5,0x1da));var _0x58ba=function(_0x2199db,_0x64fe69){_0x2199db=_0x2199db-0x0;var _0x1823bc=_0x8ba5[_0x2199db];return _0x1823bc;};'use strict';var passport=require(_0x58ba('0x0'));var LocalStrategy=require(_0x58ba('0x1'))[_0x58ba('0x2')];var moment=require(_0x58ba('0x3'));var ActiveDirectory=require(_0x58ba('0x4'));var BPromise=require('bluebird');var util=require(_0x58ba('0x5'));var db=require(_0x58ba('0x6'))['db'];var authService=require(_0x58ba('0x7'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0x58ba('0x8'))('api');function isActiveDirectoryConfigured(_0x4fb96e){var _0x48b43b=![];if(typeof _0x4fb96e[_0x58ba('0x9')]!==_0x58ba('0xa')){_0x48b43b=_0x4fb96e[_0x58ba('0x9')][_0x58ba('0xb')]&&_0x4fb96e['activedirectory'][_0x58ba('0xc')]&&_0x4fb96e['activedirectory'][_0x58ba('0xd')];}return _0x48b43b;}function adAuthenticate(_0x223b7e,_0x63c802,_0x5b1607){return new BPromise(function(_0x44bf4d,_0x57a2e5){try{var _0xfbe7f1=new ActiveDirectory(_0x223b7e);_0xfbe7f1['authenticate'](_0x63c802,_0x5b1607,function(_0x4ba989,_0x11aa55){if(_0x4ba989){logger[_0x58ba('0xe')]('Error\x20authenticate\x20%s:\x20%s',_0x63c802,util[_0x58ba('0xf')](_0x4ba989,{'showHidden':![],'depth':null}));_0x57a2e5(_0x58ba('0x10'));}else if(!_0x11aa55){logger[_0x58ba('0xe')](_0x58ba('0x11'),_0x63c802);_0x57a2e5(_0x58ba('0x10'));}else{_0x44bf4d(_0x11aa55);}});}catch(_0x5b6cc0){_0x57a2e5(_0x5b6cc0);}});}function ActiveDirectoryAuthenticate(_0x2be273,_0x235a5a,_0x4c5cd1,_0x43107d){var _0x3dbbdb,_0x464b8e;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x58ba('0x12'),_0x235a5a);return _0x43107d(null,![],{'message':_0x58ba('0x10')});}return db['Setting'][_0x58ba('0x13')]({'where':{'id':0x1},'attributes':[_0x58ba('0x14'),_0x58ba('0x15')],'raw':!![]})['then'](function(_0x5783de){_0x3dbbdb=_0x5783de;if(!_0x3dbbdb[_0x58ba('0x14')]){logger[_0x58ba('0xe')](_0x58ba('0x16'),_0x235a5a);throw new Error(_0x58ba('0x10'));}return _0x2be273[_0x58ba('0x13')]({'attributes':['id',_0x58ba('0x17'),_0x58ba('0x18'),_0x58ba('0x19'),_0x58ba('0x1a'),_0x58ba('0x1b'),_0x58ba('0x1c'),_0x58ba('0x1d'),_0x58ba('0x1e')],'where':{'name':_0x235a5a,'role':{'$or':['admin',_0x58ba('0x1f'),'agent']},'adSsoEnabled':!![]}});})[_0x58ba('0x20')](function(_0x78c779){if(!_0x78c779||_0x78c779&&_0x78c779[_0x58ba('0x17')]!==_0x235a5a){throw new Error(_0x58ba('0x10'));}_0x464b8e=_0x78c779;var _0x3d8b11=_0x464b8e[_0x58ba('0x17')]+'@'+config['activedirectory'][_0x58ba('0xd')];return adAuthenticate(config['activedirectory'],_0x3d8b11,_0x4c5cd1);})[_0x58ba('0x20')](function(_0x56d333){if(_0x464b8e[_0x58ba('0x1b')]){throw new Error(_0x58ba('0x10'));}if(_0x3dbbdb[_0x58ba('0x15')]>0x0){if(_0x464b8e[_0x58ba('0x1c')]){if(moment(_0x464b8e[_0x58ba('0x1d')])['add'](_0x3dbbdb[_0x58ba('0x15')],'minutes')>moment()){throw new Error(_0x58ba('0x10'));}return utils['clearBlockUser'](_0x464b8e,0x0,![],null)[_0x58ba('0x20')](function(){return utils['getLicense'](_0x464b8e);})[_0x58ba('0x20')](function(){return _0x43107d(null,_0x464b8e);});}else{return utils[_0x58ba('0x21')](_0x464b8e)[_0x58ba('0x20')](function(){return _0x43107d(null,_0x464b8e);});}}else{return utils[_0x58ba('0x21')](_0x464b8e)['then'](function(){return _0x43107d(null,_0x464b8e);});}})['catch'](function(_0x13e87b){return _0x43107d(null,![],_0x13e87b);});}function handleError(_0x596236,_0x30238b,_0x14cf8a){return _0x596236['status'](_0x30238b||0x1f4)['send']({'message':_0x14cf8a?_0x14cf8a['message']||_0x14cf8a:''});}exports['login']=function(_0x7d7698,_0x157ed0,_0x40fa38){passport[_0x58ba('0x22')](_0x58ba('0x23'),function(_0x447638,_0x4abae0,_0x50c59e){var _0x4651fa=_0x447638||_0x50c59e;if(_0x4651fa){return handleError(_0x157ed0,0x191,_0x4651fa);}if(!_0x4abae0){return handleError(_0x157ed0,0x194,{'message':_0x58ba('0x24')});}else{var _0x36714c={'payload':{'id':_0x4abae0['id'],'role':_0x4abae0[_0x58ba('0x1a')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x36714c)['then'](function(_0x3cd688){_0x157ed0[_0x58ba('0x25')]({'id':_0x4abae0['id'],'token':_0x3cd688,'statusCall':'','isAlreadyLogged':_0x4abae0[_0x58ba('0x1e')]});});}})(_0x7d7698,_0x157ed0,_0x40fa38);};passport[_0x58ba('0x26')](_0x58ba('0x23'),new LocalStrategy({'usernameField':'name','passwordField':_0x58ba('0x18')},function(_0x13aefd,_0x288d61,_0x3bbb99){return ActiveDirectoryAuthenticate(db[_0x58ba('0x27')],_0x13aefd,_0x288d61,_0x3bbb99);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 0790430..0c29f7d 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 _0x7cf7=['Router','./authActiveDirectory.controller','post','login','express'];(function(_0x13a201,_0x54bc68){var _0x1c2040=function(_0xaeca05){while(--_0xaeca05){_0x13a201['push'](_0x13a201['shift']());}};_0x1c2040(++_0x54bc68);}(_0x7cf7,0x1b2));var _0x77cf=function(_0x21ed11,_0x4ff1f7){_0x21ed11=_0x21ed11-0x0;var _0x126e3=_0x7cf7[_0x21ed11];return _0x126e3;};'use strict';var express=require(_0x77cf('0x0'));var router=express[_0x77cf('0x1')]();var controller=require(_0x77cf('0x2'));router[_0x77cf('0x3')]('/',controller[_0x77cf('0x4')]);module['exports']=router;
\ No newline at end of file
+var _0xace5=['login','exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xace5,0x1ca));var _0x5ace=function(_0x55bb3e,_0x55846c){_0x55bb3e=_0x55bb3e-0x0;var _0x335c3f=_0xace5[_0x55bb3e];return _0x335c3f;};'use strict';var express=require(_0x5ace('0x0'));var router=express[_0x5ace('0x1')]();var controller=require(_0x5ace('0x2'));router[_0x5ace('0x3')]('/',controller[_0x5ace('0x4')]);module[_0x5ace('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 f6b181c..27a5829 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x52d837,_0x385684){var _0x46890e=function(_0x3045d7){while(--_0x3045d7){_0x52d837['push'](_0x52d837['shift']());}};_0x46890e(++_0x385684);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x3840fc,_0x403990){var _0x1af7ae=function(_0x4153b3){while(--_0x4153b3){_0x3840fc['push'](_0x3840fc['shift']());}};_0x1af7ae(++_0x403990);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index f1aec19..6cfd8e6 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 _0x26b7=['Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport'];(function(_0x343e89,_0x9ca261){var _0x1c3623=function(_0x25410f){while(--_0x25410f){_0x343e89['push'](_0x343e89['shift']());}};_0x1c3623(++_0x9ca261);}(_0x26b7,0x16a));var _0x726b=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x26b7[_0x465a0c];return _0x1e202e;};'use strict';var express=require(_0x726b('0x0'));var passport=require(_0x726b('0x1'));var router=express[_0x726b('0x2')]();var controller=require(_0x726b('0x3'));var userController=require(_0x726b('0x4'));var authService=require(_0x726b('0x5'));router[_0x726b('0x6')]('/',controller[_0x726b('0x7')]);router[_0x726b('0x6')](_0x726b('0x8'),controller[_0x726b('0x9')],authService[_0x726b('0xa')],userController['login'],authService[_0x726b('0xb')]);module[_0x726b('0xc')]=router;
\ No newline at end of file
+var _0xb555=['exports','express','passport','Router','./authGoogle.controller','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie'];(function(_0x5d8c9a,_0x5858ea){var _0x45d9a5=function(_0x506850){while(--_0x506850){_0x5d8c9a['push'](_0x5d8c9a['shift']());}};_0x45d9a5(++_0x5858ea);}(_0xb555,0xe5));var _0x5b55=function(_0x4d0b53,_0xb4d39a){_0x4d0b53=_0x4d0b53-0x0;var _0x3638db=_0xb555[_0x4d0b53];return _0x3638db;};'use strict';var express=require(_0x5b55('0x0'));var passport=require(_0x5b55('0x1'));var router=express[_0x5b55('0x2')]();var controller=require(_0x5b55('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x5b55('0x4'));router[_0x5b55('0x5')]('/',controller[_0x5b55('0x6')]);router[_0x5b55('0x5')](_0x5b55('0x7'),controller[_0x5b55('0x8')],authService[_0x5b55('0x9')],userController['login'],authService[_0x5b55('0xa')]);module[_0x5b55('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 0641f07..cbb788a 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 _0xa7ba=['token','now','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','allowedLoginAttempts','blockDuration','name','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','request','SendMail','message','stringify','error','status','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','findOne','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset'];(function(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0xa7ba,0x1aa));var _0xaa7b=function(_0x3a683a,_0x353ce3){_0x3a683a=_0x3a683a-0x0;var _0x8e4b97=_0xa7ba[_0x3a683a];return _0x8e4b97;};'use strict';var util=require(_0xaa7b('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xaa7b('0x1')];var jayson=require(_0xaa7b('0x2'));var _=require(_0xaa7b('0x3'));var rs=require(_0xaa7b('0x4'));var moment=require(_0xaa7b('0x5'));var db=require(_0xaa7b('0x6'))['db'];var authService=require(_0xaa7b('0x7'));var utils=require('../../config/utils');var client=jayson[_0xaa7b('0x8')][_0xaa7b('0x9')]({'port':0x232b});function localAuthenticate(_0x2bca95,_0x3bfd84,_0x45e5fa,_0x592e92){var _0x54274e,_0x4b6b99;return db[_0xaa7b('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xaa7b('0xb'),_0xaa7b('0xc')],'raw':!![]})['then'](function(_0x1c8dc0){_0x54274e=_0x1c8dc0;return _0x2bca95['findOne']({'attributes':['id',_0xaa7b('0xd'),'password','salt',_0xaa7b('0xe'),_0xaa7b('0xf'),_0xaa7b('0x10'),_0xaa7b('0x11'),_0xaa7b('0x12')],'where':{'name':_0x3bfd84,'role':{'$or':[_0xaa7b('0x13'),_0xaa7b('0x14'),_0xaa7b('0x15')]}}});})[_0xaa7b('0x16')](function(_0x5300cf){if(!_0x5300cf||_0x5300cf&&_0x5300cf[_0xaa7b('0xd')]!==_0x3bfd84){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x4b6b99=_0x5300cf;return _0x4b6b99;}})[_0xaa7b('0x16')](function(){_0x4b6b99[_0xaa7b('0x17')](_0x45e5fa,function(_0x384bbf,_0xc35dfa){var _0x1e59c2=_0x4b6b99[_0xaa7b('0x12')]+0x1;if(_0x384bbf){return _0x592e92(_0x384bbf);}else if(!_0xc35dfa){if(_0x4b6b99['disabled']){return _0x592e92(null,![],{'message':_0xaa7b('0x18')});}else if(_0x54274e[_0xaa7b('0xb')]>0x0){if(_0x4b6b99[_0xaa7b('0x10')]){if(_0x54274e[_0xaa7b('0xc')]>0x0){if(moment(_0x4b6b99[_0xaa7b('0x11')])['add'](_0x54274e[_0xaa7b('0xc')],_0xaa7b('0x19'))>moment()){return _0x592e92(null,![],{'message':_0xaa7b('0x18')});}else{return utils['clearBlockUser'](_0x4b6b99,_0x1e59c2,![],null)[_0xaa7b('0x16')](function(){return _0x592e92(null,![],{'message':_0xaa7b('0x18')});});}}else{return _0x592e92(null,![],{'message':_0xaa7b('0x18')});}}else{if(_0x1e59c2>=_0x54274e['allowedLoginAttempts']){return utils[_0xaa7b('0x1a')](_0x4b6b99,0x0,!![],moment())[_0xaa7b('0x16')](function(){return _0x592e92(null,![],{'message':_0xaa7b('0x18')});});}else{return utils[_0xaa7b('0x1a')](_0x4b6b99,_0x1e59c2,![],null)[_0xaa7b('0x16')](function(){return _0x592e92(null,![],{'message':_0xaa7b('0x18')});});}}}else{return _0x592e92(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x4b6b99[_0xaa7b('0xf')]){return _0x592e92(null,![],{'message':_0xaa7b('0x18')});}else if(_0x54274e['allowedLoginAttempts']>0x0){if(_0x4b6b99[_0xaa7b('0x10')]){if(_0x54274e[_0xaa7b('0xc')]>0x0){if(moment(_0x4b6b99[_0xaa7b('0x11')])[_0xaa7b('0x1b')](_0x54274e[_0xaa7b('0xc')],_0xaa7b('0x19'))>moment()){return _0x592e92(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xaa7b('0x1a')](_0x4b6b99,0x0,![],null)[_0xaa7b('0x16')](function(){return utils['getLicense'](_0x4b6b99);})[_0xaa7b('0x16')](function(){return _0x592e92(null,_0x4b6b99);});}}else{return _0x592e92(null,![],{'message':_0xaa7b('0x18')});}}else{return utils[_0xaa7b('0x1a')](_0x4b6b99,0x0,![],null)['then'](function(){return utils[_0xaa7b('0x1c')](_0x4b6b99);})['then'](function(){return _0x592e92(null,_0x4b6b99);})[_0xaa7b('0x1d')](function(_0x3865d7){return _0x592e92(null,![],_0x3865d7);});}}else{if(_0x4b6b99[_0xaa7b('0x10')]){return _0x592e92(null,![],{'message':_0xaa7b('0x18')});}else{return utils[_0xaa7b('0x1c')](_0x4b6b99)['then'](function(){return _0x592e92(null,_0x4b6b99);});}}}});})[_0xaa7b('0x1d')](function(_0x439cb0){return _0x592e92(null,![],_0x439cb0);});}function sendServiceMail(_0x5efae7){return db[_0xaa7b('0x1e')][_0xaa7b('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0xaa7b('0x20')],'include':[{'model':db['MailServerOut'],'as':_0xaa7b('0x21'),'include':[{'model':db[_0xaa7b('0x22')],'as':'CloudProvider'}]}]})['then'](function(_0x38b9d3){if(!_0x38b9d3){throw new Error(_0xaa7b('0x23'));}var _0x452917=_0x38b9d3['getSmtpOptions']();var _0x5195e2={'account':_0x452917,'message':_[_0xaa7b('0x24')]({'from':util[_0xaa7b('0x25')](_0xaa7b('0x26'),_0x38b9d3['name'],_0x38b9d3[_0xaa7b('0x20')]||_0x38b9d3[_0xaa7b('0x21')]['user'])},_0x5efae7)};return client[_0xaa7b('0x27')](_0xaa7b('0x28'),_0x5195e2);})['then'](function(_0x4f4c80){if(_0x4f4c80['error']){throw new Error(util[_0xaa7b('0x25')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4f4c80['error'][_0xaa7b('0x29')]||JSON[_0xaa7b('0x2a')](_0x4f4c80[_0xaa7b('0x2b')])));}return!![];});}function handleError(_0x354e4f,_0x148fce,_0x30b0d5){return _0x354e4f[_0xaa7b('0x2c')](_0x148fce||0x1f4)[_0xaa7b('0x2d')]({'message':_0x30b0d5?_0x30b0d5['message']||_0x30b0d5:''});}exports['login']=function(_0xe2550e,_0x3a8ee1,_0x918ba){passport[_0xaa7b('0x17')](_0xaa7b('0x2e'),function(_0x52f5f0,_0x3f70a0,_0xe28a50){var _0x3ce630=_0x52f5f0||_0xe28a50;if(_0x3ce630){return handleError(_0x3a8ee1,0x191,_0x3ce630);}if(!_0x3f70a0){return handleError(_0x3a8ee1,0x194,{'message':_0xaa7b('0x2f')});}else{var _0x4c8f1a={'payload':{'id':_0x3f70a0['id'],'role':_0x3f70a0[_0xaa7b('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0xaa7b('0x30')](_0x4c8f1a)[_0xaa7b('0x16')](function(_0x375bac){_0x3a8ee1[_0xaa7b('0x31')]({'id':_0x3f70a0['id'],'token':_0x375bac,'statusCall':'','isAlreadyLogged':_0x3f70a0[_0xaa7b('0x32')]});});}})(_0xe2550e,_0x3a8ee1,_0x918ba);};exports[_0xaa7b('0x33')]=function(_0x154000,_0x116372){if(!_0x154000[_0xaa7b('0x34')][_0xaa7b('0x20')]){return handleError(_0x116372,0x1f4,{'message':_0xaa7b('0x35')});}var _0x347e62=rs[_0xaa7b('0x36')]();_0x154000[_0xaa7b('0x34')][_0xaa7b('0x20')]=_0x154000['body'][_0xaa7b('0x20')][_0xaa7b('0x37')]()[_0xaa7b('0x38')]();var _0x1ac325;return db[_0xaa7b('0xa')][_0xaa7b('0x39')]({'where':{'id':0x1},'attributes':[_0xaa7b('0xb'),_0xaa7b('0xc')],'raw':!![]})[_0xaa7b('0x16')](function(_0x19f591){_0x1ac325=_0x19f591;return db[_0xaa7b('0x3a')][_0xaa7b('0x1f')]({'where':{'email':_0x154000[_0xaa7b('0x34')][_0xaa7b('0x20')]}});})[_0xaa7b('0x16')](function(_0x2d7a45){if(!_0x2d7a45){throw new Error(_0xaa7b('0x3b'));}if(_0x2d7a45[_0xaa7b('0xf')]){throw new Error(_0xaa7b('0x3c'));}if(_0x2d7a45['blocked']){if(moment(_0x2d7a45[_0xaa7b('0x11')])[_0xaa7b('0x1b')](_0x1ac325[_0xaa7b('0xc')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x2d7a45[_0xaa7b('0x10')]=![];_0x2d7a45[_0xaa7b('0x11')]=null;}}_0x2d7a45[_0xaa7b('0x3d')]=_0x347e62;_0x2d7a45[_0xaa7b('0x3e')]=Date['now']()+0x36ee80;return _0x2d7a45[_0xaa7b('0x3f')]();})[_0xaa7b('0x16')](function(){return sendServiceMail({'to':_0x154000[_0xaa7b('0x34')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xaa7b('0x40')+_0xaa7b('0x41')+_0xaa7b('0x42')+_0x154000['headers'][_0xaa7b('0x43')]+_0xaa7b('0x44')+_0x347e62+'\x0a\x0a'+_0xaa7b('0x45')});})[_0xaa7b('0x16')](function(){_0x116372[_0xaa7b('0x2c')](0xc8)[_0xaa7b('0x2d')]({'message':_0xaa7b('0x46')});})[_0xaa7b('0x1d')](function(_0x41cd22){return handleError(_0x116372,0x1f4,_0x41cd22);});};exports[_0xaa7b('0x47')]=function(_0x22bd7b,_0x1e3927){return db[_0xaa7b('0x3a')]['find']({'where':{'resetPasswordToken':_0x22bd7b['params'][_0xaa7b('0x48')],'resetPasswordExpires':{'$gt':Date[_0xaa7b('0x49')]()}}})[_0xaa7b('0x16')](function(_0x46d39c){if(!_0x46d39c){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xaa7b('0xa')]['findOne']({'attributes':['id',_0xaa7b('0x4a'),_0xaa7b('0x4b'),_0xaa7b('0x4c')]})['then'](function(_0x12a215){if(_0x12a215[_0xaa7b('0x4a')])authService[_0xaa7b('0x4d')](_0x22bd7b[_0xaa7b('0x34')][_0xaa7b('0x4e')]);if(!_0x12a215[_0xaa7b('0x4b')]||!_0x46d39c[_0xaa7b('0x4f')])return _0x46d39c;authService[_0xaa7b('0x50')](_0x22bd7b[_0xaa7b('0x34')][_0xaa7b('0x4e')],_0x46d39c['previousPasswords'],_0x12a215[_0xaa7b('0x4c')]);return _0x46d39c;})[_0xaa7b('0x16')](function(){_0x46d39c[_0xaa7b('0x4e')]=_0x22bd7b[_0xaa7b('0x34')][_0xaa7b('0x4e')];_0x46d39c[_0xaa7b('0x3d')]=null;_0x46d39c[_0xaa7b('0x3e')]=null;return _0x46d39c['save']();});})[_0xaa7b('0x16')](function(){_0x1e3927[_0xaa7b('0x2c')](0xc8)[_0xaa7b('0x2d')]({'message':_0xaa7b('0x51')});})[_0xaa7b('0x1d')](function(_0x50dc81){return handleError(_0x1e3927,0x1f4,_0x50dc81);});};passport[_0xaa7b('0x52')](_0xaa7b('0x2e'),new LocalStrategy({'usernameField':_0xaa7b('0xd'),'passwordField':'password'},function(_0x369ed1,_0x2e702e,_0x9478cb){return localAuthenticate(db['User'],_0x369ed1,_0x2e702e,_0x9478cb);}));
\ No newline at end of file
+var _0x9d27=['signToken','json','online','generate','trim','toLowerCase','User','body','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','password','enforcePasswordHistory','validatePasswordHistory','previousPasswords','passwordHistoryLimit','use','util','passport','jayson/promise','randomstring','moment','../../components/auth/service','../../config/utils','client','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','salt','role','disabled','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','email','Smtp','user','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.'];(function(_0xe19c82,_0x2e9ec9){var _0x60433d=function(_0xaf76a7){while(--_0xaf76a7){_0xe19c82['push'](_0xe19c82['shift']());}};_0x60433d(++_0x2e9ec9);}(_0x9d27,0xcd));var _0x79d2=function(_0x34b6aa,_0x5ddd29){_0x34b6aa=_0x34b6aa-0x0;var _0x3ead29=_0x9d27[_0x34b6aa];return _0x3ead29;};'use strict';var util=require(_0x79d2('0x0'));var passport=require(_0x79d2('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x79d2('0x2'));var _=require('lodash');var rs=require(_0x79d2('0x3'));var moment=require(_0x79d2('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x79d2('0x5'));var utils=require(_0x79d2('0x6'));var client=jayson[_0x79d2('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x221af7,_0x2fe8fc,_0x5c5720,_0x36a09a){var _0x3b521c,_0x24f06c;return db[_0x79d2('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0x79d2('0x9'),_0x79d2('0xa')],'raw':!![]})[_0x79d2('0xb')](function(_0x7b01fa){_0x3b521c=_0x7b01fa;return _0x221af7[_0x79d2('0xc')]({'attributes':['id',_0x79d2('0xd'),'password',_0x79d2('0xe'),_0x79d2('0xf'),_0x79d2('0x10'),'blocked',_0x79d2('0x11'),_0x79d2('0x12')],'where':{'name':_0x2fe8fc,'role':{'$or':[_0x79d2('0x13'),'user',_0x79d2('0x14')]}}});})[_0x79d2('0xb')](function(_0x309c02){if(!_0x309c02||_0x309c02&&_0x309c02[_0x79d2('0xd')]!==_0x2fe8fc){throw new Error(_0x79d2('0x15'));}else{_0x24f06c=_0x309c02;return _0x24f06c;}})['then'](function(){_0x24f06c[_0x79d2('0x16')](_0x5c5720,function(_0xd283c9,_0x563461){var _0x569e33=_0x24f06c[_0x79d2('0x12')]+0x1;if(_0xd283c9){return _0x36a09a(_0xd283c9);}else if(!_0x563461){if(_0x24f06c['disabled']){return _0x36a09a(null,![],{'message':_0x79d2('0x15')});}else if(_0x3b521c[_0x79d2('0x9')]>0x0){if(_0x24f06c[_0x79d2('0x17')]){if(_0x3b521c[_0x79d2('0xa')]>0x0){if(moment(_0x24f06c['blockedAt'])[_0x79d2('0x18')](_0x3b521c[_0x79d2('0xa')],_0x79d2('0x19'))>moment()){return _0x36a09a(null,![],{'message':_0x79d2('0x15')});}else{return utils[_0x79d2('0x1a')](_0x24f06c,_0x569e33,![],null)[_0x79d2('0xb')](function(){return _0x36a09a(null,![],{'message':_0x79d2('0x15')});});}}else{return _0x36a09a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x569e33>=_0x3b521c[_0x79d2('0x9')]){return utils['clearBlockUser'](_0x24f06c,0x0,!![],moment())[_0x79d2('0xb')](function(){return _0x36a09a(null,![],{'message':_0x79d2('0x15')});});}else{return utils[_0x79d2('0x1a')](_0x24f06c,_0x569e33,![],null)[_0x79d2('0xb')](function(){return _0x36a09a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x36a09a(null,![],{'message':_0x79d2('0x15')});}}else{if(_0x24f06c[_0x79d2('0x10')]){return _0x36a09a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3b521c[_0x79d2('0x9')]>0x0){if(_0x24f06c[_0x79d2('0x17')]){if(_0x3b521c[_0x79d2('0xa')]>0x0){if(moment(_0x24f06c['blockedAt'])[_0x79d2('0x18')](_0x3b521c[_0x79d2('0xa')],_0x79d2('0x19'))>moment()){return _0x36a09a(null,![],{'message':_0x79d2('0x15')});}else{return utils[_0x79d2('0x1a')](_0x24f06c,0x0,![],null)['then'](function(){return utils[_0x79d2('0x1b')](_0x24f06c);})['then'](function(){return _0x36a09a(null,_0x24f06c);});}}else{return _0x36a09a(null,![],{'message':_0x79d2('0x15')});}}else{return utils[_0x79d2('0x1a')](_0x24f06c,0x0,![],null)[_0x79d2('0xb')](function(){return utils[_0x79d2('0x1b')](_0x24f06c);})[_0x79d2('0xb')](function(){return _0x36a09a(null,_0x24f06c);})[_0x79d2('0x1c')](function(_0x59382d){return _0x36a09a(null,![],_0x59382d);});}}else{if(_0x24f06c[_0x79d2('0x17')]){return _0x36a09a(null,![],{'message':_0x79d2('0x15')});}else{return utils[_0x79d2('0x1b')](_0x24f06c)['then'](function(){return _0x36a09a(null,_0x24f06c);});}}}});})[_0x79d2('0x1c')](function(_0x2280eb){return _0x36a09a(null,![],_0x2280eb);});}function sendServiceMail(_0x4f4407){return db[_0x79d2('0x1d')][_0x79d2('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x79d2('0xd'),'email'],'include':[{'model':db[_0x79d2('0x1f')],'as':'Smtp','include':[{'model':db[_0x79d2('0x20')],'as':_0x79d2('0x20')}]}]})['then'](function(_0xcc1d80){if(!_0xcc1d80){throw new Error(_0x79d2('0x21'));}var _0x4bc086=_0xcc1d80[_0x79d2('0x22')]();var _0x583655={'account':_0x4bc086,'message':_[_0x79d2('0x23')]({'from':util[_0x79d2('0x24')]('\x22%s\x22\x20<%s>',_0xcc1d80[_0x79d2('0xd')],_0xcc1d80[_0x79d2('0x25')]||_0xcc1d80[_0x79d2('0x26')][_0x79d2('0x27')])},_0x4f4407)};return client['request'](_0x79d2('0x28'),_0x583655);})[_0x79d2('0xb')](function(_0xae6f26){if(_0xae6f26[_0x79d2('0x29')]){throw new Error(util[_0x79d2('0x24')](_0x79d2('0x2a'),_0xae6f26['error'][_0x79d2('0x2b')]||JSON[_0x79d2('0x2c')](_0xae6f26[_0x79d2('0x29')])));}return!![];});}function handleError(_0x46d06b,_0x141569,_0x4ce9eb){return _0x46d06b[_0x79d2('0x2d')](_0x141569||0x1f4)[_0x79d2('0x2e')]({'message':_0x4ce9eb?_0x4ce9eb['message']||_0x4ce9eb:''});}exports[_0x79d2('0x2f')]=function(_0x2f0c6b,_0x1e02d6,_0x5dc7d6){passport[_0x79d2('0x16')](_0x79d2('0x30'),function(_0x20ce31,_0x867957,_0x5a6c53){var _0x575511=_0x20ce31||_0x5a6c53;if(_0x575511){return handleError(_0x1e02d6,0x191,_0x575511);}if(!_0x867957){return handleError(_0x1e02d6,0x194,{'message':_0x79d2('0x31')});}else{var _0x176d74={'payload':{'id':_0x867957['id'],'role':_0x867957[_0x79d2('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x79d2('0x32')](_0x176d74)[_0x79d2('0xb')](function(_0x1261c5){_0x1e02d6[_0x79d2('0x33')]({'id':_0x867957['id'],'token':_0x1261c5,'statusCall':'','isAlreadyLogged':_0x867957[_0x79d2('0x34')]});});}})(_0x2f0c6b,_0x1e02d6,_0x5dc7d6);};exports['forgot']=function(_0x183da7,_0x2470a5){if(!_0x183da7['body'][_0x79d2('0x25')]){return handleError(_0x2470a5,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x4141c8=rs[_0x79d2('0x35')]();_0x183da7['body']['email']=_0x183da7['body'][_0x79d2('0x25')][_0x79d2('0x36')]()[_0x79d2('0x37')]();var _0x510a2b;return db[_0x79d2('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0x79d2('0x9'),_0x79d2('0xa')],'raw':!![]})['then'](function(_0x27a339){_0x510a2b=_0x27a339;return db[_0x79d2('0x38')][_0x79d2('0x1e')]({'where':{'email':_0x183da7[_0x79d2('0x39')]['email']}});})['then'](function(_0x364353){if(!_0x364353){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x364353[_0x79d2('0x10')]){throw new Error(_0x79d2('0x3a'));}if(_0x364353[_0x79d2('0x17')]){if(moment(_0x364353[_0x79d2('0x11')])[_0x79d2('0x18')](_0x510a2b[_0x79d2('0xa')],'minutes')>moment()){throw new Error(_0x79d2('0x3b'));}else{_0x364353[_0x79d2('0x17')]=![];_0x364353[_0x79d2('0x11')]=null;}}_0x364353[_0x79d2('0x3c')]=_0x4141c8;_0x364353[_0x79d2('0x3d')]=Date[_0x79d2('0x3e')]()+0x36ee80;return _0x364353[_0x79d2('0x3f')]();})[_0x79d2('0xb')](function(){return sendServiceMail({'to':_0x183da7[_0x79d2('0x39')][_0x79d2('0x25')],'subject':_0x79d2('0x40'),'text':_0x79d2('0x41')+_0x79d2('0x42')+_0x79d2('0x43')+_0x183da7[_0x79d2('0x44')][_0x79d2('0x45')]+_0x79d2('0x46')+_0x4141c8+'\x0a\x0a'+_0x79d2('0x47')});})[_0x79d2('0xb')](function(){_0x2470a5['status'](0xc8)[_0x79d2('0x2e')]({'message':_0x79d2('0x48')});})[_0x79d2('0x1c')](function(_0x382434){return handleError(_0x2470a5,0x1f4,_0x382434);});};exports[_0x79d2('0x49')]=function(_0x43994c,_0x56586d){return db['User'][_0x79d2('0x1e')]({'where':{'resetPasswordToken':_0x43994c[_0x79d2('0x4a')][_0x79d2('0x4b')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x79d2('0xb')](function(_0x5e9171){if(!_0x5e9171){throw new Error(_0x79d2('0x4c'));}return db[_0x79d2('0x8')][_0x79d2('0xc')]({'attributes':['id',_0x79d2('0x4d'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x79d2('0xb')](function(_0x9bf9c2){if(_0x9bf9c2[_0x79d2('0x4d')])authService[_0x79d2('0x4e')](_0x43994c[_0x79d2('0x39')][_0x79d2('0x4f')]);if(!_0x9bf9c2[_0x79d2('0x50')]||!_0x5e9171['previousPasswords'])return _0x5e9171;authService[_0x79d2('0x51')](_0x43994c[_0x79d2('0x39')][_0x79d2('0x4f')],_0x5e9171[_0x79d2('0x52')],_0x9bf9c2[_0x79d2('0x53')]);return _0x5e9171;})['then'](function(){_0x5e9171[_0x79d2('0x4f')]=_0x43994c['body'][_0x79d2('0x4f')];_0x5e9171[_0x79d2('0x3c')]=null;_0x5e9171['resetPasswordExpires']=null;return _0x5e9171[_0x79d2('0x3f')]();});})[_0x79d2('0xb')](function(){_0x56586d['status'](0xc8)[_0x79d2('0x2e')]({'message':'Password\x20reset!'});})['catch'](function(_0x7ba7aa){return handleError(_0x56586d,0x1f4,_0x7ba7aa);});};passport[_0x79d2('0x54')](_0x79d2('0x30'),new LocalStrategy({'usernameField':_0x79d2('0xd'),'passwordField':'password'},function(_0x10b13f,_0x2186de,_0x2fb732){return localAuthenticate(db[_0x79d2('0x38')],_0x10b13f,_0x2186de,_0x2fb732);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 436bb8f..d39329e 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 _0xe48a=['Router','./authLocal.controller','post','login','/forgot','/reset/:token','reset'];(function(_0x323d87,_0x4ef3f9){var _0x5e8f74=function(_0x185735){while(--_0x185735){_0x323d87['push'](_0x323d87['shift']());}};_0x5e8f74(++_0x4ef3f9);}(_0xe48a,0x1e3));var _0xae48=function(_0xf43cb,_0x465374){_0xf43cb=_0xf43cb-0x0;var _0x14e869=_0xe48a[_0xf43cb];return _0x14e869;};'use strict';var express=require('express');var router=express[_0xae48('0x0')]();var controller=require(_0xae48('0x1'));router[_0xae48('0x2')]('/',controller[_0xae48('0x3')]);router[_0xae48('0x2')](_0xae48('0x4'),controller['forgot']);router['post'](_0xae48('0x5'),controller[_0xae48('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0x248c=['/reset/:token','exports','express','Router','./authLocal.controller','post','login','forgot'];(function(_0x1c95d5,_0xc1059b){var _0x20f69b=function(_0x18128b){while(--_0x18128b){_0x1c95d5['push'](_0x1c95d5['shift']());}};_0x20f69b(++_0xc1059b);}(_0x248c,0x10a));var _0xc248=function(_0x18b42a,_0x226226){_0x18b42a=_0x18b42a-0x0;var _0x4e3ed3=_0x248c[_0x18b42a];return _0x4e3ed3;};'use strict';var express=require(_0xc248('0x0'));var router=express[_0xc248('0x1')]();var controller=require(_0xc248('0x2'));router[_0xc248('0x3')]('/',controller[_0xc248('0x4')]);router['post']('/forgot',controller[_0xc248('0x5')]);router[_0xc248('0x3')](_0xc248('0x6'),controller['reset']);module[_0xc248('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 39d2a12..e9a42cb 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 _0xee69=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x2aa997,_0x35e10a){var _0x279a25=function(_0x45d656){while(--_0x45d656){_0x2aa997['push'](_0x2aa997['shift']());}};_0x279a25(++_0x35e10a);}(_0xee69,0x92));var _0x9ee6=function(_0x1327c6,_0x5ccd76){_0x1327c6=_0x1327c6-0x0;var _0x2cadd2=_0xee69[_0x1327c6];return _0x2cadd2;};'use strict';var Sequelize=require(_0x9ee6('0x0'));module[_0x9ee6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x9ee6('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x9ee6('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9ee6('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x042a=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x2e54cb,_0x268ff3){var _0x2aedfc=function(_0x3a05e3){while(--_0x3a05e3){_0x2e54cb['push'](_0x2e54cb['shift']());}};_0x2aedfc(++_0x268ff3);}(_0x042a,0x14c));var _0xa042=function(_0x4f993a,_0x1f3a4b){_0x4f993a=_0x4f993a-0x0;var _0xaaaef6=_0x042a[_0x4f993a];return _0xaaaef6;};'use strict';var Sequelize=require(_0xa042('0x0'));module[_0xa042('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xa042('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xa042('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xa042('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 529f4bc..05342e1 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 _0xbd66=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','update','Condition','addConditions','ids','getConditions','findOne','rawAttributes','order','addActions','Action','omit','getActions','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','stack','name','send','map','Automation','fieldName','type'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xbd66,0x177));var _0x6bd6=function(_0x55e12b,_0x3bbb99){_0x55e12b=_0x55e12b-0x0;var _0x507b79=_0xbd66[_0x55e12b];return _0x507b79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6bd6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6bd6('0x1'));var moment=require(_0x6bd6('0x2'));var BPromise=require(_0x6bd6('0x3'));var Mustache=require(_0x6bd6('0x4'));var util=require('util');var path=require(_0x6bd6('0x5'));var sox=require(_0x6bd6('0x6'));var csv=require('to-csv');var ejs=require(_0x6bd6('0x7'));var fs=require('fs');var fs_extra=require(_0x6bd6('0x8'));var _=require(_0x6bd6('0x9'));var squel=require(_0x6bd6('0xa'));var crypto=require(_0x6bd6('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6bd6('0xc'));var querystring=require('querystring');var Papa=require(_0x6bd6('0xd'));var Redis=require(_0x6bd6('0xe'));var authService=require(_0x6bd6('0xf'));var qs=require(_0x6bd6('0x10'));var as=require(_0x6bd6('0x11'));var hardwareService=require(_0x6bd6('0x12'));var logger=require(_0x6bd6('0x13'))(_0x6bd6('0x14'));var utils=require(_0x6bd6('0x15'));var config=require(_0x6bd6('0x16'));var licenseUtil=require(_0x6bd6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bccfd,_0x305a90){_0x305a90=_0x305a90||0xcc;return function(_0x1272db){if(_0x1272db){return _0x1bccfd[_0x6bd6('0x18')](_0x305a90);}return _0x1bccfd['status'](_0x305a90)[_0x6bd6('0x19')]();};}function respondWithResult(_0x1f7973,_0x4157ab){_0x4157ab=_0x4157ab||0xc8;return function(_0x3befd3){if(_0x3befd3){return _0x1f7973[_0x6bd6('0x1a')](_0x4157ab)[_0x6bd6('0x1b')](_0x3befd3);}};}function respondWithFilteredResult(_0x3a4b3c,_0x3cfd0f){return function(_0xd1cd14){if(_0xd1cd14){var _0x5a877b=typeof _0x3cfd0f[_0x6bd6('0x1c')]===_0x6bd6('0x1d')&&typeof _0x3cfd0f[_0x6bd6('0x1e')]===_0x6bd6('0x1d');var _0x328cbd=_0xd1cd14[_0x6bd6('0x1f')];var _0x2adb33=_0x5a877b?0x0:_0x3cfd0f[_0x6bd6('0x1c')];var _0x31173b=_0x5a877b?_0xd1cd14['count']:_0x3cfd0f[_0x6bd6('0x1c')]+_0x3cfd0f['limit'];var _0xa31c8f;if(_0x31173b>=_0x328cbd){_0x31173b=_0x328cbd;_0xa31c8f=0xc8;}else{_0xa31c8f=0xce;}_0x3a4b3c['status'](_0xa31c8f);return _0x3a4b3c[_0x6bd6('0x20')](_0x6bd6('0x21'),_0x2adb33+'-'+_0x31173b+'/'+_0x328cbd)['json'](_0xd1cd14);}return null;};}function patchUpdates(_0xbacccf){return function(_0x67243d){try{jsonpatch[_0x6bd6('0x22')](_0x67243d,_0xbacccf,!![]);}catch(_0x47ad83){return BPromise['reject'](_0x47ad83);}return _0x67243d['save']();};}function saveUpdates(_0x8e9b11,_0x16683d){return function(_0x294c09){if(_0x294c09){return _0x294c09['update'](_0x8e9b11)[_0x6bd6('0x23')](function(_0x2eb33e){return _0x2eb33e;});}return null;};}function removeEntity(_0x236fa4,_0x12392e){return function(_0x1dc809){if(_0x1dc809){return _0x1dc809[_0x6bd6('0x24')]()['then'](function(){_0x236fa4['status'](0xcc)[_0x6bd6('0x19')]();});}};}function handleEntityNotFound(_0x3f43d4,_0x4c5d25){return function(_0xcceb51){if(!_0xcceb51){_0x3f43d4[_0x6bd6('0x18')](0x194);}return _0xcceb51;};}function handleError(_0x195c26,_0x2971aa){_0x2971aa=_0x2971aa||0x1f4;return function(_0x34721f){logger[_0x6bd6('0x25')](_0x34721f[_0x6bd6('0x26')]);if(_0x34721f[_0x6bd6('0x27')]){delete _0x34721f[_0x6bd6('0x27')];}_0x195c26['status'](_0x2971aa)[_0x6bd6('0x28')](_0x34721f);};}exports['index']=function(_0x366f12,_0x52a656){var _0x23aa16={},_0x437447={},_0xd657f7={'count':0x0,'rows':[]};var _0x28a608=_[_0x6bd6('0x29')](db[_0x6bd6('0x2a')]['rawAttributes'],function(_0x5c8346){return{'name':_0x5c8346[_0x6bd6('0x2b')],'type':_0x5c8346[_0x6bd6('0x2c')][_0x6bd6('0x2d')]};});_0x437447[_0x6bd6('0x2e')]=_[_0x6bd6('0x29')](_0x28a608,_0x6bd6('0x27'));_0x437447[_0x6bd6('0x2f')]=_[_0x6bd6('0x30')](_0x366f12[_0x6bd6('0x2f')]);_0x437447[_0x6bd6('0x31')]=_[_0x6bd6('0x32')](_0x437447[_0x6bd6('0x2e')],_0x437447[_0x6bd6('0x2f')]);_0x23aa16[_0x6bd6('0x33')]=_['intersection'](_0x437447[_0x6bd6('0x2e')],qs['fields'](_0x366f12[_0x6bd6('0x2f')][_0x6bd6('0x34')]));_0x23aa16[_0x6bd6('0x33')]=_0x23aa16['attributes'][_0x6bd6('0x35')]?_0x23aa16['attributes']:_0x437447[_0x6bd6('0x2e')];if(!_0x366f12[_0x6bd6('0x2f')][_0x6bd6('0x36')](_0x6bd6('0x37'))){_0x23aa16[_0x6bd6('0x1e')]=qs[_0x6bd6('0x1e')](_0x366f12[_0x6bd6('0x2f')]['limit']);_0x23aa16[_0x6bd6('0x1c')]=qs[_0x6bd6('0x1c')](_0x366f12[_0x6bd6('0x2f')][_0x6bd6('0x1c')]);}_0x23aa16['order']=qs['sort'](_0x366f12[_0x6bd6('0x2f')][_0x6bd6('0x38')]);_0x23aa16[_0x6bd6('0x39')]=qs['filters'](_[_0x6bd6('0x3a')](_0x366f12[_0x6bd6('0x2f')],_0x437447[_0x6bd6('0x31')]),_0x28a608);if(_0x366f12[_0x6bd6('0x2f')][_0x6bd6('0x3b')]){_0x23aa16[_0x6bd6('0x39')]=_[_0x6bd6('0x3c')](_0x23aa16[_0x6bd6('0x39')],{'$or':_['map'](_0x28a608,function(_0x355946){if(_0x355946[_0x6bd6('0x2c')]!=='VIRTUAL'){var _0x91849e={};_0x91849e[_0x355946[_0x6bd6('0x27')]]={'$like':'%'+_0x366f12[_0x6bd6('0x2f')][_0x6bd6('0x3b')]+'%'};return _0x91849e;}})});}_0x23aa16=_[_0x6bd6('0x3c')]({},_0x23aa16,_0x366f12[_0x6bd6('0x3d')]);var _0x56ab41={'where':_0x23aa16[_0x6bd6('0x39')]};return db[_0x6bd6('0x2a')][_0x6bd6('0x1f')](_0x56ab41)[_0x6bd6('0x23')](function(_0x1bf5ba){_0xd657f7[_0x6bd6('0x1f')]=_0x1bf5ba;if(_0x366f12[_0x6bd6('0x2f')]['includeAll']){_0x23aa16[_0x6bd6('0x3e')]=[{'all':!![]}];}return db[_0x6bd6('0x2a')][_0x6bd6('0x3f')](_0x23aa16);})['then'](function(_0x2b3ac8){_0xd657f7[_0x6bd6('0x40')]=_0x2b3ac8;return _0xd657f7;})[_0x6bd6('0x23')](respondWithFilteredResult(_0x52a656,_0x23aa16))['catch'](handleError(_0x52a656,null));};exports[_0x6bd6('0x41')]=function(_0x98f6f0,_0x1b67ea){var _0x67ccaa={'raw':![],'where':{'id':_0x98f6f0[_0x6bd6('0x42')]['id']}},_0xb118fb={};_0xb118fb[_0x6bd6('0x2e')]=_['keys'](db[_0x6bd6('0x2a')]['rawAttributes']);_0xb118fb['query']=_[_0x6bd6('0x30')](_0x98f6f0[_0x6bd6('0x2f')]);_0xb118fb[_0x6bd6('0x31')]=_[_0x6bd6('0x32')](_0xb118fb['model'],_0xb118fb['query']);_0x67ccaa[_0x6bd6('0x33')]=_[_0x6bd6('0x32')](_0xb118fb[_0x6bd6('0x2e')],qs[_0x6bd6('0x34')](_0x98f6f0[_0x6bd6('0x2f')]['fields']));_0x67ccaa[_0x6bd6('0x33')]=_0x67ccaa[_0x6bd6('0x33')]['length']?_0x67ccaa[_0x6bd6('0x33')]:_0xb118fb['model'];if(_0x98f6f0[_0x6bd6('0x2f')][_0x6bd6('0x43')]){_0x67ccaa[_0x6bd6('0x3e')]=[{'all':!![]}];}_0x67ccaa=_[_0x6bd6('0x3c')]({},_0x67ccaa,_0x98f6f0['options']);return db[_0x6bd6('0x2a')][_0x6bd6('0x44')](_0x67ccaa)[_0x6bd6('0x23')](handleEntityNotFound(_0x1b67ea,null))[_0x6bd6('0x23')](respondWithResult(_0x1b67ea,null))[_0x6bd6('0x45')](handleError(_0x1b67ea,null));};exports['create']=function(_0x36f23b,_0x8cbe){return db[_0x6bd6('0x2a')][_0x6bd6('0x46')](_0x36f23b[_0x6bd6('0x47')],{})[_0x6bd6('0x23')](respondWithResult(_0x8cbe,0xc9))['catch'](handleError(_0x8cbe,null));};exports[_0x6bd6('0x48')]=function(_0x36226b,_0x4aee5e){if(_0x36226b[_0x6bd6('0x47')]['id']){delete _0x36226b[_0x6bd6('0x47')]['id'];}return db[_0x6bd6('0x2a')][_0x6bd6('0x44')]({'where':{'id':_0x36226b['params']['id']}})['then'](handleEntityNotFound(_0x4aee5e,null))['then'](saveUpdates(_0x36226b[_0x6bd6('0x47')],null))[_0x6bd6('0x23')](respondWithResult(_0x4aee5e,null))['catch'](handleError(_0x4aee5e,null));};exports[_0x6bd6('0x24')]=function(_0x114aad,_0x521042){return db['Automation']['find']({'where':{'id':_0x114aad[_0x6bd6('0x42')]['id']}})[_0x6bd6('0x23')](handleEntityNotFound(_0x521042,null))[_0x6bd6('0x23')](removeEntity(_0x521042,null))[_0x6bd6('0x45')](handleError(_0x521042,null));};exports['addConditions']=function(_0x16d0f8,_0x5e8fb6,_0x36d4c6){return db[_0x6bd6('0x49')][_0x6bd6('0x44')]({'where':{'id':_0x16d0f8[_0x6bd6('0x42')]['id']}})[_0x6bd6('0x23')](handleEntityNotFound(_0x5e8fb6,null))['then'](function(_0x495aba){if(_0x495aba){return _0x495aba[_0x6bd6('0x4a')](_0x16d0f8['body'][_0x6bd6('0x4b')],_['omit'](_0x16d0f8[_0x6bd6('0x47')],[_0x6bd6('0x4b'),'id'])||{});}})[_0x6bd6('0x23')](respondWithResult(_0x5e8fb6,null))[_0x6bd6('0x45')](handleError(_0x5e8fb6,null));};exports[_0x6bd6('0x4c')]=function(_0x4fd146,_0xe540a1,_0x5335a4){var _0x18db85={};var _0x21ddbc={};var _0x2dbbb1;var _0x2af209;return db['Automation'][_0x6bd6('0x4d')]({'where':{'id':_0x4fd146['params']['id']}})[_0x6bd6('0x23')](handleEntityNotFound(_0xe540a1,null))[_0x6bd6('0x23')](function(_0x400aa6){if(_0x400aa6){_0x2dbbb1=_0x400aa6;_0x21ddbc[_0x6bd6('0x2e')]=_[_0x6bd6('0x30')](db['Condition'][_0x6bd6('0x4e')]);_0x21ddbc[_0x6bd6('0x2f')]=_[_0x6bd6('0x30')](_0x4fd146[_0x6bd6('0x2f')]);_0x21ddbc['filters']=_[_0x6bd6('0x32')](_0x21ddbc[_0x6bd6('0x2e')],_0x21ddbc[_0x6bd6('0x2f')]);_0x18db85[_0x6bd6('0x33')]=_[_0x6bd6('0x32')](_0x21ddbc[_0x6bd6('0x2e')],qs[_0x6bd6('0x34')](_0x4fd146[_0x6bd6('0x2f')][_0x6bd6('0x34')]));_0x18db85['attributes']=_0x18db85[_0x6bd6('0x33')][_0x6bd6('0x35')]?_0x18db85[_0x6bd6('0x33')]:_0x21ddbc[_0x6bd6('0x2e')];_0x18db85[_0x6bd6('0x4f')]=qs[_0x6bd6('0x38')](_0x4fd146[_0x6bd6('0x2f')][_0x6bd6('0x38')]);_0x18db85['where']=qs[_0x6bd6('0x31')](_[_0x6bd6('0x3a')](_0x4fd146[_0x6bd6('0x2f')],_0x21ddbc[_0x6bd6('0x31')]));if(_0x4fd146['query'][_0x6bd6('0x3b')]){_0x18db85[_0x6bd6('0x39')]=_[_0x6bd6('0x3c')](_0x18db85['where'],{'$or':_[_0x6bd6('0x29')](_0x18db85[_0x6bd6('0x33')],function(_0x53f2a6){var _0x39b60b={};_0x39b60b[_0x53f2a6]={'$like':'%'+_0x4fd146[_0x6bd6('0x2f')][_0x6bd6('0x3b')]+'%'};return _0x39b60b;})});}_0x18db85=_[_0x6bd6('0x3c')]({},_0x18db85,_0x4fd146[_0x6bd6('0x3d')]);return _0x2dbbb1[_0x6bd6('0x4c')](_0x18db85);}})['then'](function(_0x3a82d0){if(_0x3a82d0){_0x2af209=_0x3a82d0[_0x6bd6('0x35')];if(!_0x4fd146[_0x6bd6('0x2f')][_0x6bd6('0x36')](_0x6bd6('0x37'))){_0x18db85['limit']=qs[_0x6bd6('0x1e')](_0x4fd146[_0x6bd6('0x2f')][_0x6bd6('0x1e')]);_0x18db85[_0x6bd6('0x1c')]=qs[_0x6bd6('0x1c')](_0x4fd146[_0x6bd6('0x2f')][_0x6bd6('0x1c')]);}return _0x2dbbb1['getConditions'](_0x18db85);}})['then'](function(_0x2002af){if(_0x2002af){return _0x2002af?{'count':_0x2af209,'rows':_0x2002af}:null;}})[_0x6bd6('0x23')](respondWithResult(_0xe540a1,null))[_0x6bd6('0x45')](handleError(_0xe540a1,null));};exports[_0x6bd6('0x50')]=function(_0x2602ee,_0x15503b,_0x30b2c2){return db[_0x6bd6('0x51')][_0x6bd6('0x44')]({'where':{'id':_0x2602ee[_0x6bd6('0x42')]['id']}})[_0x6bd6('0x23')](handleEntityNotFound(_0x15503b,null))[_0x6bd6('0x23')](function(_0x201c92){if(_0x201c92){return _0x201c92['addActions'](_0x2602ee[_0x6bd6('0x47')][_0x6bd6('0x4b')],_[_0x6bd6('0x52')](_0x2602ee[_0x6bd6('0x47')],[_0x6bd6('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x15503b,null))[_0x6bd6('0x45')](handleError(_0x15503b,null));};exports[_0x6bd6('0x53')]=function(_0x10ae88,_0xeb87ed,_0x571467){var _0x38cb96={};var _0x3bb52d={};var _0x1a2d93;var _0x252f13;return db[_0x6bd6('0x2a')]['findOne']({'where':{'id':_0x10ae88[_0x6bd6('0x42')]['id']}})[_0x6bd6('0x23')](handleEntityNotFound(_0xeb87ed,null))[_0x6bd6('0x23')](function(_0x3706da){if(_0x3706da){_0x1a2d93=_0x3706da;_0x3bb52d[_0x6bd6('0x2e')]=_[_0x6bd6('0x30')](db[_0x6bd6('0x51')][_0x6bd6('0x4e')]);_0x3bb52d[_0x6bd6('0x2f')]=_[_0x6bd6('0x30')](_0x10ae88['query']);_0x3bb52d[_0x6bd6('0x31')]=_[_0x6bd6('0x32')](_0x3bb52d[_0x6bd6('0x2e')],_0x3bb52d[_0x6bd6('0x2f')]);_0x38cb96[_0x6bd6('0x33')]=_[_0x6bd6('0x32')](_0x3bb52d['model'],qs[_0x6bd6('0x34')](_0x10ae88['query'][_0x6bd6('0x34')]));_0x38cb96['attributes']=_0x38cb96[_0x6bd6('0x33')][_0x6bd6('0x35')]?_0x38cb96['attributes']:_0x3bb52d['model'];_0x38cb96['order']=qs[_0x6bd6('0x38')](_0x10ae88[_0x6bd6('0x2f')][_0x6bd6('0x38')]);_0x38cb96[_0x6bd6('0x39')]=qs[_0x6bd6('0x31')](_[_0x6bd6('0x3a')](_0x10ae88[_0x6bd6('0x2f')],_0x3bb52d['filters']));if(_0x10ae88['query']['filter']){_0x38cb96[_0x6bd6('0x39')]=_['merge'](_0x38cb96['where'],{'$or':_[_0x6bd6('0x29')](_0x38cb96[_0x6bd6('0x33')],function(_0x43c648){var _0x519671={};_0x519671[_0x43c648]={'$like':'%'+_0x10ae88[_0x6bd6('0x2f')][_0x6bd6('0x3b')]+'%'};return _0x519671;})});}_0x38cb96=_[_0x6bd6('0x3c')]({},_0x38cb96,_0x10ae88[_0x6bd6('0x3d')]);return _0x1a2d93['getActions'](_0x38cb96);}})[_0x6bd6('0x23')](function(_0x441f04){if(_0x441f04){_0x252f13=_0x441f04[_0x6bd6('0x35')];if(!_0x10ae88[_0x6bd6('0x2f')][_0x6bd6('0x36')](_0x6bd6('0x37'))){_0x38cb96[_0x6bd6('0x1e')]=qs['limit'](_0x10ae88['query'][_0x6bd6('0x1e')]);_0x38cb96['offset']=qs[_0x6bd6('0x1c')](_0x10ae88[_0x6bd6('0x2f')][_0x6bd6('0x1c')]);}return _0x1a2d93[_0x6bd6('0x53')](_0x38cb96);}})[_0x6bd6('0x23')](function(_0x2f7303){if(_0x2f7303){return _0x2f7303?{'count':_0x252f13,'rows':_0x2f7303}:null;}})[_0x6bd6('0x23')](respondWithResult(_0xeb87ed,null))[_0x6bd6('0x45')](handleError(_0xeb87ed,null));};
\ No newline at end of file
+var _0xade5=['limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','intersection','include','merge','find','create','update','body','addConditions','ids','omit','findOne','Condition','order','getConditions','Action','addActions','getActions','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x5b7eee,_0x50f167){var _0x506ad8=function(_0x11edcd){while(--_0x11edcd){_0x5b7eee['push'](_0x5b7eee['shift']());}};_0x506ad8(++_0x50f167);}(_0xade5,0x143));var _0x5ade=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xade5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ade('0x0'));var zipdir=require(_0x5ade('0x1'));var jsonpatch=require(_0x5ade('0x2'));var rp=require(_0x5ade('0x3'));var moment=require(_0x5ade('0x4'));var BPromise=require(_0x5ade('0x5'));var Mustache=require('mustache');var util=require(_0x5ade('0x6'));var path=require(_0x5ade('0x7'));var sox=require(_0x5ade('0x8'));var csv=require(_0x5ade('0x9'));var ejs=require(_0x5ade('0xa'));var fs=require('fs');var fs_extra=require(_0x5ade('0xb'));var _=require(_0x5ade('0xc'));var squel=require(_0x5ade('0xd'));var crypto=require(_0x5ade('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5ade('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5ade('0x10'));var Papa=require(_0x5ade('0x11'));var Redis=require(_0x5ade('0x12'));var authService=require(_0x5ade('0x13'));var qs=require(_0x5ade('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ade('0x15'));var logger=require(_0x5ade('0x16'))(_0x5ade('0x17'));var utils=require(_0x5ade('0x18'));var config=require(_0x5ade('0x19'));var licenseUtil=require(_0x5ade('0x1a'));var db=require(_0x5ade('0x1b'))['db'];function respondWithStatusCode(_0x2b51da,_0x35f52a){_0x35f52a=_0x35f52a||0xcc;return function(_0x2a7393){if(_0x2a7393){return _0x2b51da[_0x5ade('0x1c')](_0x35f52a);}return _0x2b51da[_0x5ade('0x1d')](_0x35f52a)[_0x5ade('0x1e')]();};}function respondWithResult(_0x34c9ad,_0x10f676){_0x10f676=_0x10f676||0xc8;return function(_0x8bdf90){if(_0x8bdf90){return _0x34c9ad[_0x5ade('0x1d')](_0x10f676)[_0x5ade('0x1f')](_0x8bdf90);}};}function respondWithFilteredResult(_0x3d19fa,_0x1dc8b3){return function(_0xf6a03c){if(_0xf6a03c){var _0x17ea65=typeof _0x1dc8b3[_0x5ade('0x20')]==='undefined'&&typeof _0x1dc8b3['limit']==='undefined';var _0x2f1f79=_0xf6a03c['count'];var _0x451d8a=_0x17ea65?0x0:_0x1dc8b3[_0x5ade('0x20')];var _0x5d0c48=_0x17ea65?_0xf6a03c['count']:_0x1dc8b3['offset']+_0x1dc8b3[_0x5ade('0x21')];var _0x102b79;if(_0x5d0c48>=_0x2f1f79){_0x5d0c48=_0x2f1f79;_0x102b79=0xc8;}else{_0x102b79=0xce;}_0x3d19fa['status'](_0x102b79);return _0x3d19fa[_0x5ade('0x22')](_0x5ade('0x23'),_0x451d8a+'-'+_0x5d0c48+'/'+_0x2f1f79)[_0x5ade('0x1f')](_0xf6a03c);}return null;};}function patchUpdates(_0x2ff7ec){return function(_0x208ee9){try{jsonpatch[_0x5ade('0x24')](_0x208ee9,_0x2ff7ec,!![]);}catch(_0x47c080){return BPromise[_0x5ade('0x25')](_0x47c080);}return _0x208ee9['save']();};}function saveUpdates(_0x367dcc,_0x56923d){return function(_0x3344ac){if(_0x3344ac){return _0x3344ac['update'](_0x367dcc)[_0x5ade('0x26')](function(_0x170102){return _0x170102;});}return null;};}function removeEntity(_0x1a8da4,_0x2741fa){return function(_0x4dcb26){if(_0x4dcb26){return _0x4dcb26[_0x5ade('0x27')]()['then'](function(){_0x1a8da4[_0x5ade('0x1d')](0xcc)[_0x5ade('0x1e')]();});}};}function handleEntityNotFound(_0x5cca47,_0x16b6a0){return function(_0x731eed){if(!_0x731eed){_0x5cca47['sendStatus'](0x194);}return _0x731eed;};}function handleError(_0x4f9628,_0x144dd0){_0x144dd0=_0x144dd0||0x1f4;return function(_0x27db87){logger[_0x5ade('0x28')](_0x27db87[_0x5ade('0x29')]);if(_0x27db87[_0x5ade('0x2a')]){delete _0x27db87[_0x5ade('0x2a')];}_0x4f9628[_0x5ade('0x1d')](_0x144dd0)[_0x5ade('0x2b')](_0x27db87);};}exports[_0x5ade('0x2c')]=function(_0x367c94,_0x4f6878){var _0x358c5b={},_0x3b6f2a={},_0x3887c8={'count':0x0,'rows':[]};var _0x154252=_['map'](db[_0x5ade('0x2d')][_0x5ade('0x2e')],function(_0x470be4){return{'name':_0x470be4[_0x5ade('0x2f')],'type':_0x470be4[_0x5ade('0x30')]['key']};});_0x3b6f2a[_0x5ade('0x31')]=_['map'](_0x154252,_0x5ade('0x2a'));_0x3b6f2a['query']=_[_0x5ade('0x32')](_0x367c94[_0x5ade('0x33')]);_0x3b6f2a[_0x5ade('0x34')]=_['intersection'](_0x3b6f2a[_0x5ade('0x31')],_0x3b6f2a['query']);_0x358c5b[_0x5ade('0x35')]=_['intersection'](_0x3b6f2a[_0x5ade('0x31')],qs[_0x5ade('0x36')](_0x367c94[_0x5ade('0x33')]['fields']));_0x358c5b['attributes']=_0x358c5b[_0x5ade('0x35')][_0x5ade('0x37')]?_0x358c5b[_0x5ade('0x35')]:_0x3b6f2a[_0x5ade('0x31')];if(!_0x367c94[_0x5ade('0x33')][_0x5ade('0x38')](_0x5ade('0x39'))){_0x358c5b['limit']=qs[_0x5ade('0x21')](_0x367c94[_0x5ade('0x33')][_0x5ade('0x21')]);_0x358c5b[_0x5ade('0x20')]=qs[_0x5ade('0x20')](_0x367c94[_0x5ade('0x33')][_0x5ade('0x20')]);}_0x358c5b['order']=qs[_0x5ade('0x3a')](_0x367c94[_0x5ade('0x33')][_0x5ade('0x3a')]);_0x358c5b[_0x5ade('0x3b')]=qs[_0x5ade('0x34')](_[_0x5ade('0x3c')](_0x367c94['query'],_0x3b6f2a[_0x5ade('0x34')]),_0x154252);if(_0x367c94[_0x5ade('0x33')][_0x5ade('0x3d')]){_0x358c5b[_0x5ade('0x3b')]=_['merge'](_0x358c5b[_0x5ade('0x3b')],{'$or':_['map'](_0x154252,function(_0x4c980a){if(_0x4c980a['type']!==_0x5ade('0x3e')){var _0x523c26={};_0x523c26[_0x4c980a[_0x5ade('0x2a')]]={'$like':'%'+_0x367c94['query'][_0x5ade('0x3d')]+'%'};return _0x523c26;}})});}_0x358c5b=_['merge']({},_0x358c5b,_0x367c94[_0x5ade('0x3f')]);var _0x1b7d63={'where':_0x358c5b['where']};return db[_0x5ade('0x2d')][_0x5ade('0x40')](_0x1b7d63)[_0x5ade('0x26')](function(_0x4ded5c){_0x3887c8[_0x5ade('0x40')]=_0x4ded5c;if(_0x367c94['query'][_0x5ade('0x41')]){_0x358c5b['include']=[{'all':!![]}];}return db[_0x5ade('0x2d')][_0x5ade('0x42')](_0x358c5b);})[_0x5ade('0x26')](function(_0x4c6fe4){_0x3887c8[_0x5ade('0x43')]=_0x4c6fe4;return _0x3887c8;})[_0x5ade('0x26')](respondWithFilteredResult(_0x4f6878,_0x358c5b))[_0x5ade('0x44')](handleError(_0x4f6878,null));};exports[_0x5ade('0x45')]=function(_0x55038a,_0x25a3dd){var _0x4b184d={'raw':![],'where':{'id':_0x55038a[_0x5ade('0x46')]['id']}},_0x1be665={};_0x1be665[_0x5ade('0x31')]=_[_0x5ade('0x32')](db[_0x5ade('0x2d')][_0x5ade('0x2e')]);_0x1be665['query']=_['keys'](_0x55038a[_0x5ade('0x33')]);_0x1be665[_0x5ade('0x34')]=_[_0x5ade('0x47')](_0x1be665[_0x5ade('0x31')],_0x1be665[_0x5ade('0x33')]);_0x4b184d[_0x5ade('0x35')]=_[_0x5ade('0x47')](_0x1be665[_0x5ade('0x31')],qs[_0x5ade('0x36')](_0x55038a[_0x5ade('0x33')][_0x5ade('0x36')]));_0x4b184d[_0x5ade('0x35')]=_0x4b184d[_0x5ade('0x35')][_0x5ade('0x37')]?_0x4b184d['attributes']:_0x1be665[_0x5ade('0x31')];if(_0x55038a[_0x5ade('0x33')][_0x5ade('0x41')]){_0x4b184d[_0x5ade('0x48')]=[{'all':!![]}];}_0x4b184d=_[_0x5ade('0x49')]({},_0x4b184d,_0x55038a[_0x5ade('0x3f')]);return db[_0x5ade('0x2d')][_0x5ade('0x4a')](_0x4b184d)['then'](handleEntityNotFound(_0x25a3dd,null))[_0x5ade('0x26')](respondWithResult(_0x25a3dd,null))[_0x5ade('0x44')](handleError(_0x25a3dd,null));};exports[_0x5ade('0x4b')]=function(_0x169317,_0x441cc2){return db[_0x5ade('0x2d')][_0x5ade('0x4b')](_0x169317['body'],{})[_0x5ade('0x26')](respondWithResult(_0x441cc2,0xc9))['catch'](handleError(_0x441cc2,null));};exports[_0x5ade('0x4c')]=function(_0x3fcbb8,_0x593df1){if(_0x3fcbb8['body']['id']){delete _0x3fcbb8[_0x5ade('0x4d')]['id'];}return db[_0x5ade('0x2d')][_0x5ade('0x4a')]({'where':{'id':_0x3fcbb8[_0x5ade('0x46')]['id']}})[_0x5ade('0x26')](handleEntityNotFound(_0x593df1,null))[_0x5ade('0x26')](saveUpdates(_0x3fcbb8[_0x5ade('0x4d')],null))[_0x5ade('0x26')](respondWithResult(_0x593df1,null))[_0x5ade('0x44')](handleError(_0x593df1,null));};exports['destroy']=function(_0x1253c4,_0x5c7f69){return db[_0x5ade('0x2d')][_0x5ade('0x4a')]({'where':{'id':_0x1253c4[_0x5ade('0x46')]['id']}})[_0x5ade('0x26')](handleEntityNotFound(_0x5c7f69,null))[_0x5ade('0x26')](removeEntity(_0x5c7f69,null))['catch'](handleError(_0x5c7f69,null));};exports[_0x5ade('0x4e')]=function(_0x50f4c2,_0x51c7ee,_0x135c2c){return db['Condition'][_0x5ade('0x4a')]({'where':{'id':_0x50f4c2[_0x5ade('0x46')]['id']}})[_0x5ade('0x26')](handleEntityNotFound(_0x51c7ee,null))['then'](function(_0x5b2e07){if(_0x5b2e07){return _0x5b2e07[_0x5ade('0x4e')](_0x50f4c2[_0x5ade('0x4d')][_0x5ade('0x4f')],_[_0x5ade('0x50')](_0x50f4c2['body'],[_0x5ade('0x4f'),'id'])||{});}})[_0x5ade('0x26')](respondWithResult(_0x51c7ee,null))[_0x5ade('0x44')](handleError(_0x51c7ee,null));};exports['getConditions']=function(_0x1a1a5d,_0x5514ba,_0xe31a5){var _0x4c382b={};var _0x42bd8c={};var _0x4aca4e;var _0x3ae420;return db[_0x5ade('0x2d')][_0x5ade('0x51')]({'where':{'id':_0x1a1a5d[_0x5ade('0x46')]['id']}})[_0x5ade('0x26')](handleEntityNotFound(_0x5514ba,null))[_0x5ade('0x26')](function(_0x33a1ee){if(_0x33a1ee){_0x4aca4e=_0x33a1ee;_0x42bd8c[_0x5ade('0x31')]=_[_0x5ade('0x32')](db[_0x5ade('0x52')][_0x5ade('0x2e')]);_0x42bd8c['query']=_[_0x5ade('0x32')](_0x1a1a5d[_0x5ade('0x33')]);_0x42bd8c[_0x5ade('0x34')]=_['intersection'](_0x42bd8c[_0x5ade('0x31')],_0x42bd8c['query']);_0x4c382b[_0x5ade('0x35')]=_['intersection'](_0x42bd8c[_0x5ade('0x31')],qs[_0x5ade('0x36')](_0x1a1a5d[_0x5ade('0x33')]['fields']));_0x4c382b[_0x5ade('0x35')]=_0x4c382b[_0x5ade('0x35')][_0x5ade('0x37')]?_0x4c382b[_0x5ade('0x35')]:_0x42bd8c[_0x5ade('0x31')];_0x4c382b[_0x5ade('0x53')]=qs['sort'](_0x1a1a5d[_0x5ade('0x33')][_0x5ade('0x3a')]);_0x4c382b['where']=qs[_0x5ade('0x34')](_['pick'](_0x1a1a5d[_0x5ade('0x33')],_0x42bd8c[_0x5ade('0x34')]));if(_0x1a1a5d[_0x5ade('0x33')][_0x5ade('0x3d')]){_0x4c382b[_0x5ade('0x3b')]=_['merge'](_0x4c382b['where'],{'$or':_['map'](_0x4c382b[_0x5ade('0x35')],function(_0x3dd551){var _0x485594={};_0x485594[_0x3dd551]={'$like':'%'+_0x1a1a5d[_0x5ade('0x33')][_0x5ade('0x3d')]+'%'};return _0x485594;})});}_0x4c382b=_[_0x5ade('0x49')]({},_0x4c382b,_0x1a1a5d[_0x5ade('0x3f')]);return _0x4aca4e[_0x5ade('0x54')](_0x4c382b);}})[_0x5ade('0x26')](function(_0x49487d){if(_0x49487d){_0x3ae420=_0x49487d[_0x5ade('0x37')];if(!_0x1a1a5d[_0x5ade('0x33')]['hasOwnProperty']('nolimit')){_0x4c382b[_0x5ade('0x21')]=qs[_0x5ade('0x21')](_0x1a1a5d[_0x5ade('0x33')][_0x5ade('0x21')]);_0x4c382b[_0x5ade('0x20')]=qs['offset'](_0x1a1a5d[_0x5ade('0x33')][_0x5ade('0x20')]);}return _0x4aca4e[_0x5ade('0x54')](_0x4c382b);}})[_0x5ade('0x26')](function(_0x3068ca){if(_0x3068ca){return _0x3068ca?{'count':_0x3ae420,'rows':_0x3068ca}:null;}})[_0x5ade('0x26')](respondWithResult(_0x5514ba,null))[_0x5ade('0x44')](handleError(_0x5514ba,null));};exports['addActions']=function(_0xe2090c,_0x240426,_0x15266c){return db[_0x5ade('0x55')]['find']({'where':{'id':_0xe2090c[_0x5ade('0x46')]['id']}})[_0x5ade('0x26')](handleEntityNotFound(_0x240426,null))[_0x5ade('0x26')](function(_0x53e25c){if(_0x53e25c){return _0x53e25c[_0x5ade('0x56')](_0xe2090c[_0x5ade('0x4d')][_0x5ade('0x4f')],_[_0x5ade('0x50')](_0xe2090c[_0x5ade('0x4d')],[_0x5ade('0x4f'),'id'])||{});}})[_0x5ade('0x26')](respondWithResult(_0x240426,null))[_0x5ade('0x44')](handleError(_0x240426,null));};exports[_0x5ade('0x57')]=function(_0x3045dc,_0x29fdc4,_0xca5ddf){var _0x5667c7={};var _0x2cfd2f={};var _0xc569df;var _0x299f15;return db[_0x5ade('0x2d')][_0x5ade('0x51')]({'where':{'id':_0x3045dc[_0x5ade('0x46')]['id']}})[_0x5ade('0x26')](handleEntityNotFound(_0x29fdc4,null))[_0x5ade('0x26')](function(_0x4f543d){if(_0x4f543d){_0xc569df=_0x4f543d;_0x2cfd2f[_0x5ade('0x31')]=_[_0x5ade('0x32')](db['Action'][_0x5ade('0x2e')]);_0x2cfd2f[_0x5ade('0x33')]=_['keys'](_0x3045dc[_0x5ade('0x33')]);_0x2cfd2f[_0x5ade('0x34')]=_['intersection'](_0x2cfd2f[_0x5ade('0x31')],_0x2cfd2f[_0x5ade('0x33')]);_0x5667c7['attributes']=_[_0x5ade('0x47')](_0x2cfd2f['model'],qs[_0x5ade('0x36')](_0x3045dc[_0x5ade('0x33')][_0x5ade('0x36')]));_0x5667c7[_0x5ade('0x35')]=_0x5667c7[_0x5ade('0x35')][_0x5ade('0x37')]?_0x5667c7[_0x5ade('0x35')]:_0x2cfd2f['model'];_0x5667c7[_0x5ade('0x53')]=qs[_0x5ade('0x3a')](_0x3045dc[_0x5ade('0x33')][_0x5ade('0x3a')]);_0x5667c7[_0x5ade('0x3b')]=qs[_0x5ade('0x34')](_[_0x5ade('0x3c')](_0x3045dc['query'],_0x2cfd2f[_0x5ade('0x34')]));if(_0x3045dc[_0x5ade('0x33')][_0x5ade('0x3d')]){_0x5667c7[_0x5ade('0x3b')]=_[_0x5ade('0x49')](_0x5667c7[_0x5ade('0x3b')],{'$or':_[_0x5ade('0x58')](_0x5667c7[_0x5ade('0x35')],function(_0x1b0e12){var _0x1863b8={};_0x1863b8[_0x1b0e12]={'$like':'%'+_0x3045dc[_0x5ade('0x33')][_0x5ade('0x3d')]+'%'};return _0x1863b8;})});}_0x5667c7=_[_0x5ade('0x49')]({},_0x5667c7,_0x3045dc[_0x5ade('0x3f')]);return _0xc569df[_0x5ade('0x57')](_0x5667c7);}})[_0x5ade('0x26')](function(_0x475383){if(_0x475383){_0x299f15=_0x475383[_0x5ade('0x37')];if(!_0x3045dc[_0x5ade('0x33')][_0x5ade('0x38')](_0x5ade('0x39'))){_0x5667c7['limit']=qs[_0x5ade('0x21')](_0x3045dc[_0x5ade('0x33')][_0x5ade('0x21')]);_0x5667c7[_0x5ade('0x20')]=qs[_0x5ade('0x20')](_0x3045dc['query'][_0x5ade('0x20')]);}return _0xc569df[_0x5ade('0x57')](_0x5667c7);}})[_0x5ade('0x26')](function(_0x500c18){if(_0x500c18){return _0x500c18?{'count':_0x299f15,'rows':_0x500c18}:null;}})[_0x5ade('0x26')](respondWithResult(_0x29fdc4,null))['catch'](handleError(_0x29fdc4,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 4ee136b..88c181e 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 _0x4686=['rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','../../config/logger','api','bluebird','path'];(function(_0x2c924f,_0x46d106){var _0x483508=function(_0x528609){while(--_0x528609){_0x2c924f['push'](_0x2c924f['shift']());}};_0x483508(++_0x46d106);}(_0x4686,0x171));var _0x6468=function(_0x49d58d,_0x4e0f67){_0x49d58d=_0x49d58d-0x0;var _0x350063=_0x4686[_0x49d58d];return _0x350063;};'use strict';var _=require(_0x6468('0x0'));var util=require('util');var logger=require(_0x6468('0x1'))(_0x6468('0x2'));var moment=require('moment');var BPromise=require(_0x6468('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6468('0x4'));var rimraf=require(_0x6468('0x5'));var config=require('../../config/environment');var attributes=require(_0x6468('0x6'));module[_0x6468('0x7')]=function(_0x48bc9d,_0x50a7c3){return _0x48bc9d[_0x6468('0x8')](_0x6468('0x9'),attributes,{'tableName':_0x6468('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x19b9=['./automation.attributes','exports','Automation','tools_automations','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x4114dd,_0x2ad862){var _0x26f44c=function(_0xad2246){while(--_0xad2246){_0x4114dd['push'](_0x4114dd['shift']());}};_0x26f44c(++_0x2ad862);}(_0x19b9,0xc2));var _0x919b=function(_0x1cb890,_0x3b3a68){_0x1cb890=_0x1cb890-0x0;var _0x143993=_0x19b9[_0x1cb890];return _0x143993;};'use strict';var _=require(_0x919b('0x0'));var util=require(_0x919b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x919b('0x2'));var rp=require(_0x919b('0x3'));var fs=require('fs');var path=require(_0x919b('0x4'));var rimraf=require(_0x919b('0x5'));var config=require('../../config/environment');var attributes=require(_0x919b('0x6'));module[_0x919b('0x7')]=function(_0x58c530,_0x33a0ac){return _0x58c530['define'](_0x919b('0x8'),attributes,{'tableName':_0x919b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 07f4093..a51f423 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 _0x20d6=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Automation,\x20%s,\x20%s'];(function(_0x456551,_0x4c9050){var _0x1af692=function(_0x2dabdd){while(--_0x2dabdd){_0x456551['push'](_0x456551['shift']());}};_0x1af692(++_0x4c9050);}(_0x20d6,0x1b8));var _0x620d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x20d6[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x620d('0x0'));var util=require(_0x620d('0x1'));var moment=require(_0x620d('0x2'));var BPromise=require(_0x620d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x620d('0x4'));var db=require(_0x620d('0x5'))['db'];var utils=require(_0x620d('0x6'));var logger=require(_0x620d('0x7'))(_0x620d('0x8'));var config=require(_0x620d('0x9'));var jayson=require(_0x620d('0xa'));var client=jayson[_0x620d('0xb')][_0x620d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3aa4f3,_0x260d43,_0x52657f){return new BPromise(function(_0x3d93af,_0x478aeb){return client['request'](_0x3aa4f3,_0x52657f)[_0x620d('0xd')](function(_0x473790){logger[_0x620d('0xe')](_0x620d('0xf'),_0x260d43,_0x620d('0x10'));logger[_0x620d('0x11')]('Automation,\x20%s,\x20%s,\x20%s',_0x260d43,_0x620d('0x10'),JSON[_0x620d('0x12')](_0x473790));if(_0x473790['error']){if(_0x473790[_0x620d('0x13')][_0x620d('0x14')]===0x1f4){logger[_0x620d('0x13')](_0x620d('0xf'),_0x260d43,_0x473790[_0x620d('0x13')][_0x620d('0x15')]);return _0x478aeb(_0x473790[_0x620d('0x13')][_0x620d('0x15')]);}logger['error'](_0x620d('0xf'),_0x260d43,_0x473790[_0x620d('0x13')][_0x620d('0x15')]);return _0x3d93af(_0x473790[_0x620d('0x13')][_0x620d('0x15')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x260d43,'request\x20sent');_0x3d93af(_0x473790[_0x620d('0x16')]['message']);}})[_0x620d('0x17')](function(_0x20a91e){logger[_0x620d('0x13')](_0x620d('0xf'),_0x260d43,_0x20a91e);_0x478aeb(_0x20a91e);});});}
\ No newline at end of file
+var _0x17a7=['Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info'];(function(_0x1569fc,_0x115095){var _0x277783=function(_0x49e9c1){while(--_0x49e9c1){_0x1569fc['push'](_0x1569fc['shift']());}};_0x277783(++_0x115095);}(_0x17a7,0xc2));var _0x717a=function(_0x8d5d35,_0x4e289b){_0x8d5d35=_0x8d5d35-0x0;var _0x309712=_0x17a7[_0x8d5d35];return _0x309712;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x717a('0x0'));var rs=require(_0x717a('0x1'));var fs=require('fs');var Redis=require(_0x717a('0x2'));var db=require(_0x717a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x717a('0x4'))('rpc');var config=require(_0x717a('0x5'));var jayson=require(_0x717a('0x6'));var client=jayson['client'][_0x717a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ca7a6,_0xd7d2ce,_0x311738){return new BPromise(function(_0x536824,_0x1066d4){return client['request'](_0x1ca7a6,_0x311738)[_0x717a('0x8')](function(_0x567130){logger[_0x717a('0x9')](_0x717a('0xa'),_0xd7d2ce,_0x717a('0xb'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'),JSON[_0x717a('0xc')](_0x567130));if(_0x567130[_0x717a('0xd')]){if(_0x567130[_0x717a('0xd')][_0x717a('0xe')]===0x1f4){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x567130['error'][_0x717a('0xf')]);return _0x1066d4(_0x567130['error']['message']);}logger['error']('Automation,\x20%s,\x20%s',_0xd7d2ce,_0x567130[_0x717a('0xd')]['message']);return _0x536824(_0x567130[_0x717a('0xd')]['message']);}else{logger[_0x717a('0x9')]('Automation,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'));_0x536824(_0x567130[_0x717a('0x10')][_0x717a('0xf')]);}})['catch'](function(_0x186b4d){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x186b4d);_0x1066d4(_0x186b4d);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 891d10e..8cc5f05 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 _0x710b=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','getConditions','getActions','post','create','addConditions','/:id/actions','put','update','destroy','multer'];(function(_0x5ee3d4,_0x40da86){var _0x7f69d=function(_0x969be8){while(--_0x969be8){_0x5ee3d4['push'](_0x5ee3d4['shift']());}};_0x7f69d(++_0x40da86);}(_0x710b,0x110));var _0xb710=function(_0x469d01,_0x18c899){_0x469d01=_0x469d01-0x0;var _0x5078d3=_0x710b[_0x469d01];return _0x5078d3;};'use strict';var multer=require(_0xb710('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb710('0x1'));var express=require(_0xb710('0x2'));var router=express[_0xb710('0x3')]();var fs_extra=require(_0xb710('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb710('0x5'));var config=require(_0xb710('0x6'));var controller=require(_0xb710('0x7'));router[_0xb710('0x8')]('/',auth[_0xb710('0x9')](),controller['index']);router[_0xb710('0x8')](_0xb710('0xa'),auth['isAuthenticated'](),controller[_0xb710('0xb')]);router[_0xb710('0x8')]('/:id/conditions',auth[_0xb710('0x9')](),controller[_0xb710('0xc')]);router['get']('/:id/actions',auth[_0xb710('0x9')](),controller[_0xb710('0xd')]);router[_0xb710('0xe')]('/',auth['isAuthenticated'](),controller[_0xb710('0xf')]);router[_0xb710('0xe')]('/:id/conditions',auth[_0xb710('0x9')](),controller[_0xb710('0x10')]);router[_0xb710('0xe')](_0xb710('0x11'),auth[_0xb710('0x9')](),controller['addActions']);router[_0xb710('0x12')](_0xb710('0xa'),auth[_0xb710('0x9')](),controller[_0xb710('0x13')]);router['delete'](_0xb710('0xa'),auth[_0xb710('0x9')](),controller[_0xb710('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xbefb=['get','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','delete','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xbefb,0x13c));var _0xbbef=function(_0x1ebd5c,_0x36150e){_0x1ebd5c=_0x1ebd5c-0x0;var _0x26eefc=_0xbefb[_0x1ebd5c];return _0x26eefc;};'use strict';var multer=require(_0xbbef('0x0'));var util=require(_0xbbef('0x1'));var path=require('path');var timeout=require(_0xbbef('0x2'));var express=require(_0xbbef('0x3'));var router=express['Router']();var fs_extra=require(_0xbbef('0x4'));var auth=require(_0xbbef('0x5'));var interaction=require(_0xbbef('0x6'));var config=require('../../config/environment');var controller=require('./automation.controller');router['get']('/',auth[_0xbbef('0x7')](),controller['index']);router[_0xbbef('0x8')](_0xbbef('0x9'),auth[_0xbbef('0x7')](),controller['show']);router[_0xbbef('0x8')](_0xbbef('0xa'),auth[_0xbbef('0x7')](),controller[_0xbbef('0xb')]);router['get'](_0xbbef('0xc'),auth['isAuthenticated'](),controller[_0xbbef('0xd')]);router[_0xbbef('0xe')]('/',auth[_0xbbef('0x7')](),controller['create']);router['post'](_0xbbef('0xa'),auth[_0xbbef('0x7')](),controller[_0xbbef('0xf')]);router['post']('/:id/actions',auth[_0xbbef('0x7')](),controller[_0xbbef('0x10')]);router['put'](_0xbbef('0x9'),auth[_0xbbef('0x7')](),controller['update']);router[_0xbbef('0x11')](_0xbbef('0x9'),auth[_0xbbef('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 6f9b33e..22f9ad5 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 _0x4240=['#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','UNSIGNED','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x4240,0x10c));var _0x0424=function(_0x112ed0,_0x737772){_0x112ed0=_0x112ed0-0x0;var _0x197bc7=_0x4240[_0x112ed0];return _0x197bc7;};'use strict';var Sequelize=require('sequelize');module[_0x0424('0x0')]={'name':{'type':Sequelize[_0x0424('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0424('0x2')](_0x0424('0x3')),'allowNull':![],'defaultValue':_0x0424('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0424('0x4')},'limitCalls':{'type':Sequelize[_0x0424('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0424('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0424('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0424('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x0424('0x5')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0424('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0424('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0424('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0424('0x5')](0x5)[_0x0424('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0424('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x0424('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0424('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0424('0x5')](0x5)[_0x0424('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0424('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0424('0x5')](0x3)[_0x0424('0x9')],'defaultValue':0x3,'comment':_0x0424('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0424('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0424('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0424('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0424('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0424('0x1')],'defaultValue':_0x0424('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x0424('0x2')](_0x0424('0x11'),_0x0424('0x12'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x0424('0x13')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0424('0x5')](0x9)[_0x0424('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0424('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x0424('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0424('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0424('0x5')](0x9)[_0x0424('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0424('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0424('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0424('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0424('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0424('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0424('0x5')](0x9)[_0x0424('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0424('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0424('0x5')](0x5)[_0x0424('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0424('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0424('0x5')](0x9)[_0x0424('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0424('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0424('0x2')](_0x0424('0x1c'),_0x0424('0x1d')),'defaultValue':_0x0424('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0424('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0424('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0424('0x5')](0x3)[_0x0424('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0424('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0424('0x5')](0x5)[_0x0424('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0424('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0424('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0424('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x0424('0x5')](0x5)[_0x0424('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0424('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0424('0x5')](0x3)[_0x0424('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0424('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0424('0x5')](0x5)[_0x0424('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0424('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x0424('0x5')](0x3)[_0x0424('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0424('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0424('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0424('0x5')](0x3)[_0x0424('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0424('0x5')](0x5)[_0x0424('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0424('0x25')}};
\ No newline at end of file
+var _0x5857=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x145450,_0x8d1918){var _0x39b89d=function(_0x51f5e7){while(--_0x51f5e7){_0x145450['push'](_0x145450['shift']());}};_0x39b89d(++_0x8d1918);}(_0x5857,0xbf));var _0x7585=function(_0x4ac523,_0x5ce50e){_0x4ac523=_0x4ac523-0x0;var _0x53aa8d=_0x5857[_0x4ac523];return _0x53aa8d;};'use strict';var Sequelize=require(_0x7585('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7585('0x1')](_0x7585('0x2')),'allowNull':![],'defaultValue':_0x7585('0x2')},'description':{'type':Sequelize[_0x7585('0x3')]},'active':{'type':Sequelize[_0x7585('0x4')],'defaultValue':0x0,'comment':_0x7585('0x5')},'limitCalls':{'type':Sequelize[_0x7585('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7585('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7585('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x7585('0x6')](0x3)[_0x7585('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7585('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7585('0x6')](0x3)[_0x7585('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7585('0x6')](0x5)[_0x7585('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7585('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x7585('0x6')](0x3)[_0x7585('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7585('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7585('0x6')](0x5)[_0x7585('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7585('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7585('0x6')](0x3)[_0x7585('0x8')],'defaultValue':0x3,'comment':_0x7585('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7585('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7585('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7585('0x6')](0x3)[_0x7585('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7585('0xf')},'dialTimezone':{'type':Sequelize[_0x7585('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7585('0x3')],'defaultValue':_0x7585('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x7585('0x1')](_0x7585('0x11'),_0x7585('0x12'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x7585('0x4')],'defaultValue':0x0,'comment':_0x7585('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7585('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7585('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x7585('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7585('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7585('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7585('0x6')](0x9)[_0x7585('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x7585('0x6')](0x9)[_0x7585('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7585('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7585('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7585('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x7585('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7585('0x6')](0x5)[_0x7585('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7585('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x7585('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7585('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7585('0x1')](_0x7585('0x1b'),_0x7585('0x1c')),'defaultValue':_0x7585('0x1b')},'dialPrefix':{'type':Sequelize[_0x7585('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x7585('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7585('0x1d')},'dialCutDigit':{'type':Sequelize[_0x7585('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7585('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7585('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7585('0x6')](0x5)[_0x7585('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7585('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7585('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x7585('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7585('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7585('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7585('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7585('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7585('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x7585('0x6')](0x3)[_0x7585('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7585('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7585('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7585('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7585('0x6')](0x3)[_0x7585('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7585('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7585('0x6')](0x5)[_0x7585('0x8')],'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 0c2a092..b97a0c6 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 _0x486e=['cm_contacts','toString','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','ListId\x20=\x20?','cm_hopper_additional_phones','OrderBy','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','then','destroy','IvrCampaigns','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','where','VIRTUAL','merge','options','Campaign','includeAll','findAll','rows','catch','show','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','params','getHoppers','findOne','hasOwnProperty','CampaignId','filter','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','from'];(function(_0xf855a1,_0x420a35){var _0x9ed54c=function(_0x15d8dd){while(--_0x15d8dd){_0xf855a1['push'](_0xf855a1['shift']());}};_0x9ed54c(++_0x420a35);}(_0x486e,0xb2));var _0xe486=function(_0x252cf9,_0x5221f9){_0x252cf9=_0x252cf9-0x0;var _0x1eb966=_0x486e[_0x252cf9];return _0x1eb966;};'use strict';var emlformat=require(_0xe486('0x0'));var rimraf=require(_0xe486('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe486('0x2'));var rp=require(_0xe486('0x3'));var moment=require(_0xe486('0x4'));var BPromise=require(_0xe486('0x5'));var Mustache=require(_0xe486('0x6'));var util=require(_0xe486('0x7'));var path=require(_0xe486('0x8'));var sox=require(_0xe486('0x9'));var csv=require(_0xe486('0xa'));var ejs=require(_0xe486('0xb'));var fs=require('fs');var fs_extra=require(_0xe486('0xc'));var _=require('lodash');var squel=require(_0xe486('0xd'));var crypto=require(_0xe486('0xe'));var jsforce=require(_0xe486('0xf'));var deskjs=require(_0xe486('0x10'));var toCsv=require(_0xe486('0xa'));var querystring=require(_0xe486('0x11'));var Papa=require(_0xe486('0x12'));var Redis=require(_0xe486('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe486('0x14'));var hardwareService=require(_0xe486('0x15'));var logger=require(_0xe486('0x16'))(_0xe486('0x17'));var utils=require(_0xe486('0x18'));var config=require(_0xe486('0x19'));var licenseUtil=require(_0xe486('0x1a'));var db=require(_0xe486('0x1b'))['db'];function respondWithStatusCode(_0x372057,_0x530344){_0x530344=_0x530344||0xcc;return function(_0x5a1aad){if(_0x5a1aad){return _0x372057[_0xe486('0x1c')](_0x530344);}return _0x372057[_0xe486('0x1d')](_0x530344)[_0xe486('0x1e')]();};}function respondWithResult(_0x564a6f,_0x5ddb65){_0x5ddb65=_0x5ddb65||0xc8;return function(_0x339746){if(_0x339746){return _0x564a6f['status'](_0x5ddb65)[_0xe486('0x1f')](_0x339746);}};}function respondWithFilteredResult(_0x3da621,_0x4a0259){return function(_0x355002){if(_0x355002){var _0x5016f0=typeof _0x4a0259['offset']===_0xe486('0x20')&&typeof _0x4a0259[_0xe486('0x21')]==='undefined';var _0x3d983b=_0x355002['count'];var _0x25e946=_0x5016f0?0x0:_0x4a0259[_0xe486('0x22')];var _0x5d209a=_0x5016f0?_0x355002[_0xe486('0x23')]:_0x4a0259[_0xe486('0x22')]+_0x4a0259['limit'];var _0xf0697f;if(_0x5d209a>=_0x3d983b){_0x5d209a=_0x3d983b;_0xf0697f=0xc8;}else{_0xf0697f=0xce;}_0x3da621[_0xe486('0x1d')](_0xf0697f);return _0x3da621[_0xe486('0x24')]('Content-Range',_0x25e946+'-'+_0x5d209a+'/'+_0x3d983b)[_0xe486('0x1f')](_0x355002);}return null;};}function patchUpdates(_0x301344){return function(_0x2c34e3){try{jsonpatch[_0xe486('0x25')](_0x2c34e3,_0x301344,!![]);}catch(_0x4650bf){return BPromise[_0xe486('0x26')](_0x4650bf);}return _0x2c34e3[_0xe486('0x27')]();};}function saveUpdates(_0xdc43f0,_0x5b61cc){return function(_0x22efff){if(_0x22efff){return _0x22efff['update'](_0xdc43f0)[_0xe486('0x28')](function(_0x50ae4c){return _0x50ae4c;});}return null;};}function removeEntity(_0x3020e7,_0x47a811){return function(_0x39113f){if(_0x39113f){return _0x39113f[_0xe486('0x29')]()[_0xe486('0x28')](function(){var _0x9f77fc=_0x39113f['get']({'plain':!![]});var _0x2e7182=_0xe486('0x2a');return db[_0xe486('0x2b')][_0xe486('0x29')]({'where':{'type':_0x2e7182,'resourceId':_0x9f77fc['id']}})[_0xe486('0x28')](function(){return _0x39113f;});})[_0xe486('0x28')](function(){_0x3020e7['status'](0xcc)[_0xe486('0x1e')]();});}};}function handleEntityNotFound(_0x2b08d0,_0x502b4c){return function(_0x87ece6){if(!_0x87ece6){_0x2b08d0['sendStatus'](0x194);}return _0x87ece6;};}function handleError(_0x48ab9f,_0x4ecdac){_0x4ecdac=_0x4ecdac||0x1f4;return function(_0x361b51){logger[_0xe486('0x2c')](_0x361b51[_0xe486('0x2d')]);if(_0x361b51['name']){delete _0x361b51[_0xe486('0x2e')];}_0x48ab9f['status'](_0x4ecdac)['send'](_0x361b51);};}exports[_0xe486('0x2f')]=function(_0x1c6d22,_0x22a1c9){var _0x2fc3a7={},_0x39f3f9={},_0x70e1bb={'count':0x0,'rows':[]};var _0x39b179=_['map'](db['Campaign'][_0xe486('0x30')],function(_0x5f3b54){return{'name':_0x5f3b54[_0xe486('0x31')],'type':_0x5f3b54[_0xe486('0x32')][_0xe486('0x33')]};});_0x39f3f9[_0xe486('0x34')]=_[_0xe486('0x35')](_0x39b179,'name');_0x39f3f9[_0xe486('0x36')]=_[_0xe486('0x37')](_0x1c6d22[_0xe486('0x36')]);_0x39f3f9[_0xe486('0x38')]=_['intersection'](_0x39f3f9[_0xe486('0x34')],_0x39f3f9[_0xe486('0x36')]);_0x2fc3a7[_0xe486('0x39')]=_['intersection'](_0x39f3f9[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x1c6d22[_0xe486('0x36')][_0xe486('0x3a')]));_0x2fc3a7['attributes']=_0x2fc3a7[_0xe486('0x39')][_0xe486('0x3b')]?_0x2fc3a7[_0xe486('0x39')]:_0x39f3f9[_0xe486('0x34')];if(!_0x1c6d22['query']['hasOwnProperty'](_0xe486('0x3c'))){_0x2fc3a7[_0xe486('0x21')]=qs[_0xe486('0x21')](_0x1c6d22[_0xe486('0x36')]['limit']);_0x2fc3a7[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x1c6d22[_0xe486('0x36')]['offset']);}_0x2fc3a7[_0xe486('0x3d')]=qs[_0xe486('0x3e')](_0x1c6d22[_0xe486('0x36')][_0xe486('0x3e')]);_0x2fc3a7['where']=qs['filters'](_[_0xe486('0x3f')](_0x1c6d22[_0xe486('0x36')],_0x39f3f9[_0xe486('0x38')]),_0x39b179);if(_0x1c6d22[_0xe486('0x36')]['filter']){_0x2fc3a7[_0xe486('0x40')]=_['merge'](_0x2fc3a7[_0xe486('0x40')],{'$or':_[_0xe486('0x35')](_0x39b179,function(_0xecdc73){if(_0xecdc73[_0xe486('0x32')]!==_0xe486('0x41')){var _0x178fcc={};_0x178fcc[_0xecdc73['name']]={'$like':'%'+_0x1c6d22[_0xe486('0x36')]['filter']+'%'};return _0x178fcc;}})});}_0x2fc3a7=_[_0xe486('0x42')]({},_0x2fc3a7,_0x1c6d22[_0xe486('0x43')]);var _0x1ba5e3={'where':_0x2fc3a7['where']};return db[_0xe486('0x44')]['count'](_0x1ba5e3)[_0xe486('0x28')](function(_0x22c5d2){_0x70e1bb[_0xe486('0x23')]=_0x22c5d2;if(_0x1c6d22['query'][_0xe486('0x45')]){_0x2fc3a7['include']=[{'all':!![]}];}return db[_0xe486('0x44')][_0xe486('0x46')](_0x2fc3a7);})['then'](function(_0x312a3a){_0x70e1bb[_0xe486('0x47')]=_0x312a3a;return _0x70e1bb;})[_0xe486('0x28')](respondWithFilteredResult(_0x22a1c9,_0x2fc3a7))[_0xe486('0x48')](handleError(_0x22a1c9,null));};exports[_0xe486('0x49')]=function(_0x9d6953,_0x5c4c9c){var _0x20b6b5={'raw':![],'where':{'id':_0x9d6953['params']['id']}},_0x45c705={};_0x45c705[_0xe486('0x34')]=_['keys'](db[_0xe486('0x44')][_0xe486('0x30')]);_0x45c705['query']=_[_0xe486('0x37')](_0x9d6953[_0xe486('0x36')]);_0x45c705[_0xe486('0x38')]=_['intersection'](_0x45c705[_0xe486('0x34')],_0x45c705[_0xe486('0x36')]);_0x20b6b5[_0xe486('0x39')]=_[_0xe486('0x4a')](_0x45c705['model'],qs[_0xe486('0x3a')](_0x9d6953[_0xe486('0x36')][_0xe486('0x3a')]));_0x20b6b5[_0xe486('0x39')]=_0x20b6b5[_0xe486('0x39')][_0xe486('0x3b')]?_0x20b6b5[_0xe486('0x39')]:_0x45c705['model'];if(_0x9d6953[_0xe486('0x36')][_0xe486('0x45')]){_0x20b6b5['include']=[{'all':!![]}];}_0x20b6b5=_[_0xe486('0x42')]({},_0x20b6b5,_0x9d6953[_0xe486('0x43')]);return db['Campaign'][_0xe486('0x4b')](_0x20b6b5)[_0xe486('0x28')](handleEntityNotFound(_0x5c4c9c,null))[_0xe486('0x28')](respondWithResult(_0x5c4c9c,null))[_0xe486('0x48')](handleError(_0x5c4c9c,null));};exports[_0xe486('0x4c')]=function(_0x10b115,_0x43f2da){return db['Campaign'][_0xe486('0x4c')](_0x10b115[_0xe486('0x4d')],{})['then'](function(_0x3bc7dd){var _0x26e8c5=_0x10b115[_0xe486('0x4e')][_0xe486('0x4f')]({'plain':!![]});if(!_0x26e8c5)throw new Error(_0xe486('0x50'));if(_0x26e8c5[_0xe486('0x51')]==='user'){var _0x1c8ad5=_0x3bc7dd[_0xe486('0x4f')]({'plain':!![]});var _0x4e781c=_0xe486('0x2a');return db[_0xe486('0x52')][_0xe486('0x4b')]({'where':{'name':_0x4e781c,'userProfileId':_0x26e8c5[_0xe486('0x53')]},'raw':!![]})[_0xe486('0x28')](function(_0x319585){if(_0x319585&&_0x319585[_0xe486('0x54')]===0x0){return db[_0xe486('0x2b')][_0xe486('0x4c')]({'name':_0x1c8ad5[_0xe486('0x2e')],'resourceId':_0x1c8ad5['id'],'type':_0x319585['name'],'sectionId':_0x319585['id']},{})[_0xe486('0x28')](function(){return _0x3bc7dd;});}else{return _0x3bc7dd;}})[_0xe486('0x48')](function(_0x3c9cf2){logger[_0xe486('0x2c')](_0xe486('0x55'),_0x3c9cf2);throw _0x3c9cf2;});}return _0x3bc7dd;})[_0xe486('0x28')](respondWithResult(_0x43f2da,0xc9))['catch'](handleError(_0x43f2da,null));};exports[_0xe486('0x56')]=function(_0x1592d5,_0x4df7c6){var _0x31e57a={'where':{'id':_0x1592d5['params']['id']}},_0x4de708={};_0x4de708[_0xe486('0x34')]=_[_0xe486('0x37')](db[_0xe486('0x44')]['rawAttributes']);_0x31e57a[_0xe486('0x39')]=_['intersection'](_0x4de708[_0xe486('0x34')],qs['fields'](_0x1592d5[_0xe486('0x36')]['fields']));_0x31e57a['attributes']=_0x31e57a['attributes'][_0xe486('0x3b')]?_0x31e57a[_0xe486('0x39')]:_0x4de708[_0xe486('0x34')];if(_0x1592d5[_0xe486('0x36')][_0xe486('0x45')]){_0x31e57a[_0xe486('0x57')]=[{'all':!![]}];}_0x31e57a=_['merge']({},_0x31e57a,_0x1592d5['options']);return db[_0xe486('0x44')]['find'](_0x31e57a)[_0xe486('0x28')](handleEntityNotFound(_0x4df7c6,null))[_0xe486('0x28')](function(_0x1b96f1){if(_0x1b96f1){var _0x50732c=_0x1b96f1['get']({'plain':!![]});_0x50732c=qs[_0xe486('0x58')](_0x50732c,['id',_0xe486('0x59'),_0xe486('0x5a')]);_0x1592d5[_0xe486('0x4d')]=_[_0xe486('0x58')](_0x1592d5[_0xe486('0x4d')],['id',_0xe486('0x59'),_0xe486('0x5a')]);return db[_0xe486('0x44')]['create'](_['merge'](_0x50732c,_0x1592d5[_0xe486('0x4d')]),{'include':_0x1592d5[_0xe486('0x36')][_0xe486('0x45')]?[{'all':!![]}]:undefined})[_0xe486('0x28')](function(_0x358bce){var _0x2ec277=_0x1592d5['user']['get']({'plain':!![]});if(!_0x2ec277)throw new Error(_0xe486('0x50'));if(_0x2ec277[_0xe486('0x51')]===_0xe486('0x4e')){var _0x148bad=_0x358bce[_0xe486('0x4f')]({'plain':!![]});var _0x33f2f6='IvrCampaigns';return db[_0xe486('0x52')][_0xe486('0x4b')]({'where':{'name':_0x33f2f6,'userProfileId':_0x2ec277[_0xe486('0x53')]},'raw':!![]})[_0xe486('0x28')](function(_0x512d18){if(_0x512d18&&_0x512d18[_0xe486('0x54')]===0x0){return db[_0xe486('0x2b')]['create']({'name':_0x148bad[_0xe486('0x2e')],'resourceId':_0x148bad['id'],'type':_0x512d18[_0xe486('0x2e')],'sectionId':_0x512d18['id']},{})[_0xe486('0x28')](function(){return _0x358bce;});}else{return _0x358bce;}})[_0xe486('0x48')](function(_0x4feeb5){logger[_0xe486('0x2c')](_0xe486('0x55'),_0x4feeb5);throw _0x4feeb5;});}return _0x358bce;});}})[_0xe486('0x28')](respondWithResult(_0x4df7c6,0xc9))[_0xe486('0x48')](handleError(_0x4df7c6,null));};exports['update']=function(_0x39a093,_0x290dc1){if(_0x39a093[_0xe486('0x4d')]['id']){delete _0x39a093[_0xe486('0x4d')]['id'];}return db[_0xe486('0x44')][_0xe486('0x4b')]({'where':{'id':_0x39a093[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x290dc1,null))['then'](saveUpdates(_0x39a093[_0xe486('0x4d')],null))[_0xe486('0x28')](respondWithResult(_0x290dc1,null))[_0xe486('0x48')](handleError(_0x290dc1,null));};exports[_0xe486('0x29')]=function(_0x8f0b78,_0x276742){return db['Campaign']['find']({'where':{'id':_0x8f0b78[_0xe486('0x5b')]['id']}})['then'](handleEntityNotFound(_0x276742,null))[_0xe486('0x28')](removeEntity(_0x276742,null))[_0xe486('0x48')](handleError(_0x276742,null));};exports[_0xe486('0x5c')]=function(_0x1dfdc0,_0x2bec02,_0x22b50d){var _0x696632={'raw':!![],'where':{}};var _0x183700={};var _0x12863d={'count':0x0,'rows':[]};return db[_0xe486('0x44')][_0xe486('0x5d')]({'where':{'id':_0x1dfdc0[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x2bec02,null))[_0xe486('0x28')](function(_0x333a1f){if(_0x333a1f){_0x183700['model']=_['keys'](db['CmHopper'][_0xe486('0x30')]);_0x183700[_0xe486('0x36')]=_['keys'](_0x1dfdc0[_0xe486('0x36')]);_0x183700[_0xe486('0x38')]=_['intersection'](_0x183700['model'],_0x183700[_0xe486('0x36')]);_0x696632[_0xe486('0x39')]=_['intersection'](_0x183700['model'],qs[_0xe486('0x3a')](_0x1dfdc0[_0xe486('0x36')][_0xe486('0x3a')]));_0x696632[_0xe486('0x39')]=_0x696632['attributes'][_0xe486('0x3b')]?_0x696632[_0xe486('0x39')]:_0x183700[_0xe486('0x34')];if(!_0x1dfdc0[_0xe486('0x36')][_0xe486('0x5e')]('nolimit')){_0x696632[_0xe486('0x21')]=qs[_0xe486('0x21')](_0x1dfdc0[_0xe486('0x36')]['limit']);_0x696632[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x1dfdc0['query'][_0xe486('0x22')]);}_0x696632[_0xe486('0x3d')]=qs['sort'](_0x1dfdc0['query'][_0xe486('0x3e')]);_0x696632[_0xe486('0x40')]=qs[_0xe486('0x38')](_[_0xe486('0x3f')](_0x1dfdc0[_0xe486('0x36')],_0x183700[_0xe486('0x38')]));_0x696632[_0xe486('0x40')][_0xe486('0x5f')]=_0x333a1f['id'];if(_0x1dfdc0['query'][_0xe486('0x60')]){_0x696632['where']=_[_0xe486('0x42')](_0x696632['where'],{'$or':_[_0xe486('0x35')](_0x696632[_0xe486('0x39')],function(_0x193204){var _0x403cb1={};_0x403cb1[_0x193204]={'$like':'%'+_0x1dfdc0[_0xe486('0x36')]['filter']+'%'};return _0x403cb1;})});}_0x696632=_[_0xe486('0x42')]({},_0x696632,_0x1dfdc0[_0xe486('0x43')]);return db[_0xe486('0x61')][_0xe486('0x23')]({'where':_0x696632['where']})[_0xe486('0x28')](function(_0x43a082){_0x12863d['count']=_0x43a082;if(_0x1dfdc0['query']['includeAll']){_0x696632[_0xe486('0x57')]=[{'all':!![]}];}return db['CmHopper'][_0xe486('0x46')](_0x696632);})[_0xe486('0x28')](function(_0x17f9c9){_0x12863d['rows']=_0x17f9c9;return _0x12863d;});}})[_0xe486('0x28')](respondWithFilteredResult(_0x2bec02,_0x696632))[_0xe486('0x48')](handleError(_0x2bec02,null));};exports[_0xe486('0x62')]=function(_0x1c092d,_0x4ea43e,_0x341960){var _0x2f28f5={'raw':!![],'where':{}};var _0x351154={};var _0x394eca={'count':0x0,'rows':[]};return db[_0xe486('0x44')][_0xe486('0x5d')]({'where':{'id':_0x1c092d[_0xe486('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4ea43e,null))[_0xe486('0x28')](function(_0x3603d2){if(_0x3603d2){_0x351154[_0xe486('0x34')]=_[_0xe486('0x37')](db[_0xe486('0x63')]['rawAttributes']);_0x351154['query']=_[_0xe486('0x37')](_0x1c092d[_0xe486('0x36')]);_0x351154[_0xe486('0x38')]=_[_0xe486('0x4a')](_0x351154[_0xe486('0x34')],_0x351154[_0xe486('0x36')]);_0x2f28f5[_0xe486('0x39')]=_['intersection'](_0x351154[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x1c092d[_0xe486('0x36')]['fields']));_0x2f28f5[_0xe486('0x39')]=_0x2f28f5[_0xe486('0x39')][_0xe486('0x3b')]?_0x2f28f5[_0xe486('0x39')]:_0x351154[_0xe486('0x34')];if(!_0x1c092d[_0xe486('0x36')][_0xe486('0x5e')](_0xe486('0x3c'))){_0x2f28f5[_0xe486('0x21')]=qs[_0xe486('0x21')](_0x1c092d[_0xe486('0x36')][_0xe486('0x21')]);_0x2f28f5[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x1c092d[_0xe486('0x36')]['offset']);}_0x2f28f5[_0xe486('0x3d')]=qs[_0xe486('0x3e')](_0x1c092d[_0xe486('0x36')][_0xe486('0x3e')]);_0x2f28f5[_0xe486('0x40')]=qs[_0xe486('0x38')](_[_0xe486('0x3f')](_0x1c092d[_0xe486('0x36')],_0x351154[_0xe486('0x38')]));_0x2f28f5[_0xe486('0x40')][_0xe486('0x5f')]=_0x3603d2['id'];if(_0x1c092d[_0xe486('0x36')][_0xe486('0x60')]){_0x2f28f5[_0xe486('0x40')]=_[_0xe486('0x42')](_0x2f28f5[_0xe486('0x40')],{'$or':_[_0xe486('0x35')](_0x2f28f5['attributes'],function(_0x4d0144){var _0x540206={};_0x540206[_0x4d0144]={'$like':'%'+_0x1c092d[_0xe486('0x36')][_0xe486('0x60')]+'%'};return _0x540206;})});}_0x2f28f5=_['merge']({},_0x2f28f5,_0x1c092d[_0xe486('0x43')]);return db[_0xe486('0x63')]['count']({'where':_0x2f28f5[_0xe486('0x40')]})[_0xe486('0x28')](function(_0x2b16ed){_0x394eca[_0xe486('0x23')]=_0x2b16ed;if(_0x1c092d[_0xe486('0x36')][_0xe486('0x45')]){_0x2f28f5[_0xe486('0x57')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xe486('0x46')](_0x2f28f5);})[_0xe486('0x28')](function(_0x10678b){_0x394eca['rows']=_0x10678b;return _0x394eca;});}})[_0xe486('0x28')](respondWithFilteredResult(_0x4ea43e,_0x2f28f5))[_0xe486('0x48')](handleError(_0x4ea43e,null));};exports[_0xe486('0x64')]=function(_0x3e2a12,_0x5b6052,_0x14bd14){var _0x63f070={'raw':!![],'where':{}};var _0xd82fd4={};var _0x13b8ec={'count':0x0,'rows':[]};return db[_0xe486('0x44')][_0xe486('0x5d')]({'where':{'id':_0x3e2a12[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x5b6052,null))[_0xe486('0x28')](function(_0x3e15e1){if(_0x3e15e1){_0xd82fd4[_0xe486('0x34')]=_[_0xe486('0x37')](db['CmHopperFinal'][_0xe486('0x30')]);_0xd82fd4[_0xe486('0x36')]=_[_0xe486('0x37')](_0x3e2a12['query']);_0xd82fd4[_0xe486('0x38')]=_[_0xe486('0x4a')](_0xd82fd4['model'],_0xd82fd4[_0xe486('0x36')]);_0x63f070[_0xe486('0x39')]=_[_0xe486('0x4a')](_0xd82fd4[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x3e2a12[_0xe486('0x36')]['fields']));_0x63f070[_0xe486('0x39')]=_0x63f070['attributes'][_0xe486('0x3b')]?_0x63f070[_0xe486('0x39')]:_0xd82fd4[_0xe486('0x34')];if(!_0x3e2a12['query'][_0xe486('0x5e')](_0xe486('0x3c'))){_0x63f070[_0xe486('0x21')]=qs[_0xe486('0x21')](_0x3e2a12[_0xe486('0x36')][_0xe486('0x21')]);_0x63f070[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x3e2a12[_0xe486('0x36')][_0xe486('0x22')]);}_0x63f070[_0xe486('0x3d')]=qs[_0xe486('0x3e')](_0x3e2a12[_0xe486('0x36')][_0xe486('0x3e')]);_0x63f070[_0xe486('0x40')]=qs[_0xe486('0x38')](_[_0xe486('0x3f')](_0x3e2a12[_0xe486('0x36')],_0xd82fd4['filters']));_0x63f070[_0xe486('0x40')][_0xe486('0x5f')]=_0x3e15e1['id'];if(_0x3e2a12['query'][_0xe486('0x60')]){_0x63f070[_0xe486('0x40')]=_[_0xe486('0x42')](_0x63f070['where'],{'$or':_[_0xe486('0x35')](_0x63f070['attributes'],function(_0x37c8c8){var _0x4537e3={};_0x4537e3[_0x37c8c8]={'$like':'%'+_0x3e2a12['query'][_0xe486('0x60')]+'%'};return _0x4537e3;})});}_0x63f070=_[_0xe486('0x42')]({},_0x63f070,_0x3e2a12['options']);return db[_0xe486('0x65')][_0xe486('0x23')]({'where':_0x63f070['where']})[_0xe486('0x28')](function(_0x20e28c){_0x13b8ec['count']=_0x20e28c;if(_0x3e2a12[_0xe486('0x36')][_0xe486('0x45')]){_0x63f070[_0xe486('0x57')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xe486('0x46')](_0x63f070);})[_0xe486('0x28')](function(_0x216ea8){_0x13b8ec['rows']=_0x216ea8;return _0x13b8ec;});}})[_0xe486('0x28')](respondWithFilteredResult(_0x5b6052,_0x63f070))[_0xe486('0x48')](handleError(_0x5b6052,null));};exports[_0xe486('0x66')]=function(_0x31f489,_0x1ef654,_0x2c583f){var _0x4ebc75={'raw':!![],'where':{}};var _0x1b0f9d={};var _0x57fe91={'count':0x0,'rows':[]};return db[_0xe486('0x44')]['findOne']({'where':{'id':_0x31f489['params']['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x1ef654,null))['then'](function(_0x44b4af){if(_0x44b4af){_0x1b0f9d[_0xe486('0x34')]=_[_0xe486('0x37')](db[_0xe486('0x67')][_0xe486('0x30')]);_0x1b0f9d[_0xe486('0x36')]=_[_0xe486('0x37')](_0x31f489[_0xe486('0x36')]);_0x1b0f9d[_0xe486('0x38')]=_['intersection'](_0x1b0f9d[_0xe486('0x34')],_0x1b0f9d['query']);_0x4ebc75[_0xe486('0x39')]=_[_0xe486('0x4a')](_0x1b0f9d[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x31f489[_0xe486('0x36')][_0xe486('0x3a')]));_0x4ebc75[_0xe486('0x39')]=_0x4ebc75['attributes'][_0xe486('0x3b')]?_0x4ebc75[_0xe486('0x39')]:_0x1b0f9d[_0xe486('0x34')];if(!_0x31f489[_0xe486('0x36')]['hasOwnProperty'](_0xe486('0x3c'))){_0x4ebc75[_0xe486('0x21')]=qs['limit'](_0x31f489[_0xe486('0x36')][_0xe486('0x21')]);_0x4ebc75[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x31f489['query']['offset']);}_0x4ebc75[_0xe486('0x3d')]=qs[_0xe486('0x3e')](_0x31f489[_0xe486('0x36')]['sort']);_0x4ebc75['where']=qs['filters'](_[_0xe486('0x3f')](_0x31f489['query'],_0x1b0f9d[_0xe486('0x38')]));_0x4ebc75[_0xe486('0x40')][_0xe486('0x5f')]=_0x44b4af['id'];if(_0x31f489[_0xe486('0x36')][_0xe486('0x60')]){_0x4ebc75[_0xe486('0x40')]=_[_0xe486('0x42')](_0x4ebc75[_0xe486('0x40')],{'$or':_[_0xe486('0x35')](_0x4ebc75['attributes'],function(_0x521de9){var _0x15ac77={};_0x15ac77[_0x521de9]={'$like':'%'+_0x31f489[_0xe486('0x36')][_0xe486('0x60')]+'%'};return _0x15ac77;})});}_0x4ebc75=_[_0xe486('0x42')]({},_0x4ebc75,_0x31f489[_0xe486('0x43')]);return db[_0xe486('0x67')][_0xe486('0x23')]({'where':_0x4ebc75[_0xe486('0x40')]})['then'](function(_0x379e25){_0x57fe91[_0xe486('0x23')]=_0x379e25;if(_0x31f489['query'][_0xe486('0x45')]){_0x4ebc75[_0xe486('0x57')]=[{'all':!![]}];}return db[_0xe486('0x67')][_0xe486('0x46')](_0x4ebc75);})['then'](function(_0x512151){_0x57fe91[_0xe486('0x47')]=_0x512151;return _0x57fe91;});}})[_0xe486('0x28')](respondWithFilteredResult(_0x1ef654,_0x4ebc75))[_0xe486('0x48')](handleError(_0x1ef654,null));};exports[_0xe486('0x68')]=function(_0x27dbdd,_0x3775c8,_0x5d1e03){var _0x5dbec8={};var _0x884f99={};var _0x1d0271;var _0x178857;return db[_0xe486('0x44')][_0xe486('0x5d')]({'where':{'id':_0x27dbdd['params']['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x3775c8,null))[_0xe486('0x28')](function(_0x4867f9){if(_0x4867f9){_0x1d0271=_0x4867f9;_0x884f99[_0xe486('0x34')]=_[_0xe486('0x37')](db[_0xe486('0x69')][_0xe486('0x30')]);_0x884f99[_0xe486('0x36')]=_[_0xe486('0x37')](_0x27dbdd[_0xe486('0x36')]);_0x884f99[_0xe486('0x38')]=_[_0xe486('0x4a')](_0x884f99[_0xe486('0x34')],_0x884f99[_0xe486('0x36')]);_0x5dbec8[_0xe486('0x39')]=_[_0xe486('0x4a')](_0x884f99[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x27dbdd[_0xe486('0x36')][_0xe486('0x3a')]));_0x5dbec8['attributes']=_0x5dbec8[_0xe486('0x39')][_0xe486('0x3b')]?_0x5dbec8['attributes']:_0x884f99[_0xe486('0x34')];_0x5dbec8[_0xe486('0x3d')]=qs['sort'](_0x27dbdd[_0xe486('0x36')][_0xe486('0x3e')]);_0x5dbec8['where']=qs['filters'](_[_0xe486('0x3f')](_0x27dbdd[_0xe486('0x36')],_0x884f99[_0xe486('0x38')]));if(_0x27dbdd[_0xe486('0x36')][_0xe486('0x60')]){_0x5dbec8[_0xe486('0x40')]=_['merge'](_0x5dbec8[_0xe486('0x40')],{'$or':_[_0xe486('0x35')](_0x5dbec8[_0xe486('0x39')],function(_0x2d57a7){var _0x46fd1b={};_0x46fd1b[_0x2d57a7]={'$like':'%'+_0x27dbdd['query']['filter']+'%'};return _0x46fd1b;})});}_0x5dbec8=_[_0xe486('0x42')]({},_0x5dbec8,_0x27dbdd[_0xe486('0x43')]);return _0x1d0271['getLists'](_0x5dbec8);}})[_0xe486('0x28')](function(_0xaa4f8){if(_0xaa4f8){_0x178857=_0xaa4f8[_0xe486('0x3b')];if(!_0x27dbdd[_0xe486('0x36')]['hasOwnProperty'](_0xe486('0x3c'))){_0x5dbec8[_0xe486('0x21')]=qs[_0xe486('0x21')](_0x27dbdd[_0xe486('0x36')][_0xe486('0x21')]);_0x5dbec8[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x27dbdd[_0xe486('0x36')][_0xe486('0x22')]);}return _0x1d0271[_0xe486('0x68')](_0x5dbec8);}})[_0xe486('0x28')](function(_0x364af4){if(_0x364af4){return _0x364af4?{'count':_0x178857,'rows':_0x364af4}:null;}})[_0xe486('0x28')](respondWithResult(_0x3775c8,null))[_0xe486('0x48')](handleError(_0x3775c8,null));};exports['addLists']=function(_0x506598,_0x5a2dd0,_0x37fc31){var _0x2f25ed,_0x414e50;var _0x4e2250=[];var _0x491543=moment()[_0xe486('0x6a')](_0xe486('0x6b'));return db[_0xe486('0x44')][_0xe486('0x4b')]({'where':{'id':_0x506598[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x5a2dd0,null))[_0xe486('0x28')](function(_0xf214d8){if(_0xf214d8){_0x414e50=_0xf214d8;return _0xf214d8['addLists'](_0x506598['body'][_0xe486('0x6c')],_[_0xe486('0x58')](_0x506598[_0xe486('0x4d')],[_0xe486('0x6c'),'id'])||{});}return null;})['spread'](function(_0x1289e5){var _0x439f75;var _0x7bf3ff;_0x2f25ed=_0x1289e5||[];var _0x369b45=[];if(_0x1289e5){for(var _0x14d9ed=0x0;_0x14d9ed<_0x1289e5[_0xe486('0x3b')];_0x14d9ed+=0x1){var _0x1f953d=_0x1289e5[_0x14d9ed][_0xe486('0x4f')]({'plain':!![]});_0x414e50['dialCheckDuplicateType']=_0x506598[_0xe486('0x4d')]['dialCheckDuplicateType']?_0x506598[_0xe486('0x4d')]['dialCheckDuplicateType']:_0x414e50[_0xe486('0x6d')];switch(_0x414e50['dialCheckDuplicateType']){case _0xe486('0x6e'):_0x439f75=squel[_0xe486('0x6f')]()['into'](_0xe486('0x70'))[_0xe486('0x71')]([_0xe486('0x72'),_0xe486('0x73'),_0xe486('0x74'),_0xe486('0x75'),_0xe486('0x5f'),_0xe486('0x59'),'updatedAt'],squel['select']()[_0xe486('0x76')](_0xe486('0x72'),_0xe486('0x72'))[_0xe486('0x76')](_0xe486('0x77'),_0xe486('0x73'))[_0xe486('0x76')]('id',_0xe486('0x74'))['field'](_0x1f953d[_0xe486('0x78')]['toString'](),_0xe486('0x75'))[_0xe486('0x76')](_0x506598[_0xe486('0x5b')]['id']['toString'](),'CampaignId')['field']('\x27'+_0x491543+'\x27',_0xe486('0x59'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27',_0xe486('0x5a'))[_0xe486('0x79')](_0xe486('0x7a'))[_0xe486('0x40')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x1f953d[_0xe486('0x78')][_0xe486('0x7b')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xe486('0x40')](_0xe486('0x7c'),squel[_0xe486('0x7d')]()[_0xe486('0x76')](_0xe486('0x7e'))[_0xe486('0x79')](_0xe486('0x7f'))[_0xe486('0x40')](_0xe486('0x80'),_0x506598[_0xe486('0x5b')]['id'][_0xe486('0x7b')]()))[_0xe486('0x40')](_0xe486('0x7c'),squel[_0xe486('0x7d')]()[_0xe486('0x76')](_0xe486('0x81'))[_0xe486('0x79')](_0xe486('0x70'))[_0xe486('0x40')](_0xe486('0x80'),_0x506598[_0xe486('0x5b')]['id']['toString']())))[_0xe486('0x7b')]();break;case _0xe486('0x82'):_0x439f75=squel['insert']()[_0xe486('0x83')](_0xe486('0x70'))[_0xe486('0x71')]([_0xe486('0x72'),'scheduledAt','ContactId','ListId','CampaignId',_0xe486('0x59'),_0xe486('0x5a')],squel[_0xe486('0x7d')]()[_0xe486('0x76')](_0xe486('0x72'),_0xe486('0x72'))[_0xe486('0x76')]('NOW()',_0xe486('0x73'))[_0xe486('0x76')]('id',_0xe486('0x74'))[_0xe486('0x76')](_0x1f953d[_0xe486('0x78')]['toString'](),_0xe486('0x75'))['field'](_0x506598['params']['id'][_0xe486('0x7b')](),_0xe486('0x5f'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27',_0xe486('0x59'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27',_0xe486('0x5a'))[_0xe486('0x79')](_0xe486('0x7a'))[_0xe486('0x40')](_0xe486('0x84'))[_0xe486('0x40')]('ListId\x20=\x20?',_0x1f953d[_0xe486('0x78')][_0xe486('0x7b')]())['where'](_0xe486('0x85'))['where'](_0xe486('0x7c'),squel[_0xe486('0x7d')]()[_0xe486('0x76')]('COALESCE(phone,\x27\x27)')[_0xe486('0x79')](_0xe486('0x70'))['where'](_0xe486('0x80'),_0x506598[_0xe486('0x5b')]['id'][_0xe486('0x7b')]())))[_0xe486('0x7b')]();break;default:_0x439f75=squel[_0xe486('0x6f')]()[_0xe486('0x83')]('cm_hopper')[_0xe486('0x71')](['phone',_0xe486('0x73'),_0xe486('0x74'),'ListId',_0xe486('0x5f'),_0xe486('0x59'),_0xe486('0x5a')],squel[_0xe486('0x7d')]()[_0xe486('0x76')](_0xe486('0x72'),'phone')[_0xe486('0x76')](_0xe486('0x77'),_0xe486('0x73'))['field']('id',_0xe486('0x74'))[_0xe486('0x76')](_0x1f953d[_0xe486('0x78')]['toString'](),_0xe486('0x75'))[_0xe486('0x76')](_0x506598[_0xe486('0x5b')]['id'][_0xe486('0x7b')](),_0xe486('0x5f'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27',_0xe486('0x59'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27',_0xe486('0x5a'))[_0xe486('0x79')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xe486('0x40')](_0xe486('0x86'),_0x1f953d[_0xe486('0x78')][_0xe486('0x7b')]())[_0xe486('0x40')](_0xe486('0x85')))[_0xe486('0x7b')]();}_0x7bf3ff=squel[_0xe486('0x6f')]()[_0xe486('0x83')](_0xe486('0x87'))[_0xe486('0x71')](['cmHopperId',_0xe486('0x73'),_0xe486('0x72'),_0xe486('0x88'),_0xe486('0x59'),_0xe486('0x5a')],squel['select']()[_0xe486('0x76')]('h.id','id')[_0xe486('0x76')]('NOW()','scheduledAt')[_0xe486('0x76')]('ci.item',_0xe486('0x72'))[_0xe486('0x76')](_0xe486('0x89'),_0xe486('0x88'))[_0xe486('0x76')]('\x27'+_0x491543+'\x27','createdAt')[_0xe486('0x76')]('\x27'+_0x491543+'\x27','updatedAt')[_0xe486('0x79')]('cm_contact_has_items','ci')[_0xe486('0x8a')]('cm_hopper','h',_0xe486('0x8b'))[_0xe486('0x40')]('h.ListId\x20=\x20?',_0x1f953d[_0xe486('0x78')]['toString']())[_0xe486('0x40')](_0xe486('0x8c'),_0x506598[_0xe486('0x5b')]['id'][_0xe486('0x7b')]())['where'](_0xe486('0x8d'),_0x491543))['toString']();_0x369b45[_0xe486('0x8e')](db[_0xe486('0x8f')][_0xe486('0x36')](_0x439f75));_0x4e2250[_0xe486('0x8e')](db[_0xe486('0x8f')][_0xe486('0x36')](_0x7bf3ff));}return BPromise[_0xe486('0x90')](_0x369b45);}})[_0xe486('0x28')](function(){return BPromise[_0xe486('0x90')](_0x4e2250);})[_0xe486('0x28')](function(){return _0x2f25ed;})[_0xe486('0x28')](respondWithResult(_0x5a2dd0,null))[_0xe486('0x48')](handleError(_0x5a2dd0,null));};exports[_0xe486('0x91')]=function(_0x319924,_0x11fc68,_0x36f91f){return db[_0xe486('0x44')][_0xe486('0x4b')]({'where':{'id':_0x319924['params']['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x11fc68,null))[_0xe486('0x28')](function(_0x382cdd){if(_0x382cdd){return _0x382cdd[_0xe486('0x91')](_0x319924[_0xe486('0x36')][_0xe486('0x6c')]);}})['then'](function(_0x4c032d){if(_0x4c032d){return db[_0xe486('0x61')]['destroy']({'where':{'ListId':_0x319924[_0xe486('0x36')][_0xe486('0x6c')],'CampaignId':_0x319924['params']['id']}})['then'](function(){return _0x4c032d;});}})[_0xe486('0x28')](respondWithStatusCode(_0x11fc68,null))['catch'](handleError(_0x11fc68,null));};exports[_0xe486('0x92')]=function(_0x40e0f3,_0x53b45d,_0x1a804d){var _0x23c08a={};var _0x42379b={};var _0xeb13bf;var _0x4314a8;return db[_0xe486('0x44')][_0xe486('0x5d')]({'where':{'id':_0x40e0f3[_0xe486('0x5b')]['id']}})['then'](handleEntityNotFound(_0x53b45d,null))['then'](function(_0x660778){if(_0x660778){_0xeb13bf=_0x660778;_0x42379b['model']=_[_0xe486('0x37')](db[_0xe486('0x69')]['rawAttributes']);_0x42379b[_0xe486('0x36')]=_[_0xe486('0x37')](_0x40e0f3['query']);_0x42379b[_0xe486('0x38')]=_[_0xe486('0x4a')](_0x42379b[_0xe486('0x34')],_0x42379b[_0xe486('0x36')]);_0x23c08a[_0xe486('0x39')]=_[_0xe486('0x4a')](_0x42379b[_0xe486('0x34')],qs[_0xe486('0x3a')](_0x40e0f3[_0xe486('0x36')][_0xe486('0x3a')]));_0x23c08a[_0xe486('0x39')]=_0x23c08a['attributes']['length']?_0x23c08a[_0xe486('0x39')]:_0x42379b[_0xe486('0x34')];_0x23c08a[_0xe486('0x3d')]=qs[_0xe486('0x3e')](_0x40e0f3[_0xe486('0x36')][_0xe486('0x3e')]);_0x23c08a[_0xe486('0x40')]=qs[_0xe486('0x38')](_['pick'](_0x40e0f3[_0xe486('0x36')],_0x42379b[_0xe486('0x38')]));if(_0x40e0f3[_0xe486('0x36')][_0xe486('0x60')]){_0x23c08a[_0xe486('0x40')]=_[_0xe486('0x42')](_0x23c08a[_0xe486('0x40')],{'$or':_[_0xe486('0x35')](_0x23c08a[_0xe486('0x39')],function(_0x2e8d19){var _0x8bc29c={};_0x8bc29c[_0x2e8d19]={'$like':'%'+_0x40e0f3[_0xe486('0x36')]['filter']+'%'};return _0x8bc29c;})});}_0x23c08a=_[_0xe486('0x42')]({},_0x23c08a,_0x40e0f3['options']);return _0xeb13bf['getBlackLists'](_0x23c08a);}})[_0xe486('0x28')](function(_0x2ca599){if(_0x2ca599){_0x4314a8=_0x2ca599['length'];if(!_0x40e0f3[_0xe486('0x36')][_0xe486('0x5e')](_0xe486('0x3c'))){_0x23c08a[_0xe486('0x21')]=qs['limit'](_0x40e0f3[_0xe486('0x36')]['limit']);_0x23c08a[_0xe486('0x22')]=qs[_0xe486('0x22')](_0x40e0f3[_0xe486('0x36')][_0xe486('0x22')]);}return _0xeb13bf['getBlackLists'](_0x23c08a);}})[_0xe486('0x28')](function(_0x2b863d){if(_0x2b863d){return _0x2b863d?{'count':_0x4314a8,'rows':_0x2b863d}:null;}})[_0xe486('0x28')](respondWithResult(_0x53b45d,null))[_0xe486('0x48')](handleError(_0x53b45d,null));};exports['addBlackLists']=function(_0x501d3f,_0x9c7f9b,_0x1fe136){var _0x248db2,_0xba5703;var _0x250045=[];var _0x4f874d=moment()[_0xe486('0x6a')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xe486('0x44')][_0xe486('0x4b')]({'where':{'id':_0x501d3f[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x9c7f9b,null))['then'](function(_0x73e5c5){if(_0x73e5c5){_0xba5703=_0x73e5c5;return _0x73e5c5['addBlackLists'](_0x501d3f[_0xe486('0x4d')]['ids'],_[_0xe486('0x58')](_0x501d3f[_0xe486('0x4d')],[_0xe486('0x6c'),'id'])||{});}return null;})[_0xe486('0x93')](function(_0x4dddb2){var _0x2fbc7c;var _0x2bfd7c;_0x248db2=_0x4dddb2||[];var _0x2ec0d7=[];if(_0x4dddb2){for(var _0x10b6b9=0x0;_0x10b6b9<_0x4dddb2[_0xe486('0x3b')];_0x10b6b9+=0x1){var _0x3d2c9c=_0x4dddb2[_0x10b6b9]['get']({'plain':!![]});_0x2fbc7c=squel['insert']()[_0xe486('0x83')](_0xe486('0x94'))[_0xe486('0x71')]([_0xe486('0x72'),_0xe486('0x74'),_0xe486('0x75'),_0xe486('0x5f'),_0xe486('0x59'),_0xe486('0x5a')],squel[_0xe486('0x7d')]()[_0xe486('0x76')](_0xe486('0x72'),_0xe486('0x72'))['field']('id','ContactId')[_0xe486('0x76')](_0x3d2c9c[_0xe486('0x78')][_0xe486('0x7b')](),'ListId')['field'](_0x501d3f['params']['id']['toString'](),_0xe486('0x5f'))['field'](_0xe486('0x77'),'createdAt')[_0xe486('0x76')](_0xe486('0x77'),_0xe486('0x5a'))[_0xe486('0x79')](_0xe486('0x7a'))['where'](_0xe486('0x84'))[_0xe486('0x40')]('ListId\x20=\x20?',_0x3d2c9c[_0xe486('0x78')][_0xe486('0x7b')]())[_0xe486('0x40')](_0xe486('0x85')))[_0xe486('0x7b')]();_0x2ec0d7[_0xe486('0x8e')](db[_0xe486('0x8f')][_0xe486('0x36')](_0x2fbc7c));}return BPromise[_0xe486('0x90')](_0x2ec0d7);}})[_0xe486('0x28')](function(){return _0x248db2;})[_0xe486('0x28')](respondWithResult(_0x9c7f9b,null))['catch'](handleError(_0x9c7f9b,null));};exports[_0xe486('0x95')]=function(_0x5b6077,_0x4e28c6,_0x32d8ba){return db['Campaign']['find']({'where':{'id':_0x5b6077[_0xe486('0x5b')]['id']}})[_0xe486('0x28')](handleEntityNotFound(_0x4e28c6,null))[_0xe486('0x28')](function(_0xc7e200){if(_0xc7e200){return _0xc7e200[_0xe486('0x95')](_0x5b6077[_0xe486('0x36')][_0xe486('0x6c')]);}})[_0xe486('0x28')](function(_0x2a9cb9){if(_0x2a9cb9){return db[_0xe486('0x67')]['destroy']({'where':{'ListId':_0x5b6077[_0xe486('0x36')]['ids'],'CampaignId':_0x5b6077[_0xe486('0x5b')]['id']}})['then'](function(){return _0x2a9cb9;});}})[_0xe486('0x28')](respondWithStatusCode(_0x4e28c6,null))[_0xe486('0x48')](handleError(_0x4e28c6,null));};
\ No newline at end of file
+var _0x3276=['hasOwnProperty','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','field','NOW()','CmListId','toString','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','select','onlyIfOpen','ContactId','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','OrderBy','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','ListId\x20=\x20?','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','IvrCampaigns','error','stack','name','send','Campaign','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filters','filter','merge','where','map','type','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','getHoppers','findOne'];(function(_0x24e91d,_0x5d6ffe){var _0x324d8d=function(_0x53a0e0){while(--_0x53a0e0){_0x24e91d['push'](_0x24e91d['shift']());}};_0x324d8d(++_0x5d6ffe);}(_0x3276,0xc7));var _0x6327=function(_0xd49307,_0x494d50){_0xd49307=_0xd49307-0x0;var _0x5c519=_0x3276[_0xd49307];return _0x5c519;};'use strict';var emlformat=require(_0x6327('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6327('0x1'));var rp=require(_0x6327('0x2'));var moment=require(_0x6327('0x3'));var BPromise=require(_0x6327('0x4'));var Mustache=require(_0x6327('0x5'));var util=require(_0x6327('0x6'));var path=require(_0x6327('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6327('0x8'));var fs=require('fs');var fs_extra=require(_0x6327('0x9'));var _=require(_0x6327('0xa'));var squel=require('squel');var crypto=require(_0x6327('0xb'));var jsforce=require(_0x6327('0xc'));var deskjs=require(_0x6327('0xd'));var toCsv=require(_0x6327('0xe'));var querystring=require('querystring');var Papa=require(_0x6327('0xf'));var Redis=require(_0x6327('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6327('0x11'));var as=require(_0x6327('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6327('0x13'))(_0x6327('0x14'));var utils=require(_0x6327('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6327('0x16'));var db=require(_0x6327('0x17'))['db'];function respondWithStatusCode(_0xb6de72,_0x32408c){_0x32408c=_0x32408c||0xcc;return function(_0x3ff61b){if(_0x3ff61b){return _0xb6de72[_0x6327('0x18')](_0x32408c);}return _0xb6de72[_0x6327('0x19')](_0x32408c)[_0x6327('0x1a')]();};}function respondWithResult(_0x576b1c,_0x306095){_0x306095=_0x306095||0xc8;return function(_0x48eb75){if(_0x48eb75){return _0x576b1c[_0x6327('0x19')](_0x306095)['json'](_0x48eb75);}};}function respondWithFilteredResult(_0x441ff9,_0x1e850c){return function(_0x43186f){if(_0x43186f){var _0x4e9741=typeof _0x1e850c[_0x6327('0x1b')]===_0x6327('0x1c')&&typeof _0x1e850c[_0x6327('0x1d')]===_0x6327('0x1c');var _0x3ea016=_0x43186f[_0x6327('0x1e')];var _0x341a51=_0x4e9741?0x0:_0x1e850c[_0x6327('0x1b')];var _0x287899=_0x4e9741?_0x43186f[_0x6327('0x1e')]:_0x1e850c[_0x6327('0x1b')]+_0x1e850c[_0x6327('0x1d')];var _0x55cf65;if(_0x287899>=_0x3ea016){_0x287899=_0x3ea016;_0x55cf65=0xc8;}else{_0x55cf65=0xce;}_0x441ff9[_0x6327('0x19')](_0x55cf65);return _0x441ff9[_0x6327('0x1f')](_0x6327('0x20'),_0x341a51+'-'+_0x287899+'/'+_0x3ea016)[_0x6327('0x21')](_0x43186f);}return null;};}function patchUpdates(_0x4cbc80){return function(_0x56249b){try{jsonpatch[_0x6327('0x22')](_0x56249b,_0x4cbc80,!![]);}catch(_0x700766){return BPromise[_0x6327('0x23')](_0x700766);}return _0x56249b[_0x6327('0x24')]();};}function saveUpdates(_0x3078c5,_0x76c718){return function(_0x5754e1){if(_0x5754e1){return _0x5754e1[_0x6327('0x25')](_0x3078c5)[_0x6327('0x26')](function(_0x2f153c){return _0x2f153c;});}return null;};}function removeEntity(_0x1c3d7f,_0x302b3f){return function(_0x254c2f){if(_0x254c2f){return _0x254c2f[_0x6327('0x27')]()[_0x6327('0x26')](function(){var _0x10e312=_0x254c2f['get']({'plain':!![]});var _0x51dbe9=_0x6327('0x28');return db['UserProfileResource'][_0x6327('0x27')]({'where':{'type':_0x51dbe9,'resourceId':_0x10e312['id']}})['then'](function(){return _0x254c2f;});})[_0x6327('0x26')](function(){_0x1c3d7f['status'](0xcc)[_0x6327('0x1a')]();});}};}function handleEntityNotFound(_0x1eae65,_0x486f8e){return function(_0x44caac){if(!_0x44caac){_0x1eae65[_0x6327('0x18')](0x194);}return _0x44caac;};}function handleError(_0x14b41b,_0x2540bf){_0x2540bf=_0x2540bf||0x1f4;return function(_0x894157){logger[_0x6327('0x29')](_0x894157[_0x6327('0x2a')]);if(_0x894157[_0x6327('0x2b')]){delete _0x894157['name'];}_0x14b41b[_0x6327('0x19')](_0x2540bf)[_0x6327('0x2c')](_0x894157);};}exports['index']=function(_0x269c33,_0x40e927){var _0x5e8ff5={},_0x43bcd0={},_0x41ecd5={'count':0x0,'rows':[]};var _0x330471=_['map'](db[_0x6327('0x2d')][_0x6327('0x2e')],function(_0x1066d9){return{'name':_0x1066d9[_0x6327('0x2f')],'type':_0x1066d9['type'][_0x6327('0x30')]};});_0x43bcd0['model']=_['map'](_0x330471,_0x6327('0x2b'));_0x43bcd0[_0x6327('0x31')]=_[_0x6327('0x32')](_0x269c33[_0x6327('0x31')]);_0x43bcd0['filters']=_[_0x6327('0x33')](_0x43bcd0[_0x6327('0x34')],_0x43bcd0[_0x6327('0x31')]);_0x5e8ff5[_0x6327('0x35')]=_['intersection'](_0x43bcd0[_0x6327('0x34')],qs[_0x6327('0x36')](_0x269c33[_0x6327('0x31')]['fields']));_0x5e8ff5[_0x6327('0x35')]=_0x5e8ff5[_0x6327('0x35')][_0x6327('0x37')]?_0x5e8ff5['attributes']:_0x43bcd0['model'];if(!_0x269c33[_0x6327('0x31')]['hasOwnProperty'](_0x6327('0x38'))){_0x5e8ff5['limit']=qs[_0x6327('0x1d')](_0x269c33[_0x6327('0x31')][_0x6327('0x1d')]);_0x5e8ff5[_0x6327('0x1b')]=qs[_0x6327('0x1b')](_0x269c33[_0x6327('0x31')]['offset']);}_0x5e8ff5[_0x6327('0x39')]=qs[_0x6327('0x3a')](_0x269c33[_0x6327('0x31')][_0x6327('0x3a')]);_0x5e8ff5['where']=qs['filters'](_[_0x6327('0x3b')](_0x269c33[_0x6327('0x31')],_0x43bcd0[_0x6327('0x3c')]),_0x330471);if(_0x269c33[_0x6327('0x31')][_0x6327('0x3d')]){_0x5e8ff5['where']=_[_0x6327('0x3e')](_0x5e8ff5[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x330471,function(_0x10b988){if(_0x10b988[_0x6327('0x41')]!=='VIRTUAL'){var _0x49a887={};_0x49a887[_0x10b988[_0x6327('0x2b')]]={'$like':'%'+_0x269c33['query'][_0x6327('0x3d')]+'%'};return _0x49a887;}})});}_0x5e8ff5=_[_0x6327('0x3e')]({},_0x5e8ff5,_0x269c33[_0x6327('0x42')]);var _0x46b813={'where':_0x5e8ff5['where']};return db[_0x6327('0x2d')][_0x6327('0x1e')](_0x46b813)[_0x6327('0x26')](function(_0x592f0e){_0x41ecd5[_0x6327('0x1e')]=_0x592f0e;if(_0x269c33[_0x6327('0x31')]['includeAll']){_0x5e8ff5[_0x6327('0x43')]=[{'all':!![]}];}return db[_0x6327('0x2d')][_0x6327('0x44')](_0x5e8ff5);})[_0x6327('0x26')](function(_0xab88fb){_0x41ecd5[_0x6327('0x45')]=_0xab88fb;return _0x41ecd5;})[_0x6327('0x26')](respondWithFilteredResult(_0x40e927,_0x5e8ff5))[_0x6327('0x46')](handleError(_0x40e927,null));};exports[_0x6327('0x47')]=function(_0xc73e4a,_0x446f7c){var _0x3550c9={'raw':![],'where':{'id':_0xc73e4a[_0x6327('0x48')]['id']}},_0x115ed4={};_0x115ed4[_0x6327('0x34')]=_[_0x6327('0x32')](db[_0x6327('0x2d')][_0x6327('0x2e')]);_0x115ed4['query']=_[_0x6327('0x32')](_0xc73e4a[_0x6327('0x31')]);_0x115ed4['filters']=_['intersection'](_0x115ed4['model'],_0x115ed4[_0x6327('0x31')]);_0x3550c9[_0x6327('0x35')]=_['intersection'](_0x115ed4[_0x6327('0x34')],qs[_0x6327('0x36')](_0xc73e4a[_0x6327('0x31')][_0x6327('0x36')]));_0x3550c9[_0x6327('0x35')]=_0x3550c9[_0x6327('0x35')][_0x6327('0x37')]?_0x3550c9[_0x6327('0x35')]:_0x115ed4[_0x6327('0x34')];if(_0xc73e4a['query'][_0x6327('0x49')]){_0x3550c9[_0x6327('0x43')]=[{'all':!![]}];}_0x3550c9=_[_0x6327('0x3e')]({},_0x3550c9,_0xc73e4a['options']);return db[_0x6327('0x2d')][_0x6327('0x4a')](_0x3550c9)[_0x6327('0x26')](handleEntityNotFound(_0x446f7c,null))[_0x6327('0x26')](respondWithResult(_0x446f7c,null))['catch'](handleError(_0x446f7c,null));};exports[_0x6327('0x4b')]=function(_0x317edf,_0x3fc622){return db[_0x6327('0x2d')][_0x6327('0x4b')](_0x317edf[_0x6327('0x4c')],{})[_0x6327('0x26')](function(_0x33e8d3){var _0x11030e=_0x317edf[_0x6327('0x4d')][_0x6327('0x4e')]({'plain':!![]});if(!_0x11030e)throw new Error(_0x6327('0x4f'));if(_0x11030e[_0x6327('0x50')]===_0x6327('0x4d')){var _0x5e664d=_0x33e8d3['get']({'plain':!![]});var _0x1f95b6=_0x6327('0x28');return db[_0x6327('0x51')][_0x6327('0x4a')]({'where':{'name':_0x1f95b6,'userProfileId':_0x11030e[_0x6327('0x52')]},'raw':!![]})[_0x6327('0x26')](function(_0xc07c32){if(_0xc07c32&&_0xc07c32[_0x6327('0x53')]===0x0){return db[_0x6327('0x54')][_0x6327('0x4b')]({'name':_0x5e664d[_0x6327('0x2b')],'resourceId':_0x5e664d['id'],'type':_0xc07c32[_0x6327('0x2b')],'sectionId':_0xc07c32['id']},{})[_0x6327('0x26')](function(){return _0x33e8d3;});}else{return _0x33e8d3;}})[_0x6327('0x46')](function(_0x5daaed){logger[_0x6327('0x29')](_0x6327('0x55'),_0x5daaed);throw _0x5daaed;});}return _0x33e8d3;})[_0x6327('0x26')](respondWithResult(_0x3fc622,0xc9))[_0x6327('0x46')](handleError(_0x3fc622,null));};exports['clone']=function(_0x3e2b4f,_0x2ad46b){var _0x12862d={'where':{'id':_0x3e2b4f[_0x6327('0x48')]['id']}},_0x1bf90e={};_0x1bf90e['model']=_[_0x6327('0x32')](db['Campaign'][_0x6327('0x2e')]);_0x12862d[_0x6327('0x35')]=_[_0x6327('0x33')](_0x1bf90e[_0x6327('0x34')],qs[_0x6327('0x36')](_0x3e2b4f[_0x6327('0x31')]['fields']));_0x12862d[_0x6327('0x35')]=_0x12862d[_0x6327('0x35')]['length']?_0x12862d[_0x6327('0x35')]:_0x1bf90e[_0x6327('0x34')];if(_0x3e2b4f[_0x6327('0x31')][_0x6327('0x49')]){_0x12862d[_0x6327('0x43')]=[{'all':!![]}];}_0x12862d=_[_0x6327('0x3e')]({},_0x12862d,_0x3e2b4f[_0x6327('0x42')]);return db[_0x6327('0x2d')]['find'](_0x12862d)[_0x6327('0x26')](handleEntityNotFound(_0x2ad46b,null))[_0x6327('0x26')](function(_0x46c6bd){if(_0x46c6bd){var _0x2188c2=_0x46c6bd[_0x6327('0x4e')]({'plain':!![]});_0x2188c2=qs[_0x6327('0x56')](_0x2188c2,['id','createdAt',_0x6327('0x57')]);_0x3e2b4f['body']=_[_0x6327('0x56')](_0x3e2b4f[_0x6327('0x4c')],['id',_0x6327('0x58'),_0x6327('0x57')]);return db[_0x6327('0x2d')][_0x6327('0x4b')](_[_0x6327('0x3e')](_0x2188c2,_0x3e2b4f[_0x6327('0x4c')]),{'include':_0x3e2b4f[_0x6327('0x31')][_0x6327('0x49')]?[{'all':!![]}]:undefined})[_0x6327('0x26')](function(_0x36f28a){var _0x3f0115=_0x3e2b4f['user'][_0x6327('0x4e')]({'plain':!![]});if(!_0x3f0115)throw new Error(_0x6327('0x4f'));if(_0x3f0115[_0x6327('0x50')]==='user'){var _0xbf5d09=_0x36f28a[_0x6327('0x4e')]({'plain':!![]});var _0x57ca83='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x57ca83,'userProfileId':_0x3f0115[_0x6327('0x52')]},'raw':!![]})[_0x6327('0x26')](function(_0x36f8c2){if(_0x36f8c2&&_0x36f8c2[_0x6327('0x53')]===0x0){return db[_0x6327('0x54')]['create']({'name':_0xbf5d09['name'],'resourceId':_0xbf5d09['id'],'type':_0x36f8c2[_0x6327('0x2b')],'sectionId':_0x36f8c2['id']},{})[_0x6327('0x26')](function(){return _0x36f28a;});}else{return _0x36f28a;}})['catch'](function(_0x28f13e){logger[_0x6327('0x29')](_0x6327('0x55'),_0x28f13e);throw _0x28f13e;});}return _0x36f28a;});}})[_0x6327('0x26')](respondWithResult(_0x2ad46b,0xc9))[_0x6327('0x46')](handleError(_0x2ad46b,null));};exports[_0x6327('0x25')]=function(_0x4b4031,_0x5446db){if(_0x4b4031['body']['id']){delete _0x4b4031[_0x6327('0x4c')]['id'];}return db[_0x6327('0x2d')]['find']({'where':{'id':_0x4b4031['params']['id']}})['then'](handleEntityNotFound(_0x5446db,null))[_0x6327('0x26')](saveUpdates(_0x4b4031[_0x6327('0x4c')],null))[_0x6327('0x26')](respondWithResult(_0x5446db,null))[_0x6327('0x46')](handleError(_0x5446db,null));};exports['destroy']=function(_0x3e66b5,_0x276fe1){return db[_0x6327('0x2d')]['find']({'where':{'id':_0x3e66b5['params']['id']}})['then'](handleEntityNotFound(_0x276fe1,null))[_0x6327('0x26')](removeEntity(_0x276fe1,null))[_0x6327('0x46')](handleError(_0x276fe1,null));};exports[_0x6327('0x59')]=function(_0x4c9e12,_0x513e06,_0x54326a){var _0x17b571={'raw':!![],'where':{}};var _0x5bbc4a={};var _0x1e2376={'count':0x0,'rows':[]};return db['Campaign'][_0x6327('0x5a')]({'where':{'id':_0x4c9e12[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x513e06,null))['then'](function(_0x4bdeab){if(_0x4bdeab){_0x5bbc4a[_0x6327('0x34')]=_[_0x6327('0x32')](db['CmHopper'][_0x6327('0x2e')]);_0x5bbc4a[_0x6327('0x31')]=_[_0x6327('0x32')](_0x4c9e12['query']);_0x5bbc4a[_0x6327('0x3c')]=_['intersection'](_0x5bbc4a[_0x6327('0x34')],_0x5bbc4a[_0x6327('0x31')]);_0x17b571[_0x6327('0x35')]=_[_0x6327('0x33')](_0x5bbc4a[_0x6327('0x34')],qs[_0x6327('0x36')](_0x4c9e12[_0x6327('0x31')][_0x6327('0x36')]));_0x17b571['attributes']=_0x17b571[_0x6327('0x35')][_0x6327('0x37')]?_0x17b571[_0x6327('0x35')]:_0x5bbc4a[_0x6327('0x34')];if(!_0x4c9e12['query'][_0x6327('0x5b')](_0x6327('0x38'))){_0x17b571[_0x6327('0x1d')]=qs[_0x6327('0x1d')](_0x4c9e12['query'][_0x6327('0x1d')]);_0x17b571[_0x6327('0x1b')]=qs['offset'](_0x4c9e12[_0x6327('0x31')][_0x6327('0x1b')]);}_0x17b571['order']=qs[_0x6327('0x3a')](_0x4c9e12['query'][_0x6327('0x3a')]);_0x17b571[_0x6327('0x3f')]=qs[_0x6327('0x3c')](_['pick'](_0x4c9e12[_0x6327('0x31')],_0x5bbc4a['filters']));_0x17b571['where'][_0x6327('0x5c')]=_0x4bdeab['id'];if(_0x4c9e12['query'][_0x6327('0x3d')]){_0x17b571[_0x6327('0x3f')]=_[_0x6327('0x3e')](_0x17b571[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x17b571[_0x6327('0x35')],function(_0x1b3a5e){var _0x29ee0f={};_0x29ee0f[_0x1b3a5e]={'$like':'%'+_0x4c9e12[_0x6327('0x31')][_0x6327('0x3d')]+'%'};return _0x29ee0f;})});}_0x17b571=_['merge']({},_0x17b571,_0x4c9e12[_0x6327('0x42')]);return db[_0x6327('0x5d')][_0x6327('0x1e')]({'where':_0x17b571['where']})['then'](function(_0x55645d){_0x1e2376['count']=_0x55645d;if(_0x4c9e12[_0x6327('0x31')][_0x6327('0x49')]){_0x17b571[_0x6327('0x43')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x17b571);})[_0x6327('0x26')](function(_0x45bc3d){_0x1e2376[_0x6327('0x45')]=_0x45bc3d;return _0x1e2376;});}})[_0x6327('0x26')](respondWithFilteredResult(_0x513e06,_0x17b571))['catch'](handleError(_0x513e06,null));};exports[_0x6327('0x5e')]=function(_0x7d3f15,_0x4346b8,_0x3973dd){var _0x188557={'raw':!![],'where':{}};var _0x33b36f={};var _0x3ecb75={'count':0x0,'rows':[]};return db['Campaign'][_0x6327('0x5a')]({'where':{'id':_0x7d3f15['params']['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x4346b8,null))[_0x6327('0x26')](function(_0x101a46){if(_0x101a46){_0x33b36f['model']=_[_0x6327('0x32')](db[_0x6327('0x5f')][_0x6327('0x2e')]);_0x33b36f[_0x6327('0x31')]=_[_0x6327('0x32')](_0x7d3f15['query']);_0x33b36f['filters']=_[_0x6327('0x33')](_0x33b36f[_0x6327('0x34')],_0x33b36f[_0x6327('0x31')]);_0x188557['attributes']=_[_0x6327('0x33')](_0x33b36f[_0x6327('0x34')],qs[_0x6327('0x36')](_0x7d3f15[_0x6327('0x31')]['fields']));_0x188557['attributes']=_0x188557[_0x6327('0x35')][_0x6327('0x37')]?_0x188557['attributes']:_0x33b36f['model'];if(!_0x7d3f15[_0x6327('0x31')][_0x6327('0x5b')](_0x6327('0x38'))){_0x188557[_0x6327('0x1d')]=qs[_0x6327('0x1d')](_0x7d3f15[_0x6327('0x31')][_0x6327('0x1d')]);_0x188557[_0x6327('0x1b')]=qs['offset'](_0x7d3f15['query'][_0x6327('0x1b')]);}_0x188557[_0x6327('0x39')]=qs[_0x6327('0x3a')](_0x7d3f15['query']['sort']);_0x188557['where']=qs[_0x6327('0x3c')](_['pick'](_0x7d3f15[_0x6327('0x31')],_0x33b36f['filters']));_0x188557['where']['CampaignId']=_0x101a46['id'];if(_0x7d3f15[_0x6327('0x31')]['filter']){_0x188557[_0x6327('0x3f')]=_[_0x6327('0x3e')](_0x188557[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x188557['attributes'],function(_0x2936da){var _0x5e721b={};_0x5e721b[_0x2936da]={'$like':'%'+_0x7d3f15[_0x6327('0x31')][_0x6327('0x3d')]+'%'};return _0x5e721b;})});}_0x188557=_[_0x6327('0x3e')]({},_0x188557,_0x7d3f15[_0x6327('0x42')]);return db[_0x6327('0x5f')][_0x6327('0x1e')]({'where':_0x188557[_0x6327('0x3f')]})[_0x6327('0x26')](function(_0x52b63f){_0x3ecb75['count']=_0x52b63f;if(_0x7d3f15[_0x6327('0x31')][_0x6327('0x49')]){_0x188557[_0x6327('0x43')]=[{'all':!![]}];}return db[_0x6327('0x5f')][_0x6327('0x44')](_0x188557);})[_0x6327('0x26')](function(_0x561b1a){_0x3ecb75[_0x6327('0x45')]=_0x561b1a;return _0x3ecb75;});}})[_0x6327('0x26')](respondWithFilteredResult(_0x4346b8,_0x188557))[_0x6327('0x46')](handleError(_0x4346b8,null));};exports['getHopperFinals']=function(_0x59a5cc,_0x15a1dc,_0x424e54){var _0x35477c={'raw':!![],'where':{}};var _0x1193c5={};var _0x12726d={'count':0x0,'rows':[]};return db[_0x6327('0x2d')]['findOne']({'where':{'id':_0x59a5cc[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x15a1dc,null))[_0x6327('0x26')](function(_0x40019b){if(_0x40019b){_0x1193c5[_0x6327('0x34')]=_[_0x6327('0x32')](db[_0x6327('0x60')]['rawAttributes']);_0x1193c5[_0x6327('0x31')]=_[_0x6327('0x32')](_0x59a5cc[_0x6327('0x31')]);_0x1193c5[_0x6327('0x3c')]=_[_0x6327('0x33')](_0x1193c5['model'],_0x1193c5['query']);_0x35477c[_0x6327('0x35')]=_[_0x6327('0x33')](_0x1193c5[_0x6327('0x34')],qs[_0x6327('0x36')](_0x59a5cc[_0x6327('0x31')][_0x6327('0x36')]));_0x35477c['attributes']=_0x35477c[_0x6327('0x35')][_0x6327('0x37')]?_0x35477c[_0x6327('0x35')]:_0x1193c5['model'];if(!_0x59a5cc[_0x6327('0x31')][_0x6327('0x5b')](_0x6327('0x38'))){_0x35477c[_0x6327('0x1d')]=qs['limit'](_0x59a5cc[_0x6327('0x31')][_0x6327('0x1d')]);_0x35477c[_0x6327('0x1b')]=qs[_0x6327('0x1b')](_0x59a5cc[_0x6327('0x31')][_0x6327('0x1b')]);}_0x35477c[_0x6327('0x39')]=qs[_0x6327('0x3a')](_0x59a5cc[_0x6327('0x31')]['sort']);_0x35477c[_0x6327('0x3f')]=qs['filters'](_[_0x6327('0x3b')](_0x59a5cc[_0x6327('0x31')],_0x1193c5['filters']));_0x35477c[_0x6327('0x3f')]['CampaignId']=_0x40019b['id'];if(_0x59a5cc[_0x6327('0x31')]['filter']){_0x35477c[_0x6327('0x3f')]=_['merge'](_0x35477c[_0x6327('0x3f')],{'$or':_['map'](_0x35477c[_0x6327('0x35')],function(_0xb46760){var _0x173560={};_0x173560[_0xb46760]={'$like':'%'+_0x59a5cc['query']['filter']+'%'};return _0x173560;})});}_0x35477c=_[_0x6327('0x3e')]({},_0x35477c,_0x59a5cc[_0x6327('0x42')]);return db['CmHopperFinal'][_0x6327('0x1e')]({'where':_0x35477c[_0x6327('0x3f')]})[_0x6327('0x26')](function(_0x5d6a16){_0x12726d[_0x6327('0x1e')]=_0x5d6a16;if(_0x59a5cc[_0x6327('0x31')]['includeAll']){_0x35477c['include']=[{'all':!![]}];}return db[_0x6327('0x60')][_0x6327('0x44')](_0x35477c);})[_0x6327('0x26')](function(_0x3f23c4){_0x12726d['rows']=_0x3f23c4;return _0x12726d;});}})[_0x6327('0x26')](respondWithFilteredResult(_0x15a1dc,_0x35477c))[_0x6327('0x46')](handleError(_0x15a1dc,null));};exports[_0x6327('0x61')]=function(_0x48645b,_0xf25a85,_0x18cba6){var _0x6c8c4c={'raw':!![],'where':{}};var _0x1b6b96={};var _0x254fdc={'count':0x0,'rows':[]};return db[_0x6327('0x2d')][_0x6327('0x5a')]({'where':{'id':_0x48645b[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0xf25a85,null))[_0x6327('0x26')](function(_0x43eae1){if(_0x43eae1){_0x1b6b96['model']=_[_0x6327('0x32')](db['CmHopperBlack'][_0x6327('0x2e')]);_0x1b6b96[_0x6327('0x31')]=_[_0x6327('0x32')](_0x48645b[_0x6327('0x31')]);_0x1b6b96[_0x6327('0x3c')]=_['intersection'](_0x1b6b96[_0x6327('0x34')],_0x1b6b96['query']);_0x6c8c4c[_0x6327('0x35')]=_[_0x6327('0x33')](_0x1b6b96[_0x6327('0x34')],qs[_0x6327('0x36')](_0x48645b[_0x6327('0x31')][_0x6327('0x36')]));_0x6c8c4c[_0x6327('0x35')]=_0x6c8c4c[_0x6327('0x35')][_0x6327('0x37')]?_0x6c8c4c[_0x6327('0x35')]:_0x1b6b96[_0x6327('0x34')];if(!_0x48645b[_0x6327('0x31')][_0x6327('0x5b')]('nolimit')){_0x6c8c4c[_0x6327('0x1d')]=qs['limit'](_0x48645b['query'][_0x6327('0x1d')]);_0x6c8c4c[_0x6327('0x1b')]=qs[_0x6327('0x1b')](_0x48645b[_0x6327('0x31')]['offset']);}_0x6c8c4c[_0x6327('0x39')]=qs['sort'](_0x48645b['query']['sort']);_0x6c8c4c['where']=qs[_0x6327('0x3c')](_['pick'](_0x48645b[_0x6327('0x31')],_0x1b6b96[_0x6327('0x3c')]));_0x6c8c4c[_0x6327('0x3f')]['CampaignId']=_0x43eae1['id'];if(_0x48645b[_0x6327('0x31')][_0x6327('0x3d')]){_0x6c8c4c[_0x6327('0x3f')]=_['merge'](_0x6c8c4c[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x6c8c4c[_0x6327('0x35')],function(_0x267bdc){var _0x30e33c={};_0x30e33c[_0x267bdc]={'$like':'%'+_0x48645b[_0x6327('0x31')][_0x6327('0x3d')]+'%'};return _0x30e33c;})});}_0x6c8c4c=_[_0x6327('0x3e')]({},_0x6c8c4c,_0x48645b[_0x6327('0x42')]);return db[_0x6327('0x62')][_0x6327('0x1e')]({'where':_0x6c8c4c['where']})['then'](function(_0x2a225b){_0x254fdc[_0x6327('0x1e')]=_0x2a225b;if(_0x48645b[_0x6327('0x31')]['includeAll']){_0x6c8c4c['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x6327('0x44')](_0x6c8c4c);})['then'](function(_0x43381e){_0x254fdc[_0x6327('0x45')]=_0x43381e;return _0x254fdc;});}})['then'](respondWithFilteredResult(_0xf25a85,_0x6c8c4c))[_0x6327('0x46')](handleError(_0xf25a85,null));};exports[_0x6327('0x63')]=function(_0x2bb6e5,_0x59b7f0,_0x1c9921){var _0x3fed01={};var _0x345f6c={};var _0xd091e1;var _0x9f1c8d;return db[_0x6327('0x2d')][_0x6327('0x5a')]({'where':{'id':_0x2bb6e5['params']['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x59b7f0,null))[_0x6327('0x26')](function(_0x27e847){if(_0x27e847){_0xd091e1=_0x27e847;_0x345f6c[_0x6327('0x34')]=_[_0x6327('0x32')](db[_0x6327('0x64')][_0x6327('0x2e')]);_0x345f6c['query']=_[_0x6327('0x32')](_0x2bb6e5[_0x6327('0x31')]);_0x345f6c[_0x6327('0x3c')]=_[_0x6327('0x33')](_0x345f6c[_0x6327('0x34')],_0x345f6c[_0x6327('0x31')]);_0x3fed01[_0x6327('0x35')]=_[_0x6327('0x33')](_0x345f6c[_0x6327('0x34')],qs[_0x6327('0x36')](_0x2bb6e5[_0x6327('0x31')][_0x6327('0x36')]));_0x3fed01[_0x6327('0x35')]=_0x3fed01['attributes']['length']?_0x3fed01[_0x6327('0x35')]:_0x345f6c[_0x6327('0x34')];_0x3fed01[_0x6327('0x39')]=qs[_0x6327('0x3a')](_0x2bb6e5[_0x6327('0x31')][_0x6327('0x3a')]);_0x3fed01[_0x6327('0x3f')]=qs[_0x6327('0x3c')](_[_0x6327('0x3b')](_0x2bb6e5[_0x6327('0x31')],_0x345f6c['filters']));if(_0x2bb6e5[_0x6327('0x31')][_0x6327('0x3d')]){_0x3fed01[_0x6327('0x3f')]=_[_0x6327('0x3e')](_0x3fed01[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x3fed01[_0x6327('0x35')],function(_0x13abc5){var _0x518315={};_0x518315[_0x13abc5]={'$like':'%'+_0x2bb6e5[_0x6327('0x31')][_0x6327('0x3d')]+'%'};return _0x518315;})});}_0x3fed01=_[_0x6327('0x3e')]({},_0x3fed01,_0x2bb6e5['options']);return _0xd091e1[_0x6327('0x63')](_0x3fed01);}})[_0x6327('0x26')](function(_0x42d4ff){if(_0x42d4ff){_0x9f1c8d=_0x42d4ff[_0x6327('0x37')];if(!_0x2bb6e5[_0x6327('0x31')][_0x6327('0x5b')](_0x6327('0x38'))){_0x3fed01[_0x6327('0x1d')]=qs[_0x6327('0x1d')](_0x2bb6e5[_0x6327('0x31')]['limit']);_0x3fed01[_0x6327('0x1b')]=qs[_0x6327('0x1b')](_0x2bb6e5[_0x6327('0x31')][_0x6327('0x1b')]);}return _0xd091e1[_0x6327('0x63')](_0x3fed01);}})['then'](function(_0x48888c){if(_0x48888c){return _0x48888c?{'count':_0x9f1c8d,'rows':_0x48888c}:null;}})['then'](respondWithResult(_0x59b7f0,null))[_0x6327('0x46')](handleError(_0x59b7f0,null));};exports[_0x6327('0x65')]=function(_0x3f1526,_0x3cd50a,_0x718062){var _0x132990,_0x486571;var _0x56c2b0=[];var _0x364719=moment()[_0x6327('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x6327('0x4a')]({'where':{'id':_0x3f1526[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x3cd50a,null))[_0x6327('0x26')](function(_0x594fb3){if(_0x594fb3){_0x486571=_0x594fb3;return _0x594fb3[_0x6327('0x65')](_0x3f1526[_0x6327('0x4c')][_0x6327('0x67')],_[_0x6327('0x56')](_0x3f1526[_0x6327('0x4c')],[_0x6327('0x67'),'id'])||{});}return null;})[_0x6327('0x68')](function(_0x9e2e85){var _0x4174e4;var _0x4fa038;_0x132990=_0x9e2e85||[];var _0x570605=[];if(_0x9e2e85){for(var _0x1aa3ba=0x0;_0x1aa3ba<_0x9e2e85[_0x6327('0x37')];_0x1aa3ba+=0x1){var _0x3534a9=_0x9e2e85[_0x1aa3ba]['get']({'plain':!![]});_0x486571['dialCheckDuplicateType']=_0x3f1526[_0x6327('0x4c')]['dialCheckDuplicateType']?_0x3f1526[_0x6327('0x4c')][_0x6327('0x69')]:_0x486571[_0x6327('0x69')];switch(_0x486571[_0x6327('0x69')]){case _0x6327('0x6a'):_0x4174e4=squel[_0x6327('0x6b')]()[_0x6327('0x6c')](_0x6327('0x6d'))[_0x6327('0x6e')]([_0x6327('0x6f'),_0x6327('0x70'),'ContactId',_0x6327('0x71'),_0x6327('0x5c'),_0x6327('0x58'),_0x6327('0x57')],squel['select']()[_0x6327('0x72')](_0x6327('0x6f'),_0x6327('0x6f'))[_0x6327('0x72')](_0x6327('0x73'),_0x6327('0x70'))[_0x6327('0x72')]('id','ContactId')[_0x6327('0x72')](_0x3534a9[_0x6327('0x74')][_0x6327('0x75')](),'ListId')[_0x6327('0x72')](_0x3f1526['params']['id'][_0x6327('0x75')](),_0x6327('0x5c'))[_0x6327('0x72')]('\x27'+_0x364719+'\x27','createdAt')[_0x6327('0x72')]('\x27'+_0x364719+'\x27',_0x6327('0x57'))[_0x6327('0x76')](_0x6327('0x77'))[_0x6327('0x3f')]('deletedAt\x20IS\x20NULL')[_0x6327('0x3f')]('ListId\x20=\x20?',_0x3534a9[_0x6327('0x74')][_0x6327('0x75')]())[_0x6327('0x3f')](_0x6327('0x78'))[_0x6327('0x3f')](_0x6327('0x79'),squel['select']()['field'](_0x6327('0x7a'))['from'](_0x6327('0x7b'))[_0x6327('0x3f')](_0x6327('0x7c'),_0x3f1526[_0x6327('0x48')]['id'][_0x6327('0x75')]()))[_0x6327('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6327('0x7d')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x6327('0x6d'))[_0x6327('0x3f')]('CampaignId\x20=\x20?',_0x3f1526[_0x6327('0x48')]['id'][_0x6327('0x75')]())))['toString']();break;case _0x6327('0x7e'):_0x4174e4=squel[_0x6327('0x6b')]()[_0x6327('0x6c')](_0x6327('0x6d'))[_0x6327('0x6e')]([_0x6327('0x6f'),_0x6327('0x70'),_0x6327('0x7f'),_0x6327('0x71'),_0x6327('0x5c'),_0x6327('0x58'),_0x6327('0x57')],squel[_0x6327('0x7d')]()[_0x6327('0x72')](_0x6327('0x6f'),_0x6327('0x6f'))[_0x6327('0x72')]('NOW()',_0x6327('0x70'))[_0x6327('0x72')]('id',_0x6327('0x7f'))[_0x6327('0x72')](_0x3534a9[_0x6327('0x74')][_0x6327('0x75')](),_0x6327('0x71'))[_0x6327('0x72')](_0x3f1526[_0x6327('0x48')]['id']['toString'](),_0x6327('0x5c'))[_0x6327('0x72')]('\x27'+_0x364719+'\x27','createdAt')[_0x6327('0x72')]('\x27'+_0x364719+'\x27','updatedAt')[_0x6327('0x76')](_0x6327('0x77'))[_0x6327('0x3f')]('deletedAt\x20IS\x20NULL')[_0x6327('0x3f')]('ListId\x20=\x20?',_0x3534a9[_0x6327('0x74')][_0x6327('0x75')]())[_0x6327('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0x6327('0x3f')](_0x6327('0x79'),squel[_0x6327('0x7d')]()[_0x6327('0x72')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x6327('0x3f')]('CampaignId\x20=\x20?',_0x3f1526['params']['id'][_0x6327('0x75')]())))[_0x6327('0x75')]();break;default:_0x4174e4=squel[_0x6327('0x6b')]()[_0x6327('0x6c')]('cm_hopper')['fromQuery']([_0x6327('0x6f'),'scheduledAt',_0x6327('0x7f'),_0x6327('0x71'),'CampaignId',_0x6327('0x58'),'updatedAt'],squel[_0x6327('0x7d')]()['field'](_0x6327('0x6f'),'phone')[_0x6327('0x72')](_0x6327('0x73'),_0x6327('0x70'))[_0x6327('0x72')]('id',_0x6327('0x7f'))[_0x6327('0x72')](_0x3534a9['CmListId'][_0x6327('0x75')](),_0x6327('0x71'))['field'](_0x3f1526['params']['id']['toString'](),_0x6327('0x5c'))['field']('\x27'+_0x364719+'\x27',_0x6327('0x58'))[_0x6327('0x72')]('\x27'+_0x364719+'\x27',_0x6327('0x57'))['from']('cm_contacts')['where'](_0x6327('0x80'))[_0x6327('0x3f')]('ListId\x20=\x20?',_0x3534a9['CmListId'][_0x6327('0x75')]())[_0x6327('0x3f')](_0x6327('0x78')))['toString']();}_0x4fa038=squel[_0x6327('0x6b')]()[_0x6327('0x6c')](_0x6327('0x81'))['fromQuery'](['cmHopperId',_0x6327('0x70'),_0x6327('0x6f'),_0x6327('0x82'),'createdAt','updatedAt'],squel[_0x6327('0x7d')]()[_0x6327('0x72')]('h.id','id')[_0x6327('0x72')](_0x6327('0x73'),'scheduledAt')[_0x6327('0x72')]('ci.item','phone')[_0x6327('0x72')](_0x6327('0x83'),_0x6327('0x82'))[_0x6327('0x72')]('\x27'+_0x364719+'\x27',_0x6327('0x58'))[_0x6327('0x72')]('\x27'+_0x364719+'\x27',_0x6327('0x57'))[_0x6327('0x76')](_0x6327('0x84'),'ci')[_0x6327('0x85')](_0x6327('0x6d'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x6327('0x3f')](_0x6327('0x86'),_0x3534a9[_0x6327('0x74')][_0x6327('0x75')]())[_0x6327('0x3f')](_0x6327('0x87'),_0x3f1526[_0x6327('0x48')]['id'][_0x6327('0x75')]())[_0x6327('0x3f')](_0x6327('0x88'),_0x364719))[_0x6327('0x75')]();_0x570605[_0x6327('0x89')](db[_0x6327('0x8a')]['query'](_0x4174e4));_0x56c2b0[_0x6327('0x89')](db[_0x6327('0x8a')][_0x6327('0x31')](_0x4fa038));}return BPromise[_0x6327('0x8b')](_0x570605);}})['then'](function(){return BPromise[_0x6327('0x8b')](_0x56c2b0);})[_0x6327('0x26')](function(){return _0x132990;})[_0x6327('0x26')](respondWithResult(_0x3cd50a,null))[_0x6327('0x46')](handleError(_0x3cd50a,null));};exports[_0x6327('0x8c')]=function(_0x1a719a,_0x13a38c,_0x457343){return db[_0x6327('0x2d')][_0x6327('0x4a')]({'where':{'id':_0x1a719a[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x13a38c,null))[_0x6327('0x26')](function(_0xdad37e){if(_0xdad37e){return _0xdad37e[_0x6327('0x8c')](_0x1a719a[_0x6327('0x31')][_0x6327('0x67')]);}})[_0x6327('0x26')](function(_0x1f4b95){if(_0x1f4b95){return db[_0x6327('0x5d')][_0x6327('0x27')]({'where':{'ListId':_0x1a719a[_0x6327('0x31')][_0x6327('0x67')],'CampaignId':_0x1a719a[_0x6327('0x48')]['id']}})[_0x6327('0x26')](function(){return _0x1f4b95;});}})[_0x6327('0x26')](respondWithStatusCode(_0x13a38c,null))[_0x6327('0x46')](handleError(_0x13a38c,null));};exports[_0x6327('0x8d')]=function(_0x49975c,_0x6546a9,_0x526d09){var _0x26582e={};var _0x4f0579={};var _0x4ec482;var _0xf593bf;return db[_0x6327('0x2d')][_0x6327('0x5a')]({'where':{'id':_0x49975c[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x6546a9,null))[_0x6327('0x26')](function(_0xaee17e){if(_0xaee17e){_0x4ec482=_0xaee17e;_0x4f0579[_0x6327('0x34')]=_[_0x6327('0x32')](db[_0x6327('0x64')][_0x6327('0x2e')]);_0x4f0579[_0x6327('0x31')]=_[_0x6327('0x32')](_0x49975c[_0x6327('0x31')]);_0x4f0579['filters']=_[_0x6327('0x33')](_0x4f0579[_0x6327('0x34')],_0x4f0579[_0x6327('0x31')]);_0x26582e['attributes']=_['intersection'](_0x4f0579['model'],qs['fields'](_0x49975c[_0x6327('0x31')][_0x6327('0x36')]));_0x26582e[_0x6327('0x35')]=_0x26582e['attributes'][_0x6327('0x37')]?_0x26582e[_0x6327('0x35')]:_0x4f0579[_0x6327('0x34')];_0x26582e[_0x6327('0x39')]=qs[_0x6327('0x3a')](_0x49975c[_0x6327('0x31')][_0x6327('0x3a')]);_0x26582e[_0x6327('0x3f')]=qs[_0x6327('0x3c')](_[_0x6327('0x3b')](_0x49975c[_0x6327('0x31')],_0x4f0579[_0x6327('0x3c')]));if(_0x49975c[_0x6327('0x31')][_0x6327('0x3d')]){_0x26582e[_0x6327('0x3f')]=_[_0x6327('0x3e')](_0x26582e[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x26582e[_0x6327('0x35')],function(_0x3d7eea){var _0x30f233={};_0x30f233[_0x3d7eea]={'$like':'%'+_0x49975c[_0x6327('0x31')][_0x6327('0x3d')]+'%'};return _0x30f233;})});}_0x26582e=_[_0x6327('0x3e')]({},_0x26582e,_0x49975c[_0x6327('0x42')]);return _0x4ec482[_0x6327('0x8d')](_0x26582e);}})[_0x6327('0x26')](function(_0x21df66){if(_0x21df66){_0xf593bf=_0x21df66[_0x6327('0x37')];if(!_0x49975c[_0x6327('0x31')][_0x6327('0x5b')]('nolimit')){_0x26582e['limit']=qs[_0x6327('0x1d')](_0x49975c[_0x6327('0x31')]['limit']);_0x26582e[_0x6327('0x1b')]=qs['offset'](_0x49975c[_0x6327('0x31')]['offset']);}return _0x4ec482[_0x6327('0x8d')](_0x26582e);}})[_0x6327('0x26')](function(_0x52c67a){if(_0x52c67a){return _0x52c67a?{'count':_0xf593bf,'rows':_0x52c67a}:null;}})['then'](respondWithResult(_0x6546a9,null))[_0x6327('0x46')](handleError(_0x6546a9,null));};exports[_0x6327('0x8e')]=function(_0x4e7082,_0x497d7f,_0x3f5ddc){var _0x40047b,_0xf8d14c;var _0x431412=[];var _0x3f1690=moment()[_0x6327('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x6327('0x2d')][_0x6327('0x4a')]({'where':{'id':_0x4e7082[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x497d7f,null))[_0x6327('0x26')](function(_0x4bf469){if(_0x4bf469){_0xf8d14c=_0x4bf469;return _0x4bf469['addBlackLists'](_0x4e7082['body'][_0x6327('0x67')],_['omit'](_0x4e7082[_0x6327('0x4c')],['ids','id'])||{});}return null;})[_0x6327('0x68')](function(_0x2e28c7){var _0x464324;var _0x86039;_0x40047b=_0x2e28c7||[];var _0x2980d1=[];if(_0x2e28c7){for(var _0x589d31=0x0;_0x589d31<_0x2e28c7[_0x6327('0x37')];_0x589d31+=0x1){var _0x2d6ed2=_0x2e28c7[_0x589d31][_0x6327('0x4e')]({'plain':!![]});_0x464324=squel[_0x6327('0x6b')]()['into']('cm_hopper_black')[_0x6327('0x6e')]([_0x6327('0x6f'),_0x6327('0x7f'),_0x6327('0x71'),_0x6327('0x5c'),_0x6327('0x58'),_0x6327('0x57')],squel['select']()[_0x6327('0x72')](_0x6327('0x6f'),_0x6327('0x6f'))['field']('id','ContactId')[_0x6327('0x72')](_0x2d6ed2[_0x6327('0x74')][_0x6327('0x75')](),'ListId')['field'](_0x4e7082[_0x6327('0x48')]['id'][_0x6327('0x75')](),'CampaignId')[_0x6327('0x72')](_0x6327('0x73'),'createdAt')[_0x6327('0x72')](_0x6327('0x73'),_0x6327('0x57'))[_0x6327('0x76')](_0x6327('0x77'))[_0x6327('0x3f')](_0x6327('0x80'))[_0x6327('0x3f')](_0x6327('0x8f'),_0x2d6ed2[_0x6327('0x74')][_0x6327('0x75')]())[_0x6327('0x3f')](_0x6327('0x78')))[_0x6327('0x75')]();_0x2980d1[_0x6327('0x89')](db[_0x6327('0x8a')][_0x6327('0x31')](_0x464324));}return BPromise[_0x6327('0x8b')](_0x2980d1);}})['then'](function(){return _0x40047b;})[_0x6327('0x26')](respondWithResult(_0x497d7f,null))['catch'](handleError(_0x497d7f,null));};exports['removeBlackLists']=function(_0x458d83,_0x440bb7,_0xb44077){return db[_0x6327('0x2d')]['find']({'where':{'id':_0x458d83['params']['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x440bb7,null))[_0x6327('0x26')](function(_0x1dc095){if(_0x1dc095){return _0x1dc095[_0x6327('0x90')](_0x458d83['query'][_0x6327('0x67')]);}})[_0x6327('0x26')](function(_0x593782){if(_0x593782){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x458d83[_0x6327('0x31')][_0x6327('0x67')],'CampaignId':_0x458d83[_0x6327('0x48')]['id']}})[_0x6327('0x26')](function(){return _0x593782;});}})[_0x6327('0x26')](respondWithStatusCode(_0x440bb7,null))[_0x6327('0x46')](handleError(_0x440bb7,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 3995c6d..dd7dfbd 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(_0x4cc79a,_0xf85adc){var _0x176af9=function(_0x44ebcb){while(--_0x44ebcb){_0x4cc79a['push'](_0x4cc79a['shift']());}};_0x176af9(++_0xf85adc);}(_0x7a54,0x106));var _0x47a5=function(_0x3f32f8,_0x55bcb2){_0x3f32f8=_0x3f32f8-0x0;var _0x5cb275=_0x7a54[_0x3f32f8];return _0x5cb275;};'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(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 16117d2..b54298e 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 _0xf675=['../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1c77e7,_0x520524){var _0x45b345=function(_0x4e9a95){while(--_0x4e9a95){_0x1c77e7['push'](_0x1c77e7['shift']());}};_0x45b345(++_0x520524);}(_0xf675,0x199));var _0x5f67=function(_0x297eea,_0x5060be){_0x297eea=_0x297eea-0x0;var _0x1c42d2=_0xf675[_0x297eea];return _0x1c42d2;};'use strict';var _=require(_0x5f67('0x0'));var util=require(_0x5f67('0x1'));var moment=require(_0x5f67('0x2'));var BPromise=require('bluebird');var rs=require(_0x5f67('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5f67('0x4'))['db'];var utils=require(_0x5f67('0x5'));var logger=require(_0x5f67('0x6'))('rpc');var config=require(_0x5f67('0x7'));var jayson=require(_0x5f67('0x8'));var client=jayson[_0x5f67('0x9')][_0x5f67('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b67eb,_0xc71a7,_0x121d19){return new BPromise(function(_0x55efcd,_0x5749f5){return client[_0x5f67('0xb')](_0x5b67eb,_0x121d19)[_0x5f67('0xc')](function(_0x530ef1){logger['info'](_0x5f67('0xd'),_0xc71a7,_0x5f67('0xe'));logger[_0x5f67('0xf')]('Campaign,\x20%s,\x20%s,\x20%s',_0xc71a7,'request\x20sent',JSON['stringify'](_0x530ef1));if(_0x530ef1[_0x5f67('0x10')]){if(_0x530ef1[_0x5f67('0x10')]['code']===0x1f4){logger[_0x5f67('0x10')]('Campaign,\x20%s,\x20%s',_0xc71a7,_0x530ef1[_0x5f67('0x10')]['message']);return _0x5749f5(_0x530ef1[_0x5f67('0x10')][_0x5f67('0x11')]);}logger[_0x5f67('0x10')]('Campaign,\x20%s,\x20%s',_0xc71a7,_0x530ef1[_0x5f67('0x10')]['message']);return _0x55efcd(_0x530ef1[_0x5f67('0x10')]['message']);}else{logger[_0x5f67('0x12')]('Campaign,\x20%s,\x20%s',_0xc71a7,_0x5f67('0xe'));_0x55efcd(_0x530ef1[_0x5f67('0x13')][_0x5f67('0x11')]);}})[_0x5f67('0x14')](function(_0x444ee5){logger[_0x5f67('0x10')](_0x5f67('0xd'),_0xc71a7,_0x444ee5);_0x5749f5(_0x444ee5);});});}exports[_0x5f67('0x15')]=function(_0xc539c6){var _0x8f3bd6=this;return new Promise(function(_0x5275d6,_0x5bc956){return db[_0x5f67('0x16')][_0x5f67('0x17')]({'raw':_0xc539c6['options']?_0xc539c6[_0x5f67('0x18')][_0x5f67('0x19')]===undefined?!![]:![]:!![],'where':_0xc539c6[_0x5f67('0x18')]?_0xc539c6[_0x5f67('0x18')][_0x5f67('0x1a')]||null:null,'attributes':_0xc539c6[_0x5f67('0x18')]?_0xc539c6[_0x5f67('0x18')][_0x5f67('0x1b')]||null:null,'limit':_0xc539c6[_0x5f67('0x18')]?_0xc539c6[_0x5f67('0x18')][_0x5f67('0x1c')]||null:null,'include':_0xc539c6[_0x5f67('0x18')]?_0xc539c6['options'][_0x5f67('0x1d')]?_[_0x5f67('0x1e')](_0xc539c6[_0x5f67('0x18')]['include'],function(_0x537b39){return{'model':db[_0x537b39[_0x5f67('0x1f')]],'as':_0x537b39['as'],'attributes':_0x537b39[_0x5f67('0x1b')],'include':_0x537b39['include']?_[_0x5f67('0x1e')](_0x537b39[_0x5f67('0x1d')],function(_0x241d17){return{'model':db[_0x241d17[_0x5f67('0x1f')]],'as':_0x241d17['as'],'attributes':_0x241d17['attributes'],'include':_0x241d17[_0x5f67('0x1d')]?_['map'](_0x241d17[_0x5f67('0x1d')],function(_0x167601){return{'model':db[_0x167601['model']],'as':_0x167601['as'],'attributes':_0x167601[_0x5f67('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5f67('0xc')](function(_0x57f373){logger['info'](_0x5f67('0x15'),_0xc539c6);logger[_0x5f67('0xf')](_0x5f67('0x15'),_0xc539c6,JSON['stringify'](_0x57f373));_0x5275d6(_0x57f373);})[_0x5f67('0x14')](function(_0xd36b79){logger['error'](_0x5f67('0x15'),_0xd36b79[_0x5f67('0x11')],_0xc539c6);_0x5bc956(_0x8f3bd6['error'](0x1f4,_0xd36b79[_0x5f67('0x11')]));});});};
\ No newline at end of file
+var _0xbbb8=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','attributes','limit','include','model','map','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2c5bc7,_0x4975a6){var _0x4273b1=function(_0x4d82a0){while(--_0x4d82a0){_0x2c5bc7['push'](_0x2c5bc7['shift']());}};_0x4273b1(++_0x4975a6);}(_0xbbb8,0x7d));var _0x8bbb=function(_0x3a268d,_0xef058a){_0x3a268d=_0x3a268d-0x0;var _0x224362=_0xbbb8[_0x3a268d];return _0x224362;};'use strict';var _=require(_0x8bbb('0x0'));var util=require(_0x8bbb('0x1'));var moment=require('moment');var BPromise=require(_0x8bbb('0x2'));var rs=require(_0x8bbb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bbb('0x4'))['db'];var utils=require(_0x8bbb('0x5'));var logger=require(_0x8bbb('0x6'))(_0x8bbb('0x7'));var config=require(_0x8bbb('0x8'));var jayson=require(_0x8bbb('0x9'));var client=jayson[_0x8bbb('0xa')][_0x8bbb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d7098,_0x4bbc55,_0x5c744c){return new BPromise(function(_0x4da98e,_0x2d69aa){return client[_0x8bbb('0xc')](_0x2d7098,_0x5c744c)[_0x8bbb('0xd')](function(_0x3a6ced){logger[_0x8bbb('0xe')](_0x8bbb('0xf'),_0x4bbc55,_0x8bbb('0x10'));logger[_0x8bbb('0x11')]('Campaign,\x20%s,\x20%s,\x20%s',_0x4bbc55,_0x8bbb('0x10'),JSON[_0x8bbb('0x12')](_0x3a6ced));if(_0x3a6ced[_0x8bbb('0x13')]){if(_0x3a6ced['error'][_0x8bbb('0x14')]===0x1f4){logger[_0x8bbb('0x13')](_0x8bbb('0xf'),_0x4bbc55,_0x3a6ced['error'][_0x8bbb('0x15')]);return _0x2d69aa(_0x3a6ced[_0x8bbb('0x13')][_0x8bbb('0x15')]);}logger[_0x8bbb('0x13')]('Campaign,\x20%s,\x20%s',_0x4bbc55,_0x3a6ced[_0x8bbb('0x13')][_0x8bbb('0x15')]);return _0x4da98e(_0x3a6ced['error'][_0x8bbb('0x15')]);}else{logger[_0x8bbb('0xe')](_0x8bbb('0xf'),_0x4bbc55,_0x8bbb('0x10'));_0x4da98e(_0x3a6ced[_0x8bbb('0x16')][_0x8bbb('0x15')]);}})[_0x8bbb('0x17')](function(_0x15643c){logger[_0x8bbb('0x13')](_0x8bbb('0xf'),_0x4bbc55,_0x15643c);_0x2d69aa(_0x15643c);});});}exports[_0x8bbb('0x18')]=function(_0x2c2cd4){var _0x12486b=this;return new Promise(function(_0x4abd04,_0x2a6e0){return db[_0x8bbb('0x19')][_0x8bbb('0x1a')]({'raw':_0x2c2cd4[_0x8bbb('0x1b')]?_0x2c2cd4[_0x8bbb('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2c2cd4[_0x8bbb('0x1b')]?_0x2c2cd4['options']['where']||null:null,'attributes':_0x2c2cd4[_0x8bbb('0x1b')]?_0x2c2cd4['options'][_0x8bbb('0x1c')]||null:null,'limit':_0x2c2cd4['options']?_0x2c2cd4[_0x8bbb('0x1b')][_0x8bbb('0x1d')]||null:null,'include':_0x2c2cd4['options']?_0x2c2cd4[_0x8bbb('0x1b')][_0x8bbb('0x1e')]?_['map'](_0x2c2cd4[_0x8bbb('0x1b')][_0x8bbb('0x1e')],function(_0x4b2ba6){return{'model':db[_0x4b2ba6[_0x8bbb('0x1f')]],'as':_0x4b2ba6['as'],'attributes':_0x4b2ba6['attributes'],'include':_0x4b2ba6[_0x8bbb('0x1e')]?_[_0x8bbb('0x20')](_0x4b2ba6[_0x8bbb('0x1e')],function(_0x2fff2e){return{'model':db[_0x2fff2e['model']],'as':_0x2fff2e['as'],'attributes':_0x2fff2e[_0x8bbb('0x1c')],'include':_0x2fff2e['include']?_[_0x8bbb('0x20')](_0x2fff2e['include'],function(_0x22a074){return{'model':db[_0x22a074[_0x8bbb('0x1f')]],'as':_0x22a074['as'],'attributes':_0x22a074[_0x8bbb('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1375a9){logger['info'](_0x8bbb('0x18'),_0x2c2cd4);logger[_0x8bbb('0x11')](_0x8bbb('0x18'),_0x2c2cd4,JSON[_0x8bbb('0x12')](_0x1375a9));_0x4abd04(_0x1375a9);})['catch'](function(_0x51c251){logger[_0x8bbb('0x13')]('GetCampaign',_0x51c251[_0x8bbb('0x15')],_0x2c2cd4);_0x2a6e0(_0x12486b[_0x8bbb('0x13')](0x1f4,_0x51c251['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 480a36a..79ffbda 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 _0xca04=['path','Router','fs-extra','../../config/environment','./campaign.controller','index','/:id','show','get','/:id/hoppers','isAuthenticated','getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer'];(function(_0x12c4fe,_0x3f2d61){var _0x56b681=function(_0x3f3605){while(--_0x3f3605){_0x12c4fe['push'](_0x12c4fe['shift']());}};_0x56b681(++_0x3f2d61);}(_0xca04,0xa4));var _0x4ca0=function(_0x109e60,_0x1634ac){_0x109e60=_0x109e60-0x0;var _0x4b239d=_0xca04[_0x109e60];return _0x4b239d;};'use strict';var multer=require(_0x4ca0('0x0'));var util=require('util');var path=require(_0x4ca0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4ca0('0x2')]();var fs_extra=require(_0x4ca0('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ca0('0x4'));var controller=require(_0x4ca0('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x4ca0('0x6')]);router['get'](_0x4ca0('0x7'),auth['isAuthenticated'](),controller[_0x4ca0('0x8')]);router[_0x4ca0('0x9')](_0x4ca0('0xa'),auth[_0x4ca0('0xb')](),controller[_0x4ca0('0xc')]);router[_0x4ca0('0x9')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x4ca0('0xd')]);router[_0x4ca0('0x9')](_0x4ca0('0xe'),auth[_0x4ca0('0xb')](),controller['getHopperFinals']);router[_0x4ca0('0x9')](_0x4ca0('0xf'),auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x10')]);router[_0x4ca0('0x9')](_0x4ca0('0x11'),auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x12')]);router[_0x4ca0('0x9')](_0x4ca0('0x13'),auth[_0x4ca0('0xb')](),controller['getBlackLists']);router['post']('/',auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x14')]);router[_0x4ca0('0x15')](_0x4ca0('0x16'),auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x17')]);router[_0x4ca0('0x15')]('/:id/lists',auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x18')]);router['post'](_0x4ca0('0x13'),auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x19')]);router[_0x4ca0('0x1a')](_0x4ca0('0x7'),auth['isAuthenticated'](),controller[_0x4ca0('0x1b')]);router[_0x4ca0('0x1c')]('/:id',auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x1d')]);router[_0x4ca0('0x1c')](_0x4ca0('0x11'),auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x1e')]);router[_0x4ca0('0x1c')](_0x4ca0('0x13'),auth[_0x4ca0('0xb')](),controller[_0x4ca0('0x1f')]);module[_0x4ca0('0x20')]=router;
\ No newline at end of file
+var _0x6cf2=['/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','delete','removeLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x4c42da,_0x2b1f58){var _0x11c56a=function(_0x3a297d){while(--_0x3a297d){_0x4c42da['push'](_0x4c42da['shift']());}};_0x11c56a(++_0x2b1f58);}(_0x6cf2,0x7c));var _0x26cf=function(_0x39197d,_0x785a79){_0x39197d=_0x39197d-0x0;var _0x48cfab=_0x6cf2[_0x39197d];return _0x48cfab;};'use strict';var multer=require('multer');var util=require(_0x26cf('0x0'));var path=require(_0x26cf('0x1'));var timeout=require(_0x26cf('0x2'));var express=require(_0x26cf('0x3'));var router=express[_0x26cf('0x4')]();var fs_extra=require(_0x26cf('0x5'));var auth=require(_0x26cf('0x6'));var interaction=require(_0x26cf('0x7'));var config=require(_0x26cf('0x8'));var controller=require(_0x26cf('0x9'));router[_0x26cf('0xa')]('/',auth[_0x26cf('0xb')](),controller[_0x26cf('0xc')]);router[_0x26cf('0xa')](_0x26cf('0xd'),auth['isAuthenticated'](),controller[_0x26cf('0xe')]);router['get'](_0x26cf('0xf'),auth[_0x26cf('0xb')](),controller['getHoppers']);router[_0x26cf('0xa')](_0x26cf('0x10'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x11')]);router[_0x26cf('0xa')](_0x26cf('0x12'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x13')]);router['get'](_0x26cf('0x14'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x15')]);router[_0x26cf('0xa')](_0x26cf('0x16'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x17')]);router['get'](_0x26cf('0x18'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x19')]);router[_0x26cf('0x1a')]('/',auth[_0x26cf('0xb')](),controller[_0x26cf('0x1b')]);router[_0x26cf('0x1a')](_0x26cf('0x1c'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x1d')]);router[_0x26cf('0x1a')](_0x26cf('0x16'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x1e')]);router[_0x26cf('0x1a')]('/:id/blacklists',auth[_0x26cf('0xb')](),controller[_0x26cf('0x1f')]);router[_0x26cf('0x20')](_0x26cf('0xd'),auth[_0x26cf('0xb')](),controller['update']);router['delete']('/:id',auth[_0x26cf('0xb')](),controller['destroy']);router[_0x26cf('0x21')](_0x26cf('0x16'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x22')]);router[_0x26cf('0x21')](_0x26cf('0x18'),auth[_0x26cf('0xb')](),controller['removeBlackLists']);module[_0x26cf('0x23')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 056eac9..4a3182a 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 _0xafa9=['medium','VIRTUAL','sequelize','exports','TEXT'];(function(_0x4c5fff,_0x50d286){var _0x2bd2da=function(_0x57f1ba){while(--_0x57f1ba){_0x4c5fff['push'](_0x4c5fff['shift']());}};_0x2bd2da(++_0x50d286);}(_0xafa9,0x15b));var _0x9afa=function(_0x5bb1e9,_0x15f025){_0x5bb1e9=_0x5bb1e9-0x0;var _0x262c24=_0xafa9[_0x5bb1e9];return _0x262c24;};'use strict';var Sequelize=require(_0x9afa('0x0'));module[_0x9afa('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x9afa('0x2')],'length':_0x9afa('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x9afa('0x4')],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0x8cd3=['exports','TEXT','medium','VIRTUAL','getDataValue','key','sequelize'];(function(_0x255a0a,_0x4d809f){var _0xcb9924=function(_0x52d945){while(--_0x52d945){_0x255a0a['push'](_0x255a0a['shift']());}};_0xcb9924(++_0x4d809f);}(_0x8cd3,0xe6));var _0x38cd=function(_0x1987c2,_0x25e5ea){_0x1987c2=_0x1987c2-0x0;var _0x3fbcf3=_0x8cd3[_0x1987c2];return _0x3fbcf3;};'use strict';var Sequelize=require(_0x38cd('0x0'));module[_0x38cd('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x38cd('0x2')],'length':_0x38cd('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x38cd('0x4')],'get':function(){return this[_0x38cd('0x5')](_0x38cd('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index a5013d8..a637e01 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 _0x8de5=['fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','sort','where','filter','merge','options','findAll','catch','show','params','length','includeAll','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','find','Sequelize','ValidationError','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','stack','name','send','index','map','CannedAnswer','rawAttributes'];(function(_0x5c78d9,_0x2736c7){var _0x69ae1f=function(_0x4b31ac){while(--_0x4b31ac){_0x5c78d9['push'](_0x5c78d9['shift']());}};_0x69ae1f(++_0x2736c7);}(_0x8de5,0x1e1));var _0x58de=function(_0x31c115,_0x571962){_0x31c115=_0x31c115-0x0;var _0x3b7834=_0x8de5[_0x31c115];return _0x3b7834;};'use strict';var emlformat=require(_0x58de('0x0'));var rimraf=require(_0x58de('0x1'));var zipdir=require(_0x58de('0x2'));var jsonpatch=require(_0x58de('0x3'));var rp=require(_0x58de('0x4'));var moment=require(_0x58de('0x5'));var BPromise=require(_0x58de('0x6'));var Mustache=require(_0x58de('0x7'));var util=require(_0x58de('0x8'));var path=require(_0x58de('0x9'));var sox=require(_0x58de('0xa'));var csv=require('to-csv');var ejs=require(_0x58de('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x58de('0xc'));var squel=require(_0x58de('0xd'));var crypto=require(_0x58de('0xe'));var jsforce=require(_0x58de('0xf'));var deskjs=require(_0x58de('0x10'));var toCsv=require(_0x58de('0x11'));var querystring=require(_0x58de('0x12'));var Papa=require('papaparse');var Redis=require(_0x58de('0x13'));var authService=require(_0x58de('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x58de('0x15'));var hardwareService=require(_0x58de('0x16'));var logger=require(_0x58de('0x17'))(_0x58de('0x18'));var utils=require('../../config/utils');var config=require(_0x58de('0x19'));var licenseUtil=require(_0x58de('0x1a'));var db=require(_0x58de('0x1b'))['db'];function respondWithStatusCode(_0x31804c,_0x3b4b86){_0x3b4b86=_0x3b4b86||0xcc;return function(_0x92b35){if(_0x92b35){return _0x31804c[_0x58de('0x1c')](_0x3b4b86);}return _0x31804c[_0x58de('0x1d')](_0x3b4b86)[_0x58de('0x1e')]();};}function respondWithResult(_0x3b5ace,_0x567a80){_0x567a80=_0x567a80||0xc8;return function(_0x41f465){if(_0x41f465){return _0x3b5ace['status'](_0x567a80)[_0x58de('0x1f')](_0x41f465);}};}function respondWithFilteredResult(_0x22d1c3,_0x6f72a3){return function(_0x13cdb9){if(_0x13cdb9){var _0x720a38=typeof _0x6f72a3[_0x58de('0x20')]===_0x58de('0x21')&&typeof _0x6f72a3[_0x58de('0x22')]===_0x58de('0x21');var _0x55364e=_0x13cdb9[_0x58de('0x23')];var _0x53eb78=_0x720a38?0x0:_0x6f72a3[_0x58de('0x20')];var _0x819ad=_0x720a38?_0x13cdb9[_0x58de('0x23')]:_0x6f72a3[_0x58de('0x20')]+_0x6f72a3[_0x58de('0x22')];var _0x41ce69;if(_0x819ad>=_0x55364e){_0x819ad=_0x55364e;_0x41ce69=0xc8;}else{_0x41ce69=0xce;}_0x22d1c3['status'](_0x41ce69);return _0x22d1c3[_0x58de('0x24')](_0x58de('0x25'),_0x53eb78+'-'+_0x819ad+'/'+_0x55364e)['json'](_0x13cdb9);}return null;};}function patchUpdates(_0x48b823){return function(_0x3046f1){try{jsonpatch[_0x58de('0x26')](_0x3046f1,_0x48b823,!![]);}catch(_0x15c64c){return BPromise[_0x58de('0x27')](_0x15c64c);}return _0x3046f1[_0x58de('0x28')]();};}function saveUpdates(_0x286a76,_0x4e71be){return function(_0x5097c4){if(_0x5097c4){return _0x5097c4[_0x58de('0x29')](_0x286a76)[_0x58de('0x2a')](function(_0x4ca3a7){return _0x4ca3a7;});}return null;};}function removeEntity(_0x3ef53f,_0x5d3b44){return function(_0x3b8068){if(_0x3b8068){return _0x3b8068[_0x58de('0x2b')]()['then'](function(){var _0x61b6a7=_0x3b8068['get']({'plain':!![]});var _0x2b7c00=_0x58de('0x2c');return db[_0x58de('0x2d')][_0x58de('0x2b')]({'where':{'type':_0x2b7c00,'resourceId':_0x61b6a7['id']}})[_0x58de('0x2a')](function(){return _0x3b8068;});})[_0x58de('0x2a')](function(){_0x3ef53f[_0x58de('0x1d')](0xcc)[_0x58de('0x1e')]();});}};}function handleEntityNotFound(_0x314416,_0x3dadfc){return function(_0x117969){if(!_0x117969){_0x314416[_0x58de('0x1c')](0x194);}return _0x117969;};}function handleError(_0x2aa607,_0x2e79e0){_0x2e79e0=_0x2e79e0||0x1f4;return function(_0x1ad98a){logger['error'](_0x1ad98a[_0x58de('0x2e')]);if(_0x1ad98a[_0x58de('0x2f')]){delete _0x1ad98a[_0x58de('0x2f')];}_0x2aa607[_0x58de('0x1d')](_0x2e79e0)[_0x58de('0x30')](_0x1ad98a);};}exports[_0x58de('0x31')]=function(_0x534b9c,_0x2a7baa){var _0x2933fb={},_0x5774dd={},_0x14e7c3={'count':0x0,'rows':[]};var _0x4ca5a2=_[_0x58de('0x32')](db[_0x58de('0x33')][_0x58de('0x34')],function(_0x295081){return{'name':_0x295081[_0x58de('0x35')],'type':_0x295081[_0x58de('0x36')][_0x58de('0x37')]};});_0x5774dd[_0x58de('0x38')]=_[_0x58de('0x32')](_0x4ca5a2,_0x58de('0x2f'));_0x5774dd[_0x58de('0x39')]=_[_0x58de('0x3a')](_0x534b9c[_0x58de('0x39')]);_0x5774dd[_0x58de('0x3b')]=_[_0x58de('0x3c')](_0x5774dd[_0x58de('0x38')],_0x5774dd[_0x58de('0x39')]);_0x2933fb['attributes']=_['intersection'](_0x5774dd[_0x58de('0x38')],qs[_0x58de('0x3d')](_0x534b9c[_0x58de('0x39')][_0x58de('0x3d')]));_0x2933fb[_0x58de('0x3e')]=_0x2933fb['attributes']['length']?_0x2933fb[_0x58de('0x3e')]:_0x5774dd[_0x58de('0x38')];if(!_0x534b9c['query']['hasOwnProperty']('nolimit')){_0x2933fb[_0x58de('0x22')]=qs[_0x58de('0x22')](_0x534b9c[_0x58de('0x39')][_0x58de('0x22')]);_0x2933fb[_0x58de('0x20')]=qs[_0x58de('0x20')](_0x534b9c[_0x58de('0x39')][_0x58de('0x20')]);}_0x2933fb['order']=qs['sort'](_0x534b9c[_0x58de('0x39')][_0x58de('0x3f')]);_0x2933fb[_0x58de('0x40')]=qs['filters'](_['pick'](_0x534b9c['query'],_0x5774dd[_0x58de('0x3b')]),_0x4ca5a2);if(_0x534b9c['query'][_0x58de('0x41')]){_0x2933fb[_0x58de('0x40')]=_[_0x58de('0x42')](_0x2933fb[_0x58de('0x40')],{'$or':[{'key':{'$like':'%'+_0x534b9c[_0x58de('0x39')][_0x58de('0x41')]+'%'}},{'value':{'$like':'%'+_0x534b9c[_0x58de('0x39')]['filter']+'%'}}]});}_0x2933fb=_['merge']({},_0x2933fb,_0x534b9c[_0x58de('0x43')]);var _0x5814bd={'where':_0x2933fb[_0x58de('0x40')]};return db['CannedAnswer']['count'](_0x5814bd)['then'](function(_0x51fce6){_0x14e7c3[_0x58de('0x23')]=_0x51fce6;if(_0x534b9c['query']['includeAll']){_0x2933fb['include']=[{'all':!![]}];}return db[_0x58de('0x33')][_0x58de('0x44')](_0x2933fb);})[_0x58de('0x2a')](function(_0x30eb4b){_0x14e7c3['rows']=_0x30eb4b;return _0x14e7c3;})[_0x58de('0x2a')](respondWithFilteredResult(_0x2a7baa,_0x2933fb))[_0x58de('0x45')](handleError(_0x2a7baa,null));};exports[_0x58de('0x46')]=function(_0x3a6726,_0x3db979){var _0x2e842b={'raw':!![],'where':{'id':_0x3a6726[_0x58de('0x47')]['id']}},_0x51dad2={};_0x51dad2['model']=_[_0x58de('0x3a')](db['CannedAnswer'][_0x58de('0x34')]);_0x51dad2['query']=_[_0x58de('0x3a')](_0x3a6726['query']);_0x51dad2['filters']=_[_0x58de('0x3c')](_0x51dad2['model'],_0x51dad2[_0x58de('0x39')]);_0x2e842b['attributes']=_[_0x58de('0x3c')](_0x51dad2[_0x58de('0x38')],qs[_0x58de('0x3d')](_0x3a6726[_0x58de('0x39')][_0x58de('0x3d')]));_0x2e842b['attributes']=_0x2e842b[_0x58de('0x3e')][_0x58de('0x48')]?_0x2e842b[_0x58de('0x3e')]:_0x51dad2[_0x58de('0x38')];if(_0x3a6726['query'][_0x58de('0x49')]){_0x2e842b['include']=[{'all':!![]}];}_0x2e842b=_['merge']({},_0x2e842b,_0x3a6726[_0x58de('0x43')]);return db[_0x58de('0x33')]['find'](_0x2e842b)['then'](handleEntityNotFound(_0x3db979,null))[_0x58de('0x2a')](respondWithResult(_0x3db979,null))[_0x58de('0x45')](handleError(_0x3db979,null));};exports[_0x58de('0x29')]=function(_0x4806dc,_0x265248){if(_0x4806dc[_0x58de('0x4a')]['id']){delete _0x4806dc[_0x58de('0x4a')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x4806dc[_0x58de('0x47')]['id']}})[_0x58de('0x2a')](handleEntityNotFound(_0x265248,null))[_0x58de('0x2a')](saveUpdates(_0x4806dc[_0x58de('0x4a')],null))[_0x58de('0x2a')](respondWithResult(_0x265248,null))['catch'](handleError(_0x265248,null));};exports[_0x58de('0x2b')]=function(_0x254323,_0x4eed10){return db[_0x58de('0x33')]['find']({'where':{'id':_0x254323[_0x58de('0x47')]['id']}})[_0x58de('0x2a')](handleEntityNotFound(_0x4eed10,null))[_0x58de('0x2a')](removeEntity(_0x4eed10,null))[_0x58de('0x45')](handleError(_0x4eed10,null));};exports[_0x58de('0x4b')]=function(_0x244611,_0x5a6b62){var _0xf7b558={'key':_0x244611[_0x58de('0x4a')][_0x58de('0x37')]};if(_0x244611[_0x58de('0x4a')][_0x58de('0x4c')]){_0xf7b558[_0x58de('0x4c')]=_0x244611[_0x58de('0x4a')]['MailAccountId'];}else if(_0x244611[_0x58de('0x4a')]['SmsAccountId']){_0xf7b558[_0x58de('0x4d')]=_0x244611[_0x58de('0x4a')][_0x58de('0x4d')];}else if(_0x244611[_0x58de('0x4a')][_0x58de('0x4e')]){_0xf7b558['OpenchannelAccountId']=_0x244611[_0x58de('0x4a')]['OpenchannelAccountId'];}else if(_0x244611['body'][_0x58de('0x4f')]){_0xf7b558['ChatWebsiteId']=_0x244611[_0x58de('0x4a')][_0x58de('0x4f')];}return db[_0x58de('0x33')][_0x58de('0x50')]({'where':_0xf7b558})[_0x58de('0x2a')](function(_0x1f1c0e){if(_0x1f1c0e){throw new db[(_0x58de('0x51'))][(_0x58de('0x52'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x58de('0x33')][_0x58de('0x4b')](_0x244611[_0x58de('0x4a')]);})[_0x58de('0x2a')](function(_0x305f38){var _0x15f28a=_0x244611[_0x58de('0x53')][_0x58de('0x54')]({'plain':!![]});if(!_0x15f28a)throw new Error(_0x58de('0x55'));if(_0x15f28a[_0x58de('0x56')]===_0x58de('0x53')){var _0x309551=_0x305f38[_0x58de('0x54')]({'plain':!![]});return db[_0x58de('0x57')][_0x58de('0x50')]({'where':{'name':_0x58de('0x2c'),'userProfileId':_0x15f28a[_0x58de('0x58')]},'raw':!![]})['then'](function(_0x5eab15){if(_0x5eab15&&_0x5eab15['autoAssociation']===0x0){return db[_0x58de('0x2d')]['create']({'name':_0x309551[_0x58de('0x2f')],'resourceId':_0x309551['id'],'type':_0x5eab15['name'],'sectionId':_0x5eab15['id']},{})[_0x58de('0x2a')](function(){return _0x305f38;});}else{return _0x305f38;}})[_0x58de('0x45')](function(_0xf2f903){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf2f903);throw _0xf2f903;});}return _0x305f38;})[_0x58de('0x2a')](respondWithResult(_0x5a6b62,0xc9))[_0x58de('0x45')](handleError(_0x5a6b62,null));};
\ No newline at end of file
+var _0x6107=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','rawAttributes','fields','includeAll','find','body','params','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x2a5b1f,_0x14f7a8){var _0x374b10=function(_0x5f039e){while(--_0x5f039e){_0x2a5b1f['push'](_0x2a5b1f['shift']());}};_0x374b10(++_0x14f7a8);}(_0x6107,0x9e));var _0x7610=function(_0x3ef412,_0x28691b){_0x3ef412=_0x3ef412-0x0;var _0x2cbaeb=_0x6107[_0x3ef412];return _0x2cbaeb;};'use strict';var emlformat=require(_0x7610('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7610('0x1'));var jsonpatch=require(_0x7610('0x2'));var rp=require(_0x7610('0x3'));var moment=require(_0x7610('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7610('0x5'));var util=require('util');var path=require(_0x7610('0x6'));var sox=require(_0x7610('0x7'));var csv=require(_0x7610('0x8'));var ejs=require(_0x7610('0x9'));var fs=require('fs');var fs_extra=require(_0x7610('0xa'));var _=require(_0x7610('0xb'));var squel=require(_0x7610('0xc'));var crypto=require(_0x7610('0xd'));var jsforce=require(_0x7610('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7610('0x8'));var querystring=require(_0x7610('0xf'));var Papa=require(_0x7610('0x10'));var Redis=require(_0x7610('0x11'));var authService=require(_0x7610('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7610('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7610('0x14'))(_0x7610('0x15'));var utils=require(_0x7610('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7610('0x17'));var db=require(_0x7610('0x18'))['db'];function respondWithStatusCode(_0x22fd75,_0x36e45c){_0x36e45c=_0x36e45c||0xcc;return function(_0x11fc2c){if(_0x11fc2c){return _0x22fd75[_0x7610('0x19')](_0x36e45c);}return _0x22fd75[_0x7610('0x1a')](_0x36e45c)[_0x7610('0x1b')]();};}function respondWithResult(_0x11c178,_0x35a6fb){_0x35a6fb=_0x35a6fb||0xc8;return function(_0x52884e){if(_0x52884e){return _0x11c178[_0x7610('0x1a')](_0x35a6fb)[_0x7610('0x1c')](_0x52884e);}};}function respondWithFilteredResult(_0x39a851,_0x20e869){return function(_0x5e6a39){if(_0x5e6a39){var _0x5e3bb3=typeof _0x20e869[_0x7610('0x1d')]===_0x7610('0x1e')&&typeof _0x20e869[_0x7610('0x1f')]==='undefined';var _0x112218=_0x5e6a39[_0x7610('0x20')];var _0x41f5b6=_0x5e3bb3?0x0:_0x20e869[_0x7610('0x1d')];var _0x4f30b3=_0x5e3bb3?_0x5e6a39[_0x7610('0x20')]:_0x20e869[_0x7610('0x1d')]+_0x20e869[_0x7610('0x1f')];var _0x3b2e2d;if(_0x4f30b3>=_0x112218){_0x4f30b3=_0x112218;_0x3b2e2d=0xc8;}else{_0x3b2e2d=0xce;}_0x39a851[_0x7610('0x1a')](_0x3b2e2d);return _0x39a851[_0x7610('0x21')](_0x7610('0x22'),_0x41f5b6+'-'+_0x4f30b3+'/'+_0x112218)[_0x7610('0x1c')](_0x5e6a39);}return null;};}function patchUpdates(_0x443d4e){return function(_0x41ee76){try{jsonpatch[_0x7610('0x23')](_0x41ee76,_0x443d4e,!![]);}catch(_0x12c64d){return BPromise[_0x7610('0x24')](_0x12c64d);}return _0x41ee76['save']();};}function saveUpdates(_0x4144f7,_0x501f8a){return function(_0x35dd30){if(_0x35dd30){return _0x35dd30[_0x7610('0x25')](_0x4144f7)[_0x7610('0x26')](function(_0x44af3d){return _0x44af3d;});}return null;};}function removeEntity(_0x4aa706,_0x4d7eaa){return function(_0x30fdca){if(_0x30fdca){return _0x30fdca['destroy']()[_0x7610('0x26')](function(){var _0x339d3f=_0x30fdca[_0x7610('0x27')]({'plain':!![]});var _0x22b929=_0x7610('0x28');return db[_0x7610('0x29')]['destroy']({'where':{'type':_0x22b929,'resourceId':_0x339d3f['id']}})[_0x7610('0x26')](function(){return _0x30fdca;});})[_0x7610('0x26')](function(){_0x4aa706[_0x7610('0x1a')](0xcc)[_0x7610('0x1b')]();});}};}function handleEntityNotFound(_0xcccc58,_0x1ed072){return function(_0x458200){if(!_0x458200){_0xcccc58[_0x7610('0x19')](0x194);}return _0x458200;};}function handleError(_0x13e771,_0x30ae04){_0x30ae04=_0x30ae04||0x1f4;return function(_0x3c494f){logger[_0x7610('0x2a')](_0x3c494f[_0x7610('0x2b')]);if(_0x3c494f[_0x7610('0x2c')]){delete _0x3c494f[_0x7610('0x2c')];}_0x13e771[_0x7610('0x1a')](_0x30ae04)[_0x7610('0x2d')](_0x3c494f);};}exports[_0x7610('0x2e')]=function(_0x530025,_0x1508a5){var _0x49d692={},_0x24d5ed={},_0x4c9564={'count':0x0,'rows':[]};var _0x57ef2d=_[_0x7610('0x2f')](db[_0x7610('0x30')]['rawAttributes'],function(_0x3375e2){return{'name':_0x3375e2[_0x7610('0x31')],'type':_0x3375e2[_0x7610('0x32')][_0x7610('0x33')]};});_0x24d5ed[_0x7610('0x34')]=_[_0x7610('0x2f')](_0x57ef2d,_0x7610('0x2c'));_0x24d5ed[_0x7610('0x35')]=_[_0x7610('0x36')](_0x530025[_0x7610('0x35')]);_0x24d5ed[_0x7610('0x37')]=_['intersection'](_0x24d5ed['model'],_0x24d5ed[_0x7610('0x35')]);_0x49d692[_0x7610('0x38')]=_[_0x7610('0x39')](_0x24d5ed['model'],qs['fields'](_0x530025[_0x7610('0x35')]['fields']));_0x49d692['attributes']=_0x49d692['attributes'][_0x7610('0x3a')]?_0x49d692[_0x7610('0x38')]:_0x24d5ed[_0x7610('0x34')];if(!_0x530025['query'][_0x7610('0x3b')](_0x7610('0x3c'))){_0x49d692[_0x7610('0x1f')]=qs[_0x7610('0x1f')](_0x530025[_0x7610('0x35')][_0x7610('0x1f')]);_0x49d692[_0x7610('0x1d')]=qs[_0x7610('0x1d')](_0x530025['query'][_0x7610('0x1d')]);}_0x49d692['order']=qs[_0x7610('0x3d')](_0x530025[_0x7610('0x35')][_0x7610('0x3d')]);_0x49d692['where']=qs[_0x7610('0x37')](_[_0x7610('0x3e')](_0x530025[_0x7610('0x35')],_0x24d5ed[_0x7610('0x37')]),_0x57ef2d);if(_0x530025[_0x7610('0x35')][_0x7610('0x3f')]){_0x49d692[_0x7610('0x40')]=_[_0x7610('0x41')](_0x49d692[_0x7610('0x40')],{'$or':[{'key':{'$like':'%'+_0x530025['query'][_0x7610('0x3f')]+'%'}},{'value':{'$like':'%'+_0x530025[_0x7610('0x35')][_0x7610('0x3f')]+'%'}}]});}_0x49d692=_[_0x7610('0x41')]({},_0x49d692,_0x530025[_0x7610('0x42')]);var _0x103103={'where':_0x49d692[_0x7610('0x40')]};return db[_0x7610('0x30')][_0x7610('0x20')](_0x103103)[_0x7610('0x26')](function(_0xc64d8f){_0x4c9564[_0x7610('0x20')]=_0xc64d8f;if(_0x530025[_0x7610('0x35')]['includeAll']){_0x49d692[_0x7610('0x43')]=[{'all':!![]}];}return db[_0x7610('0x30')][_0x7610('0x44')](_0x49d692);})['then'](function(_0x5c983d){_0x4c9564[_0x7610('0x45')]=_0x5c983d;return _0x4c9564;})[_0x7610('0x26')](respondWithFilteredResult(_0x1508a5,_0x49d692))[_0x7610('0x46')](handleError(_0x1508a5,null));};exports[_0x7610('0x47')]=function(_0x280d48,_0x96dfb3){var _0x331cff={'raw':!![],'where':{'id':_0x280d48['params']['id']}},_0x579949={};_0x579949['model']=_['keys'](db[_0x7610('0x30')][_0x7610('0x48')]);_0x579949[_0x7610('0x35')]=_['keys'](_0x280d48[_0x7610('0x35')]);_0x579949['filters']=_[_0x7610('0x39')](_0x579949[_0x7610('0x34')],_0x579949[_0x7610('0x35')]);_0x331cff[_0x7610('0x38')]=_['intersection'](_0x579949['model'],qs[_0x7610('0x49')](_0x280d48[_0x7610('0x35')][_0x7610('0x49')]));_0x331cff['attributes']=_0x331cff[_0x7610('0x38')][_0x7610('0x3a')]?_0x331cff[_0x7610('0x38')]:_0x579949['model'];if(_0x280d48['query'][_0x7610('0x4a')]){_0x331cff[_0x7610('0x43')]=[{'all':!![]}];}_0x331cff=_[_0x7610('0x41')]({},_0x331cff,_0x280d48[_0x7610('0x42')]);return db['CannedAnswer'][_0x7610('0x4b')](_0x331cff)[_0x7610('0x26')](handleEntityNotFound(_0x96dfb3,null))[_0x7610('0x26')](respondWithResult(_0x96dfb3,null))[_0x7610('0x46')](handleError(_0x96dfb3,null));};exports[_0x7610('0x25')]=function(_0x11ff14,_0x4f7adf){if(_0x11ff14[_0x7610('0x4c')]['id']){delete _0x11ff14[_0x7610('0x4c')]['id'];}return db[_0x7610('0x30')]['find']({'where':{'id':_0x11ff14[_0x7610('0x4d')]['id']}})[_0x7610('0x26')](handleEntityNotFound(_0x4f7adf,null))['then'](saveUpdates(_0x11ff14[_0x7610('0x4c')],null))[_0x7610('0x26')](respondWithResult(_0x4f7adf,null))[_0x7610('0x46')](handleError(_0x4f7adf,null));};exports[_0x7610('0x4e')]=function(_0x1c8032,_0x4d8115){return db[_0x7610('0x30')][_0x7610('0x4b')]({'where':{'id':_0x1c8032['params']['id']}})[_0x7610('0x26')](handleEntityNotFound(_0x4d8115,null))[_0x7610('0x26')](removeEntity(_0x4d8115,null))[_0x7610('0x46')](handleError(_0x4d8115,null));};exports[_0x7610('0x4f')]=function(_0x3530f9,_0x2a51a3){var _0x1b9116={'key':_0x3530f9[_0x7610('0x4c')][_0x7610('0x33')]};if(_0x3530f9[_0x7610('0x4c')][_0x7610('0x50')]){_0x1b9116[_0x7610('0x50')]=_0x3530f9['body'][_0x7610('0x50')];}else if(_0x3530f9[_0x7610('0x4c')][_0x7610('0x51')]){_0x1b9116[_0x7610('0x51')]=_0x3530f9['body'][_0x7610('0x51')];}else if(_0x3530f9['body'][_0x7610('0x52')]){_0x1b9116[_0x7610('0x52')]=_0x3530f9[_0x7610('0x4c')][_0x7610('0x52')];}else if(_0x3530f9[_0x7610('0x4c')][_0x7610('0x53')]){_0x1b9116[_0x7610('0x53')]=_0x3530f9[_0x7610('0x4c')][_0x7610('0x53')];}return db['CannedAnswer']['find']({'where':_0x1b9116})[_0x7610('0x26')](function(_0x2262fd){if(_0x2262fd){throw new db[(_0x7610('0x54'))][(_0x7610('0x55'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x7610('0x30')]['create'](_0x3530f9[_0x7610('0x4c')]);})[_0x7610('0x26')](function(_0x142766){var _0x374852=_0x3530f9['user'][_0x7610('0x27')]({'plain':!![]});if(!_0x374852)throw new Error(_0x7610('0x56'));if(_0x374852[_0x7610('0x57')]==='user'){var _0x4bea7b=_0x142766[_0x7610('0x27')]({'plain':!![]});return db[_0x7610('0x58')][_0x7610('0x4b')]({'where':{'name':_0x7610('0x28'),'userProfileId':_0x374852['userProfileId']},'raw':!![]})[_0x7610('0x26')](function(_0x2f43f0){if(_0x2f43f0&&_0x2f43f0['autoAssociation']===0x0){return db[_0x7610('0x29')][_0x7610('0x4f')]({'name':_0x4bea7b[_0x7610('0x2c')],'resourceId':_0x4bea7b['id'],'type':_0x2f43f0[_0x7610('0x2c')],'sectionId':_0x2f43f0['id']},{})[_0x7610('0x26')](function(){return _0x142766;});}else{return _0x142766;}})[_0x7610('0x46')](function(_0x3a684b){logger['error'](_0x7610('0x59'),_0x3a684b);throw _0x3a684b;});}return _0x142766;})[_0x7610('0x26')](respondWithResult(_0x2a51a3,0xc9))[_0x7610('0x46')](handleError(_0x2a51a3,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index a709f16..20e49e9 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 _0xcb8e=['request-promise','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','lodash','../../config/logger','api','moment','bluebird'];(function(_0x291717,_0x54b354){var _0x5d1e50=function(_0x4309ac){while(--_0x4309ac){_0x291717['push'](_0x291717['shift']());}};_0x5d1e50(++_0x54b354);}(_0xcb8e,0x1f3));var _0xecb8=function(_0x511ef8,_0x485338){_0x511ef8=_0x511ef8-0x0;var _0x1bbc3f=_0xcb8e[_0x511ef8];return _0x1bbc3f;};'use strict';var _=require(_0xecb8('0x0'));var util=require('util');var logger=require(_0xecb8('0x1'))(_0xecb8('0x2'));var moment=require(_0xecb8('0x3'));var BPromise=require(_0xecb8('0x4'));var rp=require(_0xecb8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xecb8('0x6'));var config=require(_0xecb8('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0xecb8('0x8')]=function(_0x2e1101,_0x3a2100){return _0x2e1101[_0xecb8('0x9')](_0xecb8('0xa'),attributes,{'tableName':_0xecb8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xff28=['lodash','util','../../config/logger','api','bluebird','path','rimraf','exports','define','tools_canned_answers','utf8mb4'];(function(_0x7b484,_0x195ad4){var _0x2ae1cf=function(_0x2e6247){while(--_0x2e6247){_0x7b484['push'](_0x7b484['shift']());}};_0x2ae1cf(++_0x195ad4);}(_0xff28,0xdc));var _0x8ff2=function(_0x443494,_0x51fc7e){_0x443494=_0x443494-0x0;var _0x4a6794=_0xff28[_0x443494];return _0x4a6794;};'use strict';var _=require(_0x8ff2('0x0'));var util=require(_0x8ff2('0x1'));var logger=require(_0x8ff2('0x2'))(_0x8ff2('0x3'));var moment=require('moment');var BPromise=require(_0x8ff2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ff2('0x5'));var rimraf=require(_0x8ff2('0x6'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x8ff2('0x7')]=function(_0x3bc7e4,_0x2e8993){return _0x3bc7e4[_0x8ff2('0x8')]('CannedAnswer',attributes,{'tableName':_0x8ff2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8ff2('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index ddb254c..fa50cd4 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(_0x44b714,_0x46e6e8){var _0x66fd8b=function(_0x11056c){while(--_0x11056c){_0x44b714['push'](_0x44b714['shift']());}};_0x66fd8b(++_0x46e6e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x23f553,_0x445bf3){var _0x26ab08=function(_0x44d3a3){while(--_0x44d3a3){_0x23f553['push'](_0x23f553['shift']());}};_0x26ab08(++_0x445bf3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 63b765e..2b2d411 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 _0xf655=['isAuthenticated','index','get','show','post','put','delete','/:id','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller'];(function(_0x2bdf17,_0x6d8f38){var _0xdde346=function(_0x2dfbe3){while(--_0x2dfbe3){_0x2bdf17['push'](_0x2bdf17['shift']());}};_0xdde346(++_0x6d8f38);}(_0xf655,0x199));var _0x5f65=function(_0x5239e2,_0x5e0d5b){_0x5239e2=_0x5239e2-0x0;var _0x1f6a59=_0xf655[_0x5239e2];return _0x1f6a59;};'use strict';var multer=require(_0x5f65('0x0'));var util=require(_0x5f65('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5f65('0x2')]();var fs_extra=require(_0x5f65('0x3'));var auth=require(_0x5f65('0x4'));var interaction=require(_0x5f65('0x5'));var config=require('../../config/environment');var controller=require(_0x5f65('0x6'));router['get']('/',auth[_0x5f65('0x7')](),controller[_0x5f65('0x8')]);router[_0x5f65('0x9')]('/:id',auth[_0x5f65('0x7')](),controller[_0x5f65('0xa')]);router[_0x5f65('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5f65('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5f65('0xd')](_0x5f65('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x5f65('0xf')]=router;
\ No newline at end of file
+var _0x6ff1=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','post'];(function(_0x41daaf,_0x9c8ae8){var _0x492873=function(_0x4283b3){while(--_0x4283b3){_0x41daaf['push'](_0x41daaf['shift']());}};_0x492873(++_0x9c8ae8);}(_0x6ff1,0xf0));var _0x16ff=function(_0x48787a,_0x13f971){_0x48787a=_0x48787a-0x0;var _0x452d03=_0x6ff1[_0x48787a];return _0x452d03;};'use strict';var multer=require(_0x16ff('0x0'));var util=require(_0x16ff('0x1'));var path=require('path');var timeout=require(_0x16ff('0x2'));var express=require(_0x16ff('0x3'));var router=express['Router']();var fs_extra=require(_0x16ff('0x4'));var auth=require(_0x16ff('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x16ff('0x6'));var controller=require(_0x16ff('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x16ff('0x8')](_0x16ff('0x9'),auth[_0x16ff('0xa')](),controller['show']);router[_0x16ff('0xb')]('/',auth[_0x16ff('0xa')](),controller[_0x16ff('0xc')]);router[_0x16ff('0xd')](_0x16ff('0x9'),auth['isAuthenticated'](),controller[_0x16ff('0xe')]);router[_0x16ff('0xf')]('/:id',auth[_0x16ff('0xa')](),controller[_0x16ff('0x10')]);module[_0x16ff('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 886342f..e5b5345 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 _0xee5b=['sequelize','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x59513e,_0x15eec4){var _0x469a1b=function(_0x3a4dc7){while(--_0x3a4dc7){_0x59513e['push'](_0x59513e['shift']());}};_0x469a1b(++_0x15eec4);}(_0xee5b,0x1f4));var _0xbee5=function(_0x34ea19,_0x4a8ffe){_0x34ea19=_0x34ea19-0x0;var _0x31e059=_0xee5b[_0x34ea19];return _0x31e059;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xbee5('0x1')],'allowNull':![],'defaultValue':_0xbee5('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xbee5('0x3')]},'dst':{'type':Sequelize[_0xbee5('0x3')]},'dcontext':{'type':Sequelize[_0xbee5('0x3')]},'channel':{'type':Sequelize[_0xbee5('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xbee5('0x3')]},'duration':{'type':Sequelize[_0xbee5('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xbee5('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbee5('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xbee5('0x3')]},'peeraccount':{'type':Sequelize[_0xbee5('0x3')]},'type':{'type':Sequelize[_0xbee5('0x3')]},'tag':{'type':Sequelize[_0xbee5('0x3')]}};
\ No newline at end of file
+var _0xc540=['INTEGER','1970-01-01\x2000:00:01','STRING'];(function(_0xc1c93f,_0x1fba71){var _0x3f81cb=function(_0x20b66f){while(--_0x20b66f){_0xc1c93f['push'](_0xc1c93f['shift']());}};_0x3f81cb(++_0x1fba71);}(_0xc540,0x184));var _0x0c54=function(_0x3956ff,_0x4cd334){_0x3956ff=_0x3956ff-0x0;var _0x3bd57d=_0xc540[_0x3956ff];return _0x3bd57d;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x0c54('0x0')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x0c54('0x1')]},'dst':{'type':Sequelize[_0x0c54('0x1')]},'dcontext':{'type':Sequelize[_0x0c54('0x1')]},'channel':{'type':Sequelize[_0x0c54('0x1')]},'dstchannel':{'type':Sequelize[_0x0c54('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x0c54('0x1')]},'duration':{'type':Sequelize[_0x0c54('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0c54('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0c54('0x1')]},'amaflags':{'type':Sequelize[_0x0c54('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0c54('0x1')]},'userfield':{'type':Sequelize[_0x0c54('0x1')]},'uniqueid':{'type':Sequelize[_0x0c54('0x1')]},'linkedid':{'type':Sequelize[_0x0c54('0x1')]},'sequence':{'type':Sequelize[_0x0c54('0x1')]},'peeraccount':{'type':Sequelize[_0x0c54('0x1')]},'type':{'type':Sequelize[_0x0c54('0x1')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 9395ba1..30a37b5 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 _0xb138=['filters','pick','VIRTUAL','merge','includeAll','include','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where'];(function(_0x2ec0b7,_0x1931c){var _0x44b5a7=function(_0x5285de){while(--_0x5285de){_0x2ec0b7['push'](_0x2ec0b7['shift']());}};_0x44b5a7(++_0x1931c);}(_0xb138,0x1dd));var _0x8b13=function(_0x39ff9c,_0x35d13a){_0x39ff9c=_0x39ff9c-0x0;var _0x4ff2d2=_0xb138[_0x39ff9c];return _0x4ff2d2;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['map'](_0x35fdca,_0x8b13('0x2b'));_0x2bb51d[_0x8b13('0x35')]=_[_0x8b13('0x36')](_0x3475d8[_0x8b13('0x35')]);_0x2bb51d['filters']=_['intersection'](_0x2bb51d[_0x8b13('0x34')],_0x2bb51d['query']);_0x114b01['attributes']=_[_0x8b13('0x37')](_0x2bb51d['model'],qs[_0x8b13('0x38')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x38')]));_0x114b01[_0x8b13('0x39')]=_0x114b01[_0x8b13('0x39')][_0x8b13('0x3a')]?_0x114b01[_0x8b13('0x39')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8[_0x8b13('0x35')][_0x8b13('0x3b')]('nolimit')){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3c')](_0x3475d8['query'][_0x8b13('0x3c')]);_0x114b01[_0x8b13('0x3d')]=qs[_0x8b13('0x3e')](_[_0x8b13('0x3f')](_0x3475d8[_0x8b13('0x35')],_0x2bb51d[_0x8b13('0x3e')]),_0x35fdca);if(_0x3475d8['query']['filter']){_0x114b01[_0x8b13('0x3d')]=_['merge'](_0x114b01[_0x8b13('0x3d')],{'$or':_['map'](_0x35fdca,function(_0x590a23){if(_0x590a23[_0x8b13('0x32')]!==_0x8b13('0x40')){var _0x2bc877={};_0x2bc877[_0x590a23[_0x8b13('0x2b')]]={'$like':'%'+_0x3475d8['query']['filter']+'%'};return _0x2bc877;}})});}_0x114b01=_[_0x8b13('0x41')]({},_0x114b01,_0x3475d8['options']);var _0x6ba2f3={'where':_0x114b01[_0x8b13('0x3d')]};return db['Cdr'][_0x8b13('0x20')](_0x6ba2f3)[_0x8b13('0x26')](function(_0x35c1d6){_0x5ab161[_0x8b13('0x20')]=_0x35c1d6;if(_0x3475d8[_0x8b13('0x35')][_0x8b13('0x42')]){_0x114b01[_0x8b13('0x43')]=[{'all':!![]}];}return db['Cdr']['findAll'](_0x114b01);})['then'](function(_0x3eb3c5){_0x5ab161[_0x8b13('0x44')]=_0x3eb3c5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x45')](handleError(_0x1511bf,null));};exports[_0x8b13('0x46')]=function(_0x271507,_0x492f7d){var _0x4342db={'raw':!![],'where':{'id':_0x271507[_0x8b13('0x47')]['id']}},_0x50e535={};_0x50e535['model']=_[_0x8b13('0x36')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x50e535[_0x8b13('0x35')]=_[_0x8b13('0x36')](_0x271507[_0x8b13('0x35')]);_0x50e535[_0x8b13('0x3e')]=_['intersection'](_0x50e535['model'],_0x50e535['query']);_0x4342db[_0x8b13('0x39')]=_[_0x8b13('0x37')](_0x50e535[_0x8b13('0x34')],qs[_0x8b13('0x38')](_0x271507['query']['fields']));_0x4342db[_0x8b13('0x39')]=_0x4342db['attributes'][_0x8b13('0x3a')]?_0x4342db[_0x8b13('0x39')]:_0x50e535[_0x8b13('0x34')];if(_0x271507[_0x8b13('0x35')][_0x8b13('0x42')]){_0x4342db['include']=[{'all':!![]}];}_0x4342db=_[_0x8b13('0x41')]({},_0x4342db,_0x271507[_0x8b13('0x48')]);return db[_0x8b13('0x2f')][_0x8b13('0x49')](_0x4342db)[_0x8b13('0x26')](handleEntityNotFound(_0x492f7d,null))[_0x8b13('0x26')](respondWithResult(_0x492f7d,null))[_0x8b13('0x45')](handleError(_0x492f7d,null));};exports[_0x8b13('0x4a')]=function(_0x3e192b,_0x518298){return db[_0x8b13('0x2f')]['create'](_0x3e192b[_0x8b13('0x4b')],{})[_0x8b13('0x26')](respondWithResult(_0x518298,0xc9))[_0x8b13('0x45')](handleError(_0x518298,null));};exports['update']=function(_0x148efb,_0x35f612){if(_0x148efb[_0x8b13('0x4b')]['id']){delete _0x148efb[_0x8b13('0x4b')]['id'];}return db[_0x8b13('0x2f')][_0x8b13('0x49')]({'where':{'id':_0x148efb[_0x8b13('0x47')]['id']}})['then'](handleEntityNotFound(_0x35f612,null))[_0x8b13('0x26')](saveUpdates(_0x148efb['body'],null))[_0x8b13('0x26')](respondWithResult(_0x35f612,null))[_0x8b13('0x45')](handleError(_0x35f612,null));};exports[_0x8b13('0x27')]=function(_0x435867,_0x2be640){return db[_0x8b13('0x2f')][_0x8b13('0x49')]({'where':{'id':_0x435867[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x2be640,null))[_0x8b13('0x26')](removeEntity(_0x2be640,null))[_0x8b13('0x45')](handleError(_0x2be640,null));};exports[_0x8b13('0x4c')]=function(_0xd55f3b,_0x2bdfae){return db[_0x8b13('0x2f')][_0x8b13('0x4c')]()[_0x8b13('0x26')](respondWithResult(_0x2bdfae,null))['catch'](handleError(_0x2bdfae,null));};
\ No newline at end of file
+var _0xf006=['fieldName','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','destroy','describe','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','Cdr','rawAttributes'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0xf006,0x146));var _0x6f00=function(_0x57ab57,_0x35db53){_0x57ab57=_0x57ab57-0x0;var _0x5ddf03=_0xf006[_0x57ab57];return _0x5ddf03;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6f00('0x0'));var jsonpatch=require(_0x6f00('0x1'));var rp=require('request-promise');var moment=require(_0x6f00('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6f00('0x3'));var util=require('util');var path=require('path');var sox=require(_0x6f00('0x4'));var csv=require(_0x6f00('0x5'));var ejs=require(_0x6f00('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f00('0x7'));var squel=require('squel');var crypto=require(_0x6f00('0x8'));var jsforce=require(_0x6f00('0x9'));var deskjs=require(_0x6f00('0xa'));var toCsv=require(_0x6f00('0x5'));var querystring=require(_0x6f00('0xb'));var Papa=require(_0x6f00('0xc'));var Redis=require(_0x6f00('0xd'));var authService=require(_0x6f00('0xe'));var qs=require(_0x6f00('0xf'));var as=require(_0x6f00('0x10'));var hardwareService=require(_0x6f00('0x11'));var logger=require(_0x6f00('0x12'))(_0x6f00('0x13'));var utils=require('../../config/utils');var config=require(_0x6f00('0x14'));var licenseUtil=require(_0x6f00('0x15'));var db=require(_0x6f00('0x16'))['db'];function respondWithStatusCode(_0x36a2ec,_0x289fe9){_0x289fe9=_0x289fe9||0xcc;return function(_0x5e3264){if(_0x5e3264){return _0x36a2ec[_0x6f00('0x17')](_0x289fe9);}return _0x36a2ec['status'](_0x289fe9)[_0x6f00('0x18')]();};}function respondWithResult(_0x5047f5,_0x324e67){_0x324e67=_0x324e67||0xc8;return function(_0x220e68){if(_0x220e68){return _0x5047f5[_0x6f00('0x19')](_0x324e67)[_0x6f00('0x1a')](_0x220e68);}};}function respondWithFilteredResult(_0xa6e7a1,_0x411203){return function(_0x46bc2c){if(_0x46bc2c){var _0x4d8aee=typeof _0x411203[_0x6f00('0x1b')]==='undefined'&&typeof _0x411203[_0x6f00('0x1c')]==='undefined';var _0x534275=_0x46bc2c[_0x6f00('0x1d')];var _0x6cf83f=_0x4d8aee?0x0:_0x411203[_0x6f00('0x1b')];var _0x340f78=_0x4d8aee?_0x46bc2c[_0x6f00('0x1d')]:_0x411203[_0x6f00('0x1b')]+_0x411203[_0x6f00('0x1c')];var _0x295640;if(_0x340f78>=_0x534275){_0x340f78=_0x534275;_0x295640=0xc8;}else{_0x295640=0xce;}_0xa6e7a1[_0x6f00('0x19')](_0x295640);return _0xa6e7a1[_0x6f00('0x1e')](_0x6f00('0x1f'),_0x6cf83f+'-'+_0x340f78+'/'+_0x534275)[_0x6f00('0x1a')](_0x46bc2c);}return null;};}function patchUpdates(_0x4e11de){return function(_0x4f3031){try{jsonpatch['apply'](_0x4f3031,_0x4e11de,!![]);}catch(_0x2a5286){return BPromise[_0x6f00('0x20')](_0x2a5286);}return _0x4f3031[_0x6f00('0x21')]();};}function saveUpdates(_0x57340f,_0xe301e5){return function(_0x9066ff){if(_0x9066ff){return _0x9066ff[_0x6f00('0x22')](_0x57340f)[_0x6f00('0x23')](function(_0x388983){return _0x388983;});}return null;};}function removeEntity(_0x1cbf1c,_0x90d74c){return function(_0x1ea061){if(_0x1ea061){return _0x1ea061['destroy']()[_0x6f00('0x23')](function(){_0x1cbf1c[_0x6f00('0x19')](0xcc)[_0x6f00('0x18')]();});}};}function handleEntityNotFound(_0x4d41ef,_0x37f062){return function(_0x4f7e29){if(!_0x4f7e29){_0x4d41ef[_0x6f00('0x17')](0x194);}return _0x4f7e29;};}function handleError(_0x511293,_0x434735){_0x434735=_0x434735||0x1f4;return function(_0x39375d){logger[_0x6f00('0x24')](_0x39375d[_0x6f00('0x25')]);if(_0x39375d[_0x6f00('0x26')]){delete _0x39375d['name'];}_0x511293[_0x6f00('0x19')](_0x434735)[_0x6f00('0x27')](_0x39375d);};}exports[_0x6f00('0x28')]=function(_0x4366a4,_0x2671fe){var _0x235a86={},_0xff36ce={},_0x451849={'count':0x0,'rows':[]};var _0x22f107=_[_0x6f00('0x29')](db[_0x6f00('0x2a')][_0x6f00('0x2b')],function(_0x29555d){return{'name':_0x29555d[_0x6f00('0x2c')],'type':_0x29555d['type']['key']};});_0xff36ce['model']=_['map'](_0x22f107,'name');_0xff36ce['query']=_[_0x6f00('0x2d')](_0x4366a4['query']);_0xff36ce[_0x6f00('0x2e')]=_[_0x6f00('0x2f')](_0xff36ce[_0x6f00('0x30')],_0xff36ce[_0x6f00('0x31')]);_0x235a86[_0x6f00('0x32')]=_[_0x6f00('0x2f')](_0xff36ce['model'],qs[_0x6f00('0x33')](_0x4366a4[_0x6f00('0x31')][_0x6f00('0x33')]));_0x235a86[_0x6f00('0x32')]=_0x235a86[_0x6f00('0x32')]['length']?_0x235a86['attributes']:_0xff36ce['model'];if(!_0x4366a4[_0x6f00('0x31')][_0x6f00('0x34')](_0x6f00('0x35'))){_0x235a86[_0x6f00('0x1c')]=qs[_0x6f00('0x1c')](_0x4366a4['query'][_0x6f00('0x1c')]);_0x235a86[_0x6f00('0x1b')]=qs[_0x6f00('0x1b')](_0x4366a4[_0x6f00('0x31')][_0x6f00('0x1b')]);}_0x235a86[_0x6f00('0x36')]=qs[_0x6f00('0x37')](_0x4366a4['query'][_0x6f00('0x37')]);_0x235a86[_0x6f00('0x38')]=qs[_0x6f00('0x2e')](_['pick'](_0x4366a4[_0x6f00('0x31')],_0xff36ce[_0x6f00('0x2e')]),_0x22f107);if(_0x4366a4[_0x6f00('0x31')]['filter']){_0x235a86[_0x6f00('0x38')]=_['merge'](_0x235a86[_0x6f00('0x38')],{'$or':_['map'](_0x22f107,function(_0x3dc8e3){if(_0x3dc8e3[_0x6f00('0x39')]!==_0x6f00('0x3a')){var _0x896b3f={};_0x896b3f[_0x3dc8e3['name']]={'$like':'%'+_0x4366a4[_0x6f00('0x31')]['filter']+'%'};return _0x896b3f;}})});}_0x235a86=_[_0x6f00('0x3b')]({},_0x235a86,_0x4366a4['options']);var _0x7785e1={'where':_0x235a86[_0x6f00('0x38')]};return db[_0x6f00('0x2a')][_0x6f00('0x1d')](_0x7785e1)['then'](function(_0x53dc8c){_0x451849[_0x6f00('0x1d')]=_0x53dc8c;if(_0x4366a4['query'][_0x6f00('0x3c')]){_0x235a86[_0x6f00('0x3d')]=[{'all':!![]}];}return db['Cdr'][_0x6f00('0x3e')](_0x235a86);})['then'](function(_0x4cac2c){_0x451849[_0x6f00('0x3f')]=_0x4cac2c;return _0x451849;})[_0x6f00('0x23')](respondWithFilteredResult(_0x2671fe,_0x235a86))[_0x6f00('0x40')](handleError(_0x2671fe,null));};exports[_0x6f00('0x41')]=function(_0x56399a,_0x38ee25){var _0x4523f2={'raw':!![],'where':{'id':_0x56399a[_0x6f00('0x42')]['id']}},_0x2bb5aa={};_0x2bb5aa[_0x6f00('0x30')]=_[_0x6f00('0x2d')](db['Cdr'][_0x6f00('0x2b')]);_0x2bb5aa[_0x6f00('0x31')]=_[_0x6f00('0x2d')](_0x56399a[_0x6f00('0x31')]);_0x2bb5aa[_0x6f00('0x2e')]=_[_0x6f00('0x2f')](_0x2bb5aa['model'],_0x2bb5aa[_0x6f00('0x31')]);_0x4523f2[_0x6f00('0x32')]=_[_0x6f00('0x2f')](_0x2bb5aa['model'],qs[_0x6f00('0x33')](_0x56399a['query'][_0x6f00('0x33')]));_0x4523f2[_0x6f00('0x32')]=_0x4523f2['attributes'][_0x6f00('0x43')]?_0x4523f2['attributes']:_0x2bb5aa[_0x6f00('0x30')];if(_0x56399a[_0x6f00('0x31')][_0x6f00('0x3c')]){_0x4523f2[_0x6f00('0x3d')]=[{'all':!![]}];}_0x4523f2=_['merge']({},_0x4523f2,_0x56399a[_0x6f00('0x44')]);return db['Cdr'][_0x6f00('0x45')](_0x4523f2)['then'](handleEntityNotFound(_0x38ee25,null))[_0x6f00('0x23')](respondWithResult(_0x38ee25,null))[_0x6f00('0x40')](handleError(_0x38ee25,null));};exports[_0x6f00('0x46')]=function(_0x9b003,_0x470ff3){return db[_0x6f00('0x2a')][_0x6f00('0x46')](_0x9b003[_0x6f00('0x47')],{})['then'](respondWithResult(_0x470ff3,0xc9))[_0x6f00('0x40')](handleError(_0x470ff3,null));};exports['update']=function(_0x265666,_0x31fb17){if(_0x265666[_0x6f00('0x47')]['id']){delete _0x265666['body']['id'];}return db['Cdr'][_0x6f00('0x45')]({'where':{'id':_0x265666[_0x6f00('0x42')]['id']}})['then'](handleEntityNotFound(_0x31fb17,null))[_0x6f00('0x23')](saveUpdates(_0x265666['body'],null))[_0x6f00('0x23')](respondWithResult(_0x31fb17,null))['catch'](handleError(_0x31fb17,null));};exports[_0x6f00('0x48')]=function(_0x222b4c,_0x4c6e06){return db['Cdr'][_0x6f00('0x45')]({'where':{'id':_0x222b4c[_0x6f00('0x42')]['id']}})['then'](handleEntityNotFound(_0x4c6e06,null))[_0x6f00('0x23')](removeEntity(_0x4c6e06,null))['catch'](handleError(_0x4c6e06,null));};exports[_0x6f00('0x49')]=function(_0x7f80ed,_0x3100ee){return db[_0x6f00('0x2a')][_0x6f00('0x49')]()[_0x6f00('0x23')](respondWithResult(_0x3100ee,null))[_0x6f00('0x40')](handleError(_0x3100ee,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index e5f94ef..a45d0e5 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(_0x3d5cd9,_0x16db35){var _0x116080=function(_0x4c80fc){while(--_0x4c80fc){_0x3d5cd9['push'](_0x3d5cd9['shift']());}};_0x116080(++_0x16db35);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x1220c0,_0x5c06f9){var _0x1cc1b7=function(_0x2ab880){while(--_0x2ab880){_0x1220c0['push'](_0x1220c0['shift']());}};_0x1cc1b7(++_0x5c06f9);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 0affbb7..ded0adb 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 _0x5b4c=['bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','lodash','util','moment'];(function(_0x52967f,_0x5a463d){var _0x5e671f=function(_0x2b3dbb){while(--_0x2b3dbb){_0x52967f['push'](_0x52967f['shift']());}};_0x5e671f(++_0x5a463d);}(_0x5b4c,0xb1));var _0xc5b4=function(_0x14e704,_0x2ae9f4){_0x14e704=_0x14e704-0x0;var _0x2ff43b=_0x5b4c[_0x14e704];return _0x2ff43b;};'use strict';var _=require(_0xc5b4('0x0'));var util=require(_0xc5b4('0x1'));var moment=require(_0xc5b4('0x2'));var BPromise=require(_0xc5b4('0x3'));var rs=require(_0xc5b4('0x4'));var fs=require('fs');var Redis=require(_0xc5b4('0x5'));var db=require(_0xc5b4('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc5b4('0x7'));var config=require('../../config/environment');var jayson=require(_0xc5b4('0x8'));var client=jayson[_0xc5b4('0x9')][_0xc5b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x522f38,_0x148217,_0x3633c1){return new BPromise(function(_0xa5acc,_0x598210){return client['request'](_0x522f38,_0x3633c1)[_0xc5b4('0xb')](function(_0x93c855){logger[_0xc5b4('0xc')](_0xc5b4('0xd'),_0x148217,'request\x20sent');logger[_0xc5b4('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x148217,_0xc5b4('0xf'),JSON['stringify'](_0x93c855));if(_0x93c855[_0xc5b4('0x10')]){if(_0x93c855['error'][_0xc5b4('0x11')]===0x1f4){logger['error'](_0xc5b4('0xd'),_0x148217,_0x93c855[_0xc5b4('0x10')][_0xc5b4('0x12')]);return _0x598210(_0x93c855[_0xc5b4('0x10')]['message']);}logger[_0xc5b4('0x10')](_0xc5b4('0xd'),_0x148217,_0x93c855[_0xc5b4('0x10')][_0xc5b4('0x12')]);return _0xa5acc(_0x93c855[_0xc5b4('0x10')][_0xc5b4('0x12')]);}else{logger['info'](_0xc5b4('0xd'),_0x148217,'request\x20sent');_0xa5acc(_0x93c855['result'][_0xc5b4('0x12')]);}})[_0xc5b4('0x13')](function(_0x47dddd){logger[_0xc5b4('0x10')](_0xc5b4('0xd'),_0x148217,_0x47dddd);_0x598210(_0x47dddd);});});}
\ No newline at end of file
+var _0xb5f9=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','randomstring'];(function(_0x4dc3a4,_0x886144){var _0x45b80c=function(_0x40f6f8){while(--_0x40f6f8){_0x4dc3a4['push'](_0x4dc3a4['shift']());}};_0x45b80c(++_0x886144);}(_0xb5f9,0x13d));var _0x9b5f=function(_0x137092,_0x446f4f){_0x137092=_0x137092-0x0;var _0x4c0917=_0xb5f9[_0x137092];return _0x4c0917;};'use strict';var _=require('lodash');var util=require(_0x9b5f('0x0'));var moment=require(_0x9b5f('0x1'));var BPromise=require('bluebird');var rs=require(_0x9b5f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9b5f('0x3'));var logger=require(_0x9b5f('0x4'))(_0x9b5f('0x5'));var config=require(_0x9b5f('0x6'));var jayson=require(_0x9b5f('0x7'));var client=jayson[_0x9b5f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cdbdf,_0x255352,_0xacf955){return new BPromise(function(_0x5ada19,_0x272249){return client[_0x9b5f('0x9')](_0x4cdbdf,_0xacf955)['then'](function(_0x17d892){logger[_0x9b5f('0xa')](_0x9b5f('0xb'),_0x255352,_0x9b5f('0xc'));logger[_0x9b5f('0xd')]('Cdr,\x20%s,\x20%s,\x20%s',_0x255352,'request\x20sent',JSON[_0x9b5f('0xe')](_0x17d892));if(_0x17d892[_0x9b5f('0xf')]){if(_0x17d892[_0x9b5f('0xf')][_0x9b5f('0x10')]===0x1f4){logger[_0x9b5f('0xf')](_0x9b5f('0xb'),_0x255352,_0x17d892[_0x9b5f('0xf')][_0x9b5f('0x11')]);return _0x272249(_0x17d892[_0x9b5f('0xf')][_0x9b5f('0x11')]);}logger['error'](_0x9b5f('0xb'),_0x255352,_0x17d892[_0x9b5f('0xf')]['message']);return _0x5ada19(_0x17d892[_0x9b5f('0xf')][_0x9b5f('0x11')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x255352,'request\x20sent');_0x5ada19(_0x17d892[_0x9b5f('0x12')][_0x9b5f('0x11')]);}})[_0x9b5f('0x13')](function(_0x1b3f4a){logger[_0x9b5f('0xf')](_0x9b5f('0xb'),_0x255352,_0x1b3f4a);_0x272249(_0x1b3f4a);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 7d2518e..40bf504 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(_0x1e8972,_0x12b85d){var _0x353f33=function(_0x16f1da){while(--_0x16f1da){_0x1e8972['push'](_0x1e8972['shift']());}};_0x353f33(++_0x12b85d);}(_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(_0x608e20,_0x2c546d){var _0x5f498a=function(_0x7ee427){while(--_0x7ee427){_0x608e20['push'](_0x608e20['shift']());}};_0x5f498a(++_0x2c546d);}(_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 5f1a7c3..2205af9 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 _0x439c=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x439c,0xbb));var _0xc439=function(_0x7f31fe,_0x28e264){_0x7f31fe=_0x7f31fe-0x0;var _0x1bbdff=_0x439c[_0x7f31fe];return _0x1bbdff;};'use strict';var Sequelize=require(_0xc439('0x0'));module[_0xc439('0x1')]={'priority':{'type':Sequelize[_0xc439('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc439('0x3')],'allowNull':![],'defaultValue':_0xc439('0x4')},'appdata':{'type':Sequelize[_0xc439('0x5')]()},'description':{'type':Sequelize[_0xc439('0x3')]},'interval':{'type':Sequelize[_0xc439('0x3')],'defaultValue':_0xc439('0x6')}};
\ No newline at end of file
+var _0xfc22=['*,*,*,*','exports','INTEGER','STRING'];(function(_0x9adf1b,_0x3ac695){var _0x960269=function(_0x368ca6){while(--_0x368ca6){_0x9adf1b['push'](_0x9adf1b['shift']());}};_0x960269(++_0x3ac695);}(_0xfc22,0x79));var _0x2fc2=function(_0x40a614,_0x2ac5ee){_0x40a614=_0x40a614-0x0;var _0x40eeac=_0xfc22[_0x40a614];return _0x40eeac;};'use strict';var Sequelize=require('sequelize');module[_0x2fc2('0x0')]={'priority':{'type':Sequelize[_0x2fc2('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x2fc2('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2fc2('0x2')],'defaultValue':_0x2fc2('0x3')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 1443739..a3e95ff 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 _0x6a24=['error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x26addd,_0x255a1e){var _0x13a6b2=function(_0xb4d373){while(--_0xb4d373){_0x26addd['push'](_0x26addd['shift']());}};_0x13a6b2(++_0x255a1e);}(_0x6a24,0xd1));var _0x46a2=function(_0xe4fe77,_0xd8330e){_0xe4fe77=_0xe4fe77-0x0;var _0xeb8cd6=_0x6a24[_0xe4fe77];return _0xeb8cd6;};'use strict';var emlformat=require(_0x46a2('0x0'));var rimraf=require(_0x46a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46a2('0x2'));var rp=require(_0x46a2('0x3'));var moment=require(_0x46a2('0x4'));var BPromise=require(_0x46a2('0x5'));var Mustache=require(_0x46a2('0x6'));var util=require('util');var path=require(_0x46a2('0x7'));var sox=require(_0x46a2('0x8'));var csv=require('to-csv');var ejs=require(_0x46a2('0x9'));var fs=require('fs');var fs_extra=require(_0x46a2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x46a2('0xb'));var jsforce=require(_0x46a2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x46a2('0xd'));var querystring=require('querystring');var Papa=require(_0x46a2('0xe'));var Redis=require('ioredis');var authService=require(_0x46a2('0xf'));var qs=require(_0x46a2('0x10'));var as=require(_0x46a2('0x11'));var hardwareService=require(_0x46a2('0x12'));var logger=require(_0x46a2('0x13'))(_0x46a2('0x14'));var utils=require(_0x46a2('0x15'));var config=require(_0x46a2('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x403282,_0x18e584){_0x18e584=_0x18e584||0xcc;return function(_0x5c5d10){if(_0x5c5d10){return _0x403282[_0x46a2('0x17')](_0x18e584);}return _0x403282[_0x46a2('0x18')](_0x18e584)[_0x46a2('0x19')]();};}function respondWithResult(_0x18a038,_0xddc328){_0xddc328=_0xddc328||0xc8;return function(_0x2fd383){if(_0x2fd383){return _0x18a038[_0x46a2('0x18')](_0xddc328)[_0x46a2('0x1a')](_0x2fd383);}};}function respondWithFilteredResult(_0x577591,_0x4a7e7a){return function(_0x3c81e8){if(_0x3c81e8){var _0x2deb20=typeof _0x4a7e7a['offset']===_0x46a2('0x1b')&&typeof _0x4a7e7a[_0x46a2('0x1c')]==='undefined';var _0xa2eb96=_0x3c81e8[_0x46a2('0x1d')];var _0x577f18=_0x2deb20?0x0:_0x4a7e7a[_0x46a2('0x1e')];var _0x24f75f=_0x2deb20?_0x3c81e8['count']:_0x4a7e7a[_0x46a2('0x1e')]+_0x4a7e7a[_0x46a2('0x1c')];var _0x5144c7;if(_0x24f75f>=_0xa2eb96){_0x24f75f=_0xa2eb96;_0x5144c7=0xc8;}else{_0x5144c7=0xce;}_0x577591[_0x46a2('0x18')](_0x5144c7);return _0x577591[_0x46a2('0x1f')](_0x46a2('0x20'),_0x577f18+'-'+_0x24f75f+'/'+_0xa2eb96)[_0x46a2('0x1a')](_0x3c81e8);}return null;};}function patchUpdates(_0x202294){return function(_0x2d65c2){try{jsonpatch[_0x46a2('0x21')](_0x2d65c2,_0x202294,!![]);}catch(_0x473cfb){return BPromise[_0x46a2('0x22')](_0x473cfb);}return _0x2d65c2[_0x46a2('0x23')]();};}function saveUpdates(_0x5c7586,_0xa37d90){return function(_0x504b9e){if(_0x504b9e){return _0x504b9e[_0x46a2('0x24')](_0x5c7586)[_0x46a2('0x25')](function(_0x511ff6){return _0x511ff6;});}return null;};}function removeEntity(_0x43dc69,_0x15e5bb){return function(_0x233c4e){if(_0x233c4e){return _0x233c4e[_0x46a2('0x26')]()['then'](function(){_0x43dc69[_0x46a2('0x18')](0xcc)[_0x46a2('0x19')]();});}};}function handleEntityNotFound(_0x1e48f5,_0x297158){return function(_0x74bb6a){if(!_0x74bb6a){_0x1e48f5[_0x46a2('0x17')](0x194);}return _0x74bb6a;};}function handleError(_0x3e9554,_0xfa9e13){_0xfa9e13=_0xfa9e13||0x1f4;return function(_0x218f1c){logger[_0x46a2('0x27')](_0x218f1c[_0x46a2('0x28')]);if(_0x218f1c['name']){delete _0x218f1c[_0x46a2('0x29')];}_0x3e9554[_0x46a2('0x18')](_0xfa9e13)[_0x46a2('0x2a')](_0x218f1c);};}exports[_0x46a2('0x2b')]=function(_0x435155,_0x33f42a){var _0x577fd2={'raw':!![],'where':{'id':_0x435155[_0x46a2('0x2c')]['id']}},_0x185647={};_0x185647[_0x46a2('0x2d')]=_[_0x46a2('0x2e')](db[_0x46a2('0x2f')][_0x46a2('0x30')]);_0x185647[_0x46a2('0x31')]=_['keys'](_0x435155[_0x46a2('0x31')]);_0x185647[_0x46a2('0x32')]=_[_0x46a2('0x33')](_0x185647[_0x46a2('0x2d')],_0x185647[_0x46a2('0x31')]);_0x577fd2[_0x46a2('0x34')]=_[_0x46a2('0x33')](_0x185647[_0x46a2('0x2d')],qs[_0x46a2('0x35')](_0x435155['query'][_0x46a2('0x35')]));_0x577fd2[_0x46a2('0x34')]=_0x577fd2[_0x46a2('0x34')][_0x46a2('0x36')]?_0x577fd2[_0x46a2('0x34')]:_0x185647['model'];if(_0x435155['query'][_0x46a2('0x37')]){_0x577fd2[_0x46a2('0x38')]=[{'all':!![]}];}_0x577fd2=_[_0x46a2('0x39')]({},_0x577fd2,_0x435155[_0x46a2('0x3a')]);return db[_0x46a2('0x2f')][_0x46a2('0x3b')](_0x577fd2)['then'](handleEntityNotFound(_0x33f42a,null))['then'](respondWithResult(_0x33f42a,null))[_0x46a2('0x3c')](handleError(_0x33f42a,null));};exports['update']=function(_0x462374,_0x3fe076){if(_0x462374[_0x46a2('0x3d')]['id']){delete _0x462374[_0x46a2('0x3d')]['id'];}return db['ChatApplication'][_0x46a2('0x3b')]({'where':{'id':_0x462374[_0x46a2('0x2c')]['id']}})[_0x46a2('0x25')](handleEntityNotFound(_0x3fe076,null))[_0x46a2('0x25')](saveUpdates(_0x462374['body'],null))[_0x46a2('0x25')](respondWithResult(_0x3fe076,null))[_0x46a2('0x3c')](handleError(_0x3fe076,null));};exports[_0x46a2('0x26')]=function(_0x1cff82,_0x4fa161){return db[_0x46a2('0x2f')]['find']({'where':{'id':_0x1cff82[_0x46a2('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4fa161,null))[_0x46a2('0x25')](removeEntity(_0x4fa161,null))[_0x46a2('0x3c')](handleError(_0x4fa161,null));};
\ No newline at end of file
+var _0x3e5c=['Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','params','rawAttributes','query','keys','filters','intersection','attributes','model','fields','length','include','merge','options','ChatApplication','body','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x40b54c,_0x19014b){_0x40b54c=_0x40b54c-0x0;var _0x272365=_0x3e5c[_0x40b54c];return _0x272365;};'use strict';var emlformat=require(_0xc3e5('0x0'));var rimraf=require(_0xc3e5('0x1'));var zipdir=require(_0xc3e5('0x2'));var jsonpatch=require(_0xc3e5('0x3'));var rp=require('request-promise');var moment=require(_0xc3e5('0x4'));var BPromise=require(_0xc3e5('0x5'));var Mustache=require(_0xc3e5('0x6'));var util=require(_0xc3e5('0x7'));var path=require(_0xc3e5('0x8'));var sox=require(_0xc3e5('0x9'));var csv=require('to-csv');var ejs=require(_0xc3e5('0xa'));var fs=require('fs');var fs_extra=require(_0xc3e5('0xb'));var _=require(_0xc3e5('0xc'));var squel=require(_0xc3e5('0xd'));var crypto=require(_0xc3e5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc3e5('0xf'));var toCsv=require(_0xc3e5('0x10'));var querystring=require(_0xc3e5('0x11'));var Papa=require(_0xc3e5('0x12'));var Redis=require(_0xc3e5('0x13'));var authService=require(_0xc3e5('0x14'));var qs=require(_0xc3e5('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3e5('0x16'));var logger=require(_0xc3e5('0x17'))(_0xc3e5('0x18'));var utils=require(_0xc3e5('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc3e5('0x1a'));var db=require(_0xc3e5('0x1b'))['db'];function respondWithStatusCode(_0x36193e,_0x3f0395){_0x3f0395=_0x3f0395||0xcc;return function(_0x3b7441){if(_0x3b7441){return _0x36193e[_0xc3e5('0x1c')](_0x3f0395);}return _0x36193e['status'](_0x3f0395)['end']();};}function respondWithResult(_0x52cca7,_0x27c226){_0x27c226=_0x27c226||0xc8;return function(_0x5a52f1){if(_0x5a52f1){return _0x52cca7[_0xc3e5('0x1d')](_0x27c226)[_0xc3e5('0x1e')](_0x5a52f1);}};}function respondWithFilteredResult(_0x4d1ad9,_0x353dc0){return function(_0x3e3eaa){if(_0x3e3eaa){var _0x2cc476=typeof _0x353dc0[_0xc3e5('0x1f')]===_0xc3e5('0x20')&&typeof _0x353dc0['limit']===_0xc3e5('0x20');var _0x277063=_0x3e3eaa[_0xc3e5('0x21')];var _0xa33d84=_0x2cc476?0x0:_0x353dc0[_0xc3e5('0x1f')];var _0x1e1eea=_0x2cc476?_0x3e3eaa['count']:_0x353dc0[_0xc3e5('0x1f')]+_0x353dc0[_0xc3e5('0x22')];var _0x4a1d86;if(_0x1e1eea>=_0x277063){_0x1e1eea=_0x277063;_0x4a1d86=0xc8;}else{_0x4a1d86=0xce;}_0x4d1ad9[_0xc3e5('0x1d')](_0x4a1d86);return _0x4d1ad9['set'](_0xc3e5('0x23'),_0xa33d84+'-'+_0x1e1eea+'/'+_0x277063)[_0xc3e5('0x1e')](_0x3e3eaa);}return null;};}function patchUpdates(_0x2d551b){return function(_0xebf6dc){try{jsonpatch[_0xc3e5('0x24')](_0xebf6dc,_0x2d551b,!![]);}catch(_0x4a7806){return BPromise[_0xc3e5('0x25')](_0x4a7806);}return _0xebf6dc[_0xc3e5('0x26')]();};}function saveUpdates(_0x2d8c6f,_0x3eb513){return function(_0x414ba9){if(_0x414ba9){return _0x414ba9[_0xc3e5('0x27')](_0x2d8c6f)[_0xc3e5('0x28')](function(_0x47f344){return _0x47f344;});}return null;};}function removeEntity(_0x3a2800,_0x430cb4){return function(_0x43d01e){if(_0x43d01e){return _0x43d01e[_0xc3e5('0x29')]()[_0xc3e5('0x28')](function(){_0x3a2800[_0xc3e5('0x1d')](0xcc)[_0xc3e5('0x2a')]();});}};}function handleEntityNotFound(_0x45556e,_0x564748){return function(_0x25d3a3){if(!_0x25d3a3){_0x45556e['sendStatus'](0x194);}return _0x25d3a3;};}function handleError(_0x4c0cf4,_0x8815af){_0x8815af=_0x8815af||0x1f4;return function(_0x12ad6e){logger[_0xc3e5('0x2b')](_0x12ad6e['stack']);if(_0x12ad6e[_0xc3e5('0x2c')]){delete _0x12ad6e[_0xc3e5('0x2c')];}_0x4c0cf4[_0xc3e5('0x1d')](_0x8815af)[_0xc3e5('0x2d')](_0x12ad6e);};}exports['show']=function(_0xa6766d,_0x497ecf){var _0x45ca6d={'raw':!![],'where':{'id':_0xa6766d[_0xc3e5('0x2e')]['id']}},_0xc0e6e7={};_0xc0e6e7['model']=_['keys'](db['ChatApplication'][_0xc3e5('0x2f')]);_0xc0e6e7[_0xc3e5('0x30')]=_[_0xc3e5('0x31')](_0xa6766d[_0xc3e5('0x30')]);_0xc0e6e7[_0xc3e5('0x32')]=_[_0xc3e5('0x33')](_0xc0e6e7['model'],_0xc0e6e7[_0xc3e5('0x30')]);_0x45ca6d[_0xc3e5('0x34')]=_[_0xc3e5('0x33')](_0xc0e6e7[_0xc3e5('0x35')],qs[_0xc3e5('0x36')](_0xa6766d[_0xc3e5('0x30')][_0xc3e5('0x36')]));_0x45ca6d[_0xc3e5('0x34')]=_0x45ca6d[_0xc3e5('0x34')][_0xc3e5('0x37')]?_0x45ca6d[_0xc3e5('0x34')]:_0xc0e6e7['model'];if(_0xa6766d[_0xc3e5('0x30')]['includeAll']){_0x45ca6d[_0xc3e5('0x38')]=[{'all':!![]}];}_0x45ca6d=_[_0xc3e5('0x39')]({},_0x45ca6d,_0xa6766d[_0xc3e5('0x3a')]);return db[_0xc3e5('0x3b')]['find'](_0x45ca6d)[_0xc3e5('0x28')](handleEntityNotFound(_0x497ecf,null))['then'](respondWithResult(_0x497ecf,null))['catch'](handleError(_0x497ecf,null));};exports[_0xc3e5('0x27')]=function(_0x4f6fe1,_0x3c407f){if(_0x4f6fe1[_0xc3e5('0x3c')]['id']){delete _0x4f6fe1[_0xc3e5('0x3c')]['id'];}return db[_0xc3e5('0x3b')][_0xc3e5('0x3d')]({'where':{'id':_0x4f6fe1['params']['id']}})[_0xc3e5('0x28')](handleEntityNotFound(_0x3c407f,null))[_0xc3e5('0x28')](saveUpdates(_0x4f6fe1[_0xc3e5('0x3c')],null))[_0xc3e5('0x28')](respondWithResult(_0x3c407f,null))[_0xc3e5('0x3e')](handleError(_0x3c407f,null));};exports['destroy']=function(_0x3ab3be,_0x484e21){return db[_0xc3e5('0x3b')][_0xc3e5('0x3d')]({'where':{'id':_0x3ab3be['params']['id']}})[_0xc3e5('0x28')](handleEntityNotFound(_0x484e21,null))['then'](removeEntity(_0x484e21,null))[_0xc3e5('0x3e')](handleError(_0x484e21,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index ce5fa92..9f30292 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 _0x67c7=['bluebird','request-promise','path','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x32290e,_0x1a0749){var _0x12762f=function(_0x2b1d2b){while(--_0x2b1d2b){_0x32290e['push'](_0x32290e['shift']());}};_0x12762f(++_0x1a0749);}(_0x67c7,0x172));var _0x767c=function(_0xa599e2,_0x3046be){_0xa599e2=_0xa599e2-0x0;var _0x122f49=_0x67c7[_0xa599e2];return _0x122f49;};'use strict';var _=require(_0x767c('0x0'));var util=require(_0x767c('0x1'));var logger=require(_0x767c('0x2'))(_0x767c('0x3'));var moment=require(_0x767c('0x4'));var BPromise=require(_0x767c('0x5'));var rp=require(_0x767c('0x6'));var fs=require('fs');var path=require(_0x767c('0x7'));var rimraf=require('rimraf');var config=require(_0x767c('0x8'));var attributes=require(_0x767c('0x9'));module['exports']=function(_0x116f27,_0xf3bf74){return _0x116f27[_0x767c('0xa')](_0x767c('0xb'),attributes,{'tableName':_0x767c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x767c('0xd'),'collate':_0x767c('0xe')});};
\ No newline at end of file
+var _0x12d7=['request-promise','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x28394f,_0x5ebdd2){var _0x2618d2=function(_0x2ffed6){while(--_0x2ffed6){_0x28394f['push'](_0x28394f['shift']());}};_0x2618d2(++_0x5ebdd2);}(_0x12d7,0x181));var _0x712d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12d7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x712d('0x0'));var util=require('util');var logger=require(_0x712d('0x1'))(_0x712d('0x2'));var moment=require(_0x712d('0x3'));var BPromise=require(_0x712d('0x4'));var rp=require(_0x712d('0x5'));var fs=require('fs');var path=require(_0x712d('0x6'));var rimraf=require('rimraf');var config=require(_0x712d('0x7'));var attributes=require(_0x712d('0x8'));module[_0x712d('0x9')]=function(_0x2cf71a,_0x498a92){return _0x2cf71a[_0x712d('0xa')](_0x712d('0xb'),attributes,{'tableName':_0x712d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x712d('0xd'),'collate':_0x712d('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index b011bab..57e561e 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 _0xb599=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x249935,_0x2c405d){var _0x305bb0=function(_0x4fe26f){while(--_0x4fe26f){_0x249935['push'](_0x249935['shift']());}};_0x305bb0(++_0x2c405d);}(_0xb599,0x6e));var _0x9b59=function(_0x2d1817,_0x10589e){_0x2d1817=_0x2d1817-0x0;var _0x130746=_0xb599[_0x2d1817];return _0x130746;};'use strict';var _=require('lodash');var util=require(_0x9b59('0x0'));var moment=require(_0x9b59('0x1'));var BPromise=require(_0x9b59('0x2'));var rs=require(_0x9b59('0x3'));var fs=require('fs');var Redis=require(_0x9b59('0x4'));var db=require(_0x9b59('0x5'))['db'];var utils=require(_0x9b59('0x6'));var logger=require(_0x9b59('0x7'))(_0x9b59('0x8'));var config=require(_0x9b59('0x9'));var jayson=require(_0x9b59('0xa'));var client=jayson[_0x9b59('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xef7f55,_0x170f99,_0x2b5c11){return new BPromise(function(_0x140b37,_0x499f73){return client['request'](_0xef7f55,_0x2b5c11)[_0x9b59('0xc')](function(_0xf5cd5f){logger[_0x9b59('0xd')](_0x9b59('0xe'),_0x170f99,_0x9b59('0xf'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x170f99,'request\x20sent',JSON[_0x9b59('0x10')](_0xf5cd5f));if(_0xf5cd5f[_0x9b59('0x11')]){if(_0xf5cd5f[_0x9b59('0x11')][_0x9b59('0x12')]===0x1f4){logger[_0x9b59('0x11')](_0x9b59('0xe'),_0x170f99,_0xf5cd5f[_0x9b59('0x11')][_0x9b59('0x13')]);return _0x499f73(_0xf5cd5f['error'][_0x9b59('0x13')]);}logger[_0x9b59('0x11')](_0x9b59('0xe'),_0x170f99,_0xf5cd5f[_0x9b59('0x11')]['message']);return _0x140b37(_0xf5cd5f['error']['message']);}else{logger[_0x9b59('0xd')](_0x9b59('0xe'),_0x170f99,_0x9b59('0xf'));_0x140b37(_0xf5cd5f[_0x9b59('0x14')][_0x9b59('0x13')]);}})[_0x9b59('0x15')](function(_0x31700a){logger['error'](_0x9b59('0xe'),_0x170f99,_0x31700a);_0x499f73(_0x31700a);});});}
\ No newline at end of file
+var _0x3a4a=['error','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x27eda0,_0x42a3cf){var _0x2b63a5=function(_0x431084){while(--_0x431084){_0x27eda0['push'](_0x27eda0['shift']());}};_0x2b63a5(++_0x42a3cf);}(_0x3a4a,0x15e));var _0xa3a4=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0x3a4a[_0x1a7550];return _0x426e22;};'use strict';var _=require(_0xa3a4('0x0'));var util=require(_0xa3a4('0x1'));var moment=require(_0xa3a4('0x2'));var BPromise=require(_0xa3a4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3a4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3a4('0x5'));var logger=require(_0xa3a4('0x6'))(_0xa3a4('0x7'));var config=require(_0xa3a4('0x8'));var jayson=require(_0xa3a4('0x9'));var client=jayson[_0xa3a4('0xa')][_0xa3a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d4546,_0x1b145d,_0x6c0f54){return new BPromise(function(_0x22cc83,_0x5d79dc){return client[_0xa3a4('0xc')](_0x3d4546,_0x6c0f54)[_0xa3a4('0xd')](function(_0x1e57dd){logger[_0xa3a4('0xe')]('ChatApplication,\x20%s,\x20%s',_0x1b145d,_0xa3a4('0xf'));logger[_0xa3a4('0x10')](_0xa3a4('0x11'),_0x1b145d,_0xa3a4('0xf'),JSON['stringify'](_0x1e57dd));if(_0x1e57dd[_0xa3a4('0x12')]){if(_0x1e57dd[_0xa3a4('0x12')]['code']===0x1f4){logger[_0xa3a4('0x12')](_0xa3a4('0x13'),_0x1b145d,_0x1e57dd['error']['message']);return _0x5d79dc(_0x1e57dd[_0xa3a4('0x12')][_0xa3a4('0x14')]);}logger[_0xa3a4('0x12')](_0xa3a4('0x13'),_0x1b145d,_0x1e57dd[_0xa3a4('0x12')]['message']);return _0x22cc83(_0x1e57dd['error'][_0xa3a4('0x14')]);}else{logger[_0xa3a4('0xe')]('ChatApplication,\x20%s,\x20%s',_0x1b145d,_0xa3a4('0xf'));_0x22cc83(_0x1e57dd[_0xa3a4('0x15')][_0xa3a4('0x14')]);}})[_0xa3a4('0x16')](function(_0x49be11){logger[_0xa3a4('0x12')](_0xa3a4('0x13'),_0x1b145d,_0x49be11);_0x5d79dc(_0x49be11);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index ff8209f..7266147 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 _0x95f7=['../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5825be,_0x1c8318){var _0x5b7559=function(_0x115086){while(--_0x115086){_0x5825be['push'](_0x5825be['shift']());}};_0x5b7559(++_0x1c8318);}(_0x95f7,0x1a2));var _0x795f=function(_0x7e1895,_0x11758a){_0x7e1895=_0x7e1895-0x0;var _0x5b5320=_0x95f7[_0x7e1895];return _0x5b5320;};'use strict';var multer=require(_0x795f('0x0'));var util=require(_0x795f('0x1'));var path=require(_0x795f('0x2'));var timeout=require(_0x795f('0x3'));var express=require(_0x795f('0x4'));var router=express[_0x795f('0x5')]();var fs_extra=require(_0x795f('0x6'));var auth=require(_0x795f('0x7'));var interaction=require(_0x795f('0x8'));var config=require('../../config/environment');var controller=require(_0x795f('0x9'));router[_0x795f('0xa')](_0x795f('0xb'),auth[_0x795f('0xc')](),controller[_0x795f('0xd')]);router['put'](_0x795f('0xb'),auth[_0x795f('0xc')](),controller[_0x795f('0xe')]);router[_0x795f('0xf')](_0x795f('0xb'),auth[_0x795f('0xc')](),controller[_0x795f('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xdfc2=['connect-timeout','express','fs-extra','../../components/auth/service','./chatApplication.controller','get','/:id','show','update','isAuthenticated','destroy','exports','multer','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdfc2,0xfc));var _0x2dfc=function(_0x321d0b,_0x41fbca){_0x321d0b=_0x321d0b-0x0;var _0x24b79a=_0xdfc2[_0x321d0b];return _0x24b79a;};'use strict';var multer=require(_0x2dfc('0x0'));var util=require(_0x2dfc('0x1'));var path=require(_0x2dfc('0x2'));var timeout=require(_0x2dfc('0x3'));var express=require(_0x2dfc('0x4'));var router=express['Router']();var fs_extra=require(_0x2dfc('0x5'));var auth=require(_0x2dfc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2dfc('0x7'));router[_0x2dfc('0x8')](_0x2dfc('0x9'),auth['isAuthenticated'](),controller[_0x2dfc('0xa')]);router['put'](_0x2dfc('0x9'),auth['isAuthenticated'](),controller[_0x2dfc('0xb')]);router['delete'](_0x2dfc('0x9'),auth[_0x2dfc('0xc')](),controller[_0x2dfc('0xd')]);module[_0x2dfc('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index b5c9881..08ac495 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 _0x0018=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4e3c21,_0x286f50){var _0x50250d=function(_0x401f37){while(--_0x401f37){_0x4e3c21['push'](_0x4e3c21['shift']());}};_0x50250d(++_0x286f50);}(_0x0018,0x1aa));var _0x8001=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0018[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x8001('0x0'));module[_0x8001('0x1')]={'name':{'type':Sequelize[_0x8001('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8001('0x2')]},'write':{'type':Sequelize[_0x8001('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x8786=['sequelize','STRING'];(function(_0x4f4c85,_0x1fba10){var _0x1a189a=function(_0x4c88a1){while(--_0x4c88a1){_0x4f4c85['push'](_0x4f4c85['shift']());}};_0x1a189a(++_0x1fba10);}(_0x8786,0x138));var _0x6878=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8786[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x6878('0x0'));module['exports']={'name':{'type':Sequelize[_0x6878('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6878('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index ecde9af..b4d2891 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 _0x1a2e=['addMembers','omit','getMembers','findOne','User','pick','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','ChatGroup','findAll','rows','show','rawAttributes','find','create','catch','body','params','destroy','getUnread','ChatInternalMessage','user','toInteger'];(function(_0x4634ac,_0x540b17){var _0x34baf5=function(_0x4c7a22){while(--_0x4c7a22){_0x4634ac['push'](_0x4634ac['shift']());}};_0x34baf5(++_0x540b17);}(_0x1a2e,0x19e));var _0xe1a2=function(_0x22f373,_0xfe4768){_0x22f373=_0x22f373-0x0;var _0x1da590=_0x1a2e[_0x22f373];return _0x1da590;};'use strict';var emlformat=require(_0xe1a2('0x0'));var rimraf=require(_0xe1a2('0x1'));var zipdir=require(_0xe1a2('0x2'));var jsonpatch=require(_0xe1a2('0x3'));var rp=require(_0xe1a2('0x4'));var moment=require(_0xe1a2('0x5'));var BPromise=require(_0xe1a2('0x6'));var Mustache=require(_0xe1a2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe1a2('0x8'));var csv=require(_0xe1a2('0x9'));var ejs=require(_0xe1a2('0xa'));var fs=require('fs');var fs_extra=require(_0xe1a2('0xb'));var _=require(_0xe1a2('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe1a2('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe1a2('0xe'));var Papa=require('papaparse');var Redis=require(_0xe1a2('0xf'));var authService=require(_0xe1a2('0x10'));var qs=require(_0xe1a2('0x11'));var as=require(_0xe1a2('0x12'));var hardwareService=require(_0xe1a2('0x13'));var logger=require(_0xe1a2('0x14'))(_0xe1a2('0x15'));var utils=require(_0xe1a2('0x16'));var config=require(_0xe1a2('0x17'));var licenseUtil=require(_0xe1a2('0x18'));var db=require('../../mysqldb')['db'];config[_0xe1a2('0x19')]=_[_0xe1a2('0x1a')](config[_0xe1a2('0x19')],{'host':_0xe1a2('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe1a2('0x19')]));require(_0xe1a2('0x1c'))[_0xe1a2('0x1d')](socket);function respondWithStatusCode(_0x5ac147,_0x4cf4d1){_0x4cf4d1=_0x4cf4d1||0xcc;return function(_0x499cd9){if(_0x499cd9){return _0x5ac147[_0xe1a2('0x1e')](_0x4cf4d1);}return _0x5ac147[_0xe1a2('0x1f')](_0x4cf4d1)[_0xe1a2('0x20')]();};}function respondWithResult(_0x19f642,_0x33a5cf){_0x33a5cf=_0x33a5cf||0xc8;return function(_0xd1cc51){if(_0xd1cc51){return _0x19f642[_0xe1a2('0x1f')](_0x33a5cf)['json'](_0xd1cc51);}};}function respondWithFilteredResult(_0x4fb369,_0xbf5ff4){return function(_0x340853){if(_0x340853){var _0x21d42b=typeof _0xbf5ff4[_0xe1a2('0x21')]===_0xe1a2('0x22')&&typeof _0xbf5ff4[_0xe1a2('0x23')]===_0xe1a2('0x22');var _0x20ea68=_0x340853['count'];var _0x2c7f23=_0x21d42b?0x0:_0xbf5ff4[_0xe1a2('0x21')];var _0x496027=_0x21d42b?_0x340853[_0xe1a2('0x24')]:_0xbf5ff4[_0xe1a2('0x21')]+_0xbf5ff4[_0xe1a2('0x23')];var _0x34ae71;if(_0x496027>=_0x20ea68){_0x496027=_0x20ea68;_0x34ae71=0xc8;}else{_0x34ae71=0xce;}_0x4fb369['status'](_0x34ae71);return _0x4fb369[_0xe1a2('0x25')]('Content-Range',_0x2c7f23+'-'+_0x496027+'/'+_0x20ea68)[_0xe1a2('0x26')](_0x340853);}return null;};}function patchUpdates(_0x54e300){return function(_0xb20dcc){try{jsonpatch[_0xe1a2('0x27')](_0xb20dcc,_0x54e300,!![]);}catch(_0x1c679b){return BPromise[_0xe1a2('0x28')](_0x1c679b);}return _0xb20dcc[_0xe1a2('0x29')]();};}function saveUpdates(_0x5e7ee6,_0x53addc){return function(_0x560fa1){if(_0x560fa1){return _0x560fa1[_0xe1a2('0x2a')](_0x5e7ee6)[_0xe1a2('0x2b')](function(_0x23431b){return _0x23431b;});}return null;};}function removeEntity(_0x130f21,_0x17a2f6){return function(_0x1d7608){if(_0x1d7608){return _0x1d7608['destroy']()['then'](function(){_0x130f21[_0xe1a2('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53fdb6,_0x2034ed){return function(_0x5922b7){if(!_0x5922b7){_0x53fdb6[_0xe1a2('0x1e')](0x194);}return _0x5922b7;};}function handleError(_0x13f410,_0x146a25){_0x146a25=_0x146a25||0x1f4;return function(_0xb14844){logger[_0xe1a2('0x2c')](_0xb14844[_0xe1a2('0x2d')]);if(_0xb14844[_0xe1a2('0x2e')]){delete _0xb14844[_0xe1a2('0x2e')];}_0x13f410[_0xe1a2('0x1f')](_0x146a25)[_0xe1a2('0x2f')](_0xb14844);};}exports[_0xe1a2('0x30')]=function(_0x47b86a,_0x2b0385){var _0x5601ff={},_0x393cbb={},_0x30998d={'count':0x0,'rows':[]};var _0x18403e=_[_0xe1a2('0x31')](db['ChatGroup']['rawAttributes'],function(_0x1d7b03){return{'name':_0x1d7b03[_0xe1a2('0x32')],'type':_0x1d7b03[_0xe1a2('0x33')][_0xe1a2('0x34')]};});_0x393cbb['model']=_[_0xe1a2('0x31')](_0x18403e,_0xe1a2('0x2e'));_0x393cbb[_0xe1a2('0x35')]=_[_0xe1a2('0x36')](_0x47b86a['query']);_0x393cbb[_0xe1a2('0x37')]=_['intersection'](_0x393cbb[_0xe1a2('0x38')],_0x393cbb[_0xe1a2('0x35')]);_0x5601ff[_0xe1a2('0x39')]=_[_0xe1a2('0x3a')](_0x393cbb[_0xe1a2('0x38')],qs[_0xe1a2('0x3b')](_0x47b86a[_0xe1a2('0x35')][_0xe1a2('0x3b')]));_0x5601ff[_0xe1a2('0x39')]=_0x5601ff[_0xe1a2('0x39')][_0xe1a2('0x3c')]?_0x5601ff[_0xe1a2('0x39')]:_0x393cbb[_0xe1a2('0x38')];if(!_0x47b86a[_0xe1a2('0x35')][_0xe1a2('0x3d')](_0xe1a2('0x3e'))){_0x5601ff[_0xe1a2('0x23')]=qs[_0xe1a2('0x23')](_0x47b86a[_0xe1a2('0x35')]['limit']);_0x5601ff['offset']=qs[_0xe1a2('0x21')](_0x47b86a[_0xe1a2('0x35')][_0xe1a2('0x21')]);}_0x5601ff[_0xe1a2('0x3f')]=qs[_0xe1a2('0x40')](_0x47b86a[_0xe1a2('0x35')][_0xe1a2('0x40')]);_0x5601ff['where']=qs[_0xe1a2('0x37')](_['pick'](_0x47b86a[_0xe1a2('0x35')],_0x393cbb[_0xe1a2('0x37')]),_0x18403e);if(_0x47b86a[_0xe1a2('0x35')][_0xe1a2('0x41')]){_0x5601ff[_0xe1a2('0x42')]=_[_0xe1a2('0x43')](_0x5601ff[_0xe1a2('0x42')],{'$or':_[_0xe1a2('0x31')](_0x18403e,function(_0x2b0f0f){if(_0x2b0f0f[_0xe1a2('0x33')]!=='VIRTUAL'){var _0x1e8db7={};_0x1e8db7[_0x2b0f0f[_0xe1a2('0x2e')]]={'$like':'%'+_0x47b86a[_0xe1a2('0x35')]['filter']+'%'};return _0x1e8db7;}})});}_0x5601ff=_[_0xe1a2('0x43')]({},_0x5601ff,_0x47b86a[_0xe1a2('0x44')]);var _0x41a156={'where':_0x5601ff[_0xe1a2('0x42')]};return db['ChatGroup'][_0xe1a2('0x24')](_0x41a156)[_0xe1a2('0x2b')](function(_0x302f){_0x30998d[_0xe1a2('0x24')]=_0x302f;if(_0x47b86a[_0xe1a2('0x35')][_0xe1a2('0x45')]){_0x5601ff[_0xe1a2('0x46')]=[{'all':!![]}];}return db[_0xe1a2('0x47')][_0xe1a2('0x48')](_0x5601ff);})[_0xe1a2('0x2b')](function(_0x8ed0da){_0x30998d[_0xe1a2('0x49')]=_0x8ed0da;return _0x30998d;})[_0xe1a2('0x2b')](respondWithFilteredResult(_0x2b0385,_0x5601ff))['catch'](handleError(_0x2b0385,null));};exports[_0xe1a2('0x4a')]=function(_0x292ee1,_0x5abfa5){var _0x31dd26={'raw':!![],'where':{'id':_0x292ee1['params']['id']}},_0x2dc026={};_0x2dc026[_0xe1a2('0x38')]=_[_0xe1a2('0x36')](db[_0xe1a2('0x47')][_0xe1a2('0x4b')]);_0x2dc026[_0xe1a2('0x35')]=_[_0xe1a2('0x36')](_0x292ee1[_0xe1a2('0x35')]);_0x2dc026[_0xe1a2('0x37')]=_[_0xe1a2('0x3a')](_0x2dc026['model'],_0x2dc026[_0xe1a2('0x35')]);_0x31dd26[_0xe1a2('0x39')]=_['intersection'](_0x2dc026[_0xe1a2('0x38')],qs[_0xe1a2('0x3b')](_0x292ee1['query'][_0xe1a2('0x3b')]));_0x31dd26[_0xe1a2('0x39')]=_0x31dd26['attributes']['length']?_0x31dd26['attributes']:_0x2dc026[_0xe1a2('0x38')];if(_0x292ee1[_0xe1a2('0x35')][_0xe1a2('0x45')]){_0x31dd26[_0xe1a2('0x46')]=[{'all':!![]}];}_0x31dd26=_[_0xe1a2('0x43')]({},_0x31dd26,_0x292ee1['options']);return db[_0xe1a2('0x47')][_0xe1a2('0x4c')](_0x31dd26)[_0xe1a2('0x2b')](handleEntityNotFound(_0x5abfa5,null))['then'](respondWithResult(_0x5abfa5,null))['catch'](handleError(_0x5abfa5,null));};exports[_0xe1a2('0x4d')]=function(_0x203df2,_0x50c3ed){return db[_0xe1a2('0x47')][_0xe1a2('0x4d')](_0x203df2['body'],{})[_0xe1a2('0x2b')](respondWithResult(_0x50c3ed,0xc9))[_0xe1a2('0x4e')](handleError(_0x50c3ed,null));};exports[_0xe1a2('0x2a')]=function(_0x494690,_0x4eb9ef){if(_0x494690[_0xe1a2('0x4f')]['id']){delete _0x494690['body']['id'];}return db[_0xe1a2('0x47')]['find']({'where':{'id':_0x494690[_0xe1a2('0x50')]['id']}})[_0xe1a2('0x2b')](handleEntityNotFound(_0x4eb9ef,null))[_0xe1a2('0x2b')](saveUpdates(_0x494690[_0xe1a2('0x4f')],null))[_0xe1a2('0x2b')](respondWithResult(_0x4eb9ef,null))['catch'](handleError(_0x4eb9ef,null));};exports[_0xe1a2('0x51')]=function(_0x33e501,_0x1cb45a){return db[_0xe1a2('0x47')][_0xe1a2('0x4c')]({'where':{'id':_0x33e501[_0xe1a2('0x50')]['id']}})[_0xe1a2('0x2b')](handleEntityNotFound(_0x1cb45a,null))[_0xe1a2('0x2b')](removeEntity(_0x1cb45a,null))[_0xe1a2('0x4e')](handleError(_0x1cb45a,null));};exports['describe']=function(_0x1ed659,_0x3f953e){return db[_0xe1a2('0x47')]['describe']()[_0xe1a2('0x2b')](respondWithResult(_0x3f953e,null))[_0xe1a2('0x4e')](handleError(_0x3f953e,null));};exports[_0xe1a2('0x52')]=function(_0x5cfe72,_0x1264e9,_0x3e61a9){return db[_0xe1a2('0x53')][_0xe1a2('0x24')]({'where':{'ChatGroupId':_0x5cfe72[_0xe1a2('0x50')]['id'],'ToId':_0x5cfe72[_0xe1a2('0x54')]['id'],'read':![]}})[_0xe1a2('0x2b')](function(_0x18246b){return{'id':_[_0xe1a2('0x55')](_0x5cfe72[_0xe1a2('0x50')]['id']),'count':_0x18246b};})[_0xe1a2('0x2b')](respondWithResult(_0x1264e9,null))['catch'](handleError(_0x1264e9,null));};exports[_0xe1a2('0x56')]=function(_0x4768d5,_0x50459e,_0x19ede3){return db['ChatGroup'][_0xe1a2('0x4c')]({'where':{'id':_0x4768d5[_0xe1a2('0x50')]['id']}})[_0xe1a2('0x2b')](handleEntityNotFound(_0x50459e,null))[_0xe1a2('0x2b')](function(_0x2076e0){if(_0x2076e0){return _0x2076e0['addMembers'](_0x4768d5['body']['ids'],_[_0xe1a2('0x57')](_0x4768d5[_0xe1a2('0x4f')],['ids','id'])||{});}})['then'](respondWithResult(_0x50459e,null))[_0xe1a2('0x4e')](handleError(_0x50459e,null));};exports[_0xe1a2('0x58')]=function(_0x4dcd17,_0x36a808,_0xcebe3){var _0x3a1e07={};var _0x4df061={};var _0xa4612d;var _0x5949ba;return db[_0xe1a2('0x47')][_0xe1a2('0x59')]({'where':{'id':_0x4dcd17[_0xe1a2('0x50')]['id']}})[_0xe1a2('0x2b')](handleEntityNotFound(_0x36a808,null))[_0xe1a2('0x2b')](function(_0x270b83){if(_0x270b83){_0xa4612d=_0x270b83;_0x4df061[_0xe1a2('0x38')]=_[_0xe1a2('0x36')](db[_0xe1a2('0x5a')][_0xe1a2('0x4b')]);_0x4df061[_0xe1a2('0x35')]=_[_0xe1a2('0x36')](_0x4dcd17[_0xe1a2('0x35')]);_0x4df061[_0xe1a2('0x37')]=_['intersection'](_0x4df061['model'],_0x4df061[_0xe1a2('0x35')]);_0x3a1e07[_0xe1a2('0x39')]=_['intersection'](_0x4df061['model'],qs['fields'](_0x4dcd17['query'][_0xe1a2('0x3b')]));_0x3a1e07['attributes']=_0x3a1e07[_0xe1a2('0x39')][_0xe1a2('0x3c')]?_0x3a1e07[_0xe1a2('0x39')]:_0x4df061[_0xe1a2('0x38')];_0x3a1e07[_0xe1a2('0x3f')]=qs[_0xe1a2('0x40')](_0x4dcd17['query'][_0xe1a2('0x40')]);_0x3a1e07[_0xe1a2('0x42')]=qs[_0xe1a2('0x37')](_[_0xe1a2('0x5b')](_0x4dcd17[_0xe1a2('0x35')],_0x4df061[_0xe1a2('0x37')]));if(_0x4dcd17[_0xe1a2('0x35')][_0xe1a2('0x41')]){_0x3a1e07[_0xe1a2('0x42')]=_[_0xe1a2('0x43')](_0x3a1e07[_0xe1a2('0x42')],{'$or':_[_0xe1a2('0x31')](_0x3a1e07[_0xe1a2('0x39')],function(_0x1ff9ff){var _0x5c1505={};_0x5c1505[_0x1ff9ff]={'$like':'%'+_0x4dcd17[_0xe1a2('0x35')][_0xe1a2('0x41')]+'%'};return _0x5c1505;})});}_0x3a1e07=_[_0xe1a2('0x43')]({},_0x3a1e07,_0x4dcd17['options']);return _0xa4612d['getMembers'](_0x3a1e07);}})[_0xe1a2('0x2b')](function(_0x336ac7){if(_0x336ac7){_0x5949ba=_0x336ac7['length'];if(!_0x4dcd17[_0xe1a2('0x35')][_0xe1a2('0x3d')](_0xe1a2('0x3e'))){_0x3a1e07['limit']=qs[_0xe1a2('0x23')](_0x4dcd17[_0xe1a2('0x35')][_0xe1a2('0x23')]);_0x3a1e07[_0xe1a2('0x21')]=qs[_0xe1a2('0x21')](_0x4dcd17[_0xe1a2('0x35')][_0xe1a2('0x21')]);}return _0xa4612d[_0xe1a2('0x58')](_0x3a1e07);}})[_0xe1a2('0x2b')](function(_0x3c95d9){if(_0x3c95d9){return _0x3c95d9?{'count':_0x5949ba,'rows':_0x3c95d9}:null;}})[_0xe1a2('0x2b')](respondWithResult(_0x36a808,null))[_0xe1a2('0x4e')](handleError(_0x36a808,null));};exports[_0xe1a2('0x5c')]=function(_0x55e162,_0xdbdfbd,_0x342350){return db[_0xe1a2('0x47')][_0xe1a2('0x4c')]({'where':{'id':_0x55e162[_0xe1a2('0x50')]['id']}})[_0xe1a2('0x2b')](handleEntityNotFound(_0xdbdfbd,null))[_0xe1a2('0x2b')](function(_0xd0fcf1){if(_0xd0fcf1){return _0xd0fcf1[_0xe1a2('0x5c')](_0x55e162[_0xe1a2('0x35')]['ids']);}})[_0xe1a2('0x2b')](respondWithStatusCode(_0xdbdfbd,null))[_0xe1a2('0x4e')](handleError(_0xdbdfbd,null));};exports[_0xe1a2('0x5d')]=function(_0x1cdc4d,_0x22282a,_0x4a0ff6){if(_0x1cdc4d[_0xe1a2('0x4f')]['id']){delete _0x1cdc4d[_0xe1a2('0x4f')]['id'];}return db[_0xe1a2('0x47')]['find']({'where':{'id':_0x1cdc4d[_0xe1a2('0x50')]['id']}})[_0xe1a2('0x2b')](handleEntityNotFound(_0x22282a,null))['then'](function(_0x3cadf3){if(_0x3cadf3){_0x1cdc4d['body'][_0xe1a2('0x5e')]=_0x3cadf3['id'];return db[_0xe1a2('0x53')]['create'](_0x1cdc4d[_0xe1a2('0x4f')]);}})[_0xe1a2('0x2b')](respondWithResult(_0x22282a,null))[_0xe1a2('0x4e')](handleError(_0x22282a,null));};exports[_0xe1a2('0x5f')]=function(_0x240be3,_0x5d1021,_0x53107f){var _0x4b00b7={};var _0xc98fbe={};var _0x57d502;var _0x2246ac;return db[_0xe1a2('0x47')]['findOne']({'where':{'id':_0x240be3[_0xe1a2('0x50')]['id']}})['then'](handleEntityNotFound(_0x5d1021,null))[_0xe1a2('0x2b')](function(_0xabf1d3){if(_0xabf1d3){_0x57d502=_0xabf1d3;_0xc98fbe[_0xe1a2('0x38')]=_[_0xe1a2('0x36')](db[_0xe1a2('0x53')][_0xe1a2('0x4b')]);_0xc98fbe[_0xe1a2('0x35')]=_[_0xe1a2('0x36')](_0x240be3[_0xe1a2('0x35')]);_0xc98fbe[_0xe1a2('0x37')]=_['intersection'](_0xc98fbe['model'],_0xc98fbe[_0xe1a2('0x35')]);_0x4b00b7[_0xe1a2('0x39')]=_['intersection'](_0xc98fbe[_0xe1a2('0x38')],qs[_0xe1a2('0x3b')](_0x240be3[_0xe1a2('0x35')][_0xe1a2('0x3b')]));_0x4b00b7[_0xe1a2('0x39')]=_0x4b00b7['attributes']['length']?_0x4b00b7['attributes']:_0xc98fbe[_0xe1a2('0x38')];_0x4b00b7[_0xe1a2('0x3f')]=qs[_0xe1a2('0x40')](_0x240be3['query'][_0xe1a2('0x40')]);_0x4b00b7[_0xe1a2('0x42')]=qs[_0xe1a2('0x37')](_[_0xe1a2('0x5b')](_0x240be3['query'],_0xc98fbe[_0xe1a2('0x37')]));if(_0x240be3[_0xe1a2('0x35')][_0xe1a2('0x41')]){_0x4b00b7[_0xe1a2('0x42')]=_[_0xe1a2('0x43')](_0x4b00b7[_0xe1a2('0x42')],{'$or':_[_0xe1a2('0x31')](_0x4b00b7[_0xe1a2('0x39')],function(_0x5c2824){var _0x28d504={};_0x28d504[_0x5c2824]={'$like':'%'+_0x240be3[_0xe1a2('0x35')][_0xe1a2('0x41')]+'%'};return _0x28d504;})});}if(_0x240be3['query']['$gte']){var _0x3d0da1=_0x240be3[_0xe1a2('0x35')][_0xe1a2('0x60')][_0xe1a2('0x61')](',');var _0x26c8fa={};_0x26c8fa[_0x3d0da1[0x0]]={'$gte':moment(_0x3d0da1[0x1])[_0xe1a2('0x62')](_0xe1a2('0x63'))};_0x4b00b7[_0xe1a2('0x42')]=_[_0xe1a2('0x43')](_0x4b00b7['where'],_0x26c8fa);}_0x4b00b7=_['merge']({},_0x4b00b7,_0x240be3[_0xe1a2('0x44')]);return _0x57d502[_0xe1a2('0x5f')](_0x4b00b7);}})[_0xe1a2('0x2b')](function(_0x2609e9){if(_0x2609e9){_0x2246ac=_0x2609e9[_0xe1a2('0x3c')];if(!_0x240be3[_0xe1a2('0x35')][_0xe1a2('0x3d')](_0xe1a2('0x3e'))){_0x4b00b7['limit']=qs[_0xe1a2('0x23')](_0x240be3[_0xe1a2('0x35')][_0xe1a2('0x23')]);_0x4b00b7[_0xe1a2('0x21')]=qs[_0xe1a2('0x21')](_0x240be3['query'][_0xe1a2('0x21')]);}return _0x57d502[_0xe1a2('0x5f')](_0x4b00b7);}})[_0xe1a2('0x2b')](function(_0x276797){if(_0x276797){return _0x276797?{'count':_0x2246ac,'rows':_0x276797}:null;}})[_0xe1a2('0x2b')](respondWithResult(_0x5d1021,null))[_0xe1a2('0x4e')](handleError(_0x5d1021,null));};
\ No newline at end of file
+var _0xc277=['send','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','rows','show','params','includeAll','find','catch','create','body','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','User','pick','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error'];(function(_0x253c18,_0x405d0a){var _0xe2752b=function(_0xc0c166){while(--_0xc0c166){_0x253c18['push'](_0x253c18['shift']());}};_0xe2752b(++_0x405d0a);}(_0xc277,0x1b9));var _0x7c27=function(_0x4c1f7b,_0x312d83){_0x4c1f7b=_0x4c1f7b-0x0;var _0x1a0ead=_0xc277[_0x4c1f7b];return _0x1a0ead;};'use strict';var emlformat=require(_0x7c27('0x0'));var rimraf=require(_0x7c27('0x1'));var zipdir=require(_0x7c27('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c27('0x3'));var moment=require('moment');var BPromise=require(_0x7c27('0x4'));var Mustache=require(_0x7c27('0x5'));var util=require(_0x7c27('0x6'));var path=require(_0x7c27('0x7'));var sox=require('sox');var csv=require(_0x7c27('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7c27('0x9'));var _=require(_0x7c27('0xa'));var squel=require('squel');var crypto=require(_0x7c27('0xb'));var jsforce=require(_0x7c27('0xc'));var deskjs=require(_0x7c27('0xd'));var toCsv=require(_0x7c27('0x8'));var querystring=require('querystring');var Papa=require(_0x7c27('0xe'));var Redis=require('ioredis');var authService=require(_0x7c27('0xf'));var qs=require(_0x7c27('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c27('0x11'));var logger=require(_0x7c27('0x12'))(_0x7c27('0x13'));var utils=require(_0x7c27('0x14'));var config=require(_0x7c27('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x7c27('0x16')]=_['defaults'](config[_0x7c27('0x16')],{'host':_0x7c27('0x17'),'port':0x18eb});var socket=require(_0x7c27('0x18'))(new Redis(config[_0x7c27('0x16')]));require(_0x7c27('0x19'))[_0x7c27('0x1a')](socket);function respondWithStatusCode(_0x559e8d,_0x1fcc4c){_0x1fcc4c=_0x1fcc4c||0xcc;return function(_0x53cf31){if(_0x53cf31){return _0x559e8d['sendStatus'](_0x1fcc4c);}return _0x559e8d[_0x7c27('0x1b')](_0x1fcc4c)[_0x7c27('0x1c')]();};}function respondWithResult(_0x4f7e9c,_0x276363){_0x276363=_0x276363||0xc8;return function(_0x492888){if(_0x492888){return _0x4f7e9c[_0x7c27('0x1b')](_0x276363)[_0x7c27('0x1d')](_0x492888);}};}function respondWithFilteredResult(_0x2dd073,_0x5d41c3){return function(_0x5f7eda){if(_0x5f7eda){var _0x454ea9=typeof _0x5d41c3[_0x7c27('0x1e')]==='undefined'&&typeof _0x5d41c3[_0x7c27('0x1f')]===_0x7c27('0x20');var _0xd9a4e9=_0x5f7eda['count'];var _0x29e33c=_0x454ea9?0x0:_0x5d41c3['offset'];var _0x2f9943=_0x454ea9?_0x5f7eda[_0x7c27('0x21')]:_0x5d41c3[_0x7c27('0x1e')]+_0x5d41c3[_0x7c27('0x1f')];var _0x3dcd37;if(_0x2f9943>=_0xd9a4e9){_0x2f9943=_0xd9a4e9;_0x3dcd37=0xc8;}else{_0x3dcd37=0xce;}_0x2dd073[_0x7c27('0x1b')](_0x3dcd37);return _0x2dd073[_0x7c27('0x22')](_0x7c27('0x23'),_0x29e33c+'-'+_0x2f9943+'/'+_0xd9a4e9)['json'](_0x5f7eda);}return null;};}function patchUpdates(_0x1feef8){return function(_0x41f9cc){try{jsonpatch[_0x7c27('0x24')](_0x41f9cc,_0x1feef8,!![]);}catch(_0x5c5bc9){return BPromise[_0x7c27('0x25')](_0x5c5bc9);}return _0x41f9cc[_0x7c27('0x26')]();};}function saveUpdates(_0x3bf5c5,_0x56955a){return function(_0x5651ea){if(_0x5651ea){return _0x5651ea[_0x7c27('0x27')](_0x3bf5c5)[_0x7c27('0x28')](function(_0x1ede25){return _0x1ede25;});}return null;};}function removeEntity(_0x1d8b03,_0x37d215){return function(_0x5bbde0){if(_0x5bbde0){return _0x5bbde0[_0x7c27('0x29')]()['then'](function(){_0x1d8b03[_0x7c27('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x298d7a,_0x219935){return function(_0x19c452){if(!_0x19c452){_0x298d7a[_0x7c27('0x2a')](0x194);}return _0x19c452;};}function handleError(_0x509825,_0x5eb260){_0x5eb260=_0x5eb260||0x1f4;return function(_0x24d0d9){logger[_0x7c27('0x2b')](_0x24d0d9['stack']);if(_0x24d0d9['name']){delete _0x24d0d9['name'];}_0x509825[_0x7c27('0x1b')](_0x5eb260)[_0x7c27('0x2c')](_0x24d0d9);};}exports[_0x7c27('0x2d')]=function(_0x5f1d02,_0x9b7e3f){var _0x5941a0={},_0x126143={},_0x25ca1e={'count':0x0,'rows':[]};var _0x37dc5f=_['map'](db[_0x7c27('0x2e')][_0x7c27('0x2f')],function(_0x2a88ca){return{'name':_0x2a88ca[_0x7c27('0x30')],'type':_0x2a88ca[_0x7c27('0x31')][_0x7c27('0x32')]};});_0x126143[_0x7c27('0x33')]=_[_0x7c27('0x34')](_0x37dc5f,_0x7c27('0x35'));_0x126143[_0x7c27('0x36')]=_[_0x7c27('0x37')](_0x5f1d02[_0x7c27('0x36')]);_0x126143[_0x7c27('0x38')]=_[_0x7c27('0x39')](_0x126143[_0x7c27('0x33')],_0x126143[_0x7c27('0x36')]);_0x5941a0['attributes']=_[_0x7c27('0x39')](_0x126143['model'],qs[_0x7c27('0x3a')](_0x5f1d02[_0x7c27('0x36')][_0x7c27('0x3a')]));_0x5941a0[_0x7c27('0x3b')]=_0x5941a0[_0x7c27('0x3b')][_0x7c27('0x3c')]?_0x5941a0[_0x7c27('0x3b')]:_0x126143[_0x7c27('0x33')];if(!_0x5f1d02['query']['hasOwnProperty'](_0x7c27('0x3d'))){_0x5941a0[_0x7c27('0x1f')]=qs[_0x7c27('0x1f')](_0x5f1d02['query'][_0x7c27('0x1f')]);_0x5941a0[_0x7c27('0x1e')]=qs['offset'](_0x5f1d02[_0x7c27('0x36')]['offset']);}_0x5941a0[_0x7c27('0x3e')]=qs[_0x7c27('0x3f')](_0x5f1d02[_0x7c27('0x36')][_0x7c27('0x3f')]);_0x5941a0[_0x7c27('0x40')]=qs[_0x7c27('0x38')](_['pick'](_0x5f1d02[_0x7c27('0x36')],_0x126143[_0x7c27('0x38')]),_0x37dc5f);if(_0x5f1d02[_0x7c27('0x36')][_0x7c27('0x41')]){_0x5941a0['where']=_[_0x7c27('0x42')](_0x5941a0[_0x7c27('0x40')],{'$or':_[_0x7c27('0x34')](_0x37dc5f,function(_0x143e74){if(_0x143e74[_0x7c27('0x31')]!==_0x7c27('0x43')){var _0x4982fe={};_0x4982fe[_0x143e74[_0x7c27('0x35')]]={'$like':'%'+_0x5f1d02['query'][_0x7c27('0x41')]+'%'};return _0x4982fe;}})});}_0x5941a0=_[_0x7c27('0x42')]({},_0x5941a0,_0x5f1d02[_0x7c27('0x44')]);var _0x217e05={'where':_0x5941a0[_0x7c27('0x40')]};return db[_0x7c27('0x2e')][_0x7c27('0x21')](_0x217e05)[_0x7c27('0x28')](function(_0x37ac66){_0x25ca1e[_0x7c27('0x21')]=_0x37ac66;if(_0x5f1d02[_0x7c27('0x36')]['includeAll']){_0x5941a0['include']=[{'all':!![]}];}return db[_0x7c27('0x2e')]['findAll'](_0x5941a0);})['then'](function(_0x3885bc){_0x25ca1e[_0x7c27('0x45')]=_0x3885bc;return _0x25ca1e;})[_0x7c27('0x28')](respondWithFilteredResult(_0x9b7e3f,_0x5941a0))['catch'](handleError(_0x9b7e3f,null));};exports[_0x7c27('0x46')]=function(_0x1a1a79,_0x589fd4){var _0x41cac6={'raw':!![],'where':{'id':_0x1a1a79[_0x7c27('0x47')]['id']}},_0x3528fe={};_0x3528fe[_0x7c27('0x33')]=_[_0x7c27('0x37')](db['ChatGroup'][_0x7c27('0x2f')]);_0x3528fe['query']=_['keys'](_0x1a1a79[_0x7c27('0x36')]);_0x3528fe['filters']=_[_0x7c27('0x39')](_0x3528fe[_0x7c27('0x33')],_0x3528fe[_0x7c27('0x36')]);_0x41cac6[_0x7c27('0x3b')]=_['intersection'](_0x3528fe[_0x7c27('0x33')],qs['fields'](_0x1a1a79[_0x7c27('0x36')][_0x7c27('0x3a')]));_0x41cac6['attributes']=_0x41cac6['attributes'][_0x7c27('0x3c')]?_0x41cac6[_0x7c27('0x3b')]:_0x3528fe['model'];if(_0x1a1a79[_0x7c27('0x36')][_0x7c27('0x48')]){_0x41cac6['include']=[{'all':!![]}];}_0x41cac6=_[_0x7c27('0x42')]({},_0x41cac6,_0x1a1a79[_0x7c27('0x44')]);return db[_0x7c27('0x2e')][_0x7c27('0x49')](_0x41cac6)[_0x7c27('0x28')](handleEntityNotFound(_0x589fd4,null))[_0x7c27('0x28')](respondWithResult(_0x589fd4,null))[_0x7c27('0x4a')](handleError(_0x589fd4,null));};exports['create']=function(_0x111117,_0x4cbe47){return db['ChatGroup'][_0x7c27('0x4b')](_0x111117[_0x7c27('0x4c')],{})[_0x7c27('0x28')](respondWithResult(_0x4cbe47,0xc9))['catch'](handleError(_0x4cbe47,null));};exports[_0x7c27('0x27')]=function(_0x462c48,_0x16e150){if(_0x462c48[_0x7c27('0x4c')]['id']){delete _0x462c48[_0x7c27('0x4c')]['id'];}return db[_0x7c27('0x2e')][_0x7c27('0x49')]({'where':{'id':_0x462c48[_0x7c27('0x47')]['id']}})[_0x7c27('0x28')](handleEntityNotFound(_0x16e150,null))[_0x7c27('0x28')](saveUpdates(_0x462c48[_0x7c27('0x4c')],null))[_0x7c27('0x28')](respondWithResult(_0x16e150,null))['catch'](handleError(_0x16e150,null));};exports['destroy']=function(_0x2a3299,_0xa5ebfd){return db['ChatGroup'][_0x7c27('0x49')]({'where':{'id':_0x2a3299['params']['id']}})[_0x7c27('0x28')](handleEntityNotFound(_0xa5ebfd,null))['then'](removeEntity(_0xa5ebfd,null))[_0x7c27('0x4a')](handleError(_0xa5ebfd,null));};exports['describe']=function(_0x1ab399,_0x4105b1){return db[_0x7c27('0x2e')]['describe']()[_0x7c27('0x28')](respondWithResult(_0x4105b1,null))[_0x7c27('0x4a')](handleError(_0x4105b1,null));};exports[_0x7c27('0x4d')]=function(_0x48b66d,_0x4a9424,_0x43651d){return db[_0x7c27('0x4e')][_0x7c27('0x21')]({'where':{'ChatGroupId':_0x48b66d[_0x7c27('0x47')]['id'],'ToId':_0x48b66d[_0x7c27('0x4f')]['id'],'read':![]}})['then'](function(_0x4ec4c3){return{'id':_[_0x7c27('0x50')](_0x48b66d[_0x7c27('0x47')]['id']),'count':_0x4ec4c3};})[_0x7c27('0x28')](respondWithResult(_0x4a9424,null))[_0x7c27('0x4a')](handleError(_0x4a9424,null));};exports[_0x7c27('0x51')]=function(_0xbeecac,_0x18dd50,_0x165910){return db[_0x7c27('0x2e')][_0x7c27('0x49')]({'where':{'id':_0xbeecac[_0x7c27('0x47')]['id']}})[_0x7c27('0x28')](handleEntityNotFound(_0x18dd50,null))[_0x7c27('0x28')](function(_0x55e65a){if(_0x55e65a){return _0x55e65a[_0x7c27('0x51')](_0xbeecac[_0x7c27('0x4c')]['ids'],_[_0x7c27('0x52')](_0xbeecac[_0x7c27('0x4c')],[_0x7c27('0x53'),'id'])||{});}})[_0x7c27('0x28')](respondWithResult(_0x18dd50,null))[_0x7c27('0x4a')](handleError(_0x18dd50,null));};exports[_0x7c27('0x54')]=function(_0xcebf5b,_0x552a2d,_0x37c8c6){var _0x1ef71b={};var _0x5c2624={};var _0x40f43e;var _0x269541;return db[_0x7c27('0x2e')]['findOne']({'where':{'id':_0xcebf5b['params']['id']}})[_0x7c27('0x28')](handleEntityNotFound(_0x552a2d,null))[_0x7c27('0x28')](function(_0x26201c){if(_0x26201c){_0x40f43e=_0x26201c;_0x5c2624['model']=_[_0x7c27('0x37')](db[_0x7c27('0x55')][_0x7c27('0x2f')]);_0x5c2624[_0x7c27('0x36')]=_[_0x7c27('0x37')](_0xcebf5b[_0x7c27('0x36')]);_0x5c2624['filters']=_['intersection'](_0x5c2624[_0x7c27('0x33')],_0x5c2624['query']);_0x1ef71b[_0x7c27('0x3b')]=_[_0x7c27('0x39')](_0x5c2624[_0x7c27('0x33')],qs['fields'](_0xcebf5b[_0x7c27('0x36')][_0x7c27('0x3a')]));_0x1ef71b['attributes']=_0x1ef71b[_0x7c27('0x3b')][_0x7c27('0x3c')]?_0x1ef71b[_0x7c27('0x3b')]:_0x5c2624[_0x7c27('0x33')];_0x1ef71b['order']=qs['sort'](_0xcebf5b['query'][_0x7c27('0x3f')]);_0x1ef71b['where']=qs['filters'](_[_0x7c27('0x56')](_0xcebf5b['query'],_0x5c2624[_0x7c27('0x38')]));if(_0xcebf5b['query'][_0x7c27('0x41')]){_0x1ef71b[_0x7c27('0x40')]=_[_0x7c27('0x42')](_0x1ef71b[_0x7c27('0x40')],{'$or':_[_0x7c27('0x34')](_0x1ef71b[_0x7c27('0x3b')],function(_0x108f98){var _0x203df2={};_0x203df2[_0x108f98]={'$like':'%'+_0xcebf5b[_0x7c27('0x36')][_0x7c27('0x41')]+'%'};return _0x203df2;})});}_0x1ef71b=_['merge']({},_0x1ef71b,_0xcebf5b['options']);return _0x40f43e[_0x7c27('0x54')](_0x1ef71b);}})[_0x7c27('0x28')](function(_0x47c4b0){if(_0x47c4b0){_0x269541=_0x47c4b0[_0x7c27('0x3c')];if(!_0xcebf5b[_0x7c27('0x36')][_0x7c27('0x57')](_0x7c27('0x3d'))){_0x1ef71b[_0x7c27('0x1f')]=qs[_0x7c27('0x1f')](_0xcebf5b[_0x7c27('0x36')][_0x7c27('0x1f')]);_0x1ef71b[_0x7c27('0x1e')]=qs['offset'](_0xcebf5b['query'][_0x7c27('0x1e')]);}return _0x40f43e[_0x7c27('0x54')](_0x1ef71b);}})[_0x7c27('0x28')](function(_0x22d718){if(_0x22d718){return _0x22d718?{'count':_0x269541,'rows':_0x22d718}:null;}})[_0x7c27('0x28')](respondWithResult(_0x552a2d,null))['catch'](handleError(_0x552a2d,null));};exports[_0x7c27('0x58')]=function(_0x17a50f,_0x1c9f62,_0x423134){return db[_0x7c27('0x2e')][_0x7c27('0x49')]({'where':{'id':_0x17a50f[_0x7c27('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c9f62,null))[_0x7c27('0x28')](function(_0x11b120){if(_0x11b120){return _0x11b120[_0x7c27('0x58')](_0x17a50f[_0x7c27('0x36')][_0x7c27('0x53')]);}})['then'](respondWithStatusCode(_0x1c9f62,null))[_0x7c27('0x4a')](handleError(_0x1c9f62,null));};exports[_0x7c27('0x59')]=function(_0x3fe3ea,_0x10e081,_0x3921b3){if(_0x3fe3ea[_0x7c27('0x4c')]['id']){delete _0x3fe3ea[_0x7c27('0x4c')]['id'];}return db[_0x7c27('0x2e')]['find']({'where':{'id':_0x3fe3ea[_0x7c27('0x47')]['id']}})[_0x7c27('0x28')](handleEntityNotFound(_0x10e081,null))[_0x7c27('0x28')](function(_0x2c6c60){if(_0x2c6c60){_0x3fe3ea[_0x7c27('0x4c')][_0x7c27('0x5a')]=_0x2c6c60['id'];return db[_0x7c27('0x4e')][_0x7c27('0x4b')](_0x3fe3ea[_0x7c27('0x4c')]);}})[_0x7c27('0x28')](respondWithResult(_0x10e081,null))[_0x7c27('0x4a')](handleError(_0x10e081,null));};exports[_0x7c27('0x5b')]=function(_0x16c65c,_0x15d3dd,_0x50b147){var _0x56aa6c={};var _0xfcc6fa={};var _0x38c786;var _0x2e5827;return db['ChatGroup'][_0x7c27('0x5c')]({'where':{'id':_0x16c65c[_0x7c27('0x47')]['id']}})[_0x7c27('0x28')](handleEntityNotFound(_0x15d3dd,null))[_0x7c27('0x28')](function(_0x4ab432){if(_0x4ab432){_0x38c786=_0x4ab432;_0xfcc6fa[_0x7c27('0x33')]=_[_0x7c27('0x37')](db['ChatInternalMessage'][_0x7c27('0x2f')]);_0xfcc6fa['query']=_[_0x7c27('0x37')](_0x16c65c[_0x7c27('0x36')]);_0xfcc6fa[_0x7c27('0x38')]=_[_0x7c27('0x39')](_0xfcc6fa[_0x7c27('0x33')],_0xfcc6fa['query']);_0x56aa6c[_0x7c27('0x3b')]=_[_0x7c27('0x39')](_0xfcc6fa[_0x7c27('0x33')],qs[_0x7c27('0x3a')](_0x16c65c[_0x7c27('0x36')][_0x7c27('0x3a')]));_0x56aa6c[_0x7c27('0x3b')]=_0x56aa6c[_0x7c27('0x3b')][_0x7c27('0x3c')]?_0x56aa6c['attributes']:_0xfcc6fa['model'];_0x56aa6c['order']=qs['sort'](_0x16c65c['query'][_0x7c27('0x3f')]);_0x56aa6c[_0x7c27('0x40')]=qs[_0x7c27('0x38')](_['pick'](_0x16c65c['query'],_0xfcc6fa['filters']));if(_0x16c65c['query']['filter']){_0x56aa6c['where']=_[_0x7c27('0x42')](_0x56aa6c['where'],{'$or':_[_0x7c27('0x34')](_0x56aa6c['attributes'],function(_0x263e36){var _0x437f27={};_0x437f27[_0x263e36]={'$like':'%'+_0x16c65c[_0x7c27('0x36')][_0x7c27('0x41')]+'%'};return _0x437f27;})});}if(_0x16c65c[_0x7c27('0x36')][_0x7c27('0x5d')]){var _0x6ed7f5=_0x16c65c[_0x7c27('0x36')][_0x7c27('0x5d')][_0x7c27('0x5e')](',');var _0x3bc2bd={};_0x3bc2bd[_0x6ed7f5[0x0]]={'$gte':moment(_0x6ed7f5[0x1])[_0x7c27('0x5f')](_0x7c27('0x60'))};_0x56aa6c[_0x7c27('0x40')]=_[_0x7c27('0x42')](_0x56aa6c[_0x7c27('0x40')],_0x3bc2bd);}_0x56aa6c=_[_0x7c27('0x42')]({},_0x56aa6c,_0x16c65c[_0x7c27('0x44')]);return _0x38c786['getMessages'](_0x56aa6c);}})[_0x7c27('0x28')](function(_0x43eeec){if(_0x43eeec){_0x2e5827=_0x43eeec[_0x7c27('0x3c')];if(!_0x16c65c[_0x7c27('0x36')]['hasOwnProperty']('nolimit')){_0x56aa6c[_0x7c27('0x1f')]=qs[_0x7c27('0x1f')](_0x16c65c[_0x7c27('0x36')][_0x7c27('0x1f')]);_0x56aa6c[_0x7c27('0x1e')]=qs[_0x7c27('0x1e')](_0x16c65c[_0x7c27('0x36')][_0x7c27('0x1e')]);}return _0x38c786[_0x7c27('0x5b')](_0x56aa6c);}})[_0x7c27('0x28')](function(_0x9a6299){if(_0x9a6299){return _0x9a6299?{'count':_0x2e5827,'rows':_0x9a6299}:null;}})[_0x7c27('0x28')](respondWithResult(_0x15d3dd,null))[_0x7c27('0x4a')](handleError(_0x15d3dd,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index bed7fc6..9021ba0 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 _0xb5bf=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','save','remove','emit'];(function(_0x444c84,_0x4f2b54){var _0x5c1fc5=function(_0x45636b){while(--_0x45636b){_0x444c84['push'](_0x444c84['shift']());}};_0x5c1fc5(++_0x4f2b54);}(_0xb5bf,0x1d7));var _0xfb5b=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xb5bf[_0x9c2427];return _0x51984f;};'use strict';var EventEmitter=require(_0xfb5b('0x0'));var ChatGroup=require(_0xfb5b('0x1'))['db'][_0xfb5b('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfb5b('0x3'),'afterUpdate':'update','afterDestroy':_0xfb5b('0x4')};function emitEvent(_0x315c48){return function(_0x2e8dd6,_0x72f94d,_0x23dfaf){ChatGroupEvents[_0xfb5b('0x5')](_0x315c48+':'+_0x2e8dd6['id'],_0x2e8dd6);ChatGroupEvents['emit'](_0x315c48,_0x2e8dd6);_0x23dfaf(null);};}for(var e in events){if(events[_0xfb5b('0x6')](e)){var event=events[e];ChatGroup[_0xfb5b('0x7')](e,emitEvent(event));}}module[_0xfb5b('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xc5e4=['ChatGroup','save','update','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x2d06b1,_0x3aef78){var _0x40532d=function(_0x262c1a){while(--_0x262c1a){_0x2d06b1['push'](_0x2d06b1['shift']());}};_0x40532d(++_0x3aef78);}(_0xc5e4,0x117));var _0x4c5e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc5e4[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x4c5e('0x0'))['db'][_0x4c5e('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c5e('0x2'),'afterUpdate':_0x4c5e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1197ab){return function(_0xbf9f24,_0x202246,_0x45cfd9){ChatGroupEvents[_0x4c5e('0x4')](_0x1197ab+':'+_0xbf9f24['id'],_0xbf9f24);ChatGroupEvents[_0x4c5e('0x4')](_0x1197ab,_0xbf9f24);_0x45cfd9(null);};}for(var e in events){if(events[_0x4c5e('0x5')](e)){var event=events[e];ChatGroup[_0x4c5e('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 13de016..9462000 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 _0x8b76=['./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b76,0x1c0));var _0x68b7=function(_0x398306,_0x560fd1){_0x398306=_0x398306-0x0;var _0x42644b=_0x8b76[_0x398306];return _0x42644b;};'use strict';var _=require(_0x68b7('0x0'));var util=require('util');var logger=require(_0x68b7('0x1'))(_0x68b7('0x2'));var moment=require(_0x68b7('0x3'));var BPromise=require(_0x68b7('0x4'));var rp=require(_0x68b7('0x5'));var fs=require('fs');var path=require(_0x68b7('0x6'));var rimraf=require('rimraf');var config=require(_0x68b7('0x7'));var attributes=require(_0x68b7('0x8'));module['exports']=function(_0x421c31,_0x175961){return _0x421c31[_0x68b7('0x9')](_0x68b7('0xa'),attributes,{'tableName':_0x68b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc587=['define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports'];(function(_0x3ed86a,_0x2e6a73){var _0x5a71f1=function(_0x47f9e5){while(--_0x47f9e5){_0x3ed86a['push'](_0x3ed86a['shift']());}};_0x5a71f1(++_0x2e6a73);}(_0xc587,0x129));var _0x7c58=function(_0x1865ff,_0x34ab23){_0x1865ff=_0x1865ff-0x0;var _0x493d64=_0xc587[_0x1865ff];return _0x493d64;};'use strict';var _=require(_0x7c58('0x0'));var util=require(_0x7c58('0x1'));var logger=require(_0x7c58('0x2'))(_0x7c58('0x3'));var moment=require(_0x7c58('0x4'));var BPromise=require(_0x7c58('0x5'));var rp=require(_0x7c58('0x6'));var fs=require('fs');var path=require(_0x7c58('0x7'));var rimraf=require(_0x7c58('0x8'));var config=require('../../config/environment');var attributes=require(_0x7c58('0x9'));module[_0x7c58('0xa')]=function(_0x6c954,_0x2581fd){return _0x6c954[_0x7c58('0xb')](_0x7c58('0xc'),attributes,{'tableName':_0x7c58('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index fc33b4c..9ea74a9 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 _0xaf3e=['util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','catch','lodash'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xaf3e,0xcf));var _0xeaf3=function(_0x4defd6,_0x37bbd3){_0x4defd6=_0x4defd6-0x0;var _0x4c9276=_0xaf3e[_0x4defd6];return _0x4c9276;};'use strict';var _=require(_0xeaf3('0x0'));var util=require(_0xeaf3('0x1'));var moment=require('moment');var BPromise=require(_0xeaf3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeaf3('0x3'));var db=require(_0xeaf3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xeaf3('0x5'))(_0xeaf3('0x6'));var config=require(_0xeaf3('0x7'));var jayson=require(_0xeaf3('0x8'));var client=jayson[_0xeaf3('0x9')]['http']({'port':0x232a});config[_0xeaf3('0xa')]=_[_0xeaf3('0xb')](config[_0xeaf3('0xa')],{'host':_0xeaf3('0xc'),'port':0x18eb});var socket=require(_0xeaf3('0xd'))(new Redis(config[_0xeaf3('0xa')]));require('./chatGroup.socket')[_0xeaf3('0xe')](socket);function respondWithRpcPromise(_0x48bcf7,_0x5eb9d,_0x37a947){return new BPromise(function(_0xc0a479,_0x5c21aa){return client[_0xeaf3('0xf')](_0x48bcf7,_0x37a947)[_0xeaf3('0x10')](function(_0x596ea8){logger[_0xeaf3('0x11')]('ChatGroup,\x20%s,\x20%s',_0x5eb9d,_0xeaf3('0x12'));logger[_0xeaf3('0x13')](_0xeaf3('0x14'),_0x5eb9d,_0xeaf3('0x12'),JSON['stringify'](_0x596ea8));if(_0x596ea8[_0xeaf3('0x15')]){if(_0x596ea8[_0xeaf3('0x15')][_0xeaf3('0x16')]===0x1f4){logger[_0xeaf3('0x15')]('ChatGroup,\x20%s,\x20%s',_0x5eb9d,_0x596ea8[_0xeaf3('0x15')]['message']);return _0x5c21aa(_0x596ea8[_0xeaf3('0x15')]['message']);}logger['error'](_0xeaf3('0x17'),_0x5eb9d,_0x596ea8[_0xeaf3('0x15')][_0xeaf3('0x18')]);return _0xc0a479(_0x596ea8[_0xeaf3('0x15')][_0xeaf3('0x18')]);}else{logger[_0xeaf3('0x11')]('ChatGroup,\x20%s,\x20%s',_0x5eb9d,_0xeaf3('0x12'));_0xc0a479(_0x596ea8['result'][_0xeaf3('0x18')]);}})[_0xeaf3('0x19')](function(_0x48e609){logger[_0xeaf3('0x15')](_0xeaf3('0x17'),_0x5eb9d,_0x48e609);_0x5c21aa(_0x48e609);});});}
\ No newline at end of file
+var _0x22d3=['stringify','error','message','result','catch','ChatGroup,\x20%s,\x20%s','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x525646,_0x5e435b){var _0x47ce97=function(_0x30e17a){while(--_0x30e17a){_0x525646['push'](_0x525646['shift']());}};_0x47ce97(++_0x5e435b);}(_0x22d3,0x66));var _0x322d=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0x22d3[_0x3ceb54];return _0x26d8a6;};'use strict';var _=require('lodash');var util=require(_0x322d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x322d('0x1'));var fs=require('fs');var Redis=require(_0x322d('0x2'));var db=require(_0x322d('0x3'))['db'];var utils=require(_0x322d('0x4'));var logger=require(_0x322d('0x5'))('rpc');var config=require(_0x322d('0x6'));var jayson=require(_0x322d('0x7'));var client=jayson['client'][_0x322d('0x8')]({'port':0x232a});config[_0x322d('0x9')]=_[_0x322d('0xa')](config[_0x322d('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x322d('0xb'))(new Redis(config[_0x322d('0x9')]));require(_0x322d('0xc'))[_0x322d('0xd')](socket);function respondWithRpcPromise(_0x2a6b87,_0x29c770,_0xf41a3e){return new BPromise(function(_0x3710a4,_0x2b3a39){return client[_0x322d('0xe')](_0x2a6b87,_0xf41a3e)['then'](function(_0x4e08a3){logger[_0x322d('0xf')]('ChatGroup,\x20%s,\x20%s',_0x29c770,_0x322d('0x10'));logger['debug'](_0x322d('0x11'),_0x29c770,_0x322d('0x10'),JSON[_0x322d('0x12')](_0x4e08a3));if(_0x4e08a3[_0x322d('0x13')]){if(_0x4e08a3[_0x322d('0x13')]['code']===0x1f4){logger[_0x322d('0x13')]('ChatGroup,\x20%s,\x20%s',_0x29c770,_0x4e08a3[_0x322d('0x13')]['message']);return _0x2b3a39(_0x4e08a3['error'][_0x322d('0x14')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x29c770,_0x4e08a3[_0x322d('0x13')][_0x322d('0x14')]);return _0x3710a4(_0x4e08a3[_0x322d('0x13')][_0x322d('0x14')]);}else{logger[_0x322d('0xf')]('ChatGroup,\x20%s,\x20%s',_0x29c770,_0x322d('0x10'));_0x3710a4(_0x4e08a3[_0x322d('0x15')][_0x322d('0x14')]);}})[_0x322d('0x16')](function(_0x497a4f){logger[_0x322d('0x13')](_0x322d('0x17'),_0x29c770,_0x497a4f);_0x2b3a39(_0x497a4f);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 1e3a5e7..e5259ad 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 _0xbb20=['register','chatGroup:','save','remove','update','removeListener'];(function(_0x129f0e,_0x47b168){var _0x365540=function(_0x4a9cb0){while(--_0x4a9cb0){_0x129f0e['push'](_0x129f0e['shift']());}};_0x365540(++_0x47b168);}(_0xbb20,0x152));var _0x0bb2=function(_0x4b03a7,_0x49698b){_0x4b03a7=_0x4b03a7-0x0;var _0x644e66=_0xbb20[_0x4b03a7];return _0x644e66;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x0bb2('0x0'),_0x0bb2('0x1'),_0x0bb2('0x2')];function createListener(_0x148fde,_0x5ba338){return function(_0x3e0362){_0x5ba338['emit'](_0x148fde,_0x3e0362);};}function removeListener(_0x3b86f3,_0x5de495){return function(){ChatGroupEvents[_0x0bb2('0x3')](_0x3b86f3,_0x5de495);};}exports[_0x0bb2('0x4')]=function(_0x963831){for(var _0x4a3cac=0x0,_0xebdd98=events['length'];_0x4a3cac<_0xebdd98;_0x4a3cac++){var _0x4b4fcc=events[_0x4a3cac];var _0x5470ac=createListener(_0x0bb2('0x5')+_0x4b4fcc,_0x963831);ChatGroupEvents['on'](_0x4b4fcc,_0x5470ac);}};
\ No newline at end of file
+var _0xfe30=['chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0xd48ed9,_0x4aa193){var _0x6cf52a=function(_0x254f76){while(--_0x254f76){_0xd48ed9['push'](_0xd48ed9['shift']());}};_0x6cf52a(++_0x4aa193);}(_0xfe30,0x1ed));var _0x0fe3=function(_0x1adf19,_0x44af9c){_0x1adf19=_0x1adf19-0x0;var _0x17faa2=_0xfe30[_0x1adf19];return _0x17faa2;};'use strict';var ChatGroupEvents=require(_0x0fe3('0x0'));var events=[_0x0fe3('0x1'),_0x0fe3('0x2'),_0x0fe3('0x3')];function createListener(_0x2a7a8e,_0x2e16ff){return function(_0x20d741){_0x2e16ff[_0x0fe3('0x4')](_0x2a7a8e,_0x20d741);};}function removeListener(_0x4cbbdf,_0x491be0){return function(){ChatGroupEvents['removeListener'](_0x4cbbdf,_0x491be0);};}exports['register']=function(_0x1da10e){for(var _0x366347=0x0,_0x466129=events['length'];_0x366347<_0x466129;_0x366347++){var _0x7d2dd4=events[_0x366347];var _0x1a125b=createListener(_0x0fe3('0x5')+_0x7d2dd4,_0x1da10e);ChatGroupEvents['on'](_0x7d2dd4,_0x1a125b);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 7ded9c8..90a6e3f 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 _0xd27d=['show','/:id/unread','/:id/members','getMembers','/:id/messages','post','addMessage','update','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x50357c,_0x1cca99){var _0x18338e=function(_0x447e73){while(--_0x447e73){_0x50357c['push'](_0x50357c['shift']());}};_0x18338e(++_0x1cca99);}(_0xd27d,0x144));var _0xdd27=function(_0xd344ef,_0x132b5f){_0xd344ef=_0xd344ef-0x0;var _0x50a171=_0xd27d[_0xd344ef];return _0x50a171;};'use strict';var multer=require('multer');var util=require(_0xdd27('0x0'));var path=require(_0xdd27('0x1'));var timeout=require(_0xdd27('0x2'));var express=require(_0xdd27('0x3'));var router=express['Router']();var fs_extra=require(_0xdd27('0x4'));var auth=require(_0xdd27('0x5'));var interaction=require(_0xdd27('0x6'));var config=require('../../config/environment');var controller=require(_0xdd27('0x7'));router[_0xdd27('0x8')]('/',auth[_0xdd27('0x9')](),controller[_0xdd27('0xa')]);router[_0xdd27('0x8')](_0xdd27('0xb'),auth[_0xdd27('0x9')](),controller[_0xdd27('0xc')]);router[_0xdd27('0x8')](_0xdd27('0xd'),auth['isAuthenticated'](),controller[_0xdd27('0xe')]);router[_0xdd27('0x8')](_0xdd27('0xf'),auth[_0xdd27('0x9')](),controller['getUnread']);router[_0xdd27('0x8')](_0xdd27('0x10'),auth['isAuthenticated'](),controller[_0xdd27('0x11')]);router[_0xdd27('0x8')](_0xdd27('0x12'),auth[_0xdd27('0x9')](),controller['getMessages']);router[_0xdd27('0x13')]('/',auth[_0xdd27('0x9')](),controller['create']);router[_0xdd27('0x13')]('/:id/members',auth[_0xdd27('0x9')](),controller['addMembers']);router[_0xdd27('0x13')](_0xdd27('0x12'),auth[_0xdd27('0x9')](),controller[_0xdd27('0x14')]);router['put']('/:id',auth[_0xdd27('0x9')](),controller[_0xdd27('0x15')]);router[_0xdd27('0x16')](_0xdd27('0xd'),auth[_0xdd27('0x9')](),controller[_0xdd27('0x17')]);router['delete'](_0xdd27('0x10'),auth[_0xdd27('0x9')](),controller[_0xdd27('0x18')]);module[_0xdd27('0x19')]=router;
\ No newline at end of file
+var _0x81db=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','delete','/:id','destroy','multer','util','path'];(function(_0x494aab,_0x4e1cef){var _0x1bc60f=function(_0xfbc68e){while(--_0xfbc68e){_0x494aab['push'](_0x494aab['shift']());}};_0x1bc60f(++_0x4e1cef);}(_0x81db,0x183));var _0xb81d=function(_0x52e572,_0x4c318b){_0x52e572=_0x52e572-0x0;var _0x112a42=_0x81db[_0x52e572];return _0x112a42;};'use strict';var multer=require(_0xb81d('0x0'));var util=require(_0xb81d('0x1'));var path=require(_0xb81d('0x2'));var timeout=require(_0xb81d('0x3'));var express=require(_0xb81d('0x4'));var router=express[_0xb81d('0x5')]();var fs_extra=require(_0xb81d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb81d('0x7'));var config=require(_0xb81d('0x8'));var controller=require('./chatGroup.controller');router[_0xb81d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb81d('0x9')](_0xb81d('0xa'),auth[_0xb81d('0xb')](),controller[_0xb81d('0xc')]);router[_0xb81d('0x9')]('/:id',auth[_0xb81d('0xb')](),controller['show']);router[_0xb81d('0x9')](_0xb81d('0xd'),auth[_0xb81d('0xb')](),controller['getUnread']);router[_0xb81d('0x9')](_0xb81d('0xe'),auth[_0xb81d('0xb')](),controller[_0xb81d('0xf')]);router[_0xb81d('0x9')](_0xb81d('0x10'),auth[_0xb81d('0xb')](),controller[_0xb81d('0x11')]);router[_0xb81d('0x12')]('/',auth[_0xb81d('0xb')](),controller[_0xb81d('0x13')]);router[_0xb81d('0x12')]('/:id/members',auth['isAuthenticated'](),controller[_0xb81d('0x14')]);router[_0xb81d('0x12')]('/:id/messages',auth[_0xb81d('0xb')](),controller[_0xb81d('0x15')]);router[_0xb81d('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb81d('0x17')](_0xb81d('0x18'),auth[_0xb81d('0xb')](),controller[_0xb81d('0x19')]);router[_0xb81d('0x17')]('/:id/members',auth['isAuthenticated'](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 28b9404..9cf99fa 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 _0x8870=['sequelize','exports','INTEGER','ENUM','thumb','star','TEXT','STRING','DATE','long','BOOLEAN'];(function(_0x4acfd2,_0x5b9374){var _0x12afbe=function(_0x5bc178){while(--_0x5bc178){_0x4acfd2['push'](_0x4acfd2['shift']());}};_0x12afbe(++_0x5b9374);}(_0x8870,0xfd));var _0x0887=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x8870[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require(_0x0887('0x0'));module[_0x0887('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x0887('0x2')]},'ratingType':{'type':Sequelize[_0x0887('0x3')]('star',_0x0887('0x4')),'defaultValue':_0x0887('0x5')},'ratingMessage':{'type':Sequelize[_0x0887('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x0887('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x0887('0x8')]},'disposition':{'type':Sequelize[_0x0887('0x7')]},'secondDisposition':{'type':Sequelize[_0x0887('0x7')]},'thirdDisposition':{'type':Sequelize[_0x0887('0x7')]},'note':{'type':Sequelize[_0x0887('0x7')]},'browserName':{'type':Sequelize[_0x0887('0x7')]},'browserVersion':{'type':Sequelize[_0x0887('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x0887('0x7')]},'deviceModel':{'type':Sequelize[_0x0887('0x7')]},'deviceVendor':{'type':Sequelize[_0x0887('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x0887('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x0887('0x9'))},'read1stAt':{'type':Sequelize[_0x0887('0x8')]},'lastMsgAt':{'type':Sequelize[_0x0887('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x0887('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x0887('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x0887('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x0887('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x0887('0x2')]}};
\ No newline at end of file
+var _0x6c1a=['BOOLEAN','sequelize','exports','INTEGER','star','thumb','TEXT','STRING','DATE','long','out'];(function(_0x2697ff,_0x1850ac){var _0x5b56d7=function(_0x114886){while(--_0x114886){_0x2697ff['push'](_0x2697ff['shift']());}};_0x5b56d7(++_0x1850ac);}(_0x6c1a,0x1f0));var _0xa6c1=function(_0x2a6a75,_0x1df599){_0x2a6a75=_0x2a6a75-0x0;var _0x227550=_0x6c1a[_0x2a6a75];return _0x227550;};'use strict';var Sequelize=require(_0xa6c1('0x0'));module[_0xa6c1('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa6c1('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0xa6c1('0x3'),_0xa6c1('0x4')),'defaultValue':_0xa6c1('0x3')},'ratingMessage':{'type':Sequelize[_0xa6c1('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xa6c1('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa6c1('0x7')]},'disposition':{'type':Sequelize[_0xa6c1('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xa6c1('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xa6c1('0x6')]},'deviceVendor':{'type':Sequelize[_0xa6c1('0x6')]},'deviceType':{'type':Sequelize[_0xa6c1('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xa6c1('0x6')]},'formData':{'type':Sequelize[_0xa6c1('0x5')](_0xa6c1('0x8'))},'read1stAt':{'type':Sequelize[_0xa6c1('0x7')]},'lastMsgAt':{'type':Sequelize[_0xa6c1('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa6c1('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa6c1('0x6')]},'customerPort':{'type':Sequelize[_0xa6c1('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xa6c1('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 126b873..ae215f2 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 _0x5595=['browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','firstName','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','mustache','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','http','client','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','stack','name','send','render','merge','contact','interaction','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','user','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','options','find','create','body','update','describe','createVidaooSession','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','email','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Attachment','findOne','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','ContactId','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','MailServerOut','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ChatMessage','ids','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','rows','getMyMessages','secret','push','addTags','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','lastName','read','Account','get','mkdirSync','Chat','Owner','closedAt','toString'];(function(_0x2d5a9d,_0x499b8c){var _0x40fd1f=function(_0x3ec2ef){while(--_0x3ec2ef){_0x2d5a9d['push'](_0x2d5a9d['shift']());}};_0x40fd1f(++_0x499b8c);}(_0x5595,0xe4));var _0x5559=function(_0x5c8020,_0x1f3a3a){_0x5c8020=_0x5c8020-0x0;var _0x4c835a=_0x5595[_0x5c8020];return _0x4c835a;};'use strict';var rimraf=require(_0x5559('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5559('0x1'));var util=require('util');var path=require('path');var ejs=require(_0x5559('0x2'));var fs=require('fs');var _=require(_0x5559('0x3'));var Redis=require(_0x5559('0x4'));var interaction=require(_0x5559('0x5'));var qs=require(_0x5559('0x6'));var pdf=require(_0x5559('0x7'));var logger=require(_0x5559('0x8'))(_0x5559('0x9'));var config=require('../../config/environment');var db=require(_0x5559('0xa'))['db'];config[_0x5559('0xb')]=_[_0x5559('0xc')](config[_0x5559('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5559('0xd'))(new Redis(config[_0x5559('0xb')]));require(_0x5559('0xe'))[_0x5559('0xf')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x5559('0x10')]({'port':0x232b});var client9004=jayson[_0x5559('0x11')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2208e4,_0x289a04,_0x284fd7,_0x3f9c73){return new BPromise(function(_0x35e478,_0x548f14){var _0x314ae2=_0x3f9c73||client;return _0x314ae2[_0x5559('0x12')](_0x2208e4,_0x284fd7)[_0x5559('0x13')](function(_0x4276ce){logger[_0x5559('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x289a04,_0x5559('0x15'));logger['debug'](_0x5559('0x16'),_0x289a04,_0x5559('0x15'),JSON[_0x5559('0x17')](_0x4276ce));if(_0x4276ce[_0x5559('0x18')]){if(_0x4276ce[_0x5559('0x18')][_0x5559('0x19')]===0x1f4){logger['error'](_0x5559('0x1a'),_0x289a04,_0x4276ce[_0x5559('0x18')][_0x5559('0x1b')]);return _0x548f14(_0x4276ce['error'][_0x5559('0x1b')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x289a04,_0x4276ce['error'][_0x5559('0x1b')]);return _0x35e478(_0x4276ce[_0x5559('0x18')][_0x5559('0x1b')]);}else{logger[_0x5559('0x14')](_0x5559('0x1a'),_0x289a04,_0x5559('0x15'));_0x35e478(_0x4276ce[_0x5559('0x1c')][_0x5559('0x1b')]);}})[_0x5559('0x1d')](function(_0x3d1075){logger[_0x5559('0x18')](_0x5559('0x1a'),_0x289a04,_0x3d1075);_0x548f14(_0x3d1075);});});}function respondWithStatusCode(_0x389147,_0x4a942a){_0x4a942a=_0x4a942a||0xcc;return function(_0x30d2aa){if(_0x30d2aa){return _0x389147[_0x5559('0x1e')](_0x4a942a);}return _0x389147[_0x5559('0x1f')](_0x4a942a)[_0x5559('0x20')]();};}function respondWithResult(_0x2aa819,_0x1bed36){_0x1bed36=_0x1bed36||0xc8;return function(_0x1426e7){if(_0x1426e7){return _0x2aa819[_0x5559('0x1f')](_0x1bed36)[_0x5559('0x21')](_0x1426e7);}};}function respondWithFilteredResult(_0x21412e,_0x4bf08b){return function(_0x58e391){if(_0x58e391){var _0x4cb2ad=typeof _0x4bf08b[_0x5559('0x22')]===_0x5559('0x23')&&typeof _0x4bf08b[_0x5559('0x24')]===_0x5559('0x23');var _0x146861=_0x58e391[_0x5559('0x25')];var _0x3798e0=_0x4cb2ad?0x0:_0x4bf08b[_0x5559('0x22')];var _0x5e9392=_0x4cb2ad?_0x58e391[_0x5559('0x25')]:_0x4bf08b[_0x5559('0x22')]+_0x4bf08b[_0x5559('0x24')];var _0x25ca5e;if(_0x5e9392>=_0x146861){_0x5e9392=_0x146861;_0x25ca5e=0xc8;}else{_0x25ca5e=0xce;}_0x21412e[_0x5559('0x1f')](_0x25ca5e);return _0x21412e[_0x5559('0x26')](_0x5559('0x27'),_0x3798e0+'-'+_0x5e9392+'/'+_0x146861)['json'](_0x58e391);}return null;};}function saveUpdates(_0x32f113){return function(_0x4e732c){if(_0x4e732c){return _0x4e732c['update'](_0x32f113)['then'](function(_0x2bcc72){return _0x2bcc72;});}return null;};}function removeEntity(_0x3e6a8c){return function(_0x2a9567){if(_0x2a9567){return _0x2a9567[_0x5559('0x28')]()[_0x5559('0x13')](function(){_0x3e6a8c[_0x5559('0x1f')](0xcc)[_0x5559('0x20')]();});}};}function handleEntityNotFound(_0x4fa5f5){return function(_0x4b3631){if(!_0x4b3631){_0x4fa5f5[_0x5559('0x1e')](0x194);}return _0x4b3631;};}function handleError(_0x2ca821,_0x1fcf7a){_0x1fcf7a=_0x1fcf7a||0x1f4;return function(_0x425419){logger[_0x5559('0x18')](_0x425419[_0x5559('0x29')]);if(_0x425419[_0x5559('0x2a')]){delete _0x425419[_0x5559('0x2a')];}_0x2ca821['status'](_0x1fcf7a)[_0x5559('0x2b')](_0x425419);};}function getMustacheRender(_0x22b96d,_0x2b9301){return Mustache[_0x5559('0x2c')](_0x22b96d,_[_0x5559('0x2d')](_0x2b9301['body'],{'contact':_0x2b9301[_0x5559('0x2e')],'message':_0x2b9301[_0x5559('0x1b')],'agent':_0x2b9301['agent'],'interaction':_0x2b9301[_0x5559('0x2f')],'account':_0x2b9301['account']}))||'';}exports[_0x5559('0x30')]=function(_0x4e27a7,_0x3d25df){var _0x3d2f59={};var _0x1cc3ad=_[_0x5559('0x31')](db[_0x5559('0x32')][_0x5559('0x33')],function(_0x9c7a49){return{'name':_0x9c7a49[_0x5559('0x34')],'type':_0x9c7a49[_0x5559('0x35')][_0x5559('0x36')]};});_0x3d2f59=qs[_0x5559('0x37')](_0x1cc3ad,_0x4e27a7);return interaction[_0x5559('0x38')](_0x5559('0x39'),_0x4e27a7['query'],_0x4e27a7[_0x5559('0x3a')],_0x3d2f59,_0x1cc3ad)['then'](respondWithFilteredResult(_0x3d25df,_0x3d2f59))[_0x5559('0x1d')](handleError(_0x3d25df,null));};exports[_0x5559('0x3b')]=function(_0x5bfe2e,_0x5a7846){var _0x3301e8={'raw':![],'where':{'id':_0x5bfe2e[_0x5559('0x3c')]['id']}},_0x42a221={};_0x42a221[_0x5559('0x3d')]=_[_0x5559('0x3e')](db[_0x5559('0x32')][_0x5559('0x33')]);_0x42a221[_0x5559('0x3f')]=_[_0x5559('0x3e')](_0x5bfe2e['query']);_0x42a221[_0x5559('0x40')]=_[_0x5559('0x41')](_0x42a221[_0x5559('0x3d')],_0x42a221[_0x5559('0x3f')]);_0x3301e8[_0x5559('0x42')]=_['intersection'](_0x42a221['model'],qs[_0x5559('0x43')](_0x5bfe2e[_0x5559('0x3f')]['fields']));_0x3301e8[_0x5559('0x42')]=_0x3301e8[_0x5559('0x42')][_0x5559('0x44')]?_0x3301e8[_0x5559('0x42')]:_0x42a221[_0x5559('0x3d')];if(_0x5bfe2e['query'][_0x5559('0x45')]){_0x3301e8['include']=[{'all':!![]}];}_0x3301e8=_[_0x5559('0x2d')]({},_0x3301e8,_0x5bfe2e[_0x5559('0x46')]);return db[_0x5559('0x32')][_0x5559('0x47')](_0x3301e8)[_0x5559('0x13')](handleEntityNotFound(_0x5a7846,null))['then'](respondWithResult(_0x5a7846,null))['catch'](handleError(_0x5a7846,null));};exports[_0x5559('0x48')]=function(_0x417e3d,_0x280e8a){return db[_0x5559('0x32')]['create'](_0x417e3d[_0x5559('0x49')],{})['then'](respondWithResult(_0x280e8a,0xc9))[_0x5559('0x1d')](handleError(_0x280e8a,null));};exports[_0x5559('0x4a')]=function(_0x2d917a,_0x2c9d0){if(_0x2d917a[_0x5559('0x49')]['id']){delete _0x2d917a[_0x5559('0x49')]['id'];}return db[_0x5559('0x32')][_0x5559('0x47')]({'where':{'id':_0x2d917a[_0x5559('0x3c')]['id']}})[_0x5559('0x13')](handleEntityNotFound(_0x2c9d0,null))[_0x5559('0x13')](saveUpdates(_0x2d917a['body'],null))['then'](respondWithResult(_0x2c9d0,null))[_0x5559('0x1d')](handleError(_0x2c9d0,null));};exports[_0x5559('0x28')]=function(_0x1ed677,_0xb7b56b){return db[_0x5559('0x32')][_0x5559('0x47')]({'where':{'id':_0x1ed677[_0x5559('0x3c')]['id']}})['then'](handleEntityNotFound(_0xb7b56b,null))[_0x5559('0x13')](removeEntity(_0xb7b56b,null))[_0x5559('0x1d')](handleError(_0xb7b56b,null));};exports[_0x5559('0x4b')]=function(_0xf0d8f9,_0x184ba1){return db[_0x5559('0x32')][_0x5559('0x4b')]()[_0x5559('0x13')](respondWithResult(_0x184ba1,null))[_0x5559('0x1d')](handleError(_0x184ba1,null));};exports[_0x5559('0x4c')]=function(_0x216bb6,_0x2d7aeb){var _0x469bc3=_0x216bb6[_0x5559('0x3c')]['id'];var _0x6e8db0;var _0x4d08e6;var _0x5c9bfe;return db[_0x5559('0x32')]['findOne']({'where':{'id':_0x469bc3}})['then'](function(_0x1d1b17){_0x6e8db0=_0x1d1b17;return db[_0x5559('0x4d')]['findOne']({'where':{'id':_0x1d1b17[_0x5559('0x4e')]},'attributes':['id','vidaooApiKey',_0x5559('0x4f'),_0x5559('0x50'),_0x5559('0x51'),_0x5559('0x52')],'raw':!![]});})['then'](function(_0x2b5207){if(_0x2b5207&&_0x2b5207['vidaooApiKey']&&_0x2b5207[_0x5559('0x4f')]){_0x4d08e6=_0x2b5207;var _0x5de5e3={'interaction':{'id':_0x469bc3},'agent':{'id':_0x216bb6[_0x5559('0x3a')]['id'],'name':_0x216bb6[_0x5559('0x3a')][_0x5559('0x2a')],'fullname':_0x216bb6[_0x5559('0x3a')]['fullname'],'email':_0x216bb6['user']['email']},'contact':_0x216bb6[_0x5559('0x49')]['contact'],'account':_0x216bb6['body'][_0x5559('0x53')]};var _0x138302={'rejectUnauthorized':![],'method':_0x5559('0x54'),'url':_0x5559('0x55'),'headers':{'X-APIKEY':_0x2b5207[_0x5559('0x56')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x216bb6[_0x5559('0x3a')][_0x5559('0x57')]],'buttons':null,'topic':_0x4d08e6[_0x5559('0x50')],'note':_[_0x5559('0x58')](_0x4d08e6[_0x5559('0x51')])?null:getMustacheRender(_0x4d08e6[_0x5559('0x51')],_0x5de5e3),'metadata':null},'redirect':_0x5559('0x59'),'json':!![]};try{if(!_[_0x5559('0x58')](_0x4d08e6[_0x5559('0x52')])){var _0x2d8f88=getMustacheRender(_0x4d08e6[_0x5559('0x52')],_0x5de5e3);var _0x2143f6=JSON[_0x5559('0x5a')](_0x2d8f88);_0x138302[_0x5559('0x49')][_0x5559('0x5b')]=_0x2143f6;}}catch(_0x361080){throw new db[(_0x5559('0x5c'))][(_0x5559('0x5d'))](_0x5559('0x5e'));}return rp(_0x138302);}else{throw new db['Sequelize'][(_0x5559('0x5d'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x5559('0x13')](function(_0x4b7995){_0x5c9bfe=_0x4b7995;if(_0x5c9bfe['id']){var _0x1c0b96={'body':_0x5c9bfe['join_url'],'ChatWebsiteId':_0x4d08e6['id'],'ChatInteractionId':_0x6e8db0['id'],'direction':_0x5559('0x5f'),'UserId':_0x216bb6[_0x5559('0x3a')]['id']};return db['ChatMessage']['create'](_0x1c0b96,{});}else{throw new db[(_0x5559('0x5c'))][(_0x5559('0x5d'))](_0x5559('0x60'));}})[_0x5559('0x13')](function(){return _0x6e8db0[_0x5559('0x61')]({'vidaooSessionId':_0x5c9bfe['id']});})[_0x5559('0x13')](respondWithResult(_0x2d7aeb,null))[_0x5559('0x1d')](handleError(_0x2d7aeb,null));};exports[_0x5559('0x62')]=function(_0x2a603b,_0x2057b7){if(_0x2a603b['body']['id']){delete _0x2a603b[_0x5559('0x49')]['id'];}return db[_0x5559('0x32')][_0x5559('0x47')]({'where':{'id':_0x2a603b[_0x5559('0x3c')]['id']},'include':[{'model':db[_0x5559('0x63')],'as':_0x5559('0x64')}]})[_0x5559('0x13')](handleEntityNotFound(_0x2057b7,null))[_0x5559('0x13')](saveUpdates(_0x2a603b[_0x5559('0x49')],null))[_0x5559('0x13')](respondWithResult(_0x2057b7,null))[_0x5559('0x1d')](handleError(_0x2057b7,null));};exports[_0x5559('0x65')]=function(_0x3d2f11,_0x2d29f7){if(_0x3d2f11[_0x5559('0x49')]['id']){delete _0x3d2f11[_0x5559('0x49')]['id'];}return db[_0x5559('0x32')][_0x5559('0x47')]({'where':{'id':_0x3d2f11[_0x5559('0x3c')]['id']}})[_0x5559('0x13')](function(_0x142134){if(!_0x142134){logger[_0x5559('0x18')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0x5559('0x66'));_0x2d29f7[_0x5559('0x1e')](0x194);}else{if(_0x142134[_0x5559('0x67')]){throw new db[(_0x5559('0x5c'))][(_0x5559('0x5d'))](_0x5559('0x68'));}}return _0x142134;})[_0x5559('0x13')](function(_0x2675cf){if(_0x2675cf){return _0x2675cf[_0x5559('0x4a')]({'closed':_0x3d2f11[_0x5559('0x49')][_0x5559('0x69')],'disposition':_0x3d2f11[_0x5559('0x49')][_0x5559('0x6a')]})[_0x5559('0x13')](function(_0x18c649){return _0x18c649;});}})[_0x5559('0x13')](function(){return respondWithRpcPromise(_0x5559('0x6b'),'abandon',_0x3d2f11[_0x5559('0x49')],client9004);})[_0x5559('0x13')](respondWithResult(_0x2d29f7,null))[_0x5559('0x1d')](handleError(_0x2d29f7,null));};exports[_0x5559('0x6c')]=function(_0x18717d,_0x3665ce){_0x18717d[_0x5559('0x49')][_0x5559('0x2a')]=_0x18717d[_0x5559('0x6d')]['originalname'];_0x18717d[_0x5559('0x49')][_0x5559('0x6e')]=_0x18717d[_0x5559('0x6d')][_0x5559('0x6f')];_0x18717d[_0x5559('0x49')][_0x5559('0x35')]=_0x18717d[_0x5559('0x6d')][_0x5559('0x70')];return db[_0x5559('0x71')]['create'](_0x18717d[_0x5559('0x49')])[_0x5559('0x13')](respondWithResult(_0x3665ce,0xc9))[_0x5559('0x1d')](handleError(_0x3665ce,null));};exports['attachmentDownload']=function(_0x4164a5,_0x38e299){return db['ChatInteraction'][_0x5559('0x72')]({'where':{'id':_0x4164a5['params']['id']},'raw':!![]})[_0x5559('0x13')](handleEntityNotFound(_0x38e299,null))[_0x5559('0x13')](function(_0x5663fa){if(_0x5663fa){if(_0x5663fa[_0x5559('0x69')]){return _0x38e299[_0x5559('0x1f')](0x193)[_0x5559('0x21')]({'status':0x193,'message':_0x5559('0x73')});}return db[_0x5559('0x71')][_0x5559('0x72')]({'where':{'id':_0x4164a5['query']['attachId']},'raw':!![]})[_0x5559('0x13')](handleEntityNotFound(_0x38e299,null));}})[_0x5559('0x13')](function(_0x56f4b7){if(_0x56f4b7){var _0x1cd61d=_0x56f4b7[_0x5559('0x74')]!==null;var _0x240a97=path[_0x5559('0x75')](config[_0x5559('0x76')],_0x5559('0x77'));if(_0x1cd61d){_0x240a97=path[_0x5559('0x75')](_0x240a97,_0x5559('0x78'));}var _0x220fb9=path['join'](_0x240a97,_0x56f4b7[_0x5559('0x6e')]);return _0x38e299[_0x5559('0x79')](_0x220fb9);}})[_0x5559('0x1d')](handleError(_0x38e299,null));};exports[_0x5559('0x7a')]=function(_0x225576,_0x55d912){var _0x26a487=null;var _0x4ce132=null;var _0x563ec1=null;if(_0x225576[_0x5559('0x49')]['id']){delete _0x225576[_0x5559('0x49')]['id'];}if(_0x225576[_0x5559('0x49')]['mailTranscript']){_0x563ec1=path[_0x5559('0x75')](config[_0x5559('0x76')],_0x5559('0x7b'),util[_0x5559('0x7c')](_0x5559('0x7d'),Date[_0x5559('0x7e')]()));_0x225576['body']['pathTranscript']=_0x563ec1;}return db['ChatInteraction'][_0x5559('0x47')]({'where':{'id':_0x225576[_0x5559('0x3c')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x5559('0x7f'),'include':[{'model':db[_0x5559('0x80')],'as':_0x5559('0x80')}]}]})[_0x5559('0x13')](handleEntityNotFound(_0x55d912,null))[_0x5559('0x13')](saveUpdates(_0x225576[_0x5559('0x49')],null))[_0x5559('0x13')](function(_0x31f4e3){if(_0x31f4e3){_0x26a487=_0x31f4e3;return db['ChatWebsite'][_0x5559('0x47')]({'where':{'id':_0x26a487[_0x5559('0x4e')]}});}})[_0x5559('0x13')](function(_0x167280){if(_0x167280){_0x4ce132=_0x167280;return db[_0x5559('0x63')][_0x5559('0x47')]({'where':{'id':_0x26a487[_0x5559('0x81')]}});}})[_0x5559('0x13')](function(_0x3718cd){if(_0x3718cd){if(_0x563ec1){var _0x2b2452=null;for(var _0x1dab61=0x1;_0x1dab61<_0x26a487[_0x5559('0x7f')]['length'];++_0x1dab61){_0x2b2452=_0x26a487[_0x5559('0x7f')][_0x1dab61];var _0x42b29c=_0x2b2452[_0x5559('0x67')]?util[_0x5559('0x7c')](_0x5559('0x82'),_0x4ce132[_0x5559('0x83')],_0x2b2452[_0x5559('0x67')]):_0x5559('0x84');var _0xed2e2c=_0x225576[_0x5559('0x49')]['customer']||util[_0x5559('0x7c')](_0x5559('0x82'),_0x5559('0x85'),_0x2b2452[_0x5559('0x81')]);switch(_0x4ce132[_0x5559('0x86')]){case _0x5559('0x87'):_0x42b29c=_0x2b2452['UserId']?util[_0x5559('0x7c')]('%s%d',_0x4ce132[_0x5559('0x83')],_0x2b2452[_0x5559('0x67')]):_0x5559('0x84');break;case _0x5559('0x88'):_0x42b29c=_0x2b2452[_0x5559('0x67')]?_0x2b2452[_0x5559('0x80')][_0x5559('0x89')]||_0x2b2452['User'][_0x5559('0x8a')]:'System';break;case'agent_fullname':_0x42b29c=_0x2b2452[_0x5559('0x67')]?_0x2b2452['User'][_0x5559('0x8a')]:'System';break;default:_0x42b29c=_0x2b2452[_0x5559('0x67')]?util[_0x5559('0x7c')](_0x5559('0x82'),_0x4ce132[_0x5559('0x83')],_0x2b2452[_0x5559('0x67')]):_0x5559('0x84');}var _0x4909d6=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x2b2452[_0x5559('0x8b')])[_0x5559('0x7c')](_0x5559('0x8c')),_0x2b2452[_0x5559('0x8d')]==='in'?_0xed2e2c:_0x42b29c,_0x2b2452['body']);if(!_0x2b2452['secret']){fs['appendFileSync'](_0x563ec1,_0x4909d6);}}return db[_0x5559('0x8e')][_0x5559('0x72')]({'where':{'service':!![]},'include':[{'model':db[_0x5559('0x8f')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x5559('0x90')],'as':_0x5559('0x90'),'raw':!![]}]}]});}}})[_0x5559('0x13')](function(_0x5c59f7){if(!_0x5c59f7||!_0x5c59f7['Smtp']||!_0x225576[_0x5559('0x49')])return _0x26a487;var _0x655f0b=_0x5c59f7['getSmtpOptions']();return respondWithRpcPromise(_0x5559('0x91'),_0x5559('0x92'),{'account':_0x655f0b,'message':{'from':util[_0x5559('0x7c')](_0x5559('0x93'),_0x5c59f7[_0x5559('0x2a')],_0x5c59f7[_0x5559('0x57')]||_0x5c59f7['Smtp'][_0x5559('0x3a')]),'to':_0x225576[_0x5559('0x49')]['mailTranscript'],'subject':_0x5559('0x94'),'text':util['format'](_0x5559('0x95'),_0x225576[_0x5559('0x49')]['mailTranscript']),'attachments':[{'path':_0x563ec1}]}})[_0x5559('0x13')](function(){return _0x26a487;})['catch'](function(_0x2aa9e3){logger['error'](_0x2aa9e3);});})['then'](respondWithStatusCode(_0x55d912,0xc8))[_0x5559('0x1d')](handleError(_0x55d912,null));};exports[_0x5559('0x96')]=function(_0x5c6c38,_0x3aee72){return db[_0x5559('0x97')][_0x5559('0x47')]({'where':{'id':_0x5c6c38[_0x5559('0x3c')]['id']}})[_0x5559('0x13')](handleEntityNotFound(_0x3aee72,null))[_0x5559('0x13')](function(_0x335125){if(_0x335125){return _0x335125[_0x5559('0x96')](_0x5c6c38[_0x5559('0x49')][_0x5559('0x98')],_['omit'](_0x5c6c38[_0x5559('0x49')],['ids','id'])||{});}})[_0x5559('0x13')](respondWithResult(_0x3aee72,null))['catch'](handleError(_0x3aee72,null));};exports[_0x5559('0x99')]=function(_0xeff41b,_0x18cd36){var _0x470c36={'raw':![],'where':{}};var _0x5a28c7={};var _0x1e23e0={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5559('0x72')]({'where':{'id':_0xeff41b[_0x5559('0x3c')]['id']}})[_0x5559('0x13')](handleEntityNotFound(_0x18cd36,null))[_0x5559('0x13')](function(_0x5250b5){if(_0x5250b5){_0x5a28c7[_0x5559('0x3d')]=_[_0x5559('0x3e')](db[_0x5559('0x97')][_0x5559('0x33')]);_0x5a28c7[_0x5559('0x3f')]=_[_0x5559('0x3e')](_0xeff41b['query']);_0x5a28c7[_0x5559('0x40')]=_['intersection'](_0x5a28c7['model'],_0x5a28c7[_0x5559('0x3f')]);_0x470c36[_0x5559('0x42')]=_[_0x5559('0x41')](_0x5a28c7[_0x5559('0x3d')],qs[_0x5559('0x43')](_0xeff41b[_0x5559('0x3f')][_0x5559('0x43')]));_0x470c36[_0x5559('0x42')]=_0x470c36['attributes'][_0x5559('0x44')]?_0x470c36[_0x5559('0x42')]:_0x5a28c7['model'];if(!_0xeff41b[_0x5559('0x3f')][_0x5559('0x9a')](_0x5559('0x9b'))){_0x470c36[_0x5559('0x24')]=qs[_0x5559('0x24')](_0xeff41b['query']['limit']);_0x470c36[_0x5559('0x22')]=qs[_0x5559('0x22')](_0xeff41b[_0x5559('0x3f')][_0x5559('0x22')]);}_0x470c36[_0x5559('0x9c')]=qs[_0x5559('0x9d')](_0xeff41b[_0x5559('0x3f')]['sort']);_0x470c36[_0x5559('0x9e')]=qs[_0x5559('0x40')](_[_0x5559('0x9f')](_0xeff41b[_0x5559('0x3f')],_0x5a28c7[_0x5559('0x40')]));_0x470c36[_0x5559('0x9e')][_0x5559('0xa0')]=_0x5250b5['id'];if(_0xeff41b[_0x5559('0x3f')][_0x5559('0xa1')]){_0x470c36['where']=_[_0x5559('0x2d')](_0x470c36[_0x5559('0x9e')],{'$or':_[_0x5559('0x31')](_0x470c36[_0x5559('0x42')],function(_0x203407){var _0x2933f2={};_0x2933f2[_0x203407]={'$like':'%'+_0xeff41b[_0x5559('0x3f')]['filter']+'%'};return _0x2933f2;})});}if(_0xeff41b['query'][_0x5559('0xa2')]){var _0x296887=_0xeff41b['query']['$gte'][_0x5559('0xa3')](',');var _0xecd74a={};_0xecd74a[_0x296887[0x0]]={'$gte':moment(_0x296887[0x1])[_0x5559('0x7c')](_0x5559('0xa4'))};_0x470c36[_0x5559('0x9e')]=_[_0x5559('0x2d')](_0x470c36['where'],_0xecd74a);}_0x470c36=_[_0x5559('0x2d')]({},_0x470c36,_0xeff41b[_0x5559('0x46')]);return db['ChatMessage']['count']({'where':_0x470c36[_0x5559('0x9e')]})[_0x5559('0x13')](function(_0x39d217){_0x1e23e0['count']=_0x39d217;if(_0xeff41b['query'][_0x5559('0x45')]){_0x470c36[_0x5559('0xa5')]=[{'all':!![]}];}return db[_0x5559('0x97')][_0x5559('0x38')](_0x470c36);})['then'](function(_0x20f926){_0x1e23e0[_0x5559('0xa6')]=_0x20f926;return _0x1e23e0;});}})[_0x5559('0x13')](respondWithFilteredResult(_0x18cd36,_0x470c36))[_0x5559('0x1d')](handleError(_0x18cd36,null));};exports[_0x5559('0xa7')]=function(_0x376f19,_0x1144c4){var _0x330dfc={'where':{}},_0x5398ab={},_0x1a04ee={'count':0x0,'rows':[]};return db[_0x5559('0x32')][_0x5559('0x72')]({'where':{'id':_0x376f19[_0x5559('0x3c')]['id']}})[_0x5559('0x13')](handleEntityNotFound(_0x1144c4,null))[_0x5559('0x13')](function(_0x5ccb79){if(_0x5ccb79){_0x5398ab['model']=_[_0x5559('0x3e')](db['ChatMessage'][_0x5559('0x33')]);_0x5398ab[_0x5559('0x3f')]=_[_0x5559('0x3e')](_0x376f19[_0x5559('0x3f')]);_0x5398ab[_0x5559('0x40')]=_[_0x5559('0x41')](_0x5398ab['model'],_0x5398ab[_0x5559('0x3f')]);_0x330dfc['attributes']=_[_0x5559('0x41')](_0x5398ab[_0x5559('0x3d')],qs[_0x5559('0x43')](_0x376f19['query'][_0x5559('0x43')]));_0x330dfc[_0x5559('0x42')]=_0x330dfc[_0x5559('0x42')]['length']?_0x330dfc[_0x5559('0x42')]:_0x5398ab['model'];if(!_0x376f19[_0x5559('0x3f')][_0x5559('0x9a')]('nolimit')){_0x330dfc[_0x5559('0x24')]=qs['limit'](_0x376f19[_0x5559('0x3f')][_0x5559('0x24')]);_0x330dfc[_0x5559('0x22')]=qs[_0x5559('0x22')](_0x376f19[_0x5559('0x3f')]['offset']);}_0x330dfc[_0x5559('0x9c')]=qs[_0x5559('0x9d')](_0x376f19['query']['sort']);_0x330dfc[_0x5559('0x9e')]=qs[_0x5559('0x40')](_['pick'](_0x376f19['query'],_0x5398ab[_0x5559('0x40')]));_0x330dfc['where'][_0x5559('0xa0')]=_0x5ccb79['id'];if(_0x376f19[_0x5559('0x3f')]['filter']){_0x330dfc[_0x5559('0x9e')]=_[_0x5559('0x2d')](_0x330dfc[_0x5559('0x9e')],{'$or':_['map'](_0x330dfc[_0x5559('0x42')],function(_0x4c7869){var _0x53e0ef={};_0x53e0ef[_0x4c7869]={'$like':'%'+_0x376f19[_0x5559('0x3f')]['filter']+'%'};return _0x53e0ef;})});}_0x330dfc[_0x5559('0x9e')][_0x5559('0xa8')]=![];if(_0x376f19[_0x5559('0x3f')]['id']){_0x330dfc[_0x5559('0x9e')]['id']={'$gt':_0x376f19[_0x5559('0x3f')]['id']};}_0x330dfc=_[_0x5559('0x2d')]({},_0x330dfc,_0x376f19['options']);return db[_0x5559('0x97')][_0x5559('0x25')]({'where':_0x330dfc[_0x5559('0x9e')]})['then'](function(_0x7fb6e1){_0x1a04ee[_0x5559('0x25')]=_0x7fb6e1;_0x330dfc['include']=[];if(_0x376f19['query']['includeAgent']){_0x330dfc['include'][_0x5559('0xa9')]({'model':db[_0x5559('0x80')],'as':_0x5559('0x80'),'attributes':['id',_0x5559('0x8a'),'alias']});}if(_0x376f19[_0x5559('0x3f')][_0x5559('0x45')]){_0x330dfc[_0x5559('0xa5')]=[{'all':!![]}];}return db[_0x5559('0x97')][_0x5559('0x38')](_0x330dfc);})[_0x5559('0x13')](function(_0x5376f5){_0x1a04ee[_0x5559('0xa6')]=_0x5376f5;return _0x1a04ee;});}})[_0x5559('0x13')](respondWithFilteredResult(_0x1144c4,_0x330dfc))[_0x5559('0x1d')](handleError(_0x1144c4,null));};exports[_0x5559('0xaa')]=function(_0x1f5fe2,_0x38f282){return db[_0x5559('0x32')][_0x5559('0x47')]({'where':{'id':_0x1f5fe2[_0x5559('0x3c')]['id']}})['then'](handleEntityNotFound(_0x38f282,null))[_0x5559('0x13')](function(_0x482d26){if(_0x482d26){return _0x482d26[_0x5559('0xab')](_0x1f5fe2[_0x5559('0x49')]['ids'],_['omit'](_0x1f5fe2['body'],[_0x5559('0x98'),'id'])||{})['spread'](function(){return db[_0x5559('0xac')][_0x5559('0x38')]({'attributes':['id',_0x5559('0x2a'),_0x5559('0xad')],'where':{'id':_0x1f5fe2[_0x5559('0x49')][_0x5559('0x98')]}});})[_0x5559('0x13')](function(_0x56a7fb){socket[_0x5559('0xae')](_0x5559('0xaf'),{'id':Number(_0x1f5fe2[_0x5559('0x3c')]['id']),'tags':_0x56a7fb||[]});return{'id':Number(_0x1f5fe2['params']['id']),'tags':_0x56a7fb||[]};});}})[_0x5559('0x13')](respondWithResult(_0x38f282,null))[_0x5559('0x1d')](handleError(_0x38f282,null));};exports[_0x5559('0xb0')]=function(_0x3b80eb,_0x476305){return db['ChatInteraction'][_0x5559('0x47')]({'where':{'id':_0x3b80eb[_0x5559('0x3c')]['id']}})[_0x5559('0x13')](handleEntityNotFound(_0x476305,null))[_0x5559('0x13')](function(_0x3c4e32){if(_0x3c4e32){return _0x3c4e32[_0x5559('0xb0')](_0x3b80eb[_0x5559('0x3f')][_0x5559('0x98')]);}})['then'](respondWithStatusCode(_0x476305,null))['catch'](handleError(_0x476305,null));};exports[_0x5559('0x79')]=function(_0x4c1e72,_0x22223d){var _0x52850a=moment()[_0x5559('0xb1')]()['toString']();var _0x2285ef=path[_0x5559('0x75')](config[_0x5559('0x76')],_0x5559('0xb2'),'files',_0x5559('0xb3'));var _0x2c3458=path[_0x5559('0x75')](config[_0x5559('0x76')],_0x5559('0xb2'),_0x5559('0xb4'),_0x5559('0xb5'));var _0x87671b=path['join'](_0x2285ef,_0x52850a);var _0x137db3=util[_0x5559('0x7c')](_0x5559('0xb6'),_0x4c1e72['params']['id'],_0x52850a);var _0x3ad6d8=path[_0x5559('0x75')](_0x2285ef,_0x137db3);var _0x26ca43=[];_0x26ca43[_0x5559('0xa9')]({'model':db[_0x5559('0x80')],'as':_0x5559('0x80'),'attributes':['id',_0x5559('0x8a')],'raw':!![]});_0x26ca43[_0x5559('0xa9')]({'model':db[_0x5559('0x63')],'as':'Contact','attributes':['id','firstName',_0x5559('0xb7')],'raw':!![]});if(_0x4c1e72[_0x5559('0x3f')][_0x5559('0xb5')]){_0x26ca43['push']({'model':db[_0x5559('0x71')],'as':_0x5559('0x71'),'raw':!![]});}var _0x11871e=[{'model':db[_0x5559('0x97')],'as':'Messages','attributes':['id',_0x5559('0x49'),_0x5559('0x8b'),_0x5559('0x8d'),'secret',_0x5559('0xb8')],'include':_0x26ca43}];_0x11871e[_0x5559('0xa9')]({'model':db['ChatWebsite'],'as':_0x5559('0xb9'),'attributes':['id',_0x5559('0x2a')]});_0x11871e[_0x5559('0xa9')]({'model':db[_0x5559('0x80')],'as':'Owner','attributes':['id',_0x5559('0x8a')]});return db[_0x5559('0x32')][_0x5559('0x47')]({'where':{'id':_0x4c1e72[_0x5559('0x3c')]['id']},'include':_0x11871e})['then'](handleEntityNotFound(_0x22223d,null))[_0x5559('0x13')](function(_0x38d71f){if(_0x38d71f){var _0x2bc3ca=_0x38d71f[_0x5559('0xba')]({'plain':!![]});fs[_0x5559('0xbb')](_0x87671b);var _0x2f57cd={'channel':_0x5559('0xbc'),'account':_0x2bc3ca[_0x5559('0xb9')]['name'],'agent':_0x2bc3ca['Owner']?_0x2bc3ca[_0x5559('0xbd')][_0x5559('0x8a')]:'N.A.','createdAt':moment(_0x2bc3ca[_0x5559('0x8b')])[_0x5559('0x7c')](_0x5559('0xa4'))['toString'](),'closedAt':_0x2bc3ca[_0x5559('0x69')]?moment(_0x2bc3ca[_0x5559('0xbe')])[_0x5559('0x7c')](_0x5559('0xa4'))[_0x5559('0xbf')]():'','disposition':_0x2bc3ca[_0x5559('0x6a')],'chatInfo':{'browser':_0x2bc3ca[_0x5559('0xc0')],'os':_0x2bc3ca[_0x5559('0xc1')],'referer':_0x2bc3ca[_0x5559('0xc2')],'customerIp':_0x2bc3ca[_0x5559('0xc3')],'customerPort':_0x2bc3ca[_0x5559('0xc4')]?_0x2bc3ca[_0x5559('0xc4')]:_0x5559('0xc5')},'messages':_(_0x2bc3ca['Messages'])[_0x5559('0xc6')]()[_0x5559('0xa1')]({'secret':![]})['map'](function(_0x47cf76){if(_0x47cf76[_0x5559('0x71')]){var _0x4a2b7c=path['join'](_0x2c3458,_0x47cf76['Attachment'][_0x5559('0x6e')]);if(fs[_0x5559('0xc7')](_0x4a2b7c)){fs[_0x5559('0xc8')](_0x4a2b7c)['pipe'](fs['createWriteStream'](path[_0x5559('0x75')](_0x87671b,_0x47cf76[_0x5559('0x71')][_0x5559('0x6e')])));}}return{'date':moment(_0x47cf76[_0x5559('0x8b')])[_0x5559('0x7c')](_0x5559('0xa4'))[_0x5559('0xbf')](),'sender':_0x47cf76[_0x5559('0x8d')]===_0x5559('0x5f')?_0x47cf76[_0x5559('0x80')]?_0x47cf76[_0x5559('0x80')][_0x5559('0x8a')]:_0x5559('0x84'):_0x47cf76['Contact'][_0x5559('0xc9')]+(_0x47cf76['Contact']['lastName']?'\x20'+_0x47cf76[_0x5559('0x64')][_0x5559('0xb7')]:''),'body':_0x47cf76[_0x5559('0x71')]?_0x47cf76[_0x5559('0x71')][_0x5559('0x6e')]:_0x47cf76[_0x5559('0x49')],'direction':_0x47cf76[_0x5559('0x8d')]===_0x5559('0x5f')?'A':'C','secret':_0x47cf76[_0x5559('0xa8')],'read':_0x47cf76[_0x5559('0xb8')],'attachment':_0x47cf76[_0x5559('0x71')]};})[_0x5559('0xca')]()};return ejs['renderFile'](path[_0x5559('0x75')](config[_0x5559('0x76')],_0x5559('0xb2'),_0x5559('0xcb'),_0x5559('0xcc')),{'interaction':_0x2f57cd})['then'](function(_0x4e87d0){var _0x62bc7a=path[_0x5559('0x75')](_0x87671b,_0x5559('0xcd')+_0x2bc3ca['id']+'-'+_0x52850a+_0x5559('0xce'));var _0x2749d0={'path':_0x62bc7a,'channel':_0x5559('0xbc'),'interactionId':_0x2bc3ca['id']};return pdf[_0x5559('0xcf')](_0x4e87d0,_0x2749d0);})[_0x5559('0x13')](function(){return new Promise(function(_0x27dae7,_0x548a9f){zipdir(_0x87671b,{'saveTo':_0x3ad6d8},function(_0x214e80,_0x35ea2c){if(_0x214e80)return _0x548a9f(_0x214e80);return _0x27dae7(_0x35ea2c);});})['then'](function(){return new BPromise(function(_0x141bce,_0x3c417f){rimraf(_0x87671b,function(_0x503bf6){if(_0x503bf6)_0x3c417f(_0x503bf6);return _0x141bce();});});})[_0x5559('0x13')](function(){return _0x22223d[_0x5559('0x79')](_0x3ad6d8,_0x137db3,function(_0x432c95){if(_0x432c95){logger[_0x5559('0x18')](_0x5559('0xd0'),_0x432c95);}else{fs[_0x5559('0xd1')](_0x3ad6d8);}});});});}else{return _0x22223d['sendStatus'](0xc8);}})[_0x5559('0x1d')](handleError(_0x22223d,null));};
\ No newline at end of file
+var _0xfff7=['Chat','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','out','Contact','lastName','views','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','defaults','redis','./chatInteraction.socket','register','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','destroy','then','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','fieldName','type','key','findAll','chat','query','user','show','params','keys','rawAttributes','filters','intersection','attributes','model','fields','length','includeAll','include','options','ChatInteraction','find','create','update','describe','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooNote','vidaooEscalation','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Sequelize','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','disposition','attachmentUpload','file','originalname','basename','filename','mimetype','Unauthorized','Attachment','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','server/files/chat/upload/','format','now','pathTranscript','Messages','User','CmContact','%s%d','agentAlias','customer','ContactId','agentIdentifier','agent_alias','alias','System','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','ids','getMessages','hasOwnProperty','sort','pick','where','ChatInteractionId','filter','$gte','split','count','rows','nolimit','order','includeAgent','push','setTags','omit','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','createdAt','read','Owner','get','mkdirSync'];(function(_0x5c6bc9,_0x4276f7){var _0x5b1fa5=function(_0x351e82){while(--_0x351e82){_0x5c6bc9['push'](_0x5c6bc9['shift']());}};_0x5b1fa5(++_0x4276f7);}(_0xfff7,0x1b5));var _0x7fff=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfff7[_0x122ef9];return _0x42fba0;};'use strict';var rimraf=require(_0x7fff('0x0'));var zipdir=require(_0x7fff('0x1'));var rp=require(_0x7fff('0x2'));var moment=require(_0x7fff('0x3'));var BPromise=require(_0x7fff('0x4'));var Mustache=require(_0x7fff('0x5'));var util=require(_0x7fff('0x6'));var path=require(_0x7fff('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7fff('0x8'));var Redis=require(_0x7fff('0x9'));var interaction=require(_0x7fff('0xa'));var qs=require(_0x7fff('0xb'));var pdf=require(_0x7fff('0xc'));var logger=require(_0x7fff('0xd'))(_0x7fff('0xe'));var config=require(_0x7fff('0xf'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7fff('0x10')](config[_0x7fff('0x11')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7fff('0x11')]));require(_0x7fff('0x12'))[_0x7fff('0x13')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7fff('0x14')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x3173c9,_0x23cab8,_0x2009df,_0x55a2d5){return new BPromise(function(_0x2fef2d,_0x5e9446){var _0x34dc86=_0x55a2d5||client;return _0x34dc86[_0x7fff('0x15')](_0x3173c9,_0x2009df)['then'](function(_0x1a7cb8){logger[_0x7fff('0x16')](_0x7fff('0x17'),_0x23cab8,_0x7fff('0x18'));logger[_0x7fff('0x19')](_0x7fff('0x1a'),_0x23cab8,_0x7fff('0x18'),JSON['stringify'](_0x1a7cb8));if(_0x1a7cb8[_0x7fff('0x1b')]){if(_0x1a7cb8[_0x7fff('0x1b')][_0x7fff('0x1c')]===0x1f4){logger[_0x7fff('0x1b')](_0x7fff('0x17'),_0x23cab8,_0x1a7cb8[_0x7fff('0x1b')]['message']);return _0x5e9446(_0x1a7cb8[_0x7fff('0x1b')][_0x7fff('0x1d')]);}logger[_0x7fff('0x1b')](_0x7fff('0x17'),_0x23cab8,_0x1a7cb8[_0x7fff('0x1b')][_0x7fff('0x1d')]);return _0x2fef2d(_0x1a7cb8[_0x7fff('0x1b')][_0x7fff('0x1d')]);}else{logger['info'](_0x7fff('0x17'),_0x23cab8,_0x7fff('0x18'));_0x2fef2d(_0x1a7cb8['result']['message']);}})[_0x7fff('0x1e')](function(_0x2473f6){logger[_0x7fff('0x1b')](_0x7fff('0x17'),_0x23cab8,_0x2473f6);_0x5e9446(_0x2473f6);});});}function respondWithStatusCode(_0x408b8b,_0xe00102){_0xe00102=_0xe00102||0xcc;return function(_0x1c21db){if(_0x1c21db){return _0x408b8b[_0x7fff('0x1f')](_0xe00102);}return _0x408b8b[_0x7fff('0x20')](_0xe00102)[_0x7fff('0x21')]();};}function respondWithResult(_0x3b3300,_0x1cbc11){_0x1cbc11=_0x1cbc11||0xc8;return function(_0x594cdc){if(_0x594cdc){return _0x3b3300[_0x7fff('0x20')](_0x1cbc11)[_0x7fff('0x22')](_0x594cdc);}};}function respondWithFilteredResult(_0x496645,_0x4c19ef){return function(_0xc8c6af){if(_0xc8c6af){var _0x391611=typeof _0x4c19ef[_0x7fff('0x23')]===_0x7fff('0x24')&&typeof _0x4c19ef[_0x7fff('0x25')]===_0x7fff('0x24');var _0x26ac9c=_0xc8c6af['count'];var _0x2e0b3f=_0x391611?0x0:_0x4c19ef[_0x7fff('0x23')];var _0x490aea=_0x391611?_0xc8c6af['count']:_0x4c19ef[_0x7fff('0x23')]+_0x4c19ef[_0x7fff('0x25')];var _0x2a8fdf;if(_0x490aea>=_0x26ac9c){_0x490aea=_0x26ac9c;_0x2a8fdf=0xc8;}else{_0x2a8fdf=0xce;}_0x496645['status'](_0x2a8fdf);return _0x496645[_0x7fff('0x26')](_0x7fff('0x27'),_0x2e0b3f+'-'+_0x490aea+'/'+_0x26ac9c)['json'](_0xc8c6af);}return null;};}function saveUpdates(_0x49e7b3){return function(_0x1349f1){if(_0x1349f1){return _0x1349f1['update'](_0x49e7b3)['then'](function(_0x3cf50c){return _0x3cf50c;});}return null;};}function removeEntity(_0x281d73){return function(_0x514496){if(_0x514496){return _0x514496[_0x7fff('0x28')]()[_0x7fff('0x29')](function(){_0x281d73[_0x7fff('0x20')](0xcc)[_0x7fff('0x21')]();});}};}function handleEntityNotFound(_0x1b9b0b){return function(_0x12dd0b){if(!_0x12dd0b){_0x1b9b0b[_0x7fff('0x1f')](0x194);}return _0x12dd0b;};}function handleError(_0xd7b598,_0x168748){_0x168748=_0x168748||0x1f4;return function(_0x45910e){logger[_0x7fff('0x1b')](_0x45910e[_0x7fff('0x2a')]);if(_0x45910e[_0x7fff('0x2b')]){delete _0x45910e[_0x7fff('0x2b')];}_0xd7b598[_0x7fff('0x20')](_0x168748)[_0x7fff('0x2c')](_0x45910e);};}function getMustacheRender(_0x31aa1e,_0xbe71d8){return Mustache[_0x7fff('0x2d')](_0x31aa1e,_[_0x7fff('0x2e')](_0xbe71d8[_0x7fff('0x2f')],{'contact':_0xbe71d8[_0x7fff('0x30')],'message':_0xbe71d8['message'],'agent':_0xbe71d8[_0x7fff('0x31')],'interaction':_0xbe71d8[_0x7fff('0x32')],'account':_0xbe71d8[_0x7fff('0x33')]}))||'';}exports[_0x7fff('0x34')]=function(_0x2f785a,_0x485d2f){var _0x3fd41e={};var _0x3f0c9c=_[_0x7fff('0x35')](db['ChatInteraction']['rawAttributes'],function(_0x15e0b3){return{'name':_0x15e0b3[_0x7fff('0x36')],'type':_0x15e0b3[_0x7fff('0x37')][_0x7fff('0x38')]};});_0x3fd41e=qs['getOptions'](_0x3f0c9c,_0x2f785a);return interaction[_0x7fff('0x39')](_0x7fff('0x3a'),_0x2f785a[_0x7fff('0x3b')],_0x2f785a[_0x7fff('0x3c')],_0x3fd41e,_0x3f0c9c)['then'](respondWithFilteredResult(_0x485d2f,_0x3fd41e))['catch'](handleError(_0x485d2f,null));};exports[_0x7fff('0x3d')]=function(_0x155eac,_0x33ce23){var _0xec44={'raw':![],'where':{'id':_0x155eac[_0x7fff('0x3e')]['id']}},_0x5e33f8={};_0x5e33f8['model']=_[_0x7fff('0x3f')](db['ChatInteraction'][_0x7fff('0x40')]);_0x5e33f8[_0x7fff('0x3b')]=_['keys'](_0x155eac['query']);_0x5e33f8[_0x7fff('0x41')]=_[_0x7fff('0x42')](_0x5e33f8['model'],_0x5e33f8['query']);_0xec44[_0x7fff('0x43')]=_['intersection'](_0x5e33f8[_0x7fff('0x44')],qs[_0x7fff('0x45')](_0x155eac['query'][_0x7fff('0x45')]));_0xec44[_0x7fff('0x43')]=_0xec44[_0x7fff('0x43')][_0x7fff('0x46')]?_0xec44[_0x7fff('0x43')]:_0x5e33f8[_0x7fff('0x44')];if(_0x155eac[_0x7fff('0x3b')][_0x7fff('0x47')]){_0xec44[_0x7fff('0x48')]=[{'all':!![]}];}_0xec44=_['merge']({},_0xec44,_0x155eac[_0x7fff('0x49')]);return db[_0x7fff('0x4a')][_0x7fff('0x4b')](_0xec44)[_0x7fff('0x29')](handleEntityNotFound(_0x33ce23,null))[_0x7fff('0x29')](respondWithResult(_0x33ce23,null))[_0x7fff('0x1e')](handleError(_0x33ce23,null));};exports[_0x7fff('0x4c')]=function(_0x21c33b,_0x3c7f28){return db['ChatInteraction'][_0x7fff('0x4c')](_0x21c33b[_0x7fff('0x2f')],{})[_0x7fff('0x29')](respondWithResult(_0x3c7f28,0xc9))[_0x7fff('0x1e')](handleError(_0x3c7f28,null));};exports[_0x7fff('0x4d')]=function(_0x343ec3,_0x428d59){if(_0x343ec3[_0x7fff('0x2f')]['id']){delete _0x343ec3['body']['id'];}return db['ChatInteraction'][_0x7fff('0x4b')]({'where':{'id':_0x343ec3[_0x7fff('0x3e')]['id']}})['then'](handleEntityNotFound(_0x428d59,null))['then'](saveUpdates(_0x343ec3[_0x7fff('0x2f')],null))[_0x7fff('0x29')](respondWithResult(_0x428d59,null))[_0x7fff('0x1e')](handleError(_0x428d59,null));};exports[_0x7fff('0x28')]=function(_0x3c55f8,_0x447bdb){return db[_0x7fff('0x4a')][_0x7fff('0x4b')]({'where':{'id':_0x3c55f8[_0x7fff('0x3e')]['id']}})[_0x7fff('0x29')](handleEntityNotFound(_0x447bdb,null))['then'](removeEntity(_0x447bdb,null))['catch'](handleError(_0x447bdb,null));};exports[_0x7fff('0x4e')]=function(_0x28cfea,_0x2dc272){return db[_0x7fff('0x4a')]['describe']()[_0x7fff('0x29')](respondWithResult(_0x2dc272,null))[_0x7fff('0x1e')](handleError(_0x2dc272,null));};exports['createVidaooSession']=function(_0x2bf4a6,_0x55fa3e){var _0x292e93=_0x2bf4a6['params']['id'];var _0x1bf1d0;var _0x14426f;var _0x5c0961;return db[_0x7fff('0x4a')]['findOne']({'where':{'id':_0x292e93}})['then'](function(_0x36f3a4){_0x1bf1d0=_0x36f3a4;return db[_0x7fff('0x4f')][_0x7fff('0x50')]({'where':{'id':_0x36f3a4[_0x7fff('0x51')]},'attributes':['id',_0x7fff('0x52'),'vidaooEscalation',_0x7fff('0x53'),_0x7fff('0x54'),'vidaooMetadata'],'raw':!![]});})[_0x7fff('0x29')](function(_0x594e1b){if(_0x594e1b&&_0x594e1b[_0x7fff('0x52')]&&_0x594e1b[_0x7fff('0x55')]){_0x14426f=_0x594e1b;var _0x3396d2={'interaction':{'id':_0x292e93},'agent':{'id':_0x2bf4a6[_0x7fff('0x3c')]['id'],'name':_0x2bf4a6[_0x7fff('0x3c')][_0x7fff('0x2b')],'fullname':_0x2bf4a6[_0x7fff('0x3c')][_0x7fff('0x56')],'email':_0x2bf4a6[_0x7fff('0x3c')][_0x7fff('0x57')]},'contact':_0x2bf4a6[_0x7fff('0x2f')][_0x7fff('0x30')],'account':_0x2bf4a6[_0x7fff('0x2f')][_0x7fff('0x33')]};var _0x5929c1={'rejectUnauthorized':![],'method':_0x7fff('0x58'),'url':_0x7fff('0x59'),'headers':{'X-APIKEY':_0x594e1b[_0x7fff('0x52')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2bf4a6[_0x7fff('0x3c')][_0x7fff('0x57')]],'buttons':null,'topic':_0x14426f[_0x7fff('0x53')],'note':_[_0x7fff('0x5a')](_0x14426f['vidaooNote'])?null:getMustacheRender(_0x14426f['vidaooNote'],_0x3396d2),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x7fff('0x5a')](_0x14426f['vidaooMetadata'])){var _0x464a0a=getMustacheRender(_0x14426f['vidaooMetadata'],_0x3396d2);var _0xaebe30=JSON[_0x7fff('0x5b')](_0x464a0a);_0x5929c1[_0x7fff('0x2f')]['metadata']=_0xaebe30;}}catch(_0x4ac08b){throw new db['Sequelize'][(_0x7fff('0x5c'))](_0x7fff('0x5d'));}return rp(_0x5929c1);}else{throw new db['Sequelize']['ValidationError'](_0x7fff('0x5e'));}})['then'](function(_0x41ec9a){_0x5c0961=_0x41ec9a;if(_0x5c0961['id']){var _0x1a8e7e={'body':_0x5c0961['join_url'],'ChatWebsiteId':_0x14426f['id'],'ChatInteractionId':_0x1bf1d0['id'],'direction':'out','UserId':_0x2bf4a6[_0x7fff('0x3c')]['id']};return db[_0x7fff('0x5f')][_0x7fff('0x4c')](_0x1a8e7e,{});}else{throw new db[(_0x7fff('0x60'))]['ValidationError'](_0x7fff('0x61'));}})[_0x7fff('0x29')](function(){return _0x1bf1d0[_0x7fff('0x62')]({'vidaooSessionId':_0x5c0961['id']});})['then'](respondWithResult(_0x55fa3e,null))['catch'](handleError(_0x55fa3e,null));};exports[_0x7fff('0x63')]=function(_0x531331,_0x31ed3b){if(_0x531331['body']['id']){delete _0x531331[_0x7fff('0x2f')]['id'];}return db[_0x7fff('0x4a')][_0x7fff('0x4b')]({'where':{'id':_0x531331['params']['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x7fff('0x29')](handleEntityNotFound(_0x31ed3b,null))[_0x7fff('0x29')](saveUpdates(_0x531331['body'],null))['then'](respondWithResult(_0x31ed3b,null))[_0x7fff('0x1e')](handleError(_0x31ed3b,null));};exports['abandon']=function(_0x365a36,_0xc84c15){if(_0x365a36['body']['id']){delete _0x365a36[_0x7fff('0x2f')]['id'];}return db[_0x7fff('0x4a')][_0x7fff('0x4b')]({'where':{'id':_0x365a36[_0x7fff('0x3e')]['id']}})[_0x7fff('0x29')](function(_0x28d6a1){if(!_0x28d6a1){logger[_0x7fff('0x1b')](_0x7fff('0x64'),'abandon',0x194,_0x7fff('0x65'));_0xc84c15[_0x7fff('0x1f')](0x194);}else{if(_0x28d6a1[_0x7fff('0x66')]){throw new db[(_0x7fff('0x60'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x28d6a1;})[_0x7fff('0x29')](function(_0x44bffa){if(_0x44bffa){return _0x44bffa[_0x7fff('0x4d')]({'closed':_0x365a36[_0x7fff('0x2f')][_0x7fff('0x67')],'disposition':_0x365a36[_0x7fff('0x2f')][_0x7fff('0x68')]})['then'](function(_0x340022){return _0x340022;});}})[_0x7fff('0x29')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x365a36[_0x7fff('0x2f')],client9004);})[_0x7fff('0x29')](respondWithResult(_0xc84c15,null))[_0x7fff('0x1e')](handleError(_0xc84c15,null));};exports[_0x7fff('0x69')]=function(_0x1f033a,_0x406d42){_0x1f033a['body'][_0x7fff('0x2b')]=_0x1f033a[_0x7fff('0x6a')][_0x7fff('0x6b')];_0x1f033a['body'][_0x7fff('0x6c')]=_0x1f033a['file'][_0x7fff('0x6d')];_0x1f033a['body'][_0x7fff('0x37')]=_0x1f033a[_0x7fff('0x6a')][_0x7fff('0x6e')];return db['Attachment']['create'](_0x1f033a['body'])[_0x7fff('0x29')](respondWithResult(_0x406d42,0xc9))[_0x7fff('0x1e')](handleError(_0x406d42,null));};exports['attachmentDownload']=function(_0x1fafdd,_0x53db10){return db['ChatInteraction'][_0x7fff('0x50')]({'where':{'id':_0x1fafdd['params']['id']},'raw':!![]})[_0x7fff('0x29')](handleEntityNotFound(_0x53db10,null))[_0x7fff('0x29')](function(_0x30258f){if(_0x30258f){if(_0x30258f[_0x7fff('0x67')]){return _0x53db10['status'](0x193)['json']({'status':0x193,'message':_0x7fff('0x6f')});}return db[_0x7fff('0x70')]['findOne']({'where':{'id':_0x1fafdd['query']['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x53db10,null));}})[_0x7fff('0x29')](function(_0x27ae53){if(_0x27ae53){var _0xeaf5f4=_0x27ae53[_0x7fff('0x71')]!==null;var _0x4e9124=path[_0x7fff('0x72')](config[_0x7fff('0x73')],_0x7fff('0x74'));if(_0xeaf5f4){_0x4e9124=path[_0x7fff('0x72')](_0x4e9124,'offline-chat/');}var _0x103109=path['join'](_0x4e9124,_0x27ae53[_0x7fff('0x6c')]);return _0x53db10[_0x7fff('0x75')](_0x103109);}})[_0x7fff('0x1e')](handleError(_0x53db10,null));};exports[_0x7fff('0x76')]=function(_0x131392,_0x2c552c){var _0x1a8931=null;var _0x3d367c=null;var _0x267f78=null;if(_0x131392[_0x7fff('0x2f')]['id']){delete _0x131392[_0x7fff('0x2f')]['id'];}if(_0x131392[_0x7fff('0x2f')]['mailTranscript']){_0x267f78=path[_0x7fff('0x72')](config['root'],_0x7fff('0x77'),util[_0x7fff('0x78')]('transcript-%s.txt',Date[_0x7fff('0x79')]()));_0x131392[_0x7fff('0x2f')][_0x7fff('0x7a')]=_0x267f78;}return db[_0x7fff('0x4a')][_0x7fff('0x4b')]({'where':{'id':_0x131392[_0x7fff('0x3e')]['id']},'include':[{'model':db[_0x7fff('0x5f')],'as':_0x7fff('0x7b'),'include':[{'model':db[_0x7fff('0x7c')],'as':_0x7fff('0x7c')}]}]})[_0x7fff('0x29')](handleEntityNotFound(_0x2c552c,null))[_0x7fff('0x29')](saveUpdates(_0x131392[_0x7fff('0x2f')],null))['then'](function(_0x3d991c){if(_0x3d991c){_0x1a8931=_0x3d991c;return db[_0x7fff('0x4f')][_0x7fff('0x4b')]({'where':{'id':_0x1a8931[_0x7fff('0x51')]}});}})[_0x7fff('0x29')](function(_0x2c76fd){if(_0x2c76fd){_0x3d367c=_0x2c76fd;return db[_0x7fff('0x7d')][_0x7fff('0x4b')]({'where':{'id':_0x1a8931['ContactId']}});}})[_0x7fff('0x29')](function(_0x2cdc5b){if(_0x2cdc5b){if(_0x267f78){var _0x44fd2c=null;for(var _0xdc32dd=0x1;_0xdc32dd<_0x1a8931['Messages'][_0x7fff('0x46')];++_0xdc32dd){_0x44fd2c=_0x1a8931[_0x7fff('0x7b')][_0xdc32dd];var _0x5ef227=_0x44fd2c['UserId']?util[_0x7fff('0x78')](_0x7fff('0x7e'),_0x3d367c[_0x7fff('0x7f')],_0x44fd2c[_0x7fff('0x66')]):'System';var _0x2054c6=_0x131392[_0x7fff('0x2f')][_0x7fff('0x80')]||util[_0x7fff('0x78')](_0x7fff('0x7e'),'Visitor',_0x44fd2c[_0x7fff('0x81')]);switch(_0x3d367c[_0x7fff('0x82')]){case'website_alias':_0x5ef227=_0x44fd2c[_0x7fff('0x66')]?util['format'](_0x7fff('0x7e'),_0x3d367c[_0x7fff('0x7f')],_0x44fd2c['UserId']):'System';break;case _0x7fff('0x83'):_0x5ef227=_0x44fd2c[_0x7fff('0x66')]?_0x44fd2c[_0x7fff('0x7c')][_0x7fff('0x84')]||_0x44fd2c[_0x7fff('0x7c')][_0x7fff('0x56')]:_0x7fff('0x85');break;case'agent_fullname':_0x5ef227=_0x44fd2c[_0x7fff('0x66')]?_0x44fd2c['User'][_0x7fff('0x56')]:_0x7fff('0x85');break;default:_0x5ef227=_0x44fd2c[_0x7fff('0x66')]?util['format'](_0x7fff('0x7e'),_0x3d367c[_0x7fff('0x7f')],_0x44fd2c[_0x7fff('0x66')]):_0x7fff('0x85');}var _0x23ba0c=util[_0x7fff('0x78')](_0x7fff('0x86'),moment(_0x44fd2c['createdAt'])[_0x7fff('0x78')]('MM/DD/YYYY\x20HH:mm:ss'),_0x44fd2c[_0x7fff('0x87')]==='in'?_0x2054c6:_0x5ef227,_0x44fd2c[_0x7fff('0x2f')]);if(!_0x44fd2c[_0x7fff('0x88')]){fs[_0x7fff('0x89')](_0x267f78,_0x23ba0c);}}return db[_0x7fff('0x8a')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x7fff('0x8b')],'as':_0x7fff('0x8c'),'raw':!![],'include':[{'model':db[_0x7fff('0x8d')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x7fff('0x29')](function(_0x13c07e){if(!_0x13c07e||!_0x13c07e['Smtp']||!_0x131392[_0x7fff('0x2f')])return _0x1a8931;var _0x4381df=_0x13c07e['getSmtpOptions']();return respondWithRpcPromise(_0x7fff('0x8e'),_0x7fff('0x8f'),{'account':_0x4381df,'message':{'from':util[_0x7fff('0x78')](_0x7fff('0x90'),_0x13c07e[_0x7fff('0x2b')],_0x13c07e[_0x7fff('0x57')]||_0x13c07e[_0x7fff('0x8c')][_0x7fff('0x3c')]),'to':_0x131392['body']['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x7fff('0x78')](_0x7fff('0x91'),_0x131392[_0x7fff('0x2f')][_0x7fff('0x92')]),'attachments':[{'path':_0x267f78}]}})[_0x7fff('0x29')](function(){return _0x1a8931;})[_0x7fff('0x1e')](function(_0x5f7bb0){logger[_0x7fff('0x1b')](_0x5f7bb0);});})[_0x7fff('0x29')](respondWithStatusCode(_0x2c552c,0xc8))['catch'](handleError(_0x2c552c,null));};exports['addMessage']=function(_0x5f5ad3,_0x17dbc2){return db[_0x7fff('0x5f')]['find']({'where':{'id':_0x5f5ad3[_0x7fff('0x3e')]['id']}})[_0x7fff('0x29')](handleEntityNotFound(_0x17dbc2,null))[_0x7fff('0x29')](function(_0x2b88d4){if(_0x2b88d4){return _0x2b88d4['addMessage'](_0x5f5ad3['body'][_0x7fff('0x93')],_['omit'](_0x5f5ad3['body'],['ids','id'])||{});}})[_0x7fff('0x29')](respondWithResult(_0x17dbc2,null))[_0x7fff('0x1e')](handleError(_0x17dbc2,null));};exports[_0x7fff('0x94')]=function(_0x4f0e51,_0x54b4e2){var _0x1771ad={'raw':![],'where':{}};var _0x406aa6={};var _0x607e4d={'count':0x0,'rows':[]};return db[_0x7fff('0x4a')]['findOne']({'where':{'id':_0x4f0e51['params']['id']}})[_0x7fff('0x29')](handleEntityNotFound(_0x54b4e2,null))[_0x7fff('0x29')](function(_0x22a481){if(_0x22a481){_0x406aa6[_0x7fff('0x44')]=_[_0x7fff('0x3f')](db['ChatMessage'][_0x7fff('0x40')]);_0x406aa6[_0x7fff('0x3b')]=_[_0x7fff('0x3f')](_0x4f0e51['query']);_0x406aa6[_0x7fff('0x41')]=_[_0x7fff('0x42')](_0x406aa6[_0x7fff('0x44')],_0x406aa6[_0x7fff('0x3b')]);_0x1771ad[_0x7fff('0x43')]=_[_0x7fff('0x42')](_0x406aa6[_0x7fff('0x44')],qs['fields'](_0x4f0e51[_0x7fff('0x3b')][_0x7fff('0x45')]));_0x1771ad[_0x7fff('0x43')]=_0x1771ad['attributes'][_0x7fff('0x46')]?_0x1771ad[_0x7fff('0x43')]:_0x406aa6[_0x7fff('0x44')];if(!_0x4f0e51[_0x7fff('0x3b')][_0x7fff('0x95')]('nolimit')){_0x1771ad[_0x7fff('0x25')]=qs['limit'](_0x4f0e51['query'][_0x7fff('0x25')]);_0x1771ad['offset']=qs[_0x7fff('0x23')](_0x4f0e51[_0x7fff('0x3b')][_0x7fff('0x23')]);}_0x1771ad['order']=qs['sort'](_0x4f0e51[_0x7fff('0x3b')][_0x7fff('0x96')]);_0x1771ad['where']=qs[_0x7fff('0x41')](_[_0x7fff('0x97')](_0x4f0e51[_0x7fff('0x3b')],_0x406aa6[_0x7fff('0x41')]));_0x1771ad[_0x7fff('0x98')][_0x7fff('0x99')]=_0x22a481['id'];if(_0x4f0e51[_0x7fff('0x3b')][_0x7fff('0x9a')]){_0x1771ad[_0x7fff('0x98')]=_['merge'](_0x1771ad[_0x7fff('0x98')],{'$or':_[_0x7fff('0x35')](_0x1771ad[_0x7fff('0x43')],function(_0x6f67ce){var _0x5083c7={};_0x5083c7[_0x6f67ce]={'$like':'%'+_0x4f0e51[_0x7fff('0x3b')][_0x7fff('0x9a')]+'%'};return _0x5083c7;})});}if(_0x4f0e51['query'][_0x7fff('0x9b')]){var _0x1ae7ee=_0x4f0e51[_0x7fff('0x3b')]['$gte'][_0x7fff('0x9c')](',');var _0x58d4de={};_0x58d4de[_0x1ae7ee[0x0]]={'$gte':moment(_0x1ae7ee[0x1])[_0x7fff('0x78')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1771ad[_0x7fff('0x98')]=_[_0x7fff('0x2e')](_0x1771ad[_0x7fff('0x98')],_0x58d4de);}_0x1771ad=_[_0x7fff('0x2e')]({},_0x1771ad,_0x4f0e51[_0x7fff('0x49')]);return db['ChatMessage']['count']({'where':_0x1771ad[_0x7fff('0x98')]})[_0x7fff('0x29')](function(_0x3c6fdd){_0x607e4d[_0x7fff('0x9d')]=_0x3c6fdd;if(_0x4f0e51[_0x7fff('0x3b')][_0x7fff('0x47')]){_0x1771ad[_0x7fff('0x48')]=[{'all':!![]}];}return db[_0x7fff('0x5f')][_0x7fff('0x39')](_0x1771ad);})['then'](function(_0x5668b9){_0x607e4d[_0x7fff('0x9e')]=_0x5668b9;return _0x607e4d;});}})['then'](respondWithFilteredResult(_0x54b4e2,_0x1771ad))[_0x7fff('0x1e')](handleError(_0x54b4e2,null));};exports['getMyMessages']=function(_0x4afdbc,_0x1a5b16){var _0x267ed2={'where':{}},_0x1e4c7f={},_0x5d7cb7={'count':0x0,'rows':[]};return db[_0x7fff('0x4a')][_0x7fff('0x50')]({'where':{'id':_0x4afdbc['params']['id']}})[_0x7fff('0x29')](handleEntityNotFound(_0x1a5b16,null))[_0x7fff('0x29')](function(_0x301788){if(_0x301788){_0x1e4c7f['model']=_['keys'](db['ChatMessage'][_0x7fff('0x40')]);_0x1e4c7f[_0x7fff('0x3b')]=_[_0x7fff('0x3f')](_0x4afdbc[_0x7fff('0x3b')]);_0x1e4c7f[_0x7fff('0x41')]=_[_0x7fff('0x42')](_0x1e4c7f[_0x7fff('0x44')],_0x1e4c7f[_0x7fff('0x3b')]);_0x267ed2['attributes']=_[_0x7fff('0x42')](_0x1e4c7f[_0x7fff('0x44')],qs['fields'](_0x4afdbc[_0x7fff('0x3b')]['fields']));_0x267ed2['attributes']=_0x267ed2[_0x7fff('0x43')][_0x7fff('0x46')]?_0x267ed2[_0x7fff('0x43')]:_0x1e4c7f[_0x7fff('0x44')];if(!_0x4afdbc[_0x7fff('0x3b')]['hasOwnProperty'](_0x7fff('0x9f'))){_0x267ed2['limit']=qs['limit'](_0x4afdbc[_0x7fff('0x3b')]['limit']);_0x267ed2['offset']=qs[_0x7fff('0x23')](_0x4afdbc[_0x7fff('0x3b')][_0x7fff('0x23')]);}_0x267ed2[_0x7fff('0xa0')]=qs[_0x7fff('0x96')](_0x4afdbc[_0x7fff('0x3b')][_0x7fff('0x96')]);_0x267ed2[_0x7fff('0x98')]=qs[_0x7fff('0x41')](_[_0x7fff('0x97')](_0x4afdbc[_0x7fff('0x3b')],_0x1e4c7f['filters']));_0x267ed2['where'][_0x7fff('0x99')]=_0x301788['id'];if(_0x4afdbc[_0x7fff('0x3b')][_0x7fff('0x9a')]){_0x267ed2[_0x7fff('0x98')]=_[_0x7fff('0x2e')](_0x267ed2['where'],{'$or':_['map'](_0x267ed2[_0x7fff('0x43')],function(_0x472859){var _0x3d5ff8={};_0x3d5ff8[_0x472859]={'$like':'%'+_0x4afdbc[_0x7fff('0x3b')][_0x7fff('0x9a')]+'%'};return _0x3d5ff8;})});}_0x267ed2[_0x7fff('0x98')]['secret']=![];if(_0x4afdbc[_0x7fff('0x3b')]['id']){_0x267ed2[_0x7fff('0x98')]['id']={'$gt':_0x4afdbc['query']['id']};}_0x267ed2=_[_0x7fff('0x2e')]({},_0x267ed2,_0x4afdbc[_0x7fff('0x49')]);return db[_0x7fff('0x5f')][_0x7fff('0x9d')]({'where':_0x267ed2[_0x7fff('0x98')]})['then'](function(_0x2f2ac7){_0x5d7cb7['count']=_0x2f2ac7;_0x267ed2[_0x7fff('0x48')]=[];if(_0x4afdbc[_0x7fff('0x3b')][_0x7fff('0xa1')]){_0x267ed2[_0x7fff('0x48')][_0x7fff('0xa2')]({'model':db['User'],'as':_0x7fff('0x7c'),'attributes':['id',_0x7fff('0x56'),_0x7fff('0x84')]});}if(_0x4afdbc['query']['includeAll']){_0x267ed2[_0x7fff('0x48')]=[{'all':!![]}];}return db[_0x7fff('0x5f')][_0x7fff('0x39')](_0x267ed2);})['then'](function(_0x4a8f98){_0x5d7cb7[_0x7fff('0x9e')]=_0x4a8f98;return _0x5d7cb7;});}})['then'](respondWithFilteredResult(_0x1a5b16,_0x267ed2))[_0x7fff('0x1e')](handleError(_0x1a5b16,null));};exports['addTags']=function(_0x4b1dcd,_0x520b84){return db[_0x7fff('0x4a')][_0x7fff('0x4b')]({'where':{'id':_0x4b1dcd[_0x7fff('0x3e')]['id']}})[_0x7fff('0x29')](handleEntityNotFound(_0x520b84,null))[_0x7fff('0x29')](function(_0x43fb79){if(_0x43fb79){return _0x43fb79[_0x7fff('0xa3')](_0x4b1dcd['body']['ids'],_[_0x7fff('0xa4')](_0x4b1dcd['body'],[_0x7fff('0x93'),'id'])||{})[_0x7fff('0xa5')](function(){return db[_0x7fff('0xa6')]['findAll']({'attributes':['id',_0x7fff('0x2b'),_0x7fff('0xa7')],'where':{'id':_0x4b1dcd[_0x7fff('0x2f')][_0x7fff('0x93')]}});})['then'](function(_0x2e47ae){socket[_0x7fff('0xa8')](_0x7fff('0xa9'),{'id':Number(_0x4b1dcd[_0x7fff('0x3e')]['id']),'tags':_0x2e47ae||[]});return{'id':Number(_0x4b1dcd[_0x7fff('0x3e')]['id']),'tags':_0x2e47ae||[]};});}})[_0x7fff('0x29')](respondWithResult(_0x520b84,null))[_0x7fff('0x1e')](handleError(_0x520b84,null));};exports[_0x7fff('0xaa')]=function(_0x4db5de,_0x85136b){return db['ChatInteraction'][_0x7fff('0x4b')]({'where':{'id':_0x4db5de[_0x7fff('0x3e')]['id']}})[_0x7fff('0x29')](handleEntityNotFound(_0x85136b,null))[_0x7fff('0x29')](function(_0x5ab450){if(_0x5ab450){return _0x5ab450['removeTags'](_0x4db5de[_0x7fff('0x3b')][_0x7fff('0x93')]);}})[_0x7fff('0x29')](respondWithStatusCode(_0x85136b,null))[_0x7fff('0x1e')](handleError(_0x85136b,null));};exports[_0x7fff('0x75')]=function(_0x3cf840,_0x261a43){var _0x1b4479=moment()[_0x7fff('0xab')]()[_0x7fff('0xac')]();var _0x1c30f4=path['join'](config[_0x7fff('0x73')],_0x7fff('0xad'),'files',_0x7fff('0xae'));var _0x24c334=path[_0x7fff('0x72')](config['root'],_0x7fff('0xad'),_0x7fff('0xaf'),_0x7fff('0xb0'));var _0x50be2e=path['join'](_0x1c30f4,_0x1b4479);var _0x2622da=util['format'](_0x7fff('0xb1'),_0x3cf840['params']['id'],_0x1b4479);var _0x159c79=path[_0x7fff('0x72')](_0x1c30f4,_0x2622da);var _0x21b94e=[];_0x21b94e[_0x7fff('0xa2')]({'model':db['User'],'as':_0x7fff('0x7c'),'attributes':['id',_0x7fff('0x56')],'raw':!![]});_0x21b94e['push']({'model':db[_0x7fff('0x7d')],'as':'Contact','attributes':['id',_0x7fff('0xb2'),'lastName'],'raw':!![]});if(_0x3cf840['query'][_0x7fff('0xb0')]){_0x21b94e[_0x7fff('0xa2')]({'model':db[_0x7fff('0x70')],'as':'Attachment','raw':!![]});}var _0x33ba6a=[{'model':db[_0x7fff('0x5f')],'as':'Messages','attributes':['id',_0x7fff('0x2f'),_0x7fff('0xb3'),_0x7fff('0x87'),_0x7fff('0x88'),_0x7fff('0xb4')],'include':_0x21b94e}];_0x33ba6a[_0x7fff('0xa2')]({'model':db[_0x7fff('0x4f')],'as':'Account','attributes':['id',_0x7fff('0x2b')]});_0x33ba6a['push']({'model':db[_0x7fff('0x7c')],'as':_0x7fff('0xb5'),'attributes':['id',_0x7fff('0x56')]});return db[_0x7fff('0x4a')][_0x7fff('0x4b')]({'where':{'id':_0x3cf840[_0x7fff('0x3e')]['id']},'include':_0x33ba6a})[_0x7fff('0x29')](handleEntityNotFound(_0x261a43,null))[_0x7fff('0x29')](function(_0x3f17bd){if(_0x3f17bd){var _0x1b3581=_0x3f17bd[_0x7fff('0xb6')]({'plain':!![]});fs[_0x7fff('0xb7')](_0x50be2e);var _0x4bc558={'channel':_0x7fff('0xb8'),'account':_0x1b3581[_0x7fff('0xb9')]['name'],'agent':_0x1b3581[_0x7fff('0xb5')]?_0x1b3581[_0x7fff('0xb5')]['fullname']:_0x7fff('0xba'),'createdAt':moment(_0x1b3581['createdAt'])[_0x7fff('0x78')](_0x7fff('0xbb'))['toString'](),'closedAt':_0x1b3581[_0x7fff('0x67')]?moment(_0x1b3581[_0x7fff('0xbc')])['format'](_0x7fff('0xbb'))['toString']():'','disposition':_0x1b3581[_0x7fff('0x68')],'chatInfo':{'browser':_0x1b3581[_0x7fff('0xbd')],'os':_0x1b3581[_0x7fff('0xbe')],'referer':_0x1b3581[_0x7fff('0xbf')],'customerIp':_0x1b3581[_0x7fff('0xc0')],'customerPort':_0x1b3581[_0x7fff('0xc1')]?_0x1b3581['customerPort']:_0x7fff('0xba')},'messages':_(_0x1b3581[_0x7fff('0x7b')])[_0x7fff('0xc2')]()['filter']({'secret':![]})[_0x7fff('0x35')](function(_0x1bc8ab){if(_0x1bc8ab['Attachment']){var _0x2b2d71=path[_0x7fff('0x72')](_0x24c334,_0x1bc8ab['Attachment'][_0x7fff('0x6c')]);if(fs[_0x7fff('0xc3')](_0x2b2d71)){fs['createReadStream'](_0x2b2d71)[_0x7fff('0xc4')](fs[_0x7fff('0xc5')](path['join'](_0x50be2e,_0x1bc8ab[_0x7fff('0x70')][_0x7fff('0x6c')])));}}return{'date':moment(_0x1bc8ab[_0x7fff('0xb3')])[_0x7fff('0x78')](_0x7fff('0xbb'))[_0x7fff('0xac')](),'sender':_0x1bc8ab[_0x7fff('0x87')]===_0x7fff('0xc6')?_0x1bc8ab['User']?_0x1bc8ab[_0x7fff('0x7c')]['fullname']:_0x7fff('0x85'):_0x1bc8ab[_0x7fff('0xc7')][_0x7fff('0xb2')]+(_0x1bc8ab[_0x7fff('0xc7')][_0x7fff('0xc8')]?'\x20'+_0x1bc8ab[_0x7fff('0xc7')][_0x7fff('0xc8')]:''),'body':_0x1bc8ab[_0x7fff('0x70')]?_0x1bc8ab[_0x7fff('0x70')]['basename']:_0x1bc8ab[_0x7fff('0x2f')],'direction':_0x1bc8ab[_0x7fff('0x87')]===_0x7fff('0xc6')?'A':'C','secret':_0x1bc8ab[_0x7fff('0x88')],'read':_0x1bc8ab[_0x7fff('0xb4')],'attachment':_0x1bc8ab[_0x7fff('0x70')]};})['value']()};return ejs['renderFile'](path[_0x7fff('0x72')](config[_0x7fff('0x73')],_0x7fff('0xad'),_0x7fff('0xc9'),_0x7fff('0xca')),{'interaction':_0x4bc558})['then'](function(_0x504d4d){var _0x3e1159=path['join'](_0x50be2e,_0x7fff('0xcb')+_0x1b3581['id']+'-'+_0x1b4479+_0x7fff('0xcc'));var _0x433c4e={'path':_0x3e1159,'channel':_0x7fff('0xb8'),'interactionId':_0x1b3581['id']};return pdf['createPdfFromHTML'](_0x504d4d,_0x433c4e);})[_0x7fff('0x29')](function(){return new Promise(function(_0x3ca6db,_0x1481bb){zipdir(_0x50be2e,{'saveTo':_0x159c79},function(_0x418737,_0x618339){if(_0x418737)return _0x1481bb(_0x418737);return _0x3ca6db(_0x618339);});})[_0x7fff('0x29')](function(){return new BPromise(function(_0x480ece,_0x157b7d){rimraf(_0x50be2e,function(_0x2f209d){if(_0x2f209d)_0x157b7d(_0x2f209d);return _0x480ece();});});})[_0x7fff('0x29')](function(){return _0x261a43['download'](_0x159c79,_0x2622da,function(_0x568f8b){if(_0x568f8b){logger[_0x7fff('0x1b')](_0x7fff('0xcd'),_0x568f8b);}else{fs[_0x7fff('0xce')](_0x159c79);}});});});}else{return _0x261a43['sendStatus'](0xc8);}})[_0x7fff('0x1e')](handleError(_0x261a43,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index f5ae0eb..38d6566 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 _0x3562=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x21be1a,_0x598997){var _0x2f2ab5=function(_0x3be34b){while(--_0x3be34b){_0x21be1a['push'](_0x21be1a['shift']());}};_0x2f2ab5(++_0x598997);}(_0x3562,0x19b));var _0x2356=function(_0x59df9c,_0x5668b9){_0x59df9c=_0x59df9c-0x0;var _0x248b8a=_0x3562[_0x59df9c];return _0x248b8a;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x2356('0x0'))['db'][_0x2356('0x1')];var ChatMessage=require(_0x2356('0x0'))['db'][_0x2356('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2356('0x3')](0x0);var events={'afterCreate':_0x2356('0x4'),'afterUpdate':_0x2356('0x5'),'afterDestroy':_0x2356('0x6')};function emitEvent(_0x3b7fcd){return function(_0x43e75a,_0x1bbf6a,_0x57a4b2){_0x43e75a[_0x2356('0x7')]({'attributes':['id'],'raw':!![]})[_0x2356('0x8')](function(_0x4e5da1){_0x43e75a[_0x2356('0x9')](_0x2356('0xa'),_0x4e5da1[_0x2356('0xb')](function(_0x371e38){return{'id':_0x371e38['id']};}));return ChatMessage[_0x2356('0xc')]({'where':{'ChatInteractionId':_0x43e75a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x8ad3cc){_0x43e75a[_0x2356('0x9')](_0x2356('0xd'),_0x8ad3cc[_0x2356('0xe')]);ChatInteractionEvents[_0x2356('0xf')](_0x3b7fcd+':'+_0x43e75a['id'],_0x43e75a);ChatInteractionEvents[_0x2356('0xf')](_0x3b7fcd,_0x43e75a);_0x57a4b2(null);})[_0x2356('0x10')](_0x57a4b2(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x2356('0x11')](e,emitEvent(event));}}module[_0x2356('0x12')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xec0a=['ChatMessage','setMaxListeners','update','getUsers','then','setDataValue','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x218c0c,_0x2b21e3){var _0xf0347d=function(_0xb3b51c){while(--_0xb3b51c){_0x218c0c['push'](_0x218c0c['shift']());}};_0xf0347d(++_0x2b21e3);}(_0xec0a,0x17e));var _0xaec0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xec0a[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xaec0('0x0'));var ChatInteraction=require(_0xaec0('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xaec0('0x1'))['db'][_0xaec0('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xaec0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaec0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5f4c58){return function(_0x2e5ea7,_0x9495ef,_0x239765){_0x2e5ea7[_0xaec0('0x5')]({'attributes':['id'],'raw':!![]})[_0xaec0('0x6')](function(_0x4cbd60){_0x2e5ea7[_0xaec0('0x7')]('Users',_0x4cbd60['map'](function(_0x12db3e){return{'id':_0x12db3e['id']};}));return ChatMessage[_0xaec0('0x8')]({'where':{'ChatInteractionId':_0x2e5ea7['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x8cd841){_0x2e5ea7[_0xaec0('0x7')](_0xaec0('0x9'),_0x8cd841[_0xaec0('0xa')]);ChatInteractionEvents[_0xaec0('0xb')](_0x5f4c58+':'+_0x2e5ea7['id'],_0x2e5ea7);ChatInteractionEvents[_0xaec0('0xb')](_0x5f4c58,_0x2e5ea7);_0x239765(null);})[_0xaec0('0xc')](_0x239765(null));};}for(var e in events){if(events[_0xaec0('0xd')](e)){var event=events[e];ChatInteraction[_0xaec0('0xe')](e,emitEvent(event));}}module[_0xaec0('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 4836f62..ab22805 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 _0x78b2=['exports','ChatInteraction','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes'];(function(_0x450689,_0x3b857c){var _0x46ffb0=function(_0x5d3679){while(--_0x5d3679){_0x450689['push'](_0x450689['shift']());}};_0x46ffb0(++_0x3b857c);}(_0x78b2,0x1b9));var _0x278b=function(_0x15dd6b,_0x156756){_0x15dd6b=_0x15dd6b-0x0;var _0x531461=_0x78b2[_0x15dd6b];return _0x531461;};'use strict';var _=require(_0x278b('0x0'));var util=require(_0x278b('0x1'));var logger=require(_0x278b('0x2'))('api');var moment=require(_0x278b('0x3'));var BPromise=require(_0x278b('0x4'));var rp=require(_0x278b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x278b('0x6'));var config=require(_0x278b('0x7'));var attributes=require(_0x278b('0x8'));module[_0x278b('0x9')]=function(_0x18a402,_0x4090cc){return _0x18a402['define'](_0x278b('0xa'),attributes,{'tableName':_0x278b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a06e6,_0x5b1ede,_0x26132d){if(_0x5a06e6['changed'](_0x278b('0xc'))){_0x5a06e6['closedAt']=moment()[_0x278b('0xd')](_0x278b('0xe'));}_0x26132d(null,_0x5a06e6);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xd85b=['request-promise','rimraf','../../config/environment','exports','define','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird'];(function(_0x2acb93,_0x419a08){var _0x50ffbd=function(_0x34c094){while(--_0x34c094){_0x2acb93['push'](_0x2acb93['shift']());}};_0x50ffbd(++_0x419a08);}(_0xd85b,0xfb));var _0xbd85=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd85b[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbd85('0x0'))(_0xbd85('0x1'));var moment=require(_0xbd85('0x2'));var BPromise=require(_0xbd85('0x3'));var rp=require(_0xbd85('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd85('0x5'));var config=require(_0xbd85('0x6'));var attributes=require('./chatInteraction.attributes');module[_0xbd85('0x7')]=function(_0xaa5286,_0x4b7294){return _0xaa5286[_0xbd85('0x8')](_0xbd85('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8b7c06,_0x3c9ad9,_0x4f2065){if(_0x8b7c06[_0xbd85('0xa')](_0xbd85('0xb'))){_0x8b7c06[_0xbd85('0xc')]=moment()[_0xbd85('0xd')](_0xbd85('0xe'));}_0x4f2065(null,_0x8b7c06);}},'charset':_0xbd85('0xf'),'collate':_0xbd85('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 7bd582e..4093051 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 _0x70bd=['options','raw','where','limit','debug','stringify','AddTagsToChatInteraction','ChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','ChatInteraction,\x20%s,\x20%s','catch','UpdateChatInteraction','body'];(function(_0x35f342,_0x1f91e5){var _0x4e6b42=function(_0x54194d){while(--_0x54194d){_0x35f342['push'](_0x35f342['shift']());}};_0x4e6b42(++_0x1f91e5);}(_0x70bd,0x191));var _0xd70b=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x70bd[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xd70b('0x0'));var util=require(_0xd70b('0x1'));var moment=require(_0xd70b('0x2'));var BPromise=require('bluebird');var rs=require(_0xd70b('0x3'));var fs=require('fs');var Redis=require(_0xd70b('0x4'));var db=require(_0xd70b('0x5'))['db'];var utils=require(_0xd70b('0x6'));var logger=require('../../config/logger')(_0xd70b('0x7'));var config=require(_0xd70b('0x8'));var jayson=require(_0xd70b('0x9'));var client=jayson[_0xd70b('0xa')][_0xd70b('0xb')]({'port':0x232a});config[_0xd70b('0xc')]=_['defaults'](config[_0xd70b('0xc')],{'host':_0xd70b('0xd'),'port':0x18eb});var socket=require(_0xd70b('0xe'))(new Redis(config[_0xd70b('0xc')]));require(_0xd70b('0xf'))[_0xd70b('0x10')](socket);function respondWithRpcPromise(_0x447e4a,_0x3b4ade,_0x5517bd){return new BPromise(function(_0x816cce,_0x3de935){return client[_0xd70b('0x11')](_0x447e4a,_0x5517bd)[_0xd70b('0x12')](function(_0x3c90ba){logger[_0xd70b('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x3b4ade,_0xd70b('0x14'));logger['debug'](_0xd70b('0x15'),_0x3b4ade,_0xd70b('0x14'),JSON['stringify'](_0x3c90ba));if(_0x3c90ba[_0xd70b('0x16')]){if(_0x3c90ba['error'][_0xd70b('0x17')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3b4ade,_0x3c90ba['error'][_0xd70b('0x18')]);return _0x3de935(_0x3c90ba[_0xd70b('0x16')][_0xd70b('0x18')]);}logger[_0xd70b('0x16')](_0xd70b('0x19'),_0x3b4ade,_0x3c90ba[_0xd70b('0x16')][_0xd70b('0x18')]);return _0x816cce(_0x3c90ba[_0xd70b('0x16')]['message']);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x3b4ade,_0xd70b('0x14'));_0x816cce(_0x3c90ba['result'][_0xd70b('0x18')]);}})[_0xd70b('0x1a')](function(_0x1c73ad){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3b4ade,_0x1c73ad);_0x3de935(_0x1c73ad);});});}exports[_0xd70b('0x1b')]=function(_0x507f47){var _0x67ea74=this;return new Promise(function(_0x5f5f38,_0x31b971){return db['ChatInteraction']['update'](_0x507f47[_0xd70b('0x1c')],{'raw':_0x507f47[_0xd70b('0x1d')]?_0x507f47[_0xd70b('0x1d')][_0xd70b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x507f47[_0xd70b('0x1d')]?_0x507f47[_0xd70b('0x1d')][_0xd70b('0x1f')]||null:null,'attributes':_0x507f47[_0xd70b('0x1d')]?_0x507f47['options']['attributes']||null:null,'limit':_0x507f47['options']?_0x507f47[_0xd70b('0x1d')][_0xd70b('0x20')]||null:null})[_0xd70b('0x12')](function(_0xe04978){logger[_0xd70b('0x13')](_0xd70b('0x1b'),_0x507f47);logger[_0xd70b('0x21')](_0xd70b('0x1b'),_0x507f47,JSON[_0xd70b('0x22')](_0xe04978));_0x5f5f38(_0xe04978);})[_0xd70b('0x1a')](function(_0x42dea6){logger[_0xd70b('0x16')](_0xd70b('0x1b'),_0x42dea6['message'],_0x507f47);_0x31b971(_0x67ea74['error'](0x1f4,_0x42dea6['message']));});});};exports[_0xd70b('0x23')]=function(_0x327012){return new Promise(function(_0x1ffb00,_0xfd4503){return db[_0xd70b('0x24')][_0xd70b('0x25')]({'where':_0x327012[_0xd70b('0x1d')]?_0x327012[_0xd70b('0x1d')][_0xd70b('0x1f')]||null:null})[_0xd70b('0x12')](function(_0x3ed0ef){if(_0x3ed0ef){return _0x3ed0ef[_0xd70b('0x26')](_0x327012[_0xd70b('0x1c')][_0xd70b('0x27')],_[_0xd70b('0x28')](_0x327012[_0xd70b('0x1c')],[_0xd70b('0x27'),'id'])||{});}})[_0xd70b('0x29')](function(_0x2890e2){logger[_0xd70b('0x13')](_0xd70b('0x2a'),_0x327012);logger['debug'](_0xd70b('0x2a'),_0x327012,JSON[_0xd70b('0x22')](_0x2890e2));_0x1ffb00(_0x2890e2);})[_0xd70b('0x1a')](function(_0xb2d753){logger[_0xd70b('0x16')]('AddTags',_0xb2d753[_0xd70b('0x18')],_0x327012);_0xfd4503(_this['error'](0x1f4,_0xb2d753['message']));});});};
\ No newline at end of file
+var _0x75ad=['localhost','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','find','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x5520bf,_0x30866b){var _0x3c5ef2=function(_0x1bcc23){while(--_0x1bcc23){_0x5520bf['push'](_0x5520bf['shift']());}};_0x3c5ef2(++_0x30866b);}(_0x75ad,0xc4));var _0xd75a=function(_0x4b6ec2,_0x13725c){_0x4b6ec2=_0x4b6ec2-0x0;var _0x3fe2c5=_0x75ad[_0x4b6ec2];return _0x3fe2c5;};'use strict';var _=require(_0xd75a('0x0'));var util=require(_0xd75a('0x1'));var moment=require(_0xd75a('0x2'));var BPromise=require(_0xd75a('0x3'));var rs=require(_0xd75a('0x4'));var fs=require('fs');var Redis=require(_0xd75a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd75a('0x6'));var logger=require(_0xd75a('0x7'))(_0xd75a('0x8'));var config=require(_0xd75a('0x9'));var jayson=require(_0xd75a('0xa'));var client=jayson[_0xd75a('0xb')][_0xd75a('0xc')]({'port':0x232a});config[_0xd75a('0xd')]=_['defaults'](config[_0xd75a('0xd')],{'host':_0xd75a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd75a('0xd')]));require(_0xd75a('0xf'))[_0xd75a('0x10')](socket);function respondWithRpcPromise(_0x166cd4,_0x3b8610,_0x513455){return new BPromise(function(_0xb36732,_0x202e5a){return client['request'](_0x166cd4,_0x513455)[_0xd75a('0x11')](function(_0x44a98e){logger[_0xd75a('0x12')](_0xd75a('0x13'),_0x3b8610,_0xd75a('0x14'));logger[_0xd75a('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3b8610,_0xd75a('0x14'),JSON[_0xd75a('0x16')](_0x44a98e));if(_0x44a98e['error']){if(_0x44a98e[_0xd75a('0x17')][_0xd75a('0x18')]===0x1f4){logger['error'](_0xd75a('0x13'),_0x3b8610,_0x44a98e['error'][_0xd75a('0x19')]);return _0x202e5a(_0x44a98e[_0xd75a('0x17')]['message']);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3b8610,_0x44a98e[_0xd75a('0x17')][_0xd75a('0x19')]);return _0xb36732(_0x44a98e[_0xd75a('0x17')][_0xd75a('0x19')]);}else{logger[_0xd75a('0x12')](_0xd75a('0x13'),_0x3b8610,_0xd75a('0x14'));_0xb36732(_0x44a98e[_0xd75a('0x1a')][_0xd75a('0x19')]);}})['catch'](function(_0x457c8f){logger[_0xd75a('0x17')](_0xd75a('0x13'),_0x3b8610,_0x457c8f);_0x202e5a(_0x457c8f);});});}exports[_0xd75a('0x1b')]=function(_0x5d7279){var _0xe3ae73=this;return new Promise(function(_0x4e76d5,_0x494489){return db[_0xd75a('0x1c')][_0xd75a('0x1d')](_0x5d7279[_0xd75a('0x1e')],{'raw':_0x5d7279[_0xd75a('0x1f')]?_0x5d7279[_0xd75a('0x1f')][_0xd75a('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d7279[_0xd75a('0x1f')]?_0x5d7279[_0xd75a('0x1f')][_0xd75a('0x21')]||null:null,'attributes':_0x5d7279[_0xd75a('0x1f')]?_0x5d7279['options'][_0xd75a('0x22')]||null:null,'limit':_0x5d7279[_0xd75a('0x1f')]?_0x5d7279['options'][_0xd75a('0x23')]||null:null})['then'](function(_0x5b6ebb){logger[_0xd75a('0x12')](_0xd75a('0x1b'),_0x5d7279);logger[_0xd75a('0x15')]('UpdateChatInteraction',_0x5d7279,JSON[_0xd75a('0x16')](_0x5b6ebb));_0x4e76d5(_0x5b6ebb);})[_0xd75a('0x24')](function(_0x24feb8){logger[_0xd75a('0x17')](_0xd75a('0x1b'),_0x24feb8['message'],_0x5d7279);_0x494489(_0xe3ae73[_0xd75a('0x17')](0x1f4,_0x24feb8[_0xd75a('0x19')]));});});};exports[_0xd75a('0x25')]=function(_0xe55f98){return new Promise(function(_0x4d67af,_0x283c1a){return db['ChatInteraction'][_0xd75a('0x26')]({'where':_0xe55f98['options']?_0xe55f98[_0xd75a('0x1f')][_0xd75a('0x21')]||null:null})[_0xd75a('0x11')](function(_0xfcbb10){if(_0xfcbb10){return _0xfcbb10[_0xd75a('0x27')](_0xe55f98[_0xd75a('0x1e')][_0xd75a('0x28')],_['omit'](_0xe55f98[_0xd75a('0x1e')],[_0xd75a('0x28'),'id'])||{});}})['spread'](function(_0x4af248){logger[_0xd75a('0x12')](_0xd75a('0x29'),_0xe55f98);logger[_0xd75a('0x15')](_0xd75a('0x29'),_0xe55f98,JSON[_0xd75a('0x16')](_0x4af248));_0x4d67af(_0x4af248);})[_0xd75a('0x24')](function(_0x1a2a28){logger[_0xd75a('0x17')](_0xd75a('0x29'),_0x1a2a28['message'],_0xe55f98);_0x283c1a(_this[_0xd75a('0x17')](0x1f4,_0x1a2a28['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 99d1228..15c8143 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 _0xe784=['length','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0xcec18a,_0x663b4f){var _0x52d111=function(_0x23a999){while(--_0x23a999){_0xcec18a['push'](_0xcec18a['shift']());}};_0x52d111(++_0x663b4f);}(_0xe784,0x1b9));var _0x4e78=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xe784[_0x1e4360];return _0x31e6b4;};'use strict';var ChatInteractionEvents=require(_0x4e78('0x0'));var events=[_0x4e78('0x1'),_0x4e78('0x2'),_0x4e78('0x3')];function createListener(_0x44558a,_0x4d424b){return function(_0x3f2ad7){_0x4d424b[_0x4e78('0x4')](_0x44558a,_0x3f2ad7);};}function removeListener(_0x9e71c7,_0x2faac3){return function(){ChatInteractionEvents[_0x4e78('0x5')](_0x9e71c7,_0x2faac3);};}exports[_0x4e78('0x6')]=function(_0x5901b2){for(var _0x312472=0x0,_0x5dcadd=events[_0x4e78('0x7')];_0x312472<_0x5dcadd;_0x312472++){var _0xda6372=events[_0x312472];var _0x4aec57=createListener('chatInteraction:'+_0xda6372,_0x5901b2);ChatInteractionEvents['on'](_0xda6372,_0x4aec57);}};
\ No newline at end of file
+var _0x0064=['remove','update','removeListener','register','length','chatInteraction:','save'];(function(_0x3d8240,_0x2663d4){var _0x3d0372=function(_0xc47c6b){while(--_0xc47c6b){_0x3d8240['push'](_0x3d8240['shift']());}};_0x3d0372(++_0x2663d4);}(_0x0064,0x68));var _0x4006=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0064[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x4006('0x0'),_0x4006('0x1'),_0x4006('0x2')];function createListener(_0x24571d,_0x4022ac){return function(_0x221755){_0x4022ac['emit'](_0x24571d,_0x221755);};}function removeListener(_0x212654,_0x5643a9){return function(){ChatInteractionEvents[_0x4006('0x3')](_0x212654,_0x5643a9);};}exports[_0x4006('0x4')]=function(_0x14aaa5){for(var _0x2544c3=0x0,_0x5d86c6=events[_0x4006('0x5')];_0x2544c3<_0x5d86c6;_0x2544c3++){var _0x28792a=events[_0x2544c3];var _0x165e0b=createListener(_0x4006('0x6')+_0x28792a,_0x14aaa5);ChatInteractionEvents['on'](_0x28792a,_0x165e0b);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index d4b7812..3ec59ab 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 _0x9aca=['single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','/:id/custom_update','abandon','close','chatinteraction:destroy','destroy','delete','removeTags','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','root','%s-%s','originalname','replace','/:id/attachment_upload'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9aca,0x118));var _0xa9ac=function(_0x475ac5,_0x30737c){_0x475ac5=_0x475ac5-0x0;var _0x1e5e19=_0x9aca[_0x475ac5];return _0x1e5e19;};'use strict';var multer=require('multer');var util=require(_0xa9ac('0x0'));var path=require('path');var timeout=require(_0xa9ac('0x1'));var express=require('express');var router=express[_0xa9ac('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa9ac('0x3'));var interaction=require(_0xa9ac('0x4'));var config=require('../../config/environment');var controller=require(_0xa9ac('0x5'));router['get']('/',auth[_0xa9ac('0x6')](),controller[_0xa9ac('0x7')]);router['get'](_0xa9ac('0x8'),auth['isAuthenticated'](),controller[_0xa9ac('0x9')]);router[_0xa9ac('0xa')](_0xa9ac('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xa9ac('0xc')]);router[_0xa9ac('0xa')](_0xa9ac('0xd'),auth[_0xa9ac('0xe')](),controller[_0xa9ac('0xf')]);router[_0xa9ac('0xa')](_0xa9ac('0x10'),auth['isAuthenticated'](),controller[_0xa9ac('0x11')]);router[_0xa9ac('0xa')](_0xa9ac('0x12'),auth[_0xa9ac('0xe')](),controller[_0xa9ac('0x13')]);router[_0xa9ac('0xa')](_0xa9ac('0x14'),auth[_0xa9ac('0x6')](),controller[_0xa9ac('0x15')]);router['post']('/',auth[_0xa9ac('0x6')](),controller[_0xa9ac('0x16')]);router[_0xa9ac('0x17')](_0xa9ac('0x18'),auth[_0xa9ac('0x6')](),controller[_0xa9ac('0x19')]);var upload=multer({'storage':multer[_0xa9ac('0x1a')]({'destination':function(_0x5aa2b2,_0x380e34,_0x431efa){_0x431efa(null,path['join'](config[_0xa9ac('0x1b')],'server/files/attachments/'));},'filename':function(_0x193d94,_0x1e2263,_0xd45629){_0xd45629(null,util['format'](_0xa9ac('0x1c'),Date['now'](),_0x1e2263[_0xa9ac('0x1d')][_0xa9ac('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xa9ac('0x1f'),upload[_0xa9ac('0x20')](_0xa9ac('0x21')),controller[_0xa9ac('0x22')]);router['post']('/:id/messages',auth[_0xa9ac('0xe')](),controller[_0xa9ac('0x23')]);router['post'](_0xa9ac('0x24'),auth[_0xa9ac('0x6')](),interaction['tracked'](_0xa9ac('0x25'),_0xa9ac('0x26')),controller[_0xa9ac('0x27')]);router[_0xa9ac('0x28')]('/:id',auth['isAuthenticated'](),interaction[_0xa9ac('0x29')](_0xa9ac('0x25'),_0xa9ac('0x2a')),controller[_0xa9ac('0x2b')]);router[_0xa9ac('0x28')](_0xa9ac('0x2c'),controller['customUpdate']);router[_0xa9ac('0x28')]('/:id/abandon',auth[_0xa9ac('0xe')](),controller[_0xa9ac('0x2d')]);router[_0xa9ac('0x28')]('/:id/close',controller[_0xa9ac('0x2e')]);router['delete']('/:id',auth[_0xa9ac('0x6')](),interaction[_0xa9ac('0x29')](_0xa9ac('0x25'),_0xa9ac('0x2f')),controller[_0xa9ac('0x30')]);router[_0xa9ac('0x31')](_0xa9ac('0x24'),auth[_0xa9ac('0x6')](),controller[_0xa9ac('0x32')]);module[_0xa9ac('0x33')]=router;
\ No newline at end of file
+var _0x201e=['getMyMessages','/:id/download','post','createVidaooSession','diskStorage','join','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','/:id/messages','addMessage','/:id/tags','tracked','chat','addTags','/:id','chatinteraction:update','update','put','/:id/custom_update','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','getMessages','/:id/my_messages'];(function(_0x2bc810,_0x4a1300){var _0x56b881=function(_0x447fa2){while(--_0x447fa2){_0x2bc810['push'](_0x2bc810['shift']());}};_0x56b881(++_0x4a1300);}(_0x201e,0xb0));var _0xe201=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x201e[_0x1a9204];return _0x17ca68;};'use strict';var multer=require('multer');var util=require(_0xe201('0x0'));var path=require(_0xe201('0x1'));var timeout=require(_0xe201('0x2'));var express=require(_0xe201('0x3'));var router=express[_0xe201('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe201('0x5'));var interaction=require(_0xe201('0x6'));var config=require(_0xe201('0x7'));var controller=require('./chatInteraction.controller');router[_0xe201('0x8')]('/',auth[_0xe201('0x9')](),controller[_0xe201('0xa')]);router[_0xe201('0x8')](_0xe201('0xb'),auth[_0xe201('0x9')](),controller[_0xe201('0xc')]);router[_0xe201('0x8')]('/:id',auth[_0xe201('0xd')](),controller['show']);router[_0xe201('0x8')]('/:id/attachment_download',auth[_0xe201('0xd')](),controller['attachmentDownload']);router[_0xe201('0x8')]('/:id/messages',auth[_0xe201('0x9')](),controller[_0xe201('0xe')]);router[_0xe201('0x8')](_0xe201('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xe201('0x10')]);router[_0xe201('0x8')](_0xe201('0x11'),auth[_0xe201('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe201('0x12')]('/:id/vidaoo',auth[_0xe201('0x9')](),controller[_0xe201('0x13')]);var upload=multer({'storage':multer[_0xe201('0x14')]({'destination':function(_0x333f35,_0x20d444,_0x8aa5b4){_0x8aa5b4(null,path[_0xe201('0x15')](config['root'],_0xe201('0x16')));},'filename':function(_0x3e96cc,_0x570461,_0x2a6306){_0x2a6306(null,util[_0xe201('0x17')]('%s-%s',Date[_0xe201('0x18')](),_0x570461[_0xe201('0x19')][_0xe201('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe201('0x12')](_0xe201('0x1b'),upload[_0xe201('0x1c')]('file'),controller['attachmentUpload']);router['post'](_0xe201('0x1d'),auth[_0xe201('0xd')](),controller[_0xe201('0x1e')]);router[_0xe201('0x12')](_0xe201('0x1f'),auth[_0xe201('0x9')](),interaction[_0xe201('0x20')](_0xe201('0x21'),'chatinteraction:addtags'),controller[_0xe201('0x22')]);router['put'](_0xe201('0x23'),auth['isAuthenticated'](),interaction[_0xe201('0x20')]('chat',_0xe201('0x24')),controller[_0xe201('0x25')]);router[_0xe201('0x26')](_0xe201('0x27'),controller['customUpdate']);router[_0xe201('0x26')](_0xe201('0x28'),auth[_0xe201('0xd')](),controller['abandon']);router[_0xe201('0x26')](_0xe201('0x29'),controller[_0xe201('0x2a')]);router[_0xe201('0x2b')](_0xe201('0x23'),auth[_0xe201('0x9')](),interaction[_0xe201('0x20')](_0xe201('0x21'),_0xe201('0x2c')),controller[_0xe201('0x2d')]);router[_0xe201('0x2b')](_0xe201('0x1f'),auth['isAuthenticated'](),controller[_0xe201('0x2e')]);module[_0xe201('0x2f')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 703700a..cf00b05 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 _0xd01f=['exports','TEXT','medium','sequelize'];(function(_0x56bd4c,_0x3cd91d){var _0x462287=function(_0x3f982c){while(--_0x3f982c){_0x56bd4c['push'](_0x56bd4c['shift']());}};_0x462287(++_0x3cd91d);}(_0xd01f,0x1cf));var _0xfd01=function(_0x1cb45d,_0x46aa83){_0x1cb45d=_0x1cb45d-0x0;var _0x3ea23c=_0xd01f[_0x1cb45d];return _0x3ea23c;};'use strict';var Sequelize=require(_0xfd01('0x0'));module[_0xfd01('0x1')]={'body':{'type':Sequelize[_0xfd01('0x2')](_0xfd01('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x3a0d=['INTEGER','medium','BOOLEAN'];(function(_0x31b59c,_0x136fc7){var _0x56db60=function(_0x38f02e){while(--_0x38f02e){_0x31b59c['push'](_0x31b59c['shift']());}};_0x56db60(++_0x136fc7);}(_0x3a0d,0x14b));var _0xd3a0=function(_0x4a1196,_0x21e0c3){_0x4a1196=_0x4a1196-0x0;var _0x58604e=_0x3a0d[_0x4a1196];return _0x58604e;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xd3a0('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0xd3a0('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd3a0('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 9a84261..d367817 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 _0xbc68=['User','agent','admin','user','userpic','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','read','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','ChatInternalMessage','count','findAll','rows','catch','show','params','include','create','body','find','describe','get','messages','lastMessage','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2a4813,_0x1c9e07){var _0x75858e=function(_0x1a48d9){while(--_0x1a48d9){_0x2a4813['push'](_0x2a4813['shift']());}};_0x75858e(++_0x1c9e07);}(_0xbc68,0x155));var _0x8bc6=function(_0x4d3016,_0x3351a0){_0x4d3016=_0x4d3016-0x0;var _0x20057c=_0xbc68[_0x4d3016];return _0x20057c;};'use strict';var emlformat=require(_0x8bc6('0x0'));var rimraf=require(_0x8bc6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8bc6('0x2'));var moment=require('moment');var BPromise=require(_0x8bc6('0x3'));var Mustache=require(_0x8bc6('0x4'));var util=require(_0x8bc6('0x5'));var path=require(_0x8bc6('0x6'));var sox=require(_0x8bc6('0x7'));var csv=require(_0x8bc6('0x8'));var ejs=require(_0x8bc6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bc6('0xa'));var squel=require(_0x8bc6('0xb'));var crypto=require(_0x8bc6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8bc6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8bc6('0xe'));var Papa=require(_0x8bc6('0xf'));var Redis=require(_0x8bc6('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8bc6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8bc6('0x12'))(_0x8bc6('0x13'));var utils=require(_0x8bc6('0x14'));var config=require(_0x8bc6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8bc6('0x16'))['db'];config[_0x8bc6('0x17')]=_[_0x8bc6('0x18')](config['redis'],{'host':_0x8bc6('0x19'),'port':0x18eb});var socket=require(_0x8bc6('0x1a'))(new Redis(config[_0x8bc6('0x17')]));require(_0x8bc6('0x1b'))[_0x8bc6('0x1c')](socket);function respondWithStatusCode(_0x559a88,_0x2786e0){_0x2786e0=_0x2786e0||0xcc;return function(_0x3e8366){if(_0x3e8366){return _0x559a88['sendStatus'](_0x2786e0);}return _0x559a88[_0x8bc6('0x1d')](_0x2786e0)['end']();};}function respondWithResult(_0x28cb2a,_0x3ef1ed){_0x3ef1ed=_0x3ef1ed||0xc8;return function(_0x14816c){if(_0x14816c){return _0x28cb2a[_0x8bc6('0x1d')](_0x3ef1ed)['json'](_0x14816c);}};}function respondWithFilteredResult(_0x17c09f,_0x108043){return function(_0x3a5c8e){if(_0x3a5c8e){var _0x41dae0=typeof _0x108043[_0x8bc6('0x1e')]===_0x8bc6('0x1f')&&typeof _0x108043[_0x8bc6('0x20')]===_0x8bc6('0x1f');var _0x2d7805=_0x3a5c8e['count'];var _0x90bf59=_0x41dae0?0x0:_0x108043[_0x8bc6('0x1e')];var _0x5bbc8e=_0x41dae0?_0x3a5c8e['count']:_0x108043[_0x8bc6('0x1e')]+_0x108043[_0x8bc6('0x20')];var _0x7fbb55;if(_0x5bbc8e>=_0x2d7805){_0x5bbc8e=_0x2d7805;_0x7fbb55=0xc8;}else{_0x7fbb55=0xce;}_0x17c09f[_0x8bc6('0x1d')](_0x7fbb55);return _0x17c09f[_0x8bc6('0x21')](_0x8bc6('0x22'),_0x90bf59+'-'+_0x5bbc8e+'/'+_0x2d7805)['json'](_0x3a5c8e);}return null;};}function patchUpdates(_0xdfd7cf){return function(_0x3cf819){try{jsonpatch[_0x8bc6('0x23')](_0x3cf819,_0xdfd7cf,!![]);}catch(_0x351606){return BPromise['reject'](_0x351606);}return _0x3cf819[_0x8bc6('0x24')]();};}function saveUpdates(_0xa90f66,_0xa04593){return function(_0x121d02){if(_0x121d02){return _0x121d02[_0x8bc6('0x25')](_0xa90f66)[_0x8bc6('0x26')](function(_0x185716){return _0x185716;});}return null;};}function removeEntity(_0x4bdde9,_0x4d1e7d){return function(_0x25d326){if(_0x25d326){return _0x25d326[_0x8bc6('0x27')]()[_0x8bc6('0x26')](function(){_0x4bdde9[_0x8bc6('0x1d')](0xcc)[_0x8bc6('0x28')]();});}};}function handleEntityNotFound(_0x541ad9,_0x4bdd87){return function(_0x24330d){if(!_0x24330d){_0x541ad9[_0x8bc6('0x29')](0x194);}return _0x24330d;};}function handleError(_0x478ea6,_0x523784){_0x523784=_0x523784||0x1f4;return function(_0x109844){logger[_0x8bc6('0x2a')](_0x109844[_0x8bc6('0x2b')]);if(_0x109844[_0x8bc6('0x2c')]){delete _0x109844[_0x8bc6('0x2c')];}_0x478ea6['status'](_0x523784)[_0x8bc6('0x2d')](_0x109844);};}exports[_0x8bc6('0x2e')]=function(_0x76c48d,_0x1a6853){var _0x186768={},_0x4fbcce={},_0x46810c={'count':0x0,'rows':[]};var _0x156871=_[_0x8bc6('0x2f')](db['ChatInternalMessage'][_0x8bc6('0x30')],function(_0x32719a){return{'name':_0x32719a[_0x8bc6('0x31')],'type':_0x32719a[_0x8bc6('0x32')]['key']};});_0x4fbcce[_0x8bc6('0x33')]=_['map'](_0x156871,_0x8bc6('0x2c'));_0x4fbcce['query']=_[_0x8bc6('0x34')](_0x76c48d[_0x8bc6('0x35')]);_0x4fbcce['filters']=_['intersection'](_0x4fbcce['model'],_0x4fbcce[_0x8bc6('0x35')]);_0x186768[_0x8bc6('0x36')]=_[_0x8bc6('0x37')](_0x4fbcce[_0x8bc6('0x33')],qs[_0x8bc6('0x38')](_0x76c48d[_0x8bc6('0x35')][_0x8bc6('0x38')]));_0x186768['attributes']=_0x186768[_0x8bc6('0x36')][_0x8bc6('0x39')]?_0x186768[_0x8bc6('0x36')]:_0x4fbcce['model'];if(!_0x76c48d[_0x8bc6('0x35')]['hasOwnProperty']('nolimit')){_0x186768[_0x8bc6('0x20')]=qs['limit'](_0x76c48d['query'][_0x8bc6('0x20')]);_0x186768['offset']=qs['offset'](_0x76c48d['query'][_0x8bc6('0x1e')]);}_0x186768[_0x8bc6('0x3a')]=qs[_0x8bc6('0x3b')](_0x76c48d[_0x8bc6('0x35')]['sort']);_0x186768[_0x8bc6('0x3c')]=qs[_0x8bc6('0x3d')](_[_0x8bc6('0x3e')](_0x76c48d['query'],_0x4fbcce[_0x8bc6('0x3d')]),_0x156871);if(_0x76c48d[_0x8bc6('0x35')][_0x8bc6('0x3f')]){_0x186768[_0x8bc6('0x3c')]=_['merge'](_0x186768[_0x8bc6('0x3c')],{'$or':_[_0x8bc6('0x2f')](_0x156871,function(_0x22ed3a){if(_0x22ed3a[_0x8bc6('0x32')]!==_0x8bc6('0x40')){var _0x4ac7b7={};_0x4ac7b7[_0x22ed3a[_0x8bc6('0x2c')]]={'$like':'%'+_0x76c48d[_0x8bc6('0x35')]['filter']+'%'};return _0x4ac7b7;}})});}_0x186768=_[_0x8bc6('0x41')]({},_0x186768,_0x76c48d[_0x8bc6('0x42')]);var _0x52c915={'where':_0x186768['where']};return db[_0x8bc6('0x43')]['count'](_0x52c915)['then'](function(_0x110b6f){_0x46810c[_0x8bc6('0x44')]=_0x110b6f;if(_0x76c48d[_0x8bc6('0x35')]['includeAll']){_0x186768['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x8bc6('0x45')](_0x186768);})[_0x8bc6('0x26')](function(_0xc3b6e){_0x46810c[_0x8bc6('0x46')]=_0xc3b6e;return _0x46810c;})[_0x8bc6('0x26')](respondWithFilteredResult(_0x1a6853,_0x186768))[_0x8bc6('0x47')](handleError(_0x1a6853,null));};exports[_0x8bc6('0x48')]=function(_0xa3a962,_0x257370){var _0x222a66={'raw':!![],'where':{'id':_0xa3a962[_0x8bc6('0x49')]['id']}},_0x134ef3={};_0x134ef3[_0x8bc6('0x33')]=_[_0x8bc6('0x34')](db[_0x8bc6('0x43')][_0x8bc6('0x30')]);_0x134ef3[_0x8bc6('0x35')]=_[_0x8bc6('0x34')](_0xa3a962[_0x8bc6('0x35')]);_0x134ef3[_0x8bc6('0x3d')]=_[_0x8bc6('0x37')](_0x134ef3['model'],_0x134ef3[_0x8bc6('0x35')]);_0x222a66['attributes']=_['intersection'](_0x134ef3[_0x8bc6('0x33')],qs['fields'](_0xa3a962[_0x8bc6('0x35')][_0x8bc6('0x38')]));_0x222a66[_0x8bc6('0x36')]=_0x222a66['attributes']['length']?_0x222a66['attributes']:_0x134ef3[_0x8bc6('0x33')];if(_0xa3a962['query']['includeAll']){_0x222a66[_0x8bc6('0x4a')]=[{'all':!![]}];}_0x222a66=_[_0x8bc6('0x41')]({},_0x222a66,_0xa3a962[_0x8bc6('0x42')]);return db[_0x8bc6('0x43')]['find'](_0x222a66)[_0x8bc6('0x26')](handleEntityNotFound(_0x257370,null))['then'](respondWithResult(_0x257370,null))['catch'](handleError(_0x257370,null));};exports[_0x8bc6('0x4b')]=function(_0x5114ea,_0x58e778){return db[_0x8bc6('0x43')][_0x8bc6('0x4b')](_0x5114ea[_0x8bc6('0x4c')],{})[_0x8bc6('0x26')](respondWithResult(_0x58e778,0xc9))['catch'](handleError(_0x58e778,null));};exports[_0x8bc6('0x25')]=function(_0x372501,_0x10389e){if(_0x372501['body']['id']){delete _0x372501['body']['id'];}return db[_0x8bc6('0x43')][_0x8bc6('0x4d')]({'where':{'id':_0x372501[_0x8bc6('0x49')]['id']}})[_0x8bc6('0x26')](handleEntityNotFound(_0x10389e,null))['then'](saveUpdates(_0x372501[_0x8bc6('0x4c')],null))[_0x8bc6('0x26')](respondWithResult(_0x10389e,null))['catch'](handleError(_0x10389e,null));};exports[_0x8bc6('0x27')]=function(_0x1f12bb,_0x5447cd){return db[_0x8bc6('0x43')][_0x8bc6('0x4d')]({'where':{'id':_0x1f12bb[_0x8bc6('0x49')]['id']}})[_0x8bc6('0x26')](handleEntityNotFound(_0x5447cd,null))[_0x8bc6('0x26')](removeEntity(_0x5447cd,null))['catch'](handleError(_0x5447cd,null));};exports[_0x8bc6('0x4e')]=function(_0x1c3429,_0x43dc59){return db[_0x8bc6('0x43')][_0x8bc6('0x4e')]()[_0x8bc6('0x26')](respondWithResult(_0x43dc59,null))['catch'](handleError(_0x43dc59,null));};function wrapUser(_0x184eff){return function(_0x140721){var _0xb6d743=_0x184eff[_0x8bc6('0x4f')]({'plain':!![]});_0xb6d743[_0x8bc6('0x50')]=[];if(_0x140721){_0xb6d743['lastMessageAt']=_0x140721['createdAt'];_0xb6d743[_0x8bc6('0x51')]=_0x140721;}else{_0xb6d743['lastMessageAt']=moment(0x0)['format'](_0x8bc6('0x52'));_0xb6d743['lastMessage']={};}return _0xb6d743;};}exports['getUsers']=function(_0x1f2952,_0xf3e194,_0x4c5f4f){var _0xc06c98=[];return db[_0x8bc6('0x53')]['findAll']({'where':{'role':[_0x8bc6('0x54'),_0x8bc6('0x55'),_0x8bc6('0x56')]},'attributes':['id','fullname',_0x8bc6('0x2c'),'role',_0x8bc6('0x57'),'internal','online',_0x8bc6('0x58'),_0x8bc6('0x59'),_0x8bc6('0x5a')],'order':qs[_0x8bc6('0x3b')](_0x8bc6('0x5b')),'include':[{'model':db[_0x8bc6('0x5c')],'as':_0x8bc6('0x5d'),'attributes':['id',_0x8bc6('0x2c'),_0x8bc6('0x32')],'through':{'attributes':[]}}]})[_0x8bc6('0x26')](function(_0x423bed){if(_0x423bed){var _0x29cc64=_0x1f2952[_0x8bc6('0x56')]['get']({'plain':!![]});if(!_0x29cc64)throw new Error(_0x8bc6('0x5e'));if(_0x29cc64[_0x8bc6('0x5f')]===_0x8bc6('0x56')){return db[_0x8bc6('0x60')]['find']({'where':{'name':_0x8bc6('0x61'),'userProfileId':_0x29cc64['userProfileId']},'raw':!![]})[_0x8bc6('0x26')](function(_0x2484e9){if(_0x2484e9){if(_0x2484e9[_0x8bc6('0x62')]===0x0){return db[_0x8bc6('0x63')][_0x8bc6('0x45')]({'where':{'sectionId':_0x2484e9['id']},'raw':!![]})[_0x8bc6('0x26')](function(_0x337cfd){var _0x8b57a1=[];if(_[_0x8bc6('0x64')](_0x337cfd)){_0x8b57a1=_[_0x8bc6('0x3f')](_0x423bed,function(_0x5ed501){if(_0x5ed501[_0x8bc6('0x5f')]!==_0x8bc6('0x54')){return _0x5ed501;}});return _0x8b57a1;}else{for(var _0x2b2de5=0x0;_0x2b2de5<_0x423bed[_0x8bc6('0x39')];_0x2b2de5++){var _0x16f762=_0x423bed[_0x2b2de5];if(_0x16f762['role']===_0x8bc6('0x54')){var _0x1a54f0=_[_0x8bc6('0x4d')](_0x337cfd,function(_0x14868e){return _0x14868e[_0x8bc6('0x65')]===_0x16f762['id'];});if(_0x1a54f0)_0x8b57a1['push'](_0x16f762);}else{_0x8b57a1[_0x8bc6('0x66')](_0x16f762);}}return _0x8b57a1;}});}else{return _0x423bed;}}else{var _0x32caef=_[_0x8bc6('0x3f')](_0x423bed,function(_0x2f6a23){if(_0x2f6a23[_0x8bc6('0x5f')]!==_0x8bc6('0x54')){return _0x2f6a23;}});return _0x32caef;}});}else{return _0x423bed;}}})[_0x8bc6('0x26')](function(_0x5d18f1){var _0x35168c=[];if(_0x5d18f1){_0xc06c98=_0x5d18f1;for(var _0x2681c3=0x0;_0x2681c3<_0x5d18f1[_0x8bc6('0x39')];_0x2681c3+=0x1){_0xc06c98[_0x2681c3][_0x8bc6('0x50')]=[];_0x35168c[_0x8bc6('0x66')](db[_0x8bc6('0x43')][_0x8bc6('0x4d')]({'where':{'FromId':[_0x1f2952['user']['id'],_0x5d18f1[_0x2681c3]['id']],'ToId':[_0x1f2952['user']['id'],_0x5d18f1[_0x2681c3]['id']],'ChatGroupId':null},'attributes':['id',_0x8bc6('0x67'),_0x8bc6('0x68'),'ToId',_0x8bc6('0x69'),_0x8bc6('0x4c')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5d18f1[_0x2681c3])));}return BPromise['all'](_0x35168c);}return[];})[_0x8bc6('0x26')](function(_0x4eff6){return{'rows':_0x4eff6,'count':_0x4eff6[_0x8bc6('0x39')]};})[_0x8bc6('0x26')](respondWithResult(_0xf3e194,null))['catch'](handleError(_0xf3e194,null));};
\ No newline at end of file
+var _0xe285=['redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','apply','save','update','then','destroy','stack','name','index','map','ChatInternalMessage','fieldName','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','format','getUsers','findAll','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0xe285,0x19a));var _0x5e28=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xe285[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require(_0x5e28('0x0'));var rimraf=require(_0x5e28('0x1'));var zipdir=require(_0x5e28('0x2'));var jsonpatch=require(_0x5e28('0x3'));var rp=require(_0x5e28('0x4'));var moment=require(_0x5e28('0x5'));var BPromise=require(_0x5e28('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5e28('0x7'));var sox=require(_0x5e28('0x8'));var csv=require(_0x5e28('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e28('0xa'));var _=require(_0x5e28('0xb'));var squel=require(_0x5e28('0xc'));var crypto=require(_0x5e28('0xd'));var jsforce=require(_0x5e28('0xe'));var deskjs=require(_0x5e28('0xf'));var toCsv=require(_0x5e28('0x9'));var querystring=require('querystring');var Papa=require(_0x5e28('0x10'));var Redis=require(_0x5e28('0x11'));var authService=require(_0x5e28('0x12'));var qs=require(_0x5e28('0x13'));var as=require(_0x5e28('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e28('0x15'))(_0x5e28('0x16'));var utils=require(_0x5e28('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5e28('0x18'));var db=require(_0x5e28('0x19'))['db'];config[_0x5e28('0x1a')]=_[_0x5e28('0x1b')](config[_0x5e28('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x5e28('0x1c'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x5e28('0x1d')](socket);function respondWithStatusCode(_0x486c03,_0x17cea6){_0x17cea6=_0x17cea6||0xcc;return function(_0x20d197){if(_0x20d197){return _0x486c03[_0x5e28('0x1e')](_0x17cea6);}return _0x486c03[_0x5e28('0x1f')](_0x17cea6)[_0x5e28('0x20')]();};}function respondWithResult(_0x3af812,_0xf74a7f){_0xf74a7f=_0xf74a7f||0xc8;return function(_0x50ea92){if(_0x50ea92){return _0x3af812[_0x5e28('0x1f')](_0xf74a7f)['json'](_0x50ea92);}};}function respondWithFilteredResult(_0x5308bb,_0x455bab){return function(_0x4be1b9){if(_0x4be1b9){var _0x4e7d05=typeof _0x455bab[_0x5e28('0x21')]===_0x5e28('0x22')&&typeof _0x455bab['limit']===_0x5e28('0x22');var _0x10e5dd=_0x4be1b9[_0x5e28('0x23')];var _0x252ce3=_0x4e7d05?0x0:_0x455bab[_0x5e28('0x21')];var _0x229d40=_0x4e7d05?_0x4be1b9[_0x5e28('0x23')]:_0x455bab[_0x5e28('0x21')]+_0x455bab[_0x5e28('0x24')];var _0x3ddfd1;if(_0x229d40>=_0x10e5dd){_0x229d40=_0x10e5dd;_0x3ddfd1=0xc8;}else{_0x3ddfd1=0xce;}_0x5308bb[_0x5e28('0x1f')](_0x3ddfd1);return _0x5308bb['set']('Content-Range',_0x252ce3+'-'+_0x229d40+'/'+_0x10e5dd)['json'](_0x4be1b9);}return null;};}function patchUpdates(_0x485388){return function(_0x25762d){try{jsonpatch[_0x5e28('0x25')](_0x25762d,_0x485388,!![]);}catch(_0x28b28b){return BPromise['reject'](_0x28b28b);}return _0x25762d[_0x5e28('0x26')]();};}function saveUpdates(_0x461b86,_0x1da8cc){return function(_0x1f3e9f){if(_0x1f3e9f){return _0x1f3e9f[_0x5e28('0x27')](_0x461b86)[_0x5e28('0x28')](function(_0x531595){return _0x531595;});}return null;};}function removeEntity(_0x11bee5,_0x51e9bf){return function(_0x2ea05a){if(_0x2ea05a){return _0x2ea05a[_0x5e28('0x29')]()['then'](function(){_0x11bee5[_0x5e28('0x1f')](0xcc)[_0x5e28('0x20')]();});}};}function handleEntityNotFound(_0x5e7144,_0x528921){return function(_0xcb8b60){if(!_0xcb8b60){_0x5e7144[_0x5e28('0x1e')](0x194);}return _0xcb8b60;};}function handleError(_0x353a3b,_0x419c61){_0x419c61=_0x419c61||0x1f4;return function(_0x4a9036){logger['error'](_0x4a9036[_0x5e28('0x2a')]);if(_0x4a9036[_0x5e28('0x2b')]){delete _0x4a9036[_0x5e28('0x2b')];}_0x353a3b[_0x5e28('0x1f')](_0x419c61)['send'](_0x4a9036);};}exports[_0x5e28('0x2c')]=function(_0x152315,_0xbc7ddf){var _0x554939={},_0x3d1091={},_0x1c15a3={'count':0x0,'rows':[]};var _0x25b512=_[_0x5e28('0x2d')](db[_0x5e28('0x2e')]['rawAttributes'],function(_0x497652){return{'name':_0x497652[_0x5e28('0x2f')],'type':_0x497652['type']['key']};});_0x3d1091[_0x5e28('0x30')]=_['map'](_0x25b512,'name');_0x3d1091['query']=_[_0x5e28('0x31')](_0x152315['query']);_0x3d1091[_0x5e28('0x32')]=_[_0x5e28('0x33')](_0x3d1091['model'],_0x3d1091[_0x5e28('0x34')]);_0x554939['attributes']=_[_0x5e28('0x33')](_0x3d1091[_0x5e28('0x30')],qs[_0x5e28('0x35')](_0x152315[_0x5e28('0x34')]['fields']));_0x554939['attributes']=_0x554939[_0x5e28('0x36')][_0x5e28('0x37')]?_0x554939['attributes']:_0x3d1091['model'];if(!_0x152315[_0x5e28('0x34')][_0x5e28('0x38')](_0x5e28('0x39'))){_0x554939[_0x5e28('0x24')]=qs[_0x5e28('0x24')](_0x152315['query'][_0x5e28('0x24')]);_0x554939[_0x5e28('0x21')]=qs[_0x5e28('0x21')](_0x152315[_0x5e28('0x34')][_0x5e28('0x21')]);}_0x554939['order']=qs[_0x5e28('0x3a')](_0x152315[_0x5e28('0x34')][_0x5e28('0x3a')]);_0x554939['where']=qs[_0x5e28('0x32')](_[_0x5e28('0x3b')](_0x152315[_0x5e28('0x34')],_0x3d1091[_0x5e28('0x32')]),_0x25b512);if(_0x152315[_0x5e28('0x34')]['filter']){_0x554939[_0x5e28('0x3c')]=_[_0x5e28('0x3d')](_0x554939[_0x5e28('0x3c')],{'$or':_['map'](_0x25b512,function(_0x113c62){if(_0x113c62[_0x5e28('0x3e')]!==_0x5e28('0x3f')){var _0x58522e={};_0x58522e[_0x113c62[_0x5e28('0x2b')]]={'$like':'%'+_0x152315['query'][_0x5e28('0x40')]+'%'};return _0x58522e;}})});}_0x554939=_[_0x5e28('0x3d')]({},_0x554939,_0x152315[_0x5e28('0x41')]);var _0x3ecb3d={'where':_0x554939[_0x5e28('0x3c')]};return db[_0x5e28('0x2e')][_0x5e28('0x23')](_0x3ecb3d)['then'](function(_0x26bb37){_0x1c15a3[_0x5e28('0x23')]=_0x26bb37;if(_0x152315[_0x5e28('0x34')][_0x5e28('0x42')]){_0x554939[_0x5e28('0x43')]=[{'all':!![]}];}return db[_0x5e28('0x2e')]['findAll'](_0x554939);})[_0x5e28('0x28')](function(_0x1e681b){_0x1c15a3[_0x5e28('0x44')]=_0x1e681b;return _0x1c15a3;})[_0x5e28('0x28')](respondWithFilteredResult(_0xbc7ddf,_0x554939))[_0x5e28('0x45')](handleError(_0xbc7ddf,null));};exports[_0x5e28('0x46')]=function(_0x31cdff,_0x52ac7a){var _0x22c82d={'raw':!![],'where':{'id':_0x31cdff[_0x5e28('0x47')]['id']}},_0x68eaff={};_0x68eaff['model']=_[_0x5e28('0x31')](db[_0x5e28('0x2e')]['rawAttributes']);_0x68eaff[_0x5e28('0x34')]=_['keys'](_0x31cdff[_0x5e28('0x34')]);_0x68eaff[_0x5e28('0x32')]=_[_0x5e28('0x33')](_0x68eaff[_0x5e28('0x30')],_0x68eaff[_0x5e28('0x34')]);_0x22c82d[_0x5e28('0x36')]=_[_0x5e28('0x33')](_0x68eaff[_0x5e28('0x30')],qs[_0x5e28('0x35')](_0x31cdff[_0x5e28('0x34')][_0x5e28('0x35')]));_0x22c82d[_0x5e28('0x36')]=_0x22c82d[_0x5e28('0x36')]['length']?_0x22c82d['attributes']:_0x68eaff[_0x5e28('0x30')];if(_0x31cdff[_0x5e28('0x34')][_0x5e28('0x42')]){_0x22c82d['include']=[{'all':!![]}];}_0x22c82d=_[_0x5e28('0x3d')]({},_0x22c82d,_0x31cdff[_0x5e28('0x41')]);return db[_0x5e28('0x2e')][_0x5e28('0x48')](_0x22c82d)[_0x5e28('0x28')](handleEntityNotFound(_0x52ac7a,null))['then'](respondWithResult(_0x52ac7a,null))[_0x5e28('0x45')](handleError(_0x52ac7a,null));};exports[_0x5e28('0x49')]=function(_0x41579c,_0x47372f){return db[_0x5e28('0x2e')]['create'](_0x41579c['body'],{})['then'](respondWithResult(_0x47372f,0xc9))[_0x5e28('0x45')](handleError(_0x47372f,null));};exports['update']=function(_0x431958,_0x268f42){if(_0x431958[_0x5e28('0x4a')]['id']){delete _0x431958[_0x5e28('0x4a')]['id'];}return db['ChatInternalMessage'][_0x5e28('0x48')]({'where':{'id':_0x431958['params']['id']}})[_0x5e28('0x28')](handleEntityNotFound(_0x268f42,null))[_0x5e28('0x28')](saveUpdates(_0x431958[_0x5e28('0x4a')],null))[_0x5e28('0x28')](respondWithResult(_0x268f42,null))[_0x5e28('0x45')](handleError(_0x268f42,null));};exports[_0x5e28('0x29')]=function(_0xb4b1ad,_0x3da50d){return db[_0x5e28('0x2e')][_0x5e28('0x48')]({'where':{'id':_0xb4b1ad[_0x5e28('0x47')]['id']}})[_0x5e28('0x28')](handleEntityNotFound(_0x3da50d,null))[_0x5e28('0x28')](removeEntity(_0x3da50d,null))[_0x5e28('0x45')](handleError(_0x3da50d,null));};exports[_0x5e28('0x4b')]=function(_0x4035a0,_0x8cb609){return db[_0x5e28('0x2e')]['describe']()[_0x5e28('0x28')](respondWithResult(_0x8cb609,null))['catch'](handleError(_0x8cb609,null));};function wrapUser(_0x2107ae){return function(_0x5293f3){var _0x278d45=_0x2107ae[_0x5e28('0x4c')]({'plain':!![]});_0x278d45[_0x5e28('0x4d')]=[];if(_0x5293f3){_0x278d45[_0x5e28('0x4e')]=_0x5293f3['createdAt'];_0x278d45['lastMessage']=_0x5293f3;}else{_0x278d45['lastMessageAt']=moment(0x0)[_0x5e28('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x278d45['lastMessage']={};}return _0x278d45;};}exports[_0x5e28('0x50')]=function(_0x3dbc95,_0x532549,_0x3183b2){var _0x1b01a6=[];return db['User'][_0x5e28('0x51')]({'where':{'role':[_0x5e28('0x52'),_0x5e28('0x53'),_0x5e28('0x54')]},'attributes':['id',_0x5e28('0x55'),_0x5e28('0x2b'),_0x5e28('0x56'),_0x5e28('0x57'),_0x5e28('0x58'),_0x5e28('0x59'),_0x5e28('0x5a'),_0x5e28('0x5b'),_0x5e28('0x5c')],'order':qs['sort'](_0x5e28('0x5d')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0x5e28('0x2b'),_0x5e28('0x3e')],'through':{'attributes':[]}}]})['then'](function(_0x22e6c3){if(_0x22e6c3){var _0x404567=_0x3dbc95[_0x5e28('0x54')][_0x5e28('0x4c')]({'plain':!![]});if(!_0x404567)throw new Error(_0x5e28('0x5e'));if(_0x404567[_0x5e28('0x56')]===_0x5e28('0x54')){return db[_0x5e28('0x5f')][_0x5e28('0x48')]({'where':{'name':_0x5e28('0x60'),'userProfileId':_0x404567[_0x5e28('0x61')]},'raw':!![]})[_0x5e28('0x28')](function(_0x2e1cac){if(_0x2e1cac){if(_0x2e1cac[_0x5e28('0x62')]===0x0){return db[_0x5e28('0x63')][_0x5e28('0x51')]({'where':{'sectionId':_0x2e1cac['id']},'raw':!![]})[_0x5e28('0x28')](function(_0x46e3c5){var _0x5a3095=[];if(_[_0x5e28('0x64')](_0x46e3c5)){_0x5a3095=_[_0x5e28('0x40')](_0x22e6c3,function(_0x543740){if(_0x543740[_0x5e28('0x56')]!==_0x5e28('0x52')){return _0x543740;}});return _0x5a3095;}else{for(var _0x2e9e11=0x0;_0x2e9e11<_0x22e6c3[_0x5e28('0x37')];_0x2e9e11++){var _0x41348e=_0x22e6c3[_0x2e9e11];if(_0x41348e[_0x5e28('0x56')]===_0x5e28('0x52')){var _0x3da5d8=_['find'](_0x46e3c5,function(_0xc135ab){return _0xc135ab[_0x5e28('0x65')]===_0x41348e['id'];});if(_0x3da5d8)_0x5a3095['push'](_0x41348e);}else{_0x5a3095[_0x5e28('0x66')](_0x41348e);}}return _0x5a3095;}});}else{return _0x22e6c3;}}else{var _0x330227=_[_0x5e28('0x40')](_0x22e6c3,function(_0x29aaa5){if(_0x29aaa5[_0x5e28('0x56')]!==_0x5e28('0x52')){return _0x29aaa5;}});return _0x330227;}});}else{return _0x22e6c3;}}})[_0x5e28('0x28')](function(_0x176ca4){var _0x2364f2=[];if(_0x176ca4){_0x1b01a6=_0x176ca4;for(var _0x135b81=0x0;_0x135b81<_0x176ca4[_0x5e28('0x37')];_0x135b81+=0x1){_0x1b01a6[_0x135b81][_0x5e28('0x4d')]=[];_0x2364f2['push'](db[_0x5e28('0x2e')]['find']({'where':{'FromId':[_0x3dbc95[_0x5e28('0x54')]['id'],_0x176ca4[_0x135b81]['id']],'ToId':[_0x3dbc95['user']['id'],_0x176ca4[_0x135b81]['id']],'ChatGroupId':null},'attributes':['id',_0x5e28('0x67'),_0x5e28('0x68'),_0x5e28('0x69'),_0x5e28('0x6a'),_0x5e28('0x4a')],'order':qs[_0x5e28('0x3a')](_0x5e28('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5e28('0x28')](wrapUser(_0x176ca4[_0x135b81])));}return BPromise[_0x5e28('0x6c')](_0x2364f2);}return[];})[_0x5e28('0x28')](function(_0x10acb2){return{'rows':_0x10acb2,'count':_0x10acb2['length']};})[_0x5e28('0x28')](respondWithResult(_0x532549,null))['catch'](handleError(_0x532549,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index f251414..0ed7172 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 _0xf5ff=['setMaxListeners','save','emit','exports','events','ChatInternalMessage'];(function(_0x8bb2ba,_0x1d2097){var _0x2464c5=function(_0x1baee4){while(--_0x1baee4){_0x8bb2ba['push'](_0x8bb2ba['shift']());}};_0x2464c5(++_0x1d2097);}(_0xf5ff,0xbe));var _0xff5f=function(_0xc60eb5,_0x59eea4){_0xc60eb5=_0xc60eb5-0x0;var _0x3c5554=_0xf5ff[_0xc60eb5];return _0x3c5554;};'use strict';var EventEmitter=require(_0xff5f('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xff5f('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xff5f('0x2')](0x0);var events={'afterCreate':_0xff5f('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x592538){return function(_0x7f44f2,_0x1cc84f,_0x4606a2){ChatInternalMessageEvents[_0xff5f('0x4')](_0x592538+':'+_0x7f44f2['id'],_0x7f44f2);ChatInternalMessageEvents[_0xff5f('0x4')](_0x592538,_0x7f44f2);_0x4606a2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xff5f('0x5')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xea69=['exports','events','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x356d31,_0x151a64){var _0x3b6088=function(_0x26654a){while(--_0x26654a){_0x356d31['push'](_0x356d31['shift']());}};_0x3b6088(++_0x151a64);}(_0xea69,0x97));var _0x9ea6=function(_0x59c45a,_0x1886c4){_0x59c45a=_0x59c45a-0x0;var _0x527e17=_0xea69[_0x59c45a];return _0x527e17;};'use strict';var EventEmitter=require(_0x9ea6('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x9ea6('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x9ea6('0x2')](0x0);var events={'afterCreate':_0x9ea6('0x3'),'afterUpdate':_0x9ea6('0x4'),'afterDestroy':_0x9ea6('0x5')};function emitEvent(_0x43df72){return function(_0x2326e9,_0x58927f,_0x43ecb9){ChatInternalMessageEvents[_0x9ea6('0x6')](_0x43df72+':'+_0x2326e9['id'],_0x2326e9);ChatInternalMessageEvents[_0x9ea6('0x6')](_0x43df72,_0x2326e9);_0x43ecb9(null);};}for(var e in events){if(events[_0x9ea6('0x7')](e)){var event=events[e];ChatInternalMessage[_0x9ea6('0x8')](e,emitEvent(event));}}module[_0x9ea6('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index de6e50f..7d0361d 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 _0x58be=['rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x58be,0x158));var _0xe58b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x58be[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xe58b('0x0'));var util=require(_0xe58b('0x1'));var logger=require('../../config/logger')(_0xe58b('0x2'));var moment=require(_0xe58b('0x3'));var BPromise=require('bluebird');var rp=require(_0xe58b('0x4'));var fs=require('fs');var path=require(_0xe58b('0x5'));var rimraf=require(_0xe58b('0x6'));var config=require(_0xe58b('0x7'));var attributes=require(_0xe58b('0x8'));module['exports']=function(_0x1f1237,_0x4cdbe9){return _0x1f1237[_0xe58b('0x9')](_0xe58b('0xa'),attributes,{'tableName':_0xe58b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe58b('0xc'),'collate':_0xe58b('0xd')});};
\ No newline at end of file
+var _0xc006=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x31ed20,_0x2709b4){var _0x2379c9=function(_0x20ed02){while(--_0x20ed02){_0x31ed20['push'](_0x31ed20['shift']());}};_0x2379c9(++_0x2709b4);}(_0xc006,0x1de));var _0x6c00=function(_0x5c8f3e,_0x33ba70){_0x5c8f3e=_0x5c8f3e-0x0;var _0xb55f35=_0xc006[_0x5c8f3e];return _0xb55f35;};'use strict';var _=require(_0x6c00('0x0'));var util=require(_0x6c00('0x1'));var logger=require(_0x6c00('0x2'))(_0x6c00('0x3'));var moment=require(_0x6c00('0x4'));var BPromise=require(_0x6c00('0x5'));var rp=require(_0x6c00('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c00('0x7'));var config=require(_0x6c00('0x8'));var attributes=require(_0x6c00('0x9'));module[_0x6c00('0xa')]=function(_0x215e5b,_0x25671c){return _0x215e5b[_0x6c00('0xb')]('ChatInternalMessage',attributes,{'tableName':_0x6c00('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6c00('0xd'),'collate':_0x6c00('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 9ac1786..335eb99 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 _0x0b31=['then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request'];(function(_0x4ed32d,_0x327695){var _0xf624df=function(_0x29518c){while(--_0x29518c){_0x4ed32d['push'](_0x4ed32d['shift']());}};_0xf624df(++_0x327695);}(_0x0b31,0x1a2));var _0x10b3=function(_0x59f15c,_0x24bf17){_0x59f15c=_0x59f15c-0x0;var _0xfb1050=_0x0b31[_0x59f15c];return _0xfb1050;};'use strict';var _=require(_0x10b3('0x0'));var util=require(_0x10b3('0x1'));var moment=require(_0x10b3('0x2'));var BPromise=require('bluebird');var rs=require(_0x10b3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x10b3('0x4'));var logger=require(_0x10b3('0x5'))(_0x10b3('0x6'));var config=require(_0x10b3('0x7'));var jayson=require(_0x10b3('0x8'));var client=jayson[_0x10b3('0x9')][_0x10b3('0xa')]({'port':0x232a});config[_0x10b3('0xb')]=_[_0x10b3('0xc')](config['redis'],{'host':_0x10b3('0xd'),'port':0x18eb});var socket=require(_0x10b3('0xe'))(new Redis(config[_0x10b3('0xb')]));require(_0x10b3('0xf'))['register'](socket);function respondWithRpcPromise(_0x1fd8a6,_0x38c841,_0x5dc288){return new BPromise(function(_0x133c70,_0x43aaf2){return client[_0x10b3('0x10')](_0x1fd8a6,_0x5dc288)[_0x10b3('0x11')](function(_0x3341e4){logger['info'](_0x10b3('0x12'),_0x38c841,_0x10b3('0x13'));logger[_0x10b3('0x14')](_0x10b3('0x15'),_0x38c841,'request\x20sent',JSON[_0x10b3('0x16')](_0x3341e4));if(_0x3341e4[_0x10b3('0x17')]){if(_0x3341e4[_0x10b3('0x17')][_0x10b3('0x18')]===0x1f4){logger[_0x10b3('0x17')](_0x10b3('0x12'),_0x38c841,_0x3341e4[_0x10b3('0x17')][_0x10b3('0x19')]);return _0x43aaf2(_0x3341e4['error']['message']);}logger['error'](_0x10b3('0x12'),_0x38c841,_0x3341e4['error'][_0x10b3('0x19')]);return _0x133c70(_0x3341e4[_0x10b3('0x17')]['message']);}else{logger[_0x10b3('0x1a')](_0x10b3('0x12'),_0x38c841,'request\x20sent');_0x133c70(_0x3341e4[_0x10b3('0x1b')][_0x10b3('0x19')]);}})[_0x10b3('0x1c')](function(_0x19e3fe){logger['error'](_0x10b3('0x12'),_0x38c841,_0x19e3fe);_0x43aaf2(_0x19e3fe);});});}
\ No newline at end of file
+var _0xbe43=['../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4ded39,_0x146dd4){var _0x1259b1=function(_0x3f3ae4){while(--_0x3f3ae4){_0x4ded39['push'](_0x4ded39['shift']());}};_0x1259b1(++_0x146dd4);}(_0xbe43,0xbb));var _0x3be4=function(_0x2cc338,_0x5585d8){_0x2cc338=_0x2cc338-0x0;var _0x2a8920=_0xbe43[_0x2cc338];return _0x2a8920;};'use strict';var _=require(_0x3be4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3be4('0x1'));var fs=require('fs');var Redis=require(_0x3be4('0x2'));var db=require(_0x3be4('0x3'))['db'];var utils=require(_0x3be4('0x4'));var logger=require(_0x3be4('0x5'))('rpc');var config=require(_0x3be4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3be4('0x7')][_0x3be4('0x8')]({'port':0x232a});config[_0x3be4('0x9')]=_['defaults'](config['redis'],{'host':_0x3be4('0xa'),'port':0x18eb});var socket=require(_0x3be4('0xb'))(new Redis(config[_0x3be4('0x9')]));require(_0x3be4('0xc'))['register'](socket);function respondWithRpcPromise(_0x3d7c0d,_0x15b4e6,_0x5ef2ea){return new BPromise(function(_0x11209b,_0x5effd4){return client[_0x3be4('0xd')](_0x3d7c0d,_0x5ef2ea)[_0x3be4('0xe')](function(_0x4ae979){logger[_0x3be4('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x15b4e6,_0x3be4('0x10'));logger['debug'](_0x3be4('0x11'),_0x15b4e6,_0x3be4('0x10'),JSON[_0x3be4('0x12')](_0x4ae979));if(_0x4ae979[_0x3be4('0x13')]){if(_0x4ae979[_0x3be4('0x13')][_0x3be4('0x14')]===0x1f4){logger['error'](_0x3be4('0x15'),_0x15b4e6,_0x4ae979[_0x3be4('0x13')]['message']);return _0x5effd4(_0x4ae979[_0x3be4('0x13')][_0x3be4('0x16')]);}logger['error'](_0x3be4('0x15'),_0x15b4e6,_0x4ae979['error'][_0x3be4('0x16')]);return _0x11209b(_0x4ae979['error'][_0x3be4('0x16')]);}else{logger[_0x3be4('0xf')](_0x3be4('0x15'),_0x15b4e6,_0x3be4('0x10'));_0x11209b(_0x4ae979[_0x3be4('0x17')][_0x3be4('0x16')]);}})['catch'](function(_0x547a92){logger[_0x3be4('0x13')](_0x3be4('0x15'),_0x15b4e6,_0x547a92);_0x5effd4(_0x547a92);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 0d4bfdc..4cd5f7c 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 _0xfc00=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update'];(function(_0x237a26,_0x4d9a41){var _0x2b12c9=function(_0x4103f5){while(--_0x4103f5){_0x237a26['push'](_0x237a26['shift']());}};_0x2b12c9(++_0x4d9a41);}(_0xfc00,0x1d5));var _0x0fc0=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0xfc00[_0x3826ad];return _0x17b900;};'use strict';var ChatInternalMessageEvents=require(_0x0fc0('0x0'));var events=['save',_0x0fc0('0x1'),_0x0fc0('0x2')];function createListener(_0xcc99d7,_0xa5cc2){return function(_0x5e49dd){_0xa5cc2[_0x0fc0('0x3')](_0xcc99d7,_0x5e49dd);};}function removeListener(_0x9b95e5,_0x3832bb){return function(){ChatInternalMessageEvents[_0x0fc0('0x4')](_0x9b95e5,_0x3832bb);};}exports[_0x0fc0('0x5')]=function(_0x582b65){for(var _0x4b540a=0x0,_0x43e07f=events[_0x0fc0('0x6')];_0x4b540a<_0x43e07f;_0x4b540a++){var _0x42942d=events[_0x4b540a];var _0xe0939d=createListener(_0x0fc0('0x7')+_0x42942d,_0x582b65);ChatInternalMessageEvents['on'](_0x42942d,_0xe0939d);}};
\ No newline at end of file
+var _0xacea=['update','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xacea,0x1ed));var _0xaace=function(_0x21e75a,_0x40dc8a){_0x21e75a=_0x21e75a-0x0;var _0x6972f8=_0xacea[_0x21e75a];return _0x6972f8;};'use strict';var ChatInternalMessageEvents=require(_0xaace('0x0'));var events=[_0xaace('0x1'),_0xaace('0x2'),_0xaace('0x3')];function createListener(_0x53a913,_0x22ac89){return function(_0x335bb4){_0x22ac89['emit'](_0x53a913,_0x335bb4);};}function removeListener(_0x376786,_0x92c34){return function(){ChatInternalMessageEvents[_0xaace('0x4')](_0x376786,_0x92c34);};}exports[_0xaace('0x5')]=function(_0x203fcf){for(var _0x30e7b0=0x0,_0x52a453=events[_0xaace('0x6')];_0x30e7b0<_0x52a453;_0x30e7b0++){var _0x4d6d51=events[_0x30e7b0];var _0xbd98e0=createListener(_0xaace('0x7')+_0x4d6d51,_0x203fcf);ChatInternalMessageEvents['on'](_0x4d6d51,_0xbd98e0);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index ef909c8..c956304 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 _0xfe8d=['/:id','show','post','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers'];(function(_0x2bd7ef,_0x279212){var _0x42e78a=function(_0x1369d4){while(--_0x1369d4){_0x2bd7ef['push'](_0x2bd7ef['shift']());}};_0x42e78a(++_0x279212);}(_0xfe8d,0x15b));var _0xdfe8=function(_0x3f98a7,_0x2230ae){_0x3f98a7=_0x3f98a7-0x0;var _0x190227=_0xfe8d[_0x3f98a7];return _0x190227;};'use strict';var multer=require(_0xdfe8('0x0'));var util=require(_0xdfe8('0x1'));var path=require('path');var timeout=require(_0xdfe8('0x2'));var express=require(_0xdfe8('0x3'));var router=express[_0xdfe8('0x4')]();var fs_extra=require(_0xdfe8('0x5'));var auth=require(_0xdfe8('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdfe8('0x7'));router[_0xdfe8('0x8')]('/',auth[_0xdfe8('0x9')](),controller['index']);router['get'](_0xdfe8('0xa'),auth[_0xdfe8('0x9')](),controller[_0xdfe8('0xb')]);router[_0xdfe8('0x8')](_0xdfe8('0xc'),auth[_0xdfe8('0x9')](),controller[_0xdfe8('0xd')]);router[_0xdfe8('0x8')](_0xdfe8('0xe'),auth[_0xdfe8('0x9')](),controller[_0xdfe8('0xf')]);router[_0xdfe8('0x10')]('/',auth[_0xdfe8('0x9')](),controller['create']);router['put'](_0xdfe8('0xe'),controller['update']);router[_0xdfe8('0x11')](_0xdfe8('0xe'),auth[_0xdfe8('0x9')](),controller['destroy']);module[_0xdfe8('0x12')]=router;
\ No newline at end of file
+var _0x0b59=['index','/describe','describe','/users','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get'];(function(_0x391127,_0x5cb2df){var _0x3c4c11=function(_0x350e7){while(--_0x350e7){_0x391127['push'](_0x391127['shift']());}};_0x3c4c11(++_0x5cb2df);}(_0x0b59,0xae));var _0x90b5=function(_0x6a3b0,_0x3ffffe){_0x6a3b0=_0x6a3b0-0x0;var _0x124558=_0x0b59[_0x6a3b0];return _0x124558;};'use strict';var multer=require(_0x90b5('0x0'));var util=require(_0x90b5('0x1'));var path=require(_0x90b5('0x2'));var timeout=require(_0x90b5('0x3'));var express=require(_0x90b5('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x90b5('0x5'));var interaction=require(_0x90b5('0x6'));var config=require(_0x90b5('0x7'));var controller=require(_0x90b5('0x8'));router[_0x90b5('0x9')]('/',auth['isAuthenticated'](),controller[_0x90b5('0xa')]);router[_0x90b5('0x9')](_0x90b5('0xb'),auth['isAuthenticated'](),controller[_0x90b5('0xc')]);router[_0x90b5('0x9')](_0x90b5('0xd'),auth[_0x90b5('0xe')](),controller['getUsers']);router[_0x90b5('0x9')](_0x90b5('0xf'),auth[_0x90b5('0xe')](),controller[_0x90b5('0x10')]);router['post']('/',auth[_0x90b5('0xe')](),controller[_0x90b5('0x11')]);router[_0x90b5('0x12')](_0x90b5('0xf'),controller[_0x90b5('0x13')]);router[_0x90b5('0x14')]('/:id',auth[_0x90b5('0xe')](),controller[_0x90b5('0x15')]);module[_0x90b5('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 89096bb..ce2fe3f 100644
--- a/server/api/chatMessage/chatMessage.attributes.js
+++ b/server/api/chatMessage/chatMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6f59=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x4a74e,_0x51c3e2){var _0x527e45=function(_0x204fd6){while(--_0x204fd6){_0x4a74e['push'](_0x4a74e['shift']());}};_0x527e45(++_0x51c3e2);}(_0x6f59,0x1be));var _0x96f5=function(_0x575d29,_0x45a14c){_0x575d29=_0x575d29-0x0;var _0x236d7b=_0x6f59[_0x575d29];return _0x236d7b;};'use strict';var Sequelize=require(_0x96f5('0x0'));module[_0x96f5('0x1')]={'body':{'type':Sequelize[_0x96f5('0x2')](_0x96f5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x96f5('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x96f5('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x96f5('0x5')]('in',_0x96f5('0x6')),'defaultValue':_0x96f5('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x96f5('0x7')]},'providerName':{'type':Sequelize[_0x96f5('0x8')]},'providerResponse':{'type':Sequelize[_0x96f5('0x2')]}};
\ No newline at end of file
+var _0x8580=['medium','ENUM','out','DATE','STRING','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8580,0x1c7));var _0x0858=function(_0x1ded08,_0x137e95){_0x1ded08=_0x1ded08-0x0;var _0x290eff=_0x8580[_0x1ded08];return _0x290eff;};'use strict';var Sequelize=require('sequelize');module[_0x0858('0x0')]={'body':{'type':Sequelize['TEXT'](_0x0858('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0858('0x2')]('in',_0x0858('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x0858('0x4')]},'providerName':{'type':Sequelize[_0x0858('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 961ae93..5e2b0e4 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 _0xfe9f=['UserId','user','get','ChatInteraction','ChatInteractionId','interaction','role','null','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','agent','fullname','internal','interface','format','channel','motionChannel','formData','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','destroy','end','sendStatus','name','send','index','map','ChatMessage','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','create','body','update','describe','accept','acceptMessage','reject'];(function(_0x2e2a99,_0x38d7dd){var _0x38a24f=function(_0x1ae082){while(--_0x1ae082){_0x2e2a99['push'](_0x2e2a99['shift']());}};_0x38a24f(++_0x38d7dd);}(_0xfe9f,0x1a6));var _0xffe9=function(_0x2756f9,_0x5519f5){_0x2756f9=_0x2756f9-0x0;var _0x2dad62=_0xfe9f[_0x2756f9];return _0x2dad62;};'use strict';var util=require('util');var _=require(_0xffe9('0x0'));var Redis=require(_0xffe9('0x1'));var interactionService=require(_0xffe9('0x2'));var qs=require(_0xffe9('0x3'));var logger=require(_0xffe9('0x4'))(_0xffe9('0x5'));var config=require(_0xffe9('0x6'));var db=require('../../mysqldb')['db'];config[_0xffe9('0x7')]=_[_0xffe9('0x8')](config[_0xffe9('0x7')],{'host':_0xffe9('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xffe9('0x7')]));require(_0xffe9('0xa'))[_0xffe9('0xb')](socket);var jayson=require(_0xffe9('0xc'));var client=jayson[_0xffe9('0xd')][_0xffe9('0xe')]({'port':0x232c});var client9002=jayson['client'][_0xffe9('0xe')]({'port':0x232a});var interaction_log=require('../../config/logger')('chat-interactions');function respondWithRpcPromise(_0x2fa821,_0x903c2e,_0x28c656,_0x19dce3){return new Promise(function(_0x5463bf,_0x52ed56){var _0xcad036=_0x19dce3||client;return _0xcad036[_0xffe9('0xf')](_0x2fa821,_0x28c656)[_0xffe9('0x10')](function(_0x1e18ef){logger[_0xffe9('0x11')](_0xffe9('0x12'),_0x903c2e,'request\x20sent');logger[_0xffe9('0x13')](_0xffe9('0x14'),_0x903c2e,'request\x20sent',JSON[_0xffe9('0x15')](_0x1e18ef));if(_0x1e18ef[_0xffe9('0x16')]){if(_0x1e18ef[_0xffe9('0x16')][_0xffe9('0x17')]===0x1f4){logger['error'](_0xffe9('0x12'),_0x903c2e,_0x1e18ef[_0xffe9('0x16')][_0xffe9('0x18')]);return _0x52ed56(_0x1e18ef['error']['message']);}logger[_0xffe9('0x16')]('ChatMessage,\x20%s,\x20%s',_0x903c2e,_0x1e18ef[_0xffe9('0x16')][_0xffe9('0x18')]);return _0x5463bf(_0x1e18ef[_0xffe9('0x16')][_0xffe9('0x18')]);}else{logger[_0xffe9('0x11')]('ChatMessage,\x20%s,\x20%s',_0x903c2e,_0xffe9('0x19'));_0x5463bf(_0x1e18ef[_0xffe9('0x1a')]['message']);}})[_0xffe9('0x1b')](function(_0x5e19cd){logger[_0xffe9('0x16')](_0xffe9('0x12'),_0x903c2e,_0x5e19cd);_0x52ed56(_0x5e19cd);});});}function respondWithResult(_0x4fbad9,_0x3a0c2d){_0x3a0c2d=_0x3a0c2d||0xc8;return function(_0x3433d6){if(_0x3433d6){return _0x4fbad9[_0xffe9('0x1c')](_0x3a0c2d)[_0xffe9('0x1d')](_0x3433d6);}};}function respondWithFilteredResult(_0x46dacc,_0x14bb0a){return function(_0x4d7b76){if(_0x4d7b76){var _0x308f96=typeof _0x14bb0a[_0xffe9('0x1e')]===_0xffe9('0x1f')&&typeof _0x14bb0a[_0xffe9('0x20')]==='undefined';var _0x35d086=_0x4d7b76[_0xffe9('0x21')];var _0x2d5004=_0x308f96?0x0:_0x14bb0a[_0xffe9('0x1e')];var _0x407f45=_0x308f96?_0x4d7b76[_0xffe9('0x21')]:_0x14bb0a[_0xffe9('0x1e')]+_0x14bb0a[_0xffe9('0x20')];var _0x480c06;if(_0x407f45>=_0x35d086){_0x407f45=_0x35d086;_0x480c06=0xc8;}else{_0x480c06=0xce;}_0x46dacc[_0xffe9('0x1c')](_0x480c06);return _0x46dacc[_0xffe9('0x22')](_0xffe9('0x23'),_0x2d5004+'-'+_0x407f45+'/'+_0x35d086)[_0xffe9('0x1d')](_0x4d7b76);}return null;};}function saveUpdates(_0x193077){return function(_0x2bd8e2){if(_0x2bd8e2){return _0x2bd8e2['update'](_0x193077)[_0xffe9('0x10')](function(_0x53f53b){return _0x53f53b;});}return null;};}function removeEntity(_0x133d8c){return function(_0x11ce63){if(_0x11ce63){return _0x11ce63[_0xffe9('0x24')]()[_0xffe9('0x10')](function(){_0x133d8c[_0xffe9('0x1c')](0xcc)[_0xffe9('0x25')]();});}};}function handleEntityNotFound(_0x5c3d76){return function(_0x384a54){if(!_0x384a54){_0x5c3d76[_0xffe9('0x26')](0x194);}return _0x384a54;};}function handleError(_0x5b482e,_0x2e28e6){_0x2e28e6=_0x2e28e6||0x1f4;return function(_0x58c39b){logger[_0xffe9('0x16')](_0x58c39b['stack']);if(_0x58c39b[_0xffe9('0x27')]){delete _0x58c39b[_0xffe9('0x27')];}_0x5b482e[_0xffe9('0x1c')](_0x2e28e6)[_0xffe9('0x28')](_0x58c39b);};}exports[_0xffe9('0x29')]=function(_0xea2802,_0x1e0397){var _0x329c27={},_0xe7b9f1={},_0x3a56fa={'count':0x0,'rows':[]};var _0x320afa=_[_0xffe9('0x2a')](db[_0xffe9('0x2b')]['rawAttributes'],function(_0x5616c4){return{'name':_0x5616c4[_0xffe9('0x2c')],'type':_0x5616c4[_0xffe9('0x2d')][_0xffe9('0x2e')]};});_0xe7b9f1[_0xffe9('0x2f')]=_['map'](_0x320afa,_0xffe9('0x27'));_0xe7b9f1['query']=_[_0xffe9('0x30')](_0xea2802[_0xffe9('0x31')]);_0xe7b9f1[_0xffe9('0x32')]=_[_0xffe9('0x33')](_0xe7b9f1[_0xffe9('0x2f')],_0xe7b9f1[_0xffe9('0x31')]);_0x329c27[_0xffe9('0x34')]=_['intersection'](_0xe7b9f1[_0xffe9('0x2f')],qs[_0xffe9('0x35')](_0xea2802[_0xffe9('0x31')]['fields']));_0x329c27[_0xffe9('0x34')]=_0x329c27[_0xffe9('0x34')][_0xffe9('0x36')]?_0x329c27[_0xffe9('0x34')]:_0xe7b9f1['model'];if(!_0xea2802[_0xffe9('0x31')][_0xffe9('0x37')]('nolimit')){_0x329c27['limit']=qs[_0xffe9('0x20')](_0xea2802['query'][_0xffe9('0x20')]);_0x329c27[_0xffe9('0x1e')]=qs[_0xffe9('0x1e')](_0xea2802[_0xffe9('0x31')][_0xffe9('0x1e')]);}_0x329c27[_0xffe9('0x38')]=qs[_0xffe9('0x39')](_0xea2802[_0xffe9('0x31')][_0xffe9('0x39')]);_0x329c27[_0xffe9('0x3a')]=qs[_0xffe9('0x32')](_[_0xffe9('0x3b')](_0xea2802[_0xffe9('0x31')],_0xe7b9f1[_0xffe9('0x32')]),_0x320afa);if(_0xea2802[_0xffe9('0x31')][_0xffe9('0x3c')]){_0x329c27[_0xffe9('0x3a')]=_['merge'](_0x329c27[_0xffe9('0x3a')],{'$or':_[_0xffe9('0x2a')](_0x320afa,function(_0x402aca){if(_0x402aca['type']!==_0xffe9('0x3d')){var _0x22412f={};_0x22412f[_0x402aca[_0xffe9('0x27')]]={'$like':'%'+_0xea2802['query']['filter']+'%'};return _0x22412f;}})});}_0x329c27=_['merge']({},_0x329c27,_0xea2802['options']);var _0x5af17c={'where':_0x329c27['where']};return db[_0xffe9('0x2b')][_0xffe9('0x21')](_0x5af17c)[_0xffe9('0x10')](function(_0x2c9374){_0x3a56fa['count']=_0x2c9374;if(_0xea2802[_0xffe9('0x31')][_0xffe9('0x3e')]){_0x329c27[_0xffe9('0x3f')]=[{'all':!![]}];}return db[_0xffe9('0x2b')][_0xffe9('0x40')](_0x329c27);})[_0xffe9('0x10')](function(_0x1d8c6e){_0x3a56fa[_0xffe9('0x41')]=_0x1d8c6e;return _0x3a56fa;})[_0xffe9('0x10')](respondWithFilteredResult(_0x1e0397,_0x329c27))[_0xffe9('0x1b')](handleError(_0x1e0397,null));};exports[_0xffe9('0x42')]=function(_0x379194,_0x2629e0){var _0x5d2c0f={'raw':!![],'where':{'id':_0x379194[_0xffe9('0x43')]['id']}},_0x45041a={};_0x45041a[_0xffe9('0x2f')]=_[_0xffe9('0x30')](db[_0xffe9('0x2b')][_0xffe9('0x44')]);_0x45041a[_0xffe9('0x31')]=_['keys'](_0x379194[_0xffe9('0x31')]);_0x45041a['filters']=_[_0xffe9('0x33')](_0x45041a[_0xffe9('0x2f')],_0x45041a[_0xffe9('0x31')]);_0x5d2c0f[_0xffe9('0x34')]=_['intersection'](_0x45041a[_0xffe9('0x2f')],qs['fields'](_0x379194['query'][_0xffe9('0x35')]));_0x5d2c0f['attributes']=_0x5d2c0f['attributes']['length']?_0x5d2c0f[_0xffe9('0x34')]:_0x45041a[_0xffe9('0x2f')];if(_0x379194[_0xffe9('0x31')][_0xffe9('0x3e')]){_0x5d2c0f[_0xffe9('0x3f')]=[{'all':!![]}];}_0x5d2c0f=_['merge']({},_0x5d2c0f,_0x379194[_0xffe9('0x45')]);return db[_0xffe9('0x2b')][_0xffe9('0x46')](_0x5d2c0f)[_0xffe9('0x10')](handleEntityNotFound(_0x2629e0,null))[_0xffe9('0x10')](respondWithResult(_0x2629e0,null))[_0xffe9('0x1b')](handleError(_0x2629e0,null));};exports[_0xffe9('0x47')]=function(_0x3fbf1f,_0x420099){return db[_0xffe9('0x2b')][_0xffe9('0x47')](_0x3fbf1f[_0xffe9('0x48')],{})[_0xffe9('0x10')](respondWithResult(_0x420099,0xc9))[_0xffe9('0x1b')](handleError(_0x420099,null));};exports[_0xffe9('0x49')]=function(_0x4a3303,_0x410f99){if(_0x4a3303[_0xffe9('0x48')]['id']){delete _0x4a3303[_0xffe9('0x48')]['id'];}return db[_0xffe9('0x2b')][_0xffe9('0x46')]({'where':{'id':_0x4a3303[_0xffe9('0x43')]['id']}})[_0xffe9('0x10')](handleEntityNotFound(_0x410f99,null))[_0xffe9('0x10')](saveUpdates(_0x4a3303[_0xffe9('0x48')],null))[_0xffe9('0x10')](respondWithResult(_0x410f99,null))['catch'](handleError(_0x410f99,null));};exports[_0xffe9('0x24')]=function(_0x20548a,_0xe1e51f){return db['ChatMessage']['find']({'where':{'id':_0x20548a[_0xffe9('0x43')]['id']}})['then'](handleEntityNotFound(_0xe1e51f,null))['then'](removeEntity(_0xe1e51f,null))['catch'](handleError(_0xe1e51f,null));};exports[_0xffe9('0x4a')]=function(_0x2a15ad,_0x49eecb){return db['ChatMessage']['describe']()[_0xffe9('0x10')](respondWithResult(_0x49eecb,null))[_0xffe9('0x1b')](handleError(_0x49eecb,null));};exports[_0xffe9('0x4b')]=function(_0x4ad57c,_0x534448){var _0x223926='chat';return interactionService[_0xffe9('0x4c')](_0x4ad57c,_0x223926)['then'](respondWithResult(_0x534448,null))['catch'](handleError(_0x534448,null));};exports[_0xffe9('0x4d')]=function(_0x58167e,_0x1a92ef){var _0x1cb4cb={'agent':{},'channel':'chat'};if(_0x58167e['body']['id']){delete _0x58167e[_0xffe9('0x48')]['id'];}_0x58167e[_0xffe9('0x48')][_0xffe9('0x4e')]=_0x58167e['body']['UserId']||_0x58167e[_0xffe9('0x4f')]['id'];_0x1cb4cb['agent']['id']=_0x58167e[_0xffe9('0x48')][_0xffe9('0x4e')];return db[_0xffe9('0x2b')][_0xffe9('0x46')]({'where':{'id':_0x58167e[_0xffe9('0x43')]['id'],'UserId':null}})[_0xffe9('0x10')](handleEntityNotFound(_0x1a92ef,null))[_0xffe9('0x10')](function(_0x3aae2c){if(_0x3aae2c){_0x1cb4cb[_0xffe9('0x18')]=_0x3aae2c[_0xffe9('0x50')]({'plain':!![]});return db[_0xffe9('0x51')]['find']({'where':{'id':_0x3aae2c[_0xffe9('0x52')]}});}return null;})[_0xffe9('0x10')](handleEntityNotFound(_0x1a92ef,null))['then'](function(_0x3c6a6b){if(_0x3c6a6b){_0x1cb4cb[_0xffe9('0x53')]=_0x3c6a6b['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x58167e[_0xffe9('0x4f')]['id'],_0x58167e[_0xffe9('0x4f')][_0xffe9('0x27')],_0x58167e[_0xffe9('0x4f')][_0xffe9('0x54')],_0x1cb4cb[_0xffe9('0x53')]['id'],_0x58167e[_0xffe9('0x48')]?JSON[_0xffe9('0x15')](_0x58167e[_0xffe9('0x48')]):_0xffe9('0x55'));return respondWithRpcPromise(_0xffe9('0x56'),'rejectMessage',_0x1cb4cb);}return null;})[_0xffe9('0x10')](function(_0x4ab3f7){var _0x19afc8=_0xffe9('0x57')+_0x4ab3f7['message'][_0xffe9('0x58')];return db['sequelize']['query'](_0x19afc8,{'type':db[_0xffe9('0x59')][_0xffe9('0x5a')]['SELECT'],'raw':!![]})[_0xffe9('0x10')](function(_0x346888){return _0x346888;});})['then'](function(_0x312ef7){if(_0x312ef7){_0x1cb4cb['message'][_0xffe9('0x5b')]=_0x312ef7[0x0];if(!_0x58167e[_0xffe9('0x48')]['UserId'])return;return db['User'][_0xffe9('0x46')]({'where':{'id':_0x58167e[_0xffe9('0x48')][_0xffe9('0x4e')],'role':_0xffe9('0x5c')},'attributes':['id',_0xffe9('0x27'),_0xffe9('0x5d'),'email',_0xffe9('0x5e')],'raw':!![]});}return null;})['then'](function(_0x3b609b){if(!_0x3b609b)return null;_0x1cb4cb[_0xffe9('0x18')][_0xffe9('0x5c')]=_0x3b609b;return _0x1cb4cb;})[_0xffe9('0x10')](function(_0x1501db){if(_0x1501db){_0x1501db[_0xffe9('0x18')][_0xffe9('0x5f')]=util[_0xffe9('0x60')]('SIP/%s',_0x58167e[_0xffe9('0x4f')][_0xffe9('0x27')]);_0x1501db[_0xffe9('0x18')][_0xffe9('0x61')]=_0x1cb4cb[_0xffe9('0x61')];_0x1501db[_0xffe9('0x18')][_0xffe9('0x62')]=_0x1cb4cb['channel'];_0x1501db[_0xffe9('0x18')]['event']=_0xffe9('0x4d');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_['merge'](_0x1cb4cb[_0xffe9('0x18')],JSON['parse'](_0x1cb4cb[_0xffe9('0x53')][_0xffe9('0x63')]))},client9002);return _0x1cb4cb;}return null;})[_0xffe9('0x10')](respondWithResult(_0x1a92ef,null))['catch'](handleError(_0x1a92ef,null));};
\ No newline at end of file
+var _0x0e87=['../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','chat-interactions','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','count','limit','Content-Range','json','update','destroy','sendStatus','stack','name','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','rows','includeAll','create','body','find','params','describe','chat','acceptMessage','reject','UserId','user','agent','get','ChatInteraction','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','internal','interface','format','SIP/%s','channel','motionChannel','EventManager','rejectmessage','interaction','util','lodash','../../components/interaction/service'];(function(_0x9709ce,_0x5765af){var _0x414c87=function(_0x51149b){while(--_0x51149b){_0x9709ce['push'](_0x9709ce['shift']());}};_0x414c87(++_0x5765af);}(_0x0e87,0x64));var _0x70e8=function(_0x1b72de,_0x525ddc){_0x1b72de=_0x1b72de-0x0;var _0x17618f=_0x0e87[_0x1b72de];return _0x17618f;};'use strict';var util=require(_0x70e8('0x0'));var _=require(_0x70e8('0x1'));var Redis=require('ioredis');var interactionService=require(_0x70e8('0x2'));var qs=require(_0x70e8('0x3'));var logger=require(_0x70e8('0x4'))(_0x70e8('0x5'));var config=require(_0x70e8('0x6'));var db=require(_0x70e8('0x7'))['db'];config[_0x70e8('0x8')]=_[_0x70e8('0x9')](config[_0x70e8('0x8')],{'host':_0x70e8('0xa'),'port':0x18eb});var socket=require(_0x70e8('0xb'))(new Redis(config['redis']));require(_0x70e8('0xc'))[_0x70e8('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0x70e8('0xe')][_0x70e8('0xf')]({'port':0x232c});var client9002=jayson[_0x70e8('0xe')][_0x70e8('0xf')]({'port':0x232a});var interaction_log=require(_0x70e8('0x4'))(_0x70e8('0x10'));function respondWithRpcPromise(_0x40b2f8,_0x64512f,_0x763b4e,_0x3c7ff0){return new Promise(function(_0x13f9df,_0xcb74ad){var _0x3f618d=_0x3c7ff0||client;return _0x3f618d[_0x70e8('0x11')](_0x40b2f8,_0x763b4e)[_0x70e8('0x12')](function(_0x3b6e81){logger[_0x70e8('0x13')](_0x70e8('0x14'),_0x64512f,_0x70e8('0x15'));logger[_0x70e8('0x16')](_0x70e8('0x17'),_0x64512f,'request\x20sent',JSON[_0x70e8('0x18')](_0x3b6e81));if(_0x3b6e81[_0x70e8('0x19')]){if(_0x3b6e81[_0x70e8('0x19')][_0x70e8('0x1a')]===0x1f4){logger[_0x70e8('0x19')](_0x70e8('0x14'),_0x64512f,_0x3b6e81[_0x70e8('0x19')]['message']);return _0xcb74ad(_0x3b6e81[_0x70e8('0x19')][_0x70e8('0x1b')]);}logger[_0x70e8('0x19')]('ChatMessage,\x20%s,\x20%s',_0x64512f,_0x3b6e81[_0x70e8('0x19')][_0x70e8('0x1b')]);return _0x13f9df(_0x3b6e81[_0x70e8('0x19')][_0x70e8('0x1b')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x64512f,_0x70e8('0x15'));_0x13f9df(_0x3b6e81[_0x70e8('0x1c')]['message']);}})[_0x70e8('0x1d')](function(_0x42eca9){logger[_0x70e8('0x19')](_0x70e8('0x14'),_0x64512f,_0x42eca9);_0xcb74ad(_0x42eca9);});});}function respondWithResult(_0x2d1e4b,_0x3a68b4){_0x3a68b4=_0x3a68b4||0xc8;return function(_0x458d22){if(_0x458d22){return _0x2d1e4b[_0x70e8('0x1e')](_0x3a68b4)['json'](_0x458d22);}};}function respondWithFilteredResult(_0x294f9b,_0x3a5d00){return function(_0x4cbc81){if(_0x4cbc81){var _0x241645=typeof _0x3a5d00[_0x70e8('0x1f')]==='undefined'&&typeof _0x3a5d00['limit']===_0x70e8('0x20');var _0x3bd1c5=_0x4cbc81['count'];var _0x37b862=_0x241645?0x0:_0x3a5d00[_0x70e8('0x1f')];var _0x9c664a=_0x241645?_0x4cbc81[_0x70e8('0x21')]:_0x3a5d00[_0x70e8('0x1f')]+_0x3a5d00[_0x70e8('0x22')];var _0x1882d5;if(_0x9c664a>=_0x3bd1c5){_0x9c664a=_0x3bd1c5;_0x1882d5=0xc8;}else{_0x1882d5=0xce;}_0x294f9b[_0x70e8('0x1e')](_0x1882d5);return _0x294f9b['set'](_0x70e8('0x23'),_0x37b862+'-'+_0x9c664a+'/'+_0x3bd1c5)[_0x70e8('0x24')](_0x4cbc81);}return null;};}function saveUpdates(_0x16fd20){return function(_0x128471){if(_0x128471){return _0x128471[_0x70e8('0x25')](_0x16fd20)['then'](function(_0x4550bd){return _0x4550bd;});}return null;};}function removeEntity(_0x7d5821){return function(_0x10091f){if(_0x10091f){return _0x10091f[_0x70e8('0x26')]()[_0x70e8('0x12')](function(){_0x7d5821[_0x70e8('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e9d43){return function(_0x25dc34){if(!_0x25dc34){_0x3e9d43[_0x70e8('0x27')](0x194);}return _0x25dc34;};}function handleError(_0x53a543,_0x39905f){_0x39905f=_0x39905f||0x1f4;return function(_0x58eb84){logger['error'](_0x58eb84[_0x70e8('0x28')]);if(_0x58eb84[_0x70e8('0x29')]){delete _0x58eb84[_0x70e8('0x29')];}_0x53a543['status'](_0x39905f)['send'](_0x58eb84);};}exports['index']=function(_0x1cd4dc,_0x2eb92a){var _0x1ee6e2={},_0x11eba0={},_0x29a1be={'count':0x0,'rows':[]};var _0x3990ab=_['map'](db[_0x70e8('0x2a')][_0x70e8('0x2b')],function(_0x3f4f5b){return{'name':_0x3f4f5b[_0x70e8('0x2c')],'type':_0x3f4f5b[_0x70e8('0x2d')][_0x70e8('0x2e')]};});_0x11eba0[_0x70e8('0x2f')]=_['map'](_0x3990ab,_0x70e8('0x29'));_0x11eba0[_0x70e8('0x30')]=_[_0x70e8('0x31')](_0x1cd4dc[_0x70e8('0x30')]);_0x11eba0[_0x70e8('0x32')]=_[_0x70e8('0x33')](_0x11eba0['model'],_0x11eba0[_0x70e8('0x30')]);_0x1ee6e2[_0x70e8('0x34')]=_[_0x70e8('0x33')](_0x11eba0[_0x70e8('0x2f')],qs[_0x70e8('0x35')](_0x1cd4dc[_0x70e8('0x30')]['fields']));_0x1ee6e2[_0x70e8('0x34')]=_0x1ee6e2[_0x70e8('0x34')][_0x70e8('0x36')]?_0x1ee6e2[_0x70e8('0x34')]:_0x11eba0[_0x70e8('0x2f')];if(!_0x1cd4dc[_0x70e8('0x30')][_0x70e8('0x37')](_0x70e8('0x38'))){_0x1ee6e2[_0x70e8('0x22')]=qs[_0x70e8('0x22')](_0x1cd4dc['query'][_0x70e8('0x22')]);_0x1ee6e2['offset']=qs['offset'](_0x1cd4dc[_0x70e8('0x30')][_0x70e8('0x1f')]);}_0x1ee6e2[_0x70e8('0x39')]=qs[_0x70e8('0x3a')](_0x1cd4dc[_0x70e8('0x30')]['sort']);_0x1ee6e2[_0x70e8('0x3b')]=qs[_0x70e8('0x32')](_[_0x70e8('0x3c')](_0x1cd4dc[_0x70e8('0x30')],_0x11eba0[_0x70e8('0x32')]),_0x3990ab);if(_0x1cd4dc[_0x70e8('0x30')][_0x70e8('0x3d')]){_0x1ee6e2[_0x70e8('0x3b')]=_[_0x70e8('0x3e')](_0x1ee6e2['where'],{'$or':_[_0x70e8('0x3f')](_0x3990ab,function(_0xc72a61){if(_0xc72a61[_0x70e8('0x2d')]!==_0x70e8('0x40')){var _0x53e0a8={};_0x53e0a8[_0xc72a61[_0x70e8('0x29')]]={'$like':'%'+_0x1cd4dc[_0x70e8('0x30')][_0x70e8('0x3d')]+'%'};return _0x53e0a8;}})});}_0x1ee6e2=_['merge']({},_0x1ee6e2,_0x1cd4dc[_0x70e8('0x41')]);var _0x4c1956={'where':_0x1ee6e2[_0x70e8('0x3b')]};return db['ChatMessage'][_0x70e8('0x21')](_0x4c1956)[_0x70e8('0x12')](function(_0x210347){_0x29a1be['count']=_0x210347;if(_0x1cd4dc[_0x70e8('0x30')]['includeAll']){_0x1ee6e2[_0x70e8('0x42')]=[{'all':!![]}];}return db[_0x70e8('0x2a')]['findAll'](_0x1ee6e2);})[_0x70e8('0x12')](function(_0x293eb3){_0x29a1be[_0x70e8('0x43')]=_0x293eb3;return _0x29a1be;})[_0x70e8('0x12')](respondWithFilteredResult(_0x2eb92a,_0x1ee6e2))[_0x70e8('0x1d')](handleError(_0x2eb92a,null));};exports['show']=function(_0x2b1b11,_0x209e0c){var _0x205f48={'raw':!![],'where':{'id':_0x2b1b11['params']['id']}},_0x3f8093={};_0x3f8093['model']=_['keys'](db[_0x70e8('0x2a')][_0x70e8('0x2b')]);_0x3f8093[_0x70e8('0x30')]=_[_0x70e8('0x31')](_0x2b1b11[_0x70e8('0x30')]);_0x3f8093['filters']=_[_0x70e8('0x33')](_0x3f8093[_0x70e8('0x2f')],_0x3f8093[_0x70e8('0x30')]);_0x205f48[_0x70e8('0x34')]=_[_0x70e8('0x33')](_0x3f8093[_0x70e8('0x2f')],qs[_0x70e8('0x35')](_0x2b1b11['query'][_0x70e8('0x35')]));_0x205f48[_0x70e8('0x34')]=_0x205f48['attributes'][_0x70e8('0x36')]?_0x205f48[_0x70e8('0x34')]:_0x3f8093[_0x70e8('0x2f')];if(_0x2b1b11[_0x70e8('0x30')][_0x70e8('0x44')]){_0x205f48['include']=[{'all':!![]}];}_0x205f48=_[_0x70e8('0x3e')]({},_0x205f48,_0x2b1b11['options']);return db[_0x70e8('0x2a')]['find'](_0x205f48)[_0x70e8('0x12')](handleEntityNotFound(_0x209e0c,null))[_0x70e8('0x12')](respondWithResult(_0x209e0c,null))[_0x70e8('0x1d')](handleError(_0x209e0c,null));};exports[_0x70e8('0x45')]=function(_0x497fa6,_0xc56069){return db[_0x70e8('0x2a')][_0x70e8('0x45')](_0x497fa6[_0x70e8('0x46')],{})[_0x70e8('0x12')](respondWithResult(_0xc56069,0xc9))[_0x70e8('0x1d')](handleError(_0xc56069,null));};exports[_0x70e8('0x25')]=function(_0x17d1db,_0x3ac69b){if(_0x17d1db[_0x70e8('0x46')]['id']){delete _0x17d1db['body']['id'];}return db[_0x70e8('0x2a')][_0x70e8('0x47')]({'where':{'id':_0x17d1db[_0x70e8('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ac69b,null))[_0x70e8('0x12')](saveUpdates(_0x17d1db[_0x70e8('0x46')],null))[_0x70e8('0x12')](respondWithResult(_0x3ac69b,null))[_0x70e8('0x1d')](handleError(_0x3ac69b,null));};exports[_0x70e8('0x26')]=function(_0x4011a,_0x39bc54){return db[_0x70e8('0x2a')]['find']({'where':{'id':_0x4011a[_0x70e8('0x48')]['id']}})[_0x70e8('0x12')](handleEntityNotFound(_0x39bc54,null))[_0x70e8('0x12')](removeEntity(_0x39bc54,null))[_0x70e8('0x1d')](handleError(_0x39bc54,null));};exports['describe']=function(_0x51aa77,_0x55dc4a){return db[_0x70e8('0x2a')][_0x70e8('0x49')]()['then'](respondWithResult(_0x55dc4a,null))['catch'](handleError(_0x55dc4a,null));};exports['accept']=function(_0x28b77a,_0x3eb6dd){var _0x5c5f4a=_0x70e8('0x4a');return interactionService[_0x70e8('0x4b')](_0x28b77a,_0x5c5f4a)[_0x70e8('0x12')](respondWithResult(_0x3eb6dd,null))[_0x70e8('0x1d')](handleError(_0x3eb6dd,null));};exports[_0x70e8('0x4c')]=function(_0x503428,_0x57923d){var _0x2c83d2={'agent':{},'channel':_0x70e8('0x4a')};if(_0x503428[_0x70e8('0x46')]['id']){delete _0x503428[_0x70e8('0x46')]['id'];}_0x503428['body'][_0x70e8('0x4d')]=_0x503428[_0x70e8('0x46')][_0x70e8('0x4d')]||_0x503428[_0x70e8('0x4e')]['id'];_0x2c83d2[_0x70e8('0x4f')]['id']=_0x503428[_0x70e8('0x46')][_0x70e8('0x4d')];return db[_0x70e8('0x2a')]['find']({'where':{'id':_0x503428[_0x70e8('0x48')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x57923d,null))[_0x70e8('0x12')](function(_0x1b783d){if(_0x1b783d){_0x2c83d2[_0x70e8('0x1b')]=_0x1b783d[_0x70e8('0x50')]({'plain':!![]});return db[_0x70e8('0x51')][_0x70e8('0x47')]({'where':{'id':_0x1b783d[_0x70e8('0x52')]}});}return null;})[_0x70e8('0x12')](handleEntityNotFound(_0x57923d,null))[_0x70e8('0x12')](function(_0x357c85){if(_0x357c85){_0x2c83d2['interaction']=_0x357c85['get']({'plain':!![]});interaction_log[_0x70e8('0x13')](_0x70e8('0x53'),_0x503428['user']['id'],_0x503428[_0x70e8('0x4e')][_0x70e8('0x29')],_0x503428[_0x70e8('0x4e')]['role'],_0x2c83d2['interaction']['id'],_0x503428['body']?JSON['stringify'](_0x503428[_0x70e8('0x46')]):_0x70e8('0x54'));return respondWithRpcPromise(_0x70e8('0x55'),_0x70e8('0x56'),_0x2c83d2);}return null;})['then'](function(_0x38d478){var _0x18ce5f=_0x70e8('0x57')+_0x38d478[_0x70e8('0x1b')][_0x70e8('0x58')];return db[_0x70e8('0x59')][_0x70e8('0x30')](_0x18ce5f,{'type':db['Sequelize'][_0x70e8('0x5a')][_0x70e8('0x5b')],'raw':!![]})['then'](function(_0x1d52f4){return _0x1d52f4;});})[_0x70e8('0x12')](function(_0x16b862){if(_0x16b862){_0x2c83d2[_0x70e8('0x1b')][_0x70e8('0x5c')]=_0x16b862[0x0];if(!_0x503428[_0x70e8('0x46')][_0x70e8('0x4d')])return;return db['User']['find']({'where':{'id':_0x503428['body'][_0x70e8('0x4d')],'role':_0x70e8('0x4f')},'attributes':['id','name',_0x70e8('0x5d'),'email',_0x70e8('0x5e')],'raw':!![]});}return null;})[_0x70e8('0x12')](function(_0x4ba089){if(!_0x4ba089)return null;_0x2c83d2[_0x70e8('0x1b')][_0x70e8('0x4f')]=_0x4ba089;return _0x2c83d2;})[_0x70e8('0x12')](function(_0xbf2a9b){if(_0xbf2a9b){_0xbf2a9b['message'][_0x70e8('0x5f')]=util[_0x70e8('0x60')](_0x70e8('0x61'),_0x503428['user'][_0x70e8('0x29')]);_0xbf2a9b['message'][_0x70e8('0x62')]=_0x2c83d2['channel'];_0xbf2a9b['message'][_0x70e8('0x63')]=_0x2c83d2[_0x70e8('0x62')];_0xbf2a9b[_0x70e8('0x1b')]['event']=_0x70e8('0x4c');respondWithRpcPromise(_0x70e8('0x64'),'EventManager',{'event':_0x70e8('0x65'),'message':_[_0x70e8('0x3e')](_0x2c83d2[_0x70e8('0x1b')],JSON['parse'](_0x2c83d2[_0x70e8('0x66')]['formData']))},client9002);return _0x2c83d2;}return null;})[_0x70e8('0x12')](respondWithResult(_0x57923d,null))[_0x70e8('0x1d')](handleError(_0x57923d,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index a671353..7b0868a 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 _0xaf6f=['emit','hasOwnProperty','exports','ChatMessage','save','update'];(function(_0xfbe06e,_0x2fb7ab){var _0x24e5b6=function(_0x48569f){while(--_0x48569f){_0xfbe06e['push'](_0xfbe06e['shift']());}};_0x24e5b6(++_0x2fb7ab);}(_0xaf6f,0x12f));var _0xfaf6=function(_0x3fe9a5,_0x5d6fb7){_0x3fe9a5=_0x3fe9a5-0x0;var _0x61444e=_0xaf6f[_0x3fe9a5];return _0x61444e;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0xfaf6('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfaf6('0x1'),'afterUpdate':_0xfaf6('0x2'),'afterDestroy':'remove'};function emitEvent(_0x177ddb){return function(_0x3f6a74,_0x5be592,_0x278f8b){ChatMessageEvents[_0xfaf6('0x3')](_0x177ddb+':'+_0x3f6a74['id'],_0x3f6a74);ChatMessageEvents[_0xfaf6('0x3')](_0x177ddb,_0x3f6a74);_0x278f8b(null);};}for(var e in events){if(events[_0xfaf6('0x4')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xfaf6('0x5')]=ChatMessageEvents;
\ No newline at end of file
+var _0x07e3=['update','remove','emit','hasOwnProperty','hook','events','ChatMessage','setMaxListeners','save'];(function(_0x442ece,_0x1c5c60){var _0x303ff5=function(_0x5a94a3){while(--_0x5a94a3){_0x442ece['push'](_0x442ece['shift']());}};_0x303ff5(++_0x1c5c60);}(_0x07e3,0xd4));var _0x307e=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x07e3[_0xbc346f];return _0x9f9260;};'use strict';var EventEmitter=require(_0x307e('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x307e('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x307e('0x2')](0x0);var events={'afterCreate':_0x307e('0x3'),'afterUpdate':_0x307e('0x4'),'afterDestroy':_0x307e('0x5')};function emitEvent(_0x196f4b){return function(_0x52b6b0,_0x14a025,_0x3f22aa){ChatMessageEvents['emit'](_0x196f4b+':'+_0x52b6b0['id'],_0x52b6b0);ChatMessageEvents[_0x307e('0x6')](_0x196f4b,_0x52b6b0);_0x3f22aa(null);};}for(var e in events){if(events[_0x307e('0x7')](e)){var event=events[e];ChatMessage[_0x307e('0x8')](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 d6c5055..e3b36fc 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 _0x73d8=['direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch','error','lodash','util','api','bluebird','request-promise','path','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get'];(function(_0x1e7701,_0x13fd0f){var _0x3ab707=function(_0x3c5242){while(--_0x3c5242){_0x1e7701['push'](_0x1e7701['shift']());}};_0x3ab707(++_0x13fd0f);}(_0x73d8,0x109));var _0x873d=function(_0x2f5ff2,_0x5b7e4b){_0x2f5ff2=_0x2f5ff2-0x0;var _0x1d9564=_0x73d8[_0x2f5ff2];return _0x1d9564;};'use strict';var _=require(_0x873d('0x0'));var util=require(_0x873d('0x1'));var logger=require('../../config/logger')(_0x873d('0x2'));var moment=require('moment');var BPromise=require(_0x873d('0x3'));var rp=require(_0x873d('0x4'));var fs=require('fs');var path=require(_0x873d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x873d('0x6'));module[_0x873d('0x7')]=function(_0x460222,_0x14e988){return _0x460222[_0x873d('0x8')](_0x873d('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x873d('0xa'),'fields':[_0x873d('0xb')],'type':_0x873d('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38d40f,_0x208068,_0x321257){var _0xb25f=_0x460222[_0x873d('0xd')];var _0x252092=_0x38d40f[_0x873d('0xe')]({'plain':!![]});if(_0x252092[_0x873d('0xf')][_0x873d('0x10')]()==='in'||_0x252092['direction'][_0x873d('0x10')]()===_0x873d('0x11')&&!_0x252092[_0x873d('0x12')]&&!_[_0x873d('0x13')](_0x252092[_0x873d('0x14')])){_0xb25f[_0x873d('0x15')][_0x873d('0x16')]({'where':{'id':_0x252092['ChatInteractionId']}})[_0x873d('0x17')](function(_0x57c11b){if(_0x57c11b){_0x57c11b[_0x873d('0x18')]({'lastMsgAt':_0x252092[_0x873d('0x19')],'lastMsgDirection':_0x252092[_0x873d('0xf')][_0x873d('0x10')]()});}})[_0x873d('0x1a')](function(_0x2ceb11){console[_0x873d('0x1b')](_0x2ceb11);});}_0x321257();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xad2c=['get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xad2c,0x13a));var _0xcad2=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xad2c[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xcad2('0x0'));var util=require(_0xcad2('0x1'));var logger=require(_0xcad2('0x2'))('api');var moment=require(_0xcad2('0x3'));var BPromise=require(_0xcad2('0x4'));var rp=require(_0xcad2('0x5'));var fs=require('fs');var path=require(_0xcad2('0x6'));var rimraf=require(_0xcad2('0x7'));var config=require('../../config/environment');var attributes=require(_0xcad2('0x8'));module[_0xcad2('0x9')]=function(_0x1203e0,_0x220af1){return _0x1203e0[_0xcad2('0xa')](_0xcad2('0xb'),attributes,{'tableName':_0xcad2('0xc'),'paranoid':![],'indexes':[{'name':_0xcad2('0xd'),'fields':['body'],'type':_0xcad2('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x23d966,_0x3a2d16,_0x3e63ce){var _0x552ce9=_0x1203e0[_0xcad2('0xf')];var _0x48d76a=_0x23d966[_0xcad2('0x10')]({'plain':!![]});if(_0x48d76a[_0xcad2('0x11')][_0xcad2('0x12')]()==='in'||_0x48d76a[_0xcad2('0x11')][_0xcad2('0x12')]()===_0xcad2('0x13')&&!_0x48d76a[_0xcad2('0x14')]&&!_[_0xcad2('0x15')](_0x48d76a[_0xcad2('0x16')])){_0x552ce9[_0xcad2('0x17')][_0xcad2('0x18')]({'where':{'id':_0x48d76a[_0xcad2('0x19')]}})['then'](function(_0x1438aa){if(_0x1438aa){_0x1438aa[_0xcad2('0x1a')]({'lastMsgAt':_0x48d76a[_0xcad2('0x1b')],'lastMsgDirection':_0x48d76a[_0xcad2('0x11')][_0xcad2('0x12')]()});}})[_0xcad2('0x1c')](function(_0x46e7c2){console['error'](_0x46e7c2);});}_0x3e63ce();}},'charset':'utf8mb4','collate':_0xcad2('0x1d')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index d26cd06..59b2b6a 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 _0xcf3b=['result','catch','ChatMessage','create','options','raw','CreateChatMessage','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcf3b,0x7f));var _0xbcf3=function(_0x93b175,_0x448d4c){_0x93b175=_0x93b175-0x0;var _0x5f2532=_0xcf3b[_0x93b175];return _0x5f2532;};'use strict';var _=require('lodash');var util=require(_0xbcf3('0x0'));var moment=require(_0xbcf3('0x1'));var BPromise=require(_0xbcf3('0x2'));var rs=require(_0xbcf3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbcf3('0x4'))['db'];var utils=require(_0xbcf3('0x5'));var logger=require(_0xbcf3('0x6'))(_0xbcf3('0x7'));var config=require(_0xbcf3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbcf3('0x9')]['http']({'port':0x232a});config['redis']=_[_0xbcf3('0xa')](config[_0xbcf3('0xb')],{'host':_0xbcf3('0xc'),'port':0x18eb});var socket=require(_0xbcf3('0xd'))(new Redis(config[_0xbcf3('0xb')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x5181bf,_0x33a0df,_0x4a4660){return new BPromise(function(_0x27de0f,_0x2a5526){return client['request'](_0x5181bf,_0x4a4660)[_0xbcf3('0xe')](function(_0x561fe7){logger[_0xbcf3('0xf')](_0xbcf3('0x10'),_0x33a0df,_0xbcf3('0x11'));logger[_0xbcf3('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x33a0df,'request\x20sent',JSON[_0xbcf3('0x13')](_0x561fe7));if(_0x561fe7['error']){if(_0x561fe7[_0xbcf3('0x14')][_0xbcf3('0x15')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x33a0df,_0x561fe7[_0xbcf3('0x14')][_0xbcf3('0x16')]);return _0x2a5526(_0x561fe7['error'][_0xbcf3('0x16')]);}logger[_0xbcf3('0x14')](_0xbcf3('0x10'),_0x33a0df,_0x561fe7[_0xbcf3('0x14')][_0xbcf3('0x16')]);return _0x27de0f(_0x561fe7[_0xbcf3('0x14')]['message']);}else{logger[_0xbcf3('0xf')]('ChatMessage,\x20%s,\x20%s',_0x33a0df,_0xbcf3('0x11'));_0x27de0f(_0x561fe7[_0xbcf3('0x17')][_0xbcf3('0x16')]);}})[_0xbcf3('0x18')](function(_0x355f0d){logger[_0xbcf3('0x14')](_0xbcf3('0x10'),_0x33a0df,_0x355f0d);_0x2a5526(_0x355f0d);});});}exports['CreateChatMessage']=function(_0x55f3f4){var _0x5093b3=this;return new Promise(function(_0xf5b359,_0x428e6e){return db[_0xbcf3('0x19')][_0xbcf3('0x1a')](_0x55f3f4['body'],{'raw':_0x55f3f4['options']?_0x55f3f4[_0xbcf3('0x1b')][_0xbcf3('0x1c')]===undefined?!![]:![]:!![]})[_0xbcf3('0xe')](function(_0x22c0c2){logger['info']('CreateChatMessage',_0x55f3f4);logger[_0xbcf3('0x12')]('CreateChatMessage',_0x55f3f4,JSON[_0xbcf3('0x13')](_0x22c0c2));_0xf5b359(_0x22c0c2);})['catch'](function(_0x49dcb9){logger[_0xbcf3('0x14')](_0xbcf3('0x1d'),_0x49dcb9['message'],_0x55f3f4);_0x428e6e(_0x5093b3[_0xbcf3('0x14')](0x1f4,_0x49dcb9[_0xbcf3('0x16')]));});});};
\ No newline at end of file
+var _0x9127=['message','info','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x7b7181,_0x5f065e){var _0x3ea6ef=function(_0x2d6e06){while(--_0x2d6e06){_0x7b7181['push'](_0x7b7181['shift']());}};_0x3ea6ef(++_0x5f065e);}(_0x9127,0x180));var _0x7912=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0x9127[_0x581af1];return _0x54c22e;};'use strict';var _=require(_0x7912('0x0'));var util=require(_0x7912('0x1'));var moment=require(_0x7912('0x2'));var BPromise=require(_0x7912('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7912('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7912('0x5'))(_0x7912('0x6'));var config=require(_0x7912('0x7'));var jayson=require(_0x7912('0x8'));var client=jayson[_0x7912('0x9')][_0x7912('0xa')]({'port':0x232a});config[_0x7912('0xb')]=_[_0x7912('0xc')](config['redis'],{'host':_0x7912('0xd'),'port':0x18eb});var socket=require(_0x7912('0xe'))(new Redis(config[_0x7912('0xb')]));require(_0x7912('0xf'))['register'](socket);function respondWithRpcPromise(_0x218dc9,_0x586ccb,_0x438339){return new BPromise(function(_0x9ddd99,_0x4d7522){return client[_0x7912('0x10')](_0x218dc9,_0x438339)[_0x7912('0x11')](function(_0x3b56aa){logger['info'](_0x7912('0x12'),_0x586ccb,_0x7912('0x13'));logger['debug'](_0x7912('0x14'),_0x586ccb,'request\x20sent',JSON[_0x7912('0x15')](_0x3b56aa));if(_0x3b56aa['error']){if(_0x3b56aa[_0x7912('0x16')][_0x7912('0x17')]===0x1f4){logger[_0x7912('0x16')](_0x7912('0x12'),_0x586ccb,_0x3b56aa['error'][_0x7912('0x18')]);return _0x4d7522(_0x3b56aa['error'][_0x7912('0x18')]);}logger[_0x7912('0x16')](_0x7912('0x12'),_0x586ccb,_0x3b56aa[_0x7912('0x16')][_0x7912('0x18')]);return _0x9ddd99(_0x3b56aa[_0x7912('0x16')]['message']);}else{logger[_0x7912('0x19')](_0x7912('0x12'),_0x586ccb,_0x7912('0x13'));_0x9ddd99(_0x3b56aa['result'][_0x7912('0x18')]);}})[_0x7912('0x1a')](function(_0x8173e6){logger[_0x7912('0x16')](_0x7912('0x12'),_0x586ccb,_0x8173e6);_0x4d7522(_0x8173e6);});});}exports[_0x7912('0x1b')]=function(_0x5e1b4e){var _0x15f148=this;return new Promise(function(_0x116390,_0x27f312){return db[_0x7912('0x1c')][_0x7912('0x1d')](_0x5e1b4e[_0x7912('0x1e')],{'raw':_0x5e1b4e[_0x7912('0x1f')]?_0x5e1b4e[_0x7912('0x1f')][_0x7912('0x20')]===undefined?!![]:![]:!![]})[_0x7912('0x11')](function(_0x3e3447){logger[_0x7912('0x19')](_0x7912('0x1b'),_0x5e1b4e);logger[_0x7912('0x21')](_0x7912('0x1b'),_0x5e1b4e,JSON['stringify'](_0x3e3447));_0x116390(_0x3e3447);})[_0x7912('0x1a')](function(_0x4410b4){logger[_0x7912('0x16')](_0x7912('0x1b'),_0x4410b4[_0x7912('0x18')],_0x5e1b4e);_0x27f312(_0x15f148[_0x7912('0x16')](0x1f4,_0x4410b4['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 6bc4db1..abe1e35 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 _0x88d5=['remove','update','emit','removeListener','register','chatMessage:','./chatMessage.events','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x88d5,0x76));var _0x588d=function(_0x35ad07,_0x4b6cc4){_0x35ad07=_0x35ad07-0x0;var _0x5346ee=_0x88d5[_0x35ad07];return _0x5346ee;};'use strict';var ChatMessageEvents=require(_0x588d('0x0'));var events=[_0x588d('0x1'),_0x588d('0x2'),_0x588d('0x3')];function createListener(_0x315178,_0x5372b1){return function(_0xe46c98){_0x5372b1[_0x588d('0x4')](_0x315178,_0xe46c98);};}function removeListener(_0x504b52,_0x474e79){return function(){ChatMessageEvents[_0x588d('0x5')](_0x504b52,_0x474e79);};}exports[_0x588d('0x6')]=function(_0x1b193f){for(var _0xecfb11=0x0,_0x413748=events['length'];_0xecfb11<_0x413748;_0xecfb11++){var _0x57699a=events[_0xecfb11];var _0x41ddf3=createListener(_0x588d('0x7')+_0x57699a,_0x1b193f);ChatMessageEvents['on'](_0x57699a,_0x41ddf3);}};
\ No newline at end of file
+var _0x5162=['chatMessage:','./chatMessage.events','emit','removeListener','register','length'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x5162,0x103));var _0x2516=function(_0x57f7ea,_0x54da6b){_0x57f7ea=_0x57f7ea-0x0;var _0x54a7e4=_0x5162[_0x57f7ea];return _0x54a7e4;};'use strict';var ChatMessageEvents=require(_0x2516('0x0'));var events=['save','remove','update'];function createListener(_0x4db25c,_0x41fd28){return function(_0x2aaef5){_0x41fd28[_0x2516('0x1')](_0x4db25c,_0x2aaef5);};}function removeListener(_0x2d0b53,_0x2e48b6){return function(){ChatMessageEvents[_0x2516('0x2')](_0x2d0b53,_0x2e48b6);};}exports[_0x2516('0x3')]=function(_0x5b71b5){for(var _0x48f411=0x0,_0x5beeb3=events[_0x2516('0x4')];_0x48f411<_0x5beeb3;_0x48f411++){var _0xba4b36=events[_0x48f411];var _0xa1557=createListener(_0x2516('0x5')+_0xba4b36,_0x5b71b5);ChatMessageEvents['on'](_0xba4b36,_0xa1557);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index e7f3884..0873fae 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 _0xa86d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','tracked','chatmessage:create','create','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path'];(function(_0x48f590,_0x4cd55b){var _0x1afde4=function(_0x2b19c3){while(--_0x2b19c3){_0x48f590['push'](_0x48f590['shift']());}};_0x1afde4(++_0x4cd55b);}(_0xa86d,0x8a));var _0xda86=function(_0x1d46de,_0x3dd47f){_0x1d46de=_0x1d46de-0x0;var _0x4516e5=_0xa86d[_0x1d46de];return _0x4516e5;};'use strict';var multer=require(_0xda86('0x0'));var util=require('util');var path=require(_0xda86('0x1'));var timeout=require(_0xda86('0x2'));var express=require(_0xda86('0x3'));var router=express[_0xda86('0x4')]();var fs_extra=require(_0xda86('0x5'));var auth=require(_0xda86('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xda86('0x7'));var controller=require(_0xda86('0x8'));router[_0xda86('0x9')]('/',auth[_0xda86('0xa')](),controller[_0xda86('0xb')]);router[_0xda86('0x9')](_0xda86('0xc'),auth[_0xda86('0xa')](),controller[_0xda86('0xd')]);router[_0xda86('0x9')]('/:id',auth[_0xda86('0xa')](),controller[_0xda86('0xe')]);router[_0xda86('0xf')]('/',auth[_0xda86('0xa')](),interaction[_0xda86('0x10')]('chat',_0xda86('0x11')),controller[_0xda86('0x12')]);router[_0xda86('0x13')](_0xda86('0x14'),controller['update']);router['put'](_0xda86('0x15'),auth['isAuthenticated'](),controller[_0xda86('0x16')]);router[_0xda86('0x13')](_0xda86('0x17'),auth['isAuthenticated'](),controller[_0xda86('0x18')]);router[_0xda86('0x19')](_0xda86('0x14'),auth[_0xda86('0xa')](),controller[_0xda86('0x1a')]);module[_0xda86('0x1b')]=router;
\ No newline at end of file
+var _0xb43a=['create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','/:id','post','tracked','chatmessage:create'];(function(_0x5b33ac,_0x359e75){var _0x304b3f=function(_0xf6f90d){while(--_0xf6f90d){_0x5b33ac['push'](_0x5b33ac['shift']());}};_0x304b3f(++_0x359e75);}(_0xb43a,0x199));var _0xab43=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xb43a[_0x44a64f];return _0x52024b;};'use strict';var multer=require('multer');var util=require(_0xab43('0x0'));var path=require(_0xab43('0x1'));var timeout=require(_0xab43('0x2'));var express=require(_0xab43('0x3'));var router=express[_0xab43('0x4')]();var fs_extra=require(_0xab43('0x5'));var auth=require(_0xab43('0x6'));var interaction=require(_0xab43('0x7'));var config=require(_0xab43('0x8'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0xab43('0x9')](),controller[_0xab43('0xa')]);router['get'](_0xab43('0xb'),auth[_0xab43('0x9')](),controller['describe']);router['get'](_0xab43('0xc'),auth[_0xab43('0x9')](),controller['show']);router[_0xab43('0xd')]('/',auth['isAuthenticated'](),interaction[_0xab43('0xe')]('chat',_0xab43('0xf')),controller[_0xab43('0x10')]);router[_0xab43('0x11')](_0xab43('0xc'),controller[_0xab43('0x12')]);router[_0xab43('0x11')](_0xab43('0x13'),auth[_0xab43('0x9')](),controller[_0xab43('0x14')]);router[_0xab43('0x11')](_0xab43('0x15'),auth['isAuthenticated'](),controller[_0xab43('0x16')]);router[_0xab43('0x17')](_0xab43('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xab43('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index eb4bb86..899d288 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['medium','TEXT','exports'];(function(_0x149e88,_0x264145){var _0x26a5a6=function(_0x489294){while(--_0x489294){_0x149e88['push'](_0x149e88['shift']());}};_0x26a5a6(++_0x264145);}(_0xadb5,0xad));var _0x5adb=function(_0x4f158e,_0x3910bd){_0x4f158e=_0x4f158e-0x0;var _0x52ad37=_0xadb5[_0x4f158e];return _0x52ad37;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0xb10b=['medium','sequelize','TEXT'];(function(_0x26ec0a,_0x3d532d){var _0x48a447=function(_0x4d6705){while(--_0x4d6705){_0x26ec0a['push'](_0x26ec0a['shift']());}};_0x48a447(++_0x3d532d);}(_0xb10b,0x12a));var _0xbb10=function(_0x503d00,_0x323df1){_0x503d00=_0x503d00-0x0;var _0x2263d8=_0xb10b[_0x503d00];return _0x2263d8;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 24dee62..96117e3 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x7a54,0x106));var _0x47a5=function(_0x48dfab,_0x539679){_0x48dfab=_0x48dfab-0x0;var _0x2fa30f=_0x7a54[_0x48dfab];return _0x2fa30f;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x7a54,0x106));var _0x47a5=function(_0x5185b8,_0x4282ea){_0x5185b8=_0x5185b8-0x0;var _0x38edb2=_0x7a54[_0x5185b8];return _0x38edb2;};'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 38ef9b3..2708980 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 _0x9dbe=['save','update','remove','emit','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x1244c6,_0x4770d0){var _0x1e0a72=function(_0x61ba95){while(--_0x61ba95){_0x1244c6['push'](_0x1244c6['shift']());}};_0x1e0a72(++_0x4770d0);}(_0x9dbe,0x174));var _0xe9db=function(_0x465089,_0x823030){_0x465089=_0x465089-0x0;var _0x3c47ba=_0x9dbe[_0x465089];return _0x3c47ba;};'use strict';var EventEmitter=require(_0xe9db('0x0'));var ChatOfflineMessage=require(_0xe9db('0x1'))['db'][_0xe9db('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xe9db('0x3')](0x0);var events={'afterCreate':_0xe9db('0x4'),'afterUpdate':_0xe9db('0x5'),'afterDestroy':_0xe9db('0x6')};function emitEvent(_0x383073){return function(_0x1ff6a5,_0x117f8f,_0x383196){ChatOfflineMessageEvents[_0xe9db('0x7')](_0x383073+':'+_0x1ff6a5['id'],_0x1ff6a5);ChatOfflineMessageEvents[_0xe9db('0x7')](_0x383073,_0x1ff6a5);_0x383196(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xa009=['../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x18a7f3,_0x4cf3c5){var _0x1b070c=function(_0x1a664a){while(--_0x1a664a){_0x18a7f3['push'](_0x18a7f3['shift']());}};_0x1b070c(++_0x4cf3c5);}(_0xa009,0x13a));var _0x9a00=function(_0x4adc6d,_0x11275c){_0x4adc6d=_0x4adc6d-0x0;var _0x4d42e5=_0xa009[_0x4adc6d];return _0x4d42e5;};'use strict';var EventEmitter=require(_0x9a00('0x0'));var ChatOfflineMessage=require(_0x9a00('0x1'))['db'][_0x9a00('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9a00('0x3')](0x0);var events={'afterCreate':_0x9a00('0x4'),'afterUpdate':_0x9a00('0x5'),'afterDestroy':_0x9a00('0x6')};function emitEvent(_0x15730f){return function(_0xf578ba,_0x399968,_0x398e60){ChatOfflineMessageEvents[_0x9a00('0x7')](_0x15730f+':'+_0xf578ba['id'],_0xf578ba);ChatOfflineMessageEvents[_0x9a00('0x7')](_0x15730f,_0xf578ba);_0x398e60(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x9a00('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 48df32a..a70a58c 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 _0x8406=['chat_offline_messages','./chatOfflineMessage.attributes','exports','define'];(function(_0x19c14f,_0x262416){var _0x4bdba3=function(_0x3f18f4){while(--_0x3f18f4){_0x19c14f['push'](_0x19c14f['shift']());}};_0x4bdba3(++_0x262416);}(_0x8406,0x18d));var _0x6840=function(_0x1870ed,_0x44b070){_0x1870ed=_0x1870ed-0x0;var _0x495d32=_0x8406[_0x1870ed];return _0x495d32;};'use strict';var attributes=require(_0x6840('0x0'));module[_0x6840('0x1')]=function(_0x3c3022){return _0x3c3022[_0x6840('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x6840('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb35f=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4abd58,_0x523c62){var _0x3608a8=function(_0xa5878){while(--_0xa5878){_0x4abd58['push'](_0x4abd58['shift']());}};_0x3608a8(++_0x523c62);}(_0xb35f,0x131));var _0xfb35=function(_0x6cc07,_0x813f5d){_0x6cc07=_0x6cc07-0x0;var _0x5e745c=_0xb35f[_0x6cc07];return _0x5e745c;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x506702){return _0x506702[_0xfb35('0x0')](_0xfb35('0x1'),attributes,{'tableName':_0xfb35('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfb35('0x3'),'collate':_0xfb35('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index dc68984..4623b15 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 _0xcbd2=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x50f157,_0x280833){var _0x7e0178=function(_0x14eaf1){while(--_0x14eaf1){_0x50f157['push'](_0x50f157['shift']());}};_0x7e0178(++_0x280833);}(_0xcbd2,0xb9));var _0x2cbd=function(_0x45c48f,_0x4aa891){_0x45c48f=_0x45c48f-0x0;var _0xaf5037=_0xcbd2[_0x45c48f];return _0xaf5037;};'use strict';var _=require(_0x2cbd('0x0'));var util=require(_0x2cbd('0x1'));var moment=require(_0x2cbd('0x2'));var BPromise=require(_0x2cbd('0x3'));var rs=require(_0x2cbd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2cbd('0x5'))['db'];var utils=require(_0x2cbd('0x6'));var logger=require(_0x2cbd('0x7'))(_0x2cbd('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2cbd('0x9')][_0x2cbd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2233f3,_0x27aa9f,_0x39dc17){return new BPromise(function(_0x4b35b0,_0x1dac7c){return client[_0x2cbd('0xb')](_0x2233f3,_0x39dc17)[_0x2cbd('0xc')](function(_0x2cfd1e){logger[_0x2cbd('0xd')](_0x2cbd('0xe'),_0x27aa9f,_0x2cbd('0xf'));logger[_0x2cbd('0x10')](_0x2cbd('0x11'),_0x27aa9f,_0x2cbd('0xf'),JSON['stringify'](_0x2cfd1e));if(_0x2cfd1e[_0x2cbd('0x12')]){if(_0x2cfd1e[_0x2cbd('0x12')][_0x2cbd('0x13')]===0x1f4){logger[_0x2cbd('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x27aa9f,_0x2cfd1e[_0x2cbd('0x12')][_0x2cbd('0x14')]);return _0x1dac7c(_0x2cfd1e[_0x2cbd('0x12')][_0x2cbd('0x14')]);}logger[_0x2cbd('0x12')](_0x2cbd('0xe'),_0x27aa9f,_0x2cfd1e['error']['message']);return _0x4b35b0(_0x2cfd1e['error']['message']);}else{logger[_0x2cbd('0xd')](_0x2cbd('0xe'),_0x27aa9f,_0x2cbd('0xf'));_0x4b35b0(_0x2cfd1e[_0x2cbd('0x15')]['message']);}})[_0x2cbd('0x16')](function(_0x5df532){logger[_0x2cbd('0x12')](_0x2cbd('0xe'),_0x27aa9f,_0x5df532);_0x1dac7c(_0x5df532);});});}
\ No newline at end of file
+var _0xc164=['message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5ac71e,_0x440c86){var _0x2aaa2b=function(_0x5f37e0){while(--_0x5f37e0){_0x5ac71e['push'](_0x5ac71e['shift']());}};_0x2aaa2b(++_0x440c86);}(_0xc164,0x18e));var _0x4c16=function(_0x1c5104,_0x3bb9cc){_0x1c5104=_0x1c5104-0x0;var _0x21e4b6=_0xc164[_0x1c5104];return _0x21e4b6;};'use strict';var _=require('lodash');var util=require(_0x4c16('0x0'));var moment=require(_0x4c16('0x1'));var BPromise=require(_0x4c16('0x2'));var rs=require(_0x4c16('0x3'));var fs=require('fs');var Redis=require(_0x4c16('0x4'));var db=require(_0x4c16('0x5'))['db'];var utils=require(_0x4c16('0x6'));var logger=require(_0x4c16('0x7'))('rpc');var config=require(_0x4c16('0x8'));var jayson=require(_0x4c16('0x9'));var client=jayson[_0x4c16('0xa')][_0x4c16('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10525f,_0x5e62a8,_0xa6488e){return new BPromise(function(_0x236aa7,_0x233f0a){return client[_0x4c16('0xc')](_0x10525f,_0xa6488e)['then'](function(_0x3ed462){logger[_0x4c16('0xd')](_0x4c16('0xe'),_0x5e62a8,_0x4c16('0xf'));logger[_0x4c16('0x10')](_0x4c16('0x11'),_0x5e62a8,_0x4c16('0xf'),JSON[_0x4c16('0x12')](_0x3ed462));if(_0x3ed462[_0x4c16('0x13')]){if(_0x3ed462['error']['code']===0x1f4){logger[_0x4c16('0x13')](_0x4c16('0xe'),_0x5e62a8,_0x3ed462['error'][_0x4c16('0x14')]);return _0x233f0a(_0x3ed462[_0x4c16('0x13')][_0x4c16('0x14')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x5e62a8,_0x3ed462[_0x4c16('0x13')][_0x4c16('0x14')]);return _0x236aa7(_0x3ed462[_0x4c16('0x13')][_0x4c16('0x14')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x5e62a8,_0x4c16('0xf'));_0x236aa7(_0x3ed462[_0x4c16('0x15')][_0x4c16('0x14')]);}})['catch'](function(_0x3aa010){logger['error'](_0x4c16('0xe'),_0x5e62a8,_0x3aa010);_0x233f0a(_0x3aa010);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 1cd2573..3bdf499 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 _0x8728=['../../components/auth/service','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','express','Router','fs-extra'];(function(_0x58ff61,_0x3f18cc){var _0x7eaddc=function(_0x40eb3c){while(--_0x40eb3c){_0x58ff61['push'](_0x58ff61['shift']());}};_0x7eaddc(++_0x3f18cc);}(_0x8728,0x12d));var _0x8872=function(_0x55b06f,_0xedbba2){_0x55b06f=_0x55b06f-0x0;var _0x5b2bcb=_0x8728[_0x55b06f];return _0x5b2bcb;};'use strict';var multer=require(_0x8872('0x0'));var util=require(_0x8872('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8872('0x2'));var router=express[_0x8872('0x3')]();var fs_extra=require(_0x8872('0x4'));var auth=require(_0x8872('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x8872('0x6')]('/',auth[_0x8872('0x7')](),controller['index']);router[_0x8872('0x6')](_0x8872('0x8'),auth['isAuthenticated'](),controller[_0x8872('0x9')]);router[_0x8872('0x6')]('/:id',auth[_0x8872('0x7')](),controller[_0x8872('0xa')]);router[_0x8872('0xb')]('/',auth[_0x8872('0x7')](),controller[_0x8872('0xc')]);router[_0x8872('0xd')](_0x8872('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x8872('0xf')](_0x8872('0xe'),auth[_0x8872('0x7')](),controller[_0x8872('0x10')]);module[_0x8872('0x11')]=router;
\ No newline at end of file
+var _0x056e=['show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x4624d7,_0x2482e9){var _0x41c718=function(_0x5e099e){while(--_0x5e099e){_0x4624d7['push'](_0x4624d7['shift']());}};_0x41c718(++_0x2482e9);}(_0x056e,0x15a));var _0xe056=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0x056e[_0x39cf70];return _0x580424;};'use strict';var multer=require(_0xe056('0x0'));var util=require(_0xe056('0x1'));var path=require(_0xe056('0x2'));var timeout=require(_0xe056('0x3'));var express=require(_0xe056('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe056('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe056('0x6'));var controller=require(_0xe056('0x7'));router[_0xe056('0x8')]('/',auth['isAuthenticated'](),controller[_0xe056('0x9')]);router[_0xe056('0x8')](_0xe056('0xa'),auth[_0xe056('0xb')](),controller[_0xe056('0xc')]);router[_0xe056('0x8')](_0xe056('0xd'),auth[_0xe056('0xb')](),controller[_0xe056('0xe')]);router['post']('/',auth[_0xe056('0xb')](),controller[_0xe056('0xf')]);router[_0xe056('0x10')]('/:id',auth[_0xe056('0xb')](),controller[_0xe056('0x11')]);router[_0xe056('0x12')](_0xe056('0xd'),auth['isAuthenticated'](),controller[_0xe056('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 406aad2..93fe955 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 _0x3f90=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x182282,_0x4ba450){var _0x1362ab=function(_0x2b8f8d){while(--_0x2b8f8d){_0x182282['push'](_0x182282['shift']());}};_0x1362ab(++_0x4ba450);}(_0x3f90,0xd1));var _0x03f9=function(_0x543749,_0xcb3921){_0x543749=_0x543749-0x0;var _0x558041=_0x3f90[_0x543749];return _0x558041;};'use strict';var Sequelize=require(_0x03f9('0x0'));module[_0x03f9('0x1')]={'name':{'type':Sequelize[_0x03f9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x03f9('0x3')](_0x03f9('0x4'),_0x03f9('0x5')),'defaultValue':_0x03f9('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x03f9('0x6')]}};
\ No newline at end of file
+var _0xfc31=['mouseOver','timeout','STRING','sequelize'];(function(_0x5c6022,_0x5cd10b){var _0x4ab5af=function(_0x988aff){while(--_0x988aff){_0x5c6022['push'](_0x5c6022['shift']());}};_0x4ab5af(++_0x5cd10b);}(_0xfc31,0x1e3));var _0x1fc3=function(_0x56b6b4,_0x4b81d0){_0x56b6b4=_0x56b6b4-0x0;var _0xe97eeb=_0xfc31[_0x56b6b4];return _0xe97eeb;};'use strict';var Sequelize=require(_0x1fc3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1fc3('0x1'),_0x1fc3('0x2')),'defaultValue':_0x1fc3('0x1')},'selector':{'type':Sequelize[_0x1fc3('0x3')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 0d28cd9..cf08a9c 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 _0xafdd=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','params','model','query','keys','intersection','attributes','fields','includeAll','include','merge','ChatProactiveAction','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x2fc673,_0x522af0){var _0x21d6e2=function(_0x38356e){while(--_0x38356e){_0x2fc673['push'](_0x2fc673['shift']());}};_0x21d6e2(++_0x522af0);}(_0xafdd,0x19a));var _0xdafd=function(_0x1ffa41,_0xc3996b){_0x1ffa41=_0x1ffa41-0x0;var _0x1f3a1a=_0xafdd[_0x1ffa41];return _0x1f3a1a;};'use strict';var emlformat=require(_0xdafd('0x0'));var rimraf=require(_0xdafd('0x1'));var zipdir=require(_0xdafd('0x2'));var jsonpatch=require(_0xdafd('0x3'));var rp=require(_0xdafd('0x4'));var moment=require(_0xdafd('0x5'));var BPromise=require(_0xdafd('0x6'));var Mustache=require(_0xdafd('0x7'));var util=require('util');var path=require(_0xdafd('0x8'));var sox=require(_0xdafd('0x9'));var csv=require(_0xdafd('0xa'));var ejs=require(_0xdafd('0xb'));var fs=require('fs');var fs_extra=require(_0xdafd('0xc'));var _=require(_0xdafd('0xd'));var squel=require(_0xdafd('0xe'));var crypto=require('crypto');var jsforce=require(_0xdafd('0xf'));var deskjs=require(_0xdafd('0x10'));var toCsv=require(_0xdafd('0xa'));var querystring=require('querystring');var Papa=require(_0xdafd('0x11'));var Redis=require(_0xdafd('0x12'));var authService=require(_0xdafd('0x13'));var qs=require(_0xdafd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdafd('0x15'));var logger=require(_0xdafd('0x16'))(_0xdafd('0x17'));var utils=require(_0xdafd('0x18'));var config=require(_0xdafd('0x19'));var licenseUtil=require(_0xdafd('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x166176,_0x594f47){_0x594f47=_0x594f47||0xcc;return function(_0x553508){if(_0x553508){return _0x166176[_0xdafd('0x1b')](_0x594f47);}return _0x166176[_0xdafd('0x1c')](_0x594f47)['end']();};}function respondWithResult(_0x43a716,_0x490382){_0x490382=_0x490382||0xc8;return function(_0x4b09da){if(_0x4b09da){return _0x43a716[_0xdafd('0x1c')](_0x490382)[_0xdafd('0x1d')](_0x4b09da);}};}function respondWithFilteredResult(_0x583b1d,_0x267bfc){return function(_0x186379){if(_0x186379){var _0x496515=typeof _0x267bfc[_0xdafd('0x1e')]===_0xdafd('0x1f')&&typeof _0x267bfc[_0xdafd('0x20')]==='undefined';var _0xb382ca=_0x186379[_0xdafd('0x21')];var _0x4fc3a4=_0x496515?0x0:_0x267bfc['offset'];var _0x2569b2=_0x496515?_0x186379['count']:_0x267bfc[_0xdafd('0x1e')]+_0x267bfc[_0xdafd('0x20')];var _0x1e64d3;if(_0x2569b2>=_0xb382ca){_0x2569b2=_0xb382ca;_0x1e64d3=0xc8;}else{_0x1e64d3=0xce;}_0x583b1d[_0xdafd('0x1c')](_0x1e64d3);return _0x583b1d[_0xdafd('0x22')](_0xdafd('0x23'),_0x4fc3a4+'-'+_0x2569b2+'/'+_0xb382ca)[_0xdafd('0x1d')](_0x186379);}return null;};}function patchUpdates(_0x42e0f9){return function(_0x8480a8){try{jsonpatch[_0xdafd('0x24')](_0x8480a8,_0x42e0f9,!![]);}catch(_0xee767e){return BPromise[_0xdafd('0x25')](_0xee767e);}return _0x8480a8[_0xdafd('0x26')]();};}function saveUpdates(_0xf4a521,_0x491d96){return function(_0x230495){if(_0x230495){return _0x230495['update'](_0xf4a521)[_0xdafd('0x27')](function(_0x5e96cc){return _0x5e96cc;});}return null;};}function removeEntity(_0x439bbf,_0x35ef78){return function(_0x7f10f6){if(_0x7f10f6){return _0x7f10f6[_0xdafd('0x28')]()[_0xdafd('0x27')](function(){_0x439bbf[_0xdafd('0x1c')](0xcc)[_0xdafd('0x29')]();});}};}function handleEntityNotFound(_0x30cba9,_0x3846dd){return function(_0x5cd11d){if(!_0x5cd11d){_0x30cba9[_0xdafd('0x1b')](0x194);}return _0x5cd11d;};}function handleError(_0x2ab575,_0x18554c){_0x18554c=_0x18554c||0x1f4;return function(_0x1feb5b){logger[_0xdafd('0x2a')](_0x1feb5b[_0xdafd('0x2b')]);if(_0x1feb5b[_0xdafd('0x2c')]){delete _0x1feb5b[_0xdafd('0x2c')];}_0x2ab575[_0xdafd('0x1c')](_0x18554c)[_0xdafd('0x2d')](_0x1feb5b);};}exports['show']=function(_0x243182,_0x14626b){var _0x13ab81={'raw':!![],'where':{'id':_0x243182[_0xdafd('0x2e')]['id']}},_0x249743={};_0x249743[_0xdafd('0x2f')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x249743[_0xdafd('0x30')]=_[_0xdafd('0x31')](_0x243182['query']);_0x249743['filters']=_[_0xdafd('0x32')](_0x249743[_0xdafd('0x2f')],_0x249743[_0xdafd('0x30')]);_0x13ab81[_0xdafd('0x33')]=_[_0xdafd('0x32')](_0x249743[_0xdafd('0x2f')],qs[_0xdafd('0x34')](_0x243182['query'][_0xdafd('0x34')]));_0x13ab81[_0xdafd('0x33')]=_0x13ab81[_0xdafd('0x33')]['length']?_0x13ab81[_0xdafd('0x33')]:_0x249743[_0xdafd('0x2f')];if(_0x243182['query'][_0xdafd('0x35')]){_0x13ab81[_0xdafd('0x36')]=[{'all':!![]}];}_0x13ab81=_[_0xdafd('0x37')]({},_0x13ab81,_0x243182['options']);return db[_0xdafd('0x38')][_0xdafd('0x39')](_0x13ab81)[_0xdafd('0x27')](handleEntityNotFound(_0x14626b,null))[_0xdafd('0x27')](respondWithResult(_0x14626b,null))[_0xdafd('0x3a')](handleError(_0x14626b,null));};exports[_0xdafd('0x3b')]=function(_0x3bda9b,_0x5dc9f2){return db[_0xdafd('0x38')][_0xdafd('0x3b')](_0x3bda9b[_0xdafd('0x3c')],{})[_0xdafd('0x27')](respondWithResult(_0x5dc9f2,0xc9))[_0xdafd('0x3a')](handleError(_0x5dc9f2,null));};exports['update']=function(_0x386cf6,_0x21d724){if(_0x386cf6['body']['id']){delete _0x386cf6[_0xdafd('0x3c')]['id'];}return db[_0xdafd('0x38')][_0xdafd('0x39')]({'where':{'id':_0x386cf6[_0xdafd('0x2e')]['id']}})[_0xdafd('0x27')](handleEntityNotFound(_0x21d724,null))[_0xdafd('0x27')](saveUpdates(_0x386cf6[_0xdafd('0x3c')],null))[_0xdafd('0x27')](respondWithResult(_0x21d724,null))[_0xdafd('0x3a')](handleError(_0x21d724,null));};exports[_0xdafd('0x28')]=function(_0x787d7c,_0x245163){return db[_0xdafd('0x38')][_0xdafd('0x39')]({'where':{'id':_0x787d7c[_0xdafd('0x2e')]['id']}})[_0xdafd('0x27')](handleEntityNotFound(_0x245163,null))[_0xdafd('0x27')](removeEntity(_0x245163,null))[_0xdafd('0x3a')](handleError(_0x245163,null));};
\ No newline at end of file
+var _0x5243=['mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','name','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','catch','destroy','eml-format','fast-json-patch','request-promise'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x5243,0x71));var _0x3524=function(_0x36b0ca,_0x19b1ab){_0x36b0ca=_0x36b0ca-0x0;var _0x49b07c=_0x5243[_0x36b0ca];return _0x49b07c;};'use strict';var emlformat=require(_0x3524('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3524('0x1'));var rp=require(_0x3524('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3524('0x3'));var util=require(_0x3524('0x4'));var path=require('path');var sox=require(_0x3524('0x5'));var csv=require('to-csv');var ejs=require(_0x3524('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3524('0x7'));var squel=require(_0x3524('0x8'));var crypto=require(_0x3524('0x9'));var jsforce=require(_0x3524('0xa'));var deskjs=require(_0x3524('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3524('0xc'));var Redis=require(_0x3524('0xd'));var authService=require(_0x3524('0xe'));var qs=require(_0x3524('0xf'));var as=require(_0x3524('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3524('0x11'))(_0x3524('0x12'));var utils=require('../../config/utils');var config=require(_0x3524('0x13'));var licenseUtil=require(_0x3524('0x14'));var db=require(_0x3524('0x15'))['db'];function respondWithStatusCode(_0x5d5a60,_0x4f49da){_0x4f49da=_0x4f49da||0xcc;return function(_0x50c11f){if(_0x50c11f){return _0x5d5a60['sendStatus'](_0x4f49da);}return _0x5d5a60[_0x3524('0x16')](_0x4f49da)[_0x3524('0x17')]();};}function respondWithResult(_0x58cd29,_0x3aa2da){_0x3aa2da=_0x3aa2da||0xc8;return function(_0x253d92){if(_0x253d92){return _0x58cd29[_0x3524('0x16')](_0x3aa2da)[_0x3524('0x18')](_0x253d92);}};}function respondWithFilteredResult(_0xe5df67,_0x235cfd){return function(_0x34d9a0){if(_0x34d9a0){var _0x8440a4=typeof _0x235cfd[_0x3524('0x19')]==='undefined'&&typeof _0x235cfd[_0x3524('0x1a')]==='undefined';var _0x2eb681=_0x34d9a0[_0x3524('0x1b')];var _0x44ee2e=_0x8440a4?0x0:_0x235cfd[_0x3524('0x19')];var _0x1ca615=_0x8440a4?_0x34d9a0[_0x3524('0x1b')]:_0x235cfd['offset']+_0x235cfd['limit'];var _0x1acbd1;if(_0x1ca615>=_0x2eb681){_0x1ca615=_0x2eb681;_0x1acbd1=0xc8;}else{_0x1acbd1=0xce;}_0xe5df67['status'](_0x1acbd1);return _0xe5df67[_0x3524('0x1c')](_0x3524('0x1d'),_0x44ee2e+'-'+_0x1ca615+'/'+_0x2eb681)[_0x3524('0x18')](_0x34d9a0);}return null;};}function patchUpdates(_0xd285a3){return function(_0x1d25f8){try{jsonpatch[_0x3524('0x1e')](_0x1d25f8,_0xd285a3,!![]);}catch(_0x4f584a){return BPromise[_0x3524('0x1f')](_0x4f584a);}return _0x1d25f8[_0x3524('0x20')]();};}function saveUpdates(_0x1ab2c5,_0xf1b3b1){return function(_0x2d20c8){if(_0x2d20c8){return _0x2d20c8['update'](_0x1ab2c5)[_0x3524('0x21')](function(_0x52600c){return _0x52600c;});}return null;};}function removeEntity(_0x2eb72f,_0x26c20e){return function(_0x101e9a){if(_0x101e9a){return _0x101e9a['destroy']()[_0x3524('0x21')](function(){_0x2eb72f[_0x3524('0x16')](0xcc)[_0x3524('0x17')]();});}};}function handleEntityNotFound(_0x27bd6a,_0x4dfd49){return function(_0x4256ca){if(!_0x4256ca){_0x27bd6a[_0x3524('0x22')](0x194);}return _0x4256ca;};}function handleError(_0x1765a4,_0x5dc071){_0x5dc071=_0x5dc071||0x1f4;return function(_0x1d351e){logger[_0x3524('0x23')](_0x1d351e['stack']);if(_0x1d351e[_0x3524('0x24')]){delete _0x1d351e[_0x3524('0x24')];}_0x1765a4['status'](_0x5dc071)['send'](_0x1d351e);};}exports[_0x3524('0x25')]=function(_0x3fddc1,_0x225b26){var _0x651f11={'raw':!![],'where':{'id':_0x3fddc1[_0x3524('0x26')]['id']}},_0x5bf38e={};_0x5bf38e['model']=_[_0x3524('0x27')](db[_0x3524('0x28')][_0x3524('0x29')]);_0x5bf38e['query']=_['keys'](_0x3fddc1[_0x3524('0x2a')]);_0x5bf38e[_0x3524('0x2b')]=_['intersection'](_0x5bf38e[_0x3524('0x2c')],_0x5bf38e[_0x3524('0x2a')]);_0x651f11[_0x3524('0x2d')]=_[_0x3524('0x2e')](_0x5bf38e[_0x3524('0x2c')],qs['fields'](_0x3fddc1[_0x3524('0x2a')][_0x3524('0x2f')]));_0x651f11[_0x3524('0x2d')]=_0x651f11['attributes'][_0x3524('0x30')]?_0x651f11[_0x3524('0x2d')]:_0x5bf38e[_0x3524('0x2c')];if(_0x3fddc1[_0x3524('0x2a')][_0x3524('0x31')]){_0x651f11[_0x3524('0x32')]=[{'all':!![]}];}_0x651f11=_[_0x3524('0x33')]({},_0x651f11,_0x3fddc1[_0x3524('0x34')]);return db[_0x3524('0x28')][_0x3524('0x35')](_0x651f11)[_0x3524('0x21')](handleEntityNotFound(_0x225b26,null))['then'](respondWithResult(_0x225b26,null))['catch'](handleError(_0x225b26,null));};exports['create']=function(_0x197f78,_0x48b54b){return db[_0x3524('0x28')][_0x3524('0x36')](_0x197f78[_0x3524('0x37')],{})['then'](respondWithResult(_0x48b54b,0xc9))[_0x3524('0x38')](handleError(_0x48b54b,null));};exports['update']=function(_0x18ee71,_0xcc63d5){if(_0x18ee71[_0x3524('0x37')]['id']){delete _0x18ee71[_0x3524('0x37')]['id'];}return db[_0x3524('0x28')]['find']({'where':{'id':_0x18ee71[_0x3524('0x26')]['id']}})[_0x3524('0x21')](handleEntityNotFound(_0xcc63d5,null))[_0x3524('0x21')](saveUpdates(_0x18ee71[_0x3524('0x37')],null))['then'](respondWithResult(_0xcc63d5,null))[_0x3524('0x38')](handleError(_0xcc63d5,null));};exports[_0x3524('0x39')]=function(_0x449c51,_0x97b711){return db[_0x3524('0x28')]['find']({'where':{'id':_0x449c51['params']['id']}})[_0x3524('0x21')](handleEntityNotFound(_0x97b711,null))[_0x3524('0x21')](removeEntity(_0x97b711,null))[_0x3524('0x38')](handleError(_0x97b711,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 008ccd7..aa377f8 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 _0xdf81=['bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x433919,_0x4b106a){var _0x192c9f=function(_0x153f4a){while(--_0x153f4a){_0x433919['push'](_0x433919['shift']());}};_0x192c9f(++_0x4b106a);}(_0xdf81,0xcc));var _0x1df8=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xdf81[_0x4b73a2];return _0x383c66;};'use strict';var _=require(_0x1df8('0x0'));var util=require(_0x1df8('0x1'));var logger=require(_0x1df8('0x2'))(_0x1df8('0x3'));var moment=require('moment');var BPromise=require(_0x1df8('0x4'));var rp=require(_0x1df8('0x5'));var fs=require('fs');var path=require(_0x1df8('0x6'));var rimraf=require(_0x1df8('0x7'));var config=require('../../config/environment');var attributes=require(_0x1df8('0x8'));module[_0x1df8('0x9')]=function(_0x23971d,_0xc7a571){return _0x23971d[_0x1df8('0xa')](_0x1df8('0xb'),attributes,{'tableName':_0x1df8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c1d=['util','api','moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash'];(function(_0x5773ed,_0x2270ce){var _0x4a75d9=function(_0x31a9a3){while(--_0x31a9a3){_0x5773ed['push'](_0x5773ed['shift']());}};_0x4a75d9(++_0x2270ce);}(_0x5c1d,0x103));var _0xd5c1=function(_0x910cb0,_0x32746d){_0x910cb0=_0x910cb0-0x0;var _0x474d65=_0x5c1d[_0x910cb0];return _0x474d65;};'use strict';var _=require(_0xd5c1('0x0'));var util=require(_0xd5c1('0x1'));var logger=require('../../config/logger')(_0xd5c1('0x2'));var moment=require(_0xd5c1('0x3'));var BPromise=require(_0xd5c1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd5c1('0x5'));var rimraf=require(_0xd5c1('0x6'));var config=require(_0xd5c1('0x7'));var attributes=require(_0xd5c1('0x8'));module[_0xd5c1('0x9')]=function(_0x4d7b76,_0x18ead7){return _0x4d7b76[_0xd5c1('0xa')](_0xd5c1('0xb'),attributes,{'tableName':_0xd5c1('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 f994b15..de572b0 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 _0xa818=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0xa818,0x64));var _0x8a81=function(_0x3daa8c,_0x388a87){_0x3daa8c=_0x3daa8c-0x0;var _0x2b1bd7=_0xa818[_0x3daa8c];return _0x2b1bd7;};'use strict';var _=require('lodash');var util=require(_0x8a81('0x0'));var moment=require(_0x8a81('0x1'));var BPromise=require(_0x8a81('0x2'));var rs=require(_0x8a81('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a81('0x4'))['db'];var utils=require(_0x8a81('0x5'));var logger=require(_0x8a81('0x6'))(_0x8a81('0x7'));var config=require(_0x8a81('0x8'));var jayson=require(_0x8a81('0x9'));var client=jayson['client'][_0x8a81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a0cd9,_0x15025d,_0x35eb10){return new BPromise(function(_0x1a364a,_0x5e65d5){return client[_0x8a81('0xb')](_0x2a0cd9,_0x35eb10)[_0x8a81('0xc')](function(_0x55be3a){logger[_0x8a81('0xd')](_0x8a81('0xe'),_0x15025d,_0x8a81('0xf'));logger[_0x8a81('0x10')](_0x8a81('0x11'),_0x15025d,_0x8a81('0xf'),JSON[_0x8a81('0x12')](_0x55be3a));if(_0x55be3a[_0x8a81('0x13')]){if(_0x55be3a[_0x8a81('0x13')]['code']===0x1f4){logger['error'](_0x8a81('0xe'),_0x15025d,_0x55be3a[_0x8a81('0x13')][_0x8a81('0x14')]);return _0x5e65d5(_0x55be3a[_0x8a81('0x13')][_0x8a81('0x14')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x15025d,_0x55be3a[_0x8a81('0x13')][_0x8a81('0x14')]);return _0x1a364a(_0x55be3a[_0x8a81('0x13')]['message']);}else{logger[_0x8a81('0xd')](_0x8a81('0xe'),_0x15025d,_0x8a81('0xf'));_0x1a364a(_0x55be3a[_0x8a81('0x15')]['message']);}})[_0x8a81('0x16')](function(_0x269f5c){logger[_0x8a81('0x13')](_0x8a81('0xe'),_0x15025d,_0x269f5c);_0x5e65d5(_0x269f5c);});});}
\ No newline at end of file
+var _0xd0ba=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd0ba,0x17c));var _0xad0b=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0xd0ba[_0x2b5513];return _0x578fd2;};'use strict';var _=require('lodash');var util=require(_0xad0b('0x0'));var moment=require(_0xad0b('0x1'));var BPromise=require(_0xad0b('0x2'));var rs=require(_0xad0b('0x3'));var fs=require('fs');var Redis=require(_0xad0b('0x4'));var db=require(_0xad0b('0x5'))['db'];var utils=require(_0xad0b('0x6'));var logger=require(_0xad0b('0x7'))(_0xad0b('0x8'));var config=require('../../config/environment');var jayson=require(_0xad0b('0x9'));var client=jayson[_0xad0b('0xa')][_0xad0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x482525,_0x407d30,_0x10cf14){return new BPromise(function(_0x529785,_0x4981c3){return client['request'](_0x482525,_0x10cf14)['then'](function(_0x278f33){logger['info'](_0xad0b('0xc'),_0x407d30,_0xad0b('0xd'));logger['debug'](_0xad0b('0xe'),_0x407d30,_0xad0b('0xd'),JSON[_0xad0b('0xf')](_0x278f33));if(_0x278f33[_0xad0b('0x10')]){if(_0x278f33['error']['code']===0x1f4){logger[_0xad0b('0x10')](_0xad0b('0xc'),_0x407d30,_0x278f33[_0xad0b('0x10')][_0xad0b('0x11')]);return _0x4981c3(_0x278f33[_0xad0b('0x10')][_0xad0b('0x11')]);}logger[_0xad0b('0x10')](_0xad0b('0xc'),_0x407d30,_0x278f33[_0xad0b('0x10')][_0xad0b('0x11')]);return _0x529785(_0x278f33['error'][_0xad0b('0x11')]);}else{logger[_0xad0b('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x407d30,_0xad0b('0xd'));_0x529785(_0x278f33['result'][_0xad0b('0x11')]);}})[_0xad0b('0x13')](function(_0x4394be){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x407d30,_0x4394be);_0x4981c3(_0x4394be);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index ac5a1de..c65672c 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 _0x7fbe=['show','post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x1ead47,_0x47766a){var _0x8cbbbc=function(_0x2a20fb){while(--_0x2a20fb){_0x1ead47['push'](_0x1ead47['shift']());}};_0x8cbbbc(++_0x47766a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x35c718,_0x33a696){_0x35c718=_0x35c718-0x0;var _0x5c3099=_0x7fbe[_0x35c718];return _0x5c3099;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0xc')]);router[_0xe7fb('0xd')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0xe')]);router[_0xe7fb('0xf')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller['update']);router['delete'](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0x10')]);module[_0xe7fb('0x11')]=router;
\ No newline at end of file
+var _0x6f47=['show','post','create','put','/:id','update','destroy','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated'];(function(_0x2f56b5,_0x582964){var _0x13f229=function(_0x2e81fb){while(--_0x2e81fb){_0x2f56b5['push'](_0x2f56b5['shift']());}};_0x13f229(++_0x582964);}(_0x6f47,0xc7));var _0x76f4=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x6f47[_0xaa0309];return _0x5de7ce;};'use strict';var multer=require('multer');var util=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f4('0x2'));var router=express['Router']();var fs_extra=require(_0x76f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var controller=require(_0x76f4('0x6'));router[_0x76f4('0x7')]('/:id',auth[_0x76f4('0x8')](),controller[_0x76f4('0x9')]);router[_0x76f4('0xa')]('/',auth['isAuthenticated'](),controller[_0x76f4('0xb')]);router[_0x76f4('0xc')](_0x76f4('0xd'),auth[_0x76f4('0x8')](),controller[_0x76f4('0xe')]);router['delete']('/:id',auth[_0x76f4('0x8')](),controller[_0x76f4('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 4538dd9..9dfe46b 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 _0xfe38=['exports','STRING','name','ENUM','rrmemory','sequelize'];(function(_0x5d0430,_0x15cc32){var _0x4d964c=function(_0x392cbf){while(--_0x392cbf){_0x5d0430['push'](_0x5d0430['shift']());}};_0x4d964c(++_0x15cc32);}(_0xfe38,0x18b));var _0x8fe3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfe38[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x8fe3('0x0'));module[_0x8fe3('0x1')]={'name':{'type':Sequelize[_0x8fe3('0x2')],'unique':_0x8fe3('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8fe3('0x4')](_0x8fe3('0x5'),'beepall','roundrobin')}};
\ No newline at end of file
+var _0x23ac=['beepall','roundrobin','STRING','name','ENUM'];(function(_0x5e0d54,_0x493251){var _0x280def=function(_0x18bf09){while(--_0x18bf09){_0x5e0d54['push'](_0x5e0d54['shift']());}};_0x280def(++_0x493251);}(_0x23ac,0x11f));var _0xc23a=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0x23ac[_0x261e29];return _0x25ef43;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc23a('0x0')],'unique':_0xc23a('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc23a('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc23a('0x2')]('rrmemory',_0xc23a('0x3'),_0xc23a('0x4'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 14ef097..2ada005 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 _0x2f4a=['../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','ChatQueue','include','query','findAll','rows','catch','show','params','model','intersection','attributes','fields','length','includeAll','options','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','keys','filters','hasOwnProperty','nolimit','order','sort','ChatQueueId','filter','merge','UserChatQueue','User','findAndCountAll','agent','chatPause','updatedAt','format','SIP','createdAt','getTeams','findOne','pick','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','toString','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','userChatQueue:save','isArray','getAgents','util','lodash','squel'];(function(_0xa0cb20,_0x1c18ef){var _0x2cc906=function(_0x4db98b){while(--_0x4db98b){_0xa0cb20['push'](_0xa0cb20['shift']());}};_0x2cc906(++_0x1c18ef);}(_0x2f4a,0x75));var _0xa2f4=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x2f4a[_0x513aa5];return _0x1a1a7c;};'use strict';var BPromise=require('bluebird');var util=require(_0xa2f4('0x0'));var _=require(_0xa2f4('0x1'));var squel=require(_0xa2f4('0x2'));var Redis=require('ioredis');var qs=require(_0xa2f4('0x3'));var logger=require(_0xa2f4('0x4'))(_0xa2f4('0x5'));var config=require(_0xa2f4('0x6'));var db=require(_0xa2f4('0x7'))['db'];config[_0xa2f4('0x8')]=_[_0xa2f4('0x9')](config['redis'],{'host':_0xa2f4('0xa'),'port':0x18eb});var socket=require(_0xa2f4('0xb'))(new Redis(config[_0xa2f4('0x8')]));require('./chatQueue.socket')[_0xa2f4('0xc')](socket);function respondWithStatusCode(_0x3d76cb,_0x210083){_0x210083=_0x210083||0xcc;return function(_0x596cb1){if(_0x596cb1){return _0x3d76cb[_0xa2f4('0xd')](_0x210083);}return _0x3d76cb[_0xa2f4('0xe')](_0x210083)[_0xa2f4('0xf')]();};}function respondWithResult(_0x58f4fd,_0x277fc0){_0x277fc0=_0x277fc0||0xc8;return function(_0x210e3a){if(_0x210e3a){return _0x58f4fd[_0xa2f4('0xe')](_0x277fc0)[_0xa2f4('0x10')](_0x210e3a);}};}function respondWithFilteredResult(_0x386050,_0x39b47a){return function(_0x55e812){if(_0x55e812){var _0x15b2b9=typeof _0x39b47a['offset']==='undefined'&&typeof _0x39b47a[_0xa2f4('0x11')]===_0xa2f4('0x12');var _0x12c0ca=_0x55e812[_0xa2f4('0x13')];var _0x9e8adc=_0x15b2b9?0x0:_0x39b47a[_0xa2f4('0x14')];var _0x2eaa36=_0x15b2b9?_0x55e812['count']:_0x39b47a[_0xa2f4('0x14')]+_0x39b47a[_0xa2f4('0x11')];var _0x11b64c;if(_0x2eaa36>=_0x12c0ca){_0x2eaa36=_0x12c0ca;_0x11b64c=0xc8;}else{_0x11b64c=0xce;}_0x386050['status'](_0x11b64c);return _0x386050['set'](_0xa2f4('0x15'),_0x9e8adc+'-'+_0x2eaa36+'/'+_0x12c0ca)[_0xa2f4('0x10')](_0x55e812);}return null;};}function saveUpdates(_0x13ee36){return function(_0xc305ed){if(_0xc305ed){return _0xc305ed[_0xa2f4('0x16')](_0x13ee36)[_0xa2f4('0x17')](function(_0x36bd06){return _0x36bd06;});}return null;};}function removeEntity(_0x1892fc){return function(_0x35cba5){if(_0x35cba5){return _0x35cba5[_0xa2f4('0x18')]()[_0xa2f4('0x17')](function(){var _0x554f6b=_0x35cba5[_0xa2f4('0x19')]({'plain':!![]});var _0x1d1ee2=_0xa2f4('0x1a');return db[_0xa2f4('0x1b')][_0xa2f4('0x18')]({'where':{'type':_0x1d1ee2,'resourceId':_0x554f6b['id']}})[_0xa2f4('0x17')](function(){return _0x35cba5;});})[_0xa2f4('0x17')](function(){_0x1892fc['status'](0xcc)[_0xa2f4('0xf')]();});}};}function handleEntityNotFound(_0x937460){return function(_0x435f71){if(!_0x435f71){_0x937460['sendStatus'](0x194);}return _0x435f71;};}function handleError(_0x44e0f4,_0x362b76){_0x362b76=_0x362b76||0x1f4;return function(_0x4ce83f){logger[_0xa2f4('0x1c')](_0x4ce83f['stack']);if(_0x4ce83f[_0xa2f4('0x1d')]){delete _0x4ce83f[_0xa2f4('0x1d')];}_0x44e0f4[_0xa2f4('0xe')](_0x362b76)[_0xa2f4('0x1e')](_0x4ce83f);};}exports[_0xa2f4('0x1f')]=function(_0x535add,_0x8d7e33){var _0x583258={};var _0x2293b7={'count':0x0,'rows':[]};var _0x56f4b2=_[_0xa2f4('0x20')](db['ChatQueue'][_0xa2f4('0x21')],function(_0x262c45){return{'name':_0x262c45[_0xa2f4('0x22')],'type':_0x262c45[_0xa2f4('0x23')][_0xa2f4('0x24')]};});_0x583258=qs[_0xa2f4('0x25')](_0x56f4b2,_0x535add);var _0x5da497={'where':_0x583258[_0xa2f4('0x26')]};return db[_0xa2f4('0x27')][_0xa2f4('0x13')](_0x5da497)[_0xa2f4('0x17')](function(_0x204fcd){_0x2293b7['count']=_0x204fcd;_0x583258['include']=qs[_0xa2f4('0x28')](_0x535add[_0xa2f4('0x29')]);return db[_0xa2f4('0x27')][_0xa2f4('0x2a')](_0x583258);})[_0xa2f4('0x17')](function(_0x27a4e8){_0x2293b7[_0xa2f4('0x2b')]=_0x27a4e8;return _0x2293b7;})['then'](respondWithFilteredResult(_0x8d7e33,_0x583258))[_0xa2f4('0x2c')](handleError(_0x8d7e33,null));};exports[_0xa2f4('0x2d')]=function(_0x148e03,_0xcdbed7){var _0x414f8a={'raw':!![],'where':{'id':_0x148e03[_0xa2f4('0x2e')]['id']}},_0x3c7b5e={};_0x3c7b5e[_0xa2f4('0x2f')]=_['keys'](db[_0xa2f4('0x27')]['rawAttributes']);_0x3c7b5e[_0xa2f4('0x29')]=_['keys'](_0x148e03['query']);_0x3c7b5e['filters']=_[_0xa2f4('0x30')](_0x3c7b5e[_0xa2f4('0x2f')],_0x3c7b5e['query']);_0x414f8a[_0xa2f4('0x31')]=_[_0xa2f4('0x30')](_0x3c7b5e[_0xa2f4('0x2f')],qs['fields'](_0x148e03[_0xa2f4('0x29')][_0xa2f4('0x32')]));_0x414f8a[_0xa2f4('0x31')]=_0x414f8a[_0xa2f4('0x31')][_0xa2f4('0x33')]?_0x414f8a[_0xa2f4('0x31')]:_0x3c7b5e[_0xa2f4('0x2f')];if(_0x148e03['query'][_0xa2f4('0x34')]){_0x414f8a[_0xa2f4('0x28')]=[{'all':!![]}];}_0x414f8a=_['merge']({},_0x414f8a,_0x148e03[_0xa2f4('0x35')]);return db[_0xa2f4('0x27')][_0xa2f4('0x36')](_0x414f8a)[_0xa2f4('0x17')](handleEntityNotFound(_0xcdbed7,null))['then'](respondWithResult(_0xcdbed7,null))[_0xa2f4('0x2c')](handleError(_0xcdbed7,null));};exports[_0xa2f4('0x37')]=function(_0x5025e1,_0x5d00e4){return db['ChatQueue']['create'](_0x5025e1[_0xa2f4('0x38')],{})['then'](function(_0xcd8457){var _0x4f6170=_0x5025e1[_0xa2f4('0x39')][_0xa2f4('0x19')]({'plain':!![]});if(!_0x4f6170)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f6170[_0xa2f4('0x3a')]===_0xa2f4('0x39')){var _0x2b838c=_0xcd8457['get']({'plain':!![]});var _0x57e76b='ChatQueues';return db['UserProfileSection'][_0xa2f4('0x36')]({'where':{'name':_0x57e76b,'userProfileId':_0x4f6170[_0xa2f4('0x3b')]},'raw':!![]})[_0xa2f4('0x17')](function(_0x27f4d9){if(_0x27f4d9&&_0x27f4d9[_0xa2f4('0x3c')]===0x0){return db[_0xa2f4('0x1b')]['create']({'name':_0x2b838c['name'],'resourceId':_0x2b838c['id'],'type':_0x27f4d9['name'],'sectionId':_0x27f4d9['id']},{})['then'](function(){return _0xcd8457;});}else{return _0xcd8457;}})['catch'](function(_0x16b52f){logger['error'](_0xa2f4('0x3d'),_0x16b52f);throw _0x16b52f;});}return _0xcd8457;})[_0xa2f4('0x17')](respondWithResult(_0x5d00e4,0xc9))[_0xa2f4('0x2c')](handleError(_0x5d00e4,null));};exports[_0xa2f4('0x16')]=function(_0x203044,_0x519ac0){if(_0x203044['body']['id']){delete _0x203044[_0xa2f4('0x38')]['id'];}return db[_0xa2f4('0x27')]['find']({'where':{'id':_0x203044['params']['id']}})[_0xa2f4('0x17')](handleEntityNotFound(_0x519ac0,null))['then'](saveUpdates(_0x203044[_0xa2f4('0x38')],null))[_0xa2f4('0x17')](respondWithResult(_0x519ac0,null))[_0xa2f4('0x2c')](handleError(_0x519ac0,null));};exports['destroy']=function(_0xdcb383,_0x7b6fd5){return db[_0xa2f4('0x27')]['find']({'where':{'id':_0xdcb383[_0xa2f4('0x2e')]['id']}})[_0xa2f4('0x17')](handleEntityNotFound(_0x7b6fd5,null))['then'](removeEntity(_0x7b6fd5,null))[_0xa2f4('0x2c')](handleError(_0x7b6fd5,null));};exports['describe']=function(_0x140c86,_0x414575){return db[_0xa2f4('0x27')][_0xa2f4('0x3e')]()['then'](respondWithResult(_0x414575,null))[_0xa2f4('0x2c')](handleError(_0x414575,null));};exports[_0xa2f4('0x3f')]=function(_0xafcd9b,_0x31aa38){var _0x1267f7={'raw':!![],'where':{}},_0x23cae8={},_0xd77187;return db[_0xa2f4('0x27')]['findOne']({'where':{'id':_0xafcd9b['params']['id']}})['then'](handleEntityNotFound(_0x31aa38,null))[_0xa2f4('0x17')](function(_0x2fb8f1){if(_0x2fb8f1){_0xd77187=_0x2fb8f1[_0xa2f4('0x19')]({'plain':!![]});_0x23cae8['model']=_[_0xa2f4('0x40')](db['UserChatQueue'][_0xa2f4('0x21')]);_0x23cae8[_0xa2f4('0x29')]=_['keys'](_0xafcd9b['query']);_0x23cae8[_0xa2f4('0x41')]=_[_0xa2f4('0x30')](_0x23cae8[_0xa2f4('0x2f')],_0x23cae8[_0xa2f4('0x29')]);_0x1267f7[_0xa2f4('0x31')]=_['intersection'](_0x23cae8[_0xa2f4('0x2f')],qs[_0xa2f4('0x32')](_0xafcd9b['query'][_0xa2f4('0x32')]));_0x1267f7['attributes']=_0x1267f7['attributes'][_0xa2f4('0x33')]?_0x1267f7[_0xa2f4('0x31')]:_0x23cae8[_0xa2f4('0x2f')];if(!_0xafcd9b[_0xa2f4('0x29')][_0xa2f4('0x42')](_0xa2f4('0x43'))){_0x1267f7[_0xa2f4('0x11')]=qs['limit'](_0xafcd9b[_0xa2f4('0x29')][_0xa2f4('0x11')]);_0x1267f7[_0xa2f4('0x14')]=qs[_0xa2f4('0x14')](_0xafcd9b[_0xa2f4('0x29')][_0xa2f4('0x14')]);}_0x1267f7[_0xa2f4('0x44')]=qs[_0xa2f4('0x45')](_0xafcd9b['query'][_0xa2f4('0x45')]);_0x1267f7['where']=qs[_0xa2f4('0x41')](_['pick'](_0xafcd9b['query'],_0x23cae8[_0xa2f4('0x41')]));_0x1267f7[_0xa2f4('0x26')][_0xa2f4('0x46')]=_0x2fb8f1['id'];if(_0xafcd9b[_0xa2f4('0x29')][_0xa2f4('0x47')]){_0x1267f7[_0xa2f4('0x26')]=_[_0xa2f4('0x48')](_0x1267f7[_0xa2f4('0x26')],{'$or':_[_0xa2f4('0x20')](_0x1267f7['attributes'],function(_0x54286b){var _0x1a04e1={};_0x1a04e1[_0x54286b]={'$like':'%'+_0xafcd9b[_0xa2f4('0x29')]['filter']+'%'};return _0x1a04e1;})});}_0x1267f7=_[_0xa2f4('0x48')]({},_0x1267f7,_0xafcd9b['options']);return db[_0xa2f4('0x49')][_0xa2f4('0x2a')](_0x1267f7);}})[_0xa2f4('0x17')](function(_0x5095fe){if(_0x5095fe){return db[_0xa2f4('0x4a')][_0xa2f4('0x4b')]({'where':{'id':_['map'](_0x5095fe,'UserId'),'role':_0xa2f4('0x4c')},'attributes':['id',_0xa2f4('0x1d'),_0xa2f4('0x4d'),_0xa2f4('0x4e'),'createdAt']});}})[_0xa2f4('0x17')](function(_0x2f8255){if(_0x2f8255){return{'count':_0x2f8255[_0xa2f4('0x13')],'rows':_[_0xa2f4('0x20')](_0x2f8255[_0xa2f4('0x2b')],function(_0x599044){return{'membername':_0x599044[_0xa2f4('0x1d')],'UserId':_0x599044['id'],'queue_name':_0xd77187['name'],'ChatQueueId':_0xd77187['id'],'interface':util[_0xa2f4('0x4f')]('%s/%s',_0xa2f4('0x50'),_0x599044[_0xa2f4('0x1d')]),'penalty':0x0,'paused':_0x599044['chatPause'],'createdAt':_0x599044[_0xa2f4('0x51')],'updatedAt':_0x599044[_0xa2f4('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x31aa38,_0x1267f7))[_0xa2f4('0x2c')](handleError(_0x31aa38,null));};exports[_0xa2f4('0x52')]=function(_0x5aa3e0,_0x145ec0){var _0x297fa8={};var _0x27b71a={};var _0x19cdb5;var _0x4e97f0;return db[_0xa2f4('0x27')][_0xa2f4('0x53')]({'where':{'id':_0x5aa3e0[_0xa2f4('0x2e')]['id']}})['then'](handleEntityNotFound(_0x145ec0,null))[_0xa2f4('0x17')](function(_0x144fb4){if(_0x144fb4){_0x19cdb5=_0x144fb4;_0x27b71a['model']=_['keys'](db['Team'][_0xa2f4('0x21')]);_0x27b71a[_0xa2f4('0x29')]=_['keys'](_0x5aa3e0[_0xa2f4('0x29')]);_0x27b71a[_0xa2f4('0x41')]=_[_0xa2f4('0x30')](_0x27b71a[_0xa2f4('0x2f')],_0x27b71a[_0xa2f4('0x29')]);_0x297fa8[_0xa2f4('0x31')]=_[_0xa2f4('0x30')](_0x27b71a[_0xa2f4('0x2f')],qs[_0xa2f4('0x32')](_0x5aa3e0['query']['fields']));_0x297fa8[_0xa2f4('0x31')]=_0x297fa8[_0xa2f4('0x31')][_0xa2f4('0x33')]?_0x297fa8[_0xa2f4('0x31')]:_0x27b71a[_0xa2f4('0x2f')];_0x297fa8[_0xa2f4('0x44')]=qs[_0xa2f4('0x45')](_0x5aa3e0['query'][_0xa2f4('0x45')]);_0x297fa8['where']=qs['filters'](_[_0xa2f4('0x54')](_0x5aa3e0[_0xa2f4('0x29')],_0x27b71a['filters']));if(_0x5aa3e0[_0xa2f4('0x29')][_0xa2f4('0x47')]){_0x297fa8['where']=_[_0xa2f4('0x48')](_0x297fa8['where'],{'$or':_['map'](_0x297fa8[_0xa2f4('0x31')],function(_0x4dc930){var _0x4dcce2={};_0x4dcce2[_0x4dc930]={'$like':'%'+_0x5aa3e0[_0xa2f4('0x29')][_0xa2f4('0x47')]+'%'};return _0x4dcce2;})});}_0x297fa8=_[_0xa2f4('0x48')]({},_0x297fa8,_0x5aa3e0[_0xa2f4('0x35')]);return _0x19cdb5[_0xa2f4('0x52')](_0x297fa8);}})[_0xa2f4('0x17')](function(_0x5b23ec){if(_0x5b23ec){_0x4e97f0=_0x5b23ec[_0xa2f4('0x33')];if(!_0x5aa3e0[_0xa2f4('0x29')][_0xa2f4('0x42')](_0xa2f4('0x43'))){_0x297fa8[_0xa2f4('0x11')]=qs['limit'](_0x5aa3e0[_0xa2f4('0x29')][_0xa2f4('0x11')]);_0x297fa8[_0xa2f4('0x14')]=qs[_0xa2f4('0x14')](_0x5aa3e0['query']['offset']);}return _0x19cdb5[_0xa2f4('0x52')](_0x297fa8);}})['then'](function(_0x523d62){if(_0x523d62){return _0x523d62?{'count':_0x4e97f0,'rows':_0x523d62}:null;}})['then'](respondWithResult(_0x145ec0,null))[_0xa2f4('0x2c')](handleError(_0x145ec0,null));};exports[_0xa2f4('0x55')]=function(_0x208a5b,_0x1c37c0){var _0x306e75=_0x208a5b['body'][_0xa2f4('0x56')];return db[_0xa2f4('0x57')][_0xa2f4('0x2a')]({'where':{'id':_0x306e75},'attributes':['id'],'include':[{'model':db[_0xa2f4('0x4a')],'as':_0xa2f4('0x58'),'attributes':['id',_0xa2f4('0x1d'),'online',_0xa2f4('0x59'),_0xa2f4('0x5a')],'raw':!![]}]})[_0xa2f4('0x17')](function(_0x5ee101){if(_0x5ee101){var _0x4222fb=_[_0xa2f4('0x5b')](_0x5ee101,function(_0x229aee){var _0x5b9999=_0x229aee[_0xa2f4('0x19')]({'plain':!![]});return _0x5b9999[_0xa2f4('0x58')];});return db['ChatQueue'][_0xa2f4('0x36')]({'where':{'id':_0x208a5b[_0xa2f4('0x2e')]['id']}})[_0xa2f4('0x17')](function(_0x57cb53){return db[_0xa2f4('0x5c')]['transaction'](function(_0x2b5106){return _0x57cb53[_0xa2f4('0x55')](_0x306e75,{'transaction':_0x2b5106})['then'](function(){return BPromise['each'](_0x4222fb,function(_0x1c4ac7){return db['UserChatQueue'][_0xa2f4('0x5d')]({'where':{'UserId':_0x1c4ac7['id'],'ChatQueueId':_0x208a5b[_0xa2f4('0x2e')]['id']},'transaction':_0x2b5106});});})[_0xa2f4('0x17')](function(){_0x4222fb[_0xa2f4('0x5e')](function(_0x58d784){socket[_0xa2f4('0x5f')]('userChatQueue:save',{'UserId':_0x58d784['id'],'ChatQueueId':_0x57cb53['id']});});});});});}})[_0xa2f4('0x17')](respondWithStatusCode(_0x1c37c0,null))[_0xa2f4('0x2c')](handleError(_0x1c37c0,null));};exports[_0xa2f4('0x60')]=function(_0x57494d,_0x2f913c){return db[_0xa2f4('0x57')][_0xa2f4('0x2a')]({'where':{'id':_0x57494d['query'][_0xa2f4('0x56')]},'attributes':['id'],'include':[{'model':db[_0xa2f4('0x4a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa2f4('0x17')](handleEntityNotFound(_0x2f913c,null))[_0xa2f4('0x17')](function(_0x26f5ec){var _0x1c6d5f=_[_0xa2f4('0x20')](_0x26f5ec,'id');var _0x47181e=[];var _0x210f99=[];var _0x193f11=squel['select']();_0x193f11[_0xa2f4('0x61')](_0xa2f4('0x62'))[_0xa2f4('0x63')](_0xa2f4('0x64'),'tq')['join'](_0xa2f4('0x65'),'ut',_0xa2f4('0x66'))[_0xa2f4('0x26')]('ChatQueueId\x20=\x20?',_0x57494d[_0xa2f4('0x2e')]['id']);for(var _0x539d28=0x0;_0x539d28<_0x26f5ec[_0xa2f4('0x33')];_0x539d28+=0x1){let _0x266b29=_0x26f5ec[_0x539d28];for(var _0x221db3=0x0;_0x221db3<_0x266b29['Agents'][_0xa2f4('0x33')];_0x221db3+=0x1){let _0x1772a1=_0x266b29['Agents'][_0x221db3];var _0x30e899=_0x193f11['clone']();_0x30e899[_0xa2f4('0x26')]('ut.UserId\x20=\x20?',_0x1772a1['id']);_0x210f99[_0xa2f4('0x67')](db['sequelize'][_0xa2f4('0x29')](_0x30e899[_0xa2f4('0x68')](),{'type':db[_0xa2f4('0x5c')]['QueryTypes'][_0xa2f4('0x69')]})[_0xa2f4('0x17')](function(_0x450ae5){if(_0x450ae5[_0xa2f4('0x33')]===0x1){return _0x1772a1['id'];}else{var _0x17b26f=_[_0xa2f4('0x6a')](_['map'](_0x450ae5,'TeamId'),function(_0x3ad792){return _[_0xa2f4('0x6b')](_0x1c6d5f,_0x3ad792);});if(_0x17b26f){return _0x1772a1['id'];}}}));}}return BPromise[_0xa2f4('0x6c')](_0x210f99)[_0xa2f4('0x17')](function(_0x5d0b69){_0x47181e=_(_0x47181e)[_0xa2f4('0x6d')](_0x5d0b69)[_0xa2f4('0x6e')]()[_0xa2f4('0x6f')]();return db['ChatQueue']['find']({'where':{'id':_0x57494d['params']['id']}})[_0xa2f4('0x17')](function(_0x40ef2b){return db[_0xa2f4('0x5c')]['transaction'](function(_0x41aec5){return _0x40ef2b[_0xa2f4('0x60')](_0x57494d[_0xa2f4('0x29')][_0xa2f4('0x56')],{'transaction':_0x41aec5})['then'](function(){if(!_[_0xa2f4('0x70')](_0x47181e)){return _0x40ef2b[_0xa2f4('0x71')](_0x47181e,{'transaction':_0x41aec5});}})[_0xa2f4('0x17')](function(){_0x47181e['forEach'](function(_0x3cb1e2){socket[_0xa2f4('0x5f')](_0xa2f4('0x72'),{'UserId':_0x3cb1e2,'ChatQueueId':_0x40ef2b['id']});});});});});});})[_0xa2f4('0x17')](respondWithStatusCode(_0x2f913c,null))['catch'](handleError(_0x2f913c,null));};exports[_0xa2f4('0x73')]=function(_0x5c42c6,_0x3ffa7a){return db['ChatQueue']['find']({'where':{'id':_0x5c42c6['params']['id']}})[_0xa2f4('0x17')](handleEntityNotFound(_0x3ffa7a,null))['then'](function(_0x259f14){if(_0x259f14){return _0x259f14['addAgents'](_0x5c42c6[_0xa2f4('0x38')][_0xa2f4('0x56')],_[_0xa2f4('0x74')](_0x5c42c6[_0xa2f4('0x38')],['ids','id'])||{})['spread'](function(_0x1727fe){for(var _0x417142=0x0;_0x417142<_0x5c42c6[_0xa2f4('0x38')]['ids'][_0xa2f4('0x33')];_0x417142+=0x1){socket[_0xa2f4('0x5f')](_0xa2f4('0x75'),{'UserId':Number(_0x5c42c6[_0xa2f4('0x38')][_0xa2f4('0x56')][_0x417142]),'ChatQueueId':Number(_0x5c42c6['params']['id'])});}return _0x1727fe;});}})[_0xa2f4('0x17')](respondWithResult(_0x3ffa7a,null))[_0xa2f4('0x2c')](handleError(_0x3ffa7a,null));};exports['removeAgents']=function(_0x273660,_0x5b9223){return db[_0xa2f4('0x27')][_0xa2f4('0x36')]({'where':{'id':_0x273660[_0xa2f4('0x2e')]['id']}})[_0xa2f4('0x17')](handleEntityNotFound(_0x5b9223,null))[_0xa2f4('0x17')](function(_0x1e83e0){if(_0x1e83e0){return _0x1e83e0['removeAgents'](_0x273660[_0xa2f4('0x29')][_0xa2f4('0x56')])[_0xa2f4('0x17')](function(){if(_[_0xa2f4('0x76')](_0x273660[_0xa2f4('0x29')]['ids'])){for(var _0x20ba23=0x0;_0x20ba23<_0x273660[_0xa2f4('0x29')][_0xa2f4('0x56')][_0xa2f4('0x33')];_0x20ba23+=0x1){socket[_0xa2f4('0x5f')](_0xa2f4('0x72'),{'UserId':Number(_0x273660['query'][_0xa2f4('0x56')][_0x20ba23]),'ChatQueueId':Number(_0x273660[_0xa2f4('0x2e')]['id'])});}}else{socket[_0xa2f4('0x5f')](_0xa2f4('0x72'),{'UserId':Number(_0x273660[_0xa2f4('0x29')]['ids']),'ChatQueueId':Number(_0x273660[_0xa2f4('0x2e')]['id'])});}});}})[_0xa2f4('0x17')](respondWithStatusCode(_0x5b9223,null))['catch'](handleError(_0x5b9223,null));};exports[_0xa2f4('0x77')]=function(_0x2b2971,_0x5ec331){var _0x871d2b={};var _0x1829b6={};var _0x76f82d;var _0x560d73;return db['ChatQueue'][_0xa2f4('0x53')]({'where':{'id':_0x2b2971['params']['id']}})[_0xa2f4('0x17')](handleEntityNotFound(_0x5ec331,null))['then'](function(_0x845768){if(_0x845768){_0x76f82d=_0x845768;_0x1829b6['model']=_[_0xa2f4('0x40')](db[_0xa2f4('0x4a')][_0xa2f4('0x21')]);_0x1829b6[_0xa2f4('0x29')]=_['keys'](_0x2b2971[_0xa2f4('0x29')]);_0x1829b6[_0xa2f4('0x41')]=_[_0xa2f4('0x30')](_0x1829b6['model'],_0x1829b6[_0xa2f4('0x29')]);_0x871d2b[_0xa2f4('0x31')]=_[_0xa2f4('0x30')](_0x1829b6['model'],qs[_0xa2f4('0x32')](_0x2b2971['query'][_0xa2f4('0x32')]));_0x871d2b['attributes']=_0x871d2b[_0xa2f4('0x31')]['length']?_0x871d2b['attributes']:_0x1829b6[_0xa2f4('0x2f')];_0x871d2b['order']=qs['sort'](_0x2b2971['query'][_0xa2f4('0x45')]);_0x871d2b[_0xa2f4('0x26')]=qs['filters'](_[_0xa2f4('0x54')](_0x2b2971[_0xa2f4('0x29')],_0x1829b6[_0xa2f4('0x41')]));if(_0x2b2971[_0xa2f4('0x29')][_0xa2f4('0x47')]){_0x871d2b[_0xa2f4('0x26')]=_['merge'](_0x871d2b[_0xa2f4('0x26')],{'$or':_[_0xa2f4('0x20')](_0x871d2b[_0xa2f4('0x31')],function(_0x4eb1c6){var _0x2b598d={};_0x2b598d[_0x4eb1c6]={'$like':'%'+_0x2b2971[_0xa2f4('0x29')][_0xa2f4('0x47')]+'%'};return _0x2b598d;})});}_0x871d2b=_[_0xa2f4('0x48')]({},_0x871d2b,_0x2b2971[_0xa2f4('0x35')]);return _0x76f82d['getAgents'](_0x871d2b);}})['then'](function(_0x528e8a){if(_0x528e8a){_0x560d73=_0x528e8a['length'];if(!_0x2b2971[_0xa2f4('0x29')][_0xa2f4('0x42')](_0xa2f4('0x43'))){_0x871d2b[_0xa2f4('0x11')]=qs[_0xa2f4('0x11')](_0x2b2971[_0xa2f4('0x29')]['limit']);_0x871d2b[_0xa2f4('0x14')]=qs['offset'](_0x2b2971[_0xa2f4('0x29')]['offset']);}return _0x76f82d['getAgents'](_0x871d2b);}})['then'](function(_0x353945){if(_0x353945){return _0x353945?{'count':_0x560d73,'rows':_0x353945}:null;}})[_0xa2f4('0x17')](respondWithResult(_0x5ec331,null))[_0xa2f4('0x2c')](handleError(_0x5ec331,null));};
\ No newline at end of file
+var _0xf2d9=['select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','compact','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','order','bluebird','util','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','update','then','get','ChatQueues','error','stack','name','index','map','ChatQueue','rawAttributes','type','key','getOptions','where','include','show','params','model','keys','query','filters','intersection','fields','attributes','length','merge','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','destroy','getMembers','UserChatQueue','hasOwnProperty','nolimit','sort','pick','ChatQueueId','filter','options','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','forEach','emit','userChatQueue:save','removeTeams'];(function(_0x13c1ac,_0x19325c){var _0x85cd90=function(_0x35861c){while(--_0x35861c){_0x13c1ac['push'](_0x13c1ac['shift']());}};_0x85cd90(++_0x19325c);}(_0xf2d9,0x17c));var _0x9f2d=function(_0x23d97c,_0x20d452){_0x23d97c=_0x23d97c-0x0;var _0x510fdd=_0xf2d9[_0x23d97c];return _0x510fdd;};'use strict';var BPromise=require(_0x9f2d('0x0'));var util=require(_0x9f2d('0x1'));var _=require('lodash');var squel=require(_0x9f2d('0x2'));var Redis=require(_0x9f2d('0x3'));var qs=require(_0x9f2d('0x4'));var logger=require('../../config/logger')(_0x9f2d('0x5'));var config=require(_0x9f2d('0x6'));var db=require(_0x9f2d('0x7'))['db'];config[_0x9f2d('0x8')]=_[_0x9f2d('0x9')](config[_0x9f2d('0x8')],{'host':_0x9f2d('0xa'),'port':0x18eb});var socket=require(_0x9f2d('0xb'))(new Redis(config[_0x9f2d('0x8')]));require(_0x9f2d('0xc'))[_0x9f2d('0xd')](socket);function respondWithStatusCode(_0x52ab0f,_0x216ae1){_0x216ae1=_0x216ae1||0xcc;return function(_0x26f244){if(_0x26f244){return _0x52ab0f[_0x9f2d('0xe')](_0x216ae1);}return _0x52ab0f[_0x9f2d('0xf')](_0x216ae1)[_0x9f2d('0x10')]();};}function respondWithResult(_0x312f6b,_0x451cfb){_0x451cfb=_0x451cfb||0xc8;return function(_0x32f752){if(_0x32f752){return _0x312f6b[_0x9f2d('0xf')](_0x451cfb)[_0x9f2d('0x11')](_0x32f752);}};}function respondWithFilteredResult(_0x5c2e8f,_0x3d3124){return function(_0x1a06e3){if(_0x1a06e3){var _0x15aa07=typeof _0x3d3124[_0x9f2d('0x12')]===_0x9f2d('0x13')&&typeof _0x3d3124['limit']===_0x9f2d('0x13');var _0x293bcc=_0x1a06e3[_0x9f2d('0x14')];var _0x4e1cb6=_0x15aa07?0x0:_0x3d3124['offset'];var _0x49bc3f=_0x15aa07?_0x1a06e3[_0x9f2d('0x14')]:_0x3d3124['offset']+_0x3d3124[_0x9f2d('0x15')];var _0x2dba24;if(_0x49bc3f>=_0x293bcc){_0x49bc3f=_0x293bcc;_0x2dba24=0xc8;}else{_0x2dba24=0xce;}_0x5c2e8f['status'](_0x2dba24);return _0x5c2e8f[_0x9f2d('0x16')]('Content-Range',_0x4e1cb6+'-'+_0x49bc3f+'/'+_0x293bcc)[_0x9f2d('0x11')](_0x1a06e3);}return null;};}function saveUpdates(_0x3375b2){return function(_0x5bd820){if(_0x5bd820){return _0x5bd820[_0x9f2d('0x17')](_0x3375b2)[_0x9f2d('0x18')](function(_0x56fc62){return _0x56fc62;});}return null;};}function removeEntity(_0x443419){return function(_0x4639b7){if(_0x4639b7){return _0x4639b7['destroy']()[_0x9f2d('0x18')](function(){var _0x4b09d3=_0x4639b7[_0x9f2d('0x19')]({'plain':!![]});var _0x48b647=_0x9f2d('0x1a');return db['UserProfileResource']['destroy']({'where':{'type':_0x48b647,'resourceId':_0x4b09d3['id']}})[_0x9f2d('0x18')](function(){return _0x4639b7;});})[_0x9f2d('0x18')](function(){_0x443419[_0x9f2d('0xf')](0xcc)[_0x9f2d('0x10')]();});}};}function handleEntityNotFound(_0x2c7008){return function(_0x22f715){if(!_0x22f715){_0x2c7008['sendStatus'](0x194);}return _0x22f715;};}function handleError(_0x419128,_0x205973){_0x205973=_0x205973||0x1f4;return function(_0x409fef){logger[_0x9f2d('0x1b')](_0x409fef[_0x9f2d('0x1c')]);if(_0x409fef['name']){delete _0x409fef[_0x9f2d('0x1d')];}_0x419128[_0x9f2d('0xf')](_0x205973)['send'](_0x409fef);};}exports[_0x9f2d('0x1e')]=function(_0x4be0d1,_0x109e85){var _0x1ccfb5={};var _0x510820={'count':0x0,'rows':[]};var _0x43a68f=_[_0x9f2d('0x1f')](db[_0x9f2d('0x20')][_0x9f2d('0x21')],function(_0x2d2736){return{'name':_0x2d2736['fieldName'],'type':_0x2d2736[_0x9f2d('0x22')][_0x9f2d('0x23')]};});_0x1ccfb5=qs[_0x9f2d('0x24')](_0x43a68f,_0x4be0d1);var _0x1d69bf={'where':_0x1ccfb5[_0x9f2d('0x25')]};return db[_0x9f2d('0x20')][_0x9f2d('0x14')](_0x1d69bf)[_0x9f2d('0x18')](function(_0x2d976c){_0x510820['count']=_0x2d976c;_0x1ccfb5[_0x9f2d('0x26')]=qs[_0x9f2d('0x26')](_0x4be0d1['query']);return db[_0x9f2d('0x20')]['findAll'](_0x1ccfb5);})[_0x9f2d('0x18')](function(_0x434193){_0x510820['rows']=_0x434193;return _0x510820;})[_0x9f2d('0x18')](respondWithFilteredResult(_0x109e85,_0x1ccfb5))['catch'](handleError(_0x109e85,null));};exports[_0x9f2d('0x27')]=function(_0x50da43,_0x3a3005){var _0x2323d4={'raw':!![],'where':{'id':_0x50da43[_0x9f2d('0x28')]['id']}},_0x38f17b={};_0x38f17b[_0x9f2d('0x29')]=_[_0x9f2d('0x2a')](db['ChatQueue']['rawAttributes']);_0x38f17b['query']=_[_0x9f2d('0x2a')](_0x50da43[_0x9f2d('0x2b')]);_0x38f17b[_0x9f2d('0x2c')]=_[_0x9f2d('0x2d')](_0x38f17b[_0x9f2d('0x29')],_0x38f17b[_0x9f2d('0x2b')]);_0x2323d4['attributes']=_[_0x9f2d('0x2d')](_0x38f17b[_0x9f2d('0x29')],qs['fields'](_0x50da43['query'][_0x9f2d('0x2e')]));_0x2323d4[_0x9f2d('0x2f')]=_0x2323d4[_0x9f2d('0x2f')][_0x9f2d('0x30')]?_0x2323d4[_0x9f2d('0x2f')]:_0x38f17b[_0x9f2d('0x29')];if(_0x50da43[_0x9f2d('0x2b')]['includeAll']){_0x2323d4[_0x9f2d('0x26')]=[{'all':!![]}];}_0x2323d4=_[_0x9f2d('0x31')]({},_0x2323d4,_0x50da43['options']);return db['ChatQueue'][_0x9f2d('0x32')](_0x2323d4)['then'](handleEntityNotFound(_0x3a3005,null))[_0x9f2d('0x18')](respondWithResult(_0x3a3005,null))[_0x9f2d('0x33')](handleError(_0x3a3005,null));};exports[_0x9f2d('0x34')]=function(_0x4683fd,_0x3db017){return db[_0x9f2d('0x20')][_0x9f2d('0x34')](_0x4683fd[_0x9f2d('0x35')],{})[_0x9f2d('0x18')](function(_0x2e65a8){var _0x28c1aa=_0x4683fd[_0x9f2d('0x36')]['get']({'plain':!![]});if(!_0x28c1aa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28c1aa[_0x9f2d('0x37')]===_0x9f2d('0x36')){var _0x15888d=_0x2e65a8[_0x9f2d('0x19')]({'plain':!![]});var _0x1d20c7=_0x9f2d('0x1a');return db[_0x9f2d('0x38')]['find']({'where':{'name':_0x1d20c7,'userProfileId':_0x28c1aa[_0x9f2d('0x39')]},'raw':!![]})[_0x9f2d('0x18')](function(_0x5020b6){if(_0x5020b6&&_0x5020b6[_0x9f2d('0x3a')]===0x0){return db[_0x9f2d('0x3b')][_0x9f2d('0x34')]({'name':_0x15888d['name'],'resourceId':_0x15888d['id'],'type':_0x5020b6[_0x9f2d('0x1d')],'sectionId':_0x5020b6['id']},{})[_0x9f2d('0x18')](function(){return _0x2e65a8;});}else{return _0x2e65a8;}})['catch'](function(_0x2b8e20){logger[_0x9f2d('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b8e20);throw _0x2b8e20;});}return _0x2e65a8;})[_0x9f2d('0x18')](respondWithResult(_0x3db017,0xc9))[_0x9f2d('0x33')](handleError(_0x3db017,null));};exports['update']=function(_0x17f8f4,_0x23bea5){if(_0x17f8f4[_0x9f2d('0x35')]['id']){delete _0x17f8f4[_0x9f2d('0x35')]['id'];}return db[_0x9f2d('0x20')][_0x9f2d('0x32')]({'where':{'id':_0x17f8f4[_0x9f2d('0x28')]['id']}})[_0x9f2d('0x18')](handleEntityNotFound(_0x23bea5,null))[_0x9f2d('0x18')](saveUpdates(_0x17f8f4['body'],null))[_0x9f2d('0x18')](respondWithResult(_0x23bea5,null))['catch'](handleError(_0x23bea5,null));};exports[_0x9f2d('0x3c')]=function(_0x511ac0,_0x569331){return db[_0x9f2d('0x20')]['find']({'where':{'id':_0x511ac0['params']['id']}})[_0x9f2d('0x18')](handleEntityNotFound(_0x569331,null))[_0x9f2d('0x18')](removeEntity(_0x569331,null))[_0x9f2d('0x33')](handleError(_0x569331,null));};exports['describe']=function(_0xe90b0a,_0x1e3e24){return db[_0x9f2d('0x20')]['describe']()['then'](respondWithResult(_0x1e3e24,null))[_0x9f2d('0x33')](handleError(_0x1e3e24,null));};exports[_0x9f2d('0x3d')]=function(_0xb533bd,_0x5a3c52){var _0x3a2fa9={'raw':!![],'where':{}},_0x4adbff={},_0x3eb373;return db[_0x9f2d('0x20')]['findOne']({'where':{'id':_0xb533bd[_0x9f2d('0x28')]['id']}})[_0x9f2d('0x18')](handleEntityNotFound(_0x5a3c52,null))[_0x9f2d('0x18')](function(_0x274b95){if(_0x274b95){_0x3eb373=_0x274b95[_0x9f2d('0x19')]({'plain':!![]});_0x4adbff[_0x9f2d('0x29')]=_[_0x9f2d('0x2a')](db[_0x9f2d('0x3e')][_0x9f2d('0x21')]);_0x4adbff[_0x9f2d('0x2b')]=_[_0x9f2d('0x2a')](_0xb533bd['query']);_0x4adbff[_0x9f2d('0x2c')]=_[_0x9f2d('0x2d')](_0x4adbff[_0x9f2d('0x29')],_0x4adbff[_0x9f2d('0x2b')]);_0x3a2fa9[_0x9f2d('0x2f')]=_[_0x9f2d('0x2d')](_0x4adbff[_0x9f2d('0x29')],qs[_0x9f2d('0x2e')](_0xb533bd[_0x9f2d('0x2b')][_0x9f2d('0x2e')]));_0x3a2fa9[_0x9f2d('0x2f')]=_0x3a2fa9[_0x9f2d('0x2f')][_0x9f2d('0x30')]?_0x3a2fa9[_0x9f2d('0x2f')]:_0x4adbff[_0x9f2d('0x29')];if(!_0xb533bd[_0x9f2d('0x2b')][_0x9f2d('0x3f')](_0x9f2d('0x40'))){_0x3a2fa9[_0x9f2d('0x15')]=qs[_0x9f2d('0x15')](_0xb533bd[_0x9f2d('0x2b')][_0x9f2d('0x15')]);_0x3a2fa9[_0x9f2d('0x12')]=qs['offset'](_0xb533bd[_0x9f2d('0x2b')][_0x9f2d('0x12')]);}_0x3a2fa9['order']=qs[_0x9f2d('0x41')](_0xb533bd[_0x9f2d('0x2b')][_0x9f2d('0x41')]);_0x3a2fa9[_0x9f2d('0x25')]=qs[_0x9f2d('0x2c')](_[_0x9f2d('0x42')](_0xb533bd['query'],_0x4adbff['filters']));_0x3a2fa9[_0x9f2d('0x25')][_0x9f2d('0x43')]=_0x274b95['id'];if(_0xb533bd[_0x9f2d('0x2b')][_0x9f2d('0x44')]){_0x3a2fa9[_0x9f2d('0x25')]=_[_0x9f2d('0x31')](_0x3a2fa9['where'],{'$or':_[_0x9f2d('0x1f')](_0x3a2fa9[_0x9f2d('0x2f')],function(_0x44bf3e){var _0x4687e9={};_0x4687e9[_0x44bf3e]={'$like':'%'+_0xb533bd['query'][_0x9f2d('0x44')]+'%'};return _0x4687e9;})});}_0x3a2fa9=_['merge']({},_0x3a2fa9,_0xb533bd[_0x9f2d('0x45')]);return db[_0x9f2d('0x3e')][_0x9f2d('0x46')](_0x3a2fa9);}})[_0x9f2d('0x18')](function(_0x2afa03){if(_0x2afa03){return db[_0x9f2d('0x47')][_0x9f2d('0x48')]({'where':{'id':_[_0x9f2d('0x1f')](_0x2afa03,_0x9f2d('0x49')),'role':_0x9f2d('0x4a')},'attributes':['id','name',_0x9f2d('0x4b'),_0x9f2d('0x4c'),_0x9f2d('0x4d')]});}})[_0x9f2d('0x18')](function(_0x85814d){if(_0x85814d){return{'count':_0x85814d[_0x9f2d('0x14')],'rows':_[_0x9f2d('0x1f')](_0x85814d['rows'],function(_0x4c4dc7){return{'membername':_0x4c4dc7[_0x9f2d('0x1d')],'UserId':_0x4c4dc7['id'],'queue_name':_0x3eb373['name'],'ChatQueueId':_0x3eb373['id'],'interface':util[_0x9f2d('0x4e')](_0x9f2d('0x4f'),_0x9f2d('0x50'),_0x4c4dc7[_0x9f2d('0x1d')]),'penalty':0x0,'paused':_0x4c4dc7[_0x9f2d('0x4b')],'createdAt':_0x4c4dc7[_0x9f2d('0x4d')],'updatedAt':_0x4c4dc7[_0x9f2d('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9f2d('0x18')](respondWithFilteredResult(_0x5a3c52,_0x3a2fa9))['catch'](handleError(_0x5a3c52,null));};exports['getTeams']=function(_0x4a615b,_0x36bd8a){var _0x38e3b6={};var _0x369f78={};var _0x5b9d88;var _0x57cd22;return db['ChatQueue'][_0x9f2d('0x51')]({'where':{'id':_0x4a615b[_0x9f2d('0x28')]['id']}})['then'](handleEntityNotFound(_0x36bd8a,null))[_0x9f2d('0x18')](function(_0x4ad11c){if(_0x4ad11c){_0x5b9d88=_0x4ad11c;_0x369f78[_0x9f2d('0x29')]=_[_0x9f2d('0x2a')](db[_0x9f2d('0x52')]['rawAttributes']);_0x369f78['query']=_[_0x9f2d('0x2a')](_0x4a615b[_0x9f2d('0x2b')]);_0x369f78[_0x9f2d('0x2c')]=_[_0x9f2d('0x2d')](_0x369f78[_0x9f2d('0x29')],_0x369f78['query']);_0x38e3b6[_0x9f2d('0x2f')]=_[_0x9f2d('0x2d')](_0x369f78[_0x9f2d('0x29')],qs[_0x9f2d('0x2e')](_0x4a615b[_0x9f2d('0x2b')][_0x9f2d('0x2e')]));_0x38e3b6['attributes']=_0x38e3b6['attributes']['length']?_0x38e3b6[_0x9f2d('0x2f')]:_0x369f78['model'];_0x38e3b6['order']=qs[_0x9f2d('0x41')](_0x4a615b[_0x9f2d('0x2b')][_0x9f2d('0x41')]);_0x38e3b6[_0x9f2d('0x25')]=qs[_0x9f2d('0x2c')](_[_0x9f2d('0x42')](_0x4a615b['query'],_0x369f78[_0x9f2d('0x2c')]));if(_0x4a615b[_0x9f2d('0x2b')][_0x9f2d('0x44')]){_0x38e3b6[_0x9f2d('0x25')]=_[_0x9f2d('0x31')](_0x38e3b6[_0x9f2d('0x25')],{'$or':_['map'](_0x38e3b6[_0x9f2d('0x2f')],function(_0x26ceca){var _0x2e8e22={};_0x2e8e22[_0x26ceca]={'$like':'%'+_0x4a615b[_0x9f2d('0x2b')][_0x9f2d('0x44')]+'%'};return _0x2e8e22;})});}_0x38e3b6=_[_0x9f2d('0x31')]({},_0x38e3b6,_0x4a615b[_0x9f2d('0x45')]);return _0x5b9d88['getTeams'](_0x38e3b6);}})[_0x9f2d('0x18')](function(_0x3cae0e){if(_0x3cae0e){_0x57cd22=_0x3cae0e[_0x9f2d('0x30')];if(!_0x4a615b[_0x9f2d('0x2b')][_0x9f2d('0x3f')](_0x9f2d('0x40'))){_0x38e3b6['limit']=qs[_0x9f2d('0x15')](_0x4a615b[_0x9f2d('0x2b')][_0x9f2d('0x15')]);_0x38e3b6[_0x9f2d('0x12')]=qs[_0x9f2d('0x12')](_0x4a615b['query'][_0x9f2d('0x12')]);}return _0x5b9d88['getTeams'](_0x38e3b6);}})[_0x9f2d('0x18')](function(_0x3b39fa){if(_0x3b39fa){return _0x3b39fa?{'count':_0x57cd22,'rows':_0x3b39fa}:null;}})[_0x9f2d('0x18')](respondWithResult(_0x36bd8a,null))['catch'](handleError(_0x36bd8a,null));};exports[_0x9f2d('0x53')]=function(_0x1a99e2,_0x3f8195){var _0x274672=_0x1a99e2[_0x9f2d('0x35')][_0x9f2d('0x54')];return db[_0x9f2d('0x52')]['findAll']({'where':{'id':_0x274672},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9f2d('0x55'),'attributes':['id',_0x9f2d('0x1d'),_0x9f2d('0x56'),_0x9f2d('0x57'),'interface'],'raw':!![]}]})[_0x9f2d('0x18')](function(_0x328c98){if(_0x328c98){var _0x135930=_[_0x9f2d('0x58')](_0x328c98,function(_0x51de04){var _0x1fd719=_0x51de04[_0x9f2d('0x19')]({'plain':!![]});return _0x1fd719[_0x9f2d('0x55')];});return db[_0x9f2d('0x20')]['find']({'where':{'id':_0x1a99e2[_0x9f2d('0x28')]['id']}})[_0x9f2d('0x18')](function(_0x43c8d2){return db[_0x9f2d('0x59')][_0x9f2d('0x5a')](function(_0x38c3c3){return _0x43c8d2[_0x9f2d('0x53')](_0x274672,{'transaction':_0x38c3c3})[_0x9f2d('0x18')](function(){return BPromise[_0x9f2d('0x5b')](_0x135930,function(_0x30d0b1){return db[_0x9f2d('0x3e')]['findOrCreate']({'where':{'UserId':_0x30d0b1['id'],'ChatQueueId':_0x1a99e2[_0x9f2d('0x28')]['id']},'transaction':_0x38c3c3});});})[_0x9f2d('0x18')](function(){_0x135930[_0x9f2d('0x5c')](function(_0x117a52){socket[_0x9f2d('0x5d')](_0x9f2d('0x5e'),{'UserId':_0x117a52['id'],'ChatQueueId':_0x43c8d2['id']});});});});});}})['then'](respondWithStatusCode(_0x3f8195,null))[_0x9f2d('0x33')](handleError(_0x3f8195,null));};exports[_0x9f2d('0x5f')]=function(_0x587ee9,_0x3e654e){return db[_0x9f2d('0x52')][_0x9f2d('0x46')]({'where':{'id':_0x587ee9[_0x9f2d('0x2b')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9f2d('0x55'),'attributes':['id'],'raw':!![]}]})[_0x9f2d('0x18')](handleEntityNotFound(_0x3e654e,null))[_0x9f2d('0x18')](function(_0x1df143){var _0x1de1d5=_['map'](_0x1df143,'id');var _0x50449a=[];var _0x333870=[];var _0x325a38=squel[_0x9f2d('0x60')]();_0x325a38[_0x9f2d('0x61')](_0x9f2d('0x62'))['from'](_0x9f2d('0x63'),'tq')[_0x9f2d('0x64')](_0x9f2d('0x65'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x9f2d('0x66'),_0x587ee9['params']['id']);for(var _0xf7427a=0x0;_0xf7427a<_0x1df143[_0x9f2d('0x30')];_0xf7427a+=0x1){let _0x2ec18f=_0x1df143[_0xf7427a];for(var _0x2b6450=0x0;_0x2b6450<_0x2ec18f[_0x9f2d('0x55')][_0x9f2d('0x30')];_0x2b6450+=0x1){let _0x4f7875=_0x2ec18f[_0x9f2d('0x55')][_0x2b6450];var _0x552b3e=_0x325a38['clone']();_0x552b3e[_0x9f2d('0x25')](_0x9f2d('0x67'),_0x4f7875['id']);_0x333870['push'](db[_0x9f2d('0x59')][_0x9f2d('0x2b')](_0x552b3e[_0x9f2d('0x68')](),{'type':db['sequelize'][_0x9f2d('0x69')][_0x9f2d('0x6a')]})[_0x9f2d('0x18')](function(_0x52d9f1){if(_0x52d9f1[_0x9f2d('0x30')]===0x1){return _0x4f7875['id'];}else{var _0x10e333=_[_0x9f2d('0x6b')](_['map'](_0x52d9f1,_0x9f2d('0x6c')),function(_0xa2564f){return _['includes'](_0x1de1d5,_0xa2564f);});if(_0x10e333){return _0x4f7875['id'];}}}));}}return BPromise[_0x9f2d('0x6d')](_0x333870)[_0x9f2d('0x18')](function(_0x57cf5b){_0x50449a=_(_0x50449a)['union'](_0x57cf5b)[_0x9f2d('0x6e')]()['value']();return db[_0x9f2d('0x20')]['find']({'where':{'id':_0x587ee9[_0x9f2d('0x28')]['id']}})[_0x9f2d('0x18')](function(_0x425629){return db[_0x9f2d('0x59')][_0x9f2d('0x5a')](function(_0x1ef5e2){return _0x425629[_0x9f2d('0x5f')](_0x587ee9[_0x9f2d('0x2b')][_0x9f2d('0x54')],{'transaction':_0x1ef5e2})['then'](function(){if(!_['isEmpty'](_0x50449a)){return _0x425629[_0x9f2d('0x6f')](_0x50449a,{'transaction':_0x1ef5e2});}})[_0x9f2d('0x18')](function(){_0x50449a[_0x9f2d('0x5c')](function(_0x4f6aa5){socket[_0x9f2d('0x5d')](_0x9f2d('0x70'),{'UserId':_0x4f6aa5,'ChatQueueId':_0x425629['id']});});});});});});})['then'](respondWithStatusCode(_0x3e654e,null))[_0x9f2d('0x33')](handleError(_0x3e654e,null));};exports[_0x9f2d('0x71')]=function(_0x1116a7,_0x56a060){return db['ChatQueue'][_0x9f2d('0x32')]({'where':{'id':_0x1116a7[_0x9f2d('0x28')]['id']}})['then'](handleEntityNotFound(_0x56a060,null))[_0x9f2d('0x18')](function(_0x548926){if(_0x548926){return _0x548926[_0x9f2d('0x71')](_0x1116a7[_0x9f2d('0x35')][_0x9f2d('0x54')],_[_0x9f2d('0x72')](_0x1116a7[_0x9f2d('0x35')],[_0x9f2d('0x54'),'id'])||{})[_0x9f2d('0x73')](function(_0x250e60){for(var _0x2094bc=0x0;_0x2094bc<_0x1116a7[_0x9f2d('0x35')][_0x9f2d('0x54')][_0x9f2d('0x30')];_0x2094bc+=0x1){socket[_0x9f2d('0x5d')](_0x9f2d('0x5e'),{'UserId':Number(_0x1116a7[_0x9f2d('0x35')][_0x9f2d('0x54')][_0x2094bc]),'ChatQueueId':Number(_0x1116a7[_0x9f2d('0x28')]['id'])});}return _0x250e60;});}})[_0x9f2d('0x18')](respondWithResult(_0x56a060,null))[_0x9f2d('0x33')](handleError(_0x56a060,null));};exports[_0x9f2d('0x6f')]=function(_0x23a16b,_0xe53192){return db[_0x9f2d('0x20')]['find']({'where':{'id':_0x23a16b['params']['id']}})[_0x9f2d('0x18')](handleEntityNotFound(_0xe53192,null))[_0x9f2d('0x18')](function(_0x387f04){if(_0x387f04){return _0x387f04[_0x9f2d('0x6f')](_0x23a16b[_0x9f2d('0x2b')][_0x9f2d('0x54')])['then'](function(){if(_[_0x9f2d('0x74')](_0x23a16b['query'][_0x9f2d('0x54')])){for(var _0x2ae343=0x0;_0x2ae343<_0x23a16b[_0x9f2d('0x2b')]['ids']['length'];_0x2ae343+=0x1){socket['emit'](_0x9f2d('0x70'),{'UserId':Number(_0x23a16b[_0x9f2d('0x2b')][_0x9f2d('0x54')][_0x2ae343]),'ChatQueueId':Number(_0x23a16b['params']['id'])});}}else{socket[_0x9f2d('0x5d')](_0x9f2d('0x70'),{'UserId':Number(_0x23a16b[_0x9f2d('0x2b')]['ids']),'ChatQueueId':Number(_0x23a16b[_0x9f2d('0x28')]['id'])});}});}})[_0x9f2d('0x18')](respondWithStatusCode(_0xe53192,null))[_0x9f2d('0x33')](handleError(_0xe53192,null));};exports[_0x9f2d('0x75')]=function(_0x23df95,_0x20daa9){var _0x3e9498={};var _0x36a326={};var _0x352982;var _0x36f63a;return db[_0x9f2d('0x20')][_0x9f2d('0x51')]({'where':{'id':_0x23df95[_0x9f2d('0x28')]['id']}})[_0x9f2d('0x18')](handleEntityNotFound(_0x20daa9,null))[_0x9f2d('0x18')](function(_0x4a366d){if(_0x4a366d){_0x352982=_0x4a366d;_0x36a326[_0x9f2d('0x29')]=_[_0x9f2d('0x2a')](db['User'][_0x9f2d('0x21')]);_0x36a326['query']=_['keys'](_0x23df95[_0x9f2d('0x2b')]);_0x36a326[_0x9f2d('0x2c')]=_[_0x9f2d('0x2d')](_0x36a326[_0x9f2d('0x29')],_0x36a326['query']);_0x3e9498[_0x9f2d('0x2f')]=_[_0x9f2d('0x2d')](_0x36a326['model'],qs['fields'](_0x23df95[_0x9f2d('0x2b')][_0x9f2d('0x2e')]));_0x3e9498[_0x9f2d('0x2f')]=_0x3e9498[_0x9f2d('0x2f')]['length']?_0x3e9498[_0x9f2d('0x2f')]:_0x36a326[_0x9f2d('0x29')];_0x3e9498[_0x9f2d('0x76')]=qs[_0x9f2d('0x41')](_0x23df95[_0x9f2d('0x2b')][_0x9f2d('0x41')]);_0x3e9498[_0x9f2d('0x25')]=qs[_0x9f2d('0x2c')](_[_0x9f2d('0x42')](_0x23df95[_0x9f2d('0x2b')],_0x36a326[_0x9f2d('0x2c')]));if(_0x23df95[_0x9f2d('0x2b')][_0x9f2d('0x44')]){_0x3e9498[_0x9f2d('0x25')]=_[_0x9f2d('0x31')](_0x3e9498[_0x9f2d('0x25')],{'$or':_[_0x9f2d('0x1f')](_0x3e9498[_0x9f2d('0x2f')],function(_0x35f2e8){var _0x55a17c={};_0x55a17c[_0x35f2e8]={'$like':'%'+_0x23df95[_0x9f2d('0x2b')][_0x9f2d('0x44')]+'%'};return _0x55a17c;})});}_0x3e9498=_[_0x9f2d('0x31')]({},_0x3e9498,_0x23df95['options']);return _0x352982[_0x9f2d('0x75')](_0x3e9498);}})['then'](function(_0x667607){if(_0x667607){_0x36f63a=_0x667607[_0x9f2d('0x30')];if(!_0x23df95[_0x9f2d('0x2b')]['hasOwnProperty']('nolimit')){_0x3e9498[_0x9f2d('0x15')]=qs[_0x9f2d('0x15')](_0x23df95[_0x9f2d('0x2b')][_0x9f2d('0x15')]);_0x3e9498[_0x9f2d('0x12')]=qs[_0x9f2d('0x12')](_0x23df95[_0x9f2d('0x2b')][_0x9f2d('0x12')]);}return _0x352982[_0x9f2d('0x75')](_0x3e9498);}})[_0x9f2d('0x18')](function(_0xc3e31a){if(_0xc3e31a){return _0xc3e31a?{'count':_0x36f63a,'rows':_0xc3e31a}:null;}})[_0x9f2d('0x18')](respondWithResult(_0x20daa9,null))[_0x9f2d('0x33')](handleError(_0x20daa9,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 6c9c2bd..acf059c 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 _0x9959=['hasOwnProperty','hook','events','ChatQueue','save','remove','emit'];(function(_0x49d744,_0x56323a){var _0xeef931=function(_0x30c8bc){while(--_0x30c8bc){_0x49d744['push'](_0x49d744['shift']());}};_0xeef931(++_0x56323a);}(_0x9959,0x1c2));var _0x9995=function(_0x423aa2,_0x2f3be3){_0x423aa2=_0x423aa2-0x0;var _0x4953fa=_0x9959[_0x423aa2];return _0x4953fa;};'use strict';var EventEmitter=require(_0x9995('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x9995('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9995('0x2'),'afterUpdate':'update','afterDestroy':_0x9995('0x3')};function emitEvent(_0x34fadd){return function(_0x4aeb64,_0x20e0f7,_0x486730){ChatQueueEvents[_0x9995('0x4')](_0x34fadd+':'+_0x4aeb64['id'],_0x4aeb64);ChatQueueEvents[_0x9995('0x4')](_0x34fadd,_0x4aeb64);_0x486730(null);};}for(var e in events){if(events[_0x9995('0x5')](e)){var event=events[e];ChatQueue[_0x9995('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x279d=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','remove'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0x279d,0x1d8));var _0xd279=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x279d[_0x369151];return _0x4292d5;};'use strict';var EventEmitter=require(_0xd279('0x0'));var ChatQueue=require(_0xd279('0x1'))['db'][_0xd279('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd279('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd279('0x4')};function emitEvent(_0x44441d){return function(_0x47cfee,_0x15d034,_0x2a9e8c){ChatQueueEvents[_0xd279('0x5')](_0x44441d+':'+_0x47cfee['id'],_0x47cfee);ChatQueueEvents[_0xd279('0x5')](_0x44441d,_0x47cfee);_0x2a9e8c(null);};}for(var e in events){if(events[_0xd279('0x6')](e)){var event=events[e];ChatQueue[_0xd279('0x7')](e,emitEvent(event));}}module[_0xd279('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index ff9362a..47951f4 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 _0x3a21=['path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x24c7f7,_0x2bb77a){var _0x25604f=function(_0x418d16){while(--_0x418d16){_0x24c7f7['push'](_0x24c7f7['shift']());}};_0x25604f(++_0x2bb77a);}(_0x3a21,0x112));var _0x13a2=function(_0x2dd514,_0x4dc961){_0x2dd514=_0x2dd514-0x0;var _0x185a5f=_0x3a21[_0x2dd514];return _0x185a5f;};'use strict';var _=require(_0x13a2('0x0'));var util=require('util');var logger=require(_0x13a2('0x1'))(_0x13a2('0x2'));var moment=require(_0x13a2('0x3'));var BPromise=require(_0x13a2('0x4'));var rp=require(_0x13a2('0x5'));var fs=require('fs');var path=require(_0x13a2('0x6'));var rimraf=require(_0x13a2('0x7'));var config=require(_0x13a2('0x8'));var attributes=require(_0x13a2('0x9'));module[_0x13a2('0xa')]=function(_0x4a5d9a,_0x2d4def){return _0x4a5d9a[_0x13a2('0xb')](_0x13a2('0xc'),attributes,{'tableName':_0x13a2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa787=['./chatQueue.attributes','exports','define','ChatQueue','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x167dc,_0x2e5bf3){var _0x30bbbb=function(_0x3384a5){while(--_0x3384a5){_0x167dc['push'](_0x167dc['shift']());}};_0x30bbbb(++_0x2e5bf3);}(_0xa787,0x19b));var _0x7a78=function(_0x3326f3,_0x27919d){_0x3326f3=_0x3326f3-0x0;var _0x3fc066=_0xa787[_0x3326f3];return _0x3fc066;};'use strict';var _=require('lodash');var util=require(_0x7a78('0x0'));var logger=require(_0x7a78('0x1'))('api');var moment=require(_0x7a78('0x2'));var BPromise=require(_0x7a78('0x3'));var rp=require(_0x7a78('0x4'));var fs=require('fs');var path=require(_0x7a78('0x5'));var rimraf=require(_0x7a78('0x6'));var config=require('../../config/environment');var attributes=require(_0x7a78('0x7'));module[_0x7a78('0x8')]=function(_0x3ac7c5,_0x10d563){return _0x3ac7c5[_0x7a78('0x9')](_0x7a78('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 23b07c5..7da80fa 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 _0xc1bd=['options','raw','where','limit','map','include','model','attributes','ShowChatQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetChatQueue','ChatQueue','findAll'];(function(_0x3e3f62,_0x2d53bb){var _0x1debd7=function(_0x5cc1d8){while(--_0x5cc1d8){_0x3e3f62['push'](_0x3e3f62['shift']());}};_0x1debd7(++_0x2d53bb);}(_0xc1bd,0xd2));var _0xdc1b=function(_0x24f387,_0x13d380){_0x24f387=_0x24f387-0x0;var _0x160b4c=_0xc1bd[_0x24f387];return _0x160b4c;};'use strict';var _=require('lodash');var util=require(_0xdc1b('0x0'));var moment=require(_0xdc1b('0x1'));var BPromise=require(_0xdc1b('0x2'));var rs=require(_0xdc1b('0x3'));var fs=require('fs');var Redis=require(_0xdc1b('0x4'));var db=require(_0xdc1b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc1b('0x6'))(_0xdc1b('0x7'));var config=require('../../config/environment');var jayson=require(_0xdc1b('0x8'));var client=jayson[_0xdc1b('0x9')][_0xdc1b('0xa')]({'port':0x232a});config['redis']=_[_0xdc1b('0xb')](config[_0xdc1b('0xc')],{'host':_0xdc1b('0xd'),'port':0x18eb});var socket=require(_0xdc1b('0xe'))(new Redis(config[_0xdc1b('0xc')]));require('./chatQueue.socket')[_0xdc1b('0xf')](socket);function respondWithRpcPromise(_0x371699,_0xfdd9e9,_0x3ff980){return new BPromise(function(_0x52d17c,_0x112d8b){return client['request'](_0x371699,_0x3ff980)[_0xdc1b('0x10')](function(_0x3ab1c2){logger[_0xdc1b('0x11')](_0xdc1b('0x12'),_0xfdd9e9,'request\x20sent');logger[_0xdc1b('0x13')](_0xdc1b('0x14'),_0xfdd9e9,_0xdc1b('0x15'),JSON[_0xdc1b('0x16')](_0x3ab1c2));if(_0x3ab1c2[_0xdc1b('0x17')]){if(_0x3ab1c2[_0xdc1b('0x17')]['code']===0x1f4){logger[_0xdc1b('0x17')](_0xdc1b('0x12'),_0xfdd9e9,_0x3ab1c2['error']['message']);return _0x112d8b(_0x3ab1c2[_0xdc1b('0x17')][_0xdc1b('0x18')]);}logger['error'](_0xdc1b('0x12'),_0xfdd9e9,_0x3ab1c2[_0xdc1b('0x17')][_0xdc1b('0x18')]);return _0x52d17c(_0x3ab1c2[_0xdc1b('0x17')][_0xdc1b('0x18')]);}else{logger[_0xdc1b('0x11')]('ChatQueue,\x20%s,\x20%s',_0xfdd9e9,_0xdc1b('0x15'));_0x52d17c(_0x3ab1c2[_0xdc1b('0x19')][_0xdc1b('0x18')]);}})[_0xdc1b('0x1a')](function(_0x54598c){logger[_0xdc1b('0x17')](_0xdc1b('0x12'),_0xfdd9e9,_0x54598c);_0x112d8b(_0x54598c);});});}exports[_0xdc1b('0x1b')]=function(_0x5a6c91){var _0x4d8d41=this;return new Promise(function(_0x5ad463,_0x4d71e2){return db[_0xdc1b('0x1c')][_0xdc1b('0x1d')]({'raw':_0x5a6c91[_0xdc1b('0x1e')]?_0x5a6c91['options'][_0xdc1b('0x1f')]===undefined?!![]:![]:!![],'where':_0x5a6c91[_0xdc1b('0x1e')]?_0x5a6c91['options'][_0xdc1b('0x20')]||null:null,'attributes':_0x5a6c91['options']?_0x5a6c91['options']['attributes']||null:null,'limit':_0x5a6c91[_0xdc1b('0x1e')]?_0x5a6c91[_0xdc1b('0x1e')][_0xdc1b('0x21')]||null:null,'include':_0x5a6c91[_0xdc1b('0x1e')]?_0x5a6c91[_0xdc1b('0x1e')]['include']?_[_0xdc1b('0x22')](_0x5a6c91[_0xdc1b('0x1e')][_0xdc1b('0x23')],function(_0x36ab40){return{'model':db[_0x36ab40[_0xdc1b('0x24')]],'as':_0x36ab40['as'],'attributes':_0x36ab40[_0xdc1b('0x25')],'include':_0x36ab40[_0xdc1b('0x23')]?_[_0xdc1b('0x22')](_0x36ab40['include'],function(_0x48728d){return{'model':db[_0x48728d[_0xdc1b('0x24')]],'as':_0x48728d['as'],'attributes':_0x48728d[_0xdc1b('0x25')],'include':_0x48728d[_0xdc1b('0x23')]?_[_0xdc1b('0x22')](_0x48728d[_0xdc1b('0x23')],function(_0x3163c2){return{'model':db[_0x3163c2[_0xdc1b('0x24')]],'as':_0x3163c2['as'],'attributes':_0x3163c2[_0xdc1b('0x25')]};}):[]};}):[]};}):[]:[]})[_0xdc1b('0x10')](function(_0x2e976f){logger[_0xdc1b('0x11')](_0xdc1b('0x1b'),_0x5a6c91);logger[_0xdc1b('0x13')](_0xdc1b('0x1b'),_0x5a6c91,JSON[_0xdc1b('0x16')](_0x2e976f));_0x5ad463(_0x2e976f);})[_0xdc1b('0x1a')](function(_0x4532d6){logger[_0xdc1b('0x17')]('GetChatQueue',_0x4532d6[_0xdc1b('0x18')],_0x5a6c91);_0x4d71e2(_0x4d8d41[_0xdc1b('0x17')](0x1f4,_0x4532d6[_0xdc1b('0x18')]));});});};exports[_0xdc1b('0x26')]=function(_0x21a498){var _0x22290f=this;return new Promise(function(_0x2efc3d,_0x2f6bb3){return db[_0xdc1b('0x1c')][_0xdc1b('0x27')]({'raw':_0x21a498[_0xdc1b('0x1e')]?_0x21a498[_0xdc1b('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x21a498[_0xdc1b('0x1e')]?_0x21a498[_0xdc1b('0x1e')]['where']||null:null,'attributes':_0x21a498[_0xdc1b('0x1e')]?_0x21a498[_0xdc1b('0x1e')][_0xdc1b('0x25')]||null:null,'include':_0x21a498[_0xdc1b('0x1e')]?_0x21a498['options']['include']?_[_0xdc1b('0x22')](_0x21a498[_0xdc1b('0x1e')][_0xdc1b('0x23')],function(_0x1a71af){return{'model':db[_0x1a71af['model']],'as':_0x1a71af['as'],'attributes':_0x1a71af[_0xdc1b('0x25')],'include':_0x1a71af[_0xdc1b('0x23')]?_[_0xdc1b('0x22')](_0x1a71af['include'],function(_0x10692d){return{'model':db[_0x10692d[_0xdc1b('0x24')]],'as':_0x10692d['as'],'attributes':_0x10692d[_0xdc1b('0x25')],'include':_0x10692d[_0xdc1b('0x23')]?_['map'](_0x10692d[_0xdc1b('0x23')],function(_0xe4ea08){return{'model':db[_0xe4ea08['model']],'as':_0xe4ea08['as'],'attributes':_0xe4ea08['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x575dd6){logger[_0xdc1b('0x11')]('ShowChatQueue',_0x21a498);logger[_0xdc1b('0x13')]('ShowChatQueue',_0x21a498,JSON[_0xdc1b('0x16')](_0x575dd6));_0x2efc3d(_0x575dd6);})['catch'](function(_0x29be93){logger[_0xdc1b('0x17')]('ShowChatQueue',_0x29be93[_0xdc1b('0x18')],_0x21a498);_0x2f6bb3(_0x22290f[_0xdc1b('0x17')](0x1f4,_0x29be93[_0xdc1b('0x18')]));});});};
\ No newline at end of file
+var _0x0d74=['jayson/promise','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetChatQueue','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','ChatQueue','find','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x57f8af,_0x3a881a){var _0x1ef58a=function(_0x14c7b4){while(--_0x14c7b4){_0x57f8af['push'](_0x57f8af['shift']());}};_0x1ef58a(++_0x3a881a);}(_0x0d74,0x146));var _0x40d7=function(_0x119709,_0x43cc9d){_0x119709=_0x119709-0x0;var _0x24ef6a=_0x0d74[_0x119709];return _0x24ef6a;};'use strict';var _=require(_0x40d7('0x0'));var util=require(_0x40d7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x40d7('0x2'));var fs=require('fs');var Redis=require(_0x40d7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x40d7('0x4'))(_0x40d7('0x5'));var config=require(_0x40d7('0x6'));var jayson=require(_0x40d7('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x40d7('0x8')](config['redis'],{'host':_0x40d7('0x9'),'port':0x18eb});var socket=require(_0x40d7('0xa'))(new Redis(config['redis']));require(_0x40d7('0xb'))[_0x40d7('0xc')](socket);function respondWithRpcPromise(_0x354f80,_0x2bae78,_0xcb37e3){return new BPromise(function(_0x517d88,_0x5208be){return client[_0x40d7('0xd')](_0x354f80,_0xcb37e3)[_0x40d7('0xe')](function(_0x229937){logger[_0x40d7('0xf')](_0x40d7('0x10'),_0x2bae78,'request\x20sent');logger[_0x40d7('0x11')](_0x40d7('0x12'),_0x2bae78,_0x40d7('0x13'),JSON[_0x40d7('0x14')](_0x229937));if(_0x229937['error']){if(_0x229937[_0x40d7('0x15')][_0x40d7('0x16')]===0x1f4){logger[_0x40d7('0x15')](_0x40d7('0x10'),_0x2bae78,_0x229937[_0x40d7('0x15')][_0x40d7('0x17')]);return _0x5208be(_0x229937[_0x40d7('0x15')][_0x40d7('0x17')]);}logger[_0x40d7('0x15')]('ChatQueue,\x20%s,\x20%s',_0x2bae78,_0x229937['error']['message']);return _0x517d88(_0x229937[_0x40d7('0x15')][_0x40d7('0x17')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2bae78,_0x40d7('0x13'));_0x517d88(_0x229937['result']['message']);}})[_0x40d7('0x18')](function(_0x22de5a){logger[_0x40d7('0x15')](_0x40d7('0x10'),_0x2bae78,_0x22de5a);_0x5208be(_0x22de5a);});});}exports[_0x40d7('0x19')]=function(_0x28bbc0){var _0x3d2afa=this;return new Promise(function(_0x3ec437,_0x5eb3c1){return db['ChatQueue']['findAll']({'raw':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0['options'][_0x40d7('0x1b')]===undefined?!![]:![]:!![],'where':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1c')]||null:null,'attributes':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1d')]||null:null,'limit':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1e')]||null:null,'include':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0['options'][_0x40d7('0x1f')]?_[_0x40d7('0x20')](_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1f')],function(_0x528ab5){return{'model':db[_0x528ab5['model']],'as':_0x528ab5['as'],'attributes':_0x528ab5[_0x40d7('0x1d')],'include':_0x528ab5['include']?_['map'](_0x528ab5[_0x40d7('0x1f')],function(_0x1ef074){return{'model':db[_0x1ef074[_0x40d7('0x21')]],'as':_0x1ef074['as'],'attributes':_0x1ef074[_0x40d7('0x1d')],'include':_0x1ef074['include']?_['map'](_0x1ef074[_0x40d7('0x1f')],function(_0x2b5f11){return{'model':db[_0x2b5f11[_0x40d7('0x21')]],'as':_0x2b5f11['as'],'attributes':_0x2b5f11['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1102d3){logger[_0x40d7('0xf')]('GetChatQueue',_0x28bbc0);logger[_0x40d7('0x11')](_0x40d7('0x19'),_0x28bbc0,JSON[_0x40d7('0x14')](_0x1102d3));_0x3ec437(_0x1102d3);})[_0x40d7('0x18')](function(_0x555a3b){logger['error'](_0x40d7('0x19'),_0x555a3b[_0x40d7('0x17')],_0x28bbc0);_0x5eb3c1(_0x3d2afa[_0x40d7('0x15')](0x1f4,_0x555a3b[_0x40d7('0x17')]));});});};exports[_0x40d7('0x22')]=function(_0x4a2bc2){var _0x23e560=this;return new Promise(function(_0x5af456,_0x22edd1){return db[_0x40d7('0x23')][_0x40d7('0x24')]({'raw':_0x4a2bc2['options']?_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1b')]===undefined?!![]:![]:!![],'where':_0x4a2bc2[_0x40d7('0x1a')]?_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1c')]||null:null,'attributes':_0x4a2bc2[_0x40d7('0x1a')]?_0x4a2bc2[_0x40d7('0x1a')]['attributes']||null:null,'include':_0x4a2bc2[_0x40d7('0x1a')]?_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1f')]?_[_0x40d7('0x20')](_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1f')],function(_0x1e6f08){return{'model':db[_0x1e6f08[_0x40d7('0x21')]],'as':_0x1e6f08['as'],'attributes':_0x1e6f08['attributes'],'include':_0x1e6f08['include']?_[_0x40d7('0x20')](_0x1e6f08[_0x40d7('0x1f')],function(_0x4902a1){return{'model':db[_0x4902a1['model']],'as':_0x4902a1['as'],'attributes':_0x4902a1['attributes'],'include':_0x4902a1[_0x40d7('0x1f')]?_['map'](_0x4902a1[_0x40d7('0x1f')],function(_0x56b17c){return{'model':db[_0x56b17c[_0x40d7('0x21')]],'as':_0x56b17c['as'],'attributes':_0x56b17c[_0x40d7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x40d7('0xe')](function(_0x2e4ccb){logger[_0x40d7('0xf')]('ShowChatQueue',_0x4a2bc2);logger[_0x40d7('0x11')](_0x40d7('0x22'),_0x4a2bc2,JSON[_0x40d7('0x14')](_0x2e4ccb));_0x5af456(_0x2e4ccb);})[_0x40d7('0x18')](function(_0x21a675){logger['error']('ShowChatQueue',_0x21a675['message'],_0x4a2bc2);_0x22edd1(_0x23e560[_0x40d7('0x15')](0x1f4,_0x21a675['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index a6b0729..122f429 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 _0x7a2c=['chatQueue:','./chatQueue.events','remove','update','emit','register'];(function(_0x1c1e8c,_0x51a59b){var _0x23a5df=function(_0x25bb87){while(--_0x25bb87){_0x1c1e8c['push'](_0x1c1e8c['shift']());}};_0x23a5df(++_0x51a59b);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x12ddfb,_0x5e7808){_0x12ddfb=_0x12ddfb-0x0;var _0x712d01=_0x7a2c[_0x12ddfb];return _0x712d01;};'use strict';var ChatQueueEvents=require(_0xc7a2('0x0'));var events=['save',_0xc7a2('0x1'),_0xc7a2('0x2')];function createListener(_0x409ec5,_0x26fb61){return function(_0x44d702){_0x26fb61[_0xc7a2('0x3')](_0x409ec5,_0x44d702);};}function removeListener(_0x3f2b0d,_0x34cd60){return function(){ChatQueueEvents['removeListener'](_0x3f2b0d,_0x34cd60);};}exports[_0xc7a2('0x4')]=function(_0x1ddbae){for(var _0x5f334e=0x0,_0x481430=events['length'];_0x5f334e<_0x481430;_0x5f334e++){var _0x1dd150=events[_0x5f334e];var _0x3de428=createListener(_0xc7a2('0x5')+_0x1dd150,_0x1ddbae);ChatQueueEvents['on'](_0x1dd150,_0x3de428);}};
\ No newline at end of file
+var _0xcb99=['chatQueue:','./chatQueue.events','remove','emit','removeListener','length'];(function(_0x747115,_0x570320){var _0x1d8acf=function(_0x5f3087){while(--_0x5f3087){_0x747115['push'](_0x747115['shift']());}};_0x1d8acf(++_0x570320);}(_0xcb99,0x8b));var _0x9cb9=function(_0x1440d9,_0x4a2c7e){_0x1440d9=_0x1440d9-0x0;var _0x4a0cfb=_0xcb99[_0x1440d9];return _0x4a0cfb;};'use strict';var ChatQueueEvents=require(_0x9cb9('0x0'));var events=['save',_0x9cb9('0x1'),'update'];function createListener(_0x480364,_0x3a2f21){return function(_0x1308a8){_0x3a2f21[_0x9cb9('0x2')](_0x480364,_0x1308a8);};}function removeListener(_0x51f2ee,_0x167735){return function(){ChatQueueEvents[_0x9cb9('0x3')](_0x51f2ee,_0x167735);};}exports['register']=function(_0x214b72){for(var _0x509cfc=0x0,_0x2ed26a=events[_0x9cb9('0x4')];_0x509cfc<_0x2ed26a;_0x509cfc++){var _0x1bf9b7=events[_0x509cfc];var _0x1dd62f=createListener(_0x9cb9('0x5')+_0x1bf9b7,_0x214b72);ChatQueueEvents['on'](_0x1bf9b7,_0x1dd62f);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 7c09fe2..f86c2ce 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 _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x52d8b9,_0xe54454){var _0x126b5b=function(_0x43d8c8){while(--_0x43d8c8){_0x52d8b9['push'](_0x52d8b9['shift']());}};_0x126b5b(++_0xe54454);}(_0x814b,0x1a2));var _0xb814=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x814b[_0x50aa2e];return _0x5e07f0;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x4af72f,_0xd67b2e){var _0x5a25e4=function(_0x3f7724){while(--_0x3f7724){_0x4af72f['push'](_0x4af72f['shift']());}};_0x5a25e4(++_0xd67b2e);}(_0x55ca,0x126));var _0xa55c=function(_0x57a9e5,_0x5009df){_0x57a9e5=_0x57a9e5-0x0;var _0x36d39e=_0x55ca[_0x57a9e5];return _0x36d39e;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index a4d6e8d..2971427 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 _0x5612=['moment','sequelize','exports','STRING','DATE'];(function(_0x53e82b,_0x1c3157){var _0x482bec=function(_0x2ded11){while(--_0x2ded11){_0x53e82b['push'](_0x53e82b['shift']());}};_0x482bec(++_0x1c3157);}(_0x5612,0x19a));var _0x2561=function(_0x976d1a,_0x1d45b3){_0x976d1a=_0x976d1a-0x0;var _0x4dc6b2=_0x5612[_0x976d1a];return _0x4dc6b2;};'use strict';var moment=require(_0x2561('0x0'));var Sequelize=require(_0x2561('0x1'));module[_0x2561('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x2561('0x3')]},'joinAt':{'type':Sequelize[_0x2561('0x4')]},'leaveAt':{'type':Sequelize[_0x2561('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2561('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5a47=['moment','exports','STRING','DATE'];(function(_0x15961d,_0x13827d){var _0x2519ab=function(_0x24dd53){while(--_0x24dd53){_0x15961d['push'](_0x15961d['shift']());}};_0x2519ab(++_0x13827d);}(_0x5a47,0x12c));var _0x75a4=function(_0x12de66,_0x357deb){_0x12de66=_0x12de66-0x0;var _0x2465d7=_0x5a47[_0x12de66];return _0x2465d7;};'use strict';var moment=require(_0x75a4('0x0'));var Sequelize=require('sequelize');module[_0x75a4('0x1')]={'uniqueid':{'type':Sequelize[_0x75a4('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x75a4('0x3')]},'leaveAt':{'type':Sequelize[_0x75a4('0x3')]},'acceptAt':{'type':Sequelize[_0x75a4('0x3')]},'exitAt':{'type':Sequelize[_0x75a4('0x3')]},'reason':{'type':Sequelize[_0x75a4('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 5e84b03..e16bb3c 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 _0xdbb9=['map','ChatQueueReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy','stack','name','index'];(function(_0x372215,_0x4700f1){var _0x5ebeba=function(_0x28e54b){while(--_0x28e54b){_0x372215['push'](_0x372215['shift']());}};_0x5ebeba(++_0x4700f1);}(_0xdbb9,0xf9));var _0x9dbb=function(_0x416152,_0x2e5f33){_0x416152=_0x416152-0x0;var _0x10586d=_0xdbb9[_0x416152];return _0x10586d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9dbb('0x0'));var zipdir=require(_0x9dbb('0x1'));var jsonpatch=require(_0x9dbb('0x2'));var rp=require(_0x9dbb('0x3'));var moment=require('moment');var BPromise=require(_0x9dbb('0x4'));var Mustache=require(_0x9dbb('0x5'));var util=require(_0x9dbb('0x6'));var path=require(_0x9dbb('0x7'));var sox=require(_0x9dbb('0x8'));var csv=require(_0x9dbb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9dbb('0xa'));var crypto=require(_0x9dbb('0xb'));var jsforce=require(_0x9dbb('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9dbb('0xd'));var Papa=require(_0x9dbb('0xe'));var Redis=require(_0x9dbb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9dbb('0x10'));var as=require(_0x9dbb('0x11'));var hardwareService=require(_0x9dbb('0x12'));var logger=require(_0x9dbb('0x13'))('api');var utils=require(_0x9dbb('0x14'));var config=require(_0x9dbb('0x15'));var licenseUtil=require(_0x9dbb('0x16'));var db=require(_0x9dbb('0x17'))['db'];function respondWithStatusCode(_0x3fe0bd,_0x4468e8){_0x4468e8=_0x4468e8||0xcc;return function(_0x382cc6){if(_0x382cc6){return _0x3fe0bd[_0x9dbb('0x18')](_0x4468e8);}return _0x3fe0bd[_0x9dbb('0x19')](_0x4468e8)[_0x9dbb('0x1a')]();};}function respondWithResult(_0x293028,_0x2c36d3){_0x2c36d3=_0x2c36d3||0xc8;return function(_0x24b20b){if(_0x24b20b){return _0x293028[_0x9dbb('0x19')](_0x2c36d3)[_0x9dbb('0x1b')](_0x24b20b);}};}function respondWithFilteredResult(_0x464df5,_0x528110){return function(_0x1366b2){if(_0x1366b2){var _0x30add1=typeof _0x528110[_0x9dbb('0x1c')]===_0x9dbb('0x1d')&&typeof _0x528110[_0x9dbb('0x1e')]==='undefined';var _0x382d61=_0x1366b2[_0x9dbb('0x1f')];var _0x2383cf=_0x30add1?0x0:_0x528110[_0x9dbb('0x1c')];var _0x45c6f5=_0x30add1?_0x1366b2['count']:_0x528110[_0x9dbb('0x1c')]+_0x528110['limit'];var _0x3de435;if(_0x45c6f5>=_0x382d61){_0x45c6f5=_0x382d61;_0x3de435=0xc8;}else{_0x3de435=0xce;}_0x464df5['status'](_0x3de435);return _0x464df5[_0x9dbb('0x20')]('Content-Range',_0x2383cf+'-'+_0x45c6f5+'/'+_0x382d61)[_0x9dbb('0x1b')](_0x1366b2);}return null;};}function patchUpdates(_0x192eb5){return function(_0x188c75){try{jsonpatch['apply'](_0x188c75,_0x192eb5,!![]);}catch(_0x50e5e3){return BPromise['reject'](_0x50e5e3);}return _0x188c75[_0x9dbb('0x21')]();};}function saveUpdates(_0x35c136,_0x48bb65){return function(_0x4a07ef){if(_0x4a07ef){return _0x4a07ef['update'](_0x35c136)[_0x9dbb('0x22')](function(_0x245d12){return _0x245d12;});}return null;};}function removeEntity(_0x10c06a,_0x55e2ef){return function(_0x1f30ec){if(_0x1f30ec){return _0x1f30ec[_0x9dbb('0x23')]()[_0x9dbb('0x22')](function(){_0x10c06a[_0x9dbb('0x19')](0xcc)[_0x9dbb('0x1a')]();});}};}function handleEntityNotFound(_0x3e51ca,_0x668f7b){return function(_0x187486){if(!_0x187486){_0x3e51ca[_0x9dbb('0x18')](0x194);}return _0x187486;};}function handleError(_0x127742,_0x25614a){_0x25614a=_0x25614a||0x1f4;return function(_0x27a6f6){logger['error'](_0x27a6f6[_0x9dbb('0x24')]);if(_0x27a6f6['name']){delete _0x27a6f6[_0x9dbb('0x25')];}_0x127742[_0x9dbb('0x19')](_0x25614a)['send'](_0x27a6f6);};}exports[_0x9dbb('0x26')]=function(_0x4ebd57,_0x4b5ce1){var _0x589f63={},_0x25555c={},_0x3578b3={'count':0x0,'rows':[]};var _0x491324=_[_0x9dbb('0x27')](db[_0x9dbb('0x28')]['rawAttributes'],function(_0x71692a){return{'name':_0x71692a[_0x9dbb('0x29')],'type':_0x71692a[_0x9dbb('0x2a')]['key']};});_0x25555c[_0x9dbb('0x2b')]=_['map'](_0x491324,_0x9dbb('0x25'));_0x25555c[_0x9dbb('0x2c')]=_[_0x9dbb('0x2d')](_0x4ebd57[_0x9dbb('0x2c')]);_0x25555c[_0x9dbb('0x2e')]=_[_0x9dbb('0x2f')](_0x25555c[_0x9dbb('0x2b')],_0x25555c[_0x9dbb('0x2c')]);_0x589f63[_0x9dbb('0x30')]=_[_0x9dbb('0x2f')](_0x25555c[_0x9dbb('0x2b')],qs['fields'](_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x31')]));_0x589f63[_0x9dbb('0x30')]=_0x589f63[_0x9dbb('0x30')][_0x9dbb('0x32')]?_0x589f63[_0x9dbb('0x30')]:_0x25555c[_0x9dbb('0x2b')];if(!_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x33')](_0x9dbb('0x34'))){_0x589f63[_0x9dbb('0x1e')]=qs[_0x9dbb('0x1e')](_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x1e')]);_0x589f63[_0x9dbb('0x1c')]=qs[_0x9dbb('0x1c')](_0x4ebd57[_0x9dbb('0x2c')]['offset']);}_0x589f63[_0x9dbb('0x35')]=qs[_0x9dbb('0x36')](_0x4ebd57[_0x9dbb('0x2c')]['sort']);_0x589f63[_0x9dbb('0x37')]=qs[_0x9dbb('0x2e')](_[_0x9dbb('0x38')](_0x4ebd57[_0x9dbb('0x2c')],_0x25555c[_0x9dbb('0x2e')]),_0x491324);if(_0x4ebd57[_0x9dbb('0x2c')]['filter']){_0x589f63[_0x9dbb('0x37')]=_['merge'](_0x589f63[_0x9dbb('0x37')],{'$or':_[_0x9dbb('0x27')](_0x491324,function(_0xa3bc3){if(_0xa3bc3[_0x9dbb('0x2a')]!=='VIRTUAL'){var _0x1a5eeb={};_0x1a5eeb[_0xa3bc3['name']]={'$like':'%'+_0x4ebd57[_0x9dbb('0x2c')]['filter']+'%'};return _0x1a5eeb;}})});}_0x589f63=_[_0x9dbb('0x39')]({},_0x589f63,_0x4ebd57[_0x9dbb('0x3a')]);var _0x34524e={'where':_0x589f63[_0x9dbb('0x37')]};return db[_0x9dbb('0x28')]['count'](_0x34524e)[_0x9dbb('0x22')](function(_0x59eea1){_0x3578b3[_0x9dbb('0x1f')]=_0x59eea1;if(_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x3b')]){_0x589f63[_0x9dbb('0x3c')]=[{'all':!![]}];}return db[_0x9dbb('0x28')][_0x9dbb('0x3d')](_0x589f63);})[_0x9dbb('0x22')](function(_0x49e63f){_0x3578b3[_0x9dbb('0x3e')]=_0x49e63f;return _0x3578b3;})['then'](respondWithFilteredResult(_0x4b5ce1,_0x589f63))[_0x9dbb('0x3f')](handleError(_0x4b5ce1,null));};exports[_0x9dbb('0x40')]=function(_0x34c114,_0x104ec5){var _0x490833={'raw':!![],'where':{'id':_0x34c114['params']['id']}},_0x2f99ed={};_0x2f99ed[_0x9dbb('0x2b')]=_['keys'](db[_0x9dbb('0x28')][_0x9dbb('0x41')]);_0x2f99ed['query']=_['keys'](_0x34c114[_0x9dbb('0x2c')]);_0x2f99ed[_0x9dbb('0x2e')]=_[_0x9dbb('0x2f')](_0x2f99ed[_0x9dbb('0x2b')],_0x2f99ed[_0x9dbb('0x2c')]);_0x490833[_0x9dbb('0x30')]=_[_0x9dbb('0x2f')](_0x2f99ed[_0x9dbb('0x2b')],qs[_0x9dbb('0x31')](_0x34c114['query'][_0x9dbb('0x31')]));_0x490833['attributes']=_0x490833[_0x9dbb('0x30')][_0x9dbb('0x32')]?_0x490833[_0x9dbb('0x30')]:_0x2f99ed[_0x9dbb('0x2b')];if(_0x34c114['query'][_0x9dbb('0x3b')]){_0x490833['include']=[{'all':!![]}];}_0x490833=_['merge']({},_0x490833,_0x34c114[_0x9dbb('0x3a')]);return db[_0x9dbb('0x28')][_0x9dbb('0x42')](_0x490833)[_0x9dbb('0x22')](handleEntityNotFound(_0x104ec5,null))[_0x9dbb('0x22')](respondWithResult(_0x104ec5,null))[_0x9dbb('0x3f')](handleError(_0x104ec5,null));};exports['create']=function(_0x202235,_0x56d319){return db[_0x9dbb('0x28')][_0x9dbb('0x43')](_0x202235[_0x9dbb('0x44')],{})[_0x9dbb('0x22')](respondWithResult(_0x56d319,0xc9))[_0x9dbb('0x3f')](handleError(_0x56d319,null));};exports[_0x9dbb('0x45')]=function(_0x34304a,_0x31c532){if(_0x34304a['body']['id']){delete _0x34304a[_0x9dbb('0x44')]['id'];}return db['ChatQueueReport'][_0x9dbb('0x42')]({'where':{'id':_0x34304a[_0x9dbb('0x46')]['id']}})['then'](handleEntityNotFound(_0x31c532,null))[_0x9dbb('0x22')](saveUpdates(_0x34304a['body'],null))['then'](respondWithResult(_0x31c532,null))['catch'](handleError(_0x31c532,null));};exports[_0x9dbb('0x23')]=function(_0x3c19bb,_0x5c398b){return db[_0x9dbb('0x28')]['find']({'where':{'id':_0x3c19bb[_0x9dbb('0x46')]['id']}})[_0x9dbb('0x22')](handleEntityNotFound(_0x5c398b,null))[_0x9dbb('0x22')](removeEntity(_0x5c398b,null))[_0x9dbb('0x3f')](handleError(_0x5c398b,null));};exports[_0x9dbb('0x47')]=function(_0x6a6f55,_0x56ac9a){return db['ChatQueueReport'][_0x9dbb('0x47')]()[_0x9dbb('0x22')](respondWithResult(_0x56ac9a,null))['catch'](handleError(_0x56ac9a,null));};
\ No newline at end of file
+var _0xcd0e=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','destroy','end','error','stack','name','index','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','then','includeAll','include','findAll','rows','params','length','options','catch','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3ef5e5,_0x5bbc62){var _0x212d0a=function(_0x18d566){while(--_0x18d566){_0x3ef5e5['push'](_0x3ef5e5['shift']());}};_0x212d0a(++_0x5bbc62);}(_0xcd0e,0xe9));var _0xecd0=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xcd0e[_0x24259d];return _0x5a701;};'use strict';var emlformat=require(_0xecd0('0x0'));var rimraf=require(_0xecd0('0x1'));var zipdir=require(_0xecd0('0x2'));var jsonpatch=require(_0xecd0('0x3'));var rp=require(_0xecd0('0x4'));var moment=require(_0xecd0('0x5'));var BPromise=require(_0xecd0('0x6'));var Mustache=require(_0xecd0('0x7'));var util=require(_0xecd0('0x8'));var path=require(_0xecd0('0x9'));var sox=require(_0xecd0('0xa'));var csv=require(_0xecd0('0xb'));var ejs=require(_0xecd0('0xc'));var fs=require('fs');var fs_extra=require(_0xecd0('0xd'));var _=require(_0xecd0('0xe'));var squel=require(_0xecd0('0xf'));var crypto=require(_0xecd0('0x10'));var jsforce=require(_0xecd0('0x11'));var deskjs=require(_0xecd0('0x12'));var toCsv=require('to-csv');var querystring=require(_0xecd0('0x13'));var Papa=require(_0xecd0('0x14'));var Redis=require(_0xecd0('0x15'));var authService=require(_0xecd0('0x16'));var qs=require(_0xecd0('0x17'));var as=require(_0xecd0('0x18'));var hardwareService=require(_0xecd0('0x19'));var logger=require(_0xecd0('0x1a'))(_0xecd0('0x1b'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xecd0('0x1c'))['db'];function respondWithStatusCode(_0x33af86,_0x241974){_0x241974=_0x241974||0xcc;return function(_0x3bccd2){if(_0x3bccd2){return _0x33af86[_0xecd0('0x1d')](_0x241974);}return _0x33af86[_0xecd0('0x1e')](_0x241974)['end']();};}function respondWithResult(_0x595dd8,_0x35b69b){_0x35b69b=_0x35b69b||0xc8;return function(_0xe13b00){if(_0xe13b00){return _0x595dd8['status'](_0x35b69b)[_0xecd0('0x1f')](_0xe13b00);}};}function respondWithFilteredResult(_0x45184c,_0x4b96d8){return function(_0x51d3bd){if(_0x51d3bd){var _0x118746=typeof _0x4b96d8['offset']===_0xecd0('0x20')&&typeof _0x4b96d8[_0xecd0('0x21')]==='undefined';var _0x367c38=_0x51d3bd[_0xecd0('0x22')];var _0x291300=_0x118746?0x0:_0x4b96d8['offset'];var _0x1b0054=_0x118746?_0x51d3bd[_0xecd0('0x22')]:_0x4b96d8[_0xecd0('0x23')]+_0x4b96d8['limit'];var _0x22a703;if(_0x1b0054>=_0x367c38){_0x1b0054=_0x367c38;_0x22a703=0xc8;}else{_0x22a703=0xce;}_0x45184c[_0xecd0('0x1e')](_0x22a703);return _0x45184c['set'](_0xecd0('0x24'),_0x291300+'-'+_0x1b0054+'/'+_0x367c38)[_0xecd0('0x1f')](_0x51d3bd);}return null;};}function patchUpdates(_0x51ec16){return function(_0x409e0b){try{jsonpatch[_0xecd0('0x25')](_0x409e0b,_0x51ec16,!![]);}catch(_0x4a488c){return BPromise['reject'](_0x4a488c);}return _0x409e0b[_0xecd0('0x26')]();};}function saveUpdates(_0x48fb4c,_0x26ea52){return function(_0x5c0153){if(_0x5c0153){return _0x5c0153['update'](_0x48fb4c)['then'](function(_0x355846){return _0x355846;});}return null;};}function removeEntity(_0x5b0183,_0x25d9e9){return function(_0x4ce453){if(_0x4ce453){return _0x4ce453[_0xecd0('0x27')]()['then'](function(){_0x5b0183['status'](0xcc)[_0xecd0('0x28')]();});}};}function handleEntityNotFound(_0x4f00c9,_0x3625a4){return function(_0x918e){if(!_0x918e){_0x4f00c9[_0xecd0('0x1d')](0x194);}return _0x918e;};}function handleError(_0x133ecd,_0x3b2f14){_0x3b2f14=_0x3b2f14||0x1f4;return function(_0x482321){logger[_0xecd0('0x29')](_0x482321[_0xecd0('0x2a')]);if(_0x482321[_0xecd0('0x2b')]){delete _0x482321[_0xecd0('0x2b')];}_0x133ecd[_0xecd0('0x1e')](_0x3b2f14)['send'](_0x482321);};}exports[_0xecd0('0x2c')]=function(_0x4c0dcb,_0x4374a5){var _0x45fc62={},_0x2a99a2={},_0x22efb3={'count':0x0,'rows':[]};var _0x511ef2=_['map'](db[_0xecd0('0x2d')][_0xecd0('0x2e')],function(_0x1dbfdf){return{'name':_0x1dbfdf[_0xecd0('0x2f')],'type':_0x1dbfdf[_0xecd0('0x30')]['key']};});_0x2a99a2[_0xecd0('0x31')]=_['map'](_0x511ef2,_0xecd0('0x2b'));_0x2a99a2[_0xecd0('0x32')]=_[_0xecd0('0x33')](_0x4c0dcb[_0xecd0('0x32')]);_0x2a99a2['filters']=_[_0xecd0('0x34')](_0x2a99a2[_0xecd0('0x31')],_0x2a99a2[_0xecd0('0x32')]);_0x45fc62[_0xecd0('0x35')]=_[_0xecd0('0x34')](_0x2a99a2[_0xecd0('0x31')],qs[_0xecd0('0x36')](_0x4c0dcb['query'][_0xecd0('0x36')]));_0x45fc62[_0xecd0('0x35')]=_0x45fc62[_0xecd0('0x35')]['length']?_0x45fc62['attributes']:_0x2a99a2[_0xecd0('0x31')];if(!_0x4c0dcb[_0xecd0('0x32')][_0xecd0('0x37')](_0xecd0('0x38'))){_0x45fc62[_0xecd0('0x21')]=qs[_0xecd0('0x21')](_0x4c0dcb[_0xecd0('0x32')][_0xecd0('0x21')]);_0x45fc62[_0xecd0('0x23')]=qs['offset'](_0x4c0dcb['query'][_0xecd0('0x23')]);}_0x45fc62[_0xecd0('0x39')]=qs[_0xecd0('0x3a')](_0x4c0dcb['query'][_0xecd0('0x3a')]);_0x45fc62[_0xecd0('0x3b')]=qs[_0xecd0('0x3c')](_[_0xecd0('0x3d')](_0x4c0dcb[_0xecd0('0x32')],_0x2a99a2[_0xecd0('0x3c')]),_0x511ef2);if(_0x4c0dcb['query']['filter']){_0x45fc62[_0xecd0('0x3b')]=_[_0xecd0('0x3e')](_0x45fc62[_0xecd0('0x3b')],{'$or':_['map'](_0x511ef2,function(_0x58b2a0){if(_0x58b2a0[_0xecd0('0x30')]!==_0xecd0('0x3f')){var _0x30728d={};_0x30728d[_0x58b2a0[_0xecd0('0x2b')]]={'$like':'%'+_0x4c0dcb[_0xecd0('0x32')][_0xecd0('0x40')]+'%'};return _0x30728d;}})});}_0x45fc62=_['merge']({},_0x45fc62,_0x4c0dcb['options']);var _0xed68aa={'where':_0x45fc62[_0xecd0('0x3b')]};return db['ChatQueueReport'][_0xecd0('0x22')](_0xed68aa)[_0xecd0('0x41')](function(_0x3a4fb5){_0x22efb3['count']=_0x3a4fb5;if(_0x4c0dcb[_0xecd0('0x32')][_0xecd0('0x42')]){_0x45fc62[_0xecd0('0x43')]=[{'all':!![]}];}return db[_0xecd0('0x2d')][_0xecd0('0x44')](_0x45fc62);})[_0xecd0('0x41')](function(_0xfc1eee){_0x22efb3[_0xecd0('0x45')]=_0xfc1eee;return _0x22efb3;})[_0xecd0('0x41')](respondWithFilteredResult(_0x4374a5,_0x45fc62))['catch'](handleError(_0x4374a5,null));};exports['show']=function(_0x5cab5e,_0xaa5340){var _0x94e9dd={'raw':!![],'where':{'id':_0x5cab5e[_0xecd0('0x46')]['id']}},_0x3b08ca={};_0x3b08ca['model']=_['keys'](db[_0xecd0('0x2d')][_0xecd0('0x2e')]);_0x3b08ca[_0xecd0('0x32')]=_[_0xecd0('0x33')](_0x5cab5e[_0xecd0('0x32')]);_0x3b08ca['filters']=_['intersection'](_0x3b08ca['model'],_0x3b08ca[_0xecd0('0x32')]);_0x94e9dd['attributes']=_[_0xecd0('0x34')](_0x3b08ca[_0xecd0('0x31')],qs[_0xecd0('0x36')](_0x5cab5e['query'][_0xecd0('0x36')]));_0x94e9dd['attributes']=_0x94e9dd['attributes'][_0xecd0('0x47')]?_0x94e9dd[_0xecd0('0x35')]:_0x3b08ca[_0xecd0('0x31')];if(_0x5cab5e[_0xecd0('0x32')][_0xecd0('0x42')]){_0x94e9dd[_0xecd0('0x43')]=[{'all':!![]}];}_0x94e9dd=_[_0xecd0('0x3e')]({},_0x94e9dd,_0x5cab5e[_0xecd0('0x48')]);return db[_0xecd0('0x2d')]['find'](_0x94e9dd)[_0xecd0('0x41')](handleEntityNotFound(_0xaa5340,null))['then'](respondWithResult(_0xaa5340,null))[_0xecd0('0x49')](handleError(_0xaa5340,null));};exports[_0xecd0('0x4a')]=function(_0x496e2b,_0x563b3c){return db[_0xecd0('0x2d')][_0xecd0('0x4a')](_0x496e2b[_0xecd0('0x4b')],{})['then'](respondWithResult(_0x563b3c,0xc9))[_0xecd0('0x49')](handleError(_0x563b3c,null));};exports[_0xecd0('0x4c')]=function(_0x565829,_0x54de11){if(_0x565829[_0xecd0('0x4b')]['id']){delete _0x565829[_0xecd0('0x4b')]['id'];}return db[_0xecd0('0x2d')][_0xecd0('0x4d')]({'where':{'id':_0x565829[_0xecd0('0x46')]['id']}})[_0xecd0('0x41')](handleEntityNotFound(_0x54de11,null))[_0xecd0('0x41')](saveUpdates(_0x565829['body'],null))[_0xecd0('0x41')](respondWithResult(_0x54de11,null))[_0xecd0('0x49')](handleError(_0x54de11,null));};exports[_0xecd0('0x27')]=function(_0x1806cf,_0x3aef3e){return db['ChatQueueReport'][_0xecd0('0x4d')]({'where':{'id':_0x1806cf[_0xecd0('0x46')]['id']}})[_0xecd0('0x41')](handleEntityNotFound(_0x3aef3e,null))['then'](removeEntity(_0x3aef3e,null))[_0xecd0('0x49')](handleError(_0x3aef3e,null));};exports[_0xecd0('0x4e')]=function(_0x495b6d,_0x39cc8e){return db['ChatQueueReport'][_0xecd0('0x4e')]()[_0xecd0('0x41')](respondWithResult(_0x39cc8e,null))[_0xecd0('0x49')](handleError(_0x39cc8e,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 555deda..b34f1f0 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(_0x5c2dfc,_0x17f2f7){var _0x3827b1=function(_0xc6524f){while(--_0xc6524f){_0x5c2dfc['push'](_0x5c2dfc['shift']());}};_0x3827b1(++_0x17f2f7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb7e7[_0x16d10f];return _0x50c823;};'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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5a6669,_0x417479){var _0x543d49=function(_0x1f72ad){while(--_0x1f72ad){_0x5a6669['push'](_0x5a6669['shift']());}};_0x543d49(++_0x417479);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 7ea2217..760eb31 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 _0xa68a=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','catch','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xa68a,0x1ad));var _0xaa68=function(_0x567dcd,_0x2f6e5d){_0x567dcd=_0x567dcd-0x0;var _0x38879d=_0xa68a[_0x567dcd];return _0x38879d;};'use strict';var _=require(_0xaa68('0x0'));var util=require(_0xaa68('0x1'));var moment=require(_0xaa68('0x2'));var BPromise=require(_0xaa68('0x3'));var rs=require(_0xaa68('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa68('0x5'))['db'];var utils=require(_0xaa68('0x6'));var logger=require(_0xaa68('0x7'))(_0xaa68('0x8'));var config=require(_0xaa68('0x9'));var jayson=require(_0xaa68('0xa'));var client=jayson[_0xaa68('0xb')][_0xaa68('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x259b21,_0x5c2479,_0x3813a8){return new BPromise(function(_0x9f10f5,_0x20edd4){return client['request'](_0x259b21,_0x3813a8)[_0xaa68('0xd')](function(_0x20ceee){logger[_0xaa68('0xe')](_0xaa68('0xf'),_0x5c2479,_0xaa68('0x10'));logger['debug'](_0xaa68('0x11'),_0x5c2479,_0xaa68('0x10'),JSON[_0xaa68('0x12')](_0x20ceee));if(_0x20ceee[_0xaa68('0x13')]){if(_0x20ceee[_0xaa68('0x13')][_0xaa68('0x14')]===0x1f4){logger['error'](_0xaa68('0xf'),_0x5c2479,_0x20ceee[_0xaa68('0x13')][_0xaa68('0x15')]);return _0x20edd4(_0x20ceee[_0xaa68('0x13')][_0xaa68('0x15')]);}logger[_0xaa68('0x13')](_0xaa68('0xf'),_0x5c2479,_0x20ceee['error'][_0xaa68('0x15')]);return _0x9f10f5(_0x20ceee['error'][_0xaa68('0x15')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x5c2479,_0xaa68('0x10'));_0x9f10f5(_0x20ceee[_0xaa68('0x16')]['message']);}})['catch'](function(_0x3a1f81){logger[_0xaa68('0x13')](_0xaa68('0xf'),_0x5c2479,_0x3a1f81);_0x20edd4(_0x3a1f81);});});}exports[_0xaa68('0x17')]=function(_0xd79686){var _0x30c143=this;return new Promise(function(_0x2e45ad,_0x4af7e4){return db[_0xaa68('0x18')][_0xaa68('0x19')](_0xd79686[_0xaa68('0x1a')],{'raw':_0xd79686[_0xaa68('0x1b')]?_0xd79686[_0xaa68('0x1b')][_0xaa68('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1d748f){logger['info'](_0xaa68('0x17'),_0xd79686);logger[_0xaa68('0x1d')](_0xaa68('0x17'),_0xd79686,JSON[_0xaa68('0x12')](_0x1d748f));_0x2e45ad(_0x1d748f);})[_0xaa68('0x1e')](function(_0x43fb4){logger[_0xaa68('0x13')]('CreateChatQueueReport',_0x43fb4[_0xaa68('0x15')],_0xd79686);_0x4af7e4(_0x30c143[_0xaa68('0x13')](0x1f4,_0x43fb4[_0xaa68('0x15')]));});});};exports[_0xaa68('0x1f')]=function(_0x2d6d4c){var _0x583e00=this;return new Promise(function(_0x23298e,_0x5a50dd){return db['ChatQueueReport'][_0xaa68('0x20')](_0x2d6d4c[_0xaa68('0x1a')],{'raw':_0x2d6d4c[_0xaa68('0x1b')]?_0x2d6d4c[_0xaa68('0x1b')][_0xaa68('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d6d4c[_0xaa68('0x1b')]?_0x2d6d4c[_0xaa68('0x1b')][_0xaa68('0x21')]||null:null,'attributes':_0x2d6d4c['options']?_0x2d6d4c[_0xaa68('0x1b')][_0xaa68('0x22')]||null:null,'limit':_0x2d6d4c[_0xaa68('0x1b')]?_0x2d6d4c['options'][_0xaa68('0x23')]||null:null})[_0xaa68('0xd')](function(_0xddea5d){logger['info'](_0xaa68('0x1f'),_0x2d6d4c);logger[_0xaa68('0x1d')](_0xaa68('0x1f'),_0x2d6d4c,JSON[_0xaa68('0x12')](_0xddea5d));_0x23298e(_0xddea5d);})[_0xaa68('0x1e')](function(_0x5f0066){logger[_0xaa68('0x13')](_0xaa68('0x1f'),_0x5f0066[_0xaa68('0x15')],_0x2d6d4c);_0x5a50dd(_0x583e00[_0xaa68('0x13')](0x1f4,_0x5f0066[_0xaa68('0x15')]));});});};
\ No newline at end of file
+var _0xbf5a=['message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','debug','raw','where','attributes','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x21f3c2,_0x406840){var _0xf1069d=function(_0x263ccd){while(--_0x263ccd){_0x21f3c2['push'](_0x21f3c2['shift']());}};_0xf1069d(++_0x406840);}(_0xbf5a,0x16c));var _0xabf5=function(_0x5e4f0e,_0x5a28b3){_0x5e4f0e=_0x5e4f0e-0x0;var _0x4f18a2=_0xbf5a[_0x5e4f0e];return _0x4f18a2;};'use strict';var _=require(_0xabf5('0x0'));var util=require('util');var moment=require(_0xabf5('0x1'));var BPromise=require(_0xabf5('0x2'));var rs=require(_0xabf5('0x3'));var fs=require('fs');var Redis=require(_0xabf5('0x4'));var db=require(_0xabf5('0x5'))['db'];var utils=require(_0xabf5('0x6'));var logger=require(_0xabf5('0x7'))(_0xabf5('0x8'));var config=require(_0xabf5('0x9'));var jayson=require(_0xabf5('0xa'));var client=jayson[_0xabf5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32f17d,_0x1dfe7f,_0x7152cd){return new BPromise(function(_0x12a821,_0x15f970){return client[_0xabf5('0xc')](_0x32f17d,_0x7152cd)[_0xabf5('0xd')](function(_0x56c6fd){logger[_0xabf5('0xe')](_0xabf5('0xf'),_0x1dfe7f,_0xabf5('0x10'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x1dfe7f,'request\x20sent',JSON[_0xabf5('0x11')](_0x56c6fd));if(_0x56c6fd[_0xabf5('0x12')]){if(_0x56c6fd[_0xabf5('0x12')][_0xabf5('0x13')]===0x1f4){logger['error'](_0xabf5('0xf'),_0x1dfe7f,_0x56c6fd['error']['message']);return _0x15f970(_0x56c6fd[_0xabf5('0x12')]['message']);}logger[_0xabf5('0x12')](_0xabf5('0xf'),_0x1dfe7f,_0x56c6fd[_0xabf5('0x12')]['message']);return _0x12a821(_0x56c6fd[_0xabf5('0x12')][_0xabf5('0x14')]);}else{logger[_0xabf5('0xe')](_0xabf5('0xf'),_0x1dfe7f,_0xabf5('0x10'));_0x12a821(_0x56c6fd[_0xabf5('0x15')][_0xabf5('0x14')]);}})[_0xabf5('0x16')](function(_0x2e8d4e){logger[_0xabf5('0x12')](_0xabf5('0xf'),_0x1dfe7f,_0x2e8d4e);_0x15f970(_0x2e8d4e);});});}exports[_0xabf5('0x17')]=function(_0x19c4be){var _0x9f72a6=this;return new Promise(function(_0x1c7214,_0x3e5c90){return db[_0xabf5('0x18')]['create'](_0x19c4be[_0xabf5('0x19')],{'raw':_0x19c4be[_0xabf5('0x1a')]?_0x19c4be[_0xabf5('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xabf5('0xd')](function(_0x24115a){logger[_0xabf5('0xe')](_0xabf5('0x17'),_0x19c4be);logger[_0xabf5('0x1b')](_0xabf5('0x17'),_0x19c4be,JSON['stringify'](_0x24115a));_0x1c7214(_0x24115a);})['catch'](function(_0x2bc8ad){logger[_0xabf5('0x12')](_0xabf5('0x17'),_0x2bc8ad[_0xabf5('0x14')],_0x19c4be);_0x3e5c90(_0x9f72a6[_0xabf5('0x12')](0x1f4,_0x2bc8ad[_0xabf5('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x2b17d8){var _0x4f2e9e=this;return new Promise(function(_0x34878d,_0x599816){return db[_0xabf5('0x18')]['update'](_0x2b17d8['body'],{'raw':_0x2b17d8[_0xabf5('0x1a')]?_0x2b17d8[_0xabf5('0x1a')][_0xabf5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b17d8['options']?_0x2b17d8[_0xabf5('0x1a')][_0xabf5('0x1d')]||null:null,'attributes':_0x2b17d8[_0xabf5('0x1a')]?_0x2b17d8['options'][_0xabf5('0x1e')]||null:null,'limit':_0x2b17d8['options']?_0x2b17d8[_0xabf5('0x1a')]['limit']||null:null})[_0xabf5('0xd')](function(_0x46c1ec){logger[_0xabf5('0xe')](_0xabf5('0x1f'),_0x2b17d8);logger[_0xabf5('0x1b')]('UpdateChatQueueReport',_0x2b17d8,JSON[_0xabf5('0x11')](_0x46c1ec));_0x34878d(_0x46c1ec);})[_0xabf5('0x16')](function(_0x18bf14){logger[_0xabf5('0x12')](_0xabf5('0x1f'),_0x18bf14['message'],_0x2b17d8);_0x599816(_0x4f2e9e['error'](0x1f4,_0x18bf14[_0xabf5('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index e6174dd..d28e1a6 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 _0x4a83=['destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x4a83,0xd3));var _0x34a8=function(_0x360296,_0xcd6f97){_0x360296=_0x360296-0x0;var _0x20b06d=_0x4a83[_0x360296];return _0x20b06d;};'use strict';var multer=require(_0x34a8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x34a8('0x1'));var express=require(_0x34a8('0x2'));var router=express[_0x34a8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x34a8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x34a8('0x5'));var controller=require('./chatQueueReport.controller');router[_0x34a8('0x6')]('/',auth[_0x34a8('0x7')](),controller[_0x34a8('0x8')]);router[_0x34a8('0x6')](_0x34a8('0x9'),auth[_0x34a8('0x7')](),controller[_0x34a8('0xa')]);router[_0x34a8('0x6')](_0x34a8('0xb'),auth[_0x34a8('0x7')](),controller['show']);router[_0x34a8('0xc')]('/',auth[_0x34a8('0x7')](),controller[_0x34a8('0xd')]);router[_0x34a8('0xe')](_0x34a8('0xb'),auth[_0x34a8('0x7')](),controller[_0x34a8('0xf')]);router[_0x34a8('0x10')]('/:id',auth[_0x34a8('0x7')](),controller[_0x34a8('0x11')]);module[_0x34a8('0x12')]=router;
\ No newline at end of file
+var _0x6912=['../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3b22e9,_0x354406){var _0x230314=function(_0x29ae96){while(--_0x29ae96){_0x3b22e9['push'](_0x3b22e9['shift']());}};_0x230314(++_0x354406);}(_0x6912,0xa1));var _0x2691=function(_0x468467,_0x1dee78){_0x468467=_0x468467-0x0;var _0x488fc2=_0x6912[_0x468467];return _0x488fc2;};'use strict';var multer=require('multer');var util=require(_0x2691('0x0'));var path=require(_0x2691('0x1'));var timeout=require(_0x2691('0x2'));var express=require(_0x2691('0x3'));var router=express[_0x2691('0x4')]();var fs_extra=require(_0x2691('0x5'));var auth=require(_0x2691('0x6'));var interaction=require(_0x2691('0x7'));var config=require('../../config/environment');var controller=require(_0x2691('0x8'));router[_0x2691('0x9')]('/',auth[_0x2691('0xa')](),controller[_0x2691('0xb')]);router['get'](_0x2691('0xc'),auth[_0x2691('0xa')](),controller[_0x2691('0xd')]);router[_0x2691('0x9')](_0x2691('0xe'),auth['isAuthenticated'](),controller[_0x2691('0xf')]);router[_0x2691('0x10')]('/',auth[_0x2691('0xa')](),controller[_0x2691('0x11')]);router['put'](_0x2691('0xe'),auth[_0x2691('0xa')](),controller[_0x2691('0x12')]);router[_0x2691('0x13')](_0x2691('0xe'),auth[_0x2691('0xa')](),controller['destroy']);module[_0x2691('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 0d5cd1f..95ed28f 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(_0x1ecae9,_0x3d5fb9){var _0x5518e1=function(_0x1fcef5){while(--_0x1fcef5){_0x1ecae9['push'](_0x1ecae9['shift']());}};_0x5518e1(++_0x3d5fb9);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x4617a5,_0x582345){var _0x2629f9=function(_0x56543c){while(--_0x56543c){_0x4617a5['push'](_0x4617a5['shift']());}};_0x2629f9(++_0x582345);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2bbba5,_0x24e84b){_0x2bbba5=_0x2bbba5-0x0;var _0x3c477c=_0xf4eb[_0x2bbba5];return _0x3c477c;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 4f2120d..81a2fa6 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 _0x3785=['fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','name','send','ChatTransferReport','rawAttributes'];(function(_0x51bc84,_0x519320){var _0x3a953e=function(_0x568464){while(--_0x568464){_0x51bc84['push'](_0x51bc84['shift']());}};_0x3a953e(++_0x519320);}(_0x3785,0x68));var _0x5378=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x3785[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require(_0x5378('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5378('0x1'));var rp=require(_0x5378('0x2'));var moment=require(_0x5378('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5378('0x4'));var path=require(_0x5378('0x5'));var sox=require('sox');var csv=require(_0x5378('0x6'));var ejs=require(_0x5378('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5378('0x8'));var squel=require(_0x5378('0x9'));var crypto=require(_0x5378('0xa'));var jsforce=require(_0x5378('0xb'));var deskjs=require(_0x5378('0xc'));var toCsv=require(_0x5378('0x6'));var querystring=require(_0x5378('0xd'));var Papa=require('papaparse');var Redis=require(_0x5378('0xe'));var authService=require(_0x5378('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5378('0x10'));var hardwareService=require(_0x5378('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x5378('0x12'));var config=require(_0x5378('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5378('0x14'))['db'];function respondWithStatusCode(_0x2f75e2,_0x313698){_0x313698=_0x313698||0xcc;return function(_0x552947){if(_0x552947){return _0x2f75e2[_0x5378('0x15')](_0x313698);}return _0x2f75e2[_0x5378('0x16')](_0x313698)[_0x5378('0x17')]();};}function respondWithResult(_0x232546,_0xdc60be){_0xdc60be=_0xdc60be||0xc8;return function(_0x276572){if(_0x276572){return _0x232546[_0x5378('0x16')](_0xdc60be)['json'](_0x276572);}};}function respondWithFilteredResult(_0x1fe46e,_0x49bceb){return function(_0x36a055){if(_0x36a055){var _0x4357a9=typeof _0x49bceb[_0x5378('0x18')]===_0x5378('0x19')&&typeof _0x49bceb['limit']===_0x5378('0x19');var _0x2f6719=_0x36a055[_0x5378('0x1a')];var _0x20acfd=_0x4357a9?0x0:_0x49bceb[_0x5378('0x18')];var _0x4bf39d=_0x4357a9?_0x36a055[_0x5378('0x1a')]:_0x49bceb['offset']+_0x49bceb[_0x5378('0x1b')];var _0x59b105;if(_0x4bf39d>=_0x2f6719){_0x4bf39d=_0x2f6719;_0x59b105=0xc8;}else{_0x59b105=0xce;}_0x1fe46e['status'](_0x59b105);return _0x1fe46e[_0x5378('0x1c')](_0x5378('0x1d'),_0x20acfd+'-'+_0x4bf39d+'/'+_0x2f6719)['json'](_0x36a055);}return null;};}function patchUpdates(_0xd0ce08){return function(_0x5b776a){try{jsonpatch[_0x5378('0x1e')](_0x5b776a,_0xd0ce08,!![]);}catch(_0x485a42){return BPromise[_0x5378('0x1f')](_0x485a42);}return _0x5b776a[_0x5378('0x20')]();};}function saveUpdates(_0x3dde7b,_0x4e22a9){return function(_0x425bbb){if(_0x425bbb){return _0x425bbb[_0x5378('0x21')](_0x3dde7b)['then'](function(_0x1c847d){return _0x1c847d;});}return null;};}function removeEntity(_0x120a64,_0x1eaa87){return function(_0x4682b0){if(_0x4682b0){return _0x4682b0[_0x5378('0x22')]()[_0x5378('0x23')](function(){_0x120a64[_0x5378('0x16')](0xcc)[_0x5378('0x17')]();});}};}function handleEntityNotFound(_0x46de2a,_0x576bc4){return function(_0x559c22){if(!_0x559c22){_0x46de2a[_0x5378('0x15')](0x194);}return _0x559c22;};}function handleError(_0x32df3e,_0x12b3f7){_0x12b3f7=_0x12b3f7||0x1f4;return function(_0xc34567){logger['error'](_0xc34567['stack']);if(_0xc34567[_0x5378('0x24')]){delete _0xc34567[_0x5378('0x24')];}_0x32df3e[_0x5378('0x16')](_0x12b3f7)[_0x5378('0x25')](_0xc34567);};}exports['index']=function(_0x53f98d,_0x3aa678){var _0x2df665={},_0x4b2b0d={},_0x585603={'count':0x0,'rows':[]};var _0x13529c=_['map'](db[_0x5378('0x26')][_0x5378('0x27')],function(_0x2dc627){return{'name':_0x2dc627[_0x5378('0x28')],'type':_0x2dc627[_0x5378('0x29')][_0x5378('0x2a')]};});_0x4b2b0d[_0x5378('0x2b')]=_[_0x5378('0x2c')](_0x13529c,_0x5378('0x24'));_0x4b2b0d[_0x5378('0x2d')]=_[_0x5378('0x2e')](_0x53f98d[_0x5378('0x2d')]);_0x4b2b0d[_0x5378('0x2f')]=_[_0x5378('0x30')](_0x4b2b0d[_0x5378('0x2b')],_0x4b2b0d[_0x5378('0x2d')]);_0x2df665['attributes']=_[_0x5378('0x30')](_0x4b2b0d['model'],qs['fields'](_0x53f98d[_0x5378('0x2d')][_0x5378('0x31')]));_0x2df665[_0x5378('0x32')]=_0x2df665[_0x5378('0x32')][_0x5378('0x33')]?_0x2df665['attributes']:_0x4b2b0d[_0x5378('0x2b')];if(!_0x53f98d['query'][_0x5378('0x34')](_0x5378('0x35'))){_0x2df665[_0x5378('0x1b')]=qs[_0x5378('0x1b')](_0x53f98d[_0x5378('0x2d')]['limit']);_0x2df665[_0x5378('0x18')]=qs[_0x5378('0x18')](_0x53f98d[_0x5378('0x2d')][_0x5378('0x18')]);}_0x2df665['order']=qs[_0x5378('0x36')](_0x53f98d[_0x5378('0x2d')][_0x5378('0x36')]);_0x2df665[_0x5378('0x37')]=qs[_0x5378('0x2f')](_[_0x5378('0x38')](_0x53f98d[_0x5378('0x2d')],_0x4b2b0d[_0x5378('0x2f')]),_0x13529c);if(_0x53f98d[_0x5378('0x2d')][_0x5378('0x39')]){_0x2df665[_0x5378('0x37')]=_['merge'](_0x2df665[_0x5378('0x37')],{'$or':_[_0x5378('0x2c')](_0x13529c,function(_0x231682){if(_0x231682['type']!==_0x5378('0x3a')){var _0x1b62bd={};_0x1b62bd[_0x231682[_0x5378('0x24')]]={'$like':'%'+_0x53f98d[_0x5378('0x2d')]['filter']+'%'};return _0x1b62bd;}})});}_0x2df665=_['merge']({},_0x2df665,_0x53f98d[_0x5378('0x3b')]);var _0x168e3e={'where':_0x2df665['where']};return db[_0x5378('0x26')][_0x5378('0x1a')](_0x168e3e)[_0x5378('0x23')](function(_0x1d1446){_0x585603['count']=_0x1d1446;if(_0x53f98d[_0x5378('0x2d')][_0x5378('0x3c')]){_0x2df665[_0x5378('0x3d')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x5378('0x3e')](_0x2df665);})[_0x5378('0x23')](function(_0x3207bc){_0x585603[_0x5378('0x3f')]=_0x3207bc;return _0x585603;})[_0x5378('0x23')](respondWithFilteredResult(_0x3aa678,_0x2df665))[_0x5378('0x40')](handleError(_0x3aa678,null));};exports[_0x5378('0x41')]=function(_0x302c3c,_0x53e2c0){var _0x15d210={'raw':!![],'where':{'id':_0x302c3c[_0x5378('0x42')]['id']}},_0x2faae6={};_0x2faae6[_0x5378('0x2b')]=_[_0x5378('0x2e')](db['ChatTransferReport']['rawAttributes']);_0x2faae6[_0x5378('0x2d')]=_['keys'](_0x302c3c[_0x5378('0x2d')]);_0x2faae6['filters']=_[_0x5378('0x30')](_0x2faae6[_0x5378('0x2b')],_0x2faae6[_0x5378('0x2d')]);_0x15d210[_0x5378('0x32')]=_[_0x5378('0x30')](_0x2faae6[_0x5378('0x2b')],qs[_0x5378('0x31')](_0x302c3c['query'][_0x5378('0x31')]));_0x15d210[_0x5378('0x32')]=_0x15d210['attributes'][_0x5378('0x33')]?_0x15d210[_0x5378('0x32')]:_0x2faae6[_0x5378('0x2b')];if(_0x302c3c['query']['includeAll']){_0x15d210['include']=[{'all':!![]}];}_0x15d210=_[_0x5378('0x43')]({},_0x15d210,_0x302c3c[_0x5378('0x3b')]);return db['ChatTransferReport'][_0x5378('0x44')](_0x15d210)['then'](handleEntityNotFound(_0x53e2c0,null))[_0x5378('0x23')](respondWithResult(_0x53e2c0,null))[_0x5378('0x40')](handleError(_0x53e2c0,null));};exports[_0x5378('0x45')]=function(_0x41b9f4,_0x135090){return db[_0x5378('0x26')]['create'](_0x41b9f4[_0x5378('0x46')],{})[_0x5378('0x23')](respondWithResult(_0x135090,0xc9))[_0x5378('0x40')](handleError(_0x135090,null));};exports[_0x5378('0x21')]=function(_0x47fe14,_0x343c08){if(_0x47fe14[_0x5378('0x46')]['id']){delete _0x47fe14[_0x5378('0x46')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x47fe14[_0x5378('0x42')]['id']}})[_0x5378('0x23')](handleEntityNotFound(_0x343c08,null))[_0x5378('0x23')](saveUpdates(_0x47fe14[_0x5378('0x46')],null))[_0x5378('0x23')](respondWithResult(_0x343c08,null))[_0x5378('0x40')](handleError(_0x343c08,null));};exports['destroy']=function(_0x247fe3,_0x1f26a6){return db['ChatTransferReport'][_0x5378('0x44')]({'where':{'id':_0x247fe3[_0x5378('0x42')]['id']}})[_0x5378('0x23')](handleEntityNotFound(_0x1f26a6,null))['then'](removeEntity(_0x1f26a6,null))['catch'](handleError(_0x1f26a6,null));};exports[_0x5378('0x47')]=function(_0x3a7961,_0x50aa0c){return db['ChatTransferReport'][_0x5378('0x47')]()[_0x5378('0x23')](respondWithResult(_0x50aa0c,null))[_0x5378('0x40')](handleError(_0x50aa0c,null));};
\ No newline at end of file
+var _0xedf5=['sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','merge','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2328f3,_0x48d111){var _0x2fc749=function(_0x43f897){while(--_0x43f897){_0x2328f3['push'](_0x2328f3['shift']());}};_0x2fc749(++_0x48d111);}(_0xedf5,0x10e));var _0x5edf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xedf5[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5edf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5edf('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5edf('0x2'));var Mustache=require(_0x5edf('0x3'));var util=require('util');var path=require(_0x5edf('0x4'));var sox=require('sox');var csv=require(_0x5edf('0x5'));var ejs=require(_0x5edf('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5edf('0x7'));var squel=require(_0x5edf('0x8'));var crypto=require(_0x5edf('0x9'));var jsforce=require(_0x5edf('0xa'));var deskjs=require(_0x5edf('0xb'));var toCsv=require(_0x5edf('0x5'));var querystring=require('querystring');var Papa=require(_0x5edf('0xc'));var Redis=require(_0x5edf('0xd'));var authService=require(_0x5edf('0xe'));var qs=require(_0x5edf('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5edf('0x10'));var logger=require(_0x5edf('0x11'))('api');var utils=require(_0x5edf('0x12'));var config=require(_0x5edf('0x13'));var licenseUtil=require(_0x5edf('0x14'));var db=require(_0x5edf('0x15'))['db'];function respondWithStatusCode(_0x22682b,_0x5ad188){_0x5ad188=_0x5ad188||0xcc;return function(_0x462d4f){if(_0x462d4f){return _0x22682b[_0x5edf('0x16')](_0x5ad188);}return _0x22682b['status'](_0x5ad188)['end']();};}function respondWithResult(_0x218d11,_0x5f2016){_0x5f2016=_0x5f2016||0xc8;return function(_0x36aa39){if(_0x36aa39){return _0x218d11[_0x5edf('0x17')](_0x5f2016)[_0x5edf('0x18')](_0x36aa39);}};}function respondWithFilteredResult(_0x98ea8b,_0x1129c6){return function(_0x56feba){if(_0x56feba){var _0x4905fa=typeof _0x1129c6['offset']===_0x5edf('0x19')&&typeof _0x1129c6[_0x5edf('0x1a')]===_0x5edf('0x19');var _0x223ee1=_0x56feba[_0x5edf('0x1b')];var _0x5f12d2=_0x4905fa?0x0:_0x1129c6[_0x5edf('0x1c')];var _0x1839e1=_0x4905fa?_0x56feba[_0x5edf('0x1b')]:_0x1129c6[_0x5edf('0x1c')]+_0x1129c6[_0x5edf('0x1a')];var _0xc20065;if(_0x1839e1>=_0x223ee1){_0x1839e1=_0x223ee1;_0xc20065=0xc8;}else{_0xc20065=0xce;}_0x98ea8b[_0x5edf('0x17')](_0xc20065);return _0x98ea8b['set'](_0x5edf('0x1d'),_0x5f12d2+'-'+_0x1839e1+'/'+_0x223ee1)[_0x5edf('0x18')](_0x56feba);}return null;};}function patchUpdates(_0x44e74c){return function(_0xbaade0){try{jsonpatch[_0x5edf('0x1e')](_0xbaade0,_0x44e74c,!![]);}catch(_0x20dade){return BPromise['reject'](_0x20dade);}return _0xbaade0[_0x5edf('0x1f')]();};}function saveUpdates(_0x347a34,_0x1679dd){return function(_0x1dee83){if(_0x1dee83){return _0x1dee83[_0x5edf('0x20')](_0x347a34)[_0x5edf('0x21')](function(_0x1a7b77){return _0x1a7b77;});}return null;};}function removeEntity(_0x312cb2,_0x4d7d79){return function(_0xced655){if(_0xced655){return _0xced655[_0x5edf('0x22')]()[_0x5edf('0x21')](function(){_0x312cb2[_0x5edf('0x17')](0xcc)[_0x5edf('0x23')]();});}};}function handleEntityNotFound(_0x240ad0,_0x891a3d){return function(_0xe3c0a9){if(!_0xe3c0a9){_0x240ad0[_0x5edf('0x16')](0x194);}return _0xe3c0a9;};}function handleError(_0x1ec19f,_0x195f5b){_0x195f5b=_0x195f5b||0x1f4;return function(_0x180893){logger['error'](_0x180893[_0x5edf('0x24')]);if(_0x180893[_0x5edf('0x25')]){delete _0x180893['name'];}_0x1ec19f['status'](_0x195f5b)[_0x5edf('0x26')](_0x180893);};}exports[_0x5edf('0x27')]=function(_0x23ee4c,_0xe765e){var _0x38a368={},_0xbe4a47={},_0x48698f={'count':0x0,'rows':[]};var _0x23c9b6=_[_0x5edf('0x28')](db[_0x5edf('0x29')][_0x5edf('0x2a')],function(_0x4bbbcf){return{'name':_0x4bbbcf[_0x5edf('0x2b')],'type':_0x4bbbcf['type'][_0x5edf('0x2c')]};});_0xbe4a47['model']=_[_0x5edf('0x28')](_0x23c9b6,_0x5edf('0x25'));_0xbe4a47[_0x5edf('0x2d')]=_[_0x5edf('0x2e')](_0x23ee4c[_0x5edf('0x2d')]);_0xbe4a47[_0x5edf('0x2f')]=_['intersection'](_0xbe4a47['model'],_0xbe4a47[_0x5edf('0x2d')]);_0x38a368[_0x5edf('0x30')]=_[_0x5edf('0x31')](_0xbe4a47[_0x5edf('0x32')],qs[_0x5edf('0x33')](_0x23ee4c[_0x5edf('0x2d')]['fields']));_0x38a368[_0x5edf('0x30')]=_0x38a368['attributes'][_0x5edf('0x34')]?_0x38a368['attributes']:_0xbe4a47[_0x5edf('0x32')];if(!_0x23ee4c['query'][_0x5edf('0x35')](_0x5edf('0x36'))){_0x38a368[_0x5edf('0x1a')]=qs['limit'](_0x23ee4c[_0x5edf('0x2d')][_0x5edf('0x1a')]);_0x38a368['offset']=qs[_0x5edf('0x1c')](_0x23ee4c[_0x5edf('0x2d')][_0x5edf('0x1c')]);}_0x38a368[_0x5edf('0x37')]=qs[_0x5edf('0x38')](_0x23ee4c[_0x5edf('0x2d')][_0x5edf('0x38')]);_0x38a368[_0x5edf('0x39')]=qs[_0x5edf('0x2f')](_['pick'](_0x23ee4c[_0x5edf('0x2d')],_0xbe4a47[_0x5edf('0x2f')]),_0x23c9b6);if(_0x23ee4c[_0x5edf('0x2d')][_0x5edf('0x3a')]){_0x38a368[_0x5edf('0x39')]=_['merge'](_0x38a368['where'],{'$or':_[_0x5edf('0x28')](_0x23c9b6,function(_0x2e4b60){if(_0x2e4b60[_0x5edf('0x3b')]!==_0x5edf('0x3c')){var _0x199d67={};_0x199d67[_0x2e4b60[_0x5edf('0x25')]]={'$like':'%'+_0x23ee4c[_0x5edf('0x2d')]['filter']+'%'};return _0x199d67;}})});}_0x38a368=_['merge']({},_0x38a368,_0x23ee4c[_0x5edf('0x3d')]);var _0x1f747e={'where':_0x38a368['where']};return db['ChatTransferReport'][_0x5edf('0x1b')](_0x1f747e)['then'](function(_0x394b52){_0x48698f['count']=_0x394b52;if(_0x23ee4c[_0x5edf('0x2d')][_0x5edf('0x3e')]){_0x38a368[_0x5edf('0x3f')]=[{'all':!![]}];}return db[_0x5edf('0x29')]['findAll'](_0x38a368);})['then'](function(_0x25e0d7){_0x48698f[_0x5edf('0x40')]=_0x25e0d7;return _0x48698f;})[_0x5edf('0x21')](respondWithFilteredResult(_0xe765e,_0x38a368))[_0x5edf('0x41')](handleError(_0xe765e,null));};exports[_0x5edf('0x42')]=function(_0xa53fd4,_0x31226b){var _0x139e6b={'raw':!![],'where':{'id':_0xa53fd4[_0x5edf('0x43')]['id']}},_0x5ce3e0={};_0x5ce3e0[_0x5edf('0x32')]=_[_0x5edf('0x2e')](db[_0x5edf('0x29')][_0x5edf('0x2a')]);_0x5ce3e0['query']=_[_0x5edf('0x2e')](_0xa53fd4['query']);_0x5ce3e0[_0x5edf('0x2f')]=_[_0x5edf('0x31')](_0x5ce3e0[_0x5edf('0x32')],_0x5ce3e0['query']);_0x139e6b['attributes']=_[_0x5edf('0x31')](_0x5ce3e0[_0x5edf('0x32')],qs[_0x5edf('0x33')](_0xa53fd4[_0x5edf('0x2d')][_0x5edf('0x33')]));_0x139e6b[_0x5edf('0x30')]=_0x139e6b[_0x5edf('0x30')][_0x5edf('0x34')]?_0x139e6b[_0x5edf('0x30')]:_0x5ce3e0[_0x5edf('0x32')];if(_0xa53fd4[_0x5edf('0x2d')][_0x5edf('0x3e')]){_0x139e6b[_0x5edf('0x3f')]=[{'all':!![]}];}_0x139e6b=_[_0x5edf('0x44')]({},_0x139e6b,_0xa53fd4[_0x5edf('0x3d')]);return db['ChatTransferReport'][_0x5edf('0x45')](_0x139e6b)['then'](handleEntityNotFound(_0x31226b,null))['then'](respondWithResult(_0x31226b,null))[_0x5edf('0x41')](handleError(_0x31226b,null));};exports[_0x5edf('0x46')]=function(_0xa6a7b8,_0x1fb776){return db[_0x5edf('0x29')][_0x5edf('0x46')](_0xa6a7b8['body'],{})[_0x5edf('0x21')](respondWithResult(_0x1fb776,0xc9))[_0x5edf('0x41')](handleError(_0x1fb776,null));};exports[_0x5edf('0x20')]=function(_0x116dda,_0x2ce7b3){if(_0x116dda[_0x5edf('0x47')]['id']){delete _0x116dda[_0x5edf('0x47')]['id'];}return db[_0x5edf('0x29')][_0x5edf('0x45')]({'where':{'id':_0x116dda[_0x5edf('0x43')]['id']}})[_0x5edf('0x21')](handleEntityNotFound(_0x2ce7b3,null))[_0x5edf('0x21')](saveUpdates(_0x116dda['body'],null))[_0x5edf('0x21')](respondWithResult(_0x2ce7b3,null))[_0x5edf('0x41')](handleError(_0x2ce7b3,null));};exports[_0x5edf('0x22')]=function(_0x461525,_0x2308ca){return db[_0x5edf('0x29')][_0x5edf('0x45')]({'where':{'id':_0x461525[_0x5edf('0x43')]['id']}})[_0x5edf('0x21')](handleEntityNotFound(_0x2308ca,null))[_0x5edf('0x21')](removeEntity(_0x2308ca,null))[_0x5edf('0x41')](handleError(_0x2308ca,null));};exports['describe']=function(_0x52ad2e,_0x14b658){return db[_0x5edf('0x29')][_0x5edf('0x48')]()[_0x5edf('0x21')](respondWithResult(_0x14b658,null))[_0x5edf('0x41')](handleError(_0x14b658,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 0842a63..412953d 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 _0x96d0=['../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0x96d0,0xcd));var _0x096d=function(_0x26fdc8,_0x2f70c1){_0x26fdc8=_0x26fdc8-0x0;var _0x574ebd=_0x96d0[_0x26fdc8];return _0x574ebd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x096d('0x0'))(_0x096d('0x1'));var moment=require(_0x096d('0x2'));var BPromise=require(_0x096d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x096d('0x4'));var attributes=require(_0x096d('0x5'));module[_0x096d('0x6')]=function(_0x338b4e,_0x430794){return _0x338b4e[_0x096d('0x7')](_0x096d('0x8'),attributes,{'tableName':_0x096d('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x096d('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x36a5=['path','rimraf','../../config/environment','./chatTransferReport.attributes','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3732d4,_0x46447d){var _0x155edf=function(_0x546c7f){while(--_0x546c7f){_0x3732d4['push'](_0x3732d4['shift']());}};_0x155edf(++_0x46447d);}(_0x36a5,0x7d));var _0x536a=function(_0x4dd2aa,_0x5037a9){_0x4dd2aa=_0x4dd2aa-0x0;var _0x1b24ad=_0x36a5[_0x4dd2aa];return _0x1b24ad;};'use strict';var _=require(_0x536a('0x0'));var util=require(_0x536a('0x1'));var logger=require(_0x536a('0x2'))(_0x536a('0x3'));var moment=require(_0x536a('0x4'));var BPromise=require(_0x536a('0x5'));var rp=require(_0x536a('0x6'));var fs=require('fs');var path=require(_0x536a('0x7'));var rimraf=require(_0x536a('0x8'));var config=require(_0x536a('0x9'));var attributes=require(_0x536a('0xa'));module['exports']=function(_0x30d282,_0x35ae4b){return _0x30d282['define']('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x536a('0xb'),'fields':[_0x536a('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 3f6a4ad..919f83a 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 _0xe23a=['util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','catch','lodash'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe23a,0xaf));var _0xae23=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0xe23a[_0x2c0dc0];return _0x4c0990;};'use strict';var _=require(_0xae23('0x0'));var util=require(_0xae23('0x1'));var moment=require(_0xae23('0x2'));var BPromise=require(_0xae23('0x3'));var rs=require(_0xae23('0x4'));var fs=require('fs');var Redis=require(_0xae23('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xae23('0x6'));var config=require(_0xae23('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xae23('0x8')][_0xae23('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e41d,_0x4c3794,_0x5b3b72){return new BPromise(function(_0xb6640c,_0x3e2bb1){return client[_0xae23('0xa')](_0x23e41d,_0x5b3b72)[_0xae23('0xb')](function(_0x2134be){logger[_0xae23('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x4c3794,_0xae23('0xd'));logger[_0xae23('0xe')](_0xae23('0xf'),_0x4c3794,_0xae23('0xd'),JSON[_0xae23('0x10')](_0x2134be));if(_0x2134be[_0xae23('0x11')]){if(_0x2134be['error'][_0xae23('0x12')]===0x1f4){logger[_0xae23('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x4c3794,_0x2134be[_0xae23('0x11')][_0xae23('0x13')]);return _0x3e2bb1(_0x2134be[_0xae23('0x11')]['message']);}logger[_0xae23('0x11')](_0xae23('0x14'),_0x4c3794,_0x2134be['error'][_0xae23('0x13')]);return _0xb6640c(_0x2134be[_0xae23('0x11')][_0xae23('0x13')]);}else{logger[_0xae23('0xc')](_0xae23('0x14'),_0x4c3794,'request\x20sent');_0xb6640c(_0x2134be['result']['message']);}})[_0xae23('0x15')](function(_0x38f8e1){logger[_0xae23('0x11')](_0xae23('0x14'),_0x4c3794,_0x38f8e1);_0x3e2bb1(_0x38f8e1);});});}
\ No newline at end of file
+var _0xd55f=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xd55f,0x149));var _0xfd55=function(_0x925a4f,_0x124a3f){_0x925a4f=_0x925a4f-0x0;var _0x50120a=_0xd55f[_0x925a4f];return _0x50120a;};'use strict';var _=require(_0xfd55('0x0'));var util=require(_0xfd55('0x1'));var moment=require(_0xfd55('0x2'));var BPromise=require(_0xfd55('0x3'));var rs=require(_0xfd55('0x4'));var fs=require('fs');var Redis=require(_0xfd55('0x5'));var db=require(_0xfd55('0x6'))['db'];var utils=require(_0xfd55('0x7'));var logger=require(_0xfd55('0x8'))(_0xfd55('0x9'));var config=require(_0xfd55('0xa'));var jayson=require(_0xfd55('0xb'));var client=jayson[_0xfd55('0xc')][_0xfd55('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x33a879,_0x1a727b,_0xfd4c1){return new BPromise(function(_0x2f5cc8,_0x2537db){return client['request'](_0x33a879,_0xfd4c1)['then'](function(_0x3c5e13){logger[_0xfd55('0xe')](_0xfd55('0xf'),_0x1a727b,_0xfd55('0x10'));logger[_0xfd55('0x11')](_0xfd55('0x12'),_0x1a727b,_0xfd55('0x10'),JSON[_0xfd55('0x13')](_0x3c5e13));if(_0x3c5e13[_0xfd55('0x14')]){if(_0x3c5e13[_0xfd55('0x14')][_0xfd55('0x15')]===0x1f4){logger[_0xfd55('0x14')](_0xfd55('0xf'),_0x1a727b,_0x3c5e13[_0xfd55('0x14')][_0xfd55('0x16')]);return _0x2537db(_0x3c5e13[_0xfd55('0x14')][_0xfd55('0x16')]);}logger[_0xfd55('0x14')](_0xfd55('0xf'),_0x1a727b,_0x3c5e13['error'][_0xfd55('0x16')]);return _0x2f5cc8(_0x3c5e13['error']['message']);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x1a727b,_0xfd55('0x10'));_0x2f5cc8(_0x3c5e13[_0xfd55('0x17')][_0xfd55('0x16')]);}})[_0xfd55('0x18')](function(_0x5ec6fa){logger[_0xfd55('0x14')](_0xfd55('0xf'),_0x1a727b,_0x5ec6fa);_0x2537db(_0x5ec6fa);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index f07bf1f..b8bf205 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 _0xa99c=['/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','post'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xa99c,0x15a));var _0xca99=function(_0x368f76,_0x136ee8){_0x368f76=_0x368f76-0x0;var _0x86935e=_0xa99c[_0x368f76];return _0x86935e;};'use strict';var multer=require(_0xca99('0x0'));var util=require(_0xca99('0x1'));var path=require('path');var timeout=require(_0xca99('0x2'));var express=require(_0xca99('0x3'));var router=express[_0xca99('0x4')]();var fs_extra=require(_0xca99('0x5'));var auth=require(_0xca99('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xca99('0x7'));var controller=require(_0xca99('0x8'));router[_0xca99('0x9')]('/',auth['isAuthenticated'](),controller[_0xca99('0xa')]);router[_0xca99('0x9')](_0xca99('0xb'),auth[_0xca99('0xc')](),controller[_0xca99('0xd')]);router[_0xca99('0x9')]('/:id',auth[_0xca99('0xc')](),controller['show']);router[_0xca99('0xe')]('/',auth[_0xca99('0xc')](),controller['create']);router['put'](_0xca99('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xca99('0x10')](_0xca99('0xf'),auth[_0xca99('0xc')](),controller[_0xca99('0x11')]);module[_0xca99('0x12')]=router;
\ No newline at end of file
+var _0x41a0=['./chatTransferReport.controller','get','index','/describe','/:id','isAuthenticated','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x41a0,0x123));var _0x041a=function(_0x2efd9a,_0x2bd7d8){_0x2efd9a=_0x2efd9a-0x0;var _0x20c413=_0x41a0[_0x2efd9a];return _0x20c413;};'use strict';var multer=require('multer');var util=require(_0x041a('0x0'));var path=require(_0x041a('0x1'));var timeout=require(_0x041a('0x2'));var express=require(_0x041a('0x3'));var router=express[_0x041a('0x4')]();var fs_extra=require(_0x041a('0x5'));var auth=require(_0x041a('0x6'));var interaction=require(_0x041a('0x7'));var config=require(_0x041a('0x8'));var controller=require(_0x041a('0x9'));router[_0x041a('0xa')]('/',auth['isAuthenticated'](),controller[_0x041a('0xb')]);router['get'](_0x041a('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x041a('0xa')](_0x041a('0xd'),auth[_0x041a('0xe')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x041a('0xf')]);router[_0x041a('0x10')](_0x041a('0xd'),auth[_0x041a('0xe')](),controller[_0x041a('0x11')]);router[_0x041a('0x12')](_0x041a('0xd'),auth[_0x041a('0xe')](),controller['destroy']);module[_0x041a('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index f80dad1..5236685 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 _0x5617=['Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','TEXT','stringify','input','name','onlineForm','setDataValue','Comments','getDataValue','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.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','rounded','squared','We\x20are\x20here!'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5617,0x13d));var _0x7561=function(_0xa3400,_0x3a980a){_0xa3400=_0xa3400-0x0;var _0x33dba2=_0x5617[_0xa3400];return _0x33dba2;};'use strict';var Sequelize=require(_0x7561('0x0'));var rs=require(_0x7561('0x1'));module[_0x7561('0x2')]={'name':{'type':Sequelize[_0x7561('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x7561('0x3')],'allowNull':![],'unique':_0x7561('0x4')},'description':{'type':Sequelize[_0x7561('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0x5')},'mapKeyOffline':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x7561('0x3')],'allowNull':![],'defaultValue':_0x7561('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x7561('0x3')],'allowNull':![],'defaultValue':_0x7561('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x7561('0x3')],'allowNull':![],'defaultValue':_0x7561('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x7561('0x3')],'allowNull':![],'defaultValue':_0x7561('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x7561('0x3')]},'animation':{'type':Sequelize[_0x7561('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x7561('0xa'),_0x7561('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0xc')},'start_chat_button':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0xe')},'header_offline':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0xf')},'download_transcript':{'type':Sequelize[_0x7561('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x7561('0x10')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x7561('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x7561('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x13')},'noteTitle':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x14')},'placeholderMessage':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0x16')},'closingMessageButton':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0xe')},'skipMessageButton':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x17')},'conditionAgreement':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x18')},'ratingType':{'type':Sequelize[_0x7561('0x19')](_0x7561('0x1a'),_0x7561('0x1b')),'defaultValue':_0x7561('0x1a')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x7561('0x1c')],'defaultValue':function(){return JSON[_0x7561('0x1d')]({'items':[{'type':_0x7561('0x1e'),'variable':null,'config':{'placeholder':_0x7561('0x1f'),'type':'text','required':!![]},'props':{'title':_0x7561('0x1f'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x7561('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x7561('0x20'))?JSON['parse'](this['getDataValue'](_0x7561('0x20'))):{};},'set':function(_0x2b7061){return this[_0x7561('0x21')](_0x7561('0x20'),JSON[_0x7561('0x1d')](_0x2b7061));}},'offlineForm':{'type':Sequelize[_0x7561('0x1c')],'defaultValue':function(){return JSON[_0x7561('0x1d')]({'items':[{'type':_0x7561('0x1e'),'props':{'title':_0x7561('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x7561('0x5'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x7561('0x22'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x7561('0x23')](_0x7561('0x24'))?JSON[_0x7561('0x25')](this['getDataValue'](_0x7561('0x24'))):{};},'set':function(_0x476ff3){return this[_0x7561('0x21')](_0x7561('0x24'),JSON['stringify'](_0x476ff3));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x7561('0x26')]();}},'autoclose':{'type':Sequelize[_0x7561('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x7561('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0x27')},'waitingMessage':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x28')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0x29')},'offlineMessageBody':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0x7561('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0x2b')},'skipUnmanaged':{'type':Sequelize[_0x7561('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x7561('0x1c')]},'showAgentAvatar':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x7561('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7561('0x1c')],'defaultValue':function(){return _0x7561('0x2c');}},'notificationSound':{'type':Sequelize[_0x7561('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x7561('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x7561('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0x2d')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x7561('0x2e')},'messagesAlignment':{'type':Sequelize[_0x7561('0x3')],'defaultValue':_0x7561('0x2f')},'defaultTitle':{'type':Sequelize[_0x7561('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7561('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7561('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7561('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x7561('0x1c')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x7561('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![],'comment':_0x7561('0x32'),'set':function(_0x4d30ba){if(!_0x4d30ba)this[_0x7561('0x21')](_0x7561('0x33'),null);this[_0x7561('0x21')](_0x7561('0x34'),_0x4d30ba);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x7561('0x3')]},'vidaooTopic':{'type':Sequelize[_0x7561('0x3')],'allowNull':![],'defaultValue':_0x7561('0x35')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x7561('0x36');}},'vidaooMetadata':{'type':Sequelize[_0x7561('0x1c')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x7561('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x7561('0x1c')]}};
\ No newline at end of file
+var _0x8a2f=['squared','We\x20are\x20here!','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','star','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','BOOLEAN','rounded'];(function(_0x40ff89,_0x22ea0c){var _0x462cab=function(_0x1a7edf){while(--_0x1a7edf){_0x40ff89['push'](_0x40ff89['shift']());}};_0x462cab(++_0x22ea0c);}(_0x8a2f,0xcf));var _0xf8a2=function(_0x3e49cb,_0x429d1f){_0x3e49cb=_0x3e49cb-0x0;var _0x270b16=_0x8a2f[_0x3e49cb];return _0x270b16;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xf8a2('0x0'));module[_0xf8a2('0x1')]={'name':{'type':Sequelize[_0xf8a2('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xf8a2('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf8a2('0x2')],'allowNull':![],'defaultValue':_0xf8a2('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf8a2('0x2')],'allowNull':![],'defaultValue':_0xf8a2('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf8a2('0x2')],'allowNull':![],'defaultValue':_0xf8a2('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xf8a2('0x2')],'allowNull':![],'defaultValue':_0xf8a2('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf8a2('0x2')]},'animation':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xf8a2('0x8'),_0xf8a2('0x9')),'defaultValue':_0xf8a2('0x8')},'header_online':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0xa')},'start_chat_button':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0xb')},'header_offline':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0xc')},'download_transcript':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf8a2('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf8a2('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xf8a2('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x12')},'noteTitle':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x13')},'placeholderMessage':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x14')},'closingMessage':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x15')},'closingMessageButton':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0xb')},'skipMessageButton':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x16')},'conditionAgreement':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xf8a2('0x17')](_0xf8a2('0x18'),'thumb'),'defaultValue':_0xf8a2('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xf8a2('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf8a2('0xf')],'defaultValue':function(){return JSON[_0xf8a2('0x19')]({'items':[{'type':_0xf8a2('0x1a'),'variable':null,'config':{'placeholder':_0xf8a2('0x1b'),'type':_0xf8a2('0x1c'),'required':!![]},'props':{'title':_0xf8a2('0x1b'),'helpText':''}},{'type':_0xf8a2('0x1a'),'props':{'title':_0xf8a2('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xf8a2('0x3'),'type':_0xf8a2('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf8a2('0x1d')](_0xf8a2('0x1e'))?JSON[_0xf8a2('0x1f')](this['getDataValue'](_0xf8a2('0x1e'))):{};},'set':function(_0x425af4){return this['setDataValue'](_0xf8a2('0x1e'),JSON[_0xf8a2('0x19')](_0x425af4));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf8a2('0x1a'),'props':{'title':_0xf8a2('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xf8a2('0x3'),'type':_0xf8a2('0x3')},'variable':null},{'type':_0xf8a2('0x20'),'config':{'placeholder':_0xf8a2('0x21')},'props':{'title':'Comments','helpText':_0xf8a2('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xf8a2('0x1d')](_0xf8a2('0x23'))?JSON[_0xf8a2('0x1f')](this[_0xf8a2('0x1d')](_0xf8a2('0x23'))):{};},'set':function(_0x2ffdf2){return this['setDataValue'](_0xf8a2('0x23'),JSON[_0xf8a2('0x19')](_0x2ffdf2));}},'token':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':function(){return rs[_0xf8a2('0x24')]();}},'autoclose':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf8a2('0x2')]},'forwardOffline':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf8a2('0x2')]},'waitingTitle':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x25')},'waitingMessage':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x28')},'skipUnmanaged':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x16')},'sendUnmanaged':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf8a2('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf8a2('0xf')],'defaultValue':function(){return _0xf8a2('0x29');}},'notificationSound':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf8a2('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x2b')},'verticalAlignment':{'type':Sequelize[_0xf8a2('0xd')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x2c')},'messagesAlignment':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':_0xf8a2('0x2d')},'defaultTitle':{'type':Sequelize[_0xf8a2('0x2')]},'customerAvatar':{'type':Sequelize[_0xf8a2('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf8a2('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf8a2('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf8a2('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf8a2('0x2e')},'systemAvatar':{'type':Sequelize[_0xf8a2('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf8a2('0xd')],'comment':_0xf8a2('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf8a2('0x30'),'set':function(_0x4e8d63){if(!_0x4e8d63)this[_0xf8a2('0x31')](_0xf8a2('0x32'),null);this[_0xf8a2('0x31')](_0xf8a2('0x33'),_0x4e8d63);}},'vidaooEscalation':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf8a2('0x34')},'vidaooNote':{'type':Sequelize[_0xf8a2('0x2')],'defaultValue':function(){return _0xf8a2('0x35');}},'vidaooMetadata':{'type':Sequelize[_0xf8a2('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf8a2('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf8a2('0xf')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index c0516ec..4c85bfa 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 _0x4c4e=['color_button','backgroundColor','hideWhenOffline','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','omit','getProactiveActions','ChatProactiveAction','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','removeAgents','isArray','emit','getAgents','mustache','path','ejs','fs-extra','querystring','html-to-text','ioredis','../../components/parsers/qs','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','status','undefined','limit','count','offset','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','end','sendStatus','stack','name','send','user-agent-parser','setUA','user-agent','getResult','cf-connecting-ip','first','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','model','%s\x20%s\x20%s','vendor','type','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','intersection','body','split','forEach','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','testWildcardValidity','Pause','describe','addDisposition','Disposition','getDispositions','findOne','ChatWebsiteId','rows','removeDispositions','ids','addAnswer','CannedAnswer','nolimit','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','sitepic','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','resolve','ifTime','notify','chat','from','From\x20is\x20mandatory','isEmpty','customerIp','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','Interval','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','mapKey','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','ValidationError','no\x20available\x20attributes','difference','Sequelize','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','spread','readFileSync','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','Tag','Tags','color','tag','findAll','getSnippet','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','origin','http://localhost:9000','address','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textButtonColor'];(function(_0x5201dc,_0x1824ac){var _0x1e3a33=function(_0xca6856){while(--_0xca6856){_0x5201dc['push'](_0x5201dc['shift']());}};_0x1e3a33(++_0x1824ac);}(_0x4c4e,0x152));var _0xe4c4=function(_0x4182ad,_0x80b112){_0x4182ad=_0x4182ad-0x0;var _0x3809d6=_0x4c4e[_0x4182ad];return _0x3809d6;};'use strict';var Mustache=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var ejs=require(_0xe4c4('0x2'));var fs=require('fs');var fs_extra=require(_0xe4c4('0x3'));var _=require('lodash');var querystring=require(_0xe4c4('0x4'));var htmlToText=require(_0xe4c4('0x5'));var Redis=require(_0xe4c4('0x6'));var jayson=require('jayson/promise');var qs=require(_0xe4c4('0x7'));var logger=require('../../config/logger')(_0xe4c4('0x8'));var config=require(_0xe4c4('0x9'));var APIBadRequestError=require(_0xe4c4('0xa'))[_0xe4c4('0xb')];var APINotFoundError=require(_0xe4c4('0xa'))[_0xe4c4('0xc')];var APIOutOfIntervalError=require(_0xe4c4('0xa'))[_0xe4c4('0xd')];var APIHandleError=require('../../errors/api')['handleError'];var APIConflictError=require(_0xe4c4('0xa'))[_0xe4c4('0xe')];var wildcardUtils=require(_0xe4c4('0xf'));var URL=require(_0xe4c4('0x10'))[_0xe4c4('0x11')];var db=require(_0xe4c4('0x12'))['db'];config['redis']=_[_0xe4c4('0x13')](config[_0xe4c4('0x14')],{'host':_0xe4c4('0x15'),'port':0x18eb});var socket=require(_0xe4c4('0x16'))(new Redis(config['redis']));require(_0xe4c4('0x17'))[_0xe4c4('0x18')](socket);var client=jayson['client'][_0xe4c4('0x19')]({'port':0x232c});var client9002=jayson[_0xe4c4('0x1a')]['http']({'port':0x232a});var client9003=jayson[_0xe4c4('0x1a')][_0xe4c4('0x19')]({'port':0x232b});var client9001=jayson['client'][_0xe4c4('0x19')]({'port':0x2329});function respondWithRpcPromise(_0x465c9b,_0x26ea05,_0x40a36e,_0x19e59b){return new Promise(function(_0x882be2,_0x1f637e){var _0x1038cb=_0x19e59b||client;return _0x1038cb[_0xe4c4('0x1b')](_0x465c9b,_0x40a36e)[_0xe4c4('0x1c')](function(_0x23b7e6){logger[_0xe4c4('0x1d')](_0xe4c4('0x1e'),_0x26ea05,_0xe4c4('0x1f'));logger[_0xe4c4('0x20')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x26ea05,_0xe4c4('0x1f'),JSON[_0xe4c4('0x21')](_0x23b7e6));if(_0x23b7e6[_0xe4c4('0x22')]){if(_0x23b7e6[_0xe4c4('0x22')]['code']===0x1f4){logger[_0xe4c4('0x22')](_0xe4c4('0x1e'),_0x26ea05,_0x23b7e6[_0xe4c4('0x22')][_0xe4c4('0x23')]);return _0x1f637e(_0x23b7e6[_0xe4c4('0x22')][_0xe4c4('0x23')]);}logger[_0xe4c4('0x22')](_0xe4c4('0x1e'),_0x26ea05,_0x23b7e6[_0xe4c4('0x22')][_0xe4c4('0x23')]);return _0x882be2(_0x23b7e6[_0xe4c4('0x22')][_0xe4c4('0x23')]);}else{logger[_0xe4c4('0x1d')](_0xe4c4('0x1e'),_0x26ea05,_0xe4c4('0x1f'));_0x882be2(_0x23b7e6['result']['message']);}})[_0xe4c4('0x24')](function(_0x4dc8cc){logger[_0xe4c4('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x26ea05,_0x4dc8cc);_0x1f637e(_0x4dc8cc);});});}function respondWithStatusCode(_0x3adfcb,_0x5efc4c){_0x5efc4c=_0x5efc4c||0xcc;return function(_0x34d667){if(_0x34d667){return _0x3adfcb['sendStatus'](_0x5efc4c);}return _0x3adfcb[_0xe4c4('0x25')](_0x5efc4c)['end']();};}function respondWithResult(_0x5a2adb,_0x4cea1f){_0x4cea1f=_0x4cea1f||0xc8;return function(_0x5d66ab){if(_0x5d66ab){return _0x5a2adb[_0xe4c4('0x25')](_0x4cea1f)['json'](_0x5d66ab);}};}function respondWithFilteredResult(_0x5b5ea5,_0xe2c1b4){return function(_0x11deab){if(_0x11deab){var _0x4bb911=typeof _0xe2c1b4['offset']===_0xe4c4('0x26')&&typeof _0xe2c1b4[_0xe4c4('0x27')]==='undefined';var _0x158432=_0x11deab[_0xe4c4('0x28')];var _0x3f60fc=_0x4bb911?0x0:_0xe2c1b4['offset'];var _0x5d49fd=_0x4bb911?_0x11deab[_0xe4c4('0x28')]:_0xe2c1b4[_0xe4c4('0x29')]+_0xe2c1b4[_0xe4c4('0x27')];var _0x237dd6;if(_0x5d49fd>=_0x158432){_0x5d49fd=_0x158432;_0x237dd6=0xc8;}else{_0x237dd6=0xce;}_0x5b5ea5['status'](_0x237dd6);return _0x5b5ea5['set'](_0xe4c4('0x2a'),_0x3f60fc+'-'+_0x5d49fd+'/'+_0x158432)[_0xe4c4('0x2b')](_0x11deab);}return null;};}function saveUpdates(_0x5d0ba5){return function(_0x3e18e1){if(_0x3e18e1){return _0x3e18e1[_0xe4c4('0x2c')](_0x5d0ba5)[_0xe4c4('0x1c')](function(_0x59b5d1){return _0x59b5d1;});}return null;};}function removeEntity(_0x137f40){return function(_0x5976bc){if(_0x5976bc){return _0x5976bc[_0xe4c4('0x2d')]()[_0xe4c4('0x1c')](function(){var _0x3bb6cf=_0x5976bc[_0xe4c4('0x2e')]({'plain':!![]});var _0x2bd5c1=_0xe4c4('0x2f');return db[_0xe4c4('0x30')][_0xe4c4('0x2d')]({'where':{'type':_0x2bd5c1,'resourceId':_0x3bb6cf['id']}})[_0xe4c4('0x1c')](function(){return _0x5976bc;});})[_0xe4c4('0x1c')](function(){_0x137f40[_0xe4c4('0x25')](0xcc)[_0xe4c4('0x31')]();});}};}function handleEntityNotFound(_0x5cc2a8){return function(_0x21fce3){if(!_0x21fce3){_0x5cc2a8[_0xe4c4('0x32')](0x194);}return _0x21fce3;};}function handleError(_0x3d598a,_0x518018){_0x518018=_0x518018||0x1f4;return function(_0xac6cb4){logger[_0xe4c4('0x22')](_0xac6cb4[_0xe4c4('0x33')]);if(_0xac6cb4['name']){delete _0xac6cb4[_0xe4c4('0x34')];}_0x3d598a[_0xe4c4('0x25')](_0x518018)[_0xe4c4('0x35')](_0xac6cb4);};}function createInteractionObject(_0x1de955,_0x413ec9,_0x10f243,_0x2f8a21){var _0x44f4eb=require(_0xe4c4('0x36'));var _0x8b5bf3=new _0x44f4eb();var _0x5bb519=_0x8b5bf3[_0xe4c4('0x37')](_0x10f243[_0xe4c4('0x38')])[_0xe4c4('0x39')]();var _0x3c16a5=_0x413ec9['customerIp'];if(_0x10f243[_0xe4c4('0x3a')]){_0x3c16a5=_0x10f243[_0xe4c4('0x3a')];}else if(_0x10f243['x-forwarded-for']){_0x3c16a5=_[_0xe4c4('0x3b')](_0x10f243[_0xe4c4('0x3c')]['split'](','));}return{'ContactId':_0x2f8a21['id'],'ChatWebsiteId':_0x1de955,'from':(_0x2f8a21[_0xe4c4('0x3d')]||'')+'\x20'+(_0x2f8a21[_0xe4c4('0x3e')]||''),'customerIp':_0x3c16a5,'customerPort':_0x10f243[_0xe4c4('0x3f')]?_0x10f243[_0xe4c4('0x3f')]:null,'referer':_0x413ec9[_0xe4c4('0x40')],'browserName':_0x5bb519[_0xe4c4('0x41')][_0xe4c4('0x34')]&&_0x5bb519[_0xe4c4('0x41')][_0xe4c4('0x42')]?util[_0xe4c4('0x43')](_0xe4c4('0x44'),_0x5bb519[_0xe4c4('0x41')]['name'],_0x5bb519[_0xe4c4('0x41')][_0xe4c4('0x42')]):_0xe4c4('0x45'),'browserVersion':_0x5bb519[_0xe4c4('0x41')][_0xe4c4('0x42')]||_0xe4c4('0x45'),'osName':util['format'](_0xe4c4('0x44'),_0x5bb519['os']['name'],_0x5bb519['os'][_0xe4c4('0x42')]),'osVersion':_0x5bb519['os'][_0xe4c4('0x42')],'deviceModel':_0x5bb519[_0xe4c4('0x46')][_0xe4c4('0x47')]&&_0x5bb519[_0xe4c4('0x46')]['vendor']?util['format'](_0xe4c4('0x48'),_0x5bb519[_0xe4c4('0x46')][_0xe4c4('0x47')],_0x5bb519['device'][_0xe4c4('0x49')],_0x5bb519[_0xe4c4('0x46')][_0xe4c4('0x4a')]):null,'deviceVendor':_0x5bb519[_0xe4c4('0x46')]['vendor'],'deviceType':_0x5bb519[_0xe4c4('0x46')][_0xe4c4('0x4a')],'formData':JSON[_0xe4c4('0x21')](_0x413ec9)};}exports[_0xe4c4('0x4b')]=function(_0x6bf1ee,_0x1e459e){var _0x1eda5e={'include':[{'model':db['Pause'],'as':_0xe4c4('0x4c')}]},_0x176712={},_0x3ee4db={'count':0x0,'rows':[]};var _0x5d9b27=_[_0xe4c4('0x4d')](db[_0xe4c4('0x4e')][_0xe4c4('0x4f')],function(_0x15e595){return{'name':_0x15e595[_0xe4c4('0x50')],'type':_0x15e595[_0xe4c4('0x4a')][_0xe4c4('0x51')]};});_0x176712[_0xe4c4('0x47')]=_[_0xe4c4('0x4d')](_0x5d9b27,_0xe4c4('0x34'));_0x176712[_0xe4c4('0x52')]=_[_0xe4c4('0x53')](_0x6bf1ee[_0xe4c4('0x52')]);_0x176712[_0xe4c4('0x54')]=_['intersection'](_0x176712['model'],_0x176712[_0xe4c4('0x52')]);_0x1eda5e[_0xe4c4('0x55')]=_['intersection'](_0x176712[_0xe4c4('0x47')],qs[_0xe4c4('0x56')](_0x6bf1ee[_0xe4c4('0x52')][_0xe4c4('0x56')]));_0x1eda5e[_0xe4c4('0x55')]=_0x1eda5e['attributes'][_0xe4c4('0x57')]?_0x1eda5e[_0xe4c4('0x55')]:_0x176712['model'];if(!_0x6bf1ee[_0xe4c4('0x52')][_0xe4c4('0x58')]('nolimit')){_0x1eda5e[_0xe4c4('0x27')]=qs['limit'](_0x6bf1ee[_0xe4c4('0x52')][_0xe4c4('0x27')]);_0x1eda5e[_0xe4c4('0x29')]=qs[_0xe4c4('0x29')](_0x6bf1ee[_0xe4c4('0x52')]['offset']);}_0x1eda5e[_0xe4c4('0x59')]=qs[_0xe4c4('0x5a')](_0x6bf1ee[_0xe4c4('0x52')][_0xe4c4('0x5a')]);_0x1eda5e[_0xe4c4('0x5b')]=qs[_0xe4c4('0x54')](_[_0xe4c4('0x5c')](_0x6bf1ee[_0xe4c4('0x52')],_0x176712[_0xe4c4('0x54')]),_0x5d9b27);if(_0x6bf1ee[_0xe4c4('0x52')][_0xe4c4('0x5d')]){_0x1eda5e[_0xe4c4('0x5b')]=_[_0xe4c4('0x5e')](_0x1eda5e[_0xe4c4('0x5b')],{'$or':_[_0xe4c4('0x4d')](_0x5d9b27,function(_0x338cf5){if(_0x338cf5['type']!==_0xe4c4('0x5f')){var _0x4a2ae9={};_0x4a2ae9[_0x338cf5[_0xe4c4('0x34')]]={'$like':'%'+_0x6bf1ee['query'][_0xe4c4('0x5d')]+'%'};return _0x4a2ae9;}})});}_0x1eda5e=_[_0xe4c4('0x5e')]({},_0x1eda5e,_0x6bf1ee[_0xe4c4('0x60')]);var _0x512ca9={'where':_0x1eda5e[_0xe4c4('0x5b')]};return db['ChatWebsite'][_0xe4c4('0x28')](_0x512ca9)[_0xe4c4('0x1c')](function(_0x1cef48){_0x3ee4db['count']=_0x1cef48;if(_0x6bf1ee['query'][_0xe4c4('0x61')]){_0x1eda5e[_0xe4c4('0x62')]=[{'all':!![]}];}return db[_0xe4c4('0x4e')]['findAll'](_0x1eda5e);})[_0xe4c4('0x1c')](function(_0x5c45f8){_0x3ee4db['rows']=_0x5c45f8;return _0x3ee4db;})['then'](respondWithFilteredResult(_0x1e459e,_0x1eda5e))['catch'](handleError(_0x1e459e,null));};exports[_0xe4c4('0x63')]=function(_0x3a06da,_0x1d89ff){var _0x2ea066={'raw':![],'where':{'id':_0x3a06da[_0xe4c4('0x64')]['id']},'include':[{'model':db['Pause'],'as':_0xe4c4('0x4c')}]},_0x4456e8={};_0x4456e8[_0xe4c4('0x47')]=_[_0xe4c4('0x53')](db[_0xe4c4('0x4e')][_0xe4c4('0x4f')]);_0x4456e8[_0xe4c4('0x52')]=_['keys'](_0x3a06da['query']);_0x4456e8[_0xe4c4('0x54')]=_[_0xe4c4('0x65')](_0x4456e8[_0xe4c4('0x47')],_0x4456e8[_0xe4c4('0x52')]);_0x2ea066[_0xe4c4('0x55')]=_[_0xe4c4('0x65')](_0x4456e8[_0xe4c4('0x47')],qs[_0xe4c4('0x56')](_0x3a06da[_0xe4c4('0x52')]['fields']));_0x2ea066['attributes']=_0x2ea066[_0xe4c4('0x55')]['length']?_0x2ea066[_0xe4c4('0x55')]:_0x4456e8[_0xe4c4('0x47')];if(_0x3a06da[_0xe4c4('0x52')]['includeAll']){_0x2ea066[_0xe4c4('0x62')]=[{'all':!![]}];}_0x2ea066=_['merge']({},_0x2ea066,_0x3a06da[_0xe4c4('0x60')]);return db['ChatWebsite']['find'](_0x2ea066)[_0xe4c4('0x1c')](handleEntityNotFound(_0x1d89ff,null))[_0xe4c4('0x1c')](respondWithResult(_0x1d89ff,null))[_0xe4c4('0x24')](handleError(_0x1d89ff,null));};exports['create']=function(_0x57e38e,_0x4879f9){var _0x1f91f4=null;_0x57e38e[_0xe4c4('0x66')]['address'][_0xe4c4('0x67')](',')[_0xe4c4('0x68')](_0x11115a=>{if(_0x11115a['trim']()!==''&&!wildcardUtils['testWildcardValidity'](_0x11115a[_0xe4c4('0x69')]())){_0x1f91f4=new APIBadRequestError('\x22'+_0x11115a[_0xe4c4('0x69')]()+_0xe4c4('0x6a'));}});if(_0x1f91f4){return handleError(_0x4879f9,null)(_0x1f91f4);}return db[_0xe4c4('0x4e')][_0xe4c4('0x6b')](_0x57e38e[_0xe4c4('0x66')],{})['then'](function(_0x38dd83){var _0x1bddd5=_0x57e38e[_0xe4c4('0x6c')]['get']({'plain':!![]});if(!_0x1bddd5)throw new Error(_0xe4c4('0x6d'));if(_0x1bddd5[_0xe4c4('0x6e')]===_0xe4c4('0x6c')){var _0x57998c=_0x38dd83['get']({'plain':!![]});var _0x2043a8='ChatWebsites';return db['UserProfileSection'][_0xe4c4('0x6f')]({'where':{'name':_0x2043a8,'userProfileId':_0x1bddd5[_0xe4c4('0x70')]},'raw':!![]})[_0xe4c4('0x1c')](function(_0x49d80b){if(_0x49d80b&&_0x49d80b[_0xe4c4('0x71')]===0x0){return db[_0xe4c4('0x30')][_0xe4c4('0x6b')]({'name':_0x57998c[_0xe4c4('0x34')],'resourceId':_0x57998c['id'],'type':_0x49d80b['name'],'sectionId':_0x49d80b['id']},{})[_0xe4c4('0x1c')](function(){return _0x38dd83;});}else{return _0x38dd83;}})[_0xe4c4('0x24')](function(_0x4bb16e){logger['error'](_0xe4c4('0x72'),_0x4bb16e);throw _0x4bb16e;});}return _0x38dd83;})[_0xe4c4('0x1c')](respondWithResult(_0x4879f9,0xc9))[_0xe4c4('0x24')](handleError(_0x4879f9,null));};exports[_0xe4c4('0x2c')]=function(_0x54c386,_0x369ecc){var _0x25e84f=null;_0x54c386[_0xe4c4('0x66')]['address']['split'](',')[_0xe4c4('0x68')](_0x2be1d8=>{if(_0x2be1d8[_0xe4c4('0x69')]()!==''&&!wildcardUtils[_0xe4c4('0x73')](_0x2be1d8['trim']())){_0x25e84f=new APIBadRequestError('\x22'+_0x2be1d8['trim']()+_0xe4c4('0x6a'));}});if(_0x25e84f){return handleError(_0x369ecc,null)(_0x25e84f);}if(_0x54c386[_0xe4c4('0x66')]['id']){delete _0x54c386[_0xe4c4('0x66')]['id'];}return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')]({'where':{'id':_0x54c386['params']['id']},'include':[{'model':db[_0xe4c4('0x74')],'as':'mandatoryDispositionPause'}]})[_0xe4c4('0x1c')](handleEntityNotFound(_0x369ecc,null))[_0xe4c4('0x1c')](saveUpdates(_0x54c386['body'],null))['then'](respondWithResult(_0x369ecc,null))[_0xe4c4('0x24')](handleError(_0x369ecc,null));};exports[_0xe4c4('0x2d')]=function(_0x250bb8,_0x1f880f){return db[_0xe4c4('0x4e')]['find']({'where':{'id':_0x250bb8['params']['id']}})['then'](handleEntityNotFound(_0x1f880f,null))[_0xe4c4('0x1c')](removeEntity(_0x1f880f,null))[_0xe4c4('0x24')](handleError(_0x1f880f,null));};exports['describe']=function(_0x203f11,_0x11faa3){return db[_0xe4c4('0x4e')][_0xe4c4('0x75')]()['then'](respondWithResult(_0x11faa3,null))['catch'](handleError(_0x11faa3,null));};exports[_0xe4c4('0x76')]=function(_0x32f019,_0x5ad3f5){if(_0x32f019[_0xe4c4('0x66')]['id']){delete _0x32f019[_0xe4c4('0x66')]['id'];}return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')]({'where':{'id':_0x32f019['params']['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x5ad3f5,null))[_0xe4c4('0x1c')](function(_0x4e848c){if(_0x4e848c){_0x32f019[_0xe4c4('0x66')]['ChatWebsiteId']=_0x4e848c['id'];return db[_0xe4c4('0x77')][_0xe4c4('0x6b')](_0x32f019[_0xe4c4('0x66')]);}})[_0xe4c4('0x1c')](respondWithResult(_0x5ad3f5,null))['catch'](handleError(_0x5ad3f5,null));};exports[_0xe4c4('0x78')]=function(_0x209fa2,_0x4f3263){var _0x48e089={'raw':![],'where':{}};var _0x1cbf25={};var _0x3547d5={'count':0x0,'rows':[]};return db[_0xe4c4('0x4e')][_0xe4c4('0x79')]({'where':{'id':_0x209fa2[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x4f3263,null))[_0xe4c4('0x1c')](function(_0xa3f3b7){if(_0xa3f3b7){_0x1cbf25['model']=_['keys'](db[_0xe4c4('0x77')][_0xe4c4('0x4f')]);_0x1cbf25[_0xe4c4('0x52')]=_[_0xe4c4('0x53')](_0x209fa2[_0xe4c4('0x52')]);_0x1cbf25['filters']=_[_0xe4c4('0x65')](_0x1cbf25[_0xe4c4('0x47')],_0x1cbf25[_0xe4c4('0x52')]);_0x48e089[_0xe4c4('0x55')]=_[_0xe4c4('0x65')](_0x1cbf25[_0xe4c4('0x47')],qs[_0xe4c4('0x56')](_0x209fa2[_0xe4c4('0x52')][_0xe4c4('0x56')]));_0x48e089[_0xe4c4('0x55')]=_0x48e089[_0xe4c4('0x55')][_0xe4c4('0x57')]?_0x48e089[_0xe4c4('0x55')]:_0x1cbf25[_0xe4c4('0x47')];if(!_0x209fa2[_0xe4c4('0x52')][_0xe4c4('0x58')]('nolimit')){_0x48e089['limit']=qs[_0xe4c4('0x27')](_0x209fa2['query'][_0xe4c4('0x27')]);_0x48e089[_0xe4c4('0x29')]=qs[_0xe4c4('0x29')](_0x209fa2[_0xe4c4('0x52')][_0xe4c4('0x29')]);}_0x48e089[_0xe4c4('0x59')]=qs[_0xe4c4('0x5a')](_0x209fa2[_0xe4c4('0x52')][_0xe4c4('0x5a')]);_0x48e089[_0xe4c4('0x5b')]=qs[_0xe4c4('0x54')](_[_0xe4c4('0x5c')](_0x209fa2[_0xe4c4('0x52')],_0x1cbf25['filters']));_0x48e089[_0xe4c4('0x5b')][_0xe4c4('0x7a')]=_0xa3f3b7['id'];if(_0x209fa2[_0xe4c4('0x52')][_0xe4c4('0x5d')]){_0x48e089[_0xe4c4('0x5b')]=_['merge'](_0x48e089[_0xe4c4('0x5b')],{'$or':_[_0xe4c4('0x4d')](_0x48e089['attributes'],function(_0x143ed6){var _0x32d704={};_0x32d704[_0x143ed6]={'$like':'%'+_0x209fa2['query']['filter']+'%'};return _0x32d704;})});}_0x48e089=_['merge']({},_0x48e089,_0x209fa2[_0xe4c4('0x60')]);return db['Disposition'][_0xe4c4('0x28')]({'where':_0x48e089[_0xe4c4('0x5b')]})[_0xe4c4('0x1c')](function(_0x5dc059){_0x3547d5[_0xe4c4('0x28')]=_0x5dc059;if(_0x209fa2[_0xe4c4('0x52')][_0xe4c4('0x61')]){_0x48e089['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x48e089);})[_0xe4c4('0x1c')](function(_0x1cf5d1){_0x3547d5[_0xe4c4('0x7b')]=_0x1cf5d1;return _0x3547d5;});}})['then'](respondWithFilteredResult(_0x4f3263,_0x48e089))[_0xe4c4('0x24')](handleError(_0x4f3263,null));};exports[_0xe4c4('0x7c')]=function(_0x3abfbc,_0x16d2af){return db[_0xe4c4('0x4e')]['find']({'where':{'id':_0x3abfbc[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x16d2af,null))[_0xe4c4('0x1c')](function(_0x54a2ef){if(_0x54a2ef){return _0x54a2ef[_0xe4c4('0x7c')](_0x3abfbc[_0xe4c4('0x52')][_0xe4c4('0x7d')]);}})['then'](respondWithStatusCode(_0x16d2af,null))[_0xe4c4('0x24')](handleError(_0x16d2af,null));};exports[_0xe4c4('0x7e')]=function(_0x47d67d,_0x36c0e5){if(_0x47d67d[_0xe4c4('0x66')]['id']){delete _0x47d67d[_0xe4c4('0x66')]['id'];}return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')]({'where':{'id':_0x47d67d[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x36c0e5,null))['then'](function(_0x54abc3){if(_0x54abc3){_0x47d67d[_0xe4c4('0x66')][_0xe4c4('0x7a')]=_0x54abc3['id'];return db[_0xe4c4('0x7f')][_0xe4c4('0x6b')](_0x47d67d[_0xe4c4('0x66')]);}})['then'](respondWithResult(_0x36c0e5,null))[_0xe4c4('0x24')](handleError(_0x36c0e5,null));};exports['getAnswers']=function(_0x133576,_0x44a173){var _0x3cfed6={'raw':![],'where':{}};var _0x582c12={};var _0x562aeb={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe4c4('0x79')]({'where':{'id':_0x133576[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x44a173,null))[_0xe4c4('0x1c')](function(_0x551d45){if(_0x551d45){_0x582c12[_0xe4c4('0x47')]=_[_0xe4c4('0x53')](db[_0xe4c4('0x7f')][_0xe4c4('0x4f')]);_0x582c12['query']=_[_0xe4c4('0x53')](_0x133576[_0xe4c4('0x52')]);_0x582c12['filters']=_['intersection'](_0x582c12['model'],_0x582c12[_0xe4c4('0x52')]);_0x3cfed6[_0xe4c4('0x55')]=_[_0xe4c4('0x65')](_0x582c12[_0xe4c4('0x47')],qs[_0xe4c4('0x56')](_0x133576[_0xe4c4('0x52')][_0xe4c4('0x56')]));_0x3cfed6[_0xe4c4('0x55')]=_0x3cfed6[_0xe4c4('0x55')][_0xe4c4('0x57')]?_0x3cfed6['attributes']:_0x582c12['model'];if(!_0x133576[_0xe4c4('0x52')][_0xe4c4('0x58')](_0xe4c4('0x80'))){_0x3cfed6['limit']=qs[_0xe4c4('0x27')](_0x133576[_0xe4c4('0x52')]['limit']);_0x3cfed6[_0xe4c4('0x29')]=qs['offset'](_0x133576[_0xe4c4('0x52')]['offset']);}_0x3cfed6[_0xe4c4('0x59')]=qs[_0xe4c4('0x5a')](_0x133576[_0xe4c4('0x52')][_0xe4c4('0x5a')]);_0x3cfed6[_0xe4c4('0x5b')]=qs['filters'](_['pick'](_0x133576[_0xe4c4('0x52')],_0x582c12['filters']));_0x3cfed6[_0xe4c4('0x5b')][_0xe4c4('0x7a')]=_0x551d45['id'];if(_0x133576[_0xe4c4('0x52')]['filter']){_0x3cfed6[_0xe4c4('0x5b')]=_['merge'](_0x3cfed6[_0xe4c4('0x5b')],{'$or':_['map'](_0x3cfed6['attributes'],function(_0x2fb74b){var _0x38aac8={};_0x38aac8[_0x2fb74b]={'$like':'%'+_0x133576[_0xe4c4('0x52')]['filter']+'%'};return _0x38aac8;})});}_0x3cfed6=_[_0xe4c4('0x5e')]({},_0x3cfed6,_0x133576[_0xe4c4('0x60')]);return db[_0xe4c4('0x7f')][_0xe4c4('0x28')]({'where':_0x3cfed6['where']})[_0xe4c4('0x1c')](function(_0x323dda){_0x562aeb[_0xe4c4('0x28')]=_0x323dda;if(_0x133576[_0xe4c4('0x52')]['includeAll']){_0x3cfed6['include']=[{'all':!![]}];}return db[_0xe4c4('0x7f')]['findAll'](_0x3cfed6);})[_0xe4c4('0x1c')](function(_0x4bde1c){_0x562aeb[_0xe4c4('0x7b')]=_0x4bde1c;return _0x562aeb;});}})[_0xe4c4('0x1c')](respondWithFilteredResult(_0x44a173,_0x3cfed6))['catch'](handleError(_0x44a173,null));};exports[_0xe4c4('0x81')]=function(_0x203bbf,_0x2072f2){return db[_0xe4c4('0x4e')]['find']({'where':{'id':_0x203bbf[_0xe4c4('0x64')]['id']}})['then'](handleEntityNotFound(_0x2072f2,null))['then'](function(_0x520297){if(_0x520297){return _0x520297['removeAnswers'](_0x203bbf[_0xe4c4('0x52')][_0xe4c4('0x7d')]);}})['then'](respondWithStatusCode(_0x2072f2,null))[_0xe4c4('0x24')](handleError(_0x2072f2,null));};exports[_0xe4c4('0x82')]=function(_0x2b7ebd,_0x311dda){_0x2b7ebd['body']['sitepic']=_0x2b7ebd[_0xe4c4('0x83')][_0xe4c4('0x84')];return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')]({'where':{'id':_0x2b7ebd['params']['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x311dda,null))[_0xe4c4('0x1c')](saveUpdates(_0x2b7ebd[_0xe4c4('0x66')],null))['then'](respondWithResult(_0x311dda,null))[_0xe4c4('0x24')](handleError(_0x311dda,null));};exports[_0xe4c4('0x85')]=function(_0x435e7e,_0x34c5c9){_0x435e7e[_0xe4c4('0x66')][_0xe4c4('0x86')]=_0x435e7e[_0xe4c4('0x83')][_0xe4c4('0x84')];return db['ChatWebsite'][_0xe4c4('0x6f')]({'where':{'id':_0x435e7e[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x34c5c9,null))['then'](saveUpdates(_0x435e7e[_0xe4c4('0x66')],null))[_0xe4c4('0x1c')](respondWithResult(_0x34c5c9,null))['catch'](handleError(_0x34c5c9,null));};exports[_0xe4c4('0x87')]=function(_0x49535a,_0x5cf0b3){_0x49535a[_0xe4c4('0x66')][_0xe4c4('0x88')]=_0x49535a[_0xe4c4('0x83')]['filename'];return db[_0xe4c4('0x4e')]['find']({'where':{'id':_0x49535a[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x5cf0b3,null))[_0xe4c4('0x1c')](saveUpdates(_0x49535a[_0xe4c4('0x66')],null))[_0xe4c4('0x1c')](respondWithResult(_0x5cf0b3,null))[_0xe4c4('0x24')](handleError(_0x5cf0b3,null));};exports['addSystemAvatar']=function(_0x34baa7,_0x38226e){_0x34baa7[_0xe4c4('0x66')][_0xe4c4('0x89')]=_0x34baa7[_0xe4c4('0x83')][_0xe4c4('0x84')];return db['ChatWebsite'][_0xe4c4('0x6f')]({'where':{'id':_0x34baa7[_0xe4c4('0x64')]['id']}})['then'](handleEntityNotFound(_0x38226e,null))[_0xe4c4('0x1c')](saveUpdates(_0x34baa7[_0xe4c4('0x66')],null))['then'](respondWithResult(_0x38226e,null))[_0xe4c4('0x24')](handleError(_0x38226e,null));};exports[_0xe4c4('0x8a')]=function(_0x4ff9b8,_0x6d730e){var _0x2e0157=path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],'server/files/images/logos/default_logo.svg');var _0x270ad7={'where':{'id':_0x4ff9b8[_0xe4c4('0x64')]['id']},'attributes':['id',_0xe4c4('0x8d')],'raw':!![]};var _0x2d8891=![];return require(_0xe4c4('0x8e'))[_0xe4c4('0x8f')]()[_0xe4c4('0x1c')](function(_0x452db2){if(_0x452db2){_0x2d8891=_0x452db2[_0xe4c4('0x90')];}})['then'](function(){return db['ChatWebsite']['find'](_0x270ad7);})[_0xe4c4('0x1c')](handleEntityNotFound(_0x6d730e,null))[_0xe4c4('0x1c')](function(_0x1fba21){if(_0x1fba21){if(!_['isNil'](_0x1fba21[_0xe4c4('0x8d')])){if(fs[_0xe4c4('0x91')](path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],_0xe4c4('0x92'),_0x1fba21[_0xe4c4('0x8d')]))&&_0x2d8891){_0x2e0157=path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],_0xe4c4('0x92'),_0x1fba21['sitepic']);}}return _0x6d730e[_0xe4c4('0x93')](_0x2e0157);}})[_0xe4c4('0x24')](handleError(_0x6d730e,null));};exports[_0xe4c4('0x94')]=function(_0x408dab,_0x26d412){var _0x249246=path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],_0xe4c4('0x95'));var _0x3a5fde={'where':{'id':_0x408dab[_0xe4c4('0x64')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')](_0x3a5fde)['then'](handleEntityNotFound(_0x26d412,null))[_0xe4c4('0x1c')](function(_0x11e8bb){if(_0x11e8bb){if(!_[_0xe4c4('0x96')](_0x11e8bb[_0xe4c4('0x86')])){if(fs[_0xe4c4('0x91')](path['join'](config['root'],_0xe4c4('0x97'),_0x11e8bb[_0xe4c4('0x86')]))){_0x249246=path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],_0xe4c4('0x97'),_0x11e8bb['agentAvatar']);}}return _0x26d412['download'](_0x249246);}})[_0xe4c4('0x24')](handleError(_0x26d412,null));};exports[_0xe4c4('0x98')]=function(_0x1a8895,_0x1ab570){var _0x2d1d44=path[_0xe4c4('0x8b')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x5c2d8e={'where':{'id':_0x1a8895[_0xe4c4('0x64')]['id']},'attributes':['id','customerAvatar',_0xe4c4('0x99')],'raw':!![]};return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')](_0x5c2d8e)[_0xe4c4('0x1c')](handleEntityNotFound(_0x1ab570,null))[_0xe4c4('0x1c')](function(_0x3c703b){if(_0x3c703b){if(!_['isNil'](_0x3c703b['customerAvatar'])){if(fs[_0xe4c4('0x91')](path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],'server/files/images/avatars/',_0x3c703b[_0xe4c4('0x88')]))&&_0x3c703b[_0xe4c4('0x99')]){_0x2d1d44=path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],'server/files/images/avatars/',_0x3c703b[_0xe4c4('0x88')]);}}return _0x1ab570[_0xe4c4('0x93')](_0x2d1d44);}})[_0xe4c4('0x24')](handleError(_0x1ab570,null));};exports['getSystemAvatar']=function(_0xc40381,_0x4e3287){var _0x2d7441=path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],_0xe4c4('0x9a'));var _0x16b4aa={'where':{'id':_0xc40381[_0xe4c4('0x64')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')](_0x16b4aa)[_0xe4c4('0x1c')](handleEntityNotFound(_0x4e3287,null))[_0xe4c4('0x1c')](function(_0x5c6509){if(_0x5c6509){if(!_[_0xe4c4('0x96')](_0x5c6509['systemAvatar'])){if(fs['existsSync'](path[_0xe4c4('0x8b')](config['root'],'server/files/images/avatars/',_0x5c6509[_0xe4c4('0x89')]))){_0x2d7441=path[_0xe4c4('0x8b')](config['root'],_0xe4c4('0x97'),_0x5c6509[_0xe4c4('0x89')]);}}return _0x4e3287[_0xe4c4('0x93')](_0x2d7441);}})[_0xe4c4('0x24')](handleError(_0x4e3287,null));};function checkWebsiteInterval(_0x530b01){var _0x45a14f=_0x530b01['Interval'];if(!_0x45a14f){return Promise[_0xe4c4('0x9b')](_0x530b01);}var _0x503a34=_0x530b01['timezone']||undefined;return _0x45a14f[_0xe4c4('0x9c')](_0x503a34)['then'](function(_0x4a45bf){if(!_0x4a45bf){throw new APIOutOfIntervalError();}return _0x530b01;});}exports[_0xe4c4('0x9d')]=function(_0x451f30,_0x1f7c17){var _0xcc2474={'body':_0x451f30[_0xe4c4('0x66')],'channel':_0xe4c4('0x9e')};var _0x27e90b=[];var _0x5a1e7e=[];var _0x4833f7={};var _0x230de7=![];if(_0x451f30['body']['id']){delete _0x451f30[_0xe4c4('0x66')]['id'];}if(_[_0xe4c4('0x96')](_0x451f30[_0xe4c4('0x66')][_0xe4c4('0x9f')])){throw new APIBadRequestError(_0xe4c4('0xa0'));}if(_[_0xe4c4('0x96')](_0x451f30[_0xe4c4('0x66')]['mapKey'])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0xe4c4('0xa1')](_0x451f30['body']['body'])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x48bdf0=_0x451f30['body'][_0xe4c4('0xa2')]&&_0x451f30[_0xe4c4('0x66')][_0xe4c4('0x40')];return db[_0xe4c4('0xa3')][_0xe4c4('0x75')]()[_0xe4c4('0x1c')](function(_0xfee08a){if(!_0xfee08a){throw new Error(_0xe4c4('0xa4'));}_0x27e90b=Object['keys'](_0xfee08a)['filter'](function(_0x44ef17){return![_0xe4c4('0xa5'),_0xe4c4('0xa6')][_0xe4c4('0xa7')](_0x44ef17);});_0x5a1e7e=Object[_0xe4c4('0x53')](_0xfee08a)[_0xe4c4('0x5d')](function(_0x3ffe55){return![_0xe4c4('0xa5'),_0xe4c4('0xa6'),_0xe4c4('0xa8'),_0xe4c4('0xa9')][_0xe4c4('0xa7')](_0x3ffe55);});if(!_['includes'](_0x5a1e7e,_0x451f30['body']['mapKey'])){throw new APIBadRequestError(_0xe4c4('0xaa')+_0x5a1e7e[_0xe4c4('0x8b')](',\x20'));}_0x4833f7[_0x451f30[_0xe4c4('0x66')]['mapKey']]=_0x451f30['body'][_0xe4c4('0x9f')];})[_0xe4c4('0x1c')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x451f30[_0xe4c4('0x64')]['id']},'include':[{'model':db[_0xe4c4('0xab')],'as':_0xe4c4('0xac'),'include':[{'model':db[_0xe4c4('0xa3')],'as':_0xe4c4('0xad'),'where':_0x4833f7,'limit':0x1,'order':[['updatedAt',_0xe4c4('0xae')]]}]},{'model':db[_0xe4c4('0xaf')],'as':_0xe4c4('0xb0')},{'model':db[_0xe4c4('0xb1')],'as':_0xe4c4('0xb1'),'include':[{'model':db['Interval'],'as':_0xe4c4('0xb2'),'attributes':['id',_0xe4c4('0xb3')],'raw':!![]}]}]});})[_0xe4c4('0x1c')](function(_0x39992d){if(!_0x39992d){throw new APINotFoundError(util[_0xe4c4('0x43')](_0xe4c4('0xb4'),_0x451f30[_0xe4c4('0x64')]['id']));}if(_0x48bdf0){return checkWebsiteInterval(_0x39992d);}return _0x39992d;})[_0xe4c4('0x1c')](function(_0x4956f5){_0xcc2474[_0xe4c4('0xb5')]=_0x4956f5;_0xcc2474[_0xe4c4('0xb6')]=_[_0xe4c4('0xb7')](_0x4956f5[_0xe4c4('0xb0')],[_0xe4c4('0xb8')],[_0xe4c4('0xb9')]);if(_0xcc2474[_0xe4c4('0xb5')][_0xe4c4('0xb0')]){delete _0xcc2474[_0xe4c4('0xb5')][_0xe4c4('0xb0')];}_0xcc2474['list']=_0x4956f5[_0xe4c4('0xac')]||{'id':_0x4956f5[_0xe4c4('0xa9')]};if(_0xcc2474['list']&&_0xcc2474['list'][_0xe4c4('0xad')][_0xe4c4('0x57')]){return _0xcc2474['list']['Contacts'][0x0];}var _0xd99041=_[_0xe4c4('0x13')](_0x451f30['body'],{'firstName':_0x451f30[_0xe4c4('0x66')][_0xe4c4('0x9f')],'ListId':_0x4956f5[_0xe4c4('0xa9')]});_0xd99041[_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xba')]]=_0x451f30[_0xe4c4('0x66')][_0xe4c4('0x9f')];return db[_0xe4c4('0xa3')][_0xe4c4('0x6b')](_0xd99041,{'fields':_0x27e90b,'raw':!![]});})['then'](function(_0x2b660c){_0xcc2474[_0xe4c4('0xbb')]=_0x2b660c;var _0x57bfe4=createInteractionObject(_0x451f30[_0xe4c4('0x64')]['id'],_0x451f30[_0xe4c4('0x66')],_0x451f30[_0xe4c4('0xbc')],_0x2b660c);var _0x1e0825={'ChatWebsiteId':_0x451f30[_0xe4c4('0x64')]['id']};if(_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xbd')]){_0x1e0825[_0xe4c4('0xbd')]=_0x451f30['body']['threadId'];_0x1e0825[_0xe4c4('0xbe')]=![];return db[_0xe4c4('0xbf')]['find']({'where':_0x1e0825})['then'](function(_0x203918){var _0x2409a1=_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xa2')]&&_0x451f30[_0xe4c4('0x66')]['referer'];if(_0x203918){_0x230de7=!![];return _0x203918;}else if(!_0x2409a1&&_0x203918&&_0x203918[_0xe4c4('0xbe')]){throw new APIConflictError(_0xe4c4('0xc0'));}_0x57bfe4['threadId']=_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xbd')];_0x57bfe4['externalUrl']=_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xc1')];return db[_0xe4c4('0xbf')]['create'](_0x57bfe4);});}_0x1e0825[_0xe4c4('0xc2')]=_0x2b660c['id'];if(_0x451f30['body'][_0xe4c4('0xc3')]&&_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xc3')]['id']){_0x1e0825['id']=_0x451f30['body'][_0xe4c4('0xc3')]['id'];return db[_0xe4c4('0xbf')][_0xe4c4('0x6f')]({'where':_0x1e0825})[_0xe4c4('0x1c')](function(_0x18b728){var _0x4066a0=_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xa2')]&&_0x451f30[_0xe4c4('0x66')][_0xe4c4('0x40')];if(!_0x4066a0&&_0x18b728&&_0x18b728['closed']){throw new APIConflictError(_0xe4c4('0xc0'));}else if(_0x18b728){_0x230de7=!![];return _0x18b728;}else{return db[_0xe4c4('0xbf')][_0xe4c4('0x6b')](_0x57bfe4);}});}return db[_0xe4c4('0xbf')][_0xe4c4('0x6b')](_0x57bfe4);})[_0xe4c4('0x1c')](function(_0x3414f3){if(!_0x230de7){return _0x3414f3;}var _0x1966f6={'from':(_0xcc2474[_0xe4c4('0xbb')]['firstName']||'')+'\x20'+(_0xcc2474[_0xe4c4('0xbb')][_0xe4c4('0x3e')]||'')};if(_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xbd')]&&_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xc4')]&&_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xbd')]!=_0x451f30[_0xe4c4('0x66')][_0xe4c4('0xc4')]){_0x1966f6[_0xe4c4('0xbd')]=_0x451f30[_0xe4c4('0x66')]['messageId'];}return _0x3414f3['update'](_0x1966f6);})['then'](function(_0x3e1c4a){_0xcc2474[_0xe4c4('0xc3')]=_0x3e1c4a['get']({'plain':!![]});_0xcc2474['interaction']['created']=!_0x230de7;if(_0xcc2474[_0xe4c4('0xc3')]['created']){if(_0xcc2474[_0xe4c4('0xb5')][_0xe4c4('0xc5')]){_0xcc2474[_0xe4c4('0xb6')][_0xe4c4('0xc6')]({'id':0x0,'priority':_0xcc2474[_0xe4c4('0xb6')][_0xe4c4('0x57')]+0x1,'app':_0xe4c4('0xc7'),'appdata':_0xe4c4('0xc8'),'interval':_0xe4c4('0xc9')});}}return db[_0xe4c4('0xca')][_0xe4c4('0x6b')]({'body':_0x451f30[_0xe4c4('0x66')][_0xe4c4('0x66')],'ChatWebsiteId':_0x451f30[_0xe4c4('0x64')]['id'],'ChatInteractionId':_0x3e1c4a['id'],'direction':'in','ContactId':_0xcc2474[_0xe4c4('0xbb')]['id'],'AttachmentId':_0x451f30[_0xe4c4('0x66')]['AttachmentId']});})[_0xe4c4('0x1c')](function(_0x12333a){_0xcc2474['message']=_0x12333a;if(!_0xcc2474[_0xe4c4('0xc3')][_0xe4c4('0xcb')]){return;}return db[_0xe4c4('0xcc')][_0xe4c4('0x6f')]({'attributes':['id',_0xe4c4('0x34')],'where':{'id':_0xcc2474[_0xe4c4('0xc3')][_0xe4c4('0xcb')]}});})[_0xe4c4('0x1c')](function(_0x5ea042){if(_0x5ea042){_0xcc2474['applications'][_0xe4c4('0xcd')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5ea042['name']+','+(_0xcc2474[_0xe4c4('0xb5')][_0xe4c4('0xce')]||0xa),'interval':_0xe4c4('0xc9')});_0xcc2474[_0xe4c4('0xcf')]=!![];}if(!_0xcc2474[_0xe4c4('0xc3')]['queueId']){return;}return db['ChatQueue'][_0xe4c4('0x6f')]({'attributes':['id',_0xe4c4('0x34')],'where':{'id':_0xcc2474[_0xe4c4('0xc3')][_0xe4c4('0xd0')]}});})[_0xe4c4('0x1c')](function(_0x211371){if(_0x211371){_0xcc2474['applications'][_0xe4c4('0xcd')]({'id':0x0,'priority':0x1,'app':_0xe4c4('0xd1'),'appdata':_0x211371[_0xe4c4('0x34')]+','+(_0xcc2474[_0xe4c4('0xb5')][_0xe4c4('0xd2')]||0x12c),'interval':_0xe4c4('0xc9')});}return respondWithRpcPromise(_0xe4c4('0xd3'),_0xe4c4('0xd4'),_0xcc2474);})[_0xe4c4('0x1c')](function(_0xe396a6){respondWithRpcPromise(_0xe4c4('0xd5'),_0xe4c4('0xd5'),{'event':_0xe4c4('0x9d'),'message':_0xe396a6},client9002);return _0xe396a6;})[_0xe4c4('0x1c')](respondWithResult(_0x1f7c17,null))[_0xe4c4('0x24')](APIHandleError(_0x1f7c17));};exports[_0xe4c4('0xd6')]=function(_0x2aa16e,_0x3f6e8d){var _0x51cd04,_0x23e102,_0x18973e;var _0x3651ec=[];var _0x50371={};var _0x20de1b=_0x2aa16e[_0xe4c4('0xd7')]||[];var _0x5a34fe=[];var _0x29ac6c;return db[_0xe4c4('0xa3')][_0xe4c4('0x75')]()['then'](function(_0x4b1e34){if(!_0x4b1e34){throw new db['Sequelize'][(_0xe4c4('0xd8'))](_0xe4c4('0xd9'));}_0x3651ec=_[_0xe4c4('0xda')](_[_0xe4c4('0x53')](_0x4b1e34),[_0xe4c4('0xa5'),'updatedAt','CompanyId',_0xe4c4('0xa9')]);if(_0x2aa16e[_0xe4c4('0x66')]['id']){delete _0x2aa16e[_0xe4c4('0x66')]['id'];}if(_['isNil'](_0x2aa16e[_0xe4c4('0x66')][_0xe4c4('0x9f')])){throw _0x3f6e8d[_0xe4c4('0x25')](0x1f4)['send'](new db[(_0xe4c4('0xdb'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xe4c4('0x96')](_0x2aa16e['body'][_0xe4c4('0x66')])||_0x2aa16e[_0xe4c4('0x66')][_0xe4c4('0x66')]===''){throw _0x3f6e8d['status'](0x1f4)[_0xe4c4('0x35')](new db[(_0xe4c4('0xdb'))][(_0xe4c4('0xd8'))](_0xe4c4('0xdc')));}if(_[_0xe4c4('0x96')](_0x2aa16e[_0xe4c4('0x66')][_0xe4c4('0xdd')])){throw _0x3f6e8d[_0xe4c4('0x25')](0x1f4)[_0xe4c4('0x35')](new db[(_0xe4c4('0xdb'))][(_0xe4c4('0xd8'))](_0xe4c4('0xde')+_0x3651ec));}if(!_['includes'](_0x3651ec,_0x2aa16e[_0xe4c4('0x66')][_0xe4c4('0xdd')])){throw _0x3f6e8d[_0xe4c4('0x25')](0x1f4)[_0xe4c4('0x35')](new db[(_0xe4c4('0xdb'))]['ValidationError'](_0xe4c4('0xdf')+_0x3651ec));}_0x50371[_0x2aa16e[_0xe4c4('0x66')][_0xe4c4('0xdd')]]=_0x2aa16e['body'][_0xe4c4('0x9f')];})[_0xe4c4('0x1c')](function(){return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')]({'where':{'id':_0x2aa16e[_0xe4c4('0x64')]['id']},'include':[{'model':db[_0xe4c4('0xab')],'as':_0xe4c4('0xac')},{'model':db[_0xe4c4('0xe0')],'as':_0xe4c4('0xe0')}]});})['then'](handleEntityNotFound(_0x3f6e8d,null))[_0xe4c4('0x1c')](function(_0x21cc1a){if(_0x21cc1a&&_0x21cc1a[_0xe4c4('0xac')]){_0x23e102=_0x21cc1a;var _0x41c0dc=_[_0xe4c4('0x13')](_0x2aa16e[_0xe4c4('0x66')],{'firstName':_0x2aa16e['body'][_0xe4c4('0x9f')],'phone':_0x2aa16e[_0xe4c4('0x66')][_0xe4c4('0x9f')],'ListId':_0x21cc1a['ListId']});_0x41c0dc[_0x2aa16e[_0xe4c4('0x66')][_0xe4c4('0xdd')]]=_0x2aa16e[_0xe4c4('0x66')]['from'];return db['CmContact'][_0xe4c4('0xe1')]({'where':_0x50371,'defaults':_0x41c0dc});}})[_0xe4c4('0xe2')](function(_0x3e4571){if(_0x3e4571){_0x18973e=_0x3e4571;var _0x5ea70c=fs[_0xe4c4('0xe3')](path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],'server/files/templates/chatOfflineMessage.ejs'),_0xe4c4('0xe4'));var _0x23d5d5=ejs[_0xe4c4('0xe5')](_0x5ea70c,{'body':_[_0xe4c4('0xe6')](_0x2aa16e[_0xe4c4('0x66')][_0xe4c4('0x66')]),'bodyTitle':_0x23e102['offlineMessageBody']});return db[_0xe4c4('0xe7')][_0xe4c4('0x6b')]({'body':_0x23d5d5,'plainBody':htmlToText[_0xe4c4('0xe8')](_0x23d5d5),'ContactId':_0x3e4571['id'],'ChatWebsiteId':_0x23e102['id']});}})[_0xe4c4('0x1c')](function(_0x134833){_0x29ac6c=_0x134833;if(_0x20de1b[_0xe4c4('0x57')]){var _0x1dd21c=_0x20de1b[_0xe4c4('0x4d')](function(_0x3d8da1){return{'name':_0x3d8da1[_0xe4c4('0xe9')],'basename':_0x3d8da1['filename'],'type':_0x3d8da1[_0xe4c4('0xea')],'ChatOfflineMessageId':_0x134833['id']};});_0x5a34fe=_0x1dd21c['map'](_0x1ac10e=>{var _0x50cb2b={'filename':_0x1ac10e[_0xe4c4('0x34')],'path':path['join'](config['root'],_0xe4c4('0xeb'),_0xe4c4('0xd7'),_0xe4c4('0xec'),_0xe4c4('0xed'),_0x1ac10e[_0xe4c4('0xee')])};return _0x50cb2b;});if(!_0x23e102[_0xe4c4('0xef')]){return db[_0xe4c4('0xf0')][_0xe4c4('0xf1')](function(_0x5ed12d){return db[_0xe4c4('0xf2')][_0xe4c4('0xf3')](_0x1dd21c,{'transaction':_0x5ed12d});});}}})[_0xe4c4('0x1c')](function(){if(_0x29ac6c){_0x51cd04=_0x29ac6c;return db[_0xe4c4('0xe0')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xe4c4('0xf4')],'as':_0xe4c4('0xf5'),'raw':!![],'include':[{'model':db[_0xe4c4('0xf6')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xe4c4('0x1c')](function(_0x2a7374){if(_0x2a7374&&_0x2a7374['Smtp']&&_0x23e102[_0xe4c4('0xf7')]&&_0x23e102['forwardOfflineAddress']){var _0x2ebef7=_0x2a7374[_0xe4c4('0xf8')]();return respondWithRpcPromise('SendMail',_0xe4c4('0xf9'),{'account':_0x2ebef7,'message':{'from':util[_0xe4c4('0x43')](_0xe4c4('0xfa'),_0x2a7374[_0xe4c4('0x34')],_0x2a7374[_0xe4c4('0xfb')]||_0x2a7374[_0xe4c4('0xf5')][_0xe4c4('0x6c')]),'to':_0x23e102[_0xe4c4('0xfc')],'subject':_0x23e102[_0xe4c4('0xfd')],'html':_0x51cd04[_0xe4c4('0x66')],'attachments':_0x5a34fe}},client9003)[_0xe4c4('0x1c')](function(){return _0x51cd04;})[_0xe4c4('0x24')](function(_0x307198){logger[_0xe4c4('0x22')](_0x307198);});}})[_0xe4c4('0x1c')](function(){if(_0x23e102&&_0x23e102[_0xe4c4('0xef')]&&_0x23e102['MailAccountId']){var _0x555318=[];if(_0x20de1b[_0xe4c4('0x57')]){_0x555318=_0x20de1b[_0xe4c4('0x4d')](function(_0x4d7fea){return{'name':_0x4d7fea[_0xe4c4('0xe9')],'basename':_0x4d7fea['filename'],'type':_0x4d7fea[_0xe4c4('0xea')],'ChatOfflineMessageId':_0x29ac6c['id']};});}var _0x4f78a6;if(!_[_0xe4c4('0x96')](_0x23e102[_0xe4c4('0xfe')])){var _0x290c62=_[_0xe4c4('0x4d')](_0x2aa16e[_0xe4c4('0x66')],function(_0x1e88dc){return _0x1e88dc;});var _0x1caed0=_[_0xe4c4('0xff')](_0x290c62)[0x0];var _0x6fd02e=_[_0xe4c4('0x100')](_0x1caed0,function(_0x55cfe3){return _0x55cfe3;});_0x4f78a6=_0x6fd02e[0x1][_0x23e102[_0xe4c4('0xfe')]];}var _0x550c69={'from':_0x18973e[_0xe4c4('0xfb')],'firstName':_0x18973e[_0xe4c4('0x3d')],'lastName':_0x18973e[_0xe4c4('0x3e')],'mapKey':_0xe4c4('0xfb'),'message':{'from':_0x18973e[_0xe4c4('0xfb')],'to':_0x23e102[_0xe4c4('0xe0')][_0xe4c4('0xfb')],'cc':'','subject':_[_0xe4c4('0x96')](_0x4f78a6)?_0x23e102[_0xe4c4('0xfd')]:_0x4f78a6,'messageId':'','sentAt':new Date(),'attach':_0x555318[_0xe4c4('0x57')],'attachments':_0x555318,'originChannel':'Chat','ChatWebsiteId':_0x23e102['id'],'ChatOfflineMessageId':_0x51cd04['id'],'originTo':_0x23e102['MailAccount']['email']},'body':_0x51cd04[_0xe4c4('0x66')]};var _0x2391a1={'account':{'id':_0x23e102['MailAccountId']},'body':_0x550c69,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xe4c4('0x101'),_0x2391a1,client9001)[_0xe4c4('0x1c')](function(){return _0x51cd04;})[_0xe4c4('0x24')](function(_0xda9160){logger[_0xe4c4('0x22')](_0xda9160);});}return;})[_0xe4c4('0x1c')](function(){if(_0x51cd04){return _0x51cd04;}})['then'](respondWithResult(_0x3f6e8d,null))[_0xe4c4('0x24')](function(){for(var _0x54b014 of _0x20de1b){var _0x340fd7=path[_0xe4c4('0x8b')](config['root'],_0xe4c4('0xeb'),_0xe4c4('0xd7'),_0xe4c4('0xec'),_0xe4c4('0xed'),_0x54b014[_0xe4c4('0x84')]);fs_extra[_0xe4c4('0x102')](_0x340fd7)[_0xe4c4('0x24')](function(_0x32cbd2){logger[_0xe4c4('0x22')](_0xe4c4('0x103'),_0x340fd7,_0x32cbd2);});}});};exports['addInteraction']=function(_0x536ff2,_0x2f71b7){return db['ChatInteraction']['find']({'where':{'id':_0x536ff2[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x2f71b7,null))[_0xe4c4('0x1c')](function(_0x3fcff1){if(_0x3fcff1){return _0x3fcff1[_0xe4c4('0x104')](_0x536ff2[_0xe4c4('0x66')][_0xe4c4('0x7d')],_['omit'](_0x536ff2[_0xe4c4('0x66')],[_0xe4c4('0x7d'),'id'])||{});}})['then'](respondWithResult(_0x2f71b7,null))[_0xe4c4('0x24')](handleError(_0x2f71b7,null));};exports[_0xe4c4('0x105')]=function(_0xf5aec6,_0x510361){var _0x16c203={'raw':![],'where':{}};var _0x289144={};var _0x112034={'count':0x0,'rows':[]};return db[_0xe4c4('0x4e')][_0xe4c4('0x79')]({'where':{'id':_0xf5aec6['params']['id']}})['then'](handleEntityNotFound(_0x510361,null))[_0xe4c4('0x1c')](function(_0x51b9a1){if(_0x51b9a1){_0x289144[_0xe4c4('0x47')]=_[_0xe4c4('0x53')](db[_0xe4c4('0xbf')]['rawAttributes']);_0x289144['query']=_[_0xe4c4('0x53')](_0xf5aec6[_0xe4c4('0x52')]);_0x289144['filters']=_[_0xe4c4('0x65')](_0x289144[_0xe4c4('0x47')],_0x289144[_0xe4c4('0x52')]);_0x16c203[_0xe4c4('0x55')]=_[_0xe4c4('0x65')](_0x289144[_0xe4c4('0x47')],qs[_0xe4c4('0x56')](_0xf5aec6[_0xe4c4('0x52')][_0xe4c4('0x56')]));_0x16c203[_0xe4c4('0x55')]=_0x16c203[_0xe4c4('0x55')]['length']?_0x16c203[_0xe4c4('0x55')]:_0x289144[_0xe4c4('0x47')];if(!_0xf5aec6['query']['hasOwnProperty'](_0xe4c4('0x80'))){_0x16c203['limit']=qs[_0xe4c4('0x27')](_0xf5aec6[_0xe4c4('0x52')]['limit']);_0x16c203[_0xe4c4('0x29')]=qs[_0xe4c4('0x29')](_0xf5aec6[_0xe4c4('0x52')][_0xe4c4('0x29')]);}_0x16c203['order']=qs[_0xe4c4('0x5a')](_0xf5aec6[_0xe4c4('0x52')][_0xe4c4('0x5a')]);_0x16c203[_0xe4c4('0x5b')]=qs[_0xe4c4('0x54')](_[_0xe4c4('0x5c')](_0xf5aec6['query'],_0x289144['filters']));_0x16c203['where'][_0xe4c4('0x7a')]=_0x51b9a1['id'];if(_0xf5aec6[_0xe4c4('0x52')][_0xe4c4('0x5d')]){_0x16c203['where']=_['merge'](_0x16c203['where'],{'$or':_[_0xe4c4('0x4d')](_0x16c203[_0xe4c4('0x55')],function(_0x33bf97){var _0x36eb7b={};_0x36eb7b[_0x33bf97]={'$like':'%'+_0xf5aec6[_0xe4c4('0x52')]['filter']+'%'};return _0x36eb7b;})});}_0x16c203=_[_0xe4c4('0x5e')]({},_0x16c203,_0xf5aec6[_0xe4c4('0x60')]);return db[_0xe4c4('0xbf')][_0xe4c4('0x28')]({'where':_0x16c203[_0xe4c4('0x5b')]})[_0xe4c4('0x1c')](function(_0x28fbe4){_0x112034[_0xe4c4('0x28')]=_0x28fbe4;if(_0xf5aec6[_0xe4c4('0x52')][_0xe4c4('0x61')]){_0x16c203[_0xe4c4('0x62')]=[{'model':db['CmContact'],'as':_0xe4c4('0x106'),'required':![]},{'model':db[_0xe4c4('0xcc')],'as':_0xe4c4('0x107'),'attributes':[_0xe4c4('0x34'),'fullname','internal'],'required':![]},{'model':db[_0xe4c4('0x108')],'as':_0xe4c4('0x109'),'attributes':['id','name',_0xe4c4('0x10a')],'where':_0xf5aec6['query']['tag']?{'id':_0xf5aec6[_0xe4c4('0x52')]['tag']}:undefined,'required':_0xf5aec6[_0xe4c4('0x52')][_0xe4c4('0x10b')]?!![]:![]}];}return db[_0xe4c4('0xbf')][_0xe4c4('0x10c')](_0x16c203);})['then'](function(_0x159193){_0x112034[_0xe4c4('0x7b')]=_0x159193;return _0x112034;});}})[_0xe4c4('0x1c')](respondWithFilteredResult(_0x510361,_0x16c203))[_0xe4c4('0x24')](handleError(_0x510361,null));};exports[_0xe4c4('0x10d')]=function(_0x4c5d8b,_0x152415){var _0x448614=0x0;var _0x2a117c=0x0;var _0x12a8bb=![];var _0x56c6e5;var _0x23e05d;return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')]({'where':{'id':_0x4c5d8b[_0xe4c4('0x64')]['id']},'include':[{'model':db['Interval'],'as':_0xe4c4('0xb1'),'include':[{'model':db[_0xe4c4('0xb1')],'as':'Intervals','attributes':['id','interval']}]}]})['then'](handleEntityNotFound(_0x152415,null))[_0xe4c4('0x1c')](function(_0x2d4e9d){if(_0x2d4e9d){_0x56c6e5=_0x2d4e9d;return _0x2d4e9d['getProactiveActions']({'raw':!![]});}})[_0xe4c4('0x1c')](function(_0x20f141){if(_0x56c6e5){if(_0x20f141){_0x23e05d=_0x20f141;}}return require(_0xe4c4('0x8e'))['getLicense']();})[_0xe4c4('0x1c')](function(_0x11822e){if(_0x11822e){_0x2a117c=_0x11822e[_0xe4c4('0x10e')];_0x12a8bb=_0x11822e['custom'];}})[_0xe4c4('0x1c')](function(){return db[_0xe4c4('0xbf')][_0xe4c4('0x28')]({'where':{'closed':![]}});})[_0xe4c4('0x1c')](function(_0x3dfbde){_0x448614=_0x3dfbde;if(_0x2a117c&&_0x3dfbde>_0x2a117c){return db[_0xe4c4('0x10f')]['findOne']({'where':{'id':0x1}})[_0xe4c4('0x1c')](function(_0x337c98){if(_0x337c98){_0x337c98[_0xe4c4('0x110')](_0xe4c4('0x111'));}});}})[_0xe4c4('0x1c')](function(){var _0x2f0bba=_0x56c6e5['Interval'];var _0xbbf169=_0x56c6e5['timezone']||undefined;return _0x2f0bba?_0x2f0bba[_0xe4c4('0x9c')](_0xbbf169):!![];})[_0xe4c4('0x1c')](function(_0x24123b){var _0x20525b=fs[_0xe4c4('0xe3')](path[_0xe4c4('0x8b')](config[_0xe4c4('0x8c')],_0xe4c4('0x112')),_0xe4c4('0xe4'));var _0x317e9c='3.13.0';var _0x49a26c=![];var _0x356750,_0xa27893;if(_0x4c5d8b[_0xe4c4('0xbc')][_0xe4c4('0x40')]){_0x356750=new URL(_0x4c5d8b[_0xe4c4('0xbc')][_0xe4c4('0x40')])['origin'];}else if(_0x4c5d8b[_0xe4c4('0xbc')][_0xe4c4('0x113')]){_0x356750=new URL(_0x4c5d8b[_0xe4c4('0xbc')][_0xe4c4('0x113')])[_0xe4c4('0x113')];}else{_0x356750=_0xe4c4('0x114');}_0xa27893=typeof _0x56c6e5[_0xe4c4('0x115')][_0xe4c4('0x67')](',')['find'](function(_0x425371){return wildcardUtils[_0xe4c4('0x116')](_0x425371,_0x356750);})!==_0xe4c4('0x26');var _0x24a913={'chatVersion':_0x317e9c,'chatWebsiteAddressOrigin':_0xa27893?_0x356750:_0x56c6e5[_0xe4c4('0x115')],'remote':_0x56c6e5[_0xe4c4('0x117')],'query':querystring[_0xe4c4('0x21')](_[_0xe4c4('0x5e')](_0x56c6e5[_0xe4c4('0x2e')]({'plain':!![]}),{'customerIp':_0x4c5d8b[_0xe4c4('0xbc')]['x-forwarded-for']||_0x4c5d8b['headers'][_0xe4c4('0x118')]||_0x4c5d8b[_0xe4c4('0x119')][_0xe4c4('0x11a')]||_0x4c5d8b['ip'],'referer':_0x4c5d8b[_0xe4c4('0xbc')]['referer'],'openedInteractions':_0x448614,'maxInteractions':_0x2a117c,'virtual':_0x12a8bb[_0xe4c4('0x10e')],'online':_0x24123b,'custom':_0x12a8bb,'address':_0xa27893?_0x356750:null}))[_0xe4c4('0x11b')](/'/g,'\x5c\x27')};_0x152415['send'](ejs[_0xe4c4('0xe5')](Mustache['render'](_0x20525b,_0x24a913),{'proactiveActions':_0x23e05d,'alignment':_0x56c6e5[_0xe4c4('0x11c')],'verticalAlignment':_0x56c6e5[_0xe4c4('0x11d')],'div_color':_0x56c6e5[_0xe4c4('0x10a')],'labelText':_0x56c6e5[_0xe4c4('0x11e')],'text_color':_0x56c6e5['textColor'],'text_button_color':_0x56c6e5[_0xe4c4('0x11f')],'button_color':_0x56c6e5[_0xe4c4('0x120')],'background_color':_0x56c6e5[_0xe4c4('0x121')],'hideWhenOffline':_0x56c6e5[_0xe4c4('0x122')],'intervalId':_0x56c6e5['IntervalId'],'isDevelopment':_0x49a26c,'chatVersion':_0x317e9c}));})['catch'](handleError(_0x152415,null));};exports['addApplications']=function(_0x126005,_0xb96ce3){var _0x2ea9db=_0x126005[_0xe4c4('0x64')]['id'];var _0x5e7645=_0x126005[_0xe4c4('0x66')];var _0x4cbd84=0xc8;var _0x5b643f=null;return db[_0xe4c4('0xf0')][_0xe4c4('0xf1')]({'isolationLevel':db['sequelize'][_0xe4c4('0x123')][_0xe4c4('0x124')][_0xe4c4('0x125')]},function(_0x1d38b5){return db[_0xe4c4('0x4e')][_0xe4c4('0x79')]({'where':{'id':_0x2ea9db},'transaction':_0x1d38b5})[_0xe4c4('0x1c')](function(_0x208072){if(_0x208072){return db['ChatApplication'][_0xe4c4('0x2d')]({'where':{'ChatWebsiteId':_0x2ea9db},'transaction':_0x1d38b5})[_0xe4c4('0x1c')](function(){var _0x4755ae=_[_0xe4c4('0x4d')](_0x5e7645,function(_0xe41510){_0xe41510['ChatWebsiteId']=_0x2ea9db;return _0xe41510;});return db[_0xe4c4('0xaf')][_0xe4c4('0xf3')](_0x4755ae,{'transaction':_0x1d38b5});});}else{_0x4cbd84=0x194;_0x5b643f=[];}});})[_0xe4c4('0x1c')](function(){if(_0x4cbd84!==0x194){return db[_0xe4c4('0xaf')][_0xe4c4('0x126')]({'where':{'ChatWebsiteId':_0x2ea9db},'order':_0xe4c4('0xb8')})[_0xe4c4('0x1c')](function(_0x5eb819){_0x5b643f=_0x5eb819;});}})['catch'](function(_0x20fda7){_0x4cbd84=0x1f4;logger[_0xe4c4('0x22')](_0x20fda7[_0xe4c4('0x33')]);if(_0x20fda7[_0xe4c4('0x34')]){delete _0x20fda7[_0xe4c4('0x34')];}_0x5b643f=_0x20fda7;})[_0xe4c4('0x127')](function(){if(_0x5b643f===null){_0xb96ce3[_0xe4c4('0x32')](_0x4cbd84);}else{if(_0x4cbd84===0x1f4){_0xb96ce3[_0xe4c4('0x25')](_0x4cbd84)[_0xe4c4('0x35')](_0x5b643f);}else{_0xb96ce3[_0xe4c4('0x25')](_0x4cbd84)[_0xe4c4('0x2b')](_0x5b643f);}}});};exports[_0xe4c4('0x128')]=function(_0xa09e1a,_0x38b6e8){var _0x12b809={};var _0x3aff06={};var _0x4cf50f;var _0x494ed6;return db['ChatWebsite']['findOne']({'where':{'id':_0xa09e1a['params']['id']}})['then'](handleEntityNotFound(_0x38b6e8,null))[_0xe4c4('0x1c')](function(_0x2bda6e){if(_0x2bda6e){_0x4cf50f=_0x2bda6e;_0x3aff06[_0xe4c4('0x47')]=_['keys'](db[_0xe4c4('0xaf')][_0xe4c4('0x4f')]);_0x3aff06[_0xe4c4('0x52')]=_[_0xe4c4('0x53')](_0xa09e1a[_0xe4c4('0x52')]);_0x3aff06['filters']=_[_0xe4c4('0x65')](_0x3aff06[_0xe4c4('0x47')],_0x3aff06['query']);_0x12b809[_0xe4c4('0x55')]=_['intersection'](_0x3aff06['model'],qs[_0xe4c4('0x56')](_0xa09e1a[_0xe4c4('0x52')][_0xe4c4('0x56')]));_0x12b809['attributes']=_0x12b809['attributes'][_0xe4c4('0x57')]?_0x12b809['attributes']:_0x3aff06['model'];_0x12b809['order']=qs[_0xe4c4('0x5a')](_0xa09e1a['query']['sort']);_0x12b809[_0xe4c4('0x5b')]=qs[_0xe4c4('0x54')](_[_0xe4c4('0x5c')](_0xa09e1a[_0xe4c4('0x52')],_0x3aff06[_0xe4c4('0x54')]));if(_0xa09e1a['query'][_0xe4c4('0x5d')]){_0x12b809[_0xe4c4('0x5b')]=_[_0xe4c4('0x5e')](_0x12b809[_0xe4c4('0x5b')],{'$or':_[_0xe4c4('0x4d')](_0x12b809['attributes'],function(_0xd23315){var _0x31a65a={};_0x31a65a[_0xd23315]={'$like':'%'+_0xa09e1a[_0xe4c4('0x52')]['filter']+'%'};return _0x31a65a;})});}_0x12b809=_['merge']({},_0x12b809,_0xa09e1a[_0xe4c4('0x60')]);return _0x4cf50f[_0xe4c4('0x128')](_0x12b809);}})[_0xe4c4('0x1c')](function(_0x2f2a4b){if(_0x2f2a4b){_0x494ed6=_0x2f2a4b[_0xe4c4('0x57')];if(!_0xa09e1a['query'][_0xe4c4('0x58')](_0xe4c4('0x80'))){_0x12b809[_0xe4c4('0x27')]=qs['limit'](_0xa09e1a[_0xe4c4('0x52')][_0xe4c4('0x27')]);_0x12b809[_0xe4c4('0x29')]=qs[_0xe4c4('0x29')](_0xa09e1a['query'][_0xe4c4('0x29')]);}return _0x4cf50f[_0xe4c4('0x128')](_0x12b809);}})[_0xe4c4('0x1c')](function(_0xe5c907){if(_0xe5c907){return _0xe5c907?{'count':_0x494ed6,'rows':_0xe5c907}:null;}})[_0xe4c4('0x1c')](respondWithResult(_0x38b6e8,null))[_0xe4c4('0x24')](handleError(_0x38b6e8,null));};exports[_0xe4c4('0x129')]=function(_0x2cb743,_0x532964){return db[_0xe4c4('0x12a')][_0xe4c4('0x6f')]({'where':{'id':_0x2cb743['params']['id']}})['then'](handleEntityNotFound(_0x532964,null))['then'](function(_0x32a888){if(_0x32a888){return _0x32a888['addProactiveActions'](_0x2cb743[_0xe4c4('0x66')][_0xe4c4('0x7d')],_[_0xe4c4('0x12b')](_0x2cb743[_0xe4c4('0x66')],[_0xe4c4('0x7d'),'id'])||{});}})[_0xe4c4('0x1c')](respondWithResult(_0x532964,null))[_0xe4c4('0x24')](handleError(_0x532964,null));};exports[_0xe4c4('0x12c')]=function(_0x5ea4a1,_0x398b00){var _0x1227c={};var _0x3169dd={};var _0x2ec4b0;var _0x20a4a6;return db['ChatWebsite'][_0xe4c4('0x79')]({'where':{'id':_0x5ea4a1[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x398b00,null))[_0xe4c4('0x1c')](function(_0x5af309){if(_0x5af309){_0x2ec4b0=_0x5af309;_0x3169dd[_0xe4c4('0x47')]=_[_0xe4c4('0x53')](db[_0xe4c4('0x12d')]['rawAttributes']);_0x3169dd['query']=_[_0xe4c4('0x53')](_0x5ea4a1[_0xe4c4('0x52')]);_0x3169dd[_0xe4c4('0x54')]=_[_0xe4c4('0x65')](_0x3169dd[_0xe4c4('0x47')],_0x3169dd[_0xe4c4('0x52')]);_0x1227c[_0xe4c4('0x55')]=_[_0xe4c4('0x65')](_0x3169dd[_0xe4c4('0x47')],qs['fields'](_0x5ea4a1[_0xe4c4('0x52')]['fields']));_0x1227c[_0xe4c4('0x55')]=_0x1227c[_0xe4c4('0x55')][_0xe4c4('0x57')]?_0x1227c['attributes']:_0x3169dd[_0xe4c4('0x47')];_0x1227c['order']=qs['sort'](_0x5ea4a1['query'][_0xe4c4('0x5a')]);_0x1227c['where']=qs[_0xe4c4('0x54')](_[_0xe4c4('0x5c')](_0x5ea4a1[_0xe4c4('0x52')],_0x3169dd['filters']));if(_0x5ea4a1['query']['filter']){_0x1227c[_0xe4c4('0x5b')]=_['merge'](_0x1227c[_0xe4c4('0x5b')],{'$or':_[_0xe4c4('0x4d')](_0x1227c[_0xe4c4('0x55')],function(_0x318271){var _0x393e92={};_0x393e92[_0x318271]={'$like':'%'+_0x5ea4a1[_0xe4c4('0x52')]['filter']+'%'};return _0x393e92;})});}_0x1227c=_['merge']({},_0x1227c,_0x5ea4a1['options']);return _0x2ec4b0['getProactiveActions'](_0x1227c);}})[_0xe4c4('0x1c')](function(_0x157422){if(_0x157422){_0x20a4a6=_0x157422[_0xe4c4('0x57')];if(!_0x5ea4a1['query'][_0xe4c4('0x58')](_0xe4c4('0x80'))){_0x1227c[_0xe4c4('0x27')]=qs[_0xe4c4('0x27')](_0x5ea4a1[_0xe4c4('0x52')]['limit']);_0x1227c[_0xe4c4('0x29')]=qs['offset'](_0x5ea4a1[_0xe4c4('0x52')][_0xe4c4('0x29')]);}return _0x2ec4b0[_0xe4c4('0x12c')](_0x1227c);}})[_0xe4c4('0x1c')](function(_0x19985e){if(_0x19985e){return _0x19985e?{'count':_0x20a4a6,'rows':_0x19985e}:null;}})[_0xe4c4('0x1c')](respondWithResult(_0x398b00,null))[_0xe4c4('0x24')](handleError(_0x398b00,null));};exports['getFields']=function(_0x163d02,_0x214f2c){var _0x409b67=_0x163d02[_0xe4c4('0x52')]['online']===_0xe4c4('0x12e')?'offlineForm':_0xe4c4('0x12f');return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')]({'attributes':['id',_0x409b67],'where':{'id':_0x163d02['params']['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x214f2c,null))['then'](function(_0x57c62a){if(_0x57c62a){var _0x5369cf=_0x57c62a[_0x409b67];var _0x37e72d=_0x5369cf&&_0x5369cf[_0xe4c4('0x130')]?_0x5369cf[_0xe4c4('0x130')]:[];_0x214f2c[_0xe4c4('0x35')]({'fromKey':_[_0xe4c4('0x96')](_0x5369cf[_0xe4c4('0x131')])?undefined:_0x5369cf[_0xe4c4('0x131')],'count':_0x37e72d[_0xe4c4('0x57')],'rows':_0x37e72d});}})[_0xe4c4('0x24')](handleError(_0x214f2c,null));};exports[_0xe4c4('0x132')]=function(_0x481af5,_0x6536c0){var _0x41b65a={'raw':![],'where':{}};var _0x3082={};var _0x10aaa={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe4c4('0x79')]({'where':{'id':_0x481af5[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x6536c0,null))[_0xe4c4('0x1c')](function(_0x4cfffa){if(_0x4cfffa){_0x3082[_0xe4c4('0x47')]=_['keys'](db['ChatOfflineMessage'][_0xe4c4('0x4f')]);_0x3082[_0xe4c4('0x52')]=_['keys'](_0x481af5[_0xe4c4('0x52')]);_0x3082[_0xe4c4('0x54')]=_[_0xe4c4('0x65')](_0x3082[_0xe4c4('0x47')],_0x3082[_0xe4c4('0x52')]);_0x41b65a[_0xe4c4('0x55')]=_[_0xe4c4('0x65')](_0x3082[_0xe4c4('0x47')],qs[_0xe4c4('0x56')](_0x481af5['query']['fields']));_0x41b65a['attributes']=_0x41b65a[_0xe4c4('0x55')][_0xe4c4('0x57')]?_0x41b65a[_0xe4c4('0x55')]:_0x3082[_0xe4c4('0x47')];if(!_0x481af5['query'][_0xe4c4('0x58')](_0xe4c4('0x80'))){_0x41b65a['limit']=qs[_0xe4c4('0x27')](_0x481af5[_0xe4c4('0x52')][_0xe4c4('0x27')]);_0x41b65a['offset']=qs[_0xe4c4('0x29')](_0x481af5[_0xe4c4('0x52')][_0xe4c4('0x29')]);}_0x41b65a[_0xe4c4('0x59')]=qs['sort'](_0x481af5[_0xe4c4('0x52')][_0xe4c4('0x5a')]);_0x41b65a[_0xe4c4('0x5b')]=qs[_0xe4c4('0x54')](_[_0xe4c4('0x5c')](_0x481af5[_0xe4c4('0x52')],_0x3082[_0xe4c4('0x54')]));_0x41b65a[_0xe4c4('0x5b')][_0xe4c4('0x7a')]=_0x4cfffa['id'];if(_0x481af5[_0xe4c4('0x52')][_0xe4c4('0x5d')]){_0x41b65a[_0xe4c4('0x5b')]=_['merge'](_0x41b65a[_0xe4c4('0x5b')],{'$or':_[_0xe4c4('0x4d')](_0x41b65a[_0xe4c4('0x55')],function(_0x41f839){var _0x4d79b2={};_0x4d79b2[_0x41f839]={'$like':'%'+_0x481af5[_0xe4c4('0x52')][_0xe4c4('0x5d')]+'%'};return _0x4d79b2;})});}_0x41b65a=_[_0xe4c4('0x5e')]({},_0x41b65a,_0x481af5[_0xe4c4('0x60')]);return db[_0xe4c4('0xe7')][_0xe4c4('0x28')]({'where':_0x41b65a[_0xe4c4('0x5b')]})[_0xe4c4('0x1c')](function(_0x153150){_0x10aaa[_0xe4c4('0x28')]=_0x153150;if(_0x481af5[_0xe4c4('0x52')][_0xe4c4('0x61')]){_0x41b65a[_0xe4c4('0x62')]=[{'all':!![]}];}else{_0x41b65a['include']=[{'model':db[_0xe4c4('0xa3')],'as':_0xe4c4('0x106'),'required':![]},{'model':db[_0xe4c4('0xf2')],'as':_0xe4c4('0x133'),'required':![]}];}return db[_0xe4c4('0xe7')][_0xe4c4('0x10c')](_0x41b65a);})[_0xe4c4('0x1c')](function(_0x35e938){_0x10aaa[_0xe4c4('0x7b')]=_0x35e938;return _0x10aaa;});}})[_0xe4c4('0x1c')](respondWithFilteredResult(_0x6536c0,_0x41b65a))[_0xe4c4('0x24')](handleError(_0x6536c0,null));};exports['addAgents']=function(_0x256ef6,_0x392ae0){return db[_0xe4c4('0x4e')][_0xe4c4('0x6f')]({'where':{'id':_0x256ef6['params']['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x392ae0,null))[_0xe4c4('0x1c')](function(_0x34167a){if(_0x34167a){return _0x34167a[_0xe4c4('0x134')](_0x256ef6[_0xe4c4('0x66')]['ids'],_['omit'](_0x256ef6['body'],[_0xe4c4('0x7d'),'id'])||{})[_0xe4c4('0xe2')](function(_0x1be484){for(var _0x307beb=0x0;_0x307beb<_0x256ef6['body'][_0xe4c4('0x7d')]['length'];_0x307beb+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x256ef6['body'][_0xe4c4('0x7d')][_0x307beb]),'ChatWebsiteId':Number(_0x256ef6[_0xe4c4('0x64')]['id'])});}return _0x1be484;});}})[_0xe4c4('0x1c')](respondWithResult(_0x392ae0,null))[_0xe4c4('0x24')](handleError(_0x392ae0,null));};exports[_0xe4c4('0x135')]=function(_0x443ddb,_0x701cee){return db['ChatWebsite'][_0xe4c4('0x6f')]({'where':{'id':_0x443ddb[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x701cee,null))[_0xe4c4('0x1c')](function(_0x592bdc){if(_0x592bdc){return _0x592bdc[_0xe4c4('0x135')](_0x443ddb[_0xe4c4('0x52')][_0xe4c4('0x7d')])['then'](function(){if(_[_0xe4c4('0x136')](_0x443ddb[_0xe4c4('0x52')][_0xe4c4('0x7d')])){for(var _0x2d0d03=0x0;_0x2d0d03<_0x443ddb['query']['ids'][_0xe4c4('0x57')];_0x2d0d03+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x443ddb['query']['ids'][_0x2d0d03]),'ChatWebsiteId':Number(_0x443ddb[_0xe4c4('0x64')]['id'])});}}else{socket[_0xe4c4('0x137')]('userChatWebsite:remove',{'UserId':Number(_0x443ddb[_0xe4c4('0x52')][_0xe4c4('0x7d')]),'ChatWebsiteId':Number(_0x443ddb['params']['id'])});}});}})[_0xe4c4('0x1c')](respondWithStatusCode(_0x701cee,null))[_0xe4c4('0x24')](handleError(_0x701cee,null));};exports[_0xe4c4('0x138')]=function(_0x7a58c6,_0x530584){var _0x2e66c1={};var _0x36660e={};var _0x560404;var _0x49af45;return db[_0xe4c4('0x4e')][_0xe4c4('0x79')]({'where':{'id':_0x7a58c6[_0xe4c4('0x64')]['id']}})[_0xe4c4('0x1c')](handleEntityNotFound(_0x530584,null))[_0xe4c4('0x1c')](function(_0x4fdbb3){if(_0x4fdbb3){_0x560404=_0x4fdbb3;_0x36660e[_0xe4c4('0x47')]=_[_0xe4c4('0x53')](db[_0xe4c4('0xcc')][_0xe4c4('0x4f')]);_0x36660e[_0xe4c4('0x52')]=_[_0xe4c4('0x53')](_0x7a58c6[_0xe4c4('0x52')]);_0x36660e['filters']=_['intersection'](_0x36660e[_0xe4c4('0x47')],_0x36660e[_0xe4c4('0x52')]);_0x2e66c1[_0xe4c4('0x55')]=_[_0xe4c4('0x65')](_0x36660e['model'],qs[_0xe4c4('0x56')](_0x7a58c6[_0xe4c4('0x52')][_0xe4c4('0x56')]));_0x2e66c1['attributes']=_0x2e66c1['attributes']['length']?_0x2e66c1[_0xe4c4('0x55')]:_0x36660e[_0xe4c4('0x47')];_0x2e66c1[_0xe4c4('0x59')]=qs[_0xe4c4('0x5a')](_0x7a58c6[_0xe4c4('0x52')][_0xe4c4('0x5a')]);_0x2e66c1[_0xe4c4('0x5b')]=qs[_0xe4c4('0x54')](_[_0xe4c4('0x5c')](_0x7a58c6['query'],_0x36660e[_0xe4c4('0x54')]));if(_0x7a58c6[_0xe4c4('0x52')][_0xe4c4('0x5d')]){_0x2e66c1[_0xe4c4('0x5b')]=_['merge'](_0x2e66c1['where'],{'$or':_['map'](_0x2e66c1[_0xe4c4('0x55')],function(_0x30c149){var _0x1ab071={};_0x1ab071[_0x30c149]={'$like':'%'+_0x7a58c6[_0xe4c4('0x52')][_0xe4c4('0x5d')]+'%'};return _0x1ab071;})});}_0x2e66c1=_[_0xe4c4('0x5e')]({},_0x2e66c1,_0x7a58c6['options']);return _0x560404[_0xe4c4('0x138')](_0x2e66c1);}})['then'](function(_0x5e01f9){if(_0x5e01f9){_0x49af45=_0x5e01f9[_0xe4c4('0x57')];if(!_0x7a58c6[_0xe4c4('0x52')][_0xe4c4('0x58')]('nolimit')){_0x2e66c1[_0xe4c4('0x27')]=qs[_0xe4c4('0x27')](_0x7a58c6[_0xe4c4('0x52')][_0xe4c4('0x27')]);_0x2e66c1[_0xe4c4('0x29')]=qs[_0xe4c4('0x29')](_0x7a58c6['query'][_0xe4c4('0x29')]);}return _0x560404[_0xe4c4('0x138')](_0x2e66c1);}})[_0xe4c4('0x1c')](function(_0x405627){if(_0x405627){return _0x405627?{'count':_0x49af45,'rows':_0x405627}:null;}})['then'](respondWithResult(_0x530584,null))['catch'](handleError(_0x530584,null));};
\ No newline at end of file
+var _0x81bd=['autoclose','close','*,*,*,*','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','ChatQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','ValidationError','no\x20available\x20attributes','difference','CompanyId','Sequelize','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','List','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','files','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','Smtp','mimetype','subjectOffline','mapValues','offlineMessageSubject','Chat','MailAccountId','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','virtual','custom','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.13.0','headers','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','spread','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','api','../../config/environment','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','redis','defaults','localhost','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','destroy','UserProfileResource','name','send','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','model','device','vendor','%s\x20%s\x20%s','type','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','params','Pause','options','find','create','body','address','forEach','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','getDispositions','findAll','rows','removeDispositions','ids','ChatWebsiteId','CannedAnswer','getAnswers','findOne','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','notify','chat','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','createdAt','includes','updatedAt','ListId','from','CmList','CmContact','Contacts','DESC','ChatApplication','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','priority','asc','list','contact','threadId','closed','externalUrl','ContactId','interaction','ChatInteraction','Writing\x20on\x20closed\x20interaction','messageId','created'];(function(_0x503b03,_0x216a86){var _0x8a53d6=function(_0x85e932){while(--_0x85e932){_0x503b03['push'](_0x503b03['shift']());}};_0x8a53d6(++_0x216a86);}(_0x81bd,0x7c));var _0xd81b=function(_0x427502,_0x4e6214){_0x427502=_0x427502-0x0;var _0x1baeff=_0x81bd[_0x427502];return _0x1baeff;};'use strict';var Mustache=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var path=require(_0xd81b('0x2'));var ejs=require(_0xd81b('0x3'));var fs=require('fs');var fs_extra=require(_0xd81b('0x4'));var _=require(_0xd81b('0x5'));var querystring=require(_0xd81b('0x6'));var htmlToText=require('html-to-text');var Redis=require(_0xd81b('0x7'));var jayson=require(_0xd81b('0x8'));var qs=require(_0xd81b('0x9'));var logger=require('../../config/logger')(_0xd81b('0xa'));var config=require(_0xd81b('0xb'));var APIBadRequestError=require(_0xd81b('0xc'))['APIBadRequestError'];var APINotFoundError=require('../../errors/api')[_0xd81b('0xd')];var APIOutOfIntervalError=require('../../errors/api')[_0xd81b('0xe')];var APIHandleError=require(_0xd81b('0xc'))[_0xd81b('0xf')];var APIConflictError=require(_0xd81b('0xc'))[_0xd81b('0x10')];var wildcardUtils=require(_0xd81b('0x11'));var URL=require(_0xd81b('0x12'))[_0xd81b('0x13')];var db=require(_0xd81b('0x14'))['db'];config[_0xd81b('0x15')]=_[_0xd81b('0x16')](config[_0xd81b('0x15')],{'host':_0xd81b('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd81b('0x15')]));require('./chatWebsite.socket')[_0xd81b('0x18')](socket);var client=jayson[_0xd81b('0x19')]['http']({'port':0x232c});var client9002=jayson[_0xd81b('0x19')]['http']({'port':0x232a});var client9003=jayson[_0xd81b('0x19')][_0xd81b('0x1a')]({'port':0x232b});var client9001=jayson[_0xd81b('0x19')][_0xd81b('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0x128162,_0x552215,_0x1c620d,_0x27b7a0){return new Promise(function(_0x5c2863,_0x2abef4){var _0x26df61=_0x27b7a0||client;return _0x26df61[_0xd81b('0x1b')](_0x128162,_0x1c620d)[_0xd81b('0x1c')](function(_0x5f7db6){logger[_0xd81b('0x1d')](_0xd81b('0x1e'),_0x552215,_0xd81b('0x1f'));logger[_0xd81b('0x20')](_0xd81b('0x21'),_0x552215,_0xd81b('0x1f'),JSON[_0xd81b('0x22')](_0x5f7db6));if(_0x5f7db6[_0xd81b('0x23')]){if(_0x5f7db6[_0xd81b('0x23')][_0xd81b('0x24')]===0x1f4){logger[_0xd81b('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x552215,_0x5f7db6['error'][_0xd81b('0x25')]);return _0x2abef4(_0x5f7db6[_0xd81b('0x23')][_0xd81b('0x25')]);}logger['error'](_0xd81b('0x1e'),_0x552215,_0x5f7db6[_0xd81b('0x23')]['message']);return _0x5c2863(_0x5f7db6[_0xd81b('0x23')][_0xd81b('0x25')]);}else{logger[_0xd81b('0x1d')](_0xd81b('0x1e'),_0x552215,_0xd81b('0x1f'));_0x5c2863(_0x5f7db6[_0xd81b('0x26')][_0xd81b('0x25')]);}})[_0xd81b('0x27')](function(_0x341aec){logger[_0xd81b('0x23')](_0xd81b('0x1e'),_0x552215,_0x341aec);_0x2abef4(_0x341aec);});});}function respondWithStatusCode(_0x1bf351,_0x596389){_0x596389=_0x596389||0xcc;return function(_0x28768f){if(_0x28768f){return _0x1bf351[_0xd81b('0x28')](_0x596389);}return _0x1bf351[_0xd81b('0x29')](_0x596389)[_0xd81b('0x2a')]();};}function respondWithResult(_0x3266c2,_0x2d0d02){_0x2d0d02=_0x2d0d02||0xc8;return function(_0x3e28dd){if(_0x3e28dd){return _0x3266c2[_0xd81b('0x29')](_0x2d0d02)[_0xd81b('0x2b')](_0x3e28dd);}};}function respondWithFilteredResult(_0x483a3d,_0x469cc4){return function(_0x4e2eff){if(_0x4e2eff){var _0x5c8aee=typeof _0x469cc4[_0xd81b('0x2c')]===_0xd81b('0x2d')&&typeof _0x469cc4['limit']==='undefined';var _0x4093c8=_0x4e2eff[_0xd81b('0x2e')];var _0x1b1434=_0x5c8aee?0x0:_0x469cc4[_0xd81b('0x2c')];var _0x1a1572=_0x5c8aee?_0x4e2eff[_0xd81b('0x2e')]:_0x469cc4['offset']+_0x469cc4[_0xd81b('0x2f')];var _0x26f629;if(_0x1a1572>=_0x4093c8){_0x1a1572=_0x4093c8;_0x26f629=0xc8;}else{_0x26f629=0xce;}_0x483a3d['status'](_0x26f629);return _0x483a3d['set'](_0xd81b('0x30'),_0x1b1434+'-'+_0x1a1572+'/'+_0x4093c8)[_0xd81b('0x2b')](_0x4e2eff);}return null;};}function saveUpdates(_0x50472a){return function(_0x50ce25){if(_0x50ce25){return _0x50ce25['update'](_0x50472a)[_0xd81b('0x1c')](function(_0x3ead68){return _0x3ead68;});}return null;};}function removeEntity(_0x1d2f46){return function(_0x1c4cf7){if(_0x1c4cf7){return _0x1c4cf7[_0xd81b('0x31')]()[_0xd81b('0x1c')](function(){var _0x29aabf=_0x1c4cf7['get']({'plain':!![]});var _0x28782f='ChatWebsites';return db[_0xd81b('0x32')][_0xd81b('0x31')]({'where':{'type':_0x28782f,'resourceId':_0x29aabf['id']}})[_0xd81b('0x1c')](function(){return _0x1c4cf7;});})[_0xd81b('0x1c')](function(){_0x1d2f46[_0xd81b('0x29')](0xcc)[_0xd81b('0x2a')]();});}};}function handleEntityNotFound(_0x1c20d3){return function(_0x2d23b9){if(!_0x2d23b9){_0x1c20d3[_0xd81b('0x28')](0x194);}return _0x2d23b9;};}function handleError(_0xe88a33,_0x1be4e2){_0x1be4e2=_0x1be4e2||0x1f4;return function(_0x3c8371){logger[_0xd81b('0x23')](_0x3c8371['stack']);if(_0x3c8371['name']){delete _0x3c8371[_0xd81b('0x33')];}_0xe88a33[_0xd81b('0x29')](_0x1be4e2)[_0xd81b('0x34')](_0x3c8371);};}function createInteractionObject(_0x59c066,_0x362ebc,_0x37ba34,_0x5a236a){var _0x46f058=require(_0xd81b('0x35'));var _0x512e39=new _0x46f058();var _0xed5272=_0x512e39['setUA'](_0x37ba34[_0xd81b('0x36')])[_0xd81b('0x37')]();var _0x203365=_0x362ebc[_0xd81b('0x38')];if(_0x37ba34['cf-connecting-ip']){_0x203365=_0x37ba34[_0xd81b('0x39')];}else if(_0x37ba34[_0xd81b('0x3a')]){_0x203365=_[_0xd81b('0x3b')](_0x37ba34[_0xd81b('0x3a')][_0xd81b('0x3c')](','));}return{'ContactId':_0x5a236a['id'],'ChatWebsiteId':_0x59c066,'from':(_0x5a236a[_0xd81b('0x3d')]||'')+'\x20'+(_0x5a236a[_0xd81b('0x3e')]||''),'customerIp':_0x203365,'customerPort':_0x37ba34['x-real-port']?_0x37ba34[_0xd81b('0x3f')]:null,'referer':_0x362ebc[_0xd81b('0x40')],'browserName':_0xed5272[_0xd81b('0x41')]['name']&&_0xed5272[_0xd81b('0x41')][_0xd81b('0x42')]?util[_0xd81b('0x43')](_0xd81b('0x44'),_0xed5272[_0xd81b('0x41')]['name'],_0xed5272[_0xd81b('0x41')][_0xd81b('0x42')]):_0xd81b('0x45'),'browserVersion':_0xed5272[_0xd81b('0x41')][_0xd81b('0x42')]||_0xd81b('0x45'),'osName':util[_0xd81b('0x43')](_0xd81b('0x44'),_0xed5272['os'][_0xd81b('0x33')],_0xed5272['os'][_0xd81b('0x42')]),'osVersion':_0xed5272['os'][_0xd81b('0x42')],'deviceModel':_0xed5272['device'][_0xd81b('0x46')]&&_0xed5272[_0xd81b('0x47')][_0xd81b('0x48')]?util[_0xd81b('0x43')](_0xd81b('0x49'),_0xed5272[_0xd81b('0x47')][_0xd81b('0x46')],_0xed5272[_0xd81b('0x47')]['vendor'],_0xed5272['device'][_0xd81b('0x4a')]):null,'deviceVendor':_0xed5272[_0xd81b('0x47')][_0xd81b('0x48')],'deviceType':_0xed5272[_0xd81b('0x47')][_0xd81b('0x4a')],'formData':JSON[_0xd81b('0x22')](_0x362ebc)};}exports[_0xd81b('0x4b')]=function(_0x2e44f3,_0x2fa588){var _0xcfbbc2={'include':[{'model':db['Pause'],'as':_0xd81b('0x4c')}]},_0x41e2e6={},_0x38e436={'count':0x0,'rows':[]};var _0x2b61fc=_[_0xd81b('0x4d')](db[_0xd81b('0x4e')][_0xd81b('0x4f')],function(_0x410ef3){return{'name':_0x410ef3[_0xd81b('0x50')],'type':_0x410ef3[_0xd81b('0x4a')][_0xd81b('0x51')]};});_0x41e2e6['model']=_[_0xd81b('0x4d')](_0x2b61fc,_0xd81b('0x33'));_0x41e2e6[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0x2e44f3['query']);_0x41e2e6[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x41e2e6[_0xd81b('0x46')],_0x41e2e6[_0xd81b('0x52')]);_0xcfbbc2[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x41e2e6[_0xd81b('0x46')],qs[_0xd81b('0x57')](_0x2e44f3[_0xd81b('0x52')]['fields']));_0xcfbbc2['attributes']=_0xcfbbc2[_0xd81b('0x56')][_0xd81b('0x58')]?_0xcfbbc2[_0xd81b('0x56')]:_0x41e2e6[_0xd81b('0x46')];if(!_0x2e44f3[_0xd81b('0x52')][_0xd81b('0x59')](_0xd81b('0x5a'))){_0xcfbbc2[_0xd81b('0x2f')]=qs['limit'](_0x2e44f3[_0xd81b('0x52')][_0xd81b('0x2f')]);_0xcfbbc2[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0x2e44f3[_0xd81b('0x52')]['offset']);}_0xcfbbc2[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x2e44f3['query'][_0xd81b('0x5c')]);_0xcfbbc2[_0xd81b('0x5d')]=qs[_0xd81b('0x54')](_[_0xd81b('0x5e')](_0x2e44f3[_0xd81b('0x52')],_0x41e2e6[_0xd81b('0x54')]),_0x2b61fc);if(_0x2e44f3[_0xd81b('0x52')][_0xd81b('0x5f')]){_0xcfbbc2[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0xcfbbc2[_0xd81b('0x5d')],{'$or':_['map'](_0x2b61fc,function(_0x285e82){if(_0x285e82['type']!==_0xd81b('0x61')){var _0x7b438c={};_0x7b438c[_0x285e82[_0xd81b('0x33')]]={'$like':'%'+_0x2e44f3[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x7b438c;}})});}_0xcfbbc2=_[_0xd81b('0x60')]({},_0xcfbbc2,_0x2e44f3['options']);var _0x2d978d={'where':_0xcfbbc2[_0xd81b('0x5d')]};return db['ChatWebsite']['count'](_0x2d978d)[_0xd81b('0x1c')](function(_0x59e018){_0x38e436[_0xd81b('0x2e')]=_0x59e018;if(_0x2e44f3['query'][_0xd81b('0x62')]){_0xcfbbc2[_0xd81b('0x63')]=[{'all':!![]}];}return db[_0xd81b('0x4e')]['findAll'](_0xcfbbc2);})[_0xd81b('0x1c')](function(_0x10ed99){_0x38e436['rows']=_0x10ed99;return _0x38e436;})[_0xd81b('0x1c')](respondWithFilteredResult(_0x2fa588,_0xcfbbc2))[_0xd81b('0x27')](handleError(_0x2fa588,null));};exports['show']=function(_0x1ba5d6,_0x5e1cd7){var _0x3c9264={'raw':![],'where':{'id':_0x1ba5d6[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0x65')],'as':_0xd81b('0x4c')}]},_0x31553e={};_0x31553e[_0xd81b('0x46')]=_[_0xd81b('0x53')](db[_0xd81b('0x4e')][_0xd81b('0x4f')]);_0x31553e[_0xd81b('0x52')]=_['keys'](_0x1ba5d6[_0xd81b('0x52')]);_0x31553e[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x31553e[_0xd81b('0x46')],_0x31553e[_0xd81b('0x52')]);_0x3c9264[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x31553e['model'],qs['fields'](_0x1ba5d6['query'][_0xd81b('0x57')]));_0x3c9264[_0xd81b('0x56')]=_0x3c9264[_0xd81b('0x56')][_0xd81b('0x58')]?_0x3c9264[_0xd81b('0x56')]:_0x31553e[_0xd81b('0x46')];if(_0x1ba5d6[_0xd81b('0x52')]['includeAll']){_0x3c9264[_0xd81b('0x63')]=[{'all':!![]}];}_0x3c9264=_[_0xd81b('0x60')]({},_0x3c9264,_0x1ba5d6[_0xd81b('0x66')]);return db[_0xd81b('0x4e')][_0xd81b('0x67')](_0x3c9264)[_0xd81b('0x1c')](handleEntityNotFound(_0x5e1cd7,null))[_0xd81b('0x1c')](respondWithResult(_0x5e1cd7,null))['catch'](handleError(_0x5e1cd7,null));};exports[_0xd81b('0x68')]=function(_0x15f003,_0x12b2a7){var _0x8cf25d=null;_0x15f003[_0xd81b('0x69')][_0xd81b('0x6a')][_0xd81b('0x3c')](',')[_0xd81b('0x6b')](_0x8fa8cd=>{if(_0x8fa8cd[_0xd81b('0x6c')]()!==''&&!wildcardUtils[_0xd81b('0x6d')](_0x8fa8cd[_0xd81b('0x6c')]())){_0x8cf25d=new APIBadRequestError('\x22'+_0x8fa8cd['trim']()+_0xd81b('0x6e'));}});if(_0x8cf25d){return handleError(_0x12b2a7,null)(_0x8cf25d);}return db['ChatWebsite'][_0xd81b('0x68')](_0x15f003[_0xd81b('0x69')],{})[_0xd81b('0x1c')](function(_0xc3c117){var _0xb94a69=_0x15f003[_0xd81b('0x6f')][_0xd81b('0x70')]({'plain':!![]});if(!_0xb94a69)throw new Error(_0xd81b('0x71'));if(_0xb94a69[_0xd81b('0x72')]===_0xd81b('0x6f')){var _0x5bcfd7=_0xc3c117[_0xd81b('0x70')]({'plain':!![]});var _0x344c32=_0xd81b('0x73');return db[_0xd81b('0x74')][_0xd81b('0x67')]({'where':{'name':_0x344c32,'userProfileId':_0xb94a69['userProfileId']},'raw':!![]})['then'](function(_0x3274d2){if(_0x3274d2&&_0x3274d2[_0xd81b('0x75')]===0x0){return db[_0xd81b('0x32')][_0xd81b('0x68')]({'name':_0x5bcfd7[_0xd81b('0x33')],'resourceId':_0x5bcfd7['id'],'type':_0x3274d2[_0xd81b('0x33')],'sectionId':_0x3274d2['id']},{})[_0xd81b('0x1c')](function(){return _0xc3c117;});}else{return _0xc3c117;}})['catch'](function(_0x2190df){logger[_0xd81b('0x23')](_0xd81b('0x76'),_0x2190df);throw _0x2190df;});}return _0xc3c117;})[_0xd81b('0x1c')](respondWithResult(_0x12b2a7,0xc9))[_0xd81b('0x27')](handleError(_0x12b2a7,null));};exports[_0xd81b('0x77')]=function(_0x1e0da3,_0x185f28){var _0x2315db=null;_0x1e0da3['body'][_0xd81b('0x6a')][_0xd81b('0x3c')](',')[_0xd81b('0x6b')](_0x9c30e7=>{if(_0x9c30e7[_0xd81b('0x6c')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x9c30e7[_0xd81b('0x6c')]())){_0x2315db=new APIBadRequestError('\x22'+_0x9c30e7[_0xd81b('0x6c')]()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x2315db){return handleError(_0x185f28,null)(_0x2315db);}if(_0x1e0da3[_0xd81b('0x69')]['id']){delete _0x1e0da3[_0xd81b('0x69')]['id'];}return db['ChatWebsite'][_0xd81b('0x67')]({'where':{'id':_0x1e0da3[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0x65')],'as':'mandatoryDispositionPause'}]})[_0xd81b('0x1c')](handleEntityNotFound(_0x185f28,null))[_0xd81b('0x1c')](saveUpdates(_0x1e0da3[_0xd81b('0x69')],null))['then'](respondWithResult(_0x185f28,null))['catch'](handleError(_0x185f28,null));};exports[_0xd81b('0x31')]=function(_0x950cc3,_0x36c694){return db['ChatWebsite'][_0xd81b('0x67')]({'where':{'id':_0x950cc3[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x36c694,null))[_0xd81b('0x1c')](removeEntity(_0x36c694,null))['catch'](handleError(_0x36c694,null));};exports['describe']=function(_0x42ae01,_0x256696){return db[_0xd81b('0x4e')][_0xd81b('0x78')]()['then'](respondWithResult(_0x256696,null))[_0xd81b('0x27')](handleError(_0x256696,null));};exports[_0xd81b('0x79')]=function(_0x4b8294,_0x46e36b){if(_0x4b8294['body']['id']){delete _0x4b8294[_0xd81b('0x69')]['id'];}return db[_0xd81b('0x4e')]['find']({'where':{'id':_0x4b8294[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x46e36b,null))[_0xd81b('0x1c')](function(_0x2490f1){if(_0x2490f1){_0x4b8294[_0xd81b('0x69')]['ChatWebsiteId']=_0x2490f1['id'];return db[_0xd81b('0x7a')][_0xd81b('0x68')](_0x4b8294[_0xd81b('0x69')]);}})[_0xd81b('0x1c')](respondWithResult(_0x46e36b,null))[_0xd81b('0x27')](handleError(_0x46e36b,null));};exports[_0xd81b('0x7b')]=function(_0x579052,_0x5c8ea0){var _0x31509d={'raw':![],'where':{}};var _0x3023d9={};var _0x97bd3e={'count':0x0,'rows':[]};return db[_0xd81b('0x4e')]['findOne']({'where':{'id':_0x579052[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x5c8ea0,null))[_0xd81b('0x1c')](function(_0x195f1c){if(_0x195f1c){_0x3023d9[_0xd81b('0x46')]=_['keys'](db[_0xd81b('0x7a')][_0xd81b('0x4f')]);_0x3023d9[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0x579052[_0xd81b('0x52')]);_0x3023d9[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x3023d9['model'],_0x3023d9[_0xd81b('0x52')]);_0x31509d[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x3023d9[_0xd81b('0x46')],qs[_0xd81b('0x57')](_0x579052[_0xd81b('0x52')]['fields']));_0x31509d[_0xd81b('0x56')]=_0x31509d['attributes'][_0xd81b('0x58')]?_0x31509d[_0xd81b('0x56')]:_0x3023d9[_0xd81b('0x46')];if(!_0x579052['query'][_0xd81b('0x59')](_0xd81b('0x5a'))){_0x31509d[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x579052[_0xd81b('0x52')][_0xd81b('0x2f')]);_0x31509d['offset']=qs[_0xd81b('0x2c')](_0x579052['query']['offset']);}_0x31509d[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x579052[_0xd81b('0x52')]['sort']);_0x31509d[_0xd81b('0x5d')]=qs[_0xd81b('0x54')](_[_0xd81b('0x5e')](_0x579052[_0xd81b('0x52')],_0x3023d9[_0xd81b('0x54')]));_0x31509d[_0xd81b('0x5d')]['ChatWebsiteId']=_0x195f1c['id'];if(_0x579052[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x31509d[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x31509d[_0xd81b('0x5d')],{'$or':_[_0xd81b('0x4d')](_0x31509d[_0xd81b('0x56')],function(_0x270d82){var _0x380951={};_0x380951[_0x270d82]={'$like':'%'+_0x579052[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x380951;})});}_0x31509d=_[_0xd81b('0x60')]({},_0x31509d,_0x579052[_0xd81b('0x66')]);return db[_0xd81b('0x7a')][_0xd81b('0x2e')]({'where':_0x31509d['where']})[_0xd81b('0x1c')](function(_0x47f90e){_0x97bd3e[_0xd81b('0x2e')]=_0x47f90e;if(_0x579052[_0xd81b('0x52')][_0xd81b('0x62')]){_0x31509d[_0xd81b('0x63')]=[{'all':!![]}];}return db[_0xd81b('0x7a')][_0xd81b('0x7c')](_0x31509d);})['then'](function(_0x3a41e6){_0x97bd3e[_0xd81b('0x7d')]=_0x3a41e6;return _0x97bd3e;});}})[_0xd81b('0x1c')](respondWithFilteredResult(_0x5c8ea0,_0x31509d))[_0xd81b('0x27')](handleError(_0x5c8ea0,null));};exports[_0xd81b('0x7e')]=function(_0x6e4c25,_0x2481e9){return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x6e4c25[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x2481e9,null))[_0xd81b('0x1c')](function(_0x5a02f7){if(_0x5a02f7){return _0x5a02f7[_0xd81b('0x7e')](_0x6e4c25[_0xd81b('0x52')][_0xd81b('0x7f')]);}})[_0xd81b('0x1c')](respondWithStatusCode(_0x2481e9,null))[_0xd81b('0x27')](handleError(_0x2481e9,null));};exports['addAnswer']=function(_0x421c2b,_0x1e61d8){if(_0x421c2b[_0xd81b('0x69')]['id']){delete _0x421c2b[_0xd81b('0x69')]['id'];}return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x421c2b['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x1e61d8,null))['then'](function(_0x4461f3){if(_0x4461f3){_0x421c2b[_0xd81b('0x69')][_0xd81b('0x80')]=_0x4461f3['id'];return db[_0xd81b('0x81')]['create'](_0x421c2b[_0xd81b('0x69')]);}})[_0xd81b('0x1c')](respondWithResult(_0x1e61d8,null))['catch'](handleError(_0x1e61d8,null));};exports[_0xd81b('0x82')]=function(_0x142d78,_0x2c1a0e){var _0x1c6291={'raw':![],'where':{}};var _0x2f9a9f={};var _0x4c8925={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd81b('0x83')]({'where':{'id':_0x142d78['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x2c1a0e,null))['then'](function(_0x509001){if(_0x509001){_0x2f9a9f[_0xd81b('0x46')]=_[_0xd81b('0x53')](db['CannedAnswer']['rawAttributes']);_0x2f9a9f[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0x142d78['query']);_0x2f9a9f[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x2f9a9f[_0xd81b('0x46')],_0x2f9a9f[_0xd81b('0x52')]);_0x1c6291['attributes']=_[_0xd81b('0x55')](_0x2f9a9f[_0xd81b('0x46')],qs[_0xd81b('0x57')](_0x142d78['query']['fields']));_0x1c6291[_0xd81b('0x56')]=_0x1c6291[_0xd81b('0x56')][_0xd81b('0x58')]?_0x1c6291[_0xd81b('0x56')]:_0x2f9a9f[_0xd81b('0x46')];if(!_0x142d78['query']['hasOwnProperty'](_0xd81b('0x5a'))){_0x1c6291[_0xd81b('0x2f')]=qs['limit'](_0x142d78['query'][_0xd81b('0x2f')]);_0x1c6291[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0x142d78[_0xd81b('0x52')][_0xd81b('0x2c')]);}_0x1c6291[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x142d78[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x1c6291[_0xd81b('0x5d')]=qs['filters'](_['pick'](_0x142d78[_0xd81b('0x52')],_0x2f9a9f[_0xd81b('0x54')]));_0x1c6291[_0xd81b('0x5d')][_0xd81b('0x80')]=_0x509001['id'];if(_0x142d78[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x1c6291[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x1c6291[_0xd81b('0x5d')],{'$or':_[_0xd81b('0x4d')](_0x1c6291[_0xd81b('0x56')],function(_0x32e484){var _0x30fb62={};_0x30fb62[_0x32e484]={'$like':'%'+_0x142d78[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x30fb62;})});}_0x1c6291=_['merge']({},_0x1c6291,_0x142d78[_0xd81b('0x66')]);return db[_0xd81b('0x81')][_0xd81b('0x2e')]({'where':_0x1c6291['where']})[_0xd81b('0x1c')](function(_0x3bd28c){_0x4c8925[_0xd81b('0x2e')]=_0x3bd28c;if(_0x142d78[_0xd81b('0x52')][_0xd81b('0x62')]){_0x1c6291['include']=[{'all':!![]}];}return db[_0xd81b('0x81')][_0xd81b('0x7c')](_0x1c6291);})[_0xd81b('0x1c')](function(_0x30fe56){_0x4c8925[_0xd81b('0x7d')]=_0x30fe56;return _0x4c8925;});}})[_0xd81b('0x1c')](respondWithFilteredResult(_0x2c1a0e,_0x1c6291))[_0xd81b('0x27')](handleError(_0x2c1a0e,null));};exports[_0xd81b('0x84')]=function(_0x1c3ea4,_0x282e83){return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x1c3ea4['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x282e83,null))[_0xd81b('0x1c')](function(_0x15d52d){if(_0x15d52d){return _0x15d52d['removeAnswers'](_0x1c3ea4[_0xd81b('0x52')][_0xd81b('0x7f')]);}})[_0xd81b('0x1c')](respondWithStatusCode(_0x282e83,null))[_0xd81b('0x27')](handleError(_0x282e83,null));};exports['addLogo']=function(_0x1e5f94,_0x4e037b){_0x1e5f94['body'][_0xd81b('0x85')]=_0x1e5f94[_0xd81b('0x86')][_0xd81b('0x87')];return db[_0xd81b('0x4e')]['find']({'where':{'id':_0x1e5f94['params']['id']}})['then'](handleEntityNotFound(_0x4e037b,null))[_0xd81b('0x1c')](saveUpdates(_0x1e5f94[_0xd81b('0x69')],null))[_0xd81b('0x1c')](respondWithResult(_0x4e037b,null))[_0xd81b('0x27')](handleError(_0x4e037b,null));};exports[_0xd81b('0x88')]=function(_0x36611b,_0x368fc6){_0x36611b[_0xd81b('0x69')][_0xd81b('0x89')]=_0x36611b[_0xd81b('0x86')][_0xd81b('0x87')];return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x36611b[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x368fc6,null))[_0xd81b('0x1c')](saveUpdates(_0x36611b[_0xd81b('0x69')],null))[_0xd81b('0x1c')](respondWithResult(_0x368fc6,null))[_0xd81b('0x27')](handleError(_0x368fc6,null));};exports[_0xd81b('0x8a')]=function(_0x4c6848,_0x1162c0){_0x4c6848[_0xd81b('0x69')][_0xd81b('0x8b')]=_0x4c6848[_0xd81b('0x86')][_0xd81b('0x87')];return db['ChatWebsite'][_0xd81b('0x67')]({'where':{'id':_0x4c6848[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x1162c0,null))[_0xd81b('0x1c')](saveUpdates(_0x4c6848[_0xd81b('0x69')],null))[_0xd81b('0x1c')](respondWithResult(_0x1162c0,null))[_0xd81b('0x27')](handleError(_0x1162c0,null));};exports[_0xd81b('0x8c')]=function(_0x11b49d,_0x22e808){_0x11b49d[_0xd81b('0x69')][_0xd81b('0x8d')]=_0x11b49d[_0xd81b('0x86')][_0xd81b('0x87')];return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x11b49d[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x22e808,null))[_0xd81b('0x1c')](saveUpdates(_0x11b49d['body'],null))[_0xd81b('0x1c')](respondWithResult(_0x22e808,null))[_0xd81b('0x27')](handleError(_0x22e808,null));};exports[_0xd81b('0x8e')]=function(_0x478b92,_0xf13081){var _0x3069d1=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/logos/default_logo.svg');var _0x2a6dcb={'where':{'id':_0x478b92[_0xd81b('0x64')]['id']},'attributes':['id',_0xd81b('0x85')],'raw':!![]};var _0xf2e1b5=![];return require(_0xd81b('0x91'))[_0xd81b('0x92')]()[_0xd81b('0x1c')](function(_0x55384e){if(_0x55384e){_0xf2e1b5=_0x55384e['custom'];}})[_0xd81b('0x1c')](function(){return db[_0xd81b('0x4e')][_0xd81b('0x67')](_0x2a6dcb);})['then'](handleEntityNotFound(_0xf13081,null))[_0xd81b('0x1c')](function(_0x5189b8){if(_0x5189b8){if(!_[_0xd81b('0x93')](_0x5189b8[_0xd81b('0x85')])){if(fs[_0xd81b('0x94')](path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x95'),_0x5189b8[_0xd81b('0x85')]))&&_0xf2e1b5){_0x3069d1=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/logos/',_0x5189b8[_0xd81b('0x85')]);}}return _0xf13081[_0xd81b('0x96')](_0x3069d1);}})[_0xd81b('0x27')](handleError(_0xf13081,null));};exports['getAvatar']=function(_0x4b2b45,_0x4d44d7){var _0x3c5ea6=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x97'));var _0x175d02={'where':{'id':_0x4b2b45[_0xd81b('0x64')]['id']},'attributes':['id',_0xd81b('0x89')],'raw':!![]};return db['ChatWebsite'][_0xd81b('0x67')](_0x175d02)[_0xd81b('0x1c')](handleEntityNotFound(_0x4d44d7,null))[_0xd81b('0x1c')](function(_0x361d5a){if(_0x361d5a){if(!_['isNil'](_0x361d5a[_0xd81b('0x89')])){if(fs['existsSync'](path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x98'),_0x361d5a['agentAvatar']))){_0x3c5ea6=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/avatars/',_0x361d5a[_0xd81b('0x89')]);}}return _0x4d44d7['download'](_0x3c5ea6);}})[_0xd81b('0x27')](handleError(_0x4d44d7,null));};exports[_0xd81b('0x99')]=function(_0x10449f,_0x539668){var _0x277379=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x9a'));var _0x1e2612={'where':{'id':_0x10449f[_0xd81b('0x64')]['id']},'attributes':['id','customerAvatar',_0xd81b('0x9b')],'raw':!![]};return db[_0xd81b('0x4e')][_0xd81b('0x67')](_0x1e2612)['then'](handleEntityNotFound(_0x539668,null))[_0xd81b('0x1c')](function(_0xc9bdfe){if(_0xc9bdfe){if(!_[_0xd81b('0x93')](_0xc9bdfe[_0xd81b('0x8b')])){if(fs[_0xd81b('0x94')](path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/avatars/',_0xc9bdfe['customerAvatar']))&&_0xc9bdfe['showCustomerAvatar']){_0x277379=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/avatars/',_0xc9bdfe[_0xd81b('0x8b')]);}}return _0x539668['download'](_0x277379);}})['catch'](handleError(_0x539668,null));};exports[_0xd81b('0x9c')]=function(_0x397d26,_0x335713){var _0x1b18ef=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x9d'));var _0x13e25f={'where':{'id':_0x397d26[_0xd81b('0x64')]['id']},'attributes':['id',_0xd81b('0x8d')],'raw':!![]};return db[_0xd81b('0x4e')][_0xd81b('0x67')](_0x13e25f)[_0xd81b('0x1c')](handleEntityNotFound(_0x335713,null))[_0xd81b('0x1c')](function(_0x4283bd){if(_0x4283bd){if(!_['isNil'](_0x4283bd[_0xd81b('0x8d')])){if(fs[_0xd81b('0x94')](path['join'](config[_0xd81b('0x90')],'server/files/images/avatars/',_0x4283bd[_0xd81b('0x8d')]))){_0x1b18ef=path['join'](config[_0xd81b('0x90')],_0xd81b('0x98'),_0x4283bd[_0xd81b('0x8d')]);}}return _0x335713[_0xd81b('0x96')](_0x1b18ef);}})[_0xd81b('0x27')](handleError(_0x335713,null));};function checkWebsiteInterval(_0x2164d4){var _0x7e3d22=_0x2164d4[_0xd81b('0x9e')];if(!_0x7e3d22){return Promise[_0xd81b('0x9f')](_0x2164d4);}var _0x1b0156=_0x2164d4[_0xd81b('0xa0')]||undefined;return _0x7e3d22[_0xd81b('0xa1')](_0x1b0156)['then'](function(_0x8cda4b){if(!_0x8cda4b){throw new APIOutOfIntervalError();}return _0x2164d4;});}exports[_0xd81b('0xa2')]=function(_0x22dd20,_0x2ea321){var _0x305014={'body':_0x22dd20[_0xd81b('0x69')],'channel':_0xd81b('0xa3')};var _0x10382d=[];var _0x282942=[];var _0x24a88b={};var _0x48e6ba=![];if(_0x22dd20[_0xd81b('0x69')]['id']){delete _0x22dd20[_0xd81b('0x69')]['id'];}if(_['isNil'](_0x22dd20[_0xd81b('0x69')]['from'])){throw new APIBadRequestError(_0xd81b('0xa4'));}if(_[_0xd81b('0x93')](_0x22dd20['body'][_0xd81b('0xa5')])){throw new APIBadRequestError(_0xd81b('0xa6'));}if(_[_0xd81b('0xa7')](_0x22dd20[_0xd81b('0x69')]['body'])){throw new APIBadRequestError(_0xd81b('0xa8'));}var _0x3a248d=_0x22dd20[_0xd81b('0x69')][_0xd81b('0x38')]&&_0x22dd20[_0xd81b('0x69')][_0xd81b('0x40')];return db['CmContact'][_0xd81b('0x78')]()[_0xd81b('0x1c')](function(_0x14a219){if(!_0x14a219){throw new Error('No\x20available\x20attributes');}_0x10382d=Object['keys'](_0x14a219)[_0xd81b('0x5f')](function(_0x322771){return![_0xd81b('0xa9'),'updatedAt'][_0xd81b('0xaa')](_0x322771);});_0x282942=Object[_0xd81b('0x53')](_0x14a219)[_0xd81b('0x5f')](function(_0x4719f3){return![_0xd81b('0xa9'),_0xd81b('0xab'),'CompanyId',_0xd81b('0xac')][_0xd81b('0xaa')](_0x4719f3);});if(!_['includes'](_0x282942,_0x22dd20[_0xd81b('0x69')][_0xd81b('0xa5')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x282942[_0xd81b('0x8f')](',\x20'));}_0x24a88b[_0x22dd20[_0xd81b('0x69')][_0xd81b('0xa5')]]=_0x22dd20[_0xd81b('0x69')][_0xd81b('0xad')];})[_0xd81b('0x1c')](function(){return db[_0xd81b('0x4e')]['find']({'where':{'id':_0x22dd20[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0xae')],'as':'List','include':[{'model':db[_0xd81b('0xaf')],'as':_0xd81b('0xb0'),'where':_0x24a88b,'limit':0x1,'order':[['updatedAt',_0xd81b('0xb1')]]}]},{'model':db[_0xd81b('0xb2')],'as':_0xd81b('0xb3')},{'model':db[_0xd81b('0x9e')],'as':_0xd81b('0x9e'),'include':[{'model':db['Interval'],'as':_0xd81b('0xb4'),'attributes':['id',_0xd81b('0xb5')],'raw':!![]}]}]});})[_0xd81b('0x1c')](function(_0x9658e){if(!_0x9658e){throw new APINotFoundError(util[_0xd81b('0x43')](_0xd81b('0xb6'),_0x22dd20[_0xd81b('0x64')]['id']));}if(_0x3a248d){return checkWebsiteInterval(_0x9658e);}return _0x9658e;})[_0xd81b('0x1c')](function(_0x44d405){_0x305014[_0xd81b('0xb7')]=_0x44d405;_0x305014[_0xd81b('0xb8')]=_['orderBy'](_0x44d405['Applications'],[_0xd81b('0xb9')],[_0xd81b('0xba')]);if(_0x305014[_0xd81b('0xb7')]['Applications']){delete _0x305014[_0xd81b('0xb7')][_0xd81b('0xb3')];}_0x305014[_0xd81b('0xbb')]=_0x44d405['List']||{'id':_0x44d405[_0xd81b('0xac')]};if(_0x305014[_0xd81b('0xbb')]&&_0x305014['list'][_0xd81b('0xb0')][_0xd81b('0x58')]){return _0x305014[_0xd81b('0xbb')][_0xd81b('0xb0')][0x0];}var _0x8026d7=_[_0xd81b('0x16')](_0x22dd20[_0xd81b('0x69')],{'firstName':_0x22dd20['body'][_0xd81b('0xad')],'ListId':_0x44d405[_0xd81b('0xac')]});_0x8026d7[_0x22dd20['body'][_0xd81b('0xa5')]]=_0x22dd20['body'][_0xd81b('0xad')];return db[_0xd81b('0xaf')][_0xd81b('0x68')](_0x8026d7,{'fields':_0x10382d,'raw':!![]});})[_0xd81b('0x1c')](function(_0x3a6e15){_0x305014[_0xd81b('0xbc')]=_0x3a6e15;var _0x87b315=createInteractionObject(_0x22dd20['params']['id'],_0x22dd20[_0xd81b('0x69')],_0x22dd20['headers'],_0x3a6e15);var _0x48073b={'ChatWebsiteId':_0x22dd20[_0xd81b('0x64')]['id']};if(_0x22dd20['body'][_0xd81b('0xbd')]){_0x48073b[_0xd81b('0xbd')]=_0x22dd20[_0xd81b('0x69')][_0xd81b('0xbd')];_0x48073b['closed']=![];return db['ChatInteraction'][_0xd81b('0x67')]({'where':_0x48073b})[_0xd81b('0x1c')](function(_0x50529b){var _0x2ec729=_0x22dd20[_0xd81b('0x69')][_0xd81b('0x38')]&&_0x22dd20['body'][_0xd81b('0x40')];if(_0x50529b){_0x48e6ba=!![];return _0x50529b;}else if(!_0x2ec729&&_0x50529b&&_0x50529b[_0xd81b('0xbe')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x87b315[_0xd81b('0xbd')]=_0x22dd20[_0xd81b('0x69')][_0xd81b('0xbd')];_0x87b315[_0xd81b('0xbf')]=_0x22dd20[_0xd81b('0x69')]['externalUrl'];return db['ChatInteraction'][_0xd81b('0x68')](_0x87b315);});}_0x48073b[_0xd81b('0xc0')]=_0x3a6e15['id'];if(_0x22dd20[_0xd81b('0x69')][_0xd81b('0xc1')]&&_0x22dd20['body'][_0xd81b('0xc1')]['id']){_0x48073b['id']=_0x22dd20['body'][_0xd81b('0xc1')]['id'];return db[_0xd81b('0xc2')]['find']({'where':_0x48073b})[_0xd81b('0x1c')](function(_0x264d72){var _0x1d5dac=_0x22dd20['body'][_0xd81b('0x38')]&&_0x22dd20[_0xd81b('0x69')][_0xd81b('0x40')];if(!_0x1d5dac&&_0x264d72&&_0x264d72['closed']){throw new APIConflictError(_0xd81b('0xc3'));}else if(_0x264d72){_0x48e6ba=!![];return _0x264d72;}else{return db[_0xd81b('0xc2')][_0xd81b('0x68')](_0x87b315);}});}return db[_0xd81b('0xc2')][_0xd81b('0x68')](_0x87b315);})['then'](function(_0x5c3dce){if(!_0x48e6ba){return _0x5c3dce;}var _0x105735={'from':(_0x305014[_0xd81b('0xbc')][_0xd81b('0x3d')]||'')+'\x20'+(_0x305014[_0xd81b('0xbc')]['lastName']||'')};if(_0x22dd20[_0xd81b('0x69')][_0xd81b('0xbd')]&&_0x22dd20[_0xd81b('0x69')]['messageId']&&_0x22dd20[_0xd81b('0x69')][_0xd81b('0xbd')]!=_0x22dd20[_0xd81b('0x69')]['messageId']){_0x105735['threadId']=_0x22dd20['body'][_0xd81b('0xc4')];}return _0x5c3dce['update'](_0x105735);})[_0xd81b('0x1c')](function(_0x3d7a57){_0x305014[_0xd81b('0xc1')]=_0x3d7a57['get']({'plain':!![]});_0x305014['interaction'][_0xd81b('0xc5')]=!_0x48e6ba;if(_0x305014['interaction'][_0xd81b('0xc5')]){if(_0x305014[_0xd81b('0xb7')][_0xd81b('0xc6')]){_0x305014[_0xd81b('0xb8')]['push']({'id':0x0,'priority':_0x305014[_0xd81b('0xb8')][_0xd81b('0x58')]+0x1,'app':_0xd81b('0xc7'),'appdata':'unmanaged','interval':_0xd81b('0xc8')});}}return db['ChatMessage'][_0xd81b('0x68')]({'body':_0x22dd20[_0xd81b('0x69')]['body'],'ChatWebsiteId':_0x22dd20[_0xd81b('0x64')]['id'],'ChatInteractionId':_0x3d7a57['id'],'direction':'in','ContactId':_0x305014[_0xd81b('0xbc')]['id'],'AttachmentId':_0x22dd20[_0xd81b('0x69')]['AttachmentId']});})['then'](function(_0x1c10da){_0x305014[_0xd81b('0x25')]=_0x1c10da;if(!_0x305014[_0xd81b('0xc1')][_0xd81b('0xc9')]){return;}return db[_0xd81b('0xca')][_0xd81b('0x67')]({'attributes':['id',_0xd81b('0x33')],'where':{'id':_0x305014['interaction']['UserId']}});})[_0xd81b('0x1c')](function(_0x10f27c){if(_0x10f27c){_0x305014[_0xd81b('0xb8')][_0xd81b('0xcb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x10f27c[_0xd81b('0x33')]+','+(_0x305014[_0xd81b('0xb7')][_0xd81b('0xcc')]||0xa),'interval':_0xd81b('0xc8')});_0x305014[_0xd81b('0xcd')]=!![];}if(!_0x305014['interaction']['queueId']){return;}return db[_0xd81b('0xce')][_0xd81b('0x67')]({'attributes':['id',_0xd81b('0x33')],'where':{'id':_0x305014[_0xd81b('0xc1')][_0xd81b('0xcf')]}});})['then'](function(_0x49e5dd){if(_0x49e5dd){_0x305014[_0xd81b('0xb8')]['unshift']({'id':0x0,'priority':0x1,'app':_0xd81b('0xd0'),'appdata':_0x49e5dd[_0xd81b('0x33')]+','+(_0x305014[_0xd81b('0xb7')][_0xd81b('0xd1')]||0x12c),'interval':_0xd81b('0xc8')});}return respondWithRpcPromise(_0xd81b('0xd2'),_0xd81b('0xd3'),_0x305014);})[_0xd81b('0x1c')](function(_0x538cc2){respondWithRpcPromise(_0xd81b('0xd4'),_0xd81b('0xd4'),{'event':_0xd81b('0xa2'),'message':_0x538cc2},client9002);return _0x538cc2;})[_0xd81b('0x1c')](respondWithResult(_0x2ea321,null))[_0xd81b('0x27')](APIHandleError(_0x2ea321));};exports[_0xd81b('0xd5')]=function(_0x2f4b2b,_0x59779e){var _0x1e184c,_0x5d6b18,_0x19eef8;var _0x520762=[];var _0x36650d={};var _0x1c5923=_0x2f4b2b['files']||[];var _0x16865b=[];var _0x522616;return db[_0xd81b('0xaf')][_0xd81b('0x78')]()['then'](function(_0x98f92e){if(!_0x98f92e){throw new db['Sequelize'][(_0xd81b('0xd6'))](_0xd81b('0xd7'));}_0x520762=_[_0xd81b('0xd8')](_[_0xd81b('0x53')](_0x98f92e),[_0xd81b('0xa9'),_0xd81b('0xab'),_0xd81b('0xd9'),_0xd81b('0xac')]);if(_0x2f4b2b[_0xd81b('0x69')]['id']){delete _0x2f4b2b[_0xd81b('0x69')]['id'];}if(_[_0xd81b('0x93')](_0x2f4b2b[_0xd81b('0x69')]['from'])){throw _0x59779e[_0xd81b('0x29')](0x1f4)['send'](new db[(_0xd81b('0xda'))][(_0xd81b('0xd6'))](_0xd81b('0xdb')));}if(_[_0xd81b('0x93')](_0x2f4b2b[_0xd81b('0x69')][_0xd81b('0x69')])||_0x2f4b2b[_0xd81b('0x69')]['body']===''){throw _0x59779e[_0xd81b('0x29')](0x1f4)['send'](new db[(_0xd81b('0xda'))]['ValidationError'](_0xd81b('0xdc')));}if(_['isNil'](_0x2f4b2b[_0xd81b('0x69')][_0xd81b('0xdd')])){throw _0x59779e[_0xd81b('0x29')](0x1f4)[_0xd81b('0x34')](new db['Sequelize'][(_0xd81b('0xd6'))](_0xd81b('0xde')+_0x520762));}if(!_['includes'](_0x520762,_0x2f4b2b['body']['mapKeyOffline'])){throw _0x59779e[_0xd81b('0x29')](0x1f4)[_0xd81b('0x34')](new db[(_0xd81b('0xda'))][(_0xd81b('0xd6'))](_0xd81b('0xdf')+_0x520762));}_0x36650d[_0x2f4b2b[_0xd81b('0x69')]['mapKeyOffline']]=_0x2f4b2b['body'][_0xd81b('0xad')];})['then'](function(){return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x2f4b2b[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0xae')],'as':_0xd81b('0xe0')},{'model':db[_0xd81b('0xe1')],'as':_0xd81b('0xe1')}]});})[_0xd81b('0x1c')](handleEntityNotFound(_0x59779e,null))[_0xd81b('0x1c')](function(_0x28cbe7){if(_0x28cbe7&&_0x28cbe7[_0xd81b('0xe0')]){_0x5d6b18=_0x28cbe7;var _0x30abaf=_[_0xd81b('0x16')](_0x2f4b2b[_0xd81b('0x69')],{'firstName':_0x2f4b2b['body'][_0xd81b('0xad')],'phone':_0x2f4b2b[_0xd81b('0x69')][_0xd81b('0xad')],'ListId':_0x28cbe7[_0xd81b('0xac')]});_0x30abaf[_0x2f4b2b[_0xd81b('0x69')]['mapKeyOffline']]=_0x2f4b2b[_0xd81b('0x69')]['from'];return db['CmContact'][_0xd81b('0xe2')]({'where':_0x36650d,'defaults':_0x30abaf});}})['spread'](function(_0x126aaa){if(_0x126aaa){_0x19eef8=_0x126aaa;var _0x3e8623=fs[_0xd81b('0xe3')](path['join'](config[_0xd81b('0x90')],_0xd81b('0xe4')),_0xd81b('0xe5'));var _0x576d9d=ejs[_0xd81b('0xe6')](_0x3e8623,{'body':_[_0xd81b('0xe7')](_0x2f4b2b[_0xd81b('0x69')][_0xd81b('0x69')]),'bodyTitle':_0x5d6b18[_0xd81b('0xe8')]});return db[_0xd81b('0xe9')]['create']({'body':_0x576d9d,'plainBody':htmlToText[_0xd81b('0xea')](_0x576d9d),'ContactId':_0x126aaa['id'],'ChatWebsiteId':_0x5d6b18['id']});}})[_0xd81b('0x1c')](function(_0x3b6ed5){_0x522616=_0x3b6ed5;if(_0x1c5923[_0xd81b('0x58')]){var _0x11b997=_0x1c5923[_0xd81b('0x4d')](function(_0x3ec25d){return{'name':_0x3ec25d[_0xd81b('0xeb')],'basename':_0x3ec25d[_0xd81b('0x87')],'type':_0x3ec25d['mimetype'],'ChatOfflineMessageId':_0x3b6ed5['id']};});_0x16865b=_0x11b997[_0xd81b('0x4d')](_0x10a82f=>{var _0x255f26={'filename':_0x10a82f[_0xd81b('0x33')],'path':path['join'](config[_0xd81b('0x90')],_0xd81b('0xec'),_0xd81b('0xed'),'attachments',_0xd81b('0xee'),_0x10a82f[_0xd81b('0xef')])};return _0x255f26;});if(!_0x5d6b18[_0xd81b('0xf0')]){return db[_0xd81b('0xf1')][_0xd81b('0xf2')](function(_0x4f1d2b){return db[_0xd81b('0xf3')][_0xd81b('0xf4')](_0x11b997,{'transaction':_0x4f1d2b});});}}})[_0xd81b('0x1c')](function(){if(_0x522616){_0x1e184c=_0x522616;return db['MailAccount'][_0xd81b('0x83')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xd81b('0xf5')],'as':_0xd81b('0xf5'),'raw':!![]}]}]});}})['then'](function(_0x2e4523){if(_0x2e4523&&_0x2e4523['Smtp']&&_0x5d6b18[_0xd81b('0xf6')]&&_0x5d6b18[_0xd81b('0xf7')]){var _0x3a10ac=_0x2e4523[_0xd81b('0xf8')]();return respondWithRpcPromise('SendMail',_0xd81b('0xf9'),{'account':_0x3a10ac,'message':{'from':util[_0xd81b('0x43')](_0xd81b('0xfa'),_0x2e4523[_0xd81b('0x33')],_0x2e4523[_0xd81b('0xfb')]||_0x2e4523[_0xd81b('0xfc')]['user']),'to':_0x5d6b18[_0xd81b('0xf7')],'subject':_0x5d6b18['offlineMessageSubject'],'html':_0x1e184c['body'],'attachments':_0x16865b}},client9003)[_0xd81b('0x1c')](function(){return _0x1e184c;})[_0xd81b('0x27')](function(_0xb2d684){logger['error'](_0xb2d684);});}})[_0xd81b('0x1c')](function(){if(_0x5d6b18&&_0x5d6b18[_0xd81b('0xf0')]&&_0x5d6b18['MailAccountId']){var _0x50fbfd=[];if(_0x1c5923[_0xd81b('0x58')]){_0x50fbfd=_0x1c5923[_0xd81b('0x4d')](function(_0x44e2a8){return{'name':_0x44e2a8[_0xd81b('0xeb')],'basename':_0x44e2a8[_0xd81b('0x87')],'type':_0x44e2a8[_0xd81b('0xfd')],'ChatOfflineMessageId':_0x522616['id']};});}var _0x462925;if(!_[_0xd81b('0x93')](_0x5d6b18[_0xd81b('0xfe')])){var _0x41d12a=_[_0xd81b('0x4d')](_0x2f4b2b[_0xd81b('0x69')],function(_0x2f3170){return _0x2f3170;});var _0xfc4221=_['toPairsIn'](_0x41d12a)[0x0];var _0x25939f=_[_0xd81b('0xff')](_0xfc4221,function(_0x5a7cb8){return _0x5a7cb8;});_0x462925=_0x25939f[0x1][_0x5d6b18[_0xd81b('0xfe')]];}var _0x250cd7={'from':_0x19eef8[_0xd81b('0xfb')],'firstName':_0x19eef8[_0xd81b('0x3d')],'lastName':_0x19eef8['lastName'],'mapKey':_0xd81b('0xfb'),'message':{'from':_0x19eef8[_0xd81b('0xfb')],'to':_0x5d6b18[_0xd81b('0xe1')][_0xd81b('0xfb')],'cc':'','subject':_[_0xd81b('0x93')](_0x462925)?_0x5d6b18[_0xd81b('0x100')]:_0x462925,'messageId':'','sentAt':new Date(),'attach':_0x50fbfd['length'],'attachments':_0x50fbfd,'originChannel':_0xd81b('0x101'),'ChatWebsiteId':_0x5d6b18['id'],'ChatOfflineMessageId':_0x1e184c['id'],'originTo':_0x5d6b18[_0xd81b('0xe1')][_0xd81b('0xfb')]},'body':_0x1e184c[_0xd81b('0x69')]};var _0x35320d={'account':{'id':_0x5d6b18[_0xd81b('0x102')]},'body':_0x250cd7,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xd81b('0x103'),_0x35320d,client9001)[_0xd81b('0x1c')](function(){return _0x1e184c;})[_0xd81b('0x27')](function(_0x3c329e){logger['error'](_0x3c329e);});}return;})[_0xd81b('0x1c')](function(){if(_0x1e184c){return _0x1e184c;}})[_0xd81b('0x1c')](respondWithResult(_0x59779e,null))[_0xd81b('0x27')](function(){for(var _0x468794 of _0x1c5923){var _0x1c3473=path['join'](config[_0xd81b('0x90')],'server',_0xd81b('0xed'),_0xd81b('0x104'),'offline-chat',_0x468794['filename']);fs_extra[_0xd81b('0x105')](_0x1c3473)['catch'](function(_0x5f1c6b){logger[_0xd81b('0x23')](_0xd81b('0x106'),_0x1c3473,_0x5f1c6b);});}});};exports[_0xd81b('0x107')]=function(_0x56195b,_0x584698){return db[_0xd81b('0xc2')][_0xd81b('0x67')]({'where':{'id':_0x56195b[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x584698,null))[_0xd81b('0x1c')](function(_0xae9cb8){if(_0xae9cb8){return _0xae9cb8['addInteraction'](_0x56195b['body'][_0xd81b('0x7f')],_[_0xd81b('0x108')](_0x56195b[_0xd81b('0x69')],['ids','id'])||{});}})[_0xd81b('0x1c')](respondWithResult(_0x584698,null))[_0xd81b('0x27')](handleError(_0x584698,null));};exports['getInteractions']=function(_0x22e159,_0x3d3ee1){var _0x31e7f7={'raw':![],'where':{}};var _0x4850d8={};var _0x51c975={'count':0x0,'rows':[]};return db[_0xd81b('0x4e')][_0xd81b('0x83')]({'where':{'id':_0x22e159[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x3d3ee1,null))[_0xd81b('0x1c')](function(_0x525220){if(_0x525220){_0x4850d8[_0xd81b('0x46')]=_[_0xd81b('0x53')](db['ChatInteraction'][_0xd81b('0x4f')]);_0x4850d8[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0x22e159['query']);_0x4850d8[_0xd81b('0x54')]=_['intersection'](_0x4850d8[_0xd81b('0x46')],_0x4850d8['query']);_0x31e7f7[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x4850d8[_0xd81b('0x46')],qs[_0xd81b('0x57')](_0x22e159[_0xd81b('0x52')][_0xd81b('0x57')]));_0x31e7f7['attributes']=_0x31e7f7['attributes'][_0xd81b('0x58')]?_0x31e7f7[_0xd81b('0x56')]:_0x4850d8[_0xd81b('0x46')];if(!_0x22e159[_0xd81b('0x52')][_0xd81b('0x59')](_0xd81b('0x5a'))){_0x31e7f7[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x22e159['query'][_0xd81b('0x2f')]);_0x31e7f7[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0x22e159[_0xd81b('0x52')]['offset']);}_0x31e7f7[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x22e159[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x31e7f7['where']=qs[_0xd81b('0x54')](_['pick'](_0x22e159['query'],_0x4850d8[_0xd81b('0x54')]));_0x31e7f7[_0xd81b('0x5d')][_0xd81b('0x80')]=_0x525220['id'];if(_0x22e159[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x31e7f7[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x31e7f7['where'],{'$or':_[_0xd81b('0x4d')](_0x31e7f7[_0xd81b('0x56')],function(_0x16ef58){var _0x3b4240={};_0x3b4240[_0x16ef58]={'$like':'%'+_0x22e159['query'][_0xd81b('0x5f')]+'%'};return _0x3b4240;})});}_0x31e7f7=_[_0xd81b('0x60')]({},_0x31e7f7,_0x22e159['options']);return db[_0xd81b('0xc2')]['count']({'where':_0x31e7f7[_0xd81b('0x5d')]})['then'](function(_0x54062e){_0x51c975[_0xd81b('0x2e')]=_0x54062e;if(_0x22e159[_0xd81b('0x52')][_0xd81b('0x62')]){_0x31e7f7[_0xd81b('0x63')]=[{'model':db['CmContact'],'as':_0xd81b('0x109'),'required':![]},{'model':db['User'],'as':_0xd81b('0x10a'),'attributes':[_0xd81b('0x33'),_0xd81b('0x10b'),_0xd81b('0x10c')],'required':![]},{'model':db[_0xd81b('0x10d')],'as':_0xd81b('0x10e'),'attributes':['id',_0xd81b('0x33'),_0xd81b('0x10f')],'where':_0x22e159[_0xd81b('0x52')]['tag']?{'id':_0x22e159[_0xd81b('0x52')][_0xd81b('0x110')]}:undefined,'required':_0x22e159[_0xd81b('0x52')][_0xd81b('0x110')]?!![]:![]}];}return db[_0xd81b('0xc2')][_0xd81b('0x7c')](_0x31e7f7);})[_0xd81b('0x1c')](function(_0x23139c){_0x51c975[_0xd81b('0x7d')]=_0x23139c;return _0x51c975;});}})[_0xd81b('0x1c')](respondWithFilteredResult(_0x3d3ee1,_0x31e7f7))['catch'](handleError(_0x3d3ee1,null));};exports[_0xd81b('0x111')]=function(_0x432b04,_0x2ff8f6){var _0x30a57a=0x0;var _0x25f776=0x0;var _0x1313da=![];var _0x115026;var _0x202316;return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x432b04[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0x9e')],'as':_0xd81b('0x9e'),'include':[{'model':db[_0xd81b('0x9e')],'as':_0xd81b('0xb4'),'attributes':['id',_0xd81b('0xb5')]}]}]})[_0xd81b('0x1c')](handleEntityNotFound(_0x2ff8f6,null))['then'](function(_0x16ccac){if(_0x16ccac){_0x115026=_0x16ccac;return _0x16ccac['getProactiveActions']({'raw':!![]});}})[_0xd81b('0x1c')](function(_0x1c3879){if(_0x115026){if(_0x1c3879){_0x202316=_0x1c3879;}}return require(_0xd81b('0x91'))[_0xd81b('0x92')]();})[_0xd81b('0x1c')](function(_0x4e6c6d){if(_0x4e6c6d){_0x25f776=_0x4e6c6d[_0xd81b('0x112')];_0x1313da=_0x4e6c6d[_0xd81b('0x113')];}})[_0xd81b('0x1c')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0xd81b('0x1c')](function(_0x366808){_0x30a57a=_0x366808;if(_0x25f776&&_0x366808>_0x25f776){return db['License'][_0xd81b('0x83')]({'where':{'id':0x1}})[_0xd81b('0x1c')](function(_0x2ac7d3){if(_0x2ac7d3){_0x2ac7d3[_0xd81b('0x114')](_0xd81b('0x115'));}});}})[_0xd81b('0x1c')](function(){var _0x203fbe=_0x115026[_0xd81b('0x9e')];var _0xf1f6f2=_0x115026[_0xd81b('0xa0')]||undefined;return _0x203fbe?_0x203fbe[_0xd81b('0xa1')](_0xf1f6f2):!![];})[_0xd81b('0x1c')](function(_0xe0b626){var _0x5a187a=fs[_0xd81b('0xe3')](path['join'](config[_0xd81b('0x90')],_0xd81b('0x116')),_0xd81b('0xe5'));var _0x4cb573=_0xd81b('0x117');var _0x53d707=![];var _0x480fab,_0x1685e6;if(_0x432b04[_0xd81b('0x118')]['referer']){_0x480fab=new URL(_0x432b04['headers'][_0xd81b('0x40')])[_0xd81b('0x119')];}else if(_0x432b04[_0xd81b('0x118')][_0xd81b('0x119')]){_0x480fab=new URL(_0x432b04[_0xd81b('0x118')]['origin'])[_0xd81b('0x119')];}else{_0x480fab=_0xd81b('0x11a');}_0x1685e6=typeof _0x115026[_0xd81b('0x6a')][_0xd81b('0x3c')](',')['find'](function(_0x549d83){return wildcardUtils[_0xd81b('0x11b')](_0x549d83,_0x480fab);})!==_0xd81b('0x2d');var _0x39eb20={'chatVersion':_0x4cb573,'chatWebsiteAddressOrigin':_0x1685e6?_0x480fab:_0x115026[_0xd81b('0x6a')],'remote':_0x115026[_0xd81b('0x11c')],'query':querystring[_0xd81b('0x22')](_['merge'](_0x115026[_0xd81b('0x70')]({'plain':!![]}),{'customerIp':_0x432b04[_0xd81b('0x118')]['x-forwarded-for']||_0x432b04[_0xd81b('0x118')][_0xd81b('0x11d')]||_0x432b04[_0xd81b('0x11e')][_0xd81b('0x11f')]||_0x432b04['ip'],'referer':_0x432b04['headers'][_0xd81b('0x40')],'openedInteractions':_0x30a57a,'maxInteractions':_0x25f776,'virtual':_0x1313da[_0xd81b('0x112')],'online':_0xe0b626,'custom':_0x1313da,'address':_0x1685e6?_0x480fab:null}))[_0xd81b('0x120')](/'/g,'\x5c\x27')};_0x2ff8f6[_0xd81b('0x34')](ejs[_0xd81b('0xe6')](Mustache[_0xd81b('0xe6')](_0x5a187a,_0x39eb20),{'proactiveActions':_0x202316,'alignment':_0x115026[_0xd81b('0x121')],'verticalAlignment':_0x115026[_0xd81b('0x122')],'div_color':_0x115026[_0xd81b('0x10f')],'labelText':_0x115026[_0xd81b('0x123')],'text_color':_0x115026[_0xd81b('0x124')],'text_button_color':_0x115026['textButtonColor'],'button_color':_0x115026[_0xd81b('0x125')],'background_color':_0x115026[_0xd81b('0x126')],'hideWhenOffline':_0x115026[_0xd81b('0x127')],'intervalId':_0x115026[_0xd81b('0x128')],'isDevelopment':_0x53d707,'chatVersion':_0x4cb573}));})[_0xd81b('0x27')](handleError(_0x2ff8f6,null));};exports[_0xd81b('0x129')]=function(_0x2eefbd,_0x2883fe){var _0x34cf85=_0x2eefbd[_0xd81b('0x64')]['id'];var _0x4eae4a=_0x2eefbd[_0xd81b('0x69')];var _0x388752=0xc8;var _0x580b1f=null;return db[_0xd81b('0xf1')][_0xd81b('0xf2')]({'isolationLevel':db[_0xd81b('0xf1')][_0xd81b('0x12a')]['ISOLATION_LEVELS'][_0xd81b('0x12b')]},function(_0x33d580){return db[_0xd81b('0x4e')][_0xd81b('0x83')]({'where':{'id':_0x34cf85},'transaction':_0x33d580})[_0xd81b('0x1c')](function(_0x386b39){if(_0x386b39){return db[_0xd81b('0xb2')][_0xd81b('0x31')]({'where':{'ChatWebsiteId':_0x34cf85},'transaction':_0x33d580})[_0xd81b('0x1c')](function(){var _0x3c839c=_[_0xd81b('0x4d')](_0x4eae4a,function(_0x9bbfea){_0x9bbfea[_0xd81b('0x80')]=_0x34cf85;return _0x9bbfea;});return db[_0xd81b('0xb2')][_0xd81b('0xf4')](_0x3c839c,{'transaction':_0x33d580});});}else{_0x388752=0x194;_0x580b1f=[];}});})['then'](function(){if(_0x388752!==0x194){return db[_0xd81b('0xb2')][_0xd81b('0x12c')]({'where':{'ChatWebsiteId':_0x34cf85},'order':_0xd81b('0xb9')})['then'](function(_0x5ae954){_0x580b1f=_0x5ae954;});}})[_0xd81b('0x27')](function(_0x5ab098){_0x388752=0x1f4;logger[_0xd81b('0x23')](_0x5ab098['stack']);if(_0x5ab098[_0xd81b('0x33')]){delete _0x5ab098[_0xd81b('0x33')];}_0x580b1f=_0x5ab098;})[_0xd81b('0x12d')](function(){if(_0x580b1f===null){_0x2883fe[_0xd81b('0x28')](_0x388752);}else{if(_0x388752===0x1f4){_0x2883fe['status'](_0x388752)['send'](_0x580b1f);}else{_0x2883fe[_0xd81b('0x29')](_0x388752)[_0xd81b('0x2b')](_0x580b1f);}}});};exports[_0xd81b('0x12e')]=function(_0x1e841d,_0x6121cf){var _0x15ce6c={};var _0x29e6d9={};var _0x57ef3b;var _0xf7cefc;return db['ChatWebsite']['findOne']({'where':{'id':_0x1e841d[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x6121cf,null))['then'](function(_0x28e08c){if(_0x28e08c){_0x57ef3b=_0x28e08c;_0x29e6d9[_0xd81b('0x46')]=_[_0xd81b('0x53')](db[_0xd81b('0xb2')][_0xd81b('0x4f')]);_0x29e6d9[_0xd81b('0x52')]=_['keys'](_0x1e841d['query']);_0x29e6d9[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x29e6d9['model'],_0x29e6d9['query']);_0x15ce6c[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x29e6d9['model'],qs[_0xd81b('0x57')](_0x1e841d[_0xd81b('0x52')]['fields']));_0x15ce6c[_0xd81b('0x56')]=_0x15ce6c[_0xd81b('0x56')][_0xd81b('0x58')]?_0x15ce6c['attributes']:_0x29e6d9[_0xd81b('0x46')];_0x15ce6c[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x1e841d[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x15ce6c['where']=qs[_0xd81b('0x54')](_[_0xd81b('0x5e')](_0x1e841d[_0xd81b('0x52')],_0x29e6d9[_0xd81b('0x54')]));if(_0x1e841d[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x15ce6c[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x15ce6c[_0xd81b('0x5d')],{'$or':_[_0xd81b('0x4d')](_0x15ce6c['attributes'],function(_0x407136){var _0x3b5455={};_0x3b5455[_0x407136]={'$like':'%'+_0x1e841d[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x3b5455;})});}_0x15ce6c=_[_0xd81b('0x60')]({},_0x15ce6c,_0x1e841d[_0xd81b('0x66')]);return _0x57ef3b[_0xd81b('0x12e')](_0x15ce6c);}})['then'](function(_0x5b1898){if(_0x5b1898){_0xf7cefc=_0x5b1898[_0xd81b('0x58')];if(!_0x1e841d[_0xd81b('0x52')][_0xd81b('0x59')]('nolimit')){_0x15ce6c[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x1e841d[_0xd81b('0x52')][_0xd81b('0x2f')]);_0x15ce6c[_0xd81b('0x2c')]=qs['offset'](_0x1e841d[_0xd81b('0x52')][_0xd81b('0x2c')]);}return _0x57ef3b[_0xd81b('0x12e')](_0x15ce6c);}})[_0xd81b('0x1c')](function(_0x89764a){if(_0x89764a){return _0x89764a?{'count':_0xf7cefc,'rows':_0x89764a}:null;}})[_0xd81b('0x1c')](respondWithResult(_0x6121cf,null))[_0xd81b('0x27')](handleError(_0x6121cf,null));};exports['addProactiveActions']=function(_0x5a8445,_0x47a903){return db['chatProactiveAction']['find']({'where':{'id':_0x5a8445[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x47a903,null))[_0xd81b('0x1c')](function(_0x4d4feb){if(_0x4d4feb){return _0x4d4feb[_0xd81b('0x12f')](_0x5a8445['body'][_0xd81b('0x7f')],_[_0xd81b('0x108')](_0x5a8445[_0xd81b('0x69')],['ids','id'])||{});}})[_0xd81b('0x1c')](respondWithResult(_0x47a903,null))[_0xd81b('0x27')](handleError(_0x47a903,null));};exports[_0xd81b('0x130')]=function(_0xd09d12,_0x251bf4){var _0x3682e4={};var _0x49f9d1={};var _0x5c97b9;var _0x1e4634;return db[_0xd81b('0x4e')][_0xd81b('0x83')]({'where':{'id':_0xd09d12[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x251bf4,null))[_0xd81b('0x1c')](function(_0x4e3323){if(_0x4e3323){_0x5c97b9=_0x4e3323;_0x49f9d1[_0xd81b('0x46')]=_[_0xd81b('0x53')](db[_0xd81b('0x131')][_0xd81b('0x4f')]);_0x49f9d1['query']=_['keys'](_0xd09d12[_0xd81b('0x52')]);_0x49f9d1[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x49f9d1[_0xd81b('0x46')],_0x49f9d1[_0xd81b('0x52')]);_0x3682e4[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x49f9d1['model'],qs[_0xd81b('0x57')](_0xd09d12['query']['fields']));_0x3682e4['attributes']=_0x3682e4[_0xd81b('0x56')][_0xd81b('0x58')]?_0x3682e4[_0xd81b('0x56')]:_0x49f9d1[_0xd81b('0x46')];_0x3682e4[_0xd81b('0x5b')]=qs['sort'](_0xd09d12[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x3682e4[_0xd81b('0x5d')]=qs[_0xd81b('0x54')](_['pick'](_0xd09d12['query'],_0x49f9d1[_0xd81b('0x54')]));if(_0xd09d12[_0xd81b('0x52')]['filter']){_0x3682e4[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x3682e4[_0xd81b('0x5d')],{'$or':_[_0xd81b('0x4d')](_0x3682e4[_0xd81b('0x56')],function(_0x111dd0){var _0x37301b={};_0x37301b[_0x111dd0]={'$like':'%'+_0xd09d12['query']['filter']+'%'};return _0x37301b;})});}_0x3682e4=_[_0xd81b('0x60')]({},_0x3682e4,_0xd09d12['options']);return _0x5c97b9[_0xd81b('0x130')](_0x3682e4);}})['then'](function(_0x222acd){if(_0x222acd){_0x1e4634=_0x222acd[_0xd81b('0x58')];if(!_0xd09d12[_0xd81b('0x52')][_0xd81b('0x59')](_0xd81b('0x5a'))){_0x3682e4[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0xd09d12[_0xd81b('0x52')]['limit']);_0x3682e4[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0xd09d12[_0xd81b('0x52')][_0xd81b('0x2c')]);}return _0x5c97b9[_0xd81b('0x130')](_0x3682e4);}})['then'](function(_0x3c96d4){if(_0x3c96d4){return _0x3c96d4?{'count':_0x1e4634,'rows':_0x3c96d4}:null;}})['then'](respondWithResult(_0x251bf4,null))[_0xd81b('0x27')](handleError(_0x251bf4,null));};exports[_0xd81b('0x132')]=function(_0x4387a7,_0x24fc43){var _0x498cc0=_0x4387a7[_0xd81b('0x52')][_0xd81b('0x133')]===_0xd81b('0x134')?_0xd81b('0x135'):_0xd81b('0x136');return db[_0xd81b('0x4e')]['find']({'attributes':['id',_0x498cc0],'where':{'id':_0x4387a7[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x24fc43,null))[_0xd81b('0x1c')](function(_0x597c54){if(_0x597c54){var _0x4e792e=_0x597c54[_0x498cc0];var _0x58e782=_0x4e792e&&_0x4e792e[_0xd81b('0x137')]?_0x4e792e['items']:[];_0x24fc43[_0xd81b('0x34')]({'fromKey':_[_0xd81b('0x93')](_0x4e792e['fromKey'])?undefined:_0x4e792e[_0xd81b('0x138')],'count':_0x58e782[_0xd81b('0x58')],'rows':_0x58e782});}})[_0xd81b('0x27')](handleError(_0x24fc43,null));};exports['getOfflineMessages']=function(_0x5f10b0,_0x19ff30){var _0x398e61={'raw':![],'where':{}};var _0xcb2433={};var _0x32573b={'count':0x0,'rows':[]};return db[_0xd81b('0x4e')]['findOne']({'where':{'id':_0x5f10b0['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x19ff30,null))[_0xd81b('0x1c')](function(_0x1eea94){if(_0x1eea94){_0xcb2433[_0xd81b('0x46')]=_[_0xd81b('0x53')](db[_0xd81b('0xe9')]['rawAttributes']);_0xcb2433['query']=_[_0xd81b('0x53')](_0x5f10b0[_0xd81b('0x52')]);_0xcb2433[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0xcb2433['model'],_0xcb2433[_0xd81b('0x52')]);_0x398e61['attributes']=_[_0xd81b('0x55')](_0xcb2433['model'],qs[_0xd81b('0x57')](_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x57')]));_0x398e61['attributes']=_0x398e61[_0xd81b('0x56')][_0xd81b('0x58')]?_0x398e61[_0xd81b('0x56')]:_0xcb2433[_0xd81b('0x46')];if(!_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x59')](_0xd81b('0x5a'))){_0x398e61[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x5f10b0['query'][_0xd81b('0x2f')]);_0x398e61[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x2c')]);}_0x398e61[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x398e61[_0xd81b('0x5d')]=qs['filters'](_[_0xd81b('0x5e')](_0x5f10b0[_0xd81b('0x52')],_0xcb2433[_0xd81b('0x54')]));_0x398e61[_0xd81b('0x5d')][_0xd81b('0x80')]=_0x1eea94['id'];if(_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x398e61[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x398e61['where'],{'$or':_['map'](_0x398e61[_0xd81b('0x56')],function(_0x56f4c8){var _0xa5dd60={};_0xa5dd60[_0x56f4c8]={'$like':'%'+_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0xa5dd60;})});}_0x398e61=_[_0xd81b('0x60')]({},_0x398e61,_0x5f10b0[_0xd81b('0x66')]);return db[_0xd81b('0xe9')][_0xd81b('0x2e')]({'where':_0x398e61[_0xd81b('0x5d')]})['then'](function(_0x443a17){_0x32573b[_0xd81b('0x2e')]=_0x443a17;if(_0x5f10b0['query'][_0xd81b('0x62')]){_0x398e61[_0xd81b('0x63')]=[{'all':!![]}];}else{_0x398e61['include']=[{'model':db['CmContact'],'as':_0xd81b('0x109'),'required':![]},{'model':db[_0xd81b('0xf3')],'as':_0xd81b('0x139'),'required':![]}];}return db[_0xd81b('0xe9')][_0xd81b('0x7c')](_0x398e61);})[_0xd81b('0x1c')](function(_0x57da47){_0x32573b[_0xd81b('0x7d')]=_0x57da47;return _0x32573b;});}})[_0xd81b('0x1c')](respondWithFilteredResult(_0x19ff30,_0x398e61))['catch'](handleError(_0x19ff30,null));};exports[_0xd81b('0x13a')]=function(_0x207681,_0x212f03){return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x207681[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x212f03,null))[_0xd81b('0x1c')](function(_0x3ea155){if(_0x3ea155){return _0x3ea155[_0xd81b('0x13a')](_0x207681['body'][_0xd81b('0x7f')],_[_0xd81b('0x108')](_0x207681[_0xd81b('0x69')],[_0xd81b('0x7f'),'id'])||{})[_0xd81b('0x13b')](function(_0x3b393b){for(var _0xd6d130=0x0;_0xd6d130<_0x207681['body'][_0xd81b('0x7f')][_0xd81b('0x58')];_0xd6d130+=0x1){socket[_0xd81b('0x13c')](_0xd81b('0x13d'),{'UserId':Number(_0x207681['body'][_0xd81b('0x7f')][_0xd6d130]),'ChatWebsiteId':Number(_0x207681[_0xd81b('0x64')]['id'])});}return _0x3b393b;});}})['then'](respondWithResult(_0x212f03,null))['catch'](handleError(_0x212f03,null));};exports[_0xd81b('0x13e')]=function(_0x44a9e1,_0x26d2c2){return db['ChatWebsite'][_0xd81b('0x67')]({'where':{'id':_0x44a9e1['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x26d2c2,null))[_0xd81b('0x1c')](function(_0x4c684a){if(_0x4c684a){return _0x4c684a[_0xd81b('0x13e')](_0x44a9e1['query'][_0xd81b('0x7f')])['then'](function(){if(_[_0xd81b('0x13f')](_0x44a9e1[_0xd81b('0x52')][_0xd81b('0x7f')])){for(var _0x56d986=0x0;_0x56d986<_0x44a9e1[_0xd81b('0x52')][_0xd81b('0x7f')][_0xd81b('0x58')];_0x56d986+=0x1){socket[_0xd81b('0x13c')](_0xd81b('0x140'),{'UserId':Number(_0x44a9e1[_0xd81b('0x52')][_0xd81b('0x7f')][_0x56d986]),'ChatWebsiteId':Number(_0x44a9e1['params']['id'])});}}else{socket[_0xd81b('0x13c')](_0xd81b('0x140'),{'UserId':Number(_0x44a9e1['query']['ids']),'ChatWebsiteId':Number(_0x44a9e1['params']['id'])});}});}})[_0xd81b('0x1c')](respondWithStatusCode(_0x26d2c2,null))[_0xd81b('0x27')](handleError(_0x26d2c2,null));};exports[_0xd81b('0x141')]=function(_0xb7102c,_0x2b1519){var _0x1c5a61={};var _0x4c1201={};var _0x1f76aa;var _0x36fa37;return db[_0xd81b('0x4e')][_0xd81b('0x83')]({'where':{'id':_0xb7102c[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x2b1519,null))[_0xd81b('0x1c')](function(_0x4fc360){if(_0x4fc360){_0x1f76aa=_0x4fc360;_0x4c1201[_0xd81b('0x46')]=_['keys'](db[_0xd81b('0xca')]['rawAttributes']);_0x4c1201[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0xb7102c[_0xd81b('0x52')]);_0x4c1201['filters']=_[_0xd81b('0x55')](_0x4c1201[_0xd81b('0x46')],_0x4c1201[_0xd81b('0x52')]);_0x1c5a61['attributes']=_[_0xd81b('0x55')](_0x4c1201['model'],qs[_0xd81b('0x57')](_0xb7102c['query'][_0xd81b('0x57')]));_0x1c5a61[_0xd81b('0x56')]=_0x1c5a61[_0xd81b('0x56')][_0xd81b('0x58')]?_0x1c5a61[_0xd81b('0x56')]:_0x4c1201[_0xd81b('0x46')];_0x1c5a61['order']=qs[_0xd81b('0x5c')](_0xb7102c[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x1c5a61[_0xd81b('0x5d')]=qs[_0xd81b('0x54')](_[_0xd81b('0x5e')](_0xb7102c[_0xd81b('0x52')],_0x4c1201[_0xd81b('0x54')]));if(_0xb7102c[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x1c5a61['where']=_[_0xd81b('0x60')](_0x1c5a61['where'],{'$or':_[_0xd81b('0x4d')](_0x1c5a61['attributes'],function(_0x45bf7e){var _0x29464b={};_0x29464b[_0x45bf7e]={'$like':'%'+_0xb7102c[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x29464b;})});}_0x1c5a61=_[_0xd81b('0x60')]({},_0x1c5a61,_0xb7102c[_0xd81b('0x66')]);return _0x1f76aa[_0xd81b('0x141')](_0x1c5a61);}})['then'](function(_0xec700e){if(_0xec700e){_0x36fa37=_0xec700e[_0xd81b('0x58')];if(!_0xb7102c[_0xd81b('0x52')][_0xd81b('0x59')]('nolimit')){_0x1c5a61[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0xb7102c[_0xd81b('0x52')][_0xd81b('0x2f')]);_0x1c5a61['offset']=qs['offset'](_0xb7102c[_0xd81b('0x52')][_0xd81b('0x2c')]);}return _0x1f76aa[_0xd81b('0x141')](_0x1c5a61);}})[_0xd81b('0x1c')](function(_0x450634){if(_0x450634){return _0x450634?{'count':_0x36fa37,'rows':_0x450634}:null;}})[_0xd81b('0x1c')](respondWithResult(_0x2b1519,null))[_0xd81b('0x27')](handleError(_0x2b1519,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 1d3930f..69404f9 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 _0x861c=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x56d9b5,_0x1db06e){var _0x24829b=function(_0x19e839){while(--_0x19e839){_0x56d9b5['push'](_0x56d9b5['shift']());}};_0x24829b(++_0x1db06e);}(_0x861c,0xdb));var _0xc861=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x861c[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0xc861('0x0'));var ChatWebsite=require(_0xc861('0x1'))['db'][_0xc861('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xc861('0x3')](0x0);var events={'afterCreate':_0xc861('0x4'),'afterUpdate':_0xc861('0x5'),'afterDestroy':_0xc861('0x6')};function emitEvent(_0x683b83){return function(_0x28ed01,_0xc70070,_0x2690f9){ChatWebsiteEvents[_0xc861('0x7')](_0x683b83+':'+_0x28ed01['id'],_0x28ed01);ChatWebsiteEvents['emit'](_0x683b83,_0x28ed01);_0x2690f9(null);};}for(var e in events){if(events[_0xc861('0x8')](e)){var event=events[e];ChatWebsite[_0xc861('0x9')](e,emitEvent(event));}}module[_0xc861('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x4944=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x42d32d,_0xe5bac){var _0x2607b4=function(_0x2d8481){while(--_0x2d8481){_0x42d32d['push'](_0x42d32d['shift']());}};_0x2607b4(++_0xe5bac);}(_0x4944,0x6d));var _0x4494=function(_0x417d14,_0x59a971){_0x417d14=_0x417d14-0x0;var _0x5493cc=_0x4944[_0x417d14];return _0x5493cc;};'use strict';var EventEmitter=require(_0x4494('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x4494('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x4494('0x2')](0x0);var events={'afterCreate':_0x4494('0x3'),'afterUpdate':_0x4494('0x4'),'afterDestroy':_0x4494('0x5')};function emitEvent(_0x5074d9){return function(_0x187098,_0x5c7492,_0x370748){ChatWebsiteEvents[_0x4494('0x6')](_0x5074d9+':'+_0x187098['id'],_0x187098);ChatWebsiteEvents[_0x4494('0x6')](_0x5074d9,_0x187098);_0x370748(null);};}for(var e in events){if(events[_0x4494('0x7')](e)){var event=events[e];ChatWebsite[_0x4494('0x8')](e,emitEvent(event));}}module[_0x4494('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 550b93c..436a58b 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 _0x895b=['exports','define','ChatWebsite','chat_websites','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x47bcbc,_0x4edd2a){var _0x29421a=function(_0x20e70f){while(--_0x20e70f){_0x47bcbc['push'](_0x47bcbc['shift']());}};_0x29421a(++_0x4edd2a);}(_0x895b,0x138));var _0xb895=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x895b[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xb895('0x0'));var util=require(_0xb895('0x1'));var logger=require('../../config/logger')(_0xb895('0x2'));var moment=require(_0xb895('0x3'));var BPromise=require('bluebird');var rp=require(_0xb895('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb895('0x5'));var config=require(_0xb895('0x6'));var attributes=require('./chatWebsite.attributes');module[_0xb895('0x7')]=function(_0x2af6d8,_0x1f18bd){return _0x2af6d8[_0xb895('0x8')](_0xb895('0x9'),attributes,{'tableName':_0xb895('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb3a0=['chat_websites','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x4bdf64,_0x3022b2){var _0x9a1a19=function(_0x4e551b){while(--_0x4e551b){_0x4bdf64['push'](_0x4bdf64['shift']());}};_0x9a1a19(++_0x3022b2);}(_0xb3a0,0x1e1));var _0x0b3a=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb3a0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0b3a('0x0'));var util=require(_0x0b3a('0x1'));var logger=require(_0x0b3a('0x2'))(_0x0b3a('0x3'));var moment=require(_0x0b3a('0x4'));var BPromise=require(_0x0b3a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b3a('0x6'));var rimraf=require('rimraf');var config=require(_0x0b3a('0x7'));var attributes=require(_0x0b3a('0x8'));module[_0x0b3a('0x9')]=function(_0x695955,_0x1592eb){return _0x695955[_0x0b3a('0xa')]('ChatWebsite',attributes,{'tableName':_0x0b3a('0xb'),'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 83c9b4a..398001d 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 _0x9f4e=['request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s'];(function(_0x2c5505,_0x2a7c7a){var _0x331581=function(_0xeb7147){while(--_0xeb7147){_0x2c5505['push'](_0x2c5505['shift']());}};_0x331581(++_0x2a7c7a);}(_0x9f4e,0x1d1));var _0xe9f4=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x9f4e[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0xe9f4('0x0'));var util=require(_0xe9f4('0x1'));var moment=require(_0xe9f4('0x2'));var BPromise=require(_0xe9f4('0x3'));var rs=require(_0xe9f4('0x4'));var fs=require('fs');var Redis=require(_0xe9f4('0x5'));var db=require(_0xe9f4('0x6'))['db'];var utils=require(_0xe9f4('0x7'));var logger=require(_0xe9f4('0x8'))('rpc');var config=require(_0xe9f4('0x9'));var jayson=require(_0xe9f4('0xa'));var client=jayson[_0xe9f4('0xb')]['http']({'port':0x232a});config[_0xe9f4('0xc')]=_[_0xe9f4('0xd')](config[_0xe9f4('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe9f4('0xe'))(new Redis(config[_0xe9f4('0xc')]));require(_0xe9f4('0xf'))[_0xe9f4('0x10')](socket);function respondWithRpcPromise(_0x402d8d,_0x322378,_0x16fb3f){return new BPromise(function(_0xf9140e,_0x28e29c){return client[_0xe9f4('0x11')](_0x402d8d,_0x16fb3f)[_0xe9f4('0x12')](function(_0xe8939f){logger[_0xe9f4('0x13')](_0xe9f4('0x14'),_0x322378,_0xe9f4('0x15'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x322378,'request\x20sent',JSON[_0xe9f4('0x16')](_0xe8939f));if(_0xe8939f[_0xe9f4('0x17')]){if(_0xe8939f[_0xe9f4('0x17')][_0xe9f4('0x18')]===0x1f4){logger[_0xe9f4('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x322378,_0xe8939f[_0xe9f4('0x17')]['message']);return _0x28e29c(_0xe8939f['error'][_0xe9f4('0x19')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x322378,_0xe8939f[_0xe9f4('0x17')]['message']);return _0xf9140e(_0xe8939f[_0xe9f4('0x17')]['message']);}else{logger[_0xe9f4('0x13')](_0xe9f4('0x14'),_0x322378,_0xe9f4('0x15'));_0xf9140e(_0xe8939f[_0xe9f4('0x1a')][_0xe9f4('0x19')]);}})['catch'](function(_0x1e3bb2){logger[_0xe9f4('0x17')](_0xe9f4('0x14'),_0x322378,_0x1e3bb2);_0x28e29c(_0x1e3bb2);});});}
\ No newline at end of file
+var _0xd5b5=['rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x17c8cc,_0x5e5647){var _0x3db4eb=function(_0x2082db){while(--_0x2082db){_0x17c8cc['push'](_0x17c8cc['shift']());}};_0x3db4eb(++_0x5e5647);}(_0xd5b5,0xec));var _0x5d5b=function(_0x1c7d08,_0x46c032){_0x1c7d08=_0x1c7d08-0x0;var _0x2c6fa2=_0xd5b5[_0x1c7d08];return _0x2c6fa2;};'use strict';var _=require(_0x5d5b('0x0'));var util=require(_0x5d5b('0x1'));var moment=require(_0x5d5b('0x2'));var BPromise=require(_0x5d5b('0x3'));var rs=require(_0x5d5b('0x4'));var fs=require('fs');var Redis=require(_0x5d5b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5d5b('0x6'))(_0x5d5b('0x7'));var config=require(_0x5d5b('0x8'));var jayson=require(_0x5d5b('0x9'));var client=jayson[_0x5d5b('0xa')][_0x5d5b('0xb')]({'port':0x232a});config['redis']=_[_0x5d5b('0xc')](config[_0x5d5b('0xd')],{'host':_0x5d5b('0xe'),'port':0x18eb});var socket=require(_0x5d5b('0xf'))(new Redis(config[_0x5d5b('0xd')]));require(_0x5d5b('0x10'))[_0x5d5b('0x11')](socket);function respondWithRpcPromise(_0x93ca4a,_0x3b70ee,_0x2b149c){return new BPromise(function(_0x4af2c5,_0x578132){return client['request'](_0x93ca4a,_0x2b149c)['then'](function(_0x2aa97e){logger['info'](_0x5d5b('0x12'),_0x3b70ee,_0x5d5b('0x13'));logger[_0x5d5b('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3b70ee,'request\x20sent',JSON[_0x5d5b('0x15')](_0x2aa97e));if(_0x2aa97e[_0x5d5b('0x16')]){if(_0x2aa97e[_0x5d5b('0x16')][_0x5d5b('0x17')]===0x1f4){logger[_0x5d5b('0x16')](_0x5d5b('0x12'),_0x3b70ee,_0x2aa97e[_0x5d5b('0x16')][_0x5d5b('0x18')]);return _0x578132(_0x2aa97e[_0x5d5b('0x16')][_0x5d5b('0x18')]);}logger[_0x5d5b('0x16')](_0x5d5b('0x12'),_0x3b70ee,_0x2aa97e[_0x5d5b('0x16')]['message']);return _0x4af2c5(_0x2aa97e['error']['message']);}else{logger[_0x5d5b('0x19')](_0x5d5b('0x12'),_0x3b70ee,_0x5d5b('0x13'));_0x4af2c5(_0x2aa97e['result'][_0x5d5b('0x18')]);}})[_0x5d5b('0x1a')](function(_0x372a16){logger[_0x5d5b('0x16')](_0x5d5b('0x12'),_0x3b70ee,_0x372a16);_0x578132(_0x372a16);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 3808d92..8738969 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 _0x4777=['./chatWebsite.events','remove','update','emit','removeListener','register','length'];(function(_0x4023e2,_0xd2597d){var _0x347129=function(_0x4db2fc){while(--_0x4db2fc){_0x4023e2['push'](_0x4023e2['shift']());}};_0x347129(++_0xd2597d);}(_0x4777,0x15e));var _0x7477=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0x4777[_0x31a576];return _0x30b1d3;};'use strict';var ChatWebsiteEvents=require(_0x7477('0x0'));var events=['save',_0x7477('0x1'),_0x7477('0x2')];function createListener(_0x75a8bb,_0x496a2d){return function(_0x543437){_0x496a2d[_0x7477('0x3')](_0x75a8bb,_0x543437);};}function removeListener(_0x53ac44,_0x5f1aa2){return function(){ChatWebsiteEvents[_0x7477('0x4')](_0x53ac44,_0x5f1aa2);};}exports[_0x7477('0x5')]=function(_0xec1a4e){for(var _0x1667e1=0x0,_0x2c979d=events[_0x7477('0x6')];_0x1667e1<_0x2c979d;_0x1667e1++){var _0x258e5b=events[_0x1667e1];var _0x5afc82=createListener('chatWebsite:'+_0x258e5b,_0xec1a4e);ChatWebsiteEvents['on'](_0x258e5b,_0x5afc82);}};
\ No newline at end of file
+var _0xef7b=['remove','update','emit','removeListener','register','save'];(function(_0x4ca42c,_0x42bc1e){var _0x119e6f=function(_0x1b6822){while(--_0x1b6822){_0x4ca42c['push'](_0x4ca42c['shift']());}};_0x119e6f(++_0x42bc1e);}(_0xef7b,0xd7));var _0xbef7=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0xef7b[_0x35b18a];return _0x4db1bd;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xbef7('0x0'),_0xbef7('0x1'),_0xbef7('0x2')];function createListener(_0x14aa04,_0x4ee82e){return function(_0x22fe3e){_0x4ee82e[_0xbef7('0x3')](_0x14aa04,_0x22fe3e);};}function removeListener(_0x40581f,_0x359cb6){return function(){ChatWebsiteEvents[_0xbef7('0x4')](_0x40581f,_0x359cb6);};}exports[_0xbef7('0x5')]=function(_0xed6ec7){for(var _0x50e382=0x0,_0x5c0b55=events['length'];_0x50e382<_0x5c0b55;_0x50e382++){var _0x52ad2b=events[_0x50e382];var _0x22a2b9=createListener('chatWebsite:'+_0x52ad2b,_0xed6ec7);ChatWebsiteEvents['on'](_0x52ad2b,_0x22a2b9);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index fcdef75..8797727 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x524e=['replace','localhost','test','trim','([\x5cw]+)','exports','url','URL'];(function(_0xcf4ad9,_0x3a0633){var _0x17e368=function(_0x3a6448){while(--_0x3a6448){_0xcf4ad9['push'](_0xcf4ad9['shift']());}};_0x17e368(++_0x3a0633);}(_0x524e,0x15e));var _0xe524=function(_0x4d874e,_0x453c11){_0x4d874e=_0x4d874e-0x0;var _0x280e26=_0x524e[_0x4d874e];return _0x280e26;};var escapeRegExp=require('../../../utils/misc')['escapeRegExp'];var URL=require(_0xe524('0x0'))[_0xe524('0x1')];function testWildcardValidity(_0xc5f6b5){var _0x29e619=!![];try{new URL(_0xc5f6b5[_0xe524('0x2')]('*',_0xe524('0x3')));}catch(_0xabd694){_0x29e619=![];}return _0x29e619&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xe524('0x4')](_0xc5f6b5);}function testWebsiteWithWildcard(_0x10d37a,_0x110cff){var _0x4f75d6;var _0xaaeaa9=escapeRegExp(_0x10d37a[_0xe524('0x5')]()[_0xe524('0x2')](/\/$/,''))['replace']('\x5c*',_0xe524('0x6'));try{new URL(_0x10d37a[_0xe524('0x2')]('\x5c*',_0xe524('0x3')));_0x4f75d6=new RegExp(_0xaaeaa9)[_0xe524('0x4')](_0x110cff);}catch(_0x991924){_0x4f75d6=![];}return _0x4f75d6;}module[_0xe524('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x9672=['trim','([\x5cw]+)','localhost','exports','../../../utils/misc','escapeRegExp','URL','replace','test'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0x9672,0xee));var _0x2967=function(_0x497652,_0x27a41b){_0x497652=_0x497652-0x0;var _0x171068=_0x9672[_0x497652];return _0x171068;};var escapeRegExp=require(_0x2967('0x0'))[_0x2967('0x1')];var URL=require('url')[_0x2967('0x2')];function testWildcardValidity(_0xcaaf25){var _0x1228b8=!![];try{new URL(_0xcaaf25[_0x2967('0x3')]('*','localhost'));}catch(_0x264152){_0x1228b8=![];}return _0x1228b8&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x2967('0x4')](_0xcaaf25);}function testWebsiteWithWildcard(_0x22257d,_0x51ddb1){var _0x4baad7;var _0x24424d=escapeRegExp(_0x22257d[_0x2967('0x5')]()[_0x2967('0x3')](/\/$/,''))[_0x2967('0x3')]('\x5c*',_0x2967('0x6'));try{new URL(_0x22257d[_0x2967('0x3')]('\x5c*',_0x2967('0x7')));_0x4baad7=new RegExp(_0x24424d)[_0x2967('0x4')](_0x51ddb1);}catch(_0x4aec0f){_0x4baad7=![];}return _0x4baad7;}module[_0x2967('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 01142f0..5e21108 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 _0xdeec=['format','%s-%s','originalname','single','diskStorage','root','server/files/images/avatars/','now','file','addCustomerAvatar','/:id/system_avatar','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','/:id/proactive_actions','addAgents','put','/:id','update','delete','destroy','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','isAuthenticated','get','describe','show','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','getInteractions','/:id/snippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','join'];(function(_0x1b5a05,_0x2c80de){var _0x347931=function(_0xd39454){while(--_0xd39454){_0x1b5a05['push'](_0x1b5a05['shift']());}};_0x347931(++_0x2c80de);}(_0xdeec,0xf0));var _0xcdee=function(_0x1d3ff1,_0x56d009){_0x1d3ff1=_0x1d3ff1-0x0;var _0x5a0a4a=_0xdeec[_0x1d3ff1];return _0x5a0a4a;};'use strict';var multer=require('multer');var util=require(_0xcdee('0x0'));var path=require(_0xcdee('0x1'));var timeout=require(_0xcdee('0x2'));var express=require(_0xcdee('0x3'));var router=express[_0xcdee('0x4')]();var fs_extra=require(_0xcdee('0x5'));var auth=require(_0xcdee('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcdee('0x7'));var controller=require(_0xcdee('0x8'));router['get']('/',auth[_0xcdee('0x9')](),controller['index']);router[_0xcdee('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xcdee('0xb')]);router[_0xcdee('0xa')]('/:id',auth[_0xcdee('0x9')](),controller[_0xcdee('0xc')]);router[_0xcdee('0xa')](_0xcdee('0xd'),auth[_0xcdee('0x9')](),controller['getDispositions']);router[_0xcdee('0xa')](_0xcdee('0xe'),auth[_0xcdee('0x9')](),controller['getAnswers']);router[_0xcdee('0xa')](_0xcdee('0xf'),controller[_0xcdee('0x10')]);router[_0xcdee('0xa')](_0xcdee('0x11'),controller[_0xcdee('0x12')]);router[_0xcdee('0xa')](_0xcdee('0x13'),controller[_0xcdee('0x14')]);router[_0xcdee('0xa')]('/:id/system_avatar',controller[_0xcdee('0x15')]);router[_0xcdee('0xa')]('/:id/interactions',auth[_0xcdee('0x9')](),controller[_0xcdee('0x16')]);router['get'](_0xcdee('0x17'),controller['getSnippet']);router[_0xcdee('0xa')](_0xcdee('0x18'),auth[_0xcdee('0x9')](),controller[_0xcdee('0x19')]);router['get']('/:id/proactive_actions',auth[_0xcdee('0x9')](),controller[_0xcdee('0x1a')]);router[_0xcdee('0xa')]('/:id/fields',controller[_0xcdee('0x1b')]);router[_0xcdee('0xa')](_0xcdee('0x1c'),auth[_0xcdee('0x9')](),controller[_0xcdee('0x1d')]);router[_0xcdee('0xa')](_0xcdee('0x1e'),auth['isAuthenticated'](),controller[_0xcdee('0x1f')]);router['post']('/',auth[_0xcdee('0x9')](),controller[_0xcdee('0x20')]);router[_0xcdee('0x21')](_0xcdee('0xd'),auth[_0xcdee('0x9')](),controller[_0xcdee('0x22')]);router[_0xcdee('0x21')](_0xcdee('0xe'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f97b6,_0x3383e9,_0x398d96){_0x398d96(null,path[_0xcdee('0x23')](config['root'],'server/files/images/logos/'));},'filename':function(_0xaaceb0,_0x2d82fd,_0x4c5b82){_0x4c5b82(null,util[_0xcdee('0x24')](_0xcdee('0x25'),Date['now'](),_0x2d82fd[_0xcdee('0x26')]));}})});router['post']('/:id/logo',upload[_0xcdee('0x27')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xcdee('0x28')]({'destination':function(_0x2f28ab,_0x1d0440,_0x3e4b19){_0x3e4b19(null,path[_0xcdee('0x23')](config[_0xcdee('0x29')],_0xcdee('0x2a')));},'filename':function(_0x5e3d13,_0x2af17d,_0x4a8f85){_0x4a8f85(null,util[_0xcdee('0x24')](_0xcdee('0x25'),Date[_0xcdee('0x2b')](),_0x2af17d['originalname']));}})});router[_0xcdee('0x21')](_0xcdee('0x11'),upload[_0xcdee('0x27')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0xcdee('0x28')]({'destination':function(_0x40d96a,_0x142995,_0x40e42f){_0x40e42f(null,path[_0xcdee('0x23')](config[_0xcdee('0x29')],'server/files/images/avatars/'));},'filename':function(_0x2f07e8,_0x198f6f,_0x3d08b6){_0x3d08b6(null,util['format'](_0xcdee('0x25'),Date[_0xcdee('0x2b')](),_0x198f6f[_0xcdee('0x26')]));}})});router[_0xcdee('0x21')](_0xcdee('0x13'),upload[_0xcdee('0x27')](_0xcdee('0x2c')),controller[_0xcdee('0x2d')]);var upload=multer({'storage':multer[_0xcdee('0x28')]({'destination':function(_0x5379a2,_0x176c38,_0x4a1ad4){_0x4a1ad4(null,path['join'](config[_0xcdee('0x29')],_0xcdee('0x2a')));},'filename':function(_0x5182ee,_0x9d7e2a,_0x297adc){_0x297adc(null,util['format'](_0xcdee('0x25'),Date[_0xcdee('0x2b')](),_0x9d7e2a[_0xcdee('0x26')]));}})});router[_0xcdee('0x21')](_0xcdee('0x2e'),upload[_0xcdee('0x27')](_0xcdee('0x2c')),controller['addSystemAvatar']);router[_0xcdee('0x21')]('/:id/notify',controller[_0xcdee('0x2f')]);const offlineUploadMulter=multer({'storage':multer[_0xcdee('0x28')]({'destination':function(_0x305b88,_0x23016d,_0x468da8){const _0x2846fe=path[_0xcdee('0x23')](config[_0xcdee('0x29')],_0xcdee('0x30'),_0xcdee('0x31'),_0xcdee('0x32'));fs_extra[_0xcdee('0x33')](_0x2846fe,function(){_0x468da8(null,_0x2846fe);});},'filename':function(_0x20dac5,_0x52b7e8,_0x3013fc){const _0x38a095=_0x52b7e8[_0xcdee('0x26')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4afa52=path[_0xcdee('0x34')](_0x38a095);const _0x3dd7a3=Date[_0xcdee('0x2b')]()+'-'+_0x38a095[_0xcdee('0x35')](_0x4afa52,'')+_0x4afa52;_0x3013fc(null,_0x3dd7a3);}})});router[_0xcdee('0x21')](_0xcdee('0x36'),offlineUploadMulter[_0xcdee('0x37')](),controller[_0xcdee('0x38')]);router['post'](_0xcdee('0x39'),auth[_0xcdee('0x9')](),controller[_0xcdee('0x3a')]);router[_0xcdee('0x21')](_0xcdee('0x18'),auth[_0xcdee('0x9')](),controller[_0xcdee('0x3b')]);router['post'](_0xcdee('0x3c'),auth[_0xcdee('0x9')](),controller['addProactiveActions']);router[_0xcdee('0x21')](_0xcdee('0x1e'),auth[_0xcdee('0x9')](),controller[_0xcdee('0x3d')]);router[_0xcdee('0x3e')](_0xcdee('0x3f'),auth[_0xcdee('0x9')](),controller[_0xcdee('0x40')]);router[_0xcdee('0x41')](_0xcdee('0x3f'),auth[_0xcdee('0x9')](),controller[_0xcdee('0x42')]);router[_0xcdee('0x41')](_0xcdee('0xd'),auth[_0xcdee('0x9')](),controller['removeDispositions']);router[_0xcdee('0x41')]('/:id/canned_answers',auth[_0xcdee('0x9')](),controller[_0xcdee('0x43')]);router[_0xcdee('0x41')](_0xcdee('0x1e'),auth[_0xcdee('0x9')](),controller['removeAgents']);module[_0xcdee('0x44')]=router;
\ No newline at end of file
+var _0xad69=['isAuthenticated','index','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','diskStorage','/:id/avatar','file','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','addApplications','/:id/proactive_actions','update','delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get'];(function(_0x3d11be,_0x1b9a8c){var _0x4b657b=function(_0x4a96f2){while(--_0x4a96f2){_0x3d11be['push'](_0x3d11be['shift']());}};_0x4b657b(++_0x1b9a8c);}(_0xad69,0x184));var _0x9ad6=function(_0xf9414a,_0x5347ff){_0xf9414a=_0xf9414a-0x0;var _0x328e50=_0xad69[_0xf9414a];return _0x328e50;};'use strict';var multer=require(_0x9ad6('0x0'));var util=require(_0x9ad6('0x1'));var path=require(_0x9ad6('0x2'));var timeout=require(_0x9ad6('0x3'));var express=require('express');var router=express[_0x9ad6('0x4')]();var fs_extra=require(_0x9ad6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9ad6('0x6'));var controller=require('./chatWebsite.controller');router[_0x9ad6('0x7')]('/',auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x9')]);router[_0x9ad6('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x9ad6('0x7')](_0x9ad6('0xa'),auth[_0x9ad6('0x8')](),controller['show']);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x9ad6('0xb')]);router['get'](_0x9ad6('0xc'),auth[_0x9ad6('0x8')](),controller[_0x9ad6('0xd')]);router[_0x9ad6('0x7')](_0x9ad6('0xe'),controller[_0x9ad6('0xf')]);router[_0x9ad6('0x7')]('/:id/avatar',controller[_0x9ad6('0x10')]);router[_0x9ad6('0x7')](_0x9ad6('0x11'),controller[_0x9ad6('0x12')]);router[_0x9ad6('0x7')](_0x9ad6('0x13'),controller[_0x9ad6('0x14')]);router['get'](_0x9ad6('0x15'),auth[_0x9ad6('0x8')](),controller['getInteractions']);router['get']('/:id/snippet',controller[_0x9ad6('0x16')]);router[_0x9ad6('0x7')](_0x9ad6('0x17'),auth['isAuthenticated'](),controller[_0x9ad6('0x18')]);router[_0x9ad6('0x7')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x9ad6('0x19')]);router[_0x9ad6('0x7')]('/:id/fields',controller[_0x9ad6('0x1a')]);router['get']('/:id/offline_messages',auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x1b')]);router[_0x9ad6('0x7')](_0x9ad6('0x1c'),auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x1d')]);router[_0x9ad6('0x1e')]('/',auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x1f')]);router[_0x9ad6('0x1e')](_0x9ad6('0x20'),auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x21')]);router[_0x9ad6('0x1e')](_0x9ad6('0xc'),auth[_0x9ad6('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x36ef32,_0x2edcbc,_0x24e3ac){_0x24e3ac(null,path[_0x9ad6('0x22')](config[_0x9ad6('0x23')],_0x9ad6('0x24')));},'filename':function(_0x5db2f4,_0x5137a2,_0x5e9c65){_0x5e9c65(null,util[_0x9ad6('0x25')](_0x9ad6('0x26'),Date[_0x9ad6('0x27')](),_0x5137a2[_0x9ad6('0x28')]));}})});router[_0x9ad6('0x1e')](_0x9ad6('0xe'),upload[_0x9ad6('0x29')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x9ad6('0x2a')]({'destination':function(_0x18fb2c,_0x7d6df6,_0x4ccdf4){_0x4ccdf4(null,path[_0x9ad6('0x22')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x13a84,_0x11bed3,_0x2dc134){_0x2dc134(null,util['format'](_0x9ad6('0x26'),Date['now'](),_0x11bed3[_0x9ad6('0x28')]));}})});router['post'](_0x9ad6('0x2b'),upload['single'](_0x9ad6('0x2c')),controller[_0x9ad6('0x2d')]);var upload=multer({'storage':multer[_0x9ad6('0x2a')]({'destination':function(_0x44345a,_0x22671d,_0x5d4abd){_0x5d4abd(null,path[_0x9ad6('0x22')](config[_0x9ad6('0x23')],_0x9ad6('0x2e')));},'filename':function(_0x2a0dc5,_0x41704a,_0x218071){_0x218071(null,util[_0x9ad6('0x25')](_0x9ad6('0x26'),Date[_0x9ad6('0x27')](),_0x41704a[_0x9ad6('0x28')]));}})});router['post'](_0x9ad6('0x11'),upload[_0x9ad6('0x29')](_0x9ad6('0x2c')),controller[_0x9ad6('0x2f')]);var upload=multer({'storage':multer[_0x9ad6('0x2a')]({'destination':function(_0x1aa60b,_0x4ab015,_0x507b4a){_0x507b4a(null,path[_0x9ad6('0x22')](config[_0x9ad6('0x23')],_0x9ad6('0x2e')));},'filename':function(_0x209bb9,_0x33af08,_0x431eb4){_0x431eb4(null,util[_0x9ad6('0x25')](_0x9ad6('0x26'),Date[_0x9ad6('0x27')](),_0x33af08[_0x9ad6('0x28')]));}})});router[_0x9ad6('0x1e')](_0x9ad6('0x13'),upload[_0x9ad6('0x29')](_0x9ad6('0x2c')),controller[_0x9ad6('0x30')]);router[_0x9ad6('0x1e')](_0x9ad6('0x31'),controller[_0x9ad6('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0x9ad6('0x2a')]({'destination':function(_0x2af3cf,_0x3b77fa,_0x597661){const _0xf537ba=path[_0x9ad6('0x22')](config[_0x9ad6('0x23')],_0x9ad6('0x33'),'attachments',_0x9ad6('0x34'));fs_extra[_0x9ad6('0x35')](_0xf537ba,function(){_0x597661(null,_0xf537ba);});},'filename':function(_0x3acca5,_0x2917cd,_0x379f66){const _0x48b578=_0x2917cd[_0x9ad6('0x28')][_0x9ad6('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x42e6b3=path[_0x9ad6('0x37')](_0x48b578);const _0x55fb73=Date[_0x9ad6('0x27')]()+'-'+_0x48b578[_0x9ad6('0x36')](_0x42e6b3,'')+_0x42e6b3;_0x379f66(null,_0x55fb73);}})});router[_0x9ad6('0x1e')]('/:id/offline',offlineUploadMulter[_0x9ad6('0x38')](),controller[_0x9ad6('0x39')]);router['post'](_0x9ad6('0x15'),auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x3a')]);router['post'](_0x9ad6('0x17'),auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x3b')]);router['post'](_0x9ad6('0x3c'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x9ad6('0x1e')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x9ad6('0xa'),auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x3d')]);router[_0x9ad6('0x3e')](_0x9ad6('0xa'),auth[_0x9ad6('0x8')](),controller[_0x9ad6('0x3f')]);router[_0x9ad6('0x3e')](_0x9ad6('0x20'),auth['isAuthenticated'](),controller[_0x9ad6('0x40')]);router['delete'](_0x9ad6('0xc'),auth[_0x9ad6('0x8')](),controller['removeAnswers']);router[_0x9ad6('0x3e')](_0x9ad6('0x1c'),auth[_0x9ad6('0x8')](),controller['removeAgents']);module[_0x9ad6('0x41')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 85dd059..4e1b399 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 _0x8300=['app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','../components/auth/service','../config/environment','Router','env'];(function(_0x42515e,_0x8a595c){var _0x76ed34=function(_0x14aba4){while(--_0x14aba4){_0x42515e['push'](_0x42515e['shift']());}};_0x76ed34(++_0x8a595c);}(_0x8300,0x74));var _0x0830=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8300[_0x4a9fb1];return _0x348672;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0x0830('0x0'));var config=require(_0x0830('0x1'));var router=express[_0x0830('0x2')]();var isProduction=config[_0x0830('0x3')]==='production'||![];function clientSideLogs(_0x2e69c1,_0x6d48f7,_0x1728c1){var _0x44b231=_0x2e69c1[_0x0830('0x4')]['get'](_0x0830('0x5'));if(!_0x44b231){throw new Error(_0x0830('0x6'));}return beaverLogger[_0x0830('0x7')]({'uri':'/client-logs','logger':_0x44b231,'enableCors':!isProduction})(_0x2e69c1,_0x6d48f7,_0x1728c1);}router[_0x0830('0x8')](auth[_0x0830('0x9')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x8e60=['env','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','exports','express','../components/auth/service','../config/environment','Router'];(function(_0x1e097e,_0x23f56c){var _0x76d7d2=function(_0x52f510){while(--_0x52f510){_0x1e097e['push'](_0x1e097e['shift']());}};_0x76d7d2(++_0x23f56c);}(_0x8e60,0x15b));var _0x08e6=function(_0x71e493,_0x4308b7){_0x71e493=_0x71e493-0x0;var _0x3d40ab=_0x8e60[_0x71e493];return _0x3d40ab;};var beaverLogger=require('beaver-logger/server');var express=require(_0x08e6('0x0'));var auth=require(_0x08e6('0x1'));var config=require(_0x08e6('0x2'));var router=express[_0x08e6('0x3')]();var isProduction=config[_0x08e6('0x4')]==='production'||![];function clientSideLogs(_0x51cbc0,_0x382671,_0x57a747){var _0xe77a74=_0x51cbc0[_0x08e6('0x5')][_0x08e6('0x6')](_0x08e6('0x7'));if(!_0xe77a74){throw new Error(_0x08e6('0x8'));}return beaverLogger[_0x08e6('0x9')]({'uri':_0x08e6('0xa'),'logger':_0xe77a74,'enableCors':!isProduction})(_0x51cbc0,_0x382671,_0x57a747);}router['use'](auth[_0x08e6('0xb')](),clientSideLogs);module[_0x08e6('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 692fa54..b90a52c 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 _0x512b=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','ENUM','AmazonAWS','Outlook365'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x512b,0xeb));var _0xb512=function(_0x3a8a4b,_0x4828ce){_0x3a8a4b=_0x3a8a4b-0x0;var _0x66f046=_0x512b[_0x3a8a4b];return _0x66f046;};'use strict';var Sequelize=require(_0xb512('0x0'));module['exports']={'name':{'type':Sequelize[_0xb512('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb512('0x2')](_0xb512('0x3'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xb512('0x4'),_0xb512('0x5'))},'data1':{'type':Sequelize[_0xb512('0x1')],'comment':_0xb512('0x6')},'data2':{'type':Sequelize[_0xb512('0x1')],'comment':_0xb512('0x7')},'data3':{'type':Sequelize[_0xb512('0x1')],'comment':_0xb512('0x8')},'data4':{'type':Sequelize[_0xb512('0x1')],'comment':_0xb512('0x9')},'data5':{'type':Sequelize[_0xb512('0xa')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xb512('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0xb512('0xb')}};
\ No newline at end of file
+var _0xa635=['ENUM','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING'];(function(_0x5b2ade,_0x4c70ef){var _0x5f24dd=function(_0x57fce5){while(--_0x57fce5){_0x5b2ade['push'](_0x5b2ade['shift']());}};_0x5f24dd(++_0x4c70ef);}(_0xa635,0xcd));var _0x5a63=function(_0x214730,_0xbfcce4){_0x214730=_0x214730-0x0;var _0x82af15=_0xa635[_0x214730];return _0x82af15;};'use strict';var Sequelize=require(_0x5a63('0x0'));module[_0x5a63('0x1')]={'name':{'type':Sequelize[_0x5a63('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x5a63('0x3')]('AmazonAWS',_0x5a63('0x4'),_0x5a63('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x5a63('0x3')](_0x5a63('0x6'),_0x5a63('0x7'))},'data1':{'type':Sequelize[_0x5a63('0x2')],'comment':_0x5a63('0x8')},'data2':{'type':Sequelize['STRING'],'comment':_0x5a63('0x9')},'data3':{'type':Sequelize[_0x5a63('0x2')],'comment':_0x5a63('0xa')},'data4':{'type':Sequelize[_0x5a63('0x2')],'comment':_0x5a63('0xb')},'data5':{'type':Sequelize[_0x5a63('0xc')],'comment':_0x5a63('0xd')},'data6':{'type':Sequelize[_0x5a63('0xc')],'comment':_0x5a63('0xe')},'data7':{'type':Sequelize[_0x5a63('0xc')],'comment':_0x5a63('0xf')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 2cb026d..fd5526a 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 _0x8621=['Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','offset','undefined','limit','count','Content-Range','json','update','destroy','then','status','end','stack','name','slice','map','CloudProvider','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','options','includeAll','rows','service','MicrosoftAzure','data3','catch','show','params','decryptString','Name\x20parameter\x20not\x20specified','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','find','findOne','user','oauth2MicrosoftCallback','error','state','Invalid\x20state\x20parameter','parse','from','base64','isValidIdToken','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:error'];(function(_0x2c3739,_0x19b190){var _0x23196d=function(_0x26d937){while(--_0x26d937){_0x2c3739['push'](_0x2c3739['shift']());}};_0x23196d(++_0x19b190);}(_0x8621,0x1c2));var _0x1862=function(_0x4588d8,_0xbdb8d2){_0x4588d8=_0x4588d8-0x0;var _0x2c33dc=_0x8621[_0x4588d8];return _0x2c33dc;};'use strict';var _=require(_0x1862('0x0'));var Redis=require(_0x1862('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x1862('0x2'));var config=require(_0x1862('0x3'));var logger=require(_0x1862('0x4'))('api');var db=require(_0x1862('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x1862('0x6')]=_[_0x1862('0x7')](config[_0x1862('0x6')],{'host':_0x1862('0x8'),'port':0x18eb});var socket=require(_0x1862('0x9'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x27d068,_0x1f1cf6){_0x1f1cf6=_0x1f1cf6||0xcc;return function(_0x2da952){if(_0x2da952){return _0x27d068[_0x1862('0xa')](_0x1f1cf6);}return _0x27d068['status'](_0x1f1cf6)['end']();};}function respondWithResult(_0x182610,_0x275600){_0x275600=_0x275600||0xc8;return function(_0x563f5b){if(_0x563f5b){return _0x182610['status'](_0x275600)['json'](_0x563f5b);}};}function respondWithFilteredResult(_0x594e0f,_0x21beab){return function(_0x4ee74a){if(_0x4ee74a){var _0x2c2669=typeof _0x21beab[_0x1862('0xb')]===_0x1862('0xc')&&typeof _0x21beab[_0x1862('0xd')]===_0x1862('0xc');var _0x578f91=_0x4ee74a[_0x1862('0xe')];var _0x2e30e0=_0x2c2669?0x0:_0x21beab['offset'];var _0x363406=_0x2c2669?_0x4ee74a[_0x1862('0xe')]:_0x21beab[_0x1862('0xb')]+_0x21beab[_0x1862('0xd')];var _0x1250cc;if(_0x363406>=_0x578f91){_0x363406=_0x578f91;_0x1250cc=0xc8;}else{_0x1250cc=0xce;}_0x594e0f['status'](_0x1250cc);return _0x594e0f['set'](_0x1862('0xf'),_0x2e30e0+'-'+_0x363406+'/'+_0x578f91)[_0x1862('0x10')](_0x4ee74a);}return null;};}function saveUpdates(_0x4d6783){return function(_0x2c88d8){if(_0x2c88d8){return _0x2c88d8[_0x1862('0x11')](_0x4d6783)['then'](function(_0x1d7eb4){return _0x1d7eb4;});}return null;};}function removeEntity(_0x169112){return function(_0x432402){if(_0x432402){return _0x432402[_0x1862('0x12')]()[_0x1862('0x13')](function(){_0x169112[_0x1862('0x14')](0xcc)[_0x1862('0x15')]();});}};}function handleEntityNotFound(_0x29d629){return function(_0x1f1a7f){if(!_0x1f1a7f){_0x29d629[_0x1862('0xa')](0x194);}return _0x1f1a7f;};}function handleError(_0x4813ff,_0x3ab015){_0x3ab015=_0x3ab015||0x1f4;return function(_0x1a3098){logger['error'](_0x1a3098[_0x1862('0x16')]);if(_0x1a3098[_0x1862('0x17')]){delete _0x1a3098[_0x1862('0x17')];}_0x4813ff['status'](_0x3ab015)['send'](_0x1a3098);};}function maskClientSecret(_0x4d9d7a){return _['padEnd'](_0x4d9d7a[_0x1862('0x18')](0x0,0x3),0x14,'*');}exports['index']=function(_0x6b7fe8,_0x166949){var _0x4ba207={},_0x364d3f={},_0x5505be={'count':0x0,'rows':[]};var _0x10c478=_[_0x1862('0x19')](db[_0x1862('0x1a')][_0x1862('0x1b')],function(_0x2a8841){return{'name':_0x2a8841['fieldName'],'type':_0x2a8841[_0x1862('0x1c')][_0x1862('0x1d')]};});_0x364d3f[_0x1862('0x1e')]=_[_0x1862('0x19')](_0x10c478,_0x1862('0x17'));_0x364d3f['query']=_[_0x1862('0x1f')](_0x6b7fe8[_0x1862('0x20')]);_0x364d3f[_0x1862('0x21')]=_[_0x1862('0x22')](_0x364d3f['model'],_0x364d3f[_0x1862('0x20')]);_0x4ba207[_0x1862('0x23')]=_[_0x1862('0x22')](_0x364d3f[_0x1862('0x1e')],qs['fields'](_0x6b7fe8[_0x1862('0x20')][_0x1862('0x24')]));_0x4ba207['attributes']=_0x4ba207[_0x1862('0x23')][_0x1862('0x25')]?_0x4ba207[_0x1862('0x23')]:_0x364d3f[_0x1862('0x1e')];if(!_0x6b7fe8[_0x1862('0x20')]['hasOwnProperty'](_0x1862('0x26'))){_0x4ba207[_0x1862('0xd')]=qs[_0x1862('0xd')](_0x6b7fe8[_0x1862('0x20')][_0x1862('0xd')]);_0x4ba207[_0x1862('0xb')]=qs[_0x1862('0xb')](_0x6b7fe8['query'][_0x1862('0xb')]);}_0x4ba207[_0x1862('0x27')]=qs[_0x1862('0x28')](_0x6b7fe8[_0x1862('0x20')][_0x1862('0x28')]);_0x4ba207['where']=qs[_0x1862('0x21')](_[_0x1862('0x29')](_0x6b7fe8[_0x1862('0x20')],_0x364d3f[_0x1862('0x21')]),_0x10c478);if(_0x6b7fe8[_0x1862('0x20')][_0x1862('0x2a')]){_0x4ba207['where']=_['merge'](_0x4ba207[_0x1862('0x2b')],{'$or':_[_0x1862('0x19')](_0x10c478,function(_0x1873b0){if(_0x1873b0['type']!=='VIRTUAL'){var _0x5c9e3d={};_0x5c9e3d[_0x1873b0[_0x1862('0x17')]]={'$like':'%'+_0x6b7fe8['query']['filter']+'%'};return _0x5c9e3d;}})});}_0x4ba207=_['merge']({},_0x4ba207,_0x6b7fe8[_0x1862('0x2c')]);var _0x4fa1ba={'where':_0x4ba207['where']};return db[_0x1862('0x1a')][_0x1862('0xe')](_0x4fa1ba)[_0x1862('0x13')](function(_0x31a9e8){_0x5505be[_0x1862('0xe')]=_0x31a9e8;if(_0x6b7fe8[_0x1862('0x20')][_0x1862('0x2d')]){_0x4ba207['include']=[{'all':!![]}];}return db[_0x1862('0x1a')]['findAll'](_0x4ba207);})[_0x1862('0x13')](function(_0x42b402){_0x5505be[_0x1862('0x2e')]=_[_0x1862('0x19')](_0x42b402,function(_0xd8d37e){if(_0xd8d37e[_0x1862('0x2f')]===_0x1862('0x30')){var _0x4141fa=encryptor['decryptString'](_0xd8d37e[_0x1862('0x31')]);_0xd8d37e['data3']=maskClientSecret(_0x4141fa);}return _0xd8d37e;});return _0x5505be;})[_0x1862('0x13')](respondWithFilteredResult(_0x166949,_0x4ba207))[_0x1862('0x32')](handleError(_0x166949,null));};exports[_0x1862('0x33')]=function(_0x4520fd,_0x20e8ee){var _0x215feb={'raw':!![],'where':{'id':_0x4520fd[_0x1862('0x34')]['id']}},_0x2f79e3={};_0x2f79e3['model']=_['keys'](db[_0x1862('0x1a')]['rawAttributes']);_0x2f79e3['query']=_['keys'](_0x4520fd['query']);_0x2f79e3['filters']=_[_0x1862('0x22')](_0x2f79e3['model'],_0x2f79e3[_0x1862('0x20')]);_0x215feb[_0x1862('0x23')]=_[_0x1862('0x22')](_0x2f79e3[_0x1862('0x1e')],qs[_0x1862('0x24')](_0x4520fd[_0x1862('0x20')][_0x1862('0x24')]));_0x215feb[_0x1862('0x23')]=_0x215feb['attributes'][_0x1862('0x25')]?_0x215feb['attributes']:_0x2f79e3['model'];if(_0x4520fd[_0x1862('0x20')][_0x1862('0x2d')]){_0x215feb['include']=[{'all':!![]}];}_0x215feb=_['merge']({},_0x215feb,_0x4520fd[_0x1862('0x2c')]);return db[_0x1862('0x1a')]['find'](_0x215feb)['then'](handleEntityNotFound(_0x20e8ee,null))[_0x1862('0x13')](function(_0x364203){if(_0x364203['service']===_0x1862('0x30')){var _0x201845=encryptor[_0x1862('0x35')](_0x364203[_0x1862('0x31')]);_0x364203[_0x1862('0x31')]=maskClientSecret(_0x201845);}return _0x364203;})[_0x1862('0x13')](respondWithResult(_0x20e8ee,null))[_0x1862('0x32')](handleError(_0x20e8ee,null));};exports['create']=function(_0x5ceb5a,_0x27862f){if(!_0x5ceb5a['body']['name'])throw new Error(_0x1862('0x36'));if(!_0x5ceb5a[_0x1862('0x37')][_0x1862('0x2f')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x273650=db[_0x1862('0x1a')][_0x1862('0x1b')][_0x1862('0x2f')][_0x1862('0x38')];if(!_0x273650[_0x1862('0x39')](_0x5ceb5a['body'][_0x1862('0x2f')]))throw new Error(_0x1862('0x3a')+_0x273650[_0x1862('0x3b')](',\x20'));if(_0x5ceb5a[_0x1862('0x37')][_0x1862('0x2f')]==='MicrosoftAzure'&&_0x5ceb5a['body']['data3']){_0x5ceb5a['body'][_0x1862('0x31')]=encryptor[_0x1862('0x3c')](_0x5ceb5a[_0x1862('0x37')]['data3']);}return db[_0x1862('0x1a')][_0x1862('0x3d')](_0x5ceb5a[_0x1862('0x37')],{})[_0x1862('0x13')](respondWithResult(_0x27862f,0xc9))[_0x1862('0x32')](handleError(_0x27862f,null));};exports[_0x1862('0x11')]=function(_0x19328a,_0x2cca58){if(_0x19328a[_0x1862('0x37')]['id']){delete _0x19328a[_0x1862('0x37')]['id'];}return db[_0x1862('0x1a')][_0x1862('0x3e')]({'where':{'id':_0x19328a[_0x1862('0x34')]['id']}})[_0x1862('0x13')](handleEntityNotFound(_0x2cca58,null))[_0x1862('0x13')](function(_0xdeede){if(_0xdeede[_0x1862('0x2f')]===_0x1862('0x30')&&_0x19328a[_0x1862('0x37')]['data3']){_0x19328a['body'][_0x1862('0x31')]=encryptor[_0x1862('0x3c')](_0x19328a[_0x1862('0x37')][_0x1862('0x31')]);}return _0xdeede;})['then'](saveUpdates(_0x19328a['body'],null))[_0x1862('0x13')](respondWithResult(_0x2cca58,null))['catch'](handleError(_0x2cca58,null));};exports['destroy']=function(_0x2d87f1,_0x4c9eab){return db['CloudProvider'][_0x1862('0x3e')]({'where':{'id':_0x2d87f1[_0x1862('0x34')]['id']}})[_0x1862('0x13')](handleEntityNotFound(_0x4c9eab,null))[_0x1862('0x13')](removeEntity(_0x4c9eab,null))[_0x1862('0x32')](handleError(_0x4c9eab,null));};exports['oauth2MicrosoftAuthorize']=function(_0x39c051,_0x5b8d85){return db['CloudProvider'][_0x1862('0x3f')]({'where':{'id':_0x39c051[_0x1862('0x34')]['id']},'raw':!![]})['then'](function(_0x16c2c8){if(!_0x16c2c8)return _0x5b8d85[_0x1862('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x16c2c8,_0x39c051[_0x1862('0x40')]['id'])};})['then'](respondWithResult(_0x5b8d85,null))['catch'](handleError(_0x5b8d85,null));};exports[_0x1862('0x41')]=function(_0x346046,_0x55e15b){var _0x22c33c=_0x346046[_0x1862('0x37')];var _0x1792f1;var _0x1605b4;if(_0x22c33c[_0x1862('0x42')])throw _0x22c33c;redis['get'](_0x22c33c[_0x1862('0x43')])[_0x1862('0x13')](function(_0x2c1dbb){if(!_0x2c1dbb)throw new Error(_0x1862('0x44'));_0x1792f1=JSON[_0x1862('0x45')](_0x2c1dbb);var _0x4bc1e6=Buffer[_0x1862('0x46')](_0x22c33c[_0x1862('0x43')],_0x1862('0x47'))['toString']('ascii');_0x1605b4=JSON[_0x1862('0x45')](_0x4bc1e6);if(!oauth[_0x1862('0x48')](_0x22c33c['id_token'],_0x1792f1['oauth2Claims']))throw new Error(_0x1862('0x49'));redis[_0x1862('0x4a')](_0x22c33c[_0x1862('0x43')]);return oauth[_0x1862('0x4b')](_0x22c33c[_0x1862('0x4c')],_0x1792f1);})[_0x1862('0x13')](function(_0x53061d){_0x1792f1['data5']=_0x53061d[_0x1862('0x4d')];_0x1792f1[_0x1862('0x4e')]=_0x53061d[_0x1862('0x4f')];return db['CloudProvider'][_0x1862('0x11')]({'data5':_0x1792f1[_0x1862('0x50')],'data6':_0x1792f1['data6']},{'where':{'id':_0x1792f1['id']}});})[_0x1862('0x13')](function(){oauth[_0x1862('0x51')](_0x1792f1);socket[_0x1862('0x52')]('microsoftAuthorization:success',{'id':_0x1605b4['id']});return;})[_0x1862('0x13')](respondWithStatusCode(_0x55e15b,null))[_0x1862('0x32')](function(_0x52e56b){if(_0x1605b4){socket[_0x1862('0x52')](_0x1862('0x53'),{'id':_0x1605b4['id']});}if(!_0x1792f1){logger[_0x1862('0x42')](_0x1862('0x54'),_0x52e56b);return _0x55e15b[_0x1862('0x14')](0x1f4)[_0x1862('0x55')](_0x52e56b[_0x1862('0x56')]);}logger['error'](_0x1862('0x57'),_0x1792f1['id'],JSON[_0x1862('0x58')](_0x52e56b));});};
\ No newline at end of file
+var _0xdc19=['code','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','ioredis','../../config/environment','api','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','padEnd','slice','map','CloudProvider','rawAttributes','fieldName','type','key','model','name','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','decryptString','data3','show','params','find','service','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','MicrosoftAzure','encryptString','create','catch','oauth2MicrosoftAuthorize','findOne','oauth2MicrosoftCallback','Invalid\x20state\x20parameter','state','base64','toString','parse','isValidIdToken','id_token','oauth2Claims','del'];(function(_0xe79efd,_0x20e812){var _0x104d81=function(_0x3745fe){while(--_0x3745fe){_0xe79efd['push'](_0xe79efd['shift']());}};_0x104d81(++_0x20e812);}(_0xdc19,0x66));var _0x9dc1=function(_0x1c3e07,_0x4d31a5){_0x1c3e07=_0x1c3e07-0x0;var _0x1defcb=_0xdc19[_0x1c3e07];return _0x1defcb;};'use strict';var _=require('lodash');var Redis=require(_0x9dc1('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0x9dc1('0x1'));var logger=require('../../config/logger')(_0x9dc1('0x2'));var db=require(_0x9dc1('0x3'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x9dc1('0x4')]=_[_0x9dc1('0x5')](config[_0x9dc1('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0x9dc1('0x6'))(new Redis(config['redis']));var redis=new Redis(config[_0x9dc1('0x4')]);function respondWithStatusCode(_0x513e44,_0x329be7){_0x329be7=_0x329be7||0xcc;return function(_0x2e305c){if(_0x2e305c){return _0x513e44[_0x9dc1('0x7')](_0x329be7);}return _0x513e44['status'](_0x329be7)[_0x9dc1('0x8')]();};}function respondWithResult(_0x783f46,_0x717af7){_0x717af7=_0x717af7||0xc8;return function(_0x4121a5){if(_0x4121a5){return _0x783f46[_0x9dc1('0x9')](_0x717af7)[_0x9dc1('0xa')](_0x4121a5);}};}function respondWithFilteredResult(_0x95435f,_0x4a996f){return function(_0x19fbe1){if(_0x19fbe1){var _0x68e996=typeof _0x4a996f[_0x9dc1('0xb')]===_0x9dc1('0xc')&&typeof _0x4a996f[_0x9dc1('0xd')]==='undefined';var _0x2813c4=_0x19fbe1[_0x9dc1('0xe')];var _0x138b56=_0x68e996?0x0:_0x4a996f[_0x9dc1('0xb')];var _0x1bce86=_0x68e996?_0x19fbe1[_0x9dc1('0xe')]:_0x4a996f[_0x9dc1('0xb')]+_0x4a996f[_0x9dc1('0xd')];var _0xaf5799;if(_0x1bce86>=_0x2813c4){_0x1bce86=_0x2813c4;_0xaf5799=0xc8;}else{_0xaf5799=0xce;}_0x95435f['status'](_0xaf5799);return _0x95435f['set'](_0x9dc1('0xf'),_0x138b56+'-'+_0x1bce86+'/'+_0x2813c4)[_0x9dc1('0xa')](_0x19fbe1);}return null;};}function saveUpdates(_0x254422){return function(_0x43548f){if(_0x43548f){return _0x43548f[_0x9dc1('0x10')](_0x254422)[_0x9dc1('0x11')](function(_0x5c5256){return _0x5c5256;});}return null;};}function removeEntity(_0x4c23e3){return function(_0x5bcc1c){if(_0x5bcc1c){return _0x5bcc1c[_0x9dc1('0x12')]()[_0x9dc1('0x11')](function(){_0x4c23e3['status'](0xcc)[_0x9dc1('0x8')]();});}};}function handleEntityNotFound(_0x1efcf3){return function(_0x4c1010){if(!_0x4c1010){_0x1efcf3['sendStatus'](0x194);}return _0x4c1010;};}function handleError(_0x454f6d,_0x3125b2){_0x3125b2=_0x3125b2||0x1f4;return function(_0x38d58c){logger[_0x9dc1('0x13')](_0x38d58c['stack']);if(_0x38d58c['name']){delete _0x38d58c['name'];}_0x454f6d[_0x9dc1('0x9')](_0x3125b2)['send'](_0x38d58c);};}function maskClientSecret(_0x12079a){return _[_0x9dc1('0x14')](_0x12079a[_0x9dc1('0x15')](0x0,0x3),0x14,'*');}exports['index']=function(_0x2698ae,_0x4f786b){var _0x381726={},_0x45dd23={},_0x5e8a9a={'count':0x0,'rows':[]};var _0x7846f9=_[_0x9dc1('0x16')](db[_0x9dc1('0x17')][_0x9dc1('0x18')],function(_0x4c84a1){return{'name':_0x4c84a1[_0x9dc1('0x19')],'type':_0x4c84a1[_0x9dc1('0x1a')][_0x9dc1('0x1b')]};});_0x45dd23[_0x9dc1('0x1c')]=_[_0x9dc1('0x16')](_0x7846f9,_0x9dc1('0x1d'));_0x45dd23['query']=_[_0x9dc1('0x1e')](_0x2698ae['query']);_0x45dd23[_0x9dc1('0x1f')]=_[_0x9dc1('0x20')](_0x45dd23['model'],_0x45dd23['query']);_0x381726[_0x9dc1('0x21')]=_['intersection'](_0x45dd23[_0x9dc1('0x1c')],qs[_0x9dc1('0x22')](_0x2698ae[_0x9dc1('0x23')][_0x9dc1('0x22')]));_0x381726[_0x9dc1('0x21')]=_0x381726[_0x9dc1('0x21')][_0x9dc1('0x24')]?_0x381726[_0x9dc1('0x21')]:_0x45dd23[_0x9dc1('0x1c')];if(!_0x2698ae[_0x9dc1('0x23')][_0x9dc1('0x25')]('nolimit')){_0x381726[_0x9dc1('0xd')]=qs[_0x9dc1('0xd')](_0x2698ae[_0x9dc1('0x23')]['limit']);_0x381726[_0x9dc1('0xb')]=qs['offset'](_0x2698ae[_0x9dc1('0x23')][_0x9dc1('0xb')]);}_0x381726['order']=qs[_0x9dc1('0x26')](_0x2698ae['query'][_0x9dc1('0x26')]);_0x381726[_0x9dc1('0x27')]=qs[_0x9dc1('0x1f')](_[_0x9dc1('0x28')](_0x2698ae['query'],_0x45dd23[_0x9dc1('0x1f')]),_0x7846f9);if(_0x2698ae[_0x9dc1('0x23')][_0x9dc1('0x29')]){_0x381726[_0x9dc1('0x27')]=_['merge'](_0x381726[_0x9dc1('0x27')],{'$or':_[_0x9dc1('0x16')](_0x7846f9,function(_0x542d49){if(_0x542d49[_0x9dc1('0x1a')]!==_0x9dc1('0x2a')){var _0x33034d={};_0x33034d[_0x542d49[_0x9dc1('0x1d')]]={'$like':'%'+_0x2698ae['query'][_0x9dc1('0x29')]+'%'};return _0x33034d;}})});}_0x381726=_[_0x9dc1('0x2b')]({},_0x381726,_0x2698ae[_0x9dc1('0x2c')]);var _0x4aa732={'where':_0x381726[_0x9dc1('0x27')]};return db[_0x9dc1('0x17')][_0x9dc1('0xe')](_0x4aa732)['then'](function(_0x4da673){_0x5e8a9a['count']=_0x4da673;if(_0x2698ae[_0x9dc1('0x23')][_0x9dc1('0x2d')]){_0x381726[_0x9dc1('0x2e')]=[{'all':!![]}];}return db['CloudProvider'][_0x9dc1('0x2f')](_0x381726);})[_0x9dc1('0x11')](function(_0x5e352e){_0x5e8a9a[_0x9dc1('0x30')]=_['map'](_0x5e352e,function(_0x53649a){if(_0x53649a['service']==='MicrosoftAzure'){var _0x4943ce=encryptor[_0x9dc1('0x31')](_0x53649a['data3']);_0x53649a[_0x9dc1('0x32')]=maskClientSecret(_0x4943ce);}return _0x53649a;});return _0x5e8a9a;})['then'](respondWithFilteredResult(_0x4f786b,_0x381726))['catch'](handleError(_0x4f786b,null));};exports[_0x9dc1('0x33')]=function(_0x57938f,_0x3fea27){var _0x37e230={'raw':!![],'where':{'id':_0x57938f[_0x9dc1('0x34')]['id']}},_0x207c4e={};_0x207c4e[_0x9dc1('0x1c')]=_[_0x9dc1('0x1e')](db[_0x9dc1('0x17')][_0x9dc1('0x18')]);_0x207c4e[_0x9dc1('0x23')]=_[_0x9dc1('0x1e')](_0x57938f[_0x9dc1('0x23')]);_0x207c4e[_0x9dc1('0x1f')]=_[_0x9dc1('0x20')](_0x207c4e[_0x9dc1('0x1c')],_0x207c4e[_0x9dc1('0x23')]);_0x37e230[_0x9dc1('0x21')]=_[_0x9dc1('0x20')](_0x207c4e[_0x9dc1('0x1c')],qs[_0x9dc1('0x22')](_0x57938f[_0x9dc1('0x23')][_0x9dc1('0x22')]));_0x37e230[_0x9dc1('0x21')]=_0x37e230[_0x9dc1('0x21')][_0x9dc1('0x24')]?_0x37e230[_0x9dc1('0x21')]:_0x207c4e[_0x9dc1('0x1c')];if(_0x57938f[_0x9dc1('0x23')]['includeAll']){_0x37e230[_0x9dc1('0x2e')]=[{'all':!![]}];}_0x37e230=_['merge']({},_0x37e230,_0x57938f[_0x9dc1('0x2c')]);return db[_0x9dc1('0x17')][_0x9dc1('0x35')](_0x37e230)[_0x9dc1('0x11')](handleEntityNotFound(_0x3fea27,null))[_0x9dc1('0x11')](function(_0x1ea11a){if(_0x1ea11a[_0x9dc1('0x36')]==='MicrosoftAzure'){var _0x587ced=encryptor[_0x9dc1('0x31')](_0x1ea11a[_0x9dc1('0x32')]);_0x1ea11a[_0x9dc1('0x32')]=maskClientSecret(_0x587ced);}return _0x1ea11a;})[_0x9dc1('0x11')](respondWithResult(_0x3fea27,null))['catch'](handleError(_0x3fea27,null));};exports['create']=function(_0x2794a9,_0x47143a){if(!_0x2794a9[_0x9dc1('0x37')]['name'])throw new Error(_0x9dc1('0x38'));if(!_0x2794a9[_0x9dc1('0x37')][_0x9dc1('0x36')])throw new Error(_0x9dc1('0x39'));var _0x2d7d3c=db[_0x9dc1('0x17')][_0x9dc1('0x18')]['service'][_0x9dc1('0x3a')];if(!_0x2d7d3c[_0x9dc1('0x3b')](_0x2794a9['body'][_0x9dc1('0x36')]))throw new Error(_0x9dc1('0x3c')+_0x2d7d3c[_0x9dc1('0x3d')](',\x20'));if(_0x2794a9[_0x9dc1('0x37')][_0x9dc1('0x36')]===_0x9dc1('0x3e')&&_0x2794a9['body'][_0x9dc1('0x32')]){_0x2794a9['body'][_0x9dc1('0x32')]=encryptor[_0x9dc1('0x3f')](_0x2794a9[_0x9dc1('0x37')][_0x9dc1('0x32')]);}return db[_0x9dc1('0x17')][_0x9dc1('0x40')](_0x2794a9[_0x9dc1('0x37')],{})[_0x9dc1('0x11')](respondWithResult(_0x47143a,0xc9))[_0x9dc1('0x41')](handleError(_0x47143a,null));};exports[_0x9dc1('0x10')]=function(_0x1431b6,_0x8cbfd9){if(_0x1431b6[_0x9dc1('0x37')]['id']){delete _0x1431b6[_0x9dc1('0x37')]['id'];}return db[_0x9dc1('0x17')][_0x9dc1('0x35')]({'where':{'id':_0x1431b6[_0x9dc1('0x34')]['id']}})['then'](handleEntityNotFound(_0x8cbfd9,null))[_0x9dc1('0x11')](function(_0x27bc02){if(_0x27bc02[_0x9dc1('0x36')]===_0x9dc1('0x3e')&&_0x1431b6['body'][_0x9dc1('0x32')]){_0x1431b6[_0x9dc1('0x37')][_0x9dc1('0x32')]=encryptor[_0x9dc1('0x3f')](_0x1431b6[_0x9dc1('0x37')][_0x9dc1('0x32')]);}return _0x27bc02;})[_0x9dc1('0x11')](saveUpdates(_0x1431b6[_0x9dc1('0x37')],null))[_0x9dc1('0x11')](respondWithResult(_0x8cbfd9,null))[_0x9dc1('0x41')](handleError(_0x8cbfd9,null));};exports[_0x9dc1('0x12')]=function(_0x4c6a79,_0x315959){return db[_0x9dc1('0x17')][_0x9dc1('0x35')]({'where':{'id':_0x4c6a79[_0x9dc1('0x34')]['id']}})['then'](handleEntityNotFound(_0x315959,null))['then'](removeEntity(_0x315959,null))[_0x9dc1('0x41')](handleError(_0x315959,null));};exports[_0x9dc1('0x42')]=function(_0x14ab53,_0x584ef){return db[_0x9dc1('0x17')][_0x9dc1('0x43')]({'where':{'id':_0x14ab53[_0x9dc1('0x34')]['id']},'raw':!![]})['then'](function(_0x3a4648){if(!_0x3a4648)return _0x584ef[_0x9dc1('0x7')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x3a4648,_0x14ab53['user']['id'])};})[_0x9dc1('0x11')](respondWithResult(_0x584ef,null))[_0x9dc1('0x41')](handleError(_0x584ef,null));};exports[_0x9dc1('0x44')]=function(_0x329b99,_0x2a33f0){var _0x1f7023=_0x329b99[_0x9dc1('0x37')];var _0x5e5f29;var _0x3215b2;if(_0x1f7023[_0x9dc1('0x13')])throw _0x1f7023;redis['get'](_0x1f7023['state'])['then'](function(_0x3b84db){if(!_0x3b84db)throw new Error(_0x9dc1('0x45'));_0x5e5f29=JSON['parse'](_0x3b84db);var _0x568455=Buffer['from'](_0x1f7023[_0x9dc1('0x46')],_0x9dc1('0x47'))[_0x9dc1('0x48')]('ascii');_0x3215b2=JSON[_0x9dc1('0x49')](_0x568455);if(!oauth[_0x9dc1('0x4a')](_0x1f7023[_0x9dc1('0x4b')],_0x5e5f29[_0x9dc1('0x4c')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x9dc1('0x4d')](_0x1f7023[_0x9dc1('0x46')]);return oauth['getOauth2MicrosoftAccessToken'](_0x1f7023[_0x9dc1('0x4e')],_0x5e5f29);})[_0x9dc1('0x11')](function(_0x2d7355){_0x5e5f29['data5']=_0x2d7355['access_token'];_0x5e5f29[_0x9dc1('0x4f')]=_0x2d7355[_0x9dc1('0x50')];return db[_0x9dc1('0x17')][_0x9dc1('0x10')]({'data5':_0x5e5f29[_0x9dc1('0x51')],'data6':_0x5e5f29[_0x9dc1('0x4f')]},{'where':{'id':_0x5e5f29['id']}});})[_0x9dc1('0x11')](function(){oauth[_0x9dc1('0x52')](_0x5e5f29);socket[_0x9dc1('0x53')](_0x9dc1('0x54'),{'id':_0x3215b2['id']});return;})[_0x9dc1('0x11')](respondWithStatusCode(_0x2a33f0,null))['catch'](function(_0x49eef4){if(_0x3215b2){socket['emit'](_0x9dc1('0x55'),{'id':_0x3215b2['id']});}if(!_0x5e5f29){logger[_0x9dc1('0x13')](_0x9dc1('0x56'),_0x49eef4);return _0x2a33f0[_0x9dc1('0x9')](0x1f4)[_0x9dc1('0x57')](_0x49eef4[_0x9dc1('0x58')]);}logger[_0x9dc1('0x13')](_0x9dc1('0x59'),_0x5e5f29['id'],JSON['stringify'](_0x49eef4));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 5012dc6..45cf1bd 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 _0x2c31=['../../config/logger','moment','bluebird','request-promise','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','lodash','util'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0x2c31,0x132));var _0x12c3=function(_0x4caeda,_0x427222){_0x4caeda=_0x4caeda-0x0;var _0x2ce18b=_0x2c31[_0x4caeda];return _0x2ce18b;};'use strict';var _=require(_0x12c3('0x0'));var util=require(_0x12c3('0x1'));var logger=require(_0x12c3('0x2'))('api');var moment=require(_0x12c3('0x3'));var BPromise=require(_0x12c3('0x4'));var rp=require(_0x12c3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x12c3('0x6'));var config=require('../../config/environment');var attributes=require(_0x12c3('0x7'));module[_0x12c3('0x8')]=function(_0x2a7b5c,_0x367d4f){return _0x2a7b5c[_0x12c3('0x9')](_0x12c3('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x298f=['../../config/environment','exports','define','CloudProvider','cloud_providers','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2e0cd1,_0x381dc8){var _0x5766b9=function(_0x36ac6d){while(--_0x36ac6d){_0x2e0cd1['push'](_0x2e0cd1['shift']());}};_0x5766b9(++_0x381dc8);}(_0x298f,0x1e6));var _0xf298=function(_0xf9298e,_0x1f89ff){_0xf9298e=_0xf9298e-0x0;var _0xb34965=_0x298f[_0xf9298e];return _0xb34965;};'use strict';var _=require(_0xf298('0x0'));var util=require(_0xf298('0x1'));var logger=require('../../config/logger')(_0xf298('0x2'));var moment=require(_0xf298('0x3'));var BPromise=require(_0xf298('0x4'));var rp=require(_0xf298('0x5'));var fs=require('fs');var path=require(_0xf298('0x6'));var rimraf=require(_0xf298('0x7'));var config=require(_0xf298('0x8'));var attributes=require('./cloudProvider.attributes');module[_0xf298('0x9')]=function(_0xaf090d,_0x3bb402){return _0xaf090d[_0xf298('0xa')](_0xf298('0xb'),attributes,{'tableName':_0xf298('0xc'),'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 e08dcec..d82105d 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 _0x12c0=['https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','data7','Outlook365','Dynamics365','replace','data2','id_token','from','stringify','toString','base64','data1','response_type','join','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','set','aud','audience','isAfter','unix','exp','resolve','data3','findOne','then','refresh_token','decryptString','{TENANT_ID}','data5','access_token','update','data6','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','POST','intervals','bind','CloudProvider','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','request-promise','../../config/environment','../../config/logger','api','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access'];(function(_0x136532,_0x5a6219){var _0x1c8a04=function(_0x3c07ae){while(--_0x3c07ae){_0x136532['push'](_0x136532['shift']());}};_0x1c8a04(++_0x5a6219);}(_0x12c0,0x172));var _0x012c=function(_0x578d9e,_0x17f9fb){_0x578d9e=_0x578d9e-0x0;var _0x717f26=_0x12c0[_0x578d9e];return _0x717f26;};'use strict';var _=require(_0x012c('0x0'));var crypto=require(_0x012c('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x012c('0x2'));var Redis=require('ioredis');var rp=require(_0x012c('0x3'));var util=require('util');var encryptor=require('../../components/encryptor');var config=require(_0x012c('0x4'));var logger=require(_0x012c('0x5'))(_0x012c('0x6'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0x012c('0x7')]=_[_0x012c('0x8')](config[_0x012c('0x7')],{'host':_0x012c('0x9'),'port':0x18eb});var redis=new Redis(config[_0x012c('0x7')]);var MICROSOFT_AUTH_URL=_0x012c('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0x012c('0xb'),_0x012c('0xc'),_0x012c('0xd'),_0x012c('0xe'),_0x012c('0xf'),_0x012c('0x10'),_0x012c('0x11')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x012c('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x012c('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1fc134){var _0x133b76=_[_0x012c('0x14')](AZURE_AUTH_SCOPES[_0x1fc134[_0x012c('0x15')]]);if(_0x1fc134[_0x012c('0x15')]==='Dynamics365')_0x133b76[_0x012c('0x16')](_0x1fc134[_0x012c('0x17')]+'/.default');return _0x133b76['join']('\x20');}function getAccessTokenScope(_0x56ecf2){if(_0x56ecf2[_0x012c('0x15')]===_0x012c('0x18'))return _0x012c('0xf');if(_0x56ecf2[_0x012c('0x15')]===_0x012c('0x19'))return _0x56ecf2[_0x012c('0x17')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x52ed29,_0x1048e4){var _0x97584a=MICROSOFT_AUTH_URL[_0x012c('0x1a')]('{TENANT_ID}',_0x52ed29[_0x012c('0x1b')]);var _0x3f2a1e=['code',_0x012c('0x1c')];var _0xf6f329=Buffer[_0x012c('0x1d')](JSON[_0x012c('0x1e')]({'id':_0x1048e4}))[_0x012c('0x1f')](_0x012c('0x20'));var _0x393fcf=crypto['randomBytes'](0x10)[_0x012c('0x1f')]('hex');var _0x3f87a5=getAuthorizationScopes(_0x52ed29);var _0x2d3f9b=[{'key':'client_id','value':_0x52ed29[_0x012c('0x21')]},{'key':_0x012c('0x22'),'value':encodeURIComponent(_0x3f2a1e[_0x012c('0x23')]('\x20'))},{'key':_0x012c('0x24'),'value':_0x52ed29[_0x012c('0x25')]},{'key':_0x012c('0x26'),'value':_0x012c('0x27')},{'key':'scope','value':encodeURIComponent(_0x3f87a5)},{'key':_0x012c('0x28'),'value':_0xf6f329},{'key':_0x012c('0x29'),'value':_0x393fcf},{'key':_0x012c('0x2a'),'value':_0x012c('0x2b')}];var _0x1e8620=_0x97584a+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x2d3f9b,function(_0x300f2f){return _0x300f2f[_0x012c('0x2c')]+'='+_0x300f2f[_0x012c('0x2d')];})[_0x012c('0x23')]('&');_0x52ed29[_0x012c('0x2e')]={'issuer':_0x97584a[_0x012c('0x1a')](_0x012c('0x2f'),''),'audience':_0x52ed29['data1'],'state':_0xf6f329,'nonce':_0x393fcf};redis[_0x012c('0x30')](_0xf6f329,JSON[_0x012c('0x1e')](_0x52ed29));return _0x1e8620;}function isValidIdToken(_0x313eae,_0xcc0661){try{var _0x44d241=jwt['decode'](_0x313eae,{'complete':!![]});var _0x36dcde=_0x44d241['payload'];if(_0x36dcde['iss']!==_0xcc0661['issuer'])return![];if(_0x36dcde[_0x012c('0x31')]!==_0xcc0661[_0x012c('0x32')])return![];if(_0x36dcde[_0x012c('0x29')]!==_0xcc0661[_0x012c('0x29')])return![];if(moment()[_0x012c('0x33')](moment[_0x012c('0x34')](_0x36dcde[_0x012c('0x35')])))return![];return!![];}catch(_0x48fce8){throw _0x48fce8;}}function refreshOauth2MicrosoftAccessToken(_0x385b71){return Promise[_0x012c('0x36')]()['then'](function(){if(_0x385b71[_0x012c('0x37')])return _0x385b71;return db['CloudProvider'][_0x012c('0x38')]({'where':{'id':_0x385b71['id']},'raw':!![]});})[_0x012c('0x39')](function(_0x34b221){var _0x15e998={'grant_type':_0x012c('0x3a'),'refresh_token':_0x34b221['data6'],'scope':getAccessTokenScope(_0x34b221),'redirect_uri':_0x34b221['data4'],'client_id':_0x34b221[_0x012c('0x21')],'client_secret':encryptor[_0x012c('0x3b')](_0x34b221['data3'])};var _0x4da511={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x012c('0x3c'),_0x34b221[_0x012c('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x15e998,'json':!![]};return rp(_0x4da511);})[_0x012c('0x39')](function(_0xeda1c6){_0x385b71[_0x012c('0x3d')]=_0xeda1c6[_0x012c('0x3e')];_0x385b71['data6']=_0xeda1c6[_0x012c('0x3a')];return db['CloudProvider'][_0x012c('0x3f')]({'data5':_0x385b71[_0x012c('0x3d')],'data6':_0x385b71[_0x012c('0x40')]},{'where':{'id':_0x385b71['id']}});})[_0x012c('0x39')](function(){return _0x385b71;})[_0x012c('0x41')](function(_0x15a84c){logger[_0x012c('0x42')](_0x012c('0x43'),_0x385b71['id'],_0x15a84c);});}function getOauth2MicrosoftAccessToken(_0x572d6f,_0x3616c5){var _0x4136ea={'grant_type':'authorization_code','code':_0x572d6f,'scope':getAccessTokenScope(_0x3616c5),'redirect_uri':_0x3616c5['data4'],'client_id':_0x3616c5[_0x012c('0x21')],'client_secret':encryptor[_0x012c('0x3b')](_0x3616c5[_0x012c('0x37')])};var _0x4a3489={'method':_0x012c('0x44'),'uri':MICROSOFT_AUTH_URL[_0x012c('0x1a')](_0x012c('0x3c'),_0x3616c5['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4136ea,'json':!![]};return rp(_0x4a3489);}function startRefreshInterval(_0x1a140f){var _0x4f7101=schedule[_0x012c('0x45')];if(_0x4f7101[_0x1a140f['id']])clearInterval(_0x4f7101[_0x1a140f['id']]);_0x4f7101[_0x1a140f['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x012c('0x46')](this,{'id':_0x1a140f['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x012c('0x45')]=_0x4f7101;}function startAllRefreshIntervals(){return db[_0x012c('0x47')][_0x012c('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x012c('0x39')](function(_0x402007){var _0x168871=_0x402007[_0x012c('0x14')](function(_0x42f3b0){return refreshOauth2MicrosoftAccessToken(_0x42f3b0)[_0x012c('0x39')](function(_0x58bf2b){startRefreshInterval(_0x58bf2b);});});return Promise[_0x012c('0x49')](_0x168871);})[_0x012c('0x41')](function(_0x18cb06){var _0x56c7ee=_0x18cb06?util[_0x012c('0x4a')](_0x18cb06,{'showHidden':![],'depth':null}):'';logger[_0x012c('0x42')](_0x012c('0x4b'),_0x56c7ee);});}module[_0x012c('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x738b=['value','oauth2Claims','oauth2/','decode','payload','iss','aud','unix','exp','resolve','then','CloudProvider','data6','data1','decryptString','POST','replace','data5','access_token','refresh_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data3','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','type','Dynamics365','/.default','join','Outlook365','data7','{TENANT_ID}','data2','code','from','stringify','toString','base64','randomBytes','response_type','redirect_uri','data4','response_mode','state','nonce','prompt','login','map','key'];(function(_0x2278d4,_0x3ebf8e){var _0x25f2ee=function(_0x5a54a8){while(--_0x5a54a8){_0x2278d4['push'](_0x2278d4['shift']());}};_0x25f2ee(++_0x3ebf8e);}(_0x738b,0x192));var _0xb738=function(_0xacdaf2,_0x4ac4d5){_0xacdaf2=_0xacdaf2-0x0;var _0x6c4568=_0x738b[_0xacdaf2];return _0x6c4568;};'use strict';var _=require('lodash');var crypto=require(_0xb738('0x0'));var jwt=require(_0xb738('0x1'));var moment=require(_0xb738('0x2'));var Redis=require('ioredis');var rp=require(_0xb738('0x3'));var util=require(_0xb738('0x4'));var encryptor=require(_0xb738('0x5'));var config=require(_0xb738('0x6'));var logger=require('../../config/logger')(_0xb738('0x7'));var schedule=require(_0xb738('0x8'));var db=require('../../mysqldb')['db'];config[_0xb738('0x9')]=_['defaults'](config['redis'],{'host':_0xb738('0xa'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xb738('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xb738('0xc'),_0xb738('0xd'),_0xb738('0xe'),'offline_access',_0xb738('0xf'),'https://outlook.office.com/POP.AccessAsUser.All',_0xb738('0x10')],'Dynamics365':[_0xb738('0xc'),_0xb738('0x11')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5928de){var _0x4f13ef=_['map'](AZURE_AUTH_SCOPES[_0x5928de[_0xb738('0x12')]]);if(_0x5928de[_0xb738('0x12')]===_0xb738('0x13'))_0x4f13ef['push'](_0x5928de['data7']+_0xb738('0x14'));return _0x4f13ef[_0xb738('0x15')]('\x20');}function getAccessTokenScope(_0xc54b5e){if(_0xc54b5e['type']===_0xb738('0x16'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0xc54b5e['type']===_0xb738('0x13'))return _0xc54b5e[_0xb738('0x17')]+_0xb738('0x14');}function generateMicrosoftAuthorizationUrl(_0x2fbf41,_0x206067){var _0x2e9c19=MICROSOFT_AUTH_URL['replace'](_0xb738('0x18'),_0x2fbf41[_0xb738('0x19')]);var _0x2cc462=[_0xb738('0x1a'),'id_token'];var _0x2cc5fd=Buffer[_0xb738('0x1b')](JSON[_0xb738('0x1c')]({'id':_0x206067}))[_0xb738('0x1d')](_0xb738('0x1e'));var _0x22074d=crypto[_0xb738('0x1f')](0x10)['toString']('hex');var _0x21dea1=getAuthorizationScopes(_0x2fbf41);var _0x496623=[{'key':'client_id','value':_0x2fbf41['data1']},{'key':_0xb738('0x20'),'value':encodeURIComponent(_0x2cc462[_0xb738('0x15')]('\x20'))},{'key':_0xb738('0x21'),'value':_0x2fbf41[_0xb738('0x22')]},{'key':_0xb738('0x23'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x21dea1)},{'key':_0xb738('0x24'),'value':_0x2cc5fd},{'key':_0xb738('0x25'),'value':_0x22074d},{'key':_0xb738('0x26'),'value':_0xb738('0x27')}];var _0x2cf99d=_0x2e9c19+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb738('0x28')](_0x496623,function(_0x2a5f29){return _0x2a5f29[_0xb738('0x29')]+'='+_0x2a5f29[_0xb738('0x2a')];})[_0xb738('0x15')]('&');_0x2fbf41[_0xb738('0x2b')]={'issuer':_0x2e9c19['replace'](_0xb738('0x2c'),''),'audience':_0x2fbf41['data1'],'state':_0x2cc5fd,'nonce':_0x22074d};redis['set'](_0x2cc5fd,JSON[_0xb738('0x1c')](_0x2fbf41));return _0x2cf99d;}function isValidIdToken(_0x8829f9,_0x34cf78){try{var _0x5357f9=jwt[_0xb738('0x2d')](_0x8829f9,{'complete':!![]});var _0x18fb02=_0x5357f9[_0xb738('0x2e')];if(_0x18fb02[_0xb738('0x2f')]!==_0x34cf78['issuer'])return![];if(_0x18fb02[_0xb738('0x30')]!==_0x34cf78['audience'])return![];if(_0x18fb02[_0xb738('0x25')]!==_0x34cf78[_0xb738('0x25')])return![];if(moment()['isAfter'](moment[_0xb738('0x31')](_0x18fb02[_0xb738('0x32')])))return![];return!![];}catch(_0x4f8df4){throw _0x4f8df4;}}function refreshOauth2MicrosoftAccessToken(_0x2607ad){return Promise[_0xb738('0x33')]()[_0xb738('0x34')](function(){if(_0x2607ad['data3'])return _0x2607ad;return db[_0xb738('0x35')]['findOne']({'where':{'id':_0x2607ad['id']},'raw':!![]});})['then'](function(_0x9e4214){var _0x1434ea={'grant_type':'refresh_token','refresh_token':_0x9e4214[_0xb738('0x36')],'scope':getAccessTokenScope(_0x9e4214),'redirect_uri':_0x9e4214['data4'],'client_id':_0x9e4214[_0xb738('0x37')],'client_secret':encryptor[_0xb738('0x38')](_0x9e4214['data3'])};var _0xca50cd={'method':_0xb738('0x39'),'uri':MICROSOFT_AUTH_URL[_0xb738('0x3a')](_0xb738('0x18'),_0x9e4214['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1434ea,'json':!![]};return rp(_0xca50cd);})[_0xb738('0x34')](function(_0x481a85){_0x2607ad[_0xb738('0x3b')]=_0x481a85[_0xb738('0x3c')];_0x2607ad['data6']=_0x481a85[_0xb738('0x3d')];return db[_0xb738('0x35')][_0xb738('0x3e')]({'data5':_0x2607ad[_0xb738('0x3b')],'data6':_0x2607ad[_0xb738('0x36')]},{'where':{'id':_0x2607ad['id']}});})[_0xb738('0x34')](function(){return _0x2607ad;})[_0xb738('0x3f')](function(_0x39989e){logger[_0xb738('0x40')](_0xb738('0x41'),_0x2607ad['id'],_0x39989e);});}function getOauth2MicrosoftAccessToken(_0x5d0adb,_0x4f1f8f){var _0xf21d29={'grant_type':_0xb738('0x42'),'code':_0x5d0adb,'scope':getAccessTokenScope(_0x4f1f8f),'redirect_uri':_0x4f1f8f[_0xb738('0x22')],'client_id':_0x4f1f8f[_0xb738('0x37')],'client_secret':encryptor[_0xb738('0x38')](_0x4f1f8f[_0xb738('0x43')])};var _0x5eb069={'method':_0xb738('0x39'),'uri':MICROSOFT_AUTH_URL[_0xb738('0x3a')]('{TENANT_ID}',_0x4f1f8f['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xf21d29,'json':!![]};return rp(_0x5eb069);}function startRefreshInterval(_0xa9d2bd){var _0x56b1d5=schedule[_0xb738('0x44')];if(_0x56b1d5[_0xa9d2bd['id']])clearInterval(_0x56b1d5[_0xa9d2bd['id']]);_0x56b1d5[_0xa9d2bd['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xb738('0x45')](this,{'id':_0xa9d2bd['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xb738('0x44')]=_0x56b1d5;}function startAllRefreshIntervals(){return db[_0xb738('0x35')][_0xb738('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xb738('0x34')](function(_0x5f732f){var _0x5627f3=_0x5f732f[_0xb738('0x28')](function(_0x59b7ab){return refreshOauth2MicrosoftAccessToken(_0x59b7ab)[_0xb738('0x34')](function(_0x55d067){startRefreshInterval(_0x55d067);});});return Promise[_0xb738('0x47')](_0x5627f3);})['catch'](function(_0x3b994c){var _0x2485f9=_0x3b994c?util[_0xb738('0x48')](_0x3b994c,{'showHidden':![],'depth':null}):'';logger[_0xb738('0x40')](_0xb738('0x49'),_0x2485f9);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index b5cdb0b..ca157bd 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 _0xa809=['error','message','info','result','catch','util','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x224ad4,_0x4db500){var _0x22a5d9=function(_0x233515){while(--_0x233515){_0x224ad4['push'](_0x224ad4['shift']());}};_0x22a5d9(++_0x4db500);}(_0xa809,0x1f3));var _0x9a80=function(_0x1d070d,_0x44b1dc){_0x1d070d=_0x1d070d-0x0;var _0x150d9f=_0xa809[_0x1d070d];return _0x150d9f;};'use strict';var _=require('lodash');var util=require(_0x9a80('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9a80('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9a80('0x2'))(_0x9a80('0x3'));var config=require(_0x9a80('0x4'));var jayson=require(_0x9a80('0x5'));var client=jayson['client'][_0x9a80('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x504ba8,_0x17b704,_0x286ac5){return new BPromise(function(_0x4ea507,_0x1ef67a){return client[_0x9a80('0x7')](_0x504ba8,_0x286ac5)[_0x9a80('0x8')](function(_0x269ee2){logger['info'](_0x9a80('0x9'),_0x17b704,_0x9a80('0xa'));logger[_0x9a80('0xb')](_0x9a80('0xc'),_0x17b704,_0x9a80('0xa'),JSON[_0x9a80('0xd')](_0x269ee2));if(_0x269ee2[_0x9a80('0xe')]){if(_0x269ee2[_0x9a80('0xe')]['code']===0x1f4){logger[_0x9a80('0xe')](_0x9a80('0x9'),_0x17b704,_0x269ee2[_0x9a80('0xe')][_0x9a80('0xf')]);return _0x1ef67a(_0x269ee2[_0x9a80('0xe')][_0x9a80('0xf')]);}logger[_0x9a80('0xe')](_0x9a80('0x9'),_0x17b704,_0x269ee2['error'][_0x9a80('0xf')]);return _0x4ea507(_0x269ee2['error'][_0x9a80('0xf')]);}else{logger[_0x9a80('0x10')](_0x9a80('0x9'),_0x17b704,'request\x20sent');_0x4ea507(_0x269ee2[_0x9a80('0x11')][_0x9a80('0xf')]);}})[_0x9a80('0x12')](function(_0x12ecee){logger[_0x9a80('0xe')]('CloudProvider,\x20%s,\x20%s',_0x17b704,_0x12ecee);_0x1ef67a(_0x12ecee);});});}
\ No newline at end of file
+var _0x3d45=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','then','info','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x1174a4,_0x53e376){var _0x26e5e0=function(_0x26acc2){while(--_0x26acc2){_0x1174a4['push'](_0x1174a4['shift']());}};_0x26e5e0(++_0x53e376);}(_0x3d45,0x1d2));var _0x53d4=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d45[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x53d4('0x0'));var util=require(_0x53d4('0x1'));var moment=require(_0x53d4('0x2'));var BPromise=require(_0x53d4('0x3'));var rs=require(_0x53d4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53d4('0x5'))['db'];var utils=require(_0x53d4('0x6'));var logger=require('../../config/logger')(_0x53d4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x235ee0,_0xbfffb2,_0x2c7029){return new BPromise(function(_0xdbf204,_0x39ff2a){return client['request'](_0x235ee0,_0x2c7029)[_0x53d4('0x8')](function(_0x20b209){logger[_0x53d4('0x9')]('CloudProvider,\x20%s,\x20%s',_0xbfffb2,_0x53d4('0xa'));logger['debug'](_0x53d4('0xb'),_0xbfffb2,_0x53d4('0xa'),JSON[_0x53d4('0xc')](_0x20b209));if(_0x20b209[_0x53d4('0xd')]){if(_0x20b209[_0x53d4('0xd')]['code']===0x1f4){logger[_0x53d4('0xd')](_0x53d4('0xe'),_0xbfffb2,_0x20b209[_0x53d4('0xd')]['message']);return _0x39ff2a(_0x20b209[_0x53d4('0xd')][_0x53d4('0xf')]);}logger['error'](_0x53d4('0xe'),_0xbfffb2,_0x20b209['error'][_0x53d4('0xf')]);return _0xdbf204(_0x20b209[_0x53d4('0xd')][_0x53d4('0xf')]);}else{logger['info'](_0x53d4('0xe'),_0xbfffb2,_0x53d4('0xa'));_0xdbf204(_0x20b209[_0x53d4('0x10')][_0x53d4('0xf')]);}})[_0x53d4('0x11')](function(_0x503259){logger[_0x53d4('0xd')](_0x53d4('0xe'),_0xbfffb2,_0x503259);_0x39ff2a(_0x503259);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index bcb5a44..a73932d 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x56c70f,_0x4e4493){var _0x3812ed=function(_0x25460f){while(--_0x25460f){_0x56c70f['push'](_0x56c70f['shift']());}};_0x3812ed(++_0x4e4493);}(_0x1261,0x144));var _0x1126=function(_0x2dd976,_0x1b5dc4){_0x2dd976=_0x2dd976-0x0;var _0x2265fd=_0x1261[_0x2dd976];return _0x2265fd;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
+var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x483102,_0x54e93d){var _0x5cc885=function(_0x54931c){while(--_0x54931c){_0x483102['push'](_0x483102['shift']());}};_0x5cc885(++_0x54e93d);}(_0x1261,0x144));var _0x1126=function(_0x35021f,_0x451349){_0x35021f=_0x35021f-0x0;var _0x1044e9=_0x1261[_0x35021f];return _0x1044e9;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index c5304f1..8e0d596 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 _0x605c=['exports','STRING','name','sequelize'];(function(_0x3f0fa8,_0x5173be){var _0x51a920=function(_0x52f0f6){while(--_0x52f0f6){_0x3f0fa8['push'](_0x3f0fa8['shift']());}};_0x51a920(++_0x5173be);}(_0x605c,0x1db));var _0xc605=function(_0x1e0c05,_0x2f76dc){_0x1e0c05=_0x1e0c05-0x0;var _0x423b89=_0x605c[_0x1e0c05];return _0x423b89;};'use strict';var Sequelize=require(_0xc605('0x0'));module[_0xc605('0x1')]={'name':{'type':Sequelize[_0xc605('0x2')],'unique':_0xc605('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc605('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xc605('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc605('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xc605('0x2')]},'postalCode':{'type':Sequelize[_0xc605('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xc605('0x2')]},'email':{'type':Sequelize[_0xc605('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xc605('0x2')]},'sCity':{'type':Sequelize[_0xc605('0x2')]},'sCountry':{'type':Sequelize[_0xc605('0x2')]},'description':{'type':Sequelize[_0xc605('0x2')]}};
\ No newline at end of file
+var _0xb0ff=['STRING','exports'];(function(_0x408a76,_0x24dbb4){var _0x19f1bc=function(_0x58fa79){while(--_0x58fa79){_0x408a76['push'](_0x408a76['shift']());}};_0x19f1bc(++_0x24dbb4);}(_0xb0ff,0xb3));var _0xfb0f=function(_0x247cb3,_0x4e54f9){_0x247cb3=_0x247cb3-0x0;var _0x537741=_0xb0ff[_0x247cb3];return _0x537741;};'use strict';var Sequelize=require('sequelize');module[_0xfb0f('0x0')]={'name':{'type':Sequelize[_0xfb0f('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xfb0f('0x1')]},'companyId':{'type':Sequelize[_0xfb0f('0x1')]},'website':{'type':Sequelize[_0xfb0f('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xfb0f('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xfb0f('0x1')]},'postalCode':{'type':Sequelize[_0xfb0f('0x1')]},'city':{'type':Sequelize[_0xfb0f('0x1')]},'country':{'type':Sequelize[_0xfb0f('0x1')]},'email':{'type':Sequelize[_0xfb0f('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xfb0f('0x1')]},'sStreet':{'type':Sequelize[_0xfb0f('0x1')]},'sPostalCode':{'type':Sequelize[_0xfb0f('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xfb0f('0x1')]},'description':{'type':Sequelize[_0xfb0f('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index bfd6c1d..97c6d6d 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 _0xfe44=['limit','count','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','describe','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','offset','sort','pick','merge','where','options','include','CmCompany','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','user','role','Companies','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','order','filter','map','getContacts','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined'];(function(_0x134832,_0x4ec0f2){var _0x603c62=function(_0x4ae9f1){while(--_0x4ae9f1){_0x134832['push'](_0x134832['shift']());}};_0x603c62(++_0x4ec0f2);}(_0xfe44,0xf0));var _0x4fe4=function(_0x2f263c,_0x19cf6d){_0x2f263c=_0x2f263c-0x0;var _0x203e23=_0xfe44[_0x2f263c];return _0x203e23;};'use strict';var emlformat=require(_0x4fe4('0x0'));var rimraf=require(_0x4fe4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4fe4('0x2'));var rp=require(_0x4fe4('0x3'));var moment=require(_0x4fe4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4fe4('0x5'));var util=require(_0x4fe4('0x6'));var path=require(_0x4fe4('0x7'));var sox=require(_0x4fe4('0x8'));var csv=require('to-csv');var ejs=require(_0x4fe4('0x9'));var fs=require('fs');var fs_extra=require(_0x4fe4('0xa'));var _=require(_0x4fe4('0xb'));var squel=require(_0x4fe4('0xc'));var crypto=require('crypto');var jsforce=require(_0x4fe4('0xd'));var deskjs=require(_0x4fe4('0xe'));var toCsv=require(_0x4fe4('0xf'));var querystring=require(_0x4fe4('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4fe4('0x11'));var qs=require(_0x4fe4('0x12'));var as=require(_0x4fe4('0x13'));var hardwareService=require(_0x4fe4('0x14'));var logger=require(_0x4fe4('0x15'))('api');var utils=require(_0x4fe4('0x16'));var config=require(_0x4fe4('0x17'));var licenseUtil=require(_0x4fe4('0x18'));var db=require(_0x4fe4('0x19'))['db'];function respondWithStatusCode(_0x2316e9,_0x739028){_0x739028=_0x739028||0xcc;return function(_0x50fe0f){if(_0x50fe0f){return _0x2316e9['sendStatus'](_0x739028);}return _0x2316e9[_0x4fe4('0x1a')](_0x739028)[_0x4fe4('0x1b')]();};}function respondWithResult(_0x3b6689,_0x1981be){_0x1981be=_0x1981be||0xc8;return function(_0x2598ac){if(_0x2598ac){return _0x3b6689[_0x4fe4('0x1a')](_0x1981be)[_0x4fe4('0x1c')](_0x2598ac);}};}function respondWithFilteredResult(_0x512cec,_0x317ff8){return function(_0x38b701){if(_0x38b701){var _0x322f50=typeof _0x317ff8['offset']===_0x4fe4('0x1d')&&typeof _0x317ff8[_0x4fe4('0x1e')]===_0x4fe4('0x1d');var _0x511c53=_0x38b701[_0x4fe4('0x1f')];var _0x345a1e=_0x322f50?0x0:_0x317ff8['offset'];var _0x18efb6=_0x322f50?_0x38b701['count']:_0x317ff8['offset']+_0x317ff8['limit'];var _0x5b9edf;if(_0x18efb6>=_0x511c53){_0x18efb6=_0x511c53;_0x5b9edf=0xc8;}else{_0x5b9edf=0xce;}_0x512cec[_0x4fe4('0x1a')](_0x5b9edf);return _0x512cec[_0x4fe4('0x20')](_0x4fe4('0x21'),_0x345a1e+'-'+_0x18efb6+'/'+_0x511c53)[_0x4fe4('0x1c')](_0x38b701);}return null;};}function patchUpdates(_0x52dc78){return function(_0x1bd1fd){try{jsonpatch[_0x4fe4('0x22')](_0x1bd1fd,_0x52dc78,!![]);}catch(_0x4b69e6){return BPromise['reject'](_0x4b69e6);}return _0x1bd1fd[_0x4fe4('0x23')]();};}function saveUpdates(_0x247a19,_0x17f100){return function(_0xd7b20d){if(_0xd7b20d){return _0xd7b20d[_0x4fe4('0x24')](_0x247a19)[_0x4fe4('0x25')](function(_0x4666ce){return _0x4666ce;});}return null;};}function removeEntity(_0x2db868,_0x9b3f82){return function(_0x256fcd){if(_0x256fcd){return _0x256fcd['destroy']()['then'](function(){var _0x2fc31f=_0x256fcd[_0x4fe4('0x26')]({'plain':!![]});var _0x352656='Companies';return db[_0x4fe4('0x27')][_0x4fe4('0x28')]({'where':{'type':_0x352656,'resourceId':_0x2fc31f['id']}})[_0x4fe4('0x25')](function(){return _0x256fcd;});})[_0x4fe4('0x25')](function(){_0x2db868['status'](0xcc)[_0x4fe4('0x1b')]();});}};}function handleEntityNotFound(_0x552f00,_0xd65cb0){return function(_0x3b34c2){if(!_0x3b34c2){_0x552f00[_0x4fe4('0x29')](0x194);}return _0x3b34c2;};}function handleError(_0x1880f6,_0xa52cc6){_0xa52cc6=_0xa52cc6||0x1f4;return function(_0x315e9c){logger[_0x4fe4('0x2a')](_0x315e9c[_0x4fe4('0x2b')]);if(_0x315e9c[_0x4fe4('0x2c')]){delete _0x315e9c['name'];}_0x1880f6[_0x4fe4('0x1a')](_0xa52cc6)[_0x4fe4('0x2d')](_0x315e9c);};}exports[_0x4fe4('0x2e')]=function(_0x4f95d1,_0x5cf1ab){var _0x40247d={},_0x2a30ce={},_0x519fc8={'count':0x0,'rows':[]};return db['CmCompany'][_0x4fe4('0x2f')]()[_0x4fe4('0x25')](function(_0x50c0d8){_0x2a30ce[_0x4fe4('0x30')]=_[_0x4fe4('0x31')](_0x50c0d8);_0x2a30ce[_0x4fe4('0x32')]=_[_0x4fe4('0x31')](_0x4f95d1[_0x4fe4('0x32')]);_0x2a30ce[_0x4fe4('0x33')]=_['intersection'](_0x2a30ce[_0x4fe4('0x30')],_0x2a30ce[_0x4fe4('0x32')]);_0x40247d[_0x4fe4('0x34')]=_[_0x4fe4('0x35')](_0x2a30ce['model'],qs[_0x4fe4('0x36')](_0x4f95d1[_0x4fe4('0x32')][_0x4fe4('0x36')]));_0x40247d[_0x4fe4('0x34')]=_0x40247d[_0x4fe4('0x34')]['length']?_0x40247d[_0x4fe4('0x34')]:_0x2a30ce[_0x4fe4('0x30')];if(!_0x4f95d1[_0x4fe4('0x32')][_0x4fe4('0x37')](_0x4fe4('0x38'))){_0x40247d['limit']=qs[_0x4fe4('0x1e')](_0x4f95d1[_0x4fe4('0x32')][_0x4fe4('0x1e')]);_0x40247d[_0x4fe4('0x39')]=qs['offset'](_0x4f95d1[_0x4fe4('0x32')]['offset']);}_0x40247d['order']=qs[_0x4fe4('0x3a')](_0x4f95d1[_0x4fe4('0x32')]['sort']);_0x40247d['where']=qs[_0x4fe4('0x33')](_[_0x4fe4('0x3b')](_0x4f95d1[_0x4fe4('0x32')],_0x2a30ce[_0x4fe4('0x33')]),_0x50c0d8);if(_0x4f95d1['query']['filter']){_0x40247d['where']=_[_0x4fe4('0x3c')](_0x40247d[_0x4fe4('0x3d')],{'$or':_['map'](_0x40247d[_0x4fe4('0x34')],function(_0x3c080d){var _0x2fe4c6={};_0x2fe4c6[_0x3c080d]={'$like':'%'+_0x4f95d1[_0x4fe4('0x32')]['filter']+'%'};return _0x2fe4c6;})});}_0x40247d=_[_0x4fe4('0x3c')]({},_0x40247d,_0x4f95d1[_0x4fe4('0x3e')]);var _0x5120da={'where':_0x40247d[_0x4fe4('0x3d')]};return db['CmCompany'][_0x4fe4('0x1f')](_0x5120da)['then'](function(_0x2ff17b){_0x519fc8[_0x4fe4('0x1f')]=_0x2ff17b;if(_0x4f95d1[_0x4fe4('0x32')]['includeAll']){_0x40247d[_0x4fe4('0x3f')]=[{'all':!![]}];}return db[_0x4fe4('0x40')][_0x4fe4('0x41')](_0x40247d);})[_0x4fe4('0x25')](function(_0x3ad85e){_0x519fc8[_0x4fe4('0x42')]=_0x3ad85e;return _0x519fc8;})[_0x4fe4('0x25')](respondWithFilteredResult(_0x5cf1ab,_0x40247d))[_0x4fe4('0x43')](handleError(_0x5cf1ab,null));})[_0x4fe4('0x43')](handleError(_0x5cf1ab,null));};exports[_0x4fe4('0x44')]=function(_0x39a04b,_0x346127){var _0x5ab324={'raw':![],'where':{'id':_0x39a04b[_0x4fe4('0x45')]['id']}},_0x1e9b0d={};_0x1e9b0d[_0x4fe4('0x30')]=_['keys'](db[_0x4fe4('0x40')][_0x4fe4('0x46')]);_0x1e9b0d[_0x4fe4('0x32')]=_[_0x4fe4('0x31')](_0x39a04b[_0x4fe4('0x32')]);_0x1e9b0d[_0x4fe4('0x33')]=_[_0x4fe4('0x35')](_0x1e9b0d[_0x4fe4('0x30')],_0x1e9b0d['query']);_0x5ab324['attributes']=_[_0x4fe4('0x35')](_0x1e9b0d[_0x4fe4('0x30')],qs[_0x4fe4('0x36')](_0x39a04b[_0x4fe4('0x32')]['fields']));_0x5ab324[_0x4fe4('0x34')]=_0x5ab324[_0x4fe4('0x34')][_0x4fe4('0x47')]?_0x5ab324['attributes']:_0x1e9b0d[_0x4fe4('0x30')];if(_0x39a04b[_0x4fe4('0x32')][_0x4fe4('0x48')]){_0x5ab324[_0x4fe4('0x3f')]=[{'all':!![]}];}_0x5ab324=_[_0x4fe4('0x3c')]({},_0x5ab324,_0x39a04b[_0x4fe4('0x3e')]);return db[_0x4fe4('0x40')][_0x4fe4('0x49')](_0x5ab324)[_0x4fe4('0x25')](handleEntityNotFound(_0x346127,null))['then'](respondWithResult(_0x346127,null))[_0x4fe4('0x43')](handleError(_0x346127,null));};exports[_0x4fe4('0x4a')]=function(_0x56783c,_0x35b6cd){return db[_0x4fe4('0x40')][_0x4fe4('0x4a')](_0x56783c[_0x4fe4('0x4b')],{})[_0x4fe4('0x25')](function(_0x545202){var _0x57ad3e=_0x56783c[_0x4fe4('0x4c')][_0x4fe4('0x26')]({'plain':!![]});if(!_0x57ad3e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57ad3e[_0x4fe4('0x4d')]===_0x4fe4('0x4c')){var _0x1441c7=_0x545202[_0x4fe4('0x26')]({'plain':!![]});var _0x4c6c86=_0x4fe4('0x4e');return db[_0x4fe4('0x4f')][_0x4fe4('0x49')]({'where':{'name':_0x4c6c86,'userProfileId':_0x57ad3e[_0x4fe4('0x50')]},'raw':!![]})[_0x4fe4('0x25')](function(_0x5124c1){if(_0x5124c1&&_0x5124c1['autoAssociation']===0x0){return db[_0x4fe4('0x27')]['create']({'name':_0x1441c7['name'],'resourceId':_0x1441c7['id'],'type':_0x5124c1[_0x4fe4('0x2c')],'sectionId':_0x5124c1['id']},{})[_0x4fe4('0x25')](function(){return _0x545202;});}else{return _0x545202;}})[_0x4fe4('0x43')](function(_0x4c5385){logger[_0x4fe4('0x2a')](_0x4fe4('0x51'),_0x4c5385);throw _0x4c5385;});}return _0x545202;})[_0x4fe4('0x25')](respondWithResult(_0x35b6cd,0xc9))['catch'](handleError(_0x35b6cd,null));};exports[_0x4fe4('0x24')]=function(_0xe968f9,_0x11b20e){if(_0xe968f9[_0x4fe4('0x4b')]['id']){delete _0xe968f9[_0x4fe4('0x4b')]['id'];}return db[_0x4fe4('0x40')][_0x4fe4('0x49')]({'where':{'id':_0xe968f9[_0x4fe4('0x45')]['id']}})['then'](handleEntityNotFound(_0x11b20e,null))['then'](saveUpdates(_0xe968f9['body'],null))[_0x4fe4('0x25')](respondWithResult(_0x11b20e,null))[_0x4fe4('0x43')](handleError(_0x11b20e,null));};exports[_0x4fe4('0x28')]=function(_0x42ad1e,_0x4ef8cb){return db[_0x4fe4('0x40')]['find']({'where':{'id':_0x42ad1e[_0x4fe4('0x45')]['id']}})[_0x4fe4('0x25')](handleEntityNotFound(_0x4ef8cb,null))[_0x4fe4('0x25')](removeEntity(_0x4ef8cb,null))[_0x4fe4('0x43')](handleError(_0x4ef8cb,null));};exports[_0x4fe4('0x2f')]=function(_0x1a4472,_0x523871){return db[_0x4fe4('0x40')][_0x4fe4('0x2f')]()[_0x4fe4('0x25')](respondWithResult(_0x523871,null))[_0x4fe4('0x43')](handleError(_0x523871,null));};exports[_0x4fe4('0x52')]=function(_0x7d21cf,_0x37111e,_0x36e091){return db[_0x4fe4('0x53')][_0x4fe4('0x49')]({'where':{'id':_0x7d21cf[_0x4fe4('0x45')]['id']}})[_0x4fe4('0x25')](handleEntityNotFound(_0x37111e,null))[_0x4fe4('0x25')](function(_0x1fc911){if(_0x1fc911){return _0x1fc911[_0x4fe4('0x52')](_0x7d21cf[_0x4fe4('0x4b')][_0x4fe4('0x54')],_[_0x4fe4('0x55')](_0x7d21cf[_0x4fe4('0x4b')],[_0x4fe4('0x54'),'id'])||{});}})['then'](respondWithResult(_0x37111e,null))[_0x4fe4('0x43')](handleError(_0x37111e,null));};exports['getContacts']=function(_0x24cfe3,_0x41ebe1,_0x1a5895){var _0x28ab1c={};var _0x25a2d0={};var _0x4b42a4;var _0x36eef8;return db[_0x4fe4('0x40')]['findOne']({'where':{'id':_0x24cfe3[_0x4fe4('0x45')]['id']}})[_0x4fe4('0x25')](handleEntityNotFound(_0x41ebe1,null))['then'](function(_0x2cbba1){if(_0x2cbba1){_0x4b42a4=_0x2cbba1;_0x25a2d0[_0x4fe4('0x30')]=_['keys'](db[_0x4fe4('0x53')][_0x4fe4('0x46')]);_0x25a2d0[_0x4fe4('0x32')]=_['keys'](_0x24cfe3[_0x4fe4('0x32')]);_0x25a2d0[_0x4fe4('0x33')]=_[_0x4fe4('0x35')](_0x25a2d0[_0x4fe4('0x30')],_0x25a2d0[_0x4fe4('0x32')]);_0x28ab1c[_0x4fe4('0x34')]=_[_0x4fe4('0x35')](_0x25a2d0[_0x4fe4('0x30')],qs[_0x4fe4('0x36')](_0x24cfe3[_0x4fe4('0x32')][_0x4fe4('0x36')]));_0x28ab1c['attributes']=_0x28ab1c[_0x4fe4('0x34')][_0x4fe4('0x47')]?_0x28ab1c[_0x4fe4('0x34')]:_0x25a2d0['model'];_0x28ab1c[_0x4fe4('0x56')]=qs[_0x4fe4('0x3a')](_0x24cfe3[_0x4fe4('0x32')][_0x4fe4('0x3a')]);_0x28ab1c['where']=qs[_0x4fe4('0x33')](_[_0x4fe4('0x3b')](_0x24cfe3['query'],_0x25a2d0[_0x4fe4('0x33')]));if(_0x24cfe3[_0x4fe4('0x32')][_0x4fe4('0x57')]){_0x28ab1c['where']=_['merge'](_0x28ab1c[_0x4fe4('0x3d')],{'$or':_[_0x4fe4('0x58')](_0x28ab1c['attributes'],function(_0x45c47b){var _0x20e538={};_0x20e538[_0x45c47b]={'$like':'%'+_0x24cfe3[_0x4fe4('0x32')][_0x4fe4('0x57')]+'%'};return _0x20e538;})});}_0x28ab1c=_['merge']({},_0x28ab1c,_0x24cfe3[_0x4fe4('0x3e')]);return _0x4b42a4[_0x4fe4('0x59')](_0x28ab1c);}})['then'](function(_0x10ceb3){if(_0x10ceb3){_0x36eef8=_0x10ceb3[_0x4fe4('0x47')];if(!_0x24cfe3[_0x4fe4('0x32')][_0x4fe4('0x37')](_0x4fe4('0x38'))){_0x28ab1c[_0x4fe4('0x1e')]=qs['limit'](_0x24cfe3[_0x4fe4('0x32')][_0x4fe4('0x1e')]);_0x28ab1c[_0x4fe4('0x39')]=qs[_0x4fe4('0x39')](_0x24cfe3['query'][_0x4fe4('0x39')]);}return _0x4b42a4[_0x4fe4('0x59')](_0x28ab1c);}})[_0x4fe4('0x25')](function(_0x4590d5){if(_0x4590d5){return _0x4590d5?{'count':_0x36eef8,'rows':_0x4590d5}:null;}})[_0x4fe4('0x25')](respondWithResult(_0x41ebe1,null))[_0x4fe4('0x43')](handleError(_0x41ebe1,null));};
\ No newline at end of file
+var _0xf500=['destroy','then','Companies','stack','name','send','index','CmCompany','describe','query','keys','filters','intersection','attributes','fields','length','model','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addContacts','CmContact','ids','getContacts','findOne','order','pick','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x5859d6,_0x197158){var _0x1ed613=function(_0xbd2c4a){while(--_0xbd2c4a){_0x5859d6['push'](_0x5859d6['shift']());}};_0x1ed613(++_0x197158);}(_0xf500,0x13d));var _0x0f50=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xf500[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0x0f50('0x0'));var rimraf=require(_0x0f50('0x1'));var zipdir=require(_0x0f50('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f50('0x3'));var moment=require(_0x0f50('0x4'));var BPromise=require(_0x0f50('0x5'));var Mustache=require(_0x0f50('0x6'));var util=require(_0x0f50('0x7'));var path=require('path');var sox=require(_0x0f50('0x8'));var csv=require(_0x0f50('0x9'));var ejs=require(_0x0f50('0xa'));var fs=require('fs');var fs_extra=require(_0x0f50('0xb'));var _=require(_0x0f50('0xc'));var squel=require(_0x0f50('0xd'));var crypto=require(_0x0f50('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0f50('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0f50('0x10'));var Papa=require(_0x0f50('0x11'));var Redis=require(_0x0f50('0x12'));var authService=require(_0x0f50('0x13'));var qs=require(_0x0f50('0x14'));var as=require(_0x0f50('0x15'));var hardwareService=require(_0x0f50('0x16'));var logger=require(_0x0f50('0x17'))(_0x0f50('0x18'));var utils=require(_0x0f50('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x0f50('0x1a'));var db=require(_0x0f50('0x1b'))['db'];function respondWithStatusCode(_0x175570,_0x8e50c1){_0x8e50c1=_0x8e50c1||0xcc;return function(_0x58a475){if(_0x58a475){return _0x175570[_0x0f50('0x1c')](_0x8e50c1);}return _0x175570['status'](_0x8e50c1)['end']();};}function respondWithResult(_0x2d8c41,_0x8b0086){_0x8b0086=_0x8b0086||0xc8;return function(_0x4af2e8){if(_0x4af2e8){return _0x2d8c41[_0x0f50('0x1d')](_0x8b0086)[_0x0f50('0x1e')](_0x4af2e8);}};}function respondWithFilteredResult(_0x8234c3,_0x14e86c){return function(_0x30cd88){if(_0x30cd88){var _0x3a9217=typeof _0x14e86c[_0x0f50('0x1f')]===_0x0f50('0x20')&&typeof _0x14e86c['limit']===_0x0f50('0x20');var _0x2ca9f8=_0x30cd88[_0x0f50('0x21')];var _0x2a6eee=_0x3a9217?0x0:_0x14e86c[_0x0f50('0x1f')];var _0x5dd404=_0x3a9217?_0x30cd88['count']:_0x14e86c[_0x0f50('0x1f')]+_0x14e86c[_0x0f50('0x22')];var _0x469cfd;if(_0x5dd404>=_0x2ca9f8){_0x5dd404=_0x2ca9f8;_0x469cfd=0xc8;}else{_0x469cfd=0xce;}_0x8234c3[_0x0f50('0x1d')](_0x469cfd);return _0x8234c3[_0x0f50('0x23')](_0x0f50('0x24'),_0x2a6eee+'-'+_0x5dd404+'/'+_0x2ca9f8)[_0x0f50('0x1e')](_0x30cd88);}return null;};}function patchUpdates(_0x3fb152){return function(_0x126623){try{jsonpatch[_0x0f50('0x25')](_0x126623,_0x3fb152,!![]);}catch(_0x22cdee){return BPromise[_0x0f50('0x26')](_0x22cdee);}return _0x126623['save']();};}function saveUpdates(_0x2d547a,_0x1a48bb){return function(_0x5c4a77){if(_0x5c4a77){return _0x5c4a77['update'](_0x2d547a)['then'](function(_0x5be168){return _0x5be168;});}return null;};}function removeEntity(_0x1816dc,_0x167f55){return function(_0x3ccec7){if(_0x3ccec7){return _0x3ccec7[_0x0f50('0x27')]()[_0x0f50('0x28')](function(){var _0x2efcb4=_0x3ccec7['get']({'plain':!![]});var _0x4f8938=_0x0f50('0x29');return db['UserProfileResource'][_0x0f50('0x27')]({'where':{'type':_0x4f8938,'resourceId':_0x2efcb4['id']}})[_0x0f50('0x28')](function(){return _0x3ccec7;});})[_0x0f50('0x28')](function(){_0x1816dc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54f79e,_0x4a077f){return function(_0x33908f){if(!_0x33908f){_0x54f79e['sendStatus'](0x194);}return _0x33908f;};}function handleError(_0xaebc4a,_0x1a58d8){_0x1a58d8=_0x1a58d8||0x1f4;return function(_0x4df84e){logger['error'](_0x4df84e[_0x0f50('0x2a')]);if(_0x4df84e[_0x0f50('0x2b')]){delete _0x4df84e[_0x0f50('0x2b')];}_0xaebc4a['status'](_0x1a58d8)[_0x0f50('0x2c')](_0x4df84e);};}exports[_0x0f50('0x2d')]=function(_0x822598,_0x557df6){var _0x5a6433={},_0x3376ba={},_0x595300={'count':0x0,'rows':[]};return db[_0x0f50('0x2e')][_0x0f50('0x2f')]()['then'](function(_0x4219a2){_0x3376ba['model']=_['keys'](_0x4219a2);_0x3376ba[_0x0f50('0x30')]=_[_0x0f50('0x31')](_0x822598[_0x0f50('0x30')]);_0x3376ba[_0x0f50('0x32')]=_[_0x0f50('0x33')](_0x3376ba['model'],_0x3376ba[_0x0f50('0x30')]);_0x5a6433[_0x0f50('0x34')]=_[_0x0f50('0x33')](_0x3376ba['model'],qs[_0x0f50('0x35')](_0x822598[_0x0f50('0x30')][_0x0f50('0x35')]));_0x5a6433[_0x0f50('0x34')]=_0x5a6433['attributes'][_0x0f50('0x36')]?_0x5a6433['attributes']:_0x3376ba[_0x0f50('0x37')];if(!_0x822598[_0x0f50('0x30')]['hasOwnProperty'](_0x0f50('0x38'))){_0x5a6433[_0x0f50('0x22')]=qs[_0x0f50('0x22')](_0x822598[_0x0f50('0x30')][_0x0f50('0x22')]);_0x5a6433['offset']=qs['offset'](_0x822598[_0x0f50('0x30')][_0x0f50('0x1f')]);}_0x5a6433['order']=qs['sort'](_0x822598[_0x0f50('0x30')][_0x0f50('0x39')]);_0x5a6433[_0x0f50('0x3a')]=qs['filters'](_['pick'](_0x822598['query'],_0x3376ba['filters']),_0x4219a2);if(_0x822598[_0x0f50('0x30')][_0x0f50('0x3b')]){_0x5a6433[_0x0f50('0x3a')]=_[_0x0f50('0x3c')](_0x5a6433[_0x0f50('0x3a')],{'$or':_['map'](_0x5a6433[_0x0f50('0x34')],function(_0x55b867){var _0x37940b={};_0x37940b[_0x55b867]={'$like':'%'+_0x822598[_0x0f50('0x30')][_0x0f50('0x3b')]+'%'};return _0x37940b;})});}_0x5a6433=_[_0x0f50('0x3c')]({},_0x5a6433,_0x822598[_0x0f50('0x3d')]);var _0x44c7c6={'where':_0x5a6433['where']};return db[_0x0f50('0x2e')][_0x0f50('0x21')](_0x44c7c6)[_0x0f50('0x28')](function(_0x3f1bf2){_0x595300[_0x0f50('0x21')]=_0x3f1bf2;if(_0x822598[_0x0f50('0x30')][_0x0f50('0x3e')]){_0x5a6433[_0x0f50('0x3f')]=[{'all':!![]}];}return db[_0x0f50('0x2e')][_0x0f50('0x40')](_0x5a6433);})['then'](function(_0x4f3c3b){_0x595300['rows']=_0x4f3c3b;return _0x595300;})['then'](respondWithFilteredResult(_0x557df6,_0x5a6433))[_0x0f50('0x41')](handleError(_0x557df6,null));})[_0x0f50('0x41')](handleError(_0x557df6,null));};exports['show']=function(_0x1d17a9,_0x355b05){var _0x1700a0={'raw':![],'where':{'id':_0x1d17a9[_0x0f50('0x42')]['id']}},_0x49240c={};_0x49240c[_0x0f50('0x37')]=_['keys'](db[_0x0f50('0x2e')][_0x0f50('0x43')]);_0x49240c[_0x0f50('0x30')]=_[_0x0f50('0x31')](_0x1d17a9[_0x0f50('0x30')]);_0x49240c[_0x0f50('0x32')]=_[_0x0f50('0x33')](_0x49240c[_0x0f50('0x37')],_0x49240c[_0x0f50('0x30')]);_0x1700a0[_0x0f50('0x34')]=_['intersection'](_0x49240c[_0x0f50('0x37')],qs[_0x0f50('0x35')](_0x1d17a9['query']['fields']));_0x1700a0[_0x0f50('0x34')]=_0x1700a0[_0x0f50('0x34')][_0x0f50('0x36')]?_0x1700a0[_0x0f50('0x34')]:_0x49240c['model'];if(_0x1d17a9[_0x0f50('0x30')][_0x0f50('0x3e')]){_0x1700a0[_0x0f50('0x3f')]=[{'all':!![]}];}_0x1700a0=_[_0x0f50('0x3c')]({},_0x1700a0,_0x1d17a9[_0x0f50('0x3d')]);return db['CmCompany'][_0x0f50('0x44')](_0x1700a0)['then'](handleEntityNotFound(_0x355b05,null))['then'](respondWithResult(_0x355b05,null))['catch'](handleError(_0x355b05,null));};exports['create']=function(_0x598094,_0x255154){return db[_0x0f50('0x2e')][_0x0f50('0x45')](_0x598094['body'],{})[_0x0f50('0x28')](function(_0x38e937){var _0x5b272d=_0x598094[_0x0f50('0x46')][_0x0f50('0x47')]({'plain':!![]});if(!_0x5b272d)throw new Error(_0x0f50('0x48'));if(_0x5b272d[_0x0f50('0x49')]===_0x0f50('0x46')){var _0x5a2954=_0x38e937[_0x0f50('0x47')]({'plain':!![]});var _0x215c4c='Companies';return db[_0x0f50('0x4a')][_0x0f50('0x44')]({'where':{'name':_0x215c4c,'userProfileId':_0x5b272d[_0x0f50('0x4b')]},'raw':!![]})[_0x0f50('0x28')](function(_0x58ec2d){if(_0x58ec2d&&_0x58ec2d[_0x0f50('0x4c')]===0x0){return db[_0x0f50('0x4d')]['create']({'name':_0x5a2954[_0x0f50('0x2b')],'resourceId':_0x5a2954['id'],'type':_0x58ec2d['name'],'sectionId':_0x58ec2d['id']},{})[_0x0f50('0x28')](function(){return _0x38e937;});}else{return _0x38e937;}})[_0x0f50('0x41')](function(_0x1bdeec){logger['error'](_0x0f50('0x4e'),_0x1bdeec);throw _0x1bdeec;});}return _0x38e937;})['then'](respondWithResult(_0x255154,0xc9))[_0x0f50('0x41')](handleError(_0x255154,null));};exports[_0x0f50('0x4f')]=function(_0x41c138,_0xc32bc7){if(_0x41c138[_0x0f50('0x50')]['id']){delete _0x41c138['body']['id'];}return db[_0x0f50('0x2e')][_0x0f50('0x44')]({'where':{'id':_0x41c138[_0x0f50('0x42')]['id']}})[_0x0f50('0x28')](handleEntityNotFound(_0xc32bc7,null))[_0x0f50('0x28')](saveUpdates(_0x41c138['body'],null))[_0x0f50('0x28')](respondWithResult(_0xc32bc7,null))[_0x0f50('0x41')](handleError(_0xc32bc7,null));};exports['destroy']=function(_0x698c44,_0x2b98bf){return db[_0x0f50('0x2e')]['find']({'where':{'id':_0x698c44[_0x0f50('0x42')]['id']}})['then'](handleEntityNotFound(_0x2b98bf,null))[_0x0f50('0x28')](removeEntity(_0x2b98bf,null))[_0x0f50('0x41')](handleError(_0x2b98bf,null));};exports[_0x0f50('0x2f')]=function(_0x3ce213,_0x1f3f77){return db[_0x0f50('0x2e')][_0x0f50('0x2f')]()[_0x0f50('0x28')](respondWithResult(_0x1f3f77,null))[_0x0f50('0x41')](handleError(_0x1f3f77,null));};exports[_0x0f50('0x51')]=function(_0x3a4d5b,_0x4eb5f4,_0x12df09){return db[_0x0f50('0x52')]['find']({'where':{'id':_0x3a4d5b[_0x0f50('0x42')]['id']}})[_0x0f50('0x28')](handleEntityNotFound(_0x4eb5f4,null))[_0x0f50('0x28')](function(_0x21b78d){if(_0x21b78d){return _0x21b78d[_0x0f50('0x51')](_0x3a4d5b[_0x0f50('0x50')][_0x0f50('0x53')],_['omit'](_0x3a4d5b[_0x0f50('0x50')],[_0x0f50('0x53'),'id'])||{});}})[_0x0f50('0x28')](respondWithResult(_0x4eb5f4,null))[_0x0f50('0x41')](handleError(_0x4eb5f4,null));};exports[_0x0f50('0x54')]=function(_0x5919db,_0x2cffb4,_0x321657){var _0x12f456={};var _0x4d7b3d={};var _0x391509;var _0x1b8c9c;return db['CmCompany'][_0x0f50('0x55')]({'where':{'id':_0x5919db[_0x0f50('0x42')]['id']}})[_0x0f50('0x28')](handleEntityNotFound(_0x2cffb4,null))[_0x0f50('0x28')](function(_0x4fd8a3){if(_0x4fd8a3){_0x391509=_0x4fd8a3;_0x4d7b3d['model']=_[_0x0f50('0x31')](db[_0x0f50('0x52')][_0x0f50('0x43')]);_0x4d7b3d['query']=_['keys'](_0x5919db[_0x0f50('0x30')]);_0x4d7b3d[_0x0f50('0x32')]=_[_0x0f50('0x33')](_0x4d7b3d[_0x0f50('0x37')],_0x4d7b3d[_0x0f50('0x30')]);_0x12f456[_0x0f50('0x34')]=_[_0x0f50('0x33')](_0x4d7b3d[_0x0f50('0x37')],qs[_0x0f50('0x35')](_0x5919db['query'][_0x0f50('0x35')]));_0x12f456[_0x0f50('0x34')]=_0x12f456['attributes'][_0x0f50('0x36')]?_0x12f456['attributes']:_0x4d7b3d['model'];_0x12f456[_0x0f50('0x56')]=qs[_0x0f50('0x39')](_0x5919db[_0x0f50('0x30')]['sort']);_0x12f456['where']=qs[_0x0f50('0x32')](_[_0x0f50('0x57')](_0x5919db[_0x0f50('0x30')],_0x4d7b3d[_0x0f50('0x32')]));if(_0x5919db[_0x0f50('0x30')][_0x0f50('0x3b')]){_0x12f456[_0x0f50('0x3a')]=_['merge'](_0x12f456[_0x0f50('0x3a')],{'$or':_['map'](_0x12f456[_0x0f50('0x34')],function(_0x77ef3d){var _0x530621={};_0x530621[_0x77ef3d]={'$like':'%'+_0x5919db[_0x0f50('0x30')][_0x0f50('0x3b')]+'%'};return _0x530621;})});}_0x12f456=_[_0x0f50('0x3c')]({},_0x12f456,_0x5919db[_0x0f50('0x3d')]);return _0x391509[_0x0f50('0x54')](_0x12f456);}})[_0x0f50('0x28')](function(_0xd0f206){if(_0xd0f206){_0x1b8c9c=_0xd0f206[_0x0f50('0x36')];if(!_0x5919db[_0x0f50('0x30')][_0x0f50('0x58')](_0x0f50('0x38'))){_0x12f456[_0x0f50('0x22')]=qs[_0x0f50('0x22')](_0x5919db[_0x0f50('0x30')][_0x0f50('0x22')]);_0x12f456[_0x0f50('0x1f')]=qs[_0x0f50('0x1f')](_0x5919db[_0x0f50('0x30')]['offset']);}return _0x391509[_0x0f50('0x54')](_0x12f456);}})[_0x0f50('0x28')](function(_0x5f2b30){if(_0x5f2b30){return _0x5f2b30?{'count':_0x1b8c9c,'rows':_0x5f2b30}:null;}})[_0x0f50('0x28')](respondWithResult(_0x2cffb4,null))[_0x0f50('0x41')](handleError(_0x2cffb4,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index de3596a..f69c0a6 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 _0x1591=['exports','define','cm_companies','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x238b73,_0x5df76f){var _0x5966d9=function(_0x57802d){while(--_0x57802d){_0x238b73['push'](_0x238b73['shift']());}};_0x5966d9(++_0x5df76f);}(_0x1591,0x162));var _0x1159=function(_0x3958fe,_0x3c6605){_0x3958fe=_0x3958fe-0x0;var _0x1f27d6=_0x1591[_0x3958fe];return _0x1f27d6;};'use strict';var _=require(_0x1159('0x0'));var util=require(_0x1159('0x1'));var logger=require(_0x1159('0x2'))(_0x1159('0x3'));var moment=require('moment');var BPromise=require(_0x1159('0x4'));var rp=require(_0x1159('0x5'));var fs=require('fs');var path=require(_0x1159('0x6'));var rimraf=require(_0x1159('0x7'));var config=require(_0x1159('0x8'));var attributes=require(_0x1159('0x9'));module[_0x1159('0xa')]=function(_0x217a06,_0x3e672a){return _0x217a06[_0x1159('0xb')]('CmCompany',attributes,{'tableName':_0x1159('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x169d=['api','request-promise','path','./cmCompany.attributes','define','cm_companies','lodash','util','../../config/logger'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x169d,0x153));var _0xd169=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x169d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd169('0x0'));var util=require(_0xd169('0x1'));var logger=require(_0xd169('0x2'))(_0xd169('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd169('0x4'));var fs=require('fs');var path=require(_0xd169('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd169('0x6'));module['exports']=function(_0x4893e1,_0x2ff32f){return _0x4893e1[_0xd169('0x7')]('CmCompany',attributes,{'tableName':_0xd169('0x8'),'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 4571a3d..f4c4b93 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 _0xc8bd=['CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x21e8a3,_0x1e2514){var _0x1c14da=function(_0xfda92f){while(--_0xfda92f){_0x21e8a3['push'](_0x21e8a3['shift']());}};_0x1c14da(++_0x1e2514);}(_0xc8bd,0xa8));var _0xdc8b=function(_0x386247,_0x5dcfa9){_0x386247=_0x386247-0x0;var _0x3abf65=_0xc8bd[_0x386247];return _0x3abf65;};'use strict';var _=require('lodash');var util=require(_0xdc8b('0x0'));var moment=require('moment');var BPromise=require(_0xdc8b('0x1'));var rs=require(_0xdc8b('0x2'));var fs=require('fs');var Redis=require(_0xdc8b('0x3'));var db=require(_0xdc8b('0x4'))['db'];var utils=require(_0xdc8b('0x5'));var logger=require('../../config/logger')(_0xdc8b('0x6'));var config=require(_0xdc8b('0x7'));var jayson=require(_0xdc8b('0x8'));var client=jayson[_0xdc8b('0x9')][_0xdc8b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x274666,_0x3d10c9,_0x260369){return new BPromise(function(_0xc4d2e2,_0x43be17){return client[_0xdc8b('0xb')](_0x274666,_0x260369)[_0xdc8b('0xc')](function(_0x4426e0){logger['info'](_0xdc8b('0xd'),_0x3d10c9,_0xdc8b('0xe'));logger[_0xdc8b('0xf')](_0xdc8b('0x10'),_0x3d10c9,_0xdc8b('0xe'),JSON[_0xdc8b('0x11')](_0x4426e0));if(_0x4426e0[_0xdc8b('0x12')]){if(_0x4426e0[_0xdc8b('0x12')][_0xdc8b('0x13')]===0x1f4){logger[_0xdc8b('0x12')]('CmCompany,\x20%s,\x20%s',_0x3d10c9,_0x4426e0[_0xdc8b('0x12')][_0xdc8b('0x14')]);return _0x43be17(_0x4426e0['error']['message']);}logger[_0xdc8b('0x12')](_0xdc8b('0xd'),_0x3d10c9,_0x4426e0[_0xdc8b('0x12')][_0xdc8b('0x14')]);return _0xc4d2e2(_0x4426e0[_0xdc8b('0x12')]['message']);}else{logger[_0xdc8b('0x15')](_0xdc8b('0xd'),_0x3d10c9,'request\x20sent');_0xc4d2e2(_0x4426e0['result'][_0xdc8b('0x14')]);}})[_0xdc8b('0x16')](function(_0x3e1563){logger[_0xdc8b('0x12')](_0xdc8b('0xd'),_0x3d10c9,_0x3e1563);_0x43be17(_0x3e1563);});});}
\ No newline at end of file
+var _0x8a7c=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','then','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x8a7c,0x1b5));var _0xc8a7=function(_0x279a1a,_0x238309){_0x279a1a=_0x279a1a-0x0;var _0x185456=_0x8a7c[_0x279a1a];return _0x185456;};'use strict';var _=require('lodash');var util=require(_0xc8a7('0x0'));var moment=require(_0xc8a7('0x1'));var BPromise=require(_0xc8a7('0x2'));var rs=require(_0xc8a7('0x3'));var fs=require('fs');var Redis=require(_0xc8a7('0x4'));var db=require(_0xc8a7('0x5'))['db'];var utils=require(_0xc8a7('0x6'));var logger=require('../../config/logger')(_0xc8a7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc8a7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4eb3ef,_0x25bcf8,_0x4780a1){return new BPromise(function(_0x27bcf8,_0x1e6f2b){return client['request'](_0x4eb3ef,_0x4780a1)[_0xc8a7('0x9')](function(_0x4f426d){logger[_0xc8a7('0xa')](_0xc8a7('0xb'),_0x25bcf8,'request\x20sent');logger['debug'](_0xc8a7('0xc'),_0x25bcf8,_0xc8a7('0xd'),JSON[_0xc8a7('0xe')](_0x4f426d));if(_0x4f426d[_0xc8a7('0xf')]){if(_0x4f426d[_0xc8a7('0xf')][_0xc8a7('0x10')]===0x1f4){logger[_0xc8a7('0xf')]('CmCompany,\x20%s,\x20%s',_0x25bcf8,_0x4f426d['error'][_0xc8a7('0x11')]);return _0x1e6f2b(_0x4f426d[_0xc8a7('0xf')]['message']);}logger['error'](_0xc8a7('0xb'),_0x25bcf8,_0x4f426d['error'][_0xc8a7('0x11')]);return _0x27bcf8(_0x4f426d[_0xc8a7('0xf')]['message']);}else{logger[_0xc8a7('0xa')](_0xc8a7('0xb'),_0x25bcf8,_0xc8a7('0xd'));_0x27bcf8(_0x4f426d[_0xc8a7('0x12')][_0xc8a7('0x11')]);}})[_0xc8a7('0x13')](function(_0xe51850){logger[_0xc8a7('0xf')](_0xc8a7('0xb'),_0x25bcf8,_0xe51850);_0x1e6f2b(_0xe51850);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 3e169c9..c72a704 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 _0xfd6d=['../../components/auth/service','../../components/interaction/service','./cmCompany.controller','index','/describe','isAuthenticated','get','/:id','show','getContacts','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1a209f,_0x1b35e6){var _0x376b56=function(_0x5ed729){while(--_0x5ed729){_0x1a209f['push'](_0x1a209f['shift']());}};_0x376b56(++_0x1b35e6);}(_0xfd6d,0xb9));var _0xdfd6=function(_0x295729,_0xce308){_0x295729=_0x295729-0x0;var _0x4da443=_0xfd6d[_0x295729];return _0x4da443;};'use strict';var multer=require(_0xdfd6('0x0'));var util=require(_0xdfd6('0x1'));var path=require(_0xdfd6('0x2'));var timeout=require(_0xdfd6('0x3'));var express=require(_0xdfd6('0x4'));var router=express[_0xdfd6('0x5')]();var fs_extra=require(_0xdfd6('0x6'));var auth=require(_0xdfd6('0x7'));var interaction=require(_0xdfd6('0x8'));var config=require('../../config/environment');var controller=require(_0xdfd6('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xdfd6('0xa')]);router['get'](_0xdfd6('0xb'),auth[_0xdfd6('0xc')](),controller['describe']);router[_0xdfd6('0xd')](_0xdfd6('0xe'),auth[_0xdfd6('0xc')](),controller[_0xdfd6('0xf')]);router[_0xdfd6('0xd')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xdfd6('0x10')]);router[_0xdfd6('0x11')]('/',auth['isAuthenticated'](),controller[_0xdfd6('0x12')]);router[_0xdfd6('0x11')]('/:id/contacts',auth[_0xdfd6('0xc')](),controller['addContacts']);router[_0xdfd6('0x13')](_0xdfd6('0xe'),auth[_0xdfd6('0xc')](),controller[_0xdfd6('0x14')]);router[_0xdfd6('0x15')]('/:id',auth[_0xdfd6('0xc')](),controller[_0xdfd6('0x16')]);module[_0xdfd6('0x17')]=router;
\ No newline at end of file
+var _0x1486=['index','/describe','describe','/:id','show','post','create','/:id/contacts','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated'];(function(_0x4f3484,_0x2a0968){var _0x612a71=function(_0x9099fd){while(--_0x9099fd){_0x4f3484['push'](_0x4f3484['shift']());}};_0x612a71(++_0x2a0968);}(_0x1486,0x160));var _0x6148=function(_0x28e757,_0x28d435){_0x28e757=_0x28e757-0x0;var _0x604fde=_0x1486[_0x28e757];return _0x604fde;};'use strict';var multer=require(_0x6148('0x0'));var util=require(_0x6148('0x1'));var path=require('path');var timeout=require(_0x6148('0x2'));var express=require(_0x6148('0x3'));var router=express['Router']();var fs_extra=require(_0x6148('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6148('0x5'));var controller=require('./cmCompany.controller');router[_0x6148('0x6')]('/',auth[_0x6148('0x7')](),controller[_0x6148('0x8')]);router[_0x6148('0x6')](_0x6148('0x9'),auth[_0x6148('0x7')](),controller[_0x6148('0xa')]);router[_0x6148('0x6')](_0x6148('0xb'),auth['isAuthenticated'](),controller[_0x6148('0xc')]);router[_0x6148('0x6')]('/:id/contacts',auth[_0x6148('0x7')](),controller['getContacts']);router[_0x6148('0xd')]('/',auth[_0x6148('0x7')](),controller[_0x6148('0xe')]);router['post'](_0x6148('0xf'),auth[_0x6148('0x7')](),controller['addContacts']);router['put'](_0x6148('0xb'),auth[_0x6148('0x7')](),controller[_0x6148('0x10')]);router[_0x6148('0x11')](_0x6148('0xb'),auth[_0x6148('0x7')](),controller[_0x6148('0x12')]);module[_0x6148('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index aed5633..0debdf6 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 _0xba1e=['lodash','sequelize','exports','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x5d07e1,_0x418799){var _0x21617f=function(_0x3e8068){while(--_0x3e8068){_0x5d07e1['push'](_0x5d07e1['shift']());}};_0x21617f(++_0x418799);}(_0xba1e,0x12d));var _0xeba1=function(_0x5d1b11,_0x48c8c6){_0x5d1b11=_0x5d1b11-0x0;var _0x1ad2b5=_0xba1e[_0x5d1b11];return _0x1ad2b5;};'use strict';var _=require(_0xeba1('0x0'));var Sequelize=require(_0xeba1('0x1'));module[_0xeba1('0x2')]={'firstName':{'type':Sequelize[_0xeba1('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xeba1('0x3')]},'street':{'type':Sequelize[_0xeba1('0x3')]},'postalCode':{'type':Sequelize[_0xeba1('0x3')]},'city':{'type':Sequelize[_0xeba1('0x3')]},'country':{'type':Sequelize[_0xeba1('0x3')]},'dateOfBirth':{'type':Sequelize[_0xeba1('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xeba1('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xeba1('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xeba1('0x3')]},'fb_data':{'type':Sequelize[_0xeba1('0x3')]},'twitter':{'type':Sequelize[_0xeba1('0x3')]},'skype':{'type':Sequelize[_0xeba1('0x3')]},'teams':{'type':Sequelize[_0xeba1('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xeba1('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xeba1('0x3')]},'priority':{'type':Sequelize[_0xeba1('0x4')](0x2)[_0xeba1('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xeba1('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xeba1('0x3')]},'utcOffset':{'type':Sequelize[_0xeba1('0x4')]}};
\ No newline at end of file
+var _0x22a7=['sequelize','exports','STRING','TEXT','INTEGER','DATE','NOW'];(function(_0x1fdd8e,_0x29c639){var _0x5122ea=function(_0x4230da){while(--_0x4230da){_0x1fdd8e['push'](_0x1fdd8e['shift']());}};_0x5122ea(++_0x29c639);}(_0x22a7,0x16c));var _0x722a=function(_0x418473,_0x2f4ef1){_0x418473=_0x418473-0x0;var _0x3e85d4=_0x22a7[_0x418473];return _0x3e85d4;};'use strict';var _=require('lodash');var Sequelize=require(_0x722a('0x0'));module[_0x722a('0x1')]={'firstName':{'type':Sequelize[_0x722a('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x722a('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x722a('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x722a('0x2')]},'dateOfBirth':{'type':Sequelize[_0x722a('0x2')]},'description':{'type':Sequelize[_0x722a('0x3')]},'phone':{'type':Sequelize[_0x722a('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x722a('0x2')]},'email':{'type':Sequelize[_0x722a('0x2')]},'url':{'type':Sequelize[_0x722a('0x2')]},'facebook':{'type':Sequelize[_0x722a('0x2')]},'fb_data':{'type':Sequelize[_0x722a('0x2')]},'twitter':{'type':Sequelize[_0x722a('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x722a('0x2')]},'line':{'type':Sequelize[_0x722a('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x722a('0x2')]},'UserId':{'type':Sequelize[_0x722a('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x722a('0x2')]},'priority':{'type':Sequelize[_0x722a('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x722a('0x5')],'defaultValue':Sequelize[_0x722a('0x6')]},'dialTimezone':{'type':Sequelize[_0x722a('0x2')]},'utcOffset':{'type':Sequelize[_0x722a('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 75ebd89..7038f5d 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 _0xcd9b=['contact\x20phone\x20exists','CmHopper','item','PHONE','sequelize','literal','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','getHoppers','pick','ContactId','includeAll','include','nolimit','rows','getJscriptySessions','uploadCsv','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','0777','child_process','fork','../../components/import/cm/csv','binding_keys','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','User','agent','No\x20ListId\x20specified','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','binding','getJourney','sms','openchannel','fax','voice','resolve','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','source','destination','starttime','duration','note','createdAt','userDisposition','userThirdDisposition','UserId','fullname','DESC','startCase','chat','Website','closed','secondDisposition','thirdDisposition','Account','key','Owner','Tags','browserName','customerIp','deviceModel','ratingMessage','ratingType','ratingValue','mail','substatus','externalUrl','threadId','Interaction','findAndCountAll','reverse','slice','moment','bluebird','util','path','lodash','ioredis','../../components/contacts','../../components/parsers/qs','api','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','status','json','offset','undefined','count','limit','set','Content-Range','then','destroy','end','sendStatus','error','name','index','describe','getOptions','findAll','query','user','catch','CmContact','params','tags','keys','length','startsWith','cf_','columnName','displayName','CmCustomField','alias','custom','type','info','forEach','hasOwnProperty','merge','body','from','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','duplicates','where','$or','push','ListId','findOrCreate','contact','find','Tag','tag','ItemType','Phones.OrderBy','$and','map','cf_%d','omit','pickBy','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','values','phone','getTags','rawAttributes','filters','intersection','model','attributes','fields','order','sort','filter','options','setTags','findOne','setAdditionalPhones','all','ContactItemType','item_types','items','ItemTypeId','description','OrderBy'];(function(_0x4a8491,_0x5dd897){var _0x3c05b3=function(_0x2a7e6e){while(--_0x2a7e6e){_0x4a8491['push'](_0x4a8491['shift']());}};_0x3c05b3(++_0x5dd897);}(_0xcd9b,0x6c));var _0xbcd9=function(_0x21241e,_0x118d5f){_0x21241e=_0x21241e-0x0;var _0x225c31=_0xcd9b[_0x21241e];return _0x225c31;};'use strict';var moment=require(_0xbcd9('0x0'));var BPromise=require(_0xbcd9('0x1'));var util=require(_0xbcd9('0x2'));var path=require(_0xbcd9('0x3'));var fs=require('fs');var _=require(_0xbcd9('0x4'));var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0xbcd9('0x5'));var contacts=require(_0xbcd9('0x6'));var qs=require(_0xbcd9('0x7'));var logger=require('../../config/logger')(_0xbcd9('0x8'));var config=require('../../config/environment');var shared=require(_0xbcd9('0x9'));var db=require(_0xbcd9('0xa'))['db'];config[_0xbcd9('0xb')]=_[_0xbcd9('0xc')](config[_0xbcd9('0xb')],{'host':_0xbcd9('0xd'),'port':0x18eb});var socket=require(_0xbcd9('0xe'))(new Redis(config['redis']));require(_0xbcd9('0xf'))['register'](socket);function respondWithResult(_0x34de97,_0x1b2d5a){_0x1b2d5a=_0x1b2d5a||0xc8;return function(_0x2bd25e){if(_0x2bd25e){return _0x34de97[_0xbcd9('0x10')](_0x1b2d5a)[_0xbcd9('0x11')](_0x2bd25e);}};}function respondWithFilteredResult(_0x5e827e,_0x5b7ac5){return function(_0x18c330){if(_0x18c330){var _0x33dec3=typeof _0x5b7ac5[_0xbcd9('0x12')]==='undefined'&&typeof _0x5b7ac5['limit']===_0xbcd9('0x13');var _0x4c80a3=_0x18c330['count'];var _0x326b65=_0x33dec3?0x0:_0x5b7ac5['offset'];var _0x41a7e5=_0x33dec3?_0x18c330[_0xbcd9('0x14')]:_0x5b7ac5[_0xbcd9('0x12')]+_0x5b7ac5[_0xbcd9('0x15')];var _0x32e0ef;if(_0x41a7e5>=_0x4c80a3){_0x41a7e5=_0x4c80a3;_0x32e0ef=0xc8;}else{_0x32e0ef=0xce;}_0x5e827e['status'](_0x32e0ef);return _0x5e827e[_0xbcd9('0x16')](_0xbcd9('0x17'),_0x326b65+'-'+_0x41a7e5+'/'+_0x4c80a3)['json'](_0x18c330);}return null;};}function saveUpdates(_0x234395){return function(_0x1c4ca1){if(_0x1c4ca1){return _0x1c4ca1['update'](_0x234395)[_0xbcd9('0x18')](function(_0x27a227){return _0x27a227;});}return null;};}function removeEntity(_0x425dcc){return function(_0x23b9ba){if(_0x23b9ba){return _0x23b9ba[_0xbcd9('0x19')]()['then'](function(){_0x425dcc['status'](0xcc)[_0xbcd9('0x1a')]();});}};}function handleEntityNotFound(_0xb93db8){return function(_0x5be3b0){if(!_0x5be3b0){_0xb93db8[_0xbcd9('0x1b')](0x194);}return _0x5be3b0;};}function handleError(_0x3511c5,_0x4adfbf){_0x4adfbf=_0x4adfbf||0x1f4;return function(_0x2f8b55){logger[_0xbcd9('0x1c')](_0x2f8b55['stack']);if(_0x2f8b55[_0xbcd9('0x1d')]){delete _0x2f8b55[_0xbcd9('0x1d')];}_0x3511c5['status'](_0x4adfbf)['send'](_0x2f8b55);};}exports[_0xbcd9('0x1e')]=function(_0x1de82a,_0xbb551c){var _0x3c0a9e={};return contacts[_0xbcd9('0x1f')]()[_0xbcd9('0x18')](function(_0x328aff){_0x3c0a9e=qs[_0xbcd9('0x20')](_0x328aff,_0x1de82a);return contacts[_0xbcd9('0x21')](_0x1de82a[_0xbcd9('0x22')],_0x1de82a[_0xbcd9('0x23')],_0x3c0a9e,_0x328aff);})[_0xbcd9('0x18')](respondWithFilteredResult(_0xbb551c,_0x3c0a9e))[_0xbcd9('0x24')](handleError(_0xbb551c,null));};exports[_0xbcd9('0x19')]=function(_0x3e74ec,_0x58ad47){return db[_0xbcd9('0x25')]['find']({'where':{'id':_0x3e74ec[_0xbcd9('0x26')]['id']}})['then'](handleEntityNotFound(_0x58ad47,null))[_0xbcd9('0x18')](removeEntity(_0x58ad47,null))[_0xbcd9('0x24')](handleError(_0x58ad47,null));};exports[_0xbcd9('0x1f')]=function(_0x3c8da7,_0x2b3ca3){return db['CmContact'][_0xbcd9('0x1f')]()[_0xbcd9('0x18')](function(_0x1bc150){delete _0x1bc150[_0xbcd9('0x27')];for(var _0x52c065=0x0;_0x52c065
','Attachments','Title','Data','generateXOAuth2Token','auth=Bearer\x20','utf-8','toString'];(function(_0x16fbd2,_0x2661ec){var _0x2e513b=function(_0x2a898a){while(--_0x2a898a){_0x16fbd2['push'](_0x16fbd2['shift']());}};_0x2e513b(++_0x2661ec);}(_0x918a,0xdc));var _0xa918=function(_0x1ddfe3,_0x5e50e5){_0x1ddfe3=_0x1ddfe3-0x0;var _0x708a39=_0x918a[_0x1ddfe3];return _0x708a39;};'use strict';var _=require(_0xa918('0x0'));var moment=require(_0xa918('0x1'));var random=require(_0xa918('0x2'));var fs=require('fs');var path=require(_0xa918('0x3'));var util=require(_0xa918('0x4'));var tnef=require(_0xa918('0x5'));var logger=require('../../../config/logger')(_0xa918('0x6'));var config=require(_0xa918('0x7'));function getAddress(_0x2c260b){var _0x4908b7=_[_0xa918('0x8')](_0x2c260b['value']);return _0x4908b7&&_0x4908b7[_0xa918('0x9')]?_0x4908b7['address']:_0xa918('0xa')+random[_0xa918('0xb')](0x6)+_0xa918('0xc');}function getFirstName(_0x3d2139){var _0x81c92a=_[_0xa918('0x8')](_0x3d2139[_0xa918('0xd')]);if(_0x81c92a&&_0x81c92a[_0xa918('0xe')]){if(_0x81c92a[_0xa918('0xe')]==_0x81c92a[_0xa918('0x9')]){return _0x81c92a[_0xa918('0xe')]['substring'](0x0,_0x81c92a[_0xa918('0xe')]['indexOf']('@'));}var _0x4740bd=_0x81c92a[_0xa918('0xe')][_0xa918('0xf')](/\s+/);return _0x4740bd[_0xa918('0x10')]>0x1?_0x4740bd[_0xa918('0x11')](0x0,-0x1)['join']('\x20'):_0x81c92a[_0xa918('0xe')];}return'Anonymous';}function getLastName(_0x322d6f){var _0x12f301=_[_0xa918('0x8')](_0x322d6f[_0xa918('0xd')]);if(_0x12f301&&_0x12f301[_0xa918('0xe')]){var _0xb7f3fa=_0x12f301[_0xa918('0xe')][_0xa918('0xf')](/\s+/);return _0xb7f3fa[_0xa918('0x10')]>0x1?_0xb7f3fa[_0xa918('0x12')]():'';}return'';}function getMails(_0x58fbc7,_0x321d71){var _0x463c0a='';for(var _0x36f8e6=0x0;_0x36f8e6<_0x321d71[_0xa918('0xd')][_0xa918('0x10')];_0x36f8e6+=0x1){if(_0x321d71['value'][_0x36f8e6][_0xa918('0x9')]!==_0x58fbc7){if(!_['isEmpty'](_0x463c0a)){_0x463c0a+=',';}_0x463c0a+=_0x321d71[_0xa918('0xd')][_0x36f8e6][_0xa918('0xe')]||_0x321d71['value'][_0x36f8e6][_0xa918('0x9')]||'';_0x463c0a+='\x20<';_0x463c0a+=_0x321d71['value'][_0x36f8e6][_0xa918('0x9')]?_0x321d71[_0xa918('0xd')][_0x36f8e6]['address']:_0xa918('0xa')+random[_0xa918('0xb')](0x6)+_0xa918('0xc');_0x463c0a+='>';}}return _0x463c0a;}function parseEmail(_0x29f9c7,_0x4198a7,_0x1aef17){if(_0x4198a7['html']){var _0x6ad525=/