From: support
Date: Tue, 14 Feb 2023 13:53:45 +0000 (+0000)
Subject: Built motion from commit 5293bb2a.|2.6.30
X-Git-Url: http://repos.xcallymotion.com/base/%22./banner.jpg//%22%7B%7Blicense.fax?a=commitdiff_plain;h=554872c1ebda375d033bf6ce75c12490ea308146;p=motion2.git
Built motion from commit 5293bb2a.|2.6.30
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 72f5452..d062e76 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-02-14T09:25:44.676Z",
+ "time": "2023-02-14T13:44:36.275Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 6004fb7..6fd1f0f 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-02-14T09:25:44.676Z",
+ "time": "2023-02-14T13:44:36.275Z",
"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 8e5fd28..ab45776 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 _0xa318=['contactManager','motionbar','urlForward','bot','script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING'];(function(_0x53c9f7,_0x5a709f){var _0x4ab248=function(_0x3eee34){while(--_0x3eee34){_0x53c9f7['push'](_0x53c9f7['shift']());}};_0x4ab248(++_0x5a709f);}(_0xa318,0x9c));var _0x8a31=function(_0x3635f7,_0x143c27){_0x3635f7=_0x3635f7-0x0;var _0x5a7f42=_0xa318[_0x3635f7];return _0x5a7f42;};'use strict';var Sequelize=require(_0x8a31('0x0'));module[_0x8a31('0x1')]={'name':{'type':Sequelize[_0x8a31('0x2')],'get':function(_0x581675){return this[_0x8a31('0x3')](_0x8a31('0x4'));}},'action':{'type':Sequelize[_0x8a31('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x8a31('0x6'),'integration',_0x8a31('0x7'),'jscripty',_0x8a31('0x8'),'browser',_0x8a31('0x9'),_0x8a31('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x8a31('0x5')](0x1000),'comment':_0x8a31('0xb')},'data2':{'type':Sequelize[_0x8a31('0x5')](0x1000),'comment':_0x8a31('0xc')},'data3':{'type':Sequelize[_0x8a31('0x5')](0x1000),'comment':_0x8a31('0xd')},'data4':{'type':Sequelize[_0x8a31('0x5')](0x1000),'comments':_0x8a31('0xe')},'data5':{'type':Sequelize[_0x8a31('0x5')](0x1000),'comments':_0x8a31('0xf')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x8a31('0x10')],'comments':_0x8a31('0x11')}};
\ No newline at end of file
+var _0xe849=['exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','STRING','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0xe849,0x12b));var _0x9e84=function(_0x10a469,_0x1de6a0){_0x10a469=_0x10a469-0x0;var _0x3c8629=_0xe849[_0x10a469];return _0x3c8629;};'use strict';var Sequelize=require(_0x9e84('0x0'));module[_0x9e84('0x1')]={'name':{'type':Sequelize[_0x9e84('0x2')],'get':function(_0xccc8a0){return this[_0x9e84('0x3')](_0x9e84('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x9e84('0x5'),_0x9e84('0x6'),_0x9e84('0x7'),_0x9e84('0x8'),_0x9e84('0x9'),_0x9e84('0xa'),'bot',_0x9e84('0xb')]],'msg':_0x9e84('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x9e84('0xd')},'data2':{'type':Sequelize[_0x9e84('0xe')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x9e84('0xf')},'data5':{'type':Sequelize[_0x9e84('0xe')](0x1000),'comments':_0x9e84('0x10')},'data6':{'type':Sequelize['STRING'],'comments':_0x9e84('0x11')},'data7':{'type':Sequelize[_0x9e84('0x12')],'comments':_0x9e84('0x13')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 28a373c..568aa7e 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 _0xf1f8=['crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','update','then','destroy','error','stack','name','send','body','Action','params','catch','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x56b546,_0x4d5f71){var _0x245a8e=function(_0x3c3060){while(--_0x3c3060){_0x56b546['push'](_0x56b546['shift']());}};_0x245a8e(++_0x4d5f71);}(_0xf1f8,0xd0));var _0x8f1f=function(_0x12d366,_0x737b0){_0x12d366=_0x12d366-0x0;var _0x143aca=_0xf1f8[_0x12d366];return _0x143aca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f1f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8f1f('0x1'));var rp=require(_0x8f1f('0x2'));var moment=require(_0x8f1f('0x3'));var BPromise=require(_0x8f1f('0x4'));var Mustache=require(_0x8f1f('0x5'));var util=require(_0x8f1f('0x6'));var path=require(_0x8f1f('0x7'));var sox=require(_0x8f1f('0x8'));var csv=require(_0x8f1f('0x9'));var ejs=require(_0x8f1f('0xa'));var fs=require('fs');var fs_extra=require(_0x8f1f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8f1f('0xc'));var jsforce=require(_0x8f1f('0xd'));var deskjs=require(_0x8f1f('0xe'));var toCsv=require(_0x8f1f('0x9'));var querystring=require(_0x8f1f('0xf'));var Papa=require('papaparse');var Redis=require(_0x8f1f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8f1f('0x11'));var hardwareService=require(_0x8f1f('0x12'));var logger=require(_0x8f1f('0x13'))('api');var utils=require(_0x8f1f('0x14'));var config=require(_0x8f1f('0x15'));var licenseUtil=require(_0x8f1f('0x16'));var db=require(_0x8f1f('0x17'))['db'];function respondWithStatusCode(_0x46fa9e,_0x571bfe){_0x571bfe=_0x571bfe||0xcc;return function(_0x4aa5ab){if(_0x4aa5ab){return _0x46fa9e['sendStatus'](_0x571bfe);}return _0x46fa9e[_0x8f1f('0x18')](_0x571bfe)[_0x8f1f('0x19')]();};}function respondWithResult(_0xb7b42d,_0xf75ad3){_0xf75ad3=_0xf75ad3||0xc8;return function(_0x3c1ac0){if(_0x3c1ac0){return _0xb7b42d[_0x8f1f('0x18')](_0xf75ad3)[_0x8f1f('0x1a')](_0x3c1ac0);}};}function respondWithFilteredResult(_0x4d2b3f,_0x1c7660){return function(_0x4ed6f5){if(_0x4ed6f5){var _0xba3b46=typeof _0x1c7660[_0x8f1f('0x1b')]==='undefined'&&typeof _0x1c7660[_0x8f1f('0x1c')]===_0x8f1f('0x1d');var _0x1ee918=_0x4ed6f5['count'];var _0x2eb2fb=_0xba3b46?0x0:_0x1c7660[_0x8f1f('0x1b')];var _0x2b0971=_0xba3b46?_0x4ed6f5[_0x8f1f('0x1e')]:_0x1c7660[_0x8f1f('0x1b')]+_0x1c7660[_0x8f1f('0x1c')];var _0x34aa32;if(_0x2b0971>=_0x1ee918){_0x2b0971=_0x1ee918;_0x34aa32=0xc8;}else{_0x34aa32=0xce;}_0x4d2b3f[_0x8f1f('0x18')](_0x34aa32);return _0x4d2b3f[_0x8f1f('0x1f')]('Content-Range',_0x2eb2fb+'-'+_0x2b0971+'/'+_0x1ee918)[_0x8f1f('0x1a')](_0x4ed6f5);}return null;};}function patchUpdates(_0x2b8f14){return function(_0x40429d){try{jsonpatch['apply'](_0x40429d,_0x2b8f14,!![]);}catch(_0x1eda2a){return BPromise['reject'](_0x1eda2a);}return _0x40429d['save']();};}function saveUpdates(_0x8ab211,_0x762946){return function(_0x160e6b){if(_0x160e6b){return _0x160e6b[_0x8f1f('0x20')](_0x8ab211)[_0x8f1f('0x21')](function(_0x48b860){return _0x48b860;});}return null;};}function removeEntity(_0x33d9ea,_0x4619d8){return function(_0x4de9c2){if(_0x4de9c2){return _0x4de9c2[_0x8f1f('0x22')]()[_0x8f1f('0x21')](function(){_0x33d9ea[_0x8f1f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d0be3,_0x501630){return function(_0x5b1b9f){if(!_0x5b1b9f){_0x2d0be3['sendStatus'](0x194);}return _0x5b1b9f;};}function handleError(_0x449225,_0x508b59){_0x508b59=_0x508b59||0x1f4;return function(_0x5b134b){logger[_0x8f1f('0x23')](_0x5b134b[_0x8f1f('0x24')]);if(_0x5b134b[_0x8f1f('0x25')]){delete _0x5b134b[_0x8f1f('0x25')];}_0x449225[_0x8f1f('0x18')](_0x508b59)[_0x8f1f('0x26')](_0x5b134b);};}exports[_0x8f1f('0x20')]=function(_0x535015,_0x5a36b8){if(_0x535015[_0x8f1f('0x27')]['id']){delete _0x535015[_0x8f1f('0x27')]['id'];}return db[_0x8f1f('0x28')]['find']({'where':{'id':_0x535015[_0x8f1f('0x29')]['id']}})['then'](handleEntityNotFound(_0x5a36b8,null))[_0x8f1f('0x21')](saveUpdates(_0x535015['body'],null))[_0x8f1f('0x21')](respondWithResult(_0x5a36b8,null))[_0x8f1f('0x2a')](handleError(_0x5a36b8,null));};exports[_0x8f1f('0x22')]=function(_0x4bd915,_0x4ee2b3){return db['Action'][_0x8f1f('0x2b')]({'where':{'id':_0x4bd915[_0x8f1f('0x29')]['id']}})[_0x8f1f('0x21')](handleEntityNotFound(_0x4ee2b3,null))[_0x8f1f('0x21')](removeEntity(_0x4ee2b3,null))[_0x8f1f('0x2a')](handleError(_0x4ee2b3,null));};
\ No newline at end of file
+var _0xf372=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','stack','name','update','body','Action','params','catch','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis'];(function(_0x3661ca,_0xc9273e){var _0xf22108=function(_0x48b173){while(--_0x48b173){_0x3661ca['push'](_0x3661ca['shift']());}};_0xf22108(++_0xc9273e);}(_0xf372,0xcd));var _0x2f37=function(_0x14eba5,_0x1fcb02){_0x14eba5=_0x14eba5-0x0;var _0x121122=_0xf372[_0x14eba5];return _0x121122;};'use strict';var emlformat=require(_0x2f37('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2f37('0x1'));var rp=require(_0x2f37('0x2'));var moment=require(_0x2f37('0x3'));var BPromise=require(_0x2f37('0x4'));var Mustache=require(_0x2f37('0x5'));var util=require(_0x2f37('0x6'));var path=require(_0x2f37('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2f37('0x8'));var fs=require('fs');var fs_extra=require(_0x2f37('0x9'));var _=require(_0x2f37('0xa'));var squel=require('squel');var crypto=require(_0x2f37('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2f37('0xc'));var Papa=require(_0x2f37('0xd'));var Redis=require(_0x2f37('0xe'));var authService=require(_0x2f37('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f37('0x10'));var logger=require(_0x2f37('0x11'))(_0x2f37('0x12'));var utils=require(_0x2f37('0x13'));var config=require(_0x2f37('0x14'));var licenseUtil=require(_0x2f37('0x15'));var db=require(_0x2f37('0x16'))['db'];function respondWithStatusCode(_0x26d339,_0x368b5d){_0x368b5d=_0x368b5d||0xcc;return function(_0x499cf4){if(_0x499cf4){return _0x26d339[_0x2f37('0x17')](_0x368b5d);}return _0x26d339[_0x2f37('0x18')](_0x368b5d)[_0x2f37('0x19')]();};}function respondWithResult(_0x58eb9a,_0xe2c00f){_0xe2c00f=_0xe2c00f||0xc8;return function(_0x1c843e){if(_0x1c843e){return _0x58eb9a[_0x2f37('0x18')](_0xe2c00f)[_0x2f37('0x1a')](_0x1c843e);}};}function respondWithFilteredResult(_0x5aca0f,_0x7e3533){return function(_0x5ded66){if(_0x5ded66){var _0x220e60=typeof _0x7e3533[_0x2f37('0x1b')]===_0x2f37('0x1c')&&typeof _0x7e3533[_0x2f37('0x1d')]===_0x2f37('0x1c');var _0x46029f=_0x5ded66[_0x2f37('0x1e')];var _0x5d3b2d=_0x220e60?0x0:_0x7e3533['offset'];var _0x5e3035=_0x220e60?_0x5ded66['count']:_0x7e3533[_0x2f37('0x1b')]+_0x7e3533['limit'];var _0x53ebf7;if(_0x5e3035>=_0x46029f){_0x5e3035=_0x46029f;_0x53ebf7=0xc8;}else{_0x53ebf7=0xce;}_0x5aca0f['status'](_0x53ebf7);return _0x5aca0f[_0x2f37('0x1f')]('Content-Range',_0x5d3b2d+'-'+_0x5e3035+'/'+_0x46029f)['json'](_0x5ded66);}return null;};}function patchUpdates(_0x5af4c2){return function(_0x35aa07){try{jsonpatch[_0x2f37('0x20')](_0x35aa07,_0x5af4c2,!![]);}catch(_0x47e22f){return BPromise[_0x2f37('0x21')](_0x47e22f);}return _0x35aa07[_0x2f37('0x22')]();};}function saveUpdates(_0x114737,_0x20b079){return function(_0x1a927f){if(_0x1a927f){return _0x1a927f['update'](_0x114737)[_0x2f37('0x23')](function(_0x36aaf8){return _0x36aaf8;});}return null;};}function removeEntity(_0x8d4465,_0x208da1){return function(_0x43e21a){if(_0x43e21a){return _0x43e21a[_0x2f37('0x24')]()[_0x2f37('0x23')](function(){_0x8d4465['status'](0xcc)[_0x2f37('0x19')]();});}};}function handleEntityNotFound(_0x23172b,_0x2233fe){return function(_0x3c4bcc){if(!_0x3c4bcc){_0x23172b[_0x2f37('0x17')](0x194);}return _0x3c4bcc;};}function handleError(_0x2f431f,_0x24694b){_0x24694b=_0x24694b||0x1f4;return function(_0x15a601){logger['error'](_0x15a601[_0x2f37('0x25')]);if(_0x15a601[_0x2f37('0x26')]){delete _0x15a601['name'];}_0x2f431f['status'](_0x24694b)['send'](_0x15a601);};}exports[_0x2f37('0x27')]=function(_0x1e61d4,_0x244207){if(_0x1e61d4[_0x2f37('0x28')]['id']){delete _0x1e61d4['body']['id'];}return db[_0x2f37('0x29')]['find']({'where':{'id':_0x1e61d4[_0x2f37('0x2a')]['id']}})[_0x2f37('0x23')](handleEntityNotFound(_0x244207,null))[_0x2f37('0x23')](saveUpdates(_0x1e61d4[_0x2f37('0x28')],null))[_0x2f37('0x23')](respondWithResult(_0x244207,null))[_0x2f37('0x2b')](handleError(_0x244207,null));};exports[_0x2f37('0x24')]=function(_0x277be,_0x4322b5){return db[_0x2f37('0x29')]['find']({'where':{'id':_0x277be[_0x2f37('0x2a')]['id']}})[_0x2f37('0x23')](handleEntityNotFound(_0x4322b5,null))[_0x2f37('0x23')](removeEntity(_0x4322b5,null))[_0x2f37('0x2b')](handleError(_0x4322b5,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 7893d30..c5eb1fe 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 _0x0c1a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','define','tools_actions','lodash','util','../../config/logger'];(function(_0x2649d9,_0x513732){var _0x55c610=function(_0x274f07){while(--_0x274f07){_0x2649d9['push'](_0x2649d9['shift']());}};_0x55c610(++_0x513732);}(_0x0c1a,0x169));var _0xa0c1=function(_0x43af1f,_0x21d836){_0x43af1f=_0x43af1f-0x0;var _0x113ec2=_0x0c1a[_0x43af1f];return _0x113ec2;};'use strict';var _=require(_0xa0c1('0x0'));var util=require(_0xa0c1('0x1'));var logger=require(_0xa0c1('0x2'))(_0xa0c1('0x3'));var moment=require(_0xa0c1('0x4'));var BPromise=require(_0xa0c1('0x5'));var rp=require(_0xa0c1('0x6'));var fs=require('fs');var path=require(_0xa0c1('0x7'));var rimraf=require(_0xa0c1('0x8'));var config=require(_0xa0c1('0x9'));var attributes=require(_0xa0c1('0xa'));module['exports']=function(_0x3be00e,_0x3f194b){return _0x3be00e[_0xa0c1('0xb')]('Action',attributes,{'tableName':_0xa0c1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3aee=['rimraf','exports','define','Action','tools_actions','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x4f75f8,_0x2d3423){var _0x304380=function(_0x2c4f25){while(--_0x2c4f25){_0x4f75f8['push'](_0x4f75f8['shift']());}};_0x304380(++_0x2d3423);}(_0x3aee,0x131));var _0xe3ae=function(_0x58999b,_0xea4695){_0x58999b=_0x58999b-0x0;var _0x5efc3a=_0x3aee[_0x58999b];return _0x5efc3a;};'use strict';var _=require(_0xe3ae('0x0'));var util=require(_0xe3ae('0x1'));var logger=require('../../config/logger')(_0xe3ae('0x2'));var moment=require(_0xe3ae('0x3'));var BPromise=require(_0xe3ae('0x4'));var rp=require(_0xe3ae('0x5'));var fs=require('fs');var path=require(_0xe3ae('0x6'));var rimraf=require(_0xe3ae('0x7'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0xe3ae('0x8')]=function(_0x238269,_0x20af09){return _0x238269[_0xe3ae('0x9')](_0xe3ae('0xa'),attributes,{'tableName':_0xe3ae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 42b8eb1..33ef109 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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x275803,_0x148216){var _0x33a595=function(_0x16fed9){while(--_0x16fed9){_0x275803['push'](_0x275803['shift']());}};_0x33a595(++_0x148216);}(_0xabce,0x103));var _0xeabc=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xabce[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ 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(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x4975,0x86));var _0x5497=function(_0x2f0543,_0x3c160e){_0x2f0543=_0x2f0543-0x0;var _0x35900a=_0x4975[_0x2f0543];return _0x35900a;};'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 412af97..584c5eb 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 _0x0c9a=['destroy','exports','util','path','connect-timeout','Router','../../config/environment','put','/:id','delete','isAuthenticated'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0c9a,0x136));var _0xa0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xa0c9('0x0'));var path=require(_0xa0c9('0x1'));var timeout=require(_0xa0c9('0x2'));var express=require('express');var router=express[_0xa0c9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa0c9('0x4'));var controller=require('./action.controller');router[_0xa0c9('0x5')](_0xa0c9('0x6'),auth['isAuthenticated'](),controller['update']);router[_0xa0c9('0x7')](_0xa0c9('0x6'),auth[_0xa0c9('0x8')](),controller[_0xa0c9('0x9')]);module[_0xa0c9('0xa')]=router;
\ No newline at end of file
+var _0x1071=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','multer','util','connect-timeout','express','Router'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x1071,0xeb));var _0x1107=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1071[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x1107('0x0'));var util=require(_0x1107('0x1'));var path=require('path');var timeout=require(_0x1107('0x2'));var express=require(_0x1107('0x3'));var router=express[_0x1107('0x4')]();var fs_extra=require(_0x1107('0x5'));var auth=require(_0x1107('0x6'));var interaction=require(_0x1107('0x7'));var config=require(_0x1107('0x8'));var controller=require(_0x1107('0x9'));router[_0x1107('0xa')](_0x1107('0xb'),auth[_0x1107('0xc')](),controller[_0x1107('0xd')]);router[_0x1107('0xe')](_0x1107('0xb'),auth[_0x1107('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 72ee61f..d268b04 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 _0xee14=['STRING','TEXT'];(function(_0x2135bd,_0x42ad02){var _0x394fec=function(_0x201817){while(--_0x201817){_0x2135bd['push'](_0x2135bd['shift']());}};_0x394fec(++_0x42ad02);}(_0xee14,0x13a));var _0x4ee1=function(_0x284692,_0x2c8094){_0x284692=_0x284692-0x0;var _0x63a287=_0xee14[_0x284692];return _0x63a287;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}};
\ No newline at end of file
+var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x15503e,_0x2ce699){var _0x271c52=function(_0x39096a){while(--_0x39096a){_0x15503e['push'](_0x15503e['shift']());}};_0x271c52(++_0x2ce699);}(_0x24ca,0x1bc));var _0xa24c=function(_0x113e32,_0x5339f0){_0x113e32=_0x113e32-0x0;var _0x4ff939=_0x24ca[_0x113e32];return _0x4ff939;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 5c0e64c..3f2737f 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 _0x97e4=['fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','CustomReports','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','sort','where','pick','filters','VIRTUAL','filter','options','AnalyticCustomReport','includeAll','include','findAll','rows','merge','create','body','get','role','user','Reports','UserProfileSection','find','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','orderBy','alias','joins','parse','includes','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','left_join','cross_join','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','from','groupBy','order','DESC','parentKey','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','COUNT(*)','run','Limited\x20Query:','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x2cadbd,_0x504b02){var _0x56df1a=function(_0x8a225d){while(--_0x8a225d){_0x2cadbd['push'](_0x2cadbd['shift']());}};_0x56df1a(++_0x504b02);}(_0x97e4,0x98));var _0x497e=function(_0x5786f9,_0x59a148){_0x5786f9=_0x5786f9-0x0;var _0x22c3cf=_0x97e4[_0x5786f9];return _0x22c3cf;};'use strict';var emlformat=require(_0x497e('0x0'));var rimraf=require(_0x497e('0x1'));var zipdir=require(_0x497e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x497e('0x3'));var moment=require(_0x497e('0x4'));var BPromise=require(_0x497e('0x5'));var Mustache=require(_0x497e('0x6'));var util=require(_0x497e('0x7'));var path=require(_0x497e('0x8'));var sox=require('sox');var csv=require(_0x497e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x497e('0xa'));var _=require(_0x497e('0xb'));var squel=require(_0x497e('0xc'));var crypto=require('crypto');var jsforce=require(_0x497e('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x497e('0xe'));var Papa=require(_0x497e('0xf'));var Redis=require(_0x497e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x497e('0x11'));var as=require(_0x497e('0x12'));var hardwareService=require(_0x497e('0x13'));var logger=require(_0x497e('0x14'))(_0x497e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x497e('0x16'));var db=require(_0x497e('0x17'))['db'];var dbH=require(_0x497e('0x17'))['dbH'];function respondWithStatusCode(_0x1fa252,_0x2a2687){_0x2a2687=_0x2a2687||0xcc;return function(_0x4fb4d8){if(_0x4fb4d8){return _0x1fa252['sendStatus'](_0x2a2687);}return _0x1fa252[_0x497e('0x18')](_0x2a2687)[_0x497e('0x19')]();};}function respondWithResult(_0x781267,_0x3e779a){_0x3e779a=_0x3e779a||0xc8;return function(_0x18a2e7){if(_0x18a2e7){return _0x781267['status'](_0x3e779a)[_0x497e('0x1a')](_0x18a2e7);}};}function respondWithFilteredResult(_0x5727da,_0x324f6c){return function(_0x447d11){if(_0x447d11){var _0x10c3e9=typeof _0x324f6c[_0x497e('0x1b')]===_0x497e('0x1c')&&typeof _0x324f6c['limit']===_0x497e('0x1c');var _0xb5b0cb=_0x447d11[_0x497e('0x1d')];var _0x2ac36c=_0x10c3e9?0x0:_0x324f6c[_0x497e('0x1b')];var _0x2eac53=_0x10c3e9?_0x447d11[_0x497e('0x1d')]:_0x324f6c[_0x497e('0x1b')]+_0x324f6c[_0x497e('0x1e')];var _0x1ca114;if(_0x2eac53>=_0xb5b0cb){_0x2eac53=_0xb5b0cb;_0x1ca114=0xc8;}else{_0x1ca114=0xce;}_0x5727da['status'](_0x1ca114);return _0x5727da[_0x497e('0x1f')](_0x497e('0x20'),_0x2ac36c+'-'+_0x2eac53+'/'+_0xb5b0cb)[_0x497e('0x1a')](_0x447d11);}return null;};}function patchUpdates(_0x22bea3){return function(_0x387e6e){try{jsonpatch[_0x497e('0x21')](_0x387e6e,_0x22bea3,!![]);}catch(_0x9fca86){return BPromise['reject'](_0x9fca86);}return _0x387e6e[_0x497e('0x22')]();};}function saveUpdates(_0x39a19e,_0x1501a2){return function(_0x1e5ca9){if(_0x1e5ca9){return _0x1e5ca9['update'](_0x39a19e)['then'](function(_0x4408e7){return _0x4408e7;});}return null;};}function removeEntity(_0x5d26a9,_0x4162d7){return function(_0xede98e){if(_0xede98e){return _0xede98e['destroy']()[_0x497e('0x23')](function(){var _0x5b763a=_0xede98e['get']({'plain':!![]});var _0x4a954a=_0x497e('0x24');return db[_0x497e('0x25')][_0x497e('0x26')]({'where':{'type':_0x4a954a,'resourceId':_0x5b763a['id']}})[_0x497e('0x23')](function(){return _0xede98e;});})[_0x497e('0x23')](function(){_0x5d26a9[_0x497e('0x18')](0xcc)[_0x497e('0x19')]();});}};}function handleEntityNotFound(_0x42cbaa,_0x31b075){return function(_0x485d46){if(!_0x485d46){_0x42cbaa[_0x497e('0x27')](0x194);}return _0x485d46;};}function handleError(_0x37f398,_0x54844f){_0x54844f=_0x54844f||0x1f4;return function(_0x391acb){logger['error'](_0x391acb[_0x497e('0x28')]);if(_0x391acb[_0x497e('0x29')]){delete _0x391acb[_0x497e('0x29')];}_0x37f398['status'](_0x54844f)[_0x497e('0x2a')](_0x391acb);};}exports[_0x497e('0x2b')]=function(_0x1c2887,_0x81ffc){var _0x6fb532={},_0xb5eb52={},_0x4656ae={'count':0x0,'rows':[]};var _0x2d8b88=_[_0x497e('0x2c')](db['AnalyticCustomReport'][_0x497e('0x2d')],function(_0x2781cc){return{'name':_0x2781cc[_0x497e('0x2e')],'type':_0x2781cc[_0x497e('0x2f')][_0x497e('0x30')]};});_0xb5eb52[_0x497e('0x31')]=_['map'](_0x2d8b88,_0x497e('0x29'));_0xb5eb52[_0x497e('0x32')]=_[_0x497e('0x33')](_0x1c2887['query']);_0xb5eb52['filters']=_['intersection'](_0xb5eb52[_0x497e('0x31')],_0xb5eb52[_0x497e('0x32')]);_0x6fb532[_0x497e('0x34')]=_[_0x497e('0x35')](_0xb5eb52[_0x497e('0x31')],qs[_0x497e('0x36')](_0x1c2887[_0x497e('0x32')]['fields']));_0x6fb532[_0x497e('0x34')]=_0x6fb532[_0x497e('0x34')][_0x497e('0x37')]?_0x6fb532[_0x497e('0x34')]:_0xb5eb52[_0x497e('0x31')];if(!_0x1c2887[_0x497e('0x32')]['hasOwnProperty'](_0x497e('0x38'))){_0x6fb532[_0x497e('0x1e')]=qs[_0x497e('0x1e')](_0x1c2887[_0x497e('0x32')]['limit']);_0x6fb532['offset']=qs[_0x497e('0x1b')](_0x1c2887[_0x497e('0x32')][_0x497e('0x1b')]);}_0x6fb532['order']=qs['sort'](_0x1c2887[_0x497e('0x32')][_0x497e('0x39')]);_0x6fb532[_0x497e('0x3a')]=qs['filters'](_[_0x497e('0x3b')](_0x1c2887[_0x497e('0x32')],_0xb5eb52[_0x497e('0x3c')]),_0x2d8b88);if(_0x1c2887['query']['filter']){_0x6fb532[_0x497e('0x3a')]=_['merge'](_0x6fb532[_0x497e('0x3a')],{'$or':_[_0x497e('0x2c')](_0x2d8b88,function(_0x1dc903){if(_0x1dc903[_0x497e('0x2f')]!==_0x497e('0x3d')){var _0x2ffef6={};_0x2ffef6[_0x1dc903[_0x497e('0x29')]]={'$like':'%'+_0x1c2887[_0x497e('0x32')][_0x497e('0x3e')]+'%'};return _0x2ffef6;}})});}_0x6fb532=_['merge']({},_0x6fb532,_0x1c2887[_0x497e('0x3f')]);var _0x4d1a99={'where':_0x6fb532['where']};return db[_0x497e('0x40')]['count'](_0x4d1a99)[_0x497e('0x23')](function(_0x4213a1){_0x4656ae[_0x497e('0x1d')]=_0x4213a1;if(_0x1c2887[_0x497e('0x32')][_0x497e('0x41')]){_0x6fb532[_0x497e('0x42')]=[{'all':!![]}];}return db[_0x497e('0x40')][_0x497e('0x43')](_0x6fb532);})['then'](function(_0x46ad99){_0x4656ae[_0x497e('0x44')]=_0x46ad99;return _0x4656ae;})[_0x497e('0x23')](respondWithFilteredResult(_0x81ffc,_0x6fb532))['catch'](handleError(_0x81ffc,null));};exports['show']=function(_0x2900e9,_0x3dc4b9){var _0x517a14={'raw':![],'where':{'id':_0x2900e9['params']['id']}},_0x330ebf={};_0x330ebf[_0x497e('0x31')]=_[_0x497e('0x33')](db[_0x497e('0x40')][_0x497e('0x2d')]);_0x330ebf[_0x497e('0x32')]=_[_0x497e('0x33')](_0x2900e9[_0x497e('0x32')]);_0x330ebf['filters']=_[_0x497e('0x35')](_0x330ebf[_0x497e('0x31')],_0x330ebf['query']);_0x517a14['attributes']=_[_0x497e('0x35')](_0x330ebf[_0x497e('0x31')],qs[_0x497e('0x36')](_0x2900e9[_0x497e('0x32')][_0x497e('0x36')]));_0x517a14['attributes']=_0x517a14[_0x497e('0x34')][_0x497e('0x37')]?_0x517a14[_0x497e('0x34')]:_0x330ebf[_0x497e('0x31')];if(_0x2900e9[_0x497e('0x32')]['includeAll']){_0x517a14['include']=[{'all':!![]}];}_0x517a14=_[_0x497e('0x45')]({},_0x517a14,_0x2900e9[_0x497e('0x3f')]);return db[_0x497e('0x40')]['find'](_0x517a14)[_0x497e('0x23')](handleEntityNotFound(_0x3dc4b9,null))[_0x497e('0x23')](respondWithResult(_0x3dc4b9,null))['catch'](handleError(_0x3dc4b9,null));};exports[_0x497e('0x46')]=function(_0xc81a13,_0x5813b0){return db[_0x497e('0x40')][_0x497e('0x46')](_0xc81a13[_0x497e('0x47')],{})['then'](function(_0x4b574d){var _0x1bd07b=_0xc81a13['user'][_0x497e('0x48')]({'plain':!![]});if(!_0x1bd07b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bd07b[_0x497e('0x49')]===_0x497e('0x4a')){var _0x21b45d=_0x4b574d[_0x497e('0x48')]({'plain':!![]});var _0x402769=_0x497e('0x4b');return db[_0x497e('0x4c')][_0x497e('0x4d')]({'where':{'name':_0x402769,'userProfileId':_0x1bd07b['userProfileId']},'raw':!![]})[_0x497e('0x23')](function(_0xa467ff){if(_0xa467ff&&_0xa467ff['autoAssociation']===0x0){return db[_0x497e('0x25')]['create']({'name':_0x21b45d[_0x497e('0x29')],'resourceId':_0x21b45d['id'],'type':_0x497e('0x24'),'sectionId':_0xa467ff['id']},{})[_0x497e('0x23')](function(){return _0x4b574d;});}else{return _0x4b574d;}})[_0x497e('0x4e')](function(_0x312643){logger[_0x497e('0x4f')](_0x497e('0x50'),_0x312643);throw _0x312643;});}return _0x4b574d;})[_0x497e('0x23')](respondWithResult(_0x5813b0,0xc9))['catch'](handleError(_0x5813b0,null));};exports[_0x497e('0x51')]=function(_0x3d11d9,_0x557ead){if(_0x3d11d9['body']['id']){delete _0x3d11d9[_0x497e('0x47')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x3d11d9[_0x497e('0x52')]['id']}})[_0x497e('0x23')](handleEntityNotFound(_0x557ead,null))[_0x497e('0x23')](saveUpdates(_0x3d11d9[_0x497e('0x47')],null))[_0x497e('0x23')](respondWithResult(_0x557ead,null))['catch'](handleError(_0x557ead,null));};exports[_0x497e('0x26')]=function(_0x1ca283,_0x221249){return db['AnalyticCustomReport'][_0x497e('0x4d')]({'where':{'id':_0x1ca283['params']['id']}})[_0x497e('0x23')](handleEntityNotFound(_0x221249,null))[_0x497e('0x23')](removeEntity(_0x221249,null))[_0x497e('0x4e')](handleError(_0x221249,null));};exports[_0x497e('0x53')]=function(_0x5b88d4,_0x3665a5){var _0x4e5396=0xa;var _0x2944c0=[_0x497e('0x54'),'left_join',_0x497e('0x55'),'cross_join'];var _0x47ed1d={'SUM':_0x497e('0x56'),'COUNT':_0x497e('0x57'),'COUNT DISTINCT':_0x497e('0x58'),'MAX':'MAX(%s)','MIN':_0x497e('0x59'),'AVG':_0x497e('0x5a'),'GROUP_CONCAT':_0x497e('0x5b'),'GROUP_CONCAT ASC':_0x497e('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x37657e={'SEC_TO_TIME':_0x497e('0x5d'),'DATE':_0x497e('0x5e'),'HOUR':_0x497e('0x5f'),'ROUND':_0x497e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1ae513=function(_0x1a3ae4){return!_['includes']([_0x497e('0x61'),_0x497e('0x62'),_0x497e('0x63'),_0x497e('0x64')],_0x1a3ae4);};var _0x3661c6=function(_0x266818){if(!_0x266818||!_0x266818['rules']['length']){return'';}for(var _0x6e9444='(',_0x42f7f7=0x0;_0x42f7f7<_0x266818[_0x497e('0x65')][_0x497e('0x37')];_0x42f7f7+=0x1){_0x42f7f7>0x0&&(_0x6e9444+='\x20'+_0x266818[_0x497e('0x66')]+'\x20');_0x6e9444+=_0x266818[_0x497e('0x65')][_0x42f7f7][_0x497e('0x67')]?_0x3661c6(_0x266818[_0x497e('0x65')][_0x42f7f7][_0x497e('0x67')]):_0x266818[_0x497e('0x65')][_0x42f7f7][_0x497e('0x68')]+'\x20'+_0x266818[_0x497e('0x65')][_0x42f7f7]['condition']+(_0x1ae513(_0x266818[_0x497e('0x65')][_0x42f7f7]['condition'])?'\x20'+_0x266818['rules'][_0x42f7f7][_0x497e('0x69')]:'');}return _0x6e9444+')';};var _0x149ae5={'where':{'id':_0x5b88d4['params']['id']}},_0x26868f,_0x263cf7,_0x89fb89,_0x1ef917,_0x1f5150;_0x149ae5=_['merge']({},_0x149ae5,_0x5b88d4['options']);return db[_0x497e('0x40')][_0x497e('0x4d')](_0x149ae5)[_0x497e('0x23')](function(_0x223bcf){if(_0x223bcf){_0x26868f=_0x223bcf;return _0x223bcf[_0x497e('0x6a')]();}return null;})[_0x497e('0x23')](function(_0x376831){if(_0x376831){if(!_0x376831['length']){throw new db[(_0x497e('0x6b'))][(_0x497e('0x6c'))](_0x497e('0x6d'),0x193);}_0x263cf7=_0x376831;return db[_0x497e('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x497e('0x23')](function(_0x45bbf4){if(_0x45bbf4){_0x89fb89=_[_0x497e('0x6f')](_0x45bbf4,'id');var _0x5a3b38;var _0x93f34f=squel[_0x497e('0x70')]();_0x93f34f['from'](_0x26868f[_0x497e('0x71')]);for(var _0x2e3d1a=0x0;_0x2e3d1a<_0x263cf7[_0x497e('0x37')];_0x2e3d1a+=0x1){_0x5a3b38=_0x263cf7[_0x2e3d1a][_0x497e('0x72')]?_0x89fb89[_0x263cf7[_0x2e3d1a][_0x497e('0x72')]][_0x497e('0x73')]:_0x263cf7[_0x2e3d1a][_0x497e('0x68')];_0x5a3b38=_0x263cf7[_0x2e3d1a][_0x497e('0x74')]?_[_0x497e('0x75')](_0x47ed1d[_0x263cf7[_0x2e3d1a][_0x497e('0x74')]],'%s',_0x5a3b38):_0x5a3b38;_0x5a3b38=_0x263cf7[_0x2e3d1a][_0x497e('0x76')]?_[_0x497e('0x75')](_0x37657e[_0x263cf7[_0x2e3d1a][_0x497e('0x76')]],'%s',_0x5a3b38):_0x5a3b38;if(_0x263cf7[_0x2e3d1a]['groupBy']){_0x93f34f[_0x497e('0x67')](_0x5a3b38);}_0x263cf7[_0x2e3d1a][_0x497e('0x77')]&&_0x93f34f['order'](_0x5a3b38,_0x263cf7[_0x2e3d1a][_0x497e('0x77')]==='DESC'?![]:!![]);_0x93f34f['field'](_0x5a3b38,_0x263cf7[_0x2e3d1a][_0x497e('0x78')]||_0x5a3b38);}if(_0x26868f[_0x497e('0x79')]){_0x26868f[_0x497e('0x79')]=JSON[_0x497e('0x7a')](_0x26868f[_0x497e('0x79')]);for(var _0x39b964=0x0;_0x39b964<_0x26868f[_0x497e('0x79')][_0x497e('0x37')];_0x39b964+=0x1){if(_0x26868f[_0x497e('0x79')][_0x39b964]['type']&&_[_0x497e('0x7b')](_0x2944c0,_0x26868f[_0x497e('0x79')][_0x39b964][_0x497e('0x2f')])&&_0x26868f[_0x497e('0x79')][_0x39b964]['parentKey']&&_0x26868f[_0x497e('0x79')][_0x39b964][_0x497e('0x7c')]&&_0x26868f[_0x497e('0x79')][_0x39b964][_0x497e('0x7d')]){_0x93f34f[_0x26868f[_0x497e('0x79')][_0x39b964][_0x497e('0x2f')]](_0x26868f[_0x497e('0x79')][_0x39b964][_0x497e('0x7c')],null,util[_0x497e('0x76')](_0x497e('0x7e'),_0x26868f['table'],_0x26868f[_0x497e('0x79')][_0x39b964]['parentKey'],_0x26868f['joins'][_0x39b964][_0x497e('0x7c')],_0x26868f[_0x497e('0x79')][_0x39b964][_0x497e('0x7d')]));}}}if(_0x26868f[_0x497e('0x7f')]){_0x26868f[_0x497e('0x7f')]=JSON[_0x497e('0x7a')](_0x26868f['conditions']);_0x93f34f['where'](_0x3661c6(_0x26868f[_0x497e('0x7f')][_0x497e('0x67')]));}_0x1f5150=_0x93f34f[_0x497e('0x80')]();_0x93f34f[_0x497e('0x1e')](_0x4e5396);_0x93f34f[_0x497e('0x1b')](0x0);logger[_0x497e('0x81')]('Limited\x20Query:',_0x93f34f[_0x497e('0x82')]());return dbH[_0x497e('0x83')][_0x497e('0x32')](_0x93f34f[_0x497e('0x82')](),{'type':dbH[_0x497e('0x83')][_0x497e('0x84')][_0x497e('0x85')]});}})[_0x497e('0x23')](respondWithResult(_0x3665a5,null))[_0x497e('0x4e')](handleError(_0x3665a5,null));};function runReport(_0x3f7563,_0x4c2cfa,_0x4e7a8d){var _0x8af9a8=_0x4c2cfa['name'];var _0x1093d9=0xa;var _0x329e86=[_0x497e('0x54'),_0x497e('0x86'),_0x497e('0x55'),_0x497e('0x87')];var _0x3f7c5c={'SUM':_0x497e('0x56'),'COUNT':_0x497e('0x57'),'COUNT DISTINCT':_0x497e('0x58'),'MAX':_0x497e('0x88'),'MIN':'MIN(%s)','AVG':_0x497e('0x5a'),'GROUP_CONCAT':_0x497e('0x5b'),'GROUP_CONCAT ASC':_0x497e('0x5c'),'GROUP_CONCAT DESC':_0x497e('0x89')};var _0x570572={'SEC_TO_TIME':_0x497e('0x5d'),'DATE':_0x497e('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x497e('0x60'),'UNIX_TIMESTAMP':_0x497e('0x8a')};var _0x20a7d1=function(_0x378d58){return!_[_0x497e('0x7b')]([_0x497e('0x61'),_0x497e('0x62'),_0x497e('0x63'),_0x497e('0x64')],_0x378d58);};var _0x11e63d=function(_0x5aa1a1){if(!_0x5aa1a1||!_0x5aa1a1['rules'][_0x497e('0x37')]){return'';}for(var _0x5a5df5='(',_0x35951c=0x0;_0x35951c<_0x5aa1a1[_0x497e('0x65')][_0x497e('0x37')];_0x35951c+=0x1){_0x35951c>0x0&&(_0x5a5df5+='\x20'+_0x5aa1a1[_0x497e('0x66')]+'\x20');_0x5a5df5+=_0x5aa1a1[_0x497e('0x65')][_0x35951c][_0x497e('0x67')]?_0x11e63d(_0x5aa1a1[_0x497e('0x65')][_0x35951c][_0x497e('0x67')]):_0x5aa1a1[_0x497e('0x65')][_0x35951c][_0x497e('0x68')]+'\x20'+_0x5aa1a1[_0x497e('0x65')][_0x35951c]['condition']+(_0x20a7d1(_0x5aa1a1[_0x497e('0x65')][_0x35951c]['condition'])?'\x20'+_0x5aa1a1[_0x497e('0x65')][_0x35951c][_0x497e('0x69')]:'');}return _0x5a5df5+')';};var _0x55c08c={'where':{'id':_0x3f7563['id']}},_0x24dbc4,_0x5c7066,_0x59ebaf,_0x286912,_0x11dca0;_0x55c08c=_[_0x497e('0x45')]({},_0x55c08c,_0x4e7a8d);return db[_0x497e('0x40')][_0x497e('0x4d')](_0x55c08c)[_0x497e('0x23')](function(_0x459c04){if(_0x459c04){_0x24dbc4=_0x459c04;return _0x459c04[_0x497e('0x6a')]();}return null;})[_0x497e('0x23')](function(_0x2868f0){if(_0x2868f0){if(!_0x2868f0[_0x497e('0x37')]){throw new db[(_0x497e('0x6b'))][(_0x497e('0x6c'))](_0x497e('0x6d'),0x193);}_0x5c7066=_0x2868f0;return db[_0x497e('0x6e')][_0x497e('0x43')]({'raw':!![]});}return null;})['then'](function(_0x1d3fef){if(_0x1d3fef){_0x59ebaf=_[_0x497e('0x6f')](_0x1d3fef,'id');var _0x5f3bd8;var _0x191af6=squel[_0x497e('0x70')]();_0x191af6[_0x497e('0x8b')](_0x24dbc4[_0x497e('0x71')]);for(var _0x527310=0x0;_0x527310<_0x5c7066[_0x497e('0x37')];_0x527310+=0x1){_0x5f3bd8=_0x5c7066[_0x527310][_0x497e('0x72')]?_0x59ebaf[_0x5c7066[_0x527310][_0x497e('0x72')]][_0x497e('0x73')]:_0x5c7066[_0x527310]['field'];_0x5f3bd8=_0x5c7066[_0x527310][_0x497e('0x74')]?_[_0x497e('0x75')](_0x3f7c5c[_0x5c7066[_0x527310][_0x497e('0x74')]],'%s',_0x5f3bd8):_0x5f3bd8;_0x5f3bd8=_0x5c7066[_0x527310][_0x497e('0x76')]?_[_0x497e('0x75')](_0x570572[_0x5c7066[_0x527310][_0x497e('0x76')]],'%s',_0x5f3bd8):_0x5f3bd8;if(_0x5c7066[_0x527310][_0x497e('0x8c')]){_0x191af6[_0x497e('0x67')](_0x5f3bd8);}_0x5c7066[_0x527310][_0x497e('0x77')]&&_0x191af6[_0x497e('0x8d')](_0x5f3bd8,_0x5c7066[_0x527310][_0x497e('0x77')]===_0x497e('0x8e')?![]:!![]);_0x191af6[_0x497e('0x68')](_0x5f3bd8,_0x5c7066[_0x527310][_0x497e('0x78')]||_0x5f3bd8);}if(_0x24dbc4[_0x497e('0x79')]){_0x24dbc4[_0x497e('0x79')]=JSON[_0x497e('0x7a')](_0x24dbc4[_0x497e('0x79')]);for(var _0x554fb4=0x0;_0x554fb4<_0x24dbc4[_0x497e('0x79')][_0x497e('0x37')];_0x554fb4+=0x1){if(_0x24dbc4[_0x497e('0x79')][_0x554fb4][_0x497e('0x2f')]&&_[_0x497e('0x7b')](_0x329e86,_0x24dbc4[_0x497e('0x79')][_0x554fb4][_0x497e('0x2f')])&&_0x24dbc4[_0x497e('0x79')][_0x554fb4][_0x497e('0x8f')]&&_0x24dbc4[_0x497e('0x79')][_0x554fb4][_0x497e('0x7c')]&&_0x24dbc4[_0x497e('0x79')][_0x554fb4][_0x497e('0x7d')]){_0x191af6[_0x24dbc4['joins'][_0x554fb4][_0x497e('0x2f')]](_0x24dbc4[_0x497e('0x79')][_0x554fb4][_0x497e('0x7c')],null,util[_0x497e('0x76')]('%s.%s\x20=\x20%s.%s',_0x24dbc4[_0x497e('0x71')],_0x24dbc4['joins'][_0x554fb4][_0x497e('0x8f')],_0x24dbc4[_0x497e('0x79')][_0x554fb4][_0x497e('0x7c')],_0x24dbc4[_0x497e('0x79')][_0x554fb4]['foreignKey']));}}}if(_0x24dbc4[_0x497e('0x7f')]){_0x24dbc4[_0x497e('0x7f')]=JSON['parse'](_0x24dbc4['conditions']);_0x191af6['where'](_0x11e63d(_0x24dbc4[_0x497e('0x7f')][_0x497e('0x67')]));}_0x11dca0=_0x191af6[_0x497e('0x80')]();_0x191af6[_0x497e('0x1e')](_0x1093d9);_0x191af6[_0x497e('0x1b')](0x0);return;}})[_0x497e('0x23')](function(){if(_0x4c2cfa[_0x497e('0x90')]===_0x497e('0x91')){return null;}var _0x52ca94=_[_0x497e('0x45')](_0x4c2cfa,{'name':_0x4c2cfa[_0x497e('0x92')]||_0x4c2cfa[_0x497e('0x29')]||_0x24dbc4['name'],'basename':_0x8af9a8,'savename':util[_0x497e('0x76')](_0x497e('0x93'),_0x4c2cfa[_0x497e('0x29')]||_0x24dbc4[_0x497e('0x29')],require(_0x497e('0x94'))[_0x497e('0x95')](0x4),_0x4c2cfa['output']||_0x497e('0x96')),'reportId':_0x24dbc4['id'],'reportType':'custom'});return db[_0x497e('0x97')][_0x497e('0x46')](_0x52ca94,{'raw':!![]});})[_0x497e('0x23')](function(_0x2d6181){if(_0x24dbc4[_0x497e('0x71')]==='cdr'){_0x11dca0[_0x497e('0x3a')](_0x24dbc4[_0x497e('0x71')]+_0x497e('0x98'),_0x4c2cfa[_0x497e('0x99')],_0x4c2cfa[_0x497e('0x9a')]);}else{_0x11dca0[_0x497e('0x3a')](_0x24dbc4[_0x497e('0x71')]+_0x497e('0x9b'),_0x4c2cfa[_0x497e('0x99')],_0x4c2cfa[_0x497e('0x9a')]);}if(_0x2d6181){logger['info'](_0x497e('0x9c'),_0x11dca0[_0x497e('0x82')]());require('child_process')[_0x497e('0x9d')](path[_0x497e('0x54')](__dirname,_0x497e('0x9e'),_0x2d6181[_0x497e('0x90')]),[_0x2d6181['id'],_0x11dca0[_0x497e('0x82')](),path[_0x497e('0x54')](__dirname,'../../files/reports',_0x2d6181['savename']),_0x8af9a8]);return _0x2d6181;}else{var _0x32b198=squel[_0x497e('0x70')]();_0x32b198['from']('('+_0x11dca0[_0x497e('0x82')]()+')','countTable');_0x32b198[_0x497e('0x68')](_0x497e('0x9f'),_0x497e('0x1d'));_0x11dca0[_0x497e('0x1e')](_0x4c2cfa[_0x497e('0x1e')]||_0x1093d9);_0x11dca0[_0x497e('0x1b')](_0x4c2cfa[_0x497e('0x1b')]||0x0);return dbH[_0x497e('0x83')]['query'](_0x32b198['toString'](),{'type':dbH[_0x497e('0x83')][_0x497e('0x84')][_0x497e('0x85')]})['then'](function(_0x53b586){if(!_0x53b586[_0x497e('0x37')]){_0x286912=0x0;}else{_0x286912=_0x53b586[0x0][_0x497e('0x1d')]||0x0;}return dbH[_0x497e('0x83')][_0x497e('0x32')](_0x11dca0[_0x497e('0x82')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x497e('0x23')](function(_0x3d3397){return{'rows':_0x3d3397||[],'count':_0x286912};});}});}exports[_0x497e('0xa0')]=function(_0x79079a,_0x5d23c1){return runReport(_0x79079a['params'],_0x79079a[_0x497e('0x32')],_0x79079a[_0x497e('0x3f')])[_0x497e('0x23')](respondWithResult(_0x5d23c1,null))['catch'](handleError(_0x5d23c1,null));};exports['runReport']=runReport;exports[_0x497e('0x32')]=function(_0xe9a92,_0x3a3b81){var _0x258291=0xa;var _0x207796=['join',_0x497e('0x86'),'right_join',_0x497e('0x87')];var _0x240723={'SUM':_0x497e('0x56'),'COUNT':_0x497e('0x57'),'COUNT DISTINCT':_0x497e('0x58'),'MAX':_0x497e('0x88'),'MIN':_0x497e('0x59'),'AVG':_0x497e('0x5a'),'GROUP_CONCAT':_0x497e('0x5b'),'GROUP_CONCAT ASC':_0x497e('0x5c'),'GROUP_CONCAT DESC':_0x497e('0x89')};var _0x268673={'SEC_TO_TIME':_0x497e('0x5d'),'DATE':_0x497e('0x5e'),'HOUR':_0x497e('0x5f'),'ROUND':_0x497e('0x60'),'UNIX_TIMESTAMP':_0x497e('0x8a')};var _0x3daecd=function(_0x2173f8){return!_[_0x497e('0x7b')]([_0x497e('0x61'),_0x497e('0x62'),_0x497e('0x63'),_0x497e('0x64')],_0x2173f8);};var _0x50b3ca=function(_0x877883){if(!_0x877883||!_0x877883[_0x497e('0x65')][_0x497e('0x37')]){return'';}for(var _0x177b3d='(',_0x1979aa=0x0;_0x1979aa<_0x877883['rules'][_0x497e('0x37')];_0x1979aa+=0x1){_0x1979aa>0x0&&(_0x177b3d+='\x20'+_0x877883[_0x497e('0x66')]+'\x20');_0x177b3d+=_0x877883[_0x497e('0x65')][_0x1979aa]['group']?_0x50b3ca(_0x877883[_0x497e('0x65')][_0x1979aa]['group']):_0x877883['rules'][_0x1979aa][_0x497e('0x68')]+'\x20'+_0x877883[_0x497e('0x65')][_0x1979aa]['condition']+(_0x3daecd(_0x877883[_0x497e('0x65')][_0x1979aa]['condition'])?'\x20'+_0x877883['rules'][_0x1979aa]['value']:'');}return _0x177b3d+')';};var _0x488a30={'where':{'id':_0xe9a92['params']['id']}},_0x4f9181,_0x2fc5cf,_0x5c3051,_0x33536d,_0x512a20;_0x488a30=_['merge']({},_0x488a30,_0xe9a92['options']);return db[_0x497e('0x40')]['find'](_0x488a30)[_0x497e('0x23')](function(_0x4bfe25){if(_0x4bfe25){_0x4f9181=_0x4bfe25;return _0x4bfe25[_0x497e('0x6a')]();}return null;})['then'](function(_0x2ea56c){if(_0x2ea56c){if(!_0x2ea56c['length']){throw new db[(_0x497e('0x6b'))][(_0x497e('0x6c'))](_0x497e('0x6d'),0x193);}_0x2fc5cf=_0x2ea56c;return db[_0x497e('0x6e')][_0x497e('0x43')]({'raw':!![]});}return null;})['then'](function(_0x335447){if(_0x335447){_0x5c3051=_[_0x497e('0x6f')](_0x335447,'id');var _0x45c8bd;var _0x3acc9f=squel['select']();_0x3acc9f[_0x497e('0x8b')](_0x4f9181[_0x497e('0x71')]);for(var _0x3f9e84=0x0;_0x3f9e84<_0x2fc5cf['length'];_0x3f9e84+=0x1){_0x45c8bd=_0x2fc5cf[_0x3f9e84][_0x497e('0x72')]?_0x5c3051[_0x2fc5cf[_0x3f9e84]['MetricId']][_0x497e('0x73')]:_0x2fc5cf[_0x3f9e84][_0x497e('0x68')];_0x45c8bd=_0x2fc5cf[_0x3f9e84][_0x497e('0x74')]?_[_0x497e('0x75')](_0x240723[_0x2fc5cf[_0x3f9e84][_0x497e('0x74')]],'%s',_0x45c8bd):_0x45c8bd;_0x45c8bd=_0x2fc5cf[_0x3f9e84][_0x497e('0x76')]?_['replace'](_0x268673[_0x2fc5cf[_0x3f9e84][_0x497e('0x76')]],'%s',_0x45c8bd):_0x45c8bd;if(_0x2fc5cf[_0x3f9e84][_0x497e('0x8c')]){_0x3acc9f['group'](_0x45c8bd);}_0x2fc5cf[_0x3f9e84][_0x497e('0x77')]&&_0x3acc9f[_0x497e('0x8d')](_0x45c8bd,_0x2fc5cf[_0x3f9e84]['orderBy']==='DESC'?![]:!![]);_0x3acc9f[_0x497e('0x68')](_0x45c8bd,_0x2fc5cf[_0x3f9e84][_0x497e('0x78')]||_0x45c8bd);}if(_0x4f9181[_0x497e('0x79')]){_0x4f9181[_0x497e('0x79')]=JSON['parse'](_0x4f9181[_0x497e('0x79')]);for(var _0x2bf8be=0x0;_0x2bf8be<_0x4f9181[_0x497e('0x79')][_0x497e('0x37')];_0x2bf8be+=0x1){if(_0x4f9181[_0x497e('0x79')][_0x2bf8be][_0x497e('0x2f')]&&_[_0x497e('0x7b')](_0x207796,_0x4f9181[_0x497e('0x79')][_0x2bf8be][_0x497e('0x2f')])&&_0x4f9181[_0x497e('0x79')][_0x2bf8be]['parentKey']&&_0x4f9181[_0x497e('0x79')][_0x2bf8be][_0x497e('0x7c')]&&_0x4f9181[_0x497e('0x79')][_0x2bf8be]['foreignKey']){_0x3acc9f[_0x4f9181[_0x497e('0x79')][_0x2bf8be][_0x497e('0x2f')]](_0x4f9181['joins'][_0x2bf8be][_0x497e('0x7c')],null,util[_0x497e('0x76')](_0x497e('0x7e'),_0x4f9181['table'],_0x4f9181[_0x497e('0x79')][_0x2bf8be][_0x497e('0x8f')],_0x4f9181['joins'][_0x2bf8be]['foreignTable'],_0x4f9181['joins'][_0x2bf8be]['foreignKey']));}}}if(_0x4f9181['conditions']){_0x4f9181[_0x497e('0x7f')]=JSON[_0x497e('0x7a')](_0x4f9181['conditions']);_0x3acc9f[_0x497e('0x3a')](_0x50b3ca(_0x4f9181['conditions'][_0x497e('0x67')]));}_0x512a20=_0x3acc9f[_0x497e('0x80')]();_0x3acc9f[_0x497e('0x1e')](_0x258291);_0x3acc9f[_0x497e('0x1b')](0x0);logger['debug'](_0x497e('0xa1'),_0x3acc9f[_0x497e('0x82')]());return dbH[_0x497e('0x83')][_0x497e('0x32')](_0x3acc9f['toString'](),{'type':dbH[_0x497e('0x83')][_0x497e('0x84')][_0x497e('0x85')]});}})['then'](function(){return{'sql':_0x512a20[_0x497e('0x82')]()};})['then'](respondWithResult(_0x3a3b81,null))[_0x497e('0x4e')](handleError(_0x3a3b81,null));};
\ No newline at end of file
+var _0x8f41=['UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticCustomReport','fieldName','type','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','include','rows','catch','rawAttributes','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','update','params','preview','join','left_join','right_join','COUNT(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','table','MetricId','metric','field','function','format','replace','groupBy','orderBy','DESC','alias','parse','joins','includes','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SUM(%s)','MIN(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','value','ValidationErrorItem','keyBy','select','foreignKey','output','web','fullPath','%s-%s.%s','generate','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','SELECT','run','runReport','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','Sequelize','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','get','CustomReports'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0x8f41,0x1c3));var _0x18f4=function(_0x3b0d76,_0x223d70){_0x3b0d76=_0x3b0d76-0x0;var _0x2295e0=_0x8f41[_0x3b0d76];return _0x2295e0;};'use strict';var emlformat=require(_0x18f4('0x0'));var rimraf=require(_0x18f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x18f4('0x2'));var rp=require(_0x18f4('0x3'));var moment=require(_0x18f4('0x4'));var BPromise=require(_0x18f4('0x5'));var Mustache=require(_0x18f4('0x6'));var util=require('util');var path=require(_0x18f4('0x7'));var sox=require(_0x18f4('0x8'));var csv=require(_0x18f4('0x9'));var ejs=require(_0x18f4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x18f4('0xb'));var squel=require(_0x18f4('0xc'));var crypto=require(_0x18f4('0xd'));var jsforce=require(_0x18f4('0xe'));var deskjs=require(_0x18f4('0xf'));var toCsv=require(_0x18f4('0x9'));var querystring=require('querystring');var Papa=require(_0x18f4('0x10'));var Redis=require('ioredis');var authService=require(_0x18f4('0x11'));var qs=require(_0x18f4('0x12'));var as=require(_0x18f4('0x13'));var hardwareService=require(_0x18f4('0x14'));var logger=require(_0x18f4('0x15'))(_0x18f4('0x16'));var utils=require('../../config/utils');var config=require(_0x18f4('0x17'));var licenseUtil=require(_0x18f4('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x18f4('0x19'))[_0x18f4('0x1a')];function respondWithStatusCode(_0x5a0c52,_0x493731){_0x493731=_0x493731||0xcc;return function(_0x5652ca){if(_0x5652ca){return _0x5a0c52['sendStatus'](_0x493731);}return _0x5a0c52[_0x18f4('0x1b')](_0x493731)[_0x18f4('0x1c')]();};}function respondWithResult(_0x14f374,_0x10e956){_0x10e956=_0x10e956||0xc8;return function(_0x339fc1){if(_0x339fc1){return _0x14f374[_0x18f4('0x1b')](_0x10e956)[_0x18f4('0x1d')](_0x339fc1);}};}function respondWithFilteredResult(_0x1ca11b,_0x5628d0){return function(_0xcbeb56){if(_0xcbeb56){var _0x1ef08e=typeof _0x5628d0[_0x18f4('0x1e')]===_0x18f4('0x1f')&&typeof _0x5628d0[_0x18f4('0x20')]===_0x18f4('0x1f');var _0x5c63fc=_0xcbeb56[_0x18f4('0x21')];var _0x14318a=_0x1ef08e?0x0:_0x5628d0[_0x18f4('0x1e')];var _0x14b262=_0x1ef08e?_0xcbeb56[_0x18f4('0x21')]:_0x5628d0[_0x18f4('0x1e')]+_0x5628d0[_0x18f4('0x20')];var _0x3bee76;if(_0x14b262>=_0x5c63fc){_0x14b262=_0x5c63fc;_0x3bee76=0xc8;}else{_0x3bee76=0xce;}_0x1ca11b[_0x18f4('0x1b')](_0x3bee76);return _0x1ca11b[_0x18f4('0x22')](_0x18f4('0x23'),_0x14318a+'-'+_0x14b262+'/'+_0x5c63fc)[_0x18f4('0x1d')](_0xcbeb56);}return null;};}function patchUpdates(_0x224899){return function(_0x2762c5){try{jsonpatch[_0x18f4('0x24')](_0x2762c5,_0x224899,!![]);}catch(_0x1df3c1){return BPromise['reject'](_0x1df3c1);}return _0x2762c5[_0x18f4('0x25')]();};}function saveUpdates(_0x420cb3,_0x1a9aee){return function(_0x4b0030){if(_0x4b0030){return _0x4b0030['update'](_0x420cb3)[_0x18f4('0x26')](function(_0x300ab9){return _0x300ab9;});}return null;};}function removeEntity(_0x506a1a,_0x2cf648){return function(_0x97caf8){if(_0x97caf8){return _0x97caf8['destroy']()[_0x18f4('0x26')](function(){var _0x381939=_0x97caf8[_0x18f4('0x27')]({'plain':!![]});var _0x501491=_0x18f4('0x28');return db[_0x18f4('0x29')][_0x18f4('0x2a')]({'where':{'type':_0x501491,'resourceId':_0x381939['id']}})[_0x18f4('0x26')](function(){return _0x97caf8;});})[_0x18f4('0x26')](function(){_0x506a1a[_0x18f4('0x1b')](0xcc)[_0x18f4('0x1c')]();});}};}function handleEntityNotFound(_0x449430,_0x471e68){return function(_0x37a5ba){if(!_0x37a5ba){_0x449430[_0x18f4('0x2b')](0x194);}return _0x37a5ba;};}function handleError(_0x36a8dc,_0x18fbf3){_0x18fbf3=_0x18fbf3||0x1f4;return function(_0x1dc1b3){logger[_0x18f4('0x2c')](_0x1dc1b3['stack']);if(_0x1dc1b3[_0x18f4('0x2d')]){delete _0x1dc1b3[_0x18f4('0x2d')];}_0x36a8dc[_0x18f4('0x1b')](_0x18fbf3)[_0x18f4('0x2e')](_0x1dc1b3);};}exports[_0x18f4('0x2f')]=function(_0x20abdb,_0x1cc776){var _0x6523ed={},_0x2e6ecf={},_0xaa679a={'count':0x0,'rows':[]};var _0x666692=_[_0x18f4('0x30')](db[_0x18f4('0x31')]['rawAttributes'],function(_0x6a27fd){return{'name':_0x6a27fd[_0x18f4('0x32')],'type':_0x6a27fd[_0x18f4('0x33')]['key']};});_0x2e6ecf[_0x18f4('0x34')]=_[_0x18f4('0x30')](_0x666692,_0x18f4('0x2d'));_0x2e6ecf[_0x18f4('0x35')]=_[_0x18f4('0x36')](_0x20abdb[_0x18f4('0x35')]);_0x2e6ecf['filters']=_[_0x18f4('0x37')](_0x2e6ecf[_0x18f4('0x34')],_0x2e6ecf[_0x18f4('0x35')]);_0x6523ed['attributes']=_[_0x18f4('0x37')](_0x2e6ecf[_0x18f4('0x34')],qs[_0x18f4('0x38')](_0x20abdb[_0x18f4('0x35')][_0x18f4('0x38')]));_0x6523ed['attributes']=_0x6523ed[_0x18f4('0x39')]['length']?_0x6523ed['attributes']:_0x2e6ecf['model'];if(!_0x20abdb[_0x18f4('0x35')][_0x18f4('0x3a')](_0x18f4('0x3b'))){_0x6523ed[_0x18f4('0x20')]=qs[_0x18f4('0x20')](_0x20abdb[_0x18f4('0x35')][_0x18f4('0x20')]);_0x6523ed[_0x18f4('0x1e')]=qs[_0x18f4('0x1e')](_0x20abdb[_0x18f4('0x35')][_0x18f4('0x1e')]);}_0x6523ed[_0x18f4('0x3c')]=qs['sort'](_0x20abdb['query'][_0x18f4('0x3d')]);_0x6523ed[_0x18f4('0x3e')]=qs[_0x18f4('0x3f')](_['pick'](_0x20abdb[_0x18f4('0x35')],_0x2e6ecf[_0x18f4('0x3f')]),_0x666692);if(_0x20abdb[_0x18f4('0x35')][_0x18f4('0x40')]){_0x6523ed[_0x18f4('0x3e')]=_[_0x18f4('0x41')](_0x6523ed[_0x18f4('0x3e')],{'$or':_[_0x18f4('0x30')](_0x666692,function(_0x3b3986){if(_0x3b3986[_0x18f4('0x33')]!=='VIRTUAL'){var _0x1c1a6f={};_0x1c1a6f[_0x3b3986[_0x18f4('0x2d')]]={'$like':'%'+_0x20abdb[_0x18f4('0x35')]['filter']+'%'};return _0x1c1a6f;}})});}_0x6523ed=_[_0x18f4('0x41')]({},_0x6523ed,_0x20abdb[_0x18f4('0x42')]);var _0x32336a={'where':_0x6523ed[_0x18f4('0x3e')]};return db['AnalyticCustomReport'][_0x18f4('0x21')](_0x32336a)['then'](function(_0x4b15a4){_0xaa679a[_0x18f4('0x21')]=_0x4b15a4;if(_0x20abdb[_0x18f4('0x35')]['includeAll']){_0x6523ed[_0x18f4('0x43')]=[{'all':!![]}];}return db[_0x18f4('0x31')]['findAll'](_0x6523ed);})['then'](function(_0x462bf5){_0xaa679a[_0x18f4('0x44')]=_0x462bf5;return _0xaa679a;})[_0x18f4('0x26')](respondWithFilteredResult(_0x1cc776,_0x6523ed))[_0x18f4('0x45')](handleError(_0x1cc776,null));};exports['show']=function(_0x5bcde4,_0x1d5e40){var _0x576ac0={'raw':![],'where':{'id':_0x5bcde4['params']['id']}},_0x3883b9={};_0x3883b9[_0x18f4('0x34')]=_[_0x18f4('0x36')](db[_0x18f4('0x31')][_0x18f4('0x46')]);_0x3883b9[_0x18f4('0x35')]=_[_0x18f4('0x36')](_0x5bcde4['query']);_0x3883b9[_0x18f4('0x3f')]=_[_0x18f4('0x37')](_0x3883b9[_0x18f4('0x34')],_0x3883b9[_0x18f4('0x35')]);_0x576ac0['attributes']=_[_0x18f4('0x37')](_0x3883b9['model'],qs[_0x18f4('0x38')](_0x5bcde4[_0x18f4('0x35')][_0x18f4('0x38')]));_0x576ac0[_0x18f4('0x39')]=_0x576ac0[_0x18f4('0x39')][_0x18f4('0x47')]?_0x576ac0[_0x18f4('0x39')]:_0x3883b9[_0x18f4('0x34')];if(_0x5bcde4[_0x18f4('0x35')]['includeAll']){_0x576ac0[_0x18f4('0x43')]=[{'all':!![]}];}_0x576ac0=_['merge']({},_0x576ac0,_0x5bcde4['options']);return db[_0x18f4('0x31')]['find'](_0x576ac0)[_0x18f4('0x26')](handleEntityNotFound(_0x1d5e40,null))[_0x18f4('0x26')](respondWithResult(_0x1d5e40,null))[_0x18f4('0x45')](handleError(_0x1d5e40,null));};exports[_0x18f4('0x48')]=function(_0x43f559,_0x3b1cc7){return db[_0x18f4('0x31')][_0x18f4('0x48')](_0x43f559[_0x18f4('0x49')],{})[_0x18f4('0x26')](function(_0x224980){var _0x2b8fa6=_0x43f559[_0x18f4('0x4a')]['get']({'plain':!![]});if(!_0x2b8fa6)throw new Error(_0x18f4('0x4b'));if(_0x2b8fa6[_0x18f4('0x4c')]===_0x18f4('0x4a')){var _0x2d594d=_0x224980[_0x18f4('0x27')]({'plain':!![]});var _0x2e6b73=_0x18f4('0x4d');return db[_0x18f4('0x4e')][_0x18f4('0x4f')]({'where':{'name':_0x2e6b73,'userProfileId':_0x2b8fa6[_0x18f4('0x50')]},'raw':!![]})[_0x18f4('0x26')](function(_0x540816){if(_0x540816&&_0x540816[_0x18f4('0x51')]===0x0){return db[_0x18f4('0x29')][_0x18f4('0x48')]({'name':_0x2d594d[_0x18f4('0x2d')],'resourceId':_0x2d594d['id'],'type':_0x18f4('0x28'),'sectionId':_0x540816['id']},{})[_0x18f4('0x26')](function(){return _0x224980;});}else{return _0x224980;}})[_0x18f4('0x45')](function(_0x487b94){logger[_0x18f4('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x487b94);throw _0x487b94;});}return _0x224980;})[_0x18f4('0x26')](respondWithResult(_0x3b1cc7,0xc9))[_0x18f4('0x45')](handleError(_0x3b1cc7,null));};exports[_0x18f4('0x52')]=function(_0x15d797,_0xab6d25){if(_0x15d797[_0x18f4('0x49')]['id']){delete _0x15d797[_0x18f4('0x49')]['id'];}return db[_0x18f4('0x31')][_0x18f4('0x4f')]({'where':{'id':_0x15d797[_0x18f4('0x53')]['id']}})[_0x18f4('0x26')](handleEntityNotFound(_0xab6d25,null))['then'](saveUpdates(_0x15d797[_0x18f4('0x49')],null))[_0x18f4('0x26')](respondWithResult(_0xab6d25,null))[_0x18f4('0x45')](handleError(_0xab6d25,null));};exports[_0x18f4('0x2a')]=function(_0x390c30,_0x17e4a2){return db[_0x18f4('0x31')][_0x18f4('0x4f')]({'where':{'id':_0x390c30[_0x18f4('0x53')]['id']}})[_0x18f4('0x26')](handleEntityNotFound(_0x17e4a2,null))[_0x18f4('0x26')](removeEntity(_0x17e4a2,null))[_0x18f4('0x45')](handleError(_0x17e4a2,null));};exports[_0x18f4('0x54')]=function(_0x4e1e2f,_0x49a41d){var _0x52fbed=0xa;var _0x37788c=[_0x18f4('0x55'),_0x18f4('0x56'),_0x18f4('0x57'),'cross_join'];var _0x28fda5={'SUM':'SUM(%s)','COUNT':_0x18f4('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x18f4('0x59'),'GROUP_CONCAT':_0x18f4('0x5a'),'GROUP_CONCAT ASC':_0x18f4('0x5b'),'GROUP_CONCAT DESC':_0x18f4('0x5c')};var _0x30078a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x18f4('0x5d'),'UNIX_TIMESTAMP':_0x18f4('0x5e')};var _0x17875b=function(_0x3f20cb){return!_['includes']([_0x18f4('0x5f'),_0x18f4('0x60'),_0x18f4('0x61'),_0x18f4('0x62')],_0x3f20cb);};var _0x3067af=function(_0x2909eb){if(!_0x2909eb||!_0x2909eb['rules']['length']){return'';}for(var _0x26e34f='(',_0x138d11=0x0;_0x138d11<_0x2909eb['rules']['length'];_0x138d11+=0x1){_0x138d11>0x0&&(_0x26e34f+='\x20'+_0x2909eb[_0x18f4('0x63')]+'\x20');_0x26e34f+=_0x2909eb[_0x18f4('0x64')][_0x138d11]['group']?_0x3067af(_0x2909eb[_0x18f4('0x64')][_0x138d11][_0x18f4('0x65')]):_0x2909eb[_0x18f4('0x64')][_0x138d11]['field']+'\x20'+_0x2909eb[_0x18f4('0x64')][_0x138d11][_0x18f4('0x66')]+(_0x17875b(_0x2909eb[_0x18f4('0x64')][_0x138d11][_0x18f4('0x66')])?'\x20'+_0x2909eb[_0x18f4('0x64')][_0x138d11]['value']:'');}return _0x26e34f+')';};var _0x4c178a={'where':{'id':_0x4e1e2f[_0x18f4('0x53')]['id']}},_0x16dc23,_0x48fae4,_0x135c42,_0x7f71f2,_0x1223c0;_0x4c178a=_['merge']({},_0x4c178a,_0x4e1e2f[_0x18f4('0x42')]);return db['AnalyticCustomReport'][_0x18f4('0x4f')](_0x4c178a)[_0x18f4('0x26')](function(_0x187400){if(_0x187400){_0x16dc23=_0x187400;return _0x187400[_0x18f4('0x67')]();}return null;})[_0x18f4('0x26')](function(_0xcf1343){if(_0xcf1343){if(!_0xcf1343[_0x18f4('0x47')]){throw new db['Sequelize']['ValidationErrorItem'](_0x18f4('0x68'),0x193);}_0x48fae4=_0xcf1343;return db[_0x18f4('0x69')][_0x18f4('0x6a')]({'raw':!![]});}return null;})[_0x18f4('0x26')](function(_0x2d8591){if(_0x2d8591){_0x135c42=_['keyBy'](_0x2d8591,'id');var _0x495362;var _0x5b7069=squel['select']();_0x5b7069['from'](_0x16dc23[_0x18f4('0x6b')]);for(var _0xe2607a=0x0;_0xe2607a<_0x48fae4[_0x18f4('0x47')];_0xe2607a+=0x1){_0x495362=_0x48fae4[_0xe2607a][_0x18f4('0x6c')]?_0x135c42[_0x48fae4[_0xe2607a]['MetricId']][_0x18f4('0x6d')]:_0x48fae4[_0xe2607a][_0x18f4('0x6e')];_0x495362=_0x48fae4[_0xe2607a][_0x18f4('0x6f')]?_['replace'](_0x28fda5[_0x48fae4[_0xe2607a][_0x18f4('0x6f')]],'%s',_0x495362):_0x495362;_0x495362=_0x48fae4[_0xe2607a][_0x18f4('0x70')]?_[_0x18f4('0x71')](_0x30078a[_0x48fae4[_0xe2607a]['format']],'%s',_0x495362):_0x495362;if(_0x48fae4[_0xe2607a][_0x18f4('0x72')]){_0x5b7069['group'](_0x495362);}_0x48fae4[_0xe2607a][_0x18f4('0x73')]&&_0x5b7069[_0x18f4('0x3c')](_0x495362,_0x48fae4[_0xe2607a][_0x18f4('0x73')]===_0x18f4('0x74')?![]:!![]);_0x5b7069[_0x18f4('0x6e')](_0x495362,_0x48fae4[_0xe2607a][_0x18f4('0x75')]||_0x495362);}if(_0x16dc23['joins']){_0x16dc23['joins']=JSON[_0x18f4('0x76')](_0x16dc23[_0x18f4('0x77')]);for(var _0x550384=0x0;_0x550384<_0x16dc23['joins'][_0x18f4('0x47')];_0x550384+=0x1){if(_0x16dc23[_0x18f4('0x77')][_0x550384]['type']&&_[_0x18f4('0x78')](_0x37788c,_0x16dc23['joins'][_0x550384][_0x18f4('0x33')])&&_0x16dc23['joins'][_0x550384]['parentKey']&&_0x16dc23[_0x18f4('0x77')][_0x550384]['foreignTable']&&_0x16dc23[_0x18f4('0x77')][_0x550384]['foreignKey']){_0x5b7069[_0x16dc23[_0x18f4('0x77')][_0x550384][_0x18f4('0x33')]](_0x16dc23[_0x18f4('0x77')][_0x550384][_0x18f4('0x79')],null,util['format'](_0x18f4('0x7a'),_0x16dc23['table'],_0x16dc23[_0x18f4('0x77')][_0x550384][_0x18f4('0x7b')],_0x16dc23['joins'][_0x550384][_0x18f4('0x79')],_0x16dc23[_0x18f4('0x77')][_0x550384]['foreignKey']));}}}if(_0x16dc23[_0x18f4('0x7c')]){_0x16dc23['conditions']=JSON[_0x18f4('0x76')](_0x16dc23[_0x18f4('0x7c')]);_0x5b7069[_0x18f4('0x3e')](_0x3067af(_0x16dc23['conditions']['group']));}_0x1223c0=_0x5b7069[_0x18f4('0x7d')]();_0x5b7069['limit'](_0x52fbed);_0x5b7069[_0x18f4('0x1e')](0x0);logger[_0x18f4('0x7e')](_0x18f4('0x7f'),_0x5b7069['toString']());return dbH[_0x18f4('0x80')]['query'](_0x5b7069[_0x18f4('0x81')](),{'type':dbH[_0x18f4('0x80')][_0x18f4('0x82')]['SELECT']});}})[_0x18f4('0x26')](respondWithResult(_0x49a41d,null))[_0x18f4('0x45')](handleError(_0x49a41d,null));};function runReport(_0x31968e,_0x19a537,_0x3c3821){var _0x5df7e9=_0x19a537['name'];var _0x4fc7a9=0xa;var _0x5287ca=[_0x18f4('0x55'),_0x18f4('0x56'),_0x18f4('0x57'),'cross_join'];var _0x10f805={'SUM':_0x18f4('0x83'),'COUNT':_0x18f4('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x18f4('0x84'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x18f4('0x5a'),'GROUP_CONCAT ASC':_0x18f4('0x5b'),'GROUP_CONCAT DESC':_0x18f4('0x5c')};var _0x363d41={'SEC_TO_TIME':_0x18f4('0x85'),'DATE':_0x18f4('0x86'),'HOUR':_0x18f4('0x87'),'ROUND':_0x18f4('0x5d'),'UNIX_TIMESTAMP':_0x18f4('0x5e')};var _0x43e1c8=function(_0x5f591a){return!_[_0x18f4('0x78')](['IS\x20NULL',_0x18f4('0x60'),_0x18f4('0x61'),_0x18f4('0x62')],_0x5f591a);};var _0xe5a813=function(_0x1bb5f8){if(!_0x1bb5f8||!_0x1bb5f8['rules'][_0x18f4('0x47')]){return'';}for(var _0x4a8805='(',_0xb36dc=0x0;_0xb36dc<_0x1bb5f8[_0x18f4('0x64')]['length'];_0xb36dc+=0x1){_0xb36dc>0x0&&(_0x4a8805+='\x20'+_0x1bb5f8[_0x18f4('0x63')]+'\x20');_0x4a8805+=_0x1bb5f8[_0x18f4('0x64')][_0xb36dc][_0x18f4('0x65')]?_0xe5a813(_0x1bb5f8[_0x18f4('0x64')][_0xb36dc]['group']):_0x1bb5f8[_0x18f4('0x64')][_0xb36dc][_0x18f4('0x6e')]+'\x20'+_0x1bb5f8[_0x18f4('0x64')][_0xb36dc]['condition']+(_0x43e1c8(_0x1bb5f8[_0x18f4('0x64')][_0xb36dc][_0x18f4('0x66')])?'\x20'+_0x1bb5f8[_0x18f4('0x64')][_0xb36dc][_0x18f4('0x88')]:'');}return _0x4a8805+')';};var _0x17c83d={'where':{'id':_0x31968e['id']}},_0x58535d,_0x1c2346,_0x2d5077,_0x73d35d,_0x239db4;_0x17c83d=_['merge']({},_0x17c83d,_0x3c3821);return db['AnalyticCustomReport'][_0x18f4('0x4f')](_0x17c83d)['then'](function(_0x730704){if(_0x730704){_0x58535d=_0x730704;return _0x730704[_0x18f4('0x67')]();}return null;})[_0x18f4('0x26')](function(_0x3957de){if(_0x3957de){if(!_0x3957de['length']){throw new db['Sequelize'][(_0x18f4('0x89'))](_0x18f4('0x68'),0x193);}_0x1c2346=_0x3957de;return db[_0x18f4('0x69')][_0x18f4('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x6ea3d7){if(_0x6ea3d7){_0x2d5077=_[_0x18f4('0x8a')](_0x6ea3d7,'id');var _0x4ccf70;var _0x31c1ac=squel[_0x18f4('0x8b')]();_0x31c1ac['from'](_0x58535d['table']);for(var _0x1c326f=0x0;_0x1c326f<_0x1c2346[_0x18f4('0x47')];_0x1c326f+=0x1){_0x4ccf70=_0x1c2346[_0x1c326f]['MetricId']?_0x2d5077[_0x1c2346[_0x1c326f][_0x18f4('0x6c')]][_0x18f4('0x6d')]:_0x1c2346[_0x1c326f][_0x18f4('0x6e')];_0x4ccf70=_0x1c2346[_0x1c326f][_0x18f4('0x6f')]?_[_0x18f4('0x71')](_0x10f805[_0x1c2346[_0x1c326f][_0x18f4('0x6f')]],'%s',_0x4ccf70):_0x4ccf70;_0x4ccf70=_0x1c2346[_0x1c326f]['format']?_[_0x18f4('0x71')](_0x363d41[_0x1c2346[_0x1c326f][_0x18f4('0x70')]],'%s',_0x4ccf70):_0x4ccf70;if(_0x1c2346[_0x1c326f][_0x18f4('0x72')]){_0x31c1ac[_0x18f4('0x65')](_0x4ccf70);}_0x1c2346[_0x1c326f]['orderBy']&&_0x31c1ac[_0x18f4('0x3c')](_0x4ccf70,_0x1c2346[_0x1c326f][_0x18f4('0x73')]==='DESC'?![]:!![]);_0x31c1ac['field'](_0x4ccf70,_0x1c2346[_0x1c326f][_0x18f4('0x75')]||_0x4ccf70);}if(_0x58535d[_0x18f4('0x77')]){_0x58535d[_0x18f4('0x77')]=JSON[_0x18f4('0x76')](_0x58535d[_0x18f4('0x77')]);for(var _0x2f9909=0x0;_0x2f9909<_0x58535d[_0x18f4('0x77')][_0x18f4('0x47')];_0x2f9909+=0x1){if(_0x58535d['joins'][_0x2f9909][_0x18f4('0x33')]&&_[_0x18f4('0x78')](_0x5287ca,_0x58535d['joins'][_0x2f9909]['type'])&&_0x58535d['joins'][_0x2f9909][_0x18f4('0x7b')]&&_0x58535d[_0x18f4('0x77')][_0x2f9909][_0x18f4('0x79')]&&_0x58535d[_0x18f4('0x77')][_0x2f9909][_0x18f4('0x8c')]){_0x31c1ac[_0x58535d['joins'][_0x2f9909][_0x18f4('0x33')]](_0x58535d[_0x18f4('0x77')][_0x2f9909][_0x18f4('0x79')],null,util[_0x18f4('0x70')]('%s.%s\x20=\x20%s.%s',_0x58535d[_0x18f4('0x6b')],_0x58535d[_0x18f4('0x77')][_0x2f9909][_0x18f4('0x7b')],_0x58535d[_0x18f4('0x77')][_0x2f9909][_0x18f4('0x79')],_0x58535d['joins'][_0x2f9909]['foreignKey']));}}}if(_0x58535d[_0x18f4('0x7c')]){_0x58535d['conditions']=JSON[_0x18f4('0x76')](_0x58535d[_0x18f4('0x7c')]);_0x31c1ac[_0x18f4('0x3e')](_0xe5a813(_0x58535d[_0x18f4('0x7c')][_0x18f4('0x65')]));}_0x239db4=_0x31c1ac[_0x18f4('0x7d')]();_0x31c1ac[_0x18f4('0x20')](_0x4fc7a9);_0x31c1ac[_0x18f4('0x1e')](0x0);return;}})[_0x18f4('0x26')](function(){if(_0x19a537[_0x18f4('0x8d')]===_0x18f4('0x8e')){return null;}var _0x1d0e8f=_['merge'](_0x19a537,{'name':_0x19a537[_0x18f4('0x8f')]||_0x19a537[_0x18f4('0x2d')]||_0x58535d[_0x18f4('0x2d')],'basename':_0x5df7e9,'savename':util[_0x18f4('0x70')](_0x18f4('0x90'),_0x19a537[_0x18f4('0x2d')]||_0x58535d[_0x18f4('0x2d')],require('randomstring')[_0x18f4('0x91')](0x4),_0x19a537[_0x18f4('0x8d')]||_0x18f4('0x92')),'reportId':_0x58535d['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x18f4('0x48')](_0x1d0e8f,{'raw':!![]});})['then'](function(_0x4800d9){if(_0x58535d[_0x18f4('0x6b')]===_0x18f4('0x93')){_0x239db4[_0x18f4('0x3e')](_0x58535d[_0x18f4('0x6b')]+_0x18f4('0x94'),_0x19a537['startDate'],_0x19a537[_0x18f4('0x95')]);}else{_0x239db4[_0x18f4('0x3e')](_0x58535d[_0x18f4('0x6b')]+_0x18f4('0x96'),_0x19a537['startDate'],_0x19a537[_0x18f4('0x95')]);}if(_0x4800d9){logger[_0x18f4('0x97')](_0x18f4('0x98'),_0x239db4[_0x18f4('0x81')]());require(_0x18f4('0x99'))[_0x18f4('0x9a')](path[_0x18f4('0x55')](__dirname,'../../components/export/',_0x4800d9[_0x18f4('0x8d')]),[_0x4800d9['id'],_0x239db4['toString'](),path[_0x18f4('0x55')](__dirname,_0x18f4('0x9b'),_0x4800d9[_0x18f4('0x9c')]),_0x5df7e9]);return _0x4800d9;}else{var _0x3c8063=squel[_0x18f4('0x8b')]();_0x3c8063['from']('('+_0x239db4[_0x18f4('0x81')]()+')','countTable');_0x3c8063[_0x18f4('0x6e')]('COUNT(*)',_0x18f4('0x21'));_0x239db4[_0x18f4('0x20')](_0x19a537[_0x18f4('0x20')]||_0x4fc7a9);_0x239db4[_0x18f4('0x1e')](_0x19a537['offset']||0x0);return dbH['sequelize'][_0x18f4('0x35')](_0x3c8063[_0x18f4('0x81')](),{'type':dbH[_0x18f4('0x80')]['QueryTypes'][_0x18f4('0x9d')]})[_0x18f4('0x26')](function(_0x3016b3){if(!_0x3016b3[_0x18f4('0x47')]){_0x73d35d=0x0;}else{_0x73d35d=_0x3016b3[0x0][_0x18f4('0x21')]||0x0;}return dbH[_0x18f4('0x80')]['query'](_0x239db4['toString'](),{'type':dbH[_0x18f4('0x80')][_0x18f4('0x82')][_0x18f4('0x9d')]});})[_0x18f4('0x26')](function(_0x422e9f){return{'rows':_0x422e9f||[],'count':_0x73d35d};});}});}exports[_0x18f4('0x9e')]=function(_0x5717cf,_0x442955){return runReport(_0x5717cf[_0x18f4('0x53')],_0x5717cf[_0x18f4('0x35')],_0x5717cf[_0x18f4('0x42')])[_0x18f4('0x26')](respondWithResult(_0x442955,null))[_0x18f4('0x45')](handleError(_0x442955,null));};exports[_0x18f4('0x9f')]=runReport;exports[_0x18f4('0x35')]=function(_0x7e37b1,_0x41294b){var _0x9ab6d7=0xa;var _0x486a6f=[_0x18f4('0x55'),_0x18f4('0x56'),_0x18f4('0x57'),_0x18f4('0xa0')];var _0x30cb6d={'SUM':_0x18f4('0x83'),'COUNT':_0x18f4('0x58'),'COUNT DISTINCT':_0x18f4('0xa1'),'MAX':_0x18f4('0xa2'),'MIN':_0x18f4('0x84'),'AVG':_0x18f4('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x18f4('0x5b'),'GROUP_CONCAT DESC':_0x18f4('0x5c')};var _0x459070={'SEC_TO_TIME':_0x18f4('0x85'),'DATE':'DATE(%s)','HOUR':_0x18f4('0x87'),'ROUND':_0x18f4('0x5d'),'UNIX_TIMESTAMP':_0x18f4('0x5e')};var _0x520ac8=function(_0x343a92){return!_[_0x18f4('0x78')](['IS\x20NULL',_0x18f4('0x60'),_0x18f4('0x61'),_0x18f4('0x62')],_0x343a92);};var _0xa158b5=function(_0x55a239){if(!_0x55a239||!_0x55a239[_0x18f4('0x64')]['length']){return'';}for(var _0x116e1f='(',_0x6ad36a=0x0;_0x6ad36a<_0x55a239[_0x18f4('0x64')][_0x18f4('0x47')];_0x6ad36a+=0x1){_0x6ad36a>0x0&&(_0x116e1f+='\x20'+_0x55a239[_0x18f4('0x63')]+'\x20');_0x116e1f+=_0x55a239[_0x18f4('0x64')][_0x6ad36a]['group']?_0xa158b5(_0x55a239[_0x18f4('0x64')][_0x6ad36a]['group']):_0x55a239[_0x18f4('0x64')][_0x6ad36a][_0x18f4('0x6e')]+'\x20'+_0x55a239[_0x18f4('0x64')][_0x6ad36a][_0x18f4('0x66')]+(_0x520ac8(_0x55a239[_0x18f4('0x64')][_0x6ad36a][_0x18f4('0x66')])?'\x20'+_0x55a239[_0x18f4('0x64')][_0x6ad36a][_0x18f4('0x88')]:'');}return _0x116e1f+')';};var _0x3d0bc7={'where':{'id':_0x7e37b1[_0x18f4('0x53')]['id']}},_0x24644d,_0x1379d4,_0x13b4aa,_0x50330a,_0x370e2f;_0x3d0bc7=_[_0x18f4('0x41')]({},_0x3d0bc7,_0x7e37b1[_0x18f4('0x42')]);return db[_0x18f4('0x31')][_0x18f4('0x4f')](_0x3d0bc7)[_0x18f4('0x26')](function(_0x13bb7e){if(_0x13bb7e){_0x24644d=_0x13bb7e;return _0x13bb7e['getFields']();}return null;})[_0x18f4('0x26')](function(_0x5e02d7){if(_0x5e02d7){if(!_0x5e02d7[_0x18f4('0x47')]){throw new db[(_0x18f4('0xa3'))]['ValidationErrorItem'](_0x18f4('0x68'),0x193);}_0x1379d4=_0x5e02d7;return db[_0x18f4('0x69')][_0x18f4('0x6a')]({'raw':!![]});}return null;})[_0x18f4('0x26')](function(_0x5aaf6f){if(_0x5aaf6f){_0x13b4aa=_[_0x18f4('0x8a')](_0x5aaf6f,'id');var _0x144d3d;var _0x2958ce=squel[_0x18f4('0x8b')]();_0x2958ce['from'](_0x24644d['table']);for(var _0x1db7f2=0x0;_0x1db7f2<_0x1379d4['length'];_0x1db7f2+=0x1){_0x144d3d=_0x1379d4[_0x1db7f2][_0x18f4('0x6c')]?_0x13b4aa[_0x1379d4[_0x1db7f2]['MetricId']][_0x18f4('0x6d')]:_0x1379d4[_0x1db7f2][_0x18f4('0x6e')];_0x144d3d=_0x1379d4[_0x1db7f2][_0x18f4('0x6f')]?_[_0x18f4('0x71')](_0x30cb6d[_0x1379d4[_0x1db7f2]['function']],'%s',_0x144d3d):_0x144d3d;_0x144d3d=_0x1379d4[_0x1db7f2]['format']?_['replace'](_0x459070[_0x1379d4[_0x1db7f2]['format']],'%s',_0x144d3d):_0x144d3d;if(_0x1379d4[_0x1db7f2][_0x18f4('0x72')]){_0x2958ce[_0x18f4('0x65')](_0x144d3d);}_0x1379d4[_0x1db7f2]['orderBy']&&_0x2958ce[_0x18f4('0x3c')](_0x144d3d,_0x1379d4[_0x1db7f2][_0x18f4('0x73')]===_0x18f4('0x74')?![]:!![]);_0x2958ce[_0x18f4('0x6e')](_0x144d3d,_0x1379d4[_0x1db7f2][_0x18f4('0x75')]||_0x144d3d);}if(_0x24644d[_0x18f4('0x77')]){_0x24644d[_0x18f4('0x77')]=JSON[_0x18f4('0x76')](_0x24644d[_0x18f4('0x77')]);for(var _0x334dbf=0x0;_0x334dbf<_0x24644d[_0x18f4('0x77')][_0x18f4('0x47')];_0x334dbf+=0x1){if(_0x24644d[_0x18f4('0x77')][_0x334dbf][_0x18f4('0x33')]&&_['includes'](_0x486a6f,_0x24644d['joins'][_0x334dbf]['type'])&&_0x24644d[_0x18f4('0x77')][_0x334dbf]['parentKey']&&_0x24644d[_0x18f4('0x77')][_0x334dbf][_0x18f4('0x79')]&&_0x24644d[_0x18f4('0x77')][_0x334dbf][_0x18f4('0x8c')]){_0x2958ce[_0x24644d[_0x18f4('0x77')][_0x334dbf][_0x18f4('0x33')]](_0x24644d[_0x18f4('0x77')][_0x334dbf][_0x18f4('0x79')],null,util[_0x18f4('0x70')](_0x18f4('0x7a'),_0x24644d[_0x18f4('0x6b')],_0x24644d[_0x18f4('0x77')][_0x334dbf][_0x18f4('0x7b')],_0x24644d[_0x18f4('0x77')][_0x334dbf][_0x18f4('0x79')],_0x24644d[_0x18f4('0x77')][_0x334dbf][_0x18f4('0x8c')]));}}}if(_0x24644d['conditions']){_0x24644d[_0x18f4('0x7c')]=JSON['parse'](_0x24644d[_0x18f4('0x7c')]);_0x2958ce[_0x18f4('0x3e')](_0xa158b5(_0x24644d[_0x18f4('0x7c')][_0x18f4('0x65')]));}_0x370e2f=_0x2958ce[_0x18f4('0x7d')]();_0x2958ce['limit'](_0x9ab6d7);_0x2958ce[_0x18f4('0x1e')](0x0);logger[_0x18f4('0x7e')]('Limited\x20Query:',_0x2958ce['toString']());return dbH[_0x18f4('0x80')]['query'](_0x2958ce['toString'](),{'type':dbH[_0x18f4('0x80')][_0x18f4('0x82')][_0x18f4('0x9d')]});}})[_0x18f4('0x26')](function(){return{'sql':_0x370e2f[_0x18f4('0x81')]()};})[_0x18f4('0x26')](respondWithResult(_0x41294b,null))[_0x18f4('0x45')](handleError(_0x41294b,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index e7abd33..557eaea 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 _0x3bf4=['rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0xd81b5b,_0x15f6a7){var _0x52ffd9=function(_0x5571ea){while(--_0x5571ea){_0xd81b5b['push'](_0xd81b5b['shift']());}};_0x52ffd9(++_0x15f6a7);}(_0x3bf4,0xd6));var _0x43bf=function(_0x164331,_0x14b8ec){_0x164331=_0x164331-0x0;var _0x2d6c1f=_0x3bf4[_0x164331];return _0x2d6c1f;};'use strict';var _=require(_0x43bf('0x0'));var util=require(_0x43bf('0x1'));var logger=require(_0x43bf('0x2'))(_0x43bf('0x3'));var moment=require(_0x43bf('0x4'));var BPromise=require('bluebird');var rp=require(_0x43bf('0x5'));var fs=require('fs');var path=require(_0x43bf('0x6'));var rimraf=require(_0x43bf('0x7'));var config=require(_0x43bf('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x43bf('0x9')]=function(_0x51c582,_0x4c9852){return _0x51c582[_0x43bf('0xa')](_0x43bf('0xb'),attributes,{'tableName':_0x43bf('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7042=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api'];(function(_0x3e6695,_0x521f24){var _0x4001e2=function(_0x2fab96){while(--_0x2fab96){_0x3e6695['push'](_0x3e6695['shift']());}};_0x4001e2(++_0x521f24);}(_0x7042,0xdd));var _0x2704=function(_0x51f36c,_0x15345d){_0x51f36c=_0x51f36c-0x0;var _0x399cc5=_0x7042[_0x51f36c];return _0x399cc5;};'use strict';var _=require(_0x2704('0x0'));var util=require(_0x2704('0x1'));var logger=require(_0x2704('0x2'))(_0x2704('0x3'));var moment=require(_0x2704('0x4'));var BPromise=require(_0x2704('0x5'));var rp=require(_0x2704('0x6'));var fs=require('fs');var path=require(_0x2704('0x7'));var rimraf=require(_0x2704('0x8'));var config=require(_0x2704('0x9'));var attributes=require(_0x2704('0xa'));module[_0x2704('0xb')]=function(_0x2713a9,_0x26c951){return _0x2713a9[_0x2704('0xc')](_0x2704('0xd'),attributes,{'tableName':_0x2704('0xe'),'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 53502c5..9eeb037 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 _0x9558=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x4d1e0f,_0x1509bc){var _0x5a72f9=function(_0x5486c6){while(--_0x5486c6){_0x4d1e0f['push'](_0x4d1e0f['shift']());}};_0x5a72f9(++_0x1509bc);}(_0x9558,0x134));var _0x8955=function(_0x48cb7d,_0x3135a1){_0x48cb7d=_0x48cb7d-0x0;var _0x417b09=_0x9558[_0x48cb7d];return _0x417b09;};'use strict';var _=require(_0x8955('0x0'));var util=require(_0x8955('0x1'));var moment=require(_0x8955('0x2'));var BPromise=require(_0x8955('0x3'));var rs=require(_0x8955('0x4'));var fs=require('fs');var Redis=require(_0x8955('0x5'));var db=require(_0x8955('0x6'))['db'];var utils=require(_0x8955('0x7'));var logger=require(_0x8955('0x8'))(_0x8955('0x9'));var config=require(_0x8955('0xa'));var jayson=require(_0x8955('0xb'));var client=jayson[_0x8955('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fd501,_0x1ec03f,_0x5ae3d0){return new BPromise(function(_0x5420c5,_0x455baf){return client[_0x8955('0xd')](_0x1fd501,_0x5ae3d0)[_0x8955('0xe')](function(_0x23b9b7){logger[_0x8955('0xf')](_0x8955('0x10'),_0x1ec03f,'request\x20sent');logger[_0x8955('0x11')](_0x8955('0x12'),_0x1ec03f,_0x8955('0x13'),JSON['stringify'](_0x23b9b7));if(_0x23b9b7[_0x8955('0x14')]){if(_0x23b9b7[_0x8955('0x14')][_0x8955('0x15')]===0x1f4){logger[_0x8955('0x14')](_0x8955('0x10'),_0x1ec03f,_0x23b9b7[_0x8955('0x14')][_0x8955('0x16')]);return _0x455baf(_0x23b9b7[_0x8955('0x14')]['message']);}logger[_0x8955('0x14')](_0x8955('0x10'),_0x1ec03f,_0x23b9b7[_0x8955('0x14')][_0x8955('0x16')]);return _0x5420c5(_0x23b9b7['error'][_0x8955('0x16')]);}else{logger[_0x8955('0xf')](_0x8955('0x10'),_0x1ec03f,'request\x20sent');_0x5420c5(_0x23b9b7[_0x8955('0x17')][_0x8955('0x16')]);}})[_0x8955('0x18')](function(_0x2c0d81){logger[_0x8955('0x14')](_0x8955('0x10'),_0x1ec03f,_0x2c0d81);_0x455baf(_0x2c0d81);});});}
\ No newline at end of file
+var _0x385a=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash'];(function(_0x1eb92d,_0x343504){var _0xe27986=function(_0xbe8840){while(--_0xbe8840){_0x1eb92d['push'](_0x1eb92d['shift']());}};_0xe27986(++_0x343504);}(_0x385a,0x125));var _0xa385=function(_0x85cf53,_0x171d35){_0x85cf53=_0x85cf53-0x0;var _0x4d203c=_0x385a[_0x85cf53];return _0x4d203c;};'use strict';var _=require(_0xa385('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa385('0x1'));var fs=require('fs');var Redis=require(_0xa385('0x2'));var db=require(_0xa385('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa385('0x4'));var config=require(_0xa385('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa385('0x6')][_0xa385('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xbcf9c2,_0x5b68dc,_0x37c6ed){return new BPromise(function(_0x33e02e,_0x3c965b){return client[_0xa385('0x8')](_0xbcf9c2,_0x37c6ed)[_0xa385('0x9')](function(_0x59078b){logger[_0xa385('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5b68dc,_0xa385('0xb'));logger[_0xa385('0xc')](_0xa385('0xd'),_0x5b68dc,'request\x20sent',JSON[_0xa385('0xe')](_0x59078b));if(_0x59078b[_0xa385('0xf')]){if(_0x59078b['error'][_0xa385('0x10')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x5b68dc,_0x59078b['error'][_0xa385('0x11')]);return _0x3c965b(_0x59078b[_0xa385('0xf')][_0xa385('0x11')]);}logger[_0xa385('0xf')](_0xa385('0x12'),_0x5b68dc,_0x59078b[_0xa385('0xf')][_0xa385('0x11')]);return _0x33e02e(_0x59078b['error'][_0xa385('0x11')]);}else{logger[_0xa385('0xa')](_0xa385('0x12'),_0x5b68dc,_0xa385('0xb'));_0x33e02e(_0x59078b[_0xa385('0x13')][_0xa385('0x11')]);}})[_0xa385('0x14')](function(_0x391072){logger['error'](_0xa385('0x12'),_0x5b68dc,_0x391072);_0x3c965b(_0x391072);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 8e36bc8..80348e4 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 _0x7aa6=['query','post','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run'];(function(_0x1c2560,_0x1d9304){var _0x2be4de=function(_0x3d6984){while(--_0x3d6984){_0x1c2560['push'](_0x1c2560['shift']());}};_0x2be4de(++_0x1d9304);}(_0x7aa6,0xcc));var _0x67aa=function(_0x10df58,_0x1ae2a4){_0x10df58=_0x10df58-0x0;var _0x4321ec=_0x7aa6[_0x10df58];return _0x4321ec;};'use strict';var multer=require('multer');var util=require(_0x67aa('0x0'));var path=require(_0x67aa('0x1'));var timeout=require(_0x67aa('0x2'));var express=require(_0x67aa('0x3'));var router=express[_0x67aa('0x4')]();var fs_extra=require(_0x67aa('0x5'));var auth=require(_0x67aa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x67aa('0x7'));var controller=require(_0x67aa('0x8'));router[_0x67aa('0x9')]('/',auth[_0x67aa('0xa')](),controller[_0x67aa('0xb')]);router['get'](_0x67aa('0xc'),auth[_0x67aa('0xa')](),controller['show']);router['get'](_0x67aa('0xd'),auth[_0x67aa('0xa')](),controller[_0x67aa('0xe')]);router[_0x67aa('0x9')](_0x67aa('0xf'),auth[_0x67aa('0xa')](),controller['run']);router[_0x67aa('0x9')]('/:id/query',auth[_0x67aa('0xa')](),controller[_0x67aa('0x10')]);router[_0x67aa('0x11')]('/',auth[_0x67aa('0xa')](),controller[_0x67aa('0x12')]);router[_0x67aa('0x13')](_0x67aa('0xc'),auth[_0x67aa('0xa')](),controller['update']);router[_0x67aa('0x14')]('/:id',auth[_0x67aa('0xa')](),controller[_0x67aa('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x4e39=['preview','/:id/run','run','/:id/query','query','post','create','put','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','/:id','isAuthenticated','show','/:id/preview'];(function(_0x33e366,_0x31f8f0){var _0xdab0c7=function(_0x58978c){while(--_0x58978c){_0x33e366['push'](_0x33e366['shift']());}};_0xdab0c7(++_0x31f8f0);}(_0x4e39,0xc3));var _0x94e3=function(_0x327cbf,_0x114362){_0x327cbf=_0x327cbf-0x0;var _0x409cb8=_0x4e39[_0x327cbf];return _0x409cb8;};'use strict';var multer=require('multer');var util=require(_0x94e3('0x0'));var path=require(_0x94e3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x94e3('0x2'));var auth=require(_0x94e3('0x3'));var interaction=require(_0x94e3('0x4'));var config=require(_0x94e3('0x5'));var controller=require(_0x94e3('0x6'));router[_0x94e3('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x94e3('0x7')](_0x94e3('0x8'),auth[_0x94e3('0x9')](),controller[_0x94e3('0xa')]);router[_0x94e3('0x7')](_0x94e3('0xb'),auth[_0x94e3('0x9')](),controller[_0x94e3('0xc')]);router[_0x94e3('0x7')](_0x94e3('0xd'),auth[_0x94e3('0x9')](),controller[_0x94e3('0xe')]);router['get'](_0x94e3('0xf'),auth[_0x94e3('0x9')](),controller[_0x94e3('0x10')]);router[_0x94e3('0x11')]('/',auth[_0x94e3('0x9')](),controller[_0x94e3('0x12')]);router[_0x94e3('0x13')](_0x94e3('0x8'),auth[_0x94e3('0x9')](),controller['update']);router[_0x94e3('0x14')](_0x94e3('0x8'),auth[_0x94e3('0x9')](),controller[_0x94e3('0x15')]);module[_0x94e3('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 4de01b4..87bfbf3 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 _0x2675=['sequelize','STRING','TEXT'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x2675,0x75));var _0x5267=function(_0x414bee,_0x1b19a4){_0x414bee=_0x414bee-0x0;var _0x3ab4df=_0x2675[_0x414bee];return _0x3ab4df;};'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 _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x86337d,_0x2b57c3){var _0x22b2c6=function(_0x180d16){while(--_0x180d16){_0x86337d['push'](_0x86337d['shift']());}};_0x22b2c6(++_0x2b57c3);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xfdbd[_0x2cf2e9];return _0xd3670d;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 016f5ba..51ae90d 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 _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x250853,_0x44ae5c){var _0x23732f=function(_0x3b5dca){while(--_0x3b5dca){_0x250853['push'](_0x250853['shift']());}};_0x23732f(++_0x44ae5c);}(_0x31f0,0xb7));var _0x031f=function(_0x5d6f4c,_0x1326b4){_0x5d6f4c=_0x5d6f4c-0x0;var _0x5961ab=_0x31f0[_0x5d6f4c];return _0x5961ab;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));};
\ No newline at end of file
+var _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x2bf352,_0x1b9c6e){var _0x521911=function(_0x41d5e6){while(--_0x41d5e6){_0x2bf352['push'](_0x2bf352['shift']());}};_0x521911(++_0x1b9c6e);}(_0x4975,0x86));var _0x5497=function(_0xdd7605,_0x538718){_0xdd7605=_0xdd7605-0x0;var _0x467e5f=_0x4975[_0xdd7605];return _0x467e5f;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index cb46fb6..3f54def 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 _0x7eab=['request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','api','bluebird'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7eab,0x13f));var _0xb7ea=function(_0x33c315,_0x1fb576){_0x33c315=_0x33c315-0x0;var _0x3bdbc6=_0x7eab[_0x33c315];return _0x3bdbc6;};'use strict';var _=require(_0xb7ea('0x0'));var util=require(_0xb7ea('0x1'));var logger=require(_0xb7ea('0x2'))(_0xb7ea('0x3'));var moment=require('moment');var BPromise=require(_0xb7ea('0x4'));var rp=require(_0xb7ea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb7ea('0x6'));var config=require(_0xb7ea('0x7'));var attributes=require(_0xb7ea('0x8'));module[_0xb7ea('0x9')]=function(_0x1d902a,_0x51fd85){return _0x1d902a[_0xb7ea('0xa')](_0xb7ea('0xb'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf37a=['../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x2e6d03,_0x2c13e1){var _0x488dc2=function(_0x13f0cc){while(--_0x13f0cc){_0x2e6d03['push'](_0x2e6d03['shift']());}};_0x488dc2(++_0x2c13e1);}(_0xf37a,0x1f4));var _0xaf37=function(_0x2bc58d,_0x4e98c4){_0x2bc58d=_0x2bc58d-0x0;var _0x5d187a=_0xf37a[_0x2bc58d];return _0x5d187a;};'use strict';var _=require(_0xaf37('0x0'));var util=require(_0xaf37('0x1'));var logger=require('../../config/logger')(_0xaf37('0x2'));var moment=require(_0xaf37('0x3'));var BPromise=require(_0xaf37('0x4'));var rp=require(_0xaf37('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf37('0x6'));var config=require(_0xaf37('0x7'));var attributes=require(_0xaf37('0x8'));module[_0xaf37('0x9')]=function(_0x32d8ed,_0xb08fd0){return _0x32d8ed[_0xaf37('0xa')](_0xaf37('0xb'),attributes,{'tableName':_0xaf37('0xc'),'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 ad0faa2..bd0ae49 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 _0xce51=['then','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xce51,0x172));var _0x1ce5=function(_0x5dc03e,_0x54e60c){_0x5dc03e=_0x5dc03e-0x0;var _0x466a07=_0xce51[_0x5dc03e];return _0x466a07;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1ce5('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ce5('0x1'));var db=require(_0x1ce5('0x2'))['db'];var utils=require(_0x1ce5('0x3'));var logger=require(_0x1ce5('0x4'))(_0x1ce5('0x5'));var config=require(_0x1ce5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1ce5('0x7')][_0x1ce5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x538e65,_0x12375b,_0x914eaa){return new BPromise(function(_0x49e44a,_0xc9f8d7){return client[_0x1ce5('0x9')](_0x538e65,_0x914eaa)[_0x1ce5('0xa')](function(_0x50d8b2){logger['info'](_0x1ce5('0xb'),_0x12375b,'request\x20sent');logger[_0x1ce5('0xc')](_0x1ce5('0xd'),_0x12375b,'request\x20sent',JSON[_0x1ce5('0xe')](_0x50d8b2));if(_0x50d8b2[_0x1ce5('0xf')]){if(_0x50d8b2[_0x1ce5('0xf')][_0x1ce5('0x10')]===0x1f4){logger[_0x1ce5('0xf')](_0x1ce5('0xb'),_0x12375b,_0x50d8b2['error']['message']);return _0xc9f8d7(_0x50d8b2[_0x1ce5('0xf')][_0x1ce5('0x11')]);}logger[_0x1ce5('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x12375b,_0x50d8b2[_0x1ce5('0xf')][_0x1ce5('0x11')]);return _0x49e44a(_0x50d8b2[_0x1ce5('0xf')]['message']);}else{logger[_0x1ce5('0x12')](_0x1ce5('0xb'),_0x12375b,_0x1ce5('0x13'));_0x49e44a(_0x50d8b2['result'][_0x1ce5('0x11')]);}})['catch'](function(_0x34d2c4){logger[_0x1ce5('0xf')](_0x1ce5('0xb'),_0x12375b,_0x34d2c4);_0xc9f8d7(_0x34d2c4);});});}
\ No newline at end of file
+var _0xaa68=['message','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xaa68,0x94));var _0x8aa6=function(_0x1e8bff,_0x5553bd){_0x1e8bff=_0x1e8bff-0x0;var _0x442d64=_0xaa68[_0x1e8bff];return _0x442d64;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8aa6('0x0'));var BPromise=require(_0x8aa6('0x1'));var rs=require(_0x8aa6('0x2'));var fs=require('fs');var Redis=require(_0x8aa6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8aa6('0x4'));var logger=require(_0x8aa6('0x5'))(_0x8aa6('0x6'));var config=require(_0x8aa6('0x7'));var jayson=require(_0x8aa6('0x8'));var client=jayson['client'][_0x8aa6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6ebb4f,_0x2c27aa,_0x5858c9){return new BPromise(function(_0x231f98,_0x365a0d){return client[_0x8aa6('0xa')](_0x6ebb4f,_0x5858c9)[_0x8aa6('0xb')](function(_0xe3f122){logger[_0x8aa6('0xc')](_0x8aa6('0xd'),_0x2c27aa,_0x8aa6('0xe'));logger[_0x8aa6('0xf')](_0x8aa6('0x10'),_0x2c27aa,_0x8aa6('0xe'),JSON[_0x8aa6('0x11')](_0xe3f122));if(_0xe3f122[_0x8aa6('0x12')]){if(_0xe3f122['error'][_0x8aa6('0x13')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2c27aa,_0xe3f122[_0x8aa6('0x12')]['message']);return _0x365a0d(_0xe3f122[_0x8aa6('0x12')][_0x8aa6('0x14')]);}logger[_0x8aa6('0x12')](_0x8aa6('0xd'),_0x2c27aa,_0xe3f122[_0x8aa6('0x12')][_0x8aa6('0x14')]);return _0x231f98(_0xe3f122['error'][_0x8aa6('0x14')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2c27aa,_0x8aa6('0xe'));_0x231f98(_0xe3f122['result'][_0x8aa6('0x14')]);}})['catch'](function(_0x46e9dd){logger[_0x8aa6('0x12')](_0x8aa6('0xd'),_0x2c27aa,_0x46e9dd);_0x365a0d(_0x46e9dd);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 1c7344d..b58cf5c 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 _0x91c5=['get','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','index'];(function(_0x267900,_0x117fa7){var _0x2f95df=function(_0xac178c){while(--_0xac178c){_0x267900['push'](_0x267900['shift']());}};_0x2f95df(++_0x117fa7);}(_0x91c5,0x1c1));var _0x591c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x91c5[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x591c('0x0'));var express=require(_0x591c('0x1'));var router=express[_0x591c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x591c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x591c('0x4'));var controller=require(_0x591c('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x591c('0x6')]);router[_0x591c('0x7')]('/:id',auth[_0x591c('0x8')](),controller[_0x591c('0x9')]);router[_0x591c('0x7')](_0x591c('0xa'),auth[_0x591c('0x8')](),controller[_0x591c('0xb')]);router[_0x591c('0x7')](_0x591c('0xc'),auth['isAuthenticated'](),controller[_0x591c('0xd')]);router[_0x591c('0x7')](_0x591c('0xe'),auth['isAuthenticated'](),controller[_0x591c('0xf')]);router[_0x591c('0x10')]('/',auth[_0x591c('0x8')](),controller[_0x591c('0x11')]);router[_0x591c('0x12')](_0x591c('0x13'),auth['isAuthenticated'](),controller[_0x591c('0x14')]);router[_0x591c('0x15')](_0x591c('0x13'),auth[_0x591c('0x8')](),controller[_0x591c('0x16')]);module[_0x591c('0x17')]=router;
\ No newline at end of file
+var _0x1335=['./analyticDefaultReport.controller','get','/:id','isAuthenticated','show','preview','run','/:id/query','query','create','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5a4e35,_0x2028e3){var _0x474a4c=function(_0x30e6a0){while(--_0x30e6a0){_0x5a4e35['push'](_0x5a4e35['shift']());}};_0x474a4c(++_0x2028e3);}(_0x1335,0x1f3));var _0x5133=function(_0xfffffa,_0x8b5d7a){_0xfffffa=_0xfffffa-0x0;var _0x3715e8=_0x1335[_0xfffffa];return _0x3715e8;};'use strict';var multer=require('multer');var util=require(_0x5133('0x0'));var path=require(_0x5133('0x1'));var timeout=require('connect-timeout');var express=require(_0x5133('0x2'));var router=express[_0x5133('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5133('0x4'));var interaction=require(_0x5133('0x5'));var config=require(_0x5133('0x6'));var controller=require(_0x5133('0x7'));router[_0x5133('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5133('0x8')](_0x5133('0x9'),auth[_0x5133('0xa')](),controller[_0x5133('0xb')]);router[_0x5133('0x8')]('/:id/preview',auth[_0x5133('0xa')](),controller[_0x5133('0xc')]);router['get']('/:id/run',auth[_0x5133('0xa')](),controller[_0x5133('0xd')]);router[_0x5133('0x8')](_0x5133('0xe'),auth[_0x5133('0xa')](),controller[_0x5133('0xf')]);router['post']('/',auth[_0x5133('0xa')](),controller[_0x5133('0x10')]);router[_0x5133('0x11')](_0x5133('0x9'),auth[_0x5133('0xa')](),controller[_0x5133('0x12')]);router[_0x5133('0x13')]('/:id',auth[_0x5133('0xa')](),controller[_0x5133('0x14')]);module[_0x5133('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 66d5209..713529c 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 _0xe8eb=['pdf','xlsx','DATE','ENUM','manual','scheduled','UNSIGNED','sequelize','moment','exports','STRING','csv'];(function(_0x374521,_0x4703fb){var _0x2120b9=function(_0x3f57b0){while(--_0x3f57b0){_0x374521['push'](_0x374521['shift']());}};_0x2120b9(++_0x4703fb);}(_0xe8eb,0x8b));var _0xbe8e=function(_0x5e9491,_0x129e18){_0x5e9491=_0x5e9491-0x0;var _0x2f6d97=_0xe8eb[_0x5e9491];return _0x2f6d97;};'use strict';var Sequelize=require(_0xbe8e('0x0'));var moment=require(_0xbe8e('0x1'));module[_0xbe8e('0x2')]={'name':{'type':Sequelize[_0xbe8e('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xbe8e('0x4'),_0xbe8e('0x5'),_0xbe8e('0x6')),'allowNull':![],'defaultValue':_0xbe8e('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xbe8e('0x7')]},'status':{'type':Sequelize[_0xbe8e('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xbe8e('0x8')](_0xbe8e('0x9'),_0xbe8e('0xa')),'allowNull':![],'defaultValue':_0xbe8e('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xbe8e('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x836b=['sequelize','moment','STRING','ENUM','csv','pdf','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x836b,0x138));var _0xb836=function(_0x5d96f6,_0x44aeac){_0x5d96f6=_0x5d96f6-0x0;var _0x247d14=_0x836b[_0x5d96f6];return _0x247d14;};'use strict';var Sequelize=require(_0xb836('0x0'));var moment=require(_0xb836('0x1'));module['exports']={'name':{'type':Sequelize[_0xb836('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xb836('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xb836('0x3')](_0xb836('0x4'),_0xb836('0x5'),_0xb836('0x6')),'allowNull':![],'defaultValue':_0xb836('0x4')},'savename':{'type':Sequelize[_0xb836('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xb836('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xb836('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0xb836('0x8'),_0xb836('0x9')),'allowNull':![],'defaultValue':_0xb836('0x8')},'reportId':{'type':Sequelize[_0xb836('0xa')](0xb)[_0xb836('0xb')]},'reportType':{'type':Sequelize[_0xb836('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 7fa4d2b..31e6b4a 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 _0x36d5=['find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','basename','output','existsSync','root','server/files/reports','savename','Sequelize','ValidationError','download','join','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','count','offset','limit','set','reject','save','then','destroy','get','ExtractedReports','error','stack','name','send','index','map','AnalyticExtractedReport','type','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x36d5,0x187));var _0x536d=function(_0x297dcf,_0x448cf5){_0x297dcf=_0x297dcf-0x0;var _0xe1699b=_0x36d5[_0x297dcf];return _0xe1699b;};'use strict';var emlformat=require(_0x536d('0x0'));var rimraf=require(_0x536d('0x1'));var zipdir=require(_0x536d('0x2'));var jsonpatch=require(_0x536d('0x3'));var rp=require('request-promise');var moment=require(_0x536d('0x4'));var BPromise=require(_0x536d('0x5'));var Mustache=require(_0x536d('0x6'));var util=require(_0x536d('0x7'));var path=require(_0x536d('0x8'));var sox=require(_0x536d('0x9'));var csv=require(_0x536d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x536d('0xb'));var _=require(_0x536d('0xc'));var squel=require(_0x536d('0xd'));var crypto=require(_0x536d('0xe'));var jsforce=require(_0x536d('0xf'));var deskjs=require(_0x536d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x536d('0x11'));var Papa=require('papaparse');var Redis=require(_0x536d('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x536d('0x13'));var hardwareService=require(_0x536d('0x14'));var logger=require(_0x536d('0x15'))(_0x536d('0x16'));var utils=require(_0x536d('0x17'));var config=require(_0x536d('0x18'));var licenseUtil=require(_0x536d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x252b8f,_0x50c62e){_0x50c62e=_0x50c62e||0xcc;return function(_0x3a4bef){if(_0x3a4bef){return _0x252b8f[_0x536d('0x1a')](_0x50c62e);}return _0x252b8f[_0x536d('0x1b')](_0x50c62e)['end']();};}function respondWithResult(_0x3d6b57,_0x138c60){_0x138c60=_0x138c60||0xc8;return function(_0x19df46){if(_0x19df46){return _0x3d6b57['status'](_0x138c60)[_0x536d('0x1c')](_0x19df46);}};}function respondWithFilteredResult(_0x253c8d,_0x48657d){return function(_0x5e2dad){if(_0x5e2dad){var _0x5df25c=typeof _0x48657d['offset']==='undefined'&&typeof _0x48657d['limit']==='undefined';var _0x2d8f57=_0x5e2dad[_0x536d('0x1d')];var _0xa45dde=_0x5df25c?0x0:_0x48657d[_0x536d('0x1e')];var _0x1d5620=_0x5df25c?_0x5e2dad[_0x536d('0x1d')]:_0x48657d[_0x536d('0x1e')]+_0x48657d[_0x536d('0x1f')];var _0x2302f7;if(_0x1d5620>=_0x2d8f57){_0x1d5620=_0x2d8f57;_0x2302f7=0xc8;}else{_0x2302f7=0xce;}_0x253c8d[_0x536d('0x1b')](_0x2302f7);return _0x253c8d[_0x536d('0x20')]('Content-Range',_0xa45dde+'-'+_0x1d5620+'/'+_0x2d8f57)[_0x536d('0x1c')](_0x5e2dad);}return null;};}function patchUpdates(_0x6c0317){return function(_0x1bd090){try{jsonpatch['apply'](_0x1bd090,_0x6c0317,!![]);}catch(_0x330465){return BPromise[_0x536d('0x21')](_0x330465);}return _0x1bd090[_0x536d('0x22')]();};}function saveUpdates(_0x115fab,_0x33570b){return function(_0x477a50){if(_0x477a50){return _0x477a50['update'](_0x115fab)[_0x536d('0x23')](function(_0x191490){return _0x191490;});}return null;};}function removeEntity(_0x32a859,_0x713a60){return function(_0x4a9b32){if(_0x4a9b32){return _0x4a9b32[_0x536d('0x24')]()[_0x536d('0x23')](function(){var _0x1241b0=_0x4a9b32[_0x536d('0x25')]({'plain':!![]});var _0x447d7d=_0x536d('0x26');return db['UserProfileResource'][_0x536d('0x24')]({'where':{'type':_0x447d7d,'resourceId':_0x1241b0['id']}})[_0x536d('0x23')](function(){return _0x4a9b32;});})[_0x536d('0x23')](function(){_0x32a859[_0x536d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x689dc2,_0x3ae27d){return function(_0x1ddebc){if(!_0x1ddebc){_0x689dc2['sendStatus'](0x194);}return _0x1ddebc;};}function handleError(_0x22df44,_0x139e97){_0x139e97=_0x139e97||0x1f4;return function(_0x5575ec){logger[_0x536d('0x27')](_0x5575ec[_0x536d('0x28')]);if(_0x5575ec[_0x536d('0x29')]){delete _0x5575ec[_0x536d('0x29')];}_0x22df44[_0x536d('0x1b')](_0x139e97)[_0x536d('0x2a')](_0x5575ec);};}exports[_0x536d('0x2b')]=function(_0x252079,_0x14c3b6){var _0x5877c4={},_0x1c7b1d={},_0x255bf0={'count':0x0,'rows':[]};var _0x39ad94=_[_0x536d('0x2c')](db[_0x536d('0x2d')]['rawAttributes'],function(_0x22c132){return{'name':_0x22c132['fieldName'],'type':_0x22c132[_0x536d('0x2e')]['key']};});_0x1c7b1d[_0x536d('0x2f')]=_['map'](_0x39ad94,_0x536d('0x29'));_0x1c7b1d[_0x536d('0x30')]=_[_0x536d('0x31')](_0x252079[_0x536d('0x30')]);_0x1c7b1d[_0x536d('0x32')]=_['intersection'](_0x1c7b1d['model'],_0x1c7b1d[_0x536d('0x30')]);_0x5877c4[_0x536d('0x33')]=_[_0x536d('0x34')](_0x1c7b1d[_0x536d('0x2f')],qs[_0x536d('0x35')](_0x252079[_0x536d('0x30')][_0x536d('0x35')]));_0x5877c4['attributes']=_0x5877c4[_0x536d('0x33')][_0x536d('0x36')]?_0x5877c4[_0x536d('0x33')]:_0x1c7b1d[_0x536d('0x2f')];if(!_0x252079[_0x536d('0x30')]['hasOwnProperty']('nolimit')){_0x5877c4['limit']=qs[_0x536d('0x1f')](_0x252079[_0x536d('0x30')][_0x536d('0x1f')]);_0x5877c4['offset']=qs[_0x536d('0x1e')](_0x252079['query']['offset']);}_0x5877c4[_0x536d('0x37')]=qs[_0x536d('0x38')](_0x252079[_0x536d('0x30')][_0x536d('0x38')]);_0x5877c4[_0x536d('0x39')]=qs[_0x536d('0x32')](_[_0x536d('0x3a')](_0x252079[_0x536d('0x30')],_0x1c7b1d[_0x536d('0x32')]),_0x39ad94);if(_0x252079[_0x536d('0x30')][_0x536d('0x3b')]){_0x5877c4[_0x536d('0x39')]=_[_0x536d('0x3c')](_0x5877c4[_0x536d('0x39')],{'$or':_[_0x536d('0x2c')](_0x39ad94,function(_0x1f255){if(_0x1f255[_0x536d('0x2e')]!==_0x536d('0x3d')){var _0x47e866={};_0x47e866[_0x1f255[_0x536d('0x29')]]={'$like':'%'+_0x252079[_0x536d('0x30')][_0x536d('0x3b')]+'%'};return _0x47e866;}})});}_0x5877c4=_[_0x536d('0x3c')]({},_0x5877c4,_0x252079[_0x536d('0x3e')]);var _0x1177c5={'where':_0x5877c4[_0x536d('0x39')]};return db[_0x536d('0x2d')][_0x536d('0x1d')](_0x1177c5)[_0x536d('0x23')](function(_0x529f71){_0x255bf0[_0x536d('0x1d')]=_0x529f71;if(_0x252079[_0x536d('0x30')][_0x536d('0x3f')]){_0x5877c4[_0x536d('0x40')]=[{'all':!![]}];}return db[_0x536d('0x2d')][_0x536d('0x41')](_0x5877c4);})[_0x536d('0x23')](function(_0x554ee6){_0x255bf0['rows']=_0x554ee6;return _0x255bf0;})[_0x536d('0x23')](respondWithFilteredResult(_0x14c3b6,_0x5877c4))[_0x536d('0x42')](handleError(_0x14c3b6,null));};exports[_0x536d('0x43')]=function(_0x277a78,_0x4d920b){var _0x2db727={'raw':!![],'where':{'id':_0x277a78[_0x536d('0x44')]['id']}},_0x37a47f={};_0x37a47f['model']=_[_0x536d('0x31')](db[_0x536d('0x2d')]['rawAttributes']);_0x37a47f[_0x536d('0x30')]=_[_0x536d('0x31')](_0x277a78[_0x536d('0x30')]);_0x37a47f[_0x536d('0x32')]=_[_0x536d('0x34')](_0x37a47f['model'],_0x37a47f['query']);_0x2db727[_0x536d('0x33')]=_[_0x536d('0x34')](_0x37a47f[_0x536d('0x2f')],qs[_0x536d('0x35')](_0x277a78[_0x536d('0x30')][_0x536d('0x35')]));_0x2db727[_0x536d('0x33')]=_0x2db727[_0x536d('0x33')][_0x536d('0x36')]?_0x2db727[_0x536d('0x33')]:_0x37a47f[_0x536d('0x2f')];if(_0x277a78[_0x536d('0x30')][_0x536d('0x3f')]){_0x2db727[_0x536d('0x40')]=[{'all':!![]}];}_0x2db727=_[_0x536d('0x3c')]({},_0x2db727,_0x277a78['options']);return db['AnalyticExtractedReport'][_0x536d('0x45')](_0x2db727)[_0x536d('0x23')](handleEntityNotFound(_0x4d920b,null))[_0x536d('0x23')](respondWithResult(_0x4d920b,null))[_0x536d('0x42')](handleError(_0x4d920b,null));};exports[_0x536d('0x46')]=function(_0x5579f4,_0x38535c){return db[_0x536d('0x2d')]['create'](_0x5579f4[_0x536d('0x47')],{})[_0x536d('0x23')](function(_0x54ab7d){var _0x3ee93d=_0x5579f4['user'][_0x536d('0x25')]({'plain':!![]});if(!_0x3ee93d)throw new Error(_0x536d('0x48'));if(_0x3ee93d[_0x536d('0x49')]===_0x536d('0x4a')){var _0x481961=_0x54ab7d[_0x536d('0x25')]({'plain':!![]});var _0x2567d3=_0x536d('0x26');return db['UserProfileSection'][_0x536d('0x45')]({'where':{'name':_0x2567d3,'userProfileId':_0x3ee93d[_0x536d('0x4b')]},'raw':!![]})[_0x536d('0x23')](function(_0x2daae1){if(_0x2daae1&&_0x2daae1[_0x536d('0x4c')]===0x0){return db['UserProfileResource'][_0x536d('0x46')]({'name':_0x481961[_0x536d('0x29')],'resourceId':_0x481961['id'],'type':_0x2daae1[_0x536d('0x29')],'sectionId':_0x2daae1['id']},{})[_0x536d('0x23')](function(){return _0x54ab7d;});}else{return _0x54ab7d;}})['catch'](function(_0x2dc587){logger['error'](_0x536d('0x4d'),_0x2dc587);throw _0x2dc587;});}return _0x54ab7d;})['then'](respondWithResult(_0x38535c,0xc9))[_0x536d('0x42')](handleError(_0x38535c,null));};exports[_0x536d('0x4e')]=function(_0x508abd,_0x3a476d){if(_0x508abd['body']['id']){delete _0x508abd[_0x536d('0x47')]['id'];}return db['AnalyticExtractedReport'][_0x536d('0x45')]({'where':{'id':_0x508abd[_0x536d('0x44')]['id']}})[_0x536d('0x23')](handleEntityNotFound(_0x3a476d,null))[_0x536d('0x23')](saveUpdates(_0x508abd[_0x536d('0x47')],null))['then'](respondWithResult(_0x3a476d,null))[_0x536d('0x42')](handleError(_0x3a476d,null));};exports[_0x536d('0x24')]=function(_0x404064,_0x5b2048){return db[_0x536d('0x2d')][_0x536d('0x45')]({'where':{'id':_0x404064[_0x536d('0x44')]['id']}})[_0x536d('0x23')](handleEntityNotFound(_0x5b2048,null))[_0x536d('0x23')](removeEntity(_0x5b2048,null))['catch'](handleError(_0x5b2048,null));};exports['download']=function(_0x41ad04,_0x1a33ac,_0x3a7c0d){return db[_0x536d('0x2d')][_0x536d('0x45')]({'where':{'id':_0x41ad04['params']['id']},'attributes':[_0x536d('0x29'),_0x536d('0x4f'),'savename',_0x536d('0x50')],'raw':!![]})[_0x536d('0x23')](handleEntityNotFound(_0x1a33ac,null))[_0x536d('0x23')](function(_0x446bb6){if(_0x446bb6){if(!fs[_0x536d('0x51')](path['join'](config[_0x536d('0x52')],_0x536d('0x53'),_0x446bb6[_0x536d('0x54')]))){throw new db[(_0x536d('0x55'))][(_0x536d('0x56'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x41ad04[_0x536d('0x30')]['exists']){return _0x1a33ac[_0x536d('0x1a')](0xc8);}return _0x1a33ac[_0x536d('0x57')](path[_0x536d('0x58')](config[_0x536d('0x52')],'server/files/reports',_0x446bb6[_0x536d('0x54')]),util[_0x536d('0x59')](_0x536d('0x5a'),_0x446bb6[_0x536d('0x4f')]||_0x446bb6[_0x536d('0x29')],_0x446bb6['output'][_0x536d('0x5b')]()));}})[_0x536d('0x42')](handleError(_0x1a33ac,null));};
\ No newline at end of file
+var _0x5068=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','AnalyticExtractedReport','includeAll','include','findAll','catch','show','params','keys','find','create','body','user','role','ExtractedReports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','output','existsSync','join','root','Sequelize','exists','server/files/reports','%s.%s','basename','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../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','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','UserProfileResource','error','send','index','map','rawAttributes','type','key','model','name','query','filters','intersection'];(function(_0x1c05ce,_0xbc107b){var _0x114ec3=function(_0x3a4e08){while(--_0x3a4e08){_0x1c05ce['push'](_0x1c05ce['shift']());}};_0x114ec3(++_0xbc107b);}(_0x5068,0x13d));var _0x8506=function(_0x32d900,_0x2e9d45){_0x32d900=_0x32d900-0x0;var _0x558ea0=_0x5068[_0x32d900];return _0x558ea0;};'use strict';var emlformat=require(_0x8506('0x0'));var rimraf=require(_0x8506('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8506('0x2'));var rp=require(_0x8506('0x3'));var moment=require('moment');var BPromise=require(_0x8506('0x4'));var Mustache=require(_0x8506('0x5'));var util=require(_0x8506('0x6'));var path=require(_0x8506('0x7'));var sox=require(_0x8506('0x8'));var csv=require(_0x8506('0x9'));var ejs=require(_0x8506('0xa'));var fs=require('fs');var fs_extra=require(_0x8506('0xb'));var _=require('lodash');var squel=require(_0x8506('0xc'));var crypto=require(_0x8506('0xd'));var jsforce=require(_0x8506('0xe'));var deskjs=require(_0x8506('0xf'));var toCsv=require(_0x8506('0x9'));var querystring=require(_0x8506('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8506('0x11'));var qs=require(_0x8506('0x12'));var as=require(_0x8506('0x13'));var hardwareService=require(_0x8506('0x14'));var logger=require(_0x8506('0x15'))(_0x8506('0x16'));var utils=require(_0x8506('0x17'));var config=require(_0x8506('0x18'));var licenseUtil=require(_0x8506('0x19'));var db=require(_0x8506('0x1a'))['db'];function respondWithStatusCode(_0x186953,_0x44992d){_0x44992d=_0x44992d||0xcc;return function(_0x5a7497){if(_0x5a7497){return _0x186953[_0x8506('0x1b')](_0x44992d);}return _0x186953[_0x8506('0x1c')](_0x44992d)[_0x8506('0x1d')]();};}function respondWithResult(_0x4ea26e,_0x44e6a4){_0x44e6a4=_0x44e6a4||0xc8;return function(_0x20ff88){if(_0x20ff88){return _0x4ea26e['status'](_0x44e6a4)[_0x8506('0x1e')](_0x20ff88);}};}function respondWithFilteredResult(_0x1ea9cc,_0x3ab750){return function(_0x28ef05){if(_0x28ef05){var _0x4cb39a=typeof _0x3ab750[_0x8506('0x1f')]==='undefined'&&typeof _0x3ab750[_0x8506('0x20')]===_0x8506('0x21');var _0x922eb9=_0x28ef05[_0x8506('0x22')];var _0x5c0fad=_0x4cb39a?0x0:_0x3ab750[_0x8506('0x1f')];var _0x512819=_0x4cb39a?_0x28ef05['count']:_0x3ab750[_0x8506('0x1f')]+_0x3ab750[_0x8506('0x20')];var _0x8ce8d1;if(_0x512819>=_0x922eb9){_0x512819=_0x922eb9;_0x8ce8d1=0xc8;}else{_0x8ce8d1=0xce;}_0x1ea9cc[_0x8506('0x1c')](_0x8ce8d1);return _0x1ea9cc[_0x8506('0x23')](_0x8506('0x24'),_0x5c0fad+'-'+_0x512819+'/'+_0x922eb9)[_0x8506('0x1e')](_0x28ef05);}return null;};}function patchUpdates(_0xd6f91f){return function(_0x21610f){try{jsonpatch['apply'](_0x21610f,_0xd6f91f,!![]);}catch(_0x596598){return BPromise[_0x8506('0x25')](_0x596598);}return _0x21610f[_0x8506('0x26')]();};}function saveUpdates(_0x10e43b,_0x242afa){return function(_0x57ba18){if(_0x57ba18){return _0x57ba18[_0x8506('0x27')](_0x10e43b)[_0x8506('0x28')](function(_0xf3351){return _0xf3351;});}return null;};}function removeEntity(_0x56de59,_0x67ead3){return function(_0x37e804){if(_0x37e804){return _0x37e804[_0x8506('0x29')]()[_0x8506('0x28')](function(){var _0xdee4e=_0x37e804['get']({'plain':!![]});var _0x42d1d8='ExtractedReports';return db[_0x8506('0x2a')][_0x8506('0x29')]({'where':{'type':_0x42d1d8,'resourceId':_0xdee4e['id']}})['then'](function(){return _0x37e804;});})[_0x8506('0x28')](function(){_0x56de59['status'](0xcc)[_0x8506('0x1d')]();});}};}function handleEntityNotFound(_0x5ac71e,_0xa1c612){return function(_0x1f3d13){if(!_0x1f3d13){_0x5ac71e[_0x8506('0x1b')](0x194);}return _0x1f3d13;};}function handleError(_0x2f89b5,_0x51fae0){_0x51fae0=_0x51fae0||0x1f4;return function(_0x650141){logger[_0x8506('0x2b')](_0x650141['stack']);if(_0x650141['name']){delete _0x650141['name'];}_0x2f89b5[_0x8506('0x1c')](_0x51fae0)[_0x8506('0x2c')](_0x650141);};}exports[_0x8506('0x2d')]=function(_0x7e21ca,_0x278dca){var _0x10df3e={},_0x3e71b0={},_0x4ba65f={'count':0x0,'rows':[]};var _0x1d8bc4=_[_0x8506('0x2e')](db['AnalyticExtractedReport'][_0x8506('0x2f')],function(_0xc33d01){return{'name':_0xc33d01['fieldName'],'type':_0xc33d01[_0x8506('0x30')][_0x8506('0x31')]};});_0x3e71b0[_0x8506('0x32')]=_[_0x8506('0x2e')](_0x1d8bc4,_0x8506('0x33'));_0x3e71b0[_0x8506('0x34')]=_['keys'](_0x7e21ca[_0x8506('0x34')]);_0x3e71b0[_0x8506('0x35')]=_[_0x8506('0x36')](_0x3e71b0[_0x8506('0x32')],_0x3e71b0[_0x8506('0x34')]);_0x10df3e[_0x8506('0x37')]=_[_0x8506('0x36')](_0x3e71b0[_0x8506('0x32')],qs[_0x8506('0x38')](_0x7e21ca[_0x8506('0x34')][_0x8506('0x38')]));_0x10df3e[_0x8506('0x37')]=_0x10df3e[_0x8506('0x37')][_0x8506('0x39')]?_0x10df3e[_0x8506('0x37')]:_0x3e71b0['model'];if(!_0x7e21ca[_0x8506('0x34')][_0x8506('0x3a')]('nolimit')){_0x10df3e['limit']=qs[_0x8506('0x20')](_0x7e21ca['query'][_0x8506('0x20')]);_0x10df3e[_0x8506('0x1f')]=qs[_0x8506('0x1f')](_0x7e21ca['query']['offset']);}_0x10df3e[_0x8506('0x3b')]=qs[_0x8506('0x3c')](_0x7e21ca[_0x8506('0x34')][_0x8506('0x3c')]);_0x10df3e[_0x8506('0x3d')]=qs['filters'](_[_0x8506('0x3e')](_0x7e21ca['query'],_0x3e71b0[_0x8506('0x35')]),_0x1d8bc4);if(_0x7e21ca[_0x8506('0x34')][_0x8506('0x3f')]){_0x10df3e[_0x8506('0x3d')]=_['merge'](_0x10df3e[_0x8506('0x3d')],{'$or':_[_0x8506('0x2e')](_0x1d8bc4,function(_0x165637){if(_0x165637[_0x8506('0x30')]!==_0x8506('0x40')){var _0x8e1054={};_0x8e1054[_0x165637[_0x8506('0x33')]]={'$like':'%'+_0x7e21ca[_0x8506('0x34')]['filter']+'%'};return _0x8e1054;}})});}_0x10df3e=_[_0x8506('0x41')]({},_0x10df3e,_0x7e21ca[_0x8506('0x42')]);var _0xda6182={'where':_0x10df3e[_0x8506('0x3d')]};return db[_0x8506('0x43')]['count'](_0xda6182)['then'](function(_0x3a4f2c){_0x4ba65f[_0x8506('0x22')]=_0x3a4f2c;if(_0x7e21ca[_0x8506('0x34')][_0x8506('0x44')]){_0x10df3e[_0x8506('0x45')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x8506('0x46')](_0x10df3e);})[_0x8506('0x28')](function(_0x3da5ae){_0x4ba65f['rows']=_0x3da5ae;return _0x4ba65f;})['then'](respondWithFilteredResult(_0x278dca,_0x10df3e))[_0x8506('0x47')](handleError(_0x278dca,null));};exports[_0x8506('0x48')]=function(_0x40bf02,_0xe7d196){var _0x2c6e28={'raw':!![],'where':{'id':_0x40bf02[_0x8506('0x49')]['id']}},_0x42abbd={};_0x42abbd[_0x8506('0x32')]=_[_0x8506('0x4a')](db[_0x8506('0x43')][_0x8506('0x2f')]);_0x42abbd['query']=_['keys'](_0x40bf02[_0x8506('0x34')]);_0x42abbd[_0x8506('0x35')]=_[_0x8506('0x36')](_0x42abbd[_0x8506('0x32')],_0x42abbd[_0x8506('0x34')]);_0x2c6e28[_0x8506('0x37')]=_[_0x8506('0x36')](_0x42abbd[_0x8506('0x32')],qs[_0x8506('0x38')](_0x40bf02['query']['fields']));_0x2c6e28[_0x8506('0x37')]=_0x2c6e28[_0x8506('0x37')][_0x8506('0x39')]?_0x2c6e28[_0x8506('0x37')]:_0x42abbd['model'];if(_0x40bf02[_0x8506('0x34')]['includeAll']){_0x2c6e28[_0x8506('0x45')]=[{'all':!![]}];}_0x2c6e28=_['merge']({},_0x2c6e28,_0x40bf02[_0x8506('0x42')]);return db[_0x8506('0x43')][_0x8506('0x4b')](_0x2c6e28)[_0x8506('0x28')](handleEntityNotFound(_0xe7d196,null))['then'](respondWithResult(_0xe7d196,null))[_0x8506('0x47')](handleError(_0xe7d196,null));};exports[_0x8506('0x4c')]=function(_0x11072f,_0x442ecd){return db[_0x8506('0x43')][_0x8506('0x4c')](_0x11072f[_0x8506('0x4d')],{})['then'](function(_0x223912){var _0x5385df=_0x11072f[_0x8506('0x4e')]['get']({'plain':!![]});if(!_0x5385df)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5385df[_0x8506('0x4f')]===_0x8506('0x4e')){var _0x462a53=_0x223912['get']({'plain':!![]});var _0x26a9e9=_0x8506('0x50');return db[_0x8506('0x51')][_0x8506('0x4b')]({'where':{'name':_0x26a9e9,'userProfileId':_0x5385df['userProfileId']},'raw':!![]})[_0x8506('0x28')](function(_0x3fc6f7){if(_0x3fc6f7&&_0x3fc6f7[_0x8506('0x52')]===0x0){return db[_0x8506('0x2a')][_0x8506('0x4c')]({'name':_0x462a53[_0x8506('0x33')],'resourceId':_0x462a53['id'],'type':_0x3fc6f7[_0x8506('0x33')],'sectionId':_0x3fc6f7['id']},{})[_0x8506('0x28')](function(){return _0x223912;});}else{return _0x223912;}})['catch'](function(_0x15c668){logger['error'](_0x8506('0x53'),_0x15c668);throw _0x15c668;});}return _0x223912;})['then'](respondWithResult(_0x442ecd,0xc9))[_0x8506('0x47')](handleError(_0x442ecd,null));};exports['update']=function(_0x4fccc2,_0x2380ca){if(_0x4fccc2['body']['id']){delete _0x4fccc2[_0x8506('0x4d')]['id'];}return db[_0x8506('0x43')]['find']({'where':{'id':_0x4fccc2[_0x8506('0x49')]['id']}})[_0x8506('0x28')](handleEntityNotFound(_0x2380ca,null))[_0x8506('0x28')](saveUpdates(_0x4fccc2['body'],null))[_0x8506('0x28')](respondWithResult(_0x2380ca,null))[_0x8506('0x47')](handleError(_0x2380ca,null));};exports[_0x8506('0x29')]=function(_0x1da8f4,_0x40e4be){return db[_0x8506('0x43')][_0x8506('0x4b')]({'where':{'id':_0x1da8f4[_0x8506('0x49')]['id']}})[_0x8506('0x28')](handleEntityNotFound(_0x40e4be,null))[_0x8506('0x28')](removeEntity(_0x40e4be,null))['catch'](handleError(_0x40e4be,null));};exports['download']=function(_0x52f59e,_0x45e84e,_0x4a61e8){return db[_0x8506('0x43')][_0x8506('0x4b')]({'where':{'id':_0x52f59e[_0x8506('0x49')]['id']},'attributes':[_0x8506('0x33'),'basename','savename',_0x8506('0x54')],'raw':!![]})[_0x8506('0x28')](handleEntityNotFound(_0x45e84e,null))[_0x8506('0x28')](function(_0x2e532b){if(_0x2e532b){if(!fs[_0x8506('0x55')](path[_0x8506('0x56')](config[_0x8506('0x57')],'server/files/reports',_0x2e532b['savename']))){throw new db[(_0x8506('0x58'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x52f59e['query'][_0x8506('0x59')]){return _0x45e84e['sendStatus'](0xc8);}return _0x45e84e['download'](path[_0x8506('0x56')](config[_0x8506('0x57')],_0x8506('0x5a'),_0x2e532b['savename']),util['format'](_0x8506('0x5b'),_0x2e532b[_0x8506('0x5c')]||_0x2e532b[_0x8506('0x33')],_0x2e532b[_0x8506('0x54')]['toLowerCase']()));}})[_0x8506('0x47')](handleError(_0x45e84e,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 567917c..708df3a 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 _0x6f21=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash'];(function(_0x35e327,_0x3cda24){var _0x4f2310=function(_0x2cf292){while(--_0x2cf292){_0x35e327['push'](_0x35e327['shift']());}};_0x4f2310(++_0x3cda24);}(_0x6f21,0xfb));var _0x16f2=function(_0x4faabc,_0x349a1e){_0x4faabc=_0x4faabc-0x0;var _0x42fc45=_0x6f21[_0x4faabc];return _0x42fc45;};'use strict';var _=require(_0x16f2('0x0'));var util=require(_0x16f2('0x1'));var logger=require(_0x16f2('0x2'))(_0x16f2('0x3'));var moment=require(_0x16f2('0x4'));var BPromise=require(_0x16f2('0x5'));var rp=require(_0x16f2('0x6'));var fs=require('fs');var path=require(_0x16f2('0x7'));var rimraf=require(_0x16f2('0x8'));var config=require(_0x16f2('0x9'));var attributes=require(_0x16f2('0xa'));module[_0x16f2('0xb')]=function(_0x193481,_0x120653){return _0x193481[_0x16f2('0xc')](_0x16f2('0xd'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3a8=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util'];(function(_0x2752f4,_0x1652ca){var _0x5768c4=function(_0x32e25f){while(--_0x32e25f){_0x2752f4['push'](_0x2752f4['shift']());}};_0x5768c4(++_0x1652ca);}(_0xf3a8,0x11f));var _0x8f3a=function(_0x2e4caa,_0x4d0110){_0x2e4caa=_0x2e4caa-0x0;var _0x4a95f7=_0xf3a8[_0x2e4caa];return _0x4a95f7;};'use strict';var _=require('lodash');var util=require(_0x8f3a('0x0'));var logger=require(_0x8f3a('0x1'))('api');var moment=require(_0x8f3a('0x2'));var BPromise=require('bluebird');var rp=require(_0x8f3a('0x3'));var fs=require('fs');var path=require(_0x8f3a('0x4'));var rimraf=require(_0x8f3a('0x5'));var config=require(_0x8f3a('0x6'));var attributes=require(_0x8f3a('0x7'));module[_0x8f3a('0x8')]=function(_0x5928d8,_0x1a6d9a){return _0x5928d8[_0x8f3a('0x9')](_0x8f3a('0xa'),attributes,{'tableName':_0x8f3a('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 0cb52ef..c3331a4 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 _0x10d0=['catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1ab0e6,_0x17ba8d){var _0x248815=function(_0x5d2b40){while(--_0x5d2b40){_0x1ab0e6['push'](_0x1ab0e6['shift']());}};_0x248815(++_0x17ba8d);}(_0x10d0,0x13c));var _0x010d=function(_0xfcf442,_0x374291){_0xfcf442=_0xfcf442-0x0;var _0x5de656=_0x10d0[_0xfcf442];return _0x5de656;};'use strict';var _=require(_0x010d('0x0'));var util=require(_0x010d('0x1'));var moment=require('moment');var BPromise=require(_0x010d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x010d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x010d('0x4'));var logger=require(_0x010d('0x5'))(_0x010d('0x6'));var config=require('../../config/environment');var jayson=require(_0x010d('0x7'));var client=jayson[_0x010d('0x8')][_0x010d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48c7cd,_0x293e9c,_0x19a106){return new BPromise(function(_0x2f9013,_0x2483ca){return client[_0x010d('0xa')](_0x48c7cd,_0x19a106)[_0x010d('0xb')](function(_0x282aad){logger['info'](_0x010d('0xc'),_0x293e9c,'request\x20sent');logger[_0x010d('0xd')](_0x010d('0xe'),_0x293e9c,_0x010d('0xf'),JSON[_0x010d('0x10')](_0x282aad));if(_0x282aad[_0x010d('0x11')]){if(_0x282aad[_0x010d('0x11')][_0x010d('0x12')]===0x1f4){logger['error'](_0x010d('0xc'),_0x293e9c,_0x282aad['error'][_0x010d('0x13')]);return _0x2483ca(_0x282aad[_0x010d('0x11')][_0x010d('0x13')]);}logger[_0x010d('0x11')](_0x010d('0xc'),_0x293e9c,_0x282aad[_0x010d('0x11')]['message']);return _0x2f9013(_0x282aad['error'][_0x010d('0x13')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x293e9c,'request\x20sent');_0x2f9013(_0x282aad['result'][_0x010d('0x13')]);}})[_0x010d('0x14')](function(_0x3faa6c){logger[_0x010d('0x11')](_0x010d('0xc'),_0x293e9c,_0x3faa6c);_0x2483ca(_0x3faa6c);});});}
\ No newline at end of file
+var _0xc069=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment'];(function(_0x2b6e48,_0xdb9926){var _0x319c86=function(_0x2b0947){while(--_0x2b0947){_0x2b6e48['push'](_0x2b6e48['shift']());}};_0x319c86(++_0xdb9926);}(_0xc069,0x70));var _0x9c06=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc069[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9c06('0x0'));var util=require(_0x9c06('0x1'));var moment=require(_0x9c06('0x2'));var BPromise=require(_0x9c06('0x3'));var rs=require(_0x9c06('0x4'));var fs=require('fs');var Redis=require(_0x9c06('0x5'));var db=require(_0x9c06('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c06('0x7'))(_0x9c06('0x8'));var config=require('../../config/environment');var jayson=require(_0x9c06('0x9'));var client=jayson[_0x9c06('0xa')][_0x9c06('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3db5a8,_0x42cd9c,_0xd53942){return new BPromise(function(_0x593213,_0xc1418b){return client[_0x9c06('0xc')](_0x3db5a8,_0xd53942)[_0x9c06('0xd')](function(_0x8b9fcc){logger[_0x9c06('0xe')](_0x9c06('0xf'),_0x42cd9c,'request\x20sent');logger['debug'](_0x9c06('0x10'),_0x42cd9c,'request\x20sent',JSON[_0x9c06('0x11')](_0x8b9fcc));if(_0x8b9fcc[_0x9c06('0x12')]){if(_0x8b9fcc['error'][_0x9c06('0x13')]===0x1f4){logger[_0x9c06('0x12')](_0x9c06('0xf'),_0x42cd9c,_0x8b9fcc[_0x9c06('0x12')]['message']);return _0xc1418b(_0x8b9fcc[_0x9c06('0x12')][_0x9c06('0x14')]);}logger['error'](_0x9c06('0xf'),_0x42cd9c,_0x8b9fcc[_0x9c06('0x12')][_0x9c06('0x14')]);return _0x593213(_0x8b9fcc[_0x9c06('0x12')][_0x9c06('0x14')]);}else{logger[_0x9c06('0xe')](_0x9c06('0xf'),_0x42cd9c,_0x9c06('0x15'));_0x593213(_0x8b9fcc['result'][_0x9c06('0x14')]);}})[_0x9c06('0x16')](function(_0x1dffd6){logger[_0x9c06('0x12')](_0x9c06('0xf'),_0x42cd9c,_0x1dffd6);_0xc1418b(_0x1dffd6);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 0d9b333..cdf16ec 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 _0x8771=['delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','put'];(function(_0x10f2dc,_0x3bd93b){var _0x3bbbc6=function(_0x2770dc){while(--_0x2770dc){_0x10f2dc['push'](_0x10f2dc['shift']());}};_0x3bbbc6(++_0x3bd93b);}(_0x8771,0x193));var _0x1877=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0x8771[_0x104e21];return _0x605b37;};'use strict';var multer=require(_0x1877('0x0'));var util=require(_0x1877('0x1'));var path=require(_0x1877('0x2'));var timeout=require('connect-timeout');var express=require(_0x1877('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1877('0x4'));var interaction=require(_0x1877('0x5'));var config=require(_0x1877('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0x1877('0x7')]('/',auth[_0x1877('0x8')](),controller['index']);router[_0x1877('0x7')](_0x1877('0x9'),auth[_0x1877('0x8')](),controller[_0x1877('0xa')]);router[_0x1877('0x7')](_0x1877('0xb'),auth[_0x1877('0x8')](),controller['download']);router['post']('/',auth[_0x1877('0x8')](),controller['create']);router[_0x1877('0xc')](_0x1877('0x9'),auth[_0x1877('0x8')](),controller['update']);router[_0x1877('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x1877('0xe')]);module[_0x1877('0xf')]=router;
\ No newline at end of file
+var _0x34df=['download','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x5a1622,_0x5f0422){var _0x5a3072=function(_0x34d943){while(--_0x34d943){_0x5a1622['push'](_0x5a1622['shift']());}};_0x5a3072(++_0x5f0422);}(_0x34df,0xa2));var _0xf34d=function(_0x5ac1e5,_0x4b5012){_0x5ac1e5=_0x5ac1e5-0x0;var _0x1bccc6=_0x34df[_0x5ac1e5];return _0x1bccc6;};'use strict';var multer=require(_0xf34d('0x0'));var util=require(_0xf34d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf34d('0x2'));var router=express[_0xf34d('0x3')]();var fs_extra=require(_0xf34d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf34d('0x5'));var config=require(_0xf34d('0x6'));var controller=require(_0xf34d('0x7'));router[_0xf34d('0x8')]('/',auth[_0xf34d('0x9')](),controller[_0xf34d('0xa')]);router[_0xf34d('0x8')](_0xf34d('0xb'),auth[_0xf34d('0x9')](),controller[_0xf34d('0xc')]);router[_0xf34d('0x8')](_0xf34d('0xd'),auth['isAuthenticated'](),controller[_0xf34d('0xe')]);router[_0xf34d('0xf')]('/',auth[_0xf34d('0x9')](),controller[_0xf34d('0x10')]);router[_0xf34d('0x11')](_0xf34d('0xb'),auth[_0xf34d('0x9')](),controller[_0xf34d('0x12')]);router[_0xf34d('0x13')](_0xf34d('0xb'),auth['isAuthenticated'](),controller[_0xf34d('0x14')]);module[_0xf34d('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index bdb80f3..e731d16 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 _0xbc83=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0xf411cd,_0x2728a5){var _0xad4726=function(_0x124024){while(--_0x124024){_0xf411cd['push'](_0xf411cd['shift']());}};_0xad4726(++_0x2728a5);}(_0xbc83,0x17a));var _0x3bc8=function(_0x1c92a3,_0x4a196a){_0x1c92a3=_0x1c92a3-0x0;var _0xf30104=_0xbc83[_0x1c92a3];return _0xf30104;};'use strict';var Sequelize=require(_0x3bc8('0x0'));module['exports']={'field':{'type':Sequelize[_0x3bc8('0x1')]},'alias':{'type':Sequelize[_0x3bc8('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x3bc8('0x2')]},'groupBy':{'type':Sequelize[_0x3bc8('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3bc8('0x2')]},'custom':{'type':Sequelize[_0x3bc8('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe7f0=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x5ebf27,_0x4a656f){var _0x55f3ae=function(_0x5a2a58){while(--_0x5a2a58){_0x5ebf27['push'](_0x5ebf27['shift']());}};_0x55f3ae(++_0x4a656f);}(_0xe7f0,0x16a));var _0x0e7f=function(_0x2d4661,_0x2da65c){_0x2d4661=_0x2d4661-0x0;var _0x42ed1e=_0xe7f0[_0x2d4661];return _0x42ed1e;};'use strict';var Sequelize=require(_0x0e7f('0x0'));module[_0x0e7f('0x1')]={'field':{'type':Sequelize[_0x0e7f('0x2')]},'alias':{'type':Sequelize[_0x0e7f('0x3')]},'function':{'type':Sequelize[_0x0e7f('0x3')]},'format':{'type':Sequelize[_0x0e7f('0x3')]},'groupBy':{'type':Sequelize[_0x0e7f('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0e7f('0x3')]},'custom':{'type':Sequelize[_0x0e7f('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 4ad9a5c..784defb 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 _0x8540=['squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','save','update','then','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','type','key','keys','query','intersection','model','attributes','fields','length','nolimit','limit','order','filters','pick','where','merge','map','VIRTUAL','filter','includeAll','include','findAll','rows','params','options','catch','create','body','bulkCreate','find','bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x29bcab,_0x53a015){var _0x2cb492=function(_0x24ee16){while(--_0x24ee16){_0x29bcab['push'](_0x29bcab['shift']());}};_0x2cb492(++_0x53a015);}(_0x8540,0x148));var _0x0854=function(_0x221ba2,_0x79208){_0x221ba2=_0x221ba2-0x0;var _0x47d08e=_0x8540[_0x221ba2];return _0x47d08e;};'use strict';var emlformat=require(_0x0854('0x0'));var rimraf=require(_0x0854('0x1'));var zipdir=require(_0x0854('0x2'));var jsonpatch=require(_0x0854('0x3'));var rp=require(_0x0854('0x4'));var moment=require('moment');var BPromise=require(_0x0854('0x5'));var Mustache=require(_0x0854('0x6'));var util=require(_0x0854('0x7'));var path=require(_0x0854('0x8'));var sox=require(_0x0854('0x9'));var csv=require('to-csv');var ejs=require(_0x0854('0xa'));var fs=require('fs');var fs_extra=require(_0x0854('0xb'));var _=require('lodash');var squel=require(_0x0854('0xc'));var crypto=require('crypto');var jsforce=require(_0x0854('0xd'));var deskjs=require(_0x0854('0xe'));var toCsv=require(_0x0854('0xf'));var querystring=require(_0x0854('0x10'));var Papa=require(_0x0854('0x11'));var Redis=require('ioredis');var authService=require(_0x0854('0x12'));var qs=require(_0x0854('0x13'));var as=require(_0x0854('0x14'));var hardwareService=require(_0x0854('0x15'));var logger=require(_0x0854('0x16'))(_0x0854('0x17'));var utils=require(_0x0854('0x18'));var config=require(_0x0854('0x19'));var licenseUtil=require(_0x0854('0x1a'));var db=require(_0x0854('0x1b'))['db'];function respondWithStatusCode(_0x3a08ce,_0xca0485){_0xca0485=_0xca0485||0xcc;return function(_0x4e05d4){if(_0x4e05d4){return _0x3a08ce[_0x0854('0x1c')](_0xca0485);}return _0x3a08ce[_0x0854('0x1d')](_0xca0485)[_0x0854('0x1e')]();};}function respondWithResult(_0x3f4caf,_0xddea3f){_0xddea3f=_0xddea3f||0xc8;return function(_0x45fc41){if(_0x45fc41){return _0x3f4caf[_0x0854('0x1d')](_0xddea3f)[_0x0854('0x1f')](_0x45fc41);}};}function respondWithFilteredResult(_0x4d9fe6,_0x5d99ea){return function(_0x634fb3){if(_0x634fb3){var _0x24bd93=typeof _0x5d99ea[_0x0854('0x20')]===_0x0854('0x21')&&typeof _0x5d99ea['limit']===_0x0854('0x21');var _0x5d85cb=_0x634fb3['count'];var _0x3c1bd5=_0x24bd93?0x0:_0x5d99ea[_0x0854('0x20')];var _0x16354c=_0x24bd93?_0x634fb3[_0x0854('0x22')]:_0x5d99ea[_0x0854('0x20')]+_0x5d99ea['limit'];var _0x2dde3e;if(_0x16354c>=_0x5d85cb){_0x16354c=_0x5d85cb;_0x2dde3e=0xc8;}else{_0x2dde3e=0xce;}_0x4d9fe6['status'](_0x2dde3e);return _0x4d9fe6['set'](_0x0854('0x23'),_0x3c1bd5+'-'+_0x16354c+'/'+_0x5d85cb)[_0x0854('0x1f')](_0x634fb3);}return null;};}function patchUpdates(_0x4e3c96){return function(_0x26cb1e){try{jsonpatch['apply'](_0x26cb1e,_0x4e3c96,!![]);}catch(_0x3f2965){return BPromise['reject'](_0x3f2965);}return _0x26cb1e[_0x0854('0x24')]();};}function saveUpdates(_0x10d4ae,_0x4d65c9){return function(_0x4e1929){if(_0x4e1929){return _0x4e1929[_0x0854('0x25')](_0x10d4ae)[_0x0854('0x26')](function(_0x580d33){return _0x580d33;});}return null;};}function removeEntity(_0x46c267,_0x43d08c){return function(_0xf5fb95){if(_0xf5fb95){return _0xf5fb95['destroy']()[_0x0854('0x26')](function(){_0x46c267[_0x0854('0x1d')](0xcc)[_0x0854('0x1e')]();});}};}function handleEntityNotFound(_0x1c290e,_0x3b47c1){return function(_0x3f8fce){if(!_0x3f8fce){_0x1c290e['sendStatus'](0x194);}return _0x3f8fce;};}function handleError(_0x57878f,_0x216b90){_0x216b90=_0x216b90||0x1f4;return function(_0x16a363){logger[_0x0854('0x27')](_0x16a363[_0x0854('0x28')]);if(_0x16a363[_0x0854('0x29')]){delete _0x16a363[_0x0854('0x29')];}_0x57878f[_0x0854('0x1d')](_0x216b90)[_0x0854('0x2a')](_0x16a363);};}exports[_0x0854('0x2b')]=function(_0x456acd,_0x4a2798){var _0x3349c1={},_0x4c5629={},_0x28b399={'count':0x0,'rows':[]};var _0x157cee=_['map'](db[_0x0854('0x2c')][_0x0854('0x2d')],function(_0x540500){return{'name':_0x540500['fieldName'],'type':_0x540500[_0x0854('0x2e')][_0x0854('0x2f')]};});_0x4c5629['model']=_['map'](_0x157cee,_0x0854('0x29'));_0x4c5629['query']=_[_0x0854('0x30')](_0x456acd[_0x0854('0x31')]);_0x4c5629['filters']=_[_0x0854('0x32')](_0x4c5629[_0x0854('0x33')],_0x4c5629[_0x0854('0x31')]);_0x3349c1[_0x0854('0x34')]=_[_0x0854('0x32')](_0x4c5629[_0x0854('0x33')],qs[_0x0854('0x35')](_0x456acd[_0x0854('0x31')]['fields']));_0x3349c1['attributes']=_0x3349c1[_0x0854('0x34')][_0x0854('0x36')]?_0x3349c1[_0x0854('0x34')]:_0x4c5629['model'];if(!_0x456acd['query']['hasOwnProperty'](_0x0854('0x37'))){_0x3349c1[_0x0854('0x38')]=qs[_0x0854('0x38')](_0x456acd[_0x0854('0x31')][_0x0854('0x38')]);_0x3349c1[_0x0854('0x20')]=qs[_0x0854('0x20')](_0x456acd[_0x0854('0x31')][_0x0854('0x20')]);}_0x3349c1[_0x0854('0x39')]=qs['sort'](_0x456acd[_0x0854('0x31')]['sort']);_0x3349c1['where']=qs[_0x0854('0x3a')](_[_0x0854('0x3b')](_0x456acd[_0x0854('0x31')],_0x4c5629[_0x0854('0x3a')]),_0x157cee);if(_0x456acd['query']['filter']){_0x3349c1[_0x0854('0x3c')]=_[_0x0854('0x3d')](_0x3349c1[_0x0854('0x3c')],{'$or':_[_0x0854('0x3e')](_0x157cee,function(_0x47c662){if(_0x47c662[_0x0854('0x2e')]!==_0x0854('0x3f')){var _0x33668f={};_0x33668f[_0x47c662[_0x0854('0x29')]]={'$like':'%'+_0x456acd[_0x0854('0x31')][_0x0854('0x40')]+'%'};return _0x33668f;}})});}_0x3349c1=_['merge']({},_0x3349c1,_0x456acd['options']);var _0x2fb73b={'where':_0x3349c1[_0x0854('0x3c')]};return db[_0x0854('0x2c')]['count'](_0x2fb73b)[_0x0854('0x26')](function(_0x3751e0){_0x28b399[_0x0854('0x22')]=_0x3751e0;if(_0x456acd[_0x0854('0x31')][_0x0854('0x41')]){_0x3349c1[_0x0854('0x42')]=[{'all':!![]}];}return db[_0x0854('0x2c')][_0x0854('0x43')](_0x3349c1);})[_0x0854('0x26')](function(_0x1955ba){_0x28b399[_0x0854('0x44')]=_0x1955ba;return _0x28b399;})[_0x0854('0x26')](respondWithFilteredResult(_0x4a2798,_0x3349c1))['catch'](handleError(_0x4a2798,null));};exports['show']=function(_0x22e486,_0x1214a0){var _0x1f2824={'raw':![],'where':{'id':_0x22e486[_0x0854('0x45')]['id']}},_0x7163f={};_0x7163f[_0x0854('0x33')]=_[_0x0854('0x30')](db[_0x0854('0x2c')][_0x0854('0x2d')]);_0x7163f[_0x0854('0x31')]=_[_0x0854('0x30')](_0x22e486[_0x0854('0x31')]);_0x7163f['filters']=_[_0x0854('0x32')](_0x7163f[_0x0854('0x33')],_0x7163f['query']);_0x1f2824[_0x0854('0x34')]=_[_0x0854('0x32')](_0x7163f[_0x0854('0x33')],qs[_0x0854('0x35')](_0x22e486[_0x0854('0x31')][_0x0854('0x35')]));_0x1f2824[_0x0854('0x34')]=_0x1f2824[_0x0854('0x34')]['length']?_0x1f2824['attributes']:_0x7163f[_0x0854('0x33')];if(_0x22e486['query']['includeAll']){_0x1f2824[_0x0854('0x42')]=[{'all':!![]}];}_0x1f2824=_[_0x0854('0x3d')]({},_0x1f2824,_0x22e486[_0x0854('0x46')]);return db['AnalyticFieldReport']['find'](_0x1f2824)['then'](handleEntityNotFound(_0x1214a0,null))[_0x0854('0x26')](respondWithResult(_0x1214a0,null))[_0x0854('0x47')](handleError(_0x1214a0,null));};exports['create']=function(_0x513131,_0x21accf){return db[_0x0854('0x2c')][_0x0854('0x48')](_0x513131[_0x0854('0x49')],{})['then'](respondWithResult(_0x21accf,0xc9))[_0x0854('0x47')](handleError(_0x21accf,null));};exports['bulkCreate']=function(_0x18d65c,_0x53c150){return db[_0x0854('0x2c')][_0x0854('0x4a')](_0x18d65c[_0x0854('0x49')],{'raw':![],'individualHooks':!![]})[_0x0854('0x26')](respondWithResult(_0x53c150,0xc9))[_0x0854('0x47')](handleError(_0x53c150,null));};exports[_0x0854('0x25')]=function(_0x10d2ff,_0x3de010){if(_0x10d2ff[_0x0854('0x49')]['id']){delete _0x10d2ff[_0x0854('0x49')]['id'];}return db[_0x0854('0x2c')][_0x0854('0x4b')]({'where':{'id':_0x10d2ff[_0x0854('0x45')]['id']}})[_0x0854('0x26')](handleEntityNotFound(_0x3de010,null))[_0x0854('0x26')](saveUpdates(_0x10d2ff['body'],null))['then'](respondWithResult(_0x3de010,null))[_0x0854('0x47')](handleError(_0x3de010,null));};exports['destroy']=function(_0x169907,_0x3d193c){return db[_0x0854('0x2c')][_0x0854('0x4b')]({'where':{'id':_0x169907[_0x0854('0x45')]['id']}})['then'](handleEntityNotFound(_0x3d193c,null))[_0x0854('0x26')](removeEntity(_0x3d193c,null))[_0x0854('0x47')](handleError(_0x3d193c,null));};exports[_0x0854('0x4c')]=function(_0x32b0ed,_0x23091e){return db['AnalyticFieldReport'][_0x0854('0x4d')]({'where':{'id':_0x32b0ed['query'][_0x0854('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x0854('0x26')](respondWithResult(_0x23091e,0xcc))['catch'](handleError(_0x23091e,null));};exports[_0x0854('0x4f')]=function(_0x2944dd,_0x4347f7,_0x194919){return db[_0x0854('0x50')][_0x0854('0x51')]({'where':{'id':_0x2944dd[_0x0854('0x45')]['id']}})[_0x0854('0x26')](handleEntityNotFound(_0x4347f7,null))['then'](function(_0x56a843){if(_0x56a843){return db[_0x0854('0x52')][_0x0854('0x53')](function(_0x266cb6){return db[_0x0854('0x2c')]['destroy']({'where':{'CustomReportId':_0x2944dd[_0x0854('0x45')]['id']},'transaction':_0x266cb6})[_0x0854('0x26')](function(_0x52ffb3){var _0x1e11f0=_[_0x0854('0x3e')](_0x2944dd[_0x0854('0x49')],function(_0x19977e){delete _0x19977e['id'];_0x19977e[_0x0854('0x54')]=_0x2944dd[_0x0854('0x45')]['id'];return _0x19977e;});return db[_0x0854('0x2c')][_0x0854('0x4a')](_0x1e11f0,{'transaction':_0x266cb6});});})[_0x0854('0x26')](function(){return db[_0x0854('0x2c')][_0x0854('0x43')]({'where':{'CustomReportId':_0x2944dd[_0x0854('0x45')]['id']}});});}})['then'](respondWithResult(_0x4347f7,null))[_0x0854('0x47')](handleError(_0x4347f7,null));};
\ No newline at end of file
+var _0xfbce=['../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','AnalyticFieldReport','key','map','query','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','intersection','merge','find','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','CustomReportId','eml-format','zip-dir','request-promise','moment','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5c17ff,_0x36ad7f){var _0x1fa5b7=function(_0x1c14f2){while(--_0x1c14f2){_0x5c17ff['push'](_0x5c17ff['shift']());}};_0x1fa5b7(++_0x36ad7f);}(_0xfbce,0x8d));var _0xefbc=function(_0x542677,_0x2c11c1){_0x542677=_0x542677-0x0;var _0x1026a1=_0xfbce[_0x542677];return _0x1026a1;};'use strict';var emlformat=require(_0xefbc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xefbc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xefbc('0x2'));var moment=require(_0xefbc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xefbc('0x4'));var util=require(_0xefbc('0x5'));var path=require(_0xefbc('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xefbc('0x7'));var _=require(_0xefbc('0x8'));var squel=require(_0xefbc('0x9'));var crypto=require(_0xefbc('0xa'));var jsforce=require(_0xefbc('0xb'));var deskjs=require(_0xefbc('0xc'));var toCsv=require(_0xefbc('0xd'));var querystring=require(_0xefbc('0xe'));var Papa=require(_0xefbc('0xf'));var Redis=require(_0xefbc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xefbc('0x11'));var as=require(_0xefbc('0x12'));var hardwareService=require(_0xefbc('0x13'));var logger=require('../../config/logger')(_0xefbc('0x14'));var utils=require(_0xefbc('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xefbc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dc89d,_0x186cda){_0x186cda=_0x186cda||0xcc;return function(_0x13ba94){if(_0x13ba94){return _0x5dc89d[_0xefbc('0x17')](_0x186cda);}return _0x5dc89d[_0xefbc('0x18')](_0x186cda)[_0xefbc('0x19')]();};}function respondWithResult(_0x4b2ae9,_0xb465ad){_0xb465ad=_0xb465ad||0xc8;return function(_0x31c15c){if(_0x31c15c){return _0x4b2ae9[_0xefbc('0x18')](_0xb465ad)[_0xefbc('0x1a')](_0x31c15c);}};}function respondWithFilteredResult(_0x494125,_0x488b36){return function(_0x1e3340){if(_0x1e3340){var _0x4a478c=typeof _0x488b36['offset']===_0xefbc('0x1b')&&typeof _0x488b36[_0xefbc('0x1c')]===_0xefbc('0x1b');var _0x24863d=_0x1e3340['count'];var _0x5122a7=_0x4a478c?0x0:_0x488b36[_0xefbc('0x1d')];var _0x379a56=_0x4a478c?_0x1e3340[_0xefbc('0x1e')]:_0x488b36[_0xefbc('0x1d')]+_0x488b36[_0xefbc('0x1c')];var _0x34d55d;if(_0x379a56>=_0x24863d){_0x379a56=_0x24863d;_0x34d55d=0xc8;}else{_0x34d55d=0xce;}_0x494125[_0xefbc('0x18')](_0x34d55d);return _0x494125[_0xefbc('0x1f')](_0xefbc('0x20'),_0x5122a7+'-'+_0x379a56+'/'+_0x24863d)[_0xefbc('0x1a')](_0x1e3340);}return null;};}function patchUpdates(_0x13ec42){return function(_0x50b89b){try{jsonpatch[_0xefbc('0x21')](_0x50b89b,_0x13ec42,!![]);}catch(_0x286020){return BPromise[_0xefbc('0x22')](_0x286020);}return _0x50b89b[_0xefbc('0x23')]();};}function saveUpdates(_0x1b164f,_0x447695){return function(_0x45c9a1){if(_0x45c9a1){return _0x45c9a1['update'](_0x1b164f)[_0xefbc('0x24')](function(_0x534c9a){return _0x534c9a;});}return null;};}function removeEntity(_0x1d14dc,_0x3bb247){return function(_0x55b744){if(_0x55b744){return _0x55b744[_0xefbc('0x25')]()[_0xefbc('0x24')](function(){_0x1d14dc[_0xefbc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ff68c,_0x2abdf7){return function(_0x2018a7){if(!_0x2018a7){_0x4ff68c[_0xefbc('0x17')](0x194);}return _0x2018a7;};}function handleError(_0xea1885,_0x5470c5){_0x5470c5=_0x5470c5||0x1f4;return function(_0x30b35b){logger[_0xefbc('0x26')](_0x30b35b['stack']);if(_0x30b35b[_0xefbc('0x27')]){delete _0x30b35b[_0xefbc('0x27')];}_0xea1885[_0xefbc('0x18')](_0x5470c5)[_0xefbc('0x28')](_0x30b35b);};}exports[_0xefbc('0x29')]=function(_0x44d7d9,_0x4d8708){var _0x21be47={},_0x30a79e={},_0x177f74={'count':0x0,'rows':[]};var _0x4a96f4=_['map'](db[_0xefbc('0x2a')]['rawAttributes'],function(_0x51a56b){return{'name':_0x51a56b['fieldName'],'type':_0x51a56b['type'][_0xefbc('0x2b')]};});_0x30a79e['model']=_[_0xefbc('0x2c')](_0x4a96f4,_0xefbc('0x27'));_0x30a79e['query']=_['keys'](_0x44d7d9[_0xefbc('0x2d')]);_0x30a79e['filters']=_['intersection'](_0x30a79e[_0xefbc('0x2e')],_0x30a79e[_0xefbc('0x2d')]);_0x21be47[_0xefbc('0x2f')]=_['intersection'](_0x30a79e[_0xefbc('0x2e')],qs['fields'](_0x44d7d9['query'][_0xefbc('0x30')]));_0x21be47['attributes']=_0x21be47[_0xefbc('0x2f')][_0xefbc('0x31')]?_0x21be47[_0xefbc('0x2f')]:_0x30a79e['model'];if(!_0x44d7d9[_0xefbc('0x2d')][_0xefbc('0x32')](_0xefbc('0x33'))){_0x21be47[_0xefbc('0x1c')]=qs[_0xefbc('0x1c')](_0x44d7d9[_0xefbc('0x2d')][_0xefbc('0x1c')]);_0x21be47[_0xefbc('0x1d')]=qs['offset'](_0x44d7d9['query'][_0xefbc('0x1d')]);}_0x21be47[_0xefbc('0x34')]=qs[_0xefbc('0x35')](_0x44d7d9[_0xefbc('0x2d')][_0xefbc('0x35')]);_0x21be47[_0xefbc('0x36')]=qs['filters'](_[_0xefbc('0x37')](_0x44d7d9[_0xefbc('0x2d')],_0x30a79e[_0xefbc('0x38')]),_0x4a96f4);if(_0x44d7d9['query'][_0xefbc('0x39')]){_0x21be47[_0xefbc('0x36')]=_['merge'](_0x21be47[_0xefbc('0x36')],{'$or':_[_0xefbc('0x2c')](_0x4a96f4,function(_0x56ad9c){if(_0x56ad9c[_0xefbc('0x3a')]!==_0xefbc('0x3b')){var _0x21755a={};_0x21755a[_0x56ad9c['name']]={'$like':'%'+_0x44d7d9[_0xefbc('0x2d')][_0xefbc('0x39')]+'%'};return _0x21755a;}})});}_0x21be47=_['merge']({},_0x21be47,_0x44d7d9[_0xefbc('0x3c')]);var _0xf6dca1={'where':_0x21be47[_0xefbc('0x36')]};return db[_0xefbc('0x2a')][_0xefbc('0x1e')](_0xf6dca1)['then'](function(_0x3b2026){_0x177f74[_0xefbc('0x1e')]=_0x3b2026;if(_0x44d7d9['query'][_0xefbc('0x3d')]){_0x21be47[_0xefbc('0x3e')]=[{'all':!![]}];}return db[_0xefbc('0x2a')][_0xefbc('0x3f')](_0x21be47);})[_0xefbc('0x24')](function(_0x26c532){_0x177f74[_0xefbc('0x40')]=_0x26c532;return _0x177f74;})[_0xefbc('0x24')](respondWithFilteredResult(_0x4d8708,_0x21be47))[_0xefbc('0x41')](handleError(_0x4d8708,null));};exports['show']=function(_0x478e11,_0x8702c7){var _0x369e39={'raw':![],'where':{'id':_0x478e11[_0xefbc('0x42')]['id']}},_0x2e1e6c={};_0x2e1e6c['model']=_[_0xefbc('0x43')](db['AnalyticFieldReport']['rawAttributes']);_0x2e1e6c[_0xefbc('0x2d')]=_['keys'](_0x478e11['query']);_0x2e1e6c[_0xefbc('0x38')]=_['intersection'](_0x2e1e6c[_0xefbc('0x2e')],_0x2e1e6c[_0xefbc('0x2d')]);_0x369e39[_0xefbc('0x2f')]=_[_0xefbc('0x44')](_0x2e1e6c['model'],qs[_0xefbc('0x30')](_0x478e11['query']['fields']));_0x369e39[_0xefbc('0x2f')]=_0x369e39[_0xefbc('0x2f')][_0xefbc('0x31')]?_0x369e39[_0xefbc('0x2f')]:_0x2e1e6c[_0xefbc('0x2e')];if(_0x478e11[_0xefbc('0x2d')]['includeAll']){_0x369e39[_0xefbc('0x3e')]=[{'all':!![]}];}_0x369e39=_[_0xefbc('0x45')]({},_0x369e39,_0x478e11[_0xefbc('0x3c')]);return db['AnalyticFieldReport'][_0xefbc('0x46')](_0x369e39)[_0xefbc('0x24')](handleEntityNotFound(_0x8702c7,null))[_0xefbc('0x24')](respondWithResult(_0x8702c7,null))[_0xefbc('0x41')](handleError(_0x8702c7,null));};exports[_0xefbc('0x47')]=function(_0x4bd6e1,_0x213334){return db[_0xefbc('0x2a')][_0xefbc('0x47')](_0x4bd6e1['body'],{})[_0xefbc('0x24')](respondWithResult(_0x213334,0xc9))[_0xefbc('0x41')](handleError(_0x213334,null));};exports['bulkCreate']=function(_0x41f476,_0x13e67b){return db[_0xefbc('0x2a')][_0xefbc('0x48')](_0x41f476[_0xefbc('0x49')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x13e67b,0xc9))[_0xefbc('0x41')](handleError(_0x13e67b,null));};exports['update']=function(_0x1f5d24,_0x3165c6){if(_0x1f5d24[_0xefbc('0x49')]['id']){delete _0x1f5d24['body']['id'];}return db[_0xefbc('0x2a')][_0xefbc('0x46')]({'where':{'id':_0x1f5d24[_0xefbc('0x42')]['id']}})['then'](handleEntityNotFound(_0x3165c6,null))[_0xefbc('0x24')](saveUpdates(_0x1f5d24[_0xefbc('0x49')],null))['then'](respondWithResult(_0x3165c6,null))[_0xefbc('0x41')](handleError(_0x3165c6,null));};exports['destroy']=function(_0x552c5a,_0x349908){return db[_0xefbc('0x2a')][_0xefbc('0x46')]({'where':{'id':_0x552c5a[_0xefbc('0x42')]['id']}})['then'](handleEntityNotFound(_0x349908,null))[_0xefbc('0x24')](removeEntity(_0x349908,null))[_0xefbc('0x41')](handleError(_0x349908,null));};exports[_0xefbc('0x4a')]=function(_0x449c71,_0x3bcb87){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x449c71['query'][_0xefbc('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0xefbc('0x24')](respondWithResult(_0x3bcb87,0xcc))[_0xefbc('0x41')](handleError(_0x3bcb87,null));};exports[_0xefbc('0x4c')]=function(_0x165e37,_0x17ed38,_0xf7c414){return db[_0xefbc('0x4d')][_0xefbc('0x4e')]({'where':{'id':_0x165e37[_0xefbc('0x42')]['id']}})[_0xefbc('0x24')](handleEntityNotFound(_0x17ed38,null))['then'](function(_0x158874){if(_0x158874){return db['sequelize']['transaction'](function(_0x1ff5d2){return db[_0xefbc('0x2a')][_0xefbc('0x25')]({'where':{'CustomReportId':_0x165e37['params']['id']},'transaction':_0x1ff5d2})[_0xefbc('0x24')](function(_0x3a12bc){var _0x2e877c=_[_0xefbc('0x2c')](_0x165e37[_0xefbc('0x49')],function(_0x17cceb){delete _0x17cceb['id'];_0x17cceb[_0xefbc('0x4f')]=_0x165e37[_0xefbc('0x42')]['id'];return _0x17cceb;});return db['AnalyticFieldReport']['bulkCreate'](_0x2e877c,{'transaction':_0x1ff5d2});});})['then'](function(){return db[_0xefbc('0x2a')][_0xefbc('0x3f')]({'where':{'CustomReportId':_0x165e37[_0xefbc('0x42')]['id']}});});}})['then'](respondWithResult(_0x17ed38,null))[_0xefbc('0x41')](handleError(_0x17ed38,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 7f73850..4ddb288 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 _0xeb36=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticFieldReport','lodash','util','../../config/logger','moment'];(function(_0x16b32f,_0x758d48){var _0xc94c5b=function(_0x21858e){while(--_0x21858e){_0x16b32f['push'](_0x16b32f['shift']());}};_0xc94c5b(++_0x758d48);}(_0xeb36,0x188));var _0x6eb3=function(_0x22fded,_0x52eb9b){_0x22fded=_0x22fded-0x0;var _0x41fa12=_0xeb36[_0x22fded];return _0x41fa12;};'use strict';var _=require(_0x6eb3('0x0'));var util=require(_0x6eb3('0x1'));var logger=require(_0x6eb3('0x2'))('api');var moment=require(_0x6eb3('0x3'));var BPromise=require(_0x6eb3('0x4'));var rp=require(_0x6eb3('0x5'));var fs=require('fs');var path=require(_0x6eb3('0x6'));var rimraf=require(_0x6eb3('0x7'));var config=require(_0x6eb3('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0x6eb3('0x9')]=function(_0x56fcf4,_0x51f707){return _0x56fcf4[_0x6eb3('0xa')](_0x6eb3('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd591=['rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x33f902,_0x5ddc80){var _0x11b073=function(_0x309b69){while(--_0x309b69){_0x33f902['push'](_0x33f902['shift']());}};_0x11b073(++_0x5ddc80);}(_0xd591,0xe2));var _0x1d59=function(_0x57c64e,_0x28e189){_0x57c64e=_0x57c64e-0x0;var _0x1780ea=_0xd591[_0x57c64e];return _0x1780ea;};'use strict';var _=require('lodash');var util=require(_0x1d59('0x0'));var logger=require(_0x1d59('0x1'))('api');var moment=require(_0x1d59('0x2'));var BPromise=require(_0x1d59('0x3'));var rp=require(_0x1d59('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1d59('0x5'));var config=require('../../config/environment');var attributes=require(_0x1d59('0x6'));module[_0x1d59('0x7')]=function(_0x517555,_0x4f15f0){return _0x517555[_0x1d59('0x8')](_0x1d59('0x9'),attributes,{'tableName':_0x1d59('0xa'),'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 70162d8..75d78b0 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 _0xb187=['debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x9978d7,_0x118396){var _0x325558=function(_0x1007af){while(--_0x1007af){_0x9978d7['push'](_0x9978d7['shift']());}};_0x325558(++_0x118396);}(_0xb187,0x161));var _0x7b18=function(_0x4b775b,_0x2aadc6){_0x4b775b=_0x4b775b-0x0;var _0xf84d39=_0xb187[_0x4b775b];return _0xf84d39;};'use strict';var _=require(_0x7b18('0x0'));var util=require(_0x7b18('0x1'));var moment=require(_0x7b18('0x2'));var BPromise=require('bluebird');var rs=require(_0x7b18('0x3'));var fs=require('fs');var Redis=require(_0x7b18('0x4'));var db=require(_0x7b18('0x5'))['db'];var utils=require(_0x7b18('0x6'));var logger=require(_0x7b18('0x7'))(_0x7b18('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7b18('0x9')][_0x7b18('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4017a6,_0x28f986,_0x3a11b4){return new BPromise(function(_0x49fce9,_0x2a5ecb){return client[_0x7b18('0xb')](_0x4017a6,_0x3a11b4)[_0x7b18('0xc')](function(_0x2e73c7){logger[_0x7b18('0xd')](_0x7b18('0xe'),_0x28f986,'request\x20sent');logger[_0x7b18('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x28f986,'request\x20sent',JSON[_0x7b18('0x10')](_0x2e73c7));if(_0x2e73c7[_0x7b18('0x11')]){if(_0x2e73c7[_0x7b18('0x11')][_0x7b18('0x12')]===0x1f4){logger['error'](_0x7b18('0xe'),_0x28f986,_0x2e73c7[_0x7b18('0x11')][_0x7b18('0x13')]);return _0x2a5ecb(_0x2e73c7['error'][_0x7b18('0x13')]);}logger['error'](_0x7b18('0xe'),_0x28f986,_0x2e73c7['error'][_0x7b18('0x13')]);return _0x49fce9(_0x2e73c7[_0x7b18('0x11')][_0x7b18('0x13')]);}else{logger[_0x7b18('0xd')](_0x7b18('0xe'),_0x28f986,_0x7b18('0x14'));_0x49fce9(_0x2e73c7[_0x7b18('0x15')][_0x7b18('0x13')]);}})[_0x7b18('0x16')](function(_0x20148e){logger['error'](_0x7b18('0xe'),_0x28f986,_0x20148e);_0x2a5ecb(_0x20148e);});});}
\ No newline at end of file
+var _0x1b61=['AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info'];(function(_0x36828e,_0x1e401c){var _0x129fe3=function(_0x43c656){while(--_0x43c656){_0x36828e['push'](_0x36828e['shift']());}};_0x129fe3(++_0x1e401c);}(_0x1b61,0x15c));var _0x11b6=function(_0x22e746,_0x3337fe){_0x22e746=_0x22e746-0x0;var _0xc15f81=_0x1b61[_0x22e746];return _0xc15f81;};'use strict';var _=require(_0x11b6('0x0'));var util=require('util');var moment=require(_0x11b6('0x1'));var BPromise=require(_0x11b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x11b6('0x3'))['db'];var utils=require(_0x11b6('0x4'));var logger=require(_0x11b6('0x5'))(_0x11b6('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x11b6('0x7')][_0x11b6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10928c,_0x5913c9,_0x304c3b){return new BPromise(function(_0x2b3bb3,_0x4bcac0){return client[_0x11b6('0x9')](_0x10928c,_0x304c3b)[_0x11b6('0xa')](function(_0x47c946){logger[_0x11b6('0xb')](_0x11b6('0xc'),_0x5913c9,_0x11b6('0xd'));logger[_0x11b6('0xe')](_0x11b6('0xf'),_0x5913c9,_0x11b6('0xd'),JSON['stringify'](_0x47c946));if(_0x47c946[_0x11b6('0x10')]){if(_0x47c946[_0x11b6('0x10')][_0x11b6('0x11')]===0x1f4){logger[_0x11b6('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5913c9,_0x47c946['error'][_0x11b6('0x12')]);return _0x4bcac0(_0x47c946[_0x11b6('0x10')][_0x11b6('0x12')]);}logger[_0x11b6('0x10')](_0x11b6('0xc'),_0x5913c9,_0x47c946[_0x11b6('0x10')][_0x11b6('0x12')]);return _0x2b3bb3(_0x47c946[_0x11b6('0x10')][_0x11b6('0x12')]);}else{logger[_0x11b6('0xb')](_0x11b6('0xc'),_0x5913c9,_0x11b6('0xd'));_0x2b3bb3(_0x47c946['result'][_0x11b6('0x12')]);}})[_0x11b6('0x13')](function(_0x3e03e0){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x5913c9,_0x3e03e0);_0x4bcac0(_0x3e03e0);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 2d86350..f21d734 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(_0x51303b,_0x4f7b7e){var _0x5b255f=function(_0x37d89d){while(--_0x37d89d){_0x51303b['push'](_0x51303b['shift']());}};_0x5b255f(++_0x4f7b7e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0x1f41c0,_0x2fe473){var _0x339a12=function(_0x2112cb){while(--_0x2112cb){_0x1f41c0['push'](_0x1f41c0['shift']());}};_0x339a12(++_0x2fe473);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 5461101..3ad1b9e 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 _0xc5c0=['sequelize','exports','STRING','TEXT'];(function(_0x4533a6,_0x4794c9){var _0x25bffa=function(_0x2cd4f3){while(--_0x2cd4f3){_0x4533a6['push'](_0x4533a6['shift']());}};_0x25bffa(++_0x4794c9);}(_0xc5c0,0x6c));var _0x0c5c=function(_0x4d0bd1,_0x2f6c78){_0x4d0bd1=_0x4d0bd1-0x0;var _0x45abb0=_0xc5c0[_0x4d0bd1];return _0x45abb0;};'use strict';var Sequelize=require(_0x0c5c('0x0'));module[_0x0c5c('0x1')]={'name':{'type':Sequelize[_0x0c5c('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x0c5c('0x3')]},'description':{'type':Sequelize[_0x0c5c('0x2')]}};
\ No newline at end of file
+var _0x8aa7=['name','TEXT','exports','STRING'];(function(_0x597a43,_0x491124){var _0x4b7c2c=function(_0x47460d){while(--_0x47460d){_0x597a43['push'](_0x597a43['shift']());}};_0x4b7c2c(++_0x491124);}(_0x8aa7,0xb6));var _0x78aa=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x8aa7[_0x403c20];return _0x2b271a;};'use strict';var Sequelize=require('sequelize');module[_0x78aa('0x0')]={'name':{'type':Sequelize[_0x78aa('0x1')],'allowNull':![],'unique':_0x78aa('0x2')},'table':{'type':Sequelize[_0x78aa('0x1')]},'metric':{'type':Sequelize[_0x78aa('0x3')]},'description':{'type':Sequelize[_0x78aa('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 2b43bd9..eaaccd5 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 _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../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','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2e6b16,_0x31c2fb){var _0x185c18=function(_0x52fd7d){while(--_0x52fd7d){_0x2e6b16['push'](_0x2e6b16['shift']());}};_0x185c18(++_0x31c2fb);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x369829,_0x5149ad){_0x369829=_0x369829-0x0;var _0xb9c603=_0x7fbe[_0x369829];return _0xb9c603;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
+var _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','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','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0x56f9f8,_0x28498e){var _0x9728f3=function(_0x4c9295){while(--_0x4c9295){_0x56f9f8['push'](_0x56f9f8['shift']());}};_0x9728f3(++_0x28498e);}(_0x81bd,0x7c));var _0xd81b=function(_0x38af13,_0x3949a1){_0x38af13=_0x38af13-0x0;var _0x56a221=_0x81bd[_0x38af13];return _0x56a221;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 6d794ff..d823a31 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 _0x9206=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','AnalyticMetric','analytics_metrics'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9206,0x176));var _0x6920=function(_0x55efaf,_0x17d618){_0x55efaf=_0x55efaf-0x0;var _0x207bd2=_0x9206[_0x55efaf];return _0x207bd2;};'use strict';var _=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var logger=require(_0x6920('0x2'))(_0x6920('0x3'));var moment=require(_0x6920('0x4'));var BPromise=require(_0x6920('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6920('0x6'));var config=require(_0x6920('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x41c8c4,_0x4d67d7){return _0x41c8c4[_0x6920('0x8')](_0x6920('0x9'),attributes,{'tableName':_0x6920('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x90ec=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics'];(function(_0x599c94,_0x464f0e){var _0x34e215=function(_0x36295a){while(--_0x36295a){_0x599c94['push'](_0x599c94['shift']());}};_0x34e215(++_0x464f0e);}(_0x90ec,0x1d4));var _0xc90e=function(_0x4892f8,_0x26e8ff){_0x4892f8=_0x4892f8-0x0;var _0x524e2f=_0x90ec[_0x4892f8];return _0x524e2f;};'use strict';var _=require(_0xc90e('0x0'));var util=require(_0xc90e('0x1'));var logger=require('../../config/logger')(_0xc90e('0x2'));var moment=require(_0xc90e('0x3'));var BPromise=require(_0xc90e('0x4'));var rp=require(_0xc90e('0x5'));var fs=require('fs');var path=require(_0xc90e('0x6'));var rimraf=require('rimraf');var config=require(_0xc90e('0x7'));var attributes=require(_0xc90e('0x8'));module[_0xc90e('0x9')]=function(_0x54a0a8,_0x259c62){return _0x54a0a8['define'](_0xc90e('0xa'),attributes,{'tableName':_0xc90e('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 046d429..ef60029 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 _0x05a7=['../../config/logger','rpc','../../config/environment','http','request','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','AnalyticMetric,\x20%s,\x20%s','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x3a723e,_0x59d99a){var _0x3e9c03=function(_0x4a6947){while(--_0x4a6947){_0x3a723e['push'](_0x3a723e['shift']());}};_0x3e9c03(++_0x59d99a);}(_0x05a7,0x113));var _0x705a=function(_0x5cfb92,_0x5797e6){_0x5cfb92=_0x5cfb92-0x0;var _0x1cd7c2=_0x05a7[_0x5cfb92];return _0x1cd7c2;};'use strict';var _=require(_0x705a('0x0'));var util=require('util');var moment=require(_0x705a('0x1'));var BPromise=require(_0x705a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x705a('0x3'))['db'];var utils=require(_0x705a('0x4'));var logger=require(_0x705a('0x5'))(_0x705a('0x6'));var config=require(_0x705a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x705a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x398f75,_0x4a953e,_0x27eb98){return new BPromise(function(_0x5a9bd0,_0x57f622){return client[_0x705a('0x9')](_0x398f75,_0x27eb98)['then'](function(_0x101799){logger[_0x705a('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x4a953e,'request\x20sent');logger[_0x705a('0xb')](_0x705a('0xc'),_0x4a953e,_0x705a('0xd'),JSON[_0x705a('0xe')](_0x101799));if(_0x101799['error']){if(_0x101799['error'][_0x705a('0xf')]===0x1f4){logger[_0x705a('0x10')](_0x705a('0x11'),_0x4a953e,_0x101799[_0x705a('0x10')][_0x705a('0x12')]);return _0x57f622(_0x101799[_0x705a('0x10')][_0x705a('0x12')]);}logger[_0x705a('0x10')](_0x705a('0x11'),_0x4a953e,_0x101799['error'][_0x705a('0x12')]);return _0x5a9bd0(_0x101799[_0x705a('0x10')][_0x705a('0x12')]);}else{logger[_0x705a('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x4a953e,_0x705a('0xd'));_0x5a9bd0(_0x101799[_0x705a('0x13')][_0x705a('0x12')]);}})['catch'](function(_0xa3ec0b){logger[_0x705a('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x4a953e,_0xa3ec0b);_0x57f622(_0xa3ec0b);});});}
\ No newline at end of file
+var _0x9eb0=['result','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x25076c,_0x4a4a14){var _0x578937=function(_0x3be9bc){while(--_0x3be9bc){_0x25076c['push'](_0x25076c['shift']());}};_0x578937(++_0x4a4a14);}(_0x9eb0,0xd2));var _0x09eb=function(_0x22f458,_0x4a537b){_0x22f458=_0x22f458-0x0;var _0x3f0c85=_0x9eb0[_0x22f458];return _0x3f0c85;};'use strict';var _=require('lodash');var util=require(_0x09eb('0x0'));var moment=require(_0x09eb('0x1'));var BPromise=require(_0x09eb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x09eb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x09eb('0x4'));var logger=require(_0x09eb('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x09eb('0x6'));var client=jayson[_0x09eb('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9d203a,_0xd69198,_0x43efa5){return new BPromise(function(_0x51e6ac,_0x2e1aa1){return client['request'](_0x9d203a,_0x43efa5)[_0x09eb('0x8')](function(_0x108020){logger['info'](_0x09eb('0x9'),_0xd69198,_0x09eb('0xa'));logger[_0x09eb('0xb')](_0x09eb('0xc'),_0xd69198,'request\x20sent',JSON[_0x09eb('0xd')](_0x108020));if(_0x108020[_0x09eb('0xe')]){if(_0x108020[_0x09eb('0xe')][_0x09eb('0xf')]===0x1f4){logger[_0x09eb('0xe')](_0x09eb('0x9'),_0xd69198,_0x108020[_0x09eb('0xe')][_0x09eb('0x10')]);return _0x2e1aa1(_0x108020[_0x09eb('0xe')][_0x09eb('0x10')]);}logger[_0x09eb('0xe')](_0x09eb('0x9'),_0xd69198,_0x108020[_0x09eb('0xe')][_0x09eb('0x10')]);return _0x51e6ac(_0x108020['error'][_0x09eb('0x10')]);}else{logger[_0x09eb('0x11')](_0x09eb('0x9'),_0xd69198,_0x09eb('0xa'));_0x51e6ac(_0x108020[_0x09eb('0x12')][_0x09eb('0x10')]);}})['catch'](function(_0x562ad6){logger[_0x09eb('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0xd69198,_0x562ad6);_0x2e1aa1(_0x562ad6);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index e403636..9a1690d 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 _0x535d=['get','isAuthenticated','/:id','post','create','put','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x1c1815,_0x84870e){var _0x547581=function(_0x16acd9){while(--_0x16acd9){_0x1c1815['push'](_0x1c1815['shift']());}};_0x547581(++_0x84870e);}(_0x535d,0xe8));var _0xd535=function(_0x5da05a,_0x27fe46){_0x5da05a=_0x5da05a-0x0;var _0x1888ab=_0x535d[_0x5da05a];return _0x1888ab;};'use strict';var multer=require(_0xd535('0x0'));var util=require(_0xd535('0x1'));var path=require('path');var timeout=require(_0xd535('0x2'));var express=require(_0xd535('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd535('0x4'));var interaction=require(_0xd535('0x5'));var config=require(_0xd535('0x6'));var controller=require(_0xd535('0x7'));router[_0xd535('0x8')]('/',auth[_0xd535('0x9')](),controller['index']);router['get'](_0xd535('0xa'),auth[_0xd535('0x9')](),controller['show']);router[_0xd535('0xb')]('/',auth['isAuthenticated'](),controller[_0xd535('0xc')]);router[_0xd535('0xd')](_0xd535('0xa'),auth[_0xd535('0x9')](),controller['update']);router[_0xd535('0xe')](_0xd535('0xa'),auth[_0xd535('0x9')](),controller[_0xd535('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x9a14=['get','/:id','isAuthenticated','post','create','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x56b36f,_0x4429f4){var _0x5e24e5=function(_0x339508){while(--_0x339508){_0x56b36f['push'](_0x56b36f['shift']());}};_0x5e24e5(++_0x4429f4);}(_0x9a14,0xa8));var _0x49a1=function(_0x5034ad,_0x60d655){_0x5034ad=_0x5034ad-0x0;var _0x31d7a4=_0x9a14[_0x5034ad];return _0x31d7a4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49a1('0x0'));var timeout=require(_0x49a1('0x1'));var express=require(_0x49a1('0x2'));var router=express[_0x49a1('0x3')]();var fs_extra=require(_0x49a1('0x4'));var auth=require(_0x49a1('0x5'));var interaction=require(_0x49a1('0x6'));var config=require(_0x49a1('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x49a1('0x8')](_0x49a1('0x9'),auth[_0x49a1('0xa')](),controller['show']);router[_0x49a1('0xb')]('/',auth[_0x49a1('0xa')](),controller[_0x49a1('0xc')]);router['put'](_0x49a1('0x9'),auth[_0x49a1('0xa')](),controller['update']);router[_0x49a1('0xd')](_0x49a1('0x9'),auth[_0x49a1('0xa')](),controller[_0x49a1('0xe')]);module[_0x49a1('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 3c9b304..5b0c073 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 _0x79d5=['sequelize','TEXT'];(function(_0x2641b0,_0x36b5d0){var _0x54731f=function(_0x55e555){while(--_0x55e555){_0x2641b0['push'](_0x2641b0['shift']());}};_0x54731f(++_0x36b5d0);}(_0x79d5,0xa0));var _0x579d=function(_0x409fb8,_0x5ab3d3){_0x409fb8=_0x409fb8-0x0;var _0x278270=_0x79d5[_0x409fb8];return _0x278270;};'use strict';var Sequelize=require(_0x579d('0x0'));module['exports']={'tree':{'type':Sequelize[_0x579d('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x005c=['sequelize','TEXT'];(function(_0x299748,_0x1ad9d8){var _0x14ba0f=function(_0x3cf7af){while(--_0x3cf7af){_0x299748['push'](_0x299748['shift']());}};_0x14ba0f(++_0x1ad9d8);}(_0x005c,0x132));var _0xc005=function(_0x3a7d98,_0x1a7c63){_0x3a7d98=_0x3a7d98-0x0;var _0x59e881=_0x005c[_0x3a7d98];return _0x59e881;};'use strict';var Sequelize=require(_0xc005('0x0'));module['exports']={'tree':{'type':Sequelize[_0xc005('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 5aff35e..7aa3475 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 _0x6d32=['fields','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','length','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','stack','name','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6d32,0xec));var _0x26d3=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x6d32[_0x16b9ed];return _0x66b1f8;};'use strict';var emlformat=require(_0x26d3('0x0'));var rimraf=require(_0x26d3('0x1'));var zipdir=require(_0x26d3('0x2'));var jsonpatch=require(_0x26d3('0x3'));var rp=require(_0x26d3('0x4'));var moment=require('moment');var BPromise=require(_0x26d3('0x5'));var Mustache=require(_0x26d3('0x6'));var util=require(_0x26d3('0x7'));var path=require(_0x26d3('0x8'));var sox=require(_0x26d3('0x9'));var csv=require(_0x26d3('0xa'));var ejs=require(_0x26d3('0xb'));var fs=require('fs');var fs_extra=require(_0x26d3('0xc'));var _=require(_0x26d3('0xd'));var squel=require(_0x26d3('0xe'));var crypto=require(_0x26d3('0xf'));var jsforce=require(_0x26d3('0x10'));var deskjs=require(_0x26d3('0x11'));var toCsv=require(_0x26d3('0xa'));var querystring=require(_0x26d3('0x12'));var Papa=require(_0x26d3('0x13'));var Redis=require(_0x26d3('0x14'));var authService=require(_0x26d3('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x26d3('0x16'));var hardwareService=require(_0x26d3('0x17'));var logger=require(_0x26d3('0x18'))(_0x26d3('0x19'));var utils=require(_0x26d3('0x1a'));var config=require(_0x26d3('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x26d3('0x1c'))['db'];function respondWithStatusCode(_0x499264,_0x3f37bf){_0x3f37bf=_0x3f37bf||0xcc;return function(_0x439723){if(_0x439723){return _0x499264[_0x26d3('0x1d')](_0x3f37bf);}return _0x499264['status'](_0x3f37bf)['end']();};}function respondWithResult(_0x2c0434,_0x95bab0){_0x95bab0=_0x95bab0||0xc8;return function(_0x581f47){if(_0x581f47){return _0x2c0434[_0x26d3('0x1e')](_0x95bab0)[_0x26d3('0x1f')](_0x581f47);}};}function respondWithFilteredResult(_0x52a224,_0x3de04f){return function(_0x47f935){if(_0x47f935){var _0x12e0be=typeof _0x3de04f[_0x26d3('0x20')]===_0x26d3('0x21')&&typeof _0x3de04f[_0x26d3('0x22')]===_0x26d3('0x21');var _0xc26b55=_0x47f935[_0x26d3('0x23')];var _0x5b0caa=_0x12e0be?0x0:_0x3de04f['offset'];var _0x5ec453=_0x12e0be?_0x47f935[_0x26d3('0x23')]:_0x3de04f['offset']+_0x3de04f[_0x26d3('0x22')];var _0x4b281a;if(_0x5ec453>=_0xc26b55){_0x5ec453=_0xc26b55;_0x4b281a=0xc8;}else{_0x4b281a=0xce;}_0x52a224[_0x26d3('0x1e')](_0x4b281a);return _0x52a224[_0x26d3('0x24')](_0x26d3('0x25'),_0x5b0caa+'-'+_0x5ec453+'/'+_0xc26b55)[_0x26d3('0x1f')](_0x47f935);}return null;};}function patchUpdates(_0x266436){return function(_0xb3051e){try{jsonpatch[_0x26d3('0x26')](_0xb3051e,_0x266436,!![]);}catch(_0x4ed25c){return BPromise[_0x26d3('0x27')](_0x4ed25c);}return _0xb3051e['save']();};}function saveUpdates(_0x31ea87,_0x502f41){return function(_0x187785){if(_0x187785){return _0x187785['update'](_0x31ea87)[_0x26d3('0x28')](function(_0x3d2a1a){return _0x3d2a1a;});}return null;};}function removeEntity(_0xe595a9,_0x1e4afd){return function(_0xac1829){if(_0xac1829){return _0xac1829['destroy']()[_0x26d3('0x28')](function(){_0xe595a9[_0x26d3('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x161a5c,_0x15625f){return function(_0x44d098){if(!_0x44d098){_0x161a5c[_0x26d3('0x1d')](0x194);}return _0x44d098;};}function handleError(_0x31fddd,_0x4e2e49){_0x4e2e49=_0x4e2e49||0x1f4;return function(_0x58cb70){logger['error'](_0x58cb70[_0x26d3('0x29')]);if(_0x58cb70['name']){delete _0x58cb70[_0x26d3('0x2a')];}_0x31fddd[_0x26d3('0x1e')](_0x4e2e49)['send'](_0x58cb70);};}exports[_0x26d3('0x2b')]=function(_0x3f0633,_0x317f19){var _0x24c3f8={},_0x332ca3={},_0x2e6d34={'count':0x0,'rows':[]};var _0x3163cf=_['map'](db[_0x26d3('0x2c')][_0x26d3('0x2d')],function(_0x10cc47){return{'name':_0x10cc47[_0x26d3('0x2e')],'type':_0x10cc47[_0x26d3('0x2f')][_0x26d3('0x30')]};});_0x332ca3[_0x26d3('0x31')]=_[_0x26d3('0x32')](_0x3163cf,_0x26d3('0x2a'));_0x332ca3[_0x26d3('0x33')]=_[_0x26d3('0x34')](_0x3f0633[_0x26d3('0x33')]);_0x332ca3[_0x26d3('0x35')]=_[_0x26d3('0x36')](_0x332ca3['model'],_0x332ca3[_0x26d3('0x33')]);_0x24c3f8[_0x26d3('0x37')]=_[_0x26d3('0x36')](_0x332ca3['model'],qs[_0x26d3('0x38')](_0x3f0633[_0x26d3('0x33')]['fields']));_0x24c3f8[_0x26d3('0x37')]=_0x24c3f8[_0x26d3('0x37')]['length']?_0x24c3f8[_0x26d3('0x37')]:_0x332ca3[_0x26d3('0x31')];if(!_0x3f0633['query']['hasOwnProperty']('nolimit')){_0x24c3f8[_0x26d3('0x22')]=qs[_0x26d3('0x22')](_0x3f0633[_0x26d3('0x33')][_0x26d3('0x22')]);_0x24c3f8[_0x26d3('0x20')]=qs[_0x26d3('0x20')](_0x3f0633[_0x26d3('0x33')][_0x26d3('0x20')]);}_0x24c3f8['order']=qs['sort'](_0x3f0633['query'][_0x26d3('0x39')]);_0x24c3f8[_0x26d3('0x3a')]=qs[_0x26d3('0x35')](_[_0x26d3('0x3b')](_0x3f0633['query'],_0x332ca3[_0x26d3('0x35')]),_0x3163cf);if(_0x3f0633[_0x26d3('0x33')][_0x26d3('0x3c')]){_0x24c3f8[_0x26d3('0x3a')]=_[_0x26d3('0x3d')](_0x24c3f8['where'],{'$or':_[_0x26d3('0x32')](_0x3163cf,function(_0x4ae517){if(_0x4ae517['type']!==_0x26d3('0x3e')){var _0xca54ae={};_0xca54ae[_0x4ae517[_0x26d3('0x2a')]]={'$like':'%'+_0x3f0633[_0x26d3('0x33')][_0x26d3('0x3c')]+'%'};return _0xca54ae;}})});}_0x24c3f8=_['merge']({},_0x24c3f8,_0x3f0633['options']);var _0x26f36a={'where':_0x24c3f8['where']};return db[_0x26d3('0x2c')]['count'](_0x26f36a)['then'](function(_0x3d2866){_0x2e6d34[_0x26d3('0x23')]=_0x3d2866;if(_0x3f0633[_0x26d3('0x33')][_0x26d3('0x3f')]){_0x24c3f8[_0x26d3('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x24c3f8);})[_0x26d3('0x28')](function(_0x2ecdc6){_0x2e6d34['rows']=_0x2ecdc6;return _0x2e6d34;})['then'](respondWithFilteredResult(_0x317f19,_0x24c3f8))[_0x26d3('0x41')](handleError(_0x317f19,null));};exports[_0x26d3('0x42')]=function(_0x5d0a9b,_0x27be24){var _0x129fe7={'raw':!![],'where':{'id':_0x5d0a9b['params']['id']}},_0x8aa682={};_0x8aa682[_0x26d3('0x31')]=_['keys'](db[_0x26d3('0x2c')]['rawAttributes']);_0x8aa682[_0x26d3('0x33')]=_[_0x26d3('0x34')](_0x5d0a9b[_0x26d3('0x33')]);_0x8aa682[_0x26d3('0x35')]=_[_0x26d3('0x36')](_0x8aa682[_0x26d3('0x31')],_0x8aa682[_0x26d3('0x33')]);_0x129fe7[_0x26d3('0x37')]=_[_0x26d3('0x36')](_0x8aa682[_0x26d3('0x31')],qs[_0x26d3('0x38')](_0x5d0a9b[_0x26d3('0x33')][_0x26d3('0x38')]));_0x129fe7[_0x26d3('0x37')]=_0x129fe7[_0x26d3('0x37')][_0x26d3('0x43')]?_0x129fe7[_0x26d3('0x37')]:_0x8aa682[_0x26d3('0x31')];if(_0x5d0a9b[_0x26d3('0x33')]['includeAll']){_0x129fe7[_0x26d3('0x40')]=[{'all':!![]}];}_0x129fe7=_[_0x26d3('0x3d')]({},_0x129fe7,_0x5d0a9b[_0x26d3('0x44')]);return db['AnalyticTreeReport'][_0x26d3('0x45')](_0x129fe7)[_0x26d3('0x28')](handleEntityNotFound(_0x27be24,null))['then'](respondWithResult(_0x27be24,null))['catch'](handleError(_0x27be24,null));};exports[_0x26d3('0x46')]=function(_0x4b951f,_0x44f0f7){return db[_0x26d3('0x2c')]['create'](_0x4b951f['body'],{})[_0x26d3('0x28')](respondWithResult(_0x44f0f7,0xc9))[_0x26d3('0x41')](handleError(_0x44f0f7,null));};exports['update']=function(_0x547fa4,_0x1e05f3){if(_0x547fa4[_0x26d3('0x47')]['id']){delete _0x547fa4[_0x26d3('0x47')]['id'];}return db[_0x26d3('0x2c')][_0x26d3('0x45')]({'where':{'id':_0x547fa4[_0x26d3('0x48')]['id']}})['then'](handleEntityNotFound(_0x1e05f3,null))[_0x26d3('0x28')](saveUpdates(_0x547fa4[_0x26d3('0x47')],null))['then'](respondWithResult(_0x1e05f3,null))[_0x26d3('0x41')](handleError(_0x1e05f3,null));};exports['destroy']=function(_0x3fcaf0,_0x4784ff){return db[_0x26d3('0x2c')]['find']({'where':{'id':_0x3fcaf0[_0x26d3('0x48')]['id']}})['then'](handleEntityNotFound(_0x4784ff,null))['then'](removeEntity(_0x4784ff,null))[_0x26d3('0x41')](handleError(_0x4784ff,null));};
\ No newline at end of file
+var _0xb31d=['fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','then','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','apply','save','update','destroy','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes'];(function(_0x39b1f,_0x55ada0){var _0x4b4ead=function(_0xfaf2d5){while(--_0xfaf2d5){_0x39b1f['push'](_0x39b1f['shift']());}};_0x4b4ead(++_0x55ada0);}(_0xb31d,0x1d9));var _0xdb31=function(_0x3358cd,_0x284839){_0x3358cd=_0x3358cd-0x0;var _0xd08bf3=_0xb31d[_0x3358cd];return _0xd08bf3;};'use strict';var emlformat=require(_0xdb31('0x0'));var rimraf=require(_0xdb31('0x1'));var zipdir=require(_0xdb31('0x2'));var jsonpatch=require(_0xdb31('0x3'));var rp=require(_0xdb31('0x4'));var moment=require('moment');var BPromise=require(_0xdb31('0x5'));var Mustache=require(_0xdb31('0x6'));var util=require(_0xdb31('0x7'));var path=require('path');var sox=require(_0xdb31('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb31('0x9'));var _=require(_0xdb31('0xa'));var squel=require(_0xdb31('0xb'));var crypto=require(_0xdb31('0xc'));var jsforce=require(_0xdb31('0xd'));var deskjs=require(_0xdb31('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdb31('0xf'));var Papa=require(_0xdb31('0x10'));var Redis=require('ioredis');var authService=require(_0xdb31('0x11'));var qs=require(_0xdb31('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb31('0x13'));var logger=require(_0xdb31('0x14'))(_0xdb31('0x15'));var utils=require(_0xdb31('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdb31('0x17'));var db=require(_0xdb31('0x18'))['db'];function respondWithStatusCode(_0x307eac,_0x55ad07){_0x55ad07=_0x55ad07||0xcc;return function(_0x435284){if(_0x435284){return _0x307eac[_0xdb31('0x19')](_0x55ad07);}return _0x307eac[_0xdb31('0x1a')](_0x55ad07)[_0xdb31('0x1b')]();};}function respondWithResult(_0x196ba2,_0xc47f96){_0xc47f96=_0xc47f96||0xc8;return function(_0x49e006){if(_0x49e006){return _0x196ba2[_0xdb31('0x1a')](_0xc47f96)[_0xdb31('0x1c')](_0x49e006);}};}function respondWithFilteredResult(_0x249a09,_0x27329d){return function(_0x53af35){if(_0x53af35){var _0x5ca648=typeof _0x27329d['offset']==='undefined'&&typeof _0x27329d[_0xdb31('0x1d')]==='undefined';var _0x51a902=_0x53af35[_0xdb31('0x1e')];var _0x3ace97=_0x5ca648?0x0:_0x27329d[_0xdb31('0x1f')];var _0xb4131e=_0x5ca648?_0x53af35['count']:_0x27329d[_0xdb31('0x1f')]+_0x27329d['limit'];var _0x663c47;if(_0xb4131e>=_0x51a902){_0xb4131e=_0x51a902;_0x663c47=0xc8;}else{_0x663c47=0xce;}_0x249a09[_0xdb31('0x1a')](_0x663c47);return _0x249a09[_0xdb31('0x20')]('Content-Range',_0x3ace97+'-'+_0xb4131e+'/'+_0x51a902)[_0xdb31('0x1c')](_0x53af35);}return null;};}function patchUpdates(_0x1d1c41){return function(_0x2b4a71){try{jsonpatch[_0xdb31('0x21')](_0x2b4a71,_0x1d1c41,!![]);}catch(_0x880fba){return BPromise['reject'](_0x880fba);}return _0x2b4a71[_0xdb31('0x22')]();};}function saveUpdates(_0x5773f6,_0x3435d8){return function(_0xa59dd){if(_0xa59dd){return _0xa59dd[_0xdb31('0x23')](_0x5773f6)['then'](function(_0xd16243){return _0xd16243;});}return null;};}function removeEntity(_0x4f695c,_0x8bce12){return function(_0x312ec4){if(_0x312ec4){return _0x312ec4[_0xdb31('0x24')]()['then'](function(){_0x4f695c[_0xdb31('0x1a')](0xcc)[_0xdb31('0x1b')]();});}};}function handleEntityNotFound(_0x3e239b,_0x8ced99){return function(_0x2f781c){if(!_0x2f781c){_0x3e239b[_0xdb31('0x19')](0x194);}return _0x2f781c;};}function handleError(_0x51f7d7,_0x41ae0b){_0x41ae0b=_0x41ae0b||0x1f4;return function(_0x46d7e6){logger[_0xdb31('0x25')](_0x46d7e6['stack']);if(_0x46d7e6[_0xdb31('0x26')]){delete _0x46d7e6[_0xdb31('0x26')];}_0x51f7d7[_0xdb31('0x1a')](_0x41ae0b)[_0xdb31('0x27')](_0x46d7e6);};}exports[_0xdb31('0x28')]=function(_0x42849a,_0x1b35c8){var _0x45d83f={},_0x5e6b64={},_0x201776={'count':0x0,'rows':[]};var _0x3b0313=_[_0xdb31('0x29')](db[_0xdb31('0x2a')][_0xdb31('0x2b')],function(_0x4d85fe){return{'name':_0x4d85fe[_0xdb31('0x2c')],'type':_0x4d85fe['type'][_0xdb31('0x2d')]};});_0x5e6b64[_0xdb31('0x2e')]=_[_0xdb31('0x29')](_0x3b0313,_0xdb31('0x26'));_0x5e6b64['query']=_[_0xdb31('0x2f')](_0x42849a[_0xdb31('0x30')]);_0x5e6b64[_0xdb31('0x31')]=_[_0xdb31('0x32')](_0x5e6b64[_0xdb31('0x2e')],_0x5e6b64['query']);_0x45d83f[_0xdb31('0x33')]=_['intersection'](_0x5e6b64[_0xdb31('0x2e')],qs[_0xdb31('0x34')](_0x42849a[_0xdb31('0x30')]['fields']));_0x45d83f['attributes']=_0x45d83f[_0xdb31('0x33')][_0xdb31('0x35')]?_0x45d83f[_0xdb31('0x33')]:_0x5e6b64[_0xdb31('0x2e')];if(!_0x42849a['query'][_0xdb31('0x36')](_0xdb31('0x37'))){_0x45d83f['limit']=qs['limit'](_0x42849a[_0xdb31('0x30')][_0xdb31('0x1d')]);_0x45d83f['offset']=qs['offset'](_0x42849a['query'][_0xdb31('0x1f')]);}_0x45d83f['order']=qs[_0xdb31('0x38')](_0x42849a[_0xdb31('0x30')]['sort']);_0x45d83f[_0xdb31('0x39')]=qs[_0xdb31('0x31')](_[_0xdb31('0x3a')](_0x42849a[_0xdb31('0x30')],_0x5e6b64[_0xdb31('0x31')]),_0x3b0313);if(_0x42849a[_0xdb31('0x30')][_0xdb31('0x3b')]){_0x45d83f[_0xdb31('0x39')]=_[_0xdb31('0x3c')](_0x45d83f[_0xdb31('0x39')],{'$or':_[_0xdb31('0x29')](_0x3b0313,function(_0x33c92b){if(_0x33c92b[_0xdb31('0x3d')]!==_0xdb31('0x3e')){var _0x1068b7={};_0x1068b7[_0x33c92b[_0xdb31('0x26')]]={'$like':'%'+_0x42849a[_0xdb31('0x30')]['filter']+'%'};return _0x1068b7;}})});}_0x45d83f=_[_0xdb31('0x3c')]({},_0x45d83f,_0x42849a[_0xdb31('0x3f')]);var _0x11bc8e={'where':_0x45d83f[_0xdb31('0x39')]};return db[_0xdb31('0x2a')][_0xdb31('0x1e')](_0x11bc8e)[_0xdb31('0x40')](function(_0x235b78){_0x201776[_0xdb31('0x1e')]=_0x235b78;if(_0x42849a[_0xdb31('0x30')]['includeAll']){_0x45d83f[_0xdb31('0x41')]=[{'all':!![]}];}return db[_0xdb31('0x2a')][_0xdb31('0x42')](_0x45d83f);})['then'](function(_0x346343){_0x201776[_0xdb31('0x43')]=_0x346343;return _0x201776;})[_0xdb31('0x40')](respondWithFilteredResult(_0x1b35c8,_0x45d83f))[_0xdb31('0x44')](handleError(_0x1b35c8,null));};exports[_0xdb31('0x45')]=function(_0x5df42e,_0x3140df){var _0xd43eb6={'raw':!![],'where':{'id':_0x5df42e[_0xdb31('0x46')]['id']}},_0x5a2694={};_0x5a2694[_0xdb31('0x2e')]=_['keys'](db['AnalyticTreeReport']['rawAttributes']);_0x5a2694[_0xdb31('0x30')]=_['keys'](_0x5df42e[_0xdb31('0x30')]);_0x5a2694[_0xdb31('0x31')]=_[_0xdb31('0x32')](_0x5a2694['model'],_0x5a2694[_0xdb31('0x30')]);_0xd43eb6[_0xdb31('0x33')]=_['intersection'](_0x5a2694[_0xdb31('0x2e')],qs[_0xdb31('0x34')](_0x5df42e[_0xdb31('0x30')][_0xdb31('0x34')]));_0xd43eb6['attributes']=_0xd43eb6['attributes'][_0xdb31('0x35')]?_0xd43eb6[_0xdb31('0x33')]:_0x5a2694['model'];if(_0x5df42e['query'][_0xdb31('0x47')]){_0xd43eb6[_0xdb31('0x41')]=[{'all':!![]}];}_0xd43eb6=_[_0xdb31('0x3c')]({},_0xd43eb6,_0x5df42e['options']);return db[_0xdb31('0x2a')][_0xdb31('0x48')](_0xd43eb6)[_0xdb31('0x40')](handleEntityNotFound(_0x3140df,null))[_0xdb31('0x40')](respondWithResult(_0x3140df,null))[_0xdb31('0x44')](handleError(_0x3140df,null));};exports[_0xdb31('0x49')]=function(_0x4d0aeb,_0x3cf1ca){return db[_0xdb31('0x2a')][_0xdb31('0x49')](_0x4d0aeb[_0xdb31('0x4a')],{})[_0xdb31('0x40')](respondWithResult(_0x3cf1ca,0xc9))[_0xdb31('0x44')](handleError(_0x3cf1ca,null));};exports['update']=function(_0xbf5231,_0x5af691){if(_0xbf5231[_0xdb31('0x4a')]['id']){delete _0xbf5231[_0xdb31('0x4a')]['id'];}return db[_0xdb31('0x2a')][_0xdb31('0x48')]({'where':{'id':_0xbf5231[_0xdb31('0x46')]['id']}})['then'](handleEntityNotFound(_0x5af691,null))[_0xdb31('0x40')](saveUpdates(_0xbf5231['body'],null))[_0xdb31('0x40')](respondWithResult(_0x5af691,null))[_0xdb31('0x44')](handleError(_0x5af691,null));};exports[_0xdb31('0x24')]=function(_0x763c9b,_0x3e6d57){return db[_0xdb31('0x2a')][_0xdb31('0x48')]({'where':{'id':_0x763c9b[_0xdb31('0x46')]['id']}})[_0xdb31('0x40')](handleEntityNotFound(_0x3e6d57,null))['then'](removeEntity(_0x3e6d57,null))['catch'](handleError(_0x3e6d57,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index b0cf79f..1ccd94d 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 _0xa5f5=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','bluebird','path'];(function(_0x2aebb2,_0x21f452){var _0x17406c=function(_0x7ae2df){while(--_0x7ae2df){_0x2aebb2['push'](_0x2aebb2['shift']());}};_0x17406c(++_0x21f452);}(_0xa5f5,0xe2));var _0x5a5f=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xa5f5[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x5a5f('0x0'));var util=require('util');var logger=require(_0x5a5f('0x1'))(_0x5a5f('0x2'));var moment=require('moment');var BPromise=require(_0x5a5f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a5f('0x4'));var rimraf=require(_0x5a5f('0x5'));var config=require(_0x5a5f('0x6'));var attributes=require(_0x5a5f('0x7'));module[_0x5a5f('0x8')]=function(_0x2b6739,_0x457ab1){return _0x2b6739['define'](_0x5a5f('0x9'),attributes,{'tableName':_0x5a5f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5d4e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger'];(function(_0x55ef8b,_0x5deb5e){var _0x359c84=function(_0x437673){while(--_0x437673){_0x55ef8b['push'](_0x55ef8b['shift']());}};_0x359c84(++_0x5deb5e);}(_0x5d4e,0xdd));var _0xe5d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5d4e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe5d4('0x0'));var util=require(_0xe5d4('0x1'));var logger=require(_0xe5d4('0x2'))(_0xe5d4('0x3'));var moment=require(_0xe5d4('0x4'));var BPromise=require(_0xe5d4('0x5'));var rp=require(_0xe5d4('0x6'));var fs=require('fs');var path=require(_0xe5d4('0x7'));var rimraf=require(_0xe5d4('0x8'));var config=require(_0xe5d4('0x9'));var attributes=require(_0xe5d4('0xa'));module[_0xe5d4('0xb')]=function(_0x46166a,_0x40c75e){return _0x46166a['define'](_0xe5d4('0xc'),attributes,{'tableName':_0xe5d4('0xd'),'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 c321bb0..1640a15 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x3f0573,_0x4029da){var _0x14e625=function(_0x502f51){while(--_0x502f51){_0x3f0573['push'](_0x3f0573['shift']());}};_0x14e625(++_0x4029da);}(_0xdb28,0x106));var _0x8db2=function(_0x2ae3d0,_0x454037){_0x2ae3d0=_0x2ae3d0-0x0;var _0xbfe1d5=_0xdb28[_0x2ae3d0];return _0xbfe1d5;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2c7197,_0x28a0d9){var _0x37327f=function(_0x52aac4){while(--_0x52aac4){_0x2c7197['push'](_0x2c7197['shift']());}};_0x37327f(++_0x28a0d9);}(_0x5f2f,0x73));var _0xf5f2=function(_0xc7c59d,_0x57c4c5){_0xc7c59d=_0xc7c59d-0x0;var _0x48a06e=_0x5f2f[_0xc7c59d];return _0x48a06e;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 52dee1f..1bee525 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 _0x8319=['put','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x1b7b53,_0x287249){var _0x3a440d=function(_0x23b4e3){while(--_0x23b4e3){_0x1b7b53['push'](_0x1b7b53['shift']());}};_0x3a440d(++_0x287249);}(_0x8319,0x113));var _0x9831=function(_0x21ad00,_0x4bb7ef){_0x21ad00=_0x21ad00-0x0;var _0x157ca2=_0x8319[_0x21ad00];return _0x157ca2;};'use strict';var multer=require('multer');var util=require(_0x9831('0x0'));var path=require(_0x9831('0x1'));var timeout=require(_0x9831('0x2'));var express=require('express');var router=express[_0x9831('0x3')]();var fs_extra=require(_0x9831('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9831('0x5'));var config=require('../../config/environment');var controller=require(_0x9831('0x6'));router[_0x9831('0x7')]('/',auth[_0x9831('0x8')](),controller[_0x9831('0x9')]);router['get'](_0x9831('0xa'),auth[_0x9831('0x8')](),controller[_0x9831('0xb')]);router[_0x9831('0xc')]('/',auth[_0x9831('0x8')](),controller[_0x9831('0xd')]);router[_0x9831('0xe')]('/:id',auth[_0x9831('0x8')](),controller['update']);router['delete'](_0x9831('0xa'),auth[_0x9831('0x8')](),controller[_0x9831('0xf')]);module[_0x9831('0x10')]=router;
\ No newline at end of file
+var _0xf13e=['../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show','post','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x29416f,_0x535a3a){var _0x2ce5cf=function(_0x5f2c13){while(--_0x5f2c13){_0x29416f['push'](_0x29416f['shift']());}};_0x2ce5cf(++_0x535a3a);}(_0xf13e,0xb5));var _0xef13=function(_0x20099a,_0x2bf584){_0x20099a=_0x20099a-0x0;var _0x2c3649=_0xf13e[_0x20099a];return _0x2c3649;};'use strict';var multer=require('multer');var util=require(_0xef13('0x0'));var path=require(_0xef13('0x1'));var timeout=require(_0xef13('0x2'));var express=require('express');var router=express[_0xef13('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xef13('0x4'));var interaction=require(_0xef13('0x5'));var config=require(_0xef13('0x6'));var controller=require(_0xef13('0x7'));router['get']('/',auth[_0xef13('0x8')](),controller[_0xef13('0x9')]);router[_0xef13('0xa')](_0xef13('0xb'),auth['isAuthenticated'](),controller[_0xef13('0xc')]);router[_0xef13('0xd')]('/',auth[_0xef13('0x8')](),controller['create']);router['put']('/:id',auth[_0xef13('0x8')](),controller['update']);router[_0xef13('0xe')](_0xef13('0xb'),auth[_0xef13('0x8')](),controller[_0xef13('0xf')]);module[_0xef13('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 c83c93e..fe095b7 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 _0xf3cd=['exports','STRING','sequelize'];(function(_0xe9abdb,_0x382970){var _0x56ec13=function(_0x2c1450){while(--_0x2c1450){_0xe9abdb['push'](_0xe9abdb['shift']());}};_0x56ec13(++_0x382970);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x230bb8,_0xa1718){_0x230bb8=_0x230bb8-0x0;var _0x16cb9a=_0xf3cd[_0x230bb8];return _0x16cb9a;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'name':{'type':Sequelize[_0xdf3c('0x2')]},'basename':{'type':Sequelize[_0xdf3c('0x2')]},'type':{'type':Sequelize[_0xdf3c('0x2')]}};
\ No newline at end of file
+var _0xaa19=['STRING','sequelize','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xaa19,0x79));var _0x9aa1=function(_0x278d67,_0x2ee210){_0x278d67=_0x278d67-0x0;var _0x119d7b=_0xaa19[_0x278d67];return _0x119d7b;};'use strict';var Sequelize=require(_0x9aa1('0x0'));module[_0x9aa1('0x1')]={'name':{'type':Sequelize[_0x9aa1('0x2')]},'basename':{'type':Sequelize[_0x9aa1('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 6105a36..223bb78 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 _0xbf29=['count','offset','set','Content-Range','apply','reject','then','destroy','sendStatus','error','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','Attachment','include','rows','catch','show','params','length','includeAll','find','get','createdAt','updatedAt','body','omit','create','file','originalname','basename','filename','ChatOfflineMessageId','join','root','server/files/attachments/','download','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xbf29,0x19d));var _0x9bf2=function(_0x3caa7c,_0x5eab01){_0x3caa7c=_0x3caa7c-0x0;var _0x5e90a3=_0xbf29[_0x3caa7c];return _0x5e90a3;};'use strict';var emlformat=require(_0x9bf2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9bf2('0x1'));var jsonpatch=require(_0x9bf2('0x2'));var rp=require(_0x9bf2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9bf2('0x4'));var util=require(_0x9bf2('0x5'));var path=require(_0x9bf2('0x6'));var sox=require(_0x9bf2('0x7'));var csv=require(_0x9bf2('0x8'));var ejs=require(_0x9bf2('0x9'));var fs=require('fs');var fs_extra=require(_0x9bf2('0xa'));var _=require(_0x9bf2('0xb'));var squel=require(_0x9bf2('0xc'));var crypto=require(_0x9bf2('0xd'));var jsforce=require(_0x9bf2('0xe'));var deskjs=require(_0x9bf2('0xf'));var toCsv=require(_0x9bf2('0x8'));var querystring=require('querystring');var Papa=require(_0x9bf2('0x10'));var Redis=require(_0x9bf2('0x11'));var authService=require(_0x9bf2('0x12'));var qs=require(_0x9bf2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9bf2('0x14'));var logger=require(_0x9bf2('0x15'))(_0x9bf2('0x16'));var utils=require(_0x9bf2('0x17'));var config=require(_0x9bf2('0x18'));var licenseUtil=require(_0x9bf2('0x19'));var db=require(_0x9bf2('0x1a'))['db'];function respondWithStatusCode(_0x839e7,_0x57a874){_0x57a874=_0x57a874||0xcc;return function(_0x98faeb){if(_0x98faeb){return _0x839e7['sendStatus'](_0x57a874);}return _0x839e7[_0x9bf2('0x1b')](_0x57a874)[_0x9bf2('0x1c')]();};}function respondWithResult(_0xd74f3b,_0x1b1c05){_0x1b1c05=_0x1b1c05||0xc8;return function(_0x165c49){if(_0x165c49){return _0xd74f3b[_0x9bf2('0x1b')](_0x1b1c05)[_0x9bf2('0x1d')](_0x165c49);}};}function respondWithFilteredResult(_0x2c0093,_0xdfc53f){return function(_0x430068){if(_0x430068){var _0x33c1f4=typeof _0xdfc53f['offset']===_0x9bf2('0x1e')&&typeof _0xdfc53f[_0x9bf2('0x1f')]===_0x9bf2('0x1e');var _0x2c5ee1=_0x430068[_0x9bf2('0x20')];var _0x172f92=_0x33c1f4?0x0:_0xdfc53f[_0x9bf2('0x21')];var _0x35c9a9=_0x33c1f4?_0x430068[_0x9bf2('0x20')]:_0xdfc53f['offset']+_0xdfc53f[_0x9bf2('0x1f')];var _0xd3ea3e;if(_0x35c9a9>=_0x2c5ee1){_0x35c9a9=_0x2c5ee1;_0xd3ea3e=0xc8;}else{_0xd3ea3e=0xce;}_0x2c0093['status'](_0xd3ea3e);return _0x2c0093[_0x9bf2('0x22')](_0x9bf2('0x23'),_0x172f92+'-'+_0x35c9a9+'/'+_0x2c5ee1)[_0x9bf2('0x1d')](_0x430068);}return null;};}function patchUpdates(_0x181bfc){return function(_0x257f36){try{jsonpatch[_0x9bf2('0x24')](_0x257f36,_0x181bfc,!![]);}catch(_0x17b5b6){return BPromise[_0x9bf2('0x25')](_0x17b5b6);}return _0x257f36['save']();};}function saveUpdates(_0x114e97,_0x5beaf5){return function(_0x29f397){if(_0x29f397){return _0x29f397['update'](_0x114e97)[_0x9bf2('0x26')](function(_0x316d6b){return _0x316d6b;});}return null;};}function removeEntity(_0x5be9ac,_0x3c003f){return function(_0x79a835){if(_0x79a835){return _0x79a835[_0x9bf2('0x27')]()['then'](function(){_0x5be9ac['status'](0xcc)[_0x9bf2('0x1c')]();});}};}function handleEntityNotFound(_0x489192,_0xe8d178){return function(_0x1671eb){if(!_0x1671eb){_0x489192[_0x9bf2('0x28')](0x194);}return _0x1671eb;};}function handleError(_0x227ecc,_0x286c8a){_0x286c8a=_0x286c8a||0x1f4;return function(_0x35974e){logger[_0x9bf2('0x29')](_0x35974e['stack']);if(_0x35974e[_0x9bf2('0x2a')]){delete _0x35974e['name'];}_0x227ecc[_0x9bf2('0x1b')](_0x286c8a)['send'](_0x35974e);};}exports[_0x9bf2('0x2b')]=function(_0xaba6c9,_0x5ee754){var _0x1ff510={},_0x7b434a={},_0x34f706={'count':0x0,'rows':[]};var _0x2bede6=_[_0x9bf2('0x2c')](db['Attachment'][_0x9bf2('0x2d')],function(_0x83ee5a){return{'name':_0x83ee5a[_0x9bf2('0x2e')],'type':_0x83ee5a['type'][_0x9bf2('0x2f')]};});_0x7b434a[_0x9bf2('0x30')]=_['map'](_0x2bede6,_0x9bf2('0x2a'));_0x7b434a[_0x9bf2('0x31')]=_[_0x9bf2('0x32')](_0xaba6c9['query']);_0x7b434a[_0x9bf2('0x33')]=_[_0x9bf2('0x34')](_0x7b434a['model'],_0x7b434a[_0x9bf2('0x31')]);_0x1ff510['attributes']=_[_0x9bf2('0x34')](_0x7b434a['model'],qs[_0x9bf2('0x35')](_0xaba6c9[_0x9bf2('0x31')][_0x9bf2('0x35')]));_0x1ff510[_0x9bf2('0x36')]=_0x1ff510[_0x9bf2('0x36')]['length']?_0x1ff510['attributes']:_0x7b434a[_0x9bf2('0x30')];if(!_0xaba6c9[_0x9bf2('0x31')][_0x9bf2('0x37')](_0x9bf2('0x38'))){_0x1ff510[_0x9bf2('0x1f')]=qs[_0x9bf2('0x1f')](_0xaba6c9[_0x9bf2('0x31')]['limit']);_0x1ff510['offset']=qs[_0x9bf2('0x21')](_0xaba6c9[_0x9bf2('0x31')][_0x9bf2('0x21')]);}_0x1ff510[_0x9bf2('0x39')]=qs[_0x9bf2('0x3a')](_0xaba6c9['query'][_0x9bf2('0x3a')]);_0x1ff510[_0x9bf2('0x3b')]=qs['filters'](_['pick'](_0xaba6c9['query'],_0x7b434a['filters']),_0x2bede6);if(_0xaba6c9[_0x9bf2('0x31')][_0x9bf2('0x3c')]){_0x1ff510[_0x9bf2('0x3b')]=_[_0x9bf2('0x3d')](_0x1ff510['where'],{'$or':_[_0x9bf2('0x2c')](_0x2bede6,function(_0x3ca6b3){if(_0x3ca6b3[_0x9bf2('0x3e')]!==_0x9bf2('0x3f')){var _0x16aa4e={};_0x16aa4e[_0x3ca6b3['name']]={'$like':'%'+_0xaba6c9[_0x9bf2('0x31')]['filter']+'%'};return _0x16aa4e;}})});}_0x1ff510=_['merge']({},_0x1ff510,_0xaba6c9[_0x9bf2('0x40')]);var _0x651cd7={'where':_0x1ff510[_0x9bf2('0x3b')]};return db[_0x9bf2('0x41')][_0x9bf2('0x20')](_0x651cd7)['then'](function(_0x4dc4a7){_0x34f706[_0x9bf2('0x20')]=_0x4dc4a7;if(_0xaba6c9[_0x9bf2('0x31')]['includeAll']){_0x1ff510[_0x9bf2('0x42')]=[{'all':!![]}];}return db[_0x9bf2('0x41')]['findAll'](_0x1ff510);})[_0x9bf2('0x26')](function(_0x282264){_0x34f706[_0x9bf2('0x43')]=_0x282264;return _0x34f706;})[_0x9bf2('0x26')](respondWithFilteredResult(_0x5ee754,_0x1ff510))[_0x9bf2('0x44')](handleError(_0x5ee754,null));};exports[_0x9bf2('0x45')]=function(_0x4c6d4b,_0x3d07b9){var _0x102e9c={'raw':!![],'where':{'id':_0x4c6d4b[_0x9bf2('0x46')]['id']}},_0x372014={};_0x372014[_0x9bf2('0x30')]=_[_0x9bf2('0x32')](db['Attachment'][_0x9bf2('0x2d')]);_0x372014['query']=_['keys'](_0x4c6d4b['query']);_0x372014[_0x9bf2('0x33')]=_['intersection'](_0x372014[_0x9bf2('0x30')],_0x372014[_0x9bf2('0x31')]);_0x102e9c[_0x9bf2('0x36')]=_[_0x9bf2('0x34')](_0x372014['model'],qs['fields'](_0x4c6d4b[_0x9bf2('0x31')][_0x9bf2('0x35')]));_0x102e9c[_0x9bf2('0x36')]=_0x102e9c[_0x9bf2('0x36')][_0x9bf2('0x47')]?_0x102e9c[_0x9bf2('0x36')]:_0x372014[_0x9bf2('0x30')];if(_0x4c6d4b[_0x9bf2('0x31')][_0x9bf2('0x48')]){_0x102e9c[_0x9bf2('0x42')]=[{'all':!![]}];}_0x102e9c=_['merge']({},_0x102e9c,_0x4c6d4b[_0x9bf2('0x40')]);return db[_0x9bf2('0x41')][_0x9bf2('0x49')](_0x102e9c)[_0x9bf2('0x26')](handleEntityNotFound(_0x3d07b9,null))[_0x9bf2('0x26')](respondWithResult(_0x3d07b9,null))[_0x9bf2('0x44')](handleError(_0x3d07b9,null));};exports['clone']=function(_0x51561e,_0x2d7cbd){var _0x4b2a8a={'where':{'id':_0x51561e['params']['id']}},_0x2d7d7d={};_0x2d7d7d[_0x9bf2('0x30')]=_[_0x9bf2('0x32')](db[_0x9bf2('0x41')][_0x9bf2('0x2d')]);_0x4b2a8a[_0x9bf2('0x36')]=_[_0x9bf2('0x34')](_0x2d7d7d[_0x9bf2('0x30')],qs[_0x9bf2('0x35')](_0x51561e[_0x9bf2('0x31')][_0x9bf2('0x35')]));_0x4b2a8a['attributes']=_0x4b2a8a[_0x9bf2('0x36')]['length']?_0x4b2a8a[_0x9bf2('0x36')]:_0x2d7d7d['model'];if(_0x51561e['query'][_0x9bf2('0x48')]){_0x4b2a8a['include']=[{'all':!![]}];}_0x4b2a8a=_['merge']({},_0x4b2a8a,_0x51561e[_0x9bf2('0x40')]);return db['Attachment'][_0x9bf2('0x49')](_0x4b2a8a)[_0x9bf2('0x26')](handleEntityNotFound(_0x2d7cbd,null))[_0x9bf2('0x26')](function(_0x4bfbe3){if(_0x4bfbe3){var _0x3715fe=_0x4bfbe3[_0x9bf2('0x4a')]({'plain':!![]});_0x3715fe=qs['omit'](_0x3715fe,['id',_0x9bf2('0x4b'),_0x9bf2('0x4c')]);_0x51561e[_0x9bf2('0x4d')]=_[_0x9bf2('0x4e')](_0x51561e[_0x9bf2('0x4d')],['id',_0x9bf2('0x4b'),_0x9bf2('0x4c')]);return db['Attachment'][_0x9bf2('0x4f')](_['merge'](_0x3715fe,_0x51561e[_0x9bf2('0x4d')]),{'include':_0x51561e['query'][_0x9bf2('0x48')]?[{'all':!![]}]:undefined});}})[_0x9bf2('0x26')](respondWithResult(_0x2d7cbd,0xc9))[_0x9bf2('0x44')](handleError(_0x2d7cbd,null));};exports['update']=function(_0x28d18c,_0x549eb3){if(_0x28d18c[_0x9bf2('0x4d')]['id']){delete _0x28d18c[_0x9bf2('0x4d')]['id'];}return db[_0x9bf2('0x41')][_0x9bf2('0x49')]({'where':{'id':_0x28d18c[_0x9bf2('0x46')]['id']}})['then'](handleEntityNotFound(_0x549eb3,null))[_0x9bf2('0x26')](saveUpdates(_0x28d18c['body'],null))[_0x9bf2('0x26')](respondWithResult(_0x549eb3,null))[_0x9bf2('0x44')](handleError(_0x549eb3,null));};exports[_0x9bf2('0x27')]=function(_0x9e48d7,_0x4098e7){return db[_0x9bf2('0x41')][_0x9bf2('0x49')]({'where':{'id':_0x9e48d7[_0x9bf2('0x46')]['id']}})[_0x9bf2('0x26')](handleEntityNotFound(_0x4098e7,null))[_0x9bf2('0x26')](removeEntity(_0x4098e7,null))['catch'](handleError(_0x4098e7,null));};exports[_0x9bf2('0x4f')]=function(_0x2c4f25,_0x3faf2f,_0x200b8f){_0x2c4f25['body'][_0x9bf2('0x2a')]=_0x2c4f25[_0x9bf2('0x50')][_0x9bf2('0x51')];_0x2c4f25[_0x9bf2('0x4d')][_0x9bf2('0x52')]=_0x2c4f25['file'][_0x9bf2('0x53')];_0x2c4f25[_0x9bf2('0x4d')][_0x9bf2('0x3e')]=_0x2c4f25[_0x9bf2('0x50')]['mimetype'];return db[_0x9bf2('0x41')][_0x9bf2('0x4f')](_0x2c4f25['body'])['then'](respondWithResult(_0x3faf2f,0xc9))[_0x9bf2('0x44')](handleError(_0x3faf2f,null));};exports['download']=function(_0x261f5a,_0x151302,_0x97b594){return db[_0x9bf2('0x41')]['findOne']({'where':{'id':_0x261f5a[_0x9bf2('0x46')]['id']},'raw':!![]})[_0x9bf2('0x26')](handleEntityNotFound(_0x151302,null))['then'](function(_0x3c7c4c){if(_0x3c7c4c){var _0x22ccf7=_0x3c7c4c[_0x9bf2('0x54')]!==null;var _0x540b55=path[_0x9bf2('0x55')](config[_0x9bf2('0x56')],_0x9bf2('0x57'));if(_0x22ccf7){_0x540b55=path[_0x9bf2('0x55')](_0x540b55,'offline-chat/');}var _0x58cd7f=path[_0x9bf2('0x55')](_0x540b55,_0x3c7c4c[_0x9bf2('0x52')]);return _0x151302[_0x9bf2('0x58')](_0x58cd7f);}})[_0x9bf2('0x44')](handleError(_0x151302,null));};
\ No newline at end of file
+var _0x3bf9=['lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','sendStatus','stack','name','send','index','map','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','Attachment','includeAll','include','findAll','rows','then','catch','params','options','find','get','omit','createdAt','updatedAt','body','destroy','create','file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','bluebird','mustache','path','to-csv','ejs','fs-extra'];(function(_0x136a09,_0x39d148){var _0x188564=function(_0x2c9a3c){while(--_0x2c9a3c){_0x136a09['push'](_0x136a09['shift']());}};_0x188564(++_0x39d148);}(_0x3bf9,0xf4));var _0x93bf=function(_0x4c32f5,_0x3dbbf1){_0x4c32f5=_0x4c32f5-0x0;var _0x19cae9=_0x3bf9[_0x4c32f5];return _0x19cae9;};'use strict';var emlformat=require(_0x93bf('0x0'));var rimraf=require(_0x93bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x93bf('0x2'));var Mustache=require(_0x93bf('0x3'));var util=require('util');var path=require(_0x93bf('0x4'));var sox=require('sox');var csv=require(_0x93bf('0x5'));var ejs=require(_0x93bf('0x6'));var fs=require('fs');var fs_extra=require(_0x93bf('0x7'));var _=require(_0x93bf('0x8'));var squel=require('squel');var crypto=require(_0x93bf('0x9'));var jsforce=require(_0x93bf('0xa'));var deskjs=require(_0x93bf('0xb'));var toCsv=require(_0x93bf('0x5'));var querystring=require(_0x93bf('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x93bf('0xd'));var qs=require(_0x93bf('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x93bf('0xf'));var logger=require(_0x93bf('0x10'))(_0x93bf('0x11'));var utils=require(_0x93bf('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x93bf('0x13'))['db'];function respondWithStatusCode(_0x6d3f99,_0x2e56c8){_0x2e56c8=_0x2e56c8||0xcc;return function(_0x9ec6d0){if(_0x9ec6d0){return _0x6d3f99['sendStatus'](_0x2e56c8);}return _0x6d3f99['status'](_0x2e56c8)[_0x93bf('0x14')]();};}function respondWithResult(_0x1280b2,_0x2b19b0){_0x2b19b0=_0x2b19b0||0xc8;return function(_0xbeb215){if(_0xbeb215){return _0x1280b2[_0x93bf('0x15')](_0x2b19b0)[_0x93bf('0x16')](_0xbeb215);}};}function respondWithFilteredResult(_0x1cfc1b,_0x24eb6f){return function(_0x4cec80){if(_0x4cec80){var _0x341592=typeof _0x24eb6f[_0x93bf('0x17')]===_0x93bf('0x18')&&typeof _0x24eb6f[_0x93bf('0x19')]===_0x93bf('0x18');var _0x53f013=_0x4cec80[_0x93bf('0x1a')];var _0xa00f9b=_0x341592?0x0:_0x24eb6f[_0x93bf('0x17')];var _0x3d5b6d=_0x341592?_0x4cec80[_0x93bf('0x1a')]:_0x24eb6f[_0x93bf('0x17')]+_0x24eb6f[_0x93bf('0x19')];var _0x4942ea;if(_0x3d5b6d>=_0x53f013){_0x3d5b6d=_0x53f013;_0x4942ea=0xc8;}else{_0x4942ea=0xce;}_0x1cfc1b[_0x93bf('0x15')](_0x4942ea);return _0x1cfc1b[_0x93bf('0x1b')](_0x93bf('0x1c'),_0xa00f9b+'-'+_0x3d5b6d+'/'+_0x53f013)['json'](_0x4cec80);}return null;};}function patchUpdates(_0xaf649b){return function(_0x52f884){try{jsonpatch['apply'](_0x52f884,_0xaf649b,!![]);}catch(_0x4dab5b){return BPromise['reject'](_0x4dab5b);}return _0x52f884[_0x93bf('0x1d')]();};}function saveUpdates(_0x280abd,_0x3f4831){return function(_0x47180e){if(_0x47180e){return _0x47180e[_0x93bf('0x1e')](_0x280abd)['then'](function(_0x2347f1){return _0x2347f1;});}return null;};}function removeEntity(_0x4aeb2b,_0x37b841){return function(_0x3165e2){if(_0x3165e2){return _0x3165e2['destroy']()['then'](function(){_0x4aeb2b[_0x93bf('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53453e,_0x183f0d){return function(_0x554b6a){if(!_0x554b6a){_0x53453e[_0x93bf('0x1f')](0x194);}return _0x554b6a;};}function handleError(_0x3b92d0,_0x159d62){_0x159d62=_0x159d62||0x1f4;return function(_0x1f1090){logger['error'](_0x1f1090[_0x93bf('0x20')]);if(_0x1f1090[_0x93bf('0x21')]){delete _0x1f1090[_0x93bf('0x21')];}_0x3b92d0['status'](_0x159d62)[_0x93bf('0x22')](_0x1f1090);};}exports[_0x93bf('0x23')]=function(_0x5e9a8a,_0x4fa684){var _0x5b13fe={},_0x59d61a={},_0x4966fe={'count':0x0,'rows':[]};var _0x1e1686=_[_0x93bf('0x24')](db['Attachment'][_0x93bf('0x25')],function(_0xd80a1c){return{'name':_0xd80a1c['fieldName'],'type':_0xd80a1c['type'][_0x93bf('0x26')]};});_0x59d61a['model']=_[_0x93bf('0x24')](_0x1e1686,_0x93bf('0x21'));_0x59d61a[_0x93bf('0x27')]=_[_0x93bf('0x28')](_0x5e9a8a[_0x93bf('0x27')]);_0x59d61a[_0x93bf('0x29')]=_['intersection'](_0x59d61a[_0x93bf('0x2a')],_0x59d61a[_0x93bf('0x27')]);_0x5b13fe[_0x93bf('0x2b')]=_[_0x93bf('0x2c')](_0x59d61a[_0x93bf('0x2a')],qs[_0x93bf('0x2d')](_0x5e9a8a['query'][_0x93bf('0x2d')]));_0x5b13fe[_0x93bf('0x2b')]=_0x5b13fe['attributes'][_0x93bf('0x2e')]?_0x5b13fe[_0x93bf('0x2b')]:_0x59d61a[_0x93bf('0x2a')];if(!_0x5e9a8a[_0x93bf('0x27')][_0x93bf('0x2f')]('nolimit')){_0x5b13fe[_0x93bf('0x19')]=qs[_0x93bf('0x19')](_0x5e9a8a['query'][_0x93bf('0x19')]);_0x5b13fe[_0x93bf('0x17')]=qs[_0x93bf('0x17')](_0x5e9a8a[_0x93bf('0x27')][_0x93bf('0x17')]);}_0x5b13fe[_0x93bf('0x30')]=qs[_0x93bf('0x31')](_0x5e9a8a[_0x93bf('0x27')][_0x93bf('0x31')]);_0x5b13fe[_0x93bf('0x32')]=qs[_0x93bf('0x29')](_[_0x93bf('0x33')](_0x5e9a8a[_0x93bf('0x27')],_0x59d61a[_0x93bf('0x29')]),_0x1e1686);if(_0x5e9a8a[_0x93bf('0x27')]['filter']){_0x5b13fe[_0x93bf('0x32')]=_[_0x93bf('0x34')](_0x5b13fe[_0x93bf('0x32')],{'$or':_[_0x93bf('0x24')](_0x1e1686,function(_0x5b4fd9){if(_0x5b4fd9[_0x93bf('0x35')]!==_0x93bf('0x36')){var _0x593913={};_0x593913[_0x5b4fd9[_0x93bf('0x21')]]={'$like':'%'+_0x5e9a8a['query'][_0x93bf('0x37')]+'%'};return _0x593913;}})});}_0x5b13fe=_[_0x93bf('0x34')]({},_0x5b13fe,_0x5e9a8a['options']);var _0x4ebe14={'where':_0x5b13fe[_0x93bf('0x32')]};return db[_0x93bf('0x38')][_0x93bf('0x1a')](_0x4ebe14)['then'](function(_0x4c8a1e){_0x4966fe[_0x93bf('0x1a')]=_0x4c8a1e;if(_0x5e9a8a[_0x93bf('0x27')][_0x93bf('0x39')]){_0x5b13fe[_0x93bf('0x3a')]=[{'all':!![]}];}return db['Attachment'][_0x93bf('0x3b')](_0x5b13fe);})['then'](function(_0x387642){_0x4966fe[_0x93bf('0x3c')]=_0x387642;return _0x4966fe;})[_0x93bf('0x3d')](respondWithFilteredResult(_0x4fa684,_0x5b13fe))[_0x93bf('0x3e')](handleError(_0x4fa684,null));};exports['show']=function(_0xf38f18,_0x5a869a){var _0x1ce319={'raw':!![],'where':{'id':_0xf38f18[_0x93bf('0x3f')]['id']}},_0x476651={};_0x476651[_0x93bf('0x2a')]=_['keys'](db['Attachment'][_0x93bf('0x25')]);_0x476651[_0x93bf('0x27')]=_[_0x93bf('0x28')](_0xf38f18[_0x93bf('0x27')]);_0x476651[_0x93bf('0x29')]=_[_0x93bf('0x2c')](_0x476651[_0x93bf('0x2a')],_0x476651[_0x93bf('0x27')]);_0x1ce319['attributes']=_[_0x93bf('0x2c')](_0x476651[_0x93bf('0x2a')],qs[_0x93bf('0x2d')](_0xf38f18[_0x93bf('0x27')]['fields']));_0x1ce319[_0x93bf('0x2b')]=_0x1ce319[_0x93bf('0x2b')][_0x93bf('0x2e')]?_0x1ce319[_0x93bf('0x2b')]:_0x476651[_0x93bf('0x2a')];if(_0xf38f18['query'][_0x93bf('0x39')]){_0x1ce319[_0x93bf('0x3a')]=[{'all':!![]}];}_0x1ce319=_[_0x93bf('0x34')]({},_0x1ce319,_0xf38f18[_0x93bf('0x40')]);return db[_0x93bf('0x38')][_0x93bf('0x41')](_0x1ce319)[_0x93bf('0x3d')](handleEntityNotFound(_0x5a869a,null))[_0x93bf('0x3d')](respondWithResult(_0x5a869a,null))[_0x93bf('0x3e')](handleError(_0x5a869a,null));};exports['clone']=function(_0x2144bb,_0x59aa4d){var _0x46e4ba={'where':{'id':_0x2144bb[_0x93bf('0x3f')]['id']}},_0x245235={};_0x245235[_0x93bf('0x2a')]=_[_0x93bf('0x28')](db[_0x93bf('0x38')]['rawAttributes']);_0x46e4ba[_0x93bf('0x2b')]=_[_0x93bf('0x2c')](_0x245235['model'],qs[_0x93bf('0x2d')](_0x2144bb[_0x93bf('0x27')][_0x93bf('0x2d')]));_0x46e4ba['attributes']=_0x46e4ba[_0x93bf('0x2b')][_0x93bf('0x2e')]?_0x46e4ba[_0x93bf('0x2b')]:_0x245235[_0x93bf('0x2a')];if(_0x2144bb[_0x93bf('0x27')]['includeAll']){_0x46e4ba[_0x93bf('0x3a')]=[{'all':!![]}];}_0x46e4ba=_[_0x93bf('0x34')]({},_0x46e4ba,_0x2144bb[_0x93bf('0x40')]);return db['Attachment'][_0x93bf('0x41')](_0x46e4ba)[_0x93bf('0x3d')](handleEntityNotFound(_0x59aa4d,null))['then'](function(_0xd1271){if(_0xd1271){var _0x4692dc=_0xd1271[_0x93bf('0x42')]({'plain':!![]});_0x4692dc=qs[_0x93bf('0x43')](_0x4692dc,['id',_0x93bf('0x44'),_0x93bf('0x45')]);_0x2144bb[_0x93bf('0x46')]=_['omit'](_0x2144bb['body'],['id',_0x93bf('0x44'),'updatedAt']);return db[_0x93bf('0x38')]['create'](_['merge'](_0x4692dc,_0x2144bb[_0x93bf('0x46')]),{'include':_0x2144bb['query'][_0x93bf('0x39')]?[{'all':!![]}]:undefined});}})[_0x93bf('0x3d')](respondWithResult(_0x59aa4d,0xc9))['catch'](handleError(_0x59aa4d,null));};exports['update']=function(_0x3d8dd4,_0x27fc05){if(_0x3d8dd4[_0x93bf('0x46')]['id']){delete _0x3d8dd4['body']['id'];}return db[_0x93bf('0x38')][_0x93bf('0x41')]({'where':{'id':_0x3d8dd4[_0x93bf('0x3f')]['id']}})[_0x93bf('0x3d')](handleEntityNotFound(_0x27fc05,null))[_0x93bf('0x3d')](saveUpdates(_0x3d8dd4[_0x93bf('0x46')],null))[_0x93bf('0x3d')](respondWithResult(_0x27fc05,null))[_0x93bf('0x3e')](handleError(_0x27fc05,null));};exports[_0x93bf('0x47')]=function(_0x5ccbf7,_0x54c9bf){return db[_0x93bf('0x38')][_0x93bf('0x41')]({'where':{'id':_0x5ccbf7[_0x93bf('0x3f')]['id']}})['then'](handleEntityNotFound(_0x54c9bf,null))['then'](removeEntity(_0x54c9bf,null))[_0x93bf('0x3e')](handleError(_0x54c9bf,null));};exports[_0x93bf('0x48')]=function(_0xcbc0ab,_0x31652f,_0x48ed16){_0xcbc0ab[_0x93bf('0x46')][_0x93bf('0x21')]=_0xcbc0ab[_0x93bf('0x49')][_0x93bf('0x4a')];_0xcbc0ab[_0x93bf('0x46')][_0x93bf('0x4b')]=_0xcbc0ab['file']['filename'];_0xcbc0ab[_0x93bf('0x46')][_0x93bf('0x35')]=_0xcbc0ab['file'][_0x93bf('0x4c')];return db['Attachment'][_0x93bf('0x48')](_0xcbc0ab[_0x93bf('0x46')])['then'](respondWithResult(_0x31652f,0xc9))[_0x93bf('0x3e')](handleError(_0x31652f,null));};exports[_0x93bf('0x4d')]=function(_0x13204d,_0x2ea896,_0x488751){return db['Attachment'][_0x93bf('0x4e')]({'where':{'id':_0x13204d['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2ea896,null))[_0x93bf('0x3d')](function(_0x32d28a){if(_0x32d28a){var _0x143499=_0x32d28a[_0x93bf('0x4f')]!==null;var _0x509d14=path[_0x93bf('0x50')](config[_0x93bf('0x51')],_0x93bf('0x52'));if(_0x143499){_0x509d14=path[_0x93bf('0x50')](_0x509d14,_0x93bf('0x53'));}var _0xebdbf2=path['join'](_0x509d14,_0x32d28a[_0x93bf('0x4b')]);return _0x2ea896[_0x93bf('0x4d')](_0xebdbf2);}})['catch'](handleError(_0x2ea896,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index cb8bbc4..88d6644 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 _0xfdf9=['attachments','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./attachment.attributes','exports','Attachment'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xfdf9,0x1ae));var _0x9fdf=function(_0x2c4050,_0x1c56eb){_0x2c4050=_0x2c4050-0x0;var _0x536ef4=_0xfdf9[_0x2c4050];return _0x536ef4;};'use strict';var _=require(_0x9fdf('0x0'));var util=require(_0x9fdf('0x1'));var logger=require(_0x9fdf('0x2'))(_0x9fdf('0x3'));var moment=require('moment');var BPromise=require(_0x9fdf('0x4'));var rp=require(_0x9fdf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9fdf('0x6'));var attributes=require(_0x9fdf('0x7'));module[_0x9fdf('0x8')]=function(_0xdaf153,_0x51ec43){return _0xdaf153['define'](_0x9fdf('0x9'),attributes,{'tableName':_0x9fdf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d14=['define','util','api','moment','bluebird','path','../../config/environment','./attachment.attributes','exports'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x7d14,0x1a8));var _0x47d1=function(_0x117fb1,_0x4b9774){_0x117fb1=_0x117fb1-0x0;var _0x53db22=_0x7d14[_0x117fb1];return _0x53db22;};'use strict';var _=require('lodash');var util=require(_0x47d1('0x0'));var logger=require('../../config/logger')(_0x47d1('0x1'));var moment=require(_0x47d1('0x2'));var BPromise=require(_0x47d1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47d1('0x4'));var rimraf=require('rimraf');var config=require(_0x47d1('0x5'));var attributes=require(_0x47d1('0x6'));module[_0x47d1('0x7')]=function(_0x3acd27,_0x47333b){return _0x3acd27[_0x47d1('0x8')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 26f079e..ba75b1c 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 _0xa1fd=['jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','CreateAttachment','create','body','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x21cb7f,_0x48cd16){_0x21cb7f=_0x21cb7f-0x0;var _0x5a079a=_0xa1fd[_0x21cb7f];return _0x5a079a;};'use strict';var _=require(_0xda1f('0x0'));var util=require(_0xda1f('0x1'));var moment=require(_0xda1f('0x2'));var BPromise=require(_0xda1f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda1f('0x4'));var db=require(_0xda1f('0x5'))['db'];var utils=require(_0xda1f('0x6'));var logger=require(_0xda1f('0x7'))(_0xda1f('0x8'));var config=require('../../config/environment');var jayson=require(_0xda1f('0x9'));var client=jayson[_0xda1f('0xa')][_0xda1f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x552ba4,_0x33502e,_0x46a29e){return new BPromise(function(_0x199a8d,_0x338463){return client[_0xda1f('0xc')](_0x552ba4,_0x46a29e)[_0xda1f('0xd')](function(_0x1493f8){logger[_0xda1f('0xe')](_0xda1f('0xf'),_0x33502e,'request\x20sent');logger[_0xda1f('0x10')](_0xda1f('0x11'),_0x33502e,_0xda1f('0x12'),JSON[_0xda1f('0x13')](_0x1493f8));if(_0x1493f8['error']){if(_0x1493f8['error'][_0xda1f('0x14')]===0x1f4){logger[_0xda1f('0x15')](_0xda1f('0xf'),_0x33502e,_0x1493f8[_0xda1f('0x15')][_0xda1f('0x16')]);return _0x338463(_0x1493f8['error'][_0xda1f('0x16')]);}logger[_0xda1f('0x15')](_0xda1f('0xf'),_0x33502e,_0x1493f8[_0xda1f('0x15')][_0xda1f('0x16')]);return _0x199a8d(_0x1493f8[_0xda1f('0x15')]['message']);}else{logger[_0xda1f('0xe')](_0xda1f('0xf'),_0x33502e,_0xda1f('0x12'));_0x199a8d(_0x1493f8[_0xda1f('0x17')]['message']);}})['catch'](function(_0x3020ea){logger['error'](_0xda1f('0xf'),_0x33502e,_0x3020ea);_0x338463(_0x3020ea);});});}exports[_0xda1f('0x18')]=function(_0x1e10af){var _0x59b7bf=this;return new Promise(function(_0xe81fc2,_0xe18a0a){return db['Attachment'][_0xda1f('0x19')](_0x1e10af[_0xda1f('0x1a')],{'raw':_0x1e10af['options']?_0x1e10af[_0xda1f('0x1b')][_0xda1f('0x1c')]===undefined?!![]:![]:!![]})[_0xda1f('0xd')](function(_0xe85e94){logger[_0xda1f('0xe')](_0xda1f('0x18'),_0x1e10af);logger[_0xda1f('0x10')](_0xda1f('0x18'),_0x1e10af,JSON[_0xda1f('0x13')](_0xe85e94));_0xe81fc2(_0xe85e94);})[_0xda1f('0x1d')](function(_0x1d510b){logger[_0xda1f('0x15')]('CreateAttachment',_0x1d510b[_0xda1f('0x16')],_0x1e10af);_0xe18a0a(_0x59b7bf['error'](0x1f4,_0x1d510b[_0xda1f('0x16')]));});});};
\ No newline at end of file
+var _0xf53f=['create','options','raw','then','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','info','result','CreateAttachment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf53f,0x8d));var _0xff53=function(_0x532bbb,_0x466c76){_0x532bbb=_0x532bbb-0x0;var _0x32a4eb=_0xf53f[_0x532bbb];return _0x32a4eb;};'use strict';var _=require(_0xff53('0x0'));var util=require(_0xff53('0x1'));var moment=require(_0xff53('0x2'));var BPromise=require(_0xff53('0x3'));var rs=require(_0xff53('0x4'));var fs=require('fs');var Redis=require(_0xff53('0x5'));var db=require(_0xff53('0x6'))['db'];var utils=require(_0xff53('0x7'));var logger=require(_0xff53('0x8'))(_0xff53('0x9'));var config=require(_0xff53('0xa'));var jayson=require(_0xff53('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27b397,_0x5751e7,_0x1c27bb){return new BPromise(function(_0x122746,_0x1bc4b3){return client['request'](_0x27b397,_0x1c27bb)['then'](function(_0x3c001d){logger['info'](_0xff53('0xc'),_0x5751e7,_0xff53('0xd'));logger['debug'](_0xff53('0xe'),_0x5751e7,_0xff53('0xd'),JSON['stringify'](_0x3c001d));if(_0x3c001d[_0xff53('0xf')]){if(_0x3c001d[_0xff53('0xf')][_0xff53('0x10')]===0x1f4){logger['error'](_0xff53('0xc'),_0x5751e7,_0x3c001d[_0xff53('0xf')][_0xff53('0x11')]);return _0x1bc4b3(_0x3c001d['error'][_0xff53('0x11')]);}logger[_0xff53('0xf')]('Attachment,\x20%s,\x20%s',_0x5751e7,_0x3c001d['error']['message']);return _0x122746(_0x3c001d['error'][_0xff53('0x11')]);}else{logger[_0xff53('0x12')](_0xff53('0xc'),_0x5751e7,'request\x20sent');_0x122746(_0x3c001d[_0xff53('0x13')]['message']);}})['catch'](function(_0x12e90b){logger[_0xff53('0xf')](_0xff53('0xc'),_0x5751e7,_0x12e90b);_0x1bc4b3(_0x12e90b);});});}exports[_0xff53('0x14')]=function(_0x38883f){var _0x319ce5=this;return new Promise(function(_0x14b502,_0x5e9ba6){return db['Attachment'][_0xff53('0x15')](_0x38883f['body'],{'raw':_0x38883f[_0xff53('0x16')]?_0x38883f[_0xff53('0x16')][_0xff53('0x17')]===undefined?!![]:![]:!![]})[_0xff53('0x18')](function(_0x39b3d1){logger[_0xff53('0x12')](_0xff53('0x14'),_0x38883f);logger[_0xff53('0x19')](_0xff53('0x14'),_0x38883f,JSON['stringify'](_0x39b3d1));_0x14b502(_0x39b3d1);})[_0xff53('0x1a')](function(_0x5cd878){logger['error']('CreateAttachment',_0x5cd878['message'],_0x38883f);_0x5e9ba6(_0x319ce5[_0xff53('0xf')](0x1f4,_0x5cd878[_0xff53('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index ecf0d64..d3d6541 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(_0x296b2a,_0x4e53b2){var _0x3c9ac0=function(_0x5c38fb){while(--_0x5c38fb){_0x296b2a['push'](_0x296b2a['shift']());}};_0x3c9ac0(++_0x4e53b2);}(_0xb10b,0x12a));var _0xbb10=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0xb10b[_0x5235a6];return _0x1cf37e;};'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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x17782b,_0x2002a4){var _0x3e58d3=function(_0x568cbc){while(--_0x568cbc){_0x17782b['push'](_0x17782b['shift']());}};_0x3e58d3(++_0x2002a4);}(_0x2032,0xd9));var _0x2203=function(_0x36d597,_0x2c8d48){_0x36d597=_0x36d597-0x0;var _0x284878=_0x2032[_0x36d597];return _0x284878;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 1496e77..97b9a8a 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7beb=['user','blockDuration','blocked','add','minutes','clearBlockUser','getLicense','catch','message','login','ad-login','signToken','json','Strategy','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','undefined','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blockedAt','online','admin'];(function(_0x4ca9d2,_0x408f4b){var _0x1232eb=function(_0x3a0122){while(--_0x3a0122){_0x4ca9d2['push'](_0x4ca9d2['shift']());}};_0x1232eb(++_0x408f4b);}(_0x7beb,0xc5));var _0xb7be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7beb[_0x3dd15e];return _0x231fd0;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')[_0xb7be('0x0')];var moment=require(_0xb7be('0x1'));var ActiveDirectory=require(_0xb7be('0x2'));var BPromise=require(_0xb7be('0x3'));var util=require(_0xb7be('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0xb7be('0x5'));var utils=require(_0xb7be('0x6'));var config=require(_0xb7be('0x7'));var logger=require(_0xb7be('0x8'))(_0xb7be('0x9'));function isActiveDirectoryConfigured(_0x3983ad){var _0x190537=![];if(typeof _0x3983ad['activedirectory']!==_0xb7be('0xa')){_0x190537=_0x3983ad[_0xb7be('0xb')][_0xb7be('0xc')]&&_0x3983ad[_0xb7be('0xb')][_0xb7be('0xd')]&&_0x3983ad[_0xb7be('0xb')][_0xb7be('0xe')];}return _0x190537;}function adAuthenticate(_0x5c6e5c,_0x7b15b0,_0x79a76f){return new BPromise(function(_0x4bfe1f,_0x3908ec){try{var _0xfbf51d=new ActiveDirectory(_0x5c6e5c);_0xfbf51d[_0xb7be('0xf')](_0x7b15b0,_0x79a76f,function(_0x427e87,_0xf967fe){if(_0x427e87){logger[_0xb7be('0x10')](_0xb7be('0x11'),_0x7b15b0,util[_0xb7be('0x12')](_0x427e87,{'showHidden':![],'depth':null}));_0x3908ec(_0xb7be('0x13'));}else if(!_0xf967fe){logger[_0xb7be('0x10')](_0xb7be('0x14'),_0x7b15b0);_0x3908ec('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x4bfe1f(_0xf967fe);}});}catch(_0x163045){_0x3908ec(_0x163045);}});}function ActiveDirectoryAuthenticate(_0x3e2472,_0x56ba65,_0xd47629,_0x11a1b3){var _0x56d0b1,_0x43a1fd;if(!isActiveDirectoryConfigured(config)){logger[_0xb7be('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x56ba65);return _0x11a1b3(null,![],{'message':_0xb7be('0x13')});}return db[_0xb7be('0x15')][_0xb7be('0x16')]({'where':{'id':0x1},'attributes':[_0xb7be('0x17'),'blockDuration'],'raw':!![]})[_0xb7be('0x18')](function(_0x3fa0dc){_0x56d0b1=_0x3fa0dc;if(!_0x56d0b1[_0xb7be('0x17')]){logger[_0xb7be('0x10')](_0xb7be('0x19'),_0x56ba65);throw new Error(_0xb7be('0x13'));}return _0x3e2472[_0xb7be('0x16')]({'attributes':['id',_0xb7be('0x1a'),_0xb7be('0x1b'),_0xb7be('0x1c'),_0xb7be('0x1d'),'disabled','blocked',_0xb7be('0x1e'),_0xb7be('0x1f')],'where':{'name':_0x56ba65,'role':{'$or':[_0xb7be('0x20'),_0xb7be('0x21'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x39d22a){if(!_0x39d22a||_0x39d22a&&_0x39d22a[_0xb7be('0x1a')]!==_0x56ba65){throw new Error(_0xb7be('0x13'));}_0x43a1fd=_0x39d22a;var _0x29d3e0=_0x43a1fd['name']+'@'+config['activedirectory'][_0xb7be('0xe')];return adAuthenticate(config[_0xb7be('0xb')],_0x29d3e0,_0xd47629);})[_0xb7be('0x18')](function(_0x15f288){if(_0x43a1fd['disabled']){throw new Error(_0xb7be('0x13'));}if(_0x56d0b1[_0xb7be('0x22')]>0x0){if(_0x43a1fd[_0xb7be('0x23')]){if(moment(_0x43a1fd[_0xb7be('0x1e')])[_0xb7be('0x24')](_0x56d0b1[_0xb7be('0x22')],_0xb7be('0x25'))>moment()){throw new Error(_0xb7be('0x13'));}return utils[_0xb7be('0x26')](_0x43a1fd,0x0,![],null)[_0xb7be('0x18')](function(){return utils[_0xb7be('0x27')](_0x43a1fd);})[_0xb7be('0x18')](function(){return _0x11a1b3(null,_0x43a1fd);});}else{return utils[_0xb7be('0x27')](_0x43a1fd)['then'](function(){return _0x11a1b3(null,_0x43a1fd);});}}else{return utils[_0xb7be('0x27')](_0x43a1fd)[_0xb7be('0x18')](function(){return _0x11a1b3(null,_0x43a1fd);});}})[_0xb7be('0x28')](function(_0x2a7e91){return _0x11a1b3(null,![],_0x2a7e91);});}function handleError(_0x2bb12f,_0x196df7,_0x6e26e5){return _0x2bb12f['status'](_0x196df7||0x1f4)['send']({'message':_0x6e26e5?_0x6e26e5[_0xb7be('0x29')]||_0x6e26e5:''});}exports[_0xb7be('0x2a')]=function(_0x56aa67,_0x30099f,_0x52bb54){passport['authenticate'](_0xb7be('0x2b'),function(_0x5cef3f,_0x4257ab,_0x32a36a){var _0x4c52d9=_0x5cef3f||_0x32a36a;if(_0x4c52d9){return handleError(_0x30099f,0x191,_0x4c52d9);}if(!_0x4257ab){return handleError(_0x30099f,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x28c895={'payload':{'id':_0x4257ab['id'],'role':_0x4257ab[_0xb7be('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0xb7be('0x2c')](_0x28c895)[_0xb7be('0x18')](function(_0xbb43cf){_0x30099f[_0xb7be('0x2d')]({'id':_0x4257ab['id'],'token':_0xbb43cf,'statusCall':'','isAlreadyLogged':_0x4257ab['online']});});}})(_0x56aa67,_0x30099f,_0x52bb54);};passport['use'](_0xb7be('0x2b'),new LocalStrategy({'usernameField':_0xb7be('0x1a'),'passwordField':_0xb7be('0x1b')},function(_0x733749,_0x2a2b05,_0x1c30ea){return ActiveDirectoryAuthenticate(db['User'],_0x733749,_0x2a2b05,_0x1c30ea);}));
\ No newline at end of file
+var _0x1775=['baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled','blocked','online','admin','user','blockedAt','add','clearBlockUser','getLicense','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','activedirectory','undefined'];(function(_0x19318e,_0x46c067){var _0x425540=function(_0xb4e055){while(--_0xb4e055){_0x19318e['push'](_0x19318e['shift']());}};_0x425540(++_0x46c067);}(_0x1775,0x16d));var _0x5177=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1775[_0x17d9e3];return _0x14192d;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')[_0x5177('0x0')];var moment=require(_0x5177('0x1'));var ActiveDirectory=require(_0x5177('0x2'));var BPromise=require(_0x5177('0x3'));var util=require(_0x5177('0x4'));var db=require(_0x5177('0x5'))['db'];var authService=require(_0x5177('0x6'));var utils=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x9b2d38){var _0x43e4a1=![];if(typeof _0x9b2d38[_0x5177('0x9')]!==_0x5177('0xa')){_0x43e4a1=_0x9b2d38['activedirectory'][_0x5177('0xb')]&&_0x9b2d38[_0x5177('0x9')]['url']&&_0x9b2d38['activedirectory'][_0x5177('0xc')];}return _0x43e4a1;}function adAuthenticate(_0x3437bd,_0x1c8c5d,_0x410400){return new BPromise(function(_0x387d43,_0x3ece0c){try{var _0x437063=new ActiveDirectory(_0x3437bd);_0x437063[_0x5177('0xd')](_0x1c8c5d,_0x410400,function(_0x58264d,_0x15541e){if(_0x58264d){logger[_0x5177('0xe')](_0x5177('0xf'),_0x1c8c5d,util[_0x5177('0x10')](_0x58264d,{'showHidden':![],'depth':null}));_0x3ece0c(_0x5177('0x11'));}else if(!_0x15541e){logger[_0x5177('0xe')](_0x5177('0x12'),_0x1c8c5d);_0x3ece0c('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x387d43(_0x15541e);}});}catch(_0x4403e3){_0x3ece0c(_0x4403e3);}});}function ActiveDirectoryAuthenticate(_0x5773eb,_0x122742,_0x59b42e,_0xd9c6bb){var _0x51a62f,_0x1335bb;if(!isActiveDirectoryConfigured(config)){logger[_0x5177('0xe')](_0x5177('0x13'),_0x122742);return _0xd9c6bb(null,![],{'message':_0x5177('0x11')});}return db['Setting'][_0x5177('0x14')]({'where':{'id':0x1},'attributes':[_0x5177('0x15'),_0x5177('0x16')],'raw':!![]})[_0x5177('0x17')](function(_0x40cc97){_0x51a62f=_0x40cc97;if(!_0x51a62f[_0x5177('0x15')]){logger[_0x5177('0xe')](_0x5177('0x18'),_0x122742);throw new Error(_0x5177('0x11'));}return _0x5773eb[_0x5177('0x14')]({'attributes':['id',_0x5177('0x19'),_0x5177('0x1a'),_0x5177('0x1b'),'role',_0x5177('0x1c'),_0x5177('0x1d'),'blockedAt',_0x5177('0x1e')],'where':{'name':_0x122742,'role':{'$or':[_0x5177('0x1f'),_0x5177('0x20'),'agent']},'adSsoEnabled':!![]}});})[_0x5177('0x17')](function(_0x168905){if(!_0x168905||_0x168905&&_0x168905['name']!==_0x122742){throw new Error(_0x5177('0x11'));}_0x1335bb=_0x168905;var _0x5de98c=_0x1335bb[_0x5177('0x19')]+'@'+config[_0x5177('0x9')]['domain'];return adAuthenticate(config[_0x5177('0x9')],_0x5de98c,_0x59b42e);})[_0x5177('0x17')](function(_0x4edaf9){if(_0x1335bb[_0x5177('0x1c')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x51a62f[_0x5177('0x16')]>0x0){if(_0x1335bb[_0x5177('0x1d')]){if(moment(_0x1335bb[_0x5177('0x21')])[_0x5177('0x22')](_0x51a62f[_0x5177('0x16')],'minutes')>moment()){throw new Error(_0x5177('0x11'));}return utils[_0x5177('0x23')](_0x1335bb,0x0,![],null)[_0x5177('0x17')](function(){return utils['getLicense'](_0x1335bb);})[_0x5177('0x17')](function(){return _0xd9c6bb(null,_0x1335bb);});}else{return utils[_0x5177('0x24')](_0x1335bb)[_0x5177('0x17')](function(){return _0xd9c6bb(null,_0x1335bb);});}}else{return utils[_0x5177('0x24')](_0x1335bb)[_0x5177('0x17')](function(){return _0xd9c6bb(null,_0x1335bb);});}})['catch'](function(_0x516447){return _0xd9c6bb(null,![],_0x516447);});}function handleError(_0x596b1b,_0x3f5b34,_0x1a3bdb){return _0x596b1b[_0x5177('0x25')](_0x3f5b34||0x1f4)[_0x5177('0x26')]({'message':_0x1a3bdb?_0x1a3bdb[_0x5177('0x27')]||_0x1a3bdb:''});}exports[_0x5177('0x28')]=function(_0x364475,_0x370782,_0x32ca55){passport['authenticate'](_0x5177('0x29'),function(_0x4290e2,_0x583bc6,_0x45db02){var _0x4305ca=_0x4290e2||_0x45db02;if(_0x4305ca){return handleError(_0x370782,0x191,_0x4305ca);}if(!_0x583bc6){return handleError(_0x370782,0x194,{'message':_0x5177('0x2a')});}else{var _0x49b649={'payload':{'id':_0x583bc6['id'],'role':_0x583bc6['role']},'options':{'expiresIn':0x15180}};return authService[_0x5177('0x2b')](_0x49b649)[_0x5177('0x17')](function(_0x4c5188){_0x370782[_0x5177('0x2c')]({'id':_0x583bc6['id'],'token':_0x4c5188,'statusCall':'','isAlreadyLogged':_0x583bc6['online']});});}})(_0x364475,_0x370782,_0x32ca55);};passport[_0x5177('0x2d')](_0x5177('0x29'),new LocalStrategy({'usernameField':'name','passwordField':_0x5177('0x1a')},function(_0x2ee1c8,_0x1f0a5a,_0x352a7b){return ActiveDirectoryAuthenticate(db[_0x5177('0x2e')],_0x2ee1c8,_0x1f0a5a,_0x352a7b);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index f7f31a1..5bd9a69 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb3d9=['post','exports','Router'];(function(_0x2cfb48,_0x24b83b){var _0xc4594f=function(_0x3bc089){while(--_0x3bc089){_0x2cfb48['push'](_0x2cfb48['shift']());}};_0xc4594f(++_0x24b83b);}(_0xb3d9,0x18b));var _0x9b3d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb3d9[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var router=express[_0x9b3d('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0x9b3d('0x1')]('/',controller['login']);module[_0x9b3d('0x2')]=router;
\ No newline at end of file
+var _0x3e45=['exports','express','./authActiveDirectory.controller','post','login'];(function(_0x21ab9a,_0x43eb66){var _0x15d4c6=function(_0x4932c2){while(--_0x4932c2){_0x21ab9a['push'](_0x21ab9a['shift']());}};_0x15d4c6(++_0x43eb66);}(_0x3e45,0x105));var _0x53e4=function(_0x3ab184,_0x1fa593){_0x3ab184=_0x3ab184-0x0;var _0x4765ac=_0x3e45[_0x3ab184];return _0x4765ac;};'use strict';var express=require(_0x53e4('0x0'));var router=express['Router']();var controller=require(_0x53e4('0x1'));router[_0x53e4('0x2')]('/',controller[_0x53e4('0x3')]);module[_0x53e4('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index d8a1025..a03740d 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x7a54,0x106));var _0x47a5=function(_0x1c8301,_0xd9504c){_0x1c8301=_0x1c8301-0x0;var _0x4c4f05=_0x7a54[_0x1c8301];return _0x4c4f05;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x7a54,0x106));var _0x47a5=function(_0x15f3f6,_0x3ba6f4){_0x15f3f6=_0x15f3f6-0x0;var _0xc78ebf=_0x7a54[_0x15f3f6];return _0xc78ebf;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 994837d..b6f81ae 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 _0x6068=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','isMiddleware','setTokenCookie','exports'];(function(_0x30f6c2,_0x4a187a){var _0x1a7f9d=function(_0x227f87){while(--_0x227f87){_0x30f6c2['push'](_0x30f6c2['shift']());}};_0x1a7f9d(++_0x4a187a);}(_0x6068,0x134));var _0x8606=function(_0x53f608,_0x256def){_0x53f608=_0x53f608-0x0;var _0x495b7d=_0x6068[_0x53f608];return _0x495b7d;};'use strict';var express=require('express');var passport=require(_0x8606('0x0'));var router=express[_0x8606('0x1')]();var controller=require(_0x8606('0x2'));var userController=require(_0x8606('0x3'));var authService=require(_0x8606('0x4'));router[_0x8606('0x5')]('/',controller[_0x8606('0x6')]);router[_0x8606('0x5')](_0x8606('0x7'),controller['callback'],authService[_0x8606('0x8')],userController[_0x8606('0x6')],authService[_0x8606('0x9')]);module[_0x8606('0xa')]=router;
\ No newline at end of file
+var _0xe943=['../user/user.controller.js','../../components/auth/service','callback','isMiddleware','login','setTokenCookie','passport','Router','./authGoogle.controller'];(function(_0x51c8ac,_0x28f4fc){var _0x6c565f=function(_0x2f61d4){while(--_0x2f61d4){_0x51c8ac['push'](_0x51c8ac['shift']());}};_0x6c565f(++_0x28f4fc);}(_0xe943,0xb1));var _0x3e94=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0xe943[_0x5e4563];return _0x8d1bf5;};'use strict';var express=require('express');var passport=require(_0x3e94('0x0'));var router=express[_0x3e94('0x1')]();var controller=require(_0x3e94('0x2'));var userController=require(_0x3e94('0x3'));var authService=require(_0x3e94('0x4'));router['get']('/',controller['login']);router['get']('/callback',controller[_0x3e94('0x5')],authService[_0x3e94('0x6')],userController[_0x3e94('0x7')],authService[_0x3e94('0x8')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index a15d3d0..c0cd5b3 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 _0x66de=['error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','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','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','passport','jayson/promise','lodash','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blocked','blockedAt','admin','agent','authenticate','loginAttempts','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','user','SendMail'];(function(_0x1662a7,_0x38e198){var _0x2dab2a=function(_0x56288c){while(--_0x56288c){_0x1662a7['push'](_0x1662a7['shift']());}};_0x2dab2a(++_0x38e198);}(_0x66de,0x169));var _0xe66d=function(_0x47fb54,_0x28698c){_0x47fb54=_0x47fb54-0x0;var _0x1139a7=_0x66de[_0x47fb54];return _0x1139a7;};'use strict';var util=require('util');var passport=require(_0xe66d('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0xe66d('0x1'));var _=require(_0xe66d('0x2'));var rs=require('randomstring');var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xe66d('0x3'));var utils=require(_0xe66d('0x4'));var client=jayson[_0xe66d('0x5')][_0xe66d('0x6')]({'port':0x232b});function localAuthenticate(_0x44ca83,_0xba4e17,_0x36b23c,_0x24bd1d){var _0x251a27,_0x2719ba;return db['Setting'][_0xe66d('0x7')]({'where':{'id':0x1},'attributes':[_0xe66d('0x8'),_0xe66d('0x9')],'raw':!![]})[_0xe66d('0xa')](function(_0x1f68cf){_0x251a27=_0x1f68cf;return _0x44ca83[_0xe66d('0x7')]({'attributes':['id',_0xe66d('0xb'),_0xe66d('0xc'),_0xe66d('0xd'),_0xe66d('0xe'),'disabled',_0xe66d('0xf'),_0xe66d('0x10'),'loginAttempts'],'where':{'name':_0xba4e17,'role':{'$or':[_0xe66d('0x11'),'user',_0xe66d('0x12')]}}});})['then'](function(_0x460e5b){if(!_0x460e5b||_0x460e5b&&_0x460e5b[_0xe66d('0xb')]!==_0xba4e17){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2719ba=_0x460e5b;return _0x2719ba;}})[_0xe66d('0xa')](function(){_0x2719ba[_0xe66d('0x13')](_0x36b23c,function(_0xc26068,_0x1afe92){var _0x2ac2f0=_0x2719ba[_0xe66d('0x14')]+0x1;if(_0xc26068){return _0x24bd1d(_0xc26068);}else if(!_0x1afe92){if(_0x2719ba[_0xe66d('0x15')]){return _0x24bd1d(null,![],{'message':_0xe66d('0x16')});}else if(_0x251a27[_0xe66d('0x8')]>0x0){if(_0x2719ba[_0xe66d('0xf')]){if(_0x251a27[_0xe66d('0x9')]>0x0){if(moment(_0x2719ba[_0xe66d('0x10')])[_0xe66d('0x17')](_0x251a27[_0xe66d('0x9')],_0xe66d('0x18'))>moment()){return _0x24bd1d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xe66d('0x19')](_0x2719ba,_0x2ac2f0,![],null)[_0xe66d('0xa')](function(){return _0x24bd1d(null,![],{'message':_0xe66d('0x16')});});}}else{return _0x24bd1d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2ac2f0>=_0x251a27[_0xe66d('0x8')]){return utils[_0xe66d('0x19')](_0x2719ba,0x0,!![],moment())[_0xe66d('0xa')](function(){return _0x24bd1d(null,![],{'message':_0xe66d('0x16')});});}else{return utils[_0xe66d('0x19')](_0x2719ba,_0x2ac2f0,![],null)[_0xe66d('0xa')](function(){return _0x24bd1d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x24bd1d(null,![],{'message':_0xe66d('0x16')});}}else{if(_0x2719ba[_0xe66d('0x15')]){return _0x24bd1d(null,![],{'message':_0xe66d('0x16')});}else if(_0x251a27[_0xe66d('0x8')]>0x0){if(_0x2719ba[_0xe66d('0xf')]){if(_0x251a27[_0xe66d('0x9')]>0x0){if(moment(_0x2719ba['blockedAt'])[_0xe66d('0x17')](_0x251a27['blockDuration'],_0xe66d('0x18'))>moment()){return _0x24bd1d(null,![],{'message':_0xe66d('0x16')});}else{return utils[_0xe66d('0x19')](_0x2719ba,0x0,![],null)[_0xe66d('0xa')](function(){return utils['getLicense'](_0x2719ba);})[_0xe66d('0xa')](function(){return _0x24bd1d(null,_0x2719ba);});}}else{return _0x24bd1d(null,![],{'message':_0xe66d('0x16')});}}else{return utils['clearBlockUser'](_0x2719ba,0x0,![],null)[_0xe66d('0xa')](function(){return utils[_0xe66d('0x1a')](_0x2719ba);})[_0xe66d('0xa')](function(){return _0x24bd1d(null,_0x2719ba);})[_0xe66d('0x1b')](function(_0x291824){return _0x24bd1d(null,![],_0x291824);});}}else{if(_0x2719ba[_0xe66d('0xf')]){return _0x24bd1d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xe66d('0x1a')](_0x2719ba)[_0xe66d('0xa')](function(){return _0x24bd1d(null,_0x2719ba);});}}}});})[_0xe66d('0x1b')](function(_0x1eb2cc){return _0x24bd1d(null,![],_0x1eb2cc);});}function sendServiceMail(_0x5ecc75){return db['MailAccount'][_0xe66d('0x1c')]({'where':{'service':!![]},'attributes':['id',_0xe66d('0xb'),_0xe66d('0x1d')],'include':[{'model':db[_0xe66d('0x1e')],'as':_0xe66d('0x1f'),'include':[{'model':db[_0xe66d('0x20')],'as':_0xe66d('0x20')}]}]})[_0xe66d('0xa')](function(_0xda9181){if(!_0xda9181){throw new Error(_0xe66d('0x21'));}var _0x3b1603=_0xda9181['getSmtpOptions']();var _0x32a84d={'account':_0x3b1603,'message':_[_0xe66d('0x22')]({'from':util[_0xe66d('0x23')](_0xe66d('0x24'),_0xda9181['name'],_0xda9181[_0xe66d('0x1d')]||_0xda9181[_0xe66d('0x1f')][_0xe66d('0x25')])},_0x5ecc75)};return client['request'](_0xe66d('0x26'),_0x32a84d);})['then'](function(_0x53b47a){if(_0x53b47a[_0xe66d('0x27')]){throw new Error(util[_0xe66d('0x23')](_0xe66d('0x28'),_0x53b47a[_0xe66d('0x27')]['message']||JSON['stringify'](_0x53b47a['error'])));}return!![];});}function handleError(_0x2dbfca,_0x1b3223,_0x2e3fd2){return _0x2dbfca[_0xe66d('0x29')](_0x1b3223||0x1f4)[_0xe66d('0x2a')]({'message':_0x2e3fd2?_0x2e3fd2[_0xe66d('0x2b')]||_0x2e3fd2:''});}exports[_0xe66d('0x2c')]=function(_0x4bb9e7,_0x2bafd1,_0xa83e64){passport[_0xe66d('0x13')](_0xe66d('0x2d'),function(_0x5b8712,_0x39e3b7,_0x290329){var _0x2fbfd3=_0x5b8712||_0x290329;if(_0x2fbfd3){return handleError(_0x2bafd1,0x191,_0x2fbfd3);}if(!_0x39e3b7){return handleError(_0x2bafd1,0x194,{'message':_0xe66d('0x2e')});}else{var _0x5efe0e={'payload':{'id':_0x39e3b7['id'],'role':_0x39e3b7[_0xe66d('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0xe66d('0x2f')](_0x5efe0e)[_0xe66d('0xa')](function(_0x337f1f){_0x2bafd1[_0xe66d('0x30')]({'id':_0x39e3b7['id'],'token':_0x337f1f,'statusCall':'','isAlreadyLogged':_0x39e3b7[_0xe66d('0x31')]});});}})(_0x4bb9e7,_0x2bafd1,_0xa83e64);};exports[_0xe66d('0x32')]=function(_0x4006b2,_0x6908cf){if(!_0x4006b2['body'][_0xe66d('0x1d')]){return handleError(_0x6908cf,0x1f4,{'message':_0xe66d('0x33')});}var _0x9ad157=rs[_0xe66d('0x34')]();_0x4006b2[_0xe66d('0x35')]['email']=_0x4006b2['body'][_0xe66d('0x1d')]['trim']()[_0xe66d('0x36')]();var _0x2fdc0c;return db[_0xe66d('0x37')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe66d('0x9')],'raw':!![]})[_0xe66d('0xa')](function(_0xe9fb4a){_0x2fdc0c=_0xe9fb4a;return db['User'][_0xe66d('0x1c')]({'where':{'email':_0x4006b2[_0xe66d('0x35')][_0xe66d('0x1d')]}});})[_0xe66d('0xa')](function(_0x54f0b6){if(!_0x54f0b6){throw new Error(_0xe66d('0x38'));}if(_0x54f0b6[_0xe66d('0x15')]){throw new Error(_0xe66d('0x39'));}if(_0x54f0b6[_0xe66d('0xf')]){if(moment(_0x54f0b6[_0xe66d('0x10')])[_0xe66d('0x17')](_0x2fdc0c[_0xe66d('0x9')],_0xe66d('0x18'))>moment()){throw new Error(_0xe66d('0x3a'));}else{_0x54f0b6[_0xe66d('0xf')]=![];_0x54f0b6[_0xe66d('0x10')]=null;}}_0x54f0b6[_0xe66d('0x3b')]=_0x9ad157;_0x54f0b6['resetPasswordExpires']=Date[_0xe66d('0x3c')]()+0x36ee80;return _0x54f0b6[_0xe66d('0x3d')]();})[_0xe66d('0xa')](function(){return sendServiceMail({'to':_0x4006b2[_0xe66d('0x35')][_0xe66d('0x1d')],'subject':_0xe66d('0x3e'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xe66d('0x3f')+_0xe66d('0x40')+_0x4006b2['headers']['host']+_0xe66d('0x41')+_0x9ad157+'\x0a\x0a'+_0xe66d('0x42')});})['then'](function(){_0x6908cf[_0xe66d('0x29')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x2eb4cb){return handleError(_0x6908cf,0x1f4,_0x2eb4cb);});};exports[_0xe66d('0x43')]=function(_0xcfb1e4,_0x17338c){return db[_0xe66d('0x44')][_0xe66d('0x1c')]({'where':{'resetPasswordToken':_0xcfb1e4[_0xe66d('0x45')][_0xe66d('0x46')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x478405){if(!_0x478405){throw new Error(_0xe66d('0x47'));}return db[_0xe66d('0x37')][_0xe66d('0x7')]({'attributes':['id',_0xe66d('0x48'),_0xe66d('0x49'),_0xe66d('0x4a')]})[_0xe66d('0xa')](function(_0x11b495){if(_0x11b495[_0xe66d('0x48')])authService['validatePasswordPattern'](_0xcfb1e4[_0xe66d('0x35')][_0xe66d('0xc')]);if(!_0x11b495['enforcePasswordHistory']||!_0x478405[_0xe66d('0x4b')])return _0x478405;authService[_0xe66d('0x4c')](_0xcfb1e4['body'][_0xe66d('0xc')],_0x478405[_0xe66d('0x4b')],_0x11b495[_0xe66d('0x4a')]);return _0x478405;})['then'](function(){_0x478405[_0xe66d('0xc')]=_0xcfb1e4[_0xe66d('0x35')][_0xe66d('0xc')];_0x478405['resetPasswordToken']=null;_0x478405[_0xe66d('0x4d')]=null;return _0x478405[_0xe66d('0x3d')]();});})['then'](function(){_0x17338c['status'](0xc8)['send']({'message':_0xe66d('0x4e')});})[_0xe66d('0x1b')](function(_0x1e8e8a){return handleError(_0x17338c,0x1f4,_0x1e8e8a);});};passport[_0xe66d('0x4f')](_0xe66d('0x2d'),new LocalStrategy({'usernameField':_0xe66d('0xb'),'passwordField':_0xe66d('0xc')},function(_0x272aff,_0x29d6a6,_0x3fc92a){return localAuthenticate(db[_0xe66d('0x44')],_0x272aff,_0x29d6a6,_0x3fc92a);}));
\ No newline at end of file
+var _0xf486=['allowedLoginAttempts','blockDuration','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','add','minutes','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','format','\x22%s\x22\x20<%s>','user','SendMail','error','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','resetPasswordToken','save','use','local-login','util','passport-local','Strategy','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','findOne'];(function(_0x99ff61,_0x361951){var _0x3683d8=function(_0x4a55d9){while(--_0x4a55d9){_0x99ff61['push'](_0x99ff61['shift']());}};_0x3683d8(++_0x361951);}(_0xf486,0xda));var _0x6f48=function(_0x47959f,_0x1b4977){_0x47959f=_0x47959f-0x0;var _0x2ea8f7=_0xf486[_0x47959f];return _0x2ea8f7;};'use strict';var util=require(_0x6f48('0x0'));var passport=require('passport');var LocalStrategy=require(_0x6f48('0x1'))[_0x6f48('0x2')];var jayson=require(_0x6f48('0x3'));var _=require('lodash');var rs=require(_0x6f48('0x4'));var moment=require('moment');var db=require(_0x6f48('0x5'))['db'];var authService=require(_0x6f48('0x6'));var utils=require(_0x6f48('0x7'));var client=jayson[_0x6f48('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x1e49b4,_0x25b409,_0x560262,_0x20e82f){var _0x3289fa,_0x3d38fd;return db['Setting'][_0x6f48('0x9')]({'where':{'id':0x1},'attributes':[_0x6f48('0xa'),_0x6f48('0xb')],'raw':!![]})['then'](function(_0x14c6d7){_0x3289fa=_0x14c6d7;return _0x1e49b4[_0x6f48('0x9')]({'attributes':['id',_0x6f48('0xc'),_0x6f48('0xd'),_0x6f48('0xe'),_0x6f48('0xf'),_0x6f48('0x10'),_0x6f48('0x11'),_0x6f48('0x12'),_0x6f48('0x13')],'where':{'name':_0x25b409,'role':{'$or':[_0x6f48('0x14'),'user','agent']}}});})[_0x6f48('0x15')](function(_0x591a8b){if(!_0x591a8b||_0x591a8b&&_0x591a8b[_0x6f48('0xc')]!==_0x25b409){throw new Error(_0x6f48('0x16'));}else{_0x3d38fd=_0x591a8b;return _0x3d38fd;}})[_0x6f48('0x15')](function(){_0x3d38fd['authenticate'](_0x560262,function(_0x1f0dea,_0x4443d5){var _0x45843d=_0x3d38fd[_0x6f48('0x13')]+0x1;if(_0x1f0dea){return _0x20e82f(_0x1f0dea);}else if(!_0x4443d5){if(_0x3d38fd[_0x6f48('0x10')]){return _0x20e82f(null,![],{'message':_0x6f48('0x16')});}else if(_0x3289fa[_0x6f48('0xa')]>0x0){if(_0x3d38fd['blocked']){if(_0x3289fa['blockDuration']>0x0){if(moment(_0x3d38fd[_0x6f48('0x12')])['add'](_0x3289fa[_0x6f48('0xb')],'minutes')>moment()){return _0x20e82f(null,![],{'message':_0x6f48('0x16')});}else{return utils['clearBlockUser'](_0x3d38fd,_0x45843d,![],null)[_0x6f48('0x15')](function(){return _0x20e82f(null,![],{'message':_0x6f48('0x16')});});}}else{return _0x20e82f(null,![],{'message':_0x6f48('0x16')});}}else{if(_0x45843d>=_0x3289fa[_0x6f48('0xa')]){return utils[_0x6f48('0x17')](_0x3d38fd,0x0,!![],moment())[_0x6f48('0x15')](function(){return _0x20e82f(null,![],{'message':_0x6f48('0x16')});});}else{return utils[_0x6f48('0x17')](_0x3d38fd,_0x45843d,![],null)[_0x6f48('0x15')](function(){return _0x20e82f(null,![],{'message':_0x6f48('0x16')});});}}}else{return _0x20e82f(null,![],{'message':_0x6f48('0x16')});}}else{if(_0x3d38fd[_0x6f48('0x10')]){return _0x20e82f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3289fa['allowedLoginAttempts']>0x0){if(_0x3d38fd['blocked']){if(_0x3289fa[_0x6f48('0xb')]>0x0){if(moment(_0x3d38fd[_0x6f48('0x12')])[_0x6f48('0x18')](_0x3289fa[_0x6f48('0xb')],_0x6f48('0x19'))>moment()){return _0x20e82f(null,![],{'message':_0x6f48('0x16')});}else{return utils['clearBlockUser'](_0x3d38fd,0x0,![],null)['then'](function(){return utils['getLicense'](_0x3d38fd);})[_0x6f48('0x15')](function(){return _0x20e82f(null,_0x3d38fd);});}}else{return _0x20e82f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x3d38fd,0x0,![],null)[_0x6f48('0x15')](function(){return utils[_0x6f48('0x1a')](_0x3d38fd);})[_0x6f48('0x15')](function(){return _0x20e82f(null,_0x3d38fd);})[_0x6f48('0x1b')](function(_0x5cc5ca){return _0x20e82f(null,![],_0x5cc5ca);});}}else{if(_0x3d38fd[_0x6f48('0x11')]){return _0x20e82f(null,![],{'message':_0x6f48('0x16')});}else{return utils[_0x6f48('0x1a')](_0x3d38fd)['then'](function(){return _0x20e82f(null,_0x3d38fd);});}}}});})[_0x6f48('0x1b')](function(_0x2e6347){return _0x20e82f(null,![],_0x2e6347);});}function sendServiceMail(_0x3d3e56){return db['MailAccount'][_0x6f48('0x1c')]({'where':{'service':!![]},'attributes':['id',_0x6f48('0xc'),_0x6f48('0x1d')],'include':[{'model':db[_0x6f48('0x1e')],'as':_0x6f48('0x1f'),'include':[{'model':db[_0x6f48('0x20')],'as':'CloudProvider'}]}]})[_0x6f48('0x15')](function(_0x5bfc6b){if(!_0x5bfc6b){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x947ad2=_0x5bfc6b[_0x6f48('0x21')]();var _0x18b7c3={'account':_0x947ad2,'message':_['merge']({'from':util[_0x6f48('0x22')](_0x6f48('0x23'),_0x5bfc6b[_0x6f48('0xc')],_0x5bfc6b[_0x6f48('0x1d')]||_0x5bfc6b['Smtp'][_0x6f48('0x24')])},_0x3d3e56)};return client['request'](_0x6f48('0x25'),_0x18b7c3);})['then'](function(_0xf998d4){if(_0xf998d4[_0x6f48('0x26')]){throw new Error(util[_0x6f48('0x22')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0xf998d4[_0x6f48('0x26')][_0x6f48('0x27')]||JSON[_0x6f48('0x28')](_0xf998d4[_0x6f48('0x26')])));}return!![];});}function handleError(_0x31c793,_0x1a2055,_0x10dcd4){return _0x31c793[_0x6f48('0x29')](_0x1a2055||0x1f4)[_0x6f48('0x2a')]({'message':_0x10dcd4?_0x10dcd4[_0x6f48('0x27')]||_0x10dcd4:''});}exports[_0x6f48('0x2b')]=function(_0x480175,_0x586745,_0x5cd925){passport['authenticate']('local-login',function(_0x2574dc,_0x4cd0ef,_0x470bf5){var _0x444afa=_0x2574dc||_0x470bf5;if(_0x444afa){return handleError(_0x586745,0x191,_0x444afa);}if(!_0x4cd0ef){return handleError(_0x586745,0x194,{'message':_0x6f48('0x2c')});}else{var _0x997b53={'payload':{'id':_0x4cd0ef['id'],'role':_0x4cd0ef[_0x6f48('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x6f48('0x2d')](_0x997b53)['then'](function(_0x1b45a2){_0x586745[_0x6f48('0x2e')]({'id':_0x4cd0ef['id'],'token':_0x1b45a2,'statusCall':'','isAlreadyLogged':_0x4cd0ef['online']});});}})(_0x480175,_0x586745,_0x5cd925);};exports[_0x6f48('0x2f')]=function(_0x34f1f8,_0x384230){if(!_0x34f1f8[_0x6f48('0x30')][_0x6f48('0x1d')]){return handleError(_0x384230,0x1f4,{'message':_0x6f48('0x31')});}var _0x3ee892=rs[_0x6f48('0x32')]();_0x34f1f8[_0x6f48('0x30')][_0x6f48('0x1d')]=_0x34f1f8[_0x6f48('0x30')][_0x6f48('0x1d')]['trim']()['toLowerCase']();var _0x44169d;return db[_0x6f48('0x33')][_0x6f48('0x9')]({'where':{'id':0x1},'attributes':[_0x6f48('0xa'),_0x6f48('0xb')],'raw':!![]})[_0x6f48('0x15')](function(_0x4172d7){_0x44169d=_0x4172d7;return db['User'][_0x6f48('0x1c')]({'where':{'email':_0x34f1f8[_0x6f48('0x30')][_0x6f48('0x1d')]}});})[_0x6f48('0x15')](function(_0xed0c4f){if(!_0xed0c4f){throw new Error(_0x6f48('0x34'));}if(_0xed0c4f[_0x6f48('0x10')]){throw new Error(_0x6f48('0x35'));}if(_0xed0c4f['blocked']){if(moment(_0xed0c4f[_0x6f48('0x12')])['add'](_0x44169d[_0x6f48('0xb')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0xed0c4f[_0x6f48('0x11')]=![];_0xed0c4f[_0x6f48('0x12')]=null;}}_0xed0c4f['resetPasswordToken']=_0x3ee892;_0xed0c4f[_0x6f48('0x36')]=Date[_0x6f48('0x37')]()+0x36ee80;return _0xed0c4f['save']();})['then'](function(){return sendServiceMail({'to':_0x34f1f8['body'][_0x6f48('0x1d')],'subject':_0x6f48('0x38'),'text':_0x6f48('0x39')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x34f1f8['headers'][_0x6f48('0x3a')]+_0x6f48('0x3b')+_0x3ee892+'\x0a\x0a'+_0x6f48('0x3c')});})['then'](function(){_0x384230[_0x6f48('0x29')](0xc8)['send']({'message':_0x6f48('0x3d')});})[_0x6f48('0x1b')](function(_0x32a814){return handleError(_0x384230,0x1f4,_0x32a814);});};exports[_0x6f48('0x3e')]=function(_0x2dc2aa,_0x5934b8){return db[_0x6f48('0x3f')][_0x6f48('0x1c')]({'where':{'resetPasswordToken':_0x2dc2aa['params'][_0x6f48('0x40')],'resetPasswordExpires':{'$gt':Date[_0x6f48('0x37')]()}}})[_0x6f48('0x15')](function(_0x5d521e){if(!_0x5d521e){throw new Error(_0x6f48('0x41'));}return db[_0x6f48('0x33')]['findOne']({'attributes':['id',_0x6f48('0x42'),'enforcePasswordHistory',_0x6f48('0x43')]})[_0x6f48('0x15')](function(_0x5be000){if(_0x5be000[_0x6f48('0x42')])authService[_0x6f48('0x44')](_0x2dc2aa['body'][_0x6f48('0xd')]);if(!_0x5be000[_0x6f48('0x45')]||!_0x5d521e['previousPasswords'])return _0x5d521e;authService[_0x6f48('0x46')](_0x2dc2aa[_0x6f48('0x30')][_0x6f48('0xd')],_0x5d521e[_0x6f48('0x47')],_0x5be000[_0x6f48('0x43')]);return _0x5d521e;})['then'](function(){_0x5d521e['password']=_0x2dc2aa[_0x6f48('0x30')]['password'];_0x5d521e[_0x6f48('0x48')]=null;_0x5d521e[_0x6f48('0x36')]=null;return _0x5d521e[_0x6f48('0x49')]();});})[_0x6f48('0x15')](function(){_0x5934b8[_0x6f48('0x29')](0xc8)[_0x6f48('0x2a')]({'message':'Password\x20reset!'});})[_0x6f48('0x1b')](function(_0x400409){return handleError(_0x5934b8,0x1f4,_0x400409);});};passport[_0x6f48('0x4a')](_0x6f48('0x4b'),new LocalStrategy({'usernameField':_0x6f48('0xc'),'passwordField':'password'},function(_0x36479a,_0x4f64bf,_0x2fe42e){return localAuthenticate(db['User'],_0x36479a,_0x4f64bf,_0x2fe42e);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index e2f8114..11dd3da 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 _0xe29f=['express','Router','post','login','/forgot','forgot','/reset/:token','exports'];(function(_0x532c00,_0xd68e93){var _0x3ae4ed=function(_0x11ec62){while(--_0x11ec62){_0x532c00['push'](_0x532c00['shift']());}};_0x3ae4ed(++_0xd68e93);}(_0xe29f,0x1e8));var _0xfe29=function(_0x3fa78c,_0x18b0f2){_0x3fa78c=_0x3fa78c-0x0;var _0x4cbcc9=_0xe29f[_0x3fa78c];return _0x4cbcc9;};'use strict';var express=require(_0xfe29('0x0'));var router=express[_0xfe29('0x1')]();var controller=require('./authLocal.controller');router[_0xfe29('0x2')]('/',controller[_0xfe29('0x3')]);router[_0xfe29('0x2')](_0xfe29('0x4'),controller[_0xfe29('0x5')]);router[_0xfe29('0x2')](_0xfe29('0x6'),controller['reset']);module[_0xfe29('0x7')]=router;
\ No newline at end of file
+var _0x9500=['express','Router','./authLocal.controller','post','login','/forgot','/reset/:token','reset','exports'];(function(_0xdeb72f,_0x3e87da){var _0x2b0aa7=function(_0x2d0591){while(--_0x2d0591){_0xdeb72f['push'](_0xdeb72f['shift']());}};_0x2b0aa7(++_0x3e87da);}(_0x9500,0x10e));var _0x0950=function(_0x3bc594,_0x5e5340){_0x3bc594=_0x3bc594-0x0;var _0xdcd6=_0x9500[_0x3bc594];return _0xdcd6;};'use strict';var express=require(_0x0950('0x0'));var router=express[_0x0950('0x1')]();var controller=require(_0x0950('0x2'));router[_0x0950('0x3')]('/',controller[_0x0950('0x4')]);router[_0x0950('0x3')](_0x0950('0x5'),controller['forgot']);router[_0x0950('0x3')](_0x0950('0x6'),controller[_0x0950('0x7')]);module[_0x0950('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 3496d51..935aaef 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 _0xe099=['BOOLEAN','INTEGER','STRING'];(function(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0xe099,0x1b2));var _0x9e09=function(_0x40be47,_0x45b591){_0x40be47=_0x40be47-0x0;var _0x468f9f=_0xe099[_0x40be47];return _0x468f9f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9e09('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0x9e09('0x0')]},'description':{'type':Sequelize[_0x9e09('0x0')]},'status':{'type':Sequelize[_0x9e09('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9e09('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xfa98=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x1e52f6,_0x1de979){var _0xd80e3=function(_0x46791a){while(--_0x46791a){_0x1e52f6['push'](_0x1e52f6['shift']());}};_0xd80e3(++_0x1de979);}(_0xfa98,0x112));var _0x8fa9=function(_0x827286,_0x344e5c){_0x827286=_0x827286-0x0;var _0x31e0d4=_0xfa98[_0x827286];return _0x31e0d4;};'use strict';var Sequelize=require(_0x8fa9('0x0'));module['exports']={'name':{'type':Sequelize[_0x8fa9('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x8fa9('0x1')]},'description':{'type':Sequelize[_0x8fa9('0x1')]},'status':{'type':Sequelize[_0x8fa9('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8fa9('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 ed5ca2a..c5031c6 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 _0x1952=['offset','limit','Content-Range','json','apply','reject','save','then','end','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','map','query','keys','filters','attributes','fields','length','model','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','intersection','create','body','update','find','addConditions','ids','omit','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','undefined','count'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x1952,0xdd));var _0x2195=function(_0x18ebd4,_0x318045){_0x18ebd4=_0x18ebd4-0x0;var _0x37960f=_0x1952[_0x18ebd4];return _0x37960f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2195('0x0'));var jsonpatch=require(_0x2195('0x1'));var rp=require(_0x2195('0x2'));var moment=require(_0x2195('0x3'));var BPromise=require(_0x2195('0x4'));var Mustache=require(_0x2195('0x5'));var util=require(_0x2195('0x6'));var path=require(_0x2195('0x7'));var sox=require(_0x2195('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2195('0x9'));var _=require(_0x2195('0xa'));var squel=require(_0x2195('0xb'));var crypto=require(_0x2195('0xc'));var jsforce=require(_0x2195('0xd'));var deskjs=require(_0x2195('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2195('0xf'));var Redis=require(_0x2195('0x10'));var authService=require(_0x2195('0x11'));var qs=require(_0x2195('0x12'));var as=require(_0x2195('0x13'));var hardwareService=require(_0x2195('0x14'));var logger=require(_0x2195('0x15'))(_0x2195('0x16'));var utils=require(_0x2195('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x318fa9,_0x40ccfa){_0x40ccfa=_0x40ccfa||0xcc;return function(_0x34e5ef){if(_0x34e5ef){return _0x318fa9[_0x2195('0x18')](_0x40ccfa);}return _0x318fa9[_0x2195('0x19')](_0x40ccfa)['end']();};}function respondWithResult(_0x5b504e,_0x580204){_0x580204=_0x580204||0xc8;return function(_0x230958){if(_0x230958){return _0x5b504e['status'](_0x580204)['json'](_0x230958);}};}function respondWithFilteredResult(_0x516617,_0x441790){return function(_0x4c1e2b){if(_0x4c1e2b){var _0x105a92=typeof _0x441790['offset']===_0x2195('0x1a')&&typeof _0x441790['limit']===_0x2195('0x1a');var _0x2d3e9b=_0x4c1e2b[_0x2195('0x1b')];var _0x390b36=_0x105a92?0x0:_0x441790[_0x2195('0x1c')];var _0x10a213=_0x105a92?_0x4c1e2b[_0x2195('0x1b')]:_0x441790[_0x2195('0x1c')]+_0x441790[_0x2195('0x1d')];var _0x903a0a;if(_0x10a213>=_0x2d3e9b){_0x10a213=_0x2d3e9b;_0x903a0a=0xc8;}else{_0x903a0a=0xce;}_0x516617[_0x2195('0x19')](_0x903a0a);return _0x516617['set'](_0x2195('0x1e'),_0x390b36+'-'+_0x10a213+'/'+_0x2d3e9b)[_0x2195('0x1f')](_0x4c1e2b);}return null;};}function patchUpdates(_0x52b35e){return function(_0x2477d3){try{jsonpatch[_0x2195('0x20')](_0x2477d3,_0x52b35e,!![]);}catch(_0xe99e90){return BPromise[_0x2195('0x21')](_0xe99e90);}return _0x2477d3[_0x2195('0x22')]();};}function saveUpdates(_0x22e39c,_0x2769fd){return function(_0x31be88){if(_0x31be88){return _0x31be88['update'](_0x22e39c)['then'](function(_0x2b1339){return _0x2b1339;});}return null;};}function removeEntity(_0x468c50,_0x1b86aa){return function(_0x321808){if(_0x321808){return _0x321808['destroy']()[_0x2195('0x23')](function(){_0x468c50[_0x2195('0x19')](0xcc)[_0x2195('0x24')]();});}};}function handleEntityNotFound(_0x626274,_0x59d1b3){return function(_0x668bf6){if(!_0x668bf6){_0x626274[_0x2195('0x18')](0x194);}return _0x668bf6;};}function handleError(_0x577647,_0x5d6701){_0x5d6701=_0x5d6701||0x1f4;return function(_0x2f9b4a){logger[_0x2195('0x25')](_0x2f9b4a[_0x2195('0x26')]);if(_0x2f9b4a['name']){delete _0x2f9b4a[_0x2195('0x27')];}_0x577647['status'](_0x5d6701)[_0x2195('0x28')](_0x2f9b4a);};}exports[_0x2195('0x29')]=function(_0x26c40b,_0x13c0e){var _0x4ec88f={},_0x299493={},_0x4e3ad9={'count':0x0,'rows':[]};var _0x14bad2=_['map'](db[_0x2195('0x2a')][_0x2195('0x2b')],function(_0x598990){return{'name':_0x598990[_0x2195('0x2c')],'type':_0x598990[_0x2195('0x2d')][_0x2195('0x2e')]};});_0x299493['model']=_[_0x2195('0x2f')](_0x14bad2,_0x2195('0x27'));_0x299493[_0x2195('0x30')]=_[_0x2195('0x31')](_0x26c40b[_0x2195('0x30')]);_0x299493[_0x2195('0x32')]=_['intersection'](_0x299493['model'],_0x299493[_0x2195('0x30')]);_0x4ec88f[_0x2195('0x33')]=_['intersection'](_0x299493['model'],qs[_0x2195('0x34')](_0x26c40b[_0x2195('0x30')][_0x2195('0x34')]));_0x4ec88f[_0x2195('0x33')]=_0x4ec88f[_0x2195('0x33')][_0x2195('0x35')]?_0x4ec88f['attributes']:_0x299493[_0x2195('0x36')];if(!_0x26c40b[_0x2195('0x30')]['hasOwnProperty'](_0x2195('0x37'))){_0x4ec88f[_0x2195('0x1d')]=qs[_0x2195('0x1d')](_0x26c40b[_0x2195('0x30')][_0x2195('0x1d')]);_0x4ec88f[_0x2195('0x1c')]=qs['offset'](_0x26c40b[_0x2195('0x30')][_0x2195('0x1c')]);}_0x4ec88f[_0x2195('0x38')]=qs[_0x2195('0x39')](_0x26c40b['query'][_0x2195('0x39')]);_0x4ec88f[_0x2195('0x3a')]=qs['filters'](_[_0x2195('0x3b')](_0x26c40b[_0x2195('0x30')],_0x299493['filters']),_0x14bad2);if(_0x26c40b[_0x2195('0x30')][_0x2195('0x3c')]){_0x4ec88f[_0x2195('0x3a')]=_['merge'](_0x4ec88f['where'],{'$or':_[_0x2195('0x2f')](_0x14bad2,function(_0x505a26){if(_0x505a26[_0x2195('0x2d')]!=='VIRTUAL'){var _0x538707={};_0x538707[_0x505a26[_0x2195('0x27')]]={'$like':'%'+_0x26c40b[_0x2195('0x30')][_0x2195('0x3c')]+'%'};return _0x538707;}})});}_0x4ec88f=_[_0x2195('0x3d')]({},_0x4ec88f,_0x26c40b[_0x2195('0x3e')]);var _0x3faaa5={'where':_0x4ec88f['where']};return db['Automation'][_0x2195('0x1b')](_0x3faaa5)['then'](function(_0x293044){_0x4e3ad9[_0x2195('0x1b')]=_0x293044;if(_0x26c40b[_0x2195('0x30')][_0x2195('0x3f')]){_0x4ec88f[_0x2195('0x40')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x4ec88f);})[_0x2195('0x23')](function(_0x543dc8){_0x4e3ad9[_0x2195('0x41')]=_0x543dc8;return _0x4e3ad9;})[_0x2195('0x23')](respondWithFilteredResult(_0x13c0e,_0x4ec88f))[_0x2195('0x42')](handleError(_0x13c0e,null));};exports[_0x2195('0x43')]=function(_0x5f4566,_0x41c41b){var _0x23a7b5={'raw':![],'where':{'id':_0x5f4566[_0x2195('0x44')]['id']}},_0x3131ca={};_0x3131ca[_0x2195('0x36')]=_['keys'](db[_0x2195('0x2a')][_0x2195('0x2b')]);_0x3131ca[_0x2195('0x30')]=_[_0x2195('0x31')](_0x5f4566[_0x2195('0x30')]);_0x3131ca[_0x2195('0x32')]=_[_0x2195('0x45')](_0x3131ca[_0x2195('0x36')],_0x3131ca['query']);_0x23a7b5[_0x2195('0x33')]=_[_0x2195('0x45')](_0x3131ca[_0x2195('0x36')],qs[_0x2195('0x34')](_0x5f4566['query'][_0x2195('0x34')]));_0x23a7b5[_0x2195('0x33')]=_0x23a7b5['attributes'][_0x2195('0x35')]?_0x23a7b5['attributes']:_0x3131ca['model'];if(_0x5f4566[_0x2195('0x30')][_0x2195('0x3f')]){_0x23a7b5[_0x2195('0x40')]=[{'all':!![]}];}_0x23a7b5=_[_0x2195('0x3d')]({},_0x23a7b5,_0x5f4566[_0x2195('0x3e')]);return db[_0x2195('0x2a')]['find'](_0x23a7b5)[_0x2195('0x23')](handleEntityNotFound(_0x41c41b,null))[_0x2195('0x23')](respondWithResult(_0x41c41b,null))[_0x2195('0x42')](handleError(_0x41c41b,null));};exports[_0x2195('0x46')]=function(_0x4994f3,_0x47fc78){return db[_0x2195('0x2a')][_0x2195('0x46')](_0x4994f3[_0x2195('0x47')],{})[_0x2195('0x23')](respondWithResult(_0x47fc78,0xc9))['catch'](handleError(_0x47fc78,null));};exports[_0x2195('0x48')]=function(_0x312cdc,_0x5cacc0){if(_0x312cdc[_0x2195('0x47')]['id']){delete _0x312cdc[_0x2195('0x47')]['id'];}return db['Automation'][_0x2195('0x49')]({'where':{'id':_0x312cdc[_0x2195('0x44')]['id']}})[_0x2195('0x23')](handleEntityNotFound(_0x5cacc0,null))[_0x2195('0x23')](saveUpdates(_0x312cdc[_0x2195('0x47')],null))[_0x2195('0x23')](respondWithResult(_0x5cacc0,null))[_0x2195('0x42')](handleError(_0x5cacc0,null));};exports['destroy']=function(_0x3d1799,_0x17f0fa){return db[_0x2195('0x2a')][_0x2195('0x49')]({'where':{'id':_0x3d1799['params']['id']}})[_0x2195('0x23')](handleEntityNotFound(_0x17f0fa,null))['then'](removeEntity(_0x17f0fa,null))['catch'](handleError(_0x17f0fa,null));};exports['addConditions']=function(_0x31fc1,_0x413c47,_0x5cea91){return db['Condition'][_0x2195('0x49')]({'where':{'id':_0x31fc1['params']['id']}})[_0x2195('0x23')](handleEntityNotFound(_0x413c47,null))[_0x2195('0x23')](function(_0x17396f){if(_0x17396f){return _0x17396f[_0x2195('0x4a')](_0x31fc1[_0x2195('0x47')][_0x2195('0x4b')],_[_0x2195('0x4c')](_0x31fc1[_0x2195('0x47')],['ids','id'])||{});}})[_0x2195('0x23')](respondWithResult(_0x413c47,null))[_0x2195('0x42')](handleError(_0x413c47,null));};exports[_0x2195('0x4d')]=function(_0x5ebeb6,_0x421cd2,_0xe9eff2){var _0xd3d038={};var _0x2f7445={};var _0xd70647;var _0x4ccc38;return db[_0x2195('0x2a')][_0x2195('0x4e')]({'where':{'id':_0x5ebeb6[_0x2195('0x44')]['id']}})[_0x2195('0x23')](handleEntityNotFound(_0x421cd2,null))[_0x2195('0x23')](function(_0x486aa1){if(_0x486aa1){_0xd70647=_0x486aa1;_0x2f7445[_0x2195('0x36')]=_[_0x2195('0x31')](db['Condition']['rawAttributes']);_0x2f7445[_0x2195('0x30')]=_[_0x2195('0x31')](_0x5ebeb6[_0x2195('0x30')]);_0x2f7445[_0x2195('0x32')]=_[_0x2195('0x45')](_0x2f7445[_0x2195('0x36')],_0x2f7445[_0x2195('0x30')]);_0xd3d038['attributes']=_[_0x2195('0x45')](_0x2f7445[_0x2195('0x36')],qs[_0x2195('0x34')](_0x5ebeb6['query'][_0x2195('0x34')]));_0xd3d038[_0x2195('0x33')]=_0xd3d038['attributes'][_0x2195('0x35')]?_0xd3d038[_0x2195('0x33')]:_0x2f7445['model'];_0xd3d038[_0x2195('0x38')]=qs[_0x2195('0x39')](_0x5ebeb6['query'][_0x2195('0x39')]);_0xd3d038[_0x2195('0x3a')]=qs[_0x2195('0x32')](_['pick'](_0x5ebeb6[_0x2195('0x30')],_0x2f7445[_0x2195('0x32')]));if(_0x5ebeb6[_0x2195('0x30')]['filter']){_0xd3d038[_0x2195('0x3a')]=_['merge'](_0xd3d038[_0x2195('0x3a')],{'$or':_[_0x2195('0x2f')](_0xd3d038[_0x2195('0x33')],function(_0x390b89){var _0x571d4e={};_0x571d4e[_0x390b89]={'$like':'%'+_0x5ebeb6[_0x2195('0x30')][_0x2195('0x3c')]+'%'};return _0x571d4e;})});}_0xd3d038=_[_0x2195('0x3d')]({},_0xd3d038,_0x5ebeb6[_0x2195('0x3e')]);return _0xd70647['getConditions'](_0xd3d038);}})[_0x2195('0x23')](function(_0x36f18e){if(_0x36f18e){_0x4ccc38=_0x36f18e[_0x2195('0x35')];if(!_0x5ebeb6[_0x2195('0x30')][_0x2195('0x4f')](_0x2195('0x37'))){_0xd3d038[_0x2195('0x1d')]=qs[_0x2195('0x1d')](_0x5ebeb6[_0x2195('0x30')][_0x2195('0x1d')]);_0xd3d038[_0x2195('0x1c')]=qs['offset'](_0x5ebeb6[_0x2195('0x30')]['offset']);}return _0xd70647[_0x2195('0x4d')](_0xd3d038);}})[_0x2195('0x23')](function(_0x78e3ad){if(_0x78e3ad){return _0x78e3ad?{'count':_0x4ccc38,'rows':_0x78e3ad}:null;}})[_0x2195('0x23')](respondWithResult(_0x421cd2,null))[_0x2195('0x42')](handleError(_0x421cd2,null));};exports[_0x2195('0x50')]=function(_0x4ae862,_0x474a4e,_0x21bf10){return db[_0x2195('0x51')]['find']({'where':{'id':_0x4ae862[_0x2195('0x44')]['id']}})[_0x2195('0x23')](handleEntityNotFound(_0x474a4e,null))['then'](function(_0x381fdb){if(_0x381fdb){return _0x381fdb[_0x2195('0x50')](_0x4ae862[_0x2195('0x47')][_0x2195('0x4b')],_[_0x2195('0x4c')](_0x4ae862[_0x2195('0x47')],[_0x2195('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x474a4e,null))[_0x2195('0x42')](handleError(_0x474a4e,null));};exports['getActions']=function(_0x4f8188,_0x25e5c0,_0x399706){var _0x4b6894={};var _0x1c2d1d={};var _0x3285d4;var _0x40f32d;return db[_0x2195('0x2a')]['findOne']({'where':{'id':_0x4f8188['params']['id']}})[_0x2195('0x23')](handleEntityNotFound(_0x25e5c0,null))[_0x2195('0x23')](function(_0x436a33){if(_0x436a33){_0x3285d4=_0x436a33;_0x1c2d1d[_0x2195('0x36')]=_[_0x2195('0x31')](db[_0x2195('0x51')][_0x2195('0x2b')]);_0x1c2d1d[_0x2195('0x30')]=_[_0x2195('0x31')](_0x4f8188['query']);_0x1c2d1d[_0x2195('0x32')]=_[_0x2195('0x45')](_0x1c2d1d[_0x2195('0x36')],_0x1c2d1d[_0x2195('0x30')]);_0x4b6894[_0x2195('0x33')]=_['intersection'](_0x1c2d1d[_0x2195('0x36')],qs['fields'](_0x4f8188['query'][_0x2195('0x34')]));_0x4b6894[_0x2195('0x33')]=_0x4b6894[_0x2195('0x33')]['length']?_0x4b6894[_0x2195('0x33')]:_0x1c2d1d[_0x2195('0x36')];_0x4b6894['order']=qs[_0x2195('0x39')](_0x4f8188[_0x2195('0x30')][_0x2195('0x39')]);_0x4b6894[_0x2195('0x3a')]=qs[_0x2195('0x32')](_['pick'](_0x4f8188[_0x2195('0x30')],_0x1c2d1d['filters']));if(_0x4f8188['query'][_0x2195('0x3c')]){_0x4b6894[_0x2195('0x3a')]=_[_0x2195('0x3d')](_0x4b6894['where'],{'$or':_[_0x2195('0x2f')](_0x4b6894[_0x2195('0x33')],function(_0x2fc49b){var _0x566c9b={};_0x566c9b[_0x2fc49b]={'$like':'%'+_0x4f8188[_0x2195('0x30')][_0x2195('0x3c')]+'%'};return _0x566c9b;})});}_0x4b6894=_['merge']({},_0x4b6894,_0x4f8188['options']);return _0x3285d4[_0x2195('0x52')](_0x4b6894);}})['then'](function(_0x4dcee9){if(_0x4dcee9){_0x40f32d=_0x4dcee9[_0x2195('0x35')];if(!_0x4f8188['query'][_0x2195('0x4f')](_0x2195('0x37'))){_0x4b6894[_0x2195('0x1d')]=qs[_0x2195('0x1d')](_0x4f8188['query'][_0x2195('0x1d')]);_0x4b6894[_0x2195('0x1c')]=qs[_0x2195('0x1c')](_0x4f8188[_0x2195('0x30')][_0x2195('0x1c')]);}return _0x3285d4[_0x2195('0x52')](_0x4b6894);}})[_0x2195('0x23')](function(_0x374038){if(_0x374038){return _0x374038?{'count':_0x40f32d,'rows':_0x374038}:null;}})['then'](respondWithResult(_0x25e5c0,null))['catch'](handleError(_0x25e5c0,null));};
\ No newline at end of file
+var _0xb6c4=['keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','addConditions','Condition','ids','omit','findOne','getConditions','nolimit','addActions','Action','getActions','eml-format','zip-dir','fast-json-patch','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','Automation','rawAttributes','fieldName','type','key','model','map'];(function(_0x5631ce,_0x5a9a02){var _0x2918bb=function(_0x36042f){while(--_0x36042f){_0x5631ce['push'](_0x5631ce['shift']());}};_0x2918bb(++_0x5a9a02);}(_0xb6c4,0x1c7));var _0x4b6c=function(_0x4999c3,_0x54660b){_0x4999c3=_0x4999c3-0x0;var _0x55863a=_0xb6c4[_0x4999c3];return _0x55863a;};'use strict';var emlformat=require(_0x4b6c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b6c('0x1'));var jsonpatch=require(_0x4b6c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4b6c('0x3'));var util=require('util');var path=require(_0x4b6c('0x4'));var sox=require(_0x4b6c('0x5'));var csv=require(_0x4b6c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b6c('0x7'));var _=require(_0x4b6c('0x8'));var squel=require(_0x4b6c('0x9'));var crypto=require(_0x4b6c('0xa'));var jsforce=require(_0x4b6c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4b6c('0x6'));var querystring=require(_0x4b6c('0xc'));var Papa=require(_0x4b6c('0xd'));var Redis=require(_0x4b6c('0xe'));var authService=require(_0x4b6c('0xf'));var qs=require(_0x4b6c('0x10'));var as=require(_0x4b6c('0x11'));var hardwareService=require(_0x4b6c('0x12'));var logger=require(_0x4b6c('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4b6c('0x14'));var db=require(_0x4b6c('0x15'))['db'];function respondWithStatusCode(_0x112fc7,_0x220f3b){_0x220f3b=_0x220f3b||0xcc;return function(_0x1dee4c){if(_0x1dee4c){return _0x112fc7[_0x4b6c('0x16')](_0x220f3b);}return _0x112fc7['status'](_0x220f3b)[_0x4b6c('0x17')]();};}function respondWithResult(_0x65ba6c,_0x261a23){_0x261a23=_0x261a23||0xc8;return function(_0x4ff32c){if(_0x4ff32c){return _0x65ba6c['status'](_0x261a23)[_0x4b6c('0x18')](_0x4ff32c);}};}function respondWithFilteredResult(_0xe95fe,_0x3a46eb){return function(_0x3ba285){if(_0x3ba285){var _0x2b2164=typeof _0x3a46eb['offset']==='undefined'&&typeof _0x3a46eb[_0x4b6c('0x19')]===_0x4b6c('0x1a');var _0x13ead9=_0x3ba285[_0x4b6c('0x1b')];var _0x4f7eda=_0x2b2164?0x0:_0x3a46eb['offset'];var _0x4d2688=_0x2b2164?_0x3ba285[_0x4b6c('0x1b')]:_0x3a46eb[_0x4b6c('0x1c')]+_0x3a46eb[_0x4b6c('0x19')];var _0x29de1f;if(_0x4d2688>=_0x13ead9){_0x4d2688=_0x13ead9;_0x29de1f=0xc8;}else{_0x29de1f=0xce;}_0xe95fe[_0x4b6c('0x1d')](_0x29de1f);return _0xe95fe[_0x4b6c('0x1e')](_0x4b6c('0x1f'),_0x4f7eda+'-'+_0x4d2688+'/'+_0x13ead9)[_0x4b6c('0x18')](_0x3ba285);}return null;};}function patchUpdates(_0x3f20f6){return function(_0x393be5){try{jsonpatch[_0x4b6c('0x20')](_0x393be5,_0x3f20f6,!![]);}catch(_0x1b1a9c){return BPromise[_0x4b6c('0x21')](_0x1b1a9c);}return _0x393be5[_0x4b6c('0x22')]();};}function saveUpdates(_0x344aaf,_0x2e6b6c){return function(_0x4cc4ff){if(_0x4cc4ff){return _0x4cc4ff[_0x4b6c('0x23')](_0x344aaf)[_0x4b6c('0x24')](function(_0x19c228){return _0x19c228;});}return null;};}function removeEntity(_0x368fa0,_0x6d1101){return function(_0x291366){if(_0x291366){return _0x291366[_0x4b6c('0x25')]()[_0x4b6c('0x24')](function(){_0x368fa0[_0x4b6c('0x1d')](0xcc)[_0x4b6c('0x17')]();});}};}function handleEntityNotFound(_0x5cb9b3,_0x493585){return function(_0x258638){if(!_0x258638){_0x5cb9b3[_0x4b6c('0x16')](0x194);}return _0x258638;};}function handleError(_0x10cd61,_0x1bde73){_0x1bde73=_0x1bde73||0x1f4;return function(_0x44e255){logger[_0x4b6c('0x26')](_0x44e255['stack']);if(_0x44e255[_0x4b6c('0x27')]){delete _0x44e255[_0x4b6c('0x27')];}_0x10cd61[_0x4b6c('0x1d')](_0x1bde73)[_0x4b6c('0x28')](_0x44e255);};}exports[_0x4b6c('0x29')]=function(_0x140349,_0x334cff){var _0x4869b9={},_0x136291={},_0x2cbe71={'count':0x0,'rows':[]};var _0x8fdc6c=_['map'](db[_0x4b6c('0x2a')][_0x4b6c('0x2b')],function(_0x254944){return{'name':_0x254944[_0x4b6c('0x2c')],'type':_0x254944[_0x4b6c('0x2d')][_0x4b6c('0x2e')]};});_0x136291[_0x4b6c('0x2f')]=_[_0x4b6c('0x30')](_0x8fdc6c,_0x4b6c('0x27'));_0x136291['query']=_[_0x4b6c('0x31')](_0x140349['query']);_0x136291[_0x4b6c('0x32')]=_[_0x4b6c('0x33')](_0x136291[_0x4b6c('0x2f')],_0x136291[_0x4b6c('0x34')]);_0x4869b9[_0x4b6c('0x35')]=_['intersection'](_0x136291[_0x4b6c('0x2f')],qs[_0x4b6c('0x36')](_0x140349[_0x4b6c('0x34')][_0x4b6c('0x36')]));_0x4869b9[_0x4b6c('0x35')]=_0x4869b9[_0x4b6c('0x35')]['length']?_0x4869b9[_0x4b6c('0x35')]:_0x136291[_0x4b6c('0x2f')];if(!_0x140349[_0x4b6c('0x34')][_0x4b6c('0x37')]('nolimit')){_0x4869b9[_0x4b6c('0x19')]=qs[_0x4b6c('0x19')](_0x140349['query'][_0x4b6c('0x19')]);_0x4869b9[_0x4b6c('0x1c')]=qs['offset'](_0x140349['query'][_0x4b6c('0x1c')]);}_0x4869b9[_0x4b6c('0x38')]=qs[_0x4b6c('0x39')](_0x140349[_0x4b6c('0x34')]['sort']);_0x4869b9[_0x4b6c('0x3a')]=qs['filters'](_[_0x4b6c('0x3b')](_0x140349[_0x4b6c('0x34')],_0x136291['filters']),_0x8fdc6c);if(_0x140349[_0x4b6c('0x34')]['filter']){_0x4869b9[_0x4b6c('0x3a')]=_[_0x4b6c('0x3c')](_0x4869b9[_0x4b6c('0x3a')],{'$or':_[_0x4b6c('0x30')](_0x8fdc6c,function(_0x5734cb){if(_0x5734cb[_0x4b6c('0x2d')]!=='VIRTUAL'){var _0x97a919={};_0x97a919[_0x5734cb[_0x4b6c('0x27')]]={'$like':'%'+_0x140349[_0x4b6c('0x34')][_0x4b6c('0x3d')]+'%'};return _0x97a919;}})});}_0x4869b9=_[_0x4b6c('0x3c')]({},_0x4869b9,_0x140349['options']);var _0x151bf3={'where':_0x4869b9[_0x4b6c('0x3a')]};return db['Automation'][_0x4b6c('0x1b')](_0x151bf3)['then'](function(_0x18d47f){_0x2cbe71[_0x4b6c('0x1b')]=_0x18d47f;if(_0x140349[_0x4b6c('0x34')][_0x4b6c('0x3e')]){_0x4869b9[_0x4b6c('0x3f')]=[{'all':!![]}];}return db[_0x4b6c('0x2a')][_0x4b6c('0x40')](_0x4869b9);})[_0x4b6c('0x24')](function(_0x2c53ad){_0x2cbe71[_0x4b6c('0x41')]=_0x2c53ad;return _0x2cbe71;})['then'](respondWithFilteredResult(_0x334cff,_0x4869b9))[_0x4b6c('0x42')](handleError(_0x334cff,null));};exports[_0x4b6c('0x43')]=function(_0x43ddc4,_0x57c07f){var _0x2389f3={'raw':![],'where':{'id':_0x43ddc4[_0x4b6c('0x44')]['id']}},_0xfe3c57={};_0xfe3c57[_0x4b6c('0x2f')]=_[_0x4b6c('0x31')](db['Automation']['rawAttributes']);_0xfe3c57[_0x4b6c('0x34')]=_['keys'](_0x43ddc4[_0x4b6c('0x34')]);_0xfe3c57[_0x4b6c('0x32')]=_['intersection'](_0xfe3c57[_0x4b6c('0x2f')],_0xfe3c57[_0x4b6c('0x34')]);_0x2389f3[_0x4b6c('0x35')]=_[_0x4b6c('0x33')](_0xfe3c57[_0x4b6c('0x2f')],qs[_0x4b6c('0x36')](_0x43ddc4[_0x4b6c('0x34')][_0x4b6c('0x36')]));_0x2389f3[_0x4b6c('0x35')]=_0x2389f3[_0x4b6c('0x35')][_0x4b6c('0x45')]?_0x2389f3['attributes']:_0xfe3c57[_0x4b6c('0x2f')];if(_0x43ddc4[_0x4b6c('0x34')][_0x4b6c('0x3e')]){_0x2389f3[_0x4b6c('0x3f')]=[{'all':!![]}];}_0x2389f3=_['merge']({},_0x2389f3,_0x43ddc4[_0x4b6c('0x46')]);return db[_0x4b6c('0x2a')][_0x4b6c('0x47')](_0x2389f3)[_0x4b6c('0x24')](handleEntityNotFound(_0x57c07f,null))['then'](respondWithResult(_0x57c07f,null))[_0x4b6c('0x42')](handleError(_0x57c07f,null));};exports[_0x4b6c('0x48')]=function(_0x82167,_0x4cd01f){return db[_0x4b6c('0x2a')][_0x4b6c('0x48')](_0x82167[_0x4b6c('0x49')],{})[_0x4b6c('0x24')](respondWithResult(_0x4cd01f,0xc9))[_0x4b6c('0x42')](handleError(_0x4cd01f,null));};exports[_0x4b6c('0x23')]=function(_0x362216,_0x3f7938){if(_0x362216[_0x4b6c('0x49')]['id']){delete _0x362216[_0x4b6c('0x49')]['id'];}return db[_0x4b6c('0x2a')]['find']({'where':{'id':_0x362216['params']['id']}})[_0x4b6c('0x24')](handleEntityNotFound(_0x3f7938,null))[_0x4b6c('0x24')](saveUpdates(_0x362216[_0x4b6c('0x49')],null))[_0x4b6c('0x24')](respondWithResult(_0x3f7938,null))['catch'](handleError(_0x3f7938,null));};exports['destroy']=function(_0x30b372,_0xdedd33){return db['Automation']['find']({'where':{'id':_0x30b372[_0x4b6c('0x44')]['id']}})[_0x4b6c('0x24')](handleEntityNotFound(_0xdedd33,null))[_0x4b6c('0x24')](removeEntity(_0xdedd33,null))['catch'](handleError(_0xdedd33,null));};exports[_0x4b6c('0x4a')]=function(_0x3b65c8,_0x1a158d,_0x5a5fc4){return db[_0x4b6c('0x4b')][_0x4b6c('0x47')]({'where':{'id':_0x3b65c8['params']['id']}})['then'](handleEntityNotFound(_0x1a158d,null))[_0x4b6c('0x24')](function(_0x43d305){if(_0x43d305){return _0x43d305[_0x4b6c('0x4a')](_0x3b65c8[_0x4b6c('0x49')][_0x4b6c('0x4c')],_[_0x4b6c('0x4d')](_0x3b65c8[_0x4b6c('0x49')],['ids','id'])||{});}})['then'](respondWithResult(_0x1a158d,null))['catch'](handleError(_0x1a158d,null));};exports['getConditions']=function(_0xe8cbe2,_0x3072d8,_0x365e8f){var _0x435c9d={};var _0x1a7b18={};var _0x33ab3b;var _0x2e3191;return db['Automation'][_0x4b6c('0x4e')]({'where':{'id':_0xe8cbe2['params']['id']}})[_0x4b6c('0x24')](handleEntityNotFound(_0x3072d8,null))['then'](function(_0x13a18d){if(_0x13a18d){_0x33ab3b=_0x13a18d;_0x1a7b18[_0x4b6c('0x2f')]=_[_0x4b6c('0x31')](db[_0x4b6c('0x4b')]['rawAttributes']);_0x1a7b18[_0x4b6c('0x34')]=_['keys'](_0xe8cbe2[_0x4b6c('0x34')]);_0x1a7b18[_0x4b6c('0x32')]=_[_0x4b6c('0x33')](_0x1a7b18[_0x4b6c('0x2f')],_0x1a7b18[_0x4b6c('0x34')]);_0x435c9d[_0x4b6c('0x35')]=_[_0x4b6c('0x33')](_0x1a7b18[_0x4b6c('0x2f')],qs[_0x4b6c('0x36')](_0xe8cbe2[_0x4b6c('0x34')][_0x4b6c('0x36')]));_0x435c9d['attributes']=_0x435c9d[_0x4b6c('0x35')][_0x4b6c('0x45')]?_0x435c9d[_0x4b6c('0x35')]:_0x1a7b18['model'];_0x435c9d['order']=qs[_0x4b6c('0x39')](_0xe8cbe2[_0x4b6c('0x34')]['sort']);_0x435c9d['where']=qs['filters'](_[_0x4b6c('0x3b')](_0xe8cbe2[_0x4b6c('0x34')],_0x1a7b18[_0x4b6c('0x32')]));if(_0xe8cbe2['query'][_0x4b6c('0x3d')]){_0x435c9d[_0x4b6c('0x3a')]=_[_0x4b6c('0x3c')](_0x435c9d[_0x4b6c('0x3a')],{'$or':_[_0x4b6c('0x30')](_0x435c9d[_0x4b6c('0x35')],function(_0x369751){var _0x2e52f3={};_0x2e52f3[_0x369751]={'$like':'%'+_0xe8cbe2[_0x4b6c('0x34')][_0x4b6c('0x3d')]+'%'};return _0x2e52f3;})});}_0x435c9d=_['merge']({},_0x435c9d,_0xe8cbe2[_0x4b6c('0x46')]);return _0x33ab3b[_0x4b6c('0x4f')](_0x435c9d);}})[_0x4b6c('0x24')](function(_0x424f56){if(_0x424f56){_0x2e3191=_0x424f56['length'];if(!_0xe8cbe2[_0x4b6c('0x34')][_0x4b6c('0x37')](_0x4b6c('0x50'))){_0x435c9d[_0x4b6c('0x19')]=qs[_0x4b6c('0x19')](_0xe8cbe2[_0x4b6c('0x34')][_0x4b6c('0x19')]);_0x435c9d['offset']=qs['offset'](_0xe8cbe2['query']['offset']);}return _0x33ab3b[_0x4b6c('0x4f')](_0x435c9d);}})[_0x4b6c('0x24')](function(_0x2713b8){if(_0x2713b8){return _0x2713b8?{'count':_0x2e3191,'rows':_0x2713b8}:null;}})[_0x4b6c('0x24')](respondWithResult(_0x3072d8,null))[_0x4b6c('0x42')](handleError(_0x3072d8,null));};exports[_0x4b6c('0x51')]=function(_0x39fe74,_0x1e0ff6,_0x17da5a){return db[_0x4b6c('0x52')][_0x4b6c('0x47')]({'where':{'id':_0x39fe74[_0x4b6c('0x44')]['id']}})[_0x4b6c('0x24')](handleEntityNotFound(_0x1e0ff6,null))[_0x4b6c('0x24')](function(_0x200456){if(_0x200456){return _0x200456[_0x4b6c('0x51')](_0x39fe74[_0x4b6c('0x49')][_0x4b6c('0x4c')],_[_0x4b6c('0x4d')](_0x39fe74[_0x4b6c('0x49')],[_0x4b6c('0x4c'),'id'])||{});}})[_0x4b6c('0x24')](respondWithResult(_0x1e0ff6,null))[_0x4b6c('0x42')](handleError(_0x1e0ff6,null));};exports['getActions']=function(_0x2a15d0,_0x20b7ad,_0x2f9bca){var _0x6f18ba={};var _0x4b9b3a={};var _0x599da4;var _0x32f734;return db[_0x4b6c('0x2a')][_0x4b6c('0x4e')]({'where':{'id':_0x2a15d0[_0x4b6c('0x44')]['id']}})['then'](handleEntityNotFound(_0x20b7ad,null))['then'](function(_0x2fc410){if(_0x2fc410){_0x599da4=_0x2fc410;_0x4b9b3a[_0x4b6c('0x2f')]=_[_0x4b6c('0x31')](db[_0x4b6c('0x52')][_0x4b6c('0x2b')]);_0x4b9b3a[_0x4b6c('0x34')]=_[_0x4b6c('0x31')](_0x2a15d0[_0x4b6c('0x34')]);_0x4b9b3a[_0x4b6c('0x32')]=_[_0x4b6c('0x33')](_0x4b9b3a[_0x4b6c('0x2f')],_0x4b9b3a[_0x4b6c('0x34')]);_0x6f18ba[_0x4b6c('0x35')]=_[_0x4b6c('0x33')](_0x4b9b3a[_0x4b6c('0x2f')],qs[_0x4b6c('0x36')](_0x2a15d0[_0x4b6c('0x34')][_0x4b6c('0x36')]));_0x6f18ba['attributes']=_0x6f18ba[_0x4b6c('0x35')]['length']?_0x6f18ba[_0x4b6c('0x35')]:_0x4b9b3a[_0x4b6c('0x2f')];_0x6f18ba[_0x4b6c('0x38')]=qs['sort'](_0x2a15d0[_0x4b6c('0x34')][_0x4b6c('0x39')]);_0x6f18ba[_0x4b6c('0x3a')]=qs[_0x4b6c('0x32')](_[_0x4b6c('0x3b')](_0x2a15d0[_0x4b6c('0x34')],_0x4b9b3a[_0x4b6c('0x32')]));if(_0x2a15d0[_0x4b6c('0x34')][_0x4b6c('0x3d')]){_0x6f18ba[_0x4b6c('0x3a')]=_[_0x4b6c('0x3c')](_0x6f18ba[_0x4b6c('0x3a')],{'$or':_['map'](_0x6f18ba[_0x4b6c('0x35')],function(_0x21d19b){var _0x242c40={};_0x242c40[_0x21d19b]={'$like':'%'+_0x2a15d0['query']['filter']+'%'};return _0x242c40;})});}_0x6f18ba=_[_0x4b6c('0x3c')]({},_0x6f18ba,_0x2a15d0[_0x4b6c('0x46')]);return _0x599da4[_0x4b6c('0x53')](_0x6f18ba);}})[_0x4b6c('0x24')](function(_0xac0734){if(_0xac0734){_0x32f734=_0xac0734[_0x4b6c('0x45')];if(!_0x2a15d0[_0x4b6c('0x34')]['hasOwnProperty'](_0x4b6c('0x50'))){_0x6f18ba[_0x4b6c('0x19')]=qs['limit'](_0x2a15d0[_0x4b6c('0x34')]['limit']);_0x6f18ba[_0x4b6c('0x1c')]=qs[_0x4b6c('0x1c')](_0x2a15d0['query'][_0x4b6c('0x1c')]);}return _0x599da4[_0x4b6c('0x53')](_0x6f18ba);}})[_0x4b6c('0x24')](function(_0x18fc0f){if(_0x18fc0f){return _0x18fc0f?{'count':_0x32f734,'rows':_0x18fc0f}:null;}})[_0x4b6c('0x24')](respondWithResult(_0x20b7ad,null))[_0x4b6c('0x42')](handleError(_0x20b7ad,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index f282717..8156332 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 _0x0e4e=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash'];(function(_0x5e38f9,_0x5db6c4){var _0x4a914f=function(_0x369d29){while(--_0x369d29){_0x5e38f9['push'](_0x5e38f9['shift']());}};_0x4a914f(++_0x5db6c4);}(_0x0e4e,0x15e));var _0xe0e4=function(_0x1b69aa,_0x5aa147){_0x1b69aa=_0x1b69aa-0x0;var _0x42647d=_0x0e4e[_0x1b69aa];return _0x42647d;};'use strict';var _=require(_0xe0e4('0x0'));var util=require(_0xe0e4('0x1'));var logger=require(_0xe0e4('0x2'))('api');var moment=require(_0xe0e4('0x3'));var BPromise=require('bluebird');var rp=require(_0xe0e4('0x4'));var fs=require('fs');var path=require(_0xe0e4('0x5'));var rimraf=require(_0xe0e4('0x6'));var config=require(_0xe0e4('0x7'));var attributes=require(_0xe0e4('0x8'));module[_0xe0e4('0x9')]=function(_0xcbf2cc,_0x454d2e){return _0xcbf2cc[_0xe0e4('0xa')](_0xe0e4('0xb'),attributes,{'tableName':_0xe0e4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1b8a=['Automation','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./automation.attributes','exports','define'];(function(_0x5f213f,_0x1885d0){var _0x12be75=function(_0x2fe76f){while(--_0x2fe76f){_0x5f213f['push'](_0x5f213f['shift']());}};_0x12be75(++_0x1885d0);}(_0x1b8a,0x17a));var _0xa1b8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1b8a[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xa1b8('0x0'));var util=require(_0xa1b8('0x1'));var logger=require(_0xa1b8('0x2'))(_0xa1b8('0x3'));var moment=require(_0xa1b8('0x4'));var BPromise=require(_0xa1b8('0x5'));var rp=require(_0xa1b8('0x6'));var fs=require('fs');var path=require(_0xa1b8('0x7'));var rimraf=require(_0xa1b8('0x8'));var config=require('../../config/environment');var attributes=require(_0xa1b8('0x9'));module[_0xa1b8('0xa')]=function(_0x12efec,_0x24b051){return _0x12efec[_0xa1b8('0xb')](_0xa1b8('0xc'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 953028a..6fae16e 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 _0xf9ac=['info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','Automation,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','then'];(function(_0x5dde65,_0x1eb6f7){var _0x1e9245=function(_0x5ce237){while(--_0x5ce237){_0x5dde65['push'](_0x5dde65['shift']());}};_0x1e9245(++_0x1eb6f7);}(_0xf9ac,0x87));var _0xcf9a=function(_0x4eb5a8,_0x35684b){_0x4eb5a8=_0x4eb5a8-0x0;var _0x29b9fb=_0xf9ac[_0x4eb5a8];return _0x29b9fb;};'use strict';var _=require(_0xcf9a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcf9a('0x1'));var rs=require(_0xcf9a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf9a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf9a('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcf9a('0x5'));var client=jayson[_0xcf9a('0x6')][_0xcf9a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x235e47,_0x54ebf6,_0x33a1a6){return new BPromise(function(_0x3d2f54,_0x4c0665){return client['request'](_0x235e47,_0x33a1a6)[_0xcf9a('0x8')](function(_0x579cf9){logger[_0xcf9a('0x9')]('Automation,\x20%s,\x20%s',_0x54ebf6,_0xcf9a('0xa'));logger['debug'](_0xcf9a('0xb'),_0x54ebf6,_0xcf9a('0xa'),JSON[_0xcf9a('0xc')](_0x579cf9));if(_0x579cf9['error']){if(_0x579cf9['error']['code']===0x1f4){logger[_0xcf9a('0xd')](_0xcf9a('0xe'),_0x54ebf6,_0x579cf9['error'][_0xcf9a('0xf')]);return _0x4c0665(_0x579cf9[_0xcf9a('0xd')][_0xcf9a('0xf')]);}logger['error'](_0xcf9a('0xe'),_0x54ebf6,_0x579cf9['error']['message']);return _0x3d2f54(_0x579cf9['error']['message']);}else{logger[_0xcf9a('0x9')](_0xcf9a('0xe'),_0x54ebf6,_0xcf9a('0xa'));_0x3d2f54(_0x579cf9[_0xcf9a('0x10')][_0xcf9a('0xf')]);}})[_0xcf9a('0x11')](function(_0x25dc10){logger['error'](_0xcf9a('0xe'),_0x54ebf6,_0x25dc10);_0x4c0665(_0x25dc10);});});}
\ No newline at end of file
+var _0x3445=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Automation,\x20%s,\x20%s'];(function(_0x270e59,_0x373914){var _0x115eb2=function(_0xce15dc){while(--_0xce15dc){_0x270e59['push'](_0x270e59['shift']());}};_0x115eb2(++_0x373914);}(_0x3445,0x1b7));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5344('0x0'));var util=require(_0x5344('0x1'));var moment=require(_0x5344('0x2'));var BPromise=require(_0x5344('0x3'));var rs=require(_0x5344('0x4'));var fs=require('fs');var Redis=require(_0x5344('0x5'));var db=require(_0x5344('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5344('0x7'));var config=require(_0x5344('0x8'));var jayson=require(_0x5344('0x9'));var client=jayson[_0x5344('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ffe5f,_0x5642cb,_0x5a4f52){return new BPromise(function(_0x3f638c,_0x4adb8a){return client['request'](_0x4ffe5f,_0x5a4f52)[_0x5344('0xb')](function(_0xbc5346){logger[_0x5344('0xc')]('Automation,\x20%s,\x20%s',_0x5642cb,_0x5344('0xd'));logger[_0x5344('0xe')](_0x5344('0xf'),_0x5642cb,_0x5344('0xd'),JSON[_0x5344('0x10')](_0xbc5346));if(_0xbc5346[_0x5344('0x11')]){if(_0xbc5346['error'][_0x5344('0x12')]===0x1f4){logger[_0x5344('0x11')]('Automation,\x20%s,\x20%s',_0x5642cb,_0xbc5346[_0x5344('0x11')]['message']);return _0x4adb8a(_0xbc5346[_0x5344('0x11')]['message']);}logger['error']('Automation,\x20%s,\x20%s',_0x5642cb,_0xbc5346[_0x5344('0x11')][_0x5344('0x13')]);return _0x3f638c(_0xbc5346[_0x5344('0x11')][_0x5344('0x13')]);}else{logger[_0x5344('0xc')](_0x5344('0x14'),_0x5642cb,_0x5344('0xd'));_0x3f638c(_0xbc5346[_0x5344('0x15')][_0x5344('0x13')]);}})[_0x5344('0x16')](function(_0x4ae241){logger[_0x5344('0x11')](_0x5344('0x14'),_0x5642cb,_0x4ae241);_0x4adb8a(_0x4ae241);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 0cf3021..f9a94da 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 _0x28aa=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','put','update','delete','destroy','exports','util','path'];(function(_0x472ae7,_0x525a04){var _0x294c08=function(_0x1dc144){while(--_0x1dc144){_0x472ae7['push'](_0x472ae7['shift']());}};_0x294c08(++_0x525a04);}(_0x28aa,0xf8));var _0xa28a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x28aa[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0xa28a('0x0'));var path=require(_0xa28a('0x1'));var timeout=require(_0xa28a('0x2'));var express=require(_0xa28a('0x3'));var router=express[_0xa28a('0x4')]();var fs_extra=require(_0xa28a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa28a('0x6'));var config=require(_0xa28a('0x7'));var controller=require(_0xa28a('0x8'));router[_0xa28a('0x9')]('/',auth['isAuthenticated'](),controller[_0xa28a('0xa')]);router[_0xa28a('0x9')](_0xa28a('0xb'),auth[_0xa28a('0xc')](),controller[_0xa28a('0xd')]);router[_0xa28a('0x9')](_0xa28a('0xe'),auth[_0xa28a('0xc')](),controller[_0xa28a('0xf')]);router[_0xa28a('0x9')](_0xa28a('0x10'),auth[_0xa28a('0xc')](),controller[_0xa28a('0x11')]);router[_0xa28a('0x12')]('/',auth[_0xa28a('0xc')](),controller['create']);router[_0xa28a('0x12')](_0xa28a('0xe'),auth[_0xa28a('0xc')](),controller[_0xa28a('0x13')]);router['post'](_0xa28a('0x10'),auth[_0xa28a('0xc')](),controller['addActions']);router[_0xa28a('0x14')](_0xa28a('0xb'),auth[_0xa28a('0xc')](),controller[_0xa28a('0x15')]);router[_0xa28a('0x16')](_0xa28a('0xb'),auth[_0xa28a('0xc')](),controller[_0xa28a('0x17')]);module[_0xa28a('0x18')]=router;
\ No newline at end of file
+var _0xbc82=['isAuthenticated','show','get','/:id/conditions','post','create','addConditions','/:id/actions','addActions','put','/:id','update','delete','destroy','multer','express','../../components/auth/service','./automation.controller','index'];(function(_0x88d3a,_0x5541d5){var _0x549872=function(_0x129617){while(--_0x129617){_0x88d3a['push'](_0x88d3a['shift']());}};_0x549872(++_0x5541d5);}(_0xbc82,0x13e));var _0x2bc8=function(_0x5ef539,_0x4217c9){_0x5ef539=_0x5ef539-0x0;var _0x2be138=_0xbc82[_0x5ef539];return _0x2be138;};'use strict';var multer=require(_0x2bc8('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2bc8('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2bc8('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2bc8('0x3'));router['get']('/',auth['isAuthenticated'](),controller[_0x2bc8('0x4')]);router['get']('/:id',auth[_0x2bc8('0x5')](),controller[_0x2bc8('0x6')]);router[_0x2bc8('0x7')](_0x2bc8('0x8'),auth[_0x2bc8('0x5')](),controller['getConditions']);router[_0x2bc8('0x7')]('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router[_0x2bc8('0x9')]('/',auth[_0x2bc8('0x5')](),controller[_0x2bc8('0xa')]);router[_0x2bc8('0x9')](_0x2bc8('0x8'),auth[_0x2bc8('0x5')](),controller[_0x2bc8('0xb')]);router[_0x2bc8('0x9')](_0x2bc8('0xc'),auth['isAuthenticated'](),controller[_0x2bc8('0xd')]);router[_0x2bc8('0xe')](_0x2bc8('0xf'),auth[_0x2bc8('0x5')](),controller[_0x2bc8('0x10')]);router[_0x2bc8('0x11')](_0x2bc8('0xf'),auth[_0x2bc8('0x5')](),controller[_0x2bc8('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index e610e95..55710f9 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 _0x8251=['exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#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\x20(min:1,\x20max:999)','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8251,0x8f));var _0x1825=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8251[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x1825('0x0'));module[_0x1825('0x1')]={'name':{'type':Sequelize[_0x1825('0x2')],'unique':_0x1825('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1825('0x4')](_0x1825('0x5')),'allowNull':![],'defaultValue':_0x1825('0x5')},'description':{'type':Sequelize[_0x1825('0x2')]},'active':{'type':Sequelize[_0x1825('0x6')],'defaultValue':0x0,'comment':_0x1825('0x7')},'limitCalls':{'type':Sequelize[_0x1825('0x8')](0x4)[_0x1825('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1825('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1825('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1825('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x1825('0x8')](0x3)[_0x1825('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x1825('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1825('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1825('0x8')](0x5)[_0x1825('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x1825('0x8')](0x3)[_0x1825('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1825('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1825('0x8')](0x5)[_0x1825('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1825('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1825('0x9')],'defaultValue':0x3,'comment':_0x1825('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1825('0x8')](0x5)[_0x1825('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x1825('0x8')](0x3)[_0x1825('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x1825('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1825('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x1825('0xf'),'never',_0x1825('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x1825('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x1825('0x8')](0x9)[_0x1825('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1825('0x11')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x1825('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1825('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1825('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1825('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x1825('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x1825('0x8')](0x9)[_0x1825('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1825('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1825('0x8')](0x9)[_0x1825('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1825('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1825('0x8')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1825('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1825('0x8')](0x5)[_0x1825('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1825('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1825('0x8')](0x9)[_0x1825('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1825('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1825('0x4')](_0x1825('0x19'),_0x1825('0x1a')),'defaultValue':_0x1825('0x19')},'dialPrefix':{'type':Sequelize[_0x1825('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1825('0x8')](0x3)[_0x1825('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1825('0x1b')},'dialCutDigit':{'type':Sequelize[_0x1825('0x8')](0x3)[_0x1825('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1825('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1825('0x8')](0x3)[_0x1825('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1825('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1825('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1825('0x1d')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1825('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1825('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1825('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1825('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1825('0x8')](0x5)[_0x1825('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1825('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x1825('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1825('0x21')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1825('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1825('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1825('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1825('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1825('0x23')}};
\ No newline at end of file
+var _0xfa9e=['STRING','name','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','never','onlyIfOpen','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports'];(function(_0x3fb81f,_0x1c20f4){var _0x5d4769=function(_0x4ebdd3){while(--_0x4ebdd3){_0x3fb81f['push'](_0x3fb81f['shift']());}};_0x5d4769(++_0x1c20f4);}(_0xfa9e,0x1de));var _0xefa9=function(_0x4dbdeb,_0x52d5b8){_0x4dbdeb=_0x4dbdeb-0x0;var _0x19bc36=_0xfa9e[_0x4dbdeb];return _0x19bc36;};'use strict';var Sequelize=require(_0xefa9('0x0'));module[_0xefa9('0x1')]={'name':{'type':Sequelize[_0xefa9('0x2')],'unique':_0xefa9('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xefa9('0x4')),'allowNull':![],'defaultValue':_0xefa9('0x4')},'description':{'type':Sequelize[_0xefa9('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xefa9('0x5')},'limitCalls':{'type':Sequelize[_0xefa9('0x6')](0x4)[_0xefa9('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xefa9('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xefa9('0x6')](0x3)[_0xefa9('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xefa9('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xefa9('0x6')](0x3)[_0xefa9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xefa9('0x6')](0x5)[_0xefa9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xefa9('0x6')](0x3)[_0xefa9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xefa9('0x9')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xefa9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xefa9('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xefa9('0x6')](0x3)[_0xefa9('0x7')],'defaultValue':0x3,'comment':_0xefa9('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xefa9('0x6')](0x3)[_0xefa9('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xefa9('0xc')},'dialTimezone':{'type':Sequelize[_0xefa9('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xefa9('0x2')],'defaultValue':_0xefa9('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0xefa9('0xe')]('always',_0xefa9('0xf'),_0xefa9('0x10')),'defaultValue':_0xefa9('0x11')},'dialAMDActive':{'type':Sequelize[_0xefa9('0x12')],'defaultValue':0x0,'comment':_0xefa9('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xefa9('0x6')](0x9)[_0xefa9('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xefa9('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xefa9('0x6')](0x9)[_0xefa9('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xefa9('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xefa9('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xefa9('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xefa9('0x6')](0x9)[_0xefa9('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xefa9('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xefa9('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xefa9('0x6')](0x9)[_0xefa9('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xefa9('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xefa9('0x6')](0x9)[_0xefa9('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xefa9('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xefa9('0x6')](0x5)[_0xefa9('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xefa9('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xefa9('0x6')](0x9)[_0xefa9('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xefa9('0x1b'),_0xefa9('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xefa9('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xefa9('0x6')](0x3)[_0xefa9('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xefa9('0x1d')},'dialCutDigit':{'type':Sequelize[_0xefa9('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xefa9('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xefa9('0x6')](0x3)[_0xefa9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xefa9('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xefa9('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xefa9('0x6')](0x3)[_0xefa9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xefa9('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xefa9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xefa9('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xefa9('0x6')](0x3)[_0xefa9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xefa9('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xefa9('0x6')](0x5)[_0xefa9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xefa9('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xefa9('0x6')](0x3)[_0xefa9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xefa9('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xefa9('0x6')](0x5)[_0xefa9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xefa9('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xefa9('0x6')](0x3)[_0xefa9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xefa9('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xefa9('0x6')](0x5)[_0xefa9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xefa9('0x27')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 0c6c455..3000fb8 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 _0x7fce=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','clone','includeAll','omit','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','ContactId','select','field','NOW()','scheduledAt','CmListId','toString','ListId','createdAt','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','name','send','map','Campaign','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','rows','catch','show','params','rawAttributes','options','find'];(function(_0x16e906,_0x27f2f8){var _0x20d8ed=function(_0x5ac187){while(--_0x5ac187){_0x16e906['push'](_0x16e906['shift']());}};_0x20d8ed(++_0x27f2f8);}(_0x7fce,0xdc));var _0xe7fc=function(_0x1c2dba,_0x563270){_0x1c2dba=_0x1c2dba-0x0;var _0x300d47=_0x7fce[_0x1c2dba];return _0x300d47;};'use strict';var emlformat=require(_0xe7fc('0x0'));var rimraf=require(_0xe7fc('0x1'));var zipdir=require(_0xe7fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7fc('0x3'));var moment=require('moment');var BPromise=require(_0xe7fc('0x4'));var Mustache=require('mustache');var util=require(_0xe7fc('0x5'));var path=require(_0xe7fc('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe7fc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe7fc('0x8'));var squel=require(_0xe7fc('0x9'));var crypto=require(_0xe7fc('0xa'));var jsforce=require(_0xe7fc('0xb'));var deskjs=require(_0xe7fc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe7fc('0xd'));var Papa=require('papaparse');var Redis=require(_0xe7fc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe7fc('0xf'));var as=require(_0xe7fc('0x10'));var hardwareService=require(_0xe7fc('0x11'));var logger=require(_0xe7fc('0x12'))('api');var utils=require(_0xe7fc('0x13'));var config=require(_0xe7fc('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x243600,_0x59da2e){_0x59da2e=_0x59da2e||0xcc;return function(_0x38512a){if(_0x38512a){return _0x243600['sendStatus'](_0x59da2e);}return _0x243600['status'](_0x59da2e)[_0xe7fc('0x15')]();};}function respondWithResult(_0x14fcbf,_0x235692){_0x235692=_0x235692||0xc8;return function(_0x307f58){if(_0x307f58){return _0x14fcbf[_0xe7fc('0x16')](_0x235692)['json'](_0x307f58);}};}function respondWithFilteredResult(_0x272cd5,_0x5ce83f){return function(_0x4da73b){if(_0x4da73b){var _0x1302e5=typeof _0x5ce83f[_0xe7fc('0x17')]===_0xe7fc('0x18')&&typeof _0x5ce83f[_0xe7fc('0x19')]==='undefined';var _0x552429=_0x4da73b['count'];var _0x4aa4f0=_0x1302e5?0x0:_0x5ce83f['offset'];var _0x490a99=_0x1302e5?_0x4da73b[_0xe7fc('0x1a')]:_0x5ce83f['offset']+_0x5ce83f[_0xe7fc('0x19')];var _0xb43fde;if(_0x490a99>=_0x552429){_0x490a99=_0x552429;_0xb43fde=0xc8;}else{_0xb43fde=0xce;}_0x272cd5[_0xe7fc('0x16')](_0xb43fde);return _0x272cd5[_0xe7fc('0x1b')](_0xe7fc('0x1c'),_0x4aa4f0+'-'+_0x490a99+'/'+_0x552429)[_0xe7fc('0x1d')](_0x4da73b);}return null;};}function patchUpdates(_0x329051){return function(_0x763103){try{jsonpatch['apply'](_0x763103,_0x329051,!![]);}catch(_0x39c75a){return BPromise[_0xe7fc('0x1e')](_0x39c75a);}return _0x763103['save']();};}function saveUpdates(_0x587dee,_0x35bb53){return function(_0x3c31e7){if(_0x3c31e7){return _0x3c31e7[_0xe7fc('0x1f')](_0x587dee)[_0xe7fc('0x20')](function(_0x26977a){return _0x26977a;});}return null;};}function removeEntity(_0x11c5a3,_0x3f850f){return function(_0x1731b6){if(_0x1731b6){return _0x1731b6[_0xe7fc('0x21')]()[_0xe7fc('0x20')](function(){var _0x1d1348=_0x1731b6[_0xe7fc('0x22')]({'plain':!![]});var _0x12ebdd='IvrCampaigns';return db[_0xe7fc('0x23')][_0xe7fc('0x21')]({'where':{'type':_0x12ebdd,'resourceId':_0x1d1348['id']}})[_0xe7fc('0x20')](function(){return _0x1731b6;});})[_0xe7fc('0x20')](function(){_0x11c5a3[_0xe7fc('0x16')](0xcc)[_0xe7fc('0x15')]();});}};}function handleEntityNotFound(_0x553ac5,_0x1a82e8){return function(_0x1ceedc){if(!_0x1ceedc){_0x553ac5[_0xe7fc('0x24')](0x194);}return _0x1ceedc;};}function handleError(_0x3e3798,_0x2f1628){_0x2f1628=_0x2f1628||0x1f4;return function(_0x4416b5){logger[_0xe7fc('0x25')](_0x4416b5['stack']);if(_0x4416b5[_0xe7fc('0x26')]){delete _0x4416b5[_0xe7fc('0x26')];}_0x3e3798['status'](_0x2f1628)[_0xe7fc('0x27')](_0x4416b5);};}exports['index']=function(_0x39d908,_0x27255a){var _0x547219={},_0x2b3830={},_0x4fe326={'count':0x0,'rows':[]};var _0x245965=_[_0xe7fc('0x28')](db[_0xe7fc('0x29')]['rawAttributes'],function(_0x36a043){return{'name':_0x36a043['fieldName'],'type':_0x36a043[_0xe7fc('0x2a')][_0xe7fc('0x2b')]};});_0x2b3830['model']=_['map'](_0x245965,'name');_0x2b3830['query']=_[_0xe7fc('0x2c')](_0x39d908[_0xe7fc('0x2d')]);_0x2b3830[_0xe7fc('0x2e')]=_[_0xe7fc('0x2f')](_0x2b3830[_0xe7fc('0x30')],_0x2b3830[_0xe7fc('0x2d')]);_0x547219[_0xe7fc('0x31')]=_[_0xe7fc('0x2f')](_0x2b3830[_0xe7fc('0x30')],qs[_0xe7fc('0x32')](_0x39d908['query'][_0xe7fc('0x32')]));_0x547219[_0xe7fc('0x31')]=_0x547219[_0xe7fc('0x31')][_0xe7fc('0x33')]?_0x547219[_0xe7fc('0x31')]:_0x2b3830['model'];if(!_0x39d908[_0xe7fc('0x2d')][_0xe7fc('0x34')](_0xe7fc('0x35'))){_0x547219[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x39d908[_0xe7fc('0x2d')][_0xe7fc('0x19')]);_0x547219[_0xe7fc('0x17')]=qs[_0xe7fc('0x17')](_0x39d908[_0xe7fc('0x2d')][_0xe7fc('0x17')]);}_0x547219[_0xe7fc('0x36')]=qs['sort'](_0x39d908[_0xe7fc('0x2d')][_0xe7fc('0x37')]);_0x547219[_0xe7fc('0x38')]=qs[_0xe7fc('0x2e')](_[_0xe7fc('0x39')](_0x39d908['query'],_0x2b3830[_0xe7fc('0x2e')]),_0x245965);if(_0x39d908[_0xe7fc('0x2d')][_0xe7fc('0x3a')]){_0x547219[_0xe7fc('0x38')]=_[_0xe7fc('0x3b')](_0x547219[_0xe7fc('0x38')],{'$or':_['map'](_0x245965,function(_0x5586d8){if(_0x5586d8['type']!=='VIRTUAL'){var _0x4fd29e={};_0x4fd29e[_0x5586d8[_0xe7fc('0x26')]]={'$like':'%'+_0x39d908[_0xe7fc('0x2d')]['filter']+'%'};return _0x4fd29e;}})});}_0x547219=_[_0xe7fc('0x3b')]({},_0x547219,_0x39d908['options']);var _0x280025={'where':_0x547219[_0xe7fc('0x38')]};return db[_0xe7fc('0x29')][_0xe7fc('0x1a')](_0x280025)[_0xe7fc('0x20')](function(_0x3e35c7){_0x4fe326['count']=_0x3e35c7;if(_0x39d908[_0xe7fc('0x2d')]['includeAll']){_0x547219[_0xe7fc('0x3c')]=[{'all':!![]}];}return db[_0xe7fc('0x29')]['findAll'](_0x547219);})[_0xe7fc('0x20')](function(_0x3ce7ad){_0x4fe326[_0xe7fc('0x3d')]=_0x3ce7ad;return _0x4fe326;})[_0xe7fc('0x20')](respondWithFilteredResult(_0x27255a,_0x547219))[_0xe7fc('0x3e')](handleError(_0x27255a,null));};exports[_0xe7fc('0x3f')]=function(_0x3f47aa,_0xab81b8){var _0x31473a={'raw':![],'where':{'id':_0x3f47aa[_0xe7fc('0x40')]['id']}},_0x118e94={};_0x118e94[_0xe7fc('0x30')]=_[_0xe7fc('0x2c')](db[_0xe7fc('0x29')][_0xe7fc('0x41')]);_0x118e94[_0xe7fc('0x2d')]=_[_0xe7fc('0x2c')](_0x3f47aa['query']);_0x118e94[_0xe7fc('0x2e')]=_[_0xe7fc('0x2f')](_0x118e94[_0xe7fc('0x30')],_0x118e94['query']);_0x31473a[_0xe7fc('0x31')]=_[_0xe7fc('0x2f')](_0x118e94[_0xe7fc('0x30')],qs[_0xe7fc('0x32')](_0x3f47aa[_0xe7fc('0x2d')]['fields']));_0x31473a['attributes']=_0x31473a[_0xe7fc('0x31')][_0xe7fc('0x33')]?_0x31473a[_0xe7fc('0x31')]:_0x118e94[_0xe7fc('0x30')];if(_0x3f47aa[_0xe7fc('0x2d')]['includeAll']){_0x31473a[_0xe7fc('0x3c')]=[{'all':!![]}];}_0x31473a=_[_0xe7fc('0x3b')]({},_0x31473a,_0x3f47aa[_0xe7fc('0x42')]);return db[_0xe7fc('0x29')][_0xe7fc('0x43')](_0x31473a)[_0xe7fc('0x20')](handleEntityNotFound(_0xab81b8,null))[_0xe7fc('0x20')](respondWithResult(_0xab81b8,null))[_0xe7fc('0x3e')](handleError(_0xab81b8,null));};exports[_0xe7fc('0x44')]=function(_0x45edbf,_0x533f31){return db[_0xe7fc('0x29')]['create'](_0x45edbf[_0xe7fc('0x45')],{})[_0xe7fc('0x20')](function(_0x1129dd){var _0xc204f7=_0x45edbf[_0xe7fc('0x46')][_0xe7fc('0x22')]({'plain':!![]});if(!_0xc204f7)throw new Error(_0xe7fc('0x47'));if(_0xc204f7[_0xe7fc('0x48')]===_0xe7fc('0x46')){var _0x535afb=_0x1129dd[_0xe7fc('0x22')]({'plain':!![]});var _0xf553c1=_0xe7fc('0x49');return db[_0xe7fc('0x4a')][_0xe7fc('0x43')]({'where':{'name':_0xf553c1,'userProfileId':_0xc204f7[_0xe7fc('0x4b')]},'raw':!![]})['then'](function(_0x1ecaf1){if(_0x1ecaf1&&_0x1ecaf1[_0xe7fc('0x4c')]===0x0){return db[_0xe7fc('0x23')][_0xe7fc('0x44')]({'name':_0x535afb[_0xe7fc('0x26')],'resourceId':_0x535afb['id'],'type':_0x1ecaf1[_0xe7fc('0x26')],'sectionId':_0x1ecaf1['id']},{})['then'](function(){return _0x1129dd;});}else{return _0x1129dd;}})['catch'](function(_0x3d5f19){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d5f19);throw _0x3d5f19;});}return _0x1129dd;})[_0xe7fc('0x20')](respondWithResult(_0x533f31,0xc9))[_0xe7fc('0x3e')](handleError(_0x533f31,null));};exports[_0xe7fc('0x4d')]=function(_0x2cf52f,_0x2246d8){var _0x1fbd9d={'where':{'id':_0x2cf52f[_0xe7fc('0x40')]['id']}},_0x3fab1f={};_0x3fab1f[_0xe7fc('0x30')]=_[_0xe7fc('0x2c')](db[_0xe7fc('0x29')]['rawAttributes']);_0x1fbd9d[_0xe7fc('0x31')]=_['intersection'](_0x3fab1f[_0xe7fc('0x30')],qs[_0xe7fc('0x32')](_0x2cf52f[_0xe7fc('0x2d')][_0xe7fc('0x32')]));_0x1fbd9d[_0xe7fc('0x31')]=_0x1fbd9d[_0xe7fc('0x31')][_0xe7fc('0x33')]?_0x1fbd9d[_0xe7fc('0x31')]:_0x3fab1f['model'];if(_0x2cf52f[_0xe7fc('0x2d')][_0xe7fc('0x4e')]){_0x1fbd9d['include']=[{'all':!![]}];}_0x1fbd9d=_[_0xe7fc('0x3b')]({},_0x1fbd9d,_0x2cf52f[_0xe7fc('0x42')]);return db[_0xe7fc('0x29')][_0xe7fc('0x43')](_0x1fbd9d)[_0xe7fc('0x20')](handleEntityNotFound(_0x2246d8,null))['then'](function(_0x1807b2){if(_0x1807b2){var _0x12c4ab=_0x1807b2[_0xe7fc('0x22')]({'plain':!![]});_0x12c4ab=qs[_0xe7fc('0x4f')](_0x12c4ab,['id','createdAt',_0xe7fc('0x50')]);_0x2cf52f[_0xe7fc('0x45')]=_[_0xe7fc('0x4f')](_0x2cf52f['body'],['id','createdAt',_0xe7fc('0x50')]);return db[_0xe7fc('0x29')][_0xe7fc('0x44')](_[_0xe7fc('0x3b')](_0x12c4ab,_0x2cf52f[_0xe7fc('0x45')]),{'include':_0x2cf52f[_0xe7fc('0x2d')]['includeAll']?[{'all':!![]}]:undefined})[_0xe7fc('0x20')](function(_0x4d9a11){var _0x31fbeb=_0x2cf52f[_0xe7fc('0x46')]['get']({'plain':!![]});if(!_0x31fbeb)throw new Error(_0xe7fc('0x47'));if(_0x31fbeb['role']==='user'){var _0x567ab9=_0x4d9a11[_0xe7fc('0x22')]({'plain':!![]});var _0x270505=_0xe7fc('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x270505,'userProfileId':_0x31fbeb['userProfileId']},'raw':!![]})['then'](function(_0x3ea15b){if(_0x3ea15b&&_0x3ea15b[_0xe7fc('0x4c')]===0x0){return db[_0xe7fc('0x23')][_0xe7fc('0x44')]({'name':_0x567ab9[_0xe7fc('0x26')],'resourceId':_0x567ab9['id'],'type':_0x3ea15b[_0xe7fc('0x26')],'sectionId':_0x3ea15b['id']},{})[_0xe7fc('0x20')](function(){return _0x4d9a11;});}else{return _0x4d9a11;}})[_0xe7fc('0x3e')](function(_0x371a7f){logger['error'](_0xe7fc('0x51'),_0x371a7f);throw _0x371a7f;});}return _0x4d9a11;});}})['then'](respondWithResult(_0x2246d8,0xc9))[_0xe7fc('0x3e')](handleError(_0x2246d8,null));};exports[_0xe7fc('0x1f')]=function(_0x30c2e1,_0x561e5a){if(_0x30c2e1[_0xe7fc('0x45')]['id']){delete _0x30c2e1[_0xe7fc('0x45')]['id'];}return db['Campaign'][_0xe7fc('0x43')]({'where':{'id':_0x30c2e1[_0xe7fc('0x40')]['id']}})['then'](handleEntityNotFound(_0x561e5a,null))[_0xe7fc('0x20')](saveUpdates(_0x30c2e1[_0xe7fc('0x45')],null))[_0xe7fc('0x20')](respondWithResult(_0x561e5a,null))['catch'](handleError(_0x561e5a,null));};exports[_0xe7fc('0x21')]=function(_0x5cad9e,_0x51838f){return db[_0xe7fc('0x29')][_0xe7fc('0x43')]({'where':{'id':_0x5cad9e[_0xe7fc('0x40')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x51838f,null))[_0xe7fc('0x20')](removeEntity(_0x51838f,null))[_0xe7fc('0x3e')](handleError(_0x51838f,null));};exports['getHoppers']=function(_0x3f4dea,_0x2dc3db,_0x390a6e){var _0x26a1a4={'raw':!![],'where':{}};var _0x58a981={};var _0x1b9dff={'count':0x0,'rows':[]};return db[_0xe7fc('0x29')][_0xe7fc('0x52')]({'where':{'id':_0x3f4dea['params']['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x2dc3db,null))[_0xe7fc('0x20')](function(_0x59baff){if(_0x59baff){_0x58a981[_0xe7fc('0x30')]=_[_0xe7fc('0x2c')](db[_0xe7fc('0x53')][_0xe7fc('0x41')]);_0x58a981[_0xe7fc('0x2d')]=_[_0xe7fc('0x2c')](_0x3f4dea[_0xe7fc('0x2d')]);_0x58a981[_0xe7fc('0x2e')]=_[_0xe7fc('0x2f')](_0x58a981['model'],_0x58a981['query']);_0x26a1a4['attributes']=_[_0xe7fc('0x2f')](_0x58a981[_0xe7fc('0x30')],qs['fields'](_0x3f4dea[_0xe7fc('0x2d')]['fields']));_0x26a1a4[_0xe7fc('0x31')]=_0x26a1a4['attributes'][_0xe7fc('0x33')]?_0x26a1a4[_0xe7fc('0x31')]:_0x58a981[_0xe7fc('0x30')];if(!_0x3f4dea[_0xe7fc('0x2d')][_0xe7fc('0x34')](_0xe7fc('0x35'))){_0x26a1a4[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x3f4dea[_0xe7fc('0x2d')][_0xe7fc('0x19')]);_0x26a1a4[_0xe7fc('0x17')]=qs['offset'](_0x3f4dea[_0xe7fc('0x2d')][_0xe7fc('0x17')]);}_0x26a1a4[_0xe7fc('0x36')]=qs[_0xe7fc('0x37')](_0x3f4dea['query'][_0xe7fc('0x37')]);_0x26a1a4[_0xe7fc('0x38')]=qs[_0xe7fc('0x2e')](_['pick'](_0x3f4dea[_0xe7fc('0x2d')],_0x58a981[_0xe7fc('0x2e')]));_0x26a1a4[_0xe7fc('0x38')][_0xe7fc('0x54')]=_0x59baff['id'];if(_0x3f4dea[_0xe7fc('0x2d')][_0xe7fc('0x3a')]){_0x26a1a4[_0xe7fc('0x38')]=_[_0xe7fc('0x3b')](_0x26a1a4['where'],{'$or':_[_0xe7fc('0x28')](_0x26a1a4['attributes'],function(_0x2cdd29){var _0xc5621f={};_0xc5621f[_0x2cdd29]={'$like':'%'+_0x3f4dea[_0xe7fc('0x2d')]['filter']+'%'};return _0xc5621f;})});}_0x26a1a4=_[_0xe7fc('0x3b')]({},_0x26a1a4,_0x3f4dea[_0xe7fc('0x42')]);return db[_0xe7fc('0x53')]['count']({'where':_0x26a1a4[_0xe7fc('0x38')]})['then'](function(_0x7cfe41){_0x1b9dff[_0xe7fc('0x1a')]=_0x7cfe41;if(_0x3f4dea[_0xe7fc('0x2d')][_0xe7fc('0x4e')]){_0x26a1a4[_0xe7fc('0x3c')]=[{'all':!![]}];}return db['CmHopper'][_0xe7fc('0x55')](_0x26a1a4);})[_0xe7fc('0x20')](function(_0x9e3d14){_0x1b9dff['rows']=_0x9e3d14;return _0x1b9dff;});}})[_0xe7fc('0x20')](respondWithFilteredResult(_0x2dc3db,_0x26a1a4))['catch'](handleError(_0x2dc3db,null));};exports[_0xe7fc('0x56')]=function(_0x5256ad,_0x55ca6f,_0x195b86){var _0x116702={'raw':!![],'where':{}};var _0x3ca583={};var _0x9445bb={'count':0x0,'rows':[]};return db[_0xe7fc('0x29')][_0xe7fc('0x52')]({'where':{'id':_0x5256ad[_0xe7fc('0x40')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x55ca6f,null))[_0xe7fc('0x20')](function(_0x23a31b){if(_0x23a31b){_0x3ca583[_0xe7fc('0x30')]=_[_0xe7fc('0x2c')](db[_0xe7fc('0x57')]['rawAttributes']);_0x3ca583[_0xe7fc('0x2d')]=_['keys'](_0x5256ad[_0xe7fc('0x2d')]);_0x3ca583[_0xe7fc('0x2e')]=_['intersection'](_0x3ca583['model'],_0x3ca583[_0xe7fc('0x2d')]);_0x116702['attributes']=_[_0xe7fc('0x2f')](_0x3ca583[_0xe7fc('0x30')],qs[_0xe7fc('0x32')](_0x5256ad[_0xe7fc('0x2d')][_0xe7fc('0x32')]));_0x116702[_0xe7fc('0x31')]=_0x116702[_0xe7fc('0x31')][_0xe7fc('0x33')]?_0x116702[_0xe7fc('0x31')]:_0x3ca583[_0xe7fc('0x30')];if(!_0x5256ad['query'][_0xe7fc('0x34')](_0xe7fc('0x35'))){_0x116702['limit']=qs[_0xe7fc('0x19')](_0x5256ad[_0xe7fc('0x2d')][_0xe7fc('0x19')]);_0x116702[_0xe7fc('0x17')]=qs[_0xe7fc('0x17')](_0x5256ad[_0xe7fc('0x2d')][_0xe7fc('0x17')]);}_0x116702[_0xe7fc('0x36')]=qs[_0xe7fc('0x37')](_0x5256ad[_0xe7fc('0x2d')][_0xe7fc('0x37')]);_0x116702[_0xe7fc('0x38')]=qs['filters'](_[_0xe7fc('0x39')](_0x5256ad[_0xe7fc('0x2d')],_0x3ca583[_0xe7fc('0x2e')]));_0x116702['where']['CampaignId']=_0x23a31b['id'];if(_0x5256ad[_0xe7fc('0x2d')][_0xe7fc('0x3a')]){_0x116702[_0xe7fc('0x38')]=_['merge'](_0x116702[_0xe7fc('0x38')],{'$or':_[_0xe7fc('0x28')](_0x116702['attributes'],function(_0x9fd013){var _0x4ae3bf={};_0x4ae3bf[_0x9fd013]={'$like':'%'+_0x5256ad[_0xe7fc('0x2d')][_0xe7fc('0x3a')]+'%'};return _0x4ae3bf;})});}_0x116702=_[_0xe7fc('0x3b')]({},_0x116702,_0x5256ad[_0xe7fc('0x42')]);return db[_0xe7fc('0x57')][_0xe7fc('0x1a')]({'where':_0x116702[_0xe7fc('0x38')]})[_0xe7fc('0x20')](function(_0x466296){_0x9445bb[_0xe7fc('0x1a')]=_0x466296;if(_0x5256ad[_0xe7fc('0x2d')]['includeAll']){_0x116702['include']=[{'all':!![]}];}return db[_0xe7fc('0x57')][_0xe7fc('0x55')](_0x116702);})['then'](function(_0x2f501f){_0x9445bb[_0xe7fc('0x3d')]=_0x2f501f;return _0x9445bb;});}})[_0xe7fc('0x20')](respondWithFilteredResult(_0x55ca6f,_0x116702))[_0xe7fc('0x3e')](handleError(_0x55ca6f,null));};exports[_0xe7fc('0x58')]=function(_0x1034fe,_0x3416d6,_0x19b496){var _0x323580={'raw':!![],'where':{}};var _0x269675={};var _0x274a98={'count':0x0,'rows':[]};return db['Campaign'][_0xe7fc('0x52')]({'where':{'id':_0x1034fe[_0xe7fc('0x40')]['id']}})['then'](handleEntityNotFound(_0x3416d6,null))[_0xe7fc('0x20')](function(_0x598e79){if(_0x598e79){_0x269675[_0xe7fc('0x30')]=_['keys'](db['CmHopperFinal'][_0xe7fc('0x41')]);_0x269675[_0xe7fc('0x2d')]=_[_0xe7fc('0x2c')](_0x1034fe['query']);_0x269675['filters']=_[_0xe7fc('0x2f')](_0x269675['model'],_0x269675[_0xe7fc('0x2d')]);_0x323580[_0xe7fc('0x31')]=_[_0xe7fc('0x2f')](_0x269675[_0xe7fc('0x30')],qs[_0xe7fc('0x32')](_0x1034fe['query'][_0xe7fc('0x32')]));_0x323580[_0xe7fc('0x31')]=_0x323580[_0xe7fc('0x31')][_0xe7fc('0x33')]?_0x323580[_0xe7fc('0x31')]:_0x269675['model'];if(!_0x1034fe[_0xe7fc('0x2d')][_0xe7fc('0x34')](_0xe7fc('0x35'))){_0x323580[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x1034fe[_0xe7fc('0x2d')][_0xe7fc('0x19')]);_0x323580[_0xe7fc('0x17')]=qs['offset'](_0x1034fe[_0xe7fc('0x2d')][_0xe7fc('0x17')]);}_0x323580[_0xe7fc('0x36')]=qs[_0xe7fc('0x37')](_0x1034fe[_0xe7fc('0x2d')][_0xe7fc('0x37')]);_0x323580[_0xe7fc('0x38')]=qs[_0xe7fc('0x2e')](_['pick'](_0x1034fe[_0xe7fc('0x2d')],_0x269675[_0xe7fc('0x2e')]));_0x323580[_0xe7fc('0x38')]['CampaignId']=_0x598e79['id'];if(_0x1034fe[_0xe7fc('0x2d')]['filter']){_0x323580[_0xe7fc('0x38')]=_['merge'](_0x323580[_0xe7fc('0x38')],{'$or':_[_0xe7fc('0x28')](_0x323580[_0xe7fc('0x31')],function(_0x3df140){var _0x1c6d19={};_0x1c6d19[_0x3df140]={'$like':'%'+_0x1034fe['query']['filter']+'%'};return _0x1c6d19;})});}_0x323580=_[_0xe7fc('0x3b')]({},_0x323580,_0x1034fe[_0xe7fc('0x42')]);return db[_0xe7fc('0x59')][_0xe7fc('0x1a')]({'where':_0x323580['where']})[_0xe7fc('0x20')](function(_0x445332){_0x274a98[_0xe7fc('0x1a')]=_0x445332;if(_0x1034fe[_0xe7fc('0x2d')]['includeAll']){_0x323580[_0xe7fc('0x3c')]=[{'all':!![]}];}return db[_0xe7fc('0x59')][_0xe7fc('0x55')](_0x323580);})[_0xe7fc('0x20')](function(_0x303ba8){_0x274a98[_0xe7fc('0x3d')]=_0x303ba8;return _0x274a98;});}})[_0xe7fc('0x20')](respondWithFilteredResult(_0x3416d6,_0x323580))[_0xe7fc('0x3e')](handleError(_0x3416d6,null));};exports[_0xe7fc('0x5a')]=function(_0x5e4652,_0x234629,_0x18ba9b){var _0x13d64b={'raw':!![],'where':{}};var _0x4a0432={};var _0x3a9f96={'count':0x0,'rows':[]};return db['Campaign'][_0xe7fc('0x52')]({'where':{'id':_0x5e4652['params']['id']}})['then'](handleEntityNotFound(_0x234629,null))[_0xe7fc('0x20')](function(_0x177f8f){if(_0x177f8f){_0x4a0432['model']=_[_0xe7fc('0x2c')](db['CmHopperBlack'][_0xe7fc('0x41')]);_0x4a0432[_0xe7fc('0x2d')]=_[_0xe7fc('0x2c')](_0x5e4652[_0xe7fc('0x2d')]);_0x4a0432['filters']=_[_0xe7fc('0x2f')](_0x4a0432['model'],_0x4a0432['query']);_0x13d64b[_0xe7fc('0x31')]=_[_0xe7fc('0x2f')](_0x4a0432[_0xe7fc('0x30')],qs[_0xe7fc('0x32')](_0x5e4652[_0xe7fc('0x2d')][_0xe7fc('0x32')]));_0x13d64b[_0xe7fc('0x31')]=_0x13d64b[_0xe7fc('0x31')][_0xe7fc('0x33')]?_0x13d64b[_0xe7fc('0x31')]:_0x4a0432[_0xe7fc('0x30')];if(!_0x5e4652[_0xe7fc('0x2d')][_0xe7fc('0x34')]('nolimit')){_0x13d64b[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x5e4652['query']['limit']);_0x13d64b[_0xe7fc('0x17')]=qs[_0xe7fc('0x17')](_0x5e4652[_0xe7fc('0x2d')][_0xe7fc('0x17')]);}_0x13d64b[_0xe7fc('0x36')]=qs[_0xe7fc('0x37')](_0x5e4652['query'][_0xe7fc('0x37')]);_0x13d64b[_0xe7fc('0x38')]=qs[_0xe7fc('0x2e')](_[_0xe7fc('0x39')](_0x5e4652[_0xe7fc('0x2d')],_0x4a0432[_0xe7fc('0x2e')]));_0x13d64b[_0xe7fc('0x38')]['CampaignId']=_0x177f8f['id'];if(_0x5e4652['query'][_0xe7fc('0x3a')]){_0x13d64b[_0xe7fc('0x38')]=_[_0xe7fc('0x3b')](_0x13d64b[_0xe7fc('0x38')],{'$or':_[_0xe7fc('0x28')](_0x13d64b[_0xe7fc('0x31')],function(_0x12cb64){var _0x263504={};_0x263504[_0x12cb64]={'$like':'%'+_0x5e4652[_0xe7fc('0x2d')][_0xe7fc('0x3a')]+'%'};return _0x263504;})});}_0x13d64b=_['merge']({},_0x13d64b,_0x5e4652['options']);return db['CmHopperBlack'][_0xe7fc('0x1a')]({'where':_0x13d64b[_0xe7fc('0x38')]})[_0xe7fc('0x20')](function(_0x214c7c){_0x3a9f96[_0xe7fc('0x1a')]=_0x214c7c;if(_0x5e4652[_0xe7fc('0x2d')][_0xe7fc('0x4e')]){_0x13d64b[_0xe7fc('0x3c')]=[{'all':!![]}];}return db[_0xe7fc('0x5b')][_0xe7fc('0x55')](_0x13d64b);})[_0xe7fc('0x20')](function(_0x298849){_0x3a9f96[_0xe7fc('0x3d')]=_0x298849;return _0x3a9f96;});}})[_0xe7fc('0x20')](respondWithFilteredResult(_0x234629,_0x13d64b))[_0xe7fc('0x3e')](handleError(_0x234629,null));};exports[_0xe7fc('0x5c')]=function(_0x3b3017,_0x18f5a4,_0x5cf31b){var _0x415dbe={};var _0x454ec2={};var _0x243105;var _0x2eccd5;return db['Campaign'][_0xe7fc('0x52')]({'where':{'id':_0x3b3017[_0xe7fc('0x40')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x18f5a4,null))[_0xe7fc('0x20')](function(_0x338afb){if(_0x338afb){_0x243105=_0x338afb;_0x454ec2[_0xe7fc('0x30')]=_['keys'](db['CmList'][_0xe7fc('0x41')]);_0x454ec2['query']=_['keys'](_0x3b3017['query']);_0x454ec2[_0xe7fc('0x2e')]=_[_0xe7fc('0x2f')](_0x454ec2[_0xe7fc('0x30')],_0x454ec2[_0xe7fc('0x2d')]);_0x415dbe['attributes']=_['intersection'](_0x454ec2[_0xe7fc('0x30')],qs[_0xe7fc('0x32')](_0x3b3017[_0xe7fc('0x2d')][_0xe7fc('0x32')]));_0x415dbe[_0xe7fc('0x31')]=_0x415dbe[_0xe7fc('0x31')][_0xe7fc('0x33')]?_0x415dbe[_0xe7fc('0x31')]:_0x454ec2[_0xe7fc('0x30')];_0x415dbe[_0xe7fc('0x36')]=qs[_0xe7fc('0x37')](_0x3b3017[_0xe7fc('0x2d')][_0xe7fc('0x37')]);_0x415dbe[_0xe7fc('0x38')]=qs['filters'](_[_0xe7fc('0x39')](_0x3b3017[_0xe7fc('0x2d')],_0x454ec2['filters']));if(_0x3b3017[_0xe7fc('0x2d')][_0xe7fc('0x3a')]){_0x415dbe[_0xe7fc('0x38')]=_['merge'](_0x415dbe[_0xe7fc('0x38')],{'$or':_[_0xe7fc('0x28')](_0x415dbe['attributes'],function(_0x4e22e0){var _0x21c42b={};_0x21c42b[_0x4e22e0]={'$like':'%'+_0x3b3017['query'][_0xe7fc('0x3a')]+'%'};return _0x21c42b;})});}_0x415dbe=_[_0xe7fc('0x3b')]({},_0x415dbe,_0x3b3017[_0xe7fc('0x42')]);return _0x243105[_0xe7fc('0x5c')](_0x415dbe);}})[_0xe7fc('0x20')](function(_0x5dae71){if(_0x5dae71){_0x2eccd5=_0x5dae71[_0xe7fc('0x33')];if(!_0x3b3017[_0xe7fc('0x2d')][_0xe7fc('0x34')](_0xe7fc('0x35'))){_0x415dbe[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x3b3017['query'][_0xe7fc('0x19')]);_0x415dbe['offset']=qs[_0xe7fc('0x17')](_0x3b3017['query'][_0xe7fc('0x17')]);}return _0x243105['getLists'](_0x415dbe);}})['then'](function(_0x4521fa){if(_0x4521fa){return _0x4521fa?{'count':_0x2eccd5,'rows':_0x4521fa}:null;}})[_0xe7fc('0x20')](respondWithResult(_0x18f5a4,null))[_0xe7fc('0x3e')](handleError(_0x18f5a4,null));};exports[_0xe7fc('0x5d')]=function(_0x2bb619,_0x3ef536,_0x41206a){var _0x26e587,_0x215532;var _0x237160=[];var _0x2ee092=moment()[_0xe7fc('0x5e')](_0xe7fc('0x5f'));return db[_0xe7fc('0x29')][_0xe7fc('0x43')]({'where':{'id':_0x2bb619['params']['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x3ef536,null))[_0xe7fc('0x20')](function(_0xd37ad){if(_0xd37ad){_0x215532=_0xd37ad;return _0xd37ad[_0xe7fc('0x5d')](_0x2bb619[_0xe7fc('0x45')][_0xe7fc('0x60')],_['omit'](_0x2bb619[_0xe7fc('0x45')],[_0xe7fc('0x60'),'id'])||{});}return null;})[_0xe7fc('0x61')](function(_0x2b120d){var _0xd8b989;var _0x1ea67b;_0x26e587=_0x2b120d||[];var _0x4849a0=[];if(_0x2b120d){for(var _0x2892cb=0x0;_0x2892cb<_0x2b120d[_0xe7fc('0x33')];_0x2892cb+=0x1){var _0x6cef1f=_0x2b120d[_0x2892cb][_0xe7fc('0x22')]({'plain':!![]});_0x215532['dialCheckDuplicateType']=_0x2bb619[_0xe7fc('0x45')][_0xe7fc('0x62')]?_0x2bb619[_0xe7fc('0x45')][_0xe7fc('0x62')]:_0x215532[_0xe7fc('0x62')];switch(_0x215532[_0xe7fc('0x62')]){case _0xe7fc('0x63'):_0xd8b989=squel[_0xe7fc('0x64')]()['into'](_0xe7fc('0x65'))[_0xe7fc('0x66')]([_0xe7fc('0x67'),'scheduledAt',_0xe7fc('0x68'),'ListId','CampaignId','createdAt','updatedAt'],squel[_0xe7fc('0x69')]()[_0xe7fc('0x6a')](_0xe7fc('0x67'),'phone')[_0xe7fc('0x6a')](_0xe7fc('0x6b'),_0xe7fc('0x6c'))[_0xe7fc('0x6a')]('id',_0xe7fc('0x68'))[_0xe7fc('0x6a')](_0x6cef1f[_0xe7fc('0x6d')][_0xe7fc('0x6e')](),_0xe7fc('0x6f'))['field'](_0x2bb619[_0xe7fc('0x40')]['id'][_0xe7fc('0x6e')](),_0xe7fc('0x54'))[_0xe7fc('0x6a')]('\x27'+_0x2ee092+'\x27',_0xe7fc('0x70'))[_0xe7fc('0x6a')]('\x27'+_0x2ee092+'\x27',_0xe7fc('0x50'))[_0xe7fc('0x71')](_0xe7fc('0x72'))[_0xe7fc('0x38')]('deletedAt\x20IS\x20NULL')[_0xe7fc('0x38')](_0xe7fc('0x73'),_0x6cef1f[_0xe7fc('0x6d')][_0xe7fc('0x6e')]())[_0xe7fc('0x38')](_0xe7fc('0x74'))[_0xe7fc('0x38')](_0xe7fc('0x75'),squel[_0xe7fc('0x69')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0xe7fc('0x71')](_0xe7fc('0x76'))['where'](_0xe7fc('0x77'),_0x2bb619[_0xe7fc('0x40')]['id']['toString']()))[_0xe7fc('0x38')](_0xe7fc('0x75'),squel['select']()['field'](_0xe7fc('0x78'))['from'](_0xe7fc('0x65'))[_0xe7fc('0x38')](_0xe7fc('0x77'),_0x2bb619['params']['id'][_0xe7fc('0x6e')]())))['toString']();break;case _0xe7fc('0x79'):_0xd8b989=squel['insert']()[_0xe7fc('0x7a')]('cm_hopper')[_0xe7fc('0x66')]([_0xe7fc('0x67'),_0xe7fc('0x6c'),_0xe7fc('0x68'),_0xe7fc('0x6f'),_0xe7fc('0x54'),_0xe7fc('0x70'),_0xe7fc('0x50')],squel[_0xe7fc('0x69')]()[_0xe7fc('0x6a')](_0xe7fc('0x67'),_0xe7fc('0x67'))[_0xe7fc('0x6a')](_0xe7fc('0x6b'),_0xe7fc('0x6c'))[_0xe7fc('0x6a')]('id','ContactId')[_0xe7fc('0x6a')](_0x6cef1f[_0xe7fc('0x6d')][_0xe7fc('0x6e')](),_0xe7fc('0x6f'))['field'](_0x2bb619['params']['id'][_0xe7fc('0x6e')](),'CampaignId')[_0xe7fc('0x6a')]('\x27'+_0x2ee092+'\x27','createdAt')['field']('\x27'+_0x2ee092+'\x27',_0xe7fc('0x50'))['from'](_0xe7fc('0x72'))['where'](_0xe7fc('0x7b'))[_0xe7fc('0x38')]('ListId\x20=\x20?',_0x6cef1f[_0xe7fc('0x6d')][_0xe7fc('0x6e')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xe7fc('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0xe7fc('0x69')]()[_0xe7fc('0x6a')](_0xe7fc('0x78'))[_0xe7fc('0x71')]('cm_hopper')['where'](_0xe7fc('0x77'),_0x2bb619[_0xe7fc('0x40')]['id']['toString']())))['toString']();break;default:_0xd8b989=squel[_0xe7fc('0x64')]()[_0xe7fc('0x7a')]('cm_hopper')[_0xe7fc('0x66')](['phone','scheduledAt',_0xe7fc('0x68'),_0xe7fc('0x6f'),_0xe7fc('0x54'),_0xe7fc('0x70'),_0xe7fc('0x50')],squel[_0xe7fc('0x69')]()[_0xe7fc('0x6a')](_0xe7fc('0x67'),'phone')['field'](_0xe7fc('0x6b'),_0xe7fc('0x6c'))[_0xe7fc('0x6a')]('id',_0xe7fc('0x68'))[_0xe7fc('0x6a')](_0x6cef1f[_0xe7fc('0x6d')][_0xe7fc('0x6e')](),'ListId')[_0xe7fc('0x6a')](_0x2bb619[_0xe7fc('0x40')]['id'][_0xe7fc('0x6e')](),'CampaignId')[_0xe7fc('0x6a')]('\x27'+_0x2ee092+'\x27',_0xe7fc('0x70'))[_0xe7fc('0x6a')]('\x27'+_0x2ee092+'\x27','updatedAt')[_0xe7fc('0x71')](_0xe7fc('0x72'))[_0xe7fc('0x38')]('deletedAt\x20IS\x20NULL')[_0xe7fc('0x38')](_0xe7fc('0x73'),_0x6cef1f[_0xe7fc('0x6d')][_0xe7fc('0x6e')]())[_0xe7fc('0x38')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x1ea67b=squel['insert']()['into'](_0xe7fc('0x7c'))['fromQuery']([_0xe7fc('0x7d'),_0xe7fc('0x6c'),_0xe7fc('0x67'),_0xe7fc('0x7e'),_0xe7fc('0x70'),_0xe7fc('0x50')],squel[_0xe7fc('0x69')]()['field'](_0xe7fc('0x7f'),'id')[_0xe7fc('0x6a')](_0xe7fc('0x6b'),'scheduledAt')[_0xe7fc('0x6a')](_0xe7fc('0x80'),_0xe7fc('0x67'))[_0xe7fc('0x6a')](_0xe7fc('0x81'),_0xe7fc('0x7e'))[_0xe7fc('0x6a')]('\x27'+_0x2ee092+'\x27','createdAt')[_0xe7fc('0x6a')]('\x27'+_0x2ee092+'\x27','updatedAt')[_0xe7fc('0x71')](_0xe7fc('0x82'),'ci')[_0xe7fc('0x83')](_0xe7fc('0x65'),'h',_0xe7fc('0x84'))['where'](_0xe7fc('0x85'),_0x6cef1f['CmListId'][_0xe7fc('0x6e')]())[_0xe7fc('0x38')](_0xe7fc('0x86'),_0x2bb619['params']['id'][_0xe7fc('0x6e')]())[_0xe7fc('0x38')](_0xe7fc('0x87'),_0x2ee092))[_0xe7fc('0x6e')]();_0x4849a0[_0xe7fc('0x88')](db['sequelize'][_0xe7fc('0x2d')](_0xd8b989));_0x237160[_0xe7fc('0x88')](db[_0xe7fc('0x89')][_0xe7fc('0x2d')](_0x1ea67b));}return BPromise[_0xe7fc('0x8a')](_0x4849a0);}})[_0xe7fc('0x20')](function(){return BPromise[_0xe7fc('0x8a')](_0x237160);})[_0xe7fc('0x20')](function(){return _0x26e587;})[_0xe7fc('0x20')](respondWithResult(_0x3ef536,null))['catch'](handleError(_0x3ef536,null));};exports[_0xe7fc('0x8b')]=function(_0x2e8fd6,_0x30c72c,_0x394ca4){return db[_0xe7fc('0x29')][_0xe7fc('0x43')]({'where':{'id':_0x2e8fd6[_0xe7fc('0x40')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x30c72c,null))[_0xe7fc('0x20')](function(_0x442408){if(_0x442408){return _0x442408[_0xe7fc('0x8b')](_0x2e8fd6[_0xe7fc('0x2d')][_0xe7fc('0x60')]);}})[_0xe7fc('0x20')](function(_0x332e1b){if(_0x332e1b){return db[_0xe7fc('0x53')][_0xe7fc('0x21')]({'where':{'ListId':_0x2e8fd6['query'][_0xe7fc('0x60')],'CampaignId':_0x2e8fd6['params']['id']}})['then'](function(){return _0x332e1b;});}})['then'](respondWithStatusCode(_0x30c72c,null))[_0xe7fc('0x3e')](handleError(_0x30c72c,null));};exports[_0xe7fc('0x8c')]=function(_0x3acdb5,_0x464702,_0x5ce4cd){var _0x3fb020={};var _0x41ea88={};var _0x66fa8e;var _0x268f6a;return db[_0xe7fc('0x29')][_0xe7fc('0x52')]({'where':{'id':_0x3acdb5['params']['id']}})['then'](handleEntityNotFound(_0x464702,null))['then'](function(_0x10d59e){if(_0x10d59e){_0x66fa8e=_0x10d59e;_0x41ea88['model']=_['keys'](db[_0xe7fc('0x8d')][_0xe7fc('0x41')]);_0x41ea88[_0xe7fc('0x2d')]=_[_0xe7fc('0x2c')](_0x3acdb5['query']);_0x41ea88[_0xe7fc('0x2e')]=_[_0xe7fc('0x2f')](_0x41ea88[_0xe7fc('0x30')],_0x41ea88[_0xe7fc('0x2d')]);_0x3fb020['attributes']=_['intersection'](_0x41ea88[_0xe7fc('0x30')],qs[_0xe7fc('0x32')](_0x3acdb5[_0xe7fc('0x2d')]['fields']));_0x3fb020[_0xe7fc('0x31')]=_0x3fb020[_0xe7fc('0x31')][_0xe7fc('0x33')]?_0x3fb020['attributes']:_0x41ea88['model'];_0x3fb020[_0xe7fc('0x36')]=qs[_0xe7fc('0x37')](_0x3acdb5[_0xe7fc('0x2d')][_0xe7fc('0x37')]);_0x3fb020['where']=qs[_0xe7fc('0x2e')](_[_0xe7fc('0x39')](_0x3acdb5[_0xe7fc('0x2d')],_0x41ea88['filters']));if(_0x3acdb5[_0xe7fc('0x2d')][_0xe7fc('0x3a')]){_0x3fb020[_0xe7fc('0x38')]=_['merge'](_0x3fb020[_0xe7fc('0x38')],{'$or':_[_0xe7fc('0x28')](_0x3fb020[_0xe7fc('0x31')],function(_0x5921bc){var _0x5024b6={};_0x5024b6[_0x5921bc]={'$like':'%'+_0x3acdb5['query'][_0xe7fc('0x3a')]+'%'};return _0x5024b6;})});}_0x3fb020=_[_0xe7fc('0x3b')]({},_0x3fb020,_0x3acdb5['options']);return _0x66fa8e['getBlackLists'](_0x3fb020);}})[_0xe7fc('0x20')](function(_0x375035){if(_0x375035){_0x268f6a=_0x375035[_0xe7fc('0x33')];if(!_0x3acdb5[_0xe7fc('0x2d')][_0xe7fc('0x34')](_0xe7fc('0x35'))){_0x3fb020[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x3acdb5[_0xe7fc('0x2d')][_0xe7fc('0x19')]);_0x3fb020[_0xe7fc('0x17')]=qs[_0xe7fc('0x17')](_0x3acdb5[_0xe7fc('0x2d')][_0xe7fc('0x17')]);}return _0x66fa8e[_0xe7fc('0x8c')](_0x3fb020);}})[_0xe7fc('0x20')](function(_0x5d3b52){if(_0x5d3b52){return _0x5d3b52?{'count':_0x268f6a,'rows':_0x5d3b52}:null;}})[_0xe7fc('0x20')](respondWithResult(_0x464702,null))[_0xe7fc('0x3e')](handleError(_0x464702,null));};exports[_0xe7fc('0x8e')]=function(_0xfe96fd,_0x4380b1,_0x2ce23f){var _0x18abc3,_0xb0ffa6;var _0x81eabb=[];var _0x7cda06=moment()['format'](_0xe7fc('0x5f'));return db[_0xe7fc('0x29')][_0xe7fc('0x43')]({'where':{'id':_0xfe96fd[_0xe7fc('0x40')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x4380b1,null))[_0xe7fc('0x20')](function(_0x521834){if(_0x521834){_0xb0ffa6=_0x521834;return _0x521834[_0xe7fc('0x8e')](_0xfe96fd[_0xe7fc('0x45')][_0xe7fc('0x60')],_[_0xe7fc('0x4f')](_0xfe96fd['body'],['ids','id'])||{});}return null;})['spread'](function(_0x14444f){var _0x5a0bdb;var _0x62f194;_0x18abc3=_0x14444f||[];var _0x524203=[];if(_0x14444f){for(var _0x129496=0x0;_0x129496<_0x14444f[_0xe7fc('0x33')];_0x129496+=0x1){var _0x1e2aae=_0x14444f[_0x129496]['get']({'plain':!![]});_0x5a0bdb=squel[_0xe7fc('0x64')]()['into']('cm_hopper_black')[_0xe7fc('0x66')](['phone',_0xe7fc('0x68'),_0xe7fc('0x6f'),_0xe7fc('0x54'),'createdAt',_0xe7fc('0x50')],squel[_0xe7fc('0x69')]()[_0xe7fc('0x6a')](_0xe7fc('0x67'),_0xe7fc('0x67'))[_0xe7fc('0x6a')]('id',_0xe7fc('0x68'))['field'](_0x1e2aae[_0xe7fc('0x6d')][_0xe7fc('0x6e')](),'ListId')[_0xe7fc('0x6a')](_0xfe96fd[_0xe7fc('0x40')]['id'][_0xe7fc('0x6e')](),_0xe7fc('0x54'))[_0xe7fc('0x6a')]('NOW()',_0xe7fc('0x70'))[_0xe7fc('0x6a')](_0xe7fc('0x6b'),_0xe7fc('0x50'))[_0xe7fc('0x71')](_0xe7fc('0x72'))['where'](_0xe7fc('0x7b'))[_0xe7fc('0x38')]('ListId\x20=\x20?',_0x1e2aae[_0xe7fc('0x6d')]['toString']())[_0xe7fc('0x38')](_0xe7fc('0x74')))[_0xe7fc('0x6e')]();_0x524203[_0xe7fc('0x88')](db[_0xe7fc('0x89')][_0xe7fc('0x2d')](_0x5a0bdb));}return BPromise[_0xe7fc('0x8a')](_0x524203);}})[_0xe7fc('0x20')](function(){return _0x18abc3;})[_0xe7fc('0x20')](respondWithResult(_0x4380b1,null))[_0xe7fc('0x3e')](handleError(_0x4380b1,null));};exports[_0xe7fc('0x8f')]=function(_0x44c20a,_0x47d3d5,_0x1f6e34){return db[_0xe7fc('0x29')][_0xe7fc('0x43')]({'where':{'id':_0x44c20a[_0xe7fc('0x40')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x47d3d5,null))['then'](function(_0x39b319){if(_0x39b319){return _0x39b319['removeBlackLists'](_0x44c20a[_0xe7fc('0x2d')][_0xe7fc('0x60')]);}})[_0xe7fc('0x20')](function(_0x178888){if(_0x178888){return db[_0xe7fc('0x5b')]['destroy']({'where':{'ListId':_0x44c20a[_0xe7fc('0x2d')][_0xe7fc('0x60')],'CampaignId':_0x44c20a[_0xe7fc('0x40')]['id']}})['then'](function(){return _0x178888;});}})[_0xe7fc('0x20')](respondWithStatusCode(_0x47d3d5,null))[_0xe7fc('0x3e')](handleError(_0x47d3d5,null));};
\ No newline at end of file
+var _0x7275=['scheduledAt','ContactId','ListId','phone','NOW()','field','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper_additional_phones','cmHopperId','h.id','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','UserProfileResource','destroy','stack','name','index','map','Campaign','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','create','UserProfileSection','getHoppers','findOne','CmHopper','order','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery'];(function(_0x5e65cf,_0x4b15c6){var _0x1de15c=function(_0x9d1980){while(--_0x9d1980){_0x5e65cf['push'](_0x5e65cf['shift']());}};_0x1de15c(++_0x4b15c6);}(_0x7275,0x143));var _0x5727=function(_0x3b44a0,_0x240182){_0x3b44a0=_0x3b44a0-0x0;var _0x359a80=_0x7275[_0x3b44a0];return _0x359a80;};'use strict';var emlformat=require(_0x5727('0x0'));var rimraf=require(_0x5727('0x1'));var zipdir=require(_0x5727('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5727('0x3'));var moment=require('moment');var BPromise=require(_0x5727('0x4'));var Mustache=require(_0x5727('0x5'));var util=require('util');var path=require(_0x5727('0x6'));var sox=require(_0x5727('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5727('0x8'));var squel=require('squel');var crypto=require(_0x5727('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x5727('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5727('0xb'));var Papa=require(_0x5727('0xc'));var Redis=require('ioredis');var authService=require(_0x5727('0xd'));var qs=require(_0x5727('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5727('0xf'));var logger=require(_0x5727('0x10'))('api');var utils=require(_0x5727('0x11'));var config=require(_0x5727('0x12'));var licenseUtil=require(_0x5727('0x13'));var db=require(_0x5727('0x14'))['db'];function respondWithStatusCode(_0x362b0e,_0x45ec3c){_0x45ec3c=_0x45ec3c||0xcc;return function(_0x48c6f4){if(_0x48c6f4){return _0x362b0e[_0x5727('0x15')](_0x45ec3c);}return _0x362b0e[_0x5727('0x16')](_0x45ec3c)[_0x5727('0x17')]();};}function respondWithResult(_0x242b6a,_0x2a01df){_0x2a01df=_0x2a01df||0xc8;return function(_0x463721){if(_0x463721){return _0x242b6a[_0x5727('0x16')](_0x2a01df)['json'](_0x463721);}};}function respondWithFilteredResult(_0x24e514,_0x284633){return function(_0x1dcefc){if(_0x1dcefc){var _0x12b045=typeof _0x284633[_0x5727('0x18')]===_0x5727('0x19')&&typeof _0x284633[_0x5727('0x1a')]==='undefined';var _0x11d52c=_0x1dcefc['count'];var _0x360be0=_0x12b045?0x0:_0x284633[_0x5727('0x18')];var _0x55fc33=_0x12b045?_0x1dcefc[_0x5727('0x1b')]:_0x284633[_0x5727('0x18')]+_0x284633[_0x5727('0x1a')];var _0x35e30f;if(_0x55fc33>=_0x11d52c){_0x55fc33=_0x11d52c;_0x35e30f=0xc8;}else{_0x35e30f=0xce;}_0x24e514[_0x5727('0x16')](_0x35e30f);return _0x24e514['set']('Content-Range',_0x360be0+'-'+_0x55fc33+'/'+_0x11d52c)[_0x5727('0x1c')](_0x1dcefc);}return null;};}function patchUpdates(_0xb99c6e){return function(_0x84c9e2){try{jsonpatch[_0x5727('0x1d')](_0x84c9e2,_0xb99c6e,!![]);}catch(_0xf584e8){return BPromise[_0x5727('0x1e')](_0xf584e8);}return _0x84c9e2[_0x5727('0x1f')]();};}function saveUpdates(_0x5c63ef,_0x4aa3af){return function(_0x476a47){if(_0x476a47){return _0x476a47[_0x5727('0x20')](_0x5c63ef)['then'](function(_0x1cb06f){return _0x1cb06f;});}return null;};}function removeEntity(_0xb217a7,_0x3775b5){return function(_0x4a3e6b){if(_0x4a3e6b){return _0x4a3e6b['destroy']()[_0x5727('0x21')](function(){var _0x179e74=_0x4a3e6b['get']({'plain':!![]});var _0x41cd74='IvrCampaigns';return db[_0x5727('0x22')][_0x5727('0x23')]({'where':{'type':_0x41cd74,'resourceId':_0x179e74['id']}})['then'](function(){return _0x4a3e6b;});})['then'](function(){_0xb217a7[_0x5727('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c5305,_0x3dd7d2){return function(_0x161f5){if(!_0x161f5){_0x4c5305[_0x5727('0x15')](0x194);}return _0x161f5;};}function handleError(_0xf82573,_0x3afd59){_0x3afd59=_0x3afd59||0x1f4;return function(_0x56e93d){logger['error'](_0x56e93d[_0x5727('0x24')]);if(_0x56e93d[_0x5727('0x25')]){delete _0x56e93d[_0x5727('0x25')];}_0xf82573[_0x5727('0x16')](_0x3afd59)['send'](_0x56e93d);};}exports[_0x5727('0x26')]=function(_0x4b8ce3,_0x1d81ab){var _0x4bdae7={},_0x19636b={},_0x5a6827={'count':0x0,'rows':[]};var _0xe3a786=_[_0x5727('0x27')](db[_0x5727('0x28')][_0x5727('0x29')],function(_0x58080b){return{'name':_0x58080b[_0x5727('0x2a')],'type':_0x58080b[_0x5727('0x2b')]['key']};});_0x19636b['model']=_[_0x5727('0x27')](_0xe3a786,_0x5727('0x25'));_0x19636b[_0x5727('0x2c')]=_[_0x5727('0x2d')](_0x4b8ce3[_0x5727('0x2c')]);_0x19636b['filters']=_[_0x5727('0x2e')](_0x19636b[_0x5727('0x2f')],_0x19636b[_0x5727('0x2c')]);_0x4bdae7[_0x5727('0x30')]=_[_0x5727('0x2e')](_0x19636b[_0x5727('0x2f')],qs[_0x5727('0x31')](_0x4b8ce3[_0x5727('0x2c')][_0x5727('0x31')]));_0x4bdae7[_0x5727('0x30')]=_0x4bdae7[_0x5727('0x30')][_0x5727('0x32')]?_0x4bdae7[_0x5727('0x30')]:_0x19636b[_0x5727('0x2f')];if(!_0x4b8ce3['query'][_0x5727('0x33')](_0x5727('0x34'))){_0x4bdae7[_0x5727('0x1a')]=qs[_0x5727('0x1a')](_0x4b8ce3[_0x5727('0x2c')]['limit']);_0x4bdae7[_0x5727('0x18')]=qs[_0x5727('0x18')](_0x4b8ce3[_0x5727('0x2c')]['offset']);}_0x4bdae7['order']=qs[_0x5727('0x35')](_0x4b8ce3['query']['sort']);_0x4bdae7['where']=qs['filters'](_[_0x5727('0x36')](_0x4b8ce3[_0x5727('0x2c')],_0x19636b[_0x5727('0x37')]),_0xe3a786);if(_0x4b8ce3['query'][_0x5727('0x38')]){_0x4bdae7[_0x5727('0x39')]=_[_0x5727('0x3a')](_0x4bdae7['where'],{'$or':_[_0x5727('0x27')](_0xe3a786,function(_0x1eeac5){if(_0x1eeac5[_0x5727('0x2b')]!=='VIRTUAL'){var _0xfa0b1e={};_0xfa0b1e[_0x1eeac5['name']]={'$like':'%'+_0x4b8ce3[_0x5727('0x2c')][_0x5727('0x38')]+'%'};return _0xfa0b1e;}})});}_0x4bdae7=_['merge']({},_0x4bdae7,_0x4b8ce3[_0x5727('0x3b')]);var _0xa8269b={'where':_0x4bdae7[_0x5727('0x39')]};return db[_0x5727('0x28')][_0x5727('0x1b')](_0xa8269b)[_0x5727('0x21')](function(_0x1e580f){_0x5a6827['count']=_0x1e580f;if(_0x4b8ce3[_0x5727('0x2c')][_0x5727('0x3c')]){_0x4bdae7[_0x5727('0x3d')]=[{'all':!![]}];}return db['Campaign'][_0x5727('0x3e')](_0x4bdae7);})[_0x5727('0x21')](function(_0x47074e){_0x5a6827[_0x5727('0x3f')]=_0x47074e;return _0x5a6827;})[_0x5727('0x21')](respondWithFilteredResult(_0x1d81ab,_0x4bdae7))[_0x5727('0x40')](handleError(_0x1d81ab,null));};exports[_0x5727('0x41')]=function(_0x4da232,_0x91b888){var _0x245189={'raw':![],'where':{'id':_0x4da232[_0x5727('0x42')]['id']}},_0x7620cd={};_0x7620cd[_0x5727('0x2f')]=_[_0x5727('0x2d')](db[_0x5727('0x28')][_0x5727('0x29')]);_0x7620cd[_0x5727('0x2c')]=_[_0x5727('0x2d')](_0x4da232[_0x5727('0x2c')]);_0x7620cd[_0x5727('0x37')]=_[_0x5727('0x2e')](_0x7620cd[_0x5727('0x2f')],_0x7620cd[_0x5727('0x2c')]);_0x245189[_0x5727('0x30')]=_[_0x5727('0x2e')](_0x7620cd[_0x5727('0x2f')],qs['fields'](_0x4da232['query'][_0x5727('0x31')]));_0x245189[_0x5727('0x30')]=_0x245189['attributes'][_0x5727('0x32')]?_0x245189['attributes']:_0x7620cd[_0x5727('0x2f')];if(_0x4da232[_0x5727('0x2c')][_0x5727('0x3c')]){_0x245189[_0x5727('0x3d')]=[{'all':!![]}];}_0x245189=_['merge']({},_0x245189,_0x4da232['options']);return db[_0x5727('0x28')][_0x5727('0x43')](_0x245189)[_0x5727('0x21')](handleEntityNotFound(_0x91b888,null))[_0x5727('0x21')](respondWithResult(_0x91b888,null))[_0x5727('0x40')](handleError(_0x91b888,null));};exports['create']=function(_0x40887d,_0xb168c){return db[_0x5727('0x28')]['create'](_0x40887d[_0x5727('0x44')],{})[_0x5727('0x21')](function(_0x318c43){var _0x43cb66=_0x40887d[_0x5727('0x45')][_0x5727('0x46')]({'plain':!![]});if(!_0x43cb66)throw new Error(_0x5727('0x47'));if(_0x43cb66[_0x5727('0x48')]==='user'){var _0x9a3222=_0x318c43[_0x5727('0x46')]({'plain':!![]});var _0x4a7417=_0x5727('0x49');return db['UserProfileSection'][_0x5727('0x43')]({'where':{'name':_0x4a7417,'userProfileId':_0x43cb66[_0x5727('0x4a')]},'raw':!![]})[_0x5727('0x21')](function(_0x50e166){if(_0x50e166&&_0x50e166[_0x5727('0x4b')]===0x0){return db[_0x5727('0x22')]['create']({'name':_0x9a3222[_0x5727('0x25')],'resourceId':_0x9a3222['id'],'type':_0x50e166[_0x5727('0x25')],'sectionId':_0x50e166['id']},{})[_0x5727('0x21')](function(){return _0x318c43;});}else{return _0x318c43;}})[_0x5727('0x40')](function(_0xa68aa1){logger[_0x5727('0x4c')](_0x5727('0x4d'),_0xa68aa1);throw _0xa68aa1;});}return _0x318c43;})[_0x5727('0x21')](respondWithResult(_0xb168c,0xc9))[_0x5727('0x40')](handleError(_0xb168c,null));};exports[_0x5727('0x4e')]=function(_0x3151cd,_0x169d11){var _0x29cee7={'where':{'id':_0x3151cd[_0x5727('0x42')]['id']}},_0x273085={};_0x273085['model']=_['keys'](db[_0x5727('0x28')][_0x5727('0x29')]);_0x29cee7['attributes']=_['intersection'](_0x273085['model'],qs[_0x5727('0x31')](_0x3151cd[_0x5727('0x2c')][_0x5727('0x31')]));_0x29cee7[_0x5727('0x30')]=_0x29cee7[_0x5727('0x30')][_0x5727('0x32')]?_0x29cee7[_0x5727('0x30')]:_0x273085[_0x5727('0x2f')];if(_0x3151cd[_0x5727('0x2c')][_0x5727('0x3c')]){_0x29cee7[_0x5727('0x3d')]=[{'all':!![]}];}_0x29cee7=_[_0x5727('0x3a')]({},_0x29cee7,_0x3151cd['options']);return db[_0x5727('0x28')]['find'](_0x29cee7)[_0x5727('0x21')](handleEntityNotFound(_0x169d11,null))[_0x5727('0x21')](function(_0x21c1b1){if(_0x21c1b1){var _0x180f05=_0x21c1b1[_0x5727('0x46')]({'plain':!![]});_0x180f05=qs['omit'](_0x180f05,['id',_0x5727('0x4f'),_0x5727('0x50')]);_0x3151cd[_0x5727('0x44')]=_[_0x5727('0x51')](_0x3151cd['body'],['id',_0x5727('0x4f'),_0x5727('0x50')]);return db[_0x5727('0x28')][_0x5727('0x52')](_[_0x5727('0x3a')](_0x180f05,_0x3151cd[_0x5727('0x44')]),{'include':_0x3151cd['query'][_0x5727('0x3c')]?[{'all':!![]}]:undefined})[_0x5727('0x21')](function(_0x1ba6eb){var _0xfccdb7=_0x3151cd[_0x5727('0x45')]['get']({'plain':!![]});if(!_0xfccdb7)throw new Error(_0x5727('0x47'));if(_0xfccdb7[_0x5727('0x48')]===_0x5727('0x45')){var _0x324e95=_0x1ba6eb[_0x5727('0x46')]({'plain':!![]});var _0x5c90f0=_0x5727('0x49');return db[_0x5727('0x53')][_0x5727('0x43')]({'where':{'name':_0x5c90f0,'userProfileId':_0xfccdb7[_0x5727('0x4a')]},'raw':!![]})[_0x5727('0x21')](function(_0x433b09){if(_0x433b09&&_0x433b09['autoAssociation']===0x0){return db[_0x5727('0x22')][_0x5727('0x52')]({'name':_0x324e95[_0x5727('0x25')],'resourceId':_0x324e95['id'],'type':_0x433b09[_0x5727('0x25')],'sectionId':_0x433b09['id']},{})[_0x5727('0x21')](function(){return _0x1ba6eb;});}else{return _0x1ba6eb;}})[_0x5727('0x40')](function(_0x709762){logger['error'](_0x5727('0x4d'),_0x709762);throw _0x709762;});}return _0x1ba6eb;});}})[_0x5727('0x21')](respondWithResult(_0x169d11,0xc9))[_0x5727('0x40')](handleError(_0x169d11,null));};exports[_0x5727('0x20')]=function(_0x59bf27,_0x38c627){if(_0x59bf27[_0x5727('0x44')]['id']){delete _0x59bf27[_0x5727('0x44')]['id'];}return db[_0x5727('0x28')][_0x5727('0x43')]({'where':{'id':_0x59bf27['params']['id']}})[_0x5727('0x21')](handleEntityNotFound(_0x38c627,null))[_0x5727('0x21')](saveUpdates(_0x59bf27['body'],null))[_0x5727('0x21')](respondWithResult(_0x38c627,null))[_0x5727('0x40')](handleError(_0x38c627,null));};exports[_0x5727('0x23')]=function(_0x1e2f3b,_0xc37b31){return db['Campaign'][_0x5727('0x43')]({'where':{'id':_0x1e2f3b[_0x5727('0x42')]['id']}})['then'](handleEntityNotFound(_0xc37b31,null))[_0x5727('0x21')](removeEntity(_0xc37b31,null))[_0x5727('0x40')](handleError(_0xc37b31,null));};exports[_0x5727('0x54')]=function(_0x4d78ba,_0x1c62be,_0x297d4e){var _0x370a65={'raw':!![],'where':{}};var _0x1b417b={};var _0x318b0d={'count':0x0,'rows':[]};return db[_0x5727('0x28')][_0x5727('0x55')]({'where':{'id':_0x4d78ba[_0x5727('0x42')]['id']}})['then'](handleEntityNotFound(_0x1c62be,null))[_0x5727('0x21')](function(_0x261cc6){if(_0x261cc6){_0x1b417b[_0x5727('0x2f')]=_['keys'](db[_0x5727('0x56')]['rawAttributes']);_0x1b417b[_0x5727('0x2c')]=_[_0x5727('0x2d')](_0x4d78ba[_0x5727('0x2c')]);_0x1b417b[_0x5727('0x37')]=_['intersection'](_0x1b417b[_0x5727('0x2f')],_0x1b417b[_0x5727('0x2c')]);_0x370a65[_0x5727('0x30')]=_['intersection'](_0x1b417b[_0x5727('0x2f')],qs[_0x5727('0x31')](_0x4d78ba['query'][_0x5727('0x31')]));_0x370a65['attributes']=_0x370a65[_0x5727('0x30')][_0x5727('0x32')]?_0x370a65[_0x5727('0x30')]:_0x1b417b[_0x5727('0x2f')];if(!_0x4d78ba[_0x5727('0x2c')]['hasOwnProperty'](_0x5727('0x34'))){_0x370a65[_0x5727('0x1a')]=qs['limit'](_0x4d78ba[_0x5727('0x2c')][_0x5727('0x1a')]);_0x370a65['offset']=qs[_0x5727('0x18')](_0x4d78ba[_0x5727('0x2c')]['offset']);}_0x370a65[_0x5727('0x57')]=qs[_0x5727('0x35')](_0x4d78ba['query'][_0x5727('0x35')]);_0x370a65[_0x5727('0x39')]=qs[_0x5727('0x37')](_[_0x5727('0x36')](_0x4d78ba[_0x5727('0x2c')],_0x1b417b[_0x5727('0x37')]));_0x370a65[_0x5727('0x39')][_0x5727('0x58')]=_0x261cc6['id'];if(_0x4d78ba['query'][_0x5727('0x38')]){_0x370a65['where']=_[_0x5727('0x3a')](_0x370a65[_0x5727('0x39')],{'$or':_[_0x5727('0x27')](_0x370a65[_0x5727('0x30')],function(_0x424b5a){var _0x7f4b90={};_0x7f4b90[_0x424b5a]={'$like':'%'+_0x4d78ba[_0x5727('0x2c')][_0x5727('0x38')]+'%'};return _0x7f4b90;})});}_0x370a65=_[_0x5727('0x3a')]({},_0x370a65,_0x4d78ba['options']);return db[_0x5727('0x56')][_0x5727('0x1b')]({'where':_0x370a65[_0x5727('0x39')]})[_0x5727('0x21')](function(_0x394c48){_0x318b0d[_0x5727('0x1b')]=_0x394c48;if(_0x4d78ba[_0x5727('0x2c')][_0x5727('0x3c')]){_0x370a65['include']=[{'all':!![]}];}return db[_0x5727('0x56')][_0x5727('0x3e')](_0x370a65);})[_0x5727('0x21')](function(_0x4328d3){_0x318b0d[_0x5727('0x3f')]=_0x4328d3;return _0x318b0d;});}})[_0x5727('0x21')](respondWithFilteredResult(_0x1c62be,_0x370a65))[_0x5727('0x40')](handleError(_0x1c62be,null));};exports['getHopperHistories']=function(_0x1b10b7,_0x35de7b,_0x132879){var _0x3db853={'raw':!![],'where':{}};var _0x4abf7e={};var _0x28ee57={'count':0x0,'rows':[]};return db['Campaign'][_0x5727('0x55')]({'where':{'id':_0x1b10b7[_0x5727('0x42')]['id']}})['then'](handleEntityNotFound(_0x35de7b,null))['then'](function(_0x3ac017){if(_0x3ac017){_0x4abf7e[_0x5727('0x2f')]=_[_0x5727('0x2d')](db['CmHopperHistory']['rawAttributes']);_0x4abf7e[_0x5727('0x2c')]=_[_0x5727('0x2d')](_0x1b10b7['query']);_0x4abf7e[_0x5727('0x37')]=_[_0x5727('0x2e')](_0x4abf7e[_0x5727('0x2f')],_0x4abf7e[_0x5727('0x2c')]);_0x3db853[_0x5727('0x30')]=_[_0x5727('0x2e')](_0x4abf7e[_0x5727('0x2f')],qs['fields'](_0x1b10b7[_0x5727('0x2c')]['fields']));_0x3db853[_0x5727('0x30')]=_0x3db853['attributes'][_0x5727('0x32')]?_0x3db853['attributes']:_0x4abf7e[_0x5727('0x2f')];if(!_0x1b10b7[_0x5727('0x2c')][_0x5727('0x33')](_0x5727('0x34'))){_0x3db853['limit']=qs[_0x5727('0x1a')](_0x1b10b7[_0x5727('0x2c')][_0x5727('0x1a')]);_0x3db853[_0x5727('0x18')]=qs[_0x5727('0x18')](_0x1b10b7[_0x5727('0x2c')][_0x5727('0x18')]);}_0x3db853[_0x5727('0x57')]=qs['sort'](_0x1b10b7[_0x5727('0x2c')][_0x5727('0x35')]);_0x3db853[_0x5727('0x39')]=qs[_0x5727('0x37')](_[_0x5727('0x36')](_0x1b10b7[_0x5727('0x2c')],_0x4abf7e['filters']));_0x3db853[_0x5727('0x39')][_0x5727('0x58')]=_0x3ac017['id'];if(_0x1b10b7[_0x5727('0x2c')]['filter']){_0x3db853[_0x5727('0x39')]=_[_0x5727('0x3a')](_0x3db853[_0x5727('0x39')],{'$or':_['map'](_0x3db853[_0x5727('0x30')],function(_0x54d139){var _0x6ec164={};_0x6ec164[_0x54d139]={'$like':'%'+_0x1b10b7[_0x5727('0x2c')]['filter']+'%'};return _0x6ec164;})});}_0x3db853=_[_0x5727('0x3a')]({},_0x3db853,_0x1b10b7['options']);return db[_0x5727('0x59')][_0x5727('0x1b')]({'where':_0x3db853[_0x5727('0x39')]})[_0x5727('0x21')](function(_0x316559){_0x28ee57[_0x5727('0x1b')]=_0x316559;if(_0x1b10b7[_0x5727('0x2c')]['includeAll']){_0x3db853[_0x5727('0x3d')]=[{'all':!![]}];}return db[_0x5727('0x59')]['findAll'](_0x3db853);})[_0x5727('0x21')](function(_0xd40492){_0x28ee57[_0x5727('0x3f')]=_0xd40492;return _0x28ee57;});}})['then'](respondWithFilteredResult(_0x35de7b,_0x3db853))['catch'](handleError(_0x35de7b,null));};exports[_0x5727('0x5a')]=function(_0x395999,_0x5c44e1,_0x2c99dd){var _0x582926={'raw':!![],'where':{}};var _0x4312f0={};var _0x424cc0={'count':0x0,'rows':[]};return db[_0x5727('0x28')][_0x5727('0x55')]({'where':{'id':_0x395999[_0x5727('0x42')]['id']}})['then'](handleEntityNotFound(_0x5c44e1,null))[_0x5727('0x21')](function(_0x35af92){if(_0x35af92){_0x4312f0['model']=_[_0x5727('0x2d')](db[_0x5727('0x5b')][_0x5727('0x29')]);_0x4312f0[_0x5727('0x2c')]=_[_0x5727('0x2d')](_0x395999[_0x5727('0x2c')]);_0x4312f0[_0x5727('0x37')]=_[_0x5727('0x2e')](_0x4312f0[_0x5727('0x2f')],_0x4312f0[_0x5727('0x2c')]);_0x582926[_0x5727('0x30')]=_[_0x5727('0x2e')](_0x4312f0[_0x5727('0x2f')],qs[_0x5727('0x31')](_0x395999[_0x5727('0x2c')][_0x5727('0x31')]));_0x582926[_0x5727('0x30')]=_0x582926[_0x5727('0x30')][_0x5727('0x32')]?_0x582926[_0x5727('0x30')]:_0x4312f0[_0x5727('0x2f')];if(!_0x395999[_0x5727('0x2c')]['hasOwnProperty']('nolimit')){_0x582926[_0x5727('0x1a')]=qs[_0x5727('0x1a')](_0x395999[_0x5727('0x2c')][_0x5727('0x1a')]);_0x582926['offset']=qs[_0x5727('0x18')](_0x395999[_0x5727('0x2c')]['offset']);}_0x582926[_0x5727('0x57')]=qs[_0x5727('0x35')](_0x395999['query'][_0x5727('0x35')]);_0x582926[_0x5727('0x39')]=qs[_0x5727('0x37')](_['pick'](_0x395999[_0x5727('0x2c')],_0x4312f0['filters']));_0x582926[_0x5727('0x39')][_0x5727('0x58')]=_0x35af92['id'];if(_0x395999[_0x5727('0x2c')][_0x5727('0x38')]){_0x582926['where']=_[_0x5727('0x3a')](_0x582926[_0x5727('0x39')],{'$or':_[_0x5727('0x27')](_0x582926[_0x5727('0x30')],function(_0x462ca3){var _0x5149a5={};_0x5149a5[_0x462ca3]={'$like':'%'+_0x395999[_0x5727('0x2c')][_0x5727('0x38')]+'%'};return _0x5149a5;})});}_0x582926=_[_0x5727('0x3a')]({},_0x582926,_0x395999[_0x5727('0x3b')]);return db[_0x5727('0x5b')][_0x5727('0x1b')]({'where':_0x582926[_0x5727('0x39')]})[_0x5727('0x21')](function(_0x249a2b){_0x424cc0['count']=_0x249a2b;if(_0x395999[_0x5727('0x2c')][_0x5727('0x3c')]){_0x582926[_0x5727('0x3d')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x5727('0x3e')](_0x582926);})[_0x5727('0x21')](function(_0x4abf54){_0x424cc0[_0x5727('0x3f')]=_0x4abf54;return _0x424cc0;});}})[_0x5727('0x21')](respondWithFilteredResult(_0x5c44e1,_0x582926))[_0x5727('0x40')](handleError(_0x5c44e1,null));};exports[_0x5727('0x5c')]=function(_0x593802,_0x243b26,_0x33b426){var _0x508938={'raw':!![],'where':{}};var _0x4dc5d5={};var _0xe21b25={'count':0x0,'rows':[]};return db[_0x5727('0x28')][_0x5727('0x55')]({'where':{'id':_0x593802[_0x5727('0x42')]['id']}})[_0x5727('0x21')](handleEntityNotFound(_0x243b26,null))['then'](function(_0x53eb58){if(_0x53eb58){_0x4dc5d5['model']=_[_0x5727('0x2d')](db[_0x5727('0x5d')][_0x5727('0x29')]);_0x4dc5d5[_0x5727('0x2c')]=_[_0x5727('0x2d')](_0x593802[_0x5727('0x2c')]);_0x4dc5d5['filters']=_[_0x5727('0x2e')](_0x4dc5d5[_0x5727('0x2f')],_0x4dc5d5[_0x5727('0x2c')]);_0x508938['attributes']=_[_0x5727('0x2e')](_0x4dc5d5[_0x5727('0x2f')],qs[_0x5727('0x31')](_0x593802[_0x5727('0x2c')][_0x5727('0x31')]));_0x508938[_0x5727('0x30')]=_0x508938[_0x5727('0x30')][_0x5727('0x32')]?_0x508938[_0x5727('0x30')]:_0x4dc5d5[_0x5727('0x2f')];if(!_0x593802[_0x5727('0x2c')][_0x5727('0x33')](_0x5727('0x34'))){_0x508938[_0x5727('0x1a')]=qs[_0x5727('0x1a')](_0x593802[_0x5727('0x2c')][_0x5727('0x1a')]);_0x508938[_0x5727('0x18')]=qs['offset'](_0x593802['query']['offset']);}_0x508938['order']=qs[_0x5727('0x35')](_0x593802[_0x5727('0x2c')]['sort']);_0x508938['where']=qs[_0x5727('0x37')](_[_0x5727('0x36')](_0x593802[_0x5727('0x2c')],_0x4dc5d5['filters']));_0x508938[_0x5727('0x39')][_0x5727('0x58')]=_0x53eb58['id'];if(_0x593802[_0x5727('0x2c')]['filter']){_0x508938[_0x5727('0x39')]=_[_0x5727('0x3a')](_0x508938['where'],{'$or':_[_0x5727('0x27')](_0x508938[_0x5727('0x30')],function(_0x1e799b){var _0xa62b6c={};_0xa62b6c[_0x1e799b]={'$like':'%'+_0x593802[_0x5727('0x2c')][_0x5727('0x38')]+'%'};return _0xa62b6c;})});}_0x508938=_[_0x5727('0x3a')]({},_0x508938,_0x593802['options']);return db[_0x5727('0x5d')][_0x5727('0x1b')]({'where':_0x508938[_0x5727('0x39')]})[_0x5727('0x21')](function(_0x5692b8){_0xe21b25[_0x5727('0x1b')]=_0x5692b8;if(_0x593802[_0x5727('0x2c')][_0x5727('0x3c')]){_0x508938[_0x5727('0x3d')]=[{'all':!![]}];}return db[_0x5727('0x5d')][_0x5727('0x3e')](_0x508938);})[_0x5727('0x21')](function(_0x4a9a09){_0xe21b25[_0x5727('0x3f')]=_0x4a9a09;return _0xe21b25;});}})['then'](respondWithFilteredResult(_0x243b26,_0x508938))[_0x5727('0x40')](handleError(_0x243b26,null));};exports['getLists']=function(_0x2b6dd1,_0x49ecc4,_0x373479){var _0x367996={};var _0x2a6197={};var _0x38f57a;var _0x15f762;return db[_0x5727('0x28')][_0x5727('0x55')]({'where':{'id':_0x2b6dd1[_0x5727('0x42')]['id']}})[_0x5727('0x21')](handleEntityNotFound(_0x49ecc4,null))[_0x5727('0x21')](function(_0x19cf5a){if(_0x19cf5a){_0x38f57a=_0x19cf5a;_0x2a6197[_0x5727('0x2f')]=_['keys'](db[_0x5727('0x5e')][_0x5727('0x29')]);_0x2a6197[_0x5727('0x2c')]=_[_0x5727('0x2d')](_0x2b6dd1[_0x5727('0x2c')]);_0x2a6197[_0x5727('0x37')]=_[_0x5727('0x2e')](_0x2a6197[_0x5727('0x2f')],_0x2a6197['query']);_0x367996[_0x5727('0x30')]=_[_0x5727('0x2e')](_0x2a6197[_0x5727('0x2f')],qs[_0x5727('0x31')](_0x2b6dd1[_0x5727('0x2c')][_0x5727('0x31')]));_0x367996[_0x5727('0x30')]=_0x367996['attributes']['length']?_0x367996[_0x5727('0x30')]:_0x2a6197[_0x5727('0x2f')];_0x367996[_0x5727('0x57')]=qs[_0x5727('0x35')](_0x2b6dd1[_0x5727('0x2c')]['sort']);_0x367996[_0x5727('0x39')]=qs['filters'](_['pick'](_0x2b6dd1['query'],_0x2a6197[_0x5727('0x37')]));if(_0x2b6dd1[_0x5727('0x2c')][_0x5727('0x38')]){_0x367996[_0x5727('0x39')]=_[_0x5727('0x3a')](_0x367996[_0x5727('0x39')],{'$or':_[_0x5727('0x27')](_0x367996[_0x5727('0x30')],function(_0x23c9d3){var _0x3e0b25={};_0x3e0b25[_0x23c9d3]={'$like':'%'+_0x2b6dd1['query'][_0x5727('0x38')]+'%'};return _0x3e0b25;})});}_0x367996=_[_0x5727('0x3a')]({},_0x367996,_0x2b6dd1['options']);return _0x38f57a['getLists'](_0x367996);}})['then'](function(_0x49051a){if(_0x49051a){_0x15f762=_0x49051a[_0x5727('0x32')];if(!_0x2b6dd1[_0x5727('0x2c')][_0x5727('0x33')](_0x5727('0x34'))){_0x367996[_0x5727('0x1a')]=qs['limit'](_0x2b6dd1[_0x5727('0x2c')]['limit']);_0x367996[_0x5727('0x18')]=qs[_0x5727('0x18')](_0x2b6dd1[_0x5727('0x2c')][_0x5727('0x18')]);}return _0x38f57a['getLists'](_0x367996);}})[_0x5727('0x21')](function(_0x59f549){if(_0x59f549){return _0x59f549?{'count':_0x15f762,'rows':_0x59f549}:null;}})['then'](respondWithResult(_0x49ecc4,null))[_0x5727('0x40')](handleError(_0x49ecc4,null));};exports[_0x5727('0x5f')]=function(_0x5a1596,_0xcdf346,_0x891692){var _0x35c8e1,_0x152ce5;var _0x21ea42=[];var _0x11e075=moment()[_0x5727('0x60')](_0x5727('0x61'));return db[_0x5727('0x28')][_0x5727('0x43')]({'where':{'id':_0x5a1596[_0x5727('0x42')]['id']}})['then'](handleEntityNotFound(_0xcdf346,null))['then'](function(_0xba92f6){if(_0xba92f6){_0x152ce5=_0xba92f6;return _0xba92f6[_0x5727('0x5f')](_0x5a1596[_0x5727('0x44')][_0x5727('0x62')],_[_0x5727('0x51')](_0x5a1596[_0x5727('0x44')],[_0x5727('0x62'),'id'])||{});}return null;})[_0x5727('0x63')](function(_0x5735d5){var _0x5ebf9c;var _0x1c0890;_0x35c8e1=_0x5735d5||[];var _0x594bc4=[];if(_0x5735d5){for(var _0x5c2a2b=0x0;_0x5c2a2b<_0x5735d5['length'];_0x5c2a2b+=0x1){var _0x368a1a=_0x5735d5[_0x5c2a2b]['get']({'plain':!![]});_0x152ce5[_0x5727('0x64')]=_0x5a1596[_0x5727('0x44')]['dialCheckDuplicateType']?_0x5a1596[_0x5727('0x44')][_0x5727('0x64')]:_0x152ce5[_0x5727('0x64')];switch(_0x152ce5[_0x5727('0x64')]){case _0x5727('0x65'):_0x5ebf9c=squel[_0x5727('0x66')]()[_0x5727('0x67')](_0x5727('0x68'))[_0x5727('0x69')](['phone',_0x5727('0x6a'),_0x5727('0x6b'),_0x5727('0x6c'),'CampaignId','createdAt','updatedAt'],squel['select']()['field'](_0x5727('0x6d'),_0x5727('0x6d'))['field'](_0x5727('0x6e'),_0x5727('0x6a'))['field']('id',_0x5727('0x6b'))[_0x5727('0x6f')](_0x368a1a['CmListId'][_0x5727('0x70')](),_0x5727('0x6c'))[_0x5727('0x6f')](_0x5a1596['params']['id'][_0x5727('0x70')](),_0x5727('0x58'))[_0x5727('0x6f')]('\x27'+_0x11e075+'\x27',_0x5727('0x4f'))[_0x5727('0x6f')]('\x27'+_0x11e075+'\x27',_0x5727('0x50'))['from'](_0x5727('0x71'))[_0x5727('0x39')](_0x5727('0x72'))[_0x5727('0x39')](_0x5727('0x73'),_0x368a1a[_0x5727('0x74')][_0x5727('0x70')]())[_0x5727('0x39')](_0x5727('0x75'))[_0x5727('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0x5727('0x76')]()[_0x5727('0x6f')](_0x5727('0x77'))[_0x5727('0x78')]('cm_hopper_final')[_0x5727('0x39')](_0x5727('0x79'),_0x5a1596[_0x5727('0x42')]['id']['toString']()))[_0x5727('0x39')](_0x5727('0x7a'),squel[_0x5727('0x76')]()['field'](_0x5727('0x7b'))['from'](_0x5727('0x68'))[_0x5727('0x39')](_0x5727('0x79'),_0x5a1596[_0x5727('0x42')]['id']['toString']())))[_0x5727('0x70')]();break;case _0x5727('0x7c'):_0x5ebf9c=squel[_0x5727('0x66')]()['into'](_0x5727('0x68'))[_0x5727('0x69')](['phone','scheduledAt',_0x5727('0x6b'),_0x5727('0x6c'),_0x5727('0x58'),'createdAt',_0x5727('0x50')],squel[_0x5727('0x76')]()[_0x5727('0x6f')]('phone',_0x5727('0x6d'))[_0x5727('0x6f')](_0x5727('0x6e'),_0x5727('0x6a'))[_0x5727('0x6f')]('id','ContactId')[_0x5727('0x6f')](_0x368a1a[_0x5727('0x74')][_0x5727('0x70')](),'ListId')[_0x5727('0x6f')](_0x5a1596['params']['id'][_0x5727('0x70')](),_0x5727('0x58'))[_0x5727('0x6f')]('\x27'+_0x11e075+'\x27',_0x5727('0x4f'))[_0x5727('0x6f')]('\x27'+_0x11e075+'\x27',_0x5727('0x50'))[_0x5727('0x78')](_0x5727('0x71'))[_0x5727('0x39')](_0x5727('0x72'))[_0x5727('0x39')](_0x5727('0x73'),_0x368a1a['CmListId'][_0x5727('0x70')]())['where'](_0x5727('0x75'))[_0x5727('0x39')](_0x5727('0x7a'),squel[_0x5727('0x76')]()[_0x5727('0x6f')](_0x5727('0x7b'))['from'](_0x5727('0x68'))[_0x5727('0x39')]('CampaignId\x20=\x20?',_0x5a1596[_0x5727('0x42')]['id'][_0x5727('0x70')]())))[_0x5727('0x70')]();break;default:_0x5ebf9c=squel[_0x5727('0x66')]()[_0x5727('0x67')](_0x5727('0x68'))[_0x5727('0x69')]([_0x5727('0x6d'),_0x5727('0x6a'),_0x5727('0x6b'),_0x5727('0x6c'),'CampaignId',_0x5727('0x4f'),_0x5727('0x50')],squel[_0x5727('0x76')]()[_0x5727('0x6f')]('phone',_0x5727('0x6d'))[_0x5727('0x6f')](_0x5727('0x6e'),_0x5727('0x6a'))[_0x5727('0x6f')]('id',_0x5727('0x6b'))[_0x5727('0x6f')](_0x368a1a['CmListId']['toString'](),_0x5727('0x6c'))[_0x5727('0x6f')](_0x5a1596[_0x5727('0x42')]['id'][_0x5727('0x70')](),_0x5727('0x58'))[_0x5727('0x6f')]('\x27'+_0x11e075+'\x27',_0x5727('0x4f'))[_0x5727('0x6f')]('\x27'+_0x11e075+'\x27',_0x5727('0x50'))[_0x5727('0x78')]('cm_contacts')[_0x5727('0x39')](_0x5727('0x72'))[_0x5727('0x39')](_0x5727('0x73'),_0x368a1a[_0x5727('0x74')][_0x5727('0x70')]())[_0x5727('0x39')](_0x5727('0x75')))[_0x5727('0x70')]();}_0x1c0890=squel[_0x5727('0x66')]()[_0x5727('0x67')](_0x5727('0x7d'))[_0x5727('0x69')]([_0x5727('0x7e'),'scheduledAt','phone','OrderBy',_0x5727('0x4f'),_0x5727('0x50')],squel[_0x5727('0x76')]()[_0x5727('0x6f')](_0x5727('0x7f'),'id')[_0x5727('0x6f')]('NOW()',_0x5727('0x6a'))[_0x5727('0x6f')]('ci.item',_0x5727('0x6d'))[_0x5727('0x6f')](_0x5727('0x80'),_0x5727('0x81'))[_0x5727('0x6f')]('\x27'+_0x11e075+'\x27','createdAt')['field']('\x27'+_0x11e075+'\x27',_0x5727('0x50'))[_0x5727('0x78')](_0x5727('0x82'),'ci')[_0x5727('0x83')](_0x5727('0x68'),'h',_0x5727('0x84'))[_0x5727('0x39')]('h.ListId\x20=\x20?',_0x368a1a[_0x5727('0x74')][_0x5727('0x70')]())[_0x5727('0x39')](_0x5727('0x85'),_0x5a1596[_0x5727('0x42')]['id'][_0x5727('0x70')]())[_0x5727('0x39')](_0x5727('0x86'),_0x11e075))[_0x5727('0x70')]();_0x594bc4[_0x5727('0x87')](db[_0x5727('0x88')][_0x5727('0x2c')](_0x5ebf9c));_0x21ea42[_0x5727('0x87')](db[_0x5727('0x88')][_0x5727('0x2c')](_0x1c0890));}return BPromise['all'](_0x594bc4);}})[_0x5727('0x21')](function(){return BPromise['all'](_0x21ea42);})[_0x5727('0x21')](function(){return _0x35c8e1;})['then'](respondWithResult(_0xcdf346,null))[_0x5727('0x40')](handleError(_0xcdf346,null));};exports['removeLists']=function(_0x406b67,_0x350346,_0x16a1d9){return db[_0x5727('0x28')][_0x5727('0x43')]({'where':{'id':_0x406b67[_0x5727('0x42')]['id']}})[_0x5727('0x21')](handleEntityNotFound(_0x350346,null))[_0x5727('0x21')](function(_0x14dbec){if(_0x14dbec){return _0x14dbec[_0x5727('0x89')](_0x406b67[_0x5727('0x2c')][_0x5727('0x62')]);}})['then'](function(_0x3aee90){if(_0x3aee90){return db[_0x5727('0x56')][_0x5727('0x23')]({'where':{'ListId':_0x406b67[_0x5727('0x2c')][_0x5727('0x62')],'CampaignId':_0x406b67[_0x5727('0x42')]['id']}})[_0x5727('0x21')](function(){return _0x3aee90;});}})[_0x5727('0x21')](respondWithStatusCode(_0x350346,null))[_0x5727('0x40')](handleError(_0x350346,null));};exports[_0x5727('0x8a')]=function(_0x1dd299,_0x364735,_0x3fbc52){var _0xab3bb0={};var _0x5cdca0={};var _0x40d52b;var _0x4de535;return db[_0x5727('0x28')][_0x5727('0x55')]({'where':{'id':_0x1dd299[_0x5727('0x42')]['id']}})[_0x5727('0x21')](handleEntityNotFound(_0x364735,null))[_0x5727('0x21')](function(_0x37c99b){if(_0x37c99b){_0x40d52b=_0x37c99b;_0x5cdca0[_0x5727('0x2f')]=_[_0x5727('0x2d')](db['CmList'][_0x5727('0x29')]);_0x5cdca0[_0x5727('0x2c')]=_[_0x5727('0x2d')](_0x1dd299[_0x5727('0x2c')]);_0x5cdca0[_0x5727('0x37')]=_[_0x5727('0x2e')](_0x5cdca0['model'],_0x5cdca0['query']);_0xab3bb0[_0x5727('0x30')]=_['intersection'](_0x5cdca0[_0x5727('0x2f')],qs[_0x5727('0x31')](_0x1dd299[_0x5727('0x2c')][_0x5727('0x31')]));_0xab3bb0[_0x5727('0x30')]=_0xab3bb0[_0x5727('0x30')][_0x5727('0x32')]?_0xab3bb0[_0x5727('0x30')]:_0x5cdca0['model'];_0xab3bb0[_0x5727('0x57')]=qs[_0x5727('0x35')](_0x1dd299[_0x5727('0x2c')][_0x5727('0x35')]);_0xab3bb0[_0x5727('0x39')]=qs[_0x5727('0x37')](_[_0x5727('0x36')](_0x1dd299['query'],_0x5cdca0[_0x5727('0x37')]));if(_0x1dd299[_0x5727('0x2c')][_0x5727('0x38')]){_0xab3bb0[_0x5727('0x39')]=_['merge'](_0xab3bb0[_0x5727('0x39')],{'$or':_[_0x5727('0x27')](_0xab3bb0[_0x5727('0x30')],function(_0x1a7b7f){var _0x18efd3={};_0x18efd3[_0x1a7b7f]={'$like':'%'+_0x1dd299['query'][_0x5727('0x38')]+'%'};return _0x18efd3;})});}_0xab3bb0=_[_0x5727('0x3a')]({},_0xab3bb0,_0x1dd299[_0x5727('0x3b')]);return _0x40d52b[_0x5727('0x8a')](_0xab3bb0);}})[_0x5727('0x21')](function(_0x449dda){if(_0x449dda){_0x4de535=_0x449dda[_0x5727('0x32')];if(!_0x1dd299[_0x5727('0x2c')][_0x5727('0x33')]('nolimit')){_0xab3bb0[_0x5727('0x1a')]=qs[_0x5727('0x1a')](_0x1dd299['query'][_0x5727('0x1a')]);_0xab3bb0[_0x5727('0x18')]=qs['offset'](_0x1dd299[_0x5727('0x2c')][_0x5727('0x18')]);}return _0x40d52b[_0x5727('0x8a')](_0xab3bb0);}})[_0x5727('0x21')](function(_0x2565a0){if(_0x2565a0){return _0x2565a0?{'count':_0x4de535,'rows':_0x2565a0}:null;}})[_0x5727('0x21')](respondWithResult(_0x364735,null))[_0x5727('0x40')](handleError(_0x364735,null));};exports['addBlackLists']=function(_0x32cf23,_0x2476c7,_0xed8ef){var _0x16b7da,_0x1847fc;var _0x7129b3=[];var _0xaf181=moment()[_0x5727('0x60')](_0x5727('0x61'));return db[_0x5727('0x28')][_0x5727('0x43')]({'where':{'id':_0x32cf23[_0x5727('0x42')]['id']}})[_0x5727('0x21')](handleEntityNotFound(_0x2476c7,null))[_0x5727('0x21')](function(_0xabc143){if(_0xabc143){_0x1847fc=_0xabc143;return _0xabc143[_0x5727('0x8b')](_0x32cf23[_0x5727('0x44')][_0x5727('0x62')],_[_0x5727('0x51')](_0x32cf23[_0x5727('0x44')],[_0x5727('0x62'),'id'])||{});}return null;})[_0x5727('0x63')](function(_0xad2899){var _0x1a69ca;var _0x4e064c;_0x16b7da=_0xad2899||[];var _0x239566=[];if(_0xad2899){for(var _0x42a128=0x0;_0x42a128<_0xad2899[_0x5727('0x32')];_0x42a128+=0x1){var _0x41f86a=_0xad2899[_0x42a128][_0x5727('0x46')]({'plain':!![]});_0x1a69ca=squel[_0x5727('0x66')]()[_0x5727('0x67')](_0x5727('0x8c'))[_0x5727('0x69')](['phone',_0x5727('0x6b'),_0x5727('0x6c'),_0x5727('0x58'),_0x5727('0x4f'),_0x5727('0x50')],squel[_0x5727('0x76')]()[_0x5727('0x6f')](_0x5727('0x6d'),_0x5727('0x6d'))['field']('id',_0x5727('0x6b'))[_0x5727('0x6f')](_0x41f86a[_0x5727('0x74')]['toString'](),_0x5727('0x6c'))['field'](_0x32cf23['params']['id']['toString'](),'CampaignId')[_0x5727('0x6f')](_0x5727('0x6e'),_0x5727('0x4f'))[_0x5727('0x6f')](_0x5727('0x6e'),_0x5727('0x50'))['from'](_0x5727('0x71'))[_0x5727('0x39')](_0x5727('0x72'))['where']('ListId\x20=\x20?',_0x41f86a['CmListId'][_0x5727('0x70')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x5727('0x70')]();_0x239566['push'](db[_0x5727('0x88')][_0x5727('0x2c')](_0x1a69ca));}return BPromise[_0x5727('0x8d')](_0x239566);}})[_0x5727('0x21')](function(){return _0x16b7da;})[_0x5727('0x21')](respondWithResult(_0x2476c7,null))[_0x5727('0x40')](handleError(_0x2476c7,null));};exports['removeBlackLists']=function(_0x1c1738,_0x3909a6,_0x4f3b29){return db['Campaign'][_0x5727('0x43')]({'where':{'id':_0x1c1738['params']['id']}})['then'](handleEntityNotFound(_0x3909a6,null))[_0x5727('0x21')](function(_0x5eb419){if(_0x5eb419){return _0x5eb419[_0x5727('0x8e')](_0x1c1738[_0x5727('0x2c')][_0x5727('0x62')]);}})[_0x5727('0x21')](function(_0x4a3c6b){if(_0x4a3c6b){return db[_0x5727('0x5d')][_0x5727('0x23')]({'where':{'ListId':_0x1c1738['query'][_0x5727('0x62')],'CampaignId':_0x1c1738['params']['id']}})[_0x5727('0x21')](function(){return _0x4a3c6b;});}})['then'](respondWithStatusCode(_0x3909a6,null))[_0x5727('0x40')](handleError(_0x3909a6,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index f022b86..7963470 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 b6b4ea1..03b8ee0 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(_0x135d6d,_0x3fe57e){var _0x14ff9a=function(_0x2a6021){while(--_0x2a6021){_0x135d6d['push'](_0x135d6d['shift']());}};_0x14ff9a(++_0x3fe57e);}(_0x2121,0x1b4));var _0x1212=function(_0x20e21b,_0x456996){_0x20e21b=_0x20e21b-0x0;var _0x3c4627=_0x2121[_0x20e21b];return _0x3c4627;};'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 _0xd6ce=['raw','attributes','limit','map','include','model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','GetCampaign','Campaign','options'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd6ce,0x127));var _0xed6c=function(_0x1e01aa,_0x4868d6){_0x1e01aa=_0x1e01aa-0x0;var _0x3b40cf=_0xd6ce[_0x1e01aa];return _0x3b40cf;};'use strict';var _=require(_0xed6c('0x0'));var util=require(_0xed6c('0x1'));var moment=require(_0xed6c('0x2'));var BPromise=require(_0xed6c('0x3'));var rs=require(_0xed6c('0x4'));var fs=require('fs');var Redis=require(_0xed6c('0x5'));var db=require(_0xed6c('0x6'))['db'];var utils=require(_0xed6c('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xed6c('0x8'));var jayson=require(_0xed6c('0x9'));var client=jayson[_0xed6c('0xa')][_0xed6c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a6546,_0x5e0e3a,_0x7668a7){return new BPromise(function(_0x46e2c4,_0x4fd673){return client['request'](_0x4a6546,_0x7668a7)[_0xed6c('0xc')](function(_0xc996c4){logger[_0xed6c('0xd')](_0xed6c('0xe'),_0x5e0e3a,'request\x20sent');logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x5e0e3a,'request\x20sent',JSON[_0xed6c('0xf')](_0xc996c4));if(_0xc996c4['error']){if(_0xc996c4['error'][_0xed6c('0x10')]===0x1f4){logger[_0xed6c('0x11')]('Campaign,\x20%s,\x20%s',_0x5e0e3a,_0xc996c4[_0xed6c('0x11')]['message']);return _0x4fd673(_0xc996c4[_0xed6c('0x11')][_0xed6c('0x12')]);}logger['error'](_0xed6c('0xe'),_0x5e0e3a,_0xc996c4[_0xed6c('0x11')][_0xed6c('0x12')]);return _0x46e2c4(_0xc996c4[_0xed6c('0x11')]['message']);}else{logger['info'](_0xed6c('0xe'),_0x5e0e3a,_0xed6c('0x13'));_0x46e2c4(_0xc996c4[_0xed6c('0x14')]['message']);}})[_0xed6c('0x15')](function(_0x526c54){logger[_0xed6c('0x11')](_0xed6c('0xe'),_0x5e0e3a,_0x526c54);_0x4fd673(_0x526c54);});});}exports[_0xed6c('0x16')]=function(_0x1fe8c0){var _0x4a920e=this;return new Promise(function(_0x387ba1,_0x1856f7){return db[_0xed6c('0x17')]['findAll']({'raw':_0x1fe8c0[_0xed6c('0x18')]?_0x1fe8c0[_0xed6c('0x18')][_0xed6c('0x19')]===undefined?!![]:![]:!![],'where':_0x1fe8c0[_0xed6c('0x18')]?_0x1fe8c0[_0xed6c('0x18')]['where']||null:null,'attributes':_0x1fe8c0[_0xed6c('0x18')]?_0x1fe8c0['options'][_0xed6c('0x1a')]||null:null,'limit':_0x1fe8c0[_0xed6c('0x18')]?_0x1fe8c0[_0xed6c('0x18')][_0xed6c('0x1b')]||null:null,'include':_0x1fe8c0['options']?_0x1fe8c0[_0xed6c('0x18')]['include']?_[_0xed6c('0x1c')](_0x1fe8c0['options'][_0xed6c('0x1d')],function(_0x21e0ba){return{'model':db[_0x21e0ba[_0xed6c('0x1e')]],'as':_0x21e0ba['as'],'attributes':_0x21e0ba[_0xed6c('0x1a')],'include':_0x21e0ba[_0xed6c('0x1d')]?_[_0xed6c('0x1c')](_0x21e0ba[_0xed6c('0x1d')],function(_0x27fb6c){return{'model':db[_0x27fb6c[_0xed6c('0x1e')]],'as':_0x27fb6c['as'],'attributes':_0x27fb6c[_0xed6c('0x1a')],'include':_0x27fb6c[_0xed6c('0x1d')]?_['map'](_0x27fb6c[_0xed6c('0x1d')],function(_0x27484c){return{'model':db[_0x27484c[_0xed6c('0x1e')]],'as':_0x27484c['as'],'attributes':_0x27484c[_0xed6c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xed6c('0xc')](function(_0x3574a3){logger['info'](_0xed6c('0x16'),_0x1fe8c0);logger[_0xed6c('0x1f')](_0xed6c('0x16'),_0x1fe8c0,JSON['stringify'](_0x3574a3));_0x387ba1(_0x3574a3);})['catch'](function(_0x531cd0){logger['error'](_0xed6c('0x16'),_0x531cd0['message'],_0x1fe8c0);_0x1856f7(_0x4a920e[_0xed6c('0x11')](0x1f4,_0x531cd0['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 5d5ce2c..e928a0e 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 _0x6e73=['addLists','addBlackLists','put','update','destroy','delete','/:id/blacklists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getBlackLists','post','create','/:id/clone','clone','/:id/lists'];(function(_0x5d2cf3,_0x16bfd2){var _0x45a3fc=function(_0x24e67f){while(--_0x24e67f){_0x5d2cf3['push'](_0x5d2cf3['shift']());}};_0x45a3fc(++_0x16bfd2);}(_0x6e73,0x110));var _0x36e7=function(_0xcf1602,_0x1da275){_0xcf1602=_0xcf1602-0x0;var _0x2bfa18=_0x6e73[_0xcf1602];return _0x2bfa18;};'use strict';var multer=require(_0x36e7('0x0'));var util=require(_0x36e7('0x1'));var path=require(_0x36e7('0x2'));var timeout=require(_0x36e7('0x3'));var express=require(_0x36e7('0x4'));var router=express[_0x36e7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x36e7('0x6'));var interaction=require(_0x36e7('0x7'));var config=require(_0x36e7('0x8'));var controller=require(_0x36e7('0x9'));router[_0x36e7('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x36e7('0xa')](_0x36e7('0xb'),auth[_0x36e7('0xc')](),controller[_0x36e7('0xd')]);router[_0x36e7('0xa')](_0x36e7('0xe'),auth[_0x36e7('0xc')](),controller[_0x36e7('0xf')]);router[_0x36e7('0xa')](_0x36e7('0x10'),auth[_0x36e7('0xc')](),controller[_0x36e7('0x11')]);router[_0x36e7('0xa')](_0x36e7('0x12'),auth[_0x36e7('0xc')](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0x36e7('0xc')](),controller['getHopperBlacks']);router[_0x36e7('0xa')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router['get']('/:id/blacklists',auth[_0x36e7('0xc')](),controller[_0x36e7('0x13')]);router[_0x36e7('0x14')]('/',auth[_0x36e7('0xc')](),controller[_0x36e7('0x15')]);router['post'](_0x36e7('0x16'),auth['isAuthenticated'](),controller[_0x36e7('0x17')]);router['post'](_0x36e7('0x18'),auth[_0x36e7('0xc')](),controller[_0x36e7('0x19')]);router[_0x36e7('0x14')]('/:id/blacklists',auth[_0x36e7('0xc')](),controller[_0x36e7('0x1a')]);router[_0x36e7('0x1b')]('/:id',auth[_0x36e7('0xc')](),controller[_0x36e7('0x1c')]);router['delete'](_0x36e7('0xb'),auth[_0x36e7('0xc')](),controller[_0x36e7('0x1d')]);router[_0x36e7('0x1e')](_0x36e7('0x18'),auth[_0x36e7('0xc')](),controller['removeLists']);router[_0x36e7('0x1e')](_0x36e7('0x1f'),auth[_0x36e7('0xc')](),controller['removeBlackLists']);module[_0x36e7('0x20')]=router;
\ No newline at end of file
+var _0x884b=['/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','clone','addLists','/:id/blacklists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','getHopperHistories','getHopperFinals'];(function(_0x45d501,_0x1901b7){var _0x290355=function(_0x43205f){while(--_0x43205f){_0x45d501['push'](_0x45d501['shift']());}};_0x290355(++_0x1901b7);}(_0x884b,0x99));var _0xb884=function(_0x1562a2,_0x2e4655){_0x1562a2=_0x1562a2-0x0;var _0x39a636=_0x884b[_0x1562a2];return _0x39a636;};'use strict';var multer=require(_0xb884('0x0'));var util=require(_0xb884('0x1'));var path=require(_0xb884('0x2'));var timeout=require(_0xb884('0x3'));var express=require(_0xb884('0x4'));var router=express[_0xb884('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb884('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb884('0x7'));var controller=require(_0xb884('0x8'));router[_0xb884('0x9')]('/',auth[_0xb884('0xa')](),controller[_0xb884('0xb')]);router['get'](_0xb884('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xb884('0xd'),auth[_0xb884('0xa')](),controller[_0xb884('0xe')]);router[_0xb884('0x9')]('/:id/hopper_histories',auth[_0xb884('0xa')](),controller[_0xb884('0xf')]);router[_0xb884('0x9')]('/:id/hopper_finals',auth[_0xb884('0xa')](),controller[_0xb884('0x10')]);router[_0xb884('0x9')](_0xb884('0x11'),auth['isAuthenticated'](),controller[_0xb884('0x12')]);router[_0xb884('0x9')](_0xb884('0x13'),auth[_0xb884('0xa')](),controller[_0xb884('0x14')]);router[_0xb884('0x9')]('/:id/blacklists',auth[_0xb884('0xa')](),controller[_0xb884('0x15')]);router[_0xb884('0x16')]('/',auth['isAuthenticated'](),controller[_0xb884('0x17')]);router[_0xb884('0x16')]('/:id/clone',auth[_0xb884('0xa')](),controller[_0xb884('0x18')]);router[_0xb884('0x16')](_0xb884('0x13'),auth['isAuthenticated'](),controller[_0xb884('0x19')]);router['post'](_0xb884('0x1a'),auth[_0xb884('0xa')](),controller['addBlackLists']);router[_0xb884('0x1b')](_0xb884('0xc'),auth[_0xb884('0xa')](),controller[_0xb884('0x1c')]);router[_0xb884('0x1d')]('/:id',auth[_0xb884('0xa')](),controller[_0xb884('0x1e')]);router[_0xb884('0x1d')](_0xb884('0x13'),auth[_0xb884('0xa')](),controller[_0xb884('0x1f')]);router[_0xb884('0x1d')](_0xb884('0x1a'),auth[_0xb884('0xa')](),controller[_0xb884('0x20')]);module[_0xb884('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 55d79ae..d4a5163 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 _0xfb09=['sequelize','exports','STRING','VIRTUAL','getDataValue','key'];(function(_0x3f9584,_0x5ab12c){var _0x9d54c=function(_0x2882df){while(--_0x2882df){_0x3f9584['push'](_0x3f9584['shift']());}};_0x9d54c(++_0x5ab12c);}(_0xfb09,0xa8));var _0x9fb0=function(_0x4138ac,_0x300097){_0x4138ac=_0x4138ac-0x0;var _0x66154=_0xfb09[_0x4138ac];return _0x66154;};'use strict';var Sequelize=require(_0x9fb0('0x0'));module[_0x9fb0('0x1')]={'key':{'type':Sequelize[_0x9fb0('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x9fb0('0x2')]},'name':{'type':Sequelize[_0x9fb0('0x3')],'get':function(){return this[_0x9fb0('0x4')](_0x9fb0('0x5'));}}};
\ No newline at end of file
+var _0x5fe3=['exports','STRING','TEXT','medium','getDataValue','key'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x5fe3,0x114));var _0x35fe=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0x5fe3[_0x4ed32d];return _0xf624df;};'use strict';var Sequelize=require('sequelize');module[_0x35fe('0x0')]={'key':{'type':Sequelize[_0x35fe('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x35fe('0x2')],'length':_0x35fe('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x35fe('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x35fe('0x4')](_0x35fe('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 18dc0eb..5564f27 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 _0xb097=['pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','get','CannedAnswers','name','send','index','map','CannedAnswer','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb097,0xcc));var _0x7b09=function(_0x593e4c,_0x5b965b){_0x593e4c=_0x593e4c-0x0;var _0x15171a=_0xb097[_0x593e4c];return _0x15171a;};'use strict';var emlformat=require(_0x7b09('0x0'));var rimraf=require(_0x7b09('0x1'));var zipdir=require(_0x7b09('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b09('0x3'));var BPromise=require(_0x7b09('0x4'));var Mustache=require('mustache');var util=require(_0x7b09('0x5'));var path=require(_0x7b09('0x6'));var sox=require('sox');var csv=require(_0x7b09('0x7'));var ejs=require(_0x7b09('0x8'));var fs=require('fs');var fs_extra=require(_0x7b09('0x9'));var _=require(_0x7b09('0xa'));var squel=require(_0x7b09('0xb'));var crypto=require(_0x7b09('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7b09('0xd'));var toCsv=require(_0x7b09('0x7'));var querystring=require(_0x7b09('0xe'));var Papa=require(_0x7b09('0xf'));var Redis=require(_0x7b09('0x10'));var authService=require(_0x7b09('0x11'));var qs=require(_0x7b09('0x12'));var as=require(_0x7b09('0x13'));var hardwareService=require(_0x7b09('0x14'));var logger=require(_0x7b09('0x15'))(_0x7b09('0x16'));var utils=require(_0x7b09('0x17'));var config=require(_0x7b09('0x18'));var licenseUtil=require(_0x7b09('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ebb8f,_0x3391d4){_0x3391d4=_0x3391d4||0xcc;return function(_0x251ad1){if(_0x251ad1){return _0x2ebb8f[_0x7b09('0x1a')](_0x3391d4);}return _0x2ebb8f['status'](_0x3391d4)[_0x7b09('0x1b')]();};}function respondWithResult(_0x52c32b,_0x4f3ec7){_0x4f3ec7=_0x4f3ec7||0xc8;return function(_0x429ddf){if(_0x429ddf){return _0x52c32b[_0x7b09('0x1c')](_0x4f3ec7)[_0x7b09('0x1d')](_0x429ddf);}};}function respondWithFilteredResult(_0x13b632,_0x139480){return function(_0x5eed78){if(_0x5eed78){var _0x3d1157=typeof _0x139480[_0x7b09('0x1e')]===_0x7b09('0x1f')&&typeof _0x139480[_0x7b09('0x20')]===_0x7b09('0x1f');var _0x4637dc=_0x5eed78[_0x7b09('0x21')];var _0x1f73d7=_0x3d1157?0x0:_0x139480[_0x7b09('0x1e')];var _0x420702=_0x3d1157?_0x5eed78['count']:_0x139480['offset']+_0x139480['limit'];var _0xfa03e8;if(_0x420702>=_0x4637dc){_0x420702=_0x4637dc;_0xfa03e8=0xc8;}else{_0xfa03e8=0xce;}_0x13b632[_0x7b09('0x1c')](_0xfa03e8);return _0x13b632[_0x7b09('0x22')]('Content-Range',_0x1f73d7+'-'+_0x420702+'/'+_0x4637dc)['json'](_0x5eed78);}return null;};}function patchUpdates(_0x17b191){return function(_0x1d2d73){try{jsonpatch[_0x7b09('0x23')](_0x1d2d73,_0x17b191,!![]);}catch(_0x5197bd){return BPromise['reject'](_0x5197bd);}return _0x1d2d73[_0x7b09('0x24')]();};}function saveUpdates(_0x26caf7,_0x4af089){return function(_0x2e4175){if(_0x2e4175){return _0x2e4175[_0x7b09('0x25')](_0x26caf7)['then'](function(_0x15ee35){return _0x15ee35;});}return null;};}function removeEntity(_0x38f356,_0x2e58a8){return function(_0x1e08c3){if(_0x1e08c3){return _0x1e08c3[_0x7b09('0x26')]()[_0x7b09('0x27')](function(){var _0xe267ac=_0x1e08c3[_0x7b09('0x28')]({'plain':!![]});var _0x5b0f63=_0x7b09('0x29');return db['UserProfileResource'][_0x7b09('0x26')]({'where':{'type':_0x5b0f63,'resourceId':_0xe267ac['id']}})[_0x7b09('0x27')](function(){return _0x1e08c3;});})[_0x7b09('0x27')](function(){_0x38f356['status'](0xcc)[_0x7b09('0x1b')]();});}};}function handleEntityNotFound(_0x37f319,_0x36faa5){return function(_0x8a849e){if(!_0x8a849e){_0x37f319[_0x7b09('0x1a')](0x194);}return _0x8a849e;};}function handleError(_0x1297c4,_0x24867c){_0x24867c=_0x24867c||0x1f4;return function(_0x4535dd){logger['error'](_0x4535dd['stack']);if(_0x4535dd[_0x7b09('0x2a')]){delete _0x4535dd[_0x7b09('0x2a')];}_0x1297c4['status'](_0x24867c)[_0x7b09('0x2b')](_0x4535dd);};}exports[_0x7b09('0x2c')]=function(_0x5551d6,_0x442c11){var _0x206343={},_0xa3e5ec={},_0x47c016={'count':0x0,'rows':[]};var _0x546bf7=_[_0x7b09('0x2d')](db[_0x7b09('0x2e')]['rawAttributes'],function(_0x225494){return{'name':_0x225494[_0x7b09('0x2f')],'type':_0x225494['type'][_0x7b09('0x30')]};});_0xa3e5ec[_0x7b09('0x31')]=_['map'](_0x546bf7,_0x7b09('0x2a'));_0xa3e5ec[_0x7b09('0x32')]=_[_0x7b09('0x33')](_0x5551d6[_0x7b09('0x32')]);_0xa3e5ec['filters']=_['intersection'](_0xa3e5ec[_0x7b09('0x31')],_0xa3e5ec[_0x7b09('0x32')]);_0x206343[_0x7b09('0x34')]=_[_0x7b09('0x35')](_0xa3e5ec[_0x7b09('0x31')],qs[_0x7b09('0x36')](_0x5551d6[_0x7b09('0x32')]['fields']));_0x206343[_0x7b09('0x34')]=_0x206343['attributes'][_0x7b09('0x37')]?_0x206343[_0x7b09('0x34')]:_0xa3e5ec[_0x7b09('0x31')];if(!_0x5551d6[_0x7b09('0x32')][_0x7b09('0x38')]('nolimit')){_0x206343['limit']=qs[_0x7b09('0x20')](_0x5551d6['query']['limit']);_0x206343[_0x7b09('0x1e')]=qs[_0x7b09('0x1e')](_0x5551d6[_0x7b09('0x32')]['offset']);}_0x206343['order']=qs[_0x7b09('0x39')](_0x5551d6[_0x7b09('0x32')][_0x7b09('0x39')]);_0x206343[_0x7b09('0x3a')]=qs[_0x7b09('0x3b')](_[_0x7b09('0x3c')](_0x5551d6[_0x7b09('0x32')],_0xa3e5ec['filters']),_0x546bf7);if(_0x5551d6[_0x7b09('0x32')][_0x7b09('0x3d')]){_0x206343[_0x7b09('0x3a')]=_[_0x7b09('0x3e')](_0x206343[_0x7b09('0x3a')],{'$or':[{'key':{'$like':'%'+_0x5551d6[_0x7b09('0x32')][_0x7b09('0x3d')]+'%'}},{'value':{'$like':'%'+_0x5551d6['query']['filter']+'%'}}]});}_0x206343=_[_0x7b09('0x3e')]({},_0x206343,_0x5551d6[_0x7b09('0x3f')]);var _0x6fb9a8={'where':_0x206343[_0x7b09('0x3a')]};return db[_0x7b09('0x2e')][_0x7b09('0x21')](_0x6fb9a8)[_0x7b09('0x27')](function(_0x39906d){_0x47c016[_0x7b09('0x21')]=_0x39906d;if(_0x5551d6[_0x7b09('0x32')][_0x7b09('0x40')]){_0x206343[_0x7b09('0x41')]=[{'all':!![]}];}return db[_0x7b09('0x2e')][_0x7b09('0x42')](_0x206343);})['then'](function(_0xcdd95b){_0x47c016[_0x7b09('0x43')]=_0xcdd95b;return _0x47c016;})[_0x7b09('0x27')](respondWithFilteredResult(_0x442c11,_0x206343))[_0x7b09('0x44')](handleError(_0x442c11,null));};exports[_0x7b09('0x45')]=function(_0x47fcb0,_0x108914){var _0x2ff7b6={'raw':!![],'where':{'id':_0x47fcb0[_0x7b09('0x46')]['id']}},_0x4bf86b={};_0x4bf86b[_0x7b09('0x31')]=_[_0x7b09('0x33')](db[_0x7b09('0x2e')]['rawAttributes']);_0x4bf86b[_0x7b09('0x32')]=_['keys'](_0x47fcb0['query']);_0x4bf86b[_0x7b09('0x3b')]=_[_0x7b09('0x35')](_0x4bf86b[_0x7b09('0x31')],_0x4bf86b[_0x7b09('0x32')]);_0x2ff7b6[_0x7b09('0x34')]=_[_0x7b09('0x35')](_0x4bf86b[_0x7b09('0x31')],qs['fields'](_0x47fcb0[_0x7b09('0x32')][_0x7b09('0x36')]));_0x2ff7b6[_0x7b09('0x34')]=_0x2ff7b6[_0x7b09('0x34')][_0x7b09('0x37')]?_0x2ff7b6[_0x7b09('0x34')]:_0x4bf86b[_0x7b09('0x31')];if(_0x47fcb0['query'][_0x7b09('0x40')]){_0x2ff7b6['include']=[{'all':!![]}];}_0x2ff7b6=_[_0x7b09('0x3e')]({},_0x2ff7b6,_0x47fcb0[_0x7b09('0x3f')]);return db[_0x7b09('0x2e')]['find'](_0x2ff7b6)[_0x7b09('0x27')](handleEntityNotFound(_0x108914,null))[_0x7b09('0x27')](respondWithResult(_0x108914,null))[_0x7b09('0x44')](handleError(_0x108914,null));};exports[_0x7b09('0x25')]=function(_0x9b0c8a,_0x4f4a68){if(_0x9b0c8a[_0x7b09('0x47')]['id']){delete _0x9b0c8a[_0x7b09('0x47')]['id'];}return db[_0x7b09('0x2e')][_0x7b09('0x48')]({'where':{'id':_0x9b0c8a[_0x7b09('0x46')]['id']}})[_0x7b09('0x27')](handleEntityNotFound(_0x4f4a68,null))['then'](saveUpdates(_0x9b0c8a[_0x7b09('0x47')],null))['then'](respondWithResult(_0x4f4a68,null))[_0x7b09('0x44')](handleError(_0x4f4a68,null));};exports[_0x7b09('0x26')]=function(_0x4500fd,_0x367536){return db[_0x7b09('0x2e')][_0x7b09('0x48')]({'where':{'id':_0x4500fd['params']['id']}})[_0x7b09('0x27')](handleEntityNotFound(_0x367536,null))[_0x7b09('0x27')](removeEntity(_0x367536,null))[_0x7b09('0x44')](handleError(_0x367536,null));};exports[_0x7b09('0x49')]=function(_0x2bae25,_0x29bb3c){var _0x53cd23={'key':_0x2bae25[_0x7b09('0x47')][_0x7b09('0x30')]};if(_0x2bae25[_0x7b09('0x47')][_0x7b09('0x4a')]){_0x53cd23[_0x7b09('0x4a')]=_0x2bae25['body'][_0x7b09('0x4a')];}else if(_0x2bae25['body'][_0x7b09('0x4b')]){_0x53cd23[_0x7b09('0x4b')]=_0x2bae25[_0x7b09('0x47')][_0x7b09('0x4b')];}else if(_0x2bae25[_0x7b09('0x47')][_0x7b09('0x4c')]){_0x53cd23['OpenchannelAccountId']=_0x2bae25[_0x7b09('0x47')][_0x7b09('0x4c')];}else if(_0x2bae25[_0x7b09('0x47')][_0x7b09('0x4d')]){_0x53cd23['ChatWebsiteId']=_0x2bae25['body'][_0x7b09('0x4d')];}return db['CannedAnswer'][_0x7b09('0x48')]({'where':_0x53cd23})[_0x7b09('0x27')](function(_0x52c1d4){if(_0x52c1d4){throw new db[(_0x7b09('0x4e'))][(_0x7b09('0x4f'))](_0x7b09('0x50'));}return db[_0x7b09('0x2e')][_0x7b09('0x49')](_0x2bae25[_0x7b09('0x47')]);})['then'](function(_0x144d52){var _0x26d41b=_0x2bae25[_0x7b09('0x51')]['get']({'plain':!![]});if(!_0x26d41b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26d41b[_0x7b09('0x52')]===_0x7b09('0x51')){var _0x1466fb=_0x144d52[_0x7b09('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x7b09('0x48')]({'where':{'name':_0x7b09('0x29'),'userProfileId':_0x26d41b[_0x7b09('0x53')]},'raw':!![]})[_0x7b09('0x27')](function(_0x41d08f){if(_0x41d08f&&_0x41d08f[_0x7b09('0x54')]===0x0){return db[_0x7b09('0x55')]['create']({'name':_0x1466fb[_0x7b09('0x2a')],'resourceId':_0x1466fb['id'],'type':_0x41d08f[_0x7b09('0x2a')],'sectionId':_0x41d08f['id']},{})[_0x7b09('0x27')](function(){return _0x144d52;});}else{return _0x144d52;}})[_0x7b09('0x44')](function(_0xab3131){logger[_0x7b09('0x56')](_0x7b09('0x57'),_0xab3131);throw _0xab3131;});}return _0x144d52;})[_0x7b09('0x27')](respondWithResult(_0x29bb3c,0xc9))['catch'](handleError(_0x29bb3c,null));};
\ No newline at end of file
+var _0x72c9=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','findAll','catch','show','params','length','find','update','body','create','MailAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x72c9,0x102));var _0x972c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x72c9[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x972c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x972c('0x1'));var jsonpatch=require(_0x972c('0x2'));var rp=require(_0x972c('0x3'));var moment=require(_0x972c('0x4'));var BPromise=require(_0x972c('0x5'));var Mustache=require(_0x972c('0x6'));var util=require(_0x972c('0x7'));var path=require(_0x972c('0x8'));var sox=require(_0x972c('0x9'));var csv=require(_0x972c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x972c('0xb'));var _=require(_0x972c('0xc'));var squel=require(_0x972c('0xd'));var crypto=require(_0x972c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x972c('0xf'));var toCsv=require(_0x972c('0xa'));var querystring=require(_0x972c('0x10'));var Papa=require(_0x972c('0x11'));var Redis=require(_0x972c('0x12'));var authService=require(_0x972c('0x13'));var qs=require(_0x972c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x972c('0x15'));var logger=require(_0x972c('0x16'))('api');var utils=require(_0x972c('0x17'));var config=require(_0x972c('0x18'));var licenseUtil=require(_0x972c('0x19'));var db=require(_0x972c('0x1a'))['db'];function respondWithStatusCode(_0x3f885b,_0x18c2b4){_0x18c2b4=_0x18c2b4||0xcc;return function(_0x518a04){if(_0x518a04){return _0x3f885b['sendStatus'](_0x18c2b4);}return _0x3f885b[_0x972c('0x1b')](_0x18c2b4)[_0x972c('0x1c')]();};}function respondWithResult(_0x50e95c,_0x6c013c){_0x6c013c=_0x6c013c||0xc8;return function(_0x3497d5){if(_0x3497d5){return _0x50e95c['status'](_0x6c013c)[_0x972c('0x1d')](_0x3497d5);}};}function respondWithFilteredResult(_0x3d0261,_0x41901d){return function(_0x58c0a9){if(_0x58c0a9){var _0x2615b0=typeof _0x41901d['offset']==='undefined'&&typeof _0x41901d[_0x972c('0x1e')]===_0x972c('0x1f');var _0x244633=_0x58c0a9[_0x972c('0x20')];var _0x1bbd6a=_0x2615b0?0x0:_0x41901d[_0x972c('0x21')];var _0x44db61=_0x2615b0?_0x58c0a9[_0x972c('0x20')]:_0x41901d[_0x972c('0x21')]+_0x41901d[_0x972c('0x1e')];var _0x26218f;if(_0x44db61>=_0x244633){_0x44db61=_0x244633;_0x26218f=0xc8;}else{_0x26218f=0xce;}_0x3d0261['status'](_0x26218f);return _0x3d0261[_0x972c('0x22')](_0x972c('0x23'),_0x1bbd6a+'-'+_0x44db61+'/'+_0x244633)[_0x972c('0x1d')](_0x58c0a9);}return null;};}function patchUpdates(_0xaf42c7){return function(_0x397665){try{jsonpatch[_0x972c('0x24')](_0x397665,_0xaf42c7,!![]);}catch(_0x467b43){return BPromise['reject'](_0x467b43);}return _0x397665[_0x972c('0x25')]();};}function saveUpdates(_0x35f500,_0x2dbdfc){return function(_0x58a489){if(_0x58a489){return _0x58a489['update'](_0x35f500)[_0x972c('0x26')](function(_0x340da5){return _0x340da5;});}return null;};}function removeEntity(_0xc6638f,_0x4f77c9){return function(_0xcb2d66){if(_0xcb2d66){return _0xcb2d66[_0x972c('0x27')]()[_0x972c('0x26')](function(){var _0x42b40f=_0xcb2d66[_0x972c('0x28')]({'plain':!![]});var _0x592bbf=_0x972c('0x29');return db[_0x972c('0x2a')][_0x972c('0x27')]({'where':{'type':_0x592bbf,'resourceId':_0x42b40f['id']}})[_0x972c('0x26')](function(){return _0xcb2d66;});})['then'](function(){_0xc6638f[_0x972c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26a637,_0x524a04){return function(_0x56e6b8){if(!_0x56e6b8){_0x26a637[_0x972c('0x2b')](0x194);}return _0x56e6b8;};}function handleError(_0x3fbf20,_0x2ff142){_0x2ff142=_0x2ff142||0x1f4;return function(_0x5386f1){logger[_0x972c('0x2c')](_0x5386f1[_0x972c('0x2d')]);if(_0x5386f1['name']){delete _0x5386f1[_0x972c('0x2e')];}_0x3fbf20[_0x972c('0x1b')](_0x2ff142)['send'](_0x5386f1);};}exports[_0x972c('0x2f')]=function(_0x52f26f,_0x4e4d34){var _0x42e492={},_0x549c38={},_0x175dca={'count':0x0,'rows':[]};var _0x57052=_['map'](db[_0x972c('0x30')][_0x972c('0x31')],function(_0x693992){return{'name':_0x693992[_0x972c('0x32')],'type':_0x693992[_0x972c('0x33')][_0x972c('0x34')]};});_0x549c38[_0x972c('0x35')]=_[_0x972c('0x36')](_0x57052,_0x972c('0x2e'));_0x549c38['query']=_[_0x972c('0x37')](_0x52f26f[_0x972c('0x38')]);_0x549c38[_0x972c('0x39')]=_['intersection'](_0x549c38['model'],_0x549c38[_0x972c('0x38')]);_0x42e492[_0x972c('0x3a')]=_[_0x972c('0x3b')](_0x549c38['model'],qs[_0x972c('0x3c')](_0x52f26f[_0x972c('0x38')][_0x972c('0x3c')]));_0x42e492[_0x972c('0x3a')]=_0x42e492[_0x972c('0x3a')]['length']?_0x42e492['attributes']:_0x549c38['model'];if(!_0x52f26f[_0x972c('0x38')][_0x972c('0x3d')](_0x972c('0x3e'))){_0x42e492[_0x972c('0x1e')]=qs[_0x972c('0x1e')](_0x52f26f['query']['limit']);_0x42e492['offset']=qs[_0x972c('0x21')](_0x52f26f[_0x972c('0x38')]['offset']);}_0x42e492['order']=qs[_0x972c('0x3f')](_0x52f26f[_0x972c('0x38')]['sort']);_0x42e492['where']=qs[_0x972c('0x39')](_[_0x972c('0x40')](_0x52f26f[_0x972c('0x38')],_0x549c38[_0x972c('0x39')]),_0x57052);if(_0x52f26f[_0x972c('0x38')][_0x972c('0x41')]){_0x42e492[_0x972c('0x42')]=_[_0x972c('0x43')](_0x42e492[_0x972c('0x42')],{'$or':[{'key':{'$like':'%'+_0x52f26f['query'][_0x972c('0x41')]+'%'}},{'value':{'$like':'%'+_0x52f26f[_0x972c('0x38')][_0x972c('0x41')]+'%'}}]});}_0x42e492=_[_0x972c('0x43')]({},_0x42e492,_0x52f26f[_0x972c('0x44')]);var _0x3e7801={'where':_0x42e492[_0x972c('0x42')]};return db['CannedAnswer'][_0x972c('0x20')](_0x3e7801)[_0x972c('0x26')](function(_0x4ec44a){_0x175dca['count']=_0x4ec44a;if(_0x52f26f['query'][_0x972c('0x45')]){_0x42e492['include']=[{'all':!![]}];}return db[_0x972c('0x30')][_0x972c('0x46')](_0x42e492);})[_0x972c('0x26')](function(_0x454c2b){_0x175dca['rows']=_0x454c2b;return _0x175dca;})[_0x972c('0x26')](respondWithFilteredResult(_0x4e4d34,_0x42e492))[_0x972c('0x47')](handleError(_0x4e4d34,null));};exports[_0x972c('0x48')]=function(_0x532d49,_0x50a463){var _0x3be3e7={'raw':!![],'where':{'id':_0x532d49[_0x972c('0x49')]['id']}},_0x2bfe0d={};_0x2bfe0d[_0x972c('0x35')]=_[_0x972c('0x37')](db[_0x972c('0x30')][_0x972c('0x31')]);_0x2bfe0d[_0x972c('0x38')]=_['keys'](_0x532d49['query']);_0x2bfe0d[_0x972c('0x39')]=_[_0x972c('0x3b')](_0x2bfe0d[_0x972c('0x35')],_0x2bfe0d['query']);_0x3be3e7[_0x972c('0x3a')]=_[_0x972c('0x3b')](_0x2bfe0d[_0x972c('0x35')],qs[_0x972c('0x3c')](_0x532d49['query'][_0x972c('0x3c')]));_0x3be3e7[_0x972c('0x3a')]=_0x3be3e7[_0x972c('0x3a')][_0x972c('0x4a')]?_0x3be3e7[_0x972c('0x3a')]:_0x2bfe0d['model'];if(_0x532d49[_0x972c('0x38')]['includeAll']){_0x3be3e7['include']=[{'all':!![]}];}_0x3be3e7=_['merge']({},_0x3be3e7,_0x532d49[_0x972c('0x44')]);return db[_0x972c('0x30')][_0x972c('0x4b')](_0x3be3e7)[_0x972c('0x26')](handleEntityNotFound(_0x50a463,null))['then'](respondWithResult(_0x50a463,null))[_0x972c('0x47')](handleError(_0x50a463,null));};exports[_0x972c('0x4c')]=function(_0xb44496,_0x5862af){if(_0xb44496[_0x972c('0x4d')]['id']){delete _0xb44496[_0x972c('0x4d')]['id'];}return db[_0x972c('0x30')][_0x972c('0x4b')]({'where':{'id':_0xb44496['params']['id']}})[_0x972c('0x26')](handleEntityNotFound(_0x5862af,null))[_0x972c('0x26')](saveUpdates(_0xb44496[_0x972c('0x4d')],null))[_0x972c('0x26')](respondWithResult(_0x5862af,null))[_0x972c('0x47')](handleError(_0x5862af,null));};exports[_0x972c('0x27')]=function(_0x2df9d6,_0x63b7a1){return db['CannedAnswer'][_0x972c('0x4b')]({'where':{'id':_0x2df9d6[_0x972c('0x49')]['id']}})[_0x972c('0x26')](handleEntityNotFound(_0x63b7a1,null))[_0x972c('0x26')](removeEntity(_0x63b7a1,null))[_0x972c('0x47')](handleError(_0x63b7a1,null));};exports[_0x972c('0x4e')]=function(_0x1dc66a,_0x2b9f44){var _0x1f66a5={'key':_0x1dc66a[_0x972c('0x4d')]['key']};if(_0x1dc66a[_0x972c('0x4d')][_0x972c('0x4f')]){_0x1f66a5['MailAccountId']=_0x1dc66a[_0x972c('0x4d')]['MailAccountId'];}else if(_0x1dc66a[_0x972c('0x4d')]['SmsAccountId']){_0x1f66a5['SmsAccountId']=_0x1dc66a['body']['SmsAccountId'];}else if(_0x1dc66a['body']['OpenchannelAccountId']){_0x1f66a5[_0x972c('0x50')]=_0x1dc66a[_0x972c('0x4d')]['OpenchannelAccountId'];}else if(_0x1dc66a['body'][_0x972c('0x51')]){_0x1f66a5['ChatWebsiteId']=_0x1dc66a['body']['ChatWebsiteId'];}return db[_0x972c('0x30')][_0x972c('0x4b')]({'where':_0x1f66a5})[_0x972c('0x26')](function(_0x137095){if(_0x137095){throw new db[(_0x972c('0x52'))][(_0x972c('0x53'))](_0x972c('0x54'));}return db['CannedAnswer'][_0x972c('0x4e')](_0x1dc66a[_0x972c('0x4d')]);})['then'](function(_0x39496e){var _0x9b0e50=_0x1dc66a[_0x972c('0x55')][_0x972c('0x28')]({'plain':!![]});if(!_0x9b0e50)throw new Error(_0x972c('0x56'));if(_0x9b0e50['role']===_0x972c('0x55')){var _0x11e82a=_0x39496e[_0x972c('0x28')]({'plain':!![]});return db[_0x972c('0x57')]['find']({'where':{'name':_0x972c('0x29'),'userProfileId':_0x9b0e50[_0x972c('0x58')]},'raw':!![]})[_0x972c('0x26')](function(_0x4cd977){if(_0x4cd977&&_0x4cd977[_0x972c('0x59')]===0x0){return db['UserProfileResource'][_0x972c('0x4e')]({'name':_0x11e82a[_0x972c('0x2e')],'resourceId':_0x11e82a['id'],'type':_0x4cd977['name'],'sectionId':_0x4cd977['id']},{})['then'](function(){return _0x39496e;});}else{return _0x39496e;}})[_0x972c('0x47')](function(_0x566d77){logger[_0x972c('0x2c')](_0x972c('0x5a'),_0x566d77);throw _0x566d77;});}return _0x39496e;})[_0x972c('0x26')](respondWithResult(_0x2b9f44,0xc9))[_0x972c('0x47')](handleError(_0x2b9f44,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index f2a6140..74509f9 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 _0x59d0=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x5b6ba1,_0x49f578){var _0x417c60=function(_0x562ffb){while(--_0x562ffb){_0x5b6ba1['push'](_0x5b6ba1['shift']());}};_0x417c60(++_0x49f578);}(_0x59d0,0x129));var _0x059d=function(_0x1448d8,_0x51afba){_0x1448d8=_0x1448d8-0x0;var _0x108f1f=_0x59d0[_0x1448d8];return _0x108f1f;};'use strict';var _=require(_0x059d('0x0'));var util=require('util');var logger=require(_0x059d('0x1'))(_0x059d('0x2'));var moment=require('moment');var BPromise=require(_0x059d('0x3'));var rp=require(_0x059d('0x4'));var fs=require('fs');var path=require(_0x059d('0x5'));var rimraf=require(_0x059d('0x6'));var config=require(_0x059d('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x059d('0x8')]=function(_0x45943d,_0x364db8){return _0x45943d[_0x059d('0x9')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x059d('0xa'),'collate':_0x059d('0xb')});};
\ No newline at end of file
+var _0xaf4c=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x51d22a,_0x6cc2ee){_0x51d22a=_0x51d22a-0x0;var _0xc44c8a=_0xaf4c[_0x51d22a];return _0xc44c8a;};'use strict';var _=require('lodash');var util=require(_0xcaf4('0x0'));var logger=require(_0xcaf4('0x1'))('api');var moment=require(_0xcaf4('0x2'));var BPromise=require(_0xcaf4('0x3'));var rp=require(_0xcaf4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcaf4('0x5'));var config=require(_0xcaf4('0x6'));var attributes=require(_0xcaf4('0x7'));module['exports']=function(_0x21ad95,_0x548527){return _0x21ad95[_0xcaf4('0x8')](_0xcaf4('0x9'),attributes,{'tableName':_0xcaf4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcaf4('0xb'),'collate':_0xcaf4('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index b64c290..1cf81f1 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(_0x5bb0ed,_0x21ea31){var _0x541335=function(_0x29dce9){while(--_0x29dce9){_0x5bb0ed['push'](_0x5bb0ed['shift']());}};_0x541335(++_0x21ea31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_0x2a9e92,_0x12e91a){var _0x8f945b=function(_0x306595){while(--_0x306595){_0x2a9e92['push'](_0x2a9e92['shift']());}};_0x8f945b(++_0x12e91a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 6a913b8..28e7500 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 _0xb795=['./cannedAnswer.controller','get','index','isAuthenticated','show','put','/:id','update','destroy','multer','path','connect-timeout','express','fs-extra','../../config/environment'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xb795,0x180));var _0x5b79=function(_0x276c8d,_0x437fa6){_0x276c8d=_0x276c8d-0x0;var _0x51c99f=_0xb795[_0x276c8d];return _0x51c99f;};'use strict';var multer=require(_0x5b79('0x0'));var util=require('util');var path=require(_0x5b79('0x1'));var timeout=require(_0x5b79('0x2'));var express=require(_0x5b79('0x3'));var router=express['Router']();var fs_extra=require(_0x5b79('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5b79('0x5'));var controller=require(_0x5b79('0x6'));router[_0x5b79('0x7')]('/',auth['isAuthenticated'](),controller[_0x5b79('0x8')]);router['get']('/:id',auth[_0x5b79('0x9')](),controller[_0x5b79('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5b79('0xb')](_0x5b79('0xc'),auth[_0x5b79('0x9')](),controller[_0x5b79('0xd')]);router['delete'](_0x5b79('0xc'),auth[_0x5b79('0x9')](),controller[_0x5b79('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x1cf3=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x20b035,_0x33e530){var _0x26d5ec=function(_0x34fafa){while(--_0x34fafa){_0x20b035['push'](_0x20b035['shift']());}};_0x26d5ec(++_0x33e530);}(_0x1cf3,0x18c));var _0x31cf=function(_0x1cbc53,_0x50846c){_0x1cbc53=_0x1cbc53-0x0;var _0x4ec2c2=_0x1cf3[_0x1cbc53];return _0x4ec2c2;};'use strict';var multer=require(_0x31cf('0x0'));var util=require(_0x31cf('0x1'));var path=require(_0x31cf('0x2'));var timeout=require(_0x31cf('0x3'));var express=require(_0x31cf('0x4'));var router=express[_0x31cf('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x31cf('0x6'));var interaction=require(_0x31cf('0x7'));var config=require(_0x31cf('0x8'));var controller=require('./cannedAnswer.controller');router[_0x31cf('0x9')]('/',auth[_0x31cf('0xa')](),controller['index']);router[_0x31cf('0x9')](_0x31cf('0xb'),auth[_0x31cf('0xa')](),controller['show']);router['post']('/',auth[_0x31cf('0xa')](),controller[_0x31cf('0xc')]);router[_0x31cf('0xd')](_0x31cf('0xb'),auth[_0x31cf('0xa')](),controller[_0x31cf('0xe')]);router[_0x31cf('0xf')](_0x31cf('0xb'),auth[_0x31cf('0xa')](),controller[_0x31cf('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 7adc6be..65f6579 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 _0x1db3=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x58cc27,_0xc4c30b){var _0x40a3ec=function(_0xbb4c7c){while(--_0xbb4c7c){_0x58cc27['push'](_0x58cc27['shift']());}};_0x40a3ec(++_0xc4c30b);}(_0x1db3,0x1e5));var _0x31db=function(_0x163abc,_0x5ae42e){_0x163abc=_0x163abc-0x0;var _0x43ab13=_0x1db3[_0x163abc];return _0x43ab13;};'use strict';var Sequelize=require('sequelize');module[_0x31db('0x0')]={'calldate':{'type':Sequelize[_0x31db('0x1')],'allowNull':![],'defaultValue':_0x31db('0x2')},'clid':{'type':Sequelize[_0x31db('0x3')]},'src':{'type':Sequelize[_0x31db('0x3')]},'dst':{'type':Sequelize[_0x31db('0x3')]},'dcontext':{'type':Sequelize[_0x31db('0x3')]},'channel':{'type':Sequelize[_0x31db('0x3')]},'dstchannel':{'type':Sequelize[_0x31db('0x3')]},'lastapp':{'type':Sequelize[_0x31db('0x3')]},'lastdata':{'type':Sequelize[_0x31db('0x3')]},'duration':{'type':Sequelize[_0x31db('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x31db('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x31db('0x3')]},'amaflags':{'type':Sequelize[_0x31db('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x31db('0x3')]},'userfield':{'type':Sequelize[_0x31db('0x3')]},'uniqueid':{'type':Sequelize[_0x31db('0x3')]},'linkedid':{'type':Sequelize[_0x31db('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x31db('0x3')]},'type':{'type':Sequelize[_0x31db('0x3')]},'tag':{'type':Sequelize[_0x31db('0x3')]}};
\ No newline at end of file
+var _0x9d02=['sequelize','DATE','STRING','INTEGER'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x9d02,0x118));var _0x29d0=function(_0x4daacb,_0x156b7e){_0x4daacb=_0x4daacb-0x0;var _0xd4f99c=_0x9d02[_0x4daacb];return _0xd4f99c;};'use strict';var Sequelize=require(_0x29d0('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x29d0('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x29d0('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x29d0('0x2')]},'dcontext':{'type':Sequelize[_0x29d0('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x29d0('0x2')]},'lastapp':{'type':Sequelize[_0x29d0('0x2')]},'lastdata':{'type':Sequelize[_0x29d0('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x29d0('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x29d0('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x29d0('0x2')]},'linkedid':{'type':Sequelize[_0x29d0('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x29d0('0x2')]},'type':{'type':Sequelize[_0x29d0('0x2')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 2538496..1d555a7 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 _0x7bae=['hasOwnProperty','order','sort','where','filter','type','merge','options','includeAll','include','catch','show','params','keys','find','create','body','destroy','describe','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','index','map','Cdr','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x7bae,0x13b));var _0xe7ba=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x7bae[_0x3de8a4];return _0x4635cf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7ba('0x0'));var jsonpatch=require(_0xe7ba('0x1'));var rp=require('request-promise');var moment=require(_0xe7ba('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe7ba('0x3'));var util=require(_0xe7ba('0x4'));var path=require(_0xe7ba('0x5'));var sox=require(_0xe7ba('0x6'));var csv=require(_0xe7ba('0x7'));var ejs=require(_0xe7ba('0x8'));var fs=require('fs');var fs_extra=require(_0xe7ba('0x9'));var _=require(_0xe7ba('0xa'));var squel=require(_0xe7ba('0xb'));var crypto=require(_0xe7ba('0xc'));var jsforce=require(_0xe7ba('0xd'));var deskjs=require(_0xe7ba('0xe'));var toCsv=require(_0xe7ba('0x7'));var querystring=require(_0xe7ba('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7ba('0x10'));var authService=require(_0xe7ba('0x11'));var qs=require(_0xe7ba('0x12'));var as=require(_0xe7ba('0x13'));var hardwareService=require(_0xe7ba('0x14'));var logger=require(_0xe7ba('0x15'))(_0xe7ba('0x16'));var utils=require(_0xe7ba('0x17'));var config=require(_0xe7ba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7ba('0x19'))['db'];function respondWithStatusCode(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xcc;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0x1a')](_0x602b1);}return _0x588c8b[_0xe7ba('0x1b')](_0x602b1)[_0xe7ba('0x1c')]();};}function respondWithResult(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0xc8;return function(_0x561c48){if(_0x561c48){return _0x41369f[_0xe7ba('0x1b')](_0x561dbb)[_0xe7ba('0x1d')](_0x561c48);}};}function respondWithFilteredResult(_0x359f6f,_0x5d1d03){return function(_0x4390e3){if(_0x4390e3){var _0x4b20fd=typeof _0x5d1d03['offset']==='undefined'&&typeof _0x5d1d03[_0xe7ba('0x1e')]==='undefined';var _0x41a773=_0x4390e3['count'];var _0x4e3021=_0x4b20fd?0x0:_0x5d1d03['offset'];var _0x3f326a=_0x4b20fd?_0x4390e3[_0xe7ba('0x1f')]:_0x5d1d03[_0xe7ba('0x20')]+_0x5d1d03[_0xe7ba('0x1e')];var _0x1c8b5b;if(_0x3f326a>=_0x41a773){_0x3f326a=_0x41a773;_0x1c8b5b=0xc8;}else{_0x1c8b5b=0xce;}_0x359f6f['status'](_0x1c8b5b);return _0x359f6f[_0xe7ba('0x21')](_0xe7ba('0x22'),_0x4e3021+'-'+_0x3f326a+'/'+_0x41a773)[_0xe7ba('0x1d')](_0x4390e3);}return null;};}function patchUpdates(_0x136ec6){return function(_0x4aaf35){try{jsonpatch[_0xe7ba('0x23')](_0x4aaf35,_0x136ec6,!![]);}catch(_0x2936b7){return BPromise['reject'](_0x2936b7);}return _0x4aaf35[_0xe7ba('0x24')]();};}function saveUpdates(_0x4514e8,_0x27c882){return function(_0x7ab9e4){if(_0x7ab9e4){return _0x7ab9e4[_0xe7ba('0x25')](_0x4514e8)[_0xe7ba('0x26')](function(_0x293b14){return _0x293b14;});}return null;};}function removeEntity(_0x2b29f0,_0x41cbd9){return function(_0xa72f1c){if(_0xa72f1c){return _0xa72f1c['destroy']()['then'](function(){_0x2b29f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4363a8,_0x576513){return function(_0x4ecc0d){if(!_0x4ecc0d){_0x4363a8['sendStatus'](0x194);}return _0x4ecc0d;};}function handleError(_0x255def,_0x32cc00){_0x32cc00=_0x32cc00||0x1f4;return function(_0xe32862){logger[_0xe7ba('0x27')](_0xe32862[_0xe7ba('0x28')]);if(_0xe32862[_0xe7ba('0x29')]){delete _0xe32862[_0xe7ba('0x29')];}_0x255def[_0xe7ba('0x1b')](_0x32cc00)['send'](_0xe32862);};}exports[_0xe7ba('0x2a')]=function(_0x48c869,_0x102925){var _0x92fe7={},_0x369451={},_0x4bf5f9={'count':0x0,'rows':[]};var _0x587c7d=_[_0xe7ba('0x2b')](db[_0xe7ba('0x2c')][_0xe7ba('0x2d')],function(_0x20b6cd){return{'name':_0x20b6cd[_0xe7ba('0x2e')],'type':_0x20b6cd['type'][_0xe7ba('0x2f')]};});_0x369451[_0xe7ba('0x30')]=_['map'](_0x587c7d,_0xe7ba('0x29'));_0x369451['query']=_['keys'](_0x48c869[_0xe7ba('0x31')]);_0x369451[_0xe7ba('0x32')]=_[_0xe7ba('0x33')](_0x369451['model'],_0x369451[_0xe7ba('0x31')]);_0x92fe7['attributes']=_[_0xe7ba('0x33')](_0x369451[_0xe7ba('0x30')],qs[_0xe7ba('0x34')](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x34')]));_0x92fe7['attributes']=_0x92fe7[_0xe7ba('0x35')][_0xe7ba('0x36')]?_0x92fe7['attributes']:_0x369451[_0xe7ba('0x30')];if(!_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x37')]('nolimit')){_0x92fe7[_0xe7ba('0x1e')]=qs[_0xe7ba('0x1e')](_0x48c869['query'][_0xe7ba('0x1e')]);_0x92fe7[_0xe7ba('0x20')]=qs[_0xe7ba('0x20')](_0x48c869['query'][_0xe7ba('0x20')]);}_0x92fe7[_0xe7ba('0x38')]=qs['sort'](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x39')]);_0x92fe7[_0xe7ba('0x3a')]=qs['filters'](_['pick'](_0x48c869[_0xe7ba('0x31')],_0x369451[_0xe7ba('0x32')]),_0x587c7d);if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x3b')]){_0x92fe7[_0xe7ba('0x3a')]=_['merge'](_0x92fe7[_0xe7ba('0x3a')],{'$or':_[_0xe7ba('0x2b')](_0x587c7d,function(_0x3139a6){if(_0x3139a6[_0xe7ba('0x3c')]!=='VIRTUAL'){var _0xe67917={};_0xe67917[_0x3139a6[_0xe7ba('0x29')]]={'$like':'%'+_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x3b')]+'%'};return _0xe67917;}})});}_0x92fe7=_[_0xe7ba('0x3d')]({},_0x92fe7,_0x48c869[_0xe7ba('0x3e')]);var _0x124cc4={'where':_0x92fe7['where']};return db[_0xe7ba('0x2c')][_0xe7ba('0x1f')](_0x124cc4)[_0xe7ba('0x26')](function(_0x401b0a){_0x4bf5f9[_0xe7ba('0x1f')]=_0x401b0a;if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x3f')]){_0x92fe7[_0xe7ba('0x40')]=[{'all':!![]}];}return db[_0xe7ba('0x2c')]['findAll'](_0x92fe7);})[_0xe7ba('0x26')](function(_0x417734){_0x4bf5f9['rows']=_0x417734;return _0x4bf5f9;})['then'](respondWithFilteredResult(_0x102925,_0x92fe7))[_0xe7ba('0x41')](handleError(_0x102925,null));};exports[_0xe7ba('0x42')]=function(_0x368af2,_0x5589c4){var _0x249e1d={'raw':!![],'where':{'id':_0x368af2[_0xe7ba('0x43')]['id']}},_0x82246e={};_0x82246e[_0xe7ba('0x30')]=_[_0xe7ba('0x44')](db['Cdr'][_0xe7ba('0x2d')]);_0x82246e['query']=_[_0xe7ba('0x44')](_0x368af2[_0xe7ba('0x31')]);_0x82246e[_0xe7ba('0x32')]=_[_0xe7ba('0x33')](_0x82246e[_0xe7ba('0x30')],_0x82246e[_0xe7ba('0x31')]);_0x249e1d[_0xe7ba('0x35')]=_[_0xe7ba('0x33')](_0x82246e['model'],qs[_0xe7ba('0x34')](_0x368af2[_0xe7ba('0x31')][_0xe7ba('0x34')]));_0x249e1d[_0xe7ba('0x35')]=_0x249e1d[_0xe7ba('0x35')][_0xe7ba('0x36')]?_0x249e1d[_0xe7ba('0x35')]:_0x82246e[_0xe7ba('0x30')];if(_0x368af2[_0xe7ba('0x31')][_0xe7ba('0x3f')]){_0x249e1d['include']=[{'all':!![]}];}_0x249e1d=_[_0xe7ba('0x3d')]({},_0x249e1d,_0x368af2['options']);return db[_0xe7ba('0x2c')][_0xe7ba('0x45')](_0x249e1d)[_0xe7ba('0x26')](handleEntityNotFound(_0x5589c4,null))[_0xe7ba('0x26')](respondWithResult(_0x5589c4,null))[_0xe7ba('0x41')](handleError(_0x5589c4,null));};exports[_0xe7ba('0x46')]=function(_0x48ae57,_0x271592){return db[_0xe7ba('0x2c')][_0xe7ba('0x46')](_0x48ae57[_0xe7ba('0x47')],{})[_0xe7ba('0x26')](respondWithResult(_0x271592,0xc9))[_0xe7ba('0x41')](handleError(_0x271592,null));};exports[_0xe7ba('0x25')]=function(_0x266ace,_0x272cb9){if(_0x266ace[_0xe7ba('0x47')]['id']){delete _0x266ace[_0xe7ba('0x47')]['id'];}return db['Cdr'][_0xe7ba('0x45')]({'where':{'id':_0x266ace[_0xe7ba('0x43')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0x272cb9,null))[_0xe7ba('0x26')](saveUpdates(_0x266ace[_0xe7ba('0x47')],null))[_0xe7ba('0x26')](respondWithResult(_0x272cb9,null))['catch'](handleError(_0x272cb9,null));};exports[_0xe7ba('0x48')]=function(_0x3ee828,_0x520477){return db[_0xe7ba('0x2c')][_0xe7ba('0x45')]({'where':{'id':_0x3ee828[_0xe7ba('0x43')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0x520477,null))['then'](removeEntity(_0x520477,null))['catch'](handleError(_0x520477,null));};exports[_0xe7ba('0x49')]=function(_0x2cfdc3,_0x285743){return db['Cdr'][_0xe7ba('0x49')]()[_0xe7ba('0x26')](respondWithResult(_0x285743,null))[_0xe7ba('0x41')](handleError(_0x285743,null));};
\ No newline at end of file
+var _0x1db9=['merge','VIRTUAL','include','findAll','rows','show','keys','includeAll','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x217542,_0x15cc22){var _0x4bb071=function(_0x5f471b){while(--_0x5f471b){_0x217542['push'](_0x217542['shift']());}};_0x4bb071(++_0x15cc22);}(_0x1db9,0x176));var _0x91db=function(_0x188e16,_0x2c1952){_0x188e16=_0x188e16-0x0;var _0x3cdc6b=_0x1db9[_0x188e16];return _0x3cdc6b;};'use strict';var emlformat=require(_0x91db('0x0'));var rimraf=require(_0x91db('0x1'));var zipdir=require(_0x91db('0x2'));var jsonpatch=require(_0x91db('0x3'));var rp=require(_0x91db('0x4'));var moment=require(_0x91db('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x91db('0x6'));var util=require(_0x91db('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x91db('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x91db('0x9'));var squel=require(_0x91db('0xa'));var crypto=require(_0x91db('0xb'));var jsforce=require(_0x91db('0xc'));var deskjs=require(_0x91db('0xd'));var toCsv=require('to-csv');var querystring=require(_0x91db('0xe'));var Papa=require('papaparse');var Redis=require(_0x91db('0xf'));var authService=require(_0x91db('0x10'));var qs=require(_0x91db('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91db('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x91db('0x13'));var licenseUtil=require(_0x91db('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x540c48,_0x2b9b98){_0x2b9b98=_0x2b9b98||0xcc;return function(_0x329277){if(_0x329277){return _0x540c48[_0x91db('0x15')](_0x2b9b98);}return _0x540c48[_0x91db('0x16')](_0x2b9b98)[_0x91db('0x17')]();};}function respondWithResult(_0x4c3124,_0x371158){_0x371158=_0x371158||0xc8;return function(_0x285052){if(_0x285052){return _0x4c3124[_0x91db('0x16')](_0x371158)[_0x91db('0x18')](_0x285052);}};}function respondWithFilteredResult(_0x2df307,_0x33b39d){return function(_0x260b56){if(_0x260b56){var _0x143bc4=typeof _0x33b39d[_0x91db('0x19')]===_0x91db('0x1a')&&typeof _0x33b39d[_0x91db('0x1b')]===_0x91db('0x1a');var _0x5f5440=_0x260b56[_0x91db('0x1c')];var _0x23d125=_0x143bc4?0x0:_0x33b39d[_0x91db('0x19')];var _0x42e66c=_0x143bc4?_0x260b56[_0x91db('0x1c')]:_0x33b39d[_0x91db('0x19')]+_0x33b39d['limit'];var _0x4ae820;if(_0x42e66c>=_0x5f5440){_0x42e66c=_0x5f5440;_0x4ae820=0xc8;}else{_0x4ae820=0xce;}_0x2df307[_0x91db('0x16')](_0x4ae820);return _0x2df307[_0x91db('0x1d')](_0x91db('0x1e'),_0x23d125+'-'+_0x42e66c+'/'+_0x5f5440)[_0x91db('0x18')](_0x260b56);}return null;};}function patchUpdates(_0x50cf9c){return function(_0x168dea){try{jsonpatch[_0x91db('0x1f')](_0x168dea,_0x50cf9c,!![]);}catch(_0x6e3ca6){return BPromise[_0x91db('0x20')](_0x6e3ca6);}return _0x168dea[_0x91db('0x21')]();};}function saveUpdates(_0x31b96c,_0xaad1f6){return function(_0x8e323f){if(_0x8e323f){return _0x8e323f[_0x91db('0x22')](_0x31b96c)[_0x91db('0x23')](function(_0x554454){return _0x554454;});}return null;};}function removeEntity(_0x58774f,_0x134caa){return function(_0x2ac8d5){if(_0x2ac8d5){return _0x2ac8d5['destroy']()[_0x91db('0x23')](function(){_0x58774f[_0x91db('0x16')](0xcc)[_0x91db('0x17')]();});}};}function handleEntityNotFound(_0x6e3a9c,_0x3729d3){return function(_0x4e2a8f){if(!_0x4e2a8f){_0x6e3a9c['sendStatus'](0x194);}return _0x4e2a8f;};}function handleError(_0x42e53f,_0x2f0b86){_0x2f0b86=_0x2f0b86||0x1f4;return function(_0x329118){logger['error'](_0x329118[_0x91db('0x24')]);if(_0x329118[_0x91db('0x25')]){delete _0x329118[_0x91db('0x25')];}_0x42e53f[_0x91db('0x16')](_0x2f0b86)['send'](_0x329118);};}exports[_0x91db('0x26')]=function(_0x2a00d1,_0x1805ef){var _0x49c504={},_0x2ff6c8={},_0x69fdc2={'count':0x0,'rows':[]};var _0x2d3ebd=_[_0x91db('0x27')](db[_0x91db('0x28')][_0x91db('0x29')],function(_0x2e6a27){return{'name':_0x2e6a27[_0x91db('0x2a')],'type':_0x2e6a27[_0x91db('0x2b')][_0x91db('0x2c')]};});_0x2ff6c8[_0x91db('0x2d')]=_[_0x91db('0x27')](_0x2d3ebd,_0x91db('0x25'));_0x2ff6c8[_0x91db('0x2e')]=_['keys'](_0x2a00d1[_0x91db('0x2e')]);_0x2ff6c8[_0x91db('0x2f')]=_[_0x91db('0x30')](_0x2ff6c8[_0x91db('0x2d')],_0x2ff6c8[_0x91db('0x2e')]);_0x49c504['attributes']=_[_0x91db('0x30')](_0x2ff6c8[_0x91db('0x2d')],qs[_0x91db('0x31')](_0x2a00d1['query'][_0x91db('0x31')]));_0x49c504['attributes']=_0x49c504[_0x91db('0x32')][_0x91db('0x33')]?_0x49c504[_0x91db('0x32')]:_0x2ff6c8[_0x91db('0x2d')];if(!_0x2a00d1['query'][_0x91db('0x34')](_0x91db('0x35'))){_0x49c504[_0x91db('0x1b')]=qs['limit'](_0x2a00d1[_0x91db('0x2e')][_0x91db('0x1b')]);_0x49c504['offset']=qs[_0x91db('0x19')](_0x2a00d1[_0x91db('0x2e')]['offset']);}_0x49c504[_0x91db('0x36')]=qs['sort'](_0x2a00d1[_0x91db('0x2e')][_0x91db('0x37')]);_0x49c504['where']=qs['filters'](_['pick'](_0x2a00d1[_0x91db('0x2e')],_0x2ff6c8[_0x91db('0x2f')]),_0x2d3ebd);if(_0x2a00d1['query'][_0x91db('0x38')]){_0x49c504[_0x91db('0x39')]=_[_0x91db('0x3a')](_0x49c504[_0x91db('0x39')],{'$or':_[_0x91db('0x27')](_0x2d3ebd,function(_0x3cccc7){if(_0x3cccc7[_0x91db('0x2b')]!==_0x91db('0x3b')){var _0xcdc472={};_0xcdc472[_0x3cccc7[_0x91db('0x25')]]={'$like':'%'+_0x2a00d1[_0x91db('0x2e')]['filter']+'%'};return _0xcdc472;}})});}_0x49c504=_[_0x91db('0x3a')]({},_0x49c504,_0x2a00d1['options']);var _0x14de6d={'where':_0x49c504[_0x91db('0x39')]};return db['Cdr'][_0x91db('0x1c')](_0x14de6d)[_0x91db('0x23')](function(_0x16a7e9){_0x69fdc2[_0x91db('0x1c')]=_0x16a7e9;if(_0x2a00d1[_0x91db('0x2e')]['includeAll']){_0x49c504[_0x91db('0x3c')]=[{'all':!![]}];}return db[_0x91db('0x28')][_0x91db('0x3d')](_0x49c504);})['then'](function(_0x4733a4){_0x69fdc2[_0x91db('0x3e')]=_0x4733a4;return _0x69fdc2;})[_0x91db('0x23')](respondWithFilteredResult(_0x1805ef,_0x49c504))['catch'](handleError(_0x1805ef,null));};exports[_0x91db('0x3f')]=function(_0x2b7830,_0x29831c){var _0x3d73a7={'raw':!![],'where':{'id':_0x2b7830['params']['id']}},_0x3609e1={};_0x3609e1[_0x91db('0x2d')]=_['keys'](db[_0x91db('0x28')][_0x91db('0x29')]);_0x3609e1[_0x91db('0x2e')]=_[_0x91db('0x40')](_0x2b7830[_0x91db('0x2e')]);_0x3609e1[_0x91db('0x2f')]=_[_0x91db('0x30')](_0x3609e1[_0x91db('0x2d')],_0x3609e1[_0x91db('0x2e')]);_0x3d73a7[_0x91db('0x32')]=_[_0x91db('0x30')](_0x3609e1['model'],qs['fields'](_0x2b7830[_0x91db('0x2e')][_0x91db('0x31')]));_0x3d73a7[_0x91db('0x32')]=_0x3d73a7['attributes'][_0x91db('0x33')]?_0x3d73a7[_0x91db('0x32')]:_0x3609e1[_0x91db('0x2d')];if(_0x2b7830[_0x91db('0x2e')][_0x91db('0x41')]){_0x3d73a7['include']=[{'all':!![]}];}_0x3d73a7=_[_0x91db('0x3a')]({},_0x3d73a7,_0x2b7830['options']);return db[_0x91db('0x28')][_0x91db('0x42')](_0x3d73a7)[_0x91db('0x23')](handleEntityNotFound(_0x29831c,null))[_0x91db('0x23')](respondWithResult(_0x29831c,null))[_0x91db('0x43')](handleError(_0x29831c,null));};exports[_0x91db('0x44')]=function(_0x17f7b3,_0xd5a8fb){return db[_0x91db('0x28')]['create'](_0x17f7b3['body'],{})[_0x91db('0x23')](respondWithResult(_0xd5a8fb,0xc9))[_0x91db('0x43')](handleError(_0xd5a8fb,null));};exports[_0x91db('0x22')]=function(_0x410423,_0x27e224){if(_0x410423['body']['id']){delete _0x410423[_0x91db('0x45')]['id'];}return db[_0x91db('0x28')][_0x91db('0x42')]({'where':{'id':_0x410423[_0x91db('0x46')]['id']}})[_0x91db('0x23')](handleEntityNotFound(_0x27e224,null))['then'](saveUpdates(_0x410423[_0x91db('0x45')],null))[_0x91db('0x23')](respondWithResult(_0x27e224,null))[_0x91db('0x43')](handleError(_0x27e224,null));};exports[_0x91db('0x47')]=function(_0x50b269,_0x3d8dfb){return db['Cdr']['find']({'where':{'id':_0x50b269[_0x91db('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d8dfb,null))[_0x91db('0x23')](removeEntity(_0x3d8dfb,null))['catch'](handleError(_0x3d8dfb,null));};exports['describe']=function(_0x2c30ff,_0x371277){return db[_0x91db('0x28')]['describe']()[_0x91db('0x23')](respondWithResult(_0x371277,null))[_0x91db('0x43')](handleError(_0x371277,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 2c81da1..29debde 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0xd9154f,_0xc8881d){var _0x865cd8=function(_0x296469){while(--_0x296469){_0xd9154f['push'](_0xd9154f['shift']());}};_0x865cd8(++_0xc8881d);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x1f8d14,_0x36070d){var _0x2d8830=function(_0x42ce94){while(--_0x42ce94){_0x1f8d14['push'](_0x1f8d14['shift']());}};_0x2d8830(++_0x36070d);}(_0x7a54,0x106));var _0x47a5=function(_0x42ea60,_0x127d2f){_0x42ea60=_0x42ea60-0x0;var _0x1053d1=_0x7a54[_0x42ea60];return _0x1053d1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index cbf7b0e..5a8936e 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 _0x170b=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x54c33a,_0x17ad4e){var _0x2590fa=function(_0x8a1afb){while(--_0x8a1afb){_0x54c33a['push'](_0x54c33a['shift']());}};_0x2590fa(++_0x17ad4e);}(_0x170b,0x1e2));var _0xb170=function(_0x26ea61,_0x1b983c){_0x26ea61=_0x26ea61-0x0;var _0x1b89c4=_0x170b[_0x26ea61];return _0x1b89c4;};'use strict';var _=require(_0xb170('0x0'));var util=require(_0xb170('0x1'));var moment=require(_0xb170('0x2'));var BPromise=require(_0xb170('0x3'));var rs=require(_0xb170('0x4'));var fs=require('fs');var Redis=require(_0xb170('0x5'));var db=require(_0xb170('0x6'))['db'];var utils=require(_0xb170('0x7'));var logger=require(_0xb170('0x8'))(_0xb170('0x9'));var config=require(_0xb170('0xa'));var jayson=require(_0xb170('0xb'));var client=jayson[_0xb170('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f1f75,_0x2dc437,_0x1672fc){return new BPromise(function(_0x3e5362,_0x5a2573){return client['request'](_0x2f1f75,_0x1672fc)[_0xb170('0xd')](function(_0x196327){logger['info'](_0xb170('0xe'),_0x2dc437,_0xb170('0xf'));logger[_0xb170('0x10')](_0xb170('0x11'),_0x2dc437,_0xb170('0xf'),JSON[_0xb170('0x12')](_0x196327));if(_0x196327[_0xb170('0x13')]){if(_0x196327[_0xb170('0x13')][_0xb170('0x14')]===0x1f4){logger[_0xb170('0x13')](_0xb170('0xe'),_0x2dc437,_0x196327[_0xb170('0x13')][_0xb170('0x15')]);return _0x5a2573(_0x196327[_0xb170('0x13')]['message']);}logger['error'](_0xb170('0xe'),_0x2dc437,_0x196327[_0xb170('0x13')][_0xb170('0x15')]);return _0x3e5362(_0x196327['error'][_0xb170('0x15')]);}else{logger[_0xb170('0x16')](_0xb170('0xe'),_0x2dc437,_0xb170('0xf'));_0x3e5362(_0x196327[_0xb170('0x17')][_0xb170('0x15')]);}})[_0xb170('0x18')](function(_0x1041d4){logger[_0xb170('0x13')](_0xb170('0xe'),_0x2dc437,_0x1041d4);_0x5a2573(_0x1041d4);});});}
\ No newline at end of file
+var _0x08c6=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x22999d,_0xe112e8){var _0x22ccd4=function(_0x21426c){while(--_0x21426c){_0x22999d['push'](_0x22999d['shift']());}};_0x22ccd4(++_0xe112e8);}(_0x08c6,0x175));var _0x608c=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x08c6[_0x28aea5];return _0x6a55f9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x608c('0x0'));var BPromise=require(_0x608c('0x1'));var rs=require(_0x608c('0x2'));var fs=require('fs');var Redis=require(_0x608c('0x3'));var db=require(_0x608c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x608c('0x5'))(_0x608c('0x6'));var config=require(_0x608c('0x7'));var jayson=require(_0x608c('0x8'));var client=jayson[_0x608c('0x9')][_0x608c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7ad40a,_0x6a7ea7,_0x24fb05){return new BPromise(function(_0x1b94d8,_0x30be48){return client['request'](_0x7ad40a,_0x24fb05)[_0x608c('0xb')](function(_0x92fb2f){logger[_0x608c('0xc')](_0x608c('0xd'),_0x6a7ea7,_0x608c('0xe'));logger[_0x608c('0xf')](_0x608c('0x10'),_0x6a7ea7,'request\x20sent',JSON[_0x608c('0x11')](_0x92fb2f));if(_0x92fb2f[_0x608c('0x12')]){if(_0x92fb2f[_0x608c('0x12')]['code']===0x1f4){logger[_0x608c('0x12')]('Cdr,\x20%s,\x20%s',_0x6a7ea7,_0x92fb2f[_0x608c('0x12')][_0x608c('0x13')]);return _0x30be48(_0x92fb2f[_0x608c('0x12')][_0x608c('0x13')]);}logger[_0x608c('0x12')]('Cdr,\x20%s,\x20%s',_0x6a7ea7,_0x92fb2f['error'][_0x608c('0x13')]);return _0x1b94d8(_0x92fb2f['error'][_0x608c('0x13')]);}else{logger[_0x608c('0xc')]('Cdr,\x20%s,\x20%s',_0x6a7ea7,'request\x20sent');_0x1b94d8(_0x92fb2f['result'][_0x608c('0x13')]);}})[_0x608c('0x14')](function(_0x2cb744){logger[_0x608c('0x12')](_0x608c('0xd'),_0x6a7ea7,_0x2cb744);_0x30be48(_0x2cb744);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index dc30edb..aa2795b 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x4fde9a,_0x5d1eda){var _0x58f321=function(_0x278061){while(--_0x278061){_0x4fde9a['push'](_0x4fde9a['shift']());}};_0x58f321(++_0x5d1eda);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+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(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 0077574..21ce19a 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 _0xa7e0=['sequelize','STRING','noop'];(function(_0x27c8f3,_0x35f6e8){var _0x4b8d62=function(_0x2261ef){while(--_0x2261ef){_0x27c8f3['push'](_0x27c8f3['shift']());}};_0x4b8d62(++_0x35f6e8);}(_0xa7e0,0x1e0));var _0x0a7e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa7e0[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x0a7e('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0a7e('0x1')],'allowNull':![],'defaultValue':_0x0a7e('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0a7e('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x3c34=['exports','noop','TEXT','STRING','sequelize'];(function(_0x5d6935,_0x3e19e8){var _0x91d517=function(_0xc30ba9){while(--_0xc30ba9){_0x5d6935['push'](_0x5d6935['shift']());}};_0x91d517(++_0x3e19e8);}(_0x3c34,0x180));var _0x43c3=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x3c34[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x43c3('0x0'));module[_0x43c3('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x43c3('0x2')},'appdata':{'type':Sequelize[_0x43c3('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x43c3('0x4')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 56ca651..e28e209 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 _0x0d74=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','save','update','then','destroy','error','stack','name','show','params','model','ChatApplication','rawAttributes','query','keys','intersection','attributes','fields','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','squel','jsforce'];(function(_0x5bf79a,_0x2eaa1d){var _0x3ff10f=function(_0x48523){while(--_0x48523){_0x5bf79a['push'](_0x5bf79a['shift']());}};_0x3ff10f(++_0x2eaa1d);}(_0x0d74,0x146));var _0x40d7=function(_0x9f8eea,_0x4bcf8b){_0x9f8eea=_0x9f8eea-0x0;var _0x3b08b3=_0x0d74[_0x9f8eea];return _0x3b08b3;};'use strict';var emlformat=require(_0x40d7('0x0'));var rimraf=require(_0x40d7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x40d7('0x2'));var moment=require(_0x40d7('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x40d7('0x4'));var path=require(_0x40d7('0x5'));var sox=require(_0x40d7('0x6'));var csv=require(_0x40d7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x40d7('0x8'));var crypto=require('crypto');var jsforce=require(_0x40d7('0x9'));var deskjs=require(_0x40d7('0xa'));var toCsv=require('to-csv');var querystring=require(_0x40d7('0xb'));var Papa=require(_0x40d7('0xc'));var Redis=require(_0x40d7('0xd'));var authService=require(_0x40d7('0xe'));var qs=require(_0x40d7('0xf'));var as=require(_0x40d7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x40d7('0x11'))(_0x40d7('0x12'));var utils=require(_0x40d7('0x13'));var config=require(_0x40d7('0x14'));var licenseUtil=require(_0x40d7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43f1d8,_0xa08fd6){_0xa08fd6=_0xa08fd6||0xcc;return function(_0x3723a4){if(_0x3723a4){return _0x43f1d8[_0x40d7('0x16')](_0xa08fd6);}return _0x43f1d8['status'](_0xa08fd6)[_0x40d7('0x17')]();};}function respondWithResult(_0x4cb402,_0x14c12b){_0x14c12b=_0x14c12b||0xc8;return function(_0x2acc5b){if(_0x2acc5b){return _0x4cb402[_0x40d7('0x18')](_0x14c12b)[_0x40d7('0x19')](_0x2acc5b);}};}function respondWithFilteredResult(_0x1acc2f,_0x67d691){return function(_0x473fea){if(_0x473fea){var _0x55a7e0=typeof _0x67d691['offset']==='undefined'&&typeof _0x67d691[_0x40d7('0x1a')]===_0x40d7('0x1b');var _0x486d75=_0x473fea['count'];var _0x120964=_0x55a7e0?0x0:_0x67d691['offset'];var _0x4ed97e=_0x55a7e0?_0x473fea[_0x40d7('0x1c')]:_0x67d691[_0x40d7('0x1d')]+_0x67d691[_0x40d7('0x1a')];var _0x44fa91;if(_0x4ed97e>=_0x486d75){_0x4ed97e=_0x486d75;_0x44fa91=0xc8;}else{_0x44fa91=0xce;}_0x1acc2f[_0x40d7('0x18')](_0x44fa91);return _0x1acc2f[_0x40d7('0x1e')](_0x40d7('0x1f'),_0x120964+'-'+_0x4ed97e+'/'+_0x486d75)[_0x40d7('0x19')](_0x473fea);}return null;};}function patchUpdates(_0x5eb3c1){return function(_0x4c47cf){try{jsonpatch['apply'](_0x4c47cf,_0x5eb3c1,!![]);}catch(_0x34ea1d){return BPromise['reject'](_0x34ea1d);}return _0x4c47cf[_0x40d7('0x20')]();};}function saveUpdates(_0x145422,_0x985914){return function(_0x1a441a){if(_0x1a441a){return _0x1a441a[_0x40d7('0x21')](_0x145422)[_0x40d7('0x22')](function(_0xfec685){return _0xfec685;});}return null;};}function removeEntity(_0x3ccae9,_0x51180d){return function(_0x1cb3b2){if(_0x1cb3b2){return _0x1cb3b2[_0x40d7('0x23')]()['then'](function(){_0x3ccae9[_0x40d7('0x18')](0xcc)[_0x40d7('0x17')]();});}};}function handleEntityNotFound(_0x38276c,_0x29c62b){return function(_0x528ab5){if(!_0x528ab5){_0x38276c['sendStatus'](0x194);}return _0x528ab5;};}function handleError(_0x4889df,_0x4e7d84){_0x4e7d84=_0x4e7d84||0x1f4;return function(_0x539985){logger[_0x40d7('0x24')](_0x539985[_0x40d7('0x25')]);if(_0x539985[_0x40d7('0x26')]){delete _0x539985[_0x40d7('0x26')];}_0x4889df['status'](_0x4e7d84)['send'](_0x539985);};}exports[_0x40d7('0x27')]=function(_0x2b5f11,_0x4503cc){var _0x532ed5={'raw':!![],'where':{'id':_0x2b5f11[_0x40d7('0x28')]['id']}},_0x4fdf53={};_0x4fdf53[_0x40d7('0x29')]=_['keys'](db[_0x40d7('0x2a')][_0x40d7('0x2b')]);_0x4fdf53[_0x40d7('0x2c')]=_[_0x40d7('0x2d')](_0x2b5f11['query']);_0x4fdf53['filters']=_[_0x40d7('0x2e')](_0x4fdf53[_0x40d7('0x29')],_0x4fdf53[_0x40d7('0x2c')]);_0x532ed5[_0x40d7('0x2f')]=_[_0x40d7('0x2e')](_0x4fdf53[_0x40d7('0x29')],qs[_0x40d7('0x30')](_0x2b5f11['query'][_0x40d7('0x30')]));_0x532ed5[_0x40d7('0x2f')]=_0x532ed5[_0x40d7('0x2f')]['length']?_0x532ed5[_0x40d7('0x2f')]:_0x4fdf53[_0x40d7('0x29')];if(_0x2b5f11[_0x40d7('0x2c')][_0x40d7('0x31')]){_0x532ed5[_0x40d7('0x32')]=[{'all':!![]}];}_0x532ed5=_[_0x40d7('0x33')]({},_0x532ed5,_0x2b5f11[_0x40d7('0x34')]);return db['ChatApplication'][_0x40d7('0x35')](_0x532ed5)[_0x40d7('0x22')](handleEntityNotFound(_0x4503cc,null))[_0x40d7('0x22')](respondWithResult(_0x4503cc,null))[_0x40d7('0x36')](handleError(_0x4503cc,null));};exports[_0x40d7('0x21')]=function(_0x2d1ee6,_0x1e6f08){if(_0x2d1ee6[_0x40d7('0x37')]['id']){delete _0x2d1ee6['body']['id'];}return db['ChatApplication'][_0x40d7('0x35')]({'where':{'id':_0x2d1ee6[_0x40d7('0x28')]['id']}})['then'](handleEntityNotFound(_0x1e6f08,null))['then'](saveUpdates(_0x2d1ee6['body'],null))[_0x40d7('0x22')](respondWithResult(_0x1e6f08,null))['catch'](handleError(_0x1e6f08,null));};exports[_0x40d7('0x23')]=function(_0x56b17c,_0x798ba7){return db[_0x40d7('0x2a')][_0x40d7('0x35')]({'where':{'id':_0x56b17c[_0x40d7('0x28')]['id']}})[_0x40d7('0x22')](handleEntityNotFound(_0x798ba7,null))['then'](removeEntity(_0x798ba7,null))[_0x40d7('0x36')](handleError(_0x798ba7,null));};
\ No newline at end of file
+var _0xf151=['include','merge','options','catch','body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','show','params','model','ChatApplication','query','filters','intersection','attributes','fields','length','includeAll'];(function(_0x82140,_0x3a9d87){var _0x2b15a6=function(_0x2b565e){while(--_0x2b565e){_0x82140['push'](_0x82140['shift']());}};_0x2b15a6(++_0x3a9d87);}(_0xf151,0xab));var _0x1f15=function(_0x92409b,_0x55269e){_0x92409b=_0x92409b-0x0;var _0x591e10=_0xf151[_0x92409b];return _0x591e10;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1f15('0x0'));var jsonpatch=require(_0x1f15('0x1'));var rp=require(_0x1f15('0x2'));var moment=require(_0x1f15('0x3'));var BPromise=require(_0x1f15('0x4'));var Mustache=require(_0x1f15('0x5'));var util=require(_0x1f15('0x6'));var path=require(_0x1f15('0x7'));var sox=require('sox');var csv=require(_0x1f15('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1f15('0x9'));var crypto=require(_0x1f15('0xa'));var jsforce=require(_0x1f15('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1f15('0x8'));var querystring=require(_0x1f15('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1f15('0xd'));var qs=require(_0x1f15('0xe'));var as=require(_0x1f15('0xf'));var hardwareService=require(_0x1f15('0x10'));var logger=require('../../config/logger')(_0x1f15('0x11'));var utils=require(_0x1f15('0x12'));var config=require(_0x1f15('0x13'));var licenseUtil=require(_0x1f15('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5823c3,_0x340109){_0x340109=_0x340109||0xcc;return function(_0x94e8e4){if(_0x94e8e4){return _0x5823c3[_0x1f15('0x15')](_0x340109);}return _0x5823c3[_0x1f15('0x16')](_0x340109)[_0x1f15('0x17')]();};}function respondWithResult(_0x2ed0b8,_0x5a9f14){_0x5a9f14=_0x5a9f14||0xc8;return function(_0xfafc5c){if(_0xfafc5c){return _0x2ed0b8[_0x1f15('0x16')](_0x5a9f14)[_0x1f15('0x18')](_0xfafc5c);}};}function respondWithFilteredResult(_0x387c36,_0x48ef33){return function(_0x428133){if(_0x428133){var _0x5baa48=typeof _0x48ef33[_0x1f15('0x19')]===_0x1f15('0x1a')&&typeof _0x48ef33[_0x1f15('0x1b')]==='undefined';var _0x586a7d=_0x428133[_0x1f15('0x1c')];var _0xdf70ed=_0x5baa48?0x0:_0x48ef33[_0x1f15('0x19')];var _0x5529d7=_0x5baa48?_0x428133[_0x1f15('0x1c')]:_0x48ef33['offset']+_0x48ef33[_0x1f15('0x1b')];var _0x439ef1;if(_0x5529d7>=_0x586a7d){_0x5529d7=_0x586a7d;_0x439ef1=0xc8;}else{_0x439ef1=0xce;}_0x387c36['status'](_0x439ef1);return _0x387c36['set'](_0x1f15('0x1d'),_0xdf70ed+'-'+_0x5529d7+'/'+_0x586a7d)['json'](_0x428133);}return null;};}function patchUpdates(_0x4542a8){return function(_0x2916b5){try{jsonpatch[_0x1f15('0x1e')](_0x2916b5,_0x4542a8,!![]);}catch(_0x3b1416){return BPromise[_0x1f15('0x1f')](_0x3b1416);}return _0x2916b5[_0x1f15('0x20')]();};}function saveUpdates(_0x2bdd64,_0x588c78){return function(_0x4888c8){if(_0x4888c8){return _0x4888c8[_0x1f15('0x21')](_0x2bdd64)[_0x1f15('0x22')](function(_0x4fa0f4){return _0x4fa0f4;});}return null;};}function removeEntity(_0x57cb54,_0x303d93){return function(_0x49fe69){if(_0x49fe69){return _0x49fe69[_0x1f15('0x23')]()['then'](function(){_0x57cb54[_0x1f15('0x16')](0xcc)[_0x1f15('0x17')]();});}};}function handleEntityNotFound(_0x41559e,_0x46e8a7){return function(_0x262121){if(!_0x262121){_0x41559e[_0x1f15('0x15')](0x194);}return _0x262121;};}function handleError(_0x4305c0,_0x317bfc){_0x317bfc=_0x317bfc||0x1f4;return function(_0x42e5e3){logger['error'](_0x42e5e3[_0x1f15('0x24')]);if(_0x42e5e3['name']){delete _0x42e5e3[_0x1f15('0x25')];}_0x4305c0[_0x1f15('0x16')](_0x317bfc)['send'](_0x42e5e3);};}exports[_0x1f15('0x26')]=function(_0x610939,_0x1a5a14){var _0x4be862={'raw':!![],'where':{'id':_0x610939[_0x1f15('0x27')]['id']}},_0x38ce55={};_0x38ce55[_0x1f15('0x28')]=_['keys'](db[_0x1f15('0x29')]['rawAttributes']);_0x38ce55[_0x1f15('0x2a')]=_['keys'](_0x610939[_0x1f15('0x2a')]);_0x38ce55[_0x1f15('0x2b')]=_[_0x1f15('0x2c')](_0x38ce55[_0x1f15('0x28')],_0x38ce55[_0x1f15('0x2a')]);_0x4be862[_0x1f15('0x2d')]=_[_0x1f15('0x2c')](_0x38ce55[_0x1f15('0x28')],qs['fields'](_0x610939['query'][_0x1f15('0x2e')]));_0x4be862[_0x1f15('0x2d')]=_0x4be862[_0x1f15('0x2d')][_0x1f15('0x2f')]?_0x4be862[_0x1f15('0x2d')]:_0x38ce55[_0x1f15('0x28')];if(_0x610939['query'][_0x1f15('0x30')]){_0x4be862[_0x1f15('0x31')]=[{'all':!![]}];}_0x4be862=_[_0x1f15('0x32')]({},_0x4be862,_0x610939[_0x1f15('0x33')]);return db['ChatApplication']['find'](_0x4be862)['then'](handleEntityNotFound(_0x1a5a14,null))['then'](respondWithResult(_0x1a5a14,null))[_0x1f15('0x34')](handleError(_0x1a5a14,null));};exports[_0x1f15('0x21')]=function(_0x33ba93,_0x23c1d9){if(_0x33ba93['body']['id']){delete _0x33ba93[_0x1f15('0x35')]['id'];}return db['ChatApplication'][_0x1f15('0x36')]({'where':{'id':_0x33ba93[_0x1f15('0x27')]['id']}})[_0x1f15('0x22')](handleEntityNotFound(_0x23c1d9,null))[_0x1f15('0x22')](saveUpdates(_0x33ba93[_0x1f15('0x35')],null))[_0x1f15('0x22')](respondWithResult(_0x23c1d9,null))['catch'](handleError(_0x23c1d9,null));};exports[_0x1f15('0x23')]=function(_0x24ea8f,_0x5a61a7){return db[_0x1f15('0x29')][_0x1f15('0x36')]({'where':{'id':_0x24ea8f[_0x1f15('0x27')]['id']}})['then'](handleEntityNotFound(_0x5a61a7,null))[_0x1f15('0x22')](removeEntity(_0x5a61a7,null))[_0x1f15('0x34')](handleError(_0x5a61a7,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index f0ae709..80ebcd3 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 _0xf109=['../../config/logger','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf109,0xce));var _0x9f10=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xf109[_0x26f702];return _0x11417d;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9f10('0xc')});};
\ No newline at end of file
+var _0x3667=['request-promise','path','../../config/environment','./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x2856ac,_0xc869b1){var _0x5ac549=function(_0x207332){while(--_0x207332){_0x2856ac['push'](_0x2856ac['shift']());}};_0x5ac549(++_0xc869b1);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var logger=require(_0x7366('0x2'))(_0x7366('0x3'));var moment=require(_0x7366('0x4'));var BPromise=require('bluebird');var rp=require(_0x7366('0x5'));var fs=require('fs');var path=require(_0x7366('0x6'));var rimraf=require('rimraf');var config=require(_0x7366('0x7'));var attributes=require(_0x7366('0x8'));module[_0x7366('0x9')]=function(_0x1c0cf4,_0x101e3d){return _0x1c0cf4['define'](_0x7366('0xa'),attributes,{'tableName':_0x7366('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7366('0xc'),'collate':_0x7366('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index fe66dda..56e24cd 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 _0xd686=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','util'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0xd686,0x1cd));var _0x6d68=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0xd686[_0x31b5a5];return _0x364cc9;};'use strict';var _=require('lodash');var util=require(_0x6d68('0x0'));var moment=require(_0x6d68('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d68('0x2'));var db=require(_0x6d68('0x3'))['db'];var utils=require(_0x6d68('0x4'));var logger=require(_0x6d68('0x5'))(_0x6d68('0x6'));var config=require(_0x6d68('0x7'));var jayson=require(_0x6d68('0x8'));var client=jayson[_0x6d68('0x9')][_0x6d68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd86128,_0x2a453f,_0xb71e58){return new BPromise(function(_0x429455,_0x5ae778){return client[_0x6d68('0xb')](_0xd86128,_0xb71e58)[_0x6d68('0xc')](function(_0x5d4daf){logger[_0x6d68('0xd')](_0x6d68('0xe'),_0x2a453f,'request\x20sent');logger[_0x6d68('0xf')](_0x6d68('0x10'),_0x2a453f,'request\x20sent',JSON[_0x6d68('0x11')](_0x5d4daf));if(_0x5d4daf['error']){if(_0x5d4daf[_0x6d68('0x12')]['code']===0x1f4){logger[_0x6d68('0x12')](_0x6d68('0xe'),_0x2a453f,_0x5d4daf[_0x6d68('0x12')][_0x6d68('0x13')]);return _0x5ae778(_0x5d4daf[_0x6d68('0x12')][_0x6d68('0x13')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x2a453f,_0x5d4daf[_0x6d68('0x12')][_0x6d68('0x13')]);return _0x429455(_0x5d4daf[_0x6d68('0x12')][_0x6d68('0x13')]);}else{logger[_0x6d68('0xd')](_0x6d68('0xe'),_0x2a453f,_0x6d68('0x14'));_0x429455(_0x5d4daf[_0x6d68('0x15')][_0x6d68('0x13')]);}})['catch'](function(_0x32c3f0){logger[_0x6d68('0x12')](_0x6d68('0xe'),_0x2a453f,_0x32c3f0);_0x5ae778(_0x32c3f0);});});}
\ No newline at end of file
+var _0x2abc=['../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger'];(function(_0x3abd88,_0x523afc){var _0xb71ddd=function(_0x3ad5eb){while(--_0x3ad5eb){_0x3abd88['push'](_0x3abd88['shift']());}};_0xb71ddd(++_0x523afc);}(_0x2abc,0xec));var _0xc2ab=function(_0x5b021d,_0x20ca0c){_0x5b021d=_0x5b021d-0x0;var _0x450187=_0x2abc[_0x5b021d];return _0x450187;};'use strict';var _=require(_0xc2ab('0x0'));var util=require(_0xc2ab('0x1'));var moment=require(_0xc2ab('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc2ab('0x3'));var db=require(_0xc2ab('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc2ab('0x5'))('rpc');var config=require(_0xc2ab('0x6'));var jayson=require(_0xc2ab('0x7'));var client=jayson[_0xc2ab('0x8')][_0xc2ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32a37c,_0x420b75,_0x1aa359){return new BPromise(function(_0x36c2d4,_0x1884c6){return client[_0xc2ab('0xa')](_0x32a37c,_0x1aa359)[_0xc2ab('0xb')](function(_0xcdbfbb){logger[_0xc2ab('0xc')](_0xc2ab('0xd'),_0x420b75,'request\x20sent');logger['debug'](_0xc2ab('0xe'),_0x420b75,'request\x20sent',JSON[_0xc2ab('0xf')](_0xcdbfbb));if(_0xcdbfbb['error']){if(_0xcdbfbb[_0xc2ab('0x10')][_0xc2ab('0x11')]===0x1f4){logger[_0xc2ab('0x10')]('ChatApplication,\x20%s,\x20%s',_0x420b75,_0xcdbfbb[_0xc2ab('0x10')][_0xc2ab('0x12')]);return _0x1884c6(_0xcdbfbb[_0xc2ab('0x10')][_0xc2ab('0x12')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x420b75,_0xcdbfbb[_0xc2ab('0x10')][_0xc2ab('0x12')]);return _0x36c2d4(_0xcdbfbb[_0xc2ab('0x10')][_0xc2ab('0x12')]);}else{logger[_0xc2ab('0xc')](_0xc2ab('0xd'),_0x420b75,_0xc2ab('0x13'));_0x36c2d4(_0xcdbfbb[_0xc2ab('0x14')][_0xc2ab('0x12')]);}})[_0xc2ab('0x15')](function(_0x25c840){logger[_0xc2ab('0x10')](_0xc2ab('0xd'),_0x420b75,_0x25c840);_0x1884c6(_0x25c840);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index ef22fe8..90851b8 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 _0x8f5f=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','put'];(function(_0xe4fa3d,_0x405634){var _0x150d66=function(_0x439ae7){while(--_0x439ae7){_0xe4fa3d['push'](_0xe4fa3d['shift']());}};_0x150d66(++_0x405634);}(_0x8f5f,0xc5));var _0xf8f5=function(_0x46800d,_0x588500){_0x46800d=_0x46800d-0x0;var _0x3824cd=_0x8f5f[_0x46800d];return _0x3824cd;};'use strict';var multer=require(_0xf8f5('0x0'));var util=require(_0xf8f5('0x1'));var path=require(_0xf8f5('0x2'));var timeout=require(_0xf8f5('0x3'));var express=require(_0xf8f5('0x4'));var router=express[_0xf8f5('0x5')]();var fs_extra=require(_0xf8f5('0x6'));var auth=require(_0xf8f5('0x7'));var interaction=require(_0xf8f5('0x8'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xf8f5('0x9')](_0xf8f5('0xa'),auth[_0xf8f5('0xb')](),controller['show']);router[_0xf8f5('0xc')](_0xf8f5('0xa'),auth[_0xf8f5('0xb')](),controller['update']);router[_0xf8f5('0xd')](_0xf8f5('0xa'),auth[_0xf8f5('0xb')](),controller['destroy']);module[_0xf8f5('0xe')]=router;
\ No newline at end of file
+var _0x616c=['show','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4f2a68,_0x309542){var _0x474071=function(_0xb94b16){while(--_0xb94b16){_0x4f2a68['push'](_0x4f2a68['shift']());}};_0x474071(++_0x309542);}(_0x616c,0x1d0));var _0xc616=function(_0x13530c,_0x471a08){_0x13530c=_0x13530c-0x0;var _0x2b558d=_0x616c[_0x13530c];return _0x2b558d;};'use strict';var multer=require(_0xc616('0x0'));var util=require(_0xc616('0x1'));var path=require(_0xc616('0x2'));var timeout=require(_0xc616('0x3'));var express=require(_0xc616('0x4'));var router=express[_0xc616('0x5')]();var fs_extra=require(_0xc616('0x6'));var auth=require(_0xc616('0x7'));var interaction=require(_0xc616('0x8'));var config=require(_0xc616('0x9'));var controller=require('./chatApplication.controller');router[_0xc616('0xa')]('/:id',auth[_0xc616('0xb')](),controller[_0xc616('0xc')]);router[_0xc616('0xd')](_0xc616('0xe'),auth[_0xc616('0xb')](),controller[_0xc616('0xf')]);router['delete'](_0xc616('0xe'),auth[_0xc616('0xb')](),controller[_0xc616('0x10')]);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 e7a7934..7316e8c 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 _0xdbce=['STRING','BOOLEAN','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdbce,0x1f1));var _0xedbc=function(_0xdd2bbd,_0xaf1161){_0xdd2bbd=_0xdd2bbd-0x0;var _0x449fc8=_0xdbce[_0xdd2bbd];return _0x449fc8;};'use strict';var Sequelize=require(_0xedbc('0x0'));module['exports']={'name':{'type':Sequelize[_0xedbc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xedbc('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x0984=['exports','STRING','BOOLEAN','sequelize'];(function(_0x55d694,_0x2bfe21){var _0x102ca0=function(_0x40294f){while(--_0x40294f){_0x55d694['push'](_0x55d694['shift']());}};_0x102ca0(++_0x2bfe21);}(_0x0984,0xff));var _0x4098=function(_0x306ee6,_0x16febb){_0x306ee6=_0x306ee6-0x0;var _0x47ab12=_0x0984[_0x306ee6];return _0x47ab12;};'use strict';var Sequelize=require(_0x4098('0x0'));module[_0x4098('0x1')]={'name':{'type':Sequelize[_0x4098('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x4098('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index e13caa6..bfbd01e 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 _0x7363=['body','update','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','options','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','then','destroy','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ChatGroup','count','includeAll','include','findAll','catch','show','params','intersection','find','create'];(function(_0x34eb1d,_0x116a4d){var _0x53266b=function(_0x2c52aa){while(--_0x2c52aa){_0x34eb1d['push'](_0x34eb1d['shift']());}};_0x53266b(++_0x116a4d);}(_0x7363,0x131));var _0x3736=function(_0x3a8e15,_0x38e90d){_0x3a8e15=_0x3a8e15-0x0;var _0x4de790=_0x7363[_0x3a8e15];return _0x4de790;};'use strict';var emlformat=require(_0x3736('0x0'));var rimraf=require(_0x3736('0x1'));var zipdir=require(_0x3736('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3736('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3736('0x4'));var util=require(_0x3736('0x5'));var path=require(_0x3736('0x6'));var sox=require(_0x3736('0x7'));var csv=require(_0x3736('0x8'));var ejs=require(_0x3736('0x9'));var fs=require('fs');var fs_extra=require(_0x3736('0xa'));var _=require(_0x3736('0xb'));var squel=require(_0x3736('0xc'));var crypto=require(_0x3736('0xd'));var jsforce=require(_0x3736('0xe'));var deskjs=require(_0x3736('0xf'));var toCsv=require(_0x3736('0x8'));var querystring=require(_0x3736('0x10'));var Papa=require(_0x3736('0x11'));var Redis=require(_0x3736('0x12'));var authService=require(_0x3736('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3736('0x14'));var logger=require(_0x3736('0x15'))('api');var utils=require(_0x3736('0x16'));var config=require(_0x3736('0x17'));var licenseUtil=require(_0x3736('0x18'));var db=require(_0x3736('0x19'))['db'];config[_0x3736('0x1a')]=_['defaults'](config[_0x3736('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x3736('0x1b'))(new Redis(config[_0x3736('0x1a')]));require('./chatGroup.socket')[_0x3736('0x1c')](socket);function respondWithStatusCode(_0x7de163,_0x2c2b2b){_0x2c2b2b=_0x2c2b2b||0xcc;return function(_0x2982ef){if(_0x2982ef){return _0x7de163[_0x3736('0x1d')](_0x2c2b2b);}return _0x7de163[_0x3736('0x1e')](_0x2c2b2b)[_0x3736('0x1f')]();};}function respondWithResult(_0x59a0f3,_0x5b6dbf){_0x5b6dbf=_0x5b6dbf||0xc8;return function(_0x35f3c3){if(_0x35f3c3){return _0x59a0f3[_0x3736('0x1e')](_0x5b6dbf)[_0x3736('0x20')](_0x35f3c3);}};}function respondWithFilteredResult(_0x831bf6,_0x3c0403){return function(_0x41890b){if(_0x41890b){var _0x3fb742=typeof _0x3c0403[_0x3736('0x21')]===_0x3736('0x22')&&typeof _0x3c0403[_0x3736('0x23')]===_0x3736('0x22');var _0x3c6a48=_0x41890b['count'];var _0xadb50a=_0x3fb742?0x0:_0x3c0403[_0x3736('0x21')];var _0x3b80b0=_0x3fb742?_0x41890b['count']:_0x3c0403[_0x3736('0x21')]+_0x3c0403['limit'];var _0x48b690;if(_0x3b80b0>=_0x3c6a48){_0x3b80b0=_0x3c6a48;_0x48b690=0xc8;}else{_0x48b690=0xce;}_0x831bf6[_0x3736('0x1e')](_0x48b690);return _0x831bf6[_0x3736('0x24')](_0x3736('0x25'),_0xadb50a+'-'+_0x3b80b0+'/'+_0x3c6a48)[_0x3736('0x20')](_0x41890b);}return null;};}function patchUpdates(_0x19e1e6){return function(_0x8651e4){try{jsonpatch['apply'](_0x8651e4,_0x19e1e6,!![]);}catch(_0x79cb3a){return BPromise[_0x3736('0x26')](_0x79cb3a);}return _0x8651e4['save']();};}function saveUpdates(_0x765ac6,_0xe06804){return function(_0x17b09d){if(_0x17b09d){return _0x17b09d['update'](_0x765ac6)[_0x3736('0x27')](function(_0x541c6f){return _0x541c6f;});}return null;};}function removeEntity(_0x4a9fca,_0x280a6e){return function(_0x54675c){if(_0x54675c){return _0x54675c[_0x3736('0x28')]()[_0x3736('0x27')](function(){_0x4a9fca[_0x3736('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3620aa,_0x3ffea0){return function(_0x5a59cb){if(!_0x5a59cb){_0x3620aa[_0x3736('0x1d')](0x194);}return _0x5a59cb;};}function handleError(_0x3f7b52,_0x4a5be1){_0x4a5be1=_0x4a5be1||0x1f4;return function(_0x5bf4fb){logger['error'](_0x5bf4fb['stack']);if(_0x5bf4fb[_0x3736('0x29')]){delete _0x5bf4fb[_0x3736('0x29')];}_0x3f7b52[_0x3736('0x1e')](_0x4a5be1)[_0x3736('0x2a')](_0x5bf4fb);};}exports['index']=function(_0x3665e9,_0x995f3f){var _0x59c0c6={},_0x3fd5c0={},_0x7a0c7={'count':0x0,'rows':[]};var _0x4c8414=_['map'](db['ChatGroup'][_0x3736('0x2b')],function(_0x2ec704){return{'name':_0x2ec704[_0x3736('0x2c')],'type':_0x2ec704[_0x3736('0x2d')][_0x3736('0x2e')]};});_0x3fd5c0[_0x3736('0x2f')]=_[_0x3736('0x30')](_0x4c8414,'name');_0x3fd5c0['query']=_[_0x3736('0x31')](_0x3665e9[_0x3736('0x32')]);_0x3fd5c0[_0x3736('0x33')]=_['intersection'](_0x3fd5c0[_0x3736('0x2f')],_0x3fd5c0[_0x3736('0x32')]);_0x59c0c6[_0x3736('0x34')]=_['intersection'](_0x3fd5c0[_0x3736('0x2f')],qs[_0x3736('0x35')](_0x3665e9['query']['fields']));_0x59c0c6['attributes']=_0x59c0c6[_0x3736('0x34')][_0x3736('0x36')]?_0x59c0c6[_0x3736('0x34')]:_0x3fd5c0[_0x3736('0x2f')];if(!_0x3665e9[_0x3736('0x32')][_0x3736('0x37')](_0x3736('0x38'))){_0x59c0c6[_0x3736('0x23')]=qs['limit'](_0x3665e9['query'][_0x3736('0x23')]);_0x59c0c6[_0x3736('0x21')]=qs['offset'](_0x3665e9['query']['offset']);}_0x59c0c6[_0x3736('0x39')]=qs['sort'](_0x3665e9[_0x3736('0x32')][_0x3736('0x3a')]);_0x59c0c6[_0x3736('0x3b')]=qs[_0x3736('0x33')](_[_0x3736('0x3c')](_0x3665e9[_0x3736('0x32')],_0x3fd5c0[_0x3736('0x33')]),_0x4c8414);if(_0x3665e9['query'][_0x3736('0x3d')]){_0x59c0c6['where']=_[_0x3736('0x3e')](_0x59c0c6[_0x3736('0x3b')],{'$or':_[_0x3736('0x30')](_0x4c8414,function(_0x4db312){if(_0x4db312[_0x3736('0x2d')]!==_0x3736('0x3f')){var _0x6194da={};_0x6194da[_0x4db312[_0x3736('0x29')]]={'$like':'%'+_0x3665e9[_0x3736('0x32')][_0x3736('0x3d')]+'%'};return _0x6194da;}})});}_0x59c0c6=_[_0x3736('0x3e')]({},_0x59c0c6,_0x3665e9['options']);var _0x4c1053={'where':_0x59c0c6[_0x3736('0x3b')]};return db[_0x3736('0x40')]['count'](_0x4c1053)[_0x3736('0x27')](function(_0x22d192){_0x7a0c7[_0x3736('0x41')]=_0x22d192;if(_0x3665e9['query'][_0x3736('0x42')]){_0x59c0c6[_0x3736('0x43')]=[{'all':!![]}];}return db[_0x3736('0x40')][_0x3736('0x44')](_0x59c0c6);})[_0x3736('0x27')](function(_0x39fff7){_0x7a0c7['rows']=_0x39fff7;return _0x7a0c7;})[_0x3736('0x27')](respondWithFilteredResult(_0x995f3f,_0x59c0c6))[_0x3736('0x45')](handleError(_0x995f3f,null));};exports[_0x3736('0x46')]=function(_0x24bc77,_0x33dec4){var _0x4d031b={'raw':!![],'where':{'id':_0x24bc77[_0x3736('0x47')]['id']}},_0x206f00={};_0x206f00[_0x3736('0x2f')]=_[_0x3736('0x31')](db[_0x3736('0x40')][_0x3736('0x2b')]);_0x206f00[_0x3736('0x32')]=_[_0x3736('0x31')](_0x24bc77['query']);_0x206f00['filters']=_[_0x3736('0x48')](_0x206f00[_0x3736('0x2f')],_0x206f00['query']);_0x4d031b['attributes']=_[_0x3736('0x48')](_0x206f00[_0x3736('0x2f')],qs[_0x3736('0x35')](_0x24bc77['query'][_0x3736('0x35')]));_0x4d031b[_0x3736('0x34')]=_0x4d031b[_0x3736('0x34')][_0x3736('0x36')]?_0x4d031b[_0x3736('0x34')]:_0x206f00[_0x3736('0x2f')];if(_0x24bc77['query'][_0x3736('0x42')]){_0x4d031b[_0x3736('0x43')]=[{'all':!![]}];}_0x4d031b=_['merge']({},_0x4d031b,_0x24bc77['options']);return db[_0x3736('0x40')][_0x3736('0x49')](_0x4d031b)[_0x3736('0x27')](handleEntityNotFound(_0x33dec4,null))[_0x3736('0x27')](respondWithResult(_0x33dec4,null))[_0x3736('0x45')](handleError(_0x33dec4,null));};exports[_0x3736('0x4a')]=function(_0x4e68d2,_0x349239){return db[_0x3736('0x40')][_0x3736('0x4a')](_0x4e68d2[_0x3736('0x4b')],{})['then'](respondWithResult(_0x349239,0xc9))['catch'](handleError(_0x349239,null));};exports[_0x3736('0x4c')]=function(_0x53fc39,_0x85ee83){if(_0x53fc39[_0x3736('0x4b')]['id']){delete _0x53fc39[_0x3736('0x4b')]['id'];}return db[_0x3736('0x40')][_0x3736('0x49')]({'where':{'id':_0x53fc39[_0x3736('0x47')]['id']}})[_0x3736('0x27')](handleEntityNotFound(_0x85ee83,null))[_0x3736('0x27')](saveUpdates(_0x53fc39[_0x3736('0x4b')],null))[_0x3736('0x27')](respondWithResult(_0x85ee83,null))['catch'](handleError(_0x85ee83,null));};exports['destroy']=function(_0xb66f9d,_0x257053){return db['ChatGroup'][_0x3736('0x49')]({'where':{'id':_0xb66f9d['params']['id']}})[_0x3736('0x27')](handleEntityNotFound(_0x257053,null))[_0x3736('0x27')](removeEntity(_0x257053,null))[_0x3736('0x45')](handleError(_0x257053,null));};exports['describe']=function(_0x2f41cb,_0x4dd9e6){return db[_0x3736('0x40')]['describe']()[_0x3736('0x27')](respondWithResult(_0x4dd9e6,null))[_0x3736('0x45')](handleError(_0x4dd9e6,null));};exports[_0x3736('0x4d')]=function(_0x2d4640,_0x31f83f,_0x46cb38){return db[_0x3736('0x4e')][_0x3736('0x41')]({'where':{'ChatGroupId':_0x2d4640[_0x3736('0x47')]['id'],'ToId':_0x2d4640[_0x3736('0x4f')]['id'],'read':![]}})['then'](function(_0x54dcca){return{'id':_[_0x3736('0x50')](_0x2d4640[_0x3736('0x47')]['id']),'count':_0x54dcca};})[_0x3736('0x27')](respondWithResult(_0x31f83f,null))[_0x3736('0x45')](handleError(_0x31f83f,null));};exports[_0x3736('0x51')]=function(_0x2932a3,_0x5a31f7,_0xeeda29){return db[_0x3736('0x40')]['find']({'where':{'id':_0x2932a3[_0x3736('0x47')]['id']}})[_0x3736('0x27')](handleEntityNotFound(_0x5a31f7,null))['then'](function(_0x5de494){if(_0x5de494){return _0x5de494[_0x3736('0x51')](_0x2932a3['body'][_0x3736('0x52')],_[_0x3736('0x53')](_0x2932a3[_0x3736('0x4b')],[_0x3736('0x52'),'id'])||{});}})['then'](respondWithResult(_0x5a31f7,null))[_0x3736('0x45')](handleError(_0x5a31f7,null));};exports[_0x3736('0x54')]=function(_0x4207bb,_0x13de7c,_0x2fe073){var _0x580276={};var _0x45623b={};var _0x3919f6;var _0x55e72f;return db[_0x3736('0x40')][_0x3736('0x55')]({'where':{'id':_0x4207bb[_0x3736('0x47')]['id']}})[_0x3736('0x27')](handleEntityNotFound(_0x13de7c,null))[_0x3736('0x27')](function(_0x48b31a){if(_0x48b31a){_0x3919f6=_0x48b31a;_0x45623b[_0x3736('0x2f')]=_['keys'](db[_0x3736('0x56')]['rawAttributes']);_0x45623b['query']=_['keys'](_0x4207bb['query']);_0x45623b[_0x3736('0x33')]=_['intersection'](_0x45623b['model'],_0x45623b[_0x3736('0x32')]);_0x580276[_0x3736('0x34')]=_[_0x3736('0x48')](_0x45623b[_0x3736('0x2f')],qs['fields'](_0x4207bb[_0x3736('0x32')][_0x3736('0x35')]));_0x580276[_0x3736('0x34')]=_0x580276[_0x3736('0x34')][_0x3736('0x36')]?_0x580276['attributes']:_0x45623b[_0x3736('0x2f')];_0x580276[_0x3736('0x39')]=qs[_0x3736('0x3a')](_0x4207bb[_0x3736('0x32')][_0x3736('0x3a')]);_0x580276['where']=qs[_0x3736('0x33')](_[_0x3736('0x3c')](_0x4207bb[_0x3736('0x32')],_0x45623b[_0x3736('0x33')]));if(_0x4207bb[_0x3736('0x32')]['filter']){_0x580276[_0x3736('0x3b')]=_['merge'](_0x580276[_0x3736('0x3b')],{'$or':_[_0x3736('0x30')](_0x580276[_0x3736('0x34')],function(_0x68afad){var _0xa00949={};_0xa00949[_0x68afad]={'$like':'%'+_0x4207bb[_0x3736('0x32')]['filter']+'%'};return _0xa00949;})});}_0x580276=_[_0x3736('0x3e')]({},_0x580276,_0x4207bb[_0x3736('0x57')]);return _0x3919f6['getMembers'](_0x580276);}})[_0x3736('0x27')](function(_0x35a7f8){if(_0x35a7f8){_0x55e72f=_0x35a7f8[_0x3736('0x36')];if(!_0x4207bb[_0x3736('0x32')]['hasOwnProperty'](_0x3736('0x38'))){_0x580276[_0x3736('0x23')]=qs['limit'](_0x4207bb['query']['limit']);_0x580276[_0x3736('0x21')]=qs[_0x3736('0x21')](_0x4207bb[_0x3736('0x32')][_0x3736('0x21')]);}return _0x3919f6[_0x3736('0x54')](_0x580276);}})[_0x3736('0x27')](function(_0x57b3e7){if(_0x57b3e7){return _0x57b3e7?{'count':_0x55e72f,'rows':_0x57b3e7}:null;}})[_0x3736('0x27')](respondWithResult(_0x13de7c,null))[_0x3736('0x45')](handleError(_0x13de7c,null));};exports[_0x3736('0x58')]=function(_0x33653e,_0x9d8386,_0x3bd747){return db[_0x3736('0x40')][_0x3736('0x49')]({'where':{'id':_0x33653e[_0x3736('0x47')]['id']}})['then'](handleEntityNotFound(_0x9d8386,null))['then'](function(_0x5dc4ae){if(_0x5dc4ae){return _0x5dc4ae[_0x3736('0x58')](_0x33653e['query'][_0x3736('0x52')]);}})[_0x3736('0x27')](respondWithStatusCode(_0x9d8386,null))['catch'](handleError(_0x9d8386,null));};exports[_0x3736('0x59')]=function(_0x520bf9,_0x9d494d,_0x5d3aee){if(_0x520bf9[_0x3736('0x4b')]['id']){delete _0x520bf9['body']['id'];}return db[_0x3736('0x40')][_0x3736('0x49')]({'where':{'id':_0x520bf9[_0x3736('0x47')]['id']}})[_0x3736('0x27')](handleEntityNotFound(_0x9d494d,null))[_0x3736('0x27')](function(_0x1f19de){if(_0x1f19de){_0x520bf9[_0x3736('0x4b')][_0x3736('0x5a')]=_0x1f19de['id'];return db[_0x3736('0x4e')][_0x3736('0x4a')](_0x520bf9['body']);}})['then'](respondWithResult(_0x9d494d,null))['catch'](handleError(_0x9d494d,null));};exports['getMessages']=function(_0xe4d0bf,_0x537243,_0xb4dec){var _0xd1efdb={};var _0x3f833={};var _0x1cca39;var _0x2539a1;return db[_0x3736('0x40')][_0x3736('0x55')]({'where':{'id':_0xe4d0bf[_0x3736('0x47')]['id']}})['then'](handleEntityNotFound(_0x537243,null))[_0x3736('0x27')](function(_0x434815){if(_0x434815){_0x1cca39=_0x434815;_0x3f833[_0x3736('0x2f')]=_[_0x3736('0x31')](db[_0x3736('0x4e')]['rawAttributes']);_0x3f833[_0x3736('0x32')]=_[_0x3736('0x31')](_0xe4d0bf['query']);_0x3f833['filters']=_[_0x3736('0x48')](_0x3f833[_0x3736('0x2f')],_0x3f833['query']);_0xd1efdb['attributes']=_[_0x3736('0x48')](_0x3f833['model'],qs['fields'](_0xe4d0bf[_0x3736('0x32')][_0x3736('0x35')]));_0xd1efdb[_0x3736('0x34')]=_0xd1efdb['attributes'][_0x3736('0x36')]?_0xd1efdb[_0x3736('0x34')]:_0x3f833[_0x3736('0x2f')];_0xd1efdb[_0x3736('0x39')]=qs['sort'](_0xe4d0bf[_0x3736('0x32')]['sort']);_0xd1efdb[_0x3736('0x3b')]=qs[_0x3736('0x33')](_[_0x3736('0x3c')](_0xe4d0bf['query'],_0x3f833[_0x3736('0x33')]));if(_0xe4d0bf['query'][_0x3736('0x3d')]){_0xd1efdb[_0x3736('0x3b')]=_['merge'](_0xd1efdb[_0x3736('0x3b')],{'$or':_['map'](_0xd1efdb[_0x3736('0x34')],function(_0x9faa0b){var _0x1e730f={};_0x1e730f[_0x9faa0b]={'$like':'%'+_0xe4d0bf['query']['filter']+'%'};return _0x1e730f;})});}if(_0xe4d0bf[_0x3736('0x32')]['$gte']){var _0x3d6b77=_0xe4d0bf[_0x3736('0x32')][_0x3736('0x5b')][_0x3736('0x5c')](',');var _0x4bde31={};_0x4bde31[_0x3d6b77[0x0]]={'$gte':moment(_0x3d6b77[0x1])[_0x3736('0x5d')](_0x3736('0x5e'))};_0xd1efdb[_0x3736('0x3b')]=_[_0x3736('0x3e')](_0xd1efdb[_0x3736('0x3b')],_0x4bde31);}_0xd1efdb=_[_0x3736('0x3e')]({},_0xd1efdb,_0xe4d0bf[_0x3736('0x57')]);return _0x1cca39['getMessages'](_0xd1efdb);}})[_0x3736('0x27')](function(_0x1b2269){if(_0x1b2269){_0x2539a1=_0x1b2269[_0x3736('0x36')];if(!_0xe4d0bf[_0x3736('0x32')][_0x3736('0x37')](_0x3736('0x38'))){_0xd1efdb['limit']=qs[_0x3736('0x23')](_0xe4d0bf['query'][_0x3736('0x23')]);_0xd1efdb[_0x3736('0x21')]=qs[_0x3736('0x21')](_0xe4d0bf[_0x3736('0x32')]['offset']);}return _0x1cca39['getMessages'](_0xd1efdb);}})['then'](function(_0x4f6934){if(_0x4f6934){return _0x4f6934?{'count':_0x2539a1,'rows':_0x4f6934}:null;}})[_0x3736('0x27')](respondWithResult(_0x537243,null))[_0x3736('0x45')](handleError(_0x537243,null));};
\ No newline at end of file
+var _0x5d78=['fields','attributes','hasOwnProperty','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','create','update','body','find','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','order','pick','nolimit','addMessage','getMessages','length','$gte','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','ChatGroup','rawAttributes','type','key','model','map','query','filters','intersection'];(function(_0x501bc7,_0x4b1ca0){var _0x5cbdd0=function(_0x2cb6d3){while(--_0x2cb6d3){_0x501bc7['push'](_0x501bc7['shift']());}};_0x5cbdd0(++_0x4b1ca0);}(_0x5d78,0x88));var _0x85d7=function(_0x5ecfe3,_0x264af5){_0x5ecfe3=_0x5ecfe3-0x0;var _0x407f52=_0x5d78[_0x5ecfe3];return _0x407f52;};'use strict';var emlformat=require(_0x85d7('0x0'));var rimraf=require(_0x85d7('0x1'));var zipdir=require(_0x85d7('0x2'));var jsonpatch=require(_0x85d7('0x3'));var rp=require(_0x85d7('0x4'));var moment=require(_0x85d7('0x5'));var BPromise=require(_0x85d7('0x6'));var Mustache=require(_0x85d7('0x7'));var util=require(_0x85d7('0x8'));var path=require(_0x85d7('0x9'));var sox=require(_0x85d7('0xa'));var csv=require(_0x85d7('0xb'));var ejs=require(_0x85d7('0xc'));var fs=require('fs');var fs_extra=require(_0x85d7('0xd'));var _=require(_0x85d7('0xe'));var squel=require(_0x85d7('0xf'));var crypto=require(_0x85d7('0x10'));var jsforce=require(_0x85d7('0x11'));var deskjs=require(_0x85d7('0x12'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x85d7('0x13'));var Redis=require(_0x85d7('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x85d7('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85d7('0x16'))(_0x85d7('0x17'));var utils=require(_0x85d7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x85d7('0x19'));var db=require('../../mysqldb')['db'];config[_0x85d7('0x1a')]=_[_0x85d7('0x1b')](config[_0x85d7('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x85d7('0x1c'))(new Redis(config['redis']));require(_0x85d7('0x1d'))[_0x85d7('0x1e')](socket);function respondWithStatusCode(_0x1f2df5,_0x3ae5e6){_0x3ae5e6=_0x3ae5e6||0xcc;return function(_0x33ca77){if(_0x33ca77){return _0x1f2df5['sendStatus'](_0x3ae5e6);}return _0x1f2df5[_0x85d7('0x1f')](_0x3ae5e6)[_0x85d7('0x20')]();};}function respondWithResult(_0xe5686,_0x3b678f){_0x3b678f=_0x3b678f||0xc8;return function(_0x5aab1f){if(_0x5aab1f){return _0xe5686[_0x85d7('0x1f')](_0x3b678f)[_0x85d7('0x21')](_0x5aab1f);}};}function respondWithFilteredResult(_0x452d11,_0x5dae9f){return function(_0x426c53){if(_0x426c53){var _0x2c4f42=typeof _0x5dae9f[_0x85d7('0x22')]===_0x85d7('0x23')&&typeof _0x5dae9f[_0x85d7('0x24')]===_0x85d7('0x23');var _0x34fa40=_0x426c53[_0x85d7('0x25')];var _0x58b97a=_0x2c4f42?0x0:_0x5dae9f[_0x85d7('0x22')];var _0x7ab703=_0x2c4f42?_0x426c53['count']:_0x5dae9f['offset']+_0x5dae9f[_0x85d7('0x24')];var _0x3c673f;if(_0x7ab703>=_0x34fa40){_0x7ab703=_0x34fa40;_0x3c673f=0xc8;}else{_0x3c673f=0xce;}_0x452d11[_0x85d7('0x1f')](_0x3c673f);return _0x452d11[_0x85d7('0x26')](_0x85d7('0x27'),_0x58b97a+'-'+_0x7ab703+'/'+_0x34fa40)[_0x85d7('0x21')](_0x426c53);}return null;};}function patchUpdates(_0x332731){return function(_0x48f690){try{jsonpatch[_0x85d7('0x28')](_0x48f690,_0x332731,!![]);}catch(_0x17c881){return BPromise[_0x85d7('0x29')](_0x17c881);}return _0x48f690[_0x85d7('0x2a')]();};}function saveUpdates(_0x3b04af,_0x498da1){return function(_0x487e5e){if(_0x487e5e){return _0x487e5e['update'](_0x3b04af)[_0x85d7('0x2b')](function(_0x14309f){return _0x14309f;});}return null;};}function removeEntity(_0x2323e1,_0x4b5b63){return function(_0x46917b){if(_0x46917b){return _0x46917b['destroy']()['then'](function(){_0x2323e1[_0x85d7('0x1f')](0xcc)[_0x85d7('0x20')]();});}};}function handleEntityNotFound(_0xfc8753,_0x5f0516){return function(_0x22aa6a){if(!_0x22aa6a){_0xfc8753['sendStatus'](0x194);}return _0x22aa6a;};}function handleError(_0xe4ab78,_0x37c8cd){_0x37c8cd=_0x37c8cd||0x1f4;return function(_0x48196e){logger[_0x85d7('0x2c')](_0x48196e[_0x85d7('0x2d')]);if(_0x48196e['name']){delete _0x48196e[_0x85d7('0x2e')];}_0xe4ab78[_0x85d7('0x1f')](_0x37c8cd)[_0x85d7('0x2f')](_0x48196e);};}exports[_0x85d7('0x30')]=function(_0x387b0d,_0x3630b7){var _0x1ef7b3={},_0x341a3c={},_0x533570={'count':0x0,'rows':[]};var _0x44e7f9=_['map'](db[_0x85d7('0x31')][_0x85d7('0x32')],function(_0x4eec96){return{'name':_0x4eec96['fieldName'],'type':_0x4eec96[_0x85d7('0x33')][_0x85d7('0x34')]};});_0x341a3c[_0x85d7('0x35')]=_[_0x85d7('0x36')](_0x44e7f9,'name');_0x341a3c[_0x85d7('0x37')]=_['keys'](_0x387b0d['query']);_0x341a3c[_0x85d7('0x38')]=_['intersection'](_0x341a3c[_0x85d7('0x35')],_0x341a3c['query']);_0x1ef7b3['attributes']=_[_0x85d7('0x39')](_0x341a3c[_0x85d7('0x35')],qs['fields'](_0x387b0d[_0x85d7('0x37')][_0x85d7('0x3a')]));_0x1ef7b3[_0x85d7('0x3b')]=_0x1ef7b3[_0x85d7('0x3b')]['length']?_0x1ef7b3[_0x85d7('0x3b')]:_0x341a3c[_0x85d7('0x35')];if(!_0x387b0d[_0x85d7('0x37')][_0x85d7('0x3c')]('nolimit')){_0x1ef7b3[_0x85d7('0x24')]=qs[_0x85d7('0x24')](_0x387b0d[_0x85d7('0x37')]['limit']);_0x1ef7b3['offset']=qs[_0x85d7('0x22')](_0x387b0d['query'][_0x85d7('0x22')]);}_0x1ef7b3['order']=qs[_0x85d7('0x3d')](_0x387b0d[_0x85d7('0x37')][_0x85d7('0x3d')]);_0x1ef7b3[_0x85d7('0x3e')]=qs[_0x85d7('0x38')](_['pick'](_0x387b0d[_0x85d7('0x37')],_0x341a3c[_0x85d7('0x38')]),_0x44e7f9);if(_0x387b0d[_0x85d7('0x37')][_0x85d7('0x3f')]){_0x1ef7b3[_0x85d7('0x3e')]=_['merge'](_0x1ef7b3[_0x85d7('0x3e')],{'$or':_['map'](_0x44e7f9,function(_0x292140){if(_0x292140[_0x85d7('0x33')]!=='VIRTUAL'){var _0x12e022={};_0x12e022[_0x292140[_0x85d7('0x2e')]]={'$like':'%'+_0x387b0d[_0x85d7('0x37')]['filter']+'%'};return _0x12e022;}})});}_0x1ef7b3=_[_0x85d7('0x40')]({},_0x1ef7b3,_0x387b0d[_0x85d7('0x41')]);var _0x13e738={'where':_0x1ef7b3['where']};return db[_0x85d7('0x31')]['count'](_0x13e738)[_0x85d7('0x2b')](function(_0x3fc9c0){_0x533570[_0x85d7('0x25')]=_0x3fc9c0;if(_0x387b0d[_0x85d7('0x37')][_0x85d7('0x42')]){_0x1ef7b3['include']=[{'all':!![]}];}return db[_0x85d7('0x31')][_0x85d7('0x43')](_0x1ef7b3);})[_0x85d7('0x2b')](function(_0x1b64da){_0x533570[_0x85d7('0x44')]=_0x1b64da;return _0x533570;})['then'](respondWithFilteredResult(_0x3630b7,_0x1ef7b3))[_0x85d7('0x45')](handleError(_0x3630b7,null));};exports[_0x85d7('0x46')]=function(_0x5d8acd,_0x399519){var _0x4485b0={'raw':!![],'where':{'id':_0x5d8acd[_0x85d7('0x47')]['id']}},_0x943784={};_0x943784[_0x85d7('0x35')]=_[_0x85d7('0x48')](db['ChatGroup'][_0x85d7('0x32')]);_0x943784[_0x85d7('0x37')]=_['keys'](_0x5d8acd[_0x85d7('0x37')]);_0x943784[_0x85d7('0x38')]=_['intersection'](_0x943784[_0x85d7('0x35')],_0x943784[_0x85d7('0x37')]);_0x4485b0['attributes']=_['intersection'](_0x943784[_0x85d7('0x35')],qs[_0x85d7('0x3a')](_0x5d8acd['query'][_0x85d7('0x3a')]));_0x4485b0[_0x85d7('0x3b')]=_0x4485b0[_0x85d7('0x3b')]['length']?_0x4485b0[_0x85d7('0x3b')]:_0x943784['model'];if(_0x5d8acd[_0x85d7('0x37')][_0x85d7('0x42')]){_0x4485b0[_0x85d7('0x49')]=[{'all':!![]}];}_0x4485b0=_[_0x85d7('0x40')]({},_0x4485b0,_0x5d8acd[_0x85d7('0x41')]);return db[_0x85d7('0x31')]['find'](_0x4485b0)[_0x85d7('0x2b')](handleEntityNotFound(_0x399519,null))['then'](respondWithResult(_0x399519,null))[_0x85d7('0x45')](handleError(_0x399519,null));};exports[_0x85d7('0x4a')]=function(_0xc3116d,_0x35a23f){return db[_0x85d7('0x31')]['create'](_0xc3116d['body'],{})[_0x85d7('0x2b')](respondWithResult(_0x35a23f,0xc9))['catch'](handleError(_0x35a23f,null));};exports[_0x85d7('0x4b')]=function(_0xd69a08,_0x44713b){if(_0xd69a08[_0x85d7('0x4c')]['id']){delete _0xd69a08[_0x85d7('0x4c')]['id'];}return db['ChatGroup'][_0x85d7('0x4d')]({'where':{'id':_0xd69a08['params']['id']}})[_0x85d7('0x2b')](handleEntityNotFound(_0x44713b,null))['then'](saveUpdates(_0xd69a08[_0x85d7('0x4c')],null))['then'](respondWithResult(_0x44713b,null))[_0x85d7('0x45')](handleError(_0x44713b,null));};exports[_0x85d7('0x4e')]=function(_0x21dfe2,_0x2d41eb){return db[_0x85d7('0x31')][_0x85d7('0x4d')]({'where':{'id':_0x21dfe2[_0x85d7('0x47')]['id']}})[_0x85d7('0x2b')](handleEntityNotFound(_0x2d41eb,null))[_0x85d7('0x2b')](removeEntity(_0x2d41eb,null))[_0x85d7('0x45')](handleError(_0x2d41eb,null));};exports[_0x85d7('0x4f')]=function(_0x5b33d2,_0x44ac23){return db['ChatGroup'][_0x85d7('0x4f')]()[_0x85d7('0x2b')](respondWithResult(_0x44ac23,null))[_0x85d7('0x45')](handleError(_0x44ac23,null));};exports[_0x85d7('0x50')]=function(_0x13c150,_0x2dd1fa,_0x38edd9){return db[_0x85d7('0x51')]['count']({'where':{'ChatGroupId':_0x13c150[_0x85d7('0x47')]['id'],'ToId':_0x13c150[_0x85d7('0x52')]['id'],'read':![]}})[_0x85d7('0x2b')](function(_0x19eb51){return{'id':_[_0x85d7('0x53')](_0x13c150[_0x85d7('0x47')]['id']),'count':_0x19eb51};})[_0x85d7('0x2b')](respondWithResult(_0x2dd1fa,null))[_0x85d7('0x45')](handleError(_0x2dd1fa,null));};exports['addMembers']=function(_0x2dd5c1,_0x1b8b2,_0x1c252b){return db[_0x85d7('0x31')][_0x85d7('0x4d')]({'where':{'id':_0x2dd5c1['params']['id']}})[_0x85d7('0x2b')](handleEntityNotFound(_0x1b8b2,null))[_0x85d7('0x2b')](function(_0x514eb6){if(_0x514eb6){return _0x514eb6[_0x85d7('0x54')](_0x2dd5c1['body'][_0x85d7('0x55')],_[_0x85d7('0x56')](_0x2dd5c1[_0x85d7('0x4c')],[_0x85d7('0x55'),'id'])||{});}})[_0x85d7('0x2b')](respondWithResult(_0x1b8b2,null))[_0x85d7('0x45')](handleError(_0x1b8b2,null));};exports[_0x85d7('0x57')]=function(_0x41f3c8,_0x45b7b7,_0x333682){var _0x14a06c={};var _0x41a62f={};var _0x38b728;var _0x972169;return db[_0x85d7('0x31')][_0x85d7('0x58')]({'where':{'id':_0x41f3c8['params']['id']}})[_0x85d7('0x2b')](handleEntityNotFound(_0x45b7b7,null))[_0x85d7('0x2b')](function(_0x1fd0d3){if(_0x1fd0d3){_0x38b728=_0x1fd0d3;_0x41a62f[_0x85d7('0x35')]=_['keys'](db['User'][_0x85d7('0x32')]);_0x41a62f['query']=_['keys'](_0x41f3c8[_0x85d7('0x37')]);_0x41a62f['filters']=_[_0x85d7('0x39')](_0x41a62f['model'],_0x41a62f[_0x85d7('0x37')]);_0x14a06c[_0x85d7('0x3b')]=_['intersection'](_0x41a62f[_0x85d7('0x35')],qs[_0x85d7('0x3a')](_0x41f3c8['query']['fields']));_0x14a06c[_0x85d7('0x3b')]=_0x14a06c[_0x85d7('0x3b')]['length']?_0x14a06c[_0x85d7('0x3b')]:_0x41a62f[_0x85d7('0x35')];_0x14a06c[_0x85d7('0x59')]=qs[_0x85d7('0x3d')](_0x41f3c8[_0x85d7('0x37')][_0x85d7('0x3d')]);_0x14a06c['where']=qs[_0x85d7('0x38')](_[_0x85d7('0x5a')](_0x41f3c8['query'],_0x41a62f[_0x85d7('0x38')]));if(_0x41f3c8[_0x85d7('0x37')][_0x85d7('0x3f')]){_0x14a06c['where']=_[_0x85d7('0x40')](_0x14a06c['where'],{'$or':_['map'](_0x14a06c[_0x85d7('0x3b')],function(_0x2f88ff){var _0x1dcd3c={};_0x1dcd3c[_0x2f88ff]={'$like':'%'+_0x41f3c8[_0x85d7('0x37')][_0x85d7('0x3f')]+'%'};return _0x1dcd3c;})});}_0x14a06c=_[_0x85d7('0x40')]({},_0x14a06c,_0x41f3c8[_0x85d7('0x41')]);return _0x38b728[_0x85d7('0x57')](_0x14a06c);}})[_0x85d7('0x2b')](function(_0xe0ee7b){if(_0xe0ee7b){_0x972169=_0xe0ee7b['length'];if(!_0x41f3c8[_0x85d7('0x37')][_0x85d7('0x3c')](_0x85d7('0x5b'))){_0x14a06c[_0x85d7('0x24')]=qs['limit'](_0x41f3c8[_0x85d7('0x37')][_0x85d7('0x24')]);_0x14a06c['offset']=qs['offset'](_0x41f3c8[_0x85d7('0x37')]['offset']);}return _0x38b728[_0x85d7('0x57')](_0x14a06c);}})[_0x85d7('0x2b')](function(_0x4b0abe){if(_0x4b0abe){return _0x4b0abe?{'count':_0x972169,'rows':_0x4b0abe}:null;}})[_0x85d7('0x2b')](respondWithResult(_0x45b7b7,null))['catch'](handleError(_0x45b7b7,null));};exports['removeMembers']=function(_0x5d1179,_0x448df5,_0x51a10a){return db[_0x85d7('0x31')]['find']({'where':{'id':_0x5d1179[_0x85d7('0x47')]['id']}})[_0x85d7('0x2b')](handleEntityNotFound(_0x448df5,null))[_0x85d7('0x2b')](function(_0x1e57a3){if(_0x1e57a3){return _0x1e57a3['removeMembers'](_0x5d1179[_0x85d7('0x37')][_0x85d7('0x55')]);}})[_0x85d7('0x2b')](respondWithStatusCode(_0x448df5,null))['catch'](handleError(_0x448df5,null));};exports[_0x85d7('0x5c')]=function(_0x4cb237,_0x3f775e,_0x5e89d2){if(_0x4cb237[_0x85d7('0x4c')]['id']){delete _0x4cb237['body']['id'];}return db[_0x85d7('0x31')][_0x85d7('0x4d')]({'where':{'id':_0x4cb237['params']['id']}})[_0x85d7('0x2b')](handleEntityNotFound(_0x3f775e,null))[_0x85d7('0x2b')](function(_0x2777f1){if(_0x2777f1){_0x4cb237['body']['ChatGroupId']=_0x2777f1['id'];return db[_0x85d7('0x51')][_0x85d7('0x4a')](_0x4cb237['body']);}})[_0x85d7('0x2b')](respondWithResult(_0x3f775e,null))[_0x85d7('0x45')](handleError(_0x3f775e,null));};exports[_0x85d7('0x5d')]=function(_0x115be8,_0x24afa6,_0x4607d4){var _0x1f4abc={};var _0x2f5746={};var _0x9768aa;var _0x448ba7;return db[_0x85d7('0x31')][_0x85d7('0x58')]({'where':{'id':_0x115be8['params']['id']}})[_0x85d7('0x2b')](handleEntityNotFound(_0x24afa6,null))['then'](function(_0x183867){if(_0x183867){_0x9768aa=_0x183867;_0x2f5746[_0x85d7('0x35')]=_[_0x85d7('0x48')](db[_0x85d7('0x51')][_0x85d7('0x32')]);_0x2f5746['query']=_[_0x85d7('0x48')](_0x115be8[_0x85d7('0x37')]);_0x2f5746[_0x85d7('0x38')]=_[_0x85d7('0x39')](_0x2f5746['model'],_0x2f5746[_0x85d7('0x37')]);_0x1f4abc[_0x85d7('0x3b')]=_[_0x85d7('0x39')](_0x2f5746[_0x85d7('0x35')],qs[_0x85d7('0x3a')](_0x115be8['query'][_0x85d7('0x3a')]));_0x1f4abc['attributes']=_0x1f4abc[_0x85d7('0x3b')][_0x85d7('0x5e')]?_0x1f4abc[_0x85d7('0x3b')]:_0x2f5746['model'];_0x1f4abc[_0x85d7('0x59')]=qs[_0x85d7('0x3d')](_0x115be8[_0x85d7('0x37')][_0x85d7('0x3d')]);_0x1f4abc[_0x85d7('0x3e')]=qs[_0x85d7('0x38')](_[_0x85d7('0x5a')](_0x115be8[_0x85d7('0x37')],_0x2f5746[_0x85d7('0x38')]));if(_0x115be8[_0x85d7('0x37')][_0x85d7('0x3f')]){_0x1f4abc[_0x85d7('0x3e')]=_[_0x85d7('0x40')](_0x1f4abc[_0x85d7('0x3e')],{'$or':_['map'](_0x1f4abc[_0x85d7('0x3b')],function(_0x1fa39e){var _0x1eca1a={};_0x1eca1a[_0x1fa39e]={'$like':'%'+_0x115be8[_0x85d7('0x37')][_0x85d7('0x3f')]+'%'};return _0x1eca1a;})});}if(_0x115be8[_0x85d7('0x37')][_0x85d7('0x5f')]){var _0x2c1e02=_0x115be8[_0x85d7('0x37')]['$gte']['split'](',');var _0x559c84={};_0x559c84[_0x2c1e02[0x0]]={'$gte':moment(_0x2c1e02[0x1])[_0x85d7('0x60')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1f4abc[_0x85d7('0x3e')]=_[_0x85d7('0x40')](_0x1f4abc[_0x85d7('0x3e')],_0x559c84);}_0x1f4abc=_[_0x85d7('0x40')]({},_0x1f4abc,_0x115be8[_0x85d7('0x41')]);return _0x9768aa[_0x85d7('0x5d')](_0x1f4abc);}})[_0x85d7('0x2b')](function(_0x2263c8){if(_0x2263c8){_0x448ba7=_0x2263c8['length'];if(!_0x115be8[_0x85d7('0x37')][_0x85d7('0x3c')]('nolimit')){_0x1f4abc['limit']=qs['limit'](_0x115be8['query']['limit']);_0x1f4abc[_0x85d7('0x22')]=qs['offset'](_0x115be8[_0x85d7('0x37')][_0x85d7('0x22')]);}return _0x9768aa[_0x85d7('0x5d')](_0x1f4abc);}})[_0x85d7('0x2b')](function(_0x2f1715){if(_0x2f1715){return _0x2f1715?{'count':_0x448ba7,'rows':_0x2f1715}:null;}})['then'](respondWithResult(_0x24afa6,null))[_0x85d7('0x45')](handleError(_0x24afa6,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 9f196f0..0095702 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 _0x5e6e=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5e6e,0x74));var _0xe5e6=function(_0x220d56,_0x153929){_0x220d56=_0x220d56-0x0;var _0xd37143=_0x5e6e[_0x220d56];return _0xd37143;};'use strict';var EventEmitter=require(_0xe5e6('0x0'));var ChatGroup=require(_0xe5e6('0x1'))['db'][_0xe5e6('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xe5e6('0x3')](0x0);var events={'afterCreate':_0xe5e6('0x4'),'afterUpdate':_0xe5e6('0x5'),'afterDestroy':_0xe5e6('0x6')};function emitEvent(_0x2df215){return function(_0x5a09a3,_0x301b71,_0x1a8b1c){ChatGroupEvents[_0xe5e6('0x7')](_0x2df215+':'+_0x5a09a3['id'],_0x5a09a3);ChatGroupEvents[_0xe5e6('0x7')](_0x2df215,_0x5a09a3);_0x1a8b1c(null);};}for(var e in events){if(events[_0xe5e6('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xe5e6('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0xe3a5=['../../mysqldb','ChatGroup','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x23dcff,_0x16f503){var _0x1a42d9=function(_0x4977a3){while(--_0x4977a3){_0x23dcff['push'](_0x23dcff['shift']());}};_0x1a42d9(++_0x16f503);}(_0xe3a5,0x127));var _0x5e3a=function(_0x134771,_0x22cd7c){_0x134771=_0x134771-0x0;var _0x302010=_0xe3a5[_0x134771];return _0x302010;};'use strict';var EventEmitter=require(_0x5e3a('0x0'));var ChatGroup=require(_0x5e3a('0x1'))['db'][_0x5e3a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5e3a('0x3'),'afterDestroy':_0x5e3a('0x4')};function emitEvent(_0x1e867c){return function(_0x597a22,_0x40aa58,_0x30f110){ChatGroupEvents[_0x5e3a('0x5')](_0x1e867c+':'+_0x597a22['id'],_0x597a22);ChatGroupEvents[_0x5e3a('0x5')](_0x1e867c,_0x597a22);_0x30f110(null);};}for(var e in events){if(events[_0x5e3a('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x5e3a('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 259ab90..70eb0f4 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 _0x6f2f=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','util','moment','bluebird','request-promise','rimraf'];(function(_0x5e4ca8,_0x3e156c){var _0x21ef16=function(_0x43ae45){while(--_0x43ae45){_0x5e4ca8['push'](_0x5e4ca8['shift']());}};_0x21ef16(++_0x3e156c);}(_0x6f2f,0x1ef));var _0xf6f2=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x6f2f[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require(_0xf6f2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf6f2('0x1'));var BPromise=require(_0xf6f2('0x2'));var rp=require(_0xf6f2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf6f2('0x4'));var config=require(_0xf6f2('0x5'));var attributes=require(_0xf6f2('0x6'));module[_0xf6f2('0x7')]=function(_0x1a6a99,_0x209916){return _0x1a6a99[_0xf6f2('0x8')](_0xf6f2('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x36b1=['path','../../config/environment','exports','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0x3d09e2,_0x58e784){var _0x5d03cd=function(_0x40f355){while(--_0x40f355){_0x3d09e2['push'](_0x3d09e2['shift']());}};_0x5d03cd(++_0x58e784);}(_0x36b1,0x18d));var _0x136b=function(_0x1c528a,_0x1a59d0){_0x1c528a=_0x1c528a-0x0;var _0x53de3e=_0x36b1[_0x1c528a];return _0x53de3e;};'use strict';var _=require(_0x136b('0x0'));var util=require(_0x136b('0x1'));var logger=require(_0x136b('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x136b('0x3'));var rimraf=require('rimraf');var config=require(_0x136b('0x4'));var attributes=require('./chatGroup.attributes');module[_0x136b('0x5')]=function(_0x276766,_0x5b36e1){return _0x276766['define'](_0x136b('0x6'),attributes,{'tableName':_0x136b('0x7'),'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 c1932c5..213628c 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 _0x615a=['error','ChatGroup,\x20%s,\x20%s','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x32cd7f,_0x3c7b2a){var _0x197196=function(_0x3e0ebd){while(--_0x3e0ebd){_0x32cd7f['push'](_0x32cd7f['shift']());}};_0x197196(++_0x3c7b2a);}(_0x615a,0x119));var _0xa615=function(_0x2059df,_0x367401){_0x2059df=_0x2059df-0x0;var _0xdd848b=_0x615a[_0x2059df];return _0xdd848b;};'use strict';var _=require(_0xa615('0x0'));var util=require('util');var moment=require(_0xa615('0x1'));var BPromise=require('bluebird');var rs=require(_0xa615('0x2'));var fs=require('fs');var Redis=require(_0xa615('0x3'));var db=require(_0xa615('0x4'))['db'];var utils=require(_0xa615('0x5'));var logger=require('../../config/logger')(_0xa615('0x6'));var config=require(_0xa615('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa615('0x8')]['http']({'port':0x232a});config[_0xa615('0x9')]=_[_0xa615('0xa')](config[_0xa615('0x9')],{'host':_0xa615('0xb'),'port':0x18eb});var socket=require(_0xa615('0xc'))(new Redis(config['redis']));require(_0xa615('0xd'))['register'](socket);function respondWithRpcPromise(_0x2b952d,_0x3fbfe1,_0x5a6664){return new BPromise(function(_0x3b1698,_0xf1cbca){return client[_0xa615('0xe')](_0x2b952d,_0x5a6664)[_0xa615('0xf')](function(_0x2530ec){logger['info']('ChatGroup,\x20%s,\x20%s',_0x3fbfe1,_0xa615('0x10'));logger['debug'](_0xa615('0x11'),_0x3fbfe1,_0xa615('0x10'),JSON[_0xa615('0x12')](_0x2530ec));if(_0x2530ec[_0xa615('0x13')]){if(_0x2530ec['error']['code']===0x1f4){logger[_0xa615('0x13')](_0xa615('0x14'),_0x3fbfe1,_0x2530ec[_0xa615('0x13')][_0xa615('0x15')]);return _0xf1cbca(_0x2530ec[_0xa615('0x13')][_0xa615('0x15')]);}logger[_0xa615('0x13')](_0xa615('0x14'),_0x3fbfe1,_0x2530ec[_0xa615('0x13')][_0xa615('0x15')]);return _0x3b1698(_0x2530ec[_0xa615('0x13')][_0xa615('0x15')]);}else{logger[_0xa615('0x16')](_0xa615('0x14'),_0x3fbfe1,_0xa615('0x10'));_0x3b1698(_0x2530ec[_0xa615('0x17')][_0xa615('0x15')]);}})[_0xa615('0x18')](function(_0x1eb384){logger['error'](_0xa615('0x14'),_0x3fbfe1,_0x1eb384);_0xf1cbca(_0x1eb384);});});}
\ No newline at end of file
+var _0xc57c=['defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x2a5129,_0x19de86){var _0x169fe1=function(_0xacbaa2){while(--_0xacbaa2){_0x2a5129['push'](_0x2a5129['shift']());}};_0x169fe1(++_0x19de86);}(_0xc57c,0x149));var _0xcc57=function(_0x58c78b,_0x44a579){_0x58c78b=_0x58c78b-0x0;var _0x21757b=_0xc57c[_0x58c78b];return _0x21757b;};'use strict';var _=require(_0xcc57('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc57('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcc57('0x2'));var logger=require('../../config/logger')(_0xcc57('0x3'));var config=require(_0xcc57('0x4'));var jayson=require(_0xcc57('0x5'));var client=jayson[_0xcc57('0x6')][_0xcc57('0x7')]({'port':0x232a});config[_0xcc57('0x8')]=_[_0xcc57('0x9')](config['redis'],{'host':_0xcc57('0xa'),'port':0x18eb});var socket=require(_0xcc57('0xb'))(new Redis(config[_0xcc57('0x8')]));require(_0xcc57('0xc'))[_0xcc57('0xd')](socket);function respondWithRpcPromise(_0x1a8031,_0x35916b,_0x551a73){return new BPromise(function(_0x4c7e7c,_0x51be8c){return client[_0xcc57('0xe')](_0x1a8031,_0x551a73)[_0xcc57('0xf')](function(_0x5a5444){logger[_0xcc57('0x10')](_0xcc57('0x11'),_0x35916b,_0xcc57('0x12'));logger[_0xcc57('0x13')](_0xcc57('0x14'),_0x35916b,_0xcc57('0x12'),JSON[_0xcc57('0x15')](_0x5a5444));if(_0x5a5444[_0xcc57('0x16')]){if(_0x5a5444[_0xcc57('0x16')][_0xcc57('0x17')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x35916b,_0x5a5444['error'][_0xcc57('0x18')]);return _0x51be8c(_0x5a5444[_0xcc57('0x16')][_0xcc57('0x18')]);}logger[_0xcc57('0x16')](_0xcc57('0x11'),_0x35916b,_0x5a5444['error'][_0xcc57('0x18')]);return _0x4c7e7c(_0x5a5444[_0xcc57('0x16')]['message']);}else{logger[_0xcc57('0x10')]('ChatGroup,\x20%s,\x20%s',_0x35916b,_0xcc57('0x12'));_0x4c7e7c(_0x5a5444['result'][_0xcc57('0x18')]);}})[_0xcc57('0x19')](function(_0x24b749){logger['error'](_0xcc57('0x11'),_0x35916b,_0x24b749);_0x51be8c(_0x24b749);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 06c9a82..46ea2f2 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 _0x6339=['length','chatGroup:','./chatGroup.events','remove','update','emit'];(function(_0x3ae1cc,_0x2ab3e6){var _0x51a273=function(_0x22761a){while(--_0x22761a){_0x3ae1cc['push'](_0x3ae1cc['shift']());}};_0x51a273(++_0x2ab3e6);}(_0x6339,0x98));var _0x9633=function(_0x5c3bce,_0x6a925c){_0x5c3bce=_0x5c3bce-0x0;var _0x38c996=_0x6339[_0x5c3bce];return _0x38c996;};'use strict';var ChatGroupEvents=require(_0x9633('0x0'));var events=['save',_0x9633('0x1'),_0x9633('0x2')];function createListener(_0x4fac89,_0x4b5440){return function(_0x40cc8c){_0x4b5440[_0x9633('0x3')](_0x4fac89,_0x40cc8c);};}function removeListener(_0x18e084,_0x59387d){return function(){ChatGroupEvents['removeListener'](_0x18e084,_0x59387d);};}exports['register']=function(_0x2faaff){for(var _0x344a8e=0x0,_0x4599e3=events[_0x9633('0x4')];_0x344a8e<_0x4599e3;_0x344a8e++){var _0xeca78d=events[_0x344a8e];var _0x2937d4=createListener(_0x9633('0x5')+_0xeca78d,_0x2faaff);ChatGroupEvents['on'](_0xeca78d,_0x2937d4);}};
\ No newline at end of file
+var _0x9001=['chatGroup:','./chatGroup.events','save','remove','update','removeListener','register','length'];(function(_0x5cb367,_0x27ec9d){var _0x279365=function(_0x1d9d85){while(--_0x1d9d85){_0x5cb367['push'](_0x5cb367['shift']());}};_0x279365(++_0x27ec9d);}(_0x9001,0x109));var _0x1900=function(_0x458d26,_0x9f67b8){_0x458d26=_0x458d26-0x0;var _0x4bb206=_0x9001[_0x458d26];return _0x4bb206;};'use strict';var ChatGroupEvents=require(_0x1900('0x0'));var events=[_0x1900('0x1'),_0x1900('0x2'),_0x1900('0x3')];function createListener(_0x46b6be,_0x449052){return function(_0x2d76a7){_0x449052['emit'](_0x46b6be,_0x2d76a7);};}function removeListener(_0x1bbf6c,_0x1ca4b4){return function(){ChatGroupEvents[_0x1900('0x4')](_0x1bbf6c,_0x1ca4b4);};}exports[_0x1900('0x5')]=function(_0x2a0ae6){for(var _0x1ceb35=0x0,_0x32cebe=events[_0x1900('0x6')];_0x1ceb35<_0x32cebe;_0x1ceb35++){var _0x66d3f7=events[_0x1ceb35];var _0x3934a1=createListener(_0x1900('0x7')+_0x66d3f7,_0x2a0ae6);ChatGroupEvents['on'](_0x66d3f7,_0x3934a1);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index f03e11e..3673b20 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 _0x269d=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage','put','delete','removeMembers','exports','express','Router'];(function(_0x4fa489,_0x4cba6b){var _0x41d2ce=function(_0x364060){while(--_0x364060){_0x4fa489['push'](_0x4fa489['shift']());}};_0x41d2ce(++_0x4cba6b);}(_0x269d,0xbe));var _0xd269=function(_0x2f9922,_0x3eea19){_0x2f9922=_0x2f9922-0x0;var _0x963e1c=_0x269d[_0x2f9922];return _0x963e1c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd269('0x0'));var router=express[_0xd269('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xd269('0x2'));var interaction=require(_0xd269('0x3'));var config=require(_0xd269('0x4'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xd269('0x5')](),controller[_0xd269('0x6')]);router[_0xd269('0x7')](_0xd269('0x8'),auth['isAuthenticated'](),controller[_0xd269('0x9')]);router[_0xd269('0x7')](_0xd269('0xa'),auth[_0xd269('0x5')](),controller[_0xd269('0xb')]);router[_0xd269('0x7')]('/:id/unread',auth['isAuthenticated'](),controller[_0xd269('0xc')]);router[_0xd269('0x7')](_0xd269('0xd'),auth['isAuthenticated'](),controller[_0xd269('0xe')]);router[_0xd269('0x7')](_0xd269('0xf'),auth[_0xd269('0x5')](),controller['getMessages']);router[_0xd269('0x10')]('/',auth[_0xd269('0x5')](),controller[_0xd269('0x11')]);router[_0xd269('0x10')](_0xd269('0xd'),auth['isAuthenticated'](),controller[_0xd269('0x12')]);router[_0xd269('0x10')](_0xd269('0xf'),auth['isAuthenticated'](),controller[_0xd269('0x13')]);router[_0xd269('0x14')](_0xd269('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xd269('0x15')](_0xd269('0xd'),auth[_0xd269('0x5')](),controller[_0xd269('0x16')]);module[_0xd269('0x17')]=router;
\ No newline at end of file
+var _0xaa3f=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','getUnread','/:id/members','getMembers','getMessages','create','addMembers','post','addMessage','put','update','delete','destroy','removeMembers'];(function(_0x179314,_0x32d3a2){var _0x3556f7=function(_0x16244e){while(--_0x16244e){_0x179314['push'](_0x179314['shift']());}};_0x3556f7(++_0x32d3a2);}(_0xaa3f,0xe9));var _0xfaa3=function(_0x2e5a17,_0x558f0e){_0x2e5a17=_0x2e5a17-0x0;var _0x24f53d=_0xaa3f[_0x2e5a17];return _0x24f53d;};'use strict';var multer=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var path=require(_0xfaa3('0x2'));var timeout=require(_0xfaa3('0x3'));var express=require(_0xfaa3('0x4'));var router=express[_0xfaa3('0x5')]();var fs_extra=require(_0xfaa3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfaa3('0x7'));var config=require('../../config/environment');var controller=require(_0xfaa3('0x8'));router[_0xfaa3('0x9')]('/',auth[_0xfaa3('0xa')](),controller['index']);router['get'](_0xfaa3('0xb'),auth[_0xfaa3('0xa')](),controller[_0xfaa3('0xc')]);router['get'](_0xfaa3('0xd'),auth[_0xfaa3('0xa')](),controller[_0xfaa3('0xe')]);router[_0xfaa3('0x9')]('/:id/unread',auth[_0xfaa3('0xa')](),controller[_0xfaa3('0xf')]);router[_0xfaa3('0x9')](_0xfaa3('0x10'),auth[_0xfaa3('0xa')](),controller[_0xfaa3('0x11')]);router[_0xfaa3('0x9')]('/:id/messages',auth[_0xfaa3('0xa')](),controller[_0xfaa3('0x12')]);router['post']('/',auth[_0xfaa3('0xa')](),controller[_0xfaa3('0x13')]);router['post'](_0xfaa3('0x10'),auth[_0xfaa3('0xa')](),controller[_0xfaa3('0x14')]);router[_0xfaa3('0x15')]('/:id/messages',auth[_0xfaa3('0xa')](),controller[_0xfaa3('0x16')]);router[_0xfaa3('0x17')](_0xfaa3('0xd'),auth[_0xfaa3('0xa')](),controller[_0xfaa3('0x18')]);router[_0xfaa3('0x19')](_0xfaa3('0xd'),auth[_0xfaa3('0xa')](),controller[_0xfaa3('0x1a')]);router[_0xfaa3('0x19')](_0xfaa3('0x10'),auth[_0xfaa3('0xa')](),controller[_0xfaa3('0x1b')]);module[_0xfaa3('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 7c19fad..1431d3f 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 _0x60d3=['STRING','DATE','TEXT','long','BOOLEAN','INTEGER','ENUM','star','thumb'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x60d3,0xc1));var _0x360d=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0x60d3[_0x26b622];return _0x58a028;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x360d('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x360d('0x1')]},'ratingType':{'type':Sequelize[_0x360d('0x2')](_0x360d('0x3'),_0x360d('0x4')),'defaultValue':_0x360d('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x360d('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x360d('0x6')]},'disposition':{'type':Sequelize[_0x360d('0x5')]},'secondDisposition':{'type':Sequelize[_0x360d('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x360d('0x5')]},'browserName':{'type':Sequelize[_0x360d('0x5')]},'browserVersion':{'type':Sequelize[_0x360d('0x5')]},'osName':{'type':Sequelize[_0x360d('0x5')]},'osVersion':{'type':Sequelize[_0x360d('0x5')]},'deviceModel':{'type':Sequelize[_0x360d('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x360d('0x5')]},'referer':{'type':Sequelize[_0x360d('0x7')]},'customerIp':{'type':Sequelize[_0x360d('0x5')]},'formData':{'type':Sequelize[_0x360d('0x7')](_0x360d('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x360d('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x360d('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x360d('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x360d('0x0')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x4535=['BOOLEAN','INTEGER','thumb','star','TEXT','DATE','STRING','ENUM','exports'];(function(_0x30821a,_0x61e78b){var _0x6db77=function(_0x384c45){while(--_0x384c45){_0x30821a['push'](_0x30821a['shift']());}};_0x6db77(++_0x61e78b);}(_0x4535,0xb3));var _0x5453=function(_0x1de777,_0x34ef16){_0x1de777=_0x1de777-0x0;var _0x11a982=_0x4535[_0x1de777];return _0x11a982;};'use strict';var Sequelize=require('sequelize');module[_0x5453('0x0')]={'closed':{'type':Sequelize[_0x5453('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x5453('0x2')]},'ratingType':{'type':Sequelize['ENUM']('star',_0x5453('0x3')),'defaultValue':_0x5453('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x5453('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x5453('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x5453('0x7')]},'thirdDisposition':{'type':Sequelize[_0x5453('0x7')]},'note':{'type':Sequelize[_0x5453('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x5453('0x7')]},'osName':{'type':Sequelize[_0x5453('0x7')]},'osVersion':{'type':Sequelize[_0x5453('0x7')]},'deviceModel':{'type':Sequelize[_0x5453('0x7')]},'deviceVendor':{'type':Sequelize[_0x5453('0x7')]},'deviceType':{'type':Sequelize[_0x5453('0x7')]},'referer':{'type':Sequelize[_0x5453('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x5453('0x5')]('long')},'read1stAt':{'type':Sequelize[_0x5453('0x6')]},'lastMsgAt':{'type':Sequelize[_0x5453('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x5453('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x5453('0x7')]},'customerPort':{'type':Sequelize[_0x5453('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x5453('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x5453('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 90c6e55..cedd441 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 _0xc812=['downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','jayson/promise','http','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','sendStatus','end','json','offset','limit','undefined','count','status','destroy','stack','name','send','render','body','contact','agent','interaction','account','index','map','rawAttributes','fieldName','type','findAll','catch','show','params','model','keys','query','intersection','fields','attributes','length','includeAll','include','merge','options','ChatInteraction','find','create','update','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','join','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ChatWebsiteId','ContactId','agentAlias','System','customer','format','Visitor','agentIdentifier','agent_alias','alias','%s%d','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filters','hasOwnProperty','nolimit','order','sort','where','pick','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','ChatInteractionId','filter','push','addTags','spread','Tag','color','emit','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','toString','browserName','osName','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','views'];(function(_0x5cac67,_0x1837d3){var _0x27ce41=function(_0x17910f){while(--_0x17910f){_0x5cac67['push'](_0x5cac67['shift']());}};_0x27ce41(++_0x1837d3);}(_0xc812,0x1b2));var _0x2c81=function(_0x13ddc6,_0x4d5530){_0x13ddc6=_0x13ddc6-0x0;var _0x4202fd=_0xc812[_0x13ddc6];return _0x4202fd;};'use strict';var rimraf=require(_0x2c81('0x0'));var zipdir=require(_0x2c81('0x1'));var rp=require(_0x2c81('0x2'));var moment=require('moment');var BPromise=require(_0x2c81('0x3'));var Mustache=require('mustache');var util=require(_0x2c81('0x4'));var path=require(_0x2c81('0x5'));var ejs=require(_0x2c81('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x2c81('0x7'));var interaction=require(_0x2c81('0x8'));var qs=require(_0x2c81('0x9'));var pdf=require(_0x2c81('0xa'));var logger=require(_0x2c81('0xb'))(_0x2c81('0xc'));var config=require(_0x2c81('0xd'));var db=require(_0x2c81('0xe'))['db'];config['redis']=_[_0x2c81('0xf')](config[_0x2c81('0x10')],{'host':_0x2c81('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2c81('0x10')]));require(_0x2c81('0x12'))[_0x2c81('0x13')](socket);var jayson=require(_0x2c81('0x14'));var client=jayson['client'][_0x2c81('0x15')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x354fae,_0x50d103,_0x49704f,_0x1292d6){return new BPromise(function(_0x582c03,_0x4c6610){var _0x2909f4=_0x1292d6||client;return _0x2909f4[_0x2c81('0x16')](_0x354fae,_0x49704f)[_0x2c81('0x17')](function(_0x229249){logger[_0x2c81('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x50d103,_0x2c81('0x19'));logger['debug'](_0x2c81('0x1a'),_0x50d103,_0x2c81('0x19'),JSON[_0x2c81('0x1b')](_0x229249));if(_0x229249[_0x2c81('0x1c')]){if(_0x229249['error'][_0x2c81('0x1d')]===0x1f4){logger[_0x2c81('0x1c')](_0x2c81('0x1e'),_0x50d103,_0x229249[_0x2c81('0x1c')]['message']);return _0x4c6610(_0x229249[_0x2c81('0x1c')][_0x2c81('0x1f')]);}logger[_0x2c81('0x1c')](_0x2c81('0x1e'),_0x50d103,_0x229249['error'][_0x2c81('0x1f')]);return _0x582c03(_0x229249[_0x2c81('0x1c')]['message']);}else{logger[_0x2c81('0x18')](_0x2c81('0x1e'),_0x50d103,_0x2c81('0x19'));_0x582c03(_0x229249[_0x2c81('0x20')][_0x2c81('0x1f')]);}})['catch'](function(_0x17ee0c){logger['error'](_0x2c81('0x1e'),_0x50d103,_0x17ee0c);_0x4c6610(_0x17ee0c);});});}function respondWithStatusCode(_0x12f92d,_0x12f892){_0x12f892=_0x12f892||0xcc;return function(_0x5b2b76){if(_0x5b2b76){return _0x12f92d[_0x2c81('0x21')](_0x12f892);}return _0x12f92d['status'](_0x12f892)[_0x2c81('0x22')]();};}function respondWithResult(_0x1dcfff,_0x363562){_0x363562=_0x363562||0xc8;return function(_0xdf6d50){if(_0xdf6d50){return _0x1dcfff['status'](_0x363562)[_0x2c81('0x23')](_0xdf6d50);}};}function respondWithFilteredResult(_0x56bfb9,_0x25f8d0){return function(_0x2cdeb1){if(_0x2cdeb1){var _0x45865b=typeof _0x25f8d0[_0x2c81('0x24')]==='undefined'&&typeof _0x25f8d0[_0x2c81('0x25')]===_0x2c81('0x26');var _0x48d812=_0x2cdeb1[_0x2c81('0x27')];var _0x2e6825=_0x45865b?0x0:_0x25f8d0[_0x2c81('0x24')];var _0x2c98b1=_0x45865b?_0x2cdeb1[_0x2c81('0x27')]:_0x25f8d0[_0x2c81('0x24')]+_0x25f8d0[_0x2c81('0x25')];var _0x53b7d4;if(_0x2c98b1>=_0x48d812){_0x2c98b1=_0x48d812;_0x53b7d4=0xc8;}else{_0x53b7d4=0xce;}_0x56bfb9[_0x2c81('0x28')](_0x53b7d4);return _0x56bfb9['set']('Content-Range',_0x2e6825+'-'+_0x2c98b1+'/'+_0x48d812)[_0x2c81('0x23')](_0x2cdeb1);}return null;};}function saveUpdates(_0x191c8c){return function(_0x290594){if(_0x290594){return _0x290594['update'](_0x191c8c)[_0x2c81('0x17')](function(_0x5dfc53){return _0x5dfc53;});}return null;};}function removeEntity(_0x3a5a8f){return function(_0x402bee){if(_0x402bee){return _0x402bee[_0x2c81('0x29')]()['then'](function(){_0x3a5a8f[_0x2c81('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30d624){return function(_0x1e5f3d){if(!_0x1e5f3d){_0x30d624[_0x2c81('0x21')](0x194);}return _0x1e5f3d;};}function handleError(_0x3f8a38,_0x51cb52){_0x51cb52=_0x51cb52||0x1f4;return function(_0x5ac1ab){logger['error'](_0x5ac1ab[_0x2c81('0x2a')]);if(_0x5ac1ab[_0x2c81('0x2b')]){delete _0x5ac1ab[_0x2c81('0x2b')];}_0x3f8a38[_0x2c81('0x28')](_0x51cb52)[_0x2c81('0x2c')](_0x5ac1ab);};}function getMustacheRender(_0x4ce07e,_0x422f35){return Mustache[_0x2c81('0x2d')](_0x4ce07e,_['merge'](_0x422f35[_0x2c81('0x2e')],{'contact':_0x422f35[_0x2c81('0x2f')],'message':_0x422f35[_0x2c81('0x1f')],'agent':_0x422f35[_0x2c81('0x30')],'interaction':_0x422f35[_0x2c81('0x31')],'account':_0x422f35[_0x2c81('0x32')]}))||'';}exports[_0x2c81('0x33')]=function(_0x38816c,_0xd2f725){var _0x33149e={};var _0x5f302d=_[_0x2c81('0x34')](db['ChatInteraction'][_0x2c81('0x35')],function(_0x252403){return{'name':_0x252403[_0x2c81('0x36')],'type':_0x252403[_0x2c81('0x37')]['key']};});_0x33149e=qs['getOptions'](_0x5f302d,_0x38816c);return interaction[_0x2c81('0x38')]('chat',_0x38816c['query'],_0x38816c['user'],_0x33149e,_0x5f302d)[_0x2c81('0x17')](respondWithFilteredResult(_0xd2f725,_0x33149e))[_0x2c81('0x39')](handleError(_0xd2f725,null));};exports[_0x2c81('0x3a')]=function(_0x136a52,_0xf1af4b){var _0x358442={'raw':![],'where':{'id':_0x136a52[_0x2c81('0x3b')]['id']}},_0x290680={};_0x290680[_0x2c81('0x3c')]=_[_0x2c81('0x3d')](db['ChatInteraction'][_0x2c81('0x35')]);_0x290680[_0x2c81('0x3e')]=_['keys'](_0x136a52['query']);_0x290680['filters']=_['intersection'](_0x290680['model'],_0x290680[_0x2c81('0x3e')]);_0x358442['attributes']=_[_0x2c81('0x3f')](_0x290680['model'],qs[_0x2c81('0x40')](_0x136a52[_0x2c81('0x3e')][_0x2c81('0x40')]));_0x358442[_0x2c81('0x41')]=_0x358442['attributes'][_0x2c81('0x42')]?_0x358442[_0x2c81('0x41')]:_0x290680[_0x2c81('0x3c')];if(_0x136a52[_0x2c81('0x3e')][_0x2c81('0x43')]){_0x358442[_0x2c81('0x44')]=[{'all':!![]}];}_0x358442=_[_0x2c81('0x45')]({},_0x358442,_0x136a52[_0x2c81('0x46')]);return db[_0x2c81('0x47')][_0x2c81('0x48')](_0x358442)[_0x2c81('0x17')](handleEntityNotFound(_0xf1af4b,null))[_0x2c81('0x17')](respondWithResult(_0xf1af4b,null))[_0x2c81('0x39')](handleError(_0xf1af4b,null));};exports['create']=function(_0x23c689,_0x684d0e){return db[_0x2c81('0x47')][_0x2c81('0x49')](_0x23c689[_0x2c81('0x2e')],{})[_0x2c81('0x17')](respondWithResult(_0x684d0e,0xc9))[_0x2c81('0x39')](handleError(_0x684d0e,null));};exports[_0x2c81('0x4a')]=function(_0x44f5ae,_0xfa20a5){if(_0x44f5ae[_0x2c81('0x2e')]['id']){delete _0x44f5ae[_0x2c81('0x2e')]['id'];}return db[_0x2c81('0x47')][_0x2c81('0x48')]({'where':{'id':_0x44f5ae[_0x2c81('0x3b')]['id']}})[_0x2c81('0x17')](handleEntityNotFound(_0xfa20a5,null))[_0x2c81('0x17')](saveUpdates(_0x44f5ae[_0x2c81('0x2e')],null))[_0x2c81('0x17')](respondWithResult(_0xfa20a5,null))['catch'](handleError(_0xfa20a5,null));};exports[_0x2c81('0x29')]=function(_0x5a9de6,_0x497373){return db[_0x2c81('0x47')][_0x2c81('0x48')]({'where':{'id':_0x5a9de6[_0x2c81('0x3b')]['id']}})['then'](handleEntityNotFound(_0x497373,null))[_0x2c81('0x17')](removeEntity(_0x497373,null))['catch'](handleError(_0x497373,null));};exports[_0x2c81('0x4b')]=function(_0x11ab98,_0x3f91c3){return db['ChatInteraction']['describe']()[_0x2c81('0x17')](respondWithResult(_0x3f91c3,null))[_0x2c81('0x39')](handleError(_0x3f91c3,null));};exports[_0x2c81('0x4c')]=function(_0x481dda,_0x487505){var _0x371514=_0x481dda['params']['id'];var _0x2f5fbd;var _0x328d0b;var _0x2e3be8;return db[_0x2c81('0x47')]['findOne']({'where':{'id':_0x371514}})[_0x2c81('0x17')](function(_0x53fd80){_0x2f5fbd=_0x53fd80;return db[_0x2c81('0x4d')][_0x2c81('0x4e')]({'where':{'id':_0x53fd80['ChatWebsiteId']},'attributes':['id',_0x2c81('0x4f'),_0x2c81('0x50'),_0x2c81('0x51'),'vidaooNote',_0x2c81('0x52')],'raw':!![]});})['then'](function(_0x4e1302){if(_0x4e1302&&_0x4e1302[_0x2c81('0x4f')]&&_0x4e1302[_0x2c81('0x50')]){_0x328d0b=_0x4e1302;var _0x554b49={'interaction':{'id':_0x371514},'agent':{'id':_0x481dda[_0x2c81('0x53')]['id'],'name':_0x481dda['user'][_0x2c81('0x2b')],'fullname':_0x481dda[_0x2c81('0x53')][_0x2c81('0x54')],'email':_0x481dda[_0x2c81('0x53')][_0x2c81('0x55')]},'contact':_0x481dda[_0x2c81('0x2e')][_0x2c81('0x2f')],'account':_0x481dda[_0x2c81('0x2e')][_0x2c81('0x32')]};var _0x545151={'rejectUnauthorized':![],'method':_0x2c81('0x56'),'url':_0x2c81('0x57'),'headers':{'X-APIKEY':_0x4e1302[_0x2c81('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x481dda[_0x2c81('0x53')]['email']],'buttons':null,'topic':_0x328d0b['vidaooTopic'],'note':_[_0x2c81('0x58')](_0x328d0b[_0x2c81('0x59')])?null:getMustacheRender(_0x328d0b[_0x2c81('0x59')],_0x554b49),'metadata':null},'redirect':_0x2c81('0x5a'),'json':!![]};try{if(!_['isNull'](_0x328d0b[_0x2c81('0x52')])){var _0x8898d2=getMustacheRender(_0x328d0b[_0x2c81('0x52')],_0x554b49);var _0x4c394b=JSON[_0x2c81('0x5b')](_0x8898d2);_0x545151[_0x2c81('0x2e')][_0x2c81('0x5c')]=_0x4c394b;}}catch(_0x4e405a){throw new db[(_0x2c81('0x5d'))]['ValidationError'](_0x2c81('0x5e'));}return rp(_0x545151);}else{throw new db[(_0x2c81('0x5d'))][(_0x2c81('0x5f'))](_0x2c81('0x60'));}})['then'](function(_0x5eb9d3){_0x2e3be8=_0x5eb9d3;if(_0x2e3be8['id']){var _0x166601={'body':_0x2e3be8['join_url'],'ChatWebsiteId':_0x328d0b['id'],'ChatInteractionId':_0x2f5fbd['id'],'direction':_0x2c81('0x61'),'UserId':_0x481dda[_0x2c81('0x53')]['id']};return db['ChatMessage'][_0x2c81('0x49')](_0x166601,{});}else{throw new db[(_0x2c81('0x5d'))]['ValidationError'](_0x2c81('0x62'));}})[_0x2c81('0x17')](function(){return _0x2f5fbd[_0x2c81('0x63')]({'vidaooSessionId':_0x2e3be8['id']});})[_0x2c81('0x17')](respondWithResult(_0x487505,null))[_0x2c81('0x39')](handleError(_0x487505,null));};exports[_0x2c81('0x64')]=function(_0x44024b,_0xe068ca){if(_0x44024b[_0x2c81('0x2e')]['id']){delete _0x44024b[_0x2c81('0x2e')]['id'];}return db[_0x2c81('0x47')][_0x2c81('0x48')]({'where':{'id':_0x44024b['params']['id']},'include':[{'model':db[_0x2c81('0x65')],'as':'Contact'}]})[_0x2c81('0x17')](handleEntityNotFound(_0xe068ca,null))[_0x2c81('0x17')](saveUpdates(_0x44024b['body'],null))[_0x2c81('0x17')](respondWithResult(_0xe068ca,null))[_0x2c81('0x39')](handleError(_0xe068ca,null));};exports[_0x2c81('0x66')]=function(_0x26cafa,_0x43c331){if(_0x26cafa['body']['id']){delete _0x26cafa[_0x2c81('0x2e')]['id'];}return db[_0x2c81('0x47')]['find']({'where':{'id':_0x26cafa[_0x2c81('0x3b')]['id']}})[_0x2c81('0x17')](function(_0x13ce38){if(!_0x13ce38){logger['error'](_0x2c81('0x67'),_0x2c81('0x66'),0x194,'entity\x20not\x20found');_0x43c331['sendStatus'](0x194);}else{if(_0x13ce38[_0x2c81('0x68')]){throw new db[(_0x2c81('0x5d'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x13ce38;})[_0x2c81('0x17')](function(_0x2889bc){if(_0x2889bc){return _0x2889bc[_0x2c81('0x4a')]({'closed':_0x26cafa['body'][_0x2c81('0x69')],'disposition':_0x26cafa[_0x2c81('0x2e')][_0x2c81('0x6a')]})[_0x2c81('0x17')](function(_0x2d18d7){return _0x2d18d7;});}})[_0x2c81('0x17')](function(){return respondWithRpcPromise(_0x2c81('0x6b'),_0x2c81('0x66'),_0x26cafa[_0x2c81('0x2e')],client9004);})[_0x2c81('0x17')](respondWithResult(_0x43c331,null))[_0x2c81('0x39')](handleError(_0x43c331,null));};exports[_0x2c81('0x6c')]=function(_0x32b606,_0x445f9f){_0x32b606['body'][_0x2c81('0x2b')]=_0x32b606[_0x2c81('0x6d')][_0x2c81('0x6e')];_0x32b606[_0x2c81('0x2e')][_0x2c81('0x6f')]=_0x32b606[_0x2c81('0x6d')][_0x2c81('0x70')];_0x32b606[_0x2c81('0x2e')][_0x2c81('0x37')]=_0x32b606[_0x2c81('0x6d')][_0x2c81('0x71')];return db[_0x2c81('0x72')][_0x2c81('0x49')](_0x32b606[_0x2c81('0x2e')])[_0x2c81('0x17')](respondWithResult(_0x445f9f,0xc9))[_0x2c81('0x39')](handleError(_0x445f9f,null));};exports[_0x2c81('0x73')]=function(_0x1294bd,_0x3338de){return db['ChatInteraction'][_0x2c81('0x4e')]({'where':{'id':_0x1294bd[_0x2c81('0x3b')]['id']},'raw':!![]})[_0x2c81('0x17')](handleEntityNotFound(_0x3338de,null))['then'](function(_0x57544b){if(_0x57544b){if(_0x57544b[_0x2c81('0x69')]){return _0x3338de[_0x2c81('0x28')](0x193)[_0x2c81('0x23')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x2c81('0x4e')]({'where':{'id':_0x1294bd['query'][_0x2c81('0x74')]},'raw':!![]})[_0x2c81('0x17')](handleEntityNotFound(_0x3338de,null));}})[_0x2c81('0x17')](function(_0x1c2896){if(_0x1c2896){var _0x16423e=_0x1c2896[_0x2c81('0x75')]!==null;var _0x58b1f9=path['join'](config[_0x2c81('0x76')],_0x2c81('0x77'));if(_0x16423e){_0x58b1f9=path['join'](_0x58b1f9,_0x2c81('0x78'));}var _0x1446fe=path[_0x2c81('0x79')](_0x58b1f9,_0x1c2896[_0x2c81('0x6f')]);return _0x3338de[_0x2c81('0x7a')](_0x1446fe);}})['catch'](handleError(_0x3338de,null));};exports[_0x2c81('0x7b')]=function(_0xfa17b2,_0x3e9d65){var _0x29116a=null;var _0x829364=null;var _0xec56f7=null;if(_0xfa17b2[_0x2c81('0x2e')]['id']){delete _0xfa17b2[_0x2c81('0x2e')]['id'];}if(_0xfa17b2[_0x2c81('0x2e')][_0x2c81('0x7c')]){_0xec56f7=path[_0x2c81('0x79')](config[_0x2c81('0x76')],_0x2c81('0x7d'),util['format'](_0x2c81('0x7e'),Date[_0x2c81('0x7f')]()));_0xfa17b2['body'][_0x2c81('0x80')]=_0xec56f7;}return db['ChatInteraction']['find']({'where':{'id':_0xfa17b2[_0x2c81('0x3b')]['id']},'include':[{'model':db[_0x2c81('0x81')],'as':_0x2c81('0x82'),'include':[{'model':db[_0x2c81('0x83')],'as':_0x2c81('0x83')}]}]})[_0x2c81('0x17')](handleEntityNotFound(_0x3e9d65,null))[_0x2c81('0x17')](saveUpdates(_0xfa17b2['body'],null))[_0x2c81('0x17')](function(_0x31034e){if(_0x31034e){_0x29116a=_0x31034e;return db[_0x2c81('0x4d')][_0x2c81('0x48')]({'where':{'id':_0x29116a[_0x2c81('0x84')]}});}})[_0x2c81('0x17')](function(_0x3b98af){if(_0x3b98af){_0x829364=_0x3b98af;return db[_0x2c81('0x65')][_0x2c81('0x48')]({'where':{'id':_0x29116a[_0x2c81('0x85')]}});}})['then'](function(_0xb46680){if(_0xb46680){if(_0xec56f7){var _0x2b71a1=null;for(var _0xca4b1e=0x1;_0xca4b1e<_0x29116a[_0x2c81('0x82')][_0x2c81('0x42')];++_0xca4b1e){_0x2b71a1=_0x29116a[_0x2c81('0x82')][_0xca4b1e];var _0x5eed35=_0x2b71a1[_0x2c81('0x68')]?util['format']('%s%d',_0x829364[_0x2c81('0x86')],_0x2b71a1[_0x2c81('0x68')]):_0x2c81('0x87');var _0x9d8ec9=_0xfa17b2[_0x2c81('0x2e')][_0x2c81('0x88')]||util[_0x2c81('0x89')]('%s%d',_0x2c81('0x8a'),_0x2b71a1[_0x2c81('0x85')]);switch(_0x829364[_0x2c81('0x8b')]){case'website_alias':_0x5eed35=_0x2b71a1[_0x2c81('0x68')]?util[_0x2c81('0x89')]('%s%d',_0x829364[_0x2c81('0x86')],_0x2b71a1['UserId']):_0x2c81('0x87');break;case _0x2c81('0x8c'):_0x5eed35=_0x2b71a1[_0x2c81('0x68')]?_0x2b71a1[_0x2c81('0x83')][_0x2c81('0x8d')]||_0x2b71a1[_0x2c81('0x83')][_0x2c81('0x54')]:_0x2c81('0x87');break;case'agent_fullname':_0x5eed35=_0x2b71a1[_0x2c81('0x68')]?_0x2b71a1[_0x2c81('0x83')][_0x2c81('0x54')]:'System';break;default:_0x5eed35=_0x2b71a1[_0x2c81('0x68')]?util['format'](_0x2c81('0x8e'),_0x829364[_0x2c81('0x86')],_0x2b71a1[_0x2c81('0x68')]):_0x2c81('0x87');}var _0x14eb14=util[_0x2c81('0x89')](_0x2c81('0x8f'),moment(_0x2b71a1[_0x2c81('0x90')])[_0x2c81('0x89')](_0x2c81('0x91')),_0x2b71a1['direction']==='in'?_0x9d8ec9:_0x5eed35,_0x2b71a1['body']);if(!_0x2b71a1[_0x2c81('0x92')]){fs['appendFileSync'](_0xec56f7,_0x14eb14);}}return db['MailAccount'][_0x2c81('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x2c81('0x93')],'as':_0x2c81('0x94'),'raw':!![],'include':[{'model':db[_0x2c81('0x95')],'as':_0x2c81('0x95'),'raw':!![]}]}]});}}})['then'](function(_0x27eb0f){if(!_0x27eb0f||!_0x27eb0f['Smtp']||!_0xfa17b2[_0x2c81('0x2e')])return _0x29116a;var _0x6ea3ae=_0x27eb0f[_0x2c81('0x96')]();return respondWithRpcPromise('SendMail',_0x2c81('0x97'),{'account':_0x6ea3ae,'message':{'from':util[_0x2c81('0x89')](_0x2c81('0x98'),_0x27eb0f['name'],_0x27eb0f[_0x2c81('0x55')]||_0x27eb0f[_0x2c81('0x94')][_0x2c81('0x53')]),'to':_0xfa17b2[_0x2c81('0x2e')][_0x2c81('0x7c')],'subject':_0x2c81('0x99'),'text':util[_0x2c81('0x89')](_0x2c81('0x9a'),_0xfa17b2[_0x2c81('0x2e')][_0x2c81('0x7c')]),'attachments':[{'path':_0xec56f7}]}})[_0x2c81('0x17')](function(){return _0x29116a;})['catch'](function(_0x5a5c62){logger[_0x2c81('0x1c')](_0x5a5c62);});})[_0x2c81('0x17')](respondWithStatusCode(_0x3e9d65,0xc8))[_0x2c81('0x39')](handleError(_0x3e9d65,null));};exports['addMessage']=function(_0x17aa03,_0x31debf){return db[_0x2c81('0x81')]['find']({'where':{'id':_0x17aa03[_0x2c81('0x3b')]['id']}})[_0x2c81('0x17')](handleEntityNotFound(_0x31debf,null))[_0x2c81('0x17')](function(_0x46e63a){if(_0x46e63a){return _0x46e63a[_0x2c81('0x9b')](_0x17aa03[_0x2c81('0x2e')][_0x2c81('0x9c')],_[_0x2c81('0x9d')](_0x17aa03[_0x2c81('0x2e')],[_0x2c81('0x9c'),'id'])||{});}})['then'](respondWithResult(_0x31debf,null))[_0x2c81('0x39')](handleError(_0x31debf,null));};exports[_0x2c81('0x9e')]=function(_0x449854,_0xbf2fba){var _0x59e407={'raw':![],'where':{}};var _0x4459ec={};var _0x43486b={'count':0x0,'rows':[]};return db[_0x2c81('0x47')]['findOne']({'where':{'id':_0x449854[_0x2c81('0x3b')]['id']}})[_0x2c81('0x17')](handleEntityNotFound(_0xbf2fba,null))[_0x2c81('0x17')](function(_0x3f7df9){if(_0x3f7df9){_0x4459ec['model']=_[_0x2c81('0x3d')](db[_0x2c81('0x81')]['rawAttributes']);_0x4459ec['query']=_[_0x2c81('0x3d')](_0x449854[_0x2c81('0x3e')]);_0x4459ec[_0x2c81('0x9f')]=_['intersection'](_0x4459ec[_0x2c81('0x3c')],_0x4459ec[_0x2c81('0x3e')]);_0x59e407['attributes']=_[_0x2c81('0x3f')](_0x4459ec[_0x2c81('0x3c')],qs[_0x2c81('0x40')](_0x449854[_0x2c81('0x3e')]['fields']));_0x59e407[_0x2c81('0x41')]=_0x59e407[_0x2c81('0x41')][_0x2c81('0x42')]?_0x59e407['attributes']:_0x4459ec[_0x2c81('0x3c')];if(!_0x449854[_0x2c81('0x3e')][_0x2c81('0xa0')](_0x2c81('0xa1'))){_0x59e407['limit']=qs[_0x2c81('0x25')](_0x449854[_0x2c81('0x3e')][_0x2c81('0x25')]);_0x59e407[_0x2c81('0x24')]=qs[_0x2c81('0x24')](_0x449854[_0x2c81('0x3e')][_0x2c81('0x24')]);}_0x59e407[_0x2c81('0xa2')]=qs['sort'](_0x449854[_0x2c81('0x3e')][_0x2c81('0xa3')]);_0x59e407[_0x2c81('0xa4')]=qs[_0x2c81('0x9f')](_[_0x2c81('0xa5')](_0x449854['query'],_0x4459ec['filters']));_0x59e407[_0x2c81('0xa4')]['ChatInteractionId']=_0x3f7df9['id'];if(_0x449854['query']['filter']){_0x59e407[_0x2c81('0xa4')]=_['merge'](_0x59e407[_0x2c81('0xa4')],{'$or':_[_0x2c81('0x34')](_0x59e407[_0x2c81('0x41')],function(_0x5a674a){var _0x150a9b={};_0x150a9b[_0x5a674a]={'$like':'%'+_0x449854['query']['filter']+'%'};return _0x150a9b;})});}if(_0x449854['query'][_0x2c81('0xa6')]){var _0x197530=_0x449854['query'][_0x2c81('0xa6')][_0x2c81('0xa7')](',');var _0x2ba35b={};_0x2ba35b[_0x197530[0x0]]={'$gte':moment(_0x197530[0x1])['format'](_0x2c81('0xa8'))};_0x59e407[_0x2c81('0xa4')]=_[_0x2c81('0x45')](_0x59e407[_0x2c81('0xa4')],_0x2ba35b);}_0x59e407=_[_0x2c81('0x45')]({},_0x59e407,_0x449854[_0x2c81('0x46')]);return db['ChatMessage'][_0x2c81('0x27')]({'where':_0x59e407[_0x2c81('0xa4')]})[_0x2c81('0x17')](function(_0x3bffcf){_0x43486b[_0x2c81('0x27')]=_0x3bffcf;if(_0x449854[_0x2c81('0x3e')]['includeAll']){_0x59e407['include']=[{'all':!![]}];}return db[_0x2c81('0x81')]['findAll'](_0x59e407);})[_0x2c81('0x17')](function(_0x22205a){_0x43486b[_0x2c81('0xa9')]=_0x22205a;return _0x43486b;});}})['then'](respondWithFilteredResult(_0xbf2fba,_0x59e407))[_0x2c81('0x39')](handleError(_0xbf2fba,null));};exports[_0x2c81('0xaa')]=function(_0xd884d8,_0x1edb89){var _0x4b5059={'where':{}},_0x2bbfb6={},_0x470780={'count':0x0,'rows':[]};return db[_0x2c81('0x47')]['findOne']({'where':{'id':_0xd884d8[_0x2c81('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1edb89,null))[_0x2c81('0x17')](function(_0x2e24ca){if(_0x2e24ca){_0x2bbfb6['model']=_[_0x2c81('0x3d')](db['ChatMessage']['rawAttributes']);_0x2bbfb6[_0x2c81('0x3e')]=_[_0x2c81('0x3d')](_0xd884d8[_0x2c81('0x3e')]);_0x2bbfb6[_0x2c81('0x9f')]=_[_0x2c81('0x3f')](_0x2bbfb6[_0x2c81('0x3c')],_0x2bbfb6[_0x2c81('0x3e')]);_0x4b5059[_0x2c81('0x41')]=_[_0x2c81('0x3f')](_0x2bbfb6[_0x2c81('0x3c')],qs[_0x2c81('0x40')](_0xd884d8[_0x2c81('0x3e')][_0x2c81('0x40')]));_0x4b5059['attributes']=_0x4b5059[_0x2c81('0x41')][_0x2c81('0x42')]?_0x4b5059['attributes']:_0x2bbfb6[_0x2c81('0x3c')];if(!_0xd884d8[_0x2c81('0x3e')][_0x2c81('0xa0')]('nolimit')){_0x4b5059[_0x2c81('0x25')]=qs[_0x2c81('0x25')](_0xd884d8[_0x2c81('0x3e')][_0x2c81('0x25')]);_0x4b5059[_0x2c81('0x24')]=qs[_0x2c81('0x24')](_0xd884d8[_0x2c81('0x3e')][_0x2c81('0x24')]);}_0x4b5059[_0x2c81('0xa2')]=qs[_0x2c81('0xa3')](_0xd884d8[_0x2c81('0x3e')]['sort']);_0x4b5059['where']=qs[_0x2c81('0x9f')](_[_0x2c81('0xa5')](_0xd884d8[_0x2c81('0x3e')],_0x2bbfb6[_0x2c81('0x9f')]));_0x4b5059[_0x2c81('0xa4')][_0x2c81('0xab')]=_0x2e24ca['id'];if(_0xd884d8[_0x2c81('0x3e')][_0x2c81('0xac')]){_0x4b5059[_0x2c81('0xa4')]=_['merge'](_0x4b5059['where'],{'$or':_[_0x2c81('0x34')](_0x4b5059[_0x2c81('0x41')],function(_0x2c6e39){var _0x40c65b={};_0x40c65b[_0x2c6e39]={'$like':'%'+_0xd884d8[_0x2c81('0x3e')][_0x2c81('0xac')]+'%'};return _0x40c65b;})});}_0x4b5059[_0x2c81('0xa4')][_0x2c81('0x92')]=![];if(_0xd884d8[_0x2c81('0x3e')]['id']){_0x4b5059[_0x2c81('0xa4')]['id']={'$gt':_0xd884d8[_0x2c81('0x3e')]['id']};}_0x4b5059=_[_0x2c81('0x45')]({},_0x4b5059,_0xd884d8[_0x2c81('0x46')]);return db[_0x2c81('0x81')][_0x2c81('0x27')]({'where':_0x4b5059['where']})[_0x2c81('0x17')](function(_0x43a4f8){_0x470780[_0x2c81('0x27')]=_0x43a4f8;_0x4b5059[_0x2c81('0x44')]=[];if(_0xd884d8[_0x2c81('0x3e')]['includeAgent']){_0x4b5059[_0x2c81('0x44')][_0x2c81('0xad')]({'model':db['User'],'as':_0x2c81('0x83'),'attributes':['id',_0x2c81('0x54'),_0x2c81('0x8d')]});}if(_0xd884d8[_0x2c81('0x3e')]['includeAll']){_0x4b5059[_0x2c81('0x44')]=[{'all':!![]}];}return db[_0x2c81('0x81')][_0x2c81('0x38')](_0x4b5059);})['then'](function(_0x16eafb){_0x470780[_0x2c81('0xa9')]=_0x16eafb;return _0x470780;});}})['then'](respondWithFilteredResult(_0x1edb89,_0x4b5059))['catch'](handleError(_0x1edb89,null));};exports[_0x2c81('0xae')]=function(_0x536d8d,_0x337919){return db[_0x2c81('0x47')]['find']({'where':{'id':_0x536d8d[_0x2c81('0x3b')]['id']}})[_0x2c81('0x17')](handleEntityNotFound(_0x337919,null))['then'](function(_0x6e391){if(_0x6e391){return _0x6e391['setTags'](_0x536d8d[_0x2c81('0x2e')][_0x2c81('0x9c')],_['omit'](_0x536d8d[_0x2c81('0x2e')],[_0x2c81('0x9c'),'id'])||{})[_0x2c81('0xaf')](function(){return db[_0x2c81('0xb0')][_0x2c81('0x38')]({'attributes':['id',_0x2c81('0x2b'),_0x2c81('0xb1')],'where':{'id':_0x536d8d[_0x2c81('0x2e')][_0x2c81('0x9c')]}});})[_0x2c81('0x17')](function(_0x55b2a9){socket[_0x2c81('0xb2')]('chatInteractionTags:save',{'id':Number(_0x536d8d[_0x2c81('0x3b')]['id']),'tags':_0x55b2a9||[]});return{'id':Number(_0x536d8d[_0x2c81('0x3b')]['id']),'tags':_0x55b2a9||[]};});}})[_0x2c81('0x17')](respondWithResult(_0x337919,null))[_0x2c81('0x39')](handleError(_0x337919,null));};exports[_0x2c81('0xb3')]=function(_0x1a19ed,_0x16cf24){return db['ChatInteraction'][_0x2c81('0x48')]({'where':{'id':_0x1a19ed[_0x2c81('0x3b')]['id']}})[_0x2c81('0x17')](handleEntityNotFound(_0x16cf24,null))[_0x2c81('0x17')](function(_0x4fdfdd){if(_0x4fdfdd){return _0x4fdfdd['removeTags'](_0x1a19ed['query'][_0x2c81('0x9c')]);}})[_0x2c81('0x17')](respondWithStatusCode(_0x16cf24,null))[_0x2c81('0x39')](handleError(_0x16cf24,null));};exports[_0x2c81('0x7a')]=function(_0x2c22e7,_0xf23ba9){var _0x3d3418=moment()['unix']()['toString']();var _0x43ec1e=path[_0x2c81('0x79')](config['root'],_0x2c81('0xb4'),_0x2c81('0xb5'),_0x2c81('0xb6'));var _0x48f479=path[_0x2c81('0x79')](config[_0x2c81('0x76')],_0x2c81('0xb4'),_0x2c81('0xb5'),_0x2c81('0xb7'));var _0x75f8a7=path[_0x2c81('0x79')](_0x43ec1e,_0x3d3418);var _0x8a873b=util[_0x2c81('0x89')](_0x2c81('0xb8'),_0x2c22e7[_0x2c81('0x3b')]['id'],_0x3d3418);var _0x5b2dba=path[_0x2c81('0x79')](_0x43ec1e,_0x8a873b);var _0x5ed7bc=[];_0x5ed7bc[_0x2c81('0xad')]({'model':db['User'],'as':'User','attributes':['id',_0x2c81('0x54')],'raw':!![]});_0x5ed7bc['push']({'model':db[_0x2c81('0x65')],'as':_0x2c81('0xb9'),'attributes':['id',_0x2c81('0xba'),_0x2c81('0xbb')],'raw':!![]});if(_0x2c22e7[_0x2c81('0x3e')][_0x2c81('0xb7')]){_0x5ed7bc[_0x2c81('0xad')]({'model':db[_0x2c81('0x72')],'as':_0x2c81('0x72'),'raw':!![]});}var _0x3f1bda=[{'model':db['ChatMessage'],'as':_0x2c81('0x82'),'attributes':['id',_0x2c81('0x2e'),'createdAt',_0x2c81('0xbc'),'secret','read'],'include':_0x5ed7bc}];_0x3f1bda['push']({'model':db[_0x2c81('0x4d')],'as':_0x2c81('0xbd'),'attributes':['id',_0x2c81('0x2b')]});_0x3f1bda[_0x2c81('0xad')]({'model':db['User'],'as':_0x2c81('0xbe'),'attributes':['id','fullname']});return db[_0x2c81('0x47')][_0x2c81('0x48')]({'where':{'id':_0x2c22e7[_0x2c81('0x3b')]['id']},'include':_0x3f1bda})['then'](handleEntityNotFound(_0xf23ba9,null))[_0x2c81('0x17')](function(_0x336018){if(_0x336018){var _0x162646=_0x336018[_0x2c81('0xbf')]({'plain':!![]});fs[_0x2c81('0xc0')](_0x75f8a7);var _0x4ca785={'channel':_0x2c81('0xc1'),'account':_0x162646[_0x2c81('0xbd')]['name'],'agent':_0x162646['Owner']?_0x162646['Owner'][_0x2c81('0x54')]:_0x2c81('0xc2'),'createdAt':moment(_0x162646[_0x2c81('0x90')])[_0x2c81('0x89')](_0x2c81('0xa8'))['toString'](),'closedAt':_0x162646[_0x2c81('0x69')]?moment(_0x162646[_0x2c81('0xc3')])['format'](_0x2c81('0xa8'))[_0x2c81('0xc4')]():'','disposition':_0x162646[_0x2c81('0x6a')],'chatInfo':{'browser':_0x162646[_0x2c81('0xc5')],'os':_0x162646[_0x2c81('0xc6')],'referer':_0x162646['referer'],'customerIp':_0x162646['customerIp'],'customerPort':_0x162646[_0x2c81('0xc7')]?_0x162646[_0x2c81('0xc7')]:'N.A.'},'messages':_(_0x162646[_0x2c81('0x82')])[_0x2c81('0xc8')]()[_0x2c81('0xac')]({'secret':![]})[_0x2c81('0x34')](function(_0x5e1b23){if(_0x5e1b23[_0x2c81('0x72')]){var _0x7fdfe6=path['join'](_0x48f479,_0x5e1b23['Attachment'][_0x2c81('0x6f')]);if(fs[_0x2c81('0xc9')](_0x7fdfe6)){fs[_0x2c81('0xca')](_0x7fdfe6)[_0x2c81('0xcb')](fs[_0x2c81('0xcc')](path[_0x2c81('0x79')](_0x75f8a7,_0x5e1b23[_0x2c81('0x72')][_0x2c81('0x6f')])));}}return{'date':moment(_0x5e1b23['createdAt'])[_0x2c81('0x89')](_0x2c81('0xa8'))[_0x2c81('0xc4')](),'sender':_0x5e1b23[_0x2c81('0xbc')]===_0x2c81('0x61')?_0x5e1b23['User']?_0x5e1b23[_0x2c81('0x83')][_0x2c81('0x54')]:_0x2c81('0x87'):_0x5e1b23[_0x2c81('0xb9')][_0x2c81('0xba')]+(_0x5e1b23[_0x2c81('0xb9')]['lastName']?'\x20'+_0x5e1b23['Contact'][_0x2c81('0xbb')]:''),'body':_0x5e1b23[_0x2c81('0x72')]?_0x5e1b23['Attachment'][_0x2c81('0x6f')]:_0x5e1b23[_0x2c81('0x2e')],'direction':_0x5e1b23[_0x2c81('0xbc')]===_0x2c81('0x61')?'A':'C','secret':_0x5e1b23[_0x2c81('0x92')],'read':_0x5e1b23['read'],'attachment':_0x5e1b23['Attachment']};})[_0x2c81('0xcd')]()};return ejs[_0x2c81('0xce')](path['join'](config[_0x2c81('0x76')],_0x2c81('0xb4'),_0x2c81('0xcf'),_0x2c81('0xd0')),{'interaction':_0x4ca785})[_0x2c81('0x17')](function(_0x1c05b2){var _0x20d06d=path[_0x2c81('0x79')](_0x75f8a7,_0x2c81('0xd1')+_0x162646['id']+'-'+_0x3d3418+_0x2c81('0xd2'));var _0xd3637c={'path':_0x20d06d,'channel':_0x2c81('0xc1'),'interactionId':_0x162646['id']};return pdf[_0x2c81('0xd3')](_0x1c05b2,_0xd3637c);})[_0x2c81('0x17')](function(){return new Promise(function(_0x39d415,_0x1dbf95){zipdir(_0x75f8a7,{'saveTo':_0x5b2dba},function(_0x379c7a,_0x3e7be0){if(_0x379c7a)return _0x1dbf95(_0x379c7a);return _0x39d415(_0x3e7be0);});})['then'](function(){return new BPromise(function(_0x322aaa,_0x3ef971){rimraf(_0x75f8a7,function(_0x54af54){if(_0x54af54)_0x3ef971(_0x54af54);return _0x322aaa();});});})[_0x2c81('0x17')](function(){return _0xf23ba9['download'](_0x5b2dba,_0x8a873b,function(_0x4421a3){if(_0x4421a3){logger[_0x2c81('0x1c')](_0x2c81('0xd4'),_0x4421a3);}else{fs[_0x2c81('0xd5')](_0x5b2dba);}});});});}else{return _0xf23ba9['sendStatus'](0xc8);}})[_0x2c81('0x39')](handleError(_0xf23ba9,null));};
\ No newline at end of file
+var _0xb756=['Account','Owner','Chat','N.A.','osName','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','lastName','renderFile','views','transcript-','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','http','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','sendStatus','end','status','json','offset','limit','undefined','set','stack','send','render','merge','body','agent','interaction','account','index','map','ChatInteraction','fieldName','type','getOptions','findAll','chat','query','show','params','model','rawAttributes','intersection','fields','attributes','length','includeAll','include','options','find','create','update','destroy','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooNote','vidaooMetadata','vidaooApiKey','user','name','fullname','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','metadata','Sequelize','ValidationError','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','basename','mimetype','closed','Attachment','attachId','ChatOfflineMessageId','join','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','ContactId','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','keys','hasOwnProperty','nolimit','order','sort','where','filters','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','count','getMyMessages','pick','includeAgent','push','rows','addTags','setTags','ids','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','transcript-%d-%s.zip','firstName','attachments','read'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xb756,0x1ad));var _0x6b75=function(_0x452cc3,_0x3bca5c){_0x452cc3=_0x452cc3-0x0;var _0x10bd3e=_0xb756[_0x452cc3];return _0x10bd3e;};'use strict';var rimraf=require(_0x6b75('0x0'));var zipdir=require(_0x6b75('0x1'));var rp=require(_0x6b75('0x2'));var moment=require(_0x6b75('0x3'));var BPromise=require(_0x6b75('0x4'));var Mustache=require(_0x6b75('0x5'));var util=require('util');var path=require(_0x6b75('0x6'));var ejs=require(_0x6b75('0x7'));var fs=require('fs');var _=require(_0x6b75('0x8'));var Redis=require('ioredis');var interaction=require(_0x6b75('0x9'));var qs=require(_0x6b75('0xa'));var pdf=require('../../components/export/pdf');var logger=require(_0x6b75('0xb'))(_0x6b75('0xc'));var config=require(_0x6b75('0xd'));var db=require(_0x6b75('0xe'))['db'];config[_0x6b75('0xf')]=_[_0x6b75('0x10')](config[_0x6b75('0xf')],{'host':_0x6b75('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6b75('0x12'))[_0x6b75('0x13')](socket);var jayson=require(_0x6b75('0x14'));var client=jayson['client'][_0x6b75('0x15')]({'port':0x232b});var client9004=jayson['client'][_0x6b75('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x1f49d2,_0x518073,_0x2b8fdc,_0x5a4bcd){return new BPromise(function(_0x233d4c,_0xa542ab){var _0x9f95c6=_0x5a4bcd||client;return _0x9f95c6['request'](_0x1f49d2,_0x2b8fdc)[_0x6b75('0x16')](function(_0x18d73d){logger[_0x6b75('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x518073,_0x6b75('0x18'));logger[_0x6b75('0x19')](_0x6b75('0x1a'),_0x518073,_0x6b75('0x18'),JSON[_0x6b75('0x1b')](_0x18d73d));if(_0x18d73d[_0x6b75('0x1c')]){if(_0x18d73d[_0x6b75('0x1c')][_0x6b75('0x1d')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x518073,_0x18d73d[_0x6b75('0x1c')][_0x6b75('0x1e')]);return _0xa542ab(_0x18d73d[_0x6b75('0x1c')][_0x6b75('0x1e')]);}logger['error'](_0x6b75('0x1f'),_0x518073,_0x18d73d[_0x6b75('0x1c')][_0x6b75('0x1e')]);return _0x233d4c(_0x18d73d[_0x6b75('0x1c')][_0x6b75('0x1e')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x518073,_0x6b75('0x18'));_0x233d4c(_0x18d73d[_0x6b75('0x20')][_0x6b75('0x1e')]);}})[_0x6b75('0x21')](function(_0xe8fe47){logger[_0x6b75('0x1c')](_0x6b75('0x1f'),_0x518073,_0xe8fe47);_0xa542ab(_0xe8fe47);});});}function respondWithStatusCode(_0xa272b1,_0x12c6f4){_0x12c6f4=_0x12c6f4||0xcc;return function(_0x45b8cf){if(_0x45b8cf){return _0xa272b1[_0x6b75('0x22')](_0x12c6f4);}return _0xa272b1['status'](_0x12c6f4)[_0x6b75('0x23')]();};}function respondWithResult(_0x3e237a,_0x61ddc1){_0x61ddc1=_0x61ddc1||0xc8;return function(_0x34b331){if(_0x34b331){return _0x3e237a[_0x6b75('0x24')](_0x61ddc1)[_0x6b75('0x25')](_0x34b331);}};}function respondWithFilteredResult(_0x39eeec,_0x227981){return function(_0x2b96f4){if(_0x2b96f4){var _0x100558=typeof _0x227981[_0x6b75('0x26')]==='undefined'&&typeof _0x227981[_0x6b75('0x27')]===_0x6b75('0x28');var _0x28ac45=_0x2b96f4['count'];var _0x3e6788=_0x100558?0x0:_0x227981[_0x6b75('0x26')];var _0x146ee3=_0x100558?_0x2b96f4['count']:_0x227981[_0x6b75('0x26')]+_0x227981['limit'];var _0x4deda9;if(_0x146ee3>=_0x28ac45){_0x146ee3=_0x28ac45;_0x4deda9=0xc8;}else{_0x4deda9=0xce;}_0x39eeec[_0x6b75('0x24')](_0x4deda9);return _0x39eeec[_0x6b75('0x29')]('Content-Range',_0x3e6788+'-'+_0x146ee3+'/'+_0x28ac45)[_0x6b75('0x25')](_0x2b96f4);}return null;};}function saveUpdates(_0xd36dd5){return function(_0x3a36fc){if(_0x3a36fc){return _0x3a36fc['update'](_0xd36dd5)['then'](function(_0xe64f4a){return _0xe64f4a;});}return null;};}function removeEntity(_0x4ccfe2){return function(_0x352468){if(_0x352468){return _0x352468['destroy']()[_0x6b75('0x16')](function(){_0x4ccfe2[_0x6b75('0x24')](0xcc)[_0x6b75('0x23')]();});}};}function handleEntityNotFound(_0xa0e51f){return function(_0x2d259e){if(!_0x2d259e){_0xa0e51f[_0x6b75('0x22')](0x194);}return _0x2d259e;};}function handleError(_0x43d801,_0xb9a32e){_0xb9a32e=_0xb9a32e||0x1f4;return function(_0x3ff043){logger['error'](_0x3ff043[_0x6b75('0x2a')]);if(_0x3ff043['name']){delete _0x3ff043['name'];}_0x43d801['status'](_0xb9a32e)[_0x6b75('0x2b')](_0x3ff043);};}function getMustacheRender(_0x36e811,_0x534e63){return Mustache[_0x6b75('0x2c')](_0x36e811,_[_0x6b75('0x2d')](_0x534e63[_0x6b75('0x2e')],{'contact':_0x534e63['contact'],'message':_0x534e63[_0x6b75('0x1e')],'agent':_0x534e63[_0x6b75('0x2f')],'interaction':_0x534e63[_0x6b75('0x30')],'account':_0x534e63[_0x6b75('0x31')]}))||'';}exports[_0x6b75('0x32')]=function(_0x4ec2e1,_0x1f9e83){var _0x4327e9={};var _0x3c0044=_[_0x6b75('0x33')](db[_0x6b75('0x34')]['rawAttributes'],function(_0x358725){return{'name':_0x358725[_0x6b75('0x35')],'type':_0x358725[_0x6b75('0x36')]['key']};});_0x4327e9=qs[_0x6b75('0x37')](_0x3c0044,_0x4ec2e1);return interaction[_0x6b75('0x38')](_0x6b75('0x39'),_0x4ec2e1[_0x6b75('0x3a')],_0x4ec2e1['user'],_0x4327e9,_0x3c0044)[_0x6b75('0x16')](respondWithFilteredResult(_0x1f9e83,_0x4327e9))[_0x6b75('0x21')](handleError(_0x1f9e83,null));};exports[_0x6b75('0x3b')]=function(_0x369a18,_0x271ec5){var _0x22bf49={'raw':![],'where':{'id':_0x369a18[_0x6b75('0x3c')]['id']}},_0x2945b6={};_0x2945b6[_0x6b75('0x3d')]=_['keys'](db[_0x6b75('0x34')][_0x6b75('0x3e')]);_0x2945b6[_0x6b75('0x3a')]=_['keys'](_0x369a18['query']);_0x2945b6['filters']=_[_0x6b75('0x3f')](_0x2945b6[_0x6b75('0x3d')],_0x2945b6['query']);_0x22bf49['attributes']=_[_0x6b75('0x3f')](_0x2945b6['model'],qs[_0x6b75('0x40')](_0x369a18[_0x6b75('0x3a')][_0x6b75('0x40')]));_0x22bf49['attributes']=_0x22bf49[_0x6b75('0x41')][_0x6b75('0x42')]?_0x22bf49['attributes']:_0x2945b6[_0x6b75('0x3d')];if(_0x369a18[_0x6b75('0x3a')][_0x6b75('0x43')]){_0x22bf49[_0x6b75('0x44')]=[{'all':!![]}];}_0x22bf49=_[_0x6b75('0x2d')]({},_0x22bf49,_0x369a18[_0x6b75('0x45')]);return db[_0x6b75('0x34')][_0x6b75('0x46')](_0x22bf49)[_0x6b75('0x16')](handleEntityNotFound(_0x271ec5,null))[_0x6b75('0x16')](respondWithResult(_0x271ec5,null))[_0x6b75('0x21')](handleError(_0x271ec5,null));};exports[_0x6b75('0x47')]=function(_0x58374b,_0xb4f0d5){return db[_0x6b75('0x34')]['create'](_0x58374b[_0x6b75('0x2e')],{})['then'](respondWithResult(_0xb4f0d5,0xc9))['catch'](handleError(_0xb4f0d5,null));};exports[_0x6b75('0x48')]=function(_0x53d787,_0x394248){if(_0x53d787[_0x6b75('0x2e')]['id']){delete _0x53d787[_0x6b75('0x2e')]['id'];}return db[_0x6b75('0x34')][_0x6b75('0x46')]({'where':{'id':_0x53d787[_0x6b75('0x3c')]['id']}})[_0x6b75('0x16')](handleEntityNotFound(_0x394248,null))[_0x6b75('0x16')](saveUpdates(_0x53d787[_0x6b75('0x2e')],null))[_0x6b75('0x16')](respondWithResult(_0x394248,null))['catch'](handleError(_0x394248,null));};exports[_0x6b75('0x49')]=function(_0xd056e0,_0x53fef3){return db[_0x6b75('0x34')]['find']({'where':{'id':_0xd056e0[_0x6b75('0x3c')]['id']}})[_0x6b75('0x16')](handleEntityNotFound(_0x53fef3,null))['then'](removeEntity(_0x53fef3,null))[_0x6b75('0x21')](handleError(_0x53fef3,null));};exports['describe']=function(_0x15f41e,_0x42f0ca){return db[_0x6b75('0x34')][_0x6b75('0x4a')]()[_0x6b75('0x16')](respondWithResult(_0x42f0ca,null))[_0x6b75('0x21')](handleError(_0x42f0ca,null));};exports['createVidaooSession']=function(_0x4599e0,_0x1f2cc0){var _0x1379fc=_0x4599e0[_0x6b75('0x3c')]['id'];var _0x13094a;var _0x343e79;var _0x57efa5;return db[_0x6b75('0x34')][_0x6b75('0x4b')]({'where':{'id':_0x1379fc}})[_0x6b75('0x16')](function(_0x2dc813){_0x13094a=_0x2dc813;return db[_0x6b75('0x4c')][_0x6b75('0x4b')]({'where':{'id':_0x2dc813[_0x6b75('0x4d')]},'attributes':['id','vidaooApiKey',_0x6b75('0x4e'),'vidaooTopic',_0x6b75('0x4f'),_0x6b75('0x50')],'raw':!![]});})['then'](function(_0x193aaf){if(_0x193aaf&&_0x193aaf[_0x6b75('0x51')]&&_0x193aaf[_0x6b75('0x4e')]){_0x343e79=_0x193aaf;var _0x5990bd={'interaction':{'id':_0x1379fc},'agent':{'id':_0x4599e0[_0x6b75('0x52')]['id'],'name':_0x4599e0[_0x6b75('0x52')][_0x6b75('0x53')],'fullname':_0x4599e0['user'][_0x6b75('0x54')],'email':_0x4599e0[_0x6b75('0x52')]['email']},'contact':_0x4599e0['body'][_0x6b75('0x55')],'account':_0x4599e0['body'][_0x6b75('0x31')]};var _0xe07baa={'rejectUnauthorized':![],'method':_0x6b75('0x56'),'url':_0x6b75('0x57'),'headers':{'X-APIKEY':_0x193aaf[_0x6b75('0x51')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4599e0['user']['email']],'buttons':null,'topic':_0x343e79['vidaooTopic'],'note':_[_0x6b75('0x58')](_0x343e79[_0x6b75('0x4f')])?null:getMustacheRender(_0x343e79[_0x6b75('0x4f')],_0x5990bd),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x6b75('0x58')](_0x343e79[_0x6b75('0x50')])){var _0x3e4b53=getMustacheRender(_0x343e79[_0x6b75('0x50')],_0x5990bd);var _0x37a5f2=JSON[_0x6b75('0x59')](_0x3e4b53);_0xe07baa[_0x6b75('0x2e')][_0x6b75('0x5a')]=_0x37a5f2;}}catch(_0x306dbe){throw new db[(_0x6b75('0x5b'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xe07baa);}else{throw new db[(_0x6b75('0x5b'))][(_0x6b75('0x5c'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x6b75('0x16')](function(_0x428437){_0x57efa5=_0x428437;if(_0x57efa5['id']){var _0x5af184={'body':_0x57efa5[_0x6b75('0x5d')],'ChatWebsiteId':_0x343e79['id'],'ChatInteractionId':_0x13094a['id'],'direction':_0x6b75('0x5e'),'UserId':_0x4599e0[_0x6b75('0x52')]['id']};return db[_0x6b75('0x5f')]['create'](_0x5af184,{});}else{throw new db[(_0x6b75('0x5b'))]['ValidationError'](_0x6b75('0x60'));}})['then'](function(){return _0x13094a[_0x6b75('0x61')]({'vidaooSessionId':_0x57efa5['id']});})[_0x6b75('0x16')](respondWithResult(_0x1f2cc0,null))[_0x6b75('0x21')](handleError(_0x1f2cc0,null));};exports[_0x6b75('0x62')]=function(_0x1e3b2d,_0xc7bfd6){if(_0x1e3b2d[_0x6b75('0x2e')]['id']){delete _0x1e3b2d[_0x6b75('0x2e')]['id'];}return db[_0x6b75('0x34')][_0x6b75('0x46')]({'where':{'id':_0x1e3b2d[_0x6b75('0x3c')]['id']},'include':[{'model':db[_0x6b75('0x63')],'as':_0x6b75('0x64')}]})[_0x6b75('0x16')](handleEntityNotFound(_0xc7bfd6,null))[_0x6b75('0x16')](saveUpdates(_0x1e3b2d[_0x6b75('0x2e')],null))[_0x6b75('0x16')](respondWithResult(_0xc7bfd6,null))[_0x6b75('0x21')](handleError(_0xc7bfd6,null));};exports[_0x6b75('0x65')]=function(_0x5b4c50,_0x4a3e72){if(_0x5b4c50[_0x6b75('0x2e')]['id']){delete _0x5b4c50[_0x6b75('0x2e')]['id'];}return db[_0x6b75('0x34')][_0x6b75('0x46')]({'where':{'id':_0x5b4c50[_0x6b75('0x3c')]['id']}})['then'](function(_0x2eb25a){if(!_0x2eb25a){logger[_0x6b75('0x1c')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x6b75('0x65'),0x194,'entity\x20not\x20found');_0x4a3e72['sendStatus'](0x194);}else{if(_0x2eb25a[_0x6b75('0x66')]){throw new db[(_0x6b75('0x5b'))][(_0x6b75('0x5c'))](_0x6b75('0x67'));}}return _0x2eb25a;})[_0x6b75('0x16')](function(_0x4f2c18){if(_0x4f2c18){return _0x4f2c18[_0x6b75('0x48')]({'closed':_0x5b4c50['body']['closed'],'disposition':_0x5b4c50['body'][_0x6b75('0x68')]})['then'](function(_0x38ac48){return _0x38ac48;});}})[_0x6b75('0x16')](function(){return respondWithRpcPromise(_0x6b75('0x69'),_0x6b75('0x65'),_0x5b4c50[_0x6b75('0x2e')],client9004);})[_0x6b75('0x16')](respondWithResult(_0x4a3e72,null))[_0x6b75('0x21')](handleError(_0x4a3e72,null));};exports[_0x6b75('0x6a')]=function(_0x6920a6,_0x33215b){_0x6920a6['body'][_0x6b75('0x53')]=_0x6920a6[_0x6b75('0x6b')]['originalname'];_0x6920a6['body'][_0x6b75('0x6c')]=_0x6920a6[_0x6b75('0x6b')]['filename'];_0x6920a6[_0x6b75('0x2e')][_0x6b75('0x36')]=_0x6920a6[_0x6b75('0x6b')][_0x6b75('0x6d')];return db['Attachment']['create'](_0x6920a6[_0x6b75('0x2e')])[_0x6b75('0x16')](respondWithResult(_0x33215b,0xc9))[_0x6b75('0x21')](handleError(_0x33215b,null));};exports['attachmentDownload']=function(_0x3fd977,_0x2f296c){return db[_0x6b75('0x34')]['findOne']({'where':{'id':_0x3fd977[_0x6b75('0x3c')]['id']},'raw':!![]})[_0x6b75('0x16')](handleEntityNotFound(_0x2f296c,null))[_0x6b75('0x16')](function(_0x154093){if(_0x154093){if(_0x154093[_0x6b75('0x6e')]){return _0x2f296c[_0x6b75('0x24')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0x6b75('0x6f')][_0x6b75('0x4b')]({'where':{'id':_0x3fd977[_0x6b75('0x3a')][_0x6b75('0x70')]},'raw':!![]})['then'](handleEntityNotFound(_0x2f296c,null));}})['then'](function(_0x3b6e0b){if(_0x3b6e0b){var _0x41053b=_0x3b6e0b[_0x6b75('0x71')]!==null;var _0x15d271=path[_0x6b75('0x72')](config['root'],'server/files/attachments/');if(_0x41053b){_0x15d271=path['join'](_0x15d271,_0x6b75('0x73'));}var _0x1253cd=path[_0x6b75('0x72')](_0x15d271,_0x3b6e0b[_0x6b75('0x6c')]);return _0x2f296c[_0x6b75('0x74')](_0x1253cd);}})[_0x6b75('0x21')](handleError(_0x2f296c,null));};exports[_0x6b75('0x75')]=function(_0xd0e87f,_0x237d49){var _0x15f925=null;var _0x2f609b=null;var _0x299e00=null;if(_0xd0e87f[_0x6b75('0x2e')]['id']){delete _0xd0e87f['body']['id'];}if(_0xd0e87f[_0x6b75('0x2e')][_0x6b75('0x76')]){_0x299e00=path[_0x6b75('0x72')](config[_0x6b75('0x77')],_0x6b75('0x78'),util[_0x6b75('0x79')](_0x6b75('0x7a'),Date[_0x6b75('0x7b')]()));_0xd0e87f[_0x6b75('0x2e')][_0x6b75('0x7c')]=_0x299e00;}return db['ChatInteraction'][_0x6b75('0x46')]({'where':{'id':_0xd0e87f[_0x6b75('0x3c')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db['User'],'as':_0x6b75('0x7d')}]}]})[_0x6b75('0x16')](handleEntityNotFound(_0x237d49,null))[_0x6b75('0x16')](saveUpdates(_0xd0e87f[_0x6b75('0x2e')],null))[_0x6b75('0x16')](function(_0x5504bd){if(_0x5504bd){_0x15f925=_0x5504bd;return db[_0x6b75('0x4c')][_0x6b75('0x46')]({'where':{'id':_0x15f925[_0x6b75('0x4d')]}});}})[_0x6b75('0x16')](function(_0x2915ba){if(_0x2915ba){_0x2f609b=_0x2915ba;return db['CmContact'][_0x6b75('0x46')]({'where':{'id':_0x15f925[_0x6b75('0x7e')]}});}})['then'](function(_0x7ca95b){if(_0x7ca95b){if(_0x299e00){var _0x635251=null;for(var _0x5bcefd=0x1;_0x5bcefd<_0x15f925[_0x6b75('0x7f')]['length'];++_0x5bcefd){_0x635251=_0x15f925[_0x6b75('0x7f')][_0x5bcefd];var _0x3567a9=_0x635251['UserId']?util[_0x6b75('0x79')](_0x6b75('0x80'),_0x2f609b[_0x6b75('0x81')],_0x635251[_0x6b75('0x66')]):_0x6b75('0x82');var _0x5ad712=_0xd0e87f[_0x6b75('0x2e')][_0x6b75('0x83')]||util[_0x6b75('0x79')](_0x6b75('0x80'),_0x6b75('0x84'),_0x635251[_0x6b75('0x7e')]);switch(_0x2f609b[_0x6b75('0x85')]){case _0x6b75('0x86'):_0x3567a9=_0x635251[_0x6b75('0x66')]?util['format'](_0x6b75('0x80'),_0x2f609b[_0x6b75('0x81')],_0x635251[_0x6b75('0x66')]):'System';break;case _0x6b75('0x87'):_0x3567a9=_0x635251[_0x6b75('0x66')]?_0x635251['User'][_0x6b75('0x88')]||_0x635251[_0x6b75('0x7d')][_0x6b75('0x54')]:_0x6b75('0x82');break;case _0x6b75('0x89'):_0x3567a9=_0x635251['UserId']?_0x635251[_0x6b75('0x7d')][_0x6b75('0x54')]:_0x6b75('0x82');break;default:_0x3567a9=_0x635251[_0x6b75('0x66')]?util[_0x6b75('0x79')](_0x6b75('0x80'),_0x2f609b['agentAlias'],_0x635251[_0x6b75('0x66')]):_0x6b75('0x82');}var _0x4395bf=util[_0x6b75('0x79')]('[%s]\x20%s:\x20%s\x0a',moment(_0x635251[_0x6b75('0x8a')])[_0x6b75('0x79')](_0x6b75('0x8b')),_0x635251[_0x6b75('0x8c')]==='in'?_0x5ad712:_0x3567a9,_0x635251[_0x6b75('0x2e')]);if(!_0x635251[_0x6b75('0x8d')]){fs[_0x6b75('0x8e')](_0x299e00,_0x4395bf);}}return db[_0x6b75('0x8f')][_0x6b75('0x4b')]({'where':{'service':!![]},'include':[{'model':db[_0x6b75('0x90')],'as':_0x6b75('0x91'),'raw':!![],'include':[{'model':db[_0x6b75('0x92')],'as':_0x6b75('0x92'),'raw':!![]}]}]});}}})[_0x6b75('0x16')](function(_0x3d4095){if(!_0x3d4095||!_0x3d4095[_0x6b75('0x91')]||!_0xd0e87f[_0x6b75('0x2e')])return _0x15f925;var _0x5c84c5=_0x3d4095[_0x6b75('0x93')]();return respondWithRpcPromise(_0x6b75('0x94'),_0x6b75('0x95'),{'account':_0x5c84c5,'message':{'from':util['format'](_0x6b75('0x96'),_0x3d4095[_0x6b75('0x53')],_0x3d4095['email']||_0x3d4095['Smtp'][_0x6b75('0x52')]),'to':_0xd0e87f[_0x6b75('0x2e')][_0x6b75('0x76')],'subject':_0x6b75('0x97'),'text':util['format'](_0x6b75('0x98'),_0xd0e87f[_0x6b75('0x2e')][_0x6b75('0x76')]),'attachments':[{'path':_0x299e00}]}})['then'](function(){return _0x15f925;})[_0x6b75('0x21')](function(_0x57d6e0){logger[_0x6b75('0x1c')](_0x57d6e0);});})[_0x6b75('0x16')](respondWithStatusCode(_0x237d49,0xc8))[_0x6b75('0x21')](handleError(_0x237d49,null));};exports[_0x6b75('0x99')]=function(_0x27ba08,_0x1df24d){return db[_0x6b75('0x5f')][_0x6b75('0x46')]({'where':{'id':_0x27ba08[_0x6b75('0x3c')]['id']}})[_0x6b75('0x16')](handleEntityNotFound(_0x1df24d,null))[_0x6b75('0x16')](function(_0x3b3e48){if(_0x3b3e48){return _0x3b3e48[_0x6b75('0x99')](_0x27ba08[_0x6b75('0x2e')]['ids'],_[_0x6b75('0x9a')](_0x27ba08['body'],['ids','id'])||{});}})[_0x6b75('0x16')](respondWithResult(_0x1df24d,null))['catch'](handleError(_0x1df24d,null));};exports['getMessages']=function(_0x15cb5a,_0x1fabea){var _0x5c12f9={'raw':![],'where':{}};var _0x592c5a={};var _0x1e3a31={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x6b75('0x4b')]({'where':{'id':_0x15cb5a[_0x6b75('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1fabea,null))[_0x6b75('0x16')](function(_0x37bfa8){if(_0x37bfa8){_0x592c5a[_0x6b75('0x3d')]=_['keys'](db[_0x6b75('0x5f')][_0x6b75('0x3e')]);_0x592c5a[_0x6b75('0x3a')]=_[_0x6b75('0x9b')](_0x15cb5a['query']);_0x592c5a['filters']=_[_0x6b75('0x3f')](_0x592c5a[_0x6b75('0x3d')],_0x592c5a[_0x6b75('0x3a')]);_0x5c12f9[_0x6b75('0x41')]=_[_0x6b75('0x3f')](_0x592c5a[_0x6b75('0x3d')],qs[_0x6b75('0x40')](_0x15cb5a[_0x6b75('0x3a')]['fields']));_0x5c12f9[_0x6b75('0x41')]=_0x5c12f9[_0x6b75('0x41')][_0x6b75('0x42')]?_0x5c12f9[_0x6b75('0x41')]:_0x592c5a[_0x6b75('0x3d')];if(!_0x15cb5a['query'][_0x6b75('0x9c')](_0x6b75('0x9d'))){_0x5c12f9[_0x6b75('0x27')]=qs[_0x6b75('0x27')](_0x15cb5a[_0x6b75('0x3a')][_0x6b75('0x27')]);_0x5c12f9[_0x6b75('0x26')]=qs[_0x6b75('0x26')](_0x15cb5a[_0x6b75('0x3a')][_0x6b75('0x26')]);}_0x5c12f9[_0x6b75('0x9e')]=qs[_0x6b75('0x9f')](_0x15cb5a['query'][_0x6b75('0x9f')]);_0x5c12f9[_0x6b75('0xa0')]=qs[_0x6b75('0xa1')](_['pick'](_0x15cb5a['query'],_0x592c5a[_0x6b75('0xa1')]));_0x5c12f9['where'][_0x6b75('0xa2')]=_0x37bfa8['id'];if(_0x15cb5a['query'][_0x6b75('0xa3')]){_0x5c12f9[_0x6b75('0xa0')]=_[_0x6b75('0x2d')](_0x5c12f9[_0x6b75('0xa0')],{'$or':_[_0x6b75('0x33')](_0x5c12f9['attributes'],function(_0x5c718e){var _0x5c39a6={};_0x5c39a6[_0x5c718e]={'$like':'%'+_0x15cb5a['query'][_0x6b75('0xa3')]+'%'};return _0x5c39a6;})});}if(_0x15cb5a['query'][_0x6b75('0xa4')]){var _0xa40e72=_0x15cb5a['query'][_0x6b75('0xa4')][_0x6b75('0xa5')](',');var _0x30a01f={};_0x30a01f[_0xa40e72[0x0]]={'$gte':moment(_0xa40e72[0x1])['format'](_0x6b75('0xa6'))};_0x5c12f9[_0x6b75('0xa0')]=_[_0x6b75('0x2d')](_0x5c12f9[_0x6b75('0xa0')],_0x30a01f);}_0x5c12f9=_['merge']({},_0x5c12f9,_0x15cb5a[_0x6b75('0x45')]);return db[_0x6b75('0x5f')][_0x6b75('0xa7')]({'where':_0x5c12f9[_0x6b75('0xa0')]})['then'](function(_0x3b5e64){_0x1e3a31[_0x6b75('0xa7')]=_0x3b5e64;if(_0x15cb5a['query'][_0x6b75('0x43')]){_0x5c12f9[_0x6b75('0x44')]=[{'all':!![]}];}return db[_0x6b75('0x5f')][_0x6b75('0x38')](_0x5c12f9);})['then'](function(_0x2ba9aa){_0x1e3a31['rows']=_0x2ba9aa;return _0x1e3a31;});}})[_0x6b75('0x16')](respondWithFilteredResult(_0x1fabea,_0x5c12f9))[_0x6b75('0x21')](handleError(_0x1fabea,null));};exports[_0x6b75('0xa8')]=function(_0x52e82f,_0x52b83e){var _0x512c34={'where':{}},_0x4abdc4={},_0x6fadca={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x6b75('0x4b')]({'where':{'id':_0x52e82f[_0x6b75('0x3c')]['id']}})[_0x6b75('0x16')](handleEntityNotFound(_0x52b83e,null))['then'](function(_0x1f61a1){if(_0x1f61a1){_0x4abdc4[_0x6b75('0x3d')]=_[_0x6b75('0x9b')](db[_0x6b75('0x5f')]['rawAttributes']);_0x4abdc4['query']=_[_0x6b75('0x9b')](_0x52e82f['query']);_0x4abdc4[_0x6b75('0xa1')]=_[_0x6b75('0x3f')](_0x4abdc4[_0x6b75('0x3d')],_0x4abdc4[_0x6b75('0x3a')]);_0x512c34[_0x6b75('0x41')]=_[_0x6b75('0x3f')](_0x4abdc4[_0x6b75('0x3d')],qs[_0x6b75('0x40')](_0x52e82f[_0x6b75('0x3a')]['fields']));_0x512c34[_0x6b75('0x41')]=_0x512c34['attributes'][_0x6b75('0x42')]?_0x512c34[_0x6b75('0x41')]:_0x4abdc4[_0x6b75('0x3d')];if(!_0x52e82f[_0x6b75('0x3a')][_0x6b75('0x9c')](_0x6b75('0x9d'))){_0x512c34['limit']=qs[_0x6b75('0x27')](_0x52e82f[_0x6b75('0x3a')][_0x6b75('0x27')]);_0x512c34[_0x6b75('0x26')]=qs[_0x6b75('0x26')](_0x52e82f['query'][_0x6b75('0x26')]);}_0x512c34[_0x6b75('0x9e')]=qs['sort'](_0x52e82f[_0x6b75('0x3a')][_0x6b75('0x9f')]);_0x512c34[_0x6b75('0xa0')]=qs[_0x6b75('0xa1')](_[_0x6b75('0xa9')](_0x52e82f[_0x6b75('0x3a')],_0x4abdc4['filters']));_0x512c34[_0x6b75('0xa0')][_0x6b75('0xa2')]=_0x1f61a1['id'];if(_0x52e82f[_0x6b75('0x3a')]['filter']){_0x512c34['where']=_[_0x6b75('0x2d')](_0x512c34[_0x6b75('0xa0')],{'$or':_[_0x6b75('0x33')](_0x512c34[_0x6b75('0x41')],function(_0x450c30){var _0x490eab={};_0x490eab[_0x450c30]={'$like':'%'+_0x52e82f[_0x6b75('0x3a')][_0x6b75('0xa3')]+'%'};return _0x490eab;})});}_0x512c34[_0x6b75('0xa0')]['secret']=![];if(_0x52e82f[_0x6b75('0x3a')]['id']){_0x512c34[_0x6b75('0xa0')]['id']={'$gt':_0x52e82f[_0x6b75('0x3a')]['id']};}_0x512c34=_['merge']({},_0x512c34,_0x52e82f['options']);return db[_0x6b75('0x5f')][_0x6b75('0xa7')]({'where':_0x512c34[_0x6b75('0xa0')]})[_0x6b75('0x16')](function(_0x45b411){_0x6fadca[_0x6b75('0xa7')]=_0x45b411;_0x512c34['include']=[];if(_0x52e82f[_0x6b75('0x3a')][_0x6b75('0xaa')]){_0x512c34[_0x6b75('0x44')][_0x6b75('0xab')]({'model':db[_0x6b75('0x7d')],'as':'User','attributes':['id','fullname',_0x6b75('0x88')]});}if(_0x52e82f[_0x6b75('0x3a')][_0x6b75('0x43')]){_0x512c34[_0x6b75('0x44')]=[{'all':!![]}];}return db['ChatMessage'][_0x6b75('0x38')](_0x512c34);})[_0x6b75('0x16')](function(_0x581a3e){_0x6fadca[_0x6b75('0xac')]=_0x581a3e;return _0x6fadca;});}})[_0x6b75('0x16')](respondWithFilteredResult(_0x52b83e,_0x512c34))[_0x6b75('0x21')](handleError(_0x52b83e,null));};exports[_0x6b75('0xad')]=function(_0x257ac7,_0x42f70b){return db[_0x6b75('0x34')][_0x6b75('0x46')]({'where':{'id':_0x257ac7['params']['id']}})[_0x6b75('0x16')](handleEntityNotFound(_0x42f70b,null))[_0x6b75('0x16')](function(_0x5f5b43){if(_0x5f5b43){return _0x5f5b43[_0x6b75('0xae')](_0x257ac7[_0x6b75('0x2e')][_0x6b75('0xaf')],_['omit'](_0x257ac7['body'],['ids','id'])||{})[_0x6b75('0xb0')](function(){return db[_0x6b75('0xb1')]['findAll']({'attributes':['id',_0x6b75('0x53'),'color'],'where':{'id':_0x257ac7[_0x6b75('0x2e')][_0x6b75('0xaf')]}});})['then'](function(_0x521184){socket[_0x6b75('0xb2')](_0x6b75('0xb3'),{'id':Number(_0x257ac7[_0x6b75('0x3c')]['id']),'tags':_0x521184||[]});return{'id':Number(_0x257ac7['params']['id']),'tags':_0x521184||[]};});}})['then'](respondWithResult(_0x42f70b,null))['catch'](handleError(_0x42f70b,null));};exports[_0x6b75('0xb4')]=function(_0xcec860,_0x335314){return db[_0x6b75('0x34')]['find']({'where':{'id':_0xcec860[_0x6b75('0x3c')]['id']}})[_0x6b75('0x16')](handleEntityNotFound(_0x335314,null))[_0x6b75('0x16')](function(_0x288ce2){if(_0x288ce2){return _0x288ce2[_0x6b75('0xb4')](_0xcec860['query'][_0x6b75('0xaf')]);}})[_0x6b75('0x16')](respondWithStatusCode(_0x335314,null))[_0x6b75('0x21')](handleError(_0x335314,null));};exports[_0x6b75('0x74')]=function(_0xb4529e,_0x2c91f8){var _0x2b1e23=moment()[_0x6b75('0xb5')]()[_0x6b75('0xb6')]();var _0x5c0a24=path['join'](config[_0x6b75('0x77')],_0x6b75('0xb7'),_0x6b75('0xb8'),'tmp');var _0x7d36=path[_0x6b75('0x72')](config[_0x6b75('0x77')],_0x6b75('0xb7'),_0x6b75('0xb8'),'attachments');var _0x56ba11=path['join'](_0x5c0a24,_0x2b1e23);var _0x694dee=util[_0x6b75('0x79')](_0x6b75('0xb9'),_0xb4529e[_0x6b75('0x3c')]['id'],_0x2b1e23);var _0x1a21da=path[_0x6b75('0x72')](_0x5c0a24,_0x694dee);var _0x284258=[];_0x284258['push']({'model':db[_0x6b75('0x7d')],'as':_0x6b75('0x7d'),'attributes':['id','fullname'],'raw':!![]});_0x284258[_0x6b75('0xab')]({'model':db['CmContact'],'as':_0x6b75('0x64'),'attributes':['id',_0x6b75('0xba'),'lastName'],'raw':!![]});if(_0xb4529e[_0x6b75('0x3a')][_0x6b75('0xbb')]){_0x284258['push']({'model':db[_0x6b75('0x6f')],'as':_0x6b75('0x6f'),'raw':!![]});}var _0x443ab8=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0x6b75('0x2e'),_0x6b75('0x8a'),_0x6b75('0x8c'),_0x6b75('0x8d'),_0x6b75('0xbc')],'include':_0x284258}];_0x443ab8[_0x6b75('0xab')]({'model':db['ChatWebsite'],'as':_0x6b75('0xbd'),'attributes':['id','name']});_0x443ab8['push']({'model':db[_0x6b75('0x7d')],'as':_0x6b75('0xbe'),'attributes':['id',_0x6b75('0x54')]});return db[_0x6b75('0x34')]['find']({'where':{'id':_0xb4529e[_0x6b75('0x3c')]['id']},'include':_0x443ab8})[_0x6b75('0x16')](handleEntityNotFound(_0x2c91f8,null))[_0x6b75('0x16')](function(_0xff24fe){if(_0xff24fe){var _0x50537c=_0xff24fe['get']({'plain':!![]});fs['mkdirSync'](_0x56ba11);var _0x18bec2={'channel':_0x6b75('0xbf'),'account':_0x50537c[_0x6b75('0xbd')][_0x6b75('0x53')],'agent':_0x50537c['Owner']?_0x50537c['Owner']['fullname']:_0x6b75('0xc0'),'createdAt':moment(_0x50537c[_0x6b75('0x8a')])[_0x6b75('0x79')](_0x6b75('0xa6'))[_0x6b75('0xb6')](),'closedAt':_0x50537c[_0x6b75('0x6e')]?moment(_0x50537c['closedAt'])[_0x6b75('0x79')](_0x6b75('0xa6'))[_0x6b75('0xb6')]():'','disposition':_0x50537c[_0x6b75('0x68')],'chatInfo':{'browser':_0x50537c['browserName'],'os':_0x50537c[_0x6b75('0xc1')],'referer':_0x50537c['referer'],'customerIp':_0x50537c[_0x6b75('0xc2')],'customerPort':_0x50537c['customerPort']?_0x50537c[_0x6b75('0xc3')]:_0x6b75('0xc0')},'messages':_(_0x50537c[_0x6b75('0x7f')])[_0x6b75('0xc4')]()[_0x6b75('0xa3')]({'secret':![]})[_0x6b75('0x33')](function(_0x180ad2){if(_0x180ad2[_0x6b75('0x6f')]){var _0x21583a=path[_0x6b75('0x72')](_0x7d36,_0x180ad2[_0x6b75('0x6f')][_0x6b75('0x6c')]);if(fs[_0x6b75('0xc5')](_0x21583a)){fs[_0x6b75('0xc6')](_0x21583a)['pipe'](fs[_0x6b75('0xc7')](path['join'](_0x56ba11,_0x180ad2[_0x6b75('0x6f')]['basename'])));}}return{'date':moment(_0x180ad2['createdAt'])[_0x6b75('0x79')](_0x6b75('0xa6'))[_0x6b75('0xb6')](),'sender':_0x180ad2[_0x6b75('0x8c')]===_0x6b75('0x5e')?_0x180ad2[_0x6b75('0x7d')]?_0x180ad2[_0x6b75('0x7d')][_0x6b75('0x54')]:_0x6b75('0x82'):_0x180ad2[_0x6b75('0x64')][_0x6b75('0xba')]+(_0x180ad2['Contact'][_0x6b75('0xc8')]?'\x20'+_0x180ad2['Contact'][_0x6b75('0xc8')]:''),'body':_0x180ad2[_0x6b75('0x6f')]?_0x180ad2['Attachment'][_0x6b75('0x6c')]:_0x180ad2[_0x6b75('0x2e')],'direction':_0x180ad2[_0x6b75('0x8c')]===_0x6b75('0x5e')?'A':'C','secret':_0x180ad2[_0x6b75('0x8d')],'read':_0x180ad2[_0x6b75('0xbc')],'attachment':_0x180ad2[_0x6b75('0x6f')]};})['value']()};return ejs[_0x6b75('0xc9')](path[_0x6b75('0x72')](config[_0x6b75('0x77')],_0x6b75('0xb7'),_0x6b75('0xca'),'downloadInteraction.ejs'),{'interaction':_0x18bec2})[_0x6b75('0x16')](function(_0x49cfd0){var _0x46d413=path[_0x6b75('0x72')](_0x56ba11,_0x6b75('0xcb')+_0x50537c['id']+'-'+_0x2b1e23+'.pdf');var _0x2687dd={'path':_0x46d413,'channel':_0x6b75('0xbf'),'interactionId':_0x50537c['id']};return pdf['createPdfFromHTML'](_0x49cfd0,_0x2687dd);})[_0x6b75('0x16')](function(){return new Promise(function(_0x328555,_0x453337){zipdir(_0x56ba11,{'saveTo':_0x1a21da},function(_0x309cd3,_0x4bee16){if(_0x309cd3)return _0x453337(_0x309cd3);return _0x328555(_0x4bee16);});})[_0x6b75('0x16')](function(){return new BPromise(function(_0x51b193,_0x1f0760){rimraf(_0x56ba11,function(_0xcce6b5){if(_0xcce6b5)_0x1f0760(_0xcce6b5);return _0x51b193();});});})[_0x6b75('0x16')](function(){return _0x2c91f8['download'](_0x1a21da,_0x694dee,function(_0x296c3f){if(_0x296c3f){logger[_0x6b75('0x1c')](_0x6b75('0xcc'),_0x296c3f);}else{fs[_0x6b75('0xcd')](_0x1a21da);}});});});}else{return _0x2c91f8[_0x6b75('0x22')](0xc8);}})[_0x6b75('0x21')](handleError(_0x2c91f8,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 7d2a1e8..afb81bb 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 _0xa373=['remove','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','hook','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x10a131,_0x3dc92b){var _0x51c8e2=function(_0x4c60a9){while(--_0x4c60a9){_0x10a131['push'](_0x10a131['shift']());}};_0x51c8e2(++_0x3dc92b);}(_0xa373,0xbf));var _0x3a37=function(_0x689537,_0x5ce66b){_0x689537=_0x689537-0x0;var _0xb1b3f0=_0xa373[_0x689537];return _0xb1b3f0;};'use strict';var EventEmitter=require(_0x3a37('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x3a37('0x1')];var ChatMessage=require(_0x3a37('0x2'))['db'][_0x3a37('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3a37('0x4')](0x0);var events={'afterCreate':_0x3a37('0x5'),'afterUpdate':_0x3a37('0x6'),'afterDestroy':_0x3a37('0x7')};function emitEvent(_0x31de69){return function(_0x3869a0,_0x29e23d,_0x4ee072){_0x3869a0[_0x3a37('0x8')]({'attributes':['id'],'raw':!![]})[_0x3a37('0x9')](function(_0x210e5b){_0x3869a0[_0x3a37('0xa')](_0x3a37('0xb'),_0x210e5b[_0x3a37('0xc')](function(_0x24109d){return{'id':_0x24109d['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3869a0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3a37('0x9')](function(_0x950c92){_0x3869a0['setDataValue']('unreadMessages',_0x950c92[_0x3a37('0xd')]);ChatInteractionEvents[_0x3a37('0xe')](_0x31de69+':'+_0x3869a0['id'],_0x3869a0);ChatInteractionEvents[_0x3a37('0xe')](_0x31de69,_0x3869a0);_0x4ee072(null);})[_0x3a37('0xf')](_0x4ee072(null));};}for(var e in events){if(events[_0x3a37('0x10')](e)){var event=events[e];ChatInteraction[_0x3a37('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x073b=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','getUsers','then','setDataValue','Users','findAll','length','emit','hasOwnProperty','hook','events'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x073b,0x1a3));var _0xb073=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x073b[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xb073('0x0'));var ChatInteraction=require(_0xb073('0x1'))['db'][_0xb073('0x2')];var ChatMessage=require(_0xb073('0x1'))['db'][_0xb073('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb073('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x36ca02){return function(_0x3761b8,_0x4ba8f2,_0x3ad865){_0x3761b8[_0xb073('0x5')]({'attributes':['id'],'raw':!![]})[_0xb073('0x6')](function(_0x1d8353){_0x3761b8[_0xb073('0x7')](_0xb073('0x8'),_0x1d8353['map'](function(_0x688a1b){return{'id':_0x688a1b['id']};}));return ChatMessage[_0xb073('0x9')]({'where':{'ChatInteractionId':_0x3761b8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb073('0x6')](function(_0x1c10a1){_0x3761b8[_0xb073('0x7')]('unreadMessages',_0x1c10a1[_0xb073('0xa')]);ChatInteractionEvents[_0xb073('0xb')](_0x36ca02+':'+_0x3761b8['id'],_0x3761b8);ChatInteractionEvents[_0xb073('0xb')](_0x36ca02,_0x3761b8);_0x3ad865(null);})['catch'](_0x3ad865(null));};}for(var e in events){if(events[_0xb073('0xc')](e)){var event=events[e];ChatInteraction[_0xb073('0xd')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 4fcbac7..7aeabf5 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 _0x7a8b=['../../config/logger','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x4bebfa,_0x58b358){var _0xb8d6e5=function(_0x52a67d){while(--_0x52a67d){_0x4bebfa['push'](_0x4bebfa['shift']());}};_0xb8d6e5(++_0x58b358);}(_0x7a8b,0x1db));var _0xb7a8=function(_0xcc0214,_0x1a0248){_0xcc0214=_0xcc0214-0x0;var _0x28a82f=_0x7a8b[_0xcc0214];return _0x28a82f;};'use strict';var _=require('lodash');var util=require(_0xb7a8('0x0'));var logger=require(_0xb7a8('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb7a8('0x2'));var rp=require(_0xb7a8('0x3'));var fs=require('fs');var path=require(_0xb7a8('0x4'));var rimraf=require(_0xb7a8('0x5'));var config=require('../../config/environment');var attributes=require(_0xb7a8('0x6'));module[_0xb7a8('0x7')]=function(_0x23d7a2,_0x460fff){return _0x23d7a2[_0xb7a8('0x8')](_0xb7a8('0x9'),attributes,{'tableName':_0xb7a8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xf0dcb3,_0x1179d1,_0x13708e){if(_0xf0dcb3[_0xb7a8('0xb')](_0xb7a8('0xc'))){_0xf0dcb3[_0xb7a8('0xd')]=moment()['format'](_0xb7a8('0xe'));}_0x13708e(null,_0xf0dcb3);}},'charset':_0xb7a8('0xf'),'collate':_0xb7a8('0x10')});};
\ No newline at end of file
+var _0x9419=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3d38c3,_0x20192a){var _0x4f04f9=function(_0x2a484c){while(--_0x2a484c){_0x3d38c3['push'](_0x3d38c3['shift']());}};_0x4f04f9(++_0x20192a);}(_0x9419,0x1a6));var _0x9941=function(_0x197185,_0x251145){_0x197185=_0x197185-0x0;var _0x2c8af1=_0x9419[_0x197185];return _0x2c8af1;};'use strict';var _=require(_0x9941('0x0'));var util=require(_0x9941('0x1'));var logger=require(_0x9941('0x2'))(_0x9941('0x3'));var moment=require(_0x9941('0x4'));var BPromise=require(_0x9941('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9941('0x6'));var rimraf=require(_0x9941('0x7'));var config=require(_0x9941('0x8'));var attributes=require('./chatInteraction.attributes');module[_0x9941('0x9')]=function(_0x5d7ee8,_0xdd4f16){return _0x5d7ee8[_0x9941('0xa')](_0x9941('0xb'),attributes,{'tableName':_0x9941('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4af13f,_0x1b6d5b,_0x12f819){if(_0x4af13f[_0x9941('0xd')](_0x9941('0xe'))){_0x4af13f[_0x9941('0xf')]=moment()[_0x9941('0x10')](_0x9941('0x11'));}_0x12f819(null,_0x4af13f);}},'charset':_0x9941('0x12'),'collate':_0x9941('0x13')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 6e5fa54..aa19939 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 _0x40d9=['info','ChatInteraction,\x20%s,\x20%s','result','catch','UpdateChatInteraction','update','body','options','raw','where','attributes','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x40e6e7,_0x187f3d){var _0x1bf123=function(_0x14f24e){while(--_0x14f24e){_0x40e6e7['push'](_0x40e6e7['shift']());}};_0x1bf123(++_0x187f3d);}(_0x40d9,0x1a1));var _0x940d=function(_0x1538d1,_0x3eab18){_0x1538d1=_0x1538d1-0x0;var _0xe84c01=_0x40d9[_0x1538d1];return _0xe84c01;};'use strict';var _=require(_0x940d('0x0'));var util=require(_0x940d('0x1'));var moment=require(_0x940d('0x2'));var BPromise=require(_0x940d('0x3'));var rs=require(_0x940d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x940d('0x5'));var logger=require(_0x940d('0x6'))(_0x940d('0x7'));var config=require('../../config/environment');var jayson=require(_0x940d('0x8'));var client=jayson['client'][_0x940d('0x9')]({'port':0x232a});config[_0x940d('0xa')]=_['defaults'](config['redis'],{'host':_0x940d('0xb'),'port':0x18eb});var socket=require(_0x940d('0xc'))(new Redis(config['redis']));require(_0x940d('0xd'))[_0x940d('0xe')](socket);function respondWithRpcPromise(_0x35b834,_0x3bd710,_0x3b08b6){return new BPromise(function(_0x11ced4,_0x46b3c7){return client[_0x940d('0xf')](_0x35b834,_0x3b08b6)[_0x940d('0x10')](function(_0x1731be){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x3bd710,_0x940d('0x11'));logger[_0x940d('0x12')](_0x940d('0x13'),_0x3bd710,_0x940d('0x11'),JSON[_0x940d('0x14')](_0x1731be));if(_0x1731be[_0x940d('0x15')]){if(_0x1731be[_0x940d('0x15')]['code']===0x1f4){logger[_0x940d('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x3bd710,_0x1731be['error'][_0x940d('0x16')]);return _0x46b3c7(_0x1731be[_0x940d('0x15')]['message']);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3bd710,_0x1731be[_0x940d('0x15')][_0x940d('0x16')]);return _0x11ced4(_0x1731be[_0x940d('0x15')]['message']);}else{logger[_0x940d('0x17')](_0x940d('0x18'),_0x3bd710,'request\x20sent');_0x11ced4(_0x1731be[_0x940d('0x19')][_0x940d('0x16')]);}})[_0x940d('0x1a')](function(_0x1e5e19){logger[_0x940d('0x15')](_0x940d('0x18'),_0x3bd710,_0x1e5e19);_0x46b3c7(_0x1e5e19);});});}exports[_0x940d('0x1b')]=function(_0x3302af){var _0x5bed7d=this;return new Promise(function(_0x55c243,_0x561122){return db['ChatInteraction'][_0x940d('0x1c')](_0x3302af[_0x940d('0x1d')],{'raw':_0x3302af[_0x940d('0x1e')]?_0x3302af[_0x940d('0x1e')][_0x940d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3302af[_0x940d('0x1e')]?_0x3302af['options'][_0x940d('0x20')]||null:null,'attributes':_0x3302af[_0x940d('0x1e')]?_0x3302af['options'][_0x940d('0x21')]||null:null,'limit':_0x3302af[_0x940d('0x1e')]?_0x3302af[_0x940d('0x1e')]['limit']||null:null})['then'](function(_0x14141d){logger[_0x940d('0x17')](_0x940d('0x1b'),_0x3302af);logger[_0x940d('0x12')]('UpdateChatInteraction',_0x3302af,JSON['stringify'](_0x14141d));_0x55c243(_0x14141d);})[_0x940d('0x1a')](function(_0x220122){logger[_0x940d('0x15')](_0x940d('0x1b'),_0x220122['message'],_0x3302af);_0x561122(_0x5bed7d[_0x940d('0x15')](0x1f4,_0x220122[_0x940d('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x735ca0){return new Promise(function(_0x24731c,_0x226358){return db['ChatInteraction'][_0x940d('0x22')]({'where':_0x735ca0[_0x940d('0x1e')]?_0x735ca0[_0x940d('0x1e')][_0x940d('0x20')]||null:null})[_0x940d('0x10')](function(_0x54ffa3){if(_0x54ffa3){return _0x54ffa3[_0x940d('0x23')](_0x735ca0[_0x940d('0x1d')][_0x940d('0x24')],_[_0x940d('0x25')](_0x735ca0[_0x940d('0x1d')],[_0x940d('0x24'),'id'])||{});}})[_0x940d('0x26')](function(_0x5be2a2){logger['info'](_0x940d('0x27'),_0x735ca0);logger[_0x940d('0x12')](_0x940d('0x27'),_0x735ca0,JSON[_0x940d('0x14')](_0x5be2a2));_0x24731c(_0x5be2a2);})[_0x940d('0x1a')](function(_0x59f68f){logger[_0x940d('0x15')](_0x940d('0x27'),_0x59f68f['message'],_0x735ca0);_0x226358(_this[_0x940d('0x15')](0x1f4,_0x59f68f[_0x940d('0x16')]));});});};
\ No newline at end of file
+var _0xf976=['register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','UpdateChatInteraction','update','options','raw','where','limit','stringify','catch','find','addTags','ids','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','socket.io-emitter'];(function(_0x135cd7,_0x6bdc01){var _0x300a1d=function(_0x4f292e){while(--_0x4f292e){_0x135cd7['push'](_0x135cd7['shift']());}};_0x300a1d(++_0x6bdc01);}(_0xf976,0xfd));var _0x6f97=function(_0x1c6ab4,_0x132809){_0x1c6ab4=_0x1c6ab4-0x0;var _0x473573=_0xf976[_0x1c6ab4];return _0x473573;};'use strict';var _=require(_0x6f97('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6f97('0x1'));var rs=require(_0x6f97('0x2'));var fs=require('fs');var Redis=require(_0x6f97('0x3'));var db=require(_0x6f97('0x4'))['db'];var utils=require(_0x6f97('0x5'));var logger=require(_0x6f97('0x6'))(_0x6f97('0x7'));var config=require(_0x6f97('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6f97('0x9')]({'port':0x232a});config['redis']=_[_0x6f97('0xa')](config[_0x6f97('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6f97('0xc'))(new Redis(config[_0x6f97('0xb')]));require('./chatInteraction.socket')[_0x6f97('0xd')](socket);function respondWithRpcPromise(_0x2672d0,_0xc3cdbb,_0x25430f){return new BPromise(function(_0x202da5,_0x8384c){return client[_0x6f97('0xe')](_0x2672d0,_0x25430f)[_0x6f97('0xf')](function(_0x247fbf){logger[_0x6f97('0x10')](_0x6f97('0x11'),_0xc3cdbb,'request\x20sent');logger[_0x6f97('0x12')](_0x6f97('0x13'),_0xc3cdbb,'request\x20sent',JSON['stringify'](_0x247fbf));if(_0x247fbf['error']){if(_0x247fbf[_0x6f97('0x14')][_0x6f97('0x15')]===0x1f4){logger[_0x6f97('0x14')](_0x6f97('0x11'),_0xc3cdbb,_0x247fbf[_0x6f97('0x14')]['message']);return _0x8384c(_0x247fbf[_0x6f97('0x14')][_0x6f97('0x16')]);}logger[_0x6f97('0x14')](_0x6f97('0x11'),_0xc3cdbb,_0x247fbf[_0x6f97('0x14')][_0x6f97('0x16')]);return _0x202da5(_0x247fbf[_0x6f97('0x14')][_0x6f97('0x16')]);}else{logger[_0x6f97('0x10')](_0x6f97('0x11'),_0xc3cdbb,_0x6f97('0x17'));_0x202da5(_0x247fbf[_0x6f97('0x18')]['message']);}})['catch'](function(_0x385d3e){logger[_0x6f97('0x14')](_0x6f97('0x11'),_0xc3cdbb,_0x385d3e);_0x8384c(_0x385d3e);});});}exports[_0x6f97('0x19')]=function(_0x1fd72d){var _0x53d192=this;return new Promise(function(_0x3a8a02,_0x21ae5e){return db['ChatInteraction'][_0x6f97('0x1a')](_0x1fd72d['body'],{'raw':_0x1fd72d['options']?_0x1fd72d[_0x6f97('0x1b')][_0x6f97('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fd72d[_0x6f97('0x1b')]?_0x1fd72d[_0x6f97('0x1b')][_0x6f97('0x1d')]||null:null,'attributes':_0x1fd72d[_0x6f97('0x1b')]?_0x1fd72d[_0x6f97('0x1b')]['attributes']||null:null,'limit':_0x1fd72d[_0x6f97('0x1b')]?_0x1fd72d[_0x6f97('0x1b')][_0x6f97('0x1e')]||null:null})[_0x6f97('0xf')](function(_0x5579d3){logger[_0x6f97('0x10')]('UpdateChatInteraction',_0x1fd72d);logger[_0x6f97('0x12')]('UpdateChatInteraction',_0x1fd72d,JSON[_0x6f97('0x1f')](_0x5579d3));_0x3a8a02(_0x5579d3);})[_0x6f97('0x20')](function(_0x561abe){logger[_0x6f97('0x14')]('UpdateChatInteraction',_0x561abe[_0x6f97('0x16')],_0x1fd72d);_0x21ae5e(_0x53d192['error'](0x1f4,_0x561abe[_0x6f97('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x3d559a){return new Promise(function(_0x11da4f,_0x27f35e){return db['ChatInteraction'][_0x6f97('0x21')]({'where':_0x3d559a['options']?_0x3d559a[_0x6f97('0x1b')]['where']||null:null})['then'](function(_0x15f227){if(_0x15f227){return _0x15f227[_0x6f97('0x22')](_0x3d559a['body'][_0x6f97('0x23')],_['omit'](_0x3d559a['body'],[_0x6f97('0x23'),'id'])||{});}})[_0x6f97('0x24')](function(_0x434dd3){logger['info'](_0x6f97('0x25'),_0x3d559a);logger[_0x6f97('0x12')]('AddTags',_0x3d559a,JSON[_0x6f97('0x1f')](_0x434dd3));_0x11da4f(_0x434dd3);})[_0x6f97('0x20')](function(_0x227e76){logger['error']('AddTags',_0x227e76[_0x6f97('0x16')],_0x3d559a);_0x27f35e(_this['error'](0x1f4,_0x227e76['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 378dd16..20edb8d 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 _0x3bef=['update','emit','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3bef,0x185));var _0xf3be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3bef[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require(_0xf3be('0x0'));var events=[_0xf3be('0x1'),_0xf3be('0x2'),_0xf3be('0x3')];function createListener(_0x432a61,_0x2e37d1){return function(_0xdc837){_0x2e37d1[_0xf3be('0x4')](_0x432a61,_0xdc837);};}function removeListener(_0x34c0a3,_0x1098df){return function(){ChatInteractionEvents['removeListener'](_0x34c0a3,_0x1098df);};}exports[_0xf3be('0x5')]=function(_0x83a255){for(var _0x30494e=0x0,_0x1835bf=events[_0xf3be('0x6')];_0x30494e<_0x1835bf;_0x30494e++){var _0x48e92c=events[_0x30494e];var _0x363b33=createListener(_0xf3be('0x7')+_0x48e92c,_0x83a255);ChatInteractionEvents['on'](_0x48e92c,_0x363b33);}};
\ No newline at end of file
+var _0x0e82=['update','emit','removeListener','length','./chatInteraction.events','save','remove'];(function(_0x19da20,_0x48f324){var _0x5bec84=function(_0x18f2e9){while(--_0x18f2e9){_0x19da20['push'](_0x19da20['shift']());}};_0x5bec84(++_0x48f324);}(_0x0e82,0x1e7));var _0x20e8=function(_0x50f19a,_0xa5fafe){_0x50f19a=_0x50f19a-0x0;var _0xde90b6=_0x0e82[_0x50f19a];return _0xde90b6;};'use strict';var ChatInteractionEvents=require(_0x20e8('0x0'));var events=[_0x20e8('0x1'),_0x20e8('0x2'),_0x20e8('0x3')];function createListener(_0x3f2bc3,_0x591a92){return function(_0x323913){_0x591a92[_0x20e8('0x4')](_0x3f2bc3,_0x323913);};}function removeListener(_0x3fba19,_0x521f85){return function(){ChatInteractionEvents[_0x20e8('0x5')](_0x3fba19,_0x521f85);};}exports['register']=function(_0x478dc8){for(var _0x58e0af=0x0,_0x395493=events[_0x20e8('0x6')];_0x58e0af<_0x395493;_0x58e0af++){var _0xf11108=events[_0x58e0af];var _0x4ba44d=createListener('chatInteraction:'+_0xf11108,_0x478dc8);ChatInteractionEvents['on'](_0xf11108,_0x4ba44d);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index bea3f80..e4272f5 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 _0xa0ce=['fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','create','post','/:id/vidaoo','createVidaooSession','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','path','express','Router'];(function(_0x24a82,_0x836580){var _0x37095d=function(_0x5bb2fc){while(--_0x5bb2fc){_0x24a82['push'](_0x24a82['shift']());}};_0x37095d(++_0x836580);}(_0xa0ce,0x128));var _0xea0c=function(_0xb97296,_0x12205e){_0xb97296=_0xb97296-0x0;var _0x22ab83=_0xa0ce[_0xb97296];return _0x22ab83;};'use strict';var multer=require(_0xea0c('0x0'));var util=require('util');var path=require(_0xea0c('0x1'));var timeout=require('connect-timeout');var express=require(_0xea0c('0x2'));var router=express[_0xea0c('0x3')]();var fs_extra=require(_0xea0c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xea0c('0x5'));var config=require(_0xea0c('0x6'));var controller=require(_0xea0c('0x7'));router[_0xea0c('0x8')]('/',auth[_0xea0c('0x9')](),controller[_0xea0c('0xa')]);router[_0xea0c('0x8')]('/describe',auth[_0xea0c('0x9')](),controller[_0xea0c('0xb')]);router['get']('/:id',auth[_0xea0c('0xc')](),controller[_0xea0c('0xd')]);router['get'](_0xea0c('0xe'),auth[_0xea0c('0xc')](),controller[_0xea0c('0xf')]);router['get'](_0xea0c('0x10'),auth[_0xea0c('0x9')](),controller[_0xea0c('0x11')]);router[_0xea0c('0x8')]('/:id/my_messages',auth[_0xea0c('0xc')](),controller[_0xea0c('0x12')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xea0c('0x9')](),controller[_0xea0c('0x13')]);router[_0xea0c('0x14')](_0xea0c('0x15'),auth['isAuthenticated'](),controller[_0xea0c('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x36846e,_0x43f65b,_0x51573b){_0x51573b(null,path['join'](config[_0xea0c('0x17')],_0xea0c('0x18')));},'filename':function(_0x21c28f,_0x1fc0ac,_0xcedbd6){_0xcedbd6(null,util['format'](_0xea0c('0x19'),Date[_0xea0c('0x1a')](),_0x1fc0ac[_0xea0c('0x1b')][_0xea0c('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xea0c('0x14')](_0xea0c('0x1d'),upload[_0xea0c('0x1e')](_0xea0c('0x1f')),controller[_0xea0c('0x20')]);router[_0xea0c('0x14')](_0xea0c('0x10'),auth[_0xea0c('0xc')](),controller[_0xea0c('0x21')]);router[_0xea0c('0x14')](_0xea0c('0x22'),auth['isAuthenticated'](),interaction[_0xea0c('0x23')](_0xea0c('0x24'),_0xea0c('0x25')),controller[_0xea0c('0x26')]);router[_0xea0c('0x27')](_0xea0c('0x28'),auth[_0xea0c('0x9')](),interaction[_0xea0c('0x23')](_0xea0c('0x24'),'chatinteraction:update'),controller['update']);router[_0xea0c('0x27')]('/:id/custom_update',controller['customUpdate']);router[_0xea0c('0x27')](_0xea0c('0x29'),auth[_0xea0c('0xc')](),controller[_0xea0c('0x2a')]);router[_0xea0c('0x27')](_0xea0c('0x2b'),controller[_0xea0c('0x2c')]);router[_0xea0c('0x2d')](_0xea0c('0x28'),auth[_0xea0c('0x9')](),interaction[_0xea0c('0x23')](_0xea0c('0x24'),_0xea0c('0x2e')),controller[_0xea0c('0x2f')]);router[_0xea0c('0x2d')](_0xea0c('0x22'),auth[_0xea0c('0x9')](),controller[_0xea0c('0x30')]);module[_0xea0c('0x31')]=router;
\ No newline at end of file
+var _0x7074=['put','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chatinteraction:addtags','chatinteraction:update'];(function(_0x4505fe,_0x40e067){var _0x3f56b7=function(_0x41cb8b){while(--_0x41cb8b){_0x4505fe['push'](_0x4505fe['shift']());}};_0x3f56b7(++_0x40e067);}(_0x7074,0xb3));var _0x4707=function(_0x6e2c11,_0x58c8c2){_0x6e2c11=_0x6e2c11-0x0;var _0x51ee89=_0x7074[_0x6e2c11];return _0x51ee89;};'use strict';var multer=require(_0x4707('0x0'));var util=require(_0x4707('0x1'));var path=require(_0x4707('0x2'));var timeout=require(_0x4707('0x3'));var express=require('express');var router=express[_0x4707('0x4')]();var fs_extra=require(_0x4707('0x5'));var auth=require(_0x4707('0x6'));var interaction=require(_0x4707('0x7'));var config=require(_0x4707('0x8'));var controller=require(_0x4707('0x9'));router[_0x4707('0xa')]('/',auth[_0x4707('0xb')](),controller[_0x4707('0xc')]);router[_0x4707('0xa')](_0x4707('0xd'),auth[_0x4707('0xb')](),controller[_0x4707('0xe')]);router[_0x4707('0xa')](_0x4707('0xf'),auth[_0x4707('0x10')](),controller[_0x4707('0x11')]);router[_0x4707('0xa')](_0x4707('0x12'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0x4707('0xa')](_0x4707('0x13'),auth[_0x4707('0xb')](),controller[_0x4707('0x14')]);router[_0x4707('0xa')](_0x4707('0x15'),auth[_0x4707('0x10')](),controller[_0x4707('0x16')]);router[_0x4707('0xa')](_0x4707('0x17'),auth[_0x4707('0xb')](),controller[_0x4707('0x18')]);router[_0x4707('0x19')]('/',auth[_0x4707('0xb')](),controller[_0x4707('0x1a')]);router['post'](_0x4707('0x1b'),auth[_0x4707('0xb')](),controller[_0x4707('0x1c')]);var upload=multer({'storage':multer[_0x4707('0x1d')]({'destination':function(_0x352b93,_0xd7b775,_0x53b616){_0x53b616(null,path['join'](config[_0x4707('0x1e')],_0x4707('0x1f')));},'filename':function(_0xc0fc3b,_0x551dea,_0x23a30f){_0x23a30f(null,util[_0x4707('0x20')](_0x4707('0x21'),Date[_0x4707('0x22')](),_0x551dea[_0x4707('0x23')][_0x4707('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4707('0x19')](_0x4707('0x25'),upload[_0x4707('0x26')](_0x4707('0x27')),controller[_0x4707('0x28')]);router[_0x4707('0x19')](_0x4707('0x13'),auth[_0x4707('0x10')](),controller['addMessage']);router[_0x4707('0x19')](_0x4707('0x29'),auth[_0x4707('0xb')](),interaction[_0x4707('0x2a')]('chat',_0x4707('0x2b')),controller['addTags']);router['put'](_0x4707('0xf'),auth[_0x4707('0xb')](),interaction['tracked']('chat',_0x4707('0x2c')),controller['update']);router[_0x4707('0x2d')](_0x4707('0x2e'),controller[_0x4707('0x2f')]);router['put'](_0x4707('0x30'),auth[_0x4707('0x10')](),controller['abandon']);router[_0x4707('0x2d')](_0x4707('0x31'),controller[_0x4707('0x32')]);router[_0x4707('0x33')](_0x4707('0xf'),auth[_0x4707('0xb')](),interaction['tracked']('chat',_0x4707('0x34')),controller[_0x4707('0x35')]);router[_0x4707('0x33')](_0x4707('0x29'),auth['isAuthenticated'](),controller[_0x4707('0x36')]);module[_0x4707('0x37')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index c5fddfa..7e842f5 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 _0xf151=['TEXT','medium','BOOLEAN','sequelize','exports'];(function(_0x27c63a,_0x443297){var _0x1018ca=function(_0x1902d0){while(--_0x1902d0){_0x27c63a['push'](_0x27c63a['shift']());}};_0x1018ca(++_0x443297);}(_0xf151,0x6c));var _0x1f15=function(_0x3faf6f,_0x389fde){_0x3faf6f=_0x3faf6f-0x0;var _0x402a53=_0xf151[_0x3faf6f];return _0x402a53;};'use strict';var Sequelize=require(_0x1f15('0x0'));module[_0x1f15('0x1')]={'body':{'type':Sequelize[_0x1f15('0x2')](_0x1f15('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1f15('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x1d26=['exports','TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x469b32,_0x30c052){var _0x5c3e2d=function(_0x1f16dd){while(--_0x1f16dd){_0x469b32['push'](_0x469b32['shift']());}};_0x5c3e2d(++_0x30c052);}(_0x1d26,0x65));var _0x61d2=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0x1d26[_0x53b133];return _0x5647e0;};'use strict';var Sequelize=require(_0x61d2('0x0'));module[_0x61d2('0x1')]={'body':{'type':Sequelize[_0x61d2('0x2')](_0x61d2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x61d2('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x61d2('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 9fc2bc2..43a4b7e 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 _0xeac0=['findAll','rows','catch','show','params','includeAll','create','body','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','merge','type','VIRTUAL','options','ChatInternalMessage','include'];(function(_0x308e4f,_0x134e25){var _0x17ab35=function(_0x2cfcd9){while(--_0x2cfcd9){_0x308e4f['push'](_0x308e4f['shift']());}};_0x17ab35(++_0x134e25);}(_0xeac0,0x1db));var _0x0eac=function(_0x406ade,_0x1eccbd){_0x406ade=_0x406ade-0x0;var _0x13962e=_0xeac0[_0x406ade];return _0x13962e;};'use strict';var emlformat=require(_0x0eac('0x0'));var rimraf=require(_0x0eac('0x1'));var zipdir=require(_0x0eac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0eac('0x3'));var moment=require(_0x0eac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0eac('0x5'));var util=require(_0x0eac('0x6'));var path=require(_0x0eac('0x7'));var sox=require(_0x0eac('0x8'));var csv=require(_0x0eac('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0eac('0xa'));var crypto=require('crypto');var jsforce=require(_0x0eac('0xb'));var deskjs=require(_0x0eac('0xc'));var toCsv=require(_0x0eac('0x9'));var querystring=require(_0x0eac('0xd'));var Papa=require(_0x0eac('0xe'));var Redis=require(_0x0eac('0xf'));var authService=require(_0x0eac('0x10'));var qs=require(_0x0eac('0x11'));var as=require(_0x0eac('0x12'));var hardwareService=require(_0x0eac('0x13'));var logger=require(_0x0eac('0x14'))(_0x0eac('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0eac('0x16'))['db'];config[_0x0eac('0x17')]=_[_0x0eac('0x18')](config[_0x0eac('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x0eac('0x19'))(new Redis(config[_0x0eac('0x17')]));require('./chatInternalMessage.socket')[_0x0eac('0x1a')](socket);function respondWithStatusCode(_0x41d172,_0x1f4ffc){_0x1f4ffc=_0x1f4ffc||0xcc;return function(_0x11c9be){if(_0x11c9be){return _0x41d172[_0x0eac('0x1b')](_0x1f4ffc);}return _0x41d172[_0x0eac('0x1c')](_0x1f4ffc)[_0x0eac('0x1d')]();};}function respondWithResult(_0x4d2835,_0x1ce6a1){_0x1ce6a1=_0x1ce6a1||0xc8;return function(_0xdbf5f8){if(_0xdbf5f8){return _0x4d2835[_0x0eac('0x1c')](_0x1ce6a1)[_0x0eac('0x1e')](_0xdbf5f8);}};}function respondWithFilteredResult(_0x33be07,_0x5612b4){return function(_0x521ed1){if(_0x521ed1){var _0x2cc53e=typeof _0x5612b4['offset']===_0x0eac('0x1f')&&typeof _0x5612b4[_0x0eac('0x20')]===_0x0eac('0x1f');var _0x4f9f2d=_0x521ed1[_0x0eac('0x21')];var _0x15fce4=_0x2cc53e?0x0:_0x5612b4[_0x0eac('0x22')];var _0x3725db=_0x2cc53e?_0x521ed1['count']:_0x5612b4[_0x0eac('0x22')]+_0x5612b4[_0x0eac('0x20')];var _0x262536;if(_0x3725db>=_0x4f9f2d){_0x3725db=_0x4f9f2d;_0x262536=0xc8;}else{_0x262536=0xce;}_0x33be07['status'](_0x262536);return _0x33be07[_0x0eac('0x23')](_0x0eac('0x24'),_0x15fce4+'-'+_0x3725db+'/'+_0x4f9f2d)[_0x0eac('0x1e')](_0x521ed1);}return null;};}function patchUpdates(_0x5bcfbf){return function(_0xb7ea8c){try{jsonpatch['apply'](_0xb7ea8c,_0x5bcfbf,!![]);}catch(_0x106aff){return BPromise[_0x0eac('0x25')](_0x106aff);}return _0xb7ea8c[_0x0eac('0x26')]();};}function saveUpdates(_0xcc7764,_0x15ef0f){return function(_0x2bac22){if(_0x2bac22){return _0x2bac22[_0x0eac('0x27')](_0xcc7764)[_0x0eac('0x28')](function(_0x364e22){return _0x364e22;});}return null;};}function removeEntity(_0x43c5c7,_0x2dbf19){return function(_0x3139ff){if(_0x3139ff){return _0x3139ff[_0x0eac('0x29')]()['then'](function(){_0x43c5c7[_0x0eac('0x1c')](0xcc)[_0x0eac('0x1d')]();});}};}function handleEntityNotFound(_0x456d6f,_0x435bd3){return function(_0x5912e0){if(!_0x5912e0){_0x456d6f[_0x0eac('0x1b')](0x194);}return _0x5912e0;};}function handleError(_0x21b5ad,_0x2c4a55){_0x2c4a55=_0x2c4a55||0x1f4;return function(_0x2721b4){logger['error'](_0x2721b4['stack']);if(_0x2721b4[_0x0eac('0x2a')]){delete _0x2721b4[_0x0eac('0x2a')];}_0x21b5ad[_0x0eac('0x1c')](_0x2c4a55)[_0x0eac('0x2b')](_0x2721b4);};}exports[_0x0eac('0x2c')]=function(_0x275684,_0x5f5ba1){var _0x122080={},_0x1ec46e={},_0x5fc801={'count':0x0,'rows':[]};var _0x537a9a=_[_0x0eac('0x2d')](db['ChatInternalMessage'][_0x0eac('0x2e')],function(_0x1ac506){return{'name':_0x1ac506[_0x0eac('0x2f')],'type':_0x1ac506['type']['key']};});_0x1ec46e[_0x0eac('0x30')]=_[_0x0eac('0x2d')](_0x537a9a,_0x0eac('0x2a'));_0x1ec46e[_0x0eac('0x31')]=_[_0x0eac('0x32')](_0x275684[_0x0eac('0x31')]);_0x1ec46e[_0x0eac('0x33')]=_[_0x0eac('0x34')](_0x1ec46e[_0x0eac('0x30')],_0x1ec46e[_0x0eac('0x31')]);_0x122080[_0x0eac('0x35')]=_[_0x0eac('0x34')](_0x1ec46e[_0x0eac('0x30')],qs['fields'](_0x275684[_0x0eac('0x31')][_0x0eac('0x36')]));_0x122080[_0x0eac('0x35')]=_0x122080[_0x0eac('0x35')][_0x0eac('0x37')]?_0x122080[_0x0eac('0x35')]:_0x1ec46e['model'];if(!_0x275684[_0x0eac('0x31')]['hasOwnProperty']('nolimit')){_0x122080[_0x0eac('0x20')]=qs['limit'](_0x275684[_0x0eac('0x31')]['limit']);_0x122080[_0x0eac('0x22')]=qs[_0x0eac('0x22')](_0x275684[_0x0eac('0x31')][_0x0eac('0x22')]);}_0x122080[_0x0eac('0x38')]=qs[_0x0eac('0x39')](_0x275684[_0x0eac('0x31')]['sort']);_0x122080['where']=qs[_0x0eac('0x33')](_['pick'](_0x275684['query'],_0x1ec46e[_0x0eac('0x33')]),_0x537a9a);if(_0x275684[_0x0eac('0x31')][_0x0eac('0x3a')]){_0x122080['where']=_[_0x0eac('0x3b')](_0x122080['where'],{'$or':_[_0x0eac('0x2d')](_0x537a9a,function(_0x2c3d3e){if(_0x2c3d3e[_0x0eac('0x3c')]!==_0x0eac('0x3d')){var _0x21e6e0={};_0x21e6e0[_0x2c3d3e[_0x0eac('0x2a')]]={'$like':'%'+_0x275684[_0x0eac('0x31')]['filter']+'%'};return _0x21e6e0;}})});}_0x122080=_[_0x0eac('0x3b')]({},_0x122080,_0x275684[_0x0eac('0x3e')]);var _0x342945={'where':_0x122080['where']};return db[_0x0eac('0x3f')]['count'](_0x342945)[_0x0eac('0x28')](function(_0x30806b){_0x5fc801['count']=_0x30806b;if(_0x275684[_0x0eac('0x31')]['includeAll']){_0x122080[_0x0eac('0x40')]=[{'all':!![]}];}return db[_0x0eac('0x3f')][_0x0eac('0x41')](_0x122080);})[_0x0eac('0x28')](function(_0x2da445){_0x5fc801[_0x0eac('0x42')]=_0x2da445;return _0x5fc801;})['then'](respondWithFilteredResult(_0x5f5ba1,_0x122080))[_0x0eac('0x43')](handleError(_0x5f5ba1,null));};exports[_0x0eac('0x44')]=function(_0x24719f,_0x335cb1){var _0x37fec8={'raw':!![],'where':{'id':_0x24719f[_0x0eac('0x45')]['id']}},_0x1e8438={};_0x1e8438[_0x0eac('0x30')]=_[_0x0eac('0x32')](db['ChatInternalMessage'][_0x0eac('0x2e')]);_0x1e8438[_0x0eac('0x31')]=_[_0x0eac('0x32')](_0x24719f[_0x0eac('0x31')]);_0x1e8438['filters']=_[_0x0eac('0x34')](_0x1e8438[_0x0eac('0x30')],_0x1e8438['query']);_0x37fec8[_0x0eac('0x35')]=_[_0x0eac('0x34')](_0x1e8438[_0x0eac('0x30')],qs[_0x0eac('0x36')](_0x24719f[_0x0eac('0x31')][_0x0eac('0x36')]));_0x37fec8[_0x0eac('0x35')]=_0x37fec8[_0x0eac('0x35')][_0x0eac('0x37')]?_0x37fec8['attributes']:_0x1e8438[_0x0eac('0x30')];if(_0x24719f[_0x0eac('0x31')][_0x0eac('0x46')]){_0x37fec8[_0x0eac('0x40')]=[{'all':!![]}];}_0x37fec8=_['merge']({},_0x37fec8,_0x24719f[_0x0eac('0x3e')]);return db[_0x0eac('0x3f')]['find'](_0x37fec8)['then'](handleEntityNotFound(_0x335cb1,null))['then'](respondWithResult(_0x335cb1,null))[_0x0eac('0x43')](handleError(_0x335cb1,null));};exports['create']=function(_0x19adea,_0x34789e){return db[_0x0eac('0x3f')][_0x0eac('0x47')](_0x19adea['body'],{})[_0x0eac('0x28')](respondWithResult(_0x34789e,0xc9))[_0x0eac('0x43')](handleError(_0x34789e,null));};exports[_0x0eac('0x27')]=function(_0x493f5c,_0x4bff78){if(_0x493f5c[_0x0eac('0x48')]['id']){delete _0x493f5c[_0x0eac('0x48')]['id'];}return db['ChatInternalMessage'][_0x0eac('0x49')]({'where':{'id':_0x493f5c['params']['id']}})[_0x0eac('0x28')](handleEntityNotFound(_0x4bff78,null))[_0x0eac('0x28')](saveUpdates(_0x493f5c[_0x0eac('0x48')],null))[_0x0eac('0x28')](respondWithResult(_0x4bff78,null))['catch'](handleError(_0x4bff78,null));};exports['destroy']=function(_0x161cd7,_0x78b013){return db['ChatInternalMessage']['find']({'where':{'id':_0x161cd7['params']['id']}})[_0x0eac('0x28')](handleEntityNotFound(_0x78b013,null))[_0x0eac('0x28')](removeEntity(_0x78b013,null))[_0x0eac('0x43')](handleError(_0x78b013,null));};exports[_0x0eac('0x4a')]=function(_0x56a26d,_0x586f4e){return db[_0x0eac('0x3f')][_0x0eac('0x4a')]()[_0x0eac('0x28')](respondWithResult(_0x586f4e,null))[_0x0eac('0x43')](handleError(_0x586f4e,null));};function wrapUser(_0x22fc83){return function(_0x5b0fa3){var _0xa4101f=_0x22fc83[_0x0eac('0x4b')]({'plain':!![]});_0xa4101f[_0x0eac('0x4c')]=[];if(_0x5b0fa3){_0xa4101f[_0x0eac('0x4d')]=_0x5b0fa3[_0x0eac('0x4e')];_0xa4101f[_0x0eac('0x4f')]=_0x5b0fa3;}else{_0xa4101f[_0x0eac('0x4d')]=moment(0x0)[_0x0eac('0x50')](_0x0eac('0x51'));_0xa4101f[_0x0eac('0x4f')]={};}return _0xa4101f;};}exports[_0x0eac('0x52')]=function(_0x439c07,_0x510cbc,_0x1521d3){var _0x4939b4=[];return db['User'][_0x0eac('0x41')]({'where':{'role':[_0x0eac('0x53'),_0x0eac('0x54'),_0x0eac('0x55')]},'attributes':['id','fullname','name','role','userpic','internal',_0x0eac('0x56'),_0x0eac('0x57'),_0x0eac('0x58'),_0x0eac('0x59')],'order':qs[_0x0eac('0x39')](_0x0eac('0x5a')),'include':[{'model':db[_0x0eac('0x5b')],'as':_0x0eac('0x5c'),'attributes':['id',_0x0eac('0x2a'),'type'],'through':{'attributes':[]}}]})[_0x0eac('0x28')](function(_0x47ed43){if(_0x47ed43){var _0x49bde6=_0x439c07[_0x0eac('0x55')][_0x0eac('0x4b')]({'plain':!![]});if(!_0x49bde6)throw new Error(_0x0eac('0x5d'));if(_0x49bde6[_0x0eac('0x5e')]==='user'){return db[_0x0eac('0x5f')][_0x0eac('0x49')]({'where':{'name':_0x0eac('0x60'),'userProfileId':_0x49bde6[_0x0eac('0x61')]},'raw':!![]})[_0x0eac('0x28')](function(_0x50ce63){if(_0x50ce63){if(_0x50ce63[_0x0eac('0x62')]===0x0){return db[_0x0eac('0x63')][_0x0eac('0x41')]({'where':{'sectionId':_0x50ce63['id']},'raw':!![]})['then'](function(_0x469413){var _0x282d5c=[];if(_[_0x0eac('0x64')](_0x469413)){_0x282d5c=_['filter'](_0x47ed43,function(_0x42290c){if(_0x42290c[_0x0eac('0x5e')]!==_0x0eac('0x53')){return _0x42290c;}});return _0x282d5c;}else{for(var _0x37c4de=0x0;_0x37c4de<_0x47ed43['length'];_0x37c4de++){var _0x4f230e=_0x47ed43[_0x37c4de];if(_0x4f230e[_0x0eac('0x5e')]===_0x0eac('0x53')){var _0x475ccc=_[_0x0eac('0x49')](_0x469413,function(_0x27d709){return _0x27d709[_0x0eac('0x65')]===_0x4f230e['id'];});if(_0x475ccc)_0x282d5c[_0x0eac('0x66')](_0x4f230e);}else{_0x282d5c['push'](_0x4f230e);}}return _0x282d5c;}});}else{return _0x47ed43;}}else{var _0x28e61f=_[_0x0eac('0x3a')](_0x47ed43,function(_0x2b8a44){if(_0x2b8a44[_0x0eac('0x5e')]!==_0x0eac('0x53')){return _0x2b8a44;}});return _0x28e61f;}});}else{return _0x47ed43;}}})['then'](function(_0x4f2616){var _0x2fcb9d=[];if(_0x4f2616){_0x4939b4=_0x4f2616;for(var _0xea141=0x0;_0xea141<_0x4f2616[_0x0eac('0x37')];_0xea141+=0x1){_0x4939b4[_0xea141]['messages']=[];_0x2fcb9d[_0x0eac('0x66')](db[_0x0eac('0x3f')][_0x0eac('0x49')]({'where':{'FromId':[_0x439c07[_0x0eac('0x55')]['id'],_0x4f2616[_0xea141]['id']],'ToId':[_0x439c07[_0x0eac('0x55')]['id'],_0x4f2616[_0xea141]['id']],'ChatGroupId':null},'attributes':['id',_0x0eac('0x4e'),_0x0eac('0x67'),_0x0eac('0x68'),_0x0eac('0x69'),_0x0eac('0x48')],'order':qs['sort'](_0x0eac('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x0eac('0x28')](wrapUser(_0x4f2616[_0xea141])));}return BPromise[_0x0eac('0x6b')](_0x2fcb9d);}return[];})[_0x0eac('0x28')](function(_0x4c8133){return{'rows':_0x4c8133,'count':_0x4c8133[_0x0eac('0x37')]};})[_0x0eac('0x28')](respondWithResult(_0x510cbc,null))['catch'](handleError(_0x510cbc,null));};
\ No newline at end of file
+var _0xea05=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','limit','count','offset','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','index','fieldName','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','map','type','VIRTUAL','filter','merge','options','ChatInternalMessage','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','body','describe','get','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues'];(function(_0x5c9b80,_0x2b2722){var _0x363d13=function(_0x3c77ba){while(--_0x3c77ba){_0x5c9b80['push'](_0x5c9b80['shift']());}};_0x363d13(++_0x2b2722);}(_0xea05,0x83));var _0x5ea0=function(_0x84b8c7,_0x5962ba){_0x84b8c7=_0x84b8c7-0x0;var _0x3aadf3=_0xea05[_0x84b8c7];return _0x3aadf3;};'use strict';var emlformat=require(_0x5ea0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5ea0('0x1'));var jsonpatch=require(_0x5ea0('0x2'));var rp=require('request-promise');var moment=require(_0x5ea0('0x3'));var BPromise=require(_0x5ea0('0x4'));var Mustache=require('mustache');var util=require(_0x5ea0('0x5'));var path=require(_0x5ea0('0x6'));var sox=require(_0x5ea0('0x7'));var csv=require(_0x5ea0('0x8'));var ejs=require(_0x5ea0('0x9'));var fs=require('fs');var fs_extra=require(_0x5ea0('0xa'));var _=require(_0x5ea0('0xb'));var squel=require(_0x5ea0('0xc'));var crypto=require(_0x5ea0('0xd'));var jsforce=require(_0x5ea0('0xe'));var deskjs=require(_0x5ea0('0xf'));var toCsv=require(_0x5ea0('0x8'));var querystring=require(_0x5ea0('0x10'));var Papa=require(_0x5ea0('0x11'));var Redis=require(_0x5ea0('0x12'));var authService=require(_0x5ea0('0x13'));var qs=require(_0x5ea0('0x14'));var as=require(_0x5ea0('0x15'));var hardwareService=require(_0x5ea0('0x16'));var logger=require(_0x5ea0('0x17'))(_0x5ea0('0x18'));var utils=require(_0x5ea0('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5ea0('0x1a'));var db=require(_0x5ea0('0x1b'))['db'];config[_0x5ea0('0x1c')]=_[_0x5ea0('0x1d')](config[_0x5ea0('0x1c')],{'host':_0x5ea0('0x1e'),'port':0x18eb});var socket=require(_0x5ea0('0x1f'))(new Redis(config[_0x5ea0('0x1c')]));require(_0x5ea0('0x20'))[_0x5ea0('0x21')](socket);function respondWithStatusCode(_0x27f9a0,_0x2e9a80){_0x2e9a80=_0x2e9a80||0xcc;return function(_0x226785){if(_0x226785){return _0x27f9a0['sendStatus'](_0x2e9a80);}return _0x27f9a0[_0x5ea0('0x22')](_0x2e9a80)[_0x5ea0('0x23')]();};}function respondWithResult(_0xc2c60d,_0x2e5e97){_0x2e5e97=_0x2e5e97||0xc8;return function(_0x29a37c){if(_0x29a37c){return _0xc2c60d[_0x5ea0('0x22')](_0x2e5e97)[_0x5ea0('0x24')](_0x29a37c);}};}function respondWithFilteredResult(_0x47d8c5,_0x598f47){return function(_0x16db39){if(_0x16db39){var _0x586cd5=typeof _0x598f47['offset']==='undefined'&&typeof _0x598f47[_0x5ea0('0x25')]==='undefined';var _0x56467d=_0x16db39[_0x5ea0('0x26')];var _0x4cb2fc=_0x586cd5?0x0:_0x598f47[_0x5ea0('0x27')];var _0x434f02=_0x586cd5?_0x16db39[_0x5ea0('0x26')]:_0x598f47[_0x5ea0('0x27')]+_0x598f47[_0x5ea0('0x25')];var _0xeaefd8;if(_0x434f02>=_0x56467d){_0x434f02=_0x56467d;_0xeaefd8=0xc8;}else{_0xeaefd8=0xce;}_0x47d8c5['status'](_0xeaefd8);return _0x47d8c5['set']('Content-Range',_0x4cb2fc+'-'+_0x434f02+'/'+_0x56467d)[_0x5ea0('0x24')](_0x16db39);}return null;};}function patchUpdates(_0xbce8ce){return function(_0x2bb4db){try{jsonpatch[_0x5ea0('0x28')](_0x2bb4db,_0xbce8ce,!![]);}catch(_0x5a8b46){return BPromise[_0x5ea0('0x29')](_0x5a8b46);}return _0x2bb4db[_0x5ea0('0x2a')]();};}function saveUpdates(_0x4a2d3b,_0x245752){return function(_0x56ed3e){if(_0x56ed3e){return _0x56ed3e[_0x5ea0('0x2b')](_0x4a2d3b)['then'](function(_0x3dadc7){return _0x3dadc7;});}return null;};}function removeEntity(_0x37a659,_0x14cfb5){return function(_0x48afb8){if(_0x48afb8){return _0x48afb8[_0x5ea0('0x2c')]()[_0x5ea0('0x2d')](function(){_0x37a659[_0x5ea0('0x22')](0xcc)[_0x5ea0('0x23')]();});}};}function handleEntityNotFound(_0x5e2f4e,_0x4ac6ec){return function(_0x57e07f){if(!_0x57e07f){_0x5e2f4e[_0x5ea0('0x2e')](0x194);}return _0x57e07f;};}function handleError(_0x1ead56,_0x1d6118){_0x1d6118=_0x1d6118||0x1f4;return function(_0x2bb165){logger[_0x5ea0('0x2f')](_0x2bb165[_0x5ea0('0x30')]);if(_0x2bb165[_0x5ea0('0x31')]){delete _0x2bb165[_0x5ea0('0x31')];}_0x1ead56[_0x5ea0('0x22')](_0x1d6118)['send'](_0x2bb165);};}exports[_0x5ea0('0x32')]=function(_0x379a8a,_0x31491e){var _0x2c095b={},_0x36c3c7={},_0x568322={'count':0x0,'rows':[]};var _0x42061c=_['map'](db['ChatInternalMessage']['rawAttributes'],function(_0x83e0f5){return{'name':_0x83e0f5[_0x5ea0('0x33')],'type':_0x83e0f5['type']['key']};});_0x36c3c7[_0x5ea0('0x34')]=_['map'](_0x42061c,_0x5ea0('0x31'));_0x36c3c7[_0x5ea0('0x35')]=_[_0x5ea0('0x36')](_0x379a8a[_0x5ea0('0x35')]);_0x36c3c7['filters']=_[_0x5ea0('0x37')](_0x36c3c7[_0x5ea0('0x34')],_0x36c3c7[_0x5ea0('0x35')]);_0x2c095b[_0x5ea0('0x38')]=_[_0x5ea0('0x37')](_0x36c3c7[_0x5ea0('0x34')],qs[_0x5ea0('0x39')](_0x379a8a[_0x5ea0('0x35')][_0x5ea0('0x39')]));_0x2c095b[_0x5ea0('0x38')]=_0x2c095b[_0x5ea0('0x38')][_0x5ea0('0x3a')]?_0x2c095b['attributes']:_0x36c3c7['model'];if(!_0x379a8a[_0x5ea0('0x35')]['hasOwnProperty'](_0x5ea0('0x3b'))){_0x2c095b['limit']=qs[_0x5ea0('0x25')](_0x379a8a[_0x5ea0('0x35')][_0x5ea0('0x25')]);_0x2c095b[_0x5ea0('0x27')]=qs['offset'](_0x379a8a['query'][_0x5ea0('0x27')]);}_0x2c095b[_0x5ea0('0x3c')]=qs[_0x5ea0('0x3d')](_0x379a8a[_0x5ea0('0x35')]['sort']);_0x2c095b[_0x5ea0('0x3e')]=qs['filters'](_[_0x5ea0('0x3f')](_0x379a8a[_0x5ea0('0x35')],_0x36c3c7[_0x5ea0('0x40')]),_0x42061c);if(_0x379a8a[_0x5ea0('0x35')]['filter']){_0x2c095b[_0x5ea0('0x3e')]=_['merge'](_0x2c095b[_0x5ea0('0x3e')],{'$or':_[_0x5ea0('0x41')](_0x42061c,function(_0x44000a){if(_0x44000a[_0x5ea0('0x42')]!==_0x5ea0('0x43')){var _0x3e98d6={};_0x3e98d6[_0x44000a['name']]={'$like':'%'+_0x379a8a[_0x5ea0('0x35')][_0x5ea0('0x44')]+'%'};return _0x3e98d6;}})});}_0x2c095b=_[_0x5ea0('0x45')]({},_0x2c095b,_0x379a8a[_0x5ea0('0x46')]);var _0x484df1={'where':_0x2c095b[_0x5ea0('0x3e')]};return db[_0x5ea0('0x47')]['count'](_0x484df1)[_0x5ea0('0x2d')](function(_0xaf5df4){_0x568322[_0x5ea0('0x26')]=_0xaf5df4;if(_0x379a8a[_0x5ea0('0x35')][_0x5ea0('0x48')]){_0x2c095b[_0x5ea0('0x49')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x5ea0('0x4a')](_0x2c095b);})['then'](function(_0x3559cd){_0x568322[_0x5ea0('0x4b')]=_0x3559cd;return _0x568322;})[_0x5ea0('0x2d')](respondWithFilteredResult(_0x31491e,_0x2c095b))['catch'](handleError(_0x31491e,null));};exports[_0x5ea0('0x4c')]=function(_0x2213c8,_0x2222a8){var _0xb1a8f3={'raw':!![],'where':{'id':_0x2213c8[_0x5ea0('0x4d')]['id']}},_0x4ce40b={};_0x4ce40b['model']=_[_0x5ea0('0x36')](db[_0x5ea0('0x47')][_0x5ea0('0x4e')]);_0x4ce40b[_0x5ea0('0x35')]=_[_0x5ea0('0x36')](_0x2213c8[_0x5ea0('0x35')]);_0x4ce40b[_0x5ea0('0x40')]=_['intersection'](_0x4ce40b['model'],_0x4ce40b[_0x5ea0('0x35')]);_0xb1a8f3[_0x5ea0('0x38')]=_[_0x5ea0('0x37')](_0x4ce40b[_0x5ea0('0x34')],qs[_0x5ea0('0x39')](_0x2213c8['query'][_0x5ea0('0x39')]));_0xb1a8f3['attributes']=_0xb1a8f3['attributes']['length']?_0xb1a8f3[_0x5ea0('0x38')]:_0x4ce40b['model'];if(_0x2213c8['query'][_0x5ea0('0x48')]){_0xb1a8f3['include']=[{'all':!![]}];}_0xb1a8f3=_['merge']({},_0xb1a8f3,_0x2213c8[_0x5ea0('0x46')]);return db['ChatInternalMessage'][_0x5ea0('0x4f')](_0xb1a8f3)[_0x5ea0('0x2d')](handleEntityNotFound(_0x2222a8,null))[_0x5ea0('0x2d')](respondWithResult(_0x2222a8,null))[_0x5ea0('0x50')](handleError(_0x2222a8,null));};exports['create']=function(_0x37b7d4,_0x3aa424){return db[_0x5ea0('0x47')]['create'](_0x37b7d4['body'],{})[_0x5ea0('0x2d')](respondWithResult(_0x3aa424,0xc9))[_0x5ea0('0x50')](handleError(_0x3aa424,null));};exports[_0x5ea0('0x2b')]=function(_0x1b64c2,_0x4f7f52){if(_0x1b64c2['body']['id']){delete _0x1b64c2[_0x5ea0('0x51')]['id'];}return db[_0x5ea0('0x47')][_0x5ea0('0x4f')]({'where':{'id':_0x1b64c2[_0x5ea0('0x4d')]['id']}})[_0x5ea0('0x2d')](handleEntityNotFound(_0x4f7f52,null))[_0x5ea0('0x2d')](saveUpdates(_0x1b64c2[_0x5ea0('0x51')],null))[_0x5ea0('0x2d')](respondWithResult(_0x4f7f52,null))[_0x5ea0('0x50')](handleError(_0x4f7f52,null));};exports[_0x5ea0('0x2c')]=function(_0x51b1d5,_0x3351d6){return db[_0x5ea0('0x47')][_0x5ea0('0x4f')]({'where':{'id':_0x51b1d5[_0x5ea0('0x4d')]['id']}})[_0x5ea0('0x2d')](handleEntityNotFound(_0x3351d6,null))['then'](removeEntity(_0x3351d6,null))['catch'](handleError(_0x3351d6,null));};exports[_0x5ea0('0x52')]=function(_0x25862d,_0x24702e){return db[_0x5ea0('0x47')]['describe']()[_0x5ea0('0x2d')](respondWithResult(_0x24702e,null))[_0x5ea0('0x50')](handleError(_0x24702e,null));};function wrapUser(_0x2ecb8d){return function(_0x4a7a67){var _0x2ba0cd=_0x2ecb8d[_0x5ea0('0x53')]({'plain':!![]});_0x2ba0cd['messages']=[];if(_0x4a7a67){_0x2ba0cd['lastMessageAt']=_0x4a7a67[_0x5ea0('0x54')];_0x2ba0cd[_0x5ea0('0x55')]=_0x4a7a67;}else{_0x2ba0cd[_0x5ea0('0x56')]=moment(0x0)[_0x5ea0('0x57')](_0x5ea0('0x58'));_0x2ba0cd[_0x5ea0('0x55')]={};}return _0x2ba0cd;};}exports[_0x5ea0('0x59')]=function(_0xf22317,_0x5923f3,_0x22a509){var _0x1c7ec9=[];return db[_0x5ea0('0x5a')][_0x5ea0('0x4a')]({'where':{'role':[_0x5ea0('0x5b'),_0x5ea0('0x5c'),'user']},'attributes':['id',_0x5ea0('0x5d'),'name',_0x5ea0('0x5e'),_0x5ea0('0x5f'),_0x5ea0('0x60'),_0x5ea0('0x61'),_0x5ea0('0x62'),'allowmessenger',_0x5ea0('0x63')],'order':qs[_0x5ea0('0x3d')](_0x5ea0('0x64')),'include':[{'model':db[_0x5ea0('0x65')],'as':_0x5ea0('0x66'),'attributes':['id',_0x5ea0('0x31'),_0x5ea0('0x42')],'through':{'attributes':[]}}]})['then'](function(_0xc2f8e){if(_0xc2f8e){var _0x5e06f3=_0xf22317[_0x5ea0('0x67')][_0x5ea0('0x53')]({'plain':!![]});if(!_0x5e06f3)throw new Error(_0x5ea0('0x68'));if(_0x5e06f3[_0x5ea0('0x5e')]===_0x5ea0('0x67')){return db[_0x5ea0('0x69')][_0x5ea0('0x4f')]({'where':{'name':_0x5ea0('0x6a'),'userProfileId':_0x5e06f3['userProfileId']},'raw':!![]})['then'](function(_0x4f0f13){if(_0x4f0f13){if(_0x4f0f13[_0x5ea0('0x6b')]===0x0){return db[_0x5ea0('0x6c')]['findAll']({'where':{'sectionId':_0x4f0f13['id']},'raw':!![]})['then'](function(_0x19d850){var _0x2c8eb1=[];if(_[_0x5ea0('0x6d')](_0x19d850)){_0x2c8eb1=_[_0x5ea0('0x44')](_0xc2f8e,function(_0xfed606){if(_0xfed606[_0x5ea0('0x5e')]!=='agent'){return _0xfed606;}});return _0x2c8eb1;}else{for(var _0x2903a5=0x0;_0x2903a5<_0xc2f8e[_0x5ea0('0x3a')];_0x2903a5++){var _0x11ac33=_0xc2f8e[_0x2903a5];if(_0x11ac33[_0x5ea0('0x5e')]===_0x5ea0('0x5b')){var _0x183b8e=_[_0x5ea0('0x4f')](_0x19d850,function(_0x1a4242){return _0x1a4242[_0x5ea0('0x6e')]===_0x11ac33['id'];});if(_0x183b8e)_0x2c8eb1['push'](_0x11ac33);}else{_0x2c8eb1[_0x5ea0('0x6f')](_0x11ac33);}}return _0x2c8eb1;}});}else{return _0xc2f8e;}}else{var _0x36270a=_[_0x5ea0('0x44')](_0xc2f8e,function(_0x24af22){if(_0x24af22['role']!==_0x5ea0('0x5b')){return _0x24af22;}});return _0x36270a;}});}else{return _0xc2f8e;}}})[_0x5ea0('0x2d')](function(_0x1e0bd7){var _0x39123c=[];if(_0x1e0bd7){_0x1c7ec9=_0x1e0bd7;for(var _0x4cb482=0x0;_0x4cb482<_0x1e0bd7['length'];_0x4cb482+=0x1){_0x1c7ec9[_0x4cb482][_0x5ea0('0x70')]=[];_0x39123c[_0x5ea0('0x6f')](db[_0x5ea0('0x47')]['find']({'where':{'FromId':[_0xf22317[_0x5ea0('0x67')]['id'],_0x1e0bd7[_0x4cb482]['id']],'ToId':[_0xf22317[_0x5ea0('0x67')]['id'],_0x1e0bd7[_0x4cb482]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x5ea0('0x71'),_0x5ea0('0x72'),_0x5ea0('0x51')],'order':qs[_0x5ea0('0x3d')](_0x5ea0('0x73')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5ea0('0x2d')](wrapUser(_0x1e0bd7[_0x4cb482])));}return BPromise[_0x5ea0('0x74')](_0x39123c);}return[];})[_0x5ea0('0x2d')](function(_0x37919f){return{'rows':_0x37919f,'count':_0x37919f['length']};})['then'](respondWithResult(_0x5923f3,null))[_0x5ea0('0x50')](handleError(_0x5923f3,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index f22d372..13512b3 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 _0x8074=['save','update','remove','emit','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x5c6244,_0x112ab8){var _0x5800ce=function(_0x304e3d){while(--_0x304e3d){_0x5c6244['push'](_0x5c6244['shift']());}};_0x5800ce(++_0x112ab8);}(_0x8074,0x175));var _0x4807=function(_0x4dd37d,_0xfa992f){_0x4dd37d=_0x4dd37d-0x0;var _0x59e3e4=_0x8074[_0x4dd37d];return _0x59e3e4;};'use strict';var EventEmitter=require(_0x4807('0x0'));var ChatInternalMessage=require(_0x4807('0x1'))['db'][_0x4807('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4807('0x3'),'afterUpdate':_0x4807('0x4'),'afterDestroy':_0x4807('0x5')};function emitEvent(_0x52ee5e){return function(_0x53ce14,_0x1d05e7,_0x268da1){ChatInternalMessageEvents[_0x4807('0x6')](_0x52ee5e+':'+_0x53ce14['id'],_0x53ce14);ChatInternalMessageEvents[_0x4807('0x6')](_0x52ee5e,_0x53ce14);_0x268da1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x4807('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xb346=['events','../../mysqldb','setMaxListeners','save','update','remove','exports'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xb346,0xcb));var _0x6b34=function(_0x4cad3a,_0xdce040){_0x4cad3a=_0x4cad3a-0x0;var _0x3d20b2=_0xb346[_0x4cad3a];return _0x3d20b2;};'use strict';var EventEmitter=require(_0x6b34('0x0'));var ChatInternalMessage=require(_0x6b34('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6b34('0x2')](0x0);var events={'afterCreate':_0x6b34('0x3'),'afterUpdate':_0x6b34('0x4'),'afterDestroy':_0x6b34('0x5')};function emitEvent(_0x59805e){return function(_0x5e1406,_0x56e6dd,_0x49c8ec){ChatInternalMessageEvents['emit'](_0x59805e+':'+_0x5e1406['id'],_0x5e1406);ChatInternalMessageEvents['emit'](_0x59805e,_0x5e1406);_0x49c8ec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x6b34('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 3b5a2a4..4f43569 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 _0x8f77=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x4c1e63,_0x296a91){var _0x45d095=function(_0x351b45){while(--_0x351b45){_0x4c1e63['push'](_0x4c1e63['shift']());}};_0x45d095(++_0x296a91);}(_0x8f77,0x168));var _0x78f7=function(_0x317894,_0x592674){_0x317894=_0x317894-0x0;var _0x3aacf7=_0x8f77[_0x317894];return _0x3aacf7;};'use strict';var _=require(_0x78f7('0x0'));var util=require(_0x78f7('0x1'));var logger=require('../../config/logger')(_0x78f7('0x2'));var moment=require(_0x78f7('0x3'));var BPromise=require(_0x78f7('0x4'));var rp=require(_0x78f7('0x5'));var fs=require('fs');var path=require(_0x78f7('0x6'));var rimraf=require(_0x78f7('0x7'));var config=require(_0x78f7('0x8'));var attributes=require(_0x78f7('0x9'));module['exports']=function(_0x5adb2c,_0x30ec96){return _0x5adb2c[_0x78f7('0xa')](_0x78f7('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x78f7('0xc')});};
\ No newline at end of file
+var _0xbbba=['rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbbba,0x1d5));var _0xabbb=function(_0x46ef1d,_0x24926){_0x46ef1d=_0x46ef1d-0x0;var _0x49ce69=_0xbbba[_0x46ef1d];return _0x49ce69;};'use strict';var _=require(_0xabbb('0x0'));var util=require('util');var logger=require(_0xabbb('0x1'))(_0xabbb('0x2'));var moment=require(_0xabbb('0x3'));var BPromise=require(_0xabbb('0x4'));var rp=require(_0xabbb('0x5'));var fs=require('fs');var path=require(_0xabbb('0x6'));var rimraf=require(_0xabbb('0x7'));var config=require(_0xabbb('0x8'));var attributes=require(_0xabbb('0x9'));module['exports']=function(_0x239819,_0x197656){return _0x239819[_0xabbb('0xa')](_0xabbb('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xabbb('0xc'),'collate':_0xabbb('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 1ac3c35..da1b965 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 _0xda7f=['redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4529c2,_0x18370a){var _0x173e80=function(_0x4e7fa3){while(--_0x4e7fa3){_0x4529c2['push'](_0x4529c2['shift']());}};_0x173e80(++_0x18370a);}(_0xda7f,0xc6));var _0xfda7=function(_0x2d3ba8,_0x168519){_0x2d3ba8=_0x2d3ba8-0x0;var _0x41b210=_0xda7f[_0x2d3ba8];return _0x41b210;};'use strict';var _=require(_0xfda7('0x0'));var util=require('util');var moment=require(_0xfda7('0x1'));var BPromise=require(_0xfda7('0x2'));var rs=require(_0xfda7('0x3'));var fs=require('fs');var Redis=require(_0xfda7('0x4'));var db=require(_0xfda7('0x5'))['db'];var utils=require(_0xfda7('0x6'));var logger=require(_0xfda7('0x7'))(_0xfda7('0x8'));var config=require('../../config/environment');var jayson=require(_0xfda7('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xfda7('0xa')]=_[_0xfda7('0xb')](config[_0xfda7('0xa')],{'host':_0xfda7('0xc'),'port':0x18eb});var socket=require(_0xfda7('0xd'))(new Redis(config[_0xfda7('0xa')]));require(_0xfda7('0xe'))[_0xfda7('0xf')](socket);function respondWithRpcPromise(_0x20ffe4,_0x2c812c,_0x147837){return new BPromise(function(_0xddf6d8,_0x24f16e){return client['request'](_0x20ffe4,_0x147837)['then'](function(_0x24363e){logger[_0xfda7('0x10')](_0xfda7('0x11'),_0x2c812c,'request\x20sent');logger[_0xfda7('0x12')](_0xfda7('0x13'),_0x2c812c,_0xfda7('0x14'),JSON['stringify'](_0x24363e));if(_0x24363e[_0xfda7('0x15')]){if(_0x24363e[_0xfda7('0x15')][_0xfda7('0x16')]===0x1f4){logger[_0xfda7('0x15')](_0xfda7('0x11'),_0x2c812c,_0x24363e['error'][_0xfda7('0x17')]);return _0x24f16e(_0x24363e[_0xfda7('0x15')][_0xfda7('0x17')]);}logger[_0xfda7('0x15')](_0xfda7('0x11'),_0x2c812c,_0x24363e[_0xfda7('0x15')][_0xfda7('0x17')]);return _0xddf6d8(_0x24363e[_0xfda7('0x15')]['message']);}else{logger['info'](_0xfda7('0x11'),_0x2c812c,_0xfda7('0x14'));_0xddf6d8(_0x24363e[_0xfda7('0x18')][_0xfda7('0x17')]);}})[_0xfda7('0x19')](function(_0x337cd0){logger[_0xfda7('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2c812c,_0x337cd0);_0x24f16e(_0x337cd0);});});}
\ No newline at end of file
+var _0x7764=['localhost','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','bluebird','randomstring','rpc','../../config/environment','http','redis','defaults'];(function(_0x5f1b75,_0x29f705){var _0x416250=function(_0x579136){while(--_0x579136){_0x5f1b75['push'](_0x5f1b75['shift']());}};_0x416250(++_0x29f705);}(_0x7764,0xa8));var _0x4776=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x7764[_0x6a0266];return _0x309e00;};'use strict';var _=require(_0x4776('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4776('0x1'));var rs=require(_0x4776('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4776('0x3'));var config=require(_0x4776('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4776('0x5')]({'port':0x232a});config[_0x4776('0x6')]=_[_0x4776('0x7')](config[_0x4776('0x6')],{'host':_0x4776('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4776('0x6')]));require(_0x4776('0x9'))[_0x4776('0xa')](socket);function respondWithRpcPromise(_0x54c704,_0x4e7ce4,_0x7510b3){return new BPromise(function(_0x13be9b,_0x351038){return client[_0x4776('0xb')](_0x54c704,_0x7510b3)[_0x4776('0xc')](function(_0x1899d5){logger['info'](_0x4776('0xd'),_0x4e7ce4,'request\x20sent');logger['debug'](_0x4776('0xe'),_0x4e7ce4,_0x4776('0xf'),JSON['stringify'](_0x1899d5));if(_0x1899d5[_0x4776('0x10')]){if(_0x1899d5['error'][_0x4776('0x11')]===0x1f4){logger[_0x4776('0x10')](_0x4776('0xd'),_0x4e7ce4,_0x1899d5['error'][_0x4776('0x12')]);return _0x351038(_0x1899d5[_0x4776('0x10')]['message']);}logger[_0x4776('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x4e7ce4,_0x1899d5[_0x4776('0x10')]['message']);return _0x13be9b(_0x1899d5[_0x4776('0x10')][_0x4776('0x12')]);}else{logger[_0x4776('0x13')](_0x4776('0xd'),_0x4e7ce4,_0x4776('0xf'));_0x13be9b(_0x1899d5[_0x4776('0x14')]['message']);}})[_0x4776('0x15')](function(_0x1b080a){logger[_0x4776('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x4e7ce4,_0x1b080a);_0x351038(_0x1b080a);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 34cca02..2fcdc17 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 _0xef6d=['./chatInternalMessage.events','remove','update','emit','removeListener','register','length'];(function(_0xa259f8,_0x328468){var _0x1c6122=function(_0x25a2d2){while(--_0x25a2d2){_0xa259f8['push'](_0xa259f8['shift']());}};_0x1c6122(++_0x328468);}(_0xef6d,0x9a));var _0xdef6=function(_0x563b83,_0x127542){_0x563b83=_0x563b83-0x0;var _0x327e62=_0xef6d[_0x563b83];return _0x327e62;};'use strict';var ChatInternalMessageEvents=require(_0xdef6('0x0'));var events=['save',_0xdef6('0x1'),_0xdef6('0x2')];function createListener(_0x3181ab,_0x45611e){return function(_0x21a1ae){_0x45611e[_0xdef6('0x3')](_0x3181ab,_0x21a1ae);};}function removeListener(_0x2333a2,_0x1a0fb1){return function(){ChatInternalMessageEvents[_0xdef6('0x4')](_0x2333a2,_0x1a0fb1);};}exports[_0xdef6('0x5')]=function(_0x102c3f){for(var _0x3cc298=0x0,_0x187faa=events[_0xdef6('0x6')];_0x3cc298<_0x187faa;_0x3cc298++){var _0x4b0e11=events[_0x3cc298];var _0x23af9f=createListener('chatInternalMessage:'+_0x4b0e11,_0x102c3f);ChatInternalMessageEvents['on'](_0x4b0e11,_0x23af9f);}};
\ No newline at end of file
+var _0x410c=['update','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x414407,_0x126c2d){var _0x556184=function(_0x2fd6d4){while(--_0x2fd6d4){_0x414407['push'](_0x414407['shift']());}};_0x556184(++_0x126c2d);}(_0x410c,0x75));var _0xc410=function(_0x1a43a8,_0x2396dc){_0x1a43a8=_0x1a43a8-0x0;var _0x4a7b9b=_0x410c[_0x1a43a8];return _0x4a7b9b;};'use strict';var ChatInternalMessageEvents=require(_0xc410('0x0'));var events=[_0xc410('0x1'),_0xc410('0x2'),_0xc410('0x3')];function createListener(_0x361d70,_0x1e7227){return function(_0x384ed4){_0x1e7227['emit'](_0x361d70,_0x384ed4);};}function removeListener(_0x21c3fe,_0x3c64d6){return function(){ChatInternalMessageEvents[_0xc410('0x4')](_0x21c3fe,_0x3c64d6);};}exports[_0xc410('0x5')]=function(_0xe914d7){for(var _0x35554a=0x0,_0x13d91d=events[_0xc410('0x6')];_0x35554a<_0x13d91d;_0x35554a++){var _0x402f89=events[_0x35554a];var _0x32039a=createListener(_0xc410('0x7')+_0x402f89,_0xe914d7);ChatInternalMessageEvents['on'](_0x402f89,_0x32039a);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 97d5115..4f55398 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 _0xf2b9=['post','create','put','update','delete','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','/:id','show'];(function(_0x385567,_0x40550f){var _0x49cf95=function(_0x4d3081){while(--_0x4d3081){_0x385567['push'](_0x385567['shift']());}};_0x49cf95(++_0x40550f);}(_0xf2b9,0x123));var _0x9f2b=function(_0x823d69,_0x2f7e02){_0x823d69=_0x823d69-0x0;var _0x2b2073=_0xf2b9[_0x823d69];return _0x2b2073;};'use strict';var multer=require(_0x9f2b('0x0'));var util=require(_0x9f2b('0x1'));var path=require(_0x9f2b('0x2'));var timeout=require('connect-timeout');var express=require(_0x9f2b('0x3'));var router=express[_0x9f2b('0x4')]();var fs_extra=require(_0x9f2b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9f2b('0x6'));var config=require(_0x9f2b('0x7'));var controller=require(_0x9f2b('0x8'));router[_0x9f2b('0x9')]('/',auth[_0x9f2b('0xa')](),controller[_0x9f2b('0xb')]);router[_0x9f2b('0x9')]('/describe',auth[_0x9f2b('0xa')](),controller[_0x9f2b('0xc')]);router['get'](_0x9f2b('0xd'),auth['isAuthenticated'](),controller[_0x9f2b('0xe')]);router['get'](_0x9f2b('0xf'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x10')]);router[_0x9f2b('0x11')]('/',auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x12')]);router[_0x9f2b('0x13')](_0x9f2b('0xf'),controller[_0x9f2b('0x14')]);router[_0x9f2b('0x15')]('/:id',auth[_0x9f2b('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x6ac5=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','post','update','delete','destroy','exports'];(function(_0x1acfe8,_0x29e1ac){var _0x295faf=function(_0x59a9b5){while(--_0x59a9b5){_0x1acfe8['push'](_0x1acfe8['shift']());}};_0x295faf(++_0x29e1ac);}(_0x6ac5,0x18c));var _0x56ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ac5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x56ac('0x0'));var path=require(_0x56ac('0x1'));var timeout=require(_0x56ac('0x2'));var express=require(_0x56ac('0x3'));var router=express[_0x56ac('0x4')]();var fs_extra=require(_0x56ac('0x5'));var auth=require(_0x56ac('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x56ac('0x7'));var controller=require(_0x56ac('0x8'));router[_0x56ac('0x9')]('/',auth[_0x56ac('0xa')](),controller[_0x56ac('0xb')]);router[_0x56ac('0x9')](_0x56ac('0xc'),auth[_0x56ac('0xa')](),controller[_0x56ac('0xd')]);router[_0x56ac('0x9')](_0x56ac('0xe'),auth[_0x56ac('0xa')](),controller[_0x56ac('0xf')]);router['get'](_0x56ac('0x10'),auth[_0x56ac('0xa')](),controller['show']);router[_0x56ac('0x11')]('/',auth[_0x56ac('0xa')](),controller['create']);router['put'](_0x56ac('0x10'),controller[_0x56ac('0x12')]);router[_0x56ac('0x13')](_0x56ac('0x10'),auth[_0x56ac('0xa')](),controller[_0x56ac('0x14')]);module[_0x56ac('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 6890532..d6110e4 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 _0x6ae2=['medium','BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x266a1a,_0x28c25f){_0x266a1a=_0x266a1a-0x0;var _0x245e51=_0x6ae2[_0x266a1a];return _0x245e51;};'use strict';var Sequelize=require(_0x26ae('0x0'));module[_0x26ae('0x1')]={'body':{'type':Sequelize[_0x26ae('0x2')](_0x26ae('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x26ae('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x26ae('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x26ae('0x5')]('in',_0x26ae('0x6')),'defaultValue':_0x26ae('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x26ae('0x7')]},'providerResponse':{'type':Sequelize[_0x26ae('0x2')]}};
\ No newline at end of file
+var _0xdf92=['out','DATE','STRING','TEXT','sequelize','medium','BOOLEAN','ENUM'];(function(_0x1ea553,_0x54ad76){var _0x472d6b=function(_0x2e8fe0){while(--_0x2e8fe0){_0x1ea553['push'](_0x1ea553['shift']());}};_0x472d6b(++_0x54ad76);}(_0xdf92,0x10c));var _0x2df9=function(_0x269943,_0xcf2a69){_0x269943=_0x269943-0x0;var _0x1fa986=_0xdf92[_0x269943];return _0x1fa986;};'use strict';var Sequelize=require(_0x2df9('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x2df9('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x2df9('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x2df9('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2df9('0x3')]('in',_0x2df9('0x4')),'defaultValue':_0x2df9('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2df9('0x5')]},'providerName':{'type':Sequelize[_0x2df9('0x6')]},'providerResponse':{'type':Sequelize[_0x2df9('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 8434e8b..93ddd7c 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 _0xf5cd=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','update','end','send','index','map','ChatMessage','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','body','destroy','describe','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','fullname','email','internal','interface','SIP/%s','name','channel','EventManager','acceptmessage','parse','formData','chat-interactions','ChatInteractionId','interaction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','motionChannel','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x31c1af,_0x35051d){var _0x10b974=function(_0x3eaf34){while(--_0x3eaf34){_0x31c1af['push'](_0x31c1af['shift']());}};_0x10b974(++_0x35051d);}(_0xf5cd,0xf5));var _0xdf5c=function(_0x5ce5d6,_0x294bef){_0x5ce5d6=_0x5ce5d6-0x0;var _0x1ae010=_0xf5cd[_0x5ce5d6];return _0x1ae010;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf5c('0x0'));var zipdir=require(_0xdf5c('0x1'));var jsonpatch=require(_0xdf5c('0x2'));var rp=require(_0xdf5c('0x3'));var moment=require(_0xdf5c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdf5c('0x5'));var util=require(_0xdf5c('0x6'));var path=require('path');var sox=require(_0xdf5c('0x7'));var csv=require('to-csv');var ejs=require(_0xdf5c('0x8'));var fs=require('fs');var fs_extra=require(_0xdf5c('0x9'));var _=require(_0xdf5c('0xa'));var squel=require('squel');var crypto=require(_0xdf5c('0xb'));var jsforce=require(_0xdf5c('0xc'));var deskjs=require(_0xdf5c('0xd'));var toCsv=require(_0xdf5c('0xe'));var querystring=require(_0xdf5c('0xf'));var Papa=require(_0xdf5c('0x10'));var Redis=require(_0xdf5c('0x11'));var authService=require(_0xdf5c('0x12'));var qs=require(_0xdf5c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf5c('0x14'));var logger=require(_0xdf5c('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xdf5c('0x16'));var licenseUtil=require(_0xdf5c('0x17'));var db=require(_0xdf5c('0x18'))['db'];config[_0xdf5c('0x19')]=_['defaults'](config[_0xdf5c('0x19')],{'host':_0xdf5c('0x1a'),'port':0x18eb});var socket=require(_0xdf5c('0x1b'))(new Redis(config[_0xdf5c('0x19')]));require('./chatMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xdf5c('0x1c')][_0xdf5c('0x1d')]({'port':0x232c});var client9002=jayson[_0xdf5c('0x1c')][_0xdf5c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x58d52b,_0x2c6101,_0x2d5d79,_0x24247d){return new BPromise(function(_0x338818,_0x316a3f){var _0x2d9471=_0x24247d||client;return _0x2d9471[_0xdf5c('0x1e')](_0x58d52b,_0x2d5d79)[_0xdf5c('0x1f')](function(_0x2f58e1){logger['info'](_0xdf5c('0x20'),_0x2c6101,_0xdf5c('0x21'));logger[_0xdf5c('0x22')](_0xdf5c('0x23'),_0x2c6101,'request\x20sent',JSON[_0xdf5c('0x24')](_0x2f58e1));if(_0x2f58e1[_0xdf5c('0x25')]){if(_0x2f58e1[_0xdf5c('0x25')]['code']===0x1f4){logger[_0xdf5c('0x25')]('ChatMessage,\x20%s,\x20%s',_0x2c6101,_0x2f58e1[_0xdf5c('0x25')][_0xdf5c('0x26')]);return _0x316a3f(_0x2f58e1['error']['message']);}logger['error'](_0xdf5c('0x20'),_0x2c6101,_0x2f58e1[_0xdf5c('0x25')][_0xdf5c('0x26')]);return _0x338818(_0x2f58e1['error'][_0xdf5c('0x26')]);}else{logger[_0xdf5c('0x27')](_0xdf5c('0x20'),_0x2c6101,_0xdf5c('0x21'));_0x338818(_0x2f58e1[_0xdf5c('0x28')][_0xdf5c('0x26')]);}})['catch'](function(_0x5ef559){logger['error'](_0xdf5c('0x20'),_0x2c6101,_0x5ef559);_0x316a3f(_0x5ef559);});});}function respondWithStatusCode(_0x926e13,_0x4dd24b){_0x4dd24b=_0x4dd24b||0xcc;return function(_0xe7f220){if(_0xe7f220){return _0x926e13[_0xdf5c('0x29')](_0x4dd24b);}return _0x926e13[_0xdf5c('0x2a')](_0x4dd24b)['end']();};}function respondWithResult(_0x4672fb,_0x5424fa){_0x5424fa=_0x5424fa||0xc8;return function(_0x2ea18b){if(_0x2ea18b){return _0x4672fb[_0xdf5c('0x2a')](_0x5424fa)[_0xdf5c('0x2b')](_0x2ea18b);}};}function respondWithFilteredResult(_0x1de4b7,_0x3f0a98){return function(_0x413cbe){if(_0x413cbe){var _0x2781b7=typeof _0x3f0a98[_0xdf5c('0x2c')]==='undefined'&&typeof _0x3f0a98['limit']===_0xdf5c('0x2d');var _0x15ceef=_0x413cbe['count'];var _0x218b47=_0x2781b7?0x0:_0x3f0a98[_0xdf5c('0x2c')];var _0x2ddfbb=_0x2781b7?_0x413cbe[_0xdf5c('0x2e')]:_0x3f0a98[_0xdf5c('0x2c')]+_0x3f0a98[_0xdf5c('0x2f')];var _0x17c658;if(_0x2ddfbb>=_0x15ceef){_0x2ddfbb=_0x15ceef;_0x17c658=0xc8;}else{_0x17c658=0xce;}_0x1de4b7[_0xdf5c('0x2a')](_0x17c658);return _0x1de4b7[_0xdf5c('0x30')]('Content-Range',_0x218b47+'-'+_0x2ddfbb+'/'+_0x15ceef)[_0xdf5c('0x2b')](_0x413cbe);}return null;};}function patchUpdates(_0x32970f){return function(_0x591927){try{jsonpatch[_0xdf5c('0x31')](_0x591927,_0x32970f,!![]);}catch(_0x56d96c){return BPromise[_0xdf5c('0x32')](_0x56d96c);}return _0x591927['save']();};}function saveUpdates(_0x14bd03,_0xbde3d0){return function(_0x5e54f0){if(_0x5e54f0){return _0x5e54f0[_0xdf5c('0x33')](_0x14bd03)[_0xdf5c('0x1f')](function(_0x19b9a2){return _0x19b9a2;});}return null;};}function removeEntity(_0x5033c0,_0x1c5f46){return function(_0x3b6053){if(_0x3b6053){return _0x3b6053['destroy']()[_0xdf5c('0x1f')](function(){_0x5033c0[_0xdf5c('0x2a')](0xcc)[_0xdf5c('0x34')]();});}};}function handleEntityNotFound(_0x2c9c6a,_0x509d63){return function(_0x1de5c1){if(!_0x1de5c1){_0x2c9c6a[_0xdf5c('0x29')](0x194);}return _0x1de5c1;};}function handleError(_0x508654,_0xe7e9b9){_0xe7e9b9=_0xe7e9b9||0x1f4;return function(_0x2c6f54){logger['error'](_0x2c6f54['stack']);if(_0x2c6f54['name']){delete _0x2c6f54['name'];}_0x508654[_0xdf5c('0x2a')](_0xe7e9b9)[_0xdf5c('0x35')](_0x2c6f54);};}exports[_0xdf5c('0x36')]=function(_0x201cad,_0x18d6db){var _0x115c55={},_0x35f60d={},_0x399243={'count':0x0,'rows':[]};var _0x709921=_[_0xdf5c('0x37')](db[_0xdf5c('0x38')][_0xdf5c('0x39')],function(_0x45a427){return{'name':_0x45a427['fieldName'],'type':_0x45a427[_0xdf5c('0x3a')][_0xdf5c('0x3b')]};});_0x35f60d['model']=_[_0xdf5c('0x37')](_0x709921,'name');_0x35f60d[_0xdf5c('0x3c')]=_[_0xdf5c('0x3d')](_0x201cad[_0xdf5c('0x3c')]);_0x35f60d[_0xdf5c('0x3e')]=_[_0xdf5c('0x3f')](_0x35f60d[_0xdf5c('0x40')],_0x35f60d[_0xdf5c('0x3c')]);_0x115c55[_0xdf5c('0x41')]=_[_0xdf5c('0x3f')](_0x35f60d[_0xdf5c('0x40')],qs[_0xdf5c('0x42')](_0x201cad[_0xdf5c('0x3c')][_0xdf5c('0x42')]));_0x115c55[_0xdf5c('0x41')]=_0x115c55[_0xdf5c('0x41')]['length']?_0x115c55[_0xdf5c('0x41')]:_0x35f60d[_0xdf5c('0x40')];if(!_0x201cad['query']['hasOwnProperty'](_0xdf5c('0x43'))){_0x115c55[_0xdf5c('0x2f')]=qs[_0xdf5c('0x2f')](_0x201cad['query'][_0xdf5c('0x2f')]);_0x115c55[_0xdf5c('0x2c')]=qs['offset'](_0x201cad[_0xdf5c('0x3c')]['offset']);}_0x115c55[_0xdf5c('0x44')]=qs[_0xdf5c('0x45')](_0x201cad[_0xdf5c('0x3c')][_0xdf5c('0x45')]);_0x115c55[_0xdf5c('0x46')]=qs[_0xdf5c('0x3e')](_[_0xdf5c('0x47')](_0x201cad[_0xdf5c('0x3c')],_0x35f60d[_0xdf5c('0x3e')]),_0x709921);if(_0x201cad[_0xdf5c('0x3c')][_0xdf5c('0x48')]){_0x115c55[_0xdf5c('0x46')]=_[_0xdf5c('0x49')](_0x115c55[_0xdf5c('0x46')],{'$or':_[_0xdf5c('0x37')](_0x709921,function(_0x3a17f4){if(_0x3a17f4[_0xdf5c('0x3a')]!=='VIRTUAL'){var _0x56e970={};_0x56e970[_0x3a17f4['name']]={'$like':'%'+_0x201cad[_0xdf5c('0x3c')][_0xdf5c('0x48')]+'%'};return _0x56e970;}})});}_0x115c55=_['merge']({},_0x115c55,_0x201cad['options']);var _0x86211b={'where':_0x115c55[_0xdf5c('0x46')]};return db[_0xdf5c('0x38')][_0xdf5c('0x2e')](_0x86211b)['then'](function(_0x55e954){_0x399243['count']=_0x55e954;if(_0x201cad[_0xdf5c('0x3c')][_0xdf5c('0x4a')]){_0x115c55[_0xdf5c('0x4b')]=[{'all':!![]}];}return db[_0xdf5c('0x38')][_0xdf5c('0x4c')](_0x115c55);})[_0xdf5c('0x1f')](function(_0x2ad430){_0x399243[_0xdf5c('0x4d')]=_0x2ad430;return _0x399243;})['then'](respondWithFilteredResult(_0x18d6db,_0x115c55))[_0xdf5c('0x4e')](handleError(_0x18d6db,null));};exports[_0xdf5c('0x4f')]=function(_0x46034c,_0x5ad0f4){var _0x434e1f={'raw':!![],'where':{'id':_0x46034c[_0xdf5c('0x50')]['id']}},_0x1047c6={};_0x1047c6['model']=_[_0xdf5c('0x3d')](db[_0xdf5c('0x38')][_0xdf5c('0x39')]);_0x1047c6['query']=_[_0xdf5c('0x3d')](_0x46034c['query']);_0x1047c6[_0xdf5c('0x3e')]=_[_0xdf5c('0x3f')](_0x1047c6[_0xdf5c('0x40')],_0x1047c6[_0xdf5c('0x3c')]);_0x434e1f[_0xdf5c('0x41')]=_[_0xdf5c('0x3f')](_0x1047c6['model'],qs[_0xdf5c('0x42')](_0x46034c[_0xdf5c('0x3c')][_0xdf5c('0x42')]));_0x434e1f[_0xdf5c('0x41')]=_0x434e1f[_0xdf5c('0x41')][_0xdf5c('0x51')]?_0x434e1f[_0xdf5c('0x41')]:_0x1047c6[_0xdf5c('0x40')];if(_0x46034c[_0xdf5c('0x3c')][_0xdf5c('0x4a')]){_0x434e1f['include']=[{'all':!![]}];}_0x434e1f=_[_0xdf5c('0x49')]({},_0x434e1f,_0x46034c[_0xdf5c('0x52')]);return db['ChatMessage'][_0xdf5c('0x53')](_0x434e1f)[_0xdf5c('0x1f')](handleEntityNotFound(_0x5ad0f4,null))['then'](respondWithResult(_0x5ad0f4,null))[_0xdf5c('0x4e')](handleError(_0x5ad0f4,null));};exports['create']=function(_0x37ddb8,_0x2ec1b2){return db[_0xdf5c('0x38')]['create'](_0x37ddb8[_0xdf5c('0x54')],{})[_0xdf5c('0x1f')](respondWithResult(_0x2ec1b2,0xc9))[_0xdf5c('0x4e')](handleError(_0x2ec1b2,null));};exports[_0xdf5c('0x33')]=function(_0x34afe7,_0x59a10f){if(_0x34afe7[_0xdf5c('0x54')]['id']){delete _0x34afe7[_0xdf5c('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x34afe7[_0xdf5c('0x50')]['id']}})['then'](handleEntityNotFound(_0x59a10f,null))[_0xdf5c('0x1f')](saveUpdates(_0x34afe7[_0xdf5c('0x54')],null))[_0xdf5c('0x1f')](respondWithResult(_0x59a10f,null))[_0xdf5c('0x4e')](handleError(_0x59a10f,null));};exports[_0xdf5c('0x55')]=function(_0x5222b3,_0x59df16){return db[_0xdf5c('0x38')][_0xdf5c('0x53')]({'where':{'id':_0x5222b3['params']['id']}})[_0xdf5c('0x1f')](handleEntityNotFound(_0x59df16,null))[_0xdf5c('0x1f')](removeEntity(_0x59df16,null))['catch'](handleError(_0x59df16,null));};exports[_0xdf5c('0x56')]=function(_0x1c7e16,_0xd3b694){return db['ChatMessage'][_0xdf5c('0x56')]()[_0xdf5c('0x1f')](respondWithResult(_0xd3b694,null))[_0xdf5c('0x4e')](handleError(_0xd3b694,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xdf5c('0x57')]=function(_0x41ad54,_0xbd1f43,_0x1f34a9){var _0xedc47e={'agent':{},'channel':_0xdf5c('0x58')};if(_0x41ad54[_0xdf5c('0x54')]['id']){delete _0x41ad54['body']['id'];}_0x41ad54[_0xdf5c('0x54')][_0xdf5c('0x59')]=!![];_0x41ad54[_0xdf5c('0x54')][_0xdf5c('0x5a')]=moment()[_0xdf5c('0x5b')](_0xdf5c('0x5c'));_0x41ad54[_0xdf5c('0x54')][_0xdf5c('0x5d')]=_0x41ad54['body']['UserId']||_0x41ad54[_0xdf5c('0x5e')]['id'];_0xedc47e[_0xdf5c('0x5f')]['id']=_0x41ad54['body'][_0xdf5c('0x5d')];return db[_0xdf5c('0x38')][_0xdf5c('0x53')]({'where':{'id':_0x41ad54[_0xdf5c('0x50')]['id'],'UserId':null}})[_0xdf5c('0x1f')](handleEntityNotFound(_0xbd1f43,null))[_0xdf5c('0x1f')](saveUpdates(_0x41ad54[_0xdf5c('0x54')],null))[_0xdf5c('0x1f')](function(_0x96c4b3){if(_0x96c4b3){_0xedc47e[_0xdf5c('0x26')]=_0x96c4b3[_0xdf5c('0x60')]({'plain':!![]});return db[_0xdf5c('0x61')][_0xdf5c('0x53')]({'where':{'id':_0x96c4b3['ChatInteractionId']}});}return null;})[_0xdf5c('0x1f')](handleEntityNotFound(_0xbd1f43,null))['then'](function(_0x4a3c8d){if(_0x4a3c8d){return _0x4a3c8d[_0xdf5c('0x33')]({'UserId':_0x41ad54[_0xdf5c('0x54')][_0xdf5c('0x5d')],'read1stAt':_[_0xdf5c('0x62')](_0x4a3c8d[_0xdf5c('0x63')])?moment()['format'](_0xdf5c('0x5c')):undefined});}return null;})[_0xdf5c('0x1f')](function(_0x265e8f){if(_0x265e8f){_0xedc47e['interaction']=_0x265e8f['get']({'plain':!![]});interaction_log[_0xdf5c('0x27')](_0xdf5c('0x64'),_0x41ad54['user']['id'],_0x41ad54[_0xdf5c('0x5e')]['name'],_0x41ad54[_0xdf5c('0x5e')][_0xdf5c('0x65')],_0xedc47e['interaction']['id'],_0x41ad54[_0xdf5c('0x54')]?JSON[_0xdf5c('0x24')](_0x41ad54['body']):'null');return respondWithRpcPromise(_0xdf5c('0x66'),'acceptMessage',_0xedc47e);}return null;})[_0xdf5c('0x1f')](function(_0x3f53a6){var _0x37dde2=_0xdf5c('0x67')+_0x3f53a6[_0xdf5c('0x26')][_0xdf5c('0x68')];return db['sequelize']['query'](_0x37dde2,{'type':db[_0xdf5c('0x69')][_0xdf5c('0x6a')]['SELECT'],'raw':!![]})[_0xdf5c('0x1f')](function(_0x149705){return _0x149705;});})['then'](function(_0x4b7bbd){if(_0x4b7bbd){_0xedc47e[_0xdf5c('0x26')][_0xdf5c('0x6b')]=_0x4b7bbd[0x0];if(!_0x41ad54[_0xdf5c('0x54')]['UserId'])return;return db[_0xdf5c('0x6c')]['find']({'where':{'id':_0x41ad54[_0xdf5c('0x54')][_0xdf5c('0x5d')],'role':_0xdf5c('0x5f')},'attributes':['id','name',_0xdf5c('0x6d'),_0xdf5c('0x6e'),_0xdf5c('0x6f')],'raw':!![]});}return null;})[_0xdf5c('0x1f')](function(_0x5b6bdf){if(!_0x5b6bdf)return null;_0xedc47e[_0xdf5c('0x26')][_0xdf5c('0x5f')]=_0x5b6bdf;return _0xedc47e;})[_0xdf5c('0x1f')](function(_0x3eb27a){if(_0x3eb27a){if(_0x41ad54[_0xdf5c('0x54')]['manual']){_0xedc47e[_0xdf5c('0x26')][_0xdf5c('0x70')]=util[_0xdf5c('0x5b')](_0xdf5c('0x71'),_0x41ad54[_0xdf5c('0x5e')][_0xdf5c('0x72')]);_0xedc47e[_0xdf5c('0x26')][_0xdf5c('0x73')]=_0xedc47e[_0xdf5c('0x73')];_0xedc47e['message']['motionChannel']=_0xedc47e[_0xdf5c('0x73')];_0xedc47e[_0xdf5c('0x26')]['event']=_0xdf5c('0x57');return respondWithRpcPromise(_0xdf5c('0x74'),_0xdf5c('0x74'),{'event':_0xdf5c('0x75'),'message':_['merge'](_0xedc47e[_0xdf5c('0x26')],JSON[_0xdf5c('0x76')](_0xedc47e['interaction'][_0xdf5c('0x77')]))},client9002)[_0xdf5c('0x1f')](function(){return _0xedc47e;});}return _0xedc47e;}return null;})['then'](respondWithResult(_0xbd1f43,null))[_0xdf5c('0x4e')](handleError(_0xbd1f43,null));};var interaction_log=require(_0xdf5c('0x15'))(_0xdf5c('0x78'));exports[_0xdf5c('0x32')]=function(_0x3bc0fb,_0x4c5f5e,_0x430631){var _0x5682d9={'agent':{},'channel':_0xdf5c('0x58')};if(_0x3bc0fb['body']['id']){delete _0x3bc0fb[_0xdf5c('0x54')]['id'];}_0x3bc0fb[_0xdf5c('0x54')][_0xdf5c('0x5d')]=_0x3bc0fb[_0xdf5c('0x54')][_0xdf5c('0x5d')]||_0x3bc0fb[_0xdf5c('0x5e')]['id'];_0x5682d9[_0xdf5c('0x5f')]['id']=_0x3bc0fb[_0xdf5c('0x54')][_0xdf5c('0x5d')];return db[_0xdf5c('0x38')][_0xdf5c('0x53')]({'where':{'id':_0x3bc0fb[_0xdf5c('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4c5f5e,null))[_0xdf5c('0x1f')](function(_0x2fd0a9){if(_0x2fd0a9){_0x5682d9[_0xdf5c('0x26')]=_0x2fd0a9[_0xdf5c('0x60')]({'plain':!![]});return db[_0xdf5c('0x61')]['find']({'where':{'id':_0x2fd0a9[_0xdf5c('0x79')]}});}return null;})[_0xdf5c('0x1f')](handleEntityNotFound(_0x4c5f5e,null))[_0xdf5c('0x1f')](function(_0x251049){if(_0x251049){_0x5682d9[_0xdf5c('0x7a')]=_0x251049[_0xdf5c('0x60')]({'plain':!![]});interaction_log[_0xdf5c('0x27')](_0xdf5c('0x7b'),_0x3bc0fb[_0xdf5c('0x5e')]['id'],_0x3bc0fb['user'][_0xdf5c('0x72')],_0x3bc0fb[_0xdf5c('0x5e')]['role'],_0x5682d9[_0xdf5c('0x7a')]['id'],_0x3bc0fb['body']?JSON['stringify'](_0x3bc0fb[_0xdf5c('0x54')]):'null');return respondWithRpcPromise(_0xdf5c('0x7c'),_0xdf5c('0x7d'),_0x5682d9);}return null;})['then'](function(_0x2630b4){var _0x19da34=_0xdf5c('0x67')+_0x2630b4[_0xdf5c('0x26')][_0xdf5c('0x68')];return db[_0xdf5c('0x7e')]['query'](_0x19da34,{'type':db[_0xdf5c('0x69')]['QueryTypes']['SELECT'],'raw':!![]})[_0xdf5c('0x1f')](function(_0x535f9e){return _0x535f9e;});})['then'](function(_0x22441a){if(_0x22441a){_0x5682d9[_0xdf5c('0x26')]['contact']=_0x22441a[0x0];if(!_0x3bc0fb[_0xdf5c('0x54')][_0xdf5c('0x5d')])return;return db[_0xdf5c('0x6c')][_0xdf5c('0x53')]({'where':{'id':_0x3bc0fb[_0xdf5c('0x54')]['UserId'],'role':_0xdf5c('0x5f')},'attributes':['id','name',_0xdf5c('0x6d'),_0xdf5c('0x6e'),_0xdf5c('0x6f')],'raw':!![]});}return null;})[_0xdf5c('0x1f')](function(_0x35b2f5){if(!_0x35b2f5)return null;_0x5682d9[_0xdf5c('0x26')][_0xdf5c('0x5f')]=_0x35b2f5;return _0x5682d9;})[_0xdf5c('0x1f')](function(_0x41260c){if(_0x41260c){_0x41260c[_0xdf5c('0x26')][_0xdf5c('0x70')]=util[_0xdf5c('0x5b')]('SIP/%s',_0x3bc0fb[_0xdf5c('0x5e')][_0xdf5c('0x72')]);_0x41260c[_0xdf5c('0x26')][_0xdf5c('0x73')]=_0x5682d9[_0xdf5c('0x73')];_0x41260c['message'][_0xdf5c('0x7f')]=_0x5682d9['channel'];_0x41260c[_0xdf5c('0x26')]['event']=_0xdf5c('0x32');respondWithRpcPromise(_0xdf5c('0x74'),_0xdf5c('0x74'),{'event':_0xdf5c('0x80'),'message':_['merge'](_0x5682d9[_0xdf5c('0x26')],JSON['parse'](_0x5682d9[_0xdf5c('0x7a')]['formData']))},client9002);return _0x5682d9;}return null;})[_0xdf5c('0x1f')](respondWithResult(_0x4c5f5e,null))[_0xdf5c('0x4e')](handleError(_0x4c5f5e,null));};
\ No newline at end of file
+var _0xdb4c=['describe','chat-interactions','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','internal','agent','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','fullname','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../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','message','result','catch','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','destroy','name','send','index','map','ChatMessage','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','show','params','find','create','body'];(function(_0x10a12a,_0xee7529){var _0x1905af=function(_0x41c8b4){while(--_0x41c8b4){_0x10a12a['push'](_0x10a12a['shift']());}};_0x1905af(++_0xee7529);}(_0xdb4c,0xad));var _0xcdb4=function(_0x4c1195,_0x50429d){_0x4c1195=_0x4c1195-0x0;var _0x1bb47f=_0xdb4c[_0x4c1195];return _0x1bb47f;};'use strict';var emlformat=require(_0xcdb4('0x0'));var rimraf=require(_0xcdb4('0x1'));var zipdir=require(_0xcdb4('0x2'));var jsonpatch=require(_0xcdb4('0x3'));var rp=require(_0xcdb4('0x4'));var moment=require(_0xcdb4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcdb4('0x6'));var path=require(_0xcdb4('0x7'));var sox=require(_0xcdb4('0x8'));var csv=require(_0xcdb4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcdb4('0xa'));var squel=require('squel');var crypto=require(_0xcdb4('0xb'));var jsforce=require(_0xcdb4('0xc'));var deskjs=require(_0xcdb4('0xd'));var toCsv=require(_0xcdb4('0x9'));var querystring=require(_0xcdb4('0xe'));var Papa=require(_0xcdb4('0xf'));var Redis=require(_0xcdb4('0x10'));var authService=require(_0xcdb4('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcdb4('0x12'));var logger=require(_0xcdb4('0x13'))(_0xcdb4('0x14'));var utils=require(_0xcdb4('0x15'));var config=require(_0xcdb4('0x16'));var licenseUtil=require(_0xcdb4('0x17'));var db=require(_0xcdb4('0x18'))['db'];config[_0xcdb4('0x19')]=_['defaults'](config['redis'],{'host':_0xcdb4('0x1a'),'port':0x18eb});var socket=require(_0xcdb4('0x1b'))(new Redis(config['redis']));require(_0xcdb4('0x1c'))[_0xcdb4('0x1d')](socket);var jayson=require(_0xcdb4('0x1e'));var client=jayson[_0xcdb4('0x1f')][_0xcdb4('0x20')]({'port':0x232c});var client9002=jayson[_0xcdb4('0x1f')][_0xcdb4('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x534c15,_0x7ed212,_0xb73a00,_0x1394f8){return new BPromise(function(_0x20237e,_0x44f582){var _0x3ebc90=_0x1394f8||client;return _0x3ebc90[_0xcdb4('0x21')](_0x534c15,_0xb73a00)[_0xcdb4('0x22')](function(_0x43c8ec){logger[_0xcdb4('0x23')](_0xcdb4('0x24'),_0x7ed212,_0xcdb4('0x25'));logger[_0xcdb4('0x26')](_0xcdb4('0x27'),_0x7ed212,_0xcdb4('0x25'),JSON[_0xcdb4('0x28')](_0x43c8ec));if(_0x43c8ec['error']){if(_0x43c8ec[_0xcdb4('0x29')]['code']===0x1f4){logger[_0xcdb4('0x29')](_0xcdb4('0x24'),_0x7ed212,_0x43c8ec[_0xcdb4('0x29')][_0xcdb4('0x2a')]);return _0x44f582(_0x43c8ec[_0xcdb4('0x29')][_0xcdb4('0x2a')]);}logger[_0xcdb4('0x29')](_0xcdb4('0x24'),_0x7ed212,_0x43c8ec['error'][_0xcdb4('0x2a')]);return _0x20237e(_0x43c8ec['error'][_0xcdb4('0x2a')]);}else{logger['info'](_0xcdb4('0x24'),_0x7ed212,_0xcdb4('0x25'));_0x20237e(_0x43c8ec[_0xcdb4('0x2b')][_0xcdb4('0x2a')]);}})[_0xcdb4('0x2c')](function(_0x2e33a2){logger[_0xcdb4('0x29')](_0xcdb4('0x24'),_0x7ed212,_0x2e33a2);_0x44f582(_0x2e33a2);});});}function respondWithStatusCode(_0x753f51,_0x2c6c99){_0x2c6c99=_0x2c6c99||0xcc;return function(_0xf60e5c){if(_0xf60e5c){return _0x753f51[_0xcdb4('0x2d')](_0x2c6c99);}return _0x753f51[_0xcdb4('0x2e')](_0x2c6c99)[_0xcdb4('0x2f')]();};}function respondWithResult(_0x23f769,_0x1bf9d5){_0x1bf9d5=_0x1bf9d5||0xc8;return function(_0xa63fb6){if(_0xa63fb6){return _0x23f769['status'](_0x1bf9d5)['json'](_0xa63fb6);}};}function respondWithFilteredResult(_0x648ad8,_0x27fc31){return function(_0x264c6b){if(_0x264c6b){var _0x217db5=typeof _0x27fc31['offset']===_0xcdb4('0x30')&&typeof _0x27fc31[_0xcdb4('0x31')]===_0xcdb4('0x30');var _0x251e90=_0x264c6b[_0xcdb4('0x32')];var _0x515269=_0x217db5?0x0:_0x27fc31[_0xcdb4('0x33')];var _0x4314e0=_0x217db5?_0x264c6b[_0xcdb4('0x32')]:_0x27fc31['offset']+_0x27fc31[_0xcdb4('0x31')];var _0x8cbe3c;if(_0x4314e0>=_0x251e90){_0x4314e0=_0x251e90;_0x8cbe3c=0xc8;}else{_0x8cbe3c=0xce;}_0x648ad8[_0xcdb4('0x2e')](_0x8cbe3c);return _0x648ad8['set'](_0xcdb4('0x34'),_0x515269+'-'+_0x4314e0+'/'+_0x251e90)[_0xcdb4('0x35')](_0x264c6b);}return null;};}function patchUpdates(_0x2554c9){return function(_0x2883c1){try{jsonpatch[_0xcdb4('0x36')](_0x2883c1,_0x2554c9,!![]);}catch(_0xbfba40){return BPromise[_0xcdb4('0x37')](_0xbfba40);}return _0x2883c1[_0xcdb4('0x38')]();};}function saveUpdates(_0x257612,_0xe7fdde){return function(_0x46fe52){if(_0x46fe52){return _0x46fe52[_0xcdb4('0x39')](_0x257612)[_0xcdb4('0x22')](function(_0x4e11f4){return _0x4e11f4;});}return null;};}function removeEntity(_0x37ea7e,_0x1192e9){return function(_0x1ff217){if(_0x1ff217){return _0x1ff217[_0xcdb4('0x3a')]()[_0xcdb4('0x22')](function(){_0x37ea7e[_0xcdb4('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb99861,_0x1d7e10){return function(_0x537d4d){if(!_0x537d4d){_0xb99861[_0xcdb4('0x2d')](0x194);}return _0x537d4d;};}function handleError(_0x53c72b,_0x51950e){_0x51950e=_0x51950e||0x1f4;return function(_0x1d548f){logger[_0xcdb4('0x29')](_0x1d548f['stack']);if(_0x1d548f[_0xcdb4('0x3b')]){delete _0x1d548f[_0xcdb4('0x3b')];}_0x53c72b[_0xcdb4('0x2e')](_0x51950e)[_0xcdb4('0x3c')](_0x1d548f);};}exports[_0xcdb4('0x3d')]=function(_0xdb1979,_0x5e390e){var _0x34ac30={},_0x497e7c={},_0x2ac2e1={'count':0x0,'rows':[]};var _0x1657a0=_[_0xcdb4('0x3e')](db[_0xcdb4('0x3f')]['rawAttributes'],function(_0x43d138){return{'name':_0x43d138[_0xcdb4('0x40')],'type':_0x43d138[_0xcdb4('0x41')]['key']};});_0x497e7c[_0xcdb4('0x42')]=_['map'](_0x1657a0,_0xcdb4('0x3b'));_0x497e7c[_0xcdb4('0x43')]=_[_0xcdb4('0x44')](_0xdb1979[_0xcdb4('0x43')]);_0x497e7c['filters']=_[_0xcdb4('0x45')](_0x497e7c[_0xcdb4('0x42')],_0x497e7c[_0xcdb4('0x43')]);_0x34ac30[_0xcdb4('0x46')]=_[_0xcdb4('0x45')](_0x497e7c[_0xcdb4('0x42')],qs['fields'](_0xdb1979[_0xcdb4('0x43')][_0xcdb4('0x47')]));_0x34ac30[_0xcdb4('0x46')]=_0x34ac30[_0xcdb4('0x46')][_0xcdb4('0x48')]?_0x34ac30['attributes']:_0x497e7c[_0xcdb4('0x42')];if(!_0xdb1979[_0xcdb4('0x43')][_0xcdb4('0x49')](_0xcdb4('0x4a'))){_0x34ac30['limit']=qs[_0xcdb4('0x31')](_0xdb1979[_0xcdb4('0x43')][_0xcdb4('0x31')]);_0x34ac30[_0xcdb4('0x33')]=qs[_0xcdb4('0x33')](_0xdb1979[_0xcdb4('0x43')][_0xcdb4('0x33')]);}_0x34ac30[_0xcdb4('0x4b')]=qs[_0xcdb4('0x4c')](_0xdb1979[_0xcdb4('0x43')][_0xcdb4('0x4c')]);_0x34ac30[_0xcdb4('0x4d')]=qs[_0xcdb4('0x4e')](_[_0xcdb4('0x4f')](_0xdb1979[_0xcdb4('0x43')],_0x497e7c[_0xcdb4('0x4e')]),_0x1657a0);if(_0xdb1979[_0xcdb4('0x43')][_0xcdb4('0x50')]){_0x34ac30[_0xcdb4('0x4d')]=_['merge'](_0x34ac30[_0xcdb4('0x4d')],{'$or':_[_0xcdb4('0x3e')](_0x1657a0,function(_0x3e0acb){if(_0x3e0acb[_0xcdb4('0x41')]!=='VIRTUAL'){var _0x4024ed={};_0x4024ed[_0x3e0acb['name']]={'$like':'%'+_0xdb1979[_0xcdb4('0x43')]['filter']+'%'};return _0x4024ed;}})});}_0x34ac30=_[_0xcdb4('0x51')]({},_0x34ac30,_0xdb1979[_0xcdb4('0x52')]);var _0x303031={'where':_0x34ac30[_0xcdb4('0x4d')]};return db[_0xcdb4('0x3f')][_0xcdb4('0x32')](_0x303031)[_0xcdb4('0x22')](function(_0x47e235){_0x2ac2e1[_0xcdb4('0x32')]=_0x47e235;if(_0xdb1979[_0xcdb4('0x43')]['includeAll']){_0x34ac30[_0xcdb4('0x53')]=[{'all':!![]}];}return db[_0xcdb4('0x3f')][_0xcdb4('0x54')](_0x34ac30);})[_0xcdb4('0x22')](function(_0x3a2027){_0x2ac2e1[_0xcdb4('0x55')]=_0x3a2027;return _0x2ac2e1;})[_0xcdb4('0x22')](respondWithFilteredResult(_0x5e390e,_0x34ac30))['catch'](handleError(_0x5e390e,null));};exports[_0xcdb4('0x56')]=function(_0x57b975,_0x1b348f){var _0x46c972={'raw':!![],'where':{'id':_0x57b975[_0xcdb4('0x57')]['id']}},_0x367b69={};_0x367b69[_0xcdb4('0x42')]=_[_0xcdb4('0x44')](db['ChatMessage']['rawAttributes']);_0x367b69[_0xcdb4('0x43')]=_[_0xcdb4('0x44')](_0x57b975[_0xcdb4('0x43')]);_0x367b69[_0xcdb4('0x4e')]=_[_0xcdb4('0x45')](_0x367b69['model'],_0x367b69[_0xcdb4('0x43')]);_0x46c972[_0xcdb4('0x46')]=_['intersection'](_0x367b69[_0xcdb4('0x42')],qs[_0xcdb4('0x47')](_0x57b975['query'][_0xcdb4('0x47')]));_0x46c972[_0xcdb4('0x46')]=_0x46c972['attributes'][_0xcdb4('0x48')]?_0x46c972['attributes']:_0x367b69['model'];if(_0x57b975['query']['includeAll']){_0x46c972[_0xcdb4('0x53')]=[{'all':!![]}];}_0x46c972=_[_0xcdb4('0x51')]({},_0x46c972,_0x57b975[_0xcdb4('0x52')]);return db[_0xcdb4('0x3f')][_0xcdb4('0x58')](_0x46c972)['then'](handleEntityNotFound(_0x1b348f,null))['then'](respondWithResult(_0x1b348f,null))['catch'](handleError(_0x1b348f,null));};exports[_0xcdb4('0x59')]=function(_0x380e46,_0xe00bf9){return db[_0xcdb4('0x3f')][_0xcdb4('0x59')](_0x380e46['body'],{})[_0xcdb4('0x22')](respondWithResult(_0xe00bf9,0xc9))['catch'](handleError(_0xe00bf9,null));};exports['update']=function(_0x57f7bc,_0x4e97fc){if(_0x57f7bc[_0xcdb4('0x5a')]['id']){delete _0x57f7bc[_0xcdb4('0x5a')]['id'];}return db['ChatMessage'][_0xcdb4('0x58')]({'where':{'id':_0x57f7bc['params']['id']}})[_0xcdb4('0x22')](handleEntityNotFound(_0x4e97fc,null))[_0xcdb4('0x22')](saveUpdates(_0x57f7bc['body'],null))[_0xcdb4('0x22')](respondWithResult(_0x4e97fc,null))[_0xcdb4('0x2c')](handleError(_0x4e97fc,null));};exports[_0xcdb4('0x3a')]=function(_0x5b5262,_0x431733){return db[_0xcdb4('0x3f')][_0xcdb4('0x58')]({'where':{'id':_0x5b5262[_0xcdb4('0x57')]['id']}})[_0xcdb4('0x22')](handleEntityNotFound(_0x431733,null))[_0xcdb4('0x22')](removeEntity(_0x431733,null))[_0xcdb4('0x2c')](handleError(_0x431733,null));};exports[_0xcdb4('0x5b')]=function(_0x31969d,_0x595331){return db[_0xcdb4('0x3f')][_0xcdb4('0x5b')]()[_0xcdb4('0x22')](respondWithResult(_0x595331,null))[_0xcdb4('0x2c')](handleError(_0x595331,null));};var interaction_log=require(_0xcdb4('0x13'))(_0xcdb4('0x5c'));exports['accept']=function(_0x619cb0,_0x2ec3ea,_0x5349fe){var _0x39f217={'agent':{},'channel':_0xcdb4('0x5d')};if(_0x619cb0['body']['id']){delete _0x619cb0['body']['id'];}_0x619cb0[_0xcdb4('0x5a')]['read']=!![];_0x619cb0[_0xcdb4('0x5a')][_0xcdb4('0x5e')]=moment()[_0xcdb4('0x5f')](_0xcdb4('0x60'));_0x619cb0[_0xcdb4('0x5a')][_0xcdb4('0x61')]=_0x619cb0['body'][_0xcdb4('0x61')]||_0x619cb0[_0xcdb4('0x62')]['id'];_0x39f217['agent']['id']=_0x619cb0[_0xcdb4('0x5a')][_0xcdb4('0x61')];return db['ChatMessage'][_0xcdb4('0x58')]({'where':{'id':_0x619cb0[_0xcdb4('0x57')]['id'],'UserId':null}})[_0xcdb4('0x22')](handleEntityNotFound(_0x2ec3ea,null))[_0xcdb4('0x22')](saveUpdates(_0x619cb0[_0xcdb4('0x5a')],null))[_0xcdb4('0x22')](function(_0xe3fd3){if(_0xe3fd3){_0x39f217[_0xcdb4('0x2a')]=_0xe3fd3[_0xcdb4('0x63')]({'plain':!![]});return db[_0xcdb4('0x64')][_0xcdb4('0x58')]({'where':{'id':_0xe3fd3[_0xcdb4('0x65')]}});}return null;})[_0xcdb4('0x22')](handleEntityNotFound(_0x2ec3ea,null))['then'](function(_0x4b4fb4){if(_0x4b4fb4){return _0x4b4fb4[_0xcdb4('0x39')]({'UserId':_0x619cb0[_0xcdb4('0x5a')][_0xcdb4('0x61')],'read1stAt':_[_0xcdb4('0x66')](_0x4b4fb4[_0xcdb4('0x67')])?moment()['format'](_0xcdb4('0x60')):undefined});}return null;})[_0xcdb4('0x22')](function(_0x4f8481){if(_0x4f8481){_0x39f217[_0xcdb4('0x68')]=_0x4f8481[_0xcdb4('0x63')]({'plain':!![]});interaction_log[_0xcdb4('0x23')](_0xcdb4('0x69'),_0x619cb0[_0xcdb4('0x62')]['id'],_0x619cb0['user'][_0xcdb4('0x3b')],_0x619cb0['user'][_0xcdb4('0x6a')],_0x39f217['interaction']['id'],_0x619cb0['body']?JSON[_0xcdb4('0x28')](_0x619cb0[_0xcdb4('0x5a')]):_0xcdb4('0x6b'));return respondWithRpcPromise(_0xcdb4('0x6c'),'acceptMessage',_0x39f217);}return null;})['then'](function(_0x5c0ebf){var _0x4d8bca=_0xcdb4('0x6d')+_0x5c0ebf[_0xcdb4('0x2a')]['ContactId'];return db[_0xcdb4('0x6e')]['query'](_0x4d8bca,{'type':db[_0xcdb4('0x6f')][_0xcdb4('0x70')][_0xcdb4('0x71')],'raw':!![]})[_0xcdb4('0x22')](function(_0x62d4b4){return _0x62d4b4;});})[_0xcdb4('0x22')](function(_0x1f16b9){if(_0x1f16b9){_0x39f217[_0xcdb4('0x2a')][_0xcdb4('0x72')]=_0x1f16b9[0x0];if(!_0x619cb0[_0xcdb4('0x5a')][_0xcdb4('0x61')])return;return db[_0xcdb4('0x73')][_0xcdb4('0x58')]({'where':{'id':_0x619cb0[_0xcdb4('0x5a')]['UserId'],'role':'agent'},'attributes':['id',_0xcdb4('0x3b'),'fullname','email',_0xcdb4('0x74')],'raw':!![]});}return null;})[_0xcdb4('0x22')](function(_0x527ae3){if(!_0x527ae3)return null;_0x39f217[_0xcdb4('0x2a')][_0xcdb4('0x75')]=_0x527ae3;return _0x39f217;})[_0xcdb4('0x22')](function(_0x23e49c){if(_0x23e49c){if(_0x619cb0[_0xcdb4('0x5a')]['manual']){_0x39f217['message'][_0xcdb4('0x76')]=util[_0xcdb4('0x5f')](_0xcdb4('0x77'),_0x619cb0[_0xcdb4('0x62')][_0xcdb4('0x3b')]);_0x39f217[_0xcdb4('0x2a')]['channel']=_0x39f217[_0xcdb4('0x78')];_0x39f217[_0xcdb4('0x2a')][_0xcdb4('0x79')]=_0x39f217['channel'];_0x39f217[_0xcdb4('0x2a')][_0xcdb4('0x7a')]=_0xcdb4('0x7b');return respondWithRpcPromise('EventManager',_0xcdb4('0x7c'),{'event':_0xcdb4('0x7d'),'message':_['merge'](_0x39f217['message'],JSON[_0xcdb4('0x7e')](_0x39f217[_0xcdb4('0x68')]['formData']))},client9002)[_0xcdb4('0x22')](function(){return _0x39f217;});}return _0x39f217;}return null;})['then'](respondWithResult(_0x2ec3ea,null))['catch'](handleError(_0x2ec3ea,null));};var interaction_log=require(_0xcdb4('0x13'))(_0xcdb4('0x5c'));exports[_0xcdb4('0x37')]=function(_0x21cd3c,_0x403fac,_0x21e407){var _0x57ca8a={'agent':{},'channel':'chat'};if(_0x21cd3c[_0xcdb4('0x5a')]['id']){delete _0x21cd3c[_0xcdb4('0x5a')]['id'];}_0x21cd3c[_0xcdb4('0x5a')][_0xcdb4('0x61')]=_0x21cd3c['body'][_0xcdb4('0x61')]||_0x21cd3c[_0xcdb4('0x62')]['id'];_0x57ca8a[_0xcdb4('0x75')]['id']=_0x21cd3c[_0xcdb4('0x5a')]['UserId'];return db[_0xcdb4('0x3f')][_0xcdb4('0x58')]({'where':{'id':_0x21cd3c['params']['id'],'UserId':null}})[_0xcdb4('0x22')](handleEntityNotFound(_0x403fac,null))[_0xcdb4('0x22')](function(_0x4d2123){if(_0x4d2123){_0x57ca8a[_0xcdb4('0x2a')]=_0x4d2123['get']({'plain':!![]});return db['ChatInteraction'][_0xcdb4('0x58')]({'where':{'id':_0x4d2123[_0xcdb4('0x65')]}});}return null;})[_0xcdb4('0x22')](handleEntityNotFound(_0x403fac,null))[_0xcdb4('0x22')](function(_0x2a447e){if(_0x2a447e){_0x57ca8a[_0xcdb4('0x68')]=_0x2a447e[_0xcdb4('0x63')]({'plain':!![]});interaction_log[_0xcdb4('0x23')](_0xcdb4('0x7f'),_0x21cd3c['user']['id'],_0x21cd3c[_0xcdb4('0x62')][_0xcdb4('0x3b')],_0x21cd3c[_0xcdb4('0x62')]['role'],_0x57ca8a[_0xcdb4('0x68')]['id'],_0x21cd3c['body']?JSON[_0xcdb4('0x28')](_0x21cd3c[_0xcdb4('0x5a')]):'null');return respondWithRpcPromise('RejectMessage',_0xcdb4('0x80'),_0x57ca8a);}return null;})['then'](function(_0x3a1b00){var _0xfa257=_0xcdb4('0x6d')+_0x3a1b00[_0xcdb4('0x2a')]['ContactId'];return db[_0xcdb4('0x6e')][_0xcdb4('0x43')](_0xfa257,{'type':db[_0xcdb4('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x1f3cfc){return _0x1f3cfc;});})[_0xcdb4('0x22')](function(_0x4ae377){if(_0x4ae377){_0x57ca8a[_0xcdb4('0x2a')][_0xcdb4('0x72')]=_0x4ae377[0x0];if(!_0x21cd3c[_0xcdb4('0x5a')]['UserId'])return;return db[_0xcdb4('0x73')][_0xcdb4('0x58')]({'where':{'id':_0x21cd3c['body'][_0xcdb4('0x61')],'role':_0xcdb4('0x75')},'attributes':['id',_0xcdb4('0x3b'),_0xcdb4('0x81'),'email',_0xcdb4('0x74')],'raw':!![]});}return null;})['then'](function(_0x46928b){if(!_0x46928b)return null;_0x57ca8a[_0xcdb4('0x2a')][_0xcdb4('0x75')]=_0x46928b;return _0x57ca8a;})[_0xcdb4('0x22')](function(_0x48ae7e){if(_0x48ae7e){_0x48ae7e[_0xcdb4('0x2a')][_0xcdb4('0x76')]=util['format'](_0xcdb4('0x77'),_0x21cd3c[_0xcdb4('0x62')][_0xcdb4('0x3b')]);_0x48ae7e['message'][_0xcdb4('0x78')]=_0x57ca8a[_0xcdb4('0x78')];_0x48ae7e[_0xcdb4('0x2a')][_0xcdb4('0x79')]=_0x57ca8a[_0xcdb4('0x78')];_0x48ae7e[_0xcdb4('0x2a')][_0xcdb4('0x7a')]='reject';respondWithRpcPromise(_0xcdb4('0x7c'),_0xcdb4('0x7c'),{'event':_0xcdb4('0x82'),'message':_[_0xcdb4('0x51')](_0x57ca8a[_0xcdb4('0x2a')],JSON['parse'](_0x57ca8a['interaction'][_0xcdb4('0x83')]))},client9002);return _0x57ca8a;}return null;})[_0xcdb4('0x22')](respondWithResult(_0x403fac,null))[_0xcdb4('0x2c')](handleError(_0x403fac,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 7f055da..c4409b2 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 _0xcd23=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x1a3e23,_0xce45e){var _0x5ee0d8=function(_0x4b932f){while(--_0x4b932f){_0x1a3e23['push'](_0x1a3e23['shift']());}};_0x5ee0d8(++_0xce45e);}(_0xcd23,0xf4));var _0x3cd2=function(_0x545dd1,_0x5d6d32){_0x545dd1=_0x545dd1-0x0;var _0xb9692b=_0xcd23[_0x545dd1];return _0xb9692b;};'use strict';var EventEmitter=require(_0x3cd2('0x0'));var ChatMessage=require(_0x3cd2('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3cd2('0x2')](0x0);var events={'afterCreate':_0x3cd2('0x3'),'afterUpdate':_0x3cd2('0x4'),'afterDestroy':_0x3cd2('0x5')};function emitEvent(_0x509114){return function(_0x363b40,_0x3a54a7,_0x4c6d2d){ChatMessageEvents[_0x3cd2('0x6')](_0x509114+':'+_0x363b40['id'],_0x363b40);ChatMessageEvents[_0x3cd2('0x6')](_0x509114,_0x363b40);_0x4c6d2d(null);};}for(var e in events){if(events[_0x3cd2('0x7')](e)){var event=events[e];ChatMessage[_0x3cd2('0x8')](e,emitEvent(event));}}module[_0x3cd2('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0x31f8=['hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x31f8,0x161));var _0x831f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x31f8[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x831f('0x0'))['db'][_0x831f('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x831f('0x2')](0x0);var events={'afterCreate':_0x831f('0x3'),'afterUpdate':_0x831f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x564744){return function(_0x273355,_0x21a21a,_0xa4fd60){ChatMessageEvents[_0x831f('0x5')](_0x564744+':'+_0x273355['id'],_0x273355);ChatMessageEvents[_0x831f('0x5')](_0x564744,_0x273355);_0xa4fd60(null);};}for(var e in events){if(events[_0x831f('0x6')](e)){var event=events[e];ChatMessage[_0x831f('0x7')](e,emitEvent(event));}}module[_0x831f('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 cff9f70..6acf056 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 _0x0dec=['update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then'];(function(_0x6b488c,_0x1c8ff4){var _0x15b819=function(_0x4d876a){while(--_0x4d876a){_0x6b488c['push'](_0x6b488c['shift']());}};_0x15b819(++_0x1c8ff4);}(_0x0dec,0x11c));var _0xc0de=function(_0x44bbc8,_0x1d350f){_0x44bbc8=_0x44bbc8-0x0;var _0x3d814a=_0x0dec[_0x44bbc8];return _0x3d814a;};'use strict';var _=require(_0xc0de('0x0'));var util=require(_0xc0de('0x1'));var logger=require(_0xc0de('0x2'))(_0xc0de('0x3'));var moment=require('moment');var BPromise=require(_0xc0de('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc0de('0x5'));var config=require(_0xc0de('0x6'));var attributes=require(_0xc0de('0x7'));module[_0xc0de('0x8')]=function(_0xae49db,_0x194937){return _0xae49db[_0xc0de('0x9')](_0xc0de('0xa'),attributes,{'tableName':_0xc0de('0xb'),'paranoid':![],'indexes':[{'name':_0xc0de('0xc'),'fields':[_0xc0de('0xd')],'type':_0xc0de('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7fb69a,_0x46ed3f,_0x3a169a){var _0xd27e9f=_0xae49db[_0xc0de('0xf')];var _0x285146=_0x7fb69a[_0xc0de('0x10')]({'plain':!![]});if(_0x285146[_0xc0de('0x11')][_0xc0de('0x12')]()==='in'||_0x285146[_0xc0de('0x11')][_0xc0de('0x12')]()===_0xc0de('0x13')&&!_0x285146[_0xc0de('0x14')]&&!_['isNil'](_0x285146[_0xc0de('0x15')])){_0xd27e9f[_0xc0de('0x16')][_0xc0de('0x17')]({'where':{'id':_0x285146[_0xc0de('0x18')]}})[_0xc0de('0x19')](function(_0x7fae0c){if(_0x7fae0c){_0x7fae0c[_0xc0de('0x1a')]({'lastMsgAt':_0x285146[_0xc0de('0x1b')],'lastMsgDirection':_0x285146[_0xc0de('0x11')][_0xc0de('0x12')]()});}})[_0xc0de('0x1c')](function(_0x7f1e4d){console['error'](_0x7f1e4d);});}_0x3a169a();}},'charset':_0xc0de('0x1d'),'collate':_0xc0de('0x1e')});};
\ No newline at end of file
+var _0xdc91=['api','moment','request-promise','path','rimraf','./chatMessage.attributes','define','ChatMessage','chat_messages','body','models','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x339ded,_0xb38a57){var _0x37f8dc=function(_0x2ba951){while(--_0x2ba951){_0x339ded['push'](_0x339ded['shift']());}};_0x37f8dc(++_0xb38a57);}(_0xdc91,0x183));var _0x1dc9=function(_0x2b40e1,_0x495c47){_0x2b40e1=_0x2b40e1-0x0;var _0x30b65c=_0xdc91[_0x2b40e1];return _0x30b65c;};'use strict';var _=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var logger=require(_0x1dc9('0x2'))(_0x1dc9('0x3'));var moment=require(_0x1dc9('0x4'));var BPromise=require('bluebird');var rp=require(_0x1dc9('0x5'));var fs=require('fs');var path=require(_0x1dc9('0x6'));var rimraf=require(_0x1dc9('0x7'));var config=require('../../config/environment');var attributes=require(_0x1dc9('0x8'));module['exports']=function(_0x167133,_0x1a596b){return _0x167133[_0x1dc9('0x9')](_0x1dc9('0xa'),attributes,{'tableName':_0x1dc9('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x1dc9('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x53e9f7,_0x5e0f40,_0x223d4e){var _0x49330e=_0x167133[_0x1dc9('0xd')];var _0x3231e9=_0x53e9f7['get']({'plain':!![]});if(_0x3231e9[_0x1dc9('0xe')][_0x1dc9('0xf')]()==='in'||_0x3231e9[_0x1dc9('0xe')][_0x1dc9('0xf')]()===_0x1dc9('0x10')&&!_0x3231e9['secret']&&!_[_0x1dc9('0x11')](_0x3231e9[_0x1dc9('0x12')])){_0x49330e[_0x1dc9('0x13')][_0x1dc9('0x14')]({'where':{'id':_0x3231e9[_0x1dc9('0x15')]}})['then'](function(_0x5852fe){if(_0x5852fe){_0x5852fe[_0x1dc9('0x16')]({'lastMsgAt':_0x3231e9['createdAt'],'lastMsgDirection':_0x3231e9[_0x1dc9('0xe')][_0x1dc9('0xf')]()});}})[_0x1dc9('0x17')](function(_0x1abf27){console['error'](_0x1abf27);});}_0x223d4e();}},'charset':_0x1dc9('0x18'),'collate':_0x1dc9('0x19')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 9eae1be..57e3e50 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 _0x4371=['ChatMessage','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','./chatMessage.socket','register','request','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','CreateChatMessage'];(function(_0x2ef141,_0x3be740){var _0x47c2c0=function(_0x3f0a6a){while(--_0x3f0a6a){_0x2ef141['push'](_0x2ef141['shift']());}};_0x47c2c0(++_0x3be740);}(_0x4371,0x192));var _0x1437=function(_0x4dd4a1,_0x5ca922){_0x4dd4a1=_0x4dd4a1-0x0;var _0x168d0f=_0x4371[_0x4dd4a1];return _0x168d0f;};'use strict';var _=require(_0x1437('0x0'));var util=require(_0x1437('0x1'));var moment=require(_0x1437('0x2'));var BPromise=require(_0x1437('0x3'));var rs=require(_0x1437('0x4'));var fs=require('fs');var Redis=require(_0x1437('0x5'));var db=require(_0x1437('0x6'))['db'];var utils=require(_0x1437('0x7'));var logger=require(_0x1437('0x8'))(_0x1437('0x9'));var config=require('../../config/environment');var jayson=require(_0x1437('0xa'));var client=jayson['client'][_0x1437('0xb')]({'port':0x232a});config['redis']=_[_0x1437('0xc')](config[_0x1437('0xd')],{'host':_0x1437('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1437('0xd')]));require(_0x1437('0xf'))[_0x1437('0x10')](socket);function respondWithRpcPromise(_0x2d7aaf,_0x3d63a7,_0x112c80){return new BPromise(function(_0x1bf039,_0x500c90){return client[_0x1437('0x11')](_0x2d7aaf,_0x112c80)[_0x1437('0x12')](function(_0x144db4){logger[_0x1437('0x13')]('ChatMessage,\x20%s,\x20%s',_0x3d63a7,'request\x20sent');logger[_0x1437('0x14')](_0x1437('0x15'),_0x3d63a7,_0x1437('0x16'),JSON[_0x1437('0x17')](_0x144db4));if(_0x144db4[_0x1437('0x18')]){if(_0x144db4['error'][_0x1437('0x19')]===0x1f4){logger[_0x1437('0x18')](_0x1437('0x1a'),_0x3d63a7,_0x144db4[_0x1437('0x18')][_0x1437('0x1b')]);return _0x500c90(_0x144db4['error'][_0x1437('0x1b')]);}logger[_0x1437('0x18')](_0x1437('0x1a'),_0x3d63a7,_0x144db4['error'][_0x1437('0x1b')]);return _0x1bf039(_0x144db4[_0x1437('0x18')][_0x1437('0x1b')]);}else{logger['info'](_0x1437('0x1a'),_0x3d63a7,_0x1437('0x16'));_0x1bf039(_0x144db4[_0x1437('0x1c')][_0x1437('0x1b')]);}})['catch'](function(_0x1a1129){logger[_0x1437('0x18')]('ChatMessage,\x20%s,\x20%s',_0x3d63a7,_0x1a1129);_0x500c90(_0x1a1129);});});}exports[_0x1437('0x1d')]=function(_0x460681){var _0x629873=this;return new Promise(function(_0x3d0998,_0x31306c){return db[_0x1437('0x1e')][_0x1437('0x1f')](_0x460681[_0x1437('0x20')],{'raw':_0x460681[_0x1437('0x21')]?_0x460681[_0x1437('0x21')][_0x1437('0x22')]===undefined?!![]:![]:!![]})[_0x1437('0x12')](function(_0x18d14f){logger['info'](_0x1437('0x1d'),_0x460681);logger[_0x1437('0x14')](_0x1437('0x1d'),_0x460681,JSON[_0x1437('0x17')](_0x18d14f));_0x3d0998(_0x18d14f);})[_0x1437('0x23')](function(_0x940356){logger[_0x1437('0x18')](_0x1437('0x1d'),_0x940356['message'],_0x460681);_0x31306c(_0x629873['error'](0x1f4,_0x940356[_0x1437('0x1b')]));});});};
\ No newline at end of file
+var _0xb044=['localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','ChatMessage','create','options','raw','CreateChatMessage','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x1ca29f,_0x318ac5){var _0x576c3b=function(_0x40caab){while(--_0x40caab){_0x1ca29f['push'](_0x1ca29f['shift']());}};_0x576c3b(++_0x318ac5);}(_0xb044,0x74));var _0x4b04=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xb044[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x4b04('0x0'));var moment=require('moment');var BPromise=require(_0x4b04('0x1'));var rs=require(_0x4b04('0x2'));var fs=require('fs');var Redis=require(_0x4b04('0x3'));var db=require(_0x4b04('0x4'))['db'];var utils=require(_0x4b04('0x5'));var logger=require(_0x4b04('0x6'))(_0x4b04('0x7'));var config=require('../../config/environment');var jayson=require(_0x4b04('0x8'));var client=jayson[_0x4b04('0x9')][_0x4b04('0xa')]({'port':0x232a});config[_0x4b04('0xb')]=_['defaults'](config[_0x4b04('0xb')],{'host':_0x4b04('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b04('0xb')]));require(_0x4b04('0xd'))[_0x4b04('0xe')](socket);function respondWithRpcPromise(_0x37063c,_0x24951c,_0x8df528){return new BPromise(function(_0x74d1e3,_0x3f288e){return client[_0x4b04('0xf')](_0x37063c,_0x8df528)[_0x4b04('0x10')](function(_0x3033fd){logger[_0x4b04('0x11')](_0x4b04('0x12'),_0x24951c,'request\x20sent');logger[_0x4b04('0x13')](_0x4b04('0x14'),_0x24951c,_0x4b04('0x15'),JSON['stringify'](_0x3033fd));if(_0x3033fd[_0x4b04('0x16')]){if(_0x3033fd[_0x4b04('0x16')]['code']===0x1f4){logger['error'](_0x4b04('0x12'),_0x24951c,_0x3033fd[_0x4b04('0x16')]['message']);return _0x3f288e(_0x3033fd['error'][_0x4b04('0x17')]);}logger['error'](_0x4b04('0x12'),_0x24951c,_0x3033fd[_0x4b04('0x16')][_0x4b04('0x17')]);return _0x74d1e3(_0x3033fd['error'][_0x4b04('0x17')]);}else{logger[_0x4b04('0x11')](_0x4b04('0x12'),_0x24951c,_0x4b04('0x15'));_0x74d1e3(_0x3033fd[_0x4b04('0x18')][_0x4b04('0x17')]);}})[_0x4b04('0x19')](function(_0x7b056a){logger[_0x4b04('0x16')](_0x4b04('0x12'),_0x24951c,_0x7b056a);_0x3f288e(_0x7b056a);});});}exports['CreateChatMessage']=function(_0x36cf00){var _0x469ce7=this;return new Promise(function(_0x54c3e9,_0x238b1a){return db[_0x4b04('0x1a')][_0x4b04('0x1b')](_0x36cf00['body'],{'raw':_0x36cf00[_0x4b04('0x1c')]?_0x36cf00['options'][_0x4b04('0x1d')]===undefined?!![]:![]:!![]})[_0x4b04('0x10')](function(_0x5d121f){logger[_0x4b04('0x11')](_0x4b04('0x1e'),_0x36cf00);logger[_0x4b04('0x13')](_0x4b04('0x1e'),_0x36cf00,JSON[_0x4b04('0x1f')](_0x5d121f));_0x54c3e9(_0x5d121f);})[_0x4b04('0x19')](function(_0x14f697){logger['error'](_0x4b04('0x1e'),_0x14f697[_0x4b04('0x17')],_0x36cf00);_0x238b1a(_0x469ce7[_0x4b04('0x16')](0x1f4,_0x14f697['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 7fede85..8e9542b 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 _0x3baf=['save','remove','update','emit','removeListener','register','chatMessage:','./chatMessage.events'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x3baf,0xf7));var _0xf3ba=function(_0x5193cd,_0xcd459f){_0x5193cd=_0x5193cd-0x0;var _0x264954=_0x3baf[_0x5193cd];return _0x264954;};'use strict';var ChatMessageEvents=require(_0xf3ba('0x0'));var events=[_0xf3ba('0x1'),_0xf3ba('0x2'),_0xf3ba('0x3')];function createListener(_0x29bbc2,_0x22f9c0){return function(_0xfce22){_0x22f9c0[_0xf3ba('0x4')](_0x29bbc2,_0xfce22);};}function removeListener(_0x3e6058,_0x1ae6e6){return function(){ChatMessageEvents[_0xf3ba('0x5')](_0x3e6058,_0x1ae6e6);};}exports[_0xf3ba('0x6')]=function(_0x475268){for(var _0x2e6df2=0x0,_0x1284b7=events['length'];_0x2e6df2<_0x1284b7;_0x2e6df2++){var _0x579135=events[_0x2e6df2];var _0x5ab058=createListener(_0xf3ba('0x7')+_0x579135,_0x475268);ChatMessageEvents['on'](_0x579135,_0x5ab058);}};
\ No newline at end of file
+var _0x6f47=['chatMessage:','save','remove','removeListener','register','length'];(function(_0x44f56d,_0x343df3){var _0x2a37da=function(_0x3f7b79){while(--_0x3f7b79){_0x44f56d['push'](_0x44f56d['shift']());}};_0x2a37da(++_0x343df3);}(_0x6f47,0xc7));var _0x76f4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6f47[_0x21a9d9];return _0x46adce;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x76f4('0x0'),_0x76f4('0x1'),'update'];function createListener(_0x2092f3,_0x5765c1){return function(_0x698b39){_0x5765c1['emit'](_0x2092f3,_0x698b39);};}function removeListener(_0xe214ad,_0xc5dddc){return function(){ChatMessageEvents[_0x76f4('0x2')](_0xe214ad,_0xc5dddc);};}exports[_0x76f4('0x3')]=function(_0x5754ca){for(var _0x35602f=0x0,_0xfc2405=events[_0x76f4('0x4')];_0x35602f<_0xfc2405;_0x35602f++){var _0x497f99=events[_0x35602f];var _0x1a3172=createListener(_0x76f4('0x5')+_0x497f99,_0x5754ca);ChatMessageEvents['on'](_0x497f99,_0x1a3172);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 1e9658d..f6b2e85 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 _0x078f=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','tracked','chatmessage:create','create','put','accept','/:id/reject','reject','delete','destroy','exports','util'];(function(_0x23d47a,_0x5550e8){var _0x22d3c0=function(_0x4a550f){while(--_0x4a550f){_0x23d47a['push'](_0x23d47a['shift']());}};_0x22d3c0(++_0x5550e8);}(_0x078f,0xb5));var _0xf078=function(_0x522ae8,_0x3b637e){_0x522ae8=_0x522ae8-0x0;var _0x3189b9=_0x078f[_0x522ae8];return _0x3189b9;};'use strict';var multer=require('multer');var util=require(_0xf078('0x0'));var path=require(_0xf078('0x1'));var timeout=require(_0xf078('0x2'));var express=require('express');var router=express[_0xf078('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf078('0x4'));var interaction=require(_0xf078('0x5'));var config=require(_0xf078('0x6'));var controller=require(_0xf078('0x7'));router[_0xf078('0x8')]('/',auth['isAuthenticated'](),controller[_0xf078('0x9')]);router['get'](_0xf078('0xa'),auth['isAuthenticated'](),controller[_0xf078('0xb')]);router[_0xf078('0x8')](_0xf078('0xc'),auth[_0xf078('0xd')](),controller[_0xf078('0xe')]);router[_0xf078('0xf')]('/',auth['isAuthenticated'](),interaction[_0xf078('0x10')]('chat',_0xf078('0x11')),controller[_0xf078('0x12')]);router[_0xf078('0x13')](_0xf078('0xc'),controller['update']);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0xf078('0x14')]);router[_0xf078('0x13')](_0xf078('0x15'),auth['isAuthenticated'](),controller[_0xf078('0x16')]);router[_0xf078('0x17')]('/:id',auth[_0xf078('0xd')](),controller[_0xf078('0x18')]);module[_0xf078('0x19')]=router;
\ No newline at end of file
+var _0xfa13=['put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','chat','chatmessage:create','create','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa13,0x99));var _0x3fa1=function(_0x4d69b5,_0x1a58d6){_0x4d69b5=_0x4d69b5-0x0;var _0x2838c6=_0xfa13[_0x4d69b5];return _0x2838c6;};'use strict';var multer=require(_0x3fa1('0x0'));var util=require('util');var path=require(_0x3fa1('0x1'));var timeout=require(_0x3fa1('0x2'));var express=require(_0x3fa1('0x3'));var router=express[_0x3fa1('0x4')]();var fs_extra=require(_0x3fa1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3fa1('0x6'));var config=require(_0x3fa1('0x7'));var controller=require(_0x3fa1('0x8'));router[_0x3fa1('0x9')]('/',auth['isAuthenticated'](),controller[_0x3fa1('0xa')]);router['get'](_0x3fa1('0xb'),auth[_0x3fa1('0xc')](),controller[_0x3fa1('0xd')]);router['get'](_0x3fa1('0xe'),auth[_0x3fa1('0xc')](),controller[_0x3fa1('0xf')]);router[_0x3fa1('0x10')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x3fa1('0x11'),_0x3fa1('0x12')),controller[_0x3fa1('0x13')]);router['put'](_0x3fa1('0xe'),controller[_0x3fa1('0x14')]);router[_0x3fa1('0x15')](_0x3fa1('0x16'),auth['isAuthenticated'](),controller[_0x3fa1('0x17')]);router[_0x3fa1('0x15')](_0x3fa1('0x18'),auth[_0x3fa1('0xc')](),controller[_0x3fa1('0x19')]);router[_0x3fa1('0x1a')](_0x3fa1('0xe'),auth[_0x3fa1('0xc')](),controller[_0x3fa1('0x1b')]);module[_0x3fa1('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 6f0ff8d..4cdb46e 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 _0x5f66=['medium','TEXT','exports'];(function(_0x1db288,_0x52f105){var _0x336800=function(_0x1cd1c2){while(--_0x1cd1c2){_0x1db288['push'](_0x1db288['shift']());}};_0x336800(++_0x52f105);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x2032=['medium','exports','TEXT'];(function(_0x2eef32,_0x29f149){var _0x279e3f=function(_0x25acd1){while(--_0x25acd1){_0x2eef32['push'](_0x2eef32['shift']());}};_0x279e3f(++_0x29f149);}(_0x2032,0xd9));var _0x2203=function(_0x5c9c35,_0x2820de){_0x5c9c35=_0x5c9c35-0x0;var _0x43378b=_0x2032[_0x5c9c35];return _0x43378b;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 656de18..9504dc1 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(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x7a54,0x106));var _0x47a5=function(_0x5eae06,_0x227bf2){_0x5eae06=_0x5eae06-0x0;var _0x34a70f=_0x7a54[_0x5eae06];return _0x34a70f;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x7a54,0x106));var _0x47a5=function(_0x5e4068,_0x1345a5){_0x5e4068=_0x5e4068-0x0;var _0x22a540=_0x7a54[_0x5e4068];return _0x22a540;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 268d15d..feaa35f 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ad6=['exports','events','ChatOfflineMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2b8286,_0xe3d644){var _0x14af6c=function(_0x51a015){while(--_0x51a015){_0x2b8286['push'](_0x2b8286['shift']());}};_0x14af6c(++_0xe3d644);}(_0x2ad6,0x1a1));var _0x62ad=function(_0xdeb232,_0x18eb34){_0xdeb232=_0xdeb232-0x0;var _0x2191b0=_0x2ad6[_0xdeb232];return _0x2191b0;};'use strict';var EventEmitter=require(_0x62ad('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x62ad('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x62ad('0x2')](0x0);var events={'afterCreate':_0x62ad('0x3'),'afterUpdate':_0x62ad('0x4'),'afterDestroy':'remove'};function emitEvent(_0x989270){return function(_0x750cc9,_0xd24c4c,_0x1142ee){ChatOfflineMessageEvents[_0x62ad('0x5')](_0x989270+':'+_0x750cc9['id'],_0x750cc9);ChatOfflineMessageEvents['emit'](_0x989270,_0x750cc9);_0x1142ee(null);};}for(var e in events){if(events[_0x62ad('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x62ad('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xe60e=['save','update','emit','hasOwnProperty','hook','exports','events','ChatOfflineMessage','setMaxListeners'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0xe60e,0x8d));var _0xee60=function(_0x4e7261,_0x5d624d){_0x4e7261=_0x4e7261-0x0;var _0x37d87b=_0xe60e[_0x4e7261];return _0x37d87b;};'use strict';var EventEmitter=require(_0xee60('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xee60('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xee60('0x2')](0x0);var events={'afterCreate':_0xee60('0x3'),'afterUpdate':_0xee60('0x4'),'afterDestroy':'remove'};function emitEvent(_0xa15205){return function(_0x4e6fa1,_0x3e2308,_0x2f2794){ChatOfflineMessageEvents[_0xee60('0x5')](_0xa15205+':'+_0x4e6fa1['id'],_0x4e6fa1);ChatOfflineMessageEvents[_0xee60('0x5')](_0xa15205,_0x4e6fa1);_0x2f2794(null);};}for(var e in events){if(events[_0xee60('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xee60('0x7')](e,emitEvent(event));}}module[_0xee60('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 9abad0d..ba5a113 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 _0x6b7a=['exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x2967c1,_0x202a72){var _0x103397=function(_0x14b5cc){while(--_0x14b5cc){_0x2967c1['push'](_0x2967c1['shift']());}};_0x103397(++_0x202a72);}(_0x6b7a,0x108));var _0xa6b7=function(_0x1ab0e6,_0x17ba8d){_0x1ab0e6=_0x1ab0e6-0x0;var _0x248815=_0x6b7a[_0x1ab0e6];return _0x248815;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xa6b7('0x0')]=function(_0x34d09c){return _0x34d09c[_0xa6b7('0x1')](_0xa6b7('0x2'),attributes,{'tableName':_0xa6b7('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x74a0=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages'];(function(_0x33403b,_0x5cca9c){var _0x2d8657=function(_0x171e25){while(--_0x171e25){_0x33403b['push'](_0x33403b['shift']());}};_0x2d8657(++_0x5cca9c);}(_0x74a0,0x92));var _0x074a=function(_0x5ed085,_0x3f03e3){_0x5ed085=_0x5ed085-0x0;var _0x36da7b=_0x74a0[_0x5ed085];return _0x36da7b;};'use strict';var attributes=require(_0x074a('0x0'));module[_0x074a('0x1')]=function(_0x49a680){return _0x49a680['define'](_0x074a('0x2'),attributes,{'tableName':_0x074a('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x074a('0x4'),'collate':_0x074a('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 51f1e9e..ea4755a 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 _0xa2f5=['http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x32e90a,_0x317d6f){var _0x3ad167=function(_0x5ece84){while(--_0x5ece84){_0x32e90a['push'](_0x32e90a['shift']());}};_0x3ad167(++_0x317d6f);}(_0xa2f5,0xf2));var _0x5a2f=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa2f5[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x5a2f('0x0'));var util=require(_0x5a2f('0x1'));var moment=require(_0x5a2f('0x2'));var BPromise=require(_0x5a2f('0x3'));var rs=require(_0x5a2f('0x4'));var fs=require('fs');var Redis=require(_0x5a2f('0x5'));var db=require(_0x5a2f('0x6'))['db'];var utils=require(_0x5a2f('0x7'));var logger=require(_0x5a2f('0x8'))(_0x5a2f('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5a2f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x417d87,_0x5da183,_0x2d6392){return new BPromise(function(_0x1033db,_0x214637){return client[_0x5a2f('0xb')](_0x417d87,_0x2d6392)['then'](function(_0x58e639){logger['info'](_0x5a2f('0xc'),_0x5da183,_0x5a2f('0xd'));logger[_0x5a2f('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5da183,_0x5a2f('0xd'),JSON[_0x5a2f('0xf')](_0x58e639));if(_0x58e639['error']){if(_0x58e639[_0x5a2f('0x10')]['code']===0x1f4){logger['error'](_0x5a2f('0xc'),_0x5da183,_0x58e639[_0x5a2f('0x10')][_0x5a2f('0x11')]);return _0x214637(_0x58e639['error'][_0x5a2f('0x11')]);}logger[_0x5a2f('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5da183,_0x58e639['error'][_0x5a2f('0x11')]);return _0x1033db(_0x58e639[_0x5a2f('0x10')]['message']);}else{logger[_0x5a2f('0x12')](_0x5a2f('0xc'),_0x5da183,_0x5a2f('0xd'));_0x1033db(_0x58e639[_0x5a2f('0x13')][_0x5a2f('0x11')]);}})[_0x5a2f('0x14')](function(_0x566cd0){logger[_0x5a2f('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5da183,_0x566cd0);_0x214637(_0x566cd0);});});}
\ No newline at end of file
+var _0x9c5b=['ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info'];(function(_0x4b7976,_0x55e10b){var _0x422298=function(_0x531d4b){while(--_0x531d4b){_0x4b7976['push'](_0x4b7976['shift']());}};_0x422298(++_0x55e10b);}(_0x9c5b,0x127));var _0xb9c5=function(_0x2f3370,_0x28e72a){_0x2f3370=_0x2f3370-0x0;var _0xf8db52=_0x9c5b[_0x2f3370];return _0xf8db52;};'use strict';var _=require(_0xb9c5('0x0'));var util=require(_0xb9c5('0x1'));var moment=require(_0xb9c5('0x2'));var BPromise=require(_0xb9c5('0x3'));var rs=require(_0xb9c5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9c5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb9c5('0x6'));var config=require(_0xb9c5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb9c5('0x8')][_0xb9c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x237363,_0x4750a5,_0x24dc7c){return new BPromise(function(_0x18d941,_0x216ba8){return client[_0xb9c5('0xa')](_0x237363,_0x24dc7c)[_0xb9c5('0xb')](function(_0x5f04bc){logger[_0xb9c5('0xc')](_0xb9c5('0xd'),_0x4750a5,'request\x20sent');logger[_0xb9c5('0xe')](_0xb9c5('0xf'),_0x4750a5,_0xb9c5('0x10'),JSON['stringify'](_0x5f04bc));if(_0x5f04bc[_0xb9c5('0x11')]){if(_0x5f04bc[_0xb9c5('0x11')][_0xb9c5('0x12')]===0x1f4){logger[_0xb9c5('0x11')](_0xb9c5('0xd'),_0x4750a5,_0x5f04bc[_0xb9c5('0x11')]['message']);return _0x216ba8(_0x5f04bc['error'][_0xb9c5('0x13')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x4750a5,_0x5f04bc[_0xb9c5('0x11')][_0xb9c5('0x13')]);return _0x18d941(_0x5f04bc['error'][_0xb9c5('0x13')]);}else{logger[_0xb9c5('0xc')](_0xb9c5('0xd'),_0x4750a5,_0xb9c5('0x10'));_0x18d941(_0x5f04bc[_0xb9c5('0x14')]['message']);}})[_0xb9c5('0x15')](function(_0x1a219f){logger[_0xb9c5('0x11')](_0xb9c5('0xd'),_0x4750a5,_0x1a219f);_0x216ba8(_0x1a219f);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index d6d3c04..e814b5f 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 _0xb9d6=['/describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index'];(function(_0x43026b,_0x928d8c){var _0x4a96cd=function(_0x362cbd){while(--_0x362cbd){_0x43026b['push'](_0x43026b['shift']());}};_0x4a96cd(++_0x928d8c);}(_0xb9d6,0x13d));var _0x6b9d=function(_0x1eebe4,_0x27f7b4){_0x1eebe4=_0x1eebe4-0x0;var _0x46f639=_0xb9d6[_0x1eebe4];return _0x46f639;};'use strict';var multer=require(_0x6b9d('0x0'));var util=require(_0x6b9d('0x1'));var path=require(_0x6b9d('0x2'));var timeout=require(_0x6b9d('0x3'));var express=require('express');var router=express[_0x6b9d('0x4')]();var fs_extra=require(_0x6b9d('0x5'));var auth=require(_0x6b9d('0x6'));var interaction=require(_0x6b9d('0x7'));var config=require(_0x6b9d('0x8'));var controller=require(_0x6b9d('0x9'));router[_0x6b9d('0xa')]('/',auth[_0x6b9d('0xb')](),controller[_0x6b9d('0xc')]);router[_0x6b9d('0xa')](_0x6b9d('0xd'),auth[_0x6b9d('0xb')](),controller['describe']);router[_0x6b9d('0xa')](_0x6b9d('0xe'),auth['isAuthenticated'](),controller[_0x6b9d('0xf')]);router[_0x6b9d('0x10')]('/',auth[_0x6b9d('0xb')](),controller['create']);router[_0x6b9d('0x11')](_0x6b9d('0xe'),auth[_0x6b9d('0xb')](),controller[_0x6b9d('0x12')]);router[_0x6b9d('0x13')](_0x6b9d('0xe'),auth[_0x6b9d('0xb')](),controller[_0x6b9d('0x14')]);module[_0x6b9d('0x15')]=router;
\ No newline at end of file
+var _0x84fa=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','show','post','create','/:id','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x84fa,0x9d));var _0xa84f=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x84fa[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0xa84f('0x0'));var util=require(_0xa84f('0x1'));var path=require('path');var timeout=require(_0xa84f('0x2'));var express=require(_0xa84f('0x3'));var router=express[_0xa84f('0x4')]();var fs_extra=require(_0xa84f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa84f('0x6'));var config=require(_0xa84f('0x7'));var controller=require(_0xa84f('0x8'));router['get']('/',auth[_0xa84f('0x9')](),controller[_0xa84f('0xa')]);router[_0xa84f('0xb')](_0xa84f('0xc'),auth[_0xa84f('0x9')](),controller[_0xa84f('0xd')]);router[_0xa84f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xa84f('0xe')]);router[_0xa84f('0xf')]('/',auth[_0xa84f('0x9')](),controller[_0xa84f('0x10')]);router['put'](_0xa84f('0x11'),auth[_0xa84f('0x9')](),controller[_0xa84f('0x12')]);router[_0xa84f('0x13')]('/:id',auth[_0xa84f('0x9')](),controller[_0xa84f('0x14')]);module[_0xa84f('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 9552440..e7ab503 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 _0xca8a=['timeout','INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xca8a,0xc6));var _0xaca8=function(_0x5bd922,_0x2a6c2b){_0x5bd922=_0x5bd922-0x0;var _0x90ef93=_0xca8a[_0x5bd922];return _0x90ef93;};'use strict';var Sequelize=require(_0xaca8('0x0'));module[_0xaca8('0x1')]={'name':{'type':Sequelize[_0xaca8('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xaca8('0x3')](_0xaca8('0x4'),_0xaca8('0x5')),'defaultValue':_0xaca8('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xaca8('0x6')]}};
\ No newline at end of file
+var _0xd4be=['mouseOver','STRING','INTEGER','exports'];(function(_0x478f5a,_0x272c62){var _0x4e15d7=function(_0x157556){while(--_0x157556){_0x478f5a['push'](_0x478f5a['shift']());}};_0x4e15d7(++_0x272c62);}(_0xd4be,0x16f));var _0xed4b=function(_0x591d02,_0x513f71){_0x591d02=_0x591d02-0x0;var _0x39b52b=_0xd4be[_0x591d02];return _0x39b52b;};'use strict';var Sequelize=require('sequelize');module[_0xed4b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xed4b('0x1'),'timeout'),'defaultValue':_0xed4b('0x1')},'selector':{'type':Sequelize[_0xed4b('0x2')]},'timeout':{'type':Sequelize[_0xed4b('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index f107bb9..645e030 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 _0xfdb3=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','save','then','destroy','stack','name','send','show','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','model','fields','length','merge','options','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x1f0077,_0x328f99){var _0x353a1d=function(_0x5927fb){while(--_0x5927fb){_0x1f0077['push'](_0x1f0077['shift']());}};_0x353a1d(++_0x328f99);}(_0xfdb3,0x10c));var _0x3fdb=function(_0x5e185b,_0x853f33){_0x5e185b=_0x5e185b-0x0;var _0x19044d=_0xfdb3[_0x5e185b];return _0x19044d;};'use strict';var emlformat=require(_0x3fdb('0x0'));var rimraf=require(_0x3fdb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3fdb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3fdb('0x3'));var Mustache=require('mustache');var util=require(_0x3fdb('0x4'));var path=require(_0x3fdb('0x5'));var sox=require(_0x3fdb('0x6'));var csv=require(_0x3fdb('0x7'));var ejs=require(_0x3fdb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3fdb('0x9'));var squel=require(_0x3fdb('0xa'));var crypto=require(_0x3fdb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3fdb('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3fdb('0xd'));var Papa=require(_0x3fdb('0xe'));var Redis=require(_0x3fdb('0xf'));var authService=require(_0x3fdb('0x10'));var qs=require(_0x3fdb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x3fdb('0x12'));var config=require(_0x3fdb('0x13'));var licenseUtil=require(_0x3fdb('0x14'));var db=require(_0x3fdb('0x15'))['db'];function respondWithStatusCode(_0x3cc79c,_0x41f371){_0x41f371=_0x41f371||0xcc;return function(_0x416962){if(_0x416962){return _0x3cc79c[_0x3fdb('0x16')](_0x41f371);}return _0x3cc79c[_0x3fdb('0x17')](_0x41f371)[_0x3fdb('0x18')]();};}function respondWithResult(_0x4eab69,_0x35a660){_0x35a660=_0x35a660||0xc8;return function(_0x1a5dd8){if(_0x1a5dd8){return _0x4eab69['status'](_0x35a660)[_0x3fdb('0x19')](_0x1a5dd8);}};}function respondWithFilteredResult(_0x31cd0e,_0x182635){return function(_0x39c573){if(_0x39c573){var _0x5a9b95=typeof _0x182635['offset']==='undefined'&&typeof _0x182635[_0x3fdb('0x1a')]===_0x3fdb('0x1b');var _0x11d57d=_0x39c573[_0x3fdb('0x1c')];var _0x212ab6=_0x5a9b95?0x0:_0x182635['offset'];var _0x224035=_0x5a9b95?_0x39c573[_0x3fdb('0x1c')]:_0x182635[_0x3fdb('0x1d')]+_0x182635[_0x3fdb('0x1a')];var _0x370f84;if(_0x224035>=_0x11d57d){_0x224035=_0x11d57d;_0x370f84=0xc8;}else{_0x370f84=0xce;}_0x31cd0e['status'](_0x370f84);return _0x31cd0e[_0x3fdb('0x1e')](_0x3fdb('0x1f'),_0x212ab6+'-'+_0x224035+'/'+_0x11d57d)[_0x3fdb('0x19')](_0x39c573);}return null;};}function patchUpdates(_0x1bbad7){return function(_0x403f48){try{jsonpatch['apply'](_0x403f48,_0x1bbad7,!![]);}catch(_0x76431d){return BPromise['reject'](_0x76431d);}return _0x403f48[_0x3fdb('0x20')]();};}function saveUpdates(_0x490744,_0x516440){return function(_0x48b674){if(_0x48b674){return _0x48b674['update'](_0x490744)[_0x3fdb('0x21')](function(_0x264913){return _0x264913;});}return null;};}function removeEntity(_0xaf7c32,_0xac9aac){return function(_0x111cb8){if(_0x111cb8){return _0x111cb8[_0x3fdb('0x22')]()['then'](function(){_0xaf7c32['status'](0xcc)[_0x3fdb('0x18')]();});}};}function handleEntityNotFound(_0xc0410d,_0x5c30b5){return function(_0xaf7f8f){if(!_0xaf7f8f){_0xc0410d['sendStatus'](0x194);}return _0xaf7f8f;};}function handleError(_0x47d667,_0x1b9c4b){_0x1b9c4b=_0x1b9c4b||0x1f4;return function(_0x24278c){logger['error'](_0x24278c[_0x3fdb('0x23')]);if(_0x24278c['name']){delete _0x24278c[_0x3fdb('0x24')];}_0x47d667[_0x3fdb('0x17')](_0x1b9c4b)[_0x3fdb('0x25')](_0x24278c);};}exports[_0x3fdb('0x26')]=function(_0x3d6fbe,_0x37f3d7){var _0x442dbc={'raw':!![],'where':{'id':_0x3d6fbe['params']['id']}},_0x29be8e={};_0x29be8e['model']=_[_0x3fdb('0x27')](db[_0x3fdb('0x28')][_0x3fdb('0x29')]);_0x29be8e[_0x3fdb('0x2a')]=_[_0x3fdb('0x27')](_0x3d6fbe[_0x3fdb('0x2a')]);_0x29be8e[_0x3fdb('0x2b')]=_[_0x3fdb('0x2c')](_0x29be8e['model'],_0x29be8e[_0x3fdb('0x2a')]);_0x442dbc[_0x3fdb('0x2d')]=_[_0x3fdb('0x2c')](_0x29be8e[_0x3fdb('0x2e')],qs[_0x3fdb('0x2f')](_0x3d6fbe[_0x3fdb('0x2a')][_0x3fdb('0x2f')]));_0x442dbc[_0x3fdb('0x2d')]=_0x442dbc[_0x3fdb('0x2d')][_0x3fdb('0x30')]?_0x442dbc[_0x3fdb('0x2d')]:_0x29be8e[_0x3fdb('0x2e')];if(_0x3d6fbe[_0x3fdb('0x2a')]['includeAll']){_0x442dbc['include']=[{'all':!![]}];}_0x442dbc=_[_0x3fdb('0x31')]({},_0x442dbc,_0x3d6fbe[_0x3fdb('0x32')]);return db[_0x3fdb('0x28')][_0x3fdb('0x33')](_0x442dbc)[_0x3fdb('0x21')](handleEntityNotFound(_0x37f3d7,null))[_0x3fdb('0x21')](respondWithResult(_0x37f3d7,null))[_0x3fdb('0x34')](handleError(_0x37f3d7,null));};exports[_0x3fdb('0x35')]=function(_0xba3e2,_0x530b2a){return db[_0x3fdb('0x28')]['create'](_0xba3e2[_0x3fdb('0x36')],{})[_0x3fdb('0x21')](respondWithResult(_0x530b2a,0xc9))[_0x3fdb('0x34')](handleError(_0x530b2a,null));};exports['update']=function(_0x29cdfa,_0x324037){if(_0x29cdfa['body']['id']){delete _0x29cdfa[_0x3fdb('0x36')]['id'];}return db[_0x3fdb('0x28')][_0x3fdb('0x33')]({'where':{'id':_0x29cdfa[_0x3fdb('0x37')]['id']}})['then'](handleEntityNotFound(_0x324037,null))[_0x3fdb('0x21')](saveUpdates(_0x29cdfa[_0x3fdb('0x36')],null))['then'](respondWithResult(_0x324037,null))[_0x3fdb('0x34')](handleError(_0x324037,null));};exports[_0x3fdb('0x22')]=function(_0x23e574,_0x183db1){return db[_0x3fdb('0x28')][_0x3fdb('0x33')]({'where':{'id':_0x23e574['params']['id']}})[_0x3fdb('0x21')](handleEntityNotFound(_0x183db1,null))['then'](removeEntity(_0x183db1,null))[_0x3fdb('0x34')](handleError(_0x183db1,null));};
\ No newline at end of file
+var _0x379e=['keys','rawAttributes','query','filters','intersection','model','attributes','length','includeAll','include','options','ChatProactiveAction','find','catch','create','body','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','show','params'];(function(_0x250298,_0x5a869a){var _0x798dbf=function(_0x1d9551){while(--_0x1d9551){_0x250298['push'](_0x250298['shift']());}};_0x798dbf(++_0x5a869a);}(_0x379e,0x104));var _0xe379=function(_0x18e088,_0x28bb43){_0x18e088=_0x18e088-0x0;var _0x278fe3=_0x379e[_0x18e088];return _0x278fe3;};'use strict';var emlformat=require(_0xe379('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe379('0x1'));var moment=require(_0xe379('0x2'));var BPromise=require(_0xe379('0x3'));var Mustache=require(_0xe379('0x4'));var util=require(_0xe379('0x5'));var path=require(_0xe379('0x6'));var sox=require(_0xe379('0x7'));var csv=require('to-csv');var ejs=require(_0xe379('0x8'));var fs=require('fs');var fs_extra=require(_0xe379('0x9'));var _=require(_0xe379('0xa'));var squel=require(_0xe379('0xb'));var crypto=require(_0xe379('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe379('0xd'));var toCsv=require(_0xe379('0xe'));var querystring=require(_0xe379('0xf'));var Papa=require(_0xe379('0x10'));var Redis=require(_0xe379('0x11'));var authService=require(_0xe379('0x12'));var qs=require(_0xe379('0x13'));var as=require(_0xe379('0x14'));var hardwareService=require(_0xe379('0x15'));var logger=require('../../config/logger')(_0xe379('0x16'));var utils=require(_0xe379('0x17'));var config=require(_0xe379('0x18'));var licenseUtil=require(_0xe379('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c6562,_0x2642a8){_0x2642a8=_0x2642a8||0xcc;return function(_0x45cf1a){if(_0x45cf1a){return _0x4c6562[_0xe379('0x1a')](_0x2642a8);}return _0x4c6562[_0xe379('0x1b')](_0x2642a8)[_0xe379('0x1c')]();};}function respondWithResult(_0x1ee8e0,_0x2a5b60){_0x2a5b60=_0x2a5b60||0xc8;return function(_0x70d82){if(_0x70d82){return _0x1ee8e0['status'](_0x2a5b60)[_0xe379('0x1d')](_0x70d82);}};}function respondWithFilteredResult(_0xab59c7,_0x20eaaf){return function(_0x105d7f){if(_0x105d7f){var _0x3d9351=typeof _0x20eaaf[_0xe379('0x1e')]==='undefined'&&typeof _0x20eaaf[_0xe379('0x1f')]==='undefined';var _0x2c2bd9=_0x105d7f['count'];var _0x150d92=_0x3d9351?0x0:_0x20eaaf[_0xe379('0x1e')];var _0xe4f3d1=_0x3d9351?_0x105d7f[_0xe379('0x20')]:_0x20eaaf['offset']+_0x20eaaf[_0xe379('0x1f')];var _0x260b2e;if(_0xe4f3d1>=_0x2c2bd9){_0xe4f3d1=_0x2c2bd9;_0x260b2e=0xc8;}else{_0x260b2e=0xce;}_0xab59c7[_0xe379('0x1b')](_0x260b2e);return _0xab59c7[_0xe379('0x21')](_0xe379('0x22'),_0x150d92+'-'+_0xe4f3d1+'/'+_0x2c2bd9)['json'](_0x105d7f);}return null;};}function patchUpdates(_0x2c749e){return function(_0x3a8d17){try{jsonpatch['apply'](_0x3a8d17,_0x2c749e,!![]);}catch(_0x39ec4d){return BPromise[_0xe379('0x23')](_0x39ec4d);}return _0x3a8d17[_0xe379('0x24')]();};}function saveUpdates(_0x2e946f,_0x32f43e){return function(_0x10b3c3){if(_0x10b3c3){return _0x10b3c3['update'](_0x2e946f)[_0xe379('0x25')](function(_0x32e16e){return _0x32e16e;});}return null;};}function removeEntity(_0x21e31b,_0x48b543){return function(_0x38236b){if(_0x38236b){return _0x38236b[_0xe379('0x26')]()['then'](function(){_0x21e31b[_0xe379('0x1b')](0xcc)[_0xe379('0x1c')]();});}};}function handleEntityNotFound(_0x4da256,_0x544bf3){return function(_0x22f596){if(!_0x22f596){_0x4da256[_0xe379('0x1a')](0x194);}return _0x22f596;};}function handleError(_0x26ba82,_0x4aa041){_0x4aa041=_0x4aa041||0x1f4;return function(_0x17ba51){logger[_0xe379('0x27')](_0x17ba51[_0xe379('0x28')]);if(_0x17ba51[_0xe379('0x29')]){delete _0x17ba51['name'];}_0x26ba82[_0xe379('0x1b')](_0x4aa041)[_0xe379('0x2a')](_0x17ba51);};}exports[_0xe379('0x2b')]=function(_0x50b0aa,_0x33037d){var _0x120239={'raw':!![],'where':{'id':_0x50b0aa[_0xe379('0x2c')]['id']}},_0x5d9ca1={};_0x5d9ca1['model']=_[_0xe379('0x2d')](db['ChatProactiveAction'][_0xe379('0x2e')]);_0x5d9ca1[_0xe379('0x2f')]=_[_0xe379('0x2d')](_0x50b0aa[_0xe379('0x2f')]);_0x5d9ca1[_0xe379('0x30')]=_[_0xe379('0x31')](_0x5d9ca1[_0xe379('0x32')],_0x5d9ca1['query']);_0x120239[_0xe379('0x33')]=_[_0xe379('0x31')](_0x5d9ca1[_0xe379('0x32')],qs['fields'](_0x50b0aa[_0xe379('0x2f')]['fields']));_0x120239['attributes']=_0x120239[_0xe379('0x33')][_0xe379('0x34')]?_0x120239[_0xe379('0x33')]:_0x5d9ca1[_0xe379('0x32')];if(_0x50b0aa['query'][_0xe379('0x35')]){_0x120239[_0xe379('0x36')]=[{'all':!![]}];}_0x120239=_['merge']({},_0x120239,_0x50b0aa[_0xe379('0x37')]);return db[_0xe379('0x38')][_0xe379('0x39')](_0x120239)[_0xe379('0x25')](handleEntityNotFound(_0x33037d,null))['then'](respondWithResult(_0x33037d,null))[_0xe379('0x3a')](handleError(_0x33037d,null));};exports['create']=function(_0xdc957d,_0x38d971){return db[_0xe379('0x38')][_0xe379('0x3b')](_0xdc957d[_0xe379('0x3c')],{})['then'](respondWithResult(_0x38d971,0xc9))[_0xe379('0x3a')](handleError(_0x38d971,null));};exports['update']=function(_0x42e7ca,_0x199e28){if(_0x42e7ca[_0xe379('0x3c')]['id']){delete _0x42e7ca['body']['id'];}return db[_0xe379('0x38')][_0xe379('0x39')]({'where':{'id':_0x42e7ca[_0xe379('0x2c')]['id']}})[_0xe379('0x25')](handleEntityNotFound(_0x199e28,null))['then'](saveUpdates(_0x42e7ca[_0xe379('0x3c')],null))['then'](respondWithResult(_0x199e28,null))[_0xe379('0x3a')](handleError(_0x199e28,null));};exports[_0xe379('0x26')]=function(_0x44bfce,_0x12e67e){return db[_0xe379('0x38')][_0xe379('0x39')]({'where':{'id':_0x44bfce['params']['id']}})[_0xe379('0x25')](handleEntityNotFound(_0x12e67e,null))['then'](removeEntity(_0x12e67e,null))[_0xe379('0x3a')](handleError(_0x12e67e,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 2d03d58..5852181 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 _0xaa15=['./chatProactiveAction.attributes','define','ChatProactiveAction','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4f48b2,_0x39af74){var _0x58f40f=function(_0x2d6934){while(--_0x2d6934){_0x4f48b2['push'](_0x4f48b2['shift']());}};_0x58f40f(++_0x39af74);}(_0xaa15,0x107));var _0x5aa1=function(_0x14a72c,_0x3484f0){_0x14a72c=_0x14a72c-0x0;var _0x5de299=_0xaa15[_0x14a72c];return _0x5de299;};'use strict';var _=require(_0x5aa1('0x0'));var util=require('util');var logger=require(_0x5aa1('0x1'))('api');var moment=require(_0x5aa1('0x2'));var BPromise=require(_0x5aa1('0x3'));var rp=require(_0x5aa1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5aa1('0x5'));var config=require(_0x5aa1('0x6'));var attributes=require(_0x5aa1('0x7'));module['exports']=function(_0x2edb8a,_0x2a88d3){return _0x2edb8a[_0x5aa1('0x8')](_0x5aa1('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a5f=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x392bd3,_0x563eef){var _0x2b53d8=function(_0x2b372c){while(--_0x2b372c){_0x392bd3['push'](_0x392bd3['shift']());}};_0x2b53d8(++_0x563eef);}(_0x4a5f,0x13f));var _0xf4a5=function(_0x301075,_0x33b785){_0x301075=_0x301075-0x0;var _0x1a04c5=_0x4a5f[_0x301075];return _0x1a04c5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf4a5('0x0'))(_0xf4a5('0x1'));var moment=require(_0xf4a5('0x2'));var BPromise=require(_0xf4a5('0x3'));var rp=require(_0xf4a5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf4a5('0x5'));var config=require(_0xf4a5('0x6'));var attributes=require(_0xf4a5('0x7'));module[_0xf4a5('0x8')]=function(_0x264e5e,_0x1d9a92){return _0x264e5e[_0xf4a5('0x9')](_0xf4a5('0xa'),attributes,{'tableName':_0xf4a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 6603c6d..96c880c 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 _0x8972=['../../config/logger','rpc','../../config/environment','jayson/promise','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x533ef3,_0x42fc7c){var _0x25ceac=function(_0x462932){while(--_0x462932){_0x533ef3['push'](_0x533ef3['shift']());}};_0x25ceac(++_0x42fc7c);}(_0x8972,0x1aa));var _0x2897=function(_0x4ea5eb,_0x31360f){_0x4ea5eb=_0x4ea5eb-0x0;var _0xaf3912=_0x8972[_0x4ea5eb];return _0xaf3912;};'use strict';var _=require(_0x2897('0x0'));var util=require(_0x2897('0x1'));var moment=require(_0x2897('0x2'));var BPromise=require(_0x2897('0x3'));var rs=require(_0x2897('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2897('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2897('0x6'))(_0x2897('0x7'));var config=require(_0x2897('0x8'));var jayson=require(_0x2897('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x560c6e,_0x58058a,_0x522254){return new BPromise(function(_0x26190d,_0x2e847c){return client['request'](_0x560c6e,_0x522254)['then'](function(_0x56fd9e){logger[_0x2897('0xa')](_0x2897('0xb'),_0x58058a,_0x2897('0xc'));logger[_0x2897('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x58058a,_0x2897('0xc'),JSON[_0x2897('0xe')](_0x56fd9e));if(_0x56fd9e[_0x2897('0xf')]){if(_0x56fd9e['error']['code']===0x1f4){logger[_0x2897('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x58058a,_0x56fd9e[_0x2897('0xf')]['message']);return _0x2e847c(_0x56fd9e[_0x2897('0xf')][_0x2897('0x10')]);}logger['error'](_0x2897('0xb'),_0x58058a,_0x56fd9e[_0x2897('0xf')][_0x2897('0x10')]);return _0x26190d(_0x56fd9e[_0x2897('0xf')][_0x2897('0x10')]);}else{logger[_0x2897('0xa')](_0x2897('0xb'),_0x58058a,_0x2897('0xc'));_0x26190d(_0x56fd9e['result'][_0x2897('0x10')]);}})[_0x2897('0x11')](function(_0x1a34da){logger[_0x2897('0xf')](_0x2897('0xb'),_0x58058a,_0x1a34da);_0x2e847c(_0x1a34da);});});}
\ No newline at end of file
+var _0xf87d=['message','result','catch','lodash','util','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x428a3a,_0x387221){var _0x43a093=function(_0x8f9068){while(--_0x8f9068){_0x428a3a['push'](_0x428a3a['shift']());}};_0x43a093(++_0x387221);}(_0xf87d,0x8f));var _0xdf87=function(_0x194c1a,_0x33002c){_0x194c1a=_0x194c1a-0x0;var _0x4dc225=_0xf87d[_0x194c1a];return _0x4dc225;};'use strict';var _=require(_0xdf87('0x0'));var util=require(_0xdf87('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdf87('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf87('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdf87('0x4'));var config=require(_0xdf87('0x5'));var jayson=require(_0xdf87('0x6'));var client=jayson[_0xdf87('0x7')][_0xdf87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x580d8c,_0x2ec395,_0x24f815){return new BPromise(function(_0x439421,_0x4009c6){return client[_0xdf87('0x9')](_0x580d8c,_0x24f815)[_0xdf87('0xa')](function(_0x4d1f7f){logger[_0xdf87('0xb')](_0xdf87('0xc'),_0x2ec395,'request\x20sent');logger['debug'](_0xdf87('0xd'),_0x2ec395,_0xdf87('0xe'),JSON[_0xdf87('0xf')](_0x4d1f7f));if(_0x4d1f7f[_0xdf87('0x10')]){if(_0x4d1f7f[_0xdf87('0x10')]['code']===0x1f4){logger[_0xdf87('0x10')](_0xdf87('0xc'),_0x2ec395,_0x4d1f7f[_0xdf87('0x10')][_0xdf87('0x11')]);return _0x4009c6(_0x4d1f7f['error'][_0xdf87('0x11')]);}logger[_0xdf87('0x10')](_0xdf87('0xc'),_0x2ec395,_0x4d1f7f[_0xdf87('0x10')][_0xdf87('0x11')]);return _0x439421(_0x4d1f7f[_0xdf87('0x10')][_0xdf87('0x11')]);}else{logger[_0xdf87('0xb')](_0xdf87('0xc'),_0x2ec395,_0xdf87('0xe'));_0x439421(_0x4d1f7f[_0xdf87('0x12')][_0xdf87('0x11')]);}})[_0xdf87('0x13')](function(_0x3a8be1){logger[_0xdf87('0x10')](_0xdf87('0xc'),_0x2ec395,_0x3a8be1);_0x4009c6(_0x3a8be1);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 937900c..4f0808d 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 _0x6aa7=['/:id','show','post','isAuthenticated','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x9c4ce,_0x26dfad){var _0x550c42=function(_0x2f2bf5){while(--_0x2f2bf5){_0x9c4ce['push'](_0x9c4ce['shift']());}};_0x550c42(++_0x26dfad);}(_0x6aa7,0x178));var _0x76aa=function(_0x36a20d,_0x12281c){_0x36a20d=_0x36a20d-0x0;var _0x288a39=_0x6aa7[_0x36a20d];return _0x288a39;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0x76aa('0x8'),auth['isAuthenticated'](),controller[_0x76aa('0x9')]);router[_0x76aa('0xa')]('/',auth[_0x76aa('0xb')](),controller['create']);router[_0x76aa('0xc')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller['update']);router[_0x76aa('0xd')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller[_0x76aa('0xe')]);module[_0x76aa('0xf')]=router;
\ No newline at end of file
+var _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2eb2,0x19f));var _0x22eb=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x2eb2[_0x4d07cc];return _0x42de3b;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index e83f1ec..c761e9c 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 _0xcb7a=['INTEGER','rrmemory','exports','STRING','name'];(function(_0x3420e5,_0x67fec0){var _0x1e9141=function(_0x4babb2){while(--_0x4babb2){_0x3420e5['push'](_0x3420e5['shift']());}};_0x1e9141(++_0x67fec0);}(_0xcb7a,0xf2));var _0xacb7=function(_0x588fad,_0x424bb7){_0x588fad=_0x588fad-0x0;var _0x2ef8a8=_0xcb7a[_0x588fad];return _0x2ef8a8;};'use strict';var Sequelize=require('sequelize');module[_0xacb7('0x0')]={'name':{'type':Sequelize[_0xacb7('0x1')],'unique':_0xacb7('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xacb7('0x1')]},'timeout':{'type':Sequelize[_0xacb7('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xacb7('0x4'),'beepall','roundrobin')}};
\ No newline at end of file
+var _0x308d=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x1a56a5,_0x470d46){var _0x27a7c1=function(_0x25c805){while(--_0x25c805){_0x1a56a5['push'](_0x1a56a5['shift']());}};_0x27a7c1(++_0x470d46);}(_0x308d,0x93));var _0xd308=function(_0x58f044,_0x2a1862){_0x58f044=_0x58f044-0x0;var _0x3b3c69=_0x308d[_0x58f044];return _0x3b3c69;};'use strict';var Sequelize=require(_0xd308('0x0'));module[_0xd308('0x1')]={'name':{'type':Sequelize[_0xd308('0x2')],'unique':_0xd308('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd308('0x2')]},'timeout':{'type':Sequelize[_0xd308('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd308('0x5')](_0xd308('0x6'),'beepall',_0xd308('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 4b6aa3f..4d2bdb7 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 _0x6b3a=['push','sequelize','toString','QueryTypes','SELECT','every','includes','all','isEmpty','addAgents','omit','userChatQueue:save','removeAgents','userChatQueue:remove','order','getAgents','hasOwnProperty','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','destroy','ChatQueues','UserProfileResource','then','send','index','ChatQueue','rawAttributes','fieldName','type','getOptions','include','query','findAll','rows','model','keys','filters','attributes','intersection','fields','length','includeAll','merge','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','autoAssociation','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','getMembers','nolimit','sort','where','pick','ChatQueueId','filter','map','UserChatQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','addTeams','ids','online','voicePause','flatMap','transaction','each','findOrCreate','forEach','emit','removeTeams','Agents','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?'];(function(_0xd6a1c9,_0x203324){var _0x51ea29=function(_0x165a30){while(--_0x165a30){_0xd6a1c9['push'](_0xd6a1c9['shift']());}};_0x51ea29(++_0x203324);}(_0x6b3a,0x17c));var _0xa6b3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b3a[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xa6b3('0x0'));var util=require(_0xa6b3('0x1'));var _=require(_0xa6b3('0x2'));var squel=require(_0xa6b3('0x3'));var Redis=require(_0xa6b3('0x4'));var qs=require(_0xa6b3('0x5'));var logger=require('../../config/logger')(_0xa6b3('0x6'));var config=require(_0xa6b3('0x7'));var db=require(_0xa6b3('0x8'))['db'];config['redis']=_[_0xa6b3('0x9')](config[_0xa6b3('0xa')],{'host':_0xa6b3('0xb'),'port':0x18eb});var socket=require(_0xa6b3('0xc'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xa6b3('0xd')](socket);function respondWithStatusCode(_0x1d1ef8,_0x1d52a9){_0x1d52a9=_0x1d52a9||0xcc;return function(_0x43c67f){if(_0x43c67f){return _0x1d1ef8[_0xa6b3('0xe')](_0x1d52a9);}return _0x1d1ef8[_0xa6b3('0xf')](_0x1d52a9)[_0xa6b3('0x10')]();};}function respondWithResult(_0x4a6d8c,_0x498bd0){_0x498bd0=_0x498bd0||0xc8;return function(_0x1f8821){if(_0x1f8821){return _0x4a6d8c[_0xa6b3('0xf')](_0x498bd0)[_0xa6b3('0x11')](_0x1f8821);}};}function respondWithFilteredResult(_0x312b62,_0x4dd876){return function(_0x10da06){if(_0x10da06){var _0x20f073=typeof _0x4dd876[_0xa6b3('0x12')]==='undefined'&&typeof _0x4dd876[_0xa6b3('0x13')]===_0xa6b3('0x14');var _0x4413d2=_0x10da06[_0xa6b3('0x15')];var _0x1b37d1=_0x20f073?0x0:_0x4dd876['offset'];var _0x4067d9=_0x20f073?_0x10da06[_0xa6b3('0x15')]:_0x4dd876[_0xa6b3('0x12')]+_0x4dd876[_0xa6b3('0x13')];var _0x3efd35;if(_0x4067d9>=_0x4413d2){_0x4067d9=_0x4413d2;_0x3efd35=0xc8;}else{_0x3efd35=0xce;}_0x312b62[_0xa6b3('0xf')](_0x3efd35);return _0x312b62[_0xa6b3('0x16')](_0xa6b3('0x17'),_0x1b37d1+'-'+_0x4067d9+'/'+_0x4413d2)[_0xa6b3('0x11')](_0x10da06);}return null;};}function saveUpdates(_0x105d01){return function(_0x31bcfd){if(_0x31bcfd){return _0x31bcfd['update'](_0x105d01)['then'](function(_0x1f16cf){return _0x1f16cf;});}return null;};}function removeEntity(_0x42b933){return function(_0x42d924){if(_0x42d924){return _0x42d924[_0xa6b3('0x18')]()['then'](function(){var _0x57f680=_0x42d924['get']({'plain':!![]});var _0x3599eb=_0xa6b3('0x19');return db[_0xa6b3('0x1a')][_0xa6b3('0x18')]({'where':{'type':_0x3599eb,'resourceId':_0x57f680['id']}})[_0xa6b3('0x1b')](function(){return _0x42d924;});})[_0xa6b3('0x1b')](function(){_0x42b933[_0xa6b3('0xf')](0xcc)[_0xa6b3('0x10')]();});}};}function handleEntityNotFound(_0x5234b7){return function(_0x4ce018){if(!_0x4ce018){_0x5234b7[_0xa6b3('0xe')](0x194);}return _0x4ce018;};}function handleError(_0x2388eb,_0x22161b){_0x22161b=_0x22161b||0x1f4;return function(_0x158e02){logger['error'](_0x158e02['stack']);if(_0x158e02['name']){delete _0x158e02['name'];}_0x2388eb[_0xa6b3('0xf')](_0x22161b)[_0xa6b3('0x1c')](_0x158e02);};}exports[_0xa6b3('0x1d')]=function(_0x15e88f,_0xaa7f39){var _0x8e4f6c={};var _0x110565={'count':0x0,'rows':[]};var _0x56dfd3=_['map'](db[_0xa6b3('0x1e')][_0xa6b3('0x1f')],function(_0xca6802){return{'name':_0xca6802[_0xa6b3('0x20')],'type':_0xca6802[_0xa6b3('0x21')]['key']};});_0x8e4f6c=qs[_0xa6b3('0x22')](_0x56dfd3,_0x15e88f);var _0x109c28={'where':_0x8e4f6c['where']};return db[_0xa6b3('0x1e')][_0xa6b3('0x15')](_0x109c28)['then'](function(_0x2e4861){_0x110565[_0xa6b3('0x15')]=_0x2e4861;_0x8e4f6c[_0xa6b3('0x23')]=qs[_0xa6b3('0x23')](_0x15e88f[_0xa6b3('0x24')]);return db['ChatQueue'][_0xa6b3('0x25')](_0x8e4f6c);})[_0xa6b3('0x1b')](function(_0x1a8914){_0x110565[_0xa6b3('0x26')]=_0x1a8914;return _0x110565;})[_0xa6b3('0x1b')](respondWithFilteredResult(_0xaa7f39,_0x8e4f6c))['catch'](handleError(_0xaa7f39,null));};exports['show']=function(_0x4c001b,_0x5eee57){var _0x1762cc={'raw':!![],'where':{'id':_0x4c001b['params']['id']}},_0x60b1e6={};_0x60b1e6[_0xa6b3('0x27')]=_[_0xa6b3('0x28')](db['ChatQueue']['rawAttributes']);_0x60b1e6[_0xa6b3('0x24')]=_[_0xa6b3('0x28')](_0x4c001b[_0xa6b3('0x24')]);_0x60b1e6[_0xa6b3('0x29')]=_['intersection'](_0x60b1e6[_0xa6b3('0x27')],_0x60b1e6['query']);_0x1762cc[_0xa6b3('0x2a')]=_[_0xa6b3('0x2b')](_0x60b1e6[_0xa6b3('0x27')],qs[_0xa6b3('0x2c')](_0x4c001b[_0xa6b3('0x24')][_0xa6b3('0x2c')]));_0x1762cc[_0xa6b3('0x2a')]=_0x1762cc[_0xa6b3('0x2a')][_0xa6b3('0x2d')]?_0x1762cc[_0xa6b3('0x2a')]:_0x60b1e6[_0xa6b3('0x27')];if(_0x4c001b[_0xa6b3('0x24')][_0xa6b3('0x2e')]){_0x1762cc['include']=[{'all':!![]}];}_0x1762cc=_[_0xa6b3('0x2f')]({},_0x1762cc,_0x4c001b[_0xa6b3('0x30')]);return db[_0xa6b3('0x1e')][_0xa6b3('0x31')](_0x1762cc)[_0xa6b3('0x1b')](handleEntityNotFound(_0x5eee57,null))[_0xa6b3('0x1b')](respondWithResult(_0x5eee57,null))[_0xa6b3('0x32')](handleError(_0x5eee57,null));};exports['create']=function(_0x38dd49,_0x1a41d3){return db[_0xa6b3('0x1e')][_0xa6b3('0x33')](_0x38dd49['body'],{})[_0xa6b3('0x1b')](function(_0x169519){var _0x4a090a=_0x38dd49[_0xa6b3('0x34')]['get']({'plain':!![]});if(!_0x4a090a)throw new Error(_0xa6b3('0x35'));if(_0x4a090a['role']===_0xa6b3('0x34')){var _0x2265c1=_0x169519[_0xa6b3('0x36')]({'plain':!![]});var _0x4a9ce4=_0xa6b3('0x19');return db['UserProfileSection'][_0xa6b3('0x31')]({'where':{'name':_0x4a9ce4,'userProfileId':_0x4a090a['userProfileId']},'raw':!![]})['then'](function(_0x3d9c43){if(_0x3d9c43&&_0x3d9c43[_0xa6b3('0x37')]===0x0){return db[_0xa6b3('0x1a')][_0xa6b3('0x33')]({'name':_0x2265c1[_0xa6b3('0x38')],'resourceId':_0x2265c1['id'],'type':_0x3d9c43[_0xa6b3('0x38')],'sectionId':_0x3d9c43['id']},{})[_0xa6b3('0x1b')](function(){return _0x169519;});}else{return _0x169519;}})[_0xa6b3('0x32')](function(_0x12b01d){logger[_0xa6b3('0x39')](_0xa6b3('0x3a'),_0x12b01d);throw _0x12b01d;});}return _0x169519;})[_0xa6b3('0x1b')](respondWithResult(_0x1a41d3,0xc9))[_0xa6b3('0x32')](handleError(_0x1a41d3,null));};exports[_0xa6b3('0x3b')]=function(_0x4265e9,_0xe421a4){if(_0x4265e9[_0xa6b3('0x3c')]['id']){delete _0x4265e9['body']['id'];}return db[_0xa6b3('0x1e')][_0xa6b3('0x31')]({'where':{'id':_0x4265e9[_0xa6b3('0x3d')]['id']}})[_0xa6b3('0x1b')](handleEntityNotFound(_0xe421a4,null))[_0xa6b3('0x1b')](saveUpdates(_0x4265e9[_0xa6b3('0x3c')],null))[_0xa6b3('0x1b')](respondWithResult(_0xe421a4,null))['catch'](handleError(_0xe421a4,null));};exports['destroy']=function(_0x397b3d,_0x59b450){return db[_0xa6b3('0x1e')][_0xa6b3('0x31')]({'where':{'id':_0x397b3d[_0xa6b3('0x3d')]['id']}})[_0xa6b3('0x1b')](handleEntityNotFound(_0x59b450,null))[_0xa6b3('0x1b')](removeEntity(_0x59b450,null))[_0xa6b3('0x32')](handleError(_0x59b450,null));};exports[_0xa6b3('0x3e')]=function(_0xd0957a,_0xe71e15){return db['ChatQueue'][_0xa6b3('0x3e')]()['then'](respondWithResult(_0xe71e15,null))[_0xa6b3('0x32')](handleError(_0xe71e15,null));};exports[_0xa6b3('0x3f')]=function(_0x328207,_0x255886){var _0x2161ca={'raw':!![],'where':{}},_0x18df8e={},_0x5c7394;return db['ChatQueue']['findOne']({'where':{'id':_0x328207[_0xa6b3('0x3d')]['id']}})['then'](handleEntityNotFound(_0x255886,null))['then'](function(_0x37e28b){if(_0x37e28b){_0x5c7394=_0x37e28b['get']({'plain':!![]});_0x18df8e[_0xa6b3('0x27')]=_[_0xa6b3('0x28')](db['UserChatQueue'][_0xa6b3('0x1f')]);_0x18df8e[_0xa6b3('0x24')]=_[_0xa6b3('0x28')](_0x328207[_0xa6b3('0x24')]);_0x18df8e[_0xa6b3('0x29')]=_[_0xa6b3('0x2b')](_0x18df8e['model'],_0x18df8e['query']);_0x2161ca[_0xa6b3('0x2a')]=_[_0xa6b3('0x2b')](_0x18df8e[_0xa6b3('0x27')],qs[_0xa6b3('0x2c')](_0x328207['query']['fields']));_0x2161ca[_0xa6b3('0x2a')]=_0x2161ca['attributes'][_0xa6b3('0x2d')]?_0x2161ca[_0xa6b3('0x2a')]:_0x18df8e[_0xa6b3('0x27')];if(!_0x328207[_0xa6b3('0x24')]['hasOwnProperty'](_0xa6b3('0x40'))){_0x2161ca[_0xa6b3('0x13')]=qs[_0xa6b3('0x13')](_0x328207[_0xa6b3('0x24')]['limit']);_0x2161ca[_0xa6b3('0x12')]=qs[_0xa6b3('0x12')](_0x328207[_0xa6b3('0x24')][_0xa6b3('0x12')]);}_0x2161ca['order']=qs[_0xa6b3('0x41')](_0x328207['query'][_0xa6b3('0x41')]);_0x2161ca[_0xa6b3('0x42')]=qs[_0xa6b3('0x29')](_[_0xa6b3('0x43')](_0x328207[_0xa6b3('0x24')],_0x18df8e['filters']));_0x2161ca['where'][_0xa6b3('0x44')]=_0x37e28b['id'];if(_0x328207[_0xa6b3('0x24')][_0xa6b3('0x45')]){_0x2161ca[_0xa6b3('0x42')]=_[_0xa6b3('0x2f')](_0x2161ca[_0xa6b3('0x42')],{'$or':_[_0xa6b3('0x46')](_0x2161ca[_0xa6b3('0x2a')],function(_0x596647){var _0x3b213d={};_0x3b213d[_0x596647]={'$like':'%'+_0x328207['query'][_0xa6b3('0x45')]+'%'};return _0x3b213d;})});}_0x2161ca=_[_0xa6b3('0x2f')]({},_0x2161ca,_0x328207[_0xa6b3('0x30')]);return db[_0xa6b3('0x47')]['findAll'](_0x2161ca);}})[_0xa6b3('0x1b')](function(_0x5ae544){if(_0x5ae544){return db[_0xa6b3('0x48')][_0xa6b3('0x49')]({'where':{'id':_[_0xa6b3('0x46')](_0x5ae544,_0xa6b3('0x4a')),'role':_0xa6b3('0x4b')},'attributes':['id',_0xa6b3('0x38'),'chatPause',_0xa6b3('0x4c'),_0xa6b3('0x4d')]});}})[_0xa6b3('0x1b')](function(_0x379847){if(_0x379847){return{'count':_0x379847[_0xa6b3('0x15')],'rows':_[_0xa6b3('0x46')](_0x379847[_0xa6b3('0x26')],function(_0x379932){return{'membername':_0x379932[_0xa6b3('0x38')],'UserId':_0x379932['id'],'queue_name':_0x5c7394[_0xa6b3('0x38')],'ChatQueueId':_0x5c7394['id'],'interface':util[_0xa6b3('0x4e')](_0xa6b3('0x4f'),'SIP',_0x379932['name']),'penalty':0x0,'paused':_0x379932['chatPause'],'createdAt':_0x379932[_0xa6b3('0x4d')],'updatedAt':_0x379932['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa6b3('0x1b')](respondWithFilteredResult(_0x255886,_0x2161ca))[_0xa6b3('0x32')](handleError(_0x255886,null));};exports[_0xa6b3('0x50')]=function(_0x183023,_0x5acf69){var _0xcb35e7={};var _0x5e8e5c={};var _0x419cac;var _0x99608;return db[_0xa6b3('0x1e')][_0xa6b3('0x51')]({'where':{'id':_0x183023['params']['id']}})[_0xa6b3('0x1b')](handleEntityNotFound(_0x5acf69,null))[_0xa6b3('0x1b')](function(_0x126ad1){if(_0x126ad1){_0x419cac=_0x126ad1;_0x5e8e5c[_0xa6b3('0x27')]=_['keys'](db[_0xa6b3('0x52')][_0xa6b3('0x1f')]);_0x5e8e5c[_0xa6b3('0x24')]=_['keys'](_0x183023[_0xa6b3('0x24')]);_0x5e8e5c[_0xa6b3('0x29')]=_[_0xa6b3('0x2b')](_0x5e8e5c[_0xa6b3('0x27')],_0x5e8e5c[_0xa6b3('0x24')]);_0xcb35e7[_0xa6b3('0x2a')]=_['intersection'](_0x5e8e5c[_0xa6b3('0x27')],qs[_0xa6b3('0x2c')](_0x183023[_0xa6b3('0x24')][_0xa6b3('0x2c')]));_0xcb35e7[_0xa6b3('0x2a')]=_0xcb35e7[_0xa6b3('0x2a')][_0xa6b3('0x2d')]?_0xcb35e7['attributes']:_0x5e8e5c[_0xa6b3('0x27')];_0xcb35e7['order']=qs[_0xa6b3('0x41')](_0x183023[_0xa6b3('0x24')][_0xa6b3('0x41')]);_0xcb35e7['where']=qs[_0xa6b3('0x29')](_['pick'](_0x183023['query'],_0x5e8e5c[_0xa6b3('0x29')]));if(_0x183023[_0xa6b3('0x24')]['filter']){_0xcb35e7[_0xa6b3('0x42')]=_[_0xa6b3('0x2f')](_0xcb35e7[_0xa6b3('0x42')],{'$or':_['map'](_0xcb35e7[_0xa6b3('0x2a')],function(_0x4fe33a){var _0x486234={};_0x486234[_0x4fe33a]={'$like':'%'+_0x183023[_0xa6b3('0x24')]['filter']+'%'};return _0x486234;})});}_0xcb35e7=_[_0xa6b3('0x2f')]({},_0xcb35e7,_0x183023[_0xa6b3('0x30')]);return _0x419cac[_0xa6b3('0x50')](_0xcb35e7);}})[_0xa6b3('0x1b')](function(_0x5fd978){if(_0x5fd978){_0x99608=_0x5fd978[_0xa6b3('0x2d')];if(!_0x183023[_0xa6b3('0x24')]['hasOwnProperty'](_0xa6b3('0x40'))){_0xcb35e7['limit']=qs['limit'](_0x183023[_0xa6b3('0x24')][_0xa6b3('0x13')]);_0xcb35e7[_0xa6b3('0x12')]=qs['offset'](_0x183023['query'][_0xa6b3('0x12')]);}return _0x419cac[_0xa6b3('0x50')](_0xcb35e7);}})[_0xa6b3('0x1b')](function(_0x4b0394){if(_0x4b0394){return _0x4b0394?{'count':_0x99608,'rows':_0x4b0394}:null;}})[_0xa6b3('0x1b')](respondWithResult(_0x5acf69,null))[_0xa6b3('0x32')](handleError(_0x5acf69,null));};exports[_0xa6b3('0x53')]=function(_0x20e4c5,_0x2a410b){var _0x2a89b9=_0x20e4c5[_0xa6b3('0x3c')][_0xa6b3('0x54')];return db[_0xa6b3('0x52')]['findAll']({'where':{'id':_0x2a89b9},'attributes':['id'],'include':[{'model':db[_0xa6b3('0x48')],'as':'Agents','attributes':['id','name',_0xa6b3('0x55'),_0xa6b3('0x56'),'interface'],'raw':!![]}]})['then'](function(_0x5520c1){if(_0x5520c1){var _0x344ea0=_[_0xa6b3('0x57')](_0x5520c1,function(_0x446542){var _0x5d7a03=_0x446542[_0xa6b3('0x36')]({'plain':!![]});return _0x5d7a03['Agents'];});return db[_0xa6b3('0x1e')][_0xa6b3('0x31')]({'where':{'id':_0x20e4c5[_0xa6b3('0x3d')]['id']}})[_0xa6b3('0x1b')](function(_0x36fdb4){return db['sequelize'][_0xa6b3('0x58')](function(_0x1db2d3){return _0x36fdb4['addTeams'](_0x2a89b9,{'transaction':_0x1db2d3})[_0xa6b3('0x1b')](function(){return BPromise[_0xa6b3('0x59')](_0x344ea0,function(_0x596b24){return db[_0xa6b3('0x47')][_0xa6b3('0x5a')]({'where':{'UserId':_0x596b24['id'],'ChatQueueId':_0x20e4c5[_0xa6b3('0x3d')]['id']},'transaction':_0x1db2d3});});})['then'](function(){_0x344ea0[_0xa6b3('0x5b')](function(_0x5c1ae4){socket[_0xa6b3('0x5c')]('userChatQueue:save',{'UserId':_0x5c1ae4['id'],'ChatQueueId':_0x36fdb4['id']});});});});});}})[_0xa6b3('0x1b')](respondWithStatusCode(_0x2a410b,null))[_0xa6b3('0x32')](handleError(_0x2a410b,null));};exports[_0xa6b3('0x5d')]=function(_0x15f836,_0x591e86){return db[_0xa6b3('0x52')]['findAll']({'where':{'id':_0x15f836[_0xa6b3('0x24')][_0xa6b3('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa6b3('0x5e'),'attributes':['id'],'raw':!![]}]})[_0xa6b3('0x1b')](handleEntityNotFound(_0x591e86,null))[_0xa6b3('0x1b')](function(_0x3929ce){var _0x5ebd47=_[_0xa6b3('0x46')](_0x3929ce,'id');var _0x42998f=[];var _0x4a71d9=[];var _0x5e31b5=squel[_0xa6b3('0x5f')]();_0x5e31b5[_0xa6b3('0x60')](_0xa6b3('0x61'))[_0xa6b3('0x62')](_0xa6b3('0x63'),'tq')[_0xa6b3('0x64')](_0xa6b3('0x65'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xa6b3('0x66'),_0x15f836[_0xa6b3('0x3d')]['id']);for(var _0xae2e18=0x0;_0xae2e18<_0x3929ce[_0xa6b3('0x2d')];_0xae2e18+=0x1){let _0x347418=_0x3929ce[_0xae2e18];for(var _0x1ed755=0x0;_0x1ed755<_0x347418[_0xa6b3('0x5e')][_0xa6b3('0x2d')];_0x1ed755+=0x1){let _0x2e5e56=_0x347418[_0xa6b3('0x5e')][_0x1ed755];var _0x49dd5f=_0x5e31b5['clone']();_0x49dd5f[_0xa6b3('0x42')](_0xa6b3('0x67'),_0x2e5e56['id']);_0x4a71d9[_0xa6b3('0x68')](db[_0xa6b3('0x69')][_0xa6b3('0x24')](_0x49dd5f[_0xa6b3('0x6a')](),{'type':db[_0xa6b3('0x69')][_0xa6b3('0x6b')][_0xa6b3('0x6c')]})[_0xa6b3('0x1b')](function(_0x2b99a9){if(_0x2b99a9[_0xa6b3('0x2d')]===0x1){return _0x2e5e56['id'];}else{var _0x3e931f=_[_0xa6b3('0x6d')](_[_0xa6b3('0x46')](_0x2b99a9,'TeamId'),function(_0x18b9c1){return _[_0xa6b3('0x6e')](_0x5ebd47,_0x18b9c1);});if(_0x3e931f){return _0x2e5e56['id'];}}}));}}return BPromise[_0xa6b3('0x6f')](_0x4a71d9)[_0xa6b3('0x1b')](function(_0x48dd84){_0x42998f=_(_0x42998f)['union'](_0x48dd84)['compact']()['value']();return db['ChatQueue'][_0xa6b3('0x31')]({'where':{'id':_0x15f836[_0xa6b3('0x3d')]['id']}})[_0xa6b3('0x1b')](function(_0x20dff5){return db[_0xa6b3('0x69')][_0xa6b3('0x58')](function(_0x8c02e8){return _0x20dff5[_0xa6b3('0x5d')](_0x15f836[_0xa6b3('0x24')]['ids'],{'transaction':_0x8c02e8})['then'](function(){if(!_[_0xa6b3('0x70')](_0x42998f)){return _0x20dff5['removeAgents'](_0x42998f,{'transaction':_0x8c02e8});}})['then'](function(){_0x42998f[_0xa6b3('0x5b')](function(_0x1bb730){socket[_0xa6b3('0x5c')]('userChatQueue:remove',{'UserId':_0x1bb730,'ChatQueueId':_0x20dff5['id']});});});});});});})['then'](respondWithStatusCode(_0x591e86,null))['catch'](handleError(_0x591e86,null));};exports[_0xa6b3('0x71')]=function(_0x3f26c1,_0x3dad4d){return db['ChatQueue']['find']({'where':{'id':_0x3f26c1['params']['id']}})[_0xa6b3('0x1b')](handleEntityNotFound(_0x3dad4d,null))[_0xa6b3('0x1b')](function(_0x1e4c3b){if(_0x1e4c3b){return _0x1e4c3b['addAgents'](_0x3f26c1[_0xa6b3('0x3c')][_0xa6b3('0x54')],_[_0xa6b3('0x72')](_0x3f26c1[_0xa6b3('0x3c')],[_0xa6b3('0x54'),'id'])||{})['spread'](function(_0x5cdda4){for(var _0x30f63d=0x0;_0x30f63d<_0x3f26c1[_0xa6b3('0x3c')][_0xa6b3('0x54')][_0xa6b3('0x2d')];_0x30f63d+=0x1){socket['emit'](_0xa6b3('0x73'),{'UserId':Number(_0x3f26c1[_0xa6b3('0x3c')][_0xa6b3('0x54')][_0x30f63d]),'ChatQueueId':Number(_0x3f26c1['params']['id'])});}return _0x5cdda4;});}})[_0xa6b3('0x1b')](respondWithResult(_0x3dad4d,null))[_0xa6b3('0x32')](handleError(_0x3dad4d,null));};exports[_0xa6b3('0x74')]=function(_0x235e8e,_0x388751){return db[_0xa6b3('0x1e')]['find']({'where':{'id':_0x235e8e[_0xa6b3('0x3d')]['id']}})[_0xa6b3('0x1b')](handleEntityNotFound(_0x388751,null))['then'](function(_0x25d3b0){if(_0x25d3b0){return _0x25d3b0[_0xa6b3('0x74')](_0x235e8e['query']['ids'])[_0xa6b3('0x1b')](function(){if(_['isArray'](_0x235e8e[_0xa6b3('0x24')][_0xa6b3('0x54')])){for(var _0x1bfc4a=0x0;_0x1bfc4a<_0x235e8e[_0xa6b3('0x24')][_0xa6b3('0x54')]['length'];_0x1bfc4a+=0x1){socket[_0xa6b3('0x5c')](_0xa6b3('0x75'),{'UserId':Number(_0x235e8e[_0xa6b3('0x24')][_0xa6b3('0x54')][_0x1bfc4a]),'ChatQueueId':Number(_0x235e8e[_0xa6b3('0x3d')]['id'])});}}else{socket[_0xa6b3('0x5c')](_0xa6b3('0x75'),{'UserId':Number(_0x235e8e[_0xa6b3('0x24')]['ids']),'ChatQueueId':Number(_0x235e8e[_0xa6b3('0x3d')]['id'])});}});}})[_0xa6b3('0x1b')](respondWithStatusCode(_0x388751,null))[_0xa6b3('0x32')](handleError(_0x388751,null));};exports['getAgents']=function(_0x5402cc,_0x35d4fd){var _0x1d8f65={};var _0x512229={};var _0x56519a;var _0x10d3df;return db[_0xa6b3('0x1e')][_0xa6b3('0x51')]({'where':{'id':_0x5402cc[_0xa6b3('0x3d')]['id']}})[_0xa6b3('0x1b')](handleEntityNotFound(_0x35d4fd,null))[_0xa6b3('0x1b')](function(_0x40c2f8){if(_0x40c2f8){_0x56519a=_0x40c2f8;_0x512229['model']=_[_0xa6b3('0x28')](db[_0xa6b3('0x48')][_0xa6b3('0x1f')]);_0x512229[_0xa6b3('0x24')]=_[_0xa6b3('0x28')](_0x5402cc['query']);_0x512229['filters']=_[_0xa6b3('0x2b')](_0x512229[_0xa6b3('0x27')],_0x512229['query']);_0x1d8f65[_0xa6b3('0x2a')]=_[_0xa6b3('0x2b')](_0x512229[_0xa6b3('0x27')],qs[_0xa6b3('0x2c')](_0x5402cc['query'][_0xa6b3('0x2c')]));_0x1d8f65['attributes']=_0x1d8f65[_0xa6b3('0x2a')]['length']?_0x1d8f65[_0xa6b3('0x2a')]:_0x512229[_0xa6b3('0x27')];_0x1d8f65[_0xa6b3('0x76')]=qs[_0xa6b3('0x41')](_0x5402cc[_0xa6b3('0x24')][_0xa6b3('0x41')]);_0x1d8f65[_0xa6b3('0x42')]=qs[_0xa6b3('0x29')](_[_0xa6b3('0x43')](_0x5402cc[_0xa6b3('0x24')],_0x512229[_0xa6b3('0x29')]));if(_0x5402cc[_0xa6b3('0x24')][_0xa6b3('0x45')]){_0x1d8f65[_0xa6b3('0x42')]=_[_0xa6b3('0x2f')](_0x1d8f65['where'],{'$or':_[_0xa6b3('0x46')](_0x1d8f65[_0xa6b3('0x2a')],function(_0x4cb711){var _0x5829c9={};_0x5829c9[_0x4cb711]={'$like':'%'+_0x5402cc['query'][_0xa6b3('0x45')]+'%'};return _0x5829c9;})});}_0x1d8f65=_[_0xa6b3('0x2f')]({},_0x1d8f65,_0x5402cc[_0xa6b3('0x30')]);return _0x56519a[_0xa6b3('0x77')](_0x1d8f65);}})[_0xa6b3('0x1b')](function(_0x2dbd69){if(_0x2dbd69){_0x10d3df=_0x2dbd69[_0xa6b3('0x2d')];if(!_0x5402cc[_0xa6b3('0x24')][_0xa6b3('0x78')](_0xa6b3('0x40'))){_0x1d8f65[_0xa6b3('0x13')]=qs[_0xa6b3('0x13')](_0x5402cc[_0xa6b3('0x24')]['limit']);_0x1d8f65['offset']=qs['offset'](_0x5402cc['query']['offset']);}return _0x56519a[_0xa6b3('0x77')](_0x1d8f65);}})[_0xa6b3('0x1b')](function(_0x25cb41){if(_0x25cb41){return _0x25cb41?{'count':_0x10d3df,'rows':_0x25cb41}:null;}})[_0xa6b3('0x1b')](respondWithResult(_0x35d4fd,null))[_0xa6b3('0x32')](handleError(_0x35d4fd,null));};
\ No newline at end of file
+var _0x9572=['UserChatQueue','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','options','findAll','UserId','chatPause','updatedAt','createdAt','rows','format','SIP','getTeams','ids','Team','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','update','then','get','ChatQueues','UserProfileResource','end','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','where','include','catch','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','findOne'];(function(_0x5698a9,_0x4ae7c7){var _0x3be696=function(_0x396896){while(--_0x396896){_0x5698a9['push'](_0x5698a9['shift']());}};_0x3be696(++_0x4ae7c7);}(_0x9572,0x135));var _0x2957=function(_0x476ad7,_0xcbc856){_0x476ad7=_0x476ad7-0x0;var _0xf09e30=_0x9572[_0x476ad7];return _0xf09e30;};'use strict';var BPromise=require(_0x2957('0x0'));var util=require(_0x2957('0x1'));var _=require('lodash');var squel=require(_0x2957('0x2'));var Redis=require(_0x2957('0x3'));var qs=require(_0x2957('0x4'));var logger=require('../../config/logger')(_0x2957('0x5'));var config=require(_0x2957('0x6'));var db=require(_0x2957('0x7'))['db'];config[_0x2957('0x8')]=_['defaults'](config[_0x2957('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x2957('0x9'))(new Redis(config['redis']));require(_0x2957('0xa'))['register'](socket);function respondWithStatusCode(_0xa0a0dd,_0x585f47){_0x585f47=_0x585f47||0xcc;return function(_0x7d92b2){if(_0x7d92b2){return _0xa0a0dd[_0x2957('0xb')](_0x585f47);}return _0xa0a0dd[_0x2957('0xc')](_0x585f47)['end']();};}function respondWithResult(_0x3ea8e1,_0x14c4a0){_0x14c4a0=_0x14c4a0||0xc8;return function(_0x17bd86){if(_0x17bd86){return _0x3ea8e1['status'](_0x14c4a0)[_0x2957('0xd')](_0x17bd86);}};}function respondWithFilteredResult(_0x33b746,_0x26a264){return function(_0x2233a3){if(_0x2233a3){var _0x40338c=typeof _0x26a264[_0x2957('0xe')]===_0x2957('0xf')&&typeof _0x26a264[_0x2957('0x10')]===_0x2957('0xf');var _0x7c03c4=_0x2233a3[_0x2957('0x11')];var _0x36321a=_0x40338c?0x0:_0x26a264[_0x2957('0xe')];var _0x585ccf=_0x40338c?_0x2233a3[_0x2957('0x11')]:_0x26a264[_0x2957('0xe')]+_0x26a264[_0x2957('0x10')];var _0x32f65a;if(_0x585ccf>=_0x7c03c4){_0x585ccf=_0x7c03c4;_0x32f65a=0xc8;}else{_0x32f65a=0xce;}_0x33b746['status'](_0x32f65a);return _0x33b746[_0x2957('0x12')]('Content-Range',_0x36321a+'-'+_0x585ccf+'/'+_0x7c03c4)[_0x2957('0xd')](_0x2233a3);}return null;};}function saveUpdates(_0x9e7024){return function(_0x4c0c8a){if(_0x4c0c8a){return _0x4c0c8a[_0x2957('0x13')](_0x9e7024)[_0x2957('0x14')](function(_0x5a11d8){return _0x5a11d8;});}return null;};}function removeEntity(_0xda9068){return function(_0x36299a){if(_0x36299a){return _0x36299a['destroy']()[_0x2957('0x14')](function(){var _0x1cdbc0=_0x36299a[_0x2957('0x15')]({'plain':!![]});var _0x503a8e=_0x2957('0x16');return db[_0x2957('0x17')]['destroy']({'where':{'type':_0x503a8e,'resourceId':_0x1cdbc0['id']}})[_0x2957('0x14')](function(){return _0x36299a;});})['then'](function(){_0xda9068[_0x2957('0xc')](0xcc)[_0x2957('0x18')]();});}};}function handleEntityNotFound(_0x24efa6){return function(_0xcfd76c){if(!_0xcfd76c){_0x24efa6[_0x2957('0xb')](0x194);}return _0xcfd76c;};}function handleError(_0x385660,_0x1e44f8){_0x1e44f8=_0x1e44f8||0x1f4;return function(_0x519f12){logger[_0x2957('0x19')](_0x519f12[_0x2957('0x1a')]);if(_0x519f12[_0x2957('0x1b')]){delete _0x519f12['name'];}_0x385660['status'](_0x1e44f8)[_0x2957('0x1c')](_0x519f12);};}exports[_0x2957('0x1d')]=function(_0x20eb5a,_0x45e84e){var _0x67d53e={};var _0x2ff8a={'count':0x0,'rows':[]};var _0x543296=_[_0x2957('0x1e')](db[_0x2957('0x1f')][_0x2957('0x20')],function(_0x5aaf64){return{'name':_0x5aaf64[_0x2957('0x21')],'type':_0x5aaf64[_0x2957('0x22')]['key']};});_0x67d53e=qs['getOptions'](_0x543296,_0x20eb5a);var _0x1dac2b={'where':_0x67d53e[_0x2957('0x23')]};return db['ChatQueue']['count'](_0x1dac2b)[_0x2957('0x14')](function(_0x23c3ec){_0x2ff8a[_0x2957('0x11')]=_0x23c3ec;_0x67d53e['include']=qs[_0x2957('0x24')](_0x20eb5a['query']);return db[_0x2957('0x1f')]['findAll'](_0x67d53e);})[_0x2957('0x14')](function(_0x12b938){_0x2ff8a['rows']=_0x12b938;return _0x2ff8a;})[_0x2957('0x14')](respondWithFilteredResult(_0x45e84e,_0x67d53e))[_0x2957('0x25')](handleError(_0x45e84e,null));};exports[_0x2957('0x26')]=function(_0x4c658e,_0x3d8b66){var _0x559253={'raw':!![],'where':{'id':_0x4c658e[_0x2957('0x27')]['id']}},_0x27726f={};_0x27726f[_0x2957('0x28')]=_[_0x2957('0x29')](db[_0x2957('0x1f')]['rawAttributes']);_0x27726f['query']=_['keys'](_0x4c658e[_0x2957('0x2a')]);_0x27726f[_0x2957('0x2b')]=_[_0x2957('0x2c')](_0x27726f[_0x2957('0x28')],_0x27726f[_0x2957('0x2a')]);_0x559253[_0x2957('0x2d')]=_['intersection'](_0x27726f[_0x2957('0x28')],qs['fields'](_0x4c658e['query'][_0x2957('0x2e')]));_0x559253['attributes']=_0x559253[_0x2957('0x2d')][_0x2957('0x2f')]?_0x559253[_0x2957('0x2d')]:_0x27726f[_0x2957('0x28')];if(_0x4c658e['query'][_0x2957('0x30')]){_0x559253[_0x2957('0x24')]=[{'all':!![]}];}_0x559253=_[_0x2957('0x31')]({},_0x559253,_0x4c658e['options']);return db[_0x2957('0x1f')][_0x2957('0x32')](_0x559253)[_0x2957('0x14')](handleEntityNotFound(_0x3d8b66,null))[_0x2957('0x14')](respondWithResult(_0x3d8b66,null))['catch'](handleError(_0x3d8b66,null));};exports['create']=function(_0xf45618,_0xeea1a3){return db['ChatQueue']['create'](_0xf45618[_0x2957('0x33')],{})['then'](function(_0x44b52e){var _0x59f914=_0xf45618[_0x2957('0x34')][_0x2957('0x15')]({'plain':!![]});if(!_0x59f914)throw new Error(_0x2957('0x35'));if(_0x59f914[_0x2957('0x36')]==='user'){var _0x17c655=_0x44b52e['get']({'plain':!![]});var _0x5d8435='ChatQueues';return db[_0x2957('0x37')][_0x2957('0x32')]({'where':{'name':_0x5d8435,'userProfileId':_0x59f914[_0x2957('0x38')]},'raw':!![]})['then'](function(_0xc0eed9){if(_0xc0eed9&&_0xc0eed9[_0x2957('0x39')]===0x0){return db[_0x2957('0x17')][_0x2957('0x3a')]({'name':_0x17c655['name'],'resourceId':_0x17c655['id'],'type':_0xc0eed9['name'],'sectionId':_0xc0eed9['id']},{})[_0x2957('0x14')](function(){return _0x44b52e;});}else{return _0x44b52e;}})[_0x2957('0x25')](function(_0xabac04){logger['error'](_0x2957('0x3b'),_0xabac04);throw _0xabac04;});}return _0x44b52e;})[_0x2957('0x14')](respondWithResult(_0xeea1a3,0xc9))[_0x2957('0x25')](handleError(_0xeea1a3,null));};exports['update']=function(_0x3a3b27,_0x5b6f0c){if(_0x3a3b27[_0x2957('0x33')]['id']){delete _0x3a3b27[_0x2957('0x33')]['id'];}return db[_0x2957('0x1f')][_0x2957('0x32')]({'where':{'id':_0x3a3b27[_0x2957('0x27')]['id']}})[_0x2957('0x14')](handleEntityNotFound(_0x5b6f0c,null))[_0x2957('0x14')](saveUpdates(_0x3a3b27['body'],null))[_0x2957('0x14')](respondWithResult(_0x5b6f0c,null))[_0x2957('0x25')](handleError(_0x5b6f0c,null));};exports[_0x2957('0x3c')]=function(_0x3e3110,_0xe0a5ec){return db[_0x2957('0x1f')][_0x2957('0x32')]({'where':{'id':_0x3e3110['params']['id']}})[_0x2957('0x14')](handleEntityNotFound(_0xe0a5ec,null))[_0x2957('0x14')](removeEntity(_0xe0a5ec,null))[_0x2957('0x25')](handleError(_0xe0a5ec,null));};exports['describe']=function(_0x47bf2c,_0x243cb5){return db[_0x2957('0x1f')][_0x2957('0x3d')]()[_0x2957('0x14')](respondWithResult(_0x243cb5,null))[_0x2957('0x25')](handleError(_0x243cb5,null));};exports['getMembers']=function(_0x43a970,_0x2bbc9a){var _0x4b17d1={'raw':!![],'where':{}},_0xedac2b={},_0xf6c63c;return db['ChatQueue'][_0x2957('0x3e')]({'where':{'id':_0x43a970[_0x2957('0x27')]['id']}})['then'](handleEntityNotFound(_0x2bbc9a,null))[_0x2957('0x14')](function(_0x2fbef3){if(_0x2fbef3){_0xf6c63c=_0x2fbef3[_0x2957('0x15')]({'plain':!![]});_0xedac2b[_0x2957('0x28')]=_[_0x2957('0x29')](db[_0x2957('0x3f')][_0x2957('0x20')]);_0xedac2b[_0x2957('0x2a')]=_['keys'](_0x43a970['query']);_0xedac2b[_0x2957('0x2b')]=_[_0x2957('0x2c')](_0xedac2b['model'],_0xedac2b['query']);_0x4b17d1[_0x2957('0x2d')]=_[_0x2957('0x2c')](_0xedac2b[_0x2957('0x28')],qs[_0x2957('0x2e')](_0x43a970[_0x2957('0x2a')][_0x2957('0x2e')]));_0x4b17d1[_0x2957('0x2d')]=_0x4b17d1[_0x2957('0x2d')][_0x2957('0x2f')]?_0x4b17d1[_0x2957('0x2d')]:_0xedac2b[_0x2957('0x28')];if(!_0x43a970[_0x2957('0x2a')][_0x2957('0x40')](_0x2957('0x41'))){_0x4b17d1[_0x2957('0x10')]=qs[_0x2957('0x10')](_0x43a970[_0x2957('0x2a')]['limit']);_0x4b17d1[_0x2957('0xe')]=qs[_0x2957('0xe')](_0x43a970[_0x2957('0x2a')][_0x2957('0xe')]);}_0x4b17d1[_0x2957('0x42')]=qs[_0x2957('0x43')](_0x43a970[_0x2957('0x2a')][_0x2957('0x43')]);_0x4b17d1['where']=qs[_0x2957('0x2b')](_[_0x2957('0x44')](_0x43a970[_0x2957('0x2a')],_0xedac2b[_0x2957('0x2b')]));_0x4b17d1['where'][_0x2957('0x45')]=_0x2fbef3['id'];if(_0x43a970[_0x2957('0x2a')][_0x2957('0x46')]){_0x4b17d1[_0x2957('0x23')]=_[_0x2957('0x31')](_0x4b17d1[_0x2957('0x23')],{'$or':_[_0x2957('0x1e')](_0x4b17d1['attributes'],function(_0x50ffb3){var _0xc9d204={};_0xc9d204[_0x50ffb3]={'$like':'%'+_0x43a970[_0x2957('0x2a')][_0x2957('0x46')]+'%'};return _0xc9d204;})});}_0x4b17d1=_[_0x2957('0x31')]({},_0x4b17d1,_0x43a970[_0x2957('0x47')]);return db['UserChatQueue'][_0x2957('0x48')](_0x4b17d1);}})[_0x2957('0x14')](function(_0x1df0fa){if(_0x1df0fa){return db['User']['findAndCountAll']({'where':{'id':_[_0x2957('0x1e')](_0x1df0fa,_0x2957('0x49')),'role':'agent'},'attributes':['id','name',_0x2957('0x4a'),_0x2957('0x4b'),_0x2957('0x4c')]});}})[_0x2957('0x14')](function(_0x39ae14){if(_0x39ae14){return{'count':_0x39ae14[_0x2957('0x11')],'rows':_[_0x2957('0x1e')](_0x39ae14[_0x2957('0x4d')],function(_0x2c952b){return{'membername':_0x2c952b[_0x2957('0x1b')],'UserId':_0x2c952b['id'],'queue_name':_0xf6c63c[_0x2957('0x1b')],'ChatQueueId':_0xf6c63c['id'],'interface':util[_0x2957('0x4e')]('%s/%s',_0x2957('0x4f'),_0x2c952b[_0x2957('0x1b')]),'penalty':0x0,'paused':_0x2c952b[_0x2957('0x4a')],'createdAt':_0x2c952b[_0x2957('0x4c')],'updatedAt':_0x2c952b[_0x2957('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2bbc9a,_0x4b17d1))['catch'](handleError(_0x2bbc9a,null));};exports[_0x2957('0x50')]=function(_0x47c948,_0x46d500){var _0x161960={};var _0x41ec2e={};var _0x39dd66;var _0x1b727a;return db['ChatQueue'][_0x2957('0x3e')]({'where':{'id':_0x47c948[_0x2957('0x27')]['id']}})[_0x2957('0x14')](handleEntityNotFound(_0x46d500,null))[_0x2957('0x14')](function(_0x68c6a3){if(_0x68c6a3){_0x39dd66=_0x68c6a3;_0x41ec2e[_0x2957('0x28')]=_[_0x2957('0x29')](db['Team'][_0x2957('0x20')]);_0x41ec2e[_0x2957('0x2a')]=_['keys'](_0x47c948['query']);_0x41ec2e[_0x2957('0x2b')]=_[_0x2957('0x2c')](_0x41ec2e['model'],_0x41ec2e[_0x2957('0x2a')]);_0x161960[_0x2957('0x2d')]=_[_0x2957('0x2c')](_0x41ec2e['model'],qs['fields'](_0x47c948[_0x2957('0x2a')][_0x2957('0x2e')]));_0x161960[_0x2957('0x2d')]=_0x161960[_0x2957('0x2d')]['length']?_0x161960[_0x2957('0x2d')]:_0x41ec2e[_0x2957('0x28')];_0x161960[_0x2957('0x42')]=qs[_0x2957('0x43')](_0x47c948[_0x2957('0x2a')][_0x2957('0x43')]);_0x161960[_0x2957('0x23')]=qs[_0x2957('0x2b')](_[_0x2957('0x44')](_0x47c948[_0x2957('0x2a')],_0x41ec2e['filters']));if(_0x47c948[_0x2957('0x2a')][_0x2957('0x46')]){_0x161960['where']=_['merge'](_0x161960['where'],{'$or':_[_0x2957('0x1e')](_0x161960[_0x2957('0x2d')],function(_0x4b715c){var _0x289ad3={};_0x289ad3[_0x4b715c]={'$like':'%'+_0x47c948[_0x2957('0x2a')][_0x2957('0x46')]+'%'};return _0x289ad3;})});}_0x161960=_['merge']({},_0x161960,_0x47c948[_0x2957('0x47')]);return _0x39dd66[_0x2957('0x50')](_0x161960);}})[_0x2957('0x14')](function(_0x4330c9){if(_0x4330c9){_0x1b727a=_0x4330c9[_0x2957('0x2f')];if(!_0x47c948['query'][_0x2957('0x40')](_0x2957('0x41'))){_0x161960[_0x2957('0x10')]=qs[_0x2957('0x10')](_0x47c948[_0x2957('0x2a')][_0x2957('0x10')]);_0x161960[_0x2957('0xe')]=qs[_0x2957('0xe')](_0x47c948[_0x2957('0x2a')][_0x2957('0xe')]);}return _0x39dd66[_0x2957('0x50')](_0x161960);}})[_0x2957('0x14')](function(_0xdf13b1){if(_0xdf13b1){return _0xdf13b1?{'count':_0x1b727a,'rows':_0xdf13b1}:null;}})[_0x2957('0x14')](respondWithResult(_0x46d500,null))[_0x2957('0x25')](handleError(_0x46d500,null));};exports['addTeams']=function(_0x111a57,_0x141898){var _0x58be40=_0x111a57[_0x2957('0x33')][_0x2957('0x51')];return db[_0x2957('0x52')][_0x2957('0x48')]({'where':{'id':_0x58be40},'attributes':['id'],'include':[{'model':db[_0x2957('0x53')],'as':_0x2957('0x54'),'attributes':['id',_0x2957('0x1b'),_0x2957('0x55'),_0x2957('0x56'),_0x2957('0x57')],'raw':!![]}]})[_0x2957('0x14')](function(_0x438b1b){if(_0x438b1b){var _0x362f5b=_[_0x2957('0x58')](_0x438b1b,function(_0xa75c9){var _0x5ebde9=_0xa75c9['get']({'plain':!![]});return _0x5ebde9[_0x2957('0x54')];});return db[_0x2957('0x1f')]['find']({'where':{'id':_0x111a57['params']['id']}})[_0x2957('0x14')](function(_0xdcfd0f){return db[_0x2957('0x59')][_0x2957('0x5a')](function(_0x378a38){return _0xdcfd0f[_0x2957('0x5b')](_0x58be40,{'transaction':_0x378a38})[_0x2957('0x14')](function(){return BPromise['each'](_0x362f5b,function(_0xa4c0ad){return db['UserChatQueue'][_0x2957('0x5c')]({'where':{'UserId':_0xa4c0ad['id'],'ChatQueueId':_0x111a57['params']['id']},'transaction':_0x378a38});});})['then'](function(){_0x362f5b[_0x2957('0x5d')](function(_0x4b7706){socket[_0x2957('0x5e')]('userChatQueue:save',{'UserId':_0x4b7706['id'],'ChatQueueId':_0xdcfd0f['id']});});});});});}})[_0x2957('0x14')](respondWithStatusCode(_0x141898,null))[_0x2957('0x25')](handleError(_0x141898,null));};exports[_0x2957('0x5f')]=function(_0x1e4df9,_0x1b6850){return db[_0x2957('0x52')][_0x2957('0x48')]({'where':{'id':_0x1e4df9['query'][_0x2957('0x51')]},'attributes':['id'],'include':[{'model':db[_0x2957('0x53')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2957('0x14')](handleEntityNotFound(_0x1b6850,null))[_0x2957('0x14')](function(_0x153e84){var _0x1e4404=_[_0x2957('0x1e')](_0x153e84,'id');var _0xc80f8d=[];var _0x1a8415=[];var _0x34e74e=squel['select']();_0x34e74e[_0x2957('0x60')](_0x2957('0x61'))[_0x2957('0x62')](_0x2957('0x63'),'tq')[_0x2957('0x64')]('user_has_teams','ut',_0x2957('0x65'))[_0x2957('0x23')](_0x2957('0x66'),_0x1e4df9[_0x2957('0x27')]['id']);for(var _0x287cb6=0x0;_0x287cb6<_0x153e84['length'];_0x287cb6+=0x1){let _0xb4da98=_0x153e84[_0x287cb6];for(var _0x3c21d5=0x0;_0x3c21d5<_0xb4da98[_0x2957('0x54')][_0x2957('0x2f')];_0x3c21d5+=0x1){let _0x39b4c8=_0xb4da98[_0x2957('0x54')][_0x3c21d5];var _0x29cc96=_0x34e74e[_0x2957('0x67')]();_0x29cc96[_0x2957('0x23')](_0x2957('0x68'),_0x39b4c8['id']);_0x1a8415[_0x2957('0x69')](db['sequelize']['query'](_0x29cc96['toString'](),{'type':db[_0x2957('0x59')][_0x2957('0x6a')][_0x2957('0x6b')]})[_0x2957('0x14')](function(_0x547642){if(_0x547642[_0x2957('0x2f')]===0x1){return _0x39b4c8['id'];}else{var _0x181707=_[_0x2957('0x6c')](_['map'](_0x547642,_0x2957('0x6d')),function(_0x5a9f50){return _[_0x2957('0x6e')](_0x1e4404,_0x5a9f50);});if(_0x181707){return _0x39b4c8['id'];}}}));}}return BPromise[_0x2957('0x6f')](_0x1a8415)[_0x2957('0x14')](function(_0x1a77f8){_0xc80f8d=_(_0xc80f8d)[_0x2957('0x70')](_0x1a77f8)[_0x2957('0x71')]()[_0x2957('0x72')]();return db[_0x2957('0x1f')][_0x2957('0x32')]({'where':{'id':_0x1e4df9[_0x2957('0x27')]['id']}})['then'](function(_0x357365){return db[_0x2957('0x59')][_0x2957('0x5a')](function(_0x3264ef){return _0x357365[_0x2957('0x5f')](_0x1e4df9['query'][_0x2957('0x51')],{'transaction':_0x3264ef})[_0x2957('0x14')](function(){if(!_[_0x2957('0x73')](_0xc80f8d)){return _0x357365[_0x2957('0x74')](_0xc80f8d,{'transaction':_0x3264ef});}})[_0x2957('0x14')](function(){_0xc80f8d['forEach'](function(_0x46caae){socket[_0x2957('0x5e')](_0x2957('0x75'),{'UserId':_0x46caae,'ChatQueueId':_0x357365['id']});});});});});});})[_0x2957('0x14')](respondWithStatusCode(_0x1b6850,null))[_0x2957('0x25')](handleError(_0x1b6850,null));};exports['addAgents']=function(_0xec37ad,_0x525959){return db[_0x2957('0x1f')][_0x2957('0x32')]({'where':{'id':_0xec37ad[_0x2957('0x27')]['id']}})[_0x2957('0x14')](handleEntityNotFound(_0x525959,null))[_0x2957('0x14')](function(_0x16459a){if(_0x16459a){return _0x16459a[_0x2957('0x76')](_0xec37ad['body'][_0x2957('0x51')],_[_0x2957('0x77')](_0xec37ad['body'],[_0x2957('0x51'),'id'])||{})[_0x2957('0x78')](function(_0x2f6f27){for(var _0x50f3be=0x0;_0x50f3be<_0xec37ad['body'][_0x2957('0x51')][_0x2957('0x2f')];_0x50f3be+=0x1){socket['emit'](_0x2957('0x79'),{'UserId':Number(_0xec37ad['body']['ids'][_0x50f3be]),'ChatQueueId':Number(_0xec37ad[_0x2957('0x27')]['id'])});}return _0x2f6f27;});}})[_0x2957('0x14')](respondWithResult(_0x525959,null))['catch'](handleError(_0x525959,null));};exports[_0x2957('0x74')]=function(_0x5244c3,_0x5bb60f){return db[_0x2957('0x1f')][_0x2957('0x32')]({'where':{'id':_0x5244c3['params']['id']}})[_0x2957('0x14')](handleEntityNotFound(_0x5bb60f,null))[_0x2957('0x14')](function(_0x2dcf76){if(_0x2dcf76){return _0x2dcf76[_0x2957('0x74')](_0x5244c3['query'][_0x2957('0x51')])[_0x2957('0x14')](function(){if(_[_0x2957('0x7a')](_0x5244c3['query'][_0x2957('0x51')])){for(var _0x287ee8=0x0;_0x287ee8<_0x5244c3[_0x2957('0x2a')][_0x2957('0x51')][_0x2957('0x2f')];_0x287ee8+=0x1){socket[_0x2957('0x5e')](_0x2957('0x75'),{'UserId':Number(_0x5244c3['query'][_0x2957('0x51')][_0x287ee8]),'ChatQueueId':Number(_0x5244c3[_0x2957('0x27')]['id'])});}}else{socket[_0x2957('0x5e')](_0x2957('0x75'),{'UserId':Number(_0x5244c3[_0x2957('0x2a')]['ids']),'ChatQueueId':Number(_0x5244c3[_0x2957('0x27')]['id'])});}});}})[_0x2957('0x14')](respondWithStatusCode(_0x5bb60f,null))[_0x2957('0x25')](handleError(_0x5bb60f,null));};exports['getAgents']=function(_0x52d87f,_0x267bc5){var _0xb75c3c={};var _0x3c0cbd={};var _0x411e98;var _0x6e9c27;return db[_0x2957('0x1f')][_0x2957('0x3e')]({'where':{'id':_0x52d87f[_0x2957('0x27')]['id']}})[_0x2957('0x14')](handleEntityNotFound(_0x267bc5,null))[_0x2957('0x14')](function(_0x22ac86){if(_0x22ac86){_0x411e98=_0x22ac86;_0x3c0cbd[_0x2957('0x28')]=_[_0x2957('0x29')](db[_0x2957('0x53')]['rawAttributes']);_0x3c0cbd[_0x2957('0x2a')]=_[_0x2957('0x29')](_0x52d87f[_0x2957('0x2a')]);_0x3c0cbd[_0x2957('0x2b')]=_['intersection'](_0x3c0cbd[_0x2957('0x28')],_0x3c0cbd['query']);_0xb75c3c[_0x2957('0x2d')]=_['intersection'](_0x3c0cbd[_0x2957('0x28')],qs[_0x2957('0x2e')](_0x52d87f[_0x2957('0x2a')]['fields']));_0xb75c3c[_0x2957('0x2d')]=_0xb75c3c[_0x2957('0x2d')][_0x2957('0x2f')]?_0xb75c3c['attributes']:_0x3c0cbd[_0x2957('0x28')];_0xb75c3c[_0x2957('0x42')]=qs['sort'](_0x52d87f['query']['sort']);_0xb75c3c[_0x2957('0x23')]=qs[_0x2957('0x2b')](_[_0x2957('0x44')](_0x52d87f[_0x2957('0x2a')],_0x3c0cbd[_0x2957('0x2b')]));if(_0x52d87f[_0x2957('0x2a')][_0x2957('0x46')]){_0xb75c3c[_0x2957('0x23')]=_[_0x2957('0x31')](_0xb75c3c[_0x2957('0x23')],{'$or':_[_0x2957('0x1e')](_0xb75c3c[_0x2957('0x2d')],function(_0x4e36a2){var _0x21edf6={};_0x21edf6[_0x4e36a2]={'$like':'%'+_0x52d87f[_0x2957('0x2a')]['filter']+'%'};return _0x21edf6;})});}_0xb75c3c=_['merge']({},_0xb75c3c,_0x52d87f[_0x2957('0x47')]);return _0x411e98['getAgents'](_0xb75c3c);}})[_0x2957('0x14')](function(_0x371554){if(_0x371554){_0x6e9c27=_0x371554[_0x2957('0x2f')];if(!_0x52d87f[_0x2957('0x2a')][_0x2957('0x40')](_0x2957('0x41'))){_0xb75c3c[_0x2957('0x10')]=qs['limit'](_0x52d87f[_0x2957('0x2a')]['limit']);_0xb75c3c[_0x2957('0xe')]=qs[_0x2957('0xe')](_0x52d87f[_0x2957('0x2a')][_0x2957('0xe')]);}return _0x411e98[_0x2957('0x7b')](_0xb75c3c);}})['then'](function(_0x3c4696){if(_0x3c4696){return _0x3c4696?{'count':_0x6e9c27,'rows':_0x3c4696}:null;}})[_0x2957('0x14')](respondWithResult(_0x267bc5,null))['catch'](handleError(_0x267bc5,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index f2aaf39..e33e266 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 _0x6057=['emit','hasOwnProperty','events','../../mysqldb','update','remove'];(function(_0x471969,_0x3397bc){var _0x3ee654=function(_0x147130){while(--_0x147130){_0x471969['push'](_0x471969['shift']());}};_0x3ee654(++_0x3397bc);}(_0x6057,0x8c));var _0x7605=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0x6057[_0xf0bc07];return _0x1c50c2;};'use strict';var EventEmitter=require(_0x7605('0x0'));var ChatQueue=require(_0x7605('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7605('0x2'),'afterDestroy':_0x7605('0x3')};function emitEvent(_0x75d1d9){return function(_0x1425ff,_0x222bc7,_0x406c25){ChatQueueEvents[_0x7605('0x4')](_0x75d1d9+':'+_0x1425ff['id'],_0x1425ff);ChatQueueEvents['emit'](_0x75d1d9,_0x1425ff);_0x406c25(null);};}for(var e in events){if(events[_0x7605('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x03af=['events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5dd2ac,_0x425ec3){var _0x5e7b59=function(_0x84f04a){while(--_0x84f04a){_0x5dd2ac['push'](_0x5dd2ac['shift']());}};_0x5e7b59(++_0x425ec3);}(_0x03af,0xaf));var _0xf03a=function(_0x4a4ef3,_0xde0dc3){_0x4a4ef3=_0x4a4ef3-0x0;var _0x5908ed=_0x03af[_0x4a4ef3];return _0x5908ed;};'use strict';var EventEmitter=require(_0xf03a('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf03a('0x1')](0x0);var events={'afterCreate':_0xf03a('0x2'),'afterUpdate':_0xf03a('0x3'),'afterDestroy':_0xf03a('0x4')};function emitEvent(_0x36ddc6){return function(_0x48b0aa,_0x1cb068,_0x188ceb){ChatQueueEvents[_0xf03a('0x5')](_0x36ddc6+':'+_0x48b0aa['id'],_0x48b0aa);ChatQueueEvents[_0xf03a('0x5')](_0x36ddc6,_0x48b0aa);_0x188ceb(null);};}for(var e in events){if(events[_0xf03a('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 1fd3d16..24a444b 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 _0x7ca0=['moment','bluebird','request-promise','path','exports','lodash','../../config/logger'];(function(_0x5c5b4d,_0x3b4781){var _0x448a9e=function(_0x44710f){while(--_0x44710f){_0x5c5b4d['push'](_0x5c5b4d['shift']());}};_0x448a9e(++_0x3b4781);}(_0x7ca0,0x1cc));var _0x07ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7ca0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x07ca('0x0'));var util=require('util');var logger=require(_0x07ca('0x1'))('api');var moment=require(_0x07ca('0x2'));var BPromise=require(_0x07ca('0x3'));var rp=require(_0x07ca('0x4'));var fs=require('fs');var path=require(_0x07ca('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x07ca('0x6')]=function(_0x3bf799,_0x129ba1){return _0x3bf799['define']('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa953=['lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','define','chat_queues'];(function(_0xcb249e,_0x6ea51f){var _0x4b09ea=function(_0x1b6007){while(--_0x1b6007){_0xcb249e['push'](_0xcb249e['shift']());}};_0x4b09ea(++_0x6ea51f);}(_0xa953,0x10e));var _0x3a95=function(_0x1b591b,_0x6d2e2b){_0x1b591b=_0x1b591b-0x0;var _0x3c24f0=_0xa953[_0x1b591b];return _0x3c24f0;};'use strict';var _=require(_0x3a95('0x0'));var util=require('util');var logger=require(_0x3a95('0x1'))(_0x3a95('0x2'));var moment=require('moment');var BPromise=require(_0x3a95('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a95('0x4'));var rimraf=require(_0x3a95('0x5'));var config=require(_0x3a95('0x6'));var attributes=require(_0x3a95('0x7'));module['exports']=function(_0x78f6c1,_0x122292){return _0x78f6c1[_0x3a95('0x8')]('ChatQueue',attributes,{'tableName':_0x3a95('0x9'),'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 c671035..f27488c 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 _0xbdbe=['model','attributes','raw','ShowChatQueue','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','findAll','options','where','limit','include','map'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0xbdbe,0x1f3));var _0xebdb=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xbdbe[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xebdb('0x0'));var util=require('util');var moment=require(_0xebdb('0x1'));var BPromise=require('bluebird');var rs=require(_0xebdb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebdb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xebdb('0x4'))('rpc');var config=require(_0xebdb('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xebdb('0x6')][_0xebdb('0x7')]({'port':0x232a});config[_0xebdb('0x8')]=_[_0xebdb('0x9')](config[_0xebdb('0x8')],{'host':_0xebdb('0xa'),'port':0x18eb});var socket=require(_0xebdb('0xb'))(new Redis(config[_0xebdb('0x8')]));require(_0xebdb('0xc'))[_0xebdb('0xd')](socket);function respondWithRpcPromise(_0x3b2730,_0x54a360,_0xcdbd2d){return new BPromise(function(_0x1622d5,_0x557d85){return client[_0xebdb('0xe')](_0x3b2730,_0xcdbd2d)[_0xebdb('0xf')](function(_0x2379d3){logger[_0xebdb('0x10')]('ChatQueue,\x20%s,\x20%s',_0x54a360,'request\x20sent');logger[_0xebdb('0x11')](_0xebdb('0x12'),_0x54a360,_0xebdb('0x13'),JSON[_0xebdb('0x14')](_0x2379d3));if(_0x2379d3['error']){if(_0x2379d3[_0xebdb('0x15')][_0xebdb('0x16')]===0x1f4){logger[_0xebdb('0x15')](_0xebdb('0x17'),_0x54a360,_0x2379d3[_0xebdb('0x15')][_0xebdb('0x18')]);return _0x557d85(_0x2379d3[_0xebdb('0x15')][_0xebdb('0x18')]);}logger[_0xebdb('0x15')](_0xebdb('0x17'),_0x54a360,_0x2379d3['error'][_0xebdb('0x18')]);return _0x1622d5(_0x2379d3['error']['message']);}else{logger[_0xebdb('0x10')](_0xebdb('0x17'),_0x54a360,'request\x20sent');_0x1622d5(_0x2379d3[_0xebdb('0x19')][_0xebdb('0x18')]);}})['catch'](function(_0x2de2f5){logger['error']('ChatQueue,\x20%s,\x20%s',_0x54a360,_0x2de2f5);_0x557d85(_0x2de2f5);});});}exports[_0xebdb('0x1a')]=function(_0x253c65){var _0x28e85b=this;return new Promise(function(_0x5c76cc,_0x38a4dd){return db['ChatQueue'][_0xebdb('0x1b')]({'raw':_0x253c65[_0xebdb('0x1c')]?_0x253c65['options']['raw']===undefined?!![]:![]:!![],'where':_0x253c65[_0xebdb('0x1c')]?_0x253c65['options'][_0xebdb('0x1d')]||null:null,'attributes':_0x253c65[_0xebdb('0x1c')]?_0x253c65[_0xebdb('0x1c')]['attributes']||null:null,'limit':_0x253c65['options']?_0x253c65[_0xebdb('0x1c')][_0xebdb('0x1e')]||null:null,'include':_0x253c65[_0xebdb('0x1c')]?_0x253c65[_0xebdb('0x1c')][_0xebdb('0x1f')]?_[_0xebdb('0x20')](_0x253c65[_0xebdb('0x1c')][_0xebdb('0x1f')],function(_0x5b721f){return{'model':db[_0x5b721f[_0xebdb('0x21')]],'as':_0x5b721f['as'],'attributes':_0x5b721f[_0xebdb('0x22')],'include':_0x5b721f[_0xebdb('0x1f')]?_['map'](_0x5b721f[_0xebdb('0x1f')],function(_0x59d9f7){return{'model':db[_0x59d9f7[_0xebdb('0x21')]],'as':_0x59d9f7['as'],'attributes':_0x59d9f7[_0xebdb('0x22')],'include':_0x59d9f7['include']?_[_0xebdb('0x20')](_0x59d9f7['include'],function(_0x497642){return{'model':db[_0x497642[_0xebdb('0x21')]],'as':_0x497642['as'],'attributes':_0x497642[_0xebdb('0x22')]};}):[]};}):[]};}):[]:[]})[_0xebdb('0xf')](function(_0x5136f2){logger[_0xebdb('0x10')](_0xebdb('0x1a'),_0x253c65);logger[_0xebdb('0x11')](_0xebdb('0x1a'),_0x253c65,JSON[_0xebdb('0x14')](_0x5136f2));_0x5c76cc(_0x5136f2);})['catch'](function(_0x538920){logger[_0xebdb('0x15')](_0xebdb('0x1a'),_0x538920['message'],_0x253c65);_0x38a4dd(_0x28e85b['error'](0x1f4,_0x538920['message']));});});};exports['ShowChatQueue']=function(_0x2ba46e){var _0x5f578a=this;return new Promise(function(_0x38637c,_0xd1843){return db['ChatQueue']['find']({'raw':_0x2ba46e[_0xebdb('0x1c')]?_0x2ba46e[_0xebdb('0x1c')][_0xebdb('0x23')]===undefined?!![]:![]:!![],'where':_0x2ba46e['options']?_0x2ba46e[_0xebdb('0x1c')][_0xebdb('0x1d')]||null:null,'attributes':_0x2ba46e[_0xebdb('0x1c')]?_0x2ba46e[_0xebdb('0x1c')][_0xebdb('0x22')]||null:null,'include':_0x2ba46e[_0xebdb('0x1c')]?_0x2ba46e['options'][_0xebdb('0x1f')]?_[_0xebdb('0x20')](_0x2ba46e[_0xebdb('0x1c')][_0xebdb('0x1f')],function(_0x3dc8d3){return{'model':db[_0x3dc8d3[_0xebdb('0x21')]],'as':_0x3dc8d3['as'],'attributes':_0x3dc8d3[_0xebdb('0x22')],'include':_0x3dc8d3[_0xebdb('0x1f')]?_[_0xebdb('0x20')](_0x3dc8d3['include'],function(_0x4fb00a){return{'model':db[_0x4fb00a['model']],'as':_0x4fb00a['as'],'attributes':_0x4fb00a[_0xebdb('0x22')],'include':_0x4fb00a[_0xebdb('0x1f')]?_['map'](_0x4fb00a[_0xebdb('0x1f')],function(_0x31fb4c){return{'model':db[_0x31fb4c['model']],'as':_0x31fb4c['as'],'attributes':_0x31fb4c[_0xebdb('0x22')]};}):[]};}):[]};}):[]:[]})[_0xebdb('0xf')](function(_0x4dd3c2){logger['info'](_0xebdb('0x24'),_0x2ba46e);logger[_0xebdb('0x11')](_0xebdb('0x24'),_0x2ba46e,JSON['stringify'](_0x4dd3c2));_0x38637c(_0x4dd3c2);})[_0xebdb('0x25')](function(_0x123644){logger[_0xebdb('0x15')](_0xebdb('0x24'),_0x123644[_0xebdb('0x18')],_0x2ba46e);_0xd1843(_0x5f578a[_0xebdb('0x15')](0x1f4,_0x123644[_0xebdb('0x18')]));});});};
\ No newline at end of file
+var _0x29c4=['request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','debug','catch','find','model','ShowChatQueue','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0x29c4,0x155));var _0x429c=function(_0x40033f,_0x5633ff){_0x40033f=_0x40033f-0x0;var _0x3b301f=_0x29c4[_0x40033f];return _0x3b301f;};'use strict';var _=require(_0x429c('0x0'));var util=require('util');var moment=require(_0x429c('0x1'));var BPromise=require('bluebird');var rs=require(_0x429c('0x2'));var fs=require('fs');var Redis=require(_0x429c('0x3'));var db=require(_0x429c('0x4'))['db'];var utils=require(_0x429c('0x5'));var logger=require(_0x429c('0x6'))('rpc');var config=require(_0x429c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x429c('0x8')][_0x429c('0x9')]({'port':0x232a});config[_0x429c('0xa')]=_[_0x429c('0xb')](config['redis'],{'host':_0x429c('0xc'),'port':0x18eb});var socket=require(_0x429c('0xd'))(new Redis(config['redis']));require(_0x429c('0xe'))[_0x429c('0xf')](socket);function respondWithRpcPromise(_0xc66556,_0x1634d5,_0x2ad2f2){return new BPromise(function(_0x1f2ee0,_0x272a6a){return client['request'](_0xc66556,_0x2ad2f2)[_0x429c('0x10')](function(_0xc8f7d7){logger[_0x429c('0x11')](_0x429c('0x12'),_0x1634d5,_0x429c('0x13'));logger['debug'](_0x429c('0x14'),_0x1634d5,'request\x20sent',JSON[_0x429c('0x15')](_0xc8f7d7));if(_0xc8f7d7[_0x429c('0x16')]){if(_0xc8f7d7[_0x429c('0x16')][_0x429c('0x17')]===0x1f4){logger[_0x429c('0x16')]('ChatQueue,\x20%s,\x20%s',_0x1634d5,_0xc8f7d7[_0x429c('0x16')][_0x429c('0x18')]);return _0x272a6a(_0xc8f7d7['error'][_0x429c('0x18')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x1634d5,_0xc8f7d7[_0x429c('0x16')][_0x429c('0x18')]);return _0x1f2ee0(_0xc8f7d7[_0x429c('0x16')][_0x429c('0x18')]);}else{logger['info'](_0x429c('0x12'),_0x1634d5,_0x429c('0x13'));_0x1f2ee0(_0xc8f7d7[_0x429c('0x19')][_0x429c('0x18')]);}})['catch'](function(_0x27a61c){logger[_0x429c('0x16')](_0x429c('0x12'),_0x1634d5,_0x27a61c);_0x272a6a(_0x27a61c);});});}exports[_0x429c('0x1a')]=function(_0x10ebb8){var _0x51b75a=this;return new Promise(function(_0xe7774a,_0x5029f7){return db['ChatQueue'][_0x429c('0x1b')]({'raw':_0x10ebb8[_0x429c('0x1c')]?_0x10ebb8[_0x429c('0x1c')][_0x429c('0x1d')]===undefined?!![]:![]:!![],'where':_0x10ebb8['options']?_0x10ebb8[_0x429c('0x1c')][_0x429c('0x1e')]||null:null,'attributes':_0x10ebb8['options']?_0x10ebb8['options'][_0x429c('0x1f')]||null:null,'limit':_0x10ebb8[_0x429c('0x1c')]?_0x10ebb8[_0x429c('0x1c')][_0x429c('0x20')]||null:null,'include':_0x10ebb8[_0x429c('0x1c')]?_0x10ebb8[_0x429c('0x1c')][_0x429c('0x21')]?_[_0x429c('0x22')](_0x10ebb8['options'][_0x429c('0x21')],function(_0x30aa64){return{'model':db[_0x30aa64['model']],'as':_0x30aa64['as'],'attributes':_0x30aa64[_0x429c('0x1f')],'include':_0x30aa64[_0x429c('0x21')]?_['map'](_0x30aa64['include'],function(_0x463b01){return{'model':db[_0x463b01['model']],'as':_0x463b01['as'],'attributes':_0x463b01[_0x429c('0x1f')],'include':_0x463b01[_0x429c('0x21')]?_[_0x429c('0x22')](_0x463b01[_0x429c('0x21')],function(_0x5ef906){return{'model':db[_0x5ef906['model']],'as':_0x5ef906['as'],'attributes':_0x5ef906['attributes']};}):[]};}):[]};}):[]:[]})[_0x429c('0x10')](function(_0x542ebc){logger[_0x429c('0x11')](_0x429c('0x1a'),_0x10ebb8);logger[_0x429c('0x23')]('GetChatQueue',_0x10ebb8,JSON[_0x429c('0x15')](_0x542ebc));_0xe7774a(_0x542ebc);})[_0x429c('0x24')](function(_0x455cd2){logger['error']('GetChatQueue',_0x455cd2[_0x429c('0x18')],_0x10ebb8);_0x5029f7(_0x51b75a['error'](0x1f4,_0x455cd2[_0x429c('0x18')]));});});};exports['ShowChatQueue']=function(_0x58d665){var _0x52d1ac=this;return new Promise(function(_0x51f57e,_0x42abb4){return db['ChatQueue'][_0x429c('0x25')]({'raw':_0x58d665[_0x429c('0x1c')]?_0x58d665['options'][_0x429c('0x1d')]===undefined?!![]:![]:!![],'where':_0x58d665['options']?_0x58d665['options'][_0x429c('0x1e')]||null:null,'attributes':_0x58d665[_0x429c('0x1c')]?_0x58d665[_0x429c('0x1c')]['attributes']||null:null,'include':_0x58d665[_0x429c('0x1c')]?_0x58d665['options'][_0x429c('0x21')]?_[_0x429c('0x22')](_0x58d665[_0x429c('0x1c')]['include'],function(_0x284275){return{'model':db[_0x284275[_0x429c('0x26')]],'as':_0x284275['as'],'attributes':_0x284275[_0x429c('0x1f')],'include':_0x284275['include']?_[_0x429c('0x22')](_0x284275[_0x429c('0x21')],function(_0x4e14d5){return{'model':db[_0x4e14d5[_0x429c('0x26')]],'as':_0x4e14d5['as'],'attributes':_0x4e14d5[_0x429c('0x1f')],'include':_0x4e14d5[_0x429c('0x21')]?_['map'](_0x4e14d5['include'],function(_0x4623ce){return{'model':db[_0x4623ce[_0x429c('0x26')]],'as':_0x4623ce['as'],'attributes':_0x4623ce[_0x429c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x429c('0x10')](function(_0x335b65){logger['info'](_0x429c('0x27'),_0x58d665);logger['debug'](_0x429c('0x27'),_0x58d665,JSON['stringify'](_0x335b65));_0x51f57e(_0x335b65);})[_0x429c('0x24')](function(_0x4a3bdb){logger['error'](_0x429c('0x27'),_0x4a3bdb[_0x429c('0x18')],_0x58d665);_0x42abb4(_0x52d1ac['error'](0x1f4,_0x4a3bdb[_0x429c('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index fbaae46..60c6441 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 _0x6f0d=['update','emit','removeListener','length','save','remove'];(function(_0x70a8a5,_0x35a384){var _0x2b563b=function(_0x4bbb5b){while(--_0x4bbb5b){_0x70a8a5['push'](_0x70a8a5['shift']());}};_0x2b563b(++_0x35a384);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2e9f87,_0x246ba8){_0x2e9f87=_0x2e9f87-0x0;var _0x43eb1c=_0x6f0d[_0x2e9f87];return _0x43eb1c;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xd6f0('0x0'),_0xd6f0('0x1'),_0xd6f0('0x2')];function createListener(_0x107a8c,_0x573473){return function(_0x275230){_0x573473[_0xd6f0('0x3')](_0x107a8c,_0x275230);};}function removeListener(_0x2f78fb,_0x25344b){return function(){ChatQueueEvents[_0xd6f0('0x4')](_0x2f78fb,_0x25344b);};}exports['register']=function(_0x2d2ce6){for(var _0x4a8b0c=0x0,_0xe21ac4=events[_0xd6f0('0x5')];_0x4a8b0c<_0xe21ac4;_0x4a8b0c++){var _0x8b89a9=events[_0x4a8b0c];var _0x1a48a0=createListener('chatQueue:'+_0x8b89a9,_0x2d2ce6);ChatQueueEvents['on'](_0x8b89a9,_0x1a48a0);}};
\ No newline at end of file
+var _0x303a=['removeListener','register','length','./chatQueue.events','remove','update','emit'];(function(_0x447288,_0xd40fa7){var _0x594ef5=function(_0x5bc8f3){while(--_0x5bc8f3){_0x447288['push'](_0x447288['shift']());}};_0x594ef5(++_0xd40fa7);}(_0x303a,0x1a0));var _0xa303=function(_0x5ad3cb,_0x4ff404){_0x5ad3cb=_0x5ad3cb-0x0;var _0xbea1e2=_0x303a[_0x5ad3cb];return _0xbea1e2;};'use strict';var ChatQueueEvents=require(_0xa303('0x0'));var events=['save',_0xa303('0x1'),_0xa303('0x2')];function createListener(_0x36e548,_0x19d27a){return function(_0x594b49){_0x19d27a[_0xa303('0x3')](_0x36e548,_0x594b49);};}function removeListener(_0x26b47c,_0x38a354){return function(){ChatQueueEvents[_0xa303('0x4')](_0x26b47c,_0x38a354);};}exports[_0xa303('0x5')]=function(_0x1c7ee9){for(var _0x2bc3d7=0x0,_0x3f61f1=events[_0xa303('0x6')];_0x2bc3d7<_0x3f61f1;_0x2bc3d7++){var _0x5d95fd=events[_0x2bc3d7];var _0x51e1ee=createListener('chatQueue:'+_0x5d95fd,_0x1c7ee9);ChatQueueEvents['on'](_0x5d95fd,_0x51e1ee);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 1864af2..38c2e94 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x5cae73,_0x7deb8f){var _0x2722ce=function(_0x702135){while(--_0x702135){_0x5cae73['push'](_0x5cae73['shift']());}};_0x2722ce(++_0x7deb8f);}(_0x55ca,0x126));var _0xa55c=function(_0x143a91,_0x235332){_0x143a91=_0x143a91-0x0;var _0x1906f5=_0x55ca[_0x143a91];return _0x1906f5;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x3dc948,_0x5568f8){var _0x1ca1cf=function(_0xe3d57a){while(--_0xe3d57a){_0x3dc948['push'](_0x3dc948['shift']());}};_0x1ca1cf(++_0x5568f8);}(_0x55ca,0x126));var _0xa55c=function(_0x2f35a2,_0x9c1ac){_0x2f35a2=_0x2f35a2-0x0;var _0x503004=_0x55ca[_0x2f35a2];return _0x503004;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 518246e..903e7dd 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 _0xea3a=['sequelize','exports','STRING','DATE','moment'];(function(_0x35df37,_0x927820){var _0x30f707=function(_0x1b0475){while(--_0x1b0475){_0x35df37['push'](_0x35df37['shift']());}};_0x30f707(++_0x927820);}(_0xea3a,0x13f));var _0xaea3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xea3a[_0x4565bf];return _0x5610ba;};'use strict';var moment=require(_0xaea3('0x0'));var Sequelize=require(_0xaea3('0x1'));module[_0xaea3('0x2')]={'uniqueid':{'type':Sequelize[_0xaea3('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xaea3('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xaea3('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xaea3('0x3')]}};
\ No newline at end of file
+var _0xbd76=['DATE','moment','sequelize','exports','STRING'];(function(_0x5c6548,_0x3b46bb){var _0x15eceb=function(_0x2b076e){while(--_0x2b076e){_0x5c6548['push'](_0x5c6548['shift']());}};_0x15eceb(++_0x3b46bb);}(_0xbd76,0x105));var _0x6bd7=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xbd76[_0x278e3c];return _0x3e2d9b;};'use strict';var moment=require(_0x6bd7('0x0'));var Sequelize=require(_0x6bd7('0x1'));module[_0x6bd7('0x2')]={'uniqueid':{'type':Sequelize[_0x6bd7('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x6bd7('0x3')]},'joinAt':{'type':Sequelize[_0x6bd7('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6bd7('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index b8b12f8..78a86d3 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 _0x9d56=['end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','name','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status'];(function(_0x2578d1,_0x2990b6){var _0x2567da=function(_0x5be91b){while(--_0x5be91b){_0x2578d1['push'](_0x2578d1['shift']());}};_0x2567da(++_0x2990b6);}(_0x9d56,0x122));var _0x69d5=function(_0x21105e,_0x4a91a7){_0x21105e=_0x21105e-0x0;var _0x15988c=_0x9d56[_0x21105e];return _0x15988c;};'use strict';var emlformat=require(_0x69d5('0x0'));var rimraf=require(_0x69d5('0x1'));var zipdir=require(_0x69d5('0x2'));var jsonpatch=require(_0x69d5('0x3'));var rp=require('request-promise');var moment=require(_0x69d5('0x4'));var BPromise=require(_0x69d5('0x5'));var Mustache=require(_0x69d5('0x6'));var util=require(_0x69d5('0x7'));var path=require(_0x69d5('0x8'));var sox=require('sox');var csv=require(_0x69d5('0x9'));var ejs=require(_0x69d5('0xa'));var fs=require('fs');var fs_extra=require(_0x69d5('0xb'));var _=require(_0x69d5('0xc'));var squel=require(_0x69d5('0xd'));var crypto=require(_0x69d5('0xe'));var jsforce=require(_0x69d5('0xf'));var deskjs=require(_0x69d5('0x10'));var toCsv=require(_0x69d5('0x9'));var querystring=require(_0x69d5('0x11'));var Papa=require(_0x69d5('0x12'));var Redis=require(_0x69d5('0x13'));var authService=require(_0x69d5('0x14'));var qs=require(_0x69d5('0x15'));var as=require(_0x69d5('0x16'));var hardwareService=require(_0x69d5('0x17'));var logger=require(_0x69d5('0x18'))(_0x69d5('0x19'));var utils=require(_0x69d5('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x69d5('0x1b'));var db=require(_0x69d5('0x1c'))['db'];function respondWithStatusCode(_0x2cc733,_0x4641a7){_0x4641a7=_0x4641a7||0xcc;return function(_0x1c34d9){if(_0x1c34d9){return _0x2cc733['sendStatus'](_0x4641a7);}return _0x2cc733[_0x69d5('0x1d')](_0x4641a7)[_0x69d5('0x1e')]();};}function respondWithResult(_0x263954,_0x134e84){_0x134e84=_0x134e84||0xc8;return function(_0x56843c){if(_0x56843c){return _0x263954['status'](_0x134e84)['json'](_0x56843c);}};}function respondWithFilteredResult(_0x279ce5,_0x33cf2e){return function(_0x56bbbc){if(_0x56bbbc){var _0x28492b=typeof _0x33cf2e[_0x69d5('0x1f')]==='undefined'&&typeof _0x33cf2e[_0x69d5('0x20')]===_0x69d5('0x21');var _0x304417=_0x56bbbc[_0x69d5('0x22')];var _0x16e628=_0x28492b?0x0:_0x33cf2e[_0x69d5('0x1f')];var _0x6763ac=_0x28492b?_0x56bbbc[_0x69d5('0x22')]:_0x33cf2e['offset']+_0x33cf2e[_0x69d5('0x20')];var _0x16c02c;if(_0x6763ac>=_0x304417){_0x6763ac=_0x304417;_0x16c02c=0xc8;}else{_0x16c02c=0xce;}_0x279ce5[_0x69d5('0x1d')](_0x16c02c);return _0x279ce5[_0x69d5('0x23')](_0x69d5('0x24'),_0x16e628+'-'+_0x6763ac+'/'+_0x304417)[_0x69d5('0x25')](_0x56bbbc);}return null;};}function patchUpdates(_0x1f9ed7){return function(_0xc557e3){try{jsonpatch[_0x69d5('0x26')](_0xc557e3,_0x1f9ed7,!![]);}catch(_0x497c1a){return BPromise['reject'](_0x497c1a);}return _0xc557e3[_0x69d5('0x27')]();};}function saveUpdates(_0x3fc1a4,_0xa81fe0){return function(_0x1558b6){if(_0x1558b6){return _0x1558b6[_0x69d5('0x28')](_0x3fc1a4)[_0x69d5('0x29')](function(_0x1ec0d3){return _0x1ec0d3;});}return null;};}function removeEntity(_0x22e984,_0x23ee57){return function(_0x49b3f5){if(_0x49b3f5){return _0x49b3f5[_0x69d5('0x2a')]()[_0x69d5('0x29')](function(){_0x22e984[_0x69d5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e1d8d,_0x53ea6e){return function(_0x5e27e7){if(!_0x5e27e7){_0x2e1d8d[_0x69d5('0x2b')](0x194);}return _0x5e27e7;};}function handleError(_0x49b94f,_0x27ffd8){_0x27ffd8=_0x27ffd8||0x1f4;return function(_0x7636f2){logger[_0x69d5('0x2c')](_0x7636f2['stack']);if(_0x7636f2[_0x69d5('0x2d')]){delete _0x7636f2[_0x69d5('0x2d')];}_0x49b94f[_0x69d5('0x1d')](_0x27ffd8)['send'](_0x7636f2);};}exports['index']=function(_0x3f0ced,_0x41173f){var _0x2892a6={},_0x4d8fb={},_0xf4edd9={'count':0x0,'rows':[]};var _0x4d961f=_[_0x69d5('0x2e')](db[_0x69d5('0x2f')][_0x69d5('0x30')],function(_0x252f43){return{'name':_0x252f43[_0x69d5('0x31')],'type':_0x252f43[_0x69d5('0x32')][_0x69d5('0x33')]};});_0x4d8fb[_0x69d5('0x34')]=_['map'](_0x4d961f,_0x69d5('0x2d'));_0x4d8fb[_0x69d5('0x35')]=_['keys'](_0x3f0ced[_0x69d5('0x35')]);_0x4d8fb['filters']=_[_0x69d5('0x36')](_0x4d8fb[_0x69d5('0x34')],_0x4d8fb[_0x69d5('0x35')]);_0x2892a6['attributes']=_[_0x69d5('0x36')](_0x4d8fb[_0x69d5('0x34')],qs['fields'](_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x37')]));_0x2892a6[_0x69d5('0x38')]=_0x2892a6['attributes'][_0x69d5('0x39')]?_0x2892a6[_0x69d5('0x38')]:_0x4d8fb[_0x69d5('0x34')];if(!_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x3a')](_0x69d5('0x3b'))){_0x2892a6[_0x69d5('0x20')]=qs[_0x69d5('0x20')](_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x20')]);_0x2892a6[_0x69d5('0x1f')]=qs[_0x69d5('0x1f')](_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x1f')]);}_0x2892a6[_0x69d5('0x3c')]=qs[_0x69d5('0x3d')](_0x3f0ced[_0x69d5('0x35')]['sort']);_0x2892a6[_0x69d5('0x3e')]=qs[_0x69d5('0x3f')](_[_0x69d5('0x40')](_0x3f0ced['query'],_0x4d8fb[_0x69d5('0x3f')]),_0x4d961f);if(_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x41')]){_0x2892a6['where']=_[_0x69d5('0x42')](_0x2892a6['where'],{'$or':_[_0x69d5('0x2e')](_0x4d961f,function(_0x1ae187){if(_0x1ae187[_0x69d5('0x32')]!=='VIRTUAL'){var _0x45ca18={};_0x45ca18[_0x1ae187[_0x69d5('0x2d')]]={'$like':'%'+_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x41')]+'%'};return _0x45ca18;}})});}_0x2892a6=_['merge']({},_0x2892a6,_0x3f0ced[_0x69d5('0x43')]);var _0x661bca={'where':_0x2892a6[_0x69d5('0x3e')]};return db[_0x69d5('0x2f')][_0x69d5('0x22')](_0x661bca)[_0x69d5('0x29')](function(_0x51a8f1){_0xf4edd9[_0x69d5('0x22')]=_0x51a8f1;if(_0x3f0ced['query']['includeAll']){_0x2892a6[_0x69d5('0x44')]=[{'all':!![]}];}return db[_0x69d5('0x2f')][_0x69d5('0x45')](_0x2892a6);})[_0x69d5('0x29')](function(_0xa93202){_0xf4edd9[_0x69d5('0x46')]=_0xa93202;return _0xf4edd9;})[_0x69d5('0x29')](respondWithFilteredResult(_0x41173f,_0x2892a6))[_0x69d5('0x47')](handleError(_0x41173f,null));};exports[_0x69d5('0x48')]=function(_0x23527b,_0x13075d){var _0x5d2ba2={'raw':!![],'where':{'id':_0x23527b['params']['id']}},_0x4cf243={};_0x4cf243['model']=_[_0x69d5('0x49')](db[_0x69d5('0x2f')][_0x69d5('0x30')]);_0x4cf243[_0x69d5('0x35')]=_[_0x69d5('0x49')](_0x23527b[_0x69d5('0x35')]);_0x4cf243['filters']=_['intersection'](_0x4cf243[_0x69d5('0x34')],_0x4cf243[_0x69d5('0x35')]);_0x5d2ba2[_0x69d5('0x38')]=_[_0x69d5('0x36')](_0x4cf243[_0x69d5('0x34')],qs[_0x69d5('0x37')](_0x23527b[_0x69d5('0x35')][_0x69d5('0x37')]));_0x5d2ba2['attributes']=_0x5d2ba2['attributes'][_0x69d5('0x39')]?_0x5d2ba2[_0x69d5('0x38')]:_0x4cf243[_0x69d5('0x34')];if(_0x23527b[_0x69d5('0x35')][_0x69d5('0x4a')]){_0x5d2ba2[_0x69d5('0x44')]=[{'all':!![]}];}_0x5d2ba2=_['merge']({},_0x5d2ba2,_0x23527b['options']);return db[_0x69d5('0x2f')][_0x69d5('0x4b')](_0x5d2ba2)[_0x69d5('0x29')](handleEntityNotFound(_0x13075d,null))[_0x69d5('0x29')](respondWithResult(_0x13075d,null))[_0x69d5('0x47')](handleError(_0x13075d,null));};exports[_0x69d5('0x4c')]=function(_0x37a47e,_0x173e85){return db[_0x69d5('0x2f')][_0x69d5('0x4c')](_0x37a47e['body'],{})[_0x69d5('0x29')](respondWithResult(_0x173e85,0xc9))[_0x69d5('0x47')](handleError(_0x173e85,null));};exports[_0x69d5('0x28')]=function(_0x4497b4,_0x1a4ed4){if(_0x4497b4['body']['id']){delete _0x4497b4[_0x69d5('0x4d')]['id'];}return db['ChatQueueReport'][_0x69d5('0x4b')]({'where':{'id':_0x4497b4[_0x69d5('0x4e')]['id']}})[_0x69d5('0x29')](handleEntityNotFound(_0x1a4ed4,null))['then'](saveUpdates(_0x4497b4[_0x69d5('0x4d')],null))[_0x69d5('0x29')](respondWithResult(_0x1a4ed4,null))[_0x69d5('0x47')](handleError(_0x1a4ed4,null));};exports[_0x69d5('0x2a')]=function(_0x153ca4,_0x5266ce){return db[_0x69d5('0x2f')][_0x69d5('0x4b')]({'where':{'id':_0x153ca4[_0x69d5('0x4e')]['id']}})[_0x69d5('0x29')](handleEntityNotFound(_0x5266ce,null))[_0x69d5('0x29')](removeEntity(_0x5266ce,null))[_0x69d5('0x47')](handleError(_0x5266ce,null));};exports[_0x69d5('0x4f')]=function(_0xa04ef2,_0x2ef443){return db[_0x69d5('0x2f')][_0x69d5('0x4f')]()[_0x69d5('0x29')](respondWithResult(_0x2ef443,null))[_0x69d5('0x47')](handleError(_0x2ef443,null));};
\ No newline at end of file
+var _0x5078=['sort','where','filters','merge','filter','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','ChatQueueReport','rawAttributes','fieldName','type','key','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order'];(function(_0x2e3549,_0x76d0d5){var _0x5730d0=function(_0x52229c){while(--_0x52229c){_0x2e3549['push'](_0x2e3549['shift']());}};_0x5730d0(++_0x76d0d5);}(_0x5078,0x148));var _0x8507=function(_0x289ca3,_0xe8a2b2){_0x289ca3=_0x289ca3-0x0;var _0x5c9954=_0x5078[_0x289ca3];return _0x5c9954;};'use strict';var emlformat=require(_0x8507('0x0'));var rimraf=require(_0x8507('0x1'));var zipdir=require(_0x8507('0x2'));var jsonpatch=require(_0x8507('0x3'));var rp=require(_0x8507('0x4'));var moment=require(_0x8507('0x5'));var BPromise=require(_0x8507('0x6'));var Mustache=require(_0x8507('0x7'));var util=require(_0x8507('0x8'));var path=require(_0x8507('0x9'));var sox=require(_0x8507('0xa'));var csv=require(_0x8507('0xb'));var ejs=require(_0x8507('0xc'));var fs=require('fs');var fs_extra=require(_0x8507('0xd'));var _=require(_0x8507('0xe'));var squel=require(_0x8507('0xf'));var crypto=require('crypto');var jsforce=require(_0x8507('0x10'));var deskjs=require(_0x8507('0x11'));var toCsv=require(_0x8507('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8507('0x12'));var authService=require(_0x8507('0x13'));var qs=require(_0x8507('0x14'));var as=require(_0x8507('0x15'));var hardwareService=require(_0x8507('0x16'));var logger=require(_0x8507('0x17'))(_0x8507('0x18'));var utils=require('../../config/utils');var config=require(_0x8507('0x19'));var licenseUtil=require(_0x8507('0x1a'));var db=require(_0x8507('0x1b'))['db'];function respondWithStatusCode(_0x31109f,_0x21a236){_0x21a236=_0x21a236||0xcc;return function(_0x5c41e2){if(_0x5c41e2){return _0x31109f['sendStatus'](_0x21a236);}return _0x31109f[_0x8507('0x1c')](_0x21a236)[_0x8507('0x1d')]();};}function respondWithResult(_0x1f5550,_0x3bafeb){_0x3bafeb=_0x3bafeb||0xc8;return function(_0x2ea0e1){if(_0x2ea0e1){return _0x1f5550[_0x8507('0x1c')](_0x3bafeb)['json'](_0x2ea0e1);}};}function respondWithFilteredResult(_0x4f5aa0,_0x58ff83){return function(_0x1ec9b8){if(_0x1ec9b8){var _0x3f1ed1=typeof _0x58ff83['offset']===_0x8507('0x1e')&&typeof _0x58ff83[_0x8507('0x1f')]===_0x8507('0x1e');var _0x412aee=_0x1ec9b8[_0x8507('0x20')];var _0x13b285=_0x3f1ed1?0x0:_0x58ff83[_0x8507('0x21')];var _0x36e387=_0x3f1ed1?_0x1ec9b8['count']:_0x58ff83['offset']+_0x58ff83[_0x8507('0x1f')];var _0xc556a4;if(_0x36e387>=_0x412aee){_0x36e387=_0x412aee;_0xc556a4=0xc8;}else{_0xc556a4=0xce;}_0x4f5aa0[_0x8507('0x1c')](_0xc556a4);return _0x4f5aa0[_0x8507('0x22')](_0x8507('0x23'),_0x13b285+'-'+_0x36e387+'/'+_0x412aee)['json'](_0x1ec9b8);}return null;};}function patchUpdates(_0x1b8dbf){return function(_0x16501a){try{jsonpatch[_0x8507('0x24')](_0x16501a,_0x1b8dbf,!![]);}catch(_0x192f1c){return BPromise[_0x8507('0x25')](_0x192f1c);}return _0x16501a[_0x8507('0x26')]();};}function saveUpdates(_0x42e5ff,_0x2dc900){return function(_0x539cf9){if(_0x539cf9){return _0x539cf9[_0x8507('0x27')](_0x42e5ff)[_0x8507('0x28')](function(_0x37fd9c){return _0x37fd9c;});}return null;};}function removeEntity(_0x40ad72,_0x873ec4){return function(_0x438001){if(_0x438001){return _0x438001[_0x8507('0x29')]()[_0x8507('0x28')](function(){_0x40ad72['status'](0xcc)[_0x8507('0x1d')]();});}};}function handleEntityNotFound(_0x24fc61,_0x188ae0){return function(_0x5a559e){if(!_0x5a559e){_0x24fc61[_0x8507('0x2a')](0x194);}return _0x5a559e;};}function handleError(_0x15c710,_0x404d73){_0x404d73=_0x404d73||0x1f4;return function(_0x160402){logger['error'](_0x160402[_0x8507('0x2b')]);if(_0x160402[_0x8507('0x2c')]){delete _0x160402[_0x8507('0x2c')];}_0x15c710[_0x8507('0x1c')](_0x404d73)[_0x8507('0x2d')](_0x160402);};}exports['index']=function(_0x23c6e1,_0xb01c06){var _0x232182={},_0x2ca452={},_0x25fe12={'count':0x0,'rows':[]};var _0x8b5a47=_[_0x8507('0x2e')](db[_0x8507('0x2f')][_0x8507('0x30')],function(_0x6e9a38){return{'name':_0x6e9a38[_0x8507('0x31')],'type':_0x6e9a38[_0x8507('0x32')][_0x8507('0x33')]};});_0x2ca452['model']=_['map'](_0x8b5a47,_0x8507('0x2c'));_0x2ca452['query']=_[_0x8507('0x34')](_0x23c6e1[_0x8507('0x35')]);_0x2ca452['filters']=_['intersection'](_0x2ca452['model'],_0x2ca452[_0x8507('0x35')]);_0x232182[_0x8507('0x36')]=_[_0x8507('0x37')](_0x2ca452[_0x8507('0x38')],qs[_0x8507('0x39')](_0x23c6e1[_0x8507('0x35')]['fields']));_0x232182['attributes']=_0x232182[_0x8507('0x36')][_0x8507('0x3a')]?_0x232182[_0x8507('0x36')]:_0x2ca452['model'];if(!_0x23c6e1['query'][_0x8507('0x3b')](_0x8507('0x3c'))){_0x232182['limit']=qs[_0x8507('0x1f')](_0x23c6e1[_0x8507('0x35')]['limit']);_0x232182['offset']=qs['offset'](_0x23c6e1[_0x8507('0x35')][_0x8507('0x21')]);}_0x232182[_0x8507('0x3d')]=qs[_0x8507('0x3e')](_0x23c6e1['query']['sort']);_0x232182[_0x8507('0x3f')]=qs[_0x8507('0x40')](_['pick'](_0x23c6e1[_0x8507('0x35')],_0x2ca452[_0x8507('0x40')]),_0x8b5a47);if(_0x23c6e1[_0x8507('0x35')]['filter']){_0x232182[_0x8507('0x3f')]=_[_0x8507('0x41')](_0x232182[_0x8507('0x3f')],{'$or':_[_0x8507('0x2e')](_0x8b5a47,function(_0x46e6dd){if(_0x46e6dd[_0x8507('0x32')]!=='VIRTUAL'){var _0x42e640={};_0x42e640[_0x46e6dd[_0x8507('0x2c')]]={'$like':'%'+_0x23c6e1['query'][_0x8507('0x42')]+'%'};return _0x42e640;}})});}_0x232182=_[_0x8507('0x41')]({},_0x232182,_0x23c6e1['options']);var _0x2297a8={'where':_0x232182['where']};return db[_0x8507('0x2f')][_0x8507('0x20')](_0x2297a8)['then'](function(_0x2d344e){_0x25fe12['count']=_0x2d344e;if(_0x23c6e1[_0x8507('0x35')][_0x8507('0x43')]){_0x232182[_0x8507('0x44')]=[{'all':!![]}];}return db[_0x8507('0x2f')][_0x8507('0x45')](_0x232182);})[_0x8507('0x28')](function(_0x54d8d3){_0x25fe12[_0x8507('0x46')]=_0x54d8d3;return _0x25fe12;})[_0x8507('0x28')](respondWithFilteredResult(_0xb01c06,_0x232182))[_0x8507('0x47')](handleError(_0xb01c06,null));};exports[_0x8507('0x48')]=function(_0x57083e,_0x260a98){var _0x2e49d0={'raw':!![],'where':{'id':_0x57083e[_0x8507('0x49')]['id']}},_0x55b156={};_0x55b156[_0x8507('0x38')]=_[_0x8507('0x34')](db['ChatQueueReport'][_0x8507('0x30')]);_0x55b156['query']=_[_0x8507('0x34')](_0x57083e[_0x8507('0x35')]);_0x55b156[_0x8507('0x40')]=_[_0x8507('0x37')](_0x55b156['model'],_0x55b156[_0x8507('0x35')]);_0x2e49d0[_0x8507('0x36')]=_[_0x8507('0x37')](_0x55b156[_0x8507('0x38')],qs['fields'](_0x57083e['query']['fields']));_0x2e49d0[_0x8507('0x36')]=_0x2e49d0[_0x8507('0x36')][_0x8507('0x3a')]?_0x2e49d0[_0x8507('0x36')]:_0x55b156[_0x8507('0x38')];if(_0x57083e[_0x8507('0x35')]['includeAll']){_0x2e49d0[_0x8507('0x44')]=[{'all':!![]}];}_0x2e49d0=_[_0x8507('0x41')]({},_0x2e49d0,_0x57083e['options']);return db[_0x8507('0x2f')][_0x8507('0x4a')](_0x2e49d0)[_0x8507('0x28')](handleEntityNotFound(_0x260a98,null))[_0x8507('0x28')](respondWithResult(_0x260a98,null))[_0x8507('0x47')](handleError(_0x260a98,null));};exports[_0x8507('0x4b')]=function(_0x4858b6,_0x5e119e){return db['ChatQueueReport'][_0x8507('0x4b')](_0x4858b6[_0x8507('0x4c')],{})[_0x8507('0x28')](respondWithResult(_0x5e119e,0xc9))[_0x8507('0x47')](handleError(_0x5e119e,null));};exports[_0x8507('0x27')]=function(_0x2c3a5d,_0x5bb3c4){if(_0x2c3a5d[_0x8507('0x4c')]['id']){delete _0x2c3a5d[_0x8507('0x4c')]['id'];}return db[_0x8507('0x2f')][_0x8507('0x4a')]({'where':{'id':_0x2c3a5d[_0x8507('0x49')]['id']}})[_0x8507('0x28')](handleEntityNotFound(_0x5bb3c4,null))['then'](saveUpdates(_0x2c3a5d['body'],null))[_0x8507('0x28')](respondWithResult(_0x5bb3c4,null))[_0x8507('0x47')](handleError(_0x5bb3c4,null));};exports[_0x8507('0x29')]=function(_0x75b763,_0x50465d){return db[_0x8507('0x2f')][_0x8507('0x4a')]({'where':{'id':_0x75b763['params']['id']}})[_0x8507('0x28')](handleEntityNotFound(_0x50465d,null))[_0x8507('0x28')](removeEntity(_0x50465d,null))['catch'](handleError(_0x50465d,null));};exports[_0x8507('0x4d')]=function(_0x109b91,_0x447978){return db[_0x8507('0x2f')][_0x8507('0x4d')]()[_0x8507('0x28')](respondWithResult(_0x447978,null))[_0x8507('0x47')](handleError(_0x447978,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 54a1b93..06744e5 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0xbcacfd,_0x5d02ab){var _0x3cba9e=function(_0x5d6b95){while(--_0x5d6b95){_0xbcacfd['push'](_0xbcacfd['shift']());}};_0x3cba9e(++_0x5d02ab);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x6505c,_0x5329a7){var _0x1a7a96=function(_0x5bb1c6){while(--_0x5bb1c6){_0x6505c['push'](_0x6505c['shift']());}};_0x1a7a96(++_0x5329a7);}(_0xb10b,0x12a));var _0xbb10=function(_0x33efcc,_0x2ebf86){_0x33efcc=_0x33efcc-0x0;var _0x2e9f19=_0xb10b[_0x33efcc];return _0x2e9f19;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index fe69e51..96cfa47 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 _0xa2b6=['then','UpdateChatQueueReport','update','body','where','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw'];(function(_0x4067ac,_0x363603){var _0x53d74d=function(_0x492ad4){while(--_0x492ad4){_0x4067ac['push'](_0x4067ac['shift']());}};_0x53d74d(++_0x363603);}(_0xa2b6,0x1a6));var _0x6a2b=function(_0x5aa4ac,_0x74073a){_0x5aa4ac=_0x5aa4ac-0x0;var _0x31dfb8=_0xa2b6[_0x5aa4ac];return _0x31dfb8;};'use strict';var _=require(_0x6a2b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6a2b('0x1'));var rs=require(_0x6a2b('0x2'));var fs=require('fs');var Redis=require(_0x6a2b('0x3'));var db=require(_0x6a2b('0x4'))['db'];var utils=require(_0x6a2b('0x5'));var logger=require(_0x6a2b('0x6'))(_0x6a2b('0x7'));var config=require('../../config/environment');var jayson=require(_0x6a2b('0x8'));var client=jayson[_0x6a2b('0x9')][_0x6a2b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d6d5e,_0xfbd0c4,_0x17528d){return new BPromise(function(_0x2edd87,_0x5f1260){return client[_0x6a2b('0xb')](_0x4d6d5e,_0x17528d)['then'](function(_0x4c2c8b){logger[_0x6a2b('0xc')](_0x6a2b('0xd'),_0xfbd0c4,_0x6a2b('0xe'));logger['debug'](_0x6a2b('0xf'),_0xfbd0c4,_0x6a2b('0xe'),JSON[_0x6a2b('0x10')](_0x4c2c8b));if(_0x4c2c8b['error']){if(_0x4c2c8b[_0x6a2b('0x11')]['code']===0x1f4){logger[_0x6a2b('0x11')](_0x6a2b('0xd'),_0xfbd0c4,_0x4c2c8b[_0x6a2b('0x11')][_0x6a2b('0x12')]);return _0x5f1260(_0x4c2c8b['error'][_0x6a2b('0x12')]);}logger[_0x6a2b('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0xfbd0c4,_0x4c2c8b[_0x6a2b('0x11')][_0x6a2b('0x12')]);return _0x2edd87(_0x4c2c8b['error']['message']);}else{logger[_0x6a2b('0xc')](_0x6a2b('0xd'),_0xfbd0c4,_0x6a2b('0xe'));_0x2edd87(_0x4c2c8b[_0x6a2b('0x13')][_0x6a2b('0x12')]);}})[_0x6a2b('0x14')](function(_0x237151){logger['error'](_0x6a2b('0xd'),_0xfbd0c4,_0x237151);_0x5f1260(_0x237151);});});}exports[_0x6a2b('0x15')]=function(_0x149b51){var _0x98920=this;return new Promise(function(_0x20ad3a,_0x4db38d){return db[_0x6a2b('0x16')][_0x6a2b('0x17')](_0x149b51['body'],{'raw':_0x149b51[_0x6a2b('0x18')]?_0x149b51[_0x6a2b('0x18')][_0x6a2b('0x19')]===undefined?!![]:![]:!![]})[_0x6a2b('0x1a')](function(_0x2f9642){logger['info'](_0x6a2b('0x15'),_0x149b51);logger['debug']('CreateChatQueueReport',_0x149b51,JSON[_0x6a2b('0x10')](_0x2f9642));_0x20ad3a(_0x2f9642);})[_0x6a2b('0x14')](function(_0x30d78d){logger[_0x6a2b('0x11')](_0x6a2b('0x15'),_0x30d78d[_0x6a2b('0x12')],_0x149b51);_0x4db38d(_0x98920[_0x6a2b('0x11')](0x1f4,_0x30d78d[_0x6a2b('0x12')]));});});};exports[_0x6a2b('0x1b')]=function(_0xda7851){var _0x5e83be=this;return new Promise(function(_0x352949,_0x6389bb){return db[_0x6a2b('0x16')][_0x6a2b('0x1c')](_0xda7851[_0x6a2b('0x1d')],{'raw':_0xda7851[_0x6a2b('0x18')]?_0xda7851[_0x6a2b('0x18')][_0x6a2b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xda7851[_0x6a2b('0x18')]?_0xda7851[_0x6a2b('0x18')][_0x6a2b('0x1e')]||null:null,'attributes':_0xda7851['options']?_0xda7851[_0x6a2b('0x18')]['attributes']||null:null,'limit':_0xda7851[_0x6a2b('0x18')]?_0xda7851[_0x6a2b('0x18')][_0x6a2b('0x1f')]||null:null})[_0x6a2b('0x1a')](function(_0x4d2877){logger[_0x6a2b('0xc')](_0x6a2b('0x1b'),_0xda7851);logger['debug'](_0x6a2b('0x1b'),_0xda7851,JSON['stringify'](_0x4d2877));_0x352949(_0x4d2877);})[_0x6a2b('0x14')](function(_0x3c6f34){logger[_0x6a2b('0x11')](_0x6a2b('0x1b'),_0x3c6f34[_0x6a2b('0x12')],_0xda7851);_0x6389bb(_0x5e83be[_0x6a2b('0x11')](0x1f4,_0x3c6f34[_0x6a2b('0x12')]));});});};
\ No newline at end of file
+var _0x2652=['raw','UpdateChatQueueReport','ChatQueueReport','update','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','create','body','options'];(function(_0x4cdf4b,_0x5b07c6){var _0x4eb51d=function(_0x69775b){while(--_0x69775b){_0x4cdf4b['push'](_0x4cdf4b['shift']());}};_0x4eb51d(++_0x5b07c6);}(_0x2652,0x1e1));var _0x2265=function(_0x137388,_0x1b6e88){_0x137388=_0x137388-0x0;var _0x999e43=_0x2652[_0x137388];return _0x999e43;};'use strict';var _=require(_0x2265('0x0'));var util=require(_0x2265('0x1'));var moment=require(_0x2265('0x2'));var BPromise=require(_0x2265('0x3'));var rs=require(_0x2265('0x4'));var fs=require('fs');var Redis=require(_0x2265('0x5'));var db=require(_0x2265('0x6'))['db'];var utils=require(_0x2265('0x7'));var logger=require(_0x2265('0x8'))(_0x2265('0x9'));var config=require(_0x2265('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x2265('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a0f42,_0x42a98b,_0x5536fd){return new BPromise(function(_0xd3b591,_0x5452f4){return client[_0x2265('0xc')](_0x5a0f42,_0x5536fd)[_0x2265('0xd')](function(_0x23304c){logger[_0x2265('0xe')](_0x2265('0xf'),_0x42a98b,'request\x20sent');logger[_0x2265('0x10')](_0x2265('0x11'),_0x42a98b,_0x2265('0x12'),JSON[_0x2265('0x13')](_0x23304c));if(_0x23304c[_0x2265('0x14')]){if(_0x23304c[_0x2265('0x14')][_0x2265('0x15')]===0x1f4){logger[_0x2265('0x14')](_0x2265('0xf'),_0x42a98b,_0x23304c[_0x2265('0x14')][_0x2265('0x16')]);return _0x5452f4(_0x23304c[_0x2265('0x14')][_0x2265('0x16')]);}logger[_0x2265('0x14')](_0x2265('0xf'),_0x42a98b,_0x23304c['error']['message']);return _0xd3b591(_0x23304c[_0x2265('0x14')]['message']);}else{logger[_0x2265('0xe')](_0x2265('0xf'),_0x42a98b,_0x2265('0x12'));_0xd3b591(_0x23304c[_0x2265('0x17')]['message']);}})[_0x2265('0x18')](function(_0x551e74){logger[_0x2265('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x42a98b,_0x551e74);_0x5452f4(_0x551e74);});});}exports[_0x2265('0x19')]=function(_0x298752){var _0x199730=this;return new Promise(function(_0x5150d2,_0x1285a9){return db['ChatQueueReport'][_0x2265('0x1a')](_0x298752[_0x2265('0x1b')],{'raw':_0x298752[_0x2265('0x1c')]?_0x298752[_0x2265('0x1c')][_0x2265('0x1d')]===undefined?!![]:![]:!![]})[_0x2265('0xd')](function(_0x217202){logger[_0x2265('0xe')](_0x2265('0x19'),_0x298752);logger['debug'](_0x2265('0x19'),_0x298752,JSON['stringify'](_0x217202));_0x5150d2(_0x217202);})[_0x2265('0x18')](function(_0x19315){logger['error'](_0x2265('0x19'),_0x19315[_0x2265('0x16')],_0x298752);_0x1285a9(_0x199730[_0x2265('0x14')](0x1f4,_0x19315['message']));});});};exports[_0x2265('0x1e')]=function(_0x3cdaee){var _0x1702dc=this;return new Promise(function(_0x48697e,_0x2b3c55){return db[_0x2265('0x1f')][_0x2265('0x20')](_0x3cdaee[_0x2265('0x1b')],{'raw':_0x3cdaee[_0x2265('0x1c')]?_0x3cdaee[_0x2265('0x1c')][_0x2265('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cdaee['options']?_0x3cdaee['options']['where']||null:null,'attributes':_0x3cdaee[_0x2265('0x1c')]?_0x3cdaee[_0x2265('0x1c')]['attributes']||null:null,'limit':_0x3cdaee[_0x2265('0x1c')]?_0x3cdaee['options'][_0x2265('0x21')]||null:null})[_0x2265('0xd')](function(_0x48419e){logger[_0x2265('0xe')](_0x2265('0x1e'),_0x3cdaee);logger['debug'](_0x2265('0x1e'),_0x3cdaee,JSON['stringify'](_0x48419e));_0x48697e(_0x48419e);})[_0x2265('0x18')](function(_0x594b8a){logger[_0x2265('0x14')](_0x2265('0x1e'),_0x594b8a[_0x2265('0x16')],_0x3cdaee);_0x2b3c55(_0x1702dc[_0x2265('0x14')](0x1f4,_0x594b8a[_0x2265('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 3a197e7..0aa07ce 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 _0xf329=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','multer'];(function(_0x13ea36,_0x2805ad){var _0x312066=function(_0xfbee88){while(--_0xfbee88){_0x13ea36['push'](_0x13ea36['shift']());}};_0x312066(++_0x2805ad);}(_0xf329,0x1a3));var _0x9f32=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf329[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9f32('0x0'));var util=require(_0x9f32('0x1'));var path=require('path');var timeout=require(_0x9f32('0x2'));var express=require(_0x9f32('0x3'));var router=express[_0x9f32('0x4')]();var fs_extra=require(_0x9f32('0x5'));var auth=require(_0x9f32('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9f32('0x7'));var controller=require(_0x9f32('0x8'));router[_0x9f32('0x9')]('/',auth[_0x9f32('0xa')](),controller[_0x9f32('0xb')]);router[_0x9f32('0x9')](_0x9f32('0xc'),auth[_0x9f32('0xa')](),controller[_0x9f32('0xd')]);router[_0x9f32('0x9')](_0x9f32('0xe'),auth['isAuthenticated'](),controller[_0x9f32('0xf')]);router['post']('/',auth[_0x9f32('0xa')](),controller[_0x9f32('0x10')]);router[_0x9f32('0x11')](_0x9f32('0xe'),auth['isAuthenticated'](),controller[_0x9f32('0x12')]);router[_0x9f32('0x13')](_0x9f32('0xe'),auth[_0x9f32('0xa')](),controller['destroy']);module[_0x9f32('0x14')]=router;
\ No newline at end of file
+var _0x9c4a=['create','put','update','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','post'];(function(_0x31e245,_0xa8f086){var _0x4315a3=function(_0x14b2ae){while(--_0x14b2ae){_0x31e245['push'](_0x31e245['shift']());}};_0x4315a3(++_0xa8f086);}(_0x9c4a,0x121));var _0xa9c4=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x9c4a[_0x391c55];return _0xa434e0;};'use strict';var multer=require(_0xa9c4('0x0'));var util=require('util');var path=require(_0xa9c4('0x1'));var timeout=require(_0xa9c4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa9c4('0x3'));var auth=require(_0xa9c4('0x4'));var interaction=require(_0xa9c4('0x5'));var config=require(_0xa9c4('0x6'));var controller=require(_0xa9c4('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa9c4('0x8')]);router[_0xa9c4('0x9')](_0xa9c4('0xa'),auth[_0xa9c4('0xb')](),controller[_0xa9c4('0xc')]);router[_0xa9c4('0x9')](_0xa9c4('0xd'),auth[_0xa9c4('0xb')](),controller['show']);router[_0xa9c4('0xe')]('/',auth['isAuthenticated'](),controller[_0xa9c4('0xf')]);router[_0xa9c4('0x10')](_0xa9c4('0xd'),auth[_0xa9c4('0xb')](),controller[_0xa9c4('0x11')]);router['delete'](_0xa9c4('0xd'),auth['isAuthenticated'](),controller[_0xa9c4('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 6370781..a89dea2 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x5634df,_0x332cf8){var _0x4f2d43=function(_0x5a6a03){while(--_0x5a6a03){_0x5634df['push'](_0x5634df['shift']());}};_0x4f2d43(++_0x332cf8);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5ca74a,_0x3a057c){_0x5ca74a=_0x5ca74a-0x0;var _0x96e793=_0xf4eb[_0x5ca74a];return _0x96e793;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x3816c2,_0xb221e1){var _0x144669=function(_0x149c29){while(--_0x149c29){_0x3816c2['push'](_0x3816c2['shift']());}};_0x144669(++_0xb221e1);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1186e8,_0x507e26){_0x1186e8=_0x1186e8-0x0;var _0x5bddc4=_0x9bde[_0x1186e8];return _0x5bddc4;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 2ef2006..8f0ed07 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 _0x8d02=['ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox'];(function(_0x4f0f32,_0x5f4739){var _0x40dcd4=function(_0x40591e){while(--_0x40591e){_0x4f0f32['push'](_0x4f0f32['shift']());}};_0x40dcd4(++_0x5f4739);}(_0x8d02,0xda));var _0x28d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8d02[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x28d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x28d0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28d0('0x2'));var moment=require(_0x28d0('0x3'));var BPromise=require(_0x28d0('0x4'));var Mustache=require(_0x28d0('0x5'));var util=require('util');var path=require('path');var sox=require(_0x28d0('0x6'));var csv=require('to-csv');var ejs=require(_0x28d0('0x7'));var fs=require('fs');var fs_extra=require(_0x28d0('0x8'));var _=require('lodash');var squel=require(_0x28d0('0x9'));var crypto=require(_0x28d0('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x28d0('0xb'));var toCsv=require(_0x28d0('0xc'));var querystring=require(_0x28d0('0xd'));var Papa=require(_0x28d0('0xe'));var Redis=require(_0x28d0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x28d0('0x10'));var as=require(_0x28d0('0x11'));var hardwareService=require(_0x28d0('0x12'));var logger=require(_0x28d0('0x13'))(_0x28d0('0x14'));var utils=require(_0x28d0('0x15'));var config=require(_0x28d0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x28d0('0x17'))['db'];function respondWithStatusCode(_0xd3bbf5,_0x39acde){_0x39acde=_0x39acde||0xcc;return function(_0x3dba0f){if(_0x3dba0f){return _0xd3bbf5['sendStatus'](_0x39acde);}return _0xd3bbf5['status'](_0x39acde)[_0x28d0('0x18')]();};}function respondWithResult(_0x38ec12,_0x4e9601){_0x4e9601=_0x4e9601||0xc8;return function(_0x57b769){if(_0x57b769){return _0x38ec12['status'](_0x4e9601)[_0x28d0('0x19')](_0x57b769);}};}function respondWithFilteredResult(_0x30a606,_0x3ef19b){return function(_0x4a950f){if(_0x4a950f){var _0x4ad6d4=typeof _0x3ef19b[_0x28d0('0x1a')]===_0x28d0('0x1b')&&typeof _0x3ef19b[_0x28d0('0x1c')]==='undefined';var _0x1129b8=_0x4a950f[_0x28d0('0x1d')];var _0x4d3ada=_0x4ad6d4?0x0:_0x3ef19b[_0x28d0('0x1a')];var _0x8fd22a=_0x4ad6d4?_0x4a950f[_0x28d0('0x1d')]:_0x3ef19b['offset']+_0x3ef19b[_0x28d0('0x1c')];var _0x3b3bfd;if(_0x8fd22a>=_0x1129b8){_0x8fd22a=_0x1129b8;_0x3b3bfd=0xc8;}else{_0x3b3bfd=0xce;}_0x30a606[_0x28d0('0x1e')](_0x3b3bfd);return _0x30a606['set'](_0x28d0('0x1f'),_0x4d3ada+'-'+_0x8fd22a+'/'+_0x1129b8)['json'](_0x4a950f);}return null;};}function patchUpdates(_0x588a0d){return function(_0x3933ca){try{jsonpatch[_0x28d0('0x20')](_0x3933ca,_0x588a0d,!![]);}catch(_0x53bfaa){return BPromise[_0x28d0('0x21')](_0x53bfaa);}return _0x3933ca[_0x28d0('0x22')]();};}function saveUpdates(_0x48428b,_0x101bc9){return function(_0x556df9){if(_0x556df9){return _0x556df9[_0x28d0('0x23')](_0x48428b)[_0x28d0('0x24')](function(_0x98ee3){return _0x98ee3;});}return null;};}function removeEntity(_0x3b89ca,_0x4f1db7){return function(_0x4f3976){if(_0x4f3976){return _0x4f3976[_0x28d0('0x25')]()[_0x28d0('0x24')](function(){_0x3b89ca[_0x28d0('0x1e')](0xcc)[_0x28d0('0x18')]();});}};}function handleEntityNotFound(_0x42c5cf,_0x8dca0c){return function(_0x35909e){if(!_0x35909e){_0x42c5cf[_0x28d0('0x26')](0x194);}return _0x35909e;};}function handleError(_0x30fbb9,_0x3416c7){_0x3416c7=_0x3416c7||0x1f4;return function(_0x28c6fc){logger[_0x28d0('0x27')](_0x28c6fc[_0x28d0('0x28')]);if(_0x28c6fc[_0x28d0('0x29')]){delete _0x28c6fc[_0x28d0('0x29')];}_0x30fbb9[_0x28d0('0x1e')](_0x3416c7)[_0x28d0('0x2a')](_0x28c6fc);};}exports[_0x28d0('0x2b')]=function(_0x45dca8,_0x2b0229){var _0x1fa18={},_0x2b9659={},_0x44ec2e={'count':0x0,'rows':[]};var _0x13b395=_[_0x28d0('0x2c')](db[_0x28d0('0x2d')][_0x28d0('0x2e')],function(_0x29e546){return{'name':_0x29e546[_0x28d0('0x2f')],'type':_0x29e546[_0x28d0('0x30')][_0x28d0('0x31')]};});_0x2b9659[_0x28d0('0x32')]=_[_0x28d0('0x2c')](_0x13b395,_0x28d0('0x29'));_0x2b9659[_0x28d0('0x33')]=_[_0x28d0('0x34')](_0x45dca8['query']);_0x2b9659[_0x28d0('0x35')]=_[_0x28d0('0x36')](_0x2b9659[_0x28d0('0x32')],_0x2b9659[_0x28d0('0x33')]);_0x1fa18['attributes']=_[_0x28d0('0x36')](_0x2b9659['model'],qs[_0x28d0('0x37')](_0x45dca8[_0x28d0('0x33')]['fields']));_0x1fa18[_0x28d0('0x38')]=_0x1fa18[_0x28d0('0x38')][_0x28d0('0x39')]?_0x1fa18[_0x28d0('0x38')]:_0x2b9659[_0x28d0('0x32')];if(!_0x45dca8[_0x28d0('0x33')]['hasOwnProperty']('nolimit')){_0x1fa18['limit']=qs[_0x28d0('0x1c')](_0x45dca8['query'][_0x28d0('0x1c')]);_0x1fa18[_0x28d0('0x1a')]=qs['offset'](_0x45dca8[_0x28d0('0x33')][_0x28d0('0x1a')]);}_0x1fa18['order']=qs['sort'](_0x45dca8[_0x28d0('0x33')][_0x28d0('0x3a')]);_0x1fa18[_0x28d0('0x3b')]=qs[_0x28d0('0x35')](_[_0x28d0('0x3c')](_0x45dca8[_0x28d0('0x33')],_0x2b9659[_0x28d0('0x35')]),_0x13b395);if(_0x45dca8['query'][_0x28d0('0x3d')]){_0x1fa18['where']=_[_0x28d0('0x3e')](_0x1fa18[_0x28d0('0x3b')],{'$or':_[_0x28d0('0x2c')](_0x13b395,function(_0x29bac6){if(_0x29bac6[_0x28d0('0x30')]!==_0x28d0('0x3f')){var _0x17e1d9={};_0x17e1d9[_0x29bac6[_0x28d0('0x29')]]={'$like':'%'+_0x45dca8[_0x28d0('0x33')][_0x28d0('0x3d')]+'%'};return _0x17e1d9;}})});}_0x1fa18=_[_0x28d0('0x3e')]({},_0x1fa18,_0x45dca8[_0x28d0('0x40')]);var _0xe42ba9={'where':_0x1fa18[_0x28d0('0x3b')]};return db[_0x28d0('0x2d')][_0x28d0('0x1d')](_0xe42ba9)[_0x28d0('0x24')](function(_0x3a3343){_0x44ec2e[_0x28d0('0x1d')]=_0x3a3343;if(_0x45dca8[_0x28d0('0x33')][_0x28d0('0x41')]){_0x1fa18[_0x28d0('0x42')]=[{'all':!![]}];}return db[_0x28d0('0x2d')][_0x28d0('0x43')](_0x1fa18);})['then'](function(_0x4a140b){_0x44ec2e[_0x28d0('0x44')]=_0x4a140b;return _0x44ec2e;})[_0x28d0('0x24')](respondWithFilteredResult(_0x2b0229,_0x1fa18))[_0x28d0('0x45')](handleError(_0x2b0229,null));};exports['show']=function(_0x334d69,_0x2816d3){var _0x536f73={'raw':!![],'where':{'id':_0x334d69[_0x28d0('0x46')]['id']}},_0x43a5f6={};_0x43a5f6[_0x28d0('0x32')]=_[_0x28d0('0x34')](db[_0x28d0('0x2d')][_0x28d0('0x2e')]);_0x43a5f6['query']=_[_0x28d0('0x34')](_0x334d69[_0x28d0('0x33')]);_0x43a5f6[_0x28d0('0x35')]=_[_0x28d0('0x36')](_0x43a5f6[_0x28d0('0x32')],_0x43a5f6['query']);_0x536f73[_0x28d0('0x38')]=_['intersection'](_0x43a5f6['model'],qs[_0x28d0('0x37')](_0x334d69[_0x28d0('0x33')]['fields']));_0x536f73[_0x28d0('0x38')]=_0x536f73['attributes'][_0x28d0('0x39')]?_0x536f73[_0x28d0('0x38')]:_0x43a5f6[_0x28d0('0x32')];if(_0x334d69[_0x28d0('0x33')]['includeAll']){_0x536f73[_0x28d0('0x42')]=[{'all':!![]}];}_0x536f73=_[_0x28d0('0x3e')]({},_0x536f73,_0x334d69[_0x28d0('0x40')]);return db[_0x28d0('0x2d')][_0x28d0('0x47')](_0x536f73)[_0x28d0('0x24')](handleEntityNotFound(_0x2816d3,null))[_0x28d0('0x24')](respondWithResult(_0x2816d3,null))[_0x28d0('0x45')](handleError(_0x2816d3,null));};exports[_0x28d0('0x48')]=function(_0x3b0c55,_0x4d0674){return db['ChatTransferReport'][_0x28d0('0x48')](_0x3b0c55[_0x28d0('0x49')],{})[_0x28d0('0x24')](respondWithResult(_0x4d0674,0xc9))['catch'](handleError(_0x4d0674,null));};exports[_0x28d0('0x23')]=function(_0x4fb803,_0x2d753b){if(_0x4fb803[_0x28d0('0x49')]['id']){delete _0x4fb803[_0x28d0('0x49')]['id'];}return db[_0x28d0('0x2d')][_0x28d0('0x47')]({'where':{'id':_0x4fb803['params']['id']}})[_0x28d0('0x24')](handleEntityNotFound(_0x2d753b,null))[_0x28d0('0x24')](saveUpdates(_0x4fb803[_0x28d0('0x49')],null))[_0x28d0('0x24')](respondWithResult(_0x2d753b,null))[_0x28d0('0x45')](handleError(_0x2d753b,null));};exports[_0x28d0('0x25')]=function(_0x1e946e,_0x3abeeb){return db['ChatTransferReport']['find']({'where':{'id':_0x1e946e['params']['id']}})['then'](handleEntityNotFound(_0x3abeeb,null))[_0x28d0('0x24')](removeEntity(_0x3abeeb,null))[_0x28d0('0x45')](handleError(_0x3abeeb,null));};exports[_0x28d0('0x4a')]=function(_0x514fb6,_0x8f2cb3){return db[_0x28d0('0x2d')]['describe']()['then'](respondWithResult(_0x8f2cb3,null))[_0x28d0('0x45')](handleError(_0x8f2cb3,null));};
\ No newline at end of file
+var _0x4ad2=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','limit','count','set','apply','reject','save','update','then','stack','name','send','index','rawAttributes','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','ChatTransferReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x415f77,_0x4ef1a4){var _0x1ef989=function(_0x43313f){while(--_0x43313f){_0x415f77['push'](_0x415f77['shift']());}};_0x1ef989(++_0x4ef1a4);}(_0x4ad2,0xe2));var _0x24ad=function(_0x347896,_0x32f190){_0x347896=_0x347896-0x0;var _0x190a68=_0x4ad2[_0x347896];return _0x190a68;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x24ad('0x0'));var jsonpatch=require(_0x24ad('0x1'));var rp=require(_0x24ad('0x2'));var moment=require(_0x24ad('0x3'));var BPromise=require(_0x24ad('0x4'));var Mustache=require('mustache');var util=require(_0x24ad('0x5'));var path=require(_0x24ad('0x6'));var sox=require(_0x24ad('0x7'));var csv=require(_0x24ad('0x8'));var ejs=require(_0x24ad('0x9'));var fs=require('fs');var fs_extra=require(_0x24ad('0xa'));var _=require(_0x24ad('0xb'));var squel=require(_0x24ad('0xc'));var crypto=require(_0x24ad('0xd'));var jsforce=require(_0x24ad('0xe'));var deskjs=require(_0x24ad('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x24ad('0x10'));var authService=require(_0x24ad('0x11'));var qs=require(_0x24ad('0x12'));var as=require(_0x24ad('0x13'));var hardwareService=require(_0x24ad('0x14'));var logger=require(_0x24ad('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x24ad('0x16'));var licenseUtil=require(_0x24ad('0x17'));var db=require(_0x24ad('0x18'))['db'];function respondWithStatusCode(_0x3c81a9,_0xf47403){_0xf47403=_0xf47403||0xcc;return function(_0x52b241){if(_0x52b241){return _0x3c81a9[_0x24ad('0x19')](_0xf47403);}return _0x3c81a9[_0x24ad('0x1a')](_0xf47403)[_0x24ad('0x1b')]();};}function respondWithResult(_0x87d673,_0x50c1f3){_0x50c1f3=_0x50c1f3||0xc8;return function(_0x12a19f){if(_0x12a19f){return _0x87d673[_0x24ad('0x1a')](_0x50c1f3)[_0x24ad('0x1c')](_0x12a19f);}};}function respondWithFilteredResult(_0xc9ce49,_0x5e772c){return function(_0x4d3e2c){if(_0x4d3e2c){var _0x578c6d=typeof _0x5e772c[_0x24ad('0x1d')]===_0x24ad('0x1e')&&typeof _0x5e772c[_0x24ad('0x1f')]===_0x24ad('0x1e');var _0x1dacff=_0x4d3e2c[_0x24ad('0x20')];var _0x2f0917=_0x578c6d?0x0:_0x5e772c[_0x24ad('0x1d')];var _0x425442=_0x578c6d?_0x4d3e2c[_0x24ad('0x20')]:_0x5e772c['offset']+_0x5e772c[_0x24ad('0x1f')];var _0x5b88c7;if(_0x425442>=_0x1dacff){_0x425442=_0x1dacff;_0x5b88c7=0xc8;}else{_0x5b88c7=0xce;}_0xc9ce49[_0x24ad('0x1a')](_0x5b88c7);return _0xc9ce49[_0x24ad('0x21')]('Content-Range',_0x2f0917+'-'+_0x425442+'/'+_0x1dacff)[_0x24ad('0x1c')](_0x4d3e2c);}return null;};}function patchUpdates(_0x19f890){return function(_0x36a015){try{jsonpatch[_0x24ad('0x22')](_0x36a015,_0x19f890,!![]);}catch(_0x35d43c){return BPromise[_0x24ad('0x23')](_0x35d43c);}return _0x36a015[_0x24ad('0x24')]();};}function saveUpdates(_0x2bfcda,_0xb1c2e0){return function(_0x3d6ee1){if(_0x3d6ee1){return _0x3d6ee1[_0x24ad('0x25')](_0x2bfcda)[_0x24ad('0x26')](function(_0x1c3efb){return _0x1c3efb;});}return null;};}function removeEntity(_0x15dfaf,_0x280d5f){return function(_0x31f629){if(_0x31f629){return _0x31f629['destroy']()[_0x24ad('0x26')](function(){_0x15dfaf['status'](0xcc)[_0x24ad('0x1b')]();});}};}function handleEntityNotFound(_0x4e63a8,_0x64e2eb){return function(_0x128f67){if(!_0x128f67){_0x4e63a8[_0x24ad('0x19')](0x194);}return _0x128f67;};}function handleError(_0x579540,_0x17beca){_0x17beca=_0x17beca||0x1f4;return function(_0xd14f9b){logger['error'](_0xd14f9b[_0x24ad('0x27')]);if(_0xd14f9b[_0x24ad('0x28')]){delete _0xd14f9b['name'];}_0x579540[_0x24ad('0x1a')](_0x17beca)[_0x24ad('0x29')](_0xd14f9b);};}exports[_0x24ad('0x2a')]=function(_0x3b36cf,_0x55ec4e){var _0xb849ef={},_0x393004={},_0x20a51f={'count':0x0,'rows':[]};var _0x52dcb3=_['map'](db['ChatTransferReport'][_0x24ad('0x2b')],function(_0x3e75ca){return{'name':_0x3e75ca['fieldName'],'type':_0x3e75ca[_0x24ad('0x2c')][_0x24ad('0x2d')]};});_0x393004['model']=_['map'](_0x52dcb3,'name');_0x393004[_0x24ad('0x2e')]=_[_0x24ad('0x2f')](_0x3b36cf[_0x24ad('0x2e')]);_0x393004[_0x24ad('0x30')]=_[_0x24ad('0x31')](_0x393004['model'],_0x393004[_0x24ad('0x2e')]);_0xb849ef[_0x24ad('0x32')]=_[_0x24ad('0x31')](_0x393004['model'],qs['fields'](_0x3b36cf[_0x24ad('0x2e')][_0x24ad('0x33')]));_0xb849ef[_0x24ad('0x32')]=_0xb849ef[_0x24ad('0x32')][_0x24ad('0x34')]?_0xb849ef['attributes']:_0x393004[_0x24ad('0x35')];if(!_0x3b36cf['query'][_0x24ad('0x36')](_0x24ad('0x37'))){_0xb849ef[_0x24ad('0x1f')]=qs[_0x24ad('0x1f')](_0x3b36cf[_0x24ad('0x2e')][_0x24ad('0x1f')]);_0xb849ef[_0x24ad('0x1d')]=qs[_0x24ad('0x1d')](_0x3b36cf[_0x24ad('0x2e')][_0x24ad('0x1d')]);}_0xb849ef[_0x24ad('0x38')]=qs[_0x24ad('0x39')](_0x3b36cf[_0x24ad('0x2e')][_0x24ad('0x39')]);_0xb849ef['where']=qs[_0x24ad('0x30')](_[_0x24ad('0x3a')](_0x3b36cf[_0x24ad('0x2e')],_0x393004[_0x24ad('0x30')]),_0x52dcb3);if(_0x3b36cf[_0x24ad('0x2e')][_0x24ad('0x3b')]){_0xb849ef[_0x24ad('0x3c')]=_[_0x24ad('0x3d')](_0xb849ef['where'],{'$or':_[_0x24ad('0x3e')](_0x52dcb3,function(_0x438082){if(_0x438082['type']!==_0x24ad('0x3f')){var _0x32f6f8={};_0x32f6f8[_0x438082[_0x24ad('0x28')]]={'$like':'%'+_0x3b36cf[_0x24ad('0x2e')][_0x24ad('0x3b')]+'%'};return _0x32f6f8;}})});}_0xb849ef=_[_0x24ad('0x3d')]({},_0xb849ef,_0x3b36cf['options']);var _0x5f000c={'where':_0xb849ef[_0x24ad('0x3c')]};return db[_0x24ad('0x40')]['count'](_0x5f000c)[_0x24ad('0x26')](function(_0x50da38){_0x20a51f[_0x24ad('0x20')]=_0x50da38;if(_0x3b36cf[_0x24ad('0x2e')][_0x24ad('0x41')]){_0xb849ef[_0x24ad('0x42')]=[{'all':!![]}];}return db[_0x24ad('0x40')][_0x24ad('0x43')](_0xb849ef);})['then'](function(_0x1e13f6){_0x20a51f[_0x24ad('0x44')]=_0x1e13f6;return _0x20a51f;})['then'](respondWithFilteredResult(_0x55ec4e,_0xb849ef))[_0x24ad('0x45')](handleError(_0x55ec4e,null));};exports[_0x24ad('0x46')]=function(_0x36cb56,_0x112d50){var _0x1ca49d={'raw':!![],'where':{'id':_0x36cb56[_0x24ad('0x47')]['id']}},_0x617083={};_0x617083[_0x24ad('0x35')]=_[_0x24ad('0x2f')](db[_0x24ad('0x40')]['rawAttributes']);_0x617083[_0x24ad('0x2e')]=_[_0x24ad('0x2f')](_0x36cb56[_0x24ad('0x2e')]);_0x617083[_0x24ad('0x30')]=_['intersection'](_0x617083[_0x24ad('0x35')],_0x617083[_0x24ad('0x2e')]);_0x1ca49d[_0x24ad('0x32')]=_[_0x24ad('0x31')](_0x617083[_0x24ad('0x35')],qs[_0x24ad('0x33')](_0x36cb56['query'][_0x24ad('0x33')]));_0x1ca49d[_0x24ad('0x32')]=_0x1ca49d[_0x24ad('0x32')][_0x24ad('0x34')]?_0x1ca49d[_0x24ad('0x32')]:_0x617083['model'];if(_0x36cb56[_0x24ad('0x2e')][_0x24ad('0x41')]){_0x1ca49d[_0x24ad('0x42')]=[{'all':!![]}];}_0x1ca49d=_[_0x24ad('0x3d')]({},_0x1ca49d,_0x36cb56['options']);return db[_0x24ad('0x40')][_0x24ad('0x48')](_0x1ca49d)[_0x24ad('0x26')](handleEntityNotFound(_0x112d50,null))[_0x24ad('0x26')](respondWithResult(_0x112d50,null))[_0x24ad('0x45')](handleError(_0x112d50,null));};exports[_0x24ad('0x49')]=function(_0x67db25,_0x48167c){return db['ChatTransferReport'][_0x24ad('0x49')](_0x67db25[_0x24ad('0x4a')],{})[_0x24ad('0x26')](respondWithResult(_0x48167c,0xc9))['catch'](handleError(_0x48167c,null));};exports[_0x24ad('0x25')]=function(_0x515ee1,_0x20b1c2){if(_0x515ee1[_0x24ad('0x4a')]['id']){delete _0x515ee1[_0x24ad('0x4a')]['id'];}return db[_0x24ad('0x40')][_0x24ad('0x48')]({'where':{'id':_0x515ee1[_0x24ad('0x47')]['id']}})[_0x24ad('0x26')](handleEntityNotFound(_0x20b1c2,null))[_0x24ad('0x26')](saveUpdates(_0x515ee1[_0x24ad('0x4a')],null))[_0x24ad('0x26')](respondWithResult(_0x20b1c2,null))[_0x24ad('0x45')](handleError(_0x20b1c2,null));};exports[_0x24ad('0x4b')]=function(_0x38c0f8,_0x52faa5){return db[_0x24ad('0x40')]['find']({'where':{'id':_0x38c0f8[_0x24ad('0x47')]['id']}})['then'](handleEntityNotFound(_0x52faa5,null))['then'](removeEntity(_0x52faa5,null))[_0x24ad('0x45')](handleError(_0x52faa5,null));};exports['describe']=function(_0x4cd728,_0x1a71a7){return db[_0x24ad('0x40')][_0x24ad('0x4c')]()[_0x24ad('0x26')](respondWithResult(_0x1a71a7,null))[_0x24ad('0x45')](handleError(_0x1a71a7,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 3e69661..d2d4727 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 _0x347c=['ChatTransferReport','uniqueid','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0x2d67b4,_0x4ca8fe){var _0x4cd582=function(_0x21180a){while(--_0x21180a){_0x2d67b4['push'](_0x2d67b4['shift']());}};_0x4cd582(++_0x4ca8fe);}(_0x347c,0x16a));var _0xc347=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x347c[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xc347('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc347('0x1'));var moment=require(_0xc347('0x2'));var BPromise=require('bluebird');var rp=require(_0xc347('0x3'));var fs=require('fs');var path=require(_0xc347('0x4'));var rimraf=require(_0xc347('0x5'));var config=require(_0xc347('0x6'));var attributes=require(_0xc347('0x7'));module[_0xc347('0x8')]=function(_0x423426,_0x503779){return _0x423426[_0xc347('0x9')](_0xc347('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xc347('0xb'),'fields':[_0xc347('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b2d=['../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x31dbc2,_0x38fb3c){var _0x22eb5c=function(_0x5b63bf){while(--_0x5b63bf){_0x31dbc2['push'](_0x31dbc2['shift']());}};_0x22eb5c(++_0x38fb3c);}(_0x6b2d,0x18d));var _0xd6b2=function(_0x1ff19c,_0xd5d1c7){_0x1ff19c=_0x1ff19c-0x0;var _0x475fd4=_0x6b2d[_0x1ff19c];return _0x475fd4;};'use strict';var _=require(_0xd6b2('0x0'));var util=require(_0xd6b2('0x1'));var logger=require(_0xd6b2('0x2'))(_0xd6b2('0x3'));var moment=require(_0xd6b2('0x4'));var BPromise=require(_0xd6b2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6b2('0x6'));var rimraf=require(_0xd6b2('0x7'));var config=require(_0xd6b2('0x8'));var attributes=require(_0xd6b2('0x9'));module[_0xd6b2('0xa')]=function(_0x5a04d6,_0x34ce21){return _0x5a04d6[_0xd6b2('0xb')](_0xd6b2('0xc'),attributes,{'tableName':_0xd6b2('0xd'),'paranoid':![],'indexes':[{'name':_0xd6b2('0xe'),'fields':[_0xd6b2('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 55bd851..87a19fd 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 _0x6c0f=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x7ad123,_0xeeeef3){var _0x37d073=function(_0x51367b){while(--_0x51367b){_0x7ad123['push'](_0x7ad123['shift']());}};_0x37d073(++_0xeeeef3);}(_0x6c0f,0x15c));var _0xf6c0=function(_0x5d6a08,_0x5f3a16){_0x5d6a08=_0x5d6a08-0x0;var _0x1f9acc=_0x6c0f[_0x5d6a08];return _0x1f9acc;};'use strict';var _=require(_0xf6c0('0x0'));var util=require('util');var moment=require(_0xf6c0('0x1'));var BPromise=require('bluebird');var rs=require(_0xf6c0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6c0('0x3'))['db'];var utils=require(_0xf6c0('0x4'));var logger=require('../../config/logger')(_0xf6c0('0x5'));var config=require(_0xf6c0('0x6'));var jayson=require(_0xf6c0('0x7'));var client=jayson[_0xf6c0('0x8')][_0xf6c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41eef1,_0x4dbf84,_0x156324){return new BPromise(function(_0x4fe409,_0x105926){return client[_0xf6c0('0xa')](_0x41eef1,_0x156324)[_0xf6c0('0xb')](function(_0x30ec9b){logger[_0xf6c0('0xc')](_0xf6c0('0xd'),_0x4dbf84,_0xf6c0('0xe'));logger[_0xf6c0('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4dbf84,_0xf6c0('0xe'),JSON[_0xf6c0('0x10')](_0x30ec9b));if(_0x30ec9b[_0xf6c0('0x11')]){if(_0x30ec9b[_0xf6c0('0x11')]['code']===0x1f4){logger[_0xf6c0('0x11')](_0xf6c0('0xd'),_0x4dbf84,_0x30ec9b['error'][_0xf6c0('0x12')]);return _0x105926(_0x30ec9b[_0xf6c0('0x11')][_0xf6c0('0x12')]);}logger['error'](_0xf6c0('0xd'),_0x4dbf84,_0x30ec9b[_0xf6c0('0x11')][_0xf6c0('0x12')]);return _0x4fe409(_0x30ec9b['error'][_0xf6c0('0x12')]);}else{logger[_0xf6c0('0xc')](_0xf6c0('0xd'),_0x4dbf84,_0xf6c0('0xe'));_0x4fe409(_0x30ec9b[_0xf6c0('0x13')]['message']);}})['catch'](function(_0x518eff){logger['error'](_0xf6c0('0xd'),_0x4dbf84,_0x518eff);_0x105926(_0x518eff);});});}
\ No newline at end of file
+var _0x0f87=['../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','ioredis'];(function(_0x1341a6,_0x23816a){var _0x37658e=function(_0xbe0a4d){while(--_0xbe0a4d){_0x1341a6['push'](_0x1341a6['shift']());}};_0x37658e(++_0x23816a);}(_0x0f87,0x97));var _0x70f8=function(_0x566fca,_0x2a0a1c){_0x566fca=_0x566fca-0x0;var _0x38e666=_0x0f87[_0x566fca];return _0x38e666;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x70f8('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70f8('0x1'));var db=require(_0x70f8('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x70f8('0x3'))('rpc');var config=require(_0x70f8('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x70f8('0x5')][_0x70f8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x13db1a,_0x54f704,_0x5c84dd){return new BPromise(function(_0x405bf7,_0x208e2c){return client[_0x70f8('0x7')](_0x13db1a,_0x5c84dd)['then'](function(_0x5629aa){logger[_0x70f8('0x8')](_0x70f8('0x9'),_0x54f704,_0x70f8('0xa'));logger['debug'](_0x70f8('0xb'),_0x54f704,_0x70f8('0xa'),JSON[_0x70f8('0xc')](_0x5629aa));if(_0x5629aa[_0x70f8('0xd')]){if(_0x5629aa[_0x70f8('0xd')][_0x70f8('0xe')]===0x1f4){logger['error'](_0x70f8('0x9'),_0x54f704,_0x5629aa[_0x70f8('0xd')][_0x70f8('0xf')]);return _0x208e2c(_0x5629aa['error'][_0x70f8('0xf')]);}logger[_0x70f8('0xd')](_0x70f8('0x9'),_0x54f704,_0x5629aa[_0x70f8('0xd')][_0x70f8('0xf')]);return _0x405bf7(_0x5629aa['error'][_0x70f8('0xf')]);}else{logger[_0x70f8('0x8')](_0x70f8('0x9'),_0x54f704,_0x70f8('0xa'));_0x405bf7(_0x5629aa['result']['message']);}})[_0x70f8('0x10')](function(_0x13499e){logger['error'](_0x70f8('0x9'),_0x54f704,_0x13499e);_0x208e2c(_0x13499e);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 53df50e..88a553b 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 _0x502b=['put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x1a5e46,_0x39c459){var _0x2edd08=function(_0x21e7b9){while(--_0x21e7b9){_0x1a5e46['push'](_0x1a5e46['shift']());}};_0x2edd08(++_0x39c459);}(_0x502b,0xdf));var _0xb502=function(_0x1a5946,_0x426991){_0x1a5946=_0x1a5946-0x0;var _0x25e9d5=_0x502b[_0x1a5946];return _0x25e9d5;};'use strict';var multer=require(_0xb502('0x0'));var util=require(_0xb502('0x1'));var path=require(_0xb502('0x2'));var timeout=require(_0xb502('0x3'));var express=require(_0xb502('0x4'));var router=express[_0xb502('0x5')]();var fs_extra=require(_0xb502('0x6'));var auth=require(_0xb502('0x7'));var interaction=require(_0xb502('0x8'));var config=require('../../config/environment');var controller=require(_0xb502('0x9'));router[_0xb502('0xa')]('/',auth['isAuthenticated'](),controller[_0xb502('0xb')]);router[_0xb502('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xb502('0xc'),auth[_0xb502('0xd')](),controller[_0xb502('0xe')]);router[_0xb502('0xf')]('/',auth[_0xb502('0xd')](),controller[_0xb502('0x10')]);router[_0xb502('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb502('0x12')]);router[_0xb502('0x13')](_0xb502('0xc'),auth[_0xb502('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xa5be=['express','Router','fs-extra','../../components/auth/service','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','update','delete','exports','multer','util','connect-timeout'];(function(_0x56964b,_0x57ebf7){var _0x1b348f=function(_0x26cc10){while(--_0x26cc10){_0x56964b['push'](_0x56964b['shift']());}};_0x1b348f(++_0x57ebf7);}(_0xa5be,0x1bf));var _0xea5b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa5be[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0xea5b('0x0'));var util=require(_0xea5b('0x1'));var path=require('path');var timeout=require(_0xea5b('0x2'));var express=require(_0xea5b('0x3'));var router=express[_0xea5b('0x4')]();var fs_extra=require(_0xea5b('0x5'));var auth=require(_0xea5b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xea5b('0x7'));router[_0xea5b('0x8')]('/',auth[_0xea5b('0x9')](),controller['index']);router[_0xea5b('0x8')](_0xea5b('0xa'),auth[_0xea5b('0x9')](),controller[_0xea5b('0xb')]);router[_0xea5b('0x8')](_0xea5b('0xc'),auth[_0xea5b('0x9')](),controller['show']);router[_0xea5b('0xd')]('/',auth['isAuthenticated'](),controller[_0xea5b('0xe')]);router['put'](_0xea5b('0xc'),auth[_0xea5b('0x9')](),controller[_0xea5b('0xf')]);router[_0xea5b('0x10')]('/:id',auth[_0xea5b('0x9')](),controller['destroy']);module[_0xea5b('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 8bde91e..033ed73 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 _0xddfb=['STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','input','name','getDataValue','parse','onlineForm','setDataValue','stringify','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:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports'];(function(_0x77fd25,_0x226ea2){var _0xe14528=function(_0x1551d5){while(--_0x1551d5){_0x77fd25['push'](_0x77fd25['shift']());}};_0xe14528(++_0x226ea2);}(_0xddfb,0x101));var _0xbddf=function(_0x4b2d73,_0x57f61f){_0x4b2d73=_0x4b2d73-0x0;var _0x590b2c=_0xddfb[_0x4b2d73];return _0x590b2c;};'use strict';var Sequelize=require(_0xbddf('0x0'));var rs=require(_0xbddf('0x1'));module[_0xbddf('0x2')]={'name':{'type':Sequelize[_0xbddf('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xbddf('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xbddf('0x3')]},'mapKey':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x4')},'mapKeyOffline':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xbddf('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x5')},'customerAlias':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xbddf('0x3')],'allowNull':![],'defaultValue':_0xbddf('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbddf('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbddf('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbddf('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbddf('0x3')]},'animation':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbddf('0xa')](_0xbddf('0xb'),'squared'),'defaultValue':_0xbddf('0xb')},'header_online':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0xd')},'header_offline':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0xe')},'download_transcript':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbddf('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xbddf('0xf')]},'closingQuestion':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x13')},'closingMessage':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x14')},'closingMessageButton':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0xd')},'skipMessageButton':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x15')},'conditionAgreement':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xbddf('0xa')](_0xbddf('0x16'),_0xbddf('0x17')),'defaultValue':_0xbddf('0x16')},'ratingStarsNumber':{'type':Sequelize[_0xbddf('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbddf('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xbddf('0x18'),'variable':null,'config':{'placeholder':_0xbddf('0x19'),'type':'text','required':!![]},'props':{'title':_0xbddf('0x19'),'helpText':''}},{'type':_0xbddf('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbddf('0x4'),'type':_0xbddf('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xbddf('0x1a')]('onlineForm')?JSON[_0xbddf('0x1b')](this['getDataValue'](_0xbddf('0x1c'))):{};},'set':function(_0x267db7){return this[_0xbddf('0x1d')](_0xbddf('0x1c'),JSON[_0xbddf('0x1e')](_0x267db7));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xbddf('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbddf('0x4'),'type':_0xbddf('0x4')},'variable':null},{'type':_0xbddf('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0xbddf('0x20'),'helpText':_0xbddf('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xbddf('0x1a')](_0xbddf('0x22'))?JSON['parse'](this[_0xbddf('0x1a')](_0xbddf('0x22'))):{};},'set':function(_0x7668de){return this[_0xbddf('0x1d')](_0xbddf('0x22'),JSON[_0xbddf('0x1e')](_0x7668de));}},'token':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbddf('0x3')]},'forwardOffline':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbddf('0x3')]},'waitingTitle':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x24')},'offlineMessageSubject':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x25')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x27')},'skipUnmanaged':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x15')},'sendUnmanaged':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbddf('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xbddf('0xf')],'defaultValue':function(){return _0xbddf('0x28');}},'notificationSound':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xbddf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xbddf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x2b')},'messagesAlignment':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbddf('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbddf('0x3')],'allowNull':![],'defaultValue':_0xbddf('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbddf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x2e')},'systemAvatar':{'type':Sequelize[_0xbddf('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbddf('0x8')],'comment':_0xbddf('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![],'comment':_0xbddf('0x30'),'set':function(_0x5ef7c6){if(!_0x5ef7c6)this[_0xbddf('0x1d')](_0xbddf('0x31'),null);this[_0xbddf('0x1d')](_0xbddf('0x32'),_0x5ef7c6);}},'vidaooEscalation':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbddf('0x3')]},'vidaooTopic':{'type':Sequelize[_0xbddf('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':function(){return _0xbddf('0x33');}},'vidaooMetadata':{'type':Sequelize[_0xbddf('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x987c=['Skip','Feedback','thumb','star','TEXT','stringify','input','name','text','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','ENUM','squared','rounded','We\x20are\x20here!','Send','INTEGER','Powered\x20by\x20xCALLY','BOOLEAN','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x124a1e,_0x5d61be){var _0x15bc7a=function(_0x178bf1){while(--_0x178bf1){_0x124a1e['push'](_0x124a1e['shift']());}};_0x15bc7a(++_0x5d61be);}(_0x987c,0x144));var _0xc987=function(_0x4367d3,_0x4d531a){_0x4367d3=_0x4367d3-0x0;var _0x2d75b1=_0x987c[_0x4367d3];return _0x2d75b1;};'use strict';var Sequelize=require(_0xc987('0x0'));var rs=require(_0xc987('0x1'));module[_0xc987('0x2')]={'name':{'type':Sequelize[_0xc987('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc987('0x4')},'description':{'type':Sequelize[_0xc987('0x3')]},'mapKey':{'type':Sequelize[_0xc987('0x3')],'defaultValue':_0xc987('0x5')},'mapKeyOffline':{'type':Sequelize[_0xc987('0x3')],'defaultValue':_0xc987('0x5')},'key':{'type':Sequelize[_0xc987('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xc987('0x3')],'defaultValue':_0xc987('0x6')},'customerAlias':{'type':Sequelize[_0xc987('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xc987('0x3')],'allowNull':![],'defaultValue':_0xc987('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xc987('0x3')],'allowNull':![],'defaultValue':_0xc987('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xc987('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xc987('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xc987('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xc987('0x8')]('rounded',_0xc987('0x9')),'defaultValue':_0xc987('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xc987('0xb')},'start_chat_button':{'type':Sequelize[_0xc987('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xc987('0x3')],'defaultValue':_0xc987('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xc987('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xc987('0x3')],'defaultValue':_0xc987('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xc987('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xc987('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xc987('0x3')],'defaultValue':_0xc987('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xc987('0x3')],'defaultValue':_0xc987('0x11')},'noteTitle':{'type':Sequelize[_0xc987('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xc987('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xc987('0x3')],'defaultValue':_0xc987('0x12')},'closingMessageButton':{'type':Sequelize[_0xc987('0x3')],'defaultValue':_0xc987('0xc')},'skipMessageButton':{'type':Sequelize[_0xc987('0x3')],'defaultValue':_0xc987('0x13')},'conditionAgreement':{'type':Sequelize[_0xc987('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xc987('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xc987('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xc987('0x3')],'defaultValue':_0xc987('0x14')},'ratingType':{'type':Sequelize[_0xc987('0x8')]('star',_0xc987('0x15')),'defaultValue':_0xc987('0x16')},'ratingStarsNumber':{'type':Sequelize[_0xc987('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xc987('0x17')],'defaultValue':function(){return JSON[_0xc987('0x18')]({'items':[{'type':_0xc987('0x19'),'variable':null,'config':{'placeholder':_0xc987('0x1a'),'type':_0xc987('0x1b'),'required':!![]},'props':{'title':_0xc987('0x1a'),'helpText':''}},{'type':_0xc987('0x19'),'props':{'title':_0xc987('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xc987('0x5'),'type':_0xc987('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xc987('0x1c'))?JSON[_0xc987('0x1d')](this[_0xc987('0x1e')]('onlineForm')):{};},'set':function(_0x23859a){return this[_0xc987('0x1f')](_0xc987('0x1c'),JSON[_0xc987('0x18')](_0x23859a));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xc987('0x18')]({'items':[{'type':_0xc987('0x19'),'props':{'title':_0xc987('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xc987('0x5'),'type':_0xc987('0x5')},'variable':null},{'type':_0xc987('0x20'),'config':{'placeholder':'Comments'},'props':{'title':_0xc987('0x21'),'helpText':_0xc987('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xc987('0x1e')]('offlineForm')?JSON[_0xc987('0x1d')](this[_0xc987('0x1e')](_0xc987('0x23'))):{};},'set':function(_0x4ac230){return this[_0xc987('0x1f')](_0xc987('0x23'),JSON[_0xc987('0x18')](_0x4ac230));}},'token':{'type':Sequelize[_0xc987('0x3')],'defaultValue':function(){return rs[_0xc987('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xc987('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xc987('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xc987('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xc987('0x3')]},'waitingTitle':{'type':Sequelize[_0xc987('0x3')],'defaultValue':_0xc987('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xc987('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xc987('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xc987('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xc987('0x13')},'sendUnmanaged':{'type':Sequelize[_0xc987('0x3')],'defaultValue':_0xc987('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xc987('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xc987('0x17')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xc987('0x3')]},'notificationTemplate':{'type':Sequelize[_0xc987('0x17')],'defaultValue':function(){return _0xc987('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xc987('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xc987('0x3')],'defaultValue':_0xc987('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0xc987('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc987('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xc987('0x29')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xc987('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xc987('0x2a')},'defaultTitle':{'type':Sequelize[_0xc987('0x3')]},'customerAvatar':{'type':Sequelize[_0xc987('0x17')]},'showCustomerAvatar':{'type':Sequelize[_0xc987('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xc987('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xc987('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xc987('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc987('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc987('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc987('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xc987('0x3')],'defaultValue':_0xc987('0x2b')},'systemAvatar':{'type':Sequelize[_0xc987('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xc987('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc987('0x2d'),'set':function(_0x3791a5){if(!_0x3791a5)this[_0xc987('0x1f')](_0xc987('0x2e'),null);this['setDataValue'](_0xc987('0x2f'),_0x3791a5);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xc987('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xc987('0x30');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xc987('0xf')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xc987('0x17')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 02c4609..a4989fb 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 _0x2123=['offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','findOne','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','notifyMail','server','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','getSnippet','getProactiveActions','virtual','License','increment','server/files/chat/iframe.ejs','3.10.1','origin','testWebsiteWithWildcard','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','offlineForm','items','fromKey','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','url','URL','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','debug','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','update','get','ChatWebsites','UserProfileResource','destroy','end','name','send','user-agent-parser','user-agent','getResult','customerIp','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','model','device','vendor','%s\x20%s\x20%s','type','index','mandatoryDispositionPause','map','rawAttributes','fieldName','query','keys','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','ChatWebsite','includeAll','include','findAll','show','Pause','intersection','find','create','body','address','forEach','trim','testWildcardValidity','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','params','describe','ChatWebsiteId','Disposition','getDispositions','length','pick','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','filename','addAvatar','agentAvatar','file','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','root','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','notify','chat','from','MapKey\x20is\x20mandatory','Body\x20is\x20mandatory','createdAt','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','mapKey','CmList','List','CmContact','ChatApplication','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','applications','orderBy','Applications','priority','asc','account','list','Contacts','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','unshift','waitForTheAssignedQueue','Start','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype'];(function(_0x3d1ed2,_0x4975c3){var _0x39b31c=function(_0x23630c){while(--_0x23630c){_0x3d1ed2['push'](_0x3d1ed2['shift']());}};_0x39b31c(++_0x4975c3);}(_0x2123,0x190));var _0x3212=function(_0x115e68,_0x26a20a){_0x115e68=_0x115e68-0x0;var _0x1510be=_0x2123[_0x115e68];return _0x1510be;};'use strict';var Mustache=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var path=require(_0x3212('0x2'));var ejs=require(_0x3212('0x3'));var fs=require('fs');var fs_extra=require(_0x3212('0x4'));var _=require(_0x3212('0x5'));var querystring=require(_0x3212('0x6'));var htmlToText=require(_0x3212('0x7'));var Redis=require(_0x3212('0x8'));var jayson=require(_0x3212('0x9'));var qs=require(_0x3212('0xa'));var logger=require(_0x3212('0xb'))('api');var config=require(_0x3212('0xc'));var APIBadRequestError=require(_0x3212('0xd'))[_0x3212('0xe')];var APINotFoundError=require('../../errors/api')[_0x3212('0xf')];var APIOutOfIntervalError=require('../../errors/api')[_0x3212('0x10')];var APIHandleError=require(_0x3212('0xd'))[_0x3212('0x11')];var APIConflictError=require(_0x3212('0xd'))['APIConflictError'];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require(_0x3212('0x12'))[_0x3212('0x13')];var db=require(_0x3212('0x14'))['db'];config[_0x3212('0x15')]=_[_0x3212('0x16')](config[_0x3212('0x15')],{'host':_0x3212('0x17'),'port':0x18eb});var socket=require(_0x3212('0x18'))(new Redis(config[_0x3212('0x15')]));require(_0x3212('0x19'))[_0x3212('0x1a')](socket);var client=jayson[_0x3212('0x1b')][_0x3212('0x1c')]({'port':0x232c});var client9002=jayson[_0x3212('0x1b')][_0x3212('0x1c')]({'port':0x232a});var client9003=jayson[_0x3212('0x1b')][_0x3212('0x1c')]({'port':0x232b});var client9001=jayson[_0x3212('0x1b')][_0x3212('0x1c')]({'port':0x2329});function respondWithRpcPromise(_0x46c5f5,_0x42069c,_0x1ef2f7,_0x5b2ab8){return new Promise(function(_0x43a642,_0x1719a5){var _0x2720c6=_0x5b2ab8||client;return _0x2720c6[_0x3212('0x1d')](_0x46c5f5,_0x1ef2f7)[_0x3212('0x1e')](function(_0x34ce95){logger[_0x3212('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x42069c,'request\x20sent');logger[_0x3212('0x20')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x42069c,_0x3212('0x21'),JSON[_0x3212('0x22')](_0x34ce95));if(_0x34ce95[_0x3212('0x23')]){if(_0x34ce95[_0x3212('0x23')][_0x3212('0x24')]===0x1f4){logger['error'](_0x3212('0x25'),_0x42069c,_0x34ce95[_0x3212('0x23')]['message']);return _0x1719a5(_0x34ce95[_0x3212('0x23')][_0x3212('0x26')]);}logger[_0x3212('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x42069c,_0x34ce95['error'][_0x3212('0x26')]);return _0x43a642(_0x34ce95[_0x3212('0x23')][_0x3212('0x26')]);}else{logger[_0x3212('0x1f')](_0x3212('0x25'),_0x42069c,_0x3212('0x21'));_0x43a642(_0x34ce95['result']['message']);}})[_0x3212('0x27')](function(_0x47cfdc){logger[_0x3212('0x23')](_0x3212('0x25'),_0x42069c,_0x47cfdc);_0x1719a5(_0x47cfdc);});});}function respondWithStatusCode(_0x3319d0,_0x5bb0a5){_0x5bb0a5=_0x5bb0a5||0xcc;return function(_0x2d1b92){if(_0x2d1b92){return _0x3319d0[_0x3212('0x28')](_0x5bb0a5);}return _0x3319d0[_0x3212('0x29')](_0x5bb0a5)['end']();};}function respondWithResult(_0x206980,_0x35b4eb){_0x35b4eb=_0x35b4eb||0xc8;return function(_0x108eee){if(_0x108eee){return _0x206980[_0x3212('0x29')](_0x35b4eb)[_0x3212('0x2a')](_0x108eee);}};}function respondWithFilteredResult(_0x1638c5,_0x16df03){return function(_0x3813a3){if(_0x3813a3){var _0x1de338=typeof _0x16df03[_0x3212('0x2b')]===_0x3212('0x2c')&&typeof _0x16df03[_0x3212('0x2d')]==='undefined';var _0x1e2660=_0x3813a3[_0x3212('0x2e')];var _0x4726fb=_0x1de338?0x0:_0x16df03[_0x3212('0x2b')];var _0x402a01=_0x1de338?_0x3813a3[_0x3212('0x2e')]:_0x16df03[_0x3212('0x2b')]+_0x16df03['limit'];var _0x3cbd1a;if(_0x402a01>=_0x1e2660){_0x402a01=_0x1e2660;_0x3cbd1a=0xc8;}else{_0x3cbd1a=0xce;}_0x1638c5['status'](_0x3cbd1a);return _0x1638c5[_0x3212('0x2f')]('Content-Range',_0x4726fb+'-'+_0x402a01+'/'+_0x1e2660)[_0x3212('0x2a')](_0x3813a3);}return null;};}function saveUpdates(_0x4ddc8f){return function(_0x4d17bb){if(_0x4d17bb){return _0x4d17bb[_0x3212('0x30')](_0x4ddc8f)['then'](function(_0x294422){return _0x294422;});}return null;};}function removeEntity(_0x3754ce){return function(_0x2c664b){if(_0x2c664b){return _0x2c664b['destroy']()[_0x3212('0x1e')](function(){var _0x412740=_0x2c664b[_0x3212('0x31')]({'plain':!![]});var _0x487ce4=_0x3212('0x32');return db[_0x3212('0x33')][_0x3212('0x34')]({'where':{'type':_0x487ce4,'resourceId':_0x412740['id']}})[_0x3212('0x1e')](function(){return _0x2c664b;});})[_0x3212('0x1e')](function(){_0x3754ce['status'](0xcc)[_0x3212('0x35')]();});}};}function handleEntityNotFound(_0x3fc885){return function(_0x422b7b){if(!_0x422b7b){_0x3fc885['sendStatus'](0x194);}return _0x422b7b;};}function handleError(_0x42f481,_0x410961){_0x410961=_0x410961||0x1f4;return function(_0x40a602){logger[_0x3212('0x23')](_0x40a602['stack']);if(_0x40a602[_0x3212('0x36')]){delete _0x40a602[_0x3212('0x36')];}_0x42f481[_0x3212('0x29')](_0x410961)[_0x3212('0x37')](_0x40a602);};}function createInteractionObject(_0x5ae0cc,_0x4e5349,_0x539b7a,_0x540dfc){var _0xb2908a=require(_0x3212('0x38'));var _0x3f8018=new _0xb2908a();var _0x87587d=_0x3f8018['setUA'](_0x539b7a[_0x3212('0x39')])[_0x3212('0x3a')]();var _0x18e20=_0x4e5349[_0x3212('0x3b')];if(_0x539b7a['cf-connecting-ip']){_0x18e20=_0x539b7a['cf-connecting-ip'];}else if(_0x539b7a[_0x3212('0x3c')]){_0x18e20=_[_0x3212('0x3d')](_0x539b7a[_0x3212('0x3c')][_0x3212('0x3e')](','));}return{'ContactId':_0x540dfc['id'],'ChatWebsiteId':_0x5ae0cc,'from':(_0x540dfc[_0x3212('0x3f')]||'')+'\x20'+(_0x540dfc[_0x3212('0x40')]||''),'customerIp':_0x18e20,'customerPort':_0x539b7a[_0x3212('0x41')]?_0x539b7a['x-real-port']:null,'referer':_0x4e5349[_0x3212('0x42')],'browserName':_0x87587d[_0x3212('0x43')][_0x3212('0x36')]&&_0x87587d[_0x3212('0x43')]['version']?util[_0x3212('0x44')](_0x3212('0x45'),_0x87587d[_0x3212('0x43')][_0x3212('0x36')],_0x87587d['browser'][_0x3212('0x46')]):'unknown','browserVersion':_0x87587d[_0x3212('0x43')][_0x3212('0x46')]||_0x3212('0x47'),'osName':util[_0x3212('0x44')](_0x3212('0x45'),_0x87587d['os'][_0x3212('0x36')],_0x87587d['os'][_0x3212('0x46')]),'osVersion':_0x87587d['os'][_0x3212('0x46')],'deviceModel':_0x87587d['device'][_0x3212('0x48')]&&_0x87587d[_0x3212('0x49')][_0x3212('0x4a')]?util[_0x3212('0x44')](_0x3212('0x4b'),_0x87587d[_0x3212('0x49')][_0x3212('0x48')],_0x87587d['device'][_0x3212('0x4a')],_0x87587d[_0x3212('0x49')][_0x3212('0x4c')]):null,'deviceVendor':_0x87587d[_0x3212('0x49')]['vendor'],'deviceType':_0x87587d['device']['type'],'formData':JSON['stringify'](_0x4e5349)};}exports[_0x3212('0x4d')]=function(_0x5b1fc5,_0x22de3d){var _0x661418={'include':[{'model':db['Pause'],'as':_0x3212('0x4e')}]},_0xa6854f={},_0x29f95c={'count':0x0,'rows':[]};var _0xb7124f=_[_0x3212('0x4f')](db['ChatWebsite'][_0x3212('0x50')],function(_0x341286){return{'name':_0x341286[_0x3212('0x51')],'type':_0x341286[_0x3212('0x4c')]['key']};});_0xa6854f[_0x3212('0x48')]=_[_0x3212('0x4f')](_0xb7124f,'name');_0xa6854f[_0x3212('0x52')]=_[_0x3212('0x53')](_0x5b1fc5[_0x3212('0x52')]);_0xa6854f['filters']=_['intersection'](_0xa6854f[_0x3212('0x48')],_0xa6854f[_0x3212('0x52')]);_0x661418[_0x3212('0x54')]=_['intersection'](_0xa6854f[_0x3212('0x48')],qs[_0x3212('0x55')](_0x5b1fc5['query'][_0x3212('0x55')]));_0x661418[_0x3212('0x54')]=_0x661418[_0x3212('0x54')]['length']?_0x661418['attributes']:_0xa6854f[_0x3212('0x48')];if(!_0x5b1fc5[_0x3212('0x52')][_0x3212('0x56')](_0x3212('0x57'))){_0x661418['limit']=qs[_0x3212('0x2d')](_0x5b1fc5[_0x3212('0x52')][_0x3212('0x2d')]);_0x661418['offset']=qs[_0x3212('0x2b')](_0x5b1fc5['query'][_0x3212('0x2b')]);}_0x661418[_0x3212('0x58')]=qs[_0x3212('0x59')](_0x5b1fc5[_0x3212('0x52')]['sort']);_0x661418[_0x3212('0x5a')]=qs[_0x3212('0x5b')](_['pick'](_0x5b1fc5[_0x3212('0x52')],_0xa6854f[_0x3212('0x5b')]),_0xb7124f);if(_0x5b1fc5[_0x3212('0x52')][_0x3212('0x5c')]){_0x661418[_0x3212('0x5a')]=_[_0x3212('0x5d')](_0x661418[_0x3212('0x5a')],{'$or':_['map'](_0xb7124f,function(_0xe5878d){if(_0xe5878d[_0x3212('0x4c')]!==_0x3212('0x5e')){var _0x8f9c82={};_0x8f9c82[_0xe5878d['name']]={'$like':'%'+_0x5b1fc5['query']['filter']+'%'};return _0x8f9c82;}})});}_0x661418=_['merge']({},_0x661418,_0x5b1fc5[_0x3212('0x5f')]);var _0x5eb862={'where':_0x661418[_0x3212('0x5a')]};return db[_0x3212('0x60')][_0x3212('0x2e')](_0x5eb862)[_0x3212('0x1e')](function(_0xdf24b8){_0x29f95c[_0x3212('0x2e')]=_0xdf24b8;if(_0x5b1fc5[_0x3212('0x52')][_0x3212('0x61')]){_0x661418[_0x3212('0x62')]=[{'all':!![]}];}return db[_0x3212('0x60')][_0x3212('0x63')](_0x661418);})['then'](function(_0x51751b){_0x29f95c['rows']=_0x51751b;return _0x29f95c;})[_0x3212('0x1e')](respondWithFilteredResult(_0x22de3d,_0x661418))[_0x3212('0x27')](handleError(_0x22de3d,null));};exports[_0x3212('0x64')]=function(_0x4228b7,_0x3f1e7c){var _0x81656={'raw':![],'where':{'id':_0x4228b7['params']['id']},'include':[{'model':db[_0x3212('0x65')],'as':_0x3212('0x4e')}]},_0x4b60cf={};_0x4b60cf['model']=_['keys'](db[_0x3212('0x60')][_0x3212('0x50')]);_0x4b60cf['query']=_[_0x3212('0x53')](_0x4228b7[_0x3212('0x52')]);_0x4b60cf[_0x3212('0x5b')]=_[_0x3212('0x66')](_0x4b60cf[_0x3212('0x48')],_0x4b60cf['query']);_0x81656[_0x3212('0x54')]=_[_0x3212('0x66')](_0x4b60cf[_0x3212('0x48')],qs[_0x3212('0x55')](_0x4228b7['query'][_0x3212('0x55')]));_0x81656[_0x3212('0x54')]=_0x81656[_0x3212('0x54')]['length']?_0x81656[_0x3212('0x54')]:_0x4b60cf[_0x3212('0x48')];if(_0x4228b7[_0x3212('0x52')][_0x3212('0x61')]){_0x81656['include']=[{'all':!![]}];}_0x81656=_[_0x3212('0x5d')]({},_0x81656,_0x4228b7[_0x3212('0x5f')]);return db[_0x3212('0x60')][_0x3212('0x67')](_0x81656)['then'](handleEntityNotFound(_0x3f1e7c,null))[_0x3212('0x1e')](respondWithResult(_0x3f1e7c,null))[_0x3212('0x27')](handleError(_0x3f1e7c,null));};exports[_0x3212('0x68')]=function(_0x116301,_0x5c39b2){var _0x30c039=null;_0x116301[_0x3212('0x69')][_0x3212('0x6a')][_0x3212('0x3e')](',')[_0x3212('0x6b')](_0x3ae978=>{if(_0x3ae978[_0x3212('0x6c')]()!==''&&!wildcardUtils[_0x3212('0x6d')](_0x3ae978[_0x3212('0x6c')]())){_0x30c039=new APIBadRequestError('\x22'+_0x3ae978['trim']()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x30c039){return handleError(_0x5c39b2,null)(_0x30c039);}return db[_0x3212('0x60')][_0x3212('0x68')](_0x116301['body'],{})[_0x3212('0x1e')](function(_0x241551){var _0x46dff8=_0x116301[_0x3212('0x6e')]['get']({'plain':!![]});if(!_0x46dff8)throw new Error(_0x3212('0x6f'));if(_0x46dff8[_0x3212('0x70')]===_0x3212('0x6e')){var _0x1298d5=_0x241551[_0x3212('0x31')]({'plain':!![]});var _0x3f92c1='ChatWebsites';return db[_0x3212('0x71')][_0x3212('0x67')]({'where':{'name':_0x3f92c1,'userProfileId':_0x46dff8['userProfileId']},'raw':!![]})['then'](function(_0xa2962b){if(_0xa2962b&&_0xa2962b[_0x3212('0x72')]===0x0){return db[_0x3212('0x33')][_0x3212('0x68')]({'name':_0x1298d5[_0x3212('0x36')],'resourceId':_0x1298d5['id'],'type':_0xa2962b['name'],'sectionId':_0xa2962b['id']},{})[_0x3212('0x1e')](function(){return _0x241551;});}else{return _0x241551;}})[_0x3212('0x27')](function(_0x5b2a69){logger[_0x3212('0x23')](_0x3212('0x73'),_0x5b2a69);throw _0x5b2a69;});}return _0x241551;})['then'](respondWithResult(_0x5c39b2,0xc9))[_0x3212('0x27')](handleError(_0x5c39b2,null));};exports[_0x3212('0x30')]=function(_0x1653b0,_0x4f1c35){var _0x304e0a=null;_0x1653b0['body']['address']['split'](',')[_0x3212('0x6b')](_0x4a6d23=>{if(_0x4a6d23[_0x3212('0x6c')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x4a6d23[_0x3212('0x6c')]())){_0x304e0a=new APIBadRequestError('\x22'+_0x4a6d23[_0x3212('0x6c')]()+_0x3212('0x74'));}});if(_0x304e0a){return handleError(_0x4f1c35,null)(_0x304e0a);}if(_0x1653b0[_0x3212('0x69')]['id']){delete _0x1653b0[_0x3212('0x69')]['id'];}return db['ChatWebsite'][_0x3212('0x67')]({'where':{'id':_0x1653b0[_0x3212('0x75')]['id']},'include':[{'model':db[_0x3212('0x65')],'as':_0x3212('0x4e')}]})[_0x3212('0x1e')](handleEntityNotFound(_0x4f1c35,null))[_0x3212('0x1e')](saveUpdates(_0x1653b0['body'],null))[_0x3212('0x1e')](respondWithResult(_0x4f1c35,null))[_0x3212('0x27')](handleError(_0x4f1c35,null));};exports[_0x3212('0x34')]=function(_0x1d9afc,_0x45c5ec){return db[_0x3212('0x60')][_0x3212('0x67')]({'where':{'id':_0x1d9afc[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x45c5ec,null))[_0x3212('0x1e')](removeEntity(_0x45c5ec,null))['catch'](handleError(_0x45c5ec,null));};exports['describe']=function(_0x10e970,_0x301b41){return db['ChatWebsite'][_0x3212('0x76')]()['then'](respondWithResult(_0x301b41,null))['catch'](handleError(_0x301b41,null));};exports['addDisposition']=function(_0x4e307d,_0x4f70b2){if(_0x4e307d['body']['id']){delete _0x4e307d['body']['id'];}return db[_0x3212('0x60')]['find']({'where':{'id':_0x4e307d[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x4f70b2,null))[_0x3212('0x1e')](function(_0x295c99){if(_0x295c99){_0x4e307d[_0x3212('0x69')][_0x3212('0x77')]=_0x295c99['id'];return db[_0x3212('0x78')][_0x3212('0x68')](_0x4e307d[_0x3212('0x69')]);}})[_0x3212('0x1e')](respondWithResult(_0x4f70b2,null))[_0x3212('0x27')](handleError(_0x4f70b2,null));};exports[_0x3212('0x79')]=function(_0x177a58,_0x578101){var _0x7110c1={'raw':![],'where':{}};var _0x4c8dc8={};var _0x114d34={'count':0x0,'rows':[]};return db[_0x3212('0x60')]['findOne']({'where':{'id':_0x177a58['params']['id']}})['then'](handleEntityNotFound(_0x578101,null))[_0x3212('0x1e')](function(_0x4f63fa){if(_0x4f63fa){_0x4c8dc8['model']=_[_0x3212('0x53')](db[_0x3212('0x78')][_0x3212('0x50')]);_0x4c8dc8[_0x3212('0x52')]=_[_0x3212('0x53')](_0x177a58[_0x3212('0x52')]);_0x4c8dc8['filters']=_['intersection'](_0x4c8dc8['model'],_0x4c8dc8['query']);_0x7110c1[_0x3212('0x54')]=_[_0x3212('0x66')](_0x4c8dc8['model'],qs['fields'](_0x177a58['query'][_0x3212('0x55')]));_0x7110c1['attributes']=_0x7110c1[_0x3212('0x54')][_0x3212('0x7a')]?_0x7110c1[_0x3212('0x54')]:_0x4c8dc8[_0x3212('0x48')];if(!_0x177a58[_0x3212('0x52')][_0x3212('0x56')](_0x3212('0x57'))){_0x7110c1[_0x3212('0x2d')]=qs['limit'](_0x177a58[_0x3212('0x52')][_0x3212('0x2d')]);_0x7110c1[_0x3212('0x2b')]=qs[_0x3212('0x2b')](_0x177a58[_0x3212('0x52')]['offset']);}_0x7110c1[_0x3212('0x58')]=qs[_0x3212('0x59')](_0x177a58['query'][_0x3212('0x59')]);_0x7110c1[_0x3212('0x5a')]=qs[_0x3212('0x5b')](_[_0x3212('0x7b')](_0x177a58[_0x3212('0x52')],_0x4c8dc8[_0x3212('0x5b')]));_0x7110c1[_0x3212('0x5a')]['ChatWebsiteId']=_0x4f63fa['id'];if(_0x177a58[_0x3212('0x52')][_0x3212('0x5c')]){_0x7110c1[_0x3212('0x5a')]=_[_0x3212('0x5d')](_0x7110c1[_0x3212('0x5a')],{'$or':_[_0x3212('0x4f')](_0x7110c1[_0x3212('0x54')],function(_0x22c08b){var _0x2509f9={};_0x2509f9[_0x22c08b]={'$like':'%'+_0x177a58[_0x3212('0x52')]['filter']+'%'};return _0x2509f9;})});}_0x7110c1=_[_0x3212('0x5d')]({},_0x7110c1,_0x177a58[_0x3212('0x5f')]);return db['Disposition']['count']({'where':_0x7110c1['where']})[_0x3212('0x1e')](function(_0x4e6b83){_0x114d34[_0x3212('0x2e')]=_0x4e6b83;if(_0x177a58['query']['includeAll']){_0x7110c1[_0x3212('0x62')]=[{'all':!![]}];}return db['Disposition'][_0x3212('0x63')](_0x7110c1);})[_0x3212('0x1e')](function(_0x836bb8){_0x114d34[_0x3212('0x7c')]=_0x836bb8;return _0x114d34;});}})['then'](respondWithFilteredResult(_0x578101,_0x7110c1))[_0x3212('0x27')](handleError(_0x578101,null));};exports[_0x3212('0x7d')]=function(_0x415288,_0x480fae){return db[_0x3212('0x60')]['find']({'where':{'id':_0x415288[_0x3212('0x75')]['id']}})['then'](handleEntityNotFound(_0x480fae,null))[_0x3212('0x1e')](function(_0x2fe8f6){if(_0x2fe8f6){return _0x2fe8f6['removeDispositions'](_0x415288[_0x3212('0x52')][_0x3212('0x7e')]);}})[_0x3212('0x1e')](respondWithStatusCode(_0x480fae,null))[_0x3212('0x27')](handleError(_0x480fae,null));};exports[_0x3212('0x7f')]=function(_0x374c2,_0x3a9749){if(_0x374c2[_0x3212('0x69')]['id']){delete _0x374c2['body']['id'];}return db[_0x3212('0x60')][_0x3212('0x67')]({'where':{'id':_0x374c2['params']['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x3a9749,null))[_0x3212('0x1e')](function(_0x3650af){if(_0x3650af){_0x374c2[_0x3212('0x69')][_0x3212('0x77')]=_0x3650af['id'];return db['CannedAnswer'][_0x3212('0x68')](_0x374c2[_0x3212('0x69')]);}})[_0x3212('0x1e')](respondWithResult(_0x3a9749,null))[_0x3212('0x27')](handleError(_0x3a9749,null));};exports[_0x3212('0x80')]=function(_0x5dc8d1,_0x56612b){var _0x2aa5d5={'raw':![],'where':{}};var _0x5735e7={};var _0x285fb0={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x5dc8d1[_0x3212('0x75')]['id']}})['then'](handleEntityNotFound(_0x56612b,null))[_0x3212('0x1e')](function(_0x589c12){if(_0x589c12){_0x5735e7[_0x3212('0x48')]=_[_0x3212('0x53')](db[_0x3212('0x81')][_0x3212('0x50')]);_0x5735e7[_0x3212('0x52')]=_[_0x3212('0x53')](_0x5dc8d1[_0x3212('0x52')]);_0x5735e7[_0x3212('0x5b')]=_[_0x3212('0x66')](_0x5735e7['model'],_0x5735e7[_0x3212('0x52')]);_0x2aa5d5[_0x3212('0x54')]=_[_0x3212('0x66')](_0x5735e7['model'],qs[_0x3212('0x55')](_0x5dc8d1[_0x3212('0x52')][_0x3212('0x55')]));_0x2aa5d5[_0x3212('0x54')]=_0x2aa5d5[_0x3212('0x54')][_0x3212('0x7a')]?_0x2aa5d5[_0x3212('0x54')]:_0x5735e7[_0x3212('0x48')];if(!_0x5dc8d1['query'][_0x3212('0x56')](_0x3212('0x57'))){_0x2aa5d5[_0x3212('0x2d')]=qs[_0x3212('0x2d')](_0x5dc8d1[_0x3212('0x52')][_0x3212('0x2d')]);_0x2aa5d5[_0x3212('0x2b')]=qs[_0x3212('0x2b')](_0x5dc8d1[_0x3212('0x52')][_0x3212('0x2b')]);}_0x2aa5d5[_0x3212('0x58')]=qs[_0x3212('0x59')](_0x5dc8d1[_0x3212('0x52')]['sort']);_0x2aa5d5[_0x3212('0x5a')]=qs[_0x3212('0x5b')](_[_0x3212('0x7b')](_0x5dc8d1[_0x3212('0x52')],_0x5735e7[_0x3212('0x5b')]));_0x2aa5d5[_0x3212('0x5a')][_0x3212('0x77')]=_0x589c12['id'];if(_0x5dc8d1[_0x3212('0x52')]['filter']){_0x2aa5d5[_0x3212('0x5a')]=_['merge'](_0x2aa5d5[_0x3212('0x5a')],{'$or':_[_0x3212('0x4f')](_0x2aa5d5[_0x3212('0x54')],function(_0x4ae27a){var _0x5df8f9={};_0x5df8f9[_0x4ae27a]={'$like':'%'+_0x5dc8d1['query'][_0x3212('0x5c')]+'%'};return _0x5df8f9;})});}_0x2aa5d5=_[_0x3212('0x5d')]({},_0x2aa5d5,_0x5dc8d1['options']);return db[_0x3212('0x81')][_0x3212('0x2e')]({'where':_0x2aa5d5[_0x3212('0x5a')]})[_0x3212('0x1e')](function(_0x42b39a){_0x285fb0[_0x3212('0x2e')]=_0x42b39a;if(_0x5dc8d1[_0x3212('0x52')][_0x3212('0x61')]){_0x2aa5d5['include']=[{'all':!![]}];}return db[_0x3212('0x81')][_0x3212('0x63')](_0x2aa5d5);})[_0x3212('0x1e')](function(_0x162a7d){_0x285fb0[_0x3212('0x7c')]=_0x162a7d;return _0x285fb0;});}})['then'](respondWithFilteredResult(_0x56612b,_0x2aa5d5))[_0x3212('0x27')](handleError(_0x56612b,null));};exports[_0x3212('0x82')]=function(_0x1e3424,_0x2d3563){return db[_0x3212('0x60')]['find']({'where':{'id':_0x1e3424[_0x3212('0x75')]['id']}})['then'](handleEntityNotFound(_0x2d3563,null))['then'](function(_0x5671c3){if(_0x5671c3){return _0x5671c3['removeAnswers'](_0x1e3424[_0x3212('0x52')][_0x3212('0x7e')]);}})[_0x3212('0x1e')](respondWithStatusCode(_0x2d3563,null))[_0x3212('0x27')](handleError(_0x2d3563,null));};exports[_0x3212('0x83')]=function(_0x3e3499,_0x161ca1){_0x3e3499[_0x3212('0x69')]['sitepic']=_0x3e3499['file'][_0x3212('0x84')];return db[_0x3212('0x60')]['find']({'where':{'id':_0x3e3499[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x161ca1,null))['then'](saveUpdates(_0x3e3499[_0x3212('0x69')],null))['then'](respondWithResult(_0x161ca1,null))['catch'](handleError(_0x161ca1,null));};exports[_0x3212('0x85')]=function(_0x3429ca,_0x11c234){_0x3429ca[_0x3212('0x69')][_0x3212('0x86')]=_0x3429ca[_0x3212('0x87')]['filename'];return db[_0x3212('0x60')][_0x3212('0x67')]({'where':{'id':_0x3429ca['params']['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x11c234,null))[_0x3212('0x1e')](saveUpdates(_0x3429ca[_0x3212('0x69')],null))['then'](respondWithResult(_0x11c234,null))[_0x3212('0x27')](handleError(_0x11c234,null));};exports['addCustomerAvatar']=function(_0x14ff48,_0x584b80){_0x14ff48['body']['customerAvatar']=_0x14ff48[_0x3212('0x87')][_0x3212('0x84')];return db['ChatWebsite'][_0x3212('0x67')]({'where':{'id':_0x14ff48[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x584b80,null))[_0x3212('0x1e')](saveUpdates(_0x14ff48[_0x3212('0x69')],null))[_0x3212('0x1e')](respondWithResult(_0x584b80,null))[_0x3212('0x27')](handleError(_0x584b80,null));};exports[_0x3212('0x88')]=function(_0x272cec,_0x5746b9){_0x272cec[_0x3212('0x69')][_0x3212('0x89')]=_0x272cec[_0x3212('0x87')][_0x3212('0x84')];return db[_0x3212('0x60')][_0x3212('0x67')]({'where':{'id':_0x272cec[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x5746b9,null))[_0x3212('0x1e')](saveUpdates(_0x272cec[_0x3212('0x69')],null))[_0x3212('0x1e')](respondWithResult(_0x5746b9,null))[_0x3212('0x27')](handleError(_0x5746b9,null));};exports[_0x3212('0x8a')]=function(_0x4ef7ae,_0x582479){var _0x13441a=path[_0x3212('0x8b')](config['root'],_0x3212('0x8c'));var _0x5e493f={'where':{'id':_0x4ef7ae[_0x3212('0x75')]['id']},'attributes':['id',_0x3212('0x8d')],'raw':!![]};var _0x5b77cf=![];return require(_0x3212('0x8e'))[_0x3212('0x8f')]()[_0x3212('0x1e')](function(_0x397ecc){if(_0x397ecc){_0x5b77cf=_0x397ecc[_0x3212('0x90')];}})['then'](function(){return db[_0x3212('0x60')][_0x3212('0x67')](_0x5e493f);})[_0x3212('0x1e')](handleEntityNotFound(_0x582479,null))[_0x3212('0x1e')](function(_0x5f5ceb){if(_0x5f5ceb){if(!_[_0x3212('0x91')](_0x5f5ceb[_0x3212('0x8d')])){if(fs[_0x3212('0x92')](path[_0x3212('0x8b')](config['root'],_0x3212('0x93'),_0x5f5ceb['sitepic']))&&_0x5b77cf){_0x13441a=path[_0x3212('0x8b')](config[_0x3212('0x94')],_0x3212('0x93'),_0x5f5ceb['sitepic']);}}return _0x582479[_0x3212('0x95')](_0x13441a);}})['catch'](handleError(_0x582479,null));};exports['getAvatar']=function(_0x4ab1c5,_0x2c895a){var _0x211434=path[_0x3212('0x8b')](config[_0x3212('0x94')],_0x3212('0x96'));var _0x59bc64={'where':{'id':_0x4ab1c5[_0x3212('0x75')]['id']},'attributes':['id',_0x3212('0x86')],'raw':!![]};return db[_0x3212('0x60')]['find'](_0x59bc64)[_0x3212('0x1e')](handleEntityNotFound(_0x2c895a,null))[_0x3212('0x1e')](function(_0xfabca5){if(_0xfabca5){if(!_['isNil'](_0xfabca5[_0x3212('0x86')])){if(fs[_0x3212('0x92')](path[_0x3212('0x8b')](config[_0x3212('0x94')],'server/files/images/avatars/',_0xfabca5[_0x3212('0x86')]))){_0x211434=path[_0x3212('0x8b')](config[_0x3212('0x94')],_0x3212('0x97'),_0xfabca5[_0x3212('0x86')]);}}return _0x2c895a[_0x3212('0x95')](_0x211434);}})[_0x3212('0x27')](handleError(_0x2c895a,null));};exports[_0x3212('0x98')]=function(_0x150df7,_0x114f32){var _0x2e7a06=path['join'](config[_0x3212('0x94')],_0x3212('0x99'));var _0x248809={'where':{'id':_0x150df7['params']['id']},'attributes':['id',_0x3212('0x9a'),'showCustomerAvatar'],'raw':!![]};return db[_0x3212('0x60')][_0x3212('0x67')](_0x248809)[_0x3212('0x1e')](handleEntityNotFound(_0x114f32,null))[_0x3212('0x1e')](function(_0x484a1c){if(_0x484a1c){if(!_['isNil'](_0x484a1c[_0x3212('0x9a')])){if(fs['existsSync'](path['join'](config[_0x3212('0x94')],_0x3212('0x97'),_0x484a1c[_0x3212('0x9a')]))&&_0x484a1c['showCustomerAvatar']){_0x2e7a06=path[_0x3212('0x8b')](config[_0x3212('0x94')],_0x3212('0x97'),_0x484a1c['customerAvatar']);}}return _0x114f32[_0x3212('0x95')](_0x2e7a06);}})[_0x3212('0x27')](handleError(_0x114f32,null));};exports['getSystemAvatar']=function(_0x421019,_0x38bfb7){var _0x39b919=path[_0x3212('0x8b')](config[_0x3212('0x94')],_0x3212('0x9b'));var _0x36cd12={'where':{'id':_0x421019[_0x3212('0x75')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x3212('0x60')][_0x3212('0x67')](_0x36cd12)[_0x3212('0x1e')](handleEntityNotFound(_0x38bfb7,null))['then'](function(_0x58ddce){if(_0x58ddce){if(!_['isNil'](_0x58ddce[_0x3212('0x89')])){if(fs[_0x3212('0x92')](path[_0x3212('0x8b')](config['root'],_0x3212('0x97'),_0x58ddce[_0x3212('0x89')]))){_0x39b919=path[_0x3212('0x8b')](config[_0x3212('0x94')],_0x3212('0x97'),_0x58ddce[_0x3212('0x89')]);}}return _0x38bfb7[_0x3212('0x95')](_0x39b919);}})[_0x3212('0x27')](handleError(_0x38bfb7,null));};function checkWebsiteInterval(_0x117d5e){var _0x3f5c7a=_0x117d5e[_0x3212('0x9c')];if(!_0x3f5c7a){return Promise[_0x3212('0x9d')](_0x117d5e);}var _0x23c357=_0x117d5e[_0x3212('0x9e')]||undefined;return _0x3f5c7a[_0x3212('0x9f')](_0x23c357)['then'](function(_0x5410ee){if(!_0x5410ee){throw new APIOutOfIntervalError();}return _0x117d5e;});}exports[_0x3212('0xa0')]=function(_0x276440,_0x50ed8d){var _0x151c1b={'body':_0x276440['body'],'channel':_0x3212('0xa1')};var _0x52a17c=[];var _0x2416bb=[];var _0x299400={};var _0x5f6c86=![];if(_0x276440[_0x3212('0x69')]['id']){delete _0x276440[_0x3212('0x69')]['id'];}if(_[_0x3212('0x91')](_0x276440[_0x3212('0x69')][_0x3212('0xa2')])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0x3212('0x91')](_0x276440[_0x3212('0x69')]['mapKey'])){throw new APIBadRequestError(_0x3212('0xa3'));}if(_['isEmpty'](_0x276440[_0x3212('0x69')]['body'])){throw new APIBadRequestError(_0x3212('0xa4'));}var _0x99efa3=_0x276440[_0x3212('0x69')][_0x3212('0x3b')]&&_0x276440[_0x3212('0x69')][_0x3212('0x42')];return db['CmContact'][_0x3212('0x76')]()[_0x3212('0x1e')](function(_0x2b4188){if(!_0x2b4188){throw new Error('No\x20available\x20attributes');}_0x52a17c=Object[_0x3212('0x53')](_0x2b4188)[_0x3212('0x5c')](function(_0xaa863f){return![_0x3212('0xa5'),_0x3212('0xa6')][_0x3212('0xa7')](_0xaa863f);});_0x2416bb=Object[_0x3212('0x53')](_0x2b4188)[_0x3212('0x5c')](function(_0x2ae201){return![_0x3212('0xa5'),_0x3212('0xa6'),_0x3212('0xa8'),_0x3212('0xa9')]['includes'](_0x2ae201);});if(!_['includes'](_0x2416bb,_0x276440[_0x3212('0x69')]['mapKey'])){throw new APIBadRequestError(_0x3212('0xaa')+_0x2416bb['join'](',\x20'));}_0x299400[_0x276440[_0x3212('0x69')][_0x3212('0xab')]]=_0x276440[_0x3212('0x69')][_0x3212('0xa2')];})[_0x3212('0x1e')](function(){return db['ChatWebsite'][_0x3212('0x67')]({'where':{'id':_0x276440['params']['id']},'include':[{'model':db[_0x3212('0xac')],'as':_0x3212('0xad'),'include':[{'model':db[_0x3212('0xae')],'as':'Contacts','where':_0x299400,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x3212('0xaf')],'as':'Applications'},{'model':db['Interval'],'as':_0x3212('0x9c'),'include':[{'model':db[_0x3212('0x9c')],'as':_0x3212('0xb0'),'attributes':['id',_0x3212('0xb1')],'raw':!![]}]}]});})[_0x3212('0x1e')](function(_0x1d04fa){if(!_0x1d04fa){throw new APINotFoundError(util[_0x3212('0x44')](_0x3212('0xb2'),_0x276440[_0x3212('0x75')]['id']));}if(_0x99efa3){return checkWebsiteInterval(_0x1d04fa);}return _0x1d04fa;})['then'](function(_0x130b7a){_0x151c1b['account']=_0x130b7a;_0x151c1b[_0x3212('0xb3')]=_[_0x3212('0xb4')](_0x130b7a[_0x3212('0xb5')],[_0x3212('0xb6')],[_0x3212('0xb7')]);if(_0x151c1b[_0x3212('0xb8')][_0x3212('0xb5')]){delete _0x151c1b['account'][_0x3212('0xb5')];}_0x151c1b[_0x3212('0xb9')]=_0x130b7a[_0x3212('0xad')]||{'id':_0x130b7a[_0x3212('0xa9')]};if(_0x151c1b[_0x3212('0xb9')]&&_0x151c1b['list'][_0x3212('0xba')]['length']){return _0x151c1b['list']['Contacts'][0x0];}var _0x3d8761=_['defaults'](_0x276440['body'],{'firstName':_0x276440[_0x3212('0x69')]['from'],'ListId':_0x130b7a[_0x3212('0xa9')]});_0x3d8761[_0x276440[_0x3212('0x69')]['mapKey']]=_0x276440[_0x3212('0x69')][_0x3212('0xa2')];return db[_0x3212('0xae')][_0x3212('0x68')](_0x3d8761,{'fields':_0x52a17c,'raw':!![]});})[_0x3212('0x1e')](function(_0x3e57a8){_0x151c1b['contact']=_0x3e57a8;var _0x5cb478=createInteractionObject(_0x276440['params']['id'],_0x276440[_0x3212('0x69')],_0x276440[_0x3212('0xbb')],_0x3e57a8);var _0x14a707={'ChatWebsiteId':_0x276440[_0x3212('0x75')]['id']};if(_0x276440[_0x3212('0x69')]['threadId']){_0x14a707[_0x3212('0xbc')]=_0x276440[_0x3212('0x69')][_0x3212('0xbc')];_0x14a707[_0x3212('0xbd')]=![];return db[_0x3212('0xbe')][_0x3212('0x67')]({'where':_0x14a707})['then'](function(_0x2b8e20){var _0x2a3824=_0x276440['body'][_0x3212('0x3b')]&&_0x276440[_0x3212('0x69')][_0x3212('0x42')];if(_0x2b8e20){_0x5f6c86=!![];return _0x2b8e20;}else if(!_0x2a3824&&_0x2b8e20&&_0x2b8e20[_0x3212('0xbd')]){throw new APIConflictError(_0x3212('0xbf'));}_0x5cb478[_0x3212('0xbc')]=_0x276440['body']['threadId'];_0x5cb478[_0x3212('0xc0')]=_0x276440[_0x3212('0x69')][_0x3212('0xc0')];return db[_0x3212('0xbe')][_0x3212('0x68')](_0x5cb478);});}_0x14a707[_0x3212('0xc1')]=_0x3e57a8['id'];if(_0x276440[_0x3212('0x69')][_0x3212('0xc2')]&&_0x276440[_0x3212('0x69')][_0x3212('0xc2')]['id']){_0x14a707['id']=_0x276440[_0x3212('0x69')][_0x3212('0xc2')]['id'];return db['ChatInteraction'][_0x3212('0x67')]({'where':_0x14a707})[_0x3212('0x1e')](function(_0x241113){var _0x521fdd=_0x276440[_0x3212('0x69')][_0x3212('0x3b')]&&_0x276440[_0x3212('0x69')][_0x3212('0x42')];if(!_0x521fdd&&_0x241113&&_0x241113[_0x3212('0xbd')]){throw new APIConflictError(_0x3212('0xbf'));}else if(_0x241113){_0x5f6c86=!![];return _0x241113;}else{return db[_0x3212('0xbe')][_0x3212('0x68')](_0x5cb478);}});}return db[_0x3212('0xbe')][_0x3212('0x68')](_0x5cb478);})[_0x3212('0x1e')](function(_0x134fe5){if(!_0x5f6c86){return _0x134fe5;}var _0x1f3741={'from':(_0x151c1b[_0x3212('0xc3')]['firstName']||'')+'\x20'+(_0x151c1b[_0x3212('0xc3')][_0x3212('0x40')]||'')};if(_0x276440[_0x3212('0x69')][_0x3212('0xbc')]&&_0x276440['body']['messageId']&&_0x276440[_0x3212('0x69')][_0x3212('0xbc')]!=_0x276440[_0x3212('0x69')][_0x3212('0xc4')]){_0x1f3741[_0x3212('0xbc')]=_0x276440[_0x3212('0x69')][_0x3212('0xc4')];}return _0x134fe5['update'](_0x1f3741);})[_0x3212('0x1e')](function(_0x23027f){_0x151c1b[_0x3212('0xc2')]=_0x23027f[_0x3212('0x31')]({'plain':!![]});_0x151c1b[_0x3212('0xc2')][_0x3212('0xc5')]=!_0x5f6c86;if(_0x151c1b['interaction'][_0x3212('0xc5')]){if(_0x151c1b[_0x3212('0xb8')][_0x3212('0xc6')]){_0x151c1b[_0x3212('0xb3')][_0x3212('0xc7')]({'id':0x0,'priority':_0x151c1b[_0x3212('0xb3')][_0x3212('0x7a')]+0x1,'app':_0x3212('0xc8'),'appdata':_0x3212('0xc9'),'interval':_0x3212('0xca')});}}return db[_0x3212('0xcb')][_0x3212('0x68')]({'body':_0x276440[_0x3212('0x69')][_0x3212('0x69')],'ChatWebsiteId':_0x276440['params']['id'],'ChatInteractionId':_0x23027f['id'],'direction':'in','ContactId':_0x151c1b[_0x3212('0xc3')]['id'],'AttachmentId':_0x276440[_0x3212('0x69')][_0x3212('0xcc')]});})[_0x3212('0x1e')](function(_0x3338c3){_0x151c1b[_0x3212('0x26')]=_0x3338c3;if(!_0x151c1b['interaction'][_0x3212('0xcd')]){return;}return db[_0x3212('0xce')][_0x3212('0x67')]({'attributes':['id',_0x3212('0x36')],'where':{'id':_0x151c1b[_0x3212('0xc2')]['UserId']}});})[_0x3212('0x1e')](function(_0x1aaffb){if(_0x1aaffb){_0x151c1b[_0x3212('0xb3')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3212('0xcf'),'appdata':_0x1aaffb[_0x3212('0x36')]+','+(_0x151c1b[_0x3212('0xb8')][_0x3212('0xd0')]||0xa),'interval':'*,*,*,*'});_0x151c1b[_0x3212('0xd1')]=!![];}if(!_0x151c1b['interaction'][_0x3212('0xd2')]){return;}return db[_0x3212('0xd3')][_0x3212('0x67')]({'attributes':['id',_0x3212('0x36')],'where':{'id':_0x151c1b[_0x3212('0xc2')][_0x3212('0xd2')]}});})['then'](function(_0x335207){if(_0x335207){_0x151c1b[_0x3212('0xb3')][_0x3212('0xd4')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x335207[_0x3212('0x36')]+','+(_0x151c1b[_0x3212('0xb8')][_0x3212('0xd5')]||0x12c),'interval':_0x3212('0xca')});}return respondWithRpcPromise(_0x3212('0xd6'),'startRouting',_0x151c1b);})[_0x3212('0x1e')](function(_0x2db4d7){respondWithRpcPromise(_0x3212('0xd7'),_0x3212('0xd7'),{'event':'notify','message':_0x2db4d7},client9002);return _0x2db4d7;})[_0x3212('0x1e')](respondWithResult(_0x50ed8d,null))['catch'](APIHandleError(_0x50ed8d));};exports[_0x3212('0xd8')]=function(_0x5044dd,_0x3551bc){var _0x2ac9a0,_0x114525,_0x499fb0;var _0x4e427b=[];var _0x3794aa={};var _0x22c635=_0x5044dd[_0x3212('0xd9')]||[];var _0x455d2d=[];var _0x54e195;return db[_0x3212('0xae')][_0x3212('0x76')]()[_0x3212('0x1e')](function(_0x1c628b){if(!_0x1c628b){throw new db[(_0x3212('0xda'))][(_0x3212('0xdb'))](_0x3212('0xdc'));}_0x4e427b=_[_0x3212('0xdd')](_['keys'](_0x1c628b),[_0x3212('0xa5'),_0x3212('0xa6'),'CompanyId',_0x3212('0xa9')]);if(_0x5044dd[_0x3212('0x69')]['id']){delete _0x5044dd[_0x3212('0x69')]['id'];}if(_[_0x3212('0x91')](_0x5044dd[_0x3212('0x69')][_0x3212('0xa2')])){throw _0x3551bc['status'](0x1f4)[_0x3212('0x37')](new db['Sequelize'][(_0x3212('0xdb'))](_0x3212('0xde')));}if(_[_0x3212('0x91')](_0x5044dd['body'][_0x3212('0x69')])||_0x5044dd[_0x3212('0x69')][_0x3212('0x69')]===''){throw _0x3551bc[_0x3212('0x29')](0x1f4)[_0x3212('0x37')](new db[(_0x3212('0xda'))][(_0x3212('0xdb'))](_0x3212('0xdf')));}if(_[_0x3212('0x91')](_0x5044dd['body'][_0x3212('0xe0')])){throw _0x3551bc[_0x3212('0x29')](0x1f4)[_0x3212('0x37')](new db[(_0x3212('0xda'))][(_0x3212('0xdb'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e427b));}if(!_['includes'](_0x4e427b,_0x5044dd[_0x3212('0x69')]['mapKeyOffline'])){throw _0x3551bc[_0x3212('0x29')](0x1f4)['send'](new db[(_0x3212('0xda'))][(_0x3212('0xdb'))](_0x3212('0xe1')+_0x4e427b));}_0x3794aa[_0x5044dd['body'][_0x3212('0xe0')]]=_0x5044dd[_0x3212('0x69')]['from'];})['then'](function(){return db[_0x3212('0x60')][_0x3212('0x67')]({'where':{'id':_0x5044dd[_0x3212('0x75')]['id']},'include':[{'model':db['CmList'],'as':_0x3212('0xad')},{'model':db['MailAccount'],'as':_0x3212('0xe2')}]});})['then'](handleEntityNotFound(_0x3551bc,null))['then'](function(_0x236981){if(_0x236981&&_0x236981[_0x3212('0xad')]){_0x114525=_0x236981;var _0x1ae319=_[_0x3212('0x16')](_0x5044dd[_0x3212('0x69')],{'firstName':_0x5044dd[_0x3212('0x69')]['from'],'phone':_0x5044dd[_0x3212('0x69')][_0x3212('0xa2')],'ListId':_0x236981['ListId']});_0x1ae319[_0x5044dd[_0x3212('0x69')][_0x3212('0xe0')]]=_0x5044dd[_0x3212('0x69')][_0x3212('0xa2')];return db[_0x3212('0xae')][_0x3212('0xe3')]({'where':_0x3794aa,'defaults':_0x1ae319});}})[_0x3212('0xe4')](function(_0xd5ed8a){if(_0xd5ed8a){_0x499fb0=_0xd5ed8a;var _0x57b8b6=fs[_0x3212('0xe5')](path['join'](config['root'],_0x3212('0xe6')),_0x3212('0xe7'));var _0x47ab77=ejs['render'](_0x57b8b6,{'body':_[_0x3212('0xe8')](_0x5044dd[_0x3212('0x69')]['body']),'bodyTitle':_0x114525[_0x3212('0xe9')]});return db[_0x3212('0xea')][_0x3212('0x68')]({'body':_0x47ab77,'plainBody':htmlToText[_0x3212('0xeb')](_0x47ab77),'ContactId':_0xd5ed8a['id'],'ChatWebsiteId':_0x114525['id']});}})['then'](function(_0x22c557){_0x54e195=_0x22c557;if(_0x22c635[_0x3212('0x7a')]){var _0x55621c=_0x22c635['map'](function(_0x452503){return{'name':_0x452503[_0x3212('0xec')],'basename':_0x452503[_0x3212('0x84')],'type':_0x452503[_0x3212('0xed')],'ChatOfflineMessageId':_0x22c557['id']};});_0x455d2d=_0x55621c[_0x3212('0x4f')](_0x13f591=>{var _0x52a99e={'filename':_0x13f591['name'],'path':path[_0x3212('0x8b')](config['root'],'server','files','attachments',_0x3212('0xee'),_0x13f591[_0x3212('0xef')])};return _0x52a99e;});if(!_0x114525[_0x3212('0xf0')]){return db[_0x3212('0xf1')]['transaction'](function(_0x409508){return db[_0x3212('0xf2')][_0x3212('0xf3')](_0x55621c,{'transaction':_0x409508});});}}})[_0x3212('0x1e')](function(){if(_0x54e195){_0x2ac9a0=_0x54e195;return db[_0x3212('0xe2')][_0x3212('0xf4')]({'where':{'service':!![]},'include':[{'model':db[_0x3212('0xf5')],'as':_0x3212('0xf6'),'raw':!![],'include':[{'model':db[_0x3212('0xf7')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x184e57){if(_0x184e57&&_0x184e57[_0x3212('0xf6')]&&_0x114525[_0x3212('0xf8')]&&_0x114525[_0x3212('0xf9')]){var _0x282bcf=_0x184e57[_0x3212('0xfa')]();return respondWithRpcPromise(_0x3212('0xfb'),'sendMail',{'account':_0x282bcf,'message':{'from':util[_0x3212('0x44')](_0x3212('0xfc'),_0x184e57['name'],_0x184e57[_0x3212('0xfd')]||_0x184e57[_0x3212('0xf6')][_0x3212('0x6e')]),'to':_0x114525[_0x3212('0xf9')],'subject':_0x114525['offlineMessageSubject'],'html':_0x2ac9a0[_0x3212('0x69')],'attachments':_0x455d2d}},client9003)[_0x3212('0x1e')](function(){return _0x2ac9a0;})[_0x3212('0x27')](function(_0x562e85){logger[_0x3212('0x23')](_0x562e85);});}})[_0x3212('0x1e')](function(){if(_0x114525&&_0x114525['openNewInteraction']&&_0x114525[_0x3212('0xfe')]){var _0x14fcf7=[];if(_0x22c635[_0x3212('0x7a')]){_0x14fcf7=_0x22c635['map'](function(_0x29b1ab){return{'name':_0x29b1ab[_0x3212('0xec')],'basename':_0x29b1ab[_0x3212('0x84')],'type':_0x29b1ab[_0x3212('0xed')],'ChatOfflineMessageId':_0x54e195['id']};});}var _0x51e780;if(!_[_0x3212('0x91')](_0x114525[_0x3212('0xff')])){var _0x528e3e=_['map'](_0x5044dd[_0x3212('0x69')],function(_0x44988f){return _0x44988f;});var _0x439337=_[_0x3212('0x100')](_0x528e3e)[0x0];var _0x50b201=_[_0x3212('0x101')](_0x439337,function(_0x14c9af){return _0x14c9af;});_0x51e780=_0x50b201[0x1][_0x114525[_0x3212('0xff')]];}var _0x50f128={'from':_0x499fb0[_0x3212('0xfd')],'firstName':_0x499fb0[_0x3212('0x3f')],'lastName':_0x499fb0[_0x3212('0x40')],'mapKey':_0x3212('0xfd'),'message':{'from':_0x499fb0[_0x3212('0xfd')],'to':_0x114525[_0x3212('0xe2')][_0x3212('0xfd')],'cc':'','subject':_['isNil'](_0x51e780)?_0x114525[_0x3212('0x102')]:_0x51e780,'messageId':'','sentAt':new Date(),'attach':_0x14fcf7[_0x3212('0x7a')],'attachments':_0x14fcf7,'originChannel':_0x3212('0x103'),'ChatWebsiteId':_0x114525['id'],'ChatOfflineMessageId':_0x2ac9a0['id'],'originTo':_0x114525[_0x3212('0xe2')]['email']},'body':_0x2ac9a0['body']};var _0x2bedb4={'account':{'id':_0x114525[_0x3212('0xfe')]},'body':_0x50f128,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0x3212('0x104'),_0x2bedb4,client9001)[_0x3212('0x1e')](function(){return _0x2ac9a0;})[_0x3212('0x27')](function(_0x52c52a){logger[_0x3212('0x23')](_0x52c52a);});}return;})[_0x3212('0x1e')](function(){if(_0x2ac9a0){return _0x2ac9a0;}})['then'](respondWithResult(_0x3551bc,null))[_0x3212('0x27')](function(){for(var _0x116961 of _0x22c635){var _0x3e3ab7=path[_0x3212('0x8b')](config[_0x3212('0x94')],_0x3212('0x105'),_0x3212('0xd9'),_0x3212('0x106'),'offline-chat',_0x116961['filename']);fs_extra[_0x3212('0x107')](_0x3e3ab7)['catch'](function(_0x4e242f){logger[_0x3212('0x23')](_0x3212('0x108'),_0x3e3ab7,_0x4e242f);});}});};exports[_0x3212('0x109')]=function(_0x58b237,_0x234330){return db[_0x3212('0xbe')]['find']({'where':{'id':_0x58b237[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x234330,null))[_0x3212('0x1e')](function(_0x5cba55){if(_0x5cba55){return _0x5cba55[_0x3212('0x109')](_0x58b237['body'][_0x3212('0x7e')],_[_0x3212('0x10a')](_0x58b237[_0x3212('0x69')],[_0x3212('0x7e'),'id'])||{});}})[_0x3212('0x1e')](respondWithResult(_0x234330,null))['catch'](handleError(_0x234330,null));};exports[_0x3212('0x10b')]=function(_0x3c0359,_0x23e662){var _0x134dbc={'raw':![],'where':{}};var _0x2e9a0f={};var _0x1c0adc={'count':0x0,'rows':[]};return db[_0x3212('0x60')][_0x3212('0xf4')]({'where':{'id':_0x3c0359[_0x3212('0x75')]['id']}})['then'](handleEntityNotFound(_0x23e662,null))[_0x3212('0x1e')](function(_0x572101){if(_0x572101){_0x2e9a0f[_0x3212('0x48')]=_[_0x3212('0x53')](db[_0x3212('0xbe')][_0x3212('0x50')]);_0x2e9a0f['query']=_[_0x3212('0x53')](_0x3c0359[_0x3212('0x52')]);_0x2e9a0f['filters']=_['intersection'](_0x2e9a0f[_0x3212('0x48')],_0x2e9a0f[_0x3212('0x52')]);_0x134dbc['attributes']=_[_0x3212('0x66')](_0x2e9a0f[_0x3212('0x48')],qs['fields'](_0x3c0359[_0x3212('0x52')][_0x3212('0x55')]));_0x134dbc[_0x3212('0x54')]=_0x134dbc[_0x3212('0x54')][_0x3212('0x7a')]?_0x134dbc[_0x3212('0x54')]:_0x2e9a0f['model'];if(!_0x3c0359['query'][_0x3212('0x56')](_0x3212('0x57'))){_0x134dbc[_0x3212('0x2d')]=qs['limit'](_0x3c0359[_0x3212('0x52')][_0x3212('0x2d')]);_0x134dbc[_0x3212('0x2b')]=qs['offset'](_0x3c0359[_0x3212('0x52')][_0x3212('0x2b')]);}_0x134dbc['order']=qs[_0x3212('0x59')](_0x3c0359[_0x3212('0x52')]['sort']);_0x134dbc['where']=qs[_0x3212('0x5b')](_['pick'](_0x3c0359[_0x3212('0x52')],_0x2e9a0f['filters']));_0x134dbc['where'][_0x3212('0x77')]=_0x572101['id'];if(_0x3c0359['query'][_0x3212('0x5c')]){_0x134dbc[_0x3212('0x5a')]=_[_0x3212('0x5d')](_0x134dbc['where'],{'$or':_[_0x3212('0x4f')](_0x134dbc['attributes'],function(_0x3348ba){var _0x513862={};_0x513862[_0x3348ba]={'$like':'%'+_0x3c0359[_0x3212('0x52')][_0x3212('0x5c')]+'%'};return _0x513862;})});}_0x134dbc=_[_0x3212('0x5d')]({},_0x134dbc,_0x3c0359[_0x3212('0x5f')]);return db[_0x3212('0xbe')][_0x3212('0x2e')]({'where':_0x134dbc[_0x3212('0x5a')]})[_0x3212('0x1e')](function(_0x481352){_0x1c0adc['count']=_0x481352;if(_0x3c0359[_0x3212('0x52')][_0x3212('0x61')]){_0x134dbc[_0x3212('0x62')]=[{'model':db[_0x3212('0xae')],'as':_0x3212('0x10c'),'required':![]},{'model':db[_0x3212('0xce')],'as':_0x3212('0x10d'),'attributes':[_0x3212('0x36'),'fullname',_0x3212('0x10e')],'required':![]},{'model':db[_0x3212('0x10f')],'as':_0x3212('0x110'),'attributes':['id',_0x3212('0x36'),_0x3212('0x111')],'where':_0x3c0359['query'][_0x3212('0x112')]?{'id':_0x3c0359[_0x3212('0x52')][_0x3212('0x112')]}:undefined,'required':_0x3c0359[_0x3212('0x52')]['tag']?!![]:![]}];}return db['ChatInteraction'][_0x3212('0x63')](_0x134dbc);})[_0x3212('0x1e')](function(_0x1b2e77){_0x1c0adc[_0x3212('0x7c')]=_0x1b2e77;return _0x1c0adc;});}})[_0x3212('0x1e')](respondWithFilteredResult(_0x23e662,_0x134dbc))[_0x3212('0x27')](handleError(_0x23e662,null));};exports[_0x3212('0x113')]=function(_0x4f356c,_0xa129d1){var _0x563b6a=0x0;var _0x1fb2d2=0x0;var _0x5845c6=![];var _0x163030;var _0xf24677;return db[_0x3212('0x60')][_0x3212('0x67')]({'where':{'id':_0x4f356c[_0x3212('0x75')]['id']},'include':[{'model':db[_0x3212('0x9c')],'as':_0x3212('0x9c'),'include':[{'model':db[_0x3212('0x9c')],'as':_0x3212('0xb0'),'attributes':['id',_0x3212('0xb1')]}]}]})[_0x3212('0x1e')](handleEntityNotFound(_0xa129d1,null))[_0x3212('0x1e')](function(_0xcdb3a6){if(_0xcdb3a6){_0x163030=_0xcdb3a6;return _0xcdb3a6[_0x3212('0x114')]({'raw':!![]});}})[_0x3212('0x1e')](function(_0x2c0ae1){if(_0x163030){if(_0x2c0ae1){_0xf24677=_0x2c0ae1;}}return require(_0x3212('0x8e'))['getLicense']();})['then'](function(_0x11a5d6){if(_0x11a5d6){_0x1fb2d2=_0x11a5d6[_0x3212('0x115')];_0x5845c6=_0x11a5d6[_0x3212('0x90')];}})[_0x3212('0x1e')](function(){return db[_0x3212('0xbe')][_0x3212('0x2e')]({'where':{'closed':![]}});})['then'](function(_0x5a2155){_0x563b6a=_0x5a2155;if(_0x1fb2d2&&_0x5a2155>_0x1fb2d2){return db[_0x3212('0x116')]['findOne']({'where':{'id':0x1}})[_0x3212('0x1e')](function(_0x159c64){if(_0x159c64){_0x159c64[_0x3212('0x117')]('chatLicenseExceeded');}});}})[_0x3212('0x1e')](function(){var _0x169102=_0x163030['Interval'];var _0x110441=_0x163030[_0x3212('0x9e')]||undefined;return _0x169102?_0x169102[_0x3212('0x9f')](_0x110441):!![];})[_0x3212('0x1e')](function(_0x2acbd9){var _0x29335d=fs[_0x3212('0xe5')](path[_0x3212('0x8b')](config[_0x3212('0x94')],_0x3212('0x118')),_0x3212('0xe7'));var _0xf36a6f=_0x3212('0x119');var _0x2f4434=![];var _0x522927,_0x5575f2;if(_0x4f356c[_0x3212('0xbb')][_0x3212('0x42')]){_0x522927=new URL(_0x4f356c['headers'][_0x3212('0x42')])[_0x3212('0x11a')];}else if(_0x4f356c[_0x3212('0xbb')][_0x3212('0x11a')]){_0x522927=new URL(_0x4f356c['headers']['origin'])[_0x3212('0x11a')];}else{_0x522927='http://localhost:9000';}_0x5575f2=typeof _0x163030['address'][_0x3212('0x3e')](',')[_0x3212('0x67')](function(_0x1ff53b){return wildcardUtils[_0x3212('0x11b')](_0x1ff53b,_0x522927);})!=='undefined';var _0x48706f={'chatVersion':_0xf36a6f,'chatWebsiteAddressOrigin':_0x5575f2?_0x522927:_0x163030['address'],'remote':_0x163030['remote'],'query':querystring['stringify'](_[_0x3212('0x5d')](_0x163030[_0x3212('0x31')]({'plain':!![]}),{'customerIp':_0x4f356c[_0x3212('0xbb')][_0x3212('0x3c')]||_0x4f356c['headers'][_0x3212('0x11c')]||_0x4f356c[_0x3212('0x11d')][_0x3212('0x11e')]||_0x4f356c['ip'],'referer':_0x4f356c[_0x3212('0xbb')][_0x3212('0x42')],'openedInteractions':_0x563b6a,'maxInteractions':_0x1fb2d2,'virtual':_0x5845c6[_0x3212('0x115')],'online':_0x2acbd9,'custom':_0x5845c6,'address':_0x5575f2?_0x522927:null}))[_0x3212('0x11f')](/'/g,'\x5c\x27')};_0xa129d1[_0x3212('0x37')](ejs[_0x3212('0x120')](Mustache['render'](_0x29335d,_0x48706f),{'proactiveActions':_0xf24677,'alignment':_0x163030[_0x3212('0x121')],'verticalAlignment':_0x163030[_0x3212('0x122')],'div_color':_0x163030[_0x3212('0x111')],'labelText':_0x163030[_0x3212('0x123')],'text_color':_0x163030[_0x3212('0x124')],'text_button_color':_0x163030['textButtonColor'],'button_color':_0x163030[_0x3212('0x125')],'background_color':_0x163030[_0x3212('0x126')],'hideWhenOffline':_0x163030[_0x3212('0x127')],'intervalId':_0x163030[_0x3212('0x128')],'isDevelopment':_0x2f4434,'chatVersion':_0xf36a6f}));})[_0x3212('0x27')](handleError(_0xa129d1,null));};exports['addApplications']=function(_0x544b12,_0x2f043f){var _0x884c93=_0x544b12[_0x3212('0x75')]['id'];var _0x100d6c=_0x544b12[_0x3212('0x69')];var _0x370293=0xc8;var _0x14e5cb=null;return db[_0x3212('0xf1')][_0x3212('0x129')]({'isolationLevel':db[_0x3212('0xf1')][_0x3212('0x12a')][_0x3212('0x12b')][_0x3212('0x12c')]},function(_0x7def32){return db[_0x3212('0x60')][_0x3212('0xf4')]({'where':{'id':_0x884c93},'transaction':_0x7def32})[_0x3212('0x1e')](function(_0x3da674){if(_0x3da674){return db['ChatApplication'][_0x3212('0x34')]({'where':{'ChatWebsiteId':_0x884c93},'transaction':_0x7def32})[_0x3212('0x1e')](function(){var _0x239dd3=_[_0x3212('0x4f')](_0x100d6c,function(_0x4327b0){_0x4327b0[_0x3212('0x77')]=_0x884c93;return _0x4327b0;});return db[_0x3212('0xaf')]['bulkCreate'](_0x239dd3,{'transaction':_0x7def32});});}else{_0x370293=0x194;_0x14e5cb=[];}});})['then'](function(){if(_0x370293!==0x194){return db[_0x3212('0xaf')][_0x3212('0x12d')]({'where':{'ChatWebsiteId':_0x884c93},'order':_0x3212('0xb6')})[_0x3212('0x1e')](function(_0xdea68e){_0x14e5cb=_0xdea68e;});}})[_0x3212('0x27')](function(_0x1af398){_0x370293=0x1f4;logger[_0x3212('0x23')](_0x1af398[_0x3212('0x12e')]);if(_0x1af398[_0x3212('0x36')]){delete _0x1af398[_0x3212('0x36')];}_0x14e5cb=_0x1af398;})[_0x3212('0x12f')](function(){if(_0x14e5cb===null){_0x2f043f['sendStatus'](_0x370293);}else{if(_0x370293===0x1f4){_0x2f043f[_0x3212('0x29')](_0x370293)[_0x3212('0x37')](_0x14e5cb);}else{_0x2f043f['status'](_0x370293)[_0x3212('0x2a')](_0x14e5cb);}}});};exports['getApplications']=function(_0xa585b5,_0x57efa5){var _0x5caf79={};var _0x416d7c={};var _0xd840aa;var _0x3f5771;return db[_0x3212('0x60')][_0x3212('0xf4')]({'where':{'id':_0xa585b5[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x57efa5,null))['then'](function(_0xb75803){if(_0xb75803){_0xd840aa=_0xb75803;_0x416d7c[_0x3212('0x48')]=_[_0x3212('0x53')](db[_0x3212('0xaf')][_0x3212('0x50')]);_0x416d7c[_0x3212('0x52')]=_['keys'](_0xa585b5[_0x3212('0x52')]);_0x416d7c[_0x3212('0x5b')]=_['intersection'](_0x416d7c[_0x3212('0x48')],_0x416d7c[_0x3212('0x52')]);_0x5caf79[_0x3212('0x54')]=_[_0x3212('0x66')](_0x416d7c['model'],qs[_0x3212('0x55')](_0xa585b5['query'][_0x3212('0x55')]));_0x5caf79['attributes']=_0x5caf79['attributes'][_0x3212('0x7a')]?_0x5caf79[_0x3212('0x54')]:_0x416d7c['model'];_0x5caf79[_0x3212('0x58')]=qs['sort'](_0xa585b5[_0x3212('0x52')][_0x3212('0x59')]);_0x5caf79['where']=qs[_0x3212('0x5b')](_[_0x3212('0x7b')](_0xa585b5['query'],_0x416d7c[_0x3212('0x5b')]));if(_0xa585b5[_0x3212('0x52')][_0x3212('0x5c')]){_0x5caf79[_0x3212('0x5a')]=_[_0x3212('0x5d')](_0x5caf79[_0x3212('0x5a')],{'$or':_['map'](_0x5caf79[_0x3212('0x54')],function(_0x592ffc){var _0x4b4e6b={};_0x4b4e6b[_0x592ffc]={'$like':'%'+_0xa585b5[_0x3212('0x52')][_0x3212('0x5c')]+'%'};return _0x4b4e6b;})});}_0x5caf79=_[_0x3212('0x5d')]({},_0x5caf79,_0xa585b5[_0x3212('0x5f')]);return _0xd840aa[_0x3212('0x130')](_0x5caf79);}})[_0x3212('0x1e')](function(_0x19fd6a){if(_0x19fd6a){_0x3f5771=_0x19fd6a[_0x3212('0x7a')];if(!_0xa585b5['query'][_0x3212('0x56')](_0x3212('0x57'))){_0x5caf79['limit']=qs[_0x3212('0x2d')](_0xa585b5[_0x3212('0x52')][_0x3212('0x2d')]);_0x5caf79[_0x3212('0x2b')]=qs[_0x3212('0x2b')](_0xa585b5['query'][_0x3212('0x2b')]);}return _0xd840aa[_0x3212('0x130')](_0x5caf79);}})[_0x3212('0x1e')](function(_0x2dedd9){if(_0x2dedd9){return _0x2dedd9?{'count':_0x3f5771,'rows':_0x2dedd9}:null;}})[_0x3212('0x1e')](respondWithResult(_0x57efa5,null))[_0x3212('0x27')](handleError(_0x57efa5,null));};exports[_0x3212('0x131')]=function(_0x56fe82,_0x787711){return db[_0x3212('0x132')]['find']({'where':{'id':_0x56fe82[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x787711,null))['then'](function(_0x4164ae){if(_0x4164ae){return _0x4164ae['addProactiveActions'](_0x56fe82[_0x3212('0x69')][_0x3212('0x7e')],_[_0x3212('0x10a')](_0x56fe82[_0x3212('0x69')],[_0x3212('0x7e'),'id'])||{});}})[_0x3212('0x1e')](respondWithResult(_0x787711,null))[_0x3212('0x27')](handleError(_0x787711,null));};exports[_0x3212('0x114')]=function(_0x348509,_0x5391c8){var _0x3d287c={};var _0x45cd82={};var _0x3c64a1;var _0x43c895;return db[_0x3212('0x60')][_0x3212('0xf4')]({'where':{'id':_0x348509['params']['id']}})['then'](handleEntityNotFound(_0x5391c8,null))[_0x3212('0x1e')](function(_0xddb1b6){if(_0xddb1b6){_0x3c64a1=_0xddb1b6;_0x45cd82[_0x3212('0x48')]=_[_0x3212('0x53')](db[_0x3212('0x133')][_0x3212('0x50')]);_0x45cd82[_0x3212('0x52')]=_['keys'](_0x348509['query']);_0x45cd82[_0x3212('0x5b')]=_['intersection'](_0x45cd82[_0x3212('0x48')],_0x45cd82['query']);_0x3d287c[_0x3212('0x54')]=_[_0x3212('0x66')](_0x45cd82[_0x3212('0x48')],qs['fields'](_0x348509[_0x3212('0x52')][_0x3212('0x55')]));_0x3d287c[_0x3212('0x54')]=_0x3d287c[_0x3212('0x54')]['length']?_0x3d287c['attributes']:_0x45cd82[_0x3212('0x48')];_0x3d287c['order']=qs['sort'](_0x348509[_0x3212('0x52')]['sort']);_0x3d287c[_0x3212('0x5a')]=qs[_0x3212('0x5b')](_[_0x3212('0x7b')](_0x348509[_0x3212('0x52')],_0x45cd82[_0x3212('0x5b')]));if(_0x348509[_0x3212('0x52')][_0x3212('0x5c')]){_0x3d287c[_0x3212('0x5a')]=_[_0x3212('0x5d')](_0x3d287c[_0x3212('0x5a')],{'$or':_[_0x3212('0x4f')](_0x3d287c[_0x3212('0x54')],function(_0x1bc301){var _0x44d8b0={};_0x44d8b0[_0x1bc301]={'$like':'%'+_0x348509[_0x3212('0x52')][_0x3212('0x5c')]+'%'};return _0x44d8b0;})});}_0x3d287c=_[_0x3212('0x5d')]({},_0x3d287c,_0x348509['options']);return _0x3c64a1[_0x3212('0x114')](_0x3d287c);}})['then'](function(_0x26f991){if(_0x26f991){_0x43c895=_0x26f991[_0x3212('0x7a')];if(!_0x348509['query'][_0x3212('0x56')](_0x3212('0x57'))){_0x3d287c[_0x3212('0x2d')]=qs['limit'](_0x348509[_0x3212('0x52')][_0x3212('0x2d')]);_0x3d287c['offset']=qs[_0x3212('0x2b')](_0x348509['query']['offset']);}return _0x3c64a1['getProactiveActions'](_0x3d287c);}})[_0x3212('0x1e')](function(_0x5c769f){if(_0x5c769f){return _0x5c769f?{'count':_0x43c895,'rows':_0x5c769f}:null;}})[_0x3212('0x1e')](respondWithResult(_0x5391c8,null))['catch'](handleError(_0x5391c8,null));};exports['getFields']=function(_0x2b5b0e,_0x1aa61b){var _0xcb81c7=_0x2b5b0e[_0x3212('0x52')][_0x3212('0x134')]==='false'?_0x3212('0x135'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0xcb81c7],'where':{'id':_0x2b5b0e['params']['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x1aa61b,null))['then'](function(_0x1982c7){if(_0x1982c7){var _0x49df5a=_0x1982c7[_0xcb81c7];var _0x3b88ab=_0x49df5a&&_0x49df5a[_0x3212('0x136')]?_0x49df5a['items']:[];_0x1aa61b[_0x3212('0x37')]({'fromKey':_[_0x3212('0x91')](_0x49df5a[_0x3212('0x137')])?undefined:_0x49df5a[_0x3212('0x137')],'count':_0x3b88ab[_0x3212('0x7a')],'rows':_0x3b88ab});}})[_0x3212('0x27')](handleError(_0x1aa61b,null));};exports['getOfflineMessages']=function(_0x8590d5,_0xa77e1){var _0x885068={'raw':![],'where':{}};var _0x4fedb5={};var _0x2dbb3b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3212('0xf4')]({'where':{'id':_0x8590d5[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0xa77e1,null))[_0x3212('0x1e')](function(_0x322b5e){if(_0x322b5e){_0x4fedb5[_0x3212('0x48')]=_[_0x3212('0x53')](db[_0x3212('0xea')][_0x3212('0x50')]);_0x4fedb5[_0x3212('0x52')]=_[_0x3212('0x53')](_0x8590d5[_0x3212('0x52')]);_0x4fedb5['filters']=_[_0x3212('0x66')](_0x4fedb5['model'],_0x4fedb5[_0x3212('0x52')]);_0x885068[_0x3212('0x54')]=_[_0x3212('0x66')](_0x4fedb5[_0x3212('0x48')],qs[_0x3212('0x55')](_0x8590d5['query'][_0x3212('0x55')]));_0x885068[_0x3212('0x54')]=_0x885068[_0x3212('0x54')][_0x3212('0x7a')]?_0x885068['attributes']:_0x4fedb5['model'];if(!_0x8590d5[_0x3212('0x52')][_0x3212('0x56')](_0x3212('0x57'))){_0x885068[_0x3212('0x2d')]=qs[_0x3212('0x2d')](_0x8590d5[_0x3212('0x52')][_0x3212('0x2d')]);_0x885068[_0x3212('0x2b')]=qs[_0x3212('0x2b')](_0x8590d5[_0x3212('0x52')][_0x3212('0x2b')]);}_0x885068[_0x3212('0x58')]=qs['sort'](_0x8590d5[_0x3212('0x52')][_0x3212('0x59')]);_0x885068['where']=qs[_0x3212('0x5b')](_[_0x3212('0x7b')](_0x8590d5[_0x3212('0x52')],_0x4fedb5[_0x3212('0x5b')]));_0x885068[_0x3212('0x5a')][_0x3212('0x77')]=_0x322b5e['id'];if(_0x8590d5[_0x3212('0x52')][_0x3212('0x5c')]){_0x885068[_0x3212('0x5a')]=_[_0x3212('0x5d')](_0x885068[_0x3212('0x5a')],{'$or':_[_0x3212('0x4f')](_0x885068[_0x3212('0x54')],function(_0x308a46){var _0x3a392d={};_0x3a392d[_0x308a46]={'$like':'%'+_0x8590d5['query'][_0x3212('0x5c')]+'%'};return _0x3a392d;})});}_0x885068=_[_0x3212('0x5d')]({},_0x885068,_0x8590d5[_0x3212('0x5f')]);return db[_0x3212('0xea')]['count']({'where':_0x885068['where']})['then'](function(_0x19ec90){_0x2dbb3b['count']=_0x19ec90;if(_0x8590d5['query'][_0x3212('0x61')]){_0x885068[_0x3212('0x62')]=[{'all':!![]}];}else{_0x885068['include']=[{'model':db[_0x3212('0xae')],'as':_0x3212('0x10c'),'required':![]},{'model':db[_0x3212('0xf2')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x885068);})['then'](function(_0x19bd8b){_0x2dbb3b[_0x3212('0x7c')]=_0x19bd8b;return _0x2dbb3b;});}})[_0x3212('0x1e')](respondWithFilteredResult(_0xa77e1,_0x885068))[_0x3212('0x27')](handleError(_0xa77e1,null));};exports[_0x3212('0x138')]=function(_0x141c16,_0x145dd3){return db[_0x3212('0x60')][_0x3212('0x67')]({'where':{'id':_0x141c16[_0x3212('0x75')]['id']}})['then'](handleEntityNotFound(_0x145dd3,null))[_0x3212('0x1e')](function(_0x15a812){if(_0x15a812){return _0x15a812[_0x3212('0x138')](_0x141c16[_0x3212('0x69')][_0x3212('0x7e')],_[_0x3212('0x10a')](_0x141c16['body'],['ids','id'])||{})['spread'](function(_0x4e3ff3){for(var _0x5dda62=0x0;_0x5dda62<_0x141c16[_0x3212('0x69')][_0x3212('0x7e')][_0x3212('0x7a')];_0x5dda62+=0x1){socket['emit'](_0x3212('0x139'),{'UserId':Number(_0x141c16[_0x3212('0x69')]['ids'][_0x5dda62]),'ChatWebsiteId':Number(_0x141c16['params']['id'])});}return _0x4e3ff3;});}})[_0x3212('0x1e')](respondWithResult(_0x145dd3,null))['catch'](handleError(_0x145dd3,null));};exports[_0x3212('0x13a')]=function(_0x1fb016,_0x230999){return db[_0x3212('0x60')][_0x3212('0x67')]({'where':{'id':_0x1fb016[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x230999,null))[_0x3212('0x1e')](function(_0x4d21b0){if(_0x4d21b0){return _0x4d21b0[_0x3212('0x13a')](_0x1fb016['query'][_0x3212('0x7e')])['then'](function(){if(_[_0x3212('0x13b')](_0x1fb016[_0x3212('0x52')][_0x3212('0x7e')])){for(var _0xee24a7=0x0;_0xee24a7<_0x1fb016[_0x3212('0x52')][_0x3212('0x7e')][_0x3212('0x7a')];_0xee24a7+=0x1){socket[_0x3212('0x13c')](_0x3212('0x13d'),{'UserId':Number(_0x1fb016[_0x3212('0x52')][_0x3212('0x7e')][_0xee24a7]),'ChatWebsiteId':Number(_0x1fb016[_0x3212('0x75')]['id'])});}}else{socket[_0x3212('0x13c')]('userChatWebsite:remove',{'UserId':Number(_0x1fb016['query'][_0x3212('0x7e')]),'ChatWebsiteId':Number(_0x1fb016[_0x3212('0x75')]['id'])});}});}})['then'](respondWithStatusCode(_0x230999,null))[_0x3212('0x27')](handleError(_0x230999,null));};exports['getAgents']=function(_0x5e9fa9,_0x668041){var _0x262d20={};var _0x1561da={};var _0x48c23d;var _0x44cd1;return db[_0x3212('0x60')]['findOne']({'where':{'id':_0x5e9fa9[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x668041,null))[_0x3212('0x1e')](function(_0xc13e4d){if(_0xc13e4d){_0x48c23d=_0xc13e4d;_0x1561da[_0x3212('0x48')]=_[_0x3212('0x53')](db[_0x3212('0xce')]['rawAttributes']);_0x1561da[_0x3212('0x52')]=_[_0x3212('0x53')](_0x5e9fa9['query']);_0x1561da[_0x3212('0x5b')]=_['intersection'](_0x1561da[_0x3212('0x48')],_0x1561da['query']);_0x262d20[_0x3212('0x54')]=_[_0x3212('0x66')](_0x1561da['model'],qs[_0x3212('0x55')](_0x5e9fa9[_0x3212('0x52')][_0x3212('0x55')]));_0x262d20[_0x3212('0x54')]=_0x262d20[_0x3212('0x54')][_0x3212('0x7a')]?_0x262d20[_0x3212('0x54')]:_0x1561da[_0x3212('0x48')];_0x262d20[_0x3212('0x58')]=qs[_0x3212('0x59')](_0x5e9fa9[_0x3212('0x52')]['sort']);_0x262d20['where']=qs['filters'](_[_0x3212('0x7b')](_0x5e9fa9[_0x3212('0x52')],_0x1561da[_0x3212('0x5b')]));if(_0x5e9fa9[_0x3212('0x52')][_0x3212('0x5c')]){_0x262d20['where']=_[_0x3212('0x5d')](_0x262d20['where'],{'$or':_['map'](_0x262d20[_0x3212('0x54')],function(_0x38d073){var _0xafb9cc={};_0xafb9cc[_0x38d073]={'$like':'%'+_0x5e9fa9['query']['filter']+'%'};return _0xafb9cc;})});}_0x262d20=_['merge']({},_0x262d20,_0x5e9fa9['options']);return _0x48c23d['getAgents'](_0x262d20);}})['then'](function(_0x3e82ec){if(_0x3e82ec){_0x44cd1=_0x3e82ec[_0x3212('0x7a')];if(!_0x5e9fa9[_0x3212('0x52')]['hasOwnProperty'](_0x3212('0x57'))){_0x262d20[_0x3212('0x2d')]=qs[_0x3212('0x2d')](_0x5e9fa9['query'][_0x3212('0x2d')]);_0x262d20[_0x3212('0x2b')]=qs['offset'](_0x5e9fa9[_0x3212('0x52')][_0x3212('0x2b')]);}return _0x48c23d[_0x3212('0x13e')](_0x262d20);}})[_0x3212('0x1e')](function(_0x508579){if(_0x508579){return _0x508579?{'count':_0x44cd1,'rows':_0x508579}:null;}})[_0x3212('0x1e')](respondWithResult(_0x668041,null))[_0x3212('0x27')](handleError(_0x668041,null));};
\ No newline at end of file
+var _0x4d9e=['waitForTheAssignedQueue','Start','startRouting','EventManager','offline','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','readFileSync','render','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','files','attachments','offline-chat','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','interval','getProactiveActions','getLicense','virtual','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','utf8','origin','http://localhost:9000','remote','x-real-ip','connection','remoteAddress','replace','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','ejs','lodash','html-to-text','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','./helpers/wildcard-expressions','url','URL','../../mysqldb','redis','defaults','http','client','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','then','UserProfileResource','sendStatus','stack','name','send','user-agent-parser','setUA','user-agent','getResult','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','show','keys','includeAll','include','find','body','address','forEach','trim','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','params','describe','addDisposition','Disposition','getDispositions','findOne','ChatWebsiteId','filter','findAll','rows','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','join','root','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','download','showCustomerAvatar','getSystemAvatar','Interval','resolve','timezone','ifTime','notify','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','Body\x20is\x20mandatory','customerIp','CmContact','createdAt','updatedAt','CompanyId','includes','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','List','Contacts','DESC','ChatApplication','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','ListId','headers','threadId','closed','ChatInteraction','referer','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','contact','messageId','created','*,*,*,*','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue'];(function(_0x2e7a79,_0x30f013){var _0x29e00f=function(_0x51b9b7){while(--_0x51b9b7){_0x2e7a79['push'](_0x2e7a79['shift']());}};_0x29e00f(++_0x30f013);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x3c91ab,_0x50d459){_0x3c91ab=_0x3c91ab-0x0;var _0x57d552=_0x4d9e[_0x3c91ab];return _0x57d552;};'use strict';var Mustache=require(_0xe4d9('0x0'));var util=require('util');var path=require('path');var ejs=require(_0xe4d9('0x1'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe4d9('0x2'));var querystring=require('querystring');var htmlToText=require(_0xe4d9('0x3'));var Redis=require(_0xe4d9('0x4'));var jayson=require('jayson/promise');var qs=require(_0xe4d9('0x5'));var logger=require(_0xe4d9('0x6'))(_0xe4d9('0x7'));var config=require(_0xe4d9('0x8'));var APIBadRequestError=require(_0xe4d9('0x9'))[_0xe4d9('0xa')];var APINotFoundError=require('../../errors/api')[_0xe4d9('0xb')];var APIOutOfIntervalError=require(_0xe4d9('0x9'))[_0xe4d9('0xc')];var APIHandleError=require(_0xe4d9('0x9'))[_0xe4d9('0xd')];var APIConflictError=require(_0xe4d9('0x9'))['APIConflictError'];var wildcardUtils=require(_0xe4d9('0xe'));var URL=require(_0xe4d9('0xf'))[_0xe4d9('0x10')];var db=require(_0xe4d9('0x11'))['db'];config[_0xe4d9('0x12')]=_[_0xe4d9('0x13')](config[_0xe4d9('0x12')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0xe4d9('0x14')]({'port':0x232a});var client9003=jayson[_0xe4d9('0x15')][_0xe4d9('0x14')]({'port':0x232b});var client9001=jayson['client'][_0xe4d9('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x3f6ce4,_0xe4f133,_0x4283f7,_0x58d0cf){return new Promise(function(_0x331ef3,_0x35cbc2){var _0x4687f8=_0x58d0cf||client;return _0x4687f8['request'](_0x3f6ce4,_0x4283f7)['then'](function(_0x7abb80){logger[_0xe4d9('0x16')]('ChatWebsite,\x20%s,\x20%s',_0xe4f133,_0xe4d9('0x17'));logger['debug'](_0xe4d9('0x18'),_0xe4f133,_0xe4d9('0x17'),JSON[_0xe4d9('0x19')](_0x7abb80));if(_0x7abb80[_0xe4d9('0x1a')]){if(_0x7abb80['error'][_0xe4d9('0x1b')]===0x1f4){logger[_0xe4d9('0x1a')](_0xe4d9('0x1c'),_0xe4f133,_0x7abb80[_0xe4d9('0x1a')][_0xe4d9('0x1d')]);return _0x35cbc2(_0x7abb80[_0xe4d9('0x1a')][_0xe4d9('0x1d')]);}logger[_0xe4d9('0x1a')](_0xe4d9('0x1c'),_0xe4f133,_0x7abb80['error'][_0xe4d9('0x1d')]);return _0x331ef3(_0x7abb80[_0xe4d9('0x1a')]['message']);}else{logger[_0xe4d9('0x16')]('ChatWebsite,\x20%s,\x20%s',_0xe4f133,_0xe4d9('0x17'));_0x331ef3(_0x7abb80[_0xe4d9('0x1e')]['message']);}})[_0xe4d9('0x1f')](function(_0x32e7da){logger['error'](_0xe4d9('0x1c'),_0xe4f133,_0x32e7da);_0x35cbc2(_0x32e7da);});});}function respondWithStatusCode(_0x2af9b0,_0x36444c){_0x36444c=_0x36444c||0xcc;return function(_0x5bb43b){if(_0x5bb43b){return _0x2af9b0['sendStatus'](_0x36444c);}return _0x2af9b0[_0xe4d9('0x20')](_0x36444c)[_0xe4d9('0x21')]();};}function respondWithResult(_0x52ef56,_0x5dddd2){_0x5dddd2=_0x5dddd2||0xc8;return function(_0x4954b5){if(_0x4954b5){return _0x52ef56['status'](_0x5dddd2)[_0xe4d9('0x22')](_0x4954b5);}};}function respondWithFilteredResult(_0x48d481,_0x40ffd0){return function(_0x1f3d90){if(_0x1f3d90){var _0x4192bb=typeof _0x40ffd0['offset']===_0xe4d9('0x23')&&typeof _0x40ffd0[_0xe4d9('0x24')]===_0xe4d9('0x23');var _0x45e8a3=_0x1f3d90[_0xe4d9('0x25')];var _0x1904d1=_0x4192bb?0x0:_0x40ffd0[_0xe4d9('0x26')];var _0x449cb8=_0x4192bb?_0x1f3d90[_0xe4d9('0x25')]:_0x40ffd0[_0xe4d9('0x26')]+_0x40ffd0[_0xe4d9('0x24')];var _0x29a121;if(_0x449cb8>=_0x45e8a3){_0x449cb8=_0x45e8a3;_0x29a121=0xc8;}else{_0x29a121=0xce;}_0x48d481['status'](_0x29a121);return _0x48d481[_0xe4d9('0x27')](_0xe4d9('0x28'),_0x1904d1+'-'+_0x449cb8+'/'+_0x45e8a3)[_0xe4d9('0x22')](_0x1f3d90);}return null;};}function saveUpdates(_0x3721a0){return function(_0xa444d0){if(_0xa444d0){return _0xa444d0[_0xe4d9('0x29')](_0x3721a0)['then'](function(_0x532414){return _0x532414;});}return null;};}function removeEntity(_0x4d7f17){return function(_0x270cad){if(_0x270cad){return _0x270cad[_0xe4d9('0x2a')]()[_0xe4d9('0x2b')](function(){var _0x4f8abf=_0x270cad['get']({'plain':!![]});var _0x5ad794='ChatWebsites';return db[_0xe4d9('0x2c')][_0xe4d9('0x2a')]({'where':{'type':_0x5ad794,'resourceId':_0x4f8abf['id']}})['then'](function(){return _0x270cad;});})[_0xe4d9('0x2b')](function(){_0x4d7f17[_0xe4d9('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x831143){return function(_0x20e78a){if(!_0x20e78a){_0x831143[_0xe4d9('0x2d')](0x194);}return _0x20e78a;};}function handleError(_0x4f7a6c,_0x3321f8){_0x3321f8=_0x3321f8||0x1f4;return function(_0x37a825){logger[_0xe4d9('0x1a')](_0x37a825[_0xe4d9('0x2e')]);if(_0x37a825[_0xe4d9('0x2f')]){delete _0x37a825[_0xe4d9('0x2f')];}_0x4f7a6c[_0xe4d9('0x20')](_0x3321f8)[_0xe4d9('0x30')](_0x37a825);};}function createInteractionObject(_0x234b62,_0x34f72f,_0x5601cc,_0x35b5f5){var _0x20aef6=require(_0xe4d9('0x31'));var _0x27028d=new _0x20aef6();var _0x26a721=_0x27028d[_0xe4d9('0x32')](_0x5601cc[_0xe4d9('0x33')])[_0xe4d9('0x34')]();var _0x96a350=_0x34f72f['customerIp'];if(_0x5601cc['cf-connecting-ip']){_0x96a350=_0x5601cc['cf-connecting-ip'];}else if(_0x5601cc[_0xe4d9('0x35')]){_0x96a350=_[_0xe4d9('0x36')](_0x5601cc[_0xe4d9('0x35')][_0xe4d9('0x37')](','));}return{'ContactId':_0x35b5f5['id'],'ChatWebsiteId':_0x234b62,'from':(_0x35b5f5[_0xe4d9('0x38')]||'')+'\x20'+(_0x35b5f5[_0xe4d9('0x39')]||''),'customerIp':_0x96a350,'customerPort':_0x5601cc[_0xe4d9('0x3a')]?_0x5601cc['x-real-port']:null,'referer':_0x34f72f['referer'],'browserName':_0x26a721['browser'][_0xe4d9('0x2f')]&&_0x26a721[_0xe4d9('0x3b')]['version']?util[_0xe4d9('0x3c')](_0xe4d9('0x3d'),_0x26a721[_0xe4d9('0x3b')][_0xe4d9('0x2f')],_0x26a721['browser'][_0xe4d9('0x3e')]):_0xe4d9('0x3f'),'browserVersion':_0x26a721[_0xe4d9('0x3b')][_0xe4d9('0x3e')]||_0xe4d9('0x3f'),'osName':util[_0xe4d9('0x3c')](_0xe4d9('0x3d'),_0x26a721['os'][_0xe4d9('0x2f')],_0x26a721['os'][_0xe4d9('0x3e')]),'osVersion':_0x26a721['os'][_0xe4d9('0x3e')],'deviceModel':_0x26a721[_0xe4d9('0x40')]['model']&&_0x26a721[_0xe4d9('0x40')][_0xe4d9('0x41')]?util[_0xe4d9('0x3c')](_0xe4d9('0x42'),_0x26a721[_0xe4d9('0x40')]['model'],_0x26a721[_0xe4d9('0x40')][_0xe4d9('0x41')],_0x26a721[_0xe4d9('0x40')][_0xe4d9('0x43')]):null,'deviceVendor':_0x26a721[_0xe4d9('0x40')][_0xe4d9('0x41')],'deviceType':_0x26a721[_0xe4d9('0x40')][_0xe4d9('0x43')],'formData':JSON[_0xe4d9('0x19')](_0x34f72f)};}exports[_0xe4d9('0x44')]=function(_0x5510e7,_0x246550){var _0x179117={'include':[{'model':db[_0xe4d9('0x45')],'as':_0xe4d9('0x46')}]},_0x96ead7={},_0x54bf07={'count':0x0,'rows':[]};var _0x79baad=_[_0xe4d9('0x47')](db[_0xe4d9('0x48')][_0xe4d9('0x49')],function(_0x126b6c){return{'name':_0x126b6c['fieldName'],'type':_0x126b6c[_0xe4d9('0x43')][_0xe4d9('0x4a')]};});_0x96ead7[_0xe4d9('0x4b')]=_[_0xe4d9('0x47')](_0x79baad,_0xe4d9('0x2f'));_0x96ead7[_0xe4d9('0x4c')]=_['keys'](_0x5510e7[_0xe4d9('0x4c')]);_0x96ead7[_0xe4d9('0x4d')]=_[_0xe4d9('0x4e')](_0x96ead7[_0xe4d9('0x4b')],_0x96ead7[_0xe4d9('0x4c')]);_0x179117[_0xe4d9('0x4f')]=_['intersection'](_0x96ead7[_0xe4d9('0x4b')],qs[_0xe4d9('0x50')](_0x5510e7['query'][_0xe4d9('0x50')]));_0x179117['attributes']=_0x179117[_0xe4d9('0x4f')][_0xe4d9('0x51')]?_0x179117['attributes']:_0x96ead7[_0xe4d9('0x4b')];if(!_0x5510e7['query'][_0xe4d9('0x52')](_0xe4d9('0x53'))){_0x179117[_0xe4d9('0x24')]=qs['limit'](_0x5510e7[_0xe4d9('0x4c')][_0xe4d9('0x24')]);_0x179117['offset']=qs[_0xe4d9('0x26')](_0x5510e7[_0xe4d9('0x4c')][_0xe4d9('0x26')]);}_0x179117[_0xe4d9('0x54')]=qs['sort'](_0x5510e7['query'][_0xe4d9('0x55')]);_0x179117[_0xe4d9('0x56')]=qs[_0xe4d9('0x4d')](_[_0xe4d9('0x57')](_0x5510e7[_0xe4d9('0x4c')],_0x96ead7[_0xe4d9('0x4d')]),_0x79baad);if(_0x5510e7['query']['filter']){_0x179117[_0xe4d9('0x56')]=_[_0xe4d9('0x58')](_0x179117[_0xe4d9('0x56')],{'$or':_[_0xe4d9('0x47')](_0x79baad,function(_0xfe53b8){if(_0xfe53b8[_0xe4d9('0x43')]!=='VIRTUAL'){var _0x4ac680={};_0x4ac680[_0xfe53b8[_0xe4d9('0x2f')]]={'$like':'%'+_0x5510e7[_0xe4d9('0x4c')]['filter']+'%'};return _0x4ac680;}})});}_0x179117=_[_0xe4d9('0x58')]({},_0x179117,_0x5510e7[_0xe4d9('0x59')]);var _0x281fda={'where':_0x179117['where']};return db[_0xe4d9('0x48')]['count'](_0x281fda)[_0xe4d9('0x2b')](function(_0x13b008){_0x54bf07[_0xe4d9('0x25')]=_0x13b008;if(_0x5510e7['query']['includeAll']){_0x179117['include']=[{'all':!![]}];}return db[_0xe4d9('0x48')]['findAll'](_0x179117);})[_0xe4d9('0x2b')](function(_0x4c37a6){_0x54bf07['rows']=_0x4c37a6;return _0x54bf07;})[_0xe4d9('0x2b')](respondWithFilteredResult(_0x246550,_0x179117))[_0xe4d9('0x1f')](handleError(_0x246550,null));};exports[_0xe4d9('0x5a')]=function(_0x1469b8,_0x1ef819){var _0x580bb4={'raw':![],'where':{'id':_0x1469b8['params']['id']},'include':[{'model':db['Pause'],'as':_0xe4d9('0x46')}]},_0x49a622={};_0x49a622[_0xe4d9('0x4b')]=_[_0xe4d9('0x5b')](db[_0xe4d9('0x48')][_0xe4d9('0x49')]);_0x49a622[_0xe4d9('0x4c')]=_[_0xe4d9('0x5b')](_0x1469b8['query']);_0x49a622['filters']=_[_0xe4d9('0x4e')](_0x49a622[_0xe4d9('0x4b')],_0x49a622[_0xe4d9('0x4c')]);_0x580bb4[_0xe4d9('0x4f')]=_[_0xe4d9('0x4e')](_0x49a622[_0xe4d9('0x4b')],qs[_0xe4d9('0x50')](_0x1469b8[_0xe4d9('0x4c')][_0xe4d9('0x50')]));_0x580bb4[_0xe4d9('0x4f')]=_0x580bb4[_0xe4d9('0x4f')][_0xe4d9('0x51')]?_0x580bb4['attributes']:_0x49a622[_0xe4d9('0x4b')];if(_0x1469b8[_0xe4d9('0x4c')][_0xe4d9('0x5c')]){_0x580bb4[_0xe4d9('0x5d')]=[{'all':!![]}];}_0x580bb4=_['merge']({},_0x580bb4,_0x1469b8['options']);return db['ChatWebsite'][_0xe4d9('0x5e')](_0x580bb4)[_0xe4d9('0x2b')](handleEntityNotFound(_0x1ef819,null))[_0xe4d9('0x2b')](respondWithResult(_0x1ef819,null))[_0xe4d9('0x1f')](handleError(_0x1ef819,null));};exports['create']=function(_0x53975f,_0x383cd4){var _0xf41d89=null;_0x53975f[_0xe4d9('0x5f')][_0xe4d9('0x60')][_0xe4d9('0x37')](',')[_0xe4d9('0x61')](_0x4bb111=>{if(_0x4bb111[_0xe4d9('0x62')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x4bb111[_0xe4d9('0x62')]())){_0xf41d89=new APIBadRequestError('\x22'+_0x4bb111[_0xe4d9('0x62')]()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0xf41d89){return handleError(_0x383cd4,null)(_0xf41d89);}return db[_0xe4d9('0x48')][_0xe4d9('0x63')](_0x53975f['body'],{})[_0xe4d9('0x2b')](function(_0x655901){var _0x46d795=_0x53975f[_0xe4d9('0x64')][_0xe4d9('0x65')]({'plain':!![]});if(!_0x46d795)throw new Error(_0xe4d9('0x66'));if(_0x46d795['role']==='user'){var _0x3473ad=_0x655901['get']({'plain':!![]});var _0x10ef01='ChatWebsites';return db['UserProfileSection'][_0xe4d9('0x5e')]({'where':{'name':_0x10ef01,'userProfileId':_0x46d795[_0xe4d9('0x67')]},'raw':!![]})[_0xe4d9('0x2b')](function(_0x5b0471){if(_0x5b0471&&_0x5b0471[_0xe4d9('0x68')]===0x0){return db['UserProfileResource'][_0xe4d9('0x63')]({'name':_0x3473ad[_0xe4d9('0x2f')],'resourceId':_0x3473ad['id'],'type':_0x5b0471[_0xe4d9('0x2f')],'sectionId':_0x5b0471['id']},{})[_0xe4d9('0x2b')](function(){return _0x655901;});}else{return _0x655901;}})['catch'](function(_0x3b9fd3){logger[_0xe4d9('0x1a')](_0xe4d9('0x69'),_0x3b9fd3);throw _0x3b9fd3;});}return _0x655901;})[_0xe4d9('0x2b')](respondWithResult(_0x383cd4,0xc9))[_0xe4d9('0x1f')](handleError(_0x383cd4,null));};exports[_0xe4d9('0x29')]=function(_0x1fa518,_0x2ce194){var _0x29c3fe=null;_0x1fa518['body'][_0xe4d9('0x60')]['split'](',')[_0xe4d9('0x61')](_0x2847b9=>{if(_0x2847b9[_0xe4d9('0x62')]()!==''&&!wildcardUtils[_0xe4d9('0x6a')](_0x2847b9['trim']())){_0x29c3fe=new APIBadRequestError('\x22'+_0x2847b9['trim']()+_0xe4d9('0x6b'));}});if(_0x29c3fe){return handleError(_0x2ce194,null)(_0x29c3fe);}if(_0x1fa518[_0xe4d9('0x5f')]['id']){delete _0x1fa518[_0xe4d9('0x5f')]['id'];}return db[_0xe4d9('0x48')][_0xe4d9('0x5e')]({'where':{'id':_0x1fa518[_0xe4d9('0x6c')]['id']},'include':[{'model':db[_0xe4d9('0x45')],'as':_0xe4d9('0x46')}]})[_0xe4d9('0x2b')](handleEntityNotFound(_0x2ce194,null))['then'](saveUpdates(_0x1fa518[_0xe4d9('0x5f')],null))[_0xe4d9('0x2b')](respondWithResult(_0x2ce194,null))['catch'](handleError(_0x2ce194,null));};exports[_0xe4d9('0x2a')]=function(_0x440457,_0x1b5c79){return db[_0xe4d9('0x48')][_0xe4d9('0x5e')]({'where':{'id':_0x440457['params']['id']}})[_0xe4d9('0x2b')](handleEntityNotFound(_0x1b5c79,null))[_0xe4d9('0x2b')](removeEntity(_0x1b5c79,null))[_0xe4d9('0x1f')](handleError(_0x1b5c79,null));};exports[_0xe4d9('0x6d')]=function(_0x458eea,_0x354259){return db[_0xe4d9('0x48')][_0xe4d9('0x6d')]()[_0xe4d9('0x2b')](respondWithResult(_0x354259,null))['catch'](handleError(_0x354259,null));};exports[_0xe4d9('0x6e')]=function(_0x5442b7,_0x28fb7d){if(_0x5442b7[_0xe4d9('0x5f')]['id']){delete _0x5442b7[_0xe4d9('0x5f')]['id'];}return db[_0xe4d9('0x48')]['find']({'where':{'id':_0x5442b7[_0xe4d9('0x6c')]['id']}})[_0xe4d9('0x2b')](handleEntityNotFound(_0x28fb7d,null))['then'](function(_0x23bcfe){if(_0x23bcfe){_0x5442b7[_0xe4d9('0x5f')]['ChatWebsiteId']=_0x23bcfe['id'];return db[_0xe4d9('0x6f')][_0xe4d9('0x63')](_0x5442b7[_0xe4d9('0x5f')]);}})[_0xe4d9('0x2b')](respondWithResult(_0x28fb7d,null))[_0xe4d9('0x1f')](handleError(_0x28fb7d,null));};exports[_0xe4d9('0x70')]=function(_0x28b900,_0x23d38f){var _0x3e1fd4={'raw':![],'where':{}};var _0x5429fa={};var _0xdfe0af={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe4d9('0x71')]({'where':{'id':_0x28b900['params']['id']}})[_0xe4d9('0x2b')](handleEntityNotFound(_0x23d38f,null))[_0xe4d9('0x2b')](function(_0x1a7596){if(_0x1a7596){_0x5429fa[_0xe4d9('0x4b')]=_[_0xe4d9('0x5b')](db[_0xe4d9('0x6f')][_0xe4d9('0x49')]);_0x5429fa[_0xe4d9('0x4c')]=_['keys'](_0x28b900[_0xe4d9('0x4c')]);_0x5429fa[_0xe4d9('0x4d')]=_[_0xe4d9('0x4e')](_0x5429fa[_0xe4d9('0x4b')],_0x5429fa[_0xe4d9('0x4c')]);_0x3e1fd4[_0xe4d9('0x4f')]=_[_0xe4d9('0x4e')](_0x5429fa[_0xe4d9('0x4b')],qs[_0xe4d9('0x50')](_0x28b900[_0xe4d9('0x4c')][_0xe4d9('0x50')]));_0x3e1fd4[_0xe4d9('0x4f')]=_0x3e1fd4[_0xe4d9('0x4f')]['length']?_0x3e1fd4[_0xe4d9('0x4f')]:_0x5429fa[_0xe4d9('0x4b')];if(!_0x28b900['query'][_0xe4d9('0x52')](_0xe4d9('0x53'))){_0x3e1fd4['limit']=qs[_0xe4d9('0x24')](_0x28b900[_0xe4d9('0x4c')][_0xe4d9('0x24')]);_0x3e1fd4[_0xe4d9('0x26')]=qs[_0xe4d9('0x26')](_0x28b900[_0xe4d9('0x4c')][_0xe4d9('0x26')]);}_0x3e1fd4[_0xe4d9('0x54')]=qs[_0xe4d9('0x55')](_0x28b900[_0xe4d9('0x4c')][_0xe4d9('0x55')]);_0x3e1fd4[_0xe4d9('0x56')]=qs[_0xe4d9('0x4d')](_['pick'](_0x28b900['query'],_0x5429fa['filters']));_0x3e1fd4[_0xe4d9('0x56')][_0xe4d9('0x72')]=_0x1a7596['id'];if(_0x28b900['query']['filter']){_0x3e1fd4[_0xe4d9('0x56')]=_['merge'](_0x3e1fd4[_0xe4d9('0x56')],{'$or':_['map'](_0x3e1fd4[_0xe4d9('0x4f')],function(_0x133f5a){var _0x5b2782={};_0x5b2782[_0x133f5a]={'$like':'%'+_0x28b900[_0xe4d9('0x4c')][_0xe4d9('0x73')]+'%'};return _0x5b2782;})});}_0x3e1fd4=_[_0xe4d9('0x58')]({},_0x3e1fd4,_0x28b900['options']);return db[_0xe4d9('0x6f')][_0xe4d9('0x25')]({'where':_0x3e1fd4[_0xe4d9('0x56')]})[_0xe4d9('0x2b')](function(_0xaab18c){_0xdfe0af[_0xe4d9('0x25')]=_0xaab18c;if(_0x28b900[_0xe4d9('0x4c')][_0xe4d9('0x5c')]){_0x3e1fd4[_0xe4d9('0x5d')]=[{'all':!![]}];}return db[_0xe4d9('0x6f')][_0xe4d9('0x74')](_0x3e1fd4);})[_0xe4d9('0x2b')](function(_0x1936ab){_0xdfe0af[_0xe4d9('0x75')]=_0x1936ab;return _0xdfe0af;});}})[_0xe4d9('0x2b')](respondWithFilteredResult(_0x23d38f,_0x3e1fd4))[_0xe4d9('0x1f')](handleError(_0x23d38f,null));};exports[_0xe4d9('0x76')]=function(_0x35af23,_0x2c1ac4){return db[_0xe4d9('0x48')][_0xe4d9('0x5e')]({'where':{'id':_0x35af23[_0xe4d9('0x6c')]['id']}})[_0xe4d9('0x2b')](handleEntityNotFound(_0x2c1ac4,null))[_0xe4d9('0x2b')](function(_0x558f1e){if(_0x558f1e){return _0x558f1e[_0xe4d9('0x76')](_0x35af23[_0xe4d9('0x4c')][_0xe4d9('0x77')]);}})[_0xe4d9('0x2b')](respondWithStatusCode(_0x2c1ac4,null))[_0xe4d9('0x1f')](handleError(_0x2c1ac4,null));};exports['addAnswer']=function(_0x2dcdf9,_0x57adb6){if(_0x2dcdf9[_0xe4d9('0x5f')]['id']){delete _0x2dcdf9[_0xe4d9('0x5f')]['id'];}return db[_0xe4d9('0x48')][_0xe4d9('0x5e')]({'where':{'id':_0x2dcdf9[_0xe4d9('0x6c')]['id']}})['then'](handleEntityNotFound(_0x57adb6,null))[_0xe4d9('0x2b')](function(_0x27404d){if(_0x27404d){_0x2dcdf9[_0xe4d9('0x5f')][_0xe4d9('0x72')]=_0x27404d['id'];return db['CannedAnswer']['create'](_0x2dcdf9[_0xe4d9('0x5f')]);}})[_0xe4d9('0x2b')](respondWithResult(_0x57adb6,null))['catch'](handleError(_0x57adb6,null));};exports[_0xe4d9('0x78')]=function(_0x35a316,_0x312699){var _0x2ab4a3={'raw':![],'where':{}};var _0x40a04f={};var _0x28c84a={'count':0x0,'rows':[]};return db[_0xe4d9('0x48')][_0xe4d9('0x71')]({'where':{'id':_0x35a316[_0xe4d9('0x6c')]['id']}})[_0xe4d9('0x2b')](handleEntityNotFound(_0x312699,null))[_0xe4d9('0x2b')](function(_0x52a87d){if(_0x52a87d){_0x40a04f[_0xe4d9('0x4b')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x40a04f[_0xe4d9('0x4c')]=_[_0xe4d9('0x5b')](_0x35a316[_0xe4d9('0x4c')]);_0x40a04f[_0xe4d9('0x4d')]=_[_0xe4d9('0x4e')](_0x40a04f[_0xe4d9('0x4b')],_0x40a04f[_0xe4d9('0x4c')]);_0x2ab4a3['attributes']=_[_0xe4d9('0x4e')](_0x40a04f[_0xe4d9('0x4b')],qs[_0xe4d9('0x50')](_0x35a316[_0xe4d9('0x4c')][_0xe4d9('0x50')]));_0x2ab4a3['attributes']=_0x2ab4a3[_0xe4d9('0x4f')][_0xe4d9('0x51')]?_0x2ab4a3['attributes']:_0x40a04f[_0xe4d9('0x4b')];if(!_0x35a316[_0xe4d9('0x4c')][_0xe4d9('0x52')](_0xe4d9('0x53'))){_0x2ab4a3['limit']=qs[_0xe4d9('0x24')](_0x35a316['query'][_0xe4d9('0x24')]);_0x2ab4a3[_0xe4d9('0x26')]=qs[_0xe4d9('0x26')](_0x35a316[_0xe4d9('0x4c')][_0xe4d9('0x26')]);}_0x2ab4a3[_0xe4d9('0x54')]=qs[_0xe4d9('0x55')](_0x35a316['query']['sort']);_0x2ab4a3[_0xe4d9('0x56')]=qs[_0xe4d9('0x4d')](_[_0xe4d9('0x57')](_0x35a316[_0xe4d9('0x4c')],_0x40a04f['filters']));_0x2ab4a3['where']['ChatWebsiteId']=_0x52a87d['id'];if(_0x35a316[_0xe4d9('0x4c')][_0xe4d9('0x73')]){_0x2ab4a3[_0xe4d9('0x56')]=_[_0xe4d9('0x58')](_0x2ab4a3[_0xe4d9('0x56')],{'$or':_[_0xe4d9('0x47')](_0x2ab4a3[_0xe4d9('0x4f')],function(_0x3d0dca){var _0x57a98f={};_0x57a98f[_0x3d0dca]={'$like':'%'+_0x35a316[_0xe4d9('0x4c')][_0xe4d9('0x73')]+'%'};return _0x57a98f;})});}_0x2ab4a3=_['merge']({},_0x2ab4a3,_0x35a316['options']);return db[_0xe4d9('0x79')][_0xe4d9('0x25')]({'where':_0x2ab4a3[_0xe4d9('0x56')]})[_0xe4d9('0x2b')](function(_0x5bf730){_0x28c84a[_0xe4d9('0x25')]=_0x5bf730;if(_0x35a316[_0xe4d9('0x4c')]['includeAll']){_0x2ab4a3[_0xe4d9('0x5d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe4d9('0x74')](_0x2ab4a3);})['then'](function(_0x317cec){_0x28c84a['rows']=_0x317cec;return _0x28c84a;});}})[_0xe4d9('0x2b')](respondWithFilteredResult(_0x312699,_0x2ab4a3))[_0xe4d9('0x1f')](handleError(_0x312699,null));};exports[_0xe4d9('0x7a')]=function(_0x393384,_0x255b71){return db[_0xe4d9('0x48')][_0xe4d9('0x5e')]({'where':{'id':_0x393384[_0xe4d9('0x6c')]['id']}})['then'](handleEntityNotFound(_0x255b71,null))[_0xe4d9('0x2b')](function(_0x552a22){if(_0x552a22){return _0x552a22[_0xe4d9('0x7a')](_0x393384[_0xe4d9('0x4c')][_0xe4d9('0x77')]);}})[_0xe4d9('0x2b')](respondWithStatusCode(_0x255b71,null))[_0xe4d9('0x1f')](handleError(_0x255b71,null));};exports[_0xe4d9('0x7b')]=function(_0x543c7b,_0x308859){_0x543c7b[_0xe4d9('0x5f')][_0xe4d9('0x7c')]=_0x543c7b[_0xe4d9('0x7d')][_0xe4d9('0x7e')];return db[_0xe4d9('0x48')][_0xe4d9('0x5e')]({'where':{'id':_0x543c7b[_0xe4d9('0x6c')]['id']}})[_0xe4d9('0x2b')](handleEntityNotFound(_0x308859,null))['then'](saveUpdates(_0x543c7b['body'],null))[_0xe4d9('0x2b')](respondWithResult(_0x308859,null))[_0xe4d9('0x1f')](handleError(_0x308859,null));};exports[_0xe4d9('0x7f')]=function(_0x280160,_0x5a5446){_0x280160[_0xe4d9('0x5f')]['agentAvatar']=_0x280160[_0xe4d9('0x7d')][_0xe4d9('0x7e')];return db['ChatWebsite']['find']({'where':{'id':_0x280160[_0xe4d9('0x6c')]['id']}})[_0xe4d9('0x2b')](handleEntityNotFound(_0x5a5446,null))[_0xe4d9('0x2b')](saveUpdates(_0x280160[_0xe4d9('0x5f')],null))[_0xe4d9('0x2b')](respondWithResult(_0x5a5446,null))[_0xe4d9('0x1f')](handleError(_0x5a5446,null));};exports[_0xe4d9('0x80')]=function(_0x2af820,_0x4fdebb){_0x2af820[_0xe4d9('0x5f')][_0xe4d9('0x81')]=_0x2af820[_0xe4d9('0x7d')]['filename'];return db[_0xe4d9('0x48')][_0xe4d9('0x5e')]({'where':{'id':_0x2af820['params']['id']}})[_0xe4d9('0x2b')](handleEntityNotFound(_0x4fdebb,null))[_0xe4d9('0x2b')](saveUpdates(_0x2af820[_0xe4d9('0x5f')],null))[_0xe4d9('0x2b')](respondWithResult(_0x4fdebb,null))[_0xe4d9('0x1f')](handleError(_0x4fdebb,null));};exports['addSystemAvatar']=function(_0x3e69ba,_0x53aa65){_0x3e69ba['body'][_0xe4d9('0x82')]=_0x3e69ba[_0xe4d9('0x7d')]['filename'];return db['ChatWebsite'][_0xe4d9('0x5e')]({'where':{'id':_0x3e69ba[_0xe4d9('0x6c')]['id']}})[_0xe4d9('0x2b')](handleEntityNotFound(_0x53aa65,null))[_0xe4d9('0x2b')](saveUpdates(_0x3e69ba[_0xe4d9('0x5f')],null))[_0xe4d9('0x2b')](respondWithResult(_0x53aa65,null))[_0xe4d9('0x1f')](handleError(_0x53aa65,null));};exports[_0xe4d9('0x83')]=function(_0x1794e1,_0x59dcff){var _0x175eed=path['join'](config['root'],_0xe4d9('0x84'));var _0x7e202d={'where':{'id':_0x1794e1['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x576fcf=![];return require(_0xe4d9('0x85'))['getLicense']()[_0xe4d9('0x2b')](function(_0x4c8cd1){if(_0x4c8cd1){_0x576fcf=_0x4c8cd1[_0xe4d9('0x86')];}})[_0xe4d9('0x2b')](function(){return db[_0xe4d9('0x48')][_0xe4d9('0x5e')](_0x7e202d);})['then'](handleEntityNotFound(_0x59dcff,null))[_0xe4d9('0x2b')](function(_0x14b55f){if(_0x14b55f){if(!_[_0xe4d9('0x87')](_0x14b55f[_0xe4d9('0x7c')])){if(fs[_0xe4d9('0x88')](path['join'](config['root'],_0xe4d9('0x89'),_0x14b55f[_0xe4d9('0x7c')]))&&_0x576fcf){_0x175eed=path[_0xe4d9('0x8a')](config[_0xe4d9('0x8b')],_0xe4d9('0x89'),_0x14b55f[_0xe4d9('0x7c')]);}}return _0x59dcff['download'](_0x175eed);}})[_0xe4d9('0x1f')](handleError(_0x59dcff,null));};exports['getAvatar']=function(_0x5e6f0f,_0x1fbcad){var _0x446551=path[_0xe4d9('0x8a')](config[_0xe4d9('0x8b')],_0xe4d9('0x8c'));var _0x4eb401={'where':{'id':_0x5e6f0f[_0xe4d9('0x6c')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xe4d9('0x48')][_0xe4d9('0x5e')](_0x4eb401)[_0xe4d9('0x2b')](handleEntityNotFound(_0x1fbcad,null))['then'](function(_0x392bef){if(_0x392bef){if(!_['isNil'](_0x392bef['agentAvatar'])){if(fs[_0xe4d9('0x88')](path[_0xe4d9('0x8a')](config['root'],'server/files/images/avatars/',_0x392bef[_0xe4d9('0x8d')]))){_0x446551=path[_0xe4d9('0x8a')](config[_0xe4d9('0x8b')],_0xe4d9('0x8e'),_0x392bef[_0xe4d9('0x8d')]);}}return _0x1fbcad[_0xe4d9('0x8f')](_0x446551);}})[_0xe4d9('0x1f')](handleError(_0x1fbcad,null));};exports['getCustomerAvatar']=function(_0x4c69ee,_0x704678){var _0x22ef03=path[_0xe4d9('0x8a')](config[_0xe4d9('0x8b')],'server/files/images/avatars/customer_avatar.png');var _0x15ad99={'where':{'id':_0x4c69ee[_0xe4d9('0x6c')]['id']},'attributes':['id',_0xe4d9('0x81'),_0xe4d9('0x90')],'raw':!![]};return db[_0xe4d9('0x48')][_0xe4d9('0x5e')](_0x15ad99)[_0xe4d9('0x2b')](handleEntityNotFound(_0x704678,null))[_0xe4d9('0x2b')](function(_0x41ff9f){if(_0x41ff9f){if(!_[_0xe4d9('0x87')](_0x41ff9f['customerAvatar'])){if(fs[_0xe4d9('0x88')](path[_0xe4d9('0x8a')](config[_0xe4d9('0x8b')],_0xe4d9('0x8e'),_0x41ff9f[_0xe4d9('0x81')]))&&_0x41ff9f[_0xe4d9('0x90')]){_0x22ef03=path[_0xe4d9('0x8a')](config[_0xe4d9('0x8b')],_0xe4d9('0x8e'),_0x41ff9f['customerAvatar']);}}return _0x704678[_0xe4d9('0x8f')](_0x22ef03);}})[_0xe4d9('0x1f')](handleError(_0x704678,null));};exports[_0xe4d9('0x91')]=function(_0x4cacc0,_0x4697d0){var _0x538db5=path[_0xe4d9('0x8a')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x5839c5={'where':{'id':_0x4cacc0[_0xe4d9('0x6c')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0xe4d9('0x5e')](_0x5839c5)[_0xe4d9('0x2b')](handleEntityNotFound(_0x4697d0,null))[_0xe4d9('0x2b')](function(_0x4e0e73){if(_0x4e0e73){if(!_[_0xe4d9('0x87')](_0x4e0e73[_0xe4d9('0x82')])){if(fs[_0xe4d9('0x88')](path['join'](config[_0xe4d9('0x8b')],_0xe4d9('0x8e'),_0x4e0e73[_0xe4d9('0x82')]))){_0x538db5=path[_0xe4d9('0x8a')](config['root'],_0xe4d9('0x8e'),_0x4e0e73[_0xe4d9('0x82')]);}}return _0x4697d0['download'](_0x538db5);}})[_0xe4d9('0x1f')](handleError(_0x4697d0,null));};function checkWebsiteInterval(_0x46c5c4){var _0xed4466=_0x46c5c4[_0xe4d9('0x92')];if(!_0xed4466){return Promise[_0xe4d9('0x93')](_0x46c5c4);}var _0x3d5ad2=_0x46c5c4[_0xe4d9('0x94')]||undefined;return _0xed4466[_0xe4d9('0x95')](_0x3d5ad2)['then'](function(_0x1d1b63){if(!_0x1d1b63){throw new APIOutOfIntervalError();}return _0x46c5c4;});}exports[_0xe4d9('0x96')]=function(_0x15945a,_0x3c2a9e){var _0x7f62c6={'body':_0x15945a[_0xe4d9('0x5f')],'channel':_0xe4d9('0x97')};var _0x1dadff=[];var _0x36584b=[];var _0x388c77={};var _0x5d2e5a=![];if(_0x15945a[_0xe4d9('0x5f')]['id']){delete _0x15945a[_0xe4d9('0x5f')]['id'];}if(_['isNil'](_0x15945a['body'][_0xe4d9('0x98')])){throw new APIBadRequestError(_0xe4d9('0x99'));}if(_[_0xe4d9('0x87')](_0x15945a['body'][_0xe4d9('0x9a')])){throw new APIBadRequestError(_0xe4d9('0x9b'));}if(_['isEmpty'](_0x15945a[_0xe4d9('0x5f')][_0xe4d9('0x5f')])){throw new APIBadRequestError(_0xe4d9('0x9c'));}var _0xcfc051=_0x15945a['body'][_0xe4d9('0x9d')]&&_0x15945a['body']['referer'];return db[_0xe4d9('0x9e')][_0xe4d9('0x6d')]()['then'](function(_0x1571e8){if(!_0x1571e8){throw new Error('No\x20available\x20attributes');}_0x1dadff=Object[_0xe4d9('0x5b')](_0x1571e8)['filter'](function(_0x230c52){return![_0xe4d9('0x9f'),_0xe4d9('0xa0')]['includes'](_0x230c52);});_0x36584b=Object[_0xe4d9('0x5b')](_0x1571e8)['filter'](function(_0x248782){return![_0xe4d9('0x9f'),'updatedAt',_0xe4d9('0xa1'),'ListId'][_0xe4d9('0xa2')](_0x248782);});if(!_[_0xe4d9('0xa2')](_0x36584b,_0x15945a[_0xe4d9('0x5f')][_0xe4d9('0x9a')])){throw new APIBadRequestError(_0xe4d9('0xa3')+_0x36584b[_0xe4d9('0x8a')](',\x20'));}_0x388c77[_0x15945a[_0xe4d9('0x5f')][_0xe4d9('0x9a')]]=_0x15945a[_0xe4d9('0x5f')][_0xe4d9('0x98')];})[_0xe4d9('0x2b')](function(){return db[_0xe4d9('0x48')][_0xe4d9('0x5e')]({'where':{'id':_0x15945a[_0xe4d9('0x6c')]['id']},'include':[{'model':db['CmList'],'as':_0xe4d9('0xa4'),'include':[{'model':db[_0xe4d9('0x9e')],'as':_0xe4d9('0xa5'),'where':_0x388c77,'limit':0x1,'order':[[_0xe4d9('0xa0'),_0xe4d9('0xa6')]]}]},{'model':db[_0xe4d9('0xa7')],'as':_0xe4d9('0xa8')},{'model':db['Interval'],'as':_0xe4d9('0x92'),'include':[{'model':db[_0xe4d9('0x92')],'as':_0xe4d9('0xa9'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0xe4d9('0x2b')](function(_0x1c04ed){if(!_0x1c04ed){throw new APINotFoundError(util[_0xe4d9('0x3c')](_0xe4d9('0xaa'),_0x15945a[_0xe4d9('0x6c')]['id']));}if(_0xcfc051){return checkWebsiteInterval(_0x1c04ed);}return _0x1c04ed;})[_0xe4d9('0x2b')](function(_0x2e0efe){_0x7f62c6[_0xe4d9('0xab')]=_0x2e0efe;_0x7f62c6[_0xe4d9('0xac')]=_[_0xe4d9('0xad')](_0x2e0efe[_0xe4d9('0xa8')],[_0xe4d9('0xae')],[_0xe4d9('0xaf')]);if(_0x7f62c6[_0xe4d9('0xab')][_0xe4d9('0xa8')]){delete _0x7f62c6[_0xe4d9('0xab')][_0xe4d9('0xa8')];}_0x7f62c6['list']=_0x2e0efe[_0xe4d9('0xa4')]||{'id':_0x2e0efe['ListId']};if(_0x7f62c6[_0xe4d9('0xb0')]&&_0x7f62c6['list']['Contacts'][_0xe4d9('0x51')]){return _0x7f62c6['list'][_0xe4d9('0xa5')][0x0];}var _0x1ada99=_[_0xe4d9('0x13')](_0x15945a[_0xe4d9('0x5f')],{'firstName':_0x15945a[_0xe4d9('0x5f')][_0xe4d9('0x98')],'ListId':_0x2e0efe[_0xe4d9('0xb1')]});_0x1ada99[_0x15945a['body'][_0xe4d9('0x9a')]]=_0x15945a[_0xe4d9('0x5f')]['from'];return db['CmContact']['create'](_0x1ada99,{'fields':_0x1dadff,'raw':!![]});})[_0xe4d9('0x2b')](function(_0x383dcf){_0x7f62c6['contact']=_0x383dcf;var _0x34b65=createInteractionObject(_0x15945a[_0xe4d9('0x6c')]['id'],_0x15945a[_0xe4d9('0x5f')],_0x15945a[_0xe4d9('0xb2')],_0x383dcf);var _0x398aad={'ChatWebsiteId':_0x15945a[_0xe4d9('0x6c')]['id']};if(_0x15945a[_0xe4d9('0x5f')][_0xe4d9('0xb3')]){_0x398aad['threadId']=_0x15945a[_0xe4d9('0x5f')][_0xe4d9('0xb3')];_0x398aad[_0xe4d9('0xb4')]=![];return db[_0xe4d9('0xb5')][_0xe4d9('0x5e')]({'where':_0x398aad})['then'](function(_0x3b639e){var _0x1f6960=_0x15945a['body'][_0xe4d9('0x9d')]&&_0x15945a['body'][_0xe4d9('0xb6')];if(_0x3b639e){_0x5d2e5a=!![];return _0x3b639e;}else if(!_0x1f6960&&_0x3b639e&&_0x3b639e[_0xe4d9('0xb4')]){throw new APIConflictError(_0xe4d9('0xb7'));}_0x34b65[_0xe4d9('0xb3')]=_0x15945a[_0xe4d9('0x5f')][_0xe4d9('0xb3')];_0x34b65[_0xe4d9('0xb8')]=_0x15945a[_0xe4d9('0x5f')][_0xe4d9('0xb8')];return db[_0xe4d9('0xb5')][_0xe4d9('0x63')](_0x34b65);});}_0x398aad[_0xe4d9('0xb9')]=_0x383dcf['id'];if(_0x15945a['body'][_0xe4d9('0xba')]&&_0x15945a[_0xe4d9('0x5f')][_0xe4d9('0xba')]['id']){_0x398aad['id']=_0x15945a[_0xe4d9('0x5f')][_0xe4d9('0xba')]['id'];return db[_0xe4d9('0xb5')][_0xe4d9('0x5e')]({'where':_0x398aad})[_0xe4d9('0x2b')](function(_0x3d56d6){var _0x8c2807=_0x15945a[_0xe4d9('0x5f')][_0xe4d9('0x9d')]&&_0x15945a[_0xe4d9('0x5f')][_0xe4d9('0xb6')];if(!_0x8c2807&&_0x3d56d6&&_0x3d56d6['closed']){throw new APIConflictError(_0xe4d9('0xb7'));}else if(_0x3d56d6){_0x5d2e5a=!![];return _0x3d56d6;}else{return db[_0xe4d9('0xb5')][_0xe4d9('0x63')](_0x34b65);}});}return db[_0xe4d9('0xb5')][_0xe4d9('0x63')](_0x34b65);})[_0xe4d9('0x2b')](function(_0x133565){if(!_0x5d2e5a){return _0x133565;}var _0x3da039={'from':(_0x7f62c6['contact']['firstName']||'')+'\x20'+(_0x7f62c6[_0xe4d9('0xbb')]['lastName']||'')};if(_0x15945a['body'][_0xe4d9('0xb3')]&&_0x15945a[_0xe4d9('0x5f')][_0xe4d9('0xbc')]&&_0x15945a['body']['threadId']!=_0x15945a[_0xe4d9('0x5f')][_0xe4d9('0xbc')]){_0x3da039[_0xe4d9('0xb3')]=_0x15945a['body'][_0xe4d9('0xbc')];}return _0x133565[_0xe4d9('0x29')](_0x3da039);})[_0xe4d9('0x2b')](function(_0x4e384c){_0x7f62c6[_0xe4d9('0xba')]=_0x4e384c['get']({'plain':!![]});_0x7f62c6[_0xe4d9('0xba')][_0xe4d9('0xbd')]=!_0x5d2e5a;if(_0x7f62c6[_0xe4d9('0xba')][_0xe4d9('0xbd')]){if(_0x7f62c6[_0xe4d9('0xab')]['autoclose']){_0x7f62c6[_0xe4d9('0xac')]['push']({'id':0x0,'priority':_0x7f62c6[_0xe4d9('0xac')][_0xe4d9('0x51')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xe4d9('0xbe')});}}return db['ChatMessage'][_0xe4d9('0x63')]({'body':_0x15945a[_0xe4d9('0x5f')][_0xe4d9('0x5f')],'ChatWebsiteId':_0x15945a[_0xe4d9('0x6c')]['id'],'ChatInteractionId':_0x4e384c['id'],'direction':'in','ContactId':_0x7f62c6[_0xe4d9('0xbb')]['id'],'AttachmentId':_0x15945a[_0xe4d9('0x5f')]['AttachmentId']});})[_0xe4d9('0x2b')](function(_0x55da19){_0x7f62c6[_0xe4d9('0x1d')]=_0x55da19;if(!_0x7f62c6[_0xe4d9('0xba')][_0xe4d9('0xbf')]){return;}return db['User'][_0xe4d9('0x5e')]({'attributes':['id',_0xe4d9('0x2f')],'where':{'id':_0x7f62c6[_0xe4d9('0xba')]['UserId']}});})[_0xe4d9('0x2b')](function(_0x2c508a){if(_0x2c508a){_0x7f62c6[_0xe4d9('0xac')][_0xe4d9('0xc0')]({'id':0x0,'priority':0x0,'app':_0xe4d9('0xc1'),'appdata':_0x2c508a[_0xe4d9('0x2f')]+','+(_0x7f62c6[_0xe4d9('0xab')][_0xe4d9('0xc2')]||0xa),'interval':_0xe4d9('0xbe')});_0x7f62c6[_0xe4d9('0xc3')]=!![];}if(!_0x7f62c6[_0xe4d9('0xba')][_0xe4d9('0xc4')]){return;}return db[_0xe4d9('0xc5')][_0xe4d9('0x5e')]({'attributes':['id',_0xe4d9('0x2f')],'where':{'id':_0x7f62c6[_0xe4d9('0xba')][_0xe4d9('0xc4')]}});})[_0xe4d9('0x2b')](function(_0x5c623f){if(_0x5c623f){_0x7f62c6[_0xe4d9('0xac')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x5c623f['name']+','+(_0x7f62c6[_0xe4d9('0xab')][_0xe4d9('0xc6')]||0x12c),'interval':_0xe4d9('0xbe')});}return respondWithRpcPromise(_0xe4d9('0xc7'),_0xe4d9('0xc8'),_0x7f62c6);})[_0xe4d9('0x2b')](function(_0x94f6a7){respondWithRpcPromise(_0xe4d9('0xc9'),_0xe4d9('0xc9'),{'event':'notify','message':_0x94f6a7},client9002);return _0x94f6a7;})['then'](respondWithResult(_0x3c2a9e,null))['catch'](APIHandleError(_0x3c2a9e));};exports[_0xe4d9('0xca')]=function(_0x4b4548,_0x3494df){var _0x4df66a,_0x17d710,_0x41c729;var _0x578769=[];var _0x50a75a={};var _0x5864db=_0x4b4548['files']||[];var _0x19e9ed=[];var _0x5e6be9;return db[_0xe4d9('0x9e')][_0xe4d9('0x6d')]()['then'](function(_0x1f325d){if(!_0x1f325d){throw new db[(_0xe4d9('0xcb'))]['ValidationError']('no\x20available\x20attributes');}_0x578769=_['difference'](_[_0xe4d9('0x5b')](_0x1f325d),[_0xe4d9('0x9f'),_0xe4d9('0xa0'),_0xe4d9('0xa1'),_0xe4d9('0xb1')]);if(_0x4b4548[_0xe4d9('0x5f')]['id']){delete _0x4b4548[_0xe4d9('0x5f')]['id'];}if(_[_0xe4d9('0x87')](_0x4b4548[_0xe4d9('0x5f')][_0xe4d9('0x98')])){throw _0x3494df['status'](0x1f4)[_0xe4d9('0x30')](new db['Sequelize'][(_0xe4d9('0xcc'))](_0xe4d9('0xcd')));}if(_[_0xe4d9('0x87')](_0x4b4548[_0xe4d9('0x5f')][_0xe4d9('0x5f')])||_0x4b4548[_0xe4d9('0x5f')][_0xe4d9('0x5f')]===''){throw _0x3494df[_0xe4d9('0x20')](0x1f4)[_0xe4d9('0x30')](new db[(_0xe4d9('0xcb'))]['ValidationError'](_0xe4d9('0xce')));}if(_[_0xe4d9('0x87')](_0x4b4548['body']['mapKeyOffline'])){throw _0x3494df['status'](0x1f4)[_0xe4d9('0x30')](new db[(_0xe4d9('0xcb'))]['ValidationError'](_0xe4d9('0xcf')+_0x578769));}if(!_[_0xe4d9('0xa2')](_0x578769,_0x4b4548[_0xe4d9('0x5f')][_0xe4d9('0xd0')])){throw _0x3494df[_0xe4d9('0x20')](0x1f4)[_0xe4d9('0x30')](new db[(_0xe4d9('0xcb'))]['ValidationError'](_0xe4d9('0xd1')+_0x578769));}_0x50a75a[_0x4b4548[_0xe4d9('0x5f')][_0xe4d9('0xd0')]]=_0x4b4548['body']['from'];})['then'](function(){return db[_0xe4d9('0x48')][_0xe4d9('0x5e')]({'where':{'id':_0x4b4548[_0xe4d9('0x6c')]['id']},'include':[{'model':db[_0xe4d9('0xd2')],'as':_0xe4d9('0xa4')},{'model':db[_0xe4d9('0xd3')],'as':'MailAccount'}]});})[_0xe4d9('0x2b')](handleEntityNotFound(_0x3494df,null))['then'](function(_0x2c7c2a){if(_0x2c7c2a&&_0x2c7c2a[_0xe4d9('0xa4')]){_0x17d710=_0x2c7c2a;var _0xb81039=_['defaults'](_0x4b4548[_0xe4d9('0x5f')],{'firstName':_0x4b4548[_0xe4d9('0x5f')][_0xe4d9('0x98')],'phone':_0x4b4548['body'][_0xe4d9('0x98')],'ListId':_0x2c7c2a[_0xe4d9('0xb1')]});_0xb81039[_0x4b4548['body']['mapKeyOffline']]=_0x4b4548[_0xe4d9('0x5f')][_0xe4d9('0x98')];return db[_0xe4d9('0x9e')][_0xe4d9('0xd4')]({'where':_0x50a75a,'defaults':_0xb81039});}})[_0xe4d9('0xd5')](function(_0x37c884){if(_0x37c884){_0x41c729=_0x37c884;var _0x47c661=fs[_0xe4d9('0xd6')](path[_0xe4d9('0x8a')](config[_0xe4d9('0x8b')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x4b3324=ejs[_0xe4d9('0xd7')](_0x47c661,{'body':_['toPairs'](_0x4b4548[_0xe4d9('0x5f')][_0xe4d9('0x5f')]),'bodyTitle':_0x17d710[_0xe4d9('0xd8')]});return db[_0xe4d9('0xd9')]['create']({'body':_0x4b3324,'plainBody':htmlToText['fromString'](_0x4b3324),'ContactId':_0x37c884['id'],'ChatWebsiteId':_0x17d710['id']});}})[_0xe4d9('0x2b')](function(_0x4410e7){_0x5e6be9=_0x4410e7;if(_0x5864db[_0xe4d9('0x51')]){var _0x5480dc=_0x5864db['map'](function(_0x1c999a){return{'name':_0x1c999a[_0xe4d9('0xda')],'basename':_0x1c999a[_0xe4d9('0x7e')],'type':_0x1c999a[_0xe4d9('0xdb')],'ChatOfflineMessageId':_0x4410e7['id']};});_0x19e9ed=_0x5480dc[_0xe4d9('0x47')](_0xbc8304=>{var _0x1355cb={'filename':_0xbc8304[_0xe4d9('0x2f')],'path':path[_0xe4d9('0x8a')](config[_0xe4d9('0x8b')],_0xe4d9('0xdc'),_0xe4d9('0xdd'),_0xe4d9('0xde'),_0xe4d9('0xdf'),_0xbc8304['basename'])};return _0x1355cb;});if(!_0x17d710[_0xe4d9('0xe0')]){return db['sequelize'][_0xe4d9('0xe1')](function(_0xa771fe){return db[_0xe4d9('0xe2')][_0xe4d9('0xe3')](_0x5480dc,{'transaction':_0xa771fe});});}}})[_0xe4d9('0x2b')](function(){if(_0x5e6be9){_0x4df66a=_0x5e6be9;return db[_0xe4d9('0xd3')][_0xe4d9('0x71')]({'where':{'service':!![]},'include':[{'model':db[_0xe4d9('0xe4')],'as':_0xe4d9('0xe5'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xe4d9('0xe6'),'raw':!![]}]}]});}})['then'](function(_0x3f1f8b){if(_0x3f1f8b&&_0x3f1f8b[_0xe4d9('0xe5')]&&_0x17d710[_0xe4d9('0xe7')]&&_0x17d710[_0xe4d9('0xe8')]){var _0x4fe0ae=_0x3f1f8b[_0xe4d9('0xe9')]();return respondWithRpcPromise(_0xe4d9('0xea'),_0xe4d9('0xeb'),{'account':_0x4fe0ae,'message':{'from':util[_0xe4d9('0x3c')](_0xe4d9('0xec'),_0x3f1f8b[_0xe4d9('0x2f')],_0x3f1f8b[_0xe4d9('0xed')]||_0x3f1f8b[_0xe4d9('0xe5')][_0xe4d9('0x64')]),'to':_0x17d710[_0xe4d9('0xe8')],'subject':_0x17d710[_0xe4d9('0xee')],'html':_0x4df66a[_0xe4d9('0x5f')],'attachments':_0x19e9ed}},client9003)[_0xe4d9('0x2b')](function(){return _0x4df66a;})['catch'](function(_0x33252b){logger['error'](_0x33252b);});}})[_0xe4d9('0x2b')](function(){if(_0x17d710&&_0x17d710['openNewInteraction']&&_0x17d710['MailAccountId']){var _0x31fbc7=[];if(_0x5864db['length']){_0x31fbc7=_0x5864db[_0xe4d9('0x47')](function(_0x19b039){return{'name':_0x19b039[_0xe4d9('0xda')],'basename':_0x19b039[_0xe4d9('0x7e')],'type':_0x19b039[_0xe4d9('0xdb')],'ChatOfflineMessageId':_0x5e6be9['id']};});}var _0x16f465;if(!_[_0xe4d9('0x87')](_0x17d710[_0xe4d9('0xef')])){var _0x58e7d9=_[_0xe4d9('0x47')](_0x4b4548['body'],function(_0x3ba744){return _0x3ba744;});var _0x1b7d64=_[_0xe4d9('0xf0')](_0x58e7d9)[0x0];var _0x20b63f=_[_0xe4d9('0xf1')](_0x1b7d64,function(_0x1387ea){return _0x1387ea;});_0x16f465=_0x20b63f[0x1][_0x17d710[_0xe4d9('0xef')]];}var _0x11a94e={'from':_0x41c729[_0xe4d9('0xed')],'firstName':_0x41c729[_0xe4d9('0x38')],'lastName':_0x41c729[_0xe4d9('0x39')],'mapKey':_0xe4d9('0xed'),'message':{'from':_0x41c729[_0xe4d9('0xed')],'to':_0x17d710[_0xe4d9('0xd3')][_0xe4d9('0xed')],'cc':'','subject':_[_0xe4d9('0x87')](_0x16f465)?_0x17d710[_0xe4d9('0xee')]:_0x16f465,'messageId':'','sentAt':new Date(),'attach':_0x31fbc7[_0xe4d9('0x51')],'attachments':_0x31fbc7,'originChannel':_0xe4d9('0xf2'),'ChatWebsiteId':_0x17d710['id'],'ChatOfflineMessageId':_0x4df66a['id'],'originTo':_0x17d710['MailAccount'][_0xe4d9('0xed')]},'body':_0x4df66a[_0xe4d9('0x5f')]};var _0x510c47={'account':{'id':_0x17d710['MailAccountId']},'body':_0x11a94e,'log':_0xe4d9('0xf3')};return respondWithRpcPromise(_0xe4d9('0xf3'),'notifyMail',_0x510c47,client9001)[_0xe4d9('0x2b')](function(){return _0x4df66a;})[_0xe4d9('0x1f')](function(_0x1c3706){logger[_0xe4d9('0x1a')](_0x1c3706);});}return;})[_0xe4d9('0x2b')](function(){if(_0x4df66a){return _0x4df66a;}})[_0xe4d9('0x2b')](respondWithResult(_0x3494df,null))[_0xe4d9('0x1f')](function(){for(var _0x395f5d of _0x5864db){var _0x1c671a=path[_0xe4d9('0x8a')](config[_0xe4d9('0x8b')],_0xe4d9('0xdc'),_0xe4d9('0xdd'),_0xe4d9('0xde'),_0xe4d9('0xdf'),_0x395f5d['filename']);fs_extra['remove'](_0x1c671a)['catch'](function(_0x602b60){logger[_0xe4d9('0x1a')]('Could\x20not\x20remove\x20attachment\x20file',_0x1c671a,_0x602b60);});}});};exports[_0xe4d9('0xf4')]=function(_0x43791f,_0x5aaadb){return db[_0xe4d9('0xb5')]['find']({'where':{'id':_0x43791f[_0xe4d9('0x6c')]['id']}})[_0xe4d9('0x2b')](handleEntityNotFound(_0x5aaadb,null))['then'](function(_0x466ed2){if(_0x466ed2){return _0x466ed2[_0xe4d9('0xf4')](_0x43791f[_0xe4d9('0x5f')][_0xe4d9('0x77')],_[_0xe4d9('0xf5')](_0x43791f['body'],[_0xe4d9('0x77'),'id'])||{});}})['then'](respondWithResult(_0x5aaadb,null))['catch'](handleError(_0x5aaadb,null));};exports[_0xe4d9('0xf6')]=function(_0x46e6f6,_0x1f00b4){var _0x3a5601={'raw':![],'where':{}};var _0x11d23e={};var _0x10108d={'count':0x0,'rows':[]};return db[_0xe4d9('0x48')]['findOne']({'where':{'id':_0x46e6f6['params']['id']}})['then'](handleEntityNotFound(_0x1f00b4,null))['then'](function(_0x41e499){if(_0x41e499){_0x11d23e['model']=_['keys'](db[_0xe4d9('0xb5')][_0xe4d9('0x49')]);_0x11d23e[_0xe4d9('0x4c')]=_['keys'](_0x46e6f6[_0xe4d9('0x4c')]);_0x11d23e[_0xe4d9('0x4d')]=_[_0xe4d9('0x4e')](_0x11d23e[_0xe4d9('0x4b')],_0x11d23e[_0xe4d9('0x4c')]);_0x3a5601[_0xe4d9('0x4f')]=_[_0xe4d9('0x4e')](_0x11d23e[_0xe4d9('0x4b')],qs['fields'](_0x46e6f6[_0xe4d9('0x4c')][_0xe4d9('0x50')]));_0x3a5601[_0xe4d9('0x4f')]=_0x3a5601[_0xe4d9('0x4f')][_0xe4d9('0x51')]?_0x3a5601[_0xe4d9('0x4f')]:_0x11d23e['model'];if(!_0x46e6f6[_0xe4d9('0x4c')][_0xe4d9('0x52')](_0xe4d9('0x53'))){_0x3a5601[_0xe4d9('0x24')]=qs[_0xe4d9('0x24')](_0x46e6f6[_0xe4d9('0x4c')][_0xe4d9('0x24')]);_0x3a5601['offset']=qs[_0xe4d9('0x26')](_0x46e6f6[_0xe4d9('0x4c')][_0xe4d9('0x26')]);}_0x3a5601[_0xe4d9('0x54')]=qs['sort'](_0x46e6f6[_0xe4d9('0x4c')]['sort']);_0x3a5601['where']=qs[_0xe4d9('0x4d')](_[_0xe4d9('0x57')](_0x46e6f6['query'],_0x11d23e[_0xe4d9('0x4d')]));_0x3a5601[_0xe4d9('0x56')]['ChatWebsiteId']=_0x41e499['id'];if(_0x46e6f6[_0xe4d9('0x4c')][_0xe4d9('0x73')]){_0x3a5601[_0xe4d9('0x56')]=_['merge'](_0x3a5601[_0xe4d9('0x56')],{'$or':_[_0xe4d9('0x47')](_0x3a5601[_0xe4d9('0x4f')],function(_0x42f7c3){var _0x115b46={};_0x115b46[_0x42f7c3]={'$like':'%'+_0x46e6f6['query'][_0xe4d9('0x73')]+'%'};return _0x115b46;})});}_0x3a5601=_['merge']({},_0x3a5601,_0x46e6f6[_0xe4d9('0x59')]);return db[_0xe4d9('0xb5')][_0xe4d9('0x25')]({'where':_0x3a5601['where']})[_0xe4d9('0x2b')](function(_0x3f8b57){_0x10108d[_0xe4d9('0x25')]=_0x3f8b57;if(_0x46e6f6['query'][_0xe4d9('0x5c')]){_0x3a5601[_0xe4d9('0x5d')]=[{'model':db[_0xe4d9('0x9e')],'as':_0xe4d9('0xf7'),'required':![]},{'model':db[_0xe4d9('0xf8')],'as':_0xe4d9('0xf9'),'attributes':[_0xe4d9('0x2f'),_0xe4d9('0xfa'),_0xe4d9('0xfb')],'required':![]},{'model':db[_0xe4d9('0xfc')],'as':'Tags','attributes':['id',_0xe4d9('0x2f'),_0xe4d9('0xfd')],'where':_0x46e6f6['query'][_0xe4d9('0xfe')]?{'id':_0x46e6f6['query'][_0xe4d9('0xfe')]}:undefined,'required':_0x46e6f6[_0xe4d9('0x4c')]['tag']?!![]:![]}];}return db[_0xe4d9('0xb5')][_0xe4d9('0x74')](_0x3a5601);})['then'](function(_0x226d54){_0x10108d[_0xe4d9('0x75')]=_0x226d54;return _0x10108d;});}})[_0xe4d9('0x2b')](respondWithFilteredResult(_0x1f00b4,_0x3a5601))[_0xe4d9('0x1f')](handleError(_0x1f00b4,null));};exports['getSnippet']=function(_0x372289,_0x5d8270){var _0x40989a=0x0;var _0x490b9f=0x0;var _0x227827=![];var _0x5abfee;var _0x4b964c;return db['ChatWebsite']['find']({'where':{'id':_0x372289[_0xe4d9('0x6c')]['id']},'include':[{'model':db[_0xe4d9('0x92')],'as':_0xe4d9('0x92'),'include':[{'model':db[_0xe4d9('0x92')],'as':_0xe4d9('0xa9'),'attributes':['id',_0xe4d9('0xff')]}]}]})[_0xe4d9('0x2b')](handleEntityNotFound(_0x5d8270,null))[_0xe4d9('0x2b')](function(_0x5b1059){if(_0x5b1059){_0x5abfee=_0x5b1059;return _0x5b1059[_0xe4d9('0x100')]({'raw':!![]});}})['then'](function(_0x34161d){if(_0x5abfee){if(_0x34161d){_0x4b964c=_0x34161d;}}return require(_0xe4d9('0x85'))[_0xe4d9('0x101')]();})['then'](function(_0x298917){if(_0x298917){_0x490b9f=_0x298917[_0xe4d9('0x102')];_0x227827=_0x298917[_0xe4d9('0x86')];}})[_0xe4d9('0x2b')](function(){return db[_0xe4d9('0xb5')][_0xe4d9('0x25')]({'where':{'closed':![]}});})['then'](function(_0x43abd5){_0x40989a=_0x43abd5;if(_0x490b9f&&_0x43abd5>_0x490b9f){return db['License']['findOne']({'where':{'id':0x1}})[_0xe4d9('0x2b')](function(_0x469323){if(_0x469323){_0x469323[_0xe4d9('0x103')](_0xe4d9('0x104'));}});}})['then'](function(){var _0x29aebc=_0x5abfee[_0xe4d9('0x92')];var _0xc06a39=_0x5abfee[_0xe4d9('0x94')]||undefined;return _0x29aebc?_0x29aebc['ifTime'](_0xc06a39):!![];})[_0xe4d9('0x2b')](function(_0x12f9f0){var _0x55a7da=fs[_0xe4d9('0xd6')](path[_0xe4d9('0x8a')](config[_0xe4d9('0x8b')],_0xe4d9('0x105')),_0xe4d9('0x106'));var _0x5756b3='3.10.1';var _0x50142a=![];var _0xb9fbd1,_0x15eec4;if(_0x372289[_0xe4d9('0xb2')][_0xe4d9('0xb6')]){_0xb9fbd1=new URL(_0x372289['headers'][_0xe4d9('0xb6')])[_0xe4d9('0x107')];}else if(_0x372289[_0xe4d9('0xb2')][_0xe4d9('0x107')]){_0xb9fbd1=new URL(_0x372289[_0xe4d9('0xb2')][_0xe4d9('0x107')])[_0xe4d9('0x107')];}else{_0xb9fbd1=_0xe4d9('0x108');}_0x15eec4=typeof _0x5abfee['address'][_0xe4d9('0x37')](',')[_0xe4d9('0x5e')](function(_0x182b98){return wildcardUtils['testWebsiteWithWildcard'](_0x182b98,_0xb9fbd1);})!==_0xe4d9('0x23');var _0x56718d={'chatVersion':_0x5756b3,'chatWebsiteAddressOrigin':_0x15eec4?_0xb9fbd1:_0x5abfee[_0xe4d9('0x60')],'remote':_0x5abfee[_0xe4d9('0x109')],'query':querystring[_0xe4d9('0x19')](_[_0xe4d9('0x58')](_0x5abfee[_0xe4d9('0x65')]({'plain':!![]}),{'customerIp':_0x372289[_0xe4d9('0xb2')]['x-forwarded-for']||_0x372289['headers'][_0xe4d9('0x10a')]||_0x372289[_0xe4d9('0x10b')][_0xe4d9('0x10c')]||_0x372289['ip'],'referer':_0x372289[_0xe4d9('0xb2')]['referer'],'openedInteractions':_0x40989a,'maxInteractions':_0x490b9f,'virtual':_0x227827[_0xe4d9('0x102')],'online':_0x12f9f0,'custom':_0x227827,'address':_0x15eec4?_0xb9fbd1:null}))[_0xe4d9('0x10d')](/'/g,'\x5c\x27')};_0x5d8270[_0xe4d9('0x30')](ejs['render'](Mustache[_0xe4d9('0xd7')](_0x55a7da,_0x56718d),{'proactiveActions':_0x4b964c,'alignment':_0x5abfee['alignment'],'verticalAlignment':_0x5abfee['verticalAlignment'],'div_color':_0x5abfee[_0xe4d9('0xfd')],'labelText':_0x5abfee[_0xe4d9('0x10e')],'text_color':_0x5abfee[_0xe4d9('0x10f')],'text_button_color':_0x5abfee['textButtonColor'],'button_color':_0x5abfee[_0xe4d9('0x110')],'background_color':_0x5abfee[_0xe4d9('0x111')],'hideWhenOffline':_0x5abfee[_0xe4d9('0x112')],'intervalId':_0x5abfee[_0xe4d9('0x113')],'isDevelopment':_0x50142a,'chatVersion':_0x5756b3}));})[_0xe4d9('0x1f')](handleError(_0x5d8270,null));};exports[_0xe4d9('0x114')]=function(_0x43f24a,_0x289c07){var _0x35975a=_0x43f24a[_0xe4d9('0x6c')]['id'];var _0x19b531=_0x43f24a[_0xe4d9('0x5f')];var _0x4b9b00=0xc8;var _0x38c655=null;return db[_0xe4d9('0x115')][_0xe4d9('0xe1')]({'isolationLevel':db['sequelize'][_0xe4d9('0x116')]['ISOLATION_LEVELS'][_0xe4d9('0x117')]},function(_0x5b304f){return db['ChatWebsite'][_0xe4d9('0x71')]({'where':{'id':_0x35975a},'transaction':_0x5b304f})[_0xe4d9('0x2b')](function(_0x30946d){if(_0x30946d){return db[_0xe4d9('0xa7')]['destroy']({'where':{'ChatWebsiteId':_0x35975a},'transaction':_0x5b304f})[_0xe4d9('0x2b')](function(){var _0x3c9f65=_['map'](_0x19b531,function(_0x5c82fb){_0x5c82fb[_0xe4d9('0x72')]=_0x35975a;return _0x5c82fb;});return db[_0xe4d9('0xa7')][_0xe4d9('0xe3')](_0x3c9f65,{'transaction':_0x5b304f});});}else{_0x4b9b00=0x194;_0x38c655=[];}});})[_0xe4d9('0x2b')](function(){if(_0x4b9b00!==0x194){return db[_0xe4d9('0xa7')][_0xe4d9('0x118')]({'where':{'ChatWebsiteId':_0x35975a},'order':_0xe4d9('0xae')})['then'](function(_0x3ee853){_0x38c655=_0x3ee853;});}})[_0xe4d9('0x1f')](function(_0x1f8a9b){_0x4b9b00=0x1f4;logger[_0xe4d9('0x1a')](_0x1f8a9b[_0xe4d9('0x2e')]);if(_0x1f8a9b['name']){delete _0x1f8a9b[_0xe4d9('0x2f')];}_0x38c655=_0x1f8a9b;})['finally'](function(){if(_0x38c655===null){_0x289c07[_0xe4d9('0x2d')](_0x4b9b00);}else{if(_0x4b9b00===0x1f4){_0x289c07['status'](_0x4b9b00)[_0xe4d9('0x30')](_0x38c655);}else{_0x289c07[_0xe4d9('0x20')](_0x4b9b00)[_0xe4d9('0x22')](_0x38c655);}}});};exports[_0xe4d9('0x119')]=function(_0x1a95ce,_0x3459b7){var _0x587fdb={};var _0x39d16e={};var _0x2554be;var _0x57004e;return db[_0xe4d9('0x48')][_0xe4d9('0x71')]({'where':{'id':_0x1a95ce[_0xe4d9('0x6c')]['id']}})[_0xe4d9('0x2b')](handleEntityNotFound(_0x3459b7,null))['then'](function(_0x12e1c6){if(_0x12e1c6){_0x2554be=_0x12e1c6;_0x39d16e[_0xe4d9('0x4b')]=_['keys'](db[_0xe4d9('0xa7')]['rawAttributes']);_0x39d16e['query']=_['keys'](_0x1a95ce['query']);_0x39d16e[_0xe4d9('0x4d')]=_[_0xe4d9('0x4e')](_0x39d16e['model'],_0x39d16e[_0xe4d9('0x4c')]);_0x587fdb['attributes']=_['intersection'](_0x39d16e[_0xe4d9('0x4b')],qs[_0xe4d9('0x50')](_0x1a95ce['query'][_0xe4d9('0x50')]));_0x587fdb[_0xe4d9('0x4f')]=_0x587fdb[_0xe4d9('0x4f')][_0xe4d9('0x51')]?_0x587fdb[_0xe4d9('0x4f')]:_0x39d16e['model'];_0x587fdb[_0xe4d9('0x54')]=qs[_0xe4d9('0x55')](_0x1a95ce[_0xe4d9('0x4c')][_0xe4d9('0x55')]);_0x587fdb[_0xe4d9('0x56')]=qs[_0xe4d9('0x4d')](_['pick'](_0x1a95ce[_0xe4d9('0x4c')],_0x39d16e[_0xe4d9('0x4d')]));if(_0x1a95ce[_0xe4d9('0x4c')]['filter']){_0x587fdb[_0xe4d9('0x56')]=_[_0xe4d9('0x58')](_0x587fdb[_0xe4d9('0x56')],{'$or':_[_0xe4d9('0x47')](_0x587fdb[_0xe4d9('0x4f')],function(_0x74ec26){var _0x8a5b69={};_0x8a5b69[_0x74ec26]={'$like':'%'+_0x1a95ce['query'][_0xe4d9('0x73')]+'%'};return _0x8a5b69;})});}_0x587fdb=_[_0xe4d9('0x58')]({},_0x587fdb,_0x1a95ce[_0xe4d9('0x59')]);return _0x2554be[_0xe4d9('0x119')](_0x587fdb);}})[_0xe4d9('0x2b')](function(_0x24e540){if(_0x24e540){_0x57004e=_0x24e540[_0xe4d9('0x51')];if(!_0x1a95ce[_0xe4d9('0x4c')][_0xe4d9('0x52')](_0xe4d9('0x53'))){_0x587fdb[_0xe4d9('0x24')]=qs[_0xe4d9('0x24')](_0x1a95ce[_0xe4d9('0x4c')][_0xe4d9('0x24')]);_0x587fdb[_0xe4d9('0x26')]=qs[_0xe4d9('0x26')](_0x1a95ce[_0xe4d9('0x4c')][_0xe4d9('0x26')]);}return _0x2554be['getApplications'](_0x587fdb);}})[_0xe4d9('0x2b')](function(_0x5adc06){if(_0x5adc06){return _0x5adc06?{'count':_0x57004e,'rows':_0x5adc06}:null;}})[_0xe4d9('0x2b')](respondWithResult(_0x3459b7,null))['catch'](handleError(_0x3459b7,null));};exports[_0xe4d9('0x11a')]=function(_0x4822e2,_0x336afc){return db['chatProactiveAction'][_0xe4d9('0x5e')]({'where':{'id':_0x4822e2[_0xe4d9('0x6c')]['id']}})[_0xe4d9('0x2b')](handleEntityNotFound(_0x336afc,null))['then'](function(_0x3378d9){if(_0x3378d9){return _0x3378d9['addProactiveActions'](_0x4822e2[_0xe4d9('0x5f')][_0xe4d9('0x77')],_['omit'](_0x4822e2[_0xe4d9('0x5f')],[_0xe4d9('0x77'),'id'])||{});}})['then'](respondWithResult(_0x336afc,null))['catch'](handleError(_0x336afc,null));};exports['getProactiveActions']=function(_0x3186ae,_0x3dbd36){var _0x40c641={};var _0x28b529={};var _0x5dcc05;var _0x3a0339;return db[_0xe4d9('0x48')][_0xe4d9('0x71')]({'where':{'id':_0x3186ae[_0xe4d9('0x6c')]['id']}})[_0xe4d9('0x2b')](handleEntityNotFound(_0x3dbd36,null))[_0xe4d9('0x2b')](function(_0x9d1543){if(_0x9d1543){_0x5dcc05=_0x9d1543;_0x28b529['model']=_['keys'](db['ChatProactiveAction'][_0xe4d9('0x49')]);_0x28b529[_0xe4d9('0x4c')]=_[_0xe4d9('0x5b')](_0x3186ae['query']);_0x28b529[_0xe4d9('0x4d')]=_[_0xe4d9('0x4e')](_0x28b529['model'],_0x28b529[_0xe4d9('0x4c')]);_0x40c641['attributes']=_[_0xe4d9('0x4e')](_0x28b529[_0xe4d9('0x4b')],qs[_0xe4d9('0x50')](_0x3186ae[_0xe4d9('0x4c')]['fields']));_0x40c641['attributes']=_0x40c641[_0xe4d9('0x4f')][_0xe4d9('0x51')]?_0x40c641['attributes']:_0x28b529['model'];_0x40c641[_0xe4d9('0x54')]=qs['sort'](_0x3186ae['query'][_0xe4d9('0x55')]);_0x40c641['where']=qs[_0xe4d9('0x4d')](_['pick'](_0x3186ae[_0xe4d9('0x4c')],_0x28b529[_0xe4d9('0x4d')]));if(_0x3186ae[_0xe4d9('0x4c')]['filter']){_0x40c641['where']=_['merge'](_0x40c641[_0xe4d9('0x56')],{'$or':_[_0xe4d9('0x47')](_0x40c641[_0xe4d9('0x4f')],function(_0x17ed69){var _0x4e8ac0={};_0x4e8ac0[_0x17ed69]={'$like':'%'+_0x3186ae[_0xe4d9('0x4c')][_0xe4d9('0x73')]+'%'};return _0x4e8ac0;})});}_0x40c641=_[_0xe4d9('0x58')]({},_0x40c641,_0x3186ae['options']);return _0x5dcc05[_0xe4d9('0x100')](_0x40c641);}})[_0xe4d9('0x2b')](function(_0x59b3a5){if(_0x59b3a5){_0x3a0339=_0x59b3a5[_0xe4d9('0x51')];if(!_0x3186ae[_0xe4d9('0x4c')][_0xe4d9('0x52')]('nolimit')){_0x40c641[_0xe4d9('0x24')]=qs[_0xe4d9('0x24')](_0x3186ae['query']['limit']);_0x40c641[_0xe4d9('0x26')]=qs[_0xe4d9('0x26')](_0x3186ae[_0xe4d9('0x4c')][_0xe4d9('0x26')]);}return _0x5dcc05['getProactiveActions'](_0x40c641);}})['then'](function(_0x11e637){if(_0x11e637){return _0x11e637?{'count':_0x3a0339,'rows':_0x11e637}:null;}})[_0xe4d9('0x2b')](respondWithResult(_0x3dbd36,null))[_0xe4d9('0x1f')](handleError(_0x3dbd36,null));};exports['getFields']=function(_0x4f327f,_0x1f84d0){var _0xcfc14c=_0x4f327f[_0xe4d9('0x4c')][_0xe4d9('0x11b')]===_0xe4d9('0x11c')?_0xe4d9('0x11d'):_0xe4d9('0x11e');return db[_0xe4d9('0x48')][_0xe4d9('0x5e')]({'attributes':['id',_0xcfc14c],'where':{'id':_0x4f327f[_0xe4d9('0x6c')]['id']}})['then'](handleEntityNotFound(_0x1f84d0,null))[_0xe4d9('0x2b')](function(_0x59dd0e){if(_0x59dd0e){var _0x587483=_0x59dd0e[_0xcfc14c];var _0x165186=_0x587483&&_0x587483['items']?_0x587483[_0xe4d9('0x11f')]:[];_0x1f84d0[_0xe4d9('0x30')]({'fromKey':_[_0xe4d9('0x87')](_0x587483[_0xe4d9('0x120')])?undefined:_0x587483[_0xe4d9('0x120')],'count':_0x165186[_0xe4d9('0x51')],'rows':_0x165186});}})[_0xe4d9('0x1f')](handleError(_0x1f84d0,null));};exports[_0xe4d9('0x121')]=function(_0x30510b,_0x4c8947){var _0x266ffa={'raw':![],'where':{}};var _0x2602d8={};var _0x3e8982={'count':0x0,'rows':[]};return db[_0xe4d9('0x48')][_0xe4d9('0x71')]({'where':{'id':_0x30510b[_0xe4d9('0x6c')]['id']}})['then'](handleEntityNotFound(_0x4c8947,null))[_0xe4d9('0x2b')](function(_0x40d1a3){if(_0x40d1a3){_0x2602d8['model']=_[_0xe4d9('0x5b')](db['ChatOfflineMessage'][_0xe4d9('0x49')]);_0x2602d8[_0xe4d9('0x4c')]=_['keys'](_0x30510b[_0xe4d9('0x4c')]);_0x2602d8[_0xe4d9('0x4d')]=_[_0xe4d9('0x4e')](_0x2602d8['model'],_0x2602d8['query']);_0x266ffa[_0xe4d9('0x4f')]=_['intersection'](_0x2602d8[_0xe4d9('0x4b')],qs['fields'](_0x30510b[_0xe4d9('0x4c')][_0xe4d9('0x50')]));_0x266ffa[_0xe4d9('0x4f')]=_0x266ffa['attributes']['length']?_0x266ffa[_0xe4d9('0x4f')]:_0x2602d8['model'];if(!_0x30510b[_0xe4d9('0x4c')][_0xe4d9('0x52')](_0xe4d9('0x53'))){_0x266ffa['limit']=qs[_0xe4d9('0x24')](_0x30510b[_0xe4d9('0x4c')][_0xe4d9('0x24')]);_0x266ffa[_0xe4d9('0x26')]=qs[_0xe4d9('0x26')](_0x30510b[_0xe4d9('0x4c')][_0xe4d9('0x26')]);}_0x266ffa['order']=qs[_0xe4d9('0x55')](_0x30510b[_0xe4d9('0x4c')][_0xe4d9('0x55')]);_0x266ffa['where']=qs[_0xe4d9('0x4d')](_['pick'](_0x30510b[_0xe4d9('0x4c')],_0x2602d8['filters']));_0x266ffa[_0xe4d9('0x56')][_0xe4d9('0x72')]=_0x40d1a3['id'];if(_0x30510b[_0xe4d9('0x4c')][_0xe4d9('0x73')]){_0x266ffa['where']=_[_0xe4d9('0x58')](_0x266ffa[_0xe4d9('0x56')],{'$or':_[_0xe4d9('0x47')](_0x266ffa[_0xe4d9('0x4f')],function(_0x1b5e4a){var _0x4f9805={};_0x4f9805[_0x1b5e4a]={'$like':'%'+_0x30510b[_0xe4d9('0x4c')][_0xe4d9('0x73')]+'%'};return _0x4f9805;})});}_0x266ffa=_['merge']({},_0x266ffa,_0x30510b[_0xe4d9('0x59')]);return db[_0xe4d9('0xd9')][_0xe4d9('0x25')]({'where':_0x266ffa[_0xe4d9('0x56')]})[_0xe4d9('0x2b')](function(_0x4f8ef3){_0x3e8982[_0xe4d9('0x25')]=_0x4f8ef3;if(_0x30510b[_0xe4d9('0x4c')][_0xe4d9('0x5c')]){_0x266ffa['include']=[{'all':!![]}];}else{_0x266ffa['include']=[{'model':db[_0xe4d9('0x9e')],'as':_0xe4d9('0xf7'),'required':![]},{'model':db[_0xe4d9('0xe2')],'as':_0xe4d9('0x122'),'required':![]}];}return db['ChatOfflineMessage'][_0xe4d9('0x74')](_0x266ffa);})[_0xe4d9('0x2b')](function(_0x1f79e9){_0x3e8982[_0xe4d9('0x75')]=_0x1f79e9;return _0x3e8982;});}})[_0xe4d9('0x2b')](respondWithFilteredResult(_0x4c8947,_0x266ffa))[_0xe4d9('0x1f')](handleError(_0x4c8947,null));};exports[_0xe4d9('0x123')]=function(_0xecb7e8,_0x4488d0){return db[_0xe4d9('0x48')][_0xe4d9('0x5e')]({'where':{'id':_0xecb7e8['params']['id']}})[_0xe4d9('0x2b')](handleEntityNotFound(_0x4488d0,null))['then'](function(_0x57f07e){if(_0x57f07e){return _0x57f07e[_0xe4d9('0x123')](_0xecb7e8[_0xe4d9('0x5f')]['ids'],_[_0xe4d9('0xf5')](_0xecb7e8['body'],[_0xe4d9('0x77'),'id'])||{})[_0xe4d9('0xd5')](function(_0x23098a){for(var _0x15f432=0x0;_0x15f432<_0xecb7e8[_0xe4d9('0x5f')][_0xe4d9('0x77')]['length'];_0x15f432+=0x1){socket[_0xe4d9('0x124')]('userChatWebsite:save',{'UserId':Number(_0xecb7e8[_0xe4d9('0x5f')][_0xe4d9('0x77')][_0x15f432]),'ChatWebsiteId':Number(_0xecb7e8[_0xe4d9('0x6c')]['id'])});}return _0x23098a;});}})[_0xe4d9('0x2b')](respondWithResult(_0x4488d0,null))[_0xe4d9('0x1f')](handleError(_0x4488d0,null));};exports[_0xe4d9('0x125')]=function(_0x567d85,_0x567a86){return db['ChatWebsite']['find']({'where':{'id':_0x567d85['params']['id']}})[_0xe4d9('0x2b')](handleEntityNotFound(_0x567a86,null))[_0xe4d9('0x2b')](function(_0x36acb0){if(_0x36acb0){return _0x36acb0[_0xe4d9('0x125')](_0x567d85[_0xe4d9('0x4c')][_0xe4d9('0x77')])['then'](function(){if(_[_0xe4d9('0x126')](_0x567d85[_0xe4d9('0x4c')][_0xe4d9('0x77')])){for(var _0x872574=0x0;_0x872574<_0x567d85['query']['ids'][_0xe4d9('0x51')];_0x872574+=0x1){socket['emit'](_0xe4d9('0x127'),{'UserId':Number(_0x567d85[_0xe4d9('0x4c')][_0xe4d9('0x77')][_0x872574]),'ChatWebsiteId':Number(_0x567d85['params']['id'])});}}else{socket[_0xe4d9('0x124')]('userChatWebsite:remove',{'UserId':Number(_0x567d85[_0xe4d9('0x4c')]['ids']),'ChatWebsiteId':Number(_0x567d85[_0xe4d9('0x6c')]['id'])});}});}})[_0xe4d9('0x2b')](respondWithStatusCode(_0x567a86,null))['catch'](handleError(_0x567a86,null));};exports[_0xe4d9('0x128')]=function(_0x1365d8,_0x52f18a){var _0x4fcfe2={};var _0x51909d={};var _0x2a1ada;var _0x57226d;return db[_0xe4d9('0x48')][_0xe4d9('0x71')]({'where':{'id':_0x1365d8[_0xe4d9('0x6c')]['id']}})[_0xe4d9('0x2b')](handleEntityNotFound(_0x52f18a,null))['then'](function(_0x1810b6){if(_0x1810b6){_0x2a1ada=_0x1810b6;_0x51909d['model']=_[_0xe4d9('0x5b')](db[_0xe4d9('0xf8')]['rawAttributes']);_0x51909d[_0xe4d9('0x4c')]=_['keys'](_0x1365d8[_0xe4d9('0x4c')]);_0x51909d[_0xe4d9('0x4d')]=_[_0xe4d9('0x4e')](_0x51909d[_0xe4d9('0x4b')],_0x51909d[_0xe4d9('0x4c')]);_0x4fcfe2[_0xe4d9('0x4f')]=_[_0xe4d9('0x4e')](_0x51909d[_0xe4d9('0x4b')],qs[_0xe4d9('0x50')](_0x1365d8[_0xe4d9('0x4c')][_0xe4d9('0x50')]));_0x4fcfe2['attributes']=_0x4fcfe2[_0xe4d9('0x4f')]['length']?_0x4fcfe2[_0xe4d9('0x4f')]:_0x51909d[_0xe4d9('0x4b')];_0x4fcfe2[_0xe4d9('0x54')]=qs['sort'](_0x1365d8[_0xe4d9('0x4c')][_0xe4d9('0x55')]);_0x4fcfe2[_0xe4d9('0x56')]=qs[_0xe4d9('0x4d')](_[_0xe4d9('0x57')](_0x1365d8[_0xe4d9('0x4c')],_0x51909d[_0xe4d9('0x4d')]));if(_0x1365d8[_0xe4d9('0x4c')][_0xe4d9('0x73')]){_0x4fcfe2[_0xe4d9('0x56')]=_[_0xe4d9('0x58')](_0x4fcfe2[_0xe4d9('0x56')],{'$or':_[_0xe4d9('0x47')](_0x4fcfe2['attributes'],function(_0x4755b1){var _0x5663ed={};_0x5663ed[_0x4755b1]={'$like':'%'+_0x1365d8[_0xe4d9('0x4c')][_0xe4d9('0x73')]+'%'};return _0x5663ed;})});}_0x4fcfe2=_[_0xe4d9('0x58')]({},_0x4fcfe2,_0x1365d8[_0xe4d9('0x59')]);return _0x2a1ada[_0xe4d9('0x128')](_0x4fcfe2);}})[_0xe4d9('0x2b')](function(_0x18064b){if(_0x18064b){_0x57226d=_0x18064b[_0xe4d9('0x51')];if(!_0x1365d8[_0xe4d9('0x4c')][_0xe4d9('0x52')](_0xe4d9('0x53'))){_0x4fcfe2[_0xe4d9('0x24')]=qs[_0xe4d9('0x24')](_0x1365d8[_0xe4d9('0x4c')][_0xe4d9('0x24')]);_0x4fcfe2['offset']=qs['offset'](_0x1365d8['query']['offset']);}return _0x2a1ada[_0xe4d9('0x128')](_0x4fcfe2);}})[_0xe4d9('0x2b')](function(_0x5798cf){if(_0x5798cf){return _0x5798cf?{'count':_0x57226d,'rows':_0x5798cf}:null;}})[_0xe4d9('0x2b')](respondWithResult(_0x52f18a,null))[_0xe4d9('0x1f')](handleError(_0x52f18a,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index fb92f78..9d7ad70 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 _0x581a=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x34a49c,_0x311bf9){var _0x178e9d=function(_0x5dd714){while(--_0x5dd714){_0x34a49c['push'](_0x34a49c['shift']());}};_0x178e9d(++_0x311bf9);}(_0x581a,0x127));var _0xa581=function(_0x5c7e81,_0x10384d){_0x5c7e81=_0x5c7e81-0x0;var _0xf51111=_0x581a[_0x5c7e81];return _0xf51111;};'use strict';var EventEmitter=require(_0xa581('0x0'));var ChatWebsite=require(_0xa581('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa581('0x2')](0x0);var events={'afterCreate':_0xa581('0x3'),'afterUpdate':_0xa581('0x4'),'afterDestroy':_0xa581('0x5')};function emitEvent(_0x3f5c21){return function(_0x4e64cc,_0x4e65d7,_0x198faf){ChatWebsiteEvents['emit'](_0x3f5c21+':'+_0x4e64cc['id'],_0x4e64cc);ChatWebsiteEvents[_0xa581('0x6')](_0x3f5c21,_0x4e64cc);_0x198faf(null);};}for(var e in events){if(events[_0xa581('0x7')](e)){var event=events[e];ChatWebsite[_0xa581('0x8')](e,emitEvent(event));}}module[_0xa581('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x24cd=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x4ac320,_0x1a0f52){var _0x479cf7=function(_0x4c77ec){while(--_0x4c77ec){_0x4ac320['push'](_0x4ac320['shift']());}};_0x479cf7(++_0x1a0f52);}(_0x24cd,0x83));var _0xd24c=function(_0x52d1ad,_0x5e94dc){_0x52d1ad=_0x52d1ad-0x0;var _0x264739=_0x24cd[_0x52d1ad];return _0x264739;};'use strict';var EventEmitter=require(_0xd24c('0x0'));var ChatWebsite=require(_0xd24c('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd24c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd24c('0x3'),'afterDestroy':_0xd24c('0x4')};function emitEvent(_0x3bd534){return function(_0x4d515c,_0x21a58c,_0x32001a){ChatWebsiteEvents['emit'](_0x3bd534+':'+_0x4d515c['id'],_0x4d515c);ChatWebsiteEvents[_0xd24c('0x5')](_0x3bd534,_0x4d515c);_0x32001a(null);};}for(var e in events){if(events[_0xd24c('0x6')](e)){var event=events[e];ChatWebsite[_0xd24c('0x7')](e,emitEvent(event));}}module[_0xd24c('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 18c372c..a579984 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 _0x84a3=['api','moment','bluebird','path','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util'];(function(_0x59bf3e,_0x3a8e33){var _0x4a2340=function(_0x570a75){while(--_0x570a75){_0x59bf3e['push'](_0x59bf3e['shift']());}};_0x4a2340(++_0x3a8e33);}(_0x84a3,0x1a0));var _0x384a=function(_0x35ea7c,_0x4aa05d){_0x35ea7c=_0x35ea7c-0x0;var _0x56bdfc=_0x84a3[_0x35ea7c];return _0x56bdfc;};'use strict';var _=require(_0x384a('0x0'));var util=require(_0x384a('0x1'));var logger=require('../../config/logger')(_0x384a('0x2'));var moment=require(_0x384a('0x3'));var BPromise=require(_0x384a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x384a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x384a('0x6'));module[_0x384a('0x7')]=function(_0x3a36f4,_0x314d52){return _0x3a36f4[_0x384a('0x8')](_0x384a('0x9'),attributes,{'tableName':_0x384a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x38ae=['moment','bluebird','path','define','ChatWebsite','chat_websites','lodash','util','api'];(function(_0xbc1a4b,_0x4dfbe4){var _0x108b87=function(_0x409062){while(--_0x409062){_0xbc1a4b['push'](_0xbc1a4b['shift']());}};_0x108b87(++_0x4dfbe4);}(_0x38ae,0x10b));var _0xe38a=function(_0x504c5f,_0x4c9421){_0x504c5f=_0x504c5f-0x0;var _0x483c8e=_0x38ae[_0x504c5f];return _0x483c8e;};'use strict';var _=require(_0xe38a('0x0'));var util=require(_0xe38a('0x1'));var logger=require('../../config/logger')(_0xe38a('0x2'));var moment=require(_0xe38a('0x3'));var BPromise=require(_0xe38a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe38a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x81bf16,_0x3684b3){return _0x81bf16[_0xe38a('0x6')](_0xe38a('0x7'),attributes,{'tableName':_0xe38a('0x8'),'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 8d5fe54..8daac12 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 _0xd105=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xd105,0x194));var _0x5d10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd105[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5d10('0x0'));var util=require(_0x5d10('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5d10('0x2'));var fs=require('fs');var Redis=require(_0x5d10('0x3'));var db=require(_0x5d10('0x4'))['db'];var utils=require(_0x5d10('0x5'));var logger=require(_0x5d10('0x6'))(_0x5d10('0x7'));var config=require('../../config/environment');var jayson=require(_0x5d10('0x8'));var client=jayson['client'][_0x5d10('0x9')]({'port':0x232a});config['redis']=_[_0x5d10('0xa')](config[_0x5d10('0xb')],{'host':_0x5d10('0xc'),'port':0x18eb});var socket=require(_0x5d10('0xd'))(new Redis(config[_0x5d10('0xb')]));require(_0x5d10('0xe'))['register'](socket);function respondWithRpcPromise(_0x3c328f,_0x1b7775,_0x131652){return new BPromise(function(_0x3fe30b,_0x51511d){return client[_0x5d10('0xf')](_0x3c328f,_0x131652)['then'](function(_0x5710c5){logger['info'](_0x5d10('0x10'),_0x1b7775,_0x5d10('0x11'));logger[_0x5d10('0x12')](_0x5d10('0x13'),_0x1b7775,'request\x20sent',JSON[_0x5d10('0x14')](_0x5710c5));if(_0x5710c5[_0x5d10('0x15')]){if(_0x5710c5['error'][_0x5d10('0x16')]===0x1f4){logger['error'](_0x5d10('0x10'),_0x1b7775,_0x5710c5[_0x5d10('0x15')][_0x5d10('0x17')]);return _0x51511d(_0x5710c5['error'][_0x5d10('0x17')]);}logger['error'](_0x5d10('0x10'),_0x1b7775,_0x5710c5[_0x5d10('0x15')][_0x5d10('0x17')]);return _0x3fe30b(_0x5710c5['error'][_0x5d10('0x17')]);}else{logger[_0x5d10('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x1b7775,_0x5d10('0x11'));_0x3fe30b(_0x5710c5[_0x5d10('0x19')]['message']);}})[_0x5d10('0x1a')](function(_0x31b5b7){logger['error'](_0x5d10('0x10'),_0x1b7775,_0x31b5b7);_0x51511d(_0x31b5b7);});});}
\ No newline at end of file
+var _0x0267=['request','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register'];(function(_0x2ae786,_0xdcf97c){var _0x50dc01=function(_0x128343){while(--_0x128343){_0x2ae786['push'](_0x2ae786['shift']());}};_0x50dc01(++_0xdcf97c);}(_0x0267,0x177));var _0x7026=function(_0x3e9b13,_0x370a4b){_0x3e9b13=_0x3e9b13-0x0;var _0x1e9555=_0x0267[_0x3e9b13];return _0x1e9555;};'use strict';var _=require(_0x7026('0x0'));var util=require(_0x7026('0x1'));var moment=require(_0x7026('0x2'));var BPromise=require(_0x7026('0x3'));var rs=require(_0x7026('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7026('0x5'))['db'];var utils=require(_0x7026('0x6'));var logger=require('../../config/logger')(_0x7026('0x7'));var config=require(_0x7026('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7026('0x9')][_0x7026('0xa')]({'port':0x232a});config[_0x7026('0xb')]=_[_0x7026('0xc')](config[_0x7026('0xb')],{'host':_0x7026('0xd'),'port':0x18eb});var socket=require(_0x7026('0xe'))(new Redis(config[_0x7026('0xb')]));require(_0x7026('0xf'))[_0x7026('0x10')](socket);function respondWithRpcPromise(_0x4bf39e,_0x1af209,_0x4c3751){return new BPromise(function(_0xd73f8a,_0x4bc272){return client[_0x7026('0x11')](_0x4bf39e,_0x4c3751)['then'](function(_0x10c45e){logger['info'](_0x7026('0x12'),_0x1af209,'request\x20sent');logger[_0x7026('0x13')](_0x7026('0x14'),_0x1af209,'request\x20sent',JSON[_0x7026('0x15')](_0x10c45e));if(_0x10c45e[_0x7026('0x16')]){if(_0x10c45e[_0x7026('0x16')][_0x7026('0x17')]===0x1f4){logger[_0x7026('0x16')](_0x7026('0x12'),_0x1af209,_0x10c45e[_0x7026('0x16')][_0x7026('0x18')]);return _0x4bc272(_0x10c45e[_0x7026('0x16')][_0x7026('0x18')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1af209,_0x10c45e['error']['message']);return _0xd73f8a(_0x10c45e[_0x7026('0x16')][_0x7026('0x18')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1af209,_0x7026('0x19'));_0xd73f8a(_0x10c45e[_0x7026('0x1a')]['message']);}})[_0x7026('0x1b')](function(_0x1f377a){logger[_0x7026('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1af209,_0x1f377a);_0x4bc272(_0x1f377a);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 2b3969d..eef6313 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 _0xa686=['register','chatWebsite:','./chatWebsite.events','save','remove','update','removeListener'];(function(_0x3214c7,_0x47e426){var _0x206cb4=function(_0xb9b6be){while(--_0xb9b6be){_0x3214c7['push'](_0x3214c7['shift']());}};_0x206cb4(++_0x47e426);}(_0xa686,0xfe));var _0x6a68=function(_0x534602,_0x548725){_0x534602=_0x534602-0x0;var _0xa1e3f2=_0xa686[_0x534602];return _0xa1e3f2;};'use strict';var ChatWebsiteEvents=require(_0x6a68('0x0'));var events=[_0x6a68('0x1'),_0x6a68('0x2'),_0x6a68('0x3')];function createListener(_0x92f542,_0x467f6d){return function(_0x3361c1){_0x467f6d['emit'](_0x92f542,_0x3361c1);};}function removeListener(_0x46eebb,_0x4122a6){return function(){ChatWebsiteEvents[_0x6a68('0x4')](_0x46eebb,_0x4122a6);};}exports[_0x6a68('0x5')]=function(_0x2568be){for(var _0x2e4d45=0x0,_0x59b056=events['length'];_0x2e4d45<_0x59b056;_0x2e4d45++){var _0x22e3bc=events[_0x2e4d45];var _0x49821c=createListener(_0x6a68('0x6')+_0x22e3bc,_0x2568be);ChatWebsiteEvents['on'](_0x22e3bc,_0x49821c);}};
\ No newline at end of file
+var _0x5551=['removeListener','length','chatWebsite:','./chatWebsite.events','remove','update'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0x5551,0x1e9));var _0x1555=function(_0x2d7a4d,_0x36759a){_0x2d7a4d=_0x2d7a4d-0x0;var _0x41e8ae=_0x5551[_0x2d7a4d];return _0x41e8ae;};'use strict';var ChatWebsiteEvents=require(_0x1555('0x0'));var events=['save',_0x1555('0x1'),_0x1555('0x2')];function createListener(_0x987cc0,_0x485736){return function(_0x21c02e){_0x485736['emit'](_0x987cc0,_0x21c02e);};}function removeListener(_0x36f898,_0x3851d4){return function(){ChatWebsiteEvents[_0x1555('0x3')](_0x36f898,_0x3851d4);};}exports['register']=function(_0x186cf6){for(var _0x57477e=0x0,_0x1ae2ec=events[_0x1555('0x4')];_0x57477e<_0x1ae2ec;_0x57477e++){var _0x19e037=events[_0x57477e];var _0x57015c=createListener(_0x1555('0x5')+_0x19e037,_0x186cf6);ChatWebsiteEvents['on'](_0x19e037,_0x57015c);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index a72dfa7..6ec1f88 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedf1=['trim','([\x5cw]+)','localhost','../../../utils/misc','escapeRegExp','replace','test'];(function(_0x1e3a2e,_0x5131d0){var _0x3e6769=function(_0x3bf600){while(--_0x3bf600){_0x1e3a2e['push'](_0x1e3a2e['shift']());}};_0x3e6769(++_0x5131d0);}(_0xedf1,0xb2));var _0x1edf=function(_0xd69543,_0x5a1041){_0xd69543=_0xd69543-0x0;var _0x3588cb=_0xedf1[_0xd69543];return _0x3588cb;};var escapeRegExp=require(_0x1edf('0x0'))[_0x1edf('0x1')];var URL=require('url')['URL'];function testWildcardValidity(_0xdf58cf){var _0x462fc4=!![];try{new URL(_0xdf58cf[_0x1edf('0x2')]('*','localhost'));}catch(_0x224972){_0x462fc4=![];}return _0x462fc4&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x1edf('0x3')](_0xdf58cf);}function testWebsiteWithWildcard(_0x3a5efd,_0x5ec722){var _0x52238d;var _0x1b84af=escapeRegExp(_0x3a5efd[_0x1edf('0x4')]()[_0x1edf('0x2')](/\/$/,''))[_0x1edf('0x2')]('\x5c*',_0x1edf('0x5'));try{new URL(_0x3a5efd[_0x1edf('0x2')]('\x5c*',_0x1edf('0x6')));_0x52238d=new RegExp(_0x1b84af)[_0x1edf('0x3')](_0x5ec722);}catch(_0x30a13f){_0x52238d=![];}return _0x52238d;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x3e4d=['test','../../../utils/misc','url','replace','localhost','trim','([\x5cw]+)'];(function(_0x563840,_0xfd1827){var _0x161d43=function(_0x391a64){while(--_0x391a64){_0x563840['push'](_0x563840['shift']());}};_0x161d43(++_0xfd1827);}(_0x3e4d,0x16d));var _0xd3e4=function(_0x1af0e1,_0x35e119){_0x1af0e1=_0x1af0e1-0x0;var _0x482f73=_0x3e4d[_0x1af0e1];return _0x482f73;};var escapeRegExp=require(_0xd3e4('0x0'))['escapeRegExp'];var URL=require(_0xd3e4('0x1'))['URL'];function testWildcardValidity(_0x5bd2ea){var _0x485e9d=!![];try{new URL(_0x5bd2ea[_0xd3e4('0x2')]('*',_0xd3e4('0x3')));}catch(_0x2c7be8){_0x485e9d=![];}return _0x485e9d&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0x5bd2ea);}function testWebsiteWithWildcard(_0xc5abea,_0x5976c1){var _0x4b9a10;var _0x7b42fe=escapeRegExp(_0xc5abea[_0xd3e4('0x4')]()[_0xd3e4('0x2')](/\/$/,''))[_0xd3e4('0x2')]('\x5c*',_0xd3e4('0x5'));try{new URL(_0xc5abea['replace']('\x5c*',_0xd3e4('0x3')));_0x4b9a10=new RegExp(_0x7b42fe)[_0xd3e4('0x6')](_0x5976c1);}catch(_0x279f4c){_0x4b9a10=![];}return _0x4b9a10;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index df19ac3..7a8c45e 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 _0xa2b3=['single','file','server/files/images/avatars/','%s-%s','addAvatar','addSystemAvatar','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','offline','/:id/interactions','/:id/applications','/:id/users','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','originalname'];(function(_0x19ac90,_0x554f04){var _0x4b9d7d=function(_0x3efc03){while(--_0x3efc03){_0x19ac90['push'](_0x19ac90['shift']());}};_0x4b9d7d(++_0x554f04);}(_0xa2b3,0x162));var _0x3a2b=function(_0x742cb3,_0x43cb32){_0x742cb3=_0x742cb3-0x0;var _0x191a5d=_0xa2b3[_0x742cb3];return _0x191a5d;};'use strict';var multer=require('multer');var util=require(_0x3a2b('0x0'));var path=require(_0x3a2b('0x1'));var timeout=require(_0x3a2b('0x2'));var express=require(_0x3a2b('0x3'));var router=express['Router']();var fs_extra=require(_0x3a2b('0x4'));var auth=require(_0x3a2b('0x5'));var interaction=require(_0x3a2b('0x6'));var config=require(_0x3a2b('0x7'));var controller=require(_0x3a2b('0x8'));router[_0x3a2b('0x9')]('/',auth[_0x3a2b('0xa')](),controller[_0x3a2b('0xb')]);router[_0x3a2b('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x3a2b('0xc')]);router[_0x3a2b('0x9')](_0x3a2b('0xd'),auth[_0x3a2b('0xa')](),controller[_0x3a2b('0xe')]);router[_0x3a2b('0x9')](_0x3a2b('0xf'),auth[_0x3a2b('0xa')](),controller['getDispositions']);router['get'](_0x3a2b('0x10'),auth[_0x3a2b('0xa')](),controller['getAnswers']);router[_0x3a2b('0x9')](_0x3a2b('0x11'),controller['getLogo']);router['get'](_0x3a2b('0x12'),controller[_0x3a2b('0x13')]);router[_0x3a2b('0x9')](_0x3a2b('0x14'),controller[_0x3a2b('0x15')]);router[_0x3a2b('0x9')](_0x3a2b('0x16'),controller[_0x3a2b('0x17')]);router['get']('/:id/interactions',auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x18')]);router[_0x3a2b('0x9')](_0x3a2b('0x19'),controller['getSnippet']);router['get']('/:id/applications',auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x1a')]);router[_0x3a2b('0x9')](_0x3a2b('0x1b'),auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x1c')]);router[_0x3a2b('0x9')](_0x3a2b('0x1d'),controller[_0x3a2b('0x1e')]);router[_0x3a2b('0x9')]('/:id/offline_messages',auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x1f')]);router[_0x3a2b('0x9')]('/:id/users',auth[_0x3a2b('0xa')](),controller['getAgents']);router[_0x3a2b('0x20')]('/',auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x21')]);router['post']('/:id/dispositions',auth[_0x3a2b('0xa')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x22')]);var upload=multer({'storage':multer[_0x3a2b('0x23')]({'destination':function(_0x32e46b,_0x586a03,_0x32fcb7){_0x32fcb7(null,path[_0x3a2b('0x24')](config[_0x3a2b('0x25')],_0x3a2b('0x26')));},'filename':function(_0x40de23,_0x4bf2d0,_0x2d9a67){_0x2d9a67(null,util[_0x3a2b('0x27')]('%s-%s',Date[_0x3a2b('0x28')](),_0x4bf2d0[_0x3a2b('0x29')]));}})});router[_0x3a2b('0x20')](_0x3a2b('0x11'),upload[_0x3a2b('0x2a')](_0x3a2b('0x2b')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22e01e,_0x5779dc,_0xdb2717){_0xdb2717(null,path[_0x3a2b('0x24')](config['root'],_0x3a2b('0x2c')));},'filename':function(_0x478150,_0x5cd491,_0x386de6){_0x386de6(null,util[_0x3a2b('0x27')](_0x3a2b('0x2d'),Date[_0x3a2b('0x28')](),_0x5cd491[_0x3a2b('0x29')]));}})});router['post']('/:id/avatar',upload['single']('file'),controller[_0x3a2b('0x2e')]);var upload=multer({'storage':multer[_0x3a2b('0x23')]({'destination':function(_0x3dbca4,_0x597e81,_0x556ea4){_0x556ea4(null,path['join'](config['root'],_0x3a2b('0x2c')));},'filename':function(_0x5f4a63,_0x4f5650,_0x449ae2){_0x449ae2(null,util[_0x3a2b('0x27')](_0x3a2b('0x2d'),Date[_0x3a2b('0x28')](),_0x4f5650[_0x3a2b('0x29')]));}})});router[_0x3a2b('0x20')](_0x3a2b('0x14'),upload[_0x3a2b('0x2a')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x41491f,_0x56dfca,_0xbb54b3){_0xbb54b3(null,path['join'](config[_0x3a2b('0x25')],_0x3a2b('0x2c')));},'filename':function(_0xc584bb,_0x34465c,_0x1af7c8){_0x1af7c8(null,util[_0x3a2b('0x27')](_0x3a2b('0x2d'),Date['now'](),_0x34465c[_0x3a2b('0x29')]));}})});router[_0x3a2b('0x20')](_0x3a2b('0x16'),upload[_0x3a2b('0x2a')](_0x3a2b('0x2b')),controller[_0x3a2b('0x2f')]);router[_0x3a2b('0x20')]('/:id/notify',controller[_0x3a2b('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0x3a2b('0x23')]({'destination':function(_0x59baa1,_0x8deb87,_0x2dde22){const _0xa7aa76=path[_0x3a2b('0x24')](config[_0x3a2b('0x25')],_0x3a2b('0x31'),_0x3a2b('0x32'),'offline-chat');fs_extra[_0x3a2b('0x33')](_0xa7aa76,function(){_0x2dde22(null,_0xa7aa76);});},'filename':function(_0xef8faf,_0x27331a,_0x3bed3d){const _0x20e107=_0x27331a[_0x3a2b('0x29')][_0x3a2b('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x28c512=path[_0x3a2b('0x35')](_0x20e107);const _0x3f9236=Date[_0x3a2b('0x28')]()+'-'+_0x20e107[_0x3a2b('0x34')](_0x28c512,'')+_0x28c512;_0x3bed3d(null,_0x3f9236);}})});router[_0x3a2b('0x20')](_0x3a2b('0x36'),offlineUploadMulter['any'](),controller[_0x3a2b('0x37')]);router[_0x3a2b('0x20')](_0x3a2b('0x38'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x3a2b('0x20')](_0x3a2b('0x39'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x3a2b('0x1b'),auth[_0x3a2b('0xa')](),controller['addProactiveActions']);router['post'](_0x3a2b('0x3a'),auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x3b')]);router['put'](_0x3a2b('0xd'),auth['isAuthenticated'](),controller[_0x3a2b('0x3c')]);router[_0x3a2b('0x3d')](_0x3a2b('0xd'),auth['isAuthenticated'](),controller[_0x3a2b('0x3e')]);router[_0x3a2b('0x3d')](_0x3a2b('0xf'),auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x3f')]);router[_0x3a2b('0x3d')](_0x3a2b('0x10'),auth['isAuthenticated'](),controller[_0x3a2b('0x40')]);router['delete'](_0x3a2b('0x3a'),auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x41')]);module['exports']=router;
\ No newline at end of file
+var _0x8235=['single','file','addLogo','server/files/images/avatars/','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id/dispositions','getDispositions','getAnswers','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname'];(function(_0x3f8238,_0x196436){var _0x30de26=function(_0x1d0ca8){while(--_0x1d0ca8){_0x3f8238['push'](_0x3f8238['shift']());}};_0x30de26(++_0x196436);}(_0x8235,0xb4));var _0x5823=function(_0x255255,_0x25f03d){_0x255255=_0x255255-0x0;var _0x46feba=_0x8235[_0x255255];return _0x46feba;};'use strict';var multer=require(_0x5823('0x0'));var util=require(_0x5823('0x1'));var path=require(_0x5823('0x2'));var timeout=require(_0x5823('0x3'));var express=require(_0x5823('0x4'));var router=express[_0x5823('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5823('0x6'));var interaction=require(_0x5823('0x7'));var config=require(_0x5823('0x8'));var controller=require(_0x5823('0x9'));router[_0x5823('0xa')]('/',auth[_0x5823('0xb')](),controller[_0x5823('0xc')]);router[_0x5823('0xa')](_0x5823('0xd'),auth[_0x5823('0xb')](),controller[_0x5823('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5823('0xa')](_0x5823('0xf'),auth[_0x5823('0xb')](),controller[_0x5823('0x10')]);router['get']('/:id/canned_answers',auth[_0x5823('0xb')](),controller[_0x5823('0x11')]);router[_0x5823('0xa')]('/:id/logo',controller['getLogo']);router[_0x5823('0xa')](_0x5823('0x12'),controller[_0x5823('0x13')]);router[_0x5823('0xa')](_0x5823('0x14'),controller[_0x5823('0x15')]);router[_0x5823('0xa')](_0x5823('0x16'),controller[_0x5823('0x17')]);router[_0x5823('0xa')]('/:id/interactions',auth[_0x5823('0xb')](),controller[_0x5823('0x18')]);router[_0x5823('0xa')](_0x5823('0x19'),controller['getSnippet']);router[_0x5823('0xa')](_0x5823('0x1a'),auth[_0x5823('0xb')](),controller['getApplications']);router[_0x5823('0xa')](_0x5823('0x1b'),auth[_0x5823('0xb')](),controller['getProactiveActions']);router[_0x5823('0xa')](_0x5823('0x1c'),controller['getFields']);router[_0x5823('0xa')](_0x5823('0x1d'),auth['isAuthenticated'](),controller[_0x5823('0x1e')]);router[_0x5823('0xa')](_0x5823('0x1f'),auth['isAuthenticated'](),controller[_0x5823('0x20')]);router['post']('/',auth[_0x5823('0xb')](),controller['create']);router[_0x5823('0x21')](_0x5823('0xf'),auth[_0x5823('0xb')](),controller[_0x5823('0x22')]);router[_0x5823('0x21')](_0x5823('0x23'),auth[_0x5823('0xb')](),controller[_0x5823('0x24')]);var upload=multer({'storage':multer[_0x5823('0x25')]({'destination':function(_0x57b5b6,_0x23edd6,_0xe5a9a6){_0xe5a9a6(null,path[_0x5823('0x26')](config[_0x5823('0x27')],_0x5823('0x28')));},'filename':function(_0x3c13fd,_0x3e2c14,_0xcc95f6){_0xcc95f6(null,util[_0x5823('0x29')](_0x5823('0x2a'),Date[_0x5823('0x2b')](),_0x3e2c14[_0x5823('0x2c')]));}})});router['post']('/:id/logo',upload[_0x5823('0x2d')](_0x5823('0x2e')),controller[_0x5823('0x2f')]);var upload=multer({'storage':multer[_0x5823('0x25')]({'destination':function(_0x5bc141,_0x569049,_0xbc082d){_0xbc082d(null,path[_0x5823('0x26')](config[_0x5823('0x27')],_0x5823('0x30')));},'filename':function(_0x1e3782,_0xd43be1,_0x2bf478){_0x2bf478(null,util[_0x5823('0x29')](_0x5823('0x2a'),Date[_0x5823('0x2b')](),_0xd43be1[_0x5823('0x2c')]));}})});router[_0x5823('0x21')](_0x5823('0x12'),upload['single'](_0x5823('0x2e')),controller[_0x5823('0x31')]);var upload=multer({'storage':multer[_0x5823('0x25')]({'destination':function(_0x226aa8,_0x166171,_0x3cfb33){_0x3cfb33(null,path[_0x5823('0x26')](config[_0x5823('0x27')],_0x5823('0x30')));},'filename':function(_0x440223,_0x43ad45,_0x71f8e5){_0x71f8e5(null,util[_0x5823('0x29')](_0x5823('0x2a'),Date[_0x5823('0x2b')](),_0x43ad45[_0x5823('0x2c')]));}})});router[_0x5823('0x21')](_0x5823('0x14'),upload[_0x5823('0x2d')](_0x5823('0x2e')),controller[_0x5823('0x32')]);var upload=multer({'storage':multer[_0x5823('0x25')]({'destination':function(_0x5db0dd,_0x2aa8ba,_0x4bd4e2){_0x4bd4e2(null,path['join'](config['root'],_0x5823('0x30')));},'filename':function(_0x5d6d0d,_0x15b965,_0x549da8){_0x549da8(null,util['format']('%s-%s',Date[_0x5823('0x2b')](),_0x15b965[_0x5823('0x2c')]));}})});router[_0x5823('0x21')]('/:id/system_avatar',upload[_0x5823('0x2d')](_0x5823('0x2e')),controller[_0x5823('0x33')]);router['post'](_0x5823('0x34'),controller[_0x5823('0x35')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x542ee7,_0x3220f7,_0x426a62){const _0x4e0f63=path[_0x5823('0x26')](config[_0x5823('0x27')],_0x5823('0x36'),_0x5823('0x37'),_0x5823('0x38'));fs_extra[_0x5823('0x39')](_0x4e0f63,function(){_0x426a62(null,_0x4e0f63);});},'filename':function(_0x48a186,_0x31145a,_0x2f5d88){const _0x55aaa4=_0x31145a[_0x5823('0x2c')][_0x5823('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2a88b6=path[_0x5823('0x3b')](_0x55aaa4);const _0x340fe8=Date[_0x5823('0x2b')]()+'-'+_0x55aaa4[_0x5823('0x3a')](_0x2a88b6,'')+_0x2a88b6;_0x2f5d88(null,_0x340fe8);}})});router['post'](_0x5823('0x3c'),offlineUploadMulter[_0x5823('0x3d')](),controller[_0x5823('0x3e')]);router[_0x5823('0x21')]('/:id/interactions',auth[_0x5823('0xb')](),controller[_0x5823('0x3f')]);router[_0x5823('0x21')](_0x5823('0x1a'),auth[_0x5823('0xb')](),controller[_0x5823('0x40')]);router[_0x5823('0x21')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x5823('0x41')]);router[_0x5823('0x21')](_0x5823('0x1f'),auth[_0x5823('0xb')](),controller[_0x5823('0x42')]);router[_0x5823('0x43')]('/:id',auth[_0x5823('0xb')](),controller[_0x5823('0x44')]);router[_0x5823('0x45')]('/:id',auth[_0x5823('0xb')](),controller[_0x5823('0x46')]);router['delete'](_0x5823('0xf'),auth['isAuthenticated'](),controller[_0x5823('0x47')]);router[_0x5823('0x45')](_0x5823('0x23'),auth[_0x5823('0xb')](),controller[_0x5823('0x48')]);router['delete'](_0x5823('0x1f'),auth['isAuthenticated'](),controller[_0x5823('0x49')]);module[_0x5823('0x4a')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index db93428..f0fd21e 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6c18=['Router','env','expressEndpoint','use','beaver-logger/server','express','../components/auth/service'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x6c18,0x1a1));var _0x86c1=function(_0x4c3b80,_0x196af9){_0x4c3b80=_0x4c3b80-0x0;var _0x3290a1=_0x6c18[_0x4c3b80];return _0x3290a1;};var beaverLogger=require(_0x86c1('0x0'));var express=require(_0x86c1('0x1'));var auth=require(_0x86c1('0x2'));var config=require('../config/environment');var router=express[_0x86c1('0x3')]();var isProduction=config[_0x86c1('0x4')]==='production'||![];function clientSideLogs(_0x2fb387,_0xa121ff,_0x3d6b3f){var _0x158b1c=_0x2fb387['app']['get']('client-side-logger');if(!_0x158b1c){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x86c1('0x5')]({'uri':'/client-logs','logger':_0x158b1c,'enableCors':!isProduction})(_0x2fb387,_0xa121ff,_0x3d6b3f);}router[_0x86c1('0x6')](auth['isAuthenticated'](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x1d2e=['/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../config/environment','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0x253ae6,_0xc0f0f9){var _0x13157a=function(_0x35210f){while(--_0x35210f){_0x253ae6['push'](_0x253ae6['shift']());}};_0x13157a(++_0xc0f0f9);}(_0x1d2e,0x7c));var _0xe1d2=function(_0x3ba38b,_0x39c0be){_0x3ba38b=_0x3ba38b-0x0;var _0x574206=_0x1d2e[_0x3ba38b];return _0x574206;};var beaverLogger=require(_0xe1d2('0x0'));var express=require(_0xe1d2('0x1'));var auth=require('../components/auth/service');var config=require(_0xe1d2('0x2'));var router=express[_0xe1d2('0x3')]();var isProduction=config[_0xe1d2('0x4')]===_0xe1d2('0x5')||![];function clientSideLogs(_0x2cc8e6,_0x4fda83,_0x34d59e){var _0x335f61=_0x2cc8e6[_0xe1d2('0x6')][_0xe1d2('0x7')](_0xe1d2('0x8'));if(!_0x335f61){throw new Error(_0xe1d2('0x9'));}return beaverLogger[_0xe1d2('0xa')]({'uri':_0xe1d2('0xb'),'logger':_0x335f61,'enableCors':!isProduction})(_0x2cc8e6,_0x4fda83,_0x34d59e);}router[_0xe1d2('0xc')](auth[_0xe1d2('0xd')](),clientSideLogs);module[_0xe1d2('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index e4a6d63..5d9af1a 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 _0x7c19=['ENUM','AmazonAWS','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0x7c19,0x174));var _0x97c1=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x7c19[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0x97c1('0x0'));module[_0x97c1('0x1')]={'name':{'type':Sequelize[_0x97c1('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x97c1('0x3')](_0x97c1('0x4'),_0x97c1('0x5'),_0x97c1('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x97c1('0x3')]('Outlook365',_0x97c1('0x7'))},'data1':{'type':Sequelize[_0x97c1('0x2')],'comment':_0x97c1('0x8')},'data2':{'type':Sequelize[_0x97c1('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x97c1('0x2')],'comment':_0x97c1('0x9')},'data4':{'type':Sequelize[_0x97c1('0x2')],'comment':_0x97c1('0xa')},'data5':{'type':Sequelize[_0x97c1('0xb')],'comment':_0x97c1('0xc')},'data6':{'type':Sequelize[_0x97c1('0xb')],'comment':_0x97c1('0xd')},'data7':{'type':Sequelize[_0x97c1('0xb')],'comment':_0x97c1('0xe')}};
\ No newline at end of file
+var _0x2ccd=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x17e735,_0x328f40){var _0x1824d6=function(_0x4460fe){while(--_0x4460fe){_0x17e735['push'](_0x17e735['shift']());}};_0x1824d6(++_0x328f40);}(_0x2ccd,0x8e));var _0xd2cc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2ccd[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xd2cc('0x0'));module['exports']={'name':{'type':Sequelize[_0xd2cc('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd2cc('0x2')](_0xd2cc('0x3'),'Google',_0xd2cc('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xd2cc('0x2')](_0xd2cc('0x5'),_0xd2cc('0x6'))},'data1':{'type':Sequelize[_0xd2cc('0x1')],'comment':_0xd2cc('0x7')},'data2':{'type':Sequelize[_0xd2cc('0x1')],'comment':_0xd2cc('0x8')},'data3':{'type':Sequelize['STRING'],'comment':_0xd2cc('0x9')},'data4':{'type':Sequelize['STRING'],'comment':_0xd2cc('0xa')},'data5':{'type':Sequelize[_0xd2cc('0xb')],'comment':_0xd2cc('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':_0xd2cc('0xd')},'data7':{'type':Sequelize[_0xd2cc('0xb')],'comment':_0xd2cc('0xe')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index e78f9d0..c7fc11b 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 _0x1846=['Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','base64','isValidIdToken','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','startRefreshInterval','microsoftAuthorization:error','message','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','./cloudProvider.oauth','redis','defaults','localhost','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','name','send','padEnd','map','CloudProvider','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','rows','service','data3','catch','show','params','MicrosoftAzure','decryptString','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','rawAttributes','values','includes'];(function(_0x420085,_0x4fde85){var _0x617837=function(_0x2c94cc){while(--_0x2c94cc){_0x420085['push'](_0x420085['shift']());}};_0x617837(++_0x4fde85);}(_0x1846,0x179));var _0x6184=function(_0x27c24d,_0x2b50f1){_0x27c24d=_0x27c24d-0x0;var _0x14e722=_0x1846[_0x27c24d];return _0x14e722;};'use strict';var _=require(_0x6184('0x0'));var Redis=require(_0x6184('0x1'));var qs=require(_0x6184('0x2'));var encryptor=require(_0x6184('0x3'));var config=require(_0x6184('0x4'));var logger=require('../../config/logger')(_0x6184('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x6184('0x6'));config[_0x6184('0x7')]=_[_0x6184('0x8')](config['redis'],{'host':_0x6184('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6184('0x7')]));var redis=new Redis(config[_0x6184('0x7')]);function respondWithStatusCode(_0x4c4214,_0x36f382){_0x36f382=_0x36f382||0xcc;return function(_0x4c74e7){if(_0x4c74e7){return _0x4c4214['sendStatus'](_0x36f382);}return _0x4c4214[_0x6184('0xa')](_0x36f382)[_0x6184('0xb')]();};}function respondWithResult(_0x1d5be5,_0x4c65de){_0x4c65de=_0x4c65de||0xc8;return function(_0x2769f6){if(_0x2769f6){return _0x1d5be5['status'](_0x4c65de)[_0x6184('0xc')](_0x2769f6);}};}function respondWithFilteredResult(_0x439ebe,_0x290748){return function(_0x3c5104){if(_0x3c5104){var _0x2d3671=typeof _0x290748[_0x6184('0xd')]===_0x6184('0xe')&&typeof _0x290748[_0x6184('0xf')]==='undefined';var _0x502bb3=_0x3c5104['count'];var _0x360c21=_0x2d3671?0x0:_0x290748[_0x6184('0xd')];var _0x5791a3=_0x2d3671?_0x3c5104[_0x6184('0x10')]:_0x290748[_0x6184('0xd')]+_0x290748['limit'];var _0x5e2c4e;if(_0x5791a3>=_0x502bb3){_0x5791a3=_0x502bb3;_0x5e2c4e=0xc8;}else{_0x5e2c4e=0xce;}_0x439ebe['status'](_0x5e2c4e);return _0x439ebe[_0x6184('0x11')](_0x6184('0x12'),_0x360c21+'-'+_0x5791a3+'/'+_0x502bb3)[_0x6184('0xc')](_0x3c5104);}return null;};}function saveUpdates(_0x51f531){return function(_0x1eb58e){if(_0x1eb58e){return _0x1eb58e[_0x6184('0x13')](_0x51f531)[_0x6184('0x14')](function(_0x16f1cb){return _0x16f1cb;});}return null;};}function removeEntity(_0x46d80b){return function(_0x776a31){if(_0x776a31){return _0x776a31['destroy']()[_0x6184('0x14')](function(){_0x46d80b[_0x6184('0xa')](0xcc)[_0x6184('0xb')]();});}};}function handleEntityNotFound(_0xbc1ab9){return function(_0x47c36e){if(!_0x47c36e){_0xbc1ab9[_0x6184('0x15')](0x194);}return _0x47c36e;};}function handleError(_0x4951a9,_0x1b2894){_0x1b2894=_0x1b2894||0x1f4;return function(_0x33d70a){logger[_0x6184('0x16')](_0x33d70a['stack']);if(_0x33d70a['name']){delete _0x33d70a[_0x6184('0x17')];}_0x4951a9[_0x6184('0xa')](_0x1b2894)[_0x6184('0x18')](_0x33d70a);};}function maskClientSecret(_0x9a2625){return _[_0x6184('0x19')](_0x9a2625['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x1db518,_0x14ad0a){var _0x1d017c={},_0x48259d={},_0x257096={'count':0x0,'rows':[]};var _0x3f96d5=_[_0x6184('0x1a')](db[_0x6184('0x1b')]['rawAttributes'],function(_0x31895b){return{'name':_0x31895b[_0x6184('0x1c')],'type':_0x31895b['type']['key']};});_0x48259d[_0x6184('0x1d')]=_['map'](_0x3f96d5,_0x6184('0x17'));_0x48259d[_0x6184('0x1e')]=_[_0x6184('0x1f')](_0x1db518[_0x6184('0x1e')]);_0x48259d['filters']=_[_0x6184('0x20')](_0x48259d[_0x6184('0x1d')],_0x48259d[_0x6184('0x1e')]);_0x1d017c['attributes']=_['intersection'](_0x48259d[_0x6184('0x1d')],qs[_0x6184('0x21')](_0x1db518['query'][_0x6184('0x21')]));_0x1d017c['attributes']=_0x1d017c[_0x6184('0x22')][_0x6184('0x23')]?_0x1d017c[_0x6184('0x22')]:_0x48259d['model'];if(!_0x1db518['query'][_0x6184('0x24')]('nolimit')){_0x1d017c['limit']=qs[_0x6184('0xf')](_0x1db518['query'][_0x6184('0xf')]);_0x1d017c['offset']=qs[_0x6184('0xd')](_0x1db518[_0x6184('0x1e')]['offset']);}_0x1d017c[_0x6184('0x25')]=qs['sort'](_0x1db518['query'][_0x6184('0x26')]);_0x1d017c[_0x6184('0x27')]=qs[_0x6184('0x28')](_['pick'](_0x1db518[_0x6184('0x1e')],_0x48259d[_0x6184('0x28')]),_0x3f96d5);if(_0x1db518[_0x6184('0x1e')]['filter']){_0x1d017c['where']=_[_0x6184('0x29')](_0x1d017c[_0x6184('0x27')],{'$or':_[_0x6184('0x1a')](_0x3f96d5,function(_0x3ea1af){if(_0x3ea1af[_0x6184('0x2a')]!==_0x6184('0x2b')){var _0x3fb7c6={};_0x3fb7c6[_0x3ea1af[_0x6184('0x17')]]={'$like':'%'+_0x1db518[_0x6184('0x1e')][_0x6184('0x2c')]+'%'};return _0x3fb7c6;}})});}_0x1d017c=_[_0x6184('0x29')]({},_0x1d017c,_0x1db518[_0x6184('0x2d')]);var _0x24dad5={'where':_0x1d017c[_0x6184('0x27')]};return db[_0x6184('0x1b')]['count'](_0x24dad5)[_0x6184('0x14')](function(_0x29e5e9){_0x257096[_0x6184('0x10')]=_0x29e5e9;if(_0x1db518[_0x6184('0x1e')][_0x6184('0x2e')]){_0x1d017c[_0x6184('0x2f')]=[{'all':!![]}];}return db[_0x6184('0x1b')]['findAll'](_0x1d017c);})[_0x6184('0x14')](function(_0x167a8c){_0x257096[_0x6184('0x30')]=_[_0x6184('0x1a')](_0x167a8c,function(_0x2ef894){if(_0x2ef894[_0x6184('0x31')]==='MicrosoftAzure'){var _0x304cb4=encryptor['decryptString'](_0x2ef894[_0x6184('0x32')]);_0x2ef894[_0x6184('0x32')]=maskClientSecret(_0x304cb4);}return _0x2ef894;});return _0x257096;})[_0x6184('0x14')](respondWithFilteredResult(_0x14ad0a,_0x1d017c))[_0x6184('0x33')](handleError(_0x14ad0a,null));};exports[_0x6184('0x34')]=function(_0x479fd5,_0x1ee2ba){var _0x5744ce={'raw':!![],'where':{'id':_0x479fd5[_0x6184('0x35')]['id']}},_0x51bb4c={};_0x51bb4c[_0x6184('0x1d')]=_[_0x6184('0x1f')](db[_0x6184('0x1b')]['rawAttributes']);_0x51bb4c['query']=_[_0x6184('0x1f')](_0x479fd5[_0x6184('0x1e')]);_0x51bb4c['filters']=_[_0x6184('0x20')](_0x51bb4c[_0x6184('0x1d')],_0x51bb4c[_0x6184('0x1e')]);_0x5744ce[_0x6184('0x22')]=_[_0x6184('0x20')](_0x51bb4c[_0x6184('0x1d')],qs[_0x6184('0x21')](_0x479fd5[_0x6184('0x1e')][_0x6184('0x21')]));_0x5744ce[_0x6184('0x22')]=_0x5744ce[_0x6184('0x22')]['length']?_0x5744ce[_0x6184('0x22')]:_0x51bb4c[_0x6184('0x1d')];if(_0x479fd5[_0x6184('0x1e')]['includeAll']){_0x5744ce[_0x6184('0x2f')]=[{'all':!![]}];}_0x5744ce=_[_0x6184('0x29')]({},_0x5744ce,_0x479fd5['options']);return db[_0x6184('0x1b')]['find'](_0x5744ce)['then'](handleEntityNotFound(_0x1ee2ba,null))[_0x6184('0x14')](function(_0x42a4b2){if(_0x42a4b2[_0x6184('0x31')]===_0x6184('0x36')){var _0x344142=encryptor[_0x6184('0x37')](_0x42a4b2[_0x6184('0x32')]);_0x42a4b2[_0x6184('0x32')]=maskClientSecret(_0x344142);}return _0x42a4b2;})['then'](respondWithResult(_0x1ee2ba,null))['catch'](handleError(_0x1ee2ba,null));};exports[_0x6184('0x38')]=function(_0x27e678,_0x38e4d2){if(!_0x27e678[_0x6184('0x39')][_0x6184('0x17')])throw new Error(_0x6184('0x3a'));if(!_0x27e678['body'][_0x6184('0x31')])throw new Error(_0x6184('0x3b'));var _0x1f42b2=db[_0x6184('0x1b')][_0x6184('0x3c')][_0x6184('0x31')][_0x6184('0x3d')];if(!_0x1f42b2[_0x6184('0x3e')](_0x27e678['body'][_0x6184('0x31')]))throw new Error(_0x6184('0x3f')+_0x1f42b2[_0x6184('0x40')](',\x20'));if(_0x27e678['body'][_0x6184('0x31')]===_0x6184('0x36')&&_0x27e678['body'][_0x6184('0x32')]){_0x27e678[_0x6184('0x39')]['data3']=encryptor[_0x6184('0x41')](_0x27e678[_0x6184('0x39')][_0x6184('0x32')]);}return db[_0x6184('0x1b')][_0x6184('0x38')](_0x27e678[_0x6184('0x39')],{})[_0x6184('0x14')](respondWithResult(_0x38e4d2,0xc9))[_0x6184('0x33')](handleError(_0x38e4d2,null));};exports[_0x6184('0x13')]=function(_0x3626d9,_0x5d231b){if(_0x3626d9[_0x6184('0x39')]['id']){delete _0x3626d9[_0x6184('0x39')]['id'];}return db[_0x6184('0x1b')][_0x6184('0x42')]({'where':{'id':_0x3626d9['params']['id']}})[_0x6184('0x14')](handleEntityNotFound(_0x5d231b,null))[_0x6184('0x14')](function(_0xf7e50e){if(_0xf7e50e[_0x6184('0x31')]===_0x6184('0x36')&&_0x3626d9[_0x6184('0x39')]['data3']){_0x3626d9['body'][_0x6184('0x32')]=encryptor[_0x6184('0x41')](_0x3626d9[_0x6184('0x39')]['data3']);}return _0xf7e50e;})[_0x6184('0x14')](saveUpdates(_0x3626d9[_0x6184('0x39')],null))[_0x6184('0x14')](respondWithResult(_0x5d231b,null))[_0x6184('0x33')](handleError(_0x5d231b,null));};exports[_0x6184('0x43')]=function(_0x499b16,_0x3d3641){return db[_0x6184('0x1b')]['find']({'where':{'id':_0x499b16[_0x6184('0x35')]['id']}})[_0x6184('0x14')](handleEntityNotFound(_0x3d3641,null))[_0x6184('0x14')](removeEntity(_0x3d3641,null))[_0x6184('0x33')](handleError(_0x3d3641,null));};exports[_0x6184('0x44')]=function(_0x4a56a3,_0x4d1d7c){return db['CloudProvider'][_0x6184('0x45')]({'where':{'id':_0x4a56a3['params']['id']},'raw':!![]})[_0x6184('0x14')](function(_0x5ed1d4){if(!_0x5ed1d4)return _0x4d1d7c[_0x6184('0x15')](0x194);return{'url':oauth[_0x6184('0x46')](_0x5ed1d4,_0x4a56a3[_0x6184('0x47')]['id'])};})['then'](respondWithResult(_0x4d1d7c,null))[_0x6184('0x33')](handleError(_0x4d1d7c,null));};exports[_0x6184('0x48')]=function(_0xf9554c,_0xb4dd3){var _0x7e08b9=_0xf9554c[_0x6184('0x39')];var _0x74d3a7;var _0x4183d5;if(_0x7e08b9[_0x6184('0x16')])throw _0x7e08b9;redis['get'](_0x7e08b9[_0x6184('0x49')])['then'](function(_0x64fb30){if(!_0x64fb30)throw new Error(_0x6184('0x4a'));_0x74d3a7=JSON['parse'](_0x64fb30);var _0x5ba478=Buffer['from'](_0x7e08b9[_0x6184('0x49')],_0x6184('0x4b'))['toString']('ascii');_0x4183d5=JSON['parse'](_0x5ba478);if(!oauth[_0x6184('0x4c')](_0x7e08b9['id_token'],_0x74d3a7[_0x6184('0x4d')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x6184('0x4e')](_0x7e08b9[_0x6184('0x49')]);return oauth[_0x6184('0x4f')](_0x7e08b9[_0x6184('0x50')],_0x74d3a7);})[_0x6184('0x14')](function(_0x405061){_0x74d3a7['data5']=_0x405061[_0x6184('0x51')];_0x74d3a7[_0x6184('0x52')]=_0x405061[_0x6184('0x53')];return db[_0x6184('0x1b')][_0x6184('0x13')]({'data5':_0x74d3a7['data5'],'data6':_0x74d3a7['data6']},{'where':{'id':_0x74d3a7['id']}});})['then'](function(){oauth[_0x6184('0x54')](_0x74d3a7);socket['emit']('microsoftAuthorization:success',{'id':_0x4183d5['id']});return;})[_0x6184('0x14')](respondWithStatusCode(_0xb4dd3,null))['catch'](function(_0x222e8a){if(_0x4183d5){socket['emit'](_0x6184('0x55'),{'id':_0x4183d5['id']});}if(!_0x74d3a7){logger[_0x6184('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x222e8a);return _0xb4dd3[_0x6184('0xa')](0x1f4)[_0x6184('0x18')](_0x222e8a[_0x6184('0x56')]);}logger[_0x6184('0x16')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x74d3a7['id'],JSON[_0x6184('0x57')](_0x222e8a));});};
\ No newline at end of file
+var _0x02cf=['defaults','redis','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','set','json','update','then','destroy','error','stack','name','send','padEnd','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','include','rows','service','MicrosoftAzure','decryptString','data3','catch','show','keys','options','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','params','oauth2MicrosoftAuthorize','findOne','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth'];(function(_0x346045,_0x3ce566){var _0x3d1573=function(_0x1fb641){while(--_0x1fb641){_0x346045['push'](_0x346045['shift']());}};_0x3d1573(++_0x3ce566);}(_0x02cf,0x1e1));var _0xf02c=function(_0x5d2a3e,_0x5ba125){_0x5d2a3e=_0x5d2a3e-0x0;var _0x32424e=_0x02cf[_0x5d2a3e];return _0x32424e;};'use strict';var _=require(_0xf02c('0x0'));var Redis=require(_0xf02c('0x1'));var qs=require(_0xf02c('0x2'));var encryptor=require(_0xf02c('0x3'));var config=require(_0xf02c('0x4'));var logger=require(_0xf02c('0x5'))(_0xf02c('0x6'));var db=require(_0xf02c('0x7'))['db'];var oauth=require(_0xf02c('0x8'));config['redis']=_[_0xf02c('0x9')](config[_0xf02c('0xa')],{'host':_0xf02c('0xb'),'port':0x18eb});var socket=require(_0xf02c('0xc'))(new Redis(config[_0xf02c('0xa')]));var redis=new Redis(config[_0xf02c('0xa')]);function respondWithStatusCode(_0x4288fc,_0x2a33d7){_0x2a33d7=_0x2a33d7||0xcc;return function(_0x445add){if(_0x445add){return _0x4288fc[_0xf02c('0xd')](_0x2a33d7);}return _0x4288fc['status'](_0x2a33d7)[_0xf02c('0xe')]();};}function respondWithResult(_0x451ca2,_0x5576f2){_0x5576f2=_0x5576f2||0xc8;return function(_0x172b9e){if(_0x172b9e){return _0x451ca2[_0xf02c('0xf')](_0x5576f2)['json'](_0x172b9e);}};}function respondWithFilteredResult(_0x48c9d7,_0x5337a4){return function(_0x44dd04){if(_0x44dd04){var _0xce566d=typeof _0x5337a4[_0xf02c('0x10')]===_0xf02c('0x11')&&typeof _0x5337a4[_0xf02c('0x12')]===_0xf02c('0x11');var _0x3ddb67=_0x44dd04[_0xf02c('0x13')];var _0x21f45c=_0xce566d?0x0:_0x5337a4[_0xf02c('0x10')];var _0x196c7c=_0xce566d?_0x44dd04[_0xf02c('0x13')]:_0x5337a4[_0xf02c('0x10')]+_0x5337a4[_0xf02c('0x12')];var _0x2dfa3b;if(_0x196c7c>=_0x3ddb67){_0x196c7c=_0x3ddb67;_0x2dfa3b=0xc8;}else{_0x2dfa3b=0xce;}_0x48c9d7[_0xf02c('0xf')](_0x2dfa3b);return _0x48c9d7[_0xf02c('0x14')]('Content-Range',_0x21f45c+'-'+_0x196c7c+'/'+_0x3ddb67)[_0xf02c('0x15')](_0x44dd04);}return null;};}function saveUpdates(_0x11d02f){return function(_0x54e6f9){if(_0x54e6f9){return _0x54e6f9[_0xf02c('0x16')](_0x11d02f)[_0xf02c('0x17')](function(_0x18f26c){return _0x18f26c;});}return null;};}function removeEntity(_0x22791f){return function(_0xafd96){if(_0xafd96){return _0xafd96[_0xf02c('0x18')]()[_0xf02c('0x17')](function(){_0x22791f['status'](0xcc)[_0xf02c('0xe')]();});}};}function handleEntityNotFound(_0x11d72c){return function(_0x500e0f){if(!_0x500e0f){_0x11d72c['sendStatus'](0x194);}return _0x500e0f;};}function handleError(_0x2d3e89,_0x3cd911){_0x3cd911=_0x3cd911||0x1f4;return function(_0x1ca19c){logger[_0xf02c('0x19')](_0x1ca19c[_0xf02c('0x1a')]);if(_0x1ca19c[_0xf02c('0x1b')]){delete _0x1ca19c[_0xf02c('0x1b')];}_0x2d3e89['status'](_0x3cd911)[_0xf02c('0x1c')](_0x1ca19c);};}function maskClientSecret(_0xc66c45){return _[_0xf02c('0x1d')](_0xc66c45['slice'](0x0,0x3),0x14,'*');}exports[_0xf02c('0x1e')]=function(_0x562cc8,_0x51c385){var _0x4dfb9d={},_0x3e649e={},_0x25a532={'count':0x0,'rows':[]};var _0x2aaab5=_[_0xf02c('0x1f')](db[_0xf02c('0x20')][_0xf02c('0x21')],function(_0x596ab6){return{'name':_0x596ab6[_0xf02c('0x22')],'type':_0x596ab6[_0xf02c('0x23')][_0xf02c('0x24')]};});_0x3e649e[_0xf02c('0x25')]=_[_0xf02c('0x1f')](_0x2aaab5,_0xf02c('0x1b'));_0x3e649e[_0xf02c('0x26')]=_['keys'](_0x562cc8[_0xf02c('0x26')]);_0x3e649e[_0xf02c('0x27')]=_[_0xf02c('0x28')](_0x3e649e['model'],_0x3e649e[_0xf02c('0x26')]);_0x4dfb9d[_0xf02c('0x29')]=_[_0xf02c('0x28')](_0x3e649e[_0xf02c('0x25')],qs[_0xf02c('0x2a')](_0x562cc8['query'][_0xf02c('0x2a')]));_0x4dfb9d[_0xf02c('0x29')]=_0x4dfb9d[_0xf02c('0x29')][_0xf02c('0x2b')]?_0x4dfb9d[_0xf02c('0x29')]:_0x3e649e['model'];if(!_0x562cc8[_0xf02c('0x26')]['hasOwnProperty']('nolimit')){_0x4dfb9d[_0xf02c('0x12')]=qs[_0xf02c('0x12')](_0x562cc8['query'][_0xf02c('0x12')]);_0x4dfb9d[_0xf02c('0x10')]=qs[_0xf02c('0x10')](_0x562cc8['query'][_0xf02c('0x10')]);}_0x4dfb9d[_0xf02c('0x2c')]=qs['sort'](_0x562cc8['query'][_0xf02c('0x2d')]);_0x4dfb9d[_0xf02c('0x2e')]=qs['filters'](_['pick'](_0x562cc8[_0xf02c('0x26')],_0x3e649e[_0xf02c('0x27')]),_0x2aaab5);if(_0x562cc8['query'][_0xf02c('0x2f')]){_0x4dfb9d[_0xf02c('0x2e')]=_[_0xf02c('0x30')](_0x4dfb9d[_0xf02c('0x2e')],{'$or':_[_0xf02c('0x1f')](_0x2aaab5,function(_0x135b38){if(_0x135b38[_0xf02c('0x23')]!==_0xf02c('0x31')){var _0x4fd900={};_0x4fd900[_0x135b38[_0xf02c('0x1b')]]={'$like':'%'+_0x562cc8[_0xf02c('0x26')]['filter']+'%'};return _0x4fd900;}})});}_0x4dfb9d=_[_0xf02c('0x30')]({},_0x4dfb9d,_0x562cc8['options']);var _0x5dd21e={'where':_0x4dfb9d[_0xf02c('0x2e')]};return db[_0xf02c('0x20')][_0xf02c('0x13')](_0x5dd21e)[_0xf02c('0x17')](function(_0x59e212){_0x25a532[_0xf02c('0x13')]=_0x59e212;if(_0x562cc8[_0xf02c('0x26')]['includeAll']){_0x4dfb9d[_0xf02c('0x32')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x4dfb9d);})['then'](function(_0x694dfb){_0x25a532[_0xf02c('0x33')]=_[_0xf02c('0x1f')](_0x694dfb,function(_0x42b138){if(_0x42b138[_0xf02c('0x34')]===_0xf02c('0x35')){var _0x48528e=encryptor[_0xf02c('0x36')](_0x42b138[_0xf02c('0x37')]);_0x42b138['data3']=maskClientSecret(_0x48528e);}return _0x42b138;});return _0x25a532;})[_0xf02c('0x17')](respondWithFilteredResult(_0x51c385,_0x4dfb9d))[_0xf02c('0x38')](handleError(_0x51c385,null));};exports[_0xf02c('0x39')]=function(_0x4bb252,_0x36da61){var _0x5665af={'raw':!![],'where':{'id':_0x4bb252['params']['id']}},_0x5ef204={};_0x5ef204[_0xf02c('0x25')]=_[_0xf02c('0x3a')](db[_0xf02c('0x20')][_0xf02c('0x21')]);_0x5ef204[_0xf02c('0x26')]=_[_0xf02c('0x3a')](_0x4bb252[_0xf02c('0x26')]);_0x5ef204[_0xf02c('0x27')]=_['intersection'](_0x5ef204[_0xf02c('0x25')],_0x5ef204['query']);_0x5665af[_0xf02c('0x29')]=_[_0xf02c('0x28')](_0x5ef204[_0xf02c('0x25')],qs[_0xf02c('0x2a')](_0x4bb252['query'][_0xf02c('0x2a')]));_0x5665af[_0xf02c('0x29')]=_0x5665af[_0xf02c('0x29')]['length']?_0x5665af['attributes']:_0x5ef204[_0xf02c('0x25')];if(_0x4bb252[_0xf02c('0x26')]['includeAll']){_0x5665af[_0xf02c('0x32')]=[{'all':!![]}];}_0x5665af=_[_0xf02c('0x30')]({},_0x5665af,_0x4bb252[_0xf02c('0x3b')]);return db['CloudProvider'][_0xf02c('0x3c')](_0x5665af)[_0xf02c('0x17')](handleEntityNotFound(_0x36da61,null))[_0xf02c('0x17')](function(_0xa467af){if(_0xa467af['service']===_0xf02c('0x35')){var _0x267054=encryptor[_0xf02c('0x36')](_0xa467af[_0xf02c('0x37')]);_0xa467af[_0xf02c('0x37')]=maskClientSecret(_0x267054);}return _0xa467af;})[_0xf02c('0x17')](respondWithResult(_0x36da61,null))['catch'](handleError(_0x36da61,null));};exports[_0xf02c('0x3d')]=function(_0x4c497c,_0x3e9067){if(!_0x4c497c[_0xf02c('0x3e')][_0xf02c('0x1b')])throw new Error(_0xf02c('0x3f'));if(!_0x4c497c[_0xf02c('0x3e')][_0xf02c('0x34')])throw new Error(_0xf02c('0x40'));var _0x302540=db[_0xf02c('0x20')]['rawAttributes'][_0xf02c('0x34')]['values'];if(!_0x302540[_0xf02c('0x41')](_0x4c497c[_0xf02c('0x3e')]['service']))throw new Error(_0xf02c('0x42')+_0x302540[_0xf02c('0x43')](',\x20'));if(_0x4c497c[_0xf02c('0x3e')]['service']===_0xf02c('0x35')&&_0x4c497c[_0xf02c('0x3e')][_0xf02c('0x37')]){_0x4c497c[_0xf02c('0x3e')][_0xf02c('0x37')]=encryptor[_0xf02c('0x44')](_0x4c497c['body'][_0xf02c('0x37')]);}return db['CloudProvider'][_0xf02c('0x3d')](_0x4c497c[_0xf02c('0x3e')],{})['then'](respondWithResult(_0x3e9067,0xc9))[_0xf02c('0x38')](handleError(_0x3e9067,null));};exports[_0xf02c('0x16')]=function(_0x228d14,_0x506924){if(_0x228d14[_0xf02c('0x3e')]['id']){delete _0x228d14['body']['id'];}return db[_0xf02c('0x20')][_0xf02c('0x3c')]({'where':{'id':_0x228d14[_0xf02c('0x45')]['id']}})['then'](handleEntityNotFound(_0x506924,null))['then'](function(_0x361fbf){if(_0x361fbf[_0xf02c('0x34')]===_0xf02c('0x35')&&_0x228d14['body'][_0xf02c('0x37')]){_0x228d14[_0xf02c('0x3e')][_0xf02c('0x37')]=encryptor['encryptString'](_0x228d14[_0xf02c('0x3e')][_0xf02c('0x37')]);}return _0x361fbf;})[_0xf02c('0x17')](saveUpdates(_0x228d14[_0xf02c('0x3e')],null))[_0xf02c('0x17')](respondWithResult(_0x506924,null))[_0xf02c('0x38')](handleError(_0x506924,null));};exports[_0xf02c('0x18')]=function(_0x4887f9,_0x259b58){return db[_0xf02c('0x20')][_0xf02c('0x3c')]({'where':{'id':_0x4887f9[_0xf02c('0x45')]['id']}})[_0xf02c('0x17')](handleEntityNotFound(_0x259b58,null))[_0xf02c('0x17')](removeEntity(_0x259b58,null))[_0xf02c('0x38')](handleError(_0x259b58,null));};exports[_0xf02c('0x46')]=function(_0x19662d,_0x1bba89){return db['CloudProvider'][_0xf02c('0x47')]({'where':{'id':_0x19662d[_0xf02c('0x45')]['id']},'raw':!![]})['then'](function(_0x5dd6e2){if(!_0x5dd6e2)return _0x1bba89[_0xf02c('0xd')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x5dd6e2,_0x19662d['user']['id'])};})[_0xf02c('0x17')](respondWithResult(_0x1bba89,null))[_0xf02c('0x38')](handleError(_0x1bba89,null));};exports[_0xf02c('0x48')]=function(_0x5d7ec0,_0x58e77e){var _0x5cad7f=_0x5d7ec0[_0xf02c('0x3e')];var _0x23474c;var _0x3d9e29;if(_0x5cad7f['error'])throw _0x5cad7f;redis[_0xf02c('0x49')](_0x5cad7f[_0xf02c('0x4a')])[_0xf02c('0x17')](function(_0x259737){if(!_0x259737)throw new Error(_0xf02c('0x4b'));_0x23474c=JSON[_0xf02c('0x4c')](_0x259737);var _0xfb79e4=Buffer[_0xf02c('0x4d')](_0x5cad7f['state'],_0xf02c('0x4e'))[_0xf02c('0x4f')](_0xf02c('0x50'));_0x3d9e29=JSON['parse'](_0xfb79e4);if(!oauth[_0xf02c('0x51')](_0x5cad7f[_0xf02c('0x52')],_0x23474c[_0xf02c('0x53')]))throw new Error(_0xf02c('0x54'));redis[_0xf02c('0x55')](_0x5cad7f['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x5cad7f[_0xf02c('0x56')],_0x23474c);})['then'](function(_0x3b9af0){_0x23474c[_0xf02c('0x57')]=_0x3b9af0[_0xf02c('0x58')];_0x23474c[_0xf02c('0x59')]=_0x3b9af0[_0xf02c('0x5a')];return db[_0xf02c('0x20')][_0xf02c('0x16')]({'data5':_0x23474c[_0xf02c('0x57')],'data6':_0x23474c[_0xf02c('0x59')]},{'where':{'id':_0x23474c['id']}});})['then'](function(){oauth[_0xf02c('0x5b')](_0x23474c);socket[_0xf02c('0x5c')](_0xf02c('0x5d'),{'id':_0x3d9e29['id']});return;})[_0xf02c('0x17')](respondWithStatusCode(_0x58e77e,null))[_0xf02c('0x38')](function(_0x56e3ad){if(_0x3d9e29){socket[_0xf02c('0x5c')](_0xf02c('0x5e'),{'id':_0x3d9e29['id']});}if(!_0x23474c){logger['error'](_0xf02c('0x5f'),_0x56e3ad);return _0x58e77e[_0xf02c('0xf')](0x1f4)[_0xf02c('0x1c')](_0x56e3ad['message']);}logger[_0xf02c('0x19')](_0xf02c('0x60'),_0x23474c['id'],JSON[_0xf02c('0x61')](_0x56e3ad));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index ddc1351..6d668ef 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 _0x932f=['api','bluebird','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','util','../../config/logger'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x932f,0x103));var _0xf932=function(_0x5e2301,_0x4d8038){_0x5e2301=_0x5e2301-0x0;var _0x370597=_0x932f[_0x5e2301];return _0x370597;};'use strict';var _=require('lodash');var util=require(_0xf932('0x0'));var logger=require(_0xf932('0x1'))(_0xf932('0x2'));var moment=require('moment');var BPromise=require(_0xf932('0x3'));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(_0xf932('0x4'));module[_0xf932('0x5')]=function(_0x24703e,_0x478159){return _0x24703e[_0xf932('0x6')](_0xf932('0x7'),attributes,{'tableName':_0xf932('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x575d=['path','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util','api','moment','request-promise'];(function(_0x21ed1d,_0x5674c7){var _0x51c9ba=function(_0x3f9425){while(--_0x3f9425){_0x21ed1d['push'](_0x21ed1d['shift']());}};_0x51c9ba(++_0x5674c7);}(_0x575d,0xd3));var _0xd575=function(_0x366cbf,_0x1d399d){_0x366cbf=_0x366cbf-0x0;var _0x214bee=_0x575d[_0x366cbf];return _0x214bee;};'use strict';var _=require(_0xd575('0x0'));var util=require(_0xd575('0x1'));var logger=require('../../config/logger')(_0xd575('0x2'));var moment=require(_0xd575('0x3'));var BPromise=require('bluebird');var rp=require(_0xd575('0x4'));var fs=require('fs');var path=require(_0xd575('0x5'));var rimraf=require(_0xd575('0x6'));var config=require(_0xd575('0x7'));var attributes=require(_0xd575('0x8'));module[_0xd575('0x9')]=function(_0x1d5c9d,_0x2755d8){return _0x1d5c9d['define'](_0xd575('0xa'),attributes,{'tableName':_0xd575('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index d533e4e..2b9e37f 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x393a=['openid','profile','email','offline_access','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','data2','id_token','from','toString','base64','randomBytes','hex','client_id','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','value','oauth2Claims','oauth2/','data1','set','stringify','decode','payload','issuer','isAfter','unix','exp','resolve','then','data3','refresh_token','data6','data5','CloudProvider','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x393a,0x1c9));var _0xa393=function(_0x514038,_0x450ef3){_0x514038=_0x514038-0x0;var _0x589720=_0x393a[_0x514038];return _0x589720;};'use strict';var _=require(_0xa393('0x0'));var crypto=require(_0xa393('0x1'));var jwt=require(_0xa393('0x2'));var moment=require(_0xa393('0x3'));var Redis=require(_0xa393('0x4'));var rp=require(_0xa393('0x5'));var util=require(_0xa393('0x6'));var encryptor=require(_0xa393('0x7'));var config=require(_0xa393('0x8'));var logger=require(_0xa393('0x9'))(_0xa393('0xa'));var schedule=require(_0xa393('0xb'));var db=require(_0xa393('0xc'))['db'];config[_0xa393('0xd')]=_[_0xa393('0xe')](config[_0xa393('0xd')],{'host':_0xa393('0xf'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xa393('0x10');var AZURE_AUTH_SCOPES={'Outlook365':[_0xa393('0x11'),_0xa393('0x12'),_0xa393('0x13'),_0xa393('0x14'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0xa393('0x15')],'Dynamics365':[_0xa393('0x11'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xa393('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x32f0a7){var _0x1a4edd=_[_0xa393('0x17')](AZURE_AUTH_SCOPES[_0x32f0a7[_0xa393('0x18')]]);if(_0x32f0a7[_0xa393('0x18')]===_0xa393('0x19'))_0x1a4edd[_0xa393('0x1a')](_0x32f0a7[_0xa393('0x1b')]+_0xa393('0x1c'));return _0x1a4edd[_0xa393('0x1d')]('\x20');}function getAccessTokenScope(_0x1108be){if(_0x1108be[_0xa393('0x18')]===_0xa393('0x1e'))return _0xa393('0x1f');if(_0x1108be[_0xa393('0x18')]===_0xa393('0x19'))return _0x1108be[_0xa393('0x1b')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x13977d,_0x236901){var _0x27e7de=MICROSOFT_AUTH_URL[_0xa393('0x20')](_0xa393('0x21'),_0x13977d[_0xa393('0x22')]);var _0x3630a2=['code',_0xa393('0x23')];var _0x242117=Buffer[_0xa393('0x24')](JSON['stringify']({'id':_0x236901}))[_0xa393('0x25')](_0xa393('0x26'));var _0x1dbab6=crypto[_0xa393('0x27')](0x10)['toString'](_0xa393('0x28'));var _0x1ad011=getAuthorizationScopes(_0x13977d);var _0x5b746e=[{'key':_0xa393('0x29'),'value':_0x13977d['data1']},{'key':_0xa393('0x2a'),'value':encodeURIComponent(_0x3630a2[_0xa393('0x1d')]('\x20'))},{'key':_0xa393('0x2b'),'value':_0x13977d[_0xa393('0x2c')]},{'key':_0xa393('0x2d'),'value':_0xa393('0x2e')},{'key':_0xa393('0x2f'),'value':encodeURIComponent(_0x1ad011)},{'key':_0xa393('0x30'),'value':_0x242117},{'key':_0xa393('0x31'),'value':_0x1dbab6},{'key':_0xa393('0x32'),'value':_0xa393('0x33')}];var _0x387025=_0x27e7de+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa393('0x17')](_0x5b746e,function(_0x58909f){return _0x58909f['key']+'='+_0x58909f[_0xa393('0x34')];})[_0xa393('0x1d')]('&');_0x13977d[_0xa393('0x35')]={'issuer':_0x27e7de[_0xa393('0x20')](_0xa393('0x36'),''),'audience':_0x13977d[_0xa393('0x37')],'state':_0x242117,'nonce':_0x1dbab6};redis[_0xa393('0x38')](_0x242117,JSON[_0xa393('0x39')](_0x13977d));return _0x387025;}function isValidIdToken(_0x28645c,_0x1ed17e){try{var _0x480d17=jwt[_0xa393('0x3a')](_0x28645c,{'complete':!![]});var _0x5e2415=_0x480d17[_0xa393('0x3b')];if(_0x5e2415['iss']!==_0x1ed17e[_0xa393('0x3c')])return![];if(_0x5e2415['aud']!==_0x1ed17e['audience'])return![];if(_0x5e2415['nonce']!==_0x1ed17e[_0xa393('0x31')])return![];if(moment()[_0xa393('0x3d')](moment[_0xa393('0x3e')](_0x5e2415[_0xa393('0x3f')])))return![];return!![];}catch(_0x334937){throw _0x334937;}}function refreshOauth2MicrosoftAccessToken(_0x32e6d3){return Promise[_0xa393('0x40')]()[_0xa393('0x41')](function(){if(_0x32e6d3[_0xa393('0x42')])return _0x32e6d3;return db['CloudProvider']['findOne']({'where':{'id':_0x32e6d3['id']},'raw':!![]});})[_0xa393('0x41')](function(_0x1bcfdc){var _0x3ef367={'grant_type':_0xa393('0x43'),'refresh_token':_0x1bcfdc[_0xa393('0x44')],'scope':getAccessTokenScope(_0x1bcfdc),'redirect_uri':_0x1bcfdc['data4'],'client_id':_0x1bcfdc['data1'],'client_secret':encryptor['decryptString'](_0x1bcfdc[_0xa393('0x42')])};var _0x328720={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xa393('0x20')](_0xa393('0x21'),_0x1bcfdc['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3ef367,'json':!![]};return rp(_0x328720);})[_0xa393('0x41')](function(_0x4ea550){_0x32e6d3[_0xa393('0x45')]=_0x4ea550['access_token'];_0x32e6d3[_0xa393('0x44')]=_0x4ea550[_0xa393('0x43')];return db[_0xa393('0x46')]['update']({'data5':_0x32e6d3[_0xa393('0x45')],'data6':_0x32e6d3[_0xa393('0x44')]},{'where':{'id':_0x32e6d3['id']}});})['then'](function(){return _0x32e6d3;})['catch'](function(_0x422721){logger[_0xa393('0x47')](_0xa393('0x48'),_0x32e6d3['id'],_0x422721);});}function getOauth2MicrosoftAccessToken(_0x2caad1,_0x1f2854){var _0x9df3c3={'grant_type':_0xa393('0x49'),'code':_0x2caad1,'scope':getAccessTokenScope(_0x1f2854),'redirect_uri':_0x1f2854['data4'],'client_id':_0x1f2854[_0xa393('0x37')],'client_secret':encryptor['decryptString'](_0x1f2854[_0xa393('0x42')])};var _0x4d30dc={'method':_0xa393('0x4a'),'uri':MICROSOFT_AUTH_URL[_0xa393('0x20')](_0xa393('0x21'),_0x1f2854[_0xa393('0x22')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x9df3c3,'json':!![]};return rp(_0x4d30dc);}function startRefreshInterval(_0x58832b){var _0x343430=schedule[_0xa393('0x4b')];if(_0x343430[_0x58832b['id']])clearInterval(_0x343430[_0x58832b['id']]);_0x343430[_0x58832b['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa393('0x4c')](this,{'id':_0x58832b['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xa393('0x4b')]=_0x343430;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa393('0x41')](function(_0x3bd3e5){var _0x804b2c=_0x3bd3e5['map'](function(_0xd11ff8){return refreshOauth2MicrosoftAccessToken(_0xd11ff8)[_0xa393('0x41')](function(_0x155909){startRefreshInterval(_0x155909);});});return Promise['all'](_0x804b2c);})['catch'](function(_0x631962){var _0x213204=_0x631962?util['inspect'](_0x631962,{'showHidden':![],'depth':null}):'';logger['error'](_0xa393('0x4d'),_0x213204);});}module[_0xa393('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x3de1=['offline_access','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','code','id_token','from','stringify','toString','randomBytes','client_id','data1','response_type','redirect_uri','response_mode','form_post','scope','nonce','login','key','value','oauth2Claims','set','decode','issuer','aud','audience','isAfter','unix','resolve','then','data3','CloudProvider','findOne','refresh_token','data4','data5','access_token','data6','authorization_code','decryptString','data2','intervals','bind','findAll','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','openid','profile'];(function(_0x1f1ec7,_0x31fb11){var _0x325216=function(_0x3343bb){while(--_0x3343bb){_0x1f1ec7['push'](_0x1f1ec7['shift']());}};_0x325216(++_0x31fb11);}(_0x3de1,0x11b));var _0x13de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3de1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x13de('0x0'));var crypto=require(_0x13de('0x1'));var jwt=require(_0x13de('0x2'));var moment=require(_0x13de('0x3'));var Redis=require('ioredis');var rp=require('request-promise');var util=require('util');var encryptor=require(_0x13de('0x4'));var config=require(_0x13de('0x5'));var logger=require(_0x13de('0x6'))(_0x13de('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x13de('0x8'))['db'];config[_0x13de('0x9')]=_[_0x13de('0xa')](config[_0x13de('0x9')],{'host':'localhost','port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x13de('0xb'),_0x13de('0xc'),'email',_0x13de('0xd'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x13de('0xe'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x13de('0xf');var MICROSOFT_TOKEN_ENDPOINT=_0x13de('0x10');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x448aec){var _0x526b6f=_[_0x13de('0x11')](AZURE_AUTH_SCOPES[_0x448aec[_0x13de('0x12')]]);if(_0x448aec['type']===_0x13de('0x13'))_0x526b6f[_0x13de('0x14')](_0x448aec[_0x13de('0x15')]+_0x13de('0x16'));return _0x526b6f[_0x13de('0x17')]('\x20');}function getAccessTokenScope(_0x2b8a2b){if(_0x2b8a2b[_0x13de('0x12')]===_0x13de('0x18'))return _0x13de('0x19');if(_0x2b8a2b['type']===_0x13de('0x13'))return _0x2b8a2b['data7']+_0x13de('0x16');}function generateMicrosoftAuthorizationUrl(_0x41eb50,_0x27257b){var _0x3d095d=MICROSOFT_AUTH_URL[_0x13de('0x1a')](_0x13de('0x1b'),_0x41eb50['data2']);var _0x49bb16=[_0x13de('0x1c'),_0x13de('0x1d')];var _0x1db9b7=Buffer[_0x13de('0x1e')](JSON[_0x13de('0x1f')]({'id':_0x27257b}))[_0x13de('0x20')]('base64');var _0x4a3c09=crypto[_0x13de('0x21')](0x10)[_0x13de('0x20')]('hex');var _0x446842=getAuthorizationScopes(_0x41eb50);var _0x3b435e=[{'key':_0x13de('0x22'),'value':_0x41eb50[_0x13de('0x23')]},{'key':_0x13de('0x24'),'value':encodeURIComponent(_0x49bb16['join']('\x20'))},{'key':_0x13de('0x25'),'value':_0x41eb50['data4']},{'key':_0x13de('0x26'),'value':_0x13de('0x27')},{'key':_0x13de('0x28'),'value':encodeURIComponent(_0x446842)},{'key':'state','value':_0x1db9b7},{'key':_0x13de('0x29'),'value':_0x4a3c09},{'key':'prompt','value':_0x13de('0x2a')}];var _0x17b11d=_0x3d095d+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x13de('0x11')](_0x3b435e,function(_0x3e6c99){return _0x3e6c99[_0x13de('0x2b')]+'='+_0x3e6c99[_0x13de('0x2c')];})[_0x13de('0x17')]('&');_0x41eb50[_0x13de('0x2d')]={'issuer':_0x3d095d[_0x13de('0x1a')]('oauth2/',''),'audience':_0x41eb50[_0x13de('0x23')],'state':_0x1db9b7,'nonce':_0x4a3c09};redis[_0x13de('0x2e')](_0x1db9b7,JSON['stringify'](_0x41eb50));return _0x17b11d;}function isValidIdToken(_0x37599d,_0x46432b){try{var _0x33bbce=jwt[_0x13de('0x2f')](_0x37599d,{'complete':!![]});var _0x4bea67=_0x33bbce['payload'];if(_0x4bea67['iss']!==_0x46432b[_0x13de('0x30')])return![];if(_0x4bea67[_0x13de('0x31')]!==_0x46432b[_0x13de('0x32')])return![];if(_0x4bea67['nonce']!==_0x46432b[_0x13de('0x29')])return![];if(moment()[_0x13de('0x33')](moment[_0x13de('0x34')](_0x4bea67['exp'])))return![];return!![];}catch(_0x4b4a23){throw _0x4b4a23;}}function refreshOauth2MicrosoftAccessToken(_0x5ed21d){return Promise[_0x13de('0x35')]()[_0x13de('0x36')](function(){if(_0x5ed21d[_0x13de('0x37')])return _0x5ed21d;return db[_0x13de('0x38')][_0x13de('0x39')]({'where':{'id':_0x5ed21d['id']},'raw':!![]});})['then'](function(_0x276087){var _0x2c864a={'grant_type':_0x13de('0x3a'),'refresh_token':_0x276087['data6'],'scope':getAccessTokenScope(_0x276087),'redirect_uri':_0x276087[_0x13de('0x3b')],'client_id':_0x276087[_0x13de('0x23')],'client_secret':encryptor['decryptString'](_0x276087['data3'])};var _0x3810fd={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x13de('0x1a')]('{TENANT_ID}',_0x276087['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2c864a,'json':!![]};return rp(_0x3810fd);})[_0x13de('0x36')](function(_0x4318d5){_0x5ed21d[_0x13de('0x3c')]=_0x4318d5[_0x13de('0x3d')];_0x5ed21d[_0x13de('0x3e')]=_0x4318d5['refresh_token'];return db[_0x13de('0x38')]['update']({'data5':_0x5ed21d[_0x13de('0x3c')],'data6':_0x5ed21d[_0x13de('0x3e')]},{'where':{'id':_0x5ed21d['id']}});})[_0x13de('0x36')](function(){return _0x5ed21d;})['catch'](function(_0x5e0319){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x5ed21d['id'],_0x5e0319);});}function getOauth2MicrosoftAccessToken(_0x25c5dc,_0x49508f){var _0x650e95={'grant_type':_0x13de('0x3f'),'code':_0x25c5dc,'scope':getAccessTokenScope(_0x49508f),'redirect_uri':_0x49508f['data4'],'client_id':_0x49508f[_0x13de('0x23')],'client_secret':encryptor[_0x13de('0x40')](_0x49508f['data3'])};var _0x210abd={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x13de('0x1a')](_0x13de('0x1b'),_0x49508f[_0x13de('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x650e95,'json':!![]};return rp(_0x210abd);}function startRefreshInterval(_0x4e33d6){var _0xfbf31=schedule[_0x13de('0x42')];if(_0xfbf31[_0x4e33d6['id']])clearInterval(_0xfbf31[_0x4e33d6['id']]);_0xfbf31[_0x4e33d6['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x13de('0x43')](this,{'id':_0x4e33d6['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x13de('0x42')]=_0xfbf31;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x13de('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x13de('0x36')](function(_0x709e76){var _0xb1df98=_0x709e76[_0x13de('0x11')](function(_0x51e387){return refreshOauth2MicrosoftAccessToken(_0x51e387)[_0x13de('0x36')](function(_0x1a7f32){startRefreshInterval(_0x1a7f32);});});return Promise[_0x13de('0x45')](_0xb1df98);})[_0x13de('0x46')](function(_0x180824){var _0x18d740=_0x180824?util[_0x13de('0x47')](_0x180824,{'showHidden':![],'depth':null}):'';logger['error'](_0x13de('0x48'),_0x18d740);});}module[_0x13de('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index dd452cb..1b7b8b7 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 _0xb19a=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x56801e,_0x1bf4bc){var _0x54e02d=function(_0x4a5a34){while(--_0x4a5a34){_0x56801e['push'](_0x56801e['shift']());}};_0x54e02d(++_0x1bf4bc);}(_0xb19a,0xd0));var _0xab19=function(_0x3612ca,_0x23946f){_0x3612ca=_0x3612ca-0x0;var _0x494fc5=_0xb19a[_0x3612ca];return _0x494fc5;};'use strict';var _=require(_0xab19('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xab19('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab19('0x2'))['db'];var utils=require(_0xab19('0x3'));var logger=require(_0xab19('0x4'))(_0xab19('0x5'));var config=require(_0xab19('0x6'));var jayson=require(_0xab19('0x7'));var client=jayson[_0xab19('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9d5c1d,_0x131291,_0x59d282){return new BPromise(function(_0x300038,_0x479d0b){return client[_0xab19('0x9')](_0x9d5c1d,_0x59d282)[_0xab19('0xa')](function(_0x2c6a67){logger[_0xab19('0xb')](_0xab19('0xc'),_0x131291,_0xab19('0xd'));logger[_0xab19('0xe')](_0xab19('0xf'),_0x131291,_0xab19('0xd'),JSON[_0xab19('0x10')](_0x2c6a67));if(_0x2c6a67[_0xab19('0x11')]){if(_0x2c6a67[_0xab19('0x11')]['code']===0x1f4){logger['error'](_0xab19('0xc'),_0x131291,_0x2c6a67['error'][_0xab19('0x12')]);return _0x479d0b(_0x2c6a67[_0xab19('0x11')][_0xab19('0x12')]);}logger[_0xab19('0x11')](_0xab19('0xc'),_0x131291,_0x2c6a67[_0xab19('0x11')][_0xab19('0x12')]);return _0x300038(_0x2c6a67['error'][_0xab19('0x12')]);}else{logger[_0xab19('0xb')]('CloudProvider,\x20%s,\x20%s',_0x131291,_0xab19('0xd'));_0x300038(_0x2c6a67[_0xab19('0x13')]['message']);}})['catch'](function(_0x2284b8){logger[_0xab19('0x11')](_0xab19('0xc'),_0x131291,_0x2284b8);_0x479d0b(_0x2284b8);});});}
\ No newline at end of file
+var _0xf3a8=['message','catch','util','moment','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xf3a8,0xf2));var _0x8f3a=function(_0x7ce5c0,_0x448850){_0x7ce5c0=_0x7ce5c0-0x0;var _0x88b1f7=_0xf3a8[_0x7ce5c0];return _0x88b1f7;};'use strict';var _=require('lodash');var util=require(_0x8f3a('0x0'));var moment=require(_0x8f3a('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f3a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8f3a('0x3'));var logger=require('../../config/logger')(_0x8f3a('0x4'));var config=require('../../config/environment');var jayson=require(_0x8f3a('0x5'));var client=jayson[_0x8f3a('0x6')][_0x8f3a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32bb3a,_0xc50ed8,_0x2e290d){return new BPromise(function(_0x3dc1ea,_0xcfad11){return client[_0x8f3a('0x8')](_0x32bb3a,_0x2e290d)['then'](function(_0x2164ba){logger['info'](_0x8f3a('0x9'),_0xc50ed8,_0x8f3a('0xa'));logger[_0x8f3a('0xb')](_0x8f3a('0xc'),_0xc50ed8,_0x8f3a('0xa'),JSON['stringify'](_0x2164ba));if(_0x2164ba[_0x8f3a('0xd')]){if(_0x2164ba[_0x8f3a('0xd')]['code']===0x1f4){logger[_0x8f3a('0xd')]('CloudProvider,\x20%s,\x20%s',_0xc50ed8,_0x2164ba['error'][_0x8f3a('0xe')]);return _0xcfad11(_0x2164ba[_0x8f3a('0xd')]['message']);}logger[_0x8f3a('0xd')](_0x8f3a('0x9'),_0xc50ed8,_0x2164ba[_0x8f3a('0xd')]['message']);return _0x3dc1ea(_0x2164ba[_0x8f3a('0xd')][_0x8f3a('0xe')]);}else{logger['info'](_0x8f3a('0x9'),_0xc50ed8,_0x8f3a('0xa'));_0x3dc1ea(_0x2164ba['result'][_0x8f3a('0xe')]);}})[_0x8f3a('0xf')](function(_0x9bf803){logger[_0x8f3a('0xd')](_0x8f3a('0x9'),_0xc50ed8,_0x9bf803);_0xcfad11(_0x9bf803);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index c0e2dee..a70dd4e 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3c762a,_0x5bef8e){_0x3c762a=_0x3c762a-0x0;var _0x4a3c2a=_0x5f2f[_0x3c762a];return _0x4a3c2a;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
+var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x2d8f6c,_0x44db4c){var _0x3a00f6=function(_0x1b16ea){while(--_0x1b16ea){_0x2d8f6c['push'](_0x2d8f6c['shift']());}};_0x3a00f6(++_0x44db4c);}(_0x5f2f,0x73));var _0xf5f2=function(_0xa49733,_0x5420b3){_0xa49733=_0xa49733-0x0;var _0x49dca8=_0x5f2f[_0xa49733];return _0x49dca8;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 22fe1cf..110dabb 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 _0x192f=['sequelize','STRING'];(function(_0x3227c2,_0x22390f){var _0x1dc977=function(_0x34c591){while(--_0x34c591){_0x3227c2['push'](_0x3227c2['shift']());}};_0x1dc977(++_0x22390f);}(_0x192f,0xd6));var _0xf192=function(_0x1256d6,_0x5dc965){_0x1256d6=_0x1256d6-0x0;var _0x70d3fb=_0x192f[_0x1256d6];return _0x70d3fb;};'use strict';var Sequelize=require(_0xf192('0x0'));module['exports']={'name':{'type':Sequelize[_0xf192('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf192('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xf192('0x1')]},'fax':{'type':Sequelize[_0xf192('0x1')]},'type':{'type':Sequelize[_0xf192('0x1')]},'street':{'type':Sequelize[_0xf192('0x1')]},'postalCode':{'type':Sequelize[_0xf192('0x1')]},'city':{'type':Sequelize[_0xf192('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf192('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf192('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xf192('0x1')]},'sCity':{'type':Sequelize[_0xf192('0x1')]},'sCountry':{'type':Sequelize[_0xf192('0x1')]},'description':{'type':Sequelize[_0xf192('0x1')]}};
\ No newline at end of file
+var _0x9a20=['exports','STRING','name','sequelize'];(function(_0x51261e,_0x27c8e3){var _0x3b5115=function(_0x3fe428){while(--_0x3fe428){_0x51261e['push'](_0x51261e['shift']());}};_0x3b5115(++_0x27c8e3);}(_0x9a20,0x153));var _0x09a2=function(_0x3acd3b,_0x21e7f5){_0x3acd3b=_0x3acd3b-0x0;var _0x5bb412=_0x9a20[_0x3acd3b];return _0x5bb412;};'use strict';var Sequelize=require(_0x09a2('0x0'));module[_0x09a2('0x1')]={'name':{'type':Sequelize[_0x09a2('0x2')],'unique':_0x09a2('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x09a2('0x2')]},'companyId':{'type':Sequelize[_0x09a2('0x2')]},'website':{'type':Sequelize[_0x09a2('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x09a2('0x2')]},'type':{'type':Sequelize[_0x09a2('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x09a2('0x2')]},'city':{'type':Sequelize[_0x09a2('0x2')]},'country':{'type':Sequelize[_0x09a2('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x09a2('0x2')]},'sStreet':{'type':Sequelize[_0x09a2('0x2')]},'sPostalCode':{'type':Sequelize[_0x09a2('0x2')]},'sCity':{'type':Sequelize[_0x09a2('0x2')]},'sCountry':{'type':Sequelize[_0x09a2('0x2')]},'description':{'type':Sequelize[_0x09a2('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 3b669ba..35c89bd 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 _0x3c2a=['save','then','destroy','get','Companies','stack','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','name','error','update','CmContact','ids','omit','getContacts','map','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','apply','reject'];(function(_0x7413e,_0x57af5b){var _0x331148=function(_0x2ce64f){while(--_0x2ce64f){_0x7413e['push'](_0x7413e['shift']());}};_0x331148(++_0x57af5b);}(_0x3c2a,0xd2));var _0xa3c2=function(_0x449afc,_0xc77bc9){_0x449afc=_0x449afc-0x0;var _0x166e11=_0x3c2a[_0x449afc];return _0x166e11;};'use strict';var emlformat=require(_0xa3c2('0x0'));var rimraf=require(_0xa3c2('0x1'));var zipdir=require(_0xa3c2('0x2'));var jsonpatch=require(_0xa3c2('0x3'));var rp=require(_0xa3c2('0x4'));var moment=require(_0xa3c2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa3c2('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa3c2('0x7'));var csv=require(_0xa3c2('0x8'));var ejs=require(_0xa3c2('0x9'));var fs=require('fs');var fs_extra=require(_0xa3c2('0xa'));var _=require('lodash');var squel=require(_0xa3c2('0xb'));var crypto=require(_0xa3c2('0xc'));var jsforce=require(_0xa3c2('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa3c2('0xe'));var Papa=require(_0xa3c2('0xf'));var Redis=require(_0xa3c2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa3c2('0x11'));var as=require(_0xa3c2('0x12'));var hardwareService=require(_0xa3c2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa3c2('0x14'));var config=require(_0xa3c2('0x15'));var licenseUtil=require(_0xa3c2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fe760,_0x308f19){_0x308f19=_0x308f19||0xcc;return function(_0x3af865){if(_0x3af865){return _0x4fe760[_0xa3c2('0x17')](_0x308f19);}return _0x4fe760[_0xa3c2('0x18')](_0x308f19)[_0xa3c2('0x19')]();};}function respondWithResult(_0x76d68f,_0x1d19df){_0x1d19df=_0x1d19df||0xc8;return function(_0x1dee63){if(_0x1dee63){return _0x76d68f[_0xa3c2('0x18')](_0x1d19df)[_0xa3c2('0x1a')](_0x1dee63);}};}function respondWithFilteredResult(_0x2adbc5,_0x1c6a8a){return function(_0x200873){if(_0x200873){var _0x204cfa=typeof _0x1c6a8a['offset']===_0xa3c2('0x1b')&&typeof _0x1c6a8a['limit']===_0xa3c2('0x1b');var _0x3b3c8c=_0x200873[_0xa3c2('0x1c')];var _0x34632f=_0x204cfa?0x0:_0x1c6a8a[_0xa3c2('0x1d')];var _0x319a71=_0x204cfa?_0x200873[_0xa3c2('0x1c')]:_0x1c6a8a[_0xa3c2('0x1d')]+_0x1c6a8a[_0xa3c2('0x1e')];var _0x248b00;if(_0x319a71>=_0x3b3c8c){_0x319a71=_0x3b3c8c;_0x248b00=0xc8;}else{_0x248b00=0xce;}_0x2adbc5[_0xa3c2('0x18')](_0x248b00);return _0x2adbc5['set']('Content-Range',_0x34632f+'-'+_0x319a71+'/'+_0x3b3c8c)[_0xa3c2('0x1a')](_0x200873);}return null;};}function patchUpdates(_0x39fd47){return function(_0x2f30d1){try{jsonpatch[_0xa3c2('0x1f')](_0x2f30d1,_0x39fd47,!![]);}catch(_0xad598b){return BPromise[_0xa3c2('0x20')](_0xad598b);}return _0x2f30d1[_0xa3c2('0x21')]();};}function saveUpdates(_0x2d2fcb,_0x51d686){return function(_0x994b3b){if(_0x994b3b){return _0x994b3b['update'](_0x2d2fcb)[_0xa3c2('0x22')](function(_0x57458e){return _0x57458e;});}return null;};}function removeEntity(_0x20b0fa,_0x2809da){return function(_0xcc1f3a){if(_0xcc1f3a){return _0xcc1f3a[_0xa3c2('0x23')]()[_0xa3c2('0x22')](function(){var _0x31bf95=_0xcc1f3a[_0xa3c2('0x24')]({'plain':!![]});var _0x4daa46=_0xa3c2('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x4daa46,'resourceId':_0x31bf95['id']}})[_0xa3c2('0x22')](function(){return _0xcc1f3a;});})[_0xa3c2('0x22')](function(){_0x20b0fa[_0xa3c2('0x18')](0xcc)[_0xa3c2('0x19')]();});}};}function handleEntityNotFound(_0x4281c5,_0x1cce99){return function(_0x53c0dc){if(!_0x53c0dc){_0x4281c5['sendStatus'](0x194);}return _0x53c0dc;};}function handleError(_0x34eed4,_0x10c8c3){_0x10c8c3=_0x10c8c3||0x1f4;return function(_0x5ef712){logger['error'](_0x5ef712[_0xa3c2('0x26')]);if(_0x5ef712['name']){delete _0x5ef712['name'];}_0x34eed4[_0xa3c2('0x18')](_0x10c8c3)[_0xa3c2('0x27')](_0x5ef712);};}exports[_0xa3c2('0x28')]=function(_0x685103,_0x28f3b7){var _0x2d0fa8={},_0x281903={},_0x367a53={'count':0x0,'rows':[]};return db[_0xa3c2('0x29')][_0xa3c2('0x2a')]()['then'](function(_0x2b4274){_0x281903[_0xa3c2('0x2b')]=_[_0xa3c2('0x2c')](_0x2b4274);_0x281903[_0xa3c2('0x2d')]=_[_0xa3c2('0x2c')](_0x685103[_0xa3c2('0x2d')]);_0x281903['filters']=_[_0xa3c2('0x2e')](_0x281903['model'],_0x281903[_0xa3c2('0x2d')]);_0x2d0fa8[_0xa3c2('0x2f')]=_['intersection'](_0x281903[_0xa3c2('0x2b')],qs['fields'](_0x685103[_0xa3c2('0x2d')][_0xa3c2('0x30')]));_0x2d0fa8[_0xa3c2('0x2f')]=_0x2d0fa8['attributes'][_0xa3c2('0x31')]?_0x2d0fa8[_0xa3c2('0x2f')]:_0x281903[_0xa3c2('0x2b')];if(!_0x685103[_0xa3c2('0x2d')]['hasOwnProperty']('nolimit')){_0x2d0fa8[_0xa3c2('0x1e')]=qs[_0xa3c2('0x1e')](_0x685103[_0xa3c2('0x2d')][_0xa3c2('0x1e')]);_0x2d0fa8[_0xa3c2('0x1d')]=qs[_0xa3c2('0x1d')](_0x685103[_0xa3c2('0x2d')][_0xa3c2('0x1d')]);}_0x2d0fa8['order']=qs['sort'](_0x685103['query'][_0xa3c2('0x32')]);_0x2d0fa8[_0xa3c2('0x33')]=qs[_0xa3c2('0x34')](_[_0xa3c2('0x35')](_0x685103[_0xa3c2('0x2d')],_0x281903[_0xa3c2('0x34')]),_0x2b4274);if(_0x685103['query'][_0xa3c2('0x36')]){_0x2d0fa8['where']=_[_0xa3c2('0x37')](_0x2d0fa8[_0xa3c2('0x33')],{'$or':_['map'](_0x2d0fa8[_0xa3c2('0x2f')],function(_0x5eb571){var _0x5a7a59={};_0x5a7a59[_0x5eb571]={'$like':'%'+_0x685103[_0xa3c2('0x2d')][_0xa3c2('0x36')]+'%'};return _0x5a7a59;})});}_0x2d0fa8=_[_0xa3c2('0x37')]({},_0x2d0fa8,_0x685103[_0xa3c2('0x38')]);var _0xe84387={'where':_0x2d0fa8[_0xa3c2('0x33')]};return db[_0xa3c2('0x29')][_0xa3c2('0x1c')](_0xe84387)[_0xa3c2('0x22')](function(_0x3e4ef9){_0x367a53[_0xa3c2('0x1c')]=_0x3e4ef9;if(_0x685103[_0xa3c2('0x2d')][_0xa3c2('0x39')]){_0x2d0fa8[_0xa3c2('0x3a')]=[{'all':!![]}];}return db['CmCompany'][_0xa3c2('0x3b')](_0x2d0fa8);})[_0xa3c2('0x22')](function(_0xc02640){_0x367a53['rows']=_0xc02640;return _0x367a53;})[_0xa3c2('0x22')](respondWithFilteredResult(_0x28f3b7,_0x2d0fa8))['catch'](handleError(_0x28f3b7,null));})['catch'](handleError(_0x28f3b7,null));};exports['show']=function(_0x4312df,_0x3a71ba){var _0x102746={'raw':![],'where':{'id':_0x4312df[_0xa3c2('0x3c')]['id']}},_0x5343a7={};_0x5343a7[_0xa3c2('0x2b')]=_[_0xa3c2('0x2c')](db[_0xa3c2('0x29')][_0xa3c2('0x3d')]);_0x5343a7[_0xa3c2('0x2d')]=_['keys'](_0x4312df[_0xa3c2('0x2d')]);_0x5343a7[_0xa3c2('0x34')]=_[_0xa3c2('0x2e')](_0x5343a7[_0xa3c2('0x2b')],_0x5343a7[_0xa3c2('0x2d')]);_0x102746[_0xa3c2('0x2f')]=_['intersection'](_0x5343a7['model'],qs[_0xa3c2('0x30')](_0x4312df[_0xa3c2('0x2d')][_0xa3c2('0x30')]));_0x102746[_0xa3c2('0x2f')]=_0x102746[_0xa3c2('0x2f')][_0xa3c2('0x31')]?_0x102746['attributes']:_0x5343a7[_0xa3c2('0x2b')];if(_0x4312df[_0xa3c2('0x2d')][_0xa3c2('0x39')]){_0x102746['include']=[{'all':!![]}];}_0x102746=_[_0xa3c2('0x37')]({},_0x102746,_0x4312df[_0xa3c2('0x38')]);return db[_0xa3c2('0x29')][_0xa3c2('0x3e')](_0x102746)[_0xa3c2('0x22')](handleEntityNotFound(_0x3a71ba,null))['then'](respondWithResult(_0x3a71ba,null))[_0xa3c2('0x3f')](handleError(_0x3a71ba,null));};exports[_0xa3c2('0x40')]=function(_0x2ae14c,_0x5b5c42){return db[_0xa3c2('0x29')][_0xa3c2('0x40')](_0x2ae14c[_0xa3c2('0x41')],{})[_0xa3c2('0x22')](function(_0x54c0b0){var _0x132b20=_0x2ae14c[_0xa3c2('0x42')][_0xa3c2('0x24')]({'plain':!![]});if(!_0x132b20)throw new Error(_0xa3c2('0x43'));if(_0x132b20['role']===_0xa3c2('0x42')){var _0x7a5996=_0x54c0b0[_0xa3c2('0x24')]({'plain':!![]});var _0x496589='Companies';return db[_0xa3c2('0x44')][_0xa3c2('0x3e')]({'where':{'name':_0x496589,'userProfileId':_0x132b20[_0xa3c2('0x45')]},'raw':!![]})['then'](function(_0x199817){if(_0x199817&&_0x199817[_0xa3c2('0x46')]===0x0){return db[_0xa3c2('0x47')][_0xa3c2('0x40')]({'name':_0x7a5996[_0xa3c2('0x48')],'resourceId':_0x7a5996['id'],'type':_0x199817[_0xa3c2('0x48')],'sectionId':_0x199817['id']},{})['then'](function(){return _0x54c0b0;});}else{return _0x54c0b0;}})['catch'](function(_0x12f114){logger[_0xa3c2('0x49')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12f114);throw _0x12f114;});}return _0x54c0b0;})['then'](respondWithResult(_0x5b5c42,0xc9))[_0xa3c2('0x3f')](handleError(_0x5b5c42,null));};exports[_0xa3c2('0x4a')]=function(_0x5b64cc,_0x3bdb8c){if(_0x5b64cc[_0xa3c2('0x41')]['id']){delete _0x5b64cc[_0xa3c2('0x41')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x5b64cc[_0xa3c2('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3bdb8c,null))['then'](saveUpdates(_0x5b64cc[_0xa3c2('0x41')],null))['then'](respondWithResult(_0x3bdb8c,null))[_0xa3c2('0x3f')](handleError(_0x3bdb8c,null));};exports['destroy']=function(_0x340a2c,_0x459de2){return db[_0xa3c2('0x29')][_0xa3c2('0x3e')]({'where':{'id':_0x340a2c[_0xa3c2('0x3c')]['id']}})[_0xa3c2('0x22')](handleEntityNotFound(_0x459de2,null))[_0xa3c2('0x22')](removeEntity(_0x459de2,null))['catch'](handleError(_0x459de2,null));};exports[_0xa3c2('0x2a')]=function(_0x285fe7,_0x4bc940){return db[_0xa3c2('0x29')][_0xa3c2('0x2a')]()[_0xa3c2('0x22')](respondWithResult(_0x4bc940,null))[_0xa3c2('0x3f')](handleError(_0x4bc940,null));};exports['addContacts']=function(_0x10c0c1,_0x160a97,_0x17fbfb){return db[_0xa3c2('0x4b')][_0xa3c2('0x3e')]({'where':{'id':_0x10c0c1[_0xa3c2('0x3c')]['id']}})[_0xa3c2('0x22')](handleEntityNotFound(_0x160a97,null))['then'](function(_0x4a2094){if(_0x4a2094){return _0x4a2094['addContacts'](_0x10c0c1[_0xa3c2('0x41')][_0xa3c2('0x4c')],_[_0xa3c2('0x4d')](_0x10c0c1[_0xa3c2('0x41')],[_0xa3c2('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x160a97,null))[_0xa3c2('0x3f')](handleError(_0x160a97,null));};exports[_0xa3c2('0x4e')]=function(_0x27cecd,_0x22bba1,_0x7cba83){var _0x21e7a5={};var _0x4ed0dd={};var _0x598894;var _0x48105c;return db[_0xa3c2('0x29')]['findOne']({'where':{'id':_0x27cecd[_0xa3c2('0x3c')]['id']}})[_0xa3c2('0x22')](handleEntityNotFound(_0x22bba1,null))[_0xa3c2('0x22')](function(_0x155971){if(_0x155971){_0x598894=_0x155971;_0x4ed0dd[_0xa3c2('0x2b')]=_[_0xa3c2('0x2c')](db['CmContact'][_0xa3c2('0x3d')]);_0x4ed0dd['query']=_[_0xa3c2('0x2c')](_0x27cecd[_0xa3c2('0x2d')]);_0x4ed0dd[_0xa3c2('0x34')]=_[_0xa3c2('0x2e')](_0x4ed0dd[_0xa3c2('0x2b')],_0x4ed0dd['query']);_0x21e7a5[_0xa3c2('0x2f')]=_['intersection'](_0x4ed0dd[_0xa3c2('0x2b')],qs[_0xa3c2('0x30')](_0x27cecd['query'][_0xa3c2('0x30')]));_0x21e7a5[_0xa3c2('0x2f')]=_0x21e7a5['attributes'][_0xa3c2('0x31')]?_0x21e7a5[_0xa3c2('0x2f')]:_0x4ed0dd[_0xa3c2('0x2b')];_0x21e7a5['order']=qs['sort'](_0x27cecd[_0xa3c2('0x2d')][_0xa3c2('0x32')]);_0x21e7a5[_0xa3c2('0x33')]=qs['filters'](_['pick'](_0x27cecd['query'],_0x4ed0dd[_0xa3c2('0x34')]));if(_0x27cecd['query'][_0xa3c2('0x36')]){_0x21e7a5[_0xa3c2('0x33')]=_[_0xa3c2('0x37')](_0x21e7a5['where'],{'$or':_[_0xa3c2('0x4f')](_0x21e7a5[_0xa3c2('0x2f')],function(_0x258bc6){var _0x93d41f={};_0x93d41f[_0x258bc6]={'$like':'%'+_0x27cecd[_0xa3c2('0x2d')][_0xa3c2('0x36')]+'%'};return _0x93d41f;})});}_0x21e7a5=_[_0xa3c2('0x37')]({},_0x21e7a5,_0x27cecd[_0xa3c2('0x38')]);return _0x598894['getContacts'](_0x21e7a5);}})[_0xa3c2('0x22')](function(_0xe6c1fe){if(_0xe6c1fe){_0x48105c=_0xe6c1fe['length'];if(!_0x27cecd[_0xa3c2('0x2d')]['hasOwnProperty'](_0xa3c2('0x50'))){_0x21e7a5[_0xa3c2('0x1e')]=qs[_0xa3c2('0x1e')](_0x27cecd[_0xa3c2('0x2d')][_0xa3c2('0x1e')]);_0x21e7a5[_0xa3c2('0x1d')]=qs[_0xa3c2('0x1d')](_0x27cecd['query'][_0xa3c2('0x1d')]);}return _0x598894[_0xa3c2('0x4e')](_0x21e7a5);}})['then'](function(_0x6cd16e){if(_0x6cd16e){return _0x6cd16e?{'count':_0x48105c,'rows':_0x6cd16e}:null;}})[_0xa3c2('0x22')](respondWithResult(_0x22bba1,null))['catch'](handleError(_0x22bba1,null));};
\ No newline at end of file
+var _0x1e3c=['ids','getContacts','findOne','map','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','get','Companies','UserProfileResource','destroy','stack','name','status','send','index','CmCompany','describe','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','update','CmContact','addContacts','omit'];(function(_0x106783,_0xe4b553){var _0x11e878=function(_0x3a7ccd){while(--_0x3a7ccd){_0x106783['push'](_0x106783['shift']());}};_0x11e878(++_0xe4b553);}(_0x1e3c,0xb7));var _0xc1e3=function(_0x46632e,_0x5e3304){_0x46632e=_0x46632e-0x0;var _0x12b958=_0x1e3c[_0x46632e];return _0x12b958;};'use strict';var emlformat=require(_0xc1e3('0x0'));var rimraf=require(_0xc1e3('0x1'));var zipdir=require(_0xc1e3('0x2'));var jsonpatch=require(_0xc1e3('0x3'));var rp=require(_0xc1e3('0x4'));var moment=require(_0xc1e3('0x5'));var BPromise=require(_0xc1e3('0x6'));var Mustache=require(_0xc1e3('0x7'));var util=require(_0xc1e3('0x8'));var path=require(_0xc1e3('0x9'));var sox=require(_0xc1e3('0xa'));var csv=require(_0xc1e3('0xb'));var ejs=require(_0xc1e3('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1e3('0xd'));var squel=require(_0xc1e3('0xe'));var crypto=require(_0xc1e3('0xf'));var jsforce=require(_0xc1e3('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xc1e3('0xb'));var querystring=require('querystring');var Papa=require(_0xc1e3('0x11'));var Redis=require('ioredis');var authService=require(_0xc1e3('0x12'));var qs=require(_0xc1e3('0x13'));var as=require(_0xc1e3('0x14'));var hardwareService=require(_0xc1e3('0x15'));var logger=require('../../config/logger')(_0xc1e3('0x16'));var utils=require(_0xc1e3('0x17'));var config=require(_0xc1e3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1e3('0x19'))['db'];function respondWithStatusCode(_0x36b865,_0x5eceed){_0x5eceed=_0x5eceed||0xcc;return function(_0x2fa467){if(_0x2fa467){return _0x36b865[_0xc1e3('0x1a')](_0x5eceed);}return _0x36b865['status'](_0x5eceed)[_0xc1e3('0x1b')]();};}function respondWithResult(_0x2b8036,_0x2da373){_0x2da373=_0x2da373||0xc8;return function(_0xe00e67){if(_0xe00e67){return _0x2b8036['status'](_0x2da373)[_0xc1e3('0x1c')](_0xe00e67);}};}function respondWithFilteredResult(_0x2948ed,_0x1bb81d){return function(_0x12206c){if(_0x12206c){var _0x4a6886=typeof _0x1bb81d['offset']===_0xc1e3('0x1d')&&typeof _0x1bb81d[_0xc1e3('0x1e')]===_0xc1e3('0x1d');var _0x16f45d=_0x12206c[_0xc1e3('0x1f')];var _0x33f468=_0x4a6886?0x0:_0x1bb81d[_0xc1e3('0x20')];var _0x509875=_0x4a6886?_0x12206c[_0xc1e3('0x1f')]:_0x1bb81d['offset']+_0x1bb81d[_0xc1e3('0x1e')];var _0x3d5873;if(_0x509875>=_0x16f45d){_0x509875=_0x16f45d;_0x3d5873=0xc8;}else{_0x3d5873=0xce;}_0x2948ed['status'](_0x3d5873);return _0x2948ed[_0xc1e3('0x21')](_0xc1e3('0x22'),_0x33f468+'-'+_0x509875+'/'+_0x16f45d)[_0xc1e3('0x1c')](_0x12206c);}return null;};}function patchUpdates(_0x57b6c4){return function(_0x2e0ba2){try{jsonpatch['apply'](_0x2e0ba2,_0x57b6c4,!![]);}catch(_0x3cc69f){return BPromise[_0xc1e3('0x23')](_0x3cc69f);}return _0x2e0ba2[_0xc1e3('0x24')]();};}function saveUpdates(_0x565fc3,_0x38cc51){return function(_0x149d55){if(_0x149d55){return _0x149d55['update'](_0x565fc3)['then'](function(_0x8abdc3){return _0x8abdc3;});}return null;};}function removeEntity(_0x575d54,_0x4e2522){return function(_0x466fa8){if(_0x466fa8){return _0x466fa8['destroy']()[_0xc1e3('0x25')](function(){var _0x4ec208=_0x466fa8[_0xc1e3('0x26')]({'plain':!![]});var _0x67a8bb=_0xc1e3('0x27');return db[_0xc1e3('0x28')][_0xc1e3('0x29')]({'where':{'type':_0x67a8bb,'resourceId':_0x4ec208['id']}})[_0xc1e3('0x25')](function(){return _0x466fa8;});})[_0xc1e3('0x25')](function(){_0x575d54['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25bf5e,_0x3e895a){return function(_0x19e8d4){if(!_0x19e8d4){_0x25bf5e[_0xc1e3('0x1a')](0x194);}return _0x19e8d4;};}function handleError(_0x2b4fbe,_0x18a946){_0x18a946=_0x18a946||0x1f4;return function(_0x38d93c){logger['error'](_0x38d93c[_0xc1e3('0x2a')]);if(_0x38d93c[_0xc1e3('0x2b')]){delete _0x38d93c[_0xc1e3('0x2b')];}_0x2b4fbe[_0xc1e3('0x2c')](_0x18a946)[_0xc1e3('0x2d')](_0x38d93c);};}exports[_0xc1e3('0x2e')]=function(_0x23fd5c,_0x1114b1){var _0x1e1683={},_0x165fb2={},_0x431172={'count':0x0,'rows':[]};return db[_0xc1e3('0x2f')][_0xc1e3('0x30')]()[_0xc1e3('0x25')](function(_0x18f2be){_0x165fb2[_0xc1e3('0x31')]=_[_0xc1e3('0x32')](_0x18f2be);_0x165fb2[_0xc1e3('0x33')]=_[_0xc1e3('0x32')](_0x23fd5c[_0xc1e3('0x33')]);_0x165fb2[_0xc1e3('0x34')]=_['intersection'](_0x165fb2[_0xc1e3('0x31')],_0x165fb2[_0xc1e3('0x33')]);_0x1e1683[_0xc1e3('0x35')]=_[_0xc1e3('0x36')](_0x165fb2[_0xc1e3('0x31')],qs[_0xc1e3('0x37')](_0x23fd5c[_0xc1e3('0x33')]['fields']));_0x1e1683[_0xc1e3('0x35')]=_0x1e1683['attributes'][_0xc1e3('0x38')]?_0x1e1683[_0xc1e3('0x35')]:_0x165fb2['model'];if(!_0x23fd5c[_0xc1e3('0x33')]['hasOwnProperty'](_0xc1e3('0x39'))){_0x1e1683[_0xc1e3('0x1e')]=qs[_0xc1e3('0x1e')](_0x23fd5c['query'][_0xc1e3('0x1e')]);_0x1e1683[_0xc1e3('0x20')]=qs[_0xc1e3('0x20')](_0x23fd5c['query'][_0xc1e3('0x20')]);}_0x1e1683[_0xc1e3('0x3a')]=qs[_0xc1e3('0x3b')](_0x23fd5c[_0xc1e3('0x33')][_0xc1e3('0x3b')]);_0x1e1683[_0xc1e3('0x3c')]=qs[_0xc1e3('0x34')](_['pick'](_0x23fd5c['query'],_0x165fb2[_0xc1e3('0x34')]),_0x18f2be);if(_0x23fd5c[_0xc1e3('0x33')][_0xc1e3('0x3d')]){_0x1e1683[_0xc1e3('0x3c')]=_[_0xc1e3('0x3e')](_0x1e1683[_0xc1e3('0x3c')],{'$or':_['map'](_0x1e1683[_0xc1e3('0x35')],function(_0x330b78){var _0x7f0e23={};_0x7f0e23[_0x330b78]={'$like':'%'+_0x23fd5c[_0xc1e3('0x33')][_0xc1e3('0x3d')]+'%'};return _0x7f0e23;})});}_0x1e1683=_['merge']({},_0x1e1683,_0x23fd5c[_0xc1e3('0x3f')]);var _0x1c707b={'where':_0x1e1683[_0xc1e3('0x3c')]};return db[_0xc1e3('0x2f')]['count'](_0x1c707b)['then'](function(_0xb1ad8e){_0x431172[_0xc1e3('0x1f')]=_0xb1ad8e;if(_0x23fd5c[_0xc1e3('0x33')][_0xc1e3('0x40')]){_0x1e1683[_0xc1e3('0x41')]=[{'all':!![]}];}return db[_0xc1e3('0x2f')]['findAll'](_0x1e1683);})[_0xc1e3('0x25')](function(_0x20d537){_0x431172[_0xc1e3('0x42')]=_0x20d537;return _0x431172;})['then'](respondWithFilteredResult(_0x1114b1,_0x1e1683))[_0xc1e3('0x43')](handleError(_0x1114b1,null));})[_0xc1e3('0x43')](handleError(_0x1114b1,null));};exports[_0xc1e3('0x44')]=function(_0x1eda1d,_0x7cda32){var _0x64cee={'raw':![],'where':{'id':_0x1eda1d[_0xc1e3('0x45')]['id']}},_0x475444={};_0x475444['model']=_[_0xc1e3('0x32')](db[_0xc1e3('0x2f')][_0xc1e3('0x46')]);_0x475444[_0xc1e3('0x33')]=_[_0xc1e3('0x32')](_0x1eda1d[_0xc1e3('0x33')]);_0x475444[_0xc1e3('0x34')]=_[_0xc1e3('0x36')](_0x475444[_0xc1e3('0x31')],_0x475444[_0xc1e3('0x33')]);_0x64cee[_0xc1e3('0x35')]=_['intersection'](_0x475444['model'],qs[_0xc1e3('0x37')](_0x1eda1d[_0xc1e3('0x33')][_0xc1e3('0x37')]));_0x64cee[_0xc1e3('0x35')]=_0x64cee[_0xc1e3('0x35')][_0xc1e3('0x38')]?_0x64cee[_0xc1e3('0x35')]:_0x475444[_0xc1e3('0x31')];if(_0x1eda1d[_0xc1e3('0x33')][_0xc1e3('0x40')]){_0x64cee[_0xc1e3('0x41')]=[{'all':!![]}];}_0x64cee=_[_0xc1e3('0x3e')]({},_0x64cee,_0x1eda1d[_0xc1e3('0x3f')]);return db['CmCompany'][_0xc1e3('0x47')](_0x64cee)[_0xc1e3('0x25')](handleEntityNotFound(_0x7cda32,null))['then'](respondWithResult(_0x7cda32,null))[_0xc1e3('0x43')](handleError(_0x7cda32,null));};exports[_0xc1e3('0x48')]=function(_0xe1d03b,_0x397bad){return db[_0xc1e3('0x2f')][_0xc1e3('0x48')](_0xe1d03b[_0xc1e3('0x49')],{})['then'](function(_0x3f0aa9){var _0x378970=_0xe1d03b[_0xc1e3('0x4a')][_0xc1e3('0x26')]({'plain':!![]});if(!_0x378970)throw new Error(_0xc1e3('0x4b'));if(_0x378970[_0xc1e3('0x4c')]===_0xc1e3('0x4a')){var _0x2e2cc8=_0x3f0aa9['get']({'plain':!![]});var _0xfcff52='Companies';return db[_0xc1e3('0x4d')][_0xc1e3('0x47')]({'where':{'name':_0xfcff52,'userProfileId':_0x378970[_0xc1e3('0x4e')]},'raw':!![]})[_0xc1e3('0x25')](function(_0x2fa52a){if(_0x2fa52a&&_0x2fa52a['autoAssociation']===0x0){return db['UserProfileResource'][_0xc1e3('0x48')]({'name':_0x2e2cc8[_0xc1e3('0x2b')],'resourceId':_0x2e2cc8['id'],'type':_0x2fa52a['name'],'sectionId':_0x2fa52a['id']},{})[_0xc1e3('0x25')](function(){return _0x3f0aa9;});}else{return _0x3f0aa9;}})[_0xc1e3('0x43')](function(_0x1858f){logger[_0xc1e3('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1858f);throw _0x1858f;});}return _0x3f0aa9;})[_0xc1e3('0x25')](respondWithResult(_0x397bad,0xc9))[_0xc1e3('0x43')](handleError(_0x397bad,null));};exports[_0xc1e3('0x50')]=function(_0x2d5ec7,_0xa7b119){if(_0x2d5ec7[_0xc1e3('0x49')]['id']){delete _0x2d5ec7[_0xc1e3('0x49')]['id'];}return db[_0xc1e3('0x2f')][_0xc1e3('0x47')]({'where':{'id':_0x2d5ec7[_0xc1e3('0x45')]['id']}})['then'](handleEntityNotFound(_0xa7b119,null))[_0xc1e3('0x25')](saveUpdates(_0x2d5ec7[_0xc1e3('0x49')],null))[_0xc1e3('0x25')](respondWithResult(_0xa7b119,null))[_0xc1e3('0x43')](handleError(_0xa7b119,null));};exports[_0xc1e3('0x29')]=function(_0x28810d,_0x121acd){return db[_0xc1e3('0x2f')][_0xc1e3('0x47')]({'where':{'id':_0x28810d[_0xc1e3('0x45')]['id']}})[_0xc1e3('0x25')](handleEntityNotFound(_0x121acd,null))['then'](removeEntity(_0x121acd,null))['catch'](handleError(_0x121acd,null));};exports[_0xc1e3('0x30')]=function(_0x1336ec,_0x4a72a7){return db[_0xc1e3('0x2f')][_0xc1e3('0x30')]()['then'](respondWithResult(_0x4a72a7,null))[_0xc1e3('0x43')](handleError(_0x4a72a7,null));};exports['addContacts']=function(_0x3f8144,_0x4417bd,_0x37dffb){return db[_0xc1e3('0x51')][_0xc1e3('0x47')]({'where':{'id':_0x3f8144[_0xc1e3('0x45')]['id']}})['then'](handleEntityNotFound(_0x4417bd,null))[_0xc1e3('0x25')](function(_0x560ea1){if(_0x560ea1){return _0x560ea1[_0xc1e3('0x52')](_0x3f8144[_0xc1e3('0x49')]['ids'],_[_0xc1e3('0x53')](_0x3f8144['body'],[_0xc1e3('0x54'),'id'])||{});}})[_0xc1e3('0x25')](respondWithResult(_0x4417bd,null))[_0xc1e3('0x43')](handleError(_0x4417bd,null));};exports[_0xc1e3('0x55')]=function(_0x1e773d,_0x4775b8,_0x366ba1){var _0x5b8e0e={};var _0xf87cb6={};var _0x173b7b;var _0xb4d7c4;return db['CmCompany'][_0xc1e3('0x56')]({'where':{'id':_0x1e773d[_0xc1e3('0x45')]['id']}})[_0xc1e3('0x25')](handleEntityNotFound(_0x4775b8,null))['then'](function(_0x50fd7d){if(_0x50fd7d){_0x173b7b=_0x50fd7d;_0xf87cb6[_0xc1e3('0x31')]=_[_0xc1e3('0x32')](db['CmContact'][_0xc1e3('0x46')]);_0xf87cb6['query']=_['keys'](_0x1e773d[_0xc1e3('0x33')]);_0xf87cb6[_0xc1e3('0x34')]=_[_0xc1e3('0x36')](_0xf87cb6[_0xc1e3('0x31')],_0xf87cb6[_0xc1e3('0x33')]);_0x5b8e0e['attributes']=_[_0xc1e3('0x36')](_0xf87cb6[_0xc1e3('0x31')],qs[_0xc1e3('0x37')](_0x1e773d[_0xc1e3('0x33')][_0xc1e3('0x37')]));_0x5b8e0e[_0xc1e3('0x35')]=_0x5b8e0e[_0xc1e3('0x35')]['length']?_0x5b8e0e[_0xc1e3('0x35')]:_0xf87cb6[_0xc1e3('0x31')];_0x5b8e0e[_0xc1e3('0x3a')]=qs[_0xc1e3('0x3b')](_0x1e773d['query'][_0xc1e3('0x3b')]);_0x5b8e0e['where']=qs[_0xc1e3('0x34')](_['pick'](_0x1e773d[_0xc1e3('0x33')],_0xf87cb6[_0xc1e3('0x34')]));if(_0x1e773d[_0xc1e3('0x33')]['filter']){_0x5b8e0e['where']=_[_0xc1e3('0x3e')](_0x5b8e0e[_0xc1e3('0x3c')],{'$or':_[_0xc1e3('0x57')](_0x5b8e0e[_0xc1e3('0x35')],function(_0x1c33d6){var _0x56be37={};_0x56be37[_0x1c33d6]={'$like':'%'+_0x1e773d[_0xc1e3('0x33')][_0xc1e3('0x3d')]+'%'};return _0x56be37;})});}_0x5b8e0e=_[_0xc1e3('0x3e')]({},_0x5b8e0e,_0x1e773d[_0xc1e3('0x3f')]);return _0x173b7b[_0xc1e3('0x55')](_0x5b8e0e);}})[_0xc1e3('0x25')](function(_0x5cbe46){if(_0x5cbe46){_0xb4d7c4=_0x5cbe46['length'];if(!_0x1e773d[_0xc1e3('0x33')][_0xc1e3('0x58')](_0xc1e3('0x39'))){_0x5b8e0e['limit']=qs[_0xc1e3('0x1e')](_0x1e773d[_0xc1e3('0x33')]['limit']);_0x5b8e0e[_0xc1e3('0x20')]=qs[_0xc1e3('0x20')](_0x1e773d[_0xc1e3('0x33')][_0xc1e3('0x20')]);}return _0x173b7b[_0xc1e3('0x55')](_0x5b8e0e);}})['then'](function(_0x3e9639){if(_0x3e9639){return _0x3e9639?{'count':_0xb4d7c4,'rows':_0x3e9639}:null;}})[_0xc1e3('0x25')](respondWithResult(_0x4775b8,null))[_0xc1e3('0x43')](handleError(_0x4775b8,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 58ec5a8..66155be 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 _0x2b4c=['moment','bluebird','request-promise','path','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2b4c,0x1de));var _0xc2b4=function(_0x1e3c04,_0x5bb966){_0x1e3c04=_0x1e3c04-0x0;var _0x4f89bb=_0x2b4c[_0x1e3c04];return _0x4f89bb;};'use strict';var _=require(_0xc2b4('0x0'));var util=require(_0xc2b4('0x1'));var logger=require('../../config/logger')(_0xc2b4('0x2'));var moment=require(_0xc2b4('0x3'));var BPromise=require(_0xc2b4('0x4'));var rp=require(_0xc2b4('0x5'));var fs=require('fs');var path=require(_0xc2b4('0x6'));var rimraf=require(_0xc2b4('0x7'));var config=require('../../config/environment');var attributes=require(_0xc2b4('0x8'));module[_0xc2b4('0x9')]=function(_0x593beb,_0x49caf8){return _0x593beb[_0xc2b4('0xa')](_0xc2b4('0xb'),attributes,{'tableName':_0xc2b4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a65=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x598e27,_0x188f23){var _0x10ab50=function(_0x82d89c){while(--_0x82d89c){_0x598e27['push'](_0x598e27['shift']());}};_0x10ab50(++_0x188f23);}(_0x4a65,0x89));var _0x54a6=function(_0x2374c1,_0x522b1e){_0x2374c1=_0x2374c1-0x0;var _0x443c47=_0x4a65[_0x2374c1];return _0x443c47;};'use strict';var _=require(_0x54a6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x54a6('0x1'));var moment=require(_0x54a6('0x2'));var BPromise=require('bluebird');var rp=require(_0x54a6('0x3'));var fs=require('fs');var path=require(_0x54a6('0x4'));var rimraf=require(_0x54a6('0x5'));var config=require(_0x54a6('0x6'));var attributes=require(_0x54a6('0x7'));module[_0x54a6('0x8')]=function(_0x40303f,_0x4ca405){return _0x40303f[_0x54a6('0x9')](_0x54a6('0xa'),attributes,{'tableName':_0x54a6('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 42ce9f7..8aafe3f 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 _0x4312=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x1e16b9,_0x237d96){var _0x5c59c9=function(_0x5a3301){while(--_0x5a3301){_0x1e16b9['push'](_0x1e16b9['shift']());}};_0x5c59c9(++_0x237d96);}(_0x4312,0x1cb));var _0x2431=function(_0x55fc03,_0x43ce48){_0x55fc03=_0x55fc03-0x0;var _0x5bf429=_0x4312[_0x55fc03];return _0x5bf429;};'use strict';var _=require(_0x2431('0x0'));var util=require(_0x2431('0x1'));var moment=require(_0x2431('0x2'));var BPromise=require(_0x2431('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2431('0x4'));var db=require(_0x2431('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2431('0x6'))(_0x2431('0x7'));var config=require(_0x2431('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2431('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x556ac2,_0x274da8,_0x63d0f0){return new BPromise(function(_0x5da25c,_0x593a7b){return client[_0x2431('0xa')](_0x556ac2,_0x63d0f0)[_0x2431('0xb')](function(_0x34c385){logger[_0x2431('0xc')]('CmCompany,\x20%s,\x20%s',_0x274da8,'request\x20sent');logger[_0x2431('0xd')](_0x2431('0xe'),_0x274da8,'request\x20sent',JSON['stringify'](_0x34c385));if(_0x34c385['error']){if(_0x34c385[_0x2431('0xf')][_0x2431('0x10')]===0x1f4){logger[_0x2431('0xf')](_0x2431('0x11'),_0x274da8,_0x34c385[_0x2431('0xf')][_0x2431('0x12')]);return _0x593a7b(_0x34c385[_0x2431('0xf')][_0x2431('0x12')]);}logger[_0x2431('0xf')](_0x2431('0x11'),_0x274da8,_0x34c385[_0x2431('0xf')][_0x2431('0x12')]);return _0x5da25c(_0x34c385[_0x2431('0xf')][_0x2431('0x12')]);}else{logger['info'](_0x2431('0x11'),_0x274da8,'request\x20sent');_0x5da25c(_0x34c385[_0x2431('0x13')][_0x2431('0x12')]);}})[_0x2431('0x14')](function(_0x1ce8f6){logger[_0x2431('0xf')](_0x2431('0x11'),_0x274da8,_0x1ce8f6);_0x593a7b(_0x1ce8f6);});});}
\ No newline at end of file
+var _0xb732=['randomstring','../../config/environment','jayson/promise','client','http','request','then','info','debug','stringify','error','code','CmCompany,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','bluebird'];(function(_0x19a58a,_0xf539d5){var _0x1df6f4=function(_0x2abdaf){while(--_0x2abdaf){_0x19a58a['push'](_0x19a58a['shift']());}};_0x1df6f4(++_0xf539d5);}(_0xb732,0x1c8));var _0x2b73=function(_0x531722,_0x161aa9){_0x531722=_0x531722-0x0;var _0x3f1769=_0xb732[_0x531722];return _0x3f1769;};'use strict';var _=require(_0x2b73('0x0'));var util=require(_0x2b73('0x1'));var moment=require(_0x2b73('0x2'));var BPromise=require(_0x2b73('0x3'));var rs=require(_0x2b73('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2b73('0x5'));var jayson=require(_0x2b73('0x6'));var client=jayson[_0x2b73('0x7')][_0x2b73('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ee0b0,_0x12f95c,_0x188205){return new BPromise(function(_0xd25c8a,_0x2db598){return client[_0x2b73('0x9')](_0x1ee0b0,_0x188205)[_0x2b73('0xa')](function(_0x467af7){logger[_0x2b73('0xb')]('CmCompany,\x20%s,\x20%s',_0x12f95c,'request\x20sent');logger[_0x2b73('0xc')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x12f95c,'request\x20sent',JSON[_0x2b73('0xd')](_0x467af7));if(_0x467af7['error']){if(_0x467af7[_0x2b73('0xe')][_0x2b73('0xf')]===0x1f4){logger[_0x2b73('0xe')](_0x2b73('0x10'),_0x12f95c,_0x467af7[_0x2b73('0xe')][_0x2b73('0x11')]);return _0x2db598(_0x467af7['error'][_0x2b73('0x11')]);}logger[_0x2b73('0xe')]('CmCompany,\x20%s,\x20%s',_0x12f95c,_0x467af7[_0x2b73('0xe')]['message']);return _0xd25c8a(_0x467af7[_0x2b73('0xe')]['message']);}else{logger[_0x2b73('0xb')]('CmCompany,\x20%s,\x20%s',_0x12f95c,_0x2b73('0x12'));_0xd25c8a(_0x467af7[_0x2b73('0x13')][_0x2b73('0x11')]);}})['catch'](function(_0xaedae3){logger[_0x2b73('0xe')](_0x2b73('0x10'),_0x12f95c,_0xaedae3);_0x2db598(_0xaedae3);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index b14d298..81ba538 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 _0xe608=['show','/:id/contacts','post','create','addContacts','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','describe'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0xe608,0x1cd));var _0x8e60=function(_0x4f3207,_0x264c78){_0x4f3207=_0x4f3207-0x0;var _0x87adb6=_0xe608[_0x4f3207];return _0x87adb6;};'use strict';var multer=require(_0x8e60('0x0'));var util=require(_0x8e60('0x1'));var path=require(_0x8e60('0x2'));var timeout=require(_0x8e60('0x3'));var express=require('express');var router=express[_0x8e60('0x4')]();var fs_extra=require(_0x8e60('0x5'));var auth=require(_0x8e60('0x6'));var interaction=require(_0x8e60('0x7'));var config=require(_0x8e60('0x8'));var controller=require(_0x8e60('0x9'));router['get']('/',auth[_0x8e60('0xa')](),controller[_0x8e60('0xb')]);router[_0x8e60('0xc')]('/describe',auth[_0x8e60('0xa')](),controller[_0x8e60('0xd')]);router[_0x8e60('0xc')]('/:id',auth[_0x8e60('0xa')](),controller[_0x8e60('0xe')]);router[_0x8e60('0xc')](_0x8e60('0xf'),auth[_0x8e60('0xa')](),controller['getContacts']);router[_0x8e60('0x10')]('/',auth['isAuthenticated'](),controller[_0x8e60('0x11')]);router[_0x8e60('0x10')](_0x8e60('0xf'),auth[_0x8e60('0xa')](),controller[_0x8e60('0x12')]);router[_0x8e60('0x13')](_0x8e60('0x14'),auth['isAuthenticated'](),controller[_0x8e60('0x15')]);router[_0x8e60('0x16')](_0x8e60('0x14'),auth[_0x8e60('0xa')](),controller[_0x8e60('0x17')]);module[_0x8e60('0x18')]=router;
\ No newline at end of file
+var _0x78e8=['show','/:id/contacts','getContacts','create','post','addContacts','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x3d17df,_0x372f84){var _0x16d6d3=function(_0x2d52c8){while(--_0x2d52c8){_0x3d17df['push'](_0x3d17df['shift']());}};_0x16d6d3(++_0x372f84);}(_0x78e8,0x177));var _0x878e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x78e8[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x878e('0x0'));var util=require(_0x878e('0x1'));var path=require('path');var timeout=require(_0x878e('0x2'));var express=require(_0x878e('0x3'));var router=express[_0x878e('0x4')]();var fs_extra=require(_0x878e('0x5'));var auth=require(_0x878e('0x6'));var interaction=require(_0x878e('0x7'));var config=require(_0x878e('0x8'));var controller=require(_0x878e('0x9'));router[_0x878e('0xa')]('/',auth[_0x878e('0xb')](),controller[_0x878e('0xc')]);router[_0x878e('0xa')](_0x878e('0xd'),auth[_0x878e('0xb')](),controller[_0x878e('0xe')]);router[_0x878e('0xa')]('/:id',auth[_0x878e('0xb')](),controller[_0x878e('0xf')]);router[_0x878e('0xa')](_0x878e('0x10'),auth[_0x878e('0xb')](),controller[_0x878e('0x11')]);router['post']('/',auth[_0x878e('0xb')](),controller[_0x878e('0x12')]);router[_0x878e('0x13')](_0x878e('0x10'),auth[_0x878e('0xb')](),controller[_0x878e('0x14')]);router[_0x878e('0x15')](_0x878e('0x16'),auth[_0x878e('0xb')](),controller[_0x878e('0x17')]);router['delete'](_0x878e('0x16'),auth['isAuthenticated'](),controller[_0x878e('0x18')]);module[_0x878e('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index b764316..e8ce1ce 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 _0x7028=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','lodash'];(function(_0xd28119,_0x2a8097){var _0x418b38=function(_0x331d0e){while(--_0x331d0e){_0xd28119['push'](_0xd28119['shift']());}};_0x418b38(++_0x2a8097);}(_0x7028,0xfb));var _0x8702=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0x7028[_0x1fafa5];return _0xcf08c9;};'use strict';var _=require(_0x8702('0x0'));var Sequelize=require('sequelize');module[_0x8702('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x8702('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x8702('0x2')]},'city':{'type':Sequelize[_0x8702('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x8702('0x2')]},'description':{'type':Sequelize[_0x8702('0x3')]},'phone':{'type':Sequelize[_0x8702('0x2')]},'mobile':{'type':Sequelize[_0x8702('0x2')]},'fax':{'type':Sequelize[_0x8702('0x2')]},'email':{'type':Sequelize[_0x8702('0x2')]},'url':{'type':Sequelize[_0x8702('0x2')]},'facebook':{'type':Sequelize[_0x8702('0x2')]},'fb_data':{'type':Sequelize[_0x8702('0x2')]},'twitter':{'type':Sequelize[_0x8702('0x2')]},'skype':{'type':Sequelize[_0x8702('0x2')]},'teams':{'type':Sequelize[_0x8702('0x2')]},'viber':{'type':Sequelize[_0x8702('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x8702('0x2')]},'telegram':{'type':Sequelize[_0x8702('0x2')]},'UserId':{'type':Sequelize[_0x8702('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x8702('0x2')]},'priority':{'type':Sequelize[_0x8702('0x4')](0x2)[_0x8702('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x8702('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x8702('0x2')]},'utcOffset':{'type':Sequelize[_0x8702('0x4')]}};
\ No newline at end of file
+var _0xef53=['TEXT','INTEGER','UNSIGNED','DATE','lodash','sequelize','exports','STRING'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xef53,0x174));var _0x3ef5=function(_0x41cb4b,_0x200468){_0x41cb4b=_0x41cb4b-0x0;var _0x1719c1=_0xef53[_0x41cb4b];return _0x1719c1;};'use strict';var _=require(_0x3ef5('0x0'));var Sequelize=require(_0x3ef5('0x1'));module[_0x3ef5('0x2')]={'firstName':{'type':Sequelize[_0x3ef5('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x3ef5('0x3')]},'street':{'type':Sequelize[_0x3ef5('0x3')]},'postalCode':{'type':Sequelize[_0x3ef5('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x3ef5('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3ef5('0x4')]},'phone':{'type':Sequelize[_0x3ef5('0x3')]},'mobile':{'type':Sequelize[_0x3ef5('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3ef5('0x3')]},'url':{'type':Sequelize[_0x3ef5('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x3ef5('0x3')]},'twitter':{'type':Sequelize[_0x3ef5('0x3')]},'skype':{'type':Sequelize[_0x3ef5('0x3')]},'teams':{'type':Sequelize[_0x3ef5('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x3ef5('0x3')]},'telegram':{'type':Sequelize[_0x3ef5('0x3')]},'UserId':{'type':Sequelize[_0x3ef5('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x3ef5('0x3')]},'priority':{'type':Sequelize[_0x3ef5('0x5')](0x2)[_0x3ef5('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3ef5('0x7')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x3ef5('0x3')]},'utcOffset':{'type':Sequelize[_0x3ef5('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index f0ad13d..63b8b81 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 _0x2ee6=['bluebird','path','lodash','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','offset','limit','count','Content-Range','json','update','then','destroy','sendStatus','stack','name','index','describe','getOptions','findAll','user','CmContact','find','catch','tags','keys','startsWith','cf_','displayName','query','analytics','CmCustomField','length','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','hasOwnProperty','columnName','merge','body','get','mergeWith','isArray','from','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','join','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','all','params','Tag','Tags','color','tag','Phones','ContactItemType','sequelize','literal','Phones.OrderBy','$and','omit','map','format','pickBy','table','cm_contacts','id\x20=\x20?','toParam','phone','CmHopper','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','findOne','setTags','ids','OrderBy','item_types','items','ItemTypeId','description','contact\x20phone\x20exists','item','ItemType','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','nolimit','ContactId','options','includeAll','include','rows','CmHopperFinal','getJscriptySessions','binding_keys','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','filename','chmodSync','child_process','CompanyId','File\x20uploaded\x20correctly!','pid','send','createReadStream','parse','meta','import','User','agent','binding','No\x20firstName\x20column\x20specified','fork','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','message','getJourney','mail','chat','sms','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','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','alias','DESC','findAndCountAll','fullname','startCase','Website','closed','thirdDisposition','Owner','browserName','customerIp','customerPort','deviceModel','ratingType','ratingValue','subject','substatus','externalUrl','Interaction','reverse','slice','moment'];(function(_0x3059c9,_0x369424){var _0xb20e2=function(_0x317df5){while(--_0x317df5){_0x3059c9['push'](_0x3059c9['shift']());}};_0xb20e2(++_0x369424);}(_0x2ee6,0xf1));var _0x62ee=function(_0x2655c1,_0x3cd78e){_0x2655c1=_0x2655c1-0x0;var _0x338853=_0x2ee6[_0x2655c1];return _0x338853;};'use strict';var moment=require(_0x62ee('0x0'));var BPromise=require(_0x62ee('0x1'));var util=require('util');var path=require(_0x62ee('0x2'));var fs=require('fs');var _=require(_0x62ee('0x3'));var squel=require('squel');var Papa=require(_0x62ee('0x4'));var Redis=require(_0x62ee('0x5'));var contacts=require('../../components/contacts');var qs=require(_0x62ee('0x6'));var logger=require(_0x62ee('0x7'))('api');var config=require('../../config/environment');var shared=require(_0x62ee('0x8'));var db=require('../../mysqldb')['db'];config[_0x62ee('0x9')]=_[_0x62ee('0xa')](config['redis'],{'host':_0x62ee('0xb'),'port':0x18eb});var socket=require(_0x62ee('0xc'))(new Redis(config[_0x62ee('0x9')]));require(_0x62ee('0xd'))[_0x62ee('0xe')](socket);function respondWithResult(_0x5360b5,_0x3a3b60){_0x3a3b60=_0x3a3b60||0xc8;return function(_0x489ef5){if(_0x489ef5){return _0x5360b5[_0x62ee('0xf')](_0x3a3b60)['json'](_0x489ef5);}};}function respondWithFilteredResult(_0x1ce844,_0x1f6ab5){return function(_0x2e785c){if(_0x2e785c){var _0x596305=typeof _0x1f6ab5[_0x62ee('0x10')]==='undefined'&&typeof _0x1f6ab5[_0x62ee('0x11')]==='undefined';var _0x1cd427=_0x2e785c[_0x62ee('0x12')];var _0x38928f=_0x596305?0x0:_0x1f6ab5[_0x62ee('0x10')];var _0x4a0679=_0x596305?_0x2e785c['count']:_0x1f6ab5[_0x62ee('0x10')]+_0x1f6ab5[_0x62ee('0x11')];var _0x56cedc;if(_0x4a0679>=_0x1cd427){_0x4a0679=_0x1cd427;_0x56cedc=0xc8;}else{_0x56cedc=0xce;}_0x1ce844[_0x62ee('0xf')](_0x56cedc);return _0x1ce844['set'](_0x62ee('0x13'),_0x38928f+'-'+_0x4a0679+'/'+_0x1cd427)[_0x62ee('0x14')](_0x2e785c);}return null;};}function saveUpdates(_0x46fd0e){return function(_0x4001a9){if(_0x4001a9){return _0x4001a9[_0x62ee('0x15')](_0x46fd0e)[_0x62ee('0x16')](function(_0x3d73b1){return _0x3d73b1;});}return null;};}function removeEntity(_0x5c7ac4){return function(_0x266550){if(_0x266550){return _0x266550[_0x62ee('0x17')]()[_0x62ee('0x16')](function(){_0x5c7ac4[_0x62ee('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x319116){return function(_0xdbaefa){if(!_0xdbaefa){_0x319116[_0x62ee('0x18')](0x194);}return _0xdbaefa;};}function handleError(_0x4460b1,_0x2697e9){_0x2697e9=_0x2697e9||0x1f4;return function(_0x5d988b){logger['error'](_0x5d988b[_0x62ee('0x19')]);if(_0x5d988b[_0x62ee('0x1a')]){delete _0x5d988b[_0x62ee('0x1a')];}_0x4460b1[_0x62ee('0xf')](_0x2697e9)['send'](_0x5d988b);};}exports[_0x62ee('0x1b')]=function(_0x73af3f,_0x517959){var _0x1e3445={};return contacts[_0x62ee('0x1c')]()[_0x62ee('0x16')](function(_0x210883){_0x1e3445=qs[_0x62ee('0x1d')](_0x210883,_0x73af3f);return contacts[_0x62ee('0x1e')](_0x73af3f['query'],_0x73af3f[_0x62ee('0x1f')],_0x1e3445,_0x210883);})[_0x62ee('0x16')](respondWithFilteredResult(_0x517959,_0x1e3445))['catch'](handleError(_0x517959,null));};exports[_0x62ee('0x17')]=function(_0x5e225f,_0x259f51){return db[_0x62ee('0x20')][_0x62ee('0x21')]({'where':{'id':_0x5e225f['params']['id']}})['then'](handleEntityNotFound(_0x259f51,null))[_0x62ee('0x16')](removeEntity(_0x259f51,null))[_0x62ee('0x22')](handleError(_0x259f51,null));};exports['describe']=function(_0x537646,_0x3779ff){return db[_0x62ee('0x20')][_0x62ee('0x1c')]()['then'](function(_0x4426fd){delete _0x4426fd[_0x62ee('0x23')];for(var _0x2f3a61=0x0;_0x2f3a61
','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8'];(function(_0x2b0511,_0x127ce8){var _0x5a50d3=function(_0x27d4f4){while(--_0x27d4f4){_0x2b0511['push'](_0x2b0511['shift']());}};_0x5a50d3(++_0x127ce8);}(_0x6e72,0xe3));var _0x26e7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e72[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var moment=require(_0x26e7('0x0'));var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require('util');var tnef=require(_0x26e7('0x1'));var logger=require('../../../config/logger')('email');var config=require(_0x26e7('0x2'));function getAddress(_0x3cd0d9){var _0x26245b=_[_0x26e7('0x3')](_0x3cd0d9[_0x26e7('0x4')]);return _0x26245b&&_0x26245b['address']?_0x26245b[_0x26e7('0x5')]:_0x26e7('0x6')+random['generate'](0x6)+_0x26e7('0x7');}function getFirstName(_0x3138f2){var _0x15d996=_[_0x26e7('0x3')](_0x3138f2[_0x26e7('0x4')]);if(_0x15d996&&_0x15d996['name']){if(_0x15d996[_0x26e7('0x8')]==_0x15d996[_0x26e7('0x5')]){return _0x15d996[_0x26e7('0x8')][_0x26e7('0x9')](0x0,_0x15d996[_0x26e7('0x8')][_0x26e7('0xa')]('@'));}var _0x28fafa=_0x15d996[_0x26e7('0x8')]['split'](/\s+/);return _0x28fafa[_0x26e7('0xb')]>0x1?_0x28fafa[_0x26e7('0xc')](0x0,-0x1)[_0x26e7('0xd')]('\x20'):_0x15d996[_0x26e7('0x8')];}return _0x26e7('0xe');}function getLastName(_0x5b8d69){var _0x3908aa=_[_0x26e7('0x3')](_0x5b8d69[_0x26e7('0x4')]);if(_0x3908aa&&_0x3908aa[_0x26e7('0x8')]){var _0x158757=_0x3908aa[_0x26e7('0x8')]['split'](/\s+/);return _0x158757['length']>0x1?_0x158757[_0x26e7('0xf')]():'';}return'';}function getMails(_0x539f49,_0x3f3933){var _0x545eef='';for(var _0x17cf44=0x0;_0x17cf44<_0x3f3933[_0x26e7('0x4')]['length'];_0x17cf44+=0x1){if(_0x3f3933[_0x26e7('0x4')][_0x17cf44][_0x26e7('0x5')]!==_0x539f49){if(!_[_0x26e7('0x10')](_0x545eef)){_0x545eef+=',';}_0x545eef+=_0x3f3933[_0x26e7('0x4')][_0x17cf44]['name']||_0x3f3933[_0x26e7('0x4')][_0x17cf44][_0x26e7('0x5')]||'';_0x545eef+='\x20<';_0x545eef+=_0x3f3933[_0x26e7('0x4')][_0x17cf44]['address']?_0x3f3933[_0x26e7('0x4')][_0x17cf44][_0x26e7('0x5')]:_0x26e7('0x6')+random['generate'](0x6)+_0x26e7('0x7');_0x545eef+='>';}}return _0x545eef;}function parseEmail(_0x2e38e7,_0x3b9e54,_0x57630a){if(_0x3b9e54[_0x26e7('0x11')]){var _0xbae9e9=/