From: Andrea Amorese
Date: Wed, 6 Oct 2021 08:30:35 +0000 (+0200)
Subject: Built motion from commit 8dfab3cb.|2.5.36
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22card-image.png//%27?a=commitdiff_plain;h=352d7b631b5cd4d75828439a259798185664fb6c;p=motion2.git
Built motion from commit 8dfab3cb.|2.5.36
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index ef78356..54146b1 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-10-06T07:58:02.866Z",
+ "time": "2021-10-06T08:18:01.574Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 60bc957..fda2d50 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-10-06T07:58:02.866Z",
+ "time": "2021-10-06T08:18:01.574Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index a227031..e94bb4d 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 _0x061b=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x115ac5,_0x24271a){var _0x2c13e6=function(_0x1c6641){while(--_0x1c6641){_0x115ac5['push'](_0x115ac5['shift']());}};_0x2c13e6(++_0x24271a);}(_0x061b,0x6f));var _0xb061=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x061b[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require(_0xb061('0x0'));module[_0xb061('0x1')]={'name':{'type':Sequelize[_0xb061('0x2')],'get':function(_0x5f0f0f){return this[_0xb061('0x3')](_0xb061('0x4'));}},'action':{'type':Sequelize[_0xb061('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb061('0x6'),_0xb061('0x7'),'motionbar',_0xb061('0x8'),_0xb061('0x9'),_0xb061('0xa'),_0xb061('0xb'),'script']],'msg':_0xb061('0xc')}},'comment':_0xb061('0xc')},'data1':{'type':Sequelize[_0xb061('0x5')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xb061('0xd')},'data3':{'type':Sequelize[_0xb061('0x5')](0x1000),'comment':_0xb061('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xb061('0xf')},'data5':{'type':Sequelize[_0xb061('0x5')](0x1000),'comments':_0xb061('0x10')},'data6':{'type':Sequelize[_0xb061('0x5')],'comments':_0xb061('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x826e=['STRING','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','exports','VIRTUAL','getDataValue','action','motionbar','jscripty','urlForward','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x354bb1,_0x13c981){var _0x359351=function(_0x457226){while(--_0x457226){_0x354bb1['push'](_0x354bb1['shift']());}};_0x359351(++_0x13c981);}(_0x826e,0x163));var _0xe826=function(_0x1bb33e,_0x26a28f){_0x1bb33e=_0x1bb33e-0x0;var _0x3077e0=_0x826e[_0x1bb33e];return _0x3077e0;};'use strict';var Sequelize=require('sequelize');module[_0xe826('0x0')]={'name':{'type':Sequelize[_0xe826('0x1')],'get':function(_0x26b60c){return this[_0xe826('0x2')](_0xe826('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0xe826('0x4'),_0xe826('0x5'),_0xe826('0x6'),_0xe826('0x7'),'bot','script']],'msg':_0xe826('0x8')}},'comment':_0xe826('0x8')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0xe826('0x9')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xe826('0x9')](0x1000),'comment':_0xe826('0xa')},'data4':{'type':Sequelize[_0xe826('0x9')](0x1000),'comments':_0xe826('0xb')},'data5':{'type':Sequelize[_0xe826('0x9')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xe826('0x9')],'comments':_0xe826('0xc')},'data7':{'type':Sequelize[_0xe826('0xd')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 3d4058e..7a7a8e2 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 _0xdca6=['offset','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','body','find','catch','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined'];(function(_0x1a288e,_0x805d1d){var _0x593b72=function(_0x22d1ed){while(--_0x22d1ed){_0x1a288e['push'](_0x1a288e['shift']());}};_0x593b72(++_0x805d1d);}(_0xdca6,0xe2));var _0x6dca=function(_0x4504f5,_0x17b74d){_0x4504f5=_0x4504f5-0x0;var _0x57d974=_0xdca6[_0x4504f5];return _0x57d974;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6dca('0x0'));var zipdir=require(_0x6dca('0x1'));var jsonpatch=require(_0x6dca('0x2'));var rp=require(_0x6dca('0x3'));var moment=require(_0x6dca('0x4'));var BPromise=require(_0x6dca('0x5'));var Mustache=require(_0x6dca('0x6'));var util=require(_0x6dca('0x7'));var path=require(_0x6dca('0x8'));var sox=require(_0x6dca('0x9'));var csv=require(_0x6dca('0xa'));var ejs=require(_0x6dca('0xb'));var fs=require('fs');var fs_extra=require(_0x6dca('0xc'));var _=require(_0x6dca('0xd'));var squel=require('squel');var crypto=require(_0x6dca('0xe'));var jsforce=require(_0x6dca('0xf'));var deskjs=require(_0x6dca('0x10'));var toCsv=require(_0x6dca('0xa'));var querystring=require(_0x6dca('0x11'));var Papa=require(_0x6dca('0x12'));var Redis=require(_0x6dca('0x13'));var authService=require(_0x6dca('0x14'));var qs=require(_0x6dca('0x15'));var as=require(_0x6dca('0x16'));var hardwareService=require(_0x6dca('0x17'));var logger=require(_0x6dca('0x18'))(_0x6dca('0x19'));var utils=require(_0x6dca('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x6dca('0x1b'));var db=require(_0x6dca('0x1c'))['db'];function respondWithStatusCode(_0xe75101,_0x431a15){_0x431a15=_0x431a15||0xcc;return function(_0x559ed1){if(_0x559ed1){return _0xe75101[_0x6dca('0x1d')](_0x431a15);}return _0xe75101[_0x6dca('0x1e')](_0x431a15)['end']();};}function respondWithResult(_0xc60ca3,_0x1a1558){_0x1a1558=_0x1a1558||0xc8;return function(_0x3e288b){if(_0x3e288b){return _0xc60ca3[_0x6dca('0x1e')](_0x1a1558)[_0x6dca('0x1f')](_0x3e288b);}};}function respondWithFilteredResult(_0x38c666,_0x366272){return function(_0x152bdc){if(_0x152bdc){var _0x361c96=typeof _0x366272['offset']==='undefined'&&typeof _0x366272[_0x6dca('0x20')]===_0x6dca('0x21');var _0x3e28b9=_0x152bdc['count'];var _0x2d399b=_0x361c96?0x0:_0x366272[_0x6dca('0x22')];var _0x22571f=_0x361c96?_0x152bdc[_0x6dca('0x23')]:_0x366272['offset']+_0x366272[_0x6dca('0x20')];var _0x83b482;if(_0x22571f>=_0x3e28b9){_0x22571f=_0x3e28b9;_0x83b482=0xc8;}else{_0x83b482=0xce;}_0x38c666[_0x6dca('0x1e')](_0x83b482);return _0x38c666[_0x6dca('0x24')](_0x6dca('0x25'),_0x2d399b+'-'+_0x22571f+'/'+_0x3e28b9)['json'](_0x152bdc);}return null;};}function patchUpdates(_0x4b72e4){return function(_0x12ccc5){try{jsonpatch[_0x6dca('0x26')](_0x12ccc5,_0x4b72e4,!![]);}catch(_0xd489e3){return BPromise[_0x6dca('0x27')](_0xd489e3);}return _0x12ccc5['save']();};}function saveUpdates(_0x19a8c8,_0x125b3f){return function(_0x15b792){if(_0x15b792){return _0x15b792[_0x6dca('0x28')](_0x19a8c8)[_0x6dca('0x29')](function(_0x72c83c){return _0x72c83c;});}return null;};}function removeEntity(_0x5aec07,_0x3b154f){return function(_0x262c0e){if(_0x262c0e){return _0x262c0e[_0x6dca('0x2a')]()['then'](function(){_0x5aec07[_0x6dca('0x1e')](0xcc)[_0x6dca('0x2b')]();});}};}function handleEntityNotFound(_0x23ea9b,_0x422e72){return function(_0x153fd9){if(!_0x153fd9){_0x23ea9b[_0x6dca('0x1d')](0x194);}return _0x153fd9;};}function handleError(_0x3329f6,_0x20db8c){_0x20db8c=_0x20db8c||0x1f4;return function(_0x15bc36){logger[_0x6dca('0x2c')](_0x15bc36[_0x6dca('0x2d')]);if(_0x15bc36[_0x6dca('0x2e')]){delete _0x15bc36['name'];}_0x3329f6['status'](_0x20db8c)[_0x6dca('0x2f')](_0x15bc36);};}exports[_0x6dca('0x28')]=function(_0x4c048e,_0x58123a){if(_0x4c048e['body']['id']){delete _0x4c048e[_0x6dca('0x30')]['id'];}return db['Action'][_0x6dca('0x31')]({'where':{'id':_0x4c048e['params']['id']}})['then'](handleEntityNotFound(_0x58123a,null))[_0x6dca('0x29')](saveUpdates(_0x4c048e[_0x6dca('0x30')],null))['then'](respondWithResult(_0x58123a,null))[_0x6dca('0x32')](handleError(_0x58123a,null));};exports[_0x6dca('0x2a')]=function(_0x245d53,_0x4f4e6d){return db['Action'][_0x6dca('0x31')]({'where':{'id':_0x245d53[_0x6dca('0x33')]['id']}})[_0x6dca('0x29')](handleEntityNotFound(_0x4f4e6d,null))[_0x6dca('0x29')](removeEntity(_0x4f4e6d,null))['catch'](handleError(_0x4f4e6d,null));};
\ No newline at end of file
+var _0xdc8a=['params','catch','find','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','set','apply','reject','save','then','destroy','sendStatus','error','name','send','update','body','Action'];(function(_0x4c4042,_0x3967e4){var _0x4bb9d1=function(_0xac1371){while(--_0xac1371){_0x4c4042['push'](_0x4c4042['shift']());}};_0x4bb9d1(++_0x3967e4);}(_0xdc8a,0xe4));var _0xadc8=function(_0x1dd415,_0x1b38bb){_0x1dd415=_0x1dd415-0x0;var _0x3855cf=_0xdc8a[_0x1dd415];return _0x3855cf;};'use strict';var emlformat=require(_0xadc8('0x0'));var rimraf=require(_0xadc8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xadc8('0x2'));var rp=require(_0xadc8('0x3'));var moment=require(_0xadc8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xadc8('0x5'));var path=require(_0xadc8('0x6'));var sox=require('sox');var csv=require(_0xadc8('0x7'));var ejs=require(_0xadc8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xadc8('0x9'));var squel=require(_0xadc8('0xa'));var crypto=require(_0xadc8('0xb'));var jsforce=require(_0xadc8('0xc'));var deskjs=require(_0xadc8('0xd'));var toCsv=require('to-csv');var querystring=require(_0xadc8('0xe'));var Papa=require('papaparse');var Redis=require(_0xadc8('0xf'));var authService=require(_0xadc8('0x10'));var qs=require(_0xadc8('0x11'));var as=require(_0xadc8('0x12'));var hardwareService=require(_0xadc8('0x13'));var logger=require('../../config/logger')(_0xadc8('0x14'));var utils=require(_0xadc8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xadc8('0x16'))['db'];function respondWithStatusCode(_0x492c13,_0x547b84){_0x547b84=_0x547b84||0xcc;return function(_0xec8b1b){if(_0xec8b1b){return _0x492c13['sendStatus'](_0x547b84);}return _0x492c13[_0xadc8('0x17')](_0x547b84)[_0xadc8('0x18')]();};}function respondWithResult(_0x443d80,_0x564189){_0x564189=_0x564189||0xc8;return function(_0x3168c1){if(_0x3168c1){return _0x443d80[_0xadc8('0x17')](_0x564189)[_0xadc8('0x19')](_0x3168c1);}};}function respondWithFilteredResult(_0x4fc719,_0x4195fe){return function(_0x27562b){if(_0x27562b){var _0x3d1daf=typeof _0x4195fe[_0xadc8('0x1a')]===_0xadc8('0x1b')&&typeof _0x4195fe['limit']===_0xadc8('0x1b');var _0x4bc18e=_0x27562b['count'];var _0x1ba344=_0x3d1daf?0x0:_0x4195fe[_0xadc8('0x1a')];var _0x3357c9=_0x3d1daf?_0x27562b['count']:_0x4195fe['offset']+_0x4195fe[_0xadc8('0x1c')];var _0x59a6ff;if(_0x3357c9>=_0x4bc18e){_0x3357c9=_0x4bc18e;_0x59a6ff=0xc8;}else{_0x59a6ff=0xce;}_0x4fc719['status'](_0x59a6ff);return _0x4fc719[_0xadc8('0x1d')]('Content-Range',_0x1ba344+'-'+_0x3357c9+'/'+_0x4bc18e)[_0xadc8('0x19')](_0x27562b);}return null;};}function patchUpdates(_0x429998){return function(_0x57bf22){try{jsonpatch[_0xadc8('0x1e')](_0x57bf22,_0x429998,!![]);}catch(_0x92cf28){return BPromise[_0xadc8('0x1f')](_0x92cf28);}return _0x57bf22[_0xadc8('0x20')]();};}function saveUpdates(_0x33649f,_0xac0a0b){return function(_0x4d74d5){if(_0x4d74d5){return _0x4d74d5['update'](_0x33649f)[_0xadc8('0x21')](function(_0x58d4ad){return _0x58d4ad;});}return null;};}function removeEntity(_0x79b3dd,_0x51cf46){return function(_0x3a98ce){if(_0x3a98ce){return _0x3a98ce[_0xadc8('0x22')]()[_0xadc8('0x21')](function(){_0x79b3dd[_0xadc8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x354eff,_0x4ddffd){return function(_0x1699fe){if(!_0x1699fe){_0x354eff[_0xadc8('0x23')](0x194);}return _0x1699fe;};}function handleError(_0x42b5a2,_0x3fb88c){_0x3fb88c=_0x3fb88c||0x1f4;return function(_0x42d274){logger[_0xadc8('0x24')](_0x42d274['stack']);if(_0x42d274['name']){delete _0x42d274[_0xadc8('0x25')];}_0x42b5a2[_0xadc8('0x17')](_0x3fb88c)[_0xadc8('0x26')](_0x42d274);};}exports[_0xadc8('0x27')]=function(_0x32b2c9,_0xff286){if(_0x32b2c9[_0xadc8('0x28')]['id']){delete _0x32b2c9[_0xadc8('0x28')]['id'];}return db[_0xadc8('0x29')]['find']({'where':{'id':_0x32b2c9[_0xadc8('0x2a')]['id']}})[_0xadc8('0x21')](handleEntityNotFound(_0xff286,null))[_0xadc8('0x21')](saveUpdates(_0x32b2c9[_0xadc8('0x28')],null))[_0xadc8('0x21')](respondWithResult(_0xff286,null))[_0xadc8('0x2b')](handleError(_0xff286,null));};exports[_0xadc8('0x22')]=function(_0x4f9f35,_0xa3b27d){return db[_0xadc8('0x29')][_0xadc8('0x2c')]({'where':{'id':_0x4f9f35[_0xadc8('0x2a')]['id']}})[_0xadc8('0x21')](handleEntityNotFound(_0xa3b27d,null))['then'](removeEntity(_0xa3b27d,null))[_0xadc8('0x2b')](handleError(_0xa3b27d,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index aab3e44..2530671 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 _0x6edb=['path','rimraf','exports','Action','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x388280,_0xeef89){var _0x51122b=function(_0x250e3e){while(--_0x250e3e){_0x388280['push'](_0x388280['shift']());}};_0x51122b(++_0xeef89);}(_0x6edb,0x122));var _0xb6ed=function(_0x20e06e,_0x15a44a){_0x20e06e=_0x20e06e-0x0;var _0x2b2387=_0x6edb[_0x20e06e];return _0x2b2387;};'use strict';var _=require(_0xb6ed('0x0'));var util=require(_0xb6ed('0x1'));var logger=require(_0xb6ed('0x2'))(_0xb6ed('0x3'));var moment=require(_0xb6ed('0x4'));var BPromise=require(_0xb6ed('0x5'));var rp=require(_0xb6ed('0x6'));var fs=require('fs');var path=require(_0xb6ed('0x7'));var rimraf=require(_0xb6ed('0x8'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0xb6ed('0x9')]=function(_0x4e8df3,_0x2ee27e){return _0x4e8df3['define'](_0xb6ed('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5100=['moment','bluebird','path','../../config/environment','./action.attributes','tools_actions','lodash','util','../../config/logger','api'];(function(_0x5e0565,_0x507a73){var _0x118380=function(_0xf99a56){while(--_0xf99a56){_0x5e0565['push'](_0x5e0565['shift']());}};_0x118380(++_0x507a73);}(_0x5100,0x132));var _0x0510=function(_0x4d3d46,_0x35282a){_0x4d3d46=_0x4d3d46-0x0;var _0x4b76d4=_0x5100[_0x4d3d46];return _0x4b76d4;};'use strict';var _=require(_0x0510('0x0'));var util=require(_0x0510('0x1'));var logger=require(_0x0510('0x2'))(_0x0510('0x3'));var moment=require(_0x0510('0x4'));var BPromise=require(_0x0510('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0510('0x6'));var rimraf=require('rimraf');var config=require(_0x0510('0x7'));var attributes=require(_0x0510('0x8'));module['exports']=function(_0x314bfe,_0x187274){return _0x314bfe['define']('Action',attributes,{'tableName':_0x0510('0x9'),'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 bc05f80..fed51a8 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 _0x7a54=['info','Action,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x43a9d8,_0x680a91){_0x43a9d8=_0x43a9d8-0x0;var _0x13f25c=_0x7a54[_0x43a9d8];return _0x13f25c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Action,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4975,0x86));var _0x5497=function(_0x2b0474,_0x2565b9){_0x2b0474=_0x2b0474-0x0;var _0x1c8326=_0x4975[_0x2b0474];return _0x1c8326;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 62f6ef0..b405b38 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 _0xe2fb=['./action.controller','/:id','isAuthenticated','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2fb,0x138));var _0xbe2f=function(_0x51221b,_0x17aaa1){_0x51221b=_0x51221b-0x0;var _0xc2dc3=_0xe2fb[_0x51221b];return _0xc2dc3;};'use strict';var multer=require(_0xbe2f('0x0'));var util=require(_0xbe2f('0x1'));var path=require(_0xbe2f('0x2'));var timeout=require(_0xbe2f('0x3'));var express=require(_0xbe2f('0x4'));var router=express[_0xbe2f('0x5')]();var fs_extra=require(_0xbe2f('0x6'));var auth=require(_0xbe2f('0x7'));var interaction=require(_0xbe2f('0x8'));var config=require(_0xbe2f('0x9'));var controller=require(_0xbe2f('0xa'));router['put'](_0xbe2f('0xb'),auth[_0xbe2f('0xc')](),controller['update']);router[_0xbe2f('0xd')](_0xbe2f('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x207a=['util','connect-timeout','express','fs-extra','../../components/interaction/service','./action.controller','put','/:id','delete','isAuthenticated','exports','multer'];(function(_0x5a86fa,_0x13c0e9){var _0x2b0c5f=function(_0x57f874){while(--_0x57f874){_0x5a86fa['push'](_0x5a86fa['shift']());}};_0x2b0c5f(++_0x13c0e9);}(_0x207a,0x83));var _0xa207=function(_0xb6015f,_0x2e3fd8){_0xb6015f=_0xb6015f-0x0;var _0x48407e=_0x207a[_0xb6015f];return _0x48407e;};'use strict';var multer=require(_0xa207('0x0'));var util=require(_0xa207('0x1'));var path=require('path');var timeout=require(_0xa207('0x2'));var express=require(_0xa207('0x3'));var router=express['Router']();var fs_extra=require(_0xa207('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa207('0x5'));var config=require('../../config/environment');var controller=require(_0xa207('0x6'));router[_0xa207('0x7')](_0xa207('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xa207('0x9')]('/:id',auth[_0xa207('0xa')](),controller['destroy']);module[_0xa207('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index ca72cdc..f62a56a 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 _0x2675=['sequelize','STRING','TEXT'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x2675,0x75));var _0x5267=function(_0x4aecbd,_0xc8830c){_0x4aecbd=_0x4aecbd-0x0;var _0x49073c=_0x2675[_0x4aecbd];return _0x49073c;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
+var _0x2bd8=['TEXT','sequelize','STRING'];(function(_0x47f2c5,_0x40c84b){var _0x38b405=function(_0x22c2aa){while(--_0x22c2aa){_0x47f2c5['push'](_0x47f2c5['shift']());}};_0x38b405(++_0x40c84b);}(_0x2bd8,0x130));var _0x82bd=function(_0x460b1f,_0x494b84){_0x460b1f=_0x460b1f-0x0;var _0x9e09d0=_0x2bd8[_0x460b1f];return _0x9e09d0;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x82bd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x82bd('0x1')]},'parent':{'type':Sequelize[_0x82bd('0x1')]},'table':{'type':Sequelize[_0x82bd('0x1')]},'conditions':{'type':Sequelize[_0x82bd('0x2')]},'joins':{'type':Sequelize[_0x82bd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 80409be..e495e43 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 _0x00b8=['offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','CustomReports','UserProfileResource','destroy','stack','name','send','index','map','AnalyticCustomReport','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','error','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','from','DESC','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json'];(function(_0x14ef5b,_0x3f052a){var _0xba5a6f=function(_0x476e47){while(--_0x476e47){_0x14ef5b['push'](_0x14ef5b['shift']());}};_0xba5a6f(++_0x3f052a);}(_0x00b8,0x1e0));var _0x800b=function(_0x2a53f3,_0x5a4ab7){_0x2a53f3=_0x2a53f3-0x0;var _0xc62c3=_0x00b8[_0x2a53f3];return _0xc62c3;};'use strict';var emlformat=require(_0x800b('0x0'));var rimraf=require(_0x800b('0x1'));var zipdir=require(_0x800b('0x2'));var jsonpatch=require(_0x800b('0x3'));var rp=require(_0x800b('0x4'));var moment=require(_0x800b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x800b('0x6'));var util=require('util');var path=require(_0x800b('0x7'));var sox=require(_0x800b('0x8'));var csv=require(_0x800b('0x9'));var ejs=require(_0x800b('0xa'));var fs=require('fs');var fs_extra=require(_0x800b('0xb'));var _=require(_0x800b('0xc'));var squel=require(_0x800b('0xd'));var crypto=require(_0x800b('0xe'));var jsforce=require(_0x800b('0xf'));var deskjs=require(_0x800b('0x10'));var toCsv=require(_0x800b('0x9'));var querystring=require(_0x800b('0x11'));var Papa=require(_0x800b('0x12'));var Redis=require('ioredis');var authService=require(_0x800b('0x13'));var qs=require(_0x800b('0x14'));var as=require(_0x800b('0x15'));var hardwareService=require(_0x800b('0x16'));var logger=require('../../config/logger')(_0x800b('0x17'));var utils=require(_0x800b('0x18'));var config=require(_0x800b('0x19'));var licenseUtil=require(_0x800b('0x1a'));var db=require(_0x800b('0x1b'))['db'];var dbH=require(_0x800b('0x1b'))[_0x800b('0x1c')];function respondWithStatusCode(_0x1512e8,_0x1d7520){_0x1d7520=_0x1d7520||0xcc;return function(_0x1e6964){if(_0x1e6964){return _0x1512e8[_0x800b('0x1d')](_0x1d7520);}return _0x1512e8[_0x800b('0x1e')](_0x1d7520)[_0x800b('0x1f')]();};}function respondWithResult(_0x1c4546,_0x413957){_0x413957=_0x413957||0xc8;return function(_0x59d454){if(_0x59d454){return _0x1c4546[_0x800b('0x1e')](_0x413957)[_0x800b('0x20')](_0x59d454);}};}function respondWithFilteredResult(_0x564d27,_0x43249b){return function(_0x116e00){if(_0x116e00){var _0x3794f7=typeof _0x43249b[_0x800b('0x21')]===_0x800b('0x22')&&typeof _0x43249b[_0x800b('0x23')]===_0x800b('0x22');var _0x50e857=_0x116e00[_0x800b('0x24')];var _0x117680=_0x3794f7?0x0:_0x43249b['offset'];var _0x327c71=_0x3794f7?_0x116e00[_0x800b('0x24')]:_0x43249b[_0x800b('0x21')]+_0x43249b[_0x800b('0x23')];var _0x4c23ce;if(_0x327c71>=_0x50e857){_0x327c71=_0x50e857;_0x4c23ce=0xc8;}else{_0x4c23ce=0xce;}_0x564d27[_0x800b('0x1e')](_0x4c23ce);return _0x564d27[_0x800b('0x25')](_0x800b('0x26'),_0x117680+'-'+_0x327c71+'/'+_0x50e857)[_0x800b('0x20')](_0x116e00);}return null;};}function patchUpdates(_0x5f37d7){return function(_0x5e476e){try{jsonpatch['apply'](_0x5e476e,_0x5f37d7,!![]);}catch(_0x78dbff){return BPromise[_0x800b('0x27')](_0x78dbff);}return _0x5e476e[_0x800b('0x28')]();};}function saveUpdates(_0x4611e5,_0x1d1bd7){return function(_0x279dd9){if(_0x279dd9){return _0x279dd9[_0x800b('0x29')](_0x4611e5)[_0x800b('0x2a')](function(_0x338d64){return _0x338d64;});}return null;};}function removeEntity(_0xcde909,_0x2713f4){return function(_0x252c96){if(_0x252c96){return _0x252c96['destroy']()[_0x800b('0x2a')](function(){var _0x52d4cd=_0x252c96[_0x800b('0x2b')]({'plain':!![]});var _0x59ea97=_0x800b('0x2c');return db[_0x800b('0x2d')][_0x800b('0x2e')]({'where':{'type':_0x59ea97,'resourceId':_0x52d4cd['id']}})['then'](function(){return _0x252c96;});})[_0x800b('0x2a')](function(){_0xcde909[_0x800b('0x1e')](0xcc)[_0x800b('0x1f')]();});}};}function handleEntityNotFound(_0x26e23b,_0x42a678){return function(_0x447b2e){if(!_0x447b2e){_0x26e23b[_0x800b('0x1d')](0x194);}return _0x447b2e;};}function handleError(_0x57b7f2,_0x4ad806){_0x4ad806=_0x4ad806||0x1f4;return function(_0x5dcd20){logger['error'](_0x5dcd20[_0x800b('0x2f')]);if(_0x5dcd20[_0x800b('0x30')]){delete _0x5dcd20['name'];}_0x57b7f2['status'](_0x4ad806)[_0x800b('0x31')](_0x5dcd20);};}exports[_0x800b('0x32')]=function(_0x12f52,_0x1cad56){var _0x1a57bd={},_0x1072c2={},_0x4af766={'count':0x0,'rows':[]};var _0x4c7d55=_[_0x800b('0x33')](db[_0x800b('0x34')]['rawAttributes'],function(_0x1563c3){return{'name':_0x1563c3['fieldName'],'type':_0x1563c3['type'][_0x800b('0x35')]};});_0x1072c2[_0x800b('0x36')]=_[_0x800b('0x33')](_0x4c7d55,_0x800b('0x30'));_0x1072c2[_0x800b('0x37')]=_['keys'](_0x12f52[_0x800b('0x37')]);_0x1072c2[_0x800b('0x38')]=_[_0x800b('0x39')](_0x1072c2[_0x800b('0x36')],_0x1072c2[_0x800b('0x37')]);_0x1a57bd[_0x800b('0x3a')]=_[_0x800b('0x39')](_0x1072c2[_0x800b('0x36')],qs[_0x800b('0x3b')](_0x12f52[_0x800b('0x37')]['fields']));_0x1a57bd['attributes']=_0x1a57bd['attributes'][_0x800b('0x3c')]?_0x1a57bd[_0x800b('0x3a')]:_0x1072c2[_0x800b('0x36')];if(!_0x12f52[_0x800b('0x37')]['hasOwnProperty'](_0x800b('0x3d'))){_0x1a57bd['limit']=qs[_0x800b('0x23')](_0x12f52[_0x800b('0x37')][_0x800b('0x23')]);_0x1a57bd[_0x800b('0x21')]=qs['offset'](_0x12f52[_0x800b('0x37')][_0x800b('0x21')]);}_0x1a57bd['order']=qs[_0x800b('0x3e')](_0x12f52[_0x800b('0x37')]['sort']);_0x1a57bd[_0x800b('0x3f')]=qs[_0x800b('0x38')](_[_0x800b('0x40')](_0x12f52[_0x800b('0x37')],_0x1072c2[_0x800b('0x38')]),_0x4c7d55);if(_0x12f52['query'][_0x800b('0x41')]){_0x1a57bd[_0x800b('0x3f')]=_[_0x800b('0x42')](_0x1a57bd[_0x800b('0x3f')],{'$or':_['map'](_0x4c7d55,function(_0x165042){if(_0x165042[_0x800b('0x43')]!==_0x800b('0x44')){var _0x5751cb={};_0x5751cb[_0x165042[_0x800b('0x30')]]={'$like':'%'+_0x12f52[_0x800b('0x37')][_0x800b('0x41')]+'%'};return _0x5751cb;}})});}_0x1a57bd=_[_0x800b('0x42')]({},_0x1a57bd,_0x12f52[_0x800b('0x45')]);var _0x205248={'where':_0x1a57bd['where']};return db[_0x800b('0x34')]['count'](_0x205248)['then'](function(_0x2dbd1d){_0x4af766[_0x800b('0x24')]=_0x2dbd1d;if(_0x12f52[_0x800b('0x37')][_0x800b('0x46')]){_0x1a57bd[_0x800b('0x47')]=[{'all':!![]}];}return db[_0x800b('0x34')][_0x800b('0x48')](_0x1a57bd);})['then'](function(_0x19e6f1){_0x4af766[_0x800b('0x49')]=_0x19e6f1;return _0x4af766;})[_0x800b('0x2a')](respondWithFilteredResult(_0x1cad56,_0x1a57bd))[_0x800b('0x4a')](handleError(_0x1cad56,null));};exports[_0x800b('0x4b')]=function(_0x2bf0a7,_0x9ebefd){var _0x1274f3={'raw':![],'where':{'id':_0x2bf0a7[_0x800b('0x4c')]['id']}},_0x217fdc={};_0x217fdc[_0x800b('0x36')]=_[_0x800b('0x4d')](db['AnalyticCustomReport'][_0x800b('0x4e')]);_0x217fdc[_0x800b('0x37')]=_[_0x800b('0x4d')](_0x2bf0a7['query']);_0x217fdc['filters']=_[_0x800b('0x39')](_0x217fdc[_0x800b('0x36')],_0x217fdc['query']);_0x1274f3[_0x800b('0x3a')]=_[_0x800b('0x39')](_0x217fdc['model'],qs[_0x800b('0x3b')](_0x2bf0a7[_0x800b('0x37')]['fields']));_0x1274f3['attributes']=_0x1274f3[_0x800b('0x3a')]['length']?_0x1274f3['attributes']:_0x217fdc[_0x800b('0x36')];if(_0x2bf0a7[_0x800b('0x37')][_0x800b('0x46')]){_0x1274f3[_0x800b('0x47')]=[{'all':!![]}];}_0x1274f3=_['merge']({},_0x1274f3,_0x2bf0a7['options']);return db[_0x800b('0x34')][_0x800b('0x4f')](_0x1274f3)[_0x800b('0x2a')](handleEntityNotFound(_0x9ebefd,null))[_0x800b('0x2a')](respondWithResult(_0x9ebefd,null))[_0x800b('0x4a')](handleError(_0x9ebefd,null));};exports[_0x800b('0x50')]=function(_0x3c85e3,_0x14b414){return db['AnalyticCustomReport']['create'](_0x3c85e3['body'],{})['then'](function(_0x5c7de1){var _0x71bdec=_0x3c85e3[_0x800b('0x51')][_0x800b('0x2b')]({'plain':!![]});if(!_0x71bdec)throw new Error(_0x800b('0x52'));if(_0x71bdec[_0x800b('0x53')]===_0x800b('0x51')){var _0x2935ab=_0x5c7de1[_0x800b('0x2b')]({'plain':!![]});var _0x22e149=_0x800b('0x54');return db['UserProfileSection'][_0x800b('0x4f')]({'where':{'name':_0x22e149,'userProfileId':_0x71bdec[_0x800b('0x55')]},'raw':!![]})[_0x800b('0x2a')](function(_0x492810){if(_0x492810&&_0x492810[_0x800b('0x56')]===0x0){return db[_0x800b('0x2d')][_0x800b('0x50')]({'name':_0x2935ab[_0x800b('0x30')],'resourceId':_0x2935ab['id'],'type':'CustomReports','sectionId':_0x492810['id']},{})['then'](function(){return _0x5c7de1;});}else{return _0x5c7de1;}})['catch'](function(_0x47ed1f){logger[_0x800b('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47ed1f);throw _0x47ed1f;});}return _0x5c7de1;})['then'](respondWithResult(_0x14b414,0xc9))[_0x800b('0x4a')](handleError(_0x14b414,null));};exports['update']=function(_0x291f0b,_0x316869){if(_0x291f0b[_0x800b('0x58')]['id']){delete _0x291f0b['body']['id'];}return db['AnalyticCustomReport'][_0x800b('0x4f')]({'where':{'id':_0x291f0b['params']['id']}})[_0x800b('0x2a')](handleEntityNotFound(_0x316869,null))[_0x800b('0x2a')](saveUpdates(_0x291f0b[_0x800b('0x58')],null))['then'](respondWithResult(_0x316869,null))[_0x800b('0x4a')](handleError(_0x316869,null));};exports['destroy']=function(_0x56ca50,_0x363f5f){return db['AnalyticCustomReport'][_0x800b('0x4f')]({'where':{'id':_0x56ca50['params']['id']}})[_0x800b('0x2a')](handleEntityNotFound(_0x363f5f,null))[_0x800b('0x2a')](removeEntity(_0x363f5f,null))[_0x800b('0x4a')](handleError(_0x363f5f,null));};exports[_0x800b('0x59')]=function(_0x15ce4b,_0x45dd38){var _0x2bd6e4=0xa;var _0x585d47=[_0x800b('0x5a'),_0x800b('0x5b'),_0x800b('0x5c'),'cross_join'];var _0x825a00={'SUM':_0x800b('0x5d'),'COUNT':_0x800b('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x800b('0x5f'),'MIN':_0x800b('0x60'),'AVG':_0x800b('0x61'),'GROUP_CONCAT':_0x800b('0x62'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5ba8c6={'SEC_TO_TIME':_0x800b('0x63'),'DATE':_0x800b('0x64'),'HOUR':_0x800b('0x65'),'ROUND':_0x800b('0x66'),'UNIX_TIMESTAMP':_0x800b('0x67')};var _0x2bb204=function(_0x336df5){return!_['includes']([_0x800b('0x68'),_0x800b('0x69'),_0x800b('0x6a'),_0x800b('0x6b')],_0x336df5);};var _0x3d78d5=function(_0x4805ce){if(!_0x4805ce||!_0x4805ce['rules'][_0x800b('0x3c')]){return'';}for(var _0x514c0d='(',_0x3cc55e=0x0;_0x3cc55e<_0x4805ce[_0x800b('0x6c')][_0x800b('0x3c')];_0x3cc55e+=0x1){_0x3cc55e>0x0&&(_0x514c0d+='\x20'+_0x4805ce[_0x800b('0x6d')]+'\x20');_0x514c0d+=_0x4805ce['rules'][_0x3cc55e][_0x800b('0x6e')]?_0x3d78d5(_0x4805ce[_0x800b('0x6c')][_0x3cc55e][_0x800b('0x6e')]):_0x4805ce[_0x800b('0x6c')][_0x3cc55e][_0x800b('0x6f')]+'\x20'+_0x4805ce[_0x800b('0x6c')][_0x3cc55e][_0x800b('0x70')]+(_0x2bb204(_0x4805ce['rules'][_0x3cc55e][_0x800b('0x70')])?'\x20'+_0x4805ce[_0x800b('0x6c')][_0x3cc55e][_0x800b('0x71')]:'');}return _0x514c0d+')';};var _0x3fd2e9={'where':{'id':_0x15ce4b[_0x800b('0x4c')]['id']}},_0x317929,_0xc39a8e,_0x3a88aa,_0x4256fd,_0x606301;_0x3fd2e9=_['merge']({},_0x3fd2e9,_0x15ce4b['options']);return db[_0x800b('0x34')]['find'](_0x3fd2e9)[_0x800b('0x2a')](function(_0x1b20a1){if(_0x1b20a1){_0x317929=_0x1b20a1;return _0x1b20a1[_0x800b('0x72')]();}return null;})[_0x800b('0x2a')](function(_0x3edc97){if(_0x3edc97){if(!_0x3edc97['length']){throw new db[(_0x800b('0x73'))][(_0x800b('0x74'))](_0x800b('0x75'),0x193);}_0xc39a8e=_0x3edc97;return db[_0x800b('0x76')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x52b989){if(_0x52b989){_0x3a88aa=_[_0x800b('0x77')](_0x52b989,'id');var _0x41824c;var _0x86dcaa=squel[_0x800b('0x78')]();_0x86dcaa['from'](_0x317929[_0x800b('0x79')]);for(var _0x28c1d7=0x0;_0x28c1d7<_0xc39a8e[_0x800b('0x3c')];_0x28c1d7+=0x1){_0x41824c=_0xc39a8e[_0x28c1d7]['MetricId']?_0x3a88aa[_0xc39a8e[_0x28c1d7][_0x800b('0x7a')]][_0x800b('0x7b')]:_0xc39a8e[_0x28c1d7][_0x800b('0x6f')];_0x41824c=_0xc39a8e[_0x28c1d7][_0x800b('0x7c')]?_[_0x800b('0x7d')](_0x825a00[_0xc39a8e[_0x28c1d7][_0x800b('0x7c')]],'%s',_0x41824c):_0x41824c;_0x41824c=_0xc39a8e[_0x28c1d7][_0x800b('0x7e')]?_[_0x800b('0x7d')](_0x5ba8c6[_0xc39a8e[_0x28c1d7][_0x800b('0x7e')]],'%s',_0x41824c):_0x41824c;if(_0xc39a8e[_0x28c1d7][_0x800b('0x7f')]){_0x86dcaa[_0x800b('0x6e')](_0x41824c);}_0xc39a8e[_0x28c1d7][_0x800b('0x80')]&&_0x86dcaa['order'](_0x41824c,_0xc39a8e[_0x28c1d7][_0x800b('0x80')]==='DESC'?![]:!![]);_0x86dcaa['field'](_0x41824c,_0xc39a8e[_0x28c1d7][_0x800b('0x81')]||_0x41824c);}if(_0x317929[_0x800b('0x82')]){_0x317929[_0x800b('0x82')]=JSON[_0x800b('0x83')](_0x317929[_0x800b('0x82')]);for(var _0x3fa008=0x0;_0x3fa008<_0x317929[_0x800b('0x82')][_0x800b('0x3c')];_0x3fa008+=0x1){if(_0x317929[_0x800b('0x82')][_0x3fa008][_0x800b('0x43')]&&_[_0x800b('0x84')](_0x585d47,_0x317929['joins'][_0x3fa008][_0x800b('0x43')])&&_0x317929[_0x800b('0x82')][_0x3fa008][_0x800b('0x85')]&&_0x317929['joins'][_0x3fa008]['foreignTable']&&_0x317929['joins'][_0x3fa008]['foreignKey']){_0x86dcaa[_0x317929[_0x800b('0x82')][_0x3fa008]['type']](_0x317929[_0x800b('0x82')][_0x3fa008][_0x800b('0x86')],null,util[_0x800b('0x7e')](_0x800b('0x87'),_0x317929[_0x800b('0x79')],_0x317929['joins'][_0x3fa008][_0x800b('0x85')],_0x317929['joins'][_0x3fa008][_0x800b('0x86')],_0x317929[_0x800b('0x82')][_0x3fa008][_0x800b('0x88')]));}}}if(_0x317929[_0x800b('0x89')]){_0x317929['conditions']=JSON[_0x800b('0x83')](_0x317929[_0x800b('0x89')]);_0x86dcaa[_0x800b('0x3f')](_0x3d78d5(_0x317929[_0x800b('0x89')][_0x800b('0x6e')]));}_0x606301=_0x86dcaa[_0x800b('0x8a')]();_0x86dcaa[_0x800b('0x23')](_0x2bd6e4);_0x86dcaa[_0x800b('0x21')](0x0);logger[_0x800b('0x8b')](_0x800b('0x8c'),_0x86dcaa[_0x800b('0x8d')]());return dbH[_0x800b('0x8e')][_0x800b('0x37')](_0x86dcaa[_0x800b('0x8d')](),{'type':dbH[_0x800b('0x8e')][_0x800b('0x8f')][_0x800b('0x90')]});}})[_0x800b('0x2a')](respondWithResult(_0x45dd38,null))[_0x800b('0x4a')](handleError(_0x45dd38,null));};function runReport(_0x546b28,_0x31390d,_0x21ba3e){var _0x155d25=_0x31390d[_0x800b('0x30')];var _0xa90ce1=0xa;var _0x1d906b=[_0x800b('0x5a'),'left_join','right_join',_0x800b('0x91')];var _0x18dc8a={'SUM':'SUM(%s)','COUNT':_0x800b('0x5e'),'COUNT DISTINCT':_0x800b('0x92'),'MAX':'MAX(%s)','MIN':_0x800b('0x60'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x800b('0x62'),'GROUP_CONCAT ASC':_0x800b('0x93'),'GROUP_CONCAT DESC':_0x800b('0x94')};var _0x2cbaff={'SEC_TO_TIME':_0x800b('0x63'),'DATE':_0x800b('0x64'),'HOUR':_0x800b('0x65'),'ROUND':_0x800b('0x66'),'UNIX_TIMESTAMP':_0x800b('0x67')};var _0x2caff3=function(_0x46a3ec){return!_['includes']([_0x800b('0x68'),_0x800b('0x69'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x46a3ec);};var _0xb0fac2=function(_0x557b5c){if(!_0x557b5c||!_0x557b5c[_0x800b('0x6c')][_0x800b('0x3c')]){return'';}for(var _0x2bce3f='(',_0x30f4db=0x0;_0x30f4db<_0x557b5c[_0x800b('0x6c')][_0x800b('0x3c')];_0x30f4db+=0x1){_0x30f4db>0x0&&(_0x2bce3f+='\x20'+_0x557b5c[_0x800b('0x6d')]+'\x20');_0x2bce3f+=_0x557b5c[_0x800b('0x6c')][_0x30f4db]['group']?_0xb0fac2(_0x557b5c['rules'][_0x30f4db][_0x800b('0x6e')]):_0x557b5c[_0x800b('0x6c')][_0x30f4db]['field']+'\x20'+_0x557b5c[_0x800b('0x6c')][_0x30f4db][_0x800b('0x70')]+(_0x2caff3(_0x557b5c[_0x800b('0x6c')][_0x30f4db][_0x800b('0x70')])?'\x20'+_0x557b5c['rules'][_0x30f4db][_0x800b('0x71')]:'');}return _0x2bce3f+')';};var _0x2db6a4={'where':{'id':_0x546b28['id']}},_0x36b455,_0x2f0117,_0x35cdf2,_0x569d35,_0x49b7f4;_0x2db6a4=_[_0x800b('0x42')]({},_0x2db6a4,_0x21ba3e);return db[_0x800b('0x34')]['find'](_0x2db6a4)[_0x800b('0x2a')](function(_0x22c136){if(_0x22c136){_0x36b455=_0x22c136;return _0x22c136[_0x800b('0x72')]();}return null;})[_0x800b('0x2a')](function(_0xb3664f){if(_0xb3664f){if(!_0xb3664f['length']){throw new db['Sequelize'][(_0x800b('0x74'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2f0117=_0xb3664f;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x800b('0x2a')](function(_0x5c6d0b){if(_0x5c6d0b){_0x35cdf2=_[_0x800b('0x77')](_0x5c6d0b,'id');var _0x3d48ff;var _0x3773ee=squel['select']();_0x3773ee['from'](_0x36b455[_0x800b('0x79')]);for(var _0x44aa0a=0x0;_0x44aa0a<_0x2f0117['length'];_0x44aa0a+=0x1){_0x3d48ff=_0x2f0117[_0x44aa0a][_0x800b('0x7a')]?_0x35cdf2[_0x2f0117[_0x44aa0a][_0x800b('0x7a')]]['metric']:_0x2f0117[_0x44aa0a][_0x800b('0x6f')];_0x3d48ff=_0x2f0117[_0x44aa0a][_0x800b('0x7c')]?_[_0x800b('0x7d')](_0x18dc8a[_0x2f0117[_0x44aa0a][_0x800b('0x7c')]],'%s',_0x3d48ff):_0x3d48ff;_0x3d48ff=_0x2f0117[_0x44aa0a][_0x800b('0x7e')]?_[_0x800b('0x7d')](_0x2cbaff[_0x2f0117[_0x44aa0a][_0x800b('0x7e')]],'%s',_0x3d48ff):_0x3d48ff;if(_0x2f0117[_0x44aa0a][_0x800b('0x7f')]){_0x3773ee[_0x800b('0x6e')](_0x3d48ff);}_0x2f0117[_0x44aa0a][_0x800b('0x80')]&&_0x3773ee['order'](_0x3d48ff,_0x2f0117[_0x44aa0a][_0x800b('0x80')]==='DESC'?![]:!![]);_0x3773ee['field'](_0x3d48ff,_0x2f0117[_0x44aa0a][_0x800b('0x81')]||_0x3d48ff);}if(_0x36b455[_0x800b('0x82')]){_0x36b455['joins']=JSON[_0x800b('0x83')](_0x36b455[_0x800b('0x82')]);for(var _0x3f3d48=0x0;_0x3f3d48<_0x36b455[_0x800b('0x82')]['length'];_0x3f3d48+=0x1){if(_0x36b455['joins'][_0x3f3d48][_0x800b('0x43')]&&_['includes'](_0x1d906b,_0x36b455[_0x800b('0x82')][_0x3f3d48][_0x800b('0x43')])&&_0x36b455[_0x800b('0x82')][_0x3f3d48]['parentKey']&&_0x36b455[_0x800b('0x82')][_0x3f3d48]['foreignTable']&&_0x36b455[_0x800b('0x82')][_0x3f3d48][_0x800b('0x88')]){_0x3773ee[_0x36b455['joins'][_0x3f3d48][_0x800b('0x43')]](_0x36b455[_0x800b('0x82')][_0x3f3d48]['foreignTable'],null,util[_0x800b('0x7e')](_0x800b('0x87'),_0x36b455[_0x800b('0x79')],_0x36b455[_0x800b('0x82')][_0x3f3d48]['parentKey'],_0x36b455[_0x800b('0x82')][_0x3f3d48][_0x800b('0x86')],_0x36b455[_0x800b('0x82')][_0x3f3d48][_0x800b('0x88')]));}}}if(_0x36b455[_0x800b('0x89')]){_0x36b455[_0x800b('0x89')]=JSON[_0x800b('0x83')](_0x36b455['conditions']);_0x3773ee[_0x800b('0x3f')](_0xb0fac2(_0x36b455[_0x800b('0x89')][_0x800b('0x6e')]));}_0x49b7f4=_0x3773ee[_0x800b('0x8a')]();_0x3773ee[_0x800b('0x23')](_0xa90ce1);_0x3773ee[_0x800b('0x21')](0x0);return;}})[_0x800b('0x2a')](function(){if(_0x31390d[_0x800b('0x95')]===_0x800b('0x96')){return null;}var _0x51b05b=_[_0x800b('0x42')](_0x31390d,{'name':_0x31390d[_0x800b('0x97')]||_0x31390d['name']||_0x36b455[_0x800b('0x30')],'basename':_0x155d25,'savename':util[_0x800b('0x7e')](_0x800b('0x98'),_0x31390d['name']||_0x36b455['name'],require(_0x800b('0x99'))['generate'](0x4),_0x31390d[_0x800b('0x95')]||_0x800b('0x9a')),'reportId':_0x36b455['id'],'reportType':_0x800b('0x9b')});return db['AnalyticExtractedReport'][_0x800b('0x50')](_0x51b05b,{'raw':!![]});})['then'](function(_0x19a4f8){if(_0x36b455[_0x800b('0x79')]===_0x800b('0x9c')){_0x49b7f4[_0x800b('0x3f')](_0x36b455[_0x800b('0x79')]+_0x800b('0x9d'),_0x31390d[_0x800b('0x9e')],_0x31390d[_0x800b('0x9f')]);}else{_0x49b7f4['where'](_0x36b455[_0x800b('0x79')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x31390d['startDate'],_0x31390d['endDate']);}if(_0x19a4f8){logger[_0x800b('0xa0')](_0x800b('0xa1'),_0x49b7f4[_0x800b('0x8d')]());require(_0x800b('0xa2'))['fork'](path[_0x800b('0x5a')](__dirname,_0x800b('0xa3'),_0x19a4f8['output']),[_0x19a4f8['id'],_0x49b7f4['toString'](),path[_0x800b('0x5a')](__dirname,_0x800b('0xa4'),_0x19a4f8['savename']),_0x155d25]);return _0x19a4f8;}else{var _0x199d33=squel[_0x800b('0x78')]();_0x199d33['from']('('+_0x49b7f4[_0x800b('0x8d')]()+')',_0x800b('0xa5'));_0x199d33['field'](_0x800b('0xa6'),'count');_0x49b7f4[_0x800b('0x23')](_0x31390d['limit']||_0xa90ce1);_0x49b7f4[_0x800b('0x21')](_0x31390d[_0x800b('0x21')]||0x0);return dbH[_0x800b('0x8e')][_0x800b('0x37')](_0x199d33[_0x800b('0x8d')](),{'type':dbH[_0x800b('0x8e')]['QueryTypes'][_0x800b('0x90')]})[_0x800b('0x2a')](function(_0x527658){if(!_0x527658[_0x800b('0x3c')]){_0x569d35=0x0;}else{_0x569d35=_0x527658[0x0]['count']||0x0;}return dbH[_0x800b('0x8e')][_0x800b('0x37')](_0x49b7f4['toString'](),{'type':dbH[_0x800b('0x8e')][_0x800b('0x8f')]['SELECT']});})[_0x800b('0x2a')](function(_0x18c365){return{'rows':_0x18c365||[],'count':_0x569d35};});}});}exports[_0x800b('0xa7')]=function(_0x404142,_0x49c628){return runReport(_0x404142[_0x800b('0x4c')],_0x404142[_0x800b('0x37')],_0x404142[_0x800b('0x45')])[_0x800b('0x2a')](respondWithResult(_0x49c628,null))['catch'](handleError(_0x49c628,null));};exports[_0x800b('0xa8')]=runReport;exports[_0x800b('0x37')]=function(_0x533929,_0x4dc27b){var _0x1dc721=0xa;var _0x3e710d=['join','left_join',_0x800b('0x5c'),_0x800b('0x91')];var _0x4e7ba9={'SUM':_0x800b('0x5d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x800b('0x92'),'MAX':'MAX(%s)','MIN':_0x800b('0x60'),'AVG':_0x800b('0x61'),'GROUP_CONCAT':_0x800b('0x62'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x800b('0x94')};var _0x24c25a={'SEC_TO_TIME':_0x800b('0x63'),'DATE':_0x800b('0x64'),'HOUR':_0x800b('0x65'),'ROUND':_0x800b('0x66'),'UNIX_TIMESTAMP':_0x800b('0x67')};var _0x193ff7=function(_0x24b0c7){return!_['includes']([_0x800b('0x68'),_0x800b('0x69'),_0x800b('0x6a'),_0x800b('0x6b')],_0x24b0c7);};var _0x1b6161=function(_0x33b3c9){if(!_0x33b3c9||!_0x33b3c9[_0x800b('0x6c')][_0x800b('0x3c')]){return'';}for(var _0x421c6f='(',_0x4e45db=0x0;_0x4e45db<_0x33b3c9['rules'][_0x800b('0x3c')];_0x4e45db+=0x1){_0x4e45db>0x0&&(_0x421c6f+='\x20'+_0x33b3c9[_0x800b('0x6d')]+'\x20');_0x421c6f+=_0x33b3c9[_0x800b('0x6c')][_0x4e45db][_0x800b('0x6e')]?_0x1b6161(_0x33b3c9[_0x800b('0x6c')][_0x4e45db][_0x800b('0x6e')]):_0x33b3c9['rules'][_0x4e45db][_0x800b('0x6f')]+'\x20'+_0x33b3c9[_0x800b('0x6c')][_0x4e45db][_0x800b('0x70')]+(_0x193ff7(_0x33b3c9['rules'][_0x4e45db]['condition'])?'\x20'+_0x33b3c9[_0x800b('0x6c')][_0x4e45db][_0x800b('0x71')]:'');}return _0x421c6f+')';};var _0x38c053={'where':{'id':_0x533929[_0x800b('0x4c')]['id']}},_0x184687,_0x53aab2,_0x26bcd2,_0x4d1f2a,_0x49321b;_0x38c053=_[_0x800b('0x42')]({},_0x38c053,_0x533929[_0x800b('0x45')]);return db['AnalyticCustomReport'][_0x800b('0x4f')](_0x38c053)[_0x800b('0x2a')](function(_0x51efcd){if(_0x51efcd){_0x184687=_0x51efcd;return _0x51efcd[_0x800b('0x72')]();}return null;})['then'](function(_0x346aa4){if(_0x346aa4){if(!_0x346aa4['length']){throw new db[(_0x800b('0x73'))][(_0x800b('0x74'))](_0x800b('0x75'),0x193);}_0x53aab2=_0x346aa4;return db[_0x800b('0x76')]['findAll']({'raw':!![]});}return null;})[_0x800b('0x2a')](function(_0x281807){if(_0x281807){_0x26bcd2=_[_0x800b('0x77')](_0x281807,'id');var _0x149632;var _0x4afd16=squel[_0x800b('0x78')]();_0x4afd16[_0x800b('0xa9')](_0x184687[_0x800b('0x79')]);for(var _0x5ee6b0=0x0;_0x5ee6b0<_0x53aab2[_0x800b('0x3c')];_0x5ee6b0+=0x1){_0x149632=_0x53aab2[_0x5ee6b0][_0x800b('0x7a')]?_0x26bcd2[_0x53aab2[_0x5ee6b0][_0x800b('0x7a')]]['metric']:_0x53aab2[_0x5ee6b0][_0x800b('0x6f')];_0x149632=_0x53aab2[_0x5ee6b0]['function']?_[_0x800b('0x7d')](_0x4e7ba9[_0x53aab2[_0x5ee6b0][_0x800b('0x7c')]],'%s',_0x149632):_0x149632;_0x149632=_0x53aab2[_0x5ee6b0][_0x800b('0x7e')]?_[_0x800b('0x7d')](_0x24c25a[_0x53aab2[_0x5ee6b0]['format']],'%s',_0x149632):_0x149632;if(_0x53aab2[_0x5ee6b0][_0x800b('0x7f')]){_0x4afd16[_0x800b('0x6e')](_0x149632);}_0x53aab2[_0x5ee6b0][_0x800b('0x80')]&&_0x4afd16['order'](_0x149632,_0x53aab2[_0x5ee6b0][_0x800b('0x80')]===_0x800b('0xaa')?![]:!![]);_0x4afd16[_0x800b('0x6f')](_0x149632,_0x53aab2[_0x5ee6b0][_0x800b('0x81')]||_0x149632);}if(_0x184687[_0x800b('0x82')]){_0x184687[_0x800b('0x82')]=JSON[_0x800b('0x83')](_0x184687['joins']);for(var _0x22848b=0x0;_0x22848b<_0x184687[_0x800b('0x82')][_0x800b('0x3c')];_0x22848b+=0x1){if(_0x184687[_0x800b('0x82')][_0x22848b][_0x800b('0x43')]&&_[_0x800b('0x84')](_0x3e710d,_0x184687['joins'][_0x22848b][_0x800b('0x43')])&&_0x184687[_0x800b('0x82')][_0x22848b][_0x800b('0x85')]&&_0x184687[_0x800b('0x82')][_0x22848b][_0x800b('0x86')]&&_0x184687['joins'][_0x22848b][_0x800b('0x88')]){_0x4afd16[_0x184687[_0x800b('0x82')][_0x22848b][_0x800b('0x43')]](_0x184687[_0x800b('0x82')][_0x22848b]['foreignTable'],null,util[_0x800b('0x7e')](_0x800b('0x87'),_0x184687[_0x800b('0x79')],_0x184687[_0x800b('0x82')][_0x22848b][_0x800b('0x85')],_0x184687[_0x800b('0x82')][_0x22848b]['foreignTable'],_0x184687[_0x800b('0x82')][_0x22848b][_0x800b('0x88')]));}}}if(_0x184687[_0x800b('0x89')]){_0x184687[_0x800b('0x89')]=JSON['parse'](_0x184687['conditions']);_0x4afd16[_0x800b('0x3f')](_0x1b6161(_0x184687[_0x800b('0x89')][_0x800b('0x6e')]));}_0x49321b=_0x4afd16['clone']();_0x4afd16[_0x800b('0x23')](_0x1dc721);_0x4afd16['offset'](0x0);logger['debug'](_0x800b('0x8c'),_0x4afd16['toString']());return dbH[_0x800b('0x8e')][_0x800b('0x37')](_0x4afd16[_0x800b('0x8d')](),{'type':dbH[_0x800b('0x8e')][_0x800b('0x8f')][_0x800b('0x90')]});}})[_0x800b('0x2a')](function(){return{'sql':_0x49321b[_0x800b('0x8d')]()};})['then'](respondWithResult(_0x4dc27b,null))[_0x800b('0x4a')](handleError(_0x4dc27b,null));};
\ No newline at end of file
+var _0x6a13=['autoAssociation','UserProfileResource','preview','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','length','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','replace','function','groupBy','orderBy','alias','joins','parse','includes','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','debug','toString','sequelize','join','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','value','order','DESC','clone','output','web','fullPath','%s-%s.%s','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','SELECT','run','Limited\x20Query:','rimraf','fast-json-patch','request-promise','mustache','util','path','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','CustomReports','destroy','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','sort','filters','pick','where','merge','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll','find','create','body','user','get','role','UserProfileSection'];(function(_0x27380a,_0x11b4db){var _0x49557d=function(_0x11984a){while(--_0x11984a){_0x27380a['push'](_0x27380a['shift']());}};_0x49557d(++_0x11b4db);}(_0x6a13,0xf4));var _0x36a1=function(_0x309c75,_0x2514f5){_0x309c75=_0x309c75-0x0;var _0x187e12=_0x6a13[_0x309c75];return _0x187e12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x36a1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x36a1('0x1'));var rp=require(_0x36a1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x36a1('0x3'));var util=require(_0x36a1('0x4'));var path=require(_0x36a1('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x36a1('0x6'));var _=require(_0x36a1('0x7'));var squel=require(_0x36a1('0x8'));var crypto=require('crypto');var jsforce=require(_0x36a1('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x36a1('0xa'));var querystring=require(_0x36a1('0xb'));var Papa=require(_0x36a1('0xc'));var Redis=require(_0x36a1('0xd'));var authService=require(_0x36a1('0xe'));var qs=require(_0x36a1('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x36a1('0x10'));var logger=require(_0x36a1('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x36a1('0x12'));var db=require(_0x36a1('0x13'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x157a56,_0x10aaff){_0x10aaff=_0x10aaff||0xcc;return function(_0x272324){if(_0x272324){return _0x157a56[_0x36a1('0x14')](_0x10aaff);}return _0x157a56[_0x36a1('0x15')](_0x10aaff)[_0x36a1('0x16')]();};}function respondWithResult(_0x25b8c9,_0x4aee16){_0x4aee16=_0x4aee16||0xc8;return function(_0x5ac42f){if(_0x5ac42f){return _0x25b8c9[_0x36a1('0x15')](_0x4aee16)[_0x36a1('0x17')](_0x5ac42f);}};}function respondWithFilteredResult(_0x3e7621,_0x39be59){return function(_0x5a144a){if(_0x5a144a){var _0x2550a2=typeof _0x39be59[_0x36a1('0x18')]===_0x36a1('0x19')&&typeof _0x39be59[_0x36a1('0x1a')]===_0x36a1('0x19');var _0x50376e=_0x5a144a[_0x36a1('0x1b')];var _0x544f07=_0x2550a2?0x0:_0x39be59[_0x36a1('0x18')];var _0x47ab17=_0x2550a2?_0x5a144a[_0x36a1('0x1b')]:_0x39be59[_0x36a1('0x18')]+_0x39be59['limit'];var _0x38b9fc;if(_0x47ab17>=_0x50376e){_0x47ab17=_0x50376e;_0x38b9fc=0xc8;}else{_0x38b9fc=0xce;}_0x3e7621['status'](_0x38b9fc);return _0x3e7621[_0x36a1('0x1c')](_0x36a1('0x1d'),_0x544f07+'-'+_0x47ab17+'/'+_0x50376e)[_0x36a1('0x17')](_0x5a144a);}return null;};}function patchUpdates(_0x5c34e2){return function(_0x16eaa5){try{jsonpatch[_0x36a1('0x1e')](_0x16eaa5,_0x5c34e2,!![]);}catch(_0xd8cabc){return BPromise[_0x36a1('0x1f')](_0xd8cabc);}return _0x16eaa5[_0x36a1('0x20')]();};}function saveUpdates(_0x593308,_0x3df7f4){return function(_0x1e55d2){if(_0x1e55d2){return _0x1e55d2[_0x36a1('0x21')](_0x593308)[_0x36a1('0x22')](function(_0x547f4b){return _0x547f4b;});}return null;};}function removeEntity(_0x9eb22f,_0x4a1eba){return function(_0x5752b6){if(_0x5752b6){return _0x5752b6['destroy']()[_0x36a1('0x22')](function(){var _0x4f79ef=_0x5752b6['get']({'plain':!![]});var _0x5c80ae=_0x36a1('0x23');return db['UserProfileResource'][_0x36a1('0x24')]({'where':{'type':_0x5c80ae,'resourceId':_0x4f79ef['id']}})[_0x36a1('0x22')](function(){return _0x5752b6;});})[_0x36a1('0x22')](function(){_0x9eb22f[_0x36a1('0x15')](0xcc)[_0x36a1('0x16')]();});}};}function handleEntityNotFound(_0x388bc7,_0x506577){return function(_0x13439f){if(!_0x13439f){_0x388bc7['sendStatus'](0x194);}return _0x13439f;};}function handleError(_0x53d44a,_0x2ed36c){_0x2ed36c=_0x2ed36c||0x1f4;return function(_0x5087a2){logger[_0x36a1('0x25')](_0x5087a2[_0x36a1('0x26')]);if(_0x5087a2['name']){delete _0x5087a2[_0x36a1('0x27')];}_0x53d44a[_0x36a1('0x15')](_0x2ed36c)[_0x36a1('0x28')](_0x5087a2);};}exports[_0x36a1('0x29')]=function(_0x526131,_0x30a389){var _0x507ae4={},_0x495d7f={},_0x4a83a7={'count':0x0,'rows':[]};var _0x205712=_[_0x36a1('0x2a')](db[_0x36a1('0x2b')][_0x36a1('0x2c')],function(_0x2046ec){return{'name':_0x2046ec[_0x36a1('0x2d')],'type':_0x2046ec[_0x36a1('0x2e')]['key']};});_0x495d7f[_0x36a1('0x2f')]=_[_0x36a1('0x2a')](_0x205712,_0x36a1('0x27'));_0x495d7f[_0x36a1('0x30')]=_[_0x36a1('0x31')](_0x526131[_0x36a1('0x30')]);_0x495d7f['filters']=_['intersection'](_0x495d7f[_0x36a1('0x2f')],_0x495d7f[_0x36a1('0x30')]);_0x507ae4[_0x36a1('0x32')]=_[_0x36a1('0x33')](_0x495d7f[_0x36a1('0x2f')],qs[_0x36a1('0x34')](_0x526131[_0x36a1('0x30')][_0x36a1('0x34')]));_0x507ae4[_0x36a1('0x32')]=_0x507ae4[_0x36a1('0x32')]['length']?_0x507ae4[_0x36a1('0x32')]:_0x495d7f[_0x36a1('0x2f')];if(!_0x526131['query']['hasOwnProperty']('nolimit')){_0x507ae4[_0x36a1('0x1a')]=qs[_0x36a1('0x1a')](_0x526131[_0x36a1('0x30')][_0x36a1('0x1a')]);_0x507ae4[_0x36a1('0x18')]=qs[_0x36a1('0x18')](_0x526131[_0x36a1('0x30')][_0x36a1('0x18')]);}_0x507ae4['order']=qs[_0x36a1('0x35')](_0x526131[_0x36a1('0x30')][_0x36a1('0x35')]);_0x507ae4['where']=qs[_0x36a1('0x36')](_[_0x36a1('0x37')](_0x526131[_0x36a1('0x30')],_0x495d7f['filters']),_0x205712);if(_0x526131[_0x36a1('0x30')]['filter']){_0x507ae4[_0x36a1('0x38')]=_[_0x36a1('0x39')](_0x507ae4['where'],{'$or':_['map'](_0x205712,function(_0x5e1be2){if(_0x5e1be2[_0x36a1('0x2e')]!==_0x36a1('0x3a')){var _0x58eebf={};_0x58eebf[_0x5e1be2[_0x36a1('0x27')]]={'$like':'%'+_0x526131[_0x36a1('0x30')][_0x36a1('0x3b')]+'%'};return _0x58eebf;}})});}_0x507ae4=_[_0x36a1('0x39')]({},_0x507ae4,_0x526131[_0x36a1('0x3c')]);var _0x267454={'where':_0x507ae4['where']};return db[_0x36a1('0x2b')]['count'](_0x267454)[_0x36a1('0x22')](function(_0x27876a){_0x4a83a7[_0x36a1('0x1b')]=_0x27876a;if(_0x526131[_0x36a1('0x30')]['includeAll']){_0x507ae4[_0x36a1('0x3d')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x507ae4);})[_0x36a1('0x22')](function(_0xdc62f6){_0x4a83a7[_0x36a1('0x3e')]=_0xdc62f6;return _0x4a83a7;})[_0x36a1('0x22')](respondWithFilteredResult(_0x30a389,_0x507ae4))[_0x36a1('0x3f')](handleError(_0x30a389,null));};exports[_0x36a1('0x40')]=function(_0x36f763,_0x501244){var _0x3cbe1b={'raw':![],'where':{'id':_0x36f763[_0x36a1('0x41')]['id']}},_0x2eca9e={};_0x2eca9e[_0x36a1('0x2f')]=_[_0x36a1('0x31')](db[_0x36a1('0x2b')]['rawAttributes']);_0x2eca9e['query']=_['keys'](_0x36f763['query']);_0x2eca9e[_0x36a1('0x36')]=_[_0x36a1('0x33')](_0x2eca9e[_0x36a1('0x2f')],_0x2eca9e['query']);_0x3cbe1b[_0x36a1('0x32')]=_['intersection'](_0x2eca9e['model'],qs[_0x36a1('0x34')](_0x36f763['query'][_0x36a1('0x34')]));_0x3cbe1b['attributes']=_0x3cbe1b['attributes']['length']?_0x3cbe1b[_0x36a1('0x32')]:_0x2eca9e[_0x36a1('0x2f')];if(_0x36f763[_0x36a1('0x30')][_0x36a1('0x42')]){_0x3cbe1b[_0x36a1('0x3d')]=[{'all':!![]}];}_0x3cbe1b=_['merge']({},_0x3cbe1b,_0x36f763[_0x36a1('0x3c')]);return db[_0x36a1('0x2b')][_0x36a1('0x43')](_0x3cbe1b)[_0x36a1('0x22')](handleEntityNotFound(_0x501244,null))[_0x36a1('0x22')](respondWithResult(_0x501244,null))[_0x36a1('0x3f')](handleError(_0x501244,null));};exports[_0x36a1('0x44')]=function(_0x5b6163,_0x1b6a2f){return db[_0x36a1('0x2b')][_0x36a1('0x44')](_0x5b6163[_0x36a1('0x45')],{})[_0x36a1('0x22')](function(_0x2bf459){var _0x1084eb=_0x5b6163[_0x36a1('0x46')][_0x36a1('0x47')]({'plain':!![]});if(!_0x1084eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1084eb[_0x36a1('0x48')]==='user'){var _0x18c7d7=_0x2bf459['get']({'plain':!![]});var _0x4a0a99='Reports';return db[_0x36a1('0x49')][_0x36a1('0x43')]({'where':{'name':_0x4a0a99,'userProfileId':_0x1084eb['userProfileId']},'raw':!![]})[_0x36a1('0x22')](function(_0x4ef4c5){if(_0x4ef4c5&&_0x4ef4c5[_0x36a1('0x4a')]===0x0){return db[_0x36a1('0x4b')][_0x36a1('0x44')]({'name':_0x18c7d7[_0x36a1('0x27')],'resourceId':_0x18c7d7['id'],'type':_0x36a1('0x23'),'sectionId':_0x4ef4c5['id']},{})[_0x36a1('0x22')](function(){return _0x2bf459;});}else{return _0x2bf459;}})[_0x36a1('0x3f')](function(_0x4e41b5){logger[_0x36a1('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e41b5);throw _0x4e41b5;});}return _0x2bf459;})[_0x36a1('0x22')](respondWithResult(_0x1b6a2f,0xc9))[_0x36a1('0x3f')](handleError(_0x1b6a2f,null));};exports[_0x36a1('0x21')]=function(_0x269644,_0x173330){if(_0x269644[_0x36a1('0x45')]['id']){delete _0x269644[_0x36a1('0x45')]['id'];}return db[_0x36a1('0x2b')][_0x36a1('0x43')]({'where':{'id':_0x269644[_0x36a1('0x41')]['id']}})[_0x36a1('0x22')](handleEntityNotFound(_0x173330,null))['then'](saveUpdates(_0x269644[_0x36a1('0x45')],null))[_0x36a1('0x22')](respondWithResult(_0x173330,null))['catch'](handleError(_0x173330,null));};exports['destroy']=function(_0x56c739,_0xcd6c9b){return db[_0x36a1('0x2b')]['find']({'where':{'id':_0x56c739[_0x36a1('0x41')]['id']}})[_0x36a1('0x22')](handleEntityNotFound(_0xcd6c9b,null))[_0x36a1('0x22')](removeEntity(_0xcd6c9b,null))[_0x36a1('0x3f')](handleError(_0xcd6c9b,null));};exports[_0x36a1('0x4c')]=function(_0x3de41a,_0x559495){var _0x5908af=0xa;var _0x1a5a7a=['join','left_join',_0x36a1('0x4d'),_0x36a1('0x4e')];var _0x16bc20={'SUM':_0x36a1('0x4f'),'COUNT':_0x36a1('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x36a1('0x51'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x36a1('0x52'),'GROUP_CONCAT ASC':_0x36a1('0x53'),'GROUP_CONCAT DESC':_0x36a1('0x54')};var _0x438251={'SEC_TO_TIME':_0x36a1('0x55'),'DATE':_0x36a1('0x56'),'HOUR':_0x36a1('0x57'),'ROUND':_0x36a1('0x58'),'UNIX_TIMESTAMP':_0x36a1('0x59')};var _0x587b46=function(_0x3ca1b7){return!_['includes']([_0x36a1('0x5a'),_0x36a1('0x5b'),_0x36a1('0x5c'),_0x36a1('0x5d')],_0x3ca1b7);};var _0x4d287f=function(_0x43ae40){if(!_0x43ae40||!_0x43ae40['rules'][_0x36a1('0x5e')]){return'';}for(var _0x4cdb0c='(',_0x5da59d=0x0;_0x5da59d<_0x43ae40[_0x36a1('0x5f')][_0x36a1('0x5e')];_0x5da59d+=0x1){_0x5da59d>0x0&&(_0x4cdb0c+='\x20'+_0x43ae40[_0x36a1('0x60')]+'\x20');_0x4cdb0c+=_0x43ae40[_0x36a1('0x5f')][_0x5da59d][_0x36a1('0x61')]?_0x4d287f(_0x43ae40['rules'][_0x5da59d][_0x36a1('0x61')]):_0x43ae40[_0x36a1('0x5f')][_0x5da59d][_0x36a1('0x62')]+'\x20'+_0x43ae40['rules'][_0x5da59d][_0x36a1('0x63')]+(_0x587b46(_0x43ae40[_0x36a1('0x5f')][_0x5da59d][_0x36a1('0x63')])?'\x20'+_0x43ae40[_0x36a1('0x5f')][_0x5da59d]['value']:'');}return _0x4cdb0c+')';};var _0x6ac7f0={'where':{'id':_0x3de41a[_0x36a1('0x41')]['id']}},_0x5c75ce,_0x52d9ae,_0x3008c1,_0x328ca2,_0x2fd427;_0x6ac7f0=_[_0x36a1('0x39')]({},_0x6ac7f0,_0x3de41a['options']);return db[_0x36a1('0x2b')][_0x36a1('0x43')](_0x6ac7f0)[_0x36a1('0x22')](function(_0x4d888c){if(_0x4d888c){_0x5c75ce=_0x4d888c;return _0x4d888c[_0x36a1('0x64')]();}return null;})[_0x36a1('0x22')](function(_0x3ae349){if(_0x3ae349){if(!_0x3ae349[_0x36a1('0x5e')]){throw new db[(_0x36a1('0x65'))][(_0x36a1('0x66'))](_0x36a1('0x67'),0x193);}_0x52d9ae=_0x3ae349;return db[_0x36a1('0x68')][_0x36a1('0x69')]({'raw':!![]});}return null;})[_0x36a1('0x22')](function(_0x58cc66){if(_0x58cc66){_0x3008c1=_[_0x36a1('0x6a')](_0x58cc66,'id');var _0xf91bf2;var _0xd4309b=squel[_0x36a1('0x6b')]();_0xd4309b[_0x36a1('0x6c')](_0x5c75ce['table']);for(var _0x211de7=0x0;_0x211de7<_0x52d9ae[_0x36a1('0x5e')];_0x211de7+=0x1){_0xf91bf2=_0x52d9ae[_0x211de7][_0x36a1('0x6d')]?_0x3008c1[_0x52d9ae[_0x211de7]['MetricId']][_0x36a1('0x6e')]:_0x52d9ae[_0x211de7][_0x36a1('0x62')];_0xf91bf2=_0x52d9ae[_0x211de7]['function']?_[_0x36a1('0x6f')](_0x16bc20[_0x52d9ae[_0x211de7][_0x36a1('0x70')]],'%s',_0xf91bf2):_0xf91bf2;_0xf91bf2=_0x52d9ae[_0x211de7]['format']?_[_0x36a1('0x6f')](_0x438251[_0x52d9ae[_0x211de7]['format']],'%s',_0xf91bf2):_0xf91bf2;if(_0x52d9ae[_0x211de7][_0x36a1('0x71')]){_0xd4309b['group'](_0xf91bf2);}_0x52d9ae[_0x211de7][_0x36a1('0x72')]&&_0xd4309b['order'](_0xf91bf2,_0x52d9ae[_0x211de7][_0x36a1('0x72')]==='DESC'?![]:!![]);_0xd4309b[_0x36a1('0x62')](_0xf91bf2,_0x52d9ae[_0x211de7][_0x36a1('0x73')]||_0xf91bf2);}if(_0x5c75ce[_0x36a1('0x74')]){_0x5c75ce['joins']=JSON[_0x36a1('0x75')](_0x5c75ce[_0x36a1('0x74')]);for(var _0x19cb6b=0x0;_0x19cb6b<_0x5c75ce[_0x36a1('0x74')]['length'];_0x19cb6b+=0x1){if(_0x5c75ce[_0x36a1('0x74')][_0x19cb6b][_0x36a1('0x2e')]&&_[_0x36a1('0x76')](_0x1a5a7a,_0x5c75ce[_0x36a1('0x74')][_0x19cb6b]['type'])&&_0x5c75ce[_0x36a1('0x74')][_0x19cb6b]['parentKey']&&_0x5c75ce[_0x36a1('0x74')][_0x19cb6b][_0x36a1('0x77')]&&_0x5c75ce['joins'][_0x19cb6b][_0x36a1('0x78')]){_0xd4309b[_0x5c75ce[_0x36a1('0x74')][_0x19cb6b][_0x36a1('0x2e')]](_0x5c75ce[_0x36a1('0x74')][_0x19cb6b]['foreignTable'],null,util[_0x36a1('0x79')](_0x36a1('0x7a'),_0x5c75ce[_0x36a1('0x7b')],_0x5c75ce[_0x36a1('0x74')][_0x19cb6b][_0x36a1('0x7c')],_0x5c75ce[_0x36a1('0x74')][_0x19cb6b]['foreignTable'],_0x5c75ce['joins'][_0x19cb6b][_0x36a1('0x78')]));}}}if(_0x5c75ce[_0x36a1('0x7d')]){_0x5c75ce[_0x36a1('0x7d')]=JSON['parse'](_0x5c75ce['conditions']);_0xd4309b[_0x36a1('0x38')](_0x4d287f(_0x5c75ce[_0x36a1('0x7d')][_0x36a1('0x61')]));}_0x2fd427=_0xd4309b['clone']();_0xd4309b[_0x36a1('0x1a')](_0x5908af);_0xd4309b[_0x36a1('0x18')](0x0);logger[_0x36a1('0x7e')]('Limited\x20Query:',_0xd4309b[_0x36a1('0x7f')]());return dbH[_0x36a1('0x80')]['query'](_0xd4309b['toString'](),{'type':dbH[_0x36a1('0x80')]['QueryTypes']['SELECT']});}})[_0x36a1('0x22')](respondWithResult(_0x559495,null))[_0x36a1('0x3f')](handleError(_0x559495,null));};function runReport(_0xcace51,_0x508389,_0x5f3017){var _0x55ea60=_0x508389[_0x36a1('0x27')];var _0x249205=0xa;var _0x4962e6=[_0x36a1('0x81'),_0x36a1('0x82'),_0x36a1('0x4d'),_0x36a1('0x4e')];var _0x575c15={'SUM':_0x36a1('0x4f'),'COUNT':_0x36a1('0x50'),'COUNT DISTINCT':_0x36a1('0x83'),'MAX':'MAX(%s)','MIN':_0x36a1('0x84'),'AVG':_0x36a1('0x85'),'GROUP_CONCAT':_0x36a1('0x52'),'GROUP_CONCAT ASC':_0x36a1('0x53'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x593455={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x36a1('0x58'),'UNIX_TIMESTAMP':_0x36a1('0x59')};var _0x521ebe=function(_0x177121){return!_[_0x36a1('0x76')]([_0x36a1('0x5a'),_0x36a1('0x5b'),'IS\x20EMPTY',_0x36a1('0x5d')],_0x177121);};var _0x32a541=function(_0x28451d){if(!_0x28451d||!_0x28451d[_0x36a1('0x5f')][_0x36a1('0x5e')]){return'';}for(var _0x50962a='(',_0x470592=0x0;_0x470592<_0x28451d[_0x36a1('0x5f')][_0x36a1('0x5e')];_0x470592+=0x1){_0x470592>0x0&&(_0x50962a+='\x20'+_0x28451d['operator']+'\x20');_0x50962a+=_0x28451d['rules'][_0x470592][_0x36a1('0x61')]?_0x32a541(_0x28451d[_0x36a1('0x5f')][_0x470592][_0x36a1('0x61')]):_0x28451d[_0x36a1('0x5f')][_0x470592][_0x36a1('0x62')]+'\x20'+_0x28451d['rules'][_0x470592][_0x36a1('0x63')]+(_0x521ebe(_0x28451d[_0x36a1('0x5f')][_0x470592][_0x36a1('0x63')])?'\x20'+_0x28451d[_0x36a1('0x5f')][_0x470592][_0x36a1('0x86')]:'');}return _0x50962a+')';};var _0xe22113={'where':{'id':_0xcace51['id']}},_0x486b2c,_0x11cc15,_0x634347,_0x42801d,_0x4d4e19;_0xe22113=_[_0x36a1('0x39')]({},_0xe22113,_0x5f3017);return db[_0x36a1('0x2b')][_0x36a1('0x43')](_0xe22113)[_0x36a1('0x22')](function(_0xcaf1c5){if(_0xcaf1c5){_0x486b2c=_0xcaf1c5;return _0xcaf1c5[_0x36a1('0x64')]();}return null;})['then'](function(_0x2927c7){if(_0x2927c7){if(!_0x2927c7[_0x36a1('0x5e')]){throw new db[(_0x36a1('0x65'))][(_0x36a1('0x66'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x11cc15=_0x2927c7;return db[_0x36a1('0x68')][_0x36a1('0x69')]({'raw':!![]});}return null;})[_0x36a1('0x22')](function(_0x1a9798){if(_0x1a9798){_0x634347=_[_0x36a1('0x6a')](_0x1a9798,'id');var _0x51b89d;var _0xc27c61=squel[_0x36a1('0x6b')]();_0xc27c61[_0x36a1('0x6c')](_0x486b2c['table']);for(var _0x5a8615=0x0;_0x5a8615<_0x11cc15['length'];_0x5a8615+=0x1){_0x51b89d=_0x11cc15[_0x5a8615]['MetricId']?_0x634347[_0x11cc15[_0x5a8615][_0x36a1('0x6d')]][_0x36a1('0x6e')]:_0x11cc15[_0x5a8615][_0x36a1('0x62')];_0x51b89d=_0x11cc15[_0x5a8615][_0x36a1('0x70')]?_[_0x36a1('0x6f')](_0x575c15[_0x11cc15[_0x5a8615]['function']],'%s',_0x51b89d):_0x51b89d;_0x51b89d=_0x11cc15[_0x5a8615]['format']?_['replace'](_0x593455[_0x11cc15[_0x5a8615][_0x36a1('0x79')]],'%s',_0x51b89d):_0x51b89d;if(_0x11cc15[_0x5a8615][_0x36a1('0x71')]){_0xc27c61[_0x36a1('0x61')](_0x51b89d);}_0x11cc15[_0x5a8615]['orderBy']&&_0xc27c61[_0x36a1('0x87')](_0x51b89d,_0x11cc15[_0x5a8615][_0x36a1('0x72')]===_0x36a1('0x88')?![]:!![]);_0xc27c61['field'](_0x51b89d,_0x11cc15[_0x5a8615][_0x36a1('0x73')]||_0x51b89d);}if(_0x486b2c[_0x36a1('0x74')]){_0x486b2c[_0x36a1('0x74')]=JSON[_0x36a1('0x75')](_0x486b2c[_0x36a1('0x74')]);for(var _0x3f614a=0x0;_0x3f614a<_0x486b2c[_0x36a1('0x74')][_0x36a1('0x5e')];_0x3f614a+=0x1){if(_0x486b2c[_0x36a1('0x74')][_0x3f614a][_0x36a1('0x2e')]&&_[_0x36a1('0x76')](_0x4962e6,_0x486b2c[_0x36a1('0x74')][_0x3f614a][_0x36a1('0x2e')])&&_0x486b2c[_0x36a1('0x74')][_0x3f614a][_0x36a1('0x7c')]&&_0x486b2c[_0x36a1('0x74')][_0x3f614a][_0x36a1('0x77')]&&_0x486b2c['joins'][_0x3f614a][_0x36a1('0x78')]){_0xc27c61[_0x486b2c[_0x36a1('0x74')][_0x3f614a][_0x36a1('0x2e')]](_0x486b2c[_0x36a1('0x74')][_0x3f614a][_0x36a1('0x77')],null,util['format'](_0x36a1('0x7a'),_0x486b2c['table'],_0x486b2c['joins'][_0x3f614a][_0x36a1('0x7c')],_0x486b2c['joins'][_0x3f614a][_0x36a1('0x77')],_0x486b2c[_0x36a1('0x74')][_0x3f614a][_0x36a1('0x78')]));}}}if(_0x486b2c[_0x36a1('0x7d')]){_0x486b2c[_0x36a1('0x7d')]=JSON[_0x36a1('0x75')](_0x486b2c[_0x36a1('0x7d')]);_0xc27c61[_0x36a1('0x38')](_0x32a541(_0x486b2c['conditions'][_0x36a1('0x61')]));}_0x4d4e19=_0xc27c61[_0x36a1('0x89')]();_0xc27c61[_0x36a1('0x1a')](_0x249205);_0xc27c61[_0x36a1('0x18')](0x0);return;}})[_0x36a1('0x22')](function(){if(_0x508389[_0x36a1('0x8a')]===_0x36a1('0x8b')){return null;}var _0x41ac17=_['merge'](_0x508389,{'name':_0x508389[_0x36a1('0x8c')]||_0x508389[_0x36a1('0x27')]||_0x486b2c[_0x36a1('0x27')],'basename':_0x55ea60,'savename':util[_0x36a1('0x79')](_0x36a1('0x8d'),_0x508389['name']||_0x486b2c[_0x36a1('0x27')],require('randomstring')['generate'](0x4),_0x508389[_0x36a1('0x8a')]||_0x36a1('0x8e')),'reportId':_0x486b2c['id'],'reportType':'custom'});return db[_0x36a1('0x8f')][_0x36a1('0x44')](_0x41ac17,{'raw':!![]});})[_0x36a1('0x22')](function(_0x1a0f6b){if(_0x486b2c[_0x36a1('0x7b')]===_0x36a1('0x90')){_0x4d4e19[_0x36a1('0x38')](_0x486b2c['table']+_0x36a1('0x91'),_0x508389[_0x36a1('0x92')],_0x508389[_0x36a1('0x93')]);}else{_0x4d4e19[_0x36a1('0x38')](_0x486b2c[_0x36a1('0x7b')]+_0x36a1('0x94'),_0x508389[_0x36a1('0x92')],_0x508389[_0x36a1('0x93')]);}if(_0x1a0f6b){logger['info']('Run\x20Query:',_0x4d4e19[_0x36a1('0x7f')]());require('child_process')[_0x36a1('0x95')](path['join'](__dirname,_0x36a1('0x96'),_0x1a0f6b[_0x36a1('0x8a')]),[_0x1a0f6b['id'],_0x4d4e19['toString'](),path[_0x36a1('0x81')](__dirname,_0x36a1('0x97'),_0x1a0f6b[_0x36a1('0x98')]),_0x55ea60]);return _0x1a0f6b;}else{var _0x119afa=squel[_0x36a1('0x6b')]();_0x119afa[_0x36a1('0x6c')]('('+_0x4d4e19['toString']()+')',_0x36a1('0x99'));_0x119afa['field'](_0x36a1('0x9a'),_0x36a1('0x1b'));_0x4d4e19[_0x36a1('0x1a')](_0x508389[_0x36a1('0x1a')]||_0x249205);_0x4d4e19[_0x36a1('0x18')](_0x508389[_0x36a1('0x18')]||0x0);return dbH[_0x36a1('0x80')][_0x36a1('0x30')](_0x119afa[_0x36a1('0x7f')](),{'type':dbH['sequelize'][_0x36a1('0x9b')][_0x36a1('0x9c')]})[_0x36a1('0x22')](function(_0x3354b6){if(!_0x3354b6['length']){_0x42801d=0x0;}else{_0x42801d=_0x3354b6[0x0][_0x36a1('0x1b')]||0x0;}return dbH[_0x36a1('0x80')][_0x36a1('0x30')](_0x4d4e19[_0x36a1('0x7f')](),{'type':dbH[_0x36a1('0x80')][_0x36a1('0x9b')]['SELECT']});})[_0x36a1('0x22')](function(_0x4389ed){return{'rows':_0x4389ed||[],'count':_0x42801d};});}});}exports[_0x36a1('0x9d')]=function(_0xe159c,_0x15ba09){return runReport(_0xe159c[_0x36a1('0x41')],_0xe159c[_0x36a1('0x30')],_0xe159c[_0x36a1('0x3c')])[_0x36a1('0x22')](respondWithResult(_0x15ba09,null))['catch'](handleError(_0x15ba09,null));};exports['runReport']=runReport;exports['query']=function(_0x5c2378,_0x75663c){var _0x8d7f9b=0xa;var _0x4ca0ef=[_0x36a1('0x81'),_0x36a1('0x82'),_0x36a1('0x4d'),_0x36a1('0x4e')];var _0x136686={'SUM':_0x36a1('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x36a1('0x84'),'AVG':_0x36a1('0x85'),'GROUP_CONCAT':_0x36a1('0x52'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x36a1('0x54')};var _0x34da42={'SEC_TO_TIME':_0x36a1('0x55'),'DATE':_0x36a1('0x56'),'HOUR':_0x36a1('0x57'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x36a1('0x59')};var _0x210ff3=function(_0x19c89c){return!_['includes']([_0x36a1('0x5a'),_0x36a1('0x5b'),_0x36a1('0x5c'),_0x36a1('0x5d')],_0x19c89c);};var _0x14bb27=function(_0x4804a2){if(!_0x4804a2||!_0x4804a2[_0x36a1('0x5f')]['length']){return'';}for(var _0x2e136e='(',_0x4a9499=0x0;_0x4a9499<_0x4804a2[_0x36a1('0x5f')][_0x36a1('0x5e')];_0x4a9499+=0x1){_0x4a9499>0x0&&(_0x2e136e+='\x20'+_0x4804a2[_0x36a1('0x60')]+'\x20');_0x2e136e+=_0x4804a2[_0x36a1('0x5f')][_0x4a9499]['group']?_0x14bb27(_0x4804a2[_0x36a1('0x5f')][_0x4a9499]['group']):_0x4804a2['rules'][_0x4a9499]['field']+'\x20'+_0x4804a2[_0x36a1('0x5f')][_0x4a9499][_0x36a1('0x63')]+(_0x210ff3(_0x4804a2[_0x36a1('0x5f')][_0x4a9499][_0x36a1('0x63')])?'\x20'+_0x4804a2[_0x36a1('0x5f')][_0x4a9499][_0x36a1('0x86')]:'');}return _0x2e136e+')';};var _0x27f965={'where':{'id':_0x5c2378[_0x36a1('0x41')]['id']}},_0x47e484,_0x528a9d,_0x5b456c,_0x42cc27,_0x7d75c6;_0x27f965=_['merge']({},_0x27f965,_0x5c2378['options']);return db[_0x36a1('0x2b')][_0x36a1('0x43')](_0x27f965)['then'](function(_0x19bea6){if(_0x19bea6){_0x47e484=_0x19bea6;return _0x19bea6[_0x36a1('0x64')]();}return null;})[_0x36a1('0x22')](function(_0x4438ef){if(_0x4438ef){if(!_0x4438ef[_0x36a1('0x5e')]){throw new db[(_0x36a1('0x65'))][(_0x36a1('0x66'))](_0x36a1('0x67'),0x193);}_0x528a9d=_0x4438ef;return db['AnalyticMetric'][_0x36a1('0x69')]({'raw':!![]});}return null;})[_0x36a1('0x22')](function(_0x2801dd){if(_0x2801dd){_0x5b456c=_[_0x36a1('0x6a')](_0x2801dd,'id');var _0x12518c;var _0x5dff3f=squel[_0x36a1('0x6b')]();_0x5dff3f[_0x36a1('0x6c')](_0x47e484[_0x36a1('0x7b')]);for(var _0x534074=0x0;_0x534074<_0x528a9d['length'];_0x534074+=0x1){_0x12518c=_0x528a9d[_0x534074][_0x36a1('0x6d')]?_0x5b456c[_0x528a9d[_0x534074][_0x36a1('0x6d')]]['metric']:_0x528a9d[_0x534074][_0x36a1('0x62')];_0x12518c=_0x528a9d[_0x534074]['function']?_[_0x36a1('0x6f')](_0x136686[_0x528a9d[_0x534074][_0x36a1('0x70')]],'%s',_0x12518c):_0x12518c;_0x12518c=_0x528a9d[_0x534074][_0x36a1('0x79')]?_[_0x36a1('0x6f')](_0x34da42[_0x528a9d[_0x534074]['format']],'%s',_0x12518c):_0x12518c;if(_0x528a9d[_0x534074][_0x36a1('0x71')]){_0x5dff3f['group'](_0x12518c);}_0x528a9d[_0x534074][_0x36a1('0x72')]&&_0x5dff3f[_0x36a1('0x87')](_0x12518c,_0x528a9d[_0x534074][_0x36a1('0x72')]===_0x36a1('0x88')?![]:!![]);_0x5dff3f[_0x36a1('0x62')](_0x12518c,_0x528a9d[_0x534074][_0x36a1('0x73')]||_0x12518c);}if(_0x47e484[_0x36a1('0x74')]){_0x47e484['joins']=JSON[_0x36a1('0x75')](_0x47e484[_0x36a1('0x74')]);for(var _0xade88e=0x0;_0xade88e<_0x47e484[_0x36a1('0x74')]['length'];_0xade88e+=0x1){if(_0x47e484[_0x36a1('0x74')][_0xade88e][_0x36a1('0x2e')]&&_[_0x36a1('0x76')](_0x4ca0ef,_0x47e484['joins'][_0xade88e]['type'])&&_0x47e484['joins'][_0xade88e][_0x36a1('0x7c')]&&_0x47e484[_0x36a1('0x74')][_0xade88e][_0x36a1('0x77')]&&_0x47e484[_0x36a1('0x74')][_0xade88e][_0x36a1('0x78')]){_0x5dff3f[_0x47e484[_0x36a1('0x74')][_0xade88e]['type']](_0x47e484['joins'][_0xade88e][_0x36a1('0x77')],null,util['format'](_0x36a1('0x7a'),_0x47e484[_0x36a1('0x7b')],_0x47e484[_0x36a1('0x74')][_0xade88e]['parentKey'],_0x47e484[_0x36a1('0x74')][_0xade88e][_0x36a1('0x77')],_0x47e484['joins'][_0xade88e][_0x36a1('0x78')]));}}}if(_0x47e484[_0x36a1('0x7d')]){_0x47e484['conditions']=JSON[_0x36a1('0x75')](_0x47e484['conditions']);_0x5dff3f[_0x36a1('0x38')](_0x14bb27(_0x47e484[_0x36a1('0x7d')][_0x36a1('0x61')]));}_0x7d75c6=_0x5dff3f[_0x36a1('0x89')]();_0x5dff3f[_0x36a1('0x1a')](_0x8d7f9b);_0x5dff3f[_0x36a1('0x18')](0x0);logger[_0x36a1('0x7e')](_0x36a1('0x9e'),_0x5dff3f[_0x36a1('0x7f')]());return dbH[_0x36a1('0x80')][_0x36a1('0x30')](_0x5dff3f['toString'](),{'type':dbH[_0x36a1('0x80')][_0x36a1('0x9b')][_0x36a1('0x9c')]});}})[_0x36a1('0x22')](function(){return{'sql':_0x7d75c6[_0x36a1('0x7f')]()};})['then'](respondWithResult(_0x75663c,null))['catch'](handleError(_0x75663c,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 3ef3a90..cde25e7 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 _0xa375=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x18abe8,_0x2f7d4c){var _0xef4f51=function(_0x9ee6c){while(--_0x9ee6c){_0x18abe8['push'](_0x18abe8['shift']());}};_0xef4f51(++_0x2f7d4c);}(_0xa375,0x8f));var _0x5a37=function(_0x23e33d,_0x31c8c8){_0x23e33d=_0x23e33d-0x0;var _0x818fc=_0xa375[_0x23e33d];return _0x818fc;};'use strict';var _=require(_0x5a37('0x0'));var util=require(_0x5a37('0x1'));var logger=require(_0x5a37('0x2'))('api');var moment=require(_0x5a37('0x3'));var BPromise=require(_0x5a37('0x4'));var rp=require(_0x5a37('0x5'));var fs=require('fs');var path=require(_0x5a37('0x6'));var rimraf=require('rimraf');var config=require(_0x5a37('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x5a37('0x8')]=function(_0x1be034,_0xc3bced){return _0x1be034[_0x5a37('0x9')](_0x5a37('0xa'),attributes,{'tableName':_0x5a37('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe3cf=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','request-promise','path'];(function(_0x495f5e,_0x505cba){var _0x1a1669=function(_0x4c169b){while(--_0x4c169b){_0x495f5e['push'](_0x495f5e['shift']());}};_0x1a1669(++_0x505cba);}(_0xe3cf,0x103));var _0xfe3c=function(_0x242054,_0x36cd5a){_0x242054=_0x242054-0x0;var _0x2d5b33=_0xe3cf[_0x242054];return _0x2d5b33;};'use strict';var _=require(_0xfe3c('0x0'));var util=require(_0xfe3c('0x1'));var logger=require(_0xfe3c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfe3c('0x3'));var fs=require('fs');var path=require(_0xfe3c('0x4'));var rimraf=require(_0xfe3c('0x5'));var config=require(_0xfe3c('0x6'));var attributes=require(_0xfe3c('0x7'));module[_0xfe3c('0x8')]=function(_0x553928,_0x1b29e8){return _0x553928['define'](_0xfe3c('0x9'),attributes,{'tableName':_0xfe3c('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index e1ba865..a5be8f9 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 _0x99f5=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x356dcc,_0x51f8f7){var _0xe6c019=function(_0xc0710d){while(--_0xc0710d){_0x356dcc['push'](_0x356dcc['shift']());}};_0xe6c019(++_0x51f8f7);}(_0x99f5,0x175));var _0x599f=function(_0x42c1a0,_0x268813){_0x42c1a0=_0x42c1a0-0x0;var _0x2f984b=_0x99f5[_0x42c1a0];return _0x2f984b;};'use strict';var _=require(_0x599f('0x0'));var util=require(_0x599f('0x1'));var moment=require(_0x599f('0x2'));var BPromise=require(_0x599f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x599f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x599f('0x5'));var logger=require(_0x599f('0x6'))(_0x599f('0x7'));var config=require(_0x599f('0x8'));var jayson=require(_0x599f('0x9'));var client=jayson[_0x599f('0xa')][_0x599f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2709d3,_0xf96e62,_0x2e6052){return new BPromise(function(_0x373ee2,_0x11a192){return client[_0x599f('0xc')](_0x2709d3,_0x2e6052)[_0x599f('0xd')](function(_0x36b7d0){logger[_0x599f('0xe')](_0x599f('0xf'),_0xf96e62,_0x599f('0x10'));logger[_0x599f('0x11')](_0x599f('0x12'),_0xf96e62,'request\x20sent',JSON[_0x599f('0x13')](_0x36b7d0));if(_0x36b7d0['error']){if(_0x36b7d0[_0x599f('0x14')][_0x599f('0x15')]===0x1f4){logger[_0x599f('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0xf96e62,_0x36b7d0[_0x599f('0x14')][_0x599f('0x16')]);return _0x11a192(_0x36b7d0['error']['message']);}logger[_0x599f('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0xf96e62,_0x36b7d0['error'][_0x599f('0x16')]);return _0x373ee2(_0x36b7d0[_0x599f('0x14')]['message']);}else{logger[_0x599f('0xe')](_0x599f('0xf'),_0xf96e62,_0x599f('0x10'));_0x373ee2(_0x36b7d0[_0x599f('0x17')][_0x599f('0x16')]);}})['catch'](function(_0x1aed8f){logger[_0x599f('0x14')](_0x599f('0xf'),_0xf96e62,_0x1aed8f);_0x11a192(_0x1aed8f);});});}
\ No newline at end of file
+var _0x8f9a=['stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x160606,_0x38d60b){var _0x3457e6=function(_0x3dadfa){while(--_0x3dadfa){_0x160606['push'](_0x160606['shift']());}};_0x3457e6(++_0x38d60b);}(_0x8f9a,0x16b));var _0xa8f9=function(_0x3fd073,_0x32931f){_0x3fd073=_0x3fd073-0x0;var _0x40d7b1=_0x8f9a[_0x3fd073];return _0x40d7b1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa8f9('0x0'));var BPromise=require(_0xa8f9('0x1'));var rs=require(_0xa8f9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa8f9('0x3'))['db'];var utils=require(_0xa8f9('0x4'));var logger=require(_0xa8f9('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa8f9('0x6'));var client=jayson['client'][_0xa8f9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e5262,_0x4acf8c,_0x45107e){return new BPromise(function(_0x47b24d,_0x3b219d){return client[_0xa8f9('0x8')](_0x4e5262,_0x45107e)[_0xa8f9('0x9')](function(_0x34410d){logger[_0xa8f9('0xa')](_0xa8f9('0xb'),_0x4acf8c,'request\x20sent');logger[_0xa8f9('0xc')](_0xa8f9('0xd'),_0x4acf8c,_0xa8f9('0xe'),JSON[_0xa8f9('0xf')](_0x34410d));if(_0x34410d[_0xa8f9('0x10')]){if(_0x34410d[_0xa8f9('0x10')][_0xa8f9('0x11')]===0x1f4){logger[_0xa8f9('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4acf8c,_0x34410d['error'][_0xa8f9('0x12')]);return _0x3b219d(_0x34410d[_0xa8f9('0x10')][_0xa8f9('0x12')]);}logger[_0xa8f9('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4acf8c,_0x34410d['error']['message']);return _0x47b24d(_0x34410d[_0xa8f9('0x10')][_0xa8f9('0x12')]);}else{logger[_0xa8f9('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4acf8c,_0xa8f9('0xe'));_0x47b24d(_0x34410d[_0xa8f9('0x13')]['message']);}})[_0xa8f9('0x14')](function(_0x5a63d7){logger[_0xa8f9('0x10')](_0xa8f9('0xb'),_0x4acf8c,_0x5a63d7);_0x3b219d(_0x5a63d7);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 3ed6e51..78f7f2d 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 _0x4ce7=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','create','put','update','exports'];(function(_0x88d090,_0xc4e820){var _0x50c8cf=function(_0x2ebded){while(--_0x2ebded){_0x88d090['push'](_0x88d090['shift']());}};_0x50c8cf(++_0xc4e820);}(_0x4ce7,0x1e4));var _0x74ce=function(_0x2e9c2d,_0x209f38){_0x2e9c2d=_0x2e9c2d-0x0;var _0x162ed1=_0x4ce7[_0x2e9c2d];return _0x162ed1;};'use strict';var multer=require(_0x74ce('0x0'));var util=require(_0x74ce('0x1'));var path=require(_0x74ce('0x2'));var timeout=require('connect-timeout');var express=require(_0x74ce('0x3'));var router=express[_0x74ce('0x4')]();var fs_extra=require(_0x74ce('0x5'));var auth=require(_0x74ce('0x6'));var interaction=require(_0x74ce('0x7'));var config=require(_0x74ce('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x74ce('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x74ce('0x9')](_0x74ce('0xa'),auth[_0x74ce('0xb')](),controller[_0x74ce('0xc')]);router[_0x74ce('0x9')](_0x74ce('0xd'),auth[_0x74ce('0xb')](),controller[_0x74ce('0xe')]);router['get'](_0x74ce('0xf'),auth[_0x74ce('0xb')](),controller['run']);router['get'](_0x74ce('0x10'),auth[_0x74ce('0xb')](),controller[_0x74ce('0x11')]);router['post']('/',auth[_0x74ce('0xb')](),controller[_0x74ce('0x12')]);router[_0x74ce('0x13')](_0x74ce('0xa'),auth[_0x74ce('0xb')](),controller[_0x74ce('0x14')]);router['delete']('/:id',auth[_0x74ce('0xb')](),controller['destroy']);module[_0x74ce('0x15')]=router;
\ No newline at end of file
+var _0x097c=['update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','post','put'];(function(_0x4b51aa,_0x2d363e){var _0x586b66=function(_0x310d73){while(--_0x310d73){_0x4b51aa['push'](_0x4b51aa['shift']());}};_0x586b66(++_0x2d363e);}(_0x097c,0x168));var _0xc097=function(_0xba7682,_0x47231f){_0xba7682=_0xba7682-0x0;var _0x52ad33=_0x097c[_0xba7682];return _0x52ad33;};'use strict';var multer=require(_0xc097('0x0'));var util=require(_0xc097('0x1'));var path=require(_0xc097('0x2'));var timeout=require(_0xc097('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc097('0x4'));var auth=require(_0xc097('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc097('0x6'));var controller=require(_0xc097('0x7'));router[_0xc097('0x8')]('/',auth[_0xc097('0x9')](),controller[_0xc097('0xa')]);router[_0xc097('0x8')](_0xc097('0xb'),auth[_0xc097('0x9')](),controller['show']);router[_0xc097('0x8')](_0xc097('0xc'),auth['isAuthenticated'](),controller[_0xc097('0xd')]);router['get'](_0xc097('0xe'),auth['isAuthenticated'](),controller[_0xc097('0xf')]);router['get']('/:id/query',auth['isAuthenticated'](),controller['query']);router[_0xc097('0x10')]('/',auth[_0xc097('0x9')](),controller['create']);router[_0xc097('0x11')]('/:id',auth[_0xc097('0x9')](),controller[_0xc097('0x12')]);router[_0xc097('0x13')](_0xc097('0xb'),auth[_0xc097('0x9')](),controller[_0xc097('0x14')]);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 696da73..6d877c6 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 _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x83b4e,_0x47c407){var _0x2beec8=function(_0x48848f){while(--_0x48848f){_0x83b4e['push'](_0x83b4e['shift']());}};_0x2beec8(++_0x47c407);}(_0x5fab,0x177));var _0xb5fa=function(_0x4d6624,_0x78b606){_0x4d6624=_0x4d6624-0x0;var _0x5dbb01=_0x5fab[_0x4d6624];return _0x5dbb01;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}};
\ No newline at end of file
+var _0x2675=['sequelize','STRING','TEXT'];(function(_0x4f431d,_0xd51a3b){var _0x4f31e1=function(_0x1c688d){while(--_0x1c688d){_0x4f431d['push'](_0x4f431d['shift']());}};_0x4f31e1(++_0xd51a3b);}(_0x2675,0x75));var _0x5267=function(_0x1319e6,_0xbac853){_0x1319e6=_0x1319e6-0x0;var _0x14ec6b=_0x2675[_0x1319e6];return _0x14ec6b;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index b47edc5..96c252d 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 _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','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/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xabce[_0x433a86];return _0x23000c;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));};
\ No newline at end of file
+var _0xdc97=['startDate','toString','../../components/export/','savename','COUNT(*)','eml-format','rimraf','zip-dir','request-promise','bluebird','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','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','DefaultReports','UserProfileResource','error','stack','name','map','AnalyticDefaultReport','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','join','SUM(%s)','COUNT(%s)','value','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','clone','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','default','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc97,0x13b));var _0x7dc9=function(_0x36f32e,_0x485452){_0x36f32e=_0x36f32e-0x0;var _0x491c76=_0xdc97[_0x36f32e];return _0x491c76;};'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'];var dbH=require('../../mysqldb')[_0x7dc9('0x16')];function respondWithStatusCode(_0x14e5db,_0x5c6ca5){_0x5c6ca5=_0x5c6ca5||0xcc;return function(_0xbd06be){if(_0xbd06be){return _0x14e5db[_0x7dc9('0x17')](_0x5c6ca5);}return _0x14e5db[_0x7dc9('0x18')](_0x5c6ca5)[_0x7dc9('0x19')]();};}function respondWithResult(_0x31d43d,_0x11af93){_0x11af93=_0x11af93||0xc8;return function(_0x524d09){if(_0x524d09){return _0x31d43d[_0x7dc9('0x18')](_0x11af93)[_0x7dc9('0x1a')](_0x524d09);}};}function respondWithFilteredResult(_0x1b0aa1,_0x442819){return function(_0x11606f){if(_0x11606f){var _0xbe0437=typeof _0x442819[_0x7dc9('0x1b')]===_0x7dc9('0x1c')&&typeof _0x442819[_0x7dc9('0x1d')]==='undefined';var _0x22577e=_0x11606f['count'];var _0x1f5906=_0xbe0437?0x0:_0x442819[_0x7dc9('0x1b')];var _0x5d61d7=_0xbe0437?_0x11606f[_0x7dc9('0x1e')]:_0x442819[_0x7dc9('0x1b')]+_0x442819[_0x7dc9('0x1d')];var _0x4b2703;if(_0x5d61d7>=_0x22577e){_0x5d61d7=_0x22577e;_0x4b2703=0xc8;}else{_0x4b2703=0xce;}_0x1b0aa1[_0x7dc9('0x18')](_0x4b2703);return _0x1b0aa1[_0x7dc9('0x1f')](_0x7dc9('0x20'),_0x1f5906+'-'+_0x5d61d7+'/'+_0x22577e)[_0x7dc9('0x1a')](_0x11606f);}return null;};}function patchUpdates(_0x155cc4){return function(_0x2b38d6){try{jsonpatch['apply'](_0x2b38d6,_0x155cc4,!![]);}catch(_0x593e60){return BPromise[_0x7dc9('0x21')](_0x593e60);}return _0x2b38d6[_0x7dc9('0x22')]();};}function saveUpdates(_0x596e0f,_0x349001){return function(_0x27f7fa){if(_0x27f7fa){return _0x27f7fa['update'](_0x596e0f)[_0x7dc9('0x23')](function(_0x43d31f){return _0x43d31f;});}return null;};}function removeEntity(_0x41110a,_0x4906b1){return function(_0x424763){if(_0x424763){return _0x424763[_0x7dc9('0x24')]()[_0x7dc9('0x23')](function(){var _0x55a482=_0x424763['get']({'plain':!![]});var _0x4b9ba6=_0x7dc9('0x25');return db[_0x7dc9('0x26')]['destroy']({'where':{'type':_0x4b9ba6,'resourceId':_0x55a482['id']}})['then'](function(){return _0x424763;});})[_0x7dc9('0x23')](function(){_0x41110a['status'](0xcc)[_0x7dc9('0x19')]();});}};}function handleEntityNotFound(_0x1c690b,_0x3a74a0){return function(_0x3e4102){if(!_0x3e4102){_0x1c690b[_0x7dc9('0x17')](0x194);}return _0x3e4102;};}function handleError(_0x450124,_0x236d42){_0x236d42=_0x236d42||0x1f4;return function(_0x229f8e){logger[_0x7dc9('0x27')](_0x229f8e[_0x7dc9('0x28')]);if(_0x229f8e[_0x7dc9('0x29')]){delete _0x229f8e[_0x7dc9('0x29')];}_0x450124['status'](_0x236d42)['send'](_0x229f8e);};}exports['index']=function(_0x49a4a5,_0x4a68f0){var _0x553a03={},_0x58c4e8={},_0x59f5d8={'count':0x0,'rows':[]};var _0x4463dc=_[_0x7dc9('0x2a')](db[_0x7dc9('0x2b')][_0x7dc9('0x2c')],function(_0x3300ff){return{'name':_0x3300ff[_0x7dc9('0x2d')],'type':_0x3300ff['type']['key']};});_0x58c4e8['model']=_[_0x7dc9('0x2a')](_0x4463dc,'name');_0x58c4e8[_0x7dc9('0x2e')]=_[_0x7dc9('0x2f')](_0x49a4a5[_0x7dc9('0x2e')]);_0x58c4e8[_0x7dc9('0x30')]=_[_0x7dc9('0x31')](_0x58c4e8[_0x7dc9('0x32')],_0x58c4e8[_0x7dc9('0x2e')]);_0x553a03[_0x7dc9('0x33')]=_['intersection'](_0x58c4e8[_0x7dc9('0x32')],qs['fields'](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x34')]));_0x553a03[_0x7dc9('0x33')]=_0x553a03[_0x7dc9('0x33')]['length']?_0x553a03[_0x7dc9('0x33')]:_0x58c4e8['model'];if(!_0x49a4a5[_0x7dc9('0x2e')]['hasOwnProperty']('nolimit')){_0x553a03[_0x7dc9('0x1d')]=qs[_0x7dc9('0x1d')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x1d')]);_0x553a03['offset']=qs[_0x7dc9('0x1b')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x1b')]);}_0x553a03[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x553a03[_0x7dc9('0x37')]=qs[_0x7dc9('0x30')](_[_0x7dc9('0x38')](_0x49a4a5[_0x7dc9('0x2e')],_0x58c4e8[_0x7dc9('0x30')]),_0x4463dc);if(_0x49a4a5['query'][_0x7dc9('0x39')]){_0x553a03[_0x7dc9('0x37')]=_[_0x7dc9('0x3a')](_0x553a03[_0x7dc9('0x37')],{'$or':_['map'](_0x4463dc,function(_0x3492e6){if(_0x3492e6[_0x7dc9('0x3b')]!==_0x7dc9('0x3c')){var _0x3876b6={};_0x3876b6[_0x3492e6[_0x7dc9('0x29')]]={'$like':'%'+_0x49a4a5[_0x7dc9('0x2e')]['filter']+'%'};return _0x3876b6;}})});}_0x553a03=_['merge']({},_0x553a03,_0x49a4a5[_0x7dc9('0x3d')]);var _0x36a965={'where':_0x553a03['where']};return db[_0x7dc9('0x2b')]['count'](_0x36a965)[_0x7dc9('0x23')](function(_0x2a91fe){_0x59f5d8[_0x7dc9('0x1e')]=_0x2a91fe;if(_0x49a4a5['query'][_0x7dc9('0x3e')]){_0x553a03[_0x7dc9('0x3f')]=[{'all':!![]}];}return db[_0x7dc9('0x2b')][_0x7dc9('0x40')](_0x553a03);})[_0x7dc9('0x23')](function(_0x23499a){_0x59f5d8[_0x7dc9('0x41')]=_0x23499a;return _0x59f5d8;})['then'](respondWithFilteredResult(_0x4a68f0,_0x553a03))[_0x7dc9('0x42')](handleError(_0x4a68f0,null));};exports['show']=function(_0x52d883,_0xcced6c){var _0x294276={'raw':!![],'where':{'id':_0x52d883[_0x7dc9('0x43')]['id']}},_0x18c8a1={};_0x18c8a1[_0x7dc9('0x32')]=_[_0x7dc9('0x2f')](db[_0x7dc9('0x2b')][_0x7dc9('0x2c')]);_0x18c8a1[_0x7dc9('0x2e')]=_['keys'](_0x52d883[_0x7dc9('0x2e')]);_0x18c8a1[_0x7dc9('0x30')]=_[_0x7dc9('0x31')](_0x18c8a1[_0x7dc9('0x32')],_0x18c8a1[_0x7dc9('0x2e')]);_0x294276[_0x7dc9('0x33')]=_['intersection'](_0x18c8a1[_0x7dc9('0x32')],qs[_0x7dc9('0x34')](_0x52d883['query'][_0x7dc9('0x34')]));_0x294276[_0x7dc9('0x33')]=_0x294276[_0x7dc9('0x33')]['length']?_0x294276[_0x7dc9('0x33')]:_0x18c8a1['model'];if(_0x52d883['query'][_0x7dc9('0x3e')]){_0x294276[_0x7dc9('0x3f')]=[{'all':!![]}];}_0x294276=_[_0x7dc9('0x3a')]({},_0x294276,_0x52d883['options']);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x294276)['then'](handleEntityNotFound(_0xcced6c,null))[_0x7dc9('0x23')](respondWithResult(_0xcced6c,null))[_0x7dc9('0x42')](handleError(_0xcced6c,null));};exports['create']=function(_0x24ccce,_0x1d6c0a){return db[_0x7dc9('0x2b')][_0x7dc9('0x45')](_0x24ccce[_0x7dc9('0x46')],{})[_0x7dc9('0x23')](function(_0x86739f){var _0x3a1102=_0x24ccce[_0x7dc9('0x47')][_0x7dc9('0x48')]({'plain':!![]});if(!_0x3a1102)throw new Error(_0x7dc9('0x49'));if(_0x3a1102[_0x7dc9('0x4a')]===_0x7dc9('0x47')){var _0x59be9b=_0x86739f[_0x7dc9('0x48')]({'plain':!![]});var _0x4fcfd5='Reports';return db[_0x7dc9('0x4b')][_0x7dc9('0x44')]({'where':{'name':_0x4fcfd5,'userProfileId':_0x3a1102[_0x7dc9('0x4c')]},'raw':!![]})[_0x7dc9('0x23')](function(_0x346d27){if(_0x346d27&&_0x346d27['autoAssociation']===0x0){return db[_0x7dc9('0x26')][_0x7dc9('0x45')]({'name':_0x59be9b[_0x7dc9('0x29')],'resourceId':_0x59be9b['id'],'type':'DefaultReports','sectionId':_0x346d27['id']},{})[_0x7dc9('0x23')](function(){return _0x86739f;});}else{return _0x86739f;}})[_0x7dc9('0x42')](function(_0x2cf133){logger[_0x7dc9('0x27')](_0x7dc9('0x4d'),_0x2cf133);throw _0x2cf133;});}return _0x86739f;})[_0x7dc9('0x23')](respondWithResult(_0x1d6c0a,0xc9))['catch'](handleError(_0x1d6c0a,null));};exports[_0x7dc9('0x4e')]=function(_0x2ecc80,_0x2b0941){if(_0x2ecc80[_0x7dc9('0x46')]['id']){delete _0x2ecc80[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x2b')][_0x7dc9('0x44')]({'where':{'id':_0x2ecc80[_0x7dc9('0x43')]['id']}})[_0x7dc9('0x23')](handleEntityNotFound(_0x2b0941,null))[_0x7dc9('0x23')](saveUpdates(_0x2ecc80[_0x7dc9('0x46')],null))[_0x7dc9('0x23')](respondWithResult(_0x2b0941,null))['catch'](handleError(_0x2b0941,null));};exports[_0x7dc9('0x24')]=function(_0x39be46,_0x38df9a){return db[_0x7dc9('0x2b')][_0x7dc9('0x44')]({'where':{'id':_0x39be46['params']['id']}})[_0x7dc9('0x23')](handleEntityNotFound(_0x38df9a,null))[_0x7dc9('0x23')](removeEntity(_0x38df9a,null))[_0x7dc9('0x42')](handleError(_0x38df9a,null));};exports[_0x7dc9('0x4f')]=function(_0x2a1db8,_0x2f01a0){var _0x495a06=0xa;var _0x547caa=['join',_0x7dc9('0x50'),_0x7dc9('0x51'),_0x7dc9('0x52')];var _0x2afefc={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7dc9('0x53'),'MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':_0x7dc9('0x56'),'GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':_0x7dc9('0x59')};var _0x4905f6={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':_0x7dc9('0x5b'),'HOUR':_0x7dc9('0x5c'),'ROUND':_0x7dc9('0x5d'),'UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x4bbf8b=function(_0x175858){return!_[_0x7dc9('0x5f')]([_0x7dc9('0x60'),_0x7dc9('0x61'),_0x7dc9('0x62'),_0x7dc9('0x63')],_0x175858);};var _0x286ac5=function(_0x2a02ed){if(!_0x2a02ed||!_0x2a02ed[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x19c209='(',_0xf3ae59=0x0;_0xf3ae59<_0x2a02ed[_0x7dc9('0x64')]['length'];_0xf3ae59+=0x1){_0xf3ae59>0x0&&(_0x19c209+='\x20'+_0x2a02ed[_0x7dc9('0x66')]+'\x20');_0x19c209+=_0x2a02ed['rules'][_0xf3ae59][_0x7dc9('0x67')]?_0x286ac5(_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59]['group']):_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59][_0x7dc9('0x68')]+'\x20'+_0x2a02ed['rules'][_0xf3ae59][_0x7dc9('0x69')]+(_0x4bbf8b(_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59][_0x7dc9('0x69')])?'\x20'+_0x2a02ed['rules'][_0xf3ae59]['value']:'');}return _0x19c209+')';};var _0x205d01={'where':{'id':_0x2a1db8[_0x7dc9('0x43')]['id']}},_0x366d4d,_0x4ed60e,_0x3aba59,_0x15d02f,_0x2bbf61;_0x205d01=_[_0x7dc9('0x3a')]({},_0x205d01,_0x2a1db8[_0x7dc9('0x3d')]);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x205d01)[_0x7dc9('0x23')](function(_0x3f81dd){if(_0x3f81dd){_0x366d4d=_0x3f81dd;return _0x3f81dd['getFields']();}return null;})['then'](function(_0x1b2369){if(_0x1b2369){if(!_0x1b2369[_0x7dc9('0x65')]){throw new db[(_0x7dc9('0x6a'))][(_0x7dc9('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ed60e=_0x1b2369;return db['AnalyticMetric'][_0x7dc9('0x40')]({'raw':!![]});}return null;})[_0x7dc9('0x23')](function(_0x25f8b3){if(_0x25f8b3){_0x3aba59=_[_0x7dc9('0x6c')](_0x25f8b3,'id');var _0x5d211b;var _0xea1728=squel[_0x7dc9('0x6d')]();_0xea1728[_0x7dc9('0x6e')](_0x366d4d[_0x7dc9('0x6f')]);for(var _0x19e0b1=0x0;_0x19e0b1<_0x4ed60e[_0x7dc9('0x65')];_0x19e0b1+=0x1){_0x5d211b=_0x4ed60e[_0x19e0b1][_0x7dc9('0x70')]?_0x3aba59[_0x4ed60e[_0x19e0b1]['MetricId']][_0x7dc9('0x71')]:_0x4ed60e[_0x19e0b1][_0x7dc9('0x68')];_0x5d211b=_0x4ed60e[_0x19e0b1]['function']?_['replace'](_0x2afefc[_0x4ed60e[_0x19e0b1][_0x7dc9('0x72')]],'%s',_0x5d211b):_0x5d211b;_0x5d211b=_0x4ed60e[_0x19e0b1]['format']?_[_0x7dc9('0x73')](_0x4905f6[_0x4ed60e[_0x19e0b1][_0x7dc9('0x74')]],'%s',_0x5d211b):_0x5d211b;if(_0x4ed60e[_0x19e0b1][_0x7dc9('0x75')]){_0xea1728[_0x7dc9('0x67')](_0x5d211b);}_0x4ed60e[_0x19e0b1][_0x7dc9('0x76')]&&_0xea1728[_0x7dc9('0x35')](_0x5d211b,_0x4ed60e[_0x19e0b1][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0xea1728[_0x7dc9('0x68')](_0x5d211b,_0x4ed60e[_0x19e0b1][_0x7dc9('0x78')]||_0x5d211b);}if(_0x366d4d['joins']){_0x366d4d[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x366d4d[_0x7dc9('0x79')]);for(var _0x499393=0x0;_0x499393<_0x366d4d[_0x7dc9('0x79')]['length'];_0x499393+=0x1){if(_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')]&&_[_0x7dc9('0x5f')](_0x547caa,_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')])&&_0x366d4d['joins'][_0x499393]['parentKey']&&_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7b')]&&_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7c')]){_0xea1728[_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')]](_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7b')],null,util[_0x7dc9('0x74')](_0x7dc9('0x7d'),_0x366d4d[_0x7dc9('0x6f')],_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7e')],_0x366d4d['joins'][_0x499393]['foreignTable'],_0x366d4d[_0x7dc9('0x79')][_0x499393]['foreignKey']));}}}if(_0x366d4d[_0x7dc9('0x7f')]){_0x366d4d[_0x7dc9('0x7f')]=JSON[_0x7dc9('0x7a')](_0x366d4d[_0x7dc9('0x7f')]);_0xea1728['where'](_0x286ac5(_0x366d4d[_0x7dc9('0x7f')][_0x7dc9('0x67')]));}_0x2bbf61=_0xea1728['clone']();_0xea1728[_0x7dc9('0x1d')](_0x495a06);_0xea1728[_0x7dc9('0x1b')](0x0);logger[_0x7dc9('0x80')](_0x7dc9('0x81'),_0xea1728['toString']());return dbH[_0x7dc9('0x82')][_0x7dc9('0x2e')](_0xea1728['toString'](),{'type':dbH['sequelize'][_0x7dc9('0x83')][_0x7dc9('0x84')]});}})['then'](respondWithResult(_0x2f01a0,null))[_0x7dc9('0x42')](handleError(_0x2f01a0,null));};function runReport(_0x5f08f6,_0x2e7296,_0x1d0722){var _0x1acdba=_0x2e7296['name'];var _0x33d68c=0xa;var _0x3c7daf=[_0x7dc9('0x85'),'left_join',_0x7dc9('0x51'),'cross_join'];var _0x5761cb={'SUM':_0x7dc9('0x86'),'COUNT':_0x7dc9('0x87'),'COUNT DISTINCT':_0x7dc9('0x53'),'MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':_0x7dc9('0x59')};var _0x2dc92e={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':'DATE(%s)','HOUR':_0x7dc9('0x5c'),'ROUND':_0x7dc9('0x5d'),'UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x200df7=function(_0x53c992){return!_[_0x7dc9('0x5f')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x7dc9('0x62'),'IS\x20NOT\x20EMPTY'],_0x53c992);};var _0x21da79=function(_0x476a24){if(!_0x476a24||!_0x476a24[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x38dccc='(',_0xc716c3=0x0;_0xc716c3<_0x476a24['rules'][_0x7dc9('0x65')];_0xc716c3+=0x1){_0xc716c3>0x0&&(_0x38dccc+='\x20'+_0x476a24[_0x7dc9('0x66')]+'\x20');_0x38dccc+=_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x67')]?_0x21da79(_0x476a24[_0x7dc9('0x64')][_0xc716c3]['group']):_0x476a24[_0x7dc9('0x64')][_0xc716c3]['field']+'\x20'+_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x69')]+(_0x200df7(_0x476a24[_0x7dc9('0x64')][_0xc716c3]['condition'])?'\x20'+_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x88')]:'');}return _0x38dccc+')';};var _0x5e8806={'where':{'id':_0x5f08f6['id']}},_0x1a9c7e,_0x3f8839,_0xf74b6,_0x2b3d46,_0x5c466d;_0x5e8806=_[_0x7dc9('0x3a')]({},_0x5e8806,_0x1d0722);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x5e8806)[_0x7dc9('0x23')](function(_0x3e06b3){if(_0x3e06b3){_0x1a9c7e=_0x3e06b3;return _0x3e06b3['getFields']();}return null;})[_0x7dc9('0x23')](function(_0x4588a7){if(_0x4588a7){if(!_0x4588a7[_0x7dc9('0x65')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7dc9('0x89'),0x193);}_0x3f8839=_0x4588a7;return db[_0x7dc9('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xb0c228){if(_0xb0c228){_0xf74b6=_[_0x7dc9('0x6c')](_0xb0c228,'id');var _0x5f3487;var _0x29c228=squel['select']();_0x29c228[_0x7dc9('0x6e')](_0x1a9c7e[_0x7dc9('0x6f')]);for(var _0x235473=0x0;_0x235473<_0x3f8839[_0x7dc9('0x65')];_0x235473+=0x1){_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x70')]?_0xf74b6[_0x3f8839[_0x235473][_0x7dc9('0x70')]]['metric']:_0x3f8839[_0x235473][_0x7dc9('0x68')];_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x72')]?_[_0x7dc9('0x73')](_0x5761cb[_0x3f8839[_0x235473][_0x7dc9('0x72')]],'%s',_0x5f3487):_0x5f3487;_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x74')]?_['replace'](_0x2dc92e[_0x3f8839[_0x235473][_0x7dc9('0x74')]],'%s',_0x5f3487):_0x5f3487;if(_0x3f8839[_0x235473][_0x7dc9('0x75')]){_0x29c228[_0x7dc9('0x67')](_0x5f3487);}_0x3f8839[_0x235473][_0x7dc9('0x76')]&&_0x29c228['order'](_0x5f3487,_0x3f8839[_0x235473][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0x29c228['field'](_0x5f3487,_0x3f8839[_0x235473][_0x7dc9('0x78')]||_0x5f3487);}if(_0x1a9c7e['joins']){_0x1a9c7e[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x1a9c7e[_0x7dc9('0x79')]);for(var _0x4173c2=0x0;_0x4173c2<_0x1a9c7e[_0x7dc9('0x79')][_0x7dc9('0x65')];_0x4173c2+=0x1){if(_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')]&&_['includes'](_0x3c7daf,_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')])&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7e')]&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2]['foreignTable']&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7c')]){_0x29c228[_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')]](_0x1a9c7e['joins'][_0x4173c2][_0x7dc9('0x7b')],null,util['format'](_0x7dc9('0x7d'),_0x1a9c7e['table'],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7e')],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7b')],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7c')]));}}}if(_0x1a9c7e[_0x7dc9('0x7f')]){_0x1a9c7e[_0x7dc9('0x7f')]=JSON[_0x7dc9('0x7a')](_0x1a9c7e[_0x7dc9('0x7f')]);_0x29c228[_0x7dc9('0x37')](_0x21da79(_0x1a9c7e[_0x7dc9('0x7f')]['group']));}_0x5c466d=_0x29c228[_0x7dc9('0x8b')]();_0x29c228[_0x7dc9('0x1d')](_0x33d68c);_0x29c228[_0x7dc9('0x1b')](0x0);return;}})[_0x7dc9('0x23')](function(){if(_0x2e7296['output']===_0x7dc9('0x8c')){return null;}var _0x35e061=_[_0x7dc9('0x3a')](_0x2e7296,{'name':_0x2e7296[_0x7dc9('0x8d')]||_0x2e7296['name']||_0x1a9c7e[_0x7dc9('0x29')],'basename':_0x1acdba,'savename':util[_0x7dc9('0x74')](_0x7dc9('0x8e'),_0x2e7296['name']||_0x1a9c7e['name'],require(_0x7dc9('0x8f'))[_0x7dc9('0x90')](0x4),_0x2e7296[_0x7dc9('0x91')]||_0x7dc9('0x92')),'reportId':_0x1a9c7e['id'],'reportType':_0x7dc9('0x93')});return db['AnalyticExtractedReport'][_0x7dc9('0x45')](_0x35e061,{'raw':!![]});})[_0x7dc9('0x23')](function(_0x648bf9){if(_0x1a9c7e[_0x7dc9('0x6f')]==='cdr'){_0x5c466d[_0x7dc9('0x37')](_0x1a9c7e['table']+_0x7dc9('0x94'),_0x2e7296['startDate'],_0x2e7296[_0x7dc9('0x95')]);}else{_0x5c466d[_0x7dc9('0x37')](_0x1a9c7e[_0x7dc9('0x6f')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e7296[_0x7dc9('0x96')],_0x2e7296[_0x7dc9('0x95')]);}if(_0x648bf9){logger['info']('Run\x20Query:',_0x5c466d[_0x7dc9('0x97')]());require('child_process')['fork'](path[_0x7dc9('0x85')](__dirname,_0x7dc9('0x98'),_0x648bf9[_0x7dc9('0x91')]),[_0x648bf9['id'],_0x5c466d['toString'](),path['join'](__dirname,'../../files/reports',_0x648bf9[_0x7dc9('0x99')]),_0x1acdba]);return _0x648bf9;}else{var _0xb825f3=squel[_0x7dc9('0x6d')]();_0xb825f3[_0x7dc9('0x6e')]('('+_0x5c466d['toString']()+')','countTable');_0xb825f3[_0x7dc9('0x68')](_0x7dc9('0x9a'),_0x7dc9('0x1e'));_0x5c466d['limit'](_0x2e7296['limit']||_0x33d68c);_0x5c466d[_0x7dc9('0x1b')](_0x2e7296['offset']||0x0);return dbH[_0x7dc9('0x82')][_0x7dc9('0x2e')](_0xb825f3['toString'](),{'type':dbH[_0x7dc9('0x82')][_0x7dc9('0x83')][_0x7dc9('0x84')]})[_0x7dc9('0x23')](function(_0x14cbd9){if(!_0x14cbd9[_0x7dc9('0x65')]){_0x2b3d46=0x0;}else{_0x2b3d46=_0x14cbd9[0x0][_0x7dc9('0x1e')]||0x0;}return dbH[_0x7dc9('0x82')]['query'](_0x5c466d[_0x7dc9('0x97')](),{'type':dbH['sequelize'][_0x7dc9('0x83')]['SELECT']});})[_0x7dc9('0x23')](function(_0x20f245){return{'rows':_0x20f245||[],'count':_0x2b3d46};});}});}exports['run']=function(_0x67d933,_0x1b2b88){return runReport(_0x67d933[_0x7dc9('0x43')],_0x67d933[_0x7dc9('0x2e')],_0x67d933[_0x7dc9('0x3d')])['then'](respondWithResult(_0x1b2b88,null))[_0x7dc9('0x42')](handleError(_0x1b2b88,null));};exports['runReport']=runReport;exports[_0x7dc9('0x2e')]=function(_0x313b41,_0x275675){var _0x299c23=0xa;var _0x4c1c43=[_0x7dc9('0x85'),_0x7dc9('0x50'),'right_join',_0x7dc9('0x52')];var _0x1fbaea={'SUM':_0x7dc9('0x86'),'COUNT':_0x7dc9('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':_0x7dc9('0x56'),'GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6c7fdc={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':_0x7dc9('0x5b'),'HOUR':_0x7dc9('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x5c9d64=function(_0x59710c){return!_['includes']([_0x7dc9('0x60'),_0x7dc9('0x61'),_0x7dc9('0x62'),_0x7dc9('0x63')],_0x59710c);};var _0x24a1e2=function(_0x45bcf4){if(!_0x45bcf4||!_0x45bcf4[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x4b18e1='(',_0x28e50e=0x0;_0x28e50e<_0x45bcf4[_0x7dc9('0x64')][_0x7dc9('0x65')];_0x28e50e+=0x1){_0x28e50e>0x0&&(_0x4b18e1+='\x20'+_0x45bcf4['operator']+'\x20');_0x4b18e1+=_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x67')]?_0x24a1e2(_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x67')]):_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x68')]+'\x20'+_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x69')]+(_0x5c9d64(_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x69')])?'\x20'+_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x88')]:'');}return _0x4b18e1+')';};var _0x1dc474={'where':{'id':_0x313b41[_0x7dc9('0x43')]['id']}},_0x31121a,_0x454b3a,_0x409a9f,_0x187f17,_0x809ae5;_0x1dc474=_[_0x7dc9('0x3a')]({},_0x1dc474,_0x313b41['options']);return db[_0x7dc9('0x2b')]['find'](_0x1dc474)[_0x7dc9('0x23')](function(_0x56e1ba){if(_0x56e1ba){_0x31121a=_0x56e1ba;return _0x56e1ba['getFields']();}return null;})[_0x7dc9('0x23')](function(_0x342b95){if(_0x342b95){if(!_0x342b95['length']){throw new db[(_0x7dc9('0x6a'))]['ValidationErrorItem'](_0x7dc9('0x89'),0x193);}_0x454b3a=_0x342b95;return db[_0x7dc9('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x338c78){if(_0x338c78){_0x409a9f=_[_0x7dc9('0x6c')](_0x338c78,'id');var _0x8ee4f4;var _0x8f887e=squel['select']();_0x8f887e[_0x7dc9('0x6e')](_0x31121a[_0x7dc9('0x6f')]);for(var _0x4e2edf=0x0;_0x4e2edf<_0x454b3a[_0x7dc9('0x65')];_0x4e2edf+=0x1){_0x8ee4f4=_0x454b3a[_0x4e2edf][_0x7dc9('0x70')]?_0x409a9f[_0x454b3a[_0x4e2edf]['MetricId']]['metric']:_0x454b3a[_0x4e2edf][_0x7dc9('0x68')];_0x8ee4f4=_0x454b3a[_0x4e2edf][_0x7dc9('0x72')]?_[_0x7dc9('0x73')](_0x1fbaea[_0x454b3a[_0x4e2edf][_0x7dc9('0x72')]],'%s',_0x8ee4f4):_0x8ee4f4;_0x8ee4f4=_0x454b3a[_0x4e2edf]['format']?_[_0x7dc9('0x73')](_0x6c7fdc[_0x454b3a[_0x4e2edf]['format']],'%s',_0x8ee4f4):_0x8ee4f4;if(_0x454b3a[_0x4e2edf]['groupBy']){_0x8f887e[_0x7dc9('0x67')](_0x8ee4f4);}_0x454b3a[_0x4e2edf][_0x7dc9('0x76')]&&_0x8f887e[_0x7dc9('0x35')](_0x8ee4f4,_0x454b3a[_0x4e2edf][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0x8f887e[_0x7dc9('0x68')](_0x8ee4f4,_0x454b3a[_0x4e2edf][_0x7dc9('0x78')]||_0x8ee4f4);}if(_0x31121a['joins']){_0x31121a[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x31121a[_0x7dc9('0x79')]);for(var _0x283f96=0x0;_0x283f96<_0x31121a[_0x7dc9('0x79')][_0x7dc9('0x65')];_0x283f96+=0x1){if(_0x31121a[_0x7dc9('0x79')][_0x283f96]['type']&&_[_0x7dc9('0x5f')](_0x4c1c43,_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x3b')])&&_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7e')]&&_0x31121a['joins'][_0x283f96][_0x7dc9('0x7b')]&&_0x31121a['joins'][_0x283f96][_0x7dc9('0x7c')]){_0x8f887e[_0x31121a[_0x7dc9('0x79')][_0x283f96]['type']](_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7b')],null,util[_0x7dc9('0x74')](_0x7dc9('0x7d'),_0x31121a[_0x7dc9('0x6f')],_0x31121a[_0x7dc9('0x79')][_0x283f96]['parentKey'],_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7b')],_0x31121a['joins'][_0x283f96][_0x7dc9('0x7c')]));}}}if(_0x31121a[_0x7dc9('0x7f')]){_0x31121a['conditions']=JSON['parse'](_0x31121a[_0x7dc9('0x7f')]);_0x8f887e[_0x7dc9('0x37')](_0x24a1e2(_0x31121a[_0x7dc9('0x7f')]['group']));}_0x809ae5=_0x8f887e[_0x7dc9('0x8b')]();_0x8f887e['limit'](_0x299c23);_0x8f887e[_0x7dc9('0x1b')](0x0);logger[_0x7dc9('0x80')](_0x7dc9('0x81'),_0x8f887e['toString']());return dbH[_0x7dc9('0x82')]['query'](_0x8f887e['toString'](),{'type':dbH[_0x7dc9('0x82')][_0x7dc9('0x83')][_0x7dc9('0x84')]});}})[_0x7dc9('0x23')](function(){return{'sql':_0x809ae5[_0x7dc9('0x97')]()};})['then'](respondWithResult(_0x275675,null))['catch'](handleError(_0x275675,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index c4f0667..82b8aef 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 _0x0724=['AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0xfef05d,_0x537455){var _0x373df4=function(_0x57d6f4){while(--_0x57d6f4){_0xfef05d['push'](_0xfef05d['shift']());}};_0x373df4(++_0x537455);}(_0x0724,0x162));var _0x4072=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0724[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x4072('0x0'));var util=require(_0x4072('0x1'));var logger=require(_0x4072('0x2'))(_0x4072('0x3'));var moment=require(_0x4072('0x4'));var BPromise=require(_0x4072('0x5'));var rp=require(_0x4072('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4072('0x7'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x4072('0x8')]=function(_0x240687,_0x339a3a){return _0x240687['define'](_0x4072('0x9'),attributes,{'tableName':_0x4072('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4905=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','lodash','util','../../config/logger','api'];(function(_0x4f966a,_0x22d73b){var _0x31993d=function(_0x4d0891){while(--_0x4d0891){_0x4f966a['push'](_0x4f966a['shift']());}};_0x31993d(++_0x22d73b);}(_0x4905,0x80));var _0x5490=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0x4905[_0x1e4f2f];return _0xccea89;};'use strict';var _=require(_0x5490('0x0'));var util=require(_0x5490('0x1'));var logger=require(_0x5490('0x2'))(_0x5490('0x3'));var moment=require(_0x5490('0x4'));var BPromise=require(_0x5490('0x5'));var rp=require(_0x5490('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5490('0x7'));var config=require(_0x5490('0x8'));var attributes=require(_0x5490('0x9'));module[_0x5490('0xa')]=function(_0x3cbc8e,_0x4220c1){return _0x3cbc8e['define'](_0x5490('0xb'),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 a446d29..856cc0d 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 _0x2f11=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x2c03bf,_0x23f4a4){var _0x127cd7=function(_0xe66114){while(--_0xe66114){_0x2c03bf['push'](_0x2c03bf['shift']());}};_0x127cd7(++_0x23f4a4);}(_0x2f11,0x9b));var _0x12f1=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x2f11[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x12f1('0x0'));var util=require(_0x12f1('0x1'));var moment=require('moment');var BPromise=require(_0x12f1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x12f1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x12f1('0x4'))(_0x12f1('0x5'));var config=require(_0x12f1('0x6'));var jayson=require(_0x12f1('0x7'));var client=jayson[_0x12f1('0x8')][_0x12f1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21c99c,_0x4a311c,_0x91cc89){return new BPromise(function(_0x31a22d,_0x43ff29){return client[_0x12f1('0xa')](_0x21c99c,_0x91cc89)['then'](function(_0x2607c9){logger[_0x12f1('0xb')](_0x12f1('0xc'),_0x4a311c,'request\x20sent');logger[_0x12f1('0xd')](_0x12f1('0xe'),_0x4a311c,_0x12f1('0xf'),JSON[_0x12f1('0x10')](_0x2607c9));if(_0x2607c9[_0x12f1('0x11')]){if(_0x2607c9['error'][_0x12f1('0x12')]===0x1f4){logger[_0x12f1('0x11')](_0x12f1('0xc'),_0x4a311c,_0x2607c9['error'][_0x12f1('0x13')]);return _0x43ff29(_0x2607c9[_0x12f1('0x11')][_0x12f1('0x13')]);}logger[_0x12f1('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4a311c,_0x2607c9[_0x12f1('0x11')][_0x12f1('0x13')]);return _0x31a22d(_0x2607c9[_0x12f1('0x11')][_0x12f1('0x13')]);}else{logger[_0x12f1('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4a311c,'request\x20sent');_0x31a22d(_0x2607c9['result'][_0x12f1('0x13')]);}})[_0x12f1('0x14')](function(_0x2d771d){logger[_0x12f1('0x11')](_0x12f1('0xc'),_0x4a311c,_0x2d771d);_0x43ff29(_0x2d771d);});});}
\ No newline at end of file
+var _0xbb8e=['rpc','jayson/promise','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0xbb8e,0x19a));var _0xebb8=function(_0x3af341,_0x56730c){_0x3af341=_0x3af341-0x0;var _0x7de169=_0xbb8e[_0x3af341];return _0x7de169;};'use strict';var _=require(_0xebb8('0x0'));var util=require(_0xebb8('0x1'));var moment=require('moment');var BPromise=require(_0xebb8('0x2'));var rs=require(_0xebb8('0x3'));var fs=require('fs');var Redis=require(_0xebb8('0x4'));var db=require(_0xebb8('0x5'))['db'];var utils=require(_0xebb8('0x6'));var logger=require(_0xebb8('0x7'))(_0xebb8('0x8'));var config=require('../../config/environment');var jayson=require(_0xebb8('0x9'));var client=jayson[_0xebb8('0xa')][_0xebb8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16b6b8,_0x4d0f50,_0x459c86){return new BPromise(function(_0x54f68e,_0x482a5b){return client[_0xebb8('0xc')](_0x16b6b8,_0x459c86)['then'](function(_0x57328c){logger[_0xebb8('0xd')](_0xebb8('0xe'),_0x4d0f50,_0xebb8('0xf'));logger[_0xebb8('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4d0f50,_0xebb8('0xf'),JSON[_0xebb8('0x11')](_0x57328c));if(_0x57328c[_0xebb8('0x12')]){if(_0x57328c[_0xebb8('0x12')][_0xebb8('0x13')]===0x1f4){logger['error'](_0xebb8('0xe'),_0x4d0f50,_0x57328c['error'][_0xebb8('0x14')]);return _0x482a5b(_0x57328c[_0xebb8('0x12')][_0xebb8('0x14')]);}logger[_0xebb8('0x12')](_0xebb8('0xe'),_0x4d0f50,_0x57328c['error'][_0xebb8('0x14')]);return _0x54f68e(_0x57328c[_0xebb8('0x12')][_0xebb8('0x14')]);}else{logger[_0xebb8('0xd')](_0xebb8('0xe'),_0x4d0f50,'request\x20sent');_0x54f68e(_0x57328c[_0xebb8('0x15')][_0xebb8('0x14')]);}})['catch'](function(_0x508472){logger[_0xebb8('0x12')](_0xebb8('0xe'),_0x4d0f50,_0x508472);_0x482a5b(_0x508472);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 83585c4..32f5002 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 _0x2884=['isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','query','create','put','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get'];(function(_0x49e988,_0x1b10bf){var _0x5c07cc=function(_0x42a621){while(--_0x42a621){_0x49e988['push'](_0x49e988['shift']());}};_0x5c07cc(++_0x1b10bf);}(_0x2884,0xea));var _0x4288=function(_0x377fb1,_0x5ee538){_0x377fb1=_0x377fb1-0x0;var _0x3248e9=_0x2884[_0x377fb1];return _0x3248e9;};'use strict';var multer=require(_0x4288('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4288('0x1'));var express=require(_0x4288('0x2'));var router=express['Router']();var fs_extra=require(_0x4288('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4288('0x4'));var config=require(_0x4288('0x5'));var controller=require(_0x4288('0x6'));router[_0x4288('0x7')]('/',auth[_0x4288('0x8')](),controller[_0x4288('0x9')]);router[_0x4288('0x7')](_0x4288('0xa'),auth['isAuthenticated'](),controller[_0x4288('0xb')]);router[_0x4288('0x7')](_0x4288('0xc'),auth[_0x4288('0x8')](),controller[_0x4288('0xd')]);router['get'](_0x4288('0xe'),auth['isAuthenticated'](),controller[_0x4288('0xf')]);router[_0x4288('0x7')]('/:id/query',auth[_0x4288('0x8')](),controller[_0x4288('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4288('0x11')]);router[_0x4288('0x12')](_0x4288('0xa'),auth[_0x4288('0x8')](),controller[_0x4288('0x13')]);router[_0x4288('0x14')](_0x4288('0xa'),auth[_0x4288('0x8')](),controller['destroy']);module[_0x4288('0x15')]=router;
\ No newline at end of file
+var _0x9e07=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','/:id','show','get','/:id/preview','run','query','post','update','delete','destroy'];(function(_0x2d4c3e,_0x158273){var _0x47b398=function(_0x58d29f){while(--_0x58d29f){_0x2d4c3e['push'](_0x2d4c3e['shift']());}};_0x47b398(++_0x158273);}(_0x9e07,0x1cf));var _0x79e0=function(_0x3fb889,_0x365def){_0x3fb889=_0x3fb889-0x0;var _0x5d444f=_0x9e07[_0x3fb889];return _0x5d444f;};'use strict';var multer=require(_0x79e0('0x0'));var util=require(_0x79e0('0x1'));var path=require('path');var timeout=require(_0x79e0('0x2'));var express=require(_0x79e0('0x3'));var router=express[_0x79e0('0x4')]();var fs_extra=require(_0x79e0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x79e0('0x6'));var config=require(_0x79e0('0x7'));var controller=require(_0x79e0('0x8'));router['get']('/',auth[_0x79e0('0x9')](),controller[_0x79e0('0xa')]);router['get'](_0x79e0('0xb'),auth['isAuthenticated'](),controller[_0x79e0('0xc')]);router[_0x79e0('0xd')](_0x79e0('0xe'),auth[_0x79e0('0x9')](),controller['preview']);router[_0x79e0('0xd')]('/:id/run',auth['isAuthenticated'](),controller[_0x79e0('0xf')]);router[_0x79e0('0xd')]('/:id/query',auth[_0x79e0('0x9')](),controller[_0x79e0('0x10')]);router[_0x79e0('0x11')]('/',auth[_0x79e0('0x9')](),controller['create']);router['put'](_0x79e0('0xb'),auth['isAuthenticated'](),controller[_0x79e0('0x12')]);router[_0x79e0('0x13')](_0x79e0('0xb'),auth[_0x79e0('0x9')](),controller[_0x79e0('0x14')]);module[_0x79e0('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 6f104bb..b2872ef 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 _0x1236=['csv','pdf','DATE','Loading','ENUM','manual','scheduled','sequelize','exports','STRING'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x1236,0x9d));var _0x6123=function(_0x1a3e18,_0x40aba2){_0x1a3e18=_0x1a3e18-0x0;var _0xe8c9a4=_0x1236[_0x1a3e18];return _0xe8c9a4;};'use strict';var Sequelize=require(_0x6123('0x0'));var moment=require('moment');module[_0x6123('0x1')]={'name':{'type':Sequelize[_0x6123('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x6123('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x6123('0x3'),_0x6123('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0x6123('0x3')},'savename':{'type':Sequelize[_0x6123('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x6123('0x5')]},'status':{'type':Sequelize[_0x6123('0x2')],'defaultValue':_0x6123('0x6')},'type':{'type':Sequelize[_0x6123('0x7')](_0x6123('0x8'),_0x6123('0x9')),'allowNull':![],'defaultValue':_0x6123('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x6123('0x2')]}};
\ No newline at end of file
+var _0x4b9d=['Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','csv','xlsx','DATE'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4b9d,0x10d));var _0xd4b9=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x4b9d[_0x266618];return _0x54dbf5;};'use strict';var Sequelize=require(_0xd4b9('0x0'));var moment=require(_0xd4b9('0x1'));module['exports']={'name':{'type':Sequelize[_0xd4b9('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xd4b9('0x3')](_0xd4b9('0x4'),'pdf',_0xd4b9('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xd4b9('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd4b9('0x6')]},'endDate':{'type':Sequelize[_0xd4b9('0x6')]},'status':{'type':Sequelize[_0xd4b9('0x2')],'defaultValue':_0xd4b9('0x7')},'type':{'type':Sequelize['ENUM'](_0xd4b9('0x8'),_0xd4b9('0x9')),'allowNull':![],'defaultValue':_0xd4b9('0x8')},'reportId':{'type':Sequelize[_0xd4b9('0xa')](0xb)[_0xd4b9('0xb')]},'reportType':{'type':Sequelize[_0xd4b9('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 9857976..e1354d4 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 _0x19f3=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','findAll','rows','catch','params','attributes','fields','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','join','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x19f3,0x100));var _0x319f=function(_0x4697fa,_0x21c841){_0x4697fa=_0x4697fa-0x0;var _0x390950=_0x19f3[_0x4697fa];return _0x390950;};'use strict';var emlformat=require(_0x319f('0x0'));var rimraf=require(_0x319f('0x1'));var zipdir=require(_0x319f('0x2'));var jsonpatch=require(_0x319f('0x3'));var rp=require(_0x319f('0x4'));var moment=require('moment');var BPromise=require(_0x319f('0x5'));var Mustache=require('mustache');var util=require(_0x319f('0x6'));var path=require(_0x319f('0x7'));var sox=require('sox');var csv=require(_0x319f('0x8'));var ejs=require(_0x319f('0x9'));var fs=require('fs');var fs_extra=require(_0x319f('0xa'));var _=require('lodash');var squel=require(_0x319f('0xb'));var crypto=require(_0x319f('0xc'));var jsforce=require(_0x319f('0xd'));var deskjs=require(_0x319f('0xe'));var toCsv=require(_0x319f('0x8'));var querystring=require(_0x319f('0xf'));var Papa=require(_0x319f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x319f('0x11'));var as=require(_0x319f('0x12'));var hardwareService=require(_0x319f('0x13'));var logger=require(_0x319f('0x14'))('api');var utils=require(_0x319f('0x15'));var config=require(_0x319f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x319f('0x17'))['db'];function respondWithStatusCode(_0x204f4c,_0x4f67d9){_0x4f67d9=_0x4f67d9||0xcc;return function(_0x1ee6ab){if(_0x1ee6ab){return _0x204f4c[_0x319f('0x18')](_0x4f67d9);}return _0x204f4c[_0x319f('0x19')](_0x4f67d9)['end']();};}function respondWithResult(_0x2927e3,_0xb2d331){_0xb2d331=_0xb2d331||0xc8;return function(_0x100102){if(_0x100102){return _0x2927e3[_0x319f('0x19')](_0xb2d331)[_0x319f('0x1a')](_0x100102);}};}function respondWithFilteredResult(_0x3135d3,_0x4a9500){return function(_0x3e3d98){if(_0x3e3d98){var _0x28e8c8=typeof _0x4a9500[_0x319f('0x1b')]===_0x319f('0x1c')&&typeof _0x4a9500[_0x319f('0x1d')]==='undefined';var _0x194adb=_0x3e3d98[_0x319f('0x1e')];var _0x144ba2=_0x28e8c8?0x0:_0x4a9500[_0x319f('0x1b')];var _0x345755=_0x28e8c8?_0x3e3d98[_0x319f('0x1e')]:_0x4a9500[_0x319f('0x1b')]+_0x4a9500[_0x319f('0x1d')];var _0x411f62;if(_0x345755>=_0x194adb){_0x345755=_0x194adb;_0x411f62=0xc8;}else{_0x411f62=0xce;}_0x3135d3[_0x319f('0x19')](_0x411f62);return _0x3135d3[_0x319f('0x1f')](_0x319f('0x20'),_0x144ba2+'-'+_0x345755+'/'+_0x194adb)[_0x319f('0x1a')](_0x3e3d98);}return null;};}function patchUpdates(_0x461a09){return function(_0x40973b){try{jsonpatch[_0x319f('0x21')](_0x40973b,_0x461a09,!![]);}catch(_0x3cb84d){return BPromise[_0x319f('0x22')](_0x3cb84d);}return _0x40973b[_0x319f('0x23')]();};}function saveUpdates(_0x28c273,_0xf1e91e){return function(_0x398535){if(_0x398535){return _0x398535[_0x319f('0x24')](_0x28c273)[_0x319f('0x25')](function(_0x209f0d){return _0x209f0d;});}return null;};}function removeEntity(_0x573848,_0x5988dd){return function(_0x1596bb){if(_0x1596bb){return _0x1596bb[_0x319f('0x26')]()[_0x319f('0x25')](function(){var _0x17d18c=_0x1596bb[_0x319f('0x27')]({'plain':!![]});var _0x205262=_0x319f('0x28');return db[_0x319f('0x29')][_0x319f('0x26')]({'where':{'type':_0x205262,'resourceId':_0x17d18c['id']}})[_0x319f('0x25')](function(){return _0x1596bb;});})[_0x319f('0x25')](function(){_0x573848[_0x319f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x282c1b,_0x573b53){return function(_0x480d78){if(!_0x480d78){_0x282c1b[_0x319f('0x18')](0x194);}return _0x480d78;};}function handleError(_0x3ec476,_0x233739){_0x233739=_0x233739||0x1f4;return function(_0x3ab224){logger[_0x319f('0x2a')](_0x3ab224['stack']);if(_0x3ab224['name']){delete _0x3ab224[_0x319f('0x2b')];}_0x3ec476[_0x319f('0x19')](_0x233739)[_0x319f('0x2c')](_0x3ab224);};}exports[_0x319f('0x2d')]=function(_0x278b5d,_0x26398c){var _0x51b0c1={},_0x35c323={},_0x1721bd={'count':0x0,'rows':[]};var _0x4d4ffb=_[_0x319f('0x2e')](db[_0x319f('0x2f')][_0x319f('0x30')],function(_0x1b50c2){return{'name':_0x1b50c2[_0x319f('0x31')],'type':_0x1b50c2[_0x319f('0x32')][_0x319f('0x33')]};});_0x35c323[_0x319f('0x34')]=_[_0x319f('0x2e')](_0x4d4ffb,_0x319f('0x2b'));_0x35c323['query']=_[_0x319f('0x35')](_0x278b5d[_0x319f('0x36')]);_0x35c323[_0x319f('0x37')]=_[_0x319f('0x38')](_0x35c323['model'],_0x35c323['query']);_0x51b0c1['attributes']=_['intersection'](_0x35c323[_0x319f('0x34')],qs['fields'](_0x278b5d[_0x319f('0x36')]['fields']));_0x51b0c1['attributes']=_0x51b0c1['attributes']['length']?_0x51b0c1['attributes']:_0x35c323['model'];if(!_0x278b5d[_0x319f('0x36')][_0x319f('0x39')]('nolimit')){_0x51b0c1[_0x319f('0x1d')]=qs[_0x319f('0x1d')](_0x278b5d[_0x319f('0x36')][_0x319f('0x1d')]);_0x51b0c1[_0x319f('0x1b')]=qs[_0x319f('0x1b')](_0x278b5d[_0x319f('0x36')][_0x319f('0x1b')]);}_0x51b0c1[_0x319f('0x3a')]=qs[_0x319f('0x3b')](_0x278b5d[_0x319f('0x36')][_0x319f('0x3b')]);_0x51b0c1[_0x319f('0x3c')]=qs['filters'](_[_0x319f('0x3d')](_0x278b5d[_0x319f('0x36')],_0x35c323[_0x319f('0x37')]),_0x4d4ffb);if(_0x278b5d['query']['filter']){_0x51b0c1[_0x319f('0x3c')]=_[_0x319f('0x3e')](_0x51b0c1[_0x319f('0x3c')],{'$or':_[_0x319f('0x2e')](_0x4d4ffb,function(_0x495026){if(_0x495026['type']!==_0x319f('0x3f')){var _0x537aef={};_0x537aef[_0x495026[_0x319f('0x2b')]]={'$like':'%'+_0x278b5d['query']['filter']+'%'};return _0x537aef;}})});}_0x51b0c1=_[_0x319f('0x3e')]({},_0x51b0c1,_0x278b5d[_0x319f('0x40')]);var _0x297dea={'where':_0x51b0c1[_0x319f('0x3c')]};return db['AnalyticExtractedReport']['count'](_0x297dea)['then'](function(_0x4dfc17){_0x1721bd['count']=_0x4dfc17;if(_0x278b5d['query']['includeAll']){_0x51b0c1['include']=[{'all':!![]}];}return db[_0x319f('0x2f')][_0x319f('0x41')](_0x51b0c1);})[_0x319f('0x25')](function(_0x49adce){_0x1721bd[_0x319f('0x42')]=_0x49adce;return _0x1721bd;})[_0x319f('0x25')](respondWithFilteredResult(_0x26398c,_0x51b0c1))[_0x319f('0x43')](handleError(_0x26398c,null));};exports['show']=function(_0x504209,_0x490fcd){var _0x4038fc={'raw':!![],'where':{'id':_0x504209[_0x319f('0x44')]['id']}},_0x588d24={};_0x588d24[_0x319f('0x34')]=_[_0x319f('0x35')](db[_0x319f('0x2f')][_0x319f('0x30')]);_0x588d24[_0x319f('0x36')]=_['keys'](_0x504209[_0x319f('0x36')]);_0x588d24[_0x319f('0x37')]=_[_0x319f('0x38')](_0x588d24[_0x319f('0x34')],_0x588d24[_0x319f('0x36')]);_0x4038fc[_0x319f('0x45')]=_[_0x319f('0x38')](_0x588d24['model'],qs['fields'](_0x504209[_0x319f('0x36')][_0x319f('0x46')]));_0x4038fc['attributes']=_0x4038fc[_0x319f('0x45')][_0x319f('0x47')]?_0x4038fc['attributes']:_0x588d24['model'];if(_0x504209[_0x319f('0x36')][_0x319f('0x48')]){_0x4038fc['include']=[{'all':!![]}];}_0x4038fc=_[_0x319f('0x3e')]({},_0x4038fc,_0x504209[_0x319f('0x40')]);return db[_0x319f('0x2f')][_0x319f('0x49')](_0x4038fc)['then'](handleEntityNotFound(_0x490fcd,null))['then'](respondWithResult(_0x490fcd,null))[_0x319f('0x43')](handleError(_0x490fcd,null));};exports[_0x319f('0x4a')]=function(_0x2b7fa2,_0x530908){return db[_0x319f('0x2f')][_0x319f('0x4a')](_0x2b7fa2['body'],{})['then'](function(_0x29c728){var _0x145373=_0x2b7fa2[_0x319f('0x4b')][_0x319f('0x27')]({'plain':!![]});if(!_0x145373)throw new Error(_0x319f('0x4c'));if(_0x145373[_0x319f('0x4d')]===_0x319f('0x4b')){var _0x1b5da9=_0x29c728[_0x319f('0x27')]({'plain':!![]});var _0x389445=_0x319f('0x28');return db[_0x319f('0x4e')][_0x319f('0x49')]({'where':{'name':_0x389445,'userProfileId':_0x145373['userProfileId']},'raw':!![]})[_0x319f('0x25')](function(_0x2f89df){if(_0x2f89df&&_0x2f89df[_0x319f('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x1b5da9[_0x319f('0x2b')],'resourceId':_0x1b5da9['id'],'type':_0x2f89df[_0x319f('0x2b')],'sectionId':_0x2f89df['id']},{})[_0x319f('0x25')](function(){return _0x29c728;});}else{return _0x29c728;}})[_0x319f('0x43')](function(_0x5108a6){logger[_0x319f('0x2a')](_0x319f('0x50'),_0x5108a6);throw _0x5108a6;});}return _0x29c728;})['then'](respondWithResult(_0x530908,0xc9))['catch'](handleError(_0x530908,null));};exports[_0x319f('0x24')]=function(_0x4cb04d,_0x307b1b){if(_0x4cb04d[_0x319f('0x51')]['id']){delete _0x4cb04d[_0x319f('0x51')]['id'];}return db[_0x319f('0x2f')]['find']({'where':{'id':_0x4cb04d['params']['id']}})[_0x319f('0x25')](handleEntityNotFound(_0x307b1b,null))[_0x319f('0x25')](saveUpdates(_0x4cb04d[_0x319f('0x51')],null))[_0x319f('0x25')](respondWithResult(_0x307b1b,null))[_0x319f('0x43')](handleError(_0x307b1b,null));};exports[_0x319f('0x26')]=function(_0x1f96d6,_0x8c2ed3){return db['AnalyticExtractedReport'][_0x319f('0x49')]({'where':{'id':_0x1f96d6['params']['id']}})['then'](handleEntityNotFound(_0x8c2ed3,null))[_0x319f('0x25')](removeEntity(_0x8c2ed3,null))[_0x319f('0x43')](handleError(_0x8c2ed3,null));};exports['download']=function(_0x3b2c09,_0x42eb42,_0x3c600a){return db['AnalyticExtractedReport'][_0x319f('0x49')]({'where':{'id':_0x3b2c09['params']['id']},'attributes':[_0x319f('0x2b'),'basename','savename','output'],'raw':!![]})['then'](handleEntityNotFound(_0x42eb42,null))[_0x319f('0x25')](function(_0x35bc13){if(_0x35bc13){if(!fs[_0x319f('0x52')](path['join'](config[_0x319f('0x53')],_0x319f('0x54'),_0x35bc13['savename']))){throw new db[(_0x319f('0x55'))][(_0x319f('0x56'))](_0x319f('0x57'));}if(_0x3b2c09['query'][_0x319f('0x58')]){return _0x42eb42['sendStatus'](0xc8);}return _0x42eb42[_0x319f('0x59')](path[_0x319f('0x5a')](config[_0x319f('0x53')],_0x319f('0x54'),_0x35bc13['savename']),util[_0x319f('0x5b')](_0x319f('0x5c'),_0x35bc13[_0x319f('0x5d')]||_0x35bc13[_0x319f('0x2b')],_0x35bc13['output'][_0x319f('0x5e')]()));}})[_0x319f('0x43')](handleError(_0x42eb42,null));};
\ No newline at end of file
+var _0x6e52=['UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','download','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','ExtractedReports','end','error','stack','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','rows','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x176dd3,_0x1f546f){var _0x21bdd6=function(_0x59df8a){while(--_0x59df8a){_0x176dd3['push'](_0x176dd3['shift']());}};_0x21bdd6(++_0x1f546f);}(_0x6e52,0x1ed));var _0x26e5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e52[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x26e5('0x0'));var rimraf=require(_0x26e5('0x1'));var zipdir=require(_0x26e5('0x2'));var jsonpatch=require(_0x26e5('0x3'));var rp=require(_0x26e5('0x4'));var moment=require(_0x26e5('0x5'));var BPromise=require(_0x26e5('0x6'));var Mustache=require(_0x26e5('0x7'));var util=require(_0x26e5('0x8'));var path=require(_0x26e5('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x26e5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x26e5('0xb'));var squel=require(_0x26e5('0xc'));var crypto=require('crypto');var jsforce=require(_0x26e5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x26e5('0xe'));var Papa=require(_0x26e5('0xf'));var Redis=require(_0x26e5('0x10'));var authService=require(_0x26e5('0x11'));var qs=require(_0x26e5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x26e5('0x13'));var config=require(_0x26e5('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x26e5('0x15'))['db'];function respondWithStatusCode(_0x3f95f1,_0x1115e9){_0x1115e9=_0x1115e9||0xcc;return function(_0x34a9ff){if(_0x34a9ff){return _0x3f95f1[_0x26e5('0x16')](_0x1115e9);}return _0x3f95f1[_0x26e5('0x17')](_0x1115e9)['end']();};}function respondWithResult(_0x3aa84d,_0x2e64bd){_0x2e64bd=_0x2e64bd||0xc8;return function(_0x3e497d){if(_0x3e497d){return _0x3aa84d[_0x26e5('0x17')](_0x2e64bd)[_0x26e5('0x18')](_0x3e497d);}};}function respondWithFilteredResult(_0x4140a9,_0x5dc2f7){return function(_0x2428ea){if(_0x2428ea){var _0x61f2f0=typeof _0x5dc2f7[_0x26e5('0x19')]===_0x26e5('0x1a')&&typeof _0x5dc2f7[_0x26e5('0x1b')]===_0x26e5('0x1a');var _0x58efdc=_0x2428ea[_0x26e5('0x1c')];var _0x154f5e=_0x61f2f0?0x0:_0x5dc2f7[_0x26e5('0x19')];var _0x340395=_0x61f2f0?_0x2428ea['count']:_0x5dc2f7[_0x26e5('0x19')]+_0x5dc2f7[_0x26e5('0x1b')];var _0x355b96;if(_0x340395>=_0x58efdc){_0x340395=_0x58efdc;_0x355b96=0xc8;}else{_0x355b96=0xce;}_0x4140a9[_0x26e5('0x17')](_0x355b96);return _0x4140a9[_0x26e5('0x1d')](_0x26e5('0x1e'),_0x154f5e+'-'+_0x340395+'/'+_0x58efdc)[_0x26e5('0x18')](_0x2428ea);}return null;};}function patchUpdates(_0x9dd6a){return function(_0x5703f8){try{jsonpatch[_0x26e5('0x1f')](_0x5703f8,_0x9dd6a,!![]);}catch(_0x3f2acb){return BPromise[_0x26e5('0x20')](_0x3f2acb);}return _0x5703f8['save']();};}function saveUpdates(_0x17f165,_0x25f29d){return function(_0x34ff68){if(_0x34ff68){return _0x34ff68[_0x26e5('0x21')](_0x17f165)['then'](function(_0x52431a){return _0x52431a;});}return null;};}function removeEntity(_0x294c99,_0x4de306){return function(_0x1a7372){if(_0x1a7372){return _0x1a7372[_0x26e5('0x22')]()[_0x26e5('0x23')](function(){var _0x1fda11=_0x1a7372[_0x26e5('0x24')]({'plain':!![]});var _0x3f8500=_0x26e5('0x25');return db['UserProfileResource'][_0x26e5('0x22')]({'where':{'type':_0x3f8500,'resourceId':_0x1fda11['id']}})['then'](function(){return _0x1a7372;});})[_0x26e5('0x23')](function(){_0x294c99[_0x26e5('0x17')](0xcc)[_0x26e5('0x26')]();});}};}function handleEntityNotFound(_0x56969c,_0x30e7a0){return function(_0x4efbf9){if(!_0x4efbf9){_0x56969c[_0x26e5('0x16')](0x194);}return _0x4efbf9;};}function handleError(_0x33b23f,_0x15795b){_0x15795b=_0x15795b||0x1f4;return function(_0x5d3e61){logger[_0x26e5('0x27')](_0x5d3e61[_0x26e5('0x28')]);if(_0x5d3e61[_0x26e5('0x29')]){delete _0x5d3e61[_0x26e5('0x29')];}_0x33b23f[_0x26e5('0x17')](_0x15795b)[_0x26e5('0x2a')](_0x5d3e61);};}exports['index']=function(_0x56a182,_0x1adbc2){var _0x3bc8a2={},_0x2b8b62={},_0x297951={'count':0x0,'rows':[]};var _0x5239e7=_['map'](db[_0x26e5('0x2b')][_0x26e5('0x2c')],function(_0x1b15dc){return{'name':_0x1b15dc[_0x26e5('0x2d')],'type':_0x1b15dc[_0x26e5('0x2e')][_0x26e5('0x2f')]};});_0x2b8b62[_0x26e5('0x30')]=_['map'](_0x5239e7,_0x26e5('0x29'));_0x2b8b62['query']=_['keys'](_0x56a182[_0x26e5('0x31')]);_0x2b8b62[_0x26e5('0x32')]=_['intersection'](_0x2b8b62[_0x26e5('0x30')],_0x2b8b62[_0x26e5('0x31')]);_0x3bc8a2[_0x26e5('0x33')]=_[_0x26e5('0x34')](_0x2b8b62[_0x26e5('0x30')],qs[_0x26e5('0x35')](_0x56a182[_0x26e5('0x31')][_0x26e5('0x35')]));_0x3bc8a2['attributes']=_0x3bc8a2[_0x26e5('0x33')][_0x26e5('0x36')]?_0x3bc8a2['attributes']:_0x2b8b62['model'];if(!_0x56a182[_0x26e5('0x31')][_0x26e5('0x37')](_0x26e5('0x38'))){_0x3bc8a2[_0x26e5('0x1b')]=qs[_0x26e5('0x1b')](_0x56a182[_0x26e5('0x31')]['limit']);_0x3bc8a2[_0x26e5('0x19')]=qs[_0x26e5('0x19')](_0x56a182[_0x26e5('0x31')][_0x26e5('0x19')]);}_0x3bc8a2['order']=qs[_0x26e5('0x39')](_0x56a182[_0x26e5('0x31')][_0x26e5('0x39')]);_0x3bc8a2[_0x26e5('0x3a')]=qs[_0x26e5('0x32')](_[_0x26e5('0x3b')](_0x56a182[_0x26e5('0x31')],_0x2b8b62[_0x26e5('0x32')]),_0x5239e7);if(_0x56a182['query']['filter']){_0x3bc8a2[_0x26e5('0x3a')]=_[_0x26e5('0x3c')](_0x3bc8a2[_0x26e5('0x3a')],{'$or':_[_0x26e5('0x3d')](_0x5239e7,function(_0x24a30f){if(_0x24a30f[_0x26e5('0x2e')]!==_0x26e5('0x3e')){var _0x22f3ee={};_0x22f3ee[_0x24a30f[_0x26e5('0x29')]]={'$like':'%'+_0x56a182[_0x26e5('0x31')][_0x26e5('0x3f')]+'%'};return _0x22f3ee;}})});}_0x3bc8a2=_[_0x26e5('0x3c')]({},_0x3bc8a2,_0x56a182[_0x26e5('0x40')]);var _0xb87bef={'where':_0x3bc8a2[_0x26e5('0x3a')]};return db[_0x26e5('0x2b')][_0x26e5('0x1c')](_0xb87bef)['then'](function(_0x37b316){_0x297951[_0x26e5('0x1c')]=_0x37b316;if(_0x56a182[_0x26e5('0x31')][_0x26e5('0x41')]){_0x3bc8a2[_0x26e5('0x42')]=[{'all':!![]}];}return db[_0x26e5('0x2b')]['findAll'](_0x3bc8a2);})[_0x26e5('0x23')](function(_0x3749c2){_0x297951[_0x26e5('0x43')]=_0x3749c2;return _0x297951;})[_0x26e5('0x23')](respondWithFilteredResult(_0x1adbc2,_0x3bc8a2))['catch'](handleError(_0x1adbc2,null));};exports[_0x26e5('0x44')]=function(_0x2a4a46,_0x1f4538){var _0x467881={'raw':!![],'where':{'id':_0x2a4a46[_0x26e5('0x45')]['id']}},_0x19c7bc={};_0x19c7bc[_0x26e5('0x30')]=_[_0x26e5('0x46')](db[_0x26e5('0x2b')][_0x26e5('0x2c')]);_0x19c7bc[_0x26e5('0x31')]=_[_0x26e5('0x46')](_0x2a4a46[_0x26e5('0x31')]);_0x19c7bc[_0x26e5('0x32')]=_[_0x26e5('0x34')](_0x19c7bc['model'],_0x19c7bc[_0x26e5('0x31')]);_0x467881[_0x26e5('0x33')]=_[_0x26e5('0x34')](_0x19c7bc[_0x26e5('0x30')],qs[_0x26e5('0x35')](_0x2a4a46[_0x26e5('0x31')][_0x26e5('0x35')]));_0x467881[_0x26e5('0x33')]=_0x467881['attributes'][_0x26e5('0x36')]?_0x467881[_0x26e5('0x33')]:_0x19c7bc[_0x26e5('0x30')];if(_0x2a4a46[_0x26e5('0x31')][_0x26e5('0x41')]){_0x467881['include']=[{'all':!![]}];}_0x467881=_['merge']({},_0x467881,_0x2a4a46[_0x26e5('0x40')]);return db[_0x26e5('0x2b')][_0x26e5('0x47')](_0x467881)[_0x26e5('0x23')](handleEntityNotFound(_0x1f4538,null))[_0x26e5('0x23')](respondWithResult(_0x1f4538,null))['catch'](handleError(_0x1f4538,null));};exports[_0x26e5('0x48')]=function(_0x12858f,_0x351485){return db['AnalyticExtractedReport'][_0x26e5('0x48')](_0x12858f[_0x26e5('0x49')],{})['then'](function(_0x165aa3){var _0x321266=_0x12858f[_0x26e5('0x4a')]['get']({'plain':!![]});if(!_0x321266)throw new Error(_0x26e5('0x4b'));if(_0x321266[_0x26e5('0x4c')]===_0x26e5('0x4a')){var _0x475c61=_0x165aa3[_0x26e5('0x24')]({'plain':!![]});var _0x269350='ExtractedReports';return db[_0x26e5('0x4d')][_0x26e5('0x47')]({'where':{'name':_0x269350,'userProfileId':_0x321266['userProfileId']},'raw':!![]})['then'](function(_0x172e14){if(_0x172e14&&_0x172e14[_0x26e5('0x4e')]===0x0){return db[_0x26e5('0x4f')][_0x26e5('0x48')]({'name':_0x475c61['name'],'resourceId':_0x475c61['id'],'type':_0x172e14[_0x26e5('0x29')],'sectionId':_0x172e14['id']},{})[_0x26e5('0x23')](function(){return _0x165aa3;});}else{return _0x165aa3;}})['catch'](function(_0x3bb119){logger[_0x26e5('0x27')](_0x26e5('0x50'),_0x3bb119);throw _0x3bb119;});}return _0x165aa3;})[_0x26e5('0x23')](respondWithResult(_0x351485,0xc9))[_0x26e5('0x51')](handleError(_0x351485,null));};exports['update']=function(_0x5a0017,_0x5802e8){if(_0x5a0017[_0x26e5('0x49')]['id']){delete _0x5a0017[_0x26e5('0x49')]['id'];}return db[_0x26e5('0x2b')][_0x26e5('0x47')]({'where':{'id':_0x5a0017[_0x26e5('0x45')]['id']}})['then'](handleEntityNotFound(_0x5802e8,null))[_0x26e5('0x23')](saveUpdates(_0x5a0017[_0x26e5('0x49')],null))[_0x26e5('0x23')](respondWithResult(_0x5802e8,null))[_0x26e5('0x51')](handleError(_0x5802e8,null));};exports[_0x26e5('0x22')]=function(_0x2d970f,_0x3cac80){return db['AnalyticExtractedReport'][_0x26e5('0x47')]({'where':{'id':_0x2d970f['params']['id']}})[_0x26e5('0x23')](handleEntityNotFound(_0x3cac80,null))[_0x26e5('0x23')](removeEntity(_0x3cac80,null))[_0x26e5('0x51')](handleError(_0x3cac80,null));};exports[_0x26e5('0x52')]=function(_0x509d62,_0x48ea95,_0x4ae22b){return db[_0x26e5('0x2b')]['find']({'where':{'id':_0x509d62[_0x26e5('0x45')]['id']},'attributes':[_0x26e5('0x29'),_0x26e5('0x53'),_0x26e5('0x54'),_0x26e5('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x48ea95,null))[_0x26e5('0x23')](function(_0x51a3f8){if(_0x51a3f8){if(!fs['existsSync'](path[_0x26e5('0x56')](config[_0x26e5('0x57')],_0x26e5('0x58'),_0x51a3f8[_0x26e5('0x54')]))){throw new db[(_0x26e5('0x59'))][(_0x26e5('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x509d62[_0x26e5('0x31')][_0x26e5('0x5b')]){return _0x48ea95['sendStatus'](0xc8);}return _0x48ea95[_0x26e5('0x52')](path[_0x26e5('0x56')](config['root'],_0x26e5('0x58'),_0x51a3f8['savename']),util[_0x26e5('0x5c')](_0x26e5('0x5d'),_0x51a3f8[_0x26e5('0x53')]||_0x51a3f8[_0x26e5('0x29')],_0x51a3f8[_0x26e5('0x55')][_0x26e5('0x5e')]()));}})[_0x26e5('0x51')](handleError(_0x48ea95,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 57fa429..b9b3a2a 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 _0x89a2=['api','moment','bluebird','request-promise','path','rimraf','exports','define','AnalyticExtractedReport','util','../../config/logger'];(function(_0x1767de,_0x1c8994){var _0x2dbae2=function(_0x9b3bb1){while(--_0x9b3bb1){_0x1767de['push'](_0x1767de['shift']());}};_0x2dbae2(++_0x1c8994);}(_0x89a2,0x132));var _0x289a=function(_0x166146,_0x1f34c6){_0x166146=_0x166146-0x0;var _0x9c7390=_0x89a2[_0x166146];return _0x9c7390;};'use strict';var _=require('lodash');var util=require(_0x289a('0x0'));var logger=require(_0x289a('0x1'))(_0x289a('0x2'));var moment=require(_0x289a('0x3'));var BPromise=require(_0x289a('0x4'));var rp=require(_0x289a('0x5'));var fs=require('fs');var path=require(_0x289a('0x6'));var rimraf=require(_0x289a('0x7'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0x289a('0x8')]=function(_0xaa41a0,_0x56c880){return _0xaa41a0[_0x289a('0x9')](_0x289a('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c4a=['analytics_extracted_reports','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0xe1b14b,_0x275799){var _0x21da52=function(_0x5232a7){while(--_0x5232a7){_0xe1b14b['push'](_0xe1b14b['shift']());}};_0x21da52(++_0x275799);}(_0x9c4a,0xe5));var _0xa9c4=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x9c4a[_0x39e283];return _0x7de89f;};'use strict';var _=require(_0xa9c4('0x0'));var util=require('util');var logger=require(_0xa9c4('0x1'))(_0xa9c4('0x2'));var moment=require(_0xa9c4('0x3'));var BPromise=require('bluebird');var rp=require(_0xa9c4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c4('0x5'));var config=require(_0xa9c4('0x6'));var attributes=require(_0xa9c4('0x7'));module[_0xa9c4('0x8')]=function(_0x2ee55e,_0x35ab42){return _0x2ee55e[_0xa9c4('0x9')](_0xa9c4('0xa'),attributes,{'tableName':_0xa9c4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 4e6ea78..23709e5 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 _0x32ad=['request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x3d87ea,_0x21c003){var _0x78e20b=function(_0x34a8d5){while(--_0x34a8d5){_0x3d87ea['push'](_0x3d87ea['shift']());}};_0x78e20b(++_0x21c003);}(_0x32ad,0x18b));var _0xd32a=function(_0x47c520,_0x56b2db){_0x47c520=_0x47c520-0x0;var _0x36704c=_0x32ad[_0x47c520];return _0x36704c;};'use strict';var _=require(_0xd32a('0x0'));var util=require(_0xd32a('0x1'));var moment=require(_0xd32a('0x2'));var BPromise=require(_0xd32a('0x3'));var rs=require(_0xd32a('0x4'));var fs=require('fs');var Redis=require(_0xd32a('0x5'));var db=require(_0xd32a('0x6'))['db'];var utils=require(_0xd32a('0x7'));var logger=require(_0xd32a('0x8'))(_0xd32a('0x9'));var config=require(_0xd32a('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xd32a('0xb')][_0xd32a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf31c33,_0x3c3410,_0x3652b3){return new BPromise(function(_0x10b754,_0x975c68){return client[_0xd32a('0xd')](_0xf31c33,_0x3652b3)[_0xd32a('0xe')](function(_0x410ec8){logger[_0xd32a('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3c3410,_0xd32a('0x10'));logger[_0xd32a('0x11')](_0xd32a('0x12'),_0x3c3410,_0xd32a('0x10'),JSON[_0xd32a('0x13')](_0x410ec8));if(_0x410ec8[_0xd32a('0x14')]){if(_0x410ec8['error']['code']===0x1f4){logger[_0xd32a('0x14')](_0xd32a('0x15'),_0x3c3410,_0x410ec8[_0xd32a('0x14')][_0xd32a('0x16')]);return _0x975c68(_0x410ec8[_0xd32a('0x14')][_0xd32a('0x16')]);}logger[_0xd32a('0x14')](_0xd32a('0x15'),_0x3c3410,_0x410ec8[_0xd32a('0x14')]['message']);return _0x10b754(_0x410ec8[_0xd32a('0x14')]['message']);}else{logger[_0xd32a('0xf')](_0xd32a('0x15'),_0x3c3410,_0xd32a('0x10'));_0x10b754(_0x410ec8[_0xd32a('0x17')][_0xd32a('0x16')]);}})['catch'](function(_0x43daa9){logger['error'](_0xd32a('0x15'),_0x3c3410,_0x43daa9);_0x975c68(_0x43daa9);});});}
\ No newline at end of file
+var _0x8da8=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x5c0687,_0xe75ce2){var _0x581f60=function(_0x374997){while(--_0x374997){_0x5c0687['push'](_0x5c0687['shift']());}};_0x581f60(++_0xe75ce2);}(_0x8da8,0x187));var _0x88da=function(_0x291fc4,_0x39bf93){_0x291fc4=_0x291fc4-0x0;var _0x6f8a72=_0x8da8[_0x291fc4];return _0x6f8a72;};'use strict';var _=require(_0x88da('0x0'));var util=require(_0x88da('0x1'));var moment=require(_0x88da('0x2'));var BPromise=require(_0x88da('0x3'));var rs=require(_0x88da('0x4'));var fs=require('fs');var Redis=require(_0x88da('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x88da('0x6'));var logger=require(_0x88da('0x7'))(_0x88da('0x8'));var config=require(_0x88da('0x9'));var jayson=require(_0x88da('0xa'));var client=jayson[_0x88da('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6baa96,_0x33e3be,_0x3de109){return new BPromise(function(_0x3b2868,_0x58a969){return client['request'](_0x6baa96,_0x3de109)[_0x88da('0xc')](function(_0x10db86){logger[_0x88da('0xd')](_0x88da('0xe'),_0x33e3be,_0x88da('0xf'));logger[_0x88da('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x33e3be,_0x88da('0xf'),JSON[_0x88da('0x11')](_0x10db86));if(_0x10db86['error']){if(_0x10db86[_0x88da('0x12')][_0x88da('0x13')]===0x1f4){logger[_0x88da('0x12')](_0x88da('0xe'),_0x33e3be,_0x10db86['error'][_0x88da('0x14')]);return _0x58a969(_0x10db86['error']['message']);}logger['error'](_0x88da('0xe'),_0x33e3be,_0x10db86[_0x88da('0x12')][_0x88da('0x14')]);return _0x3b2868(_0x10db86[_0x88da('0x12')]['message']);}else{logger[_0x88da('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x33e3be,'request\x20sent');_0x3b2868(_0x10db86[_0x88da('0x15')][_0x88da('0x14')]);}})['catch'](function(_0x4d9ffd){logger[_0x88da('0x12')](_0x88da('0xe'),_0x33e3be,_0x4d9ffd);_0x58a969(_0x4d9ffd);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index e5caa73..c57b2ea 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 _0xea91=['/:id/download','create','put','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xea91,0x1ce));var _0x1ea9=function(_0x214266,_0x1f6f52){_0x214266=_0x214266-0x0;var _0x568f75=_0xea91[_0x214266];return _0x568f75;};'use strict';var multer=require(_0x1ea9('0x0'));var util=require(_0x1ea9('0x1'));var path=require(_0x1ea9('0x2'));var timeout=require('connect-timeout');var express=require(_0x1ea9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1ea9('0x4'));var interaction=require(_0x1ea9('0x5'));var config=require(_0x1ea9('0x6'));var controller=require(_0x1ea9('0x7'));router[_0x1ea9('0x8')]('/',auth[_0x1ea9('0x9')](),controller[_0x1ea9('0xa')]);router[_0x1ea9('0x8')](_0x1ea9('0xb'),auth[_0x1ea9('0x9')](),controller[_0x1ea9('0xc')]);router[_0x1ea9('0x8')](_0x1ea9('0xd'),auth[_0x1ea9('0x9')](),controller['download']);router['post']('/',auth[_0x1ea9('0x9')](),controller[_0x1ea9('0xe')]);router[_0x1ea9('0xf')](_0x1ea9('0xb'),auth[_0x1ea9('0x9')](),controller['update']);router[_0x1ea9('0x10')]('/:id',auth[_0x1ea9('0x9')](),controller[_0x1ea9('0x11')]);module[_0x1ea9('0x12')]=router;
\ No newline at end of file
+var _0x11fb=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','download','create','delete','destroy','exports','util','path'];(function(_0x15acd2,_0x18730e){var _0x3b192d=function(_0x42c28f){while(--_0x42c28f){_0x15acd2['push'](_0x15acd2['shift']());}};_0x3b192d(++_0x18730e);}(_0x11fb,0x1ce));var _0xb11f=function(_0x3eee70,_0x2173d6){_0x3eee70=_0x3eee70-0x0;var _0x14f04a=_0x11fb[_0x3eee70];return _0x14f04a;};'use strict';var multer=require('multer');var util=require(_0xb11f('0x0'));var path=require(_0xb11f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb11f('0x2')]();var fs_extra=require(_0xb11f('0x3'));var auth=require(_0xb11f('0x4'));var interaction=require(_0xb11f('0x5'));var config=require(_0xb11f('0x6'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xb11f('0x7')](),controller[_0xb11f('0x8')]);router[_0xb11f('0x9')](_0xb11f('0xa'),auth[_0xb11f('0x7')](),controller['show']);router[_0xb11f('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0xb11f('0xb')]);router['post']('/',auth[_0xb11f('0x7')](),controller[_0xb11f('0xc')]);router['put'](_0xb11f('0xa'),auth[_0xb11f('0x7')](),controller['update']);router[_0xb11f('0xd')](_0xb11f('0xa'),auth[_0xb11f('0x7')](),controller[_0xb11f('0xe')]);module[_0xb11f('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index ae81b1f..708ecc4 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 _0xd407=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x1220dc,_0x448145){var _0x264ada=function(_0x171972){while(--_0x171972){_0x1220dc['push'](_0x1220dc['shift']());}};_0x264ada(++_0x448145);}(_0xd407,0x6f));var _0x7d40=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd407[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7d40('0x0'));module[_0x7d40('0x1')]={'field':{'type':Sequelize[_0x7d40('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x7d40('0x3')]},'format':{'type':Sequelize[_0x7d40('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7d40('0x3')]},'custom':{'type':Sequelize[_0x7d40('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xea6d=['sequelize','exports','STRING','BOOLEAN'];(function(_0x483985,_0x3e589e){var _0x3a513a=function(_0x9099a9){while(--_0x9099a9){_0x483985['push'](_0x483985['shift']());}};_0x3a513a(++_0x3e589e);}(_0xea6d,0x16c));var _0xdea6=function(_0x1693cf,_0x2ccbcc){_0x1693cf=_0x1693cf-0x0;var _0x56b509=_0xea6d[_0x1693cf];return _0x56b509;};'use strict';var Sequelize=require(_0xdea6('0x0'));module[_0xdea6('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xdea6('0x2')]},'format':{'type':Sequelize[_0xdea6('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xdea6('0x2')]},'custom':{'type':Sequelize[_0xdea6('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 ba1ec52..8842e84 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 _0x225d=['rawAttributes','include','options','create','bulkCreate','body','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','error','stack','index','map','AnalyticFieldReport','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','then','includeAll','findAll','rows','catch','show','params','keys'];(function(_0x271e3f,_0x57e6ed){var _0x2157eb=function(_0x12af10){while(--_0x12af10){_0x271e3f['push'](_0x271e3f['shift']());}};_0x2157eb(++_0x57e6ed);}(_0x225d,0x16f));var _0xd225=function(_0x22a2b3,_0x1b9e8d){_0x22a2b3=_0x22a2b3-0x0;var _0x48d024=_0x225d[_0x22a2b3];return _0x48d024;};'use strict';var emlformat=require(_0xd225('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd225('0x1'));var jsonpatch=require(_0xd225('0x2'));var rp=require(_0xd225('0x3'));var moment=require(_0xd225('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd225('0x5'));var sox=require(_0xd225('0x6'));var csv=require('to-csv');var ejs=require(_0xd225('0x7'));var fs=require('fs');var fs_extra=require(_0xd225('0x8'));var _=require(_0xd225('0x9'));var squel=require(_0xd225('0xa'));var crypto=require(_0xd225('0xb'));var jsforce=require(_0xd225('0xc'));var deskjs=require(_0xd225('0xd'));var toCsv=require(_0xd225('0xe'));var querystring=require(_0xd225('0xf'));var Papa=require(_0xd225('0x10'));var Redis=require(_0xd225('0x11'));var authService=require(_0xd225('0x12'));var qs=require(_0xd225('0x13'));var as=require(_0xd225('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd225('0x15'))(_0xd225('0x16'));var utils=require(_0xd225('0x17'));var config=require(_0xd225('0x18'));var licenseUtil=require(_0xd225('0x19'));var db=require(_0xd225('0x1a'))['db'];function respondWithStatusCode(_0x46702a,_0x28f086){_0x28f086=_0x28f086||0xcc;return function(_0x2c8414){if(_0x2c8414){return _0x46702a[_0xd225('0x1b')](_0x28f086);}return _0x46702a[_0xd225('0x1c')](_0x28f086)[_0xd225('0x1d')]();};}function respondWithResult(_0xfb975d,_0x21b16a){_0x21b16a=_0x21b16a||0xc8;return function(_0x303ab8){if(_0x303ab8){return _0xfb975d[_0xd225('0x1c')](_0x21b16a)[_0xd225('0x1e')](_0x303ab8);}};}function respondWithFilteredResult(_0x534736,_0xdee868){return function(_0x5c117c){if(_0x5c117c){var _0x4f961e=typeof _0xdee868['offset']===_0xd225('0x1f')&&typeof _0xdee868[_0xd225('0x20')]===_0xd225('0x1f');var _0x3ae99b=_0x5c117c[_0xd225('0x21')];var _0x49507c=_0x4f961e?0x0:_0xdee868[_0xd225('0x22')];var _0x360df2=_0x4f961e?_0x5c117c[_0xd225('0x21')]:_0xdee868[_0xd225('0x22')]+_0xdee868[_0xd225('0x20')];var _0x531874;if(_0x360df2>=_0x3ae99b){_0x360df2=_0x3ae99b;_0x531874=0xc8;}else{_0x531874=0xce;}_0x534736[_0xd225('0x1c')](_0x531874);return _0x534736[_0xd225('0x23')]('Content-Range',_0x49507c+'-'+_0x360df2+'/'+_0x3ae99b)[_0xd225('0x1e')](_0x5c117c);}return null;};}function patchUpdates(_0x3bf02a){return function(_0x56c92b){try{jsonpatch[_0xd225('0x24')](_0x56c92b,_0x3bf02a,!![]);}catch(_0x38b457){return BPromise[_0xd225('0x25')](_0x38b457);}return _0x56c92b[_0xd225('0x26')]();};}function saveUpdates(_0x3cc26a,_0x390243){return function(_0x2a1062){if(_0x2a1062){return _0x2a1062[_0xd225('0x27')](_0x3cc26a)['then'](function(_0x2c04e2){return _0x2c04e2;});}return null;};}function removeEntity(_0x65e9de,_0xd6d126){return function(_0x2a22b8){if(_0x2a22b8){return _0x2a22b8[_0xd225('0x28')]()['then'](function(){_0x65e9de[_0xd225('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bf473,_0x54c574){return function(_0xd02c37){if(!_0xd02c37){_0x2bf473[_0xd225('0x1b')](0x194);}return _0xd02c37;};}function handleError(_0x468fb8,_0x3dd2aa){_0x3dd2aa=_0x3dd2aa||0x1f4;return function(_0x5a8f9d){logger[_0xd225('0x29')](_0x5a8f9d[_0xd225('0x2a')]);if(_0x5a8f9d['name']){delete _0x5a8f9d['name'];}_0x468fb8[_0xd225('0x1c')](_0x3dd2aa)['send'](_0x5a8f9d);};}exports[_0xd225('0x2b')]=function(_0x96e1aa,_0x3eae5a){var _0x40c27e={},_0x147313={},_0x2c0d49={'count':0x0,'rows':[]};var _0x133c74=_[_0xd225('0x2c')](db[_0xd225('0x2d')]['rawAttributes'],function(_0x23b41d){return{'name':_0x23b41d['fieldName'],'type':_0x23b41d[_0xd225('0x2e')][_0xd225('0x2f')]};});_0x147313[_0xd225('0x30')]=_[_0xd225('0x2c')](_0x133c74,_0xd225('0x31'));_0x147313['query']=_['keys'](_0x96e1aa[_0xd225('0x32')]);_0x147313[_0xd225('0x33')]=_[_0xd225('0x34')](_0x147313[_0xd225('0x30')],_0x147313[_0xd225('0x32')]);_0x40c27e[_0xd225('0x35')]=_[_0xd225('0x34')](_0x147313[_0xd225('0x30')],qs[_0xd225('0x36')](_0x96e1aa['query'][_0xd225('0x36')]));_0x40c27e[_0xd225('0x35')]=_0x40c27e['attributes'][_0xd225('0x37')]?_0x40c27e[_0xd225('0x35')]:_0x147313['model'];if(!_0x96e1aa[_0xd225('0x32')][_0xd225('0x38')](_0xd225('0x39'))){_0x40c27e[_0xd225('0x20')]=qs['limit'](_0x96e1aa['query']['limit']);_0x40c27e[_0xd225('0x22')]=qs[_0xd225('0x22')](_0x96e1aa[_0xd225('0x32')]['offset']);}_0x40c27e[_0xd225('0x3a')]=qs[_0xd225('0x3b')](_0x96e1aa[_0xd225('0x32')]['sort']);_0x40c27e[_0xd225('0x3c')]=qs[_0xd225('0x33')](_[_0xd225('0x3d')](_0x96e1aa['query'],_0x147313[_0xd225('0x33')]),_0x133c74);if(_0x96e1aa[_0xd225('0x32')]['filter']){_0x40c27e[_0xd225('0x3c')]=_[_0xd225('0x3e')](_0x40c27e[_0xd225('0x3c')],{'$or':_[_0xd225('0x2c')](_0x133c74,function(_0x131a17){if(_0x131a17[_0xd225('0x2e')]!==_0xd225('0x3f')){var _0x5e7c75={};_0x5e7c75[_0x131a17['name']]={'$like':'%'+_0x96e1aa[_0xd225('0x32')][_0xd225('0x40')]+'%'};return _0x5e7c75;}})});}_0x40c27e=_[_0xd225('0x3e')]({},_0x40c27e,_0x96e1aa['options']);var _0x4e0453={'where':_0x40c27e['where']};return db[_0xd225('0x2d')][_0xd225('0x21')](_0x4e0453)[_0xd225('0x41')](function(_0x5cb6a8){_0x2c0d49[_0xd225('0x21')]=_0x5cb6a8;if(_0x96e1aa[_0xd225('0x32')][_0xd225('0x42')]){_0x40c27e['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xd225('0x43')](_0x40c27e);})[_0xd225('0x41')](function(_0x10a475){_0x2c0d49[_0xd225('0x44')]=_0x10a475;return _0x2c0d49;})[_0xd225('0x41')](respondWithFilteredResult(_0x3eae5a,_0x40c27e))[_0xd225('0x45')](handleError(_0x3eae5a,null));};exports[_0xd225('0x46')]=function(_0x11b919,_0x59502a){var _0x13e67c={'raw':![],'where':{'id':_0x11b919[_0xd225('0x47')]['id']}},_0x4de696={};_0x4de696[_0xd225('0x30')]=_[_0xd225('0x48')](db[_0xd225('0x2d')][_0xd225('0x49')]);_0x4de696[_0xd225('0x32')]=_[_0xd225('0x48')](_0x11b919['query']);_0x4de696[_0xd225('0x33')]=_['intersection'](_0x4de696[_0xd225('0x30')],_0x4de696[_0xd225('0x32')]);_0x13e67c[_0xd225('0x35')]=_[_0xd225('0x34')](_0x4de696[_0xd225('0x30')],qs[_0xd225('0x36')](_0x11b919['query'][_0xd225('0x36')]));_0x13e67c[_0xd225('0x35')]=_0x13e67c[_0xd225('0x35')][_0xd225('0x37')]?_0x13e67c[_0xd225('0x35')]:_0x4de696[_0xd225('0x30')];if(_0x11b919['query'][_0xd225('0x42')]){_0x13e67c[_0xd225('0x4a')]=[{'all':!![]}];}_0x13e67c=_[_0xd225('0x3e')]({},_0x13e67c,_0x11b919[_0xd225('0x4b')]);return db[_0xd225('0x2d')]['find'](_0x13e67c)[_0xd225('0x41')](handleEntityNotFound(_0x59502a,null))[_0xd225('0x41')](respondWithResult(_0x59502a,null))[_0xd225('0x45')](handleError(_0x59502a,null));};exports[_0xd225('0x4c')]=function(_0x290513,_0x5a4353){return db[_0xd225('0x2d')]['create'](_0x290513['body'],{})[_0xd225('0x41')](respondWithResult(_0x5a4353,0xc9))['catch'](handleError(_0x5a4353,null));};exports['bulkCreate']=function(_0xadf363,_0x362029){return db[_0xd225('0x2d')][_0xd225('0x4d')](_0xadf363['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x362029,0xc9))[_0xd225('0x45')](handleError(_0x362029,null));};exports['update']=function(_0x2471f1,_0x410a35){if(_0x2471f1[_0xd225('0x4e')]['id']){delete _0x2471f1['body']['id'];}return db[_0xd225('0x2d')][_0xd225('0x4f')]({'where':{'id':_0x2471f1[_0xd225('0x47')]['id']}})[_0xd225('0x41')](handleEntityNotFound(_0x410a35,null))[_0xd225('0x41')](saveUpdates(_0x2471f1[_0xd225('0x4e')],null))['then'](respondWithResult(_0x410a35,null))[_0xd225('0x45')](handleError(_0x410a35,null));};exports['destroy']=function(_0x286f9a,_0x405072){return db[_0xd225('0x2d')]['find']({'where':{'id':_0x286f9a[_0xd225('0x47')]['id']}})['then'](handleEntityNotFound(_0x405072,null))[_0xd225('0x41')](removeEntity(_0x405072,null))[_0xd225('0x45')](handleError(_0x405072,null));};exports[_0xd225('0x50')]=function(_0x52ea79,_0x335ac6){return db['AnalyticFieldReport'][_0xd225('0x28')]({'where':{'id':_0x52ea79[_0xd225('0x32')][_0xd225('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0xd225('0x41')](respondWithResult(_0x335ac6,0xcc))[_0xd225('0x45')](handleError(_0x335ac6,null));};exports[_0xd225('0x52')]=function(_0x2b6fe1,_0x39fa94,_0x5a1925){return db[_0xd225('0x53')][_0xd225('0x54')]({'where':{'id':_0x2b6fe1[_0xd225('0x47')]['id']}})[_0xd225('0x41')](handleEntityNotFound(_0x39fa94,null))['then'](function(_0x18bee9){if(_0x18bee9){return db[_0xd225('0x55')][_0xd225('0x56')](function(_0x3d08fa){return db[_0xd225('0x2d')][_0xd225('0x28')]({'where':{'CustomReportId':_0x2b6fe1[_0xd225('0x47')]['id']},'transaction':_0x3d08fa})[_0xd225('0x41')](function(_0x469ff6){var _0x41aece=_[_0xd225('0x2c')](_0x2b6fe1[_0xd225('0x4e')],function(_0x3d7ab8){delete _0x3d7ab8['id'];_0x3d7ab8[_0xd225('0x57')]=_0x2b6fe1[_0xd225('0x47')]['id'];return _0x3d7ab8;});return db[_0xd225('0x2d')]['bulkCreate'](_0x41aece,{'transaction':_0x3d08fa});});})[_0xd225('0x41')](function(){return db['AnalyticFieldReport'][_0xd225('0x43')]({'where':{'CustomReportId':_0x2b6fe1[_0xd225('0x47')]['id']}});});}})[_0xd225('0x41')](respondWithResult(_0x39fa94,null))['catch'](handleError(_0x39fa94,null));};
\ No newline at end of file
+var _0x5a52=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','options','includeAll','rows','params','include','find','create','catch','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','CustomReportId','findAll','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','ioredis','../../components/parsers/qs'];(function(_0x135b81,_0x39db4b){var _0x5d8a8e=function(_0x3a7614){while(--_0x3a7614){_0x135b81['push'](_0x135b81['shift']());}};_0x5d8a8e(++_0x39db4b);}(_0x5a52,0x178));var _0x25a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a52[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x25a5('0x0'));var rimraf=require(_0x25a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x25a5('0x2'));var moment=require(_0x25a5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x25a5('0x4'));var path=require(_0x25a5('0x5'));var sox=require(_0x25a5('0x6'));var csv=require(_0x25a5('0x7'));var ejs=require(_0x25a5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25a5('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x25a5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x25a5('0x7'));var querystring=require(_0x25a5('0xb'));var Papa=require('papaparse');var Redis=require(_0x25a5('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x25a5('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x25a5('0xe'))(_0x25a5('0xf'));var utils=require(_0x25a5('0x10'));var config=require(_0x25a5('0x11'));var licenseUtil=require(_0x25a5('0x12'));var db=require(_0x25a5('0x13'))['db'];function respondWithStatusCode(_0x1e052b,_0x5c92f3){_0x5c92f3=_0x5c92f3||0xcc;return function(_0x322eb0){if(_0x322eb0){return _0x1e052b['sendStatus'](_0x5c92f3);}return _0x1e052b['status'](_0x5c92f3)[_0x25a5('0x14')]();};}function respondWithResult(_0x1ba7a0,_0x301cfd){_0x301cfd=_0x301cfd||0xc8;return function(_0x2c2f0f){if(_0x2c2f0f){return _0x1ba7a0[_0x25a5('0x15')](_0x301cfd)[_0x25a5('0x16')](_0x2c2f0f);}};}function respondWithFilteredResult(_0x1b2899,_0x5ac1b5){return function(_0x104bf2){if(_0x104bf2){var _0x325d5e=typeof _0x5ac1b5['offset']==='undefined'&&typeof _0x5ac1b5[_0x25a5('0x17')]===_0x25a5('0x18');var _0x465b60=_0x104bf2[_0x25a5('0x19')];var _0x7570e3=_0x325d5e?0x0:_0x5ac1b5['offset'];var _0x28d24e=_0x325d5e?_0x104bf2[_0x25a5('0x19')]:_0x5ac1b5[_0x25a5('0x1a')]+_0x5ac1b5[_0x25a5('0x17')];var _0x1e69d1;if(_0x28d24e>=_0x465b60){_0x28d24e=_0x465b60;_0x1e69d1=0xc8;}else{_0x1e69d1=0xce;}_0x1b2899[_0x25a5('0x15')](_0x1e69d1);return _0x1b2899[_0x25a5('0x1b')](_0x25a5('0x1c'),_0x7570e3+'-'+_0x28d24e+'/'+_0x465b60)[_0x25a5('0x16')](_0x104bf2);}return null;};}function patchUpdates(_0x321f5a){return function(_0x523964){try{jsonpatch[_0x25a5('0x1d')](_0x523964,_0x321f5a,!![]);}catch(_0x211950){return BPromise['reject'](_0x211950);}return _0x523964[_0x25a5('0x1e')]();};}function saveUpdates(_0x2d62bf,_0x49639f){return function(_0x44a6f3){if(_0x44a6f3){return _0x44a6f3[_0x25a5('0x1f')](_0x2d62bf)[_0x25a5('0x20')](function(_0x36ca77){return _0x36ca77;});}return null;};}function removeEntity(_0x1db32c,_0x21dce7){return function(_0x1ed064){if(_0x1ed064){return _0x1ed064[_0x25a5('0x21')]()['then'](function(){_0x1db32c[_0x25a5('0x15')](0xcc)[_0x25a5('0x14')]();});}};}function handleEntityNotFound(_0x50016d,_0x104dc0){return function(_0x2ad39a){if(!_0x2ad39a){_0x50016d[_0x25a5('0x22')](0x194);}return _0x2ad39a;};}function handleError(_0x301f68,_0x2f11cf){_0x2f11cf=_0x2f11cf||0x1f4;return function(_0xd343e){logger[_0x25a5('0x23')](_0xd343e['stack']);if(_0xd343e['name']){delete _0xd343e[_0x25a5('0x24')];}_0x301f68[_0x25a5('0x15')](_0x2f11cf)[_0x25a5('0x25')](_0xd343e);};}exports[_0x25a5('0x26')]=function(_0x34f168,_0x4c6b32){var _0x536363={},_0x4b56bc={},_0x59afd4={'count':0x0,'rows':[]};var _0x43764a=_[_0x25a5('0x27')](db[_0x25a5('0x28')][_0x25a5('0x29')],function(_0x2511f6){return{'name':_0x2511f6[_0x25a5('0x2a')],'type':_0x2511f6['type'][_0x25a5('0x2b')]};});_0x4b56bc[_0x25a5('0x2c')]=_[_0x25a5('0x27')](_0x43764a,_0x25a5('0x24'));_0x4b56bc[_0x25a5('0x2d')]=_[_0x25a5('0x2e')](_0x34f168['query']);_0x4b56bc[_0x25a5('0x2f')]=_[_0x25a5('0x30')](_0x4b56bc['model'],_0x4b56bc['query']);_0x536363[_0x25a5('0x31')]=_['intersection'](_0x4b56bc[_0x25a5('0x2c')],qs['fields'](_0x34f168['query'][_0x25a5('0x32')]));_0x536363[_0x25a5('0x31')]=_0x536363[_0x25a5('0x31')][_0x25a5('0x33')]?_0x536363[_0x25a5('0x31')]:_0x4b56bc[_0x25a5('0x2c')];if(!_0x34f168[_0x25a5('0x2d')][_0x25a5('0x34')](_0x25a5('0x35'))){_0x536363['limit']=qs['limit'](_0x34f168['query'][_0x25a5('0x17')]);_0x536363['offset']=qs['offset'](_0x34f168[_0x25a5('0x2d')][_0x25a5('0x1a')]);}_0x536363[_0x25a5('0x36')]=qs[_0x25a5('0x37')](_0x34f168[_0x25a5('0x2d')]['sort']);_0x536363['where']=qs[_0x25a5('0x2f')](_[_0x25a5('0x38')](_0x34f168[_0x25a5('0x2d')],_0x4b56bc[_0x25a5('0x2f')]),_0x43764a);if(_0x34f168[_0x25a5('0x2d')][_0x25a5('0x39')]){_0x536363['where']=_[_0x25a5('0x3a')](_0x536363[_0x25a5('0x3b')],{'$or':_[_0x25a5('0x27')](_0x43764a,function(_0x1b368f){if(_0x1b368f[_0x25a5('0x3c')]!=='VIRTUAL'){var _0x29f5ab={};_0x29f5ab[_0x1b368f['name']]={'$like':'%'+_0x34f168[_0x25a5('0x2d')][_0x25a5('0x39')]+'%'};return _0x29f5ab;}})});}_0x536363=_[_0x25a5('0x3a')]({},_0x536363,_0x34f168[_0x25a5('0x3d')]);var _0x37874b={'where':_0x536363[_0x25a5('0x3b')]};return db[_0x25a5('0x28')][_0x25a5('0x19')](_0x37874b)[_0x25a5('0x20')](function(_0x47ad3e){_0x59afd4[_0x25a5('0x19')]=_0x47ad3e;if(_0x34f168[_0x25a5('0x2d')][_0x25a5('0x3e')]){_0x536363['include']=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x536363);})[_0x25a5('0x20')](function(_0x548da3){_0x59afd4[_0x25a5('0x3f')]=_0x548da3;return _0x59afd4;})[_0x25a5('0x20')](respondWithFilteredResult(_0x4c6b32,_0x536363))['catch'](handleError(_0x4c6b32,null));};exports['show']=function(_0x4fcff6,_0x68125e){var _0x46bbcf={'raw':![],'where':{'id':_0x4fcff6[_0x25a5('0x40')]['id']}},_0xc32aaf={};_0xc32aaf[_0x25a5('0x2c')]=_[_0x25a5('0x2e')](db[_0x25a5('0x28')][_0x25a5('0x29')]);_0xc32aaf['query']=_[_0x25a5('0x2e')](_0x4fcff6['query']);_0xc32aaf['filters']=_[_0x25a5('0x30')](_0xc32aaf['model'],_0xc32aaf[_0x25a5('0x2d')]);_0x46bbcf['attributes']=_[_0x25a5('0x30')](_0xc32aaf[_0x25a5('0x2c')],qs['fields'](_0x4fcff6['query'][_0x25a5('0x32')]));_0x46bbcf[_0x25a5('0x31')]=_0x46bbcf['attributes'][_0x25a5('0x33')]?_0x46bbcf['attributes']:_0xc32aaf[_0x25a5('0x2c')];if(_0x4fcff6[_0x25a5('0x2d')][_0x25a5('0x3e')]){_0x46bbcf[_0x25a5('0x41')]=[{'all':!![]}];}_0x46bbcf=_[_0x25a5('0x3a')]({},_0x46bbcf,_0x4fcff6[_0x25a5('0x3d')]);return db[_0x25a5('0x28')][_0x25a5('0x42')](_0x46bbcf)[_0x25a5('0x20')](handleEntityNotFound(_0x68125e,null))['then'](respondWithResult(_0x68125e,null))['catch'](handleError(_0x68125e,null));};exports['create']=function(_0xe6d3e6,_0x54dd9b){return db['AnalyticFieldReport'][_0x25a5('0x43')](_0xe6d3e6['body'],{})['then'](respondWithResult(_0x54dd9b,0xc9))[_0x25a5('0x44')](handleError(_0x54dd9b,null));};exports[_0x25a5('0x45')]=function(_0x10e3b0,_0x17d5fa){return db['AnalyticFieldReport'][_0x25a5('0x45')](_0x10e3b0[_0x25a5('0x46')],{'raw':![],'individualHooks':!![]})[_0x25a5('0x20')](respondWithResult(_0x17d5fa,0xc9))['catch'](handleError(_0x17d5fa,null));};exports[_0x25a5('0x1f')]=function(_0x57d518,_0x330cc4){if(_0x57d518[_0x25a5('0x46')]['id']){delete _0x57d518[_0x25a5('0x46')]['id'];}return db['AnalyticFieldReport'][_0x25a5('0x42')]({'where':{'id':_0x57d518['params']['id']}})[_0x25a5('0x20')](handleEntityNotFound(_0x330cc4,null))[_0x25a5('0x20')](saveUpdates(_0x57d518['body'],null))[_0x25a5('0x20')](respondWithResult(_0x330cc4,null))[_0x25a5('0x44')](handleError(_0x330cc4,null));};exports['destroy']=function(_0x33ca67,_0xeec670){return db['AnalyticFieldReport']['find']({'where':{'id':_0x33ca67[_0x25a5('0x40')]['id']}})[_0x25a5('0x20')](handleEntityNotFound(_0xeec670,null))[_0x25a5('0x20')](removeEntity(_0xeec670,null))['catch'](handleError(_0xeec670,null));};exports[_0x25a5('0x47')]=function(_0x2eb04a,_0x3a5457){return db[_0x25a5('0x28')][_0x25a5('0x21')]({'where':{'id':_0x2eb04a[_0x25a5('0x2d')][_0x25a5('0x48')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3a5457,0xcc))[_0x25a5('0x44')](handleError(_0x3a5457,null));};exports[_0x25a5('0x49')]=function(_0x45a49f,_0x463376,_0x2f5ef4){return db[_0x25a5('0x4a')][_0x25a5('0x4b')]({'where':{'id':_0x45a49f[_0x25a5('0x40')]['id']}})[_0x25a5('0x20')](handleEntityNotFound(_0x463376,null))[_0x25a5('0x20')](function(_0xadcf0c){if(_0xadcf0c){return db['sequelize']['transaction'](function(_0x3afee){return db[_0x25a5('0x28')][_0x25a5('0x21')]({'where':{'CustomReportId':_0x45a49f[_0x25a5('0x40')]['id']},'transaction':_0x3afee})[_0x25a5('0x20')](function(_0x228608){var _0x4efb01=_[_0x25a5('0x27')](_0x45a49f[_0x25a5('0x46')],function(_0x165a7f){delete _0x165a7f['id'];_0x165a7f[_0x25a5('0x4c')]=_0x45a49f['params']['id'];return _0x165a7f;});return db[_0x25a5('0x28')][_0x25a5('0x45')](_0x4efb01,{'transaction':_0x3afee});});})['then'](function(){return db[_0x25a5('0x28')][_0x25a5('0x4d')]({'where':{'CustomReportId':_0x45a49f[_0x25a5('0x40')]['id']}});});}})['then'](respondWithResult(_0x463376,null))[_0x25a5('0x44')](handleError(_0x463376,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index d47e6f9..9d7c106 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 _0xceb9=['request-promise','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','moment','bluebird'];(function(_0x2cbf0c,_0x372a64){var _0x3a3f47=function(_0x571cc0){while(--_0x571cc0){_0x2cbf0c['push'](_0x2cbf0c['shift']());}};_0x3a3f47(++_0x372a64);}(_0xceb9,0xb0));var _0x9ceb=function(_0xc10d36,_0x2e3e63){_0xc10d36=_0xc10d36-0x0;var _0x274999=_0xceb9[_0xc10d36];return _0x274999;};'use strict';var _=require(_0x9ceb('0x0'));var util=require('util');var logger=require(_0x9ceb('0x1'))('api');var moment=require(_0x9ceb('0x2'));var BPromise=require(_0x9ceb('0x3'));var rp=require(_0x9ceb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9ceb('0x5'));module[_0x9ceb('0x6')]=function(_0x340d09,_0x4c7647){return _0x340d09[_0x9ceb('0x7')](_0x9ceb('0x8'),attributes,{'tableName':_0x9ceb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a14=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x4a14,0x11e));var _0x44a1=function(_0xb06ca0,_0x1afdfd){_0xb06ca0=_0xb06ca0-0x0;var _0x2dfd9b=_0x4a14[_0xb06ca0];return _0x2dfd9b;};'use strict';var _=require(_0x44a1('0x0'));var util=require(_0x44a1('0x1'));var logger=require(_0x44a1('0x2'))(_0x44a1('0x3'));var moment=require('moment');var BPromise=require(_0x44a1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x44a1('0x5'));var rimraf=require(_0x44a1('0x6'));var config=require(_0x44a1('0x7'));var attributes=require(_0x44a1('0x8'));module[_0x44a1('0x9')]=function(_0x3512c7,_0x5e5b0b){return _0x3512c7['define'](_0x44a1('0xa'),attributes,{'tableName':_0x44a1('0xb'),'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 2f99354..42a9a77 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 _0x6293=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug'];(function(_0x498874,_0x34a63d){var _0x21f0fe=function(_0xf0eff5){while(--_0xf0eff5){_0x498874['push'](_0x498874['shift']());}};_0x21f0fe(++_0x34a63d);}(_0x6293,0x133));var _0x3629=function(_0x377199,_0x1439fa){_0x377199=_0x377199-0x0;var _0x501155=_0x6293[_0x377199];return _0x501155;};'use strict';var _=require(_0x3629('0x0'));var util=require(_0x3629('0x1'));var moment=require(_0x3629('0x2'));var BPromise=require(_0x3629('0x3'));var rs=require(_0x3629('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3629('0x5'));var logger=require('../../config/logger')(_0x3629('0x6'));var config=require(_0x3629('0x7'));var jayson=require(_0x3629('0x8'));var client=jayson[_0x3629('0x9')][_0x3629('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19b9d1,_0x1f0674,_0x37ab80){return new BPromise(function(_0x1d1361,_0x13a07b){return client['request'](_0x19b9d1,_0x37ab80)[_0x3629('0xb')](function(_0x488b43){logger[_0x3629('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1f0674,_0x3629('0xd'));logger[_0x3629('0xe')](_0x3629('0xf'),_0x1f0674,'request\x20sent',JSON[_0x3629('0x10')](_0x488b43));if(_0x488b43[_0x3629('0x11')]){if(_0x488b43[_0x3629('0x11')][_0x3629('0x12')]===0x1f4){logger[_0x3629('0x11')](_0x3629('0x13'),_0x1f0674,_0x488b43[_0x3629('0x11')][_0x3629('0x14')]);return _0x13a07b(_0x488b43[_0x3629('0x11')]['message']);}logger[_0x3629('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1f0674,_0x488b43[_0x3629('0x11')][_0x3629('0x14')]);return _0x1d1361(_0x488b43[_0x3629('0x11')][_0x3629('0x14')]);}else{logger[_0x3629('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1f0674,_0x3629('0xd'));_0x1d1361(_0x488b43[_0x3629('0x15')][_0x3629('0x14')]);}})[_0x3629('0x16')](function(_0x55dbde){logger[_0x3629('0x11')](_0x3629('0x13'),_0x1f0674,_0x55dbde);_0x13a07b(_0x55dbde);});});}
\ No newline at end of file
+var _0x6978=['request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x1eccf0,_0x4a4efe){var _0x582f43=function(_0x27ad67){while(--_0x27ad67){_0x1eccf0['push'](_0x1eccf0['shift']());}};_0x582f43(++_0x4a4efe);}(_0x6978,0x16f));var _0x8697=function(_0x108d5f,_0x33f82d){_0x108d5f=_0x108d5f-0x0;var _0x456ea3=_0x6978[_0x108d5f];return _0x456ea3;};'use strict';var _=require(_0x8697('0x0'));var util=require(_0x8697('0x1'));var moment=require(_0x8697('0x2'));var BPromise=require(_0x8697('0x3'));var rs=require(_0x8697('0x4'));var fs=require('fs');var Redis=require(_0x8697('0x5'));var db=require(_0x8697('0x6'))['db'];var utils=require(_0x8697('0x7'));var logger=require(_0x8697('0x8'))(_0x8697('0x9'));var config=require(_0x8697('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8697('0xb')][_0x8697('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a9458,_0x5d223a,_0x188ab8){return new BPromise(function(_0x1482f0,_0x1f18cb){return client[_0x8697('0xd')](_0x5a9458,_0x188ab8)[_0x8697('0xe')](function(_0x4517db){logger[_0x8697('0xf')](_0x8697('0x10'),_0x5d223a,_0x8697('0x11'));logger[_0x8697('0x12')](_0x8697('0x13'),_0x5d223a,_0x8697('0x11'),JSON['stringify'](_0x4517db));if(_0x4517db['error']){if(_0x4517db[_0x8697('0x14')][_0x8697('0x15')]===0x1f4){logger[_0x8697('0x14')](_0x8697('0x10'),_0x5d223a,_0x4517db[_0x8697('0x14')][_0x8697('0x16')]);return _0x1f18cb(_0x4517db[_0x8697('0x14')][_0x8697('0x16')]);}logger['error'](_0x8697('0x10'),_0x5d223a,_0x4517db['error']['message']);return _0x1482f0(_0x4517db['error']['message']);}else{logger[_0x8697('0xf')](_0x8697('0x10'),_0x5d223a,'request\x20sent');_0x1482f0(_0x4517db[_0x8697('0x17')][_0x8697('0x16')]);}})['catch'](function(_0x1d995c){logger['error'](_0x8697('0x10'),_0x5d223a,_0x1d995c);_0x1f18cb(_0x1d995c);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index f2a0742..57902f6 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(_0x2ffc0a,_0x47604a){var _0x47ee3d=function(_0x49012a){while(--_0x49012a){_0x2ffc0a['push'](_0x2ffc0a['shift']());}};_0x47ee3d(++_0x47604a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x2fe63d,_0x5b80ac){var _0x11b001=function(_0x573030){while(--_0x573030){_0x2fe63d['push'](_0x2fe63d['shift']());}};_0x11b001(++_0x5b80ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 eaf838e..d91ca14 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 _0xf958=['sequelize','STRING'];(function(_0x4a3323,_0x4f1468){var _0x3c8181=function(_0x4f7bd7){while(--_0x4f7bd7){_0x4a3323['push'](_0x4a3323['shift']());}};_0x3c8181(++_0x4f1468);}(_0xf958,0xe6));var _0x8f95=function(_0x44a77a,_0x52408e){_0x44a77a=_0x44a77a-0x0;var _0x69fb42=_0xf958[_0x44a77a];return _0x69fb42;};'use strict';var Sequelize=require(_0x8f95('0x0'));module['exports']={'name':{'type':Sequelize[_0x8f95('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x8f95('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x8f95('0x1')]}};
\ No newline at end of file
+var _0x96cc=['TEXT','sequelize','STRING'];(function(_0x30bb30,_0x564af1){var _0xce44e7=function(_0x5b96aa){while(--_0x5b96aa){_0x30bb30['push'](_0x30bb30['shift']());}};_0xce44e7(++_0x564af1);}(_0x96cc,0x16c));var _0xc96c=function(_0x2d41fc,_0x58b122){_0x2d41fc=_0x2d41fc-0x0;var _0x51473d=_0x96cc[_0x2d41fc];return _0x51473d;};'use strict';var Sequelize=require(_0xc96c('0x0'));module['exports']={'name':{'type':Sequelize[_0xc96c('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xc96c('0x1')]},'metric':{'type':Sequelize[_0xc96c('0x2')]},'description':{'type':Sequelize[_0xc96c('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 1233bf4..28a2785 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 _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x7da7,0x10d));var _0x77da=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0x7da7[_0x5cab28];return _0xa3554d;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));};
\ No newline at end of file
+var _0x8ef6=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xbc4659,_0x578fba){var _0x5831f9=function(_0x5eb0eb){while(--_0x5eb0eb){_0xbc4659['push'](_0xbc4659['shift']());}};_0x5831f9(++_0x578fba);}(_0x8ef6,0xf2));var _0x68ef=function(_0x13448a,_0x559bd9){_0x13448a=_0x13448a-0x0;var _0x76c5b0=_0x8ef6[_0x13448a];return _0x76c5b0;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){var _0x49374f=_0x438b4c[_0x68ef('0x29')]({'plain':!![]});var _0x13280b='Metrics';return db[_0x68ef('0x2a')]['destroy']({'where':{'type':_0x13280b,'resourceId':_0x49374f['id']}})['then'](function(){return _0x438b4c;});})['then'](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x123041,_0x29518e){return function(_0x52e67e){if(!_0x52e67e){_0x123041['sendStatus'](0x194);}return _0x52e67e;};}function handleError(_0x1cbe4f,_0x28907a){_0x28907a=_0x28907a||0x1f4;return function(_0x7bf96){logger[_0x68ef('0x2b')](_0x7bf96[_0x68ef('0x2c')]);if(_0x7bf96[_0x68ef('0x2d')]){delete _0x7bf96[_0x68ef('0x2d')];}_0x1cbe4f[_0x68ef('0x1d')](_0x28907a)['send'](_0x7bf96);};}exports[_0x68ef('0x2e')]=function(_0x4314bd,_0x132d9e){var _0x4c25aa={},_0x370a8f={},_0x523120={'count':0x0,'rows':[]};var _0x133788=_[_0x68ef('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x159395){return{'name':_0x159395[_0x68ef('0x30')],'type':_0x159395['type'][_0x68ef('0x31')]};});_0x370a8f[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0x133788,_0x68ef('0x2d'));_0x370a8f['query']=_[_0x68ef('0x33')](_0x4314bd[_0x68ef('0x34')]);_0x370a8f['filters']=_[_0x68ef('0x35')](_0x370a8f['model'],_0x370a8f[_0x68ef('0x34')]);_0x4c25aa[_0x68ef('0x36')]=_['intersection'](_0x370a8f[_0x68ef('0x32')],qs['fields'](_0x4314bd[_0x68ef('0x34')]['fields']));_0x4c25aa[_0x68ef('0x36')]=_0x4c25aa[_0x68ef('0x36')][_0x68ef('0x37')]?_0x4c25aa['attributes']:_0x370a8f[_0x68ef('0x32')];if(!_0x4314bd['query'][_0x68ef('0x38')]('nolimit')){_0x4c25aa[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x4314bd[_0x68ef('0x34')][_0x68ef('0x21')]);_0x4c25aa[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x4314bd['query'][_0x68ef('0x1f')]);}_0x4c25aa[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x4314bd['query'][_0x68ef('0x3a')]);_0x4c25aa[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_['pick'](_0x4314bd['query'],_0x370a8f[_0x68ef('0x3c')]),_0x133788);if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x3d')]){_0x4c25aa[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x4c25aa[_0x68ef('0x3b')],{'$or':_[_0x68ef('0x2f')](_0x133788,function(_0x5b1246){if(_0x5b1246[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x2f6ee0={};_0x2f6ee0[_0x5b1246[_0x68ef('0x2d')]]={'$like':'%'+_0x4314bd['query'][_0x68ef('0x3d')]+'%'};return _0x2f6ee0;}})});}_0x4c25aa=_[_0x68ef('0x3e')]({},_0x4c25aa,_0x4314bd[_0x68ef('0x41')]);var _0x410c10={'where':_0x4c25aa[_0x68ef('0x3b')]};return db[_0x68ef('0x42')]['count'](_0x410c10)[_0x68ef('0x27')](function(_0x3f7699){_0x523120[_0x68ef('0x43')]=_0x3f7699;if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x44')]){_0x4c25aa[_0x68ef('0x45')]=[{'all':!![]}];}return db[_0x68ef('0x42')][_0x68ef('0x46')](_0x4c25aa);})[_0x68ef('0x27')](function(_0x531096){_0x523120[_0x68ef('0x47')]=_0x531096;return _0x523120;})[_0x68ef('0x27')](respondWithFilteredResult(_0x132d9e,_0x4c25aa))[_0x68ef('0x48')](handleError(_0x132d9e,null));};exports[_0x68ef('0x49')]=function(_0xdeacf2,_0x183377){var _0xcac58f={'raw':!![],'where':{'id':_0xdeacf2[_0x68ef('0x4a')]['id']}},_0x576767={};_0x576767['model']=_[_0x68ef('0x33')](db[_0x68ef('0x42')][_0x68ef('0x4b')]);_0x576767[_0x68ef('0x34')]=_['keys'](_0xdeacf2[_0x68ef('0x34')]);_0x576767['filters']=_[_0x68ef('0x35')](_0x576767['model'],_0x576767[_0x68ef('0x34')]);_0xcac58f[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x576767['model'],qs['fields'](_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x4c')]));_0xcac58f['attributes']=_0xcac58f['attributes']['length']?_0xcac58f[_0x68ef('0x36')]:_0x576767[_0x68ef('0x32')];if(_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x44')]){_0xcac58f[_0x68ef('0x45')]=[{'all':!![]}];}_0xcac58f=_['merge']({},_0xcac58f,_0xdeacf2['options']);return db[_0x68ef('0x42')][_0x68ef('0x4d')](_0xcac58f)[_0x68ef('0x27')](handleEntityNotFound(_0x183377,null))[_0x68ef('0x27')](respondWithResult(_0x183377,null))['catch'](handleError(_0x183377,null));};exports[_0x68ef('0x4e')]=function(_0x474e5a,_0x1c9b6f){return db[_0x68ef('0x42')]['create'](_0x474e5a['body'],{})[_0x68ef('0x27')](function(_0x3c3074){var _0x566e7c=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x29')]({'plain':!![]});if(!_0x566e7c)throw new Error(_0x68ef('0x50'));if(_0x566e7c[_0x68ef('0x51')]===_0x68ef('0x4f')){var _0x4f0f77=_0x3c3074[_0x68ef('0x29')]({'plain':!![]});var _0x3984ca=_0x68ef('0x52');return db['UserProfileSection'][_0x68ef('0x4d')]({'where':{'name':_0x3984ca,'userProfileId':_0x566e7c[_0x68ef('0x53')]},'raw':!![]})[_0x68ef('0x27')](function(_0x50ef1f){if(_0x50ef1f&&_0x50ef1f[_0x68ef('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f0f77[_0x68ef('0x2d')],'resourceId':_0x4f0f77['id'],'type':_0x50ef1f['name'],'sectionId':_0x50ef1f['id']},{})[_0x68ef('0x27')](function(){return _0x3c3074;});}else{return _0x3c3074;}})[_0x68ef('0x48')](function(_0x53ebd){logger[_0x68ef('0x2b')](_0x68ef('0x55'),_0x53ebd);throw _0x53ebd;});}return _0x3c3074;})[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,0xc9))[_0x68ef('0x48')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x56')]=function(_0x2b35f4,_0x247915){if(_0x2b35f4['body']['id']){delete _0x2b35f4['body']['id'];}return db[_0x68ef('0x42')][_0x68ef('0x4d')]({'where':{'id':_0x2b35f4[_0x68ef('0x4a')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x247915,null))[_0x68ef('0x27')](saveUpdates(_0x2b35f4[_0x68ef('0x57')],null))[_0x68ef('0x27')](respondWithResult(_0x247915,null))[_0x68ef('0x48')](handleError(_0x247915,null));};exports[_0x68ef('0x28')]=function(_0x4c2e9c,_0x5685bb){return db[_0x68ef('0x42')]['find']({'where':{'id':_0x4c2e9c[_0x68ef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5685bb,null))[_0x68ef('0x27')](removeEntity(_0x5685bb,null))[_0x68ef('0x48')](handleError(_0x5685bb,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index e41eb38..633b345 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 _0x363e=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics'];(function(_0x37dd7b,_0x29619d){var _0x548856=function(_0x5f62ff){while(--_0x5f62ff){_0x37dd7b['push'](_0x37dd7b['shift']());}};_0x548856(++_0x29619d);}(_0x363e,0x179));var _0xe363=function(_0x3f5b0d,_0x2f5def){_0x3f5b0d=_0x3f5b0d-0x0;var _0x44e766=_0x363e[_0x3f5b0d];return _0x44e766;};'use strict';var _=require(_0xe363('0x0'));var util=require(_0xe363('0x1'));var logger=require('../../config/logger')(_0xe363('0x2'));var moment=require(_0xe363('0x3'));var BPromise=require(_0xe363('0x4'));var rp=require(_0xe363('0x5'));var fs=require('fs');var path=require(_0xe363('0x6'));var rimraf=require(_0xe363('0x7'));var config=require(_0xe363('0x8'));var attributes=require(_0xe363('0x9'));module[_0xe363('0xa')]=function(_0x1834ca,_0x8953cc){return _0x1834ca['define'](_0xe363('0xb'),attributes,{'tableName':_0xe363('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb0df=['analytics_metrics','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticMetric'];(function(_0x2082bb,_0x216c62){var _0x8ceeeb=function(_0x2b9a60){while(--_0x2b9a60){_0x2082bb['push'](_0x2082bb['shift']());}};_0x8ceeeb(++_0x216c62);}(_0xb0df,0x85));var _0xfb0d=function(_0x673722,_0x275d7e){_0x673722=_0x673722-0x0;var _0x21249c=_0xb0df[_0x673722];return _0x21249c;};'use strict';var _=require('lodash');var util=require(_0xfb0d('0x0'));var logger=require(_0xfb0d('0x1'))(_0xfb0d('0x2'));var moment=require(_0xfb0d('0x3'));var BPromise=require(_0xfb0d('0x4'));var rp=require(_0xfb0d('0x5'));var fs=require('fs');var path=require(_0xfb0d('0x6'));var rimraf=require(_0xfb0d('0x7'));var config=require(_0xfb0d('0x8'));var attributes=require('./analyticMetric.attributes');module[_0xfb0d('0x9')]=function(_0x12458c,_0x58e4c0){return _0x12458c['define'](_0xfb0d('0xa'),attributes,{'tableName':_0xfb0d('0xb'),'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 62f1a25..f9bd31a 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 _0x8e9b=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info'];(function(_0x19fe09,_0x47cc7c){var _0x514472=function(_0x50e64d){while(--_0x50e64d){_0x19fe09['push'](_0x19fe09['shift']());}};_0x514472(++_0x47cc7c);}(_0x8e9b,0x15e));var _0xb8e9=function(_0x53b3ee,_0x12feb7){_0x53b3ee=_0x53b3ee-0x0;var _0x50fae3=_0x8e9b[_0x53b3ee];return _0x50fae3;};'use strict';var _=require(_0xb8e9('0x0'));var util=require(_0xb8e9('0x1'));var moment=require(_0xb8e9('0x2'));var BPromise=require(_0xb8e9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8e9('0x4'))['db'];var utils=require(_0xb8e9('0x5'));var logger=require('../../config/logger')(_0xb8e9('0x6'));var config=require('../../config/environment');var jayson=require(_0xb8e9('0x7'));var client=jayson[_0xb8e9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f26fa,_0x3de947,_0x783c04){return new BPromise(function(_0x5a2ec5,_0x1168d5){return client[_0xb8e9('0x9')](_0x3f26fa,_0x783c04)['then'](function(_0xfb304f){logger[_0xb8e9('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x3de947,_0xb8e9('0xb'));logger[_0xb8e9('0xc')](_0xb8e9('0xd'),_0x3de947,_0xb8e9('0xb'),JSON[_0xb8e9('0xe')](_0xfb304f));if(_0xfb304f[_0xb8e9('0xf')]){if(_0xfb304f[_0xb8e9('0xf')]['code']===0x1f4){logger[_0xb8e9('0xf')](_0xb8e9('0x10'),_0x3de947,_0xfb304f[_0xb8e9('0xf')][_0xb8e9('0x11')]);return _0x1168d5(_0xfb304f[_0xb8e9('0xf')][_0xb8e9('0x11')]);}logger[_0xb8e9('0xf')](_0xb8e9('0x10'),_0x3de947,_0xfb304f[_0xb8e9('0xf')]['message']);return _0x5a2ec5(_0xfb304f[_0xb8e9('0xf')][_0xb8e9('0x11')]);}else{logger[_0xb8e9('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x3de947,'request\x20sent');_0x5a2ec5(_0xfb304f[_0xb8e9('0x12')][_0xb8e9('0x11')]);}})['catch'](function(_0x3c2b6c){logger['error'](_0xb8e9('0x10'),_0x3de947,_0x3c2b6c);_0x1168d5(_0x3c2b6c);});});}
\ No newline at end of file
+var _0x4404=['../../config/logger','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x25dd3b,_0x27e043){var _0x3084aa=function(_0x45f3c1){while(--_0x45f3c1){_0x25dd3b['push'](_0x25dd3b['shift']());}};_0x3084aa(++_0x27e043);}(_0x4404,0x16e));var _0x4440=function(_0x494fcb,_0x4f6a92){_0x494fcb=_0x494fcb-0x0;var _0x1a3a98=_0x4404[_0x494fcb];return _0x1a3a98;};'use strict';var _=require(_0x4440('0x0'));var util=require(_0x4440('0x1'));var moment=require(_0x4440('0x2'));var BPromise=require(_0x4440('0x3'));var rs=require(_0x4440('0x4'));var fs=require('fs');var Redis=require(_0x4440('0x5'));var db=require(_0x4440('0x6'))['db'];var utils=require(_0x4440('0x7'));var logger=require(_0x4440('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ed9a8,_0x4626d2,_0x21f35c){return new BPromise(function(_0x57b514,_0x567895){return client[_0x4440('0x9')](_0x1ed9a8,_0x21f35c)[_0x4440('0xa')](function(_0x440080){logger[_0x4440('0xb')](_0x4440('0xc'),_0x4626d2,_0x4440('0xd'));logger[_0x4440('0xe')](_0x4440('0xf'),_0x4626d2,'request\x20sent',JSON[_0x4440('0x10')](_0x440080));if(_0x440080['error']){if(_0x440080[_0x4440('0x11')][_0x4440('0x12')]===0x1f4){logger[_0x4440('0x11')](_0x4440('0xc'),_0x4626d2,_0x440080[_0x4440('0x11')][_0x4440('0x13')]);return _0x567895(_0x440080[_0x4440('0x11')]['message']);}logger['error'](_0x4440('0xc'),_0x4626d2,_0x440080['error'][_0x4440('0x13')]);return _0x57b514(_0x440080[_0x4440('0x11')][_0x4440('0x13')]);}else{logger[_0x4440('0xb')](_0x4440('0xc'),_0x4626d2,'request\x20sent');_0x57b514(_0x440080[_0x4440('0x14')][_0x4440('0x13')]);}})[_0x4440('0x15')](function(_0x502549){logger[_0x4440('0x11')](_0x4440('0xc'),_0x4626d2,_0x502549);_0x567895(_0x502549);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 71fe7d7..5619f4f 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 _0xc838=['../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x275b63,_0x684508){var _0x2d4b9d=function(_0x59acb6){while(--_0x59acb6){_0x275b63['push'](_0x275b63['shift']());}};_0x2d4b9d(++_0x684508);}(_0xc838,0xbd));var _0x8c83=function(_0x3a1405,_0x433caf){_0x3a1405=_0x3a1405-0x0;var _0x2e78f1=_0xc838[_0x3a1405];return _0x2e78f1;};'use strict';var multer=require(_0x8c83('0x0'));var util=require(_0x8c83('0x1'));var path=require(_0x8c83('0x2'));var timeout=require(_0x8c83('0x3'));var express=require(_0x8c83('0x4'));var router=express[_0x8c83('0x5')]();var fs_extra=require(_0x8c83('0x6'));var auth=require(_0x8c83('0x7'));var interaction=require(_0x8c83('0x8'));var config=require(_0x8c83('0x9'));var controller=require(_0x8c83('0xa'));router[_0x8c83('0xb')]('/',auth[_0x8c83('0xc')](),controller[_0x8c83('0xd')]);router[_0x8c83('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x8c83('0xe')]);router['post']('/',auth[_0x8c83('0xc')](),controller[_0x8c83('0xf')]);router[_0x8c83('0x10')](_0x8c83('0x11'),auth[_0x8c83('0xc')](),controller[_0x8c83('0x12')]);router[_0x8c83('0x13')](_0x8c83('0x11'),auth[_0x8c83('0xc')](),controller[_0x8c83('0x14')]);module[_0x8c83('0x15')]=router;
\ No newline at end of file
+var _0x7412=['delete','destroy','exports','multer','connect-timeout','Router','isAuthenticated','index','get','show','post','put','/:id','update'];(function(_0x307888,_0x2e8d30){var _0x3af557=function(_0x48aa49){while(--_0x48aa49){_0x307888['push'](_0x307888['shift']());}};_0x3af557(++_0x2e8d30);}(_0x7412,0x161));var _0x2741=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x7412[_0xfa634c];return _0x73e478;};'use strict';var multer=require(_0x2741('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2741('0x1'));var express=require('express');var router=express[_0x2741('0x2')]();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('./analyticMetric.controller');router['get']('/',auth[_0x2741('0x3')](),controller[_0x2741('0x4')]);router[_0x2741('0x5')]('/:id',auth[_0x2741('0x3')](),controller[_0x2741('0x6')]);router[_0x2741('0x7')]('/',auth[_0x2741('0x3')](),controller['create']);router[_0x2741('0x8')](_0x2741('0x9'),auth[_0x2741('0x3')](),controller[_0x2741('0xa')]);router[_0x2741('0xb')]('/:id',auth[_0x2741('0x3')](),controller[_0x2741('0xc')]);module[_0x2741('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index fa15121..17b95c1 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 _0x624c=['exports','sequelize'];(function(_0x477017,_0x99a3b){var _0x29bbc9=function(_0x40e1c2){while(--_0x40e1c2){_0x477017['push'](_0x477017['shift']());}};_0x29bbc9(++_0x99a3b);}(_0x624c,0x83));var _0xc624=function(_0x397843,_0xa7173e){_0x397843=_0x397843-0x0;var _0x2ba028=_0x624c[_0x397843];return _0x2ba028;};'use strict';var Sequelize=require(_0xc624('0x0'));module[_0xc624('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xfb6a=['TEXT','sequelize'];(function(_0x3cfc01,_0x4ea6b9){var _0x52d02c=function(_0x375398){while(--_0x375398){_0x3cfc01['push'](_0x3cfc01['shift']());}};_0x52d02c(++_0x4ea6b9);}(_0xfb6a,0x79));var _0xafb6=function(_0x564e9f,_0x225a15){_0x564e9f=_0x564e9f-0x0;var _0x3a9f3e=_0xfb6a[_0x564e9f];return _0x3a9f3e;};'use strict';var Sequelize=require(_0xafb6('0x0'));module['exports']={'tree':{'type':Sequelize[_0xafb6('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 1659b64..0d051ca 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 _0x22c6=['include','catch','create','body','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','findAll','rows','then','show','params'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x22c6,0x9f));var _0x622c=function(_0x16be52,_0x35af14){_0x16be52=_0x16be52-0x0;var _0x40d854=_0x22c6[_0x16be52];return _0x40d854;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x622c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x622c('0x1'));var rp=require(_0x622c('0x2'));var moment=require(_0x622c('0x3'));var BPromise=require(_0x622c('0x4'));var Mustache=require(_0x622c('0x5'));var util=require(_0x622c('0x6'));var path=require(_0x622c('0x7'));var sox=require(_0x622c('0x8'));var csv=require(_0x622c('0x9'));var ejs=require(_0x622c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x622c('0xb'));var squel=require(_0x622c('0xc'));var crypto=require(_0x622c('0xd'));var jsforce=require(_0x622c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x622c('0x9'));var querystring=require(_0x622c('0xf'));var Papa=require(_0x622c('0x10'));var Redis=require(_0x622c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x622c('0x12'));var as=require(_0x622c('0x13'));var hardwareService=require(_0x622c('0x14'));var logger=require(_0x622c('0x15'))(_0x622c('0x16'));var utils=require(_0x622c('0x17'));var config=require(_0x622c('0x18'));var licenseUtil=require(_0x622c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38f8b4,_0x12d7ae){_0x12d7ae=_0x12d7ae||0xcc;return function(_0x27b488){if(_0x27b488){return _0x38f8b4['sendStatus'](_0x12d7ae);}return _0x38f8b4[_0x622c('0x1a')](_0x12d7ae)[_0x622c('0x1b')]();};}function respondWithResult(_0x5134e8,_0x3ed8b6){_0x3ed8b6=_0x3ed8b6||0xc8;return function(_0x3087b0){if(_0x3087b0){return _0x5134e8['status'](_0x3ed8b6)[_0x622c('0x1c')](_0x3087b0);}};}function respondWithFilteredResult(_0x2cf5d5,_0x214e8f){return function(_0x12b3da){if(_0x12b3da){var _0x1f7a75=typeof _0x214e8f[_0x622c('0x1d')]===_0x622c('0x1e')&&typeof _0x214e8f[_0x622c('0x1f')]===_0x622c('0x1e');var _0x2b9c27=_0x12b3da[_0x622c('0x20')];var _0x1b512a=_0x1f7a75?0x0:_0x214e8f[_0x622c('0x1d')];var _0x53d06e=_0x1f7a75?_0x12b3da[_0x622c('0x20')]:_0x214e8f[_0x622c('0x1d')]+_0x214e8f[_0x622c('0x1f')];var _0x22f693;if(_0x53d06e>=_0x2b9c27){_0x53d06e=_0x2b9c27;_0x22f693=0xc8;}else{_0x22f693=0xce;}_0x2cf5d5[_0x622c('0x1a')](_0x22f693);return _0x2cf5d5[_0x622c('0x21')](_0x622c('0x22'),_0x1b512a+'-'+_0x53d06e+'/'+_0x2b9c27)[_0x622c('0x1c')](_0x12b3da);}return null;};}function patchUpdates(_0x4069e8){return function(_0x41f7d8){try{jsonpatch[_0x622c('0x23')](_0x41f7d8,_0x4069e8,!![]);}catch(_0x417ed6){return BPromise['reject'](_0x417ed6);}return _0x41f7d8['save']();};}function saveUpdates(_0x83aaeb,_0x58fa22){return function(_0x544f33){if(_0x544f33){return _0x544f33[_0x622c('0x24')](_0x83aaeb)['then'](function(_0x3f5b98){return _0x3f5b98;});}return null;};}function removeEntity(_0x351114,_0x421a0c){return function(_0x2885c8){if(_0x2885c8){return _0x2885c8['destroy']()['then'](function(){_0x351114[_0x622c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3af1b2,_0x476c3c){return function(_0x492422){if(!_0x492422){_0x3af1b2[_0x622c('0x25')](0x194);}return _0x492422;};}function handleError(_0x3dd7f9,_0x5f00a6){_0x5f00a6=_0x5f00a6||0x1f4;return function(_0x31c90e){logger[_0x622c('0x26')](_0x31c90e[_0x622c('0x27')]);if(_0x31c90e['name']){delete _0x31c90e[_0x622c('0x28')];}_0x3dd7f9[_0x622c('0x1a')](_0x5f00a6)[_0x622c('0x29')](_0x31c90e);};}exports[_0x622c('0x2a')]=function(_0x5758a2,_0xfaa975){var _0x49539c={},_0x30a992={},_0x52e5f8={'count':0x0,'rows':[]};var _0x3c80b6=_[_0x622c('0x2b')](db['AnalyticTreeReport'][_0x622c('0x2c')],function(_0x275d66){return{'name':_0x275d66['fieldName'],'type':_0x275d66[_0x622c('0x2d')][_0x622c('0x2e')]};});_0x30a992[_0x622c('0x2f')]=_[_0x622c('0x2b')](_0x3c80b6,'name');_0x30a992[_0x622c('0x30')]=_[_0x622c('0x31')](_0x5758a2['query']);_0x30a992['filters']=_[_0x622c('0x32')](_0x30a992[_0x622c('0x2f')],_0x30a992[_0x622c('0x30')]);_0x49539c[_0x622c('0x33')]=_[_0x622c('0x32')](_0x30a992[_0x622c('0x2f')],qs[_0x622c('0x34')](_0x5758a2[_0x622c('0x30')][_0x622c('0x34')]));_0x49539c[_0x622c('0x33')]=_0x49539c[_0x622c('0x33')][_0x622c('0x35')]?_0x49539c[_0x622c('0x33')]:_0x30a992['model'];if(!_0x5758a2[_0x622c('0x30')][_0x622c('0x36')](_0x622c('0x37'))){_0x49539c[_0x622c('0x1f')]=qs[_0x622c('0x1f')](_0x5758a2[_0x622c('0x30')][_0x622c('0x1f')]);_0x49539c[_0x622c('0x1d')]=qs[_0x622c('0x1d')](_0x5758a2[_0x622c('0x30')][_0x622c('0x1d')]);}_0x49539c[_0x622c('0x38')]=qs[_0x622c('0x39')](_0x5758a2[_0x622c('0x30')][_0x622c('0x39')]);_0x49539c['where']=qs[_0x622c('0x3a')](_[_0x622c('0x3b')](_0x5758a2['query'],_0x30a992['filters']),_0x3c80b6);if(_0x5758a2[_0x622c('0x30')][_0x622c('0x3c')]){_0x49539c[_0x622c('0x3d')]=_[_0x622c('0x3e')](_0x49539c[_0x622c('0x3d')],{'$or':_[_0x622c('0x2b')](_0x3c80b6,function(_0x39dc2f){if(_0x39dc2f[_0x622c('0x2d')]!==_0x622c('0x3f')){var _0x51adbc={};_0x51adbc[_0x39dc2f[_0x622c('0x28')]]={'$like':'%'+_0x5758a2[_0x622c('0x30')][_0x622c('0x3c')]+'%'};return _0x51adbc;}})});}_0x49539c=_[_0x622c('0x3e')]({},_0x49539c,_0x5758a2[_0x622c('0x40')]);var _0x34a2d7={'where':_0x49539c['where']};return db[_0x622c('0x41')][_0x622c('0x20')](_0x34a2d7)['then'](function(_0x2aab92){_0x52e5f8[_0x622c('0x20')]=_0x2aab92;if(_0x5758a2[_0x622c('0x30')][_0x622c('0x42')]){_0x49539c['include']=[{'all':!![]}];}return db[_0x622c('0x41')][_0x622c('0x43')](_0x49539c);})['then'](function(_0x21b7de){_0x52e5f8[_0x622c('0x44')]=_0x21b7de;return _0x52e5f8;})[_0x622c('0x45')](respondWithFilteredResult(_0xfaa975,_0x49539c))['catch'](handleError(_0xfaa975,null));};exports[_0x622c('0x46')]=function(_0x468178,_0x411481){var _0x41712b={'raw':!![],'where':{'id':_0x468178[_0x622c('0x47')]['id']}},_0x5a7693={};_0x5a7693[_0x622c('0x2f')]=_[_0x622c('0x31')](db[_0x622c('0x41')][_0x622c('0x2c')]);_0x5a7693['query']=_[_0x622c('0x31')](_0x468178['query']);_0x5a7693[_0x622c('0x3a')]=_[_0x622c('0x32')](_0x5a7693[_0x622c('0x2f')],_0x5a7693[_0x622c('0x30')]);_0x41712b[_0x622c('0x33')]=_['intersection'](_0x5a7693['model'],qs[_0x622c('0x34')](_0x468178[_0x622c('0x30')][_0x622c('0x34')]));_0x41712b['attributes']=_0x41712b[_0x622c('0x33')][_0x622c('0x35')]?_0x41712b['attributes']:_0x5a7693['model'];if(_0x468178[_0x622c('0x30')][_0x622c('0x42')]){_0x41712b[_0x622c('0x48')]=[{'all':!![]}];}_0x41712b=_[_0x622c('0x3e')]({},_0x41712b,_0x468178[_0x622c('0x40')]);return db[_0x622c('0x41')]['find'](_0x41712b)[_0x622c('0x45')](handleEntityNotFound(_0x411481,null))[_0x622c('0x45')](respondWithResult(_0x411481,null))[_0x622c('0x49')](handleError(_0x411481,null));};exports[_0x622c('0x4a')]=function(_0x18158f,_0x56c21f){return db['AnalyticTreeReport']['create'](_0x18158f[_0x622c('0x4b')],{})[_0x622c('0x45')](respondWithResult(_0x56c21f,0xc9))['catch'](handleError(_0x56c21f,null));};exports['update']=function(_0x2b438e,_0x22eadf){if(_0x2b438e[_0x622c('0x4b')]['id']){delete _0x2b438e[_0x622c('0x4b')]['id'];}return db[_0x622c('0x41')][_0x622c('0x4c')]({'where':{'id':_0x2b438e[_0x622c('0x47')]['id']}})[_0x622c('0x45')](handleEntityNotFound(_0x22eadf,null))['then'](saveUpdates(_0x2b438e[_0x622c('0x4b')],null))[_0x622c('0x45')](respondWithResult(_0x22eadf,null))[_0x622c('0x49')](handleError(_0x22eadf,null));};exports['destroy']=function(_0x2d3786,_0x5f31a8){return db[_0x622c('0x41')][_0x622c('0x4c')]({'where':{'id':_0x2d3786[_0x622c('0x47')]['id']}})['then'](handleEntityNotFound(_0x5f31a8,null))[_0x622c('0x45')](removeEntity(_0x5f31a8,null))[_0x622c('0x49')](handleError(_0x5f31a8,null));};
\ No newline at end of file
+var _0x5024=['findAll','rows','catch','show','params','include','create','body','find','eml-format','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','stack','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','AnalyticTreeReport','count','includeAll'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5024,0x16c));var _0x4502=function(_0x4d9ad1,_0x467b48){_0x4d9ad1=_0x4d9ad1-0x0;var _0x4962dd=_0x5024[_0x4d9ad1];return _0x4962dd;};'use strict';var emlformat=require(_0x4502('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4502('0x1'));var BPromise=require(_0x4502('0x2'));var Mustache=require(_0x4502('0x3'));var util=require(_0x4502('0x4'));var path=require('path');var sox=require(_0x4502('0x5'));var csv=require(_0x4502('0x6'));var ejs=require(_0x4502('0x7'));var fs=require('fs');var fs_extra=require(_0x4502('0x8'));var _=require(_0x4502('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4502('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4502('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4502('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4502('0xc'));var hardwareService=require(_0x4502('0xd'));var logger=require(_0x4502('0xe'))(_0x4502('0xf'));var utils=require(_0x4502('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4502('0x11'));var db=require(_0x4502('0x12'))['db'];function respondWithStatusCode(_0x2c459f,_0x22c7a6){_0x22c7a6=_0x22c7a6||0xcc;return function(_0x43a701){if(_0x43a701){return _0x2c459f['sendStatus'](_0x22c7a6);}return _0x2c459f['status'](_0x22c7a6)[_0x4502('0x13')]();};}function respondWithResult(_0x4bb5ba,_0x41af7f){_0x41af7f=_0x41af7f||0xc8;return function(_0x235a3d){if(_0x235a3d){return _0x4bb5ba[_0x4502('0x14')](_0x41af7f)['json'](_0x235a3d);}};}function respondWithFilteredResult(_0x399d60,_0x378a0a){return function(_0x5300b8){if(_0x5300b8){var _0x308bd4=typeof _0x378a0a[_0x4502('0x15')]==='undefined'&&typeof _0x378a0a[_0x4502('0x16')]===_0x4502('0x17');var _0x5894f7=_0x5300b8['count'];var _0x43b8f5=_0x308bd4?0x0:_0x378a0a[_0x4502('0x15')];var _0x35c4e4=_0x308bd4?_0x5300b8['count']:_0x378a0a[_0x4502('0x15')]+_0x378a0a[_0x4502('0x16')];var _0x4eb3f1;if(_0x35c4e4>=_0x5894f7){_0x35c4e4=_0x5894f7;_0x4eb3f1=0xc8;}else{_0x4eb3f1=0xce;}_0x399d60[_0x4502('0x14')](_0x4eb3f1);return _0x399d60[_0x4502('0x18')](_0x4502('0x19'),_0x43b8f5+'-'+_0x35c4e4+'/'+_0x5894f7)[_0x4502('0x1a')](_0x5300b8);}return null;};}function patchUpdates(_0x1c4441){return function(_0xcf8ee1){try{jsonpatch[_0x4502('0x1b')](_0xcf8ee1,_0x1c4441,!![]);}catch(_0x303b9e){return BPromise[_0x4502('0x1c')](_0x303b9e);}return _0xcf8ee1['save']();};}function saveUpdates(_0x3ef6b1,_0x406924){return function(_0x577455){if(_0x577455){return _0x577455[_0x4502('0x1d')](_0x3ef6b1)[_0x4502('0x1e')](function(_0x428075){return _0x428075;});}return null;};}function removeEntity(_0x4c1738,_0x1777e8){return function(_0x360f8c){if(_0x360f8c){return _0x360f8c[_0x4502('0x1f')]()['then'](function(){_0x4c1738[_0x4502('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57cb7e,_0x2503f1){return function(_0x4044f1){if(!_0x4044f1){_0x57cb7e[_0x4502('0x20')](0x194);}return _0x4044f1;};}function handleError(_0x1387bb,_0x20b33){_0x20b33=_0x20b33||0x1f4;return function(_0x4d0a70){logger['error'](_0x4d0a70[_0x4502('0x21')]);if(_0x4d0a70['name']){delete _0x4d0a70['name'];}_0x1387bb[_0x4502('0x14')](_0x20b33)[_0x4502('0x22')](_0x4d0a70);};}exports[_0x4502('0x23')]=function(_0x2bc568,_0x592c19){var _0x3fadf5={},_0x45e5e3={},_0x17023f={'count':0x0,'rows':[]};var _0xc8c37b=_[_0x4502('0x24')](db['AnalyticTreeReport'][_0x4502('0x25')],function(_0x2f3851){return{'name':_0x2f3851[_0x4502('0x26')],'type':_0x2f3851[_0x4502('0x27')][_0x4502('0x28')]};});_0x45e5e3[_0x4502('0x29')]=_[_0x4502('0x24')](_0xc8c37b,'name');_0x45e5e3[_0x4502('0x2a')]=_[_0x4502('0x2b')](_0x2bc568['query']);_0x45e5e3[_0x4502('0x2c')]=_['intersection'](_0x45e5e3[_0x4502('0x29')],_0x45e5e3[_0x4502('0x2a')]);_0x3fadf5['attributes']=_[_0x4502('0x2d')](_0x45e5e3[_0x4502('0x29')],qs[_0x4502('0x2e')](_0x2bc568[_0x4502('0x2a')][_0x4502('0x2e')]));_0x3fadf5[_0x4502('0x2f')]=_0x3fadf5[_0x4502('0x2f')][_0x4502('0x30')]?_0x3fadf5['attributes']:_0x45e5e3[_0x4502('0x29')];if(!_0x2bc568[_0x4502('0x2a')]['hasOwnProperty'](_0x4502('0x31'))){_0x3fadf5[_0x4502('0x16')]=qs[_0x4502('0x16')](_0x2bc568[_0x4502('0x2a')][_0x4502('0x16')]);_0x3fadf5[_0x4502('0x15')]=qs[_0x4502('0x15')](_0x2bc568[_0x4502('0x2a')][_0x4502('0x15')]);}_0x3fadf5[_0x4502('0x32')]=qs[_0x4502('0x33')](_0x2bc568['query'][_0x4502('0x33')]);_0x3fadf5[_0x4502('0x34')]=qs[_0x4502('0x2c')](_[_0x4502('0x35')](_0x2bc568[_0x4502('0x2a')],_0x45e5e3[_0x4502('0x2c')]),_0xc8c37b);if(_0x2bc568[_0x4502('0x2a')][_0x4502('0x36')]){_0x3fadf5[_0x4502('0x34')]=_[_0x4502('0x37')](_0x3fadf5['where'],{'$or':_[_0x4502('0x24')](_0xc8c37b,function(_0xd5e8a8){if(_0xd5e8a8['type']!==_0x4502('0x38')){var _0x688fdd={};_0x688fdd[_0xd5e8a8[_0x4502('0x39')]]={'$like':'%'+_0x2bc568[_0x4502('0x2a')][_0x4502('0x36')]+'%'};return _0x688fdd;}})});}_0x3fadf5=_[_0x4502('0x37')]({},_0x3fadf5,_0x2bc568[_0x4502('0x3a')]);var _0x8f00d2={'where':_0x3fadf5['where']};return db[_0x4502('0x3b')][_0x4502('0x3c')](_0x8f00d2)[_0x4502('0x1e')](function(_0x3d4b13){_0x17023f['count']=_0x3d4b13;if(_0x2bc568[_0x4502('0x2a')][_0x4502('0x3d')]){_0x3fadf5['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x4502('0x3e')](_0x3fadf5);})[_0x4502('0x1e')](function(_0xccc5c3){_0x17023f[_0x4502('0x3f')]=_0xccc5c3;return _0x17023f;})[_0x4502('0x1e')](respondWithFilteredResult(_0x592c19,_0x3fadf5))[_0x4502('0x40')](handleError(_0x592c19,null));};exports[_0x4502('0x41')]=function(_0x42a549,_0x5a9a14){var _0x406811={'raw':!![],'where':{'id':_0x42a549[_0x4502('0x42')]['id']}},_0x4cf132={};_0x4cf132[_0x4502('0x29')]=_['keys'](db['AnalyticTreeReport'][_0x4502('0x25')]);_0x4cf132[_0x4502('0x2a')]=_['keys'](_0x42a549['query']);_0x4cf132[_0x4502('0x2c')]=_[_0x4502('0x2d')](_0x4cf132[_0x4502('0x29')],_0x4cf132[_0x4502('0x2a')]);_0x406811['attributes']=_[_0x4502('0x2d')](_0x4cf132[_0x4502('0x29')],qs[_0x4502('0x2e')](_0x42a549[_0x4502('0x2a')][_0x4502('0x2e')]));_0x406811[_0x4502('0x2f')]=_0x406811[_0x4502('0x2f')][_0x4502('0x30')]?_0x406811[_0x4502('0x2f')]:_0x4cf132[_0x4502('0x29')];if(_0x42a549[_0x4502('0x2a')][_0x4502('0x3d')]){_0x406811[_0x4502('0x43')]=[{'all':!![]}];}_0x406811=_[_0x4502('0x37')]({},_0x406811,_0x42a549[_0x4502('0x3a')]);return db[_0x4502('0x3b')]['find'](_0x406811)[_0x4502('0x1e')](handleEntityNotFound(_0x5a9a14,null))['then'](respondWithResult(_0x5a9a14,null))['catch'](handleError(_0x5a9a14,null));};exports[_0x4502('0x44')]=function(_0x2d6252,_0x113e4b){return db['AnalyticTreeReport'][_0x4502('0x44')](_0x2d6252[_0x4502('0x45')],{})[_0x4502('0x1e')](respondWithResult(_0x113e4b,0xc9))[_0x4502('0x40')](handleError(_0x113e4b,null));};exports[_0x4502('0x1d')]=function(_0x162ef9,_0x5f06ea){if(_0x162ef9[_0x4502('0x45')]['id']){delete _0x162ef9[_0x4502('0x45')]['id'];}return db[_0x4502('0x3b')][_0x4502('0x46')]({'where':{'id':_0x162ef9[_0x4502('0x42')]['id']}})[_0x4502('0x1e')](handleEntityNotFound(_0x5f06ea,null))[_0x4502('0x1e')](saveUpdates(_0x162ef9[_0x4502('0x45')],null))[_0x4502('0x1e')](respondWithResult(_0x5f06ea,null))['catch'](handleError(_0x5f06ea,null));};exports[_0x4502('0x1f')]=function(_0x2169be,_0x437569){return db['AnalyticTreeReport'][_0x4502('0x46')]({'where':{'id':_0x2169be[_0x4502('0x42')]['id']}})[_0x4502('0x1e')](handleEntityNotFound(_0x437569,null))[_0x4502('0x1e')](removeEntity(_0x437569,null))[_0x4502('0x40')](handleError(_0x437569,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 4fd2d0e..13d9a69 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 _0x1493=['analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport'];(function(_0x268555,_0x20241f){var _0x5a1d01=function(_0x5122c2){while(--_0x5122c2){_0x268555['push'](_0x268555['shift']());}};_0x5a1d01(++_0x20241f);}(_0x1493,0x121));var _0x3149=function(_0x33290b,_0x545ef3){_0x33290b=_0x33290b-0x0;var _0x57d076=_0x1493[_0x33290b];return _0x57d076;};'use strict';var _=require(_0x3149('0x0'));var util=require('util');var logger=require(_0x3149('0x1'))(_0x3149('0x2'));var moment=require(_0x3149('0x3'));var BPromise=require(_0x3149('0x4'));var rp=require(_0x3149('0x5'));var fs=require('fs');var path=require(_0x3149('0x6'));var rimraf=require('rimraf');var config=require(_0x3149('0x7'));var attributes=require(_0x3149('0x8'));module['exports']=function(_0x5e767d,_0x4851a2){return _0x5e767d[_0x3149('0x9')](_0x3149('0xa'),attributes,{'tableName':_0x3149('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x01be=['request-promise','rimraf','./analyticTreeReport.attributes','AnalyticTreeReport','lodash','api','bluebird'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x01be,0x162));var _0xe01b=function(_0x129c23,_0x2d8387){_0x129c23=_0x129c23-0x0;var _0x133723=_0x01be[_0x129c23];return _0x133723;};'use strict';var _=require(_0xe01b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe01b('0x1'));var moment=require('moment');var BPromise=require(_0xe01b('0x2'));var rp=require(_0xe01b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe01b('0x4'));var config=require('../../config/environment');var attributes=require(_0xe01b('0x5'));module['exports']=function(_0x4316e3,_0x2a1123){return _0x4316e3['define'](_0xe01b('0x6'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 131ae75..0b5e342 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2d5887,_0xace828){var _0x257084=function(_0x457e3a){while(--_0x457e3a){_0x2d5887['push'](_0x2d5887['shift']());}};_0x257084(++_0xace828);}(_0xadb5,0xad));var _0x5adb=function(_0x4b39f1,_0x1f97ee){_0x4b39f1=_0x4b39f1-0x0;var _0x14014f=_0xadb5[_0x4b39f1];return _0x14014f;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1e0144,_0x1528e3){var _0x172a14=function(_0x3ab22e){while(--_0x3ab22e){_0x1e0144['push'](_0x1e0144['shift']());}};_0x172a14(++_0x1528e3);}(_0xadb5,0xad));var _0x5adb=function(_0x48d4f9,_0x4dfecb){_0x48d4f9=_0x48d4f9-0x0;var _0x506d6c=_0xadb5[_0x48d4f9];return _0x506d6c;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index a6be68a..7d938b9 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 _0xdc1f=['multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports'];(function(_0x3c4d90,_0x47d8d){var _0x49dec7=function(_0x5367f6){while(--_0x5367f6){_0x3c4d90['push'](_0x3c4d90['shift']());}};_0x49dec7(++_0x47d8d);}(_0xdc1f,0x1db));var _0xfdc1=function(_0x304ed0,_0x7a1b5c){_0x304ed0=_0x304ed0-0x0;var _0x1e965a=_0xdc1f[_0x304ed0];return _0x1e965a;};'use strict';var multer=require(_0xfdc1('0x0'));var util=require(_0xfdc1('0x1'));var path=require(_0xfdc1('0x2'));var timeout=require(_0xfdc1('0x3'));var express=require('express');var router=express[_0xfdc1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfdc1('0x5'));var config=require(_0xfdc1('0x6'));var controller=require(_0xfdc1('0x7'));router[_0xfdc1('0x8')]('/',auth[_0xfdc1('0x9')](),controller[_0xfdc1('0xa')]);router[_0xfdc1('0x8')]('/:id',auth[_0xfdc1('0x9')](),controller[_0xfdc1('0xb')]);router[_0xfdc1('0xc')]('/',auth[_0xfdc1('0x9')](),controller[_0xfdc1('0xd')]);router[_0xfdc1('0xe')](_0xfdc1('0xf'),auth[_0xfdc1('0x9')](),controller[_0xfdc1('0x10')]);router[_0xfdc1('0x11')]('/:id',auth[_0xfdc1('0x9')](),controller['destroy']);module[_0xfdc1('0x12')]=router;
\ No newline at end of file
+var _0xcf01=['./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x273f88,_0x5d4150){var _0x177ca1=function(_0xf46ec4){while(--_0xf46ec4){_0x273f88['push'](_0x273f88['shift']());}};_0x177ca1(++_0x5d4150);}(_0xcf01,0x13d));var _0x1cf0=function(_0x5dd181,_0x1eac8b){_0x5dd181=_0x5dd181-0x0;var _0x27cc98=_0xcf01[_0x5dd181];return _0x27cc98;};'use strict';var multer=require(_0x1cf0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1cf0('0x1'));var express=require(_0x1cf0('0x2'));var router=express[_0x1cf0('0x3')]();var fs_extra=require(_0x1cf0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1cf0('0x5'));var config=require('../../config/environment');var controller=require(_0x1cf0('0x6'));router['get']('/',auth[_0x1cf0('0x7')](),controller[_0x1cf0('0x8')]);router[_0x1cf0('0x9')](_0x1cf0('0xa'),auth[_0x1cf0('0x7')](),controller[_0x1cf0('0xb')]);router[_0x1cf0('0xc')]('/',auth['isAuthenticated'](),controller[_0x1cf0('0xd')]);router[_0x1cf0('0xe')](_0x1cf0('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x1cf0('0xf')](_0x1cf0('0xa'),auth[_0x1cf0('0x7')](),controller['destroy']);module[_0x1cf0('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 525ee4b..5545fe8 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 _0x61a1=['STRING','sequelize','exports'];(function(_0x2d2258,_0x2ce510){var _0x18e155=function(_0x11949e){while(--_0x11949e){_0x2d2258['push'](_0x2d2258['shift']());}};_0x18e155(++_0x2ce510);}(_0x61a1,0x127));var _0x161a=function(_0x1a72b8,_0x1e4f4b){_0x1a72b8=_0x1a72b8-0x0;var _0x39f72d=_0x61a1[_0x1a72b8];return _0x39f72d;};'use strict';var Sequelize=require(_0x161a('0x0'));module[_0x161a('0x1')]={'name':{'type':Sequelize[_0x161a('0x2')]},'basename':{'type':Sequelize[_0x161a('0x2')]},'type':{'type':Sequelize[_0x161a('0x2')]}};
\ No newline at end of file
+var _0xae53=['sequelize','STRING'];(function(_0x209e59,_0x5343c0){var _0x4fd0a3=function(_0x33726b){while(--_0x33726b){_0x209e59['push'](_0x209e59['shift']());}};_0x4fd0a3(++_0x5343c0);}(_0xae53,0x16e));var _0x3ae5=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xae53[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require(_0x3ae5('0x0'));module['exports']={'name':{'type':Sequelize[_0x3ae5('0x1')]},'basename':{'type':Sequelize[_0x3ae5('0x1')]},'type':{'type':Sequelize[_0x3ae5('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index cd0ea50..670877c 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 _0x0c3a=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','Attachment','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','find','clone','get','omit','body','createdAt','create','destroy','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x159195,_0x595363){var _0x1ed1c3=function(_0x2192da){while(--_0x2192da){_0x159195['push'](_0x159195['shift']());}};_0x1ed1c3(++_0x595363);}(_0x0c3a,0x154));var _0xa0c3=function(_0x33e241,_0x7b53b2){_0x33e241=_0x33e241-0x0;var _0x14a5dc=_0x0c3a[_0x33e241];return _0x14a5dc;};'use strict';var emlformat=require(_0xa0c3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa0c3('0x1'));var moment=require(_0xa0c3('0x2'));var BPromise=require(_0xa0c3('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa0c3('0x4'));var csv=require(_0xa0c3('0x5'));var ejs=require(_0xa0c3('0x6'));var fs=require('fs');var fs_extra=require(_0xa0c3('0x7'));var _=require(_0xa0c3('0x8'));var squel=require('squel');var crypto=require(_0xa0c3('0x9'));var jsforce=require(_0xa0c3('0xa'));var deskjs=require(_0xa0c3('0xb'));var toCsv=require(_0xa0c3('0x5'));var querystring=require(_0xa0c3('0xc'));var Papa=require(_0xa0c3('0xd'));var Redis=require(_0xa0c3('0xe'));var authService=require(_0xa0c3('0xf'));var qs=require(_0xa0c3('0x10'));var as=require(_0xa0c3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0c3('0x12'))(_0xa0c3('0x13'));var utils=require(_0xa0c3('0x14'));var config=require(_0xa0c3('0x15'));var licenseUtil=require(_0xa0c3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41026a,_0x269c0d){_0x269c0d=_0x269c0d||0xcc;return function(_0x47a1f5){if(_0x47a1f5){return _0x41026a['sendStatus'](_0x269c0d);}return _0x41026a['status'](_0x269c0d)[_0xa0c3('0x17')]();};}function respondWithResult(_0x39188a,_0x3b05ad){_0x3b05ad=_0x3b05ad||0xc8;return function(_0x5f14ab){if(_0x5f14ab){return _0x39188a['status'](_0x3b05ad)[_0xa0c3('0x18')](_0x5f14ab);}};}function respondWithFilteredResult(_0x3ac9d8,_0x389540){return function(_0x1360c5){if(_0x1360c5){var _0x45e42e=typeof _0x389540[_0xa0c3('0x19')]===_0xa0c3('0x1a')&&typeof _0x389540['limit']==='undefined';var _0x4829e7=_0x1360c5[_0xa0c3('0x1b')];var _0x2607a9=_0x45e42e?0x0:_0x389540[_0xa0c3('0x19')];var _0x5384d3=_0x45e42e?_0x1360c5[_0xa0c3('0x1b')]:_0x389540['offset']+_0x389540['limit'];var _0x25276f;if(_0x5384d3>=_0x4829e7){_0x5384d3=_0x4829e7;_0x25276f=0xc8;}else{_0x25276f=0xce;}_0x3ac9d8[_0xa0c3('0x1c')](_0x25276f);return _0x3ac9d8[_0xa0c3('0x1d')](_0xa0c3('0x1e'),_0x2607a9+'-'+_0x5384d3+'/'+_0x4829e7)[_0xa0c3('0x18')](_0x1360c5);}return null;};}function patchUpdates(_0x3bca26){return function(_0x369ba7){try{jsonpatch[_0xa0c3('0x1f')](_0x369ba7,_0x3bca26,!![]);}catch(_0x3d76c6){return BPromise[_0xa0c3('0x20')](_0x3d76c6);}return _0x369ba7[_0xa0c3('0x21')]();};}function saveUpdates(_0x3d1ce9,_0x5b04a8){return function(_0x22f118){if(_0x22f118){return _0x22f118[_0xa0c3('0x22')](_0x3d1ce9)[_0xa0c3('0x23')](function(_0x14d122){return _0x14d122;});}return null;};}function removeEntity(_0x1f3f10,_0x45ae6d){return function(_0x1ed2db){if(_0x1ed2db){return _0x1ed2db['destroy']()[_0xa0c3('0x23')](function(){_0x1f3f10[_0xa0c3('0x1c')](0xcc)[_0xa0c3('0x17')]();});}};}function handleEntityNotFound(_0x1c189f,_0x421e5b){return function(_0x3e228a){if(!_0x3e228a){_0x1c189f['sendStatus'](0x194);}return _0x3e228a;};}function handleError(_0x2a679b,_0x3f71ae){_0x3f71ae=_0x3f71ae||0x1f4;return function(_0x4e2f18){logger[_0xa0c3('0x24')](_0x4e2f18['stack']);if(_0x4e2f18['name']){delete _0x4e2f18[_0xa0c3('0x25')];}_0x2a679b[_0xa0c3('0x1c')](_0x3f71ae)[_0xa0c3('0x26')](_0x4e2f18);};}exports[_0xa0c3('0x27')]=function(_0x58b611,_0x3b6b71){var _0x35ece3={},_0x4b9291={},_0x1811f1={'count':0x0,'rows':[]};var _0x55aa09=_[_0xa0c3('0x28')](db[_0xa0c3('0x29')][_0xa0c3('0x2a')],function(_0x470d96){return{'name':_0x470d96[_0xa0c3('0x2b')],'type':_0x470d96['type']['key']};});_0x4b9291[_0xa0c3('0x2c')]=_[_0xa0c3('0x28')](_0x55aa09,_0xa0c3('0x25'));_0x4b9291['query']=_[_0xa0c3('0x2d')](_0x58b611[_0xa0c3('0x2e')]);_0x4b9291[_0xa0c3('0x2f')]=_[_0xa0c3('0x30')](_0x4b9291[_0xa0c3('0x2c')],_0x4b9291[_0xa0c3('0x2e')]);_0x35ece3[_0xa0c3('0x31')]=_[_0xa0c3('0x30')](_0x4b9291['model'],qs[_0xa0c3('0x32')](_0x58b611[_0xa0c3('0x2e')]['fields']));_0x35ece3[_0xa0c3('0x31')]=_0x35ece3['attributes'][_0xa0c3('0x33')]?_0x35ece3[_0xa0c3('0x31')]:_0x4b9291[_0xa0c3('0x2c')];if(!_0x58b611[_0xa0c3('0x2e')][_0xa0c3('0x34')](_0xa0c3('0x35'))){_0x35ece3['limit']=qs['limit'](_0x58b611[_0xa0c3('0x2e')][_0xa0c3('0x36')]);_0x35ece3[_0xa0c3('0x19')]=qs[_0xa0c3('0x19')](_0x58b611[_0xa0c3('0x2e')][_0xa0c3('0x19')]);}_0x35ece3[_0xa0c3('0x37')]=qs['sort'](_0x58b611[_0xa0c3('0x2e')][_0xa0c3('0x38')]);_0x35ece3[_0xa0c3('0x39')]=qs[_0xa0c3('0x2f')](_[_0xa0c3('0x3a')](_0x58b611['query'],_0x4b9291[_0xa0c3('0x2f')]),_0x55aa09);if(_0x58b611[_0xa0c3('0x2e')][_0xa0c3('0x3b')]){_0x35ece3['where']=_[_0xa0c3('0x3c')](_0x35ece3[_0xa0c3('0x39')],{'$or':_['map'](_0x55aa09,function(_0x59e925){if(_0x59e925[_0xa0c3('0x3d')]!==_0xa0c3('0x3e')){var _0x35850c={};_0x35850c[_0x59e925[_0xa0c3('0x25')]]={'$like':'%'+_0x58b611[_0xa0c3('0x2e')][_0xa0c3('0x3b')]+'%'};return _0x35850c;}})});}_0x35ece3=_[_0xa0c3('0x3c')]({},_0x35ece3,_0x58b611['options']);var _0x4d59c3={'where':_0x35ece3[_0xa0c3('0x39')]};return db[_0xa0c3('0x29')]['count'](_0x4d59c3)[_0xa0c3('0x23')](function(_0x2fe1bc){_0x1811f1[_0xa0c3('0x1b')]=_0x2fe1bc;if(_0x58b611['query'][_0xa0c3('0x3f')]){_0x35ece3['include']=[{'all':!![]}];}return db[_0xa0c3('0x29')][_0xa0c3('0x40')](_0x35ece3);})[_0xa0c3('0x23')](function(_0x4977ab){_0x1811f1[_0xa0c3('0x41')]=_0x4977ab;return _0x1811f1;})['then'](respondWithFilteredResult(_0x3b6b71,_0x35ece3))[_0xa0c3('0x42')](handleError(_0x3b6b71,null));};exports[_0xa0c3('0x43')]=function(_0x308828,_0xc8f7ad){var _0x30527b={'raw':!![],'where':{'id':_0x308828[_0xa0c3('0x44')]['id']}},_0x305c18={};_0x305c18[_0xa0c3('0x2c')]=_[_0xa0c3('0x2d')](db[_0xa0c3('0x29')][_0xa0c3('0x2a')]);_0x305c18['query']=_['keys'](_0x308828[_0xa0c3('0x2e')]);_0x305c18[_0xa0c3('0x2f')]=_[_0xa0c3('0x30')](_0x305c18['model'],_0x305c18[_0xa0c3('0x2e')]);_0x30527b['attributes']=_[_0xa0c3('0x30')](_0x305c18[_0xa0c3('0x2c')],qs[_0xa0c3('0x32')](_0x308828['query'][_0xa0c3('0x32')]));_0x30527b[_0xa0c3('0x31')]=_0x30527b[_0xa0c3('0x31')][_0xa0c3('0x33')]?_0x30527b['attributes']:_0x305c18[_0xa0c3('0x2c')];if(_0x308828[_0xa0c3('0x2e')]['includeAll']){_0x30527b[_0xa0c3('0x45')]=[{'all':!![]}];}_0x30527b=_[_0xa0c3('0x3c')]({},_0x30527b,_0x308828['options']);return db['Attachment'][_0xa0c3('0x46')](_0x30527b)[_0xa0c3('0x23')](handleEntityNotFound(_0xc8f7ad,null))[_0xa0c3('0x23')](respondWithResult(_0xc8f7ad,null))[_0xa0c3('0x42')](handleError(_0xc8f7ad,null));};exports[_0xa0c3('0x47')]=function(_0x3c6d3a,_0x3f11f4){var _0x3cfd21={'where':{'id':_0x3c6d3a[_0xa0c3('0x44')]['id']}},_0x2d853d={};_0x2d853d['model']=_[_0xa0c3('0x2d')](db['Attachment'][_0xa0c3('0x2a')]);_0x3cfd21[_0xa0c3('0x31')]=_['intersection'](_0x2d853d[_0xa0c3('0x2c')],qs[_0xa0c3('0x32')](_0x3c6d3a['query'][_0xa0c3('0x32')]));_0x3cfd21['attributes']=_0x3cfd21[_0xa0c3('0x31')]['length']?_0x3cfd21[_0xa0c3('0x31')]:_0x2d853d[_0xa0c3('0x2c')];if(_0x3c6d3a[_0xa0c3('0x2e')][_0xa0c3('0x3f')]){_0x3cfd21['include']=[{'all':!![]}];}_0x3cfd21=_[_0xa0c3('0x3c')]({},_0x3cfd21,_0x3c6d3a['options']);return db['Attachment']['find'](_0x3cfd21)[_0xa0c3('0x23')](handleEntityNotFound(_0x3f11f4,null))[_0xa0c3('0x23')](function(_0x118263){if(_0x118263){var _0x124ad0=_0x118263[_0xa0c3('0x48')]({'plain':!![]});_0x124ad0=qs[_0xa0c3('0x49')](_0x124ad0,['id','createdAt','updatedAt']);_0x3c6d3a[_0xa0c3('0x4a')]=_[_0xa0c3('0x49')](_0x3c6d3a[_0xa0c3('0x4a')],['id',_0xa0c3('0x4b'),'updatedAt']);return db[_0xa0c3('0x29')][_0xa0c3('0x4c')](_[_0xa0c3('0x3c')](_0x124ad0,_0x3c6d3a[_0xa0c3('0x4a')]),{'include':_0x3c6d3a[_0xa0c3('0x2e')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xa0c3('0x23')](respondWithResult(_0x3f11f4,0xc9))['catch'](handleError(_0x3f11f4,null));};exports['update']=function(_0x4a435e,_0x516b00){if(_0x4a435e[_0xa0c3('0x4a')]['id']){delete _0x4a435e[_0xa0c3('0x4a')]['id'];}return db[_0xa0c3('0x29')][_0xa0c3('0x46')]({'where':{'id':_0x4a435e[_0xa0c3('0x44')]['id']}})[_0xa0c3('0x23')](handleEntityNotFound(_0x516b00,null))[_0xa0c3('0x23')](saveUpdates(_0x4a435e[_0xa0c3('0x4a')],null))['then'](respondWithResult(_0x516b00,null))[_0xa0c3('0x42')](handleError(_0x516b00,null));};exports[_0xa0c3('0x4d')]=function(_0x5f11a9,_0x1f96d1){return db['Attachment'][_0xa0c3('0x46')]({'where':{'id':_0x5f11a9['params']['id']}})[_0xa0c3('0x23')](handleEntityNotFound(_0x1f96d1,null))[_0xa0c3('0x23')](removeEntity(_0x1f96d1,null))['catch'](handleError(_0x1f96d1,null));};exports[_0xa0c3('0x4c')]=function(_0x29bd3b,_0x5455c2,_0x2bc70c){_0x29bd3b['body']['name']=_0x29bd3b[_0xa0c3('0x4e')][_0xa0c3('0x4f')];_0x29bd3b[_0xa0c3('0x4a')][_0xa0c3('0x50')]=_0x29bd3b[_0xa0c3('0x4e')][_0xa0c3('0x51')];_0x29bd3b[_0xa0c3('0x4a')]['type']=_0x29bd3b['file'][_0xa0c3('0x52')];return db[_0xa0c3('0x29')]['create'](_0x29bd3b['body'])[_0xa0c3('0x23')](respondWithResult(_0x5455c2,0xc9))[_0xa0c3('0x42')](handleError(_0x5455c2,null));};exports[_0xa0c3('0x53')]=function(_0x5b17c7,_0x1190ce,_0x395e58){return db[_0xa0c3('0x29')]['findOne']({'where':{'id':_0x5b17c7['params']['id']},'raw':!![]})[_0xa0c3('0x23')](handleEntityNotFound(_0x1190ce,null))[_0xa0c3('0x23')](function(_0x249e27){if(_0x249e27){var _0x3ff1b4=_0x249e27[_0xa0c3('0x54')]!==null;var _0x519d73=path[_0xa0c3('0x55')](config[_0xa0c3('0x56')],_0xa0c3('0x57'));if(_0x3ff1b4){_0x519d73=path[_0xa0c3('0x55')](_0x519d73,_0xa0c3('0x58'));}var _0x51ffe4=path[_0xa0c3('0x55')](_0x519d73,_0x249e27[_0xa0c3('0x50')]);return _0x1190ce[_0xa0c3('0x53')](_0x51ffe4);}})[_0xa0c3('0x42')](handleError(_0x1190ce,null));};
\ No newline at end of file
+var _0x1d8a=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../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','then','destroy','stack','name','send','index','map','Attachment','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','rows','catch','show','params','include','options','find','clone','get','omit','createdAt','updatedAt','body','create','update','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/'];(function(_0x5da27b,_0x1a78bf){var _0x4890e4=function(_0x428bb6){while(--_0x428bb6){_0x5da27b['push'](_0x5da27b['shift']());}};_0x4890e4(++_0x1a78bf);}(_0x1d8a,0x1cc));var _0xa1d8=function(_0x16f8a9,_0x348c8f){_0x16f8a9=_0x16f8a9-0x0;var _0x427a18=_0x1d8a[_0x16f8a9];return _0x427a18;};'use strict';var emlformat=require(_0xa1d8('0x0'));var rimraf=require(_0xa1d8('0x1'));var zipdir=require(_0xa1d8('0x2'));var jsonpatch=require(_0xa1d8('0x3'));var rp=require(_0xa1d8('0x4'));var moment=require('moment');var BPromise=require(_0xa1d8('0x5'));var Mustache=require(_0xa1d8('0x6'));var util=require(_0xa1d8('0x7'));var path=require('path');var sox=require(_0xa1d8('0x8'));var csv=require(_0xa1d8('0x9'));var ejs=require(_0xa1d8('0xa'));var fs=require('fs');var fs_extra=require(_0xa1d8('0xb'));var _=require(_0xa1d8('0xc'));var squel=require(_0xa1d8('0xd'));var crypto=require(_0xa1d8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa1d8('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa1d8('0x10'));var Redis=require(_0xa1d8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa1d8('0x12'));var as=require(_0xa1d8('0x13'));var hardwareService=require(_0xa1d8('0x14'));var logger=require(_0xa1d8('0x15'))('api');var utils=require(_0xa1d8('0x16'));var config=require(_0xa1d8('0x17'));var licenseUtil=require(_0xa1d8('0x18'));var db=require(_0xa1d8('0x19'))['db'];function respondWithStatusCode(_0x6de110,_0x3ee3ef){_0x3ee3ef=_0x3ee3ef||0xcc;return function(_0x5f4ee1){if(_0x5f4ee1){return _0x6de110['sendStatus'](_0x3ee3ef);}return _0x6de110[_0xa1d8('0x1a')](_0x3ee3ef)[_0xa1d8('0x1b')]();};}function respondWithResult(_0x13af43,_0x4066d5){_0x4066d5=_0x4066d5||0xc8;return function(_0x4d54c5){if(_0x4d54c5){return _0x13af43['status'](_0x4066d5)[_0xa1d8('0x1c')](_0x4d54c5);}};}function respondWithFilteredResult(_0x4d1304,_0x2ac733){return function(_0x3517f8){if(_0x3517f8){var _0x44aa13=typeof _0x2ac733[_0xa1d8('0x1d')]===_0xa1d8('0x1e')&&typeof _0x2ac733[_0xa1d8('0x1f')]==='undefined';var _0x1053c4=_0x3517f8[_0xa1d8('0x20')];var _0x1e843e=_0x44aa13?0x0:_0x2ac733['offset'];var _0x2295b1=_0x44aa13?_0x3517f8[_0xa1d8('0x20')]:_0x2ac733[_0xa1d8('0x1d')]+_0x2ac733[_0xa1d8('0x1f')];var _0x14b5d4;if(_0x2295b1>=_0x1053c4){_0x2295b1=_0x1053c4;_0x14b5d4=0xc8;}else{_0x14b5d4=0xce;}_0x4d1304[_0xa1d8('0x1a')](_0x14b5d4);return _0x4d1304[_0xa1d8('0x21')](_0xa1d8('0x22'),_0x1e843e+'-'+_0x2295b1+'/'+_0x1053c4)['json'](_0x3517f8);}return null;};}function patchUpdates(_0x5cee07){return function(_0x2d50fd){try{jsonpatch[_0xa1d8('0x23')](_0x2d50fd,_0x5cee07,!![]);}catch(_0x3749b4){return BPromise['reject'](_0x3749b4);}return _0x2d50fd['save']();};}function saveUpdates(_0x56e1fe,_0x384223){return function(_0x2b716e){if(_0x2b716e){return _0x2b716e['update'](_0x56e1fe)[_0xa1d8('0x24')](function(_0x14d16b){return _0x14d16b;});}return null;};}function removeEntity(_0x57d23d,_0x3bc701){return function(_0x50e366){if(_0x50e366){return _0x50e366[_0xa1d8('0x25')]()['then'](function(){_0x57d23d[_0xa1d8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c16d4,_0x277e14){return function(_0x580301){if(!_0x580301){_0x5c16d4['sendStatus'](0x194);}return _0x580301;};}function handleError(_0x4cba57,_0x3191e1){_0x3191e1=_0x3191e1||0x1f4;return function(_0x42bdf1){logger['error'](_0x42bdf1[_0xa1d8('0x26')]);if(_0x42bdf1['name']){delete _0x42bdf1[_0xa1d8('0x27')];}_0x4cba57['status'](_0x3191e1)[_0xa1d8('0x28')](_0x42bdf1);};}exports[_0xa1d8('0x29')]=function(_0x26fd80,_0x228b8d){var _0x32a78d={},_0xf5c82={},_0x3270a8={'count':0x0,'rows':[]};var _0x40bd2a=_[_0xa1d8('0x2a')](db[_0xa1d8('0x2b')][_0xa1d8('0x2c')],function(_0xc1896e){return{'name':_0xc1896e[_0xa1d8('0x2d')],'type':_0xc1896e['type'][_0xa1d8('0x2e')]};});_0xf5c82['model']=_[_0xa1d8('0x2a')](_0x40bd2a,'name');_0xf5c82[_0xa1d8('0x2f')]=_[_0xa1d8('0x30')](_0x26fd80['query']);_0xf5c82[_0xa1d8('0x31')]=_[_0xa1d8('0x32')](_0xf5c82[_0xa1d8('0x33')],_0xf5c82['query']);_0x32a78d[_0xa1d8('0x34')]=_[_0xa1d8('0x32')](_0xf5c82['model'],qs[_0xa1d8('0x35')](_0x26fd80[_0xa1d8('0x2f')]['fields']));_0x32a78d['attributes']=_0x32a78d[_0xa1d8('0x34')][_0xa1d8('0x36')]?_0x32a78d['attributes']:_0xf5c82[_0xa1d8('0x33')];if(!_0x26fd80[_0xa1d8('0x2f')][_0xa1d8('0x37')](_0xa1d8('0x38'))){_0x32a78d[_0xa1d8('0x1f')]=qs[_0xa1d8('0x1f')](_0x26fd80['query'][_0xa1d8('0x1f')]);_0x32a78d[_0xa1d8('0x1d')]=qs[_0xa1d8('0x1d')](_0x26fd80[_0xa1d8('0x2f')][_0xa1d8('0x1d')]);}_0x32a78d[_0xa1d8('0x39')]=qs[_0xa1d8('0x3a')](_0x26fd80[_0xa1d8('0x2f')][_0xa1d8('0x3a')]);_0x32a78d[_0xa1d8('0x3b')]=qs['filters'](_[_0xa1d8('0x3c')](_0x26fd80[_0xa1d8('0x2f')],_0xf5c82[_0xa1d8('0x31')]),_0x40bd2a);if(_0x26fd80[_0xa1d8('0x2f')]['filter']){_0x32a78d['where']=_[_0xa1d8('0x3d')](_0x32a78d[_0xa1d8('0x3b')],{'$or':_[_0xa1d8('0x2a')](_0x40bd2a,function(_0x52a94c){if(_0x52a94c[_0xa1d8('0x3e')]!==_0xa1d8('0x3f')){var _0x21a3b3={};_0x21a3b3[_0x52a94c[_0xa1d8('0x27')]]={'$like':'%'+_0x26fd80[_0xa1d8('0x2f')][_0xa1d8('0x40')]+'%'};return _0x21a3b3;}})});}_0x32a78d=_['merge']({},_0x32a78d,_0x26fd80['options']);var _0x58484a={'where':_0x32a78d['where']};return db[_0xa1d8('0x2b')][_0xa1d8('0x20')](_0x58484a)[_0xa1d8('0x24')](function(_0x1f5d29){_0x3270a8[_0xa1d8('0x20')]=_0x1f5d29;if(_0x26fd80[_0xa1d8('0x2f')][_0xa1d8('0x41')]){_0x32a78d['include']=[{'all':!![]}];}return db[_0xa1d8('0x2b')]['findAll'](_0x32a78d);})[_0xa1d8('0x24')](function(_0x450338){_0x3270a8[_0xa1d8('0x42')]=_0x450338;return _0x3270a8;})[_0xa1d8('0x24')](respondWithFilteredResult(_0x228b8d,_0x32a78d))[_0xa1d8('0x43')](handleError(_0x228b8d,null));};exports[_0xa1d8('0x44')]=function(_0x5b4547,_0x28cd8a){var _0x1a1ec9={'raw':!![],'where':{'id':_0x5b4547[_0xa1d8('0x45')]['id']}},_0x3f0535={};_0x3f0535[_0xa1d8('0x33')]=_[_0xa1d8('0x30')](db[_0xa1d8('0x2b')][_0xa1d8('0x2c')]);_0x3f0535[_0xa1d8('0x2f')]=_[_0xa1d8('0x30')](_0x5b4547[_0xa1d8('0x2f')]);_0x3f0535[_0xa1d8('0x31')]=_['intersection'](_0x3f0535[_0xa1d8('0x33')],_0x3f0535[_0xa1d8('0x2f')]);_0x1a1ec9[_0xa1d8('0x34')]=_[_0xa1d8('0x32')](_0x3f0535[_0xa1d8('0x33')],qs[_0xa1d8('0x35')](_0x5b4547[_0xa1d8('0x2f')][_0xa1d8('0x35')]));_0x1a1ec9[_0xa1d8('0x34')]=_0x1a1ec9[_0xa1d8('0x34')][_0xa1d8('0x36')]?_0x1a1ec9[_0xa1d8('0x34')]:_0x3f0535[_0xa1d8('0x33')];if(_0x5b4547[_0xa1d8('0x2f')][_0xa1d8('0x41')]){_0x1a1ec9[_0xa1d8('0x46')]=[{'all':!![]}];}_0x1a1ec9=_[_0xa1d8('0x3d')]({},_0x1a1ec9,_0x5b4547[_0xa1d8('0x47')]);return db[_0xa1d8('0x2b')][_0xa1d8('0x48')](_0x1a1ec9)['then'](handleEntityNotFound(_0x28cd8a,null))[_0xa1d8('0x24')](respondWithResult(_0x28cd8a,null))['catch'](handleError(_0x28cd8a,null));};exports[_0xa1d8('0x49')]=function(_0x42220b,_0x11bd79){var _0x5a8a77={'where':{'id':_0x42220b[_0xa1d8('0x45')]['id']}},_0x1d75ec={};_0x1d75ec[_0xa1d8('0x33')]=_[_0xa1d8('0x30')](db[_0xa1d8('0x2b')][_0xa1d8('0x2c')]);_0x5a8a77[_0xa1d8('0x34')]=_[_0xa1d8('0x32')](_0x1d75ec[_0xa1d8('0x33')],qs[_0xa1d8('0x35')](_0x42220b[_0xa1d8('0x2f')][_0xa1d8('0x35')]));_0x5a8a77[_0xa1d8('0x34')]=_0x5a8a77[_0xa1d8('0x34')]['length']?_0x5a8a77[_0xa1d8('0x34')]:_0x1d75ec[_0xa1d8('0x33')];if(_0x42220b[_0xa1d8('0x2f')]['includeAll']){_0x5a8a77[_0xa1d8('0x46')]=[{'all':!![]}];}_0x5a8a77=_[_0xa1d8('0x3d')]({},_0x5a8a77,_0x42220b[_0xa1d8('0x47')]);return db['Attachment']['find'](_0x5a8a77)[_0xa1d8('0x24')](handleEntityNotFound(_0x11bd79,null))[_0xa1d8('0x24')](function(_0x214dbf){if(_0x214dbf){var _0x5cf24e=_0x214dbf[_0xa1d8('0x4a')]({'plain':!![]});_0x5cf24e=qs[_0xa1d8('0x4b')](_0x5cf24e,['id',_0xa1d8('0x4c'),_0xa1d8('0x4d')]);_0x42220b[_0xa1d8('0x4e')]=_['omit'](_0x42220b['body'],['id','createdAt',_0xa1d8('0x4d')]);return db[_0xa1d8('0x2b')][_0xa1d8('0x4f')](_[_0xa1d8('0x3d')](_0x5cf24e,_0x42220b[_0xa1d8('0x4e')]),{'include':_0x42220b[_0xa1d8('0x2f')][_0xa1d8('0x41')]?[{'all':!![]}]:undefined});}})[_0xa1d8('0x24')](respondWithResult(_0x11bd79,0xc9))[_0xa1d8('0x43')](handleError(_0x11bd79,null));};exports[_0xa1d8('0x50')]=function(_0x1bb8a9,_0x461622){if(_0x1bb8a9[_0xa1d8('0x4e')]['id']){delete _0x1bb8a9[_0xa1d8('0x4e')]['id'];}return db['Attachment'][_0xa1d8('0x48')]({'where':{'id':_0x1bb8a9[_0xa1d8('0x45')]['id']}})[_0xa1d8('0x24')](handleEntityNotFound(_0x461622,null))[_0xa1d8('0x24')](saveUpdates(_0x1bb8a9[_0xa1d8('0x4e')],null))[_0xa1d8('0x24')](respondWithResult(_0x461622,null))[_0xa1d8('0x43')](handleError(_0x461622,null));};exports['destroy']=function(_0x5e4315,_0x45a991){return db[_0xa1d8('0x2b')]['find']({'where':{'id':_0x5e4315['params']['id']}})['then'](handleEntityNotFound(_0x45a991,null))[_0xa1d8('0x24')](removeEntity(_0x45a991,null))[_0xa1d8('0x43')](handleError(_0x45a991,null));};exports[_0xa1d8('0x4f')]=function(_0x2243b9,_0x394813,_0x35a574){_0x2243b9[_0xa1d8('0x4e')][_0xa1d8('0x27')]=_0x2243b9[_0xa1d8('0x51')][_0xa1d8('0x52')];_0x2243b9[_0xa1d8('0x4e')][_0xa1d8('0x53')]=_0x2243b9['file'][_0xa1d8('0x54')];_0x2243b9[_0xa1d8('0x4e')][_0xa1d8('0x3e')]=_0x2243b9['file'][_0xa1d8('0x55')];return db['Attachment']['create'](_0x2243b9[_0xa1d8('0x4e')])[_0xa1d8('0x24')](respondWithResult(_0x394813,0xc9))[_0xa1d8('0x43')](handleError(_0x394813,null));};exports[_0xa1d8('0x56')]=function(_0x18cfd5,_0x5c0cb2,_0x39db6b){return db['Attachment'][_0xa1d8('0x57')]({'where':{'id':_0x18cfd5[_0xa1d8('0x45')]['id']},'raw':!![]})[_0xa1d8('0x24')](handleEntityNotFound(_0x5c0cb2,null))[_0xa1d8('0x24')](function(_0x38a4e0){if(_0x38a4e0){var _0x56f432=_0x38a4e0[_0xa1d8('0x58')]!==null;var _0x12719e=path[_0xa1d8('0x59')](config[_0xa1d8('0x5a')],_0xa1d8('0x5b'));if(_0x56f432){_0x12719e=path[_0xa1d8('0x59')](_0x12719e,'offline-chat/');}var _0x22ca67=path[_0xa1d8('0x59')](_0x12719e,_0x38a4e0[_0xa1d8('0x53')]);return _0x5c0cb2[_0xa1d8('0x56')](_0x22ca67);}})['catch'](handleError(_0x5c0cb2,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 3d7a1b5..0696b80 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 _0xb1c7=['lodash','moment','bluebird','path','rimraf','../../config/environment','exports','define','Attachment','attachments'];(function(_0x2c690b,_0x4b42dd){var _0x8756cd=function(_0x396522){while(--_0x396522){_0x2c690b['push'](_0x2c690b['shift']());}};_0x8756cd(++_0x4b42dd);}(_0xb1c7,0x96));var _0x7b1c=function(_0x353313,_0x5c3686){_0x353313=_0x353313-0x0;var _0x4cb750=_0xb1c7[_0x353313];return _0x4cb750;};'use strict';var _=require(_0x7b1c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7b1c('0x1'));var BPromise=require(_0x7b1c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b1c('0x3'));var rimraf=require(_0x7b1c('0x4'));var config=require(_0x7b1c('0x5'));var attributes=require('./attachment.attributes');module[_0x7b1c('0x6')]=function(_0x3e7395,_0x516d3d){return _0x3e7395[_0x7b1c('0x7')](_0x7b1c('0x8'),attributes,{'tableName':_0x7b1c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfce2=['api','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','lodash','util','../../config/logger'];(function(_0x1b1266,_0xa8fd7a){var _0x48aeed=function(_0x27fc59){while(--_0x27fc59){_0x1b1266['push'](_0x1b1266['shift']());}};_0x48aeed(++_0xa8fd7a);}(_0xfce2,0xf4));var _0x2fce=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfce2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2fce('0x0'));var util=require(_0x2fce('0x1'));var logger=require(_0x2fce('0x2'))(_0x2fce('0x3'));var moment=require(_0x2fce('0x4'));var BPromise=require(_0x2fce('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2fce('0x6'));var rimraf=require(_0x2fce('0x7'));var config=require(_0x2fce('0x8'));var attributes=require(_0x2fce('0x9'));module[_0x2fce('0xa')]=function(_0x267ef2,_0x19e07c){return _0x267ef2[_0x2fce('0xb')]('Attachment',attributes,{'tableName':_0x2fce('0xc'),'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 3919b97..7a97bdb 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 _0x1b32=['http','info','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Attachment,\x20%s,\x20%s','message','result','catch','create','body','options','raw','then','CreateAttachment','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xbebf50,_0x44ec09){var _0xce1496=function(_0x1bf94d){while(--_0x1bf94d){_0xbebf50['push'](_0xbebf50['shift']());}};_0xce1496(++_0x44ec09);}(_0x1b32,0x85));var _0x21b3=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x1b32[_0x476bf4];return _0x788ffe;};'use strict';var _=require('lodash');var util=require(_0x21b3('0x0'));var moment=require(_0x21b3('0x1'));var BPromise=require(_0x21b3('0x2'));var rs=require(_0x21b3('0x3'));var fs=require('fs');var Redis=require(_0x21b3('0x4'));var db=require(_0x21b3('0x5'))['db'];var utils=require(_0x21b3('0x6'));var logger=require(_0x21b3('0x7'))(_0x21b3('0x8'));var config=require(_0x21b3('0x9'));var jayson=require(_0x21b3('0xa'));var client=jayson[_0x21b3('0xb')][_0x21b3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47516a,_0x21e881,_0x5c0f36){return new BPromise(function(_0x45b1b7,_0x5639eb){return client['request'](_0x47516a,_0x5c0f36)['then'](function(_0xd7a981){logger[_0x21b3('0xd')]('Attachment,\x20%s,\x20%s',_0x21e881,'request\x20sent');logger[_0x21b3('0xe')](_0x21b3('0xf'),_0x21e881,_0x21b3('0x10'),JSON['stringify'](_0xd7a981));if(_0xd7a981[_0x21b3('0x11')]){if(_0xd7a981[_0x21b3('0x11')][_0x21b3('0x12')]===0x1f4){logger[_0x21b3('0x11')](_0x21b3('0x13'),_0x21e881,_0xd7a981[_0x21b3('0x11')][_0x21b3('0x14')]);return _0x5639eb(_0xd7a981[_0x21b3('0x11')][_0x21b3('0x14')]);}logger['error'](_0x21b3('0x13'),_0x21e881,_0xd7a981[_0x21b3('0x11')][_0x21b3('0x14')]);return _0x45b1b7(_0xd7a981['error'][_0x21b3('0x14')]);}else{logger['info'](_0x21b3('0x13'),_0x21e881,'request\x20sent');_0x45b1b7(_0xd7a981[_0x21b3('0x15')][_0x21b3('0x14')]);}})[_0x21b3('0x16')](function(_0x4217d6){logger['error'](_0x21b3('0x13'),_0x21e881,_0x4217d6);_0x5639eb(_0x4217d6);});});}exports['CreateAttachment']=function(_0x408c17){var _0x2af6e4=this;return new Promise(function(_0xaf1eba,_0x21921b){return db['Attachment'][_0x21b3('0x17')](_0x408c17[_0x21b3('0x18')],{'raw':_0x408c17[_0x21b3('0x19')]?_0x408c17['options'][_0x21b3('0x1a')]===undefined?!![]:![]:!![]})[_0x21b3('0x1b')](function(_0x2f996d){logger[_0x21b3('0xd')](_0x21b3('0x1c'),_0x408c17);logger[_0x21b3('0xe')](_0x21b3('0x1c'),_0x408c17,JSON['stringify'](_0x2f996d));_0xaf1eba(_0x2f996d);})[_0x21b3('0x16')](function(_0x54695b){logger[_0x21b3('0x11')](_0x21b3('0x1c'),_0x54695b[_0x21b3('0x14')],_0x408c17);_0x21921b(_0x2af6e4['error'](0x1f4,_0x54695b[_0x21b3('0x14')]));});});};
\ No newline at end of file
+var _0x21a3=['Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Attachment','create','body','options','raw','CreateAttachment','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x21a3,0x66));var _0x321a=function(_0x22e101,_0x412840){_0x22e101=_0x22e101-0x0;var _0xa51f61=_0x21a3[_0x22e101];return _0xa51f61;};'use strict';var _=require(_0x321a('0x0'));var util=require('util');var moment=require(_0x321a('0x1'));var BPromise=require(_0x321a('0x2'));var rs=require(_0x321a('0x3'));var fs=require('fs');var Redis=require(_0x321a('0x4'));var db=require(_0x321a('0x5'))['db'];var utils=require(_0x321a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x321a('0x7'));var jayson=require(_0x321a('0x8'));var client=jayson[_0x321a('0x9')][_0x321a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f3b81,_0x388901,_0x24a04c){return new BPromise(function(_0x10c1d3,_0xdfd6b8){return client[_0x321a('0xb')](_0x5f3b81,_0x24a04c)[_0x321a('0xc')](function(_0x2c52dc){logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,_0x321a('0xf'));logger[_0x321a('0x10')](_0x321a('0x11'),_0x388901,'request\x20sent',JSON[_0x321a('0x12')](_0x2c52dc));if(_0x2c52dc[_0x321a('0x13')]){if(_0x2c52dc['error']['code']===0x1f4){logger[_0x321a('0x13')]('Attachment,\x20%s,\x20%s',_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0xdfd6b8(_0x2c52dc['error']['message']);}logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0x10c1d3(_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);}else{logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,'request\x20sent');_0x10c1d3(_0x2c52dc[_0x321a('0x15')][_0x321a('0x14')]);}})['catch'](function(_0x45ceb2){logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x45ceb2);_0xdfd6b8(_0x45ceb2);});});}exports['CreateAttachment']=function(_0x5b1810){var _0x464bd7=this;return new Promise(function(_0x35fd6f,_0x58595b){return db[_0x321a('0x16')][_0x321a('0x17')](_0x5b1810[_0x321a('0x18')],{'raw':_0x5b1810['options']?_0x5b1810[_0x321a('0x19')][_0x321a('0x1a')]===undefined?!![]:![]:!![]})[_0x321a('0xc')](function(_0x423cb8){logger[_0x321a('0xd')](_0x321a('0x1b'),_0x5b1810);logger[_0x321a('0x10')](_0x321a('0x1b'),_0x5b1810,JSON[_0x321a('0x12')](_0x423cb8));_0x35fd6f(_0x423cb8);})[_0x321a('0x1c')](function(_0x1b94a1){logger[_0x321a('0x13')]('CreateAttachment',_0x1b94a1[_0x321a('0x14')],_0x5b1810);_0x58595b(_0x464bd7[_0x321a('0x13')](0x1f4,_0x1b94a1[_0x321a('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 5246966..0d66c20 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 _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(_0x39908d,_0x375620){var _0x592f52=function(_0x4425e4){while(--_0x4425e4){_0x39908d['push'](_0x39908d['shift']());}};_0x592f52(++_0x375620);}(_0xb10b,0x12a));var _0xbb10=function(_0x28f153,_0x4852ed){_0x28f153=_0x28f153-0x0;var _0x56b861=_0xb10b[_0x28f153];return _0x56b861;};'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
+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(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x0b0e[_0x45d55e];return _0x29812a;};'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
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index c5e3433..6b31fab 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 _0x5b25=['../../config/utils','login','authenticate','google','/login','profile','email','callback','use','clientSecret','secret','callbackURL','Setting','findOne','blockDuration','then','map','value','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken'];(function(_0x3af288,_0x1a9c9c){var _0x55d2a4=function(_0x4d0677){while(--_0x4d0677){_0x3af288['push'](_0x3af288['shift']());}};_0x55d2a4(++_0x1a9c9c);}(_0x5b25,0x88));var _0x55b2=function(_0x1256ca,_0x29a6c2){_0x1256ca=_0x1256ca-0x0;var _0x55fa8c=_0x5b25[_0x1256ca];return _0x55fa8c;};'use strict';var _=require(_0x55b2('0x0'));var passport=require(_0x55b2('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0x55b2('0x2')];var moment=require(_0x55b2('0x3'));var db=require(_0x55b2('0x4'))['db'];var config=require(_0x55b2('0x5'));var signToken=require(_0x55b2('0x6'))[_0x55b2('0x7')];var utils=require(_0x55b2('0x8'));exports[_0x55b2('0x9')]=passport[_0x55b2('0xa')](_0x55b2('0xb'),{'failureRedirect':_0x55b2('0xc'),'scope':[_0x55b2('0xd'),_0x55b2('0xe')],'session':![]});exports[_0x55b2('0xf')]=passport['authenticate']('google',{'failureRedirect':'/login','session':![]});passport[_0x55b2('0x10')](new GoogleStrategy({'clientID':config[_0x55b2('0xb')]?config['google']['clientID']:'id','clientSecret':config[_0x55b2('0xb')]?config[_0x55b2('0xb')][_0x55b2('0x11')]:_0x55b2('0x12'),'callbackURL':config[_0x55b2('0xb')]?config[_0x55b2('0xb')][_0x55b2('0x13')]:''},function(_0x36beed,_0x3b5c15,_0x480b67,_0x49dd9b){var _0x409cbc,_0x2a7edd;return db[_0x55b2('0x14')][_0x55b2('0x15')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x55b2('0x16')],'raw':!![]})[_0x55b2('0x17')](function(_0x45c9c4){_0x409cbc=_0x45c9c4;return db['User']['find']({'where':{'email':_[_0x55b2('0x18')](_0x480b67['emails'],_0x55b2('0x19')),'role':{'$or':['admin','user',_0x55b2('0x1a')]}}});})['then'](function(_0x16b340){_0x2a7edd=_0x16b340;if(_0x2a7edd){if(_0x2a7edd[_0x55b2('0x1b')]){return _0x49dd9b(_0x55b2('0x1c'));}else if(_0x409cbc['blockDuration']>0x0){if(_0x2a7edd[_0x55b2('0x1d')]){if(moment(_0x2a7edd[_0x55b2('0x1e')])[_0x55b2('0x1f')](_0x409cbc[_0x55b2('0x16')],_0x55b2('0x20'))>moment()){return _0x49dd9b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x55b2('0x21')](_0x2a7edd,0x0,![],null)['then'](function(){return utils[_0x55b2('0x22')](_0x2a7edd);})[_0x55b2('0x17')](function(){return _0x49dd9b(null,_0x2a7edd);});}}else{return utils[_0x55b2('0x22')](_0x2a7edd)[_0x55b2('0x17')](function(){return _0x49dd9b(null,_0x2a7edd);});}}else{return utils['getLicense'](_0x2a7edd)[_0x55b2('0x17')](function(){return _0x49dd9b(null,_0x2a7edd);});}}return _0x49dd9b(_0x55b2('0x1c'));})[_0x55b2('0x23')](function(_0x505c4c){_0x49dd9b(_0x505c4c);});}));
\ No newline at end of file
+var _0x2d90=['clientID','clientSecret','secret','Setting','findOne','blockDuration','then','User','find','emails','value','user','agent','disabled','blocked','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','login','google','/login','profile','email','callback'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x2d90,0x1a1));var _0x02d9=function(_0x3d82af,_0x5a703d){_0x3d82af=_0x3d82af-0x0;var _0x22de45=_0x2d90[_0x3d82af];return _0x22de45;};'use strict';var _=require(_0x02d9('0x0'));var passport=require(_0x02d9('0x1'));var GoogleStrategy=require(_0x02d9('0x2'))[_0x02d9('0x3')];var moment=require(_0x02d9('0x4'));var db=require(_0x02d9('0x5'))['db'];var config=require(_0x02d9('0x6'));var signToken=require('../../components/auth/service')[_0x02d9('0x7')];var utils=require(_0x02d9('0x8'));exports[_0x02d9('0x9')]=passport['authenticate'](_0x02d9('0xa'),{'failureRedirect':_0x02d9('0xb'),'scope':[_0x02d9('0xc'),_0x02d9('0xd')],'session':![]});exports[_0x02d9('0xe')]=passport['authenticate']('google',{'failureRedirect':_0x02d9('0xb'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x02d9('0xa')]?config[_0x02d9('0xa')][_0x02d9('0xf')]:'id','clientSecret':config[_0x02d9('0xa')]?config[_0x02d9('0xa')][_0x02d9('0x10')]:_0x02d9('0x11'),'callbackURL':config['google']?config[_0x02d9('0xa')]['callbackURL']:''},function(_0x18883b,_0x1f5a46,_0xc0254e,_0x113d00){var _0x2c6f59,_0x2fc789;return db[_0x02d9('0x12')][_0x02d9('0x13')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x02d9('0x14')],'raw':!![]})[_0x02d9('0x15')](function(_0xb07f0d){_0x2c6f59=_0xb07f0d;return db[_0x02d9('0x16')][_0x02d9('0x17')]({'where':{'email':_['map'](_0xc0254e[_0x02d9('0x18')],_0x02d9('0x19')),'role':{'$or':['admin',_0x02d9('0x1a'),_0x02d9('0x1b')]}}});})[_0x02d9('0x15')](function(_0x65201b){_0x2fc789=_0x65201b;if(_0x2fc789){if(_0x2fc789[_0x02d9('0x1c')]){return _0x113d00('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x2c6f59[_0x02d9('0x14')]>0x0){if(_0x2fc789[_0x02d9('0x1d')]){if(moment(_0x2fc789[_0x02d9('0x1e')])[_0x02d9('0x1f')](_0x2c6f59[_0x02d9('0x14')],_0x02d9('0x20'))>moment()){return _0x113d00(_0x02d9('0x21'));}else{return utils[_0x02d9('0x22')](_0x2fc789,0x0,![],null)['then'](function(){return utils[_0x02d9('0x23')](_0x2fc789);})[_0x02d9('0x15')](function(){return _0x113d00(null,_0x2fc789);});}}else{return utils[_0x02d9('0x23')](_0x2fc789)[_0x02d9('0x15')](function(){return _0x113d00(null,_0x2fc789);});}}else{return utils[_0x02d9('0x23')](_0x2fc789)['then'](function(){return _0x113d00(null,_0x2fc789);});}}return _0x113d00('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})['catch'](function(_0x420c34){_0x113d00(_0x420c34);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 919c0ce..f23e26f 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 _0x33d8=['get','callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x33d8,0x1a7));var _0x833d=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x33d8[_0x4b055c];return _0x4b62bb;};'use strict';var express=require('express');var passport=require(_0x833d('0x0'));var router=express[_0x833d('0x1')]();var controller=require(_0x833d('0x2'));var userController=require(_0x833d('0x3'));var authService=require(_0x833d('0x4'));router['get']('/',controller[_0x833d('0x5')]);router[_0x833d('0x6')]('/callback',controller[_0x833d('0x7')],authService[_0x833d('0x8')],userController[_0x833d('0x5')],authService[_0x833d('0x9')]);module[_0x833d('0xa')]=router;
\ No newline at end of file
+var _0x8a9c=['exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','login','/callback','callback','isMiddleware','setTokenCookie'];(function(_0x900da4,_0x3857fa){var _0x2e6bdb=function(_0x31204c){while(--_0x31204c){_0x900da4['push'](_0x900da4['shift']());}};_0x2e6bdb(++_0x3857fa);}(_0x8a9c,0x12d));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xc8a9('0x0'));var passport=require(_0xc8a9('0x1'));var router=express[_0xc8a9('0x2')]();var controller=require(_0xc8a9('0x3'));var userController=require(_0xc8a9('0x4'));var authService=require('../../components/auth/service');router[_0xc8a9('0x5')]('/',controller[_0xc8a9('0x6')]);router['get'](_0xc8a9('0x7'),controller[_0xc8a9('0x8')],authService[_0xc8a9('0x9')],userController['login'],authService[_0xc8a9('0xa')]);module[_0xc8a9('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 f4f3f52..af692d5 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 _0x2289=['minutes','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','send','Reset\x20Email\x20sent!','reset','params','token','now','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','blockDuration','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','clearBlockUser','getLicense','catch','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','login','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x2fa946,_0x4e1f6e){var _0x4ed01c=function(_0x4ed8df){while(--_0x4ed8df){_0x2fa946['push'](_0x2fa946['shift']());}};_0x4ed01c(++_0x4e1f6e);}(_0x2289,0xc6));var _0x9228=function(_0xd31621,_0x17b567){_0xd31621=_0xd31621-0x0;var _0x2e7ac0=_0x2289[_0xd31621];return _0x2e7ac0;};'use strict';var util=require(_0x9228('0x0'));var passport=require(_0x9228('0x1'));var LocalStrategy=require(_0x9228('0x2'))['Strategy'];var jayson=require(_0x9228('0x3'));var _=require(_0x9228('0x4'));var rs=require(_0x9228('0x5'));var moment=require('moment');var db=require(_0x9228('0x6'))['db'];var authService=require(_0x9228('0x7'));var utils=require(_0x9228('0x8'));var client=jayson[_0x9228('0x9')][_0x9228('0xa')]({'port':0x232b});function localAuthenticate(_0x22c518,_0x4c6591,_0x2c8859,_0x4ccf04){var _0x1497a5,_0x39aec2;return db[_0x9228('0xb')][_0x9228('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x9228('0xd')],'raw':!![]})['then'](function(_0x34ce70){_0x1497a5=_0x34ce70;return _0x22c518[_0x9228('0xc')]({'attributes':['id',_0x9228('0xe'),_0x9228('0xf'),_0x9228('0x10'),_0x9228('0x11'),_0x9228('0x12'),_0x9228('0x13'),_0x9228('0x14'),_0x9228('0x15')],'where':{'name':_0x4c6591,'role':{'$or':[_0x9228('0x16'),_0x9228('0x17'),_0x9228('0x18')]}}});})[_0x9228('0x19')](function(_0x99f523){if(!_0x99f523||_0x99f523&&_0x99f523['name']!==_0x4c6591){throw new Error(_0x9228('0x1a'));}else{_0x39aec2=_0x99f523;return _0x39aec2;}})[_0x9228('0x19')](function(){_0x39aec2['authenticate'](_0x2c8859,function(_0x920bad,_0x2efcaf){var _0x18e348=_0x39aec2['loginAttempts']+0x1;if(_0x920bad){return _0x4ccf04(_0x920bad);}else if(!_0x2efcaf){if(_0x39aec2[_0x9228('0x12')]){return _0x4ccf04(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1497a5[_0x9228('0x1b')]>0x0){if(_0x39aec2[_0x9228('0x13')]){if(_0x1497a5[_0x9228('0xd')]>0x0){if(moment(_0x39aec2[_0x9228('0x14')])[_0x9228('0x1c')](_0x1497a5[_0x9228('0xd')],'minutes')>moment()){return _0x4ccf04(null,![],{'message':_0x9228('0x1a')});}else{return utils[_0x9228('0x1d')](_0x39aec2,_0x18e348,![],null)[_0x9228('0x19')](function(){return _0x4ccf04(null,![],{'message':_0x9228('0x1a')});});}}else{return _0x4ccf04(null,![],{'message':_0x9228('0x1a')});}}else{if(_0x18e348>=_0x1497a5[_0x9228('0x1b')]){return utils[_0x9228('0x1d')](_0x39aec2,0x0,!![],moment())[_0x9228('0x19')](function(){return _0x4ccf04(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x9228('0x1d')](_0x39aec2,_0x18e348,![],null)[_0x9228('0x19')](function(){return _0x4ccf04(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x4ccf04(null,![],{'message':_0x9228('0x1a')});}}else{if(_0x39aec2['disabled']){return _0x4ccf04(null,![],{'message':_0x9228('0x1a')});}else if(_0x1497a5[_0x9228('0x1b')]>0x0){if(_0x39aec2[_0x9228('0x13')]){if(_0x1497a5[_0x9228('0xd')]>0x0){if(moment(_0x39aec2[_0x9228('0x14')])[_0x9228('0x1c')](_0x1497a5[_0x9228('0xd')],'minutes')>moment()){return _0x4ccf04(null,![],{'message':_0x9228('0x1a')});}else{return utils['clearBlockUser'](_0x39aec2,0x0,![],null)[_0x9228('0x19')](function(){return utils[_0x9228('0x1e')](_0x39aec2);})[_0x9228('0x19')](function(){return _0x4ccf04(null,_0x39aec2);});}}else{return _0x4ccf04(null,![],{'message':_0x9228('0x1a')});}}else{return utils['clearBlockUser'](_0x39aec2,0x0,![],null)[_0x9228('0x19')](function(){return utils[_0x9228('0x1e')](_0x39aec2);})['then'](function(){return _0x4ccf04(null,_0x39aec2);})[_0x9228('0x1f')](function(_0x57bb35){return _0x4ccf04(null,![],_0x57bb35);});}}else{if(_0x39aec2['blocked']){return _0x4ccf04(null,![],{'message':_0x9228('0x1a')});}else{return utils['getLicense'](_0x39aec2)['then'](function(){return _0x4ccf04(null,_0x39aec2);});}}}});})[_0x9228('0x1f')](function(_0x5d21aa){return _0x4ccf04(null,![],_0x5d21aa);});}function sendServiceMail(_0x4fe67b){return db['MailAccount'][_0x9228('0x20')]({'where':{'service':!![]},'attributes':['id',_0x9228('0xe'),_0x9228('0x21')],'include':[{'model':db['MailServerOut'],'as':_0x9228('0x22')}]})[_0x9228('0x19')](function(_0x484a38){if(!_0x484a38){throw new Error(_0x9228('0x23'));}var _0x20aecc={'tls':{'rejectUnauthorized':![]}};if(_0x484a38[_0x9228('0x22')]['service']){_0x20aecc[_0x9228('0x24')]=_0x484a38[_0x9228('0x22')][_0x9228('0x24')];}else{_0x20aecc[_0x9228('0x25')]=_0x484a38[_0x9228('0x22')][_0x9228('0x25')];_0x20aecc[_0x9228('0x26')]=_0x484a38[_0x9228('0x22')]['port'];_0x20aecc[_0x9228('0x27')]=_0x484a38[_0x9228('0x22')][_0x9228('0x27')];}if(_0x484a38['Smtp']['authentication']){_0x20aecc['auth']={'user':_0x484a38[_0x9228('0x22')][_0x9228('0x17')],'pass':_0x484a38[_0x9228('0x22')][_0x9228('0x28')]};}var _0x4050bc={'account':_0x20aecc,'message':_[_0x9228('0x29')]({'from':util[_0x9228('0x2a')](_0x9228('0x2b'),_0x484a38['name'],_0x484a38[_0x9228('0x21')]||_0x484a38[_0x9228('0x22')][_0x9228('0x17')])},_0x4fe67b)};return client[_0x9228('0x2c')](_0x9228('0x2d'),_0x4050bc);})[_0x9228('0x19')](function(_0xffc4ca){if(_0xffc4ca['error']){throw new Error(util['format'](_0x9228('0x2e'),_0xffc4ca[_0x9228('0x2f')][_0x9228('0x30')]||JSON[_0x9228('0x31')](_0xffc4ca[_0x9228('0x2f')])));}return!![];});}function handleError(_0x58e786,_0xd81775,_0x4fa2f3){return _0x58e786[_0x9228('0x32')](_0xd81775||0x1f4)['send']({'message':_0x4fa2f3?_0x4fa2f3[_0x9228('0x30')]||_0x4fa2f3:''});}exports[_0x9228('0x33')]=function(_0x367646,_0x28368d,_0x30c27d){passport[_0x9228('0x34')](_0x9228('0x35'),function(_0xbbe1ab,_0x3467a2,_0xab223a){var _0xd25fb1=_0xbbe1ab||_0xab223a;if(_0xd25fb1){return handleError(_0x28368d,0x191,_0xd25fb1);}if(!_0x3467a2){return handleError(_0x28368d,0x194,{'message':_0x9228('0x36')});}else{var _0x668af4={'payload':{'id':_0x3467a2['id'],'role':_0x3467a2[_0x9228('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x9228('0x37')](_0x668af4)[_0x9228('0x19')](function(_0x5d194e){_0x28368d[_0x9228('0x38')]({'id':_0x3467a2['id'],'token':_0x5d194e,'statusCall':'','isAlreadyLogged':_0x3467a2[_0x9228('0x39')]});});}})(_0x367646,_0x28368d,_0x30c27d);};exports[_0x9228('0x3a')]=function(_0x31d16e,_0xd5ad24,_0x649f33){if(!_0x31d16e[_0x9228('0x3b')]['email']){return handleError(_0xd5ad24,0x1f4,{'message':_0x9228('0x3c')});}var _0x2e1557=rs[_0x9228('0x3d')]();_0x31d16e[_0x9228('0x3b')][_0x9228('0x21')]=_0x31d16e[_0x9228('0x3b')][_0x9228('0x21')][_0x9228('0x3e')]()[_0x9228('0x3f')]();var _0x3c5792;return db[_0x9228('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x9228('0x1b'),_0x9228('0xd')],'raw':!![]})[_0x9228('0x19')](function(_0x5133e2){_0x3c5792=_0x5133e2;return db[_0x9228('0x40')][_0x9228('0x20')]({'where':{'email':_0x31d16e[_0x9228('0x3b')][_0x9228('0x21')]}});})['then'](function(_0xed9a0b){if(!_0xed9a0b){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0xed9a0b[_0x9228('0x12')]){throw new Error(_0x9228('0x41'));}if(_0xed9a0b[_0x9228('0x13')]){if(moment(_0xed9a0b['blockedAt'])[_0x9228('0x1c')](_0x3c5792[_0x9228('0xd')],_0x9228('0x42'))>moment()){throw new Error(_0x9228('0x43'));}else{_0xed9a0b['blocked']=![];_0xed9a0b['blockedAt']=null;}}_0xed9a0b[_0x9228('0x44')]=_0x2e1557;_0xed9a0b[_0x9228('0x45')]=Date['now']()+0x36ee80;return _0xed9a0b['save']();})[_0x9228('0x19')](function(){return sendServiceMail({'to':_0x31d16e[_0x9228('0x3b')]['email'],'subject':_0x9228('0x46'),'text':_0x9228('0x47')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x9228('0x48')+_0x31d16e[_0x9228('0x49')][_0x9228('0x25')]+'/reset/'+_0x2e1557+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x9228('0x19')](function(){_0xd5ad24['status'](0xc8)[_0x9228('0x4a')]({'message':_0x9228('0x4b')});})['catch'](function(_0x1b22a8){return handleError(_0xd5ad24,0x1f4,_0x1b22a8);});};exports[_0x9228('0x4c')]=function(_0x2b7c58,_0xdada7a,_0x15334a){return db[_0x9228('0x40')][_0x9228('0x20')]({'where':{'resetPasswordToken':_0x2b7c58[_0x9228('0x4d')][_0x9228('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x9228('0x4f')]()}}})[_0x9228('0x19')](function(_0x100802){if(!_0x100802){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x9228('0xb')]['findOne']({'attributes':['id',_0x9228('0x50'),_0x9228('0x51'),_0x9228('0x52')]})[_0x9228('0x19')](function(_0x5240a9){if(_0x5240a9[_0x9228('0x50')])authService['validatePasswordPattern'](_0x2b7c58[_0x9228('0x3b')][_0x9228('0xf')]);if(!_0x5240a9['enforcePasswordHistory']||!_0x100802[_0x9228('0x53')])return _0x100802;authService[_0x9228('0x54')](_0x2b7c58[_0x9228('0x3b')][_0x9228('0xf')],_0x100802[_0x9228('0x53')],_0x5240a9['passwordHistoryLimit']);return _0x100802;})[_0x9228('0x19')](function(){_0x100802[_0x9228('0xf')]=_0x2b7c58['body'][_0x9228('0xf')];_0x100802['resetPasswordToken']=null;_0x100802['resetPasswordExpires']=null;return _0x100802[_0x9228('0x55')]();});})['then'](function(){_0xdada7a['status'](0xc8)[_0x9228('0x4a')]({'message':_0x9228('0x56')});})[_0x9228('0x1f')](function(_0x426e11){return handleError(_0xdada7a,0x1f4,_0x426e11);});};passport[_0x9228('0x57')](new LocalStrategy({'usernameField':'name','passwordField':_0x9228('0xf')},function(_0x59029d,_0xaad680,_0x113e5e){return localAuthenticate(db[_0x9228('0x40')],_0x59029d,_0xaad680,_0x113e5e);}));
\ No newline at end of file
+var _0x1af7=['login','local','role','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordHistory','util','passport','passport-local','Strategy','lodash','moment','../../mysqldb','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','clearBlockUser','minutes','getLicense','catch','find','email','MailServerOut','Smtp','service','host','port','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify'];(function(_0x4207f4,_0x1f778b){var _0x29a621=function(_0xa6f5b7){while(--_0xa6f5b7){_0x4207f4['push'](_0x4207f4['shift']());}};_0x29a621(++_0x1f778b);}(_0x1af7,0x1b8));var _0x71af=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1af7[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0x71af('0x0'));var passport=require(_0x71af('0x1'));var LocalStrategy=require(_0x71af('0x2'))[_0x71af('0x3')];var jayson=require('jayson/promise');var _=require(_0x71af('0x4'));var rs=require('randomstring');var moment=require(_0x71af('0x5'));var db=require(_0x71af('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson['client'][_0x71af('0x7')]({'port':0x232b});function localAuthenticate(_0x5510f7,_0x1af506,_0x5e0fdf,_0x3cec6f){var _0x5868c0,_0x47fad8;return db[_0x71af('0x8')][_0x71af('0x9')]({'where':{'id':0x1},'attributes':[_0x71af('0xa'),'blockDuration'],'raw':!![]})[_0x71af('0xb')](function(_0x57c0c0){_0x5868c0=_0x57c0c0;return _0x5510f7[_0x71af('0x9')]({'attributes':['id',_0x71af('0xc'),_0x71af('0xd'),_0x71af('0xe'),'role','disabled',_0x71af('0xf'),_0x71af('0x10'),_0x71af('0x11')],'where':{'name':_0x1af506,'role':{'$or':[_0x71af('0x12'),_0x71af('0x13'),_0x71af('0x14')]}}});})[_0x71af('0xb')](function(_0x4aab00){if(!_0x4aab00||_0x4aab00&&_0x4aab00[_0x71af('0xc')]!==_0x1af506){throw new Error(_0x71af('0x15'));}else{_0x47fad8=_0x4aab00;return _0x47fad8;}})[_0x71af('0xb')](function(){_0x47fad8[_0x71af('0x16')](_0x5e0fdf,function(_0x3002ec,_0xa5c8b9){var _0x5cd36a=_0x47fad8[_0x71af('0x11')]+0x1;if(_0x3002ec){return _0x3cec6f(_0x3002ec);}else if(!_0xa5c8b9){if(_0x47fad8['disabled']){return _0x3cec6f(null,![],{'message':_0x71af('0x15')});}else if(_0x5868c0[_0x71af('0xa')]>0x0){if(_0x47fad8['blocked']){if(_0x5868c0[_0x71af('0x17')]>0x0){if(moment(_0x47fad8['blockedAt'])[_0x71af('0x18')](_0x5868c0[_0x71af('0x17')],'minutes')>moment()){return _0x3cec6f(null,![],{'message':_0x71af('0x15')});}else{return utils['clearBlockUser'](_0x47fad8,_0x5cd36a,![],null)['then'](function(){return _0x3cec6f(null,![],{'message':_0x71af('0x15')});});}}else{return _0x3cec6f(null,![],{'message':_0x71af('0x15')});}}else{if(_0x5cd36a>=_0x5868c0[_0x71af('0xa')]){return utils[_0x71af('0x19')](_0x47fad8,0x0,!![],moment())[_0x71af('0xb')](function(){return _0x3cec6f(null,![],{'message':_0x71af('0x15')});});}else{return utils['clearBlockUser'](_0x47fad8,_0x5cd36a,![],null)[_0x71af('0xb')](function(){return _0x3cec6f(null,![],{'message':_0x71af('0x15')});});}}}else{return _0x3cec6f(null,![],{'message':_0x71af('0x15')});}}else{if(_0x47fad8['disabled']){return _0x3cec6f(null,![],{'message':_0x71af('0x15')});}else if(_0x5868c0[_0x71af('0xa')]>0x0){if(_0x47fad8['blocked']){if(_0x5868c0[_0x71af('0x17')]>0x0){if(moment(_0x47fad8[_0x71af('0x10')])[_0x71af('0x18')](_0x5868c0[_0x71af('0x17')],_0x71af('0x1a'))>moment()){return _0x3cec6f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x47fad8,0x0,![],null)[_0x71af('0xb')](function(){return utils[_0x71af('0x1b')](_0x47fad8);})[_0x71af('0xb')](function(){return _0x3cec6f(null,_0x47fad8);});}}else{return _0x3cec6f(null,![],{'message':_0x71af('0x15')});}}else{return utils['clearBlockUser'](_0x47fad8,0x0,![],null)[_0x71af('0xb')](function(){return utils[_0x71af('0x1b')](_0x47fad8);})[_0x71af('0xb')](function(){return _0x3cec6f(null,_0x47fad8);})[_0x71af('0x1c')](function(_0xa5e756){return _0x3cec6f(null,![],_0xa5e756);});}}else{if(_0x47fad8['blocked']){return _0x3cec6f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x47fad8)[_0x71af('0xb')](function(){return _0x3cec6f(null,_0x47fad8);});}}}});})['catch'](function(_0xabf4d6){return _0x3cec6f(null,![],_0xabf4d6);});}function sendServiceMail(_0x299a60){return db['MailAccount'][_0x71af('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x71af('0xc'),_0x71af('0x1e')],'include':[{'model':db[_0x71af('0x1f')],'as':_0x71af('0x20')}]})[_0x71af('0xb')](function(_0x4a4493){if(!_0x4a4493){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x484b98={'tls':{'rejectUnauthorized':![]}};if(_0x4a4493[_0x71af('0x20')][_0x71af('0x21')]){_0x484b98['service']=_0x4a4493[_0x71af('0x20')][_0x71af('0x21')];}else{_0x484b98['host']=_0x4a4493[_0x71af('0x20')][_0x71af('0x22')];_0x484b98[_0x71af('0x23')]=_0x4a4493[_0x71af('0x20')][_0x71af('0x23')];_0x484b98['secure']=_0x4a4493[_0x71af('0x20')]['secure'];}if(_0x4a4493['Smtp'][_0x71af('0x24')]){_0x484b98[_0x71af('0x25')]={'user':_0x4a4493[_0x71af('0x20')][_0x71af('0x13')],'pass':_0x4a4493[_0x71af('0x20')][_0x71af('0x26')]};}var _0x534ec4={'account':_0x484b98,'message':_[_0x71af('0x27')]({'from':util[_0x71af('0x28')](_0x71af('0x29'),_0x4a4493[_0x71af('0xc')],_0x4a4493[_0x71af('0x1e')]||_0x4a4493['Smtp'][_0x71af('0x13')])},_0x299a60)};return client['request'](_0x71af('0x2a'),_0x534ec4);})['then'](function(_0x4d5d83){if(_0x4d5d83[_0x71af('0x2b')]){throw new Error(util[_0x71af('0x28')](_0x71af('0x2c'),_0x4d5d83[_0x71af('0x2b')]['message']||JSON[_0x71af('0x2d')](_0x4d5d83[_0x71af('0x2b')])));}return!![];});}function handleError(_0x55ab2a,_0x9ea37b,_0x3319fd){return _0x55ab2a['status'](_0x9ea37b||0x1f4)['send']({'message':_0x3319fd?_0x3319fd['message']||_0x3319fd:''});}exports[_0x71af('0x2e')]=function(_0x2351ad,_0x6cd89f,_0x2bbcc3){passport[_0x71af('0x16')](_0x71af('0x2f'),function(_0x53d327,_0x51d5e8,_0x6b3a36){var _0x50e3fe=_0x53d327||_0x6b3a36;if(_0x50e3fe){return handleError(_0x6cd89f,0x191,_0x50e3fe);}if(!_0x51d5e8){return handleError(_0x6cd89f,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3594cd={'payload':{'id':_0x51d5e8['id'],'role':_0x51d5e8[_0x71af('0x30')]},'options':{'expiresIn':0x15180}};return authService[_0x71af('0x31')](_0x3594cd)[_0x71af('0xb')](function(_0x2f7cb5){_0x6cd89f[_0x71af('0x32')]({'id':_0x51d5e8['id'],'token':_0x2f7cb5,'statusCall':'','isAlreadyLogged':_0x51d5e8[_0x71af('0x33')]});});}})(_0x2351ad,_0x6cd89f,_0x2bbcc3);};exports[_0x71af('0x34')]=function(_0x40ff09,_0x4a8ded,_0x338906){if(!_0x40ff09[_0x71af('0x35')][_0x71af('0x1e')]){return handleError(_0x4a8ded,0x1f4,{'message':_0x71af('0x36')});}var _0x45b063=rs[_0x71af('0x37')]();_0x40ff09[_0x71af('0x35')][_0x71af('0x1e')]=_0x40ff09[_0x71af('0x35')][_0x71af('0x1e')]['trim']()[_0x71af('0x38')]();var _0x4594e0;return db[_0x71af('0x8')][_0x71af('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x71af('0x17')],'raw':!![]})[_0x71af('0xb')](function(_0x425059){_0x4594e0=_0x425059;return db[_0x71af('0x39')][_0x71af('0x1d')]({'where':{'email':_0x40ff09[_0x71af('0x35')][_0x71af('0x1e')]}});})['then'](function(_0x372755){if(!_0x372755){throw new Error(_0x71af('0x3a'));}if(_0x372755['disabled']){throw new Error(_0x71af('0x3b'));}if(_0x372755[_0x71af('0xf')]){if(moment(_0x372755['blockedAt'])['add'](_0x4594e0['blockDuration'],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x372755['blocked']=![];_0x372755[_0x71af('0x10')]=null;}}_0x372755[_0x71af('0x3c')]=_0x45b063;_0x372755[_0x71af('0x3d')]=Date['now']()+0x36ee80;return _0x372755[_0x71af('0x3e')]();})[_0x71af('0xb')](function(){return sendServiceMail({'to':_0x40ff09[_0x71af('0x35')]['email'],'subject':_0x71af('0x3f'),'text':_0x71af('0x40')+_0x71af('0x41')+_0x71af('0x42')+_0x40ff09['headers'][_0x71af('0x22')]+_0x71af('0x43')+_0x45b063+'\x0a\x0a'+_0x71af('0x44')});})[_0x71af('0xb')](function(){_0x4a8ded[_0x71af('0x45')](0xc8)[_0x71af('0x46')]({'message':_0x71af('0x47')});})[_0x71af('0x1c')](function(_0x5879ae){return handleError(_0x4a8ded,0x1f4,_0x5879ae);});};exports[_0x71af('0x48')]=function(_0x9cc6db,_0x1c016d,_0x506e08){return db[_0x71af('0x39')][_0x71af('0x1d')]({'where':{'resetPasswordToken':_0x9cc6db[_0x71af('0x49')][_0x71af('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x71af('0x4b')]()}}})[_0x71af('0xb')](function(_0x19222d){if(!_0x19222d){throw new Error(_0x71af('0x4c'));}return db[_0x71af('0x8')][_0x71af('0x9')]({'attributes':['id','securePassword',_0x71af('0x4d'),_0x71af('0x4e')]})[_0x71af('0xb')](function(_0xf8655){if(_0xf8655[_0x71af('0x4f')])authService['validatePasswordPattern'](_0x9cc6db[_0x71af('0x35')][_0x71af('0xd')]);if(!_0xf8655[_0x71af('0x4d')]||!_0x19222d['previousPasswords'])return _0x19222d;authService[_0x71af('0x50')](_0x9cc6db[_0x71af('0x35')][_0x71af('0xd')],_0x19222d['previousPasswords'],_0xf8655[_0x71af('0x4e')]);return _0x19222d;})[_0x71af('0xb')](function(){_0x19222d[_0x71af('0xd')]=_0x9cc6db['body'][_0x71af('0xd')];_0x19222d[_0x71af('0x3c')]=null;_0x19222d[_0x71af('0x3d')]=null;return _0x19222d[_0x71af('0x3e')]();});})[_0x71af('0xb')](function(){_0x1c016d[_0x71af('0x45')](0xc8)[_0x71af('0x46')]({'message':'Password\x20reset!'});})['catch'](function(_0x307626){return handleError(_0x1c016d,0x1f4,_0x307626);});};passport['use'](new LocalStrategy({'usernameField':_0x71af('0xc'),'passwordField':_0x71af('0xd')},function(_0x3ad616,_0x59133b,_0x54342d){return localAuthenticate(db[_0x71af('0x39')],_0x3ad616,_0x59133b,_0x54342d);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 0f60787..847ca61 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 _0xe4b3=['exports','express','Router','post','login','/forgot','/reset/:token'];(function(_0x38e642,_0x52c2af){var _0x4aaf6a=function(_0x151f78){while(--_0x151f78){_0x38e642['push'](_0x38e642['shift']());}};_0x4aaf6a(++_0x52c2af);}(_0xe4b3,0x12e));var _0x3e4b=function(_0x93d1ec,_0x5330a0){_0x93d1ec=_0x93d1ec-0x0;var _0x529f14=_0xe4b3[_0x93d1ec];return _0x529f14;};'use strict';var express=require(_0x3e4b('0x0'));var router=express[_0x3e4b('0x1')]();var controller=require('./authLocal.controller');router[_0x3e4b('0x2')]('/',controller[_0x3e4b('0x3')]);router['post'](_0x3e4b('0x4'),controller['forgot']);router[_0x3e4b('0x2')](_0x3e4b('0x5'),controller['reset']);module[_0x3e4b('0x6')]=router;
\ No newline at end of file
+var _0x2304=['exports','express','login','post','/forgot','/reset/:token','reset'];(function(_0x259dac,_0x33ac39){var _0x337b53=function(_0x9a138e){while(--_0x9a138e){_0x259dac['push'](_0x259dac['shift']());}};_0x337b53(++_0x33ac39);}(_0x2304,0x14a));var _0x4230=function(_0x4751b9,_0x4b62a1){_0x4751b9=_0x4751b9-0x0;var _0x4b2feb=_0x2304[_0x4751b9];return _0x4b2feb;};'use strict';var express=require(_0x4230('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0x4230('0x1')]);router[_0x4230('0x2')](_0x4230('0x3'),controller['forgot']);router['post'](_0x4230('0x4'),controller[_0x4230('0x5')]);module[_0x4230('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index d1b9dd4..9cce9c3 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 _0x1654=['BOOLEAN','exports','STRING'];(function(_0x12ab01,_0x11195e){var _0x4d3917=function(_0x5c027c){while(--_0x5c027c){_0x12ab01['push'](_0x12ab01['shift']());}};_0x4d3917(++_0x11195e);}(_0x1654,0x94));var _0x4165=function(_0x3f36f9,_0x574d38){_0x3f36f9=_0x3f36f9-0x0;var _0x3dfbf7=_0x1654[_0x3f36f9];return _0x3dfbf7;};'use strict';var Sequelize=require('sequelize');module[_0x4165('0x0')]={'name':{'type':Sequelize[_0x4165('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x4165('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x74e7=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x1958ae,_0x238fc7){var _0x4330cf=function(_0x56f70c){while(--_0x56f70c){_0x1958ae['push'](_0x1958ae['shift']());}};_0x4330cf(++_0x238fc7);}(_0x74e7,0x10a));var _0x774e=function(_0x2d0245,_0x2e30fa){_0x2d0245=_0x2d0245-0x0;var _0x336e42=_0x74e7[_0x2d0245];return _0x336e42;};'use strict';var Sequelize=require('sequelize');module[_0x774e('0x0')]={'name':{'type':Sequelize[_0x774e('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x774e('0x1')]},'description':{'type':Sequelize[_0x774e('0x1')]},'status':{'type':Sequelize[_0x774e('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x774e('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 2c3bac1..5655761 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 _0x8aec=['offset','undefined','limit','count','set','json','reject','save','update','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','Automation','then','include','findAll','catch','includeAll','find','create','params','body','Condition','addConditions','ids','omit','findOne','getConditions','addActions','getActions','Action','pick','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8aec,0x123));var _0xc8ae=function(_0x5809e8,_0x565f30){_0x5809e8=_0x5809e8-0x0;var _0x194390=_0x8aec[_0x5809e8];return _0x194390;};'use strict';var emlformat=require(_0xc8ae('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc8ae('0x1'));var moment=require(_0xc8ae('0x2'));var BPromise=require(_0xc8ae('0x3'));var Mustache=require(_0xc8ae('0x4'));var util=require(_0xc8ae('0x5'));var path=require(_0xc8ae('0x6'));var sox=require(_0xc8ae('0x7'));var csv=require(_0xc8ae('0x8'));var ejs=require(_0xc8ae('0x9'));var fs=require('fs');var fs_extra=require(_0xc8ae('0xa'));var _=require(_0xc8ae('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc8ae('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc8ae('0x8'));var querystring=require(_0xc8ae('0xd'));var Papa=require('papaparse');var Redis=require(_0xc8ae('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8ae('0xf'))('api');var utils=require('../../config/utils');var config=require(_0xc8ae('0x10'));var licenseUtil=require(_0xc8ae('0x11'));var db=require(_0xc8ae('0x12'))['db'];function respondWithStatusCode(_0x456f75,_0x24cab0){_0x24cab0=_0x24cab0||0xcc;return function(_0x148a8c){if(_0x148a8c){return _0x456f75[_0xc8ae('0x13')](_0x24cab0);}return _0x456f75[_0xc8ae('0x14')](_0x24cab0)['end']();};}function respondWithResult(_0x103e99,_0xac4c45){_0xac4c45=_0xac4c45||0xc8;return function(_0x3bf862){if(_0x3bf862){return _0x103e99[_0xc8ae('0x14')](_0xac4c45)['json'](_0x3bf862);}};}function respondWithFilteredResult(_0x219538,_0x40e10f){return function(_0x1aad4a){if(_0x1aad4a){var _0x5ce4e3=typeof _0x40e10f[_0xc8ae('0x15')]===_0xc8ae('0x16')&&typeof _0x40e10f[_0xc8ae('0x17')]==='undefined';var _0x545633=_0x1aad4a[_0xc8ae('0x18')];var _0x33f682=_0x5ce4e3?0x0:_0x40e10f[_0xc8ae('0x15')];var _0x25da97=_0x5ce4e3?_0x1aad4a['count']:_0x40e10f[_0xc8ae('0x15')]+_0x40e10f[_0xc8ae('0x17')];var _0x415949;if(_0x25da97>=_0x545633){_0x25da97=_0x545633;_0x415949=0xc8;}else{_0x415949=0xce;}_0x219538['status'](_0x415949);return _0x219538[_0xc8ae('0x19')]('Content-Range',_0x33f682+'-'+_0x25da97+'/'+_0x545633)[_0xc8ae('0x1a')](_0x1aad4a);}return null;};}function patchUpdates(_0x37c746){return function(_0x578fea){try{jsonpatch['apply'](_0x578fea,_0x37c746,!![]);}catch(_0x212873){return BPromise[_0xc8ae('0x1b')](_0x212873);}return _0x578fea[_0xc8ae('0x1c')]();};}function saveUpdates(_0x4933f5,_0x3e0c69){return function(_0x1fae76){if(_0x1fae76){return _0x1fae76[_0xc8ae('0x1d')](_0x4933f5)['then'](function(_0xb96c8a){return _0xb96c8a;});}return null;};}function removeEntity(_0x5c7fa8,_0x1c34b4){return function(_0x551a08){if(_0x551a08){return _0x551a08[_0xc8ae('0x1e')]()['then'](function(){_0x5c7fa8[_0xc8ae('0x14')](0xcc)[_0xc8ae('0x1f')]();});}};}function handleEntityNotFound(_0x295fef,_0x45e3f9){return function(_0x4c6070){if(!_0x4c6070){_0x295fef['sendStatus'](0x194);}return _0x4c6070;};}function handleError(_0x5954a2,_0x1965e2){_0x1965e2=_0x1965e2||0x1f4;return function(_0x4d0908){logger[_0xc8ae('0x20')](_0x4d0908[_0xc8ae('0x21')]);if(_0x4d0908[_0xc8ae('0x22')]){delete _0x4d0908[_0xc8ae('0x22')];}_0x5954a2[_0xc8ae('0x14')](_0x1965e2)['send'](_0x4d0908);};}exports[_0xc8ae('0x23')]=function(_0xb4a752,_0x331b8d){var _0x5f0a96={},_0x377cb8={},_0x12630d={'count':0x0,'rows':[]};var _0x12e135=_[_0xc8ae('0x24')](db['Automation'][_0xc8ae('0x25')],function(_0x3f8190){return{'name':_0x3f8190[_0xc8ae('0x26')],'type':_0x3f8190[_0xc8ae('0x27')][_0xc8ae('0x28')]};});_0x377cb8['model']=_[_0xc8ae('0x24')](_0x12e135,_0xc8ae('0x22'));_0x377cb8[_0xc8ae('0x29')]=_[_0xc8ae('0x2a')](_0xb4a752['query']);_0x377cb8['filters']=_[_0xc8ae('0x2b')](_0x377cb8[_0xc8ae('0x2c')],_0x377cb8[_0xc8ae('0x29')]);_0x5f0a96[_0xc8ae('0x2d')]=_[_0xc8ae('0x2b')](_0x377cb8['model'],qs[_0xc8ae('0x2e')](_0xb4a752[_0xc8ae('0x29')][_0xc8ae('0x2e')]));_0x5f0a96[_0xc8ae('0x2d')]=_0x5f0a96[_0xc8ae('0x2d')][_0xc8ae('0x2f')]?_0x5f0a96[_0xc8ae('0x2d')]:_0x377cb8[_0xc8ae('0x2c')];if(!_0xb4a752[_0xc8ae('0x29')][_0xc8ae('0x30')](_0xc8ae('0x31'))){_0x5f0a96[_0xc8ae('0x17')]=qs[_0xc8ae('0x17')](_0xb4a752[_0xc8ae('0x29')]['limit']);_0x5f0a96['offset']=qs[_0xc8ae('0x15')](_0xb4a752[_0xc8ae('0x29')][_0xc8ae('0x15')]);}_0x5f0a96[_0xc8ae('0x32')]=qs['sort'](_0xb4a752[_0xc8ae('0x29')][_0xc8ae('0x33')]);_0x5f0a96[_0xc8ae('0x34')]=qs[_0xc8ae('0x35')](_['pick'](_0xb4a752['query'],_0x377cb8[_0xc8ae('0x35')]),_0x12e135);if(_0xb4a752['query'][_0xc8ae('0x36')]){_0x5f0a96[_0xc8ae('0x34')]=_[_0xc8ae('0x37')](_0x5f0a96[_0xc8ae('0x34')],{'$or':_[_0xc8ae('0x24')](_0x12e135,function(_0x50613a){if(_0x50613a[_0xc8ae('0x27')]!==_0xc8ae('0x38')){var _0x2bb37f={};_0x2bb37f[_0x50613a['name']]={'$like':'%'+_0xb4a752[_0xc8ae('0x29')][_0xc8ae('0x36')]+'%'};return _0x2bb37f;}})});}_0x5f0a96=_[_0xc8ae('0x37')]({},_0x5f0a96,_0xb4a752[_0xc8ae('0x39')]);var _0x1167a2={'where':_0x5f0a96[_0xc8ae('0x34')]};return db[_0xc8ae('0x3a')][_0xc8ae('0x18')](_0x1167a2)[_0xc8ae('0x3b')](function(_0x49b420){_0x12630d[_0xc8ae('0x18')]=_0x49b420;if(_0xb4a752['query']['includeAll']){_0x5f0a96[_0xc8ae('0x3c')]=[{'all':!![]}];}return db[_0xc8ae('0x3a')][_0xc8ae('0x3d')](_0x5f0a96);})[_0xc8ae('0x3b')](function(_0x28e5f9){_0x12630d['rows']=_0x28e5f9;return _0x12630d;})['then'](respondWithFilteredResult(_0x331b8d,_0x5f0a96))[_0xc8ae('0x3e')](handleError(_0x331b8d,null));};exports['show']=function(_0x4cde20,_0x245bd4){var _0x47739e={'raw':![],'where':{'id':_0x4cde20['params']['id']}},_0x56d0e0={};_0x56d0e0['model']=_[_0xc8ae('0x2a')](db[_0xc8ae('0x3a')][_0xc8ae('0x25')]);_0x56d0e0[_0xc8ae('0x29')]=_['keys'](_0x4cde20[_0xc8ae('0x29')]);_0x56d0e0['filters']=_[_0xc8ae('0x2b')](_0x56d0e0[_0xc8ae('0x2c')],_0x56d0e0[_0xc8ae('0x29')]);_0x47739e[_0xc8ae('0x2d')]=_[_0xc8ae('0x2b')](_0x56d0e0[_0xc8ae('0x2c')],qs[_0xc8ae('0x2e')](_0x4cde20['query'][_0xc8ae('0x2e')]));_0x47739e[_0xc8ae('0x2d')]=_0x47739e[_0xc8ae('0x2d')][_0xc8ae('0x2f')]?_0x47739e[_0xc8ae('0x2d')]:_0x56d0e0[_0xc8ae('0x2c')];if(_0x4cde20[_0xc8ae('0x29')][_0xc8ae('0x3f')]){_0x47739e['include']=[{'all':!![]}];}_0x47739e=_[_0xc8ae('0x37')]({},_0x47739e,_0x4cde20['options']);return db['Automation'][_0xc8ae('0x40')](_0x47739e)[_0xc8ae('0x3b')](handleEntityNotFound(_0x245bd4,null))['then'](respondWithResult(_0x245bd4,null))[_0xc8ae('0x3e')](handleError(_0x245bd4,null));};exports[_0xc8ae('0x41')]=function(_0x3ba8ae,_0x2e14f5){return db[_0xc8ae('0x3a')][_0xc8ae('0x41')](_0x3ba8ae['body'],{})[_0xc8ae('0x3b')](respondWithResult(_0x2e14f5,0xc9))[_0xc8ae('0x3e')](handleError(_0x2e14f5,null));};exports[_0xc8ae('0x1d')]=function(_0x53f194,_0x105a81){if(_0x53f194['body']['id']){delete _0x53f194['body']['id'];}return db[_0xc8ae('0x3a')]['find']({'where':{'id':_0x53f194[_0xc8ae('0x42')]['id']}})[_0xc8ae('0x3b')](handleEntityNotFound(_0x105a81,null))[_0xc8ae('0x3b')](saveUpdates(_0x53f194[_0xc8ae('0x43')],null))[_0xc8ae('0x3b')](respondWithResult(_0x105a81,null))[_0xc8ae('0x3e')](handleError(_0x105a81,null));};exports[_0xc8ae('0x1e')]=function(_0xd60554,_0x4cbd96){return db[_0xc8ae('0x3a')][_0xc8ae('0x40')]({'where':{'id':_0xd60554[_0xc8ae('0x42')]['id']}})['then'](handleEntityNotFound(_0x4cbd96,null))[_0xc8ae('0x3b')](removeEntity(_0x4cbd96,null))[_0xc8ae('0x3e')](handleError(_0x4cbd96,null));};exports['addConditions']=function(_0x21036e,_0x187530,_0x4e2c9d){return db[_0xc8ae('0x44')][_0xc8ae('0x40')]({'where':{'id':_0x21036e[_0xc8ae('0x42')]['id']}})[_0xc8ae('0x3b')](handleEntityNotFound(_0x187530,null))[_0xc8ae('0x3b')](function(_0x13fee3){if(_0x13fee3){return _0x13fee3[_0xc8ae('0x45')](_0x21036e[_0xc8ae('0x43')][_0xc8ae('0x46')],_[_0xc8ae('0x47')](_0x21036e['body'],[_0xc8ae('0x46'),'id'])||{});}})[_0xc8ae('0x3b')](respondWithResult(_0x187530,null))[_0xc8ae('0x3e')](handleError(_0x187530,null));};exports['getConditions']=function(_0x3e3c56,_0x362c33,_0x17e1ae){var _0x48e813={};var _0x318fd1={};var _0x1cd057;var _0x2fb4d6;return db[_0xc8ae('0x3a')][_0xc8ae('0x48')]({'where':{'id':_0x3e3c56[_0xc8ae('0x42')]['id']}})['then'](handleEntityNotFound(_0x362c33,null))[_0xc8ae('0x3b')](function(_0x360b09){if(_0x360b09){_0x1cd057=_0x360b09;_0x318fd1[_0xc8ae('0x2c')]=_[_0xc8ae('0x2a')](db[_0xc8ae('0x44')]['rawAttributes']);_0x318fd1['query']=_[_0xc8ae('0x2a')](_0x3e3c56[_0xc8ae('0x29')]);_0x318fd1['filters']=_[_0xc8ae('0x2b')](_0x318fd1[_0xc8ae('0x2c')],_0x318fd1[_0xc8ae('0x29')]);_0x48e813['attributes']=_[_0xc8ae('0x2b')](_0x318fd1[_0xc8ae('0x2c')],qs[_0xc8ae('0x2e')](_0x3e3c56[_0xc8ae('0x29')][_0xc8ae('0x2e')]));_0x48e813['attributes']=_0x48e813[_0xc8ae('0x2d')][_0xc8ae('0x2f')]?_0x48e813['attributes']:_0x318fd1['model'];_0x48e813['order']=qs[_0xc8ae('0x33')](_0x3e3c56['query'][_0xc8ae('0x33')]);_0x48e813['where']=qs[_0xc8ae('0x35')](_['pick'](_0x3e3c56[_0xc8ae('0x29')],_0x318fd1[_0xc8ae('0x35')]));if(_0x3e3c56['query'][_0xc8ae('0x36')]){_0x48e813['where']=_[_0xc8ae('0x37')](_0x48e813[_0xc8ae('0x34')],{'$or':_['map'](_0x48e813[_0xc8ae('0x2d')],function(_0x51b0ee){var _0xac11f2={};_0xac11f2[_0x51b0ee]={'$like':'%'+_0x3e3c56[_0xc8ae('0x29')][_0xc8ae('0x36')]+'%'};return _0xac11f2;})});}_0x48e813=_[_0xc8ae('0x37')]({},_0x48e813,_0x3e3c56[_0xc8ae('0x39')]);return _0x1cd057[_0xc8ae('0x49')](_0x48e813);}})[_0xc8ae('0x3b')](function(_0x51d371){if(_0x51d371){_0x2fb4d6=_0x51d371[_0xc8ae('0x2f')];if(!_0x3e3c56[_0xc8ae('0x29')][_0xc8ae('0x30')](_0xc8ae('0x31'))){_0x48e813[_0xc8ae('0x17')]=qs[_0xc8ae('0x17')](_0x3e3c56[_0xc8ae('0x29')][_0xc8ae('0x17')]);_0x48e813[_0xc8ae('0x15')]=qs[_0xc8ae('0x15')](_0x3e3c56[_0xc8ae('0x29')]['offset']);}return _0x1cd057['getConditions'](_0x48e813);}})[_0xc8ae('0x3b')](function(_0x41f60e){if(_0x41f60e){return _0x41f60e?{'count':_0x2fb4d6,'rows':_0x41f60e}:null;}})[_0xc8ae('0x3b')](respondWithResult(_0x362c33,null))[_0xc8ae('0x3e')](handleError(_0x362c33,null));};exports[_0xc8ae('0x4a')]=function(_0x2ec5f6,_0x2a6732,_0x1d98d7){return db['Action'][_0xc8ae('0x40')]({'where':{'id':_0x2ec5f6['params']['id']}})[_0xc8ae('0x3b')](handleEntityNotFound(_0x2a6732,null))[_0xc8ae('0x3b')](function(_0x501579){if(_0x501579){return _0x501579['addActions'](_0x2ec5f6[_0xc8ae('0x43')]['ids'],_[_0xc8ae('0x47')](_0x2ec5f6[_0xc8ae('0x43')],[_0xc8ae('0x46'),'id'])||{});}})['then'](respondWithResult(_0x2a6732,null))[_0xc8ae('0x3e')](handleError(_0x2a6732,null));};exports[_0xc8ae('0x4b')]=function(_0x131ad5,_0x5291ad,_0x36812d){var _0x324b95={};var _0x45bab0={};var _0x229bfd;var _0x2b5453;return db[_0xc8ae('0x3a')][_0xc8ae('0x48')]({'where':{'id':_0x131ad5[_0xc8ae('0x42')]['id']}})['then'](handleEntityNotFound(_0x5291ad,null))[_0xc8ae('0x3b')](function(_0x137d3a){if(_0x137d3a){_0x229bfd=_0x137d3a;_0x45bab0[_0xc8ae('0x2c')]=_[_0xc8ae('0x2a')](db[_0xc8ae('0x4c')][_0xc8ae('0x25')]);_0x45bab0[_0xc8ae('0x29')]=_[_0xc8ae('0x2a')](_0x131ad5['query']);_0x45bab0[_0xc8ae('0x35')]=_[_0xc8ae('0x2b')](_0x45bab0['model'],_0x45bab0[_0xc8ae('0x29')]);_0x324b95[_0xc8ae('0x2d')]=_['intersection'](_0x45bab0[_0xc8ae('0x2c')],qs[_0xc8ae('0x2e')](_0x131ad5[_0xc8ae('0x29')]['fields']));_0x324b95[_0xc8ae('0x2d')]=_0x324b95['attributes'][_0xc8ae('0x2f')]?_0x324b95[_0xc8ae('0x2d')]:_0x45bab0[_0xc8ae('0x2c')];_0x324b95[_0xc8ae('0x32')]=qs[_0xc8ae('0x33')](_0x131ad5[_0xc8ae('0x29')][_0xc8ae('0x33')]);_0x324b95[_0xc8ae('0x34')]=qs[_0xc8ae('0x35')](_[_0xc8ae('0x4d')](_0x131ad5[_0xc8ae('0x29')],_0x45bab0[_0xc8ae('0x35')]));if(_0x131ad5['query'][_0xc8ae('0x36')]){_0x324b95[_0xc8ae('0x34')]=_[_0xc8ae('0x37')](_0x324b95[_0xc8ae('0x34')],{'$or':_['map'](_0x324b95[_0xc8ae('0x2d')],function(_0x47793c){var _0x487ef9={};_0x487ef9[_0x47793c]={'$like':'%'+_0x131ad5[_0xc8ae('0x29')]['filter']+'%'};return _0x487ef9;})});}_0x324b95=_[_0xc8ae('0x37')]({},_0x324b95,_0x131ad5['options']);return _0x229bfd[_0xc8ae('0x4b')](_0x324b95);}})['then'](function(_0x4f1f64){if(_0x4f1f64){_0x2b5453=_0x4f1f64[_0xc8ae('0x2f')];if(!_0x131ad5[_0xc8ae('0x29')][_0xc8ae('0x30')](_0xc8ae('0x31'))){_0x324b95['limit']=qs[_0xc8ae('0x17')](_0x131ad5[_0xc8ae('0x29')][_0xc8ae('0x17')]);_0x324b95[_0xc8ae('0x15')]=qs[_0xc8ae('0x15')](_0x131ad5[_0xc8ae('0x29')][_0xc8ae('0x15')]);}return _0x229bfd[_0xc8ae('0x4b')](_0x324b95);}})[_0xc8ae('0x3b')](function(_0x595c99){if(_0x595c99){return _0x595c99?{'count':_0x2b5453,'rows':_0x595c99}:null;}})[_0xc8ae('0x3b')](respondWithResult(_0x5291ad,null))[_0xc8ae('0x3e')](handleError(_0x5291ad,null));};
\ No newline at end of file
+var _0xa31a=['include','findAll','rows','catch','params','includeAll','options','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','reject','save','update','then','destroy','stack','send','map','Automation','rawAttributes','fieldName','type','key','model','name','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter'];(function(_0x339ee2,_0x2b27ae){var _0x2984f5=function(_0x9f4e5b){while(--_0x9f4e5b){_0x339ee2['push'](_0x339ee2['shift']());}};_0x2984f5(++_0x2b27ae);}(_0xa31a,0x69));var _0xaa31=function(_0xb1c4a4,_0x70fbdc){_0xb1c4a4=_0xb1c4a4-0x0;var _0x4ea691=_0xa31a[_0xb1c4a4];return _0x4ea691;};'use strict';var emlformat=require(_0xaa31('0x0'));var rimraf=require(_0xaa31('0x1'));var zipdir=require(_0xaa31('0x2'));var jsonpatch=require(_0xaa31('0x3'));var rp=require(_0xaa31('0x4'));var moment=require(_0xaa31('0x5'));var BPromise=require(_0xaa31('0x6'));var Mustache=require(_0xaa31('0x7'));var util=require(_0xaa31('0x8'));var path=require(_0xaa31('0x9'));var sox=require(_0xaa31('0xa'));var csv=require(_0xaa31('0xb'));var ejs=require(_0xaa31('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa31('0xd'));var squel=require(_0xaa31('0xe'));var crypto=require('crypto');var jsforce=require(_0xaa31('0xf'));var deskjs=require(_0xaa31('0x10'));var toCsv=require(_0xaa31('0xb'));var querystring=require(_0xaa31('0x11'));var Papa=require(_0xaa31('0x12'));var Redis=require(_0xaa31('0x13'));var authService=require(_0xaa31('0x14'));var qs=require(_0xaa31('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa31('0x16'));var logger=require(_0xaa31('0x17'))(_0xaa31('0x18'));var utils=require(_0xaa31('0x19'));var config=require(_0xaa31('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xaa31('0x1b'))['db'];function respondWithStatusCode(_0x12c90d,_0x258f91){_0x258f91=_0x258f91||0xcc;return function(_0x2758a5){if(_0x2758a5){return _0x12c90d[_0xaa31('0x1c')](_0x258f91);}return _0x12c90d[_0xaa31('0x1d')](_0x258f91)[_0xaa31('0x1e')]();};}function respondWithResult(_0x19807c,_0x8bab77){_0x8bab77=_0x8bab77||0xc8;return function(_0x59661d){if(_0x59661d){return _0x19807c[_0xaa31('0x1d')](_0x8bab77)[_0xaa31('0x1f')](_0x59661d);}};}function respondWithFilteredResult(_0x4bf594,_0x26eaa8){return function(_0x403921){if(_0x403921){var _0x42803d=typeof _0x26eaa8[_0xaa31('0x20')]===_0xaa31('0x21')&&typeof _0x26eaa8['limit']===_0xaa31('0x21');var _0x3bb4de=_0x403921[_0xaa31('0x22')];var _0x316c4c=_0x42803d?0x0:_0x26eaa8['offset'];var _0x52e5ab=_0x42803d?_0x403921[_0xaa31('0x22')]:_0x26eaa8['offset']+_0x26eaa8[_0xaa31('0x23')];var _0x3c56c9;if(_0x52e5ab>=_0x3bb4de){_0x52e5ab=_0x3bb4de;_0x3c56c9=0xc8;}else{_0x3c56c9=0xce;}_0x4bf594[_0xaa31('0x1d')](_0x3c56c9);return _0x4bf594['set']('Content-Range',_0x316c4c+'-'+_0x52e5ab+'/'+_0x3bb4de)['json'](_0x403921);}return null;};}function patchUpdates(_0x5ebd63){return function(_0x425ff0){try{jsonpatch['apply'](_0x425ff0,_0x5ebd63,!![]);}catch(_0x4cd4b6){return BPromise[_0xaa31('0x24')](_0x4cd4b6);}return _0x425ff0[_0xaa31('0x25')]();};}function saveUpdates(_0x196e0f,_0x43d570){return function(_0x823f0e){if(_0x823f0e){return _0x823f0e[_0xaa31('0x26')](_0x196e0f)[_0xaa31('0x27')](function(_0x1a5b30){return _0x1a5b30;});}return null;};}function removeEntity(_0x1b9114,_0x4eda87){return function(_0x19158b){if(_0x19158b){return _0x19158b[_0xaa31('0x28')]()['then'](function(){_0x1b9114[_0xaa31('0x1d')](0xcc)[_0xaa31('0x1e')]();});}};}function handleEntityNotFound(_0x43c90e,_0x5fb171){return function(_0x98e674){if(!_0x98e674){_0x43c90e['sendStatus'](0x194);}return _0x98e674;};}function handleError(_0x27f583,_0x2c42a4){_0x2c42a4=_0x2c42a4||0x1f4;return function(_0x15c269){logger['error'](_0x15c269[_0xaa31('0x29')]);if(_0x15c269['name']){delete _0x15c269['name'];}_0x27f583[_0xaa31('0x1d')](_0x2c42a4)[_0xaa31('0x2a')](_0x15c269);};}exports['index']=function(_0xd9bcb5,_0x43413b){var _0x22704e={},_0x429498={},_0x3d41cb={'count':0x0,'rows':[]};var _0x283152=_[_0xaa31('0x2b')](db[_0xaa31('0x2c')][_0xaa31('0x2d')],function(_0x2a1a96){return{'name':_0x2a1a96[_0xaa31('0x2e')],'type':_0x2a1a96[_0xaa31('0x2f')][_0xaa31('0x30')]};});_0x429498[_0xaa31('0x31')]=_[_0xaa31('0x2b')](_0x283152,_0xaa31('0x32'));_0x429498['query']=_[_0xaa31('0x33')](_0xd9bcb5['query']);_0x429498[_0xaa31('0x34')]=_[_0xaa31('0x35')](_0x429498[_0xaa31('0x31')],_0x429498['query']);_0x22704e[_0xaa31('0x36')]=_['intersection'](_0x429498[_0xaa31('0x31')],qs[_0xaa31('0x37')](_0xd9bcb5['query'][_0xaa31('0x37')]));_0x22704e[_0xaa31('0x36')]=_0x22704e[_0xaa31('0x36')][_0xaa31('0x38')]?_0x22704e[_0xaa31('0x36')]:_0x429498[_0xaa31('0x31')];if(!_0xd9bcb5[_0xaa31('0x39')][_0xaa31('0x3a')](_0xaa31('0x3b'))){_0x22704e[_0xaa31('0x23')]=qs[_0xaa31('0x23')](_0xd9bcb5[_0xaa31('0x39')][_0xaa31('0x23')]);_0x22704e['offset']=qs[_0xaa31('0x20')](_0xd9bcb5[_0xaa31('0x39')]['offset']);}_0x22704e[_0xaa31('0x3c')]=qs[_0xaa31('0x3d')](_0xd9bcb5[_0xaa31('0x39')][_0xaa31('0x3d')]);_0x22704e[_0xaa31('0x3e')]=qs['filters'](_[_0xaa31('0x3f')](_0xd9bcb5['query'],_0x429498[_0xaa31('0x34')]),_0x283152);if(_0xd9bcb5['query']['filter']){_0x22704e[_0xaa31('0x3e')]=_[_0xaa31('0x40')](_0x22704e[_0xaa31('0x3e')],{'$or':_['map'](_0x283152,function(_0x4a9866){if(_0x4a9866['type']!==_0xaa31('0x41')){var _0x52f264={};_0x52f264[_0x4a9866['name']]={'$like':'%'+_0xd9bcb5['query'][_0xaa31('0x42')]+'%'};return _0x52f264;}})});}_0x22704e=_['merge']({},_0x22704e,_0xd9bcb5['options']);var _0x23c9a4={'where':_0x22704e[_0xaa31('0x3e')]};return db[_0xaa31('0x2c')][_0xaa31('0x22')](_0x23c9a4)[_0xaa31('0x27')](function(_0x8bced8){_0x3d41cb[_0xaa31('0x22')]=_0x8bced8;if(_0xd9bcb5[_0xaa31('0x39')]['includeAll']){_0x22704e[_0xaa31('0x43')]=[{'all':!![]}];}return db['Automation'][_0xaa31('0x44')](_0x22704e);})[_0xaa31('0x27')](function(_0x1f618b){_0x3d41cb[_0xaa31('0x45')]=_0x1f618b;return _0x3d41cb;})[_0xaa31('0x27')](respondWithFilteredResult(_0x43413b,_0x22704e))[_0xaa31('0x46')](handleError(_0x43413b,null));};exports['show']=function(_0x2bae1a,_0x2cd6b9){var _0x1cd9bd={'raw':![],'where':{'id':_0x2bae1a[_0xaa31('0x47')]['id']}},_0x1d99d2={};_0x1d99d2[_0xaa31('0x31')]=_[_0xaa31('0x33')](db[_0xaa31('0x2c')][_0xaa31('0x2d')]);_0x1d99d2[_0xaa31('0x39')]=_[_0xaa31('0x33')](_0x2bae1a[_0xaa31('0x39')]);_0x1d99d2[_0xaa31('0x34')]=_[_0xaa31('0x35')](_0x1d99d2[_0xaa31('0x31')],_0x1d99d2[_0xaa31('0x39')]);_0x1cd9bd['attributes']=_[_0xaa31('0x35')](_0x1d99d2[_0xaa31('0x31')],qs[_0xaa31('0x37')](_0x2bae1a[_0xaa31('0x39')][_0xaa31('0x37')]));_0x1cd9bd[_0xaa31('0x36')]=_0x1cd9bd[_0xaa31('0x36')][_0xaa31('0x38')]?_0x1cd9bd[_0xaa31('0x36')]:_0x1d99d2['model'];if(_0x2bae1a[_0xaa31('0x39')][_0xaa31('0x48')]){_0x1cd9bd[_0xaa31('0x43')]=[{'all':!![]}];}_0x1cd9bd=_[_0xaa31('0x40')]({},_0x1cd9bd,_0x2bae1a[_0xaa31('0x49')]);return db[_0xaa31('0x2c')][_0xaa31('0x4a')](_0x1cd9bd)[_0xaa31('0x27')](handleEntityNotFound(_0x2cd6b9,null))[_0xaa31('0x27')](respondWithResult(_0x2cd6b9,null))['catch'](handleError(_0x2cd6b9,null));};exports[_0xaa31('0x4b')]=function(_0x34afd3,_0x422cff){return db[_0xaa31('0x2c')][_0xaa31('0x4b')](_0x34afd3[_0xaa31('0x4c')],{})['then'](respondWithResult(_0x422cff,0xc9))[_0xaa31('0x46')](handleError(_0x422cff,null));};exports['update']=function(_0x3b0e0e,_0x20cf52){if(_0x3b0e0e['body']['id']){delete _0x3b0e0e['body']['id'];}return db[_0xaa31('0x2c')][_0xaa31('0x4a')]({'where':{'id':_0x3b0e0e['params']['id']}})[_0xaa31('0x27')](handleEntityNotFound(_0x20cf52,null))[_0xaa31('0x27')](saveUpdates(_0x3b0e0e[_0xaa31('0x4c')],null))[_0xaa31('0x27')](respondWithResult(_0x20cf52,null))[_0xaa31('0x46')](handleError(_0x20cf52,null));};exports[_0xaa31('0x28')]=function(_0x3fbb90,_0x4d0d69){return db[_0xaa31('0x2c')][_0xaa31('0x4a')]({'where':{'id':_0x3fbb90[_0xaa31('0x47')]['id']}})[_0xaa31('0x27')](handleEntityNotFound(_0x4d0d69,null))[_0xaa31('0x27')](removeEntity(_0x4d0d69,null))[_0xaa31('0x46')](handleError(_0x4d0d69,null));};exports[_0xaa31('0x4d')]=function(_0x1ad617,_0x570d07,_0x318b2f){return db[_0xaa31('0x4e')][_0xaa31('0x4a')]({'where':{'id':_0x1ad617[_0xaa31('0x47')]['id']}})[_0xaa31('0x27')](handleEntityNotFound(_0x570d07,null))[_0xaa31('0x27')](function(_0x336fe5){if(_0x336fe5){return _0x336fe5[_0xaa31('0x4d')](_0x1ad617[_0xaa31('0x4c')][_0xaa31('0x4f')],_[_0xaa31('0x50')](_0x1ad617[_0xaa31('0x4c')],[_0xaa31('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x570d07,null))[_0xaa31('0x46')](handleError(_0x570d07,null));};exports[_0xaa31('0x51')]=function(_0x4253c3,_0x3e6a46,_0x45afd4){var _0x755270={};var _0x197946={};var _0x352cc9;var _0x1afd45;return db[_0xaa31('0x2c')][_0xaa31('0x52')]({'where':{'id':_0x4253c3[_0xaa31('0x47')]['id']}})[_0xaa31('0x27')](handleEntityNotFound(_0x3e6a46,null))['then'](function(_0x2f8594){if(_0x2f8594){_0x352cc9=_0x2f8594;_0x197946[_0xaa31('0x31')]=_[_0xaa31('0x33')](db['Condition'][_0xaa31('0x2d')]);_0x197946[_0xaa31('0x39')]=_['keys'](_0x4253c3['query']);_0x197946['filters']=_['intersection'](_0x197946[_0xaa31('0x31')],_0x197946[_0xaa31('0x39')]);_0x755270['attributes']=_[_0xaa31('0x35')](_0x197946[_0xaa31('0x31')],qs[_0xaa31('0x37')](_0x4253c3['query'][_0xaa31('0x37')]));_0x755270[_0xaa31('0x36')]=_0x755270[_0xaa31('0x36')][_0xaa31('0x38')]?_0x755270['attributes']:_0x197946[_0xaa31('0x31')];_0x755270[_0xaa31('0x3c')]=qs[_0xaa31('0x3d')](_0x4253c3[_0xaa31('0x39')]['sort']);_0x755270[_0xaa31('0x3e')]=qs['filters'](_[_0xaa31('0x3f')](_0x4253c3['query'],_0x197946[_0xaa31('0x34')]));if(_0x4253c3['query'][_0xaa31('0x42')]){_0x755270['where']=_[_0xaa31('0x40')](_0x755270[_0xaa31('0x3e')],{'$or':_[_0xaa31('0x2b')](_0x755270[_0xaa31('0x36')],function(_0xea2d49){var _0x5d7282={};_0x5d7282[_0xea2d49]={'$like':'%'+_0x4253c3[_0xaa31('0x39')][_0xaa31('0x42')]+'%'};return _0x5d7282;})});}_0x755270=_[_0xaa31('0x40')]({},_0x755270,_0x4253c3['options']);return _0x352cc9[_0xaa31('0x51')](_0x755270);}})[_0xaa31('0x27')](function(_0x25e259){if(_0x25e259){_0x1afd45=_0x25e259[_0xaa31('0x38')];if(!_0x4253c3['query'][_0xaa31('0x3a')]('nolimit')){_0x755270['limit']=qs['limit'](_0x4253c3[_0xaa31('0x39')][_0xaa31('0x23')]);_0x755270[_0xaa31('0x20')]=qs[_0xaa31('0x20')](_0x4253c3[_0xaa31('0x39')]['offset']);}return _0x352cc9[_0xaa31('0x51')](_0x755270);}})[_0xaa31('0x27')](function(_0x3df788){if(_0x3df788){return _0x3df788?{'count':_0x1afd45,'rows':_0x3df788}:null;}})['then'](respondWithResult(_0x3e6a46,null))[_0xaa31('0x46')](handleError(_0x3e6a46,null));};exports[_0xaa31('0x53')]=function(_0x415348,_0x4f51b1,_0x1b331b){return db[_0xaa31('0x54')][_0xaa31('0x4a')]({'where':{'id':_0x415348[_0xaa31('0x47')]['id']}})[_0xaa31('0x27')](handleEntityNotFound(_0x4f51b1,null))['then'](function(_0x5074d4){if(_0x5074d4){return _0x5074d4[_0xaa31('0x53')](_0x415348['body']['ids'],_['omit'](_0x415348['body'],[_0xaa31('0x4f'),'id'])||{});}})[_0xaa31('0x27')](respondWithResult(_0x4f51b1,null))['catch'](handleError(_0x4f51b1,null));};exports['getActions']=function(_0x937470,_0x5b232e,_0xf2e33){var _0x443bfd={};var _0x2ff8ff={};var _0x55c0d4;var _0xffa62;return db['Automation'][_0xaa31('0x52')]({'where':{'id':_0x937470[_0xaa31('0x47')]['id']}})[_0xaa31('0x27')](handleEntityNotFound(_0x5b232e,null))[_0xaa31('0x27')](function(_0x22721b){if(_0x22721b){_0x55c0d4=_0x22721b;_0x2ff8ff[_0xaa31('0x31')]=_[_0xaa31('0x33')](db['Action'][_0xaa31('0x2d')]);_0x2ff8ff[_0xaa31('0x39')]=_[_0xaa31('0x33')](_0x937470[_0xaa31('0x39')]);_0x2ff8ff[_0xaa31('0x34')]=_[_0xaa31('0x35')](_0x2ff8ff[_0xaa31('0x31')],_0x2ff8ff[_0xaa31('0x39')]);_0x443bfd['attributes']=_[_0xaa31('0x35')](_0x2ff8ff[_0xaa31('0x31')],qs['fields'](_0x937470[_0xaa31('0x39')]['fields']));_0x443bfd[_0xaa31('0x36')]=_0x443bfd[_0xaa31('0x36')][_0xaa31('0x38')]?_0x443bfd[_0xaa31('0x36')]:_0x2ff8ff[_0xaa31('0x31')];_0x443bfd[_0xaa31('0x3c')]=qs[_0xaa31('0x3d')](_0x937470[_0xaa31('0x39')][_0xaa31('0x3d')]);_0x443bfd[_0xaa31('0x3e')]=qs[_0xaa31('0x34')](_[_0xaa31('0x3f')](_0x937470['query'],_0x2ff8ff[_0xaa31('0x34')]));if(_0x937470[_0xaa31('0x39')][_0xaa31('0x42')]){_0x443bfd[_0xaa31('0x3e')]=_[_0xaa31('0x40')](_0x443bfd[_0xaa31('0x3e')],{'$or':_[_0xaa31('0x2b')](_0x443bfd[_0xaa31('0x36')],function(_0x5549da){var _0x13ce9d={};_0x13ce9d[_0x5549da]={'$like':'%'+_0x937470['query'][_0xaa31('0x42')]+'%'};return _0x13ce9d;})});}_0x443bfd=_[_0xaa31('0x40')]({},_0x443bfd,_0x937470[_0xaa31('0x49')]);return _0x55c0d4[_0xaa31('0x55')](_0x443bfd);}})[_0xaa31('0x27')](function(_0x297e3a){if(_0x297e3a){_0xffa62=_0x297e3a[_0xaa31('0x38')];if(!_0x937470[_0xaa31('0x39')][_0xaa31('0x3a')](_0xaa31('0x3b'))){_0x443bfd[_0xaa31('0x23')]=qs['limit'](_0x937470['query'][_0xaa31('0x23')]);_0x443bfd[_0xaa31('0x20')]=qs[_0xaa31('0x20')](_0x937470[_0xaa31('0x39')][_0xaa31('0x20')]);}return _0x55c0d4[_0xaa31('0x55')](_0x443bfd);}})[_0xaa31('0x27')](function(_0xf0f5df){if(_0xf0f5df){return _0xf0f5df?{'count':_0xffa62,'rows':_0xf0f5df}:null;}})[_0xaa31('0x27')](respondWithResult(_0x5b232e,null))[_0xaa31('0x46')](handleError(_0x5b232e,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 6d26e55..8f31d00 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 _0xbe74=['lodash','util','api','moment','bluebird','request-promise','../../config/environment','./automation.attributes','exports','define','tools_automations'];(function(_0x14691c,_0xe1c878){var _0xbec98=function(_0x100b9e){while(--_0x100b9e){_0x14691c['push'](_0x14691c['shift']());}};_0xbec98(++_0xe1c878);}(_0xbe74,0x176));var _0x4be7=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xbe74[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x4be7('0x0'));var util=require(_0x4be7('0x1'));var logger=require('../../config/logger')(_0x4be7('0x2'));var moment=require(_0x4be7('0x3'));var BPromise=require(_0x4be7('0x4'));var rp=require(_0x4be7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4be7('0x6'));var attributes=require(_0x4be7('0x7'));module[_0x4be7('0x8')]=function(_0xe0d43,_0x515e0c){return _0xe0d43[_0x4be7('0x9')]('Automation',attributes,{'tableName':_0x4be7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x11d7=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','define','Automation','tools_automations'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x11d7,0xd1));var _0x711d=function(_0x29733c,_0x2da30b){_0x29733c=_0x29733c-0x0;var _0x49e72f=_0x11d7[_0x29733c];return _0x49e72f;};'use strict';var _=require(_0x711d('0x0'));var util=require(_0x711d('0x1'));var logger=require('../../config/logger')(_0x711d('0x2'));var moment=require('moment');var BPromise=require(_0x711d('0x3'));var rp=require(_0x711d('0x4'));var fs=require('fs');var path=require(_0x711d('0x5'));var rimraf=require(_0x711d('0x6'));var config=require(_0x711d('0x7'));var attributes=require('./automation.attributes');module['exports']=function(_0xdf51c1,_0x57d1f5){return _0xdf51c1[_0x711d('0x8')](_0x711d('0x9'),attributes,{'tableName':_0x711d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index e9168af..8354ae4 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 _0x07a2=['error','Automation,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','debug','stringify'];(function(_0x2ce160,_0x2a9ea0){var _0x30a9a4=function(_0xf8243f){while(--_0xf8243f){_0x2ce160['push'](_0x2ce160['shift']());}};_0x30a9a4(++_0x2a9ea0);}(_0x07a2,0x12c));var _0x207a=function(_0x5bd044,_0xafd5fa){_0x5bd044=_0x5bd044-0x0;var _0x582fd7=_0x07a2[_0x5bd044];return _0x582fd7;};'use strict';var _=require(_0x207a('0x0'));var util=require(_0x207a('0x1'));var moment=require('moment');var BPromise=require(_0x207a('0x2'));var rs=require(_0x207a('0x3'));var fs=require('fs');var Redis=require(_0x207a('0x4'));var db=require(_0x207a('0x5'))['db'];var utils=require(_0x207a('0x6'));var logger=require(_0x207a('0x7'))(_0x207a('0x8'));var config=require(_0x207a('0x9'));var jayson=require(_0x207a('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x18dddc,_0x15d085,_0x7be81c){return new BPromise(function(_0x2a0b70,_0x55412c){return client[_0x207a('0xb')](_0x18dddc,_0x7be81c)['then'](function(_0x5201fe){logger[_0x207a('0xc')]('Automation,\x20%s,\x20%s',_0x15d085,'request\x20sent');logger[_0x207a('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0x15d085,'request\x20sent',JSON[_0x207a('0xe')](_0x5201fe));if(_0x5201fe[_0x207a('0xf')]){if(_0x5201fe[_0x207a('0xf')]['code']===0x1f4){logger[_0x207a('0xf')](_0x207a('0x10'),_0x15d085,_0x5201fe[_0x207a('0xf')]['message']);return _0x55412c(_0x5201fe[_0x207a('0xf')][_0x207a('0x11')]);}logger[_0x207a('0xf')](_0x207a('0x10'),_0x15d085,_0x5201fe[_0x207a('0xf')]['message']);return _0x2a0b70(_0x5201fe[_0x207a('0xf')]['message']);}else{logger[_0x207a('0xc')](_0x207a('0x10'),_0x15d085,_0x207a('0x12'));_0x2a0b70(_0x5201fe[_0x207a('0x13')][_0x207a('0x11')]);}})[_0x207a('0x14')](function(_0xd60aa3){logger[_0x207a('0xf')](_0x207a('0x10'),_0x15d085,_0xd60aa3);_0x55412c(_0xd60aa3);});});}
\ No newline at end of file
+var _0x0f42=['rpc','../../config/environment','jayson/promise','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x443570,_0x5125dc){var _0x5f4e0d=function(_0x29b03b){while(--_0x29b03b){_0x443570['push'](_0x443570['shift']());}};_0x5f4e0d(++_0x5125dc);}(_0x0f42,0x126));var _0x20f4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0f42[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x20f4('0x0'));var util=require(_0x20f4('0x1'));var moment=require(_0x20f4('0x2'));var BPromise=require(_0x20f4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x20f4('0x5'));var logger=require('../../config/logger')(_0x20f4('0x6'));var config=require(_0x20f4('0x7'));var jayson=require(_0x20f4('0x8'));var client=jayson['client'][_0x20f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1519fe,_0x525da0,_0x45adf6){return new BPromise(function(_0x553d5d,_0x4a452d){return client['request'](_0x1519fe,_0x45adf6)[_0x20f4('0xa')](function(_0x4f3d95){logger[_0x20f4('0xb')](_0x20f4('0xc'),_0x525da0,_0x20f4('0xd'));logger[_0x20f4('0xe')]('Automation,\x20%s,\x20%s,\x20%s',_0x525da0,_0x20f4('0xd'),JSON['stringify'](_0x4f3d95));if(_0x4f3d95[_0x20f4('0xf')]){if(_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x10')]===0x1f4){logger[_0x20f4('0xf')]('Automation,\x20%s,\x20%s',_0x525da0,_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x11')]);return _0x4a452d(_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x11')]);}logger[_0x20f4('0xf')](_0x20f4('0xc'),_0x525da0,_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x11')]);return _0x553d5d(_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x11')]);}else{logger[_0x20f4('0xb')]('Automation,\x20%s,\x20%s',_0x525da0,'request\x20sent');_0x553d5d(_0x4f3d95[_0x20f4('0x12')][_0x20f4('0x11')]);}})[_0x20f4('0x13')](function(_0x36fdc2){logger[_0x20f4('0xf')]('Automation,\x20%s,\x20%s',_0x525da0,_0x36fdc2);_0x4a452d(_0x36fdc2);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 924dd9e..44f995f 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 _0xfbdb=['destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','getConditions','getActions','post','/:id/conditions','addConditions','/:id/actions','delete'];(function(_0x2e15fe,_0x59d847){var _0x4bccce=function(_0x57aa97){while(--_0x57aa97){_0x2e15fe['push'](_0x2e15fe['shift']());}};_0x4bccce(++_0x59d847);}(_0xfbdb,0x1ba));var _0xbfbd=function(_0x5339b6,_0x4dfff8){_0x5339b6=_0x5339b6-0x0;var _0x5e3b04=_0xfbdb[_0x5339b6];return _0x5e3b04;};'use strict';var multer=require(_0xbfbd('0x0'));var util=require('util');var path=require(_0xbfbd('0x1'));var timeout=require('connect-timeout');var express=require(_0xbfbd('0x2'));var router=express[_0xbfbd('0x3')]();var fs_extra=require(_0xbfbd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbfbd('0x5'));var config=require(_0xbfbd('0x6'));var controller=require(_0xbfbd('0x7'));router[_0xbfbd('0x8')]('/',auth[_0xbfbd('0x9')](),controller[_0xbfbd('0xa')]);router[_0xbfbd('0x8')](_0xbfbd('0xb'),auth[_0xbfbd('0x9')](),controller[_0xbfbd('0xc')]);router[_0xbfbd('0x8')]('/:id/conditions',auth[_0xbfbd('0x9')](),controller[_0xbfbd('0xd')]);router[_0xbfbd('0x8')]('/:id/actions',auth[_0xbfbd('0x9')](),controller[_0xbfbd('0xe')]);router[_0xbfbd('0xf')]('/',auth[_0xbfbd('0x9')](),controller['create']);router['post'](_0xbfbd('0x10'),auth[_0xbfbd('0x9')](),controller[_0xbfbd('0x11')]);router[_0xbfbd('0xf')](_0xbfbd('0x12'),auth[_0xbfbd('0x9')](),controller['addActions']);router['put']('/:id',auth[_0xbfbd('0x9')](),controller['update']);router[_0xbfbd('0x13')](_0xbfbd('0xb'),auth['isAuthenticated'](),controller[_0xbfbd('0x14')]);module[_0xbfbd('0x15')]=router;
\ No newline at end of file
+var _0x4d9e=['../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','getActions','post','create','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service'];(function(_0x588777,_0xb115db){var _0x58746e=function(_0x2ec4bd){while(--_0x2ec4bd){_0x588777['push'](_0x588777['shift']());}};_0x58746e(++_0xb115db);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x39903f,_0x2b76ad){_0x39903f=_0x39903f-0x0;var _0x1c0074=_0x4d9e[_0x39903f];return _0x1c0074;};'use strict';var multer=require(_0xe4d9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe4d9('0x1'));var express=require('express');var router=express[_0xe4d9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe4d9('0x3'));var interaction=require(_0xe4d9('0x4'));var config=require('../../config/environment');var controller=require(_0xe4d9('0x5'));router[_0xe4d9('0x6')]('/',auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x8')]);router[_0xe4d9('0x6')](_0xe4d9('0x9'),auth['isAuthenticated'](),controller[_0xe4d9('0xa')]);router[_0xe4d9('0x6')](_0xe4d9('0xb'),auth[_0xe4d9('0x7')](),controller[_0xe4d9('0xc')]);router[_0xe4d9('0x6')]('/:id/actions',auth[_0xe4d9('0x7')](),controller[_0xe4d9('0xd')]);router[_0xe4d9('0xe')]('/',auth[_0xe4d9('0x7')](),controller[_0xe4d9('0xf')]);router[_0xe4d9('0xe')](_0xe4d9('0xb'),auth['isAuthenticated'](),controller['addConditions']);router['post']('/:id/actions',auth['isAuthenticated'](),controller['addActions']);router['put']('/:id',auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x10')]);router[_0xe4d9('0x11')]('/:id',auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x12')]);module[_0xe4d9('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 935ef4b..f70b8ee 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 _0xffcc=['#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)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xffcc,0x147));var _0xcffc=function(_0x2d755d,_0x2fd0f5){_0x2d755d=_0x2d755d-0x0;var _0x323067=_0xffcc[_0x2d755d];return _0x323067;};'use strict';var Sequelize=require(_0xcffc('0x0'));module['exports']={'name':{'type':Sequelize[_0xcffc('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xcffc('0x2')](_0xcffc('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xcffc('0x4')],'defaultValue':0x0,'comment':_0xcffc('0x5')},'limitCalls':{'type':Sequelize[_0xcffc('0x6')](0x4)[_0xcffc('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xcffc('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xcffc('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xcffc('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcffc('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcffc('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xcffc('0x6')](0x5)[_0xcffc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcffc('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xcffc('0x6')](0x3)[_0xcffc('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xcffc('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcffc('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xcffc('0x6')](0x3)[_0xcffc('0x7')],'defaultValue':0x3,'comment':_0xcffc('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xcffc('0x6')](0x5)[_0xcffc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcffc('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xcffc('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xcffc('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xcffc('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xcffc('0xf'),_0xcffc('0x10'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xcffc('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xcffc('0x6')](0x9)[_0xcffc('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xcffc('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xcffc('0x6')](0x9)[_0xcffc('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xcffc('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xcffc('0x6')](0x9)[_0xcffc('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xcffc('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xcffc('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xcffc('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xcffc('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xcffc('0x6')](0x9)[_0xcffc('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xcffc('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xcffc('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xcffc('0x6')](0x5)[_0xcffc('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xcffc('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xcffc('0x6')](0x9)[_0xcffc('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xcffc('0x18')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xcffc('0x19'),_0xcffc('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xcffc('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xcffc('0x6')](0x3)[_0xcffc('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xcffc('0x1b')},'dialCutDigit':{'type':Sequelize[_0xcffc('0x6')](0x3)[_0xcffc('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xcffc('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xcffc('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xcffc('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xcffc('0x6')](0x5)[_0xcffc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcffc('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xcffc('0x6')](0x3)[_0xcffc('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcffc('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xcffc('0x6')](0x5)[_0xcffc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcffc('0x1f')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xcffc('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xcffc('0x6')](0x5)[_0xcffc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcffc('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xcffc('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcffc('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xcffc('0x6')](0x5)[_0xcffc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcffc('0x22')}};
\ No newline at end of file
+var _0x8f96=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','ENUM','ivr','STRING','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8f96,0x1a3));var _0x68f9=function(_0x70221a,_0x150939){_0x70221a=_0x70221a-0x0;var _0xe703c4=_0x8f96[_0x70221a];return _0xe703c4;};'use strict';var Sequelize=require(_0x68f9('0x0'));module[_0x68f9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x68f9('0x2')]('ivr'),'allowNull':![],'defaultValue':_0x68f9('0x3')},'description':{'type':Sequelize[_0x68f9('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x68f9('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x68f9('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x68f9('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x68f9('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x68f9('0x7')](0x5)[_0x68f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x68f9('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x68f9('0x7')](0x5)[_0x68f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x68f9('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x68f9('0x7')](0x5)[_0x68f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x68f9('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x68f9('0xd')},'dialTimezone':{'type':Sequelize[_0x68f9('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x68f9('0x4')],'defaultValue':_0x68f9('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x68f9('0x2')](_0x68f9('0xf'),'never','onlyIfOpen'),'defaultValue':_0x68f9('0xf')},'dialAMDActive':{'type':Sequelize[_0x68f9('0x10')],'defaultValue':0x0,'comment':_0x68f9('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x68f9('0x7')](0x9)[_0x68f9('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x68f9('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x68f9('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x68f9('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x68f9('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x68f9('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x68f9('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x68f9('0x7')](0x9)[_0x68f9('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x68f9('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x68f9('0x7')](0x9)[_0x68f9('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x68f9('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x68f9('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x68f9('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x68f9('0x7')](0x9)[_0x68f9('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x68f9('0x2')]('DESC',_0x68f9('0x18')),'defaultValue':_0x68f9('0x19')},'dialPrefix':{'type':Sequelize[_0x68f9('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x68f9('0x1a')},'dialCutDigit':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x68f9('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x68f9('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x68f9('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x68f9('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x68f9('0x7')](0x5)[_0x68f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x68f9('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x68f9('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x68f9('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x68f9('0x7')](0x3)[_0x68f9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x68f9('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x68f9('0x7')](0x5)[_0x68f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x68f9('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x68f9('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x68f9('0x7')](0x5)[_0x68f9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x68f9('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 9bebbc9..dcc9798 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 _0x6185=['destroy','get','IvrCampaigns','end','sendStatus','error','stack','send','Campaign','rawAttributes','fieldName','type','key','model','map','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','findOne','CmHopper','nolimit','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','CampaignId','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','field','NOW()','ContactId','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','ListId','COALESCE(phone,\x27\x27)','deletedAt\x20IS\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','zip-dir','request-promise','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then'];(function(_0x2c1aa8,_0x3e0609){var _0x4019f5=function(_0x916eac){while(--_0x916eac){_0x2c1aa8['push'](_0x2c1aa8['shift']());}};_0x4019f5(++_0x3e0609);}(_0x6185,0x1ec));var _0x5618=function(_0x5d299b,_0x2932e9){_0x5d299b=_0x5d299b-0x0;var _0x397a38=_0x6185[_0x5d299b];return _0x397a38;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5618('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5618('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5618('0x2'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5618('0x3'));var ejs=require(_0x5618('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5618('0x5'));var squel=require(_0x5618('0x6'));var crypto=require(_0x5618('0x7'));var jsforce=require(_0x5618('0x8'));var deskjs=require(_0x5618('0x9'));var toCsv=require(_0x5618('0x3'));var querystring=require('querystring');var Papa=require(_0x5618('0xa'));var Redis=require(_0x5618('0xb'));var authService=require(_0x5618('0xc'));var qs=require(_0x5618('0xd'));var as=require(_0x5618('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5618('0xf'));var utils=require(_0x5618('0x10'));var config=require(_0x5618('0x11'));var licenseUtil=require(_0x5618('0x12'));var db=require(_0x5618('0x13'))['db'];function respondWithStatusCode(_0x14eb2e,_0x4daa1b){_0x4daa1b=_0x4daa1b||0xcc;return function(_0x5b6af5){if(_0x5b6af5){return _0x14eb2e['sendStatus'](_0x4daa1b);}return _0x14eb2e[_0x5618('0x14')](_0x4daa1b)['end']();};}function respondWithResult(_0x151048,_0x4f9d00){_0x4f9d00=_0x4f9d00||0xc8;return function(_0x47b056){if(_0x47b056){return _0x151048[_0x5618('0x14')](_0x4f9d00)[_0x5618('0x15')](_0x47b056);}};}function respondWithFilteredResult(_0x1fe4bc,_0x11141b){return function(_0x4bf313){if(_0x4bf313){var _0x30494e=typeof _0x11141b['offset']===_0x5618('0x16')&&typeof _0x11141b[_0x5618('0x17')]===_0x5618('0x16');var _0x3c4478=_0x4bf313[_0x5618('0x18')];var _0xc393d7=_0x30494e?0x0:_0x11141b[_0x5618('0x19')];var _0x2ad822=_0x30494e?_0x4bf313[_0x5618('0x18')]:_0x11141b[_0x5618('0x19')]+_0x11141b[_0x5618('0x17')];var _0x5854de;if(_0x2ad822>=_0x3c4478){_0x2ad822=_0x3c4478;_0x5854de=0xc8;}else{_0x5854de=0xce;}_0x1fe4bc[_0x5618('0x14')](_0x5854de);return _0x1fe4bc[_0x5618('0x1a')](_0x5618('0x1b'),_0xc393d7+'-'+_0x2ad822+'/'+_0x3c4478)[_0x5618('0x15')](_0x4bf313);}return null;};}function patchUpdates(_0x32ec98){return function(_0x69fc08){try{jsonpatch['apply'](_0x69fc08,_0x32ec98,!![]);}catch(_0x49320d){return BPromise[_0x5618('0x1c')](_0x49320d);}return _0x69fc08[_0x5618('0x1d')]();};}function saveUpdates(_0x475e67,_0x229c3c){return function(_0x232688){if(_0x232688){return _0x232688[_0x5618('0x1e')](_0x475e67)[_0x5618('0x1f')](function(_0x3fd329){return _0x3fd329;});}return null;};}function removeEntity(_0x124fd5,_0x48acd1){return function(_0x49d15b){if(_0x49d15b){return _0x49d15b[_0x5618('0x20')]()['then'](function(){var _0x356a3b=_0x49d15b[_0x5618('0x21')]({'plain':!![]});var _0xc6aa23=_0x5618('0x22');return db['UserProfileResource'][_0x5618('0x20')]({'where':{'type':_0xc6aa23,'resourceId':_0x356a3b['id']}})[_0x5618('0x1f')](function(){return _0x49d15b;});})[_0x5618('0x1f')](function(){_0x124fd5[_0x5618('0x14')](0xcc)[_0x5618('0x23')]();});}};}function handleEntityNotFound(_0x622686,_0x55eddd){return function(_0x1cb244){if(!_0x1cb244){_0x622686[_0x5618('0x24')](0x194);}return _0x1cb244;};}function handleError(_0x1f86e4,_0x392e48){_0x392e48=_0x392e48||0x1f4;return function(_0x25310a){logger[_0x5618('0x25')](_0x25310a[_0x5618('0x26')]);if(_0x25310a['name']){delete _0x25310a['name'];}_0x1f86e4[_0x5618('0x14')](_0x392e48)[_0x5618('0x27')](_0x25310a);};}exports['index']=function(_0x4eed62,_0x5336ac){var _0x4d4adc={},_0x4e45a3={},_0x3c1547={'count':0x0,'rows':[]};var _0x5a934e=_['map'](db[_0x5618('0x28')][_0x5618('0x29')],function(_0x4a5da9){return{'name':_0x4a5da9[_0x5618('0x2a')],'type':_0x4a5da9[_0x5618('0x2b')][_0x5618('0x2c')]};});_0x4e45a3[_0x5618('0x2d')]=_[_0x5618('0x2e')](_0x5a934e,_0x5618('0x2f'));_0x4e45a3[_0x5618('0x30')]=_[_0x5618('0x31')](_0x4eed62['query']);_0x4e45a3['filters']=_['intersection'](_0x4e45a3['model'],_0x4e45a3[_0x5618('0x30')]);_0x4d4adc['attributes']=_[_0x5618('0x32')](_0x4e45a3[_0x5618('0x2d')],qs[_0x5618('0x33')](_0x4eed62['query'][_0x5618('0x33')]));_0x4d4adc[_0x5618('0x34')]=_0x4d4adc['attributes'][_0x5618('0x35')]?_0x4d4adc[_0x5618('0x34')]:_0x4e45a3['model'];if(!_0x4eed62[_0x5618('0x30')][_0x5618('0x36')]('nolimit')){_0x4d4adc[_0x5618('0x17')]=qs[_0x5618('0x17')](_0x4eed62['query'][_0x5618('0x17')]);_0x4d4adc[_0x5618('0x19')]=qs[_0x5618('0x19')](_0x4eed62['query'][_0x5618('0x19')]);}_0x4d4adc['order']=qs['sort'](_0x4eed62[_0x5618('0x30')][_0x5618('0x37')]);_0x4d4adc[_0x5618('0x38')]=qs[_0x5618('0x39')](_[_0x5618('0x3a')](_0x4eed62[_0x5618('0x30')],_0x4e45a3[_0x5618('0x39')]),_0x5a934e);if(_0x4eed62[_0x5618('0x30')][_0x5618('0x3b')]){_0x4d4adc['where']=_[_0x5618('0x3c')](_0x4d4adc[_0x5618('0x38')],{'$or':_[_0x5618('0x2e')](_0x5a934e,function(_0x4723a9){if(_0x4723a9[_0x5618('0x2b')]!==_0x5618('0x3d')){var _0x40ee65={};_0x40ee65[_0x4723a9['name']]={'$like':'%'+_0x4eed62[_0x5618('0x30')][_0x5618('0x3b')]+'%'};return _0x40ee65;}})});}_0x4d4adc=_['merge']({},_0x4d4adc,_0x4eed62[_0x5618('0x3e')]);var _0x1cafc0={'where':_0x4d4adc[_0x5618('0x38')]};return db[_0x5618('0x28')][_0x5618('0x18')](_0x1cafc0)[_0x5618('0x1f')](function(_0x399738){_0x3c1547[_0x5618('0x18')]=_0x399738;if(_0x4eed62[_0x5618('0x30')]['includeAll']){_0x4d4adc[_0x5618('0x3f')]=[{'all':!![]}];}return db[_0x5618('0x28')][_0x5618('0x40')](_0x4d4adc);})[_0x5618('0x1f')](function(_0x1b3570){_0x3c1547[_0x5618('0x41')]=_0x1b3570;return _0x3c1547;})['then'](respondWithFilteredResult(_0x5336ac,_0x4d4adc))['catch'](handleError(_0x5336ac,null));};exports[_0x5618('0x42')]=function(_0x448df2,_0x5d9d52){var _0x3086f3={'raw':![],'where':{'id':_0x448df2[_0x5618('0x43')]['id']}},_0x33ee33={};_0x33ee33[_0x5618('0x2d')]=_['keys'](db['Campaign'][_0x5618('0x29')]);_0x33ee33[_0x5618('0x30')]=_[_0x5618('0x31')](_0x448df2[_0x5618('0x30')]);_0x33ee33[_0x5618('0x39')]=_[_0x5618('0x32')](_0x33ee33[_0x5618('0x2d')],_0x33ee33[_0x5618('0x30')]);_0x3086f3['attributes']=_['intersection'](_0x33ee33[_0x5618('0x2d')],qs[_0x5618('0x33')](_0x448df2['query']['fields']));_0x3086f3[_0x5618('0x34')]=_0x3086f3[_0x5618('0x34')][_0x5618('0x35')]?_0x3086f3[_0x5618('0x34')]:_0x33ee33[_0x5618('0x2d')];if(_0x448df2[_0x5618('0x30')][_0x5618('0x44')]){_0x3086f3[_0x5618('0x3f')]=[{'all':!![]}];}_0x3086f3=_[_0x5618('0x3c')]({},_0x3086f3,_0x448df2['options']);return db[_0x5618('0x28')][_0x5618('0x45')](_0x3086f3)['then'](handleEntityNotFound(_0x5d9d52,null))[_0x5618('0x1f')](respondWithResult(_0x5d9d52,null))[_0x5618('0x46')](handleError(_0x5d9d52,null));};exports['create']=function(_0x40bee3,_0x3d42d6){return db[_0x5618('0x28')][_0x5618('0x47')](_0x40bee3[_0x5618('0x48')],{})[_0x5618('0x1f')](function(_0x354371){var _0x3d49dd=_0x40bee3[_0x5618('0x49')][_0x5618('0x21')]({'plain':!![]});if(!_0x3d49dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d49dd['role']===_0x5618('0x49')){var _0x86aa0a=_0x354371[_0x5618('0x21')]({'plain':!![]});var _0x3b251b='IvrCampaigns';return db['UserProfileSection'][_0x5618('0x45')]({'where':{'name':_0x3b251b,'userProfileId':_0x3d49dd['userProfileId']},'raw':!![]})[_0x5618('0x1f')](function(_0x4cd03d){if(_0x4cd03d&&_0x4cd03d['autoAssociation']===0x0){return db['UserProfileResource'][_0x5618('0x47')]({'name':_0x86aa0a[_0x5618('0x2f')],'resourceId':_0x86aa0a['id'],'type':_0x4cd03d[_0x5618('0x2f')],'sectionId':_0x4cd03d['id']},{})['then'](function(){return _0x354371;});}else{return _0x354371;}})[_0x5618('0x46')](function(_0x3e295b){logger['error'](_0x5618('0x4a'),_0x3e295b);throw _0x3e295b;});}return _0x354371;})['then'](respondWithResult(_0x3d42d6,0xc9))['catch'](handleError(_0x3d42d6,null));};exports['clone']=function(_0x84c263,_0x155b5d){var _0x406a9a={'where':{'id':_0x84c263[_0x5618('0x43')]['id']}},_0x15b216={};_0x15b216['model']=_[_0x5618('0x31')](db[_0x5618('0x28')][_0x5618('0x29')]);_0x406a9a[_0x5618('0x34')]=_[_0x5618('0x32')](_0x15b216[_0x5618('0x2d')],qs[_0x5618('0x33')](_0x84c263[_0x5618('0x30')]['fields']));_0x406a9a[_0x5618('0x34')]=_0x406a9a['attributes'][_0x5618('0x35')]?_0x406a9a[_0x5618('0x34')]:_0x15b216[_0x5618('0x2d')];if(_0x84c263['query']['includeAll']){_0x406a9a['include']=[{'all':!![]}];}_0x406a9a=_[_0x5618('0x3c')]({},_0x406a9a,_0x84c263[_0x5618('0x3e')]);return db[_0x5618('0x28')]['find'](_0x406a9a)[_0x5618('0x1f')](handleEntityNotFound(_0x155b5d,null))[_0x5618('0x1f')](function(_0x9f2314){if(_0x9f2314){var _0x2d5c1a=_0x9f2314['get']({'plain':!![]});_0x2d5c1a=qs[_0x5618('0x4b')](_0x2d5c1a,['id',_0x5618('0x4c'),'updatedAt']);_0x84c263[_0x5618('0x48')]=_[_0x5618('0x4b')](_0x84c263['body'],['id',_0x5618('0x4c'),_0x5618('0x4d')]);return db['Campaign'][_0x5618('0x47')](_[_0x5618('0x3c')](_0x2d5c1a,_0x84c263['body']),{'include':_0x84c263[_0x5618('0x30')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x285c70){var _0x41ad14=_0x84c263[_0x5618('0x49')][_0x5618('0x21')]({'plain':!![]});if(!_0x41ad14)throw new Error(_0x5618('0x4e'));if(_0x41ad14['role']===_0x5618('0x49')){var _0x3030ec=_0x285c70[_0x5618('0x21')]({'plain':!![]});var _0x90f46e=_0x5618('0x22');return db[_0x5618('0x4f')][_0x5618('0x45')]({'where':{'name':_0x90f46e,'userProfileId':_0x41ad14[_0x5618('0x50')]},'raw':!![]})[_0x5618('0x1f')](function(_0x30df0e){if(_0x30df0e&&_0x30df0e['autoAssociation']===0x0){return db[_0x5618('0x51')][_0x5618('0x47')]({'name':_0x3030ec[_0x5618('0x2f')],'resourceId':_0x3030ec['id'],'type':_0x30df0e[_0x5618('0x2f')],'sectionId':_0x30df0e['id']},{})[_0x5618('0x1f')](function(){return _0x285c70;});}else{return _0x285c70;}})[_0x5618('0x46')](function(_0x2b5d34){logger[_0x5618('0x25')](_0x5618('0x4a'),_0x2b5d34);throw _0x2b5d34;});}return _0x285c70;});}})[_0x5618('0x1f')](respondWithResult(_0x155b5d,0xc9))[_0x5618('0x46')](handleError(_0x155b5d,null));};exports[_0x5618('0x1e')]=function(_0x17eec4,_0x332d25){if(_0x17eec4['body']['id']){delete _0x17eec4[_0x5618('0x48')]['id'];}return db[_0x5618('0x28')][_0x5618('0x45')]({'where':{'id':_0x17eec4[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x332d25,null))[_0x5618('0x1f')](saveUpdates(_0x17eec4[_0x5618('0x48')],null))['then'](respondWithResult(_0x332d25,null))[_0x5618('0x46')](handleError(_0x332d25,null));};exports['destroy']=function(_0x2a06d7,_0x4f61e3){return db[_0x5618('0x28')][_0x5618('0x45')]({'where':{'id':_0x2a06d7['params']['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x4f61e3,null))[_0x5618('0x1f')](removeEntity(_0x4f61e3,null))[_0x5618('0x46')](handleError(_0x4f61e3,null));};exports['getHoppers']=function(_0x3f1aa3,_0x35723c,_0x2e48e0){var _0x115e5a={'raw':!![],'where':{}};var _0x4ccc7b={};var _0x57d356={'count':0x0,'rows':[]};return db[_0x5618('0x28')][_0x5618('0x52')]({'where':{'id':_0x3f1aa3[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x35723c,null))['then'](function(_0x36ae1b){if(_0x36ae1b){_0x4ccc7b[_0x5618('0x2d')]=_[_0x5618('0x31')](db[_0x5618('0x53')]['rawAttributes']);_0x4ccc7b['query']=_[_0x5618('0x31')](_0x3f1aa3[_0x5618('0x30')]);_0x4ccc7b[_0x5618('0x39')]=_[_0x5618('0x32')](_0x4ccc7b[_0x5618('0x2d')],_0x4ccc7b[_0x5618('0x30')]);_0x115e5a[_0x5618('0x34')]=_['intersection'](_0x4ccc7b[_0x5618('0x2d')],qs[_0x5618('0x33')](_0x3f1aa3[_0x5618('0x30')][_0x5618('0x33')]));_0x115e5a[_0x5618('0x34')]=_0x115e5a[_0x5618('0x34')][_0x5618('0x35')]?_0x115e5a[_0x5618('0x34')]:_0x4ccc7b[_0x5618('0x2d')];if(!_0x3f1aa3[_0x5618('0x30')][_0x5618('0x36')](_0x5618('0x54'))){_0x115e5a[_0x5618('0x17')]=qs[_0x5618('0x17')](_0x3f1aa3[_0x5618('0x30')][_0x5618('0x17')]);_0x115e5a[_0x5618('0x19')]=qs[_0x5618('0x19')](_0x3f1aa3['query'][_0x5618('0x19')]);}_0x115e5a['order']=qs[_0x5618('0x37')](_0x3f1aa3[_0x5618('0x30')][_0x5618('0x37')]);_0x115e5a[_0x5618('0x38')]=qs['filters'](_['pick'](_0x3f1aa3['query'],_0x4ccc7b[_0x5618('0x39')]));_0x115e5a[_0x5618('0x38')]['CampaignId']=_0x36ae1b['id'];if(_0x3f1aa3[_0x5618('0x30')][_0x5618('0x3b')]){_0x115e5a[_0x5618('0x38')]=_['merge'](_0x115e5a[_0x5618('0x38')],{'$or':_['map'](_0x115e5a[_0x5618('0x34')],function(_0x420466){var _0x2b9731={};_0x2b9731[_0x420466]={'$like':'%'+_0x3f1aa3[_0x5618('0x30')][_0x5618('0x3b')]+'%'};return _0x2b9731;})});}_0x115e5a=_[_0x5618('0x3c')]({},_0x115e5a,_0x3f1aa3[_0x5618('0x3e')]);return db[_0x5618('0x53')][_0x5618('0x18')]({'where':_0x115e5a[_0x5618('0x38')]})[_0x5618('0x1f')](function(_0xa27373){_0x57d356[_0x5618('0x18')]=_0xa27373;if(_0x3f1aa3[_0x5618('0x30')]['includeAll']){_0x115e5a[_0x5618('0x3f')]=[{'all':!![]}];}return db[_0x5618('0x53')]['findAll'](_0x115e5a);})[_0x5618('0x1f')](function(_0x3e4553){_0x57d356[_0x5618('0x41')]=_0x3e4553;return _0x57d356;});}})['then'](respondWithFilteredResult(_0x35723c,_0x115e5a))[_0x5618('0x46')](handleError(_0x35723c,null));};exports[_0x5618('0x55')]=function(_0x36d947,_0x32a29a,_0x3c35b5){var _0xc2d7c0={'raw':!![],'where':{}};var _0xb172fe={};var _0x4b5710={'count':0x0,'rows':[]};return db[_0x5618('0x28')][_0x5618('0x52')]({'where':{'id':_0x36d947[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x32a29a,null))['then'](function(_0x31f2c0){if(_0x31f2c0){_0xb172fe[_0x5618('0x2d')]=_[_0x5618('0x31')](db[_0x5618('0x56')][_0x5618('0x29')]);_0xb172fe[_0x5618('0x30')]=_[_0x5618('0x31')](_0x36d947[_0x5618('0x30')]);_0xb172fe[_0x5618('0x39')]=_[_0x5618('0x32')](_0xb172fe['model'],_0xb172fe[_0x5618('0x30')]);_0xc2d7c0[_0x5618('0x34')]=_[_0x5618('0x32')](_0xb172fe[_0x5618('0x2d')],qs[_0x5618('0x33')](_0x36d947['query'][_0x5618('0x33')]));_0xc2d7c0[_0x5618('0x34')]=_0xc2d7c0[_0x5618('0x34')][_0x5618('0x35')]?_0xc2d7c0[_0x5618('0x34')]:_0xb172fe['model'];if(!_0x36d947[_0x5618('0x30')][_0x5618('0x36')]('nolimit')){_0xc2d7c0[_0x5618('0x17')]=qs[_0x5618('0x17')](_0x36d947[_0x5618('0x30')][_0x5618('0x17')]);_0xc2d7c0[_0x5618('0x19')]=qs[_0x5618('0x19')](_0x36d947[_0x5618('0x30')][_0x5618('0x19')]);}_0xc2d7c0[_0x5618('0x57')]=qs[_0x5618('0x37')](_0x36d947[_0x5618('0x30')][_0x5618('0x37')]);_0xc2d7c0[_0x5618('0x38')]=qs[_0x5618('0x39')](_[_0x5618('0x3a')](_0x36d947[_0x5618('0x30')],_0xb172fe[_0x5618('0x39')]));_0xc2d7c0[_0x5618('0x38')]['CampaignId']=_0x31f2c0['id'];if(_0x36d947[_0x5618('0x30')][_0x5618('0x3b')]){_0xc2d7c0['where']=_[_0x5618('0x3c')](_0xc2d7c0['where'],{'$or':_['map'](_0xc2d7c0[_0x5618('0x34')],function(_0x415ca2){var _0x59849d={};_0x59849d[_0x415ca2]={'$like':'%'+_0x36d947['query'][_0x5618('0x3b')]+'%'};return _0x59849d;})});}_0xc2d7c0=_[_0x5618('0x3c')]({},_0xc2d7c0,_0x36d947[_0x5618('0x3e')]);return db[_0x5618('0x56')]['count']({'where':_0xc2d7c0[_0x5618('0x38')]})['then'](function(_0xfc17b9){_0x4b5710['count']=_0xfc17b9;if(_0x36d947['query'][_0x5618('0x44')]){_0xc2d7c0['include']=[{'all':!![]}];}return db[_0x5618('0x56')]['findAll'](_0xc2d7c0);})[_0x5618('0x1f')](function(_0x537c28){_0x4b5710[_0x5618('0x41')]=_0x537c28;return _0x4b5710;});}})[_0x5618('0x1f')](respondWithFilteredResult(_0x32a29a,_0xc2d7c0))['catch'](handleError(_0x32a29a,null));};exports[_0x5618('0x58')]=function(_0x5a1bd1,_0x4ca111,_0x1d5fc9){var _0xafb79a={'raw':!![],'where':{}};var _0x40ebd5={};var _0x55e480={'count':0x0,'rows':[]};return db[_0x5618('0x28')][_0x5618('0x52')]({'where':{'id':_0x5a1bd1[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x4ca111,null))[_0x5618('0x1f')](function(_0x3b7b95){if(_0x3b7b95){_0x40ebd5[_0x5618('0x2d')]=_['keys'](db[_0x5618('0x59')][_0x5618('0x29')]);_0x40ebd5[_0x5618('0x30')]=_[_0x5618('0x31')](_0x5a1bd1[_0x5618('0x30')]);_0x40ebd5[_0x5618('0x39')]=_['intersection'](_0x40ebd5[_0x5618('0x2d')],_0x40ebd5[_0x5618('0x30')]);_0xafb79a[_0x5618('0x34')]=_[_0x5618('0x32')](_0x40ebd5['model'],qs['fields'](_0x5a1bd1[_0x5618('0x30')][_0x5618('0x33')]));_0xafb79a[_0x5618('0x34')]=_0xafb79a[_0x5618('0x34')]['length']?_0xafb79a[_0x5618('0x34')]:_0x40ebd5[_0x5618('0x2d')];if(!_0x5a1bd1[_0x5618('0x30')][_0x5618('0x36')]('nolimit')){_0xafb79a[_0x5618('0x17')]=qs[_0x5618('0x17')](_0x5a1bd1[_0x5618('0x30')]['limit']);_0xafb79a[_0x5618('0x19')]=qs['offset'](_0x5a1bd1['query'][_0x5618('0x19')]);}_0xafb79a[_0x5618('0x57')]=qs[_0x5618('0x37')](_0x5a1bd1[_0x5618('0x30')][_0x5618('0x37')]);_0xafb79a[_0x5618('0x38')]=qs[_0x5618('0x39')](_[_0x5618('0x3a')](_0x5a1bd1[_0x5618('0x30')],_0x40ebd5[_0x5618('0x39')]));_0xafb79a[_0x5618('0x38')][_0x5618('0x5a')]=_0x3b7b95['id'];if(_0x5a1bd1[_0x5618('0x30')][_0x5618('0x3b')]){_0xafb79a[_0x5618('0x38')]=_[_0x5618('0x3c')](_0xafb79a[_0x5618('0x38')],{'$or':_['map'](_0xafb79a[_0x5618('0x34')],function(_0x4f97ba){var _0x587b6b={};_0x587b6b[_0x4f97ba]={'$like':'%'+_0x5a1bd1[_0x5618('0x30')][_0x5618('0x3b')]+'%'};return _0x587b6b;})});}_0xafb79a=_[_0x5618('0x3c')]({},_0xafb79a,_0x5a1bd1[_0x5618('0x3e')]);return db['CmHopperFinal'][_0x5618('0x18')]({'where':_0xafb79a[_0x5618('0x38')]})[_0x5618('0x1f')](function(_0x375b9c){_0x55e480[_0x5618('0x18')]=_0x375b9c;if(_0x5a1bd1[_0x5618('0x30')][_0x5618('0x44')]){_0xafb79a[_0x5618('0x3f')]=[{'all':!![]}];}return db[_0x5618('0x59')][_0x5618('0x40')](_0xafb79a);})[_0x5618('0x1f')](function(_0xc71e51){_0x55e480['rows']=_0xc71e51;return _0x55e480;});}})[_0x5618('0x1f')](respondWithFilteredResult(_0x4ca111,_0xafb79a))[_0x5618('0x46')](handleError(_0x4ca111,null));};exports['getHopperBlacks']=function(_0x4c84f8,_0x103191,_0xf68a70){var _0x4a9238={'raw':!![],'where':{}};var _0x510e10={};var _0xab7104={'count':0x0,'rows':[]};return db[_0x5618('0x28')][_0x5618('0x52')]({'where':{'id':_0x4c84f8[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x103191,null))[_0x5618('0x1f')](function(_0x269a40){if(_0x269a40){_0x510e10[_0x5618('0x2d')]=_[_0x5618('0x31')](db[_0x5618('0x5b')]['rawAttributes']);_0x510e10['query']=_['keys'](_0x4c84f8[_0x5618('0x30')]);_0x510e10[_0x5618('0x39')]=_[_0x5618('0x32')](_0x510e10['model'],_0x510e10[_0x5618('0x30')]);_0x4a9238['attributes']=_[_0x5618('0x32')](_0x510e10[_0x5618('0x2d')],qs[_0x5618('0x33')](_0x4c84f8[_0x5618('0x30')][_0x5618('0x33')]));_0x4a9238['attributes']=_0x4a9238['attributes'][_0x5618('0x35')]?_0x4a9238[_0x5618('0x34')]:_0x510e10['model'];if(!_0x4c84f8[_0x5618('0x30')][_0x5618('0x36')]('nolimit')){_0x4a9238[_0x5618('0x17')]=qs[_0x5618('0x17')](_0x4c84f8[_0x5618('0x30')][_0x5618('0x17')]);_0x4a9238[_0x5618('0x19')]=qs['offset'](_0x4c84f8[_0x5618('0x30')][_0x5618('0x19')]);}_0x4a9238[_0x5618('0x57')]=qs[_0x5618('0x37')](_0x4c84f8[_0x5618('0x30')]['sort']);_0x4a9238[_0x5618('0x38')]=qs[_0x5618('0x39')](_['pick'](_0x4c84f8[_0x5618('0x30')],_0x510e10[_0x5618('0x39')]));_0x4a9238['where'][_0x5618('0x5a')]=_0x269a40['id'];if(_0x4c84f8[_0x5618('0x30')][_0x5618('0x3b')]){_0x4a9238[_0x5618('0x38')]=_[_0x5618('0x3c')](_0x4a9238[_0x5618('0x38')],{'$or':_[_0x5618('0x2e')](_0x4a9238[_0x5618('0x34')],function(_0x5c8b1b){var _0x30de01={};_0x30de01[_0x5c8b1b]={'$like':'%'+_0x4c84f8[_0x5618('0x30')]['filter']+'%'};return _0x30de01;})});}_0x4a9238=_[_0x5618('0x3c')]({},_0x4a9238,_0x4c84f8[_0x5618('0x3e')]);return db[_0x5618('0x5b')]['count']({'where':_0x4a9238['where']})[_0x5618('0x1f')](function(_0x129d9e){_0xab7104['count']=_0x129d9e;if(_0x4c84f8[_0x5618('0x30')]['includeAll']){_0x4a9238['include']=[{'all':!![]}];}return db[_0x5618('0x5b')]['findAll'](_0x4a9238);})['then'](function(_0x3fd1bd){_0xab7104[_0x5618('0x41')]=_0x3fd1bd;return _0xab7104;});}})[_0x5618('0x1f')](respondWithFilteredResult(_0x103191,_0x4a9238))[_0x5618('0x46')](handleError(_0x103191,null));};exports[_0x5618('0x5c')]=function(_0x4e87e9,_0x5097f9,_0x3d9775){var _0x35320e={};var _0x1f9219={};var _0x4dd43e;var _0x36a32c;return db['Campaign'][_0x5618('0x52')]({'where':{'id':_0x4e87e9[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x5097f9,null))['then'](function(_0x3e4d80){if(_0x3e4d80){_0x4dd43e=_0x3e4d80;_0x1f9219['model']=_[_0x5618('0x31')](db[_0x5618('0x5d')][_0x5618('0x29')]);_0x1f9219[_0x5618('0x30')]=_[_0x5618('0x31')](_0x4e87e9[_0x5618('0x30')]);_0x1f9219[_0x5618('0x39')]=_[_0x5618('0x32')](_0x1f9219[_0x5618('0x2d')],_0x1f9219['query']);_0x35320e['attributes']=_[_0x5618('0x32')](_0x1f9219[_0x5618('0x2d')],qs[_0x5618('0x33')](_0x4e87e9[_0x5618('0x30')][_0x5618('0x33')]));_0x35320e[_0x5618('0x34')]=_0x35320e[_0x5618('0x34')][_0x5618('0x35')]?_0x35320e['attributes']:_0x1f9219[_0x5618('0x2d')];_0x35320e['order']=qs['sort'](_0x4e87e9[_0x5618('0x30')][_0x5618('0x37')]);_0x35320e['where']=qs['filters'](_[_0x5618('0x3a')](_0x4e87e9[_0x5618('0x30')],_0x1f9219[_0x5618('0x39')]));if(_0x4e87e9[_0x5618('0x30')][_0x5618('0x3b')]){_0x35320e[_0x5618('0x38')]=_['merge'](_0x35320e[_0x5618('0x38')],{'$or':_['map'](_0x35320e['attributes'],function(_0x1b8c9a){var _0xd5ebb5={};_0xd5ebb5[_0x1b8c9a]={'$like':'%'+_0x4e87e9['query']['filter']+'%'};return _0xd5ebb5;})});}_0x35320e=_[_0x5618('0x3c')]({},_0x35320e,_0x4e87e9[_0x5618('0x3e')]);return _0x4dd43e[_0x5618('0x5c')](_0x35320e);}})[_0x5618('0x1f')](function(_0x9fbca){if(_0x9fbca){_0x36a32c=_0x9fbca[_0x5618('0x35')];if(!_0x4e87e9[_0x5618('0x30')][_0x5618('0x36')](_0x5618('0x54'))){_0x35320e[_0x5618('0x17')]=qs['limit'](_0x4e87e9[_0x5618('0x30')][_0x5618('0x17')]);_0x35320e[_0x5618('0x19')]=qs[_0x5618('0x19')](_0x4e87e9[_0x5618('0x30')]['offset']);}return _0x4dd43e[_0x5618('0x5c')](_0x35320e);}})[_0x5618('0x1f')](function(_0xe889e1){if(_0xe889e1){return _0xe889e1?{'count':_0x36a32c,'rows':_0xe889e1}:null;}})[_0x5618('0x1f')](respondWithResult(_0x5097f9,null))[_0x5618('0x46')](handleError(_0x5097f9,null));};exports[_0x5618('0x5e')]=function(_0x4f2c4a,_0x31d1f7,_0x31d55d){var _0x3066f0,_0x4976f5;return db[_0x5618('0x28')]['find']({'where':{'id':_0x4f2c4a[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x31d1f7,null))[_0x5618('0x1f')](function(_0x55127a){if(_0x55127a){_0x4976f5=_0x55127a;return _0x55127a['addLists'](_0x4f2c4a['body'][_0x5618('0x5f')],_['omit'](_0x4f2c4a[_0x5618('0x48')],[_0x5618('0x5f'),'id'])||{});}return null;})[_0x5618('0x60')](function(_0x140484){var _0x1e5a04;_0x3066f0=_0x140484||[];var _0x53a730=[];if(_0x140484){for(var _0x5dfc46=0x0;_0x5dfc46<_0x140484['length'];_0x5dfc46+=0x1){var _0x4acb54=_0x140484[_0x5dfc46][_0x5618('0x21')]({'plain':!![]});_0x4976f5[_0x5618('0x61')]=_0x4f2c4a[_0x5618('0x48')][_0x5618('0x61')]?_0x4f2c4a[_0x5618('0x48')][_0x5618('0x61')]:_0x4976f5[_0x5618('0x61')];switch(_0x4976f5['dialCheckDuplicateType']){case _0x5618('0x62'):_0x1e5a04=squel[_0x5618('0x63')]()[_0x5618('0x64')](_0x5618('0x65'))['fromQuery']([_0x5618('0x66'),_0x5618('0x67'),'ContactId','ListId',_0x5618('0x5a'),'createdAt',_0x5618('0x4d')],squel['select']()[_0x5618('0x68')]('phone',_0x5618('0x66'))[_0x5618('0x68')](_0x5618('0x69'),_0x5618('0x67'))[_0x5618('0x68')]('id',_0x5618('0x6a'))[_0x5618('0x68')](_0x4acb54[_0x5618('0x6b')][_0x5618('0x6c')](),'ListId')[_0x5618('0x68')](_0x4f2c4a['params']['id'][_0x5618('0x6c')](),_0x5618('0x5a'))[_0x5618('0x68')](_0x5618('0x69'),_0x5618('0x4c'))[_0x5618('0x68')]('NOW()','updatedAt')[_0x5618('0x6d')](_0x5618('0x6e'))[_0x5618('0x38')]('deletedAt\x20IS\x20NULL')['where'](_0x5618('0x6f'),_0x4acb54[_0x5618('0x6b')]['toString']())[_0x5618('0x38')](_0x5618('0x70'))[_0x5618('0x38')](_0x5618('0x71'),squel[_0x5618('0x72')]()['field'](_0x5618('0x73'))['from'](_0x5618('0x74'))['where'](_0x5618('0x75'),_0x4f2c4a[_0x5618('0x43')]['id'][_0x5618('0x6c')]()))['where'](_0x5618('0x71'),squel[_0x5618('0x72')]()[_0x5618('0x68')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x5618('0x38')]('CampaignId\x20=\x20?',_0x4f2c4a['params']['id'][_0x5618('0x6c')]())))[_0x5618('0x6c')]();break;case _0x5618('0x76'):_0x1e5a04=squel['insert']()['into'](_0x5618('0x65'))[_0x5618('0x77')]([_0x5618('0x66'),_0x5618('0x67'),'ContactId',_0x5618('0x78'),_0x5618('0x5a'),_0x5618('0x4c'),_0x5618('0x4d')],squel[_0x5618('0x72')]()[_0x5618('0x68')](_0x5618('0x66'),_0x5618('0x66'))[_0x5618('0x68')](_0x5618('0x69'),_0x5618('0x67'))[_0x5618('0x68')]('id',_0x5618('0x6a'))[_0x5618('0x68')](_0x4acb54[_0x5618('0x6b')]['toString'](),'ListId')[_0x5618('0x68')](_0x4f2c4a['params']['id'][_0x5618('0x6c')](),'CampaignId')[_0x5618('0x68')]('NOW()',_0x5618('0x4c'))[_0x5618('0x68')](_0x5618('0x69'),_0x5618('0x4d'))[_0x5618('0x6d')]('cm_contacts')[_0x5618('0x38')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x4acb54[_0x5618('0x6b')][_0x5618('0x6c')]())[_0x5618('0x38')](_0x5618('0x70'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x5618('0x72')]()[_0x5618('0x68')](_0x5618('0x79'))[_0x5618('0x6d')](_0x5618('0x65'))['where']('CampaignId\x20=\x20?',_0x4f2c4a[_0x5618('0x43')]['id'][_0x5618('0x6c')]())))[_0x5618('0x6c')]();break;default:_0x1e5a04=squel[_0x5618('0x63')]()[_0x5618('0x64')]('cm_hopper')[_0x5618('0x77')](['phone',_0x5618('0x67'),_0x5618('0x6a'),_0x5618('0x78'),_0x5618('0x5a'),_0x5618('0x4c'),_0x5618('0x4d')],squel[_0x5618('0x72')]()[_0x5618('0x68')](_0x5618('0x66'),_0x5618('0x66'))[_0x5618('0x68')](_0x5618('0x69'),_0x5618('0x67'))[_0x5618('0x68')]('id','ContactId')[_0x5618('0x68')](_0x4acb54['CmListId']['toString'](),_0x5618('0x78'))[_0x5618('0x68')](_0x4f2c4a[_0x5618('0x43')]['id'][_0x5618('0x6c')](),'CampaignId')[_0x5618('0x68')](_0x5618('0x69'),'createdAt')['field'](_0x5618('0x69'),_0x5618('0x4d'))[_0x5618('0x6d')]('cm_contacts')['where'](_0x5618('0x7a'))['where']('ListId\x20=\x20?',_0x4acb54[_0x5618('0x6b')]['toString']())[_0x5618('0x38')](_0x5618('0x70')))[_0x5618('0x6c')]();}_0x53a730[_0x5618('0x7b')](db[_0x5618('0x7c')][_0x5618('0x30')](_0x1e5a04));}return BPromise[_0x5618('0x7d')](_0x53a730);}})['then'](function(){return _0x3066f0;})[_0x5618('0x1f')](respondWithResult(_0x31d1f7,null))[_0x5618('0x46')](handleError(_0x31d1f7,null));};exports[_0x5618('0x7e')]=function(_0x4dbba8,_0x2bba3a,_0x22b691){return db[_0x5618('0x28')][_0x5618('0x45')]({'where':{'id':_0x4dbba8[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x2bba3a,null))[_0x5618('0x1f')](function(_0x3eeb5b){if(_0x3eeb5b){return _0x3eeb5b[_0x5618('0x7e')](_0x4dbba8[_0x5618('0x30')]['ids']);}})['then'](function(_0x4daf2c){if(_0x4daf2c){return db[_0x5618('0x53')][_0x5618('0x20')]({'where':{'ListId':_0x4dbba8[_0x5618('0x30')][_0x5618('0x5f')],'CampaignId':_0x4dbba8['params']['id']}})[_0x5618('0x1f')](function(){return _0x4daf2c;});}})['then'](respondWithStatusCode(_0x2bba3a,null))[_0x5618('0x46')](handleError(_0x2bba3a,null));};exports[_0x5618('0x7f')]=function(_0x1d99ff,_0x1b2f9c,_0x1118be){var _0x3a1fca={};var _0x178eee={};var _0x362977;var _0x2a342f;return db[_0x5618('0x28')][_0x5618('0x52')]({'where':{'id':_0x1d99ff[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x1b2f9c,null))['then'](function(_0x5b196e){if(_0x5b196e){_0x362977=_0x5b196e;_0x178eee[_0x5618('0x2d')]=_[_0x5618('0x31')](db['CmList'][_0x5618('0x29')]);_0x178eee[_0x5618('0x30')]=_['keys'](_0x1d99ff['query']);_0x178eee[_0x5618('0x39')]=_['intersection'](_0x178eee[_0x5618('0x2d')],_0x178eee[_0x5618('0x30')]);_0x3a1fca[_0x5618('0x34')]=_[_0x5618('0x32')](_0x178eee[_0x5618('0x2d')],qs[_0x5618('0x33')](_0x1d99ff['query'][_0x5618('0x33')]));_0x3a1fca['attributes']=_0x3a1fca[_0x5618('0x34')][_0x5618('0x35')]?_0x3a1fca[_0x5618('0x34')]:_0x178eee[_0x5618('0x2d')];_0x3a1fca[_0x5618('0x57')]=qs[_0x5618('0x37')](_0x1d99ff['query'][_0x5618('0x37')]);_0x3a1fca['where']=qs[_0x5618('0x39')](_[_0x5618('0x3a')](_0x1d99ff[_0x5618('0x30')],_0x178eee[_0x5618('0x39')]));if(_0x1d99ff[_0x5618('0x30')]['filter']){_0x3a1fca[_0x5618('0x38')]=_['merge'](_0x3a1fca[_0x5618('0x38')],{'$or':_[_0x5618('0x2e')](_0x3a1fca[_0x5618('0x34')],function(_0x45e4d6){var _0xc0d39f={};_0xc0d39f[_0x45e4d6]={'$like':'%'+_0x1d99ff[_0x5618('0x30')][_0x5618('0x3b')]+'%'};return _0xc0d39f;})});}_0x3a1fca=_[_0x5618('0x3c')]({},_0x3a1fca,_0x1d99ff[_0x5618('0x3e')]);return _0x362977[_0x5618('0x7f')](_0x3a1fca);}})['then'](function(_0x52dd58){if(_0x52dd58){_0x2a342f=_0x52dd58[_0x5618('0x35')];if(!_0x1d99ff[_0x5618('0x30')][_0x5618('0x36')](_0x5618('0x54'))){_0x3a1fca[_0x5618('0x17')]=qs[_0x5618('0x17')](_0x1d99ff[_0x5618('0x30')][_0x5618('0x17')]);_0x3a1fca['offset']=qs[_0x5618('0x19')](_0x1d99ff[_0x5618('0x30')]['offset']);}return _0x362977[_0x5618('0x7f')](_0x3a1fca);}})['then'](function(_0x2c5756){if(_0x2c5756){return _0x2c5756?{'count':_0x2a342f,'rows':_0x2c5756}:null;}})[_0x5618('0x1f')](respondWithResult(_0x1b2f9c,null))['catch'](handleError(_0x1b2f9c,null));};exports[_0x5618('0x80')]=function(_0x50b22d,_0x3dfda8,_0x3e5b5f){var _0x188333,_0x1e5aaa;return db[_0x5618('0x28')][_0x5618('0x45')]({'where':{'id':_0x50b22d[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x3dfda8,null))[_0x5618('0x1f')](function(_0x35e73b){if(_0x35e73b){_0x1e5aaa=_0x35e73b;return _0x35e73b[_0x5618('0x80')](_0x50b22d['body'][_0x5618('0x5f')],_['omit'](_0x50b22d[_0x5618('0x48')],[_0x5618('0x5f'),'id'])||{});}return null;})[_0x5618('0x60')](function(_0x22e84e){var _0x2f84be;_0x188333=_0x22e84e||[];var _0x306b0f=[];if(_0x22e84e){for(var _0x36dc30=0x0;_0x36dc30<_0x22e84e['length'];_0x36dc30+=0x1){var _0x189cab=_0x22e84e[_0x36dc30][_0x5618('0x21')]({'plain':!![]});_0x2f84be=squel[_0x5618('0x63')]()[_0x5618('0x64')](_0x5618('0x81'))[_0x5618('0x77')]([_0x5618('0x66'),'ContactId',_0x5618('0x78'),_0x5618('0x5a'),'createdAt',_0x5618('0x4d')],squel[_0x5618('0x72')]()[_0x5618('0x68')]('phone',_0x5618('0x66'))[_0x5618('0x68')]('id',_0x5618('0x6a'))['field'](_0x189cab[_0x5618('0x6b')][_0x5618('0x6c')](),_0x5618('0x78'))[_0x5618('0x68')](_0x50b22d[_0x5618('0x43')]['id'][_0x5618('0x6c')](),_0x5618('0x5a'))['field'](_0x5618('0x69'),'createdAt')[_0x5618('0x68')](_0x5618('0x69'),_0x5618('0x4d'))[_0x5618('0x6d')]('cm_contacts')[_0x5618('0x38')](_0x5618('0x7a'))[_0x5618('0x38')]('ListId\x20=\x20?',_0x189cab[_0x5618('0x6b')]['toString']())[_0x5618('0x38')](_0x5618('0x70')))['toString']();_0x306b0f[_0x5618('0x7b')](db[_0x5618('0x7c')][_0x5618('0x30')](_0x2f84be));}return BPromise[_0x5618('0x7d')](_0x306b0f);}})[_0x5618('0x1f')](function(){return _0x188333;})['then'](respondWithResult(_0x3dfda8,null))[_0x5618('0x46')](handleError(_0x3dfda8,null));};exports[_0x5618('0x82')]=function(_0x5af19d,_0x417ded,_0x1dd59e){return db['Campaign'][_0x5618('0x45')]({'where':{'id':_0x5af19d[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](handleEntityNotFound(_0x417ded,null))[_0x5618('0x1f')](function(_0xda3692){if(_0xda3692){return _0xda3692['removeBlackLists'](_0x5af19d[_0x5618('0x30')][_0x5618('0x5f')]);}})[_0x5618('0x1f')](function(_0x3493f4){if(_0x3493f4){return db[_0x5618('0x5b')][_0x5618('0x20')]({'where':{'ListId':_0x5af19d[_0x5618('0x30')][_0x5618('0x5f')],'CampaignId':_0x5af19d[_0x5618('0x43')]['id']}})[_0x5618('0x1f')](function(){return _0x3493f4;});}})[_0x5618('0x1f')](respondWithStatusCode(_0x417ded,null))['catch'](handleError(_0x417ded,null));};
\ No newline at end of file
+var _0x85e0=['getHoppers','CmHopper','order','pick','CampaignId','findAll','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','ContactId','CmListId','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','from','onlyIfOpen','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','apply','reject','update','then','destroy','get','IvrCampaigns','error','stack','name','send','index','map','Campaign','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','count','includeAll','rows','show','params','keys','rawAttributes','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','updatedAt','role','UserProfileSection'];(function(_0x182c4e,_0x252d41){var _0x1a701c=function(_0x387539){while(--_0x387539){_0x182c4e['push'](_0x182c4e['shift']());}};_0x1a701c(++_0x252d41);}(_0x85e0,0xbc));var _0x085e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x85e0[_0x46698a];return _0x356db0;};'use strict';var emlformat=require(_0x085e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x085e('0x1'));var jsonpatch=require(_0x085e('0x2'));var rp=require(_0x085e('0x3'));var moment=require(_0x085e('0x4'));var BPromise=require(_0x085e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x085e('0x6'));var sox=require(_0x085e('0x7'));var csv=require(_0x085e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x085e('0x9'));var _=require(_0x085e('0xa'));var squel=require('squel');var crypto=require(_0x085e('0xb'));var jsforce=require(_0x085e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x085e('0x8'));var querystring=require(_0x085e('0xd'));var Papa=require(_0x085e('0xe'));var Redis=require(_0x085e('0xf'));var authService=require(_0x085e('0x10'));var qs=require(_0x085e('0x11'));var as=require(_0x085e('0x12'));var hardwareService=require(_0x085e('0x13'));var logger=require(_0x085e('0x14'))(_0x085e('0x15'));var utils=require(_0x085e('0x16'));var config=require(_0x085e('0x17'));var licenseUtil=require(_0x085e('0x18'));var db=require(_0x085e('0x19'))['db'];function respondWithStatusCode(_0x5aa734,_0x19548a){_0x19548a=_0x19548a||0xcc;return function(_0x4bcba3){if(_0x4bcba3){return _0x5aa734[_0x085e('0x1a')](_0x19548a);}return _0x5aa734[_0x085e('0x1b')](_0x19548a)[_0x085e('0x1c')]();};}function respondWithResult(_0x311be3,_0x5b5522){_0x5b5522=_0x5b5522||0xc8;return function(_0x3051b4){if(_0x3051b4){return _0x311be3[_0x085e('0x1b')](_0x5b5522)[_0x085e('0x1d')](_0x3051b4);}};}function respondWithFilteredResult(_0x339cb6,_0x316066){return function(_0xccbaf7){if(_0xccbaf7){var _0x4baa7c=typeof _0x316066[_0x085e('0x1e')]===_0x085e('0x1f')&&typeof _0x316066[_0x085e('0x20')]==='undefined';var _0x44b163=_0xccbaf7['count'];var _0x23591b=_0x4baa7c?0x0:_0x316066[_0x085e('0x1e')];var _0x294055=_0x4baa7c?_0xccbaf7['count']:_0x316066[_0x085e('0x1e')]+_0x316066[_0x085e('0x20')];var _0x5b3dbc;if(_0x294055>=_0x44b163){_0x294055=_0x44b163;_0x5b3dbc=0xc8;}else{_0x5b3dbc=0xce;}_0x339cb6[_0x085e('0x1b')](_0x5b3dbc);return _0x339cb6['set']('Content-Range',_0x23591b+'-'+_0x294055+'/'+_0x44b163)['json'](_0xccbaf7);}return null;};}function patchUpdates(_0x49135d){return function(_0x2114bb){try{jsonpatch[_0x085e('0x21')](_0x2114bb,_0x49135d,!![]);}catch(_0x1d747c){return BPromise[_0x085e('0x22')](_0x1d747c);}return _0x2114bb['save']();};}function saveUpdates(_0x45f571,_0x97dc1a){return function(_0xa1fda3){if(_0xa1fda3){return _0xa1fda3[_0x085e('0x23')](_0x45f571)[_0x085e('0x24')](function(_0x36caa8){return _0x36caa8;});}return null;};}function removeEntity(_0x53bbcb,_0xc41871){return function(_0x29fa66){if(_0x29fa66){return _0x29fa66[_0x085e('0x25')]()['then'](function(){var _0x10e7cf=_0x29fa66[_0x085e('0x26')]({'plain':!![]});var _0x900d4c=_0x085e('0x27');return db['UserProfileResource'][_0x085e('0x25')]({'where':{'type':_0x900d4c,'resourceId':_0x10e7cf['id']}})['then'](function(){return _0x29fa66;});})[_0x085e('0x24')](function(){_0x53bbcb['status'](0xcc)[_0x085e('0x1c')]();});}};}function handleEntityNotFound(_0xb22705,_0x591b48){return function(_0x37041d){if(!_0x37041d){_0xb22705[_0x085e('0x1a')](0x194);}return _0x37041d;};}function handleError(_0x162fbf,_0x96b04b){_0x96b04b=_0x96b04b||0x1f4;return function(_0x1f62a7){logger[_0x085e('0x28')](_0x1f62a7[_0x085e('0x29')]);if(_0x1f62a7[_0x085e('0x2a')]){delete _0x1f62a7[_0x085e('0x2a')];}_0x162fbf[_0x085e('0x1b')](_0x96b04b)[_0x085e('0x2b')](_0x1f62a7);};}exports[_0x085e('0x2c')]=function(_0x32bf8c,_0x3f1cbe){var _0x222e44={},_0x25ed35={},_0x181e2d={'count':0x0,'rows':[]};var _0x19deed=_[_0x085e('0x2d')](db[_0x085e('0x2e')]['rawAttributes'],function(_0x3ca9b0){return{'name':_0x3ca9b0[_0x085e('0x2f')],'type':_0x3ca9b0['type'][_0x085e('0x30')]};});_0x25ed35[_0x085e('0x31')]=_['map'](_0x19deed,_0x085e('0x2a'));_0x25ed35[_0x085e('0x32')]=_['keys'](_0x32bf8c[_0x085e('0x32')]);_0x25ed35[_0x085e('0x33')]=_[_0x085e('0x34')](_0x25ed35['model'],_0x25ed35[_0x085e('0x32')]);_0x222e44['attributes']=_['intersection'](_0x25ed35['model'],qs[_0x085e('0x35')](_0x32bf8c[_0x085e('0x32')][_0x085e('0x35')]));_0x222e44[_0x085e('0x36')]=_0x222e44[_0x085e('0x36')]['length']?_0x222e44[_0x085e('0x36')]:_0x25ed35['model'];if(!_0x32bf8c[_0x085e('0x32')][_0x085e('0x37')](_0x085e('0x38'))){_0x222e44[_0x085e('0x20')]=qs['limit'](_0x32bf8c[_0x085e('0x32')][_0x085e('0x20')]);_0x222e44['offset']=qs[_0x085e('0x1e')](_0x32bf8c[_0x085e('0x32')][_0x085e('0x1e')]);}_0x222e44['order']=qs['sort'](_0x32bf8c[_0x085e('0x32')][_0x085e('0x39')]);_0x222e44[_0x085e('0x3a')]=qs[_0x085e('0x33')](_['pick'](_0x32bf8c[_0x085e('0x32')],_0x25ed35[_0x085e('0x33')]),_0x19deed);if(_0x32bf8c[_0x085e('0x32')][_0x085e('0x3b')]){_0x222e44[_0x085e('0x3a')]=_[_0x085e('0x3c')](_0x222e44[_0x085e('0x3a')],{'$or':_['map'](_0x19deed,function(_0x43e7a0){if(_0x43e7a0[_0x085e('0x3d')]!==_0x085e('0x3e')){var _0x1c02b1={};_0x1c02b1[_0x43e7a0['name']]={'$like':'%'+_0x32bf8c[_0x085e('0x32')][_0x085e('0x3b')]+'%'};return _0x1c02b1;}})});}_0x222e44=_['merge']({},_0x222e44,_0x32bf8c[_0x085e('0x3f')]);var _0x246315={'where':_0x222e44[_0x085e('0x3a')]};return db['Campaign'][_0x085e('0x40')](_0x246315)[_0x085e('0x24')](function(_0x34d84f){_0x181e2d['count']=_0x34d84f;if(_0x32bf8c[_0x085e('0x32')][_0x085e('0x41')]){_0x222e44['include']=[{'all':!![]}];}return db[_0x085e('0x2e')]['findAll'](_0x222e44);})[_0x085e('0x24')](function(_0x102151){_0x181e2d[_0x085e('0x42')]=_0x102151;return _0x181e2d;})[_0x085e('0x24')](respondWithFilteredResult(_0x3f1cbe,_0x222e44))['catch'](handleError(_0x3f1cbe,null));};exports[_0x085e('0x43')]=function(_0xce6c34,_0x59333c){var _0x31c55b={'raw':![],'where':{'id':_0xce6c34[_0x085e('0x44')]['id']}},_0x4d0c3a={};_0x4d0c3a[_0x085e('0x31')]=_[_0x085e('0x45')](db[_0x085e('0x2e')][_0x085e('0x46')]);_0x4d0c3a[_0x085e('0x32')]=_[_0x085e('0x45')](_0xce6c34['query']);_0x4d0c3a[_0x085e('0x33')]=_['intersection'](_0x4d0c3a['model'],_0x4d0c3a[_0x085e('0x32')]);_0x31c55b[_0x085e('0x36')]=_['intersection'](_0x4d0c3a[_0x085e('0x31')],qs[_0x085e('0x35')](_0xce6c34[_0x085e('0x32')][_0x085e('0x35')]));_0x31c55b['attributes']=_0x31c55b[_0x085e('0x36')]['length']?_0x31c55b[_0x085e('0x36')]:_0x4d0c3a[_0x085e('0x31')];if(_0xce6c34[_0x085e('0x32')][_0x085e('0x41')]){_0x31c55b[_0x085e('0x47')]=[{'all':!![]}];}_0x31c55b=_[_0x085e('0x3c')]({},_0x31c55b,_0xce6c34[_0x085e('0x3f')]);return db[_0x085e('0x2e')][_0x085e('0x48')](_0x31c55b)['then'](handleEntityNotFound(_0x59333c,null))[_0x085e('0x24')](respondWithResult(_0x59333c,null))[_0x085e('0x49')](handleError(_0x59333c,null));};exports[_0x085e('0x4a')]=function(_0x7942ad,_0x9b3729){return db[_0x085e('0x2e')][_0x085e('0x4a')](_0x7942ad[_0x085e('0x4b')],{})[_0x085e('0x24')](function(_0x16dd04){var _0x1d0645=_0x7942ad[_0x085e('0x4c')]['get']({'plain':!![]});if(!_0x1d0645)throw new Error(_0x085e('0x4d'));if(_0x1d0645['role']===_0x085e('0x4c')){var _0xa3a277=_0x16dd04[_0x085e('0x26')]({'plain':!![]});var _0x27925f='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x27925f,'userProfileId':_0x1d0645[_0x085e('0x4e')]},'raw':!![]})[_0x085e('0x24')](function(_0xea25cc){if(_0xea25cc&&_0xea25cc['autoAssociation']===0x0){return db[_0x085e('0x4f')]['create']({'name':_0xa3a277[_0x085e('0x2a')],'resourceId':_0xa3a277['id'],'type':_0xea25cc[_0x085e('0x2a')],'sectionId':_0xea25cc['id']},{})[_0x085e('0x24')](function(){return _0x16dd04;});}else{return _0x16dd04;}})[_0x085e('0x49')](function(_0x39412d){logger[_0x085e('0x28')](_0x085e('0x50'),_0x39412d);throw _0x39412d;});}return _0x16dd04;})[_0x085e('0x24')](respondWithResult(_0x9b3729,0xc9))[_0x085e('0x49')](handleError(_0x9b3729,null));};exports[_0x085e('0x51')]=function(_0x19dc1f,_0x1f6b29){var _0x31941d={'where':{'id':_0x19dc1f[_0x085e('0x44')]['id']}},_0xa75e43={};_0xa75e43[_0x085e('0x31')]=_[_0x085e('0x45')](db[_0x085e('0x2e')][_0x085e('0x46')]);_0x31941d['attributes']=_[_0x085e('0x34')](_0xa75e43[_0x085e('0x31')],qs[_0x085e('0x35')](_0x19dc1f['query'][_0x085e('0x35')]));_0x31941d[_0x085e('0x36')]=_0x31941d[_0x085e('0x36')][_0x085e('0x52')]?_0x31941d[_0x085e('0x36')]:_0xa75e43['model'];if(_0x19dc1f[_0x085e('0x32')][_0x085e('0x41')]){_0x31941d[_0x085e('0x47')]=[{'all':!![]}];}_0x31941d=_[_0x085e('0x3c')]({},_0x31941d,_0x19dc1f[_0x085e('0x3f')]);return db[_0x085e('0x2e')][_0x085e('0x48')](_0x31941d)['then'](handleEntityNotFound(_0x1f6b29,null))[_0x085e('0x24')](function(_0x365a9f){if(_0x365a9f){var _0x27a241=_0x365a9f[_0x085e('0x26')]({'plain':!![]});_0x27a241=qs[_0x085e('0x53')](_0x27a241,['id',_0x085e('0x54'),_0x085e('0x55')]);_0x19dc1f[_0x085e('0x4b')]=_[_0x085e('0x53')](_0x19dc1f['body'],['id',_0x085e('0x54'),_0x085e('0x55')]);return db[_0x085e('0x2e')][_0x085e('0x4a')](_[_0x085e('0x3c')](_0x27a241,_0x19dc1f['body']),{'include':_0x19dc1f[_0x085e('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0x085e('0x24')](function(_0x40c1bc){var _0x274a56=_0x19dc1f[_0x085e('0x4c')]['get']({'plain':!![]});if(!_0x274a56)throw new Error(_0x085e('0x4d'));if(_0x274a56[_0x085e('0x56')]==='user'){var _0x20e5ef=_0x40c1bc[_0x085e('0x26')]({'plain':!![]});var _0x4ee2bb='IvrCampaigns';return db[_0x085e('0x57')]['find']({'where':{'name':_0x4ee2bb,'userProfileId':_0x274a56[_0x085e('0x4e')]},'raw':!![]})[_0x085e('0x24')](function(_0x696135){if(_0x696135&&_0x696135['autoAssociation']===0x0){return db[_0x085e('0x4f')][_0x085e('0x4a')]({'name':_0x20e5ef[_0x085e('0x2a')],'resourceId':_0x20e5ef['id'],'type':_0x696135[_0x085e('0x2a')],'sectionId':_0x696135['id']},{})[_0x085e('0x24')](function(){return _0x40c1bc;});}else{return _0x40c1bc;}})[_0x085e('0x49')](function(_0xfa1dfc){logger['error'](_0x085e('0x50'),_0xfa1dfc);throw _0xfa1dfc;});}return _0x40c1bc;});}})['then'](respondWithResult(_0x1f6b29,0xc9))[_0x085e('0x49')](handleError(_0x1f6b29,null));};exports[_0x085e('0x23')]=function(_0x45bb15,_0x6cd1ee){if(_0x45bb15[_0x085e('0x4b')]['id']){delete _0x45bb15[_0x085e('0x4b')]['id'];}return db[_0x085e('0x2e')][_0x085e('0x48')]({'where':{'id':_0x45bb15['params']['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x6cd1ee,null))[_0x085e('0x24')](saveUpdates(_0x45bb15[_0x085e('0x4b')],null))[_0x085e('0x24')](respondWithResult(_0x6cd1ee,null))[_0x085e('0x49')](handleError(_0x6cd1ee,null));};exports['destroy']=function(_0x1589bc,_0x139e4d){return db[_0x085e('0x2e')][_0x085e('0x48')]({'where':{'id':_0x1589bc[_0x085e('0x44')]['id']}})['then'](handleEntityNotFound(_0x139e4d,null))[_0x085e('0x24')](removeEntity(_0x139e4d,null))[_0x085e('0x49')](handleError(_0x139e4d,null));};exports[_0x085e('0x58')]=function(_0x47d72b,_0x49de63,_0x25fc48){var _0x578100={'raw':!![],'where':{}};var _0x263ea6={};var _0x2280e2={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x47d72b[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x49de63,null))[_0x085e('0x24')](function(_0x4358ed){if(_0x4358ed){_0x263ea6[_0x085e('0x31')]=_['keys'](db[_0x085e('0x59')][_0x085e('0x46')]);_0x263ea6['query']=_[_0x085e('0x45')](_0x47d72b[_0x085e('0x32')]);_0x263ea6[_0x085e('0x33')]=_[_0x085e('0x34')](_0x263ea6[_0x085e('0x31')],_0x263ea6[_0x085e('0x32')]);_0x578100['attributes']=_[_0x085e('0x34')](_0x263ea6['model'],qs[_0x085e('0x35')](_0x47d72b[_0x085e('0x32')][_0x085e('0x35')]));_0x578100[_0x085e('0x36')]=_0x578100[_0x085e('0x36')][_0x085e('0x52')]?_0x578100['attributes']:_0x263ea6['model'];if(!_0x47d72b['query'][_0x085e('0x37')](_0x085e('0x38'))){_0x578100['limit']=qs[_0x085e('0x20')](_0x47d72b[_0x085e('0x32')]['limit']);_0x578100[_0x085e('0x1e')]=qs[_0x085e('0x1e')](_0x47d72b[_0x085e('0x32')][_0x085e('0x1e')]);}_0x578100[_0x085e('0x5a')]=qs['sort'](_0x47d72b[_0x085e('0x32')]['sort']);_0x578100['where']=qs[_0x085e('0x33')](_[_0x085e('0x5b')](_0x47d72b[_0x085e('0x32')],_0x263ea6[_0x085e('0x33')]));_0x578100[_0x085e('0x3a')][_0x085e('0x5c')]=_0x4358ed['id'];if(_0x47d72b[_0x085e('0x32')][_0x085e('0x3b')]){_0x578100[_0x085e('0x3a')]=_[_0x085e('0x3c')](_0x578100['where'],{'$or':_[_0x085e('0x2d')](_0x578100['attributes'],function(_0x1cf1fa){var _0x4b55f8={};_0x4b55f8[_0x1cf1fa]={'$like':'%'+_0x47d72b['query'][_0x085e('0x3b')]+'%'};return _0x4b55f8;})});}_0x578100=_['merge']({},_0x578100,_0x47d72b[_0x085e('0x3f')]);return db[_0x085e('0x59')][_0x085e('0x40')]({'where':_0x578100[_0x085e('0x3a')]})['then'](function(_0x3fec90){_0x2280e2[_0x085e('0x40')]=_0x3fec90;if(_0x47d72b['query']['includeAll']){_0x578100[_0x085e('0x47')]=[{'all':!![]}];}return db[_0x085e('0x59')][_0x085e('0x5d')](_0x578100);})[_0x085e('0x24')](function(_0x29438b){_0x2280e2['rows']=_0x29438b;return _0x2280e2;});}})[_0x085e('0x24')](respondWithFilteredResult(_0x49de63,_0x578100))['catch'](handleError(_0x49de63,null));};exports[_0x085e('0x5e')]=function(_0x1d752b,_0x2455bb,_0xb1e189){var _0x3a78ad={'raw':!![],'where':{}};var _0x57f939={};var _0x5e6a97={'count':0x0,'rows':[]};return db[_0x085e('0x2e')][_0x085e('0x5f')]({'where':{'id':_0x1d752b[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x2455bb,null))[_0x085e('0x24')](function(_0x202be9){if(_0x202be9){_0x57f939['model']=_['keys'](db[_0x085e('0x60')]['rawAttributes']);_0x57f939[_0x085e('0x32')]=_['keys'](_0x1d752b[_0x085e('0x32')]);_0x57f939['filters']=_[_0x085e('0x34')](_0x57f939[_0x085e('0x31')],_0x57f939[_0x085e('0x32')]);_0x3a78ad[_0x085e('0x36')]=_[_0x085e('0x34')](_0x57f939['model'],qs[_0x085e('0x35')](_0x1d752b[_0x085e('0x32')]['fields']));_0x3a78ad[_0x085e('0x36')]=_0x3a78ad[_0x085e('0x36')][_0x085e('0x52')]?_0x3a78ad[_0x085e('0x36')]:_0x57f939[_0x085e('0x31')];if(!_0x1d752b['query'][_0x085e('0x37')](_0x085e('0x38'))){_0x3a78ad[_0x085e('0x20')]=qs[_0x085e('0x20')](_0x1d752b[_0x085e('0x32')][_0x085e('0x20')]);_0x3a78ad[_0x085e('0x1e')]=qs[_0x085e('0x1e')](_0x1d752b[_0x085e('0x32')][_0x085e('0x1e')]);}_0x3a78ad['order']=qs[_0x085e('0x39')](_0x1d752b[_0x085e('0x32')][_0x085e('0x39')]);_0x3a78ad[_0x085e('0x3a')]=qs['filters'](_[_0x085e('0x5b')](_0x1d752b['query'],_0x57f939[_0x085e('0x33')]));_0x3a78ad[_0x085e('0x3a')][_0x085e('0x5c')]=_0x202be9['id'];if(_0x1d752b[_0x085e('0x32')]['filter']){_0x3a78ad['where']=_[_0x085e('0x3c')](_0x3a78ad['where'],{'$or':_['map'](_0x3a78ad[_0x085e('0x36')],function(_0x19c0fb){var _0x216a56={};_0x216a56[_0x19c0fb]={'$like':'%'+_0x1d752b[_0x085e('0x32')][_0x085e('0x3b')]+'%'};return _0x216a56;})});}_0x3a78ad=_['merge']({},_0x3a78ad,_0x1d752b['options']);return db[_0x085e('0x60')][_0x085e('0x40')]({'where':_0x3a78ad[_0x085e('0x3a')]})['then'](function(_0x134f55){_0x5e6a97[_0x085e('0x40')]=_0x134f55;if(_0x1d752b[_0x085e('0x32')]['includeAll']){_0x3a78ad[_0x085e('0x47')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x085e('0x5d')](_0x3a78ad);})[_0x085e('0x24')](function(_0x1e5a62){_0x5e6a97[_0x085e('0x42')]=_0x1e5a62;return _0x5e6a97;});}})[_0x085e('0x24')](respondWithFilteredResult(_0x2455bb,_0x3a78ad))[_0x085e('0x49')](handleError(_0x2455bb,null));};exports['getHopperFinals']=function(_0xd6e167,_0x5cc811,_0x2423e0){var _0x112d92={'raw':!![],'where':{}};var _0x2667fd={};var _0x10628e={'count':0x0,'rows':[]};return db[_0x085e('0x2e')]['findOne']({'where':{'id':_0xd6e167[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x5cc811,null))['then'](function(_0x432e50){if(_0x432e50){_0x2667fd[_0x085e('0x31')]=_[_0x085e('0x45')](db[_0x085e('0x61')][_0x085e('0x46')]);_0x2667fd[_0x085e('0x32')]=_['keys'](_0xd6e167['query']);_0x2667fd[_0x085e('0x33')]=_['intersection'](_0x2667fd['model'],_0x2667fd['query']);_0x112d92[_0x085e('0x36')]=_['intersection'](_0x2667fd[_0x085e('0x31')],qs[_0x085e('0x35')](_0xd6e167[_0x085e('0x32')]['fields']));_0x112d92['attributes']=_0x112d92[_0x085e('0x36')][_0x085e('0x52')]?_0x112d92[_0x085e('0x36')]:_0x2667fd['model'];if(!_0xd6e167[_0x085e('0x32')][_0x085e('0x37')](_0x085e('0x38'))){_0x112d92['limit']=qs[_0x085e('0x20')](_0xd6e167[_0x085e('0x32')][_0x085e('0x20')]);_0x112d92['offset']=qs[_0x085e('0x1e')](_0xd6e167[_0x085e('0x32')][_0x085e('0x1e')]);}_0x112d92['order']=qs[_0x085e('0x39')](_0xd6e167[_0x085e('0x32')][_0x085e('0x39')]);_0x112d92['where']=qs['filters'](_[_0x085e('0x5b')](_0xd6e167['query'],_0x2667fd['filters']));_0x112d92[_0x085e('0x3a')]['CampaignId']=_0x432e50['id'];if(_0xd6e167['query'][_0x085e('0x3b')]){_0x112d92[_0x085e('0x3a')]=_['merge'](_0x112d92['where'],{'$or':_['map'](_0x112d92[_0x085e('0x36')],function(_0x5a7a7c){var _0x4c987b={};_0x4c987b[_0x5a7a7c]={'$like':'%'+_0xd6e167[_0x085e('0x32')][_0x085e('0x3b')]+'%'};return _0x4c987b;})});}_0x112d92=_[_0x085e('0x3c')]({},_0x112d92,_0xd6e167[_0x085e('0x3f')]);return db['CmHopperFinal'][_0x085e('0x40')]({'where':_0x112d92[_0x085e('0x3a')]})[_0x085e('0x24')](function(_0x120688){_0x10628e[_0x085e('0x40')]=_0x120688;if(_0xd6e167['query']['includeAll']){_0x112d92['include']=[{'all':!![]}];}return db[_0x085e('0x61')]['findAll'](_0x112d92);})[_0x085e('0x24')](function(_0x52243e){_0x10628e['rows']=_0x52243e;return _0x10628e;});}})['then'](respondWithFilteredResult(_0x5cc811,_0x112d92))['catch'](handleError(_0x5cc811,null));};exports['getHopperBlacks']=function(_0x19bc52,_0xf3dc94,_0x3b8a05){var _0xc34f3f={'raw':!![],'where':{}};var _0x55be06={};var _0xb65cbd={'count':0x0,'rows':[]};return db['Campaign'][_0x085e('0x5f')]({'where':{'id':_0x19bc52[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0xf3dc94,null))[_0x085e('0x24')](function(_0x14ba51){if(_0x14ba51){_0x55be06[_0x085e('0x31')]=_[_0x085e('0x45')](db[_0x085e('0x62')][_0x085e('0x46')]);_0x55be06['query']=_[_0x085e('0x45')](_0x19bc52[_0x085e('0x32')]);_0x55be06[_0x085e('0x33')]=_[_0x085e('0x34')](_0x55be06['model'],_0x55be06[_0x085e('0x32')]);_0xc34f3f[_0x085e('0x36')]=_[_0x085e('0x34')](_0x55be06[_0x085e('0x31')],qs['fields'](_0x19bc52['query']['fields']));_0xc34f3f[_0x085e('0x36')]=_0xc34f3f[_0x085e('0x36')]['length']?_0xc34f3f[_0x085e('0x36')]:_0x55be06['model'];if(!_0x19bc52[_0x085e('0x32')][_0x085e('0x37')](_0x085e('0x38'))){_0xc34f3f[_0x085e('0x20')]=qs[_0x085e('0x20')](_0x19bc52[_0x085e('0x32')][_0x085e('0x20')]);_0xc34f3f[_0x085e('0x1e')]=qs['offset'](_0x19bc52[_0x085e('0x32')][_0x085e('0x1e')]);}_0xc34f3f[_0x085e('0x5a')]=qs[_0x085e('0x39')](_0x19bc52[_0x085e('0x32')][_0x085e('0x39')]);_0xc34f3f[_0x085e('0x3a')]=qs['filters'](_[_0x085e('0x5b')](_0x19bc52[_0x085e('0x32')],_0x55be06[_0x085e('0x33')]));_0xc34f3f[_0x085e('0x3a')][_0x085e('0x5c')]=_0x14ba51['id'];if(_0x19bc52['query'][_0x085e('0x3b')]){_0xc34f3f[_0x085e('0x3a')]=_[_0x085e('0x3c')](_0xc34f3f[_0x085e('0x3a')],{'$or':_[_0x085e('0x2d')](_0xc34f3f[_0x085e('0x36')],function(_0x116a78){var _0x55b8a4={};_0x55b8a4[_0x116a78]={'$like':'%'+_0x19bc52[_0x085e('0x32')][_0x085e('0x3b')]+'%'};return _0x55b8a4;})});}_0xc34f3f=_['merge']({},_0xc34f3f,_0x19bc52[_0x085e('0x3f')]);return db['CmHopperBlack'][_0x085e('0x40')]({'where':_0xc34f3f[_0x085e('0x3a')]})[_0x085e('0x24')](function(_0x31d573){_0xb65cbd[_0x085e('0x40')]=_0x31d573;if(_0x19bc52['query'][_0x085e('0x41')]){_0xc34f3f[_0x085e('0x47')]=[{'all':!![]}];}return db[_0x085e('0x62')][_0x085e('0x5d')](_0xc34f3f);})['then'](function(_0x48d001){_0xb65cbd[_0x085e('0x42')]=_0x48d001;return _0xb65cbd;});}})[_0x085e('0x24')](respondWithFilteredResult(_0xf3dc94,_0xc34f3f))[_0x085e('0x49')](handleError(_0xf3dc94,null));};exports[_0x085e('0x63')]=function(_0xfef94d,_0x4d55e5,_0x3895ed){var _0x568040={};var _0x323bd9={};var _0x392768;var _0xa23572;return db[_0x085e('0x2e')]['findOne']({'where':{'id':_0xfef94d[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x4d55e5,null))[_0x085e('0x24')](function(_0x136888){if(_0x136888){_0x392768=_0x136888;_0x323bd9[_0x085e('0x31')]=_[_0x085e('0x45')](db[_0x085e('0x64')][_0x085e('0x46')]);_0x323bd9[_0x085e('0x32')]=_[_0x085e('0x45')](_0xfef94d[_0x085e('0x32')]);_0x323bd9[_0x085e('0x33')]=_[_0x085e('0x34')](_0x323bd9[_0x085e('0x31')],_0x323bd9[_0x085e('0x32')]);_0x568040[_0x085e('0x36')]=_[_0x085e('0x34')](_0x323bd9['model'],qs[_0x085e('0x35')](_0xfef94d['query'][_0x085e('0x35')]));_0x568040[_0x085e('0x36')]=_0x568040[_0x085e('0x36')]['length']?_0x568040[_0x085e('0x36')]:_0x323bd9['model'];_0x568040[_0x085e('0x5a')]=qs[_0x085e('0x39')](_0xfef94d[_0x085e('0x32')][_0x085e('0x39')]);_0x568040[_0x085e('0x3a')]=qs['filters'](_[_0x085e('0x5b')](_0xfef94d[_0x085e('0x32')],_0x323bd9[_0x085e('0x33')]));if(_0xfef94d['query'][_0x085e('0x3b')]){_0x568040[_0x085e('0x3a')]=_[_0x085e('0x3c')](_0x568040[_0x085e('0x3a')],{'$or':_[_0x085e('0x2d')](_0x568040[_0x085e('0x36')],function(_0x37d9c9){var _0x44c863={};_0x44c863[_0x37d9c9]={'$like':'%'+_0xfef94d[_0x085e('0x32')][_0x085e('0x3b')]+'%'};return _0x44c863;})});}_0x568040=_[_0x085e('0x3c')]({},_0x568040,_0xfef94d[_0x085e('0x3f')]);return _0x392768[_0x085e('0x63')](_0x568040);}})['then'](function(_0x107f15){if(_0x107f15){_0xa23572=_0x107f15['length'];if(!_0xfef94d[_0x085e('0x32')][_0x085e('0x37')](_0x085e('0x38'))){_0x568040[_0x085e('0x20')]=qs[_0x085e('0x20')](_0xfef94d[_0x085e('0x32')]['limit']);_0x568040['offset']=qs[_0x085e('0x1e')](_0xfef94d[_0x085e('0x32')][_0x085e('0x1e')]);}return _0x392768[_0x085e('0x63')](_0x568040);}})[_0x085e('0x24')](function(_0x1a4e06){if(_0x1a4e06){return _0x1a4e06?{'count':_0xa23572,'rows':_0x1a4e06}:null;}})[_0x085e('0x24')](respondWithResult(_0x4d55e5,null))[_0x085e('0x49')](handleError(_0x4d55e5,null));};exports[_0x085e('0x65')]=function(_0xcec444,_0x4d75d4,_0x19289a){var _0x4ad0bb,_0x32e16c;return db[_0x085e('0x2e')][_0x085e('0x48')]({'where':{'id':_0xcec444[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x4d75d4,null))[_0x085e('0x24')](function(_0x52653d){if(_0x52653d){_0x32e16c=_0x52653d;return _0x52653d[_0x085e('0x65')](_0xcec444[_0x085e('0x4b')][_0x085e('0x66')],_[_0x085e('0x53')](_0xcec444[_0x085e('0x4b')],[_0x085e('0x66'),'id'])||{});}return null;})[_0x085e('0x67')](function(_0x6a0dbc){var _0x584776;_0x4ad0bb=_0x6a0dbc||[];var _0x57a741=[];if(_0x6a0dbc){for(var _0x166604=0x0;_0x166604<_0x6a0dbc[_0x085e('0x52')];_0x166604+=0x1){var _0x4c12aa=_0x6a0dbc[_0x166604][_0x085e('0x26')]({'plain':!![]});_0x32e16c[_0x085e('0x68')]=_0xcec444[_0x085e('0x4b')][_0x085e('0x68')]?_0xcec444[_0x085e('0x4b')][_0x085e('0x68')]:_0x32e16c[_0x085e('0x68')];switch(_0x32e16c['dialCheckDuplicateType']){case _0x085e('0x69'):_0x584776=squel[_0x085e('0x6a')]()[_0x085e('0x6b')](_0x085e('0x6c'))[_0x085e('0x6d')]([_0x085e('0x6e'),_0x085e('0x6f'),'ContactId',_0x085e('0x70'),_0x085e('0x5c'),_0x085e('0x54'),_0x085e('0x55')],squel[_0x085e('0x71')]()['field']('phone',_0x085e('0x6e'))[_0x085e('0x72')]('NOW()','scheduledAt')[_0x085e('0x72')]('id',_0x085e('0x73'))['field'](_0x4c12aa[_0x085e('0x74')][_0x085e('0x75')](),_0x085e('0x70'))['field'](_0xcec444[_0x085e('0x44')]['id'][_0x085e('0x75')](),_0x085e('0x5c'))[_0x085e('0x72')](_0x085e('0x76'),'createdAt')[_0x085e('0x72')](_0x085e('0x76'),_0x085e('0x55'))['from'](_0x085e('0x77'))[_0x085e('0x3a')](_0x085e('0x78'))[_0x085e('0x3a')](_0x085e('0x79'),_0x4c12aa[_0x085e('0x74')]['toString']())[_0x085e('0x3a')](_0x085e('0x7a'))[_0x085e('0x3a')](_0x085e('0x7b'),squel[_0x085e('0x71')]()[_0x085e('0x72')](_0x085e('0x7c'))['from'](_0x085e('0x7d'))[_0x085e('0x3a')](_0x085e('0x7e'),_0xcec444[_0x085e('0x44')]['id'][_0x085e('0x75')]()))[_0x085e('0x3a')](_0x085e('0x7b'),squel['select']()['field'](_0x085e('0x7f'))[_0x085e('0x80')]('cm_hopper')[_0x085e('0x3a')](_0x085e('0x7e'),_0xcec444['params']['id'][_0x085e('0x75')]())))['toString']();break;case _0x085e('0x81'):_0x584776=squel[_0x085e('0x6a')]()[_0x085e('0x6b')]('cm_hopper')[_0x085e('0x6d')]([_0x085e('0x6e'),_0x085e('0x6f'),_0x085e('0x73'),'ListId','CampaignId',_0x085e('0x54'),_0x085e('0x55')],squel[_0x085e('0x71')]()[_0x085e('0x72')](_0x085e('0x6e'),_0x085e('0x6e'))[_0x085e('0x72')](_0x085e('0x76'),_0x085e('0x6f'))[_0x085e('0x72')]('id','ContactId')[_0x085e('0x72')](_0x4c12aa[_0x085e('0x74')]['toString'](),_0x085e('0x70'))[_0x085e('0x72')](_0xcec444['params']['id'][_0x085e('0x75')](),_0x085e('0x5c'))[_0x085e('0x72')](_0x085e('0x76'),_0x085e('0x54'))[_0x085e('0x72')](_0x085e('0x76'),'updatedAt')['from']('cm_contacts')[_0x085e('0x3a')]('deletedAt\x20IS\x20NULL')[_0x085e('0x3a')](_0x085e('0x79'),_0x4c12aa[_0x085e('0x74')][_0x085e('0x75')]())[_0x085e('0x3a')](_0x085e('0x7a'))[_0x085e('0x3a')](_0x085e('0x7b'),squel[_0x085e('0x71')]()[_0x085e('0x72')](_0x085e('0x7f'))[_0x085e('0x80')](_0x085e('0x6c'))[_0x085e('0x3a')]('CampaignId\x20=\x20?',_0xcec444[_0x085e('0x44')]['id']['toString']())))[_0x085e('0x75')]();break;default:_0x584776=squel[_0x085e('0x6a')]()[_0x085e('0x6b')](_0x085e('0x6c'))[_0x085e('0x6d')]([_0x085e('0x6e'),'scheduledAt',_0x085e('0x73'),_0x085e('0x70'),_0x085e('0x5c'),_0x085e('0x54'),_0x085e('0x55')],squel[_0x085e('0x71')]()['field'](_0x085e('0x6e'),_0x085e('0x6e'))[_0x085e('0x72')](_0x085e('0x76'),_0x085e('0x6f'))[_0x085e('0x72')]('id','ContactId')['field'](_0x4c12aa[_0x085e('0x74')][_0x085e('0x75')](),_0x085e('0x70'))[_0x085e('0x72')](_0xcec444[_0x085e('0x44')]['id'][_0x085e('0x75')](),_0x085e('0x5c'))['field'](_0x085e('0x76'),_0x085e('0x54'))[_0x085e('0x72')](_0x085e('0x76'),_0x085e('0x55'))['from'](_0x085e('0x77'))['where'](_0x085e('0x78'))['where'](_0x085e('0x79'),_0x4c12aa['CmListId']['toString']())[_0x085e('0x3a')](_0x085e('0x7a')))[_0x085e('0x75')]();}_0x57a741[_0x085e('0x82')](db[_0x085e('0x83')][_0x085e('0x32')](_0x584776));}return BPromise[_0x085e('0x84')](_0x57a741);}})['then'](function(){return _0x4ad0bb;})['then'](respondWithResult(_0x4d75d4,null))['catch'](handleError(_0x4d75d4,null));};exports[_0x085e('0x85')]=function(_0x2b82a7,_0x1ce355,_0x5a9026){return db[_0x085e('0x2e')]['find']({'where':{'id':_0x2b82a7[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x1ce355,null))[_0x085e('0x24')](function(_0x1c1237){if(_0x1c1237){return _0x1c1237['removeLists'](_0x2b82a7[_0x085e('0x32')][_0x085e('0x66')]);}})['then'](function(_0x1076dd){if(_0x1076dd){return db[_0x085e('0x59')][_0x085e('0x25')]({'where':{'ListId':_0x2b82a7[_0x085e('0x32')][_0x085e('0x66')],'CampaignId':_0x2b82a7[_0x085e('0x44')]['id']}})[_0x085e('0x24')](function(){return _0x1076dd;});}})['then'](respondWithStatusCode(_0x1ce355,null))[_0x085e('0x49')](handleError(_0x1ce355,null));};exports[_0x085e('0x86')]=function(_0x5314a2,_0x34ae3c,_0x4c717f){var _0x39cc28={};var _0x57b6be={};var _0xe1050;var _0x2d642d;return db[_0x085e('0x2e')][_0x085e('0x5f')]({'where':{'id':_0x5314a2[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x34ae3c,null))[_0x085e('0x24')](function(_0x3d586d){if(_0x3d586d){_0xe1050=_0x3d586d;_0x57b6be[_0x085e('0x31')]=_[_0x085e('0x45')](db[_0x085e('0x64')][_0x085e('0x46')]);_0x57b6be[_0x085e('0x32')]=_[_0x085e('0x45')](_0x5314a2[_0x085e('0x32')]);_0x57b6be['filters']=_[_0x085e('0x34')](_0x57b6be[_0x085e('0x31')],_0x57b6be['query']);_0x39cc28[_0x085e('0x36')]=_[_0x085e('0x34')](_0x57b6be[_0x085e('0x31')],qs[_0x085e('0x35')](_0x5314a2[_0x085e('0x32')][_0x085e('0x35')]));_0x39cc28['attributes']=_0x39cc28[_0x085e('0x36')]['length']?_0x39cc28[_0x085e('0x36')]:_0x57b6be['model'];_0x39cc28[_0x085e('0x5a')]=qs[_0x085e('0x39')](_0x5314a2['query'][_0x085e('0x39')]);_0x39cc28[_0x085e('0x3a')]=qs[_0x085e('0x33')](_[_0x085e('0x5b')](_0x5314a2['query'],_0x57b6be[_0x085e('0x33')]));if(_0x5314a2[_0x085e('0x32')][_0x085e('0x3b')]){_0x39cc28['where']=_[_0x085e('0x3c')](_0x39cc28['where'],{'$or':_[_0x085e('0x2d')](_0x39cc28[_0x085e('0x36')],function(_0x4f5b67){var _0x2ce799={};_0x2ce799[_0x4f5b67]={'$like':'%'+_0x5314a2['query'][_0x085e('0x3b')]+'%'};return _0x2ce799;})});}_0x39cc28=_[_0x085e('0x3c')]({},_0x39cc28,_0x5314a2[_0x085e('0x3f')]);return _0xe1050[_0x085e('0x86')](_0x39cc28);}})['then'](function(_0x3c43cc){if(_0x3c43cc){_0x2d642d=_0x3c43cc[_0x085e('0x52')];if(!_0x5314a2['query'][_0x085e('0x37')]('nolimit')){_0x39cc28[_0x085e('0x20')]=qs[_0x085e('0x20')](_0x5314a2['query']['limit']);_0x39cc28['offset']=qs[_0x085e('0x1e')](_0x5314a2['query'][_0x085e('0x1e')]);}return _0xe1050[_0x085e('0x86')](_0x39cc28);}})['then'](function(_0x1466f5){if(_0x1466f5){return _0x1466f5?{'count':_0x2d642d,'rows':_0x1466f5}:null;}})[_0x085e('0x24')](respondWithResult(_0x34ae3c,null))[_0x085e('0x49')](handleError(_0x34ae3c,null));};exports['addBlackLists']=function(_0x2d9a58,_0x3d8f1d,_0x4eab8e){var _0x19cf86,_0x35ddd8;return db['Campaign'][_0x085e('0x48')]({'where':{'id':_0x2d9a58['params']['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x3d8f1d,null))[_0x085e('0x24')](function(_0x4d1a64){if(_0x4d1a64){_0x35ddd8=_0x4d1a64;return _0x4d1a64[_0x085e('0x87')](_0x2d9a58[_0x085e('0x4b')][_0x085e('0x66')],_[_0x085e('0x53')](_0x2d9a58[_0x085e('0x4b')],['ids','id'])||{});}return null;})[_0x085e('0x67')](function(_0x52b87a){var _0x1277b8;_0x19cf86=_0x52b87a||[];var _0x1b84b9=[];if(_0x52b87a){for(var _0x7f31be=0x0;_0x7f31be<_0x52b87a[_0x085e('0x52')];_0x7f31be+=0x1){var _0x503cbb=_0x52b87a[_0x7f31be][_0x085e('0x26')]({'plain':!![]});_0x1277b8=squel['insert']()[_0x085e('0x6b')](_0x085e('0x88'))[_0x085e('0x6d')]([_0x085e('0x6e'),_0x085e('0x73'),'ListId',_0x085e('0x5c'),_0x085e('0x54'),_0x085e('0x55')],squel[_0x085e('0x71')]()['field'](_0x085e('0x6e'),_0x085e('0x6e'))[_0x085e('0x72')]('id',_0x085e('0x73'))['field'](_0x503cbb[_0x085e('0x74')]['toString'](),'ListId')[_0x085e('0x72')](_0x2d9a58[_0x085e('0x44')]['id'][_0x085e('0x75')](),_0x085e('0x5c'))['field']('NOW()',_0x085e('0x54'))[_0x085e('0x72')](_0x085e('0x76'),_0x085e('0x55'))[_0x085e('0x80')](_0x085e('0x77'))[_0x085e('0x3a')]('deletedAt\x20IS\x20NULL')[_0x085e('0x3a')]('ListId\x20=\x20?',_0x503cbb[_0x085e('0x74')][_0x085e('0x75')]())[_0x085e('0x3a')](_0x085e('0x7a')))['toString']();_0x1b84b9[_0x085e('0x82')](db[_0x085e('0x83')][_0x085e('0x32')](_0x1277b8));}return BPromise[_0x085e('0x84')](_0x1b84b9);}})[_0x085e('0x24')](function(){return _0x19cf86;})[_0x085e('0x24')](respondWithResult(_0x3d8f1d,null))[_0x085e('0x49')](handleError(_0x3d8f1d,null));};exports[_0x085e('0x89')]=function(_0x4a86e5,_0x36256c,_0x58a5cc){return db['Campaign'][_0x085e('0x48')]({'where':{'id':_0x4a86e5[_0x085e('0x44')]['id']}})[_0x085e('0x24')](handleEntityNotFound(_0x36256c,null))[_0x085e('0x24')](function(_0x5efef2){if(_0x5efef2){return _0x5efef2[_0x085e('0x89')](_0x4a86e5[_0x085e('0x32')][_0x085e('0x66')]);}})[_0x085e('0x24')](function(_0x50e6ba){if(_0x50e6ba){return db['CmHopperBlack'][_0x085e('0x25')]({'where':{'ListId':_0x4a86e5[_0x085e('0x32')][_0x085e('0x66')],'CampaignId':_0x4a86e5[_0x085e('0x44')]['id']}})[_0x085e('0x24')](function(){return _0x50e6ba;});}})[_0x085e('0x24')](respondWithStatusCode(_0x36256c,null))[_0x085e('0x49')](handleError(_0x36256c,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index a58c1da..35fe5db 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_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':'campaigns','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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_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 5bbc1e3..87199cf 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 _0x2121=['request\x20sent','stringify','error','message','GetCampaign','Campaign','options','raw','where','limit','include','map','model','attributes','debug','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s'];(function(_0x4b1cb8,_0x33d977){var _0x25d6ed=function(_0x21134c){while(--_0x21134c){_0x4b1cb8['push'](_0x4b1cb8['shift']());}};_0x25d6ed(++_0x33d977);}(_0x2121,0x1b4));var _0x1212=function(_0x25986d,_0x4ea0b6){_0x25986d=_0x25986d-0x0;var _0x1a694b=_0x2121[_0x25986d];return _0x1a694b;};'use strict';var _=require(_0x1212('0x0'));var util=require(_0x1212('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1212('0x2'));var fs=require('fs');var Redis=require(_0x1212('0x3'));var db=require(_0x1212('0x4'))['db'];var utils=require(_0x1212('0x5'));var logger=require(_0x1212('0x6'))('rpc');var config=require(_0x1212('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1212('0x8')][_0x1212('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20fadc,_0x1b1ef5,_0x233a53){return new BPromise(function(_0x642ed5,_0x4a3d2a){return client[_0x1212('0xa')](_0x20fadc,_0x233a53)[_0x1212('0xb')](function(_0x434d23){logger[_0x1212('0xc')](_0x1212('0xd'),_0x1b1ef5,_0x1212('0xe'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x1b1ef5,_0x1212('0xe'),JSON[_0x1212('0xf')](_0x434d23));if(_0x434d23[_0x1212('0x10')]){if(_0x434d23[_0x1212('0x10')]['code']===0x1f4){logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);return _0x4a3d2a(_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);}logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);return _0x642ed5(_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);}else{logger[_0x1212('0xc')](_0x1212('0xd'),_0x1b1ef5,_0x1212('0xe'));_0x642ed5(_0x434d23['result']['message']);}})['catch'](function(_0x3cfe21){logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x3cfe21);_0x4a3d2a(_0x3cfe21);});});}exports[_0x1212('0x12')]=function(_0x3cf284){var _0x3face0=this;return new Promise(function(_0xb0dc88,_0x22eefb){return db[_0x1212('0x13')]['findAll']({'raw':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')][_0x1212('0x15')]===undefined?!![]:![]:!![],'where':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')][_0x1212('0x16')]||null:null,'attributes':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')]['attributes']||null:null,'limit':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')][_0x1212('0x17')]||null:null,'include':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')][_0x1212('0x18')]?_[_0x1212('0x19')](_0x3cf284[_0x1212('0x14')]['include'],function(_0x58ab5b){return{'model':db[_0x58ab5b['model']],'as':_0x58ab5b['as'],'attributes':_0x58ab5b['attributes'],'include':_0x58ab5b['include']?_[_0x1212('0x19')](_0x58ab5b[_0x1212('0x18')],function(_0x4c32a7){return{'model':db[_0x4c32a7[_0x1212('0x1a')]],'as':_0x4c32a7['as'],'attributes':_0x4c32a7[_0x1212('0x1b')],'include':_0x4c32a7['include']?_[_0x1212('0x19')](_0x4c32a7[_0x1212('0x18')],function(_0x4630b4){return{'model':db[_0x4630b4[_0x1212('0x1a')]],'as':_0x4630b4['as'],'attributes':_0x4630b4[_0x1212('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1212('0xb')](function(_0x2750b0){logger[_0x1212('0xc')]('GetCampaign',_0x3cf284);logger[_0x1212('0x1c')](_0x1212('0x12'),_0x3cf284,JSON[_0x1212('0xf')](_0x2750b0));_0xb0dc88(_0x2750b0);})[_0x1212('0x1d')](function(_0x17d0f6){logger[_0x1212('0x10')](_0x1212('0x12'),_0x17d0f6[_0x1212('0x11')],_0x3cf284);_0x22eefb(_0x3face0[_0x1212('0x10')](0x1f4,_0x17d0f6[_0x1212('0x11')]));});});};
\ No newline at end of file
+var _0x96a2=['jayson/promise','client','http','request','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','Campaign,\x20%s,\x20%s','message','GetCampaign','findAll','options','where','attributes','limit','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x12c8f7,_0x38edf6){var _0x43c77a=function(_0x18cb2f){while(--_0x18cb2f){_0x12c8f7['push'](_0x12c8f7['shift']());}};_0x43c77a(++_0x38edf6);}(_0x96a2,0x96));var _0x296a=function(_0x3fddda,_0x4d0ca0){_0x3fddda=_0x3fddda-0x0;var _0x5ba097=_0x96a2[_0x3fddda];return _0x5ba097;};'use strict';var _=require(_0x296a('0x0'));var util=require('util');var moment=require(_0x296a('0x1'));var BPromise=require(_0x296a('0x2'));var rs=require(_0x296a('0x3'));var fs=require('fs');var Redis=require(_0x296a('0x4'));var db=require(_0x296a('0x5'))['db'];var utils=require(_0x296a('0x6'));var logger=require(_0x296a('0x7'))(_0x296a('0x8'));var config=require(_0x296a('0x9'));var jayson=require(_0x296a('0xa'));var client=jayson[_0x296a('0xb')][_0x296a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4eb919,_0x273b83,_0x3c3486){return new BPromise(function(_0x3a2b44,_0x17d4d2){return client[_0x296a('0xd')](_0x4eb919,_0x3c3486)['then'](function(_0x307644){logger[_0x296a('0xe')]('Campaign,\x20%s,\x20%s',_0x273b83,_0x296a('0xf'));logger[_0x296a('0x10')](_0x296a('0x11'),_0x273b83,_0x296a('0xf'),JSON[_0x296a('0x12')](_0x307644));if(_0x307644[_0x296a('0x13')]){if(_0x307644[_0x296a('0x13')]['code']===0x1f4){logger[_0x296a('0x13')](_0x296a('0x14'),_0x273b83,_0x307644[_0x296a('0x13')][_0x296a('0x15')]);return _0x17d4d2(_0x307644[_0x296a('0x13')]['message']);}logger[_0x296a('0x13')](_0x296a('0x14'),_0x273b83,_0x307644['error'][_0x296a('0x15')]);return _0x3a2b44(_0x307644[_0x296a('0x13')][_0x296a('0x15')]);}else{logger[_0x296a('0xe')](_0x296a('0x14'),_0x273b83,_0x296a('0xf'));_0x3a2b44(_0x307644['result'][_0x296a('0x15')]);}})['catch'](function(_0x55864e){logger['error'](_0x296a('0x14'),_0x273b83,_0x55864e);_0x17d4d2(_0x55864e);});});}exports[_0x296a('0x16')]=function(_0x2b82d6){var _0x55295f=this;return new Promise(function(_0x51ba98,_0x3e72fa){return db['Campaign'][_0x296a('0x17')]({'raw':_0x2b82d6[_0x296a('0x18')]?_0x2b82d6[_0x296a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2b82d6[_0x296a('0x18')]?_0x2b82d6[_0x296a('0x18')][_0x296a('0x19')]||null:null,'attributes':_0x2b82d6['options']?_0x2b82d6[_0x296a('0x18')][_0x296a('0x1a')]||null:null,'limit':_0x2b82d6['options']?_0x2b82d6['options'][_0x296a('0x1b')]||null:null,'include':_0x2b82d6[_0x296a('0x18')]?_0x2b82d6[_0x296a('0x18')][_0x296a('0x1c')]?_[_0x296a('0x1d')](_0x2b82d6[_0x296a('0x18')][_0x296a('0x1c')],function(_0x2cf007){return{'model':db[_0x2cf007[_0x296a('0x1e')]],'as':_0x2cf007['as'],'attributes':_0x2cf007[_0x296a('0x1a')],'include':_0x2cf007[_0x296a('0x1c')]?_[_0x296a('0x1d')](_0x2cf007[_0x296a('0x1c')],function(_0xf6b922){return{'model':db[_0xf6b922[_0x296a('0x1e')]],'as':_0xf6b922['as'],'attributes':_0xf6b922['attributes'],'include':_0xf6b922[_0x296a('0x1c')]?_[_0x296a('0x1d')](_0xf6b922['include'],function(_0x2c4bed){return{'model':db[_0x2c4bed[_0x296a('0x1e')]],'as':_0x2c4bed['as'],'attributes':_0x2c4bed[_0x296a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24b280){logger[_0x296a('0xe')]('GetCampaign',_0x2b82d6);logger['debug'](_0x296a('0x16'),_0x2b82d6,JSON[_0x296a('0x12')](_0x24b280));_0x51ba98(_0x24b280);})[_0x296a('0x1f')](function(_0x583548){logger['error'](_0x296a('0x16'),_0x583548[_0x296a('0x15')],_0x2b82d6);_0x3e72fa(_0x55295f[_0x296a('0x13')](0x1f4,_0x583548[_0x296a('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 04c6066..2a0ecfa 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 _0xd93a=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','addLists','addBlackLists','put','update','destroy','delete','exports','util','path'];(function(_0x127abd,_0xabc647){var _0x19b3aa=function(_0x2a4bcc){while(--_0x2a4bcc){_0x127abd['push'](_0x127abd['shift']());}};_0x19b3aa(++_0xabc647);}(_0xd93a,0xa3));var _0xad93=function(_0x2e5687,_0x3ff69a){_0x2e5687=_0x2e5687-0x0;var _0x5891d2=_0xd93a[_0x2e5687];return _0x5891d2;};'use strict';var multer=require('multer');var util=require(_0xad93('0x0'));var path=require(_0xad93('0x1'));var timeout=require(_0xad93('0x2'));var express=require(_0xad93('0x3'));var router=express[_0xad93('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xad93('0x5'));var interaction=require(_0xad93('0x6'));var config=require(_0xad93('0x7'));var controller=require(_0xad93('0x8'));router[_0xad93('0x9')]('/',auth[_0xad93('0xa')](),controller[_0xad93('0xb')]);router['get'](_0xad93('0xc'),auth[_0xad93('0xa')](),controller[_0xad93('0xd')]);router['get'](_0xad93('0xe'),auth[_0xad93('0xa')](),controller[_0xad93('0xf')]);router['get'](_0xad93('0x10'),auth['isAuthenticated'](),controller[_0xad93('0x11')]);router[_0xad93('0x9')](_0xad93('0x12'),auth['isAuthenticated'](),controller[_0xad93('0x13')]);router['get'](_0xad93('0x14'),auth[_0xad93('0xa')](),controller[_0xad93('0x15')]);router[_0xad93('0x9')](_0xad93('0x16'),auth[_0xad93('0xa')](),controller['getLists']);router['get'](_0xad93('0x17'),auth[_0xad93('0xa')](),controller[_0xad93('0x18')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xad93('0x19')]('/:id/clone',auth[_0xad93('0xa')](),controller['clone']);router['post']('/:id/lists',auth[_0xad93('0xa')](),controller[_0xad93('0x1a')]);router[_0xad93('0x19')](_0xad93('0x17'),auth['isAuthenticated'](),controller[_0xad93('0x1b')]);router[_0xad93('0x1c')]('/:id',auth[_0xad93('0xa')](),controller[_0xad93('0x1d')]);router['delete'](_0xad93('0xc'),auth[_0xad93('0xa')](),controller[_0xad93('0x1e')]);router[_0xad93('0x1f')]('/:id/lists',auth[_0xad93('0xa')](),controller['removeLists']);router[_0xad93('0x1f')]('/:id/blacklists',auth[_0xad93('0xa')](),controller['removeBlackLists']);module[_0xad93('0x20')]=router;
\ No newline at end of file
+var _0x077a=['getHopperHistories','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','/:id','update','delete','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','getHoppers','/:id/hopper_histories'];(function(_0x11d230,_0x4542ab){var _0x488064=function(_0x2f8f4f){while(--_0x2f8f4f){_0x11d230['push'](_0x11d230['shift']());}};_0x488064(++_0x4542ab);}(_0x077a,0x1f2));var _0xa077=function(_0x404bda,_0x1c2365){_0x404bda=_0x404bda-0x0;var _0x4b5a6e=_0x077a[_0x404bda];return _0x4b5a6e;};'use strict';var multer=require(_0xa077('0x0'));var util=require('util');var path=require(_0xa077('0x1'));var timeout=require(_0xa077('0x2'));var express=require(_0xa077('0x3'));var router=express[_0xa077('0x4')]();var fs_extra=require(_0xa077('0x5'));var auth=require(_0xa077('0x6'));var interaction=require(_0xa077('0x7'));var config=require(_0xa077('0x8'));var controller=require('./campaign.controller');router[_0xa077('0x9')]('/',auth[_0xa077('0xa')](),controller['index']);router['get']('/:id',auth[_0xa077('0xa')](),controller[_0xa077('0xb')]);router['get']('/:id/hoppers',auth[_0xa077('0xa')](),controller[_0xa077('0xc')]);router[_0xa077('0x9')](_0xa077('0xd'),auth[_0xa077('0xa')](),controller[_0xa077('0xe')]);router[_0xa077('0x9')]('/:id/hopper_finals',auth[_0xa077('0xa')](),controller[_0xa077('0xf')]);router[_0xa077('0x9')](_0xa077('0x10'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xa077('0x9')](_0xa077('0x11'),auth[_0xa077('0xa')](),controller[_0xa077('0x12')]);router[_0xa077('0x9')](_0xa077('0x13'),auth[_0xa077('0xa')](),controller[_0xa077('0x14')]);router[_0xa077('0x15')]('/',auth[_0xa077('0xa')](),controller[_0xa077('0x16')]);router[_0xa077('0x15')](_0xa077('0x17'),auth[_0xa077('0xa')](),controller[_0xa077('0x18')]);router[_0xa077('0x15')](_0xa077('0x11'),auth[_0xa077('0xa')](),controller[_0xa077('0x19')]);router[_0xa077('0x15')](_0xa077('0x13'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0xa077('0x1a')](_0xa077('0x1b'),auth[_0xa077('0xa')](),controller[_0xa077('0x1c')]);router[_0xa077('0x1d')]('/:id',auth[_0xa077('0xa')](),controller['destroy']);router[_0xa077('0x1d')](_0xa077('0x11'),auth[_0xa077('0xa')](),controller['removeLists']);router[_0xa077('0x1d')](_0xa077('0x13'),auth[_0xa077('0xa')](),controller[_0xa077('0x1e')]);module[_0xa077('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 0d16c4e..f74e246 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 _0x92bd=['sequelize','exports','STRING','TEXT','VIRTUAL','key'];(function(_0x9a65e1,_0x4b3471){var _0x36e14e=function(_0x4d951a){while(--_0x4d951a){_0x9a65e1['push'](_0x9a65e1['shift']());}};_0x36e14e(++_0x4b3471);}(_0x92bd,0x8a));var _0xd92b=function(_0x21192f,_0x131d0f){_0x21192f=_0x21192f-0x0;var _0x4006dc=_0x92bd[_0x21192f];return _0x4006dc;};'use strict';var Sequelize=require(_0xd92b('0x0'));module[_0xd92b('0x1')]={'key':{'type':Sequelize[_0xd92b('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xd92b('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xd92b('0x2')]},'name':{'type':Sequelize[_0xd92b('0x4')],'get':function(){return this['getDataValue'](_0xd92b('0x5'));}}};
\ No newline at end of file
+var _0x04b4=['key','exports','TEXT','STRING','getDataValue'];(function(_0x486398,_0x370d53){var _0x2d4bc5=function(_0x4013f9){while(--_0x4013f9){_0x486398['push'](_0x486398['shift']());}};_0x2d4bc5(++_0x370d53);}(_0x04b4,0x1c8));var _0x404b=function(_0x6e6fa2,_0x2c592c){_0x6e6fa2=_0x6e6fa2-0x0;var _0x5c619e=_0x04b4[_0x6e6fa2];return _0x5c619e;};'use strict';var Sequelize=require('sequelize');module[_0x404b('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x404b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x404b('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x404b('0x3')](_0x404b('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index accb94c..6e79dde 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 _0x7898=['MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','body','find','params'];(function(_0x3af9a9,_0x4431c6){var _0x599d29=function(_0x5ceafe){while(--_0x5ceafe){_0x3af9a9['push'](_0x3af9a9['shift']());}};_0x599d29(++_0x4431c6);}(_0x7898,0x175));var _0x8789=function(_0x4f9922,_0x5182d5){_0x4f9922=_0x4f9922-0x0;var _0x3d6a25=_0x7898[_0x4f9922];return _0x3d6a25;};'use strict';var emlformat=require(_0x8789('0x0'));var rimraf=require(_0x8789('0x1'));var zipdir=require(_0x8789('0x2'));var jsonpatch=require(_0x8789('0x3'));var rp=require(_0x8789('0x4'));var moment=require(_0x8789('0x5'));var BPromise=require(_0x8789('0x6'));var Mustache=require('mustache');var util=require(_0x8789('0x7'));var path=require(_0x8789('0x8'));var sox=require(_0x8789('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8789('0xa'));var _=require(_0x8789('0xb'));var squel=require(_0x8789('0xc'));var crypto=require(_0x8789('0xd'));var jsforce=require(_0x8789('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8789('0xf'));var querystring=require(_0x8789('0x10'));var Papa=require(_0x8789('0x11'));var Redis=require(_0x8789('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8789('0x13'));var as=require(_0x8789('0x14'));var hardwareService=require(_0x8789('0x15'));var logger=require(_0x8789('0x16'))(_0x8789('0x17'));var utils=require(_0x8789('0x18'));var config=require(_0x8789('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3614f7,_0x9ec441){_0x9ec441=_0x9ec441||0xcc;return function(_0x45276e){if(_0x45276e){return _0x3614f7['sendStatus'](_0x9ec441);}return _0x3614f7['status'](_0x9ec441)[_0x8789('0x1a')]();};}function respondWithResult(_0x5ae9b9,_0x53f2e9){_0x53f2e9=_0x53f2e9||0xc8;return function(_0x200e25){if(_0x200e25){return _0x5ae9b9[_0x8789('0x1b')](_0x53f2e9)[_0x8789('0x1c')](_0x200e25);}};}function respondWithFilteredResult(_0x5ce88e,_0x15aad8){return function(_0x14cc39){if(_0x14cc39){var _0x165460=typeof _0x15aad8[_0x8789('0x1d')]===_0x8789('0x1e')&&typeof _0x15aad8[_0x8789('0x1f')]===_0x8789('0x1e');var _0x435b55=_0x14cc39[_0x8789('0x20')];var _0x43fbab=_0x165460?0x0:_0x15aad8['offset'];var _0x419f5a=_0x165460?_0x14cc39[_0x8789('0x20')]:_0x15aad8['offset']+_0x15aad8[_0x8789('0x1f')];var _0x43ea3f;if(_0x419f5a>=_0x435b55){_0x419f5a=_0x435b55;_0x43ea3f=0xc8;}else{_0x43ea3f=0xce;}_0x5ce88e[_0x8789('0x1b')](_0x43ea3f);return _0x5ce88e['set'](_0x8789('0x21'),_0x43fbab+'-'+_0x419f5a+'/'+_0x435b55)[_0x8789('0x1c')](_0x14cc39);}return null;};}function patchUpdates(_0x514eb8){return function(_0x51181c){try{jsonpatch[_0x8789('0x22')](_0x51181c,_0x514eb8,!![]);}catch(_0x360c41){return BPromise[_0x8789('0x23')](_0x360c41);}return _0x51181c[_0x8789('0x24')]();};}function saveUpdates(_0xe70f7,_0x4a2d05){return function(_0x639ebd){if(_0x639ebd){return _0x639ebd[_0x8789('0x25')](_0xe70f7)[_0x8789('0x26')](function(_0x12e57a){return _0x12e57a;});}return null;};}function removeEntity(_0x4e4b4a,_0x5d8c7f){return function(_0x935963){if(_0x935963){return _0x935963[_0x8789('0x27')]()['then'](function(){var _0x27ebb2=_0x935963[_0x8789('0x28')]({'plain':!![]});var _0x4e7558=_0x8789('0x29');return db[_0x8789('0x2a')]['destroy']({'where':{'type':_0x4e7558,'resourceId':_0x27ebb2['id']}})[_0x8789('0x26')](function(){return _0x935963;});})[_0x8789('0x26')](function(){_0x4e4b4a[_0x8789('0x1b')](0xcc)[_0x8789('0x1a')]();});}};}function handleEntityNotFound(_0x39fd6f,_0x223fda){return function(_0x54b9e0){if(!_0x54b9e0){_0x39fd6f[_0x8789('0x2b')](0x194);}return _0x54b9e0;};}function handleError(_0x6411e8,_0x7d36ca){_0x7d36ca=_0x7d36ca||0x1f4;return function(_0x5d5827){logger['error'](_0x5d5827['stack']);if(_0x5d5827[_0x8789('0x2c')]){delete _0x5d5827[_0x8789('0x2c')];}_0x6411e8[_0x8789('0x1b')](_0x7d36ca)[_0x8789('0x2d')](_0x5d5827);};}exports[_0x8789('0x2e')]=function(_0x4972fa,_0x3ab819){var _0x15d3f2={},_0x456ec4={},_0x37c126={'count':0x0,'rows':[]};var _0x1926d5=_[_0x8789('0x2f')](db[_0x8789('0x30')][_0x8789('0x31')],function(_0x47358e){return{'name':_0x47358e['fieldName'],'type':_0x47358e[_0x8789('0x32')][_0x8789('0x33')]};});_0x456ec4[_0x8789('0x34')]=_[_0x8789('0x2f')](_0x1926d5,'name');_0x456ec4[_0x8789('0x35')]=_[_0x8789('0x36')](_0x4972fa[_0x8789('0x35')]);_0x456ec4[_0x8789('0x37')]=_['intersection'](_0x456ec4[_0x8789('0x34')],_0x456ec4[_0x8789('0x35')]);_0x15d3f2[_0x8789('0x38')]=_[_0x8789('0x39')](_0x456ec4[_0x8789('0x34')],qs[_0x8789('0x3a')](_0x4972fa['query'][_0x8789('0x3a')]));_0x15d3f2[_0x8789('0x38')]=_0x15d3f2[_0x8789('0x38')][_0x8789('0x3b')]?_0x15d3f2[_0x8789('0x38')]:_0x456ec4[_0x8789('0x34')];if(!_0x4972fa['query'][_0x8789('0x3c')](_0x8789('0x3d'))){_0x15d3f2['limit']=qs[_0x8789('0x1f')](_0x4972fa['query'][_0x8789('0x1f')]);_0x15d3f2[_0x8789('0x1d')]=qs[_0x8789('0x1d')](_0x4972fa[_0x8789('0x35')][_0x8789('0x1d')]);}_0x15d3f2[_0x8789('0x3e')]=qs[_0x8789('0x3f')](_0x4972fa[_0x8789('0x35')][_0x8789('0x3f')]);_0x15d3f2[_0x8789('0x40')]=qs[_0x8789('0x37')](_[_0x8789('0x41')](_0x4972fa['query'],_0x456ec4['filters']),_0x1926d5);if(_0x4972fa['query'][_0x8789('0x42')]){_0x15d3f2[_0x8789('0x40')]=_[_0x8789('0x43')](_0x15d3f2['where'],{'$or':[{'key':{'$like':'%'+_0x4972fa['query'][_0x8789('0x42')]+'%'}},{'value':{'$like':'%'+_0x4972fa[_0x8789('0x35')][_0x8789('0x42')]+'%'}}]});}_0x15d3f2=_[_0x8789('0x43')]({},_0x15d3f2,_0x4972fa[_0x8789('0x44')]);var _0x2bcbd2={'where':_0x15d3f2[_0x8789('0x40')]};return db[_0x8789('0x30')][_0x8789('0x20')](_0x2bcbd2)[_0x8789('0x26')](function(_0x3c72e5){_0x37c126[_0x8789('0x20')]=_0x3c72e5;if(_0x4972fa[_0x8789('0x35')][_0x8789('0x45')]){_0x15d3f2[_0x8789('0x46')]=[{'all':!![]}];}return db[_0x8789('0x30')][_0x8789('0x47')](_0x15d3f2);})[_0x8789('0x26')](function(_0x45c538){_0x37c126['rows']=_0x45c538;return _0x37c126;})['then'](respondWithFilteredResult(_0x3ab819,_0x15d3f2))[_0x8789('0x48')](handleError(_0x3ab819,null));};exports[_0x8789('0x49')]=function(_0xc8358d,_0x5c6a46){var _0x4f40dd={'raw':!![],'where':{'id':_0xc8358d['params']['id']}},_0x37d04a={};_0x37d04a[_0x8789('0x34')]=_[_0x8789('0x36')](db[_0x8789('0x30')][_0x8789('0x31')]);_0x37d04a[_0x8789('0x35')]=_[_0x8789('0x36')](_0xc8358d[_0x8789('0x35')]);_0x37d04a[_0x8789('0x37')]=_[_0x8789('0x39')](_0x37d04a[_0x8789('0x34')],_0x37d04a[_0x8789('0x35')]);_0x4f40dd[_0x8789('0x38')]=_[_0x8789('0x39')](_0x37d04a[_0x8789('0x34')],qs[_0x8789('0x3a')](_0xc8358d['query'][_0x8789('0x3a')]));_0x4f40dd[_0x8789('0x38')]=_0x4f40dd[_0x8789('0x38')]['length']?_0x4f40dd[_0x8789('0x38')]:_0x37d04a['model'];if(_0xc8358d[_0x8789('0x35')][_0x8789('0x45')]){_0x4f40dd[_0x8789('0x46')]=[{'all':!![]}];}_0x4f40dd=_[_0x8789('0x43')]({},_0x4f40dd,_0xc8358d[_0x8789('0x44')]);return db[_0x8789('0x30')]['find'](_0x4f40dd)[_0x8789('0x26')](handleEntityNotFound(_0x5c6a46,null))['then'](respondWithResult(_0x5c6a46,null))[_0x8789('0x48')](handleError(_0x5c6a46,null));};exports['update']=function(_0x45d3b5,_0x4bea8f){if(_0x45d3b5[_0x8789('0x4a')]['id']){delete _0x45d3b5[_0x8789('0x4a')]['id'];}return db[_0x8789('0x30')][_0x8789('0x4b')]({'where':{'id':_0x45d3b5['params']['id']}})['then'](handleEntityNotFound(_0x4bea8f,null))[_0x8789('0x26')](saveUpdates(_0x45d3b5[_0x8789('0x4a')],null))[_0x8789('0x26')](respondWithResult(_0x4bea8f,null))[_0x8789('0x48')](handleError(_0x4bea8f,null));};exports['destroy']=function(_0x57845c,_0x43527e){return db[_0x8789('0x30')]['find']({'where':{'id':_0x57845c[_0x8789('0x4c')]['id']}})[_0x8789('0x26')](handleEntityNotFound(_0x43527e,null))[_0x8789('0x26')](removeEntity(_0x43527e,null))[_0x8789('0x48')](handleError(_0x43527e,null));};exports['create']=function(_0x47c13f,_0x3d6b06){var _0x4e302a={'key':_0x47c13f[_0x8789('0x4a')][_0x8789('0x33')]};if(_0x47c13f['body'][_0x8789('0x4d')]){_0x4e302a[_0x8789('0x4d')]=_0x47c13f[_0x8789('0x4a')][_0x8789('0x4d')];}else if(_0x47c13f['body'][_0x8789('0x4e')]){_0x4e302a[_0x8789('0x4e')]=_0x47c13f['body'][_0x8789('0x4e')];}else if(_0x47c13f[_0x8789('0x4a')][_0x8789('0x4f')]){_0x4e302a[_0x8789('0x4f')]=_0x47c13f[_0x8789('0x4a')][_0x8789('0x4f')];}else if(_0x47c13f[_0x8789('0x4a')][_0x8789('0x50')]){_0x4e302a[_0x8789('0x50')]=_0x47c13f[_0x8789('0x4a')][_0x8789('0x50')];}return db[_0x8789('0x30')][_0x8789('0x4b')]({'where':_0x4e302a})['then'](function(_0x1166e8){if(_0x1166e8){throw new db['Sequelize'][(_0x8789('0x51'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x8789('0x30')][_0x8789('0x52')](_0x47c13f['body']);})[_0x8789('0x26')](function(_0x357630){var _0x97b82=_0x47c13f[_0x8789('0x53')][_0x8789('0x28')]({'plain':!![]});if(!_0x97b82)throw new Error(_0x8789('0x54'));if(_0x97b82[_0x8789('0x55')]==='user'){var _0x4a5bf9=_0x357630[_0x8789('0x28')]({'plain':!![]});return db[_0x8789('0x56')][_0x8789('0x4b')]({'where':{'name':_0x8789('0x29'),'userProfileId':_0x97b82[_0x8789('0x57')]},'raw':!![]})['then'](function(_0x1e3488){if(_0x1e3488&&_0x1e3488['autoAssociation']===0x0){return db[_0x8789('0x2a')][_0x8789('0x52')]({'name':_0x4a5bf9[_0x8789('0x2c')],'resourceId':_0x4a5bf9['id'],'type':_0x1e3488[_0x8789('0x2c')],'sectionId':_0x1e3488['id']},{})[_0x8789('0x26')](function(){return _0x357630;});}else{return _0x357630;}})[_0x8789('0x48')](function(_0x158a72){logger[_0x8789('0x58')](_0x8789('0x59'),_0x158a72);throw _0x158a72;});}return _0x357630;})[_0x8789('0x26')](respondWithResult(_0x3d6b06,0xc9))[_0x8789('0x48')](handleError(_0x3d6b06,null));};
\ No newline at end of file
+var _0x3feb=['sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','find','catch','update','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','destroy','then','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x1c9762,_0x553707){var _0x1b6eed=function(_0x2a882d){while(--_0x2a882d){_0x1c9762['push'](_0x1c9762['shift']());}};_0x1b6eed(++_0x553707);}(_0x3feb,0x12e));var _0xb3fe=function(_0x28be64,_0x48c7c5){_0x28be64=_0x28be64-0x0;var _0x3d92ec=_0x3feb[_0x28be64];return _0x3d92ec;};'use strict';var emlformat=require(_0xb3fe('0x0'));var rimraf=require(_0xb3fe('0x1'));var zipdir=require(_0xb3fe('0x2'));var jsonpatch=require(_0xb3fe('0x3'));var rp=require('request-promise');var moment=require(_0xb3fe('0x4'));var BPromise=require(_0xb3fe('0x5'));var Mustache=require(_0xb3fe('0x6'));var util=require(_0xb3fe('0x7'));var path=require(_0xb3fe('0x8'));var sox=require(_0xb3fe('0x9'));var csv=require('to-csv');var ejs=require(_0xb3fe('0xa'));var fs=require('fs');var fs_extra=require(_0xb3fe('0xb'));var _=require(_0xb3fe('0xc'));var squel=require(_0xb3fe('0xd'));var crypto=require(_0xb3fe('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb3fe('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb3fe('0x10'));var Redis=require(_0xb3fe('0x11'));var authService=require(_0xb3fe('0x12'));var qs=require(_0xb3fe('0x13'));var as=require(_0xb3fe('0x14'));var hardwareService=require(_0xb3fe('0x15'));var logger=require(_0xb3fe('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xb3fe('0x17'));var licenseUtil=require(_0xb3fe('0x18'));var db=require(_0xb3fe('0x19'))['db'];function respondWithStatusCode(_0x16c449,_0x2ad369){_0x2ad369=_0x2ad369||0xcc;return function(_0x231a6a){if(_0x231a6a){return _0x16c449[_0xb3fe('0x1a')](_0x2ad369);}return _0x16c449[_0xb3fe('0x1b')](_0x2ad369)[_0xb3fe('0x1c')]();};}function respondWithResult(_0x4ef6b9,_0x5270cc){_0x5270cc=_0x5270cc||0xc8;return function(_0xeab218){if(_0xeab218){return _0x4ef6b9['status'](_0x5270cc)[_0xb3fe('0x1d')](_0xeab218);}};}function respondWithFilteredResult(_0xbd43d9,_0x33fc7f){return function(_0x4f76a7){if(_0x4f76a7){var _0x4b13d=typeof _0x33fc7f[_0xb3fe('0x1e')]===_0xb3fe('0x1f')&&typeof _0x33fc7f['limit']===_0xb3fe('0x1f');var _0x17e320=_0x4f76a7['count'];var _0x2f6ad8=_0x4b13d?0x0:_0x33fc7f[_0xb3fe('0x1e')];var _0x48839a=_0x4b13d?_0x4f76a7[_0xb3fe('0x20')]:_0x33fc7f[_0xb3fe('0x1e')]+_0x33fc7f['limit'];var _0x588bad;if(_0x48839a>=_0x17e320){_0x48839a=_0x17e320;_0x588bad=0xc8;}else{_0x588bad=0xce;}_0xbd43d9[_0xb3fe('0x1b')](_0x588bad);return _0xbd43d9[_0xb3fe('0x21')]('Content-Range',_0x2f6ad8+'-'+_0x48839a+'/'+_0x17e320)[_0xb3fe('0x1d')](_0x4f76a7);}return null;};}function patchUpdates(_0x2c93ae){return function(_0x2db7d3){try{jsonpatch[_0xb3fe('0x22')](_0x2db7d3,_0x2c93ae,!![]);}catch(_0x1cce98){return BPromise[_0xb3fe('0x23')](_0x1cce98);}return _0x2db7d3['save']();};}function saveUpdates(_0x30b300,_0x27fa30){return function(_0x12914a){if(_0x12914a){return _0x12914a['update'](_0x30b300)['then'](function(_0x3b6ca3){return _0x3b6ca3;});}return null;};}function removeEntity(_0x4b0e1e,_0x2c360c){return function(_0x3fb1bf){if(_0x3fb1bf){return _0x3fb1bf[_0xb3fe('0x24')]()[_0xb3fe('0x25')](function(){var _0x37de9a=_0x3fb1bf['get']({'plain':!![]});var _0x2e85a2=_0xb3fe('0x26');return db[_0xb3fe('0x27')]['destroy']({'where':{'type':_0x2e85a2,'resourceId':_0x37de9a['id']}})['then'](function(){return _0x3fb1bf;});})[_0xb3fe('0x25')](function(){_0x4b0e1e[_0xb3fe('0x1b')](0xcc)[_0xb3fe('0x1c')]();});}};}function handleEntityNotFound(_0x2fcf17,_0x356ef8){return function(_0xf4f577){if(!_0xf4f577){_0x2fcf17[_0xb3fe('0x1a')](0x194);}return _0xf4f577;};}function handleError(_0x23e749,_0x2c83b9){_0x2c83b9=_0x2c83b9||0x1f4;return function(_0x1ee79e){logger[_0xb3fe('0x28')](_0x1ee79e[_0xb3fe('0x29')]);if(_0x1ee79e[_0xb3fe('0x2a')]){delete _0x1ee79e[_0xb3fe('0x2a')];}_0x23e749[_0xb3fe('0x1b')](_0x2c83b9)[_0xb3fe('0x2b')](_0x1ee79e);};}exports[_0xb3fe('0x2c')]=function(_0x49e001,_0x345600){var _0x5d9614={},_0x125589={},_0x2b75e3={'count':0x0,'rows':[]};var _0x1e48d1=_[_0xb3fe('0x2d')](db[_0xb3fe('0x2e')][_0xb3fe('0x2f')],function(_0x5f0bd4){return{'name':_0x5f0bd4[_0xb3fe('0x30')],'type':_0x5f0bd4[_0xb3fe('0x31')][_0xb3fe('0x32')]};});_0x125589['model']=_['map'](_0x1e48d1,'name');_0x125589['query']=_[_0xb3fe('0x33')](_0x49e001[_0xb3fe('0x34')]);_0x125589[_0xb3fe('0x35')]=_[_0xb3fe('0x36')](_0x125589[_0xb3fe('0x37')],_0x125589[_0xb3fe('0x34')]);_0x5d9614[_0xb3fe('0x38')]=_['intersection'](_0x125589[_0xb3fe('0x37')],qs[_0xb3fe('0x39')](_0x49e001[_0xb3fe('0x34')][_0xb3fe('0x39')]));_0x5d9614['attributes']=_0x5d9614['attributes'][_0xb3fe('0x3a')]?_0x5d9614[_0xb3fe('0x38')]:_0x125589[_0xb3fe('0x37')];if(!_0x49e001[_0xb3fe('0x34')][_0xb3fe('0x3b')](_0xb3fe('0x3c'))){_0x5d9614[_0xb3fe('0x3d')]=qs['limit'](_0x49e001[_0xb3fe('0x34')]['limit']);_0x5d9614[_0xb3fe('0x1e')]=qs[_0xb3fe('0x1e')](_0x49e001[_0xb3fe('0x34')][_0xb3fe('0x1e')]);}_0x5d9614['order']=qs[_0xb3fe('0x3e')](_0x49e001[_0xb3fe('0x34')][_0xb3fe('0x3e')]);_0x5d9614[_0xb3fe('0x3f')]=qs[_0xb3fe('0x35')](_[_0xb3fe('0x40')](_0x49e001['query'],_0x125589['filters']),_0x1e48d1);if(_0x49e001[_0xb3fe('0x34')][_0xb3fe('0x41')]){_0x5d9614['where']=_[_0xb3fe('0x42')](_0x5d9614[_0xb3fe('0x3f')],{'$or':[{'key':{'$like':'%'+_0x49e001[_0xb3fe('0x34')][_0xb3fe('0x41')]+'%'}},{'value':{'$like':'%'+_0x49e001[_0xb3fe('0x34')][_0xb3fe('0x41')]+'%'}}]});}_0x5d9614=_[_0xb3fe('0x42')]({},_0x5d9614,_0x49e001[_0xb3fe('0x43')]);var _0x430459={'where':_0x5d9614[_0xb3fe('0x3f')]};return db[_0xb3fe('0x2e')]['count'](_0x430459)[_0xb3fe('0x25')](function(_0x49a5da){_0x2b75e3[_0xb3fe('0x20')]=_0x49a5da;if(_0x49e001[_0xb3fe('0x34')][_0xb3fe('0x44')]){_0x5d9614[_0xb3fe('0x45')]=[{'all':!![]}];}return db[_0xb3fe('0x2e')]['findAll'](_0x5d9614);})[_0xb3fe('0x25')](function(_0x50db97){_0x2b75e3[_0xb3fe('0x46')]=_0x50db97;return _0x2b75e3;})[_0xb3fe('0x25')](respondWithFilteredResult(_0x345600,_0x5d9614))['catch'](handleError(_0x345600,null));};exports[_0xb3fe('0x47')]=function(_0x173ea3,_0x3cdb77){var _0x1435cb={'raw':!![],'where':{'id':_0x173ea3[_0xb3fe('0x48')]['id']}},_0x367c25={};_0x367c25[_0xb3fe('0x37')]=_[_0xb3fe('0x33')](db[_0xb3fe('0x2e')]['rawAttributes']);_0x367c25[_0xb3fe('0x34')]=_[_0xb3fe('0x33')](_0x173ea3[_0xb3fe('0x34')]);_0x367c25[_0xb3fe('0x35')]=_[_0xb3fe('0x36')](_0x367c25['model'],_0x367c25[_0xb3fe('0x34')]);_0x1435cb['attributes']=_[_0xb3fe('0x36')](_0x367c25[_0xb3fe('0x37')],qs[_0xb3fe('0x39')](_0x173ea3['query'][_0xb3fe('0x39')]));_0x1435cb[_0xb3fe('0x38')]=_0x1435cb[_0xb3fe('0x38')][_0xb3fe('0x3a')]?_0x1435cb['attributes']:_0x367c25[_0xb3fe('0x37')];if(_0x173ea3[_0xb3fe('0x34')]['includeAll']){_0x1435cb['include']=[{'all':!![]}];}_0x1435cb=_['merge']({},_0x1435cb,_0x173ea3[_0xb3fe('0x43')]);return db[_0xb3fe('0x2e')][_0xb3fe('0x49')](_0x1435cb)[_0xb3fe('0x25')](handleEntityNotFound(_0x3cdb77,null))['then'](respondWithResult(_0x3cdb77,null))[_0xb3fe('0x4a')](handleError(_0x3cdb77,null));};exports[_0xb3fe('0x4b')]=function(_0x137620,_0x1907d2){if(_0x137620['body']['id']){delete _0x137620[_0xb3fe('0x4c')]['id'];}return db['CannedAnswer'][_0xb3fe('0x49')]({'where':{'id':_0x137620['params']['id']}})[_0xb3fe('0x25')](handleEntityNotFound(_0x1907d2,null))[_0xb3fe('0x25')](saveUpdates(_0x137620['body'],null))['then'](respondWithResult(_0x1907d2,null))[_0xb3fe('0x4a')](handleError(_0x1907d2,null));};exports['destroy']=function(_0x3d695c,_0x305757){return db[_0xb3fe('0x2e')][_0xb3fe('0x49')]({'where':{'id':_0x3d695c[_0xb3fe('0x48')]['id']}})[_0xb3fe('0x25')](handleEntityNotFound(_0x305757,null))[_0xb3fe('0x25')](removeEntity(_0x305757,null))[_0xb3fe('0x4a')](handleError(_0x305757,null));};exports['create']=function(_0x5762a3,_0x232783){var _0x361671={'key':_0x5762a3[_0xb3fe('0x4c')][_0xb3fe('0x32')]};if(_0x5762a3[_0xb3fe('0x4c')]['MailAccountId']){_0x361671['MailAccountId']=_0x5762a3[_0xb3fe('0x4c')][_0xb3fe('0x4d')];}else if(_0x5762a3['body'][_0xb3fe('0x4e')]){_0x361671['SmsAccountId']=_0x5762a3['body'][_0xb3fe('0x4e')];}else if(_0x5762a3[_0xb3fe('0x4c')][_0xb3fe('0x4f')]){_0x361671[_0xb3fe('0x4f')]=_0x5762a3[_0xb3fe('0x4c')]['OpenchannelAccountId'];}else if(_0x5762a3[_0xb3fe('0x4c')][_0xb3fe('0x50')]){_0x361671[_0xb3fe('0x50')]=_0x5762a3[_0xb3fe('0x4c')][_0xb3fe('0x50')];}return db['CannedAnswer'][_0xb3fe('0x49')]({'where':_0x361671})[_0xb3fe('0x25')](function(_0x5c168f){if(_0x5c168f){throw new db['Sequelize'][(_0xb3fe('0x51'))](_0xb3fe('0x52'));}return db[_0xb3fe('0x2e')]['create'](_0x5762a3[_0xb3fe('0x4c')]);})[_0xb3fe('0x25')](function(_0x1cce29){var _0x4b24f8=_0x5762a3[_0xb3fe('0x53')]['get']({'plain':!![]});if(!_0x4b24f8)throw new Error(_0xb3fe('0x54'));if(_0x4b24f8[_0xb3fe('0x55')]===_0xb3fe('0x53')){var _0x22b61e=_0x1cce29[_0xb3fe('0x56')]({'plain':!![]});return db[_0xb3fe('0x57')][_0xb3fe('0x49')]({'where':{'name':_0xb3fe('0x26'),'userProfileId':_0x4b24f8[_0xb3fe('0x58')]},'raw':!![]})[_0xb3fe('0x25')](function(_0x38b718){if(_0x38b718&&_0x38b718[_0xb3fe('0x59')]===0x0){return db[_0xb3fe('0x27')]['create']({'name':_0x22b61e[_0xb3fe('0x2a')],'resourceId':_0x22b61e['id'],'type':_0x38b718[_0xb3fe('0x2a')],'sectionId':_0x38b718['id']},{})['then'](function(){return _0x1cce29;});}else{return _0x1cce29;}})[_0xb3fe('0x4a')](function(_0xdc7e0){logger[_0xb3fe('0x28')](_0xb3fe('0x5a'),_0xdc7e0);throw _0xdc7e0;});}return _0x1cce29;})[_0xb3fe('0x25')](respondWithResult(_0x232783,0xc9))[_0xb3fe('0x4a')](handleError(_0x232783,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 48f65de..35210b0 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 _0x08ff=['request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x56acd3,_0x52fcc5){var _0x920a32=function(_0x16dc60){while(--_0x16dc60){_0x56acd3['push'](_0x56acd3['shift']());}};_0x920a32(++_0x52fcc5);}(_0x08ff,0x72));var _0xf08f=function(_0x15cf2c,_0x114878){_0x15cf2c=_0x15cf2c-0x0;var _0x47b99a=_0x08ff[_0x15cf2c];return _0x47b99a;};'use strict';var _=require(_0xf08f('0x0'));var util=require(_0xf08f('0x1'));var logger=require(_0xf08f('0x2'))(_0xf08f('0x3'));var moment=require(_0xf08f('0x4'));var BPromise=require(_0xf08f('0x5'));var rp=require(_0xf08f('0x6'));var fs=require('fs');var path=require(_0xf08f('0x7'));var rimraf=require('rimraf');var config=require(_0xf08f('0x8'));var attributes=require(_0xf08f('0x9'));module[_0xf08f('0xa')]=function(_0x1bf734,_0x4a4e14){return _0x1bf734['define'](_0xf08f('0xb'),attributes,{'tableName':_0xf08f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf08f('0xd'),'collate':_0xf08f('0xe')});};
\ No newline at end of file
+var _0x22b3=['exports','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x49c186,_0x14c4b0){var _0x34e626=function(_0x5c0f95){while(--_0x5c0f95){_0x49c186['push'](_0x49c186['shift']());}};_0x34e626(++_0x14c4b0);}(_0x22b3,0x189));var _0x322b=function(_0x29c652,_0x251ca1){_0x29c652=_0x29c652-0x0;var _0x13b5cd=_0x22b3[_0x29c652];return _0x13b5cd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x322b('0x0'))(_0x322b('0x1'));var moment=require(_0x322b('0x2'));var BPromise=require(_0x322b('0x3'));var rp=require(_0x322b('0x4'));var fs=require('fs');var path=require(_0x322b('0x5'));var rimraf=require('rimraf');var config=require(_0x322b('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x322b('0x7')]=function(_0xd6f2a,_0x36d64a){return _0xd6f2a['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x322b('0x8'),'collate':_0x322b('0x9')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index cbe8429..de8923b 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(_0x1f861f,_0x573858){var _0x33ca05=function(_0x5ef9b9){while(--_0x5ef9b9){_0x1f861f['push'](_0x1f861f['shift']());}};_0x33ca05(++_0x573858);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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(_0x523886,_0x3ad7d8){var _0x4e704c=function(_0x3c1a9e){while(--_0x3c1a9e){_0x523886['push'](_0x523886['shift']());}};_0x4e704c(++_0x3ad7d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 199c028..5053a72 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 _0x9e67=['/:id','show','destroy','exports','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x33bf91,_0xb8c629){var _0x37ceed=function(_0x48f82b){while(--_0x48f82b){_0x33bf91['push'](_0x33bf91['shift']());}};_0x37ceed(++_0xb8c629);}(_0x9e67,0x1cb));var _0x79e6=function(_0x13394d,_0x13653b){_0x13394d=_0x13394d-0x0;var _0x410bcb=_0x9e67[_0x13394d];return _0x410bcb;};'use strict';var multer=require('multer');var util=require(_0x79e6('0x0'));var path=require(_0x79e6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x79e6('0x2')]();var fs_extra=require(_0x79e6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x79e6('0x4'));var config=require(_0x79e6('0x5'));var controller=require('./cannedAnswer.controller');router[_0x79e6('0x6')]('/',auth[_0x79e6('0x7')](),controller[_0x79e6('0x8')]);router[_0x79e6('0x6')](_0x79e6('0x9'),auth['isAuthenticated'](),controller[_0x79e6('0xa')]);router['post']('/',auth[_0x79e6('0x7')](),controller['create']);router['put']('/:id',auth[_0x79e6('0x7')](),controller['update']);router['delete']('/:id',auth[_0x79e6('0x7')](),controller[_0x79e6('0xb')]);module[_0x79e6('0xc')]=router;
\ No newline at end of file
+var _0x05d8=['create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show'];(function(_0x4ef17a,_0x1a799b){var _0x141f41=function(_0x12ec71){while(--_0x12ec71){_0x4ef17a['push'](_0x4ef17a['shift']());}};_0x141f41(++_0x1a799b);}(_0x05d8,0x64));var _0x805d=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x05d8[_0x4bb66f];return _0xf2772f;};'use strict';var multer=require(_0x805d('0x0'));var util=require(_0x805d('0x1'));var path=require('path');var timeout=require(_0x805d('0x2'));var express=require(_0x805d('0x3'));var router=express[_0x805d('0x4')]();var fs_extra=require(_0x805d('0x5'));var auth=require(_0x805d('0x6'));var interaction=require(_0x805d('0x7'));var config=require(_0x805d('0x8'));var controller=require(_0x805d('0x9'));router[_0x805d('0xa')]('/',auth[_0x805d('0xb')](),controller['index']);router[_0x805d('0xa')](_0x805d('0xc'),auth[_0x805d('0xb')](),controller[_0x805d('0xd')]);router['post']('/',auth[_0x805d('0xb')](),controller[_0x805d('0xe')]);router[_0x805d('0xf')](_0x805d('0xc'),auth[_0x805d('0xb')](),controller[_0x805d('0x10')]);router['delete'](_0x805d('0xc'),auth[_0x805d('0xb')](),controller[_0x805d('0x11')]);module[_0x805d('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 2318d93..18d17a7 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 _0x10bd=['1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x34752e,_0x557215){var _0x4d6e49=function(_0x400b1a){while(--_0x400b1a){_0x34752e['push'](_0x34752e['shift']());}};_0x4d6e49(++_0x557215);}(_0x10bd,0x97));var _0xd10b=function(_0x4cd11c,_0x3faeb2){_0x4cd11c=_0x4cd11c-0x0;var _0xade338=_0x10bd[_0x4cd11c];return _0xade338;};'use strict';var Sequelize=require('sequelize');module[_0xd10b('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xd10b('0x1')},'clid':{'type':Sequelize[_0xd10b('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xd10b('0x2')]},'channel':{'type':Sequelize[_0xd10b('0x2')]},'dstchannel':{'type':Sequelize[_0xd10b('0x2')]},'lastapp':{'type':Sequelize[_0xd10b('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xd10b('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd10b('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd10b('0x2')]},'amaflags':{'type':Sequelize[_0xd10b('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd10b('0x2')]},'userfield':{'type':Sequelize[_0xd10b('0x2')]},'uniqueid':{'type':Sequelize[_0xd10b('0x2')]},'linkedid':{'type':Sequelize[_0xd10b('0x2')]},'sequence':{'type':Sequelize[_0xd10b('0x2')]},'peeraccount':{'type':Sequelize[_0xd10b('0x2')]},'type':{'type':Sequelize[_0xd10b('0x2')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xaf09=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x4af527,_0x22291b){var _0x55ae8d=function(_0x41086c){while(--_0x41086c){_0x4af527['push'](_0x4af527['shift']());}};_0x55ae8d(++_0x22291b);}(_0xaf09,0x10d));var _0x9af0=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xaf09[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x9af0('0x0'));module[_0x9af0('0x1')]={'calldate':{'type':Sequelize[_0x9af0('0x2')],'allowNull':![],'defaultValue':_0x9af0('0x3')},'clid':{'type':Sequelize[_0x9af0('0x4')]},'src':{'type':Sequelize[_0x9af0('0x4')]},'dst':{'type':Sequelize[_0x9af0('0x4')]},'dcontext':{'type':Sequelize[_0x9af0('0x4')]},'channel':{'type':Sequelize[_0x9af0('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x9af0('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9af0('0x4')]},'linkedid':{'type':Sequelize[_0x9af0('0x4')]},'sequence':{'type':Sequelize[_0x9af0('0x4')]},'peeraccount':{'type':Sequelize[_0x9af0('0x4')]},'type':{'type':Sequelize[_0x9af0('0x4')]},'tag':{'type':Sequelize[_0x9af0('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index bb567eb..6a6bac1 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 _0x8c46=['filter','VIRTUAL','merge','options','include','Cdr','rows','catch','includeAll','find','create','body','params','describe','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick'];(function(_0xa14049,_0x127041){var _0x584efc=function(_0x157707){while(--_0x157707){_0xa14049['push'](_0xa14049['shift']());}};_0x584efc(++_0x127041);}(_0x8c46,0x171));var _0x68c4=function(_0x3767ef,_0x29c168){_0x3767ef=_0x3767ef-0x0;var _0x14c673=_0x8c46[_0x3767ef];return _0x14c673;};'use strict';var emlformat=require(_0x68c4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x68c4('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x68c4('0x2'));var Mustache=require(_0x68c4('0x3'));var util=require(_0x68c4('0x4'));var path=require(_0x68c4('0x5'));var sox=require(_0x68c4('0x6'));var csv=require(_0x68c4('0x7'));var ejs=require(_0x68c4('0x8'));var fs=require('fs');var fs_extra=require(_0x68c4('0x9'));var _=require(_0x68c4('0xa'));var squel=require(_0x68c4('0xb'));var crypto=require('crypto');var jsforce=require(_0x68c4('0xc'));var deskjs=require(_0x68c4('0xd'));var toCsv=require(_0x68c4('0x7'));var querystring=require('querystring');var Papa=require(_0x68c4('0xe'));var Redis=require(_0x68c4('0xf'));var authService=require(_0x68c4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68c4('0x11'));var logger=require(_0x68c4('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x68c4('0x13'));var licenseUtil=require(_0x68c4('0x14'));var db=require(_0x68c4('0x15'))['db'];function respondWithStatusCode(_0x48783b,_0x3a432a){_0x3a432a=_0x3a432a||0xcc;return function(_0x1f5f42){if(_0x1f5f42){return _0x48783b[_0x68c4('0x16')](_0x3a432a);}return _0x48783b['status'](_0x3a432a)[_0x68c4('0x17')]();};}function respondWithResult(_0x14919c,_0x5e1341){_0x5e1341=_0x5e1341||0xc8;return function(_0x52f031){if(_0x52f031){return _0x14919c[_0x68c4('0x18')](_0x5e1341)[_0x68c4('0x19')](_0x52f031);}};}function respondWithFilteredResult(_0x5be0de,_0xc25f7b){return function(_0x4ea2a4){if(_0x4ea2a4){var _0x1a7045=typeof _0xc25f7b['offset']==='undefined'&&typeof _0xc25f7b[_0x68c4('0x1a')]===_0x68c4('0x1b');var _0x4f4797=_0x4ea2a4[_0x68c4('0x1c')];var _0x1d757c=_0x1a7045?0x0:_0xc25f7b[_0x68c4('0x1d')];var _0x33c5c5=_0x1a7045?_0x4ea2a4[_0x68c4('0x1c')]:_0xc25f7b[_0x68c4('0x1d')]+_0xc25f7b[_0x68c4('0x1a')];var _0x415ef2;if(_0x33c5c5>=_0x4f4797){_0x33c5c5=_0x4f4797;_0x415ef2=0xc8;}else{_0x415ef2=0xce;}_0x5be0de[_0x68c4('0x18')](_0x415ef2);return _0x5be0de[_0x68c4('0x1e')](_0x68c4('0x1f'),_0x1d757c+'-'+_0x33c5c5+'/'+_0x4f4797)['json'](_0x4ea2a4);}return null;};}function patchUpdates(_0x398a71){return function(_0x4edf9f){try{jsonpatch['apply'](_0x4edf9f,_0x398a71,!![]);}catch(_0x34d3a6){return BPromise[_0x68c4('0x20')](_0x34d3a6);}return _0x4edf9f[_0x68c4('0x21')]();};}function saveUpdates(_0x42f0bc,_0x5b8135){return function(_0x35e865){if(_0x35e865){return _0x35e865[_0x68c4('0x22')](_0x42f0bc)['then'](function(_0x201742){return _0x201742;});}return null;};}function removeEntity(_0x392ccf,_0x45f9be){return function(_0x10278e){if(_0x10278e){return _0x10278e[_0x68c4('0x23')]()[_0x68c4('0x24')](function(){_0x392ccf[_0x68c4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ff4a5,_0x55355d){return function(_0xf16a78){if(!_0xf16a78){_0x2ff4a5[_0x68c4('0x16')](0x194);}return _0xf16a78;};}function handleError(_0x57f32,_0x4f9d32){_0x4f9d32=_0x4f9d32||0x1f4;return function(_0x1e14db){logger[_0x68c4('0x25')](_0x1e14db[_0x68c4('0x26')]);if(_0x1e14db[_0x68c4('0x27')]){delete _0x1e14db[_0x68c4('0x27')];}_0x57f32[_0x68c4('0x18')](_0x4f9d32)[_0x68c4('0x28')](_0x1e14db);};}exports['index']=function(_0x26d56b,_0x4b4634){var _0x3772b3={},_0x1442ba={},_0x56ed70={'count':0x0,'rows':[]};var _0x2847d1=_[_0x68c4('0x29')](db['Cdr'][_0x68c4('0x2a')],function(_0x3a1b69){return{'name':_0x3a1b69[_0x68c4('0x2b')],'type':_0x3a1b69[_0x68c4('0x2c')][_0x68c4('0x2d')]};});_0x1442ba[_0x68c4('0x2e')]=_[_0x68c4('0x29')](_0x2847d1,_0x68c4('0x27'));_0x1442ba[_0x68c4('0x2f')]=_[_0x68c4('0x30')](_0x26d56b[_0x68c4('0x2f')]);_0x1442ba[_0x68c4('0x31')]=_[_0x68c4('0x32')](_0x1442ba[_0x68c4('0x2e')],_0x1442ba[_0x68c4('0x2f')]);_0x3772b3[_0x68c4('0x33')]=_[_0x68c4('0x32')](_0x1442ba[_0x68c4('0x2e')],qs['fields'](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x34')]));_0x3772b3[_0x68c4('0x33')]=_0x3772b3[_0x68c4('0x33')][_0x68c4('0x35')]?_0x3772b3['attributes']:_0x1442ba[_0x68c4('0x2e')];if(!_0x26d56b['query']['hasOwnProperty']('nolimit')){_0x3772b3[_0x68c4('0x1a')]=qs[_0x68c4('0x1a')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x1a')]);_0x3772b3['offset']=qs[_0x68c4('0x1d')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x1d')]);}_0x3772b3['order']=qs[_0x68c4('0x36')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x36')]);_0x3772b3[_0x68c4('0x37')]=qs[_0x68c4('0x31')](_[_0x68c4('0x38')](_0x26d56b[_0x68c4('0x2f')],_0x1442ba[_0x68c4('0x31')]),_0x2847d1);if(_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x39')]){_0x3772b3['where']=_['merge'](_0x3772b3[_0x68c4('0x37')],{'$or':_[_0x68c4('0x29')](_0x2847d1,function(_0x460e11){if(_0x460e11[_0x68c4('0x2c')]!==_0x68c4('0x3a')){var _0x13386d={};_0x13386d[_0x460e11[_0x68c4('0x27')]]={'$like':'%'+_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x39')]+'%'};return _0x13386d;}})});}_0x3772b3=_[_0x68c4('0x3b')]({},_0x3772b3,_0x26d56b[_0x68c4('0x3c')]);var _0x30a1cd={'where':_0x3772b3[_0x68c4('0x37')]};return db['Cdr']['count'](_0x30a1cd)[_0x68c4('0x24')](function(_0x2785b4){_0x56ed70[_0x68c4('0x1c')]=_0x2785b4;if(_0x26d56b[_0x68c4('0x2f')]['includeAll']){_0x3772b3[_0x68c4('0x3d')]=[{'all':!![]}];}return db[_0x68c4('0x3e')]['findAll'](_0x3772b3);})['then'](function(_0x4c564a){_0x56ed70[_0x68c4('0x3f')]=_0x4c564a;return _0x56ed70;})['then'](respondWithFilteredResult(_0x4b4634,_0x3772b3))[_0x68c4('0x40')](handleError(_0x4b4634,null));};exports['show']=function(_0x18da6f,_0x2406b1){var _0xbd848f={'raw':!![],'where':{'id':_0x18da6f['params']['id']}},_0xefe68d={};_0xefe68d[_0x68c4('0x2e')]=_[_0x68c4('0x30')](db[_0x68c4('0x3e')][_0x68c4('0x2a')]);_0xefe68d['query']=_[_0x68c4('0x30')](_0x18da6f[_0x68c4('0x2f')]);_0xefe68d[_0x68c4('0x31')]=_[_0x68c4('0x32')](_0xefe68d[_0x68c4('0x2e')],_0xefe68d['query']);_0xbd848f['attributes']=_['intersection'](_0xefe68d[_0x68c4('0x2e')],qs[_0x68c4('0x34')](_0x18da6f[_0x68c4('0x2f')][_0x68c4('0x34')]));_0xbd848f['attributes']=_0xbd848f[_0x68c4('0x33')][_0x68c4('0x35')]?_0xbd848f[_0x68c4('0x33')]:_0xefe68d[_0x68c4('0x2e')];if(_0x18da6f[_0x68c4('0x2f')][_0x68c4('0x41')]){_0xbd848f[_0x68c4('0x3d')]=[{'all':!![]}];}_0xbd848f=_[_0x68c4('0x3b')]({},_0xbd848f,_0x18da6f[_0x68c4('0x3c')]);return db[_0x68c4('0x3e')][_0x68c4('0x42')](_0xbd848f)['then'](handleEntityNotFound(_0x2406b1,null))[_0x68c4('0x24')](respondWithResult(_0x2406b1,null))['catch'](handleError(_0x2406b1,null));};exports[_0x68c4('0x43')]=function(_0x44e3c9,_0x463a6b){return db[_0x68c4('0x3e')]['create'](_0x44e3c9[_0x68c4('0x44')],{})['then'](respondWithResult(_0x463a6b,0xc9))[_0x68c4('0x40')](handleError(_0x463a6b,null));};exports[_0x68c4('0x22')]=function(_0x570e25,_0x250941){if(_0x570e25[_0x68c4('0x44')]['id']){delete _0x570e25[_0x68c4('0x44')]['id'];}return db[_0x68c4('0x3e')][_0x68c4('0x42')]({'where':{'id':_0x570e25[_0x68c4('0x45')]['id']}})['then'](handleEntityNotFound(_0x250941,null))[_0x68c4('0x24')](saveUpdates(_0x570e25[_0x68c4('0x44')],null))[_0x68c4('0x24')](respondWithResult(_0x250941,null))[_0x68c4('0x40')](handleError(_0x250941,null));};exports['destroy']=function(_0x40ecf6,_0x19aec2){return db[_0x68c4('0x3e')][_0x68c4('0x42')]({'where':{'id':_0x40ecf6[_0x68c4('0x45')]['id']}})[_0x68c4('0x24')](handleEntityNotFound(_0x19aec2,null))['then'](removeEntity(_0x19aec2,null))[_0x68c4('0x40')](handleError(_0x19aec2,null));};exports[_0x68c4('0x46')]=function(_0x3db854,_0x51db14){return db[_0x68c4('0x3e')][_0x68c4('0x46')]()['then'](respondWithResult(_0x51db14,null))['catch'](handleError(_0x51db14,null));};
\ No newline at end of file
+var _0xf69d=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','then','send','map','Cdr','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','keys','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x22fa8d,_0x3af3bb){var _0x1c445e=function(_0xabe36c){while(--_0xabe36c){_0x22fa8d['push'](_0x22fa8d['shift']());}};_0x1c445e(++_0x3af3bb);}(_0xf69d,0xd3));var _0xdf69=function(_0x5b1b43,_0x42f389){_0x5b1b43=_0x5b1b43-0x0;var _0x2758b3=_0xf69d[_0x5b1b43];return _0x2758b3;};'use strict';var emlformat=require(_0xdf69('0x0'));var rimraf=require(_0xdf69('0x1'));var zipdir=require(_0xdf69('0x2'));var jsonpatch=require(_0xdf69('0x3'));var rp=require(_0xdf69('0x4'));var moment=require('moment');var BPromise=require(_0xdf69('0x5'));var Mustache=require(_0xdf69('0x6'));var util=require(_0xdf69('0x7'));var path=require(_0xdf69('0x8'));var sox=require(_0xdf69('0x9'));var csv=require(_0xdf69('0xa'));var ejs=require(_0xdf69('0xb'));var fs=require('fs');var fs_extra=require(_0xdf69('0xc'));var _=require(_0xdf69('0xd'));var squel=require(_0xdf69('0xe'));var crypto=require(_0xdf69('0xf'));var jsforce=require(_0xdf69('0x10'));var deskjs=require(_0xdf69('0x11'));var toCsv=require(_0xdf69('0xa'));var querystring=require(_0xdf69('0x12'));var Papa=require(_0xdf69('0x13'));var Redis=require(_0xdf69('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdf69('0x15'));var as=require(_0xdf69('0x16'));var hardwareService=require(_0xdf69('0x17'));var logger=require(_0xdf69('0x18'))(_0xdf69('0x19'));var utils=require(_0xdf69('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5df98a,_0x3dcda8){_0x3dcda8=_0x3dcda8||0xcc;return function(_0xbacdc6){if(_0xbacdc6){return _0x5df98a[_0xdf69('0x1b')](_0x3dcda8);}return _0x5df98a[_0xdf69('0x1c')](_0x3dcda8)[_0xdf69('0x1d')]();};}function respondWithResult(_0x38aee2,_0x584cbd){_0x584cbd=_0x584cbd||0xc8;return function(_0x41cc77){if(_0x41cc77){return _0x38aee2[_0xdf69('0x1c')](_0x584cbd)[_0xdf69('0x1e')](_0x41cc77);}};}function respondWithFilteredResult(_0xef2df5,_0x4f28fc){return function(_0xa4242f){if(_0xa4242f){var _0x56be66=typeof _0x4f28fc[_0xdf69('0x1f')]===_0xdf69('0x20')&&typeof _0x4f28fc['limit']===_0xdf69('0x20');var _0x449908=_0xa4242f[_0xdf69('0x21')];var _0x85d1d=_0x56be66?0x0:_0x4f28fc['offset'];var _0x5ae237=_0x56be66?_0xa4242f[_0xdf69('0x21')]:_0x4f28fc[_0xdf69('0x1f')]+_0x4f28fc['limit'];var _0x32cf65;if(_0x5ae237>=_0x449908){_0x5ae237=_0x449908;_0x32cf65=0xc8;}else{_0x32cf65=0xce;}_0xef2df5[_0xdf69('0x1c')](_0x32cf65);return _0xef2df5[_0xdf69('0x22')]('Content-Range',_0x85d1d+'-'+_0x5ae237+'/'+_0x449908)[_0xdf69('0x1e')](_0xa4242f);}return null;};}function patchUpdates(_0x452cfa){return function(_0x4d09d5){try{jsonpatch['apply'](_0x4d09d5,_0x452cfa,!![]);}catch(_0x32505a){return BPromise[_0xdf69('0x23')](_0x32505a);}return _0x4d09d5[_0xdf69('0x24')]();};}function saveUpdates(_0x5d91b8,_0x50ef18){return function(_0x5be7dd){if(_0x5be7dd){return _0x5be7dd[_0xdf69('0x25')](_0x5d91b8)['then'](function(_0x21f757){return _0x21f757;});}return null;};}function removeEntity(_0x311534,_0x1d37d8){return function(_0x54d2ca){if(_0x54d2ca){return _0x54d2ca['destroy']()[_0xdf69('0x26')](function(){_0x311534[_0xdf69('0x1c')](0xcc)[_0xdf69('0x1d')]();});}};}function handleEntityNotFound(_0x3fd933,_0x549191){return function(_0x3b727c){if(!_0x3b727c){_0x3fd933[_0xdf69('0x1b')](0x194);}return _0x3b727c;};}function handleError(_0x3e4f28,_0x5969cb){_0x5969cb=_0x5969cb||0x1f4;return function(_0x2da3df){logger['error'](_0x2da3df['stack']);if(_0x2da3df['name']){delete _0x2da3df['name'];}_0x3e4f28[_0xdf69('0x1c')](_0x5969cb)[_0xdf69('0x27')](_0x2da3df);};}exports['index']=function(_0x301bd2,_0xd81d0a){var _0x19cf2d={},_0x12aec3={},_0x1b7c16={'count':0x0,'rows':[]};var _0x1b57b3=_[_0xdf69('0x28')](db[_0xdf69('0x29')][_0xdf69('0x2a')],function(_0x3b97df){return{'name':_0x3b97df[_0xdf69('0x2b')],'type':_0x3b97df[_0xdf69('0x2c')][_0xdf69('0x2d')]};});_0x12aec3[_0xdf69('0x2e')]=_[_0xdf69('0x28')](_0x1b57b3,_0xdf69('0x2f'));_0x12aec3[_0xdf69('0x30')]=_['keys'](_0x301bd2[_0xdf69('0x30')]);_0x12aec3[_0xdf69('0x31')]=_[_0xdf69('0x32')](_0x12aec3[_0xdf69('0x2e')],_0x12aec3[_0xdf69('0x30')]);_0x19cf2d['attributes']=_[_0xdf69('0x32')](_0x12aec3['model'],qs[_0xdf69('0x33')](_0x301bd2[_0xdf69('0x30')]['fields']));_0x19cf2d[_0xdf69('0x34')]=_0x19cf2d['attributes'][_0xdf69('0x35')]?_0x19cf2d[_0xdf69('0x34')]:_0x12aec3[_0xdf69('0x2e')];if(!_0x301bd2[_0xdf69('0x30')][_0xdf69('0x36')]('nolimit')){_0x19cf2d[_0xdf69('0x37')]=qs['limit'](_0x301bd2[_0xdf69('0x30')][_0xdf69('0x37')]);_0x19cf2d[_0xdf69('0x1f')]=qs[_0xdf69('0x1f')](_0x301bd2['query'][_0xdf69('0x1f')]);}_0x19cf2d['order']=qs[_0xdf69('0x38')](_0x301bd2['query'][_0xdf69('0x38')]);_0x19cf2d['where']=qs[_0xdf69('0x31')](_[_0xdf69('0x39')](_0x301bd2[_0xdf69('0x30')],_0x12aec3[_0xdf69('0x31')]),_0x1b57b3);if(_0x301bd2[_0xdf69('0x30')]['filter']){_0x19cf2d[_0xdf69('0x3a')]=_[_0xdf69('0x3b')](_0x19cf2d['where'],{'$or':_['map'](_0x1b57b3,function(_0x4ee03c){if(_0x4ee03c['type']!==_0xdf69('0x3c')){var _0x5aff7d={};_0x5aff7d[_0x4ee03c[_0xdf69('0x2f')]]={'$like':'%'+_0x301bd2[_0xdf69('0x30')][_0xdf69('0x3d')]+'%'};return _0x5aff7d;}})});}_0x19cf2d=_[_0xdf69('0x3b')]({},_0x19cf2d,_0x301bd2['options']);var _0x3de096={'where':_0x19cf2d[_0xdf69('0x3a')]};return db[_0xdf69('0x29')]['count'](_0x3de096)[_0xdf69('0x26')](function(_0xdd919d){_0x1b7c16[_0xdf69('0x21')]=_0xdd919d;if(_0x301bd2[_0xdf69('0x30')][_0xdf69('0x3e')]){_0x19cf2d[_0xdf69('0x3f')]=[{'all':!![]}];}return db[_0xdf69('0x29')]['findAll'](_0x19cf2d);})['then'](function(_0x1fc4aa){_0x1b7c16[_0xdf69('0x40')]=_0x1fc4aa;return _0x1b7c16;})[_0xdf69('0x26')](respondWithFilteredResult(_0xd81d0a,_0x19cf2d))[_0xdf69('0x41')](handleError(_0xd81d0a,null));};exports['show']=function(_0x4a972c,_0x5980b1){var _0x5454e1={'raw':!![],'where':{'id':_0x4a972c['params']['id']}},_0x2abc7f={};_0x2abc7f[_0xdf69('0x2e')]=_['keys'](db[_0xdf69('0x29')][_0xdf69('0x2a')]);_0x2abc7f[_0xdf69('0x30')]=_[_0xdf69('0x42')](_0x4a972c[_0xdf69('0x30')]);_0x2abc7f[_0xdf69('0x31')]=_[_0xdf69('0x32')](_0x2abc7f[_0xdf69('0x2e')],_0x2abc7f[_0xdf69('0x30')]);_0x5454e1['attributes']=_['intersection'](_0x2abc7f[_0xdf69('0x2e')],qs['fields'](_0x4a972c[_0xdf69('0x30')][_0xdf69('0x33')]));_0x5454e1[_0xdf69('0x34')]=_0x5454e1['attributes'][_0xdf69('0x35')]?_0x5454e1[_0xdf69('0x34')]:_0x2abc7f[_0xdf69('0x2e')];if(_0x4a972c[_0xdf69('0x30')]['includeAll']){_0x5454e1[_0xdf69('0x3f')]=[{'all':!![]}];}_0x5454e1=_[_0xdf69('0x3b')]({},_0x5454e1,_0x4a972c['options']);return db['Cdr'][_0xdf69('0x43')](_0x5454e1)[_0xdf69('0x26')](handleEntityNotFound(_0x5980b1,null))[_0xdf69('0x26')](respondWithResult(_0x5980b1,null))[_0xdf69('0x41')](handleError(_0x5980b1,null));};exports[_0xdf69('0x44')]=function(_0x1b46c6,_0x578eec){return db['Cdr'][_0xdf69('0x44')](_0x1b46c6[_0xdf69('0x45')],{})[_0xdf69('0x26')](respondWithResult(_0x578eec,0xc9))[_0xdf69('0x41')](handleError(_0x578eec,null));};exports['update']=function(_0x4bc70f,_0xb34f76){if(_0x4bc70f[_0xdf69('0x45')]['id']){delete _0x4bc70f[_0xdf69('0x45')]['id'];}return db[_0xdf69('0x29')][_0xdf69('0x43')]({'where':{'id':_0x4bc70f[_0xdf69('0x46')]['id']}})[_0xdf69('0x26')](handleEntityNotFound(_0xb34f76,null))[_0xdf69('0x26')](saveUpdates(_0x4bc70f[_0xdf69('0x45')],null))[_0xdf69('0x26')](respondWithResult(_0xb34f76,null))[_0xdf69('0x41')](handleError(_0xb34f76,null));};exports[_0xdf69('0x47')]=function(_0x9a24c9,_0x439b06){return db['Cdr'][_0xdf69('0x43')]({'where':{'id':_0x9a24c9[_0xdf69('0x46')]['id']}})[_0xdf69('0x26')](handleEntityNotFound(_0x439b06,null))['then'](removeEntity(_0x439b06,null))[_0xdf69('0x41')](handleError(_0x439b06,null));};exports[_0xdf69('0x48')]=function(_0x15ca48,_0x4abeb7){return db[_0xdf69('0x29')]['describe']()[_0xdf69('0x26')](respondWithResult(_0x4abeb7,null))[_0xdf69('0x41')](handleError(_0x4abeb7,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 4052242..503861c 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x152459,_0x4ef11d){var _0x126827=function(_0x434ed6){while(--_0x434ed6){_0x152459['push'](_0x152459['shift']());}};_0x126827(++_0x4ef11d);}(_0x7a54,0x106));var _0x47a5=function(_0x18f857,_0x3b3d3a){_0x18f857=_0x18f857-0x0;var _0x1504bd=_0x7a54[_0x18f857];return _0x1504bd;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x40f2a4,_0x261c4b){var _0x48f496=function(_0x38f49b){while(--_0x38f49b){_0x40f2a4['push'](_0x40f2a4['shift']());}};_0x48f496(++_0x261c4b);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 e521818..a9deadd 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 _0x7f43=['info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then'];(function(_0x51d3ac,_0x2cdcfc){var _0x29b333=function(_0xd4e32){while(--_0xd4e32){_0x51d3ac['push'](_0x51d3ac['shift']());}};_0x29b333(++_0x2cdcfc);}(_0x7f43,0xfb));var _0x37f4=function(_0x45e7b8,_0x1d3180){_0x45e7b8=_0x45e7b8-0x0;var _0x4838a=_0x7f43[_0x45e7b8];return _0x4838a;};'use strict';var _=require(_0x37f4('0x0'));var util=require(_0x37f4('0x1'));var moment=require(_0x37f4('0x2'));var BPromise=require(_0x37f4('0x3'));var rs=require(_0x37f4('0x4'));var fs=require('fs');var Redis=require(_0x37f4('0x5'));var db=require(_0x37f4('0x6'))['db'];var utils=require(_0x37f4('0x7'));var logger=require(_0x37f4('0x8'))(_0x37f4('0x9'));var config=require('../../config/environment');var jayson=require(_0x37f4('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56108c,_0x1a1f11,_0x30e5a9){return new BPromise(function(_0x4a4fbc,_0x3b4b46){return client[_0x37f4('0xb')](_0x56108c,_0x30e5a9)[_0x37f4('0xc')](function(_0x4a09a0){logger[_0x37f4('0xd')](_0x37f4('0xe'),_0x1a1f11,_0x37f4('0xf'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x1a1f11,_0x37f4('0xf'),JSON[_0x37f4('0x10')](_0x4a09a0));if(_0x4a09a0[_0x37f4('0x11')]){if(_0x4a09a0[_0x37f4('0x11')][_0x37f4('0x12')]===0x1f4){logger[_0x37f4('0x11')](_0x37f4('0xe'),_0x1a1f11,_0x4a09a0['error'][_0x37f4('0x13')]);return _0x3b4b46(_0x4a09a0['error'][_0x37f4('0x13')]);}logger['error'](_0x37f4('0xe'),_0x1a1f11,_0x4a09a0[_0x37f4('0x11')][_0x37f4('0x13')]);return _0x4a4fbc(_0x4a09a0[_0x37f4('0x11')][_0x37f4('0x13')]);}else{logger[_0x37f4('0xd')](_0x37f4('0xe'),_0x1a1f11,_0x37f4('0xf'));_0x4a4fbc(_0x4a09a0[_0x37f4('0x14')]['message']);}})[_0x37f4('0x15')](function(_0x448bec){logger[_0x37f4('0x11')](_0x37f4('0xe'),_0x1a1f11,_0x448bec);_0x3b4b46(_0x448bec);});});}
\ No newline at end of file
+var _0xa585=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x472ede,_0xeafc05){var _0x4b35fd=function(_0x3ae5fc){while(--_0x3ae5fc){_0x472ede['push'](_0x472ede['shift']());}};_0x4b35fd(++_0xeafc05);}(_0xa585,0x84));var _0x5a58=function(_0x4fd508,_0x340941){_0x4fd508=_0x4fd508-0x0;var _0xc8e65b=_0xa585[_0x4fd508];return _0xc8e65b;};'use strict';var _=require(_0x5a58('0x0'));var util=require(_0x5a58('0x1'));var moment=require(_0x5a58('0x2'));var BPromise=require(_0x5a58('0x3'));var rs=require(_0x5a58('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a58('0x5'))['db'];var utils=require(_0x5a58('0x6'));var logger=require(_0x5a58('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5a58('0x8')][_0x5a58('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39a0c9,_0x3a1de1,_0x24d726){return new BPromise(function(_0xe42f84,_0x4396bc){return client[_0x5a58('0xa')](_0x39a0c9,_0x24d726)[_0x5a58('0xb')](function(_0xf3aef9){logger[_0x5a58('0xc')](_0x5a58('0xd'),_0x3a1de1,'request\x20sent');logger[_0x5a58('0xe')](_0x5a58('0xf'),_0x3a1de1,_0x5a58('0x10'),JSON['stringify'](_0xf3aef9));if(_0xf3aef9[_0x5a58('0x11')]){if(_0xf3aef9[_0x5a58('0x11')][_0x5a58('0x12')]===0x1f4){logger['error'](_0x5a58('0xd'),_0x3a1de1,_0xf3aef9[_0x5a58('0x11')][_0x5a58('0x13')]);return _0x4396bc(_0xf3aef9[_0x5a58('0x11')][_0x5a58('0x13')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x3a1de1,_0xf3aef9['error'][_0x5a58('0x13')]);return _0xe42f84(_0xf3aef9['error'][_0x5a58('0x13')]);}else{logger[_0x5a58('0xc')](_0x5a58('0xd'),_0x3a1de1,'request\x20sent');_0xe42f84(_0xf3aef9[_0x5a58('0x14')]['message']);}})[_0x5a58('0x15')](function(_0x2ed5c3){logger[_0x5a58('0x11')](_0x5a58('0xd'),_0x3a1de1,_0x2ed5c3);_0x4396bc(_0x2ed5c3);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index beb48cf..fbdfa02 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 04f94e1..7babdec 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 _0xbecd=['STRING'];(function(_0x29f800,_0x19fbf1){var _0x213eb2=function(_0x43d3e0){while(--_0x43d3e0){_0x29f800['push'](_0x29f800['shift']());}};_0x213eb2(++_0x19fbf1);}(_0xbecd,0x105));var _0xdbec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbecd[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xdbec('0x0')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xf9c6=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x16fdf2,_0x5c0a1e){var _0x23c7ba=function(_0xa40af){while(--_0xa40af){_0x16fdf2['push'](_0x16fdf2['shift']());}};_0x23c7ba(++_0x5c0a1e);}(_0xf9c6,0x18f));var _0x6f9c=function(_0x459274,_0x384c01){_0x459274=_0x459274-0x0;var _0x35c4ab=_0xf9c6[_0x459274];return _0x35c4ab;};'use strict';var Sequelize=require(_0x6f9c('0x0'));module[_0x6f9c('0x1')]={'priority':{'type':Sequelize[_0x6f9c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6f9c('0x3')],'allowNull':![],'defaultValue':_0x6f9c('0x4')},'appdata':{'type':Sequelize[_0x6f9c('0x5')]()},'description':{'type':Sequelize[_0x6f9c('0x3')]},'interval':{'type':Sequelize[_0x6f9c('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index c7faac7..e115c03 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 _0x2948=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','reject','update','then','destroy','stack','name','model','keys','ChatApplication','query','intersection','attributes','fields','length','includeAll','include','merge','find','body','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x2eea65,_0x7809ce){var _0x859a85=function(_0x3b7e13){while(--_0x3b7e13){_0x2eea65['push'](_0x2eea65['shift']());}};_0x859a85(++_0x7809ce);}(_0x2948,0xcb));var _0x8294=function(_0x18e9c4,_0x45775e){_0x18e9c4=_0x18e9c4-0x0;var _0x3c380f=_0x2948[_0x18e9c4];return _0x3c380f;};'use strict';var emlformat=require(_0x8294('0x0'));var rimraf=require(_0x8294('0x1'));var zipdir=require(_0x8294('0x2'));var jsonpatch=require(_0x8294('0x3'));var rp=require(_0x8294('0x4'));var moment=require(_0x8294('0x5'));var BPromise=require(_0x8294('0x6'));var Mustache=require(_0x8294('0x7'));var util=require(_0x8294('0x8'));var path=require('path');var sox=require(_0x8294('0x9'));var csv=require('to-csv');var ejs=require(_0x8294('0xa'));var fs=require('fs');var fs_extra=require(_0x8294('0xb'));var _=require(_0x8294('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8294('0xd'));var querystring=require(_0x8294('0xe'));var Papa=require('papaparse');var Redis=require(_0x8294('0xf'));var authService=require(_0x8294('0x10'));var qs=require(_0x8294('0x11'));var as=require(_0x8294('0x12'));var hardwareService=require(_0x8294('0x13'));var logger=require(_0x8294('0x14'))('api');var utils=require(_0x8294('0x15'));var config=require(_0x8294('0x16'));var licenseUtil=require(_0x8294('0x17'));var db=require(_0x8294('0x18'))['db'];function respondWithStatusCode(_0x3a13f4,_0x29f1c6){_0x29f1c6=_0x29f1c6||0xcc;return function(_0x71e347){if(_0x71e347){return _0x3a13f4[_0x8294('0x19')](_0x29f1c6);}return _0x3a13f4['status'](_0x29f1c6)[_0x8294('0x1a')]();};}function respondWithResult(_0xde307c,_0x3041ce){_0x3041ce=_0x3041ce||0xc8;return function(_0x552a87){if(_0x552a87){return _0xde307c['status'](_0x3041ce)['json'](_0x552a87);}};}function respondWithFilteredResult(_0x19295d,_0x1bccf6){return function(_0x25c9ae){if(_0x25c9ae){var _0x2ca14b=typeof _0x1bccf6[_0x8294('0x1b')]===_0x8294('0x1c')&&typeof _0x1bccf6[_0x8294('0x1d')]===_0x8294('0x1c');var _0xf93bde=_0x25c9ae[_0x8294('0x1e')];var _0x3d194a=_0x2ca14b?0x0:_0x1bccf6['offset'];var _0x40175a=_0x2ca14b?_0x25c9ae['count']:_0x1bccf6[_0x8294('0x1b')]+_0x1bccf6[_0x8294('0x1d')];var _0x256be3;if(_0x40175a>=_0xf93bde){_0x40175a=_0xf93bde;_0x256be3=0xc8;}else{_0x256be3=0xce;}_0x19295d[_0x8294('0x1f')](_0x256be3);return _0x19295d[_0x8294('0x20')](_0x8294('0x21'),_0x3d194a+'-'+_0x40175a+'/'+_0xf93bde)[_0x8294('0x22')](_0x25c9ae);}return null;};}function patchUpdates(_0x27273d){return function(_0x318fd3){try{jsonpatch['apply'](_0x318fd3,_0x27273d,!![]);}catch(_0x24ea70){return BPromise[_0x8294('0x23')](_0x24ea70);}return _0x318fd3['save']();};}function saveUpdates(_0x1e5d1e,_0x140666){return function(_0xc0eed4){if(_0xc0eed4){return _0xc0eed4[_0x8294('0x24')](_0x1e5d1e)[_0x8294('0x25')](function(_0x3a36af){return _0x3a36af;});}return null;};}function removeEntity(_0x2b6935,_0xff5d69){return function(_0x3aa9f6){if(_0x3aa9f6){return _0x3aa9f6[_0x8294('0x26')]()[_0x8294('0x25')](function(){_0x2b6935['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d2b6a,_0x557529){return function(_0x83f0c4){if(!_0x83f0c4){_0x2d2b6a['sendStatus'](0x194);}return _0x83f0c4;};}function handleError(_0x591b94,_0x37601e){_0x37601e=_0x37601e||0x1f4;return function(_0x399c9d){logger['error'](_0x399c9d[_0x8294('0x27')]);if(_0x399c9d[_0x8294('0x28')]){delete _0x399c9d[_0x8294('0x28')];}_0x591b94[_0x8294('0x1f')](_0x37601e)['send'](_0x399c9d);};}exports['show']=function(_0x311e6b,_0x2d6312){var _0x3ae908={'raw':!![],'where':{'id':_0x311e6b['params']['id']}},_0x4fa43c={};_0x4fa43c[_0x8294('0x29')]=_[_0x8294('0x2a')](db[_0x8294('0x2b')]['rawAttributes']);_0x4fa43c['query']=_[_0x8294('0x2a')](_0x311e6b[_0x8294('0x2c')]);_0x4fa43c['filters']=_[_0x8294('0x2d')](_0x4fa43c[_0x8294('0x29')],_0x4fa43c['query']);_0x3ae908[_0x8294('0x2e')]=_['intersection'](_0x4fa43c[_0x8294('0x29')],qs['fields'](_0x311e6b[_0x8294('0x2c')][_0x8294('0x2f')]));_0x3ae908[_0x8294('0x2e')]=_0x3ae908[_0x8294('0x2e')][_0x8294('0x30')]?_0x3ae908[_0x8294('0x2e')]:_0x4fa43c[_0x8294('0x29')];if(_0x311e6b['query'][_0x8294('0x31')]){_0x3ae908[_0x8294('0x32')]=[{'all':!![]}];}_0x3ae908=_[_0x8294('0x33')]({},_0x3ae908,_0x311e6b['options']);return db[_0x8294('0x2b')][_0x8294('0x34')](_0x3ae908)[_0x8294('0x25')](handleEntityNotFound(_0x2d6312,null))['then'](respondWithResult(_0x2d6312,null))['catch'](handleError(_0x2d6312,null));};exports[_0x8294('0x24')]=function(_0x35a80d,_0x1f60f3){if(_0x35a80d[_0x8294('0x35')]['id']){delete _0x35a80d[_0x8294('0x35')]['id'];}return db[_0x8294('0x2b')][_0x8294('0x34')]({'where':{'id':_0x35a80d[_0x8294('0x36')]['id']}})[_0x8294('0x25')](handleEntityNotFound(_0x1f60f3,null))['then'](saveUpdates(_0x35a80d[_0x8294('0x35')],null))[_0x8294('0x25')](respondWithResult(_0x1f60f3,null))['catch'](handleError(_0x1f60f3,null));};exports[_0x8294('0x26')]=function(_0x8ad38c,_0x1f2b33){return db[_0x8294('0x2b')]['find']({'where':{'id':_0x8ad38c[_0x8294('0x36')]['id']}})[_0x8294('0x25')](handleEntityNotFound(_0x1f2b33,null))[_0x8294('0x25')](removeEntity(_0x1f2b33,null))[_0x8294('0x37')](handleError(_0x1f2b33,null));};
\ No newline at end of file
+var _0x4f6f=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','params','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','fields','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4f6f,0x157));var _0xf4f6=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x4f6f[_0x468b0f];return _0x3e74d9;};'use strict';var emlformat=require(_0xf4f6('0x0'));var rimraf=require(_0xf4f6('0x1'));var zipdir=require(_0xf4f6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf4f6('0x3'));var moment=require('moment');var BPromise=require(_0xf4f6('0x4'));var Mustache=require(_0xf4f6('0x5'));var util=require('util');var path=require(_0xf4f6('0x6'));var sox=require(_0xf4f6('0x7'));var csv=require('to-csv');var ejs=require(_0xf4f6('0x8'));var fs=require('fs');var fs_extra=require(_0xf4f6('0x9'));var _=require(_0xf4f6('0xa'));var squel=require('squel');var crypto=require(_0xf4f6('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf4f6('0xc'));var querystring=require(_0xf4f6('0xd'));var Papa=require(_0xf4f6('0xe'));var Redis=require(_0xf4f6('0xf'));var authService=require(_0xf4f6('0x10'));var qs=require(_0xf4f6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf4f6('0x12'));var logger=require(_0xf4f6('0x13'))(_0xf4f6('0x14'));var utils=require(_0xf4f6('0x15'));var config=require(_0xf4f6('0x16'));var licenseUtil=require(_0xf4f6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ea38b,_0x107046){_0x107046=_0x107046||0xcc;return function(_0x4976f5){if(_0x4976f5){return _0x5ea38b['sendStatus'](_0x107046);}return _0x5ea38b[_0xf4f6('0x18')](_0x107046)[_0xf4f6('0x19')]();};}function respondWithResult(_0x33492d,_0x4e623b){_0x4e623b=_0x4e623b||0xc8;return function(_0x3f314c){if(_0x3f314c){return _0x33492d[_0xf4f6('0x18')](_0x4e623b)[_0xf4f6('0x1a')](_0x3f314c);}};}function respondWithFilteredResult(_0x51c4c3,_0xfdf7ae){return function(_0x5ba4c4){if(_0x5ba4c4){var _0x1f06b6=typeof _0xfdf7ae[_0xf4f6('0x1b')]===_0xf4f6('0x1c')&&typeof _0xfdf7ae['limit']===_0xf4f6('0x1c');var _0x310845=_0x5ba4c4[_0xf4f6('0x1d')];var _0x4e1d2a=_0x1f06b6?0x0:_0xfdf7ae[_0xf4f6('0x1b')];var _0x4cb047=_0x1f06b6?_0x5ba4c4[_0xf4f6('0x1d')]:_0xfdf7ae[_0xf4f6('0x1b')]+_0xfdf7ae[_0xf4f6('0x1e')];var _0x4f0d14;if(_0x4cb047>=_0x310845){_0x4cb047=_0x310845;_0x4f0d14=0xc8;}else{_0x4f0d14=0xce;}_0x51c4c3[_0xf4f6('0x18')](_0x4f0d14);return _0x51c4c3[_0xf4f6('0x1f')](_0xf4f6('0x20'),_0x4e1d2a+'-'+_0x4cb047+'/'+_0x310845)[_0xf4f6('0x1a')](_0x5ba4c4);}return null;};}function patchUpdates(_0x112918){return function(_0x794453){try{jsonpatch[_0xf4f6('0x21')](_0x794453,_0x112918,!![]);}catch(_0x30917b){return BPromise[_0xf4f6('0x22')](_0x30917b);}return _0x794453[_0xf4f6('0x23')]();};}function saveUpdates(_0x3a5e24,_0x4d8497){return function(_0x9148f1){if(_0x9148f1){return _0x9148f1[_0xf4f6('0x24')](_0x3a5e24)[_0xf4f6('0x25')](function(_0x55ac8c){return _0x55ac8c;});}return null;};}function removeEntity(_0x1324f3,_0x45b5fb){return function(_0x5bbc9d){if(_0x5bbc9d){return _0x5bbc9d[_0xf4f6('0x26')]()[_0xf4f6('0x25')](function(){_0x1324f3[_0xf4f6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32af7b,_0x224be7){return function(_0x464be1){if(!_0x464be1){_0x32af7b[_0xf4f6('0x27')](0x194);}return _0x464be1;};}function handleError(_0x5f1d69,_0x303e94){_0x303e94=_0x303e94||0x1f4;return function(_0x330ec1){logger[_0xf4f6('0x28')](_0x330ec1[_0xf4f6('0x29')]);if(_0x330ec1[_0xf4f6('0x2a')]){delete _0x330ec1[_0xf4f6('0x2a')];}_0x5f1d69[_0xf4f6('0x18')](_0x303e94)[_0xf4f6('0x2b')](_0x330ec1);};}exports['show']=function(_0x43604d,_0x3fb157){var _0xe13578={'raw':!![],'where':{'id':_0x43604d[_0xf4f6('0x2c')]['id']}},_0x59490b={};_0x59490b[_0xf4f6('0x2d')]=_[_0xf4f6('0x2e')](db[_0xf4f6('0x2f')][_0xf4f6('0x30')]);_0x59490b[_0xf4f6('0x31')]=_[_0xf4f6('0x2e')](_0x43604d[_0xf4f6('0x31')]);_0x59490b[_0xf4f6('0x32')]=_['intersection'](_0x59490b['model'],_0x59490b[_0xf4f6('0x31')]);_0xe13578[_0xf4f6('0x33')]=_[_0xf4f6('0x34')](_0x59490b[_0xf4f6('0x2d')],qs[_0xf4f6('0x35')](_0x43604d[_0xf4f6('0x31')][_0xf4f6('0x35')]));_0xe13578[_0xf4f6('0x33')]=_0xe13578[_0xf4f6('0x33')]['length']?_0xe13578[_0xf4f6('0x33')]:_0x59490b[_0xf4f6('0x2d')];if(_0x43604d[_0xf4f6('0x31')]['includeAll']){_0xe13578[_0xf4f6('0x36')]=[{'all':!![]}];}_0xe13578=_[_0xf4f6('0x37')]({},_0xe13578,_0x43604d[_0xf4f6('0x38')]);return db[_0xf4f6('0x2f')][_0xf4f6('0x39')](_0xe13578)['then'](handleEntityNotFound(_0x3fb157,null))[_0xf4f6('0x25')](respondWithResult(_0x3fb157,null))[_0xf4f6('0x3a')](handleError(_0x3fb157,null));};exports['update']=function(_0x36315f,_0x384436){if(_0x36315f[_0xf4f6('0x3b')]['id']){delete _0x36315f[_0xf4f6('0x3b')]['id'];}return db['ChatApplication'][_0xf4f6('0x39')]({'where':{'id':_0x36315f['params']['id']}})[_0xf4f6('0x25')](handleEntityNotFound(_0x384436,null))[_0xf4f6('0x25')](saveUpdates(_0x36315f[_0xf4f6('0x3b')],null))['then'](respondWithResult(_0x384436,null))[_0xf4f6('0x3a')](handleError(_0x384436,null));};exports[_0xf4f6('0x26')]=function(_0x46f9b9,_0xf11e25){return db['ChatApplication'][_0xf4f6('0x39')]({'where':{'id':_0x46f9b9[_0xf4f6('0x2c')]['id']}})[_0xf4f6('0x25')](handleEntityNotFound(_0xf11e25,null))['then'](removeEntity(_0xf11e25,null))[_0xf4f6('0x3a')](handleError(_0xf11e25,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index f87fd09..15419fb 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 _0x20ef=['./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x177a61,_0x40b148){var _0x49a6a8=function(_0xa68318){while(--_0xa68318){_0x177a61['push'](_0x177a61['shift']());}};_0x49a6a8(++_0x40b148);}(_0x20ef,0xe6));var _0xf20e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf20e('0x0'));var util=require(_0xf20e('0x1'));var logger=require(_0xf20e('0x2'))(_0xf20e('0x3'));var moment=require(_0xf20e('0x4'));var BPromise=require(_0xf20e('0x5'));var rp=require(_0xf20e('0x6'));var fs=require('fs');var path=require(_0xf20e('0x7'));var rimraf=require(_0xf20e('0x8'));var config=require(_0xf20e('0x9'));var attributes=require(_0xf20e('0xa'));module[_0xf20e('0xb')]=function(_0x40bc26,_0x27b0b2){return _0x40bc26[_0xf20e('0xc')](_0xf20e('0xd'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf20e('0xe'),'collate':_0xf20e('0xf')});};
\ No newline at end of file
+var _0xe1ce=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication','lodash'];(function(_0x4ae666,_0x5e849a){var _0x3d282a=function(_0x2d9979){while(--_0x2d9979){_0x4ae666['push'](_0x4ae666['shift']());}};_0x3d282a(++_0x5e849a);}(_0xe1ce,0x15e));var _0xee1c=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xe1ce[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0xee1c('0x0'));var util=require(_0xee1c('0x1'));var logger=require(_0xee1c('0x2'))(_0xee1c('0x3'));var moment=require(_0xee1c('0x4'));var BPromise=require(_0xee1c('0x5'));var rp=require(_0xee1c('0x6'));var fs=require('fs');var path=require(_0xee1c('0x7'));var rimraf=require(_0xee1c('0x8'));var config=require(_0xee1c('0x9'));var attributes=require('./chatApplication.attributes');module[_0xee1c('0xa')]=function(_0x4f0733,_0x5729f0){return _0x4f0733[_0xee1c('0xb')](_0xee1c('0xc'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 78592ef..a187c1c 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 _0x72af=['../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','message','ChatApplication,\x20%s,\x20%s','info','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x72af,0xb5));var _0xf72a=function(_0x24de55,_0x43bf51){_0x24de55=_0x24de55-0x0;var _0x48400f=_0x72af[_0x24de55];return _0x48400f;};'use strict';var _=require(_0xf72a('0x0'));var util=require(_0xf72a('0x1'));var moment=require(_0xf72a('0x2'));var BPromise=require(_0xf72a('0x3'));var rs=require(_0xf72a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf72a('0x5'));var logger=require(_0xf72a('0x6'))(_0xf72a('0x7'));var config=require(_0xf72a('0x8'));var jayson=require(_0xf72a('0x9'));var client=jayson[_0xf72a('0xa')][_0xf72a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30e0d5,_0x487a9e,_0x51996f){return new BPromise(function(_0x5c7beb,_0x5044c5){return client[_0xf72a('0xc')](_0x30e0d5,_0x51996f)['then'](function(_0x5b2965){logger['info']('ChatApplication,\x20%s,\x20%s',_0x487a9e,_0xf72a('0xd'));logger[_0xf72a('0xe')](_0xf72a('0xf'),_0x487a9e,_0xf72a('0xd'),JSON['stringify'](_0x5b2965));if(_0x5b2965[_0xf72a('0x10')]){if(_0x5b2965[_0xf72a('0x10')]['code']===0x1f4){logger[_0xf72a('0x10')]('ChatApplication,\x20%s,\x20%s',_0x487a9e,_0x5b2965[_0xf72a('0x10')][_0xf72a('0x11')]);return _0x5044c5(_0x5b2965[_0xf72a('0x10')][_0xf72a('0x11')]);}logger[_0xf72a('0x10')](_0xf72a('0x12'),_0x487a9e,_0x5b2965['error']['message']);return _0x5c7beb(_0x5b2965[_0xf72a('0x10')]['message']);}else{logger[_0xf72a('0x13')](_0xf72a('0x12'),_0x487a9e,_0xf72a('0xd'));_0x5c7beb(_0x5b2965['result']['message']);}})[_0xf72a('0x14')](function(_0x46757c){logger['error'](_0xf72a('0x12'),_0x487a9e,_0x46757c);_0x5044c5(_0x46757c);});});}
\ No newline at end of file
+var _0xf5e3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','ChatApplication,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','randomstring'];(function(_0x248baa,_0x4fbab1){var _0x4e8f6c=function(_0x252bc8){while(--_0x252bc8){_0x248baa['push'](_0x248baa['shift']());}};_0x4e8f6c(++_0x4fbab1);}(_0xf5e3,0x13e));var _0x3f5e=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xf5e3[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x3f5e('0x0'));var util=require(_0x3f5e('0x1'));var moment=require(_0x3f5e('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f5e('0x3'));var fs=require('fs');var Redis=require(_0x3f5e('0x4'));var db=require(_0x3f5e('0x5'))['db'];var utils=require(_0x3f5e('0x6'));var logger=require(_0x3f5e('0x7'))(_0x3f5e('0x8'));var config=require(_0x3f5e('0x9'));var jayson=require(_0x3f5e('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xea8f77,_0x40a479,_0x1f9e47){return new BPromise(function(_0x598a59,_0x40a0fc){return client[_0x3f5e('0xb')](_0xea8f77,_0x1f9e47)[_0x3f5e('0xc')](function(_0x5b1afd){logger[_0x3f5e('0xd')]('ChatApplication,\x20%s,\x20%s',_0x40a479,'request\x20sent');logger[_0x3f5e('0xe')](_0x3f5e('0xf'),_0x40a479,'request\x20sent',JSON['stringify'](_0x5b1afd));if(_0x5b1afd[_0x3f5e('0x10')]){if(_0x5b1afd['error'][_0x3f5e('0x11')]===0x1f4){logger[_0x3f5e('0x10')](_0x3f5e('0x12'),_0x40a479,_0x5b1afd[_0x3f5e('0x10')][_0x3f5e('0x13')]);return _0x40a0fc(_0x5b1afd[_0x3f5e('0x10')][_0x3f5e('0x13')]);}logger[_0x3f5e('0x10')](_0x3f5e('0x12'),_0x40a479,_0x5b1afd[_0x3f5e('0x10')][_0x3f5e('0x13')]);return _0x598a59(_0x5b1afd[_0x3f5e('0x10')][_0x3f5e('0x13')]);}else{logger[_0x3f5e('0xd')](_0x3f5e('0x12'),_0x40a479,_0x3f5e('0x14'));_0x598a59(_0x5b1afd[_0x3f5e('0x15')]['message']);}})[_0x3f5e('0x16')](function(_0x2cc355){logger['error'](_0x3f5e('0x12'),_0x40a479,_0x2cc355);_0x40a0fc(_0x2cc355);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 45dbde1..1a5261c 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 _0xa707=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/:id','show','put','isAuthenticated','update','destroy','exports','multer','util','path'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xa707,0xfd));var _0x7a70=function(_0x4bb3ea,_0x2ce356){_0x4bb3ea=_0x4bb3ea-0x0;var _0xdb178a=_0xa707[_0x4bb3ea];return _0xdb178a;};'use strict';var multer=require(_0x7a70('0x0'));var util=require(_0x7a70('0x1'));var path=require(_0x7a70('0x2'));var timeout=require(_0x7a70('0x3'));var express=require(_0x7a70('0x4'));var router=express[_0x7a70('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7a70('0x6'));var interaction=require(_0x7a70('0x7'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x7a70('0x8')](_0x7a70('0x9'),auth['isAuthenticated'](),controller[_0x7a70('0xa')]);router[_0x7a70('0xb')](_0x7a70('0x9'),auth[_0x7a70('0xc')](),controller[_0x7a70('0xd')]);router['delete']('/:id',auth[_0x7a70('0xc')](),controller[_0x7a70('0xe')]);module[_0x7a70('0xf')]=router;
\ No newline at end of file
+var _0xb994=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','update','delete','destroy','util','path','connect-timeout'];(function(_0x3c704f,_0x5b5106){var _0x550c19=function(_0x562091){while(--_0x562091){_0x3c704f['push'](_0x3c704f['shift']());}};_0x550c19(++_0x5b5106);}(_0xb994,0x97));var _0x4b99=function(_0x39d812,_0x9b37e5){_0x39d812=_0x39d812-0x0;var _0x43882d=_0xb994[_0x39d812];return _0x43882d;};'use strict';var multer=require('multer');var util=require(_0x4b99('0x0'));var path=require(_0x4b99('0x1'));var timeout=require(_0x4b99('0x2'));var express=require(_0x4b99('0x3'));var router=express[_0x4b99('0x4')]();var fs_extra=require(_0x4b99('0x5'));var auth=require(_0x4b99('0x6'));var interaction=require(_0x4b99('0x7'));var config=require(_0x4b99('0x8'));var controller=require('./chatApplication.controller');router['get'](_0x4b99('0x9'),auth[_0x4b99('0xa')](),controller['show']);router['put'](_0x4b99('0x9'),auth[_0x4b99('0xa')](),controller[_0x4b99('0xb')]);router[_0x4b99('0xc')](_0x4b99('0x9'),auth[_0x4b99('0xa')](),controller[_0x4b99('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 1da0ce5..e054343 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 _0xf4a9=['sequelize','exports','STRING','BOOLEAN'];(function(_0x3b3466,_0x228276){var _0x16157f=function(_0x51a1af){while(--_0x51a1af){_0x3b3466['push'](_0x3b3466['shift']());}};_0x16157f(++_0x228276);}(_0xf4a9,0x164));var _0x9f4a=function(_0x1cd51f,_0x297954){_0x1cd51f=_0x1cd51f-0x0;var _0x54208a=_0xf4a9[_0x1cd51f];return _0x54208a;};'use strict';var Sequelize=require(_0x9f4a('0x0'));module[_0x9f4a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9f4a('0x2')]},'write':{'type':Sequelize[_0x9f4a('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xd1ca=['sequelize','exports'];(function(_0x16d03f,_0x308f79){var _0x235081=function(_0xc768ec){while(--_0xc768ec){_0x16d03f['push'](_0x16d03f['shift']());}};_0x235081(++_0x308f79);}(_0xd1ca,0x140));var _0xad1c=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xd1ca[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0xad1c('0x0'));module[_0xad1c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 6b18438..9e54da2 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 _0x2b45=['includeAll','findAll','catch','show','params','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','order','$gte','eml-format','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','end','sendStatus','error','stack','name','send','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','merge','options','ChatGroup'];(function(_0x283d30,_0x4a0b8a){var _0x5540f1=function(_0x4c20f3){while(--_0x4c20f3){_0x283d30['push'](_0x283d30['shift']());}};_0x5540f1(++_0x4a0b8a);}(_0x2b45,0x71));var _0x52b4=function(_0x47b844,_0x540bac){_0x47b844=_0x47b844-0x0;var _0x86cc76=_0x2b45[_0x47b844];return _0x86cc76;};'use strict';var emlformat=require(_0x52b4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x52b4('0x1'));var moment=require(_0x52b4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x52b4('0x3'));var util=require('util');var path=require(_0x52b4('0x4'));var sox=require(_0x52b4('0x5'));var csv=require(_0x52b4('0x6'));var ejs=require(_0x52b4('0x7'));var fs=require('fs');var fs_extra=require(_0x52b4('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x52b4('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x52b4('0xa'));var Redis=require(_0x52b4('0xb'));var authService=require(_0x52b4('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x52b4('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x52b4('0xe'))(_0x52b4('0xf'));var utils=require(_0x52b4('0x10'));var config=require(_0x52b4('0x11'));var licenseUtil=require(_0x52b4('0x12'));var db=require(_0x52b4('0x13'))['db'];config[_0x52b4('0x14')]=_[_0x52b4('0x15')](config['redis'],{'host':_0x52b4('0x16'),'port':0x18eb});var socket=require(_0x52b4('0x17'))(new Redis(config[_0x52b4('0x14')]));require(_0x52b4('0x18'))[_0x52b4('0x19')](socket);function respondWithStatusCode(_0x141132,_0x332300){_0x332300=_0x332300||0xcc;return function(_0x4bc1f4){if(_0x4bc1f4){return _0x141132['sendStatus'](_0x332300);}return _0x141132['status'](_0x332300)['end']();};}function respondWithResult(_0x23c48e,_0x38b1f1){_0x38b1f1=_0x38b1f1||0xc8;return function(_0x50fdb8){if(_0x50fdb8){return _0x23c48e[_0x52b4('0x1a')](_0x38b1f1)[_0x52b4('0x1b')](_0x50fdb8);}};}function respondWithFilteredResult(_0x173318,_0x4c8800){return function(_0x256353){if(_0x256353){var _0x3f5a9f=typeof _0x4c8800[_0x52b4('0x1c')]===_0x52b4('0x1d')&&typeof _0x4c8800[_0x52b4('0x1e')]===_0x52b4('0x1d');var _0x2a873d=_0x256353[_0x52b4('0x1f')];var _0x39cb32=_0x3f5a9f?0x0:_0x4c8800[_0x52b4('0x1c')];var _0x5188d5=_0x3f5a9f?_0x256353['count']:_0x4c8800[_0x52b4('0x1c')]+_0x4c8800[_0x52b4('0x1e')];var _0x4ccbce;if(_0x5188d5>=_0x2a873d){_0x5188d5=_0x2a873d;_0x4ccbce=0xc8;}else{_0x4ccbce=0xce;}_0x173318[_0x52b4('0x1a')](_0x4ccbce);return _0x173318[_0x52b4('0x20')](_0x52b4('0x21'),_0x39cb32+'-'+_0x5188d5+'/'+_0x2a873d)[_0x52b4('0x1b')](_0x256353);}return null;};}function patchUpdates(_0x4561bf){return function(_0x2630ab){try{jsonpatch[_0x52b4('0x22')](_0x2630ab,_0x4561bf,!![]);}catch(_0x30fd4b){return BPromise['reject'](_0x30fd4b);}return _0x2630ab[_0x52b4('0x23')]();};}function saveUpdates(_0x15efc0,_0x13a05e){return function(_0x2801d3){if(_0x2801d3){return _0x2801d3[_0x52b4('0x24')](_0x15efc0)['then'](function(_0x40fe6a){return _0x40fe6a;});}return null;};}function removeEntity(_0x56d3a9,_0x2716eb){return function(_0x4b3ee1){if(_0x4b3ee1){return _0x4b3ee1[_0x52b4('0x25')]()[_0x52b4('0x26')](function(){_0x56d3a9[_0x52b4('0x1a')](0xcc)[_0x52b4('0x27')]();});}};}function handleEntityNotFound(_0x433a2b,_0x23b8f0){return function(_0x46b49e){if(!_0x46b49e){_0x433a2b[_0x52b4('0x28')](0x194);}return _0x46b49e;};}function handleError(_0x44aab8,_0x19cdd6){_0x19cdd6=_0x19cdd6||0x1f4;return function(_0x5f20ce){logger[_0x52b4('0x29')](_0x5f20ce[_0x52b4('0x2a')]);if(_0x5f20ce[_0x52b4('0x2b')]){delete _0x5f20ce[_0x52b4('0x2b')];}_0x44aab8['status'](_0x19cdd6)[_0x52b4('0x2c')](_0x5f20ce);};}exports['index']=function(_0x6ade4b,_0x15453d){var _0x3a56b9={},_0x202614={},_0x198d2a={'count':0x0,'rows':[]};var _0x530bfd=_['map'](db['ChatGroup'][_0x52b4('0x2d')],function(_0x11b331){return{'name':_0x11b331[_0x52b4('0x2e')],'type':_0x11b331['type'][_0x52b4('0x2f')]};});_0x202614[_0x52b4('0x30')]=_[_0x52b4('0x31')](_0x530bfd,_0x52b4('0x2b'));_0x202614['query']=_[_0x52b4('0x32')](_0x6ade4b[_0x52b4('0x33')]);_0x202614[_0x52b4('0x34')]=_[_0x52b4('0x35')](_0x202614['model'],_0x202614[_0x52b4('0x33')]);_0x3a56b9['attributes']=_[_0x52b4('0x35')](_0x202614[_0x52b4('0x30')],qs[_0x52b4('0x36')](_0x6ade4b[_0x52b4('0x33')]['fields']));_0x3a56b9[_0x52b4('0x37')]=_0x3a56b9[_0x52b4('0x37')][_0x52b4('0x38')]?_0x3a56b9[_0x52b4('0x37')]:_0x202614['model'];if(!_0x6ade4b['query'][_0x52b4('0x39')](_0x52b4('0x3a'))){_0x3a56b9[_0x52b4('0x1e')]=qs[_0x52b4('0x1e')](_0x6ade4b[_0x52b4('0x33')][_0x52b4('0x1e')]);_0x3a56b9[_0x52b4('0x1c')]=qs[_0x52b4('0x1c')](_0x6ade4b['query'][_0x52b4('0x1c')]);}_0x3a56b9['order']=qs[_0x52b4('0x3b')](_0x6ade4b[_0x52b4('0x33')][_0x52b4('0x3b')]);_0x3a56b9['where']=qs[_0x52b4('0x34')](_[_0x52b4('0x3c')](_0x6ade4b[_0x52b4('0x33')],_0x202614[_0x52b4('0x34')]),_0x530bfd);if(_0x6ade4b[_0x52b4('0x33')][_0x52b4('0x3d')]){_0x3a56b9[_0x52b4('0x3e')]=_['merge'](_0x3a56b9[_0x52b4('0x3e')],{'$or':_[_0x52b4('0x31')](_0x530bfd,function(_0x57b8a0){if(_0x57b8a0[_0x52b4('0x3f')]!=='VIRTUAL'){var _0x55596e={};_0x55596e[_0x57b8a0[_0x52b4('0x2b')]]={'$like':'%'+_0x6ade4b[_0x52b4('0x33')][_0x52b4('0x3d')]+'%'};return _0x55596e;}})});}_0x3a56b9=_[_0x52b4('0x40')]({},_0x3a56b9,_0x6ade4b[_0x52b4('0x41')]);var _0xf331dc={'where':_0x3a56b9['where']};return db[_0x52b4('0x42')]['count'](_0xf331dc)['then'](function(_0x420076){_0x198d2a[_0x52b4('0x1f')]=_0x420076;if(_0x6ade4b[_0x52b4('0x33')][_0x52b4('0x43')]){_0x3a56b9['include']=[{'all':!![]}];}return db['ChatGroup'][_0x52b4('0x44')](_0x3a56b9);})[_0x52b4('0x26')](function(_0x44d916){_0x198d2a['rows']=_0x44d916;return _0x198d2a;})[_0x52b4('0x26')](respondWithFilteredResult(_0x15453d,_0x3a56b9))[_0x52b4('0x45')](handleError(_0x15453d,null));};exports[_0x52b4('0x46')]=function(_0x341813,_0x531799){var _0x2da4dd={'raw':!![],'where':{'id':_0x341813[_0x52b4('0x47')]['id']}},_0x3bbfc0={};_0x3bbfc0[_0x52b4('0x30')]=_['keys'](db['ChatGroup']['rawAttributes']);_0x3bbfc0[_0x52b4('0x33')]=_[_0x52b4('0x32')](_0x341813['query']);_0x3bbfc0['filters']=_[_0x52b4('0x35')](_0x3bbfc0['model'],_0x3bbfc0[_0x52b4('0x33')]);_0x2da4dd[_0x52b4('0x37')]=_['intersection'](_0x3bbfc0[_0x52b4('0x30')],qs[_0x52b4('0x36')](_0x341813['query'][_0x52b4('0x36')]));_0x2da4dd[_0x52b4('0x37')]=_0x2da4dd[_0x52b4('0x37')]['length']?_0x2da4dd[_0x52b4('0x37')]:_0x3bbfc0[_0x52b4('0x30')];if(_0x341813[_0x52b4('0x33')]['includeAll']){_0x2da4dd['include']=[{'all':!![]}];}_0x2da4dd=_[_0x52b4('0x40')]({},_0x2da4dd,_0x341813[_0x52b4('0x41')]);return db[_0x52b4('0x42')][_0x52b4('0x48')](_0x2da4dd)['then'](handleEntityNotFound(_0x531799,null))['then'](respondWithResult(_0x531799,null))[_0x52b4('0x45')](handleError(_0x531799,null));};exports['create']=function(_0xdcc78b,_0x2a9d64){return db[_0x52b4('0x42')][_0x52b4('0x49')](_0xdcc78b[_0x52b4('0x4a')],{})['then'](respondWithResult(_0x2a9d64,0xc9))['catch'](handleError(_0x2a9d64,null));};exports[_0x52b4('0x24')]=function(_0xf3e0e,_0x23a814){if(_0xf3e0e[_0x52b4('0x4a')]['id']){delete _0xf3e0e[_0x52b4('0x4a')]['id'];}return db[_0x52b4('0x42')][_0x52b4('0x48')]({'where':{'id':_0xf3e0e[_0x52b4('0x47')]['id']}})[_0x52b4('0x26')](handleEntityNotFound(_0x23a814,null))['then'](saveUpdates(_0xf3e0e[_0x52b4('0x4a')],null))[_0x52b4('0x26')](respondWithResult(_0x23a814,null))[_0x52b4('0x45')](handleError(_0x23a814,null));};exports['destroy']=function(_0x242062,_0x9c540a){return db[_0x52b4('0x42')]['find']({'where':{'id':_0x242062['params']['id']}})[_0x52b4('0x26')](handleEntityNotFound(_0x9c540a,null))[_0x52b4('0x26')](removeEntity(_0x9c540a,null))[_0x52b4('0x45')](handleError(_0x9c540a,null));};exports[_0x52b4('0x4b')]=function(_0x3807b3,_0x54cf1e){return db[_0x52b4('0x42')][_0x52b4('0x4b')]()['then'](respondWithResult(_0x54cf1e,null))[_0x52b4('0x45')](handleError(_0x54cf1e,null));};exports[_0x52b4('0x4c')]=function(_0x11b4ad,_0x577730,_0x5f59de){return db[_0x52b4('0x4d')]['count']({'where':{'ChatGroupId':_0x11b4ad[_0x52b4('0x47')]['id'],'ToId':_0x11b4ad[_0x52b4('0x4e')]['id'],'read':![]}})[_0x52b4('0x26')](function(_0x1d7466){return{'id':_[_0x52b4('0x4f')](_0x11b4ad[_0x52b4('0x47')]['id']),'count':_0x1d7466};})[_0x52b4('0x26')](respondWithResult(_0x577730,null))[_0x52b4('0x45')](handleError(_0x577730,null));};exports[_0x52b4('0x50')]=function(_0x41d847,_0x3290a3,_0x32b035){return db[_0x52b4('0x42')][_0x52b4('0x48')]({'where':{'id':_0x41d847[_0x52b4('0x47')]['id']}})[_0x52b4('0x26')](handleEntityNotFound(_0x3290a3,null))[_0x52b4('0x26')](function(_0x3e7c9e){if(_0x3e7c9e){return _0x3e7c9e['addMembers'](_0x41d847[_0x52b4('0x4a')][_0x52b4('0x51')],_[_0x52b4('0x52')](_0x41d847[_0x52b4('0x4a')],[_0x52b4('0x51'),'id'])||{});}})[_0x52b4('0x26')](respondWithResult(_0x3290a3,null))[_0x52b4('0x45')](handleError(_0x3290a3,null));};exports[_0x52b4('0x53')]=function(_0x1d8491,_0x17ce1d,_0x144758){var _0x267b0f={};var _0x377ed5={};var _0x5ea896;var _0x301635;return db['ChatGroup']['findOne']({'where':{'id':_0x1d8491['params']['id']}})[_0x52b4('0x26')](handleEntityNotFound(_0x17ce1d,null))[_0x52b4('0x26')](function(_0x40363b){if(_0x40363b){_0x5ea896=_0x40363b;_0x377ed5[_0x52b4('0x30')]=_[_0x52b4('0x32')](db['User'][_0x52b4('0x2d')]);_0x377ed5[_0x52b4('0x33')]=_[_0x52b4('0x32')](_0x1d8491['query']);_0x377ed5[_0x52b4('0x34')]=_[_0x52b4('0x35')](_0x377ed5['model'],_0x377ed5[_0x52b4('0x33')]);_0x267b0f[_0x52b4('0x37')]=_[_0x52b4('0x35')](_0x377ed5[_0x52b4('0x30')],qs[_0x52b4('0x36')](_0x1d8491[_0x52b4('0x33')][_0x52b4('0x36')]));_0x267b0f[_0x52b4('0x37')]=_0x267b0f[_0x52b4('0x37')]['length']?_0x267b0f[_0x52b4('0x37')]:_0x377ed5['model'];_0x267b0f['order']=qs[_0x52b4('0x3b')](_0x1d8491[_0x52b4('0x33')]['sort']);_0x267b0f[_0x52b4('0x3e')]=qs[_0x52b4('0x34')](_[_0x52b4('0x3c')](_0x1d8491[_0x52b4('0x33')],_0x377ed5['filters']));if(_0x1d8491[_0x52b4('0x33')][_0x52b4('0x3d')]){_0x267b0f[_0x52b4('0x3e')]=_[_0x52b4('0x40')](_0x267b0f[_0x52b4('0x3e')],{'$or':_['map'](_0x267b0f[_0x52b4('0x37')],function(_0x2ef862){var _0x4416fa={};_0x4416fa[_0x2ef862]={'$like':'%'+_0x1d8491[_0x52b4('0x33')]['filter']+'%'};return _0x4416fa;})});}_0x267b0f=_['merge']({},_0x267b0f,_0x1d8491['options']);return _0x5ea896[_0x52b4('0x53')](_0x267b0f);}})[_0x52b4('0x26')](function(_0x4129ea){if(_0x4129ea){_0x301635=_0x4129ea['length'];if(!_0x1d8491[_0x52b4('0x33')]['hasOwnProperty']('nolimit')){_0x267b0f[_0x52b4('0x1e')]=qs[_0x52b4('0x1e')](_0x1d8491[_0x52b4('0x33')][_0x52b4('0x1e')]);_0x267b0f[_0x52b4('0x1c')]=qs[_0x52b4('0x1c')](_0x1d8491[_0x52b4('0x33')][_0x52b4('0x1c')]);}return _0x5ea896['getMembers'](_0x267b0f);}})['then'](function(_0x60a22){if(_0x60a22){return _0x60a22?{'count':_0x301635,'rows':_0x60a22}:null;}})[_0x52b4('0x26')](respondWithResult(_0x17ce1d,null))['catch'](handleError(_0x17ce1d,null));};exports[_0x52b4('0x54')]=function(_0x55cc49,_0x16f28d,_0x13eb57){return db[_0x52b4('0x42')][_0x52b4('0x48')]({'where':{'id':_0x55cc49[_0x52b4('0x47')]['id']}})[_0x52b4('0x26')](handleEntityNotFound(_0x16f28d,null))[_0x52b4('0x26')](function(_0x134b03){if(_0x134b03){return _0x134b03[_0x52b4('0x54')](_0x55cc49[_0x52b4('0x33')][_0x52b4('0x51')]);}})[_0x52b4('0x26')](respondWithStatusCode(_0x16f28d,null))[_0x52b4('0x45')](handleError(_0x16f28d,null));};exports[_0x52b4('0x55')]=function(_0x3feee4,_0x2766b2,_0x199a02){if(_0x3feee4[_0x52b4('0x4a')]['id']){delete _0x3feee4[_0x52b4('0x4a')]['id'];}return db[_0x52b4('0x42')]['find']({'where':{'id':_0x3feee4['params']['id']}})['then'](handleEntityNotFound(_0x2766b2,null))[_0x52b4('0x26')](function(_0x2e0b8c){if(_0x2e0b8c){_0x3feee4[_0x52b4('0x4a')][_0x52b4('0x56')]=_0x2e0b8c['id'];return db[_0x52b4('0x4d')][_0x52b4('0x49')](_0x3feee4['body']);}})['then'](respondWithResult(_0x2766b2,null))[_0x52b4('0x45')](handleError(_0x2766b2,null));};exports[_0x52b4('0x57')]=function(_0x490ce6,_0x3919ba,_0xb24883){var _0x289d01={};var _0x27baff={};var _0x1ee5d5;var _0x506484;return db[_0x52b4('0x42')]['findOne']({'where':{'id':_0x490ce6['params']['id']}})[_0x52b4('0x26')](handleEntityNotFound(_0x3919ba,null))[_0x52b4('0x26')](function(_0x51ffda){if(_0x51ffda){_0x1ee5d5=_0x51ffda;_0x27baff[_0x52b4('0x30')]=_[_0x52b4('0x32')](db[_0x52b4('0x4d')][_0x52b4('0x2d')]);_0x27baff[_0x52b4('0x33')]=_[_0x52b4('0x32')](_0x490ce6[_0x52b4('0x33')]);_0x27baff[_0x52b4('0x34')]=_[_0x52b4('0x35')](_0x27baff[_0x52b4('0x30')],_0x27baff[_0x52b4('0x33')]);_0x289d01[_0x52b4('0x37')]=_[_0x52b4('0x35')](_0x27baff[_0x52b4('0x30')],qs[_0x52b4('0x36')](_0x490ce6[_0x52b4('0x33')][_0x52b4('0x36')]));_0x289d01[_0x52b4('0x37')]=_0x289d01[_0x52b4('0x37')][_0x52b4('0x38')]?_0x289d01[_0x52b4('0x37')]:_0x27baff['model'];_0x289d01[_0x52b4('0x58')]=qs[_0x52b4('0x3b')](_0x490ce6[_0x52b4('0x33')][_0x52b4('0x3b')]);_0x289d01[_0x52b4('0x3e')]=qs[_0x52b4('0x34')](_[_0x52b4('0x3c')](_0x490ce6[_0x52b4('0x33')],_0x27baff[_0x52b4('0x34')]));if(_0x490ce6[_0x52b4('0x33')][_0x52b4('0x3d')]){_0x289d01[_0x52b4('0x3e')]=_['merge'](_0x289d01[_0x52b4('0x3e')],{'$or':_[_0x52b4('0x31')](_0x289d01[_0x52b4('0x37')],function(_0x27398b){var _0x3819e0={};_0x3819e0[_0x27398b]={'$like':'%'+_0x490ce6[_0x52b4('0x33')][_0x52b4('0x3d')]+'%'};return _0x3819e0;})});}if(_0x490ce6[_0x52b4('0x33')][_0x52b4('0x59')]){var _0x32637f=_0x490ce6[_0x52b4('0x33')][_0x52b4('0x59')]['split'](',');var _0x3f11da={};_0x3f11da[_0x32637f[0x0]]={'$gte':moment(_0x32637f[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x289d01[_0x52b4('0x3e')]=_[_0x52b4('0x40')](_0x289d01[_0x52b4('0x3e')],_0x3f11da);}_0x289d01=_['merge']({},_0x289d01,_0x490ce6[_0x52b4('0x41')]);return _0x1ee5d5[_0x52b4('0x57')](_0x289d01);}})[_0x52b4('0x26')](function(_0x11c438){if(_0x11c438){_0x506484=_0x11c438['length'];if(!_0x490ce6[_0x52b4('0x33')]['hasOwnProperty'](_0x52b4('0x3a'))){_0x289d01[_0x52b4('0x1e')]=qs[_0x52b4('0x1e')](_0x490ce6[_0x52b4('0x33')]['limit']);_0x289d01['offset']=qs[_0x52b4('0x1c')](_0x490ce6[_0x52b4('0x33')][_0x52b4('0x1c')]);}return _0x1ee5d5['getMessages'](_0x289d01);}})['then'](function(_0x823cd8){if(_0x823cd8){return _0x823cd8?{'count':_0x506484,'rows':_0x823cd8}:null;}})[_0x52b4('0x26')](respondWithResult(_0x3919ba,null))[_0x52b4('0x45')](handleError(_0x3919ba,null));};
\ No newline at end of file
+var _0x21a6=['create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','order','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','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./chatGroup.socket','register','status','end','json','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','key','model','keys','filters','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','find'];(function(_0x19283a,_0x303ffc){var _0x14b3b3=function(_0x434de2){while(--_0x434de2){_0x19283a['push'](_0x19283a['shift']());}};_0x14b3b3(++_0x303ffc);}(_0x21a6,0x1f0));var _0x621a=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0x21a6[_0x26d6d9];return _0x1b4875;};'use strict';var emlformat=require(_0x621a('0x0'));var rimraf=require(_0x621a('0x1'));var zipdir=require(_0x621a('0x2'));var jsonpatch=require(_0x621a('0x3'));var rp=require(_0x621a('0x4'));var moment=require(_0x621a('0x5'));var BPromise=require(_0x621a('0x6'));var Mustache=require(_0x621a('0x7'));var util=require(_0x621a('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x621a('0x9'));var ejs=require(_0x621a('0xa'));var fs=require('fs');var fs_extra=require(_0x621a('0xb'));var _=require(_0x621a('0xc'));var squel=require(_0x621a('0xd'));var crypto=require(_0x621a('0xe'));var jsforce=require(_0x621a('0xf'));var deskjs=require(_0x621a('0x10'));var toCsv=require(_0x621a('0x9'));var querystring=require(_0x621a('0x11'));var Papa=require('papaparse');var Redis=require(_0x621a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x621a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x621a('0x14'))(_0x621a('0x15'));var utils=require(_0x621a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x621a('0x17'));var db=require('../../mysqldb')['db'];config[_0x621a('0x18')]=_[_0x621a('0x19')](config['redis'],{'host':_0x621a('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x621a('0x18')]));require(_0x621a('0x1b'))[_0x621a('0x1c')](socket);function respondWithStatusCode(_0x5f4ef7,_0xd4f528){_0xd4f528=_0xd4f528||0xcc;return function(_0x54eb8b){if(_0x54eb8b){return _0x5f4ef7['sendStatus'](_0xd4f528);}return _0x5f4ef7[_0x621a('0x1d')](_0xd4f528)[_0x621a('0x1e')]();};}function respondWithResult(_0x26ba03,_0x2c157c){_0x2c157c=_0x2c157c||0xc8;return function(_0x50c6a1){if(_0x50c6a1){return _0x26ba03[_0x621a('0x1d')](_0x2c157c)[_0x621a('0x1f')](_0x50c6a1);}};}function respondWithFilteredResult(_0x19c7ed,_0x46a7bc){return function(_0x4e2036){if(_0x4e2036){var _0x356b45=typeof _0x46a7bc[_0x621a('0x20')]==='undefined'&&typeof _0x46a7bc['limit']==='undefined';var _0x11b3ee=_0x4e2036[_0x621a('0x21')];var _0x5de37b=_0x356b45?0x0:_0x46a7bc[_0x621a('0x20')];var _0x68dad6=_0x356b45?_0x4e2036['count']:_0x46a7bc['offset']+_0x46a7bc[_0x621a('0x22')];var _0x2f38b4;if(_0x68dad6>=_0x11b3ee){_0x68dad6=_0x11b3ee;_0x2f38b4=0xc8;}else{_0x2f38b4=0xce;}_0x19c7ed[_0x621a('0x1d')](_0x2f38b4);return _0x19c7ed[_0x621a('0x23')](_0x621a('0x24'),_0x5de37b+'-'+_0x68dad6+'/'+_0x11b3ee)['json'](_0x4e2036);}return null;};}function patchUpdates(_0x439727){return function(_0x1909ad){try{jsonpatch[_0x621a('0x25')](_0x1909ad,_0x439727,!![]);}catch(_0x216a42){return BPromise[_0x621a('0x26')](_0x216a42);}return _0x1909ad['save']();};}function saveUpdates(_0x672809,_0x2b5bae){return function(_0x90e2a9){if(_0x90e2a9){return _0x90e2a9[_0x621a('0x27')](_0x672809)[_0x621a('0x28')](function(_0xd90c85){return _0xd90c85;});}return null;};}function removeEntity(_0x17f538,_0x1e742f){return function(_0x2cc340){if(_0x2cc340){return _0x2cc340[_0x621a('0x29')]()[_0x621a('0x28')](function(){_0x17f538[_0x621a('0x1d')](0xcc)[_0x621a('0x1e')]();});}};}function handleEntityNotFound(_0x3df292,_0x58d463){return function(_0x48e7b6){if(!_0x48e7b6){_0x3df292['sendStatus'](0x194);}return _0x48e7b6;};}function handleError(_0xd68a07,_0x5bd0c7){_0x5bd0c7=_0x5bd0c7||0x1f4;return function(_0x3e92c7){logger[_0x621a('0x2a')](_0x3e92c7[_0x621a('0x2b')]);if(_0x3e92c7['name']){delete _0x3e92c7[_0x621a('0x2c')];}_0xd68a07['status'](_0x5bd0c7)['send'](_0x3e92c7);};}exports[_0x621a('0x2d')]=function(_0xa00c2e,_0x338615){var _0x5dd58a={},_0x1ac56e={},_0x48eadf={'count':0x0,'rows':[]};var _0x587b29=_[_0x621a('0x2e')](db[_0x621a('0x2f')][_0x621a('0x30')],function(_0x8b30a5){return{'name':_0x8b30a5[_0x621a('0x31')],'type':_0x8b30a5['type'][_0x621a('0x32')]};});_0x1ac56e[_0x621a('0x33')]=_[_0x621a('0x2e')](_0x587b29,_0x621a('0x2c'));_0x1ac56e['query']=_[_0x621a('0x34')](_0xa00c2e['query']);_0x1ac56e[_0x621a('0x35')]=_['intersection'](_0x1ac56e[_0x621a('0x33')],_0x1ac56e[_0x621a('0x36')]);_0x5dd58a['attributes']=_[_0x621a('0x37')](_0x1ac56e['model'],qs[_0x621a('0x38')](_0xa00c2e['query'][_0x621a('0x38')]));_0x5dd58a[_0x621a('0x39')]=_0x5dd58a[_0x621a('0x39')]['length']?_0x5dd58a['attributes']:_0x1ac56e[_0x621a('0x33')];if(!_0xa00c2e['query'][_0x621a('0x3a')](_0x621a('0x3b'))){_0x5dd58a[_0x621a('0x22')]=qs[_0x621a('0x22')](_0xa00c2e[_0x621a('0x36')]['limit']);_0x5dd58a['offset']=qs['offset'](_0xa00c2e['query']['offset']);}_0x5dd58a['order']=qs[_0x621a('0x3c')](_0xa00c2e[_0x621a('0x36')][_0x621a('0x3c')]);_0x5dd58a['where']=qs[_0x621a('0x35')](_['pick'](_0xa00c2e[_0x621a('0x36')],_0x1ac56e[_0x621a('0x35')]),_0x587b29);if(_0xa00c2e[_0x621a('0x36')][_0x621a('0x3d')]){_0x5dd58a[_0x621a('0x3e')]=_[_0x621a('0x3f')](_0x5dd58a['where'],{'$or':_[_0x621a('0x2e')](_0x587b29,function(_0x1204ba){if(_0x1204ba['type']!==_0x621a('0x40')){var _0x4a5f88={};_0x4a5f88[_0x1204ba[_0x621a('0x2c')]]={'$like':'%'+_0xa00c2e[_0x621a('0x36')][_0x621a('0x3d')]+'%'};return _0x4a5f88;}})});}_0x5dd58a=_[_0x621a('0x3f')]({},_0x5dd58a,_0xa00c2e[_0x621a('0x41')]);var _0x2025ff={'where':_0x5dd58a[_0x621a('0x3e')]};return db[_0x621a('0x2f')][_0x621a('0x21')](_0x2025ff)[_0x621a('0x28')](function(_0x452df1){_0x48eadf[_0x621a('0x21')]=_0x452df1;if(_0xa00c2e[_0x621a('0x36')][_0x621a('0x42')]){_0x5dd58a['include']=[{'all':!![]}];}return db[_0x621a('0x2f')][_0x621a('0x43')](_0x5dd58a);})[_0x621a('0x28')](function(_0x2560db){_0x48eadf[_0x621a('0x44')]=_0x2560db;return _0x48eadf;})['then'](respondWithFilteredResult(_0x338615,_0x5dd58a))[_0x621a('0x45')](handleError(_0x338615,null));};exports[_0x621a('0x46')]=function(_0x1f214a,_0x4115b8){var _0x29fdb8={'raw':!![],'where':{'id':_0x1f214a[_0x621a('0x47')]['id']}},_0x20161e={};_0x20161e[_0x621a('0x33')]=_['keys'](db['ChatGroup']['rawAttributes']);_0x20161e[_0x621a('0x36')]=_[_0x621a('0x34')](_0x1f214a['query']);_0x20161e[_0x621a('0x35')]=_['intersection'](_0x20161e[_0x621a('0x33')],_0x20161e[_0x621a('0x36')]);_0x29fdb8[_0x621a('0x39')]=_[_0x621a('0x37')](_0x20161e['model'],qs['fields'](_0x1f214a[_0x621a('0x36')]['fields']));_0x29fdb8['attributes']=_0x29fdb8[_0x621a('0x39')][_0x621a('0x48')]?_0x29fdb8[_0x621a('0x39')]:_0x20161e['model'];if(_0x1f214a['query'][_0x621a('0x42')]){_0x29fdb8['include']=[{'all':!![]}];}_0x29fdb8=_[_0x621a('0x3f')]({},_0x29fdb8,_0x1f214a[_0x621a('0x41')]);return db[_0x621a('0x2f')][_0x621a('0x49')](_0x29fdb8)[_0x621a('0x28')](handleEntityNotFound(_0x4115b8,null))[_0x621a('0x28')](respondWithResult(_0x4115b8,null))[_0x621a('0x45')](handleError(_0x4115b8,null));};exports[_0x621a('0x4a')]=function(_0x59f2fb,_0x5759fc){return db[_0x621a('0x2f')][_0x621a('0x4a')](_0x59f2fb['body'],{})['then'](respondWithResult(_0x5759fc,0xc9))[_0x621a('0x45')](handleError(_0x5759fc,null));};exports[_0x621a('0x27')]=function(_0x1afc91,_0x13228f){if(_0x1afc91[_0x621a('0x4b')]['id']){delete _0x1afc91[_0x621a('0x4b')]['id'];}return db['ChatGroup'][_0x621a('0x49')]({'where':{'id':_0x1afc91[_0x621a('0x47')]['id']}})['then'](handleEntityNotFound(_0x13228f,null))[_0x621a('0x28')](saveUpdates(_0x1afc91[_0x621a('0x4b')],null))[_0x621a('0x28')](respondWithResult(_0x13228f,null))[_0x621a('0x45')](handleError(_0x13228f,null));};exports[_0x621a('0x29')]=function(_0x84f96f,_0x520951){return db[_0x621a('0x2f')][_0x621a('0x49')]({'where':{'id':_0x84f96f[_0x621a('0x47')]['id']}})['then'](handleEntityNotFound(_0x520951,null))['then'](removeEntity(_0x520951,null))[_0x621a('0x45')](handleError(_0x520951,null));};exports[_0x621a('0x4c')]=function(_0x3606dc,_0x2c38f4){return db[_0x621a('0x2f')]['describe']()[_0x621a('0x28')](respondWithResult(_0x2c38f4,null))[_0x621a('0x45')](handleError(_0x2c38f4,null));};exports['getUnread']=function(_0x39b22f,_0x18f7b7,_0x2d7b2e){return db[_0x621a('0x4d')][_0x621a('0x21')]({'where':{'ChatGroupId':_0x39b22f['params']['id'],'ToId':_0x39b22f[_0x621a('0x4e')]['id'],'read':![]}})[_0x621a('0x28')](function(_0x22e664){return{'id':_[_0x621a('0x4f')](_0x39b22f[_0x621a('0x47')]['id']),'count':_0x22e664};})[_0x621a('0x28')](respondWithResult(_0x18f7b7,null))[_0x621a('0x45')](handleError(_0x18f7b7,null));};exports[_0x621a('0x50')]=function(_0x109bff,_0x3cd931,_0x200142){return db[_0x621a('0x2f')][_0x621a('0x49')]({'where':{'id':_0x109bff['params']['id']}})[_0x621a('0x28')](handleEntityNotFound(_0x3cd931,null))[_0x621a('0x28')](function(_0x33dde9){if(_0x33dde9){return _0x33dde9[_0x621a('0x50')](_0x109bff[_0x621a('0x4b')][_0x621a('0x51')],_['omit'](_0x109bff[_0x621a('0x4b')],[_0x621a('0x51'),'id'])||{});}})[_0x621a('0x28')](respondWithResult(_0x3cd931,null))['catch'](handleError(_0x3cd931,null));};exports[_0x621a('0x52')]=function(_0x34f3e9,_0x37115c,_0x2b7e6c){var _0x45286a={};var _0x1776a5={};var _0x8b7869;var _0x482b34;return db[_0x621a('0x2f')][_0x621a('0x53')]({'where':{'id':_0x34f3e9[_0x621a('0x47')]['id']}})[_0x621a('0x28')](handleEntityNotFound(_0x37115c,null))[_0x621a('0x28')](function(_0x5a72f5){if(_0x5a72f5){_0x8b7869=_0x5a72f5;_0x1776a5[_0x621a('0x33')]=_[_0x621a('0x34')](db[_0x621a('0x54')][_0x621a('0x30')]);_0x1776a5[_0x621a('0x36')]=_['keys'](_0x34f3e9[_0x621a('0x36')]);_0x1776a5[_0x621a('0x35')]=_['intersection'](_0x1776a5[_0x621a('0x33')],_0x1776a5[_0x621a('0x36')]);_0x45286a['attributes']=_[_0x621a('0x37')](_0x1776a5[_0x621a('0x33')],qs['fields'](_0x34f3e9['query'][_0x621a('0x38')]));_0x45286a['attributes']=_0x45286a['attributes']['length']?_0x45286a[_0x621a('0x39')]:_0x1776a5[_0x621a('0x33')];_0x45286a[_0x621a('0x55')]=qs[_0x621a('0x3c')](_0x34f3e9[_0x621a('0x36')][_0x621a('0x3c')]);_0x45286a[_0x621a('0x3e')]=qs[_0x621a('0x35')](_[_0x621a('0x56')](_0x34f3e9[_0x621a('0x36')],_0x1776a5['filters']));if(_0x34f3e9[_0x621a('0x36')][_0x621a('0x3d')]){_0x45286a[_0x621a('0x3e')]=_['merge'](_0x45286a['where'],{'$or':_[_0x621a('0x2e')](_0x45286a[_0x621a('0x39')],function(_0x13eb56){var _0x50a494={};_0x50a494[_0x13eb56]={'$like':'%'+_0x34f3e9['query']['filter']+'%'};return _0x50a494;})});}_0x45286a=_[_0x621a('0x3f')]({},_0x45286a,_0x34f3e9[_0x621a('0x41')]);return _0x8b7869['getMembers'](_0x45286a);}})[_0x621a('0x28')](function(_0x3b0237){if(_0x3b0237){_0x482b34=_0x3b0237[_0x621a('0x48')];if(!_0x34f3e9[_0x621a('0x36')][_0x621a('0x3a')](_0x621a('0x3b'))){_0x45286a['limit']=qs['limit'](_0x34f3e9['query'][_0x621a('0x22')]);_0x45286a[_0x621a('0x20')]=qs[_0x621a('0x20')](_0x34f3e9[_0x621a('0x36')][_0x621a('0x20')]);}return _0x8b7869[_0x621a('0x52')](_0x45286a);}})[_0x621a('0x28')](function(_0x53c1cd){if(_0x53c1cd){return _0x53c1cd?{'count':_0x482b34,'rows':_0x53c1cd}:null;}})[_0x621a('0x28')](respondWithResult(_0x37115c,null))[_0x621a('0x45')](handleError(_0x37115c,null));};exports[_0x621a('0x57')]=function(_0x4b0b2c,_0x125f6a,_0x32bea8){return db[_0x621a('0x2f')][_0x621a('0x49')]({'where':{'id':_0x4b0b2c['params']['id']}})[_0x621a('0x28')](handleEntityNotFound(_0x125f6a,null))[_0x621a('0x28')](function(_0x123b72){if(_0x123b72){return _0x123b72[_0x621a('0x57')](_0x4b0b2c['query'][_0x621a('0x51')]);}})[_0x621a('0x28')](respondWithStatusCode(_0x125f6a,null))[_0x621a('0x45')](handleError(_0x125f6a,null));};exports[_0x621a('0x58')]=function(_0xa2fe36,_0x265bc6,_0x22716b){if(_0xa2fe36['body']['id']){delete _0xa2fe36[_0x621a('0x4b')]['id'];}return db[_0x621a('0x2f')][_0x621a('0x49')]({'where':{'id':_0xa2fe36[_0x621a('0x47')]['id']}})[_0x621a('0x28')](handleEntityNotFound(_0x265bc6,null))['then'](function(_0x2aa0c5){if(_0x2aa0c5){_0xa2fe36[_0x621a('0x4b')][_0x621a('0x59')]=_0x2aa0c5['id'];return db[_0x621a('0x4d')][_0x621a('0x4a')](_0xa2fe36['body']);}})[_0x621a('0x28')](respondWithResult(_0x265bc6,null))[_0x621a('0x45')](handleError(_0x265bc6,null));};exports[_0x621a('0x5a')]=function(_0x2e08ff,_0x20b54d,_0x1549b8){var _0x545ce5={};var _0x146b13={};var _0x1f8348;var _0x2336e0;return db['ChatGroup'][_0x621a('0x53')]({'where':{'id':_0x2e08ff['params']['id']}})['then'](handleEntityNotFound(_0x20b54d,null))[_0x621a('0x28')](function(_0xa0a63e){if(_0xa0a63e){_0x1f8348=_0xa0a63e;_0x146b13[_0x621a('0x33')]=_[_0x621a('0x34')](db['ChatInternalMessage']['rawAttributes']);_0x146b13[_0x621a('0x36')]=_['keys'](_0x2e08ff[_0x621a('0x36')]);_0x146b13[_0x621a('0x35')]=_['intersection'](_0x146b13[_0x621a('0x33')],_0x146b13['query']);_0x545ce5['attributes']=_[_0x621a('0x37')](_0x146b13[_0x621a('0x33')],qs[_0x621a('0x38')](_0x2e08ff[_0x621a('0x36')]['fields']));_0x545ce5[_0x621a('0x39')]=_0x545ce5[_0x621a('0x39')][_0x621a('0x48')]?_0x545ce5[_0x621a('0x39')]:_0x146b13[_0x621a('0x33')];_0x545ce5[_0x621a('0x55')]=qs['sort'](_0x2e08ff[_0x621a('0x36')]['sort']);_0x545ce5[_0x621a('0x3e')]=qs[_0x621a('0x35')](_[_0x621a('0x56')](_0x2e08ff['query'],_0x146b13[_0x621a('0x35')]));if(_0x2e08ff[_0x621a('0x36')][_0x621a('0x3d')]){_0x545ce5[_0x621a('0x3e')]=_[_0x621a('0x3f')](_0x545ce5[_0x621a('0x3e')],{'$or':_[_0x621a('0x2e')](_0x545ce5['attributes'],function(_0x589992){var _0x418f61={};_0x418f61[_0x589992]={'$like':'%'+_0x2e08ff['query'][_0x621a('0x3d')]+'%'};return _0x418f61;})});}if(_0x2e08ff[_0x621a('0x36')][_0x621a('0x5b')]){var _0xcb865d=_0x2e08ff[_0x621a('0x36')][_0x621a('0x5b')][_0x621a('0x5c')](',');var _0x3cf87d={};_0x3cf87d[_0xcb865d[0x0]]={'$gte':moment(_0xcb865d[0x1])[_0x621a('0x5d')](_0x621a('0x5e'))};_0x545ce5['where']=_[_0x621a('0x3f')](_0x545ce5[_0x621a('0x3e')],_0x3cf87d);}_0x545ce5=_[_0x621a('0x3f')]({},_0x545ce5,_0x2e08ff['options']);return _0x1f8348[_0x621a('0x5a')](_0x545ce5);}})[_0x621a('0x28')](function(_0x34bf73){if(_0x34bf73){_0x2336e0=_0x34bf73[_0x621a('0x48')];if(!_0x2e08ff[_0x621a('0x36')][_0x621a('0x3a')](_0x621a('0x3b'))){_0x545ce5[_0x621a('0x22')]=qs[_0x621a('0x22')](_0x2e08ff[_0x621a('0x36')][_0x621a('0x22')]);_0x545ce5['offset']=qs[_0x621a('0x20')](_0x2e08ff[_0x621a('0x36')]['offset']);}return _0x1f8348[_0x621a('0x5a')](_0x545ce5);}})[_0x621a('0x28')](function(_0x2fe99d){if(_0x2fe99d){return _0x2fe99d?{'count':_0x2336e0,'rows':_0x2fe99d}:null;}})[_0x621a('0x28')](respondWithResult(_0x20b54d,null))['catch'](handleError(_0x20b54d,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 6b28348..4b944e5 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 _0x0648=['exports','ChatGroup','setMaxListeners','save','remove','emit','hook'];(function(_0x299028,_0x4d7e9f){var _0x12154e=function(_0x558d18){while(--_0x558d18){_0x299028['push'](_0x299028['shift']());}};_0x12154e(++_0x4d7e9f);}(_0x0648,0x1a5));var _0x8064=function(_0x2e66a0,_0x505e42){_0x2e66a0=_0x2e66a0-0x0;var _0x595d22=_0x0648[_0x2e66a0];return _0x595d22;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x8064('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8064('0x1')](0x0);var events={'afterCreate':_0x8064('0x2'),'afterUpdate':'update','afterDestroy':_0x8064('0x3')};function emitEvent(_0x4c8019){return function(_0x104fa8,_0x3f3896,_0x262229){ChatGroupEvents[_0x8064('0x4')](_0x4c8019+':'+_0x104fa8['id'],_0x104fa8);ChatGroupEvents[_0x8064('0x4')](_0x4c8019,_0x104fa8);_0x262229(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x8064('0x5')](e,emitEvent(event));}}module[_0x8064('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0x6a55=['hasOwnProperty','hook','exports','events','save','emit'];(function(_0x518b2f,_0x238346){var _0x2c92a5=function(_0x40ef20){while(--_0x40ef20){_0x518b2f['push'](_0x518b2f['shift']());}};_0x2c92a5(++_0x238346);}(_0x6a55,0xdb));var _0x56a5=function(_0x4d3924,_0x327b56){_0x4d3924=_0x4d3924-0x0;var _0x844555=_0x6a55[_0x4d3924];return _0x844555;};'use strict';var EventEmitter=require(_0x56a5('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x56a5('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x116199){return function(_0x5e5a32,_0x3ff76a,_0x5171fa){ChatGroupEvents[_0x56a5('0x2')](_0x116199+':'+_0x5e5a32['id'],_0x5e5a32);ChatGroupEvents[_0x56a5('0x2')](_0x116199,_0x5e5a32);_0x5171fa(null);};}for(var e in events){if(events[_0x56a5('0x3')](e)){var event=events[e];ChatGroup[_0x56a5('0x4')](e,emitEvent(event));}}module[_0x56a5('0x5')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index e8d24b9..678a6c0 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 _0xf181=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash'];(function(_0x58ffb3,_0x5b67aa){var _0x4d8ddd=function(_0x240ca8){while(--_0x240ca8){_0x58ffb3['push'](_0x58ffb3['shift']());}};_0x4d8ddd(++_0x5b67aa);}(_0xf181,0xa8));var _0x1f18=function(_0x4df5d3,_0x522c48){_0x4df5d3=_0x4df5d3-0x0;var _0x34a8d=_0xf181[_0x4df5d3];return _0x34a8d;};'use strict';var _=require(_0x1f18('0x0'));var util=require(_0x1f18('0x1'));var logger=require(_0x1f18('0x2'))(_0x1f18('0x3'));var moment=require(_0x1f18('0x4'));var BPromise=require(_0x1f18('0x5'));var rp=require(_0x1f18('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f18('0x7'));var config=require(_0x1f18('0x8'));var attributes=require(_0x1f18('0x9'));module[_0x1f18('0xa')]=function(_0xe84977,_0x15744e){return _0xe84977[_0x1f18('0xb')]('ChatGroup',attributes,{'tableName':_0x1f18('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x02c3=['bluebird','../../config/environment','./chatGroup.attributes','ChatGroup','chat_groups','lodash','util','../../config/logger','moment'];(function(_0x19cbac,_0x3541cb){var _0x156ba6=function(_0x3495f3){while(--_0x3495f3){_0x19cbac['push'](_0x19cbac['shift']());}};_0x156ba6(++_0x3541cb);}(_0x02c3,0x12e));var _0x302c=function(_0x2b8607,_0x4ccf37){_0x2b8607=_0x2b8607-0x0;var _0x2ce6f1=_0x02c3[_0x2b8607];return _0x2ce6f1;};'use strict';var _=require(_0x302c('0x0'));var util=require(_0x302c('0x1'));var logger=require(_0x302c('0x2'))('api');var moment=require(_0x302c('0x3'));var BPromise=require(_0x302c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x302c('0x5'));var attributes=require(_0x302c('0x6'));module['exports']=function(_0x49dce9,_0x1ee4f9){return _0x49dce9['define'](_0x302c('0x7'),attributes,{'tableName':_0x302c('0x8'),'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 9cbc2d8..d2d6943 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 _0x550b=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2229a1,_0x339925){var _0x204007=function(_0x17c93b){while(--_0x17c93b){_0x2229a1['push'](_0x2229a1['shift']());}};_0x204007(++_0x339925);}(_0x550b,0x17e));var _0xb550=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0x550b[_0x3c51d4];return _0x53c45f;};'use strict';var _=require(_0xb550('0x0'));var util=require(_0xb550('0x1'));var moment=require(_0xb550('0x2'));var BPromise=require(_0xb550('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb550('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb550('0x5'));var logger=require(_0xb550('0x6'))('rpc');var config=require(_0xb550('0x7'));var jayson=require(_0xb550('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xb550('0x9')]=_[_0xb550('0xa')](config['redis'],{'host':_0xb550('0xb'),'port':0x18eb});var socket=require(_0xb550('0xc'))(new Redis(config[_0xb550('0x9')]));require('./chatGroup.socket')[_0xb550('0xd')](socket);function respondWithRpcPromise(_0x38ee6c,_0x2e3631,_0x262405){return new BPromise(function(_0x91e6db,_0x5d56a8){return client[_0xb550('0xe')](_0x38ee6c,_0x262405)[_0xb550('0xf')](function(_0xb08026){logger[_0xb550('0x10')](_0xb550('0x11'),_0x2e3631,_0xb550('0x12'));logger[_0xb550('0x13')](_0xb550('0x14'),_0x2e3631,'request\x20sent',JSON[_0xb550('0x15')](_0xb08026));if(_0xb08026[_0xb550('0x16')]){if(_0xb08026[_0xb550('0x16')][_0xb550('0x17')]===0x1f4){logger[_0xb550('0x16')](_0xb550('0x11'),_0x2e3631,_0xb08026[_0xb550('0x16')]['message']);return _0x5d56a8(_0xb08026['error'][_0xb550('0x18')]);}logger[_0xb550('0x16')]('ChatGroup,\x20%s,\x20%s',_0x2e3631,_0xb08026[_0xb550('0x16')][_0xb550('0x18')]);return _0x91e6db(_0xb08026[_0xb550('0x16')][_0xb550('0x18')]);}else{logger[_0xb550('0x10')](_0xb550('0x11'),_0x2e3631,_0xb550('0x12'));_0x91e6db(_0xb08026[_0xb550('0x19')]['message']);}})[_0xb550('0x1a')](function(_0x2e22c7){logger['error'](_0xb550('0x11'),_0x2e3631,_0x2e22c7);_0x5d56a8(_0x2e22c7);});});}
\ No newline at end of file
+var _0x97ed=['then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','socket.io-emitter','request'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x97ed,0x1e7));var _0xd97e=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x97ed[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xd97e('0x0'));var util=require(_0xd97e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd97e('0x2'));var fs=require('fs');var Redis=require(_0xd97e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd97e('0x4'));var logger=require(_0xd97e('0x5'))(_0xd97e('0x6'));var config=require(_0xd97e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd97e('0x8')][_0xd97e('0x9')]({'port':0x232a});config['redis']=_[_0xd97e('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd97e('0xb'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x448f66,_0x55f533,_0x370017){return new BPromise(function(_0x1afa13,_0x49c988){return client[_0xd97e('0xc')](_0x448f66,_0x370017)[_0xd97e('0xd')](function(_0x9316d2){logger['info'](_0xd97e('0xe'),_0x55f533,_0xd97e('0xf'));logger[_0xd97e('0x10')](_0xd97e('0x11'),_0x55f533,_0xd97e('0xf'),JSON[_0xd97e('0x12')](_0x9316d2));if(_0x9316d2[_0xd97e('0x13')]){if(_0x9316d2[_0xd97e('0x13')][_0xd97e('0x14')]===0x1f4){logger[_0xd97e('0x13')]('ChatGroup,\x20%s,\x20%s',_0x55f533,_0x9316d2[_0xd97e('0x13')]['message']);return _0x49c988(_0x9316d2[_0xd97e('0x13')][_0xd97e('0x15')]);}logger[_0xd97e('0x13')](_0xd97e('0xe'),_0x55f533,_0x9316d2[_0xd97e('0x13')][_0xd97e('0x15')]);return _0x1afa13(_0x9316d2['error'][_0xd97e('0x15')]);}else{logger[_0xd97e('0x16')](_0xd97e('0xe'),_0x55f533,_0xd97e('0xf'));_0x1afa13(_0x9316d2[_0xd97e('0x17')][_0xd97e('0x15')]);}})[_0xd97e('0x18')](function(_0x28b818){logger[_0xd97e('0x13')](_0xd97e('0xe'),_0x55f533,_0x28b818);_0x49c988(_0x28b818);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 248c06f..f45cc4e 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 _0x07a0=['update','emit','removeListener','register','./chatGroup.events','save','remove'];(function(_0x5acc75,_0x15f7ce){var _0x70e355=function(_0x2dbc21){while(--_0x2dbc21){_0x5acc75['push'](_0x5acc75['shift']());}};_0x70e355(++_0x15f7ce);}(_0x07a0,0x13f));var _0x007a=function(_0x25cf6d,_0x1dce1d){_0x25cf6d=_0x25cf6d-0x0;var _0xbff02a=_0x07a0[_0x25cf6d];return _0xbff02a;};'use strict';var ChatGroupEvents=require(_0x007a('0x0'));var events=[_0x007a('0x1'),_0x007a('0x2'),_0x007a('0x3')];function createListener(_0x517178,_0x514ed4){return function(_0x218b9b){_0x514ed4[_0x007a('0x4')](_0x517178,_0x218b9b);};}function removeListener(_0x399a9d,_0x1a012e){return function(){ChatGroupEvents[_0x007a('0x5')](_0x399a9d,_0x1a012e);};}exports[_0x007a('0x6')]=function(_0x4ea26b){for(var _0x45ea0e=0x0,_0x4af766=events['length'];_0x45ea0e<_0x4af766;_0x45ea0e++){var _0x5ecbdb=events[_0x45ea0e];var _0x15e1f7=createListener('chatGroup:'+_0x5ecbdb,_0x4ea26b);ChatGroupEvents['on'](_0x5ecbdb,_0x15e1f7);}};
\ No newline at end of file
+var _0xe0c1=['emit','removeListener','length','chatGroup:','./chatGroup.events','save','update'];(function(_0x48b163,_0x464055){var _0x5ce3a2=function(_0x533fa7){while(--_0x533fa7){_0x48b163['push'](_0x48b163['shift']());}};_0x5ce3a2(++_0x464055);}(_0xe0c1,0xa5));var _0x1e0c=function(_0x4a3fd0,_0x37ca05){_0x4a3fd0=_0x4a3fd0-0x0;var _0x33b81d=_0xe0c1[_0x4a3fd0];return _0x33b81d;};'use strict';var ChatGroupEvents=require(_0x1e0c('0x0'));var events=[_0x1e0c('0x1'),'remove',_0x1e0c('0x2')];function createListener(_0x37ab49,_0x250395){return function(_0x4540a2){_0x250395[_0x1e0c('0x3')](_0x37ab49,_0x4540a2);};}function removeListener(_0x42fec4,_0x412e43){return function(){ChatGroupEvents[_0x1e0c('0x4')](_0x42fec4,_0x412e43);};}exports['register']=function(_0x2f2751){for(var _0x4978da=0x0,_0x1f2e72=events[_0x1e0c('0x5')];_0x4978da<_0x1f2e72;_0x4978da++){var _0x3a0b75=events[_0x4978da];var _0x442de4=createListener(_0x1e0c('0x6')+_0x3a0b75,_0x2f2751);ChatGroupEvents['on'](_0x3a0b75,_0x442de4);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index cc3ff5f..439fc35 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 _0x5b9a=['getMessages','create','/:id/members','post','addMessage','put','update','delete','destroy','removeMembers','exports','multer','path','connect-timeout','express','Router','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/messages'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5b9a,0x193));var _0xa5b9=function(_0x5429ec,_0x975d62){_0x5429ec=_0x5429ec-0x0;var _0x495635=_0x5b9a[_0x5429ec];return _0x495635;};'use strict';var multer=require(_0xa5b9('0x0'));var util=require('util');var path=require(_0xa5b9('0x1'));var timeout=require(_0xa5b9('0x2'));var express=require(_0xa5b9('0x3'));var router=express[_0xa5b9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa5b9('0x5'));var controller=require(_0xa5b9('0x6'));router[_0xa5b9('0x7')]('/',auth[_0xa5b9('0x8')](),controller[_0xa5b9('0x9')]);router['get'](_0xa5b9('0xa'),auth[_0xa5b9('0x8')](),controller[_0xa5b9('0xb')]);router['get'](_0xa5b9('0xc'),auth['isAuthenticated'](),controller[_0xa5b9('0xd')]);router[_0xa5b9('0x7')](_0xa5b9('0xe'),auth[_0xa5b9('0x8')](),controller[_0xa5b9('0xf')]);router[_0xa5b9('0x7')]('/:id/members',auth[_0xa5b9('0x8')](),controller['getMembers']);router[_0xa5b9('0x7')](_0xa5b9('0x10'),auth[_0xa5b9('0x8')](),controller[_0xa5b9('0x11')]);router['post']('/',auth[_0xa5b9('0x8')](),controller[_0xa5b9('0x12')]);router['post'](_0xa5b9('0x13'),auth[_0xa5b9('0x8')](),controller['addMembers']);router[_0xa5b9('0x14')](_0xa5b9('0x10'),auth[_0xa5b9('0x8')](),controller[_0xa5b9('0x15')]);router[_0xa5b9('0x16')]('/:id',auth[_0xa5b9('0x8')](),controller[_0xa5b9('0x17')]);router[_0xa5b9('0x18')](_0xa5b9('0xc'),auth[_0xa5b9('0x8')](),controller[_0xa5b9('0x19')]);router[_0xa5b9('0x18')](_0xa5b9('0x13'),auth[_0xa5b9('0x8')](),controller[_0xa5b9('0x1a')]);module[_0xa5b9('0x1b')]=router;
\ No newline at end of file
+var _0x5cfd=['/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMessage','delete','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe'];(function(_0x5d622a,_0x158399){var _0x37f8d2=function(_0x1aa657){while(--_0x1aa657){_0x5d622a['push'](_0x5d622a['shift']());}};_0x37f8d2(++_0x158399);}(_0x5cfd,0x12b));var _0xd5cf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5cfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd5cf('0x0'));var util=require(_0xd5cf('0x1'));var path=require(_0xd5cf('0x2'));var timeout=require(_0xd5cf('0x3'));var express=require(_0xd5cf('0x4'));var router=express[_0xd5cf('0x5')]();var fs_extra=require(_0xd5cf('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd5cf('0x7'));var config=require(_0xd5cf('0x8'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xd5cf('0x9')](),controller[_0xd5cf('0xa')]);router[_0xd5cf('0xb')]('/describe',auth[_0xd5cf('0x9')](),controller[_0xd5cf('0xc')]);router[_0xd5cf('0xb')](_0xd5cf('0xd'),auth[_0xd5cf('0x9')](),controller[_0xd5cf('0xe')]);router[_0xd5cf('0xb')](_0xd5cf('0xf'),auth['isAuthenticated'](),controller[_0xd5cf('0x10')]);router[_0xd5cf('0xb')](_0xd5cf('0x11'),auth[_0xd5cf('0x9')](),controller[_0xd5cf('0x12')]);router['get'](_0xd5cf('0x13'),auth['isAuthenticated'](),controller['getMessages']);router[_0xd5cf('0x14')]('/',auth[_0xd5cf('0x9')](),controller[_0xd5cf('0x15')]);router['post'](_0xd5cf('0x11'),auth[_0xd5cf('0x9')](),controller['addMembers']);router[_0xd5cf('0x14')](_0xd5cf('0x13'),auth[_0xd5cf('0x9')](),controller[_0xd5cf('0x16')]);router['put'](_0xd5cf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xd5cf('0x17')](_0xd5cf('0xd'),auth[_0xd5cf('0x9')](),controller['destroy']);router['delete'](_0xd5cf('0x11'),auth[_0xd5cf('0x9')](),controller[_0xd5cf('0x18')]);module[_0xd5cf('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 53d94e1..9e82ce8 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 _0x750a=['TEXT','STRING','DATE','out','BOOLEAN','exports','ENUM','star','thumb'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x750a,0x140));var _0xa750=function(_0x1d3791,_0x51c613){_0x1d3791=_0x1d3791-0x0;var _0x40fbf5=_0x750a[_0x1d3791];return _0x40fbf5;};'use strict';var Sequelize=require('sequelize');module[_0xa750('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xa750('0x1')](_0xa750('0x2'),_0xa750('0x3')),'defaultValue':_0xa750('0x2')},'ratingMessage':{'type':Sequelize[_0xa750('0x4')]},'pathTranscript':{'type':Sequelize[_0xa750('0x4')]},'mailTranscript':{'type':Sequelize[_0xa750('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa750('0x6')]},'disposition':{'type':Sequelize[_0xa750('0x5')]},'secondDisposition':{'type':Sequelize[_0xa750('0x5')]},'thirdDisposition':{'type':Sequelize[_0xa750('0x5')]},'note':{'type':Sequelize[_0xa750('0x5')]},'browserName':{'type':Sequelize[_0xa750('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xa750('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xa750('0x5')]},'deviceType':{'type':Sequelize[_0xa750('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xa750('0x5')]},'formData':{'type':Sequelize[_0xa750('0x4')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xa750('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa750('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa750('0x5')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xa750('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xa750('0x8')],'defaultValue':![]}};
\ No newline at end of file
+var _0xdef9=['out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long'];(function(_0x58aaf8,_0x525867){var _0x35e8dc=function(_0x30c81b){while(--_0x30c81b){_0x58aaf8['push'](_0x58aaf8['shift']());}};_0x35e8dc(++_0x525867);}(_0xdef9,0x1ed));var _0x9def=function(_0x4583d0,_0x24551f){_0x4583d0=_0x4583d0-0x0;var _0x7b3c5a=_0xdef9[_0x4583d0];return _0x7b3c5a;};'use strict';var Sequelize=require(_0x9def('0x0'));module[_0x9def('0x1')]={'closed':{'type':Sequelize[_0x9def('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x9def('0x3')]},'ratingType':{'type':Sequelize[_0x9def('0x4')](_0x9def('0x5'),_0x9def('0x6')),'defaultValue':_0x9def('0x5')},'ratingMessage':{'type':Sequelize[_0x9def('0x7')]},'pathTranscript':{'type':Sequelize[_0x9def('0x7')]},'mailTranscript':{'type':Sequelize[_0x9def('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9def('0x9')]},'disposition':{'type':Sequelize[_0x9def('0x8')]},'secondDisposition':{'type':Sequelize[_0x9def('0x8')]},'thirdDisposition':{'type':Sequelize[_0x9def('0x8')]},'note':{'type':Sequelize[_0x9def('0x8')]},'browserName':{'type':Sequelize[_0x9def('0x8')]},'browserVersion':{'type':Sequelize[_0x9def('0x8')]},'osName':{'type':Sequelize[_0x9def('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x9def('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x9def('0x7')]},'customerIp':{'type':Sequelize[_0x9def('0x8')]},'formData':{'type':Sequelize[_0x9def('0x7')](_0x9def('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x9def('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x9def('0x4')]('in',_0x9def('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x9def('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x9def('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x9def('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 8f030ba..84972e9 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 _0x7880=['parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','agent','sequelize','toString','keyBy','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','include','options','create','destroy','describe','createVidaooSession','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','update','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','findOne','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','transcript-%s.txt','now','Messages','%s%d','agentAlias','customer','format','website_alias','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailServerOut','Smtp','service','host','port','secure','pass','SendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','pick','YYYY-MM-DD\x20HH:mm:ss','includeAll','getMyMessages','secret','includeAgent','findAll','addTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Owner','get','mkdirSync','Account','closedAt','browserName','customerPort','N.A.','tail','createReadStream','createWriteStream','direction','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','client','then','info','request\x20sent','debug','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','name','send','merge','contact','interaction','account','fullname','Tags','TagIds','split','forEach','push','index','map','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','select','field','color','from','tools_tags','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','isEmpty','concat','createdAt'];(function(_0x54280d,_0x565316){var _0x56f50b=function(_0x4ceb52){while(--_0x4ceb52){_0x54280d['push'](_0x54280d['shift']());}};_0x56f50b(++_0x565316);}(_0x7880,0x1f4));var _0x0788=function(_0x15d9bc,_0x513b46){_0x15d9bc=_0x15d9bc-0x0;var _0x5868fe=_0x7880[_0x15d9bc];return _0x5868fe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var pdf=require(_0x0788('0x14'));var hardwareService=require(_0x0788('0x15'));var logger=require('../../config/logger')(_0x0788('0x16'));var utils=require(_0x0788('0x17'));var config=require(_0x0788('0x18'));var licenseUtil=require(_0x0788('0x19'));var db=require(_0x0788('0x1a'))['db'];config[_0x0788('0x1b')]=_[_0x0788('0x1c')](config['redis'],{'host':_0x0788('0x1d'),'port':0x18eb});var socket=require(_0x0788('0x1e'))(new Redis(config[_0x0788('0x1b')]));require(_0x0788('0x1f'))['register'](socket);var jayson=require(_0x0788('0x20'));var client=jayson['client'][_0x0788('0x21')]({'port':0x232b});var client9004=jayson[_0x0788('0x22')][_0x0788('0x21')]({'port':0x232c});function respondWithRpcPromise(_0xb406fb,_0x2ddd1a,_0x430e34,_0x5e1a29){return new BPromise(function(_0x573822,_0x17d805){var _0x461d9d=_0x5e1a29||client;return _0x461d9d['request'](_0xb406fb,_0x430e34)[_0x0788('0x23')](function(_0x415f19){logger[_0x0788('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x2ddd1a,_0x0788('0x25'));logger[_0x0788('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2ddd1a,_0x0788('0x25'),JSON['stringify'](_0x415f19));if(_0x415f19[_0x0788('0x27')]){if(_0x415f19['error'][_0x0788('0x28')]===0x1f4){logger[_0x0788('0x27')](_0x0788('0x29'),_0x2ddd1a,_0x415f19[_0x0788('0x27')][_0x0788('0x2a')]);return _0x17d805(_0x415f19['error']['message']);}logger[_0x0788('0x27')](_0x0788('0x29'),_0x2ddd1a,_0x415f19[_0x0788('0x27')][_0x0788('0x2a')]);return _0x573822(_0x415f19['error']['message']);}else{logger[_0x0788('0x24')](_0x0788('0x29'),_0x2ddd1a,_0x0788('0x25'));_0x573822(_0x415f19['result']['message']);}})[_0x0788('0x2b')](function(_0xa1f7dc){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2ddd1a,_0xa1f7dc);_0x17d805(_0xa1f7dc);});});}function respondWithStatusCode(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0xcc;return function(_0x57fda1){if(_0x57fda1){return _0x5a54a5[_0x0788('0x2c')](_0x44798c);}return _0x5a54a5[_0x0788('0x2d')](_0x44798c)[_0x0788('0x2e')]();};}function respondWithResult(_0x18fc0e,_0xf9ba32){_0xf9ba32=_0xf9ba32||0xc8;return function(_0xb2f4a5){if(_0xb2f4a5){return _0x18fc0e[_0x0788('0x2d')](_0xf9ba32)[_0x0788('0x2f')](_0xb2f4a5);}};}function respondWithFilteredResult(_0x5b7594,_0x5a5178){return function(_0x3c5246){if(_0x3c5246){var _0x40d345=typeof _0x5a5178['offset']==='undefined'&&typeof _0x5a5178[_0x0788('0x30')]===_0x0788('0x31');var _0x20fcd8=_0x3c5246[_0x0788('0x32')];var _0x44cbfb=_0x40d345?0x0:_0x5a5178[_0x0788('0x33')];var _0x327d67=_0x40d345?_0x3c5246[_0x0788('0x32')]:_0x5a5178[_0x0788('0x33')]+_0x5a5178[_0x0788('0x30')];var _0x5ec0ed;if(_0x327d67>=_0x20fcd8){_0x327d67=_0x20fcd8;_0x5ec0ed=0xc8;}else{_0x5ec0ed=0xce;}_0x5b7594[_0x0788('0x2d')](_0x5ec0ed);return _0x5b7594[_0x0788('0x34')](_0x0788('0x35'),_0x44cbfb+'-'+_0x327d67+'/'+_0x20fcd8)[_0x0788('0x2f')](_0x3c5246);}return null;};}function patchUpdates(_0xce4534){return function(_0x458193){try{jsonpatch[_0x0788('0x36')](_0x458193,_0xce4534,!![]);}catch(_0x15d67a){return BPromise[_0x0788('0x37')](_0x15d67a);}return _0x458193[_0x0788('0x38')]();};}function saveUpdates(_0x4fa055,_0x4ae132){return function(_0x5947d3){if(_0x5947d3){return _0x5947d3['update'](_0x4fa055)['then'](function(_0x586a06){return _0x586a06;});}return null;};}function removeEntity(_0x208a89,_0x38a4ae){return function(_0x2130e3){if(_0x2130e3){return _0x2130e3['destroy']()[_0x0788('0x23')](function(){_0x208a89[_0x0788('0x2d')](0xcc)[_0x0788('0x2e')]();});}};}function handleEntityNotFound(_0xaea11d,_0x57c4d8){return function(_0x2ed940){if(!_0x2ed940){_0xaea11d['sendStatus'](0x194);}return _0x2ed940;};}function handleError(_0x322465,_0x4fcde3){_0x4fcde3=_0x4fcde3||0x1f4;return function(_0x9d1edb){logger[_0x0788('0x27')](_0x9d1edb['stack']);if(_0x9d1edb[_0x0788('0x39')]){delete _0x9d1edb[_0x0788('0x39')];}_0x322465['status'](_0x4fcde3)[_0x0788('0x3a')](_0x9d1edb);};}function getMustacheRender(_0x5eb693,_0x295024){return Mustache['render'](_0x5eb693,_[_0x0788('0x3b')](_0x295024['body'],{'contact':_0x295024[_0x0788('0x3c')],'message':_0x295024['message'],'agent':_0x295024['agent'],'interaction':_0x295024[_0x0788('0x3d')],'account':_0x295024[_0x0788('0x3e')]}))||'';}function getInteractionUsers(_0x2e48cf,_0x2d17b0){return new BPromise(function(_0x8cfffc,_0x53da74){try{if(_0x2d17b0[_0x2e48cf['id']]){_0x2e48cf['Users']=_['map'](_0x2d17b0[_0x2e48cf['id']],function(_0x4d539a){return{'id':_0x4d539a['id'],'fullname':_0x4d539a[_0x0788('0x3f')]};});}}catch(_0x1202c4){_0x53da74(_0x1202c4);}_0x8cfffc(_0x2e48cf);});}function getInteractionTags(_0x45b247,_0x358a22){return new BPromise(function(_0x362c49,_0x5993ad){try{if(_0x45b247['TagIds']){_0x45b247[_0x0788('0x40')]=[];_0x45b247[_0x0788('0x41')][_0x0788('0x42')](',')[_0x0788('0x43')](function(_0x236b63){_0x45b247[_0x0788('0x40')][_0x0788('0x44')](_0x358a22[_0x236b63]);});}delete _0x45b247[_0x0788('0x41')];}catch(_0x347984){_0x5993ad(_0x347984);}_0x362c49(_0x45b247);});}function updateChatInteraction(_0x50e8f5,_0x5581e6,_0x441aec){return new BPromise(function(_0x1d579d,_0x9e8ee){return getInteractionUsers(_0x50e8f5,_0x441aec)['then'](function(_0x5ab353){return getInteractionTags(_0x5ab353,_0x5581e6);})['then'](function(_0x172424){_0x1d579d(_0x172424);})[_0x0788('0x2b')](function(_0x25501b){_0x9e8ee(_0x25501b);});});}exports[_0x0788('0x45')]=function(_0x2737d8,_0x1928f3){var _0x1ab634={},_0x15b90c={},_0x4bd0d9={'count':0x0,'rows':[]};var _0x15c618=_[_0x0788('0x46')](db[_0x0788('0x47')][_0x0788('0x48')],function(_0x58eb04){return{'name':_0x58eb04[_0x0788('0x49')],'type':_0x58eb04[_0x0788('0x4a')]['key']};});_0x15b90c['model']=_['map'](_0x15c618,_0x0788('0x39'));_0x15b90c['query']=_[_0x0788('0x4b')](_0x2737d8[_0x0788('0x4c')]);_0x15b90c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x15b90c[_0x0788('0x4f')],_0x15b90c[_0x0788('0x4c')]);_0x1ab634[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x15b90c['model'],qs['fields'](_0x2737d8[_0x0788('0x4c')][_0x0788('0x51')]));_0x1ab634[_0x0788('0x50')]=_0x1ab634['attributes'][_0x0788('0x52')]?_0x1ab634[_0x0788('0x50')]:_0x15b90c[_0x0788('0x4f')];if(!_0x2737d8[_0x0788('0x4c')][_0x0788('0x53')]('nolimit')){_0x1ab634['limit']=qs[_0x0788('0x30')](_0x2737d8[_0x0788('0x4c')]['limit']);_0x1ab634[_0x0788('0x33')]=qs['offset'](_0x2737d8[_0x0788('0x4c')][_0x0788('0x33')]);}_0x1ab634[_0x0788('0x54')]=qs[_0x0788('0x55')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x55')]);_0x1ab634[_0x0788('0x56')]=qs[_0x0788('0x4d')](_['pick'](_0x2737d8[_0x0788('0x4c')],_0x15b90c[_0x0788('0x4d')]),_0x15c618);var _0x3f2f1b=[];var _0x5ef557=squel[_0x0788('0x57')]()[_0x0788('0x58')]('id')['field'](_0x0788('0x39'))[_0x0788('0x58')](_0x0788('0x59'))[_0x0788('0x5a')](_0x0788('0x5b'));var _0x347cc8=squel['select']()['field'](_0x0788('0x5c'))[_0x0788('0x58')]('u.fullname')[_0x0788('0x58')](_0x0788('0x5d'))[_0x0788('0x5a')](_0x0788('0x5e'),'ui')[_0x0788('0x5f')](_0x0788('0x60'),'u',_0x0788('0x61'));var _0xeedd30=squel[_0x0788('0x57')]()[_0x0788('0x5a')](_0x0788('0x62'),'i')[_0x0788('0x5f')]('cm_contacts','c',_0x0788('0x63'))[_0x0788('0x5f')](_0x0788('0x60'),'o','o.id\x20=\x20i.UserId')[_0x0788('0x5f')](_0x0788('0x64'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0x0788('0x65'),'me',_0x0788('0x66'))[_0x0788('0x5f')](_0x0788('0x67'),'it',_0x0788('0x68'))[_0x0788('0x5f')]('tools_tags','t',_0x0788('0x69'));var _0x3be076=squel[_0x0788('0x6a')]();var _0x47be71=[];var _0x533f71=squel[_0x0788('0x6a')]();var _0x5419d9;if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x6b')]){_0x5419d9=as[_0x0788('0x6c')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x6b')]);var _0x348d25=_0x5419d9[_0x0788('0x6d')];for(var _0x29c912=0x0;_0x29c912<_0x5419d9[_0x0788('0x6e')][_0x0788('0x52')];_0x29c912++){var _0x59fcbc=_0x5419d9[_0x0788('0x6e')][_0x29c912];var _0x446170='i';var _0x602e3b=_[_0x0788('0x6f')](_0x15c618,['name',_0x59fcbc[_0x0788('0x58')]]);if(!_0x602e3b){switch(_0x59fcbc[_0x0788('0x58')]){case _0x0788('0x70'):if(_0x59fcbc[_0x0788('0x71')]==0x1){_0xeedd30[_0x0788('0x72')]('`'+_0x59fcbc['field']+_0x0788('0x73'));}else{_0xeedd30['having']('`'+_0x59fcbc[_0x0788('0x58')]+_0x0788('0x74'));}break;case _0x0788('0x75'):if(_0x59fcbc[_0x0788('0x76')]===_0x0788('0x77')){if(_0x59fcbc[_0x0788('0x71')][_0x0788('0x42')]('\x20')[_0x0788('0x52')]>0x1){_0x3be076[_0x348d25](_0x0788('0x78'),qs['getFullTextValue'](_0x59fcbc[_0x0788('0x71')]),null);}else{var _0x2dea6c='%'+_0x59fcbc[_0x0788('0x71')]+'%';_0x3be076[_0x348d25]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2dea6c,_0x2dea6c,_0x2dea6c);}}else{_0x602e3b=_['find'](_0x15c618,[_0x0788('0x39'),_0x0788('0x79')]);_0x59fcbc[_0x0788('0x58')]='ContactId';_0x35c612=as[_0x0788('0x7a')](_0x446170,_0x602e3b[_0x0788('0x4a')],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')]['start'],_0x35c612['value']['end']);}break;case _0x0788('0x7c'):var _0x2a55f2=_0x59fcbc[_0x0788('0x71')]['split'](',')['map'](function(_0xaa2d4d){return Number(_0xaa2d4d);});_0x2a55f2['forEach'](function(_0x955bfa){_0x533f71['or'](_0x0788('0x7d'),'%,'+_0x955bfa+',%');});_0x47be71=_[_0x0788('0x7e')](_0x47be71,_0x2a55f2);break;case _0x0788('0x7f'):if(_0x59fcbc[_0x0788('0x76')]===_0x0788('0x77')){_0x3be076[_0x348d25](_0x0788('0x80'),'%'+_0x59fcbc[_0x0788('0x71')]+'%',null);}else{_0x602e3b=_[_0x0788('0x6f')](_0x15c618,[_0x0788('0x39'),'UserId']);_0x59fcbc[_0x0788('0x58')]=_0x0788('0x81');_0x35c612=as['buildExpression'](_0x446170,_0x602e3b['type'],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')][_0x0788('0x82')],_0x35c612[_0x0788('0x71')][_0x0788('0x2e')]);}break;case _0x0788('0x83'):_0x35c612=as['buildExpression']('me',null,_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')][_0x0788('0x82')],_0x35c612[_0x0788('0x71')]['end']);break;}}else{var _0x35c612=as[_0x0788('0x7a')](_0x446170,_0x602e3b[_0x0788('0x4a')],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612['value']['start'],_0x35c612[_0x0788('0x71')][_0x0788('0x2e')]);}}}else{var _0x5513f7=_(_0x2737d8[_0x0788('0x4c')])[_0x0788('0x4b')]()[_0x0788('0x46')](function(_0x2b10fe){return _[_0x0788('0x84')](_0x15c618,[_0x0788('0x39'),_0x2b10fe])?_0x2b10fe:undefined;})['compact']()[_0x0788('0x71')]();if(!_[_0x0788('0x85')](_0x5513f7)){_0x5513f7[_0x0788('0x43')](function(_0x515dd8){if(_0x515dd8==='ChatWebsiteId'){_0xeedd30[_0x0788('0x56')]('i.ChatWebsiteId\x20IN\x20?',[][_0x0788('0x86')](_0x2737d8[_0x0788('0x4c')][_0x515dd8]));}else if(_0x515dd8===_0x0788('0x87')){var _0xa4b3f8=JSON[_0x0788('0x88')](_0x2737d8[_0x0788('0x4c')][_0x515dd8])[_0x0788('0x89')];var _0x216ea9=JSON[_0x0788('0x88')](_0x2737d8['query'][_0x515dd8])[_0x0788('0x8a')];_0xeedd30[_0x0788('0x56')](_0x0788('0x8b'),_0xa4b3f8,_0x216ea9);}else{if(_0x2737d8['query'][_0x515dd8]===_0x0788('0x8c')){_0xeedd30[_0x0788('0x56')]('i.'+_0x515dd8+_0x0788('0x8d'));}else{_0xeedd30['where']('i.'+_0x515dd8+_0x0788('0x8e'),_0x2737d8[_0x0788('0x4c')][_0x515dd8]);}}});}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x8f')]){if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x8f')]==0x1){_0xeedd30[_0x0788('0x72')](_0x0788('0x90'));}else{_0xeedd30[_0x0788('0x72')]('`unreadMessages`\x20>\x200');}}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')]){_0x47be71=_[_0x0788('0x92')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')])?_0x2737d8['query'][_0x0788('0x91')]:new Array(_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')]);_0x47be71['forEach'](function(_0x1788d1){_0x533f71['or'](_0x0788('0x7d'),'%,'+_0x1788d1+',%');});}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x93')]){var _0x2b74df=_0x2737d8['query'][_0x0788('0x93')][_0x0788('0x94')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x0788('0x95')](_0x2b74df)){_0x3be076['or'](_0x0788('0x96'),_0x2b74df+'%');}else{_0x3be076['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0788('0x97')](_0x2b74df))['or'](_0x0788('0x98'),_0x2b74df+'%');}}}_0xeedd30[_0x0788('0x56')](_0x3be076);_0xeedd30['group'](_0x0788('0x99'));var _0x42c537={'type':db[_0x0788('0x9a')]['QueryTypes'][_0x0788('0x9b')],'raw':!![]};var _0x1b3046=_0xeedd30[_0x0788('0x9c')]();_0x1b3046[_0x0788('0x58')](_0x0788('0x99'));_0x1b3046[_0x0788('0x58')](_0x0788('0x9d'),_0x0788('0x70'));if(_0x1ab634['order']){_0x1ab634[_0x0788('0x54')][_0x0788('0x43')](function(_0x121f1d){var _0x31c921=_0x121f1d[0x0]==='contactName'?_0x121f1d[0x0]:'i.'+_0x121f1d[0x0];_0xeedd30['order'](_0x31c921,_0x121f1d[0x1]===_0x0788('0x9e')?![]:!![]);});}if(!_[_0x0788('0x85')](_0x47be71)){_0xeedd30['having'](_0x533f71);_0x1b3046[_0x0788('0x56')](_0x0788('0x9f'),_0x47be71);}BPromise[_0x0788('0xa0')]()['then'](function(){if(!_0x5419d9){if(_0x2737d8['query'][_0x0788('0xa1')])return;_0x1b3046[_0x0788('0x56')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0xeedd30['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2737d8[_0x0788('0xa2')][_0x0788('0xa3')]!=='agent')return;return _0x2737d8[_0x0788('0xa2')][_0x0788('0xa4')]({'attributes':['id'],'raw':!![]})[_0x0788('0x23')](function(_0x41fe7a){if(_[_0x0788('0x85')](_0x41fe7a)){_0x1b3046['where'](_0x0788('0xa5'));_0xeedd30['where'](_0x0788('0xa5'));}else{_0x1b3046['where'](_0x0788('0xa6'),_[_0x0788('0x46')](_0x41fe7a,'id'));_0xeedd30[_0x0788('0x56')](_0x0788('0xa6'),_[_0x0788('0x46')](_0x41fe7a,'id'));}});})[_0x0788('0x23')](function(){if(_0x2737d8[_0x0788('0xa2')][_0x0788('0xa3')]===_0x0788('0xa7')&&!_0x5419d9&&!_0x2737d8[_0x0788('0x4c')][_0x0788('0xa1')])return[];return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x1b3046['toString'](),_0x42c537);})['then'](function(_0x50363e){_0x4bd0d9[_0x0788('0x32')]=_0x50363e[_0x0788('0x52')];if(_0x4bd0d9[_0x0788('0x32')]===0x0)return[];return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x5ef557[_0x0788('0xa9')](),_0x42c537)[_0x0788('0x23')](function(_0x16838d){_0x3f2f1b=_[_0x0788('0xaa')](_0x16838d,'id');_0x42c537=_[_0x0788('0x3b')](_0x42c537,{'model':db[_0x0788('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2737d8['query']['fields']){_0x1ab634[_0x0788('0x50')][_0x0788('0x43')](function(_0x104a70){_0xeedd30[_0x0788('0x58')]('i.'+_0x104a70);});}else{_0xeedd30[_0x0788('0x58')](_0x0788('0x9d'),_0x0788('0x70'));_0xeedd30[_0x0788('0x58')]('a.key','Account.key');_0xeedd30[_0x0788('0x58')](_0x0788('0xab'),_0x0788('0xac'));_0xeedd30[_0x0788('0x58')](_0x0788('0xad'),_0x0788('0xae'));_0xeedd30['field'](_0x0788('0xaf'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb0'),_0x0788('0xb1'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb2'),_0x0788('0xb3'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb4'),'Contact.email');_0xeedd30[_0x0788('0x58')](_0x0788('0xb5'),_0x0788('0xb6'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb7'),_0x0788('0xb8'));_0xeedd30['field'](_0x0788('0xb9'),_0x0788('0xba'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbb'),_0x0788('0xbc'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbd'),_0x0788('0xbe'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbf'),'TagIds');}if(_0x1ab634[_0x0788('0x30')])_0xeedd30['limit'](_0x1ab634[_0x0788('0x30')]);if(_0x1ab634['offset'])_0xeedd30[_0x0788('0x33')](_0x1ab634['offset']);return db[_0x0788('0xa8')][_0x0788('0x4c')](_0xeedd30[_0x0788('0xa9')](),_0x42c537);})[_0x0788('0x23')](function(_0x5242eb){if(_0x5242eb[_0x0788('0x52')]>0x0)_0x347cc8[_0x0788('0x56')](_0x0788('0xc0'),_['map'](_0x5242eb,'id'));return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x347cc8['toString'](),_0x42c537)[_0x0788('0x23')](function(_0x4645aa){var _0x37e9a9=_[_0x0788('0xc1')](_0x4645aa,_0x0788('0xc2'));var _0xab471b=[];_0x5242eb[_0x0788('0x43')](function(_0x563533){_0xab471b[_0x0788('0x44')](updateChatInteraction(_0x563533,_0x3f2f1b,_0x37e9a9));});return BPromise[_0x0788('0xc3')](_0xab471b);});});})[_0x0788('0x23')](function(_0x3f3e06){_0x4bd0d9[_0x0788('0xc4')]=_0x3f3e06;return _0x4bd0d9;})[_0x0788('0x23')](respondWithFilteredResult(_0x1928f3,_0x1ab634))[_0x0788('0x2b')](handleError(_0x1928f3,null));};exports[_0x0788('0xc5')]=function(_0x5761b1,_0x5130c4){var _0x26233b={'raw':![],'where':{'id':_0x5761b1[_0x0788('0xc6')]['id']}},_0x42f6df={};_0x42f6df[_0x0788('0x4f')]=_[_0x0788('0x4b')](db[_0x0788('0x47')][_0x0788('0x48')]);_0x42f6df['query']=_[_0x0788('0x4b')](_0x5761b1['query']);_0x42f6df['filters']=_[_0x0788('0x4e')](_0x42f6df[_0x0788('0x4f')],_0x42f6df['query']);_0x26233b[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x42f6df[_0x0788('0x4f')],qs[_0x0788('0x51')](_0x5761b1[_0x0788('0x4c')][_0x0788('0x51')]));_0x26233b['attributes']=_0x26233b[_0x0788('0x50')][_0x0788('0x52')]?_0x26233b['attributes']:_0x42f6df[_0x0788('0x4f')];if(_0x5761b1[_0x0788('0x4c')]['includeAll']){_0x26233b[_0x0788('0xc7')]=[{'all':!![]}];}_0x26233b=_[_0x0788('0x3b')]({},_0x26233b,_0x5761b1[_0x0788('0xc8')]);return db[_0x0788('0x47')][_0x0788('0x6f')](_0x26233b)[_0x0788('0x23')](handleEntityNotFound(_0x5130c4,null))[_0x0788('0x23')](respondWithResult(_0x5130c4,null))['catch'](handleError(_0x5130c4,null));};exports[_0x0788('0xc9')]=function(_0x2e0529,_0x1f9944){return db[_0x0788('0x47')]['create'](_0x2e0529[_0x0788('0x83')],{})[_0x0788('0x23')](respondWithResult(_0x1f9944,0xc9))['catch'](handleError(_0x1f9944,null));};exports['update']=function(_0x691225,_0x15a70b){if(_0x691225[_0x0788('0x83')]['id']){delete _0x691225[_0x0788('0x83')]['id'];}return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x691225['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x15a70b,null))[_0x0788('0x23')](saveUpdates(_0x691225[_0x0788('0x83')],null))[_0x0788('0x23')](respondWithResult(_0x15a70b,null))[_0x0788('0x2b')](handleError(_0x15a70b,null));};exports[_0x0788('0xca')]=function(_0xc5e64a,_0x3539d4){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0xc5e64a[_0x0788('0xc6')]['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x3539d4,null))[_0x0788('0x23')](removeEntity(_0x3539d4,null))[_0x0788('0x2b')](handleError(_0x3539d4,null));};exports[_0x0788('0xcb')]=function(_0x150a05,_0x1e0fb7){return db['ChatInteraction'][_0x0788('0xcb')]()[_0x0788('0x23')](respondWithResult(_0x1e0fb7,null))[_0x0788('0x2b')](handleError(_0x1e0fb7,null));};exports[_0x0788('0xcc')]=function(_0x57b44e,_0x191e15){var _0x5d0919=_0x57b44e[_0x0788('0xc6')]['id'];var _0x563e4c;var _0x51da2c;var _0x34a12a;return db[_0x0788('0x47')]['findOne']({'where':{'id':_0x5d0919}})[_0x0788('0x23')](function(_0x522e02){_0x563e4c=_0x522e02;return db[_0x0788('0xcd')]['findOne']({'where':{'id':_0x522e02[_0x0788('0xa1')]},'attributes':['id',_0x0788('0xce'),_0x0788('0xcf'),_0x0788('0xd0'),_0x0788('0xd1'),_0x0788('0xd2')],'raw':!![]});})['then'](function(_0x473491){if(_0x473491&&_0x473491['vidaooApiKey']&&_0x473491[_0x0788('0xcf')]){_0x51da2c=_0x473491;var _0x1222f8={'interaction':{'id':_0x5d0919},'agent':{'id':_0x57b44e['user']['id'],'name':_0x57b44e['user']['name'],'fullname':_0x57b44e[_0x0788('0xa2')]['fullname'],'email':_0x57b44e['user']['email']},'contact':_0x57b44e['body']['contact'],'account':_0x57b44e['body'][_0x0788('0x3e')]};var _0x3c2aa3={'rejectUnauthorized':![],'method':'POST','url':_0x0788('0xd3'),'headers':{'X-APIKEY':_0x473491['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x57b44e[_0x0788('0xa2')]['email']],'buttons':null,'topic':_0x51da2c[_0x0788('0xd0')],'note':_[_0x0788('0xd4')](_0x51da2c[_0x0788('0xd1')])?null:getMustacheRender(_0x51da2c[_0x0788('0xd1')],_0x1222f8),'metadata':null},'redirect':_0x0788('0xd5'),'json':!![]};try{if(!_[_0x0788('0xd4')](_0x51da2c[_0x0788('0xd2')])){var _0x37439f=getMustacheRender(_0x51da2c[_0x0788('0xd2')],_0x1222f8);var _0xf87649=JSON['parse'](_0x37439f);_0x3c2aa3[_0x0788('0x83')]['metadata']=_0xf87649;}}catch(_0x3bd7f3){throw new db['Sequelize']['ValidationError'](_0x0788('0xd6'));}return rp(_0x3c2aa3);}else{throw new db[(_0x0788('0x9a'))][(_0x0788('0xd7'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x0788('0x23')](function(_0x1b52f6){_0x34a12a=_0x1b52f6;if(_0x34a12a['id']){var _0x5be647={'body':_0x34a12a['join_url'],'ChatWebsiteId':_0x51da2c['id'],'ChatInteractionId':_0x563e4c['id'],'direction':_0x0788('0xd8'),'UserId':_0x57b44e[_0x0788('0xa2')]['id']};return db[_0x0788('0xd9')]['create'](_0x5be647,{});}else{throw new db['Sequelize'][(_0x0788('0xd7'))](_0x0788('0xda'));}})[_0x0788('0x23')](function(){return _0x563e4c[_0x0788('0xdb')]({'vidaooSessionId':_0x34a12a['id']});})[_0x0788('0x23')](respondWithResult(_0x191e15,null))[_0x0788('0x2b')](handleError(_0x191e15,null));};exports[_0x0788('0xdc')]=function(_0x252780,_0x3d3272){if(_0x252780['body']['id']){delete _0x252780[_0x0788('0x83')]['id'];}return db['ChatInteraction'][_0x0788('0x6f')]({'where':{'id':_0x252780[_0x0788('0xc6')]['id']},'include':[{'model':db[_0x0788('0xdd')],'as':_0x0788('0x75')}]})[_0x0788('0x23')](handleEntityNotFound(_0x3d3272,null))['then'](saveUpdates(_0x252780[_0x0788('0x83')],null))[_0x0788('0x23')](respondWithResult(_0x3d3272,null))['catch'](handleError(_0x3d3272,null));};exports[_0x0788('0xde')]=function(_0x881d27,_0x47ce3c,_0x1c9b6f){if(_0x881d27['body']['id']){delete _0x881d27[_0x0788('0x83')]['id'];}return db[_0x0788('0x47')]['find']({'where':{'id':_0x881d27[_0x0788('0xc6')]['id']}})[_0x0788('0x23')](function(_0x207b55){if(!_0x207b55){logger[_0x0788('0x27')](_0x0788('0xdf'),_0x0788('0xde'),0x194,_0x0788('0xe0'));_0x47ce3c[_0x0788('0x2c')](0x194);}else{if(_0x207b55['UserId']){throw new db[(_0x0788('0x9a'))][(_0x0788('0xd7'))](_0x0788('0xe1'));}}return _0x207b55;})['then'](function(_0x5ac0bc){if(_0x5ac0bc){return _0x5ac0bc[_0x0788('0xe2')]({'closed':_0x881d27[_0x0788('0x83')][_0x0788('0xe3')],'disposition':_0x881d27[_0x0788('0x83')][_0x0788('0xe4')]})[_0x0788('0x23')](function(_0x48e56d){return _0x48e56d;});}})[_0x0788('0x23')](function(_0x227eaf){return respondWithRpcPromise(_0x0788('0xe5'),_0x0788('0xde'),_0x881d27[_0x0788('0x83')],client9004);})[_0x0788('0x23')](respondWithResult(_0x47ce3c,null))[_0x0788('0x2b')](handleError(_0x47ce3c,null));};exports[_0x0788('0xe6')]=function(_0x1fc335,_0x27c428,_0x1ce4f2){_0x1fc335[_0x0788('0x83')][_0x0788('0x39')]=_0x1fc335[_0x0788('0xe7')][_0x0788('0xe8')];_0x1fc335[_0x0788('0x83')][_0x0788('0xe9')]=_0x1fc335[_0x0788('0xe7')][_0x0788('0xea')];_0x1fc335[_0x0788('0x83')][_0x0788('0x4a')]=_0x1fc335['file'][_0x0788('0xeb')];return db[_0x0788('0xec')][_0x0788('0xc9')](_0x1fc335[_0x0788('0x83')])['then'](respondWithResult(_0x27c428,0xc9))[_0x0788('0x2b')](handleError(_0x27c428,null));};exports[_0x0788('0xed')]=function(_0x5eb3f1,_0xb63553,_0x4a34e2){return db['ChatInteraction']['findOne']({'where':{'id':_0x5eb3f1['params']['id']},'raw':!![]})[_0x0788('0x23')](handleEntityNotFound(_0xb63553,null))[_0x0788('0x23')](function(_0x4cc536){if(_0x4cc536){if(_0x4cc536[_0x0788('0xe3')]){return _0xb63553[_0x0788('0x2d')](0x193)[_0x0788('0x2f')]({'status':0x193,'message':_0x0788('0xee')});}return db[_0x0788('0xec')][_0x0788('0xef')]({'where':{'id':_0x5eb3f1[_0x0788('0x4c')][_0x0788('0xf0')]},'raw':!![]})[_0x0788('0x23')](handleEntityNotFound(_0xb63553,null));}})['then'](function(_0x2047bc){if(_0x2047bc){var _0x38fd71=_0x2047bc['ChatOfflineMessageId']!==null;var _0x224ef9=path[_0x0788('0xf1')](config[_0x0788('0xf2')],_0x0788('0xf3'));if(_0x38fd71){_0x224ef9=path[_0x0788('0xf1')](_0x224ef9,_0x0788('0xf4'));}var _0x2399b9=path[_0x0788('0xf1')](_0x224ef9,_0x2047bc[_0x0788('0xe9')]);return _0xb63553[_0x0788('0xf5')](_0x2399b9);}})[_0x0788('0x2b')](handleError(_0xb63553,null));};exports[_0x0788('0xf6')]=function(_0x31c746,_0x4f696c){var _0x11de9c=null;var _0xf690e0=null;var _0x4a492c=null;var _0x523faa=null;if(_0x31c746[_0x0788('0x83')]['id']){delete _0x31c746[_0x0788('0x83')]['id'];}if(_0x31c746['body'][_0x0788('0xf7')]){_0x523faa=path[_0x0788('0xf1')](config[_0x0788('0xf2')],'server/files/chat/upload/',util['format'](_0x0788('0xf8'),Date[_0x0788('0xf9')]()));_0x31c746['body']['pathTranscript']=_0x523faa;}return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x31c746['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x0788('0xfa'),'include':[{'model':db[_0x0788('0x7f')],'as':'User'}]}]})[_0x0788('0x23')](handleEntityNotFound(_0x4f696c,null))[_0x0788('0x23')](saveUpdates(_0x31c746['body'],null))[_0x0788('0x23')](function(_0x21be45){if(_0x21be45){_0x11de9c=_0x21be45;return db[_0x0788('0xcd')][_0x0788('0x6f')]({'where':{'id':_0x11de9c[_0x0788('0xa1')]}});}})['then'](function(_0x36acad){if(_0x36acad){_0x4a492c=_0x36acad;return db[_0x0788('0xdd')][_0x0788('0x6f')]({'where':{'id':_0x11de9c[_0x0788('0x79')]}});}})[_0x0788('0x23')](function(_0x569b4d){if(_0x569b4d){_0xf690e0=_0x569b4d;if(_0x523faa){var _0x31ffc7=null;for(var _0x59aece=0x1;_0x59aece<_0x11de9c['Messages'][_0x0788('0x52')];++_0x59aece){_0x31ffc7=_0x11de9c[_0x0788('0xfa')][_0x59aece];var _0x3787d3=_0x31ffc7[_0x0788('0x81')]?util['format'](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7[_0x0788('0x81')]):'System';var _0x3ea229=_0x31c746[_0x0788('0x83')][_0x0788('0xfd')]||util[_0x0788('0xfe')](_0x0788('0xfb'),'Visitor',_0x31ffc7[_0x0788('0x79')]);switch(_0x4a492c['agentIdentifier']){case _0x0788('0xff'):_0x3787d3=_0x31ffc7[_0x0788('0x81')]?util[_0x0788('0xfe')](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7['UserId']):_0x0788('0x100');break;case'agent_alias':_0x3787d3=_0x31ffc7[_0x0788('0x81')]?_0x31ffc7['User'][_0x0788('0x101')]||_0x31ffc7[_0x0788('0x7f')]['fullname']:_0x0788('0x100');break;case _0x0788('0x102'):_0x3787d3=_0x31ffc7[_0x0788('0x81')]?_0x31ffc7[_0x0788('0x7f')][_0x0788('0x3f')]:_0x0788('0x100');break;default:_0x3787d3=_0x31ffc7[_0x0788('0x81')]?util[_0x0788('0xfe')](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7[_0x0788('0x81')]):'System';}var _0x303d5=util['format'](_0x0788('0x103'),moment(_0x31ffc7['createdAt'])[_0x0788('0xfe')](_0x0788('0x104')),_0x31ffc7['direction']==='in'?_0x3ea229:_0x3787d3,_0x31ffc7['body']);if(!_0x31ffc7['secret']){fs[_0x0788('0x105')](_0x523faa,_0x303d5);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x0788('0x106')],'as':_0x0788('0x107'),'raw':!![]}]});}}})[_0x0788('0x23')](function(_0x5c5464){if(_0x5c5464&&_0x5c5464[_0x0788('0x107')]&&_0x31c746[_0x0788('0x83')]){var _0x14420b={'tls':{'rejectUnauthorized':![]}};if(_0x5c5464['Smtp']['service']){_0x14420b[_0x0788('0x108')]=_0x5c5464[_0x0788('0x107')][_0x0788('0x108')];}else{_0x14420b['host']=_0x5c5464[_0x0788('0x107')][_0x0788('0x109')];_0x14420b[_0x0788('0x10a')]=_0x5c5464['Smtp']['port'];_0x14420b[_0x0788('0x10b')]=_0x5c5464['Smtp'][_0x0788('0x10b')];}if(_0x5c5464[_0x0788('0x107')]['authentication']){_0x14420b['auth']={'user':_0x5c5464[_0x0788('0x107')][_0x0788('0xa2')],'pass':_0x5c5464['Smtp'][_0x0788('0x10c')]};}return respondWithRpcPromise(_0x0788('0x10d'),'sendMail',{'account':_0x14420b,'message':{'from':util[_0x0788('0xfe')](_0x0788('0x10e'),_0x5c5464[_0x0788('0x39')],_0x5c5464[_0x0788('0x10f')]||_0x5c5464['Smtp'][_0x0788('0xa2')]),'to':_0x31c746[_0x0788('0x83')][_0x0788('0xf7')],'subject':_0x0788('0x110'),'text':util[_0x0788('0xfe')](_0x0788('0x111'),_0x31c746[_0x0788('0x83')][_0x0788('0xf7')]),'attachments':[{'path':_0x523faa}]}})[_0x0788('0x23')](function(){return _0x11de9c;})['catch'](function(_0x1b5b80){console[_0x0788('0x27')](_0x1b5b80);});}else{return _0x11de9c;}})['then'](respondWithStatusCode(_0x4f696c,0xc8))[_0x0788('0x2b')](handleError(_0x4f696c,null));};exports[_0x0788('0x112')]=function(_0x5522e3,_0x5f1a46,_0x248f60){return db[_0x0788('0xd9')][_0x0788('0x6f')]({'where':{'id':_0x5522e3['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x5f1a46,null))[_0x0788('0x23')](function(_0x36d7f9){if(_0x36d7f9){return _0x36d7f9['addMessage'](_0x5522e3[_0x0788('0x83')][_0x0788('0x113')],_['omit'](_0x5522e3['body'],['ids','id'])||{});}})[_0x0788('0x23')](respondWithResult(_0x5f1a46,null))[_0x0788('0x2b')](handleError(_0x5f1a46,null));};exports[_0x0788('0x114')]=function(_0x20f429,_0x364f26,_0x351665){var _0x1ba9fb={'raw':![],'where':{}};var _0x56b11c={};var _0x4f36bd={'count':0x0,'rows':[]};return db[_0x0788('0x47')][_0x0788('0xef')]({'where':{'id':_0x20f429[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x364f26,null))[_0x0788('0x23')](function(_0x1c7980){if(_0x1c7980){_0x56b11c[_0x0788('0x4f')]=_[_0x0788('0x4b')](db['ChatMessage']['rawAttributes']);_0x56b11c[_0x0788('0x4c')]=_[_0x0788('0x4b')](_0x20f429[_0x0788('0x4c')]);_0x56b11c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x56b11c[_0x0788('0x4f')],_0x56b11c[_0x0788('0x4c')]);_0x1ba9fb[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x56b11c['model'],qs[_0x0788('0x51')](_0x20f429[_0x0788('0x4c')][_0x0788('0x51')]));_0x1ba9fb[_0x0788('0x50')]=_0x1ba9fb[_0x0788('0x50')][_0x0788('0x52')]?_0x1ba9fb[_0x0788('0x50')]:_0x56b11c['model'];if(!_0x20f429[_0x0788('0x4c')][_0x0788('0x53')](_0x0788('0x115'))){_0x1ba9fb['limit']=qs[_0x0788('0x30')](_0x20f429[_0x0788('0x4c')][_0x0788('0x30')]);_0x1ba9fb[_0x0788('0x33')]=qs[_0x0788('0x33')](_0x20f429['query']['offset']);}_0x1ba9fb['order']=qs[_0x0788('0x55')](_0x20f429[_0x0788('0x4c')][_0x0788('0x55')]);_0x1ba9fb[_0x0788('0x56')]=qs[_0x0788('0x4d')](_[_0x0788('0x116')](_0x20f429[_0x0788('0x4c')],_0x56b11c['filters']));_0x1ba9fb[_0x0788('0x56')][_0x0788('0xc2')]=_0x1c7980['id'];if(_0x20f429[_0x0788('0x4c')][_0x0788('0x93')]){_0x1ba9fb['where']=_[_0x0788('0x3b')](_0x1ba9fb[_0x0788('0x56')],{'$or':_[_0x0788('0x46')](_0x1ba9fb[_0x0788('0x50')],function(_0xccb2e6){var _0x4cc769={};_0x4cc769[_0xccb2e6]={'$like':'%'+_0x20f429[_0x0788('0x4c')][_0x0788('0x93')]+'%'};return _0x4cc769;})});}if(_0x20f429[_0x0788('0x4c')][_0x0788('0x89')]){var _0x4785ac=_0x20f429[_0x0788('0x4c')][_0x0788('0x89')][_0x0788('0x42')](',');var _0x4455dc={};_0x4455dc[_0x4785ac[0x0]]={'$gte':moment(_0x4785ac[0x1])['format'](_0x0788('0x117'))};_0x1ba9fb['where']=_[_0x0788('0x3b')](_0x1ba9fb[_0x0788('0x56')],_0x4455dc);}_0x1ba9fb=_[_0x0788('0x3b')]({},_0x1ba9fb,_0x20f429[_0x0788('0xc8')]);return db[_0x0788('0xd9')][_0x0788('0x32')]({'where':_0x1ba9fb[_0x0788('0x56')]})['then'](function(_0x3eb474){_0x4f36bd[_0x0788('0x32')]=_0x3eb474;if(_0x20f429['query'][_0x0788('0x118')]){_0x1ba9fb[_0x0788('0xc7')]=[{'all':!![]}];}return db[_0x0788('0xd9')]['findAll'](_0x1ba9fb);})['then'](function(_0x1aa86f){_0x4f36bd[_0x0788('0xc4')]=_0x1aa86f;return _0x4f36bd;});}})['then'](respondWithFilteredResult(_0x364f26,_0x1ba9fb))['catch'](handleError(_0x364f26,null));};exports[_0x0788('0x119')]=function(_0x4d6a60,_0x114658,_0x4b11b9){var _0x9af662={'where':{}},_0x257e1c={},_0x35a6bc={'count':0x0,'rows':[]};return db[_0x0788('0x47')]['findOne']({'where':{'id':_0x4d6a60['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x114658,null))[_0x0788('0x23')](function(_0x278a6f){if(_0x278a6f){_0x257e1c[_0x0788('0x4f')]=_['keys'](db[_0x0788('0xd9')][_0x0788('0x48')]);_0x257e1c[_0x0788('0x4c')]=_[_0x0788('0x4b')](_0x4d6a60['query']);_0x257e1c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x257e1c['model'],_0x257e1c[_0x0788('0x4c')]);_0x9af662[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x257e1c[_0x0788('0x4f')],qs[_0x0788('0x51')](_0x4d6a60[_0x0788('0x4c')]['fields']));_0x9af662[_0x0788('0x50')]=_0x9af662[_0x0788('0x50')][_0x0788('0x52')]?_0x9af662[_0x0788('0x50')]:_0x257e1c['model'];if(!_0x4d6a60[_0x0788('0x4c')]['hasOwnProperty'](_0x0788('0x115'))){_0x9af662['limit']=qs['limit'](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x30')]);_0x9af662[_0x0788('0x33')]=qs[_0x0788('0x33')](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x33')]);}_0x9af662[_0x0788('0x54')]=qs[_0x0788('0x55')](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x55')]);_0x9af662['where']=qs['filters'](_['pick'](_0x4d6a60[_0x0788('0x4c')],_0x257e1c[_0x0788('0x4d')]));_0x9af662[_0x0788('0x56')][_0x0788('0xc2')]=_0x278a6f['id'];if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x93')]){_0x9af662[_0x0788('0x56')]=_[_0x0788('0x3b')](_0x9af662['where'],{'$or':_[_0x0788('0x46')](_0x9af662[_0x0788('0x50')],function(_0x4a4297){var _0x1fb846={};_0x1fb846[_0x4a4297]={'$like':'%'+_0x4d6a60[_0x0788('0x4c')][_0x0788('0x93')]+'%'};return _0x1fb846;})});}_0x9af662['where'][_0x0788('0x11a')]=![];if(_0x4d6a60[_0x0788('0x4c')]['id']){_0x9af662[_0x0788('0x56')]['id']={'$gt':_0x4d6a60[_0x0788('0x4c')]['id']};}_0x9af662=_[_0x0788('0x3b')]({},_0x9af662,_0x4d6a60[_0x0788('0xc8')]);return db[_0x0788('0xd9')][_0x0788('0x32')]({'where':_0x9af662[_0x0788('0x56')]})[_0x0788('0x23')](function(_0x292d07){_0x35a6bc[_0x0788('0x32')]=_0x292d07;_0x9af662[_0x0788('0xc7')]=[];if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x11b')]){_0x9af662['include'][_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x7f'),'attributes':['id','fullname',_0x0788('0x101')]});}if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x118')]){_0x9af662['include']=[{'all':!![]}];}return db[_0x0788('0xd9')][_0x0788('0x11c')](_0x9af662);})['then'](function(_0xa44dc3){_0x35a6bc[_0x0788('0xc4')]=_0xa44dc3;return _0x35a6bc;});}})[_0x0788('0x23')](respondWithFilteredResult(_0x114658,_0x9af662))['catch'](handleError(_0x114658,null));};exports[_0x0788('0x11d')]=function(_0x5b0417,_0x4d5e94,_0x1fb141){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x5b0417[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x4d5e94,null))[_0x0788('0x23')](function(_0x5bf415){if(_0x5bf415){return _0x5bf415['setTags'](_0x5b0417['body'][_0x0788('0x113')],_['omit'](_0x5b0417['body'],['ids','id'])||{})[_0x0788('0x11e')](function(){return db[_0x0788('0x7c')][_0x0788('0x11c')]({'attributes':['id',_0x0788('0x39'),_0x0788('0x59')],'where':{'id':_0x5b0417[_0x0788('0x83')][_0x0788('0x113')]}});})[_0x0788('0x23')](function(_0x109d90){socket[_0x0788('0x11f')](_0x0788('0x120'),{'id':Number(_0x5b0417[_0x0788('0xc6')]['id']),'tags':_0x109d90||[]});return{'id':Number(_0x5b0417[_0x0788('0xc6')]['id']),'tags':_0x109d90||[]};});}})['then'](respondWithResult(_0x4d5e94,null))[_0x0788('0x2b')](handleError(_0x4d5e94,null));};exports['removeTags']=function(_0x26343c,_0x30334c,_0x1d18bc){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x26343c[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x30334c,null))[_0x0788('0x23')](function(_0x10266b){if(_0x10266b){return _0x10266b[_0x0788('0x121')](_0x26343c[_0x0788('0x4c')][_0x0788('0x113')]);}})[_0x0788('0x23')](respondWithStatusCode(_0x30334c,null))['catch'](handleError(_0x30334c,null));};exports['download']=function(_0x1fb76f,_0x17ca71){var _0xbae24f=moment()[_0x0788('0x122')]()[_0x0788('0xa9')]();var _0x525754=path['join'](config['root'],_0x0788('0x123'),_0x0788('0x124'),_0x0788('0x125'));var _0x2d51ef=path[_0x0788('0xf1')](config[_0x0788('0xf2')],_0x0788('0x123'),_0x0788('0x124'),_0x0788('0x126'));var _0x5ecd59=path['join'](_0x525754,_0xbae24f);var _0xf63471=util[_0x0788('0xfe')](_0x0788('0x127'),_0x1fb76f[_0x0788('0xc6')]['id'],_0xbae24f);var _0x390cdf=path[_0x0788('0xf1')](_0x525754,_0xf63471);var _0x40a75d=[];_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x7f'),'attributes':['id',_0x0788('0x3f')],'raw':!![]});_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0xdd')],'as':'Contact','attributes':['id',_0x0788('0x128'),_0x0788('0x129')],'raw':!![]});if(_0x1fb76f[_0x0788('0x4c')][_0x0788('0x126')]){_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0xec')],'as':_0x0788('0xec'),'raw':!![]});}var _0x4cf323=[{'model':db[_0x0788('0xd9')],'as':_0x0788('0xfa'),'attributes':['id','body',_0x0788('0x87'),'direction',_0x0788('0x11a'),_0x0788('0x8f')],'include':_0x40a75d}];_0x4cf323['push']({'model':db[_0x0788('0xcd')],'as':'Account','attributes':['id',_0x0788('0x39')]});_0x4cf323[_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x12a'),'attributes':['id',_0x0788('0x3f')]});return db['ChatInteraction'][_0x0788('0x6f')]({'where':{'id':_0x1fb76f['params']['id']},'include':_0x4cf323})['then'](handleEntityNotFound(_0x17ca71,null))[_0x0788('0x23')](function(_0x1fa39f){if(_0x1fa39f){var _0x19b030=_0x1fa39f[_0x0788('0x12b')]({'plain':!![]});fs[_0x0788('0x12c')](_0x5ecd59);var _0x35fc5b={'channel':'Chat','account':_0x19b030[_0x0788('0x12d')]['name'],'agent':_0x19b030[_0x0788('0x12a')]?_0x19b030[_0x0788('0x12a')][_0x0788('0x3f')]:'N.A.','createdAt':moment(_0x19b030['createdAt'])[_0x0788('0xfe')](_0x0788('0x117'))['toString'](),'closedAt':_0x19b030[_0x0788('0xe3')]?moment(_0x19b030[_0x0788('0x12e')])[_0x0788('0xfe')](_0x0788('0x117'))[_0x0788('0xa9')]():'','disposition':_0x19b030[_0x0788('0xe4')],'chatInfo':{'browser':_0x19b030[_0x0788('0x12f')],'os':_0x19b030['osName'],'referer':_0x19b030['referer'],'customerIp':_0x19b030['customerIp'],'customerPort':_0x19b030[_0x0788('0x130')]?_0x19b030['customerPort']:_0x0788('0x131')},'messages':_(_0x19b030[_0x0788('0xfa')])[_0x0788('0x132')]()[_0x0788('0x93')]({'secret':![]})[_0x0788('0x46')](function(_0x3ff416){if(_0x3ff416[_0x0788('0xec')]){var _0x7d6cf9=path[_0x0788('0xf1')](_0x2d51ef,_0x3ff416[_0x0788('0xec')][_0x0788('0xe9')]);if(fs['existsSync'](_0x7d6cf9)){fs[_0x0788('0x133')](_0x7d6cf9)['pipe'](fs[_0x0788('0x134')](path[_0x0788('0xf1')](_0x5ecd59,_0x3ff416[_0x0788('0xec')][_0x0788('0xe9')])));}}return{'date':moment(_0x3ff416[_0x0788('0x87')])[_0x0788('0xfe')](_0x0788('0x117'))[_0x0788('0xa9')](),'sender':_0x3ff416[_0x0788('0x135')]===_0x0788('0xd8')?_0x3ff416['User']?_0x3ff416[_0x0788('0x7f')][_0x0788('0x3f')]:_0x0788('0x100'):_0x3ff416[_0x0788('0x75')]['firstName']+(_0x3ff416[_0x0788('0x75')][_0x0788('0x129')]?'\x20'+_0x3ff416['Contact'][_0x0788('0x129')]:''),'body':_0x3ff416['Attachment']?_0x3ff416[_0x0788('0xec')]['basename']:_0x3ff416[_0x0788('0x83')],'direction':_0x3ff416[_0x0788('0x135')]===_0x0788('0xd8')?'A':'C','secret':_0x3ff416['secret'],'read':_0x3ff416[_0x0788('0x8f')],'attachment':_0x3ff416['Attachment']};})[_0x0788('0x71')]()};return ejs[_0x0788('0x136')](path[_0x0788('0xf1')](config[_0x0788('0xf2')],'server','views',_0x0788('0x137')),{'interaction':_0x35fc5b})['then'](function(_0x45962d){var _0x4cc133=path[_0x0788('0xf1')](_0x5ecd59,_0x0788('0x138')+_0x19b030['id']+'-'+_0xbae24f+_0x0788('0x139'));var _0x52452f={'path':_0x4cc133,'channel':_0x0788('0x13a'),'interactionId':_0x19b030['id']};return pdf[_0x0788('0x13b')](_0x45962d,_0x52452f);})[_0x0788('0x23')](function(){return new BPromise(function(_0xe2d72d,_0x5401a8){zipdir(_0x5ecd59,{'saveTo':_0x390cdf},function(_0x5b289e,_0x4191b4){if(_0x5b289e)return _0x5401a8(_0x5b289e);return _0xe2d72d(_0x4191b4);});})[_0x0788('0x23')](function(){return new BPromise(function(_0x5440c6,_0x2dbb74){rimraf(_0x5ecd59,function(_0x8a89c0){if(_0x8a89c0)_0x2dbb74(_0x8a89c0);return _0x5440c6();});});})['then'](function(){return _0x17ca71['download'](_0x390cdf,_0xf63471,function(_0x2487db){if(_0x2487db){console['log'](_0x0788('0x13c'),_0x2487db);}else{fs[_0x0788('0x13d')](_0x390cdf);}});});});}else{return _0x17ca71[_0x0788('0x2c')](0xc8);}})['catch'](handleError(_0x17ca71,null));};
\ No newline at end of file
+var _0x5f2f=['vidaooMetadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','service','host','port','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','getMessages','pick','includeAll','findAll','getMyMessages','includeAgent','alias','setTags','ids','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','status','end','limit','undefined','count','set','Content-Range','json','apply','save','update','name','merge','body','contact','account','Users','map','fullname','TagIds','Tags','split','forEach','push','index','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','getFullTextValue','find','ContactId','buildExpression','text','start','Tag','union','User','UserId','some','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','contactName','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','keyBy','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','include','options','create','destroy','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow'];(function(_0x4a1412,_0x2b6ee8){var _0x2cc456=function(_0x2cf4a4){while(--_0x2cf4a4){_0x4a1412['push'](_0x4a1412['shift']());}};_0x2cc456(++_0x2b6ee8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5ee824,_0x3b1c7b){_0x5ee824=_0x5ee824-0x0;var _0x1abd19=_0x5f2f[_0x5ee824];return _0x1abd19;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5f2('0x14'))(_0xf5f2('0x15'));var utils=require('../../config/utils');var config=require(_0xf5f2('0x16'));var licenseUtil=require(_0xf5f2('0x17'));var db=require(_0xf5f2('0x18'))['db'];config[_0xf5f2('0x19')]=_[_0xf5f2('0x1a')](config[_0xf5f2('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf5f2('0x1b'))(new Redis(config[_0xf5f2('0x19')]));require(_0xf5f2('0x1c'))[_0xf5f2('0x1d')](socket);var jayson=require(_0xf5f2('0x1e'));var client=jayson['client'][_0xf5f2('0x1f')]({'port':0x232b});var client9004=jayson[_0xf5f2('0x20')][_0xf5f2('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x1b6dd2,_0x23e23a,_0x3a9dbb,_0xdb61b3){return new BPromise(function(_0x395a5a,_0x11f702){var _0x228ace=_0xdb61b3||client;return _0x228ace[_0xf5f2('0x21')](_0x1b6dd2,_0x3a9dbb)[_0xf5f2('0x22')](function(_0x4ff59b){logger[_0xf5f2('0x23')](_0xf5f2('0x24'),_0x23e23a,_0xf5f2('0x25'));logger[_0xf5f2('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x23e23a,_0xf5f2('0x25'),JSON[_0xf5f2('0x27')](_0x4ff59b));if(_0x4ff59b['error']){if(_0x4ff59b['error'][_0xf5f2('0x28')]===0x1f4){logger[_0xf5f2('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);return _0x11f702(_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);}logger[_0xf5f2('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);return _0x395a5a(_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);}else{logger[_0xf5f2('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,'request\x20sent');_0x395a5a(_0x4ff59b[_0xf5f2('0x2b')][_0xf5f2('0x2a')]);}})[_0xf5f2('0x2c')](function(_0x1a5bb3){logger[_0xf5f2('0x29')](_0xf5f2('0x24'),_0x23e23a,_0x1a5bb3);_0x11f702(_0x1a5bb3);});});}function respondWithStatusCode(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0xcc;return function(_0x294414){if(_0x294414){return _0x13a3be['sendStatus'](_0x281ec8);}return _0x13a3be[_0xf5f2('0x2d')](_0x281ec8)[_0xf5f2('0x2e')]();};}function respondWithResult(_0x375ca8,_0x31bfcb){_0x31bfcb=_0x31bfcb||0xc8;return function(_0x198c73){if(_0x198c73){return _0x375ca8[_0xf5f2('0x2d')](_0x31bfcb)['json'](_0x198c73);}};}function respondWithFilteredResult(_0x53cb96,_0x22c826){return function(_0x14c829){if(_0x14c829){var _0x11c771=typeof _0x22c826['offset']==='undefined'&&typeof _0x22c826[_0xf5f2('0x2f')]===_0xf5f2('0x30');var _0x17394a=_0x14c829[_0xf5f2('0x31')];var _0x1b381e=_0x11c771?0x0:_0x22c826['offset'];var _0x52e959=_0x11c771?_0x14c829[_0xf5f2('0x31')]:_0x22c826['offset']+_0x22c826[_0xf5f2('0x2f')];var _0x58a4df;if(_0x52e959>=_0x17394a){_0x52e959=_0x17394a;_0x58a4df=0xc8;}else{_0x58a4df=0xce;}_0x53cb96[_0xf5f2('0x2d')](_0x58a4df);return _0x53cb96[_0xf5f2('0x32')](_0xf5f2('0x33'),_0x1b381e+'-'+_0x52e959+'/'+_0x17394a)[_0xf5f2('0x34')](_0x14c829);}return null;};}function patchUpdates(_0x256bd9){return function(_0x277eee){try{jsonpatch[_0xf5f2('0x35')](_0x277eee,_0x256bd9,!![]);}catch(_0x2c0e05){return BPromise['reject'](_0x2c0e05);}return _0x277eee[_0xf5f2('0x36')]();};}function saveUpdates(_0x43e4ff,_0x4590ec){return function(_0x43c77d){if(_0x43c77d){return _0x43c77d[_0xf5f2('0x37')](_0x43e4ff)[_0xf5f2('0x22')](function(_0x297c0c){return _0x297c0c;});}return null;};}function removeEntity(_0x48d64d,_0x144646){return function(_0xf503e8){if(_0xf503e8){return _0xf503e8['destroy']()[_0xf5f2('0x22')](function(){_0x48d64d['status'](0xcc)[_0xf5f2('0x2e')]();});}};}function handleEntityNotFound(_0x3930fb,_0x2a2c31){return function(_0x2e3cca){if(!_0x2e3cca){_0x3930fb['sendStatus'](0x194);}return _0x2e3cca;};}function handleError(_0x5a98d7,_0x41088b){_0x41088b=_0x41088b||0x1f4;return function(_0x46ad4a){logger[_0xf5f2('0x29')](_0x46ad4a['stack']);if(_0x46ad4a[_0xf5f2('0x38')]){delete _0x46ad4a['name'];}_0x5a98d7[_0xf5f2('0x2d')](_0x41088b)['send'](_0x46ad4a);};}function getMustacheRender(_0x46f464,_0x456764){return Mustache['render'](_0x46f464,_[_0xf5f2('0x39')](_0x456764[_0xf5f2('0x3a')],{'contact':_0x456764[_0xf5f2('0x3b')],'message':_0x456764[_0xf5f2('0x2a')],'agent':_0x456764['agent'],'interaction':_0x456764['interaction'],'account':_0x456764[_0xf5f2('0x3c')]}))||'';}function getInteractionUsers(_0x140a11,_0x22b20c){return new BPromise(function(_0x2d4400,_0x2c7f65){try{if(_0x22b20c[_0x140a11['id']]){_0x140a11[_0xf5f2('0x3d')]=_[_0xf5f2('0x3e')](_0x22b20c[_0x140a11['id']],function(_0x4c0ac7){return{'id':_0x4c0ac7['id'],'fullname':_0x4c0ac7[_0xf5f2('0x3f')]};});}}catch(_0x3b4ea6){_0x2c7f65(_0x3b4ea6);}_0x2d4400(_0x140a11);});}function getInteractionTags(_0x536501,_0xc6a1ae){return new BPromise(function(_0x3f3895,_0x71b0e7){try{if(_0x536501[_0xf5f2('0x40')]){_0x536501[_0xf5f2('0x41')]=[];_0x536501[_0xf5f2('0x40')][_0xf5f2('0x42')](',')[_0xf5f2('0x43')](function(_0x574f24){_0x536501[_0xf5f2('0x41')][_0xf5f2('0x44')](_0xc6a1ae[_0x574f24]);});}delete _0x536501[_0xf5f2('0x40')];}catch(_0x4a8e39){_0x71b0e7(_0x4a8e39);}_0x3f3895(_0x536501);});}function updateChatInteraction(_0x509dbc,_0x59eb00,_0x76d21b){return new BPromise(function(_0x2ad13c,_0x4c8d8e){return getInteractionUsers(_0x509dbc,_0x76d21b)[_0xf5f2('0x22')](function(_0xeed03d){return getInteractionTags(_0xeed03d,_0x59eb00);})[_0xf5f2('0x22')](function(_0x31f86c){_0x2ad13c(_0x31f86c);})[_0xf5f2('0x2c')](function(_0x2b3b1c){_0x4c8d8e(_0x2b3b1c);});});}exports[_0xf5f2('0x45')]=function(_0x212e90,_0x40c322){var _0x106062={},_0x444317={},_0x4773cd={'count':0x0,'rows':[]};var _0x4252a3=_[_0xf5f2('0x3e')](db['ChatInteraction'][_0xf5f2('0x46')],function(_0x578c93){return{'name':_0x578c93[_0xf5f2('0x47')],'type':_0x578c93[_0xf5f2('0x48')][_0xf5f2('0x49')]};});_0x444317[_0xf5f2('0x4a')]=_[_0xf5f2('0x3e')](_0x4252a3,_0xf5f2('0x38'));_0x444317['query']=_[_0xf5f2('0x4b')](_0x212e90[_0xf5f2('0x4c')]);_0x444317[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x444317[_0xf5f2('0x4a')],_0x444317[_0xf5f2('0x4c')]);_0x106062[_0xf5f2('0x4f')]=_[_0xf5f2('0x4e')](_0x444317['model'],qs[_0xf5f2('0x50')](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x106062['attributes']=_0x106062[_0xf5f2('0x4f')][_0xf5f2('0x51')]?_0x106062[_0xf5f2('0x4f')]:_0x444317['model'];if(!_0x212e90['query'][_0xf5f2('0x52')](_0xf5f2('0x53'))){_0x106062['limit']=qs[_0xf5f2('0x2f')](_0x212e90['query'][_0xf5f2('0x2f')]);_0x106062['offset']=qs[_0xf5f2('0x54')](_0x212e90['query'][_0xf5f2('0x54')]);}_0x106062[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x212e90[_0xf5f2('0x4c')]['sort']);_0x106062[_0xf5f2('0x57')]=qs[_0xf5f2('0x4d')](_['pick'](_0x212e90['query'],_0x444317[_0xf5f2('0x4d')]),_0x4252a3);var _0x3dc0c4=[];var _0x57782c=squel[_0xf5f2('0x58')]()[_0xf5f2('0x59')]('id')[_0xf5f2('0x59')](_0xf5f2('0x38'))['field']('color')[_0xf5f2('0x5a')](_0xf5f2('0x5b'));var _0x4b62fc=squel[_0xf5f2('0x58')]()[_0xf5f2('0x59')](_0xf5f2('0x5c'))[_0xf5f2('0x59')](_0xf5f2('0x5d'))[_0xf5f2('0x59')](_0xf5f2('0x5e'))['from']('user_has_chat_interactions','ui')[_0xf5f2('0x5f')](_0xf5f2('0x60'),'u',_0xf5f2('0x61'));var _0x46a905=squel[_0xf5f2('0x58')]()['from'](_0xf5f2('0x62'),'i')[_0xf5f2('0x5f')](_0xf5f2('0x63'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf5f2('0x5f')]('users','o',_0xf5f2('0x64'))[_0xf5f2('0x5f')](_0xf5f2('0x65'),'a',_0xf5f2('0x66'))['left_join']('chat_messages','me',_0xf5f2('0x67'))['left_join'](_0xf5f2('0x68'),'it',_0xf5f2('0x69'))['left_join'](_0xf5f2('0x5b'),'t',_0xf5f2('0x6a'));var _0x2a8f6d=squel['expr']();var _0x397b99=[];var _0xcf7a50=squel[_0xf5f2('0x6b')]();var _0x4579f4;if(_0x212e90['query'][_0xf5f2('0x6c')]){_0x4579f4=as['parseSearch'](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x6c')]);var _0x2e6f5d=_0x4579f4[_0xf5f2('0x6d')];for(var _0x9f210e=0x0;_0x9f210e<_0x4579f4['conditions'][_0xf5f2('0x51')];_0x9f210e++){var _0xacd80=_0x4579f4[_0xf5f2('0x6e')][_0x9f210e];var _0x212639='i';var _0x2c5733=_['find'](_0x4252a3,[_0xf5f2('0x38'),_0xacd80['field']]);if(!_0x2c5733){switch(_0xacd80['field']){case _0xf5f2('0x6f'):if(_0xacd80['value']==0x1){_0x46a905[_0xf5f2('0x70')]('`'+_0xacd80[_0xf5f2('0x59')]+_0xf5f2('0x71'));}else{_0x46a905[_0xf5f2('0x70')]('`'+_0xacd80['field']+_0xf5f2('0x72'));}break;case _0xf5f2('0x73'):if(_0xacd80[_0xf5f2('0x74')]===_0xf5f2('0x75')){if(_0xacd80[_0xf5f2('0x76')][_0xf5f2('0x42')]('\x20')[_0xf5f2('0x51')]>0x1){_0x2a8f6d[_0x2e6f5d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf5f2('0x77')](_0xacd80[_0xf5f2('0x76')]),null);}else{var _0xb39a6e='%'+_0xacd80[_0xf5f2('0x76')]+'%';_0x2a8f6d[_0x2e6f5d]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xb39a6e,_0xb39a6e,_0xb39a6e);}}else{_0x2c5733=_[_0xf5f2('0x78')](_0x4252a3,['name',_0xf5f2('0x79')]);_0xacd80[_0xf5f2('0x59')]='ContactId';_0x5a143f=as[_0xf5f2('0x7a')](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value'][_0xf5f2('0x2e')]);}break;case _0xf5f2('0x7d'):var _0x3a0e75=_0xacd80[_0xf5f2('0x76')][_0xf5f2('0x42')](',')[_0xf5f2('0x3e')](function(_0x53284f){return Number(_0x53284f);});_0x3a0e75[_0xf5f2('0x43')](function(_0x3f475e){_0xcf7a50['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3f475e+',%');});_0x397b99=_[_0xf5f2('0x7e')](_0x397b99,_0x3a0e75);break;case _0xf5f2('0x7f'):if(_0xacd80[_0xf5f2('0x74')]==='$substring'){_0x2a8f6d[_0x2e6f5d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xacd80['value']+'%',null);}else{_0x2c5733=_[_0xf5f2('0x78')](_0x4252a3,[_0xf5f2('0x38'),_0xf5f2('0x80')]);_0xacd80[_0xf5f2('0x59')]=_0xf5f2('0x80');_0x5a143f=as['buildExpression'](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x2e')]);}break;case _0xf5f2('0x3a'):_0x5a143f=as[_0xf5f2('0x7a')]('me',null,_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value']['end']);break;}}else{var _0x5a143f=as[_0xf5f2('0x7a')](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value'][_0xf5f2('0x2e')]);}}}else{var _0x43c732=_(_0x212e90[_0xf5f2('0x4c')])[_0xf5f2('0x4b')]()[_0xf5f2('0x3e')](function(_0x55748d){return _[_0xf5f2('0x81')](_0x4252a3,[_0xf5f2('0x38'),_0x55748d])?_0x55748d:undefined;})['compact']()[_0xf5f2('0x76')]();if(!_[_0xf5f2('0x82')](_0x43c732)){_0x43c732[_0xf5f2('0x43')](function(_0x30ac41){if(_0x30ac41==='ChatWebsiteId'){_0x46a905[_0xf5f2('0x57')](_0xf5f2('0x83'),[][_0xf5f2('0x84')](_0x212e90[_0xf5f2('0x4c')][_0x30ac41]));}else if(_0x30ac41===_0xf5f2('0x85')){var _0x4f47e1=JSON['parse'](_0x212e90[_0xf5f2('0x4c')][_0x30ac41])[_0xf5f2('0x86')];var _0x17eb69=JSON[_0xf5f2('0x87')](_0x212e90['query'][_0x30ac41])['$lte'];_0x46a905[_0xf5f2('0x57')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f47e1,_0x17eb69);}else{if(_0x212e90['query'][_0x30ac41]==='null'){_0x46a905['where']('i.'+_0x30ac41+_0xf5f2('0x88'));}else{_0x46a905[_0xf5f2('0x57')]('i.'+_0x30ac41+_0xf5f2('0x89'),_0x212e90[_0xf5f2('0x4c')][_0x30ac41]);}}});}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8a')]){if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8a')]==0x1){_0x46a905[_0xf5f2('0x70')](_0xf5f2('0x8b'));}else{_0x46a905[_0xf5f2('0x70')](_0xf5f2('0x8c'));}}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')]){_0x397b99=_[_0xf5f2('0x8e')](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')])?_0x212e90[_0xf5f2('0x4c')]['tag']:new Array(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')]);_0x397b99[_0xf5f2('0x43')](function(_0x2811ad){_0xcf7a50['or'](_0xf5f2('0x8f'),'%,'+_0x2811ad+',%');});}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x90')]){var _0xcf48eb=_0x212e90['query'][_0xf5f2('0x90')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0xcf48eb)){_0x2a8f6d['or']('i.id\x20LIKE\x20?',_0xcf48eb+'%');}else{_0x2a8f6d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xcf48eb))['or'](_0xf5f2('0x91'),_0xcf48eb+'%');}}}_0x46a905[_0xf5f2('0x57')](_0x2a8f6d);_0x46a905[_0xf5f2('0x92')](_0xf5f2('0x93'));var _0x145d4d={'type':db[_0xf5f2('0x94')]['QueryTypes']['SELECT'],'raw':!![]};var _0x2fb1a6=_0x46a905['clone']();_0x2fb1a6[_0xf5f2('0x59')](_0xf5f2('0x93'));_0x2fb1a6['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf5f2('0x6f'));if(_0x106062[_0xf5f2('0x55')]){_0x106062['order'][_0xf5f2('0x43')](function(_0x388b32){var _0x49e363=_0x388b32[0x0]===_0xf5f2('0x95')?_0x388b32[0x0]:'i.'+_0x388b32[0x0];_0x46a905[_0xf5f2('0x55')](_0x49e363,_0x388b32[0x1]===_0xf5f2('0x96')?![]:!![]);});}if(!_['isEmpty'](_0x397b99)){_0x46a905[_0xf5f2('0x70')](_0xcf7a50);_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x97'),_0x397b99);}BPromise[_0xf5f2('0x98')]()[_0xf5f2('0x22')](function(){if(!_0x4579f4){if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x99')])return;_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x9a'));_0x46a905[_0xf5f2('0x57')](_0xf5f2('0x9a'));return;}if(_0x212e90[_0xf5f2('0x9b')][_0xf5f2('0x9c')]!==_0xf5f2('0x9d'))return;return _0x212e90[_0xf5f2('0x9b')][_0xf5f2('0x9e')]({'attributes':['id'],'raw':!![]})[_0xf5f2('0x22')](function(_0x29a9d4){if(_[_0xf5f2('0x82')](_0x29a9d4)){_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x9f'));_0x46a905['where'](_0xf5f2('0x9f'));}else{_0x2fb1a6[_0xf5f2('0x57')]('i.ChatWebsiteId\x20IN\x20?',_[_0xf5f2('0x3e')](_0x29a9d4,'id'));_0x46a905[_0xf5f2('0x57')]('i.ChatWebsiteId\x20IN\x20?',_[_0xf5f2('0x3e')](_0x29a9d4,'id'));}});})[_0xf5f2('0x22')](function(){if(_0x212e90[_0xf5f2('0x9b')]['role']==='agent'&&!_0x4579f4&&!_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x99')])return[];return db[_0xf5f2('0xa0')]['query'](_0x2fb1a6['toString'](),_0x145d4d);})[_0xf5f2('0x22')](function(_0xcdc6fd){_0x4773cd[_0xf5f2('0x31')]=_0xcdc6fd['length'];if(_0x4773cd['count']===0x0)return[];return db['sequelize']['query'](_0x57782c['toString'](),_0x145d4d)[_0xf5f2('0x22')](function(_0x561bab){_0x3dc0c4=_[_0xf5f2('0xa1')](_0x561bab,'id');_0x145d4d=_[_0xf5f2('0x39')](_0x145d4d,{'model':db[_0xf5f2('0xa2')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x50')]){_0x106062[_0xf5f2('0x4f')][_0xf5f2('0x43')](function(_0x40e921){_0x46a905[_0xf5f2('0x59')]('i.'+_0x40e921);});}else{_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xa3'),_0xf5f2('0x6f'));_0x46a905[_0xf5f2('0x59')]('a.key',_0xf5f2('0xa4'));_0x46a905[_0xf5f2('0x59')]('a.mandatoryDisposition',_0xf5f2('0xa5'));_0x46a905[_0xf5f2('0x59')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xf5f2('0x95'));_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xa6'));_0x46a905['field'](_0xf5f2('0xa7'),_0xf5f2('0xa8'));_0x46a905['field'](_0xf5f2('0xa9'),_0xf5f2('0xaa'));_0x46a905[_0xf5f2('0x59')]('c.email',_0xf5f2('0xab'));_0x46a905['field'](_0xf5f2('0xac'),'Contact.phone');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xad'),_0xf5f2('0xae'));_0x46a905[_0xf5f2('0x59')]('c.fax',_0xf5f2('0xaf'));_0x46a905['field']('o.fullname','Owner.fullname');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xb0'),'Owner.internal');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xb1'),_0xf5f2('0x40'));}if(_0x106062[_0xf5f2('0x2f')])_0x46a905[_0xf5f2('0x2f')](_0x106062[_0xf5f2('0x2f')]);if(_0x106062['offset'])_0x46a905[_0xf5f2('0x54')](_0x106062[_0xf5f2('0x54')]);return db['sequelize'][_0xf5f2('0x4c')](_0x46a905[_0xf5f2('0xb2')](),_0x145d4d);})['then'](function(_0x32301a){if(_0x32301a[_0xf5f2('0x51')]>0x0)_0x4b62fc[_0xf5f2('0x57')](_0xf5f2('0xb3'),_[_0xf5f2('0x3e')](_0x32301a,'id'));return db[_0xf5f2('0xa0')]['query'](_0x4b62fc[_0xf5f2('0xb2')](),_0x145d4d)[_0xf5f2('0x22')](function(_0x13fcb0){var _0x792c75=_[_0xf5f2('0xb4')](_0x13fcb0,_0xf5f2('0xb5'));var _0x162c13=[];_0x32301a[_0xf5f2('0x43')](function(_0x3e4e40){_0x162c13['push'](updateChatInteraction(_0x3e4e40,_0x3dc0c4,_0x792c75));});return BPromise[_0xf5f2('0xb6')](_0x162c13);});});})[_0xf5f2('0x22')](function(_0xdbb2cd){_0x4773cd[_0xf5f2('0xb7')]=_0xdbb2cd;return _0x4773cd;})[_0xf5f2('0x22')](respondWithFilteredResult(_0x40c322,_0x106062))[_0xf5f2('0x2c')](handleError(_0x40c322,null));};exports[_0xf5f2('0xb8')]=function(_0x56f4b4,_0x33cfe7){var _0x40d0eb={'raw':![],'where':{'id':_0x56f4b4['params']['id']}},_0x4c138c={};_0x4c138c[_0xf5f2('0x4a')]=_[_0xf5f2('0x4b')](db[_0xf5f2('0xa2')][_0xf5f2('0x46')]);_0x4c138c['query']=_[_0xf5f2('0x4b')](_0x56f4b4[_0xf5f2('0x4c')]);_0x4c138c[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x4c138c[_0xf5f2('0x4a')],_0x4c138c['query']);_0x40d0eb[_0xf5f2('0x4f')]=_[_0xf5f2('0x4e')](_0x4c138c['model'],qs[_0xf5f2('0x50')](_0x56f4b4[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x40d0eb[_0xf5f2('0x4f')]=_0x40d0eb['attributes'][_0xf5f2('0x51')]?_0x40d0eb[_0xf5f2('0x4f')]:_0x4c138c[_0xf5f2('0x4a')];if(_0x56f4b4['query']['includeAll']){_0x40d0eb[_0xf5f2('0xb9')]=[{'all':!![]}];}_0x40d0eb=_[_0xf5f2('0x39')]({},_0x40d0eb,_0x56f4b4[_0xf5f2('0xba')]);return db[_0xf5f2('0xa2')][_0xf5f2('0x78')](_0x40d0eb)[_0xf5f2('0x22')](handleEntityNotFound(_0x33cfe7,null))['then'](respondWithResult(_0x33cfe7,null))[_0xf5f2('0x2c')](handleError(_0x33cfe7,null));};exports['create']=function(_0x151f13,_0x1624a4){return db[_0xf5f2('0xa2')][_0xf5f2('0xbb')](_0x151f13[_0xf5f2('0x3a')],{})[_0xf5f2('0x22')](respondWithResult(_0x1624a4,0xc9))['catch'](handleError(_0x1624a4,null));};exports[_0xf5f2('0x37')]=function(_0x409ed1,_0x457b53){if(_0x409ed1[_0xf5f2('0x3a')]['id']){delete _0x409ed1[_0xf5f2('0x3a')]['id'];}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x409ed1['params']['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x457b53,null))['then'](saveUpdates(_0x409ed1['body'],null))['then'](respondWithResult(_0x457b53,null))[_0xf5f2('0x2c')](handleError(_0x457b53,null));};exports[_0xf5f2('0xbc')]=function(_0x568806,_0x3487df){return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x568806[_0xf5f2('0xbd')]['id']}})['then'](handleEntityNotFound(_0x3487df,null))[_0xf5f2('0x22')](removeEntity(_0x3487df,null))[_0xf5f2('0x2c')](handleError(_0x3487df,null));};exports[_0xf5f2('0xbe')]=function(_0x5d3ca7,_0x29f7bd){return db[_0xf5f2('0xa2')]['describe']()[_0xf5f2('0x22')](respondWithResult(_0x29f7bd,null))[_0xf5f2('0x2c')](handleError(_0x29f7bd,null));};exports[_0xf5f2('0xbf')]=function(_0x1583bb,_0x176974){var _0x8b591c=_0x1583bb[_0xf5f2('0xbd')]['id'];var _0x2c242b;var _0x155007;var _0x4782da;return db[_0xf5f2('0xa2')]['findOne']({'where':{'id':_0x8b591c}})[_0xf5f2('0x22')](function(_0x31dbfa){_0x2c242b=_0x31dbfa;return db['ChatWebsite'][_0xf5f2('0xc0')]({'where':{'id':_0x31dbfa['ChatWebsiteId']},'attributes':['id',_0xf5f2('0xc1'),_0xf5f2('0xc2'),_0xf5f2('0xc3'),_0xf5f2('0xc4'),'vidaooMetadata'],'raw':!![]});})[_0xf5f2('0x22')](function(_0x5a104b){if(_0x5a104b&&_0x5a104b[_0xf5f2('0xc1')]&&_0x5a104b['vidaooEscalation']){_0x155007=_0x5a104b;var _0x3310cb={'interaction':{'id':_0x8b591c},'agent':{'id':_0x1583bb[_0xf5f2('0x9b')]['id'],'name':_0x1583bb['user'][_0xf5f2('0x38')],'fullname':_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0x3f')],'email':_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0xc5')]},'contact':_0x1583bb[_0xf5f2('0x3a')]['contact'],'account':_0x1583bb['body'][_0xf5f2('0x3c')]};var _0x17e1eb={'rejectUnauthorized':![],'method':'POST','url':_0xf5f2('0xc6'),'headers':{'X-APIKEY':_0x5a104b[_0xf5f2('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0xc5')]],'buttons':null,'topic':_0x155007[_0xf5f2('0xc3')],'note':_[_0xf5f2('0xc7')](_0x155007[_0xf5f2('0xc4')])?null:getMustacheRender(_0x155007['vidaooNote'],_0x3310cb),'metadata':null},'redirect':_0xf5f2('0xc8'),'json':!![]};try{if(!_['isNull'](_0x155007[_0xf5f2('0xc9')])){var _0x5ec0f3=getMustacheRender(_0x155007[_0xf5f2('0xc9')],_0x3310cb);var _0x4f2531=JSON[_0xf5f2('0x87')](_0x5ec0f3);_0x17e1eb['body']['metadata']=_0x4f2531;}}catch(_0x2c285c){throw new db[(_0xf5f2('0x94'))]['ValidationError'](_0xf5f2('0xca'));}return rp(_0x17e1eb);}else{throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xcc'));}})[_0xf5f2('0x22')](function(_0x25af1e){_0x4782da=_0x25af1e;if(_0x4782da['id']){var _0xd0b5d={'body':_0x4782da[_0xf5f2('0xcd')],'ChatWebsiteId':_0x155007['id'],'ChatInteractionId':_0x2c242b['id'],'direction':'out','UserId':_0x1583bb['user']['id']};return db[_0xf5f2('0xce')]['create'](_0xd0b5d,{});}else{throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xcf'));}})[_0xf5f2('0x22')](function(){return _0x2c242b[_0xf5f2('0xd0')]({'vidaooSessionId':_0x4782da['id']});})[_0xf5f2('0x22')](respondWithResult(_0x176974,null))[_0xf5f2('0x2c')](handleError(_0x176974,null));};exports[_0xf5f2('0xd1')]=function(_0x28f65b,_0x16cbd3){if(_0x28f65b[_0xf5f2('0x3a')]['id']){delete _0x28f65b[_0xf5f2('0x3a')]['id'];}return db['ChatInteraction'][_0xf5f2('0x78')]({'where':{'id':_0x28f65b['params']['id']},'include':[{'model':db[_0xf5f2('0xd2')],'as':_0xf5f2('0x73')}]})[_0xf5f2('0x22')](handleEntityNotFound(_0x16cbd3,null))[_0xf5f2('0x22')](saveUpdates(_0x28f65b[_0xf5f2('0x3a')],null))[_0xf5f2('0x22')](respondWithResult(_0x16cbd3,null))[_0xf5f2('0x2c')](handleError(_0x16cbd3,null));};exports[_0xf5f2('0xd3')]=function(_0x29db4f,_0x377c68,_0xe0f288){if(_0x29db4f['body']['id']){delete _0x29db4f[_0xf5f2('0x3a')]['id'];}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x29db4f[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](function(_0x3f8794){if(!_0x3f8794){logger[_0xf5f2('0x29')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xf5f2('0xd3'),0x194,_0xf5f2('0xd4'));_0x377c68[_0xf5f2('0xd5')](0x194);}else{if(_0x3f8794[_0xf5f2('0x80')]){throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xd6'));}}return _0x3f8794;})[_0xf5f2('0x22')](function(_0x356155){if(_0x356155){return _0x356155[_0xf5f2('0x37')]({'closed':_0x29db4f[_0xf5f2('0x3a')][_0xf5f2('0xd7')],'disposition':_0x29db4f[_0xf5f2('0x3a')][_0xf5f2('0xd8')]})[_0xf5f2('0x22')](function(_0x654b1b){return _0x654b1b;});}})['then'](function(_0x25566a){return respondWithRpcPromise(_0xf5f2('0xd9'),'abandon',_0x29db4f['body'],client9004);})[_0xf5f2('0x22')](respondWithResult(_0x377c68,null))[_0xf5f2('0x2c')](handleError(_0x377c68,null));};exports[_0xf5f2('0xda')]=function(_0x2c8f4c,_0x529d6f,_0x28cc){_0x2c8f4c[_0xf5f2('0x3a')][_0xf5f2('0x38')]=_0x2c8f4c[_0xf5f2('0xdb')][_0xf5f2('0xdc')];_0x2c8f4c[_0xf5f2('0x3a')]['basename']=_0x2c8f4c[_0xf5f2('0xdb')]['filename'];_0x2c8f4c['body'][_0xf5f2('0x48')]=_0x2c8f4c[_0xf5f2('0xdb')][_0xf5f2('0xdd')];return db[_0xf5f2('0xde')][_0xf5f2('0xbb')](_0x2c8f4c[_0xf5f2('0x3a')])[_0xf5f2('0x22')](respondWithResult(_0x529d6f,0xc9))['catch'](handleError(_0x529d6f,null));};exports[_0xf5f2('0xdf')]=function(_0x3a2862,_0x2c1160,_0x5e6c83){return db[_0xf5f2('0xa2')]['findOne']({'where':{'id':_0x3a2862['params']['id']},'raw':!![]})[_0xf5f2('0x22')](handleEntityNotFound(_0x2c1160,null))['then'](function(_0x2389b7){if(_0x2389b7){if(_0x2389b7[_0xf5f2('0xd7')]){return _0x2c1160['status'](0x193)[_0xf5f2('0x34')]({'status':0x193,'message':_0xf5f2('0xe0')});}return db['Attachment'][_0xf5f2('0xc0')]({'where':{'id':_0x3a2862[_0xf5f2('0x4c')][_0xf5f2('0xe1')]},'raw':!![]})[_0xf5f2('0x22')](handleEntityNotFound(_0x2c1160,null));}})[_0xf5f2('0x22')](function(_0x47a28a){if(_0x47a28a){var _0x182fa7=_0x47a28a[_0xf5f2('0xe2')]!==null;var _0x4d9048=path['join'](config[_0xf5f2('0xe3')],_0xf5f2('0xe4'));if(_0x182fa7){_0x4d9048=path[_0xf5f2('0xe5')](_0x4d9048,_0xf5f2('0xe6'));}var _0x1f51d8=path[_0xf5f2('0xe5')](_0x4d9048,_0x47a28a[_0xf5f2('0xe7')]);return _0x2c1160[_0xf5f2('0xe8')](_0x1f51d8);}})['catch'](handleError(_0x2c1160,null));};exports['close']=function(_0xc86ed5,_0x5be398){var _0x34abb6=null;var _0x235c30=null;var _0x15b060=null;var _0x422e88=null;if(_0xc86ed5['body']['id']){delete _0xc86ed5[_0xf5f2('0x3a')]['id'];}if(_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xe9')]){_0x422e88=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],'server/files/chat/upload/',util[_0xf5f2('0xea')](_0xf5f2('0xeb'),Date[_0xf5f2('0xec')]()));_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xed')]=_0x422e88;}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0xc86ed5[_0xf5f2('0xbd')]['id']},'include':[{'model':db[_0xf5f2('0xce')],'as':_0xf5f2('0xee'),'include':[{'model':db[_0xf5f2('0x7f')],'as':_0xf5f2('0x7f')}]}]})['then'](handleEntityNotFound(_0x5be398,null))[_0xf5f2('0x22')](saveUpdates(_0xc86ed5['body'],null))[_0xf5f2('0x22')](function(_0x349efe){if(_0x349efe){_0x34abb6=_0x349efe;return db[_0xf5f2('0xef')][_0xf5f2('0x78')]({'where':{'id':_0x34abb6[_0xf5f2('0x99')]}});}})[_0xf5f2('0x22')](function(_0x2cd0b7){if(_0x2cd0b7){_0x15b060=_0x2cd0b7;return db[_0xf5f2('0xd2')][_0xf5f2('0x78')]({'where':{'id':_0x34abb6[_0xf5f2('0x79')]}});}})[_0xf5f2('0x22')](function(_0x2b6f46){if(_0x2b6f46){_0x235c30=_0x2b6f46;if(_0x422e88){var _0xf53f16=null;for(var _0xd45a63=0x1;_0xd45a63<_0x34abb6[_0xf5f2('0xee')][_0xf5f2('0x51')];++_0xd45a63){_0xf53f16=_0x34abb6[_0xf5f2('0xee')][_0xd45a63];var _0x33f987=_0xf53f16['UserId']?util[_0xf5f2('0xea')]('%s%d',_0x15b060['agentAlias'],_0xf53f16[_0xf5f2('0x80')]):_0xf5f2('0xf0');var _0x53e85c=_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xf1')]||util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0xf5f2('0xf3'),_0xf53f16[_0xf5f2('0x79')]);switch(_0x15b060[_0xf5f2('0xf4')]){case _0xf5f2('0xf5'):_0x33f987=_0xf53f16['UserId']?util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0x15b060[_0xf5f2('0xf6')],_0xf53f16['UserId']):_0xf5f2('0xf0');break;case _0xf5f2('0xf7'):_0x33f987=_0xf53f16[_0xf5f2('0x80')]?_0xf53f16[_0xf5f2('0x7f')]['alias']||_0xf53f16['User'][_0xf5f2('0x3f')]:_0xf5f2('0xf0');break;case _0xf5f2('0xf8'):_0x33f987=_0xf53f16[_0xf5f2('0x80')]?_0xf53f16[_0xf5f2('0x7f')][_0xf5f2('0x3f')]:_0xf5f2('0xf0');break;default:_0x33f987=_0xf53f16[_0xf5f2('0x80')]?util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0x15b060['agentAlias'],_0xf53f16[_0xf5f2('0x80')]):_0xf5f2('0xf0');}var _0x3881cd=util['format'](_0xf5f2('0xf9'),moment(_0xf53f16[_0xf5f2('0x85')])['format'](_0xf5f2('0xfa')),_0xf53f16['direction']==='in'?_0x53e85c:_0x33f987,_0xf53f16[_0xf5f2('0x3a')]);if(!_0xf53f16[_0xf5f2('0xfb')]){fs['appendFileSync'](_0x422e88,_0x3881cd);}}return db[_0xf5f2('0xfc')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf5f2('0xfd')],'as':_0xf5f2('0xfe'),'raw':!![]}]});}}})['then'](function(_0x3971ee){if(_0x3971ee&&_0x3971ee[_0xf5f2('0xfe')]&&_0xc86ed5[_0xf5f2('0x3a')]){var _0xfeccdd={'tls':{'rejectUnauthorized':![]}};if(_0x3971ee[_0xf5f2('0xfe')]['service']){_0xfeccdd[_0xf5f2('0xff')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0xff')];}else{_0xfeccdd[_0xf5f2('0x100')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x100')];_0xfeccdd[_0xf5f2('0x101')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x101')];_0xfeccdd['secure']=_0x3971ee[_0xf5f2('0xfe')]['secure'];}if(_0x3971ee['Smtp'][_0xf5f2('0x102')]){_0xfeccdd[_0xf5f2('0x103')]={'user':_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x9b')],'pass':_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x104')]};}return respondWithRpcPromise(_0xf5f2('0x105'),_0xf5f2('0x106'),{'account':_0xfeccdd,'message':{'from':util[_0xf5f2('0xea')](_0xf5f2('0x107'),_0x3971ee['name'],_0x3971ee['email']||_0x3971ee['Smtp'][_0xf5f2('0x9b')]),'to':_0xc86ed5['body'][_0xf5f2('0xe9')],'subject':_0xf5f2('0x108'),'text':util[_0xf5f2('0xea')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xe9')]),'attachments':[{'path':_0x422e88}]}})['then'](function(){return _0x34abb6;})['catch'](function(_0x4d0709){console[_0xf5f2('0x29')](_0x4d0709);});}else{return _0x34abb6;}})[_0xf5f2('0x22')](respondWithStatusCode(_0x5be398,0xc8))[_0xf5f2('0x2c')](handleError(_0x5be398,null));};exports['addMessage']=function(_0x2cfa84,_0x4a22fb,_0x7cf1b6){return db[_0xf5f2('0xce')][_0xf5f2('0x78')]({'where':{'id':_0x2cfa84['params']['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x4a22fb,null))['then'](function(_0x1b88b5){if(_0x1b88b5){return _0x1b88b5[_0xf5f2('0x109')](_0x2cfa84[_0xf5f2('0x3a')]['ids'],_[_0xf5f2('0x10a')](_0x2cfa84[_0xf5f2('0x3a')],['ids','id'])||{});}})[_0xf5f2('0x22')](respondWithResult(_0x4a22fb,null))[_0xf5f2('0x2c')](handleError(_0x4a22fb,null));};exports[_0xf5f2('0x10b')]=function(_0x29526c,_0x2a52e3,_0x439c9f){var _0x44adaa={'raw':![],'where':{}};var _0x3c7058={};var _0x3bcb44={'count':0x0,'rows':[]};return db[_0xf5f2('0xa2')][_0xf5f2('0xc0')]({'where':{'id':_0x29526c[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x2a52e3,null))[_0xf5f2('0x22')](function(_0x23675a){if(_0x23675a){_0x3c7058[_0xf5f2('0x4a')]=_[_0xf5f2('0x4b')](db[_0xf5f2('0xce')][_0xf5f2('0x46')]);_0x3c7058[_0xf5f2('0x4c')]=_[_0xf5f2('0x4b')](_0x29526c[_0xf5f2('0x4c')]);_0x3c7058['filters']=_[_0xf5f2('0x4e')](_0x3c7058[_0xf5f2('0x4a')],_0x3c7058[_0xf5f2('0x4c')]);_0x44adaa[_0xf5f2('0x4f')]=_['intersection'](_0x3c7058[_0xf5f2('0x4a')],qs['fields'](_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x44adaa[_0xf5f2('0x4f')]=_0x44adaa[_0xf5f2('0x4f')][_0xf5f2('0x51')]?_0x44adaa[_0xf5f2('0x4f')]:_0x3c7058[_0xf5f2('0x4a')];if(!_0x29526c['query']['hasOwnProperty'](_0xf5f2('0x53'))){_0x44adaa[_0xf5f2('0x2f')]=qs[_0xf5f2('0x2f')](_0x29526c[_0xf5f2('0x4c')]['limit']);_0x44adaa[_0xf5f2('0x54')]=qs[_0xf5f2('0x54')](_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x54')]);}_0x44adaa[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x29526c['query']['sort']);_0x44adaa['where']=qs[_0xf5f2('0x4d')](_[_0xf5f2('0x10c')](_0x29526c[_0xf5f2('0x4c')],_0x3c7058['filters']));_0x44adaa[_0xf5f2('0x57')]['ChatInteractionId']=_0x23675a['id'];if(_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x90')]){_0x44adaa[_0xf5f2('0x57')]=_[_0xf5f2('0x39')](_0x44adaa[_0xf5f2('0x57')],{'$or':_[_0xf5f2('0x3e')](_0x44adaa[_0xf5f2('0x4f')],function(_0xece862){var _0x3b4121={};_0x3b4121[_0xece862]={'$like':'%'+_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x90')]+'%'};return _0x3b4121;})});}if(_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x86')]){var _0x2fa70d=_0x29526c['query'][_0xf5f2('0x86')][_0xf5f2('0x42')](',');var _0x31f018={};_0x31f018[_0x2fa70d[0x0]]={'$gte':moment(_0x2fa70d[0x1])[_0xf5f2('0xea')]('YYYY-MM-DD\x20HH:mm:ss')};_0x44adaa[_0xf5f2('0x57')]=_[_0xf5f2('0x39')](_0x44adaa[_0xf5f2('0x57')],_0x31f018);}_0x44adaa=_[_0xf5f2('0x39')]({},_0x44adaa,_0x29526c['options']);return db[_0xf5f2('0xce')]['count']({'where':_0x44adaa[_0xf5f2('0x57')]})[_0xf5f2('0x22')](function(_0x20bb46){_0x3bcb44[_0xf5f2('0x31')]=_0x20bb46;if(_0x29526c['query'][_0xf5f2('0x10d')]){_0x44adaa[_0xf5f2('0xb9')]=[{'all':!![]}];}return db[_0xf5f2('0xce')][_0xf5f2('0x10e')](_0x44adaa);})[_0xf5f2('0x22')](function(_0x889f0e){_0x3bcb44['rows']=_0x889f0e;return _0x3bcb44;});}})[_0xf5f2('0x22')](respondWithFilteredResult(_0x2a52e3,_0x44adaa))[_0xf5f2('0x2c')](handleError(_0x2a52e3,null));};exports[_0xf5f2('0x10f')]=function(_0x3dcf4e,_0x4212d4,_0x2ebe4f){var _0x34fc35={'where':{}},_0x29c1ca={},_0x2cf93e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf5f2('0xc0')]({'where':{'id':_0x3dcf4e[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x4212d4,null))[_0xf5f2('0x22')](function(_0x544db3){if(_0x544db3){_0x29c1ca['model']=_[_0xf5f2('0x4b')](db[_0xf5f2('0xce')][_0xf5f2('0x46')]);_0x29c1ca['query']=_['keys'](_0x3dcf4e[_0xf5f2('0x4c')]);_0x29c1ca[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x29c1ca[_0xf5f2('0x4a')],_0x29c1ca[_0xf5f2('0x4c')]);_0x34fc35[_0xf5f2('0x4f')]=_['intersection'](_0x29c1ca[_0xf5f2('0x4a')],qs[_0xf5f2('0x50')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x34fc35['attributes']=_0x34fc35['attributes'][_0xf5f2('0x51')]?_0x34fc35['attributes']:_0x29c1ca[_0xf5f2('0x4a')];if(!_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x52')](_0xf5f2('0x53'))){_0x34fc35[_0xf5f2('0x2f')]=qs[_0xf5f2('0x2f')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x2f')]);_0x34fc35[_0xf5f2('0x54')]=qs[_0xf5f2('0x54')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x54')]);}_0x34fc35[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x3dcf4e['query'][_0xf5f2('0x56')]);_0x34fc35[_0xf5f2('0x57')]=qs[_0xf5f2('0x4d')](_[_0xf5f2('0x10c')](_0x3dcf4e[_0xf5f2('0x4c')],_0x29c1ca['filters']));_0x34fc35[_0xf5f2('0x57')][_0xf5f2('0xb5')]=_0x544db3['id'];if(_0x3dcf4e['query'][_0xf5f2('0x90')]){_0x34fc35[_0xf5f2('0x57')]=_['merge'](_0x34fc35['where'],{'$or':_[_0xf5f2('0x3e')](_0x34fc35[_0xf5f2('0x4f')],function(_0x3e7f54){var _0x5e165c={};_0x5e165c[_0x3e7f54]={'$like':'%'+_0x3dcf4e['query'][_0xf5f2('0x90')]+'%'};return _0x5e165c;})});}_0x34fc35[_0xf5f2('0x57')][_0xf5f2('0xfb')]=![];if(_0x3dcf4e[_0xf5f2('0x4c')]['id']){_0x34fc35[_0xf5f2('0x57')]['id']={'$gt':_0x3dcf4e[_0xf5f2('0x4c')]['id']};}_0x34fc35=_[_0xf5f2('0x39')]({},_0x34fc35,_0x3dcf4e[_0xf5f2('0xba')]);return db[_0xf5f2('0xce')][_0xf5f2('0x31')]({'where':_0x34fc35['where']})[_0xf5f2('0x22')](function(_0x1c2842){_0x2cf93e['count']=_0x1c2842;_0x34fc35[_0xf5f2('0xb9')]=[];if(_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x110')]){_0x34fc35[_0xf5f2('0xb9')][_0xf5f2('0x44')]({'model':db['User'],'as':'User','attributes':['id',_0xf5f2('0x3f'),_0xf5f2('0x111')]});}if(_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x10d')]){_0x34fc35['include']=[{'all':!![]}];}return db[_0xf5f2('0xce')][_0xf5f2('0x10e')](_0x34fc35);})[_0xf5f2('0x22')](function(_0x3518f9){_0x2cf93e['rows']=_0x3518f9;return _0x2cf93e;});}})['then'](respondWithFilteredResult(_0x4212d4,_0x34fc35))['catch'](handleError(_0x4212d4,null));};exports['addTags']=function(_0x2e9d3b,_0x496802,_0x5be074){return db['ChatInteraction']['find']({'where':{'id':_0x2e9d3b[_0xf5f2('0xbd')]['id']}})['then'](handleEntityNotFound(_0x496802,null))['then'](function(_0x43150f){if(_0x43150f){return _0x43150f[_0xf5f2('0x112')](_0x2e9d3b[_0xf5f2('0x3a')][_0xf5f2('0x113')],_['omit'](_0x2e9d3b[_0xf5f2('0x3a')],[_0xf5f2('0x113'),'id'])||{})[_0xf5f2('0x114')](function(){return db[_0xf5f2('0x7d')][_0xf5f2('0x10e')]({'attributes':['id',_0xf5f2('0x38'),_0xf5f2('0x115')],'where':{'id':_0x2e9d3b['body'][_0xf5f2('0x113')]}});})[_0xf5f2('0x22')](function(_0x4f4af9){socket[_0xf5f2('0x116')](_0xf5f2('0x117'),{'id':Number(_0x2e9d3b[_0xf5f2('0xbd')]['id']),'tags':_0x4f4af9||[]});return{'id':Number(_0x2e9d3b[_0xf5f2('0xbd')]['id']),'tags':_0x4f4af9||[]};});}})[_0xf5f2('0x22')](respondWithResult(_0x496802,null))['catch'](handleError(_0x496802,null));};exports[_0xf5f2('0x118')]=function(_0x5f470f,_0x1f0a64,_0x2bbc23){return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x5f470f['params']['id']}})['then'](handleEntityNotFound(_0x1f0a64,null))[_0xf5f2('0x22')](function(_0x179901){if(_0x179901){return _0x179901[_0xf5f2('0x118')](_0x5f470f[_0xf5f2('0x4c')][_0xf5f2('0x113')]);}})[_0xf5f2('0x22')](respondWithStatusCode(_0x1f0a64,null))[_0xf5f2('0x2c')](handleError(_0x1f0a64,null));};exports[_0xf5f2('0xe8')]=function(_0x5d8c6a,_0x4f777b){var _0x26dc8c=moment()[_0xf5f2('0x119')]()['toString']();var _0xb8bcf3=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],_0xf5f2('0x11a'),_0xf5f2('0x11b'),_0xf5f2('0x11c'));var _0x2bc493=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],_0xf5f2('0x11a'),_0xf5f2('0x11b'),_0xf5f2('0x11d'));var _0x212d97=path[_0xf5f2('0xe5')](_0xb8bcf3,_0x26dc8c);var _0x8ee5fd=util[_0xf5f2('0xea')](_0xf5f2('0x11e'),_0x5d8c6a['params']['id'],_0x26dc8c);var _0x3712e3=path['join'](_0xb8bcf3,_0x8ee5fd);var _0x56a1c3=[];_0x56a1c3['push']({'model':db['User'],'as':_0xf5f2('0x7f'),'attributes':['id',_0xf5f2('0x3f')],'raw':!![]});_0x56a1c3[_0xf5f2('0x44')]({'model':db[_0xf5f2('0xd2')],'as':'Contact','attributes':['id',_0xf5f2('0x11f'),_0xf5f2('0x120')],'raw':!![]});if(_0x5d8c6a['query']['attachments']){_0x56a1c3['push']({'model':db[_0xf5f2('0xde')],'as':_0xf5f2('0xde'),'raw':!![]});}var _0x5a6da7=[{'model':db[_0xf5f2('0xce')],'as':_0xf5f2('0xee'),'attributes':['id',_0xf5f2('0x3a'),'createdAt',_0xf5f2('0x121'),_0xf5f2('0xfb'),_0xf5f2('0x8a')],'include':_0x56a1c3}];_0x5a6da7[_0xf5f2('0x44')]({'model':db[_0xf5f2('0xef')],'as':_0xf5f2('0x122'),'attributes':['id','name']});_0x5a6da7['push']({'model':db[_0xf5f2('0x7f')],'as':_0xf5f2('0x123'),'attributes':['id','fullname']});return db['ChatInteraction'][_0xf5f2('0x78')]({'where':{'id':_0x5d8c6a['params']['id']},'include':_0x5a6da7})[_0xf5f2('0x22')](handleEntityNotFound(_0x4f777b,null))[_0xf5f2('0x22')](function(_0x2ee55f){if(_0x2ee55f){var _0x43ca34=_0x2ee55f[_0xf5f2('0x124')]({'plain':!![]});fs[_0xf5f2('0x125')](_0x212d97);var _0x220300={'channel':_0xf5f2('0x126'),'account':_0x43ca34[_0xf5f2('0x122')][_0xf5f2('0x38')],'agent':_0x43ca34['Owner']?_0x43ca34[_0xf5f2('0x123')][_0xf5f2('0x3f')]:_0xf5f2('0x127'),'createdAt':moment(_0x43ca34[_0xf5f2('0x85')])['format'](_0xf5f2('0x128'))[_0xf5f2('0xb2')](),'closedAt':_0x43ca34['closed']?moment(_0x43ca34[_0xf5f2('0x129')])['format'](_0xf5f2('0x128'))[_0xf5f2('0xb2')]():'','disposition':_0x43ca34['disposition'],'chatInfo':{'browser':_0x43ca34[_0xf5f2('0x12a')],'os':_0x43ca34[_0xf5f2('0x12b')],'referer':_0x43ca34[_0xf5f2('0x12c')],'customerIp':_0x43ca34[_0xf5f2('0x12d')],'customerPort':_0x43ca34['customerPort']?_0x43ca34[_0xf5f2('0x12e')]:_0xf5f2('0x127')},'messages':_(_0x43ca34[_0xf5f2('0xee')])['tail']()[_0xf5f2('0x90')]({'secret':![]})[_0xf5f2('0x3e')](function(_0x5981bb){if(_0x5981bb[_0xf5f2('0xde')]){var _0x4586b5=path[_0xf5f2('0xe5')](_0x2bc493,_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')]);if(fs[_0xf5f2('0x12f')](_0x4586b5)){fs[_0xf5f2('0x130')](_0x4586b5)[_0xf5f2('0x131')](fs[_0xf5f2('0x132')](path['join'](_0x212d97,_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')])));}}return{'date':moment(_0x5981bb[_0xf5f2('0x85')])[_0xf5f2('0xea')](_0xf5f2('0x128'))[_0xf5f2('0xb2')](),'sender':_0x5981bb[_0xf5f2('0x121')]===_0xf5f2('0x133')?_0x5981bb[_0xf5f2('0x7f')]?_0x5981bb[_0xf5f2('0x7f')][_0xf5f2('0x3f')]:'System':_0x5981bb['Contact']['firstName']+(_0x5981bb[_0xf5f2('0x73')][_0xf5f2('0x120')]?'\x20'+_0x5981bb[_0xf5f2('0x73')]['lastName']:''),'body':_0x5981bb[_0xf5f2('0xde')]?_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')]:_0x5981bb['body'],'direction':_0x5981bb[_0xf5f2('0x121')]===_0xf5f2('0x133')?'A':'C','secret':_0x5981bb[_0xf5f2('0xfb')],'read':_0x5981bb[_0xf5f2('0x8a')],'attachment':_0x5981bb[_0xf5f2('0xde')]};})[_0xf5f2('0x76')]()};return ejs[_0xf5f2('0x134')](path[_0xf5f2('0xe5')](config['root'],_0xf5f2('0x11a'),_0xf5f2('0x135'),_0xf5f2('0x136')),{'interaction':_0x220300})[_0xf5f2('0x22')](function(_0x510f56){var _0x319b39=path[_0xf5f2('0xe5')](_0x212d97,_0xf5f2('0x137')+_0x43ca34['id']+'-'+_0x26dc8c+'.pdf');var _0x346a95={'path':_0x319b39,'channel':_0xf5f2('0x126'),'interactionId':_0x43ca34['id']};return pdf[_0xf5f2('0x138')](_0x510f56,_0x346a95);})[_0xf5f2('0x22')](function(){return new BPromise(function(_0x249e9b,_0x56ab93){zipdir(_0x212d97,{'saveTo':_0x3712e3},function(_0x21fce7,_0x38a5e3){if(_0x21fce7)return _0x56ab93(_0x21fce7);return _0x249e9b(_0x38a5e3);});})[_0xf5f2('0x22')](function(){return new BPromise(function(_0x4d8a71,_0x1ca92b){rimraf(_0x212d97,function(_0x486c5e){if(_0x486c5e)_0x1ca92b(_0x486c5e);return _0x4d8a71();});});})[_0xf5f2('0x22')](function(){return _0x4f777b[_0xf5f2('0xe8')](_0x3712e3,_0x8ee5fd,function(_0x5089c1){if(_0x5089c1){console[_0xf5f2('0x139')](_0xf5f2('0x13a'),_0x5089c1);}else{fs[_0xf5f2('0x13b')](_0x3712e3);}});});});}else{return _0x4f777b['sendStatus'](0xc8);}})[_0xf5f2('0x2c')](handleError(_0x4f777b,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index a33cd6c..09ce161 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 _0x015f=['hasOwnProperty','hook','ChatInteraction','../../mysqldb','ChatMessage','save','update','remove','getUsers','then','setDataValue','findAll','unreadMessages','length','emit','catch'];(function(_0x27a74c,_0x1db582){var _0x4efe5b=function(_0x72b283){while(--_0x72b283){_0x27a74c['push'](_0x27a74c['shift']());}};_0x4efe5b(++_0x1db582);}(_0x015f,0xe2));var _0xf015=function(_0x1bbad0,_0x34e914){_0x1bbad0=_0x1bbad0-0x0;var _0x463383=_0x015f[_0x1bbad0];return _0x463383;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0xf015('0x0')];var ChatMessage=require(_0xf015('0x1'))['db'][_0xf015('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf015('0x3'),'afterUpdate':_0xf015('0x4'),'afterDestroy':_0xf015('0x5')};function emitEvent(_0x55d774){return function(_0x181fa5,_0x41e603,_0x53c40c){_0x181fa5[_0xf015('0x6')]({'attributes':['id'],'raw':!![]})[_0xf015('0x7')](function(_0x4fc355){_0x181fa5[_0xf015('0x8')]('Users',_0x4fc355['map'](function(_0xc6556){return{'id':_0xc6556['id']};}));return ChatMessage[_0xf015('0x9')]({'where':{'ChatInteractionId':_0x181fa5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf015('0x7')](function(_0x577ca8){_0x181fa5['setDataValue'](_0xf015('0xa'),_0x577ca8[_0xf015('0xb')]);ChatInteractionEvents[_0xf015('0xc')](_0x55d774+':'+_0x181fa5['id'],_0x181fa5);ChatInteractionEvents[_0xf015('0xc')](_0x55d774,_0x181fa5);_0x53c40c(null);})[_0xf015('0xd')](_0x53c40c(null));};}for(var e in events){if(events[_0xf015('0xe')](e)){var event=events[e];ChatInteraction[_0xf015('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x1e66=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','update','then','map','findAll','setDataValue','emit','catch'];(function(_0x1842e4,_0x4b67d5){var _0x456a40=function(_0x5058d5){while(--_0x5058d5){_0x1842e4['push'](_0x1842e4['shift']());}};_0x456a40(++_0x4b67d5);}(_0x1e66,0xd5));var _0x61e6=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x1e66[_0x1e3c16];return _0x47a0c9;};'use strict';var EventEmitter=require(_0x61e6('0x0'));var ChatInteraction=require(_0x61e6('0x1'))['db'][_0x61e6('0x2')];var ChatMessage=require(_0x61e6('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x61e6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x61e6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x255f39){return function(_0x19ee02,_0x5b1a6d,_0x31618c){_0x19ee02['getUsers']({'attributes':['id'],'raw':!![]})[_0x61e6('0x5')](function(_0x21cefe){_0x19ee02['setDataValue']('Users',_0x21cefe[_0x61e6('0x6')](function(_0x3e73f6){return{'id':_0x3e73f6['id']};}));return ChatMessage[_0x61e6('0x7')]({'where':{'ChatInteractionId':_0x19ee02['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x12eca3){_0x19ee02[_0x61e6('0x8')]('unreadMessages',_0x12eca3['length']);ChatInteractionEvents[_0x61e6('0x9')](_0x255f39+':'+_0x19ee02['id'],_0x19ee02);ChatInteractionEvents[_0x61e6('0x9')](_0x255f39,_0x19ee02);_0x31618c(null);})[_0x61e6('0xa')](_0x31618c(null));};}for(var e in events){if(events[_0x61e6('0xb')](e)){var event=events[e];ChatInteraction[_0x61e6('0xc')](e,emitEvent(event));}}module[_0x61e6('0xd')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index e4abf74..b9425f1 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 _0xe6c8=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','changed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x31de52,_0x19b57f){var _0x4b3d88=function(_0x4fc7e2){while(--_0x4fc7e2){_0x31de52['push'](_0x31de52['shift']());}};_0x4b3d88(++_0x19b57f);}(_0xe6c8,0x192));var _0x8e6c=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xe6c8[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x8e6c('0x0'));var util=require(_0x8e6c('0x1'));var logger=require(_0x8e6c('0x2'))(_0x8e6c('0x3'));var moment=require(_0x8e6c('0x4'));var BPromise=require(_0x8e6c('0x5'));var rp=require(_0x8e6c('0x6'));var fs=require('fs');var path=require(_0x8e6c('0x7'));var rimraf=require(_0x8e6c('0x8'));var config=require(_0x8e6c('0x9'));var attributes=require(_0x8e6c('0xa'));module['exports']=function(_0x117007,_0x2e5856){return _0x117007[_0x8e6c('0xb')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x490bb2,_0x4110ce,_0x149174){if(_0x490bb2[_0x8e6c('0xc')]('closed')){_0x490bb2['closedAt']=moment()[_0x8e6c('0xd')](_0x8e6c('0xe'));}_0x149174(null,_0x490bb2);}},'charset':_0x8e6c('0xf'),'collate':_0x8e6c('0x10')});};
\ No newline at end of file
+var _0x6afa=['./chatInteraction.attributes','define','ChatInteraction','changed','format','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xc93e24,_0x3fe75e){var _0x32a649=function(_0x4f7b12){while(--_0x4f7b12){_0xc93e24['push'](_0xc93e24['shift']());}};_0x32a649(++_0x3fe75e);}(_0x6afa,0x13a));var _0xa6af=function(_0x50bf72,_0x5ae1a6){_0x50bf72=_0x50bf72-0x0;var _0x2f2574=_0x6afa[_0x50bf72];return _0x2f2574;};'use strict';var _=require(_0xa6af('0x0'));var util=require(_0xa6af('0x1'));var logger=require(_0xa6af('0x2'))('api');var moment=require(_0xa6af('0x3'));var BPromise=require('bluebird');var rp=require(_0xa6af('0x4'));var fs=require('fs');var path=require(_0xa6af('0x5'));var rimraf=require(_0xa6af('0x6'));var config=require(_0xa6af('0x7'));var attributes=require(_0xa6af('0x8'));module['exports']=function(_0x1c992a,_0x40340e){return _0x1c992a[_0xa6af('0x9')](_0xa6af('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5233af,_0x26f720,_0x3666a1){if(_0x5233af[_0xa6af('0xb')]('closed')){_0x5233af['closedAt']=moment()[_0xa6af('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3666a1(null,_0x5233af);}},'charset':'utf8mb4','collate':_0xa6af('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 57e57d3..ca0707e 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 _0x1a71=['register','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','then','AddTagsToChatInteraction','find','addTags','body','ids','omit','spread','AddTags','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket'];(function(_0x5a6402,_0x4062a9){var _0x134b49=function(_0x416f0b){while(--_0x416f0b){_0x5a6402['push'](_0x5a6402['shift']());}};_0x134b49(++_0x4062a9);}(_0x1a71,0x157));var _0x11a7=function(_0x16b1b8,_0x432d03){_0x16b1b8=_0x16b1b8-0x0;var _0x558b1e=_0x1a71[_0x16b1b8];return _0x558b1e;};'use strict';var _=require(_0x11a7('0x0'));var util=require(_0x11a7('0x1'));var moment=require(_0x11a7('0x2'));var BPromise=require('bluebird');var rs=require(_0x11a7('0x3'));var fs=require('fs');var Redis=require(_0x11a7('0x4'));var db=require(_0x11a7('0x5'))['db'];var utils=require(_0x11a7('0x6'));var logger=require(_0x11a7('0x7'))(_0x11a7('0x8'));var config=require(_0x11a7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x11a7('0xa')][_0x11a7('0xb')]({'port':0x232a});config[_0x11a7('0xc')]=_[_0x11a7('0xd')](config['redis'],{'host':_0x11a7('0xe'),'port':0x18eb});var socket=require(_0x11a7('0xf'))(new Redis(config['redis']));require(_0x11a7('0x10'))[_0x11a7('0x11')](socket);function respondWithRpcPromise(_0x162563,_0x323998,_0x1262ae){return new BPromise(function(_0x3ad9a3,_0x26f578){return client[_0x11a7('0x12')](_0x162563,_0x1262ae)['then'](function(_0x5b9f6b){logger['info'](_0x11a7('0x13'),_0x323998,_0x11a7('0x14'));logger[_0x11a7('0x15')](_0x11a7('0x16'),_0x323998,'request\x20sent',JSON['stringify'](_0x5b9f6b));if(_0x5b9f6b[_0x11a7('0x17')]){if(_0x5b9f6b[_0x11a7('0x17')][_0x11a7('0x18')]===0x1f4){logger[_0x11a7('0x17')](_0x11a7('0x13'),_0x323998,_0x5b9f6b[_0x11a7('0x17')]['message']);return _0x26f578(_0x5b9f6b[_0x11a7('0x17')][_0x11a7('0x19')]);}logger[_0x11a7('0x17')](_0x11a7('0x13'),_0x323998,_0x5b9f6b['error'][_0x11a7('0x19')]);return _0x3ad9a3(_0x5b9f6b[_0x11a7('0x17')]['message']);}else{logger[_0x11a7('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x323998,_0x11a7('0x14'));_0x3ad9a3(_0x5b9f6b[_0x11a7('0x1b')][_0x11a7('0x19')]);}})[_0x11a7('0x1c')](function(_0x4facb5){logger[_0x11a7('0x17')](_0x11a7('0x13'),_0x323998,_0x4facb5);_0x26f578(_0x4facb5);});});}exports[_0x11a7('0x1d')]=function(_0x4f908c){var _0x2785fe=this;return new Promise(function(_0x22c725,_0x36ee03){return db[_0x11a7('0x1e')][_0x11a7('0x1f')](_0x4f908c['body'],{'raw':_0x4f908c[_0x11a7('0x20')]?_0x4f908c[_0x11a7('0x20')][_0x11a7('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f908c[_0x11a7('0x20')]?_0x4f908c[_0x11a7('0x20')][_0x11a7('0x22')]||null:null,'attributes':_0x4f908c['options']?_0x4f908c[_0x11a7('0x20')]['attributes']||null:null,'limit':_0x4f908c[_0x11a7('0x20')]?_0x4f908c[_0x11a7('0x20')]['limit']||null:null})[_0x11a7('0x23')](function(_0x1b3bfb){logger[_0x11a7('0x1a')](_0x11a7('0x1d'),_0x4f908c);logger[_0x11a7('0x15')](_0x11a7('0x1d'),_0x4f908c,JSON['stringify'](_0x1b3bfb));_0x22c725(_0x1b3bfb);})[_0x11a7('0x1c')](function(_0x45ffd2){logger[_0x11a7('0x17')]('UpdateChatInteraction',_0x45ffd2[_0x11a7('0x19')],_0x4f908c);_0x36ee03(_0x2785fe[_0x11a7('0x17')](0x1f4,_0x45ffd2[_0x11a7('0x19')]));});});};exports[_0x11a7('0x24')]=function(_0x5126f7){return new Promise(function(_0x19bdfb,_0x3c85da){return db['ChatInteraction'][_0x11a7('0x25')]({'where':_0x5126f7[_0x11a7('0x20')]?_0x5126f7['options']['where']||null:null})[_0x11a7('0x23')](function(_0x452db3){if(_0x452db3){return _0x452db3[_0x11a7('0x26')](_0x5126f7[_0x11a7('0x27')][_0x11a7('0x28')],_[_0x11a7('0x29')](_0x5126f7[_0x11a7('0x27')],[_0x11a7('0x28'),'id'])||{});}})[_0x11a7('0x2a')](function(_0x5f69ab){logger[_0x11a7('0x1a')]('AddTags',_0x5126f7);logger[_0x11a7('0x15')](_0x11a7('0x2b'),_0x5126f7,JSON[_0x11a7('0x2c')](_0x5f69ab));_0x19bdfb(_0x5f69ab);})['catch'](function(_0x3a1194){logger['error'](_0x11a7('0x2b'),_0x3a1194[_0x11a7('0x19')],_0x5126f7);_0x3c85da(_this[_0x11a7('0x17')](0x1f4,_0x3a1194[_0x11a7('0x19')]));});});};
\ No newline at end of file
+var _0x602c=['info','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','./chatInteraction.socket','register','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','update','body','options','where','attributes','limit','then'];(function(_0x115f70,_0x18a247){var _0x251562=function(_0x29adcf){while(--_0x29adcf){_0x115f70['push'](_0x115f70['shift']());}};_0x251562(++_0x18a247);}(_0x602c,0xcf));var _0xc602=function(_0x376c3c,_0x4fcf2c){_0x376c3c=_0x376c3c-0x0;var _0x46aefe=_0x602c[_0x376c3c];return _0x46aefe;};'use strict';var _=require(_0xc602('0x0'));var util=require(_0xc602('0x1'));var moment=require(_0xc602('0x2'));var BPromise=require(_0xc602('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc602('0x4'))['db'];var utils=require(_0xc602('0x5'));var logger=require('../../config/logger')(_0xc602('0x6'));var config=require('../../config/environment');var jayson=require(_0xc602('0x7'));var client=jayson['client'][_0xc602('0x8')]({'port':0x232a});config[_0xc602('0x9')]=_[_0xc602('0xa')](config[_0xc602('0x9')],{'host':_0xc602('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc602('0x9')]));require(_0xc602('0xc'))[_0xc602('0xd')](socket);function respondWithRpcPromise(_0x2c6534,_0x45f51a,_0x2117c6){return new BPromise(function(_0x22e2a4,_0x3e6cdd){return client[_0xc602('0xe')](_0x2c6534,_0x2117c6)['then'](function(_0x186924){logger['info'](_0xc602('0xf'),_0x45f51a,_0xc602('0x10'));logger[_0xc602('0x11')](_0xc602('0x12'),_0x45f51a,_0xc602('0x10'),JSON[_0xc602('0x13')](_0x186924));if(_0x186924['error']){if(_0x186924[_0xc602('0x14')][_0xc602('0x15')]===0x1f4){logger['error'](_0xc602('0xf'),_0x45f51a,_0x186924[_0xc602('0x14')][_0xc602('0x16')]);return _0x3e6cdd(_0x186924['error'][_0xc602('0x16')]);}logger[_0xc602('0x14')](_0xc602('0xf'),_0x45f51a,_0x186924['error'][_0xc602('0x16')]);return _0x22e2a4(_0x186924['error']['message']);}else{logger['info'](_0xc602('0xf'),_0x45f51a,_0xc602('0x10'));_0x22e2a4(_0x186924[_0xc602('0x17')][_0xc602('0x16')]);}})[_0xc602('0x18')](function(_0xbce0fb){logger[_0xc602('0x14')](_0xc602('0xf'),_0x45f51a,_0xbce0fb);_0x3e6cdd(_0xbce0fb);});});}exports[_0xc602('0x19')]=function(_0x25e828){var _0x415c33=this;return new Promise(function(_0x8b479c,_0x232b54){return db['ChatInteraction'][_0xc602('0x1a')](_0x25e828[_0xc602('0x1b')],{'raw':_0x25e828[_0xc602('0x1c')]?_0x25e828[_0xc602('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25e828['options']?_0x25e828['options'][_0xc602('0x1d')]||null:null,'attributes':_0x25e828['options']?_0x25e828['options'][_0xc602('0x1e')]||null:null,'limit':_0x25e828[_0xc602('0x1c')]?_0x25e828[_0xc602('0x1c')][_0xc602('0x1f')]||null:null})[_0xc602('0x20')](function(_0x3153f7){logger[_0xc602('0x21')](_0xc602('0x19'),_0x25e828);logger[_0xc602('0x11')](_0xc602('0x19'),_0x25e828,JSON[_0xc602('0x13')](_0x3153f7));_0x8b479c(_0x3153f7);})[_0xc602('0x18')](function(_0x5a1a0a){logger[_0xc602('0x14')](_0xc602('0x19'),_0x5a1a0a['message'],_0x25e828);_0x232b54(_0x415c33[_0xc602('0x14')](0x1f4,_0x5a1a0a[_0xc602('0x16')]));});});};exports[_0xc602('0x22')]=function(_0x44b5c4){return new Promise(function(_0x552e6e,_0xba061e){return db['ChatInteraction'][_0xc602('0x23')]({'where':_0x44b5c4[_0xc602('0x1c')]?_0x44b5c4['options']['where']||null:null})[_0xc602('0x20')](function(_0xc00164){if(_0xc00164){return _0xc00164[_0xc602('0x24')](_0x44b5c4[_0xc602('0x1b')][_0xc602('0x25')],_[_0xc602('0x26')](_0x44b5c4[_0xc602('0x1b')],['ids','id'])||{});}})['spread'](function(_0x9c973b){logger['info']('AddTags',_0x44b5c4);logger[_0xc602('0x11')](_0xc602('0x27'),_0x44b5c4,JSON[_0xc602('0x13')](_0x9c973b));_0x552e6e(_0x9c973b);})[_0xc602('0x18')](function(_0x51f225){logger[_0xc602('0x14')](_0xc602('0x27'),_0x51f225[_0xc602('0x16')],_0x44b5c4);_0xba061e(_this[_0xc602('0x14')](0x1f4,_0x51f225[_0xc602('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 9e4cbb1..ca2adfe 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 _0xa363=['emit','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x962bb5,_0x26cb1d){var _0x549440=function(_0x1f30b9){while(--_0x1f30b9){_0x962bb5['push'](_0x962bb5['shift']());}};_0x549440(++_0x26cb1d);}(_0xa363,0x19b));var _0x3a36=function(_0x36e0f6,_0x4da6a7){_0x36e0f6=_0x36e0f6-0x0;var _0xc90479=_0xa363[_0x36e0f6];return _0xc90479;};'use strict';var ChatInteractionEvents=require(_0x3a36('0x0'));var events=[_0x3a36('0x1'),_0x3a36('0x2'),'update'];function createListener(_0x618035,_0x3802e8){return function(_0x8e5ead){_0x3802e8[_0x3a36('0x3')](_0x618035,_0x8e5ead);};}function removeListener(_0x1b3568,_0x1c66c1){return function(){ChatInteractionEvents['removeListener'](_0x1b3568,_0x1c66c1);};}exports['register']=function(_0x228667){for(var _0x4365dd=0x0,_0x1bb114=events[_0x3a36('0x4')];_0x4365dd<_0x1bb114;_0x4365dd++){var _0x32d82f=events[_0x4365dd];var _0x9c0ba7=createListener(_0x3a36('0x5')+_0x32d82f,_0x228667);ChatInteractionEvents['on'](_0x32d82f,_0x9c0ba7);}};
\ No newline at end of file
+var _0xf498=['update','removeListener','register','length','chatInteraction:','./chatInteraction.events','remove'];(function(_0x2e2b76,_0x2460ae){var _0x4da918=function(_0x2c8fc7){while(--_0x2c8fc7){_0x2e2b76['push'](_0x2e2b76['shift']());}};_0x4da918(++_0x2460ae);}(_0xf498,0x108));var _0x8f49=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xf498[_0xc4001c];return _0x49f7bc;};'use strict';var ChatInteractionEvents=require(_0x8f49('0x0'));var events=['save',_0x8f49('0x1'),_0x8f49('0x2')];function createListener(_0x50b4c0,_0x32eac0){return function(_0x213aa6){_0x32eac0['emit'](_0x50b4c0,_0x213aa6);};}function removeListener(_0x54f3bf,_0x3800e4){return function(){ChatInteractionEvents[_0x8f49('0x3')](_0x54f3bf,_0x3800e4);};}exports[_0x8f49('0x4')]=function(_0x52521d){for(var _0x2be802=0x0,_0x25d471=events[_0x8f49('0x5')];_0x2be802<_0x25d471;_0x2be802++){var _0x211b5b=events[_0x2be802];var _0x5b563b=createListener(_0x8f49('0x6')+_0x211b5b,_0x52521d);ChatInteractionEvents['on'](_0x211b5b,_0x5b563b);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 7c8c5cf..6c8f026 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 _0xa91d=['/:id/tags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/attachment_download','isChatInteractionAuthorized','/:id/messages','getMessages','getMyMessages','/:id/download','post','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','chat','put','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete'];(function(_0x49e734,_0xc04f4f){var _0x2a2d42=function(_0x564e55){while(--_0x564e55){_0x49e734['push'](_0x49e734['shift']());}};_0x2a2d42(++_0xc04f4f);}(_0xa91d,0x167));var _0xda91=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa91d[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xda91('0x0'));var util=require('util');var path=require(_0xda91('0x1'));var timeout=require(_0xda91('0x2'));var express=require(_0xda91('0x3'));var router=express[_0xda91('0x4')]();var fs_extra=require(_0xda91('0x5'));var auth=require(_0xda91('0x6'));var interaction=require(_0xda91('0x7'));var config=require(_0xda91('0x8'));var controller=require(_0xda91('0x9'));router[_0xda91('0xa')]('/',auth[_0xda91('0xb')](),controller[_0xda91('0xc')]);router[_0xda91('0xa')](_0xda91('0xd'),auth[_0xda91('0xb')](),controller[_0xda91('0xe')]);router[_0xda91('0xa')](_0xda91('0xf'),auth['isChatInteractionAuthorized'](),controller['show']);router[_0xda91('0xa')](_0xda91('0x10'),auth[_0xda91('0x11')](),controller['attachmentDownload']);router['get'](_0xda91('0x12'),auth[_0xda91('0xb')](),controller[_0xda91('0x13')]);router['get']('/:id/my_messages',auth[_0xda91('0x11')](),controller[_0xda91('0x14')]);router['get'](_0xda91('0x15'),auth[_0xda91('0xb')](),controller['download']);router[_0xda91('0x16')]('/',auth[_0xda91('0xb')](),controller['create']);router[_0xda91('0x16')](_0xda91('0x17'),auth[_0xda91('0xb')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xda91('0x18')]({'destination':function(_0x530c4b,_0x29f694,_0x24f9da){_0x24f9da(null,path[_0xda91('0x19')](config[_0xda91('0x1a')],_0xda91('0x1b')));},'filename':function(_0x16f81e,_0x257d4a,_0x327b2b){_0x327b2b(null,util[_0xda91('0x1c')]('%s-%s',Date[_0xda91('0x1d')](),_0x257d4a[_0xda91('0x1e')][_0xda91('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xda91('0x16')](_0xda91('0x20'),upload[_0xda91('0x21')](_0xda91('0x22')),controller[_0xda91('0x23')]);router['post'](_0xda91('0x12'),auth[_0xda91('0x11')](),controller[_0xda91('0x24')]);router[_0xda91('0x16')]('/:id/tags',auth[_0xda91('0xb')](),interaction['tracked'](_0xda91('0x25'),'chatinteraction:addtags'),controller['addTags']);router[_0xda91('0x26')]('/:id',auth['isAuthenticated'](),interaction[_0xda91('0x27')](_0xda91('0x25'),_0xda91('0x28')),controller[_0xda91('0x29')]);router[_0xda91('0x26')](_0xda91('0x2a'),controller[_0xda91('0x2b')]);router[_0xda91('0x26')](_0xda91('0x2c'),auth[_0xda91('0x11')](),controller[_0xda91('0x2d')]);router['put'](_0xda91('0x2e'),controller[_0xda91('0x2f')]);router[_0xda91('0x30')](_0xda91('0xf'),auth[_0xda91('0xb')](),interaction[_0xda91('0x27')](_0xda91('0x25'),'chatinteraction:destroy'),controller['destroy']);router[_0xda91('0x30')](_0xda91('0x31'),auth['isAuthenticated'](),controller['removeTags']);module[_0xda91('0x32')]=router;
\ No newline at end of file
+var _0xcfc8=['%s-%s','now','originalname','replace','/:id/attachment_upload','file','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','/:id/custom_update','customUpdate','/:id/abandon','abandon','chatinteraction:destroy','destroy','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized','show','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','root','server/files/attachments/','format'];(function(_0x417452,_0x19ecdd){var _0x326b75=function(_0x1d817e){while(--_0x1d817e){_0x417452['push'](_0x417452['shift']());}};_0x326b75(++_0x19ecdd);}(_0xcfc8,0x150));var _0x8cfc=function(_0x19b6bc,_0x14f3cf){_0x19b6bc=_0x19b6bc-0x0;var _0x3a7172=_0xcfc8[_0x19b6bc];return _0x3a7172;};'use strict';var multer=require(_0x8cfc('0x0'));var util=require(_0x8cfc('0x1'));var path=require(_0x8cfc('0x2'));var timeout=require('connect-timeout');var express=require(_0x8cfc('0x3'));var router=express['Router']();var fs_extra=require(_0x8cfc('0x4'));var auth=require(_0x8cfc('0x5'));var interaction=require(_0x8cfc('0x6'));var config=require('../../config/environment');var controller=require(_0x8cfc('0x7'));router[_0x8cfc('0x8')]('/',auth[_0x8cfc('0x9')](),controller['index']);router[_0x8cfc('0x8')](_0x8cfc('0xa'),auth[_0x8cfc('0x9')](),controller['describe']);router[_0x8cfc('0x8')](_0x8cfc('0xb'),auth[_0x8cfc('0xc')](),controller[_0x8cfc('0xd')]);router['get']('/:id/attachment_download',auth[_0x8cfc('0xc')](),controller['attachmentDownload']);router[_0x8cfc('0x8')](_0x8cfc('0xe'),auth[_0x8cfc('0x9')](),controller['getMessages']);router[_0x8cfc('0x8')](_0x8cfc('0xf'),auth[_0x8cfc('0xc')](),controller[_0x8cfc('0x10')]);router[_0x8cfc('0x8')](_0x8cfc('0x11'),auth['isAuthenticated'](),controller[_0x8cfc('0x12')]);router['post']('/',auth[_0x8cfc('0x9')](),controller['create']);router[_0x8cfc('0x13')]('/:id/vidaoo',auth[_0x8cfc('0x9')](),controller[_0x8cfc('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5945d6,_0x3965de,_0x106afe){_0x106afe(null,path['join'](config[_0x8cfc('0x15')],_0x8cfc('0x16')));},'filename':function(_0x2df7dd,_0x16a616,_0x58a6d2){_0x58a6d2(null,util[_0x8cfc('0x17')](_0x8cfc('0x18'),Date[_0x8cfc('0x19')](),_0x16a616[_0x8cfc('0x1a')][_0x8cfc('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8cfc('0x13')](_0x8cfc('0x1c'),upload['single'](_0x8cfc('0x1d')),controller['attachmentUpload']);router[_0x8cfc('0x13')]('/:id/messages',auth[_0x8cfc('0xc')](),controller[_0x8cfc('0x1e')]);router['post'](_0x8cfc('0x1f'),auth[_0x8cfc('0x9')](),interaction['tracked'](_0x8cfc('0x20'),_0x8cfc('0x21')),controller[_0x8cfc('0x22')]);router[_0x8cfc('0x23')](_0x8cfc('0xb'),auth['isAuthenticated'](),interaction[_0x8cfc('0x24')](_0x8cfc('0x20'),'chatinteraction:update'),controller['update']);router[_0x8cfc('0x23')](_0x8cfc('0x25'),controller[_0x8cfc('0x26')]);router[_0x8cfc('0x23')](_0x8cfc('0x27'),auth[_0x8cfc('0xc')](),controller[_0x8cfc('0x28')]);router['put']('/:id/close',controller['close']);router['delete'](_0x8cfc('0xb'),auth[_0x8cfc('0x9')](),interaction[_0x8cfc('0x24')](_0x8cfc('0x20'),_0x8cfc('0x29')),controller[_0x8cfc('0x2a')]);router[_0x8cfc('0x2b')](_0x8cfc('0x1f'),auth['isAuthenticated'](),controller['removeTags']);module[_0x8cfc('0x2c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 42101f7..e025b1f 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 _0x5629=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x2138e7,_0x235c2d){var _0x2504d6=function(_0x37e191){while(--_0x37e191){_0x2138e7['push'](_0x2138e7['shift']());}};_0x2504d6(++_0x235c2d);}(_0x5629,0x1e4));var _0x9562=function(_0x4c1378,_0x100a00){_0x4c1378=_0x4c1378-0x0;var _0x34083c=_0x5629[_0x4c1378];return _0x34083c;};'use strict';var Sequelize=require(_0x9562('0x0'));module[_0x9562('0x1')]={'body':{'type':Sequelize[_0x9562('0x2')](_0x9562('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9562('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9562('0x5')]}};
\ No newline at end of file
+var _0x7979=['medium','BOOLEAN','INTEGER','exports','TEXT'];(function(_0x58ae0a,_0x3e120d){var _0x394c2d=function(_0xdded18){while(--_0xdded18){_0x58ae0a['push'](_0x58ae0a['shift']());}};_0x394c2d(++_0x3e120d);}(_0x7979,0x1b1));var _0x9797=function(_0x439a7e,_0x301aa4){_0x439a7e=_0x439a7e-0x0;var _0x369a5f=_0x7979[_0x439a7e];return _0x369a5f;};'use strict';var Sequelize=require('sequelize');module[_0x9797('0x0')]={'body':{'type':Sequelize[_0x9797('0x1')](_0x9797('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9797('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9797('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 9c9b486..fe47824 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 _0x5fa6=['sendStatus','offset','undefined','count','limit','Content-Range','json','apply','reject','update','then','status','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','map','VIRTUAL','include','rows','catch','show','includeAll','options','find','create','body','params','destroy','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','sort','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','findAll','isEmpty','resourceId','push','length','FromId','ToId','read','-createdAt','all','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0xda2dd1,_0x2fe6a8){var _0x43637e=function(_0x1a1753){while(--_0x1a1753){_0xda2dd1['push'](_0xda2dd1['shift']());}};_0x43637e(++_0x2fe6a8);}(_0x5fa6,0xc0));var _0x65fa=function(_0x21f013,_0x3a2050){_0x21f013=_0x21f013-0x0;var _0x1addf8=_0x5fa6[_0x21f013];return _0x1addf8;};'use strict';var emlformat=require(_0x65fa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x65fa('0x1'));var rp=require(_0x65fa('0x2'));var moment=require(_0x65fa('0x3'));var BPromise=require(_0x65fa('0x4'));var Mustache=require('mustache');var util=require(_0x65fa('0x5'));var path=require('path');var sox=require(_0x65fa('0x6'));var csv=require(_0x65fa('0x7'));var ejs=require(_0x65fa('0x8'));var fs=require('fs');var fs_extra=require(_0x65fa('0x9'));var _=require(_0x65fa('0xa'));var squel=require('squel');var crypto=require(_0x65fa('0xb'));var jsforce=require(_0x65fa('0xc'));var deskjs=require(_0x65fa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x65fa('0xe'));var Papa=require('papaparse');var Redis=require(_0x65fa('0xf'));var authService=require(_0x65fa('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x65fa('0x11'));var hardwareService=require(_0x65fa('0x12'));var logger=require(_0x65fa('0x13'))(_0x65fa('0x14'));var utils=require(_0x65fa('0x15'));var config=require(_0x65fa('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x65fa('0x17')]=_['defaults'](config[_0x65fa('0x17')],{'host':_0x65fa('0x18'),'port':0x18eb});var socket=require(_0x65fa('0x19'))(new Redis(config['redis']));require(_0x65fa('0x1a'))[_0x65fa('0x1b')](socket);function respondWithStatusCode(_0x140602,_0xad921){_0xad921=_0xad921||0xcc;return function(_0x2e9656){if(_0x2e9656){return _0x140602[_0x65fa('0x1c')](_0xad921);}return _0x140602['status'](_0xad921)['end']();};}function respondWithResult(_0x348f60,_0x330a49){_0x330a49=_0x330a49||0xc8;return function(_0x46ac07){if(_0x46ac07){return _0x348f60['status'](_0x330a49)['json'](_0x46ac07);}};}function respondWithFilteredResult(_0xcf9eb5,_0x148df3){return function(_0x137d39){if(_0x137d39){var _0x180849=typeof _0x148df3[_0x65fa('0x1d')]===_0x65fa('0x1e')&&typeof _0x148df3['limit']==='undefined';var _0x47514c=_0x137d39[_0x65fa('0x1f')];var _0x43ccc8=_0x180849?0x0:_0x148df3[_0x65fa('0x1d')];var _0x19e8fc=_0x180849?_0x137d39[_0x65fa('0x1f')]:_0x148df3[_0x65fa('0x1d')]+_0x148df3[_0x65fa('0x20')];var _0x5ee376;if(_0x19e8fc>=_0x47514c){_0x19e8fc=_0x47514c;_0x5ee376=0xc8;}else{_0x5ee376=0xce;}_0xcf9eb5['status'](_0x5ee376);return _0xcf9eb5['set'](_0x65fa('0x21'),_0x43ccc8+'-'+_0x19e8fc+'/'+_0x47514c)[_0x65fa('0x22')](_0x137d39);}return null;};}function patchUpdates(_0x319e13){return function(_0x1642c2){try{jsonpatch[_0x65fa('0x23')](_0x1642c2,_0x319e13,!![]);}catch(_0x4ce3ba){return BPromise[_0x65fa('0x24')](_0x4ce3ba);}return _0x1642c2['save']();};}function saveUpdates(_0x324325,_0x41afb2){return function(_0x1250a9){if(_0x1250a9){return _0x1250a9[_0x65fa('0x25')](_0x324325)['then'](function(_0x2bb5c8){return _0x2bb5c8;});}return null;};}function removeEntity(_0x19ee7e,_0x4e618a){return function(_0x3e832e){if(_0x3e832e){return _0x3e832e['destroy']()[_0x65fa('0x26')](function(){_0x19ee7e[_0x65fa('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fce19,_0x1cf44c){return function(_0x3934e5){if(!_0x3934e5){_0x2fce19[_0x65fa('0x1c')](0x194);}return _0x3934e5;};}function handleError(_0x21c752,_0x4ac566){_0x4ac566=_0x4ac566||0x1f4;return function(_0x22771e){logger['error'](_0x22771e[_0x65fa('0x28')]);if(_0x22771e[_0x65fa('0x29')]){delete _0x22771e[_0x65fa('0x29')];}_0x21c752[_0x65fa('0x27')](_0x4ac566)[_0x65fa('0x2a')](_0x22771e);};}exports[_0x65fa('0x2b')]=function(_0xda28c8,_0x374c09){var _0x3cca6c={},_0x1b71dd={},_0x5f39e9={'count':0x0,'rows':[]};var _0x1da79a=_['map'](db[_0x65fa('0x2c')][_0x65fa('0x2d')],function(_0x4f3f7a){return{'name':_0x4f3f7a[_0x65fa('0x2e')],'type':_0x4f3f7a[_0x65fa('0x2f')][_0x65fa('0x30')]};});_0x1b71dd['model']=_['map'](_0x1da79a,'name');_0x1b71dd['query']=_[_0x65fa('0x31')](_0xda28c8[_0x65fa('0x32')]);_0x1b71dd[_0x65fa('0x33')]=_[_0x65fa('0x34')](_0x1b71dd[_0x65fa('0x35')],_0x1b71dd[_0x65fa('0x32')]);_0x3cca6c[_0x65fa('0x36')]=_[_0x65fa('0x34')](_0x1b71dd[_0x65fa('0x35')],qs[_0x65fa('0x37')](_0xda28c8[_0x65fa('0x32')][_0x65fa('0x37')]));_0x3cca6c['attributes']=_0x3cca6c[_0x65fa('0x36')]['length']?_0x3cca6c['attributes']:_0x1b71dd[_0x65fa('0x35')];if(!_0xda28c8['query'][_0x65fa('0x38')](_0x65fa('0x39'))){_0x3cca6c[_0x65fa('0x20')]=qs['limit'](_0xda28c8[_0x65fa('0x32')][_0x65fa('0x20')]);_0x3cca6c[_0x65fa('0x1d')]=qs['offset'](_0xda28c8[_0x65fa('0x32')][_0x65fa('0x1d')]);}_0x3cca6c['order']=qs['sort'](_0xda28c8['query']['sort']);_0x3cca6c[_0x65fa('0x3a')]=qs[_0x65fa('0x33')](_[_0x65fa('0x3b')](_0xda28c8[_0x65fa('0x32')],_0x1b71dd[_0x65fa('0x33')]),_0x1da79a);if(_0xda28c8[_0x65fa('0x32')][_0x65fa('0x3c')]){_0x3cca6c[_0x65fa('0x3a')]=_[_0x65fa('0x3d')](_0x3cca6c[_0x65fa('0x3a')],{'$or':_[_0x65fa('0x3e')](_0x1da79a,function(_0x30f060){if(_0x30f060[_0x65fa('0x2f')]!==_0x65fa('0x3f')){var _0x133c76={};_0x133c76[_0x30f060['name']]={'$like':'%'+_0xda28c8['query'][_0x65fa('0x3c')]+'%'};return _0x133c76;}})});}_0x3cca6c=_['merge']({},_0x3cca6c,_0xda28c8['options']);var _0x4272d7={'where':_0x3cca6c[_0x65fa('0x3a')]};return db[_0x65fa('0x2c')][_0x65fa('0x1f')](_0x4272d7)['then'](function(_0x18ee2e){_0x5f39e9[_0x65fa('0x1f')]=_0x18ee2e;if(_0xda28c8[_0x65fa('0x32')]['includeAll']){_0x3cca6c[_0x65fa('0x40')]=[{'all':!![]}];}return db[_0x65fa('0x2c')]['findAll'](_0x3cca6c);})[_0x65fa('0x26')](function(_0x5b7df1){_0x5f39e9[_0x65fa('0x41')]=_0x5b7df1;return _0x5f39e9;})[_0x65fa('0x26')](respondWithFilteredResult(_0x374c09,_0x3cca6c))[_0x65fa('0x42')](handleError(_0x374c09,null));};exports[_0x65fa('0x43')]=function(_0x517c7c,_0xc066ef){var _0x538102={'raw':!![],'where':{'id':_0x517c7c['params']['id']}},_0x1a7b6b={};_0x1a7b6b['model']=_[_0x65fa('0x31')](db[_0x65fa('0x2c')][_0x65fa('0x2d')]);_0x1a7b6b[_0x65fa('0x32')]=_[_0x65fa('0x31')](_0x517c7c[_0x65fa('0x32')]);_0x1a7b6b[_0x65fa('0x33')]=_['intersection'](_0x1a7b6b[_0x65fa('0x35')],_0x1a7b6b['query']);_0x538102[_0x65fa('0x36')]=_[_0x65fa('0x34')](_0x1a7b6b[_0x65fa('0x35')],qs['fields'](_0x517c7c['query'][_0x65fa('0x37')]));_0x538102['attributes']=_0x538102[_0x65fa('0x36')]['length']?_0x538102[_0x65fa('0x36')]:_0x1a7b6b['model'];if(_0x517c7c[_0x65fa('0x32')][_0x65fa('0x44')]){_0x538102[_0x65fa('0x40')]=[{'all':!![]}];}_0x538102=_[_0x65fa('0x3d')]({},_0x538102,_0x517c7c[_0x65fa('0x45')]);return db[_0x65fa('0x2c')][_0x65fa('0x46')](_0x538102)[_0x65fa('0x26')](handleEntityNotFound(_0xc066ef,null))[_0x65fa('0x26')](respondWithResult(_0xc066ef,null))['catch'](handleError(_0xc066ef,null));};exports['create']=function(_0x4abbdf,_0x1b6fff){return db[_0x65fa('0x2c')][_0x65fa('0x47')](_0x4abbdf['body'],{})[_0x65fa('0x26')](respondWithResult(_0x1b6fff,0xc9))['catch'](handleError(_0x1b6fff,null));};exports['update']=function(_0x1459e6,_0x3bf3ea){if(_0x1459e6[_0x65fa('0x48')]['id']){delete _0x1459e6['body']['id'];}return db['ChatInternalMessage'][_0x65fa('0x46')]({'where':{'id':_0x1459e6[_0x65fa('0x49')]['id']}})[_0x65fa('0x26')](handleEntityNotFound(_0x3bf3ea,null))['then'](saveUpdates(_0x1459e6[_0x65fa('0x48')],null))[_0x65fa('0x26')](respondWithResult(_0x3bf3ea,null))[_0x65fa('0x42')](handleError(_0x3bf3ea,null));};exports[_0x65fa('0x4a')]=function(_0x456361,_0x57fc38){return db[_0x65fa('0x2c')][_0x65fa('0x46')]({'where':{'id':_0x456361[_0x65fa('0x49')]['id']}})[_0x65fa('0x26')](handleEntityNotFound(_0x57fc38,null))[_0x65fa('0x26')](removeEntity(_0x57fc38,null))[_0x65fa('0x42')](handleError(_0x57fc38,null));};exports['describe']=function(_0x5e8293,_0x3c1195){return db[_0x65fa('0x2c')]['describe']()[_0x65fa('0x26')](respondWithResult(_0x3c1195,null))[_0x65fa('0x42')](handleError(_0x3c1195,null));};function wrapUser(_0x56c50c){return function(_0xe6cb6d){var _0x26b275=_0x56c50c[_0x65fa('0x4b')]({'plain':!![]});_0x26b275[_0x65fa('0x4c')]=[];if(_0xe6cb6d){_0x26b275[_0x65fa('0x4d')]=_0xe6cb6d[_0x65fa('0x4e')];_0x26b275[_0x65fa('0x4f')]=_0xe6cb6d;}else{_0x26b275['lastMessageAt']=moment(0x0)['format'](_0x65fa('0x50'));_0x26b275[_0x65fa('0x4f')]={};}return _0x26b275;};}exports[_0x65fa('0x51')]=function(_0x3b2364,_0x54ab26,_0x4c543c){var _0x9f5eb0=[];return db[_0x65fa('0x52')]['findAll']({'where':{'role':[_0x65fa('0x53'),_0x65fa('0x54'),_0x65fa('0x55')]},'attributes':['id',_0x65fa('0x56'),_0x65fa('0x29'),_0x65fa('0x57'),_0x65fa('0x58'),_0x65fa('0x59'),'online',_0x65fa('0x5a'),_0x65fa('0x5b'),_0x65fa('0x5c')],'order':qs[_0x65fa('0x5d')]('-online'),'include':[{'model':db[_0x65fa('0x5e')],'as':'VoiceQueues','attributes':['id',_0x65fa('0x29'),'type'],'through':{'attributes':[]}}]})[_0x65fa('0x26')](function(_0x5be13f){if(_0x5be13f){var _0x876eb2=_0x3b2364[_0x65fa('0x55')][_0x65fa('0x4b')]({'plain':!![]});if(!_0x876eb2)throw new Error(_0x65fa('0x5f'));if(_0x876eb2[_0x65fa('0x57')]==='user'){return db[_0x65fa('0x60')]['find']({'where':{'name':'Agents','userProfileId':_0x876eb2[_0x65fa('0x61')]},'raw':!![]})[_0x65fa('0x26')](function(_0x42b3d9){if(_0x42b3d9){if(_0x42b3d9[_0x65fa('0x62')]===0x0){return db[_0x65fa('0x63')][_0x65fa('0x64')]({'where':{'sectionId':_0x42b3d9['id']},'raw':!![]})[_0x65fa('0x26')](function(_0x4f9dbd){var _0xf589bc=[];if(_[_0x65fa('0x65')](_0x4f9dbd)){_0xf589bc=_[_0x65fa('0x3c')](_0x5be13f,function(_0x2dc42d){if(_0x2dc42d[_0x65fa('0x57')]!==_0x65fa('0x53')){return _0x2dc42d;}});return _0xf589bc;}else{for(var _0xd5f6c2=0x0;_0xd5f6c2<_0x5be13f['length'];_0xd5f6c2++){var _0x4d3623=_0x5be13f[_0xd5f6c2];if(_0x4d3623[_0x65fa('0x57')]===_0x65fa('0x53')){var _0x4a5067=_[_0x65fa('0x46')](_0x4f9dbd,function(_0x26c0d8){return _0x26c0d8[_0x65fa('0x66')]===_0x4d3623['id'];});if(_0x4a5067)_0xf589bc[_0x65fa('0x67')](_0x4d3623);}else{_0xf589bc[_0x65fa('0x67')](_0x4d3623);}}return _0xf589bc;}});}else{return _0x5be13f;}}else{var _0x2f9f97=_[_0x65fa('0x3c')](_0x5be13f,function(_0x3b9e68){if(_0x3b9e68[_0x65fa('0x57')]!==_0x65fa('0x53')){return _0x3b9e68;}});return _0x2f9f97;}});}else{return _0x5be13f;}}})['then'](function(_0x4f2dc5){var _0x228ee1=[];if(_0x4f2dc5){_0x9f5eb0=_0x4f2dc5;for(var _0x18a070=0x0;_0x18a070<_0x4f2dc5[_0x65fa('0x68')];_0x18a070+=0x1){_0x9f5eb0[_0x18a070]['messages']=[];_0x228ee1[_0x65fa('0x67')](db[_0x65fa('0x2c')][_0x65fa('0x46')]({'where':{'FromId':[_0x3b2364[_0x65fa('0x55')]['id'],_0x4f2dc5[_0x18a070]['id']],'ToId':[_0x3b2364[_0x65fa('0x55')]['id'],_0x4f2dc5[_0x18a070]['id']],'ChatGroupId':null},'attributes':['id',_0x65fa('0x4e'),_0x65fa('0x69'),_0x65fa('0x6a'),_0x65fa('0x6b'),'body'],'order':qs['sort'](_0x65fa('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x65fa('0x26')](wrapUser(_0x4f2dc5[_0x18a070])));}return BPromise[_0x65fa('0x6d')](_0x228ee1);}return[];})[_0x65fa('0x26')](function(_0x4e56f9){return{'rows':_0x4e56f9,'count':_0x4e56f9[_0x65fa('0x68')]};})['then'](respondWithResult(_0x54ab26,null))[_0x65fa('0x42')](handleError(_0x54ab26,null));};
\ No newline at end of file
+var _0x0d24=['includeAll','findAll','params','rawAttributes','include','find','catch','create','body','describe','get','createdAt','lastMessage','lastMessageAt','getUsers','agent','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','filter','messages','FromId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','fieldName','type','key','model','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0d24,0x1d5));var _0x40d2=function(_0x2c0b2c,_0x59dbb2){_0x2c0b2c=_0x2c0b2c-0x0;var _0x2c3596=_0x0d24[_0x2c0b2c];return _0x2c3596;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x40d2('0x0'));var zipdir=require(_0x40d2('0x1'));var jsonpatch=require(_0x40d2('0x2'));var rp=require(_0x40d2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x40d2('0x4'));var util=require(_0x40d2('0x5'));var path=require(_0x40d2('0x6'));var sox=require('sox');var csv=require(_0x40d2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x40d2('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x40d2('0x9'));var Papa=require(_0x40d2('0xa'));var Redis=require(_0x40d2('0xb'));var authService=require(_0x40d2('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x40d2('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x40d2('0xe'))(_0x40d2('0xf'));var utils=require(_0x40d2('0x10'));var config=require(_0x40d2('0x11'));var licenseUtil=require(_0x40d2('0x12'));var db=require(_0x40d2('0x13'))['db'];config[_0x40d2('0x14')]=_[_0x40d2('0x15')](config[_0x40d2('0x14')],{'host':_0x40d2('0x16'),'port':0x18eb});var socket=require(_0x40d2('0x17'))(new Redis(config['redis']));require(_0x40d2('0x18'))[_0x40d2('0x19')](socket);function respondWithStatusCode(_0x3eb9d7,_0x2917b3){_0x2917b3=_0x2917b3||0xcc;return function(_0x5ecd7b){if(_0x5ecd7b){return _0x3eb9d7[_0x40d2('0x1a')](_0x2917b3);}return _0x3eb9d7['status'](_0x2917b3)[_0x40d2('0x1b')]();};}function respondWithResult(_0x52ab09,_0x508e91){_0x508e91=_0x508e91||0xc8;return function(_0x638d73){if(_0x638d73){return _0x52ab09[_0x40d2('0x1c')](_0x508e91)[_0x40d2('0x1d')](_0x638d73);}};}function respondWithFilteredResult(_0x4648e6,_0x564401){return function(_0x1a34cc){if(_0x1a34cc){var _0x69817=typeof _0x564401[_0x40d2('0x1e')]===_0x40d2('0x1f')&&typeof _0x564401[_0x40d2('0x20')]===_0x40d2('0x1f');var _0x299df1=_0x1a34cc['count'];var _0x5b02d4=_0x69817?0x0:_0x564401[_0x40d2('0x1e')];var _0x1692ee=_0x69817?_0x1a34cc[_0x40d2('0x21')]:_0x564401[_0x40d2('0x1e')]+_0x564401[_0x40d2('0x20')];var _0x4ead66;if(_0x1692ee>=_0x299df1){_0x1692ee=_0x299df1;_0x4ead66=0xc8;}else{_0x4ead66=0xce;}_0x4648e6[_0x40d2('0x1c')](_0x4ead66);return _0x4648e6[_0x40d2('0x22')](_0x40d2('0x23'),_0x5b02d4+'-'+_0x1692ee+'/'+_0x299df1)[_0x40d2('0x1d')](_0x1a34cc);}return null;};}function patchUpdates(_0x375cf5){return function(_0x5e2017){try{jsonpatch['apply'](_0x5e2017,_0x375cf5,!![]);}catch(_0x12b2ef){return BPromise[_0x40d2('0x24')](_0x12b2ef);}return _0x5e2017[_0x40d2('0x25')]();};}function saveUpdates(_0x1437a7,_0x31a528){return function(_0x21977d){if(_0x21977d){return _0x21977d[_0x40d2('0x26')](_0x1437a7)[_0x40d2('0x27')](function(_0x45922f){return _0x45922f;});}return null;};}function removeEntity(_0x843b60,_0x595e8e){return function(_0x27543c){if(_0x27543c){return _0x27543c[_0x40d2('0x28')]()[_0x40d2('0x27')](function(){_0x843b60[_0x40d2('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a338f,_0x38b0dc){return function(_0x45313b){if(!_0x45313b){_0x1a338f[_0x40d2('0x1a')](0x194);}return _0x45313b;};}function handleError(_0x33bf17,_0x379a7e){_0x379a7e=_0x379a7e||0x1f4;return function(_0x19a39f){logger[_0x40d2('0x29')](_0x19a39f[_0x40d2('0x2a')]);if(_0x19a39f[_0x40d2('0x2b')]){delete _0x19a39f['name'];}_0x33bf17['status'](_0x379a7e)[_0x40d2('0x2c')](_0x19a39f);};}exports[_0x40d2('0x2d')]=function(_0x4cd53e,_0x288581){var _0xd9eaca={},_0x3bf290={},_0xc463c4={'count':0x0,'rows':[]};var _0x226f57=_[_0x40d2('0x2e')](db[_0x40d2('0x2f')]['rawAttributes'],function(_0x338a38){return{'name':_0x338a38[_0x40d2('0x30')],'type':_0x338a38[_0x40d2('0x31')][_0x40d2('0x32')]};});_0x3bf290[_0x40d2('0x33')]=_[_0x40d2('0x2e')](_0x226f57,_0x40d2('0x2b'));_0x3bf290['query']=_[_0x40d2('0x34')](_0x4cd53e['query']);_0x3bf290[_0x40d2('0x35')]=_[_0x40d2('0x36')](_0x3bf290['model'],_0x3bf290['query']);_0xd9eaca[_0x40d2('0x37')]=_[_0x40d2('0x36')](_0x3bf290[_0x40d2('0x33')],qs['fields'](_0x4cd53e['query'][_0x40d2('0x38')]));_0xd9eaca[_0x40d2('0x37')]=_0xd9eaca[_0x40d2('0x37')][_0x40d2('0x39')]?_0xd9eaca[_0x40d2('0x37')]:_0x3bf290[_0x40d2('0x33')];if(!_0x4cd53e[_0x40d2('0x3a')][_0x40d2('0x3b')](_0x40d2('0x3c'))){_0xd9eaca[_0x40d2('0x20')]=qs[_0x40d2('0x20')](_0x4cd53e['query'][_0x40d2('0x20')]);_0xd9eaca[_0x40d2('0x1e')]=qs[_0x40d2('0x1e')](_0x4cd53e[_0x40d2('0x3a')][_0x40d2('0x1e')]);}_0xd9eaca['order']=qs[_0x40d2('0x3d')](_0x4cd53e[_0x40d2('0x3a')][_0x40d2('0x3d')]);_0xd9eaca[_0x40d2('0x3e')]=qs['filters'](_['pick'](_0x4cd53e['query'],_0x3bf290['filters']),_0x226f57);if(_0x4cd53e['query']['filter']){_0xd9eaca[_0x40d2('0x3e')]=_[_0x40d2('0x3f')](_0xd9eaca[_0x40d2('0x3e')],{'$or':_[_0x40d2('0x2e')](_0x226f57,function(_0xb7dda5){if(_0xb7dda5['type']!==_0x40d2('0x40')){var _0x22df59={};_0x22df59[_0xb7dda5[_0x40d2('0x2b')]]={'$like':'%'+_0x4cd53e[_0x40d2('0x3a')]['filter']+'%'};return _0x22df59;}})});}_0xd9eaca=_[_0x40d2('0x3f')]({},_0xd9eaca,_0x4cd53e[_0x40d2('0x41')]);var _0x165892={'where':_0xd9eaca['where']};return db[_0x40d2('0x2f')][_0x40d2('0x21')](_0x165892)[_0x40d2('0x27')](function(_0x2d613d){_0xc463c4[_0x40d2('0x21')]=_0x2d613d;if(_0x4cd53e['query'][_0x40d2('0x42')]){_0xd9eaca['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x40d2('0x43')](_0xd9eaca);})[_0x40d2('0x27')](function(_0x166a7){_0xc463c4['rows']=_0x166a7;return _0xc463c4;})[_0x40d2('0x27')](respondWithFilteredResult(_0x288581,_0xd9eaca))['catch'](handleError(_0x288581,null));};exports['show']=function(_0x137300,_0x564905){var _0xab0f50={'raw':!![],'where':{'id':_0x137300[_0x40d2('0x44')]['id']}},_0x5e46dc={};_0x5e46dc[_0x40d2('0x33')]=_[_0x40d2('0x34')](db['ChatInternalMessage'][_0x40d2('0x45')]);_0x5e46dc[_0x40d2('0x3a')]=_[_0x40d2('0x34')](_0x137300[_0x40d2('0x3a')]);_0x5e46dc[_0x40d2('0x35')]=_[_0x40d2('0x36')](_0x5e46dc[_0x40d2('0x33')],_0x5e46dc[_0x40d2('0x3a')]);_0xab0f50[_0x40d2('0x37')]=_[_0x40d2('0x36')](_0x5e46dc[_0x40d2('0x33')],qs[_0x40d2('0x38')](_0x137300['query'][_0x40d2('0x38')]));_0xab0f50['attributes']=_0xab0f50['attributes'][_0x40d2('0x39')]?_0xab0f50[_0x40d2('0x37')]:_0x5e46dc['model'];if(_0x137300['query']['includeAll']){_0xab0f50[_0x40d2('0x46')]=[{'all':!![]}];}_0xab0f50=_[_0x40d2('0x3f')]({},_0xab0f50,_0x137300['options']);return db[_0x40d2('0x2f')][_0x40d2('0x47')](_0xab0f50)[_0x40d2('0x27')](handleEntityNotFound(_0x564905,null))[_0x40d2('0x27')](respondWithResult(_0x564905,null))[_0x40d2('0x48')](handleError(_0x564905,null));};exports['create']=function(_0x448c94,_0x17ff13){return db[_0x40d2('0x2f')][_0x40d2('0x49')](_0x448c94[_0x40d2('0x4a')],{})[_0x40d2('0x27')](respondWithResult(_0x17ff13,0xc9))[_0x40d2('0x48')](handleError(_0x17ff13,null));};exports['update']=function(_0x4a9fa8,_0x36dc56){if(_0x4a9fa8['body']['id']){delete _0x4a9fa8['body']['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x4a9fa8[_0x40d2('0x44')]['id']}})[_0x40d2('0x27')](handleEntityNotFound(_0x36dc56,null))[_0x40d2('0x27')](saveUpdates(_0x4a9fa8['body'],null))[_0x40d2('0x27')](respondWithResult(_0x36dc56,null))['catch'](handleError(_0x36dc56,null));};exports[_0x40d2('0x28')]=function(_0x539d8d,_0x1c9fb3){return db['ChatInternalMessage']['find']({'where':{'id':_0x539d8d[_0x40d2('0x44')]['id']}})[_0x40d2('0x27')](handleEntityNotFound(_0x1c9fb3,null))[_0x40d2('0x27')](removeEntity(_0x1c9fb3,null))[_0x40d2('0x48')](handleError(_0x1c9fb3,null));};exports['describe']=function(_0x4f3eea,_0x241e30){return db[_0x40d2('0x2f')][_0x40d2('0x4b')]()[_0x40d2('0x27')](respondWithResult(_0x241e30,null))[_0x40d2('0x48')](handleError(_0x241e30,null));};function wrapUser(_0x225da1){return function(_0x2a65e6){var _0x3595d0=_0x225da1[_0x40d2('0x4c')]({'plain':!![]});_0x3595d0['messages']=[];if(_0x2a65e6){_0x3595d0['lastMessageAt']=_0x2a65e6[_0x40d2('0x4d')];_0x3595d0[_0x40d2('0x4e')]=_0x2a65e6;}else{_0x3595d0[_0x40d2('0x4f')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3595d0[_0x40d2('0x4e')]={};}return _0x3595d0;};}exports[_0x40d2('0x50')]=function(_0x43c686,_0x7389da,_0x41bb71){var _0x97c671=[];return db['User'][_0x40d2('0x43')]({'where':{'role':[_0x40d2('0x51'),_0x40d2('0x52'),_0x40d2('0x53')]},'attributes':['id','fullname',_0x40d2('0x2b'),_0x40d2('0x54'),_0x40d2('0x55'),_0x40d2('0x56'),_0x40d2('0x57'),_0x40d2('0x58'),_0x40d2('0x59'),'showWebBar'],'order':qs[_0x40d2('0x3d')](_0x40d2('0x5a')),'include':[{'model':db[_0x40d2('0x5b')],'as':_0x40d2('0x5c'),'attributes':['id','name',_0x40d2('0x31')],'through':{'attributes':[]}}]})[_0x40d2('0x27')](function(_0x4ae5e0){if(_0x4ae5e0){var _0x3c5843=_0x43c686[_0x40d2('0x53')][_0x40d2('0x4c')]({'plain':!![]});if(!_0x3c5843)throw new Error(_0x40d2('0x5d'));if(_0x3c5843[_0x40d2('0x54')]===_0x40d2('0x53')){return db[_0x40d2('0x5e')][_0x40d2('0x47')]({'where':{'name':_0x40d2('0x5f'),'userProfileId':_0x3c5843[_0x40d2('0x60')]},'raw':!![]})[_0x40d2('0x27')](function(_0x57b232){if(_0x57b232){if(_0x57b232[_0x40d2('0x61')]===0x0){return db[_0x40d2('0x62')][_0x40d2('0x43')]({'where':{'sectionId':_0x57b232['id']},'raw':!![]})[_0x40d2('0x27')](function(_0x57c029){var _0xb70582=[];if(_['isEmpty'](_0x57c029)){_0xb70582=_['filter'](_0x4ae5e0,function(_0x3e3fc1){if(_0x3e3fc1[_0x40d2('0x54')]!=='agent'){return _0x3e3fc1;}});return _0xb70582;}else{for(var _0x3711f2=0x0;_0x3711f2<_0x4ae5e0[_0x40d2('0x39')];_0x3711f2++){var _0x186e07=_0x4ae5e0[_0x3711f2];if(_0x186e07[_0x40d2('0x54')]===_0x40d2('0x51')){var _0x3c20c9=_['find'](_0x57c029,function(_0x4e3099){return _0x4e3099[_0x40d2('0x63')]===_0x186e07['id'];});if(_0x3c20c9)_0xb70582[_0x40d2('0x64')](_0x186e07);}else{_0xb70582['push'](_0x186e07);}}return _0xb70582;}});}else{return _0x4ae5e0;}}else{var _0x1fee39=_[_0x40d2('0x65')](_0x4ae5e0,function(_0x12d77f){if(_0x12d77f[_0x40d2('0x54')]!=='agent'){return _0x12d77f;}});return _0x1fee39;}});}else{return _0x4ae5e0;}}})[_0x40d2('0x27')](function(_0x171db1){var _0x11f5e1=[];if(_0x171db1){_0x97c671=_0x171db1;for(var _0x41d03f=0x0;_0x41d03f<_0x171db1[_0x40d2('0x39')];_0x41d03f+=0x1){_0x97c671[_0x41d03f][_0x40d2('0x66')]=[];_0x11f5e1[_0x40d2('0x64')](db[_0x40d2('0x2f')][_0x40d2('0x47')]({'where':{'FromId':[_0x43c686[_0x40d2('0x53')]['id'],_0x171db1[_0x41d03f]['id']],'ToId':[_0x43c686[_0x40d2('0x53')]['id'],_0x171db1[_0x41d03f]['id']],'ChatGroupId':null},'attributes':['id',_0x40d2('0x4d'),_0x40d2('0x67'),'ToId',_0x40d2('0x68'),_0x40d2('0x4a')],'order':qs[_0x40d2('0x3d')](_0x40d2('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x40d2('0x27')](wrapUser(_0x171db1[_0x41d03f])));}return BPromise[_0x40d2('0x6a')](_0x11f5e1);}return[];})[_0x40d2('0x27')](function(_0x4ac909){return{'rows':_0x4ac909,'count':_0x4ac909['length']};})[_0x40d2('0x27')](respondWithResult(_0x7389da,null))['catch'](handleError(_0x7389da,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 597ec21..b3b2804 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 _0xf559=['hasOwnProperty','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save','emit'];(function(_0x97b24f,_0x4bc0a9){var _0x627fa7=function(_0x271063){while(--_0x271063){_0x97b24f['push'](_0x97b24f['shift']());}};_0x627fa7(++_0x4bc0a9);}(_0xf559,0xb8));var _0x9f55=function(_0x465f75,_0x4b9141){_0x465f75=_0x465f75-0x0;var _0x53f44a=_0xf559[_0x465f75];return _0x53f44a;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x9f55('0x0'))['db'][_0x9f55('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x9f55('0x2')](0x0);var events={'afterCreate':_0x9f55('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1dbac9){return function(_0x6e981a,_0x351596,_0x494203){ChatInternalMessageEvents[_0x9f55('0x4')](_0x1dbac9+':'+_0x6e981a['id'],_0x6e981a);ChatInternalMessageEvents['emit'](_0x1dbac9,_0x6e981a);_0x494203(null);};}for(var e in events){if(events[_0x9f55('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x9f55('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x030a=['emit','hook','exports','events','../../mysqldb','ChatInternalMessage','save','update','remove'];(function(_0x414743,_0x2e6d87){var _0x39d57d=function(_0xb932fa){while(--_0xb932fa){_0x414743['push'](_0x414743['shift']());}};_0x39d57d(++_0x2e6d87);}(_0x030a,0xdb));var _0xa030=function(_0x1c206c,_0x30bdcf){_0x1c206c=_0x1c206c-0x0;var _0x188aaa=_0x030a[_0x1c206c];return _0x188aaa;};'use strict';var EventEmitter=require(_0xa030('0x0'));var ChatInternalMessage=require(_0xa030('0x1'))['db'][_0xa030('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa030('0x3'),'afterUpdate':_0xa030('0x4'),'afterDestroy':_0xa030('0x5')};function emitEvent(_0x8712e9){return function(_0x243cef,_0x25162e,_0x504386){ChatInternalMessageEvents[_0xa030('0x6')](_0x8712e9+':'+_0x243cef['id'],_0x243cef);ChatInternalMessageEvents[_0xa030('0x6')](_0x8712e9,_0x243cef);_0x504386(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xa030('0x7')](e,emitEvent(event));}}module[_0xa030('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 0c870c3..264ad73 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 _0xb80c=['../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','request-promise','rimraf'];(function(_0x17de64,_0x283320){var _0x18e352=function(_0x3cd244){while(--_0x3cd244){_0x17de64['push'](_0x17de64['shift']());}};_0x18e352(++_0x283320);}(_0xb80c,0x98));var _0xcb80=function(_0x1b2bf8,_0x319800){_0x1b2bf8=_0x1b2bf8-0x0;var _0xffb475=_0xb80c[_0x1b2bf8];return _0xffb475;};'use strict';var _=require(_0xcb80('0x0'));var util=require(_0xcb80('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb80('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb80('0x3'));var config=require(_0xcb80('0x4'));var attributes=require(_0xcb80('0x5'));module[_0xcb80('0x6')]=function(_0x3b393,_0x4594f6){return _0x3b393[_0xcb80('0x7')](_0xcb80('0x8'),attributes,{'tableName':_0xcb80('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcb80('0xa'),'collate':_0xcb80('0xb')});};
\ No newline at end of file
+var _0x521d=['ChatInternalMessage','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','define'];(function(_0x364bf5,_0x9f144e){var _0x58f413=function(_0x1fea98){while(--_0x1fea98){_0x364bf5['push'](_0x364bf5['shift']());}};_0x58f413(++_0x9f144e);}(_0x521d,0x12e));var _0xd521=function(_0xd4c75a,_0x3b6e6e){_0xd4c75a=_0xd4c75a-0x0;var _0xc6926a=_0x521d[_0xd4c75a];return _0xc6926a;};'use strict';var _=require(_0xd521('0x0'));var util=require('util');var logger=require(_0xd521('0x1'))(_0xd521('0x2'));var moment=require(_0xd521('0x3'));var BPromise=require(_0xd521('0x4'));var rp=require(_0xd521('0x5'));var fs=require('fs');var path=require(_0xd521('0x6'));var rimraf=require(_0xd521('0x7'));var config=require('../../config/environment');var attributes=require(_0xd521('0x8'));module['exports']=function(_0x2ce6d1,_0x4e9fb8){return _0x2ce6d1[_0xd521('0x9')](_0xd521('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd521('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 9b0eaf5..36fe84c 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 _0x93ea=['debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x28a439,_0x5d9b3a){var _0x455e33=function(_0x18ddf0){while(--_0x18ddf0){_0x28a439['push'](_0x28a439['shift']());}};_0x455e33(++_0x5d9b3a);}(_0x93ea,0x131));var _0xa93e=function(_0x50cfc3,_0x526cc6){_0x50cfc3=_0x50cfc3-0x0;var _0x5c11ef=_0x93ea[_0x50cfc3];return _0x5c11ef;};'use strict';var _=require(_0xa93e('0x0'));var util=require(_0xa93e('0x1'));var moment=require('moment');var BPromise=require(_0xa93e('0x2'));var rs=require(_0xa93e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa93e('0x4'))['db'];var utils=require(_0xa93e('0x5'));var logger=require(_0xa93e('0x6'))(_0xa93e('0x7'));var config=require(_0xa93e('0x8'));var jayson=require(_0xa93e('0x9'));var client=jayson[_0xa93e('0xa')][_0xa93e('0xb')]({'port':0x232a});config[_0xa93e('0xc')]=_[_0xa93e('0xd')](config[_0xa93e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa93e('0xe'))(new Redis(config[_0xa93e('0xc')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2ee93f,_0x550607,_0x3fed5d){return new BPromise(function(_0x4ddc6e,_0x1ce09e){return client['request'](_0x2ee93f,_0x3fed5d)['then'](function(_0x1ab7cf){logger[_0xa93e('0xf')](_0xa93e('0x10'),_0x550607,'request\x20sent');logger[_0xa93e('0x11')](_0xa93e('0x12'),_0x550607,_0xa93e('0x13'),JSON[_0xa93e('0x14')](_0x1ab7cf));if(_0x1ab7cf['error']){if(_0x1ab7cf[_0xa93e('0x15')]['code']===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x550607,_0x1ab7cf[_0xa93e('0x15')][_0xa93e('0x16')]);return _0x1ce09e(_0x1ab7cf[_0xa93e('0x15')][_0xa93e('0x16')]);}logger[_0xa93e('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x550607,_0x1ab7cf[_0xa93e('0x15')][_0xa93e('0x16')]);return _0x4ddc6e(_0x1ab7cf[_0xa93e('0x15')]['message']);}else{logger[_0xa93e('0xf')](_0xa93e('0x10'),_0x550607,_0xa93e('0x13'));_0x4ddc6e(_0x1ab7cf['result'][_0xa93e('0x16')]);}})['catch'](function(_0x54cdb4){logger[_0xa93e('0x15')](_0xa93e('0x10'),_0x550607,_0x54cdb4);_0x1ce09e(_0x54cdb4);});});}
\ No newline at end of file
+var _0x5693=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','request\x20sent','debug'];(function(_0x4ea712,_0x261e02){var _0x159e1d=function(_0x44f723){while(--_0x44f723){_0x4ea712['push'](_0x4ea712['shift']());}};_0x159e1d(++_0x261e02);}(_0x5693,0x1d2));var _0x3569=function(_0x39c9fc,_0x267494){_0x39c9fc=_0x39c9fc-0x0;var _0x425ea4=_0x5693[_0x39c9fc];return _0x425ea4;};'use strict';var _=require(_0x3569('0x0'));var util=require(_0x3569('0x1'));var moment=require(_0x3569('0x2'));var BPromise=require('bluebird');var rs=require(_0x3569('0x3'));var fs=require('fs');var Redis=require(_0x3569('0x4'));var db=require(_0x3569('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3569('0x6'))(_0x3569('0x7'));var config=require('../../config/environment');var jayson=require(_0x3569('0x8'));var client=jayson[_0x3569('0x9')]['http']({'port':0x232a});config[_0x3569('0xa')]=_[_0x3569('0xb')](config[_0x3569('0xa')],{'host':_0x3569('0xc'),'port':0x18eb});var socket=require(_0x3569('0xd'))(new Redis(config[_0x3569('0xa')]));require(_0x3569('0xe'))[_0x3569('0xf')](socket);function respondWithRpcPromise(_0x32668a,_0x1fc954,_0x373bc9){return new BPromise(function(_0x20dd7c,_0x391588){return client['request'](_0x32668a,_0x373bc9)[_0x3569('0x10')](function(_0x5a2cff){logger[_0x3569('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x1fc954,_0x3569('0x12'));logger[_0x3569('0x13')](_0x3569('0x14'),_0x1fc954,_0x3569('0x12'),JSON[_0x3569('0x15')](_0x5a2cff));if(_0x5a2cff[_0x3569('0x16')]){if(_0x5a2cff[_0x3569('0x16')][_0x3569('0x17')]===0x1f4){logger[_0x3569('0x16')](_0x3569('0x18'),_0x1fc954,_0x5a2cff[_0x3569('0x16')][_0x3569('0x19')]);return _0x391588(_0x5a2cff['error'][_0x3569('0x19')]);}logger[_0x3569('0x16')](_0x3569('0x18'),_0x1fc954,_0x5a2cff[_0x3569('0x16')][_0x3569('0x19')]);return _0x20dd7c(_0x5a2cff['error'][_0x3569('0x19')]);}else{logger[_0x3569('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x1fc954,_0x3569('0x12'));_0x20dd7c(_0x5a2cff[_0x3569('0x1a')][_0x3569('0x19')]);}})['catch'](function(_0x21c182){logger[_0x3569('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x1fc954,_0x21c182);_0x391588(_0x21c182);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 20936ba..b432a27 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 _0xeed2=['./chatInternalMessage.events','remove','update','removeListener','length'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xeed2,0x1ef));var _0x2eed=function(_0x1b04b2,_0x43cd52){_0x1b04b2=_0x1b04b2-0x0;var _0x56e88d=_0xeed2[_0x1b04b2];return _0x56e88d;};'use strict';var ChatInternalMessageEvents=require(_0x2eed('0x0'));var events=['save',_0x2eed('0x1'),_0x2eed('0x2')];function createListener(_0x3bb5ca,_0x5d60a3){return function(_0x4b1810){_0x5d60a3['emit'](_0x3bb5ca,_0x4b1810);};}function removeListener(_0x2fddbd,_0x162fe9){return function(){ChatInternalMessageEvents[_0x2eed('0x3')](_0x2fddbd,_0x162fe9);};}exports['register']=function(_0x31c6aa){for(var _0xc79c95=0x0,_0x14c84a=events[_0x2eed('0x4')];_0xc79c95<_0x14c84a;_0xc79c95++){var _0xb23768=events[_0xc79c95];var _0x41c09c=createListener('chatInternalMessage:'+_0xb23768,_0x31c6aa);ChatInternalMessageEvents['on'](_0xb23768,_0x41c09c);}};
\ No newline at end of file
+var _0x03fc=['chatInternalMessage:','save','remove','update','emit','removeListener','register'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x03fc,0x86));var _0xc03f=function(_0x552203,_0x530526){_0x552203=_0x552203-0x0;var _0x3dab1e=_0x03fc[_0x552203];return _0x3dab1e;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xc03f('0x0'),_0xc03f('0x1'),_0xc03f('0x2')];function createListener(_0x115dc6,_0x271a15){return function(_0x147af0){_0x271a15[_0xc03f('0x3')](_0x115dc6,_0x147af0);};}function removeListener(_0xedf3e9,_0x2845cc){return function(){ChatInternalMessageEvents[_0xc03f('0x4')](_0xedf3e9,_0x2845cc);};}exports[_0xc03f('0x5')]=function(_0x558cb9){for(var _0x25e91a=0x0,_0x1ed063=events['length'];_0x25e91a<_0x1ed063;_0x25e91a++){var _0x39e9b7=events[_0x25e91a];var _0x2975d3=createListener(_0xc03f('0x6')+_0x39e9b7,_0x558cb9);ChatInternalMessageEvents['on'](_0x39e9b7,_0x2975d3);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 8217fe4..139a6b1 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 _0x404d=['index','get','describe','getUsers','show','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated'];(function(_0x6a6960,_0x3008f6){var _0x43c3e8=function(_0x19ebf2){while(--_0x19ebf2){_0x6a6960['push'](_0x6a6960['shift']());}};_0x43c3e8(++_0x3008f6);}(_0x404d,0xf9));var _0xd404=function(_0x5a3f41,_0x4f1913){_0x5a3f41=_0x5a3f41-0x0;var _0x51cc1f=_0x404d[_0x5a3f41];return _0x51cc1f;};'use strict';var multer=require(_0xd404('0x0'));var util=require(_0xd404('0x1'));var path=require(_0xd404('0x2'));var timeout=require(_0xd404('0x3'));var express=require(_0xd404('0x4'));var router=express[_0xd404('0x5')]();var fs_extra=require(_0xd404('0x6'));var auth=require(_0xd404('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd404('0x8'));var controller=require(_0xd404('0x9'));router['get']('/',auth[_0xd404('0xa')](),controller[_0xd404('0xb')]);router[_0xd404('0xc')]('/describe',auth['isAuthenticated'](),controller[_0xd404('0xd')]);router[_0xd404('0xc')]('/users',auth[_0xd404('0xa')](),controller[_0xd404('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd404('0xf')]);router['post']('/',auth[_0xd404('0xa')](),controller['create']);router[_0xd404('0x10')](_0xd404('0x11'),controller['update']);router[_0xd404('0x12')](_0xd404('0x11'),auth[_0xd404('0xa')](),controller['destroy']);module[_0xd404('0x13')]=router;
\ No newline at end of file
+var _0x80d9=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x3451d7,_0x20d83a){var _0x1575b4=function(_0x57f42c){while(--_0x57f42c){_0x3451d7['push'](_0x3451d7['shift']());}};_0x1575b4(++_0x20d83a);}(_0x80d9,0xb6));var _0x980d=function(_0xa13fdb,_0x22bd20){_0xa13fdb=_0xa13fdb-0x0;var _0x32758b=_0x80d9[_0xa13fdb];return _0x32758b;};'use strict';var multer=require(_0x980d('0x0'));var util=require(_0x980d('0x1'));var path=require(_0x980d('0x2'));var timeout=require(_0x980d('0x3'));var express=require(_0x980d('0x4'));var router=express[_0x980d('0x5')]();var fs_extra=require(_0x980d('0x6'));var auth=require(_0x980d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x980d('0x8'));var controller=require(_0x980d('0x9'));router[_0x980d('0xa')]('/',auth[_0x980d('0xb')](),controller[_0x980d('0xc')]);router[_0x980d('0xa')]('/describe',auth[_0x980d('0xb')](),controller[_0x980d('0xd')]);router[_0x980d('0xa')](_0x980d('0xe'),auth[_0x980d('0xb')](),controller['getUsers']);router[_0x980d('0xa')](_0x980d('0xf'),auth[_0x980d('0xb')](),controller[_0x980d('0x10')]);router[_0x980d('0x11')]('/',auth[_0x980d('0xb')](),controller[_0x980d('0x12')]);router['put'](_0x980d('0xf'),controller[_0x980d('0x13')]);router[_0x980d('0x14')]('/:id',auth[_0x980d('0xb')](),controller[_0x980d('0x15')]);module[_0x980d('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 f4e7917..597a570 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 _0x9805=['sequelize','exports','TEXT','medium','ENUM','out','DATE'];(function(_0x1a3d06,_0x5b0511){var _0x4b3d44=function(_0x2bea93){while(--_0x2bea93){_0x1a3d06['push'](_0x1a3d06['shift']());}};_0x4b3d44(++_0x5b0511);}(_0x9805,0x18f));var _0x5980=function(_0x13bcbb,_0x2eb915){_0x13bcbb=_0x13bcbb-0x0;var _0x457c81=_0x9805[_0x13bcbb];return _0x457c81;};'use strict';var Sequelize=require(_0x5980('0x0'));module[_0x5980('0x1')]={'body':{'type':Sequelize[_0x5980('0x2')](_0x5980('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5980('0x4')]('in',_0x5980('0x5')),'defaultValue':_0x5980('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x5980('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x9ccd=['TEXT','medium','ENUM','out','DATE','STRING','sequelize'];(function(_0x3d6c73,_0x34047d){var _0x1ab97c=function(_0x34d16b){while(--_0x34d16b){_0x3d6c73['push'](_0x3d6c73['shift']());}};_0x1ab97c(++_0x34047d);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ccd[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xd9cc('0x0'));module['exports']={'body':{'type':Sequelize[_0xd9cc('0x1')](_0xd9cc('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9cc('0x3')]('in','out'),'defaultValue':_0xd9cc('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd9cc('0x5')]},'providerName':{'type':Sequelize[_0xd9cc('0x6')]},'providerResponse':{'type':Sequelize[_0xd9cc('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index b490504..848ad10 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 _0xad36=['accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectmessage','formData','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','params','ChatMessage','find','create','body','describe','../../config/logger','chat-interactions'];(function(_0x31a576,_0x424419){var _0x30b1d3=function(_0x4710e8){while(--_0x4710e8){_0x31a576['push'](_0x31a576['shift']());}};_0x30b1d3(++_0x424419);}(_0xad36,0xa5));var _0x6ad3=function(_0x1bc286,_0x1bf518){_0x1bc286=_0x1bc286-0x0;var _0x20de66=_0xad36[_0x1bc286];return _0x20de66;};'use strict';var emlformat=require(_0x6ad3('0x0'));var rimraf=require(_0x6ad3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6ad3('0x2'));var rp=require(_0x6ad3('0x3'));var moment=require(_0x6ad3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6ad3('0x5'));var path=require(_0x6ad3('0x6'));var sox=require(_0x6ad3('0x7'));var csv=require(_0x6ad3('0x8'));var ejs=require(_0x6ad3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ad3('0xa'));var squel=require(_0x6ad3('0xb'));var crypto=require(_0x6ad3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6ad3('0xd'));var toCsv=require(_0x6ad3('0x8'));var querystring=require(_0x6ad3('0xe'));var Papa=require(_0x6ad3('0xf'));var Redis=require(_0x6ad3('0x10'));var authService=require(_0x6ad3('0x11'));var qs=require(_0x6ad3('0x12'));var as=require(_0x6ad3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6ad3('0x14'));var config=require(_0x6ad3('0x15'));var licenseUtil=require(_0x6ad3('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x6ad3('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x6ad3('0x18'))(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x6ad3('0x19'));var client=jayson[_0x6ad3('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0x6ad3('0x1a')][_0x6ad3('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x210622,_0x3ab4f6,_0x11dc00,_0x2362b4){return new BPromise(function(_0xddeb90,_0xc86acd){var _0x4c5c80=_0x2362b4||client;return _0x4c5c80[_0x6ad3('0x1c')](_0x210622,_0x11dc00)['then'](function(_0x44092f){logger[_0x6ad3('0x1d')]('ChatMessage,\x20%s,\x20%s',_0x3ab4f6,_0x6ad3('0x1e'));logger[_0x6ad3('0x1f')](_0x6ad3('0x20'),_0x3ab4f6,_0x6ad3('0x1e'),JSON[_0x6ad3('0x21')](_0x44092f));if(_0x44092f['error']){if(_0x44092f[_0x6ad3('0x22')][_0x6ad3('0x23')]===0x1f4){logger[_0x6ad3('0x22')](_0x6ad3('0x24'),_0x3ab4f6,_0x44092f['error']['message']);return _0xc86acd(_0x44092f[_0x6ad3('0x22')]['message']);}logger[_0x6ad3('0x22')](_0x6ad3('0x24'),_0x3ab4f6,_0x44092f[_0x6ad3('0x22')][_0x6ad3('0x25')]);return _0xddeb90(_0x44092f['error']['message']);}else{logger[_0x6ad3('0x1d')](_0x6ad3('0x24'),_0x3ab4f6,_0x6ad3('0x1e'));_0xddeb90(_0x44092f['result'][_0x6ad3('0x25')]);}})[_0x6ad3('0x26')](function(_0x2c354b){logger[_0x6ad3('0x22')](_0x6ad3('0x24'),_0x3ab4f6,_0x2c354b);_0xc86acd(_0x2c354b);});});}function respondWithStatusCode(_0x5395b2,_0x5f0f27){_0x5f0f27=_0x5f0f27||0xcc;return function(_0x2b7cfb){if(_0x2b7cfb){return _0x5395b2[_0x6ad3('0x27')](_0x5f0f27);}return _0x5395b2[_0x6ad3('0x28')](_0x5f0f27)[_0x6ad3('0x29')]();};}function respondWithResult(_0x1530ee,_0x4f41fa){_0x4f41fa=_0x4f41fa||0xc8;return function(_0x2fcaa7){if(_0x2fcaa7){return _0x1530ee[_0x6ad3('0x28')](_0x4f41fa)['json'](_0x2fcaa7);}};}function respondWithFilteredResult(_0x2c66b9,_0x32be81){return function(_0x560529){if(_0x560529){var _0x4dd886=typeof _0x32be81['offset']===_0x6ad3('0x2a')&&typeof _0x32be81[_0x6ad3('0x2b')]===_0x6ad3('0x2a');var _0xec3fd2=_0x560529['count'];var _0x22fb96=_0x4dd886?0x0:_0x32be81[_0x6ad3('0x2c')];var _0x42f7ee=_0x4dd886?_0x560529[_0x6ad3('0x2d')]:_0x32be81['offset']+_0x32be81[_0x6ad3('0x2b')];var _0x5b50c3;if(_0x42f7ee>=_0xec3fd2){_0x42f7ee=_0xec3fd2;_0x5b50c3=0xc8;}else{_0x5b50c3=0xce;}_0x2c66b9[_0x6ad3('0x28')](_0x5b50c3);return _0x2c66b9[_0x6ad3('0x2e')](_0x6ad3('0x2f'),_0x22fb96+'-'+_0x42f7ee+'/'+_0xec3fd2)[_0x6ad3('0x30')](_0x560529);}return null;};}function patchUpdates(_0x20c998){return function(_0x271eb3){try{jsonpatch[_0x6ad3('0x31')](_0x271eb3,_0x20c998,!![]);}catch(_0xc66f36){return BPromise[_0x6ad3('0x32')](_0xc66f36);}return _0x271eb3[_0x6ad3('0x33')]();};}function saveUpdates(_0x18cd98,_0x51eebd){return function(_0x2c2a4d){if(_0x2c2a4d){return _0x2c2a4d[_0x6ad3('0x34')](_0x18cd98)[_0x6ad3('0x35')](function(_0x3c8b67){return _0x3c8b67;});}return null;};}function removeEntity(_0x265159,_0x17d921){return function(_0x272263){if(_0x272263){return _0x272263[_0x6ad3('0x36')]()[_0x6ad3('0x35')](function(){_0x265159[_0x6ad3('0x28')](0xcc)[_0x6ad3('0x29')]();});}};}function handleEntityNotFound(_0x3ad263,_0x2a2d17){return function(_0x33dc57){if(!_0x33dc57){_0x3ad263['sendStatus'](0x194);}return _0x33dc57;};}function handleError(_0x4cd6aa,_0x106d52){_0x106d52=_0x106d52||0x1f4;return function(_0x58b400){logger[_0x6ad3('0x22')](_0x58b400[_0x6ad3('0x37')]);if(_0x58b400[_0x6ad3('0x38')]){delete _0x58b400[_0x6ad3('0x38')];}_0x4cd6aa['status'](_0x106d52)[_0x6ad3('0x39')](_0x58b400);};}exports[_0x6ad3('0x3a')]=function(_0x5ec536,_0x5656e7){var _0x312319={},_0x5e0034={},_0x506b21={'count':0x0,'rows':[]};var _0x2b6aa3=_[_0x6ad3('0x3b')](db['ChatMessage'][_0x6ad3('0x3c')],function(_0xfb9c91){return{'name':_0xfb9c91[_0x6ad3('0x3d')],'type':_0xfb9c91[_0x6ad3('0x3e')][_0x6ad3('0x3f')]};});_0x5e0034[_0x6ad3('0x40')]=_[_0x6ad3('0x3b')](_0x2b6aa3,'name');_0x5e0034[_0x6ad3('0x41')]=_[_0x6ad3('0x42')](_0x5ec536['query']);_0x5e0034[_0x6ad3('0x43')]=_[_0x6ad3('0x44')](_0x5e0034[_0x6ad3('0x40')],_0x5e0034['query']);_0x312319[_0x6ad3('0x45')]=_[_0x6ad3('0x44')](_0x5e0034['model'],qs['fields'](_0x5ec536['query'][_0x6ad3('0x46')]));_0x312319[_0x6ad3('0x45')]=_0x312319[_0x6ad3('0x45')][_0x6ad3('0x47')]?_0x312319[_0x6ad3('0x45')]:_0x5e0034[_0x6ad3('0x40')];if(!_0x5ec536['query']['hasOwnProperty'](_0x6ad3('0x48'))){_0x312319[_0x6ad3('0x2b')]=qs[_0x6ad3('0x2b')](_0x5ec536[_0x6ad3('0x41')][_0x6ad3('0x2b')]);_0x312319[_0x6ad3('0x2c')]=qs[_0x6ad3('0x2c')](_0x5ec536['query']['offset']);}_0x312319[_0x6ad3('0x49')]=qs[_0x6ad3('0x4a')](_0x5ec536[_0x6ad3('0x41')][_0x6ad3('0x4a')]);_0x312319[_0x6ad3('0x4b')]=qs[_0x6ad3('0x43')](_['pick'](_0x5ec536['query'],_0x5e0034['filters']),_0x2b6aa3);if(_0x5ec536[_0x6ad3('0x41')]['filter']){_0x312319[_0x6ad3('0x4b')]=_[_0x6ad3('0x4c')](_0x312319[_0x6ad3('0x4b')],{'$or':_[_0x6ad3('0x3b')](_0x2b6aa3,function(_0x12e05d){if(_0x12e05d[_0x6ad3('0x3e')]!==_0x6ad3('0x4d')){var _0x5f2d2f={};_0x5f2d2f[_0x12e05d['name']]={'$like':'%'+_0x5ec536['query'][_0x6ad3('0x4e')]+'%'};return _0x5f2d2f;}})});}_0x312319=_[_0x6ad3('0x4c')]({},_0x312319,_0x5ec536[_0x6ad3('0x4f')]);var _0x56ee25={'where':_0x312319[_0x6ad3('0x4b')]};return db['ChatMessage']['count'](_0x56ee25)[_0x6ad3('0x35')](function(_0x3b66da){_0x506b21['count']=_0x3b66da;if(_0x5ec536['query']['includeAll']){_0x312319[_0x6ad3('0x50')]=[{'all':!![]}];}return db['ChatMessage'][_0x6ad3('0x51')](_0x312319);})[_0x6ad3('0x35')](function(_0x57bb7a){_0x506b21[_0x6ad3('0x52')]=_0x57bb7a;return _0x506b21;})[_0x6ad3('0x35')](respondWithFilteredResult(_0x5656e7,_0x312319))[_0x6ad3('0x26')](handleError(_0x5656e7,null));};exports['show']=function(_0xcc153b,_0x424765){var _0x5a8252={'raw':!![],'where':{'id':_0xcc153b[_0x6ad3('0x53')]['id']}},_0xd7f8d5={};_0xd7f8d5['model']=_[_0x6ad3('0x42')](db[_0x6ad3('0x54')]['rawAttributes']);_0xd7f8d5[_0x6ad3('0x41')]=_['keys'](_0xcc153b['query']);_0xd7f8d5[_0x6ad3('0x43')]=_[_0x6ad3('0x44')](_0xd7f8d5[_0x6ad3('0x40')],_0xd7f8d5[_0x6ad3('0x41')]);_0x5a8252['attributes']=_[_0x6ad3('0x44')](_0xd7f8d5['model'],qs[_0x6ad3('0x46')](_0xcc153b[_0x6ad3('0x41')][_0x6ad3('0x46')]));_0x5a8252[_0x6ad3('0x45')]=_0x5a8252['attributes'][_0x6ad3('0x47')]?_0x5a8252[_0x6ad3('0x45')]:_0xd7f8d5[_0x6ad3('0x40')];if(_0xcc153b[_0x6ad3('0x41')]['includeAll']){_0x5a8252[_0x6ad3('0x50')]=[{'all':!![]}];}_0x5a8252=_['merge']({},_0x5a8252,_0xcc153b[_0x6ad3('0x4f')]);return db[_0x6ad3('0x54')][_0x6ad3('0x55')](_0x5a8252)['then'](handleEntityNotFound(_0x424765,null))[_0x6ad3('0x35')](respondWithResult(_0x424765,null))[_0x6ad3('0x26')](handleError(_0x424765,null));};exports[_0x6ad3('0x56')]=function(_0x1abd84,_0x4090c9){return db[_0x6ad3('0x54')][_0x6ad3('0x56')](_0x1abd84[_0x6ad3('0x57')],{})[_0x6ad3('0x35')](respondWithResult(_0x4090c9,0xc9))[_0x6ad3('0x26')](handleError(_0x4090c9,null));};exports[_0x6ad3('0x34')]=function(_0x505d89,_0x25c4a1){if(_0x505d89[_0x6ad3('0x57')]['id']){delete _0x505d89[_0x6ad3('0x57')]['id'];}return db[_0x6ad3('0x54')][_0x6ad3('0x55')]({'where':{'id':_0x505d89[_0x6ad3('0x53')]['id']}})[_0x6ad3('0x35')](handleEntityNotFound(_0x25c4a1,null))[_0x6ad3('0x35')](saveUpdates(_0x505d89[_0x6ad3('0x57')],null))[_0x6ad3('0x35')](respondWithResult(_0x25c4a1,null))[_0x6ad3('0x26')](handleError(_0x25c4a1,null));};exports[_0x6ad3('0x36')]=function(_0x411557,_0x68448a){return db[_0x6ad3('0x54')]['find']({'where':{'id':_0x411557[_0x6ad3('0x53')]['id']}})[_0x6ad3('0x35')](handleEntityNotFound(_0x68448a,null))[_0x6ad3('0x35')](removeEntity(_0x68448a,null))[_0x6ad3('0x26')](handleError(_0x68448a,null));};exports[_0x6ad3('0x58')]=function(_0x199674,_0x57f07d){return db[_0x6ad3('0x54')][_0x6ad3('0x58')]()['then'](respondWithResult(_0x57f07d,null))[_0x6ad3('0x26')](handleError(_0x57f07d,null));};var interaction_log=require(_0x6ad3('0x59'))(_0x6ad3('0x5a'));exports[_0x6ad3('0x5b')]=function(_0x2d6037,_0x455aa5,_0x2206ed){var _0x24daf4={'agent':{},'channel':_0x6ad3('0x5c')};if(_0x2d6037[_0x6ad3('0x57')]['id']){delete _0x2d6037[_0x6ad3('0x57')]['id'];}_0x2d6037[_0x6ad3('0x57')]['read']=!![];_0x2d6037[_0x6ad3('0x57')][_0x6ad3('0x5d')]=moment()[_0x6ad3('0x5e')](_0x6ad3('0x5f'));_0x2d6037[_0x6ad3('0x57')][_0x6ad3('0x60')]=_0x2d6037[_0x6ad3('0x57')][_0x6ad3('0x60')]||_0x2d6037[_0x6ad3('0x61')]['id'];_0x24daf4['agent']['id']=_0x2d6037[_0x6ad3('0x57')][_0x6ad3('0x60')];return db['ChatMessage'][_0x6ad3('0x55')]({'where':{'id':_0x2d6037[_0x6ad3('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x455aa5,null))[_0x6ad3('0x35')](saveUpdates(_0x2d6037[_0x6ad3('0x57')],null))['then'](function(_0x334001){if(_0x334001){_0x24daf4[_0x6ad3('0x25')]=_0x334001['get']({'plain':!![]});return db[_0x6ad3('0x62')][_0x6ad3('0x55')]({'where':{'id':_0x334001['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x455aa5,null))[_0x6ad3('0x35')](function(_0x87a964){if(_0x87a964){return _0x87a964[_0x6ad3('0x34')]({'UserId':_0x2d6037[_0x6ad3('0x57')][_0x6ad3('0x60')],'read1stAt':_['isNil'](_0x87a964[_0x6ad3('0x63')])?moment()['format'](_0x6ad3('0x5f')):undefined});}return null;})[_0x6ad3('0x35')](function(_0x2d4593){if(_0x2d4593){_0x24daf4[_0x6ad3('0x64')]=_0x2d4593[_0x6ad3('0x65')]({'plain':!![]});interaction_log[_0x6ad3('0x1d')](_0x6ad3('0x66'),_0x2d6037['user']['id'],_0x2d6037[_0x6ad3('0x61')][_0x6ad3('0x38')],_0x2d6037[_0x6ad3('0x61')][_0x6ad3('0x67')],_0x24daf4[_0x6ad3('0x64')]['id'],_0x2d6037[_0x6ad3('0x57')]?JSON[_0x6ad3('0x21')](_0x2d6037[_0x6ad3('0x57')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x24daf4);}return null;})[_0x6ad3('0x35')](function(_0x4abed8){var _0x55b089='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4abed8[_0x6ad3('0x25')][_0x6ad3('0x68')];return db[_0x6ad3('0x69')][_0x6ad3('0x41')](_0x55b089,{'type':db[_0x6ad3('0x6a')][_0x6ad3('0x6b')]['SELECT'],'raw':!![]})[_0x6ad3('0x35')](function(_0x3b5a88){return _0x3b5a88;});})[_0x6ad3('0x35')](function(_0x13173a){if(_0x13173a){_0x24daf4[_0x6ad3('0x25')][_0x6ad3('0x6c')]=_0x13173a[0x0];if(!_0x2d6037[_0x6ad3('0x57')][_0x6ad3('0x60')])return;return db[_0x6ad3('0x6d')]['find']({'where':{'id':_0x2d6037[_0x6ad3('0x57')][_0x6ad3('0x60')],'role':_0x6ad3('0x6e')},'attributes':['id',_0x6ad3('0x38'),_0x6ad3('0x6f'),_0x6ad3('0x70'),_0x6ad3('0x71')],'raw':!![]});}return null;})[_0x6ad3('0x35')](function(_0x3150cd){if(!_0x3150cd)return null;_0x24daf4[_0x6ad3('0x25')][_0x6ad3('0x6e')]=_0x3150cd;return _0x24daf4;})[_0x6ad3('0x35')](function(_0x5b03f9){if(_0x5b03f9){if(_0x2d6037['body'][_0x6ad3('0x72')]){_0x24daf4[_0x6ad3('0x25')][_0x6ad3('0x73')]=util[_0x6ad3('0x5e')](_0x6ad3('0x74'),_0x2d6037[_0x6ad3('0x61')][_0x6ad3('0x38')]);_0x24daf4['message'][_0x6ad3('0x75')]=_0x24daf4[_0x6ad3('0x75')];_0x24daf4[_0x6ad3('0x25')][_0x6ad3('0x76')]=_0x24daf4['channel'];_0x24daf4['message'][_0x6ad3('0x77')]=_0x6ad3('0x5b');return respondWithRpcPromise(_0x6ad3('0x78'),_0x6ad3('0x78'),{'event':_0x6ad3('0x79'),'message':_[_0x6ad3('0x4c')](_0x24daf4[_0x6ad3('0x25')],JSON['parse'](_0x24daf4['interaction']['formData']))},client9002)[_0x6ad3('0x35')](function(){return _0x24daf4;});}return _0x24daf4;}return null;})[_0x6ad3('0x35')](respondWithResult(_0x455aa5,null))[_0x6ad3('0x26')](handleError(_0x455aa5,null));};var interaction_log=require(_0x6ad3('0x59'))(_0x6ad3('0x5a'));exports['reject']=function(_0x55b210,_0x525b65,_0x53518a){var _0x5cd3fd={'agent':{},'channel':_0x6ad3('0x5c')};if(_0x55b210[_0x6ad3('0x57')]['id']){delete _0x55b210[_0x6ad3('0x57')]['id'];}_0x55b210[_0x6ad3('0x57')]['UserId']=_0x55b210[_0x6ad3('0x57')]['UserId']||_0x55b210['user']['id'];_0x5cd3fd['agent']['id']=_0x55b210['body'][_0x6ad3('0x60')];return db[_0x6ad3('0x54')][_0x6ad3('0x55')]({'where':{'id':_0x55b210[_0x6ad3('0x53')]['id'],'UserId':null}})[_0x6ad3('0x35')](handleEntityNotFound(_0x525b65,null))[_0x6ad3('0x35')](function(_0x55089e){if(_0x55089e){_0x5cd3fd[_0x6ad3('0x25')]=_0x55089e[_0x6ad3('0x65')]({'plain':!![]});return db['ChatInteraction'][_0x6ad3('0x55')]({'where':{'id':_0x55089e[_0x6ad3('0x7a')]}});}return null;})[_0x6ad3('0x35')](handleEntityNotFound(_0x525b65,null))['then'](function(_0x6e2470){if(_0x6e2470){_0x5cd3fd[_0x6ad3('0x64')]=_0x6e2470[_0x6ad3('0x65')]({'plain':!![]});interaction_log[_0x6ad3('0x1d')](_0x6ad3('0x7b'),_0x55b210[_0x6ad3('0x61')]['id'],_0x55b210[_0x6ad3('0x61')]['name'],_0x55b210[_0x6ad3('0x61')][_0x6ad3('0x67')],_0x5cd3fd[_0x6ad3('0x64')]['id'],_0x55b210[_0x6ad3('0x57')]?JSON[_0x6ad3('0x21')](_0x55b210['body']):_0x6ad3('0x7c'));return respondWithRpcPromise(_0x6ad3('0x7d'),'rejectMessage',_0x5cd3fd);}return null;})[_0x6ad3('0x35')](function(_0x52a61c){var _0x3b450e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x52a61c[_0x6ad3('0x25')][_0x6ad3('0x68')];return db['sequelize'][_0x6ad3('0x41')](_0x3b450e,{'type':db[_0x6ad3('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x18b01b){return _0x18b01b;});})[_0x6ad3('0x35')](function(_0x3d2a5a){if(_0x3d2a5a){_0x5cd3fd[_0x6ad3('0x25')][_0x6ad3('0x6c')]=_0x3d2a5a[0x0];if(!_0x55b210[_0x6ad3('0x57')][_0x6ad3('0x60')])return;return db[_0x6ad3('0x6d')]['find']({'where':{'id':_0x55b210['body'][_0x6ad3('0x60')],'role':_0x6ad3('0x6e')},'attributes':['id',_0x6ad3('0x38'),_0x6ad3('0x6f'),_0x6ad3('0x70'),_0x6ad3('0x71')],'raw':!![]});}return null;})[_0x6ad3('0x35')](function(_0x1923b4){if(!_0x1923b4)return null;_0x5cd3fd['message'][_0x6ad3('0x6e')]=_0x1923b4;return _0x5cd3fd;})[_0x6ad3('0x35')](function(_0x267834){if(_0x267834){_0x267834[_0x6ad3('0x25')]['interface']=util[_0x6ad3('0x5e')](_0x6ad3('0x74'),_0x55b210[_0x6ad3('0x61')][_0x6ad3('0x38')]);_0x267834['message']['channel']=_0x5cd3fd[_0x6ad3('0x75')];_0x267834[_0x6ad3('0x25')][_0x6ad3('0x76')]=_0x5cd3fd[_0x6ad3('0x75')];_0x267834[_0x6ad3('0x25')][_0x6ad3('0x77')]=_0x6ad3('0x32');respondWithRpcPromise('EventManager',_0x6ad3('0x78'),{'event':_0x6ad3('0x7e'),'message':_[_0x6ad3('0x4c')](_0x5cd3fd[_0x6ad3('0x25')],JSON['parse'](_0x5cd3fd['interaction'][_0x6ad3('0x7f')]))},client9002);return _0x5cd3fd;}return null;})[_0x6ad3('0x35')](respondWithResult(_0x525b65,null))[_0x6ad3('0x26')](handleError(_0x525b65,null));};
\ No newline at end of file
+var _0xd16a=['result','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','reject','save','destroy','stack','name','map','ChatMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','show','rawAttributes','includeAll','include','find','catch','create','body','update','params','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','ChatInteractionId','isNil','interaction','get','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','agent','internal','manual','SIP/%s','channel','event','EventManager','formData','ChatInteraction','null','RejectMessage','rejectMessage','ContactId','Sequelize','email','interface','motionChannel','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x47c825,_0x5355be){var _0x12f621=function(_0x28072c){while(--_0x28072c){_0x47c825['push'](_0x47c825['shift']());}};_0x12f621(++_0x5355be);}(_0xd16a,0x167));var _0xad16=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd16a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xad16('0x0'));var rimraf=require(_0xad16('0x1'));var zipdir=require(_0xad16('0x2'));var jsonpatch=require(_0xad16('0x3'));var rp=require(_0xad16('0x4'));var moment=require('moment');var BPromise=require(_0xad16('0x5'));var Mustache=require(_0xad16('0x6'));var util=require(_0xad16('0x7'));var path=require(_0xad16('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad16('0x9'));var _=require(_0xad16('0xa'));var squel=require(_0xad16('0xb'));var crypto=require(_0xad16('0xc'));var jsforce=require(_0xad16('0xd'));var deskjs=require(_0xad16('0xe'));var toCsv=require(_0xad16('0xf'));var querystring=require(_0xad16('0x10'));var Papa=require(_0xad16('0x11'));var Redis=require('ioredis');var authService=require(_0xad16('0x12'));var qs=require(_0xad16('0x13'));var as=require(_0xad16('0x14'));var hardwareService=require(_0xad16('0x15'));var logger=require(_0xad16('0x16'))('api');var utils=require(_0xad16('0x17'));var config=require(_0xad16('0x18'));var licenseUtil=require(_0xad16('0x19'));var db=require(_0xad16('0x1a'))['db'];config[_0xad16('0x1b')]=_['defaults'](config[_0xad16('0x1b')],{'host':_0xad16('0x1c'),'port':0x18eb});var socket=require(_0xad16('0x1d'))(new Redis(config['redis']));require(_0xad16('0x1e'))[_0xad16('0x1f')](socket);var jayson=require(_0xad16('0x20'));var client=jayson[_0xad16('0x21')][_0xad16('0x22')]({'port':0x232c});var client9002=jayson[_0xad16('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36ae2f,_0x553be1,_0x5a5ad1,_0x35982e){return new BPromise(function(_0x254843,_0x1a61d0){var _0x2f5c4f=_0x35982e||client;return _0x2f5c4f[_0xad16('0x23')](_0x36ae2f,_0x5a5ad1)[_0xad16('0x24')](function(_0x1eb8d3){logger[_0xad16('0x25')](_0xad16('0x26'),_0x553be1,_0xad16('0x27'));logger[_0xad16('0x28')](_0xad16('0x29'),_0x553be1,_0xad16('0x27'),JSON[_0xad16('0x2a')](_0x1eb8d3));if(_0x1eb8d3[_0xad16('0x2b')]){if(_0x1eb8d3[_0xad16('0x2b')][_0xad16('0x2c')]===0x1f4){logger['error'](_0xad16('0x26'),_0x553be1,_0x1eb8d3[_0xad16('0x2b')][_0xad16('0x2d')]);return _0x1a61d0(_0x1eb8d3[_0xad16('0x2b')][_0xad16('0x2d')]);}logger[_0xad16('0x2b')](_0xad16('0x26'),_0x553be1,_0x1eb8d3['error'][_0xad16('0x2d')]);return _0x254843(_0x1eb8d3['error'][_0xad16('0x2d')]);}else{logger['info'](_0xad16('0x26'),_0x553be1,_0xad16('0x27'));_0x254843(_0x1eb8d3[_0xad16('0x2e')][_0xad16('0x2d')]);}})['catch'](function(_0xd93752){logger[_0xad16('0x2b')](_0xad16('0x26'),_0x553be1,_0xd93752);_0x1a61d0(_0xd93752);});});}function respondWithStatusCode(_0x1a227f,_0x772d46){_0x772d46=_0x772d46||0xcc;return function(_0x4aa910){if(_0x4aa910){return _0x1a227f[_0xad16('0x2f')](_0x772d46);}return _0x1a227f['status'](_0x772d46)[_0xad16('0x30')]();};}function respondWithResult(_0x34f925,_0x2c097c){_0x2c097c=_0x2c097c||0xc8;return function(_0x130d76){if(_0x130d76){return _0x34f925['status'](_0x2c097c)[_0xad16('0x31')](_0x130d76);}};}function respondWithFilteredResult(_0x530b25,_0xceb1b7){return function(_0x24929a){if(_0x24929a){var _0x22144c=typeof _0xceb1b7[_0xad16('0x32')]==='undefined'&&typeof _0xceb1b7[_0xad16('0x33')]==='undefined';var _0x1140b0=_0x24929a[_0xad16('0x34')];var _0x48bd4f=_0x22144c?0x0:_0xceb1b7['offset'];var _0x39f328=_0x22144c?_0x24929a[_0xad16('0x34')]:_0xceb1b7[_0xad16('0x32')]+_0xceb1b7[_0xad16('0x33')];var _0x55ef03;if(_0x39f328>=_0x1140b0){_0x39f328=_0x1140b0;_0x55ef03=0xc8;}else{_0x55ef03=0xce;}_0x530b25[_0xad16('0x35')](_0x55ef03);return _0x530b25[_0xad16('0x36')](_0xad16('0x37'),_0x48bd4f+'-'+_0x39f328+'/'+_0x1140b0)[_0xad16('0x31')](_0x24929a);}return null;};}function patchUpdates(_0x1d5787){return function(_0x5e4686){try{jsonpatch[_0xad16('0x38')](_0x5e4686,_0x1d5787,!![]);}catch(_0x10043b){return BPromise[_0xad16('0x39')](_0x10043b);}return _0x5e4686[_0xad16('0x3a')]();};}function saveUpdates(_0xbaafd6,_0x58ac6b){return function(_0x487662){if(_0x487662){return _0x487662['update'](_0xbaafd6)[_0xad16('0x24')](function(_0x52c50f){return _0x52c50f;});}return null;};}function removeEntity(_0xfb74f7,_0x58de90){return function(_0x3053f3){if(_0x3053f3){return _0x3053f3[_0xad16('0x3b')]()[_0xad16('0x24')](function(){_0xfb74f7['status'](0xcc)[_0xad16('0x30')]();});}};}function handleEntityNotFound(_0x44bd09,_0x286210){return function(_0x444087){if(!_0x444087){_0x44bd09[_0xad16('0x2f')](0x194);}return _0x444087;};}function handleError(_0x543d93,_0x28897a){_0x28897a=_0x28897a||0x1f4;return function(_0x2f390e){logger[_0xad16('0x2b')](_0x2f390e[_0xad16('0x3c')]);if(_0x2f390e[_0xad16('0x3d')]){delete _0x2f390e[_0xad16('0x3d')];}_0x543d93['status'](_0x28897a)['send'](_0x2f390e);};}exports['index']=function(_0x3ee781,_0x1a7a24){var _0x15125e={},_0x41381d={},_0x57a700={'count':0x0,'rows':[]};var _0x53bf1e=_[_0xad16('0x3e')](db[_0xad16('0x3f')]['rawAttributes'],function(_0x38ec88){return{'name':_0x38ec88[_0xad16('0x40')],'type':_0x38ec88[_0xad16('0x41')][_0xad16('0x42')]};});_0x41381d[_0xad16('0x43')]=_[_0xad16('0x3e')](_0x53bf1e,_0xad16('0x3d'));_0x41381d[_0xad16('0x44')]=_[_0xad16('0x45')](_0x3ee781['query']);_0x41381d[_0xad16('0x46')]=_[_0xad16('0x47')](_0x41381d[_0xad16('0x43')],_0x41381d['query']);_0x15125e[_0xad16('0x48')]=_[_0xad16('0x47')](_0x41381d['model'],qs['fields'](_0x3ee781[_0xad16('0x44')][_0xad16('0x49')]));_0x15125e[_0xad16('0x48')]=_0x15125e['attributes'][_0xad16('0x4a')]?_0x15125e[_0xad16('0x48')]:_0x41381d[_0xad16('0x43')];if(!_0x3ee781[_0xad16('0x44')]['hasOwnProperty']('nolimit')){_0x15125e[_0xad16('0x33')]=qs[_0xad16('0x33')](_0x3ee781[_0xad16('0x44')]['limit']);_0x15125e[_0xad16('0x32')]=qs[_0xad16('0x32')](_0x3ee781[_0xad16('0x44')][_0xad16('0x32')]);}_0x15125e[_0xad16('0x4b')]=qs[_0xad16('0x4c')](_0x3ee781[_0xad16('0x44')][_0xad16('0x4c')]);_0x15125e[_0xad16('0x4d')]=qs[_0xad16('0x46')](_[_0xad16('0x4e')](_0x3ee781[_0xad16('0x44')],_0x41381d[_0xad16('0x46')]),_0x53bf1e);if(_0x3ee781['query'][_0xad16('0x4f')]){_0x15125e[_0xad16('0x4d')]=_[_0xad16('0x50')](_0x15125e['where'],{'$or':_[_0xad16('0x3e')](_0x53bf1e,function(_0x3b8e2b){if(_0x3b8e2b[_0xad16('0x41')]!==_0xad16('0x51')){var _0x223f2a={};_0x223f2a[_0x3b8e2b[_0xad16('0x3d')]]={'$like':'%'+_0x3ee781[_0xad16('0x44')][_0xad16('0x4f')]+'%'};return _0x223f2a;}})});}_0x15125e=_[_0xad16('0x50')]({},_0x15125e,_0x3ee781[_0xad16('0x52')]);var _0xf10d7={'where':_0x15125e[_0xad16('0x4d')]};return db[_0xad16('0x3f')][_0xad16('0x34')](_0xf10d7)[_0xad16('0x24')](function(_0x114f1f){_0x57a700[_0xad16('0x34')]=_0x114f1f;if(_0x3ee781[_0xad16('0x44')]['includeAll']){_0x15125e['include']=[{'all':!![]}];}return db[_0xad16('0x3f')][_0xad16('0x53')](_0x15125e);})[_0xad16('0x24')](function(_0x35e284){_0x57a700['rows']=_0x35e284;return _0x57a700;})['then'](respondWithFilteredResult(_0x1a7a24,_0x15125e))['catch'](handleError(_0x1a7a24,null));};exports[_0xad16('0x54')]=function(_0x16140c,_0x52d98d){var _0x5ced46={'raw':!![],'where':{'id':_0x16140c['params']['id']}},_0x5bda1f={};_0x5bda1f['model']=_[_0xad16('0x45')](db['ChatMessage'][_0xad16('0x55')]);_0x5bda1f[_0xad16('0x44')]=_['keys'](_0x16140c[_0xad16('0x44')]);_0x5bda1f['filters']=_[_0xad16('0x47')](_0x5bda1f[_0xad16('0x43')],_0x5bda1f[_0xad16('0x44')]);_0x5ced46[_0xad16('0x48')]=_[_0xad16('0x47')](_0x5bda1f[_0xad16('0x43')],qs[_0xad16('0x49')](_0x16140c['query'][_0xad16('0x49')]));_0x5ced46[_0xad16('0x48')]=_0x5ced46[_0xad16('0x48')]['length']?_0x5ced46[_0xad16('0x48')]:_0x5bda1f[_0xad16('0x43')];if(_0x16140c['query'][_0xad16('0x56')]){_0x5ced46[_0xad16('0x57')]=[{'all':!![]}];}_0x5ced46=_[_0xad16('0x50')]({},_0x5ced46,_0x16140c[_0xad16('0x52')]);return db[_0xad16('0x3f')][_0xad16('0x58')](_0x5ced46)['then'](handleEntityNotFound(_0x52d98d,null))['then'](respondWithResult(_0x52d98d,null))[_0xad16('0x59')](handleError(_0x52d98d,null));};exports[_0xad16('0x5a')]=function(_0xb25591,_0x39bb14){return db['ChatMessage'][_0xad16('0x5a')](_0xb25591[_0xad16('0x5b')],{})[_0xad16('0x24')](respondWithResult(_0x39bb14,0xc9))[_0xad16('0x59')](handleError(_0x39bb14,null));};exports[_0xad16('0x5c')]=function(_0x3d8777,_0x86da87){if(_0x3d8777['body']['id']){delete _0x3d8777[_0xad16('0x5b')]['id'];}return db[_0xad16('0x3f')][_0xad16('0x58')]({'where':{'id':_0x3d8777[_0xad16('0x5d')]['id']}})[_0xad16('0x24')](handleEntityNotFound(_0x86da87,null))['then'](saveUpdates(_0x3d8777['body'],null))[_0xad16('0x24')](respondWithResult(_0x86da87,null))[_0xad16('0x59')](handleError(_0x86da87,null));};exports[_0xad16('0x3b')]=function(_0x45f280,_0x2db1cb){return db[_0xad16('0x3f')][_0xad16('0x58')]({'where':{'id':_0x45f280['params']['id']}})[_0xad16('0x24')](handleEntityNotFound(_0x2db1cb,null))['then'](removeEntity(_0x2db1cb,null))[_0xad16('0x59')](handleError(_0x2db1cb,null));};exports[_0xad16('0x5e')]=function(_0x51d845,_0x1a1607){return db[_0xad16('0x3f')]['describe']()[_0xad16('0x24')](respondWithResult(_0x1a1607,null))[_0xad16('0x59')](handleError(_0x1a1607,null));};var interaction_log=require(_0xad16('0x16'))(_0xad16('0x5f'));exports[_0xad16('0x60')]=function(_0x553566,_0x40fc60,_0x467333){var _0x2a47b2={'agent':{},'channel':_0xad16('0x61')};if(_0x553566[_0xad16('0x5b')]['id']){delete _0x553566[_0xad16('0x5b')]['id'];}_0x553566[_0xad16('0x5b')][_0xad16('0x62')]=!![];_0x553566[_0xad16('0x5b')]['readAt']=moment()[_0xad16('0x63')](_0xad16('0x64'));_0x553566['body'][_0xad16('0x65')]=_0x553566[_0xad16('0x5b')]['UserId']||_0x553566['user']['id'];_0x2a47b2['agent']['id']=_0x553566[_0xad16('0x5b')][_0xad16('0x65')];return db[_0xad16('0x3f')]['find']({'where':{'id':_0x553566[_0xad16('0x5d')]['id'],'UserId':null}})[_0xad16('0x24')](handleEntityNotFound(_0x40fc60,null))[_0xad16('0x24')](saveUpdates(_0x553566['body'],null))[_0xad16('0x24')](function(_0x328e03){if(_0x328e03){_0x2a47b2[_0xad16('0x2d')]=_0x328e03['get']({'plain':!![]});return db['ChatInteraction'][_0xad16('0x58')]({'where':{'id':_0x328e03[_0xad16('0x66')]}});}return null;})[_0xad16('0x24')](handleEntityNotFound(_0x40fc60,null))[_0xad16('0x24')](function(_0x154037){if(_0x154037){return _0x154037['update']({'UserId':_0x553566[_0xad16('0x5b')][_0xad16('0x65')],'read1stAt':_[_0xad16('0x67')](_0x154037['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x120ab0){if(_0x120ab0){_0x2a47b2[_0xad16('0x68')]=_0x120ab0[_0xad16('0x69')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x553566['user']['id'],_0x553566[_0xad16('0x6a')][_0xad16('0x3d')],_0x553566[_0xad16('0x6a')][_0xad16('0x6b')],_0x2a47b2[_0xad16('0x68')]['id'],_0x553566[_0xad16('0x5b')]?JSON[_0xad16('0x2a')](_0x553566[_0xad16('0x5b')]):'null');return respondWithRpcPromise(_0xad16('0x6c'),_0xad16('0x6d'),_0x2a47b2);}return null;})[_0xad16('0x24')](function(_0x57c96b){var _0x11834d=_0xad16('0x6e')+_0x57c96b[_0xad16('0x2d')]['ContactId'];return db[_0xad16('0x6f')][_0xad16('0x44')](_0x11834d,{'type':db['Sequelize'][_0xad16('0x70')][_0xad16('0x71')],'raw':!![]})[_0xad16('0x24')](function(_0x1e41fd){return _0x1e41fd;});})['then'](function(_0x560e94){if(_0x560e94){_0x2a47b2['message'][_0xad16('0x72')]=_0x560e94[0x0];if(!_0x553566[_0xad16('0x5b')][_0xad16('0x65')])return;return db[_0xad16('0x73')][_0xad16('0x58')]({'where':{'id':_0x553566[_0xad16('0x5b')][_0xad16('0x65')],'role':_0xad16('0x74')},'attributes':['id',_0xad16('0x3d'),'fullname','email',_0xad16('0x75')],'raw':!![]});}return null;})['then'](function(_0x7b5a19){if(!_0x7b5a19)return null;_0x2a47b2[_0xad16('0x2d')][_0xad16('0x74')]=_0x7b5a19;return _0x2a47b2;})[_0xad16('0x24')](function(_0x4a741d){if(_0x4a741d){if(_0x553566[_0xad16('0x5b')][_0xad16('0x76')]){_0x2a47b2[_0xad16('0x2d')]['interface']=util[_0xad16('0x63')](_0xad16('0x77'),_0x553566[_0xad16('0x6a')][_0xad16('0x3d')]);_0x2a47b2['message']['channel']=_0x2a47b2['channel'];_0x2a47b2[_0xad16('0x2d')]['motionChannel']=_0x2a47b2[_0xad16('0x78')];_0x2a47b2['message'][_0xad16('0x79')]='accept';return respondWithRpcPromise(_0xad16('0x7a'),'EventManager',{'event':'acceptmessage','message':_['merge'](_0x2a47b2[_0xad16('0x2d')],JSON['parse'](_0x2a47b2[_0xad16('0x68')][_0xad16('0x7b')]))},client9002)[_0xad16('0x24')](function(){return _0x2a47b2;});}return _0x2a47b2;}return null;})['then'](respondWithResult(_0x40fc60,null))[_0xad16('0x59')](handleError(_0x40fc60,null));};var interaction_log=require(_0xad16('0x16'))(_0xad16('0x5f'));exports[_0xad16('0x39')]=function(_0x1a7509,_0x55adfb,_0xadd3e9){var _0x3894b8={'agent':{},'channel':_0xad16('0x61')};if(_0x1a7509['body']['id']){delete _0x1a7509[_0xad16('0x5b')]['id'];}_0x1a7509['body']['UserId']=_0x1a7509['body']['UserId']||_0x1a7509[_0xad16('0x6a')]['id'];_0x3894b8[_0xad16('0x74')]['id']=_0x1a7509[_0xad16('0x5b')]['UserId'];return db[_0xad16('0x3f')]['find']({'where':{'id':_0x1a7509[_0xad16('0x5d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x55adfb,null))[_0xad16('0x24')](function(_0x1a0977){if(_0x1a0977){_0x3894b8[_0xad16('0x2d')]=_0x1a0977[_0xad16('0x69')]({'plain':!![]});return db[_0xad16('0x7c')]['find']({'where':{'id':_0x1a0977[_0xad16('0x66')]}});}return null;})[_0xad16('0x24')](handleEntityNotFound(_0x55adfb,null))[_0xad16('0x24')](function(_0x556db3){if(_0x556db3){_0x3894b8[_0xad16('0x68')]=_0x556db3[_0xad16('0x69')]({'plain':!![]});interaction_log[_0xad16('0x25')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1a7509['user']['id'],_0x1a7509[_0xad16('0x6a')][_0xad16('0x3d')],_0x1a7509[_0xad16('0x6a')][_0xad16('0x6b')],_0x3894b8['interaction']['id'],_0x1a7509[_0xad16('0x5b')]?JSON[_0xad16('0x2a')](_0x1a7509[_0xad16('0x5b')]):_0xad16('0x7d'));return respondWithRpcPromise(_0xad16('0x7e'),_0xad16('0x7f'),_0x3894b8);}return null;})[_0xad16('0x24')](function(_0x1a1c51){var _0x419fb5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1a1c51['message'][_0xad16('0x80')];return db['sequelize'][_0xad16('0x44')](_0x419fb5,{'type':db[_0xad16('0x81')][_0xad16('0x70')]['SELECT'],'raw':!![]})[_0xad16('0x24')](function(_0x567afc){return _0x567afc;});})['then'](function(_0x5704eb){if(_0x5704eb){_0x3894b8[_0xad16('0x2d')]['contact']=_0x5704eb[0x0];if(!_0x1a7509[_0xad16('0x5b')][_0xad16('0x65')])return;return db[_0xad16('0x73')][_0xad16('0x58')]({'where':{'id':_0x1a7509[_0xad16('0x5b')]['UserId'],'role':'agent'},'attributes':['id',_0xad16('0x3d'),'fullname',_0xad16('0x82'),'internal'],'raw':!![]});}return null;})['then'](function(_0x1ef7d7){if(!_0x1ef7d7)return null;_0x3894b8[_0xad16('0x2d')][_0xad16('0x74')]=_0x1ef7d7;return _0x3894b8;})['then'](function(_0x329e67){if(_0x329e67){_0x329e67[_0xad16('0x2d')][_0xad16('0x83')]=util[_0xad16('0x63')](_0xad16('0x77'),_0x1a7509[_0xad16('0x6a')][_0xad16('0x3d')]);_0x329e67[_0xad16('0x2d')][_0xad16('0x78')]=_0x3894b8[_0xad16('0x78')];_0x329e67[_0xad16('0x2d')][_0xad16('0x84')]=_0x3894b8[_0xad16('0x78')];_0x329e67[_0xad16('0x2d')][_0xad16('0x79')]=_0xad16('0x39');respondWithRpcPromise(_0xad16('0x7a'),'EventManager',{'event':_0xad16('0x85'),'message':_[_0xad16('0x50')](_0x3894b8['message'],JSON[_0xad16('0x86')](_0x3894b8[_0xad16('0x68')][_0xad16('0x7b')]))},client9002);return _0x3894b8;}return null;})[_0xad16('0x24')](respondWithResult(_0x55adfb,null))[_0xad16('0x59')](handleError(_0x55adfb,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index ea2025b..204d981 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 _0x6a2b=['exports','../../mysqldb','ChatMessage','setMaxListeners','update','remove','hook'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x6a2b,0x19e));var _0xb6a2=function(_0x55a41c,_0x2ced02){_0x55a41c=_0x55a41c-0x0;var _0x278b73=_0x6a2b[_0x55a41c];return _0x278b73;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xb6a2('0x0'))['db'][_0xb6a2('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb6a2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb6a2('0x3'),'afterDestroy':_0xb6a2('0x4')};function emitEvent(_0x17d345){return function(_0x5d85d9,_0x33a583,_0x47bd30){ChatMessageEvents['emit'](_0x17d345+':'+_0x5d85d9['id'],_0x5d85d9);ChatMessageEvents['emit'](_0x17d345,_0x5d85d9);_0x47bd30(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xb6a2('0x5')](e,emitEvent(event));}}module[_0xb6a2('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0xa1dd=['ChatMessage','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4b4508,_0x2fd5cf){var _0x49db31=function(_0x41217a){while(--_0x41217a){_0x4b4508['push'](_0x4b4508['shift']());}};_0x49db31(++_0x2fd5cf);}(_0xa1dd,0x11e));var _0xda1d=function(_0x3e80af,_0x132c33){_0x3e80af=_0x3e80af-0x0;var _0x1ec9a8=_0xa1dd[_0x3e80af];return _0x1ec9a8;};'use strict';var EventEmitter=require(_0xda1d('0x0'));var ChatMessage=require(_0xda1d('0x1'))['db'][_0xda1d('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xda1d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xda1d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x45d4eb){return function(_0x39fe07,_0x29b6a8,_0x5d9375){ChatMessageEvents[_0xda1d('0x5')](_0x45d4eb+':'+_0x39fe07['id'],_0x39fe07);ChatMessageEvents[_0xda1d('0x5')](_0x45d4eb,_0x39fe07);_0x5d9375(null);};}for(var e in events){if(events[_0xda1d('0x6')](e)){var event=events[e];ChatMessage[_0xda1d('0x7')](e,emitEvent(event));}}module[_0xda1d('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 9597399..2f11025 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 _0x0a34=['get','direction','toLowerCase','secret','isNil','ChatInteraction','findOne','then','update','createdAt','error','utf8mb4','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','body','FULLTEXT'];(function(_0x21343a,_0x42204c){var _0x4ce4f8=function(_0x548875){while(--_0x548875){_0x21343a['push'](_0x21343a['shift']());}};_0x4ce4f8(++_0x42204c);}(_0x0a34,0x12a));var _0x40a3=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x0a34[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x40a3('0x0'));var util=require(_0x40a3('0x1'));var logger=require('../../config/logger')(_0x40a3('0x2'));var moment=require(_0x40a3('0x3'));var BPromise=require(_0x40a3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x40a3('0x5'));var rimraf=require(_0x40a3('0x6'));var config=require(_0x40a3('0x7'));var attributes=require('./chatMessage.attributes');module[_0x40a3('0x8')]=function(_0x1cdc8a,_0xbda4a8){return _0x1cdc8a[_0x40a3('0x9')](_0x40a3('0xa'),attributes,{'tableName':_0x40a3('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x40a3('0xc')],'type':_0x40a3('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x258101,_0x1459bc,_0x519e1b){var _0x2edb15=_0x1cdc8a['models'];var _0x643d61=_0x258101[_0x40a3('0xe')]({'plain':!![]});if(_0x643d61[_0x40a3('0xf')]['toLowerCase']()==='in'||_0x643d61[_0x40a3('0xf')][_0x40a3('0x10')]()==='out'&&!_0x643d61[_0x40a3('0x11')]&&!_[_0x40a3('0x12')](_0x643d61['UserId'])){_0x2edb15[_0x40a3('0x13')][_0x40a3('0x14')]({'where':{'id':_0x643d61['ChatInteractionId']}})[_0x40a3('0x15')](function(_0x3ced7b){if(_0x3ced7b){_0x3ced7b[_0x40a3('0x16')]({'lastMsgAt':_0x643d61[_0x40a3('0x17')],'lastMsgDirection':_0x643d61['direction']['toLowerCase']()});}})['catch'](function(_0x28bb05){console[_0x40a3('0x18')](_0x28bb05);});}_0x519e1b();}},'charset':_0x40a3('0x19'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x9380=['api','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci'];(function(_0x1eb9f0,_0x16f8a6){var _0x3b900a=function(_0x6cd644){while(--_0x6cd644){_0x1eb9f0['push'](_0x1eb9f0['shift']());}};_0x3b900a(++_0x16f8a6);}(_0x9380,0x1b3));var _0x0938=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x9380[_0x29d94e];return _0x106237;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0938('0x0'));var moment=require(_0x0938('0x1'));var BPromise=require(_0x0938('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0938('0x3'));var rimraf=require(_0x0938('0x4'));var config=require(_0x0938('0x5'));var attributes=require(_0x0938('0x6'));module[_0x0938('0x7')]=function(_0x39e169,_0x27def8){return _0x39e169[_0x0938('0x8')](_0x0938('0x9'),attributes,{'tableName':_0x0938('0xa'),'paranoid':![],'indexes':[{'name':_0x0938('0xb'),'fields':[_0x0938('0xc')],'type':_0x0938('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x409fe6,_0x360d34,_0x134a03){var _0x4d0520=_0x39e169[_0x0938('0xe')];var _0x361195=_0x409fe6[_0x0938('0xf')]({'plain':!![]});if(_0x361195[_0x0938('0x10')][_0x0938('0x11')]()==='in'||_0x361195['direction'][_0x0938('0x11')]()===_0x0938('0x12')&&!_0x361195['secret']&&!_['isNil'](_0x361195[_0x0938('0x13')])){_0x4d0520[_0x0938('0x14')][_0x0938('0x15')]({'where':{'id':_0x361195[_0x0938('0x16')]}})[_0x0938('0x17')](function(_0x5620b3){if(_0x5620b3){_0x5620b3[_0x0938('0x18')]({'lastMsgAt':_0x361195[_0x0938('0x19')],'lastMsgDirection':_0x361195[_0x0938('0x10')][_0x0938('0x11')]()});}})[_0x0938('0x1a')](function(_0x5829b9){console[_0x0938('0x1b')](_0x5829b9);});}_0x134a03();}},'charset':'utf8mb4','collate':_0x0938('0x1c')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index b642a4c..caf845e 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 _0x1220=['request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost'];(function(_0x266010,_0x2735e7){var _0x4aa73a=function(_0x43dc89){while(--_0x43dc89){_0x266010['push'](_0x266010['shift']());}};_0x4aa73a(++_0x2735e7);}(_0x1220,0x8a));var _0x0122=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x1220[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x0122('0x0'));var util=require(_0x0122('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0122('0x2'));var db=require(_0x0122('0x3'))['db'];var utils=require(_0x0122('0x4'));var logger=require(_0x0122('0x5'))(_0x0122('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0122('0x7')][_0x0122('0x8')]({'port':0x232a});config[_0x0122('0x9')]=_[_0x0122('0xa')](config['redis'],{'host':_0x0122('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2d0fa4,_0x21b455,_0x305412){return new BPromise(function(_0xa304e2,_0x3c4e33){return client[_0x0122('0xc')](_0x2d0fa4,_0x305412)[_0x0122('0xd')](function(_0x301578){logger['info'](_0x0122('0xe'),_0x21b455,_0x0122('0xf'));logger[_0x0122('0x10')](_0x0122('0x11'),_0x21b455,_0x0122('0xf'),JSON[_0x0122('0x12')](_0x301578));if(_0x301578[_0x0122('0x13')]){if(_0x301578[_0x0122('0x13')][_0x0122('0x14')]===0x1f4){logger[_0x0122('0x13')](_0x0122('0xe'),_0x21b455,_0x301578[_0x0122('0x13')][_0x0122('0x15')]);return _0x3c4e33(_0x301578['error'][_0x0122('0x15')]);}logger[_0x0122('0x13')]('ChatMessage,\x20%s,\x20%s',_0x21b455,_0x301578[_0x0122('0x13')][_0x0122('0x15')]);return _0xa304e2(_0x301578[_0x0122('0x13')]['message']);}else{logger[_0x0122('0x16')](_0x0122('0xe'),_0x21b455,_0x0122('0xf'));_0xa304e2(_0x301578[_0x0122('0x17')][_0x0122('0x15')]);}})[_0x0122('0x18')](function(_0x5d3016){logger[_0x0122('0x13')](_0x0122('0xe'),_0x21b455,_0x5d3016);_0x3c4e33(_0x5d3016);});});}exports[_0x0122('0x19')]=function(_0x547acd){var _0x2401ed=this;return new Promise(function(_0x49c984,_0xdda6b1){return db[_0x0122('0x1a')]['create'](_0x547acd[_0x0122('0x1b')],{'raw':_0x547acd[_0x0122('0x1c')]?_0x547acd[_0x0122('0x1c')][_0x0122('0x1d')]===undefined?!![]:![]:!![]})[_0x0122('0xd')](function(_0x4d08e6){logger[_0x0122('0x16')](_0x0122('0x19'),_0x547acd);logger[_0x0122('0x10')](_0x0122('0x19'),_0x547acd,JSON['stringify'](_0x4d08e6));_0x49c984(_0x4d08e6);})[_0x0122('0x18')](function(_0x136856){logger[_0x0122('0x13')](_0x0122('0x19'),_0x136856['message'],_0x547acd);_0xdda6b1(_0x2401ed[_0x0122('0x13')](0x1f4,_0x136856[_0x0122('0x15')]));});});};
\ No newline at end of file
+var _0x5a43=['socket.io-emitter','./chatMessage.socket','register','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ChatMessage','create','options','raw','then','CreateChatMessage','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis'];(function(_0x170983,_0x49786d){var _0x1e6962=function(_0x19075a){while(--_0x19075a){_0x170983['push'](_0x170983['shift']());}};_0x1e6962(++_0x49786d);}(_0x5a43,0x12a));var _0x35a4=function(_0x1813d8,_0x52abf1){_0x1813d8=_0x1813d8-0x0;var _0xf09630=_0x5a43[_0x1813d8];return _0xf09630;};'use strict';var _=require(_0x35a4('0x0'));var util=require(_0x35a4('0x1'));var moment=require('moment');var BPromise=require(_0x35a4('0x2'));var rs=require(_0x35a4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35a4('0x4'))['db'];var utils=require(_0x35a4('0x5'));var logger=require('../../config/logger')(_0x35a4('0x6'));var config=require('../../config/environment');var jayson=require(_0x35a4('0x7'));var client=jayson[_0x35a4('0x8')][_0x35a4('0x9')]({'port':0x232a});config['redis']=_[_0x35a4('0xa')](config[_0x35a4('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x35a4('0xc'))(new Redis(config['redis']));require(_0x35a4('0xd'))[_0x35a4('0xe')](socket);function respondWithRpcPromise(_0xaf708a,_0x1631fa,_0x5431e5){return new BPromise(function(_0x4194dc,_0x4f44e5){return client['request'](_0xaf708a,_0x5431e5)['then'](function(_0x5c3f13){logger[_0x35a4('0xf')](_0x35a4('0x10'),_0x1631fa,'request\x20sent');logger[_0x35a4('0x11')](_0x35a4('0x12'),_0x1631fa,_0x35a4('0x13'),JSON[_0x35a4('0x14')](_0x5c3f13));if(_0x5c3f13['error']){if(_0x5c3f13[_0x35a4('0x15')][_0x35a4('0x16')]===0x1f4){logger[_0x35a4('0x15')](_0x35a4('0x10'),_0x1631fa,_0x5c3f13[_0x35a4('0x15')][_0x35a4('0x17')]);return _0x4f44e5(_0x5c3f13[_0x35a4('0x15')][_0x35a4('0x17')]);}logger[_0x35a4('0x15')]('ChatMessage,\x20%s,\x20%s',_0x1631fa,_0x5c3f13[_0x35a4('0x15')]['message']);return _0x4194dc(_0x5c3f13[_0x35a4('0x15')][_0x35a4('0x17')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x1631fa,_0x35a4('0x13'));_0x4194dc(_0x5c3f13['result'][_0x35a4('0x17')]);}})[_0x35a4('0x18')](function(_0x5a6ab1){logger[_0x35a4('0x15')](_0x35a4('0x10'),_0x1631fa,_0x5a6ab1);_0x4f44e5(_0x5a6ab1);});});}exports['CreateChatMessage']=function(_0x323446){var _0x2e29ee=this;return new Promise(function(_0x1c5a0a,_0x49d5ce){return db[_0x35a4('0x19')][_0x35a4('0x1a')](_0x323446['body'],{'raw':_0x323446['options']?_0x323446[_0x35a4('0x1b')][_0x35a4('0x1c')]===undefined?!![]:![]:!![]})[_0x35a4('0x1d')](function(_0x11b9d5){logger[_0x35a4('0xf')](_0x35a4('0x1e'),_0x323446);logger['debug'](_0x35a4('0x1e'),_0x323446,JSON[_0x35a4('0x14')](_0x11b9d5));_0x1c5a0a(_0x11b9d5);})['catch'](function(_0x5785fd){logger[_0x35a4('0x15')]('CreateChatMessage',_0x5785fd[_0x35a4('0x17')],_0x323446);_0x49d5ce(_0x2e29ee[_0x35a4('0x15')](0x1f4,_0x5785fd[_0x35a4('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 1c7b66d..ccce69e 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 _0xf185=['update','emit','removeListener','register','length','./chatMessage.events','remove'];(function(_0x4fbc23,_0x559772){var _0x45dc12=function(_0xf31bd1){while(--_0xf31bd1){_0x4fbc23['push'](_0x4fbc23['shift']());}};_0x45dc12(++_0x559772);}(_0xf185,0x1be));var _0x5f18=function(_0x11ae93,_0x52a4e6){_0x11ae93=_0x11ae93-0x0;var _0x33435c=_0xf185[_0x11ae93];return _0x33435c;};'use strict';var ChatMessageEvents=require(_0x5f18('0x0'));var events=['save',_0x5f18('0x1'),_0x5f18('0x2')];function createListener(_0x26ab30,_0x3100aa){return function(_0x40e868){_0x3100aa[_0x5f18('0x3')](_0x26ab30,_0x40e868);};}function removeListener(_0x529b25,_0x33d44f){return function(){ChatMessageEvents[_0x5f18('0x4')](_0x529b25,_0x33d44f);};}exports[_0x5f18('0x5')]=function(_0x1cac08){for(var _0x5b7cc5=0x0,_0x2982d6=events[_0x5f18('0x6')];_0x5b7cc5<_0x2982d6;_0x5b7cc5++){var _0x47e05a=events[_0x5b7cc5];var _0x15b931=createListener('chatMessage:'+_0x47e05a,_0x1cac08);ChatMessageEvents['on'](_0x47e05a,_0x15b931);}};
\ No newline at end of file
+var _0x50d0=['update','removeListener','register','length','chatMessage:','./chatMessage.events','remove'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x50d0,0x101));var _0x050d=function(_0x5df47d,_0x56b70d){_0x5df47d=_0x5df47d-0x0;var _0x503d79=_0x50d0[_0x5df47d];return _0x503d79;};'use strict';var ChatMessageEvents=require(_0x050d('0x0'));var events=['save',_0x050d('0x1'),_0x050d('0x2')];function createListener(_0x449ea6,_0x3a26e2){return function(_0x2d73d4){_0x3a26e2['emit'](_0x449ea6,_0x2d73d4);};}function removeListener(_0x3553e3,_0xd37556){return function(){ChatMessageEvents[_0x050d('0x3')](_0x3553e3,_0xd37556);};}exports[_0x050d('0x4')]=function(_0x3c2dbe){for(var _0x20bede=0x0,_0x348909=events[_0x050d('0x5')];_0x20bede<_0x348909;_0x20bede++){var _0x2b2faa=events[_0x20bede];var _0x516f5d=createListener(_0x050d('0x6')+_0x2b2faa,_0x3c2dbe);ChatMessageEvents['on'](_0x2b2faa,_0x516f5d);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 1149092..0c855ba 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 _0x7853=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','post','tracked','chat','chatmessage:create','put','update','accept','reject','delete','multer'];(function(_0x545173,_0x46180a){var _0x270ef2=function(_0x1f2ea0){while(--_0x1f2ea0){_0x545173['push'](_0x545173['shift']());}};_0x270ef2(++_0x46180a);}(_0x7853,0xa7));var _0x3785=function(_0xec2394,_0x40b2df){_0xec2394=_0xec2394-0x0;var _0x2e78a0=_0x7853[_0xec2394];return _0x2e78a0;};'use strict';var multer=require(_0x3785('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3785('0x1'));var express=require(_0x3785('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3785('0x3'));var interaction=require(_0x3785('0x4'));var config=require(_0x3785('0x5'));var controller=require(_0x3785('0x6'));router[_0x3785('0x7')]('/',auth[_0x3785('0x8')](),controller['index']);router[_0x3785('0x7')](_0x3785('0x9'),auth[_0x3785('0x8')](),controller[_0x3785('0xa')]);router[_0x3785('0x7')](_0x3785('0xb'),auth[_0x3785('0x8')](),controller['show']);router[_0x3785('0xc')]('/',auth['isAuthenticated'](),interaction[_0x3785('0xd')](_0x3785('0xe'),_0x3785('0xf')),controller['create']);router[_0x3785('0x10')](_0x3785('0xb'),controller[_0x3785('0x11')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x3785('0x12')]);router['put']('/:id/reject',auth[_0x3785('0x8')](),controller[_0x3785('0x13')]);router[_0x3785('0x14')]('/:id',auth[_0x3785('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xb73f=['isAuthenticated','index','get','/describe','describe','show','post','tracked','chat','create','update','/:id/accept','put','/:id/reject','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatMessage.controller'];(function(_0x470bfb,_0x389787){var _0x2f5d97=function(_0x3431b4){while(--_0x3431b4){_0x470bfb['push'](_0x470bfb['shift']());}};_0x2f5d97(++_0x389787);}(_0xb73f,0x149));var _0xfb73=function(_0x29e91f,_0x19746f){_0x29e91f=_0x29e91f-0x0;var _0x96024=_0xb73f[_0x29e91f];return _0x96024;};'use strict';var multer=require(_0xfb73('0x0'));var util=require(_0xfb73('0x1'));var path=require(_0xfb73('0x2'));var timeout=require(_0xfb73('0x3'));var express=require(_0xfb73('0x4'));var router=express[_0xfb73('0x5')]();var fs_extra=require(_0xfb73('0x6'));var auth=require(_0xfb73('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfb73('0x8'));router['get']('/',auth[_0xfb73('0x9')](),controller[_0xfb73('0xa')]);router[_0xfb73('0xb')](_0xfb73('0xc'),auth['isAuthenticated'](),controller[_0xfb73('0xd')]);router[_0xfb73('0xb')]('/:id',auth[_0xfb73('0x9')](),controller[_0xfb73('0xe')]);router[_0xfb73('0xf')]('/',auth[_0xfb73('0x9')](),interaction[_0xfb73('0x10')](_0xfb73('0x11'),'chatmessage:create'),controller[_0xfb73('0x12')]);router['put']('/:id',controller[_0xfb73('0x13')]);router['put'](_0xfb73('0x14'),auth['isAuthenticated'](),controller['accept']);router[_0xfb73('0x15')](_0xfb73('0x16'),auth[_0xfb73('0x9')](),controller['reject']);router['delete'](_0xfb73('0x17'),auth['isAuthenticated'](),controller[_0xfb73('0x18')]);module[_0xfb73('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 30fbdab..27a2958 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 _0xb7c1=['exports','medium','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7c1,0x10a));var _0x1b7c=function(_0x930369,_0x3a255f){_0x930369=_0x930369-0x0;var _0x46afa0=_0xb7c1[_0x930369];return _0x46afa0;};'use strict';var Sequelize=require(_0x1b7c('0x0'));module[_0x1b7c('0x1')]={'body':{'type':Sequelize['TEXT'](_0x1b7c('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xeb53=['TEXT','exports'];(function(_0x3afb73,_0xaa578f){var _0x5165f2=function(_0x142ac9){while(--_0x142ac9){_0x3afb73['push'](_0x3afb73['shift']());}};_0x5165f2(++_0xaa578f);}(_0xeb53,0x1a7));var _0x3eb5=function(_0x588e7c,_0x112f11){_0x588e7c=_0x588e7c-0x0;var _0x97e0ce=_0xeb53[_0x588e7c];return _0x97e0ce;};'use strict';var Sequelize=require('sequelize');module[_0x3eb5('0x0')]={'body':{'type':Sequelize[_0x3eb5('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 7c9249b..dff3b34 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(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x7a54,0x106));var _0x47a5=function(_0x2794b4,_0x3b8468){_0x2794b4=_0x2794b4-0x0;var _0xc46db1=_0x7a54[_0x2794b4];return _0xc46db1;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x31abab,_0x2f71c5){var _0x384373=function(_0x201b7e){while(--_0x201b7e){_0x31abab['push'](_0x31abab['shift']());}};_0x384373(++_0x2f71c5);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 2e47e3e..6cac367 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 _0x9386=['define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports'];(function(_0x3685d6,_0x2ae608){var _0x628d2c=function(_0x34e316){while(--_0x34e316){_0x3685d6['push'](_0x3685d6['shift']());}};_0x628d2c(++_0x2ae608);}(_0x9386,0x108));var _0x6938=function(_0x2b31a2,_0x124f77){_0x2b31a2=_0x2b31a2-0x0;var _0x511515=_0x9386[_0x2b31a2];return _0x511515;};'use strict';var _=require('lodash');var util=require(_0x6938('0x0'));var logger=require(_0x6938('0x1'))(_0x6938('0x2'));var moment=require(_0x6938('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6938('0x4'));var rimraf=require(_0x6938('0x5'));var config=require(_0x6938('0x6'));var attributes=require(_0x6938('0x7'));module[_0x6938('0x8')]=function(_0x4e9443,_0x4056f8){return _0x4e9443[_0x6938('0x9')]('ChatOfflineMessage',attributes,{'tableName':_0x6938('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6938('0xb'),'collate':_0x6938('0xc')});};
\ No newline at end of file
+var _0x2059=['bluebird','./chatOfflineMessage.attributes','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2059,0x113));var _0x9205=function(_0x30f5bb,_0x4db4bd){_0x30f5bb=_0x30f5bb-0x0;var _0x1cfc00=_0x2059[_0x30f5bb];return _0x1cfc00;};'use strict';var _=require(_0x9205('0x0'));var util=require(_0x9205('0x1'));var logger=require(_0x9205('0x2'))(_0x9205('0x3'));var moment=require(_0x9205('0x4'));var BPromise=require(_0x9205('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9205('0x6'));module['exports']=function(_0x4db99a,_0x11ccc8){return _0x4db99a[_0x9205('0x7')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9205('0x8'),'collate':_0x9205('0x9')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index b4c6d6b..33ee9cb 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 _0x69a2=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x69a2,0x181));var _0x269a=function(_0x4c63ee,_0x1f719d){_0x4c63ee=_0x4c63ee-0x0;var _0x172087=_0x69a2[_0x4c63ee];return _0x172087;};'use strict';var _=require('lodash');var util=require(_0x269a('0x0'));var moment=require('moment');var BPromise=require(_0x269a('0x1'));var rs=require(_0x269a('0x2'));var fs=require('fs');var Redis=require(_0x269a('0x3'));var db=require(_0x269a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x269a('0x5'))(_0x269a('0x6'));var config=require(_0x269a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x269a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a8006,_0x1ca23b,_0x5f29f0){return new BPromise(function(_0x3dbc4e,_0x3012b3){return client[_0x269a('0x9')](_0x2a8006,_0x5f29f0)['then'](function(_0xf72a04){logger[_0x269a('0xa')](_0x269a('0xb'),_0x1ca23b,_0x269a('0xc'));logger[_0x269a('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1ca23b,_0x269a('0xc'),JSON[_0x269a('0xe')](_0xf72a04));if(_0xf72a04['error']){if(_0xf72a04[_0x269a('0xf')][_0x269a('0x10')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x1ca23b,_0xf72a04[_0x269a('0xf')]['message']);return _0x3012b3(_0xf72a04[_0x269a('0xf')]['message']);}logger[_0x269a('0xf')](_0x269a('0xb'),_0x1ca23b,_0xf72a04['error'][_0x269a('0x11')]);return _0x3dbc4e(_0xf72a04[_0x269a('0xf')]['message']);}else{logger[_0x269a('0xa')](_0x269a('0xb'),_0x1ca23b,_0x269a('0xc'));_0x3dbc4e(_0xf72a04[_0x269a('0x12')][_0x269a('0x11')]);}})[_0x269a('0x13')](function(_0x43f87a){logger[_0x269a('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1ca23b,_0x43f87a);_0x3012b3(_0x43f87a);});});}
\ No newline at end of file
+var _0x62f0=['error','message','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x835dbc,_0x3852e3){var _0x1ac9d7=function(_0x295263){while(--_0x295263){_0x835dbc['push'](_0x835dbc['shift']());}};_0x1ac9d7(++_0x3852e3);}(_0x62f0,0x167));var _0x062f=function(_0x121350,_0x361f4d){_0x121350=_0x121350-0x0;var _0x2e21c7=_0x62f0[_0x121350];return _0x2e21c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x062f('0x0'));var rs=require(_0x062f('0x1'));var fs=require('fs');var Redis=require(_0x062f('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x062f('0x3'))(_0x062f('0x4'));var config=require(_0x062f('0x5'));var jayson=require(_0x062f('0x6'));var client=jayson[_0x062f('0x7')][_0x062f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x504846,_0x5ae756,_0x107f00){return new BPromise(function(_0xde7ab0,_0x12d7fb){return client['request'](_0x504846,_0x107f00)[_0x062f('0x9')](function(_0x493d13){logger[_0x062f('0xa')](_0x062f('0xb'),_0x5ae756,_0x062f('0xc'));logger['debug'](_0x062f('0xd'),_0x5ae756,_0x062f('0xc'),JSON[_0x062f('0xe')](_0x493d13));if(_0x493d13['error']){if(_0x493d13['error']['code']===0x1f4){logger[_0x062f('0xf')](_0x062f('0xb'),_0x5ae756,_0x493d13[_0x062f('0xf')][_0x062f('0x10')]);return _0x12d7fb(_0x493d13[_0x062f('0xf')][_0x062f('0x10')]);}logger[_0x062f('0xf')](_0x062f('0xb'),_0x5ae756,_0x493d13[_0x062f('0xf')][_0x062f('0x10')]);return _0xde7ab0(_0x493d13['error'][_0x062f('0x10')]);}else{logger['info'](_0x062f('0xb'),_0x5ae756,_0x062f('0xc'));_0xde7ab0(_0x493d13['result'][_0x062f('0x10')]);}})['catch'](function(_0x41162c){logger['error'](_0x062f('0xb'),_0x5ae756,_0x41162c);_0x12d7fb(_0x41162c);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index a750c52..e76f648 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 _0xfda9=['/describe','describe','/:id','show','post','create','put','delete','destroy','multer','util','connect-timeout','express','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get'];(function(_0x446301,_0x15b238){var _0x268e22=function(_0x29a525){while(--_0x29a525){_0x446301['push'](_0x446301['shift']());}};_0x268e22(++_0x15b238);}(_0xfda9,0xe1));var _0x9fda=function(_0x278dcf,_0x5f23f3){_0x278dcf=_0x278dcf-0x0;var _0x85bbcc=_0xfda9[_0x278dcf];return _0x85bbcc;};'use strict';var multer=require(_0x9fda('0x0'));var util=require(_0x9fda('0x1'));var path=require('path');var timeout=require(_0x9fda('0x2'));var express=require(_0x9fda('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9fda('0x4'));var controller=require(_0x9fda('0x5'));router['get']('/',auth[_0x9fda('0x6')](),controller[_0x9fda('0x7')]);router[_0x9fda('0x8')](_0x9fda('0x9'),auth[_0x9fda('0x6')](),controller[_0x9fda('0xa')]);router[_0x9fda('0x8')](_0x9fda('0xb'),auth[_0x9fda('0x6')](),controller[_0x9fda('0xc')]);router[_0x9fda('0xd')]('/',auth['isAuthenticated'](),controller[_0x9fda('0xe')]);router[_0x9fda('0xf')](_0x9fda('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x9fda('0x10')](_0x9fda('0xb'),auth[_0x9fda('0x6')](),controller[_0x9fda('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xfc6d=['create','put','update','delete','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','show','post'];(function(_0x3ab47c,_0x5cf435){var _0x1aa972=function(_0x2ca8ff){while(--_0x2ca8ff){_0x3ab47c['push'](_0x3ab47c['shift']());}};_0x1aa972(++_0x5cf435);}(_0xfc6d,0x1ad));var _0xdfc6=function(_0x279f6d,_0x122316){_0x279f6d=_0x279f6d-0x0;var _0x5874a5=_0xfc6d[_0x279f6d];return _0x5874a5;};'use strict';var multer=require(_0xdfc6('0x0'));var util=require(_0xdfc6('0x1'));var path=require('path');var timeout=require(_0xdfc6('0x2'));var express=require(_0xdfc6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdfc6('0x4'));var interaction=require(_0xdfc6('0x5'));var config=require(_0xdfc6('0x6'));var controller=require(_0xdfc6('0x7'));router[_0xdfc6('0x8')]('/',auth[_0xdfc6('0x9')](),controller[_0xdfc6('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xdfc6('0x9')](),controller[_0xdfc6('0xb')]);router[_0xdfc6('0xc')]('/',auth[_0xdfc6('0x9')](),controller[_0xdfc6('0xd')]);router[_0xdfc6('0xe')]('/:id',auth[_0xdfc6('0x9')](),controller[_0xdfc6('0xf')]);router[_0xdfc6('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);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 87e6de0..1682eb7 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 _0xf4e7=['timeout','INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x49bc69,_0x17439f){var _0x213c42=function(_0x4c88dd){while(--_0x4c88dd){_0x49bc69['push'](_0x49bc69['shift']());}};_0x213c42(++_0x17439f);}(_0xf4e7,0xb8));var _0x7f4e=function(_0x2b95d0,_0x592abb){_0x2b95d0=_0x2b95d0-0x0;var _0x356268=_0xf4e7[_0x2b95d0];return _0x356268;};'use strict';var Sequelize=require(_0x7f4e('0x0'));module[_0x7f4e('0x1')]={'name':{'type':Sequelize[_0x7f4e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7f4e('0x3')](_0x7f4e('0x4'),_0x7f4e('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x7f4e('0x2')]},'timeout':{'type':Sequelize[_0x7f4e('0x6')]}};
\ No newline at end of file
+var _0x00e4=['STRING','ENUM','mouseOver','sequelize','exports'];(function(_0x4df337,_0x3bf41d){var _0x4a1c4e=function(_0x248214){while(--_0x248214){_0x4df337['push'](_0x4df337['shift']());}};_0x4a1c4e(++_0x3bf41d);}(_0x00e4,0x157));var _0x400e=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x00e4[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require(_0x400e('0x0'));module[_0x400e('0x1')]={'name':{'type':Sequelize[_0x400e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x400e('0x3')](_0x400e('0x4'),'timeout'),'defaultValue':_0x400e('0x4')},'selector':{'type':Sequelize[_0x400e('0x2')]},'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 4f886ba..52c4e2a 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 _0x2d17=['../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','then','error','name','show','params','keys','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','merge','options','ChatProactiveAction','find','catch','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2d17,0x17e));var _0x72d1=function(_0x2e24c7,_0x52191c){_0x2e24c7=_0x2e24c7-0x0;var _0x48be94=_0x2d17[_0x2e24c7];return _0x48be94;};'use strict';var emlformat=require(_0x72d1('0x0'));var rimraf=require(_0x72d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x72d1('0x2'));var rp=require(_0x72d1('0x3'));var moment=require('moment');var BPromise=require(_0x72d1('0x4'));var Mustache=require(_0x72d1('0x5'));var util=require('util');var path=require(_0x72d1('0x6'));var sox=require('sox');var csv=require(_0x72d1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72d1('0x8'));var _=require(_0x72d1('0x9'));var squel=require('squel');var crypto=require(_0x72d1('0xa'));var jsforce=require(_0x72d1('0xb'));var deskjs=require(_0x72d1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x72d1('0xd'));var Papa=require(_0x72d1('0xe'));var Redis=require(_0x72d1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x72d1('0x10'));var as=require(_0x72d1('0x11'));var hardwareService=require(_0x72d1('0x12'));var logger=require(_0x72d1('0x13'))(_0x72d1('0x14'));var utils=require(_0x72d1('0x15'));var config=require(_0x72d1('0x16'));var licenseUtil=require(_0x72d1('0x17'));var db=require(_0x72d1('0x18'))['db'];function respondWithStatusCode(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xcc;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0x19')](_0x5ad4df);}return _0x2f5a78[_0x72d1('0x1a')](_0x5ad4df)[_0x72d1('0x1b')]();};}function respondWithResult(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0xc8;return function(_0x143718){if(_0x143718){return _0x22ac6f[_0x72d1('0x1a')](_0x685a27)[_0x72d1('0x1c')](_0x143718);}};}function respondWithFilteredResult(_0x3f190f,_0x21c85e){return function(_0x23a238){if(_0x23a238){var _0x8d458=typeof _0x21c85e['offset']===_0x72d1('0x1d')&&typeof _0x21c85e['limit']===_0x72d1('0x1d');var _0x2c9851=_0x23a238['count'];var _0x1061b7=_0x8d458?0x0:_0x21c85e[_0x72d1('0x1e')];var _0x1ca18d=_0x8d458?_0x23a238['count']:_0x21c85e['offset']+_0x21c85e[_0x72d1('0x1f')];var _0x10d464;if(_0x1ca18d>=_0x2c9851){_0x1ca18d=_0x2c9851;_0x10d464=0xc8;}else{_0x10d464=0xce;}_0x3f190f[_0x72d1('0x1a')](_0x10d464);return _0x3f190f[_0x72d1('0x20')](_0x72d1('0x21'),_0x1061b7+'-'+_0x1ca18d+'/'+_0x2c9851)[_0x72d1('0x1c')](_0x23a238);}return null;};}function patchUpdates(_0x1e2411){return function(_0x5c7982){try{jsonpatch[_0x72d1('0x22')](_0x5c7982,_0x1e2411,!![]);}catch(_0x56e8d3){return BPromise['reject'](_0x56e8d3);}return _0x5c7982['save']();};}function saveUpdates(_0x585243,_0x445985){return function(_0x374602){if(_0x374602){return _0x374602['update'](_0x585243)[_0x72d1('0x23')](function(_0x256dc1){return _0x256dc1;});}return null;};}function removeEntity(_0x492086,_0x1431ee){return function(_0x26fa35){if(_0x26fa35){return _0x26fa35['destroy']()['then'](function(){_0x492086[_0x72d1('0x1a')](0xcc)[_0x72d1('0x1b')]();});}};}function handleEntityNotFound(_0x2f661,_0x2f879f){return function(_0xdf6a69){if(!_0xdf6a69){_0x2f661[_0x72d1('0x19')](0x194);}return _0xdf6a69;};}function handleError(_0x163bec,_0x589f7c){_0x589f7c=_0x589f7c||0x1f4;return function(_0x57ec9e){logger[_0x72d1('0x24')](_0x57ec9e['stack']);if(_0x57ec9e[_0x72d1('0x25')]){delete _0x57ec9e[_0x72d1('0x25')];}_0x163bec[_0x72d1('0x1a')](_0x589f7c)['send'](_0x57ec9e);};}exports[_0x72d1('0x26')]=function(_0x4c4c41,_0x707cd0){var _0x20055f={'raw':!![],'where':{'id':_0x4c4c41[_0x72d1('0x27')]['id']}},_0x32588f={};_0x32588f['model']=_[_0x72d1('0x28')](db['ChatProactiveAction'][_0x72d1('0x29')]);_0x32588f[_0x72d1('0x2a')]=_['keys'](_0x4c4c41[_0x72d1('0x2a')]);_0x32588f[_0x72d1('0x2b')]=_[_0x72d1('0x2c')](_0x32588f[_0x72d1('0x2d')],_0x32588f[_0x72d1('0x2a')]);_0x20055f['attributes']=_[_0x72d1('0x2c')](_0x32588f[_0x72d1('0x2d')],qs[_0x72d1('0x2e')](_0x4c4c41['query'][_0x72d1('0x2e')]));_0x20055f[_0x72d1('0x2f')]=_0x20055f['attributes'][_0x72d1('0x30')]?_0x20055f[_0x72d1('0x2f')]:_0x32588f[_0x72d1('0x2d')];if(_0x4c4c41['query'][_0x72d1('0x31')]){_0x20055f['include']=[{'all':!![]}];}_0x20055f=_[_0x72d1('0x32')]({},_0x20055f,_0x4c4c41[_0x72d1('0x33')]);return db[_0x72d1('0x34')][_0x72d1('0x35')](_0x20055f)[_0x72d1('0x23')](handleEntityNotFound(_0x707cd0,null))[_0x72d1('0x23')](respondWithResult(_0x707cd0,null))[_0x72d1('0x36')](handleError(_0x707cd0,null));};exports[_0x72d1('0x37')]=function(_0x4006b9,_0x24be04){return db[_0x72d1('0x34')]['create'](_0x4006b9[_0x72d1('0x38')],{})[_0x72d1('0x23')](respondWithResult(_0x24be04,0xc9))[_0x72d1('0x36')](handleError(_0x24be04,null));};exports[_0x72d1('0x39')]=function(_0x49e074,_0x3eb3da){if(_0x49e074[_0x72d1('0x38')]['id']){delete _0x49e074[_0x72d1('0x38')]['id'];}return db['ChatProactiveAction'][_0x72d1('0x35')]({'where':{'id':_0x49e074[_0x72d1('0x27')]['id']}})[_0x72d1('0x23')](handleEntityNotFound(_0x3eb3da,null))['then'](saveUpdates(_0x49e074[_0x72d1('0x38')],null))[_0x72d1('0x23')](respondWithResult(_0x3eb3da,null))[_0x72d1('0x36')](handleError(_0x3eb3da,null));};exports['destroy']=function(_0x43b419,_0x40cdbd){return db[_0x72d1('0x34')][_0x72d1('0x35')]({'where':{'id':_0x43b419[_0x72d1('0x27')]['id']}})[_0x72d1('0x23')](handleEntityNotFound(_0x40cdbd,null))[_0x72d1('0x23')](removeEntity(_0x40cdbd,null))['catch'](handleError(_0x40cdbd,null));};
\ No newline at end of file
+var _0x2171=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','json','apply','reject','save','then','destroy','stack','name','send','show','params','model','rawAttributes','query','keys','intersection','fields','attributes','includeAll','merge','options','ChatProactiveAction','find','catch','create','body','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x1bc794,_0x3e7f10){var _0x47055f=function(_0x1957e1){while(--_0x1957e1){_0x1bc794['push'](_0x1bc794['shift']());}};_0x47055f(++_0x3e7f10);}(_0x2171,0x143));var _0x1217=function(_0x24f894,_0x2e838b){_0x24f894=_0x24f894-0x0;var _0x36e466=_0x2171[_0x24f894];return _0x36e466;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1217('0x0'));var zipdir=require(_0x1217('0x1'));var jsonpatch=require(_0x1217('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1217('0x3'));var Mustache=require('mustache');var util=require(_0x1217('0x4'));var path=require(_0x1217('0x5'));var sox=require(_0x1217('0x6'));var csv=require(_0x1217('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1217('0x8'));var _=require(_0x1217('0x9'));var squel=require(_0x1217('0xa'));var crypto=require('crypto');var jsforce=require(_0x1217('0xb'));var deskjs=require(_0x1217('0xc'));var toCsv=require(_0x1217('0x7'));var querystring=require(_0x1217('0xd'));var Papa=require(_0x1217('0xe'));var Redis=require(_0x1217('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1217('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1217('0x11'));var logger=require(_0x1217('0x12'))(_0x1217('0x13'));var utils=require(_0x1217('0x14'));var config=require(_0x1217('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1217('0x16'))['db'];function respondWithStatusCode(_0x358007,_0x1e34e9){_0x1e34e9=_0x1e34e9||0xcc;return function(_0x107d99){if(_0x107d99){return _0x358007[_0x1217('0x17')](_0x1e34e9);}return _0x358007['status'](_0x1e34e9)['end']();};}function respondWithResult(_0xb06ed5,_0x5d8f22){_0x5d8f22=_0x5d8f22||0xc8;return function(_0x4aa848){if(_0x4aa848){return _0xb06ed5[_0x1217('0x18')](_0x5d8f22)['json'](_0x4aa848);}};}function respondWithFilteredResult(_0x4ef9be,_0x2300f0){return function(_0x24a3f3){if(_0x24a3f3){var _0x417cfe=typeof _0x2300f0[_0x1217('0x19')]==='undefined'&&typeof _0x2300f0[_0x1217('0x1a')]===_0x1217('0x1b');var _0x41c34f=_0x24a3f3[_0x1217('0x1c')];var _0x512159=_0x417cfe?0x0:_0x2300f0[_0x1217('0x19')];var _0x24033f=_0x417cfe?_0x24a3f3[_0x1217('0x1c')]:_0x2300f0[_0x1217('0x19')]+_0x2300f0[_0x1217('0x1a')];var _0x20ccb9;if(_0x24033f>=_0x41c34f){_0x24033f=_0x41c34f;_0x20ccb9=0xc8;}else{_0x20ccb9=0xce;}_0x4ef9be[_0x1217('0x18')](_0x20ccb9);return _0x4ef9be[_0x1217('0x1d')]('Content-Range',_0x512159+'-'+_0x24033f+'/'+_0x41c34f)[_0x1217('0x1e')](_0x24a3f3);}return null;};}function patchUpdates(_0x49382b){return function(_0x3bb618){try{jsonpatch[_0x1217('0x1f')](_0x3bb618,_0x49382b,!![]);}catch(_0x5f018c){return BPromise[_0x1217('0x20')](_0x5f018c);}return _0x3bb618[_0x1217('0x21')]();};}function saveUpdates(_0x4ea5e6,_0xb4e4ea){return function(_0x2c625b){if(_0x2c625b){return _0x2c625b['update'](_0x4ea5e6)[_0x1217('0x22')](function(_0x11f512){return _0x11f512;});}return null;};}function removeEntity(_0x1516e8,_0x5b9b7a){return function(_0x4a9c32){if(_0x4a9c32){return _0x4a9c32[_0x1217('0x23')]()[_0x1217('0x22')](function(){_0x1516e8[_0x1217('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x463c66,_0x8bd9d9){return function(_0x1bde0b){if(!_0x1bde0b){_0x463c66[_0x1217('0x17')](0x194);}return _0x1bde0b;};}function handleError(_0x465209,_0x446dc3){_0x446dc3=_0x446dc3||0x1f4;return function(_0x518a0a){logger['error'](_0x518a0a[_0x1217('0x24')]);if(_0x518a0a[_0x1217('0x25')]){delete _0x518a0a['name'];}_0x465209[_0x1217('0x18')](_0x446dc3)[_0x1217('0x26')](_0x518a0a);};}exports[_0x1217('0x27')]=function(_0x21392c,_0x2f5387){var _0x5eb398={'raw':!![],'where':{'id':_0x21392c[_0x1217('0x28')]['id']}},_0xdb98d5={};_0xdb98d5[_0x1217('0x29')]=_['keys'](db['ChatProactiveAction'][_0x1217('0x2a')]);_0xdb98d5[_0x1217('0x2b')]=_[_0x1217('0x2c')](_0x21392c['query']);_0xdb98d5['filters']=_[_0x1217('0x2d')](_0xdb98d5[_0x1217('0x29')],_0xdb98d5[_0x1217('0x2b')]);_0x5eb398['attributes']=_['intersection'](_0xdb98d5[_0x1217('0x29')],qs[_0x1217('0x2e')](_0x21392c[_0x1217('0x2b')][_0x1217('0x2e')]));_0x5eb398[_0x1217('0x2f')]=_0x5eb398['attributes']['length']?_0x5eb398['attributes']:_0xdb98d5['model'];if(_0x21392c[_0x1217('0x2b')][_0x1217('0x30')]){_0x5eb398['include']=[{'all':!![]}];}_0x5eb398=_[_0x1217('0x31')]({},_0x5eb398,_0x21392c[_0x1217('0x32')]);return db[_0x1217('0x33')][_0x1217('0x34')](_0x5eb398)[_0x1217('0x22')](handleEntityNotFound(_0x2f5387,null))[_0x1217('0x22')](respondWithResult(_0x2f5387,null))[_0x1217('0x35')](handleError(_0x2f5387,null));};exports[_0x1217('0x36')]=function(_0x2d6653,_0x445bd2){return db[_0x1217('0x33')][_0x1217('0x36')](_0x2d6653[_0x1217('0x37')],{})[_0x1217('0x22')](respondWithResult(_0x445bd2,0xc9))[_0x1217('0x35')](handleError(_0x445bd2,null));};exports['update']=function(_0xc189a6,_0x3ac293){if(_0xc189a6[_0x1217('0x37')]['id']){delete _0xc189a6['body']['id'];}return db[_0x1217('0x33')]['find']({'where':{'id':_0xc189a6[_0x1217('0x28')]['id']}})['then'](handleEntityNotFound(_0x3ac293,null))[_0x1217('0x22')](saveUpdates(_0xc189a6[_0x1217('0x37')],null))[_0x1217('0x22')](respondWithResult(_0x3ac293,null))[_0x1217('0x35')](handleError(_0x3ac293,null));};exports['destroy']=function(_0xc699b3,_0x437f54){return db[_0x1217('0x33')]['find']({'where':{'id':_0xc699b3[_0x1217('0x28')]['id']}})['then'](handleEntityNotFound(_0x437f54,null))[_0x1217('0x22')](removeEntity(_0x437f54,null))[_0x1217('0x35')](handleError(_0x437f54,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index b04f78a..bfaf0d5 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 _0xcc48=['ChatProactiveAction','lodash','../../config/logger','api','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x226318,_0x43f075){var _0x15c149=function(_0x28b962){while(--_0x28b962){_0x226318['push'](_0x226318['shift']());}};_0x15c149(++_0x43f075);}(_0xcc48,0x1eb));var _0x8cc4=function(_0xb3fe4b,_0x1bde5c){_0xb3fe4b=_0xb3fe4b-0x0;var _0x42027f=_0xcc48[_0xb3fe4b];return _0x42027f;};'use strict';var _=require(_0x8cc4('0x0'));var util=require('util');var logger=require(_0x8cc4('0x1'))(_0x8cc4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8cc4('0x3'));var fs=require('fs');var path=require(_0x8cc4('0x4'));var rimraf=require('rimraf');var config=require(_0x8cc4('0x5'));var attributes=require(_0x8cc4('0x6'));module[_0x8cc4('0x7')]=function(_0x2480f8,_0x21ddab){return _0x2480f8[_0x8cc4('0x8')](_0x8cc4('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x07a8=['rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07a8,0x16c));var _0x807a=function(_0x1fb0fa,_0x5011bf){_0x1fb0fa=_0x1fb0fa-0x0;var _0x40eb0d=_0x07a8[_0x1fb0fa];return _0x40eb0d;};'use strict';var _=require('lodash');var util=require(_0x807a('0x0'));var logger=require(_0x807a('0x1'))('api');var moment=require(_0x807a('0x2'));var BPromise=require(_0x807a('0x3'));var rp=require(_0x807a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x807a('0x5'));var config=require('../../config/environment');var attributes=require(_0x807a('0x6'));module['exports']=function(_0x1c21f1,_0x34b543){return _0x1c21f1[_0x807a('0x7')](_0x807a('0x8'),attributes,{'tableName':'chat_proactive_actions','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 f565874..64d8d5f 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 _0x8115=['util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x243de9,_0x1897bb){var _0x58e4bd=function(_0x342b42){while(--_0x342b42){_0x243de9['push'](_0x243de9['shift']());}};_0x58e4bd(++_0x1897bb);}(_0x8115,0xa7));var _0x5811=function(_0x1106d5,_0x35d6f4){_0x1106d5=_0x1106d5-0x0;var _0x232944=_0x8115[_0x1106d5];return _0x232944;};'use strict';var _=require(_0x5811('0x0'));var util=require(_0x5811('0x1'));var moment=require('moment');var BPromise=require(_0x5811('0x2'));var rs=require(_0x5811('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5811('0x4'))['db'];var utils=require(_0x5811('0x5'));var logger=require('../../config/logger')(_0x5811('0x6'));var config=require(_0x5811('0x7'));var jayson=require(_0x5811('0x8'));var client=jayson[_0x5811('0x9')][_0x5811('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x562d06,_0x36b92c,_0x4969ea){return new BPromise(function(_0x284c20,_0xc291f){return client[_0x5811('0xb')](_0x562d06,_0x4969ea)[_0x5811('0xc')](function(_0x1f6e62){logger['info'](_0x5811('0xd'),_0x36b92c,_0x5811('0xe'));logger[_0x5811('0xf')](_0x5811('0x10'),_0x36b92c,'request\x20sent',JSON[_0x5811('0x11')](_0x1f6e62));if(_0x1f6e62[_0x5811('0x12')]){if(_0x1f6e62[_0x5811('0x12')][_0x5811('0x13')]===0x1f4){logger[_0x5811('0x12')](_0x5811('0xd'),_0x36b92c,_0x1f6e62['error'][_0x5811('0x14')]);return _0xc291f(_0x1f6e62[_0x5811('0x12')]['message']);}logger[_0x5811('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x36b92c,_0x1f6e62[_0x5811('0x12')][_0x5811('0x14')]);return _0x284c20(_0x1f6e62['error'][_0x5811('0x14')]);}else{logger[_0x5811('0x15')](_0x5811('0xd'),_0x36b92c,'request\x20sent');_0x284c20(_0x1f6e62[_0x5811('0x16')]['message']);}})[_0x5811('0x17')](function(_0x5cee72){logger[_0x5811('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x36b92c,_0x5cee72);_0xc291f(_0x5cee72);});});}
\ No newline at end of file
+var _0x78f9=['error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x78f9,0x14f));var _0x978f=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x78f9[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x978f('0x0'));var util=require('util');var moment=require(_0x978f('0x1'));var BPromise=require('bluebird');var rs=require(_0x978f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x978f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x978f('0x4'))(_0x978f('0x5'));var config=require(_0x978f('0x6'));var jayson=require(_0x978f('0x7'));var client=jayson[_0x978f('0x8')][_0x978f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22238c,_0x4d8311,_0x167cf2){return new BPromise(function(_0x36602e,_0x5f5617){return client[_0x978f('0xa')](_0x22238c,_0x167cf2)[_0x978f('0xb')](function(_0x335ba3){logger[_0x978f('0xc')](_0x978f('0xd'),_0x4d8311,_0x978f('0xe'));logger[_0x978f('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4d8311,'request\x20sent',JSON[_0x978f('0x10')](_0x335ba3));if(_0x335ba3[_0x978f('0x11')]){if(_0x335ba3[_0x978f('0x11')][_0x978f('0x12')]===0x1f4){logger[_0x978f('0x11')](_0x978f('0xd'),_0x4d8311,_0x335ba3[_0x978f('0x11')][_0x978f('0x13')]);return _0x5f5617(_0x335ba3[_0x978f('0x11')]['message']);}logger[_0x978f('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x4d8311,_0x335ba3[_0x978f('0x11')]['message']);return _0x36602e(_0x335ba3[_0x978f('0x11')]['message']);}else{logger[_0x978f('0xc')](_0x978f('0xd'),_0x4d8311,_0x978f('0xe'));_0x36602e(_0x335ba3[_0x978f('0x14')][_0x978f('0x13')]);}})[_0x978f('0x15')](function(_0x485e5b){logger['error'](_0x978f('0xd'),_0x4d8311,_0x485e5b);_0x5f5617(_0x485e5b);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index b52518b..9a83eed 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 _0x8958=['show','post','put','update','delete','destroy','exports','util','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated'];(function(_0x5b46b4,_0x5645c9){var _0x29632e=function(_0x15d0d9){while(--_0x15d0d9){_0x5b46b4['push'](_0x5b46b4['shift']());}};_0x29632e(++_0x5645c9);}(_0x8958,0x93));var _0x8895=function(_0x51d177,_0x4288b9){_0x51d177=_0x51d177-0x0;var _0xbf010e=_0x8958[_0x51d177];return _0xbf010e;};'use strict';var multer=require('multer');var util=require(_0x8895('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8895('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var controller=require(_0x8895('0x4'));router['get'](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0x7')]);router[_0x8895('0x8')]('/',auth[_0x8895('0x6')](),controller['create']);router[_0x8895('0x9')](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0xa')]);router[_0x8895('0xb')](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0xc')]);module[_0x8895('0xd')]=router;
\ No newline at end of file
+var _0x55ca=['multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','destroy','exports'];(function(_0x56fab5,_0x38e754){var _0x11cf97=function(_0x1b0af6){while(--_0x1b0af6){_0x56fab5['push'](_0x56fab5['shift']());}};_0x11cf97(++_0x38e754);}(_0x55ca,0x126));var _0xa55c=function(_0x1113d9,_0x52cd99){_0x1113d9=_0x1113d9-0x0;var _0x4a5aa2=_0x55ca[_0x1113d9];return _0x4a5aa2;};'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')](_0xa55c('0x8'),auth[_0xa55c('0x9')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x9')](),controller[_0xa55c('0xb')]);router['put'](_0xa55c('0x8'),auth[_0xa55c('0x9')](),controller['update']);router['delete'](_0xa55c('0x8'),auth[_0xa55c('0x9')](),controller[_0xa55c('0xc')]);module[_0xa55c('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index c52c466..525bd60 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 _0x881c=['sequelize','exports','STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x350a7b,_0x236625){var _0x1100f9=function(_0x2f37c3){while(--_0x2f37c3){_0x350a7b['push'](_0x350a7b['shift']());}};_0x1100f9(++_0x236625);}(_0x881c,0xf0));var _0xc881=function(_0xd7ddc4,_0x4e57dc){_0xd7ddc4=_0xd7ddc4-0x0;var _0x3d264d=_0x881c[_0xd7ddc4];return _0x3d264d;};'use strict';var Sequelize=require(_0xc881('0x0'));module[_0xc881('0x1')]={'name':{'type':Sequelize[_0xc881('0x2')],'unique':_0xc881('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc881('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc881('0x4')](_0xc881('0x5'),_0xc881('0x6'),_0xc881('0x7'))}};
\ No newline at end of file
+var _0xa4ef=['roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x1067b1,_0xe1f971){var _0x46e160=function(_0x5a4752){while(--_0x5a4752){_0x1067b1['push'](_0x1067b1['shift']());}};_0x46e160(++_0xe1f971);}(_0xa4ef,0xd1));var _0xfa4e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa4ef[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0xfa4e('0x0')]={'name':{'type':Sequelize[_0xfa4e('0x1')],'unique':_0xfa4e('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfa4e('0x1')]},'timeout':{'type':Sequelize[_0xfa4e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfa4e('0x4')](_0xfa4e('0x5'),_0xfa4e('0x6'),_0xfa4e('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 7e45722..a3bd827 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 _0x73ab=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','catch','show','length','includeAll','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','params','describe','getMembers','findOne','UserChatQueue','User','UserId','agent','chatPause','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./chatQueue.socket','register','client','http','request','then','info','request\x20sent','debug','stringify','error','message','ChatQueue,\x20%s,\x20%s','sendStatus','end','status'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x73ab,0x67));var _0xb73a=function(_0x3a2118,_0x31fc3c){_0x3a2118=_0x3a2118-0x0;var _0x1d181d=_0x73ab[_0x3a2118];return _0x1d181d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb73a('0x0'));var jsonpatch=require(_0xb73a('0x1'));var rp=require(_0xb73a('0x2'));var moment=require('moment');var BPromise=require(_0xb73a('0x3'));var Mustache=require(_0xb73a('0x4'));var util=require('util');var path=require(_0xb73a('0x5'));var sox=require(_0xb73a('0x6'));var csv=require(_0xb73a('0x7'));var ejs=require(_0xb73a('0x8'));var fs=require('fs');var fs_extra=require(_0xb73a('0x9'));var _=require('lodash');var squel=require(_0xb73a('0xa'));var crypto=require(_0xb73a('0xb'));var jsforce=require(_0xb73a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb73a('0x7'));var querystring=require(_0xb73a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb73a('0xe'));var authService=require(_0xb73a('0xf'));var qs=require(_0xb73a('0x10'));var as=require(_0xb73a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb73a('0x12'))(_0xb73a('0x13'));var utils=require(_0xb73a('0x14'));var config=require(_0xb73a('0x15'));var licenseUtil=require(_0xb73a('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb73a('0x17')](config['redis'],{'host':_0xb73a('0x18'),'port':0x18eb});var socket=require(_0xb73a('0x19'))(new Redis(config[_0xb73a('0x1a')]));require(_0xb73a('0x1b'))[_0xb73a('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb73a('0x1d')][_0xb73a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x53e139,_0x382c54,_0x33a6c,_0x13354d){return new BPromise(function(_0x457fb6,_0x5f30b3){var _0x323309=_0x13354d||client;return _0x323309[_0xb73a('0x1f')](_0x53e139,_0x33a6c)[_0xb73a('0x20')](function(_0x131095){logger[_0xb73a('0x21')]('ChatQueue,\x20%s,\x20%s',_0x382c54,_0xb73a('0x22'));logger[_0xb73a('0x23')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x382c54,_0xb73a('0x22'),JSON[_0xb73a('0x24')](_0x131095));if(_0x131095['error']){if(_0x131095[_0xb73a('0x25')]['code']===0x1f4){logger[_0xb73a('0x25')]('ChatQueue,\x20%s,\x20%s',_0x382c54,_0x131095[_0xb73a('0x25')][_0xb73a('0x26')]);return _0x5f30b3(_0x131095['error'][_0xb73a('0x26')]);}logger['error'](_0xb73a('0x27'),_0x382c54,_0x131095[_0xb73a('0x25')][_0xb73a('0x26')]);return _0x457fb6(_0x131095[_0xb73a('0x25')][_0xb73a('0x26')]);}else{logger['info'](_0xb73a('0x27'),_0x382c54,_0xb73a('0x22'));_0x457fb6(_0x131095['result']['message']);}})['catch'](function(_0x460c0d){logger['error'](_0xb73a('0x27'),_0x382c54,_0x460c0d);_0x5f30b3(_0x460c0d);});});}function respondWithStatusCode(_0x5e565b,_0x114d6e){_0x114d6e=_0x114d6e||0xcc;return function(_0x16557e){if(_0x16557e){return _0x5e565b[_0xb73a('0x28')](_0x114d6e);}return _0x5e565b['status'](_0x114d6e)[_0xb73a('0x29')]();};}function respondWithResult(_0x424c86,_0x47ac83){_0x47ac83=_0x47ac83||0xc8;return function(_0x55c093){if(_0x55c093){return _0x424c86[_0xb73a('0x2a')](_0x47ac83)[_0xb73a('0x2b')](_0x55c093);}};}function respondWithFilteredResult(_0x4de8e7,_0x12c111){return function(_0x5d918e){if(_0x5d918e){var _0x23bcf6=typeof _0x12c111[_0xb73a('0x2c')]===_0xb73a('0x2d')&&typeof _0x12c111[_0xb73a('0x2e')]==='undefined';var _0x26d08c=_0x5d918e[_0xb73a('0x2f')];var _0x31c484=_0x23bcf6?0x0:_0x12c111[_0xb73a('0x2c')];var _0x313e7b=_0x23bcf6?_0x5d918e['count']:_0x12c111[_0xb73a('0x2c')]+_0x12c111['limit'];var _0x429450;if(_0x313e7b>=_0x26d08c){_0x313e7b=_0x26d08c;_0x429450=0xc8;}else{_0x429450=0xce;}_0x4de8e7['status'](_0x429450);return _0x4de8e7[_0xb73a('0x30')](_0xb73a('0x31'),_0x31c484+'-'+_0x313e7b+'/'+_0x26d08c)[_0xb73a('0x2b')](_0x5d918e);}return null;};}function patchUpdates(_0x37b5a3){return function(_0x3e5e0d){try{jsonpatch[_0xb73a('0x32')](_0x3e5e0d,_0x37b5a3,!![]);}catch(_0x2906ab){return BPromise[_0xb73a('0x33')](_0x2906ab);}return _0x3e5e0d[_0xb73a('0x34')]();};}function saveUpdates(_0x416fa0,_0x184aea){return function(_0x1aad72){if(_0x1aad72){return _0x1aad72[_0xb73a('0x35')](_0x416fa0)[_0xb73a('0x20')](function(_0x37f645){return _0x37f645;});}return null;};}function removeEntity(_0x1d6d84,_0x529e0c){return function(_0x148624){if(_0x148624){return _0x148624[_0xb73a('0x36')]()[_0xb73a('0x20')](function(){var _0xb16828=_0x148624['get']({'plain':!![]});var _0x5e6904=_0xb73a('0x37');return db[_0xb73a('0x38')][_0xb73a('0x36')]({'where':{'type':_0x5e6904,'resourceId':_0xb16828['id']}})['then'](function(){return _0x148624;});})['then'](function(){_0x1d6d84[_0xb73a('0x2a')](0xcc)[_0xb73a('0x29')]();});}};}function handleEntityNotFound(_0x5ed46c,_0x27beb9){return function(_0x31950f){if(!_0x31950f){_0x5ed46c['sendStatus'](0x194);}return _0x31950f;};}function handleError(_0x207b0f,_0x1e1afb){_0x1e1afb=_0x1e1afb||0x1f4;return function(_0xb19533){logger[_0xb73a('0x25')](_0xb19533[_0xb73a('0x39')]);if(_0xb19533['name']){delete _0xb19533[_0xb73a('0x3a')];}_0x207b0f['status'](_0x1e1afb)[_0xb73a('0x3b')](_0xb19533);};}exports[_0xb73a('0x3c')]=function(_0x484086,_0x454914){var _0x27e7fd={},_0x21aa22={},_0x16e6a6={'count':0x0,'rows':[]};var _0x413773=_[_0xb73a('0x3d')](db[_0xb73a('0x3e')][_0xb73a('0x3f')],function(_0x209346){return{'name':_0x209346[_0xb73a('0x40')],'type':_0x209346[_0xb73a('0x41')]['key']};});_0x21aa22['model']=_['map'](_0x413773,_0xb73a('0x3a'));_0x21aa22[_0xb73a('0x42')]=_[_0xb73a('0x43')](_0x484086[_0xb73a('0x42')]);_0x21aa22[_0xb73a('0x44')]=_[_0xb73a('0x45')](_0x21aa22['model'],_0x21aa22[_0xb73a('0x42')]);_0x27e7fd[_0xb73a('0x46')]=_[_0xb73a('0x45')](_0x21aa22[_0xb73a('0x47')],qs[_0xb73a('0x48')](_0x484086[_0xb73a('0x42')][_0xb73a('0x48')]));_0x27e7fd['attributes']=_0x27e7fd[_0xb73a('0x46')]['length']?_0x27e7fd[_0xb73a('0x46')]:_0x21aa22['model'];if(!_0x484086[_0xb73a('0x42')][_0xb73a('0x49')](_0xb73a('0x4a'))){_0x27e7fd[_0xb73a('0x2e')]=qs['limit'](_0x484086[_0xb73a('0x42')][_0xb73a('0x2e')]);_0x27e7fd['offset']=qs[_0xb73a('0x2c')](_0x484086[_0xb73a('0x42')][_0xb73a('0x2c')]);}_0x27e7fd[_0xb73a('0x4b')]=qs['sort'](_0x484086['query'][_0xb73a('0x4c')]);_0x27e7fd[_0xb73a('0x4d')]=qs[_0xb73a('0x44')](_[_0xb73a('0x4e')](_0x484086[_0xb73a('0x42')],_0x21aa22[_0xb73a('0x44')]),_0x413773);if(_0x484086[_0xb73a('0x42')][_0xb73a('0x4f')]){_0x27e7fd[_0xb73a('0x4d')]=_[_0xb73a('0x50')](_0x27e7fd['where'],{'$or':_[_0xb73a('0x3d')](_0x413773,function(_0x367041){if(_0x367041['type']!=='VIRTUAL'){var _0x3456b4={};_0x3456b4[_0x367041[_0xb73a('0x3a')]]={'$like':'%'+_0x484086[_0xb73a('0x42')][_0xb73a('0x4f')]+'%'};return _0x3456b4;}})});}_0x27e7fd=_['merge']({},_0x27e7fd,_0x484086['options']);var _0x4287b1={'where':_0x27e7fd[_0xb73a('0x4d')]};return db[_0xb73a('0x3e')]['count'](_0x4287b1)[_0xb73a('0x20')](function(_0x567a48){_0x16e6a6[_0xb73a('0x2f')]=_0x567a48;if(_0x484086['query']['includeAll']){_0x27e7fd[_0xb73a('0x51')]=[{'all':!![]}];}return db[_0xb73a('0x3e')][_0xb73a('0x52')](_0x27e7fd);})['then'](function(_0x40e1e4){_0x16e6a6['rows']=_0x40e1e4;return _0x16e6a6;})[_0xb73a('0x20')](respondWithFilteredResult(_0x454914,_0x27e7fd))[_0xb73a('0x53')](handleError(_0x454914,null));};exports[_0xb73a('0x54')]=function(_0x3a432d,_0x2c0315){var _0x1bac41={'raw':!![],'where':{'id':_0x3a432d['params']['id']}},_0x39727e={};_0x39727e[_0xb73a('0x47')]=_[_0xb73a('0x43')](db[_0xb73a('0x3e')][_0xb73a('0x3f')]);_0x39727e[_0xb73a('0x42')]=_[_0xb73a('0x43')](_0x3a432d[_0xb73a('0x42')]);_0x39727e[_0xb73a('0x44')]=_[_0xb73a('0x45')](_0x39727e[_0xb73a('0x47')],_0x39727e[_0xb73a('0x42')]);_0x1bac41[_0xb73a('0x46')]=_[_0xb73a('0x45')](_0x39727e[_0xb73a('0x47')],qs[_0xb73a('0x48')](_0x3a432d[_0xb73a('0x42')]['fields']));_0x1bac41[_0xb73a('0x46')]=_0x1bac41[_0xb73a('0x46')][_0xb73a('0x55')]?_0x1bac41[_0xb73a('0x46')]:_0x39727e[_0xb73a('0x47')];if(_0x3a432d['query'][_0xb73a('0x56')]){_0x1bac41['include']=[{'all':!![]}];}_0x1bac41=_[_0xb73a('0x50')]({},_0x1bac41,_0x3a432d[_0xb73a('0x57')]);return db[_0xb73a('0x3e')][_0xb73a('0x58')](_0x1bac41)[_0xb73a('0x20')](handleEntityNotFound(_0x2c0315,null))[_0xb73a('0x20')](respondWithResult(_0x2c0315,null))[_0xb73a('0x53')](handleError(_0x2c0315,null));};exports['create']=function(_0x1ee0c2,_0x441218){return db[_0xb73a('0x3e')][_0xb73a('0x59')](_0x1ee0c2[_0xb73a('0x5a')],{})[_0xb73a('0x20')](function(_0x79b6bb){var _0x3a1840=_0x1ee0c2['user'][_0xb73a('0x5b')]({'plain':!![]});if(!_0x3a1840)throw new Error(_0xb73a('0x5c'));if(_0x3a1840['role']===_0xb73a('0x5d')){var _0x28b2f6=_0x79b6bb['get']({'plain':!![]});var _0x46bc36=_0xb73a('0x37');return db[_0xb73a('0x5e')][_0xb73a('0x58')]({'where':{'name':_0x46bc36,'userProfileId':_0x3a1840[_0xb73a('0x5f')]},'raw':!![]})[_0xb73a('0x20')](function(_0x3f3755){if(_0x3f3755&&_0x3f3755[_0xb73a('0x60')]===0x0){return db[_0xb73a('0x38')][_0xb73a('0x59')]({'name':_0x28b2f6[_0xb73a('0x3a')],'resourceId':_0x28b2f6['id'],'type':_0x3f3755[_0xb73a('0x3a')],'sectionId':_0x3f3755['id']},{})[_0xb73a('0x20')](function(){return _0x79b6bb;});}else{return _0x79b6bb;}})['catch'](function(_0x4b4047){logger[_0xb73a('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b4047);throw _0x4b4047;});}return _0x79b6bb;})[_0xb73a('0x20')](respondWithResult(_0x441218,0xc9))[_0xb73a('0x53')](handleError(_0x441218,null));};exports[_0xb73a('0x35')]=function(_0x10db0b,_0x2cc9b9){if(_0x10db0b['body']['id']){delete _0x10db0b[_0xb73a('0x5a')]['id'];}return db[_0xb73a('0x3e')][_0xb73a('0x58')]({'where':{'id':_0x10db0b['params']['id']}})[_0xb73a('0x20')](handleEntityNotFound(_0x2cc9b9,null))['then'](saveUpdates(_0x10db0b[_0xb73a('0x5a')],null))[_0xb73a('0x20')](respondWithResult(_0x2cc9b9,null))['catch'](handleError(_0x2cc9b9,null));};exports[_0xb73a('0x36')]=function(_0x4d4947,_0x3cc39f){return db[_0xb73a('0x3e')][_0xb73a('0x58')]({'where':{'id':_0x4d4947[_0xb73a('0x61')]['id']}})[_0xb73a('0x20')](handleEntityNotFound(_0x3cc39f,null))['then'](removeEntity(_0x3cc39f,null))[_0xb73a('0x53')](handleError(_0x3cc39f,null));};exports[_0xb73a('0x62')]=function(_0x579ba6,_0x36160f){return db[_0xb73a('0x3e')][_0xb73a('0x62')]()['then'](respondWithResult(_0x36160f,null))[_0xb73a('0x53')](handleError(_0x36160f,null));};exports[_0xb73a('0x63')]=function(_0x12aa7a,_0x1f9900,_0x5e5b98){var _0x59c3a7={'raw':!![],'where':{}},_0x578c1e={},_0x2d061d;return db[_0xb73a('0x3e')][_0xb73a('0x64')]({'where':{'id':_0x12aa7a[_0xb73a('0x61')]['id']}})[_0xb73a('0x20')](handleEntityNotFound(_0x1f9900,null))[_0xb73a('0x20')](function(_0x516903){if(_0x516903){_0x2d061d=_0x516903['get']({'plain':!![]});_0x578c1e[_0xb73a('0x47')]=_[_0xb73a('0x43')](db[_0xb73a('0x65')][_0xb73a('0x3f')]);_0x578c1e[_0xb73a('0x42')]=_['keys'](_0x12aa7a['query']);_0x578c1e[_0xb73a('0x44')]=_[_0xb73a('0x45')](_0x578c1e[_0xb73a('0x47')],_0x578c1e[_0xb73a('0x42')]);_0x59c3a7['attributes']=_['intersection'](_0x578c1e[_0xb73a('0x47')],qs['fields'](_0x12aa7a['query'][_0xb73a('0x48')]));_0x59c3a7[_0xb73a('0x46')]=_0x59c3a7[_0xb73a('0x46')]['length']?_0x59c3a7[_0xb73a('0x46')]:_0x578c1e[_0xb73a('0x47')];if(!_0x12aa7a[_0xb73a('0x42')][_0xb73a('0x49')](_0xb73a('0x4a'))){_0x59c3a7[_0xb73a('0x2e')]=qs['limit'](_0x12aa7a[_0xb73a('0x42')][_0xb73a('0x2e')]);_0x59c3a7['offset']=qs[_0xb73a('0x2c')](_0x12aa7a[_0xb73a('0x42')][_0xb73a('0x2c')]);}_0x59c3a7[_0xb73a('0x4b')]=qs['sort'](_0x12aa7a['query'][_0xb73a('0x4c')]);_0x59c3a7[_0xb73a('0x4d')]=qs[_0xb73a('0x44')](_[_0xb73a('0x4e')](_0x12aa7a[_0xb73a('0x42')],_0x578c1e[_0xb73a('0x44')]));_0x59c3a7['where']['ChatQueueId']=_0x516903['id'];if(_0x12aa7a[_0xb73a('0x42')]['filter']){_0x59c3a7['where']=_[_0xb73a('0x50')](_0x59c3a7['where'],{'$or':_[_0xb73a('0x3d')](_0x59c3a7[_0xb73a('0x46')],function(_0x59ef00){var _0x5a593c={};_0x5a593c[_0x59ef00]={'$like':'%'+_0x12aa7a[_0xb73a('0x42')][_0xb73a('0x4f')]+'%'};return _0x5a593c;})});}_0x59c3a7=_[_0xb73a('0x50')]({},_0x59c3a7,_0x12aa7a[_0xb73a('0x57')]);return db[_0xb73a('0x65')][_0xb73a('0x52')](_0x59c3a7);}})['then'](function(_0x2c17e5){if(_0x2c17e5){return db[_0xb73a('0x66')]['findAndCountAll']({'where':{'id':_[_0xb73a('0x3d')](_0x2c17e5,_0xb73a('0x67')),'role':_0xb73a('0x68')},'attributes':['id',_0xb73a('0x3a'),_0xb73a('0x69'),'updatedAt',_0xb73a('0x6a')]});}})[_0xb73a('0x20')](function(_0x3a6c8c){if(_0x3a6c8c){return{'count':_0x3a6c8c[_0xb73a('0x2f')],'rows':_[_0xb73a('0x3d')](_0x3a6c8c['rows'],function(_0x5194aa){return{'membername':_0x5194aa[_0xb73a('0x3a')],'UserId':_0x5194aa['id'],'queue_name':_0x2d061d[_0xb73a('0x3a')],'ChatQueueId':_0x2d061d['id'],'interface':util['format'](_0xb73a('0x6b'),_0xb73a('0x6c'),_0x5194aa[_0xb73a('0x3a')]),'penalty':0x0,'paused':_0x5194aa[_0xb73a('0x69')],'createdAt':_0x5194aa[_0xb73a('0x6a')],'updatedAt':_0x5194aa['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb73a('0x20')](respondWithFilteredResult(_0x1f9900,_0x59c3a7))[_0xb73a('0x53')](handleError(_0x1f9900,null));};exports[_0xb73a('0x6d')]=function(_0x4fccc2,_0x4212d0,_0x51789a){var _0x45e2ca={};var _0x28804a={};var _0x43a355;var _0x4de103;return db[_0xb73a('0x3e')]['findOne']({'where':{'id':_0x4fccc2['params']['id']}})[_0xb73a('0x20')](handleEntityNotFound(_0x4212d0,null))['then'](function(_0x4f5bb8){if(_0x4f5bb8){_0x43a355=_0x4f5bb8;_0x28804a[_0xb73a('0x47')]=_[_0xb73a('0x43')](db[_0xb73a('0x6e')][_0xb73a('0x3f')]);_0x28804a['query']=_['keys'](_0x4fccc2[_0xb73a('0x42')]);_0x28804a[_0xb73a('0x44')]=_[_0xb73a('0x45')](_0x28804a[_0xb73a('0x47')],_0x28804a['query']);_0x45e2ca['attributes']=_[_0xb73a('0x45')](_0x28804a[_0xb73a('0x47')],qs[_0xb73a('0x48')](_0x4fccc2[_0xb73a('0x42')]['fields']));_0x45e2ca['attributes']=_0x45e2ca['attributes'][_0xb73a('0x55')]?_0x45e2ca['attributes']:_0x28804a[_0xb73a('0x47')];_0x45e2ca['order']=qs[_0xb73a('0x4c')](_0x4fccc2[_0xb73a('0x42')][_0xb73a('0x4c')]);_0x45e2ca[_0xb73a('0x4d')]=qs[_0xb73a('0x44')](_['pick'](_0x4fccc2[_0xb73a('0x42')],_0x28804a[_0xb73a('0x44')]));if(_0x4fccc2['query'][_0xb73a('0x4f')]){_0x45e2ca['where']=_[_0xb73a('0x50')](_0x45e2ca[_0xb73a('0x4d')],{'$or':_[_0xb73a('0x3d')](_0x45e2ca[_0xb73a('0x46')],function(_0x37964e){var _0x43be0f={};_0x43be0f[_0x37964e]={'$like':'%'+_0x4fccc2[_0xb73a('0x42')][_0xb73a('0x4f')]+'%'};return _0x43be0f;})});}_0x45e2ca=_[_0xb73a('0x50')]({},_0x45e2ca,_0x4fccc2[_0xb73a('0x57')]);return _0x43a355[_0xb73a('0x6d')](_0x45e2ca);}})['then'](function(_0x1173cf){if(_0x1173cf){_0x4de103=_0x1173cf[_0xb73a('0x55')];if(!_0x4fccc2[_0xb73a('0x42')][_0xb73a('0x49')](_0xb73a('0x4a'))){_0x45e2ca[_0xb73a('0x2e')]=qs['limit'](_0x4fccc2[_0xb73a('0x42')][_0xb73a('0x2e')]);_0x45e2ca[_0xb73a('0x2c')]=qs['offset'](_0x4fccc2[_0xb73a('0x42')][_0xb73a('0x2c')]);}return _0x43a355[_0xb73a('0x6d')](_0x45e2ca);}})[_0xb73a('0x20')](function(_0x3dc95c){if(_0x3dc95c){return _0x3dc95c?{'count':_0x4de103,'rows':_0x3dc95c}:null;}})[_0xb73a('0x20')](respondWithResult(_0x4212d0,null))[_0xb73a('0x53')](handleError(_0x4212d0,null));};exports[_0xb73a('0x6f')]=function(_0x4eb32a,_0x53a7aa,_0x222b74){var _0x27ba7c=_0x4eb32a[_0xb73a('0x5a')][_0xb73a('0x70')];return db[_0xb73a('0x6e')][_0xb73a('0x52')]({'where':{'id':_0x27ba7c},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb73a('0x71'),'attributes':['id',_0xb73a('0x3a'),'online','voicePause',_0xb73a('0x72')],'raw':!![]}]})['then'](function(_0x554ade){if(_0x554ade){var _0x4797f2=_[_0xb73a('0x73')](_0x554ade,function(_0x329dec){var _0x12b6a0=_0x329dec[_0xb73a('0x5b')]({'plain':!![]});return _0x12b6a0['Agents'];});return db[_0xb73a('0x3e')][_0xb73a('0x58')]({'where':{'id':_0x4eb32a[_0xb73a('0x61')]['id']}})[_0xb73a('0x20')](function(_0x208492){return db[_0xb73a('0x74')][_0xb73a('0x75')](function(_0x4f21fb){return _0x208492['addTeams'](_0x27ba7c,{'transaction':_0x4f21fb})['then'](function(){return BPromise[_0xb73a('0x76')](_0x4797f2,function(_0x2a0051){return db[_0xb73a('0x65')][_0xb73a('0x77')]({'where':{'UserId':_0x2a0051['id'],'ChatQueueId':_0x4eb32a[_0xb73a('0x61')]['id']},'transaction':_0x4f21fb});});})[_0xb73a('0x20')](function(){_0x4797f2[_0xb73a('0x78')](function(_0x351de8){socket[_0xb73a('0x79')](_0xb73a('0x7a'),{'UserId':_0x351de8['id'],'ChatQueueId':_0x208492['id']});});});});});}})['then'](respondWithStatusCode(_0x53a7aa,null))[_0xb73a('0x53')](handleError(_0x53a7aa,null));};exports[_0xb73a('0x7b')]=function(_0x33daa6,_0x517093,_0x26bca9){return db[_0xb73a('0x6e')]['findAll']({'where':{'id':_0x33daa6[_0xb73a('0x42')][_0xb73a('0x70')]},'attributes':['id'],'include':[{'model':db[_0xb73a('0x66')],'as':_0xb73a('0x71'),'attributes':['id'],'raw':!![]}]})[_0xb73a('0x20')](handleEntityNotFound(_0x517093,null))[_0xb73a('0x20')](function(_0x18c707){var _0x32609a=_['map'](_0x18c707,'id');var _0x2dba00=[];var _0x573fd1=[];var _0x5325da=squel[_0xb73a('0x7c')]();_0x5325da[_0xb73a('0x7d')]('tq.TeamId')['from'](_0xb73a('0x7e'),'tq')[_0xb73a('0x7f')]('user_has_teams','ut',_0xb73a('0x80'))[_0xb73a('0x4d')](_0xb73a('0x81'),_0x33daa6[_0xb73a('0x61')]['id']);for(var _0x395cf1=0x0;_0x395cf1<_0x18c707[_0xb73a('0x55')];_0x395cf1+=0x1){let _0x314e55=_0x18c707[_0x395cf1];for(var _0x200fc5=0x0;_0x200fc5<_0x314e55[_0xb73a('0x71')]['length'];_0x200fc5+=0x1){let _0x43229c=_0x314e55[_0xb73a('0x71')][_0x200fc5];var _0x1f3c8f=_0x5325da[_0xb73a('0x82')]();_0x1f3c8f[_0xb73a('0x4d')](_0xb73a('0x83'),_0x43229c['id']);_0x573fd1['push'](db[_0xb73a('0x74')][_0xb73a('0x42')](_0x1f3c8f[_0xb73a('0x84')](),{'type':db[_0xb73a('0x74')][_0xb73a('0x85')][_0xb73a('0x86')]})['then'](function(_0x21191c){if(_0x21191c['length']===0x1){return _0x43229c['id'];}else{var _0x4f325d=_[_0xb73a('0x87')](_[_0xb73a('0x3d')](_0x21191c,_0xb73a('0x88')),function(_0xe31d8b){return _['includes'](_0x32609a,_0xe31d8b);});if(_0x4f325d){return _0x43229c['id'];}}}));}}return BPromise['all'](_0x573fd1)[_0xb73a('0x20')](function(_0x38eb29){_0x2dba00=_(_0x2dba00)['union'](_0x38eb29)['compact']()[_0xb73a('0x89')]();return db[_0xb73a('0x3e')][_0xb73a('0x58')]({'where':{'id':_0x33daa6['params']['id']}})[_0xb73a('0x20')](function(_0x17ab2b){return db['sequelize']['transaction'](function(_0x1c0347){return _0x17ab2b[_0xb73a('0x7b')](_0x33daa6[_0xb73a('0x42')][_0xb73a('0x70')],{'transaction':_0x1c0347})[_0xb73a('0x20')](function(){if(!_[_0xb73a('0x8a')](_0x2dba00)){return _0x17ab2b[_0xb73a('0x8b')](_0x2dba00,{'transaction':_0x1c0347});}})[_0xb73a('0x20')](function(){_0x2dba00['forEach'](function(_0x523d3f){socket[_0xb73a('0x79')](_0xb73a('0x8c'),{'UserId':_0x523d3f,'ChatQueueId':_0x17ab2b['id']});});});});});});})[_0xb73a('0x20')](respondWithStatusCode(_0x517093,null))[_0xb73a('0x53')](handleError(_0x517093,null));};exports[_0xb73a('0x8d')]=function(_0x1303e7,_0x48851a,_0x183af8){return db[_0xb73a('0x3e')]['find']({'where':{'id':_0x1303e7[_0xb73a('0x61')]['id']}})['then'](handleEntityNotFound(_0x48851a,null))[_0xb73a('0x20')](function(_0x1b6167){if(_0x1b6167){return _0x1b6167['addAgents'](_0x1303e7[_0xb73a('0x5a')][_0xb73a('0x70')],_[_0xb73a('0x8e')](_0x1303e7[_0xb73a('0x5a')],[_0xb73a('0x70'),'id'])||{})[_0xb73a('0x8f')](function(_0x49f486){for(var _0x19ea6e=0x0;_0x19ea6e<_0x1303e7[_0xb73a('0x5a')][_0xb73a('0x70')][_0xb73a('0x55')];_0x19ea6e+=0x1){socket[_0xb73a('0x79')](_0xb73a('0x7a'),{'UserId':Number(_0x1303e7[_0xb73a('0x5a')][_0xb73a('0x70')][_0x19ea6e]),'ChatQueueId':Number(_0x1303e7[_0xb73a('0x61')]['id'])});}return _0x49f486;});}})[_0xb73a('0x20')](respondWithResult(_0x48851a,null))[_0xb73a('0x53')](handleError(_0x48851a,null));};exports[_0xb73a('0x8b')]=function(_0x1763fa,_0x2c913a,_0x47a237){return db['ChatQueue'][_0xb73a('0x58')]({'where':{'id':_0x1763fa['params']['id']}})[_0xb73a('0x20')](handleEntityNotFound(_0x2c913a,null))['then'](function(_0xa83734){if(_0xa83734){return _0xa83734[_0xb73a('0x8b')](_0x1763fa[_0xb73a('0x42')][_0xb73a('0x70')])['then'](function(){if(_[_0xb73a('0x90')](_0x1763fa[_0xb73a('0x42')][_0xb73a('0x70')])){for(var _0x5f0f69=0x0;_0x5f0f69<_0x1763fa[_0xb73a('0x42')][_0xb73a('0x70')][_0xb73a('0x55')];_0x5f0f69+=0x1){socket[_0xb73a('0x79')](_0xb73a('0x8c'),{'UserId':Number(_0x1763fa['query'][_0xb73a('0x70')][_0x5f0f69]),'ChatQueueId':Number(_0x1763fa[_0xb73a('0x61')]['id'])});}}else{socket[_0xb73a('0x79')](_0xb73a('0x8c'),{'UserId':Number(_0x1763fa[_0xb73a('0x42')][_0xb73a('0x70')]),'ChatQueueId':Number(_0x1763fa['params']['id'])});}});}})[_0xb73a('0x20')](respondWithStatusCode(_0x2c913a,null))[_0xb73a('0x53')](handleError(_0x2c913a,null));};exports[_0xb73a('0x91')]=function(_0x4c4d4a,_0x1aa2e9,_0x158032){var _0xa5da9b={};var _0x117eb8={};var _0x1a691f;var _0x25a62e;return db[_0xb73a('0x3e')][_0xb73a('0x64')]({'where':{'id':_0x4c4d4a[_0xb73a('0x61')]['id']}})[_0xb73a('0x20')](handleEntityNotFound(_0x1aa2e9,null))[_0xb73a('0x20')](function(_0x3b346c){if(_0x3b346c){_0x1a691f=_0x3b346c;_0x117eb8['model']=_['keys'](db[_0xb73a('0x66')][_0xb73a('0x3f')]);_0x117eb8['query']=_[_0xb73a('0x43')](_0x4c4d4a[_0xb73a('0x42')]);_0x117eb8['filters']=_['intersection'](_0x117eb8[_0xb73a('0x47')],_0x117eb8[_0xb73a('0x42')]);_0xa5da9b[_0xb73a('0x46')]=_['intersection'](_0x117eb8[_0xb73a('0x47')],qs['fields'](_0x4c4d4a[_0xb73a('0x42')][_0xb73a('0x48')]));_0xa5da9b[_0xb73a('0x46')]=_0xa5da9b[_0xb73a('0x46')]['length']?_0xa5da9b[_0xb73a('0x46')]:_0x117eb8[_0xb73a('0x47')];_0xa5da9b[_0xb73a('0x4b')]=qs[_0xb73a('0x4c')](_0x4c4d4a[_0xb73a('0x42')][_0xb73a('0x4c')]);_0xa5da9b['where']=qs['filters'](_[_0xb73a('0x4e')](_0x4c4d4a[_0xb73a('0x42')],_0x117eb8[_0xb73a('0x44')]));if(_0x4c4d4a[_0xb73a('0x42')][_0xb73a('0x4f')]){_0xa5da9b[_0xb73a('0x4d')]=_[_0xb73a('0x50')](_0xa5da9b[_0xb73a('0x4d')],{'$or':_[_0xb73a('0x3d')](_0xa5da9b[_0xb73a('0x46')],function(_0x117baf){var _0x1823d5={};_0x1823d5[_0x117baf]={'$like':'%'+_0x4c4d4a[_0xb73a('0x42')][_0xb73a('0x4f')]+'%'};return _0x1823d5;})});}_0xa5da9b=_[_0xb73a('0x50')]({},_0xa5da9b,_0x4c4d4a[_0xb73a('0x57')]);return _0x1a691f[_0xb73a('0x91')](_0xa5da9b);}})[_0xb73a('0x20')](function(_0xaa7941){if(_0xaa7941){_0x25a62e=_0xaa7941[_0xb73a('0x55')];if(!_0x4c4d4a[_0xb73a('0x42')][_0xb73a('0x49')]('nolimit')){_0xa5da9b['limit']=qs[_0xb73a('0x2e')](_0x4c4d4a[_0xb73a('0x42')][_0xb73a('0x2e')]);_0xa5da9b[_0xb73a('0x2c')]=qs[_0xb73a('0x2c')](_0x4c4d4a[_0xb73a('0x42')][_0xb73a('0x2c')]);}return _0x1a691f[_0xb73a('0x91')](_0xa5da9b);}})[_0xb73a('0x20')](function(_0x43918b){if(_0x43918b){return _0x43918b?{'count':_0x25a62e,'rows':_0x43918b}:null;}})['then'](respondWithResult(_0x1aa2e9,null))['catch'](handleError(_0x1aa2e9,null));};
\ No newline at end of file
+var _0xf66a=['message','result','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','ChatQueues','UserProfileResource','destroy','name','index','map','ChatQueue','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','rows','catch','params','includeAll','options','create','body','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserChatQueue','ChatQueueId','findAll','User','findAndCountAll','agent','chatPause','createdAt','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','compact','value','transaction','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3a5b0b,_0x50e024){var _0x37c881=function(_0x418a37){while(--_0x418a37){_0x3a5b0b['push'](_0x3a5b0b['shift']());}};_0x37c881(++_0x50e024);}(_0xf66a,0x196));var _0xaf66=function(_0x1201d2,_0x4e166f){_0x1201d2=_0x1201d2-0x0;var _0x1a8c11=_0xf66a[_0x1201d2];return _0x1a8c11;};'use strict';var emlformat=require(_0xaf66('0x0'));var rimraf=require(_0xaf66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaf66('0x2'));var BPromise=require(_0xaf66('0x3'));var Mustache=require('mustache');var util=require(_0xaf66('0x4'));var path=require(_0xaf66('0x5'));var sox=require(_0xaf66('0x6'));var csv=require(_0xaf66('0x7'));var ejs=require(_0xaf66('0x8'));var fs=require('fs');var fs_extra=require(_0xaf66('0x9'));var _=require(_0xaf66('0xa'));var squel=require(_0xaf66('0xb'));var crypto=require(_0xaf66('0xc'));var jsforce=require(_0xaf66('0xd'));var deskjs=require(_0xaf66('0xe'));var toCsv=require(_0xaf66('0x7'));var querystring=require(_0xaf66('0xf'));var Papa=require(_0xaf66('0x10'));var Redis=require(_0xaf66('0x11'));var authService=require(_0xaf66('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf66('0x13'));var logger=require(_0xaf66('0x14'))(_0xaf66('0x15'));var utils=require(_0xaf66('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xaf66('0x17'));var db=require('../../mysqldb')['db'];config[_0xaf66('0x18')]=_[_0xaf66('0x19')](config[_0xaf66('0x18')],{'host':_0xaf66('0x1a'),'port':0x18eb});var socket=require(_0xaf66('0x1b'))(new Redis(config[_0xaf66('0x18')]));require(_0xaf66('0x1c'))[_0xaf66('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xaf66('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47cb60,_0x3b6549,_0x2b0e1f,_0x1175c7){return new BPromise(function(_0x2f91bb,_0x176aa5){var _0x27bf20=_0x1175c7||client;return _0x27bf20[_0xaf66('0x1f')](_0x47cb60,_0x2b0e1f)[_0xaf66('0x20')](function(_0x24c422){logger[_0xaf66('0x21')](_0xaf66('0x22'),_0x3b6549,_0xaf66('0x23'));logger[_0xaf66('0x24')](_0xaf66('0x25'),_0x3b6549,_0xaf66('0x23'),JSON[_0xaf66('0x26')](_0x24c422));if(_0x24c422[_0xaf66('0x27')]){if(_0x24c422[_0xaf66('0x27')][_0xaf66('0x28')]===0x1f4){logger[_0xaf66('0x27')](_0xaf66('0x22'),_0x3b6549,_0x24c422[_0xaf66('0x27')]['message']);return _0x176aa5(_0x24c422[_0xaf66('0x27')][_0xaf66('0x29')]);}logger[_0xaf66('0x27')](_0xaf66('0x22'),_0x3b6549,_0x24c422[_0xaf66('0x27')]['message']);return _0x2f91bb(_0x24c422[_0xaf66('0x27')][_0xaf66('0x29')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x3b6549,_0xaf66('0x23'));_0x2f91bb(_0x24c422[_0xaf66('0x2a')][_0xaf66('0x29')]);}})['catch'](function(_0xe7e281){logger[_0xaf66('0x27')](_0xaf66('0x22'),_0x3b6549,_0xe7e281);_0x176aa5(_0xe7e281);});});}function respondWithStatusCode(_0x564de4,_0x997219){_0x997219=_0x997219||0xcc;return function(_0xd388b5){if(_0xd388b5){return _0x564de4[_0xaf66('0x2b')](_0x997219);}return _0x564de4[_0xaf66('0x2c')](_0x997219)[_0xaf66('0x2d')]();};}function respondWithResult(_0x2bfa3b,_0x253a15){_0x253a15=_0x253a15||0xc8;return function(_0x2798a7){if(_0x2798a7){return _0x2bfa3b['status'](_0x253a15)[_0xaf66('0x2e')](_0x2798a7);}};}function respondWithFilteredResult(_0x48bdef,_0x3bd8b6){return function(_0x3f7c1d){if(_0x3f7c1d){var _0xa19814=typeof _0x3bd8b6[_0xaf66('0x2f')]===_0xaf66('0x30')&&typeof _0x3bd8b6['limit']===_0xaf66('0x30');var _0x214977=_0x3f7c1d[_0xaf66('0x31')];var _0x54c7d8=_0xa19814?0x0:_0x3bd8b6[_0xaf66('0x2f')];var _0x3f3835=_0xa19814?_0x3f7c1d[_0xaf66('0x31')]:_0x3bd8b6[_0xaf66('0x2f')]+_0x3bd8b6['limit'];var _0x2df016;if(_0x3f3835>=_0x214977){_0x3f3835=_0x214977;_0x2df016=0xc8;}else{_0x2df016=0xce;}_0x48bdef[_0xaf66('0x2c')](_0x2df016);return _0x48bdef[_0xaf66('0x32')](_0xaf66('0x33'),_0x54c7d8+'-'+_0x3f3835+'/'+_0x214977)[_0xaf66('0x2e')](_0x3f7c1d);}return null;};}function patchUpdates(_0x2cc112){return function(_0x27d061){try{jsonpatch[_0xaf66('0x34')](_0x27d061,_0x2cc112,!![]);}catch(_0x2ec891){return BPromise[_0xaf66('0x35')](_0x2ec891);}return _0x27d061['save']();};}function saveUpdates(_0x5e3b5e,_0x92ac42){return function(_0x603113){if(_0x603113){return _0x603113['update'](_0x5e3b5e)[_0xaf66('0x20')](function(_0x54dc44){return _0x54dc44;});}return null;};}function removeEntity(_0x24bd75,_0x314e19){return function(_0x74e345){if(_0x74e345){return _0x74e345['destroy']()[_0xaf66('0x20')](function(){var _0x1608b3=_0x74e345['get']({'plain':!![]});var _0x4a61df=_0xaf66('0x36');return db[_0xaf66('0x37')][_0xaf66('0x38')]({'where':{'type':_0x4a61df,'resourceId':_0x1608b3['id']}})[_0xaf66('0x20')](function(){return _0x74e345;});})['then'](function(){_0x24bd75['status'](0xcc)[_0xaf66('0x2d')]();});}};}function handleEntityNotFound(_0x2509df,_0x41de00){return function(_0x455902){if(!_0x455902){_0x2509df['sendStatus'](0x194);}return _0x455902;};}function handleError(_0x394d94,_0x582542){_0x582542=_0x582542||0x1f4;return function(_0x661f6b){logger['error'](_0x661f6b['stack']);if(_0x661f6b[_0xaf66('0x39')]){delete _0x661f6b[_0xaf66('0x39')];}_0x394d94['status'](_0x582542)['send'](_0x661f6b);};}exports[_0xaf66('0x3a')]=function(_0x24c271,_0x35ba6a){var _0x3a1da1={},_0x9d128f={},_0x2a39d9={'count':0x0,'rows':[]};var _0x5b683e=_[_0xaf66('0x3b')](db[_0xaf66('0x3c')][_0xaf66('0x3d')],function(_0x33511d){return{'name':_0x33511d['fieldName'],'type':_0x33511d['type']['key']};});_0x9d128f[_0xaf66('0x3e')]=_[_0xaf66('0x3b')](_0x5b683e,_0xaf66('0x39'));_0x9d128f[_0xaf66('0x3f')]=_[_0xaf66('0x40')](_0x24c271['query']);_0x9d128f[_0xaf66('0x41')]=_['intersection'](_0x9d128f[_0xaf66('0x3e')],_0x9d128f[_0xaf66('0x3f')]);_0x3a1da1['attributes']=_[_0xaf66('0x42')](_0x9d128f['model'],qs['fields'](_0x24c271[_0xaf66('0x3f')][_0xaf66('0x43')]));_0x3a1da1['attributes']=_0x3a1da1[_0xaf66('0x44')][_0xaf66('0x45')]?_0x3a1da1[_0xaf66('0x44')]:_0x9d128f['model'];if(!_0x24c271[_0xaf66('0x3f')][_0xaf66('0x46')](_0xaf66('0x47'))){_0x3a1da1['limit']=qs[_0xaf66('0x48')](_0x24c271[_0xaf66('0x3f')]['limit']);_0x3a1da1[_0xaf66('0x2f')]=qs[_0xaf66('0x2f')](_0x24c271[_0xaf66('0x3f')][_0xaf66('0x2f')]);}_0x3a1da1[_0xaf66('0x49')]=qs[_0xaf66('0x4a')](_0x24c271[_0xaf66('0x3f')][_0xaf66('0x4a')]);_0x3a1da1['where']=qs[_0xaf66('0x41')](_[_0xaf66('0x4b')](_0x24c271[_0xaf66('0x3f')],_0x9d128f[_0xaf66('0x41')]),_0x5b683e);if(_0x24c271[_0xaf66('0x3f')][_0xaf66('0x4c')]){_0x3a1da1[_0xaf66('0x4d')]=_[_0xaf66('0x4e')](_0x3a1da1[_0xaf66('0x4d')],{'$or':_[_0xaf66('0x3b')](_0x5b683e,function(_0x2fc2f9){if(_0x2fc2f9['type']!==_0xaf66('0x4f')){var _0x2c67ea={};_0x2c67ea[_0x2fc2f9['name']]={'$like':'%'+_0x24c271[_0xaf66('0x3f')]['filter']+'%'};return _0x2c67ea;}})});}_0x3a1da1=_[_0xaf66('0x4e')]({},_0x3a1da1,_0x24c271['options']);var _0x4e9fb0={'where':_0x3a1da1['where']};return db['ChatQueue']['count'](_0x4e9fb0)[_0xaf66('0x20')](function(_0x4fcfe1){_0x2a39d9[_0xaf66('0x31')]=_0x4fcfe1;if(_0x24c271[_0xaf66('0x3f')]['includeAll']){_0x3a1da1['include']=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x3a1da1);})[_0xaf66('0x20')](function(_0x28fe47){_0x2a39d9[_0xaf66('0x50')]=_0x28fe47;return _0x2a39d9;})[_0xaf66('0x20')](respondWithFilteredResult(_0x35ba6a,_0x3a1da1))[_0xaf66('0x51')](handleError(_0x35ba6a,null));};exports['show']=function(_0x3ba319,_0x5aee03){var _0x2f8699={'raw':!![],'where':{'id':_0x3ba319[_0xaf66('0x52')]['id']}},_0x24160d={};_0x24160d[_0xaf66('0x3e')]=_['keys'](db['ChatQueue']['rawAttributes']);_0x24160d[_0xaf66('0x3f')]=_['keys'](_0x3ba319[_0xaf66('0x3f')]);_0x24160d['filters']=_[_0xaf66('0x42')](_0x24160d[_0xaf66('0x3e')],_0x24160d[_0xaf66('0x3f')]);_0x2f8699[_0xaf66('0x44')]=_[_0xaf66('0x42')](_0x24160d[_0xaf66('0x3e')],qs[_0xaf66('0x43')](_0x3ba319['query'][_0xaf66('0x43')]));_0x2f8699[_0xaf66('0x44')]=_0x2f8699['attributes'][_0xaf66('0x45')]?_0x2f8699[_0xaf66('0x44')]:_0x24160d[_0xaf66('0x3e')];if(_0x3ba319[_0xaf66('0x3f')][_0xaf66('0x53')]){_0x2f8699['include']=[{'all':!![]}];}_0x2f8699=_[_0xaf66('0x4e')]({},_0x2f8699,_0x3ba319[_0xaf66('0x54')]);return db[_0xaf66('0x3c')]['find'](_0x2f8699)[_0xaf66('0x20')](handleEntityNotFound(_0x5aee03,null))[_0xaf66('0x20')](respondWithResult(_0x5aee03,null))[_0xaf66('0x51')](handleError(_0x5aee03,null));};exports['create']=function(_0x3d35ca,_0x46db9c){return db['ChatQueue'][_0xaf66('0x55')](_0x3d35ca[_0xaf66('0x56')],{})[_0xaf66('0x20')](function(_0x4c25a1){var _0x1637bc=_0x3d35ca[_0xaf66('0x57')][_0xaf66('0x58')]({'plain':!![]});if(!_0x1637bc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1637bc[_0xaf66('0x59')]===_0xaf66('0x57')){var _0x37b8e7=_0x4c25a1[_0xaf66('0x58')]({'plain':!![]});var _0x1a2f45=_0xaf66('0x36');return db[_0xaf66('0x5a')][_0xaf66('0x5b')]({'where':{'name':_0x1a2f45,'userProfileId':_0x1637bc[_0xaf66('0x5c')]},'raw':!![]})[_0xaf66('0x20')](function(_0x180a9e){if(_0x180a9e&&_0x180a9e[_0xaf66('0x5d')]===0x0){return db[_0xaf66('0x37')]['create']({'name':_0x37b8e7[_0xaf66('0x39')],'resourceId':_0x37b8e7['id'],'type':_0x180a9e['name'],'sectionId':_0x180a9e['id']},{})[_0xaf66('0x20')](function(){return _0x4c25a1;});}else{return _0x4c25a1;}})[_0xaf66('0x51')](function(_0x55060b){logger['error'](_0xaf66('0x5e'),_0x55060b);throw _0x55060b;});}return _0x4c25a1;})['then'](respondWithResult(_0x46db9c,0xc9))['catch'](handleError(_0x46db9c,null));};exports['update']=function(_0x6d0f5c,_0x27a988){if(_0x6d0f5c[_0xaf66('0x56')]['id']){delete _0x6d0f5c[_0xaf66('0x56')]['id'];}return db[_0xaf66('0x3c')]['find']({'where':{'id':_0x6d0f5c[_0xaf66('0x52')]['id']}})['then'](handleEntityNotFound(_0x27a988,null))[_0xaf66('0x20')](saveUpdates(_0x6d0f5c[_0xaf66('0x56')],null))[_0xaf66('0x20')](respondWithResult(_0x27a988,null))[_0xaf66('0x51')](handleError(_0x27a988,null));};exports[_0xaf66('0x38')]=function(_0x55421f,_0x4252d7){return db[_0xaf66('0x3c')][_0xaf66('0x5b')]({'where':{'id':_0x55421f[_0xaf66('0x52')]['id']}})[_0xaf66('0x20')](handleEntityNotFound(_0x4252d7,null))['then'](removeEntity(_0x4252d7,null))[_0xaf66('0x51')](handleError(_0x4252d7,null));};exports['describe']=function(_0x193b74,_0x261d38){return db['ChatQueue'][_0xaf66('0x5f')]()[_0xaf66('0x20')](respondWithResult(_0x261d38,null))[_0xaf66('0x51')](handleError(_0x261d38,null));};exports['getMembers']=function(_0x4b62d5,_0x3ea7dd,_0x10a9d1){var _0x11c843={'raw':!![],'where':{}},_0x121526={},_0x4894d2;return db[_0xaf66('0x3c')]['findOne']({'where':{'id':_0x4b62d5['params']['id']}})[_0xaf66('0x20')](handleEntityNotFound(_0x3ea7dd,null))[_0xaf66('0x20')](function(_0x2703e9){if(_0x2703e9){_0x4894d2=_0x2703e9[_0xaf66('0x58')]({'plain':!![]});_0x121526[_0xaf66('0x3e')]=_[_0xaf66('0x40')](db[_0xaf66('0x60')][_0xaf66('0x3d')]);_0x121526[_0xaf66('0x3f')]=_[_0xaf66('0x40')](_0x4b62d5[_0xaf66('0x3f')]);_0x121526[_0xaf66('0x41')]=_[_0xaf66('0x42')](_0x121526[_0xaf66('0x3e')],_0x121526[_0xaf66('0x3f')]);_0x11c843['attributes']=_[_0xaf66('0x42')](_0x121526[_0xaf66('0x3e')],qs['fields'](_0x4b62d5[_0xaf66('0x3f')][_0xaf66('0x43')]));_0x11c843[_0xaf66('0x44')]=_0x11c843[_0xaf66('0x44')][_0xaf66('0x45')]?_0x11c843['attributes']:_0x121526[_0xaf66('0x3e')];if(!_0x4b62d5[_0xaf66('0x3f')][_0xaf66('0x46')]('nolimit')){_0x11c843['limit']=qs['limit'](_0x4b62d5[_0xaf66('0x3f')][_0xaf66('0x48')]);_0x11c843[_0xaf66('0x2f')]=qs[_0xaf66('0x2f')](_0x4b62d5['query'][_0xaf66('0x2f')]);}_0x11c843[_0xaf66('0x49')]=qs['sort'](_0x4b62d5['query'][_0xaf66('0x4a')]);_0x11c843[_0xaf66('0x4d')]=qs['filters'](_[_0xaf66('0x4b')](_0x4b62d5[_0xaf66('0x3f')],_0x121526[_0xaf66('0x41')]));_0x11c843[_0xaf66('0x4d')][_0xaf66('0x61')]=_0x2703e9['id'];if(_0x4b62d5[_0xaf66('0x3f')]['filter']){_0x11c843[_0xaf66('0x4d')]=_[_0xaf66('0x4e')](_0x11c843[_0xaf66('0x4d')],{'$or':_[_0xaf66('0x3b')](_0x11c843[_0xaf66('0x44')],function(_0x291037){var _0x5940ec={};_0x5940ec[_0x291037]={'$like':'%'+_0x4b62d5[_0xaf66('0x3f')][_0xaf66('0x4c')]+'%'};return _0x5940ec;})});}_0x11c843=_[_0xaf66('0x4e')]({},_0x11c843,_0x4b62d5['options']);return db['UserChatQueue'][_0xaf66('0x62')](_0x11c843);}})[_0xaf66('0x20')](function(_0x2bec3d){if(_0x2bec3d){return db[_0xaf66('0x63')][_0xaf66('0x64')]({'where':{'id':_[_0xaf66('0x3b')](_0x2bec3d,'UserId'),'role':_0xaf66('0x65')},'attributes':['id',_0xaf66('0x39'),_0xaf66('0x66'),'updatedAt',_0xaf66('0x67')]});}})[_0xaf66('0x20')](function(_0x3855c7){if(_0x3855c7){return{'count':_0x3855c7[_0xaf66('0x31')],'rows':_[_0xaf66('0x3b')](_0x3855c7[_0xaf66('0x50')],function(_0x5daeb8){return{'membername':_0x5daeb8[_0xaf66('0x39')],'UserId':_0x5daeb8['id'],'queue_name':_0x4894d2[_0xaf66('0x39')],'ChatQueueId':_0x4894d2['id'],'interface':util['format'](_0xaf66('0x68'),_0xaf66('0x69'),_0x5daeb8[_0xaf66('0x39')]),'penalty':0x0,'paused':_0x5daeb8[_0xaf66('0x66')],'createdAt':_0x5daeb8[_0xaf66('0x67')],'updatedAt':_0x5daeb8[_0xaf66('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xaf66('0x20')](respondWithFilteredResult(_0x3ea7dd,_0x11c843))[_0xaf66('0x51')](handleError(_0x3ea7dd,null));};exports[_0xaf66('0x6b')]=function(_0x32d90b,_0x4b8f54,_0x51a83d){var _0x49c7f4={};var _0x433e0b={};var _0x1e83bd;var _0x29bd47;return db['ChatQueue'][_0xaf66('0x6c')]({'where':{'id':_0x32d90b[_0xaf66('0x52')]['id']}})[_0xaf66('0x20')](handleEntityNotFound(_0x4b8f54,null))[_0xaf66('0x20')](function(_0x292cee){if(_0x292cee){_0x1e83bd=_0x292cee;_0x433e0b[_0xaf66('0x3e')]=_[_0xaf66('0x40')](db[_0xaf66('0x6d')][_0xaf66('0x3d')]);_0x433e0b['query']=_[_0xaf66('0x40')](_0x32d90b[_0xaf66('0x3f')]);_0x433e0b['filters']=_[_0xaf66('0x42')](_0x433e0b[_0xaf66('0x3e')],_0x433e0b[_0xaf66('0x3f')]);_0x49c7f4[_0xaf66('0x44')]=_[_0xaf66('0x42')](_0x433e0b[_0xaf66('0x3e')],qs[_0xaf66('0x43')](_0x32d90b[_0xaf66('0x3f')][_0xaf66('0x43')]));_0x49c7f4[_0xaf66('0x44')]=_0x49c7f4[_0xaf66('0x44')][_0xaf66('0x45')]?_0x49c7f4[_0xaf66('0x44')]:_0x433e0b[_0xaf66('0x3e')];_0x49c7f4[_0xaf66('0x49')]=qs[_0xaf66('0x4a')](_0x32d90b[_0xaf66('0x3f')][_0xaf66('0x4a')]);_0x49c7f4[_0xaf66('0x4d')]=qs[_0xaf66('0x41')](_[_0xaf66('0x4b')](_0x32d90b[_0xaf66('0x3f')],_0x433e0b[_0xaf66('0x41')]));if(_0x32d90b[_0xaf66('0x3f')][_0xaf66('0x4c')]){_0x49c7f4[_0xaf66('0x4d')]=_[_0xaf66('0x4e')](_0x49c7f4[_0xaf66('0x4d')],{'$or':_['map'](_0x49c7f4[_0xaf66('0x44')],function(_0x336787){var _0x3a2d34={};_0x3a2d34[_0x336787]={'$like':'%'+_0x32d90b['query'][_0xaf66('0x4c')]+'%'};return _0x3a2d34;})});}_0x49c7f4=_['merge']({},_0x49c7f4,_0x32d90b[_0xaf66('0x54')]);return _0x1e83bd[_0xaf66('0x6b')](_0x49c7f4);}})[_0xaf66('0x20')](function(_0x28e98d){if(_0x28e98d){_0x29bd47=_0x28e98d[_0xaf66('0x45')];if(!_0x32d90b[_0xaf66('0x3f')]['hasOwnProperty'](_0xaf66('0x47'))){_0x49c7f4[_0xaf66('0x48')]=qs[_0xaf66('0x48')](_0x32d90b[_0xaf66('0x3f')]['limit']);_0x49c7f4[_0xaf66('0x2f')]=qs[_0xaf66('0x2f')](_0x32d90b[_0xaf66('0x3f')][_0xaf66('0x2f')]);}return _0x1e83bd[_0xaf66('0x6b')](_0x49c7f4);}})[_0xaf66('0x20')](function(_0x417d3c){if(_0x417d3c){return _0x417d3c?{'count':_0x29bd47,'rows':_0x417d3c}:null;}})['then'](respondWithResult(_0x4b8f54,null))[_0xaf66('0x51')](handleError(_0x4b8f54,null));};exports[_0xaf66('0x6e')]=function(_0x1aa7c6,_0x57918d,_0xd567f1){var _0x284f4f=_0x1aa7c6[_0xaf66('0x56')][_0xaf66('0x6f')];return db[_0xaf66('0x6d')][_0xaf66('0x62')]({'where':{'id':_0x284f4f},'attributes':['id'],'include':[{'model':db[_0xaf66('0x63')],'as':_0xaf66('0x70'),'attributes':['id','name',_0xaf66('0x71'),_0xaf66('0x72'),'interface'],'raw':!![]}]})[_0xaf66('0x20')](function(_0x2de015){if(_0x2de015){var _0x57d725=_[_0xaf66('0x73')](_0x2de015,function(_0x15b6f0){var _0x747685=_0x15b6f0[_0xaf66('0x58')]({'plain':!![]});return _0x747685[_0xaf66('0x70')];});return db['ChatQueue']['find']({'where':{'id':_0x1aa7c6[_0xaf66('0x52')]['id']}})[_0xaf66('0x20')](function(_0x374cd2){return db[_0xaf66('0x74')]['transaction'](function(_0x37ea16){return _0x374cd2['addTeams'](_0x284f4f,{'transaction':_0x37ea16})[_0xaf66('0x20')](function(){return BPromise[_0xaf66('0x75')](_0x57d725,function(_0x121081){return db[_0xaf66('0x60')][_0xaf66('0x76')]({'where':{'UserId':_0x121081['id'],'ChatQueueId':_0x1aa7c6[_0xaf66('0x52')]['id']},'transaction':_0x37ea16});});})['then'](function(){_0x57d725[_0xaf66('0x77')](function(_0x58bf8f){socket[_0xaf66('0x78')](_0xaf66('0x79'),{'UserId':_0x58bf8f['id'],'ChatQueueId':_0x374cd2['id']});});});});});}})[_0xaf66('0x20')](respondWithStatusCode(_0x57918d,null))['catch'](handleError(_0x57918d,null));};exports[_0xaf66('0x7a')]=function(_0x1d50ab,_0x27c69c,_0x53ca0a){return db[_0xaf66('0x6d')][_0xaf66('0x62')]({'where':{'id':_0x1d50ab[_0xaf66('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db[_0xaf66('0x63')],'as':_0xaf66('0x70'),'attributes':['id'],'raw':!![]}]})[_0xaf66('0x20')](handleEntityNotFound(_0x27c69c,null))[_0xaf66('0x20')](function(_0x3eece6){var _0x416301=_[_0xaf66('0x3b')](_0x3eece6,'id');var _0x3a5dd7=[];var _0x145f08=[];var _0x53867a=squel[_0xaf66('0x7b')]();_0x53867a[_0xaf66('0x7c')](_0xaf66('0x7d'))[_0xaf66('0x7e')]('team_has_chat_queues','tq')[_0xaf66('0x7f')](_0xaf66('0x80'),'ut',_0xaf66('0x81'))[_0xaf66('0x4d')](_0xaf66('0x82'),_0x1d50ab[_0xaf66('0x52')]['id']);for(var _0x18fe40=0x0;_0x18fe40<_0x3eece6[_0xaf66('0x45')];_0x18fe40+=0x1){let _0x238a8f=_0x3eece6[_0x18fe40];for(var _0x53b281=0x0;_0x53b281<_0x238a8f['Agents'][_0xaf66('0x45')];_0x53b281+=0x1){let _0x521d64=_0x238a8f['Agents'][_0x53b281];var _0x5d5b09=_0x53867a['clone']();_0x5d5b09[_0xaf66('0x4d')](_0xaf66('0x83'),_0x521d64['id']);_0x145f08[_0xaf66('0x84')](db['sequelize'][_0xaf66('0x3f')](_0x5d5b09[_0xaf66('0x85')](),{'type':db[_0xaf66('0x74')][_0xaf66('0x86')]['SELECT']})[_0xaf66('0x20')](function(_0x29f173){if(_0x29f173[_0xaf66('0x45')]===0x1){return _0x521d64['id'];}else{var _0x41202e=_[_0xaf66('0x87')](_['map'](_0x29f173,_0xaf66('0x88')),function(_0x187e7e){return _['includes'](_0x416301,_0x187e7e);});if(_0x41202e){return _0x521d64['id'];}}}));}}return BPromise[_0xaf66('0x89')](_0x145f08)[_0xaf66('0x20')](function(_0xaa2de8){_0x3a5dd7=_(_0x3a5dd7)[_0xaf66('0x8a')](_0xaa2de8)[_0xaf66('0x8b')]()[_0xaf66('0x8c')]();return db[_0xaf66('0x3c')][_0xaf66('0x5b')]({'where':{'id':_0x1d50ab[_0xaf66('0x52')]['id']}})[_0xaf66('0x20')](function(_0x4c5c18){return db[_0xaf66('0x74')][_0xaf66('0x8d')](function(_0x1b3f7f){return _0x4c5c18[_0xaf66('0x7a')](_0x1d50ab[_0xaf66('0x3f')][_0xaf66('0x6f')],{'transaction':_0x1b3f7f})[_0xaf66('0x20')](function(){if(!_['isEmpty'](_0x3a5dd7)){return _0x4c5c18[_0xaf66('0x8e')](_0x3a5dd7,{'transaction':_0x1b3f7f});}})['then'](function(){_0x3a5dd7['forEach'](function(_0x386ddb){socket[_0xaf66('0x78')](_0xaf66('0x8f'),{'UserId':_0x386ddb,'ChatQueueId':_0x4c5c18['id']});});});});});});})[_0xaf66('0x20')](respondWithStatusCode(_0x27c69c,null))[_0xaf66('0x51')](handleError(_0x27c69c,null));};exports[_0xaf66('0x90')]=function(_0x32f9f4,_0x4870c8,_0x100705){return db[_0xaf66('0x3c')][_0xaf66('0x5b')]({'where':{'id':_0x32f9f4['params']['id']}})['then'](handleEntityNotFound(_0x4870c8,null))[_0xaf66('0x20')](function(_0x1cfd4e){if(_0x1cfd4e){return _0x1cfd4e[_0xaf66('0x90')](_0x32f9f4[_0xaf66('0x56')][_0xaf66('0x6f')],_[_0xaf66('0x91')](_0x32f9f4['body'],['ids','id'])||{})[_0xaf66('0x92')](function(_0x2368e2){for(var _0x3bd602=0x0;_0x3bd602<_0x32f9f4[_0xaf66('0x56')][_0xaf66('0x6f')][_0xaf66('0x45')];_0x3bd602+=0x1){socket[_0xaf66('0x78')](_0xaf66('0x79'),{'UserId':Number(_0x32f9f4['body'][_0xaf66('0x6f')][_0x3bd602]),'ChatQueueId':Number(_0x32f9f4[_0xaf66('0x52')]['id'])});}return _0x2368e2;});}})['then'](respondWithResult(_0x4870c8,null))['catch'](handleError(_0x4870c8,null));};exports[_0xaf66('0x8e')]=function(_0x1d6bdf,_0x14c593,_0x22fb11){return db[_0xaf66('0x3c')]['find']({'where':{'id':_0x1d6bdf[_0xaf66('0x52')]['id']}})[_0xaf66('0x20')](handleEntityNotFound(_0x14c593,null))[_0xaf66('0x20')](function(_0x207609){if(_0x207609){return _0x207609['removeAgents'](_0x1d6bdf[_0xaf66('0x3f')][_0xaf66('0x6f')])[_0xaf66('0x20')](function(){if(_[_0xaf66('0x93')](_0x1d6bdf['query'][_0xaf66('0x6f')])){for(var _0x359924=0x0;_0x359924<_0x1d6bdf[_0xaf66('0x3f')][_0xaf66('0x6f')][_0xaf66('0x45')];_0x359924+=0x1){socket[_0xaf66('0x78')](_0xaf66('0x8f'),{'UserId':Number(_0x1d6bdf[_0xaf66('0x3f')][_0xaf66('0x6f')][_0x359924]),'ChatQueueId':Number(_0x1d6bdf[_0xaf66('0x52')]['id'])});}}else{socket['emit'](_0xaf66('0x8f'),{'UserId':Number(_0x1d6bdf[_0xaf66('0x3f')]['ids']),'ChatQueueId':Number(_0x1d6bdf['params']['id'])});}});}})['then'](respondWithStatusCode(_0x14c593,null))[_0xaf66('0x51')](handleError(_0x14c593,null));};exports['getAgents']=function(_0xc09c38,_0xe6e0ff,_0x544441){var _0xfe69f={};var _0xc679={};var _0x56d16c;var _0x503e4b;return db['ChatQueue']['findOne']({'where':{'id':_0xc09c38[_0xaf66('0x52')]['id']}})[_0xaf66('0x20')](handleEntityNotFound(_0xe6e0ff,null))[_0xaf66('0x20')](function(_0x3d1c65){if(_0x3d1c65){_0x56d16c=_0x3d1c65;_0xc679['model']=_[_0xaf66('0x40')](db['User'][_0xaf66('0x3d')]);_0xc679[_0xaf66('0x3f')]=_['keys'](_0xc09c38['query']);_0xc679['filters']=_[_0xaf66('0x42')](_0xc679['model'],_0xc679[_0xaf66('0x3f')]);_0xfe69f[_0xaf66('0x44')]=_['intersection'](_0xc679[_0xaf66('0x3e')],qs['fields'](_0xc09c38[_0xaf66('0x3f')][_0xaf66('0x43')]));_0xfe69f[_0xaf66('0x44')]=_0xfe69f[_0xaf66('0x44')][_0xaf66('0x45')]?_0xfe69f[_0xaf66('0x44')]:_0xc679[_0xaf66('0x3e')];_0xfe69f[_0xaf66('0x49')]=qs['sort'](_0xc09c38['query'][_0xaf66('0x4a')]);_0xfe69f[_0xaf66('0x4d')]=qs[_0xaf66('0x41')](_['pick'](_0xc09c38[_0xaf66('0x3f')],_0xc679[_0xaf66('0x41')]));if(_0xc09c38['query'][_0xaf66('0x4c')]){_0xfe69f[_0xaf66('0x4d')]=_[_0xaf66('0x4e')](_0xfe69f[_0xaf66('0x4d')],{'$or':_[_0xaf66('0x3b')](_0xfe69f['attributes'],function(_0xf49a6f){var _0x5e39aa={};_0x5e39aa[_0xf49a6f]={'$like':'%'+_0xc09c38[_0xaf66('0x3f')]['filter']+'%'};return _0x5e39aa;})});}_0xfe69f=_[_0xaf66('0x4e')]({},_0xfe69f,_0xc09c38[_0xaf66('0x54')]);return _0x56d16c[_0xaf66('0x94')](_0xfe69f);}})['then'](function(_0x2b5f11){if(_0x2b5f11){_0x503e4b=_0x2b5f11['length'];if(!_0xc09c38[_0xaf66('0x3f')][_0xaf66('0x46')]('nolimit')){_0xfe69f[_0xaf66('0x48')]=qs['limit'](_0xc09c38[_0xaf66('0x3f')]['limit']);_0xfe69f['offset']=qs[_0xaf66('0x2f')](_0xc09c38[_0xaf66('0x3f')][_0xaf66('0x2f')]);}return _0x56d16c[_0xaf66('0x94')](_0xfe69f);}})[_0xaf66('0x20')](function(_0x5c6983){if(_0x5c6983){return _0x5c6983?{'count':_0x503e4b,'rows':_0x5c6983}:null;}})[_0xaf66('0x20')](respondWithResult(_0xe6e0ff,null))[_0xaf66('0x51')](handleError(_0xe6e0ff,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 1e9b7ab..b58a2e5 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 _0xc9b6=['ChatQueue','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x1819bd,_0x15e90e){var _0x5b5f76=function(_0x358907){while(--_0x358907){_0x1819bd['push'](_0x1819bd['shift']());}};_0x5b5f76(++_0x15e90e);}(_0xc9b6,0xb6));var _0x6c9b=function(_0x3f59e7,_0x3ac9df){_0x3f59e7=_0x3f59e7-0x0;var _0x26e855=_0xc9b6[_0x3f59e7];return _0x26e855;};'use strict';var EventEmitter=require(_0x6c9b('0x0'));var ChatQueue=require(_0x6c9b('0x1'))['db'][_0x6c9b('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6c9b('0x3'),'afterUpdate':_0x6c9b('0x4'),'afterDestroy':_0x6c9b('0x5')};function emitEvent(_0x4a9305){return function(_0x44a559,_0x25300b,_0x855dc9){ChatQueueEvents[_0x6c9b('0x6')](_0x4a9305+':'+_0x44a559['id'],_0x44a559);ChatQueueEvents[_0x6c9b('0x6')](_0x4a9305,_0x44a559);_0x855dc9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x6c9b('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x7ab1=['update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x192807,_0x17de9e){var _0x4061df=function(_0x44eed9){while(--_0x44eed9){_0x192807['push'](_0x192807['shift']());}};_0x4061df(++_0x17de9e);}(_0x7ab1,0x1b5));var _0x17ab=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7ab1[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x17ab('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x17ab('0x1'),'afterDestroy':_0x17ab('0x2')};function emitEvent(_0x3f3cf0){return function(_0x29b082,_0x158d0d,_0x15919c){ChatQueueEvents['emit'](_0x3f3cf0+':'+_0x29b082['id'],_0x29b082);ChatQueueEvents[_0x17ab('0x3')](_0x3f3cf0,_0x29b082);_0x15919c(null);};}for(var e in events){if(events[_0x17ab('0x4')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x17ab('0x5')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index ab95141..b8bd462 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 _0x480b=['util','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','ChatQueue','chat_queues','lodash'];(function(_0x50b918,_0x12064c){var _0x21c735=function(_0x269229){while(--_0x269229){_0x50b918['push'](_0x50b918['shift']());}};_0x21c735(++_0x12064c);}(_0x480b,0x78));var _0xb480=function(_0x518c4a,_0x1139bb){_0x518c4a=_0x518c4a-0x0;var _0x4daca4=_0x480b[_0x518c4a];return _0x4daca4;};'use strict';var _=require(_0xb480('0x0'));var util=require(_0xb480('0x1'));var logger=require('../../config/logger')(_0xb480('0x2'));var moment=require(_0xb480('0x3'));var BPromise=require(_0xb480('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb480('0x5'));var rimraf=require(_0xb480('0x6'));var config=require(_0xb480('0x7'));var attributes=require(_0xb480('0x8'));module['exports']=function(_0x11a56f,_0x2fbb4b){return _0x11a56f['define'](_0xb480('0x9'),attributes,{'tableName':_0xb480('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6be9=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','util'];(function(_0x1d7300,_0x17f109){var _0x46ee98=function(_0x5ee16a){while(--_0x5ee16a){_0x1d7300['push'](_0x1d7300['shift']());}};_0x46ee98(++_0x17f109);}(_0x6be9,0x66));var _0x96be=function(_0x2ed989,_0xf3616){_0x2ed989=_0x2ed989-0x0;var _0x1200f3=_0x6be9[_0x2ed989];return _0x1200f3;};'use strict';var _=require(_0x96be('0x0'));var util=require(_0x96be('0x1'));var logger=require(_0x96be('0x2'))(_0x96be('0x3'));var moment=require('moment');var BPromise=require(_0x96be('0x4'));var rp=require(_0x96be('0x5'));var fs=require('fs');var path=require(_0x96be('0x6'));var rimraf=require(_0x96be('0x7'));var config=require(_0x96be('0x8'));var attributes=require(_0x96be('0x9'));module[_0x96be('0xa')]=function(_0x2c3c37,_0x1a0cde){return _0x2c3c37[_0x96be('0xb')](_0x96be('0xc'),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 d559cce..65f1006 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 _0x7aa0=['rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','limit','map','include','model','debug','stringify','catch','ShowChatQueue','find','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0x7aa0,0xa1));var _0x07aa=function(_0x366c77,_0x20e6a8){_0x366c77=_0x366c77-0x0;var _0x5b1950=_0x7aa0[_0x366c77];return _0x5b1950;};'use strict';var _=require(_0x07aa('0x0'));var util=require(_0x07aa('0x1'));var moment=require(_0x07aa('0x2'));var BPromise=require(_0x07aa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x07aa('0x4'))['db'];var utils=require(_0x07aa('0x5'));var logger=require(_0x07aa('0x6'))(_0x07aa('0x7'));var config=require(_0x07aa('0x8'));var jayson=require(_0x07aa('0x9'));var client=jayson['client'][_0x07aa('0xa')]({'port':0x232a});config['redis']=_[_0x07aa('0xb')](config['redis'],{'host':_0x07aa('0xc'),'port':0x18eb});var socket=require(_0x07aa('0xd'))(new Redis(config[_0x07aa('0xe')]));require(_0x07aa('0xf'))[_0x07aa('0x10')](socket);function respondWithRpcPromise(_0x18064b,_0xddeeba,_0x150026){return new BPromise(function(_0x4803dc,_0x2d11de){return client['request'](_0x18064b,_0x150026)[_0x07aa('0x11')](function(_0x13d341){logger[_0x07aa('0x12')](_0x07aa('0x13'),_0xddeeba,_0x07aa('0x14'));logger['debug'](_0x07aa('0x15'),_0xddeeba,_0x07aa('0x14'),JSON['stringify'](_0x13d341));if(_0x13d341[_0x07aa('0x16')]){if(_0x13d341['error'][_0x07aa('0x17')]===0x1f4){logger['error'](_0x07aa('0x13'),_0xddeeba,_0x13d341[_0x07aa('0x16')][_0x07aa('0x18')]);return _0x2d11de(_0x13d341['error']['message']);}logger[_0x07aa('0x16')](_0x07aa('0x13'),_0xddeeba,_0x13d341[_0x07aa('0x16')][_0x07aa('0x18')]);return _0x4803dc(_0x13d341[_0x07aa('0x16')]['message']);}else{logger[_0x07aa('0x12')](_0x07aa('0x13'),_0xddeeba,'request\x20sent');_0x4803dc(_0x13d341[_0x07aa('0x19')][_0x07aa('0x18')]);}})['catch'](function(_0x1b3d3e){logger[_0x07aa('0x16')](_0x07aa('0x13'),_0xddeeba,_0x1b3d3e);_0x2d11de(_0x1b3d3e);});});}exports[_0x07aa('0x1a')]=function(_0xd18462){var _0x5548fd=this;return new Promise(function(_0x13f865,_0x517ea1){return db[_0x07aa('0x1b')][_0x07aa('0x1c')]({'raw':_0xd18462['options']?_0xd18462['options'][_0x07aa('0x1d')]===undefined?!![]:![]:!![],'where':_0xd18462[_0x07aa('0x1e')]?_0xd18462[_0x07aa('0x1e')][_0x07aa('0x1f')]||null:null,'attributes':_0xd18462['options']?_0xd18462[_0x07aa('0x1e')][_0x07aa('0x20')]||null:null,'limit':_0xd18462[_0x07aa('0x1e')]?_0xd18462[_0x07aa('0x1e')][_0x07aa('0x21')]||null:null,'include':_0xd18462[_0x07aa('0x1e')]?_0xd18462[_0x07aa('0x1e')]['include']?_[_0x07aa('0x22')](_0xd18462[_0x07aa('0x1e')][_0x07aa('0x23')],function(_0x4fe949){return{'model':db[_0x4fe949[_0x07aa('0x24')]],'as':_0x4fe949['as'],'attributes':_0x4fe949[_0x07aa('0x20')],'include':_0x4fe949[_0x07aa('0x23')]?_['map'](_0x4fe949[_0x07aa('0x23')],function(_0x4aacbd){return{'model':db[_0x4aacbd[_0x07aa('0x24')]],'as':_0x4aacbd['as'],'attributes':_0x4aacbd['attributes'],'include':_0x4aacbd[_0x07aa('0x23')]?_[_0x07aa('0x22')](_0x4aacbd[_0x07aa('0x23')],function(_0x3c55ab){return{'model':db[_0x3c55ab[_0x07aa('0x24')]],'as':_0x3c55ab['as'],'attributes':_0x3c55ab[_0x07aa('0x20')]};}):[]};}):[]};}):[]:[]})[_0x07aa('0x11')](function(_0xa8f57d){logger[_0x07aa('0x12')](_0x07aa('0x1a'),_0xd18462);logger[_0x07aa('0x25')](_0x07aa('0x1a'),_0xd18462,JSON[_0x07aa('0x26')](_0xa8f57d));_0x13f865(_0xa8f57d);})[_0x07aa('0x27')](function(_0x156134){logger['error'](_0x07aa('0x1a'),_0x156134[_0x07aa('0x18')],_0xd18462);_0x517ea1(_0x5548fd[_0x07aa('0x16')](0x1f4,_0x156134[_0x07aa('0x18')]));});});};exports[_0x07aa('0x28')]=function(_0x4317f8){var _0x273f3d=this;return new Promise(function(_0x2cc824,_0xe18859){return db['ChatQueue'][_0x07aa('0x29')]({'raw':_0x4317f8[_0x07aa('0x1e')]?_0x4317f8[_0x07aa('0x1e')][_0x07aa('0x1d')]===undefined?!![]:![]:!![],'where':_0x4317f8['options']?_0x4317f8[_0x07aa('0x1e')][_0x07aa('0x1f')]||null:null,'attributes':_0x4317f8[_0x07aa('0x1e')]?_0x4317f8[_0x07aa('0x1e')][_0x07aa('0x20')]||null:null,'include':_0x4317f8['options']?_0x4317f8[_0x07aa('0x1e')]['include']?_[_0x07aa('0x22')](_0x4317f8[_0x07aa('0x1e')][_0x07aa('0x23')],function(_0x30f283){return{'model':db[_0x30f283[_0x07aa('0x24')]],'as':_0x30f283['as'],'attributes':_0x30f283[_0x07aa('0x20')],'include':_0x30f283[_0x07aa('0x23')]?_['map'](_0x30f283[_0x07aa('0x23')],function(_0x2e900d){return{'model':db[_0x2e900d[_0x07aa('0x24')]],'as':_0x2e900d['as'],'attributes':_0x2e900d[_0x07aa('0x20')],'include':_0x2e900d[_0x07aa('0x23')]?_[_0x07aa('0x22')](_0x2e900d[_0x07aa('0x23')],function(_0x4e2750){return{'model':db[_0x4e2750[_0x07aa('0x24')]],'as':_0x4e2750['as'],'attributes':_0x4e2750[_0x07aa('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1dd86e){logger[_0x07aa('0x12')](_0x07aa('0x28'),_0x4317f8);logger['debug']('ShowChatQueue',_0x4317f8,JSON[_0x07aa('0x26')](_0x1dd86e));_0x2cc824(_0x1dd86e);})[_0x07aa('0x27')](function(_0x4b8184){logger['error']('ShowChatQueue',_0x4b8184[_0x07aa('0x18')],_0x4317f8);_0xe18859(_0x273f3d[_0x07aa('0x16')](0x1f4,_0x4b8184[_0x07aa('0x18')]));});});};
\ No newline at end of file
+var _0x672d=['message','result','catch','ChatQueue','options','raw','where','attributes','limit','map','model','include','GetChatQueue','ShowChatQueue','find','lodash','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x219d87,_0x1cb6f7){var _0x22823d=function(_0x5357bf){while(--_0x5357bf){_0x219d87['push'](_0x219d87['shift']());}};_0x22823d(++_0x1cb6f7);}(_0x672d,0x181));var _0xd672=function(_0x4748b5,_0x442d0a){_0x4748b5=_0x4748b5-0x0;var _0x311a30=_0x672d[_0x4748b5];return _0x311a30;};'use strict';var _=require(_0xd672('0x0'));var util=require('util');var moment=require(_0xd672('0x1'));var BPromise=require(_0xd672('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd672('0x3'));var logger=require(_0xd672('0x4'))('rpc');var config=require(_0xd672('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd672('0x6')][_0xd672('0x7')]({'port':0x232a});config[_0xd672('0x8')]=_[_0xd672('0x9')](config[_0xd672('0x8')],{'host':_0xd672('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd672('0x8')]));require(_0xd672('0xb'))[_0xd672('0xc')](socket);function respondWithRpcPromise(_0x431bfa,_0x218c6f,_0x41289b){return new BPromise(function(_0x4e87ba,_0x5ae10e){return client[_0xd672('0xd')](_0x431bfa,_0x41289b)[_0xd672('0xe')](function(_0x46f78b){logger[_0xd672('0xf')](_0xd672('0x10'),_0x218c6f,'request\x20sent');logger[_0xd672('0x11')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x218c6f,_0xd672('0x12'),JSON[_0xd672('0x13')](_0x46f78b));if(_0x46f78b[_0xd672('0x14')]){if(_0x46f78b['error'][_0xd672('0x15')]===0x1f4){logger[_0xd672('0x14')](_0xd672('0x10'),_0x218c6f,_0x46f78b[_0xd672('0x14')][_0xd672('0x16')]);return _0x5ae10e(_0x46f78b[_0xd672('0x14')]['message']);}logger[_0xd672('0x14')](_0xd672('0x10'),_0x218c6f,_0x46f78b[_0xd672('0x14')]['message']);return _0x4e87ba(_0x46f78b[_0xd672('0x14')][_0xd672('0x16')]);}else{logger[_0xd672('0xf')](_0xd672('0x10'),_0x218c6f,'request\x20sent');_0x4e87ba(_0x46f78b[_0xd672('0x17')][_0xd672('0x16')]);}})[_0xd672('0x18')](function(_0x3a99d8){logger[_0xd672('0x14')](_0xd672('0x10'),_0x218c6f,_0x3a99d8);_0x5ae10e(_0x3a99d8);});});}exports['GetChatQueue']=function(_0x236bd7){var _0x486ba1=this;return new Promise(function(_0x1cda11,_0x5604cb){return db[_0xd672('0x19')]['findAll']({'raw':_0x236bd7[_0xd672('0x1a')]?_0x236bd7['options'][_0xd672('0x1b')]===undefined?!![]:![]:!![],'where':_0x236bd7[_0xd672('0x1a')]?_0x236bd7[_0xd672('0x1a')][_0xd672('0x1c')]||null:null,'attributes':_0x236bd7['options']?_0x236bd7[_0xd672('0x1a')][_0xd672('0x1d')]||null:null,'limit':_0x236bd7[_0xd672('0x1a')]?_0x236bd7[_0xd672('0x1a')][_0xd672('0x1e')]||null:null,'include':_0x236bd7[_0xd672('0x1a')]?_0x236bd7[_0xd672('0x1a')]['include']?_[_0xd672('0x1f')](_0x236bd7['options']['include'],function(_0x314d7d){return{'model':db[_0x314d7d[_0xd672('0x20')]],'as':_0x314d7d['as'],'attributes':_0x314d7d['attributes'],'include':_0x314d7d[_0xd672('0x21')]?_[_0xd672('0x1f')](_0x314d7d[_0xd672('0x21')],function(_0x5764e2){return{'model':db[_0x5764e2['model']],'as':_0x5764e2['as'],'attributes':_0x5764e2['attributes'],'include':_0x5764e2[_0xd672('0x21')]?_['map'](_0x5764e2['include'],function(_0x549c5e){return{'model':db[_0x549c5e['model']],'as':_0x549c5e['as'],'attributes':_0x549c5e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x526a90){logger[_0xd672('0xf')]('GetChatQueue',_0x236bd7);logger['debug'](_0xd672('0x22'),_0x236bd7,JSON[_0xd672('0x13')](_0x526a90));_0x1cda11(_0x526a90);})[_0xd672('0x18')](function(_0x8ef91d){logger[_0xd672('0x14')](_0xd672('0x22'),_0x8ef91d[_0xd672('0x16')],_0x236bd7);_0x5604cb(_0x486ba1[_0xd672('0x14')](0x1f4,_0x8ef91d[_0xd672('0x16')]));});});};exports[_0xd672('0x23')]=function(_0x15d280){var _0x267aa3=this;return new Promise(function(_0x162c35,_0x1ba48a){return db[_0xd672('0x19')][_0xd672('0x24')]({'raw':_0x15d280['options']?_0x15d280[_0xd672('0x1a')][_0xd672('0x1b')]===undefined?!![]:![]:!![],'where':_0x15d280['options']?_0x15d280[_0xd672('0x1a')][_0xd672('0x1c')]||null:null,'attributes':_0x15d280[_0xd672('0x1a')]?_0x15d280[_0xd672('0x1a')]['attributes']||null:null,'include':_0x15d280[_0xd672('0x1a')]?_0x15d280['options'][_0xd672('0x21')]?_[_0xd672('0x1f')](_0x15d280[_0xd672('0x1a')]['include'],function(_0xf16e2c){return{'model':db[_0xf16e2c[_0xd672('0x20')]],'as':_0xf16e2c['as'],'attributes':_0xf16e2c['attributes'],'include':_0xf16e2c[_0xd672('0x21')]?_['map'](_0xf16e2c[_0xd672('0x21')],function(_0x1d43e8){return{'model':db[_0x1d43e8[_0xd672('0x20')]],'as':_0x1d43e8['as'],'attributes':_0x1d43e8[_0xd672('0x1d')],'include':_0x1d43e8['include']?_[_0xd672('0x1f')](_0x1d43e8[_0xd672('0x21')],function(_0xe353d4){return{'model':db[_0xe353d4[_0xd672('0x20')]],'as':_0xe353d4['as'],'attributes':_0xe353d4['attributes']};}):[]};}):[]};}):[]:[]})[_0xd672('0xe')](function(_0x54cd33){logger[_0xd672('0xf')](_0xd672('0x23'),_0x15d280);logger[_0xd672('0x11')](_0xd672('0x23'),_0x15d280,JSON[_0xd672('0x13')](_0x54cd33));_0x162c35(_0x54cd33);})[_0xd672('0x18')](function(_0x129baa){logger[_0xd672('0x14')](_0xd672('0x23'),_0x129baa[_0xd672('0x16')],_0x15d280);_0x1ba48a(_0x267aa3['error'](0x1f4,_0x129baa['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 0201567..902a8c1 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 _0x3140=['removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x49b063,_0xc246bf){var _0x812a93=function(_0x4fee29){while(--_0x4fee29){_0x49b063['push'](_0x49b063['shift']());}};_0x812a93(++_0xc246bf);}(_0x3140,0xaf));var _0x0314=function(_0x296d9d,_0x4d286b){_0x296d9d=_0x296d9d-0x0;var _0x53f5d0=_0x3140[_0x296d9d];return _0x53f5d0;};'use strict';var ChatQueueEvents=require(_0x0314('0x0'));var events=[_0x0314('0x1'),_0x0314('0x2'),_0x0314('0x3')];function createListener(_0x4ac557,_0x4cf353){return function(_0x285be5){_0x4cf353[_0x0314('0x4')](_0x4ac557,_0x285be5);};}function removeListener(_0x1c0f66,_0x3e4284){return function(){ChatQueueEvents[_0x0314('0x5')](_0x1c0f66,_0x3e4284);};}exports[_0x0314('0x6')]=function(_0x9e308d){for(var _0xf87d26=0x0,_0x11ee94=events[_0x0314('0x7')];_0xf87d26<_0x11ee94;_0xf87d26++){var _0x176944=events[_0xf87d26];var _0x495b27=createListener(_0x0314('0x8')+_0x176944,_0x9e308d);ChatQueueEvents['on'](_0x176944,_0x495b27);}};
\ No newline at end of file
+var _0xb332=['emit','register','./chatQueue.events','remove','update'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0xb332,0xd9));var _0x2b33=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0xb332[_0x4a7843];return _0x2c57fe;};'use strict';var ChatQueueEvents=require(_0x2b33('0x0'));var events=['save',_0x2b33('0x1'),_0x2b33('0x2')];function createListener(_0x5ee720,_0xf8c6a7){return function(_0x548a70){_0xf8c6a7[_0x2b33('0x3')](_0x5ee720,_0x548a70);};}function removeListener(_0x4c6634,_0x34b111){return function(){ChatQueueEvents['removeListener'](_0x4c6634,_0x34b111);};}exports[_0x2b33('0x4')]=function(_0x22d66){for(var _0x478214=0x0,_0x461d44=events['length'];_0x478214<_0x461d44;_0x478214++){var _0x5ccf2d=events[_0x478214];var _0x4302b7=createListener('chatQueue:'+_0x5ccf2d,_0x22d66);ChatQueueEvents['on'](_0x5ccf2d,_0x4302b7);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 628fa1a..fa72950 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3e74,0x175));var _0x43e7=function(_0x295f99,_0x245ffd){_0x295f99=_0x295f99-0x0;var _0x8f96da=_0x3e74[_0x295f99];return _0x8f96da;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
+var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x32b8a0,_0x213779){var _0x223a7d=function(_0x51f25e){while(--_0x51f25e){_0x32b8a0['push'](_0x32b8a0['shift']());}};_0x223a7d(++_0x213779);}(_0x008c,0x188));var _0xc008=function(_0x88da9,_0x52cd6a){_0x88da9=_0x88da9-0x0;var _0x42df80=_0x008c[_0x88da9];return _0x42df80;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index ff4a95d..4111663 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 _0x4b2e=['STRING','DATE','moment','sequelize','exports'];(function(_0x18cd87,_0x358a7f){var _0x379687=function(_0x1f8da3){while(--_0x1f8da3){_0x18cd87['push'](_0x18cd87['shift']());}};_0x379687(++_0x358a7f);}(_0x4b2e,0x1ec));var _0xe4b2=function(_0x1a8d48,_0x452097){_0x1a8d48=_0x1a8d48-0x0;var _0x1f9de2=_0x4b2e[_0x1a8d48];return _0x1f9de2;};'use strict';var moment=require(_0xe4b2('0x0'));var Sequelize=require(_0xe4b2('0x1'));module[_0xe4b2('0x2')]={'uniqueid':{'type':Sequelize[_0xe4b2('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xe4b2('0x3')]},'joinAt':{'type':Sequelize[_0xe4b2('0x4')]},'leaveAt':{'type':Sequelize[_0xe4b2('0x4')]},'acceptAt':{'type':Sequelize[_0xe4b2('0x4')]},'exitAt':{'type':Sequelize[_0xe4b2('0x4')]},'reason':{'type':Sequelize[_0xe4b2('0x3')]}};
\ No newline at end of file
+var _0x9670=['exports','STRING','DATE','moment','sequelize'];(function(_0x284e49,_0x200326){var _0x4737b2=function(_0x269c43){while(--_0x269c43){_0x284e49['push'](_0x284e49['shift']());}};_0x4737b2(++_0x200326);}(_0x9670,0x71));var _0x0967=function(_0x229c23,_0x380edc){_0x229c23=_0x229c23-0x0;var _0x348784=_0x9670[_0x229c23];return _0x348784;};'use strict';var moment=require(_0x0967('0x0'));var Sequelize=require(_0x0967('0x1'));module[_0x0967('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0967('0x3')]},'joinAt':{'type':Sequelize[_0x0967('0x4')]},'leaveAt':{'type':Sequelize[_0x0967('0x4')]},'acceptAt':{'type':Sequelize[_0x0967('0x4')]},'exitAt':{'type':Sequelize[_0x0967('0x4')]},'reason':{'type':Sequelize[_0x0967('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 788844f..1f894ea 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 _0xdf98=['ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','pick','filters','filter','options','includeAll','include','ChatQueueReport','findAll','rows','catch','show','params','length','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xdf98,0xcf));var _0x8df9=function(_0x317bf0,_0x277c03){_0x317bf0=_0x317bf0-0x0;var _0x225932=_0xdf98[_0x317bf0];return _0x225932;};'use strict';var emlformat=require(_0x8df9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8df9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8df9('0x2'));var BPromise=require(_0x8df9('0x3'));var Mustache=require(_0x8df9('0x4'));var util=require(_0x8df9('0x5'));var path=require(_0x8df9('0x6'));var sox=require(_0x8df9('0x7'));var csv=require(_0x8df9('0x8'));var ejs=require(_0x8df9('0x9'));var fs=require('fs');var fs_extra=require(_0x8df9('0xa'));var _=require('lodash');var squel=require(_0x8df9('0xb'));var crypto=require(_0x8df9('0xc'));var jsforce=require(_0x8df9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8df9('0xe'));var Papa=require('papaparse');var Redis=require(_0x8df9('0xf'));var authService=require(_0x8df9('0x10'));var qs=require(_0x8df9('0x11'));var as=require(_0x8df9('0x12'));var hardwareService=require(_0x8df9('0x13'));var logger=require(_0x8df9('0x14'))(_0x8df9('0x15'));var utils=require(_0x8df9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8df9('0x17'));var db=require(_0x8df9('0x18'))['db'];function respondWithStatusCode(_0x45f85b,_0x5a97dd){_0x5a97dd=_0x5a97dd||0xcc;return function(_0x42666d){if(_0x42666d){return _0x45f85b[_0x8df9('0x19')](_0x5a97dd);}return _0x45f85b[_0x8df9('0x1a')](_0x5a97dd)[_0x8df9('0x1b')]();};}function respondWithResult(_0x4bc4cc,_0x510e66){_0x510e66=_0x510e66||0xc8;return function(_0x2dcc1c){if(_0x2dcc1c){return _0x4bc4cc[_0x8df9('0x1a')](_0x510e66)[_0x8df9('0x1c')](_0x2dcc1c);}};}function respondWithFilteredResult(_0x50f0f7,_0x110f2b){return function(_0x526c78){if(_0x526c78){var _0xcc0419=typeof _0x110f2b['offset']===_0x8df9('0x1d')&&typeof _0x110f2b[_0x8df9('0x1e')]===_0x8df9('0x1d');var _0x218e76=_0x526c78[_0x8df9('0x1f')];var _0x16e8c4=_0xcc0419?0x0:_0x110f2b['offset'];var _0x54f2b0=_0xcc0419?_0x526c78[_0x8df9('0x1f')]:_0x110f2b['offset']+_0x110f2b['limit'];var _0x324dc0;if(_0x54f2b0>=_0x218e76){_0x54f2b0=_0x218e76;_0x324dc0=0xc8;}else{_0x324dc0=0xce;}_0x50f0f7[_0x8df9('0x1a')](_0x324dc0);return _0x50f0f7[_0x8df9('0x20')](_0x8df9('0x21'),_0x16e8c4+'-'+_0x54f2b0+'/'+_0x218e76)[_0x8df9('0x1c')](_0x526c78);}return null;};}function patchUpdates(_0xd73eb3){return function(_0x5a0071){try{jsonpatch[_0x8df9('0x22')](_0x5a0071,_0xd73eb3,!![]);}catch(_0x36deb6){return BPromise[_0x8df9('0x23')](_0x36deb6);}return _0x5a0071['save']();};}function saveUpdates(_0x5041f8,_0x490028){return function(_0x4a6748){if(_0x4a6748){return _0x4a6748['update'](_0x5041f8)[_0x8df9('0x24')](function(_0x239b71){return _0x239b71;});}return null;};}function removeEntity(_0x360d0b,_0x3dea66){return function(_0x478453){if(_0x478453){return _0x478453[_0x8df9('0x25')]()[_0x8df9('0x24')](function(){_0x360d0b[_0x8df9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3323dc,_0xe662a6){return function(_0x30cc42){if(!_0x30cc42){_0x3323dc['sendStatus'](0x194);}return _0x30cc42;};}function handleError(_0x5e8f46,_0x27d441){_0x27d441=_0x27d441||0x1f4;return function(_0x5117c9){logger['error'](_0x5117c9[_0x8df9('0x26')]);if(_0x5117c9[_0x8df9('0x27')]){delete _0x5117c9[_0x8df9('0x27')];}_0x5e8f46[_0x8df9('0x1a')](_0x27d441)[_0x8df9('0x28')](_0x5117c9);};}exports['index']=function(_0x5a3907,_0x8de080){var _0xce8575={},_0x2a9fee={},_0x5180fb={'count':0x0,'rows':[]};var _0x25d636=_[_0x8df9('0x29')](db['ChatQueueReport'][_0x8df9('0x2a')],function(_0x1c5065){return{'name':_0x1c5065['fieldName'],'type':_0x1c5065[_0x8df9('0x2b')][_0x8df9('0x2c')]};});_0x2a9fee[_0x8df9('0x2d')]=_['map'](_0x25d636,'name');_0x2a9fee[_0x8df9('0x2e')]=_[_0x8df9('0x2f')](_0x5a3907[_0x8df9('0x2e')]);_0x2a9fee['filters']=_[_0x8df9('0x30')](_0x2a9fee[_0x8df9('0x2d')],_0x2a9fee[_0x8df9('0x2e')]);_0xce8575[_0x8df9('0x31')]=_['intersection'](_0x2a9fee[_0x8df9('0x2d')],qs[_0x8df9('0x32')](_0x5a3907['query'][_0x8df9('0x32')]));_0xce8575['attributes']=_0xce8575['attributes']['length']?_0xce8575['attributes']:_0x2a9fee[_0x8df9('0x2d')];if(!_0x5a3907[_0x8df9('0x2e')][_0x8df9('0x33')](_0x8df9('0x34'))){_0xce8575[_0x8df9('0x1e')]=qs[_0x8df9('0x1e')](_0x5a3907[_0x8df9('0x2e')][_0x8df9('0x1e')]);_0xce8575[_0x8df9('0x35')]=qs[_0x8df9('0x35')](_0x5a3907[_0x8df9('0x2e')][_0x8df9('0x35')]);}_0xce8575['order']=qs['sort'](_0x5a3907['query'][_0x8df9('0x36')]);_0xce8575[_0x8df9('0x37')]=qs['filters'](_[_0x8df9('0x38')](_0x5a3907['query'],_0x2a9fee[_0x8df9('0x39')]),_0x25d636);if(_0x5a3907[_0x8df9('0x2e')]['filter']){_0xce8575['where']=_['merge'](_0xce8575[_0x8df9('0x37')],{'$or':_[_0x8df9('0x29')](_0x25d636,function(_0x25d77f){if(_0x25d77f['type']!=='VIRTUAL'){var _0x16b0c3={};_0x16b0c3[_0x25d77f['name']]={'$like':'%'+_0x5a3907[_0x8df9('0x2e')][_0x8df9('0x3a')]+'%'};return _0x16b0c3;}})});}_0xce8575=_['merge']({},_0xce8575,_0x5a3907[_0x8df9('0x3b')]);var _0x44e295={'where':_0xce8575[_0x8df9('0x37')]};return db['ChatQueueReport'][_0x8df9('0x1f')](_0x44e295)['then'](function(_0x11014b){_0x5180fb[_0x8df9('0x1f')]=_0x11014b;if(_0x5a3907[_0x8df9('0x2e')][_0x8df9('0x3c')]){_0xce8575[_0x8df9('0x3d')]=[{'all':!![]}];}return db[_0x8df9('0x3e')][_0x8df9('0x3f')](_0xce8575);})[_0x8df9('0x24')](function(_0x211b51){_0x5180fb[_0x8df9('0x40')]=_0x211b51;return _0x5180fb;})[_0x8df9('0x24')](respondWithFilteredResult(_0x8de080,_0xce8575))[_0x8df9('0x41')](handleError(_0x8de080,null));};exports[_0x8df9('0x42')]=function(_0x5d68b0,_0x5b84e6){var _0x1b5cb3={'raw':!![],'where':{'id':_0x5d68b0[_0x8df9('0x43')]['id']}},_0x4fdf12={};_0x4fdf12['model']=_[_0x8df9('0x2f')](db[_0x8df9('0x3e')][_0x8df9('0x2a')]);_0x4fdf12[_0x8df9('0x2e')]=_[_0x8df9('0x2f')](_0x5d68b0[_0x8df9('0x2e')]);_0x4fdf12[_0x8df9('0x39')]=_[_0x8df9('0x30')](_0x4fdf12[_0x8df9('0x2d')],_0x4fdf12[_0x8df9('0x2e')]);_0x1b5cb3[_0x8df9('0x31')]=_[_0x8df9('0x30')](_0x4fdf12['model'],qs[_0x8df9('0x32')](_0x5d68b0[_0x8df9('0x2e')][_0x8df9('0x32')]));_0x1b5cb3['attributes']=_0x1b5cb3[_0x8df9('0x31')][_0x8df9('0x44')]?_0x1b5cb3['attributes']:_0x4fdf12['model'];if(_0x5d68b0['query'][_0x8df9('0x3c')]){_0x1b5cb3[_0x8df9('0x3d')]=[{'all':!![]}];}_0x1b5cb3=_['merge']({},_0x1b5cb3,_0x5d68b0['options']);return db[_0x8df9('0x3e')]['find'](_0x1b5cb3)['then'](handleEntityNotFound(_0x5b84e6,null))['then'](respondWithResult(_0x5b84e6,null))[_0x8df9('0x41')](handleError(_0x5b84e6,null));};exports[_0x8df9('0x45')]=function(_0x28313f,_0x5510f7){return db[_0x8df9('0x3e')][_0x8df9('0x45')](_0x28313f[_0x8df9('0x46')],{})[_0x8df9('0x24')](respondWithResult(_0x5510f7,0xc9))[_0x8df9('0x41')](handleError(_0x5510f7,null));};exports['update']=function(_0x4f9dac,_0xdee15b){if(_0x4f9dac[_0x8df9('0x46')]['id']){delete _0x4f9dac[_0x8df9('0x46')]['id'];}return db[_0x8df9('0x3e')]['find']({'where':{'id':_0x4f9dac[_0x8df9('0x43')]['id']}})[_0x8df9('0x24')](handleEntityNotFound(_0xdee15b,null))[_0x8df9('0x24')](saveUpdates(_0x4f9dac[_0x8df9('0x46')],null))[_0x8df9('0x24')](respondWithResult(_0xdee15b,null))[_0x8df9('0x41')](handleError(_0xdee15b,null));};exports['destroy']=function(_0x3d9e7b,_0x4a24e5){return db[_0x8df9('0x3e')]['find']({'where':{'id':_0x3d9e7b[_0x8df9('0x43')]['id']}})['then'](handleEntityNotFound(_0x4a24e5,null))[_0x8df9('0x24')](removeEntity(_0x4a24e5,null))['catch'](handleError(_0x4a24e5,null));};exports[_0x8df9('0x47')]=function(_0x343518,_0xd445c9){return db['ChatQueueReport'][_0x8df9('0x47')]()['then'](respondWithResult(_0xd445c9,null))[_0x8df9('0x41')](handleError(_0xd445c9,null));};
\ No newline at end of file
+var _0x57ca=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','ChatQueueReport','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x161a13,_0x100a56){var _0x425b96=function(_0x46d922){while(--_0x46d922){_0x161a13['push'](_0x161a13['shift']());}};_0x425b96(++_0x100a56);}(_0x57ca,0x108));var _0xa57c=function(_0x53d9af,_0x8789d6){_0x53d9af=_0x53d9af-0x0;var _0x30e406=_0x57ca[_0x53d9af];return _0x30e406;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':!![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['ChatQueueReport']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')](_0x247906['body'],{})['then'](respondWithResult(_0x44ea0a,0xc9))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x232675,_0x49492f){if(_0x232675[_0xa57c('0x42')]['id']){delete _0x232675[_0xa57c('0x42')]['id'];}return db['ChatQueueReport'][_0xa57c('0x3f')]({'where':{'id':_0x232675[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x21')](saveUpdates(_0x232675[_0xa57c('0x42')],null))['then'](respondWithResult(_0x49492f,null))[_0xa57c('0x40')](handleError(_0x49492f,null));};exports[_0xa57c('0x22')]=function(_0x4584e8,_0xd57bac){return db[_0xa57c('0x2a')]['find']({'where':{'id':_0x4584e8[_0xa57c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xd57bac,null))['then'](removeEntity(_0xd57bac,null))[_0xa57c('0x40')](handleError(_0xd57bac,null));};exports[_0xa57c('0x43')]=function(_0x5ded49,_0x5bf336){return db['ChatQueueReport'][_0xa57c('0x43')]()[_0xa57c('0x21')](respondWithResult(_0x5bf336,null))[_0xa57c('0x40')](handleError(_0x5bf336,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 6d1bfae..17d9773 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x56c8b2,_0x4741b3){var _0x23912b=function(_0x5607d5){while(--_0x5607d5){_0x56c8b2['push'](_0x56c8b2['shift']());}};_0x23912b(++_0x4741b3);}(_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
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3d1f22,_0x3c6726){var _0x3f38b3=function(_0x1176d4){while(--_0x1176d4){_0x3d1f22['push'](_0x3d1f22['shift']());}};_0x3f38b3(++_0x3c6726);}(_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 1bc07ae..600f0dc 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 _0x1136=['create','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0x1136,0x13c));var _0x6113=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1136[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x6113('0x0'));var util=require(_0x6113('0x1'));var moment=require(_0x6113('0x2'));var BPromise=require(_0x6113('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6113('0x4'))['db'];var utils=require(_0x6113('0x5'));var logger=require('../../config/logger')(_0x6113('0x6'));var config=require(_0x6113('0x7'));var jayson=require(_0x6113('0x8'));var client=jayson['client'][_0x6113('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43284d,_0x2f2286,_0x4c7a69){return new BPromise(function(_0x527ca5,_0x3c4089){return client[_0x6113('0xa')](_0x43284d,_0x4c7a69)[_0x6113('0xb')](function(_0x37d032){logger[_0x6113('0xc')](_0x6113('0xd'),_0x2f2286,_0x6113('0xe'));logger['debug'](_0x6113('0xf'),_0x2f2286,_0x6113('0xe'),JSON[_0x6113('0x10')](_0x37d032));if(_0x37d032[_0x6113('0x11')]){if(_0x37d032[_0x6113('0x11')][_0x6113('0x12')]===0x1f4){logger[_0x6113('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x2f2286,_0x37d032[_0x6113('0x11')]['message']);return _0x3c4089(_0x37d032[_0x6113('0x11')]['message']);}logger[_0x6113('0x11')](_0x6113('0xd'),_0x2f2286,_0x37d032[_0x6113('0x11')][_0x6113('0x13')]);return _0x527ca5(_0x37d032[_0x6113('0x11')][_0x6113('0x13')]);}else{logger[_0x6113('0xc')](_0x6113('0xd'),_0x2f2286,_0x6113('0xe'));_0x527ca5(_0x37d032[_0x6113('0x14')][_0x6113('0x13')]);}})[_0x6113('0x15')](function(_0x43eeba){logger[_0x6113('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x2f2286,_0x43eeba);_0x3c4089(_0x43eeba);});});}exports[_0x6113('0x16')]=function(_0x44f65b){var _0x55f70c=this;return new Promise(function(_0x1faaac,_0x43f90a){return db[_0x6113('0x17')][_0x6113('0x18')](_0x44f65b[_0x6113('0x19')],{'raw':_0x44f65b[_0x6113('0x1a')]?_0x44f65b[_0x6113('0x1a')][_0x6113('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x4b58c9){logger[_0x6113('0xc')]('CreateChatQueueReport',_0x44f65b);logger['debug']('CreateChatQueueReport',_0x44f65b,JSON[_0x6113('0x10')](_0x4b58c9));_0x1faaac(_0x4b58c9);})[_0x6113('0x15')](function(_0x5b84c2){logger[_0x6113('0x11')](_0x6113('0x16'),_0x5b84c2[_0x6113('0x13')],_0x44f65b);_0x43f90a(_0x55f70c['error'](0x1f4,_0x5b84c2[_0x6113('0x13')]));});});};exports[_0x6113('0x1c')]=function(_0x3d2bd){var _0x2d07fb=this;return new Promise(function(_0x2b000e,_0x2c1340){return db[_0x6113('0x17')][_0x6113('0x1d')](_0x3d2bd[_0x6113('0x19')],{'raw':_0x3d2bd[_0x6113('0x1a')]?_0x3d2bd[_0x6113('0x1a')][_0x6113('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d2bd['options']?_0x3d2bd['options'][_0x6113('0x1e')]||null:null,'attributes':_0x3d2bd['options']?_0x3d2bd[_0x6113('0x1a')][_0x6113('0x1f')]||null:null,'limit':_0x3d2bd['options']?_0x3d2bd[_0x6113('0x1a')][_0x6113('0x20')]||null:null})['then'](function(_0x180ac1){logger[_0x6113('0xc')]('UpdateChatQueueReport',_0x3d2bd);logger[_0x6113('0x21')](_0x6113('0x1c'),_0x3d2bd,JSON[_0x6113('0x10')](_0x180ac1));_0x2b000e(_0x180ac1);})[_0x6113('0x15')](function(_0x4f262a){logger[_0x6113('0x11')](_0x6113('0x1c'),_0x4f262a[_0x6113('0x13')],_0x3d2bd);_0x2c1340(_0x2d07fb[_0x6113('0x11')](0x1f4,_0x4f262a['message']));});});};
\ No newline at end of file
+var _0x8054=['rpc','http','request','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','CreateChatQueueReport','ChatQueueReport','create','options','raw','catch','UpdateChatQueueReport','body','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x988f0b,_0x1bcef8){var _0x678898=function(_0x49341b){while(--_0x49341b){_0x988f0b['push'](_0x988f0b['shift']());}};_0x678898(++_0x1bcef8);}(_0x8054,0x141));var _0x4805=function(_0x1c4493,_0x42c1be){_0x1c4493=_0x1c4493-0x0;var _0x2e375a=_0x8054[_0x1c4493];return _0x2e375a;};'use strict';var _=require(_0x4805('0x0'));var util=require(_0x4805('0x1'));var moment=require(_0x4805('0x2'));var BPromise=require(_0x4805('0x3'));var rs=require(_0x4805('0x4'));var fs=require('fs');var Redis=require(_0x4805('0x5'));var db=require(_0x4805('0x6'))['db'];var utils=require(_0x4805('0x7'));var logger=require(_0x4805('0x8'))(_0x4805('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4805('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x244e07,_0x5b4002,_0x4b4bba){return new BPromise(function(_0x25187b,_0x35f092){return client[_0x4805('0xb')](_0x244e07,_0x4b4bba)[_0x4805('0xc')](function(_0x4175f0){logger[_0x4805('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x5b4002,_0x4805('0xe'));logger[_0x4805('0xf')](_0x4805('0x10'),_0x5b4002,_0x4805('0xe'),JSON[_0x4805('0x11')](_0x4175f0));if(_0x4175f0['error']){if(_0x4175f0[_0x4805('0x12')][_0x4805('0x13')]===0x1f4){logger[_0x4805('0x12')](_0x4805('0x14'),_0x5b4002,_0x4175f0[_0x4805('0x12')][_0x4805('0x15')]);return _0x35f092(_0x4175f0[_0x4805('0x12')]['message']);}logger[_0x4805('0x12')](_0x4805('0x14'),_0x5b4002,_0x4175f0['error'][_0x4805('0x15')]);return _0x25187b(_0x4175f0['error']['message']);}else{logger[_0x4805('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x5b4002,'request\x20sent');_0x25187b(_0x4175f0[_0x4805('0x16')][_0x4805('0x15')]);}})['catch'](function(_0x284f4b){logger[_0x4805('0x12')](_0x4805('0x14'),_0x5b4002,_0x284f4b);_0x35f092(_0x284f4b);});});}exports[_0x4805('0x17')]=function(_0x1a95a6){var _0x41d5f8=this;return new Promise(function(_0x4cde3f,_0x17184c){return db[_0x4805('0x18')][_0x4805('0x19')](_0x1a95a6['body'],{'raw':_0x1a95a6[_0x4805('0x1a')]?_0x1a95a6[_0x4805('0x1a')][_0x4805('0x1b')]===undefined?!![]:![]:!![]})[_0x4805('0xc')](function(_0x33709b){logger[_0x4805('0xd')](_0x4805('0x17'),_0x1a95a6);logger['debug']('CreateChatQueueReport',_0x1a95a6,JSON[_0x4805('0x11')](_0x33709b));_0x4cde3f(_0x33709b);})[_0x4805('0x1c')](function(_0x525af2){logger[_0x4805('0x12')]('CreateChatQueueReport',_0x525af2['message'],_0x1a95a6);_0x17184c(_0x41d5f8[_0x4805('0x12')](0x1f4,_0x525af2[_0x4805('0x15')]));});});};exports[_0x4805('0x1d')]=function(_0x5e582e){var _0x52de54=this;return new Promise(function(_0x11dce8,_0x25585e){return db[_0x4805('0x18')]['update'](_0x5e582e[_0x4805('0x1e')],{'raw':_0x5e582e[_0x4805('0x1a')]?_0x5e582e[_0x4805('0x1a')][_0x4805('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e582e[_0x4805('0x1a')]?_0x5e582e[_0x4805('0x1a')][_0x4805('0x1f')]||null:null,'attributes':_0x5e582e[_0x4805('0x1a')]?_0x5e582e['options'][_0x4805('0x20')]||null:null,'limit':_0x5e582e[_0x4805('0x1a')]?_0x5e582e['options']['limit']||null:null})['then'](function(_0x228a65){logger[_0x4805('0xd')](_0x4805('0x1d'),_0x5e582e);logger[_0x4805('0xf')](_0x4805('0x1d'),_0x5e582e,JSON[_0x4805('0x11')](_0x228a65));_0x11dce8(_0x228a65);})[_0x4805('0x1c')](function(_0x19f3ba){logger[_0x4805('0x12')]('UpdateChatQueueReport',_0x19f3ba[_0x4805('0x15')],_0x5e582e);_0x25585e(_0x52de54[_0x4805('0x12')](0x1f4,_0x19f3ba[_0x4805('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 0a84d8c..7d86e8d 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 _0x2e1a=['path','connect-timeout','express','Router','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','destroy','multer','util'];(function(_0x216428,_0x5d20ea){var _0x313dd4=function(_0x447e0d){while(--_0x447e0d){_0x216428['push'](_0x216428['shift']());}};_0x313dd4(++_0x5d20ea);}(_0x2e1a,0x8e));var _0xa2e1=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0x2e1a[_0x56ba92];return _0x8fe94d;};'use strict';var multer=require(_0xa2e1('0x0'));var util=require(_0xa2e1('0x1'));var path=require(_0xa2e1('0x2'));var timeout=require(_0xa2e1('0x3'));var express=require(_0xa2e1('0x4'));var router=express[_0xa2e1('0x5')]();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(_0xa2e1('0x6'));router['get']('/',auth[_0xa2e1('0x7')](),controller[_0xa2e1('0x8')]);router[_0xa2e1('0x9')](_0xa2e1('0xa'),auth[_0xa2e1('0x7')](),controller[_0xa2e1('0xb')]);router[_0xa2e1('0x9')](_0xa2e1('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa2e1('0xd')]('/',auth[_0xa2e1('0x7')](),controller[_0xa2e1('0xe')]);router[_0xa2e1('0xf')]('/:id',auth[_0xa2e1('0x7')](),controller[_0xa2e1('0x10')]);router['delete'](_0xa2e1('0xc'),auth[_0xa2e1('0x7')](),controller[_0xa2e1('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xeeaf=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4b9a50,_0x1d1312){var _0x368c57=function(_0x1e5ff5){while(--_0x1e5ff5){_0x4b9a50['push'](_0x4b9a50['shift']());}};_0x368c57(++_0x1d1312);}(_0xeeaf,0x78));var _0xfeea=function(_0x31183e,_0x4764cc){_0x31183e=_0x31183e-0x0;var _0xa6cf81=_0xeeaf[_0x31183e];return _0xa6cf81;};'use strict';var multer=require(_0xfeea('0x0'));var util=require(_0xfeea('0x1'));var path=require('path');var timeout=require(_0xfeea('0x2'));var express=require(_0xfeea('0x3'));var router=express[_0xfeea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfeea('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfeea('0x6'));var controller=require('./chatQueueReport.controller');router[_0xfeea('0x7')]('/',auth[_0xfeea('0x8')](),controller[_0xfeea('0x9')]);router[_0xfeea('0x7')](_0xfeea('0xa'),auth[_0xfeea('0x8')](),controller['describe']);router['get'](_0xfeea('0xb'),auth[_0xfeea('0x8')](),controller[_0xfeea('0xc')]);router[_0xfeea('0xd')]('/',auth[_0xfeea('0x8')](),controller[_0xfeea('0xe')]);router[_0xfeea('0xf')](_0xfeea('0xb'),auth['isAuthenticated'](),controller[_0xfeea('0x10')]);router[_0xfeea('0x11')]('/:id',auth[_0xfeea('0x8')](),controller[_0xfeea('0x12')]);module[_0xfeea('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 56e8832..899be3a 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4407d9,_0x33ce90){var _0x355ad4=function(_0x33421c){while(--_0x33421c){_0x4407d9['push'](_0x4407d9['shift']());}};_0x355ad4(++_0x33ce90);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0xcb91[_0x58c20f];return _0x3b0318;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1afe91,_0x29e173){var _0x45a1cb=function(_0x2d8c78){while(--_0x2d8c78){_0x1afe91['push'](_0x1afe91['shift']());}};_0x45a1cb(++_0x29e173);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x22663b,_0xc8c6e3){_0x22663b=_0x22663b-0x0;var _0x310d0a=_0xcb91[_0x22663b];return _0x310d0a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 08eb19b..6a8d9bf 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 _0x4df2=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','rows','catch','params','create','body','find','describe','eml-format'];(function(_0x5685ff,_0x3acac3){var _0x246d98=function(_0x5f3acc){while(--_0x5f3acc){_0x5685ff['push'](_0x5685ff['shift']());}};_0x246d98(++_0x3acac3);}(_0x4df2,0x176));var _0x24df=function(_0x5991a8,_0x1aee07){_0x5991a8=_0x5991a8-0x0;var _0x532c72=_0x4df2[_0x5991a8];return _0x532c72;};'use strict';var emlformat=require(_0x24df('0x0'));var rimraf=require(_0x24df('0x1'));var zipdir=require(_0x24df('0x2'));var jsonpatch=require(_0x24df('0x3'));var rp=require(_0x24df('0x4'));var moment=require(_0x24df('0x5'));var BPromise=require(_0x24df('0x6'));var Mustache=require(_0x24df('0x7'));var util=require('util');var path=require(_0x24df('0x8'));var sox=require(_0x24df('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x24df('0xa'));var _=require(_0x24df('0xb'));var squel=require(_0x24df('0xc'));var crypto=require(_0x24df('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x24df('0xe'));var toCsv=require(_0x24df('0xf'));var querystring=require(_0x24df('0x10'));var Papa=require(_0x24df('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x24df('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24df('0x13'))(_0x24df('0x14'));var utils=require(_0x24df('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x24df('0x16'))['db'];function respondWithStatusCode(_0x4480fd,_0x420ce8){_0x420ce8=_0x420ce8||0xcc;return function(_0x4b99a2){if(_0x4b99a2){return _0x4480fd[_0x24df('0x17')](_0x420ce8);}return _0x4480fd[_0x24df('0x18')](_0x420ce8)[_0x24df('0x19')]();};}function respondWithResult(_0x1b5faa,_0x429a26){_0x429a26=_0x429a26||0xc8;return function(_0x1fce5c){if(_0x1fce5c){return _0x1b5faa[_0x24df('0x18')](_0x429a26)[_0x24df('0x1a')](_0x1fce5c);}};}function respondWithFilteredResult(_0x5f3fea,_0x358e0e){return function(_0x52050b){if(_0x52050b){var _0x291b0d=typeof _0x358e0e[_0x24df('0x1b')]===_0x24df('0x1c')&&typeof _0x358e0e[_0x24df('0x1d')]===_0x24df('0x1c');var _0xbab2e=_0x52050b[_0x24df('0x1e')];var _0x555bbd=_0x291b0d?0x0:_0x358e0e[_0x24df('0x1b')];var _0x4f290b=_0x291b0d?_0x52050b[_0x24df('0x1e')]:_0x358e0e[_0x24df('0x1b')]+_0x358e0e[_0x24df('0x1d')];var _0x3c2848;if(_0x4f290b>=_0xbab2e){_0x4f290b=_0xbab2e;_0x3c2848=0xc8;}else{_0x3c2848=0xce;}_0x5f3fea[_0x24df('0x18')](_0x3c2848);return _0x5f3fea[_0x24df('0x1f')](_0x24df('0x20'),_0x555bbd+'-'+_0x4f290b+'/'+_0xbab2e)['json'](_0x52050b);}return null;};}function patchUpdates(_0x50cb1c){return function(_0x1061f0){try{jsonpatch[_0x24df('0x21')](_0x1061f0,_0x50cb1c,!![]);}catch(_0x1cb57f){return BPromise[_0x24df('0x22')](_0x1cb57f);}return _0x1061f0[_0x24df('0x23')]();};}function saveUpdates(_0x53f91f,_0x4be7ab){return function(_0x2112a9){if(_0x2112a9){return _0x2112a9[_0x24df('0x24')](_0x53f91f)[_0x24df('0x25')](function(_0xd12116){return _0xd12116;});}return null;};}function removeEntity(_0x30a4d0,_0xfa4371){return function(_0x42a8fe){if(_0x42a8fe){return _0x42a8fe[_0x24df('0x26')]()['then'](function(){_0x30a4d0[_0x24df('0x18')](0xcc)[_0x24df('0x19')]();});}};}function handleEntityNotFound(_0x3a29ea,_0xd7c140){return function(_0x82879e){if(!_0x82879e){_0x3a29ea[_0x24df('0x17')](0x194);}return _0x82879e;};}function handleError(_0x3d7bf9,_0x2f5447){_0x2f5447=_0x2f5447||0x1f4;return function(_0x43c6fc){logger[_0x24df('0x27')](_0x43c6fc[_0x24df('0x28')]);if(_0x43c6fc[_0x24df('0x29')]){delete _0x43c6fc['name'];}_0x3d7bf9['status'](_0x2f5447)[_0x24df('0x2a')](_0x43c6fc);};}exports[_0x24df('0x2b')]=function(_0x544b4d,_0x1cfe07){var _0x50648c={},_0x26da54={},_0x465b8d={'count':0x0,'rows':[]};var _0x5e003f=_['map'](db['ChatTransferReport'][_0x24df('0x2c')],function(_0x3c456a){return{'name':_0x3c456a[_0x24df('0x2d')],'type':_0x3c456a[_0x24df('0x2e')]['key']};});_0x26da54[_0x24df('0x2f')]=_[_0x24df('0x30')](_0x5e003f,_0x24df('0x29'));_0x26da54[_0x24df('0x31')]=_[_0x24df('0x32')](_0x544b4d[_0x24df('0x31')]);_0x26da54[_0x24df('0x33')]=_[_0x24df('0x34')](_0x26da54['model'],_0x26da54[_0x24df('0x31')]);_0x50648c[_0x24df('0x35')]=_[_0x24df('0x34')](_0x26da54['model'],qs[_0x24df('0x36')](_0x544b4d[_0x24df('0x31')][_0x24df('0x36')]));_0x50648c[_0x24df('0x35')]=_0x50648c[_0x24df('0x35')][_0x24df('0x37')]?_0x50648c[_0x24df('0x35')]:_0x26da54[_0x24df('0x2f')];if(!_0x544b4d[_0x24df('0x31')][_0x24df('0x38')](_0x24df('0x39'))){_0x50648c[_0x24df('0x1d')]=qs['limit'](_0x544b4d[_0x24df('0x31')][_0x24df('0x1d')]);_0x50648c[_0x24df('0x1b')]=qs[_0x24df('0x1b')](_0x544b4d[_0x24df('0x31')][_0x24df('0x1b')]);}_0x50648c[_0x24df('0x3a')]=qs['sort'](_0x544b4d[_0x24df('0x31')][_0x24df('0x3b')]);_0x50648c[_0x24df('0x3c')]=qs[_0x24df('0x33')](_['pick'](_0x544b4d[_0x24df('0x31')],_0x26da54['filters']),_0x5e003f);if(_0x544b4d[_0x24df('0x31')][_0x24df('0x3d')]){_0x50648c[_0x24df('0x3c')]=_[_0x24df('0x3e')](_0x50648c['where'],{'$or':_[_0x24df('0x30')](_0x5e003f,function(_0x5b4e47){if(_0x5b4e47[_0x24df('0x2e')]!==_0x24df('0x3f')){var _0x21882d={};_0x21882d[_0x5b4e47[_0x24df('0x29')]]={'$like':'%'+_0x544b4d[_0x24df('0x31')][_0x24df('0x3d')]+'%'};return _0x21882d;}})});}_0x50648c=_[_0x24df('0x3e')]({},_0x50648c,_0x544b4d[_0x24df('0x40')]);var _0x1b5928={'where':_0x50648c['where']};return db[_0x24df('0x41')]['count'](_0x1b5928)[_0x24df('0x25')](function(_0x3dc9f1){_0x465b8d[_0x24df('0x1e')]=_0x3dc9f1;if(_0x544b4d[_0x24df('0x31')][_0x24df('0x42')]){_0x50648c[_0x24df('0x43')]=[{'all':!![]}];}return db[_0x24df('0x41')]['findAll'](_0x50648c);})['then'](function(_0x5ea63b){_0x465b8d[_0x24df('0x44')]=_0x5ea63b;return _0x465b8d;})[_0x24df('0x25')](respondWithFilteredResult(_0x1cfe07,_0x50648c))[_0x24df('0x45')](handleError(_0x1cfe07,null));};exports['show']=function(_0xf6c4a4,_0x5877de){var _0x3afe00={'raw':!![],'where':{'id':_0xf6c4a4[_0x24df('0x46')]['id']}},_0x455d2d={};_0x455d2d[_0x24df('0x2f')]=_[_0x24df('0x32')](db[_0x24df('0x41')][_0x24df('0x2c')]);_0x455d2d[_0x24df('0x31')]=_[_0x24df('0x32')](_0xf6c4a4[_0x24df('0x31')]);_0x455d2d[_0x24df('0x33')]=_['intersection'](_0x455d2d[_0x24df('0x2f')],_0x455d2d['query']);_0x3afe00[_0x24df('0x35')]=_[_0x24df('0x34')](_0x455d2d[_0x24df('0x2f')],qs[_0x24df('0x36')](_0xf6c4a4[_0x24df('0x31')][_0x24df('0x36')]));_0x3afe00[_0x24df('0x35')]=_0x3afe00[_0x24df('0x35')][_0x24df('0x37')]?_0x3afe00[_0x24df('0x35')]:_0x455d2d['model'];if(_0xf6c4a4[_0x24df('0x31')][_0x24df('0x42')]){_0x3afe00[_0x24df('0x43')]=[{'all':!![]}];}_0x3afe00=_[_0x24df('0x3e')]({},_0x3afe00,_0xf6c4a4[_0x24df('0x40')]);return db['ChatTransferReport']['find'](_0x3afe00)['then'](handleEntityNotFound(_0x5877de,null))[_0x24df('0x25')](respondWithResult(_0x5877de,null))['catch'](handleError(_0x5877de,null));};exports[_0x24df('0x47')]=function(_0x1ccb04,_0x25fa42){return db[_0x24df('0x41')][_0x24df('0x47')](_0x1ccb04[_0x24df('0x48')],{})[_0x24df('0x25')](respondWithResult(_0x25fa42,0xc9))['catch'](handleError(_0x25fa42,null));};exports[_0x24df('0x24')]=function(_0x35b117,_0x32e371){if(_0x35b117[_0x24df('0x48')]['id']){delete _0x35b117[_0x24df('0x48')]['id'];}return db[_0x24df('0x41')][_0x24df('0x49')]({'where':{'id':_0x35b117[_0x24df('0x46')]['id']}})[_0x24df('0x25')](handleEntityNotFound(_0x32e371,null))[_0x24df('0x25')](saveUpdates(_0x35b117[_0x24df('0x48')],null))[_0x24df('0x25')](respondWithResult(_0x32e371,null))[_0x24df('0x45')](handleError(_0x32e371,null));};exports[_0x24df('0x26')]=function(_0x341fec,_0x426a52){return db[_0x24df('0x41')]['find']({'where':{'id':_0x341fec[_0x24df('0x46')]['id']}})['then'](handleEntityNotFound(_0x426a52,null))['then'](removeEntity(_0x426a52,null))[_0x24df('0x45')](handleError(_0x426a52,null));};exports['describe']=function(_0x3df55c,_0x1c8a6e){return db[_0x24df('0x41')][_0x24df('0x4a')]()[_0x24df('0x25')](respondWithResult(_0x1c8a6e,null))['catch'](handleError(_0x1c8a6e,null));};
\ No newline at end of file
+var _0x98cf=['keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','include','findAll','show','params','merge','options','catch','create','body','find','describe','zip-dir','fast-json-patch','bluebird','mustache','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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','destroy','then','status','error','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x17f7e1,_0x561bf4){var _0x556d66=function(_0xd871eb){while(--_0xd871eb){_0x17f7e1['push'](_0x17f7e1['shift']());}};_0x556d66(++_0x561bf4);}(_0x98cf,0xb1));var _0xf98c=function(_0x537998,_0x4a1e32){_0x537998=_0x537998-0x0;var _0x2ba597=_0x98cf[_0x537998];return _0x2ba597;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf98c('0x0'));var jsonpatch=require(_0xf98c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf98c('0x2'));var Mustache=require(_0xf98c('0x3'));var util=require(_0xf98c('0x4'));var path=require(_0xf98c('0x5'));var sox=require(_0xf98c('0x6'));var csv=require(_0xf98c('0x7'));var ejs=require(_0xf98c('0x8'));var fs=require('fs');var fs_extra=require(_0xf98c('0x9'));var _=require(_0xf98c('0xa'));var squel=require(_0xf98c('0xb'));var crypto=require(_0xf98c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf98c('0xd'));var toCsv=require(_0xf98c('0x7'));var querystring=require(_0xf98c('0xe'));var Papa=require(_0xf98c('0xf'));var Redis=require(_0xf98c('0x10'));var authService=require(_0xf98c('0x11'));var qs=require(_0xf98c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf98c('0x13'));var logger=require(_0xf98c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xf98c('0x15'));var licenseUtil=require(_0xf98c('0x16'));var db=require(_0xf98c('0x17'))['db'];function respondWithStatusCode(_0x2ca676,_0x58d252){_0x58d252=_0x58d252||0xcc;return function(_0x1fce13){if(_0x1fce13){return _0x2ca676[_0xf98c('0x18')](_0x58d252);}return _0x2ca676['status'](_0x58d252)[_0xf98c('0x19')]();};}function respondWithResult(_0x38423e,_0x2c7f53){_0x2c7f53=_0x2c7f53||0xc8;return function(_0x479e3c){if(_0x479e3c){return _0x38423e['status'](_0x2c7f53)[_0xf98c('0x1a')](_0x479e3c);}};}function respondWithFilteredResult(_0x4f4799,_0x3bfd95){return function(_0x1e3257){if(_0x1e3257){var _0x267f1a=typeof _0x3bfd95['offset']===_0xf98c('0x1b')&&typeof _0x3bfd95['limit']===_0xf98c('0x1b');var _0x2f513b=_0x1e3257[_0xf98c('0x1c')];var _0x2b06d0=_0x267f1a?0x0:_0x3bfd95[_0xf98c('0x1d')];var _0x18a98f=_0x267f1a?_0x1e3257[_0xf98c('0x1c')]:_0x3bfd95[_0xf98c('0x1d')]+_0x3bfd95[_0xf98c('0x1e')];var _0x2dade0;if(_0x18a98f>=_0x2f513b){_0x18a98f=_0x2f513b;_0x2dade0=0xc8;}else{_0x2dade0=0xce;}_0x4f4799['status'](_0x2dade0);return _0x4f4799['set'](_0xf98c('0x1f'),_0x2b06d0+'-'+_0x18a98f+'/'+_0x2f513b)['json'](_0x1e3257);}return null;};}function patchUpdates(_0x456dd3){return function(_0x585e87){try{jsonpatch[_0xf98c('0x20')](_0x585e87,_0x456dd3,!![]);}catch(_0x295c37){return BPromise[_0xf98c('0x21')](_0x295c37);}return _0x585e87['save']();};}function saveUpdates(_0x24eeb2,_0x19ad08){return function(_0x22c2f8){if(_0x22c2f8){return _0x22c2f8[_0xf98c('0x22')](_0x24eeb2)['then'](function(_0x2ca452){return _0x2ca452;});}return null;};}function removeEntity(_0x1ef07d,_0x1d1ff3){return function(_0x24220c){if(_0x24220c){return _0x24220c[_0xf98c('0x23')]()[_0xf98c('0x24')](function(){_0x1ef07d[_0xf98c('0x25')](0xcc)[_0xf98c('0x19')]();});}};}function handleEntityNotFound(_0x65f75d,_0x56f507){return function(_0x36ee47){if(!_0x36ee47){_0x65f75d['sendStatus'](0x194);}return _0x36ee47;};}function handleError(_0x16ee3a,_0x13d0da){_0x13d0da=_0x13d0da||0x1f4;return function(_0xbe43b5){logger[_0xf98c('0x26')](_0xbe43b5[_0xf98c('0x27')]);if(_0xbe43b5[_0xf98c('0x28')]){delete _0xbe43b5[_0xf98c('0x28')];}_0x16ee3a[_0xf98c('0x25')](_0x13d0da)[_0xf98c('0x29')](_0xbe43b5);};}exports[_0xf98c('0x2a')]=function(_0x44a1b5,_0x2eea5a){var _0x33ee6d={},_0x51ab32={},_0x214543={'count':0x0,'rows':[]};var _0x2195d1=_['map'](db[_0xf98c('0x2b')][_0xf98c('0x2c')],function(_0x384b10){return{'name':_0x384b10[_0xf98c('0x2d')],'type':_0x384b10[_0xf98c('0x2e')][_0xf98c('0x2f')]};});_0x51ab32[_0xf98c('0x30')]=_[_0xf98c('0x31')](_0x2195d1,'name');_0x51ab32[_0xf98c('0x32')]=_[_0xf98c('0x33')](_0x44a1b5[_0xf98c('0x32')]);_0x51ab32['filters']=_[_0xf98c('0x34')](_0x51ab32[_0xf98c('0x30')],_0x51ab32['query']);_0x33ee6d[_0xf98c('0x35')]=_[_0xf98c('0x34')](_0x51ab32[_0xf98c('0x30')],qs['fields'](_0x44a1b5[_0xf98c('0x32')][_0xf98c('0x36')]));_0x33ee6d[_0xf98c('0x35')]=_0x33ee6d['attributes'][_0xf98c('0x37')]?_0x33ee6d[_0xf98c('0x35')]:_0x51ab32['model'];if(!_0x44a1b5[_0xf98c('0x32')][_0xf98c('0x38')]('nolimit')){_0x33ee6d[_0xf98c('0x1e')]=qs[_0xf98c('0x1e')](_0x44a1b5[_0xf98c('0x32')][_0xf98c('0x1e')]);_0x33ee6d['offset']=qs[_0xf98c('0x1d')](_0x44a1b5[_0xf98c('0x32')][_0xf98c('0x1d')]);}_0x33ee6d[_0xf98c('0x39')]=qs[_0xf98c('0x3a')](_0x44a1b5[_0xf98c('0x32')]['sort']);_0x33ee6d[_0xf98c('0x3b')]=qs['filters'](_[_0xf98c('0x3c')](_0x44a1b5[_0xf98c('0x32')],_0x51ab32[_0xf98c('0x3d')]),_0x2195d1);if(_0x44a1b5[_0xf98c('0x32')][_0xf98c('0x3e')]){_0x33ee6d[_0xf98c('0x3b')]=_['merge'](_0x33ee6d[_0xf98c('0x3b')],{'$or':_['map'](_0x2195d1,function(_0x293512){if(_0x293512[_0xf98c('0x2e')]!==_0xf98c('0x3f')){var _0x415b5a={};_0x415b5a[_0x293512[_0xf98c('0x28')]]={'$like':'%'+_0x44a1b5[_0xf98c('0x32')]['filter']+'%'};return _0x415b5a;}})});}_0x33ee6d=_['merge']({},_0x33ee6d,_0x44a1b5['options']);var _0x4ac83c={'where':_0x33ee6d[_0xf98c('0x3b')]};return db[_0xf98c('0x2b')][_0xf98c('0x1c')](_0x4ac83c)[_0xf98c('0x24')](function(_0x177487){_0x214543[_0xf98c('0x1c')]=_0x177487;if(_0x44a1b5['query'][_0xf98c('0x40')]){_0x33ee6d[_0xf98c('0x41')]=[{'all':!![]}];}return db[_0xf98c('0x2b')][_0xf98c('0x42')](_0x33ee6d);})[_0xf98c('0x24')](function(_0x38dda8){_0x214543['rows']=_0x38dda8;return _0x214543;})['then'](respondWithFilteredResult(_0x2eea5a,_0x33ee6d))['catch'](handleError(_0x2eea5a,null));};exports[_0xf98c('0x43')]=function(_0x3a4e5e,_0x4239fc){var _0x57d379={'raw':!![],'where':{'id':_0x3a4e5e[_0xf98c('0x44')]['id']}},_0x1fbe20={};_0x1fbe20[_0xf98c('0x30')]=_[_0xf98c('0x33')](db[_0xf98c('0x2b')][_0xf98c('0x2c')]);_0x1fbe20[_0xf98c('0x32')]=_[_0xf98c('0x33')](_0x3a4e5e['query']);_0x1fbe20[_0xf98c('0x3d')]=_[_0xf98c('0x34')](_0x1fbe20[_0xf98c('0x30')],_0x1fbe20[_0xf98c('0x32')]);_0x57d379['attributes']=_[_0xf98c('0x34')](_0x1fbe20[_0xf98c('0x30')],qs[_0xf98c('0x36')](_0x3a4e5e[_0xf98c('0x32')][_0xf98c('0x36')]));_0x57d379[_0xf98c('0x35')]=_0x57d379[_0xf98c('0x35')][_0xf98c('0x37')]?_0x57d379[_0xf98c('0x35')]:_0x1fbe20[_0xf98c('0x30')];if(_0x3a4e5e['query'][_0xf98c('0x40')]){_0x57d379['include']=[{'all':!![]}];}_0x57d379=_[_0xf98c('0x45')]({},_0x57d379,_0x3a4e5e[_0xf98c('0x46')]);return db[_0xf98c('0x2b')]['find'](_0x57d379)[_0xf98c('0x24')](handleEntityNotFound(_0x4239fc,null))[_0xf98c('0x24')](respondWithResult(_0x4239fc,null))[_0xf98c('0x47')](handleError(_0x4239fc,null));};exports[_0xf98c('0x48')]=function(_0x580ee8,_0x3fe50d){return db['ChatTransferReport'][_0xf98c('0x48')](_0x580ee8[_0xf98c('0x49')],{})['then'](respondWithResult(_0x3fe50d,0xc9))[_0xf98c('0x47')](handleError(_0x3fe50d,null));};exports[_0xf98c('0x22')]=function(_0x1e9fda,_0x230a37){if(_0x1e9fda[_0xf98c('0x49')]['id']){delete _0x1e9fda['body']['id'];}return db['ChatTransferReport'][_0xf98c('0x4a')]({'where':{'id':_0x1e9fda[_0xf98c('0x44')]['id']}})[_0xf98c('0x24')](handleEntityNotFound(_0x230a37,null))['then'](saveUpdates(_0x1e9fda['body'],null))['then'](respondWithResult(_0x230a37,null))[_0xf98c('0x47')](handleError(_0x230a37,null));};exports['destroy']=function(_0x3df7b5,_0x716fe8){return db[_0xf98c('0x2b')][_0xf98c('0x4a')]({'where':{'id':_0x3df7b5[_0xf98c('0x44')]['id']}})[_0xf98c('0x24')](handleEntityNotFound(_0x716fe8,null))['then'](removeEntity(_0x716fe8,null))[_0xf98c('0x47')](handleError(_0x716fe8,null));};exports[_0xf98c('0x4b')]=function(_0x243aac,_0x4aec57){return db[_0xf98c('0x2b')]['describe']()[_0xf98c('0x24')](respondWithResult(_0x4aec57,null))[_0xf98c('0x47')](handleError(_0x4aec57,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 71b0f8a..904a4e0 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 _0x7291=['api','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x37cbb0,_0x307a2b){var _0x2b1ce3=function(_0x29dff7){while(--_0x29dff7){_0x37cbb0['push'](_0x37cbb0['shift']());}};_0x2b1ce3(++_0x307a2b);}(_0x7291,0x6d));var _0x1729=function(_0xd17ce0,_0x246123){_0xd17ce0=_0xd17ce0-0x0;var _0x4a9f3d=_0x7291[_0xd17ce0];return _0x4a9f3d;};'use strict';var _=require(_0x1729('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1729('0x1'));var moment=require('moment');var BPromise=require(_0x1729('0x2'));var rp=require(_0x1729('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1729('0x4'));var config=require(_0x1729('0x5'));var attributes=require(_0x1729('0x6'));module[_0x1729('0x7')]=function(_0x24f896,_0x5bd302){return _0x24f896['define'](_0x1729('0x8'),attributes,{'tableName':_0x1729('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1729('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0812=['ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define'];(function(_0x52bb01,_0x1f0a38){var _0x112a08=function(_0x41e827){while(--_0x41e827){_0x52bb01['push'](_0x52bb01['shift']());}};_0x112a08(++_0x1f0a38);}(_0x0812,0x6e));var _0x2081=function(_0x2e4b9b,_0x3ea071){_0x2e4b9b=_0x2e4b9b-0x0;var _0x5812e4=_0x0812[_0x2e4b9b];return _0x5812e4;};'use strict';var _=require(_0x2081('0x0'));var util=require(_0x2081('0x1'));var logger=require(_0x2081('0x2'))(_0x2081('0x3'));var moment=require(_0x2081('0x4'));var BPromise=require(_0x2081('0x5'));var rp=require(_0x2081('0x6'));var fs=require('fs');var path=require(_0x2081('0x7'));var rimraf=require(_0x2081('0x8'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x418df3,_0x268f10){return _0x418df3[_0x2081('0x9')](_0x2081('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2081('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 2e80ee8..1df1d3e 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 _0xb08f=['request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','http','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x5e1664,_0x12dab0){var _0x29c99d=function(_0xa4eb65){while(--_0xa4eb65){_0x5e1664['push'](_0x5e1664['shift']());}};_0x29c99d(++_0x12dab0);}(_0xb08f,0x139));var _0xfb08=function(_0x2d84e2,_0x132f45){_0x2d84e2=_0x2d84e2-0x0;var _0x1a0181=_0xb08f[_0x2d84e2];return _0x1a0181;};'use strict';var _=require(_0xfb08('0x0'));var util=require(_0xfb08('0x1'));var moment=require(_0xfb08('0x2'));var BPromise=require(_0xfb08('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb08('0x4'));var db=require(_0xfb08('0x5'))['db'];var utils=require(_0xfb08('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xfb08('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14966a,_0x22c767,_0x6922bf){return new BPromise(function(_0x16585e,_0x38bf0f){return client['request'](_0x14966a,_0x6922bf)[_0xfb08('0x8')](function(_0x179bb2){logger[_0xfb08('0x9')](_0xfb08('0xa'),_0x22c767,_0xfb08('0xb'));logger['debug'](_0xfb08('0xc'),_0x22c767,_0xfb08('0xb'),JSON[_0xfb08('0xd')](_0x179bb2));if(_0x179bb2['error']){if(_0x179bb2[_0xfb08('0xe')][_0xfb08('0xf')]===0x1f4){logger[_0xfb08('0xe')](_0xfb08('0xa'),_0x22c767,_0x179bb2[_0xfb08('0xe')][_0xfb08('0x10')]);return _0x38bf0f(_0x179bb2[_0xfb08('0xe')][_0xfb08('0x10')]);}logger[_0xfb08('0xe')](_0xfb08('0xa'),_0x22c767,_0x179bb2[_0xfb08('0xe')]['message']);return _0x16585e(_0x179bb2[_0xfb08('0xe')][_0xfb08('0x10')]);}else{logger[_0xfb08('0x9')](_0xfb08('0xa'),_0x22c767,_0xfb08('0xb'));_0x16585e(_0x179bb2['result'][_0xfb08('0x10')]);}})[_0xfb08('0x11')](function(_0x3d0215){logger[_0xfb08('0xe')](_0xfb08('0xa'),_0x22c767,_0x3d0215);_0x38bf0f(_0x3d0215);});});}
\ No newline at end of file
+var _0x7927=['stringify','error','ChatTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x5f49c0,_0x27a1b4){var _0x5ab653=function(_0x4de962){while(--_0x4de962){_0x5f49c0['push'](_0x5f49c0['shift']());}};_0x5ab653(++_0x27a1b4);}(_0x7927,0x1d4));var _0x7792=function(_0x23ad16,_0x40c45a){_0x23ad16=_0x23ad16-0x0;var _0x435bc2=_0x7927[_0x23ad16];return _0x435bc2;};'use strict';var _=require(_0x7792('0x0'));var util=require(_0x7792('0x1'));var moment=require(_0x7792('0x2'));var BPromise=require(_0x7792('0x3'));var rs=require(_0x7792('0x4'));var fs=require('fs');var Redis=require(_0x7792('0x5'));var db=require(_0x7792('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7792('0x7'))(_0x7792('0x8'));var config=require(_0x7792('0x9'));var jayson=require(_0x7792('0xa'));var client=jayson['client'][_0x7792('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a3c34,_0x570ca1,_0x4bf76d){return new BPromise(function(_0x5310af,_0x1194d3){return client[_0x7792('0xc')](_0x5a3c34,_0x4bf76d)['then'](function(_0x2bb122){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x570ca1,_0x7792('0xd'));logger['debug'](_0x7792('0xe'),_0x570ca1,_0x7792('0xd'),JSON[_0x7792('0xf')](_0x2bb122));if(_0x2bb122['error']){if(_0x2bb122[_0x7792('0x10')]['code']===0x1f4){logger[_0x7792('0x10')](_0x7792('0x11'),_0x570ca1,_0x2bb122[_0x7792('0x10')]['message']);return _0x1194d3(_0x2bb122['error']['message']);}logger[_0x7792('0x10')](_0x7792('0x11'),_0x570ca1,_0x2bb122[_0x7792('0x10')][_0x7792('0x12')]);return _0x5310af(_0x2bb122[_0x7792('0x10')][_0x7792('0x12')]);}else{logger[_0x7792('0x13')](_0x7792('0x11'),_0x570ca1,_0x7792('0xd'));_0x5310af(_0x2bb122[_0x7792('0x14')][_0x7792('0x12')]);}})['catch'](function(_0x4a5921){logger[_0x7792('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x570ca1,_0x4a5921);_0x1194d3(_0x4a5921);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 3bdbd40..24cb616 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 _0xe4f6=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xe4f6,0xfd));var _0x6e4f=function(_0x5bf28a,_0x24385a){_0x5bf28a=_0x5bf28a-0x0;var _0x5b5bdf=_0xe4f6[_0x5bf28a];return _0x5b5bdf;};'use strict';var multer=require(_0x6e4f('0x0'));var util=require(_0x6e4f('0x1'));var path=require(_0x6e4f('0x2'));var timeout=require(_0x6e4f('0x3'));var express=require(_0x6e4f('0x4'));var router=express['Router']();var fs_extra=require(_0x6e4f('0x5'));var auth=require(_0x6e4f('0x6'));var interaction=require(_0x6e4f('0x7'));var config=require(_0x6e4f('0x8'));var controller=require('./chatTransferReport.controller');router[_0x6e4f('0x9')]('/',auth[_0x6e4f('0xa')](),controller[_0x6e4f('0xb')]);router[_0x6e4f('0x9')](_0x6e4f('0xc'),auth['isAuthenticated'](),controller[_0x6e4f('0xd')]);router[_0x6e4f('0x9')](_0x6e4f('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x6e4f('0xf')]('/',auth[_0x6e4f('0xa')](),controller[_0x6e4f('0x10')]);router[_0x6e4f('0x11')]('/:id',auth[_0x6e4f('0xa')](),controller['update']);router[_0x6e4f('0x12')](_0x6e4f('0xe'),auth[_0x6e4f('0xa')](),controller['destroy']);module[_0x6e4f('0x13')]=router;
\ No newline at end of file
+var _0x7bc1=['post','create','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xf56f08,_0x48a748){var _0x5c1b2c=function(_0x49780e){while(--_0x49780e){_0xf56f08['push'](_0xf56f08['shift']());}};_0x5c1b2c(++_0x48a748);}(_0x7bc1,0xaf));var _0x17bc=function(_0x466538,_0x24ca73){_0x466538=_0x466538-0x0;var _0x3e7489=_0x7bc1[_0x466538];return _0x3e7489;};'use strict';var multer=require(_0x17bc('0x0'));var util=require(_0x17bc('0x1'));var path=require(_0x17bc('0x2'));var timeout=require(_0x17bc('0x3'));var express=require(_0x17bc('0x4'));var router=express[_0x17bc('0x5')]();var fs_extra=require(_0x17bc('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x17bc('0x7'));var controller=require(_0x17bc('0x8'));router[_0x17bc('0x9')]('/',auth[_0x17bc('0xa')](),controller[_0x17bc('0xb')]);router['get'](_0x17bc('0xc'),auth[_0x17bc('0xa')](),controller[_0x17bc('0xd')]);router[_0x17bc('0x9')](_0x17bc('0xe'),auth[_0x17bc('0xa')](),controller['show']);router[_0x17bc('0xf')]('/',auth[_0x17bc('0xa')](),controller[_0x17bc('0x10')]);router[_0x17bc('0x11')](_0x17bc('0xe'),auth[_0x17bc('0xa')](),controller['update']);router['delete'](_0x17bc('0xe'),auth['isAuthenticated'](),controller[_0x17bc('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index bfec550..1a1bbe2 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 _0x9c52=['sequelize','STRING','address','email','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Contact\x20us','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','thumb','INTEGER','input','name','text','getDataValue','parse','onlineForm','setDataValue','stringify','TEXT','textarea','Comments','Leave\x20your\x20comments','offlineForm','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:','website_alias','bottom_right','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}'];(function(_0xfe7ce3,_0x394ba8){var _0x108672=function(_0x4000b5){while(--_0x4000b5){_0xfe7ce3['push'](_0xfe7ce3['shift']());}};_0x108672(++_0x394ba8);}(_0x9c52,0x170));var _0x29c5=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9c52[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x29c5('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x29c5('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x29c5('0x1')],'allowNull':![],'unique':_0x29c5('0x2')},'description':{'type':Sequelize[_0x29c5('0x1')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x29c5('0x3')},'mapKeyOffline':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0x3')},'key':{'type':Sequelize[_0x29c5('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x29c5('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x29c5('0x1')],'allowNull':![],'defaultValue':_0x29c5('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29c5('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x29c5('0x1')]},'animation':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x29c5('0x7')](_0x29c5('0x8'),_0x29c5('0x9')),'defaultValue':_0x29c5('0x8')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x29c5('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x29c5('0xb')},'download_transcript':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0xc')},'formSubmitFailureMessage':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0xd')},'placeholderMessage':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0xe')},'closingMessage':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0xf')},'closingMessageButton':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0x10')},'skipMessageButton':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0x11')},'conditionAgreement':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x29c5('0x7')](_0x29c5('0x12'),_0x29c5('0x13')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x29c5('0x14')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x29c5('0x15'),'variable':null,'config':{'placeholder':_0x29c5('0x16'),'type':_0x29c5('0x17'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x29c5('0x15'),'props':{'title':_0x29c5('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x29c5('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x29c5('0x18')]('onlineForm')?JSON[_0x29c5('0x19')](this[_0x29c5('0x18')](_0x29c5('0x1a'))):{};},'set':function(_0x2b89fc){return this[_0x29c5('0x1b')](_0x29c5('0x1a'),JSON[_0x29c5('0x1c')](_0x2b89fc));}},'offlineForm':{'type':Sequelize[_0x29c5('0x1d')],'defaultValue':function(){return JSON[_0x29c5('0x1c')]({'items':[{'type':_0x29c5('0x15'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x29c5('0x3'),'type':_0x29c5('0x3')},'variable':null},{'type':_0x29c5('0x1e'),'config':{'placeholder':_0x29c5('0x1f')},'props':{'title':'Comments','helpText':_0x29c5('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x29c5('0x18')](_0x29c5('0x21'))?JSON[_0x29c5('0x19')](this[_0x29c5('0x18')]('offlineForm')):{};},'set':function(_0x3ff1c7){return this[_0x29c5('0x1b')](_0x29c5('0x21'),JSON[_0x29c5('0x1c')](_0x3ff1c7));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x29c5('0x1')]},'forwardOffline':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x29c5('0x1')]},'waitingTitle':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0x22')},'waitingMessage':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0x24')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x29c5('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0x10')},'enableCustomerAttachment':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x29c5('0x1')]},'notificationTemplate':{'type':Sequelize[_0x29c5('0x1d')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':_0x29c5('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x29c5('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x29c5('0x27')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x29c5('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x29c5('0x1')]},'customerAvatar':{'type':Sequelize[_0x29c5('0x1d')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x29c5('0x14')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x29c5('0x1')],'allowNull':![],'defaultValue':_0x29c5('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x29c5('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x29c5('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x29c5('0x29')},'systemAvatar':{'type':Sequelize[_0x29c5('0x1d')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x29c5('0x14')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29c5('0x6')],'defaultValue':![],'comment':_0x29c5('0x2a'),'set':function(_0x2dcd56){if(!_0x2dcd56)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x29c5('0x1b')](_0x29c5('0x2b'),_0x2dcd56);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x29c5('0x1')]},'vidaooTopic':{'type':Sequelize[_0x29c5('0x1')],'allowNull':![],'defaultValue':_0x29c5('0x2c')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x29c5('0x2d');}},'vidaooMetadata':{'type':Sequelize[_0x29c5('0x1d')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x29c5('0x1d')]}};
\ No newline at end of file
+var _0x746c=['Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','name','input','getDataValue','onlineForm','parse','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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','#fafafa','System','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT'];(function(_0x43c758,_0x290424){var _0x18d46e=function(_0x395d4a){while(--_0x395d4a){_0x43c758['push'](_0x43c758['shift']());}};_0x18d46e(++_0x290424);}(_0x746c,0x7f));var _0xc746=function(_0x58b603,_0x450f6d){_0x58b603=_0x58b603-0x0;var _0xf76126=_0x746c[_0x58b603];return _0xf76126;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc746('0x0'));module[_0xc746('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xc746('0x2')],'allowNull':![],'unique':_0xc746('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x4')},'mapKeyOffline':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x4')},'key':{'type':Sequelize[_0xc746('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x5')},'customerAlias':{'type':Sequelize[_0xc746('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xc746('0x2')],'allowNull':![],'defaultValue':_0xc746('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xc746('0x2')],'allowNull':![],'defaultValue':_0xc746('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xc746('0x2')],'allowNull':![],'defaultValue':_0xc746('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xc746('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xc746('0x2')]},'animation':{'type':Sequelize[_0xc746('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xc746('0xa')](_0xc746('0xb'),_0xc746('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xc746('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xc746('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xc746('0xd')},'header_offline':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0xe')},'download_transcript':{'type':Sequelize[_0xc746('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xc746('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xc746('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xc746('0x10')]},'closingQuestion':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xc746('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xc746('0x14')},'placeholderMessage':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x15')},'closingMessage':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xc746('0xd')},'skipMessageButton':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x17')},'conditionAgreement':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x18')},'ratingType':{'type':Sequelize[_0xc746('0xa')](_0xc746('0x19'),_0xc746('0x1a')),'defaultValue':_0xc746('0x19')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xc746('0x1b'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xc746('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xc746('0x4'),'type':_0xc746('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xc746('0x1d')](_0xc746('0x1e'))?JSON[_0xc746('0x1f')](this['getDataValue'](_0xc746('0x1e'))):{};},'set':function(_0x19671a){return this[_0xc746('0x20')](_0xc746('0x1e'),JSON[_0xc746('0x21')](_0x19671a));}},'offlineForm':{'type':Sequelize[_0xc746('0x10')],'defaultValue':function(){return JSON[_0xc746('0x21')]({'items':[{'type':'input','props':{'title':_0xc746('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xc746('0x4'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0xc746('0x22'),'helpText':_0xc746('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xc746('0x1d')](_0xc746('0x24'))?JSON['parse'](this[_0xc746('0x1d')](_0xc746('0x24'))):{};},'set':function(_0x1520cf){return this[_0xc746('0x20')](_0xc746('0x24'),JSON[_0xc746('0x21')](_0x1520cf));}},'token':{'type':Sequelize[_0xc746('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xc746('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xc746('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x25')},'waitingMessage':{'type':Sequelize[_0xc746('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x26')},'offlineMessageBody':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xc746('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xc746('0x28')},'skipUnmanaged':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x17')},'sendUnmanaged':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xc746('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xc746('0x2')]},'notificationTemplate':{'type':Sequelize[_0xc746('0x10')],'defaultValue':function(){return _0xc746('0x29');}},'notificationSound':{'type':Sequelize[_0xc746('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xc746('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x2a')},'verticalAlignment':{'type':Sequelize[_0xc746('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xc746('0x2')]},'customerAvatar':{'type':Sequelize[_0xc746('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xc746('0x2')],'allowNull':![],'defaultValue':_0xc746('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc746('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xc746('0x2')],'defaultValue':_0xc746('0x2c')},'systemAvatar':{'type':Sequelize[_0xc746('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc746('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x454d2b){if(!_0x454d2b)this[_0xc746('0x20')](_0xc746('0x2d'),null);this[_0xc746('0x20')]('mandatoryDisposition',_0x454d2b);}},'vidaooEscalation':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xc746('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc746('0x2e')},'vidaooNote':{'type':Sequelize[_0xc746('0x2')],'defaultValue':function(){return _0xc746('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0xc746('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xc746('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xc746('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index d79dda9..4a96c6c 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 _0x6855=['Intervals','virtual','custom','License','increment','push','all','some','utf8','remote','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','textColor','backgroundColor','addApplications','sequelize','ChatApplication','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','getFields','online','false','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','get','ChatWebsites','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','ChatWebsite','includeAll','include','rows','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','nolimit','ChatWebsiteId','Disposition','findAll','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','ids','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','getLicense','isNil','existsSync','server/files/images/logos/','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','describe','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','Applications','List','account','list','applications','orderBy','priority','asc','Contacts','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','unknown','format','%s\x20%s','device','vendor','threadId','ChatInteraction','ContactId','interaction','contact','lastName','messageId','created','autoclose','close','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','offline','no\x20available\x20attributes','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','files','attachments','offline-chat','basename','transaction','Attachment','bulkCreate','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','openNewInteraction','MailAccountId','mimetype','toPairsIn','mapValues','subjectOffline','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','tag','Command','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','timezone','No\x20timezone','getSnippet','Interval'];(function(_0x49adfe,_0x2fd329){var _0x1d53da=function(_0x4edbdb){while(--_0x4edbdb){_0x49adfe['push'](_0x49adfe['shift']());}};_0x1d53da(++_0x2fd329);}(_0x6855,0x157));var _0x5685=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0x6855[_0x5e4563];return _0x8d1bf5;};'use strict';var emlformat=require(_0x5685('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5685('0x1'));var rp=require('request-promise');var moment=require(_0x5685('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5685('0x3'));var util=require(_0x5685('0x4'));var path=require(_0x5685('0x5'));var sox=require(_0x5685('0x6'));var csv=require('to-csv');var ejs=require(_0x5685('0x7'));var fs=require('fs');var fs_extra=require(_0x5685('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5685('0x9'));var jsforce=require(_0x5685('0xa'));var deskjs=require(_0x5685('0xb'));var toCsv=require(_0x5685('0xc'));var querystring=require(_0x5685('0xd'));var Papa=require(_0x5685('0xe'));var Redis=require('ioredis');var authService=require(_0x5685('0xf'));var qs=require(_0x5685('0x10'));var as=require(_0x5685('0x11'));var hardwareService=require(_0x5685('0x12'));var logger=require(_0x5685('0x13'))('api');var utils=require(_0x5685('0x14'));var config=require(_0x5685('0x15'));var licenseUtil=require(_0x5685('0x16'));var db=require(_0x5685('0x17'))['db'];config[_0x5685('0x18')]=_[_0x5685('0x19')](config[_0x5685('0x18')],{'host':_0x5685('0x1a'),'port':0x18eb});var socket=require(_0x5685('0x1b'))(new Redis(config[_0x5685('0x18')]));require(_0x5685('0x1c'))[_0x5685('0x1d')](socket);var jayson=require(_0x5685('0x1e'));var client=jayson[_0x5685('0x1f')][_0x5685('0x20')]({'port':0x232c});var client9002=jayson[_0x5685('0x1f')][_0x5685('0x20')]({'port':0x232a});var client9003=jayson[_0x5685('0x1f')][_0x5685('0x20')]({'port':0x232b});var client9001=jayson[_0x5685('0x1f')]['http']({'port':0x2329});function respondWithRpcPromise(_0x1dfa38,_0x273360,_0x368a53,_0x5651e9){return new BPromise(function(_0xdde08d,_0x1f292a){var _0x64dfe3=_0x5651e9||client;return _0x64dfe3['request'](_0x1dfa38,_0x368a53)[_0x5685('0x21')](function(_0xdc2cbc){logger[_0x5685('0x22')](_0x5685('0x23'),_0x273360,_0x5685('0x24'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x273360,_0x5685('0x24'),JSON[_0x5685('0x25')](_0xdc2cbc));if(_0xdc2cbc[_0x5685('0x26')]){if(_0xdc2cbc[_0x5685('0x26')][_0x5685('0x27')]===0x1f4){logger[_0x5685('0x26')](_0x5685('0x23'),_0x273360,_0xdc2cbc[_0x5685('0x26')][_0x5685('0x28')]);return _0x1f292a(_0xdc2cbc['error']['message']);}logger[_0x5685('0x26')](_0x5685('0x23'),_0x273360,_0xdc2cbc[_0x5685('0x26')]['message']);return _0xdde08d(_0xdc2cbc[_0x5685('0x26')][_0x5685('0x28')]);}else{logger[_0x5685('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x273360,'request\x20sent');_0xdde08d(_0xdc2cbc[_0x5685('0x29')][_0x5685('0x28')]);}})[_0x5685('0x2a')](function(_0xfaa39b){logger[_0x5685('0x26')](_0x5685('0x23'),_0x273360,_0xfaa39b);_0x1f292a(_0xfaa39b);});});}function respondWithStatusCode(_0x6e1964,_0x32ff47){_0x32ff47=_0x32ff47||0xcc;return function(_0x58d265){if(_0x58d265){return _0x6e1964[_0x5685('0x2b')](_0x32ff47);}return _0x6e1964[_0x5685('0x2c')](_0x32ff47)[_0x5685('0x2d')]();};}function respondWithResult(_0x310856,_0x5c5c40){_0x5c5c40=_0x5c5c40||0xc8;return function(_0x7cce1f){if(_0x7cce1f){return _0x310856[_0x5685('0x2c')](_0x5c5c40)[_0x5685('0x2e')](_0x7cce1f);}};}function respondWithFilteredResult(_0x534fff,_0x1e7fe0){return function(_0x3ebd8d){if(_0x3ebd8d){var _0x59d938=typeof _0x1e7fe0[_0x5685('0x2f')]===_0x5685('0x30')&&typeof _0x1e7fe0['limit']===_0x5685('0x30');var _0x458b8f=_0x3ebd8d[_0x5685('0x31')];var _0x1c8243=_0x59d938?0x0:_0x1e7fe0[_0x5685('0x2f')];var _0x29ffde=_0x59d938?_0x3ebd8d['count']:_0x1e7fe0[_0x5685('0x2f')]+_0x1e7fe0[_0x5685('0x32')];var _0x37bf6d;if(_0x29ffde>=_0x458b8f){_0x29ffde=_0x458b8f;_0x37bf6d=0xc8;}else{_0x37bf6d=0xce;}_0x534fff[_0x5685('0x2c')](_0x37bf6d);return _0x534fff[_0x5685('0x33')]('Content-Range',_0x1c8243+'-'+_0x29ffde+'/'+_0x458b8f)['json'](_0x3ebd8d);}return null;};}function patchUpdates(_0x52f61a){return function(_0x396257){try{jsonpatch[_0x5685('0x34')](_0x396257,_0x52f61a,!![]);}catch(_0x4ffb03){return BPromise['reject'](_0x4ffb03);}return _0x396257[_0x5685('0x35')]();};}function saveUpdates(_0x109087,_0x53a510){return function(_0xb3456c){if(_0xb3456c){return _0xb3456c[_0x5685('0x36')](_0x109087)[_0x5685('0x21')](function(_0x1d0876){return _0x1d0876;});}return null;};}function removeEntity(_0xb8c19b,_0x5cca69){return function(_0x4b8fc3){if(_0x4b8fc3){return _0x4b8fc3['destroy']()[_0x5685('0x21')](function(){var _0x517a6e=_0x4b8fc3[_0x5685('0x37')]({'plain':!![]});var _0x41519a=_0x5685('0x38');return db['UserProfileResource'][_0x5685('0x39')]({'where':{'type':_0x41519a,'resourceId':_0x517a6e['id']}})[_0x5685('0x21')](function(){return _0x4b8fc3;});})['then'](function(){_0xb8c19b[_0x5685('0x2c')](0xcc)[_0x5685('0x2d')]();});}};}function handleEntityNotFound(_0x4455a2,_0xdaeb4a){return function(_0x426600){if(!_0x426600){_0x4455a2[_0x5685('0x2b')](0x194);}return _0x426600;};}function handleError(_0x285baa,_0x42c562){_0x42c562=_0x42c562||0x1f4;return function(_0x453b87){logger[_0x5685('0x26')](_0x453b87[_0x5685('0x3a')]);if(_0x453b87[_0x5685('0x3b')]){delete _0x453b87[_0x5685('0x3b')];}_0x285baa['status'](_0x42c562)[_0x5685('0x3c')](_0x453b87);};}exports[_0x5685('0x3d')]=function(_0x55312d,_0x2ce479){var _0x1932ae={'include':[{'model':db[_0x5685('0x3e')],'as':_0x5685('0x3f')}]},_0x199a18={},_0x6ed76={'count':0x0,'rows':[]};var _0x3a02e3=_[_0x5685('0x40')](db['ChatWebsite'][_0x5685('0x41')],function(_0x46da56){return{'name':_0x46da56[_0x5685('0x42')],'type':_0x46da56[_0x5685('0x43')][_0x5685('0x44')]};});_0x199a18[_0x5685('0x45')]=_['map'](_0x3a02e3,_0x5685('0x3b'));_0x199a18[_0x5685('0x46')]=_[_0x5685('0x47')](_0x55312d[_0x5685('0x46')]);_0x199a18['filters']=_[_0x5685('0x48')](_0x199a18[_0x5685('0x45')],_0x199a18['query']);_0x1932ae[_0x5685('0x49')]=_['intersection'](_0x199a18[_0x5685('0x45')],qs['fields'](_0x55312d['query'][_0x5685('0x4a')]));_0x1932ae[_0x5685('0x49')]=_0x1932ae[_0x5685('0x49')][_0x5685('0x4b')]?_0x1932ae[_0x5685('0x49')]:_0x199a18[_0x5685('0x45')];if(!_0x55312d[_0x5685('0x46')][_0x5685('0x4c')]('nolimit')){_0x1932ae['limit']=qs[_0x5685('0x32')](_0x55312d['query'][_0x5685('0x32')]);_0x1932ae['offset']=qs[_0x5685('0x2f')](_0x55312d[_0x5685('0x46')][_0x5685('0x2f')]);}_0x1932ae[_0x5685('0x4d')]=qs['sort'](_0x55312d[_0x5685('0x46')][_0x5685('0x4e')]);_0x1932ae['where']=qs[_0x5685('0x4f')](_[_0x5685('0x50')](_0x55312d[_0x5685('0x46')],_0x199a18[_0x5685('0x4f')]),_0x3a02e3);if(_0x55312d[_0x5685('0x46')][_0x5685('0x51')]){_0x1932ae[_0x5685('0x52')]=_[_0x5685('0x53')](_0x1932ae[_0x5685('0x52')],{'$or':_[_0x5685('0x40')](_0x3a02e3,function(_0x44ad7e){if(_0x44ad7e[_0x5685('0x43')]!==_0x5685('0x54')){var _0x36822c={};_0x36822c[_0x44ad7e[_0x5685('0x3b')]]={'$like':'%'+_0x55312d[_0x5685('0x46')][_0x5685('0x51')]+'%'};return _0x36822c;}})});}_0x1932ae=_['merge']({},_0x1932ae,_0x55312d[_0x5685('0x55')]);var _0x188f60={'where':_0x1932ae[_0x5685('0x52')]};return db[_0x5685('0x56')][_0x5685('0x31')](_0x188f60)[_0x5685('0x21')](function(_0x51bec6){_0x6ed76['count']=_0x51bec6;if(_0x55312d[_0x5685('0x46')][_0x5685('0x57')]){_0x1932ae[_0x5685('0x58')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x1932ae);})[_0x5685('0x21')](function(_0x170dd5){_0x6ed76[_0x5685('0x59')]=_0x170dd5;return _0x6ed76;})[_0x5685('0x21')](respondWithFilteredResult(_0x2ce479,_0x1932ae))[_0x5685('0x2a')](handleError(_0x2ce479,null));};exports['show']=function(_0x1197d3,_0x154eb1){var _0x56701e={'raw':![],'where':{'id':_0x1197d3[_0x5685('0x5a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2840dc={};_0x2840dc[_0x5685('0x45')]=_[_0x5685('0x47')](db[_0x5685('0x56')][_0x5685('0x41')]);_0x2840dc[_0x5685('0x46')]=_[_0x5685('0x47')](_0x1197d3[_0x5685('0x46')]);_0x2840dc[_0x5685('0x4f')]=_['intersection'](_0x2840dc[_0x5685('0x45')],_0x2840dc['query']);_0x56701e[_0x5685('0x49')]=_[_0x5685('0x48')](_0x2840dc['model'],qs[_0x5685('0x4a')](_0x1197d3[_0x5685('0x46')][_0x5685('0x4a')]));_0x56701e['attributes']=_0x56701e[_0x5685('0x49')][_0x5685('0x4b')]?_0x56701e[_0x5685('0x49')]:_0x2840dc[_0x5685('0x45')];if(_0x1197d3[_0x5685('0x46')][_0x5685('0x57')]){_0x56701e[_0x5685('0x58')]=[{'all':!![]}];}_0x56701e=_[_0x5685('0x53')]({},_0x56701e,_0x1197d3[_0x5685('0x55')]);return db[_0x5685('0x56')][_0x5685('0x5b')](_0x56701e)[_0x5685('0x21')](handleEntityNotFound(_0x154eb1,null))[_0x5685('0x21')](respondWithResult(_0x154eb1,null))[_0x5685('0x2a')](handleError(_0x154eb1,null));};exports[_0x5685('0x5c')]=function(_0x40bf0d,_0x4958a9){return db['ChatWebsite'][_0x5685('0x5c')](_0x40bf0d[_0x5685('0x5d')],{})[_0x5685('0x21')](function(_0x29c238){var _0x2d5c59=_0x40bf0d[_0x5685('0x5e')][_0x5685('0x37')]({'plain':!![]});if(!_0x2d5c59)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d5c59[_0x5685('0x5f')]==='user'){var _0x181772=_0x29c238[_0x5685('0x37')]({'plain':!![]});var _0xcf2ad3='ChatWebsites';return db[_0x5685('0x60')][_0x5685('0x5b')]({'where':{'name':_0xcf2ad3,'userProfileId':_0x2d5c59[_0x5685('0x61')]},'raw':!![]})[_0x5685('0x21')](function(_0x3dc6c8){if(_0x3dc6c8&&_0x3dc6c8[_0x5685('0x62')]===0x0){return db[_0x5685('0x63')]['create']({'name':_0x181772[_0x5685('0x3b')],'resourceId':_0x181772['id'],'type':_0x3dc6c8[_0x5685('0x3b')],'sectionId':_0x3dc6c8['id']},{})['then'](function(){return _0x29c238;});}else{return _0x29c238;}})[_0x5685('0x2a')](function(_0x504d20){logger[_0x5685('0x26')](_0x5685('0x64'),_0x504d20);throw _0x504d20;});}return _0x29c238;})[_0x5685('0x21')](respondWithResult(_0x4958a9,0xc9))['catch'](handleError(_0x4958a9,null));};exports[_0x5685('0x36')]=function(_0x4a7af1,_0xe8e978){if(_0x4a7af1['body']['id']){delete _0x4a7af1[_0x5685('0x5d')]['id'];}return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x4a7af1[_0x5685('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x5685('0x3f')}]})['then'](handleEntityNotFound(_0xe8e978,null))[_0x5685('0x21')](saveUpdates(_0x4a7af1[_0x5685('0x5d')],null))[_0x5685('0x21')](respondWithResult(_0xe8e978,null))[_0x5685('0x2a')](handleError(_0xe8e978,null));};exports[_0x5685('0x39')]=function(_0x4413dd,_0x4220df){return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x4413dd[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x4220df,null))[_0x5685('0x21')](removeEntity(_0x4220df,null))[_0x5685('0x2a')](handleError(_0x4220df,null));};exports['describe']=function(_0x15fa78,_0x577ef3){return db[_0x5685('0x56')]['describe']()['then'](respondWithResult(_0x577ef3,null))['catch'](handleError(_0x577ef3,null));};exports[_0x5685('0x65')]=function(_0x2a8588,_0x225469,_0x2e333d){if(_0x2a8588[_0x5685('0x5d')]['id']){delete _0x2a8588[_0x5685('0x5d')]['id'];}return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x2a8588[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x225469,null))[_0x5685('0x21')](function(_0x13cdad){if(_0x13cdad){_0x2a8588[_0x5685('0x5d')]['ChatWebsiteId']=_0x13cdad['id'];return db['Disposition'][_0x5685('0x5c')](_0x2a8588[_0x5685('0x5d')]);}})[_0x5685('0x21')](respondWithResult(_0x225469,null))[_0x5685('0x2a')](handleError(_0x225469,null));};exports['getDispositions']=function(_0x160ba8,_0x3ddd96,_0x14bdde){var _0x373fe1={'raw':![],'where':{}};var _0x34559b={};var _0x2cccb3={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x160ba8[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x3ddd96,null))['then'](function(_0x5bb1f2){if(_0x5bb1f2){_0x34559b['model']=_[_0x5685('0x47')](db['Disposition'][_0x5685('0x41')]);_0x34559b[_0x5685('0x46')]=_['keys'](_0x160ba8[_0x5685('0x46')]);_0x34559b[_0x5685('0x4f')]=_[_0x5685('0x48')](_0x34559b[_0x5685('0x45')],_0x34559b[_0x5685('0x46')]);_0x373fe1[_0x5685('0x49')]=_[_0x5685('0x48')](_0x34559b[_0x5685('0x45')],qs[_0x5685('0x4a')](_0x160ba8[_0x5685('0x46')][_0x5685('0x4a')]));_0x373fe1[_0x5685('0x49')]=_0x373fe1[_0x5685('0x49')][_0x5685('0x4b')]?_0x373fe1['attributes']:_0x34559b[_0x5685('0x45')];if(!_0x160ba8['query'][_0x5685('0x4c')](_0x5685('0x66'))){_0x373fe1['limit']=qs[_0x5685('0x32')](_0x160ba8[_0x5685('0x46')][_0x5685('0x32')]);_0x373fe1[_0x5685('0x2f')]=qs[_0x5685('0x2f')](_0x160ba8[_0x5685('0x46')]['offset']);}_0x373fe1['order']=qs[_0x5685('0x4e')](_0x160ba8[_0x5685('0x46')][_0x5685('0x4e')]);_0x373fe1[_0x5685('0x52')]=qs[_0x5685('0x4f')](_[_0x5685('0x50')](_0x160ba8['query'],_0x34559b[_0x5685('0x4f')]));_0x373fe1[_0x5685('0x52')][_0x5685('0x67')]=_0x5bb1f2['id'];if(_0x160ba8['query'][_0x5685('0x51')]){_0x373fe1[_0x5685('0x52')]=_['merge'](_0x373fe1['where'],{'$or':_[_0x5685('0x40')](_0x373fe1[_0x5685('0x49')],function(_0x394783){var _0x478378={};_0x478378[_0x394783]={'$like':'%'+_0x160ba8['query'][_0x5685('0x51')]+'%'};return _0x478378;})});}_0x373fe1=_[_0x5685('0x53')]({},_0x373fe1,_0x160ba8[_0x5685('0x55')]);return db['Disposition']['count']({'where':_0x373fe1[_0x5685('0x52')]})[_0x5685('0x21')](function(_0x1fb097){_0x2cccb3[_0x5685('0x31')]=_0x1fb097;if(_0x160ba8['query'][_0x5685('0x57')]){_0x373fe1['include']=[{'all':!![]}];}return db[_0x5685('0x68')][_0x5685('0x69')](_0x373fe1);})[_0x5685('0x21')](function(_0x2ba85e){_0x2cccb3['rows']=_0x2ba85e;return _0x2cccb3;});}})['then'](respondWithFilteredResult(_0x3ddd96,_0x373fe1))[_0x5685('0x2a')](handleError(_0x3ddd96,null));};exports[_0x5685('0x6a')]=function(_0x1aefa7,_0x128633,_0x216591){return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x1aefa7['params']['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x128633,null))['then'](function(_0x2c97f2){if(_0x2c97f2){return _0x2c97f2[_0x5685('0x6a')](_0x1aefa7[_0x5685('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x128633,null))['catch'](handleError(_0x128633,null));};exports[_0x5685('0x6b')]=function(_0x4ce07f,_0x9e9468,_0x66b1af){if(_0x4ce07f['body']['id']){delete _0x4ce07f['body']['id'];}return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x4ce07f['params']['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x9e9468,null))[_0x5685('0x21')](function(_0x3ea573){if(_0x3ea573){_0x4ce07f[_0x5685('0x5d')][_0x5685('0x67')]=_0x3ea573['id'];return db['CannedAnswer'][_0x5685('0x5c')](_0x4ce07f[_0x5685('0x5d')]);}})[_0x5685('0x21')](respondWithResult(_0x9e9468,null))[_0x5685('0x2a')](handleError(_0x9e9468,null));};exports[_0x5685('0x6c')]=function(_0x19f98e,_0x3252eb,_0x2bee11){var _0xc71188={'raw':![],'where':{}};var _0x25fe09={};var _0x54fad9={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5685('0x6d')]({'where':{'id':_0x19f98e['params']['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x3252eb,null))[_0x5685('0x21')](function(_0x15453c){if(_0x15453c){_0x25fe09[_0x5685('0x45')]=_[_0x5685('0x47')](db[_0x5685('0x6e')][_0x5685('0x41')]);_0x25fe09[_0x5685('0x46')]=_[_0x5685('0x47')](_0x19f98e[_0x5685('0x46')]);_0x25fe09[_0x5685('0x4f')]=_[_0x5685('0x48')](_0x25fe09[_0x5685('0x45')],_0x25fe09[_0x5685('0x46')]);_0xc71188['attributes']=_['intersection'](_0x25fe09[_0x5685('0x45')],qs[_0x5685('0x4a')](_0x19f98e[_0x5685('0x46')][_0x5685('0x4a')]));_0xc71188[_0x5685('0x49')]=_0xc71188['attributes'][_0x5685('0x4b')]?_0xc71188[_0x5685('0x49')]:_0x25fe09[_0x5685('0x45')];if(!_0x19f98e[_0x5685('0x46')][_0x5685('0x4c')](_0x5685('0x66'))){_0xc71188[_0x5685('0x32')]=qs[_0x5685('0x32')](_0x19f98e[_0x5685('0x46')][_0x5685('0x32')]);_0xc71188[_0x5685('0x2f')]=qs[_0x5685('0x2f')](_0x19f98e[_0x5685('0x46')][_0x5685('0x2f')]);}_0xc71188[_0x5685('0x4d')]=qs[_0x5685('0x4e')](_0x19f98e['query'][_0x5685('0x4e')]);_0xc71188['where']=qs[_0x5685('0x4f')](_['pick'](_0x19f98e[_0x5685('0x46')],_0x25fe09['filters']));_0xc71188[_0x5685('0x52')][_0x5685('0x67')]=_0x15453c['id'];if(_0x19f98e[_0x5685('0x46')][_0x5685('0x51')]){_0xc71188[_0x5685('0x52')]=_[_0x5685('0x53')](_0xc71188[_0x5685('0x52')],{'$or':_[_0x5685('0x40')](_0xc71188[_0x5685('0x49')],function(_0x56e668){var _0x5c2a27={};_0x5c2a27[_0x56e668]={'$like':'%'+_0x19f98e[_0x5685('0x46')][_0x5685('0x51')]+'%'};return _0x5c2a27;})});}_0xc71188=_[_0x5685('0x53')]({},_0xc71188,_0x19f98e[_0x5685('0x55')]);return db['CannedAnswer']['count']({'where':_0xc71188[_0x5685('0x52')]})[_0x5685('0x21')](function(_0x2ef29d){_0x54fad9['count']=_0x2ef29d;if(_0x19f98e[_0x5685('0x46')]['includeAll']){_0xc71188[_0x5685('0x58')]=[{'all':!![]}];}return db[_0x5685('0x6e')][_0x5685('0x69')](_0xc71188);})[_0x5685('0x21')](function(_0x3d844a){_0x54fad9[_0x5685('0x59')]=_0x3d844a;return _0x54fad9;});}})[_0x5685('0x21')](respondWithFilteredResult(_0x3252eb,_0xc71188))[_0x5685('0x2a')](handleError(_0x3252eb,null));};exports[_0x5685('0x6f')]=function(_0x5cd4df,_0x353c0e,_0x36dec0){return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x5cd4df['params']['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x353c0e,null))[_0x5685('0x21')](function(_0x2a9a15){if(_0x2a9a15){return _0x2a9a15[_0x5685('0x6f')](_0x5cd4df[_0x5685('0x46')][_0x5685('0x70')]);}})[_0x5685('0x21')](respondWithStatusCode(_0x353c0e,null))[_0x5685('0x2a')](handleError(_0x353c0e,null));};exports[_0x5685('0x71')]=function(_0x13e8d6,_0x39d2c3,_0x308c3a){_0x13e8d6[_0x5685('0x5d')]['sitepic']=_0x13e8d6[_0x5685('0x72')][_0x5685('0x73')];return db[_0x5685('0x56')]['find']({'where':{'id':_0x13e8d6[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x39d2c3,null))[_0x5685('0x21')](saveUpdates(_0x13e8d6[_0x5685('0x5d')],null))[_0x5685('0x21')](respondWithResult(_0x39d2c3,null))[_0x5685('0x2a')](handleError(_0x39d2c3,null));};exports[_0x5685('0x74')]=function(_0x294460,_0x3921d8,_0x4529b4){_0x294460[_0x5685('0x5d')][_0x5685('0x75')]=_0x294460[_0x5685('0x72')][_0x5685('0x73')];return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x294460[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x3921d8,null))[_0x5685('0x21')](saveUpdates(_0x294460[_0x5685('0x5d')],null))[_0x5685('0x21')](respondWithResult(_0x3921d8,null))['catch'](handleError(_0x3921d8,null));};exports[_0x5685('0x76')]=function(_0x46001b,_0x4e7a60,_0x3bb3e2){_0x46001b['body']['customerAvatar']=_0x46001b[_0x5685('0x72')]['filename'];return db['ChatWebsite'][_0x5685('0x5b')]({'where':{'id':_0x46001b[_0x5685('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4e7a60,null))[_0x5685('0x21')](saveUpdates(_0x46001b[_0x5685('0x5d')],null))[_0x5685('0x21')](respondWithResult(_0x4e7a60,null))[_0x5685('0x2a')](handleError(_0x4e7a60,null));};exports['addSystemAvatar']=function(_0x1f4afc,_0x32d751,_0x5f20b7){_0x1f4afc[_0x5685('0x5d')]['systemAvatar']=_0x1f4afc[_0x5685('0x72')][_0x5685('0x73')];return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x1f4afc[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x32d751,null))['then'](saveUpdates(_0x1f4afc[_0x5685('0x5d')],null))[_0x5685('0x21')](respondWithResult(_0x32d751,null))['catch'](handleError(_0x32d751,null));};exports[_0x5685('0x77')]=function(_0x8a2b07,_0x55f352,_0x52b009){var _0xec091e=path[_0x5685('0x78')](config[_0x5685('0x79')],_0x5685('0x7a'));var _0x31a402={'where':{'id':_0x8a2b07['params']['id']},'attributes':['id',_0x5685('0x7b')],'raw':!![]};var _0x362a83=![];return require(_0x5685('0x16'))[_0x5685('0x7c')]()[_0x5685('0x21')](function(_0x101dd4){if(_0x101dd4){_0x362a83=_0x101dd4['custom'];}})[_0x5685('0x21')](function(){return db[_0x5685('0x56')]['find'](_0x31a402);})['then'](handleEntityNotFound(_0x55f352,null))[_0x5685('0x21')](function(_0x46c635){if(_0x46c635){if(!_[_0x5685('0x7d')](_0x46c635['sitepic'])){if(fs[_0x5685('0x7e')](path[_0x5685('0x78')](config[_0x5685('0x79')],'server/files/images/logos/',_0x46c635[_0x5685('0x7b')]))&&_0x362a83){_0xec091e=path[_0x5685('0x78')](config[_0x5685('0x79')],_0x5685('0x7f'),_0x46c635[_0x5685('0x7b')]);}}return _0x55f352['download'](_0xec091e);}})[_0x5685('0x2a')](handleError(_0x55f352,null));};exports['getAvatar']=function(_0x405b76,_0x1d6d54,_0xf97bec){var _0x37fb42=path[_0x5685('0x78')](config[_0x5685('0x79')],'server/files/images/avatars/default_avatar.png');var _0xc18602={'where':{'id':_0x405b76[_0x5685('0x5a')]['id']},'attributes':['id',_0x5685('0x75')],'raw':!![]};return db[_0x5685('0x56')][_0x5685('0x5b')](_0xc18602)[_0x5685('0x21')](handleEntityNotFound(_0x1d6d54,null))['then'](function(_0x337d6c){if(_0x337d6c){if(!_[_0x5685('0x7d')](_0x337d6c[_0x5685('0x75')])){if(fs[_0x5685('0x7e')](path[_0x5685('0x78')](config[_0x5685('0x79')],_0x5685('0x80'),_0x337d6c[_0x5685('0x75')]))){_0x37fb42=path[_0x5685('0x78')](config['root'],_0x5685('0x80'),_0x337d6c[_0x5685('0x75')]);}}return _0x1d6d54['download'](_0x37fb42);}})[_0x5685('0x2a')](handleError(_0x1d6d54,null));};exports[_0x5685('0x81')]=function(_0x5a3d55,_0x51043e,_0x3778f4){var _0x422cb2=path[_0x5685('0x78')](config[_0x5685('0x79')],_0x5685('0x82'));var _0x28c4b6={'where':{'id':_0x5a3d55[_0x5685('0x5a')]['id']},'attributes':['id',_0x5685('0x83'),_0x5685('0x84')],'raw':!![]};return db['ChatWebsite'][_0x5685('0x5b')](_0x28c4b6)[_0x5685('0x21')](handleEntityNotFound(_0x51043e,null))[_0x5685('0x21')](function(_0x20672e){if(_0x20672e){if(!_[_0x5685('0x7d')](_0x20672e[_0x5685('0x83')])){if(fs[_0x5685('0x7e')](path[_0x5685('0x78')](config[_0x5685('0x79')],_0x5685('0x80'),_0x20672e['customerAvatar']))&&_0x20672e[_0x5685('0x84')]){_0x422cb2=path['join'](config[_0x5685('0x79')],'server/files/images/avatars/',_0x20672e[_0x5685('0x83')]);}}return _0x51043e[_0x5685('0x85')](_0x422cb2);}})[_0x5685('0x2a')](handleError(_0x51043e,null));};exports[_0x5685('0x86')]=function(_0x397fdc,_0x58eafb,_0x5e7a09){var _0x59cebe=path[_0x5685('0x78')](config['root'],_0x5685('0x87'));var _0x315ab5={'where':{'id':_0x397fdc[_0x5685('0x5a')]['id']},'attributes':['id',_0x5685('0x88')],'raw':!![]};return db['ChatWebsite'][_0x5685('0x5b')](_0x315ab5)[_0x5685('0x21')](handleEntityNotFound(_0x58eafb,null))[_0x5685('0x21')](function(_0x387156){if(_0x387156){if(!_[_0x5685('0x7d')](_0x387156['systemAvatar'])){if(fs[_0x5685('0x7e')](path[_0x5685('0x78')](config['root'],_0x5685('0x80'),_0x387156[_0x5685('0x88')]))){_0x59cebe=path[_0x5685('0x78')](config[_0x5685('0x79')],_0x5685('0x80'),_0x387156['systemAvatar']);}}return _0x58eafb[_0x5685('0x85')](_0x59cebe);}})[_0x5685('0x2a')](handleError(_0x58eafb,null));};exports[_0x5685('0x89')]=function(_0x23f326,_0x4b2108,_0x155b92){var _0x429748=require(_0x5685('0x8a'));var _0x1e84bc=new _0x429748();var _0x5e76d2=_0x1e84bc[_0x5685('0x8b')](_0x23f326[_0x5685('0x8c')][_0x5685('0x8d')])[_0x5685('0x8e')]();var _0x23e5ab={'body':_0x23f326[_0x5685('0x5d')],'channel':_0x5685('0x8f')};var _0x55be9d=[];var _0x47af3a=[];var _0x53c1e2={};var _0x5c95be=![];return db[_0x5685('0x90')][_0x5685('0x91')]()[_0x5685('0x21')](function(_0x182a2e){if(!_0x182a2e){throw new db[(_0x5685('0x92'))][(_0x5685('0x93'))]('no\x20available\x20attributes');}_0x55be9d=_[_0x5685('0x94')](_[_0x5685('0x47')](_0x182a2e),['createdAt',_0x5685('0x95')]);_0x47af3a=_[_0x5685('0x94')](_[_0x5685('0x47')](_0x182a2e),[_0x5685('0x96'),_0x5685('0x95'),_0x5685('0x97'),_0x5685('0x98')]);if(_0x23f326[_0x5685('0x5d')]['id']){delete _0x23f326[_0x5685('0x5d')]['id'];}if(_['isNil'](_0x23f326['body'][_0x5685('0x99')])){throw new db['Sequelize'][(_0x5685('0x93'))](_0x5685('0x9a'));}if(_['isNil'](_0x23f326[_0x5685('0x5d')]['body'])||_0x23f326[_0x5685('0x5d')][_0x5685('0x5d')]===''){throw new db[(_0x5685('0x92'))][(_0x5685('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5685('0x7d')](_0x23f326[_0x5685('0x5d')][_0x5685('0x9b')])){throw new db[(_0x5685('0x92'))][(_0x5685('0x93'))](_0x5685('0x9c')+_0x47af3a);}if(!_[_0x5685('0x9d')](_0x47af3a,_0x23f326['body'][_0x5685('0x9b')])){throw new db['Sequelize'][(_0x5685('0x93'))](_0x5685('0x9e')+_0x47af3a);}_0x53c1e2[_0x23f326['body'][_0x5685('0x9b')]]=_0x23f326[_0x5685('0x5d')][_0x5685('0x99')];})[_0x5685('0x21')](function(){return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x23f326['params']['id']},'include':[{'model':db[_0x5685('0x9f')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x53c1e2,'limit':0x1,'order':[[_0x5685('0x95'),_0x5685('0xa0')]]}]},{'model':db['ChatApplication'],'as':_0x5685('0xa1')}]});})[_0x5685('0x21')](handleEntityNotFound(_0x4b2108,null))[_0x5685('0x21')](function(_0x103904){if(_0x103904&&_0x103904[_0x5685('0xa2')]){_0x23e5ab[_0x5685('0xa3')]=_0x103904;_0x23e5ab['applications']=_0x103904[_0x5685('0xa1')];_0x23e5ab[_0x5685('0xa4')]=_0x103904[_0x5685('0xa2')];_0x23e5ab[_0x5685('0xa5')]=_[_0x5685('0xa6')](_0x23e5ab[_0x5685('0xa5')],[_0x5685('0xa7')],[_0x5685('0xa8')]);if(_0x23e5ab['account'][_0x5685('0xa1')]){delete _0x23e5ab[_0x5685('0xa3')]['Applications'];}if(_0x23e5ab[_0x5685('0xa3')][_0x5685('0xa2')]&&_0x23e5ab[_0x5685('0xa3')][_0x5685('0xa2')][_0x5685('0xa9')][_0x5685('0x4b')]){return _0x23e5ab['account']['List'][_0x5685('0xa9')][0x0];}var _0x33f988=_['defaults'](_0x23f326[_0x5685('0x5d')],{'firstName':_0x23f326[_0x5685('0x5d')]['from'],'ListId':_0x103904[_0x5685('0x98')]});_0x33f988[_0x23f326[_0x5685('0x5d')]['mapKey']]=_0x23f326[_0x5685('0x5d')][_0x5685('0x99')];return db[_0x5685('0x90')][_0x5685('0x5c')](_0x33f988,{'fields':_0x55be9d,'raw':!![]});}})[_0x5685('0x21')](handleEntityNotFound(_0x4b2108,null))[_0x5685('0x21')](function(_0x24975b){_0x23e5ab['contact']=_0x24975b;var _0x303b77=_0x23f326[_0x5685('0x5d')][_0x5685('0xaa')];if(_0x23f326['headers'][_0x5685('0xab')]){_0x303b77=_0x23f326[_0x5685('0x8c')][_0x5685('0xab')];}else if(_0x23f326['headers'][_0x5685('0xac')]){_0x303b77=_[_0x5685('0xad')](_0x23f326[_0x5685('0x8c')][_0x5685('0xac')][_0x5685('0xae')](','));}if(_0x24975b){var _0x2e316b={'ContactId':_0x24975b['id'],'ChatWebsiteId':_0x23f326[_0x5685('0x5a')]['id'],'from':(_0x24975b[_0x5685('0xaf')]||'')+'\x20'+(_0x24975b['lastName']||''),'customerIp':_0x303b77,'customerPort':_0x23f326[_0x5685('0x8c')][_0x5685('0xb0')]?_0x23f326[_0x5685('0x8c')][_0x5685('0xb0')]:null,'referer':_0x23f326[_0x5685('0x5d')][_0x5685('0xb1')],'browserName':_0x5e76d2[_0x5685('0xb2')]['name']&&_0x5e76d2[_0x5685('0xb2')][_0x5685('0xb3')]?util['format']('%s\x20%s',_0x5e76d2[_0x5685('0xb2')][_0x5685('0x3b')],_0x5e76d2[_0x5685('0xb2')][_0x5685('0xb3')]):_0x5685('0xb4'),'browserVersion':_0x5e76d2['browser'][_0x5685('0xb3')]||_0x5685('0xb4'),'osName':util[_0x5685('0xb5')](_0x5685('0xb6'),_0x5e76d2['os'][_0x5685('0x3b')],_0x5e76d2['os']['version']),'osVersion':_0x5e76d2['os'][_0x5685('0xb3')],'deviceModel':_0x5e76d2[_0x5685('0xb7')][_0x5685('0x45')]&&_0x5e76d2[_0x5685('0xb7')][_0x5685('0xb8')]?util[_0x5685('0xb5')]('%s\x20%s\x20%s',_0x5e76d2[_0x5685('0xb7')][_0x5685('0x45')],_0x5e76d2[_0x5685('0xb7')][_0x5685('0xb8')],_0x5e76d2[_0x5685('0xb7')][_0x5685('0x43')]):null,'deviceVendor':_0x5e76d2[_0x5685('0xb7')]['vendor'],'deviceType':_0x5e76d2[_0x5685('0xb7')][_0x5685('0x43')],'formData':JSON[_0x5685('0x25')](_0x23f326[_0x5685('0x5d')])};var _0x1122a8={'ChatWebsiteId':_0x23f326[_0x5685('0x5a')]['id'],'closed':![]};if(_0x23f326[_0x5685('0x5d')][_0x5685('0xb9')]){_0x1122a8['threadId']=_0x23f326[_0x5685('0x5d')][_0x5685('0xb9')];return db[_0x5685('0xba')]['find']({'where':_0x1122a8})['then'](function(_0x78cb58){if(_0x78cb58){return[_0x78cb58,![]];}_0x2e316b[_0x5685('0xb9')]=_0x23f326['body'][_0x5685('0xb9')];_0x2e316b['externalUrl']=_0x23f326['body']['externalUrl'];return db[_0x5685('0xba')][_0x5685('0x5c')](_0x2e316b)['then'](function(_0x24ae5d){return[_0x24ae5d,!![]];});});}_0x1122a8[_0x5685('0xbb')]=_0x24975b['id'];if(_0x23f326[_0x5685('0x5d')]['interaction']&&_0x23f326[_0x5685('0x5d')][_0x5685('0xbc')]['id']){_0x1122a8['id']=_0x23f326[_0x5685('0x5d')][_0x5685('0xbc')]['id'];return db[_0x5685('0xba')][_0x5685('0x5b')]({'where':_0x1122a8})[_0x5685('0x21')](function(_0x3a1698){if(_0x3a1698){return[_0x3a1698,![]];}return db['ChatInteraction'][_0x5685('0x5c')](_0x2e316b)['then'](function(_0x37c8ac){return[_0x37c8ac,!![]];});});}return db[_0x5685('0xba')][_0x5685('0x5c')](_0x2e316b)[_0x5685('0x21')](function(_0x1ee322){return[_0x1ee322,!![]];});}})['spread'](function(_0x343257,_0x482ca1){if(_0x343257){_0x5c95be=_0x482ca1;if(!_0x482ca1){var _0x19c76b={'from':(_0x23e5ab['contact'][_0x5685('0xaf')]||'')+'\x20'+(_0x23e5ab[_0x5685('0xbd')][_0x5685('0xbe')]||'')};if(_0x23f326['body']['threadId']&&_0x23f326[_0x5685('0x5d')][_0x5685('0xbf')]&&_0x23f326[_0x5685('0x5d')][_0x5685('0xb9')]!=_0x23f326[_0x5685('0x5d')][_0x5685('0xbf')]){_0x19c76b[_0x5685('0xb9')]=_0x23f326[_0x5685('0x5d')][_0x5685('0xbf')];}return _0x343257[_0x5685('0x36')](_0x19c76b);}else{return _0x343257;}}})[_0x5685('0x21')](function(_0x2f5432){_0x23e5ab[_0x5685('0xbc')]=_0x2f5432[_0x5685('0x37')]({'plain':!![]});_0x23e5ab['interaction'][_0x5685('0xc0')]=_0x5c95be;if(_0x23e5ab[_0x5685('0xbc')]['created']){if(_0x23e5ab[_0x5685('0xa3')][_0x5685('0xc1')]){_0x23e5ab['applications']['push']({'id':0x0,'priority':_0x23e5ab[_0x5685('0xa5')][_0x5685('0x4b')]+0x1,'app':_0x5685('0xc2'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x5685('0xc3')][_0x5685('0x5c')]({'body':_0x23f326[_0x5685('0x5d')][_0x5685('0x5d')],'ChatWebsiteId':_0x23f326['params']['id'],'ChatInteractionId':_0x2f5432['id'],'direction':'in','ContactId':_0x23e5ab[_0x5685('0xbd')]['id'],'AttachmentId':_0x23f326['body'][_0x5685('0xc4')]});})['then'](function(_0x10af69){_0x23e5ab[_0x5685('0x28')]=_0x10af69;if(_0x23e5ab[_0x5685('0xbc')][_0x5685('0xc5')]){return db[_0x5685('0xc6')][_0x5685('0x5b')]({'attributes':['id',_0x5685('0x3b')],'where':{'id':_0x23e5ab[_0x5685('0xbc')][_0x5685('0xc5')]}})['then'](function(_0x24926b){if(_0x24926b){_0x23e5ab[_0x5685('0xa5')][_0x5685('0xc7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x24926b[_0x5685('0x3b')]+','+(_0x23e5ab['account'][_0x5685('0xc8')]||0xa),'interval':_0x5685('0xc9')});_0x23e5ab['forcedOwnership']=!![];}return respondWithRpcPromise(_0x5685('0xca'),_0x5685('0xcb'),_0x23e5ab);});}return respondWithRpcPromise(_0x5685('0xca'),'startRouting',_0x23e5ab);})['then'](function(_0x51c2aa){respondWithRpcPromise(_0x5685('0xcc'),_0x5685('0xcc'),{'event':_0x5685('0x89'),'message':_0x51c2aa},client9002);return _0x51c2aa;})[_0x5685('0x21')](respondWithResult(_0x4b2108,null))[_0x5685('0x2a')](handleError(_0x4b2108,null));};exports[_0x5685('0xcd')]=function(_0x3882a3,_0x585f03,_0x7fbc){var _0x2ef173,_0x114fe8,_0x388002;var _0x574e67=[];var _0x112295=[];var _0x313ccc={};var _0x18b84b=_0x3882a3['files']||[];var _0xe1ce9e=[];var _0x17d589;return db[_0x5685('0x90')]['describe']()[_0x5685('0x21')](function(_0x48500a){if(!_0x48500a){throw new db[(_0x5685('0x92'))][(_0x5685('0x93'))](_0x5685('0xce'));}_0x112295=_[_0x5685('0x94')](_[_0x5685('0x47')](_0x48500a),[_0x5685('0x96'),_0x5685('0x95')]);_0x574e67=_[_0x5685('0x94')](_[_0x5685('0x47')](_0x48500a),['createdAt','updatedAt',_0x5685('0x97'),'ListId']);if(_0x3882a3[_0x5685('0x5d')]['id']){delete _0x3882a3[_0x5685('0x5d')]['id'];}if(_[_0x5685('0x7d')](_0x3882a3[_0x5685('0x5d')][_0x5685('0x99')])){throw _0x585f03[_0x5685('0x2c')](0x1f4)[_0x5685('0x3c')](new db[(_0x5685('0x92'))]['ValidationError'](_0x5685('0x9a')));}if(_['isNil'](_0x3882a3[_0x5685('0x5d')][_0x5685('0x5d')])||_0x3882a3[_0x5685('0x5d')][_0x5685('0x5d')]===''){throw _0x585f03[_0x5685('0x2c')](0x1f4)['send'](new db[(_0x5685('0x92'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x3882a3[_0x5685('0x5d')]['mapKeyOffline'])){throw _0x585f03[_0x5685('0x2c')](0x1f4)[_0x5685('0x3c')](new db[(_0x5685('0x92'))]['ValidationError'](_0x5685('0xcf')+_0x574e67));}if(!_[_0x5685('0x9d')](_0x574e67,_0x3882a3[_0x5685('0x5d')]['mapKeyOffline'])){throw _0x585f03[_0x5685('0x2c')](0x1f4)[_0x5685('0x3c')](new db[(_0x5685('0x92'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x574e67));}_0x313ccc[_0x3882a3[_0x5685('0x5d')][_0x5685('0xd0')]]=_0x3882a3[_0x5685('0x5d')][_0x5685('0x99')];})[_0x5685('0x21')](function(){return db[_0x5685('0x56')][_0x5685('0x5b')]({'where':{'id':_0x3882a3[_0x5685('0x5a')]['id']},'include':[{'model':db[_0x5685('0x9f')],'as':_0x5685('0xa2')},{'model':db['MailAccount'],'as':_0x5685('0xd1')}]});})['then'](handleEntityNotFound(_0x585f03,null))[_0x5685('0x21')](function(_0x154af4){if(_0x154af4&&_0x154af4['List']){_0x114fe8=_0x154af4;var _0x356572=_[_0x5685('0x19')](_0x3882a3[_0x5685('0x5d')],{'firstName':_0x3882a3[_0x5685('0x5d')][_0x5685('0x99')],'phone':_0x3882a3['body'][_0x5685('0x99')],'ListId':_0x154af4['ListId']});_0x356572[_0x3882a3[_0x5685('0x5d')][_0x5685('0xd0')]]=_0x3882a3[_0x5685('0x5d')]['from'];return db[_0x5685('0x90')]['findOrCreate']({'where':_0x313ccc,'defaults':_0x356572});}})[_0x5685('0xd2')](function(_0x42df58){if(_0x42df58){_0x388002=_0x42df58;var _0xaa3549=fs[_0x5685('0xd3')](path[_0x5685('0x78')](config[_0x5685('0x79')],_0x5685('0xd4')),'utf8');var _0x18ffbc=ejs['render'](_0xaa3549,{'body':_[_0x5685('0xd5')](_0x3882a3[_0x5685('0x5d')][_0x5685('0x5d')]),'bodyTitle':_0x114fe8[_0x5685('0xd6')]});return db[_0x5685('0xd7')][_0x5685('0x5c')]({'body':_0x18ffbc,'ContactId':_0x42df58['id'],'ChatWebsiteId':_0x114fe8['id']});}})[_0x5685('0x21')](function(_0x565922){_0x17d589=_0x565922;if(_0x18b84b[_0x5685('0x4b')]){var _0x26bee9=_0x18b84b['map'](function(_0x2c1a6b){return{'name':_0x2c1a6b[_0x5685('0xd8')],'basename':_0x2c1a6b[_0x5685('0x73')],'type':_0x2c1a6b['mimetype'],'ChatOfflineMessageId':_0x565922['id']};});_0xe1ce9e=_0x26bee9[_0x5685('0x40')](_0x39e1c9=>{var _0x1f48d0={'filename':_0x39e1c9['name'],'path':path['join'](config[_0x5685('0x79')],_0x5685('0xd9'),_0x5685('0xda'),_0x5685('0xdb'),_0x5685('0xdc'),_0x39e1c9[_0x5685('0xdd')])};return _0x1f48d0;});if(!_0x114fe8['openNewInteraction']){return db['sequelize'][_0x5685('0xde')](function(_0x462856){return db[_0x5685('0xdf')][_0x5685('0xe0')](_0x26bee9,{'transaction':_0x462856});});}}})[_0x5685('0x21')](function(){if(_0x17d589){_0x2ef173=_0x17d589;return db[_0x5685('0xd1')][_0x5685('0x6d')]({'where':{'active':!![]},'include':[{'model':db[_0x5685('0xe1')],'as':_0x5685('0xe2'),'raw':!![]}]});}})['then'](function(_0x26d9a6){if(_0x26d9a6&&_0x26d9a6[_0x5685('0xe2')]&&_0x114fe8['forwardOffline']&&_0x114fe8['forwardOfflineAddress']){var _0xb3809b={'tls':{'rejectUnauthorized':![]}};if(_0x26d9a6[_0x5685('0xe2')]['service']){_0xb3809b[_0x5685('0xe3')]=_0x26d9a6[_0x5685('0xe2')][_0x5685('0xe3')];}else{_0xb3809b[_0x5685('0xe4')]=_0x26d9a6[_0x5685('0xe2')][_0x5685('0xe4')];_0xb3809b[_0x5685('0xe5')]=_0x26d9a6['Smtp']['port'];_0xb3809b[_0x5685('0xe6')]=_0x26d9a6[_0x5685('0xe2')][_0x5685('0xe6')];}if(_0x26d9a6[_0x5685('0xe2')][_0x5685('0xe7')]){_0xb3809b['auth']={'user':_0x26d9a6[_0x5685('0xe2')][_0x5685('0x5e')],'pass':_0x26d9a6[_0x5685('0xe2')][_0x5685('0xe8')]};}return respondWithRpcPromise(_0x5685('0xe9'),_0x5685('0xea'),{'account':_0xb3809b,'message':{'from':util[_0x5685('0xb5')]('\x22%s\x22\x20<%s>',_0x26d9a6['name'],_0x26d9a6['email']||_0x26d9a6[_0x5685('0xe2')][_0x5685('0x5e')]),'to':_0x114fe8['forwardOfflineAddress'],'subject':_0x114fe8['offlineMessageSubject'],'html':_0x2ef173[_0x5685('0x5d')],'attachments':_0xe1ce9e}},client9003)[_0x5685('0x21')](function(){return _0x2ef173;})[_0x5685('0x2a')](function(_0xcce31a){console[_0x5685('0x26')](_0xcce31a);});}})[_0x5685('0x21')](function(){if(_0x114fe8&&_0x114fe8[_0x5685('0xeb')]&&_0x114fe8[_0x5685('0xec')]){var _0x388854=[];if(_0x18b84b[_0x5685('0x4b')]){_0x388854=_0x18b84b[_0x5685('0x40')](function(_0x934d57){return{'name':_0x934d57['originalname'],'basename':_0x934d57[_0x5685('0x73')],'type':_0x934d57[_0x5685('0xed')],'ChatOfflineMessageId':_0x17d589['id']};});}var _0x54c28f;if(!_[_0x5685('0x7d')](_0x114fe8['subjectOffline'])){var _0x36f784=_['map'](_0x3882a3['body'],function(_0x411614){return _0x411614;});var _0x374a61=_[_0x5685('0xee')](_0x36f784)[0x0];var _0x27205a=_[_0x5685('0xef')](_0x374a61,function(_0x53f9f7){return _0x53f9f7;});_0x54c28f=_0x27205a[0x1][_0x114fe8[_0x5685('0xf0')]];}var _0x48e79c={'from':_0x388002[_0x5685('0xf1')],'firstName':_0x388002[_0x5685('0xaf')],'lastName':_0x388002[_0x5685('0xbe')],'mapKey':_0x5685('0xf1'),'message':{'from':_0x388002[_0x5685('0xf1')],'to':_0x114fe8[_0x5685('0xd1')][_0x5685('0xf1')],'cc':'','subject':_[_0x5685('0x7d')](_0x54c28f)?_0x114fe8[_0x5685('0xf2')]:_0x54c28f,'messageId':'','sentAt':new Date(),'attach':_0x388854['length'],'attachments':_0x388854,'originChannel':_0x5685('0xf3'),'ChatWebsiteId':_0x114fe8['id'],'ChatOfflineMessageId':_0x2ef173['id'],'originTo':_0x114fe8[_0x5685('0xd1')]['email']},'body':_0x2ef173[_0x5685('0x5d')]};var _0x35b1dd={'account':{'id':_0x114fe8[_0x5685('0xec')]},'body':_0x48e79c,'log':_0x5685('0xf4')};return respondWithRpcPromise(_0x5685('0xf4'),_0x5685('0xf5'),_0x35b1dd,client9001)[_0x5685('0x21')](function(){return _0x2ef173;})[_0x5685('0x2a')](function(_0x7672e2){console['error'](_0x7672e2);});}return;})[_0x5685('0x21')](function(){if(_0x2ef173){return _0x2ef173;}})['then'](respondWithResult(_0x585f03,null))[_0x5685('0x2a')](function(_0x48da48){console[_0x5685('0x26')](_0x5685('0x2a'),_0x48da48);for(var _0x482ea7 of _0x18b84b){var _0x194022=path[_0x5685('0x78')](config[_0x5685('0x79')],_0x5685('0xd9'),_0x5685('0xda'),_0x5685('0xdb'),_0x5685('0xdc'),_0x482ea7[_0x5685('0x73')]);fs_extra[_0x5685('0xf6')](_0x194022)['catch'](function(_0x3de726){console[_0x5685('0x26')]('Could\x20not\x20remove\x20attachment\x20file',_0x194022,_0x3de726);});}});};exports[_0x5685('0xf7')]=function(_0x1256e1,_0x1dcc02,_0x38c032){return db[_0x5685('0xba')][_0x5685('0x5b')]({'where':{'id':_0x1256e1[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x1dcc02,null))['then'](function(_0x426e73){if(_0x426e73){return _0x426e73[_0x5685('0xf7')](_0x1256e1[_0x5685('0x5d')][_0x5685('0x70')],_[_0x5685('0xf8')](_0x1256e1[_0x5685('0x5d')],[_0x5685('0x70'),'id'])||{});}})[_0x5685('0x21')](respondWithResult(_0x1dcc02,null))['catch'](handleError(_0x1dcc02,null));};exports[_0x5685('0xf9')]=function(_0x877d21,_0x3ac4fc,_0x1c5264){var _0x5150be={'raw':![],'where':{}};var _0x2c3d78={};var _0x57c64c={'count':0x0,'rows':[]};return db[_0x5685('0x56')][_0x5685('0x6d')]({'where':{'id':_0x877d21[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x3ac4fc,null))[_0x5685('0x21')](function(_0x5e5031){if(_0x5e5031){_0x2c3d78['model']=_[_0x5685('0x47')](db[_0x5685('0xba')][_0x5685('0x41')]);_0x2c3d78[_0x5685('0x46')]=_['keys'](_0x877d21[_0x5685('0x46')]);_0x2c3d78['filters']=_[_0x5685('0x48')](_0x2c3d78[_0x5685('0x45')],_0x2c3d78[_0x5685('0x46')]);_0x5150be[_0x5685('0x49')]=_[_0x5685('0x48')](_0x2c3d78[_0x5685('0x45')],qs[_0x5685('0x4a')](_0x877d21[_0x5685('0x46')][_0x5685('0x4a')]));_0x5150be[_0x5685('0x49')]=_0x5150be[_0x5685('0x49')][_0x5685('0x4b')]?_0x5150be[_0x5685('0x49')]:_0x2c3d78[_0x5685('0x45')];if(!_0x877d21[_0x5685('0x46')][_0x5685('0x4c')](_0x5685('0x66'))){_0x5150be[_0x5685('0x32')]=qs[_0x5685('0x32')](_0x877d21[_0x5685('0x46')][_0x5685('0x32')]);_0x5150be[_0x5685('0x2f')]=qs[_0x5685('0x2f')](_0x877d21[_0x5685('0x46')][_0x5685('0x2f')]);}_0x5150be[_0x5685('0x4d')]=qs[_0x5685('0x4e')](_0x877d21[_0x5685('0x46')][_0x5685('0x4e')]);_0x5150be['where']=qs['filters'](_[_0x5685('0x50')](_0x877d21[_0x5685('0x46')],_0x2c3d78[_0x5685('0x4f')]));_0x5150be[_0x5685('0x52')][_0x5685('0x67')]=_0x5e5031['id'];if(_0x877d21[_0x5685('0x46')][_0x5685('0x51')]){_0x5150be[_0x5685('0x52')]=_[_0x5685('0x53')](_0x5150be[_0x5685('0x52')],{'$or':_[_0x5685('0x40')](_0x5150be[_0x5685('0x49')],function(_0x30e36b){var _0x4fdb94={};_0x4fdb94[_0x30e36b]={'$like':'%'+_0x877d21[_0x5685('0x46')][_0x5685('0x51')]+'%'};return _0x4fdb94;})});}_0x5150be=_['merge']({},_0x5150be,_0x877d21[_0x5685('0x55')]);return db[_0x5685('0xba')][_0x5685('0x31')]({'where':_0x5150be[_0x5685('0x52')]})[_0x5685('0x21')](function(_0x2ac030){_0x57c64c[_0x5685('0x31')]=_0x2ac030;if(_0x877d21[_0x5685('0x46')][_0x5685('0x57')]){_0x5150be[_0x5685('0x58')]=[{'model':db[_0x5685('0x90')],'as':_0x5685('0xfa'),'required':![]},{'model':db[_0x5685('0xc6')],'as':_0x5685('0xfb'),'attributes':[_0x5685('0x3b'),_0x5685('0xfc'),_0x5685('0xfd')],'required':![]},{'model':db[_0x5685('0xfe')],'as':'Tags','attributes':['id',_0x5685('0x3b'),'color'],'where':_0x877d21[_0x5685('0x46')][_0x5685('0xff')]?{'id':_0x877d21[_0x5685('0x46')]['tag']}:undefined,'required':_0x877d21[_0x5685('0x46')][_0x5685('0xff')]?!![]:![]}];}return db[_0x5685('0xba')][_0x5685('0x69')](_0x5150be);})[_0x5685('0x21')](function(_0x595a45){_0x57c64c[_0x5685('0x59')]=_0x595a45;return _0x57c64c;});}})[_0x5685('0x21')](respondWithFilteredResult(_0x3ac4fc,_0x5150be))[_0x5685('0x2a')](handleError(_0x3ac4fc,null));};function iftimePromise(_0xb45167,_0x37a962){return respondWithRpcPromise(_0x5685('0x100'),'getSnippet',{'command':_0x37a962['timezone']?util[_0x5685('0xb5')](_0x5685('0x101'),_0xb45167[_0x5685('0x102')],_0x37a962['timezone']):util[_0x5685('0xb5')]('iftime\x20%s',_0xb45167[_0x5685('0x102')])},client9002)[_0x5685('0x21')](function(_0x29d8be){var _0x4e737f=_0x29d8be&&_0x29d8be[_0x5685('0x103')](_0x5685('0x104'))>=0x0?!![]:![];logger[_0x5685('0x22')](_0x5685('0x105'),_0x37a962['id'],_0xb45167['id'],_0xb45167[_0x5685('0x102')],_0x4e737f?_0x5685('0x106'):'OFFLINE',_0x37a962[_0x5685('0x107')]?_0x37a962[_0x5685('0x107')]:'No\x20timezone');return _0x4e737f;})[_0x5685('0x2a')](function(_0x5f188d){logger[_0x5685('0x26')](_0x5685('0x105'),_0x37a962['id'],_0xb45167['id'],_0xb45167[_0x5685('0x102')],util['inspect'](_0x5f188d,{'showHidden':![],'depth':null}),_0x37a962[_0x5685('0x107')]?_0x37a962[_0x5685('0x107')]:_0x5685('0x108'));return![];});}exports[_0x5685('0x109')]=function(_0xb00ad3,_0x794911,_0x1f79a7){var _0x577464=0x0;var _0x2841d1=0x0;var _0x130e19=![];var _0x5cbc21;var _0x4139cc;return db[_0x5685('0x56')]['find']({'where':{'id':_0xb00ad3[_0x5685('0x5a')]['id']},'include':[{'model':db['Interval'],'as':_0x5685('0x10a'),'include':[{'model':db[_0x5685('0x10a')],'as':_0x5685('0x10b'),'attributes':['id',_0x5685('0x102')],'raw':!![]}]}]})[_0x5685('0x21')](handleEntityNotFound(_0x794911,null))[_0x5685('0x21')](function(_0xe19a02){if(_0xe19a02){_0x5cbc21=_0xe19a02;return _0xe19a02['getProactiveActions']({'raw':!![]});}})[_0x5685('0x21')](function(_0x18ec62){if(_0x5cbc21){if(_0x18ec62){_0x4139cc=_0x18ec62;}}return require(_0x5685('0x16'))['getLicense']();})[_0x5685('0x21')](function(_0x15d270){if(_0x15d270){_0x2841d1=_0x15d270[_0x5685('0x10c')];_0x130e19=_0x15d270[_0x5685('0x10d')];}})['then'](function(){return db[_0x5685('0xba')][_0x5685('0x31')]({'where':{'closed':![]}});})[_0x5685('0x21')](function(_0x1218c6){_0x577464=_0x1218c6;if(_0x2841d1&&_0x1218c6>_0x2841d1){return db[_0x5685('0x10e')][_0x5685('0x6d')]({'where':{'id':0x1}})[_0x5685('0x21')](function(_0x5eba6d){if(_0x5eba6d){_0x5eba6d[_0x5685('0x10f')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x5cbc21[_0x5685('0x10a')]&&_0x5cbc21['Interval'][_0x5685('0x10b')]){var _0x1210e7=[];for(var _0x580545=0x0;_0x580545<_0x5cbc21['Interval'][_0x5685('0x10b')][_0x5685('0x4b')];_0x580545++){var _0x484ae8=_0x5cbc21[_0x5685('0x10a')][_0x5685('0x10b')][_0x580545][_0x5685('0x37')]({'plain':!![]});_0x1210e7[_0x5685('0x110')](iftimePromise(_0x484ae8,_0x5cbc21));}return BPromise[_0x5685('0x111')](_0x1210e7)[_0x5685('0x21')](function(_0x2d612){return _[_0x5685('0x112')](_0x2d612);});}else{return!![];}})[_0x5685('0x21')](function(_0x470548){var _0x2c3db4=fs[_0x5685('0xd3')](path[_0x5685('0x78')](config[_0x5685('0x79')],'server/files/chat/iframe.ejs'),_0x5685('0x113'));var _0x59facf={'remote':_0x5cbc21[_0x5685('0x114')],'query':querystring['stringify'](_['merge'](_0x5cbc21[_0x5685('0x37')]({'plain':!![]}),{'customerIp':_0xb00ad3[_0x5685('0x8c')]['x-forwarded-for']||_0xb00ad3[_0x5685('0x8c')][_0x5685('0x115')]||_0xb00ad3['connection'][_0x5685('0x116')]||_0xb00ad3['ip'],'referer':_0xb00ad3[_0x5685('0x8c')][_0x5685('0xb1')],'openedInteractions':_0x577464,'maxInteractions':_0x2841d1,'virtual':_0x130e19[_0x5685('0x10c')],'online':_0x470548,'custom':_0x130e19}))[_0x5685('0x117')](/'/g,'\x5c\x27')};_0x794911[_0x5685('0x3c')](ejs['render'](Mustache['render'](_0x2c3db4,_0x59facf),{'proactiveActions':_0x4139cc,'alignment':_0x5cbc21[_0x5685('0x118')],'verticalAlignment':_0x5cbc21[_0x5685('0x119')],'div_color':_0x5cbc21['color'],'text_color':_0x5cbc21[_0x5685('0x11a')],'button_color':_0x5cbc21['color_button'],'background_color':_0x5cbc21[_0x5685('0x11b')]}));})['catch'](handleError(_0x794911,null));};exports[_0x5685('0x11c')]=function(_0x1f1a66,_0x4471e3,_0x40e48f){return db['ChatWebsite'][_0x5685('0x6d')]({'where':{'id':_0x1f1a66[_0x5685('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4471e3,null))[_0x5685('0x21')](function(_0x3c83f2){if(_0x3c83f2){return db[_0x5685('0x11d')]['transaction'](function(_0x463389){return db[_0x5685('0x11e')][_0x5685('0x39')]({'where':{'ChatWebsiteId':_0x1f1a66['params']['id']},'transaction':_0x463389})['then'](function(_0x17e61b){var _0x27e619=_['map'](_0x1f1a66['body'],function(_0x42c0c9){_0x42c0c9[_0x5685('0x67')]=_0x1f1a66[_0x5685('0x5a')]['id'];return _0x42c0c9;});return db[_0x5685('0x11e')]['bulkCreate'](_0x27e619,{'transaction':_0x463389});});})[_0x5685('0x21')](function(){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x1f1a66[_0x5685('0x5a')]['id']},'order':_0x5685('0xa7')});});}})[_0x5685('0x21')](respondWithResult(_0x4471e3,null))[_0x5685('0x2a')](handleError(_0x4471e3,null));};exports[_0x5685('0x11f')]=function(_0x58f3cc,_0x543e09,_0x2c367a){var _0x3fc531={};var _0x442605={};var _0x397b27;var _0xa10b6;return db[_0x5685('0x56')][_0x5685('0x6d')]({'where':{'id':_0x58f3cc['params']['id']}})['then'](handleEntityNotFound(_0x543e09,null))[_0x5685('0x21')](function(_0x347532){if(_0x347532){_0x397b27=_0x347532;_0x442605[_0x5685('0x45')]=_[_0x5685('0x47')](db[_0x5685('0x11e')]['rawAttributes']);_0x442605[_0x5685('0x46')]=_['keys'](_0x58f3cc[_0x5685('0x46')]);_0x442605[_0x5685('0x4f')]=_[_0x5685('0x48')](_0x442605[_0x5685('0x45')],_0x442605['query']);_0x3fc531[_0x5685('0x49')]=_['intersection'](_0x442605[_0x5685('0x45')],qs[_0x5685('0x4a')](_0x58f3cc[_0x5685('0x46')]['fields']));_0x3fc531['attributes']=_0x3fc531['attributes'][_0x5685('0x4b')]?_0x3fc531['attributes']:_0x442605[_0x5685('0x45')];_0x3fc531['order']=qs[_0x5685('0x4e')](_0x58f3cc[_0x5685('0x46')][_0x5685('0x4e')]);_0x3fc531['where']=qs[_0x5685('0x4f')](_[_0x5685('0x50')](_0x58f3cc[_0x5685('0x46')],_0x442605[_0x5685('0x4f')]));if(_0x58f3cc[_0x5685('0x46')][_0x5685('0x51')]){_0x3fc531[_0x5685('0x52')]=_[_0x5685('0x53')](_0x3fc531[_0x5685('0x52')],{'$or':_[_0x5685('0x40')](_0x3fc531[_0x5685('0x49')],function(_0x8ecb13){var _0x1aae72={};_0x1aae72[_0x8ecb13]={'$like':'%'+_0x58f3cc[_0x5685('0x46')][_0x5685('0x51')]+'%'};return _0x1aae72;})});}_0x3fc531=_[_0x5685('0x53')]({},_0x3fc531,_0x58f3cc[_0x5685('0x55')]);return _0x397b27[_0x5685('0x11f')](_0x3fc531);}})['then'](function(_0x3b0f09){if(_0x3b0f09){_0xa10b6=_0x3b0f09[_0x5685('0x4b')];if(!_0x58f3cc[_0x5685('0x46')]['hasOwnProperty'](_0x5685('0x66'))){_0x3fc531[_0x5685('0x32')]=qs[_0x5685('0x32')](_0x58f3cc['query']['limit']);_0x3fc531['offset']=qs['offset'](_0x58f3cc['query']['offset']);}return _0x397b27[_0x5685('0x11f')](_0x3fc531);}})['then'](function(_0x421909){if(_0x421909){return _0x421909?{'count':_0xa10b6,'rows':_0x421909}:null;}})[_0x5685('0x21')](respondWithResult(_0x543e09,null))[_0x5685('0x2a')](handleError(_0x543e09,null));};exports[_0x5685('0x120')]=function(_0x4c47a0,_0x5a97ba,_0x9a3cb7){return db[_0x5685('0x121')][_0x5685('0x5b')]({'where':{'id':_0x4c47a0[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x5a97ba,null))['then'](function(_0x295ad4){if(_0x295ad4){return _0x295ad4['addProactiveActions'](_0x4c47a0['body'][_0x5685('0x70')],_[_0x5685('0xf8')](_0x4c47a0[_0x5685('0x5d')],[_0x5685('0x70'),'id'])||{});}})[_0x5685('0x21')](respondWithResult(_0x5a97ba,null))['catch'](handleError(_0x5a97ba,null));};exports[_0x5685('0x122')]=function(_0x5d1d5b,_0x13c707,_0x178bf9){var _0xe2baa5={};var _0x209647={};var _0x212950;var _0x1546ce;return db[_0x5685('0x56')][_0x5685('0x6d')]({'where':{'id':_0x5d1d5b[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x13c707,null))['then'](function(_0x58309c){if(_0x58309c){_0x212950=_0x58309c;_0x209647[_0x5685('0x45')]=_[_0x5685('0x47')](db['ChatProactiveAction'][_0x5685('0x41')]);_0x209647[_0x5685('0x46')]=_[_0x5685('0x47')](_0x5d1d5b[_0x5685('0x46')]);_0x209647[_0x5685('0x4f')]=_[_0x5685('0x48')](_0x209647['model'],_0x209647[_0x5685('0x46')]);_0xe2baa5[_0x5685('0x49')]=_['intersection'](_0x209647[_0x5685('0x45')],qs[_0x5685('0x4a')](_0x5d1d5b[_0x5685('0x46')][_0x5685('0x4a')]));_0xe2baa5[_0x5685('0x49')]=_0xe2baa5[_0x5685('0x49')]['length']?_0xe2baa5[_0x5685('0x49')]:_0x209647[_0x5685('0x45')];_0xe2baa5[_0x5685('0x4d')]=qs[_0x5685('0x4e')](_0x5d1d5b['query'][_0x5685('0x4e')]);_0xe2baa5['where']=qs[_0x5685('0x4f')](_[_0x5685('0x50')](_0x5d1d5b[_0x5685('0x46')],_0x209647[_0x5685('0x4f')]));if(_0x5d1d5b[_0x5685('0x46')][_0x5685('0x51')]){_0xe2baa5[_0x5685('0x52')]=_[_0x5685('0x53')](_0xe2baa5[_0x5685('0x52')],{'$or':_[_0x5685('0x40')](_0xe2baa5['attributes'],function(_0x5a8ff4){var _0x39d766={};_0x39d766[_0x5a8ff4]={'$like':'%'+_0x5d1d5b[_0x5685('0x46')][_0x5685('0x51')]+'%'};return _0x39d766;})});}_0xe2baa5=_[_0x5685('0x53')]({},_0xe2baa5,_0x5d1d5b[_0x5685('0x55')]);return _0x212950[_0x5685('0x122')](_0xe2baa5);}})['then'](function(_0xa5c28e){if(_0xa5c28e){_0x1546ce=_0xa5c28e[_0x5685('0x4b')];if(!_0x5d1d5b[_0x5685('0x46')][_0x5685('0x4c')](_0x5685('0x66'))){_0xe2baa5[_0x5685('0x32')]=qs[_0x5685('0x32')](_0x5d1d5b[_0x5685('0x46')][_0x5685('0x32')]);_0xe2baa5[_0x5685('0x2f')]=qs[_0x5685('0x2f')](_0x5d1d5b['query'][_0x5685('0x2f')]);}return _0x212950[_0x5685('0x122')](_0xe2baa5);}})[_0x5685('0x21')](function(_0xcf7a48){if(_0xcf7a48){return _0xcf7a48?{'count':_0x1546ce,'rows':_0xcf7a48}:null;}})[_0x5685('0x21')](respondWithResult(_0x13c707,null))['catch'](handleError(_0x13c707,null));};exports[_0x5685('0x123')]=function(_0xf6b1dc,_0x52b585,_0x409a0e){var _0x5a1409=_0xf6b1dc['query'][_0x5685('0x124')]===_0x5685('0x125')?_0x5685('0x126'):_0x5685('0x127');return db[_0x5685('0x56')][_0x5685('0x5b')]({'attributes':['id',_0x5a1409],'where':{'id':_0xf6b1dc['params']['id']}})['then'](handleEntityNotFound(_0x52b585,null))[_0x5685('0x21')](function(_0x136432){if(_0x136432){var _0x19fe2a=_0x136432[_0x5a1409];var _0x44b250=_0x19fe2a&&_0x19fe2a[_0x5685('0x128')]?_0x19fe2a[_0x5685('0x128')]:[];_0x52b585[_0x5685('0x3c')]({'fromKey':_[_0x5685('0x7d')](_0x19fe2a[_0x5685('0x129')])?undefined:_0x19fe2a[_0x5685('0x129')],'count':_0x44b250[_0x5685('0x4b')],'rows':_0x44b250});}})[_0x5685('0x2a')](handleError(_0x52b585,null));};exports['getOfflineMessages']=function(_0x16bb1e,_0x7174b3,_0x373250){var _0x42e1a6={'raw':![],'where':{}};var _0x31579c={};var _0x5bae19={'count':0x0,'rows':[]};return db[_0x5685('0x56')]['findOne']({'where':{'id':_0x16bb1e['params']['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x7174b3,null))['then'](function(_0x19f549){if(_0x19f549){_0x31579c[_0x5685('0x45')]=_[_0x5685('0x47')](db[_0x5685('0xd7')][_0x5685('0x41')]);_0x31579c[_0x5685('0x46')]=_[_0x5685('0x47')](_0x16bb1e[_0x5685('0x46')]);_0x31579c[_0x5685('0x4f')]=_[_0x5685('0x48')](_0x31579c[_0x5685('0x45')],_0x31579c[_0x5685('0x46')]);_0x42e1a6[_0x5685('0x49')]=_[_0x5685('0x48')](_0x31579c[_0x5685('0x45')],qs[_0x5685('0x4a')](_0x16bb1e['query'][_0x5685('0x4a')]));_0x42e1a6[_0x5685('0x49')]=_0x42e1a6[_0x5685('0x49')][_0x5685('0x4b')]?_0x42e1a6['attributes']:_0x31579c[_0x5685('0x45')];if(!_0x16bb1e[_0x5685('0x46')]['hasOwnProperty'](_0x5685('0x66'))){_0x42e1a6[_0x5685('0x32')]=qs[_0x5685('0x32')](_0x16bb1e[_0x5685('0x46')][_0x5685('0x32')]);_0x42e1a6[_0x5685('0x2f')]=qs['offset'](_0x16bb1e[_0x5685('0x46')][_0x5685('0x2f')]);}_0x42e1a6[_0x5685('0x4d')]=qs[_0x5685('0x4e')](_0x16bb1e[_0x5685('0x46')]['sort']);_0x42e1a6[_0x5685('0x52')]=qs[_0x5685('0x4f')](_[_0x5685('0x50')](_0x16bb1e[_0x5685('0x46')],_0x31579c[_0x5685('0x4f')]));_0x42e1a6['where'][_0x5685('0x67')]=_0x19f549['id'];if(_0x16bb1e['query'][_0x5685('0x51')]){_0x42e1a6[_0x5685('0x52')]=_[_0x5685('0x53')](_0x42e1a6[_0x5685('0x52')],{'$or':_[_0x5685('0x40')](_0x42e1a6[_0x5685('0x49')],function(_0x53dc07){var _0x493a56={};_0x493a56[_0x53dc07]={'$like':'%'+_0x16bb1e[_0x5685('0x46')][_0x5685('0x51')]+'%'};return _0x493a56;})});}_0x42e1a6=_[_0x5685('0x53')]({},_0x42e1a6,_0x16bb1e[_0x5685('0x55')]);return db['ChatOfflineMessage'][_0x5685('0x31')]({'where':_0x42e1a6['where']})[_0x5685('0x21')](function(_0x5559ac){_0x5bae19[_0x5685('0x31')]=_0x5559ac;if(_0x16bb1e[_0x5685('0x46')]['includeAll']){_0x42e1a6['include']=[{'all':!![]}];}else{_0x42e1a6[_0x5685('0x58')]=[{'model':db['CmContact'],'as':_0x5685('0xfa'),'required':![]},{'model':db[_0x5685('0xdf')],'as':_0x5685('0x12a'),'required':![]}];}return db[_0x5685('0xd7')][_0x5685('0x69')](_0x42e1a6);})[_0x5685('0x21')](function(_0x4b5b1a){_0x5bae19[_0x5685('0x59')]=_0x4b5b1a;return _0x5bae19;});}})['then'](respondWithFilteredResult(_0x7174b3,_0x42e1a6))[_0x5685('0x2a')](handleError(_0x7174b3,null));};exports[_0x5685('0x12b')]=function(_0x2e2ba8,_0x19bb40,_0x1bd9e8){return db[_0x5685('0x56')]['find']({'where':{'id':_0x2e2ba8[_0x5685('0x5a')]['id']}})['then'](handleEntityNotFound(_0x19bb40,null))['then'](function(_0x74e48d){if(_0x74e48d){return _0x74e48d[_0x5685('0x12b')](_0x2e2ba8[_0x5685('0x5d')]['ids'],_[_0x5685('0xf8')](_0x2e2ba8[_0x5685('0x5d')],[_0x5685('0x70'),'id'])||{})[_0x5685('0xd2')](function(_0x41a852){for(var _0x48c1b1=0x0;_0x48c1b1<_0x2e2ba8[_0x5685('0x5d')][_0x5685('0x70')]['length'];_0x48c1b1+=0x1){socket[_0x5685('0x12c')]('userChatWebsite:save',{'UserId':Number(_0x2e2ba8['body'][_0x5685('0x70')][_0x48c1b1]),'ChatWebsiteId':Number(_0x2e2ba8[_0x5685('0x5a')]['id'])});}return _0x41a852;});}})[_0x5685('0x21')](respondWithResult(_0x19bb40,null))[_0x5685('0x2a')](handleError(_0x19bb40,null));};exports[_0x5685('0x12d')]=function(_0x525bb9,_0x30d950,_0x3c6be0){return db[_0x5685('0x56')]['find']({'where':{'id':_0x525bb9['params']['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x30d950,null))[_0x5685('0x21')](function(_0x5b6c2c){if(_0x5b6c2c){return _0x5b6c2c[_0x5685('0x12d')](_0x525bb9['query'][_0x5685('0x70')])['then'](function(){if(_[_0x5685('0x12e')](_0x525bb9[_0x5685('0x46')][_0x5685('0x70')])){for(var _0x2e0fc2=0x0;_0x2e0fc2<_0x525bb9[_0x5685('0x46')][_0x5685('0x70')][_0x5685('0x4b')];_0x2e0fc2+=0x1){socket[_0x5685('0x12c')]('userChatWebsite:remove',{'UserId':Number(_0x525bb9[_0x5685('0x46')][_0x5685('0x70')][_0x2e0fc2]),'ChatWebsiteId':Number(_0x525bb9[_0x5685('0x5a')]['id'])});}}else{socket[_0x5685('0x12c')](_0x5685('0x12f'),{'UserId':Number(_0x525bb9[_0x5685('0x46')][_0x5685('0x70')]),'ChatWebsiteId':Number(_0x525bb9[_0x5685('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x30d950,null))['catch'](handleError(_0x30d950,null));};exports[_0x5685('0x130')]=function(_0x2336a2,_0x34f4c2,_0x138908){var _0x45690f={};var _0x2caefc={};var _0x2f3888;var _0x252b65;return db['ChatWebsite'][_0x5685('0x6d')]({'where':{'id':_0x2336a2[_0x5685('0x5a')]['id']}})[_0x5685('0x21')](handleEntityNotFound(_0x34f4c2,null))[_0x5685('0x21')](function(_0x4a5a47){if(_0x4a5a47){_0x2f3888=_0x4a5a47;_0x2caefc[_0x5685('0x45')]=_[_0x5685('0x47')](db['User'][_0x5685('0x41')]);_0x2caefc[_0x5685('0x46')]=_[_0x5685('0x47')](_0x2336a2['query']);_0x2caefc[_0x5685('0x4f')]=_[_0x5685('0x48')](_0x2caefc['model'],_0x2caefc[_0x5685('0x46')]);_0x45690f[_0x5685('0x49')]=_[_0x5685('0x48')](_0x2caefc[_0x5685('0x45')],qs[_0x5685('0x4a')](_0x2336a2[_0x5685('0x46')][_0x5685('0x4a')]));_0x45690f[_0x5685('0x49')]=_0x45690f[_0x5685('0x49')]['length']?_0x45690f[_0x5685('0x49')]:_0x2caefc[_0x5685('0x45')];_0x45690f[_0x5685('0x4d')]=qs['sort'](_0x2336a2['query']['sort']);_0x45690f[_0x5685('0x52')]=qs[_0x5685('0x4f')](_[_0x5685('0x50')](_0x2336a2[_0x5685('0x46')],_0x2caefc['filters']));if(_0x2336a2[_0x5685('0x46')][_0x5685('0x51')]){_0x45690f[_0x5685('0x52')]=_[_0x5685('0x53')](_0x45690f[_0x5685('0x52')],{'$or':_[_0x5685('0x40')](_0x45690f['attributes'],function(_0x56c346){var _0xc138eb={};_0xc138eb[_0x56c346]={'$like':'%'+_0x2336a2[_0x5685('0x46')]['filter']+'%'};return _0xc138eb;})});}_0x45690f=_['merge']({},_0x45690f,_0x2336a2[_0x5685('0x55')]);return _0x2f3888[_0x5685('0x130')](_0x45690f);}})['then'](function(_0x373ebb){if(_0x373ebb){_0x252b65=_0x373ebb[_0x5685('0x4b')];if(!_0x2336a2[_0x5685('0x46')][_0x5685('0x4c')]('nolimit')){_0x45690f[_0x5685('0x32')]=qs[_0x5685('0x32')](_0x2336a2[_0x5685('0x46')]['limit']);_0x45690f[_0x5685('0x2f')]=qs['offset'](_0x2336a2[_0x5685('0x46')][_0x5685('0x2f')]);}return _0x2f3888[_0x5685('0x130')](_0x45690f);}})[_0x5685('0x21')](function(_0x488990){if(_0x488990){return _0x488990?{'count':_0x252b65,'rows':_0x488990}:null;}})[_0x5685('0x21')](respondWithResult(_0x34f4c2,null))[_0x5685('0x2a')](handleError(_0x34f4c2,null));};
\ No newline at end of file
+var _0x501e=['spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','ListId','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','ChatOfflineMessage','mimetype','files','attachments','offline-chat','openNewInteraction','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','mapValues','Chat','NotifyMailAccount','server','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','info','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','increment','chatLicenseExceeded','all','some','remote','x-real-ip','connection','remoteAddress','virtual','replace','render','alignment','textColor','color_button','backgroundColor','addApplications','sequelize','transaction','findAndCountAll','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','false','offlineForm','onlineForm','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatWebsite.socket','register','client','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','get','ChatWebsites','UserProfileResource','destroy','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','show','params','keys','fields','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','describe','ChatWebsiteId','findOne','Disposition','pick','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','getLicense','custom','isNil','root','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','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','List','Contacts','DESC','ChatApplication','applications','Applications','list','orderBy','priority','asc','account','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x501e,0x1a7));var _0xe501=function(_0x3fbe61,_0x17093b){_0x3fbe61=_0x3fbe61-0x0;var _0x3450b3=_0x501e[_0x3fbe61];return _0x3450b3;};'use strict';var emlformat=require(_0xe501('0x0'));var rimraf=require(_0xe501('0x1'));var zipdir=require(_0xe501('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe501('0x3'));var BPromise=require(_0xe501('0x4'));var Mustache=require(_0xe501('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe501('0x6'));var csv=require('to-csv');var ejs=require(_0xe501('0x7'));var fs=require('fs');var fs_extra=require(_0xe501('0x8'));var _=require(_0xe501('0x9'));var squel=require(_0xe501('0xa'));var crypto=require(_0xe501('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe501('0xc'));var toCsv=require(_0xe501('0xd'));var querystring=require(_0xe501('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe501('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe501('0x10'))('api');var utils=require(_0xe501('0x11'));var config=require(_0xe501('0x12'));var licenseUtil=require(_0xe501('0x13'));var db=require('../../mysqldb')['db'];config[_0xe501('0x14')]=_['defaults'](config[_0xe501('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xe501('0x15'))(new Redis(config[_0xe501('0x14')]));require(_0xe501('0x16'))[_0xe501('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe501('0x18')]['http']({'port':0x232c});var client9002=jayson[_0xe501('0x18')]['http']({'port':0x232a});var client9003=jayson[_0xe501('0x18')]['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x59d932,_0x5e0153,_0x581dda,_0x351e0b){return new BPromise(function(_0x1e603f,_0x1f9c16){var _0x5347ab=_0x351e0b||client;return _0x5347ab['request'](_0x59d932,_0x581dda)['then'](function(_0x1fbe17){logger['info'](_0xe501('0x19'),_0x5e0153,_0xe501('0x1a'));logger[_0xe501('0x1b')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5e0153,_0xe501('0x1a'),JSON[_0xe501('0x1c')](_0x1fbe17));if(_0x1fbe17['error']){if(_0x1fbe17['error'][_0xe501('0x1d')]===0x1f4){logger[_0xe501('0x1e')](_0xe501('0x19'),_0x5e0153,_0x1fbe17['error']['message']);return _0x1f9c16(_0x1fbe17['error'][_0xe501('0x1f')]);}logger[_0xe501('0x1e')](_0xe501('0x19'),_0x5e0153,_0x1fbe17[_0xe501('0x1e')][_0xe501('0x1f')]);return _0x1e603f(_0x1fbe17['error'][_0xe501('0x1f')]);}else{logger['info'](_0xe501('0x19'),_0x5e0153,'request\x20sent');_0x1e603f(_0x1fbe17['result'][_0xe501('0x1f')]);}})['catch'](function(_0x41df82){logger[_0xe501('0x1e')](_0xe501('0x19'),_0x5e0153,_0x41df82);_0x1f9c16(_0x41df82);});});}function respondWithStatusCode(_0x2592f9,_0x7310d0){_0x7310d0=_0x7310d0||0xcc;return function(_0x51aad5){if(_0x51aad5){return _0x2592f9['sendStatus'](_0x7310d0);}return _0x2592f9[_0xe501('0x20')](_0x7310d0)[_0xe501('0x21')]();};}function respondWithResult(_0x22f81e,_0x23c98e){_0x23c98e=_0x23c98e||0xc8;return function(_0x1cb53f){if(_0x1cb53f){return _0x22f81e['status'](_0x23c98e)[_0xe501('0x22')](_0x1cb53f);}};}function respondWithFilteredResult(_0x44225b,_0x5d95dd){return function(_0x2d3b85){if(_0x2d3b85){var _0x4100dc=typeof _0x5d95dd[_0xe501('0x23')]===_0xe501('0x24')&&typeof _0x5d95dd['limit']==='undefined';var _0x48be4a=_0x2d3b85[_0xe501('0x25')];var _0x24b75c=_0x4100dc?0x0:_0x5d95dd[_0xe501('0x23')];var _0x5060db=_0x4100dc?_0x2d3b85[_0xe501('0x25')]:_0x5d95dd[_0xe501('0x23')]+_0x5d95dd[_0xe501('0x26')];var _0x4520d3;if(_0x5060db>=_0x48be4a){_0x5060db=_0x48be4a;_0x4520d3=0xc8;}else{_0x4520d3=0xce;}_0x44225b[_0xe501('0x20')](_0x4520d3);return _0x44225b[_0xe501('0x27')]('Content-Range',_0x24b75c+'-'+_0x5060db+'/'+_0x48be4a)['json'](_0x2d3b85);}return null;};}function patchUpdates(_0x22b511){return function(_0x40b9b3){try{jsonpatch[_0xe501('0x28')](_0x40b9b3,_0x22b511,!![]);}catch(_0x32a103){return BPromise[_0xe501('0x29')](_0x32a103);}return _0x40b9b3[_0xe501('0x2a')]();};}function saveUpdates(_0x54cca2,_0x498c44){return function(_0x589d37){if(_0x589d37){return _0x589d37[_0xe501('0x2b')](_0x54cca2)[_0xe501('0x2c')](function(_0x4dbe14){return _0x4dbe14;});}return null;};}function removeEntity(_0x515182,_0x36143d){return function(_0x3c1379){if(_0x3c1379){return _0x3c1379['destroy']()[_0xe501('0x2c')](function(){var _0x1cbb74=_0x3c1379[_0xe501('0x2d')]({'plain':!![]});var _0x193a74=_0xe501('0x2e');return db[_0xe501('0x2f')][_0xe501('0x30')]({'where':{'type':_0x193a74,'resourceId':_0x1cbb74['id']}})[_0xe501('0x2c')](function(){return _0x3c1379;});})[_0xe501('0x2c')](function(){_0x515182[_0xe501('0x20')](0xcc)[_0xe501('0x21')]();});}};}function handleEntityNotFound(_0x9316c2,_0x590198){return function(_0x48088c){if(!_0x48088c){_0x9316c2[_0xe501('0x31')](0x194);}return _0x48088c;};}function handleError(_0x1a8e53,_0x2120fa){_0x2120fa=_0x2120fa||0x1f4;return function(_0x2f2e08){logger['error'](_0x2f2e08[_0xe501('0x32')]);if(_0x2f2e08['name']){delete _0x2f2e08[_0xe501('0x33')];}_0x1a8e53[_0xe501('0x20')](_0x2120fa)['send'](_0x2f2e08);};}exports[_0xe501('0x34')]=function(_0x4c6906,_0x5a7f00){var _0xd7931c={'include':[{'model':db[_0xe501('0x35')],'as':_0xe501('0x36')}]},_0x646e18={},_0xbae3={'count':0x0,'rows':[]};var _0x1dbbc5=_['map'](db[_0xe501('0x37')][_0xe501('0x38')],function(_0x261376){return{'name':_0x261376['fieldName'],'type':_0x261376[_0xe501('0x39')][_0xe501('0x3a')]};});_0x646e18[_0xe501('0x3b')]=_[_0xe501('0x3c')](_0x1dbbc5,_0xe501('0x33'));_0x646e18[_0xe501('0x3d')]=_['keys'](_0x4c6906[_0xe501('0x3d')]);_0x646e18[_0xe501('0x3e')]=_[_0xe501('0x3f')](_0x646e18['model'],_0x646e18[_0xe501('0x3d')]);_0xd7931c['attributes']=_[_0xe501('0x3f')](_0x646e18[_0xe501('0x3b')],qs['fields'](_0x4c6906[_0xe501('0x3d')]['fields']));_0xd7931c[_0xe501('0x40')]=_0xd7931c[_0xe501('0x40')][_0xe501('0x41')]?_0xd7931c['attributes']:_0x646e18[_0xe501('0x3b')];if(!_0x4c6906[_0xe501('0x3d')][_0xe501('0x42')]('nolimit')){_0xd7931c[_0xe501('0x26')]=qs[_0xe501('0x26')](_0x4c6906[_0xe501('0x3d')][_0xe501('0x26')]);_0xd7931c[_0xe501('0x23')]=qs[_0xe501('0x23')](_0x4c6906[_0xe501('0x3d')]['offset']);}_0xd7931c[_0xe501('0x43')]=qs[_0xe501('0x44')](_0x4c6906[_0xe501('0x3d')]['sort']);_0xd7931c[_0xe501('0x45')]=qs[_0xe501('0x3e')](_['pick'](_0x4c6906[_0xe501('0x3d')],_0x646e18[_0xe501('0x3e')]),_0x1dbbc5);if(_0x4c6906[_0xe501('0x3d')][_0xe501('0x46')]){_0xd7931c[_0xe501('0x45')]=_[_0xe501('0x47')](_0xd7931c['where'],{'$or':_[_0xe501('0x3c')](_0x1dbbc5,function(_0x323675){if(_0x323675[_0xe501('0x39')]!==_0xe501('0x48')){var _0x1f842b={};_0x1f842b[_0x323675[_0xe501('0x33')]]={'$like':'%'+_0x4c6906[_0xe501('0x3d')][_0xe501('0x46')]+'%'};return _0x1f842b;}})});}_0xd7931c=_['merge']({},_0xd7931c,_0x4c6906[_0xe501('0x49')]);var _0x1f6072={'where':_0xd7931c[_0xe501('0x45')]};return db[_0xe501('0x37')]['count'](_0x1f6072)[_0xe501('0x2c')](function(_0x9c3b1c){_0xbae3[_0xe501('0x25')]=_0x9c3b1c;if(_0x4c6906[_0xe501('0x3d')][_0xe501('0x4a')]){_0xd7931c[_0xe501('0x4b')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0xd7931c);})['then'](function(_0x49dba3){_0xbae3['rows']=_0x49dba3;return _0xbae3;})['then'](respondWithFilteredResult(_0x5a7f00,_0xd7931c))['catch'](handleError(_0x5a7f00,null));};exports[_0xe501('0x4c')]=function(_0x44290a,_0x11e33d){var _0x104ef3={'raw':![],'where':{'id':_0x44290a[_0xe501('0x4d')]['id']},'include':[{'model':db[_0xe501('0x35')],'as':_0xe501('0x36')}]},_0x5ac55a={};_0x5ac55a['model']=_[_0xe501('0x4e')](db['ChatWebsite']['rawAttributes']);_0x5ac55a[_0xe501('0x3d')]=_['keys'](_0x44290a[_0xe501('0x3d')]);_0x5ac55a['filters']=_['intersection'](_0x5ac55a[_0xe501('0x3b')],_0x5ac55a[_0xe501('0x3d')]);_0x104ef3[_0xe501('0x40')]=_[_0xe501('0x3f')](_0x5ac55a[_0xe501('0x3b')],qs[_0xe501('0x4f')](_0x44290a[_0xe501('0x3d')][_0xe501('0x4f')]));_0x104ef3[_0xe501('0x40')]=_0x104ef3[_0xe501('0x40')][_0xe501('0x41')]?_0x104ef3['attributes']:_0x5ac55a[_0xe501('0x3b')];if(_0x44290a['query'][_0xe501('0x4a')]){_0x104ef3[_0xe501('0x4b')]=[{'all':!![]}];}_0x104ef3=_[_0xe501('0x47')]({},_0x104ef3,_0x44290a[_0xe501('0x49')]);return db[_0xe501('0x37')]['find'](_0x104ef3)[_0xe501('0x2c')](handleEntityNotFound(_0x11e33d,null))[_0xe501('0x2c')](respondWithResult(_0x11e33d,null))[_0xe501('0x50')](handleError(_0x11e33d,null));};exports['create']=function(_0x244e9b,_0x5caeea){return db[_0xe501('0x37')][_0xe501('0x51')](_0x244e9b[_0xe501('0x52')],{})[_0xe501('0x2c')](function(_0x4488fc){var _0x2086c1=_0x244e9b[_0xe501('0x53')][_0xe501('0x2d')]({'plain':!![]});if(!_0x2086c1)throw new Error(_0xe501('0x54'));if(_0x2086c1[_0xe501('0x55')]==='user'){var _0x4bb65a=_0x4488fc['get']({'plain':!![]});var _0x2ced18=_0xe501('0x2e');return db['UserProfileSection'][_0xe501('0x56')]({'where':{'name':_0x2ced18,'userProfileId':_0x2086c1[_0xe501('0x57')]},'raw':!![]})[_0xe501('0x2c')](function(_0x5505ee){if(_0x5505ee&&_0x5505ee[_0xe501('0x58')]===0x0){return db[_0xe501('0x2f')][_0xe501('0x51')]({'name':_0x4bb65a[_0xe501('0x33')],'resourceId':_0x4bb65a['id'],'type':_0x5505ee[_0xe501('0x33')],'sectionId':_0x5505ee['id']},{})[_0xe501('0x2c')](function(){return _0x4488fc;});}else{return _0x4488fc;}})[_0xe501('0x50')](function(_0x2d799e){logger[_0xe501('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d799e);throw _0x2d799e;});}return _0x4488fc;})[_0xe501('0x2c')](respondWithResult(_0x5caeea,0xc9))[_0xe501('0x50')](handleError(_0x5caeea,null));};exports[_0xe501('0x2b')]=function(_0x5ae9ee,_0x47d4f3){if(_0x5ae9ee[_0xe501('0x52')]['id']){delete _0x5ae9ee['body']['id'];}return db[_0xe501('0x37')]['find']({'where':{'id':_0x5ae9ee['params']['id']},'include':[{'model':db[_0xe501('0x35')],'as':_0xe501('0x36')}]})[_0xe501('0x2c')](handleEntityNotFound(_0x47d4f3,null))[_0xe501('0x2c')](saveUpdates(_0x5ae9ee[_0xe501('0x52')],null))[_0xe501('0x2c')](respondWithResult(_0x47d4f3,null))['catch'](handleError(_0x47d4f3,null));};exports[_0xe501('0x30')]=function(_0x47400a,_0x14fb5a){return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x47400a['params']['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x14fb5a,null))[_0xe501('0x2c')](removeEntity(_0x14fb5a,null))['catch'](handleError(_0x14fb5a,null));};exports['describe']=function(_0x21231e,_0x497755){return db['ChatWebsite'][_0xe501('0x59')]()[_0xe501('0x2c')](respondWithResult(_0x497755,null))[_0xe501('0x50')](handleError(_0x497755,null));};exports['addDisposition']=function(_0x40a457,_0x339960,_0x11c3e3){if(_0x40a457[_0xe501('0x52')]['id']){delete _0x40a457[_0xe501('0x52')]['id'];}return db['ChatWebsite'][_0xe501('0x56')]({'where':{'id':_0x40a457[_0xe501('0x4d')]['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x339960,null))['then'](function(_0x56500e){if(_0x56500e){_0x40a457['body'][_0xe501('0x5a')]=_0x56500e['id'];return db['Disposition'][_0xe501('0x51')](_0x40a457['body']);}})[_0xe501('0x2c')](respondWithResult(_0x339960,null))[_0xe501('0x50')](handleError(_0x339960,null));};exports['getDispositions']=function(_0x100d31,_0x3096e7,_0x237085){var _0x4698a2={'raw':![],'where':{}};var _0x48da30={};var _0x95193={'count':0x0,'rows':[]};return db[_0xe501('0x37')][_0xe501('0x5b')]({'where':{'id':_0x100d31['params']['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x3096e7,null))[_0xe501('0x2c')](function(_0x5caa85){if(_0x5caa85){_0x48da30[_0xe501('0x3b')]=_[_0xe501('0x4e')](db[_0xe501('0x5c')][_0xe501('0x38')]);_0x48da30[_0xe501('0x3d')]=_['keys'](_0x100d31[_0xe501('0x3d')]);_0x48da30['filters']=_[_0xe501('0x3f')](_0x48da30[_0xe501('0x3b')],_0x48da30[_0xe501('0x3d')]);_0x4698a2[_0xe501('0x40')]=_['intersection'](_0x48da30['model'],qs[_0xe501('0x4f')](_0x100d31[_0xe501('0x3d')]['fields']));_0x4698a2['attributes']=_0x4698a2[_0xe501('0x40')][_0xe501('0x41')]?_0x4698a2[_0xe501('0x40')]:_0x48da30[_0xe501('0x3b')];if(!_0x100d31[_0xe501('0x3d')][_0xe501('0x42')]('nolimit')){_0x4698a2[_0xe501('0x26')]=qs[_0xe501('0x26')](_0x100d31['query']['limit']);_0x4698a2[_0xe501('0x23')]=qs['offset'](_0x100d31['query'][_0xe501('0x23')]);}_0x4698a2['order']=qs[_0xe501('0x44')](_0x100d31[_0xe501('0x3d')][_0xe501('0x44')]);_0x4698a2['where']=qs[_0xe501('0x3e')](_[_0xe501('0x5d')](_0x100d31[_0xe501('0x3d')],_0x48da30[_0xe501('0x3e')]));_0x4698a2[_0xe501('0x45')]['ChatWebsiteId']=_0x5caa85['id'];if(_0x100d31['query'][_0xe501('0x46')]){_0x4698a2[_0xe501('0x45')]=_[_0xe501('0x47')](_0x4698a2['where'],{'$or':_[_0xe501('0x3c')](_0x4698a2[_0xe501('0x40')],function(_0x26eeb3){var _0x3040fb={};_0x3040fb[_0x26eeb3]={'$like':'%'+_0x100d31[_0xe501('0x3d')][_0xe501('0x46')]+'%'};return _0x3040fb;})});}_0x4698a2=_[_0xe501('0x47')]({},_0x4698a2,_0x100d31['options']);return db['Disposition'][_0xe501('0x25')]({'where':_0x4698a2[_0xe501('0x45')]})[_0xe501('0x2c')](function(_0x41e385){_0x95193[_0xe501('0x25')]=_0x41e385;if(_0x100d31[_0xe501('0x3d')][_0xe501('0x4a')]){_0x4698a2['include']=[{'all':!![]}];}return db[_0xe501('0x5c')][_0xe501('0x5e')](_0x4698a2);})['then'](function(_0x1fb0c5){_0x95193[_0xe501('0x5f')]=_0x1fb0c5;return _0x95193;});}})['then'](respondWithFilteredResult(_0x3096e7,_0x4698a2))[_0xe501('0x50')](handleError(_0x3096e7,null));};exports[_0xe501('0x60')]=function(_0x268935,_0x3758f6,_0x297932){return db['ChatWebsite'][_0xe501('0x56')]({'where':{'id':_0x268935[_0xe501('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3758f6,null))['then'](function(_0x4b3d80){if(_0x4b3d80){return _0x4b3d80[_0xe501('0x60')](_0x268935[_0xe501('0x3d')][_0xe501('0x61')]);}})[_0xe501('0x2c')](respondWithStatusCode(_0x3758f6,null))[_0xe501('0x50')](handleError(_0x3758f6,null));};exports[_0xe501('0x62')]=function(_0x3ad7a0,_0x5d8000,_0xbd5cc){if(_0x3ad7a0['body']['id']){delete _0x3ad7a0[_0xe501('0x52')]['id'];}return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x3ad7a0[_0xe501('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5d8000,null))[_0xe501('0x2c')](function(_0x30f46a){if(_0x30f46a){_0x3ad7a0[_0xe501('0x52')][_0xe501('0x5a')]=_0x30f46a['id'];return db[_0xe501('0x63')][_0xe501('0x51')](_0x3ad7a0['body']);}})[_0xe501('0x2c')](respondWithResult(_0x5d8000,null))[_0xe501('0x50')](handleError(_0x5d8000,null));};exports[_0xe501('0x64')]=function(_0x427d70,_0x187cea,_0x2bbd9c){var _0x28cf58={'raw':![],'where':{}};var _0x468565={};var _0x5ddd33={'count':0x0,'rows':[]};return db[_0xe501('0x37')][_0xe501('0x5b')]({'where':{'id':_0x427d70[_0xe501('0x4d')]['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x187cea,null))[_0xe501('0x2c')](function(_0x3d0d4b){if(_0x3d0d4b){_0x468565[_0xe501('0x3b')]=_[_0xe501('0x4e')](db['CannedAnswer'][_0xe501('0x38')]);_0x468565[_0xe501('0x3d')]=_['keys'](_0x427d70[_0xe501('0x3d')]);_0x468565[_0xe501('0x3e')]=_['intersection'](_0x468565[_0xe501('0x3b')],_0x468565['query']);_0x28cf58[_0xe501('0x40')]=_['intersection'](_0x468565['model'],qs['fields'](_0x427d70[_0xe501('0x3d')][_0xe501('0x4f')]));_0x28cf58[_0xe501('0x40')]=_0x28cf58[_0xe501('0x40')]['length']?_0x28cf58[_0xe501('0x40')]:_0x468565['model'];if(!_0x427d70[_0xe501('0x3d')][_0xe501('0x42')](_0xe501('0x65'))){_0x28cf58[_0xe501('0x26')]=qs['limit'](_0x427d70[_0xe501('0x3d')][_0xe501('0x26')]);_0x28cf58['offset']=qs['offset'](_0x427d70[_0xe501('0x3d')][_0xe501('0x23')]);}_0x28cf58[_0xe501('0x43')]=qs['sort'](_0x427d70[_0xe501('0x3d')][_0xe501('0x44')]);_0x28cf58[_0xe501('0x45')]=qs[_0xe501('0x3e')](_[_0xe501('0x5d')](_0x427d70[_0xe501('0x3d')],_0x468565[_0xe501('0x3e')]));_0x28cf58[_0xe501('0x45')][_0xe501('0x5a')]=_0x3d0d4b['id'];if(_0x427d70[_0xe501('0x3d')][_0xe501('0x46')]){_0x28cf58['where']=_[_0xe501('0x47')](_0x28cf58['where'],{'$or':_[_0xe501('0x3c')](_0x28cf58[_0xe501('0x40')],function(_0x525392){var _0x34926a={};_0x34926a[_0x525392]={'$like':'%'+_0x427d70[_0xe501('0x3d')]['filter']+'%'};return _0x34926a;})});}_0x28cf58=_['merge']({},_0x28cf58,_0x427d70[_0xe501('0x49')]);return db['CannedAnswer'][_0xe501('0x25')]({'where':_0x28cf58[_0xe501('0x45')]})[_0xe501('0x2c')](function(_0x2bbc5d){_0x5ddd33[_0xe501('0x25')]=_0x2bbc5d;if(_0x427d70[_0xe501('0x3d')][_0xe501('0x4a')]){_0x28cf58[_0xe501('0x4b')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe501('0x5e')](_0x28cf58);})['then'](function(_0x74c3fd){_0x5ddd33['rows']=_0x74c3fd;return _0x5ddd33;});}})[_0xe501('0x2c')](respondWithFilteredResult(_0x187cea,_0x28cf58))[_0xe501('0x50')](handleError(_0x187cea,null));};exports[_0xe501('0x66')]=function(_0x385b50,_0x130dee,_0x43e2e8){return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x385b50[_0xe501('0x4d')]['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x130dee,null))[_0xe501('0x2c')](function(_0x4c4874){if(_0x4c4874){return _0x4c4874[_0xe501('0x66')](_0x385b50[_0xe501('0x3d')][_0xe501('0x61')]);}})['then'](respondWithStatusCode(_0x130dee,null))[_0xe501('0x50')](handleError(_0x130dee,null));};exports[_0xe501('0x67')]=function(_0x2817b6,_0x364f90,_0xba423d){_0x2817b6[_0xe501('0x52')][_0xe501('0x68')]=_0x2817b6[_0xe501('0x69')][_0xe501('0x6a')];return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x2817b6[_0xe501('0x4d')]['id']}})['then'](handleEntityNotFound(_0x364f90,null))['then'](saveUpdates(_0x2817b6['body'],null))[_0xe501('0x2c')](respondWithResult(_0x364f90,null))[_0xe501('0x50')](handleError(_0x364f90,null));};exports[_0xe501('0x6b')]=function(_0x14cf38,_0x1b3e4e,_0x5a5e22){_0x14cf38['body'][_0xe501('0x6c')]=_0x14cf38['file']['filename'];return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x14cf38[_0xe501('0x4d')]['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x1b3e4e,null))[_0xe501('0x2c')](saveUpdates(_0x14cf38[_0xe501('0x52')],null))['then'](respondWithResult(_0x1b3e4e,null))[_0xe501('0x50')](handleError(_0x1b3e4e,null));};exports[_0xe501('0x6d')]=function(_0x4f3b4d,_0x345d53,_0x480275){_0x4f3b4d[_0xe501('0x52')][_0xe501('0x6e')]=_0x4f3b4d[_0xe501('0x69')][_0xe501('0x6a')];return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x4f3b4d[_0xe501('0x4d')]['id']}})['then'](handleEntityNotFound(_0x345d53,null))['then'](saveUpdates(_0x4f3b4d[_0xe501('0x52')],null))[_0xe501('0x2c')](respondWithResult(_0x345d53,null))[_0xe501('0x50')](handleError(_0x345d53,null));};exports[_0xe501('0x6f')]=function(_0x48c801,_0x291ccf,_0x58edde){_0x48c801[_0xe501('0x52')][_0xe501('0x70')]=_0x48c801[_0xe501('0x69')][_0xe501('0x6a')];return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x48c801[_0xe501('0x4d')]['id']}})['then'](handleEntityNotFound(_0x291ccf,null))[_0xe501('0x2c')](saveUpdates(_0x48c801[_0xe501('0x52')],null))[_0xe501('0x2c')](respondWithResult(_0x291ccf,null))[_0xe501('0x50')](handleError(_0x291ccf,null));};exports[_0xe501('0x71')]=function(_0x2dd7c9,_0xa4e72d,_0x1ddab2){var _0x28f5d8=path[_0xe501('0x72')](config['root'],'server/files/images/logos/default_logo.svg');var _0x1e2088={'where':{'id':_0x2dd7c9[_0xe501('0x4d')]['id']},'attributes':['id',_0xe501('0x68')],'raw':!![]};var _0x3e3f88=![];return require(_0xe501('0x13'))[_0xe501('0x73')]()[_0xe501('0x2c')](function(_0x358b11){if(_0x358b11){_0x3e3f88=_0x358b11[_0xe501('0x74')];}})[_0xe501('0x2c')](function(){return db['ChatWebsite']['find'](_0x1e2088);})['then'](handleEntityNotFound(_0xa4e72d,null))[_0xe501('0x2c')](function(_0x10761e){if(_0x10761e){if(!_[_0xe501('0x75')](_0x10761e[_0xe501('0x68')])){if(fs['existsSync'](path[_0xe501('0x72')](config[_0xe501('0x76')],'server/files/images/logos/',_0x10761e[_0xe501('0x68')]))&&_0x3e3f88){_0x28f5d8=path[_0xe501('0x72')](config['root'],_0xe501('0x77'),_0x10761e[_0xe501('0x68')]);}}return _0xa4e72d[_0xe501('0x78')](_0x28f5d8);}})['catch'](handleError(_0xa4e72d,null));};exports['getAvatar']=function(_0x55657f,_0x1c4329,_0x3b1506){var _0x1e17d3=path['join'](config[_0xe501('0x76')],_0xe501('0x79'));var _0x425656={'where':{'id':_0x55657f[_0xe501('0x4d')]['id']},'attributes':['id',_0xe501('0x6c')],'raw':!![]};return db[_0xe501('0x37')]['find'](_0x425656)[_0xe501('0x2c')](handleEntityNotFound(_0x1c4329,null))[_0xe501('0x2c')](function(_0xa1f951){if(_0xa1f951){if(!_[_0xe501('0x75')](_0xa1f951[_0xe501('0x6c')])){if(fs['existsSync'](path[_0xe501('0x72')](config[_0xe501('0x76')],_0xe501('0x7a'),_0xa1f951[_0xe501('0x6c')]))){_0x1e17d3=path[_0xe501('0x72')](config['root'],_0xe501('0x7a'),_0xa1f951[_0xe501('0x6c')]);}}return _0x1c4329[_0xe501('0x78')](_0x1e17d3);}})[_0xe501('0x50')](handleError(_0x1c4329,null));};exports[_0xe501('0x7b')]=function(_0x3abc6c,_0xdc28e5,_0x36e3e2){var _0x206265=path['join'](config[_0xe501('0x76')],_0xe501('0x7c'));var _0x1f844f={'where':{'id':_0x3abc6c['params']['id']},'attributes':['id','customerAvatar',_0xe501('0x7d')],'raw':!![]};return db['ChatWebsite'][_0xe501('0x56')](_0x1f844f)['then'](handleEntityNotFound(_0xdc28e5,null))[_0xe501('0x2c')](function(_0x29b1a1){if(_0x29b1a1){if(!_[_0xe501('0x75')](_0x29b1a1['customerAvatar'])){if(fs[_0xe501('0x7e')](path['join'](config['root'],_0xe501('0x7a'),_0x29b1a1[_0xe501('0x6e')]))&&_0x29b1a1[_0xe501('0x7d')]){_0x206265=path['join'](config[_0xe501('0x76')],_0xe501('0x7a'),_0x29b1a1[_0xe501('0x6e')]);}}return _0xdc28e5[_0xe501('0x78')](_0x206265);}})[_0xe501('0x50')](handleError(_0xdc28e5,null));};exports[_0xe501('0x7f')]=function(_0x28b7a0,_0x8d31f9,_0x1377c7){var _0x246258=path['join'](config[_0xe501('0x76')],_0xe501('0x80'));var _0x716bf4={'where':{'id':_0x28b7a0[_0xe501('0x4d')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xe501('0x37')][_0xe501('0x56')](_0x716bf4)[_0xe501('0x2c')](handleEntityNotFound(_0x8d31f9,null))[_0xe501('0x2c')](function(_0x21d640){if(_0x21d640){if(!_[_0xe501('0x75')](_0x21d640[_0xe501('0x70')])){if(fs['existsSync'](path[_0xe501('0x72')](config[_0xe501('0x76')],_0xe501('0x7a'),_0x21d640[_0xe501('0x70')]))){_0x246258=path['join'](config[_0xe501('0x76')],'server/files/images/avatars/',_0x21d640[_0xe501('0x70')]);}}return _0x8d31f9[_0xe501('0x78')](_0x246258);}})[_0xe501('0x50')](handleError(_0x8d31f9,null));};exports[_0xe501('0x81')]=function(_0x2e2534,_0x3020fb,_0x2ff2e7){var _0x44e4b7=require(_0xe501('0x82'));var _0x53a8d0=new _0x44e4b7();var _0x123c1f=_0x53a8d0[_0xe501('0x83')](_0x2e2534[_0xe501('0x84')][_0xe501('0x85')])[_0xe501('0x86')]();var _0x27b3e3={'body':_0x2e2534[_0xe501('0x52')],'channel':_0xe501('0x87')};var _0x1bbcc2=[];var _0x44e871=[];var _0x12588d={};var _0x2b860a=![];return db[_0xe501('0x88')]['describe']()['then'](function(_0x419676){if(!_0x419676){throw new db[(_0xe501('0x89'))][(_0xe501('0x8a'))](_0xe501('0x8b'));}_0x1bbcc2=_['difference'](_[_0xe501('0x4e')](_0x419676),[_0xe501('0x8c'),_0xe501('0x8d')]);_0x44e871=_[_0xe501('0x8e')](_[_0xe501('0x4e')](_0x419676),[_0xe501('0x8c'),_0xe501('0x8d'),'CompanyId','ListId']);if(_0x2e2534[_0xe501('0x52')]['id']){delete _0x2e2534[_0xe501('0x52')]['id'];}if(_[_0xe501('0x75')](_0x2e2534[_0xe501('0x52')][_0xe501('0x8f')])){throw new db[(_0xe501('0x89'))][(_0xe501('0x8a'))]('from\x20is\x20mandatory');}if(_[_0xe501('0x75')](_0x2e2534[_0xe501('0x52')][_0xe501('0x52')])||_0x2e2534[_0xe501('0x52')][_0xe501('0x52')]===''){throw new db[(_0xe501('0x89'))][(_0xe501('0x8a'))](_0xe501('0x90'));}if(_['isNil'](_0x2e2534['body'][_0xe501('0x91')])){throw new db[(_0xe501('0x89'))][(_0xe501('0x8a'))](_0xe501('0x92')+_0x44e871);}if(!_[_0xe501('0x93')](_0x44e871,_0x2e2534[_0xe501('0x52')][_0xe501('0x91')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x44e871);}_0x12588d[_0x2e2534['body'][_0xe501('0x91')]]=_0x2e2534['body'][_0xe501('0x8f')];})[_0xe501('0x2c')](function(){return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x2e2534[_0xe501('0x4d')]['id']},'include':[{'model':db['CmList'],'as':_0xe501('0x94'),'include':[{'model':db[_0xe501('0x88')],'as':_0xe501('0x95'),'where':_0x12588d,'limit':0x1,'order':[[_0xe501('0x8d'),_0xe501('0x96')]]}]},{'model':db[_0xe501('0x97')],'as':'Applications'}]});})[_0xe501('0x2c')](handleEntityNotFound(_0x3020fb,null))[_0xe501('0x2c')](function(_0xdf2870){if(_0xdf2870&&_0xdf2870['List']){_0x27b3e3['account']=_0xdf2870;_0x27b3e3[_0xe501('0x98')]=_0xdf2870[_0xe501('0x99')];_0x27b3e3[_0xe501('0x9a')]=_0xdf2870['List'];_0x27b3e3['applications']=_[_0xe501('0x9b')](_0x27b3e3[_0xe501('0x98')],[_0xe501('0x9c')],[_0xe501('0x9d')]);if(_0x27b3e3[_0xe501('0x9e')][_0xe501('0x99')]){delete _0x27b3e3[_0xe501('0x9e')][_0xe501('0x99')];}if(_0x27b3e3[_0xe501('0x9e')][_0xe501('0x94')]&&_0x27b3e3[_0xe501('0x9e')]['List'][_0xe501('0x95')][_0xe501('0x41')]){return _0x27b3e3['account'][_0xe501('0x94')][_0xe501('0x95')][0x0];}var _0x5b6155=_[_0xe501('0x9f')](_0x2e2534['body'],{'firstName':_0x2e2534[_0xe501('0x52')]['from'],'ListId':_0xdf2870['ListId']});_0x5b6155[_0x2e2534[_0xe501('0x52')][_0xe501('0x91')]]=_0x2e2534[_0xe501('0x52')]['from'];return db[_0xe501('0x88')][_0xe501('0x51')](_0x5b6155,{'fields':_0x1bbcc2,'raw':!![]});}})[_0xe501('0x2c')](handleEntityNotFound(_0x3020fb,null))[_0xe501('0x2c')](function(_0xdd7a02){_0x27b3e3[_0xe501('0xa0')]=_0xdd7a02;var _0x1ca98d=_0x2e2534[_0xe501('0x52')][_0xe501('0xa1')];if(_0x2e2534['headers'][_0xe501('0xa2')]){_0x1ca98d=_0x2e2534[_0xe501('0x84')][_0xe501('0xa2')];}else if(_0x2e2534['headers'][_0xe501('0xa3')]){_0x1ca98d=_[_0xe501('0xa4')](_0x2e2534['headers'][_0xe501('0xa3')][_0xe501('0xa5')](','));}if(_0xdd7a02){var _0x1cf79f={'ContactId':_0xdd7a02['id'],'ChatWebsiteId':_0x2e2534['params']['id'],'from':(_0xdd7a02[_0xe501('0xa6')]||'')+'\x20'+(_0xdd7a02[_0xe501('0xa7')]||''),'customerIp':_0x1ca98d,'customerPort':_0x2e2534['headers'][_0xe501('0xa8')]?_0x2e2534[_0xe501('0x84')]['x-real-port']:null,'referer':_0x2e2534[_0xe501('0x52')][_0xe501('0xa9')],'browserName':_0x123c1f['browser'][_0xe501('0x33')]&&_0x123c1f[_0xe501('0xaa')][_0xe501('0xab')]?util['format'](_0xe501('0xac'),_0x123c1f['browser'][_0xe501('0x33')],_0x123c1f[_0xe501('0xaa')][_0xe501('0xab')]):_0xe501('0xad'),'browserVersion':_0x123c1f[_0xe501('0xaa')][_0xe501('0xab')]||_0xe501('0xad'),'osName':util[_0xe501('0xae')](_0xe501('0xac'),_0x123c1f['os'][_0xe501('0x33')],_0x123c1f['os']['version']),'osVersion':_0x123c1f['os'][_0xe501('0xab')],'deviceModel':_0x123c1f[_0xe501('0xaf')][_0xe501('0x3b')]&&_0x123c1f[_0xe501('0xaf')][_0xe501('0xb0')]?util[_0xe501('0xae')](_0xe501('0xb1'),_0x123c1f[_0xe501('0xaf')][_0xe501('0x3b')],_0x123c1f[_0xe501('0xaf')][_0xe501('0xb0')],_0x123c1f[_0xe501('0xaf')]['type']):null,'deviceVendor':_0x123c1f[_0xe501('0xaf')][_0xe501('0xb0')],'deviceType':_0x123c1f['device'][_0xe501('0x39')],'formData':JSON[_0xe501('0x1c')](_0x2e2534['body'])};var _0x504258={'ChatWebsiteId':_0x2e2534[_0xe501('0x4d')]['id'],'closed':![]};if(_0x2e2534['body'][_0xe501('0xb2')]){_0x504258['threadId']=_0x2e2534[_0xe501('0x52')][_0xe501('0xb2')];return db[_0xe501('0xb3')]['find']({'where':_0x504258})[_0xe501('0x2c')](function(_0x21bcb0){if(_0x21bcb0){return[_0x21bcb0,![]];}_0x1cf79f[_0xe501('0xb2')]=_0x2e2534[_0xe501('0x52')][_0xe501('0xb2')];_0x1cf79f[_0xe501('0xb4')]=_0x2e2534[_0xe501('0x52')][_0xe501('0xb4')];return db[_0xe501('0xb3')][_0xe501('0x51')](_0x1cf79f)[_0xe501('0x2c')](function(_0x42d8e8){return[_0x42d8e8,!![]];});});}_0x504258[_0xe501('0xb5')]=_0xdd7a02['id'];if(_0x2e2534[_0xe501('0x52')][_0xe501('0xb6')]&&_0x2e2534[_0xe501('0x52')][_0xe501('0xb6')]['id']){_0x504258['id']=_0x2e2534[_0xe501('0x52')][_0xe501('0xb6')]['id'];return db[_0xe501('0xb3')]['find']({'where':_0x504258})[_0xe501('0x2c')](function(_0x23923f){if(_0x23923f){return[_0x23923f,![]];}return db[_0xe501('0xb3')]['create'](_0x1cf79f)[_0xe501('0x2c')](function(_0x3bfc71){return[_0x3bfc71,!![]];});});}return db[_0xe501('0xb3')][_0xe501('0x51')](_0x1cf79f)[_0xe501('0x2c')](function(_0x24be56){return[_0x24be56,!![]];});}})[_0xe501('0xb7')](function(_0xe1aab9,_0x2a4af8){if(_0xe1aab9){_0x2b860a=_0x2a4af8;if(!_0x2a4af8){var _0x3a96e1={'from':(_0x27b3e3[_0xe501('0xa0')][_0xe501('0xa6')]||'')+'\x20'+(_0x27b3e3[_0xe501('0xa0')]['lastName']||'')};if(_0x2e2534[_0xe501('0x52')][_0xe501('0xb2')]&&_0x2e2534[_0xe501('0x52')][_0xe501('0xb8')]&&_0x2e2534['body'][_0xe501('0xb2')]!=_0x2e2534['body'][_0xe501('0xb8')]){_0x3a96e1['threadId']=_0x2e2534[_0xe501('0x52')][_0xe501('0xb8')];}return _0xe1aab9['update'](_0x3a96e1);}else{return _0xe1aab9;}}})[_0xe501('0x2c')](function(_0x494f5a){_0x27b3e3[_0xe501('0xb6')]=_0x494f5a[_0xe501('0x2d')]({'plain':!![]});_0x27b3e3[_0xe501('0xb6')][_0xe501('0xb9')]=_0x2b860a;if(_0x27b3e3['interaction'][_0xe501('0xb9')]){if(_0x27b3e3[_0xe501('0x9e')][_0xe501('0xba')]){_0x27b3e3[_0xe501('0x98')][_0xe501('0xbb')]({'id':0x0,'priority':_0x27b3e3['applications'][_0xe501('0x41')]+0x1,'app':_0xe501('0xbc'),'appdata':_0xe501('0xbd'),'interval':_0xe501('0xbe')});}}return db[_0xe501('0xbf')]['create']({'body':_0x2e2534[_0xe501('0x52')][_0xe501('0x52')],'ChatWebsiteId':_0x2e2534[_0xe501('0x4d')]['id'],'ChatInteractionId':_0x494f5a['id'],'direction':'in','ContactId':_0x27b3e3['contact']['id'],'AttachmentId':_0x2e2534['body'][_0xe501('0xc0')]});})[_0xe501('0x2c')](function(_0x1f4c79){_0x27b3e3[_0xe501('0x1f')]=_0x1f4c79;if(_0x27b3e3[_0xe501('0xb6')][_0xe501('0xc1')]){return db['User'][_0xe501('0x56')]({'attributes':['id',_0xe501('0x33')],'where':{'id':_0x27b3e3[_0xe501('0xb6')][_0xe501('0xc1')]}})[_0xe501('0x2c')](function(_0x2591f2){if(_0x2591f2){_0x27b3e3['applications'][_0xe501('0xc2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2591f2['name']+','+(_0x27b3e3[_0xe501('0x9e')][_0xe501('0xc3')]||0xa),'interval':_0xe501('0xbe')});_0x27b3e3['forcedOwnership']=!![];}return respondWithRpcPromise(_0xe501('0xc4'),_0xe501('0xc5'),_0x27b3e3);});}return respondWithRpcPromise(_0xe501('0xc4'),_0xe501('0xc5'),_0x27b3e3);})['then'](function(_0x32e210){respondWithRpcPromise(_0xe501('0xc6'),_0xe501('0xc6'),{'event':'notify','message':_0x32e210},client9002);return _0x32e210;})[_0xe501('0x2c')](respondWithResult(_0x3020fb,null))['catch'](handleError(_0x3020fb,null));};exports[_0xe501('0xc7')]=function(_0x4b1818,_0xe52520,_0x5d9278){var _0x230bb1,_0x4f23da,_0x539b47;var _0x5a9567=[];var _0x4253a4=[];var _0x663df9={};var _0x3e6ea8=_0x4b1818['files']||[];var _0x466ff7=[];var _0x1df45c;return db[_0xe501('0x88')]['describe']()['then'](function(_0xa807ce){if(!_0xa807ce){throw new db[(_0xe501('0x89'))][(_0xe501('0x8a'))](_0xe501('0x8b'));}_0x4253a4=_[_0xe501('0x8e')](_[_0xe501('0x4e')](_0xa807ce),[_0xe501('0x8c'),_0xe501('0x8d')]);_0x5a9567=_['difference'](_[_0xe501('0x4e')](_0xa807ce),[_0xe501('0x8c'),_0xe501('0x8d'),_0xe501('0xc8'),'ListId']);if(_0x4b1818[_0xe501('0x52')]['id']){delete _0x4b1818[_0xe501('0x52')]['id'];}if(_[_0xe501('0x75')](_0x4b1818[_0xe501('0x52')]['from'])){throw _0xe52520[_0xe501('0x20')](0x1f4)[_0xe501('0xc9')](new db[(_0xe501('0x89'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xe501('0x75')](_0x4b1818[_0xe501('0x52')][_0xe501('0x52')])||_0x4b1818['body'][_0xe501('0x52')]===''){throw _0xe52520[_0xe501('0x20')](0x1f4)[_0xe501('0xc9')](new db[(_0xe501('0x89'))][(_0xe501('0x8a'))](_0xe501('0x90')));}if(_[_0xe501('0x75')](_0x4b1818[_0xe501('0x52')][_0xe501('0xca')])){throw _0xe52520[_0xe501('0x20')](0x1f4)[_0xe501('0xc9')](new db[(_0xe501('0x89'))][(_0xe501('0x8a'))](_0xe501('0xcb')+_0x5a9567));}if(!_[_0xe501('0x93')](_0x5a9567,_0x4b1818['body'][_0xe501('0xca')])){throw _0xe52520['status'](0x1f4)[_0xe501('0xc9')](new db['Sequelize']['ValidationError'](_0xe501('0xcc')+_0x5a9567));}_0x663df9[_0x4b1818[_0xe501('0x52')]['mapKeyOffline']]=_0x4b1818[_0xe501('0x52')][_0xe501('0x8f')];})[_0xe501('0x2c')](function(){return db['ChatWebsite'][_0xe501('0x56')]({'where':{'id':_0x4b1818[_0xe501('0x4d')]['id']},'include':[{'model':db[_0xe501('0xcd')],'as':'List'},{'model':db[_0xe501('0xce')],'as':_0xe501('0xce')}]});})[_0xe501('0x2c')](handleEntityNotFound(_0xe52520,null))[_0xe501('0x2c')](function(_0x2e99c9){if(_0x2e99c9&&_0x2e99c9[_0xe501('0x94')]){_0x4f23da=_0x2e99c9;var _0x177513=_['defaults'](_0x4b1818[_0xe501('0x52')],{'firstName':_0x4b1818[_0xe501('0x52')][_0xe501('0x8f')],'phone':_0x4b1818[_0xe501('0x52')]['from'],'ListId':_0x2e99c9[_0xe501('0xcf')]});_0x177513[_0x4b1818['body']['mapKeyOffline']]=_0x4b1818[_0xe501('0x52')][_0xe501('0x8f')];return db['CmContact'][_0xe501('0xd0')]({'where':_0x663df9,'defaults':_0x177513});}})[_0xe501('0xb7')](function(_0x311c7a){if(_0x311c7a){_0x539b47=_0x311c7a;var _0x396309=fs[_0xe501('0xd1')](path['join'](config[_0xe501('0x76')],_0xe501('0xd2')),_0xe501('0xd3'));var _0x219bce=ejs['render'](_0x396309,{'body':_['toPairs'](_0x4b1818[_0xe501('0x52')][_0xe501('0x52')]),'bodyTitle':_0x4f23da[_0xe501('0xd4')]});return db[_0xe501('0xd5')]['create']({'body':_0x219bce,'ContactId':_0x311c7a['id'],'ChatWebsiteId':_0x4f23da['id']});}})[_0xe501('0x2c')](function(_0x5e2d87){_0x1df45c=_0x5e2d87;if(_0x3e6ea8[_0xe501('0x41')]){var _0x4a24ff=_0x3e6ea8[_0xe501('0x3c')](function(_0x33a3e5){return{'name':_0x33a3e5['originalname'],'basename':_0x33a3e5[_0xe501('0x6a')],'type':_0x33a3e5[_0xe501('0xd6')],'ChatOfflineMessageId':_0x5e2d87['id']};});_0x466ff7=_0x4a24ff[_0xe501('0x3c')](_0x391793=>{var _0x2f7861={'filename':_0x391793[_0xe501('0x33')],'path':path[_0xe501('0x72')](config[_0xe501('0x76')],'server',_0xe501('0xd7'),_0xe501('0xd8'),_0xe501('0xd9'),_0x391793['basename'])};return _0x2f7861;});if(!_0x4f23da[_0xe501('0xda')]){return db['sequelize']['transaction'](function(_0x583e86){return db['Attachment'][_0xe501('0xdb')](_0x4a24ff,{'transaction':_0x583e86});});}}})[_0xe501('0x2c')](function(){if(_0x1df45c){_0x230bb1=_0x1df45c;return db[_0xe501('0xce')][_0xe501('0x5b')]({'where':{'active':!![]},'include':[{'model':db[_0xe501('0xdc')],'as':_0xe501('0xdd'),'raw':!![]}]});}})[_0xe501('0x2c')](function(_0x1f694d){if(_0x1f694d&&_0x1f694d[_0xe501('0xdd')]&&_0x4f23da['forwardOffline']&&_0x4f23da[_0xe501('0xde')]){var _0x3b01b2={'tls':{'rejectUnauthorized':![]}};if(_0x1f694d[_0xe501('0xdd')]['service']){_0x3b01b2[_0xe501('0xdf')]=_0x1f694d[_0xe501('0xdd')][_0xe501('0xdf')];}else{_0x3b01b2[_0xe501('0xe0')]=_0x1f694d['Smtp'][_0xe501('0xe0')];_0x3b01b2[_0xe501('0xe1')]=_0x1f694d[_0xe501('0xdd')][_0xe501('0xe1')];_0x3b01b2[_0xe501('0xe2')]=_0x1f694d[_0xe501('0xdd')][_0xe501('0xe2')];}if(_0x1f694d[_0xe501('0xdd')][_0xe501('0xe3')]){_0x3b01b2['auth']={'user':_0x1f694d['Smtp'][_0xe501('0x53')],'pass':_0x1f694d[_0xe501('0xdd')][_0xe501('0xe4')]};}return respondWithRpcPromise(_0xe501('0xe5'),_0xe501('0xe6'),{'account':_0x3b01b2,'message':{'from':util[_0xe501('0xae')](_0xe501('0xe7'),_0x1f694d[_0xe501('0x33')],_0x1f694d[_0xe501('0xe8')]||_0x1f694d['Smtp'][_0xe501('0x53')]),'to':_0x4f23da[_0xe501('0xde')],'subject':_0x4f23da[_0xe501('0xe9')],'html':_0x230bb1[_0xe501('0x52')],'attachments':_0x466ff7}},client9003)[_0xe501('0x2c')](function(){return _0x230bb1;})['catch'](function(_0x352e22){console[_0xe501('0x1e')](_0x352e22);});}})[_0xe501('0x2c')](function(){if(_0x4f23da&&_0x4f23da[_0xe501('0xda')]&&_0x4f23da[_0xe501('0xea')]){var _0xd19c9=[];if(_0x3e6ea8[_0xe501('0x41')]){_0xd19c9=_0x3e6ea8[_0xe501('0x3c')](function(_0x606492){return{'name':_0x606492[_0xe501('0xeb')],'basename':_0x606492[_0xe501('0x6a')],'type':_0x606492['mimetype'],'ChatOfflineMessageId':_0x1df45c['id']};});}var _0x46c959;if(!_[_0xe501('0x75')](_0x4f23da[_0xe501('0xec')])){var _0x46be3e=_[_0xe501('0x3c')](_0x4b1818[_0xe501('0x52')],function(_0x31e51a){return _0x31e51a;});var _0x353b69=_['toPairsIn'](_0x46be3e)[0x0];var _0xdeb2f5=_[_0xe501('0xed')](_0x353b69,function(_0x126dfb){return _0x126dfb;});_0x46c959=_0xdeb2f5[0x1][_0x4f23da['subjectOffline']];}var _0x196491={'from':_0x539b47[_0xe501('0xe8')],'firstName':_0x539b47['firstName'],'lastName':_0x539b47[_0xe501('0xa7')],'mapKey':_0xe501('0xe8'),'message':{'from':_0x539b47[_0xe501('0xe8')],'to':_0x4f23da[_0xe501('0xce')]['email'],'cc':'','subject':_[_0xe501('0x75')](_0x46c959)?_0x4f23da[_0xe501('0xe9')]:_0x46c959,'messageId':'','sentAt':new Date(),'attach':_0xd19c9['length'],'attachments':_0xd19c9,'originChannel':_0xe501('0xee'),'ChatWebsiteId':_0x4f23da['id'],'ChatOfflineMessageId':_0x230bb1['id'],'originTo':_0x4f23da['MailAccount']['email']},'body':_0x230bb1['body']};var _0x229714={'account':{'id':_0x4f23da[_0xe501('0xea')]},'body':_0x196491,'log':_0xe501('0xef')};return respondWithRpcPromise(_0xe501('0xef'),'notifyMail',_0x229714,client9001)[_0xe501('0x2c')](function(){return _0x230bb1;})['catch'](function(_0x436a47){console[_0xe501('0x1e')](_0x436a47);});}return;})['then'](function(){if(_0x230bb1){return _0x230bb1;}})[_0xe501('0x2c')](respondWithResult(_0xe52520,null))[_0xe501('0x50')](function(_0x265ac1){console[_0xe501('0x1e')](_0xe501('0x50'),_0x265ac1);for(var _0x329db4 of _0x3e6ea8){var _0x5cc52d=path[_0xe501('0x72')](config[_0xe501('0x76')],_0xe501('0xf0'),_0xe501('0xd7'),'attachments',_0xe501('0xd9'),_0x329db4[_0xe501('0x6a')]);fs_extra['remove'](_0x5cc52d)[_0xe501('0x50')](function(_0x32023a){console[_0xe501('0x1e')](_0xe501('0xf1'),_0x5cc52d,_0x32023a);});}});};exports[_0xe501('0xf2')]=function(_0x570c78,_0x41ccaa,_0x18faae){return db[_0xe501('0xb3')]['find']({'where':{'id':_0x570c78[_0xe501('0x4d')]['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x41ccaa,null))['then'](function(_0x15c35b){if(_0x15c35b){return _0x15c35b[_0xe501('0xf2')](_0x570c78[_0xe501('0x52')][_0xe501('0x61')],_[_0xe501('0xf3')](_0x570c78['body'],[_0xe501('0x61'),'id'])||{});}})['then'](respondWithResult(_0x41ccaa,null))['catch'](handleError(_0x41ccaa,null));};exports[_0xe501('0xf4')]=function(_0x1d0c52,_0x476730,_0x25a30e){var _0x3454d7={'raw':![],'where':{}};var _0x404d19={};var _0x2f55f6={'count':0x0,'rows':[]};return db[_0xe501('0x37')][_0xe501('0x5b')]({'where':{'id':_0x1d0c52[_0xe501('0x4d')]['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x476730,null))[_0xe501('0x2c')](function(_0x36513a){if(_0x36513a){_0x404d19[_0xe501('0x3b')]=_[_0xe501('0x4e')](db['ChatInteraction'][_0xe501('0x38')]);_0x404d19[_0xe501('0x3d')]=_['keys'](_0x1d0c52['query']);_0x404d19[_0xe501('0x3e')]=_[_0xe501('0x3f')](_0x404d19[_0xe501('0x3b')],_0x404d19['query']);_0x3454d7[_0xe501('0x40')]=_[_0xe501('0x3f')](_0x404d19[_0xe501('0x3b')],qs['fields'](_0x1d0c52[_0xe501('0x3d')][_0xe501('0x4f')]));_0x3454d7['attributes']=_0x3454d7['attributes'][_0xe501('0x41')]?_0x3454d7[_0xe501('0x40')]:_0x404d19['model'];if(!_0x1d0c52['query']['hasOwnProperty'](_0xe501('0x65'))){_0x3454d7[_0xe501('0x26')]=qs[_0xe501('0x26')](_0x1d0c52['query'][_0xe501('0x26')]);_0x3454d7[_0xe501('0x23')]=qs['offset'](_0x1d0c52[_0xe501('0x3d')]['offset']);}_0x3454d7[_0xe501('0x43')]=qs['sort'](_0x1d0c52[_0xe501('0x3d')][_0xe501('0x44')]);_0x3454d7['where']=qs[_0xe501('0x3e')](_[_0xe501('0x5d')](_0x1d0c52[_0xe501('0x3d')],_0x404d19[_0xe501('0x3e')]));_0x3454d7['where'][_0xe501('0x5a')]=_0x36513a['id'];if(_0x1d0c52[_0xe501('0x3d')][_0xe501('0x46')]){_0x3454d7[_0xe501('0x45')]=_[_0xe501('0x47')](_0x3454d7['where'],{'$or':_[_0xe501('0x3c')](_0x3454d7[_0xe501('0x40')],function(_0x39fa43){var _0x4f1fcc={};_0x4f1fcc[_0x39fa43]={'$like':'%'+_0x1d0c52['query'][_0xe501('0x46')]+'%'};return _0x4f1fcc;})});}_0x3454d7=_[_0xe501('0x47')]({},_0x3454d7,_0x1d0c52[_0xe501('0x49')]);return db['ChatInteraction'][_0xe501('0x25')]({'where':_0x3454d7[_0xe501('0x45')]})['then'](function(_0x2add0a){_0x2f55f6[_0xe501('0x25')]=_0x2add0a;if(_0x1d0c52['query'][_0xe501('0x4a')]){_0x3454d7[_0xe501('0x4b')]=[{'model':db[_0xe501('0x88')],'as':_0xe501('0xf5'),'required':![]},{'model':db[_0xe501('0xf6')],'as':_0xe501('0xf7'),'attributes':[_0xe501('0x33'),_0xe501('0xf8'),_0xe501('0xf9')],'required':![]},{'model':db[_0xe501('0xfa')],'as':_0xe501('0xfb'),'attributes':['id',_0xe501('0x33'),_0xe501('0xfc')],'where':_0x1d0c52['query'][_0xe501('0xfd')]?{'id':_0x1d0c52[_0xe501('0x3d')][_0xe501('0xfd')]}:undefined,'required':_0x1d0c52[_0xe501('0x3d')]['tag']?!![]:![]}];}return db[_0xe501('0xb3')]['findAll'](_0x3454d7);})[_0xe501('0x2c')](function(_0xd6002b){_0x2f55f6['rows']=_0xd6002b;return _0x2f55f6;});}})['then'](respondWithFilteredResult(_0x476730,_0x3454d7))[_0xe501('0x50')](handleError(_0x476730,null));};function iftimePromise(_0x49d4cf,_0x55202a){return respondWithRpcPromise(_0xe501('0xfe'),_0xe501('0xff'),{'command':_0x55202a[_0xe501('0x100')]?util[_0xe501('0xae')](_0xe501('0x101'),_0x49d4cf[_0xe501('0x102')],_0x55202a[_0xe501('0x100')]):util['format'](_0xe501('0x103'),_0x49d4cf[_0xe501('0x102')])},client9002)[_0xe501('0x2c')](function(_0x577983){var _0x3920fe=_0x577983&&_0x577983['indexOf'](_0xe501('0x104'))>=0x0?!![]:![];logger[_0xe501('0x105')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x55202a['id'],_0x49d4cf['id'],_0x49d4cf[_0xe501('0x102')],_0x3920fe?_0xe501('0x106'):_0xe501('0x107'),_0x55202a[_0xe501('0x100')]?_0x55202a[_0xe501('0x100')]:'No\x20timezone');return _0x3920fe;})['catch'](function(_0x3b346b){logger[_0xe501('0x1e')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x55202a['id'],_0x49d4cf['id'],_0x49d4cf['interval'],util[_0xe501('0x108')](_0x3b346b,{'showHidden':![],'depth':null}),_0x55202a[_0xe501('0x100')]?_0x55202a['timezone']:_0xe501('0x109'));return![];});}exports[_0xe501('0xff')]=function(_0x5af667,_0x15dbfa,_0x15cddf){var _0xcc79b3=0x0;var _0x369eb3=0x0;var _0x5e3ee6=![];var _0x226475;var _0x21392f;return db[_0xe501('0x37')]['find']({'where':{'id':_0x5af667['params']['id']},'include':[{'model':db['Interval'],'as':_0xe501('0x10a'),'include':[{'model':db[_0xe501('0x10a')],'as':_0xe501('0x10b'),'attributes':['id',_0xe501('0x102')],'raw':!![]}]}]})[_0xe501('0x2c')](handleEntityNotFound(_0x15dbfa,null))[_0xe501('0x2c')](function(_0x27b7ba){if(_0x27b7ba){_0x226475=_0x27b7ba;return _0x27b7ba['getProactiveActions']({'raw':!![]});}})[_0xe501('0x2c')](function(_0x1db99e){if(_0x226475){if(_0x1db99e){_0x21392f=_0x1db99e;}}return require('../../config/license/util')[_0xe501('0x73')]();})[_0xe501('0x2c')](function(_0x1ebf02){if(_0x1ebf02){_0x369eb3=_0x1ebf02['virtual'];_0x5e3ee6=_0x1ebf02['custom'];}})[_0xe501('0x2c')](function(){return db[_0xe501('0xb3')]['count']({'where':{'closed':![]}});})[_0xe501('0x2c')](function(_0x15e7a3){_0xcc79b3=_0x15e7a3;if(_0x369eb3&&_0x15e7a3>_0x369eb3){return db['License'][_0xe501('0x5b')]({'where':{'id':0x1}})[_0xe501('0x2c')](function(_0xef50f6){if(_0xef50f6){_0xef50f6[_0xe501('0x10c')](_0xe501('0x10d'));}});}})[_0xe501('0x2c')](function(){if(_0x226475[_0xe501('0x10a')]&&_0x226475[_0xe501('0x10a')][_0xe501('0x10b')]){var _0x19e0df=[];for(var _0xf99a46=0x0;_0xf99a46<_0x226475['Interval']['Intervals'][_0xe501('0x41')];_0xf99a46++){var _0x1f9eb6=_0x226475[_0xe501('0x10a')]['Intervals'][_0xf99a46][_0xe501('0x2d')]({'plain':!![]});_0x19e0df['push'](iftimePromise(_0x1f9eb6,_0x226475));}return BPromise[_0xe501('0x10e')](_0x19e0df)[_0xe501('0x2c')](function(_0x3a5c7a){return _[_0xe501('0x10f')](_0x3a5c7a);});}else{return!![];}})[_0xe501('0x2c')](function(_0x257b2e){var _0xaf5cbe=fs['readFileSync'](path[_0xe501('0x72')](config['root'],'server/files/chat/iframe.ejs'),_0xe501('0xd3'));var _0x4e0111={'remote':_0x226475[_0xe501('0x110')],'query':querystring[_0xe501('0x1c')](_['merge'](_0x226475['get']({'plain':!![]}),{'customerIp':_0x5af667[_0xe501('0x84')][_0xe501('0xa3')]||_0x5af667['headers'][_0xe501('0x111')]||_0x5af667[_0xe501('0x112')][_0xe501('0x113')]||_0x5af667['ip'],'referer':_0x5af667[_0xe501('0x84')][_0xe501('0xa9')],'openedInteractions':_0xcc79b3,'maxInteractions':_0x369eb3,'virtual':_0x5e3ee6[_0xe501('0x114')],'online':_0x257b2e,'custom':_0x5e3ee6}))[_0xe501('0x115')](/'/g,'\x5c\x27')};_0x15dbfa[_0xe501('0xc9')](ejs['render'](Mustache[_0xe501('0x116')](_0xaf5cbe,_0x4e0111),{'proactiveActions':_0x21392f,'alignment':_0x226475[_0xe501('0x117')],'verticalAlignment':_0x226475['verticalAlignment'],'div_color':_0x226475[_0xe501('0xfc')],'text_color':_0x226475[_0xe501('0x118')],'button_color':_0x226475[_0xe501('0x119')],'background_color':_0x226475[_0xe501('0x11a')]}));})[_0xe501('0x50')](handleError(_0x15dbfa,null));};exports[_0xe501('0x11b')]=function(_0x202b19,_0x1f42aa,_0x313e31){return db[_0xe501('0x37')][_0xe501('0x5b')]({'where':{'id':_0x202b19[_0xe501('0x4d')]['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x1f42aa,null))[_0xe501('0x2c')](function(_0x113fbc){if(_0x113fbc){return db[_0xe501('0x11c')][_0xe501('0x11d')](function(_0x45de69){return db[_0xe501('0x97')][_0xe501('0x30')]({'where':{'ChatWebsiteId':_0x202b19[_0xe501('0x4d')]['id']},'transaction':_0x45de69})['then'](function(_0x48371a){var _0x2f525f=_[_0xe501('0x3c')](_0x202b19[_0xe501('0x52')],function(_0x65b02a){_0x65b02a[_0xe501('0x5a')]=_0x202b19[_0xe501('0x4d')]['id'];return _0x65b02a;});return db[_0xe501('0x97')]['bulkCreate'](_0x2f525f,{'transaction':_0x45de69});});})[_0xe501('0x2c')](function(){return db[_0xe501('0x97')][_0xe501('0x11e')]({'where':{'ChatWebsiteId':_0x202b19[_0xe501('0x4d')]['id']},'order':'priority'});});}})[_0xe501('0x2c')](respondWithResult(_0x1f42aa,null))[_0xe501('0x50')](handleError(_0x1f42aa,null));};exports['getApplications']=function(_0x4d6383,_0x2152a6,_0x51edec){var _0x2ac4cf={};var _0x15a7d7={};var _0x245632;var _0x1f56ad;return db[_0xe501('0x37')][_0xe501('0x5b')]({'where':{'id':_0x4d6383['params']['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x2152a6,null))[_0xe501('0x2c')](function(_0x58bb3d){if(_0x58bb3d){_0x245632=_0x58bb3d;_0x15a7d7[_0xe501('0x3b')]=_[_0xe501('0x4e')](db[_0xe501('0x97')][_0xe501('0x38')]);_0x15a7d7[_0xe501('0x3d')]=_['keys'](_0x4d6383['query']);_0x15a7d7[_0xe501('0x3e')]=_[_0xe501('0x3f')](_0x15a7d7[_0xe501('0x3b')],_0x15a7d7[_0xe501('0x3d')]);_0x2ac4cf[_0xe501('0x40')]=_[_0xe501('0x3f')](_0x15a7d7[_0xe501('0x3b')],qs[_0xe501('0x4f')](_0x4d6383[_0xe501('0x3d')][_0xe501('0x4f')]));_0x2ac4cf['attributes']=_0x2ac4cf['attributes']['length']?_0x2ac4cf[_0xe501('0x40')]:_0x15a7d7['model'];_0x2ac4cf['order']=qs[_0xe501('0x44')](_0x4d6383['query']['sort']);_0x2ac4cf[_0xe501('0x45')]=qs['filters'](_[_0xe501('0x5d')](_0x4d6383[_0xe501('0x3d')],_0x15a7d7[_0xe501('0x3e')]));if(_0x4d6383[_0xe501('0x3d')][_0xe501('0x46')]){_0x2ac4cf[_0xe501('0x45')]=_[_0xe501('0x47')](_0x2ac4cf['where'],{'$or':_[_0xe501('0x3c')](_0x2ac4cf[_0xe501('0x40')],function(_0x1dfd47){var _0x5855bb={};_0x5855bb[_0x1dfd47]={'$like':'%'+_0x4d6383[_0xe501('0x3d')]['filter']+'%'};return _0x5855bb;})});}_0x2ac4cf=_[_0xe501('0x47')]({},_0x2ac4cf,_0x4d6383['options']);return _0x245632[_0xe501('0x11f')](_0x2ac4cf);}})[_0xe501('0x2c')](function(_0xa555bd){if(_0xa555bd){_0x1f56ad=_0xa555bd[_0xe501('0x41')];if(!_0x4d6383[_0xe501('0x3d')][_0xe501('0x42')](_0xe501('0x65'))){_0x2ac4cf[_0xe501('0x26')]=qs[_0xe501('0x26')](_0x4d6383[_0xe501('0x3d')][_0xe501('0x26')]);_0x2ac4cf[_0xe501('0x23')]=qs[_0xe501('0x23')](_0x4d6383[_0xe501('0x3d')][_0xe501('0x23')]);}return _0x245632[_0xe501('0x11f')](_0x2ac4cf);}})[_0xe501('0x2c')](function(_0xd71df9){if(_0xd71df9){return _0xd71df9?{'count':_0x1f56ad,'rows':_0xd71df9}:null;}})[_0xe501('0x2c')](respondWithResult(_0x2152a6,null))[_0xe501('0x50')](handleError(_0x2152a6,null));};exports[_0xe501('0x120')]=function(_0x5e4b3c,_0x174c68,_0x25fea7){return db['chatProactiveAction'][_0xe501('0x56')]({'where':{'id':_0x5e4b3c['params']['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x174c68,null))['then'](function(_0x48d2ee){if(_0x48d2ee){return _0x48d2ee[_0xe501('0x120')](_0x5e4b3c[_0xe501('0x52')][_0xe501('0x61')],_[_0xe501('0xf3')](_0x5e4b3c['body'],[_0xe501('0x61'),'id'])||{});}})['then'](respondWithResult(_0x174c68,null))[_0xe501('0x50')](handleError(_0x174c68,null));};exports[_0xe501('0x121')]=function(_0x5b6a14,_0x2ffcbc,_0x50e9d0){var _0x58dcaf={};var _0x5941ba={};var _0x1ca5cb;var _0x28fa98;return db['ChatWebsite'][_0xe501('0x5b')]({'where':{'id':_0x5b6a14[_0xe501('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2ffcbc,null))[_0xe501('0x2c')](function(_0x16f766){if(_0x16f766){_0x1ca5cb=_0x16f766;_0x5941ba[_0xe501('0x3b')]=_[_0xe501('0x4e')](db[_0xe501('0x122')]['rawAttributes']);_0x5941ba['query']=_[_0xe501('0x4e')](_0x5b6a14[_0xe501('0x3d')]);_0x5941ba[_0xe501('0x3e')]=_[_0xe501('0x3f')](_0x5941ba[_0xe501('0x3b')],_0x5941ba['query']);_0x58dcaf[_0xe501('0x40')]=_[_0xe501('0x3f')](_0x5941ba[_0xe501('0x3b')],qs[_0xe501('0x4f')](_0x5b6a14['query']['fields']));_0x58dcaf[_0xe501('0x40')]=_0x58dcaf[_0xe501('0x40')][_0xe501('0x41')]?_0x58dcaf[_0xe501('0x40')]:_0x5941ba[_0xe501('0x3b')];_0x58dcaf[_0xe501('0x43')]=qs[_0xe501('0x44')](_0x5b6a14['query'][_0xe501('0x44')]);_0x58dcaf[_0xe501('0x45')]=qs[_0xe501('0x3e')](_['pick'](_0x5b6a14[_0xe501('0x3d')],_0x5941ba['filters']));if(_0x5b6a14['query']['filter']){_0x58dcaf[_0xe501('0x45')]=_[_0xe501('0x47')](_0x58dcaf['where'],{'$or':_[_0xe501('0x3c')](_0x58dcaf[_0xe501('0x40')],function(_0x185de2){var _0x403cf9={};_0x403cf9[_0x185de2]={'$like':'%'+_0x5b6a14[_0xe501('0x3d')][_0xe501('0x46')]+'%'};return _0x403cf9;})});}_0x58dcaf=_[_0xe501('0x47')]({},_0x58dcaf,_0x5b6a14['options']);return _0x1ca5cb[_0xe501('0x121')](_0x58dcaf);}})[_0xe501('0x2c')](function(_0x4ee93a){if(_0x4ee93a){_0x28fa98=_0x4ee93a[_0xe501('0x41')];if(!_0x5b6a14['query'][_0xe501('0x42')](_0xe501('0x65'))){_0x58dcaf['limit']=qs[_0xe501('0x26')](_0x5b6a14[_0xe501('0x3d')]['limit']);_0x58dcaf['offset']=qs[_0xe501('0x23')](_0x5b6a14[_0xe501('0x3d')][_0xe501('0x23')]);}return _0x1ca5cb[_0xe501('0x121')](_0x58dcaf);}})['then'](function(_0x2983c5){if(_0x2983c5){return _0x2983c5?{'count':_0x28fa98,'rows':_0x2983c5}:null;}})[_0xe501('0x2c')](respondWithResult(_0x2ffcbc,null))['catch'](handleError(_0x2ffcbc,null));};exports['getFields']=function(_0x1a6358,_0x2a7b72,_0xfea5dd){var _0x49f27b=_0x1a6358[_0xe501('0x3d')]['online']===_0xe501('0x123')?_0xe501('0x124'):_0xe501('0x125');return db[_0xe501('0x37')][_0xe501('0x56')]({'attributes':['id',_0x49f27b],'where':{'id':_0x1a6358['params']['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x2a7b72,null))[_0xe501('0x2c')](function(_0x117926){if(_0x117926){var _0x24a663=_0x117926[_0x49f27b];var _0x4e4222=_0x24a663&&_0x24a663['items']?_0x24a663['items']:[];_0x2a7b72['send']({'fromKey':_['isNil'](_0x24a663[_0xe501('0x126')])?undefined:_0x24a663[_0xe501('0x126')],'count':_0x4e4222['length'],'rows':_0x4e4222});}})[_0xe501('0x50')](handleError(_0x2a7b72,null));};exports[_0xe501('0x127')]=function(_0x4d3f3c,_0x46f707,_0x2f533b){var _0x3de1c3={'raw':![],'where':{}};var _0x4117d0={};var _0x5abbf7={'count':0x0,'rows':[]};return db[_0xe501('0x37')][_0xe501('0x5b')]({'where':{'id':_0x4d3f3c['params']['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x46f707,null))[_0xe501('0x2c')](function(_0x13a2c8){if(_0x13a2c8){_0x4117d0[_0xe501('0x3b')]=_[_0xe501('0x4e')](db[_0xe501('0xd5')][_0xe501('0x38')]);_0x4117d0[_0xe501('0x3d')]=_[_0xe501('0x4e')](_0x4d3f3c[_0xe501('0x3d')]);_0x4117d0[_0xe501('0x3e')]=_['intersection'](_0x4117d0[_0xe501('0x3b')],_0x4117d0[_0xe501('0x3d')]);_0x3de1c3['attributes']=_['intersection'](_0x4117d0[_0xe501('0x3b')],qs[_0xe501('0x4f')](_0x4d3f3c[_0xe501('0x3d')][_0xe501('0x4f')]));_0x3de1c3[_0xe501('0x40')]=_0x3de1c3[_0xe501('0x40')][_0xe501('0x41')]?_0x3de1c3['attributes']:_0x4117d0[_0xe501('0x3b')];if(!_0x4d3f3c['query'][_0xe501('0x42')](_0xe501('0x65'))){_0x3de1c3[_0xe501('0x26')]=qs['limit'](_0x4d3f3c[_0xe501('0x3d')]['limit']);_0x3de1c3[_0xe501('0x23')]=qs['offset'](_0x4d3f3c[_0xe501('0x3d')]['offset']);}_0x3de1c3[_0xe501('0x43')]=qs[_0xe501('0x44')](_0x4d3f3c[_0xe501('0x3d')]['sort']);_0x3de1c3[_0xe501('0x45')]=qs[_0xe501('0x3e')](_[_0xe501('0x5d')](_0x4d3f3c[_0xe501('0x3d')],_0x4117d0['filters']));_0x3de1c3['where'][_0xe501('0x5a')]=_0x13a2c8['id'];if(_0x4d3f3c[_0xe501('0x3d')][_0xe501('0x46')]){_0x3de1c3[_0xe501('0x45')]=_[_0xe501('0x47')](_0x3de1c3[_0xe501('0x45')],{'$or':_[_0xe501('0x3c')](_0x3de1c3[_0xe501('0x40')],function(_0xf3065a){var _0x2cc9e6={};_0x2cc9e6[_0xf3065a]={'$like':'%'+_0x4d3f3c[_0xe501('0x3d')][_0xe501('0x46')]+'%'};return _0x2cc9e6;})});}_0x3de1c3=_[_0xe501('0x47')]({},_0x3de1c3,_0x4d3f3c[_0xe501('0x49')]);return db[_0xe501('0xd5')][_0xe501('0x25')]({'where':_0x3de1c3[_0xe501('0x45')]})[_0xe501('0x2c')](function(_0x3be115){_0x5abbf7['count']=_0x3be115;if(_0x4d3f3c[_0xe501('0x3d')][_0xe501('0x4a')]){_0x3de1c3['include']=[{'all':!![]}];}else{_0x3de1c3['include']=[{'model':db[_0xe501('0x88')],'as':_0xe501('0xf5'),'required':![]},{'model':db[_0xe501('0x128')],'as':_0xe501('0x129'),'required':![]}];}return db['ChatOfflineMessage'][_0xe501('0x5e')](_0x3de1c3);})[_0xe501('0x2c')](function(_0x3e171d){_0x5abbf7['rows']=_0x3e171d;return _0x5abbf7;});}})['then'](respondWithFilteredResult(_0x46f707,_0x3de1c3))[_0xe501('0x50')](handleError(_0x46f707,null));};exports[_0xe501('0x12a')]=function(_0x58e47c,_0x24fde5,_0x4be8c3){return db[_0xe501('0x37')]['find']({'where':{'id':_0x58e47c[_0xe501('0x4d')]['id']}})[_0xe501('0x2c')](handleEntityNotFound(_0x24fde5,null))[_0xe501('0x2c')](function(_0x134835){if(_0x134835){return _0x134835[_0xe501('0x12a')](_0x58e47c[_0xe501('0x52')][_0xe501('0x61')],_['omit'](_0x58e47c[_0xe501('0x52')],[_0xe501('0x61'),'id'])||{})[_0xe501('0xb7')](function(_0x5e41e4){for(var _0x21e8f0=0x0;_0x21e8f0<_0x58e47c['body']['ids'][_0xe501('0x41')];_0x21e8f0+=0x1){socket[_0xe501('0x12b')]('userChatWebsite:save',{'UserId':Number(_0x58e47c[_0xe501('0x52')]['ids'][_0x21e8f0]),'ChatWebsiteId':Number(_0x58e47c[_0xe501('0x4d')]['id'])});}return _0x5e41e4;});}})[_0xe501('0x2c')](respondWithResult(_0x24fde5,null))[_0xe501('0x50')](handleError(_0x24fde5,null));};exports['removeAgents']=function(_0x45c27c,_0x346510,_0x51b491){return db[_0xe501('0x37')][_0xe501('0x56')]({'where':{'id':_0x45c27c[_0xe501('0x4d')]['id']}})['then'](handleEntityNotFound(_0x346510,null))[_0xe501('0x2c')](function(_0x2537f1){if(_0x2537f1){return _0x2537f1[_0xe501('0x12c')](_0x45c27c[_0xe501('0x3d')][_0xe501('0x61')])[_0xe501('0x2c')](function(){if(_['isArray'](_0x45c27c[_0xe501('0x3d')][_0xe501('0x61')])){for(var _0x35e6ec=0x0;_0x35e6ec<_0x45c27c[_0xe501('0x3d')]['ids'][_0xe501('0x41')];_0x35e6ec+=0x1){socket[_0xe501('0x12b')](_0xe501('0x12d'),{'UserId':Number(_0x45c27c['query'][_0xe501('0x61')][_0x35e6ec]),'ChatWebsiteId':Number(_0x45c27c[_0xe501('0x4d')]['id'])});}}else{socket['emit'](_0xe501('0x12d'),{'UserId':Number(_0x45c27c[_0xe501('0x3d')][_0xe501('0x61')]),'ChatWebsiteId':Number(_0x45c27c['params']['id'])});}});}})[_0xe501('0x2c')](respondWithStatusCode(_0x346510,null))[_0xe501('0x50')](handleError(_0x346510,null));};exports[_0xe501('0x12e')]=function(_0xa1d749,_0x5d2b76,_0x53ee0c){var _0x174d3c={};var _0x414ead={};var _0x39cac3;var _0x13d76a;return db[_0xe501('0x37')][_0xe501('0x5b')]({'where':{'id':_0xa1d749[_0xe501('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5d2b76,null))[_0xe501('0x2c')](function(_0x24eb95){if(_0x24eb95){_0x39cac3=_0x24eb95;_0x414ead[_0xe501('0x3b')]=_[_0xe501('0x4e')](db[_0xe501('0xf6')][_0xe501('0x38')]);_0x414ead[_0xe501('0x3d')]=_[_0xe501('0x4e')](_0xa1d749[_0xe501('0x3d')]);_0x414ead['filters']=_[_0xe501('0x3f')](_0x414ead[_0xe501('0x3b')],_0x414ead['query']);_0x174d3c['attributes']=_[_0xe501('0x3f')](_0x414ead[_0xe501('0x3b')],qs[_0xe501('0x4f')](_0xa1d749[_0xe501('0x3d')]['fields']));_0x174d3c[_0xe501('0x40')]=_0x174d3c[_0xe501('0x40')][_0xe501('0x41')]?_0x174d3c[_0xe501('0x40')]:_0x414ead['model'];_0x174d3c[_0xe501('0x43')]=qs[_0xe501('0x44')](_0xa1d749['query'][_0xe501('0x44')]);_0x174d3c[_0xe501('0x45')]=qs['filters'](_['pick'](_0xa1d749[_0xe501('0x3d')],_0x414ead[_0xe501('0x3e')]));if(_0xa1d749[_0xe501('0x3d')]['filter']){_0x174d3c['where']=_[_0xe501('0x47')](_0x174d3c[_0xe501('0x45')],{'$or':_[_0xe501('0x3c')](_0x174d3c['attributes'],function(_0x4480eb){var _0x1cdb01={};_0x1cdb01[_0x4480eb]={'$like':'%'+_0xa1d749[_0xe501('0x3d')][_0xe501('0x46')]+'%'};return _0x1cdb01;})});}_0x174d3c=_[_0xe501('0x47')]({},_0x174d3c,_0xa1d749[_0xe501('0x49')]);return _0x39cac3[_0xe501('0x12e')](_0x174d3c);}})[_0xe501('0x2c')](function(_0x5a33a7){if(_0x5a33a7){_0x13d76a=_0x5a33a7[_0xe501('0x41')];if(!_0xa1d749['query'][_0xe501('0x42')]('nolimit')){_0x174d3c[_0xe501('0x26')]=qs[_0xe501('0x26')](_0xa1d749[_0xe501('0x3d')]['limit']);_0x174d3c[_0xe501('0x23')]=qs[_0xe501('0x23')](_0xa1d749[_0xe501('0x3d')][_0xe501('0x23')]);}return _0x39cac3['getAgents'](_0x174d3c);}})[_0xe501('0x2c')](function(_0x2e54da){if(_0x2e54da){return _0x2e54da?{'count':_0x13d76a,'rows':_0x2e54da}:null;}})[_0xe501('0x2c')](respondWithResult(_0x5d2b76,null))['catch'](handleError(_0x5d2b76,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 30dc715..ff4ab1c 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 _0x5447=['exports','events','ChatWebsite','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0xfbd2a9,_0x28b8b3){var _0x399bc5=function(_0x2cee1e){while(--_0x2cee1e){_0xfbd2a9['push'](_0xfbd2a9['shift']());}};_0x399bc5(++_0x28b8b3);}(_0x5447,0xf1));var _0x7544=function(_0x49e1df,_0x5e5424){_0x49e1df=_0x49e1df-0x0;var _0xf23632=_0x5447[_0x49e1df];return _0xf23632;};'use strict';var EventEmitter=require(_0x7544('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x7544('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7544('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7544('0x3'),'afterDestroy':'remove'};function emitEvent(_0x6e3582){return function(_0x2b18eb,_0xe47f97,_0x340bda){ChatWebsiteEvents[_0x7544('0x4')](_0x6e3582+':'+_0x2b18eb['id'],_0x2b18eb);ChatWebsiteEvents[_0x7544('0x4')](_0x6e3582,_0x2b18eb);_0x340bda(null);};}for(var e in events){if(events[_0x7544('0x5')](e)){var event=events[e];ChatWebsite[_0x7544('0x6')](e,emitEvent(event));}}module[_0x7544('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x3a32=['update','remove','emit','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x158b90,_0x597dbc){var _0x141dce=function(_0x5c9f68){while(--_0x5c9f68){_0x158b90['push'](_0x158b90['shift']());}};_0x141dce(++_0x597dbc);}(_0x3a32,0x9b));var _0x23a3=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x3a32[_0x160c73];return _0xd9302;};'use strict';var EventEmitter=require(_0x23a3('0x0'));var ChatWebsite=require(_0x23a3('0x1'))['db'][_0x23a3('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x23a3('0x3')](0x0);var events={'afterCreate':_0x23a3('0x4'),'afterUpdate':_0x23a3('0x5'),'afterDestroy':_0x23a3('0x6')};function emitEvent(_0x4a1378){return function(_0x480d99,_0xc06a55,_0xd3df2f){ChatWebsiteEvents['emit'](_0x4a1378+':'+_0x480d99['id'],_0x480d99);ChatWebsiteEvents[_0x23a3('0x7')](_0x4a1378,_0x480d99);_0xd3df2f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x23a3('0x8')](e,emitEvent(event));}}module[_0x23a3('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 c52de0f..d624f64 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 _0x6470=['bluebird','path','rimraf','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment'];(function(_0x6392e4,_0x4bb7ea){var _0x4f0319=function(_0x433cda){while(--_0x433cda){_0x6392e4['push'](_0x6392e4['shift']());}};_0x4f0319(++_0x4bb7ea);}(_0x6470,0x124));var _0x0647=function(_0x34872e,_0x1f18a3){_0x34872e=_0x34872e-0x0;var _0x2e3319=_0x6470[_0x34872e];return _0x2e3319;};'use strict';var _=require(_0x0647('0x0'));var util=require(_0x0647('0x1'));var logger=require(_0x0647('0x2'))(_0x0647('0x3'));var moment=require(_0x0647('0x4'));var BPromise=require(_0x0647('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0647('0x6'));var rimraf=require(_0x0647('0x7'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x0647('0x8')]=function(_0x5870ca,_0x35bdee){return _0x5870ca['define'](_0x0647('0x9'),attributes,{'tableName':_0x0647('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x95d9=['./chatWebsite.attributes','define','ChatWebsite','lodash','api','moment','request-promise','path','rimraf'];(function(_0x153022,_0xefa3ec){var _0x1f6ab1=function(_0x1f47f8){while(--_0x1f47f8){_0x153022['push'](_0x153022['shift']());}};_0x1f6ab1(++_0xefa3ec);}(_0x95d9,0xdb));var _0x995d=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x95d9[_0xac151d];return _0x111dba;};'use strict';var _=require(_0x995d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x995d('0x1'));var moment=require(_0x995d('0x2'));var BPromise=require('bluebird');var rp=require(_0x995d('0x3'));var fs=require('fs');var path=require(_0x995d('0x4'));var rimraf=require(_0x995d('0x5'));var config=require('../../config/environment');var attributes=require(_0x995d('0x6'));module['exports']=function(_0xef0b0e,_0x49f5c4){return _0xef0b0e[_0x995d('0x7')](_0x995d('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 1d652ba..99f592b 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 _0xdcdd=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2a1513,_0x425364){var _0x1a1a10=function(_0x5463a6){while(--_0x5463a6){_0x2a1513['push'](_0x2a1513['shift']());}};_0x1a1a10(++_0x425364);}(_0xdcdd,0xbf));var _0xddcd=function(_0x42c28d,_0x3d4777){_0x42c28d=_0x42c28d-0x0;var _0x585c2f=_0xdcdd[_0x42c28d];return _0x585c2f;};'use strict';var _=require(_0xddcd('0x0'));var util=require(_0xddcd('0x1'));var moment=require(_0xddcd('0x2'));var BPromise=require('bluebird');var rs=require(_0xddcd('0x3'));var fs=require('fs');var Redis=require(_0xddcd('0x4'));var db=require(_0xddcd('0x5'))['db'];var utils=require(_0xddcd('0x6'));var logger=require(_0xddcd('0x7'))(_0xddcd('0x8'));var config=require(_0xddcd('0x9'));var jayson=require(_0xddcd('0xa'));var client=jayson[_0xddcd('0xb')][_0xddcd('0xc')]({'port':0x232a});config[_0xddcd('0xd')]=_[_0xddcd('0xe')](config[_0xddcd('0xd')],{'host':_0xddcd('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xddcd('0xd')]));require(_0xddcd('0x10'))[_0xddcd('0x11')](socket);function respondWithRpcPromise(_0x1b21be,_0x464043,_0x2422c9){return new BPromise(function(_0x57a6f4,_0xe599c8){return client[_0xddcd('0x12')](_0x1b21be,_0x2422c9)[_0xddcd('0x13')](function(_0x53789a){logger[_0xddcd('0x14')](_0xddcd('0x15'),_0x464043,_0xddcd('0x16'));logger[_0xddcd('0x17')](_0xddcd('0x18'),_0x464043,_0xddcd('0x16'),JSON[_0xddcd('0x19')](_0x53789a));if(_0x53789a[_0xddcd('0x1a')]){if(_0x53789a[_0xddcd('0x1a')][_0xddcd('0x1b')]===0x1f4){logger['error'](_0xddcd('0x15'),_0x464043,_0x53789a['error'][_0xddcd('0x1c')]);return _0xe599c8(_0x53789a['error'][_0xddcd('0x1c')]);}logger['error'](_0xddcd('0x15'),_0x464043,_0x53789a[_0xddcd('0x1a')][_0xddcd('0x1c')]);return _0x57a6f4(_0x53789a[_0xddcd('0x1a')][_0xddcd('0x1c')]);}else{logger[_0xddcd('0x14')](_0xddcd('0x15'),_0x464043,_0xddcd('0x16'));_0x57a6f4(_0x53789a[_0xddcd('0x1d')][_0xddcd('0x1c')]);}})[_0xddcd('0x1e')](function(_0x5d3206){logger[_0xddcd('0x1a')](_0xddcd('0x15'),_0x464043,_0x5d3206);_0xe599c8(_0x5d3206);});});}
\ No newline at end of file
+var _0xe5be=['error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x379dc2,_0x35509e){var _0x1935dd=function(_0x10ca49){while(--_0x10ca49){_0x379dc2['push'](_0x379dc2['shift']());}};_0x1935dd(++_0x35509e);}(_0xe5be,0x109));var _0xee5b=function(_0x244eb6,_0x29c6fd){_0x244eb6=_0x244eb6-0x0;var _0x1e13e0=_0xe5be[_0x244eb6];return _0x1e13e0;};'use strict';var _=require(_0xee5b('0x0'));var util=require(_0xee5b('0x1'));var moment=require(_0xee5b('0x2'));var BPromise=require(_0xee5b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee5b('0x4'));var db=require(_0xee5b('0x5'))['db'];var utils=require(_0xee5b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xee5b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xee5b('0x8')][_0xee5b('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xee5b('0xa'),'port':0x18eb});var socket=require(_0xee5b('0xb'))(new Redis(config[_0xee5b('0xc')]));require(_0xee5b('0xd'))[_0xee5b('0xe')](socket);function respondWithRpcPromise(_0x17a6ed,_0x4c8c2e,_0x2c4ae4){return new BPromise(function(_0x7a6b88,_0x10b415){return client[_0xee5b('0xf')](_0x17a6ed,_0x2c4ae4)[_0xee5b('0x10')](function(_0x23bfc8){logger[_0xee5b('0x11')](_0xee5b('0x12'),_0x4c8c2e,_0xee5b('0x13'));logger[_0xee5b('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4c8c2e,_0xee5b('0x13'),JSON['stringify'](_0x23bfc8));if(_0x23bfc8[_0xee5b('0x15')]){if(_0x23bfc8['error'][_0xee5b('0x16')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4c8c2e,_0x23bfc8[_0xee5b('0x15')][_0xee5b('0x17')]);return _0x10b415(_0x23bfc8[_0xee5b('0x15')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4c8c2e,_0x23bfc8[_0xee5b('0x15')][_0xee5b('0x17')]);return _0x7a6b88(_0x23bfc8[_0xee5b('0x15')][_0xee5b('0x17')]);}else{logger[_0xee5b('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x4c8c2e,_0xee5b('0x13'));_0x7a6b88(_0x23bfc8[_0xee5b('0x18')][_0xee5b('0x17')]);}})[_0xee5b('0x19')](function(_0x4acbeb){logger[_0xee5b('0x15')](_0xee5b('0x12'),_0x4c8c2e,_0x4acbeb);_0x10b415(_0x4acbeb);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index d0b5b7b..ae94a9d 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 _0x610c=['./chatWebsite.events','save','remove','update','removeListener','register','length'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x610c,0x85));var _0xc610=function(_0x42ac5a,_0x1444d6){_0x42ac5a=_0x42ac5a-0x0;var _0x29505d=_0x610c[_0x42ac5a];return _0x29505d;};'use strict';var ChatWebsiteEvents=require(_0xc610('0x0'));var events=[_0xc610('0x1'),_0xc610('0x2'),_0xc610('0x3')];function createListener(_0x32dd71,_0x4bbe1b){return function(_0x5d2c9b){_0x4bbe1b['emit'](_0x32dd71,_0x5d2c9b);};}function removeListener(_0x2e206c,_0x5f4801){return function(){ChatWebsiteEvents[_0xc610('0x4')](_0x2e206c,_0x5f4801);};}exports[_0xc610('0x5')]=function(_0x54cb4e){for(var _0x474b3b=0x0,_0x4f009a=events[_0xc610('0x6')];_0x474b3b<_0x4f009a;_0x474b3b++){var _0x530c5b=events[_0x474b3b];var _0x1be0d5=createListener('chatWebsite:'+_0x530c5b,_0x54cb4e);ChatWebsiteEvents['on'](_0x530c5b,_0x1be0d5);}};
\ No newline at end of file
+var _0x9e17=['register','length','chatWebsite:','./chatWebsite.events','emit','removeListener'];(function(_0x47b673,_0x3d6eeb){var _0x13b656=function(_0x221e42){while(--_0x221e42){_0x47b673['push'](_0x47b673['shift']());}};_0x13b656(++_0x3d6eeb);}(_0x9e17,0x141));var _0x79e1=function(_0x404b9a,_0xca0480){_0x404b9a=_0x404b9a-0x0;var _0x30ba61=_0x9e17[_0x404b9a];return _0x30ba61;};'use strict';var ChatWebsiteEvents=require(_0x79e1('0x0'));var events=['save','remove','update'];function createListener(_0x399f51,_0x2c625f){return function(_0x119221){_0x2c625f[_0x79e1('0x1')](_0x399f51,_0x119221);};}function removeListener(_0x553f9b,_0x13d06f){return function(){ChatWebsiteEvents[_0x79e1('0x2')](_0x553f9b,_0x13d06f);};}exports[_0x79e1('0x3')]=function(_0x525df1){for(var _0xbdbdbc=0x0,_0x1b9822=events[_0x79e1('0x4')];_0xbdbdbc<_0x1b9822;_0xbdbdbc++){var _0x28c56d=events[_0xbdbdbc];var _0xc8e2f5=createListener(_0x79e1('0x5')+_0x28c56d,_0x525df1);ChatWebsiteEvents['on'](_0x28c56d,_0xc8e2f5);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 7921d5a..4cd3a28 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 _0x275c=['now','originalname','file','addLogo','diskStorage','root','server/files/images/avatars/','/:id/avatar','single','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','any','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','/:id/users','addAgents','put','update','delete','/:id','destroy','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','index','/describe','describe','show','get','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','addAnswer','join','server/files/images/logos/','format','%s-%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x275c,0x70));var _0xc275=function(_0x19dc1b,_0x35ffcb){_0x19dc1b=_0x19dc1b-0x0;var _0x1fbaf5=_0x275c[_0x19dc1b];return _0x1fbaf5;};'use strict';var multer=require(_0xc275('0x0'));var util=require(_0xc275('0x1'));var path=require(_0xc275('0x2'));var timeout=require(_0xc275('0x3'));var express=require(_0xc275('0x4'));var router=express[_0xc275('0x5')]();var fs_extra=require(_0xc275('0x6'));var auth=require(_0xc275('0x7'));var interaction=require(_0xc275('0x8'));var config=require('../../config/environment');var controller=require(_0xc275('0x9'));router['get']('/',auth[_0xc275('0xa')](),controller[_0xc275('0xb')]);router['get'](_0xc275('0xc'),auth[_0xc275('0xa')](),controller[_0xc275('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc275('0xe')]);router[_0xc275('0xf')](_0xc275('0x10'),auth[_0xc275('0xa')](),controller[_0xc275('0x11')]);router['get'](_0xc275('0x12'),auth[_0xc275('0xa')](),controller['getAnswers']);router[_0xc275('0xf')](_0xc275('0x13'),controller[_0xc275('0x14')]);router[_0xc275('0xf')]('/:id/avatar',controller[_0xc275('0x15')]);router['get']('/:id/customer_avatar',controller[_0xc275('0x16')]);router[_0xc275('0xf')](_0xc275('0x17'),controller[_0xc275('0x18')]);router[_0xc275('0xf')](_0xc275('0x19'),auth['isAuthenticated'](),controller[_0xc275('0x1a')]);router['get']('/:id/snippet',controller[_0xc275('0x1b')]);router['get'](_0xc275('0x1c'),auth[_0xc275('0xa')](),controller[_0xc275('0x1d')]);router[_0xc275('0xf')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xc275('0x1e')]);router['get'](_0xc275('0x1f'),controller[_0xc275('0x20')]);router[_0xc275('0xf')](_0xc275('0x21'),auth[_0xc275('0xa')](),controller[_0xc275('0x22')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xc275('0x23')]);router[_0xc275('0x24')]('/',auth[_0xc275('0xa')](),controller['create']);router[_0xc275('0x24')](_0xc275('0x10'),auth[_0xc275('0xa')](),controller['addDisposition']);router['post'](_0xc275('0x12'),auth[_0xc275('0xa')](),controller[_0xc275('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3c870e,_0x508d0f,_0x4a0d93){_0x4a0d93(null,path[_0xc275('0x26')](config['root'],_0xc275('0x27')));},'filename':function(_0x21fc3c,_0x33a720,_0x28893e){_0x28893e(null,util[_0xc275('0x28')](_0xc275('0x29'),Date[_0xc275('0x2a')](),_0x33a720[_0xc275('0x2b')]));}})});router[_0xc275('0x24')]('/:id/logo',upload['single'](_0xc275('0x2c')),controller[_0xc275('0x2d')]);var upload=multer({'storage':multer[_0xc275('0x2e')]({'destination':function(_0x5009fd,_0x5731d4,_0x46a594){_0x46a594(null,path[_0xc275('0x26')](config[_0xc275('0x2f')],_0xc275('0x30')));},'filename':function(_0x26a372,_0xebc708,_0x1a12a5){_0x1a12a5(null,util[_0xc275('0x28')](_0xc275('0x29'),Date[_0xc275('0x2a')](),_0xebc708[_0xc275('0x2b')]));}})});router[_0xc275('0x24')](_0xc275('0x31'),upload[_0xc275('0x32')](_0xc275('0x2c')),controller[_0xc275('0x33')]);var upload=multer({'storage':multer[_0xc275('0x2e')]({'destination':function(_0x94f9a7,_0x1c5dc4,_0x40d593){_0x40d593(null,path[_0xc275('0x26')](config[_0xc275('0x2f')],_0xc275('0x30')));},'filename':function(_0x3755b5,_0x49a42d,_0x3d8d82){_0x3d8d82(null,util[_0xc275('0x28')](_0xc275('0x29'),Date[_0xc275('0x2a')](),_0x49a42d[_0xc275('0x2b')]));}})});router['post']('/:id/customer_avatar',upload[_0xc275('0x32')](_0xc275('0x2c')),controller[_0xc275('0x34')]);var upload=multer({'storage':multer[_0xc275('0x2e')]({'destination':function(_0x741361,_0x4ebdf2,_0x21fb3d){_0x21fb3d(null,path['join'](config[_0xc275('0x2f')],'server/files/images/avatars/'));},'filename':function(_0x577f69,_0x2aff31,_0x41270d){_0x41270d(null,util[_0xc275('0x28')](_0xc275('0x29'),Date[_0xc275('0x2a')](),_0x2aff31[_0xc275('0x2b')]));}})});router[_0xc275('0x24')](_0xc275('0x17'),upload['single'](_0xc275('0x2c')),controller[_0xc275('0x35')]);router[_0xc275('0x24')](_0xc275('0x36'),controller[_0xc275('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0xc275('0x2e')]({'destination':function(_0x148efa,_0x3c20c3,_0x4e254c){const _0x4c63a0=path[_0xc275('0x26')](config[_0xc275('0x2f')],_0xc275('0x38'),_0xc275('0x39'),_0xc275('0x3a'));fs_extra[_0xc275('0x3b')](_0x4c63a0,function(){_0x4e254c(null,_0x4c63a0);});},'filename':function(_0x6aed59,_0xbc044c,_0x46c193){const _0x3043e0=_0xbc044c[_0xc275('0x2b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x40ddd9=path[_0xc275('0x3c')](_0x3043e0);const _0x2d046d=Date[_0xc275('0x2a')]()+'-'+_0x3043e0[_0xc275('0x3d')](_0x40ddd9,'')+_0x40ddd9;_0x46c193(null,_0x2d046d);}})});router['post']('/:id/offline',offlineUploadMulter[_0xc275('0x3e')](),controller[_0xc275('0x3f')]);router[_0xc275('0x24')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc275('0x40')]);router[_0xc275('0x24')](_0xc275('0x1c'),auth[_0xc275('0xa')](),controller[_0xc275('0x41')]);router[_0xc275('0x24')](_0xc275('0x42'),auth[_0xc275('0xa')](),controller[_0xc275('0x43')]);router[_0xc275('0x24')](_0xc275('0x44'),auth[_0xc275('0xa')](),controller[_0xc275('0x45')]);router[_0xc275('0x46')]('/:id',auth[_0xc275('0xa')](),controller[_0xc275('0x47')]);router[_0xc275('0x48')](_0xc275('0x49'),auth['isAuthenticated'](),controller[_0xc275('0x4a')]);router[_0xc275('0x48')](_0xc275('0x10'),auth[_0xc275('0xa')](),controller['removeDispositions']);router[_0xc275('0x48')](_0xc275('0x12'),auth[_0xc275('0xa')](),controller[_0xc275('0x4b')]);router['delete'](_0xc275('0x44'),auth[_0xc275('0xa')](),controller[_0xc275('0x4c')]);module['exports']=router;
\ No newline at end of file
+var _0x3938=['now','originalname','single','file','addLogo','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','update','delete','/:id/dispositions','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','get','isAuthenticated','describe','/:id','show','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/snippet','getSnippet','/:id/applications','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s'];(function(_0x3c4dad,_0x25ffd5){var _0x1a4f49=function(_0x6fe6c){while(--_0x6fe6c){_0x3c4dad['push'](_0x3c4dad['shift']());}};_0x1a4f49(++_0x25ffd5);}(_0x3938,0x17a));var _0x8393=function(_0x55e287,_0x36472d){_0x55e287=_0x55e287-0x0;var _0x582ca5=_0x3938[_0x55e287];return _0x582ca5;};'use strict';var multer=require(_0x8393('0x0'));var util=require(_0x8393('0x1'));var path=require(_0x8393('0x2'));var timeout=require(_0x8393('0x3'));var express=require(_0x8393('0x4'));var router=express[_0x8393('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8393('0x6'));var config=require(_0x8393('0x7'));var controller=require(_0x8393('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8393('0x9')]);router[_0x8393('0xa')]('/describe',auth[_0x8393('0xb')](),controller[_0x8393('0xc')]);router[_0x8393('0xa')](_0x8393('0xd'),auth[_0x8393('0xb')](),controller[_0x8393('0xe')]);router[_0x8393('0xa')]('/:id/dispositions',auth[_0x8393('0xb')](),controller[_0x8393('0xf')]);router[_0x8393('0xa')]('/:id/canned_answers',auth[_0x8393('0xb')](),controller[_0x8393('0x10')]);router[_0x8393('0xa')](_0x8393('0x11'),controller[_0x8393('0x12')]);router[_0x8393('0xa')](_0x8393('0x13'),controller[_0x8393('0x14')]);router[_0x8393('0xa')](_0x8393('0x15'),controller[_0x8393('0x16')]);router['get'](_0x8393('0x17'),controller['getSystemAvatar']);router[_0x8393('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x8393('0xa')](_0x8393('0x18'),controller[_0x8393('0x19')]);router[_0x8393('0xa')](_0x8393('0x1a'),auth['isAuthenticated'](),controller['getApplications']);router[_0x8393('0xa')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router['get'](_0x8393('0x1b'),controller[_0x8393('0x1c')]);router[_0x8393('0xa')]('/:id/offline_messages',auth[_0x8393('0xb')](),controller[_0x8393('0x1d')]);router['get'](_0x8393('0x1e'),auth[_0x8393('0xb')](),controller[_0x8393('0x1f')]);router[_0x8393('0x20')]('/',auth[_0x8393('0xb')](),controller[_0x8393('0x21')]);router[_0x8393('0x20')]('/:id/dispositions',auth[_0x8393('0xb')](),controller[_0x8393('0x22')]);router[_0x8393('0x20')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8393('0x23')]);var upload=multer({'storage':multer[_0x8393('0x24')]({'destination':function(_0x9d55b0,_0x34f0b5,_0x5b665e){_0x5b665e(null,path[_0x8393('0x25')](config[_0x8393('0x26')],_0x8393('0x27')));},'filename':function(_0x5453f0,_0x1a1b89,_0x4de7ba){_0x4de7ba(null,util[_0x8393('0x28')](_0x8393('0x29'),Date[_0x8393('0x2a')](),_0x1a1b89[_0x8393('0x2b')]));}})});router[_0x8393('0x20')](_0x8393('0x11'),upload[_0x8393('0x2c')](_0x8393('0x2d')),controller[_0x8393('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa4cbbb,_0x255dce,_0x41c879){_0x41c879(null,path[_0x8393('0x25')](config[_0x8393('0x26')],'server/files/images/avatars/'));},'filename':function(_0x8a3e40,_0x19e07e,_0x3dd03b){_0x3dd03b(null,util[_0x8393('0x28')](_0x8393('0x29'),Date[_0x8393('0x2a')](),_0x19e07e[_0x8393('0x2b')]));}})});router[_0x8393('0x20')](_0x8393('0x13'),upload['single'](_0x8393('0x2d')),controller[_0x8393('0x2f')]);var upload=multer({'storage':multer[_0x8393('0x24')]({'destination':function(_0x2bcc3d,_0x410937,_0x570e20){_0x570e20(null,path[_0x8393('0x25')](config[_0x8393('0x26')],'server/files/images/avatars/'));},'filename':function(_0xdacd88,_0x387872,_0x2c3535){_0x2c3535(null,util['format']('%s-%s',Date[_0x8393('0x2a')](),_0x387872[_0x8393('0x2b')]));}})});router[_0x8393('0x20')](_0x8393('0x15'),upload[_0x8393('0x2c')]('file'),controller[_0x8393('0x30')]);var upload=multer({'storage':multer[_0x8393('0x24')]({'destination':function(_0x118f8c,_0x5c52ca,_0x3c7053){_0x3c7053(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x396cc9,_0x247be8,_0x2b97e4){_0x2b97e4(null,util[_0x8393('0x28')](_0x8393('0x29'),Date[_0x8393('0x2a')](),_0x247be8[_0x8393('0x2b')]));}})});router['post'](_0x8393('0x17'),upload[_0x8393('0x2c')](_0x8393('0x2d')),controller[_0x8393('0x31')]);router['post'](_0x8393('0x32'),controller[_0x8393('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x8393('0x24')]({'destination':function(_0x960d82,_0x47ada8,_0x33fdc5){const _0x1bda7f=path['join'](config['root'],'server/files',_0x8393('0x34'),'offline-chat');fs_extra['ensureDir'](_0x1bda7f,function(){_0x33fdc5(null,_0x1bda7f);});},'filename':function(_0x561c93,_0x22188c,_0x8b83fa){const _0x5ab529=_0x22188c[_0x8393('0x2b')][_0x8393('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x514e0c=path[_0x8393('0x36')](_0x5ab529);const _0x367b95=Date['now']()+'-'+_0x5ab529['replace'](_0x514e0c,'')+_0x514e0c;_0x8b83fa(null,_0x367b95);}})});router['post'](_0x8393('0x37'),offlineUploadMulter[_0x8393('0x38')](),controller[_0x8393('0x39')]);router[_0x8393('0x20')](_0x8393('0x3a'),auth[_0x8393('0xb')](),controller[_0x8393('0x3b')]);router['post'](_0x8393('0x1a'),auth['isAuthenticated'](),controller[_0x8393('0x3c')]);router[_0x8393('0x20')](_0x8393('0x3d'),auth[_0x8393('0xb')](),controller[_0x8393('0x3e')]);router[_0x8393('0x20')](_0x8393('0x1e'),auth[_0x8393('0xb')](),controller['addAgents']);router['put'](_0x8393('0xd'),auth[_0x8393('0xb')](),controller[_0x8393('0x3f')]);router['delete'](_0x8393('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x8393('0x40')](_0x8393('0x41'),auth[_0x8393('0xb')](),controller[_0x8393('0x42')]);router[_0x8393('0x40')](_0x8393('0x43'),auth[_0x8393('0xb')](),controller[_0x8393('0x44')]);router[_0x8393('0x40')](_0x8393('0x1e'),auth['isAuthenticated'](),controller[_0x8393('0x45')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 7152e5c..763dca3 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 _0x1af5=['Google','sequelize','STRING','ENUM','AmazonAWS'];(function(_0xdb23fa,_0x254851){var _0x157954=function(_0x39346a){while(--_0x39346a){_0xdb23fa['push'](_0xdb23fa['shift']());}};_0x157954(++_0x254851);}(_0x1af5,0x17d));var _0x51af=function(_0x5424c4,_0x591b70){_0x5424c4=_0x5424c4-0x0;var _0x157cac=_0x1af5[_0x5424c4];return _0x157cac;};'use strict';var Sequelize=require(_0x51af('0x0'));module['exports']={'name':{'type':Sequelize[_0x51af('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x51af('0x2')](_0x51af('0x3'),_0x51af('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x51af('0x1')]},'data2':{'type':Sequelize[_0x51af('0x1')]}};
\ No newline at end of file
+var _0xd43e=['Google','sequelize','STRING','ENUM','AmazonAWS'];(function(_0x1e238c,_0x4a17d2){var _0x308f0d=function(_0x49dd90){while(--_0x49dd90){_0x1e238c['push'](_0x1e238c['shift']());}};_0x308f0d(++_0x4a17d2);}(_0xd43e,0x88));var _0xed43=function(_0x4a6470,_0x167a61){_0x4a6470=_0x4a6470-0x0;var _0x5203d7=_0xd43e[_0x4a6470];return _0x5203d7;};'use strict';var Sequelize=require(_0xed43('0x0'));module['exports']={'name':{'type':Sequelize[_0xed43('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xed43('0x2')](_0xed43('0x3'),_0xed43('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index cd1cdf5..de98b17 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 _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x5d9de5,_0x19608d){var _0x1e188e=function(_0xdc0762){while(--_0xdc0762){_0x5d9de5['push'](_0x5d9de5['shift']());}};_0x1e188e(++_0x19608d);}(_0x2ef3,0xba));var _0x32ef=function(_0x5075a5,_0x175b42){_0x5075a5=_0x5075a5-0x0;var _0x31cb0f=_0x2ef3[_0x5075a5];return _0x31cb0f;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};
\ No newline at end of file
+var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0xb096ef,_0x20ebdf){var _0x5ac5b=function(_0x11b4be){while(--_0x11b4be){_0xb096ef['push'](_0xb096ef['shift']());}};_0x5ac5b(++_0x20ebdf);}(_0x2ef3,0xba));var _0x32ef=function(_0x29f0c7,_0x41bb6d){_0x29f0c7=_0x29f0c7-0x0;var _0xb09310=_0x2ef3[_0x29f0c7];return _0xb09310;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 777415c..3a3e722 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 _0xd796=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers'];(function(_0x2d4c16,_0x1cc64a){var _0x354ed8=function(_0x1aee44){while(--_0x1aee44){_0x2d4c16['push'](_0x2d4c16['shift']());}};_0x354ed8(++_0x1cc64a);}(_0xd796,0xea));var _0x6d79=function(_0x506550,_0x5d2359){_0x506550=_0x506550-0x0;var _0x344791=_0xd796[_0x506550];return _0x344791;};'use strict';var _=require(_0x6d79('0x0'));var util=require('util');var logger=require(_0x6d79('0x1'))(_0x6d79('0x2'));var moment=require(_0x6d79('0x3'));var BPromise=require(_0x6d79('0x4'));var rp=require(_0x6d79('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6d79('0x6'));var config=require(_0x6d79('0x7'));var attributes=require(_0x6d79('0x8'));module[_0x6d79('0x9')]=function(_0x57d7bd,_0x46d95e){return _0x57d7bd[_0x6d79('0xa')](_0x6d79('0xb'),attributes,{'tableName':_0x6d79('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x14bb=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','lodash','util','api','moment'];(function(_0x27d527,_0x529167){var _0x4a09bd=function(_0x4a1031){while(--_0x4a1031){_0x27d527['push'](_0x27d527['shift']());}};_0x4a09bd(++_0x529167);}(_0x14bb,0x1e8));var _0xb14b=function(_0x5486c2,_0x30c249){_0x5486c2=_0x5486c2-0x0;var _0x45371c=_0x14bb[_0x5486c2];return _0x45371c;};'use strict';var _=require(_0xb14b('0x0'));var util=require(_0xb14b('0x1'));var logger=require('../../config/logger')(_0xb14b('0x2'));var moment=require(_0xb14b('0x3'));var BPromise=require(_0xb14b('0x4'));var rp=require(_0xb14b('0x5'));var fs=require('fs');var path=require(_0xb14b('0x6'));var rimraf=require(_0xb14b('0x7'));var config=require(_0xb14b('0x8'));var attributes=require(_0xb14b('0x9'));module[_0xb14b('0xa')]=function(_0x1db7e6,_0x5c3d29){return _0x1db7e6['define'](_0xb14b('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index f69b54e..6d0f449 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 _0x93e9=['request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s'];(function(_0x295147,_0x5abf17){var _0x39ce09=function(_0x2b7d92){while(--_0x2b7d92){_0x295147['push'](_0x295147['shift']());}};_0x39ce09(++_0x5abf17);}(_0x93e9,0xcc));var _0x993e=function(_0x38db20,_0x1759cb){_0x38db20=_0x38db20-0x0;var _0x1918f4=_0x93e9[_0x38db20];return _0x1918f4;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var moment=require(_0x993e('0x2'));var BPromise=require(_0x993e('0x3'));var rs=require(_0x993e('0x4'));var fs=require('fs');var Redis=require(_0x993e('0x5'));var db=require(_0x993e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x993e('0x7'));var config=require(_0x993e('0x8'));var jayson=require(_0x993e('0x9'));var client=jayson[_0x993e('0xa')][_0x993e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2366d9,_0x12ac94,_0x1aef74){return new BPromise(function(_0x53d0ce,_0x4701d3){return client[_0x993e('0xc')](_0x2366d9,_0x1aef74)[_0x993e('0xd')](function(_0x280291){logger[_0x993e('0xe')](_0x993e('0xf'),_0x12ac94,_0x993e('0x10'));logger['debug'](_0x993e('0x11'),_0x12ac94,_0x993e('0x10'),JSON['stringify'](_0x280291));if(_0x280291['error']){if(_0x280291[_0x993e('0x12')]['code']===0x1f4){logger[_0x993e('0x12')]('CloudProvider,\x20%s,\x20%s',_0x12ac94,_0x280291['error'][_0x993e('0x13')]);return _0x4701d3(_0x280291[_0x993e('0x12')][_0x993e('0x13')]);}logger[_0x993e('0x12')](_0x993e('0xf'),_0x12ac94,_0x280291[_0x993e('0x12')][_0x993e('0x13')]);return _0x53d0ce(_0x280291[_0x993e('0x12')][_0x993e('0x13')]);}else{logger[_0x993e('0xe')](_0x993e('0xf'),_0x12ac94,_0x993e('0x10'));_0x53d0ce(_0x280291[_0x993e('0x14')][_0x993e('0x13')]);}})[_0x993e('0x15')](function(_0x454475){logger[_0x993e('0x12')]('CloudProvider,\x20%s,\x20%s',_0x12ac94,_0x454475);_0x4701d3(_0x454475);});});}
\ No newline at end of file
+var _0x073d=['request','then','info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x073d,0xd2));var _0xd073=function(_0x312962,_0x282d40){_0x312962=_0x312962-0x0;var _0x3e85d0=_0x073d[_0x312962];return _0x3e85d0;};'use strict';var _=require('lodash');var util=require(_0xd073('0x0'));var moment=require(_0xd073('0x1'));var BPromise=require(_0xd073('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd073('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd073('0x4'));var logger=require(_0xd073('0x5'))('rpc');var config=require(_0xd073('0x6'));var jayson=require(_0xd073('0x7'));var client=jayson[_0xd073('0x8')][_0xd073('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f5792,_0x3541cd,_0x440c91){return new BPromise(function(_0x409e4a,_0x199033){return client[_0xd073('0xa')](_0x2f5792,_0x440c91)[_0xd073('0xb')](function(_0x1c9295){logger[_0xd073('0xc')](_0xd073('0xd'),_0x3541cd,'request\x20sent');logger['debug'](_0xd073('0xe'),_0x3541cd,'request\x20sent',JSON[_0xd073('0xf')](_0x1c9295));if(_0x1c9295[_0xd073('0x10')]){if(_0x1c9295[_0xd073('0x10')][_0xd073('0x11')]===0x1f4){logger[_0xd073('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3541cd,_0x1c9295[_0xd073('0x10')][_0xd073('0x12')]);return _0x199033(_0x1c9295[_0xd073('0x10')][_0xd073('0x12')]);}logger['error'](_0xd073('0xd'),_0x3541cd,_0x1c9295[_0xd073('0x10')]['message']);return _0x409e4a(_0x1c9295[_0xd073('0x10')][_0xd073('0x12')]);}else{logger[_0xd073('0xc')](_0xd073('0xd'),_0x3541cd,'request\x20sent');_0x409e4a(_0x1c9295[_0xd073('0x13')]['message']);}})['catch'](function(_0x195c5d){logger[_0xd073('0x10')](_0xd073('0xd'),_0x3541cd,_0x195c5d);_0x199033(_0x195c5d);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 649fec5..9fe0c8e 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 _0xb664=['../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x41f5a6,_0xb35c51){var _0x241efd=function(_0x2cfaa5){while(--_0x2cfaa5){_0x41f5a6['push'](_0x41f5a6['shift']());}};_0x241efd(++_0xb35c51);}(_0xb664,0x163));var _0x4b66=function(_0x5cec3d,_0x1e7628){_0x5cec3d=_0x5cec3d-0x0;var _0x3eceb6=_0xb664[_0x5cec3d];return _0x3eceb6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4b66('0x0'));var timeout=require('connect-timeout');var express=require(_0x4b66('0x1'));var router=express[_0x4b66('0x2')]();var fs_extra=require(_0x4b66('0x3'));var auth=require(_0x4b66('0x4'));var interaction=require(_0x4b66('0x5'));var config=require(_0x4b66('0x6'));var controller=require('./cloudProvider.controller');router['get']('/',auth[_0x4b66('0x7')](),controller['index']);router[_0x4b66('0x8')](_0x4b66('0x9'),auth[_0x4b66('0x7')](),controller[_0x4b66('0xa')]);router[_0x4b66('0xb')]('/',auth[_0x4b66('0x7')](),controller[_0x4b66('0xc')]);router[_0x4b66('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x4b66('0xe')]);router[_0x4b66('0xf')](_0x4b66('0x9'),auth['isAuthenticated'](),controller[_0x4b66('0x10')]);module[_0x4b66('0x11')]=router;
\ No newline at end of file
+var _0x05f3=['destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cloudProvider.controller','index','get','/:id','isAuthenticated','show','post','update','delete'];(function(_0x550f45,_0x506e32){var _0x4fa063=function(_0x3b76c0){while(--_0x3b76c0){_0x550f45['push'](_0x550f45['shift']());}};_0x4fa063(++_0x506e32);}(_0x05f3,0xf0));var _0x305f=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0x05f3[_0x3b90ab];return _0x206e92;};'use strict';var multer=require('multer');var util=require(_0x305f('0x0'));var path=require(_0x305f('0x1'));var timeout=require(_0x305f('0x2'));var express=require(_0x305f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x305f('0x4'));var config=require(_0x305f('0x5'));var controller=require(_0x305f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x305f('0x7')]);router[_0x305f('0x8')](_0x305f('0x9'),auth[_0x305f('0xa')](),controller[_0x305f('0xb')]);router[_0x305f('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x305f('0x9'),auth['isAuthenticated'](),controller[_0x305f('0xd')]);router[_0x305f('0xe')](_0x305f('0x9'),auth[_0x305f('0xa')](),controller[_0x305f('0xf')]);module[_0x305f('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index f6a0280..47bea21 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 _0xfe62=['STRING','name','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe62,0x76));var _0x2fe6=function(_0x587a1f,_0x6f50b7){_0x587a1f=_0x587a1f-0x0;var _0x317bc1=_0xfe62[_0x587a1f];return _0x317bc1;};'use strict';var Sequelize=require(_0x2fe6('0x0'));module[_0x2fe6('0x1')]={'name':{'type':Sequelize[_0x2fe6('0x2')],'unique':_0x2fe6('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2fe6('0x2')]},'companyId':{'type':Sequelize[_0x2fe6('0x2')]},'website':{'type':Sequelize[_0x2fe6('0x2')]},'phone':{'type':Sequelize[_0x2fe6('0x2')]},'fax':{'type':Sequelize[_0x2fe6('0x2')]},'type':{'type':Sequelize[_0x2fe6('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x2fe6('0x2')]},'city':{'type':Sequelize[_0x2fe6('0x2')]},'country':{'type':Sequelize[_0x2fe6('0x2')]},'email':{'type':Sequelize[_0x2fe6('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2fe6('0x2')]},'sStreet':{'type':Sequelize[_0x2fe6('0x2')]},'sPostalCode':{'type':Sequelize[_0x2fe6('0x2')]},'sCity':{'type':Sequelize[_0x2fe6('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2fe6('0x2')]}};
\ No newline at end of file
+var _0x5c4a=['STRING','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x28d25e,_0x3cdc7a){_0x28d25e=_0x28d25e-0x0;var _0x1be491=_0x5c4a[_0x28d25e];return _0x1be491;};'use strict';var Sequelize=require('sequelize');module[_0xa5c4('0x0')]={'name':{'type':Sequelize[_0xa5c4('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa5c4('0x1')]},'companyId':{'type':Sequelize[_0xa5c4('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa5c4('0x1')]},'fax':{'type':Sequelize[_0xa5c4('0x1')]},'type':{'type':Sequelize[_0xa5c4('0x1')]},'street':{'type':Sequelize[_0xa5c4('0x1')]},'postalCode':{'type':Sequelize[_0xa5c4('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa5c4('0x1')]},'email':{'type':Sequelize[_0xa5c4('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa5c4('0x1')]},'sStreet':{'type':Sequelize[_0xa5c4('0x1')]},'sPostalCode':{'type':Sequelize[_0xa5c4('0x1')]},'sCity':{'type':Sequelize[_0xa5c4('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa5c4('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 82b4533..9844a4b 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 _0xd07c=['Companies','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','rawAttributes','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','findOne','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','count','offset','Content-Range','reject','update','destroy','then','get'];(function(_0x3f5389,_0x55588e){var _0x1734a4=function(_0x1ef7d5){while(--_0x1ef7d5){_0x3f5389['push'](_0x3f5389['shift']());}};_0x1734a4(++_0x55588e);}(_0xd07c,0x8b));var _0xcd07=function(_0x49da9d,_0x5f1b0c){_0x49da9d=_0x49da9d-0x0;var _0x5e8c59=_0xd07c[_0x49da9d];return _0x5e8c59;};'use strict';var emlformat=require(_0xcd07('0x0'));var rimraf=require(_0xcd07('0x1'));var zipdir=require(_0xcd07('0x2'));var jsonpatch=require(_0xcd07('0x3'));var rp=require(_0xcd07('0x4'));var moment=require(_0xcd07('0x5'));var BPromise=require(_0xcd07('0x6'));var Mustache=require(_0xcd07('0x7'));var util=require(_0xcd07('0x8'));var path=require(_0xcd07('0x9'));var sox=require(_0xcd07('0xa'));var csv=require(_0xcd07('0xb'));var ejs=require(_0xcd07('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd07('0xd'));var squel=require(_0xcd07('0xe'));var crypto=require('crypto');var jsforce=require(_0xcd07('0xf'));var deskjs=require(_0xcd07('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcd07('0x11'));var Papa=require(_0xcd07('0x12'));var Redis=require(_0xcd07('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcd07('0x14'));var hardwareService=require(_0xcd07('0x15'));var logger=require(_0xcd07('0x16'))(_0xcd07('0x17'));var utils=require(_0xcd07('0x18'));var config=require(_0xcd07('0x19'));var licenseUtil=require(_0xcd07('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x461464,_0x1f17ed){_0x1f17ed=_0x1f17ed||0xcc;return function(_0x3deeee){if(_0x3deeee){return _0x461464['sendStatus'](_0x1f17ed);}return _0x461464[_0xcd07('0x1b')](_0x1f17ed)[_0xcd07('0x1c')]();};}function respondWithResult(_0x5cf843,_0x5c1d8f){_0x5c1d8f=_0x5c1d8f||0xc8;return function(_0x59afff){if(_0x59afff){return _0x5cf843[_0xcd07('0x1b')](_0x5c1d8f)[_0xcd07('0x1d')](_0x59afff);}};}function respondWithFilteredResult(_0x1ee739,_0x4f276f){return function(_0x4f1ad){if(_0x4f1ad){var _0x35733c=typeof _0x4f276f['offset']===_0xcd07('0x1e')&&typeof _0x4f276f['limit']===_0xcd07('0x1e');var _0x541bbb=_0x4f1ad[_0xcd07('0x1f')];var _0x490ce9=_0x35733c?0x0:_0x4f276f[_0xcd07('0x20')];var _0x10bce0=_0x35733c?_0x4f1ad['count']:_0x4f276f[_0xcd07('0x20')]+_0x4f276f['limit'];var _0x100959;if(_0x10bce0>=_0x541bbb){_0x10bce0=_0x541bbb;_0x100959=0xc8;}else{_0x100959=0xce;}_0x1ee739[_0xcd07('0x1b')](_0x100959);return _0x1ee739['set'](_0xcd07('0x21'),_0x490ce9+'-'+_0x10bce0+'/'+_0x541bbb)[_0xcd07('0x1d')](_0x4f1ad);}return null;};}function patchUpdates(_0x3bb0e7){return function(_0x2a2dd6){try{jsonpatch['apply'](_0x2a2dd6,_0x3bb0e7,!![]);}catch(_0x1f5ef5){return BPromise[_0xcd07('0x22')](_0x1f5ef5);}return _0x2a2dd6['save']();};}function saveUpdates(_0x50a95a,_0x329cde){return function(_0x15dd53){if(_0x15dd53){return _0x15dd53[_0xcd07('0x23')](_0x50a95a)['then'](function(_0xf22f95){return _0xf22f95;});}return null;};}function removeEntity(_0x593972,_0x256972){return function(_0xda9c83){if(_0xda9c83){return _0xda9c83[_0xcd07('0x24')]()[_0xcd07('0x25')](function(){var _0x2c4665=_0xda9c83[_0xcd07('0x26')]({'plain':!![]});var _0x59d315=_0xcd07('0x27');return db[_0xcd07('0x28')][_0xcd07('0x24')]({'where':{'type':_0x59d315,'resourceId':_0x2c4665['id']}})['then'](function(){return _0xda9c83;});})[_0xcd07('0x25')](function(){_0x593972[_0xcd07('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x597580,_0x5aadfc){return function(_0x4f169b){if(!_0x4f169b){_0x597580[_0xcd07('0x29')](0x194);}return _0x4f169b;};}function handleError(_0x47f5dc,_0x418e33){_0x418e33=_0x418e33||0x1f4;return function(_0x5dd418){logger[_0xcd07('0x2a')](_0x5dd418[_0xcd07('0x2b')]);if(_0x5dd418[_0xcd07('0x2c')]){delete _0x5dd418[_0xcd07('0x2c')];}_0x47f5dc[_0xcd07('0x1b')](_0x418e33)[_0xcd07('0x2d')](_0x5dd418);};}exports[_0xcd07('0x2e')]=function(_0xaacae3,_0x2886cd){var _0x33bbeb={},_0x35ae69={},_0x1dbc2f={'count':0x0,'rows':[]};return db[_0xcd07('0x2f')][_0xcd07('0x30')]()[_0xcd07('0x25')](function(_0x4151c5){_0x35ae69[_0xcd07('0x31')]=_[_0xcd07('0x32')](_0x4151c5);_0x35ae69[_0xcd07('0x33')]=_['keys'](_0xaacae3[_0xcd07('0x33')]);_0x35ae69[_0xcd07('0x34')]=_[_0xcd07('0x35')](_0x35ae69['model'],_0x35ae69[_0xcd07('0x33')]);_0x33bbeb[_0xcd07('0x36')]=_[_0xcd07('0x35')](_0x35ae69[_0xcd07('0x31')],qs['fields'](_0xaacae3[_0xcd07('0x33')]['fields']));_0x33bbeb[_0xcd07('0x36')]=_0x33bbeb['attributes']['length']?_0x33bbeb[_0xcd07('0x36')]:_0x35ae69[_0xcd07('0x31')];if(!_0xaacae3['query'][_0xcd07('0x37')](_0xcd07('0x38'))){_0x33bbeb[_0xcd07('0x39')]=qs[_0xcd07('0x39')](_0xaacae3[_0xcd07('0x33')][_0xcd07('0x39')]);_0x33bbeb[_0xcd07('0x20')]=qs[_0xcd07('0x20')](_0xaacae3[_0xcd07('0x33')][_0xcd07('0x20')]);}_0x33bbeb[_0xcd07('0x3a')]=qs[_0xcd07('0x3b')](_0xaacae3[_0xcd07('0x33')][_0xcd07('0x3b')]);_0x33bbeb[_0xcd07('0x3c')]=qs[_0xcd07('0x34')](_[_0xcd07('0x3d')](_0xaacae3[_0xcd07('0x33')],_0x35ae69['filters']),_0x4151c5);if(_0xaacae3['query'][_0xcd07('0x3e')]){_0x33bbeb[_0xcd07('0x3c')]=_['merge'](_0x33bbeb[_0xcd07('0x3c')],{'$or':_['map'](_0x33bbeb[_0xcd07('0x36')],function(_0x19fa51){var _0x571845={};_0x571845[_0x19fa51]={'$like':'%'+_0xaacae3[_0xcd07('0x33')][_0xcd07('0x3e')]+'%'};return _0x571845;})});}_0x33bbeb=_[_0xcd07('0x3f')]({},_0x33bbeb,_0xaacae3[_0xcd07('0x40')]);var _0x5978ff={'where':_0x33bbeb['where']};return db[_0xcd07('0x2f')][_0xcd07('0x1f')](_0x5978ff)['then'](function(_0x4e32a4){_0x1dbc2f[_0xcd07('0x1f')]=_0x4e32a4;if(_0xaacae3[_0xcd07('0x33')][_0xcd07('0x41')]){_0x33bbeb[_0xcd07('0x42')]=[{'all':!![]}];}return db[_0xcd07('0x2f')]['findAll'](_0x33bbeb);})[_0xcd07('0x25')](function(_0x2a55fb){_0x1dbc2f[_0xcd07('0x43')]=_0x2a55fb;return _0x1dbc2f;})[_0xcd07('0x25')](respondWithFilteredResult(_0x2886cd,_0x33bbeb))['catch'](handleError(_0x2886cd,null));})[_0xcd07('0x44')](handleError(_0x2886cd,null));};exports[_0xcd07('0x45')]=function(_0x5e58ff,_0x425224){var _0x407051={'raw':![],'where':{'id':_0x5e58ff['params']['id']}},_0x940722={};_0x940722[_0xcd07('0x31')]=_[_0xcd07('0x32')](db[_0xcd07('0x2f')][_0xcd07('0x46')]);_0x940722[_0xcd07('0x33')]=_['keys'](_0x5e58ff[_0xcd07('0x33')]);_0x940722[_0xcd07('0x34')]=_[_0xcd07('0x35')](_0x940722[_0xcd07('0x31')],_0x940722[_0xcd07('0x33')]);_0x407051[_0xcd07('0x36')]=_[_0xcd07('0x35')](_0x940722[_0xcd07('0x31')],qs[_0xcd07('0x47')](_0x5e58ff[_0xcd07('0x33')][_0xcd07('0x47')]));_0x407051['attributes']=_0x407051['attributes'][_0xcd07('0x48')]?_0x407051[_0xcd07('0x36')]:_0x940722['model'];if(_0x5e58ff['query'][_0xcd07('0x41')]){_0x407051[_0xcd07('0x42')]=[{'all':!![]}];}_0x407051=_[_0xcd07('0x3f')]({},_0x407051,_0x5e58ff[_0xcd07('0x40')]);return db['CmCompany'][_0xcd07('0x49')](_0x407051)[_0xcd07('0x25')](handleEntityNotFound(_0x425224,null))[_0xcd07('0x25')](respondWithResult(_0x425224,null))[_0xcd07('0x44')](handleError(_0x425224,null));};exports[_0xcd07('0x4a')]=function(_0x5171eb,_0x367dc8){return db[_0xcd07('0x2f')][_0xcd07('0x4a')](_0x5171eb[_0xcd07('0x4b')],{})[_0xcd07('0x25')](function(_0x5f9bbc){var _0x4bc393=_0x5171eb[_0xcd07('0x4c')]['get']({'plain':!![]});if(!_0x4bc393)throw new Error(_0xcd07('0x4d'));if(_0x4bc393[_0xcd07('0x4e')]===_0xcd07('0x4c')){var _0x21fd22=_0x5f9bbc[_0xcd07('0x26')]({'plain':!![]});var _0x210a4=_0xcd07('0x27');return db[_0xcd07('0x4f')][_0xcd07('0x49')]({'where':{'name':_0x210a4,'userProfileId':_0x4bc393['userProfileId']},'raw':!![]})[_0xcd07('0x25')](function(_0x24e97b){if(_0x24e97b&&_0x24e97b['autoAssociation']===0x0){return db[_0xcd07('0x28')][_0xcd07('0x4a')]({'name':_0x21fd22[_0xcd07('0x2c')],'resourceId':_0x21fd22['id'],'type':_0x24e97b['name'],'sectionId':_0x24e97b['id']},{})[_0xcd07('0x25')](function(){return _0x5f9bbc;});}else{return _0x5f9bbc;}})[_0xcd07('0x44')](function(_0x3c6d95){logger[_0xcd07('0x2a')](_0xcd07('0x50'),_0x3c6d95);throw _0x3c6d95;});}return _0x5f9bbc;})[_0xcd07('0x25')](respondWithResult(_0x367dc8,0xc9))[_0xcd07('0x44')](handleError(_0x367dc8,null));};exports[_0xcd07('0x23')]=function(_0x3bfd34,_0x43ed3c){if(_0x3bfd34[_0xcd07('0x4b')]['id']){delete _0x3bfd34[_0xcd07('0x4b')]['id'];}return db[_0xcd07('0x2f')][_0xcd07('0x49')]({'where':{'id':_0x3bfd34['params']['id']}})['then'](handleEntityNotFound(_0x43ed3c,null))[_0xcd07('0x25')](saveUpdates(_0x3bfd34[_0xcd07('0x4b')],null))[_0xcd07('0x25')](respondWithResult(_0x43ed3c,null))['catch'](handleError(_0x43ed3c,null));};exports[_0xcd07('0x24')]=function(_0x6c4da8,_0x40f3a4){return db['CmCompany'][_0xcd07('0x49')]({'where':{'id':_0x6c4da8[_0xcd07('0x51')]['id']}})[_0xcd07('0x25')](handleEntityNotFound(_0x40f3a4,null))['then'](removeEntity(_0x40f3a4,null))[_0xcd07('0x44')](handleError(_0x40f3a4,null));};exports[_0xcd07('0x30')]=function(_0x195d89,_0x5b5279){return db[_0xcd07('0x2f')]['describe']()[_0xcd07('0x25')](respondWithResult(_0x5b5279,null))[_0xcd07('0x44')](handleError(_0x5b5279,null));};exports[_0xcd07('0x52')]=function(_0x2cb206,_0x2a2d88,_0x5a1c5e){return db[_0xcd07('0x53')][_0xcd07('0x49')]({'where':{'id':_0x2cb206['params']['id']}})[_0xcd07('0x25')](handleEntityNotFound(_0x2a2d88,null))[_0xcd07('0x25')](function(_0x26ac4b){if(_0x26ac4b){return _0x26ac4b[_0xcd07('0x52')](_0x2cb206[_0xcd07('0x4b')][_0xcd07('0x54')],_[_0xcd07('0x55')](_0x2cb206[_0xcd07('0x4b')],[_0xcd07('0x54'),'id'])||{});}})['then'](respondWithResult(_0x2a2d88,null))[_0xcd07('0x44')](handleError(_0x2a2d88,null));};exports[_0xcd07('0x56')]=function(_0x491045,_0x46e37e,_0x8f8f6e){var _0x5973db={};var _0x1000a6={};var _0xc50108;var _0x1179db;return db[_0xcd07('0x2f')][_0xcd07('0x57')]({'where':{'id':_0x491045[_0xcd07('0x51')]['id']}})[_0xcd07('0x25')](handleEntityNotFound(_0x46e37e,null))[_0xcd07('0x25')](function(_0x3a953b){if(_0x3a953b){_0xc50108=_0x3a953b;_0x1000a6[_0xcd07('0x31')]=_[_0xcd07('0x32')](db['CmContact'][_0xcd07('0x46')]);_0x1000a6[_0xcd07('0x33')]=_[_0xcd07('0x32')](_0x491045[_0xcd07('0x33')]);_0x1000a6[_0xcd07('0x34')]=_[_0xcd07('0x35')](_0x1000a6[_0xcd07('0x31')],_0x1000a6[_0xcd07('0x33')]);_0x5973db[_0xcd07('0x36')]=_['intersection'](_0x1000a6[_0xcd07('0x31')],qs[_0xcd07('0x47')](_0x491045[_0xcd07('0x33')][_0xcd07('0x47')]));_0x5973db[_0xcd07('0x36')]=_0x5973db[_0xcd07('0x36')][_0xcd07('0x48')]?_0x5973db[_0xcd07('0x36')]:_0x1000a6['model'];_0x5973db[_0xcd07('0x3a')]=qs[_0xcd07('0x3b')](_0x491045['query'][_0xcd07('0x3b')]);_0x5973db[_0xcd07('0x3c')]=qs['filters'](_[_0xcd07('0x3d')](_0x491045[_0xcd07('0x33')],_0x1000a6[_0xcd07('0x34')]));if(_0x491045[_0xcd07('0x33')]['filter']){_0x5973db[_0xcd07('0x3c')]=_[_0xcd07('0x3f')](_0x5973db['where'],{'$or':_[_0xcd07('0x58')](_0x5973db['attributes'],function(_0x554fea){var _0x2ea2a2={};_0x2ea2a2[_0x554fea]={'$like':'%'+_0x491045[_0xcd07('0x33')]['filter']+'%'};return _0x2ea2a2;})});}_0x5973db=_['merge']({},_0x5973db,_0x491045['options']);return _0xc50108[_0xcd07('0x56')](_0x5973db);}})[_0xcd07('0x25')](function(_0x14c1e2){if(_0x14c1e2){_0x1179db=_0x14c1e2[_0xcd07('0x48')];if(!_0x491045[_0xcd07('0x33')][_0xcd07('0x37')](_0xcd07('0x38'))){_0x5973db[_0xcd07('0x39')]=qs['limit'](_0x491045[_0xcd07('0x33')]['limit']);_0x5973db[_0xcd07('0x20')]=qs['offset'](_0x491045[_0xcd07('0x33')]['offset']);}return _0xc50108[_0xcd07('0x56')](_0x5973db);}})['then'](function(_0x4258e7){if(_0x4258e7){return _0x4258e7?{'count':_0x1179db,'rows':_0x4258e7}:null;}})[_0xcd07('0x25')](respondWithResult(_0x46e37e,null))[_0xcd07('0x44')](handleError(_0x46e37e,null));};
\ No newline at end of file
+var _0x59fd=['options','includeAll','include','catch','show','length','find','create','body','role','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContact','addContacts','ids','omit','getContacts','rawAttributes','order','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','sendStatus','error','stack','name','send','index','CmCompany','describe','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x59fd,0xbc));var _0xd59f=function(_0x1e237a,_0x43991a){_0x1e237a=_0x1e237a-0x0;var _0x461d8a=_0x59fd[_0x1e237a];return _0x461d8a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd59f('0x0'));var jsonpatch=require(_0xd59f('0x1'));var rp=require(_0xd59f('0x2'));var moment=require(_0xd59f('0x3'));var BPromise=require(_0xd59f('0x4'));var Mustache=require(_0xd59f('0x5'));var util=require(_0xd59f('0x6'));var path=require(_0xd59f('0x7'));var sox=require(_0xd59f('0x8'));var csv=require(_0xd59f('0x9'));var ejs=require(_0xd59f('0xa'));var fs=require('fs');var fs_extra=require(_0xd59f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd59f('0xc'));var jsforce=require(_0xd59f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd59f('0x9'));var querystring=require(_0xd59f('0xe'));var Papa=require('papaparse');var Redis=require(_0xd59f('0xf'));var authService=require(_0xd59f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd59f('0x11'));var logger=require('../../config/logger')(_0xd59f('0x12'));var utils=require('../../config/utils');var config=require(_0xd59f('0x13'));var licenseUtil=require(_0xd59f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x159b60,_0x256974){_0x256974=_0x256974||0xcc;return function(_0x188506){if(_0x188506){return _0x159b60['sendStatus'](_0x256974);}return _0x159b60[_0xd59f('0x15')](_0x256974)[_0xd59f('0x16')]();};}function respondWithResult(_0x3f26fb,_0x1bc60a){_0x1bc60a=_0x1bc60a||0xc8;return function(_0x535535){if(_0x535535){return _0x3f26fb[_0xd59f('0x15')](_0x1bc60a)[_0xd59f('0x17')](_0x535535);}};}function respondWithFilteredResult(_0x14dc2a,_0x2cc253){return function(_0x3e806e){if(_0x3e806e){var _0x3ccffa=typeof _0x2cc253[_0xd59f('0x18')]==='undefined'&&typeof _0x2cc253[_0xd59f('0x19')]===_0xd59f('0x1a');var _0x1b1550=_0x3e806e[_0xd59f('0x1b')];var _0x3ca53f=_0x3ccffa?0x0:_0x2cc253[_0xd59f('0x18')];var _0x41c92d=_0x3ccffa?_0x3e806e[_0xd59f('0x1b')]:_0x2cc253[_0xd59f('0x18')]+_0x2cc253[_0xd59f('0x19')];var _0x556338;if(_0x41c92d>=_0x1b1550){_0x41c92d=_0x1b1550;_0x556338=0xc8;}else{_0x556338=0xce;}_0x14dc2a[_0xd59f('0x15')](_0x556338);return _0x14dc2a[_0xd59f('0x1c')](_0xd59f('0x1d'),_0x3ca53f+'-'+_0x41c92d+'/'+_0x1b1550)['json'](_0x3e806e);}return null;};}function patchUpdates(_0x390ebd){return function(_0x16312f){try{jsonpatch[_0xd59f('0x1e')](_0x16312f,_0x390ebd,!![]);}catch(_0x18a128){return BPromise[_0xd59f('0x1f')](_0x18a128);}return _0x16312f[_0xd59f('0x20')]();};}function saveUpdates(_0xaf77cd,_0x18e000){return function(_0x4bf0bc){if(_0x4bf0bc){return _0x4bf0bc[_0xd59f('0x21')](_0xaf77cd)[_0xd59f('0x22')](function(_0x14ab65){return _0x14ab65;});}return null;};}function removeEntity(_0x1d61d9,_0x4a62ba){return function(_0x562b00){if(_0x562b00){return _0x562b00[_0xd59f('0x23')]()['then'](function(){var _0x25f436=_0x562b00[_0xd59f('0x24')]({'plain':!![]});var _0x28299f=_0xd59f('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x28299f,'resourceId':_0x25f436['id']}})[_0xd59f('0x22')](function(){return _0x562b00;});})[_0xd59f('0x22')](function(){_0x1d61d9[_0xd59f('0x15')](0xcc)[_0xd59f('0x16')]();});}};}function handleEntityNotFound(_0x4a9b92,_0x3bbc31){return function(_0x18d9a6){if(!_0x18d9a6){_0x4a9b92[_0xd59f('0x26')](0x194);}return _0x18d9a6;};}function handleError(_0x5349bd,_0x583caa){_0x583caa=_0x583caa||0x1f4;return function(_0x25431d){logger[_0xd59f('0x27')](_0x25431d[_0xd59f('0x28')]);if(_0x25431d['name']){delete _0x25431d[_0xd59f('0x29')];}_0x5349bd['status'](_0x583caa)[_0xd59f('0x2a')](_0x25431d);};}exports[_0xd59f('0x2b')]=function(_0x5c13eb,_0x805f62){var _0x4aa71b={},_0x382e70={},_0x1f6861={'count':0x0,'rows':[]};return db[_0xd59f('0x2c')][_0xd59f('0x2d')]()[_0xd59f('0x22')](function(_0x56aca9){_0x382e70['model']=_[_0xd59f('0x2e')](_0x56aca9);_0x382e70[_0xd59f('0x2f')]=_['keys'](_0x5c13eb[_0xd59f('0x2f')]);_0x382e70['filters']=_[_0xd59f('0x30')](_0x382e70[_0xd59f('0x31')],_0x382e70['query']);_0x4aa71b['attributes']=_[_0xd59f('0x30')](_0x382e70['model'],qs[_0xd59f('0x32')](_0x5c13eb[_0xd59f('0x2f')][_0xd59f('0x32')]));_0x4aa71b[_0xd59f('0x33')]=_0x4aa71b[_0xd59f('0x33')]['length']?_0x4aa71b['attributes']:_0x382e70[_0xd59f('0x31')];if(!_0x5c13eb[_0xd59f('0x2f')][_0xd59f('0x34')](_0xd59f('0x35'))){_0x4aa71b[_0xd59f('0x19')]=qs[_0xd59f('0x19')](_0x5c13eb[_0xd59f('0x2f')][_0xd59f('0x19')]);_0x4aa71b[_0xd59f('0x18')]=qs['offset'](_0x5c13eb[_0xd59f('0x2f')][_0xd59f('0x18')]);}_0x4aa71b['order']=qs[_0xd59f('0x36')](_0x5c13eb[_0xd59f('0x2f')][_0xd59f('0x36')]);_0x4aa71b[_0xd59f('0x37')]=qs[_0xd59f('0x38')](_[_0xd59f('0x39')](_0x5c13eb[_0xd59f('0x2f')],_0x382e70['filters']),_0x56aca9);if(_0x5c13eb[_0xd59f('0x2f')][_0xd59f('0x3a')]){_0x4aa71b[_0xd59f('0x37')]=_[_0xd59f('0x3b')](_0x4aa71b[_0xd59f('0x37')],{'$or':_[_0xd59f('0x3c')](_0x4aa71b['attributes'],function(_0x2e7e63){var _0x57406a={};_0x57406a[_0x2e7e63]={'$like':'%'+_0x5c13eb[_0xd59f('0x2f')][_0xd59f('0x3a')]+'%'};return _0x57406a;})});}_0x4aa71b=_[_0xd59f('0x3b')]({},_0x4aa71b,_0x5c13eb[_0xd59f('0x3d')]);var _0xd9a0a9={'where':_0x4aa71b[_0xd59f('0x37')]};return db['CmCompany'][_0xd59f('0x1b')](_0xd9a0a9)['then'](function(_0x14c4e7){_0x1f6861[_0xd59f('0x1b')]=_0x14c4e7;if(_0x5c13eb[_0xd59f('0x2f')][_0xd59f('0x3e')]){_0x4aa71b[_0xd59f('0x3f')]=[{'all':!![]}];}return db[_0xd59f('0x2c')]['findAll'](_0x4aa71b);})['then'](function(_0xf9bd3e){_0x1f6861['rows']=_0xf9bd3e;return _0x1f6861;})[_0xd59f('0x22')](respondWithFilteredResult(_0x805f62,_0x4aa71b))[_0xd59f('0x40')](handleError(_0x805f62,null));})['catch'](handleError(_0x805f62,null));};exports[_0xd59f('0x41')]=function(_0xdcd837,_0x24e319){var _0x35b941={'raw':![],'where':{'id':_0xdcd837['params']['id']}},_0x2abbd2={};_0x2abbd2[_0xd59f('0x31')]=_[_0xd59f('0x2e')](db[_0xd59f('0x2c')]['rawAttributes']);_0x2abbd2[_0xd59f('0x2f')]=_[_0xd59f('0x2e')](_0xdcd837[_0xd59f('0x2f')]);_0x2abbd2[_0xd59f('0x38')]=_[_0xd59f('0x30')](_0x2abbd2['model'],_0x2abbd2[_0xd59f('0x2f')]);_0x35b941['attributes']=_[_0xd59f('0x30')](_0x2abbd2[_0xd59f('0x31')],qs[_0xd59f('0x32')](_0xdcd837[_0xd59f('0x2f')][_0xd59f('0x32')]));_0x35b941[_0xd59f('0x33')]=_0x35b941[_0xd59f('0x33')][_0xd59f('0x42')]?_0x35b941[_0xd59f('0x33')]:_0x2abbd2[_0xd59f('0x31')];if(_0xdcd837['query'][_0xd59f('0x3e')]){_0x35b941[_0xd59f('0x3f')]=[{'all':!![]}];}_0x35b941=_[_0xd59f('0x3b')]({},_0x35b941,_0xdcd837[_0xd59f('0x3d')]);return db[_0xd59f('0x2c')][_0xd59f('0x43')](_0x35b941)['then'](handleEntityNotFound(_0x24e319,null))[_0xd59f('0x22')](respondWithResult(_0x24e319,null))[_0xd59f('0x40')](handleError(_0x24e319,null));};exports[_0xd59f('0x44')]=function(_0x1942cf,_0x38dddf){return db[_0xd59f('0x2c')][_0xd59f('0x44')](_0x1942cf[_0xd59f('0x45')],{})['then'](function(_0x563e47){var _0x78c5ea=_0x1942cf['user'][_0xd59f('0x24')]({'plain':!![]});if(!_0x78c5ea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x78c5ea[_0xd59f('0x46')]===_0xd59f('0x47')){var _0x25f3d8=_0x563e47[_0xd59f('0x24')]({'plain':!![]});var _0x2c7584=_0xd59f('0x25');return db['UserProfileSection'][_0xd59f('0x43')]({'where':{'name':_0x2c7584,'userProfileId':_0x78c5ea[_0xd59f('0x48')]},'raw':!![]})['then'](function(_0x17f630){if(_0x17f630&&_0x17f630['autoAssociation']===0x0){return db[_0xd59f('0x49')][_0xd59f('0x44')]({'name':_0x25f3d8[_0xd59f('0x29')],'resourceId':_0x25f3d8['id'],'type':_0x17f630['name'],'sectionId':_0x17f630['id']},{})['then'](function(){return _0x563e47;});}else{return _0x563e47;}})['catch'](function(_0x20ea3a){logger[_0xd59f('0x27')](_0xd59f('0x4a'),_0x20ea3a);throw _0x20ea3a;});}return _0x563e47;})[_0xd59f('0x22')](respondWithResult(_0x38dddf,0xc9))['catch'](handleError(_0x38dddf,null));};exports[_0xd59f('0x21')]=function(_0x4f00b3,_0x211d78){if(_0x4f00b3['body']['id']){delete _0x4f00b3[_0xd59f('0x45')]['id'];}return db[_0xd59f('0x2c')]['find']({'where':{'id':_0x4f00b3['params']['id']}})[_0xd59f('0x22')](handleEntityNotFound(_0x211d78,null))[_0xd59f('0x22')](saveUpdates(_0x4f00b3[_0xd59f('0x45')],null))[_0xd59f('0x22')](respondWithResult(_0x211d78,null))[_0xd59f('0x40')](handleError(_0x211d78,null));};exports[_0xd59f('0x23')]=function(_0x11a4bd,_0x4b1ecd){return db[_0xd59f('0x2c')][_0xd59f('0x43')]({'where':{'id':_0x11a4bd[_0xd59f('0x4b')]['id']}})[_0xd59f('0x22')](handleEntityNotFound(_0x4b1ecd,null))[_0xd59f('0x22')](removeEntity(_0x4b1ecd,null))[_0xd59f('0x40')](handleError(_0x4b1ecd,null));};exports['describe']=function(_0x17efa7,_0x241201){return db[_0xd59f('0x2c')][_0xd59f('0x2d')]()[_0xd59f('0x22')](respondWithResult(_0x241201,null))[_0xd59f('0x40')](handleError(_0x241201,null));};exports['addContacts']=function(_0xe86942,_0x49c4e9,_0x5388d4){return db[_0xd59f('0x4c')][_0xd59f('0x43')]({'where':{'id':_0xe86942['params']['id']}})[_0xd59f('0x22')](handleEntityNotFound(_0x49c4e9,null))[_0xd59f('0x22')](function(_0x44be3e){if(_0x44be3e){return _0x44be3e[_0xd59f('0x4d')](_0xe86942[_0xd59f('0x45')][_0xd59f('0x4e')],_[_0xd59f('0x4f')](_0xe86942[_0xd59f('0x45')],[_0xd59f('0x4e'),'id'])||{});}})[_0xd59f('0x22')](respondWithResult(_0x49c4e9,null))[_0xd59f('0x40')](handleError(_0x49c4e9,null));};exports[_0xd59f('0x50')]=function(_0x10986c,_0x115baf,_0x44e0ce){var _0x201815={};var _0xf66e31={};var _0x745844;var _0x1dd5aa;return db[_0xd59f('0x2c')]['findOne']({'where':{'id':_0x10986c[_0xd59f('0x4b')]['id']}})[_0xd59f('0x22')](handleEntityNotFound(_0x115baf,null))['then'](function(_0x577261){if(_0x577261){_0x745844=_0x577261;_0xf66e31[_0xd59f('0x31')]=_[_0xd59f('0x2e')](db['CmContact'][_0xd59f('0x51')]);_0xf66e31['query']=_[_0xd59f('0x2e')](_0x10986c['query']);_0xf66e31[_0xd59f('0x38')]=_['intersection'](_0xf66e31[_0xd59f('0x31')],_0xf66e31[_0xd59f('0x2f')]);_0x201815[_0xd59f('0x33')]=_['intersection'](_0xf66e31[_0xd59f('0x31')],qs[_0xd59f('0x32')](_0x10986c[_0xd59f('0x2f')][_0xd59f('0x32')]));_0x201815[_0xd59f('0x33')]=_0x201815[_0xd59f('0x33')][_0xd59f('0x42')]?_0x201815[_0xd59f('0x33')]:_0xf66e31[_0xd59f('0x31')];_0x201815[_0xd59f('0x52')]=qs[_0xd59f('0x36')](_0x10986c[_0xd59f('0x2f')][_0xd59f('0x36')]);_0x201815[_0xd59f('0x37')]=qs[_0xd59f('0x38')](_[_0xd59f('0x39')](_0x10986c['query'],_0xf66e31[_0xd59f('0x38')]));if(_0x10986c[_0xd59f('0x2f')][_0xd59f('0x3a')]){_0x201815[_0xd59f('0x37')]=_[_0xd59f('0x3b')](_0x201815[_0xd59f('0x37')],{'$or':_[_0xd59f('0x3c')](_0x201815[_0xd59f('0x33')],function(_0x32139a){var _0x1fb5d0={};_0x1fb5d0[_0x32139a]={'$like':'%'+_0x10986c[_0xd59f('0x2f')][_0xd59f('0x3a')]+'%'};return _0x1fb5d0;})});}_0x201815=_[_0xd59f('0x3b')]({},_0x201815,_0x10986c['options']);return _0x745844['getContacts'](_0x201815);}})[_0xd59f('0x22')](function(_0x18cba9){if(_0x18cba9){_0x1dd5aa=_0x18cba9[_0xd59f('0x42')];if(!_0x10986c[_0xd59f('0x2f')][_0xd59f('0x34')](_0xd59f('0x35'))){_0x201815[_0xd59f('0x19')]=qs[_0xd59f('0x19')](_0x10986c[_0xd59f('0x2f')][_0xd59f('0x19')]);_0x201815[_0xd59f('0x18')]=qs['offset'](_0x10986c['query'][_0xd59f('0x18')]);}return _0x745844[_0xd59f('0x50')](_0x201815);}})[_0xd59f('0x22')](function(_0x52ca6d){if(_0x52ca6d){return _0x52ca6d?{'count':_0x1dd5aa,'rows':_0x52ca6d}:null;}})['then'](respondWithResult(_0x115baf,null))[_0xd59f('0x40')](handleError(_0x115baf,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 27bf609..3dfa394 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 _0x202b=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x202b,0x1e1));var _0xb202=function(_0x5e8b64,_0x3b0ad7){_0x5e8b64=_0x5e8b64-0x0;var _0x57cf34=_0x202b[_0x5e8b64];return _0x57cf34;};'use strict';var _=require(_0xb202('0x0'));var util=require(_0xb202('0x1'));var logger=require(_0xb202('0x2'))(_0xb202('0x3'));var moment=require(_0xb202('0x4'));var BPromise=require(_0xb202('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb202('0x6'));var rimraf=require(_0xb202('0x7'));var config=require(_0xb202('0x8'));var attributes=require(_0xb202('0x9'));module[_0xb202('0xa')]=function(_0x24233a,_0x32d1ec){return _0x24233a[_0xb202('0xb')](_0xb202('0xc'),attributes,{'tableName':_0xb202('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa655=['CmCompany','cm_companies','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x20bba9,_0x256685){var _0x2620d8=function(_0x3c8717){while(--_0x3c8717){_0x20bba9['push'](_0x20bba9['shift']());}};_0x2620d8(++_0x256685);}(_0xa655,0x1a6));var _0x5a65=function(_0x5edbac,_0xa54f78){_0x5edbac=_0x5edbac-0x0;var _0x2a5b78=_0xa655[_0x5edbac];return _0x2a5b78;};'use strict';var _=require('lodash');var util=require(_0x5a65('0x0'));var logger=require(_0x5a65('0x1'))(_0x5a65('0x2'));var moment=require(_0x5a65('0x3'));var BPromise=require('bluebird');var rp=require(_0x5a65('0x4'));var fs=require('fs');var path=require(_0x5a65('0x5'));var rimraf=require('rimraf');var config=require(_0x5a65('0x6'));var attributes=require(_0x5a65('0x7'));module[_0x5a65('0x8')]=function(_0x621796,_0x99d9f9){return _0x621796[_0x5a65('0x9')](_0x5a65('0xa'),attributes,{'tableName':_0x5a65('0xb'),'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 5317715..365519e 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 _0x4f7e=['catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x2e75f4,_0x4ec199){var _0x51de51=function(_0xb370dd){while(--_0xb370dd){_0x2e75f4['push'](_0x2e75f4['shift']());}};_0x51de51(++_0x4ec199);}(_0x4f7e,0x177));var _0xe4f7=function(_0x1e8d1f,_0x48ab24){_0x1e8d1f=_0x1e8d1f-0x0;var _0x47ef46=_0x4f7e[_0x1e8d1f];return _0x47ef46;};'use strict';var _=require(_0xe4f7('0x0'));var util=require(_0xe4f7('0x1'));var moment=require(_0xe4f7('0x2'));var BPromise=require(_0xe4f7('0x3'));var rs=require(_0xe4f7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe4f7('0x5'));var logger=require(_0xe4f7('0x6'))(_0xe4f7('0x7'));var config=require('../../config/environment');var jayson=require(_0xe4f7('0x8'));var client=jayson[_0xe4f7('0x9')][_0xe4f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cbebe,_0x586aaf,_0x56f865){return new BPromise(function(_0x4b6edc,_0x5c5159){return client[_0xe4f7('0xb')](_0x4cbebe,_0x56f865)[_0xe4f7('0xc')](function(_0x340e80){logger['info'](_0xe4f7('0xd'),_0x586aaf,_0xe4f7('0xe'));logger['debug'](_0xe4f7('0xf'),_0x586aaf,_0xe4f7('0xe'),JSON['stringify'](_0x340e80));if(_0x340e80[_0xe4f7('0x10')]){if(_0x340e80[_0xe4f7('0x10')][_0xe4f7('0x11')]===0x1f4){logger[_0xe4f7('0x10')](_0xe4f7('0xd'),_0x586aaf,_0x340e80[_0xe4f7('0x10')]['message']);return _0x5c5159(_0x340e80[_0xe4f7('0x10')][_0xe4f7('0x12')]);}logger[_0xe4f7('0x10')](_0xe4f7('0xd'),_0x586aaf,_0x340e80[_0xe4f7('0x10')][_0xe4f7('0x12')]);return _0x4b6edc(_0x340e80['error'][_0xe4f7('0x12')]);}else{logger[_0xe4f7('0x13')](_0xe4f7('0xd'),_0x586aaf,_0xe4f7('0xe'));_0x4b6edc(_0x340e80[_0xe4f7('0x14')][_0xe4f7('0x12')]);}})[_0xe4f7('0x15')](function(_0xee3ebf){logger[_0xe4f7('0x10')](_0xe4f7('0xd'),_0x586aaf,_0xee3ebf);_0x5c5159(_0xee3ebf);});});}
\ No newline at end of file
+var _0x9795=['CmCompany,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4b3033,_0x556ef3){var _0x397cd3=function(_0x67055c){while(--_0x67055c){_0x4b3033['push'](_0x4b3033['shift']());}};_0x397cd3(++_0x556ef3);}(_0x9795,0x157));var _0x5979=function(_0x3994e6,_0x1abef6){_0x3994e6=_0x3994e6-0x0;var _0x2e38b2=_0x9795[_0x3994e6];return _0x2e38b2;};'use strict';var _=require(_0x5979('0x0'));var util=require(_0x5979('0x1'));var moment=require(_0x5979('0x2'));var BPromise=require(_0x5979('0x3'));var rs=require(_0x5979('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5979('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5979('0x6'));var config=require('../../config/environment');var jayson=require(_0x5979('0x7'));var client=jayson['client'][_0x5979('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xabd45a,_0x505829,_0x33b227){return new BPromise(function(_0x2bb3cd,_0x341f98){return client[_0x5979('0x9')](_0xabd45a,_0x33b227)[_0x5979('0xa')](function(_0x5bc8ca){logger[_0x5979('0xb')]('CmCompany,\x20%s,\x20%s',_0x505829,'request\x20sent');logger['debug'](_0x5979('0xc'),_0x505829,_0x5979('0xd'),JSON[_0x5979('0xe')](_0x5bc8ca));if(_0x5bc8ca[_0x5979('0xf')]){if(_0x5bc8ca[_0x5979('0xf')][_0x5979('0x10')]===0x1f4){logger[_0x5979('0xf')](_0x5979('0x11'),_0x505829,_0x5bc8ca['error']['message']);return _0x341f98(_0x5bc8ca[_0x5979('0xf')]['message']);}logger[_0x5979('0xf')]('CmCompany,\x20%s,\x20%s',_0x505829,_0x5bc8ca[_0x5979('0xf')][_0x5979('0x12')]);return _0x2bb3cd(_0x5bc8ca[_0x5979('0xf')][_0x5979('0x12')]);}else{logger[_0x5979('0xb')](_0x5979('0x11'),_0x505829,_0x5979('0xd'));_0x2bb3cd(_0x5bc8ca[_0x5979('0x13')][_0x5979('0x12')]);}})['catch'](function(_0x35b6bd){logger[_0x5979('0xf')](_0x5979('0x11'),_0x505829,_0x35b6bd);_0x341f98(_0x35b6bd);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 904b201..6ca498f 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 _0xb41f=['isAuthenticated','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get'];(function(_0x12a5d4,_0x41ae93){var _0x4c1910=function(_0x488d0c){while(--_0x488d0c){_0x12a5d4['push'](_0x12a5d4['shift']());}};_0x4c1910(++_0x41ae93);}(_0xb41f,0x14f));var _0xfb41=function(_0x386e47,_0x5d10cb){_0x386e47=_0x386e47-0x0;var _0x58f333=_0xb41f[_0x386e47];return _0x58f333;};'use strict';var multer=require(_0xfb41('0x0'));var util=require(_0xfb41('0x1'));var path=require('path');var timeout=require(_0xfb41('0x2'));var express=require(_0xfb41('0x3'));var router=express['Router']();var fs_extra=require(_0xfb41('0x4'));var auth=require(_0xfb41('0x5'));var interaction=require(_0xfb41('0x6'));var config=require(_0xfb41('0x7'));var controller=require(_0xfb41('0x8'));router[_0xfb41('0x9')]('/',auth[_0xfb41('0xa')](),controller['index']);router[_0xfb41('0x9')](_0xfb41('0xb'),auth[_0xfb41('0xa')](),controller[_0xfb41('0xc')]);router[_0xfb41('0x9')](_0xfb41('0xd'),auth[_0xfb41('0xa')](),controller[_0xfb41('0xe')]);router[_0xfb41('0x9')](_0xfb41('0xf'),auth[_0xfb41('0xa')](),controller[_0xfb41('0x10')]);router[_0xfb41('0x11')]('/',auth[_0xfb41('0xa')](),controller[_0xfb41('0x12')]);router[_0xfb41('0x11')](_0xfb41('0xf'),auth[_0xfb41('0xa')](),controller[_0xfb41('0x13')]);router[_0xfb41('0x14')]('/:id',auth[_0xfb41('0xa')](),controller[_0xfb41('0x15')]);router['delete'](_0xfb41('0xd'),auth['isAuthenticated'](),controller[_0xfb41('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x0317=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','describe','isAuthenticated','show','post','/:id/contacts','addContacts','/:id','update','delete','destroy','exports'];(function(_0x3b0966,_0x3fc4ca){var _0x18e6b0=function(_0x535058){while(--_0x535058){_0x3b0966['push'](_0x3b0966['shift']());}};_0x18e6b0(++_0x3fc4ca);}(_0x0317,0x1b9));var _0x7031=function(_0x5ee0ef,_0x34f2b1){_0x5ee0ef=_0x5ee0ef-0x0;var _0x144aab=_0x0317[_0x5ee0ef];return _0x144aab;};'use strict';var multer=require('multer');var util=require(_0x7031('0x0'));var path=require(_0x7031('0x1'));var timeout=require(_0x7031('0x2'));var express=require(_0x7031('0x3'));var router=express[_0x7031('0x4')]();var fs_extra=require(_0x7031('0x5'));var auth=require(_0x7031('0x6'));var interaction=require(_0x7031('0x7'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7031('0x8')]);router[_0x7031('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x7031('0xa')]);router[_0x7031('0x9')]('/:id',auth[_0x7031('0xb')](),controller[_0x7031('0xc')]);router[_0x7031('0x9')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0x7031('0xd')]('/',auth[_0x7031('0xb')](),controller['create']);router['post'](_0x7031('0xe'),auth[_0x7031('0xb')](),controller[_0x7031('0xf')]);router['put'](_0x7031('0x10'),auth[_0x7031('0xb')](),controller[_0x7031('0x11')]);router[_0x7031('0x12')](_0x7031('0x10'),auth[_0x7031('0xb')](),controller[_0x7031('0x13')]);module[_0x7031('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 7277282..9f9075d 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 _0xdccc=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xdccc,0x111));var _0xcdcc=function(_0x4134f9,_0xb72988){_0x4134f9=_0x4134f9-0x0;var _0x3989a8=_0xdccc[_0x4134f9];return _0x3989a8;};'use strict';var _=require(_0xcdcc('0x0'));var Sequelize=require(_0xcdcc('0x1'));module[_0xcdcc('0x2')]={'firstName':{'type':Sequelize[_0xcdcc('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xcdcc('0x3')]},'street':{'type':Sequelize[_0xcdcc('0x3')]},'postalCode':{'type':Sequelize[_0xcdcc('0x3')]},'city':{'type':Sequelize[_0xcdcc('0x3')]},'country':{'type':Sequelize[_0xcdcc('0x3')]},'dateOfBirth':{'type':Sequelize[_0xcdcc('0x3')]},'description':{'type':Sequelize[_0xcdcc('0x4')]},'phone':{'type':Sequelize[_0xcdcc('0x3')]},'mobile':{'type':Sequelize[_0xcdcc('0x3')]},'fax':{'type':Sequelize[_0xcdcc('0x3')]},'email':{'type':Sequelize[_0xcdcc('0x3')]},'url':{'type':Sequelize[_0xcdcc('0x3')]},'facebook':{'type':Sequelize[_0xcdcc('0x3')]},'fb_data':{'type':Sequelize[_0xcdcc('0x3')]},'twitter':{'type':Sequelize[_0xcdcc('0x3')]},'skype':{'type':Sequelize[_0xcdcc('0x3')]},'teams':{'type':Sequelize[_0xcdcc('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xcdcc('0x3')]},'wechat':{'type':Sequelize[_0xcdcc('0x3')]},'telegram':{'type':Sequelize[_0xcdcc('0x3')]},'UserId':{'type':Sequelize[_0xcdcc('0x5')]},'priority':{'type':Sequelize[_0xcdcc('0x5')](0x2)[_0xcdcc('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xcdcc('0x7')]}};
\ No newline at end of file
+var _0x8520=['INTEGER','UNSIGNED','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8520,0x16b));var _0x0852=function(_0x50c270,_0x112e9){_0x50c270=_0x50c270-0x0;var _0x4e7064=_0x8520[_0x50c270];return _0x4e7064;};'use strict';var _=require(_0x0852('0x0'));var Sequelize=require(_0x0852('0x1'));module[_0x0852('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x0852('0x3')]},'postalCode':{'type':Sequelize[_0x0852('0x3')]},'city':{'type':Sequelize[_0x0852('0x3')]},'country':{'type':Sequelize[_0x0852('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0852('0x4')]},'phone':{'type':Sequelize[_0x0852('0x3')]},'mobile':{'type':Sequelize[_0x0852('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0852('0x3')]},'url':{'type':Sequelize[_0x0852('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0852('0x3')]},'skype':{'type':Sequelize[_0x0852('0x3')]},'teams':{'type':Sequelize[_0x0852('0x3')]},'viber':{'type':Sequelize[_0x0852('0x3')]},'line':{'type':Sequelize[_0x0852('0x3')]},'wechat':{'type':Sequelize[_0x0852('0x3')]},'telegram':{'type':Sequelize[_0x0852('0x3')]},'UserId':{'type':Sequelize[_0x0852('0x5')]},'priority':{'type':Sequelize[_0x0852('0x5')](0x2)[_0x0852('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x0852('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 8b1e40f..eeb758a 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 _0x333c=['Contact','isEmpty','ListId','c.ListId\x20IN\x20?','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','order','DESC','t.id\x20IN\x20?','user','role','agent','conditions','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','merge','CmContact','c.mobile','c.fax','c.email','c.createdAt','c.deletedAt','TagIds','Tags','rows','catch','params','describe','startsWith','columnName','displayName','findAll','alias','custom','values','body','get','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','each','duplicates','$or','findOrCreate','show','color','$and','cf_%d','omit','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','options','setTags','ids','getHoppers','includeAll','include','CmHopperHistory','ContactId','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','filename','chmodSync','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','import','binding','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','error\x20child\x20process','mail','chat','openchannel','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','VoiceCallReport','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','key','Owner','browserName','osName','ratingMessage','ratingType','ratingValue','subject','externalUrl','threadId','Interaction','findAndCountAll','all','sortBy','reverse','moment','bluebird','path','lodash','ioredis','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','update','destroy','then','sendStatus','error','stack','name','send','index','keys','cf_','CmCustomField','findOne','trimStart','length','fieldType','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','cm_contact_has_tags','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','type','text','start','end','hasOwnProperty','filter','isNil','push'];(function(_0x1534d4,_0x33c784){var _0x274edd=function(_0xe8d545){while(--_0xe8d545){_0x1534d4['push'](_0x1534d4['shift']());}};_0x274edd(++_0x33c784);}(_0x333c,0xbf));var _0xc333=function(_0x10d888,_0x5c8b27){_0x10d888=_0x10d888-0x0;var _0x1c30e1=_0x333c[_0x10d888];return _0x1c30e1;};'use strict';var moment=require(_0xc333('0x0'));var BPromise=require(_0xc333('0x1'));var util=require('util');var path=require(_0xc333('0x2'));var fs=require('fs');var _=require(_0xc333('0x3'));var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0xc333('0x4'));var qs=require('../../components/parsers/qs');var as=require(_0xc333('0x5'));var logger=require('../../config/logger')('api');var config=require(_0xc333('0x6'));var db=require(_0xc333('0x7'))['db'];config[_0xc333('0x8')]=_[_0xc333('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc333('0xa'))(new Redis(config['redis']));require(_0xc333('0xb'))[_0xc333('0xc')](socket);function respondWithResult(_0x38c947,_0x12e874){_0x12e874=_0x12e874||0xc8;return function(_0x58ca86){if(_0x58ca86){return _0x38c947[_0xc333('0xd')](_0x12e874)[_0xc333('0xe')](_0x58ca86);}};}function respondWithFilteredResult(_0x4af396,_0x4f08ed){return function(_0x56f23d){if(_0x56f23d){var _0x3b004e=typeof _0x4f08ed[_0xc333('0xf')]===_0xc333('0x10')&&typeof _0x4f08ed[_0xc333('0x11')]==='undefined';var _0x3e811c=_0x56f23d[_0xc333('0x12')];var _0x58c9c7=_0x3b004e?0x0:_0x4f08ed['offset'];var _0x20bdec=_0x3b004e?_0x56f23d[_0xc333('0x12')]:_0x4f08ed['offset']+_0x4f08ed[_0xc333('0x11')];var _0x5b54dd;if(_0x20bdec>=_0x3e811c){_0x20bdec=_0x3e811c;_0x5b54dd=0xc8;}else{_0x5b54dd=0xce;}_0x4af396[_0xc333('0xd')](_0x5b54dd);return _0x4af396[_0xc333('0x13')]('Content-Range',_0x58c9c7+'-'+_0x20bdec+'/'+_0x3e811c)[_0xc333('0xe')](_0x56f23d);}return null;};}function saveUpdates(_0x18e9ae){return function(_0x3b86f8){if(_0x3b86f8){return _0x3b86f8[_0xc333('0x14')](_0x18e9ae)['then'](function(_0xb70203){return _0xb70203;});}return null;};}function removeEntity(_0x15c1ec){return function(_0x570255){if(_0x570255){return _0x570255[_0xc333('0x15')]()[_0xc333('0x16')](function(){_0x15c1ec['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a130b){return function(_0x447779){if(!_0x447779){_0x3a130b[_0xc333('0x17')](0x194);}return _0x447779;};}function handleError(_0x18f8e5,_0x1955d5){_0x1955d5=_0x1955d5||0x1f4;return function(_0x5e08a2){logger[_0xc333('0x18')](_0x5e08a2[_0xc333('0x19')]);if(_0x5e08a2[_0xc333('0x1a')]){delete _0x5e08a2[_0xc333('0x1a')];}_0x18f8e5[_0xc333('0xd')](_0x1955d5)[_0xc333('0x1b')](_0x5e08a2);};}exports[_0xc333('0x1c')]=function(_0x3f5230,_0x319177){var _0x4c72f5={},_0x118c77={},_0x5edf1d={'count':0x0,'rows':[]};return db['CmContact']['describe']()['then'](function(_0x1d7c43){var _0xee826c=[];for(var _0x1757b4=0x0;_0x1757b4
','Attachments','Title','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','lodash','moment'];(function(_0x3db122,_0x5e6bee){var _0x325b67=function(_0x5095af){while(--_0x5095af){_0x3db122['push'](_0x3db122['shift']());}};_0x325b67(++_0x5e6bee);}(_0x9f0e,0x116));var _0xe9f0=function(_0x3c224e,_0x2ae548){_0x3c224e=_0x3c224e-0x0;var _0x122a8=_0x9f0e[_0x3c224e];return _0x122a8;};'use strict';var _=require(_0xe9f0('0x0'));var moment=require(_0xe9f0('0x1'));var random=require(_0xe9f0('0x2'));var fs=require('fs');var path=require(_0xe9f0('0x3'));var util=require(_0xe9f0('0x4'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0xe9f0('0x5'));var config=require(_0xe9f0('0x6'));function getAddress(_0x3c589d){var _0x202d69=_[_0xe9f0('0x7')](_0x3c589d['value']);return _0x202d69&&_0x202d69['address']?_0x202d69[_0xe9f0('0x8')]:_0xe9f0('0x9')+random[_0xe9f0('0xa')](0x6)+'@xcally.com';}function getFirstName(_0xf4a256){var _0x335b82=_[_0xe9f0('0x7')](_0xf4a256[_0xe9f0('0xb')]);if(_0x335b82&&_0x335b82[_0xe9f0('0xc')]){if(_0x335b82[_0xe9f0('0xc')]==_0x335b82[_0xe9f0('0x8')]){return _0x335b82[_0xe9f0('0xc')][_0xe9f0('0xd')](0x0,_0x335b82['name'][_0xe9f0('0xe')]('@'));}var _0x329ecd=_0x335b82[_0xe9f0('0xc')]['split'](/\s+/);return _0x329ecd[_0xe9f0('0xf')]>0x1?_0x329ecd['slice'](0x0,-0x1)[_0xe9f0('0x10')]('\x20'):_0x335b82[_0xe9f0('0xc')];}return _0xe9f0('0x11');}function getLastName(_0x216601){var _0x55a388=_[_0xe9f0('0x7')](_0x216601['value']);if(_0x55a388&&_0x55a388[_0xe9f0('0xc')]){var _0x23914b=_0x55a388[_0xe9f0('0xc')]['split'](/\s+/);return _0x23914b[_0xe9f0('0xf')]>0x1?_0x23914b[_0xe9f0('0x12')]():'';}return'';}function getMails(_0x2e68ef,_0x598eee){var _0xaa7aa6='';for(var _0x1e16e0=0x0;_0x1e16e0<_0x598eee[_0xe9f0('0xb')][_0xe9f0('0xf')];_0x1e16e0+=0x1){if(_0x598eee[_0xe9f0('0xb')][_0x1e16e0][_0xe9f0('0x8')]!==_0x2e68ef){if(!_[_0xe9f0('0x13')](_0xaa7aa6)){_0xaa7aa6+=',';}_0xaa7aa6+=_0x598eee['value'][_0x1e16e0][_0xe9f0('0xc')]||_0x598eee[_0xe9f0('0xb')][_0x1e16e0][_0xe9f0('0x8')]||'';_0xaa7aa6+='\x20<';_0xaa7aa6+=_0x598eee['value'][_0x1e16e0][_0xe9f0('0x8')]?_0x598eee[_0xe9f0('0xb')][_0x1e16e0][_0xe9f0('0x8')]:_0xe9f0('0x9')+random['generate'](0x6)+_0xe9f0('0x14');_0xaa7aa6+='>';}}return _0xaa7aa6;}function parseEmail(_0xfaa312,_0x583687,_0x51e03f){if(_0x583687['html']){var _0x12fe9f=/