From: support
Date: Thu, 2 Feb 2023 12:19:19 +0000 (+0000)
Subject: Built motion from commit 896e83a8.|2.6.30
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22https:/fonts.googleapis.com/icon?a=commitdiff_plain;h=d4a6ec8f31b08e5615602325f1060bce6eed413c;p=motion2.git
Built motion from commit 896e83a8.|2.6.30
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 00bcf4d..4f16427 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-02T09:59:48.711Z",
+ "time": "2023-02-02T12:10:12.809Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 820c2fc..08ca2f8 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-02T09:59:48.711Z",
+ "time": "2023-02-02T12:10:12.809Z",
"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 f29fc47..e165920 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 _0x6b27=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','STRING','integration','motionbar','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x572c0a,_0x55951b){var _0x12c7f7=function(_0x2582c6){while(--_0x2582c6){_0x572c0a['push'](_0x572c0a['shift']());}};_0x12c7f7(++_0x55951b);}(_0x6b27,0xc3));var _0x76b2=function(_0x89fd1e,_0x344785){_0x89fd1e=_0x89fd1e-0x0;var _0x464931=_0x6b27[_0x89fd1e];return _0x464931;};'use strict';var Sequelize=require(_0x76b2('0x0'));module['exports']={'name':{'type':Sequelize[_0x76b2('0x1')],'get':function(_0xc4d1ca){return this[_0x76b2('0x2')](_0x76b2('0x3'));}},'action':{'type':Sequelize[_0x76b2('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x76b2('0x5'),_0x76b2('0x6'),_0x76b2('0x7'),'urlForward','browser',_0x76b2('0x8'),_0x76b2('0x9')]],'msg':_0x76b2('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x76b2('0x4')](0x1000),'comment':_0x76b2('0xb')},'data2':{'type':Sequelize[_0x76b2('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x76b2('0x4')](0x1000),'comment':_0x76b2('0xc')},'data4':{'type':Sequelize[_0x76b2('0x4')](0x1000),'comments':_0x76b2('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x76b2('0xe')],'comments':_0x76b2('0xf')}};
\ No newline at end of file
+var _0xe7b3=['urlForward[body]','sequelize','VIRTUAL','getDataValue','contactManager','integration','motionbar','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0x29a3a5,_0x4873c8){var _0x37fe1d=function(_0x26920b){while(--_0x26920b){_0x29a3a5['push'](_0x29a3a5['shift']());}};_0x37fe1d(++_0x4873c8);}(_0xe7b3,0xd2));var _0x3e7b=function(_0x13edd2,_0x165577){_0x13edd2=_0x13edd2-0x0;var _0x53f5eb=_0xe7b3[_0x13edd2];return _0x53f5eb;};'use strict';var Sequelize=require(_0x3e7b('0x0'));module['exports']={'name':{'type':Sequelize[_0x3e7b('0x1')],'get':function(_0x14baf0){return this[_0x3e7b('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x3e7b('0x3'),_0x3e7b('0x4'),_0x3e7b('0x5'),_0x3e7b('0x6'),'urlForward','browser',_0x3e7b('0x7'),_0x3e7b('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x3e7b('0x9')},'data1':{'type':Sequelize[_0x3e7b('0xa')](0x1000),'comment':_0x3e7b('0xb')},'data2':{'type':Sequelize[_0x3e7b('0xa')](0x1000),'comment':_0x3e7b('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x3e7b('0xd')},'data4':{'type':Sequelize[_0x3e7b('0xa')](0x1000),'comments':_0x3e7b('0xe')},'data5':{'type':Sequelize[_0x3e7b('0xa')](0x1000),'comments':_0x3e7b('0xf')},'data6':{'type':Sequelize[_0x3e7b('0xa')],'comments':_0x3e7b('0x10')},'data7':{'type':Sequelize[_0x3e7b('0x11')],'comments':_0x3e7b('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index efb9414..c6f8b6d 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 _0xb600=['offset','reject','save','update','then','error','stack','name','send','body','find','params','catch','destroy','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count'];(function(_0x1401e1,_0xabb499){var _0x1aab56=function(_0x1071fd){while(--_0x1071fd){_0x1401e1['push'](_0x1401e1['shift']());}};_0x1aab56(++_0xabb499);}(_0xb600,0xa5));var _0x0b60=function(_0x360926,_0x15f49f){_0x360926=_0x360926-0x0;var _0x33a85a=_0xb600[_0x360926];return _0x33a85a;};'use strict';var emlformat=require(_0x0b60('0x0'));var rimraf=require(_0x0b60('0x1'));var zipdir=require(_0x0b60('0x2'));var jsonpatch=require(_0x0b60('0x3'));var rp=require(_0x0b60('0x4'));var moment=require('moment');var BPromise=require(_0x0b60('0x5'));var Mustache=require(_0x0b60('0x6'));var util=require(_0x0b60('0x7'));var path=require('path');var sox=require(_0x0b60('0x8'));var csv=require(_0x0b60('0x9'));var ejs=require(_0x0b60('0xa'));var fs=require('fs');var fs_extra=require(_0x0b60('0xb'));var _=require(_0x0b60('0xc'));var squel=require(_0x0b60('0xd'));var crypto=require(_0x0b60('0xe'));var jsforce=require(_0x0b60('0xf'));var deskjs=require(_0x0b60('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0b60('0x11'));var Papa=require(_0x0b60('0x12'));var Redis=require(_0x0b60('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0b60('0x14'));var as=require(_0x0b60('0x15'));var hardwareService=require(_0x0b60('0x16'));var logger=require(_0x0b60('0x17'))(_0x0b60('0x18'));var utils=require(_0x0b60('0x19'));var config=require(_0x0b60('0x1a'));var licenseUtil=require(_0x0b60('0x1b'));var db=require(_0x0b60('0x1c'))['db'];function respondWithStatusCode(_0x3d5408,_0x3e9008){_0x3e9008=_0x3e9008||0xcc;return function(_0x34bebe){if(_0x34bebe){return _0x3d5408[_0x0b60('0x1d')](_0x3e9008);}return _0x3d5408['status'](_0x3e9008)[_0x0b60('0x1e')]();};}function respondWithResult(_0x3ec774,_0x3c32c6){_0x3c32c6=_0x3c32c6||0xc8;return function(_0x26da59){if(_0x26da59){return _0x3ec774[_0x0b60('0x1f')](_0x3c32c6)['json'](_0x26da59);}};}function respondWithFilteredResult(_0x448473,_0x46bcdf){return function(_0x362e9c){if(_0x362e9c){var _0x4f232b=typeof _0x46bcdf['offset']===_0x0b60('0x20')&&typeof _0x46bcdf[_0x0b60('0x21')]===_0x0b60('0x20');var _0x1e5c3f=_0x362e9c[_0x0b60('0x22')];var _0x41100a=_0x4f232b?0x0:_0x46bcdf[_0x0b60('0x23')];var _0x51e3ec=_0x4f232b?_0x362e9c[_0x0b60('0x22')]:_0x46bcdf[_0x0b60('0x23')]+_0x46bcdf[_0x0b60('0x21')];var _0x10a65c;if(_0x51e3ec>=_0x1e5c3f){_0x51e3ec=_0x1e5c3f;_0x10a65c=0xc8;}else{_0x10a65c=0xce;}_0x448473[_0x0b60('0x1f')](_0x10a65c);return _0x448473['set']('Content-Range',_0x41100a+'-'+_0x51e3ec+'/'+_0x1e5c3f)['json'](_0x362e9c);}return null;};}function patchUpdates(_0x14f5cf){return function(_0x5dadca){try{jsonpatch['apply'](_0x5dadca,_0x14f5cf,!![]);}catch(_0x3efb79){return BPromise[_0x0b60('0x24')](_0x3efb79);}return _0x5dadca[_0x0b60('0x25')]();};}function saveUpdates(_0x455d5a,_0x29c6cc){return function(_0x38b12f){if(_0x38b12f){return _0x38b12f[_0x0b60('0x26')](_0x455d5a)[_0x0b60('0x27')](function(_0x187298){return _0x187298;});}return null;};}function removeEntity(_0x10242c,_0x32d4aa){return function(_0x2e0d46){if(_0x2e0d46){return _0x2e0d46['destroy']()[_0x0b60('0x27')](function(){_0x10242c[_0x0b60('0x1f')](0xcc)[_0x0b60('0x1e')]();});}};}function handleEntityNotFound(_0x4acdf8,_0x41793e){return function(_0x503613){if(!_0x503613){_0x4acdf8[_0x0b60('0x1d')](0x194);}return _0x503613;};}function handleError(_0x726330,_0x4c4215){_0x4c4215=_0x4c4215||0x1f4;return function(_0x6eb0f3){logger[_0x0b60('0x28')](_0x6eb0f3[_0x0b60('0x29')]);if(_0x6eb0f3[_0x0b60('0x2a')]){delete _0x6eb0f3[_0x0b60('0x2a')];}_0x726330['status'](_0x4c4215)[_0x0b60('0x2b')](_0x6eb0f3);};}exports['update']=function(_0x48ac4b,_0x5a9d14){if(_0x48ac4b[_0x0b60('0x2c')]['id']){delete _0x48ac4b[_0x0b60('0x2c')]['id'];}return db['Action'][_0x0b60('0x2d')]({'where':{'id':_0x48ac4b[_0x0b60('0x2e')]['id']}})['then'](handleEntityNotFound(_0x5a9d14,null))['then'](saveUpdates(_0x48ac4b[_0x0b60('0x2c')],null))[_0x0b60('0x27')](respondWithResult(_0x5a9d14,null))[_0x0b60('0x2f')](handleError(_0x5a9d14,null));};exports[_0x0b60('0x30')]=function(_0xd4b69e,_0xc871d6){return db[_0x0b60('0x31')][_0x0b60('0x2d')]({'where':{'id':_0xd4b69e[_0x0b60('0x2e')]['id']}})[_0x0b60('0x27')](handleEntityNotFound(_0xc871d6,null))['then'](removeEntity(_0xc871d6,null))[_0x0b60('0x2f')](handleError(_0xc871d6,null));};
\ No newline at end of file
+var _0x2d36=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','stack','name','send','update','body','params','Action','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0x2d36,0x73));var _0x62d3=function(_0xeda3ff,_0x1736fe){_0xeda3ff=_0xeda3ff-0x0;var _0x4b0c13=_0x2d36[_0xeda3ff];return _0x4b0c13;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x62d3('0x0'));var zipdir=require(_0x62d3('0x1'));var jsonpatch=require(_0x62d3('0x2'));var rp=require(_0x62d3('0x3'));var moment=require(_0x62d3('0x4'));var BPromise=require(_0x62d3('0x5'));var Mustache=require(_0x62d3('0x6'));var util=require('util');var path=require('path');var sox=require(_0x62d3('0x7'));var csv=require(_0x62d3('0x8'));var ejs=require(_0x62d3('0x9'));var fs=require('fs');var fs_extra=require(_0x62d3('0xa'));var _=require(_0x62d3('0xb'));var squel=require(_0x62d3('0xc'));var crypto=require(_0x62d3('0xd'));var jsforce=require(_0x62d3('0xe'));var deskjs=require(_0x62d3('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x62d3('0x10'));var Redis=require(_0x62d3('0x11'));var authService=require(_0x62d3('0x12'));var qs=require(_0x62d3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x62d3('0x14'));var logger=require(_0x62d3('0x15'))('api');var utils=require(_0x62d3('0x16'));var config=require(_0x62d3('0x17'));var licenseUtil=require(_0x62d3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b5ca0,_0x1e2595){_0x1e2595=_0x1e2595||0xcc;return function(_0x3f3607){if(_0x3f3607){return _0x4b5ca0['sendStatus'](_0x1e2595);}return _0x4b5ca0[_0x62d3('0x19')](_0x1e2595)[_0x62d3('0x1a')]();};}function respondWithResult(_0x24e7eb,_0x28f4f6){_0x28f4f6=_0x28f4f6||0xc8;return function(_0x2caa56){if(_0x2caa56){return _0x24e7eb[_0x62d3('0x19')](_0x28f4f6)[_0x62d3('0x1b')](_0x2caa56);}};}function respondWithFilteredResult(_0x220f6e,_0x79b4ef){return function(_0x58f9e6){if(_0x58f9e6){var _0x251dba=typeof _0x79b4ef[_0x62d3('0x1c')]===_0x62d3('0x1d')&&typeof _0x79b4ef[_0x62d3('0x1e')]===_0x62d3('0x1d');var _0x2fe3ee=_0x58f9e6['count'];var _0x7225fa=_0x251dba?0x0:_0x79b4ef[_0x62d3('0x1c')];var _0xd66ea1=_0x251dba?_0x58f9e6[_0x62d3('0x1f')]:_0x79b4ef[_0x62d3('0x1c')]+_0x79b4ef[_0x62d3('0x1e')];var _0x287713;if(_0xd66ea1>=_0x2fe3ee){_0xd66ea1=_0x2fe3ee;_0x287713=0xc8;}else{_0x287713=0xce;}_0x220f6e['status'](_0x287713);return _0x220f6e['set'](_0x62d3('0x20'),_0x7225fa+'-'+_0xd66ea1+'/'+_0x2fe3ee)['json'](_0x58f9e6);}return null;};}function patchUpdates(_0x3086d4){return function(_0x57e941){try{jsonpatch[_0x62d3('0x21')](_0x57e941,_0x3086d4,!![]);}catch(_0x364f7a){return BPromise[_0x62d3('0x22')](_0x364f7a);}return _0x57e941['save']();};}function saveUpdates(_0x4ff8ac,_0x3312e5){return function(_0x878997){if(_0x878997){return _0x878997['update'](_0x4ff8ac)[_0x62d3('0x23')](function(_0x774995){return _0x774995;});}return null;};}function removeEntity(_0x227981,_0x19d629){return function(_0x50a491){if(_0x50a491){return _0x50a491[_0x62d3('0x24')]()['then'](function(){_0x227981[_0x62d3('0x19')](0xcc)[_0x62d3('0x1a')]();});}};}function handleEntityNotFound(_0x4d6aca,_0x4e7bf9){return function(_0x4f0eeb){if(!_0x4f0eeb){_0x4d6aca['sendStatus'](0x194);}return _0x4f0eeb;};}function handleError(_0x177ac4,_0x432722){_0x432722=_0x432722||0x1f4;return function(_0x2dd7aa){logger['error'](_0x2dd7aa[_0x62d3('0x25')]);if(_0x2dd7aa[_0x62d3('0x26')]){delete _0x2dd7aa[_0x62d3('0x26')];}_0x177ac4[_0x62d3('0x19')](_0x432722)[_0x62d3('0x27')](_0x2dd7aa);};}exports[_0x62d3('0x28')]=function(_0x199e44,_0x52c8da){if(_0x199e44[_0x62d3('0x29')]['id']){delete _0x199e44['body']['id'];}return db['Action']['find']({'where':{'id':_0x199e44[_0x62d3('0x2a')]['id']}})[_0x62d3('0x23')](handleEntityNotFound(_0x52c8da,null))[_0x62d3('0x23')](saveUpdates(_0x199e44[_0x62d3('0x29')],null))['then'](respondWithResult(_0x52c8da,null))['catch'](handleError(_0x52c8da,null));};exports[_0x62d3('0x24')]=function(_0x5a7668,_0x47597d){return db[_0x62d3('0x2b')][_0x62d3('0x2c')]({'where':{'id':_0x5a7668['params']['id']}})[_0x62d3('0x23')](handleEntityNotFound(_0x47597d,null))[_0x62d3('0x23')](removeEntity(_0x47597d,null))['catch'](handleError(_0x47597d,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 247dbee..c8de35f 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 _0xa723=['moment','bluebird','request-promise','path','../../config/environment','./action.attributes','Action','tools_actions','lodash','../../config/logger','api'];(function(_0x2380b2,_0x4cf1cf){var _0x495c21=function(_0x4a70b8){while(--_0x4a70b8){_0x2380b2['push'](_0x2380b2['shift']());}};_0x495c21(++_0x4cf1cf);}(_0xa723,0x110));var _0x3a72=function(_0x1306f3,_0x1da761){_0x1306f3=_0x1306f3-0x0;var _0xc1c7bf=_0xa723[_0x1306f3];return _0xc1c7bf;};'use strict';var _=require(_0x3a72('0x0'));var util=require('util');var logger=require(_0x3a72('0x1'))(_0x3a72('0x2'));var moment=require(_0x3a72('0x3'));var BPromise=require(_0x3a72('0x4'));var rp=require(_0x3a72('0x5'));var fs=require('fs');var path=require(_0x3a72('0x6'));var rimraf=require('rimraf');var config=require(_0x3a72('0x7'));var attributes=require(_0x3a72('0x8'));module['exports']=function(_0x1bc9f6,_0x5a5536){return _0x1bc9f6['define'](_0x3a72('0x9'),attributes,{'tableName':_0x3a72('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6ff4=['request-promise','path','rimraf','../../config/environment','define','tools_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4326eb,_0x1801c5){var _0x2735a3=function(_0x4b1f8d){while(--_0x4b1f8d){_0x4326eb['push'](_0x4326eb['shift']());}};_0x2735a3(++_0x1801c5);}(_0x6ff4,0x1ce));var _0x46ff=function(_0x34ae6c,_0xbba594){_0x34ae6c=_0x34ae6c-0x0;var _0x29cc87=_0x6ff4[_0x34ae6c];return _0x29cc87;};'use strict';var _=require(_0x46ff('0x0'));var util=require(_0x46ff('0x1'));var logger=require(_0x46ff('0x2'))(_0x46ff('0x3'));var moment=require(_0x46ff('0x4'));var BPromise=require(_0x46ff('0x5'));var rp=require(_0x46ff('0x6'));var fs=require('fs');var path=require(_0x46ff('0x7'));var rimraf=require(_0x46ff('0x8'));var config=require(_0x46ff('0x9'));var attributes=require('./action.attributes');module['exports']=function(_0x2b6271,_0x1cfba1){return _0x2b6271[_0x46ff('0xa')]('Action',attributes,{'tableName':_0x46ff('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 be1384d..0ce75f2 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['info','Action,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x57fe81,_0x5ab32f){_0x57fe81=_0x57fe81-0x0;var _0x245330=_0x7a54[_0x57fe81];return _0x245330;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Action,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x58ab46,_0x197f7f){var _0x28c5f6=function(_0x320a59){while(--_0x320a59){_0x58ab46['push'](_0x58ab46['shift']());}};_0x28c5f6(++_0x197f7f);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x456032,_0x1a799d){_0x456032=_0x456032-0x0;var _0x1a53cd=_0x7fbe[_0x456032];return _0x1a53cd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index fe99cc6..531826d 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 _0x2a63=['../../components/auth/service','./action.controller','put','isAuthenticated','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2a3ee3,_0x45e68f){var _0x4a0b34=function(_0x368d7e){while(--_0x368d7e){_0x2a3ee3['push'](_0x2a3ee3['shift']());}};_0x4a0b34(++_0x45e68f);}(_0x2a63,0x79));var _0x32a6=function(_0x3bd4e5,_0x33854f){_0x3bd4e5=_0x3bd4e5-0x0;var _0x2d1522=_0x2a63[_0x3bd4e5];return _0x2d1522;};'use strict';var multer=require(_0x32a6('0x0'));var util=require(_0x32a6('0x1'));var path=require(_0x32a6('0x2'));var timeout=require(_0x32a6('0x3'));var express=require(_0x32a6('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x32a6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x32a6('0x6'));router[_0x32a6('0x7')]('/:id',auth[_0x32a6('0x8')](),controller[_0x32a6('0x9')]);router[_0x32a6('0xa')](_0x32a6('0xb'),auth[_0x32a6('0x8')](),controller[_0x32a6('0xc')]);module[_0x32a6('0xd')]=router;
\ No newline at end of file
+var _0xf9c0=['isAuthenticated','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf9c0,0x177));var _0x0f9c=function(_0xa4aae,_0x9e1982){_0xa4aae=_0xa4aae-0x0;var _0x3b4b91=_0xf9c0[_0xa4aae];return _0x3b4b91;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0f9c('0x0'));var timeout=require('connect-timeout');var express=require(_0x0f9c('0x1'));var router=express[_0x0f9c('0x2')]();var fs_extra=require(_0x0f9c('0x3'));var auth=require(_0x0f9c('0x4'));var interaction=require(_0x0f9c('0x5'));var config=require(_0x0f9c('0x6'));var controller=require('./action.controller');router[_0x0f9c('0x7')](_0x0f9c('0x8'),auth[_0x0f9c('0x9')](),controller['update']);router['delete'](_0x0f9c('0x8'),auth[_0x0f9c('0x9')](),controller[_0x0f9c('0xa')]);module[_0x0f9c('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 20f897d..554ae89 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xda19=['exports','STRING','TEXT'];(function(_0x262d98,_0x1236e9){var _0x38c0fb=function(_0x2d9835){while(--_0x2d9835){_0x262d98['push'](_0x262d98['shift']());}};_0x38c0fb(++_0x1236e9);}(_0xda19,0xd5));var _0x9da1=function(_0x1dfc71,_0x52cbd3){_0x1dfc71=_0x1dfc71-0x0;var _0x449188=_0xda19[_0x1dfc71];return _0x449188;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0xf24f30,_0x77205b){var _0x364bea=function(_0x562a10){while(--_0x562a10){_0xf24f30['push'](_0xf24f30['shift']());}};_0x364bea(++_0x77205b);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7995('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x7995('0x2')]},'conditions':{'type':Sequelize[_0x7995('0x3')]},'joins':{'type':Sequelize[_0x7995('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 10edd2d..1fee5d0 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 _0x1f80=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','show','params','length','options','find','catch','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','create','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','%s.%s\x20=\x20%s.%s','parse','output','web','fullPath','%s-%s.%s','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','runReport','IS\x20NULL','condition','getFields','AnalyticMetric','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js'];(function(_0x542a5d,_0x27e6c8){var _0x251378=function(_0x295247){while(--_0x295247){_0x542a5d['push'](_0x542a5d['shift']());}};_0x251378(++_0x27e6c8);}(_0x1f80,0x148));var _0x01f8=function(_0x2b92e2,_0x358e56){_0x2b92e2=_0x2b92e2-0x0;var _0x2b88a9=_0x1f80[_0x2b92e2];return _0x2b88a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x01f8('0x0'));var zipdir=require(_0x01f8('0x1'));var jsonpatch=require(_0x01f8('0x2'));var rp=require(_0x01f8('0x3'));var moment=require(_0x01f8('0x4'));var BPromise=require(_0x01f8('0x5'));var Mustache=require(_0x01f8('0x6'));var util=require(_0x01f8('0x7'));var path=require(_0x01f8('0x8'));var sox=require(_0x01f8('0x9'));var csv=require(_0x01f8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x01f8('0xb'));var squel=require('squel');var crypto=require(_0x01f8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x01f8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x01f8('0xe'));var Redis=require(_0x01f8('0xf'));var authService=require(_0x01f8('0x10'));var qs=require(_0x01f8('0x11'));var as=require(_0x01f8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x01f8('0x13'))(_0x01f8('0x14'));var utils=require(_0x01f8('0x15'));var config=require(_0x01f8('0x16'));var licenseUtil=require(_0x01f8('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x01f8('0x18'))[_0x01f8('0x19')];function respondWithStatusCode(_0x1d399f,_0x52cf79){_0x52cf79=_0x52cf79||0xcc;return function(_0x275efc){if(_0x275efc){return _0x1d399f['sendStatus'](_0x52cf79);}return _0x1d399f[_0x01f8('0x1a')](_0x52cf79)[_0x01f8('0x1b')]();};}function respondWithResult(_0x409cbd,_0x448d06){_0x448d06=_0x448d06||0xc8;return function(_0x115a73){if(_0x115a73){return _0x409cbd[_0x01f8('0x1a')](_0x448d06)[_0x01f8('0x1c')](_0x115a73);}};}function respondWithFilteredResult(_0x5a3ed5,_0x48166c){return function(_0x3f46da){if(_0x3f46da){var _0x19724d=typeof _0x48166c[_0x01f8('0x1d')]===_0x01f8('0x1e')&&typeof _0x48166c[_0x01f8('0x1f')]===_0x01f8('0x1e');var _0x352854=_0x3f46da[_0x01f8('0x20')];var _0x46380c=_0x19724d?0x0:_0x48166c[_0x01f8('0x1d')];var _0x4d3b0c=_0x19724d?_0x3f46da[_0x01f8('0x20')]:_0x48166c[_0x01f8('0x1d')]+_0x48166c[_0x01f8('0x1f')];var _0x5d8a77;if(_0x4d3b0c>=_0x352854){_0x4d3b0c=_0x352854;_0x5d8a77=0xc8;}else{_0x5d8a77=0xce;}_0x5a3ed5[_0x01f8('0x1a')](_0x5d8a77);return _0x5a3ed5[_0x01f8('0x21')](_0x01f8('0x22'),_0x46380c+'-'+_0x4d3b0c+'/'+_0x352854)[_0x01f8('0x1c')](_0x3f46da);}return null;};}function patchUpdates(_0x26f3bb){return function(_0x3428f9){try{jsonpatch[_0x01f8('0x23')](_0x3428f9,_0x26f3bb,!![]);}catch(_0x26e623){return BPromise[_0x01f8('0x24')](_0x26e623);}return _0x3428f9[_0x01f8('0x25')]();};}function saveUpdates(_0x5d511d,_0x2b0755){return function(_0x5183f6){if(_0x5183f6){return _0x5183f6[_0x01f8('0x26')](_0x5d511d)[_0x01f8('0x27')](function(_0x2d4d3f){return _0x2d4d3f;});}return null;};}function removeEntity(_0x376487,_0x274158){return function(_0x3b3b32){if(_0x3b3b32){return _0x3b3b32['destroy']()[_0x01f8('0x27')](function(){var _0x33552a=_0x3b3b32[_0x01f8('0x28')]({'plain':!![]});var _0x3cd8ed='CustomReports';return db[_0x01f8('0x29')][_0x01f8('0x2a')]({'where':{'type':_0x3cd8ed,'resourceId':_0x33552a['id']}})['then'](function(){return _0x3b3b32;});})['then'](function(){_0x376487[_0x01f8('0x1a')](0xcc)[_0x01f8('0x1b')]();});}};}function handleEntityNotFound(_0xf48611,_0x309714){return function(_0xbd5d79){if(!_0xbd5d79){_0xf48611[_0x01f8('0x2b')](0x194);}return _0xbd5d79;};}function handleError(_0xbc9495,_0x2a8dce){_0x2a8dce=_0x2a8dce||0x1f4;return function(_0x22d8a5){logger['error'](_0x22d8a5[_0x01f8('0x2c')]);if(_0x22d8a5[_0x01f8('0x2d')]){delete _0x22d8a5[_0x01f8('0x2d')];}_0xbc9495[_0x01f8('0x1a')](_0x2a8dce)[_0x01f8('0x2e')](_0x22d8a5);};}exports[_0x01f8('0x2f')]=function(_0x5e05e4,_0x59eea1){var _0x26056b={},_0x324a2c={},_0x531afa={'count':0x0,'rows':[]};var _0x48dcea=_[_0x01f8('0x30')](db[_0x01f8('0x31')][_0x01f8('0x32')],function(_0x118973){return{'name':_0x118973['fieldName'],'type':_0x118973['type'][_0x01f8('0x33')]};});_0x324a2c[_0x01f8('0x34')]=_[_0x01f8('0x30')](_0x48dcea,'name');_0x324a2c[_0x01f8('0x35')]=_[_0x01f8('0x36')](_0x5e05e4[_0x01f8('0x35')]);_0x324a2c['filters']=_[_0x01f8('0x37')](_0x324a2c['model'],_0x324a2c[_0x01f8('0x35')]);_0x26056b['attributes']=_[_0x01f8('0x37')](_0x324a2c[_0x01f8('0x34')],qs[_0x01f8('0x38')](_0x5e05e4[_0x01f8('0x35')]['fields']));_0x26056b['attributes']=_0x26056b[_0x01f8('0x39')]['length']?_0x26056b[_0x01f8('0x39')]:_0x324a2c['model'];if(!_0x5e05e4[_0x01f8('0x35')][_0x01f8('0x3a')]('nolimit')){_0x26056b[_0x01f8('0x1f')]=qs[_0x01f8('0x1f')](_0x5e05e4[_0x01f8('0x35')]['limit']);_0x26056b['offset']=qs[_0x01f8('0x1d')](_0x5e05e4[_0x01f8('0x35')][_0x01f8('0x1d')]);}_0x26056b[_0x01f8('0x3b')]=qs[_0x01f8('0x3c')](_0x5e05e4['query'][_0x01f8('0x3c')]);_0x26056b[_0x01f8('0x3d')]=qs[_0x01f8('0x3e')](_[_0x01f8('0x3f')](_0x5e05e4[_0x01f8('0x35')],_0x324a2c[_0x01f8('0x3e')]),_0x48dcea);if(_0x5e05e4[_0x01f8('0x35')][_0x01f8('0x40')]){_0x26056b[_0x01f8('0x3d')]=_['merge'](_0x26056b[_0x01f8('0x3d')],{'$or':_['map'](_0x48dcea,function(_0x550280){if(_0x550280[_0x01f8('0x41')]!==_0x01f8('0x42')){var _0x472027={};_0x472027[_0x550280[_0x01f8('0x2d')]]={'$like':'%'+_0x5e05e4[_0x01f8('0x35')]['filter']+'%'};return _0x472027;}})});}_0x26056b=_[_0x01f8('0x43')]({},_0x26056b,_0x5e05e4['options']);var _0x4e0681={'where':_0x26056b[_0x01f8('0x3d')]};return db[_0x01f8('0x31')]['count'](_0x4e0681)[_0x01f8('0x27')](function(_0x4efb32){_0x531afa[_0x01f8('0x20')]=_0x4efb32;if(_0x5e05e4['query'][_0x01f8('0x44')]){_0x26056b[_0x01f8('0x45')]=[{'all':!![]}];}return db[_0x01f8('0x31')][_0x01f8('0x46')](_0x26056b);})[_0x01f8('0x27')](function(_0xa01131){_0x531afa['rows']=_0xa01131;return _0x531afa;})[_0x01f8('0x27')](respondWithFilteredResult(_0x59eea1,_0x26056b))['catch'](handleError(_0x59eea1,null));};exports[_0x01f8('0x47')]=function(_0x145335,_0x4fefdc){var _0x1fdf51={'raw':![],'where':{'id':_0x145335[_0x01f8('0x48')]['id']}},_0xbb858d={};_0xbb858d[_0x01f8('0x34')]=_[_0x01f8('0x36')](db[_0x01f8('0x31')]['rawAttributes']);_0xbb858d[_0x01f8('0x35')]=_['keys'](_0x145335[_0x01f8('0x35')]);_0xbb858d[_0x01f8('0x3e')]=_[_0x01f8('0x37')](_0xbb858d[_0x01f8('0x34')],_0xbb858d[_0x01f8('0x35')]);_0x1fdf51[_0x01f8('0x39')]=_[_0x01f8('0x37')](_0xbb858d[_0x01f8('0x34')],qs[_0x01f8('0x38')](_0x145335[_0x01f8('0x35')][_0x01f8('0x38')]));_0x1fdf51[_0x01f8('0x39')]=_0x1fdf51[_0x01f8('0x39')][_0x01f8('0x49')]?_0x1fdf51[_0x01f8('0x39')]:_0xbb858d[_0x01f8('0x34')];if(_0x145335[_0x01f8('0x35')][_0x01f8('0x44')]){_0x1fdf51[_0x01f8('0x45')]=[{'all':!![]}];}_0x1fdf51=_[_0x01f8('0x43')]({},_0x1fdf51,_0x145335[_0x01f8('0x4a')]);return db[_0x01f8('0x31')][_0x01f8('0x4b')](_0x1fdf51)['then'](handleEntityNotFound(_0x4fefdc,null))['then'](respondWithResult(_0x4fefdc,null))[_0x01f8('0x4c')](handleError(_0x4fefdc,null));};exports['create']=function(_0x16e9c3,_0x3eefda){return db[_0x01f8('0x31')]['create'](_0x16e9c3[_0x01f8('0x4d')],{})[_0x01f8('0x27')](function(_0x3625ef){var _0x1683b7=_0x16e9c3[_0x01f8('0x4e')][_0x01f8('0x28')]({'plain':!![]});if(!_0x1683b7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1683b7[_0x01f8('0x4f')]===_0x01f8('0x4e')){var _0x22224f=_0x3625ef[_0x01f8('0x28')]({'plain':!![]});var _0x45c431=_0x01f8('0x50');return db[_0x01f8('0x51')][_0x01f8('0x4b')]({'where':{'name':_0x45c431,'userProfileId':_0x1683b7[_0x01f8('0x52')]},'raw':!![]})['then'](function(_0xa15265){if(_0xa15265&&_0xa15265[_0x01f8('0x53')]===0x0){return db[_0x01f8('0x29')][_0x01f8('0x54')]({'name':_0x22224f[_0x01f8('0x2d')],'resourceId':_0x22224f['id'],'type':_0x01f8('0x55'),'sectionId':_0xa15265['id']},{})[_0x01f8('0x27')](function(){return _0x3625ef;});}else{return _0x3625ef;}})[_0x01f8('0x4c')](function(_0x4b1ce0){logger[_0x01f8('0x56')](_0x01f8('0x57'),_0x4b1ce0);throw _0x4b1ce0;});}return _0x3625ef;})[_0x01f8('0x27')](respondWithResult(_0x3eefda,0xc9))['catch'](handleError(_0x3eefda,null));};exports[_0x01f8('0x26')]=function(_0x5e328d,_0x5d8ad9){if(_0x5e328d[_0x01f8('0x4d')]['id']){delete _0x5e328d[_0x01f8('0x4d')]['id'];}return db['AnalyticCustomReport'][_0x01f8('0x4b')]({'where':{'id':_0x5e328d[_0x01f8('0x48')]['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0x5d8ad9,null))[_0x01f8('0x27')](saveUpdates(_0x5e328d[_0x01f8('0x4d')],null))['then'](respondWithResult(_0x5d8ad9,null))['catch'](handleError(_0x5d8ad9,null));};exports['destroy']=function(_0x30d396,_0x548348){return db[_0x01f8('0x31')][_0x01f8('0x4b')]({'where':{'id':_0x30d396[_0x01f8('0x48')]['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0x548348,null))[_0x01f8('0x27')](removeEntity(_0x548348,null))[_0x01f8('0x4c')](handleError(_0x548348,null));};exports[_0x01f8('0x58')]=function(_0x4124af,_0x8904c2){var _0x40a3b9=0xa;var _0x8d8f4f=['join','left_join','right_join','cross_join'];var _0x4cb98a={'SUM':'SUM(%s)','COUNT':_0x01f8('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x01f8('0x5a'),'MIN':_0x01f8('0x5b'),'AVG':_0x01f8('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x01f8('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x33bc22={'SEC_TO_TIME':_0x01f8('0x5e'),'DATE':_0x01f8('0x5f'),'HOUR':_0x01f8('0x60'),'ROUND':_0x01f8('0x61'),'UNIX_TIMESTAMP':_0x01f8('0x62')};var _0xc67043=function(_0x3c075f){return!_[_0x01f8('0x63')](['IS\x20NULL',_0x01f8('0x64'),'IS\x20EMPTY',_0x01f8('0x65')],_0x3c075f);};var _0x23d2ec=function(_0x503a87){if(!_0x503a87||!_0x503a87[_0x01f8('0x66')][_0x01f8('0x49')]){return'';}for(var _0x5d943c='(',_0x5b5016=0x0;_0x5b5016<_0x503a87[_0x01f8('0x66')][_0x01f8('0x49')];_0x5b5016+=0x1){_0x5b5016>0x0&&(_0x5d943c+='\x20'+_0x503a87[_0x01f8('0x67')]+'\x20');_0x5d943c+=_0x503a87['rules'][_0x5b5016][_0x01f8('0x68')]?_0x23d2ec(_0x503a87[_0x01f8('0x66')][_0x5b5016][_0x01f8('0x68')]):_0x503a87[_0x01f8('0x66')][_0x5b5016][_0x01f8('0x69')]+'\x20'+_0x503a87[_0x01f8('0x66')][_0x5b5016]['condition']+(_0xc67043(_0x503a87[_0x01f8('0x66')][_0x5b5016]['condition'])?'\x20'+_0x503a87[_0x01f8('0x66')][_0x5b5016][_0x01f8('0x6a')]:'');}return _0x5d943c+')';};var _0xab3670={'where':{'id':_0x4124af[_0x01f8('0x48')]['id']}},_0x42a289,_0x44d255,_0x1f73f9,_0x468a09,_0x6ff0ea;_0xab3670=_[_0x01f8('0x43')]({},_0xab3670,_0x4124af[_0x01f8('0x4a')]);return db[_0x01f8('0x31')][_0x01f8('0x4b')](_0xab3670)[_0x01f8('0x27')](function(_0x206e14){if(_0x206e14){_0x42a289=_0x206e14;return _0x206e14['getFields']();}return null;})[_0x01f8('0x27')](function(_0x181273){if(_0x181273){if(!_0x181273['length']){throw new db[(_0x01f8('0x6b'))][(_0x01f8('0x6c'))](_0x01f8('0x6d'),0x193);}_0x44d255=_0x181273;return db['AnalyticMetric'][_0x01f8('0x46')]({'raw':!![]});}return null;})[_0x01f8('0x27')](function(_0x435058){if(_0x435058){_0x1f73f9=_[_0x01f8('0x6e')](_0x435058,'id');var _0x4201c7;var _0x5d04ed=squel[_0x01f8('0x6f')]();_0x5d04ed[_0x01f8('0x70')](_0x42a289[_0x01f8('0x71')]);for(var _0x27823e=0x0;_0x27823e<_0x44d255[_0x01f8('0x49')];_0x27823e+=0x1){_0x4201c7=_0x44d255[_0x27823e]['MetricId']?_0x1f73f9[_0x44d255[_0x27823e][_0x01f8('0x72')]][_0x01f8('0x73')]:_0x44d255[_0x27823e][_0x01f8('0x69')];_0x4201c7=_0x44d255[_0x27823e][_0x01f8('0x74')]?_[_0x01f8('0x75')](_0x4cb98a[_0x44d255[_0x27823e][_0x01f8('0x74')]],'%s',_0x4201c7):_0x4201c7;_0x4201c7=_0x44d255[_0x27823e]['format']?_['replace'](_0x33bc22[_0x44d255[_0x27823e][_0x01f8('0x76')]],'%s',_0x4201c7):_0x4201c7;if(_0x44d255[_0x27823e][_0x01f8('0x77')]){_0x5d04ed[_0x01f8('0x68')](_0x4201c7);}_0x44d255[_0x27823e]['orderBy']&&_0x5d04ed[_0x01f8('0x3b')](_0x4201c7,_0x44d255[_0x27823e][_0x01f8('0x78')]===_0x01f8('0x79')?![]:!![]);_0x5d04ed[_0x01f8('0x69')](_0x4201c7,_0x44d255[_0x27823e][_0x01f8('0x7a')]||_0x4201c7);}if(_0x42a289[_0x01f8('0x7b')]){_0x42a289['joins']=JSON['parse'](_0x42a289['joins']);for(var _0x39bf02=0x0;_0x39bf02<_0x42a289[_0x01f8('0x7b')][_0x01f8('0x49')];_0x39bf02+=0x1){if(_0x42a289[_0x01f8('0x7b')][_0x39bf02]['type']&&_[_0x01f8('0x63')](_0x8d8f4f,_0x42a289[_0x01f8('0x7b')][_0x39bf02][_0x01f8('0x41')])&&_0x42a289[_0x01f8('0x7b')][_0x39bf02][_0x01f8('0x7c')]&&_0x42a289[_0x01f8('0x7b')][_0x39bf02][_0x01f8('0x7d')]&&_0x42a289[_0x01f8('0x7b')][_0x39bf02]['foreignKey']){_0x5d04ed[_0x42a289[_0x01f8('0x7b')][_0x39bf02]['type']](_0x42a289[_0x01f8('0x7b')][_0x39bf02][_0x01f8('0x7d')],null,util[_0x01f8('0x76')]('%s.%s\x20=\x20%s.%s',_0x42a289['table'],_0x42a289[_0x01f8('0x7b')][_0x39bf02][_0x01f8('0x7c')],_0x42a289[_0x01f8('0x7b')][_0x39bf02][_0x01f8('0x7d')],_0x42a289[_0x01f8('0x7b')][_0x39bf02][_0x01f8('0x7e')]));}}}if(_0x42a289['conditions']){_0x42a289['conditions']=JSON['parse'](_0x42a289[_0x01f8('0x7f')]);_0x5d04ed[_0x01f8('0x3d')](_0x23d2ec(_0x42a289['conditions'][_0x01f8('0x68')]));}_0x6ff0ea=_0x5d04ed[_0x01f8('0x80')]();_0x5d04ed[_0x01f8('0x1f')](_0x40a3b9);_0x5d04ed[_0x01f8('0x1d')](0x0);logger[_0x01f8('0x81')](_0x01f8('0x82'),_0x5d04ed['toString']());return dbH[_0x01f8('0x83')][_0x01f8('0x35')](_0x5d04ed[_0x01f8('0x84')](),{'type':dbH['sequelize'][_0x01f8('0x85')][_0x01f8('0x86')]});}})[_0x01f8('0x27')](respondWithResult(_0x8904c2,null))['catch'](handleError(_0x8904c2,null));};function runReport(_0x13ac9a,_0x507866,_0x2ed107){var _0x15f817=_0x507866[_0x01f8('0x2d')];var _0x1d2de2=0xa;var _0x2a5ee4=[_0x01f8('0x87'),_0x01f8('0x88'),_0x01f8('0x89'),_0x01f8('0x8a')];var _0x5c37d8={'SUM':_0x01f8('0x8b'),'COUNT':_0x01f8('0x59'),'COUNT DISTINCT':_0x01f8('0x8c'),'MAX':'MAX(%s)','MIN':_0x01f8('0x5b'),'AVG':_0x01f8('0x5c'),'GROUP_CONCAT':_0x01f8('0x8d'),'GROUP_CONCAT ASC':_0x01f8('0x5d'),'GROUP_CONCAT DESC':_0x01f8('0x8e')};var _0x3fec1c={'SEC_TO_TIME':_0x01f8('0x5e'),'DATE':_0x01f8('0x5f'),'HOUR':_0x01f8('0x60'),'ROUND':_0x01f8('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x44be26=function(_0x3f7409){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x01f8('0x8f'),_0x01f8('0x65')],_0x3f7409);};var _0x352ab0=function(_0x123ebb){if(!_0x123ebb||!_0x123ebb[_0x01f8('0x66')][_0x01f8('0x49')]){return'';}for(var _0x46c4bf='(',_0x1c2c2d=0x0;_0x1c2c2d<_0x123ebb[_0x01f8('0x66')][_0x01f8('0x49')];_0x1c2c2d+=0x1){_0x1c2c2d>0x0&&(_0x46c4bf+='\x20'+_0x123ebb[_0x01f8('0x67')]+'\x20');_0x46c4bf+=_0x123ebb[_0x01f8('0x66')][_0x1c2c2d][_0x01f8('0x68')]?_0x352ab0(_0x123ebb['rules'][_0x1c2c2d]['group']):_0x123ebb[_0x01f8('0x66')][_0x1c2c2d]['field']+'\x20'+_0x123ebb['rules'][_0x1c2c2d]['condition']+(_0x44be26(_0x123ebb[_0x01f8('0x66')][_0x1c2c2d]['condition'])?'\x20'+_0x123ebb['rules'][_0x1c2c2d]['value']:'');}return _0x46c4bf+')';};var _0xa7f724={'where':{'id':_0x13ac9a['id']}},_0x123339,_0x20ae16,_0x242108,_0x57b0ce,_0x166cce;_0xa7f724=_['merge']({},_0xa7f724,_0x2ed107);return db['AnalyticCustomReport']['find'](_0xa7f724)[_0x01f8('0x27')](function(_0x138118){if(_0x138118){_0x123339=_0x138118;return _0x138118['getFields']();}return null;})['then'](function(_0x18a466){if(_0x18a466){if(!_0x18a466[_0x01f8('0x49')]){throw new db[(_0x01f8('0x6b'))][(_0x01f8('0x6c'))](_0x01f8('0x6d'),0x193);}_0x20ae16=_0x18a466;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x01f8('0x27')](function(_0x20b890){if(_0x20b890){_0x242108=_[_0x01f8('0x6e')](_0x20b890,'id');var _0x168bc5;var _0x414932=squel[_0x01f8('0x6f')]();_0x414932[_0x01f8('0x70')](_0x123339['table']);for(var _0x5be240=0x0;_0x5be240<_0x20ae16[_0x01f8('0x49')];_0x5be240+=0x1){_0x168bc5=_0x20ae16[_0x5be240][_0x01f8('0x72')]?_0x242108[_0x20ae16[_0x5be240][_0x01f8('0x72')]][_0x01f8('0x73')]:_0x20ae16[_0x5be240][_0x01f8('0x69')];_0x168bc5=_0x20ae16[_0x5be240][_0x01f8('0x74')]?_['replace'](_0x5c37d8[_0x20ae16[_0x5be240][_0x01f8('0x74')]],'%s',_0x168bc5):_0x168bc5;_0x168bc5=_0x20ae16[_0x5be240][_0x01f8('0x76')]?_[_0x01f8('0x75')](_0x3fec1c[_0x20ae16[_0x5be240][_0x01f8('0x76')]],'%s',_0x168bc5):_0x168bc5;if(_0x20ae16[_0x5be240]['groupBy']){_0x414932[_0x01f8('0x68')](_0x168bc5);}_0x20ae16[_0x5be240][_0x01f8('0x78')]&&_0x414932[_0x01f8('0x3b')](_0x168bc5,_0x20ae16[_0x5be240][_0x01f8('0x78')]===_0x01f8('0x79')?![]:!![]);_0x414932[_0x01f8('0x69')](_0x168bc5,_0x20ae16[_0x5be240]['alias']||_0x168bc5);}if(_0x123339[_0x01f8('0x7b')]){_0x123339['joins']=JSON['parse'](_0x123339[_0x01f8('0x7b')]);for(var _0x33c101=0x0;_0x33c101<_0x123339[_0x01f8('0x7b')]['length'];_0x33c101+=0x1){if(_0x123339[_0x01f8('0x7b')][_0x33c101]['type']&&_['includes'](_0x2a5ee4,_0x123339[_0x01f8('0x7b')][_0x33c101][_0x01f8('0x41')])&&_0x123339['joins'][_0x33c101][_0x01f8('0x7c')]&&_0x123339[_0x01f8('0x7b')][_0x33c101][_0x01f8('0x7d')]&&_0x123339[_0x01f8('0x7b')][_0x33c101][_0x01f8('0x7e')]){_0x414932[_0x123339['joins'][_0x33c101]['type']](_0x123339['joins'][_0x33c101][_0x01f8('0x7d')],null,util[_0x01f8('0x76')](_0x01f8('0x90'),_0x123339[_0x01f8('0x71')],_0x123339[_0x01f8('0x7b')][_0x33c101][_0x01f8('0x7c')],_0x123339['joins'][_0x33c101]['foreignTable'],_0x123339[_0x01f8('0x7b')][_0x33c101][_0x01f8('0x7e')]));}}}if(_0x123339['conditions']){_0x123339['conditions']=JSON[_0x01f8('0x91')](_0x123339[_0x01f8('0x7f')]);_0x414932[_0x01f8('0x3d')](_0x352ab0(_0x123339[_0x01f8('0x7f')][_0x01f8('0x68')]));}_0x166cce=_0x414932[_0x01f8('0x80')]();_0x414932[_0x01f8('0x1f')](_0x1d2de2);_0x414932[_0x01f8('0x1d')](0x0);return;}})[_0x01f8('0x27')](function(){if(_0x507866[_0x01f8('0x92')]===_0x01f8('0x93')){return null;}var _0x2d2530=_['merge'](_0x507866,{'name':_0x507866[_0x01f8('0x94')]||_0x507866[_0x01f8('0x2d')]||_0x123339[_0x01f8('0x2d')],'basename':_0x15f817,'savename':util[_0x01f8('0x76')](_0x01f8('0x95'),_0x507866['name']||_0x123339['name'],require('randomstring')[_0x01f8('0x96')](0x4),_0x507866[_0x01f8('0x92')]||_0x01f8('0x97')),'reportId':_0x123339['id'],'reportType':'custom'});return db[_0x01f8('0x98')]['create'](_0x2d2530,{'raw':!![]});})[_0x01f8('0x27')](function(_0x9f5f0a){if(_0x123339[_0x01f8('0x71')]===_0x01f8('0x99')){_0x166cce[_0x01f8('0x3d')](_0x123339[_0x01f8('0x71')]+_0x01f8('0x9a'),_0x507866['startDate'],_0x507866[_0x01f8('0x9b')]);}else{_0x166cce[_0x01f8('0x3d')](_0x123339[_0x01f8('0x71')]+_0x01f8('0x9c'),_0x507866[_0x01f8('0x9d')],_0x507866[_0x01f8('0x9b')]);}if(_0x9f5f0a){logger[_0x01f8('0x9e')](_0x01f8('0x9f'),_0x166cce[_0x01f8('0x84')]());require(_0x01f8('0xa0'))[_0x01f8('0xa1')](path['join'](__dirname,'../../components/export/',_0x9f5f0a[_0x01f8('0x92')]),[_0x9f5f0a['id'],_0x166cce[_0x01f8('0x84')](),path[_0x01f8('0x87')](__dirname,_0x01f8('0xa2'),_0x9f5f0a[_0x01f8('0xa3')]),_0x15f817]);return _0x9f5f0a;}else{var _0x1eeea0=squel[_0x01f8('0x6f')]();_0x1eeea0[_0x01f8('0x70')]('('+_0x166cce[_0x01f8('0x84')]()+')',_0x01f8('0xa4'));_0x1eeea0[_0x01f8('0x69')](_0x01f8('0xa5'),_0x01f8('0x20'));_0x166cce['limit'](_0x507866[_0x01f8('0x1f')]||_0x1d2de2);_0x166cce[_0x01f8('0x1d')](_0x507866['offset']||0x0);return dbH[_0x01f8('0x83')][_0x01f8('0x35')](_0x1eeea0['toString'](),{'type':dbH[_0x01f8('0x83')][_0x01f8('0x85')]['SELECT']})[_0x01f8('0x27')](function(_0x345417){if(!_0x345417[_0x01f8('0x49')]){_0x57b0ce=0x0;}else{_0x57b0ce=_0x345417[0x0][_0x01f8('0x20')]||0x0;}return dbH['sequelize'][_0x01f8('0x35')](_0x166cce[_0x01f8('0x84')](),{'type':dbH[_0x01f8('0x83')][_0x01f8('0x85')][_0x01f8('0x86')]});})[_0x01f8('0x27')](function(_0x43eb31){return{'rows':_0x43eb31||[],'count':_0x57b0ce};});}});}exports['run']=function(_0x14e0b7,_0x4a31a7){return runReport(_0x14e0b7[_0x01f8('0x48')],_0x14e0b7[_0x01f8('0x35')],_0x14e0b7[_0x01f8('0x4a')])['then'](respondWithResult(_0x4a31a7,null))[_0x01f8('0x4c')](handleError(_0x4a31a7,null));};exports[_0x01f8('0xa6')]=runReport;exports[_0x01f8('0x35')]=function(_0x2af8b8,_0x54004c){var _0x19033d=0xa;var _0x3f062e=[_0x01f8('0x87'),_0x01f8('0x88'),_0x01f8('0x89'),_0x01f8('0x8a')];var _0x48bf68={'SUM':_0x01f8('0x8b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x01f8('0x8c'),'MAX':_0x01f8('0x5a'),'MIN':_0x01f8('0x5b'),'AVG':_0x01f8('0x5c'),'GROUP_CONCAT':_0x01f8('0x8d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x01f8('0x8e')};var _0x4ddc14={'SEC_TO_TIME':_0x01f8('0x5e'),'DATE':_0x01f8('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x01f8('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x186cd0=function(_0x27fc5d){return!_[_0x01f8('0x63')]([_0x01f8('0xa7'),_0x01f8('0x64'),_0x01f8('0x8f'),_0x01f8('0x65')],_0x27fc5d);};var _0x5f4748=function(_0x4b5fa6){if(!_0x4b5fa6||!_0x4b5fa6[_0x01f8('0x66')][_0x01f8('0x49')]){return'';}for(var _0x1f79ce='(',_0x6e257=0x0;_0x6e257<_0x4b5fa6['rules']['length'];_0x6e257+=0x1){_0x6e257>0x0&&(_0x1f79ce+='\x20'+_0x4b5fa6[_0x01f8('0x67')]+'\x20');_0x1f79ce+=_0x4b5fa6[_0x01f8('0x66')][_0x6e257][_0x01f8('0x68')]?_0x5f4748(_0x4b5fa6[_0x01f8('0x66')][_0x6e257]['group']):_0x4b5fa6['rules'][_0x6e257][_0x01f8('0x69')]+'\x20'+_0x4b5fa6['rules'][_0x6e257]['condition']+(_0x186cd0(_0x4b5fa6[_0x01f8('0x66')][_0x6e257][_0x01f8('0xa8')])?'\x20'+_0x4b5fa6[_0x01f8('0x66')][_0x6e257][_0x01f8('0x6a')]:'');}return _0x1f79ce+')';};var _0x4be8b8={'where':{'id':_0x2af8b8[_0x01f8('0x48')]['id']}},_0xa5b068,_0x941b9f,_0x456eaa,_0x3668e8,_0x1f5319;_0x4be8b8=_[_0x01f8('0x43')]({},_0x4be8b8,_0x2af8b8[_0x01f8('0x4a')]);return db[_0x01f8('0x31')]['find'](_0x4be8b8)[_0x01f8('0x27')](function(_0x14d3d8){if(_0x14d3d8){_0xa5b068=_0x14d3d8;return _0x14d3d8[_0x01f8('0xa9')]();}return null;})[_0x01f8('0x27')](function(_0x4003b0){if(_0x4003b0){if(!_0x4003b0[_0x01f8('0x49')]){throw new db[(_0x01f8('0x6b'))][(_0x01f8('0x6c'))](_0x01f8('0x6d'),0x193);}_0x941b9f=_0x4003b0;return db[_0x01f8('0xaa')][_0x01f8('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3758ad){if(_0x3758ad){_0x456eaa=_['keyBy'](_0x3758ad,'id');var _0x3fa75c;var _0xbaa87e=squel['select']();_0xbaa87e[_0x01f8('0x70')](_0xa5b068[_0x01f8('0x71')]);for(var _0x38ce79=0x0;_0x38ce79<_0x941b9f['length'];_0x38ce79+=0x1){_0x3fa75c=_0x941b9f[_0x38ce79][_0x01f8('0x72')]?_0x456eaa[_0x941b9f[_0x38ce79][_0x01f8('0x72')]][_0x01f8('0x73')]:_0x941b9f[_0x38ce79][_0x01f8('0x69')];_0x3fa75c=_0x941b9f[_0x38ce79][_0x01f8('0x74')]?_[_0x01f8('0x75')](_0x48bf68[_0x941b9f[_0x38ce79][_0x01f8('0x74')]],'%s',_0x3fa75c):_0x3fa75c;_0x3fa75c=_0x941b9f[_0x38ce79][_0x01f8('0x76')]?_[_0x01f8('0x75')](_0x4ddc14[_0x941b9f[_0x38ce79]['format']],'%s',_0x3fa75c):_0x3fa75c;if(_0x941b9f[_0x38ce79][_0x01f8('0x77')]){_0xbaa87e[_0x01f8('0x68')](_0x3fa75c);}_0x941b9f[_0x38ce79][_0x01f8('0x78')]&&_0xbaa87e[_0x01f8('0x3b')](_0x3fa75c,_0x941b9f[_0x38ce79][_0x01f8('0x78')]===_0x01f8('0x79')?![]:!![]);_0xbaa87e[_0x01f8('0x69')](_0x3fa75c,_0x941b9f[_0x38ce79]['alias']||_0x3fa75c);}if(_0xa5b068[_0x01f8('0x7b')]){_0xa5b068[_0x01f8('0x7b')]=JSON[_0x01f8('0x91')](_0xa5b068[_0x01f8('0x7b')]);for(var _0x3cb003=0x0;_0x3cb003<_0xa5b068[_0x01f8('0x7b')][_0x01f8('0x49')];_0x3cb003+=0x1){if(_0xa5b068[_0x01f8('0x7b')][_0x3cb003][_0x01f8('0x41')]&&_[_0x01f8('0x63')](_0x3f062e,_0xa5b068[_0x01f8('0x7b')][_0x3cb003][_0x01f8('0x41')])&&_0xa5b068[_0x01f8('0x7b')][_0x3cb003][_0x01f8('0x7c')]&&_0xa5b068[_0x01f8('0x7b')][_0x3cb003]['foreignTable']&&_0xa5b068['joins'][_0x3cb003][_0x01f8('0x7e')]){_0xbaa87e[_0xa5b068['joins'][_0x3cb003][_0x01f8('0x41')]](_0xa5b068[_0x01f8('0x7b')][_0x3cb003][_0x01f8('0x7d')],null,util[_0x01f8('0x76')]('%s.%s\x20=\x20%s.%s',_0xa5b068[_0x01f8('0x71')],_0xa5b068['joins'][_0x3cb003]['parentKey'],_0xa5b068[_0x01f8('0x7b')][_0x3cb003][_0x01f8('0x7d')],_0xa5b068[_0x01f8('0x7b')][_0x3cb003][_0x01f8('0x7e')]));}}}if(_0xa5b068[_0x01f8('0x7f')]){_0xa5b068[_0x01f8('0x7f')]=JSON[_0x01f8('0x91')](_0xa5b068[_0x01f8('0x7f')]);_0xbaa87e['where'](_0x5f4748(_0xa5b068[_0x01f8('0x7f')]['group']));}_0x1f5319=_0xbaa87e[_0x01f8('0x80')]();_0xbaa87e[_0x01f8('0x1f')](_0x19033d);_0xbaa87e[_0x01f8('0x1d')](0x0);logger[_0x01f8('0x81')](_0x01f8('0x82'),_0xbaa87e[_0x01f8('0x84')]());return dbH[_0x01f8('0x83')][_0x01f8('0x35')](_0xbaa87e[_0x01f8('0x84')](),{'type':dbH[_0x01f8('0x83')]['QueryTypes']['SELECT']});}})[_0x01f8('0x27')](function(){return{'sql':_0x1f5319['toString']()};})[_0x01f8('0x27')](respondWithResult(_0x54004c,null))[_0x01f8('0x4c')](handleError(_0x54004c,null));};
\ No newline at end of file
+var _0xc9d8=['end','status','offset','undefined','limit','count','set','Content-Range','json','save','destroy','then','CustomReports','UserProfileResource','error','name','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','left_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','groupBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','right_join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','Sequelize','keyBy','orderBy','order','output','web','fullPath','%s-%s.%s','randomstring','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','run','COUNT(DISTINCT\x20%s)','IS\x20EMPTY','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','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','../../config/environment','../../mysqldb','sendStatus'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xc9d8,0x138));var _0x8c9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc9d8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8c9d('0x0'));var rimraf=require(_0x8c9d('0x1'));var zipdir=require(_0x8c9d('0x2'));var jsonpatch=require(_0x8c9d('0x3'));var rp=require(_0x8c9d('0x4'));var moment=require(_0x8c9d('0x5'));var BPromise=require(_0x8c9d('0x6'));var Mustache=require(_0x8c9d('0x7'));var util=require(_0x8c9d('0x8'));var path=require('path');var sox=require(_0x8c9d('0x9'));var csv=require(_0x8c9d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c9d('0xb'));var _=require(_0x8c9d('0xc'));var squel=require(_0x8c9d('0xd'));var crypto=require(_0x8c9d('0xe'));var jsforce=require(_0x8c9d('0xf'));var deskjs=require(_0x8c9d('0x10'));var toCsv=require(_0x8c9d('0xa'));var querystring=require(_0x8c9d('0x11'));var Papa=require(_0x8c9d('0x12'));var Redis=require(_0x8c9d('0x13'));var authService=require(_0x8c9d('0x14'));var qs=require(_0x8c9d('0x15'));var as=require(_0x8c9d('0x16'));var hardwareService=require(_0x8c9d('0x17'));var logger=require(_0x8c9d('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x8c9d('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c9d('0x1a'))['db'];var dbH=require(_0x8c9d('0x1a'))['dbH'];function respondWithStatusCode(_0x443a3b,_0x5c56f3){_0x5c56f3=_0x5c56f3||0xcc;return function(_0x40355a){if(_0x40355a){return _0x443a3b[_0x8c9d('0x1b')](_0x5c56f3);}return _0x443a3b['status'](_0x5c56f3)[_0x8c9d('0x1c')]();};}function respondWithResult(_0x1004e1,_0x4fb794){_0x4fb794=_0x4fb794||0xc8;return function(_0x1022b6){if(_0x1022b6){return _0x1004e1[_0x8c9d('0x1d')](_0x4fb794)['json'](_0x1022b6);}};}function respondWithFilteredResult(_0x3a6092,_0x1227c3){return function(_0x38fa03){if(_0x38fa03){var _0x90974a=typeof _0x1227c3[_0x8c9d('0x1e')]===_0x8c9d('0x1f')&&typeof _0x1227c3[_0x8c9d('0x20')]===_0x8c9d('0x1f');var _0x3a65c5=_0x38fa03[_0x8c9d('0x21')];var _0xf4439=_0x90974a?0x0:_0x1227c3[_0x8c9d('0x1e')];var _0x3ded4a=_0x90974a?_0x38fa03[_0x8c9d('0x21')]:_0x1227c3['offset']+_0x1227c3[_0x8c9d('0x20')];var _0x3b1f3f;if(_0x3ded4a>=_0x3a65c5){_0x3ded4a=_0x3a65c5;_0x3b1f3f=0xc8;}else{_0x3b1f3f=0xce;}_0x3a6092['status'](_0x3b1f3f);return _0x3a6092[_0x8c9d('0x22')](_0x8c9d('0x23'),_0xf4439+'-'+_0x3ded4a+'/'+_0x3a65c5)[_0x8c9d('0x24')](_0x38fa03);}return null;};}function patchUpdates(_0x56e8cb){return function(_0x2538bb){try{jsonpatch['apply'](_0x2538bb,_0x56e8cb,!![]);}catch(_0x50c57c){return BPromise['reject'](_0x50c57c);}return _0x2538bb[_0x8c9d('0x25')]();};}function saveUpdates(_0x2c06ce,_0x18e2b6){return function(_0x4fefcf){if(_0x4fefcf){return _0x4fefcf['update'](_0x2c06ce)['then'](function(_0x1cd59e){return _0x1cd59e;});}return null;};}function removeEntity(_0x2e407,_0x24b1fb){return function(_0x1d2a96){if(_0x1d2a96){return _0x1d2a96[_0x8c9d('0x26')]()[_0x8c9d('0x27')](function(){var _0x20be5a=_0x1d2a96['get']({'plain':!![]});var _0x5812a3=_0x8c9d('0x28');return db[_0x8c9d('0x29')][_0x8c9d('0x26')]({'where':{'type':_0x5812a3,'resourceId':_0x20be5a['id']}})[_0x8c9d('0x27')](function(){return _0x1d2a96;});})[_0x8c9d('0x27')](function(){_0x2e407[_0x8c9d('0x1d')](0xcc)[_0x8c9d('0x1c')]();});}};}function handleEntityNotFound(_0x282555,_0xcfe4d9){return function(_0x2afaf7){if(!_0x2afaf7){_0x282555[_0x8c9d('0x1b')](0x194);}return _0x2afaf7;};}function handleError(_0x431ece,_0x40bf56){_0x40bf56=_0x40bf56||0x1f4;return function(_0x243e2a){logger[_0x8c9d('0x2a')](_0x243e2a['stack']);if(_0x243e2a[_0x8c9d('0x2b')]){delete _0x243e2a['name'];}_0x431ece[_0x8c9d('0x1d')](_0x40bf56)['send'](_0x243e2a);};}exports['index']=function(_0x5f2eb8,_0x47ef32){var _0x1fc196={},_0x389a95={},_0x41eb8b={'count':0x0,'rows':[]};var _0x11a8dc=_[_0x8c9d('0x2c')](db[_0x8c9d('0x2d')][_0x8c9d('0x2e')],function(_0x25ed04){return{'name':_0x25ed04[_0x8c9d('0x2f')],'type':_0x25ed04[_0x8c9d('0x30')][_0x8c9d('0x31')]};});_0x389a95['model']=_[_0x8c9d('0x2c')](_0x11a8dc,_0x8c9d('0x2b'));_0x389a95[_0x8c9d('0x32')]=_[_0x8c9d('0x33')](_0x5f2eb8[_0x8c9d('0x32')]);_0x389a95[_0x8c9d('0x34')]=_[_0x8c9d('0x35')](_0x389a95[_0x8c9d('0x36')],_0x389a95[_0x8c9d('0x32')]);_0x1fc196[_0x8c9d('0x37')]=_[_0x8c9d('0x35')](_0x389a95[_0x8c9d('0x36')],qs[_0x8c9d('0x38')](_0x5f2eb8['query']['fields']));_0x1fc196['attributes']=_0x1fc196[_0x8c9d('0x37')][_0x8c9d('0x39')]?_0x1fc196[_0x8c9d('0x37')]:_0x389a95[_0x8c9d('0x36')];if(!_0x5f2eb8['query'][_0x8c9d('0x3a')](_0x8c9d('0x3b'))){_0x1fc196[_0x8c9d('0x20')]=qs[_0x8c9d('0x20')](_0x5f2eb8[_0x8c9d('0x32')]['limit']);_0x1fc196[_0x8c9d('0x1e')]=qs[_0x8c9d('0x1e')](_0x5f2eb8[_0x8c9d('0x32')][_0x8c9d('0x1e')]);}_0x1fc196['order']=qs[_0x8c9d('0x3c')](_0x5f2eb8[_0x8c9d('0x32')][_0x8c9d('0x3c')]);_0x1fc196[_0x8c9d('0x3d')]=qs[_0x8c9d('0x34')](_[_0x8c9d('0x3e')](_0x5f2eb8['query'],_0x389a95['filters']),_0x11a8dc);if(_0x5f2eb8[_0x8c9d('0x32')]['filter']){_0x1fc196[_0x8c9d('0x3d')]=_[_0x8c9d('0x3f')](_0x1fc196['where'],{'$or':_[_0x8c9d('0x2c')](_0x11a8dc,function(_0x27b4aa){if(_0x27b4aa[_0x8c9d('0x30')]!=='VIRTUAL'){var _0xd5862c={};_0xd5862c[_0x27b4aa[_0x8c9d('0x2b')]]={'$like':'%'+_0x5f2eb8[_0x8c9d('0x32')][_0x8c9d('0x40')]+'%'};return _0xd5862c;}})});}_0x1fc196=_[_0x8c9d('0x3f')]({},_0x1fc196,_0x5f2eb8[_0x8c9d('0x41')]);var _0x36de0f={'where':_0x1fc196['where']};return db['AnalyticCustomReport']['count'](_0x36de0f)[_0x8c9d('0x27')](function(_0x7bd851){_0x41eb8b['count']=_0x7bd851;if(_0x5f2eb8[_0x8c9d('0x32')][_0x8c9d('0x42')]){_0x1fc196[_0x8c9d('0x43')]=[{'all':!![]}];}return db[_0x8c9d('0x2d')][_0x8c9d('0x44')](_0x1fc196);})['then'](function(_0x1639e7){_0x41eb8b[_0x8c9d('0x45')]=_0x1639e7;return _0x41eb8b;})[_0x8c9d('0x27')](respondWithFilteredResult(_0x47ef32,_0x1fc196))['catch'](handleError(_0x47ef32,null));};exports[_0x8c9d('0x46')]=function(_0x1eebf4,_0x490f58){var _0x50dba7={'raw':![],'where':{'id':_0x1eebf4[_0x8c9d('0x47')]['id']}},_0x3ef263={};_0x3ef263[_0x8c9d('0x36')]=_['keys'](db[_0x8c9d('0x2d')]['rawAttributes']);_0x3ef263['query']=_[_0x8c9d('0x33')](_0x1eebf4[_0x8c9d('0x32')]);_0x3ef263[_0x8c9d('0x34')]=_[_0x8c9d('0x35')](_0x3ef263[_0x8c9d('0x36')],_0x3ef263['query']);_0x50dba7['attributes']=_['intersection'](_0x3ef263[_0x8c9d('0x36')],qs[_0x8c9d('0x38')](_0x1eebf4[_0x8c9d('0x32')][_0x8c9d('0x38')]));_0x50dba7[_0x8c9d('0x37')]=_0x50dba7[_0x8c9d('0x37')]['length']?_0x50dba7[_0x8c9d('0x37')]:_0x3ef263[_0x8c9d('0x36')];if(_0x1eebf4[_0x8c9d('0x32')][_0x8c9d('0x42')]){_0x50dba7[_0x8c9d('0x43')]=[{'all':!![]}];}_0x50dba7=_['merge']({},_0x50dba7,_0x1eebf4[_0x8c9d('0x41')]);return db[_0x8c9d('0x2d')][_0x8c9d('0x48')](_0x50dba7)[_0x8c9d('0x27')](handleEntityNotFound(_0x490f58,null))['then'](respondWithResult(_0x490f58,null))[_0x8c9d('0x49')](handleError(_0x490f58,null));};exports[_0x8c9d('0x4a')]=function(_0x51dd2f,_0x4f1498){return db[_0x8c9d('0x2d')][_0x8c9d('0x4a')](_0x51dd2f[_0x8c9d('0x4b')],{})[_0x8c9d('0x27')](function(_0x3a2484){var _0x11fccd=_0x51dd2f[_0x8c9d('0x4c')][_0x8c9d('0x4d')]({'plain':!![]});if(!_0x11fccd)throw new Error(_0x8c9d('0x4e'));if(_0x11fccd[_0x8c9d('0x4f')]===_0x8c9d('0x4c')){var _0xba0366=_0x3a2484[_0x8c9d('0x4d')]({'plain':!![]});var _0x3d4205=_0x8c9d('0x50');return db[_0x8c9d('0x51')][_0x8c9d('0x48')]({'where':{'name':_0x3d4205,'userProfileId':_0x11fccd[_0x8c9d('0x52')]},'raw':!![]})[_0x8c9d('0x27')](function(_0x12bb72){if(_0x12bb72&&_0x12bb72[_0x8c9d('0x53')]===0x0){return db['UserProfileResource'][_0x8c9d('0x4a')]({'name':_0xba0366[_0x8c9d('0x2b')],'resourceId':_0xba0366['id'],'type':_0x8c9d('0x28'),'sectionId':_0x12bb72['id']},{})[_0x8c9d('0x27')](function(){return _0x3a2484;});}else{return _0x3a2484;}})[_0x8c9d('0x49')](function(_0x275412){logger[_0x8c9d('0x2a')](_0x8c9d('0x54'),_0x275412);throw _0x275412;});}return _0x3a2484;})[_0x8c9d('0x27')](respondWithResult(_0x4f1498,0xc9))[_0x8c9d('0x49')](handleError(_0x4f1498,null));};exports[_0x8c9d('0x55')]=function(_0x3755fe,_0x677876){if(_0x3755fe[_0x8c9d('0x4b')]['id']){delete _0x3755fe[_0x8c9d('0x4b')]['id'];}return db['AnalyticCustomReport'][_0x8c9d('0x48')]({'where':{'id':_0x3755fe[_0x8c9d('0x47')]['id']}})[_0x8c9d('0x27')](handleEntityNotFound(_0x677876,null))[_0x8c9d('0x27')](saveUpdates(_0x3755fe[_0x8c9d('0x4b')],null))[_0x8c9d('0x27')](respondWithResult(_0x677876,null))[_0x8c9d('0x49')](handleError(_0x677876,null));};exports[_0x8c9d('0x26')]=function(_0x61ed8a,_0x320eac){return db['AnalyticCustomReport'][_0x8c9d('0x48')]({'where':{'id':_0x61ed8a[_0x8c9d('0x47')]['id']}})[_0x8c9d('0x27')](handleEntityNotFound(_0x320eac,null))['then'](removeEntity(_0x320eac,null))[_0x8c9d('0x49')](handleError(_0x320eac,null));};exports[_0x8c9d('0x56')]=function(_0x100076,_0xc09499){var _0x16e352=0xa;var _0x1d351d=['join',_0x8c9d('0x57'),'right_join',_0x8c9d('0x58')];var _0x305e9a={'SUM':_0x8c9d('0x59'),'COUNT':_0x8c9d('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8c9d('0x5b'),'MIN':_0x8c9d('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x8c9d('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x8c9d('0x5e')};var _0x157d0d={'SEC_TO_TIME':_0x8c9d('0x5f'),'DATE':'DATE(%s)','HOUR':_0x8c9d('0x60'),'ROUND':_0x8c9d('0x61'),'UNIX_TIMESTAMP':_0x8c9d('0x62')};var _0x5422c2=function(_0x431081){return!_[_0x8c9d('0x63')]([_0x8c9d('0x64'),_0x8c9d('0x65'),'IS\x20EMPTY',_0x8c9d('0x66')],_0x431081);};var _0x1d05a0=function(_0x4b5626){if(!_0x4b5626||!_0x4b5626[_0x8c9d('0x67')][_0x8c9d('0x39')]){return'';}for(var _0x5020fd='(',_0xeb6bb5=0x0;_0xeb6bb5<_0x4b5626[_0x8c9d('0x67')][_0x8c9d('0x39')];_0xeb6bb5+=0x1){_0xeb6bb5>0x0&&(_0x5020fd+='\x20'+_0x4b5626[_0x8c9d('0x68')]+'\x20');_0x5020fd+=_0x4b5626[_0x8c9d('0x67')][_0xeb6bb5][_0x8c9d('0x69')]?_0x1d05a0(_0x4b5626[_0x8c9d('0x67')][_0xeb6bb5][_0x8c9d('0x69')]):_0x4b5626[_0x8c9d('0x67')][_0xeb6bb5][_0x8c9d('0x6a')]+'\x20'+_0x4b5626['rules'][_0xeb6bb5][_0x8c9d('0x6b')]+(_0x5422c2(_0x4b5626[_0x8c9d('0x67')][_0xeb6bb5][_0x8c9d('0x6b')])?'\x20'+_0x4b5626[_0x8c9d('0x67')][_0xeb6bb5][_0x8c9d('0x6c')]:'');}return _0x5020fd+')';};var _0x2563e2={'where':{'id':_0x100076[_0x8c9d('0x47')]['id']}},_0x465ebc,_0x3ce5a2,_0x2b7ab1,_0x3c1548,_0x11ca65;_0x2563e2=_['merge']({},_0x2563e2,_0x100076[_0x8c9d('0x41')]);return db[_0x8c9d('0x2d')]['find'](_0x2563e2)[_0x8c9d('0x27')](function(_0x1786f7){if(_0x1786f7){_0x465ebc=_0x1786f7;return _0x1786f7[_0x8c9d('0x6d')]();}return null;})['then'](function(_0x5465cc){if(_0x5465cc){if(!_0x5465cc[_0x8c9d('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x8c9d('0x6e'),0x193);}_0x3ce5a2=_0x5465cc;return db[_0x8c9d('0x6f')][_0x8c9d('0x44')]({'raw':!![]});}return null;})[_0x8c9d('0x27')](function(_0x34f94a){if(_0x34f94a){_0x2b7ab1=_['keyBy'](_0x34f94a,'id');var _0x3503b0;var _0x16e08a=squel[_0x8c9d('0x70')]();_0x16e08a['from'](_0x465ebc[_0x8c9d('0x71')]);for(var _0x49bbcc=0x0;_0x49bbcc<_0x3ce5a2[_0x8c9d('0x39')];_0x49bbcc+=0x1){_0x3503b0=_0x3ce5a2[_0x49bbcc]['MetricId']?_0x2b7ab1[_0x3ce5a2[_0x49bbcc][_0x8c9d('0x72')]][_0x8c9d('0x73')]:_0x3ce5a2[_0x49bbcc]['field'];_0x3503b0=_0x3ce5a2[_0x49bbcc]['function']?_[_0x8c9d('0x74')](_0x305e9a[_0x3ce5a2[_0x49bbcc][_0x8c9d('0x75')]],'%s',_0x3503b0):_0x3503b0;_0x3503b0=_0x3ce5a2[_0x49bbcc][_0x8c9d('0x76')]?_[_0x8c9d('0x74')](_0x157d0d[_0x3ce5a2[_0x49bbcc]['format']],'%s',_0x3503b0):_0x3503b0;if(_0x3ce5a2[_0x49bbcc][_0x8c9d('0x77')]){_0x16e08a[_0x8c9d('0x69')](_0x3503b0);}_0x3ce5a2[_0x49bbcc]['orderBy']&&_0x16e08a['order'](_0x3503b0,_0x3ce5a2[_0x49bbcc]['orderBy']===_0x8c9d('0x78')?![]:!![]);_0x16e08a[_0x8c9d('0x6a')](_0x3503b0,_0x3ce5a2[_0x49bbcc][_0x8c9d('0x79')]||_0x3503b0);}if(_0x465ebc['joins']){_0x465ebc[_0x8c9d('0x7a')]=JSON[_0x8c9d('0x7b')](_0x465ebc['joins']);for(var _0x3b262c=0x0;_0x3b262c<_0x465ebc[_0x8c9d('0x7a')][_0x8c9d('0x39')];_0x3b262c+=0x1){if(_0x465ebc[_0x8c9d('0x7a')][_0x3b262c][_0x8c9d('0x30')]&&_['includes'](_0x1d351d,_0x465ebc['joins'][_0x3b262c]['type'])&&_0x465ebc[_0x8c9d('0x7a')][_0x3b262c][_0x8c9d('0x7c')]&&_0x465ebc[_0x8c9d('0x7a')][_0x3b262c][_0x8c9d('0x7d')]&&_0x465ebc[_0x8c9d('0x7a')][_0x3b262c][_0x8c9d('0x7e')]){_0x16e08a[_0x465ebc[_0x8c9d('0x7a')][_0x3b262c]['type']](_0x465ebc['joins'][_0x3b262c][_0x8c9d('0x7d')],null,util[_0x8c9d('0x76')](_0x8c9d('0x7f'),_0x465ebc['table'],_0x465ebc[_0x8c9d('0x7a')][_0x3b262c][_0x8c9d('0x7c')],_0x465ebc[_0x8c9d('0x7a')][_0x3b262c][_0x8c9d('0x7d')],_0x465ebc[_0x8c9d('0x7a')][_0x3b262c]['foreignKey']));}}}if(_0x465ebc['conditions']){_0x465ebc[_0x8c9d('0x80')]=JSON[_0x8c9d('0x7b')](_0x465ebc[_0x8c9d('0x80')]);_0x16e08a['where'](_0x1d05a0(_0x465ebc['conditions'][_0x8c9d('0x69')]));}_0x11ca65=_0x16e08a[_0x8c9d('0x81')]();_0x16e08a[_0x8c9d('0x20')](_0x16e352);_0x16e08a[_0x8c9d('0x1e')](0x0);logger[_0x8c9d('0x82')](_0x8c9d('0x83'),_0x16e08a[_0x8c9d('0x84')]());return dbH['sequelize'][_0x8c9d('0x32')](_0x16e08a[_0x8c9d('0x84')](),{'type':dbH[_0x8c9d('0x85')][_0x8c9d('0x86')][_0x8c9d('0x87')]});}})['then'](respondWithResult(_0xc09499,null))[_0x8c9d('0x49')](handleError(_0xc09499,null));};function runReport(_0x4659f9,_0x1fbb32,_0x59db8b){var _0x2860e9=_0x1fbb32[_0x8c9d('0x2b')];var _0x17196b=0xa;var _0x3f1d38=[_0x8c9d('0x88'),'left_join',_0x8c9d('0x89'),_0x8c9d('0x58')];var _0xaa9b2b={'SUM':_0x8c9d('0x59'),'COUNT':_0x8c9d('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x8c9d('0x5c'),'AVG':_0x8c9d('0x8a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x8c9d('0x8b'),'GROUP_CONCAT DESC':_0x8c9d('0x5e')};var _0x2548d3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x8c9d('0x8c'),'HOUR':_0x8c9d('0x60'),'ROUND':_0x8c9d('0x61'),'UNIX_TIMESTAMP':_0x8c9d('0x62')};var _0x33b8bb=function(_0x3b2069){return!_[_0x8c9d('0x63')]([_0x8c9d('0x64'),_0x8c9d('0x65'),'IS\x20EMPTY',_0x8c9d('0x66')],_0x3b2069);};var _0x3fce1e=function(_0x589608){if(!_0x589608||!_0x589608[_0x8c9d('0x67')][_0x8c9d('0x39')]){return'';}for(var _0x45f2a7='(',_0x77a7e5=0x0;_0x77a7e5<_0x589608[_0x8c9d('0x67')][_0x8c9d('0x39')];_0x77a7e5+=0x1){_0x77a7e5>0x0&&(_0x45f2a7+='\x20'+_0x589608[_0x8c9d('0x68')]+'\x20');_0x45f2a7+=_0x589608[_0x8c9d('0x67')][_0x77a7e5][_0x8c9d('0x69')]?_0x3fce1e(_0x589608['rules'][_0x77a7e5][_0x8c9d('0x69')]):_0x589608[_0x8c9d('0x67')][_0x77a7e5][_0x8c9d('0x6a')]+'\x20'+_0x589608[_0x8c9d('0x67')][_0x77a7e5][_0x8c9d('0x6b')]+(_0x33b8bb(_0x589608[_0x8c9d('0x67')][_0x77a7e5]['condition'])?'\x20'+_0x589608[_0x8c9d('0x67')][_0x77a7e5][_0x8c9d('0x6c')]:'');}return _0x45f2a7+')';};var _0x32cf4c={'where':{'id':_0x4659f9['id']}},_0x194331,_0x6c9f5e,_0x47b04e,_0x149142,_0x2490b7;_0x32cf4c=_[_0x8c9d('0x3f')]({},_0x32cf4c,_0x59db8b);return db['AnalyticCustomReport'][_0x8c9d('0x48')](_0x32cf4c)[_0x8c9d('0x27')](function(_0x1bb9a0){if(_0x1bb9a0){_0x194331=_0x1bb9a0;return _0x1bb9a0[_0x8c9d('0x6d')]();}return null;})[_0x8c9d('0x27')](function(_0x4d7c40){if(_0x4d7c40){if(!_0x4d7c40[_0x8c9d('0x39')]){throw new db[(_0x8c9d('0x8d'))]['ValidationErrorItem'](_0x8c9d('0x6e'),0x193);}_0x6c9f5e=_0x4d7c40;return db[_0x8c9d('0x6f')][_0x8c9d('0x44')]({'raw':!![]});}return null;})[_0x8c9d('0x27')](function(_0x1f8e89){if(_0x1f8e89){_0x47b04e=_[_0x8c9d('0x8e')](_0x1f8e89,'id');var _0x1f2580;var _0x124ea0=squel[_0x8c9d('0x70')]();_0x124ea0['from'](_0x194331['table']);for(var _0x4ed751=0x0;_0x4ed751<_0x6c9f5e[_0x8c9d('0x39')];_0x4ed751+=0x1){_0x1f2580=_0x6c9f5e[_0x4ed751][_0x8c9d('0x72')]?_0x47b04e[_0x6c9f5e[_0x4ed751][_0x8c9d('0x72')]][_0x8c9d('0x73')]:_0x6c9f5e[_0x4ed751][_0x8c9d('0x6a')];_0x1f2580=_0x6c9f5e[_0x4ed751]['function']?_[_0x8c9d('0x74')](_0xaa9b2b[_0x6c9f5e[_0x4ed751]['function']],'%s',_0x1f2580):_0x1f2580;_0x1f2580=_0x6c9f5e[_0x4ed751][_0x8c9d('0x76')]?_[_0x8c9d('0x74')](_0x2548d3[_0x6c9f5e[_0x4ed751][_0x8c9d('0x76')]],'%s',_0x1f2580):_0x1f2580;if(_0x6c9f5e[_0x4ed751][_0x8c9d('0x77')]){_0x124ea0[_0x8c9d('0x69')](_0x1f2580);}_0x6c9f5e[_0x4ed751][_0x8c9d('0x8f')]&&_0x124ea0[_0x8c9d('0x90')](_0x1f2580,_0x6c9f5e[_0x4ed751]['orderBy']==='DESC'?![]:!![]);_0x124ea0[_0x8c9d('0x6a')](_0x1f2580,_0x6c9f5e[_0x4ed751]['alias']||_0x1f2580);}if(_0x194331[_0x8c9d('0x7a')]){_0x194331[_0x8c9d('0x7a')]=JSON[_0x8c9d('0x7b')](_0x194331[_0x8c9d('0x7a')]);for(var _0x3cdbfe=0x0;_0x3cdbfe<_0x194331[_0x8c9d('0x7a')][_0x8c9d('0x39')];_0x3cdbfe+=0x1){if(_0x194331[_0x8c9d('0x7a')][_0x3cdbfe][_0x8c9d('0x30')]&&_['includes'](_0x3f1d38,_0x194331['joins'][_0x3cdbfe][_0x8c9d('0x30')])&&_0x194331[_0x8c9d('0x7a')][_0x3cdbfe][_0x8c9d('0x7c')]&&_0x194331[_0x8c9d('0x7a')][_0x3cdbfe]['foreignTable']&&_0x194331[_0x8c9d('0x7a')][_0x3cdbfe][_0x8c9d('0x7e')]){_0x124ea0[_0x194331[_0x8c9d('0x7a')][_0x3cdbfe][_0x8c9d('0x30')]](_0x194331[_0x8c9d('0x7a')][_0x3cdbfe][_0x8c9d('0x7d')],null,util[_0x8c9d('0x76')]('%s.%s\x20=\x20%s.%s',_0x194331['table'],_0x194331[_0x8c9d('0x7a')][_0x3cdbfe][_0x8c9d('0x7c')],_0x194331[_0x8c9d('0x7a')][_0x3cdbfe][_0x8c9d('0x7d')],_0x194331[_0x8c9d('0x7a')][_0x3cdbfe][_0x8c9d('0x7e')]));}}}if(_0x194331[_0x8c9d('0x80')]){_0x194331['conditions']=JSON[_0x8c9d('0x7b')](_0x194331['conditions']);_0x124ea0[_0x8c9d('0x3d')](_0x3fce1e(_0x194331[_0x8c9d('0x80')][_0x8c9d('0x69')]));}_0x2490b7=_0x124ea0[_0x8c9d('0x81')]();_0x124ea0[_0x8c9d('0x20')](_0x17196b);_0x124ea0[_0x8c9d('0x1e')](0x0);return;}})[_0x8c9d('0x27')](function(){if(_0x1fbb32[_0x8c9d('0x91')]===_0x8c9d('0x92')){return null;}var _0x190257=_[_0x8c9d('0x3f')](_0x1fbb32,{'name':_0x1fbb32[_0x8c9d('0x93')]||_0x1fbb32[_0x8c9d('0x2b')]||_0x194331[_0x8c9d('0x2b')],'basename':_0x2860e9,'savename':util[_0x8c9d('0x76')](_0x8c9d('0x94'),_0x1fbb32[_0x8c9d('0x2b')]||_0x194331[_0x8c9d('0x2b')],require(_0x8c9d('0x95'))['generate'](0x4),_0x1fbb32[_0x8c9d('0x91')]||_0x8c9d('0x96')),'reportId':_0x194331['id'],'reportType':'custom'});return db[_0x8c9d('0x97')][_0x8c9d('0x4a')](_0x190257,{'raw':!![]});})[_0x8c9d('0x27')](function(_0x243aca){if(_0x194331['table']==='cdr'){_0x2490b7['where'](_0x194331[_0x8c9d('0x71')]+_0x8c9d('0x98'),_0x1fbb32[_0x8c9d('0x99')],_0x1fbb32[_0x8c9d('0x9a')]);}else{_0x2490b7['where'](_0x194331[_0x8c9d('0x71')]+_0x8c9d('0x9b'),_0x1fbb32[_0x8c9d('0x99')],_0x1fbb32[_0x8c9d('0x9a')]);}if(_0x243aca){logger[_0x8c9d('0x9c')](_0x8c9d('0x9d'),_0x2490b7[_0x8c9d('0x84')]());require(_0x8c9d('0x9e'))[_0x8c9d('0x9f')](path[_0x8c9d('0x88')](__dirname,_0x8c9d('0xa0'),_0x243aca[_0x8c9d('0x91')]),[_0x243aca['id'],_0x2490b7[_0x8c9d('0x84')](),path[_0x8c9d('0x88')](__dirname,_0x8c9d('0xa1'),_0x243aca[_0x8c9d('0xa2')]),_0x2860e9]);return _0x243aca;}else{var _0x496ba2=squel[_0x8c9d('0x70')]();_0x496ba2[_0x8c9d('0xa3')]('('+_0x2490b7[_0x8c9d('0x84')]()+')',_0x8c9d('0xa4'));_0x496ba2[_0x8c9d('0x6a')](_0x8c9d('0xa5'),_0x8c9d('0x21'));_0x2490b7[_0x8c9d('0x20')](_0x1fbb32[_0x8c9d('0x20')]||_0x17196b);_0x2490b7[_0x8c9d('0x1e')](_0x1fbb32[_0x8c9d('0x1e')]||0x0);return dbH[_0x8c9d('0x85')]['query'](_0x496ba2['toString'](),{'type':dbH[_0x8c9d('0x85')]['QueryTypes'][_0x8c9d('0x87')]})[_0x8c9d('0x27')](function(_0x1a157c){if(!_0x1a157c['length']){_0x149142=0x0;}else{_0x149142=_0x1a157c[0x0]['count']||0x0;}return dbH[_0x8c9d('0x85')][_0x8c9d('0x32')](_0x2490b7[_0x8c9d('0x84')](),{'type':dbH[_0x8c9d('0x85')][_0x8c9d('0x86')]['SELECT']});})[_0x8c9d('0x27')](function(_0xec5c79){return{'rows':_0xec5c79||[],'count':_0x149142};});}});}exports[_0x8c9d('0xa6')]=function(_0x4c2ad4,_0x562aa7){return runReport(_0x4c2ad4['params'],_0x4c2ad4['query'],_0x4c2ad4[_0x8c9d('0x41')])[_0x8c9d('0x27')](respondWithResult(_0x562aa7,null))[_0x8c9d('0x49')](handleError(_0x562aa7,null));};exports['runReport']=runReport;exports[_0x8c9d('0x32')]=function(_0x5dafe8,_0x34afbd){var _0x5ea95f=0xa;var _0x3ccbba=[_0x8c9d('0x88'),_0x8c9d('0x57'),'right_join','cross_join'];var _0x66b87c={'SUM':_0x8c9d('0x59'),'COUNT':_0x8c9d('0x5a'),'COUNT DISTINCT':_0x8c9d('0xa7'),'MAX':_0x8c9d('0x5b'),'MIN':_0x8c9d('0x5c'),'AVG':_0x8c9d('0x8a'),'GROUP_CONCAT':_0x8c9d('0x5d'),'GROUP_CONCAT ASC':_0x8c9d('0x8b'),'GROUP_CONCAT DESC':_0x8c9d('0x5e')};var _0xf0ead9={'SEC_TO_TIME':_0x8c9d('0x5f'),'DATE':_0x8c9d('0x8c'),'HOUR':_0x8c9d('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2360b2=function(_0x3c4056){return!_['includes']([_0x8c9d('0x64'),'IS\x20NOT\x20NULL',_0x8c9d('0xa8'),_0x8c9d('0x66')],_0x3c4056);};var _0x9bbee6=function(_0x1bcdde){if(!_0x1bcdde||!_0x1bcdde[_0x8c9d('0x67')][_0x8c9d('0x39')]){return'';}for(var _0x47006b='(',_0x596983=0x0;_0x596983<_0x1bcdde[_0x8c9d('0x67')][_0x8c9d('0x39')];_0x596983+=0x1){_0x596983>0x0&&(_0x47006b+='\x20'+_0x1bcdde[_0x8c9d('0x68')]+'\x20');_0x47006b+=_0x1bcdde[_0x8c9d('0x67')][_0x596983]['group']?_0x9bbee6(_0x1bcdde[_0x8c9d('0x67')][_0x596983]['group']):_0x1bcdde[_0x8c9d('0x67')][_0x596983]['field']+'\x20'+_0x1bcdde[_0x8c9d('0x67')][_0x596983][_0x8c9d('0x6b')]+(_0x2360b2(_0x1bcdde['rules'][_0x596983][_0x8c9d('0x6b')])?'\x20'+_0x1bcdde[_0x8c9d('0x67')][_0x596983]['value']:'');}return _0x47006b+')';};var _0x4e223a={'where':{'id':_0x5dafe8['params']['id']}},_0x4fb17c,_0x419929,_0x29492c,_0x398151,_0x4d6be2;_0x4e223a=_[_0x8c9d('0x3f')]({},_0x4e223a,_0x5dafe8[_0x8c9d('0x41')]);return db[_0x8c9d('0x2d')][_0x8c9d('0x48')](_0x4e223a)[_0x8c9d('0x27')](function(_0xdd5493){if(_0xdd5493){_0x4fb17c=_0xdd5493;return _0xdd5493[_0x8c9d('0x6d')]();}return null;})[_0x8c9d('0x27')](function(_0x1642b5){if(_0x1642b5){if(!_0x1642b5['length']){throw new db[(_0x8c9d('0x8d'))][(_0x8c9d('0xa9'))](_0x8c9d('0x6e'),0x193);}_0x419929=_0x1642b5;return db[_0x8c9d('0x6f')][_0x8c9d('0x44')]({'raw':!![]});}return null;})[_0x8c9d('0x27')](function(_0x8da741){if(_0x8da741){_0x29492c=_[_0x8c9d('0x8e')](_0x8da741,'id');var _0x3d2b9b;var _0x330d6f=squel[_0x8c9d('0x70')]();_0x330d6f[_0x8c9d('0xa3')](_0x4fb17c['table']);for(var _0x3b4567=0x0;_0x3b4567<_0x419929[_0x8c9d('0x39')];_0x3b4567+=0x1){_0x3d2b9b=_0x419929[_0x3b4567]['MetricId']?_0x29492c[_0x419929[_0x3b4567]['MetricId']]['metric']:_0x419929[_0x3b4567]['field'];_0x3d2b9b=_0x419929[_0x3b4567]['function']?_['replace'](_0x66b87c[_0x419929[_0x3b4567][_0x8c9d('0x75')]],'%s',_0x3d2b9b):_0x3d2b9b;_0x3d2b9b=_0x419929[_0x3b4567]['format']?_[_0x8c9d('0x74')](_0xf0ead9[_0x419929[_0x3b4567]['format']],'%s',_0x3d2b9b):_0x3d2b9b;if(_0x419929[_0x3b4567][_0x8c9d('0x77')]){_0x330d6f[_0x8c9d('0x69')](_0x3d2b9b);}_0x419929[_0x3b4567]['orderBy']&&_0x330d6f['order'](_0x3d2b9b,_0x419929[_0x3b4567]['orderBy']===_0x8c9d('0x78')?![]:!![]);_0x330d6f[_0x8c9d('0x6a')](_0x3d2b9b,_0x419929[_0x3b4567]['alias']||_0x3d2b9b);}if(_0x4fb17c[_0x8c9d('0x7a')]){_0x4fb17c['joins']=JSON[_0x8c9d('0x7b')](_0x4fb17c[_0x8c9d('0x7a')]);for(var _0xb28293=0x0;_0xb28293<_0x4fb17c[_0x8c9d('0x7a')]['length'];_0xb28293+=0x1){if(_0x4fb17c[_0x8c9d('0x7a')][_0xb28293][_0x8c9d('0x30')]&&_[_0x8c9d('0x63')](_0x3ccbba,_0x4fb17c[_0x8c9d('0x7a')][_0xb28293]['type'])&&_0x4fb17c[_0x8c9d('0x7a')][_0xb28293][_0x8c9d('0x7c')]&&_0x4fb17c[_0x8c9d('0x7a')][_0xb28293][_0x8c9d('0x7d')]&&_0x4fb17c[_0x8c9d('0x7a')][_0xb28293][_0x8c9d('0x7e')]){_0x330d6f[_0x4fb17c[_0x8c9d('0x7a')][_0xb28293]['type']](_0x4fb17c[_0x8c9d('0x7a')][_0xb28293][_0x8c9d('0x7d')],null,util[_0x8c9d('0x76')](_0x8c9d('0x7f'),_0x4fb17c[_0x8c9d('0x71')],_0x4fb17c['joins'][_0xb28293][_0x8c9d('0x7c')],_0x4fb17c[_0x8c9d('0x7a')][_0xb28293][_0x8c9d('0x7d')],_0x4fb17c[_0x8c9d('0x7a')][_0xb28293][_0x8c9d('0x7e')]));}}}if(_0x4fb17c[_0x8c9d('0x80')]){_0x4fb17c['conditions']=JSON[_0x8c9d('0x7b')](_0x4fb17c['conditions']);_0x330d6f[_0x8c9d('0x3d')](_0x9bbee6(_0x4fb17c[_0x8c9d('0x80')][_0x8c9d('0x69')]));}_0x4d6be2=_0x330d6f[_0x8c9d('0x81')]();_0x330d6f['limit'](_0x5ea95f);_0x330d6f['offset'](0x0);logger[_0x8c9d('0x82')](_0x8c9d('0x83'),_0x330d6f['toString']());return dbH[_0x8c9d('0x85')]['query'](_0x330d6f[_0x8c9d('0x84')](),{'type':dbH[_0x8c9d('0x85')][_0x8c9d('0x86')][_0x8c9d('0x87')]});}})['then'](function(){return{'sql':_0x4d6be2['toString']()};})['then'](respondWithResult(_0x34afbd,null))[_0x8c9d('0x49')](handleError(_0x34afbd,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index b6dac55..3778fdb 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 _0x3930=['request-promise','path','../../config/environment','./analyticCustomReport.attributes','define','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x28e973,_0x2a1364){var _0x178b9e=function(_0x11907d){while(--_0x11907d){_0x28e973['push'](_0x28e973['shift']());}};_0x178b9e(++_0x2a1364);}(_0x3930,0x19d));var _0x0393=function(_0x1ad901,_0x852d9e){_0x1ad901=_0x1ad901-0x0;var _0x3c0249=_0x3930[_0x1ad901];return _0x3c0249;};'use strict';var _=require(_0x0393('0x0'));var util=require('util');var logger=require(_0x0393('0x1'))(_0x0393('0x2'));var moment=require(_0x0393('0x3'));var BPromise=require(_0x0393('0x4'));var rp=require(_0x0393('0x5'));var fs=require('fs');var path=require(_0x0393('0x6'));var rimraf=require('rimraf');var config=require(_0x0393('0x7'));var attributes=require(_0x0393('0x8'));module['exports']=function(_0x47dee1,_0x479a0b){return _0x47dee1[_0x0393('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x0393('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x370a=['exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x1c461e,_0x1b98ff){var _0x1dce4f=function(_0x5cbdf0){while(--_0x5cbdf0){_0x1c461e['push'](_0x1c461e['shift']());}};_0x1dce4f(++_0x1b98ff);}(_0x370a,0xfb));var _0xa370=function(_0x56fb4a,_0x1a66ec){_0x56fb4a=_0x56fb4a-0x0;var _0x4e47fd=_0x370a[_0x56fb4a];return _0x4e47fd;};'use strict';var _=require(_0xa370('0x0'));var util=require(_0xa370('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa370('0x2'));var BPromise=require(_0xa370('0x3'));var rp=require(_0xa370('0x4'));var fs=require('fs');var path=require(_0xa370('0x5'));var rimraf=require(_0xa370('0x6'));var config=require(_0xa370('0x7'));var attributes=require(_0xa370('0x8'));module[_0xa370('0x9')]=function(_0x3d9271,_0x335d4c){return _0x3d9271[_0xa370('0xa')](_0xa370('0xb'),attributes,{'tableName':_0xa370('0xc'),'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 00ddb07..974cb72 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 _0x727b=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x727b,0xe3));var _0xb727=function(_0x106fd8,_0x19dbc1){_0x106fd8=_0x106fd8-0x0;var _0x2fec5c=_0x727b[_0x106fd8];return _0x2fec5c;};'use strict';var _=require(_0xb727('0x0'));var util=require(_0xb727('0x1'));var moment=require(_0xb727('0x2'));var BPromise=require(_0xb727('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb727('0x4'));var db=require(_0xb727('0x5'))['db'];var utils=require(_0xb727('0x6'));var logger=require('../../config/logger')(_0xb727('0x7'));var config=require('../../config/environment');var jayson=require(_0xb727('0x8'));var client=jayson[_0xb727('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ac0a6,_0x21aa38,_0xf108d2){return new BPromise(function(_0x4c145d,_0x3a486b){return client[_0xb727('0xa')](_0x2ac0a6,_0xf108d2)['then'](function(_0x50bacb){logger[_0xb727('0xb')](_0xb727('0xc'),_0x21aa38,_0xb727('0xd'));logger['debug'](_0xb727('0xe'),_0x21aa38,_0xb727('0xd'),JSON[_0xb727('0xf')](_0x50bacb));if(_0x50bacb[_0xb727('0x10')]){if(_0x50bacb['error']['code']===0x1f4){logger[_0xb727('0x10')](_0xb727('0xc'),_0x21aa38,_0x50bacb['error']['message']);return _0x3a486b(_0x50bacb[_0xb727('0x10')][_0xb727('0x11')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x21aa38,_0x50bacb[_0xb727('0x10')][_0xb727('0x11')]);return _0x4c145d(_0x50bacb['error']['message']);}else{logger[_0xb727('0xb')](_0xb727('0xc'),_0x21aa38,'request\x20sent');_0x4c145d(_0x50bacb['result'][_0xb727('0x11')]);}})[_0xb727('0x12')](function(_0x56c6dc){logger['error'](_0xb727('0xc'),_0x21aa38,_0x56c6dc);_0x3a486b(_0x56c6dc);});});}
\ No newline at end of file
+var _0x2911=['info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x5f0864,_0x413e01){var _0x5700dc=function(_0x1677cf){while(--_0x1677cf){_0x5f0864['push'](_0x5f0864['shift']());}};_0x5700dc(++_0x413e01);}(_0x2911,0x163));var _0x1291=function(_0x2bd440,_0x46c53d){_0x2bd440=_0x2bd440-0x0;var _0xc57de4=_0x2911[_0x2bd440];return _0xc57de4;};'use strict';var _=require(_0x1291('0x0'));var util=require(_0x1291('0x1'));var moment=require(_0x1291('0x2'));var BPromise=require(_0x1291('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1291('0x4'));var db=require(_0x1291('0x5'))['db'];var utils=require(_0x1291('0x6'));var logger=require(_0x1291('0x7'))(_0x1291('0x8'));var config=require(_0x1291('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1291('0xa')][_0x1291('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14939f,_0x323755,_0x28001b){return new BPromise(function(_0x3b591c,_0x1641fb){return client[_0x1291('0xc')](_0x14939f,_0x28001b)['then'](function(_0x4cba96){logger['info'](_0x1291('0xd'),_0x323755,_0x1291('0xe'));logger[_0x1291('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x323755,_0x1291('0xe'),JSON['stringify'](_0x4cba96));if(_0x4cba96[_0x1291('0x10')]){if(_0x4cba96[_0x1291('0x10')][_0x1291('0x11')]===0x1f4){logger[_0x1291('0x10')](_0x1291('0xd'),_0x323755,_0x4cba96[_0x1291('0x10')][_0x1291('0x12')]);return _0x1641fb(_0x4cba96[_0x1291('0x10')]['message']);}logger[_0x1291('0x10')](_0x1291('0xd'),_0x323755,_0x4cba96['error'][_0x1291('0x12')]);return _0x3b591c(_0x4cba96[_0x1291('0x10')][_0x1291('0x12')]);}else{logger[_0x1291('0x13')](_0x1291('0xd'),_0x323755,_0x1291('0xe'));_0x3b591c(_0x4cba96[_0x1291('0x14')][_0x1291('0x12')]);}})[_0x1291('0x15')](function(_0x2c6569){logger[_0x1291('0x10')](_0x1291('0xd'),_0x323755,_0x2c6569);_0x1641fb(_0x2c6569);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 66162d5..880bc2c 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 _0xc4aa=['exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','query','create','update','destroy'];(function(_0x5977ba,_0x15369e){var _0x32be1d=function(_0x20c222){while(--_0x20c222){_0x5977ba['push'](_0x5977ba['shift']());}};_0x32be1d(++_0x15369e);}(_0xc4aa,0x17d));var _0xac4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc4aa[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xac4a('0x0'));var path=require(_0xac4a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xac4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xac4a('0x3'));var interaction=require(_0xac4a('0x4'));var config=require(_0xac4a('0x5'));var controller=require('./analyticCustomReport.controller');router[_0xac4a('0x6')]('/',auth['isAuthenticated'](),controller[_0xac4a('0x7')]);router[_0xac4a('0x6')](_0xac4a('0x8'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router['get'](_0xac4a('0xb'),auth['isAuthenticated'](),controller['preview']);router['get'](_0xac4a('0xc'),auth['isAuthenticated'](),controller[_0xac4a('0xd')]);router[_0xac4a('0x6')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0x10')]);router['put'](_0xac4a('0x8'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xac4a('0x12')]);module[_0xac4a('0x13')]=router;
\ No newline at end of file
+var _0xa275=['post','create','update','delete','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','/:id/run','/:id/query','query'];(function(_0x4e0e01,_0x2e1f1b){var _0x2389bd=function(_0x9c8e06){while(--_0x9c8e06){_0x4e0e01['push'](_0x4e0e01['shift']());}};_0x2389bd(++_0x2e1f1b);}(_0xa275,0x1d3));var _0x5a27=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa275[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x5a27('0x0'));var util=require('util');var path=require(_0x5a27('0x1'));var timeout=require('connect-timeout');var express=require(_0x5a27('0x2'));var router=express[_0x5a27('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5a27('0x4'));var interaction=require(_0x5a27('0x5'));var config=require(_0x5a27('0x6'));var controller=require(_0x5a27('0x7'));router[_0x5a27('0x8')]('/',auth[_0x5a27('0x9')](),controller['index']);router['get'](_0x5a27('0xa'),auth[_0x5a27('0x9')](),controller[_0x5a27('0xb')]);router['get'](_0x5a27('0xc'),auth[_0x5a27('0x9')](),controller['preview']);router['get'](_0x5a27('0xd'),auth['isAuthenticated'](),controller['run']);router[_0x5a27('0x8')](_0x5a27('0xe'),auth['isAuthenticated'](),controller[_0x5a27('0xf')]);router[_0x5a27('0x10')]('/',auth['isAuthenticated'](),controller[_0x5a27('0x11')]);router['put']('/:id',auth[_0x5a27('0x9')](),controller[_0x5a27('0x12')]);router[_0x5a27('0x13')](_0x5a27('0xa'),auth['isAuthenticated'](),controller[_0x5a27('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 6e1ff0b..10818e7 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 _0xdbf5=['exports','STRING','TEXT'];(function(_0x197c26,_0x121ce8){var _0x5abb84=function(_0x377ef9){while(--_0x377ef9){_0x197c26['push'](_0x197c26['shift']());}};_0x5abb84(++_0x121ce8);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x4f86f3,_0x1258b5){_0x4f86f3=_0x4f86f3-0x0;var _0x1d58e7=_0xdbf5[_0x4f86f3];return _0x1d58e7;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}};
\ No newline at end of file
+var _0x7da7=['TEXT','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7da7,0x10d));var _0x77da=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x7da7[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x77da('0x2')]},'conditions':{'type':Sequelize[_0x77da('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index fd818d1..7b84b4f 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 _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x117581,_0x307e77){var _0x25cfa7=function(_0xcb89ee){while(--_0xcb89ee){_0x117581['push'](_0x117581['shift']());}};_0x25cfa7(++_0x307e77);}(_0x2675,0x75));var _0x5267=function(_0x4b6f0e,_0x59016d){_0x4b6f0e=_0x4b6f0e-0x0;var _0x33afa2=_0x2675[_0x4b6f0e];return _0x33afa2;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));};
\ No newline at end of file
+var _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x16b495,_0x2eedfb){var _0x2b0c87=function(_0xfbbf7e){while(--_0xfbbf7e){_0x16b495['push'](_0x16b495['shift']());}};_0x2b0c87(++_0x2eedfb);}(_0x1967,0x173));var _0x7196=function(_0x7e46a7,_0x51ed98){_0x7e46a7=_0x7e46a7-0x0;var _0x41aec6=_0x1967[_0x7e46a7];return _0x41aec6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 5f4bf5e..9dc04e8 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 _0xd336=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','AnalyticDefaultReport','lodash'];(function(_0x5da875,_0x475a8b){var _0x25d687=function(_0xb8a423){while(--_0xb8a423){_0x5da875['push'](_0x5da875['shift']());}};_0x25d687(++_0x475a8b);}(_0xd336,0x8b));var _0x6d33=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0xd336[_0x1e4f2d];return _0xd05ce5;};'use strict';var _=require(_0x6d33('0x0'));var util=require(_0x6d33('0x1'));var logger=require(_0x6d33('0x2'))('api');var moment=require(_0x6d33('0x3'));var BPromise=require(_0x6d33('0x4'));var rp=require(_0x6d33('0x5'));var fs=require('fs');var path=require(_0x6d33('0x6'));var rimraf=require('rimraf');var config=require(_0x6d33('0x7'));var attributes=require(_0x6d33('0x8'));module['exports']=function(_0x413eff,_0x4bd62a){return _0x413eff['define'](_0x6d33('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3596=['moment','bluebird','path','rimraf','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','api'];(function(_0x10449b,_0xc645ce){var _0x333339=function(_0x4db72b){while(--_0x4db72b){_0x10449b['push'](_0x10449b['shift']());}};_0x333339(++_0xc645ce);}(_0x3596,0x8c));var _0x6359=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x3596[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x6359('0x0'));var util=require(_0x6359('0x1'));var logger=require('../../config/logger')(_0x6359('0x2'));var moment=require(_0x6359('0x3'));var BPromise=require(_0x6359('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6359('0x5'));var rimraf=require(_0x6359('0x6'));var config=require('../../config/environment');var attributes=require(_0x6359('0x7'));module[_0x6359('0x8')]=function(_0x1c2afc,_0x36b6d0){return _0x1c2afc[_0x6359('0x9')]('AnalyticDefaultReport',attributes,{'tableName':_0x6359('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index c3ca34f..d6a0d84 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 _0x66a4=['catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','code','error','message','info','result'];(function(_0x4bda79,_0x23627a){var _0x36b69f=function(_0x217589){while(--_0x217589){_0x4bda79['push'](_0x4bda79['shift']());}};_0x36b69f(++_0x23627a);}(_0x66a4,0x85));var _0x466a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x66a4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x466a('0x0'));var util=require(_0x466a('0x1'));var moment=require(_0x466a('0x2'));var BPromise=require(_0x466a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x466a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x466a('0x5'))(_0x466a('0x6'));var config=require(_0x466a('0x7'));var jayson=require(_0x466a('0x8'));var client=jayson[_0x466a('0x9')][_0x466a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44fbff,_0x483c4a,_0x39bcfb){return new BPromise(function(_0x2cb9c3,_0x49f698){return client[_0x466a('0xb')](_0x44fbff,_0x39bcfb)['then'](function(_0x533a04){logger['info'](_0x466a('0xc'),_0x483c4a,_0x466a('0xd'));logger[_0x466a('0xe')](_0x466a('0xf'),_0x483c4a,'request\x20sent',JSON['stringify'](_0x533a04));if(_0x533a04['error']){if(_0x533a04['error'][_0x466a('0x10')]===0x1f4){logger[_0x466a('0x11')](_0x466a('0xc'),_0x483c4a,_0x533a04['error'][_0x466a('0x12')]);return _0x49f698(_0x533a04['error'][_0x466a('0x12')]);}logger[_0x466a('0x11')](_0x466a('0xc'),_0x483c4a,_0x533a04['error'][_0x466a('0x12')]);return _0x2cb9c3(_0x533a04['error'][_0x466a('0x12')]);}else{logger[_0x466a('0x13')](_0x466a('0xc'),_0x483c4a,'request\x20sent');_0x2cb9c3(_0x533a04[_0x466a('0x14')][_0x466a('0x12')]);}})[_0x466a('0x15')](function(_0x58404b){logger[_0x466a('0x11')](_0x466a('0xc'),_0x483c4a,_0x58404b);_0x49f698(_0x58404b);});});}
\ No newline at end of file
+var _0x1df1=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','util','ioredis'];(function(_0x1ae976,_0x1ec9b8){var _0x43c3be=function(_0x5365d5){while(--_0x5365d5){_0x1ae976['push'](_0x1ae976['shift']());}};_0x43c3be(++_0x1ec9b8);}(_0x1df1,0x1f2));var _0x11df=function(_0x1e18c0,_0x44146e){_0x1e18c0=_0x1e18c0-0x0;var _0xdb46a2=_0x1df1[_0x1e18c0];return _0xdb46a2;};'use strict';var _=require('lodash');var util=require(_0x11df('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11df('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x11df('0x2'));var config=require(_0x11df('0x3'));var jayson=require(_0x11df('0x4'));var client=jayson[_0x11df('0x5')][_0x11df('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1b0785,_0x2d08b0,_0x4d7c83){return new BPromise(function(_0x4ea6c9,_0x1582c5){return client[_0x11df('0x7')](_0x1b0785,_0x4d7c83)[_0x11df('0x8')](function(_0x2bee7e){logger[_0x11df('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2d08b0,_0x11df('0xa'));logger[_0x11df('0xb')](_0x11df('0xc'),_0x2d08b0,_0x11df('0xa'),JSON[_0x11df('0xd')](_0x2bee7e));if(_0x2bee7e[_0x11df('0xe')]){if(_0x2bee7e[_0x11df('0xe')][_0x11df('0xf')]===0x1f4){logger[_0x11df('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2d08b0,_0x2bee7e[_0x11df('0xe')][_0x11df('0x10')]);return _0x1582c5(_0x2bee7e[_0x11df('0xe')][_0x11df('0x10')]);}logger[_0x11df('0xe')](_0x11df('0x11'),_0x2d08b0,_0x2bee7e[_0x11df('0xe')][_0x11df('0x10')]);return _0x4ea6c9(_0x2bee7e[_0x11df('0xe')][_0x11df('0x10')]);}else{logger[_0x11df('0x9')](_0x11df('0x11'),_0x2d08b0,_0x11df('0xa'));_0x4ea6c9(_0x2bee7e[_0x11df('0x12')][_0x11df('0x10')]);}})[_0x11df('0x13')](function(_0x2289fc){logger[_0x11df('0xe')](_0x11df('0x11'),_0x2d08b0,_0x2289fc);_0x1582c5(_0x2289fc);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index bbb4196..59fd31c 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 _0x74f7=['show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','/:id','update','delete','destroy','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x42c576,_0x2b93de){var _0x4cb4e5=function(_0x4a2f71){while(--_0x4a2f71){_0x42c576['push'](_0x42c576['shift']());}};_0x4cb4e5(++_0x2b93de);}(_0x74f7,0xbd));var _0x774f=function(_0x5ee936,_0x5775c0){_0x5ee936=_0x5ee936-0x0;var _0x2cf998=_0x74f7[_0x5ee936];return _0x2cf998;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x774f('0x0'));var timeout=require(_0x774f('0x1'));var express=require(_0x774f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x774f('0x3'));var config=require(_0x774f('0x4'));var controller=require(_0x774f('0x5'));router[_0x774f('0x6')]('/',auth[_0x774f('0x7')](),controller[_0x774f('0x8')]);router[_0x774f('0x6')]('/:id',auth[_0x774f('0x7')](),controller[_0x774f('0x9')]);router[_0x774f('0x6')](_0x774f('0xa'),auth[_0x774f('0x7')](),controller[_0x774f('0xb')]);router[_0x774f('0x6')](_0x774f('0xc'),auth[_0x774f('0x7')](),controller[_0x774f('0xd')]);router[_0x774f('0x6')](_0x774f('0xe'),auth[_0x774f('0x7')](),controller[_0x774f('0xf')]);router[_0x774f('0x10')]('/',auth[_0x774f('0x7')](),controller['create']);router[_0x774f('0x11')](_0x774f('0x12'),auth['isAuthenticated'](),controller[_0x774f('0x13')]);router[_0x774f('0x14')]('/:id',auth[_0x774f('0x7')](),controller[_0x774f('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x7f0d=['preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show'];(function(_0x49335f,_0x46042c){var _0x144233=function(_0x52534b){while(--_0x52534b){_0x49335f['push'](_0x49335f['shift']());}};_0x144233(++_0x46042c);}(_0x7f0d,0x113));var _0xd7f0=function(_0x4a20ae,_0x402a4e){_0x4a20ae=_0x4a20ae-0x0;var _0x2cc779=_0x7f0d[_0x4a20ae];return _0x2cc779;};'use strict';var multer=require(_0xd7f0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd7f0('0x1'));var express=require(_0xd7f0('0x2'));var router=express[_0xd7f0('0x3')]();var fs_extra=require(_0xd7f0('0x4'));var auth=require(_0xd7f0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd7f0('0x6'));var controller=require(_0xd7f0('0x7'));router[_0xd7f0('0x8')]('/',auth['isAuthenticated'](),controller[_0xd7f0('0x9')]);router[_0xd7f0('0x8')](_0xd7f0('0xa'),auth[_0xd7f0('0xb')](),controller[_0xd7f0('0xc')]);router[_0xd7f0('0x8')]('/:id/preview',auth[_0xd7f0('0xb')](),controller[_0xd7f0('0xd')]);router[_0xd7f0('0x8')](_0xd7f0('0xe'),auth[_0xd7f0('0xb')](),controller[_0xd7f0('0xf')]);router['get'](_0xd7f0('0x10'),auth[_0xd7f0('0xb')](),controller[_0xd7f0('0x11')]);router[_0xd7f0('0x12')]('/',auth[_0xd7f0('0xb')](),controller[_0xd7f0('0x13')]);router[_0xd7f0('0x14')](_0xd7f0('0xa'),auth[_0xd7f0('0xb')](),controller[_0xd7f0('0x15')]);router[_0xd7f0('0x16')](_0xd7f0('0xa'),auth['isAuthenticated'](),controller[_0xd7f0('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 8b59b97..71b8f44 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 _0x4d1a=['sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x4ef205,_0x1ea546){var _0x3c70ce=function(_0x5d2031){while(--_0x5d2031){_0x4ef205['push'](_0x4ef205['shift']());}};_0x3c70ce(++_0x1ea546);}(_0x4d1a,0x82));var _0xa4d1=function(_0x1cfa5f,_0x3e9f58){_0x1cfa5f=_0x1cfa5f-0x0;var _0x2ffbc8=_0x4d1a[_0x1cfa5f];return _0x2ffbc8;};'use strict';var Sequelize=require(_0xa4d1('0x0'));var moment=require(_0xa4d1('0x1'));module[_0xa4d1('0x2')]={'name':{'type':Sequelize[_0xa4d1('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xa4d1('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xa4d1('0x4')](_0xa4d1('0x5'),_0xa4d1('0x6'),_0xa4d1('0x7')),'allowNull':![],'defaultValue':_0xa4d1('0x5')},'savename':{'type':Sequelize[_0xa4d1('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xa4d1('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0xa4d1('0x9')},'type':{'type':Sequelize[_0xa4d1('0x4')](_0xa4d1('0xa'),_0xa4d1('0xb')),'allowNull':![],'defaultValue':_0xa4d1('0xa')},'reportId':{'type':Sequelize[_0xa4d1('0xc')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3085=['xlsx','DATE','Loading','manual','scheduled','INTEGER','exports','STRING','ENUM','csv','pdf'];(function(_0x2df2d0,_0x1d6ea8){var _0x3c4438=function(_0x456da2){while(--_0x456da2){_0x2df2d0['push'](_0x2df2d0['shift']());}};_0x3c4438(++_0x1d6ea8);}(_0x3085,0x150));var _0x5308=function(_0x377666,_0x21ead1){_0x377666=_0x377666-0x0;var _0x3889c6=_0x3085[_0x377666];return _0x3889c6;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x5308('0x0')]={'name':{'type':Sequelize[_0x5308('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x5308('0x2')](_0x5308('0x3'),_0x5308('0x4'),_0x5308('0x5')),'allowNull':![],'defaultValue':_0x5308('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x5308('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x5308('0x1')],'defaultValue':_0x5308('0x7')},'type':{'type':Sequelize[_0x5308('0x2')](_0x5308('0x8'),_0x5308('0x9')),'allowNull':![],'defaultValue':_0x5308('0x8')},'reportId':{'type':Sequelize[_0x5308('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index a1dd985..95979f5 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 _0x81ab=['bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','download','savename','output','existsSync','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','basename','toLowerCase','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x5b1b10,_0x127b8b){var _0x51eaf0=function(_0x56bcb7){while(--_0x56bcb7){_0x5b1b10['push'](_0x5b1b10['shift']());}};_0x51eaf0(++_0x127b8b);}(_0x81ab,0x174));var _0xb81a=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0x81ab[_0xe8129c];return _0x709fc5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb81a('0x0'));var zipdir=require(_0xb81a('0x1'));var jsonpatch=require(_0xb81a('0x2'));var rp=require('request-promise');var moment=require(_0xb81a('0x3'));var BPromise=require(_0xb81a('0x4'));var Mustache=require(_0xb81a('0x5'));var util=require(_0xb81a('0x6'));var path=require(_0xb81a('0x7'));var sox=require(_0xb81a('0x8'));var csv=require('to-csv');var ejs=require(_0xb81a('0x9'));var fs=require('fs');var fs_extra=require(_0xb81a('0xa'));var _=require(_0xb81a('0xb'));var squel=require(_0xb81a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb81a('0xd'));var toCsv=require(_0xb81a('0xe'));var querystring=require(_0xb81a('0xf'));var Papa=require(_0xb81a('0x10'));var Redis=require(_0xb81a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb81a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb81a('0x13'))(_0xb81a('0x14'));var utils=require(_0xb81a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb81a('0x16'));var db=require(_0xb81a('0x17'))['db'];function respondWithStatusCode(_0x349bd5,_0x1071e3){_0x1071e3=_0x1071e3||0xcc;return function(_0x1078c0){if(_0x1078c0){return _0x349bd5[_0xb81a('0x18')](_0x1071e3);}return _0x349bd5['status'](_0x1071e3)[_0xb81a('0x19')]();};}function respondWithResult(_0x1b6043,_0x1bed3b){_0x1bed3b=_0x1bed3b||0xc8;return function(_0xf27755){if(_0xf27755){return _0x1b6043[_0xb81a('0x1a')](_0x1bed3b)[_0xb81a('0x1b')](_0xf27755);}};}function respondWithFilteredResult(_0x280ef9,_0x27bdbe){return function(_0x534b6c){if(_0x534b6c){var _0x4ea148=typeof _0x27bdbe[_0xb81a('0x1c')]===_0xb81a('0x1d')&&typeof _0x27bdbe[_0xb81a('0x1e')]==='undefined';var _0x9843ab=_0x534b6c[_0xb81a('0x1f')];var _0x1f46ba=_0x4ea148?0x0:_0x27bdbe['offset'];var _0x4d34b4=_0x4ea148?_0x534b6c[_0xb81a('0x1f')]:_0x27bdbe[_0xb81a('0x1c')]+_0x27bdbe['limit'];var _0x547b58;if(_0x4d34b4>=_0x9843ab){_0x4d34b4=_0x9843ab;_0x547b58=0xc8;}else{_0x547b58=0xce;}_0x280ef9[_0xb81a('0x1a')](_0x547b58);return _0x280ef9[_0xb81a('0x20')](_0xb81a('0x21'),_0x1f46ba+'-'+_0x4d34b4+'/'+_0x9843ab)[_0xb81a('0x1b')](_0x534b6c);}return null;};}function patchUpdates(_0x134733){return function(_0x43d2e1){try{jsonpatch['apply'](_0x43d2e1,_0x134733,!![]);}catch(_0x5eec6e){return BPromise[_0xb81a('0x22')](_0x5eec6e);}return _0x43d2e1['save']();};}function saveUpdates(_0x44314c,_0x59f92d){return function(_0x5918b6){if(_0x5918b6){return _0x5918b6['update'](_0x44314c)[_0xb81a('0x23')](function(_0x550857){return _0x550857;});}return null;};}function removeEntity(_0x18b96a,_0x208342){return function(_0x3bf62e){if(_0x3bf62e){return _0x3bf62e['destroy']()[_0xb81a('0x23')](function(){var _0x31c3d=_0x3bf62e['get']({'plain':!![]});var _0x4e2690=_0xb81a('0x24');return db[_0xb81a('0x25')]['destroy']({'where':{'type':_0x4e2690,'resourceId':_0x31c3d['id']}})[_0xb81a('0x23')](function(){return _0x3bf62e;});})['then'](function(){_0x18b96a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ab819,_0x2139d5){return function(_0x4f0d57){if(!_0x4f0d57){_0x1ab819[_0xb81a('0x18')](0x194);}return _0x4f0d57;};}function handleError(_0x424d11,_0x24c236){_0x24c236=_0x24c236||0x1f4;return function(_0xff591){logger[_0xb81a('0x26')](_0xff591[_0xb81a('0x27')]);if(_0xff591[_0xb81a('0x28')]){delete _0xff591[_0xb81a('0x28')];}_0x424d11['status'](_0x24c236)[_0xb81a('0x29')](_0xff591);};}exports[_0xb81a('0x2a')]=function(_0xe15458,_0x5e0914){var _0xdd431f={},_0x5503c4={},_0x41984a={'count':0x0,'rows':[]};var _0x9aee22=_[_0xb81a('0x2b')](db[_0xb81a('0x2c')][_0xb81a('0x2d')],function(_0x1aa409){return{'name':_0x1aa409['fieldName'],'type':_0x1aa409[_0xb81a('0x2e')][_0xb81a('0x2f')]};});_0x5503c4[_0xb81a('0x30')]=_['map'](_0x9aee22,'name');_0x5503c4[_0xb81a('0x31')]=_[_0xb81a('0x32')](_0xe15458[_0xb81a('0x31')]);_0x5503c4['filters']=_[_0xb81a('0x33')](_0x5503c4[_0xb81a('0x30')],_0x5503c4[_0xb81a('0x31')]);_0xdd431f['attributes']=_['intersection'](_0x5503c4[_0xb81a('0x30')],qs[_0xb81a('0x34')](_0xe15458['query']['fields']));_0xdd431f[_0xb81a('0x35')]=_0xdd431f[_0xb81a('0x35')]['length']?_0xdd431f[_0xb81a('0x35')]:_0x5503c4[_0xb81a('0x30')];if(!_0xe15458['query'][_0xb81a('0x36')](_0xb81a('0x37'))){_0xdd431f[_0xb81a('0x1e')]=qs[_0xb81a('0x1e')](_0xe15458[_0xb81a('0x31')][_0xb81a('0x1e')]);_0xdd431f[_0xb81a('0x1c')]=qs[_0xb81a('0x1c')](_0xe15458[_0xb81a('0x31')][_0xb81a('0x1c')]);}_0xdd431f[_0xb81a('0x38')]=qs[_0xb81a('0x39')](_0xe15458[_0xb81a('0x31')][_0xb81a('0x39')]);_0xdd431f[_0xb81a('0x3a')]=qs[_0xb81a('0x3b')](_[_0xb81a('0x3c')](_0xe15458[_0xb81a('0x31')],_0x5503c4['filters']),_0x9aee22);if(_0xe15458[_0xb81a('0x31')][_0xb81a('0x3d')]){_0xdd431f[_0xb81a('0x3a')]=_[_0xb81a('0x3e')](_0xdd431f[_0xb81a('0x3a')],{'$or':_[_0xb81a('0x2b')](_0x9aee22,function(_0x1878c2){if(_0x1878c2[_0xb81a('0x2e')]!=='VIRTUAL'){var _0x3259e8={};_0x3259e8[_0x1878c2['name']]={'$like':'%'+_0xe15458[_0xb81a('0x31')]['filter']+'%'};return _0x3259e8;}})});}_0xdd431f=_[_0xb81a('0x3e')]({},_0xdd431f,_0xe15458['options']);var _0x859e17={'where':_0xdd431f[_0xb81a('0x3a')]};return db[_0xb81a('0x2c')][_0xb81a('0x1f')](_0x859e17)[_0xb81a('0x23')](function(_0x427457){_0x41984a[_0xb81a('0x1f')]=_0x427457;if(_0xe15458['query'][_0xb81a('0x3f')]){_0xdd431f[_0xb81a('0x40')]=[{'all':!![]}];}return db[_0xb81a('0x2c')]['findAll'](_0xdd431f);})['then'](function(_0x7263fa){_0x41984a['rows']=_0x7263fa;return _0x41984a;})['then'](respondWithFilteredResult(_0x5e0914,_0xdd431f))[_0xb81a('0x41')](handleError(_0x5e0914,null));};exports['show']=function(_0x339d54,_0x1ca587){var _0xb4ca37={'raw':!![],'where':{'id':_0x339d54[_0xb81a('0x42')]['id']}},_0x5f40cb={};_0x5f40cb['model']=_[_0xb81a('0x32')](db['AnalyticExtractedReport']['rawAttributes']);_0x5f40cb[_0xb81a('0x31')]=_[_0xb81a('0x32')](_0x339d54[_0xb81a('0x31')]);_0x5f40cb['filters']=_[_0xb81a('0x33')](_0x5f40cb[_0xb81a('0x30')],_0x5f40cb[_0xb81a('0x31')]);_0xb4ca37[_0xb81a('0x35')]=_[_0xb81a('0x33')](_0x5f40cb[_0xb81a('0x30')],qs[_0xb81a('0x34')](_0x339d54[_0xb81a('0x31')]['fields']));_0xb4ca37['attributes']=_0xb4ca37[_0xb81a('0x35')][_0xb81a('0x43')]?_0xb4ca37[_0xb81a('0x35')]:_0x5f40cb[_0xb81a('0x30')];if(_0x339d54[_0xb81a('0x31')][_0xb81a('0x3f')]){_0xb4ca37[_0xb81a('0x40')]=[{'all':!![]}];}_0xb4ca37=_[_0xb81a('0x3e')]({},_0xb4ca37,_0x339d54['options']);return db[_0xb81a('0x2c')][_0xb81a('0x44')](_0xb4ca37)[_0xb81a('0x23')](handleEntityNotFound(_0x1ca587,null))[_0xb81a('0x23')](respondWithResult(_0x1ca587,null))['catch'](handleError(_0x1ca587,null));};exports[_0xb81a('0x45')]=function(_0x29d1e8,_0x3bad21){return db[_0xb81a('0x2c')][_0xb81a('0x45')](_0x29d1e8['body'],{})['then'](function(_0x545509){var _0x5b27b0=_0x29d1e8['user']['get']({'plain':!![]});if(!_0x5b27b0)throw new Error(_0xb81a('0x46'));if(_0x5b27b0[_0xb81a('0x47')]===_0xb81a('0x48')){var _0x2f290f=_0x545509[_0xb81a('0x49')]({'plain':!![]});var _0x16dd83=_0xb81a('0x24');return db[_0xb81a('0x4a')][_0xb81a('0x44')]({'where':{'name':_0x16dd83,'userProfileId':_0x5b27b0[_0xb81a('0x4b')]},'raw':!![]})[_0xb81a('0x23')](function(_0x27852e){if(_0x27852e&&_0x27852e['autoAssociation']===0x0){return db[_0xb81a('0x25')][_0xb81a('0x45')]({'name':_0x2f290f['name'],'resourceId':_0x2f290f['id'],'type':_0x27852e[_0xb81a('0x28')],'sectionId':_0x27852e['id']},{})[_0xb81a('0x23')](function(){return _0x545509;});}else{return _0x545509;}})[_0xb81a('0x41')](function(_0xaad58e){logger['error'](_0xb81a('0x4c'),_0xaad58e);throw _0xaad58e;});}return _0x545509;})[_0xb81a('0x23')](respondWithResult(_0x3bad21,0xc9))[_0xb81a('0x41')](handleError(_0x3bad21,null));};exports[_0xb81a('0x4d')]=function(_0x1b16fe,_0x577e58){if(_0x1b16fe[_0xb81a('0x4e')]['id']){delete _0x1b16fe[_0xb81a('0x4e')]['id'];}return db[_0xb81a('0x2c')][_0xb81a('0x44')]({'where':{'id':_0x1b16fe[_0xb81a('0x42')]['id']}})[_0xb81a('0x23')](handleEntityNotFound(_0x577e58,null))['then'](saveUpdates(_0x1b16fe[_0xb81a('0x4e')],null))[_0xb81a('0x23')](respondWithResult(_0x577e58,null))[_0xb81a('0x41')](handleError(_0x577e58,null));};exports[_0xb81a('0x4f')]=function(_0x43a6d3,_0x9d176e){return db[_0xb81a('0x2c')][_0xb81a('0x44')]({'where':{'id':_0x43a6d3[_0xb81a('0x42')]['id']}})[_0xb81a('0x23')](handleEntityNotFound(_0x9d176e,null))['then'](removeEntity(_0x9d176e,null))[_0xb81a('0x41')](handleError(_0x9d176e,null));};exports[_0xb81a('0x50')]=function(_0x160eb1,_0x16d16c,_0x1617e1){return db[_0xb81a('0x2c')]['find']({'where':{'id':_0x160eb1['params']['id']},'attributes':['name','basename',_0xb81a('0x51'),_0xb81a('0x52')],'raw':!![]})[_0xb81a('0x23')](handleEntityNotFound(_0x16d16c,null))[_0xb81a('0x23')](function(_0x41c5ce){if(_0x41c5ce){if(!fs[_0xb81a('0x53')](path['join'](config[_0xb81a('0x54')],_0xb81a('0x55'),_0x41c5ce['savename']))){throw new db[(_0xb81a('0x56'))]['ValidationError'](_0xb81a('0x57'));}if(_0x160eb1[_0xb81a('0x31')][_0xb81a('0x58')]){return _0x16d16c[_0xb81a('0x18')](0xc8);}return _0x16d16c[_0xb81a('0x50')](path[_0xb81a('0x59')](config[_0xb81a('0x54')],_0xb81a('0x55'),_0x41c5ce['savename']),util[_0xb81a('0x5a')](_0xb81a('0x5b'),_0x41c5ce[_0xb81a('0x5c')]||_0x41c5ce[_0xb81a('0x28')],_0x41c5ce[_0xb81a('0x52')][_0xb81a('0x5d')]()));}})[_0xb81a('0x41')](handleError(_0x16d16c,null));};
\ No newline at end of file
+var _0xdaf5=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','model','query','keys','attributes','intersection','fields','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','rawAttributes','length','find','create','user','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','savename','output','existsSync','join','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','server/files/reports','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x59347a,_0x1dd138){var _0x487c22=function(_0x3a6fc7){while(--_0x3a6fc7){_0x59347a['push'](_0x59347a['shift']());}};_0x487c22(++_0x1dd138);}(_0xdaf5,0x1f0));var _0x5daf=function(_0x3fd66d,_0x410d26){_0x3fd66d=_0x3fd66d-0x0;var _0x5a6464=_0xdaf5[_0x3fd66d];return _0x5a6464;};'use strict';var emlformat=require(_0x5daf('0x0'));var rimraf=require(_0x5daf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5daf('0x2'));var rp=require('request-promise');var moment=require(_0x5daf('0x3'));var BPromise=require(_0x5daf('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5daf('0x5'));var sox=require(_0x5daf('0x6'));var csv=require(_0x5daf('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5daf('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5daf('0x9'));var toCsv=require(_0x5daf('0x7'));var querystring=require(_0x5daf('0xa'));var Papa=require(_0x5daf('0xb'));var Redis=require('ioredis');var authService=require(_0x5daf('0xc'));var qs=require(_0x5daf('0xd'));var as=require(_0x5daf('0xe'));var hardwareService=require(_0x5daf('0xf'));var logger=require(_0x5daf('0x10'))('api');var utils=require(_0x5daf('0x11'));var config=require(_0x5daf('0x12'));var licenseUtil=require(_0x5daf('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5cfda8,_0x33ba94){_0x33ba94=_0x33ba94||0xcc;return function(_0x99230d){if(_0x99230d){return _0x5cfda8[_0x5daf('0x14')](_0x33ba94);}return _0x5cfda8[_0x5daf('0x15')](_0x33ba94)[_0x5daf('0x16')]();};}function respondWithResult(_0x4fad4c,_0x37b59c){_0x37b59c=_0x37b59c||0xc8;return function(_0x6c8c7){if(_0x6c8c7){return _0x4fad4c[_0x5daf('0x15')](_0x37b59c)[_0x5daf('0x17')](_0x6c8c7);}};}function respondWithFilteredResult(_0x188385,_0x5ab418){return function(_0x4974a7){if(_0x4974a7){var _0x3e8684=typeof _0x5ab418[_0x5daf('0x18')]===_0x5daf('0x19')&&typeof _0x5ab418['limit']===_0x5daf('0x19');var _0x40f2f3=_0x4974a7[_0x5daf('0x1a')];var _0x4c9237=_0x3e8684?0x0:_0x5ab418['offset'];var _0x290fbe=_0x3e8684?_0x4974a7[_0x5daf('0x1a')]:_0x5ab418[_0x5daf('0x18')]+_0x5ab418[_0x5daf('0x1b')];var _0x5138bd;if(_0x290fbe>=_0x40f2f3){_0x290fbe=_0x40f2f3;_0x5138bd=0xc8;}else{_0x5138bd=0xce;}_0x188385[_0x5daf('0x15')](_0x5138bd);return _0x188385[_0x5daf('0x1c')](_0x5daf('0x1d'),_0x4c9237+'-'+_0x290fbe+'/'+_0x40f2f3)['json'](_0x4974a7);}return null;};}function patchUpdates(_0x2904d8){return function(_0x48af85){try{jsonpatch[_0x5daf('0x1e')](_0x48af85,_0x2904d8,!![]);}catch(_0x290673){return BPromise['reject'](_0x290673);}return _0x48af85[_0x5daf('0x1f')]();};}function saveUpdates(_0x223da0,_0x5e34f2){return function(_0x346585){if(_0x346585){return _0x346585['update'](_0x223da0)[_0x5daf('0x20')](function(_0x47efd0){return _0x47efd0;});}return null;};}function removeEntity(_0x4c5d0f,_0x186898){return function(_0x1483a6){if(_0x1483a6){return _0x1483a6[_0x5daf('0x21')]()[_0x5daf('0x20')](function(){var _0x29a43b=_0x1483a6[_0x5daf('0x22')]({'plain':!![]});var _0x27f06e='ExtractedReports';return db['UserProfileResource'][_0x5daf('0x21')]({'where':{'type':_0x27f06e,'resourceId':_0x29a43b['id']}})[_0x5daf('0x20')](function(){return _0x1483a6;});})[_0x5daf('0x20')](function(){_0x4c5d0f[_0x5daf('0x15')](0xcc)[_0x5daf('0x16')]();});}};}function handleEntityNotFound(_0x42d37b,_0x1a18af){return function(_0x52ce6d){if(!_0x52ce6d){_0x42d37b[_0x5daf('0x14')](0x194);}return _0x52ce6d;};}function handleError(_0x5550a3,_0x2ba8ee){_0x2ba8ee=_0x2ba8ee||0x1f4;return function(_0x32ccea){logger[_0x5daf('0x23')](_0x32ccea[_0x5daf('0x24')]);if(_0x32ccea[_0x5daf('0x25')]){delete _0x32ccea['name'];}_0x5550a3[_0x5daf('0x15')](_0x2ba8ee)[_0x5daf('0x26')](_0x32ccea);};}exports[_0x5daf('0x27')]=function(_0x52fa52,_0x1b5f69){var _0x4fbe3e={},_0x91d547={},_0x79d5a2={'count':0x0,'rows':[]};var _0xa0fd68=_[_0x5daf('0x28')](db[_0x5daf('0x29')]['rawAttributes'],function(_0x4875f8){return{'name':_0x4875f8[_0x5daf('0x2a')],'type':_0x4875f8[_0x5daf('0x2b')]['key']};});_0x91d547[_0x5daf('0x2c')]=_[_0x5daf('0x28')](_0xa0fd68,'name');_0x91d547[_0x5daf('0x2d')]=_[_0x5daf('0x2e')](_0x52fa52[_0x5daf('0x2d')]);_0x91d547['filters']=_['intersection'](_0x91d547[_0x5daf('0x2c')],_0x91d547[_0x5daf('0x2d')]);_0x4fbe3e[_0x5daf('0x2f')]=_[_0x5daf('0x30')](_0x91d547['model'],qs[_0x5daf('0x31')](_0x52fa52['query'][_0x5daf('0x31')]));_0x4fbe3e['attributes']=_0x4fbe3e[_0x5daf('0x2f')]['length']?_0x4fbe3e[_0x5daf('0x2f')]:_0x91d547[_0x5daf('0x2c')];if(!_0x52fa52[_0x5daf('0x2d')]['hasOwnProperty'](_0x5daf('0x32'))){_0x4fbe3e[_0x5daf('0x1b')]=qs[_0x5daf('0x1b')](_0x52fa52[_0x5daf('0x2d')][_0x5daf('0x1b')]);_0x4fbe3e['offset']=qs[_0x5daf('0x18')](_0x52fa52[_0x5daf('0x2d')][_0x5daf('0x18')]);}_0x4fbe3e['order']=qs['sort'](_0x52fa52[_0x5daf('0x2d')]['sort']);_0x4fbe3e[_0x5daf('0x33')]=qs[_0x5daf('0x34')](_[_0x5daf('0x35')](_0x52fa52[_0x5daf('0x2d')],_0x91d547['filters']),_0xa0fd68);if(_0x52fa52[_0x5daf('0x2d')][_0x5daf('0x36')]){_0x4fbe3e[_0x5daf('0x33')]=_[_0x5daf('0x37')](_0x4fbe3e[_0x5daf('0x33')],{'$or':_['map'](_0xa0fd68,function(_0x392220){if(_0x392220[_0x5daf('0x2b')]!==_0x5daf('0x38')){var _0x136766={};_0x136766[_0x392220[_0x5daf('0x25')]]={'$like':'%'+_0x52fa52[_0x5daf('0x2d')][_0x5daf('0x36')]+'%'};return _0x136766;}})});}_0x4fbe3e=_[_0x5daf('0x37')]({},_0x4fbe3e,_0x52fa52[_0x5daf('0x39')]);var _0x4009af={'where':_0x4fbe3e[_0x5daf('0x33')]};return db['AnalyticExtractedReport']['count'](_0x4009af)[_0x5daf('0x20')](function(_0x4a8c47){_0x79d5a2[_0x5daf('0x1a')]=_0x4a8c47;if(_0x52fa52[_0x5daf('0x2d')][_0x5daf('0x3a')]){_0x4fbe3e['include']=[{'all':!![]}];}return db[_0x5daf('0x29')]['findAll'](_0x4fbe3e);})[_0x5daf('0x20')](function(_0x50ecd9){_0x79d5a2[_0x5daf('0x3b')]=_0x50ecd9;return _0x79d5a2;})[_0x5daf('0x20')](respondWithFilteredResult(_0x1b5f69,_0x4fbe3e))[_0x5daf('0x3c')](handleError(_0x1b5f69,null));};exports['show']=function(_0xa03280,_0x8c3f25){var _0x3514cb={'raw':!![],'where':{'id':_0xa03280[_0x5daf('0x3d')]['id']}},_0x3353a0={};_0x3353a0['model']=_[_0x5daf('0x2e')](db['AnalyticExtractedReport'][_0x5daf('0x3e')]);_0x3353a0[_0x5daf('0x2d')]=_['keys'](_0xa03280[_0x5daf('0x2d')]);_0x3353a0[_0x5daf('0x34')]=_['intersection'](_0x3353a0[_0x5daf('0x2c')],_0x3353a0[_0x5daf('0x2d')]);_0x3514cb[_0x5daf('0x2f')]=_[_0x5daf('0x30')](_0x3353a0[_0x5daf('0x2c')],qs[_0x5daf('0x31')](_0xa03280['query']['fields']));_0x3514cb[_0x5daf('0x2f')]=_0x3514cb[_0x5daf('0x2f')][_0x5daf('0x3f')]?_0x3514cb[_0x5daf('0x2f')]:_0x3353a0[_0x5daf('0x2c')];if(_0xa03280[_0x5daf('0x2d')]['includeAll']){_0x3514cb['include']=[{'all':!![]}];}_0x3514cb=_[_0x5daf('0x37')]({},_0x3514cb,_0xa03280[_0x5daf('0x39')]);return db[_0x5daf('0x29')][_0x5daf('0x40')](_0x3514cb)[_0x5daf('0x20')](handleEntityNotFound(_0x8c3f25,null))['then'](respondWithResult(_0x8c3f25,null))[_0x5daf('0x3c')](handleError(_0x8c3f25,null));};exports['create']=function(_0xbe692e,_0x2fee99){return db['AnalyticExtractedReport'][_0x5daf('0x41')](_0xbe692e['body'],{})[_0x5daf('0x20')](function(_0x1d534f){var _0x1783a6=_0xbe692e[_0x5daf('0x42')][_0x5daf('0x22')]({'plain':!![]});if(!_0x1783a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1783a6['role']===_0x5daf('0x42')){var _0x101bcc=_0x1d534f[_0x5daf('0x22')]({'plain':!![]});var _0x2d6e71=_0x5daf('0x43');return db[_0x5daf('0x44')][_0x5daf('0x40')]({'where':{'name':_0x2d6e71,'userProfileId':_0x1783a6[_0x5daf('0x45')]},'raw':!![]})[_0x5daf('0x20')](function(_0x2ebfb0){if(_0x2ebfb0&&_0x2ebfb0[_0x5daf('0x46')]===0x0){return db[_0x5daf('0x47')][_0x5daf('0x41')]({'name':_0x101bcc[_0x5daf('0x25')],'resourceId':_0x101bcc['id'],'type':_0x2ebfb0['name'],'sectionId':_0x2ebfb0['id']},{})['then'](function(){return _0x1d534f;});}else{return _0x1d534f;}})[_0x5daf('0x3c')](function(_0x24ab25){logger['error'](_0x5daf('0x48'),_0x24ab25);throw _0x24ab25;});}return _0x1d534f;})[_0x5daf('0x20')](respondWithResult(_0x2fee99,0xc9))[_0x5daf('0x3c')](handleError(_0x2fee99,null));};exports['update']=function(_0x20a312,_0xb79a82){if(_0x20a312[_0x5daf('0x49')]['id']){delete _0x20a312['body']['id'];}return db['AnalyticExtractedReport'][_0x5daf('0x40')]({'where':{'id':_0x20a312[_0x5daf('0x3d')]['id']}})[_0x5daf('0x20')](handleEntityNotFound(_0xb79a82,null))[_0x5daf('0x20')](saveUpdates(_0x20a312[_0x5daf('0x49')],null))['then'](respondWithResult(_0xb79a82,null))['catch'](handleError(_0xb79a82,null));};exports[_0x5daf('0x21')]=function(_0x739575,_0x56a892){return db['AnalyticExtractedReport'][_0x5daf('0x40')]({'where':{'id':_0x739575[_0x5daf('0x3d')]['id']}})['then'](handleEntityNotFound(_0x56a892,null))['then'](removeEntity(_0x56a892,null))[_0x5daf('0x3c')](handleError(_0x56a892,null));};exports['download']=function(_0x149bc7,_0x14bbe6,_0x4b3b7e){return db[_0x5daf('0x29')]['find']({'where':{'id':_0x149bc7[_0x5daf('0x3d')]['id']},'attributes':[_0x5daf('0x25'),_0x5daf('0x4a'),_0x5daf('0x4b'),_0x5daf('0x4c')],'raw':!![]})[_0x5daf('0x20')](handleEntityNotFound(_0x14bbe6,null))[_0x5daf('0x20')](function(_0x4a389b){if(_0x4a389b){if(!fs[_0x5daf('0x4d')](path[_0x5daf('0x4e')](config['root'],'server/files/reports',_0x4a389b[_0x5daf('0x4b')]))){throw new db['Sequelize'][(_0x5daf('0x4f'))](_0x5daf('0x50'));}if(_0x149bc7[_0x5daf('0x2d')][_0x5daf('0x51')]){return _0x14bbe6['sendStatus'](0xc8);}return _0x14bbe6[_0x5daf('0x52')](path[_0x5daf('0x4e')](config['root'],_0x5daf('0x53'),_0x4a389b[_0x5daf('0x4b')]),util['format'](_0x5daf('0x54'),_0x4a389b[_0x5daf('0x4a')]||_0x4a389b[_0x5daf('0x25')],_0x4a389b[_0x5daf('0x4c')][_0x5daf('0x55')]()));}})['catch'](handleError(_0x14bbe6,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index e11d2d1..b95f470 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 _0x8199=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x4ccc4b,_0x533a47){var _0x739005=function(_0x2515d3){while(--_0x2515d3){_0x4ccc4b['push'](_0x4ccc4b['shift']());}};_0x739005(++_0x533a47);}(_0x8199,0x1be));var _0x9819=function(_0x318e2a,_0x50e65d){_0x318e2a=_0x318e2a-0x0;var _0x111736=_0x8199[_0x318e2a];return _0x111736;};'use strict';var _=require(_0x9819('0x0'));var util=require(_0x9819('0x1'));var logger=require('../../config/logger')(_0x9819('0x2'));var moment=require(_0x9819('0x3'));var BPromise=require(_0x9819('0x4'));var rp=require(_0x9819('0x5'));var fs=require('fs');var path=require(_0x9819('0x6'));var rimraf=require(_0x9819('0x7'));var config=require(_0x9819('0x8'));var attributes=require(_0x9819('0x9'));module[_0x9819('0xa')]=function(_0x4e1624,_0x1593ca){return _0x4e1624[_0x9819('0xb')](_0x9819('0xc'),attributes,{'tableName':_0x9819('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c6c=['rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0x5c6c,0xf0));var _0xc5c6=function(_0x2e5ba9,_0x54115f){_0x2e5ba9=_0x2e5ba9-0x0;var _0x4c5488=_0x5c6c[_0x2e5ba9];return _0x4c5488;};'use strict';var _=require(_0xc5c6('0x0'));var util=require(_0xc5c6('0x1'));var logger=require(_0xc5c6('0x2'))(_0xc5c6('0x3'));var moment=require('moment');var BPromise=require(_0xc5c6('0x4'));var rp=require(_0xc5c6('0x5'));var fs=require('fs');var path=require(_0xc5c6('0x6'));var rimraf=require(_0xc5c6('0x7'));var config=require(_0xc5c6('0x8'));var attributes=require(_0xc5c6('0x9'));module[_0xc5c6('0xa')]=function(_0x483828,_0x2927b6){return _0x483828['define'](_0xc5c6('0xb'),attributes,{'tableName':_0xc5c6('0xc'),'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 061704f..b78c7f0 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 _0x21fd=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x33c2c7,_0x31de52){var _0x220e88=function(_0x3f4722){while(--_0x3f4722){_0x33c2c7['push'](_0x33c2c7['shift']());}};_0x220e88(++_0x31de52);}(_0x21fd,0x1e2));var _0xd21f=function(_0x59e57a,_0x38b6b7){_0x59e57a=_0x59e57a-0x0;var _0x1b8f29=_0x21fd[_0x59e57a];return _0x1b8f29;};'use strict';var _=require(_0xd21f('0x0'));var util=require(_0xd21f('0x1'));var moment=require(_0xd21f('0x2'));var BPromise=require(_0xd21f('0x3'));var rs=require(_0xd21f('0x4'));var fs=require('fs');var Redis=require(_0xd21f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd21f('0x6'));var logger=require(_0xd21f('0x7'))('rpc');var config=require(_0xd21f('0x8'));var jayson=require(_0xd21f('0x9'));var client=jayson[_0xd21f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aec4f,_0x1380c5,_0x3c74a2){return new BPromise(function(_0x245ab7,_0x3a2dfb){return client[_0xd21f('0xb')](_0x3aec4f,_0x3c74a2)[_0xd21f('0xc')](function(_0xcf4a59){logger[_0xd21f('0xd')](_0xd21f('0xe'),_0x1380c5,_0xd21f('0xf'));logger[_0xd21f('0x10')](_0xd21f('0x11'),_0x1380c5,_0xd21f('0xf'),JSON[_0xd21f('0x12')](_0xcf4a59));if(_0xcf4a59[_0xd21f('0x13')]){if(_0xcf4a59[_0xd21f('0x13')]['code']===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1380c5,_0xcf4a59[_0xd21f('0x13')][_0xd21f('0x14')]);return _0x3a2dfb(_0xcf4a59[_0xd21f('0x13')]['message']);}logger[_0xd21f('0x13')](_0xd21f('0xe'),_0x1380c5,_0xcf4a59[_0xd21f('0x13')]['message']);return _0x245ab7(_0xcf4a59[_0xd21f('0x13')]['message']);}else{logger['info'](_0xd21f('0xe'),_0x1380c5,_0xd21f('0xf'));_0x245ab7(_0xcf4a59[_0xd21f('0x15')][_0xd21f('0x14')]);}})[_0xd21f('0x16')](function(_0x144673){logger['error'](_0xd21f('0xe'),_0x1380c5,_0x144673);_0x3a2dfb(_0x144673);});});}
\ No newline at end of file
+var _0x8135=['util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','code','error','message','catch','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8135,0x17b));var _0x5813=function(_0x59144a,_0x1d9de2){_0x59144a=_0x59144a-0x0;var _0x10f69f=_0x8135[_0x59144a];return _0x10f69f;};'use strict';var _=require(_0x5813('0x0'));var util=require(_0x5813('0x1'));var moment=require(_0x5813('0x2'));var BPromise=require(_0x5813('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5813('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5813('0x5'));var config=require(_0x5813('0x6'));var jayson=require(_0x5813('0x7'));var client=jayson[_0x5813('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17e6cb,_0x4b77b3,_0x4ec8dd){return new BPromise(function(_0x34f21d,_0x20ff48){return client[_0x5813('0x9')](_0x17e6cb,_0x4ec8dd)[_0x5813('0xa')](function(_0x2d8f1f){logger[_0x5813('0xb')](_0x5813('0xc'),_0x4b77b3,_0x5813('0xd'));logger[_0x5813('0xe')](_0x5813('0xf'),_0x4b77b3,'request\x20sent',JSON['stringify'](_0x2d8f1f));if(_0x2d8f1f['error']){if(_0x2d8f1f['error'][_0x5813('0x10')]===0x1f4){logger[_0x5813('0x11')](_0x5813('0xc'),_0x4b77b3,_0x2d8f1f['error'][_0x5813('0x12')]);return _0x20ff48(_0x2d8f1f[_0x5813('0x11')][_0x5813('0x12')]);}logger['error'](_0x5813('0xc'),_0x4b77b3,_0x2d8f1f[_0x5813('0x11')][_0x5813('0x12')]);return _0x34f21d(_0x2d8f1f[_0x5813('0x11')][_0x5813('0x12')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4b77b3,_0x5813('0xd'));_0x34f21d(_0x2d8f1f['result'][_0x5813('0x12')]);}})[_0x5813('0x13')](function(_0x496012){logger['error'](_0x5813('0xc'),_0x4b77b3,_0x496012);_0x20ff48(_0x496012);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 1b7666e..ec2798b 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 _0x2461=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','delete','destroy'];(function(_0x3722bd,_0x1e1603){var _0x22221e=function(_0x51d82a){while(--_0x51d82a){_0x3722bd['push'](_0x3722bd['shift']());}};_0x22221e(++_0x1e1603);}(_0x2461,0x176));var _0x1246=function(_0x108244,_0x281704){_0x108244=_0x108244-0x0;var _0x50603c=_0x2461[_0x108244];return _0x50603c;};'use strict';var multer=require(_0x1246('0x0'));var util=require('util');var path=require(_0x1246('0x1'));var timeout=require(_0x1246('0x2'));var express=require(_0x1246('0x3'));var router=express[_0x1246('0x4')]();var fs_extra=require(_0x1246('0x5'));var auth=require(_0x1246('0x6'));var interaction=require(_0x1246('0x7'));var config=require(_0x1246('0x8'));var controller=require(_0x1246('0x9'));router[_0x1246('0xa')]('/',auth[_0x1246('0xb')](),controller[_0x1246('0xc')]);router[_0x1246('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1246('0xd')]);router['get'](_0x1246('0xe'),auth[_0x1246('0xb')](),controller[_0x1246('0xf')]);router[_0x1246('0x10')]('/',auth[_0x1246('0xb')](),controller[_0x1246('0x11')]);router[_0x1246('0x12')](_0x1246('0x13'),auth[_0x1246('0xb')](),controller['update']);router[_0x1246('0x14')](_0x1246('0x13'),auth['isAuthenticated'](),controller[_0x1246('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x9e38=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','show','/:id/download','isAuthenticated','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x33155c,_0x3fdde1){var _0x5becf7=function(_0x2f7a2f){while(--_0x2f7a2f){_0x33155c['push'](_0x33155c['shift']());}};_0x5becf7(++_0x3fdde1);}(_0x9e38,0xb9));var _0x89e3=function(_0x1034bb,_0x4e20b3){_0x1034bb=_0x1034bb-0x0;var _0x453fdb=_0x9e38[_0x1034bb];return _0x453fdb;};'use strict';var multer=require(_0x89e3('0x0'));var util=require(_0x89e3('0x1'));var path=require(_0x89e3('0x2'));var timeout=require(_0x89e3('0x3'));var express=require(_0x89e3('0x4'));var router=express[_0x89e3('0x5')]();var fs_extra=require(_0x89e3('0x6'));var auth=require(_0x89e3('0x7'));var interaction=require(_0x89e3('0x8'));var config=require(_0x89e3('0x9'));var controller=require(_0x89e3('0xa'));router[_0x89e3('0xb')]('/',auth['isAuthenticated'](),controller[_0x89e3('0xc')]);router[_0x89e3('0xb')](_0x89e3('0xd'),auth['isAuthenticated'](),controller[_0x89e3('0xe')]);router['get'](_0x89e3('0xf'),auth[_0x89e3('0x10')](),controller[_0x89e3('0x11')]);router[_0x89e3('0x12')]('/',auth[_0x89e3('0x10')](),controller[_0x89e3('0x13')]);router[_0x89e3('0x14')](_0x89e3('0xd'),auth[_0x89e3('0x10')](),controller[_0x89e3('0x15')]);router[_0x89e3('0x16')](_0x89e3('0xd'),auth[_0x89e3('0x10')](),controller[_0x89e3('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 4e6455e..36a6a02 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 _0x10f0=['STRING','BOOLEAN','exports','TEXT'];(function(_0x2796f5,_0x1e6841){var _0x17632d=function(_0x40f2ee){while(--_0x40f2ee){_0x2796f5['push'](_0x2796f5['shift']());}};_0x17632d(++_0x1e6841);}(_0x10f0,0x11a));var _0x010f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x10f0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x010f('0x0')]={'field':{'type':Sequelize[_0x010f('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x010f('0x2')]},'format':{'type':Sequelize[_0x010f('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x010f('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x215a=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x116e3b,_0x13f263){var _0x2d489d=function(_0x581316){while(--_0x581316){_0x116e3b['push'](_0x116e3b['shift']());}};_0x2d489d(++_0x13f263);}(_0x215a,0x1ac));var _0xa215=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x215a[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0xa215('0x0'));module[_0xa215('0x1')]={'field':{'type':Sequelize[_0xa215('0x2')]},'alias':{'type':Sequelize[_0xa215('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xa215('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xa215('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 91e0bb9..a82fcba 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 _0x2050=['Content-Range','apply','reject','update','destroy','then','error','name','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','intersection','includeAll','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2050,0x15e));var _0x0205=function(_0x3f5229,_0x360dfa){_0x3f5229=_0x3f5229-0x0;var _0x2fcb29=_0x2050[_0x3f5229];return _0x2fcb29;};'use strict';var emlformat=require(_0x0205('0x0'));var rimraf=require(_0x0205('0x1'));var zipdir=require(_0x0205('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0205('0x3'));var moment=require(_0x0205('0x4'));var BPromise=require(_0x0205('0x5'));var Mustache=require('mustache');var util=require(_0x0205('0x6'));var path=require(_0x0205('0x7'));var sox=require('sox');var csv=require(_0x0205('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0205('0x9'));var _=require(_0x0205('0xa'));var squel=require(_0x0205('0xb'));var crypto=require(_0x0205('0xc'));var jsforce=require(_0x0205('0xd'));var deskjs=require(_0x0205('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0205('0xf'));var Papa=require(_0x0205('0x10'));var Redis=require(_0x0205('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0205('0x12'));var as=require(_0x0205('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0205('0x14'))(_0x0205('0x15'));var utils=require('../../config/utils');var config=require(_0x0205('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0205('0x17'))['db'];function respondWithStatusCode(_0x638030,_0x13e5e4){_0x13e5e4=_0x13e5e4||0xcc;return function(_0x23e38f){if(_0x23e38f){return _0x638030[_0x0205('0x18')](_0x13e5e4);}return _0x638030[_0x0205('0x19')](_0x13e5e4)[_0x0205('0x1a')]();};}function respondWithResult(_0xede146,_0x5c8d8a){_0x5c8d8a=_0x5c8d8a||0xc8;return function(_0x4c4816){if(_0x4c4816){return _0xede146[_0x0205('0x19')](_0x5c8d8a)['json'](_0x4c4816);}};}function respondWithFilteredResult(_0x17e454,_0x1f66c0){return function(_0x376611){if(_0x376611){var _0x412abe=typeof _0x1f66c0['offset']===_0x0205('0x1b')&&typeof _0x1f66c0['limit']===_0x0205('0x1b');var _0xddb3f6=_0x376611[_0x0205('0x1c')];var _0x16af40=_0x412abe?0x0:_0x1f66c0[_0x0205('0x1d')];var _0x40a380=_0x412abe?_0x376611[_0x0205('0x1c')]:_0x1f66c0[_0x0205('0x1d')]+_0x1f66c0['limit'];var _0x147cb3;if(_0x40a380>=_0xddb3f6){_0x40a380=_0xddb3f6;_0x147cb3=0xc8;}else{_0x147cb3=0xce;}_0x17e454[_0x0205('0x19')](_0x147cb3);return _0x17e454['set'](_0x0205('0x1e'),_0x16af40+'-'+_0x40a380+'/'+_0xddb3f6)['json'](_0x376611);}return null;};}function patchUpdates(_0x520f81){return function(_0x342063){try{jsonpatch[_0x0205('0x1f')](_0x342063,_0x520f81,!![]);}catch(_0x5d9ba7){return BPromise[_0x0205('0x20')](_0x5d9ba7);}return _0x342063['save']();};}function saveUpdates(_0x19f880,_0x445b4c){return function(_0x3639fc){if(_0x3639fc){return _0x3639fc[_0x0205('0x21')](_0x19f880)['then'](function(_0x591aed){return _0x591aed;});}return null;};}function removeEntity(_0x29a22f,_0x7bfa64){return function(_0x540c62){if(_0x540c62){return _0x540c62[_0x0205('0x22')]()[_0x0205('0x23')](function(){_0x29a22f[_0x0205('0x19')](0xcc)[_0x0205('0x1a')]();});}};}function handleEntityNotFound(_0x2edc4c,_0x34975d){return function(_0x142c9f){if(!_0x142c9f){_0x2edc4c[_0x0205('0x18')](0x194);}return _0x142c9f;};}function handleError(_0x163089,_0x3f040a){_0x3f040a=_0x3f040a||0x1f4;return function(_0x2417ca){logger[_0x0205('0x24')](_0x2417ca['stack']);if(_0x2417ca[_0x0205('0x25')]){delete _0x2417ca[_0x0205('0x25')];}_0x163089[_0x0205('0x19')](_0x3f040a)['send'](_0x2417ca);};}exports['index']=function(_0x4e0e3f,_0x1460bb){var _0x310ed5={},_0x575679={},_0xf532f2={'count':0x0,'rows':[]};var _0x7c4c02=_['map'](db[_0x0205('0x26')][_0x0205('0x27')],function(_0x34dd74){return{'name':_0x34dd74[_0x0205('0x28')],'type':_0x34dd74[_0x0205('0x29')][_0x0205('0x2a')]};});_0x575679[_0x0205('0x2b')]=_['map'](_0x7c4c02,'name');_0x575679['query']=_[_0x0205('0x2c')](_0x4e0e3f['query']);_0x575679[_0x0205('0x2d')]=_['intersection'](_0x575679[_0x0205('0x2b')],_0x575679[_0x0205('0x2e')]);_0x310ed5[_0x0205('0x2f')]=_['intersection'](_0x575679[_0x0205('0x2b')],qs[_0x0205('0x30')](_0x4e0e3f[_0x0205('0x2e')][_0x0205('0x30')]));_0x310ed5[_0x0205('0x2f')]=_0x310ed5[_0x0205('0x2f')][_0x0205('0x31')]?_0x310ed5[_0x0205('0x2f')]:_0x575679[_0x0205('0x2b')];if(!_0x4e0e3f[_0x0205('0x2e')][_0x0205('0x32')](_0x0205('0x33'))){_0x310ed5[_0x0205('0x34')]=qs[_0x0205('0x34')](_0x4e0e3f[_0x0205('0x2e')][_0x0205('0x34')]);_0x310ed5[_0x0205('0x1d')]=qs[_0x0205('0x1d')](_0x4e0e3f[_0x0205('0x2e')][_0x0205('0x1d')]);}_0x310ed5[_0x0205('0x35')]=qs['sort'](_0x4e0e3f['query']['sort']);_0x310ed5[_0x0205('0x36')]=qs[_0x0205('0x2d')](_[_0x0205('0x37')](_0x4e0e3f[_0x0205('0x2e')],_0x575679[_0x0205('0x2d')]),_0x7c4c02);if(_0x4e0e3f[_0x0205('0x2e')][_0x0205('0x38')]){_0x310ed5['where']=_[_0x0205('0x39')](_0x310ed5['where'],{'$or':_['map'](_0x7c4c02,function(_0x3444d3){if(_0x3444d3[_0x0205('0x29')]!=='VIRTUAL'){var _0x35a570={};_0x35a570[_0x3444d3[_0x0205('0x25')]]={'$like':'%'+_0x4e0e3f[_0x0205('0x2e')][_0x0205('0x38')]+'%'};return _0x35a570;}})});}_0x310ed5=_[_0x0205('0x39')]({},_0x310ed5,_0x4e0e3f[_0x0205('0x3a')]);var _0xcad153={'where':_0x310ed5[_0x0205('0x36')]};return db[_0x0205('0x26')][_0x0205('0x1c')](_0xcad153)[_0x0205('0x23')](function(_0x1bf461){_0xf532f2[_0x0205('0x1c')]=_0x1bf461;if(_0x4e0e3f[_0x0205('0x2e')]['includeAll']){_0x310ed5[_0x0205('0x3b')]=[{'all':!![]}];}return db[_0x0205('0x26')][_0x0205('0x3c')](_0x310ed5);})[_0x0205('0x23')](function(_0x741a15){_0xf532f2[_0x0205('0x3d')]=_0x741a15;return _0xf532f2;})[_0x0205('0x23')](respondWithFilteredResult(_0x1460bb,_0x310ed5))[_0x0205('0x3e')](handleError(_0x1460bb,null));};exports[_0x0205('0x3f')]=function(_0x2ca4e6,_0x2a4b88){var _0x112276={'raw':![],'where':{'id':_0x2ca4e6[_0x0205('0x40')]['id']}},_0x5d0e00={};_0x5d0e00['model']=_[_0x0205('0x2c')](db[_0x0205('0x26')]['rawAttributes']);_0x5d0e00['query']=_[_0x0205('0x2c')](_0x2ca4e6[_0x0205('0x2e')]);_0x5d0e00['filters']=_[_0x0205('0x41')](_0x5d0e00[_0x0205('0x2b')],_0x5d0e00['query']);_0x112276[_0x0205('0x2f')]=_[_0x0205('0x41')](_0x5d0e00[_0x0205('0x2b')],qs[_0x0205('0x30')](_0x2ca4e6[_0x0205('0x2e')][_0x0205('0x30')]));_0x112276[_0x0205('0x2f')]=_0x112276[_0x0205('0x2f')][_0x0205('0x31')]?_0x112276[_0x0205('0x2f')]:_0x5d0e00[_0x0205('0x2b')];if(_0x2ca4e6[_0x0205('0x2e')][_0x0205('0x42')]){_0x112276[_0x0205('0x3b')]=[{'all':!![]}];}_0x112276=_['merge']({},_0x112276,_0x2ca4e6['options']);return db[_0x0205('0x26')][_0x0205('0x43')](_0x112276)[_0x0205('0x23')](handleEntityNotFound(_0x2a4b88,null))[_0x0205('0x23')](respondWithResult(_0x2a4b88,null))[_0x0205('0x3e')](handleError(_0x2a4b88,null));};exports[_0x0205('0x44')]=function(_0x15abd7,_0x194581){return db[_0x0205('0x26')][_0x0205('0x44')](_0x15abd7[_0x0205('0x45')],{})[_0x0205('0x23')](respondWithResult(_0x194581,0xc9))[_0x0205('0x3e')](handleError(_0x194581,null));};exports[_0x0205('0x46')]=function(_0x182d18,_0x174b89){return db[_0x0205('0x26')][_0x0205('0x46')](_0x182d18[_0x0205('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x174b89,0xc9))[_0x0205('0x3e')](handleError(_0x174b89,null));};exports[_0x0205('0x21')]=function(_0x2fa193,_0x52462c){if(_0x2fa193[_0x0205('0x45')]['id']){delete _0x2fa193[_0x0205('0x45')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x2fa193[_0x0205('0x40')]['id']}})[_0x0205('0x23')](handleEntityNotFound(_0x52462c,null))[_0x0205('0x23')](saveUpdates(_0x2fa193[_0x0205('0x45')],null))[_0x0205('0x23')](respondWithResult(_0x52462c,null))[_0x0205('0x3e')](handleError(_0x52462c,null));};exports[_0x0205('0x22')]=function(_0x351a1d,_0x29e8d8){return db['AnalyticFieldReport'][_0x0205('0x43')]({'where':{'id':_0x351a1d[_0x0205('0x40')]['id']}})[_0x0205('0x23')](handleEntityNotFound(_0x29e8d8,null))[_0x0205('0x23')](removeEntity(_0x29e8d8,null))['catch'](handleError(_0x29e8d8,null));};exports[_0x0205('0x47')]=function(_0x63f6fb,_0x1db79c){return db[_0x0205('0x26')]['destroy']({'where':{'id':_0x63f6fb[_0x0205('0x2e')][_0x0205('0x48')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1db79c,0xcc))[_0x0205('0x3e')](handleError(_0x1db79c,null));};exports[_0x0205('0x49')]=function(_0x4fe0b2,_0x3a4ab3,_0xeddab5){return db[_0x0205('0x4a')]['findOne']({'where':{'id':_0x4fe0b2[_0x0205('0x40')]['id']}})[_0x0205('0x23')](handleEntityNotFound(_0x3a4ab3,null))[_0x0205('0x23')](function(_0x307b3d){if(_0x307b3d){return db[_0x0205('0x4b')]['transaction'](function(_0x43397e){return db['AnalyticFieldReport'][_0x0205('0x22')]({'where':{'CustomReportId':_0x4fe0b2[_0x0205('0x40')]['id']},'transaction':_0x43397e})[_0x0205('0x23')](function(_0x185b1e){var _0x4e0f76=_['map'](_0x4fe0b2['body'],function(_0x34ccc1){delete _0x34ccc1['id'];_0x34ccc1['CustomReportId']=_0x4fe0b2[_0x0205('0x40')]['id'];return _0x34ccc1;});return db[_0x0205('0x26')][_0x0205('0x46')](_0x4e0f76,{'transaction':_0x43397e});});})[_0x0205('0x23')](function(){return db[_0x0205('0x26')][_0x0205('0x3c')]({'where':{'CustomReportId':_0x4fe0b2[_0x0205('0x40')]['id']}});});}})[_0x0205('0x23')](respondWithResult(_0x3a4ab3,null))['catch'](handleError(_0x3a4ab3,null));};
\ No newline at end of file
+var _0x75b8=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','end','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','destroy','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x4a9765,_0x323732){var _0x1c363c=function(_0x4667d8){while(--_0x4667d8){_0x4a9765['push'](_0x4a9765['shift']());}};_0x1c363c(++_0x323732);}(_0x75b8,0x9e));var _0x875b=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x75b8[_0x403c20];return _0x2b271a;};'use strict';var emlformat=require(_0x875b('0x0'));var rimraf=require(_0x875b('0x1'));var zipdir=require(_0x875b('0x2'));var jsonpatch=require(_0x875b('0x3'));var rp=require(_0x875b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x875b('0x5'));var util=require(_0x875b('0x6'));var path=require(_0x875b('0x7'));var sox=require(_0x875b('0x8'));var csv=require(_0x875b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x875b('0xa'));var _=require(_0x875b('0xb'));var squel=require(_0x875b('0xc'));var crypto=require(_0x875b('0xd'));var jsforce=require(_0x875b('0xe'));var deskjs=require(_0x875b('0xf'));var toCsv=require(_0x875b('0x9'));var querystring=require(_0x875b('0x10'));var Papa=require('papaparse');var Redis=require(_0x875b('0x11'));var authService=require(_0x875b('0x12'));var qs=require(_0x875b('0x13'));var as=require(_0x875b('0x14'));var hardwareService=require(_0x875b('0x15'));var logger=require(_0x875b('0x16'))(_0x875b('0x17'));var utils=require(_0x875b('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x875b('0x19'))['db'];function respondWithStatusCode(_0x496d5b,_0x4f9bcf){_0x4f9bcf=_0x4f9bcf||0xcc;return function(_0x1061c3){if(_0x1061c3){return _0x496d5b[_0x875b('0x1a')](_0x4f9bcf);}return _0x496d5b['status'](_0x4f9bcf)['end']();};}function respondWithResult(_0x115db0,_0x5f4402){_0x5f4402=_0x5f4402||0xc8;return function(_0x1d8847){if(_0x1d8847){return _0x115db0[_0x875b('0x1b')](_0x5f4402)[_0x875b('0x1c')](_0x1d8847);}};}function respondWithFilteredResult(_0x36b33c,_0x243438){return function(_0x30e766){if(_0x30e766){var _0x132950=typeof _0x243438[_0x875b('0x1d')]===_0x875b('0x1e')&&typeof _0x243438[_0x875b('0x1f')]==='undefined';var _0x5a645e=_0x30e766[_0x875b('0x20')];var _0x49d137=_0x132950?0x0:_0x243438['offset'];var _0x2b4ac5=_0x132950?_0x30e766[_0x875b('0x20')]:_0x243438[_0x875b('0x1d')]+_0x243438['limit'];var _0x2d34f3;if(_0x2b4ac5>=_0x5a645e){_0x2b4ac5=_0x5a645e;_0x2d34f3=0xc8;}else{_0x2d34f3=0xce;}_0x36b33c[_0x875b('0x1b')](_0x2d34f3);return _0x36b33c[_0x875b('0x21')](_0x875b('0x22'),_0x49d137+'-'+_0x2b4ac5+'/'+_0x5a645e)[_0x875b('0x1c')](_0x30e766);}return null;};}function patchUpdates(_0x1a6db1){return function(_0x5cb629){try{jsonpatch[_0x875b('0x23')](_0x5cb629,_0x1a6db1,!![]);}catch(_0x39d494){return BPromise['reject'](_0x39d494);}return _0x5cb629['save']();};}function saveUpdates(_0x28013f,_0x283655){return function(_0x26082d){if(_0x26082d){return _0x26082d[_0x875b('0x24')](_0x28013f)[_0x875b('0x25')](function(_0xa23638){return _0xa23638;});}return null;};}function removeEntity(_0xe6258e,_0x371381){return function(_0x2de15e){if(_0x2de15e){return _0x2de15e['destroy']()['then'](function(){_0xe6258e[_0x875b('0x1b')](0xcc)[_0x875b('0x26')]();});}};}function handleEntityNotFound(_0x1cdb7e,_0x1e83ac){return function(_0x2e6531){if(!_0x2e6531){_0x1cdb7e[_0x875b('0x1a')](0x194);}return _0x2e6531;};}function handleError(_0x1d933b,_0x2ab3bf){_0x2ab3bf=_0x2ab3bf||0x1f4;return function(_0x338384){logger['error'](_0x338384[_0x875b('0x27')]);if(_0x338384['name']){delete _0x338384[_0x875b('0x28')];}_0x1d933b[_0x875b('0x1b')](_0x2ab3bf)[_0x875b('0x29')](_0x338384);};}exports[_0x875b('0x2a')]=function(_0x5a9106,_0x276bea){var _0x48c128={},_0x22d332={},_0xd871ba={'count':0x0,'rows':[]};var _0x3815b4=_[_0x875b('0x2b')](db[_0x875b('0x2c')][_0x875b('0x2d')],function(_0x5d46c2){return{'name':_0x5d46c2[_0x875b('0x2e')],'type':_0x5d46c2[_0x875b('0x2f')][_0x875b('0x30')]};});_0x22d332[_0x875b('0x31')]=_[_0x875b('0x2b')](_0x3815b4,_0x875b('0x28'));_0x22d332[_0x875b('0x32')]=_[_0x875b('0x33')](_0x5a9106[_0x875b('0x32')]);_0x22d332[_0x875b('0x34')]=_[_0x875b('0x35')](_0x22d332[_0x875b('0x31')],_0x22d332[_0x875b('0x32')]);_0x48c128[_0x875b('0x36')]=_[_0x875b('0x35')](_0x22d332[_0x875b('0x31')],qs['fields'](_0x5a9106[_0x875b('0x32')][_0x875b('0x37')]));_0x48c128[_0x875b('0x36')]=_0x48c128[_0x875b('0x36')][_0x875b('0x38')]?_0x48c128[_0x875b('0x36')]:_0x22d332['model'];if(!_0x5a9106['query']['hasOwnProperty'](_0x875b('0x39'))){_0x48c128['limit']=qs[_0x875b('0x1f')](_0x5a9106[_0x875b('0x32')][_0x875b('0x1f')]);_0x48c128[_0x875b('0x1d')]=qs[_0x875b('0x1d')](_0x5a9106[_0x875b('0x32')][_0x875b('0x1d')]);}_0x48c128[_0x875b('0x3a')]=qs[_0x875b('0x3b')](_0x5a9106[_0x875b('0x32')][_0x875b('0x3b')]);_0x48c128[_0x875b('0x3c')]=qs[_0x875b('0x34')](_['pick'](_0x5a9106[_0x875b('0x32')],_0x22d332[_0x875b('0x34')]),_0x3815b4);if(_0x5a9106[_0x875b('0x32')][_0x875b('0x3d')]){_0x48c128[_0x875b('0x3c')]=_[_0x875b('0x3e')](_0x48c128[_0x875b('0x3c')],{'$or':_['map'](_0x3815b4,function(_0x3f1b30){if(_0x3f1b30['type']!==_0x875b('0x3f')){var _0x50c385={};_0x50c385[_0x3f1b30[_0x875b('0x28')]]={'$like':'%'+_0x5a9106[_0x875b('0x32')][_0x875b('0x3d')]+'%'};return _0x50c385;}})});}_0x48c128=_[_0x875b('0x3e')]({},_0x48c128,_0x5a9106[_0x875b('0x40')]);var _0x43c7a5={'where':_0x48c128['where']};return db[_0x875b('0x2c')][_0x875b('0x20')](_0x43c7a5)[_0x875b('0x25')](function(_0x4c0a26){_0xd871ba[_0x875b('0x20')]=_0x4c0a26;if(_0x5a9106[_0x875b('0x32')]['includeAll']){_0x48c128[_0x875b('0x41')]=[{'all':!![]}];}return db[_0x875b('0x2c')][_0x875b('0x42')](_0x48c128);})[_0x875b('0x25')](function(_0x16008a){_0xd871ba[_0x875b('0x43')]=_0x16008a;return _0xd871ba;})['then'](respondWithFilteredResult(_0x276bea,_0x48c128))[_0x875b('0x44')](handleError(_0x276bea,null));};exports[_0x875b('0x45')]=function(_0xe23ee5,_0x2ac976){var _0x913fdb={'raw':![],'where':{'id':_0xe23ee5[_0x875b('0x46')]['id']}},_0x4a5a4d={};_0x4a5a4d[_0x875b('0x31')]=_[_0x875b('0x33')](db[_0x875b('0x2c')][_0x875b('0x2d')]);_0x4a5a4d[_0x875b('0x32')]=_[_0x875b('0x33')](_0xe23ee5[_0x875b('0x32')]);_0x4a5a4d['filters']=_[_0x875b('0x35')](_0x4a5a4d[_0x875b('0x31')],_0x4a5a4d[_0x875b('0x32')]);_0x913fdb[_0x875b('0x36')]=_['intersection'](_0x4a5a4d[_0x875b('0x31')],qs[_0x875b('0x37')](_0xe23ee5['query']['fields']));_0x913fdb[_0x875b('0x36')]=_0x913fdb['attributes'][_0x875b('0x38')]?_0x913fdb[_0x875b('0x36')]:_0x4a5a4d[_0x875b('0x31')];if(_0xe23ee5[_0x875b('0x32')][_0x875b('0x47')]){_0x913fdb['include']=[{'all':!![]}];}_0x913fdb=_[_0x875b('0x3e')]({},_0x913fdb,_0xe23ee5[_0x875b('0x40')]);return db['AnalyticFieldReport'][_0x875b('0x48')](_0x913fdb)[_0x875b('0x25')](handleEntityNotFound(_0x2ac976,null))[_0x875b('0x25')](respondWithResult(_0x2ac976,null))[_0x875b('0x44')](handleError(_0x2ac976,null));};exports[_0x875b('0x49')]=function(_0x277123,_0x5923d1){return db[_0x875b('0x2c')][_0x875b('0x49')](_0x277123[_0x875b('0x4a')],{})[_0x875b('0x25')](respondWithResult(_0x5923d1,0xc9))[_0x875b('0x44')](handleError(_0x5923d1,null));};exports['bulkCreate']=function(_0x3d36fb,_0x513f23){return db[_0x875b('0x2c')][_0x875b('0x4b')](_0x3d36fb[_0x875b('0x4a')],{'raw':![],'individualHooks':!![]})[_0x875b('0x25')](respondWithResult(_0x513f23,0xc9))['catch'](handleError(_0x513f23,null));};exports[_0x875b('0x24')]=function(_0x48e78b,_0x4b5ab6){if(_0x48e78b[_0x875b('0x4a')]['id']){delete _0x48e78b[_0x875b('0x4a')]['id'];}return db[_0x875b('0x2c')][_0x875b('0x48')]({'where':{'id':_0x48e78b[_0x875b('0x46')]['id']}})[_0x875b('0x25')](handleEntityNotFound(_0x4b5ab6,null))[_0x875b('0x25')](saveUpdates(_0x48e78b[_0x875b('0x4a')],null))['then'](respondWithResult(_0x4b5ab6,null))['catch'](handleError(_0x4b5ab6,null));};exports['destroy']=function(_0xab7327,_0x5d3b60){return db['AnalyticFieldReport'][_0x875b('0x48')]({'where':{'id':_0xab7327[_0x875b('0x46')]['id']}})[_0x875b('0x25')](handleEntityNotFound(_0x5d3b60,null))[_0x875b('0x25')](removeEntity(_0x5d3b60,null))[_0x875b('0x44')](handleError(_0x5d3b60,null));};exports[_0x875b('0x4c')]=function(_0x547aa5,_0x39cec0){return db[_0x875b('0x2c')]['destroy']({'where':{'id':_0x547aa5[_0x875b('0x32')][_0x875b('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x875b('0x25')](respondWithResult(_0x39cec0,0xcc))[_0x875b('0x44')](handleError(_0x39cec0,null));};exports[_0x875b('0x4e')]=function(_0xbd5532,_0x1e2bbd,_0x13ff44){return db[_0x875b('0x4f')][_0x875b('0x50')]({'where':{'id':_0xbd5532[_0x875b('0x46')]['id']}})[_0x875b('0x25')](handleEntityNotFound(_0x1e2bbd,null))[_0x875b('0x25')](function(_0x20161f){if(_0x20161f){return db[_0x875b('0x51')][_0x875b('0x52')](function(_0x5b1461){return db['AnalyticFieldReport'][_0x875b('0x53')]({'where':{'CustomReportId':_0xbd5532[_0x875b('0x46')]['id']},'transaction':_0x5b1461})[_0x875b('0x25')](function(_0x3666cb){var _0x53f924=_[_0x875b('0x2b')](_0xbd5532[_0x875b('0x4a')],function(_0x30b611){delete _0x30b611['id'];_0x30b611[_0x875b('0x54')]=_0xbd5532[_0x875b('0x46')]['id'];return _0x30b611;});return db[_0x875b('0x2c')]['bulkCreate'](_0x53f924,{'transaction':_0x5b1461});});})[_0x875b('0x25')](function(){return db[_0x875b('0x2c')][_0x875b('0x42')]({'where':{'CustomReportId':_0xbd5532[_0x875b('0x46')]['id']}});});}})['then'](respondWithResult(_0x1e2bbd,null))['catch'](handleError(_0x1e2bbd,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 4ca080b..bc8093b 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 _0x4f61=['util','api','bluebird','request-promise','path','../../config/environment','exports','define','analytics_report_fields','lodash'];(function(_0x423e39,_0x25445e){var _0x4eb87a=function(_0x198fec){while(--_0x198fec){_0x423e39['push'](_0x423e39['shift']());}};_0x4eb87a(++_0x25445e);}(_0x4f61,0xb3));var _0x14f6=function(_0x46142d,_0x4114f9){_0x46142d=_0x46142d-0x0;var _0x14cea9=_0x4f61[_0x46142d];return _0x14cea9;};'use strict';var _=require(_0x14f6('0x0'));var util=require(_0x14f6('0x1'));var logger=require('../../config/logger')(_0x14f6('0x2'));var moment=require('moment');var BPromise=require(_0x14f6('0x3'));var rp=require(_0x14f6('0x4'));var fs=require('fs');var path=require(_0x14f6('0x5'));var rimraf=require('rimraf');var config=require(_0x14f6('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0x14f6('0x7')]=function(_0x4aeca3,_0x88261c){return _0x4aeca3[_0x14f6('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0x14f6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9bec=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./analyticFieldReport.attributes','define'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0x9bec,0xda));var _0xc9be=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x9bec[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0xc9be('0x0'));var util=require(_0xc9be('0x1'));var logger=require(_0xc9be('0x2'))(_0xc9be('0x3'));var moment=require(_0xc9be('0x4'));var BPromise=require(_0xc9be('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9be('0x6'));var rimraf=require(_0xc9be('0x7'));var config=require('../../config/environment');var attributes=require(_0xc9be('0x8'));module['exports']=function(_0x362b2b,_0x401a3c){return _0x362b2b[_0xc9be('0x9')](_0xc9be('0xa'),attributes,{'tableName':_0xc9be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 11ab91e..2092d02 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 _0x9177=['client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3df550,_0x5ecd0d){var _0x3e6ffd=function(_0x1c7adb){while(--_0x1c7adb){_0x3df550['push'](_0x3df550['shift']());}};_0x3e6ffd(++_0x5ecd0d);}(_0x9177,0xe7));var _0x7917=function(_0x4ee9cd,_0xd375b0){_0x4ee9cd=_0x4ee9cd-0x0;var _0x328a5b=_0x9177[_0x4ee9cd];return _0x328a5b;};'use strict';var _=require('lodash');var util=require(_0x7917('0x0'));var moment=require(_0x7917('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7917('0x2'));var db=require(_0x7917('0x3'))['db'];var utils=require(_0x7917('0x4'));var logger=require(_0x7917('0x5'))(_0x7917('0x6'));var config=require(_0x7917('0x7'));var jayson=require(_0x7917('0x8'));var client=jayson[_0x7917('0x9')][_0x7917('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x539afe,_0x5cb4d0,_0x344f95){return new BPromise(function(_0x3ac655,_0x541a61){return client['request'](_0x539afe,_0x344f95)[_0x7917('0xb')](function(_0x4f35b4){logger[_0x7917('0xc')](_0x7917('0xd'),_0x5cb4d0,_0x7917('0xe'));logger['debug'](_0x7917('0xf'),_0x5cb4d0,'request\x20sent',JSON['stringify'](_0x4f35b4));if(_0x4f35b4['error']){if(_0x4f35b4[_0x7917('0x10')]['code']===0x1f4){logger['error'](_0x7917('0xd'),_0x5cb4d0,_0x4f35b4[_0x7917('0x10')][_0x7917('0x11')]);return _0x541a61(_0x4f35b4['error']['message']);}logger[_0x7917('0x10')](_0x7917('0xd'),_0x5cb4d0,_0x4f35b4[_0x7917('0x10')][_0x7917('0x11')]);return _0x3ac655(_0x4f35b4[_0x7917('0x10')][_0x7917('0x11')]);}else{logger['info'](_0x7917('0xd'),_0x5cb4d0,_0x7917('0xe'));_0x3ac655(_0x4f35b4[_0x7917('0x12')][_0x7917('0x11')]);}})[_0x7917('0x13')](function(_0x113ba3){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x5cb4d0,_0x113ba3);_0x541a61(_0x113ba3);});});}
\ No newline at end of file
+var _0x3242=['bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x45365d,_0x267e43){var _0x23a842=function(_0xc1e1ff){while(--_0xc1e1ff){_0x45365d['push'](_0x45365d['shift']());}};_0x23a842(++_0x267e43);}(_0x3242,0x105));var _0x2324=function(_0x5d8c33,_0x3017c8){_0x5d8c33=_0x5d8c33-0x0;var _0x4117b1=_0x3242[_0x5d8c33];return _0x4117b1;};'use strict';var _=require(_0x2324('0x0'));var util=require(_0x2324('0x1'));var moment=require(_0x2324('0x2'));var BPromise=require(_0x2324('0x3'));var rs=require(_0x2324('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2324('0x5'));var logger=require('../../config/logger')(_0x2324('0x6'));var config=require('../../config/environment');var jayson=require(_0x2324('0x7'));var client=jayson[_0x2324('0x8')][_0x2324('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b618f,_0x23aa61,_0x4ee896){return new BPromise(function(_0x1788c1,_0x562749){return client[_0x2324('0xa')](_0x4b618f,_0x4ee896)[_0x2324('0xb')](function(_0x5622c9){logger[_0x2324('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x23aa61,'request\x20sent');logger[_0x2324('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x23aa61,_0x2324('0xe'),JSON[_0x2324('0xf')](_0x5622c9));if(_0x5622c9[_0x2324('0x10')]){if(_0x5622c9['error'][_0x2324('0x11')]===0x1f4){logger[_0x2324('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x23aa61,_0x5622c9[_0x2324('0x10')][_0x2324('0x12')]);return _0x562749(_0x5622c9[_0x2324('0x10')]['message']);}logger[_0x2324('0x10')](_0x2324('0x13'),_0x23aa61,_0x5622c9[_0x2324('0x10')][_0x2324('0x12')]);return _0x1788c1(_0x5622c9[_0x2324('0x10')][_0x2324('0x12')]);}else{logger[_0x2324('0xc')](_0x2324('0x13'),_0x23aa61,'request\x20sent');_0x1788c1(_0x5622c9[_0x2324('0x14')][_0x2324('0x12')]);}})[_0x2324('0x15')](function(_0x20e990){logger['error'](_0x2324('0x13'),_0x23aa61,_0x20e990);_0x562749(_0x20e990);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index bbd521d..dd57d2c 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(_0x51d0c8,_0x424307){var _0x9cc64c=function(_0x25af2e){while(--_0x25af2e){_0x51d0c8['push'](_0x51d0c8['shift']());}};_0x9cc64c(++_0x424307);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x1d6688,_0x1e887d){var _0xb94e97=function(_0x3658cd){while(--_0x3658cd){_0x1d6688['push'](_0x1d6688['shift']());}};_0xb94e97(++_0x1e887d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 3969b83..05d476d 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 _0x594d=['STRING','TEXT','sequelize','name'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0x594d,0x92));var _0xd594=function(_0x56f215,_0x391360){_0x56f215=_0x56f215-0x0;var _0x68e039=_0x594d[_0x56f215];return _0x68e039;};'use strict';var Sequelize=require(_0xd594('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd594('0x1')},'table':{'type':Sequelize[_0xd594('0x2')]},'metric':{'type':Sequelize[_0xd594('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2697=['exports','STRING','name','TEXT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2697,0x120));var _0x7269=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0x2697[_0xdeefbd];return _0x4ff63f;};'use strict';var Sequelize=require('sequelize');module[_0x7269('0x0')]={'name':{'type':Sequelize[_0x7269('0x1')],'allowNull':![],'unique':_0x7269('0x2')},'table':{'type':Sequelize[_0x7269('0x1')]},'metric':{'type':Sequelize[_0x7269('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 80e99e8..a89bf82 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 _0xdbf5=['../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','AnalyticMetric','includeAll','include','findAll','rows','catch','show','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x31fb35,_0x1854f8){var _0x5cad7a=function(_0x3ce198){while(--_0x3ce198){_0x31fb35['push'](_0x31fb35['shift']());}};_0x5cad7a(++_0x1854f8);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x5e866a,_0x536f8a){_0x5e866a=_0x5e866a-0x0;var _0x3e10a1=_0xdbf5[_0x5e866a];return _0x3e10a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){var _0x226b93=_0x2d3e1b[_0x5dbf('0x22')]({'plain':!![]});var _0x20ab1b=_0x5dbf('0x23');return db[_0x5dbf('0x24')][_0x5dbf('0x21')]({'where':{'type':_0x20ab1b,'resourceId':_0x226b93['id']}})[_0x5dbf('0x20')](function(){return _0x2d3e1b;});})[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x25')]();});}};}function handleEntityNotFound(_0x17f135,_0x466985){return function(_0x3f8341){if(!_0x3f8341){_0x17f135[_0x5dbf('0x16')](0x194);}return _0x3f8341;};}function handleError(_0x22ec42,_0x6a9757){_0x6a9757=_0x6a9757||0x1f4;return function(_0x471027){logger[_0x5dbf('0x26')](_0x471027['stack']);if(_0x471027[_0x5dbf('0x27')]){delete _0x471027[_0x5dbf('0x27')];}_0x22ec42[_0x5dbf('0x17')](_0x6a9757)[_0x5dbf('0x28')](_0x471027);};}exports[_0x5dbf('0x29')]=function(_0x6a276d,_0x2a65c5){var _0x31d57a={},_0x406ce6={},_0x273b63={'count':0x0,'rows':[]};var _0x294dd7=_['map'](db['AnalyticMetric'][_0x5dbf('0x2a')],function(_0x19015a){return{'name':_0x19015a[_0x5dbf('0x2b')],'type':_0x19015a[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x406ce6['model']=_['map'](_0x294dd7,_0x5dbf('0x27'));_0x406ce6[_0x5dbf('0x2e')]=_['keys'](_0x6a276d[_0x5dbf('0x2e')]);_0x406ce6[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],_0x406ce6[_0x5dbf('0x2e')]);_0x31d57a['attributes']=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x32')]));_0x31d57a['attributes']=_0x31d57a[_0x5dbf('0x33')][_0x5dbf('0x34')]?_0x31d57a[_0x5dbf('0x33')]:_0x406ce6[_0x5dbf('0x31')];if(!_0x6a276d['query'][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x31d57a[_0x5dbf('0x37')]=qs[_0x5dbf('0x37')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x37')]);_0x31d57a[_0x5dbf('0x19')]=qs[_0x5dbf('0x19')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x19')]);}_0x31d57a[_0x5dbf('0x38')]=qs['sort'](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x39')]);_0x31d57a[_0x5dbf('0x3a')]=qs['filters'](_[_0x5dbf('0x3b')](_0x6a276d[_0x5dbf('0x2e')],_0x406ce6[_0x5dbf('0x2f')]),_0x294dd7);if(_0x6a276d['query'][_0x5dbf('0x3c')]){_0x31d57a[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x31d57a['where'],{'$or':_[_0x5dbf('0x3e')](_0x294dd7,function(_0x29a62d){if(_0x29a62d[_0x5dbf('0x2c')]!==_0x5dbf('0x3f')){var _0x10537d={};_0x10537d[_0x29a62d[_0x5dbf('0x27')]]={'$like':'%'+_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x3c')]+'%'};return _0x10537d;}})});}_0x31d57a=_['merge']({},_0x31d57a,_0x6a276d['options']);var _0x57ee72={'where':_0x31d57a['where']};return db[_0x5dbf('0x40')][_0x5dbf('0x1b')](_0x57ee72)['then'](function(_0x3ef0eb){_0x273b63[_0x5dbf('0x1b')]=_0x3ef0eb;if(_0x6a276d['query'][_0x5dbf('0x41')]){_0x31d57a[_0x5dbf('0x42')]=[{'all':!![]}];}return db[_0x5dbf('0x40')][_0x5dbf('0x43')](_0x31d57a);})[_0x5dbf('0x20')](function(_0x7c390d){_0x273b63[_0x5dbf('0x44')]=_0x7c390d;return _0x273b63;})[_0x5dbf('0x20')](respondWithFilteredResult(_0x2a65c5,_0x31d57a))[_0x5dbf('0x45')](handleError(_0x2a65c5,null));};exports[_0x5dbf('0x46')]=function(_0x50ac70,_0x78aef3){var _0x22f958={'raw':!![],'where':{'id':_0x50ac70['params']['id']}},_0xec1d28={};_0xec1d28[_0x5dbf('0x31')]=_[_0x5dbf('0x47')](db[_0x5dbf('0x40')][_0x5dbf('0x2a')]);_0xec1d28['query']=_[_0x5dbf('0x47')](_0x50ac70['query']);_0xec1d28[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0xec1d28[_0x5dbf('0x31')],_0xec1d28[_0x5dbf('0x2e')]);_0x22f958['attributes']=_['intersection'](_0xec1d28[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x50ac70[_0x5dbf('0x2e')]['fields']));_0x22f958[_0x5dbf('0x33')]=_0x22f958['attributes']['length']?_0x22f958['attributes']:_0xec1d28['model'];if(_0x50ac70[_0x5dbf('0x2e')][_0x5dbf('0x41')]){_0x22f958['include']=[{'all':!![]}];}_0x22f958=_[_0x5dbf('0x3d')]({},_0x22f958,_0x50ac70[_0x5dbf('0x48')]);return db['AnalyticMetric'][_0x5dbf('0x49')](_0x22f958)[_0x5dbf('0x20')](handleEntityNotFound(_0x78aef3,null))['then'](respondWithResult(_0x78aef3,null))[_0x5dbf('0x45')](handleError(_0x78aef3,null));};exports['create']=function(_0x5ab862,_0x337897){return db[_0x5dbf('0x40')][_0x5dbf('0x4a')](_0x5ab862['body'],{})['then'](function(_0x442a43){var _0x3e8612=_0x5ab862[_0x5dbf('0x4b')][_0x5dbf('0x22')]({'plain':!![]});if(!_0x3e8612)throw new Error(_0x5dbf('0x4c'));if(_0x3e8612[_0x5dbf('0x4d')]===_0x5dbf('0x4b')){var _0x319906=_0x442a43['get']({'plain':!![]});var _0x3f38a0=_0x5dbf('0x23');return db[_0x5dbf('0x4e')][_0x5dbf('0x49')]({'where':{'name':_0x3f38a0,'userProfileId':_0x3e8612[_0x5dbf('0x4f')]},'raw':!![]})[_0x5dbf('0x20')](function(_0x328dc5){if(_0x328dc5&&_0x328dc5['autoAssociation']===0x0){return db[_0x5dbf('0x24')]['create']({'name':_0x319906[_0x5dbf('0x27')],'resourceId':_0x319906['id'],'type':_0x328dc5[_0x5dbf('0x27')],'sectionId':_0x328dc5['id']},{})[_0x5dbf('0x20')](function(){return _0x442a43;});}else{return _0x442a43;}})[_0x5dbf('0x45')](function(_0x78ab84){logger[_0x5dbf('0x26')](_0x5dbf('0x50'),_0x78ab84);throw _0x78ab84;});}return _0x442a43;})['then'](respondWithResult(_0x337897,0xc9))['catch'](handleError(_0x337897,null));};exports['update']=function(_0x1e1876,_0xfdacc7){if(_0x1e1876[_0x5dbf('0x51')]['id']){delete _0x1e1876['body']['id'];}return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x1e1876[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0xfdacc7,null))['then'](saveUpdates(_0x1e1876[_0x5dbf('0x51')],null))['then'](respondWithResult(_0xfdacc7,null))[_0x5dbf('0x45')](handleError(_0xfdacc7,null));};exports[_0x5dbf('0x21')]=function(_0x2145ea,_0x5da14b){return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x2145ea[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x5da14b,null))[_0x5dbf('0x20')](removeEntity(_0x5da14b,null))['catch'](handleError(_0x5da14b,null));};
\ No newline at end of file
+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(_0x5524a4,_0x5808eb){var _0x2033ec=function(_0xdd3ce5){while(--_0xdd3ce5){_0x5524a4['push'](_0x5524a4['shift']());}};_0x2033ec(++_0x5808eb);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4aa350,_0x12a9eb){_0x4aa350=_0x4aa350-0x0;var _0x32a16f=_0x7fbe[_0x4aa350];return _0x32a16f;};'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
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 5ee800d..2543f49 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 _0xf483=['api','moment','bluebird','request-promise','path','rimraf','AnalyticMetric','analytics_metrics','util'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0xf483,0xf2));var _0x3f48=function(_0x4263c6,_0x239009){_0x4263c6=_0x4263c6-0x0;var _0x47b675=_0xf483[_0x4263c6];return _0x47b675;};'use strict';var _=require('lodash');var util=require(_0x3f48('0x0'));var logger=require('../../config/logger')(_0x3f48('0x1'));var moment=require(_0x3f48('0x2'));var BPromise=require(_0x3f48('0x3'));var rp=require(_0x3f48('0x4'));var fs=require('fs');var path=require(_0x3f48('0x5'));var rimraf=require(_0x3f48('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x1a3447,_0x16905e){return _0x1a3447['define'](_0x3f48('0x7'),attributes,{'tableName':_0x3f48('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf8af=['bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment'];(function(_0x5397d4,_0x2b4b0d){var _0x33746c=function(_0xc1626c){while(--_0xc1626c){_0x5397d4['push'](_0x5397d4['shift']());}};_0x33746c(++_0x2b4b0d);}(_0xf8af,0x8b));var _0xff8a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf8af[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xff8a('0x0'));var util=require('util');var logger=require(_0xff8a('0x1'))(_0xff8a('0x2'));var moment=require(_0xff8a('0x3'));var BPromise=require(_0xff8a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xff8a('0x5'));var rimraf=require(_0xff8a('0x6'));var config=require(_0xff8a('0x7'));var attributes=require(_0xff8a('0x8'));module['exports']=function(_0x5a4a51,_0x1fc99e){return _0x5a4a51['define'](_0xff8a('0x9'),attributes,{'tableName':_0xff8a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 132c088..4e556cd 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 _0xc8e4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment'];(function(_0x5b0207,_0x251750){var _0x9cdd39=function(_0x5f98b2){while(--_0x5f98b2){_0x5b0207['push'](_0x5b0207['shift']());}};_0x9cdd39(++_0x251750);}(_0xc8e4,0x1e0));var _0x4c8e=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xc8e4[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x4c8e('0x0'));var util=require(_0x4c8e('0x1'));var moment=require(_0x4c8e('0x2'));var BPromise=require(_0x4c8e('0x3'));var rs=require(_0x4c8e('0x4'));var fs=require('fs');var Redis=require(_0x4c8e('0x5'));var db=require(_0x4c8e('0x6'))['db'];var utils=require(_0x4c8e('0x7'));var logger=require('../../config/logger')(_0x4c8e('0x8'));var config=require('../../config/environment');var jayson=require(_0x4c8e('0x9'));var client=jayson[_0x4c8e('0xa')][_0x4c8e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x490228,_0x35eecc,_0x477b64){return new BPromise(function(_0x3cb1da,_0x248ca2){return client[_0x4c8e('0xc')](_0x490228,_0x477b64)[_0x4c8e('0xd')](function(_0x570f32){logger[_0x4c8e('0xe')](_0x4c8e('0xf'),_0x35eecc,_0x4c8e('0x10'));logger[_0x4c8e('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x35eecc,_0x4c8e('0x10'),JSON['stringify'](_0x570f32));if(_0x570f32[_0x4c8e('0x12')]){if(_0x570f32[_0x4c8e('0x12')][_0x4c8e('0x13')]===0x1f4){logger[_0x4c8e('0x12')](_0x4c8e('0xf'),_0x35eecc,_0x570f32['error'][_0x4c8e('0x14')]);return _0x248ca2(_0x570f32[_0x4c8e('0x12')][_0x4c8e('0x14')]);}logger['error'](_0x4c8e('0xf'),_0x35eecc,_0x570f32[_0x4c8e('0x12')][_0x4c8e('0x14')]);return _0x3cb1da(_0x570f32[_0x4c8e('0x12')][_0x4c8e('0x14')]);}else{logger['info'](_0x4c8e('0xf'),_0x35eecc,_0x4c8e('0x10'));_0x3cb1da(_0x570f32[_0x4c8e('0x15')]['message']);}})[_0x4c8e('0x16')](function(_0x794f11){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x35eecc,_0x794f11);_0x248ca2(_0x794f11);});});}
\ No newline at end of file
+var _0x3c98=['info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x30a5e5,_0x4ba8a0){var _0x15d571=function(_0x1285a5){while(--_0x1285a5){_0x30a5e5['push'](_0x30a5e5['shift']());}};_0x15d571(++_0x4ba8a0);}(_0x3c98,0xc6));var _0x83c9=function(_0x4081da,_0x7e4af9){_0x4081da=_0x4081da-0x0;var _0x5b2533=_0x3c98[_0x4081da];return _0x5b2533;};'use strict';var _=require(_0x83c9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x83c9('0x1'));var fs=require('fs');var Redis=require(_0x83c9('0x2'));var db=require(_0x83c9('0x3'))['db'];var utils=require(_0x83c9('0x4'));var logger=require('../../config/logger')(_0x83c9('0x5'));var config=require(_0x83c9('0x6'));var jayson=require(_0x83c9('0x7'));var client=jayson['client'][_0x83c9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf2c93c,_0x690129,_0x4c9369){return new BPromise(function(_0x20f0c5,_0x824f35){return client[_0x83c9('0x9')](_0xf2c93c,_0x4c9369)[_0x83c9('0xa')](function(_0x58bb0f){logger[_0x83c9('0xb')](_0x83c9('0xc'),_0x690129,_0x83c9('0xd'));logger[_0x83c9('0xe')](_0x83c9('0xf'),_0x690129,_0x83c9('0xd'),JSON['stringify'](_0x58bb0f));if(_0x58bb0f[_0x83c9('0x10')]){if(_0x58bb0f[_0x83c9('0x10')]['code']===0x1f4){logger[_0x83c9('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x690129,_0x58bb0f[_0x83c9('0x10')]['message']);return _0x824f35(_0x58bb0f[_0x83c9('0x10')]['message']);}logger[_0x83c9('0x10')](_0x83c9('0xc'),_0x690129,_0x58bb0f[_0x83c9('0x10')][_0x83c9('0x11')]);return _0x20f0c5(_0x58bb0f[_0x83c9('0x10')][_0x83c9('0x11')]);}else{logger[_0x83c9('0xb')](_0x83c9('0xc'),_0x690129,_0x83c9('0xd'));_0x20f0c5(_0x58bb0f['result'][_0x83c9('0x11')]);}})[_0x83c9('0x12')](function(_0x110323){logger[_0x83c9('0x10')](_0x83c9('0xc'),_0x690129,_0x110323);_0x824f35(_0x110323);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 7808c09..972a379 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 _0xd3e3=['post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x2365a0,_0x4c1e17){var _0x1a5ce9=function(_0x35841d){while(--_0x35841d){_0x2365a0['push'](_0x2365a0['shift']());}};_0x1a5ce9(++_0x4c1e17);}(_0xd3e3,0xdd));var _0x3d3e=function(_0x27fdae,_0x45daa8){_0x27fdae=_0x27fdae-0x0;var _0x165d1e=_0xd3e3[_0x27fdae];return _0x165d1e;};'use strict';var multer=require(_0x3d3e('0x0'));var util=require(_0x3d3e('0x1'));var path=require(_0x3d3e('0x2'));var timeout=require(_0x3d3e('0x3'));var express=require('express');var router=express[_0x3d3e('0x4')]();var fs_extra=require(_0x3d3e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3d3e('0x6'));var config=require(_0x3d3e('0x7'));var controller=require('./analyticMetric.controller');router[_0x3d3e('0x8')]('/',auth[_0x3d3e('0x9')](),controller[_0x3d3e('0xa')]);router[_0x3d3e('0x8')](_0x3d3e('0xb'),auth['isAuthenticated'](),controller[_0x3d3e('0xc')]);router[_0x3d3e('0xd')]('/',auth[_0x3d3e('0x9')](),controller['create']);router[_0x3d3e('0xe')](_0x3d3e('0xb'),auth[_0x3d3e('0x9')](),controller[_0x3d3e('0xf')]);router['delete'](_0x3d3e('0xb'),auth['isAuthenticated'](),controller[_0x3d3e('0x10')]);module[_0x3d3e('0x11')]=router;
\ No newline at end of file
+var _0x5c91=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x54a2da,_0x51925b){var _0x20297e=function(_0x16fb4d){while(--_0x16fb4d){_0x54a2da['push'](_0x54a2da['shift']());}};_0x20297e(++_0x51925b);}(_0x5c91,0x1e9));var _0x15c9=function(_0x3f18d9,_0x3b2f8f){_0x3f18d9=_0x3f18d9-0x0;var _0x243ff4=_0x5c91[_0x3f18d9];return _0x243ff4;};'use strict';var multer=require(_0x15c9('0x0'));var util=require(_0x15c9('0x1'));var path=require(_0x15c9('0x2'));var timeout=require('connect-timeout');var express=require(_0x15c9('0x3'));var router=express[_0x15c9('0x4')]();var fs_extra=require(_0x15c9('0x5'));var auth=require(_0x15c9('0x6'));var interaction=require(_0x15c9('0x7'));var config=require(_0x15c9('0x8'));var controller=require('./analyticMetric.controller');router[_0x15c9('0x9')]('/',auth[_0x15c9('0xa')](),controller[_0x15c9('0xb')]);router[_0x15c9('0x9')](_0x15c9('0xc'),auth['isAuthenticated'](),controller[_0x15c9('0xd')]);router[_0x15c9('0xe')]('/',auth[_0x15c9('0xa')](),controller['create']);router[_0x15c9('0xf')](_0x15c9('0xc'),auth[_0x15c9('0xa')](),controller['update']);router['delete'](_0x15c9('0xc'),auth[_0x15c9('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index cfcb2d8..9d4a258 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 _0xfbf9=['exports','TEXT'];(function(_0x1f3c2a,_0xb2ee90){var _0x2cbce9=function(_0x1ba35c){while(--_0x1ba35c){_0x1f3c2a['push'](_0x1f3c2a['shift']());}};_0x2cbce9(++_0xb2ee90);}(_0xfbf9,0x138));var _0x9fbf=function(_0x1b48cd,_0x4e1a55){_0x1b48cd=_0x1b48cd-0x0;var _0x11a3c8=_0xfbf9[_0x1b48cd];return _0x11a3c8;};'use strict';var Sequelize=require('sequelize');module[_0x9fbf('0x0')]={'tree':{'type':Sequelize[_0x9fbf('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xf73a=['exports','sequelize'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xf73a,0x115));var _0xaf73=function(_0x3d3bf7,_0x3d8ecf){_0x3d3bf7=_0x3d3bf7-0x0;var _0x16bd6d=_0xf73a[_0x3d3bf7];return _0x16bd6d;};'use strict';var Sequelize=require(_0xaf73('0x0'));module[_0xaf73('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 4b860db..b4e9b6a 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 _0x5f39=['moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x34d7b1,_0x3a495b){var _0x2314f0=function(_0x3604e7){while(--_0x3604e7){_0x34d7b1['push'](_0x34d7b1['shift']());}};_0x2314f0(++_0x3a495b);}(_0x5f39,0x17c));var _0x95f3=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x5f39[_0x46698a];return _0x356db0;};'use strict';var emlformat=require(_0x95f3('0x0'));var rimraf=require(_0x95f3('0x1'));var zipdir=require(_0x95f3('0x2'));var jsonpatch=require(_0x95f3('0x3'));var rp=require(_0x95f3('0x4'));var moment=require(_0x95f3('0x5'));var BPromise=require(_0x95f3('0x6'));var Mustache=require('mustache');var util=require(_0x95f3('0x7'));var path=require('path');var sox=require(_0x95f3('0x8'));var csv=require(_0x95f3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x95f3('0xa'));var _=require(_0x95f3('0xb'));var squel=require('squel');var crypto=require(_0x95f3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x95f3('0xd'));var toCsv=require(_0x95f3('0x9'));var querystring=require(_0x95f3('0xe'));var Papa=require(_0x95f3('0xf'));var Redis=require(_0x95f3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x95f3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x95f3('0x12'));var logger=require(_0x95f3('0x13'))(_0x95f3('0x14'));var utils=require(_0x95f3('0x15'));var config=require(_0x95f3('0x16'));var licenseUtil=require(_0x95f3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dd009,_0x1a73f9){_0x1a73f9=_0x1a73f9||0xcc;return function(_0x9c4fa0){if(_0x9c4fa0){return _0x1dd009[_0x95f3('0x18')](_0x1a73f9);}return _0x1dd009[_0x95f3('0x19')](_0x1a73f9)[_0x95f3('0x1a')]();};}function respondWithResult(_0x58935f,_0x25560f){_0x25560f=_0x25560f||0xc8;return function(_0x4a638b){if(_0x4a638b){return _0x58935f['status'](_0x25560f)[_0x95f3('0x1b')](_0x4a638b);}};}function respondWithFilteredResult(_0x105fd0,_0x1aa020){return function(_0x352567){if(_0x352567){var _0x1f5af0=typeof _0x1aa020[_0x95f3('0x1c')]===_0x95f3('0x1d')&&typeof _0x1aa020[_0x95f3('0x1e')]===_0x95f3('0x1d');var _0x3d79c5=_0x352567[_0x95f3('0x1f')];var _0x431369=_0x1f5af0?0x0:_0x1aa020['offset'];var _0x16f8d7=_0x1f5af0?_0x352567[_0x95f3('0x1f')]:_0x1aa020[_0x95f3('0x1c')]+_0x1aa020[_0x95f3('0x1e')];var _0x17884a;if(_0x16f8d7>=_0x3d79c5){_0x16f8d7=_0x3d79c5;_0x17884a=0xc8;}else{_0x17884a=0xce;}_0x105fd0[_0x95f3('0x19')](_0x17884a);return _0x105fd0[_0x95f3('0x20')](_0x95f3('0x21'),_0x431369+'-'+_0x16f8d7+'/'+_0x3d79c5)[_0x95f3('0x1b')](_0x352567);}return null;};}function patchUpdates(_0x2ba089){return function(_0xd48b33){try{jsonpatch['apply'](_0xd48b33,_0x2ba089,!![]);}catch(_0xa90021){return BPromise[_0x95f3('0x22')](_0xa90021);}return _0xd48b33[_0x95f3('0x23')]();};}function saveUpdates(_0x27e7a8,_0x332f47){return function(_0x3e8a57){if(_0x3e8a57){return _0x3e8a57[_0x95f3('0x24')](_0x27e7a8)[_0x95f3('0x25')](function(_0x43ad67){return _0x43ad67;});}return null;};}function removeEntity(_0x5c7ecc,_0x530f2f){return function(_0x5254f6){if(_0x5254f6){return _0x5254f6[_0x95f3('0x26')]()['then'](function(){_0x5c7ecc[_0x95f3('0x19')](0xcc)[_0x95f3('0x1a')]();});}};}function handleEntityNotFound(_0x2cf9b1,_0x5bbdd2){return function(_0x1fd524){if(!_0x1fd524){_0x2cf9b1[_0x95f3('0x18')](0x194);}return _0x1fd524;};}function handleError(_0x5cbb0e,_0x2ec5db){_0x2ec5db=_0x2ec5db||0x1f4;return function(_0x536500){logger[_0x95f3('0x27')](_0x536500[_0x95f3('0x28')]);if(_0x536500[_0x95f3('0x29')]){delete _0x536500[_0x95f3('0x29')];}_0x5cbb0e[_0x95f3('0x19')](_0x2ec5db)[_0x95f3('0x2a')](_0x536500);};}exports[_0x95f3('0x2b')]=function(_0x41589d,_0x57452e){var _0x18bc62={},_0x76cabd={},_0x3ea942={'count':0x0,'rows':[]};var _0x1a6bec=_[_0x95f3('0x2c')](db['AnalyticTreeReport']['rawAttributes'],function(_0x2e0fad){return{'name':_0x2e0fad[_0x95f3('0x2d')],'type':_0x2e0fad[_0x95f3('0x2e')][_0x95f3('0x2f')]};});_0x76cabd[_0x95f3('0x30')]=_[_0x95f3('0x2c')](_0x1a6bec,_0x95f3('0x29'));_0x76cabd[_0x95f3('0x31')]=_['keys'](_0x41589d[_0x95f3('0x31')]);_0x76cabd['filters']=_[_0x95f3('0x32')](_0x76cabd[_0x95f3('0x30')],_0x76cabd[_0x95f3('0x31')]);_0x18bc62['attributes']=_[_0x95f3('0x32')](_0x76cabd[_0x95f3('0x30')],qs[_0x95f3('0x33')](_0x41589d[_0x95f3('0x31')][_0x95f3('0x33')]));_0x18bc62[_0x95f3('0x34')]=_0x18bc62['attributes'][_0x95f3('0x35')]?_0x18bc62[_0x95f3('0x34')]:_0x76cabd[_0x95f3('0x30')];if(!_0x41589d[_0x95f3('0x31')][_0x95f3('0x36')](_0x95f3('0x37'))){_0x18bc62[_0x95f3('0x1e')]=qs[_0x95f3('0x1e')](_0x41589d['query'][_0x95f3('0x1e')]);_0x18bc62['offset']=qs[_0x95f3('0x1c')](_0x41589d[_0x95f3('0x31')][_0x95f3('0x1c')]);}_0x18bc62[_0x95f3('0x38')]=qs[_0x95f3('0x39')](_0x41589d[_0x95f3('0x31')][_0x95f3('0x39')]);_0x18bc62[_0x95f3('0x3a')]=qs[_0x95f3('0x3b')](_[_0x95f3('0x3c')](_0x41589d['query'],_0x76cabd[_0x95f3('0x3b')]),_0x1a6bec);if(_0x41589d['query'][_0x95f3('0x3d')]){_0x18bc62[_0x95f3('0x3a')]=_[_0x95f3('0x3e')](_0x18bc62['where'],{'$or':_[_0x95f3('0x2c')](_0x1a6bec,function(_0x12516b){if(_0x12516b[_0x95f3('0x2e')]!==_0x95f3('0x3f')){var _0x3ec6c5={};_0x3ec6c5[_0x12516b[_0x95f3('0x29')]]={'$like':'%'+_0x41589d[_0x95f3('0x31')]['filter']+'%'};return _0x3ec6c5;}})});}_0x18bc62=_['merge']({},_0x18bc62,_0x41589d[_0x95f3('0x40')]);var _0x4b0225={'where':_0x18bc62[_0x95f3('0x3a')]};return db[_0x95f3('0x41')][_0x95f3('0x1f')](_0x4b0225)[_0x95f3('0x25')](function(_0x5114a8){_0x3ea942[_0x95f3('0x1f')]=_0x5114a8;if(_0x41589d['query'][_0x95f3('0x42')]){_0x18bc62['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x95f3('0x43')](_0x18bc62);})[_0x95f3('0x25')](function(_0x2a33f5){_0x3ea942[_0x95f3('0x44')]=_0x2a33f5;return _0x3ea942;})[_0x95f3('0x25')](respondWithFilteredResult(_0x57452e,_0x18bc62))[_0x95f3('0x45')](handleError(_0x57452e,null));};exports[_0x95f3('0x46')]=function(_0x47c741,_0x4ccad3){var _0x1dad70={'raw':!![],'where':{'id':_0x47c741[_0x95f3('0x47')]['id']}},_0x1a8711={};_0x1a8711[_0x95f3('0x30')]=_['keys'](db[_0x95f3('0x41')][_0x95f3('0x48')]);_0x1a8711[_0x95f3('0x31')]=_['keys'](_0x47c741['query']);_0x1a8711[_0x95f3('0x3b')]=_[_0x95f3('0x32')](_0x1a8711[_0x95f3('0x30')],_0x1a8711[_0x95f3('0x31')]);_0x1dad70[_0x95f3('0x34')]=_[_0x95f3('0x32')](_0x1a8711[_0x95f3('0x30')],qs[_0x95f3('0x33')](_0x47c741[_0x95f3('0x31')][_0x95f3('0x33')]));_0x1dad70[_0x95f3('0x34')]=_0x1dad70['attributes'][_0x95f3('0x35')]?_0x1dad70[_0x95f3('0x34')]:_0x1a8711[_0x95f3('0x30')];if(_0x47c741[_0x95f3('0x31')][_0x95f3('0x42')]){_0x1dad70[_0x95f3('0x49')]=[{'all':!![]}];}_0x1dad70=_[_0x95f3('0x3e')]({},_0x1dad70,_0x47c741[_0x95f3('0x40')]);return db[_0x95f3('0x41')][_0x95f3('0x4a')](_0x1dad70)[_0x95f3('0x25')](handleEntityNotFound(_0x4ccad3,null))[_0x95f3('0x25')](respondWithResult(_0x4ccad3,null))[_0x95f3('0x45')](handleError(_0x4ccad3,null));};exports[_0x95f3('0x4b')]=function(_0x2db8f5,_0x57a928){return db['AnalyticTreeReport'][_0x95f3('0x4b')](_0x2db8f5[_0x95f3('0x4c')],{})[_0x95f3('0x25')](respondWithResult(_0x57a928,0xc9))['catch'](handleError(_0x57a928,null));};exports[_0x95f3('0x24')]=function(_0x55461d,_0x2a4036){if(_0x55461d[_0x95f3('0x4c')]['id']){delete _0x55461d['body']['id'];}return db['AnalyticTreeReport'][_0x95f3('0x4a')]({'where':{'id':_0x55461d['params']['id']}})[_0x95f3('0x25')](handleEntityNotFound(_0x2a4036,null))[_0x95f3('0x25')](saveUpdates(_0x55461d[_0x95f3('0x4c')],null))[_0x95f3('0x25')](respondWithResult(_0x2a4036,null))['catch'](handleError(_0x2a4036,null));};exports['destroy']=function(_0x5a2f05,_0x29a83f){return db['AnalyticTreeReport'][_0x95f3('0x4a')]({'where':{'id':_0x5a2f05[_0x95f3('0x47')]['id']}})['then'](handleEntityNotFound(_0x29a83f,null))['then'](removeEntity(_0x29a83f,null))[_0x95f3('0x45')](handleError(_0x29a83f,null));};
\ No newline at end of file
+var _0xd8bd=['index','map','AnalyticTreeReport','rawAttributes','key','name','query','keys','filters','intersection','attributes','model','fields','length','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','send'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0xd8bd,0xb0));var _0xdd8b=function(_0x57f135,_0x54061b){_0x57f135=_0x57f135-0x0;var _0x166438=_0xd8bd[_0x57f135];return _0x166438;};'use strict';var emlformat=require(_0xdd8b('0x0'));var rimraf=require(_0xdd8b('0x1'));var zipdir=require(_0xdd8b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdd8b('0x3'));var Mustache=require(_0xdd8b('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xdd8b('0x5'));var ejs=require(_0xdd8b('0x6'));var fs=require('fs');var fs_extra=require(_0xdd8b('0x7'));var _=require(_0xdd8b('0x8'));var squel=require('squel');var crypto=require(_0xdd8b('0x9'));var jsforce=require(_0xdd8b('0xa'));var deskjs=require(_0xdd8b('0xb'));var toCsv=require('to-csv');var querystring=require(_0xdd8b('0xc'));var Papa=require(_0xdd8b('0xd'));var Redis=require(_0xdd8b('0xe'));var authService=require(_0xdd8b('0xf'));var qs=require(_0xdd8b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd8b('0x11'))(_0xdd8b('0x12'));var utils=require('../../config/utils');var config=require(_0xdd8b('0x13'));var licenseUtil=require(_0xdd8b('0x14'));var db=require(_0xdd8b('0x15'))['db'];function respondWithStatusCode(_0x5c6dd7,_0x40165b){_0x40165b=_0x40165b||0xcc;return function(_0x3dd77b){if(_0x3dd77b){return _0x5c6dd7[_0xdd8b('0x16')](_0x40165b);}return _0x5c6dd7[_0xdd8b('0x17')](_0x40165b)['end']();};}function respondWithResult(_0x27a4f2,_0x27d57a){_0x27d57a=_0x27d57a||0xc8;return function(_0x27b476){if(_0x27b476){return _0x27a4f2[_0xdd8b('0x17')](_0x27d57a)['json'](_0x27b476);}};}function respondWithFilteredResult(_0x43534a,_0x38680a){return function(_0x15f99a){if(_0x15f99a){var _0x1e535d=typeof _0x38680a[_0xdd8b('0x18')]===_0xdd8b('0x19')&&typeof _0x38680a[_0xdd8b('0x1a')]==='undefined';var _0x53e523=_0x15f99a['count'];var _0x47015b=_0x1e535d?0x0:_0x38680a[_0xdd8b('0x18')];var _0x2d4256=_0x1e535d?_0x15f99a[_0xdd8b('0x1b')]:_0x38680a['offset']+_0x38680a[_0xdd8b('0x1a')];var _0x4e2b42;if(_0x2d4256>=_0x53e523){_0x2d4256=_0x53e523;_0x4e2b42=0xc8;}else{_0x4e2b42=0xce;}_0x43534a[_0xdd8b('0x17')](_0x4e2b42);return _0x43534a[_0xdd8b('0x1c')](_0xdd8b('0x1d'),_0x47015b+'-'+_0x2d4256+'/'+_0x53e523)[_0xdd8b('0x1e')](_0x15f99a);}return null;};}function patchUpdates(_0x5db4a7){return function(_0x551d68){try{jsonpatch[_0xdd8b('0x1f')](_0x551d68,_0x5db4a7,!![]);}catch(_0x38439e){return BPromise['reject'](_0x38439e);}return _0x551d68[_0xdd8b('0x20')]();};}function saveUpdates(_0x5043b9,_0x46b93c){return function(_0x2aba8e){if(_0x2aba8e){return _0x2aba8e[_0xdd8b('0x21')](_0x5043b9)[_0xdd8b('0x22')](function(_0x20c4ee){return _0x20c4ee;});}return null;};}function removeEntity(_0x3f5c64,_0x334cd4){return function(_0x323384){if(_0x323384){return _0x323384[_0xdd8b('0x23')]()['then'](function(){_0x3f5c64[_0xdd8b('0x17')](0xcc)[_0xdd8b('0x24')]();});}};}function handleEntityNotFound(_0x2ccead,_0xa7e4ea){return function(_0x4c90fd){if(!_0x4c90fd){_0x2ccead['sendStatus'](0x194);}return _0x4c90fd;};}function handleError(_0x4e0998,_0x1b8305){_0x1b8305=_0x1b8305||0x1f4;return function(_0x4248e1){logger[_0xdd8b('0x25')](_0x4248e1[_0xdd8b('0x26')]);if(_0x4248e1['name']){delete _0x4248e1['name'];}_0x4e0998['status'](_0x1b8305)[_0xdd8b('0x27')](_0x4248e1);};}exports[_0xdd8b('0x28')]=function(_0x188c95,_0x237f4a){var _0x48331d={},_0x1a6d5c={},_0x2e9158={'count':0x0,'rows':[]};var _0xadd297=_[_0xdd8b('0x29')](db[_0xdd8b('0x2a')][_0xdd8b('0x2b')],function(_0x3724b4){return{'name':_0x3724b4['fieldName'],'type':_0x3724b4['type'][_0xdd8b('0x2c')]};});_0x1a6d5c['model']=_[_0xdd8b('0x29')](_0xadd297,_0xdd8b('0x2d'));_0x1a6d5c[_0xdd8b('0x2e')]=_[_0xdd8b('0x2f')](_0x188c95[_0xdd8b('0x2e')]);_0x1a6d5c[_0xdd8b('0x30')]=_[_0xdd8b('0x31')](_0x1a6d5c['model'],_0x1a6d5c['query']);_0x48331d[_0xdd8b('0x32')]=_['intersection'](_0x1a6d5c[_0xdd8b('0x33')],qs[_0xdd8b('0x34')](_0x188c95[_0xdd8b('0x2e')][_0xdd8b('0x34')]));_0x48331d[_0xdd8b('0x32')]=_0x48331d[_0xdd8b('0x32')][_0xdd8b('0x35')]?_0x48331d[_0xdd8b('0x32')]:_0x1a6d5c[_0xdd8b('0x33')];if(!_0x188c95['query']['hasOwnProperty']('nolimit')){_0x48331d[_0xdd8b('0x1a')]=qs['limit'](_0x188c95[_0xdd8b('0x2e')][_0xdd8b('0x1a')]);_0x48331d[_0xdd8b('0x18')]=qs['offset'](_0x188c95[_0xdd8b('0x2e')][_0xdd8b('0x18')]);}_0x48331d[_0xdd8b('0x36')]=qs[_0xdd8b('0x37')](_0x188c95[_0xdd8b('0x2e')][_0xdd8b('0x37')]);_0x48331d[_0xdd8b('0x38')]=qs[_0xdd8b('0x30')](_[_0xdd8b('0x39')](_0x188c95[_0xdd8b('0x2e')],_0x1a6d5c[_0xdd8b('0x30')]),_0xadd297);if(_0x188c95[_0xdd8b('0x2e')][_0xdd8b('0x3a')]){_0x48331d[_0xdd8b('0x38')]=_['merge'](_0x48331d['where'],{'$or':_[_0xdd8b('0x29')](_0xadd297,function(_0x700aef){if(_0x700aef[_0xdd8b('0x3b')]!==_0xdd8b('0x3c')){var _0x30170b={};_0x30170b[_0x700aef['name']]={'$like':'%'+_0x188c95[_0xdd8b('0x2e')]['filter']+'%'};return _0x30170b;}})});}_0x48331d=_[_0xdd8b('0x3d')]({},_0x48331d,_0x188c95['options']);var _0x3afaa6={'where':_0x48331d[_0xdd8b('0x38')]};return db[_0xdd8b('0x2a')][_0xdd8b('0x1b')](_0x3afaa6)[_0xdd8b('0x22')](function(_0x129d66){_0x2e9158[_0xdd8b('0x1b')]=_0x129d66;if(_0x188c95[_0xdd8b('0x2e')][_0xdd8b('0x3e')]){_0x48331d[_0xdd8b('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xdd8b('0x40')](_0x48331d);})[_0xdd8b('0x22')](function(_0x31c599){_0x2e9158[_0xdd8b('0x41')]=_0x31c599;return _0x2e9158;})[_0xdd8b('0x22')](respondWithFilteredResult(_0x237f4a,_0x48331d))[_0xdd8b('0x42')](handleError(_0x237f4a,null));};exports[_0xdd8b('0x43')]=function(_0x8ab2be,_0xc15427){var _0x10dcc9={'raw':!![],'where':{'id':_0x8ab2be['params']['id']}},_0x3c599c={};_0x3c599c[_0xdd8b('0x33')]=_[_0xdd8b('0x2f')](db[_0xdd8b('0x2a')][_0xdd8b('0x2b')]);_0x3c599c[_0xdd8b('0x2e')]=_[_0xdd8b('0x2f')](_0x8ab2be[_0xdd8b('0x2e')]);_0x3c599c[_0xdd8b('0x30')]=_[_0xdd8b('0x31')](_0x3c599c[_0xdd8b('0x33')],_0x3c599c[_0xdd8b('0x2e')]);_0x10dcc9['attributes']=_[_0xdd8b('0x31')](_0x3c599c[_0xdd8b('0x33')],qs[_0xdd8b('0x34')](_0x8ab2be[_0xdd8b('0x2e')]['fields']));_0x10dcc9['attributes']=_0x10dcc9['attributes']['length']?_0x10dcc9[_0xdd8b('0x32')]:_0x3c599c['model'];if(_0x8ab2be['query']['includeAll']){_0x10dcc9[_0xdd8b('0x3f')]=[{'all':!![]}];}_0x10dcc9=_[_0xdd8b('0x3d')]({},_0x10dcc9,_0x8ab2be['options']);return db['AnalyticTreeReport'][_0xdd8b('0x44')](_0x10dcc9)[_0xdd8b('0x22')](handleEntityNotFound(_0xc15427,null))[_0xdd8b('0x22')](respondWithResult(_0xc15427,null))['catch'](handleError(_0xc15427,null));};exports[_0xdd8b('0x45')]=function(_0x3e91f2,_0x1e3144){return db[_0xdd8b('0x2a')][_0xdd8b('0x45')](_0x3e91f2[_0xdd8b('0x46')],{})['then'](respondWithResult(_0x1e3144,0xc9))[_0xdd8b('0x42')](handleError(_0x1e3144,null));};exports[_0xdd8b('0x21')]=function(_0x156d8f,_0x3f9751){if(_0x156d8f[_0xdd8b('0x46')]['id']){delete _0x156d8f['body']['id'];}return db[_0xdd8b('0x2a')][_0xdd8b('0x44')]({'where':{'id':_0x156d8f[_0xdd8b('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f9751,null))[_0xdd8b('0x22')](saveUpdates(_0x156d8f[_0xdd8b('0x46')],null))['then'](respondWithResult(_0x3f9751,null))[_0xdd8b('0x42')](handleError(_0x3f9751,null));};exports[_0xdd8b('0x23')]=function(_0x63ae9,_0x240c74){return db[_0xdd8b('0x2a')]['find']({'where':{'id':_0x63ae9[_0xdd8b('0x47')]['id']}})[_0xdd8b('0x22')](handleEntityNotFound(_0x240c74,null))[_0xdd8b('0x22')](removeEntity(_0x240c74,null))[_0xdd8b('0x42')](handleError(_0x240c74,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 84d6235..ea46fd9 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 _0x387f=['define','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x57b35b,_0x4b0493){var _0x34a20b=function(_0x3ee3e7){while(--_0x3ee3e7){_0x57b35b['push'](_0x57b35b['shift']());}};_0x34a20b(++_0x4b0493);}(_0x387f,0x169));var _0xf387=function(_0x4f784f,_0x33c48e){_0x4f784f=_0x4f784f-0x0;var _0x4921cc=_0x387f[_0x4f784f];return _0x4921cc;};'use strict';var _=require(_0xf387('0x0'));var util=require(_0xf387('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf387('0x2'));var BPromise=require(_0xf387('0x3'));var rp=require(_0xf387('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf387('0x5'));var config=require(_0xf387('0x6'));var attributes=require(_0xf387('0x7'));module['exports']=function(_0x46d710,_0xc7bc56){return _0x46d710[_0xf387('0x8')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b3f=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees'];(function(_0x237c9f,_0xad81c4){var _0x1be536=function(_0x1bfaea){while(--_0x1bfaea){_0x237c9f['push'](_0x237c9f['shift']());}};_0x1be536(++_0xad81c4);}(_0x0b3f,0x6c));var _0xf0b3=function(_0x46d463,_0x2e8e61){_0x46d463=_0x46d463-0x0;var _0x3f9c94=_0x0b3f[_0x46d463];return _0x3f9c94;};'use strict';var _=require(_0xf0b3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf0b3('0x1'));var moment=require(_0xf0b3('0x2'));var BPromise=require(_0xf0b3('0x3'));var rp=require(_0xf0b3('0x4'));var fs=require('fs');var path=require(_0xf0b3('0x5'));var rimraf=require(_0xf0b3('0x6'));var config=require(_0xf0b3('0x7'));var attributes=require(_0xf0b3('0x8'));module[_0xf0b3('0x9')]=function(_0x240d83,_0x4f1f62){return _0x240d83[_0xf0b3('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0xf0b3('0xb'),'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 1321bcc..55d70f8 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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x21c56c,_0x24cccf){var _0x51d085=function(_0x1274c2){while(--_0x1274c2){_0x21c56c['push'](_0x21c56c['shift']());}};_0x51d085(++_0x24cccf);}(_0x1261,0x144));var _0x1126=function(_0x1249f4,_0x27226c){_0x1249f4=_0x1249f4-0x0;var _0x47c8a9=_0x1261[_0x1249f4];return _0x47c8a9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x27bc6d,_0x5cc68f){var _0x1131f1=function(_0xc3f2f5){while(--_0xc3f2f5){_0x27bc6d['push'](_0x27bc6d['shift']());}};_0x1131f1(++_0x5cc68f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc4aa[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index af62fa6..595c00e 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 _0xc672=['../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1f716f,_0xbb9877){var _0x397db0=function(_0x59f7){while(--_0x59f7){_0x1f716f['push'](_0x1f716f['shift']());}};_0x397db0(++_0xbb9877);}(_0xc672,0xf1));var _0x2c67=function(_0x163571,_0xc890f8){_0x163571=_0x163571-0x0;var _0x31d66d=_0xc672[_0x163571];return _0x31d66d;};'use strict';var multer=require(_0x2c67('0x0'));var util=require('util');var path=require(_0x2c67('0x1'));var timeout=require(_0x2c67('0x2'));var express=require(_0x2c67('0x3'));var router=express[_0x2c67('0x4')]();var fs_extra=require(_0x2c67('0x5'));var auth=require(_0x2c67('0x6'));var interaction=require(_0x2c67('0x7'));var config=require('../../config/environment');var controller=require(_0x2c67('0x8'));router['get']('/',auth[_0x2c67('0x9')](),controller['index']);router['get'](_0x2c67('0xa'),auth['isAuthenticated'](),controller[_0x2c67('0xb')]);router[_0x2c67('0xc')]('/',auth[_0x2c67('0x9')](),controller[_0x2c67('0xd')]);router[_0x2c67('0xe')](_0x2c67('0xa'),auth[_0x2c67('0x9')](),controller[_0x2c67('0xf')]);router[_0x2c67('0x10')](_0x2c67('0xa'),auth[_0x2c67('0x9')](),controller[_0x2c67('0x11')]);module[_0x2c67('0x12')]=router;
\ No newline at end of file
+var _0x46fd=['isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x3addde,_0x251294){var _0x55364e=function(_0x36812e){while(--_0x36812e){_0x3addde['push'](_0x3addde['shift']());}};_0x55364e(++_0x251294);}(_0x46fd,0x1eb));var _0xd46f=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x46fd[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require(_0xd46f('0x0'));var util=require(_0xd46f('0x1'));var path=require(_0xd46f('0x2'));var timeout=require(_0xd46f('0x3'));var express=require(_0xd46f('0x4'));var router=express['Router']();var fs_extra=require(_0xd46f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd46f('0x6'));var config=require(_0xd46f('0x7'));var controller=require(_0xd46f('0x8'));router['get']('/',auth[_0xd46f('0x9')](),controller[_0xd46f('0xa')]);router[_0xd46f('0xb')](_0xd46f('0xc'),auth[_0xd46f('0x9')](),controller[_0xd46f('0xd')]);router[_0xd46f('0xe')]('/',auth[_0xd46f('0x9')](),controller[_0xd46f('0xf')]);router[_0xd46f('0x10')](_0xd46f('0xc'),auth[_0xd46f('0x9')](),controller[_0xd46f('0x11')]);router['delete'](_0xd46f('0xc'),auth[_0xd46f('0x9')](),controller[_0xd46f('0x12')]);module[_0xd46f('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index c7ac6d4..5295b52 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 _0xe700=['exports','STRING','sequelize'];(function(_0x86eb0c,_0x4e16de){var _0x463d7b=function(_0x51f56e){while(--_0x51f56e){_0x86eb0c['push'](_0x86eb0c['shift']());}};_0x463d7b(++_0x4e16de);}(_0xe700,0x16a));var _0x0e70=function(_0x3887ce,_0x327268){_0x3887ce=_0x3887ce-0x0;var _0x3bf1cb=_0xe700[_0x3887ce];return _0x3bf1cb;};'use strict';var Sequelize=require(_0x0e70('0x0'));module[_0x0e70('0x1')]={'name':{'type':Sequelize[_0x0e70('0x2')]},'basename':{'type':Sequelize[_0x0e70('0x2')]},'type':{'type':Sequelize[_0x0e70('0x2')]}};
\ No newline at end of file
+var _0xbb53=['STRING','sequelize','exports'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xbb53,0x121));var _0x3bb5=function(_0x5a80b3,_0x574647){_0x5a80b3=_0x5a80b3-0x0;var _0x2ab3c0=_0xbb53[_0x5a80b3];return _0x2ab3c0;};'use strict';var Sequelize=require(_0x3bb5('0x0'));module[_0x3bb5('0x1')]={'name':{'type':Sequelize[_0x3bb5('0x2')]},'basename':{'type':Sequelize[_0x3bb5('0x2')]},'type':{'type':Sequelize[_0x3bb5('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index c72b9ce..e2a4422 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 _0xb2f2=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','sendStatus','error','name','index','map','fieldName','type','key','query','model','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','options','Attachment','includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','find','keys','get','omit','createdAt','body','create','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','server/files/attachments/','join','offline-chat/','basename','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xb2f2,0x159));var _0x2b2f=function(_0x70207a,_0x40dc8b){_0x70207a=_0x70207a-0x0;var _0x25c3d2=_0xb2f2[_0x70207a];return _0x25c3d2;};'use strict';var emlformat=require(_0x2b2f('0x0'));var rimraf=require(_0x2b2f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2b2f('0x2'));var rp=require(_0x2b2f('0x3'));var moment=require(_0x2b2f('0x4'));var BPromise=require(_0x2b2f('0x5'));var Mustache=require(_0x2b2f('0x6'));var util=require('util');var path=require(_0x2b2f('0x7'));var sox=require(_0x2b2f('0x8'));var csv=require(_0x2b2f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b2f('0xa'));var _=require(_0x2b2f('0xb'));var squel=require(_0x2b2f('0xc'));var crypto=require(_0x2b2f('0xd'));var jsforce=require(_0x2b2f('0xe'));var deskjs=require(_0x2b2f('0xf'));var toCsv=require(_0x2b2f('0x9'));var querystring=require(_0x2b2f('0x10'));var Papa=require(_0x2b2f('0x11'));var Redis=require(_0x2b2f('0x12'));var authService=require(_0x2b2f('0x13'));var qs=require(_0x2b2f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2b2f('0x15'));var logger=require(_0x2b2f('0x16'))(_0x2b2f('0x17'));var utils=require(_0x2b2f('0x18'));var config=require(_0x2b2f('0x19'));var licenseUtil=require(_0x2b2f('0x1a'));var db=require(_0x2b2f('0x1b'))['db'];function respondWithStatusCode(_0x2d99db,_0x2fac77){_0x2fac77=_0x2fac77||0xcc;return function(_0x510416){if(_0x510416){return _0x2d99db['sendStatus'](_0x2fac77);}return _0x2d99db[_0x2b2f('0x1c')](_0x2fac77)[_0x2b2f('0x1d')]();};}function respondWithResult(_0x19cb59,_0x43758c){_0x43758c=_0x43758c||0xc8;return function(_0xa0fb5a){if(_0xa0fb5a){return _0x19cb59[_0x2b2f('0x1c')](_0x43758c)[_0x2b2f('0x1e')](_0xa0fb5a);}};}function respondWithFilteredResult(_0x1971fd,_0xa72617){return function(_0x3e049a){if(_0x3e049a){var _0x4eccad=typeof _0xa72617[_0x2b2f('0x1f')]===_0x2b2f('0x20')&&typeof _0xa72617[_0x2b2f('0x21')]===_0x2b2f('0x20');var _0xce8db8=_0x3e049a[_0x2b2f('0x22')];var _0x2027a9=_0x4eccad?0x0:_0xa72617[_0x2b2f('0x1f')];var _0xca2c89=_0x4eccad?_0x3e049a[_0x2b2f('0x22')]:_0xa72617[_0x2b2f('0x1f')]+_0xa72617[_0x2b2f('0x21')];var _0x5f5920;if(_0xca2c89>=_0xce8db8){_0xca2c89=_0xce8db8;_0x5f5920=0xc8;}else{_0x5f5920=0xce;}_0x1971fd[_0x2b2f('0x1c')](_0x5f5920);return _0x1971fd['set'](_0x2b2f('0x23'),_0x2027a9+'-'+_0xca2c89+'/'+_0xce8db8)['json'](_0x3e049a);}return null;};}function patchUpdates(_0x296fb9){return function(_0x4072a2){try{jsonpatch['apply'](_0x4072a2,_0x296fb9,!![]);}catch(_0x211c43){return BPromise[_0x2b2f('0x24')](_0x211c43);}return _0x4072a2['save']();};}function saveUpdates(_0x5477ee,_0x2d791a){return function(_0xbc5768){if(_0xbc5768){return _0xbc5768[_0x2b2f('0x25')](_0x5477ee)[_0x2b2f('0x26')](function(_0x40cb6f){return _0x40cb6f;});}return null;};}function removeEntity(_0x5fd92b,_0x276e34){return function(_0x4a8fe6){if(_0x4a8fe6){return _0x4a8fe6[_0x2b2f('0x27')]()[_0x2b2f('0x26')](function(){_0x5fd92b[_0x2b2f('0x1c')](0xcc)[_0x2b2f('0x1d')]();});}};}function handleEntityNotFound(_0x58ec66,_0x483594){return function(_0x36dea8){if(!_0x36dea8){_0x58ec66[_0x2b2f('0x28')](0x194);}return _0x36dea8;};}function handleError(_0x2ef433,_0x367679){_0x367679=_0x367679||0x1f4;return function(_0xf636d7){logger[_0x2b2f('0x29')](_0xf636d7['stack']);if(_0xf636d7[_0x2b2f('0x2a')]){delete _0xf636d7[_0x2b2f('0x2a')];}_0x2ef433['status'](_0x367679)['send'](_0xf636d7);};}exports[_0x2b2f('0x2b')]=function(_0x37cc9d,_0x4f452d){var _0x113cca={},_0x54f2f4={},_0x4b882b={'count':0x0,'rows':[]};var _0x2549ec=_[_0x2b2f('0x2c')](db['Attachment']['rawAttributes'],function(_0x8b8f65){return{'name':_0x8b8f65[_0x2b2f('0x2d')],'type':_0x8b8f65[_0x2b2f('0x2e')][_0x2b2f('0x2f')]};});_0x54f2f4['model']=_[_0x2b2f('0x2c')](_0x2549ec,_0x2b2f('0x2a'));_0x54f2f4[_0x2b2f('0x30')]=_['keys'](_0x37cc9d['query']);_0x54f2f4['filters']=_['intersection'](_0x54f2f4[_0x2b2f('0x31')],_0x54f2f4[_0x2b2f('0x30')]);_0x113cca[_0x2b2f('0x32')]=_['intersection'](_0x54f2f4['model'],qs[_0x2b2f('0x33')](_0x37cc9d[_0x2b2f('0x30')][_0x2b2f('0x33')]));_0x113cca['attributes']=_0x113cca[_0x2b2f('0x32')][_0x2b2f('0x34')]?_0x113cca[_0x2b2f('0x32')]:_0x54f2f4[_0x2b2f('0x31')];if(!_0x37cc9d[_0x2b2f('0x30')]['hasOwnProperty'](_0x2b2f('0x35'))){_0x113cca[_0x2b2f('0x21')]=qs[_0x2b2f('0x21')](_0x37cc9d[_0x2b2f('0x30')][_0x2b2f('0x21')]);_0x113cca[_0x2b2f('0x1f')]=qs['offset'](_0x37cc9d['query'][_0x2b2f('0x1f')]);}_0x113cca[_0x2b2f('0x36')]=qs[_0x2b2f('0x37')](_0x37cc9d['query']['sort']);_0x113cca[_0x2b2f('0x38')]=qs['filters'](_[_0x2b2f('0x39')](_0x37cc9d[_0x2b2f('0x30')],_0x54f2f4[_0x2b2f('0x3a')]),_0x2549ec);if(_0x37cc9d[_0x2b2f('0x30')][_0x2b2f('0x3b')]){_0x113cca[_0x2b2f('0x38')]=_[_0x2b2f('0x3c')](_0x113cca['where'],{'$or':_[_0x2b2f('0x2c')](_0x2549ec,function(_0x17d985){if(_0x17d985['type']!=='VIRTUAL'){var _0x2e9c32={};_0x2e9c32[_0x17d985['name']]={'$like':'%'+_0x37cc9d['query']['filter']+'%'};return _0x2e9c32;}})});}_0x113cca=_[_0x2b2f('0x3c')]({},_0x113cca,_0x37cc9d[_0x2b2f('0x3d')]);var _0x376f6d={'where':_0x113cca[_0x2b2f('0x38')]};return db[_0x2b2f('0x3e')][_0x2b2f('0x22')](_0x376f6d)[_0x2b2f('0x26')](function(_0x48cacd){_0x4b882b[_0x2b2f('0x22')]=_0x48cacd;if(_0x37cc9d[_0x2b2f('0x30')][_0x2b2f('0x3f')]){_0x113cca[_0x2b2f('0x40')]=[{'all':!![]}];}return db[_0x2b2f('0x3e')][_0x2b2f('0x41')](_0x113cca);})['then'](function(_0x4da539){_0x4b882b[_0x2b2f('0x42')]=_0x4da539;return _0x4b882b;})['then'](respondWithFilteredResult(_0x4f452d,_0x113cca))[_0x2b2f('0x43')](handleError(_0x4f452d,null));};exports['show']=function(_0x256a80,_0x43f2b4){var _0x516ecf={'raw':!![],'where':{'id':_0x256a80[_0x2b2f('0x44')]['id']}},_0x685d7a={};_0x685d7a['model']=_['keys'](db[_0x2b2f('0x3e')][_0x2b2f('0x45')]);_0x685d7a[_0x2b2f('0x30')]=_['keys'](_0x256a80[_0x2b2f('0x30')]);_0x685d7a['filters']=_[_0x2b2f('0x46')](_0x685d7a['model'],_0x685d7a[_0x2b2f('0x30')]);_0x516ecf[_0x2b2f('0x32')]=_[_0x2b2f('0x46')](_0x685d7a['model'],qs[_0x2b2f('0x33')](_0x256a80[_0x2b2f('0x30')]['fields']));_0x516ecf[_0x2b2f('0x32')]=_0x516ecf[_0x2b2f('0x32')]['length']?_0x516ecf[_0x2b2f('0x32')]:_0x685d7a[_0x2b2f('0x31')];if(_0x256a80['query'][_0x2b2f('0x3f')]){_0x516ecf[_0x2b2f('0x40')]=[{'all':!![]}];}_0x516ecf=_[_0x2b2f('0x3c')]({},_0x516ecf,_0x256a80['options']);return db['Attachment'][_0x2b2f('0x47')](_0x516ecf)[_0x2b2f('0x26')](handleEntityNotFound(_0x43f2b4,null))[_0x2b2f('0x26')](respondWithResult(_0x43f2b4,null))['catch'](handleError(_0x43f2b4,null));};exports['clone']=function(_0x5b3c19,_0x455c18){var _0x5f133a={'where':{'id':_0x5b3c19[_0x2b2f('0x44')]['id']}},_0x591e99={};_0x591e99[_0x2b2f('0x31')]=_[_0x2b2f('0x48')](db[_0x2b2f('0x3e')][_0x2b2f('0x45')]);_0x5f133a[_0x2b2f('0x32')]=_[_0x2b2f('0x46')](_0x591e99[_0x2b2f('0x31')],qs[_0x2b2f('0x33')](_0x5b3c19[_0x2b2f('0x30')][_0x2b2f('0x33')]));_0x5f133a[_0x2b2f('0x32')]=_0x5f133a['attributes'][_0x2b2f('0x34')]?_0x5f133a[_0x2b2f('0x32')]:_0x591e99[_0x2b2f('0x31')];if(_0x5b3c19['query']['includeAll']){_0x5f133a[_0x2b2f('0x40')]=[{'all':!![]}];}_0x5f133a=_['merge']({},_0x5f133a,_0x5b3c19[_0x2b2f('0x3d')]);return db[_0x2b2f('0x3e')]['find'](_0x5f133a)[_0x2b2f('0x26')](handleEntityNotFound(_0x455c18,null))[_0x2b2f('0x26')](function(_0xdf8f08){if(_0xdf8f08){var _0x1dbdf0=_0xdf8f08[_0x2b2f('0x49')]({'plain':!![]});_0x1dbdf0=qs[_0x2b2f('0x4a')](_0x1dbdf0,['id',_0x2b2f('0x4b'),'updatedAt']);_0x5b3c19['body']=_[_0x2b2f('0x4a')](_0x5b3c19[_0x2b2f('0x4c')],['id',_0x2b2f('0x4b'),'updatedAt']);return db['Attachment']['create'](_[_0x2b2f('0x3c')](_0x1dbdf0,_0x5b3c19[_0x2b2f('0x4c')]),{'include':_0x5b3c19[_0x2b2f('0x30')][_0x2b2f('0x3f')]?[{'all':!![]}]:undefined});}})[_0x2b2f('0x26')](respondWithResult(_0x455c18,0xc9))['catch'](handleError(_0x455c18,null));};exports['update']=function(_0x465479,_0x595fb9){if(_0x465479[_0x2b2f('0x4c')]['id']){delete _0x465479[_0x2b2f('0x4c')]['id'];}return db[_0x2b2f('0x3e')][_0x2b2f('0x47')]({'where':{'id':_0x465479[_0x2b2f('0x44')]['id']}})[_0x2b2f('0x26')](handleEntityNotFound(_0x595fb9,null))['then'](saveUpdates(_0x465479[_0x2b2f('0x4c')],null))[_0x2b2f('0x26')](respondWithResult(_0x595fb9,null))['catch'](handleError(_0x595fb9,null));};exports[_0x2b2f('0x27')]=function(_0x2ab265,_0x5c9fcd){return db[_0x2b2f('0x3e')][_0x2b2f('0x47')]({'where':{'id':_0x2ab265[_0x2b2f('0x44')]['id']}})[_0x2b2f('0x26')](handleEntityNotFound(_0x5c9fcd,null))[_0x2b2f('0x26')](removeEntity(_0x5c9fcd,null))['catch'](handleError(_0x5c9fcd,null));};exports[_0x2b2f('0x4d')]=function(_0x175a7d,_0xca4182,_0x7c9ea5){_0x175a7d[_0x2b2f('0x4c')][_0x2b2f('0x2a')]=_0x175a7d[_0x2b2f('0x4e')][_0x2b2f('0x4f')];_0x175a7d[_0x2b2f('0x4c')]['basename']=_0x175a7d['file'][_0x2b2f('0x50')];_0x175a7d[_0x2b2f('0x4c')][_0x2b2f('0x2e')]=_0x175a7d[_0x2b2f('0x4e')][_0x2b2f('0x51')];return db[_0x2b2f('0x3e')]['create'](_0x175a7d['body'])[_0x2b2f('0x26')](respondWithResult(_0xca4182,0xc9))[_0x2b2f('0x43')](handleError(_0xca4182,null));};exports[_0x2b2f('0x52')]=function(_0x353247,_0x27feb1,_0x199c9b){return db['Attachment'][_0x2b2f('0x53')]({'where':{'id':_0x353247[_0x2b2f('0x44')]['id']},'raw':!![]})[_0x2b2f('0x26')](handleEntityNotFound(_0x27feb1,null))[_0x2b2f('0x26')](function(_0x55d296){if(_0x55d296){var _0x478ae7=_0x55d296[_0x2b2f('0x54')]!==null;var _0x376758=path['join'](config['root'],_0x2b2f('0x55'));if(_0x478ae7){_0x376758=path[_0x2b2f('0x56')](_0x376758,_0x2b2f('0x57'));}var _0x22a9f0=path[_0x2b2f('0x56')](_0x376758,_0x55d296[_0x2b2f('0x58')]);return _0x27feb1[_0x2b2f('0x52')](_0x22a9f0);}})[_0x2b2f('0x43')](handleError(_0x27feb1,null));};
\ No newline at end of file
+var _0xacf4=['findAll','rows','catch','show','params','intersection','find','clone','get','omit','createdAt','body','updatedAt','create','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','send','map','Attachment','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','includeAll','include'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xacf4,0x186));var _0x4acf=function(_0x4bf457,_0x14dcf4){_0x4bf457=_0x4bf457-0x0;var _0x232be2=_0xacf4[_0x4bf457];return _0x232be2;};'use strict';var emlformat=require(_0x4acf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require(_0x4acf('0x7'));var sox=require(_0x4acf('0x8'));var csv=require('to-csv');var ejs=require(_0x4acf('0x9'));var fs=require('fs');var fs_extra=require(_0x4acf('0xa'));var _=require('lodash');var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4acf('0xd'));var toCsv=require(_0x4acf('0xe'));var querystring=require('querystring');var Papa=require(_0x4acf('0xf'));var Redis=require(_0x4acf('0x10'));var authService=require(_0x4acf('0x11'));var qs=require(_0x4acf('0x12'));var as=require(_0x4acf('0x13'));var hardwareService=require(_0x4acf('0x14'));var logger=require(_0x4acf('0x15'))('api');var utils=require(_0x4acf('0x16'));var config=require(_0x4acf('0x17'));var licenseUtil=require(_0x4acf('0x18'));var db=require(_0x4acf('0x19'))['db'];function respondWithStatusCode(_0x2f30c1,_0x4ddfce){_0x4ddfce=_0x4ddfce||0xcc;return function(_0x391e31){if(_0x391e31){return _0x2f30c1[_0x4acf('0x1a')](_0x4ddfce);}return _0x2f30c1[_0x4acf('0x1b')](_0x4ddfce)[_0x4acf('0x1c')]();};}function respondWithResult(_0x4486f4,_0x115242){_0x115242=_0x115242||0xc8;return function(_0x55d9e2){if(_0x55d9e2){return _0x4486f4[_0x4acf('0x1b')](_0x115242)[_0x4acf('0x1d')](_0x55d9e2);}};}function respondWithFilteredResult(_0x1a8caf,_0x5b146b){return function(_0x4ecaec){if(_0x4ecaec){var _0x2d2552=typeof _0x5b146b['offset']===_0x4acf('0x1e')&&typeof _0x5b146b[_0x4acf('0x1f')]==='undefined';var _0x2e4c00=_0x4ecaec[_0x4acf('0x20')];var _0x214d1e=_0x2d2552?0x0:_0x5b146b[_0x4acf('0x21')];var _0x2fbe89=_0x2d2552?_0x4ecaec[_0x4acf('0x20')]:_0x5b146b[_0x4acf('0x21')]+_0x5b146b['limit'];var _0x3f73e3;if(_0x2fbe89>=_0x2e4c00){_0x2fbe89=_0x2e4c00;_0x3f73e3=0xc8;}else{_0x3f73e3=0xce;}_0x1a8caf[_0x4acf('0x1b')](_0x3f73e3);return _0x1a8caf[_0x4acf('0x22')](_0x4acf('0x23'),_0x214d1e+'-'+_0x2fbe89+'/'+_0x2e4c00)[_0x4acf('0x1d')](_0x4ecaec);}return null;};}function patchUpdates(_0x39b2c3){return function(_0x4379ea){try{jsonpatch['apply'](_0x4379ea,_0x39b2c3,!![]);}catch(_0x1a6a6a){return BPromise[_0x4acf('0x24')](_0x1a6a6a);}return _0x4379ea[_0x4acf('0x25')]();};}function saveUpdates(_0x4e54dd,_0x436f4e){return function(_0x55ca5b){if(_0x55ca5b){return _0x55ca5b[_0x4acf('0x26')](_0x4e54dd)[_0x4acf('0x27')](function(_0x152b3c){return _0x152b3c;});}return null;};}function removeEntity(_0x5d5011,_0x485319){return function(_0x410968){if(_0x410968){return _0x410968[_0x4acf('0x28')]()['then'](function(){_0x5d5011['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47a3fd,_0x4c82f4){return function(_0x523c08){if(!_0x523c08){_0x47a3fd['sendStatus'](0x194);}return _0x523c08;};}function handleError(_0x2f980c,_0x4a9fcc){_0x4a9fcc=_0x4a9fcc||0x1f4;return function(_0x17f496){logger[_0x4acf('0x29')](_0x17f496['stack']);if(_0x17f496['name']){delete _0x17f496['name'];}_0x2f980c['status'](_0x4a9fcc)[_0x4acf('0x2a')](_0x17f496);};}exports['index']=function(_0x517264,_0x390928){var _0x32366b={},_0x45e9e6={},_0x3e3115={'count':0x0,'rows':[]};var _0x17325d=_[_0x4acf('0x2b')](db[_0x4acf('0x2c')][_0x4acf('0x2d')],function(_0x58e8af){return{'name':_0x58e8af[_0x4acf('0x2e')],'type':_0x58e8af[_0x4acf('0x2f')]['key']};});_0x45e9e6[_0x4acf('0x30')]=_[_0x4acf('0x2b')](_0x17325d,_0x4acf('0x31'));_0x45e9e6[_0x4acf('0x32')]=_[_0x4acf('0x33')](_0x517264[_0x4acf('0x32')]);_0x45e9e6[_0x4acf('0x34')]=_['intersection'](_0x45e9e6[_0x4acf('0x30')],_0x45e9e6[_0x4acf('0x32')]);_0x32366b['attributes']=_['intersection'](_0x45e9e6['model'],qs['fields'](_0x517264[_0x4acf('0x32')][_0x4acf('0x35')]));_0x32366b['attributes']=_0x32366b[_0x4acf('0x36')][_0x4acf('0x37')]?_0x32366b[_0x4acf('0x36')]:_0x45e9e6['model'];if(!_0x517264[_0x4acf('0x32')]['hasOwnProperty'](_0x4acf('0x38'))){_0x32366b[_0x4acf('0x1f')]=qs[_0x4acf('0x1f')](_0x517264['query'][_0x4acf('0x1f')]);_0x32366b['offset']=qs['offset'](_0x517264[_0x4acf('0x32')][_0x4acf('0x21')]);}_0x32366b[_0x4acf('0x39')]=qs['sort'](_0x517264[_0x4acf('0x32')][_0x4acf('0x3a')]);_0x32366b[_0x4acf('0x3b')]=qs[_0x4acf('0x34')](_['pick'](_0x517264[_0x4acf('0x32')],_0x45e9e6[_0x4acf('0x34')]),_0x17325d);if(_0x517264[_0x4acf('0x32')][_0x4acf('0x3c')]){_0x32366b[_0x4acf('0x3b')]=_[_0x4acf('0x3d')](_0x32366b[_0x4acf('0x3b')],{'$or':_['map'](_0x17325d,function(_0x4ed1d1){if(_0x4ed1d1[_0x4acf('0x2f')]!=='VIRTUAL'){var _0xe42309={};_0xe42309[_0x4ed1d1['name']]={'$like':'%'+_0x517264['query'][_0x4acf('0x3c')]+'%'};return _0xe42309;}})});}_0x32366b=_[_0x4acf('0x3d')]({},_0x32366b,_0x517264[_0x4acf('0x3e')]);var _0x23212b={'where':_0x32366b['where']};return db['Attachment'][_0x4acf('0x20')](_0x23212b)[_0x4acf('0x27')](function(_0x36f948){_0x3e3115[_0x4acf('0x20')]=_0x36f948;if(_0x517264[_0x4acf('0x32')][_0x4acf('0x3f')]){_0x32366b[_0x4acf('0x40')]=[{'all':!![]}];}return db['Attachment'][_0x4acf('0x41')](_0x32366b);})[_0x4acf('0x27')](function(_0x2b1725){_0x3e3115[_0x4acf('0x42')]=_0x2b1725;return _0x3e3115;})['then'](respondWithFilteredResult(_0x390928,_0x32366b))[_0x4acf('0x43')](handleError(_0x390928,null));};exports[_0x4acf('0x44')]=function(_0x18e440,_0x403feb){var _0x12072d={'raw':!![],'where':{'id':_0x18e440[_0x4acf('0x45')]['id']}},_0x3d5c6f={};_0x3d5c6f[_0x4acf('0x30')]=_[_0x4acf('0x33')](db[_0x4acf('0x2c')][_0x4acf('0x2d')]);_0x3d5c6f[_0x4acf('0x32')]=_['keys'](_0x18e440['query']);_0x3d5c6f[_0x4acf('0x34')]=_[_0x4acf('0x46')](_0x3d5c6f[_0x4acf('0x30')],_0x3d5c6f[_0x4acf('0x32')]);_0x12072d['attributes']=_['intersection'](_0x3d5c6f['model'],qs[_0x4acf('0x35')](_0x18e440['query'][_0x4acf('0x35')]));_0x12072d['attributes']=_0x12072d[_0x4acf('0x36')][_0x4acf('0x37')]?_0x12072d[_0x4acf('0x36')]:_0x3d5c6f[_0x4acf('0x30')];if(_0x18e440[_0x4acf('0x32')][_0x4acf('0x3f')]){_0x12072d[_0x4acf('0x40')]=[{'all':!![]}];}_0x12072d=_['merge']({},_0x12072d,_0x18e440[_0x4acf('0x3e')]);return db[_0x4acf('0x2c')][_0x4acf('0x47')](_0x12072d)[_0x4acf('0x27')](handleEntityNotFound(_0x403feb,null))[_0x4acf('0x27')](respondWithResult(_0x403feb,null))[_0x4acf('0x43')](handleError(_0x403feb,null));};exports[_0x4acf('0x48')]=function(_0x138c7c,_0xc6ebec){var _0x4318bb={'where':{'id':_0x138c7c['params']['id']}},_0x1d0bdd={};_0x1d0bdd[_0x4acf('0x30')]=_[_0x4acf('0x33')](db[_0x4acf('0x2c')]['rawAttributes']);_0x4318bb[_0x4acf('0x36')]=_[_0x4acf('0x46')](_0x1d0bdd['model'],qs[_0x4acf('0x35')](_0x138c7c['query'][_0x4acf('0x35')]));_0x4318bb[_0x4acf('0x36')]=_0x4318bb[_0x4acf('0x36')][_0x4acf('0x37')]?_0x4318bb[_0x4acf('0x36')]:_0x1d0bdd[_0x4acf('0x30')];if(_0x138c7c['query']['includeAll']){_0x4318bb[_0x4acf('0x40')]=[{'all':!![]}];}_0x4318bb=_[_0x4acf('0x3d')]({},_0x4318bb,_0x138c7c[_0x4acf('0x3e')]);return db[_0x4acf('0x2c')][_0x4acf('0x47')](_0x4318bb)[_0x4acf('0x27')](handleEntityNotFound(_0xc6ebec,null))[_0x4acf('0x27')](function(_0xbeac2){if(_0xbeac2){var _0xb33f98=_0xbeac2[_0x4acf('0x49')]({'plain':!![]});_0xb33f98=qs[_0x4acf('0x4a')](_0xb33f98,['id',_0x4acf('0x4b'),'updatedAt']);_0x138c7c[_0x4acf('0x4c')]=_['omit'](_0x138c7c['body'],['id',_0x4acf('0x4b'),_0x4acf('0x4d')]);return db[_0x4acf('0x2c')][_0x4acf('0x4e')](_[_0x4acf('0x3d')](_0xb33f98,_0x138c7c['body']),{'include':_0x138c7c[_0x4acf('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x4acf('0x27')](respondWithResult(_0xc6ebec,0xc9))[_0x4acf('0x43')](handleError(_0xc6ebec,null));};exports['update']=function(_0x450359,_0x528cdc){if(_0x450359[_0x4acf('0x4c')]['id']){delete _0x450359[_0x4acf('0x4c')]['id'];}return db['Attachment'][_0x4acf('0x47')]({'where':{'id':_0x450359['params']['id']}})[_0x4acf('0x27')](handleEntityNotFound(_0x528cdc,null))['then'](saveUpdates(_0x450359[_0x4acf('0x4c')],null))['then'](respondWithResult(_0x528cdc,null))['catch'](handleError(_0x528cdc,null));};exports['destroy']=function(_0x38b8ca,_0x176d15){return db['Attachment'][_0x4acf('0x47')]({'where':{'id':_0x38b8ca[_0x4acf('0x45')]['id']}})[_0x4acf('0x27')](handleEntityNotFound(_0x176d15,null))[_0x4acf('0x27')](removeEntity(_0x176d15,null))[_0x4acf('0x43')](handleError(_0x176d15,null));};exports[_0x4acf('0x4e')]=function(_0x3bbe39,_0x2c62dd,_0xe20668){_0x3bbe39[_0x4acf('0x4c')][_0x4acf('0x31')]=_0x3bbe39[_0x4acf('0x4f')][_0x4acf('0x50')];_0x3bbe39[_0x4acf('0x4c')]['basename']=_0x3bbe39['file'][_0x4acf('0x51')];_0x3bbe39['body']['type']=_0x3bbe39[_0x4acf('0x4f')][_0x4acf('0x52')];return db[_0x4acf('0x2c')][_0x4acf('0x4e')](_0x3bbe39[_0x4acf('0x4c')])[_0x4acf('0x27')](respondWithResult(_0x2c62dd,0xc9))['catch'](handleError(_0x2c62dd,null));};exports[_0x4acf('0x53')]=function(_0x2e2ed7,_0xa9a7ba,_0x1096d8){return db[_0x4acf('0x2c')][_0x4acf('0x54')]({'where':{'id':_0x2e2ed7[_0x4acf('0x45')]['id']},'raw':!![]})[_0x4acf('0x27')](handleEntityNotFound(_0xa9a7ba,null))[_0x4acf('0x27')](function(_0xd345fe){if(_0xd345fe){var _0x591e89=_0xd345fe[_0x4acf('0x55')]!==null;var _0x48e823=path[_0x4acf('0x56')](config[_0x4acf('0x57')],_0x4acf('0x58'));if(_0x591e89){_0x48e823=path['join'](_0x48e823,_0x4acf('0x59'));}var _0x4216b6=path[_0x4acf('0x56')](_0x48e823,_0xd345fe[_0x4acf('0x5a')]);return _0xa9a7ba['download'](_0x4216b6);}})[_0x4acf('0x43')](handleError(_0xa9a7ba,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 7789de8..3decb4c 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 _0xbcdb=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','Attachment','attachments'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0xbcdb,0xe4));var _0xbbcd=function(_0x31362c,_0x46b97d){_0x31362c=_0x31362c-0x0;var _0x341918=_0xbcdb[_0x31362c];return _0x341918;};'use strict';var _=require('lodash');var util=require(_0xbbcd('0x0'));var logger=require(_0xbbcd('0x1'))(_0xbbcd('0x2'));var moment=require(_0xbbcd('0x3'));var BPromise=require(_0xbbcd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbcd('0x5'));var rimraf=require(_0xbbcd('0x6'));var config=require(_0xbbcd('0x7'));var attributes=require('./attachment.attributes');module[_0xbbcd('0x8')]=function(_0x1273af,_0x500596){return _0x1273af[_0xbbcd('0x9')](_0xbbcd('0xa'),attributes,{'tableName':_0xbbcd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc832=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','define','Attachment','attachments','lodash'];(function(_0x239a3d,_0xc087f4){var _0x1a43de=function(_0x2b2391){while(--_0x2b2391){_0x239a3d['push'](_0x239a3d['shift']());}};_0x1a43de(++_0xc087f4);}(_0xc832,0xf6));var _0x2c83=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xc832[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x2c83('0x0'));var util=require(_0x2c83('0x1'));var logger=require(_0x2c83('0x2'))(_0x2c83('0x3'));var moment=require('moment');var BPromise=require(_0x2c83('0x4'));var rp=require(_0x2c83('0x5'));var fs=require('fs');var path=require(_0x2c83('0x6'));var rimraf=require(_0x2c83('0x7'));var config=require('../../config/environment');var attributes=require(_0x2c83('0x8'));module[_0x2c83('0x9')]=function(_0x44fefc,_0x424a78){return _0x44fefc[_0x2c83('0xa')](_0x2c83('0xb'),attributes,{'tableName':_0x2c83('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index a2d2838..618b947 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 _0x22fb=['message','error','result','catch','Attachment','create','options','raw','CreateAttachment','stringify','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','code'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x22fb,0x192));var _0xb22f=function(_0x3fdabd,_0x4f21c3){_0x3fdabd=_0x3fdabd-0x0;var _0x323f9b=_0x22fb[_0x3fdabd];return _0x323f9b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb22f('0x0'));var BPromise=require('bluebird');var rs=require(_0xb22f('0x1'));var fs=require('fs');var Redis=require(_0xb22f('0x2'));var db=require(_0xb22f('0x3'))['db'];var utils=require(_0xb22f('0x4'));var logger=require(_0xb22f('0x5'))('rpc');var config=require(_0xb22f('0x6'));var jayson=require(_0xb22f('0x7'));var client=jayson[_0xb22f('0x8')][_0xb22f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x412a95,_0x367d4b,_0x47f61a){return new BPromise(function(_0x34433b,_0x22c509){return client[_0xb22f('0xa')](_0x412a95,_0x47f61a)[_0xb22f('0xb')](function(_0x1a3aae){logger[_0xb22f('0xc')](_0xb22f('0xd'),_0x367d4b,_0xb22f('0xe'));logger[_0xb22f('0xf')](_0xb22f('0x10'),_0x367d4b,_0xb22f('0xe'),JSON['stringify'](_0x1a3aae));if(_0x1a3aae['error']){if(_0x1a3aae['error'][_0xb22f('0x11')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x367d4b,_0x1a3aae['error'][_0xb22f('0x12')]);return _0x22c509(_0x1a3aae[_0xb22f('0x13')][_0xb22f('0x12')]);}logger[_0xb22f('0x13')](_0xb22f('0xd'),_0x367d4b,_0x1a3aae[_0xb22f('0x13')]['message']);return _0x34433b(_0x1a3aae[_0xb22f('0x13')]['message']);}else{logger[_0xb22f('0xc')]('Attachment,\x20%s,\x20%s',_0x367d4b,_0xb22f('0xe'));_0x34433b(_0x1a3aae[_0xb22f('0x14')][_0xb22f('0x12')]);}})[_0xb22f('0x15')](function(_0x447eaf){logger['error'](_0xb22f('0xd'),_0x367d4b,_0x447eaf);_0x22c509(_0x447eaf);});});}exports['CreateAttachment']=function(_0x252742){var _0x35caec=this;return new Promise(function(_0x2aaec4,_0x1f515d){return db[_0xb22f('0x16')][_0xb22f('0x17')](_0x252742['body'],{'raw':_0x252742[_0xb22f('0x18')]?_0x252742['options'][_0xb22f('0x19')]===undefined?!![]:![]:!![]})[_0xb22f('0xb')](function(_0x316f11){logger[_0xb22f('0xc')](_0xb22f('0x1a'),_0x252742);logger['debug']('CreateAttachment',_0x252742,JSON[_0xb22f('0x1b')](_0x316f11));_0x2aaec4(_0x316f11);})[_0xb22f('0x15')](function(_0xf34e0d){logger[_0xb22f('0x13')](_0xb22f('0x1a'),_0xf34e0d[_0xb22f('0x12')],_0x252742);_0x1f515d(_0x35caec[_0xb22f('0x13')](0x1f4,_0xf34e0d[_0xb22f('0x12')]));});});};
\ No newline at end of file
+var _0x559a=['request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x5207d6,_0x2eb625){var _0x2c7443=function(_0x3201d2){while(--_0x3201d2){_0x5207d6['push'](_0x5207d6['shift']());}};_0x2c7443(++_0x2eb625);}(_0x559a,0xb3));var _0xa559=function(_0x1b3381,_0x568e87){_0x1b3381=_0x1b3381-0x0;var _0x114fec=_0x559a[_0x1b3381];return _0x114fec;};'use strict';var _=require(_0xa559('0x0'));var util=require(_0xa559('0x1'));var moment=require('moment');var BPromise=require(_0xa559('0x2'));var rs=require(_0xa559('0x3'));var fs=require('fs');var Redis=require(_0xa559('0x4'));var db=require(_0xa559('0x5'))['db'];var utils=require(_0xa559('0x6'));var logger=require(_0xa559('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa559('0x8'));var client=jayson[_0xa559('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2edab4,_0x1a5cec,_0x4eada1){return new BPromise(function(_0xb8055,_0x218e3b){return client[_0xa559('0xa')](_0x2edab4,_0x4eada1)[_0xa559('0xb')](function(_0x48aa9a){logger[_0xa559('0xc')](_0xa559('0xd'),_0x1a5cec,_0xa559('0xe'));logger[_0xa559('0xf')]('Attachment,\x20%s,\x20%s,\x20%s',_0x1a5cec,'request\x20sent',JSON[_0xa559('0x10')](_0x48aa9a));if(_0x48aa9a[_0xa559('0x11')]){if(_0x48aa9a['error'][_0xa559('0x12')]===0x1f4){logger['error'](_0xa559('0xd'),_0x1a5cec,_0x48aa9a['error'][_0xa559('0x13')]);return _0x218e3b(_0x48aa9a[_0xa559('0x11')][_0xa559('0x13')]);}logger['error'](_0xa559('0xd'),_0x1a5cec,_0x48aa9a[_0xa559('0x11')]['message']);return _0xb8055(_0x48aa9a[_0xa559('0x11')][_0xa559('0x13')]);}else{logger[_0xa559('0xc')](_0xa559('0xd'),_0x1a5cec,'request\x20sent');_0xb8055(_0x48aa9a[_0xa559('0x14')]['message']);}})[_0xa559('0x15')](function(_0x1387b6){logger['error'](_0xa559('0xd'),_0x1a5cec,_0x1387b6);_0x218e3b(_0x1387b6);});});}exports[_0xa559('0x16')]=function(_0x163405){var _0xd21ebf=this;return new Promise(function(_0x1a4c42,_0x16f090){return db[_0xa559('0x17')][_0xa559('0x18')](_0x163405[_0xa559('0x19')],{'raw':_0x163405[_0xa559('0x1a')]?_0x163405['options']['raw']===undefined?!![]:![]:!![]})[_0xa559('0xb')](function(_0x3aa532){logger['info'](_0xa559('0x16'),_0x163405);logger[_0xa559('0xf')](_0xa559('0x16'),_0x163405,JSON[_0xa559('0x10')](_0x3aa532));_0x1a4c42(_0x3aa532);})[_0xa559('0x15')](function(_0x2dd8cf){logger['error'](_0xa559('0x16'),_0x2dd8cf['message'],_0x163405);_0x16f090(_0xd21ebf[_0xa559('0x11')](0x1f4,_0x2dd8cf[_0xa559('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index f65c468..29d2f95 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x20daa8,_0x1022a4){var _0xdada56=function(_0x528750){while(--_0x528750){_0x20daa8['push'](_0x20daa8['shift']());}};_0xdada56(++_0x1022a4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x30bea1,_0x468ea6){_0x30bea1=_0x30bea1-0x0;var _0xa2e99c=_0x5f2f[_0x30bea1];return _0xa2e99c;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x2bd6c9,_0x36a113){var _0x147850=function(_0x5b729a){while(--_0x5b729a){_0x2bd6c9['push'](_0x2bd6c9['shift']());}};_0x147850(++_0x36a113);}(_0xadb5,0xad));var _0x5adb=function(_0x575f66,_0x4d744c){_0x575f66=_0x575f66-0x0;var _0x2db7a5=_0xadb5[_0x575f66];return _0x2db7a5;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index fba8bc7..58819e9 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 _0xcbba=['../../config/logger','api','activedirectory','undefined','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','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blocked','blockedAt','online','admin','user','agent','then','blockDuration','add','minutes','clearBlockUser','getLicense','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','password','User','passport','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x23b349,_0xf34aaa){var _0x32ef80=function(_0x1d5660){while(--_0x1d5660){_0x23b349['push'](_0x23b349['shift']());}};_0x32ef80(++_0xf34aaa);}(_0xcbba,0x16a));var _0xacbb=function(_0x263b36,_0x988d3c){_0x263b36=_0x263b36-0x0;var _0x64387b=_0xcbba[_0x263b36];return _0x64387b;};'use strict';var passport=require(_0xacbb('0x0'));var LocalStrategy=require('passport-local')[_0xacbb('0x1')];var moment=require(_0xacbb('0x2'));var ActiveDirectory=require(_0xacbb('0x3'));var BPromise=require(_0xacbb('0x4'));var util=require(_0xacbb('0x5'));var db=require(_0xacbb('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xacbb('0x7'));var config=require(_0xacbb('0x8'));var logger=require(_0xacbb('0x9'))(_0xacbb('0xa'));function isActiveDirectoryConfigured(_0x30e358){var _0x452740=![];if(typeof _0x30e358[_0xacbb('0xb')]!==_0xacbb('0xc')){_0x452740=_0x30e358[_0xacbb('0xb')][_0xacbb('0xd')]&&_0x30e358[_0xacbb('0xb')][_0xacbb('0xe')]&&_0x30e358[_0xacbb('0xb')][_0xacbb('0xf')];}return _0x452740;}function adAuthenticate(_0x390018,_0x1a87db,_0x117374){return new BPromise(function(_0x494708,_0xb163e){try{var _0x74fb8c=new ActiveDirectory(_0x390018);_0x74fb8c[_0xacbb('0x10')](_0x1a87db,_0x117374,function(_0x3f05b8,_0x144efe){if(_0x3f05b8){logger[_0xacbb('0x11')](_0xacbb('0x12'),_0x1a87db,util[_0xacbb('0x13')](_0x3f05b8,{'showHidden':![],'depth':null}));_0xb163e(_0xacbb('0x14'));}else if(!_0x144efe){logger[_0xacbb('0x11')](_0xacbb('0x15'),_0x1a87db);_0xb163e(_0xacbb('0x14'));}else{_0x494708(_0x144efe);}});}catch(_0x55ada0){_0xb163e(_0x55ada0);}});}function ActiveDirectoryAuthenticate(_0x34b2ba,_0x22ef55,_0x23f8f4,_0x3b178b){var _0x5c438b,_0x2d9dd2;if(!isActiveDirectoryConfigured(config)){logger[_0xacbb('0x11')](_0xacbb('0x16'),_0x22ef55);return _0x3b178b(null,![],{'message':_0xacbb('0x14')});}return db['Setting'][_0xacbb('0x17')]({'where':{'id':0x1},'attributes':[_0xacbb('0x18'),'blockDuration'],'raw':!![]})['then'](function(_0x5c4c58){_0x5c438b=_0x5c4c58;if(!_0x5c438b[_0xacbb('0x18')]){logger[_0xacbb('0x11')](_0xacbb('0x19'),_0x22ef55);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x34b2ba['findOne']({'attributes':['id',_0xacbb('0x1a'),'password',_0xacbb('0x1b'),_0xacbb('0x1c'),_0xacbb('0x1d'),_0xacbb('0x1e'),_0xacbb('0x1f'),_0xacbb('0x20')],'where':{'name':_0x22ef55,'role':{'$or':[_0xacbb('0x21'),_0xacbb('0x22'),_0xacbb('0x23')]},'adSsoEnabled':!![]}});})[_0xacbb('0x24')](function(_0x28cba4){if(!_0x28cba4||_0x28cba4&&_0x28cba4['name']!==_0x22ef55){throw new Error(_0xacbb('0x14'));}_0x2d9dd2=_0x28cba4;var _0x1fe481=_0x2d9dd2[_0xacbb('0x1a')]+'@'+config[_0xacbb('0xb')][_0xacbb('0xf')];return adAuthenticate(config[_0xacbb('0xb')],_0x1fe481,_0x23f8f4);})['then'](function(_0x437217){if(_0x2d9dd2[_0xacbb('0x1d')]){throw new Error(_0xacbb('0x14'));}if(_0x5c438b[_0xacbb('0x25')]>0x0){if(_0x2d9dd2[_0xacbb('0x1e')]){if(moment(_0x2d9dd2[_0xacbb('0x1f')])[_0xacbb('0x26')](_0x5c438b[_0xacbb('0x25')],_0xacbb('0x27'))>moment()){throw new Error(_0xacbb('0x14'));}return utils[_0xacbb('0x28')](_0x2d9dd2,0x0,![],null)[_0xacbb('0x24')](function(){return utils[_0xacbb('0x29')](_0x2d9dd2);})[_0xacbb('0x24')](function(){return _0x3b178b(null,_0x2d9dd2);});}else{return utils[_0xacbb('0x29')](_0x2d9dd2)[_0xacbb('0x24')](function(){return _0x3b178b(null,_0x2d9dd2);});}}else{return utils[_0xacbb('0x29')](_0x2d9dd2)[_0xacbb('0x24')](function(){return _0x3b178b(null,_0x2d9dd2);});}})['catch'](function(_0x1fe214){return _0x3b178b(null,![],_0x1fe214);});}function handleError(_0x321110,_0x351502,_0x2c7de9){return _0x321110[_0xacbb('0x2a')](_0x351502||0x1f4)[_0xacbb('0x2b')]({'message':_0x2c7de9?_0x2c7de9[_0xacbb('0x2c')]||_0x2c7de9:''});}exports[_0xacbb('0x2d')]=function(_0x372dda,_0x3df636,_0x530416){passport[_0xacbb('0x10')](_0xacbb('0x2e'),function(_0x3b3f4e,_0x12533a,_0x274cc5){var _0x227006=_0x3b3f4e||_0x274cc5;if(_0x227006){return handleError(_0x3df636,0x191,_0x227006);}if(!_0x12533a){return handleError(_0x3df636,0x194,{'message':_0xacbb('0x2f')});}else{var _0x312ec5={'payload':{'id':_0x12533a['id'],'role':_0x12533a[_0xacbb('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0xacbb('0x30')](_0x312ec5)[_0xacbb('0x24')](function(_0x5a9d3a){_0x3df636[_0xacbb('0x31')]({'id':_0x12533a['id'],'token':_0x5a9d3a,'statusCall':'','isAlreadyLogged':_0x12533a[_0xacbb('0x20')]});});}})(_0x372dda,_0x3df636,_0x530416);};passport[_0xacbb('0x32')](_0xacbb('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':_0xacbb('0x33')},function(_0x1a1f7d,_0x2ed80a,_0x53789c){return ActiveDirectoryAuthenticate(db[_0xacbb('0x34')],_0x1a1f7d,_0x2ed80a,_0x53789c);}));
\ No newline at end of file
+var _0xcc20=['admin','user','agent','minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','json','passport','passport-local','moment','activedirectory2','util','../../config/utils','../../config/environment','../../config/logger','undefined','activedirectory','baseDN','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','role','disabled','blocked','blockedAt','online'];(function(_0x360e5c,_0x1d60de){var _0x3629ea=function(_0x3f12b6){while(--_0x3f12b6){_0x360e5c['push'](_0x360e5c['shift']());}};_0x3629ea(++_0x1d60de);}(_0xcc20,0x114));var _0x0cc2=function(_0x18d9cb,_0x4df904){_0x18d9cb=_0x18d9cb-0x0;var _0x5ba26d=_0xcc20[_0x18d9cb];return _0x5ba26d;};'use strict';var passport=require(_0x0cc2('0x0'));var LocalStrategy=require(_0x0cc2('0x1'))['Strategy'];var moment=require(_0x0cc2('0x2'));var ActiveDirectory=require(_0x0cc2('0x3'));var BPromise=require('bluebird');var util=require(_0x0cc2('0x4'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x0cc2('0x5'));var config=require(_0x0cc2('0x6'));var logger=require(_0x0cc2('0x7'))('api');function isActiveDirectoryConfigured(_0x390b91){var _0x169d72=![];if(typeof _0x390b91['activedirectory']!==_0x0cc2('0x8')){_0x169d72=_0x390b91[_0x0cc2('0x9')][_0x0cc2('0xa')]&&_0x390b91[_0x0cc2('0x9')][_0x0cc2('0xb')]&&_0x390b91[_0x0cc2('0x9')]['domain'];}return _0x169d72;}function adAuthenticate(_0x30a25c,_0x2d91c8,_0x4977eb){return new BPromise(function(_0x3d705c,_0x52fcf2){try{var _0x230fb1=new ActiveDirectory(_0x30a25c);_0x230fb1[_0x0cc2('0xc')](_0x2d91c8,_0x4977eb,function(_0x1ba5a8,_0x16575d){if(_0x1ba5a8){logger[_0x0cc2('0xd')](_0x0cc2('0xe'),_0x2d91c8,util[_0x0cc2('0xf')](_0x1ba5a8,{'showHidden':![],'depth':null}));_0x52fcf2(_0x0cc2('0x10'));}else if(!_0x16575d){logger[_0x0cc2('0xd')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x2d91c8);_0x52fcf2('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3d705c(_0x16575d);}});}catch(_0x50c282){_0x52fcf2(_0x50c282);}});}function ActiveDirectoryAuthenticate(_0x26a506,_0x39fb38,_0x3e2e5e,_0x5b0869){var _0x151644,_0x29b1fd;if(!isActiveDirectoryConfigured(config)){logger[_0x0cc2('0xd')](_0x0cc2('0x11'),_0x39fb38);return _0x5b0869(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0cc2('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x0cc2('0x13'),_0x0cc2('0x14')],'raw':!![]})[_0x0cc2('0x15')](function(_0x48522a){_0x151644=_0x48522a;if(!_0x151644['adSsoEnabled']){logger[_0x0cc2('0xd')](_0x0cc2('0x16'),_0x39fb38);throw new Error(_0x0cc2('0x10'));}return _0x26a506[_0x0cc2('0x17')]({'attributes':['id',_0x0cc2('0x18'),_0x0cc2('0x19'),_0x0cc2('0x1a'),_0x0cc2('0x1b'),_0x0cc2('0x1c'),_0x0cc2('0x1d'),_0x0cc2('0x1e'),_0x0cc2('0x1f')],'where':{'name':_0x39fb38,'role':{'$or':[_0x0cc2('0x20'),_0x0cc2('0x21'),_0x0cc2('0x22')]},'adSsoEnabled':!![]}});})['then'](function(_0x3aefc5){if(!_0x3aefc5||_0x3aefc5&&_0x3aefc5[_0x0cc2('0x18')]!==_0x39fb38){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x29b1fd=_0x3aefc5;var _0x398f8c=_0x29b1fd[_0x0cc2('0x18')]+'@'+config[_0x0cc2('0x9')]['domain'];return adAuthenticate(config['activedirectory'],_0x398f8c,_0x3e2e5e);})[_0x0cc2('0x15')](function(_0x4ef0ee){if(_0x29b1fd[_0x0cc2('0x1c')]){throw new Error(_0x0cc2('0x10'));}if(_0x151644['blockDuration']>0x0){if(_0x29b1fd[_0x0cc2('0x1d')]){if(moment(_0x29b1fd['blockedAt'])['add'](_0x151644[_0x0cc2('0x14')],_0x0cc2('0x23'))>moment()){throw new Error(_0x0cc2('0x10'));}return utils[_0x0cc2('0x24')](_0x29b1fd,0x0,![],null)[_0x0cc2('0x15')](function(){return utils[_0x0cc2('0x25')](_0x29b1fd);})[_0x0cc2('0x15')](function(){return _0x5b0869(null,_0x29b1fd);});}else{return utils['getLicense'](_0x29b1fd)[_0x0cc2('0x15')](function(){return _0x5b0869(null,_0x29b1fd);});}}else{return utils[_0x0cc2('0x25')](_0x29b1fd)['then'](function(){return _0x5b0869(null,_0x29b1fd);});}})[_0x0cc2('0x26')](function(_0x5414e5){return _0x5b0869(null,![],_0x5414e5);});}function handleError(_0x3996d4,_0x3c8adb,_0x2f7b92){return _0x3996d4[_0x0cc2('0x27')](_0x3c8adb||0x1f4)['send']({'message':_0x2f7b92?_0x2f7b92[_0x0cc2('0x28')]||_0x2f7b92:''});}exports[_0x0cc2('0x29')]=function(_0x499174,_0x57de66,_0x52dfbf){passport[_0x0cc2('0xc')](_0x0cc2('0x2a'),function(_0x204490,_0x47e8e3,_0x34c28c){var _0x4a4311=_0x204490||_0x34c28c;if(_0x4a4311){return handleError(_0x57de66,0x191,_0x4a4311);}if(!_0x47e8e3){return handleError(_0x57de66,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2ef2cd={'payload':{'id':_0x47e8e3['id'],'role':_0x47e8e3[_0x0cc2('0x1b')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2ef2cd)['then'](function(_0x27b49c){_0x57de66[_0x0cc2('0x2b')]({'id':_0x47e8e3['id'],'token':_0x27b49c,'statusCall':'','isAlreadyLogged':_0x47e8e3[_0x0cc2('0x1f')]});});}})(_0x499174,_0x57de66,_0x52dfbf);};passport['use'](_0x0cc2('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':_0x0cc2('0x19')},function(_0x17238e,_0x5c7efb,_0x26757c){return ActiveDirectoryAuthenticate(db['User'],_0x17238e,_0x5c7efb,_0x26757c);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 45e531c..b11b2f4 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 _0xb626=['./authActiveDirectory.controller','post','express','Router'];(function(_0x506477,_0x45b375){var _0x176218=function(_0x3d7d0c){while(--_0x3d7d0c){_0x506477['push'](_0x506477['shift']());}};_0x176218(++_0x45b375);}(_0xb626,0x17a));var _0x6b62=function(_0x43f1f4,_0x2207b6){_0x43f1f4=_0x43f1f4-0x0;var _0x3b5c46=_0xb626[_0x43f1f4];return _0x3b5c46;};'use strict';var express=require(_0x6b62('0x0'));var router=express[_0x6b62('0x1')]();var controller=require(_0x6b62('0x2'));router[_0x6b62('0x3')]('/',controller['login']);module['exports']=router;
\ No newline at end of file
+var _0x238b=['exports','express','Router','login'];(function(_0x1b4155,_0x2396c9){var _0x106480=function(_0x5769bc){while(--_0x5769bc){_0x1b4155['push'](_0x1b4155['shift']());}};_0x106480(++_0x2396c9);}(_0x238b,0xd1));var _0xb238=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x238b[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0xb238('0x0'));var router=express[_0xb238('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0xb238('0x2')]);module[_0xb238('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index edc30e6..cd037c4 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x114693,_0x21e8ba){var _0xc04995=function(_0x4fa7a9){while(--_0x4fa7a9){_0x114693['push'](_0x114693['shift']());}};_0xc04995(++_0x21e8ba);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x7a54,0x106));var _0x47a5=function(_0x11b9ff,_0x4ea87e){_0x11b9ff=_0x11b9ff-0x0;var _0x436e8d=_0x7a54[_0x11b9ff];return _0x436e8d;};'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 5a58816..986f749 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 _0xe25e=['get','/callback','isMiddleware','setTokenCookie','passport','Router','./authGoogle.controller','../../components/auth/service'];(function(_0x47dd48,_0x33c6e2){var _0x31e99e=function(_0xcde139){while(--_0xcde139){_0x47dd48['push'](_0x47dd48['shift']());}};_0x31e99e(++_0x33c6e2);}(_0xe25e,0x10c));var _0xee25=function(_0x5bd613,_0x151a02){_0x5bd613=_0x5bd613-0x0;var _0x62f674=_0xe25e[_0x5bd613];return _0x62f674;};'use strict';var express=require('express');var passport=require(_0xee25('0x0'));var router=express[_0xee25('0x1')]();var controller=require(_0xee25('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0xee25('0x3'));router[_0xee25('0x4')]('/',controller['login']);router['get'](_0xee25('0x5'),controller['callback'],authService[_0xee25('0x6')],userController['login'],authService[_0xee25('0x7')]);module['exports']=router;
\ No newline at end of file
+var _0xc42d=['callback','setTokenCookie','exports','express','passport','Router','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x36f56b,_0x4f7224){var _0x34fe0d=function(_0x3dcf3c){while(--_0x3dcf3c){_0x36f56b['push'](_0x36f56b['shift']());}};_0x34fe0d(++_0x4f7224);}(_0xc42d,0x1dc));var _0xdc42=function(_0x34ddd4,_0x143395){_0x34ddd4=_0x34ddd4-0x0;var _0x82e9a9=_0xc42d[_0x34ddd4];return _0x82e9a9;};'use strict';var express=require(_0xdc42('0x0'));var passport=require(_0xdc42('0x1'));var router=express[_0xdc42('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xdc42('0x3'));var authService=require(_0xdc42('0x4'));router[_0xdc42('0x5')]('/',controller[_0xdc42('0x6')]);router['get'](_0xdc42('0x7'),controller[_0xdc42('0x8')],authService['isMiddleware'],userController[_0xdc42('0x6')],authService[_0xdc42('0x9')]);module[_0xdc42('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 20a043d..6742e61 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 _0x7bd7=['You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','password','enforcePasswordHistory','validatePasswordHistory','previousPasswords','passwordHistoryLimit','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','disabled','blocked','loginAttempts','admin','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset'];(function(_0x5c7158,_0x40146f){var _0x526bc4=function(_0x58260f){while(--_0x58260f){_0x5c7158['push'](_0x5c7158['shift']());}};_0x526bc4(++_0x40146f);}(_0x7bd7,0x173));var _0x77bd=function(_0x54a166,_0x259c8f){_0x54a166=_0x54a166-0x0;var _0x2c4472=_0x7bd7[_0x54a166];return _0x2c4472;};'use strict';var util=require(_0x77bd('0x0'));var passport=require(_0x77bd('0x1'));var LocalStrategy=require(_0x77bd('0x2'))[_0x77bd('0x3')];var jayson=require(_0x77bd('0x4'));var _=require('lodash');var rs=require(_0x77bd('0x5'));var moment=require(_0x77bd('0x6'));var db=require(_0x77bd('0x7'))['db'];var authService=require(_0x77bd('0x8'));var utils=require('../../config/utils');var client=jayson[_0x77bd('0x9')][_0x77bd('0xa')]({'port':0x232b});function localAuthenticate(_0x4ab0ba,_0x7d389c,_0x22ce4c,_0x974de0){var _0x6cee37,_0x1407e3;return db[_0x77bd('0xb')][_0x77bd('0xc')]({'where':{'id':0x1},'attributes':[_0x77bd('0xd'),_0x77bd('0xe')],'raw':!![]})[_0x77bd('0xf')](function(_0x280d93){_0x6cee37=_0x280d93;return _0x4ab0ba[_0x77bd('0xc')]({'attributes':['id',_0x77bd('0x10'),'password',_0x77bd('0x11'),_0x77bd('0x12'),_0x77bd('0x13'),_0x77bd('0x14'),'blockedAt',_0x77bd('0x15')],'where':{'name':_0x7d389c,'role':{'$or':[_0x77bd('0x16'),_0x77bd('0x17'),_0x77bd('0x18')]}}});})['then'](function(_0x4edd38){if(!_0x4edd38||_0x4edd38&&_0x4edd38[_0x77bd('0x10')]!==_0x7d389c){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1407e3=_0x4edd38;return _0x1407e3;}})[_0x77bd('0xf')](function(){_0x1407e3[_0x77bd('0x19')](_0x22ce4c,function(_0x34082e,_0x113427){var _0x57c06d=_0x1407e3[_0x77bd('0x15')]+0x1;if(_0x34082e){return _0x974de0(_0x34082e);}else if(!_0x113427){if(_0x1407e3[_0x77bd('0x13')]){return _0x974de0(null,![],{'message':_0x77bd('0x1a')});}else if(_0x6cee37['allowedLoginAttempts']>0x0){if(_0x1407e3[_0x77bd('0x14')]){if(_0x6cee37[_0x77bd('0xe')]>0x0){if(moment(_0x1407e3['blockedAt'])[_0x77bd('0x1b')](_0x6cee37[_0x77bd('0xe')],_0x77bd('0x1c'))>moment()){return _0x974de0(null,![],{'message':_0x77bd('0x1a')});}else{return utils[_0x77bd('0x1d')](_0x1407e3,_0x57c06d,![],null)['then'](function(){return _0x974de0(null,![],{'message':_0x77bd('0x1a')});});}}else{return _0x974de0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x57c06d>=_0x6cee37[_0x77bd('0xd')]){return utils[_0x77bd('0x1d')](_0x1407e3,0x0,!![],moment())['then'](function(){return _0x974de0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x77bd('0x1d')](_0x1407e3,_0x57c06d,![],null)['then'](function(){return _0x974de0(null,![],{'message':_0x77bd('0x1a')});});}}}else{return _0x974de0(null,![],{'message':_0x77bd('0x1a')});}}else{if(_0x1407e3['disabled']){return _0x974de0(null,![],{'message':_0x77bd('0x1a')});}else if(_0x6cee37[_0x77bd('0xd')]>0x0){if(_0x1407e3[_0x77bd('0x14')]){if(_0x6cee37[_0x77bd('0xe')]>0x0){if(moment(_0x1407e3[_0x77bd('0x1e')])[_0x77bd('0x1b')](_0x6cee37[_0x77bd('0xe')],_0x77bd('0x1c'))>moment()){return _0x974de0(null,![],{'message':_0x77bd('0x1a')});}else{return utils[_0x77bd('0x1d')](_0x1407e3,0x0,![],null)[_0x77bd('0xf')](function(){return utils[_0x77bd('0x1f')](_0x1407e3);})[_0x77bd('0xf')](function(){return _0x974de0(null,_0x1407e3);});}}else{return _0x974de0(null,![],{'message':_0x77bd('0x1a')});}}else{return utils['clearBlockUser'](_0x1407e3,0x0,![],null)[_0x77bd('0xf')](function(){return utils['getLicense'](_0x1407e3);})[_0x77bd('0xf')](function(){return _0x974de0(null,_0x1407e3);})[_0x77bd('0x20')](function(_0x5c6800){return _0x974de0(null,![],_0x5c6800);});}}else{if(_0x1407e3[_0x77bd('0x14')]){return _0x974de0(null,![],{'message':_0x77bd('0x1a')});}else{return utils[_0x77bd('0x1f')](_0x1407e3)[_0x77bd('0xf')](function(){return _0x974de0(null,_0x1407e3);});}}}});})['catch'](function(_0x512a6b){return _0x974de0(null,![],_0x512a6b);});}function sendServiceMail(_0x49e460){return db[_0x77bd('0x21')][_0x77bd('0x22')]({'where':{'service':!![]},'attributes':['id',_0x77bd('0x10'),_0x77bd('0x23')],'include':[{'model':db[_0x77bd('0x24')],'as':_0x77bd('0x25'),'include':[{'model':db[_0x77bd('0x26')],'as':_0x77bd('0x26')}]}]})['then'](function(_0x4c8a11){if(!_0x4c8a11){throw new Error(_0x77bd('0x27'));}var _0x1e66c5=_0x4c8a11['getSmtpOptions']();var _0x34d5f2={'account':_0x1e66c5,'message':_['merge']({'from':util[_0x77bd('0x28')](_0x77bd('0x29'),_0x4c8a11[_0x77bd('0x10')],_0x4c8a11[_0x77bd('0x23')]||_0x4c8a11['Smtp'][_0x77bd('0x17')])},_0x49e460)};return client[_0x77bd('0x2a')](_0x77bd('0x2b'),_0x34d5f2);})['then'](function(_0x40a914){if(_0x40a914[_0x77bd('0x2c')]){throw new Error(util[_0x77bd('0x28')](_0x77bd('0x2d'),_0x40a914['error'][_0x77bd('0x2e')]||JSON['stringify'](_0x40a914[_0x77bd('0x2c')])));}return!![];});}function handleError(_0xaebef9,_0x215f5d,_0x59334a){return _0xaebef9[_0x77bd('0x2f')](_0x215f5d||0x1f4)[_0x77bd('0x30')]({'message':_0x59334a?_0x59334a[_0x77bd('0x2e')]||_0x59334a:''});}exports[_0x77bd('0x31')]=function(_0x85106d,_0x19d99f,_0x50a170){passport['authenticate'](_0x77bd('0x32'),function(_0xfd0764,_0x4e75ff,_0x4867c8){var _0x59dd78=_0xfd0764||_0x4867c8;if(_0x59dd78){return handleError(_0x19d99f,0x191,_0x59dd78);}if(!_0x4e75ff){return handleError(_0x19d99f,0x194,{'message':_0x77bd('0x33')});}else{var _0xe481b9={'payload':{'id':_0x4e75ff['id'],'role':_0x4e75ff[_0x77bd('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x77bd('0x34')](_0xe481b9)['then'](function(_0x2c40f0){_0x19d99f[_0x77bd('0x35')]({'id':_0x4e75ff['id'],'token':_0x2c40f0,'statusCall':'','isAlreadyLogged':_0x4e75ff[_0x77bd('0x36')]});});}})(_0x85106d,_0x19d99f,_0x50a170);};exports[_0x77bd('0x37')]=function(_0x969245,_0x5a7140){if(!_0x969245[_0x77bd('0x38')][_0x77bd('0x23')]){return handleError(_0x5a7140,0x1f4,{'message':_0x77bd('0x39')});}var _0x52c6bc=rs[_0x77bd('0x3a')]();_0x969245[_0x77bd('0x38')][_0x77bd('0x23')]=_0x969245[_0x77bd('0x38')]['email'][_0x77bd('0x3b')]()[_0x77bd('0x3c')]();var _0x3269de;return db[_0x77bd('0xb')][_0x77bd('0xc')]({'where':{'id':0x1},'attributes':[_0x77bd('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x503d37){_0x3269de=_0x503d37;return db[_0x77bd('0x3d')][_0x77bd('0x22')]({'where':{'email':_0x969245['body'][_0x77bd('0x23')]}});})[_0x77bd('0xf')](function(_0x320eee){if(!_0x320eee){throw new Error(_0x77bd('0x3e'));}if(_0x320eee[_0x77bd('0x13')]){throw new Error(_0x77bd('0x3f'));}if(_0x320eee[_0x77bd('0x14')]){if(moment(_0x320eee[_0x77bd('0x1e')])[_0x77bd('0x1b')](_0x3269de[_0x77bd('0xe')],_0x77bd('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x320eee[_0x77bd('0x14')]=![];_0x320eee[_0x77bd('0x1e')]=null;}}_0x320eee[_0x77bd('0x40')]=_0x52c6bc;_0x320eee[_0x77bd('0x41')]=Date[_0x77bd('0x42')]()+0x36ee80;return _0x320eee[_0x77bd('0x43')]();})[_0x77bd('0xf')](function(){return sendServiceMail({'to':_0x969245['body'][_0x77bd('0x23')],'subject':_0x77bd('0x44'),'text':_0x77bd('0x45')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x77bd('0x46')+_0x969245[_0x77bd('0x47')]['host']+_0x77bd('0x48')+_0x52c6bc+'\x0a\x0a'+_0x77bd('0x49')});})['then'](function(){_0x5a7140[_0x77bd('0x2f')](0xc8)[_0x77bd('0x30')]({'message':_0x77bd('0x4a')});})[_0x77bd('0x20')](function(_0x1518c4){return handleError(_0x5a7140,0x1f4,_0x1518c4);});};exports[_0x77bd('0x4b')]=function(_0x1131ac,_0x37a26f){return db[_0x77bd('0x3d')][_0x77bd('0x22')]({'where':{'resetPasswordToken':_0x1131ac[_0x77bd('0x4c')][_0x77bd('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x77bd('0x42')]()}}})[_0x77bd('0xf')](function(_0x349512){if(!_0x349512){throw new Error(_0x77bd('0x4e'));}return db['Setting'][_0x77bd('0xc')]({'attributes':['id',_0x77bd('0x4f'),'enforcePasswordHistory','passwordHistoryLimit']})['then'](function(_0x45ea47){if(_0x45ea47[_0x77bd('0x4f')])authService[_0x77bd('0x50')](_0x1131ac[_0x77bd('0x38')][_0x77bd('0x51')]);if(!_0x45ea47[_0x77bd('0x52')]||!_0x349512['previousPasswords'])return _0x349512;authService[_0x77bd('0x53')](_0x1131ac[_0x77bd('0x38')]['password'],_0x349512[_0x77bd('0x54')],_0x45ea47[_0x77bd('0x55')]);return _0x349512;})['then'](function(){_0x349512[_0x77bd('0x51')]=_0x1131ac['body']['password'];_0x349512['resetPasswordToken']=null;_0x349512[_0x77bd('0x41')]=null;return _0x349512[_0x77bd('0x43')]();});})[_0x77bd('0xf')](function(){_0x37a26f[_0x77bd('0x2f')](0xc8)['send']({'message':_0x77bd('0x56')});})['catch'](function(_0x109838){return handleError(_0x37a26f,0x1f4,_0x109838);});};passport[_0x77bd('0x57')](_0x77bd('0x32'),new LocalStrategy({'usernameField':_0x77bd('0x10'),'passwordField':'password'},function(_0x5e579a,_0x2ad754,_0x11fcce){return localAuthenticate(db['User'],_0x5e579a,_0x2ad754,_0x11fcce);}));
\ No newline at end of file
+var _0x2c33=['client','Setting','findOne','then','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','allowedLoginAttempts','blockDuration','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','body','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','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','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport-local','jayson/promise','lodash','randomstring','moment','../../config/utils'];(function(_0x2f3d29,_0x150e7b){var _0x53d69d=function(_0x45f6ec){while(--_0x45f6ec){_0x2f3d29['push'](_0x2f3d29['shift']());}};_0x53d69d(++_0x150e7b);}(_0x2c33,0xef));var _0x32c3=function(_0x4abed2,_0x567260){_0x4abed2=_0x4abed2-0x0;var _0x5c6928=_0x2c33[_0x4abed2];return _0x5c6928;};'use strict';var util=require(_0x32c3('0x0'));var passport=require('passport');var LocalStrategy=require(_0x32c3('0x1'))['Strategy'];var jayson=require(_0x32c3('0x2'));var _=require(_0x32c3('0x3'));var rs=require(_0x32c3('0x4'));var moment=require(_0x32c3('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x32c3('0x6'));var client=jayson[_0x32c3('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x1431a2,_0x3f6196,_0x146e60,_0x23d2e4){var _0x358fab,_0x2b3a40;return db[_0x32c3('0x8')][_0x32c3('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x32c3('0xa')](function(_0x43787c){_0x358fab=_0x43787c;return _0x1431a2[_0x32c3('0x9')]({'attributes':['id',_0x32c3('0xb'),_0x32c3('0xc'),_0x32c3('0xd'),_0x32c3('0xe'),'disabled',_0x32c3('0xf'),_0x32c3('0x10'),_0x32c3('0x11')],'where':{'name':_0x3f6196,'role':{'$or':[_0x32c3('0x12'),_0x32c3('0x13'),'agent']}}});})[_0x32c3('0xa')](function(_0x1e8109){if(!_0x1e8109||_0x1e8109&&_0x1e8109['name']!==_0x3f6196){throw new Error(_0x32c3('0x14'));}else{_0x2b3a40=_0x1e8109;return _0x2b3a40;}})[_0x32c3('0xa')](function(){_0x2b3a40[_0x32c3('0x15')](_0x146e60,function(_0x520656,_0x17fcd0){var _0x5f0a82=_0x2b3a40[_0x32c3('0x11')]+0x1;if(_0x520656){return _0x23d2e4(_0x520656);}else if(!_0x17fcd0){if(_0x2b3a40['disabled']){return _0x23d2e4(null,![],{'message':_0x32c3('0x14')});}else if(_0x358fab['allowedLoginAttempts']>0x0){if(_0x2b3a40[_0x32c3('0xf')]){if(_0x358fab['blockDuration']>0x0){if(moment(_0x2b3a40[_0x32c3('0x10')])['add'](_0x358fab['blockDuration'],_0x32c3('0x16'))>moment()){return _0x23d2e4(null,![],{'message':_0x32c3('0x14')});}else{return utils[_0x32c3('0x17')](_0x2b3a40,_0x5f0a82,![],null)[_0x32c3('0xa')](function(){return _0x23d2e4(null,![],{'message':_0x32c3('0x14')});});}}else{return _0x23d2e4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x5f0a82>=_0x358fab['allowedLoginAttempts']){return utils[_0x32c3('0x17')](_0x2b3a40,0x0,!![],moment())[_0x32c3('0xa')](function(){return _0x23d2e4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x32c3('0x17')](_0x2b3a40,_0x5f0a82,![],null)[_0x32c3('0xa')](function(){return _0x23d2e4(null,![],{'message':_0x32c3('0x14')});});}}}else{return _0x23d2e4(null,![],{'message':_0x32c3('0x14')});}}else{if(_0x2b3a40['disabled']){return _0x23d2e4(null,![],{'message':_0x32c3('0x14')});}else if(_0x358fab[_0x32c3('0x18')]>0x0){if(_0x2b3a40[_0x32c3('0xf')]){if(_0x358fab[_0x32c3('0x19')]>0x0){if(moment(_0x2b3a40[_0x32c3('0x10')])['add'](_0x358fab[_0x32c3('0x19')],_0x32c3('0x16'))>moment()){return _0x23d2e4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x2b3a40,0x0,![],null)['then'](function(){return utils[_0x32c3('0x1a')](_0x2b3a40);})[_0x32c3('0xa')](function(){return _0x23d2e4(null,_0x2b3a40);});}}else{return _0x23d2e4(null,![],{'message':_0x32c3('0x14')});}}else{return utils[_0x32c3('0x17')](_0x2b3a40,0x0,![],null)[_0x32c3('0xa')](function(){return utils[_0x32c3('0x1a')](_0x2b3a40);})[_0x32c3('0xa')](function(){return _0x23d2e4(null,_0x2b3a40);})['catch'](function(_0x33504b){return _0x23d2e4(null,![],_0x33504b);});}}else{if(_0x2b3a40[_0x32c3('0xf')]){return _0x23d2e4(null,![],{'message':_0x32c3('0x14')});}else{return utils[_0x32c3('0x1a')](_0x2b3a40)[_0x32c3('0xa')](function(){return _0x23d2e4(null,_0x2b3a40);});}}}});})[_0x32c3('0x1b')](function(_0x40d958){return _0x23d2e4(null,![],_0x40d958);});}function sendServiceMail(_0x4ff120){return db[_0x32c3('0x1c')][_0x32c3('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x32c3('0xb'),_0x32c3('0x1e')],'include':[{'model':db[_0x32c3('0x1f')],'as':_0x32c3('0x20'),'include':[{'model':db['CloudProvider'],'as':_0x32c3('0x21')}]}]})[_0x32c3('0xa')](function(_0x446931){if(!_0x446931){throw new Error(_0x32c3('0x22'));}var _0x1d824d=_0x446931['getSmtpOptions']();var _0xc3a024={'account':_0x1d824d,'message':_[_0x32c3('0x23')]({'from':util[_0x32c3('0x24')](_0x32c3('0x25'),_0x446931[_0x32c3('0xb')],_0x446931[_0x32c3('0x1e')]||_0x446931[_0x32c3('0x20')][_0x32c3('0x13')])},_0x4ff120)};return client[_0x32c3('0x26')](_0x32c3('0x27'),_0xc3a024);})[_0x32c3('0xa')](function(_0x44afd1){if(_0x44afd1['error']){throw new Error(util[_0x32c3('0x24')](_0x32c3('0x28'),_0x44afd1[_0x32c3('0x29')][_0x32c3('0x2a')]||JSON[_0x32c3('0x2b')](_0x44afd1[_0x32c3('0x29')])));}return!![];});}function handleError(_0x34e2a7,_0x1804c1,_0x3147f9){return _0x34e2a7['status'](_0x1804c1||0x1f4)[_0x32c3('0x2c')]({'message':_0x3147f9?_0x3147f9['message']||_0x3147f9:''});}exports[_0x32c3('0x2d')]=function(_0x34ba66,_0x2ed3f7,_0x58b256){passport[_0x32c3('0x15')]('local-login',function(_0x3ccc2d,_0x20b9b1,_0x234c89){var _0x1db448=_0x3ccc2d||_0x234c89;if(_0x1db448){return handleError(_0x2ed3f7,0x191,_0x1db448);}if(!_0x20b9b1){return handleError(_0x2ed3f7,0x194,{'message':_0x32c3('0x2e')});}else{var _0xd610b8={'payload':{'id':_0x20b9b1['id'],'role':_0x20b9b1[_0x32c3('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x32c3('0x2f')](_0xd610b8)[_0x32c3('0xa')](function(_0x4a2cfc){_0x2ed3f7[_0x32c3('0x30')]({'id':_0x20b9b1['id'],'token':_0x4a2cfc,'statusCall':'','isAlreadyLogged':_0x20b9b1[_0x32c3('0x31')]});});}})(_0x34ba66,_0x2ed3f7,_0x58b256);};exports[_0x32c3('0x32')]=function(_0x44a0c7,_0x198f7c){if(!_0x44a0c7['body']['email']){return handleError(_0x198f7c,0x1f4,{'message':_0x32c3('0x33')});}var _0x3ebd26=rs['generate']();_0x44a0c7['body'][_0x32c3('0x1e')]=_0x44a0c7['body'][_0x32c3('0x1e')][_0x32c3('0x34')]()[_0x32c3('0x35')]();var _0x3622e7;return db['Setting'][_0x32c3('0x9')]({'where':{'id':0x1},'attributes':[_0x32c3('0x18'),_0x32c3('0x19')],'raw':!![]})[_0x32c3('0xa')](function(_0x1f5cfa){_0x3622e7=_0x1f5cfa;return db[_0x32c3('0x36')][_0x32c3('0x1d')]({'where':{'email':_0x44a0c7[_0x32c3('0x37')][_0x32c3('0x1e')]}});})[_0x32c3('0xa')](function(_0x5bca50){if(!_0x5bca50){throw new Error(_0x32c3('0x38'));}if(_0x5bca50['disabled']){throw new Error(_0x32c3('0x39'));}if(_0x5bca50[_0x32c3('0xf')]){if(moment(_0x5bca50['blockedAt'])['add'](_0x3622e7['blockDuration'],_0x32c3('0x16'))>moment()){throw new Error(_0x32c3('0x3a'));}else{_0x5bca50[_0x32c3('0xf')]=![];_0x5bca50[_0x32c3('0x10')]=null;}}_0x5bca50[_0x32c3('0x3b')]=_0x3ebd26;_0x5bca50['resetPasswordExpires']=Date[_0x32c3('0x3c')]()+0x36ee80;return _0x5bca50['save']();})['then'](function(){return sendServiceMail({'to':_0x44a0c7[_0x32c3('0x37')][_0x32c3('0x1e')],'subject':_0x32c3('0x3d'),'text':_0x32c3('0x3e')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x32c3('0x3f')+_0x44a0c7[_0x32c3('0x40')][_0x32c3('0x41')]+_0x32c3('0x42')+_0x3ebd26+'\x0a\x0a'+_0x32c3('0x43')});})['then'](function(){_0x198f7c[_0x32c3('0x44')](0xc8)['send']({'message':_0x32c3('0x45')});})[_0x32c3('0x1b')](function(_0x16d758){return handleError(_0x198f7c,0x1f4,_0x16d758);});};exports[_0x32c3('0x46')]=function(_0x463f68,_0x121101){return db['User'][_0x32c3('0x1d')]({'where':{'resetPasswordToken':_0x463f68[_0x32c3('0x47')][_0x32c3('0x48')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x32c3('0xa')](function(_0x4d240b){if(!_0x4d240b){throw new Error(_0x32c3('0x49'));}return db[_0x32c3('0x8')][_0x32c3('0x9')]({'attributes':['id',_0x32c3('0x4a'),_0x32c3('0x4b'),_0x32c3('0x4c')]})['then'](function(_0x813920){if(_0x813920[_0x32c3('0x4a')])authService['validatePasswordPattern'](_0x463f68[_0x32c3('0x37')]['password']);if(!_0x813920[_0x32c3('0x4b')]||!_0x4d240b[_0x32c3('0x4d')])return _0x4d240b;authService[_0x32c3('0x4e')](_0x463f68[_0x32c3('0x37')][_0x32c3('0xc')],_0x4d240b[_0x32c3('0x4d')],_0x813920[_0x32c3('0x4c')]);return _0x4d240b;})['then'](function(){_0x4d240b['password']=_0x463f68['body']['password'];_0x4d240b['resetPasswordToken']=null;_0x4d240b[_0x32c3('0x4f')]=null;return _0x4d240b['save']();});})[_0x32c3('0xa')](function(){_0x121101[_0x32c3('0x44')](0xc8)['send']({'message':_0x32c3('0x50')});})[_0x32c3('0x1b')](function(_0x368d10){return handleError(_0x121101,0x1f4,_0x368d10);});};passport[_0x32c3('0x51')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0xa0988b,_0x170754,_0x1d1476){return localAuthenticate(db[_0x32c3('0x36')],_0xa0988b,_0x170754,_0x1d1476);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index f3a36fe..d929fa6 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 _0xa830=['/forgot','forgot','/reset/:token','exports','express','Router','./authLocal.controller','post','login'];(function(_0x235210,_0x2f2967){var _0x48f600=function(_0x192c4a){while(--_0x192c4a){_0x235210['push'](_0x235210['shift']());}};_0x48f600(++_0x2f2967);}(_0xa830,0x151));var _0x0a83=function(_0x185ce6,_0x80b049){_0x185ce6=_0x185ce6-0x0;var _0xb2b554=_0xa830[_0x185ce6];return _0xb2b554;};'use strict';var express=require(_0x0a83('0x0'));var router=express[_0x0a83('0x1')]();var controller=require(_0x0a83('0x2'));router[_0x0a83('0x3')]('/',controller[_0x0a83('0x4')]);router[_0x0a83('0x3')](_0x0a83('0x5'),controller[_0x0a83('0x6')]);router[_0x0a83('0x3')](_0x0a83('0x7'),controller['reset']);module[_0x0a83('0x8')]=router;
\ No newline at end of file
+var _0xab5a=['reset','Router','post','login','/forgot'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xab5a,0x1cd));var _0xaab5=function(_0xc67aef,_0x36a9ba){_0xc67aef=_0xc67aef-0x0;var _0x23a974=_0xab5a[_0xc67aef];return _0x23a974;};'use strict';var express=require('express');var router=express[_0xaab5('0x0')]();var controller=require('./authLocal.controller');router[_0xaab5('0x1')]('/',controller[_0xaab5('0x2')]);router[_0xaab5('0x1')](_0xaab5('0x3'),controller['forgot']);router[_0xaab5('0x1')]('/reset/:token',controller[_0xaab5('0x4')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 33b4b17..e58e9a7 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 _0x1423=['STRING','BOOLEAN','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1423,0x1d6));var _0x3142=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1423[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0x3142('0x0')]={'name':{'type':Sequelize[_0x3142('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3142('0x1')]},'status':{'type':Sequelize[_0x3142('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x1a00=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x52d358,_0x51d6fd){var _0x386ffb=function(_0x3ea9ab){while(--_0x3ea9ab){_0x52d358['push'](_0x52d358['shift']());}};_0x386ffb(++_0x51d6fd);}(_0x1a00,0x96));var _0x01a0=function(_0x3ce3cd,_0x508147){_0x3ce3cd=_0x3ce3cd-0x0;var _0x12d8d8=_0x1a00[_0x3ce3cd];return _0x12d8d8;};'use strict';var Sequelize=require(_0x01a0('0x0'));module[_0x01a0('0x1')]={'name':{'type':Sequelize[_0x01a0('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x01a0('0x2')]},'status':{'type':Sequelize[_0x01a0('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x01a0('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 02e8dee..61a1cbb 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 _0x8ad1=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','include','findAll','rows','catch','show','keys','includeAll','options','create','body','find','params','addConditions','Condition','ids','omit','getConditions','findOne','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','map','Automation','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length'];(function(_0x39e134,_0xd37a5d){var _0x3239a7=function(_0x597cc7){while(--_0x597cc7){_0x39e134['push'](_0x39e134['shift']());}};_0x3239a7(++_0xd37a5d);}(_0x8ad1,0x1d5));var _0x18ad=function(_0x583200,_0x42c9d1){_0x583200=_0x583200-0x0;var _0x31f4bb=_0x8ad1[_0x583200];return _0x31f4bb;};'use strict';var emlformat=require(_0x18ad('0x0'));var rimraf=require(_0x18ad('0x1'));var zipdir=require(_0x18ad('0x2'));var jsonpatch=require(_0x18ad('0x3'));var rp=require(_0x18ad('0x4'));var moment=require(_0x18ad('0x5'));var BPromise=require(_0x18ad('0x6'));var Mustache=require(_0x18ad('0x7'));var util=require(_0x18ad('0x8'));var path=require('path');var sox=require(_0x18ad('0x9'));var csv=require(_0x18ad('0xa'));var ejs=require(_0x18ad('0xb'));var fs=require('fs');var fs_extra=require(_0x18ad('0xc'));var _=require(_0x18ad('0xd'));var squel=require(_0x18ad('0xe'));var crypto=require(_0x18ad('0xf'));var jsforce=require(_0x18ad('0x10'));var deskjs=require(_0x18ad('0x11'));var toCsv=require(_0x18ad('0xa'));var querystring=require('querystring');var Papa=require(_0x18ad('0x12'));var Redis=require(_0x18ad('0x13'));var authService=require(_0x18ad('0x14'));var qs=require(_0x18ad('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x18ad('0x16'));var logger=require(_0x18ad('0x17'))(_0x18ad('0x18'));var utils=require('../../config/utils');var config=require(_0x18ad('0x19'));var licenseUtil=require(_0x18ad('0x1a'));var db=require(_0x18ad('0x1b'))['db'];function respondWithStatusCode(_0x3db3de,_0x2d66c0){_0x2d66c0=_0x2d66c0||0xcc;return function(_0x266694){if(_0x266694){return _0x3db3de[_0x18ad('0x1c')](_0x2d66c0);}return _0x3db3de[_0x18ad('0x1d')](_0x2d66c0)['end']();};}function respondWithResult(_0x25bbc0,_0x32b023){_0x32b023=_0x32b023||0xc8;return function(_0x48cb4b){if(_0x48cb4b){return _0x25bbc0['status'](_0x32b023)[_0x18ad('0x1e')](_0x48cb4b);}};}function respondWithFilteredResult(_0x3da2d2,_0xe09514){return function(_0x4fcb31){if(_0x4fcb31){var _0xb6864=typeof _0xe09514[_0x18ad('0x1f')]==='undefined'&&typeof _0xe09514['limit']===_0x18ad('0x20');var _0x18710e=_0x4fcb31[_0x18ad('0x21')];var _0x3817e4=_0xb6864?0x0:_0xe09514[_0x18ad('0x1f')];var _0x1fe116=_0xb6864?_0x4fcb31['count']:_0xe09514[_0x18ad('0x1f')]+_0xe09514[_0x18ad('0x22')];var _0x30a2f5;if(_0x1fe116>=_0x18710e){_0x1fe116=_0x18710e;_0x30a2f5=0xc8;}else{_0x30a2f5=0xce;}_0x3da2d2[_0x18ad('0x1d')](_0x30a2f5);return _0x3da2d2[_0x18ad('0x23')](_0x18ad('0x24'),_0x3817e4+'-'+_0x1fe116+'/'+_0x18710e)[_0x18ad('0x1e')](_0x4fcb31);}return null;};}function patchUpdates(_0x264cbf){return function(_0x1feeb8){try{jsonpatch[_0x18ad('0x25')](_0x1feeb8,_0x264cbf,!![]);}catch(_0x5e70dd){return BPromise[_0x18ad('0x26')](_0x5e70dd);}return _0x1feeb8[_0x18ad('0x27')]();};}function saveUpdates(_0x485147,_0x28dd1f){return function(_0x21f0a5){if(_0x21f0a5){return _0x21f0a5[_0x18ad('0x28')](_0x485147)[_0x18ad('0x29')](function(_0x32aba8){return _0x32aba8;});}return null;};}function removeEntity(_0x565b93,_0xefe1fe){return function(_0x37229d){if(_0x37229d){return _0x37229d[_0x18ad('0x2a')]()[_0x18ad('0x29')](function(){_0x565b93[_0x18ad('0x1d')](0xcc)[_0x18ad('0x2b')]();});}};}function handleEntityNotFound(_0x5e78bb,_0x52ff4d){return function(_0x150fd2){if(!_0x150fd2){_0x5e78bb['sendStatus'](0x194);}return _0x150fd2;};}function handleError(_0x56125f,_0x430f45){_0x430f45=_0x430f45||0x1f4;return function(_0xcf7125){logger[_0x18ad('0x2c')](_0xcf7125['stack']);if(_0xcf7125[_0x18ad('0x2d')]){delete _0xcf7125[_0x18ad('0x2d')];}_0x56125f[_0x18ad('0x1d')](_0x430f45)[_0x18ad('0x2e')](_0xcf7125);};}exports['index']=function(_0xc759af,_0x3e2357){var _0xf70b31={},_0x6be5d7={},_0x567fff={'count':0x0,'rows':[]};var _0xdcd7e1=_[_0x18ad('0x2f')](db[_0x18ad('0x30')][_0x18ad('0x31')],function(_0x52f8b2){return{'name':_0x52f8b2[_0x18ad('0x32')],'type':_0x52f8b2['type'][_0x18ad('0x33')]};});_0x6be5d7[_0x18ad('0x34')]=_[_0x18ad('0x2f')](_0xdcd7e1,_0x18ad('0x2d'));_0x6be5d7[_0x18ad('0x35')]=_['keys'](_0xc759af[_0x18ad('0x35')]);_0x6be5d7[_0x18ad('0x36')]=_['intersection'](_0x6be5d7[_0x18ad('0x34')],_0x6be5d7[_0x18ad('0x35')]);_0xf70b31['attributes']=_[_0x18ad('0x37')](_0x6be5d7['model'],qs[_0x18ad('0x38')](_0xc759af[_0x18ad('0x35')][_0x18ad('0x38')]));_0xf70b31[_0x18ad('0x39')]=_0xf70b31[_0x18ad('0x39')][_0x18ad('0x3a')]?_0xf70b31[_0x18ad('0x39')]:_0x6be5d7[_0x18ad('0x34')];if(!_0xc759af[_0x18ad('0x35')][_0x18ad('0x3b')](_0x18ad('0x3c'))){_0xf70b31[_0x18ad('0x22')]=qs[_0x18ad('0x22')](_0xc759af[_0x18ad('0x35')]['limit']);_0xf70b31[_0x18ad('0x1f')]=qs[_0x18ad('0x1f')](_0xc759af[_0x18ad('0x35')][_0x18ad('0x1f')]);}_0xf70b31[_0x18ad('0x3d')]=qs['sort'](_0xc759af[_0x18ad('0x35')][_0x18ad('0x3e')]);_0xf70b31[_0x18ad('0x3f')]=qs[_0x18ad('0x36')](_[_0x18ad('0x40')](_0xc759af['query'],_0x6be5d7[_0x18ad('0x36')]),_0xdcd7e1);if(_0xc759af[_0x18ad('0x35')][_0x18ad('0x41')]){_0xf70b31[_0x18ad('0x3f')]=_[_0x18ad('0x42')](_0xf70b31[_0x18ad('0x3f')],{'$or':_[_0x18ad('0x2f')](_0xdcd7e1,function(_0x31c722){if(_0x31c722[_0x18ad('0x43')]!=='VIRTUAL'){var _0x5066da={};_0x5066da[_0x31c722[_0x18ad('0x2d')]]={'$like':'%'+_0xc759af[_0x18ad('0x35')][_0x18ad('0x41')]+'%'};return _0x5066da;}})});}_0xf70b31=_[_0x18ad('0x42')]({},_0xf70b31,_0xc759af['options']);var _0x34fcba={'where':_0xf70b31[_0x18ad('0x3f')]};return db['Automation'][_0x18ad('0x21')](_0x34fcba)[_0x18ad('0x29')](function(_0x14c58f){_0x567fff[_0x18ad('0x21')]=_0x14c58f;if(_0xc759af[_0x18ad('0x35')]['includeAll']){_0xf70b31[_0x18ad('0x44')]=[{'all':!![]}];}return db['Automation'][_0x18ad('0x45')](_0xf70b31);})[_0x18ad('0x29')](function(_0x31d866){_0x567fff[_0x18ad('0x46')]=_0x31d866;return _0x567fff;})[_0x18ad('0x29')](respondWithFilteredResult(_0x3e2357,_0xf70b31))[_0x18ad('0x47')](handleError(_0x3e2357,null));};exports[_0x18ad('0x48')]=function(_0x595c00,_0x51e327){var _0x37abc8={'raw':![],'where':{'id':_0x595c00['params']['id']}},_0x38f93c={};_0x38f93c['model']=_['keys'](db['Automation']['rawAttributes']);_0x38f93c[_0x18ad('0x35')]=_[_0x18ad('0x49')](_0x595c00['query']);_0x38f93c[_0x18ad('0x36')]=_['intersection'](_0x38f93c[_0x18ad('0x34')],_0x38f93c[_0x18ad('0x35')]);_0x37abc8[_0x18ad('0x39')]=_[_0x18ad('0x37')](_0x38f93c[_0x18ad('0x34')],qs[_0x18ad('0x38')](_0x595c00[_0x18ad('0x35')][_0x18ad('0x38')]));_0x37abc8[_0x18ad('0x39')]=_0x37abc8[_0x18ad('0x39')][_0x18ad('0x3a')]?_0x37abc8[_0x18ad('0x39')]:_0x38f93c[_0x18ad('0x34')];if(_0x595c00['query'][_0x18ad('0x4a')]){_0x37abc8[_0x18ad('0x44')]=[{'all':!![]}];}_0x37abc8=_['merge']({},_0x37abc8,_0x595c00[_0x18ad('0x4b')]);return db[_0x18ad('0x30')]['find'](_0x37abc8)[_0x18ad('0x29')](handleEntityNotFound(_0x51e327,null))['then'](respondWithResult(_0x51e327,null))[_0x18ad('0x47')](handleError(_0x51e327,null));};exports[_0x18ad('0x4c')]=function(_0x10f87c,_0x419812){return db['Automation'][_0x18ad('0x4c')](_0x10f87c[_0x18ad('0x4d')],{})[_0x18ad('0x29')](respondWithResult(_0x419812,0xc9))[_0x18ad('0x47')](handleError(_0x419812,null));};exports[_0x18ad('0x28')]=function(_0x261c90,_0xe7d085){if(_0x261c90[_0x18ad('0x4d')]['id']){delete _0x261c90[_0x18ad('0x4d')]['id'];}return db[_0x18ad('0x30')][_0x18ad('0x4e')]({'where':{'id':_0x261c90[_0x18ad('0x4f')]['id']}})[_0x18ad('0x29')](handleEntityNotFound(_0xe7d085,null))['then'](saveUpdates(_0x261c90[_0x18ad('0x4d')],null))[_0x18ad('0x29')](respondWithResult(_0xe7d085,null))[_0x18ad('0x47')](handleError(_0xe7d085,null));};exports[_0x18ad('0x2a')]=function(_0x379570,_0xa070d6){return db[_0x18ad('0x30')]['find']({'where':{'id':_0x379570[_0x18ad('0x4f')]['id']}})[_0x18ad('0x29')](handleEntityNotFound(_0xa070d6,null))['then'](removeEntity(_0xa070d6,null))[_0x18ad('0x47')](handleError(_0xa070d6,null));};exports[_0x18ad('0x50')]=function(_0x2332e8,_0x410f36,_0x164c8d){return db[_0x18ad('0x51')][_0x18ad('0x4e')]({'where':{'id':_0x2332e8[_0x18ad('0x4f')]['id']}})[_0x18ad('0x29')](handleEntityNotFound(_0x410f36,null))['then'](function(_0x397c5a){if(_0x397c5a){return _0x397c5a[_0x18ad('0x50')](_0x2332e8[_0x18ad('0x4d')][_0x18ad('0x52')],_[_0x18ad('0x53')](_0x2332e8[_0x18ad('0x4d')],[_0x18ad('0x52'),'id'])||{});}})[_0x18ad('0x29')](respondWithResult(_0x410f36,null))['catch'](handleError(_0x410f36,null));};exports[_0x18ad('0x54')]=function(_0x183e58,_0x3f1341,_0x3d53f6){var _0x1ac49c={};var _0x19590a={};var _0x3044fb;var _0x41eb56;return db[_0x18ad('0x30')][_0x18ad('0x55')]({'where':{'id':_0x183e58[_0x18ad('0x4f')]['id']}})[_0x18ad('0x29')](handleEntityNotFound(_0x3f1341,null))[_0x18ad('0x29')](function(_0x2c691a){if(_0x2c691a){_0x3044fb=_0x2c691a;_0x19590a['model']=_[_0x18ad('0x49')](db['Condition'][_0x18ad('0x31')]);_0x19590a[_0x18ad('0x35')]=_['keys'](_0x183e58[_0x18ad('0x35')]);_0x19590a['filters']=_[_0x18ad('0x37')](_0x19590a[_0x18ad('0x34')],_0x19590a['query']);_0x1ac49c[_0x18ad('0x39')]=_[_0x18ad('0x37')](_0x19590a[_0x18ad('0x34')],qs[_0x18ad('0x38')](_0x183e58['query'][_0x18ad('0x38')]));_0x1ac49c[_0x18ad('0x39')]=_0x1ac49c[_0x18ad('0x39')][_0x18ad('0x3a')]?_0x1ac49c[_0x18ad('0x39')]:_0x19590a[_0x18ad('0x34')];_0x1ac49c['order']=qs[_0x18ad('0x3e')](_0x183e58[_0x18ad('0x35')]['sort']);_0x1ac49c[_0x18ad('0x3f')]=qs[_0x18ad('0x36')](_['pick'](_0x183e58[_0x18ad('0x35')],_0x19590a[_0x18ad('0x36')]));if(_0x183e58['query'][_0x18ad('0x41')]){_0x1ac49c['where']=_[_0x18ad('0x42')](_0x1ac49c[_0x18ad('0x3f')],{'$or':_[_0x18ad('0x2f')](_0x1ac49c[_0x18ad('0x39')],function(_0x211117){var _0x2c4b5d={};_0x2c4b5d[_0x211117]={'$like':'%'+_0x183e58[_0x18ad('0x35')][_0x18ad('0x41')]+'%'};return _0x2c4b5d;})});}_0x1ac49c=_[_0x18ad('0x42')]({},_0x1ac49c,_0x183e58[_0x18ad('0x4b')]);return _0x3044fb[_0x18ad('0x54')](_0x1ac49c);}})['then'](function(_0x5e2411){if(_0x5e2411){_0x41eb56=_0x5e2411[_0x18ad('0x3a')];if(!_0x183e58[_0x18ad('0x35')][_0x18ad('0x3b')](_0x18ad('0x3c'))){_0x1ac49c[_0x18ad('0x22')]=qs[_0x18ad('0x22')](_0x183e58[_0x18ad('0x35')][_0x18ad('0x22')]);_0x1ac49c[_0x18ad('0x1f')]=qs[_0x18ad('0x1f')](_0x183e58[_0x18ad('0x35')][_0x18ad('0x1f')]);}return _0x3044fb[_0x18ad('0x54')](_0x1ac49c);}})[_0x18ad('0x29')](function(_0x59482e){if(_0x59482e){return _0x59482e?{'count':_0x41eb56,'rows':_0x59482e}:null;}})[_0x18ad('0x29')](respondWithResult(_0x3f1341,null))[_0x18ad('0x47')](handleError(_0x3f1341,null));};exports['addActions']=function(_0x13a7f8,_0x1ca3eb,_0x53576c){return db[_0x18ad('0x56')][_0x18ad('0x4e')]({'where':{'id':_0x13a7f8['params']['id']}})[_0x18ad('0x29')](handleEntityNotFound(_0x1ca3eb,null))[_0x18ad('0x29')](function(_0xd8f4d8){if(_0xd8f4d8){return _0xd8f4d8['addActions'](_0x13a7f8[_0x18ad('0x4d')][_0x18ad('0x52')],_[_0x18ad('0x53')](_0x13a7f8[_0x18ad('0x4d')],[_0x18ad('0x52'),'id'])||{});}})[_0x18ad('0x29')](respondWithResult(_0x1ca3eb,null))[_0x18ad('0x47')](handleError(_0x1ca3eb,null));};exports[_0x18ad('0x57')]=function(_0x21b354,_0x152731,_0x357efe){var _0x5e4194={};var _0x10bc5a={};var _0x31d49c;var _0x667bdf;return db[_0x18ad('0x30')][_0x18ad('0x55')]({'where':{'id':_0x21b354['params']['id']}})[_0x18ad('0x29')](handleEntityNotFound(_0x152731,null))[_0x18ad('0x29')](function(_0x126206){if(_0x126206){_0x31d49c=_0x126206;_0x10bc5a[_0x18ad('0x34')]=_[_0x18ad('0x49')](db['Action']['rawAttributes']);_0x10bc5a[_0x18ad('0x35')]=_[_0x18ad('0x49')](_0x21b354[_0x18ad('0x35')]);_0x10bc5a[_0x18ad('0x36')]=_['intersection'](_0x10bc5a[_0x18ad('0x34')],_0x10bc5a[_0x18ad('0x35')]);_0x5e4194[_0x18ad('0x39')]=_['intersection'](_0x10bc5a['model'],qs[_0x18ad('0x38')](_0x21b354[_0x18ad('0x35')][_0x18ad('0x38')]));_0x5e4194['attributes']=_0x5e4194[_0x18ad('0x39')][_0x18ad('0x3a')]?_0x5e4194[_0x18ad('0x39')]:_0x10bc5a[_0x18ad('0x34')];_0x5e4194[_0x18ad('0x3d')]=qs[_0x18ad('0x3e')](_0x21b354[_0x18ad('0x35')][_0x18ad('0x3e')]);_0x5e4194[_0x18ad('0x3f')]=qs[_0x18ad('0x36')](_[_0x18ad('0x40')](_0x21b354['query'],_0x10bc5a[_0x18ad('0x36')]));if(_0x21b354[_0x18ad('0x35')][_0x18ad('0x41')]){_0x5e4194[_0x18ad('0x3f')]=_[_0x18ad('0x42')](_0x5e4194['where'],{'$or':_[_0x18ad('0x2f')](_0x5e4194[_0x18ad('0x39')],function(_0x3c5b48){var _0x30bd6c={};_0x30bd6c[_0x3c5b48]={'$like':'%'+_0x21b354['query'][_0x18ad('0x41')]+'%'};return _0x30bd6c;})});}_0x5e4194=_[_0x18ad('0x42')]({},_0x5e4194,_0x21b354[_0x18ad('0x4b')]);return _0x31d49c[_0x18ad('0x57')](_0x5e4194);}})['then'](function(_0x58581f){if(_0x58581f){_0x667bdf=_0x58581f[_0x18ad('0x3a')];if(!_0x21b354[_0x18ad('0x35')][_0x18ad('0x3b')](_0x18ad('0x3c'))){_0x5e4194[_0x18ad('0x22')]=qs[_0x18ad('0x22')](_0x21b354['query'][_0x18ad('0x22')]);_0x5e4194[_0x18ad('0x1f')]=qs[_0x18ad('0x1f')](_0x21b354[_0x18ad('0x35')][_0x18ad('0x1f')]);}return _0x31d49c['getActions'](_0x5e4194);}})[_0x18ad('0x29')](function(_0x7b00d0){if(_0x7b00d0){return _0x7b00d0?{'count':_0x667bdf,'rows':_0x7b00d0}:null;}})['then'](respondWithResult(_0x152731,null))[_0x18ad('0x47')](handleError(_0x152731,null));};
\ No newline at end of file
+var _0x708f=['pick','filters','filter','merge','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','update','body','addConditions','Condition','ids','getConditions','findOne','keys','sort','nolimit','limit','Action','addActions','omit','getActions','hasOwnProperty','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','Content-Range','json','reject','save','then','destroy','error','stack','send','index','Automation','rawAttributes','fieldName','type','key','model','map','name','query','intersection','attributes','fields','order','where'];(function(_0x31a9ae,_0x2a1716){var _0x23a1d0=function(_0x740fab){while(--_0x740fab){_0x31a9ae['push'](_0x31a9ae['shift']());}};_0x23a1d0(++_0x2a1716);}(_0x708f,0xc7));var _0xf708=function(_0x1a613b,_0x381801){_0x1a613b=_0x1a613b-0x0;var _0x5b80f0=_0x708f[_0x1a613b];return _0x5b80f0;};'use strict';var emlformat=require(_0xf708('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf708('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf708('0x2'));var moment=require(_0xf708('0x3'));var BPromise=require(_0xf708('0x4'));var Mustache=require(_0xf708('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf708('0x6'));var csv=require(_0xf708('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf708('0x8'));var _=require(_0xf708('0x9'));var squel=require(_0xf708('0xa'));var crypto=require(_0xf708('0xb'));var jsforce=require(_0xf708('0xc'));var deskjs=require(_0xf708('0xd'));var toCsv=require(_0xf708('0x7'));var querystring=require('querystring');var Papa=require(_0xf708('0xe'));var Redis=require(_0xf708('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf708('0x10'));var hardwareService=require(_0xf708('0x11'));var logger=require(_0xf708('0x12'))(_0xf708('0x13'));var utils=require(_0xf708('0x14'));var config=require(_0xf708('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf708('0x16'))['db'];function respondWithStatusCode(_0x3b959d,_0x316e93){_0x316e93=_0x316e93||0xcc;return function(_0x151c32){if(_0x151c32){return _0x3b959d[_0xf708('0x17')](_0x316e93);}return _0x3b959d[_0xf708('0x18')](_0x316e93)[_0xf708('0x19')]();};}function respondWithResult(_0xe9c51d,_0x37e132){_0x37e132=_0x37e132||0xc8;return function(_0x1caf7b){if(_0x1caf7b){return _0xe9c51d[_0xf708('0x18')](_0x37e132)['json'](_0x1caf7b);}};}function respondWithFilteredResult(_0x469d14,_0x3dda9e){return function(_0x107b6b){if(_0x107b6b){var _0x3aea42=typeof _0x3dda9e['offset']===_0xf708('0x1a')&&typeof _0x3dda9e['limit']===_0xf708('0x1a');var _0x238b35=_0x107b6b[_0xf708('0x1b')];var _0x6ac8c8=_0x3aea42?0x0:_0x3dda9e[_0xf708('0x1c')];var _0x5cedb6=_0x3aea42?_0x107b6b['count']:_0x3dda9e[_0xf708('0x1c')]+_0x3dda9e['limit'];var _0x3ee2e5;if(_0x5cedb6>=_0x238b35){_0x5cedb6=_0x238b35;_0x3ee2e5=0xc8;}else{_0x3ee2e5=0xce;}_0x469d14[_0xf708('0x18')](_0x3ee2e5);return _0x469d14['set'](_0xf708('0x1d'),_0x6ac8c8+'-'+_0x5cedb6+'/'+_0x238b35)[_0xf708('0x1e')](_0x107b6b);}return null;};}function patchUpdates(_0x6b31b1){return function(_0x3e59af){try{jsonpatch['apply'](_0x3e59af,_0x6b31b1,!![]);}catch(_0x187315){return BPromise[_0xf708('0x1f')](_0x187315);}return _0x3e59af[_0xf708('0x20')]();};}function saveUpdates(_0x23873c,_0x336c57){return function(_0x551e66){if(_0x551e66){return _0x551e66['update'](_0x23873c)[_0xf708('0x21')](function(_0x1cd749){return _0x1cd749;});}return null;};}function removeEntity(_0xec5a1d,_0x576c99){return function(_0x13718e){if(_0x13718e){return _0x13718e[_0xf708('0x22')]()['then'](function(){_0xec5a1d[_0xf708('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41596f,_0x512782){return function(_0x288118){if(!_0x288118){_0x41596f[_0xf708('0x17')](0x194);}return _0x288118;};}function handleError(_0x273fbd,_0x49fa30){_0x49fa30=_0x49fa30||0x1f4;return function(_0xa71dc4){logger[_0xf708('0x23')](_0xa71dc4[_0xf708('0x24')]);if(_0xa71dc4['name']){delete _0xa71dc4['name'];}_0x273fbd[_0xf708('0x18')](_0x49fa30)[_0xf708('0x25')](_0xa71dc4);};}exports[_0xf708('0x26')]=function(_0x1e2e22,_0x56859c){var _0x440e79={},_0x5c5141={},_0xf655e={'count':0x0,'rows':[]};var _0x195eac=_['map'](db[_0xf708('0x27')][_0xf708('0x28')],function(_0x52da8b){return{'name':_0x52da8b[_0xf708('0x29')],'type':_0x52da8b[_0xf708('0x2a')][_0xf708('0x2b')]};});_0x5c5141[_0xf708('0x2c')]=_[_0xf708('0x2d')](_0x195eac,_0xf708('0x2e'));_0x5c5141[_0xf708('0x2f')]=_['keys'](_0x1e2e22['query']);_0x5c5141['filters']=_[_0xf708('0x30')](_0x5c5141[_0xf708('0x2c')],_0x5c5141[_0xf708('0x2f')]);_0x440e79[_0xf708('0x31')]=_[_0xf708('0x30')](_0x5c5141[_0xf708('0x2c')],qs[_0xf708('0x32')](_0x1e2e22['query'][_0xf708('0x32')]));_0x440e79[_0xf708('0x31')]=_0x440e79['attributes']['length']?_0x440e79[_0xf708('0x31')]:_0x5c5141[_0xf708('0x2c')];if(!_0x1e2e22[_0xf708('0x2f')]['hasOwnProperty']('nolimit')){_0x440e79['limit']=qs['limit'](_0x1e2e22[_0xf708('0x2f')]['limit']);_0x440e79[_0xf708('0x1c')]=qs[_0xf708('0x1c')](_0x1e2e22[_0xf708('0x2f')][_0xf708('0x1c')]);}_0x440e79[_0xf708('0x33')]=qs['sort'](_0x1e2e22[_0xf708('0x2f')]['sort']);_0x440e79[_0xf708('0x34')]=qs['filters'](_[_0xf708('0x35')](_0x1e2e22['query'],_0x5c5141[_0xf708('0x36')]),_0x195eac);if(_0x1e2e22[_0xf708('0x2f')][_0xf708('0x37')]){_0x440e79[_0xf708('0x34')]=_[_0xf708('0x38')](_0x440e79[_0xf708('0x34')],{'$or':_[_0xf708('0x2d')](_0x195eac,function(_0xb1ed3d){if(_0xb1ed3d[_0xf708('0x2a')]!=='VIRTUAL'){var _0x4445fd={};_0x4445fd[_0xb1ed3d[_0xf708('0x2e')]]={'$like':'%'+_0x1e2e22['query'][_0xf708('0x37')]+'%'};return _0x4445fd;}})});}_0x440e79=_[_0xf708('0x38')]({},_0x440e79,_0x1e2e22['options']);var _0x29e0a4={'where':_0x440e79[_0xf708('0x34')]};return db[_0xf708('0x27')][_0xf708('0x1b')](_0x29e0a4)[_0xf708('0x21')](function(_0x155d4d){_0xf655e[_0xf708('0x1b')]=_0x155d4d;if(_0x1e2e22[_0xf708('0x2f')]['includeAll']){_0x440e79[_0xf708('0x39')]=[{'all':!![]}];}return db[_0xf708('0x27')][_0xf708('0x3a')](_0x440e79);})[_0xf708('0x21')](function(_0x1382c3){_0xf655e[_0xf708('0x3b')]=_0x1382c3;return _0xf655e;})[_0xf708('0x21')](respondWithFilteredResult(_0x56859c,_0x440e79))[_0xf708('0x3c')](handleError(_0x56859c,null));};exports[_0xf708('0x3d')]=function(_0x1b90de,_0x4dfb54){var _0x15ebcf={'raw':![],'where':{'id':_0x1b90de[_0xf708('0x3e')]['id']}},_0x286535={};_0x286535[_0xf708('0x2c')]=_['keys'](db[_0xf708('0x27')][_0xf708('0x28')]);_0x286535[_0xf708('0x2f')]=_['keys'](_0x1b90de['query']);_0x286535[_0xf708('0x36')]=_['intersection'](_0x286535[_0xf708('0x2c')],_0x286535['query']);_0x15ebcf[_0xf708('0x31')]=_[_0xf708('0x30')](_0x286535[_0xf708('0x2c')],qs[_0xf708('0x32')](_0x1b90de[_0xf708('0x2f')][_0xf708('0x32')]));_0x15ebcf[_0xf708('0x31')]=_0x15ebcf[_0xf708('0x31')][_0xf708('0x3f')]?_0x15ebcf[_0xf708('0x31')]:_0x286535[_0xf708('0x2c')];if(_0x1b90de[_0xf708('0x2f')][_0xf708('0x40')]){_0x15ebcf[_0xf708('0x39')]=[{'all':!![]}];}_0x15ebcf=_[_0xf708('0x38')]({},_0x15ebcf,_0x1b90de[_0xf708('0x41')]);return db[_0xf708('0x27')][_0xf708('0x42')](_0x15ebcf)[_0xf708('0x21')](handleEntityNotFound(_0x4dfb54,null))['then'](respondWithResult(_0x4dfb54,null))['catch'](handleError(_0x4dfb54,null));};exports['create']=function(_0x193ff8,_0xc5a809){return db[_0xf708('0x27')][_0xf708('0x43')](_0x193ff8['body'],{})[_0xf708('0x21')](respondWithResult(_0xc5a809,0xc9))[_0xf708('0x3c')](handleError(_0xc5a809,null));};exports[_0xf708('0x44')]=function(_0xcd6ee8,_0x3c07c5){if(_0xcd6ee8[_0xf708('0x45')]['id']){delete _0xcd6ee8[_0xf708('0x45')]['id'];}return db[_0xf708('0x27')][_0xf708('0x42')]({'where':{'id':_0xcd6ee8[_0xf708('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3c07c5,null))[_0xf708('0x21')](saveUpdates(_0xcd6ee8['body'],null))[_0xf708('0x21')](respondWithResult(_0x3c07c5,null))[_0xf708('0x3c')](handleError(_0x3c07c5,null));};exports[_0xf708('0x22')]=function(_0xc01004,_0x3553d8){return db[_0xf708('0x27')][_0xf708('0x42')]({'where':{'id':_0xc01004[_0xf708('0x3e')]['id']}})[_0xf708('0x21')](handleEntityNotFound(_0x3553d8,null))[_0xf708('0x21')](removeEntity(_0x3553d8,null))[_0xf708('0x3c')](handleError(_0x3553d8,null));};exports[_0xf708('0x46')]=function(_0x5355b3,_0x437313,_0x5cda7e){return db[_0xf708('0x47')][_0xf708('0x42')]({'where':{'id':_0x5355b3[_0xf708('0x3e')]['id']}})[_0xf708('0x21')](handleEntityNotFound(_0x437313,null))[_0xf708('0x21')](function(_0x2dca06){if(_0x2dca06){return _0x2dca06[_0xf708('0x46')](_0x5355b3[_0xf708('0x45')][_0xf708('0x48')],_['omit'](_0x5355b3['body'],[_0xf708('0x48'),'id'])||{});}})[_0xf708('0x21')](respondWithResult(_0x437313,null))[_0xf708('0x3c')](handleError(_0x437313,null));};exports[_0xf708('0x49')]=function(_0x45ffed,_0xddc8fd,_0x970ed9){var _0x322cd9={};var _0x564d67={};var _0x3ec77d;var _0x1c71f9;return db[_0xf708('0x27')][_0xf708('0x4a')]({'where':{'id':_0x45ffed[_0xf708('0x3e')]['id']}})[_0xf708('0x21')](handleEntityNotFound(_0xddc8fd,null))[_0xf708('0x21')](function(_0x26838d){if(_0x26838d){_0x3ec77d=_0x26838d;_0x564d67[_0xf708('0x2c')]=_[_0xf708('0x4b')](db[_0xf708('0x47')][_0xf708('0x28')]);_0x564d67[_0xf708('0x2f')]=_[_0xf708('0x4b')](_0x45ffed[_0xf708('0x2f')]);_0x564d67[_0xf708('0x36')]=_[_0xf708('0x30')](_0x564d67[_0xf708('0x2c')],_0x564d67[_0xf708('0x2f')]);_0x322cd9[_0xf708('0x31')]=_[_0xf708('0x30')](_0x564d67['model'],qs[_0xf708('0x32')](_0x45ffed[_0xf708('0x2f')][_0xf708('0x32')]));_0x322cd9[_0xf708('0x31')]=_0x322cd9[_0xf708('0x31')]['length']?_0x322cd9[_0xf708('0x31')]:_0x564d67[_0xf708('0x2c')];_0x322cd9['order']=qs[_0xf708('0x4c')](_0x45ffed[_0xf708('0x2f')][_0xf708('0x4c')]);_0x322cd9['where']=qs[_0xf708('0x36')](_[_0xf708('0x35')](_0x45ffed[_0xf708('0x2f')],_0x564d67[_0xf708('0x36')]));if(_0x45ffed[_0xf708('0x2f')][_0xf708('0x37')]){_0x322cd9[_0xf708('0x34')]=_[_0xf708('0x38')](_0x322cd9[_0xf708('0x34')],{'$or':_[_0xf708('0x2d')](_0x322cd9[_0xf708('0x31')],function(_0x2d6a40){var _0x2cb8e0={};_0x2cb8e0[_0x2d6a40]={'$like':'%'+_0x45ffed[_0xf708('0x2f')][_0xf708('0x37')]+'%'};return _0x2cb8e0;})});}_0x322cd9=_[_0xf708('0x38')]({},_0x322cd9,_0x45ffed[_0xf708('0x41')]);return _0x3ec77d['getConditions'](_0x322cd9);}})[_0xf708('0x21')](function(_0x4a0899){if(_0x4a0899){_0x1c71f9=_0x4a0899[_0xf708('0x3f')];if(!_0x45ffed[_0xf708('0x2f')]['hasOwnProperty'](_0xf708('0x4d'))){_0x322cd9[_0xf708('0x4e')]=qs['limit'](_0x45ffed[_0xf708('0x2f')][_0xf708('0x4e')]);_0x322cd9[_0xf708('0x1c')]=qs['offset'](_0x45ffed[_0xf708('0x2f')][_0xf708('0x1c')]);}return _0x3ec77d['getConditions'](_0x322cd9);}})[_0xf708('0x21')](function(_0x3b811e){if(_0x3b811e){return _0x3b811e?{'count':_0x1c71f9,'rows':_0x3b811e}:null;}})['then'](respondWithResult(_0xddc8fd,null))[_0xf708('0x3c')](handleError(_0xddc8fd,null));};exports['addActions']=function(_0xadd558,_0x121e83,_0x301e18){return db[_0xf708('0x4f')][_0xf708('0x42')]({'where':{'id':_0xadd558[_0xf708('0x3e')]['id']}})[_0xf708('0x21')](handleEntityNotFound(_0x121e83,null))[_0xf708('0x21')](function(_0x32020b){if(_0x32020b){return _0x32020b[_0xf708('0x50')](_0xadd558[_0xf708('0x45')][_0xf708('0x48')],_[_0xf708('0x51')](_0xadd558[_0xf708('0x45')],[_0xf708('0x48'),'id'])||{});}})['then'](respondWithResult(_0x121e83,null))[_0xf708('0x3c')](handleError(_0x121e83,null));};exports['getActions']=function(_0x4b3d5b,_0x302dbb,_0x3b92be){var _0x5c63d9={};var _0x3bb9ac={};var _0x1aebfc;var _0x170d92;return db[_0xf708('0x27')][_0xf708('0x4a')]({'where':{'id':_0x4b3d5b[_0xf708('0x3e')]['id']}})[_0xf708('0x21')](handleEntityNotFound(_0x302dbb,null))[_0xf708('0x21')](function(_0x222e7e){if(_0x222e7e){_0x1aebfc=_0x222e7e;_0x3bb9ac[_0xf708('0x2c')]=_[_0xf708('0x4b')](db[_0xf708('0x4f')][_0xf708('0x28')]);_0x3bb9ac[_0xf708('0x2f')]=_['keys'](_0x4b3d5b[_0xf708('0x2f')]);_0x3bb9ac['filters']=_['intersection'](_0x3bb9ac[_0xf708('0x2c')],_0x3bb9ac[_0xf708('0x2f')]);_0x5c63d9[_0xf708('0x31')]=_[_0xf708('0x30')](_0x3bb9ac[_0xf708('0x2c')],qs['fields'](_0x4b3d5b[_0xf708('0x2f')]['fields']));_0x5c63d9[_0xf708('0x31')]=_0x5c63d9[_0xf708('0x31')][_0xf708('0x3f')]?_0x5c63d9['attributes']:_0x3bb9ac[_0xf708('0x2c')];_0x5c63d9[_0xf708('0x33')]=qs[_0xf708('0x4c')](_0x4b3d5b[_0xf708('0x2f')][_0xf708('0x4c')]);_0x5c63d9[_0xf708('0x34')]=qs['filters'](_[_0xf708('0x35')](_0x4b3d5b[_0xf708('0x2f')],_0x3bb9ac[_0xf708('0x36')]));if(_0x4b3d5b['query'][_0xf708('0x37')]){_0x5c63d9[_0xf708('0x34')]=_[_0xf708('0x38')](_0x5c63d9[_0xf708('0x34')],{'$or':_[_0xf708('0x2d')](_0x5c63d9['attributes'],function(_0x525874){var _0xafc2aa={};_0xafc2aa[_0x525874]={'$like':'%'+_0x4b3d5b[_0xf708('0x2f')]['filter']+'%'};return _0xafc2aa;})});}_0x5c63d9=_[_0xf708('0x38')]({},_0x5c63d9,_0x4b3d5b['options']);return _0x1aebfc[_0xf708('0x52')](_0x5c63d9);}})[_0xf708('0x21')](function(_0x41ef79){if(_0x41ef79){_0x170d92=_0x41ef79['length'];if(!_0x4b3d5b['query'][_0xf708('0x53')]('nolimit')){_0x5c63d9['limit']=qs[_0xf708('0x4e')](_0x4b3d5b[_0xf708('0x2f')][_0xf708('0x4e')]);_0x5c63d9[_0xf708('0x1c')]=qs[_0xf708('0x1c')](_0x4b3d5b['query'][_0xf708('0x1c')]);}return _0x1aebfc[_0xf708('0x52')](_0x5c63d9);}})[_0xf708('0x21')](function(_0x4f62f5){if(_0x4f62f5){return _0x4f62f5?{'count':_0x170d92,'rows':_0x4f62f5}:null;}})[_0xf708('0x21')](respondWithResult(_0x302dbb,null))[_0xf708('0x3c')](handleError(_0x302dbb,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 0a4c7f7..3fbc196 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 _0x08a5=['tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./automation.attributes','exports','define','Automation'];(function(_0x21a2b3,_0x5d6564){var _0x4651a7=function(_0x285f59){while(--_0x285f59){_0x21a2b3['push'](_0x21a2b3['shift']());}};_0x4651a7(++_0x5d6564);}(_0x08a5,0x1d5));var _0x508a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08a5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x508a('0x0'));var util=require(_0x508a('0x1'));var logger=require(_0x508a('0x2'))(_0x508a('0x3'));var moment=require(_0x508a('0x4'));var BPromise=require(_0x508a('0x5'));var rp=require(_0x508a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x508a('0x7'));var config=require('../../config/environment');var attributes=require(_0x508a('0x8'));module[_0x508a('0x9')]=function(_0x30bfea,_0x5c87b8){return _0x30bfea[_0x508a('0xa')](_0x508a('0xb'),attributes,{'tableName':_0x508a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa80f=['define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes'];(function(_0x30b2c6,_0x1eafe8){var _0x42052d=function(_0xfeb539){while(--_0xfeb539){_0x30b2c6['push'](_0x30b2c6['shift']());}};_0x42052d(++_0x1eafe8);}(_0xa80f,0x17c));var _0xfa80=function(_0x5a57c6,_0x394b7d){_0x5a57c6=_0x5a57c6-0x0;var _0x509601=_0xa80f[_0x5a57c6];return _0x509601;};'use strict';var _=require(_0xfa80('0x0'));var util=require(_0xfa80('0x1'));var logger=require(_0xfa80('0x2'))(_0xfa80('0x3'));var moment=require(_0xfa80('0x4'));var BPromise=require(_0xfa80('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa80('0x6'));var rimraf=require(_0xfa80('0x7'));var config=require(_0xfa80('0x8'));var attributes=require(_0xfa80('0x9'));module['exports']=function(_0xe5a2a0,_0x1c5bd7){return _0xe5a2a0[_0xfa80('0xa')](_0xfa80('0xb'),attributes,{'tableName':_0xfa80('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 0e5814a..e742f0e 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 _0x87d9=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x314f8b,_0x28224e){var _0x6c3532=function(_0x4a6132){while(--_0x4a6132){_0x314f8b['push'](_0x314f8b['shift']());}};_0x6c3532(++_0x28224e);}(_0x87d9,0x143));var _0x987d=function(_0x4633ee,_0xc061fe){_0x4633ee=_0x4633ee-0x0;var _0x5c5ac0=_0x87d9[_0x4633ee];return _0x5c5ac0;};'use strict';var _=require(_0x987d('0x0'));var util=require('util');var moment=require(_0x987d('0x1'));var BPromise=require(_0x987d('0x2'));var rs=require(_0x987d('0x3'));var fs=require('fs');var Redis=require(_0x987d('0x4'));var db=require(_0x987d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x987d('0x6'))('rpc');var config=require(_0x987d('0x7'));var jayson=require(_0x987d('0x8'));var client=jayson['client'][_0x987d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ee510,_0x5bf349,_0x11d89e){return new BPromise(function(_0x1f97b6,_0x444273){return client[_0x987d('0xa')](_0x3ee510,_0x11d89e)[_0x987d('0xb')](function(_0x325c8b){logger[_0x987d('0xc')]('Automation,\x20%s,\x20%s',_0x5bf349,_0x987d('0xd'));logger[_0x987d('0xe')](_0x987d('0xf'),_0x5bf349,_0x987d('0xd'),JSON['stringify'](_0x325c8b));if(_0x325c8b[_0x987d('0x10')]){if(_0x325c8b[_0x987d('0x10')][_0x987d('0x11')]===0x1f4){logger[_0x987d('0x10')](_0x987d('0x12'),_0x5bf349,_0x325c8b[_0x987d('0x10')][_0x987d('0x13')]);return _0x444273(_0x325c8b[_0x987d('0x10')][_0x987d('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0x5bf349,_0x325c8b[_0x987d('0x10')][_0x987d('0x13')]);return _0x1f97b6(_0x325c8b[_0x987d('0x10')][_0x987d('0x13')]);}else{logger[_0x987d('0xc')](_0x987d('0x12'),_0x5bf349,_0x987d('0xd'));_0x1f97b6(_0x325c8b[_0x987d('0x14')][_0x987d('0x13')]);}})[_0x987d('0x15')](function(_0x197e46){logger[_0x987d('0x10')](_0x987d('0x12'),_0x5bf349,_0x197e46);_0x444273(_0x197e46);});});}
\ No newline at end of file
+var _0x0b0e=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug'];(function(_0x2e249d,_0x41b7e7){var _0x1faa37=function(_0x1422b4){while(--_0x1422b4){_0x2e249d['push'](_0x2e249d['shift']());}};_0x1faa37(++_0x41b7e7);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3c5ad6,_0x47b7bf){_0x3c5ad6=_0x3c5ad6-0x0;var _0x3154f2=_0x0b0e[_0x3c5ad6];return _0x3154f2;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('Automation,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 1205be1..3ed5275 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 _0x9de3=['../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0xa9eaa0,_0x4ba2b4){var _0x30897a=function(_0x2caa01){while(--_0x2caa01){_0xa9eaa0['push'](_0xa9eaa0['shift']());}};_0x30897a(++_0x4ba2b4);}(_0x9de3,0xea));var _0x39de=function(_0x100521,_0x351566){_0x100521=_0x100521-0x0;var _0x4c8267=_0x9de3[_0x100521];return _0x4c8267;};'use strict';var multer=require(_0x39de('0x0'));var util=require('util');var path=require(_0x39de('0x1'));var timeout=require(_0x39de('0x2'));var express=require(_0x39de('0x3'));var router=express['Router']();var fs_extra=require(_0x39de('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x39de('0x5'));var config=require(_0x39de('0x6'));var controller=require(_0x39de('0x7'));router[_0x39de('0x8')]('/',auth['isAuthenticated'](),controller[_0x39de('0x9')]);router[_0x39de('0x8')](_0x39de('0xa'),auth[_0x39de('0xb')](),controller[_0x39de('0xc')]);router['get']('/:id/conditions',auth['isAuthenticated'](),controller[_0x39de('0xd')]);router[_0x39de('0x8')](_0x39de('0xe'),auth[_0x39de('0xb')](),controller[_0x39de('0xf')]);router[_0x39de('0x10')]('/',auth[_0x39de('0xb')](),controller[_0x39de('0x11')]);router['post'](_0x39de('0x12'),auth['isAuthenticated'](),controller['addConditions']);router[_0x39de('0x10')](_0x39de('0xe'),auth[_0x39de('0xb')](),controller['addActions']);router[_0x39de('0x13')](_0x39de('0xa'),auth[_0x39de('0xb')](),controller[_0x39de('0x14')]);router[_0x39de('0x15')](_0x39de('0xa'),auth[_0x39de('0xb')](),controller[_0x39de('0x16')]);module[_0x39de('0x17')]=router;
\ No newline at end of file
+var _0xd0a2=['/:id','/:id/conditions','/:id/actions','getActions','post','create','addConditions','put','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index'];(function(_0x105e11,_0x128087){var _0x3cc2e5=function(_0x3aec6d){while(--_0x3aec6d){_0x105e11['push'](_0x105e11['shift']());}};_0x3cc2e5(++_0x128087);}(_0xd0a2,0x128));var _0x2d0a=function(_0xfadc1a,_0xc6a189){_0xfadc1a=_0xfadc1a-0x0;var _0x1be3a4=_0xd0a2[_0xfadc1a];return _0x1be3a4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2d0a('0x0'));var timeout=require(_0x2d0a('0x1'));var express=require(_0x2d0a('0x2'));var router=express[_0x2d0a('0x3')]();var fs_extra=require(_0x2d0a('0x4'));var auth=require(_0x2d0a('0x5'));var interaction=require(_0x2d0a('0x6'));var config=require(_0x2d0a('0x7'));var controller=require(_0x2d0a('0x8'));router[_0x2d0a('0x9')]('/',auth[_0x2d0a('0xa')](),controller[_0x2d0a('0xb')]);router[_0x2d0a('0x9')](_0x2d0a('0xc'),auth[_0x2d0a('0xa')](),controller['show']);router[_0x2d0a('0x9')](_0x2d0a('0xd'),auth[_0x2d0a('0xa')](),controller['getConditions']);router[_0x2d0a('0x9')](_0x2d0a('0xe'),auth[_0x2d0a('0xa')](),controller[_0x2d0a('0xf')]);router[_0x2d0a('0x10')]('/',auth[_0x2d0a('0xa')](),controller[_0x2d0a('0x11')]);router[_0x2d0a('0x10')]('/:id/conditions',auth[_0x2d0a('0xa')](),controller[_0x2d0a('0x12')]);router[_0x2d0a('0x10')](_0x2d0a('0xe'),auth[_0x2d0a('0xa')](),controller['addActions']);router[_0x2d0a('0x13')](_0x2d0a('0xc'),auth[_0x2d0a('0xa')](),controller['update']);router[_0x2d0a('0x14')](_0x2d0a('0xc'),auth[_0x2d0a('0xa')](),controller['destroy']);module[_0x2d0a('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 8e11561..eebafd1 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 _0x2813=['BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#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)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','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)','exports','STRING','name','ivr'];(function(_0x4233e2,_0x1ae078){var _0x5bad86=function(_0xffc34e){while(--_0xffc34e){_0x4233e2['push'](_0x4233e2['shift']());}};_0x5bad86(++_0x1ae078);}(_0x2813,0x6e));var _0x3281=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2813[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x3281('0x0')]={'name':{'type':Sequelize[_0x3281('0x1')],'unique':_0x3281('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x3281('0x3')),'allowNull':![],'defaultValue':_0x3281('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x3281('0x4')],'defaultValue':0x0,'comment':_0x3281('0x5')},'limitCalls':{'type':Sequelize[_0x3281('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x3281('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3281('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3281('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3281('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3281('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3281('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3281('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x3281('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3281('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3281('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3281('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x3281('0xe')](_0x3281('0xf'),_0x3281('0x10'),_0x3281('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3281('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x3281('0x6')](0x9)[_0x3281('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3281('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x3281('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3281('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3281('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3281('0x6')](0x9)[_0x3281('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3281('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x3281('0x6')](0x9)[_0x3281('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3281('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3281('0x6')](0x9)[_0x3281('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3281('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3281('0x6')](0x9)[_0x3281('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3281('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3281('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3281('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3281('0x6')](0x9)[_0x3281('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3281('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3281('0xe')](_0x3281('0x1b'),_0x3281('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x3281('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3281('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x3281('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3281('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3281('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3281('0x6')](0x5)[_0x3281('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x3281('0x6')](0x5)[_0x3281('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3281('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3281('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3281('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3281('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3281('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3281('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3281('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3281('0x25')}};
\ No newline at end of file
+var _0x4e63=['exports','ENUM','STRING','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#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)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4e63,0x1ad));var _0x34e6=function(_0x200770,_0x4391ed){_0x200770=_0x200770-0x0;var _0x303db6=_0x4e63[_0x200770];return _0x303db6;};'use strict';var Sequelize=require('sequelize');module[_0x34e6('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x34e6('0x1')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x34e6('0x2')]},'active':{'type':Sequelize[_0x34e6('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x34e6('0x4')](0x4)[_0x34e6('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x34e6('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x34e6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x34e6('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x34e6('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x34e6('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x34e6('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x34e6('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x34e6('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x34e6('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x34e6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x34e6('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x34e6('0x4')](0x5)[_0x34e6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x34e6('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x34e6('0x4')](0x3)[_0x34e6('0x5')],'defaultValue':0x3,'comment':_0x34e6('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x34e6('0x4')](0x5)[_0x34e6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x34e6('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x34e6('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x34e6('0xe')},'dialTimezone':{'type':Sequelize[_0x34e6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x34e6('0x2')],'defaultValue':_0x34e6('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x34e6('0x1')](_0x34e6('0x10'),_0x34e6('0x11'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x34e6('0x3')],'defaultValue':0x0,'comment':_0x34e6('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x34e6('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x34e6('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x34e6('0x4')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x34e6('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x34e6('0x4')](0x9)[_0x34e6('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x34e6('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x34e6('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x34e6('0x4')](0x9)[_0x34e6('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x34e6('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x34e6('0x4')](0x9)[_0x34e6('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x34e6('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x34e6('0x4')](0x5)[_0x34e6('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x34e6('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x34e6('0x4')](0x9)[_0x34e6('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x34e6('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x34e6('0x1')](_0x34e6('0x1a'),_0x34e6('0x1b')),'defaultValue':_0x34e6('0x1a')},'dialPrefix':{'type':Sequelize[_0x34e6('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x34e6('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x34e6('0x1c')},'dialCutDigit':{'type':Sequelize[_0x34e6('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x34e6('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x34e6('0x4')](0x3)[_0x34e6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x34e6('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x34e6('0x4')](0x5)[_0x34e6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x34e6('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x34e6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x34e6('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x34e6('0x4')](0x5)[_0x34e6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x34e6('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x34e6('0x4')](0x3)[_0x34e6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x34e6('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x34e6('0x4')](0x5)[_0x34e6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x34e6('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x34e6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x34e6('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x34e6('0x4')](0x5)[_0x34e6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x34e6('0x4')](0x3)[_0x34e6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x34e6('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x34e6('0x26')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 5e26efc..fcddeb3 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 _0x30d6=['sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','count','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','map','query','keys','intersection','attributes','model','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','catch','params','fields','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','role','findOne','CampaignId','CmHopper','findAll','rows','getHopperHistories','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','omit','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','fromQuery','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache'];(function(_0x2d1357,_0x40febc){var _0x44f553=function(_0x5257bb){while(--_0x5257bb){_0x2d1357['push'](_0x2d1357['shift']());}};_0x44f553(++_0x40febc);}(_0x30d6,0x1b0));var _0x630d=function(_0x23f58d,_0x22b11c){_0x23f58d=_0x23f58d-0x0;var _0x515d10=_0x30d6[_0x23f58d];return _0x515d10;};'use strict';var emlformat=require(_0x630d('0x0'));var rimraf=require(_0x630d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x630d('0x2'));var rp=require('request-promise');var moment=require(_0x630d('0x3'));var BPromise=require(_0x630d('0x4'));var Mustache=require(_0x630d('0x5'));var util=require('util');var path=require('path');var sox=require(_0x630d('0x6'));var csv=require(_0x630d('0x7'));var ejs=require(_0x630d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x630d('0x9'));var squel=require(_0x630d('0xa'));var crypto=require(_0x630d('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x630d('0x7'));var querystring=require(_0x630d('0xc'));var Papa=require(_0x630d('0xd'));var Redis=require(_0x630d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x630d('0xf'));var as=require(_0x630d('0x10'));var hardwareService=require(_0x630d('0x11'));var logger=require(_0x630d('0x12'))(_0x630d('0x13'));var utils=require(_0x630d('0x14'));var config=require(_0x630d('0x15'));var licenseUtil=require(_0x630d('0x16'));var db=require(_0x630d('0x17'))['db'];function respondWithStatusCode(_0x3c86ef,_0x4e67c4){_0x4e67c4=_0x4e67c4||0xcc;return function(_0x1f458a){if(_0x1f458a){return _0x3c86ef['sendStatus'](_0x4e67c4);}return _0x3c86ef[_0x630d('0x18')](_0x4e67c4)[_0x630d('0x19')]();};}function respondWithResult(_0x51808f,_0x23e4e4){_0x23e4e4=_0x23e4e4||0xc8;return function(_0x1cc36b){if(_0x1cc36b){return _0x51808f[_0x630d('0x18')](_0x23e4e4)[_0x630d('0x1a')](_0x1cc36b);}};}function respondWithFilteredResult(_0x1c3f36,_0x82d90){return function(_0x162263){if(_0x162263){var _0x156687=typeof _0x82d90['offset']===_0x630d('0x1b')&&typeof _0x82d90['limit']===_0x630d('0x1b');var _0x48d0af=_0x162263['count'];var _0x227d62=_0x156687?0x0:_0x82d90[_0x630d('0x1c')];var _0x57066b=_0x156687?_0x162263[_0x630d('0x1d')]:_0x82d90[_0x630d('0x1c')]+_0x82d90['limit'];var _0x3443b1;if(_0x57066b>=_0x48d0af){_0x57066b=_0x48d0af;_0x3443b1=0xc8;}else{_0x3443b1=0xce;}_0x1c3f36['status'](_0x3443b1);return _0x1c3f36['set'](_0x630d('0x1e'),_0x227d62+'-'+_0x57066b+'/'+_0x48d0af)['json'](_0x162263);}return null;};}function patchUpdates(_0x2d960f){return function(_0xa7c90e){try{jsonpatch['apply'](_0xa7c90e,_0x2d960f,!![]);}catch(_0x9d16e6){return BPromise[_0x630d('0x1f')](_0x9d16e6);}return _0xa7c90e[_0x630d('0x20')]();};}function saveUpdates(_0x52d152,_0x4f5334){return function(_0x4c27b2){if(_0x4c27b2){return _0x4c27b2[_0x630d('0x21')](_0x52d152)[_0x630d('0x22')](function(_0x324f51){return _0x324f51;});}return null;};}function removeEntity(_0x56743e,_0x1e178e){return function(_0x1bae23){if(_0x1bae23){return _0x1bae23[_0x630d('0x23')]()[_0x630d('0x22')](function(){var _0x5ae2a1=_0x1bae23[_0x630d('0x24')]({'plain':!![]});var _0x10fb6e=_0x630d('0x25');return db[_0x630d('0x26')][_0x630d('0x23')]({'where':{'type':_0x10fb6e,'resourceId':_0x5ae2a1['id']}})[_0x630d('0x22')](function(){return _0x1bae23;});})[_0x630d('0x22')](function(){_0x56743e['status'](0xcc)[_0x630d('0x19')]();});}};}function handleEntityNotFound(_0x5c5d36,_0xd198d5){return function(_0x5346da){if(!_0x5346da){_0x5c5d36['sendStatus'](0x194);}return _0x5346da;};}function handleError(_0x368a88,_0x274a40){_0x274a40=_0x274a40||0x1f4;return function(_0x3d62dd){logger['error'](_0x3d62dd[_0x630d('0x27')]);if(_0x3d62dd['name']){delete _0x3d62dd[_0x630d('0x28')];}_0x368a88[_0x630d('0x18')](_0x274a40)[_0x630d('0x29')](_0x3d62dd);};}exports[_0x630d('0x2a')]=function(_0x20fc93,_0x8db5c1){var _0x2a9269={},_0x2d6d26={},_0x357f46={'count':0x0,'rows':[]};var _0x33ad60=_['map'](db[_0x630d('0x2b')][_0x630d('0x2c')],function(_0x2120e8){return{'name':_0x2120e8[_0x630d('0x2d')],'type':_0x2120e8[_0x630d('0x2e')][_0x630d('0x2f')]};});_0x2d6d26['model']=_[_0x630d('0x30')](_0x33ad60,_0x630d('0x28'));_0x2d6d26[_0x630d('0x31')]=_[_0x630d('0x32')](_0x20fc93[_0x630d('0x31')]);_0x2d6d26['filters']=_[_0x630d('0x33')](_0x2d6d26['model'],_0x2d6d26[_0x630d('0x31')]);_0x2a9269[_0x630d('0x34')]=_[_0x630d('0x33')](_0x2d6d26[_0x630d('0x35')],qs['fields'](_0x20fc93[_0x630d('0x31')]['fields']));_0x2a9269[_0x630d('0x34')]=_0x2a9269[_0x630d('0x34')][_0x630d('0x36')]?_0x2a9269[_0x630d('0x34')]:_0x2d6d26['model'];if(!_0x20fc93[_0x630d('0x31')][_0x630d('0x37')]('nolimit')){_0x2a9269[_0x630d('0x38')]=qs[_0x630d('0x38')](_0x20fc93[_0x630d('0x31')]['limit']);_0x2a9269[_0x630d('0x1c')]=qs[_0x630d('0x1c')](_0x20fc93[_0x630d('0x31')]['offset']);}_0x2a9269[_0x630d('0x39')]=qs[_0x630d('0x3a')](_0x20fc93['query'][_0x630d('0x3a')]);_0x2a9269[_0x630d('0x3b')]=qs[_0x630d('0x3c')](_[_0x630d('0x3d')](_0x20fc93[_0x630d('0x31')],_0x2d6d26[_0x630d('0x3c')]),_0x33ad60);if(_0x20fc93[_0x630d('0x31')][_0x630d('0x3e')]){_0x2a9269[_0x630d('0x3b')]=_['merge'](_0x2a9269[_0x630d('0x3b')],{'$or':_['map'](_0x33ad60,function(_0x13ed13){if(_0x13ed13[_0x630d('0x2e')]!==_0x630d('0x3f')){var _0x4a4f31={};_0x4a4f31[_0x13ed13[_0x630d('0x28')]]={'$like':'%'+_0x20fc93[_0x630d('0x31')][_0x630d('0x3e')]+'%'};return _0x4a4f31;}})});}_0x2a9269=_[_0x630d('0x40')]({},_0x2a9269,_0x20fc93['options']);var _0x25711={'where':_0x2a9269[_0x630d('0x3b')]};return db[_0x630d('0x2b')][_0x630d('0x1d')](_0x25711)[_0x630d('0x22')](function(_0x4402de){_0x357f46['count']=_0x4402de;if(_0x20fc93[_0x630d('0x31')][_0x630d('0x41')]){_0x2a9269['include']=[{'all':!![]}];}return db[_0x630d('0x2b')]['findAll'](_0x2a9269);})[_0x630d('0x22')](function(_0x4e4223){_0x357f46['rows']=_0x4e4223;return _0x357f46;})[_0x630d('0x22')](respondWithFilteredResult(_0x8db5c1,_0x2a9269))[_0x630d('0x42')](handleError(_0x8db5c1,null));};exports['show']=function(_0x319650,_0x400cb5){var _0x5b35a0={'raw':![],'where':{'id':_0x319650[_0x630d('0x43')]['id']}},_0x2d5580={};_0x2d5580[_0x630d('0x35')]=_['keys'](db[_0x630d('0x2b')][_0x630d('0x2c')]);_0x2d5580[_0x630d('0x31')]=_[_0x630d('0x32')](_0x319650['query']);_0x2d5580[_0x630d('0x3c')]=_['intersection'](_0x2d5580['model'],_0x2d5580[_0x630d('0x31')]);_0x5b35a0[_0x630d('0x34')]=_[_0x630d('0x33')](_0x2d5580[_0x630d('0x35')],qs[_0x630d('0x44')](_0x319650[_0x630d('0x31')][_0x630d('0x44')]));_0x5b35a0[_0x630d('0x34')]=_0x5b35a0['attributes']['length']?_0x5b35a0[_0x630d('0x34')]:_0x2d5580[_0x630d('0x35')];if(_0x319650[_0x630d('0x31')][_0x630d('0x41')]){_0x5b35a0[_0x630d('0x45')]=[{'all':!![]}];}_0x5b35a0=_['merge']({},_0x5b35a0,_0x319650[_0x630d('0x46')]);return db['Campaign'][_0x630d('0x47')](_0x5b35a0)[_0x630d('0x22')](handleEntityNotFound(_0x400cb5,null))[_0x630d('0x22')](respondWithResult(_0x400cb5,null))[_0x630d('0x42')](handleError(_0x400cb5,null));};exports['create']=function(_0x2c81c6,_0x17d3fe){return db[_0x630d('0x2b')][_0x630d('0x48')](_0x2c81c6['body'],{})['then'](function(_0x522b8e){var _0x432716=_0x2c81c6[_0x630d('0x49')][_0x630d('0x24')]({'plain':!![]});if(!_0x432716)throw new Error(_0x630d('0x4a'));if(_0x432716['role']===_0x630d('0x49')){var _0x3a225a=_0x522b8e[_0x630d('0x24')]({'plain':!![]});var _0x4c84dc=_0x630d('0x25');return db[_0x630d('0x4b')]['find']({'where':{'name':_0x4c84dc,'userProfileId':_0x432716[_0x630d('0x4c')]},'raw':!![]})['then'](function(_0x1d25aa){if(_0x1d25aa&&_0x1d25aa[_0x630d('0x4d')]===0x0){return db[_0x630d('0x26')][_0x630d('0x48')]({'name':_0x3a225a[_0x630d('0x28')],'resourceId':_0x3a225a['id'],'type':_0x1d25aa[_0x630d('0x28')],'sectionId':_0x1d25aa['id']},{})['then'](function(){return _0x522b8e;});}else{return _0x522b8e;}})[_0x630d('0x42')](function(_0x4ce602){logger[_0x630d('0x4e')](_0x630d('0x4f'),_0x4ce602);throw _0x4ce602;});}return _0x522b8e;})[_0x630d('0x22')](respondWithResult(_0x17d3fe,0xc9))[_0x630d('0x42')](handleError(_0x17d3fe,null));};exports[_0x630d('0x50')]=function(_0x4bc6cb,_0x5cf1e9){var _0xab862b={'where':{'id':_0x4bc6cb[_0x630d('0x43')]['id']}},_0xacf4de={};_0xacf4de[_0x630d('0x35')]=_[_0x630d('0x32')](db[_0x630d('0x2b')][_0x630d('0x2c')]);_0xab862b[_0x630d('0x34')]=_['intersection'](_0xacf4de[_0x630d('0x35')],qs[_0x630d('0x44')](_0x4bc6cb[_0x630d('0x31')][_0x630d('0x44')]));_0xab862b[_0x630d('0x34')]=_0xab862b[_0x630d('0x34')]['length']?_0xab862b[_0x630d('0x34')]:_0xacf4de['model'];if(_0x4bc6cb[_0x630d('0x31')][_0x630d('0x41')]){_0xab862b[_0x630d('0x45')]=[{'all':!![]}];}_0xab862b=_[_0x630d('0x40')]({},_0xab862b,_0x4bc6cb[_0x630d('0x46')]);return db['Campaign'][_0x630d('0x47')](_0xab862b)[_0x630d('0x22')](handleEntityNotFound(_0x5cf1e9,null))[_0x630d('0x22')](function(_0x27307a){if(_0x27307a){var _0x234804=_0x27307a[_0x630d('0x24')]({'plain':!![]});_0x234804=qs['omit'](_0x234804,['id',_0x630d('0x51'),_0x630d('0x52')]);_0x4bc6cb[_0x630d('0x53')]=_['omit'](_0x4bc6cb[_0x630d('0x53')],['id','createdAt',_0x630d('0x52')]);return db[_0x630d('0x2b')][_0x630d('0x48')](_[_0x630d('0x40')](_0x234804,_0x4bc6cb[_0x630d('0x53')]),{'include':_0x4bc6cb[_0x630d('0x31')][_0x630d('0x41')]?[{'all':!![]}]:undefined})[_0x630d('0x22')](function(_0x518cbe){var _0x296851=_0x4bc6cb['user'][_0x630d('0x24')]({'plain':!![]});if(!_0x296851)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x296851[_0x630d('0x54')]==='user'){var _0x304a9a=_0x518cbe['get']({'plain':!![]});var _0x49c8d7=_0x630d('0x25');return db[_0x630d('0x4b')]['find']({'where':{'name':_0x49c8d7,'userProfileId':_0x296851['userProfileId']},'raw':!![]})['then'](function(_0x22c547){if(_0x22c547&&_0x22c547[_0x630d('0x4d')]===0x0){return db[_0x630d('0x26')]['create']({'name':_0x304a9a['name'],'resourceId':_0x304a9a['id'],'type':_0x22c547[_0x630d('0x28')],'sectionId':_0x22c547['id']},{})[_0x630d('0x22')](function(){return _0x518cbe;});}else{return _0x518cbe;}})[_0x630d('0x42')](function(_0x2cd222){logger[_0x630d('0x4e')](_0x630d('0x4f'),_0x2cd222);throw _0x2cd222;});}return _0x518cbe;});}})[_0x630d('0x22')](respondWithResult(_0x5cf1e9,0xc9))[_0x630d('0x42')](handleError(_0x5cf1e9,null));};exports['update']=function(_0x55f5cf,_0x4c6c25){if(_0x55f5cf[_0x630d('0x53')]['id']){delete _0x55f5cf[_0x630d('0x53')]['id'];}return db['Campaign'][_0x630d('0x47')]({'where':{'id':_0x55f5cf['params']['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x4c6c25,null))[_0x630d('0x22')](saveUpdates(_0x55f5cf[_0x630d('0x53')],null))[_0x630d('0x22')](respondWithResult(_0x4c6c25,null))[_0x630d('0x42')](handleError(_0x4c6c25,null));};exports[_0x630d('0x23')]=function(_0x114772,_0x3bad41){return db[_0x630d('0x2b')][_0x630d('0x47')]({'where':{'id':_0x114772[_0x630d('0x43')]['id']}})['then'](handleEntityNotFound(_0x3bad41,null))['then'](removeEntity(_0x3bad41,null))[_0x630d('0x42')](handleError(_0x3bad41,null));};exports['getHoppers']=function(_0x104c4f,_0x40688a,_0x417f33){var _0x23e4ba={'raw':!![],'where':{}};var _0x57a7e9={};var _0xdf5bde={'count':0x0,'rows':[]};return db[_0x630d('0x2b')][_0x630d('0x55')]({'where':{'id':_0x104c4f[_0x630d('0x43')]['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x40688a,null))[_0x630d('0x22')](function(_0x5588c1){if(_0x5588c1){_0x57a7e9['model']=_[_0x630d('0x32')](db['CmHopper'][_0x630d('0x2c')]);_0x57a7e9[_0x630d('0x31')]=_[_0x630d('0x32')](_0x104c4f[_0x630d('0x31')]);_0x57a7e9[_0x630d('0x3c')]=_[_0x630d('0x33')](_0x57a7e9[_0x630d('0x35')],_0x57a7e9[_0x630d('0x31')]);_0x23e4ba[_0x630d('0x34')]=_['intersection'](_0x57a7e9['model'],qs[_0x630d('0x44')](_0x104c4f['query']['fields']));_0x23e4ba[_0x630d('0x34')]=_0x23e4ba['attributes']['length']?_0x23e4ba['attributes']:_0x57a7e9[_0x630d('0x35')];if(!_0x104c4f[_0x630d('0x31')][_0x630d('0x37')]('nolimit')){_0x23e4ba['limit']=qs[_0x630d('0x38')](_0x104c4f['query'][_0x630d('0x38')]);_0x23e4ba[_0x630d('0x1c')]=qs[_0x630d('0x1c')](_0x104c4f[_0x630d('0x31')][_0x630d('0x1c')]);}_0x23e4ba['order']=qs[_0x630d('0x3a')](_0x104c4f[_0x630d('0x31')][_0x630d('0x3a')]);_0x23e4ba[_0x630d('0x3b')]=qs[_0x630d('0x3c')](_[_0x630d('0x3d')](_0x104c4f[_0x630d('0x31')],_0x57a7e9['filters']));_0x23e4ba['where'][_0x630d('0x56')]=_0x5588c1['id'];if(_0x104c4f[_0x630d('0x31')]['filter']){_0x23e4ba[_0x630d('0x3b')]=_['merge'](_0x23e4ba[_0x630d('0x3b')],{'$or':_[_0x630d('0x30')](_0x23e4ba[_0x630d('0x34')],function(_0x3aacfa){var _0x7dcfd2={};_0x7dcfd2[_0x3aacfa]={'$like':'%'+_0x104c4f[_0x630d('0x31')]['filter']+'%'};return _0x7dcfd2;})});}_0x23e4ba=_['merge']({},_0x23e4ba,_0x104c4f[_0x630d('0x46')]);return db[_0x630d('0x57')]['count']({'where':_0x23e4ba['where']})['then'](function(_0x58ef6f){_0xdf5bde[_0x630d('0x1d')]=_0x58ef6f;if(_0x104c4f[_0x630d('0x31')][_0x630d('0x41')]){_0x23e4ba['include']=[{'all':!![]}];}return db[_0x630d('0x57')][_0x630d('0x58')](_0x23e4ba);})[_0x630d('0x22')](function(_0x83e0fb){_0xdf5bde[_0x630d('0x59')]=_0x83e0fb;return _0xdf5bde;});}})['then'](respondWithFilteredResult(_0x40688a,_0x23e4ba))[_0x630d('0x42')](handleError(_0x40688a,null));};exports[_0x630d('0x5a')]=function(_0x1cfd6a,_0x7d9941,_0x31f39e){var _0x3f7aff={'raw':!![],'where':{}};var _0x5047a0={};var _0x30a9b4={'count':0x0,'rows':[]};return db[_0x630d('0x2b')][_0x630d('0x55')]({'where':{'id':_0x1cfd6a[_0x630d('0x43')]['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x7d9941,null))['then'](function(_0x327aba){if(_0x327aba){_0x5047a0['model']=_[_0x630d('0x32')](db[_0x630d('0x5b')][_0x630d('0x2c')]);_0x5047a0[_0x630d('0x31')]=_[_0x630d('0x32')](_0x1cfd6a[_0x630d('0x31')]);_0x5047a0[_0x630d('0x3c')]=_[_0x630d('0x33')](_0x5047a0[_0x630d('0x35')],_0x5047a0[_0x630d('0x31')]);_0x3f7aff[_0x630d('0x34')]=_[_0x630d('0x33')](_0x5047a0[_0x630d('0x35')],qs['fields'](_0x1cfd6a[_0x630d('0x31')][_0x630d('0x44')]));_0x3f7aff[_0x630d('0x34')]=_0x3f7aff[_0x630d('0x34')]['length']?_0x3f7aff[_0x630d('0x34')]:_0x5047a0[_0x630d('0x35')];if(!_0x1cfd6a['query'][_0x630d('0x37')](_0x630d('0x5c'))){_0x3f7aff[_0x630d('0x38')]=qs[_0x630d('0x38')](_0x1cfd6a[_0x630d('0x31')][_0x630d('0x38')]);_0x3f7aff[_0x630d('0x1c')]=qs[_0x630d('0x1c')](_0x1cfd6a[_0x630d('0x31')][_0x630d('0x1c')]);}_0x3f7aff[_0x630d('0x39')]=qs[_0x630d('0x3a')](_0x1cfd6a[_0x630d('0x31')][_0x630d('0x3a')]);_0x3f7aff[_0x630d('0x3b')]=qs[_0x630d('0x3c')](_[_0x630d('0x3d')](_0x1cfd6a[_0x630d('0x31')],_0x5047a0[_0x630d('0x3c')]));_0x3f7aff[_0x630d('0x3b')]['CampaignId']=_0x327aba['id'];if(_0x1cfd6a[_0x630d('0x31')][_0x630d('0x3e')]){_0x3f7aff[_0x630d('0x3b')]=_[_0x630d('0x40')](_0x3f7aff[_0x630d('0x3b')],{'$or':_[_0x630d('0x30')](_0x3f7aff[_0x630d('0x34')],function(_0xcf5dc4){var _0x32e12d={};_0x32e12d[_0xcf5dc4]={'$like':'%'+_0x1cfd6a[_0x630d('0x31')][_0x630d('0x3e')]+'%'};return _0x32e12d;})});}_0x3f7aff=_[_0x630d('0x40')]({},_0x3f7aff,_0x1cfd6a[_0x630d('0x46')]);return db['CmHopperHistory'][_0x630d('0x1d')]({'where':_0x3f7aff[_0x630d('0x3b')]})[_0x630d('0x22')](function(_0x2bb5f5){_0x30a9b4[_0x630d('0x1d')]=_0x2bb5f5;if(_0x1cfd6a['query']['includeAll']){_0x3f7aff[_0x630d('0x45')]=[{'all':!![]}];}return db[_0x630d('0x5b')][_0x630d('0x58')](_0x3f7aff);})[_0x630d('0x22')](function(_0x347fd1){_0x30a9b4[_0x630d('0x59')]=_0x347fd1;return _0x30a9b4;});}})['then'](respondWithFilteredResult(_0x7d9941,_0x3f7aff))[_0x630d('0x42')](handleError(_0x7d9941,null));};exports[_0x630d('0x5d')]=function(_0x555ee6,_0xce602e,_0x4fdcf4){var _0x36b585={'raw':!![],'where':{}};var _0x1d1d74={};var _0xc42603={'count':0x0,'rows':[]};return db[_0x630d('0x2b')][_0x630d('0x55')]({'where':{'id':_0x555ee6['params']['id']}})[_0x630d('0x22')](handleEntityNotFound(_0xce602e,null))[_0x630d('0x22')](function(_0x2da810){if(_0x2da810){_0x1d1d74[_0x630d('0x35')]=_[_0x630d('0x32')](db[_0x630d('0x5e')][_0x630d('0x2c')]);_0x1d1d74['query']=_[_0x630d('0x32')](_0x555ee6[_0x630d('0x31')]);_0x1d1d74[_0x630d('0x3c')]=_['intersection'](_0x1d1d74['model'],_0x1d1d74[_0x630d('0x31')]);_0x36b585['attributes']=_[_0x630d('0x33')](_0x1d1d74[_0x630d('0x35')],qs[_0x630d('0x44')](_0x555ee6[_0x630d('0x31')]['fields']));_0x36b585[_0x630d('0x34')]=_0x36b585[_0x630d('0x34')][_0x630d('0x36')]?_0x36b585['attributes']:_0x1d1d74[_0x630d('0x35')];if(!_0x555ee6[_0x630d('0x31')][_0x630d('0x37')]('nolimit')){_0x36b585['limit']=qs[_0x630d('0x38')](_0x555ee6[_0x630d('0x31')][_0x630d('0x38')]);_0x36b585[_0x630d('0x1c')]=qs[_0x630d('0x1c')](_0x555ee6[_0x630d('0x31')][_0x630d('0x1c')]);}_0x36b585[_0x630d('0x39')]=qs[_0x630d('0x3a')](_0x555ee6[_0x630d('0x31')][_0x630d('0x3a')]);_0x36b585[_0x630d('0x3b')]=qs[_0x630d('0x3c')](_['pick'](_0x555ee6[_0x630d('0x31')],_0x1d1d74[_0x630d('0x3c')]));_0x36b585[_0x630d('0x3b')][_0x630d('0x56')]=_0x2da810['id'];if(_0x555ee6['query'][_0x630d('0x3e')]){_0x36b585[_0x630d('0x3b')]=_[_0x630d('0x40')](_0x36b585[_0x630d('0x3b')],{'$or':_[_0x630d('0x30')](_0x36b585[_0x630d('0x34')],function(_0x17ca19){var _0x3ce33b={};_0x3ce33b[_0x17ca19]={'$like':'%'+_0x555ee6[_0x630d('0x31')]['filter']+'%'};return _0x3ce33b;})});}_0x36b585=_[_0x630d('0x40')]({},_0x36b585,_0x555ee6[_0x630d('0x46')]);return db[_0x630d('0x5e')][_0x630d('0x1d')]({'where':_0x36b585[_0x630d('0x3b')]})[_0x630d('0x22')](function(_0x4ba2e5){_0xc42603[_0x630d('0x1d')]=_0x4ba2e5;if(_0x555ee6[_0x630d('0x31')][_0x630d('0x41')]){_0x36b585[_0x630d('0x45')]=[{'all':!![]}];}return db[_0x630d('0x5e')]['findAll'](_0x36b585);})[_0x630d('0x22')](function(_0x29cfd6){_0xc42603[_0x630d('0x59')]=_0x29cfd6;return _0xc42603;});}})['then'](respondWithFilteredResult(_0xce602e,_0x36b585))[_0x630d('0x42')](handleError(_0xce602e,null));};exports[_0x630d('0x5f')]=function(_0x4a0086,_0x596b6f,_0x3b499a){var _0x4cdc7a={'raw':!![],'where':{}};var _0x113496={};var _0x5bccb0={'count':0x0,'rows':[]};return db[_0x630d('0x2b')][_0x630d('0x55')]({'where':{'id':_0x4a0086[_0x630d('0x43')]['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x596b6f,null))[_0x630d('0x22')](function(_0x5aefab){if(_0x5aefab){_0x113496['model']=_[_0x630d('0x32')](db[_0x630d('0x60')][_0x630d('0x2c')]);_0x113496[_0x630d('0x31')]=_['keys'](_0x4a0086[_0x630d('0x31')]);_0x113496[_0x630d('0x3c')]=_[_0x630d('0x33')](_0x113496['model'],_0x113496[_0x630d('0x31')]);_0x4cdc7a['attributes']=_[_0x630d('0x33')](_0x113496['model'],qs[_0x630d('0x44')](_0x4a0086[_0x630d('0x31')]['fields']));_0x4cdc7a[_0x630d('0x34')]=_0x4cdc7a[_0x630d('0x34')][_0x630d('0x36')]?_0x4cdc7a['attributes']:_0x113496['model'];if(!_0x4a0086[_0x630d('0x31')][_0x630d('0x37')](_0x630d('0x5c'))){_0x4cdc7a[_0x630d('0x38')]=qs[_0x630d('0x38')](_0x4a0086[_0x630d('0x31')]['limit']);_0x4cdc7a['offset']=qs[_0x630d('0x1c')](_0x4a0086[_0x630d('0x31')][_0x630d('0x1c')]);}_0x4cdc7a[_0x630d('0x39')]=qs[_0x630d('0x3a')](_0x4a0086[_0x630d('0x31')]['sort']);_0x4cdc7a['where']=qs[_0x630d('0x3c')](_[_0x630d('0x3d')](_0x4a0086[_0x630d('0x31')],_0x113496['filters']));_0x4cdc7a[_0x630d('0x3b')]['CampaignId']=_0x5aefab['id'];if(_0x4a0086['query'][_0x630d('0x3e')]){_0x4cdc7a[_0x630d('0x3b')]=_[_0x630d('0x40')](_0x4cdc7a['where'],{'$or':_['map'](_0x4cdc7a['attributes'],function(_0x14d9a6){var _0x4f551b={};_0x4f551b[_0x14d9a6]={'$like':'%'+_0x4a0086[_0x630d('0x31')]['filter']+'%'};return _0x4f551b;})});}_0x4cdc7a=_[_0x630d('0x40')]({},_0x4cdc7a,_0x4a0086['options']);return db[_0x630d('0x60')][_0x630d('0x1d')]({'where':_0x4cdc7a['where']})[_0x630d('0x22')](function(_0x2bbe36){_0x5bccb0[_0x630d('0x1d')]=_0x2bbe36;if(_0x4a0086['query'][_0x630d('0x41')]){_0x4cdc7a[_0x630d('0x45')]=[{'all':!![]}];}return db[_0x630d('0x60')][_0x630d('0x58')](_0x4cdc7a);})[_0x630d('0x22')](function(_0x5b7e2f){_0x5bccb0['rows']=_0x5b7e2f;return _0x5bccb0;});}})[_0x630d('0x22')](respondWithFilteredResult(_0x596b6f,_0x4cdc7a))['catch'](handleError(_0x596b6f,null));};exports[_0x630d('0x61')]=function(_0x628634,_0x260438,_0x3b72fa){var _0x4c89f4={};var _0x451a75={};var _0x2d1a1c;var _0x242649;return db[_0x630d('0x2b')][_0x630d('0x55')]({'where':{'id':_0x628634[_0x630d('0x43')]['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x260438,null))[_0x630d('0x22')](function(_0x214e14){if(_0x214e14){_0x2d1a1c=_0x214e14;_0x451a75[_0x630d('0x35')]=_[_0x630d('0x32')](db[_0x630d('0x62')][_0x630d('0x2c')]);_0x451a75[_0x630d('0x31')]=_[_0x630d('0x32')](_0x628634[_0x630d('0x31')]);_0x451a75['filters']=_[_0x630d('0x33')](_0x451a75[_0x630d('0x35')],_0x451a75['query']);_0x4c89f4[_0x630d('0x34')]=_['intersection'](_0x451a75[_0x630d('0x35')],qs[_0x630d('0x44')](_0x628634[_0x630d('0x31')][_0x630d('0x44')]));_0x4c89f4['attributes']=_0x4c89f4['attributes']['length']?_0x4c89f4[_0x630d('0x34')]:_0x451a75[_0x630d('0x35')];_0x4c89f4[_0x630d('0x39')]=qs[_0x630d('0x3a')](_0x628634['query'][_0x630d('0x3a')]);_0x4c89f4[_0x630d('0x3b')]=qs[_0x630d('0x3c')](_[_0x630d('0x3d')](_0x628634[_0x630d('0x31')],_0x451a75[_0x630d('0x3c')]));if(_0x628634[_0x630d('0x31')][_0x630d('0x3e')]){_0x4c89f4[_0x630d('0x3b')]=_['merge'](_0x4c89f4[_0x630d('0x3b')],{'$or':_[_0x630d('0x30')](_0x4c89f4[_0x630d('0x34')],function(_0x456de1){var _0x46ca50={};_0x46ca50[_0x456de1]={'$like':'%'+_0x628634[_0x630d('0x31')]['filter']+'%'};return _0x46ca50;})});}_0x4c89f4=_[_0x630d('0x40')]({},_0x4c89f4,_0x628634[_0x630d('0x46')]);return _0x2d1a1c[_0x630d('0x61')](_0x4c89f4);}})[_0x630d('0x22')](function(_0x3b21e8){if(_0x3b21e8){_0x242649=_0x3b21e8[_0x630d('0x36')];if(!_0x628634[_0x630d('0x31')][_0x630d('0x37')](_0x630d('0x5c'))){_0x4c89f4[_0x630d('0x38')]=qs[_0x630d('0x38')](_0x628634[_0x630d('0x31')]['limit']);_0x4c89f4[_0x630d('0x1c')]=qs[_0x630d('0x1c')](_0x628634[_0x630d('0x31')][_0x630d('0x1c')]);}return _0x2d1a1c[_0x630d('0x61')](_0x4c89f4);}})['then'](function(_0x2f649a){if(_0x2f649a){return _0x2f649a?{'count':_0x242649,'rows':_0x2f649a}:null;}})[_0x630d('0x22')](respondWithResult(_0x260438,null))[_0x630d('0x42')](handleError(_0x260438,null));};exports[_0x630d('0x63')]=function(_0xb4ac4e,_0x2728b0,_0x28a6e9){var _0x35ec4e,_0x17bb3f;var _0x15128d=[];var _0x436071=moment()[_0x630d('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x630d('0x2b')][_0x630d('0x47')]({'where':{'id':_0xb4ac4e['params']['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x2728b0,null))[_0x630d('0x22')](function(_0x1889cc){if(_0x1889cc){_0x17bb3f=_0x1889cc;return _0x1889cc['addLists'](_0xb4ac4e[_0x630d('0x53')][_0x630d('0x65')],_[_0x630d('0x66')](_0xb4ac4e['body'],[_0x630d('0x65'),'id'])||{});}return null;})[_0x630d('0x67')](function(_0x1da3d8){var _0x1e1802;var _0x4b0cdd;_0x35ec4e=_0x1da3d8||[];var _0xf69299=[];if(_0x1da3d8){for(var _0x59a2b8=0x0;_0x59a2b8<_0x1da3d8[_0x630d('0x36')];_0x59a2b8+=0x1){var _0x46571b=_0x1da3d8[_0x59a2b8]['get']({'plain':!![]});_0x17bb3f['dialCheckDuplicateType']=_0xb4ac4e[_0x630d('0x53')][_0x630d('0x68')]?_0xb4ac4e[_0x630d('0x53')][_0x630d('0x68')]:_0x17bb3f[_0x630d('0x68')];switch(_0x17bb3f[_0x630d('0x68')]){case _0x630d('0x69'):_0x1e1802=squel[_0x630d('0x6a')]()[_0x630d('0x6b')](_0x630d('0x6c'))['fromQuery']([_0x630d('0x6d'),_0x630d('0x6e'),_0x630d('0x6f'),_0x630d('0x70'),'CampaignId',_0x630d('0x51'),_0x630d('0x52')],squel[_0x630d('0x71')]()['field'](_0x630d('0x6d'),_0x630d('0x6d'))[_0x630d('0x72')]('NOW()',_0x630d('0x6e'))['field']('id',_0x630d('0x6f'))[_0x630d('0x72')](_0x46571b[_0x630d('0x73')][_0x630d('0x74')](),_0x630d('0x70'))[_0x630d('0x72')](_0xb4ac4e[_0x630d('0x43')]['id']['toString'](),_0x630d('0x56'))['field']('\x27'+_0x436071+'\x27','createdAt')['field']('\x27'+_0x436071+'\x27',_0x630d('0x52'))[_0x630d('0x75')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x630d('0x76'),_0x46571b[_0x630d('0x73')][_0x630d('0x74')]())[_0x630d('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x630d('0x3b')](_0x630d('0x77'),squel[_0x630d('0x71')]()[_0x630d('0x72')](_0x630d('0x78'))[_0x630d('0x75')](_0x630d('0x79'))[_0x630d('0x3b')](_0x630d('0x7a'),_0xb4ac4e[_0x630d('0x43')]['id']['toString']()))[_0x630d('0x3b')](_0x630d('0x77'),squel[_0x630d('0x71')]()['field'](_0x630d('0x7b'))[_0x630d('0x75')](_0x630d('0x6c'))[_0x630d('0x3b')]('CampaignId\x20=\x20?',_0xb4ac4e[_0x630d('0x43')]['id'][_0x630d('0x74')]())))[_0x630d('0x74')]();break;case'onlyIfOpen':_0x1e1802=squel[_0x630d('0x6a')]()['into'](_0x630d('0x6c'))[_0x630d('0x7c')]([_0x630d('0x6d'),_0x630d('0x6e'),_0x630d('0x6f'),_0x630d('0x70'),_0x630d('0x56'),_0x630d('0x51'),_0x630d('0x52')],squel[_0x630d('0x71')]()['field'](_0x630d('0x6d'),_0x630d('0x6d'))[_0x630d('0x72')](_0x630d('0x7d'),_0x630d('0x6e'))[_0x630d('0x72')]('id',_0x630d('0x6f'))[_0x630d('0x72')](_0x46571b[_0x630d('0x73')]['toString'](),_0x630d('0x70'))['field'](_0xb4ac4e[_0x630d('0x43')]['id']['toString'](),_0x630d('0x56'))[_0x630d('0x72')]('\x27'+_0x436071+'\x27',_0x630d('0x51'))['field']('\x27'+_0x436071+'\x27',_0x630d('0x52'))[_0x630d('0x75')](_0x630d('0x7e'))['where'](_0x630d('0x7f'))[_0x630d('0x3b')](_0x630d('0x76'),_0x46571b['CmListId'][_0x630d('0x74')]())[_0x630d('0x3b')](_0x630d('0x80'))[_0x630d('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x630d('0x71')]()[_0x630d('0x72')](_0x630d('0x7b'))[_0x630d('0x75')]('cm_hopper')[_0x630d('0x3b')](_0x630d('0x7a'),_0xb4ac4e[_0x630d('0x43')]['id']['toString']())))[_0x630d('0x74')]();break;default:_0x1e1802=squel[_0x630d('0x6a')]()['into'](_0x630d('0x6c'))[_0x630d('0x7c')]([_0x630d('0x6d'),_0x630d('0x6e'),'ContactId','ListId',_0x630d('0x56'),_0x630d('0x51'),'updatedAt'],squel[_0x630d('0x71')]()[_0x630d('0x72')](_0x630d('0x6d'),_0x630d('0x6d'))[_0x630d('0x72')](_0x630d('0x7d'),_0x630d('0x6e'))['field']('id',_0x630d('0x6f'))[_0x630d('0x72')](_0x46571b[_0x630d('0x73')]['toString'](),_0x630d('0x70'))[_0x630d('0x72')](_0xb4ac4e[_0x630d('0x43')]['id'][_0x630d('0x74')](),'CampaignId')['field']('\x27'+_0x436071+'\x27',_0x630d('0x51'))['field']('\x27'+_0x436071+'\x27','updatedAt')['from']('cm_contacts')[_0x630d('0x3b')]('deletedAt\x20IS\x20NULL')[_0x630d('0x3b')]('ListId\x20=\x20?',_0x46571b[_0x630d('0x73')][_0x630d('0x74')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x630d('0x74')]();}_0x4b0cdd=squel[_0x630d('0x6a')]()[_0x630d('0x6b')](_0x630d('0x81'))[_0x630d('0x7c')](['cmHopperId',_0x630d('0x6e'),'phone',_0x630d('0x82'),_0x630d('0x51'),_0x630d('0x52')],squel[_0x630d('0x71')]()[_0x630d('0x72')]('h.id','id')[_0x630d('0x72')](_0x630d('0x7d'),_0x630d('0x6e'))['field'](_0x630d('0x83'),'phone')[_0x630d('0x72')](_0x630d('0x84'),_0x630d('0x82'))[_0x630d('0x72')]('\x27'+_0x436071+'\x27',_0x630d('0x51'))[_0x630d('0x72')]('\x27'+_0x436071+'\x27',_0x630d('0x52'))['from'](_0x630d('0x85'),'ci')['join'](_0x630d('0x6c'),'h',_0x630d('0x86'))[_0x630d('0x3b')](_0x630d('0x87'),_0x46571b[_0x630d('0x73')][_0x630d('0x74')]())[_0x630d('0x3b')](_0x630d('0x88'),_0xb4ac4e['params']['id']['toString']())['where'](_0x630d('0x89'),_0x436071))[_0x630d('0x74')]();_0xf69299[_0x630d('0x8a')](db['sequelize'][_0x630d('0x31')](_0x1e1802));_0x15128d[_0x630d('0x8a')](db[_0x630d('0x8b')]['query'](_0x4b0cdd));}return BPromise[_0x630d('0x8c')](_0xf69299);}})[_0x630d('0x22')](function(){return BPromise['all'](_0x15128d);})[_0x630d('0x22')](function(){return _0x35ec4e;})[_0x630d('0x22')](respondWithResult(_0x2728b0,null))['catch'](handleError(_0x2728b0,null));};exports[_0x630d('0x8d')]=function(_0x5664a6,_0x40bff7,_0x1d4afb){return db[_0x630d('0x2b')][_0x630d('0x47')]({'where':{'id':_0x5664a6[_0x630d('0x43')]['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x40bff7,null))[_0x630d('0x22')](function(_0x5fb03a){if(_0x5fb03a){return _0x5fb03a[_0x630d('0x8d')](_0x5664a6[_0x630d('0x31')][_0x630d('0x65')]);}})[_0x630d('0x22')](function(_0x200714){if(_0x200714){return db[_0x630d('0x57')][_0x630d('0x23')]({'where':{'ListId':_0x5664a6[_0x630d('0x31')][_0x630d('0x65')],'CampaignId':_0x5664a6[_0x630d('0x43')]['id']}})['then'](function(){return _0x200714;});}})[_0x630d('0x22')](respondWithStatusCode(_0x40bff7,null))[_0x630d('0x42')](handleError(_0x40bff7,null));};exports[_0x630d('0x8e')]=function(_0x3395fe,_0x2aca64,_0xa24d6e){var _0x421241={};var _0x1efaa8={};var _0x333740;var _0x28dfa5;return db[_0x630d('0x2b')][_0x630d('0x55')]({'where':{'id':_0x3395fe['params']['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x2aca64,null))[_0x630d('0x22')](function(_0xcaadda){if(_0xcaadda){_0x333740=_0xcaadda;_0x1efaa8[_0x630d('0x35')]=_[_0x630d('0x32')](db[_0x630d('0x62')]['rawAttributes']);_0x1efaa8[_0x630d('0x31')]=_[_0x630d('0x32')](_0x3395fe['query']);_0x1efaa8[_0x630d('0x3c')]=_[_0x630d('0x33')](_0x1efaa8[_0x630d('0x35')],_0x1efaa8[_0x630d('0x31')]);_0x421241[_0x630d('0x34')]=_[_0x630d('0x33')](_0x1efaa8[_0x630d('0x35')],qs[_0x630d('0x44')](_0x3395fe['query'][_0x630d('0x44')]));_0x421241[_0x630d('0x34')]=_0x421241['attributes'][_0x630d('0x36')]?_0x421241[_0x630d('0x34')]:_0x1efaa8[_0x630d('0x35')];_0x421241[_0x630d('0x39')]=qs[_0x630d('0x3a')](_0x3395fe[_0x630d('0x31')]['sort']);_0x421241[_0x630d('0x3b')]=qs[_0x630d('0x3c')](_[_0x630d('0x3d')](_0x3395fe['query'],_0x1efaa8[_0x630d('0x3c')]));if(_0x3395fe['query'][_0x630d('0x3e')]){_0x421241[_0x630d('0x3b')]=_['merge'](_0x421241[_0x630d('0x3b')],{'$or':_[_0x630d('0x30')](_0x421241[_0x630d('0x34')],function(_0x456817){var _0x488f2d={};_0x488f2d[_0x456817]={'$like':'%'+_0x3395fe['query'][_0x630d('0x3e')]+'%'};return _0x488f2d;})});}_0x421241=_[_0x630d('0x40')]({},_0x421241,_0x3395fe[_0x630d('0x46')]);return _0x333740[_0x630d('0x8e')](_0x421241);}})[_0x630d('0x22')](function(_0x620517){if(_0x620517){_0x28dfa5=_0x620517['length'];if(!_0x3395fe[_0x630d('0x31')][_0x630d('0x37')](_0x630d('0x5c'))){_0x421241[_0x630d('0x38')]=qs[_0x630d('0x38')](_0x3395fe[_0x630d('0x31')]['limit']);_0x421241[_0x630d('0x1c')]=qs[_0x630d('0x1c')](_0x3395fe[_0x630d('0x31')]['offset']);}return _0x333740[_0x630d('0x8e')](_0x421241);}})[_0x630d('0x22')](function(_0x4c385a){if(_0x4c385a){return _0x4c385a?{'count':_0x28dfa5,'rows':_0x4c385a}:null;}})[_0x630d('0x22')](respondWithResult(_0x2aca64,null))[_0x630d('0x42')](handleError(_0x2aca64,null));};exports['addBlackLists']=function(_0xa31ad3,_0x109f7f,_0x59b217){var _0x3eedd5,_0x212575;var _0x5b89a1=[];var _0x3bfffe=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x630d('0x2b')][_0x630d('0x47')]({'where':{'id':_0xa31ad3[_0x630d('0x43')]['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x109f7f,null))[_0x630d('0x22')](function(_0x31e20a){if(_0x31e20a){_0x212575=_0x31e20a;return _0x31e20a[_0x630d('0x8f')](_0xa31ad3['body'][_0x630d('0x65')],_[_0x630d('0x66')](_0xa31ad3['body'],[_0x630d('0x65'),'id'])||{});}return null;})[_0x630d('0x67')](function(_0x1931a7){var _0xf25ef0;var _0x361d22;_0x3eedd5=_0x1931a7||[];var _0x1bb79c=[];if(_0x1931a7){for(var _0x189c8a=0x0;_0x189c8a<_0x1931a7['length'];_0x189c8a+=0x1){var _0x13b4e7=_0x1931a7[_0x189c8a][_0x630d('0x24')]({'plain':!![]});_0xf25ef0=squel[_0x630d('0x6a')]()[_0x630d('0x6b')](_0x630d('0x90'))[_0x630d('0x7c')]([_0x630d('0x6d'),_0x630d('0x6f'),'ListId',_0x630d('0x56'),_0x630d('0x51'),_0x630d('0x52')],squel[_0x630d('0x71')]()[_0x630d('0x72')]('phone','phone')[_0x630d('0x72')]('id','ContactId')['field'](_0x13b4e7['CmListId'][_0x630d('0x74')](),_0x630d('0x70'))[_0x630d('0x72')](_0xa31ad3['params']['id'][_0x630d('0x74')](),_0x630d('0x56'))[_0x630d('0x72')](_0x630d('0x7d'),'createdAt')[_0x630d('0x72')](_0x630d('0x7d'),'updatedAt')[_0x630d('0x75')](_0x630d('0x7e'))[_0x630d('0x3b')](_0x630d('0x7f'))[_0x630d('0x3b')](_0x630d('0x76'),_0x13b4e7[_0x630d('0x73')][_0x630d('0x74')]())[_0x630d('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x630d('0x74')]();_0x1bb79c[_0x630d('0x8a')](db[_0x630d('0x8b')][_0x630d('0x31')](_0xf25ef0));}return BPromise[_0x630d('0x8c')](_0x1bb79c);}})['then'](function(){return _0x3eedd5;})[_0x630d('0x22')](respondWithResult(_0x109f7f,null))[_0x630d('0x42')](handleError(_0x109f7f,null));};exports[_0x630d('0x91')]=function(_0x13dd25,_0x556169,_0xc138e7){return db[_0x630d('0x2b')][_0x630d('0x47')]({'where':{'id':_0x13dd25['params']['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x556169,null))['then'](function(_0x26a1ed){if(_0x26a1ed){return _0x26a1ed[_0x630d('0x91')](_0x13dd25[_0x630d('0x31')][_0x630d('0x65')]);}})['then'](function(_0x37afdb){if(_0x37afdb){return db[_0x630d('0x60')][_0x630d('0x23')]({'where':{'ListId':_0x13dd25[_0x630d('0x31')]['ids'],'CampaignId':_0x13dd25[_0x630d('0x43')]['id']}})[_0x630d('0x22')](function(){return _0x37afdb;});}})[_0x630d('0x22')](respondWithStatusCode(_0x556169,null))[_0x630d('0x42')](handleError(_0x556169,null));};
\ No newline at end of file
+var _0xa571=['status','json','undefined','limit','count','offset','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','autoAssociation','params','getHoppers','CmHopper','pick','CampaignId','filter','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','format','addLists','ids','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','select','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','NOW()','insert','into','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xa571,0x107));var _0x1a57=function(_0x26cc10,_0x24dd3b){_0x26cc10=_0x26cc10-0x0;var _0xb7cbec=_0xa571[_0x26cc10];return _0xb7cbec;};'use strict';var emlformat=require(_0x1a57('0x0'));var rimraf=require(_0x1a57('0x1'));var zipdir=require(_0x1a57('0x2'));var jsonpatch=require(_0x1a57('0x3'));var rp=require('request-promise');var moment=require(_0x1a57('0x4'));var BPromise=require(_0x1a57('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a57('0x6'));var sox=require('sox');var csv=require(_0x1a57('0x7'));var ejs=require(_0x1a57('0x8'));var fs=require('fs');var fs_extra=require(_0x1a57('0x9'));var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x7'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a57('0x17'))['db'];function respondWithStatusCode(_0x1911b2,_0x202d9a){_0x202d9a=_0x202d9a||0xcc;return function(_0x5ae643){if(_0x5ae643){return _0x1911b2[_0x1a57('0x18')](_0x202d9a);}return _0x1911b2[_0x1a57('0x19')](_0x202d9a)['end']();};}function respondWithResult(_0x503278,_0x587422){_0x587422=_0x587422||0xc8;return function(_0xd08107){if(_0xd08107){return _0x503278[_0x1a57('0x19')](_0x587422)[_0x1a57('0x1a')](_0xd08107);}};}function respondWithFilteredResult(_0x153d01,_0x5802d6){return function(_0x20f7ad){if(_0x20f7ad){var _0x53c61f=typeof _0x5802d6['offset']===_0x1a57('0x1b')&&typeof _0x5802d6[_0x1a57('0x1c')]===_0x1a57('0x1b');var _0x51b4c2=_0x20f7ad[_0x1a57('0x1d')];var _0x1662a3=_0x53c61f?0x0:_0x5802d6[_0x1a57('0x1e')];var _0x53bb20=_0x53c61f?_0x20f7ad[_0x1a57('0x1d')]:_0x5802d6[_0x1a57('0x1e')]+_0x5802d6[_0x1a57('0x1c')];var _0xcba6b7;if(_0x53bb20>=_0x51b4c2){_0x53bb20=_0x51b4c2;_0xcba6b7=0xc8;}else{_0xcba6b7=0xce;}_0x153d01[_0x1a57('0x19')](_0xcba6b7);return _0x153d01['set']('Content-Range',_0x1662a3+'-'+_0x53bb20+'/'+_0x51b4c2)[_0x1a57('0x1a')](_0x20f7ad);}return null;};}function patchUpdates(_0x21e811){return function(_0x211c63){try{jsonpatch['apply'](_0x211c63,_0x21e811,!![]);}catch(_0x5c200e){return BPromise['reject'](_0x5c200e);}return _0x211c63[_0x1a57('0x1f')]();};}function saveUpdates(_0x113ad4,_0x3f52b9){return function(_0xee133b){if(_0xee133b){return _0xee133b[_0x1a57('0x20')](_0x113ad4)[_0x1a57('0x21')](function(_0x2efa49){return _0x2efa49;});}return null;};}function removeEntity(_0x2f8b00,_0x183ca3){return function(_0x35d5dc){if(_0x35d5dc){return _0x35d5dc[_0x1a57('0x22')]()[_0x1a57('0x21')](function(){var _0x26cdd3=_0x35d5dc[_0x1a57('0x23')]({'plain':!![]});var _0x2f9454=_0x1a57('0x24');return db[_0x1a57('0x25')][_0x1a57('0x22')]({'where':{'type':_0x2f9454,'resourceId':_0x26cdd3['id']}})[_0x1a57('0x21')](function(){return _0x35d5dc;});})[_0x1a57('0x21')](function(){_0x2f8b00[_0x1a57('0x19')](0xcc)[_0x1a57('0x26')]();});}};}function handleEntityNotFound(_0x5a53c8,_0x530401){return function(_0x139d8c){if(!_0x139d8c){_0x5a53c8[_0x1a57('0x18')](0x194);}return _0x139d8c;};}function handleError(_0x545041,_0x46dac6){_0x46dac6=_0x46dac6||0x1f4;return function(_0x54f6a5){logger[_0x1a57('0x27')](_0x54f6a5[_0x1a57('0x28')]);if(_0x54f6a5['name']){delete _0x54f6a5[_0x1a57('0x29')];}_0x545041[_0x1a57('0x19')](_0x46dac6)[_0x1a57('0x2a')](_0x54f6a5);};}exports[_0x1a57('0x2b')]=function(_0x492b90,_0x366d5f){var _0x396832={},_0x4374f0={},_0x160536={'count':0x0,'rows':[]};var _0x5763ba=_[_0x1a57('0x2c')](db[_0x1a57('0x2d')][_0x1a57('0x2e')],function(_0x32f79f){return{'name':_0x32f79f[_0x1a57('0x2f')],'type':_0x32f79f[_0x1a57('0x30')][_0x1a57('0x31')]};});_0x4374f0[_0x1a57('0x32')]=_[_0x1a57('0x2c')](_0x5763ba,'name');_0x4374f0[_0x1a57('0x33')]=_[_0x1a57('0x34')](_0x492b90['query']);_0x4374f0['filters']=_[_0x1a57('0x35')](_0x4374f0[_0x1a57('0x32')],_0x4374f0[_0x1a57('0x33')]);_0x396832[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x4374f0[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x492b90[_0x1a57('0x33')][_0x1a57('0x37')]));_0x396832[_0x1a57('0x36')]=_0x396832[_0x1a57('0x36')][_0x1a57('0x38')]?_0x396832[_0x1a57('0x36')]:_0x4374f0[_0x1a57('0x32')];if(!_0x492b90[_0x1a57('0x33')][_0x1a57('0x39')](_0x1a57('0x3a'))){_0x396832[_0x1a57('0x1c')]=qs['limit'](_0x492b90[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x396832[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x492b90[_0x1a57('0x33')][_0x1a57('0x1e')]);}_0x396832[_0x1a57('0x3b')]=qs[_0x1a57('0x3c')](_0x492b90[_0x1a57('0x33')]['sort']);_0x396832['where']=qs['filters'](_['pick'](_0x492b90[_0x1a57('0x33')],_0x4374f0[_0x1a57('0x3d')]),_0x5763ba);if(_0x492b90[_0x1a57('0x33')]['filter']){_0x396832[_0x1a57('0x3e')]=_[_0x1a57('0x3f')](_0x396832[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x5763ba,function(_0x5bf186){if(_0x5bf186[_0x1a57('0x30')]!=='VIRTUAL'){var _0xd39e5a={};_0xd39e5a[_0x5bf186[_0x1a57('0x29')]]={'$like':'%'+_0x492b90[_0x1a57('0x33')]['filter']+'%'};return _0xd39e5a;}})});}_0x396832=_[_0x1a57('0x3f')]({},_0x396832,_0x492b90[_0x1a57('0x40')]);var _0x61e9f6={'where':_0x396832[_0x1a57('0x3e')]};return db[_0x1a57('0x2d')]['count'](_0x61e9f6)[_0x1a57('0x21')](function(_0x47e998){_0x160536['count']=_0x47e998;if(_0x492b90[_0x1a57('0x33')]['includeAll']){_0x396832[_0x1a57('0x41')]=[{'all':!![]}];}return db[_0x1a57('0x2d')][_0x1a57('0x42')](_0x396832);})['then'](function(_0x188a50){_0x160536[_0x1a57('0x43')]=_0x188a50;return _0x160536;})[_0x1a57('0x21')](respondWithFilteredResult(_0x366d5f,_0x396832))[_0x1a57('0x44')](handleError(_0x366d5f,null));};exports['show']=function(_0xc7bab4,_0x150fb6){var _0x4fdd29={'raw':![],'where':{'id':_0xc7bab4['params']['id']}},_0x32d05b={};_0x32d05b['model']=_[_0x1a57('0x34')](db[_0x1a57('0x2d')][_0x1a57('0x2e')]);_0x32d05b[_0x1a57('0x33')]=_['keys'](_0xc7bab4[_0x1a57('0x33')]);_0x32d05b[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0x32d05b[_0x1a57('0x32')],_0x32d05b[_0x1a57('0x33')]);_0x4fdd29['attributes']=_[_0x1a57('0x35')](_0x32d05b[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0xc7bab4[_0x1a57('0x33')]['fields']));_0x4fdd29[_0x1a57('0x36')]=_0x4fdd29['attributes'][_0x1a57('0x38')]?_0x4fdd29[_0x1a57('0x36')]:_0x32d05b[_0x1a57('0x32')];if(_0xc7bab4[_0x1a57('0x33')][_0x1a57('0x45')]){_0x4fdd29[_0x1a57('0x41')]=[{'all':!![]}];}_0x4fdd29=_[_0x1a57('0x3f')]({},_0x4fdd29,_0xc7bab4[_0x1a57('0x40')]);return db[_0x1a57('0x2d')][_0x1a57('0x46')](_0x4fdd29)[_0x1a57('0x21')](handleEntityNotFound(_0x150fb6,null))[_0x1a57('0x21')](respondWithResult(_0x150fb6,null))[_0x1a57('0x44')](handleError(_0x150fb6,null));};exports['create']=function(_0xf4d056,_0x480aff){return db[_0x1a57('0x2d')][_0x1a57('0x47')](_0xf4d056[_0x1a57('0x48')],{})[_0x1a57('0x21')](function(_0x323af1){var _0x3cbb9e=_0xf4d056[_0x1a57('0x49')][_0x1a57('0x23')]({'plain':!![]});if(!_0x3cbb9e)throw new Error(_0x1a57('0x4a'));if(_0x3cbb9e['role']===_0x1a57('0x49')){var _0x439a42=_0x323af1['get']({'plain':!![]});var _0x15f1f5=_0x1a57('0x24');return db['UserProfileSection'][_0x1a57('0x46')]({'where':{'name':_0x15f1f5,'userProfileId':_0x3cbb9e[_0x1a57('0x4b')]},'raw':!![]})['then'](function(_0x4d3177){if(_0x4d3177&&_0x4d3177['autoAssociation']===0x0){return db[_0x1a57('0x25')][_0x1a57('0x47')]({'name':_0x439a42['name'],'resourceId':_0x439a42['id'],'type':_0x4d3177[_0x1a57('0x29')],'sectionId':_0x4d3177['id']},{})[_0x1a57('0x21')](function(){return _0x323af1;});}else{return _0x323af1;}})['catch'](function(_0x5e510e){logger['error'](_0x1a57('0x4c'),_0x5e510e);throw _0x5e510e;});}return _0x323af1;})[_0x1a57('0x21')](respondWithResult(_0x480aff,0xc9))[_0x1a57('0x44')](handleError(_0x480aff,null));};exports[_0x1a57('0x4d')]=function(_0x28738e,_0x33379c){var _0xd64b3a={'where':{'id':_0x28738e['params']['id']}},_0x1f705b={};_0x1f705b['model']=_['keys'](db['Campaign']['rawAttributes']);_0xd64b3a[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x1f705b[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x28738e[_0x1a57('0x33')][_0x1a57('0x37')]));_0xd64b3a[_0x1a57('0x36')]=_0xd64b3a[_0x1a57('0x36')]['length']?_0xd64b3a['attributes']:_0x1f705b['model'];if(_0x28738e[_0x1a57('0x33')]['includeAll']){_0xd64b3a[_0x1a57('0x41')]=[{'all':!![]}];}_0xd64b3a=_[_0x1a57('0x3f')]({},_0xd64b3a,_0x28738e[_0x1a57('0x40')]);return db[_0x1a57('0x2d')][_0x1a57('0x46')](_0xd64b3a)[_0x1a57('0x21')](handleEntityNotFound(_0x33379c,null))[_0x1a57('0x21')](function(_0x561add){if(_0x561add){var _0x4e56b5=_0x561add['get']({'plain':!![]});_0x4e56b5=qs[_0x1a57('0x4e')](_0x4e56b5,['id',_0x1a57('0x4f'),_0x1a57('0x50')]);_0x28738e[_0x1a57('0x48')]=_[_0x1a57('0x4e')](_0x28738e[_0x1a57('0x48')],['id',_0x1a57('0x4f'),'updatedAt']);return db['Campaign'][_0x1a57('0x47')](_[_0x1a57('0x3f')](_0x4e56b5,_0x28738e[_0x1a57('0x48')]),{'include':_0x28738e[_0x1a57('0x33')][_0x1a57('0x45')]?[{'all':!![]}]:undefined})[_0x1a57('0x21')](function(_0x59a731){var _0x47db75=_0x28738e[_0x1a57('0x49')][_0x1a57('0x23')]({'plain':!![]});if(!_0x47db75)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47db75['role']===_0x1a57('0x49')){var _0x3a8806=_0x59a731[_0x1a57('0x23')]({'plain':!![]});var _0x10ceb8=_0x1a57('0x24');return db[_0x1a57('0x51')][_0x1a57('0x46')]({'where':{'name':_0x10ceb8,'userProfileId':_0x47db75['userProfileId']},'raw':!![]})['then'](function(_0x2fbf49){if(_0x2fbf49&&_0x2fbf49[_0x1a57('0x52')]===0x0){return db[_0x1a57('0x25')][_0x1a57('0x47')]({'name':_0x3a8806['name'],'resourceId':_0x3a8806['id'],'type':_0x2fbf49[_0x1a57('0x29')],'sectionId':_0x2fbf49['id']},{})[_0x1a57('0x21')](function(){return _0x59a731;});}else{return _0x59a731;}})[_0x1a57('0x44')](function(_0x33c8d4){logger[_0x1a57('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33c8d4);throw _0x33c8d4;});}return _0x59a731;});}})['then'](respondWithResult(_0x33379c,0xc9))['catch'](handleError(_0x33379c,null));};exports[_0x1a57('0x20')]=function(_0x223ba5,_0x1e2df1){if(_0x223ba5[_0x1a57('0x48')]['id']){delete _0x223ba5[_0x1a57('0x48')]['id'];}return db[_0x1a57('0x2d')][_0x1a57('0x46')]({'where':{'id':_0x223ba5[_0x1a57('0x53')]['id']}})['then'](handleEntityNotFound(_0x1e2df1,null))[_0x1a57('0x21')](saveUpdates(_0x223ba5[_0x1a57('0x48')],null))['then'](respondWithResult(_0x1e2df1,null))['catch'](handleError(_0x1e2df1,null));};exports[_0x1a57('0x22')]=function(_0x5be7b4,_0x2ebd9c){return db[_0x1a57('0x2d')][_0x1a57('0x46')]({'where':{'id':_0x5be7b4[_0x1a57('0x53')]['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x2ebd9c,null))[_0x1a57('0x21')](removeEntity(_0x2ebd9c,null))[_0x1a57('0x44')](handleError(_0x2ebd9c,null));};exports[_0x1a57('0x54')]=function(_0x5ae6ae,_0x7783ec,_0xc33b56){var _0x5e5b2f={'raw':!![],'where':{}};var _0x24b56c={};var _0x392f49={'count':0x0,'rows':[]};return db[_0x1a57('0x2d')]['findOne']({'where':{'id':_0x5ae6ae['params']['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x7783ec,null))[_0x1a57('0x21')](function(_0x3c5840){if(_0x3c5840){_0x24b56c[_0x1a57('0x32')]=_['keys'](db[_0x1a57('0x55')][_0x1a57('0x2e')]);_0x24b56c[_0x1a57('0x33')]=_[_0x1a57('0x34')](_0x5ae6ae[_0x1a57('0x33')]);_0x24b56c['filters']=_[_0x1a57('0x35')](_0x24b56c[_0x1a57('0x32')],_0x24b56c[_0x1a57('0x33')]);_0x5e5b2f[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x24b56c[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x5ae6ae[_0x1a57('0x33')][_0x1a57('0x37')]));_0x5e5b2f[_0x1a57('0x36')]=_0x5e5b2f[_0x1a57('0x36')]['length']?_0x5e5b2f[_0x1a57('0x36')]:_0x24b56c[_0x1a57('0x32')];if(!_0x5ae6ae['query'][_0x1a57('0x39')](_0x1a57('0x3a'))){_0x5e5b2f['limit']=qs[_0x1a57('0x1c')](_0x5ae6ae[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x5e5b2f[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x5ae6ae[_0x1a57('0x33')][_0x1a57('0x1e')]);}_0x5e5b2f[_0x1a57('0x3b')]=qs['sort'](_0x5ae6ae[_0x1a57('0x33')][_0x1a57('0x3c')]);_0x5e5b2f['where']=qs[_0x1a57('0x3d')](_[_0x1a57('0x56')](_0x5ae6ae[_0x1a57('0x33')],_0x24b56c[_0x1a57('0x3d')]));_0x5e5b2f[_0x1a57('0x3e')][_0x1a57('0x57')]=_0x3c5840['id'];if(_0x5ae6ae[_0x1a57('0x33')][_0x1a57('0x58')]){_0x5e5b2f[_0x1a57('0x3e')]=_['merge'](_0x5e5b2f[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x5e5b2f[_0x1a57('0x36')],function(_0x1e4d4e){var _0x12ae08={};_0x12ae08[_0x1e4d4e]={'$like':'%'+_0x5ae6ae['query'][_0x1a57('0x58')]+'%'};return _0x12ae08;})});}_0x5e5b2f=_[_0x1a57('0x3f')]({},_0x5e5b2f,_0x5ae6ae[_0x1a57('0x40')]);return db[_0x1a57('0x55')][_0x1a57('0x1d')]({'where':_0x5e5b2f[_0x1a57('0x3e')]})[_0x1a57('0x21')](function(_0x2831f7){_0x392f49['count']=_0x2831f7;if(_0x5ae6ae[_0x1a57('0x33')][_0x1a57('0x45')]){_0x5e5b2f[_0x1a57('0x41')]=[{'all':!![]}];}return db[_0x1a57('0x55')]['findAll'](_0x5e5b2f);})['then'](function(_0x49f809){_0x392f49['rows']=_0x49f809;return _0x392f49;});}})['then'](respondWithFilteredResult(_0x7783ec,_0x5e5b2f))[_0x1a57('0x44')](handleError(_0x7783ec,null));};exports[_0x1a57('0x59')]=function(_0x5e640b,_0x3219ce,_0x19f1d5){var _0x5f4509={'raw':!![],'where':{}};var _0x758985={};var _0x1fbcb1={'count':0x0,'rows':[]};return db[_0x1a57('0x2d')][_0x1a57('0x5a')]({'where':{'id':_0x5e640b['params']['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x3219ce,null))[_0x1a57('0x21')](function(_0x4c66e3){if(_0x4c66e3){_0x758985[_0x1a57('0x32')]=_[_0x1a57('0x34')](db[_0x1a57('0x5b')][_0x1a57('0x2e')]);_0x758985[_0x1a57('0x33')]=_[_0x1a57('0x34')](_0x5e640b[_0x1a57('0x33')]);_0x758985['filters']=_[_0x1a57('0x35')](_0x758985['model'],_0x758985[_0x1a57('0x33')]);_0x5f4509[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x758985[_0x1a57('0x32')],qs['fields'](_0x5e640b[_0x1a57('0x33')][_0x1a57('0x37')]));_0x5f4509[_0x1a57('0x36')]=_0x5f4509['attributes'][_0x1a57('0x38')]?_0x5f4509[_0x1a57('0x36')]:_0x758985[_0x1a57('0x32')];if(!_0x5e640b['query'][_0x1a57('0x39')](_0x1a57('0x3a'))){_0x5f4509[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x5e640b[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x5f4509[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x5e640b[_0x1a57('0x33')][_0x1a57('0x1e')]);}_0x5f4509[_0x1a57('0x3b')]=qs['sort'](_0x5e640b[_0x1a57('0x33')]['sort']);_0x5f4509[_0x1a57('0x3e')]=qs['filters'](_['pick'](_0x5e640b['query'],_0x758985['filters']));_0x5f4509[_0x1a57('0x3e')][_0x1a57('0x57')]=_0x4c66e3['id'];if(_0x5e640b[_0x1a57('0x33')]['filter']){_0x5f4509[_0x1a57('0x3e')]=_['merge'](_0x5f4509[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x5f4509[_0x1a57('0x36')],function(_0x597c28){var _0x1000e5={};_0x1000e5[_0x597c28]={'$like':'%'+_0x5e640b[_0x1a57('0x33')]['filter']+'%'};return _0x1000e5;})});}_0x5f4509=_['merge']({},_0x5f4509,_0x5e640b[_0x1a57('0x40')]);return db['CmHopperHistory'][_0x1a57('0x1d')]({'where':_0x5f4509[_0x1a57('0x3e')]})['then'](function(_0x45afe5){_0x1fbcb1[_0x1a57('0x1d')]=_0x45afe5;if(_0x5e640b['query'][_0x1a57('0x45')]){_0x5f4509[_0x1a57('0x41')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x5f4509);})[_0x1a57('0x21')](function(_0x4dd78e){_0x1fbcb1[_0x1a57('0x43')]=_0x4dd78e;return _0x1fbcb1;});}})[_0x1a57('0x21')](respondWithFilteredResult(_0x3219ce,_0x5f4509))[_0x1a57('0x44')](handleError(_0x3219ce,null));};exports[_0x1a57('0x5c')]=function(_0x1e4456,_0x46337f,_0x3770b9){var _0x4db879={'raw':!![],'where':{}};var _0xe7a762={};var _0x272589={'count':0x0,'rows':[]};return db[_0x1a57('0x2d')]['findOne']({'where':{'id':_0x1e4456['params']['id']}})['then'](handleEntityNotFound(_0x46337f,null))[_0x1a57('0x21')](function(_0x297300){if(_0x297300){_0xe7a762['model']=_['keys'](db[_0x1a57('0x5d')][_0x1a57('0x2e')]);_0xe7a762[_0x1a57('0x33')]=_['keys'](_0x1e4456[_0x1a57('0x33')]);_0xe7a762[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0xe7a762[_0x1a57('0x32')],_0xe7a762['query']);_0x4db879[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0xe7a762[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x1e4456[_0x1a57('0x33')][_0x1a57('0x37')]));_0x4db879[_0x1a57('0x36')]=_0x4db879[_0x1a57('0x36')][_0x1a57('0x38')]?_0x4db879['attributes']:_0xe7a762[_0x1a57('0x32')];if(!_0x1e4456[_0x1a57('0x33')][_0x1a57('0x39')](_0x1a57('0x3a'))){_0x4db879[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x1e4456[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x4db879[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x1e4456[_0x1a57('0x33')][_0x1a57('0x1e')]);}_0x4db879[_0x1a57('0x3b')]=qs['sort'](_0x1e4456[_0x1a57('0x33')][_0x1a57('0x3c')]);_0x4db879[_0x1a57('0x3e')]=qs[_0x1a57('0x3d')](_[_0x1a57('0x56')](_0x1e4456[_0x1a57('0x33')],_0xe7a762['filters']));_0x4db879[_0x1a57('0x3e')][_0x1a57('0x57')]=_0x297300['id'];if(_0x1e4456[_0x1a57('0x33')][_0x1a57('0x58')]){_0x4db879[_0x1a57('0x3e')]=_['merge'](_0x4db879[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x4db879['attributes'],function(_0x29bdca){var _0x350dbd={};_0x350dbd[_0x29bdca]={'$like':'%'+_0x1e4456[_0x1a57('0x33')][_0x1a57('0x58')]+'%'};return _0x350dbd;})});}_0x4db879=_['merge']({},_0x4db879,_0x1e4456['options']);return db[_0x1a57('0x5d')][_0x1a57('0x1d')]({'where':_0x4db879['where']})[_0x1a57('0x21')](function(_0x67d85){_0x272589[_0x1a57('0x1d')]=_0x67d85;if(_0x1e4456[_0x1a57('0x33')][_0x1a57('0x45')]){_0x4db879[_0x1a57('0x41')]=[{'all':!![]}];}return db[_0x1a57('0x5d')][_0x1a57('0x42')](_0x4db879);})[_0x1a57('0x21')](function(_0x26d7b8){_0x272589[_0x1a57('0x43')]=_0x26d7b8;return _0x272589;});}})[_0x1a57('0x21')](respondWithFilteredResult(_0x46337f,_0x4db879))['catch'](handleError(_0x46337f,null));};exports[_0x1a57('0x5e')]=function(_0x31805d,_0x30295e,_0x739c6b){var _0x2c40de={'raw':!![],'where':{}};var _0x771d07={};var _0x3d4cab={'count':0x0,'rows':[]};return db[_0x1a57('0x2d')][_0x1a57('0x5a')]({'where':{'id':_0x31805d['params']['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x30295e,null))[_0x1a57('0x21')](function(_0x1ff4fa){if(_0x1ff4fa){_0x771d07[_0x1a57('0x32')]=_[_0x1a57('0x34')](db[_0x1a57('0x5f')][_0x1a57('0x2e')]);_0x771d07['query']=_[_0x1a57('0x34')](_0x31805d[_0x1a57('0x33')]);_0x771d07[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0x771d07[_0x1a57('0x32')],_0x771d07[_0x1a57('0x33')]);_0x2c40de[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x771d07[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x31805d[_0x1a57('0x33')]['fields']));_0x2c40de['attributes']=_0x2c40de[_0x1a57('0x36')]['length']?_0x2c40de[_0x1a57('0x36')]:_0x771d07[_0x1a57('0x32')];if(!_0x31805d[_0x1a57('0x33')][_0x1a57('0x39')](_0x1a57('0x3a'))){_0x2c40de[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x31805d[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x2c40de[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x31805d[_0x1a57('0x33')][_0x1a57('0x1e')]);}_0x2c40de['order']=qs['sort'](_0x31805d[_0x1a57('0x33')]['sort']);_0x2c40de[_0x1a57('0x3e')]=qs[_0x1a57('0x3d')](_['pick'](_0x31805d[_0x1a57('0x33')],_0x771d07[_0x1a57('0x3d')]));_0x2c40de[_0x1a57('0x3e')][_0x1a57('0x57')]=_0x1ff4fa['id'];if(_0x31805d[_0x1a57('0x33')][_0x1a57('0x58')]){_0x2c40de[_0x1a57('0x3e')]=_['merge'](_0x2c40de[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x2c40de['attributes'],function(_0x2d37cd){var _0x10217b={};_0x10217b[_0x2d37cd]={'$like':'%'+_0x31805d[_0x1a57('0x33')]['filter']+'%'};return _0x10217b;})});}_0x2c40de=_[_0x1a57('0x3f')]({},_0x2c40de,_0x31805d['options']);return db['CmHopperBlack'][_0x1a57('0x1d')]({'where':_0x2c40de['where']})['then'](function(_0x1779ab){_0x3d4cab[_0x1a57('0x1d')]=_0x1779ab;if(_0x31805d[_0x1a57('0x33')][_0x1a57('0x45')]){_0x2c40de['include']=[{'all':!![]}];}return db[_0x1a57('0x5f')][_0x1a57('0x42')](_0x2c40de);})['then'](function(_0x308e36){_0x3d4cab[_0x1a57('0x43')]=_0x308e36;return _0x3d4cab;});}})[_0x1a57('0x21')](respondWithFilteredResult(_0x30295e,_0x2c40de))[_0x1a57('0x44')](handleError(_0x30295e,null));};exports['getLists']=function(_0x5656e5,_0x2dbb1e,_0x2036f1){var _0x190395={};var _0x37b838={};var _0x561d62;var _0x533af1;return db[_0x1a57('0x2d')]['findOne']({'where':{'id':_0x5656e5['params']['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x2dbb1e,null))[_0x1a57('0x21')](function(_0x44b6f8){if(_0x44b6f8){_0x561d62=_0x44b6f8;_0x37b838[_0x1a57('0x32')]=_[_0x1a57('0x34')](db[_0x1a57('0x60')][_0x1a57('0x2e')]);_0x37b838[_0x1a57('0x33')]=_[_0x1a57('0x34')](_0x5656e5[_0x1a57('0x33')]);_0x37b838[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0x37b838[_0x1a57('0x32')],_0x37b838['query']);_0x190395[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x37b838[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x5656e5[_0x1a57('0x33')][_0x1a57('0x37')]));_0x190395[_0x1a57('0x36')]=_0x190395[_0x1a57('0x36')][_0x1a57('0x38')]?_0x190395[_0x1a57('0x36')]:_0x37b838['model'];_0x190395[_0x1a57('0x3b')]=qs[_0x1a57('0x3c')](_0x5656e5[_0x1a57('0x33')][_0x1a57('0x3c')]);_0x190395[_0x1a57('0x3e')]=qs[_0x1a57('0x3d')](_[_0x1a57('0x56')](_0x5656e5[_0x1a57('0x33')],_0x37b838['filters']));if(_0x5656e5[_0x1a57('0x33')][_0x1a57('0x58')]){_0x190395['where']=_[_0x1a57('0x3f')](_0x190395[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x190395['attributes'],function(_0xdaf58b){var _0x5247c5={};_0x5247c5[_0xdaf58b]={'$like':'%'+_0x5656e5[_0x1a57('0x33')][_0x1a57('0x58')]+'%'};return _0x5247c5;})});}_0x190395=_[_0x1a57('0x3f')]({},_0x190395,_0x5656e5[_0x1a57('0x40')]);return _0x561d62[_0x1a57('0x61')](_0x190395);}})['then'](function(_0x337ce5){if(_0x337ce5){_0x533af1=_0x337ce5[_0x1a57('0x38')];if(!_0x5656e5[_0x1a57('0x33')][_0x1a57('0x39')](_0x1a57('0x3a'))){_0x190395[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x5656e5[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x190395[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x5656e5[_0x1a57('0x33')]['offset']);}return _0x561d62['getLists'](_0x190395);}})[_0x1a57('0x21')](function(_0x4d0799){if(_0x4d0799){return _0x4d0799?{'count':_0x533af1,'rows':_0x4d0799}:null;}})[_0x1a57('0x21')](respondWithResult(_0x2dbb1e,null))[_0x1a57('0x44')](handleError(_0x2dbb1e,null));};exports['addLists']=function(_0x2f9860,_0x8bfcb,_0x4f8f97){var _0x30c86b,_0x584f30;var _0x38d08b=[];var _0x33622a=moment()[_0x1a57('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x1a57('0x2d')][_0x1a57('0x46')]({'where':{'id':_0x2f9860[_0x1a57('0x53')]['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x8bfcb,null))['then'](function(_0x85bec5){if(_0x85bec5){_0x584f30=_0x85bec5;return _0x85bec5[_0x1a57('0x63')](_0x2f9860['body'][_0x1a57('0x64')],_[_0x1a57('0x4e')](_0x2f9860[_0x1a57('0x48')],[_0x1a57('0x64'),'id'])||{});}return null;})['spread'](function(_0x186d91){var _0x6bab68;var _0x2fcd4a;_0x30c86b=_0x186d91||[];var _0x56e2a2=[];if(_0x186d91){for(var _0x8698fe=0x0;_0x8698fe<_0x186d91[_0x1a57('0x38')];_0x8698fe+=0x1){var _0x3e1944=_0x186d91[_0x8698fe]['get']({'plain':!![]});_0x584f30['dialCheckDuplicateType']=_0x2f9860[_0x1a57('0x48')][_0x1a57('0x65')]?_0x2f9860[_0x1a57('0x48')]['dialCheckDuplicateType']:_0x584f30[_0x1a57('0x65')];switch(_0x584f30['dialCheckDuplicateType']){case _0x1a57('0x66'):_0x6bab68=squel['insert']()['into'](_0x1a57('0x67'))[_0x1a57('0x68')]([_0x1a57('0x69'),_0x1a57('0x6a'),_0x1a57('0x6b'),_0x1a57('0x6c'),_0x1a57('0x57'),_0x1a57('0x4f'),'updatedAt'],squel['select']()['field'](_0x1a57('0x69'),'phone')[_0x1a57('0x6d')]('NOW()',_0x1a57('0x6a'))[_0x1a57('0x6d')]('id',_0x1a57('0x6b'))[_0x1a57('0x6d')](_0x3e1944[_0x1a57('0x6e')][_0x1a57('0x6f')](),'ListId')[_0x1a57('0x6d')](_0x2f9860[_0x1a57('0x53')]['id'][_0x1a57('0x6f')](),_0x1a57('0x57'))[_0x1a57('0x6d')]('\x27'+_0x33622a+'\x27','createdAt')[_0x1a57('0x6d')]('\x27'+_0x33622a+'\x27','updatedAt')[_0x1a57('0x70')](_0x1a57('0x71'))[_0x1a57('0x3e')](_0x1a57('0x72'))['where'](_0x1a57('0x73'),_0x3e1944['CmListId']['toString']())[_0x1a57('0x3e')](_0x1a57('0x74'))[_0x1a57('0x3e')](_0x1a57('0x75'),squel['select']()['field'](_0x1a57('0x76'))[_0x1a57('0x70')]('cm_hopper_final')[_0x1a57('0x3e')]('CampaignId\x20=\x20?',_0x2f9860[_0x1a57('0x53')]['id'][_0x1a57('0x6f')]()))[_0x1a57('0x3e')](_0x1a57('0x75'),squel[_0x1a57('0x77')]()[_0x1a57('0x6d')](_0x1a57('0x78'))[_0x1a57('0x70')](_0x1a57('0x67'))[_0x1a57('0x3e')](_0x1a57('0x79'),_0x2f9860[_0x1a57('0x53')]['id'][_0x1a57('0x6f')]())))[_0x1a57('0x6f')]();break;case _0x1a57('0x7a'):_0x6bab68=squel['insert']()['into']('cm_hopper')[_0x1a57('0x68')]([_0x1a57('0x69'),_0x1a57('0x6a'),'ContactId','ListId',_0x1a57('0x57'),_0x1a57('0x4f'),_0x1a57('0x50')],squel[_0x1a57('0x77')]()[_0x1a57('0x6d')]('phone',_0x1a57('0x69'))[_0x1a57('0x6d')](_0x1a57('0x7b'),_0x1a57('0x6a'))[_0x1a57('0x6d')]('id',_0x1a57('0x6b'))[_0x1a57('0x6d')](_0x3e1944[_0x1a57('0x6e')]['toString'](),'ListId')['field'](_0x2f9860[_0x1a57('0x53')]['id'][_0x1a57('0x6f')](),_0x1a57('0x57'))[_0x1a57('0x6d')]('\x27'+_0x33622a+'\x27',_0x1a57('0x4f'))[_0x1a57('0x6d')]('\x27'+_0x33622a+'\x27',_0x1a57('0x50'))[_0x1a57('0x70')](_0x1a57('0x71'))['where'](_0x1a57('0x72'))[_0x1a57('0x3e')](_0x1a57('0x73'),_0x3e1944[_0x1a57('0x6e')]['toString']())[_0x1a57('0x3e')](_0x1a57('0x74'))['where'](_0x1a57('0x75'),squel[_0x1a57('0x77')]()[_0x1a57('0x6d')]('COALESCE(phone,\x27\x27)')['from'](_0x1a57('0x67'))[_0x1a57('0x3e')](_0x1a57('0x79'),_0x2f9860[_0x1a57('0x53')]['id'][_0x1a57('0x6f')]())))[_0x1a57('0x6f')]();break;default:_0x6bab68=squel[_0x1a57('0x7c')]()['into'](_0x1a57('0x67'))[_0x1a57('0x68')]([_0x1a57('0x69'),_0x1a57('0x6a'),_0x1a57('0x6b'),'ListId','CampaignId',_0x1a57('0x4f'),_0x1a57('0x50')],squel[_0x1a57('0x77')]()[_0x1a57('0x6d')](_0x1a57('0x69'),'phone')[_0x1a57('0x6d')](_0x1a57('0x7b'),_0x1a57('0x6a'))[_0x1a57('0x6d')]('id',_0x1a57('0x6b'))[_0x1a57('0x6d')](_0x3e1944[_0x1a57('0x6e')][_0x1a57('0x6f')](),'ListId')['field'](_0x2f9860[_0x1a57('0x53')]['id'][_0x1a57('0x6f')](),_0x1a57('0x57'))[_0x1a57('0x6d')]('\x27'+_0x33622a+'\x27',_0x1a57('0x4f'))['field']('\x27'+_0x33622a+'\x27','updatedAt')[_0x1a57('0x70')](_0x1a57('0x71'))[_0x1a57('0x3e')](_0x1a57('0x72'))['where']('ListId\x20=\x20?',_0x3e1944[_0x1a57('0x6e')][_0x1a57('0x6f')]())[_0x1a57('0x3e')](_0x1a57('0x74')))[_0x1a57('0x6f')]();}_0x2fcd4a=squel[_0x1a57('0x7c')]()[_0x1a57('0x7d')]('cm_hopper_additional_phones')[_0x1a57('0x68')](['cmHopperId',_0x1a57('0x6a'),_0x1a57('0x69'),_0x1a57('0x7e'),_0x1a57('0x4f'),_0x1a57('0x50')],squel[_0x1a57('0x77')]()['field'](_0x1a57('0x7f'),'id')['field'](_0x1a57('0x7b'),'scheduledAt')[_0x1a57('0x6d')](_0x1a57('0x80'),'phone')[_0x1a57('0x6d')](_0x1a57('0x81'),_0x1a57('0x7e'))[_0x1a57('0x6d')]('\x27'+_0x33622a+'\x27','createdAt')[_0x1a57('0x6d')]('\x27'+_0x33622a+'\x27',_0x1a57('0x50'))[_0x1a57('0x70')](_0x1a57('0x82'),'ci')[_0x1a57('0x83')]('cm_hopper','h',_0x1a57('0x84'))[_0x1a57('0x3e')](_0x1a57('0x85'),_0x3e1944[_0x1a57('0x6e')][_0x1a57('0x6f')]())[_0x1a57('0x3e')](_0x1a57('0x86'),_0x2f9860[_0x1a57('0x53')]['id'][_0x1a57('0x6f')]())['where'](_0x1a57('0x87'),_0x33622a))['toString']();_0x56e2a2[_0x1a57('0x88')](db[_0x1a57('0x89')]['query'](_0x6bab68));_0x38d08b[_0x1a57('0x88')](db[_0x1a57('0x89')][_0x1a57('0x33')](_0x2fcd4a));}return BPromise[_0x1a57('0x8a')](_0x56e2a2);}})['then'](function(){return BPromise[_0x1a57('0x8a')](_0x38d08b);})[_0x1a57('0x21')](function(){return _0x30c86b;})['then'](respondWithResult(_0x8bfcb,null))[_0x1a57('0x44')](handleError(_0x8bfcb,null));};exports[_0x1a57('0x8b')]=function(_0x2d944e,_0x2d528a,_0x13fa27){return db[_0x1a57('0x2d')][_0x1a57('0x46')]({'where':{'id':_0x2d944e[_0x1a57('0x53')]['id']}})['then'](handleEntityNotFound(_0x2d528a,null))[_0x1a57('0x21')](function(_0x51b73d){if(_0x51b73d){return _0x51b73d[_0x1a57('0x8b')](_0x2d944e[_0x1a57('0x33')][_0x1a57('0x64')]);}})[_0x1a57('0x21')](function(_0x221622){if(_0x221622){return db[_0x1a57('0x55')][_0x1a57('0x22')]({'where':{'ListId':_0x2d944e[_0x1a57('0x33')]['ids'],'CampaignId':_0x2d944e[_0x1a57('0x53')]['id']}})[_0x1a57('0x21')](function(){return _0x221622;});}})[_0x1a57('0x21')](respondWithStatusCode(_0x2d528a,null))[_0x1a57('0x44')](handleError(_0x2d528a,null));};exports[_0x1a57('0x8c')]=function(_0x4896da,_0x5df8e0,_0x291d5d){var _0x3d7632={};var _0x1440df={};var _0x116a92;var _0x4b9f41;return db[_0x1a57('0x2d')][_0x1a57('0x5a')]({'where':{'id':_0x4896da['params']['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x5df8e0,null))['then'](function(_0x4d7d88){if(_0x4d7d88){_0x116a92=_0x4d7d88;_0x1440df[_0x1a57('0x32')]=_[_0x1a57('0x34')](db['CmList'][_0x1a57('0x2e')]);_0x1440df[_0x1a57('0x33')]=_[_0x1a57('0x34')](_0x4896da[_0x1a57('0x33')]);_0x1440df[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0x1440df[_0x1a57('0x32')],_0x1440df[_0x1a57('0x33')]);_0x3d7632[_0x1a57('0x36')]=_['intersection'](_0x1440df[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x4896da[_0x1a57('0x33')][_0x1a57('0x37')]));_0x3d7632[_0x1a57('0x36')]=_0x3d7632[_0x1a57('0x36')][_0x1a57('0x38')]?_0x3d7632['attributes']:_0x1440df[_0x1a57('0x32')];_0x3d7632[_0x1a57('0x3b')]=qs[_0x1a57('0x3c')](_0x4896da['query'][_0x1a57('0x3c')]);_0x3d7632[_0x1a57('0x3e')]=qs[_0x1a57('0x3d')](_['pick'](_0x4896da[_0x1a57('0x33')],_0x1440df['filters']));if(_0x4896da['query']['filter']){_0x3d7632[_0x1a57('0x3e')]=_[_0x1a57('0x3f')](_0x3d7632[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x3d7632['attributes'],function(_0x4138bd){var _0x1d400e={};_0x1d400e[_0x4138bd]={'$like':'%'+_0x4896da[_0x1a57('0x33')]['filter']+'%'};return _0x1d400e;})});}_0x3d7632=_[_0x1a57('0x3f')]({},_0x3d7632,_0x4896da[_0x1a57('0x40')]);return _0x116a92[_0x1a57('0x8c')](_0x3d7632);}})[_0x1a57('0x21')](function(_0x4d8aeb){if(_0x4d8aeb){_0x4b9f41=_0x4d8aeb[_0x1a57('0x38')];if(!_0x4896da[_0x1a57('0x33')][_0x1a57('0x39')]('nolimit')){_0x3d7632[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x4896da[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x3d7632[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x4896da[_0x1a57('0x33')][_0x1a57('0x1e')]);}return _0x116a92['getBlackLists'](_0x3d7632);}})[_0x1a57('0x21')](function(_0xeaebb5){if(_0xeaebb5){return _0xeaebb5?{'count':_0x4b9f41,'rows':_0xeaebb5}:null;}})[_0x1a57('0x21')](respondWithResult(_0x5df8e0,null))[_0x1a57('0x44')](handleError(_0x5df8e0,null));};exports[_0x1a57('0x8d')]=function(_0x5d9afb,_0x1a863d,_0x4cfdef){var _0x2f2698,_0x2b2165;var _0x412c11=[];var _0x4363d1=moment()[_0x1a57('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x1a57('0x46')]({'where':{'id':_0x5d9afb[_0x1a57('0x53')]['id']}})['then'](handleEntityNotFound(_0x1a863d,null))[_0x1a57('0x21')](function(_0x278fa7){if(_0x278fa7){_0x2b2165=_0x278fa7;return _0x278fa7[_0x1a57('0x8d')](_0x5d9afb['body']['ids'],_['omit'](_0x5d9afb[_0x1a57('0x48')],['ids','id'])||{});}return null;})[_0x1a57('0x8e')](function(_0x56c92b){var _0x3876c1;var _0x287766;_0x2f2698=_0x56c92b||[];var _0x13abb5=[];if(_0x56c92b){for(var _0x5cae61=0x0;_0x5cae61<_0x56c92b['length'];_0x5cae61+=0x1){var _0x154e08=_0x56c92b[_0x5cae61][_0x1a57('0x23')]({'plain':!![]});_0x3876c1=squel[_0x1a57('0x7c')]()[_0x1a57('0x7d')]('cm_hopper_black')['fromQuery']([_0x1a57('0x69'),_0x1a57('0x6b'),'ListId',_0x1a57('0x57'),_0x1a57('0x4f'),_0x1a57('0x50')],squel[_0x1a57('0x77')]()[_0x1a57('0x6d')]('phone','phone')[_0x1a57('0x6d')]('id',_0x1a57('0x6b'))['field'](_0x154e08[_0x1a57('0x6e')]['toString'](),'ListId')[_0x1a57('0x6d')](_0x5d9afb[_0x1a57('0x53')]['id'][_0x1a57('0x6f')](),_0x1a57('0x57'))['field'](_0x1a57('0x7b'),_0x1a57('0x4f'))[_0x1a57('0x6d')](_0x1a57('0x7b'),'updatedAt')[_0x1a57('0x70')](_0x1a57('0x71'))[_0x1a57('0x3e')](_0x1a57('0x72'))[_0x1a57('0x3e')](_0x1a57('0x73'),_0x154e08[_0x1a57('0x6e')]['toString']())[_0x1a57('0x3e')](_0x1a57('0x74')))[_0x1a57('0x6f')]();_0x13abb5[_0x1a57('0x88')](db['sequelize']['query'](_0x3876c1));}return BPromise[_0x1a57('0x8a')](_0x13abb5);}})[_0x1a57('0x21')](function(){return _0x2f2698;})[_0x1a57('0x21')](respondWithResult(_0x1a863d,null))[_0x1a57('0x44')](handleError(_0x1a863d,null));};exports[_0x1a57('0x8f')]=function(_0x3e7879,_0x373d43,_0x54189e){return db['Campaign']['find']({'where':{'id':_0x3e7879['params']['id']}})['then'](handleEntityNotFound(_0x373d43,null))[_0x1a57('0x21')](function(_0x31783b){if(_0x31783b){return _0x31783b['removeBlackLists'](_0x3e7879[_0x1a57('0x33')][_0x1a57('0x64')]);}})[_0x1a57('0x21')](function(_0x1c12ce){if(_0x1c12ce){return db[_0x1a57('0x5f')][_0x1a57('0x22')]({'where':{'ListId':_0x3e7879[_0x1a57('0x33')][_0x1a57('0x64')],'CampaignId':_0x3e7879[_0x1a57('0x53')]['id']}})[_0x1a57('0x21')](function(){return _0x1c12ce;});}})[_0x1a57('0x21')](respondWithStatusCode(_0x373d43,null))[_0x1a57('0x44')](handleError(_0x373d43,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 1fb6f4a..9c5e4a1 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x386b69,_0x5d9360){var _0x476415=function(_0x49fd60){while(--_0x49fd60){_0x386b69['push'](_0x386b69['shift']());}};_0x476415(++_0x5d9360);}(_0x7a54,0x106));var _0x47a5=function(_0xe0c1a7,_0x5f37cb){_0xe0c1a7=_0xe0c1a7-0x0;var _0x314d9b=_0x7a54[_0xe0c1a7];return _0x314d9b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 5d43d5f..a3558de 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 _0x50a6=['../../config/utils','../../config/logger','../../config/environment','http','then','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Campaign','options','raw','where','attributes','limit','map','include','model','info','GetCampaign','lodash','util','randomstring','../../mysqldb'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x50a6,0xa4));var _0x650a=function(_0xdd45,_0x2daf10){_0xdd45=_0xdd45-0x0;var _0x106736=_0x50a6[_0xdd45];return _0x106736;};'use strict';var _=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x650a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x650a('0x3'))['db'];var utils=require(_0x650a('0x4'));var logger=require(_0x650a('0x5'))('rpc');var config=require(_0x650a('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x650a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d1bb4,_0x2c22b9,_0x61618a){return new BPromise(function(_0x56d38f,_0x25366e){return client['request'](_0x2d1bb4,_0x61618a)[_0x650a('0x8')](function(_0x1e4796){logger['info'](_0x650a('0x9'),_0x2c22b9,_0x650a('0xa'));logger['debug'](_0x650a('0xb'),_0x2c22b9,'request\x20sent',JSON[_0x650a('0xc')](_0x1e4796));if(_0x1e4796['error']){if(_0x1e4796[_0x650a('0xd')]['code']===0x1f4){logger[_0x650a('0xd')]('Campaign,\x20%s,\x20%s',_0x2c22b9,_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);return _0x25366e(_0x1e4796[_0x650a('0xd')]['message']);}logger[_0x650a('0xd')](_0x650a('0x9'),_0x2c22b9,_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);return _0x56d38f(_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);}else{logger['info'](_0x650a('0x9'),_0x2c22b9,'request\x20sent');_0x56d38f(_0x1e4796[_0x650a('0xf')][_0x650a('0xe')]);}})[_0x650a('0x10')](function(_0x5d9c92){logger['error']('Campaign,\x20%s,\x20%s',_0x2c22b9,_0x5d9c92);_0x25366e(_0x5d9c92);});});}exports['GetCampaign']=function(_0x2ad2d7){var _0x359314=this;return new Promise(function(_0x41d2fa,_0xd0f717){return db[_0x650a('0x11')]['findAll']({'raw':_0x2ad2d7['options']?_0x2ad2d7[_0x650a('0x12')][_0x650a('0x13')]===undefined?!![]:![]:!![],'where':_0x2ad2d7['options']?_0x2ad2d7[_0x650a('0x12')][_0x650a('0x14')]||null:null,'attributes':_0x2ad2d7['options']?_0x2ad2d7[_0x650a('0x12')][_0x650a('0x15')]||null:null,'limit':_0x2ad2d7[_0x650a('0x12')]?_0x2ad2d7[_0x650a('0x12')][_0x650a('0x16')]||null:null,'include':_0x2ad2d7['options']?_0x2ad2d7[_0x650a('0x12')]['include']?_[_0x650a('0x17')](_0x2ad2d7[_0x650a('0x12')][_0x650a('0x18')],function(_0x469e53){return{'model':db[_0x469e53[_0x650a('0x19')]],'as':_0x469e53['as'],'attributes':_0x469e53[_0x650a('0x15')],'include':_0x469e53[_0x650a('0x18')]?_[_0x650a('0x17')](_0x469e53[_0x650a('0x18')],function(_0x2761a8){return{'model':db[_0x2761a8[_0x650a('0x19')]],'as':_0x2761a8['as'],'attributes':_0x2761a8[_0x650a('0x15')],'include':_0x2761a8[_0x650a('0x18')]?_[_0x650a('0x17')](_0x2761a8[_0x650a('0x18')],function(_0x39a155){return{'model':db[_0x39a155[_0x650a('0x19')]],'as':_0x39a155['as'],'attributes':_0x39a155[_0x650a('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2290a7){logger[_0x650a('0x1a')](_0x650a('0x1b'),_0x2ad2d7);logger['debug'](_0x650a('0x1b'),_0x2ad2d7,JSON[_0x650a('0xc')](_0x2290a7));_0x41d2fa(_0x2290a7);})[_0x650a('0x10')](function(_0x783509){logger[_0x650a('0xd')](_0x650a('0x1b'),_0x783509['message'],_0x2ad2d7);_0xd0f717(_0x359314[_0x650a('0xd')](0x1f4,_0x783509[_0x650a('0xe')]));});});};
\ No newline at end of file
+var _0x12fd=['catch','GetCampaign','Campaign','options','raw','where','attributes','limit','include','map','model','debug','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','Campaign,\x20%s,\x20%s','result'];(function(_0x343e70,_0xe5f373){var _0x2742fd=function(_0x27e56e){while(--_0x27e56e){_0x343e70['push'](_0x343e70['shift']());}};_0x2742fd(++_0xe5f373);}(_0x12fd,0x199));var _0xd12f=function(_0x5105ca,_0x2f2589){_0x5105ca=_0x5105ca-0x0;var _0x567724=_0x12fd[_0x5105ca];return _0x567724;};'use strict';var _=require(_0xd12f('0x0'));var util=require(_0xd12f('0x1'));var moment=require(_0xd12f('0x2'));var BPromise=require(_0xd12f('0x3'));var rs=require(_0xd12f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd12f('0x5'))['db'];var utils=require(_0xd12f('0x6'));var logger=require(_0xd12f('0x7'))(_0xd12f('0x8'));var config=require(_0xd12f('0x9'));var jayson=require(_0xd12f('0xa'));var client=jayson['client'][_0xd12f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ca6e6,_0x285abf,_0x193e89){return new BPromise(function(_0x62de68,_0x40aaf8){return client['request'](_0x5ca6e6,_0x193e89)[_0xd12f('0xc')](function(_0x539473){logger[_0xd12f('0xd')]('Campaign,\x20%s,\x20%s',_0x285abf,'request\x20sent');logger['debug'](_0xd12f('0xe'),_0x285abf,_0xd12f('0xf'),JSON['stringify'](_0x539473));if(_0x539473['error']){if(_0x539473['error']['code']===0x1f4){logger[_0xd12f('0x10')]('Campaign,\x20%s,\x20%s',_0x285abf,_0x539473[_0xd12f('0x10')][_0xd12f('0x11')]);return _0x40aaf8(_0x539473['error'][_0xd12f('0x11')]);}logger[_0xd12f('0x10')]('Campaign,\x20%s,\x20%s',_0x285abf,_0x539473['error']['message']);return _0x62de68(_0x539473[_0xd12f('0x10')][_0xd12f('0x11')]);}else{logger[_0xd12f('0xd')](_0xd12f('0x12'),_0x285abf,_0xd12f('0xf'));_0x62de68(_0x539473[_0xd12f('0x13')][_0xd12f('0x11')]);}})[_0xd12f('0x14')](function(_0x4769a2){logger['error']('Campaign,\x20%s,\x20%s',_0x285abf,_0x4769a2);_0x40aaf8(_0x4769a2);});});}exports[_0xd12f('0x15')]=function(_0x45ff4d){var _0x58a653=this;return new Promise(function(_0x14c619,_0x12c884){return db[_0xd12f('0x16')]['findAll']({'raw':_0x45ff4d['options']?_0x45ff4d[_0xd12f('0x17')][_0xd12f('0x18')]===undefined?!![]:![]:!![],'where':_0x45ff4d[_0xd12f('0x17')]?_0x45ff4d[_0xd12f('0x17')][_0xd12f('0x19')]||null:null,'attributes':_0x45ff4d[_0xd12f('0x17')]?_0x45ff4d['options'][_0xd12f('0x1a')]||null:null,'limit':_0x45ff4d[_0xd12f('0x17')]?_0x45ff4d[_0xd12f('0x17')][_0xd12f('0x1b')]||null:null,'include':_0x45ff4d[_0xd12f('0x17')]?_0x45ff4d[_0xd12f('0x17')][_0xd12f('0x1c')]?_[_0xd12f('0x1d')](_0x45ff4d[_0xd12f('0x17')][_0xd12f('0x1c')],function(_0x42eb92){return{'model':db[_0x42eb92[_0xd12f('0x1e')]],'as':_0x42eb92['as'],'attributes':_0x42eb92[_0xd12f('0x1a')],'include':_0x42eb92[_0xd12f('0x1c')]?_[_0xd12f('0x1d')](_0x42eb92[_0xd12f('0x1c')],function(_0x2218fe){return{'model':db[_0x2218fe[_0xd12f('0x1e')]],'as':_0x2218fe['as'],'attributes':_0x2218fe[_0xd12f('0x1a')],'include':_0x2218fe[_0xd12f('0x1c')]?_[_0xd12f('0x1d')](_0x2218fe[_0xd12f('0x1c')],function(_0x3d71be){return{'model':db[_0x3d71be['model']],'as':_0x3d71be['as'],'attributes':_0x3d71be[_0xd12f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x163f95){logger[_0xd12f('0xd')]('GetCampaign',_0x45ff4d);logger[_0xd12f('0x1f')]('GetCampaign',_0x45ff4d,JSON[_0xd12f('0x20')](_0x163f95));_0x14c619(_0x163f95);})[_0xd12f('0x14')](function(_0x3418de){logger[_0xd12f('0x10')]('GetCampaign',_0x3418de['message'],_0x45ff4d);_0x12c884(_0x58a653[_0xd12f('0x10')](0x1f4,_0x3418de['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 6757fe5..92c71d8 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 _0xc38d=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','/:id','show','get','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc38d,0x110));var _0xdc38=function(_0xf8dfc8,_0x58486e){_0xf8dfc8=_0xf8dfc8-0x0;var _0x3a601d=_0xc38d[_0xf8dfc8];return _0x3a601d;};'use strict';var multer=require(_0xdc38('0x0'));var util=require(_0xdc38('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdc38('0x2'));var router=express[_0xdc38('0x3')]();var fs_extra=require(_0xdc38('0x4'));var auth=require(_0xdc38('0x5'));var interaction=require(_0xdc38('0x6'));var config=require(_0xdc38('0x7'));var controller=require(_0xdc38('0x8'));router['get']('/',auth[_0xdc38('0x9')](),controller[_0xdc38('0xa')]);router['get'](_0xdc38('0xb'),auth['isAuthenticated'](),controller[_0xdc38('0xc')]);router[_0xdc38('0xd')](_0xdc38('0xe'),auth[_0xdc38('0x9')](),controller[_0xdc38('0xf')]);router[_0xdc38('0xd')]('/:id/hopper_histories',auth[_0xdc38('0x9')](),controller[_0xdc38('0x10')]);router[_0xdc38('0xd')](_0xdc38('0x11'),auth[_0xdc38('0x9')](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0xdc38('0x9')](),controller[_0xdc38('0x12')]);router['get'](_0xdc38('0x13'),auth[_0xdc38('0x9')](),controller[_0xdc38('0x14')]);router['get'](_0xdc38('0x15'),auth[_0xdc38('0x9')](),controller[_0xdc38('0x16')]);router['post']('/',auth[_0xdc38('0x9')](),controller[_0xdc38('0x17')]);router[_0xdc38('0x18')]('/:id/clone',auth[_0xdc38('0x9')](),controller['clone']);router[_0xdc38('0x18')](_0xdc38('0x13'),auth[_0xdc38('0x9')](),controller[_0xdc38('0x19')]);router[_0xdc38('0x18')](_0xdc38('0x15'),auth['isAuthenticated'](),controller[_0xdc38('0x1a')]);router[_0xdc38('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xdc38('0x1c')]);router[_0xdc38('0x1d')](_0xdc38('0xb'),auth[_0xdc38('0x9')](),controller[_0xdc38('0x1e')]);router[_0xdc38('0x1d')](_0xdc38('0x13'),auth['isAuthenticated'](),controller[_0xdc38('0x1f')]);router[_0xdc38('0x1d')]('/:id/blacklists',auth[_0xdc38('0x9')](),controller[_0xdc38('0x20')]);module[_0xdc38('0x21')]=router;
\ No newline at end of file
+var _0x30c6=['create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post'];(function(_0x3cf346,_0x3b8a44){var _0x33f272=function(_0x5d4056){while(--_0x5d4056){_0x3cf346['push'](_0x3cf346['shift']());}};_0x33f272(++_0x3b8a44);}(_0x30c6,0x171));var _0x630c=function(_0x459885,_0x5dcd09){_0x459885=_0x459885-0x0;var _0x39372f=_0x30c6[_0x459885];return _0x39372f;};'use strict';var multer=require(_0x630c('0x0'));var util=require('util');var path=require(_0x630c('0x1'));var timeout=require(_0x630c('0x2'));var express=require(_0x630c('0x3'));var router=express[_0x630c('0x4')]();var fs_extra=require(_0x630c('0x5'));var auth=require(_0x630c('0x6'));var interaction=require(_0x630c('0x7'));var config=require(_0x630c('0x8'));var controller=require(_0x630c('0x9'));router[_0x630c('0xa')]('/',auth[_0x630c('0xb')](),controller[_0x630c('0xc')]);router[_0x630c('0xa')](_0x630c('0xd'),auth[_0x630c('0xb')](),controller[_0x630c('0xe')]);router[_0x630c('0xa')]('/:id/hoppers',auth[_0x630c('0xb')](),controller[_0x630c('0xf')]);router[_0x630c('0xa')](_0x630c('0x10'),auth[_0x630c('0xb')](),controller[_0x630c('0x11')]);router[_0x630c('0xa')](_0x630c('0x12'),auth['isAuthenticated'](),controller[_0x630c('0x13')]);router['get'](_0x630c('0x14'),auth['isAuthenticated'](),controller[_0x630c('0x15')]);router['get'](_0x630c('0x16'),auth[_0x630c('0xb')](),controller[_0x630c('0x17')]);router[_0x630c('0xa')](_0x630c('0x18'),auth['isAuthenticated'](),controller[_0x630c('0x19')]);router[_0x630c('0x1a')]('/',auth['isAuthenticated'](),controller[_0x630c('0x1b')]);router['post'](_0x630c('0x1c'),auth[_0x630c('0xb')](),controller[_0x630c('0x1d')]);router[_0x630c('0x1a')]('/:id/lists',auth[_0x630c('0xb')](),controller[_0x630c('0x1e')]);router[_0x630c('0x1a')](_0x630c('0x18'),auth[_0x630c('0xb')](),controller[_0x630c('0x1f')]);router[_0x630c('0x20')](_0x630c('0xd'),auth['isAuthenticated'](),controller[_0x630c('0x21')]);router[_0x630c('0x22')]('/:id',auth['isAuthenticated'](),controller[_0x630c('0x23')]);router[_0x630c('0x22')](_0x630c('0x16'),auth[_0x630c('0xb')](),controller['removeLists']);router[_0x630c('0x22')](_0x630c('0x18'),auth[_0x630c('0xb')](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 6d3d2e6..68f5b86 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 _0x5b4e=['STRING','TEXT','medium','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0xd25cef,_0x35c0e5){var _0x5d933d=function(_0x552767){while(--_0x552767){_0xd25cef['push'](_0xd25cef['shift']());}};_0x5d933d(++_0x35c0e5);}(_0x5b4e,0x196));var _0xe5b4=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5b4e[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xe5b4('0x0'));module[_0xe5b4('0x1')]={'key':{'type':Sequelize[_0xe5b4('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xe5b4('0x3')],'length':_0xe5b4('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xe5b4('0x2')]},'name':{'type':Sequelize[_0xe5b4('0x5')],'get':function(){return this[_0xe5b4('0x6')](_0xe5b4('0x7'));}}};
\ No newline at end of file
+var _0x9d25=['TEXT','getDataValue','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9d25,0xde));var _0x59d2=function(_0x15b78c,_0x364a98){_0x15b78c=_0x15b78c-0x0;var _0x46804e=_0x9d25[_0x15b78c];return _0x46804e;};'use strict';var Sequelize=require(_0x59d2('0x0'));module[_0x59d2('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x59d2('0x2')],'length':'medium','allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x59d2('0x3')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 28366da..e578443 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 _0x21d9=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','apply','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','find','catch','body','params','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x152b4d,_0x5e6b47){var _0x5abe5e=function(_0x13a033){while(--_0x13a033){_0x152b4d['push'](_0x152b4d['shift']());}};_0x5abe5e(++_0x5e6b47);}(_0x21d9,0x1ae));var _0x921d=function(_0x4a2707,_0x56a7aa){_0x4a2707=_0x4a2707-0x0;var _0x2eb468=_0x21d9[_0x4a2707];return _0x2eb468;};'use strict';var emlformat=require(_0x921d('0x0'));var rimraf=require(_0x921d('0x1'));var zipdir=require(_0x921d('0x2'));var jsonpatch=require(_0x921d('0x3'));var rp=require(_0x921d('0x4'));var moment=require(_0x921d('0x5'));var BPromise=require(_0x921d('0x6'));var Mustache=require('mustache');var util=require(_0x921d('0x7'));var path=require(_0x921d('0x8'));var sox=require(_0x921d('0x9'));var csv=require(_0x921d('0xa'));var ejs=require(_0x921d('0xb'));var fs=require('fs');var fs_extra=require(_0x921d('0xc'));var _=require(_0x921d('0xd'));var squel=require(_0x921d('0xe'));var crypto=require(_0x921d('0xf'));var jsforce=require(_0x921d('0x10'));var deskjs=require(_0x921d('0x11'));var toCsv=require('to-csv');var querystring=require(_0x921d('0x12'));var Papa=require(_0x921d('0x13'));var Redis=require(_0x921d('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x921d('0x15'));var hardwareService=require(_0x921d('0x16'));var logger=require(_0x921d('0x17'))(_0x921d('0x18'));var utils=require(_0x921d('0x19'));var config=require(_0x921d('0x1a'));var licenseUtil=require(_0x921d('0x1b'));var db=require(_0x921d('0x1c'))['db'];function respondWithStatusCode(_0x44c951,_0x5a212f){_0x5a212f=_0x5a212f||0xcc;return function(_0x499f80){if(_0x499f80){return _0x44c951['sendStatus'](_0x5a212f);}return _0x44c951[_0x921d('0x1d')](_0x5a212f)[_0x921d('0x1e')]();};}function respondWithResult(_0x2aefac,_0x362bf4){_0x362bf4=_0x362bf4||0xc8;return function(_0x10285c){if(_0x10285c){return _0x2aefac[_0x921d('0x1d')](_0x362bf4)[_0x921d('0x1f')](_0x10285c);}};}function respondWithFilteredResult(_0x3e2baf,_0x5c64d9){return function(_0x141ab0){if(_0x141ab0){var _0x552053=typeof _0x5c64d9[_0x921d('0x20')]==='undefined'&&typeof _0x5c64d9[_0x921d('0x21')]===_0x921d('0x22');var _0x1e7e8d=_0x141ab0['count'];var _0x4ce8d5=_0x552053?0x0:_0x5c64d9['offset'];var _0x5bd96c=_0x552053?_0x141ab0[_0x921d('0x23')]:_0x5c64d9[_0x921d('0x20')]+_0x5c64d9[_0x921d('0x21')];var _0x126e94;if(_0x5bd96c>=_0x1e7e8d){_0x5bd96c=_0x1e7e8d;_0x126e94=0xc8;}else{_0x126e94=0xce;}_0x3e2baf[_0x921d('0x1d')](_0x126e94);return _0x3e2baf['set']('Content-Range',_0x4ce8d5+'-'+_0x5bd96c+'/'+_0x1e7e8d)[_0x921d('0x1f')](_0x141ab0);}return null;};}function patchUpdates(_0x48222b){return function(_0x3b84f8){try{jsonpatch[_0x921d('0x24')](_0x3b84f8,_0x48222b,!![]);}catch(_0x4b1e4a){return BPromise['reject'](_0x4b1e4a);}return _0x3b84f8[_0x921d('0x25')]();};}function saveUpdates(_0x51ee84,_0x1ec8fb){return function(_0x45833e){if(_0x45833e){return _0x45833e[_0x921d('0x26')](_0x51ee84)[_0x921d('0x27')](function(_0xfef3aa){return _0xfef3aa;});}return null;};}function removeEntity(_0xf63933,_0x3d8d01){return function(_0x1f2983){if(_0x1f2983){return _0x1f2983[_0x921d('0x28')]()[_0x921d('0x27')](function(){var _0x459208=_0x1f2983['get']({'plain':!![]});var _0x1facc5='CannedAnswers';return db[_0x921d('0x29')][_0x921d('0x28')]({'where':{'type':_0x1facc5,'resourceId':_0x459208['id']}})[_0x921d('0x27')](function(){return _0x1f2983;});})[_0x921d('0x27')](function(){_0xf63933[_0x921d('0x1d')](0xcc)[_0x921d('0x1e')]();});}};}function handleEntityNotFound(_0x471cf8,_0x2774ff){return function(_0x5b8f64){if(!_0x5b8f64){_0x471cf8['sendStatus'](0x194);}return _0x5b8f64;};}function handleError(_0x55fda7,_0x411894){_0x411894=_0x411894||0x1f4;return function(_0x3ff668){logger[_0x921d('0x2a')](_0x3ff668[_0x921d('0x2b')]);if(_0x3ff668[_0x921d('0x2c')]){delete _0x3ff668[_0x921d('0x2c')];}_0x55fda7[_0x921d('0x1d')](_0x411894)[_0x921d('0x2d')](_0x3ff668);};}exports[_0x921d('0x2e')]=function(_0xecaf05,_0x48ff95){var _0x492bc9={},_0xd718f9={},_0x501d00={'count':0x0,'rows':[]};var _0xfb1572=_[_0x921d('0x2f')](db[_0x921d('0x30')][_0x921d('0x31')],function(_0x5412f9){return{'name':_0x5412f9[_0x921d('0x32')],'type':_0x5412f9['type']['key']};});_0xd718f9['model']=_[_0x921d('0x2f')](_0xfb1572,_0x921d('0x2c'));_0xd718f9[_0x921d('0x33')]=_[_0x921d('0x34')](_0xecaf05['query']);_0xd718f9[_0x921d('0x35')]=_[_0x921d('0x36')](_0xd718f9[_0x921d('0x37')],_0xd718f9[_0x921d('0x33')]);_0x492bc9[_0x921d('0x38')]=_[_0x921d('0x36')](_0xd718f9[_0x921d('0x37')],qs[_0x921d('0x39')](_0xecaf05[_0x921d('0x33')]['fields']));_0x492bc9[_0x921d('0x38')]=_0x492bc9[_0x921d('0x38')][_0x921d('0x3a')]?_0x492bc9[_0x921d('0x38')]:_0xd718f9['model'];if(!_0xecaf05[_0x921d('0x33')][_0x921d('0x3b')]('nolimit')){_0x492bc9[_0x921d('0x21')]=qs[_0x921d('0x21')](_0xecaf05[_0x921d('0x33')][_0x921d('0x21')]);_0x492bc9[_0x921d('0x20')]=qs[_0x921d('0x20')](_0xecaf05[_0x921d('0x33')][_0x921d('0x20')]);}_0x492bc9[_0x921d('0x3c')]=qs['sort'](_0xecaf05[_0x921d('0x33')][_0x921d('0x3d')]);_0x492bc9[_0x921d('0x3e')]=qs['filters'](_[_0x921d('0x3f')](_0xecaf05[_0x921d('0x33')],_0xd718f9[_0x921d('0x35')]),_0xfb1572);if(_0xecaf05[_0x921d('0x33')][_0x921d('0x40')]){_0x492bc9[_0x921d('0x3e')]=_[_0x921d('0x41')](_0x492bc9[_0x921d('0x3e')],{'$or':[{'key':{'$like':'%'+_0xecaf05['query']['filter']+'%'}},{'value':{'$like':'%'+_0xecaf05['query'][_0x921d('0x40')]+'%'}}]});}_0x492bc9=_[_0x921d('0x41')]({},_0x492bc9,_0xecaf05[_0x921d('0x42')]);var _0x522651={'where':_0x492bc9[_0x921d('0x3e')]};return db['CannedAnswer'][_0x921d('0x23')](_0x522651)['then'](function(_0x483a60){_0x501d00[_0x921d('0x23')]=_0x483a60;if(_0xecaf05['query'][_0x921d('0x43')]){_0x492bc9[_0x921d('0x44')]=[{'all':!![]}];}return db[_0x921d('0x30')][_0x921d('0x45')](_0x492bc9);})[_0x921d('0x27')](function(_0xabb198){_0x501d00[_0x921d('0x46')]=_0xabb198;return _0x501d00;})['then'](respondWithFilteredResult(_0x48ff95,_0x492bc9))['catch'](handleError(_0x48ff95,null));};exports['show']=function(_0x55f1ad,_0xe7759c){var _0xf365c1={'raw':!![],'where':{'id':_0x55f1ad['params']['id']}},_0xd462b0={};_0xd462b0[_0x921d('0x37')]=_[_0x921d('0x34')](db[_0x921d('0x30')][_0x921d('0x31')]);_0xd462b0['query']=_[_0x921d('0x34')](_0x55f1ad['query']);_0xd462b0['filters']=_[_0x921d('0x36')](_0xd462b0[_0x921d('0x37')],_0xd462b0[_0x921d('0x33')]);_0xf365c1[_0x921d('0x38')]=_[_0x921d('0x36')](_0xd462b0['model'],qs['fields'](_0x55f1ad['query']['fields']));_0xf365c1['attributes']=_0xf365c1[_0x921d('0x38')][_0x921d('0x3a')]?_0xf365c1[_0x921d('0x38')]:_0xd462b0[_0x921d('0x37')];if(_0x55f1ad['query']['includeAll']){_0xf365c1[_0x921d('0x44')]=[{'all':!![]}];}_0xf365c1=_['merge']({},_0xf365c1,_0x55f1ad[_0x921d('0x42')]);return db[_0x921d('0x30')][_0x921d('0x47')](_0xf365c1)['then'](handleEntityNotFound(_0xe7759c,null))[_0x921d('0x27')](respondWithResult(_0xe7759c,null))[_0x921d('0x48')](handleError(_0xe7759c,null));};exports[_0x921d('0x26')]=function(_0x1e64f7,_0x4edd1c){if(_0x1e64f7[_0x921d('0x49')]['id']){delete _0x1e64f7[_0x921d('0x49')]['id'];}return db[_0x921d('0x30')][_0x921d('0x47')]({'where':{'id':_0x1e64f7[_0x921d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4edd1c,null))[_0x921d('0x27')](saveUpdates(_0x1e64f7[_0x921d('0x49')],null))['then'](respondWithResult(_0x4edd1c,null))[_0x921d('0x48')](handleError(_0x4edd1c,null));};exports[_0x921d('0x28')]=function(_0xf74c08,_0x12d796){return db[_0x921d('0x30')]['find']({'where':{'id':_0xf74c08[_0x921d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12d796,null))[_0x921d('0x27')](removeEntity(_0x12d796,null))[_0x921d('0x48')](handleError(_0x12d796,null));};exports[_0x921d('0x4b')]=function(_0x1d28b8,_0x4e32ff){var _0x139914={'key':_0x1d28b8['body'][_0x921d('0x4c')]};if(_0x1d28b8[_0x921d('0x49')][_0x921d('0x4d')]){_0x139914[_0x921d('0x4d')]=_0x1d28b8[_0x921d('0x49')]['MailAccountId'];}else if(_0x1d28b8[_0x921d('0x49')][_0x921d('0x4e')]){_0x139914['SmsAccountId']=_0x1d28b8[_0x921d('0x49')]['SmsAccountId'];}else if(_0x1d28b8[_0x921d('0x49')][_0x921d('0x4f')]){_0x139914[_0x921d('0x4f')]=_0x1d28b8['body'][_0x921d('0x4f')];}else if(_0x1d28b8[_0x921d('0x49')][_0x921d('0x50')]){_0x139914[_0x921d('0x50')]=_0x1d28b8[_0x921d('0x49')][_0x921d('0x50')];}return db[_0x921d('0x30')][_0x921d('0x47')]({'where':_0x139914})[_0x921d('0x27')](function(_0x31cf7f){if(_0x31cf7f){throw new db['Sequelize'][(_0x921d('0x51'))](_0x921d('0x52'));}return db[_0x921d('0x30')][_0x921d('0x4b')](_0x1d28b8[_0x921d('0x49')]);})['then'](function(_0x26438d){var _0x5a0dac=_0x1d28b8[_0x921d('0x53')][_0x921d('0x54')]({'plain':!![]});if(!_0x5a0dac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a0dac[_0x921d('0x55')]==='user'){var _0x249e41=_0x26438d[_0x921d('0x54')]({'plain':!![]});return db[_0x921d('0x56')][_0x921d('0x47')]({'where':{'name':'CannedAnswers','userProfileId':_0x5a0dac[_0x921d('0x57')]},'raw':!![]})[_0x921d('0x27')](function(_0x34d6a9){if(_0x34d6a9&&_0x34d6a9[_0x921d('0x58')]===0x0){return db[_0x921d('0x29')][_0x921d('0x4b')]({'name':_0x249e41['name'],'resourceId':_0x249e41['id'],'type':_0x34d6a9['name'],'sectionId':_0x34d6a9['id']},{})[_0x921d('0x27')](function(){return _0x26438d;});}else{return _0x26438d;}})[_0x921d('0x48')](function(_0x47e57b){logger[_0x921d('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47e57b);throw _0x47e57b;});}return _0x26438d;})['then'](respondWithResult(_0x4e32ff,0xc9))[_0x921d('0x48')](handleError(_0x4e32ff,null));};
\ No newline at end of file
+var _0x3d79=['SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','end','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','filters','pick','filter','where','merge','options','count','include','findAll','catch','params','keys','length','includeAll','find','body','create','MailAccountId'];(function(_0x15ee93,_0x62af92){var _0x48cc71=function(_0x36bb89){while(--_0x36bb89){_0x15ee93['push'](_0x15ee93['shift']());}};_0x48cc71(++_0x62af92);}(_0x3d79,0x186));var _0x93d7=function(_0x101d07,_0x1a9a15){_0x101d07=_0x101d07-0x0;var _0xdcca9d=_0x3d79[_0x101d07];return _0xdcca9d;};'use strict';var emlformat=require(_0x93d7('0x0'));var rimraf=require(_0x93d7('0x1'));var zipdir=require(_0x93d7('0x2'));var jsonpatch=require(_0x93d7('0x3'));var rp=require(_0x93d7('0x4'));var moment=require('moment');var BPromise=require(_0x93d7('0x5'));var Mustache=require(_0x93d7('0x6'));var util=require(_0x93d7('0x7'));var path=require(_0x93d7('0x8'));var sox=require('sox');var csv=require(_0x93d7('0x9'));var ejs=require(_0x93d7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x93d7('0xb'));var squel=require(_0x93d7('0xc'));var crypto=require('crypto');var jsforce=require(_0x93d7('0xd'));var deskjs=require(_0x93d7('0xe'));var toCsv=require(_0x93d7('0x9'));var querystring=require(_0x93d7('0xf'));var Papa=require(_0x93d7('0x10'));var Redis=require(_0x93d7('0x11'));var authService=require(_0x93d7('0x12'));var qs=require(_0x93d7('0x13'));var as=require(_0x93d7('0x14'));var hardwareService=require(_0x93d7('0x15'));var logger=require(_0x93d7('0x16'))(_0x93d7('0x17'));var utils=require(_0x93d7('0x18'));var config=require(_0x93d7('0x19'));var licenseUtil=require(_0x93d7('0x1a'));var db=require(_0x93d7('0x1b'))['db'];function respondWithStatusCode(_0x5b8cd2,_0x410201){_0x410201=_0x410201||0xcc;return function(_0xe67c1c){if(_0xe67c1c){return _0x5b8cd2[_0x93d7('0x1c')](_0x410201);}return _0x5b8cd2['status'](_0x410201)['end']();};}function respondWithResult(_0x414953,_0x5f11ba){_0x5f11ba=_0x5f11ba||0xc8;return function(_0xd77f2c){if(_0xd77f2c){return _0x414953[_0x93d7('0x1d')](_0x5f11ba)[_0x93d7('0x1e')](_0xd77f2c);}};}function respondWithFilteredResult(_0x268cca,_0x416820){return function(_0x2debcb){if(_0x2debcb){var _0x11caee=typeof _0x416820['offset']==='undefined'&&typeof _0x416820[_0x93d7('0x1f')]===_0x93d7('0x20');var _0x3e7003=_0x2debcb['count'];var _0x2b0a34=_0x11caee?0x0:_0x416820[_0x93d7('0x21')];var _0x4b3c86=_0x11caee?_0x2debcb['count']:_0x416820[_0x93d7('0x21')]+_0x416820[_0x93d7('0x1f')];var _0x53b120;if(_0x4b3c86>=_0x3e7003){_0x4b3c86=_0x3e7003;_0x53b120=0xc8;}else{_0x53b120=0xce;}_0x268cca[_0x93d7('0x1d')](_0x53b120);return _0x268cca[_0x93d7('0x22')](_0x93d7('0x23'),_0x2b0a34+'-'+_0x4b3c86+'/'+_0x3e7003)[_0x93d7('0x1e')](_0x2debcb);}return null;};}function patchUpdates(_0x5d5f41){return function(_0x486aad){try{jsonpatch[_0x93d7('0x24')](_0x486aad,_0x5d5f41,!![]);}catch(_0x329d98){return BPromise[_0x93d7('0x25')](_0x329d98);}return _0x486aad[_0x93d7('0x26')]();};}function saveUpdates(_0x4fd91b,_0x40df40){return function(_0x1ab8a1){if(_0x1ab8a1){return _0x1ab8a1[_0x93d7('0x27')](_0x4fd91b)['then'](function(_0x3d15f2){return _0x3d15f2;});}return null;};}function removeEntity(_0x2c581b,_0x2ddb05){return function(_0x2e94db){if(_0x2e94db){return _0x2e94db[_0x93d7('0x28')]()[_0x93d7('0x29')](function(){var _0x1a9feb=_0x2e94db[_0x93d7('0x2a')]({'plain':!![]});var _0x4dbccd='CannedAnswers';return db['UserProfileResource']['destroy']({'where':{'type':_0x4dbccd,'resourceId':_0x1a9feb['id']}})[_0x93d7('0x29')](function(){return _0x2e94db;});})[_0x93d7('0x29')](function(){_0x2c581b[_0x93d7('0x1d')](0xcc)[_0x93d7('0x2b')]();});}};}function handleEntityNotFound(_0x1355ab,_0x160526){return function(_0x3b4212){if(!_0x3b4212){_0x1355ab[_0x93d7('0x1c')](0x194);}return _0x3b4212;};}function handleError(_0x571dfc,_0x55c41d){_0x55c41d=_0x55c41d||0x1f4;return function(_0x3f7ead){logger[_0x93d7('0x2c')](_0x3f7ead[_0x93d7('0x2d')]);if(_0x3f7ead[_0x93d7('0x2e')]){delete _0x3f7ead[_0x93d7('0x2e')];}_0x571dfc[_0x93d7('0x1d')](_0x55c41d)[_0x93d7('0x2f')](_0x3f7ead);};}exports[_0x93d7('0x30')]=function(_0xe6476,_0x3c45d8){var _0x43c562={},_0xa23382={},_0x4220bb={'count':0x0,'rows':[]};var _0x1bfe70=_['map'](db[_0x93d7('0x31')][_0x93d7('0x32')],function(_0x29c16e){return{'name':_0x29c16e[_0x93d7('0x33')],'type':_0x29c16e[_0x93d7('0x34')][_0x93d7('0x35')]};});_0xa23382[_0x93d7('0x36')]=_[_0x93d7('0x37')](_0x1bfe70,'name');_0xa23382['query']=_['keys'](_0xe6476[_0x93d7('0x38')]);_0xa23382['filters']=_[_0x93d7('0x39')](_0xa23382[_0x93d7('0x36')],_0xa23382[_0x93d7('0x38')]);_0x43c562[_0x93d7('0x3a')]=_['intersection'](_0xa23382['model'],qs[_0x93d7('0x3b')](_0xe6476[_0x93d7('0x38')][_0x93d7('0x3b')]));_0x43c562[_0x93d7('0x3a')]=_0x43c562['attributes']['length']?_0x43c562[_0x93d7('0x3a')]:_0xa23382[_0x93d7('0x36')];if(!_0xe6476[_0x93d7('0x38')][_0x93d7('0x3c')](_0x93d7('0x3d'))){_0x43c562[_0x93d7('0x1f')]=qs['limit'](_0xe6476[_0x93d7('0x38')][_0x93d7('0x1f')]);_0x43c562[_0x93d7('0x21')]=qs[_0x93d7('0x21')](_0xe6476[_0x93d7('0x38')][_0x93d7('0x21')]);}_0x43c562['order']=qs['sort'](_0xe6476[_0x93d7('0x38')]['sort']);_0x43c562['where']=qs[_0x93d7('0x3e')](_[_0x93d7('0x3f')](_0xe6476['query'],_0xa23382[_0x93d7('0x3e')]),_0x1bfe70);if(_0xe6476[_0x93d7('0x38')][_0x93d7('0x40')]){_0x43c562[_0x93d7('0x41')]=_['merge'](_0x43c562[_0x93d7('0x41')],{'$or':[{'key':{'$like':'%'+_0xe6476[_0x93d7('0x38')][_0x93d7('0x40')]+'%'}},{'value':{'$like':'%'+_0xe6476[_0x93d7('0x38')][_0x93d7('0x40')]+'%'}}]});}_0x43c562=_[_0x93d7('0x42')]({},_0x43c562,_0xe6476[_0x93d7('0x43')]);var _0x1ac4c6={'where':_0x43c562[_0x93d7('0x41')]};return db[_0x93d7('0x31')][_0x93d7('0x44')](_0x1ac4c6)['then'](function(_0x52f124){_0x4220bb['count']=_0x52f124;if(_0xe6476[_0x93d7('0x38')]['includeAll']){_0x43c562[_0x93d7('0x45')]=[{'all':!![]}];}return db[_0x93d7('0x31')][_0x93d7('0x46')](_0x43c562);})['then'](function(_0x1b7137){_0x4220bb['rows']=_0x1b7137;return _0x4220bb;})['then'](respondWithFilteredResult(_0x3c45d8,_0x43c562))[_0x93d7('0x47')](handleError(_0x3c45d8,null));};exports['show']=function(_0x5b55cb,_0x1387fd){var _0x5c2b6f={'raw':!![],'where':{'id':_0x5b55cb[_0x93d7('0x48')]['id']}},_0x5b5da8={};_0x5b5da8[_0x93d7('0x36')]=_[_0x93d7('0x49')](db[_0x93d7('0x31')][_0x93d7('0x32')]);_0x5b5da8[_0x93d7('0x38')]=_['keys'](_0x5b55cb[_0x93d7('0x38')]);_0x5b5da8[_0x93d7('0x3e')]=_['intersection'](_0x5b5da8['model'],_0x5b5da8['query']);_0x5c2b6f['attributes']=_[_0x93d7('0x39')](_0x5b5da8[_0x93d7('0x36')],qs[_0x93d7('0x3b')](_0x5b55cb[_0x93d7('0x38')][_0x93d7('0x3b')]));_0x5c2b6f[_0x93d7('0x3a')]=_0x5c2b6f[_0x93d7('0x3a')][_0x93d7('0x4a')]?_0x5c2b6f[_0x93d7('0x3a')]:_0x5b5da8[_0x93d7('0x36')];if(_0x5b55cb[_0x93d7('0x38')][_0x93d7('0x4b')]){_0x5c2b6f['include']=[{'all':!![]}];}_0x5c2b6f=_[_0x93d7('0x42')]({},_0x5c2b6f,_0x5b55cb[_0x93d7('0x43')]);return db[_0x93d7('0x31')][_0x93d7('0x4c')](_0x5c2b6f)[_0x93d7('0x29')](handleEntityNotFound(_0x1387fd,null))[_0x93d7('0x29')](respondWithResult(_0x1387fd,null))[_0x93d7('0x47')](handleError(_0x1387fd,null));};exports['update']=function(_0x3a00ef,_0xdd7c6a){if(_0x3a00ef['body']['id']){delete _0x3a00ef['body']['id'];}return db[_0x93d7('0x31')][_0x93d7('0x4c')]({'where':{'id':_0x3a00ef[_0x93d7('0x48')]['id']}})[_0x93d7('0x29')](handleEntityNotFound(_0xdd7c6a,null))[_0x93d7('0x29')](saveUpdates(_0x3a00ef[_0x93d7('0x4d')],null))[_0x93d7('0x29')](respondWithResult(_0xdd7c6a,null))[_0x93d7('0x47')](handleError(_0xdd7c6a,null));};exports['destroy']=function(_0x1ad59f,_0x963579){return db[_0x93d7('0x31')][_0x93d7('0x4c')]({'where':{'id':_0x1ad59f[_0x93d7('0x48')]['id']}})['then'](handleEntityNotFound(_0x963579,null))[_0x93d7('0x29')](removeEntity(_0x963579,null))['catch'](handleError(_0x963579,null));};exports[_0x93d7('0x4e')]=function(_0x43ac54,_0x2f3691){var _0x2d831a={'key':_0x43ac54[_0x93d7('0x4d')][_0x93d7('0x35')]};if(_0x43ac54[_0x93d7('0x4d')][_0x93d7('0x4f')]){_0x2d831a[_0x93d7('0x4f')]=_0x43ac54[_0x93d7('0x4d')][_0x93d7('0x4f')];}else if(_0x43ac54[_0x93d7('0x4d')]['SmsAccountId']){_0x2d831a[_0x93d7('0x50')]=_0x43ac54['body']['SmsAccountId'];}else if(_0x43ac54['body']['OpenchannelAccountId']){_0x2d831a[_0x93d7('0x51')]=_0x43ac54[_0x93d7('0x4d')][_0x93d7('0x51')];}else if(_0x43ac54[_0x93d7('0x4d')][_0x93d7('0x52')]){_0x2d831a['ChatWebsiteId']=_0x43ac54['body'][_0x93d7('0x52')];}return db[_0x93d7('0x31')][_0x93d7('0x4c')]({'where':_0x2d831a})['then'](function(_0x436c2f){if(_0x436c2f){throw new db[(_0x93d7('0x53'))]['ValidationError'](_0x93d7('0x54'));}return db['CannedAnswer']['create'](_0x43ac54['body']);})[_0x93d7('0x29')](function(_0xc15d77){var _0x2107c3=_0x43ac54[_0x93d7('0x55')][_0x93d7('0x2a')]({'plain':!![]});if(!_0x2107c3)throw new Error(_0x93d7('0x56'));if(_0x2107c3[_0x93d7('0x57')]===_0x93d7('0x55')){var _0x51e8b6=_0xc15d77[_0x93d7('0x2a')]({'plain':!![]});return db[_0x93d7('0x58')][_0x93d7('0x4c')]({'where':{'name':_0x93d7('0x59'),'userProfileId':_0x2107c3[_0x93d7('0x5a')]},'raw':!![]})['then'](function(_0x27518a){if(_0x27518a&&_0x27518a[_0x93d7('0x5b')]===0x0){return db[_0x93d7('0x5c')][_0x93d7('0x4e')]({'name':_0x51e8b6[_0x93d7('0x2e')],'resourceId':_0x51e8b6['id'],'type':_0x27518a[_0x93d7('0x2e')],'sectionId':_0x27518a['id']},{})[_0x93d7('0x29')](function(){return _0xc15d77;});}else{return _0xc15d77;}})[_0x93d7('0x47')](function(_0x1a6d92){logger[_0x93d7('0x2c')](_0x93d7('0x5d'),_0x1a6d92);throw _0x1a6d92;});}return _0xc15d77;})[_0x93d7('0x29')](respondWithResult(_0x2f3691,0xc9))[_0x93d7('0x47')](handleError(_0x2f3691,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index d52eb41..209500f 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 _0xc366=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./cannedAnswer.attributes','CannedAnswer','tools_canned_answers'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc366,0x1c5));var _0x6c36=function(_0x4fe2dc,_0x2a4d5d){_0x4fe2dc=_0x4fe2dc-0x0;var _0xac84b6=_0xc366[_0x4fe2dc];return _0xac84b6;};'use strict';var _=require(_0x6c36('0x0'));var util=require(_0x6c36('0x1'));var logger=require(_0x6c36('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6c36('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6c36('0x4'));var config=require(_0x6c36('0x5'));var attributes=require(_0x6c36('0x6'));module['exports']=function(_0x24f233,_0x5d1d5e){return _0x24f233['define'](_0x6c36('0x7'),attributes,{'tableName':_0x6c36('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6c36('0x9'),'collate':_0x6c36('0xa')});};
\ No newline at end of file
+var _0x96f8=['util','api','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x93a6ee,_0x253344){var _0xb5ee31=function(_0x41cc23){while(--_0x41cc23){_0x93a6ee['push'](_0x93a6ee['shift']());}};_0xb5ee31(++_0x253344);}(_0x96f8,0x1db));var _0x896f=function(_0x44b68f,_0x5313e9){_0x44b68f=_0x44b68f-0x0;var _0x4ee6b8=_0x96f8[_0x44b68f];return _0x4ee6b8;};'use strict';var _=require(_0x896f('0x0'));var util=require(_0x896f('0x1'));var logger=require('../../config/logger')(_0x896f('0x2'));var moment=require('moment');var BPromise=require(_0x896f('0x3'));var rp=require(_0x896f('0x4'));var fs=require('fs');var path=require(_0x896f('0x5'));var rimraf=require('rimraf');var config=require(_0x896f('0x6'));var attributes=require(_0x896f('0x7'));module[_0x896f('0x8')]=function(_0x465f84,_0x453273){return _0x465f84[_0x896f('0x9')](_0x896f('0xa'),attributes,{'tableName':_0x896f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x896f('0xc'),'collate':_0x896f('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index a2a491c..e9727aa 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(_0x20f1bc,_0x5d1517){var _0x15cef1=function(_0x926a9d){while(--_0x926a9d){_0x20f1bc['push'](_0x20f1bc['shift']());}};_0x15cef1(++_0x5d1517);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x50222c,_0x139e18){var _0x2b01fd=function(_0x2a2cd4){while(--_0x2a2cd4){_0x50222c['push'](_0x50222c['shift']());}};_0x2b01fd(++_0x139e18);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 15bbaac..97a17fa 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 _0xbc78=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','post','put','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x47d256,_0x384f2d){var _0x40c53f=function(_0xca0b6f){while(--_0xca0b6f){_0x47d256['push'](_0x47d256['shift']());}};_0x40c53f(++_0x384f2d);}(_0xbc78,0x1ed));var _0x8bc7=function(_0xfb5548,_0xc3760b){_0xfb5548=_0xfb5548-0x0;var _0x2cbe6a=_0xbc78[_0xfb5548];return _0x2cbe6a;};'use strict';var multer=require('multer');var util=require(_0x8bc7('0x0'));var path=require(_0x8bc7('0x1'));var timeout=require(_0x8bc7('0x2'));var express=require(_0x8bc7('0x3'));var router=express[_0x8bc7('0x4')]();var fs_extra=require(_0x8bc7('0x5'));var auth=require(_0x8bc7('0x6'));var interaction=require(_0x8bc7('0x7'));var config=require(_0x8bc7('0x8'));var controller=require(_0x8bc7('0x9'));router[_0x8bc7('0xa')]('/',auth[_0x8bc7('0xb')](),controller[_0x8bc7('0xc')]);router['get']('/:id',auth[_0x8bc7('0xb')](),controller[_0x8bc7('0xd')]);router[_0x8bc7('0xe')]('/',auth[_0x8bc7('0xb')](),controller['create']);router[_0x8bc7('0xf')](_0x8bc7('0x10'),auth[_0x8bc7('0xb')](),controller['update']);router[_0x8bc7('0x11')]('/:id',auth[_0x8bc7('0xb')](),controller[_0x8bc7('0x12')]);module[_0x8bc7('0x13')]=router;
\ No newline at end of file
+var _0x4d23=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','index','get','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','util','path'];(function(_0x57d7aa,_0x44a62f){var _0xe6f3f2=function(_0x25e1a6){while(--_0x25e1a6){_0x57d7aa['push'](_0x57d7aa['shift']());}};_0xe6f3f2(++_0x44a62f);}(_0x4d23,0x82));var _0x34d2=function(_0xd985de,_0x1a704a){_0xd985de=_0xd985de-0x0;var _0x1d9e79=_0x4d23[_0xd985de];return _0x1d9e79;};'use strict';var multer=require('multer');var util=require(_0x34d2('0x0'));var path=require(_0x34d2('0x1'));var timeout=require(_0x34d2('0x2'));var express=require(_0x34d2('0x3'));var router=express[_0x34d2('0x4')]();var fs_extra=require(_0x34d2('0x5'));var auth=require(_0x34d2('0x6'));var interaction=require(_0x34d2('0x7'));var config=require(_0x34d2('0x8'));var controller=require(_0x34d2('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x34d2('0xa')]);router[_0x34d2('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x34d2('0xc')]);router[_0x34d2('0xd')]('/',auth[_0x34d2('0xe')](),controller[_0x34d2('0xf')]);router[_0x34d2('0x10')](_0x34d2('0x11'),auth[_0x34d2('0xe')](),controller[_0x34d2('0x12')]);router[_0x34d2('0x13')]('/:id',auth[_0x34d2('0xe')](),controller[_0x34d2('0x14')]);module[_0x34d2('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index a2fd659..9222921 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 _0x57f8=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x3b24f8,_0x3dc308){var _0x3e8327=function(_0xbadb7a){while(--_0xbadb7a){_0x3b24f8['push'](_0x3b24f8['shift']());}};_0x3e8327(++_0x3dc308);}(_0x57f8,0x198));var _0x857f=function(_0x304e0e,_0x2654a3){_0x304e0e=_0x304e0e-0x0;var _0x4449c8=_0x57f8[_0x304e0e];return _0x4449c8;};'use strict';var Sequelize=require('sequelize');module[_0x857f('0x0')]={'calldate':{'type':Sequelize[_0x857f('0x1')],'allowNull':![],'defaultValue':_0x857f('0x2')},'clid':{'type':Sequelize[_0x857f('0x3')]},'src':{'type':Sequelize[_0x857f('0x3')]},'dst':{'type':Sequelize[_0x857f('0x3')]},'dcontext':{'type':Sequelize[_0x857f('0x3')]},'channel':{'type':Sequelize[_0x857f('0x3')]},'dstchannel':{'type':Sequelize[_0x857f('0x3')]},'lastapp':{'type':Sequelize[_0x857f('0x3')]},'lastdata':{'type':Sequelize[_0x857f('0x3')]},'duration':{'type':Sequelize[_0x857f('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x857f('0x3')]},'amaflags':{'type':Sequelize[_0x857f('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x857f('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x857f('0x3')]},'linkedid':{'type':Sequelize[_0x857f('0x3')]},'sequence':{'type':Sequelize[_0x857f('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x857f('0x3')]},'tag':{'type':Sequelize[_0x857f('0x3')]}};
\ No newline at end of file
+var _0x117d=['STRING','INTEGER','sequelize','exports','DATE'];(function(_0x52538f,_0x203635){var _0x12d71b=function(_0x10486b){while(--_0x10486b){_0x52538f['push'](_0x52538f['shift']());}};_0x12d71b(++_0x203635);}(_0x117d,0xac));var _0xd117=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x117d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xd117('0x0'));module[_0xd117('0x1')]={'calldate':{'type':Sequelize[_0xd117('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xd117('0x3')]},'src':{'type':Sequelize[_0xd117('0x3')]},'dst':{'type':Sequelize[_0xd117('0x3')]},'dcontext':{'type':Sequelize[_0xd117('0x3')]},'channel':{'type':Sequelize[_0xd117('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xd117('0x3')]},'lastdata':{'type':Sequelize[_0xd117('0x3')]},'duration':{'type':Sequelize[_0xd117('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd117('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd117('0x3')]},'userfield':{'type':Sequelize[_0xd117('0x3')]},'uniqueid':{'type':Sequelize[_0xd117('0x3')]},'linkedid':{'type':Sequelize[_0xd117('0x3')]},'sequence':{'type':Sequelize[_0xd117('0x3')]},'peeraccount':{'type':Sequelize[_0xd117('0x3')]},'type':{'type':Sequelize[_0xd117('0x3')]},'tag':{'type':Sequelize[_0xd117('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index ca1a40a..1632751 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 _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','Cdr','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x55ca,0x126));var _0xa55c=function(_0x38080e,_0x95512d){_0x38080e=_0x38080e-0x0;var _0x4e4c87=_0x55ca[_0x38080e];return _0x4e4c87;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['Cdr'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));};
\ No newline at end of file
+var _0x6c32=['name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','save','update','destroy','then','error'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x26c3('0x0'));var rimraf=require(_0x26c3('0x1'));var zipdir=require(_0x26c3('0x2'));var jsonpatch=require(_0x26c3('0x3'));var rp=require(_0x26c3('0x4'));var moment=require(_0x26c3('0x5'));var BPromise=require(_0x26c3('0x6'));var Mustache=require(_0x26c3('0x7'));var util=require(_0x26c3('0x8'));var path=require('path');var sox=require(_0x26c3('0x9'));var csv=require(_0x26c3('0xa'));var ejs=require(_0x26c3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x26c3('0xc'));var squel=require('squel');var crypto=require(_0x26c3('0xd'));var jsforce=require(_0x26c3('0xe'));var deskjs=require(_0x26c3('0xf'));var toCsv=require(_0x26c3('0xa'));var querystring=require(_0x26c3('0x10'));var Papa=require(_0x26c3('0x11'));var Redis=require(_0x26c3('0x12'));var authService=require(_0x26c3('0x13'));var qs=require(_0x26c3('0x14'));var as=require(_0x26c3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x26c3('0x16'));var licenseUtil=require(_0x26c3('0x17'));var db=require(_0x26c3('0x18'))['db'];function respondWithStatusCode(_0x457fc9,_0x4b8d92){_0x4b8d92=_0x4b8d92||0xcc;return function(_0x4c7b94){if(_0x4c7b94){return _0x457fc9[_0x26c3('0x19')](_0x4b8d92);}return _0x457fc9[_0x26c3('0x1a')](_0x4b8d92)[_0x26c3('0x1b')]();};}function respondWithResult(_0x3cd3c7,_0x17c399){_0x17c399=_0x17c399||0xc8;return function(_0x568d0b){if(_0x568d0b){return _0x3cd3c7['status'](_0x17c399)[_0x26c3('0x1c')](_0x568d0b);}};}function respondWithFilteredResult(_0xc14c69,_0x4f4256){return function(_0x4ed7c1){if(_0x4ed7c1){var _0x124cb3=typeof _0x4f4256['offset']===_0x26c3('0x1d')&&typeof _0x4f4256['limit']==='undefined';var _0x3931d5=_0x4ed7c1['count'];var _0x38fe17=_0x124cb3?0x0:_0x4f4256['offset'];var _0x170039=_0x124cb3?_0x4ed7c1[_0x26c3('0x1e')]:_0x4f4256[_0x26c3('0x1f')]+_0x4f4256[_0x26c3('0x20')];var _0x20317d;if(_0x170039>=_0x3931d5){_0x170039=_0x3931d5;_0x20317d=0xc8;}else{_0x20317d=0xce;}_0xc14c69['status'](_0x20317d);return _0xc14c69['set'](_0x26c3('0x21'),_0x38fe17+'-'+_0x170039+'/'+_0x3931d5)[_0x26c3('0x1c')](_0x4ed7c1);}return null;};}function patchUpdates(_0x480b76){return function(_0x5344e7){try{jsonpatch[_0x26c3('0x22')](_0x5344e7,_0x480b76,!![]);}catch(_0x5c2f7d){return BPromise['reject'](_0x5c2f7d);}return _0x5344e7[_0x26c3('0x23')]();};}function saveUpdates(_0x4eb863,_0x21034d){return function(_0x4a76b5){if(_0x4a76b5){return _0x4a76b5[_0x26c3('0x24')](_0x4eb863)['then'](function(_0x449548){return _0x449548;});}return null;};}function removeEntity(_0x146b69,_0x2f1648){return function(_0xdc0f2c){if(_0xdc0f2c){return _0xdc0f2c[_0x26c3('0x25')]()[_0x26c3('0x26')](function(){_0x146b69[_0x26c3('0x1a')](0xcc)[_0x26c3('0x1b')]();});}};}function handleEntityNotFound(_0x85a057,_0x3f6a18){return function(_0x52dae1){if(!_0x52dae1){_0x85a057[_0x26c3('0x19')](0x194);}return _0x52dae1;};}function handleError(_0x4c7696,_0x50d85e){_0x50d85e=_0x50d85e||0x1f4;return function(_0x44b4f8){logger[_0x26c3('0x27')](_0x44b4f8['stack']);if(_0x44b4f8[_0x26c3('0x28')]){delete _0x44b4f8['name'];}_0x4c7696[_0x26c3('0x1a')](_0x50d85e)[_0x26c3('0x29')](_0x44b4f8);};}exports[_0x26c3('0x2a')]=function(_0x130fcc,_0x3dbda5){var _0x50cd11={},_0x1d3331={},_0x27f556={'count':0x0,'rows':[]};var _0xebb766=_[_0x26c3('0x2b')](db[_0x26c3('0x2c')][_0x26c3('0x2d')],function(_0x5557b8){return{'name':_0x5557b8[_0x26c3('0x2e')],'type':_0x5557b8[_0x26c3('0x2f')][_0x26c3('0x30')]};});_0x1d3331['model']=_[_0x26c3('0x2b')](_0xebb766,_0x26c3('0x28'));_0x1d3331[_0x26c3('0x31')]=_[_0x26c3('0x32')](_0x130fcc[_0x26c3('0x31')]);_0x1d3331[_0x26c3('0x33')]=_['intersection'](_0x1d3331[_0x26c3('0x34')],_0x1d3331[_0x26c3('0x31')]);_0x50cd11['attributes']=_['intersection'](_0x1d3331['model'],qs['fields'](_0x130fcc['query'][_0x26c3('0x35')]));_0x50cd11[_0x26c3('0x36')]=_0x50cd11['attributes'][_0x26c3('0x37')]?_0x50cd11[_0x26c3('0x36')]:_0x1d3331['model'];if(!_0x130fcc['query'][_0x26c3('0x38')]('nolimit')){_0x50cd11[_0x26c3('0x20')]=qs['limit'](_0x130fcc[_0x26c3('0x31')][_0x26c3('0x20')]);_0x50cd11[_0x26c3('0x1f')]=qs[_0x26c3('0x1f')](_0x130fcc[_0x26c3('0x31')]['offset']);}_0x50cd11[_0x26c3('0x39')]=qs[_0x26c3('0x3a')](_0x130fcc[_0x26c3('0x31')][_0x26c3('0x3a')]);_0x50cd11[_0x26c3('0x3b')]=qs[_0x26c3('0x33')](_['pick'](_0x130fcc['query'],_0x1d3331[_0x26c3('0x33')]),_0xebb766);if(_0x130fcc[_0x26c3('0x31')][_0x26c3('0x3c')]){_0x50cd11[_0x26c3('0x3b')]=_[_0x26c3('0x3d')](_0x50cd11['where'],{'$or':_['map'](_0xebb766,function(_0x4c2df1){if(_0x4c2df1[_0x26c3('0x2f')]!==_0x26c3('0x3e')){var _0x832ef2={};_0x832ef2[_0x4c2df1[_0x26c3('0x28')]]={'$like':'%'+_0x130fcc[_0x26c3('0x31')]['filter']+'%'};return _0x832ef2;}})});}_0x50cd11=_['merge']({},_0x50cd11,_0x130fcc[_0x26c3('0x3f')]);var _0x16e680={'where':_0x50cd11[_0x26c3('0x3b')]};return db[_0x26c3('0x2c')]['count'](_0x16e680)[_0x26c3('0x26')](function(_0x2b4bdf){_0x27f556[_0x26c3('0x1e')]=_0x2b4bdf;if(_0x130fcc[_0x26c3('0x31')][_0x26c3('0x40')]){_0x50cd11[_0x26c3('0x41')]=[{'all':!![]}];}return db[_0x26c3('0x2c')][_0x26c3('0x42')](_0x50cd11);})[_0x26c3('0x26')](function(_0x1c0d6c){_0x27f556[_0x26c3('0x43')]=_0x1c0d6c;return _0x27f556;})[_0x26c3('0x26')](respondWithFilteredResult(_0x3dbda5,_0x50cd11))[_0x26c3('0x44')](handleError(_0x3dbda5,null));};exports['show']=function(_0x2f775b,_0x2ecb43){var _0xfb596a={'raw':!![],'where':{'id':_0x2f775b[_0x26c3('0x45')]['id']}},_0x46ebfb={};_0x46ebfb[_0x26c3('0x34')]=_['keys'](db[_0x26c3('0x2c')]['rawAttributes']);_0x46ebfb[_0x26c3('0x31')]=_['keys'](_0x2f775b[_0x26c3('0x31')]);_0x46ebfb[_0x26c3('0x33')]=_['intersection'](_0x46ebfb[_0x26c3('0x34')],_0x46ebfb[_0x26c3('0x31')]);_0xfb596a[_0x26c3('0x36')]=_[_0x26c3('0x46')](_0x46ebfb[_0x26c3('0x34')],qs['fields'](_0x2f775b[_0x26c3('0x31')]['fields']));_0xfb596a[_0x26c3('0x36')]=_0xfb596a['attributes']['length']?_0xfb596a[_0x26c3('0x36')]:_0x46ebfb[_0x26c3('0x34')];if(_0x2f775b[_0x26c3('0x31')]['includeAll']){_0xfb596a[_0x26c3('0x41')]=[{'all':!![]}];}_0xfb596a=_[_0x26c3('0x3d')]({},_0xfb596a,_0x2f775b[_0x26c3('0x3f')]);return db[_0x26c3('0x2c')][_0x26c3('0x47')](_0xfb596a)[_0x26c3('0x26')](handleEntityNotFound(_0x2ecb43,null))['then'](respondWithResult(_0x2ecb43,null))[_0x26c3('0x44')](handleError(_0x2ecb43,null));};exports[_0x26c3('0x48')]=function(_0x378982,_0x133cf7){return db['Cdr'][_0x26c3('0x48')](_0x378982[_0x26c3('0x49')],{})['then'](respondWithResult(_0x133cf7,0xc9))[_0x26c3('0x44')](handleError(_0x133cf7,null));};exports[_0x26c3('0x24')]=function(_0x522fe2,_0x4566ab){if(_0x522fe2['body']['id']){delete _0x522fe2[_0x26c3('0x49')]['id'];}return db[_0x26c3('0x2c')][_0x26c3('0x47')]({'where':{'id':_0x522fe2[_0x26c3('0x45')]['id']}})[_0x26c3('0x26')](handleEntityNotFound(_0x4566ab,null))[_0x26c3('0x26')](saveUpdates(_0x522fe2[_0x26c3('0x49')],null))['then'](respondWithResult(_0x4566ab,null))[_0x26c3('0x44')](handleError(_0x4566ab,null));};exports['destroy']=function(_0x4ada42,_0x3b3e31){return db[_0x26c3('0x2c')][_0x26c3('0x47')]({'where':{'id':_0x4ada42['params']['id']}})['then'](handleEntityNotFound(_0x3b3e31,null))[_0x26c3('0x26')](removeEntity(_0x3b3e31,null))[_0x26c3('0x44')](handleError(_0x3b3e31,null));};exports[_0x26c3('0x4a')]=function(_0x4d1ec7,_0x446453){return db[_0x26c3('0x2c')][_0x26c3('0x4a')]()['then'](respondWithResult(_0x446453,null))[_0x26c3('0x44')](handleError(_0x446453,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index a9ea052..dd55244 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x41920b,_0x213cb6){var _0x5b3099=function(_0x3c2653){while(--_0x3c2653){_0x41920b['push'](_0x41920b['shift']());}};_0x5b3099(++_0x213cb6);}(_0x7a54,0x106));var _0x47a5=function(_0xd63678,_0x38f3c3){_0xd63678=_0xd63678-0x0;var _0x41c3cc=_0x7a54[_0xd63678];return _0x41c3cc;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x581f97,_0x122d3f){var _0xd67f57=function(_0x305f8d){while(--_0x305f8d){_0x581f97['push'](_0x581f97['shift']());}};_0xd67f57(++_0x122d3f);}(_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
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 08d5cde..8e998c7 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 _0x7745=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x144c0c,_0x113cfe){var _0x436221=function(_0x231dd7){while(--_0x231dd7){_0x144c0c['push'](_0x144c0c['shift']());}};_0x436221(++_0x113cfe);}(_0x7745,0x15a));var _0x5774=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0x7745[_0x25248b];return _0x509939;};'use strict';var _=require(_0x5774('0x0'));var util=require(_0x5774('0x1'));var moment=require(_0x5774('0x2'));var BPromise=require(_0x5774('0x3'));var rs=require(_0x5774('0x4'));var fs=require('fs');var Redis=require(_0x5774('0x5'));var db=require(_0x5774('0x6'))['db'];var utils=require(_0x5774('0x7'));var logger=require(_0x5774('0x8'))(_0x5774('0x9'));var config=require(_0x5774('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5774('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5151a8,_0x333bad,_0x500341){return new BPromise(function(_0x4f759e,_0x12c5ff){return client['request'](_0x5151a8,_0x500341)[_0x5774('0xc')](function(_0x3726e1){logger[_0x5774('0xd')](_0x5774('0xe'),_0x333bad,_0x5774('0xf'));logger[_0x5774('0x10')](_0x5774('0x11'),_0x333bad,_0x5774('0xf'),JSON['stringify'](_0x3726e1));if(_0x3726e1[_0x5774('0x12')]){if(_0x3726e1['error'][_0x5774('0x13')]===0x1f4){logger[_0x5774('0x12')](_0x5774('0xe'),_0x333bad,_0x3726e1[_0x5774('0x12')][_0x5774('0x14')]);return _0x12c5ff(_0x3726e1['error'][_0x5774('0x14')]);}logger[_0x5774('0x12')](_0x5774('0xe'),_0x333bad,_0x3726e1[_0x5774('0x12')][_0x5774('0x14')]);return _0x4f759e(_0x3726e1[_0x5774('0x12')][_0x5774('0x14')]);}else{logger[_0x5774('0xd')](_0x5774('0xe'),_0x333bad,_0x5774('0xf'));_0x4f759e(_0x3726e1[_0x5774('0x15')]['message']);}})[_0x5774('0x16')](function(_0x4a0a32){logger[_0x5774('0x12')]('Cdr,\x20%s,\x20%s',_0x333bad,_0x4a0a32);_0x12c5ff(_0x4a0a32);});});}
\ No newline at end of file
+var _0x9e65=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xeba6a7,_0x587d8c){var _0x4f52a6=function(_0x371b2d){while(--_0x371b2d){_0xeba6a7['push'](_0xeba6a7['shift']());}};_0x4f52a6(++_0x587d8c);}(_0x9e65,0x170));var _0x59e6=function(_0x50c00a,_0x2afdb8){_0x50c00a=_0x50c00a-0x0;var _0x37e299=_0x9e65[_0x50c00a];return _0x37e299;};'use strict';var _=require(_0x59e6('0x0'));var util=require('util');var moment=require(_0x59e6('0x1'));var BPromise=require('bluebird');var rs=require(_0x59e6('0x2'));var fs=require('fs');var Redis=require(_0x59e6('0x3'));var db=require(_0x59e6('0x4'))['db'];var utils=require(_0x59e6('0x5'));var logger=require(_0x59e6('0x6'))(_0x59e6('0x7'));var config=require(_0x59e6('0x8'));var jayson=require(_0x59e6('0x9'));var client=jayson[_0x59e6('0xa')][_0x59e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b0c2c,_0x36e922,_0x24ce33){return new BPromise(function(_0x57525a,_0x495791){return client[_0x59e6('0xc')](_0x4b0c2c,_0x24ce33)[_0x59e6('0xd')](function(_0x33b616){logger[_0x59e6('0xe')](_0x59e6('0xf'),_0x36e922,_0x59e6('0x10'));logger[_0x59e6('0x11')]('Cdr,\x20%s,\x20%s,\x20%s',_0x36e922,_0x59e6('0x10'),JSON[_0x59e6('0x12')](_0x33b616));if(_0x33b616[_0x59e6('0x13')]){if(_0x33b616['error']['code']===0x1f4){logger[_0x59e6('0x13')](_0x59e6('0xf'),_0x36e922,_0x33b616[_0x59e6('0x13')]['message']);return _0x495791(_0x33b616[_0x59e6('0x13')][_0x59e6('0x14')]);}logger[_0x59e6('0x13')](_0x59e6('0xf'),_0x36e922,_0x33b616['error'][_0x59e6('0x14')]);return _0x57525a(_0x33b616[_0x59e6('0x13')][_0x59e6('0x14')]);}else{logger[_0x59e6('0xe')](_0x59e6('0xf'),_0x36e922,_0x59e6('0x10'));_0x57525a(_0x33b616['result']['message']);}})[_0x59e6('0x15')](function(_0x2d67ee){logger['error'](_0x59e6('0xf'),_0x36e922,_0x2d67ee);_0x495791(_0x2d67ee);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 3f08cab..89b2de3 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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x59c366,_0x153fb5){var _0x467fd4=function(_0x30f38b){while(--_0x30f38b){_0x59c366['push'](_0x59c366['shift']());}};_0x467fd4(++_0x153fb5);}(_0xb10b,0x12a));var _0xbb10=function(_0x39106e,_0x586f3d){_0x39106e=_0x39106e-0x0;var _0x892aec=_0xb10b[_0x39106e];return _0x892aec;};'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')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x56b794,_0x50003f){var _0x80c80=function(_0x54dc03){while(--_0x54dc03){_0x56b794['push'](_0x56b794['shift']());}};_0x80c80(++_0x50003f);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 5cd460a..29e14c0 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 _0x7719=['exports','INTEGER','STRING','noop','TEXT'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7719,0x9b));var _0x9771=function(_0x4f1de8,_0x1452c2){_0x4f1de8=_0x4f1de8-0x0;var _0x306d47=_0x7719[_0x4f1de8];return _0x306d47;};'use strict';var Sequelize=require('sequelize');module[_0x9771('0x0')]={'priority':{'type':Sequelize[_0x9771('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9771('0x2')],'allowNull':![],'defaultValue':_0x9771('0x3')},'appdata':{'type':Sequelize[_0x9771('0x4')]()},'description':{'type':Sequelize[_0x9771('0x2')]},'interval':{'type':Sequelize[_0x9771('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x9ee3=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0x9ee3,0x11d));var _0x39ee=function(_0x1de9a2,_0x38b784){_0x1de9a2=_0x1de9a2-0x0;var _0x2ca2b4=_0x9ee3[_0x1de9a2];return _0x2ca2b4;};'use strict';var Sequelize=require(_0x39ee('0x0'));module[_0x39ee('0x1')]={'priority':{'type':Sequelize[_0x39ee('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x39ee('0x3')],'allowNull':![],'defaultValue':_0x39ee('0x4')},'appdata':{'type':Sequelize[_0x39ee('0x5')]()},'description':{'type':Sequelize[_0x39ee('0x3')]},'interval':{'type':Sequelize[_0x39ee('0x3')],'defaultValue':_0x39ee('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 14f604d..858e60f 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 _0x43b1=['fields','length','includeAll','include','merge','then','catch','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','show','params','model','keys','ChatApplication','filters','intersection','query','attributes'];(function(_0x29771f,_0x1189ae){var _0x279baf=function(_0xd66325){while(--_0xd66325){_0x29771f['push'](_0x29771f['shift']());}};_0x279baf(++_0x1189ae);}(_0x43b1,0x7d));var _0x143b=function(_0x279298,_0x4f589b){_0x279298=_0x279298-0x0;var _0x10f64e=_0x43b1[_0x279298];return _0x10f64e;};'use strict';var emlformat=require(_0x143b('0x0'));var rimraf=require(_0x143b('0x1'));var zipdir=require(_0x143b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x143b('0x3'));var moment=require('moment');var BPromise=require(_0x143b('0x4'));var Mustache=require(_0x143b('0x5'));var util=require(_0x143b('0x6'));var path=require(_0x143b('0x7'));var sox=require(_0x143b('0x8'));var csv=require(_0x143b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x143b('0xa'));var _=require(_0x143b('0xb'));var squel=require(_0x143b('0xc'));var crypto=require('crypto');var jsforce=require(_0x143b('0xd'));var deskjs=require(_0x143b('0xe'));var toCsv=require(_0x143b('0x9'));var querystring=require(_0x143b('0xf'));var Papa=require(_0x143b('0x10'));var Redis=require(_0x143b('0x11'));var authService=require(_0x143b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x143b('0x13'));var hardwareService=require(_0x143b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x143b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x143b('0x16'));var db=require(_0x143b('0x17'))['db'];function respondWithStatusCode(_0x52429f,_0x2d6c07){_0x2d6c07=_0x2d6c07||0xcc;return function(_0x1ef389){if(_0x1ef389){return _0x52429f[_0x143b('0x18')](_0x2d6c07);}return _0x52429f[_0x143b('0x19')](_0x2d6c07)[_0x143b('0x1a')]();};}function respondWithResult(_0x34cd9b,_0x1325c3){_0x1325c3=_0x1325c3||0xc8;return function(_0x40ce06){if(_0x40ce06){return _0x34cd9b[_0x143b('0x19')](_0x1325c3)[_0x143b('0x1b')](_0x40ce06);}};}function respondWithFilteredResult(_0x2bca2c,_0x3cc649){return function(_0x2d746a){if(_0x2d746a){var _0x133603=typeof _0x3cc649[_0x143b('0x1c')]===_0x143b('0x1d')&&typeof _0x3cc649[_0x143b('0x1e')]==='undefined';var _0x520197=_0x2d746a[_0x143b('0x1f')];var _0x244ba8=_0x133603?0x0:_0x3cc649[_0x143b('0x1c')];var _0x139aa9=_0x133603?_0x2d746a[_0x143b('0x1f')]:_0x3cc649[_0x143b('0x1c')]+_0x3cc649[_0x143b('0x1e')];var _0x1ca6d2;if(_0x139aa9>=_0x520197){_0x139aa9=_0x520197;_0x1ca6d2=0xc8;}else{_0x1ca6d2=0xce;}_0x2bca2c[_0x143b('0x19')](_0x1ca6d2);return _0x2bca2c[_0x143b('0x20')](_0x143b('0x21'),_0x244ba8+'-'+_0x139aa9+'/'+_0x520197)['json'](_0x2d746a);}return null;};}function patchUpdates(_0x1dd05b){return function(_0x35df37){try{jsonpatch[_0x143b('0x22')](_0x35df37,_0x1dd05b,!![]);}catch(_0xfd9194){return BPromise[_0x143b('0x23')](_0xfd9194);}return _0x35df37[_0x143b('0x24')]();};}function saveUpdates(_0x159ef6,_0x1d5b5b){return function(_0x5d0684){if(_0x5d0684){return _0x5d0684[_0x143b('0x25')](_0x159ef6)['then'](function(_0x2a55fe){return _0x2a55fe;});}return null;};}function removeEntity(_0x5bdebc,_0x549638){return function(_0x56717f){if(_0x56717f){return _0x56717f[_0x143b('0x26')]()['then'](function(){_0x5bdebc['status'](0xcc)[_0x143b('0x1a')]();});}};}function handleEntityNotFound(_0x53c102,_0x35e097){return function(_0x54eca6){if(!_0x54eca6){_0x53c102[_0x143b('0x18')](0x194);}return _0x54eca6;};}function handleError(_0xd30b1,_0x1adf50){_0x1adf50=_0x1adf50||0x1f4;return function(_0x4f5a17){logger['error'](_0x4f5a17['stack']);if(_0x4f5a17['name']){delete _0x4f5a17[_0x143b('0x27')];}_0xd30b1['status'](_0x1adf50)['send'](_0x4f5a17);};}exports[_0x143b('0x28')]=function(_0x37611b,_0x6174a3){var _0x5535b5={'raw':!![],'where':{'id':_0x37611b[_0x143b('0x29')]['id']}},_0xd1aa12={};_0xd1aa12[_0x143b('0x2a')]=_[_0x143b('0x2b')](db[_0x143b('0x2c')]['rawAttributes']);_0xd1aa12['query']=_['keys'](_0x37611b['query']);_0xd1aa12[_0x143b('0x2d')]=_[_0x143b('0x2e')](_0xd1aa12[_0x143b('0x2a')],_0xd1aa12[_0x143b('0x2f')]);_0x5535b5[_0x143b('0x30')]=_[_0x143b('0x2e')](_0xd1aa12[_0x143b('0x2a')],qs[_0x143b('0x31')](_0x37611b[_0x143b('0x2f')][_0x143b('0x31')]));_0x5535b5['attributes']=_0x5535b5[_0x143b('0x30')][_0x143b('0x32')]?_0x5535b5['attributes']:_0xd1aa12['model'];if(_0x37611b[_0x143b('0x2f')][_0x143b('0x33')]){_0x5535b5[_0x143b('0x34')]=[{'all':!![]}];}_0x5535b5=_[_0x143b('0x35')]({},_0x5535b5,_0x37611b['options']);return db['ChatApplication']['find'](_0x5535b5)['then'](handleEntityNotFound(_0x6174a3,null))[_0x143b('0x36')](respondWithResult(_0x6174a3,null))[_0x143b('0x37')](handleError(_0x6174a3,null));};exports[_0x143b('0x25')]=function(_0x54dcb9,_0x1f2eff){if(_0x54dcb9[_0x143b('0x38')]['id']){delete _0x54dcb9[_0x143b('0x38')]['id'];}return db['ChatApplication'][_0x143b('0x39')]({'where':{'id':_0x54dcb9[_0x143b('0x29')]['id']}})[_0x143b('0x36')](handleEntityNotFound(_0x1f2eff,null))['then'](saveUpdates(_0x54dcb9[_0x143b('0x38')],null))[_0x143b('0x36')](respondWithResult(_0x1f2eff,null))['catch'](handleError(_0x1f2eff,null));};exports['destroy']=function(_0x5a8bd8,_0x1388fc){return db[_0x143b('0x2c')]['find']({'where':{'id':_0x5a8bd8[_0x143b('0x29')]['id']}})[_0x143b('0x36')](handleEntityNotFound(_0x1388fc,null))[_0x143b('0x36')](removeEntity(_0x1388fc,null))[_0x143b('0x37')](handleError(_0x1388fc,null));};
\ No newline at end of file
+var _0x063c=['json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','end','error','stack','name','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','merge','ChatApplication','find','body','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x40e006,_0x43182b){var _0x59c350=function(_0x2af04b){while(--_0x2af04b){_0x40e006['push'](_0x40e006['shift']());}};_0x59c350(++_0x43182b);}(_0x063c,0xba));var _0xc063=function(_0x3091ea,_0x43ce06){_0x3091ea=_0x3091ea-0x0;var _0x4f99e7=_0x063c[_0x3091ea];return _0x4f99e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc063('0x0'));var zipdir=require(_0xc063('0x1'));var jsonpatch=require(_0xc063('0x2'));var rp=require(_0xc063('0x3'));var moment=require(_0xc063('0x4'));var BPromise=require(_0xc063('0x5'));var Mustache=require('mustache');var util=require(_0xc063('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc063('0x7'));var fs=require('fs');var fs_extra=require(_0xc063('0x8'));var _=require('lodash');var squel=require(_0xc063('0x9'));var crypto=require(_0xc063('0xa'));var jsforce=require(_0xc063('0xb'));var deskjs=require(_0xc063('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc063('0xd'));var Papa=require(_0xc063('0xe'));var Redis=require('ioredis');var authService=require(_0xc063('0xf'));var qs=require(_0xc063('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc063('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc063('0x12'));var licenseUtil=require(_0xc063('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8fc3dc,_0x5d0d2a){_0x5d0d2a=_0x5d0d2a||0xcc;return function(_0x14f55e){if(_0x14f55e){return _0x8fc3dc[_0xc063('0x14')](_0x5d0d2a);}return _0x8fc3dc[_0xc063('0x15')](_0x5d0d2a)['end']();};}function respondWithResult(_0x364264,_0x1249b2){_0x1249b2=_0x1249b2||0xc8;return function(_0x21b8da){if(_0x21b8da){return _0x364264[_0xc063('0x15')](_0x1249b2)[_0xc063('0x16')](_0x21b8da);}};}function respondWithFilteredResult(_0x391910,_0xf7fe54){return function(_0xac1724){if(_0xac1724){var _0x3baaeb=typeof _0xf7fe54['offset']===_0xc063('0x17')&&typeof _0xf7fe54[_0xc063('0x18')]==='undefined';var _0x89bb1e=_0xac1724[_0xc063('0x19')];var _0x4dcef1=_0x3baaeb?0x0:_0xf7fe54[_0xc063('0x1a')];var _0x13cc09=_0x3baaeb?_0xac1724[_0xc063('0x19')]:_0xf7fe54[_0xc063('0x1a')]+_0xf7fe54['limit'];var _0x234f33;if(_0x13cc09>=_0x89bb1e){_0x13cc09=_0x89bb1e;_0x234f33=0xc8;}else{_0x234f33=0xce;}_0x391910[_0xc063('0x15')](_0x234f33);return _0x391910[_0xc063('0x1b')]('Content-Range',_0x4dcef1+'-'+_0x13cc09+'/'+_0x89bb1e)[_0xc063('0x16')](_0xac1724);}return null;};}function patchUpdates(_0x5fa053){return function(_0x5741e0){try{jsonpatch[_0xc063('0x1c')](_0x5741e0,_0x5fa053,!![]);}catch(_0x4606eb){return BPromise[_0xc063('0x1d')](_0x4606eb);}return _0x5741e0[_0xc063('0x1e')]();};}function saveUpdates(_0x1ba785,_0x4a82eb){return function(_0x59c960){if(_0x59c960){return _0x59c960['update'](_0x1ba785)[_0xc063('0x1f')](function(_0x552560){return _0x552560;});}return null;};}function removeEntity(_0x4fb406,_0x481a6b){return function(_0x382f79){if(_0x382f79){return _0x382f79[_0xc063('0x20')]()[_0xc063('0x1f')](function(){_0x4fb406[_0xc063('0x15')](0xcc)[_0xc063('0x21')]();});}};}function handleEntityNotFound(_0x49f26e,_0x5a0d10){return function(_0x7317e7){if(!_0x7317e7){_0x49f26e['sendStatus'](0x194);}return _0x7317e7;};}function handleError(_0x36ba5a,_0x43e592){_0x43e592=_0x43e592||0x1f4;return function(_0x7db21a){logger[_0xc063('0x22')](_0x7db21a[_0xc063('0x23')]);if(_0x7db21a[_0xc063('0x24')]){delete _0x7db21a[_0xc063('0x24')];}_0x36ba5a[_0xc063('0x15')](_0x43e592)['send'](_0x7db21a);};}exports[_0xc063('0x25')]=function(_0xb48cc9,_0x5a623d){var _0x3a18bd={'raw':!![],'where':{'id':_0xb48cc9[_0xc063('0x26')]['id']}},_0x3359cd={};_0x3359cd[_0xc063('0x27')]=_[_0xc063('0x28')](db['ChatApplication'][_0xc063('0x29')]);_0x3359cd[_0xc063('0x2a')]=_['keys'](_0xb48cc9['query']);_0x3359cd['filters']=_[_0xc063('0x2b')](_0x3359cd['model'],_0x3359cd[_0xc063('0x2a')]);_0x3a18bd[_0xc063('0x2c')]=_[_0xc063('0x2b')](_0x3359cd[_0xc063('0x27')],qs['fields'](_0xb48cc9[_0xc063('0x2a')][_0xc063('0x2d')]));_0x3a18bd[_0xc063('0x2c')]=_0x3a18bd['attributes'][_0xc063('0x2e')]?_0x3a18bd['attributes']:_0x3359cd[_0xc063('0x27')];if(_0xb48cc9[_0xc063('0x2a')]['includeAll']){_0x3a18bd['include']=[{'all':!![]}];}_0x3a18bd=_[_0xc063('0x2f')]({},_0x3a18bd,_0xb48cc9['options']);return db[_0xc063('0x30')][_0xc063('0x31')](_0x3a18bd)[_0xc063('0x1f')](handleEntityNotFound(_0x5a623d,null))['then'](respondWithResult(_0x5a623d,null))['catch'](handleError(_0x5a623d,null));};exports['update']=function(_0x40fee0,_0x4ee218){if(_0x40fee0[_0xc063('0x32')]['id']){delete _0x40fee0['body']['id'];}return db[_0xc063('0x30')][_0xc063('0x31')]({'where':{'id':_0x40fee0[_0xc063('0x26')]['id']}})[_0xc063('0x1f')](handleEntityNotFound(_0x4ee218,null))['then'](saveUpdates(_0x40fee0[_0xc063('0x32')],null))[_0xc063('0x1f')](respondWithResult(_0x4ee218,null))[_0xc063('0x33')](handleError(_0x4ee218,null));};exports['destroy']=function(_0xcd344b,_0xb6b651){return db[_0xc063('0x30')][_0xc063('0x31')]({'where':{'id':_0xcd344b[_0xc063('0x26')]['id']}})[_0xc063('0x1f')](handleEntityNotFound(_0xb6b651,null))[_0xc063('0x1f')](removeEntity(_0xb6b651,null))[_0xc063('0x33')](handleError(_0xb6b651,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 4574b5d..a5b1d7c 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 _0xec0e=['bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xec0e,0x1d1));var _0xeec0=function(_0x61bb05,_0x47421f){_0x61bb05=_0x61bb05-0x0;var _0x3ceb3e=_0xec0e[_0x61bb05];return _0x3ceb3e;};'use strict';var _=require(_0xeec0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xeec0('0x1'));var moment=require(_0xeec0('0x2'));var BPromise=require(_0xeec0('0x3'));var rp=require(_0xeec0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeec0('0x5'));var config=require(_0xeec0('0x6'));var attributes=require(_0xeec0('0x7'));module[_0xeec0('0x8')]=function(_0x20c9a9,_0x830f66){return _0x20c9a9['define']('ChatApplication',attributes,{'tableName':_0xeec0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeec0('0xa'),'collate':_0xeec0('0xb')});};
\ No newline at end of file
+var _0x5d01=['utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications'];(function(_0x434634,_0x2b232d){var _0x5d866b=function(_0x5d2691){while(--_0x5d2691){_0x434634['push'](_0x434634['shift']());}};_0x5d866b(++_0x2b232d);}(_0x5d01,0xe5));var _0x15d0=function(_0x25d33a,_0x3859b9){_0x25d33a=_0x25d33a-0x0;var _0x4ede62=_0x5d01[_0x25d33a];return _0x4ede62;};'use strict';var _=require(_0x15d0('0x0'));var util=require('util');var logger=require(_0x15d0('0x1'))(_0x15d0('0x2'));var moment=require('moment');var BPromise=require(_0x15d0('0x3'));var rp=require(_0x15d0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x15d0('0x5'));var attributes=require(_0x15d0('0x6'));module[_0x15d0('0x7')]=function(_0x1b0e27,_0x2af55d){return _0x1b0e27[_0x15d0('0x8')](_0x15d0('0x9'),attributes,{'tableName':_0x15d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x15d0('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 00ad176..7c2fb38 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 _0x3301=['request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x1e6955,_0x2f6273){var _0x21271e=function(_0xd75f7d){while(--_0xd75f7d){_0x1e6955['push'](_0x1e6955['shift']());}};_0x21271e(++_0x2f6273);}(_0x3301,0x182));var _0x1330=function(_0x5f1b74,_0x498562){_0x5f1b74=_0x5f1b74-0x0;var _0x1fb5a0=_0x3301[_0x5f1b74];return _0x1fb5a0;};'use strict';var _=require(_0x1330('0x0'));var util=require(_0x1330('0x1'));var moment=require(_0x1330('0x2'));var BPromise=require(_0x1330('0x3'));var rs=require(_0x1330('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1330('0x5'))['db'];var utils=require(_0x1330('0x6'));var logger=require(_0x1330('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1330('0x8')][_0x1330('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c8bbf,_0x474b44,_0xc85bdd){return new BPromise(function(_0x69d2e1,_0xc4bec){return client[_0x1330('0xa')](_0x5c8bbf,_0xc85bdd)[_0x1330('0xb')](function(_0x5ad070){logger[_0x1330('0xc')](_0x1330('0xd'),_0x474b44,_0x1330('0xe'));logger[_0x1330('0xf')](_0x1330('0x10'),_0x474b44,_0x1330('0xe'),JSON[_0x1330('0x11')](_0x5ad070));if(_0x5ad070[_0x1330('0x12')]){if(_0x5ad070['error'][_0x1330('0x13')]===0x1f4){logger[_0x1330('0x12')](_0x1330('0xd'),_0x474b44,_0x5ad070[_0x1330('0x12')]['message']);return _0xc4bec(_0x5ad070[_0x1330('0x12')][_0x1330('0x14')]);}logger[_0x1330('0x12')](_0x1330('0xd'),_0x474b44,_0x5ad070[_0x1330('0x12')][_0x1330('0x14')]);return _0x69d2e1(_0x5ad070[_0x1330('0x12')][_0x1330('0x14')]);}else{logger[_0x1330('0xc')](_0x1330('0xd'),_0x474b44,_0x1330('0xe'));_0x69d2e1(_0x5ad070[_0x1330('0x15')][_0x1330('0x14')]);}})['catch'](function(_0x2597f3){logger['error'](_0x1330('0xd'),_0x474b44,_0x2597f3);_0xc4bec(_0x2597f3);});});}
\ No newline at end of file
+var _0xe0fe=['http','request','then','info','request\x20sent','debug','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','result','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x144efb,_0x1e9c15){var _0x3b7832=function(_0x9a6cd){while(--_0x9a6cd){_0x144efb['push'](_0x144efb['shift']());}};_0x3b7832(++_0x1e9c15);}(_0xe0fe,0x108));var _0xee0f=function(_0x166614,_0x548d47){_0x166614=_0x166614-0x0;var _0x4a1307=_0xe0fe[_0x166614];return _0x4a1307;};'use strict';var _=require(_0xee0f('0x0'));var util=require(_0xee0f('0x1'));var moment=require(_0xee0f('0x2'));var BPromise=require(_0xee0f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xee0f('0x4'));var logger=require('../../config/logger')(_0xee0f('0x5'));var config=require(_0xee0f('0x6'));var jayson=require(_0xee0f('0x7'));var client=jayson[_0xee0f('0x8')][_0xee0f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa63d33,_0x36c4ea,_0x314cf6){return new BPromise(function(_0x4d7ee0,_0x440dc9){return client[_0xee0f('0xa')](_0xa63d33,_0x314cf6)[_0xee0f('0xb')](function(_0x5594cd){logger[_0xee0f('0xc')]('ChatApplication,\x20%s,\x20%s',_0x36c4ea,_0xee0f('0xd'));logger[_0xee0f('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x36c4ea,_0xee0f('0xd'),JSON[_0xee0f('0xf')](_0x5594cd));if(_0x5594cd[_0xee0f('0x10')]){if(_0x5594cd[_0xee0f('0x10')][_0xee0f('0x11')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x36c4ea,_0x5594cd[_0xee0f('0x10')][_0xee0f('0x12')]);return _0x440dc9(_0x5594cd['error'][_0xee0f('0x12')]);}logger[_0xee0f('0x10')](_0xee0f('0x13'),_0x36c4ea,_0x5594cd[_0xee0f('0x10')][_0xee0f('0x12')]);return _0x4d7ee0(_0x5594cd[_0xee0f('0x10')][_0xee0f('0x12')]);}else{logger[_0xee0f('0xc')](_0xee0f('0x13'),_0x36c4ea,_0xee0f('0xd'));_0x4d7ee0(_0x5594cd[_0xee0f('0x14')][_0xee0f('0x12')]);}})['catch'](function(_0x3590a5){logger[_0xee0f('0x10')](_0xee0f('0x13'),_0x36c4ea,_0x3590a5);_0x440dc9(_0x3590a5);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 45adeb3..0632e1f 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 _0x373d=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','show','/:id','isAuthenticated'];(function(_0x492c02,_0x177429){var _0x403eda=function(_0x3dbb0f){while(--_0x3dbb0f){_0x492c02['push'](_0x492c02['shift']());}};_0x403eda(++_0x177429);}(_0x373d,0xb8));var _0xd373=function(_0x42f7cd,_0x1c47b7){_0x42f7cd=_0x42f7cd-0x0;var _0x514f16=_0x373d[_0x42f7cd];return _0x514f16;};'use strict';var multer=require(_0xd373('0x0'));var util=require('util');var path=require(_0xd373('0x1'));var timeout=require(_0xd373('0x2'));var express=require('express');var router=express[_0xd373('0x3')]();var fs_extra=require(_0xd373('0x4'));var auth=require(_0xd373('0x5'));var interaction=require(_0xd373('0x6'));var config=require(_0xd373('0x7'));var controller=require(_0xd373('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0xd373('0x9')]);router['put'](_0xd373('0xa'),auth[_0xd373('0xb')](),controller['update']);router['delete'](_0xd373('0xa'),auth['isAuthenticated'](),controller[_0xd373('0xc')]);module[_0xd373('0xd')]=router;
\ No newline at end of file
+var _0xd2ca=['fs-extra','../../components/auth/service','get','/:id','isAuthenticated','show','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xd2ca,0x1cb));var _0xad2c=function(_0x4c4c82,_0x24a215){_0x4c4c82=_0x4c4c82-0x0;var _0xab2ece=_0xd2ca[_0x4c4c82];return _0xab2ece;};'use strict';var multer=require(_0xad2c('0x0'));var util=require(_0xad2c('0x1'));var path=require(_0xad2c('0x2'));var timeout=require(_0xad2c('0x3'));var express=require(_0xad2c('0x4'));var router=express[_0xad2c('0x5')]();var fs_extra=require(_0xad2c('0x6'));var auth=require(_0xad2c('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xad2c('0x8')](_0xad2c('0x9'),auth[_0xad2c('0xa')](),controller[_0xad2c('0xb')]);router[_0xad2c('0xc')](_0xad2c('0x9'),auth[_0xad2c('0xa')](),controller[_0xad2c('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xad2c('0xe')]);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 a822099..550e978 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 _0x4a9a=['exports','STRING','BOOLEAN'];(function(_0x1233d2,_0x5416f4){var _0x22759e=function(_0xb516aa){while(--_0xb516aa){_0x1233d2['push'](_0x1233d2['shift']());}};_0x22759e(++_0x5416f4);}(_0x4a9a,0x123));var _0xa4a9=function(_0x3f9951,_0x4bf5d0){_0x3f9951=_0x3f9951-0x0;var _0x11eae7=_0x4a9a[_0x3f9951];return _0x11eae7;};'use strict';var Sequelize=require('sequelize');module[_0xa4a9('0x0')]={'name':{'type':Sequelize[_0xa4a9('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xa4a9('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x94aa=['BOOLEAN','sequelize'];(function(_0x5a92ad,_0x2219a6){var _0x2466f8=function(_0x4ad04e){while(--_0x4ad04e){_0x5a92ad['push'](_0x5a92ad['shift']());}};_0x2466f8(++_0x2219a6);}(_0x94aa,0x65));var _0xa94a=function(_0x5bee26,_0x3d4891){_0x5bee26=_0x5bee26-0x0;var _0x557587=_0x94aa[_0x5bee26];return _0x557587;};'use strict';var Sequelize=require(_0xa94a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xa94a('0x1')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 21c6710..69f9012 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 _0x49b6=['filters','pick','filter','merge','options','ChatGroup','catch','show','includeAll','include','create','body','find','params','describe','getUnread','ChatInternalMessage','toInteger','addMembers','omit','ids','getMembers','User','removeMembers','addMessage','ChatGroupId','$gte','split','format','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x1708e8,_0x11f822){var _0x5a305f=function(_0xa045d0){while(--_0xa045d0){_0x1708e8['push'](_0x1708e8['shift']());}};_0x5a305f(++_0x11f822);}(_0x49b6,0x1ea));var _0x649b=function(_0x15fe68,_0xddc145){_0x15fe68=_0x15fe68-0x0;var _0x1d144c=_0x49b6[_0x15fe68];return _0x1d144c;};'use strict';var emlformat=require(_0x649b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x649b('0x1'));var jsonpatch=require(_0x649b('0x2'));var rp=require(_0x649b('0x3'));var moment=require(_0x649b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x649b('0x5'));var path=require(_0x649b('0x6'));var sox=require(_0x649b('0x7'));var csv=require(_0x649b('0x8'));var ejs=require(_0x649b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x649b('0xa'));var squel=require(_0x649b('0xb'));var crypto=require(_0x649b('0xc'));var jsforce=require(_0x649b('0xd'));var deskjs=require(_0x649b('0xe'));var toCsv=require(_0x649b('0x8'));var querystring=require(_0x649b('0xf'));var Papa=require('papaparse');var Redis=require(_0x649b('0x10'));var authService=require(_0x649b('0x11'));var qs=require(_0x649b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x649b('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x649b('0x14'));var config=require(_0x649b('0x15'));var licenseUtil=require(_0x649b('0x16'));var db=require(_0x649b('0x17'))['db'];config[_0x649b('0x18')]=_['defaults'](config[_0x649b('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x649b('0x19'))(new Redis(config[_0x649b('0x18')]));require('./chatGroup.socket')[_0x649b('0x1a')](socket);function respondWithStatusCode(_0x41b3eb,_0x1c7a13){_0x1c7a13=_0x1c7a13||0xcc;return function(_0xd9d95e){if(_0xd9d95e){return _0x41b3eb[_0x649b('0x1b')](_0x1c7a13);}return _0x41b3eb[_0x649b('0x1c')](_0x1c7a13)[_0x649b('0x1d')]();};}function respondWithResult(_0x45bc63,_0x28b4f0){_0x28b4f0=_0x28b4f0||0xc8;return function(_0x40ba96){if(_0x40ba96){return _0x45bc63[_0x649b('0x1c')](_0x28b4f0)[_0x649b('0x1e')](_0x40ba96);}};}function respondWithFilteredResult(_0x5ec263,_0x7db0de){return function(_0xd36fe){if(_0xd36fe){var _0x44b458=typeof _0x7db0de[_0x649b('0x1f')]==='undefined'&&typeof _0x7db0de[_0x649b('0x20')]===_0x649b('0x21');var _0x342ce7=_0xd36fe[_0x649b('0x22')];var _0x2eda80=_0x44b458?0x0:_0x7db0de[_0x649b('0x1f')];var _0xecdc2b=_0x44b458?_0xd36fe[_0x649b('0x22')]:_0x7db0de[_0x649b('0x1f')]+_0x7db0de[_0x649b('0x20')];var _0x128190;if(_0xecdc2b>=_0x342ce7){_0xecdc2b=_0x342ce7;_0x128190=0xc8;}else{_0x128190=0xce;}_0x5ec263[_0x649b('0x1c')](_0x128190);return _0x5ec263[_0x649b('0x23')](_0x649b('0x24'),_0x2eda80+'-'+_0xecdc2b+'/'+_0x342ce7)[_0x649b('0x1e')](_0xd36fe);}return null;};}function patchUpdates(_0x3d6b31){return function(_0x2424d9){try{jsonpatch[_0x649b('0x25')](_0x2424d9,_0x3d6b31,!![]);}catch(_0x386c8b){return BPromise[_0x649b('0x26')](_0x386c8b);}return _0x2424d9[_0x649b('0x27')]();};}function saveUpdates(_0x120f61,_0xc51f0b){return function(_0x45ed78){if(_0x45ed78){return _0x45ed78[_0x649b('0x28')](_0x120f61)[_0x649b('0x29')](function(_0x224011){return _0x224011;});}return null;};}function removeEntity(_0x483057,_0x585190){return function(_0x57d85f){if(_0x57d85f){return _0x57d85f[_0x649b('0x2a')]()[_0x649b('0x29')](function(){_0x483057[_0x649b('0x1c')](0xcc)[_0x649b('0x1d')]();});}};}function handleEntityNotFound(_0x3207f1,_0x47aac7){return function(_0x315476){if(!_0x315476){_0x3207f1[_0x649b('0x1b')](0x194);}return _0x315476;};}function handleError(_0x1c6b36,_0x2aac47){_0x2aac47=_0x2aac47||0x1f4;return function(_0x2b90b4){logger[_0x649b('0x2b')](_0x2b90b4[_0x649b('0x2c')]);if(_0x2b90b4['name']){delete _0x2b90b4['name'];}_0x1c6b36[_0x649b('0x1c')](_0x2aac47)[_0x649b('0x2d')](_0x2b90b4);};}exports[_0x649b('0x2e')]=function(_0x3b57aa,_0x1a0f15){var _0x330ac3={},_0x5c9847={},_0x369be0={'count':0x0,'rows':[]};var _0x255f28=_[_0x649b('0x2f')](db['ChatGroup'][_0x649b('0x30')],function(_0x6341ea){return{'name':_0x6341ea['fieldName'],'type':_0x6341ea[_0x649b('0x31')]['key']};});_0x5c9847[_0x649b('0x32')]=_[_0x649b('0x2f')](_0x255f28,'name');_0x5c9847[_0x649b('0x33')]=_[_0x649b('0x34')](_0x3b57aa[_0x649b('0x33')]);_0x5c9847['filters']=_[_0x649b('0x35')](_0x5c9847['model'],_0x5c9847[_0x649b('0x33')]);_0x330ac3[_0x649b('0x36')]=_[_0x649b('0x35')](_0x5c9847[_0x649b('0x32')],qs[_0x649b('0x37')](_0x3b57aa[_0x649b('0x33')]['fields']));_0x330ac3[_0x649b('0x36')]=_0x330ac3[_0x649b('0x36')][_0x649b('0x38')]?_0x330ac3[_0x649b('0x36')]:_0x5c9847[_0x649b('0x32')];if(!_0x3b57aa['query'][_0x649b('0x39')](_0x649b('0x3a'))){_0x330ac3[_0x649b('0x20')]=qs[_0x649b('0x20')](_0x3b57aa[_0x649b('0x33')]['limit']);_0x330ac3[_0x649b('0x1f')]=qs[_0x649b('0x1f')](_0x3b57aa[_0x649b('0x33')]['offset']);}_0x330ac3[_0x649b('0x3b')]=qs[_0x649b('0x3c')](_0x3b57aa[_0x649b('0x33')][_0x649b('0x3c')]);_0x330ac3[_0x649b('0x3d')]=qs[_0x649b('0x3e')](_[_0x649b('0x3f')](_0x3b57aa['query'],_0x5c9847[_0x649b('0x3e')]),_0x255f28);if(_0x3b57aa['query'][_0x649b('0x40')]){_0x330ac3[_0x649b('0x3d')]=_[_0x649b('0x41')](_0x330ac3['where'],{'$or':_['map'](_0x255f28,function(_0x15a419){if(_0x15a419['type']!=='VIRTUAL'){var _0x38d087={};_0x38d087[_0x15a419['name']]={'$like':'%'+_0x3b57aa[_0x649b('0x33')][_0x649b('0x40')]+'%'};return _0x38d087;}})});}_0x330ac3=_[_0x649b('0x41')]({},_0x330ac3,_0x3b57aa[_0x649b('0x42')]);var _0x115f14={'where':_0x330ac3[_0x649b('0x3d')]};return db['ChatGroup'][_0x649b('0x22')](_0x115f14)[_0x649b('0x29')](function(_0x1700a7){_0x369be0[_0x649b('0x22')]=_0x1700a7;if(_0x3b57aa[_0x649b('0x33')]['includeAll']){_0x330ac3['include']=[{'all':!![]}];}return db[_0x649b('0x43')]['findAll'](_0x330ac3);})['then'](function(_0x3c3b6b){_0x369be0['rows']=_0x3c3b6b;return _0x369be0;})[_0x649b('0x29')](respondWithFilteredResult(_0x1a0f15,_0x330ac3))[_0x649b('0x44')](handleError(_0x1a0f15,null));};exports[_0x649b('0x45')]=function(_0x1e4ce7,_0x4ad8ad){var _0x3e4f65={'raw':!![],'where':{'id':_0x1e4ce7['params']['id']}},_0x449dc4={};_0x449dc4['model']=_['keys'](db[_0x649b('0x43')][_0x649b('0x30')]);_0x449dc4[_0x649b('0x33')]=_[_0x649b('0x34')](_0x1e4ce7[_0x649b('0x33')]);_0x449dc4['filters']=_['intersection'](_0x449dc4['model'],_0x449dc4[_0x649b('0x33')]);_0x3e4f65[_0x649b('0x36')]=_[_0x649b('0x35')](_0x449dc4[_0x649b('0x32')],qs['fields'](_0x1e4ce7[_0x649b('0x33')][_0x649b('0x37')]));_0x3e4f65[_0x649b('0x36')]=_0x3e4f65[_0x649b('0x36')][_0x649b('0x38')]?_0x3e4f65[_0x649b('0x36')]:_0x449dc4[_0x649b('0x32')];if(_0x1e4ce7[_0x649b('0x33')][_0x649b('0x46')]){_0x3e4f65[_0x649b('0x47')]=[{'all':!![]}];}_0x3e4f65=_['merge']({},_0x3e4f65,_0x1e4ce7['options']);return db[_0x649b('0x43')]['find'](_0x3e4f65)[_0x649b('0x29')](handleEntityNotFound(_0x4ad8ad,null))[_0x649b('0x29')](respondWithResult(_0x4ad8ad,null))[_0x649b('0x44')](handleError(_0x4ad8ad,null));};exports['create']=function(_0x8895ec,_0x525a96){return db[_0x649b('0x43')][_0x649b('0x48')](_0x8895ec[_0x649b('0x49')],{})[_0x649b('0x29')](respondWithResult(_0x525a96,0xc9))[_0x649b('0x44')](handleError(_0x525a96,null));};exports[_0x649b('0x28')]=function(_0x25ea88,_0xb8ae93){if(_0x25ea88[_0x649b('0x49')]['id']){delete _0x25ea88[_0x649b('0x49')]['id'];}return db[_0x649b('0x43')]['find']({'where':{'id':_0x25ea88['params']['id']}})[_0x649b('0x29')](handleEntityNotFound(_0xb8ae93,null))[_0x649b('0x29')](saveUpdates(_0x25ea88[_0x649b('0x49')],null))[_0x649b('0x29')](respondWithResult(_0xb8ae93,null))[_0x649b('0x44')](handleError(_0xb8ae93,null));};exports[_0x649b('0x2a')]=function(_0x3af923,_0x55f579){return db[_0x649b('0x43')][_0x649b('0x4a')]({'where':{'id':_0x3af923[_0x649b('0x4b')]['id']}})[_0x649b('0x29')](handleEntityNotFound(_0x55f579,null))[_0x649b('0x29')](removeEntity(_0x55f579,null))[_0x649b('0x44')](handleError(_0x55f579,null));};exports[_0x649b('0x4c')]=function(_0x251314,_0x51fd22){return db[_0x649b('0x43')][_0x649b('0x4c')]()[_0x649b('0x29')](respondWithResult(_0x51fd22,null))[_0x649b('0x44')](handleError(_0x51fd22,null));};exports[_0x649b('0x4d')]=function(_0x151f23,_0x125369,_0x308226){return db[_0x649b('0x4e')]['count']({'where':{'ChatGroupId':_0x151f23[_0x649b('0x4b')]['id'],'ToId':_0x151f23['user']['id'],'read':![]}})[_0x649b('0x29')](function(_0x2c686d){return{'id':_[_0x649b('0x4f')](_0x151f23[_0x649b('0x4b')]['id']),'count':_0x2c686d};})[_0x649b('0x29')](respondWithResult(_0x125369,null))[_0x649b('0x44')](handleError(_0x125369,null));};exports[_0x649b('0x50')]=function(_0x594dad,_0x418562,_0x405e14){return db[_0x649b('0x43')][_0x649b('0x4a')]({'where':{'id':_0x594dad[_0x649b('0x4b')]['id']}})[_0x649b('0x29')](handleEntityNotFound(_0x418562,null))[_0x649b('0x29')](function(_0x2d0dd2){if(_0x2d0dd2){return _0x2d0dd2[_0x649b('0x50')](_0x594dad[_0x649b('0x49')]['ids'],_[_0x649b('0x51')](_0x594dad['body'],[_0x649b('0x52'),'id'])||{});}})[_0x649b('0x29')](respondWithResult(_0x418562,null))[_0x649b('0x44')](handleError(_0x418562,null));};exports[_0x649b('0x53')]=function(_0x1c8ac0,_0x67f059,_0x4ce759){var _0x399d3a={};var _0x20f32f={};var _0x3b2801;var _0x46b195;return db[_0x649b('0x43')]['findOne']({'where':{'id':_0x1c8ac0[_0x649b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x67f059,null))[_0x649b('0x29')](function(_0x4d1a90){if(_0x4d1a90){_0x3b2801=_0x4d1a90;_0x20f32f[_0x649b('0x32')]=_[_0x649b('0x34')](db[_0x649b('0x54')][_0x649b('0x30')]);_0x20f32f[_0x649b('0x33')]=_[_0x649b('0x34')](_0x1c8ac0[_0x649b('0x33')]);_0x20f32f[_0x649b('0x3e')]=_['intersection'](_0x20f32f[_0x649b('0x32')],_0x20f32f[_0x649b('0x33')]);_0x399d3a['attributes']=_[_0x649b('0x35')](_0x20f32f[_0x649b('0x32')],qs[_0x649b('0x37')](_0x1c8ac0[_0x649b('0x33')][_0x649b('0x37')]));_0x399d3a['attributes']=_0x399d3a[_0x649b('0x36')][_0x649b('0x38')]?_0x399d3a[_0x649b('0x36')]:_0x20f32f[_0x649b('0x32')];_0x399d3a[_0x649b('0x3b')]=qs[_0x649b('0x3c')](_0x1c8ac0['query']['sort']);_0x399d3a['where']=qs[_0x649b('0x3e')](_['pick'](_0x1c8ac0[_0x649b('0x33')],_0x20f32f[_0x649b('0x3e')]));if(_0x1c8ac0[_0x649b('0x33')][_0x649b('0x40')]){_0x399d3a[_0x649b('0x3d')]=_['merge'](_0x399d3a[_0x649b('0x3d')],{'$or':_[_0x649b('0x2f')](_0x399d3a['attributes'],function(_0x24fa0d){var _0x5c9381={};_0x5c9381[_0x24fa0d]={'$like':'%'+_0x1c8ac0[_0x649b('0x33')][_0x649b('0x40')]+'%'};return _0x5c9381;})});}_0x399d3a=_[_0x649b('0x41')]({},_0x399d3a,_0x1c8ac0[_0x649b('0x42')]);return _0x3b2801[_0x649b('0x53')](_0x399d3a);}})[_0x649b('0x29')](function(_0x3b7006){if(_0x3b7006){_0x46b195=_0x3b7006['length'];if(!_0x1c8ac0['query'][_0x649b('0x39')](_0x649b('0x3a'))){_0x399d3a[_0x649b('0x20')]=qs[_0x649b('0x20')](_0x1c8ac0['query'][_0x649b('0x20')]);_0x399d3a[_0x649b('0x1f')]=qs[_0x649b('0x1f')](_0x1c8ac0[_0x649b('0x33')]['offset']);}return _0x3b2801['getMembers'](_0x399d3a);}})[_0x649b('0x29')](function(_0x18c5e8){if(_0x18c5e8){return _0x18c5e8?{'count':_0x46b195,'rows':_0x18c5e8}:null;}})[_0x649b('0x29')](respondWithResult(_0x67f059,null))['catch'](handleError(_0x67f059,null));};exports[_0x649b('0x55')]=function(_0x1f1f94,_0x471638,_0x1e1b76){return db[_0x649b('0x43')][_0x649b('0x4a')]({'where':{'id':_0x1f1f94[_0x649b('0x4b')]['id']}})[_0x649b('0x29')](handleEntityNotFound(_0x471638,null))['then'](function(_0x1d0ad9){if(_0x1d0ad9){return _0x1d0ad9['removeMembers'](_0x1f1f94['query'][_0x649b('0x52')]);}})[_0x649b('0x29')](respondWithStatusCode(_0x471638,null))[_0x649b('0x44')](handleError(_0x471638,null));};exports[_0x649b('0x56')]=function(_0x3f83e0,_0x14ca4c,_0x346f44){if(_0x3f83e0[_0x649b('0x49')]['id']){delete _0x3f83e0['body']['id'];}return db['ChatGroup'][_0x649b('0x4a')]({'where':{'id':_0x3f83e0[_0x649b('0x4b')]['id']}})[_0x649b('0x29')](handleEntityNotFound(_0x14ca4c,null))['then'](function(_0x491560){if(_0x491560){_0x3f83e0[_0x649b('0x49')][_0x649b('0x57')]=_0x491560['id'];return db[_0x649b('0x4e')][_0x649b('0x48')](_0x3f83e0[_0x649b('0x49')]);}})[_0x649b('0x29')](respondWithResult(_0x14ca4c,null))[_0x649b('0x44')](handleError(_0x14ca4c,null));};exports['getMessages']=function(_0x52a679,_0x1fcb4b,_0x51e003){var _0x21f758={};var _0x1a23fb={};var _0x4906e8;var _0x441a76;return db[_0x649b('0x43')]['findOne']({'where':{'id':_0x52a679['params']['id']}})[_0x649b('0x29')](handleEntityNotFound(_0x1fcb4b,null))['then'](function(_0x351758){if(_0x351758){_0x4906e8=_0x351758;_0x1a23fb[_0x649b('0x32')]=_[_0x649b('0x34')](db[_0x649b('0x4e')][_0x649b('0x30')]);_0x1a23fb[_0x649b('0x33')]=_[_0x649b('0x34')](_0x52a679[_0x649b('0x33')]);_0x1a23fb[_0x649b('0x3e')]=_[_0x649b('0x35')](_0x1a23fb[_0x649b('0x32')],_0x1a23fb[_0x649b('0x33')]);_0x21f758[_0x649b('0x36')]=_['intersection'](_0x1a23fb['model'],qs['fields'](_0x52a679[_0x649b('0x33')][_0x649b('0x37')]));_0x21f758[_0x649b('0x36')]=_0x21f758['attributes'][_0x649b('0x38')]?_0x21f758[_0x649b('0x36')]:_0x1a23fb[_0x649b('0x32')];_0x21f758[_0x649b('0x3b')]=qs[_0x649b('0x3c')](_0x52a679['query'][_0x649b('0x3c')]);_0x21f758['where']=qs['filters'](_[_0x649b('0x3f')](_0x52a679[_0x649b('0x33')],_0x1a23fb[_0x649b('0x3e')]));if(_0x52a679['query']['filter']){_0x21f758['where']=_[_0x649b('0x41')](_0x21f758[_0x649b('0x3d')],{'$or':_['map'](_0x21f758[_0x649b('0x36')],function(_0x146b49){var _0x318517={};_0x318517[_0x146b49]={'$like':'%'+_0x52a679[_0x649b('0x33')][_0x649b('0x40')]+'%'};return _0x318517;})});}if(_0x52a679[_0x649b('0x33')][_0x649b('0x58')]){var _0x473e78=_0x52a679[_0x649b('0x33')]['$gte'][_0x649b('0x59')](',');var _0x3f4bb3={};_0x3f4bb3[_0x473e78[0x0]]={'$gte':moment(_0x473e78[0x1])[_0x649b('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x21f758[_0x649b('0x3d')]=_[_0x649b('0x41')](_0x21f758['where'],_0x3f4bb3);}_0x21f758=_['merge']({},_0x21f758,_0x52a679[_0x649b('0x42')]);return _0x4906e8[_0x649b('0x5b')](_0x21f758);}})[_0x649b('0x29')](function(_0x50dc03){if(_0x50dc03){_0x441a76=_0x50dc03[_0x649b('0x38')];if(!_0x52a679['query'][_0x649b('0x39')](_0x649b('0x3a'))){_0x21f758['limit']=qs['limit'](_0x52a679[_0x649b('0x33')]['limit']);_0x21f758[_0x649b('0x1f')]=qs[_0x649b('0x1f')](_0x52a679[_0x649b('0x33')][_0x649b('0x1f')]);}return _0x4906e8[_0x649b('0x5b')](_0x21f758);}})[_0x649b('0x29')](function(_0x3ae3ba){if(_0x3ae3ba){return _0x3ae3ba?{'count':_0x441a76,'rows':_0x3ae3ba}:null;}})['then'](respondWithResult(_0x1fcb4b,null))['catch'](handleError(_0x1fcb4b,null));};
\ No newline at end of file
+var _0x3d4c=['findOne','keys','User','sort','nolimit','getMembers','removeMembers','addMessage','ChatGroupId','$gte','split','hasOwnProperty','getMessages','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','send','map','ChatGroup','rawAttributes','type','key','model','query','intersection','attributes','fields','length','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','filters','find','create','body','describe','ChatInternalMessage','toInteger','addMembers','ids','omit'];(function(_0x154cbb,_0x43c57f){var _0x494584=function(_0x971bd9){while(--_0x971bd9){_0x154cbb['push'](_0x154cbb['shift']());}};_0x494584(++_0x43c57f);}(_0x3d4c,0x12a));var _0xc3d4=function(_0x32612f,_0x353794){_0x32612f=_0x32612f-0x0;var _0x1d2bc6=_0x3d4c[_0x32612f];return _0x1d2bc6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc3d4('0x0'));var zipdir=require(_0xc3d4('0x1'));var jsonpatch=require(_0xc3d4('0x2'));var rp=require(_0xc3d4('0x3'));var moment=require(_0xc3d4('0x4'));var BPromise=require(_0xc3d4('0x5'));var Mustache=require('mustache');var util=require(_0xc3d4('0x6'));var path=require(_0xc3d4('0x7'));var sox=require('sox');var csv=require(_0xc3d4('0x8'));var ejs=require(_0xc3d4('0x9'));var fs=require('fs');var fs_extra=require(_0xc3d4('0xa'));var _=require(_0xc3d4('0xb'));var squel=require(_0xc3d4('0xc'));var crypto=require(_0xc3d4('0xd'));var jsforce=require(_0xc3d4('0xe'));var deskjs=require(_0xc3d4('0xf'));var toCsv=require(_0xc3d4('0x8'));var querystring=require('querystring');var Papa=require(_0xc3d4('0x10'));var Redis=require('ioredis');var authService=require(_0xc3d4('0x11'));var qs=require(_0xc3d4('0x12'));var as=require(_0xc3d4('0x13'));var hardwareService=require(_0xc3d4('0x14'));var logger=require('../../config/logger')(_0xc3d4('0x15'));var utils=require(_0xc3d4('0x16'));var config=require(_0xc3d4('0x17'));var licenseUtil=require(_0xc3d4('0x18'));var db=require(_0xc3d4('0x19'))['db'];config[_0xc3d4('0x1a')]=_[_0xc3d4('0x1b')](config[_0xc3d4('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc3d4('0x1a')]));require(_0xc3d4('0x1c'))[_0xc3d4('0x1d')](socket);function respondWithStatusCode(_0x18b12c,_0x28d16e){_0x28d16e=_0x28d16e||0xcc;return function(_0x56e563){if(_0x56e563){return _0x18b12c[_0xc3d4('0x1e')](_0x28d16e);}return _0x18b12c[_0xc3d4('0x1f')](_0x28d16e)[_0xc3d4('0x20')]();};}function respondWithResult(_0x257403,_0x37be54){_0x37be54=_0x37be54||0xc8;return function(_0x32fb11){if(_0x32fb11){return _0x257403[_0xc3d4('0x1f')](_0x37be54)[_0xc3d4('0x21')](_0x32fb11);}};}function respondWithFilteredResult(_0x458b75,_0x3598a3){return function(_0x4437b8){if(_0x4437b8){var _0x25a6c9=typeof _0x3598a3[_0xc3d4('0x22')]===_0xc3d4('0x23')&&typeof _0x3598a3[_0xc3d4('0x24')]===_0xc3d4('0x23');var _0x5289df=_0x4437b8[_0xc3d4('0x25')];var _0x4dd3e5=_0x25a6c9?0x0:_0x3598a3[_0xc3d4('0x22')];var _0x41e9b3=_0x25a6c9?_0x4437b8[_0xc3d4('0x25')]:_0x3598a3[_0xc3d4('0x22')]+_0x3598a3['limit'];var _0x1bf898;if(_0x41e9b3>=_0x5289df){_0x41e9b3=_0x5289df;_0x1bf898=0xc8;}else{_0x1bf898=0xce;}_0x458b75['status'](_0x1bf898);return _0x458b75[_0xc3d4('0x26')]('Content-Range',_0x4dd3e5+'-'+_0x41e9b3+'/'+_0x5289df)[_0xc3d4('0x21')](_0x4437b8);}return null;};}function patchUpdates(_0x1b1434){return function(_0x1b2c07){try{jsonpatch[_0xc3d4('0x27')](_0x1b2c07,_0x1b1434,!![]);}catch(_0x53c430){return BPromise['reject'](_0x53c430);}return _0x1b2c07[_0xc3d4('0x28')]();};}function saveUpdates(_0x5d1538,_0x53d986){return function(_0x56ad56){if(_0x56ad56){return _0x56ad56[_0xc3d4('0x29')](_0x5d1538)[_0xc3d4('0x2a')](function(_0x27f025){return _0x27f025;});}return null;};}function removeEntity(_0x51f9f1,_0x59262){return function(_0x2916fe){if(_0x2916fe){return _0x2916fe[_0xc3d4('0x2b')]()['then'](function(){_0x51f9f1[_0xc3d4('0x1f')](0xcc)[_0xc3d4('0x20')]();});}};}function handleEntityNotFound(_0x3710a0,_0x1c2cba){return function(_0x4b3871){if(!_0x4b3871){_0x3710a0[_0xc3d4('0x1e')](0x194);}return _0x4b3871;};}function handleError(_0x23817e,_0x51ab94){_0x51ab94=_0x51ab94||0x1f4;return function(_0x1d3be){logger[_0xc3d4('0x2c')](_0x1d3be[_0xc3d4('0x2d')]);if(_0x1d3be['name']){delete _0x1d3be[_0xc3d4('0x2e')];}_0x23817e[_0xc3d4('0x1f')](_0x51ab94)[_0xc3d4('0x2f')](_0x1d3be);};}exports['index']=function(_0x32a548,_0xc4242b){var _0x5d182d={},_0x345094={},_0x6cd03a={'count':0x0,'rows':[]};var _0x3590b7=_[_0xc3d4('0x30')](db[_0xc3d4('0x31')][_0xc3d4('0x32')],function(_0x1fa3d9){return{'name':_0x1fa3d9['fieldName'],'type':_0x1fa3d9[_0xc3d4('0x33')][_0xc3d4('0x34')]};});_0x345094[_0xc3d4('0x35')]=_[_0xc3d4('0x30')](_0x3590b7,_0xc3d4('0x2e'));_0x345094['query']=_['keys'](_0x32a548[_0xc3d4('0x36')]);_0x345094['filters']=_[_0xc3d4('0x37')](_0x345094[_0xc3d4('0x35')],_0x345094[_0xc3d4('0x36')]);_0x5d182d[_0xc3d4('0x38')]=_['intersection'](_0x345094['model'],qs[_0xc3d4('0x39')](_0x32a548[_0xc3d4('0x36')][_0xc3d4('0x39')]));_0x5d182d[_0xc3d4('0x38')]=_0x5d182d[_0xc3d4('0x38')][_0xc3d4('0x3a')]?_0x5d182d[_0xc3d4('0x38')]:_0x345094[_0xc3d4('0x35')];if(!_0x32a548[_0xc3d4('0x36')]['hasOwnProperty']('nolimit')){_0x5d182d[_0xc3d4('0x24')]=qs[_0xc3d4('0x24')](_0x32a548['query'][_0xc3d4('0x24')]);_0x5d182d[_0xc3d4('0x22')]=qs[_0xc3d4('0x22')](_0x32a548[_0xc3d4('0x36')][_0xc3d4('0x22')]);}_0x5d182d[_0xc3d4('0x3b')]=qs['sort'](_0x32a548[_0xc3d4('0x36')]['sort']);_0x5d182d[_0xc3d4('0x3c')]=qs['filters'](_[_0xc3d4('0x3d')](_0x32a548[_0xc3d4('0x36')],_0x345094['filters']),_0x3590b7);if(_0x32a548['query'][_0xc3d4('0x3e')]){_0x5d182d[_0xc3d4('0x3c')]=_[_0xc3d4('0x3f')](_0x5d182d['where'],{'$or':_[_0xc3d4('0x30')](_0x3590b7,function(_0x2c3952){if(_0x2c3952[_0xc3d4('0x33')]!=='VIRTUAL'){var _0x1dde41={};_0x1dde41[_0x2c3952[_0xc3d4('0x2e')]]={'$like':'%'+_0x32a548['query'][_0xc3d4('0x3e')]+'%'};return _0x1dde41;}})});}_0x5d182d=_['merge']({},_0x5d182d,_0x32a548[_0xc3d4('0x40')]);var _0x437858={'where':_0x5d182d[_0xc3d4('0x3c')]};return db[_0xc3d4('0x31')][_0xc3d4('0x25')](_0x437858)[_0xc3d4('0x2a')](function(_0x56f6ef){_0x6cd03a[_0xc3d4('0x25')]=_0x56f6ef;if(_0x32a548[_0xc3d4('0x36')][_0xc3d4('0x41')]){_0x5d182d[_0xc3d4('0x42')]=[{'all':!![]}];}return db[_0xc3d4('0x31')][_0xc3d4('0x43')](_0x5d182d);})['then'](function(_0x144120){_0x6cd03a[_0xc3d4('0x44')]=_0x144120;return _0x6cd03a;})[_0xc3d4('0x2a')](respondWithFilteredResult(_0xc4242b,_0x5d182d))[_0xc3d4('0x45')](handleError(_0xc4242b,null));};exports[_0xc3d4('0x46')]=function(_0x379604,_0x1a418e){var _0xc0fc89={'raw':!![],'where':{'id':_0x379604[_0xc3d4('0x47')]['id']}},_0x5dfe66={};_0x5dfe66[_0xc3d4('0x35')]=_['keys'](db[_0xc3d4('0x31')][_0xc3d4('0x32')]);_0x5dfe66[_0xc3d4('0x36')]=_['keys'](_0x379604[_0xc3d4('0x36')]);_0x5dfe66[_0xc3d4('0x48')]=_[_0xc3d4('0x37')](_0x5dfe66[_0xc3d4('0x35')],_0x5dfe66[_0xc3d4('0x36')]);_0xc0fc89['attributes']=_[_0xc3d4('0x37')](_0x5dfe66[_0xc3d4('0x35')],qs[_0xc3d4('0x39')](_0x379604[_0xc3d4('0x36')][_0xc3d4('0x39')]));_0xc0fc89[_0xc3d4('0x38')]=_0xc0fc89[_0xc3d4('0x38')]['length']?_0xc0fc89[_0xc3d4('0x38')]:_0x5dfe66['model'];if(_0x379604[_0xc3d4('0x36')][_0xc3d4('0x41')]){_0xc0fc89[_0xc3d4('0x42')]=[{'all':!![]}];}_0xc0fc89=_[_0xc3d4('0x3f')]({},_0xc0fc89,_0x379604[_0xc3d4('0x40')]);return db[_0xc3d4('0x31')][_0xc3d4('0x49')](_0xc0fc89)[_0xc3d4('0x2a')](handleEntityNotFound(_0x1a418e,null))[_0xc3d4('0x2a')](respondWithResult(_0x1a418e,null))[_0xc3d4('0x45')](handleError(_0x1a418e,null));};exports[_0xc3d4('0x4a')]=function(_0x250884,_0x9cbaaa){return db[_0xc3d4('0x31')][_0xc3d4('0x4a')](_0x250884['body'],{})[_0xc3d4('0x2a')](respondWithResult(_0x9cbaaa,0xc9))[_0xc3d4('0x45')](handleError(_0x9cbaaa,null));};exports[_0xc3d4('0x29')]=function(_0x51ae7b,_0x338a14){if(_0x51ae7b[_0xc3d4('0x4b')]['id']){delete _0x51ae7b[_0xc3d4('0x4b')]['id'];}return db[_0xc3d4('0x31')][_0xc3d4('0x49')]({'where':{'id':_0x51ae7b['params']['id']}})[_0xc3d4('0x2a')](handleEntityNotFound(_0x338a14,null))['then'](saveUpdates(_0x51ae7b[_0xc3d4('0x4b')],null))[_0xc3d4('0x2a')](respondWithResult(_0x338a14,null))[_0xc3d4('0x45')](handleError(_0x338a14,null));};exports[_0xc3d4('0x2b')]=function(_0x370610,_0x7bfadb){return db['ChatGroup']['find']({'where':{'id':_0x370610[_0xc3d4('0x47')]['id']}})[_0xc3d4('0x2a')](handleEntityNotFound(_0x7bfadb,null))[_0xc3d4('0x2a')](removeEntity(_0x7bfadb,null))[_0xc3d4('0x45')](handleError(_0x7bfadb,null));};exports[_0xc3d4('0x4c')]=function(_0x32ae4f,_0x24ab39){return db[_0xc3d4('0x31')][_0xc3d4('0x4c')]()['then'](respondWithResult(_0x24ab39,null))[_0xc3d4('0x45')](handleError(_0x24ab39,null));};exports['getUnread']=function(_0x1af5e9,_0x59609c,_0x2d6d5a){return db[_0xc3d4('0x4d')]['count']({'where':{'ChatGroupId':_0x1af5e9[_0xc3d4('0x47')]['id'],'ToId':_0x1af5e9['user']['id'],'read':![]}})[_0xc3d4('0x2a')](function(_0x3f2063){return{'id':_[_0xc3d4('0x4e')](_0x1af5e9[_0xc3d4('0x47')]['id']),'count':_0x3f2063};})[_0xc3d4('0x2a')](respondWithResult(_0x59609c,null))['catch'](handleError(_0x59609c,null));};exports[_0xc3d4('0x4f')]=function(_0xd46579,_0x15137e,_0x390c8f){return db[_0xc3d4('0x31')][_0xc3d4('0x49')]({'where':{'id':_0xd46579[_0xc3d4('0x47')]['id']}})['then'](handleEntityNotFound(_0x15137e,null))[_0xc3d4('0x2a')](function(_0xaa12b8){if(_0xaa12b8){return _0xaa12b8[_0xc3d4('0x4f')](_0xd46579['body'][_0xc3d4('0x50')],_[_0xc3d4('0x51')](_0xd46579['body'],[_0xc3d4('0x50'),'id'])||{});}})['then'](respondWithResult(_0x15137e,null))[_0xc3d4('0x45')](handleError(_0x15137e,null));};exports['getMembers']=function(_0x382269,_0x50eeff,_0x1cefa4){var _0x4adb5d={};var _0x577ac5={};var _0x183801;var _0x46cc15;return db[_0xc3d4('0x31')][_0xc3d4('0x52')]({'where':{'id':_0x382269[_0xc3d4('0x47')]['id']}})[_0xc3d4('0x2a')](handleEntityNotFound(_0x50eeff,null))['then'](function(_0x1ae8cd){if(_0x1ae8cd){_0x183801=_0x1ae8cd;_0x577ac5[_0xc3d4('0x35')]=_[_0xc3d4('0x53')](db[_0xc3d4('0x54')][_0xc3d4('0x32')]);_0x577ac5['query']=_['keys'](_0x382269[_0xc3d4('0x36')]);_0x577ac5[_0xc3d4('0x48')]=_[_0xc3d4('0x37')](_0x577ac5['model'],_0x577ac5['query']);_0x4adb5d[_0xc3d4('0x38')]=_[_0xc3d4('0x37')](_0x577ac5['model'],qs['fields'](_0x382269['query'][_0xc3d4('0x39')]));_0x4adb5d[_0xc3d4('0x38')]=_0x4adb5d['attributes']['length']?_0x4adb5d['attributes']:_0x577ac5[_0xc3d4('0x35')];_0x4adb5d[_0xc3d4('0x3b')]=qs[_0xc3d4('0x55')](_0x382269['query'][_0xc3d4('0x55')]);_0x4adb5d[_0xc3d4('0x3c')]=qs[_0xc3d4('0x48')](_[_0xc3d4('0x3d')](_0x382269['query'],_0x577ac5[_0xc3d4('0x48')]));if(_0x382269[_0xc3d4('0x36')][_0xc3d4('0x3e')]){_0x4adb5d[_0xc3d4('0x3c')]=_['merge'](_0x4adb5d[_0xc3d4('0x3c')],{'$or':_[_0xc3d4('0x30')](_0x4adb5d[_0xc3d4('0x38')],function(_0x29b8d6){var _0x1edf7d={};_0x1edf7d[_0x29b8d6]={'$like':'%'+_0x382269[_0xc3d4('0x36')][_0xc3d4('0x3e')]+'%'};return _0x1edf7d;})});}_0x4adb5d=_[_0xc3d4('0x3f')]({},_0x4adb5d,_0x382269['options']);return _0x183801['getMembers'](_0x4adb5d);}})[_0xc3d4('0x2a')](function(_0x438548){if(_0x438548){_0x46cc15=_0x438548[_0xc3d4('0x3a')];if(!_0x382269[_0xc3d4('0x36')]['hasOwnProperty'](_0xc3d4('0x56'))){_0x4adb5d[_0xc3d4('0x24')]=qs[_0xc3d4('0x24')](_0x382269[_0xc3d4('0x36')][_0xc3d4('0x24')]);_0x4adb5d[_0xc3d4('0x22')]=qs[_0xc3d4('0x22')](_0x382269[_0xc3d4('0x36')][_0xc3d4('0x22')]);}return _0x183801[_0xc3d4('0x57')](_0x4adb5d);}})['then'](function(_0x3ad302){if(_0x3ad302){return _0x3ad302?{'count':_0x46cc15,'rows':_0x3ad302}:null;}})[_0xc3d4('0x2a')](respondWithResult(_0x50eeff,null))[_0xc3d4('0x45')](handleError(_0x50eeff,null));};exports[_0xc3d4('0x58')]=function(_0x2cf1d6,_0x7c46bc,_0x4c64a1){return db[_0xc3d4('0x31')][_0xc3d4('0x49')]({'where':{'id':_0x2cf1d6[_0xc3d4('0x47')]['id']}})[_0xc3d4('0x2a')](handleEntityNotFound(_0x7c46bc,null))[_0xc3d4('0x2a')](function(_0x430fb7){if(_0x430fb7){return _0x430fb7[_0xc3d4('0x58')](_0x2cf1d6[_0xc3d4('0x36')]['ids']);}})[_0xc3d4('0x2a')](respondWithStatusCode(_0x7c46bc,null))['catch'](handleError(_0x7c46bc,null));};exports[_0xc3d4('0x59')]=function(_0x198b43,_0xef0f73,_0x2cacf8){if(_0x198b43[_0xc3d4('0x4b')]['id']){delete _0x198b43['body']['id'];}return db[_0xc3d4('0x31')]['find']({'where':{'id':_0x198b43[_0xc3d4('0x47')]['id']}})[_0xc3d4('0x2a')](handleEntityNotFound(_0xef0f73,null))['then'](function(_0x7b13db){if(_0x7b13db){_0x198b43[_0xc3d4('0x4b')][_0xc3d4('0x5a')]=_0x7b13db['id'];return db[_0xc3d4('0x4d')][_0xc3d4('0x4a')](_0x198b43['body']);}})[_0xc3d4('0x2a')](respondWithResult(_0xef0f73,null))[_0xc3d4('0x45')](handleError(_0xef0f73,null));};exports['getMessages']=function(_0x6f1bad,_0x36fa6e,_0x3cb4a2){var _0x3f861f={};var _0x1a77e5={};var _0x527b15;var _0x2b5e67;return db[_0xc3d4('0x31')][_0xc3d4('0x52')]({'where':{'id':_0x6f1bad[_0xc3d4('0x47')]['id']}})[_0xc3d4('0x2a')](handleEntityNotFound(_0x36fa6e,null))[_0xc3d4('0x2a')](function(_0x162f91){if(_0x162f91){_0x527b15=_0x162f91;_0x1a77e5['model']=_[_0xc3d4('0x53')](db[_0xc3d4('0x4d')][_0xc3d4('0x32')]);_0x1a77e5[_0xc3d4('0x36')]=_[_0xc3d4('0x53')](_0x6f1bad[_0xc3d4('0x36')]);_0x1a77e5[_0xc3d4('0x48')]=_['intersection'](_0x1a77e5[_0xc3d4('0x35')],_0x1a77e5[_0xc3d4('0x36')]);_0x3f861f[_0xc3d4('0x38')]=_[_0xc3d4('0x37')](_0x1a77e5['model'],qs[_0xc3d4('0x39')](_0x6f1bad[_0xc3d4('0x36')][_0xc3d4('0x39')]));_0x3f861f[_0xc3d4('0x38')]=_0x3f861f[_0xc3d4('0x38')][_0xc3d4('0x3a')]?_0x3f861f['attributes']:_0x1a77e5['model'];_0x3f861f[_0xc3d4('0x3b')]=qs['sort'](_0x6f1bad[_0xc3d4('0x36')][_0xc3d4('0x55')]);_0x3f861f[_0xc3d4('0x3c')]=qs[_0xc3d4('0x48')](_[_0xc3d4('0x3d')](_0x6f1bad['query'],_0x1a77e5[_0xc3d4('0x48')]));if(_0x6f1bad[_0xc3d4('0x36')]['filter']){_0x3f861f[_0xc3d4('0x3c')]=_[_0xc3d4('0x3f')](_0x3f861f[_0xc3d4('0x3c')],{'$or':_[_0xc3d4('0x30')](_0x3f861f[_0xc3d4('0x38')],function(_0xb66961){var _0x546d59={};_0x546d59[_0xb66961]={'$like':'%'+_0x6f1bad['query'][_0xc3d4('0x3e')]+'%'};return _0x546d59;})});}if(_0x6f1bad[_0xc3d4('0x36')][_0xc3d4('0x5b')]){var _0x60352c=_0x6f1bad[_0xc3d4('0x36')][_0xc3d4('0x5b')][_0xc3d4('0x5c')](',');var _0x355e0b={};_0x355e0b[_0x60352c[0x0]]={'$gte':moment(_0x60352c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3f861f['where']=_['merge'](_0x3f861f['where'],_0x355e0b);}_0x3f861f=_[_0xc3d4('0x3f')]({},_0x3f861f,_0x6f1bad[_0xc3d4('0x40')]);return _0x527b15['getMessages'](_0x3f861f);}})[_0xc3d4('0x2a')](function(_0x6c5fa9){if(_0x6c5fa9){_0x2b5e67=_0x6c5fa9[_0xc3d4('0x3a')];if(!_0x6f1bad[_0xc3d4('0x36')][_0xc3d4('0x5d')](_0xc3d4('0x56'))){_0x3f861f['limit']=qs[_0xc3d4('0x24')](_0x6f1bad[_0xc3d4('0x36')][_0xc3d4('0x24')]);_0x3f861f['offset']=qs[_0xc3d4('0x22')](_0x6f1bad['query'][_0xc3d4('0x22')]);}return _0x527b15[_0xc3d4('0x5e')](_0x3f861f);}})[_0xc3d4('0x2a')](function(_0x5d9379){if(_0x5d9379){return _0x5d9379?{'count':_0x2b5e67,'rows':_0x5d9379}:null;}})[_0xc3d4('0x2a')](respondWithResult(_0x36fa6e,null))[_0xc3d4('0x45')](handleError(_0x36fa6e,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 4d76b82..727ab96 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 _0xe2bb=['update','remove','emit','hasOwnProperty','hook','exports','save'];(function(_0x1ca29f,_0x318ac5){var _0x576c3b=function(_0x40caab){while(--_0x40caab){_0x1ca29f['push'](_0x1ca29f['shift']());}};_0x576c3b(++_0x318ac5);}(_0xe2bb,0x76));var _0xbe2b=function(_0xffc8d6,_0x5a4ef2){_0xffc8d6=_0xffc8d6-0x0;var _0x1c6060=_0xe2bb[_0xffc8d6];return _0x1c6060;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe2b('0x0'),'afterUpdate':_0xbe2b('0x1'),'afterDestroy':_0xbe2b('0x2')};function emitEvent(_0x1379c5){return function(_0x34a542,_0xd0d1ae,_0xc944a3){ChatGroupEvents[_0xbe2b('0x3')](_0x1379c5+':'+_0x34a542['id'],_0x34a542);ChatGroupEvents[_0xbe2b('0x3')](_0x1379c5,_0x34a542);_0xc944a3(null);};}for(var e in events){if(events[_0xbe2b('0x4')](e)){var event=events[e];ChatGroup[_0xbe2b('0x5')](e,emitEvent(event));}}module[_0xbe2b('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0x85d6=['setMaxListeners','save','emit','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85d6,0x135));var _0x685d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x85d6[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x685d('0x0'));var ChatGroup=require(_0x685d('0x1'))['db'][_0x685d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x685d('0x3')](0x0);var events={'afterCreate':_0x685d('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x447935){return function(_0x5074f9,_0xa4c797,_0x362db4){ChatGroupEvents[_0x685d('0x5')](_0x447935+':'+_0x5074f9['id'],_0x5074f9);ChatGroupEvents[_0x685d('0x5')](_0x447935,_0x5074f9);_0x362db4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x685d('0x6')](e,emitEvent(event));}}module[_0x685d('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 ee5da53..c34e454 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 _0x98b0=['path','rimraf','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x98b0,0x1b3));var _0x098b=function(_0x1e399a,_0x351c59){_0x1e399a=_0x1e399a-0x0;var _0x539897=_0x98b0[_0x1e399a];return _0x539897;};'use strict';var _=require(_0x098b('0x0'));var util=require('util');var logger=require(_0x098b('0x1'))(_0x098b('0x2'));var moment=require(_0x098b('0x3'));var BPromise=require(_0x098b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x098b('0x5'));var rimraf=require(_0x098b('0x6'));var config=require('../../config/environment');var attributes=require(_0x098b('0x7'));module['exports']=function(_0x1ae882,_0x28c14d){return _0x1ae882[_0x098b('0x8')](_0x098b('0x9'),attributes,{'tableName':_0x098b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb7d=['exports','ChatGroup','chat_groups','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatGroup.attributes'];(function(_0x421c08,_0x524eba){var _0x107a0b=function(_0x250416){while(--_0x250416){_0x421c08['push'](_0x421c08['shift']());}};_0x107a0b(++_0x524eba);}(_0xfb7d,0x1bf));var _0xdfb7=function(_0x40a8a4,_0x3bd1ed){_0x40a8a4=_0x40a8a4-0x0;var _0x23af3b=_0xfb7d[_0x40a8a4];return _0x23af3b;};'use strict';var _=require(_0xdfb7('0x0'));var util=require(_0xdfb7('0x1'));var logger=require(_0xdfb7('0x2'))(_0xdfb7('0x3'));var moment=require('moment');var BPromise=require(_0xdfb7('0x4'));var rp=require(_0xdfb7('0x5'));var fs=require('fs');var path=require(_0xdfb7('0x6'));var rimraf=require(_0xdfb7('0x7'));var config=require('../../config/environment');var attributes=require(_0xdfb7('0x8'));module[_0xdfb7('0x9')]=function(_0x38bf51,_0x308d85){return _0x38bf51['define'](_0xdfb7('0xa'),attributes,{'tableName':_0xdfb7('0xb'),'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 95d7b43..a9d1948 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 _0x6dac=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1ae141,_0x9b00e4){var _0x970bb1=function(_0x2252e6){while(--_0x2252e6){_0x1ae141['push'](_0x1ae141['shift']());}};_0x970bb1(++_0x9b00e4);}(_0x6dac,0x16e));var _0xc6da=function(_0x38b7e3,_0x4aa608){_0x38b7e3=_0x38b7e3-0x0;var _0x4e4b0d=_0x6dac[_0x38b7e3];return _0x4e4b0d;};'use strict';var _=require(_0xc6da('0x0'));var util=require(_0xc6da('0x1'));var moment=require(_0xc6da('0x2'));var BPromise=require(_0xc6da('0x3'));var rs=require(_0xc6da('0x4'));var fs=require('fs');var Redis=require(_0xc6da('0x5'));var db=require(_0xc6da('0x6'))['db'];var utils=require(_0xc6da('0x7'));var logger=require(_0xc6da('0x8'))(_0xc6da('0x9'));var config=require(_0xc6da('0xa'));var jayson=require(_0xc6da('0xb'));var client=jayson[_0xc6da('0xc')]['http']({'port':0x232a});config[_0xc6da('0xd')]=_[_0xc6da('0xe')](config[_0xc6da('0xd')],{'host':_0xc6da('0xf'),'port':0x18eb});var socket=require(_0xc6da('0x10'))(new Redis(config[_0xc6da('0xd')]));require(_0xc6da('0x11'))[_0xc6da('0x12')](socket);function respondWithRpcPromise(_0x13fea1,_0x48455d,_0x34b9ea){return new BPromise(function(_0x2e4eb7,_0x414831){return client[_0xc6da('0x13')](_0x13fea1,_0x34b9ea)[_0xc6da('0x14')](function(_0x27411e){logger[_0xc6da('0x15')](_0xc6da('0x16'),_0x48455d,_0xc6da('0x17'));logger[_0xc6da('0x18')](_0xc6da('0x19'),_0x48455d,_0xc6da('0x17'),JSON[_0xc6da('0x1a')](_0x27411e));if(_0x27411e['error']){if(_0x27411e[_0xc6da('0x1b')][_0xc6da('0x1c')]===0x1f4){logger[_0xc6da('0x1b')](_0xc6da('0x16'),_0x48455d,_0x27411e[_0xc6da('0x1b')][_0xc6da('0x1d')]);return _0x414831(_0x27411e['error'][_0xc6da('0x1d')]);}logger[_0xc6da('0x1b')](_0xc6da('0x16'),_0x48455d,_0x27411e[_0xc6da('0x1b')][_0xc6da('0x1d')]);return _0x2e4eb7(_0x27411e['error'][_0xc6da('0x1d')]);}else{logger['info'](_0xc6da('0x16'),_0x48455d,_0xc6da('0x17'));_0x2e4eb7(_0x27411e[_0xc6da('0x1e')][_0xc6da('0x1d')]);}})['catch'](function(_0x232565){logger[_0xc6da('0x1b')](_0xc6da('0x16'),_0x48455d,_0x232565);_0x414831(_0x232565);});});}
\ No newline at end of file
+var _0x1cc7=['result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x1cc7,0x15a));var _0x71cc=function(_0x25f2a0,_0x93ce33){_0x25f2a0=_0x25f2a0-0x0;var _0x566d49=_0x1cc7[_0x25f2a0];return _0x566d49;};'use strict';var _=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var moment=require(_0x71cc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71cc('0x3'))['db'];var utils=require(_0x71cc('0x4'));var logger=require(_0x71cc('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x71cc('0x6')]['http']({'port':0x232a});config[_0x71cc('0x7')]=_[_0x71cc('0x8')](config[_0x71cc('0x7')],{'host':_0x71cc('0x9'),'port':0x18eb});var socket=require(_0x71cc('0xa'))(new Redis(config['redis']));require(_0x71cc('0xb'))[_0x71cc('0xc')](socket);function respondWithRpcPromise(_0x47759a,_0x5ae8e7,_0x554044){return new BPromise(function(_0x50a7b7,_0x4b7514){return client[_0x71cc('0xd')](_0x47759a,_0x554044)[_0x71cc('0xe')](function(_0x37e34b){logger['info'](_0x71cc('0xf'),_0x5ae8e7,'request\x20sent');logger[_0x71cc('0x10')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5ae8e7,_0x71cc('0x11'),JSON['stringify'](_0x37e34b));if(_0x37e34b[_0x71cc('0x12')]){if(_0x37e34b[_0x71cc('0x12')][_0x71cc('0x13')]===0x1f4){logger[_0x71cc('0x12')](_0x71cc('0xf'),_0x5ae8e7,_0x37e34b['error'][_0x71cc('0x14')]);return _0x4b7514(_0x37e34b[_0x71cc('0x12')][_0x71cc('0x14')]);}logger[_0x71cc('0x12')](_0x71cc('0xf'),_0x5ae8e7,_0x37e34b[_0x71cc('0x12')][_0x71cc('0x14')]);return _0x50a7b7(_0x37e34b['error'][_0x71cc('0x14')]);}else{logger[_0x71cc('0x15')](_0x71cc('0xf'),_0x5ae8e7,_0x71cc('0x11'));_0x50a7b7(_0x37e34b[_0x71cc('0x16')][_0x71cc('0x14')]);}})['catch'](function(_0x366690){logger[_0x71cc('0x12')]('ChatGroup,\x20%s,\x20%s',_0x5ae8e7,_0x366690);_0x4b7514(_0x366690);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 10a6ff7..7863088 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 _0x4c47=['emit','register','length','chatGroup:','./chatGroup.events','save','update'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x4c47,0x10e));var _0x74c4=function(_0x3a5358,_0x18a34e){_0x3a5358=_0x3a5358-0x0;var _0x2dfe15=_0x4c47[_0x3a5358];return _0x2dfe15;};'use strict';var ChatGroupEvents=require(_0x74c4('0x0'));var events=[_0x74c4('0x1'),'remove',_0x74c4('0x2')];function createListener(_0x2e310c,_0x23b554){return function(_0x473f84){_0x23b554[_0x74c4('0x3')](_0x2e310c,_0x473f84);};}function removeListener(_0x49cc33,_0x447567){return function(){ChatGroupEvents['removeListener'](_0x49cc33,_0x447567);};}exports[_0x74c4('0x4')]=function(_0x226d73){for(var _0x2e2a94=0x0,_0xbb0154=events[_0x74c4('0x5')];_0x2e2a94<_0xbb0154;_0x2e2a94++){var _0x5ee6e2=events[_0x2e2a94];var _0x1c477f=createListener(_0x74c4('0x6')+_0x5ee6e2,_0x226d73);ChatGroupEvents['on'](_0x5ee6e2,_0x1c477f);}};
\ No newline at end of file
+var _0xfd12=['emit','removeListener','./chatGroup.events','save','remove','update'];(function(_0x370852,_0x2c7e62){var _0x40cc7e=function(_0x34a439){while(--_0x34a439){_0x370852['push'](_0x370852['shift']());}};_0x40cc7e(++_0x2c7e62);}(_0xfd12,0xf8));var _0x2fd1=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0xfd12[_0x249e96];return _0x17444c;};'use strict';var ChatGroupEvents=require(_0x2fd1('0x0'));var events=[_0x2fd1('0x1'),_0x2fd1('0x2'),_0x2fd1('0x3')];function createListener(_0x1889ae,_0x47c394){return function(_0x12bf5d){_0x47c394[_0x2fd1('0x4')](_0x1889ae,_0x12bf5d);};}function removeListener(_0x4a5aef,_0x58368d){return function(){ChatGroupEvents[_0x2fd1('0x5')](_0x4a5aef,_0x58368d);};}exports['register']=function(_0x238d53){for(var _0x3e6c6d=0x0,_0x1ed3ce=events['length'];_0x3e6c6d<_0x1ed3ce;_0x3e6c6d++){var _0x3fdf32=events[_0x3e6c6d];var _0x4df54d=createListener('chatGroup:'+_0x3fdf32,_0x238d53);ChatGroupEvents['on'](_0x3fdf32,_0x4df54d);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 6f77fcf..b29fed8 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 _0x8225=['removeMembers','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','show','/:id/unread','create','post','/:id/members','addMembers','addMessage','delete','/:id','destroy'];(function(_0x3c4682,_0x270dd2){var _0x102849=function(_0x27a6d2){while(--_0x27a6d2){_0x3c4682['push'](_0x3c4682['shift']());}};_0x102849(++_0x270dd2);}(_0x8225,0x152));var _0x5822=function(_0x3f19be,_0x5299ab){_0x3f19be=_0x3f19be-0x0;var _0x240471=_0x8225[_0x3f19be];return _0x240471;};'use strict';var multer=require('multer');var util=require(_0x5822('0x0'));var path=require(_0x5822('0x1'));var timeout=require('connect-timeout');var express=require(_0x5822('0x2'));var router=express['Router']();var fs_extra=require(_0x5822('0x3'));var auth=require(_0x5822('0x4'));var interaction=require(_0x5822('0x5'));var config=require(_0x5822('0x6'));var controller=require(_0x5822('0x7'));router[_0x5822('0x8')]('/',auth[_0x5822('0x9')](),controller['index']);router[_0x5822('0x8')](_0x5822('0xa'),auth[_0x5822('0x9')](),controller[_0x5822('0xb')]);router[_0x5822('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x5822('0xc')]);router[_0x5822('0x8')](_0x5822('0xd'),auth['isAuthenticated'](),controller['getUnread']);router[_0x5822('0x8')]('/:id/members',auth[_0x5822('0x9')](),controller['getMembers']);router['get']('/:id/messages',auth[_0x5822('0x9')](),controller['getMessages']);router['post']('/',auth[_0x5822('0x9')](),controller[_0x5822('0xe')]);router[_0x5822('0xf')](_0x5822('0x10'),auth['isAuthenticated'](),controller[_0x5822('0x11')]);router[_0x5822('0xf')]('/:id/messages',auth[_0x5822('0x9')](),controller[_0x5822('0x12')]);router['put']('/:id',auth[_0x5822('0x9')](),controller['update']);router[_0x5822('0x13')](_0x5822('0x14'),auth['isAuthenticated'](),controller[_0x5822('0x15')]);router[_0x5822('0x13')](_0x5822('0x10'),auth[_0x5822('0x9')](),controller[_0x5822('0x16')]);module[_0x5822('0x17')]=router;
\ No newline at end of file
+var _0xa127=['/describe','isAuthenticated','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','addMessage','/:id','update','delete','removeMembers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','index','get'];(function(_0xbb8e1f,_0x2612f6){var _0x49172c=function(_0xb2b222){while(--_0xb2b222){_0xbb8e1f['push'](_0xbb8e1f['shift']());}};_0x49172c(++_0x2612f6);}(_0xa127,0x16c));var _0x7a12=function(_0x37c30d,_0x468ca2){_0x37c30d=_0x37c30d-0x0;var _0x3142ba=_0xa127[_0x37c30d];return _0x3142ba;};'use strict';var multer=require(_0x7a12('0x0'));var util=require(_0x7a12('0x1'));var path=require('path');var timeout=require(_0x7a12('0x2'));var express=require(_0x7a12('0x3'));var router=express[_0x7a12('0x4')]();var fs_extra=require(_0x7a12('0x5'));var auth=require(_0x7a12('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7a12('0x7'));var controller=require(_0x7a12('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7a12('0x9')]);router[_0x7a12('0xa')](_0x7a12('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x7a12('0xa')]('/:id',auth[_0x7a12('0xc')](),controller['show']);router[_0x7a12('0xa')](_0x7a12('0xd'),auth[_0x7a12('0xc')](),controller[_0x7a12('0xe')]);router[_0x7a12('0xa')](_0x7a12('0xf'),auth[_0x7a12('0xc')](),controller[_0x7a12('0x10')]);router[_0x7a12('0xa')](_0x7a12('0x11'),auth['isAuthenticated'](),controller['getMessages']);router[_0x7a12('0x12')]('/',auth[_0x7a12('0xc')](),controller['create']);router[_0x7a12('0x12')](_0x7a12('0xf'),auth[_0x7a12('0xc')](),controller['addMembers']);router[_0x7a12('0x12')](_0x7a12('0x11'),auth[_0x7a12('0xc')](),controller[_0x7a12('0x13')]);router['put'](_0x7a12('0x14'),auth[_0x7a12('0xc')](),controller[_0x7a12('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x7a12('0x16')]('/:id/members',auth[_0x7a12('0xc')](),controller[_0x7a12('0x17')]);module[_0x7a12('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index e23918f..52b4af4 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 _0xcf6f=['TEXT','STRING','long','DATE','out','INTEGER','sequelize','BOOLEAN','ENUM','thumb','star'];(function(_0x4464f3,_0x47ad4f){var _0x3f5311=function(_0x14980b){while(--_0x14980b){_0x4464f3['push'](_0x4464f3['shift']());}};_0x3f5311(++_0x47ad4f);}(_0xcf6f,0x12f));var _0xfcf6=function(_0xa53cd9,_0x2e2a8b){_0xa53cd9=_0xa53cd9-0x0;var _0x139dc7=_0xcf6f[_0xa53cd9];return _0x139dc7;};'use strict';var Sequelize=require(_0xfcf6('0x0'));module['exports']={'closed':{'type':Sequelize[_0xfcf6('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xfcf6('0x2')]('star',_0xfcf6('0x3')),'defaultValue':_0xfcf6('0x4')},'ratingMessage':{'type':Sequelize[_0xfcf6('0x5')]},'pathTranscript':{'type':Sequelize[_0xfcf6('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xfcf6('0x6')]},'secondDisposition':{'type':Sequelize[_0xfcf6('0x6')]},'thirdDisposition':{'type':Sequelize[_0xfcf6('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xfcf6('0x6')]},'browserVersion':{'type':Sequelize[_0xfcf6('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xfcf6('0x6')]},'deviceVendor':{'type':Sequelize[_0xfcf6('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xfcf6('0x5')]},'customerIp':{'type':Sequelize[_0xfcf6('0x6')]},'formData':{'type':Sequelize[_0xfcf6('0x5')](_0xfcf6('0x7'))},'read1stAt':{'type':Sequelize[_0xfcf6('0x8')]},'lastMsgAt':{'type':Sequelize[_0xfcf6('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xfcf6('0x2')]('in',_0xfcf6('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xfcf6('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xfcf6('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xfcf6('0xa')]}};
\ No newline at end of file
+var _0x7bd8=['out','exports','BOOLEAN','INTEGER','ENUM','star','STRING','TEXT','DATE'];(function(_0x2df387,_0x1d3ea1){var _0x3b1708=function(_0x49c05b){while(--_0x49c05b){_0x2df387['push'](_0x2df387['shift']());}};_0x3b1708(++_0x1d3ea1);}(_0x7bd8,0xe2));var _0x87bd=function(_0x13665d,_0x55849d){_0x13665d=_0x13665d-0x0;var _0x2b55f4=_0x7bd8[_0x13665d];return _0x2b55f4;};'use strict';var Sequelize=require('sequelize');module[_0x87bd('0x0')]={'closed':{'type':Sequelize[_0x87bd('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x87bd('0x2')]},'ratingType':{'type':Sequelize[_0x87bd('0x3')]('star','thumb'),'defaultValue':_0x87bd('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x87bd('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x87bd('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x87bd('0x5')]},'note':{'type':Sequelize[_0x87bd('0x5')]},'browserName':{'type':Sequelize[_0x87bd('0x5')]},'browserVersion':{'type':Sequelize[_0x87bd('0x5')]},'osName':{'type':Sequelize[_0x87bd('0x5')]},'osVersion':{'type':Sequelize[_0x87bd('0x5')]},'deviceModel':{'type':Sequelize[_0x87bd('0x5')]},'deviceVendor':{'type':Sequelize[_0x87bd('0x5')]},'deviceType':{'type':Sequelize[_0x87bd('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x87bd('0x5')]},'formData':{'type':Sequelize[_0x87bd('0x6')]('long')},'read1stAt':{'type':Sequelize[_0x87bd('0x7')]},'lastMsgAt':{'type':Sequelize[_0x87bd('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x87bd('0x3')]('in',_0x87bd('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x87bd('0x5')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x87bd('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x87bd('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x87bd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 1a64232..8a63861 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 _0x89e6=['client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','stack','name','render','merge','body','agent','interaction','account','map','rawAttributes','fieldName','type','getOptions','query','user','show','params','model','ChatInteraction','filters','intersection','attributes','fields','includeAll','include','options','find','create','update','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','fullname','email','contact','POST','isNull','vidaooNote','follow','vidaooMetadata','parse','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','Sequelize','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','originalname','basename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsiteId','length','System','customer','%s%d','Visitor','agentIdentifier','website_alias','alias','agent_fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','ChatMessage','keys','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','addTags','setTags','spread','Tag','findAll','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','transcript-%d-%s.zip','Contact','lastName','push','read','Owner','mkdirSync','Chat','Account','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','firstName','value','renderFile','transcript-','.pdf','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise'];(function(_0x318256,_0xa773f3){var _0xb1e352=function(_0x4bb14e){while(--_0x4bb14e){_0x318256['push'](_0x318256['shift']());}};_0xb1e352(++_0xa773f3);}(_0x89e6,0x18c));var _0x689e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x89e6[_0x14add3];return _0x4a174f;};'use strict';var rimraf=require(_0x689e('0x0'));var zipdir=require(_0x689e('0x1'));var rp=require(_0x689e('0x2'));var moment=require(_0x689e('0x3'));var BPromise=require(_0x689e('0x4'));var Mustache=require('mustache');var util=require(_0x689e('0x5'));var path=require(_0x689e('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x689e('0x7'));var Redis=require(_0x689e('0x8'));var interaction=require(_0x689e('0x9'));var qs=require(_0x689e('0xa'));var pdf=require(_0x689e('0xb'));var logger=require(_0x689e('0xc'))(_0x689e('0xd'));var config=require(_0x689e('0xe'));var db=require(_0x689e('0xf'))['db'];config[_0x689e('0x10')]=_[_0x689e('0x11')](config[_0x689e('0x10')],{'host':_0x689e('0x12'),'port':0x18eb});var socket=require(_0x689e('0x13'))(new Redis(config['redis']));require(_0x689e('0x14'))['register'](socket);var jayson=require(_0x689e('0x15'));var client=jayson[_0x689e('0x16')]['http']({'port':0x232b});var client9004=jayson[_0x689e('0x16')][_0x689e('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x353c15,_0x39fe7d,_0x4c2624,_0x11a401){return new BPromise(function(_0x2aac49,_0x493606){var _0x5a8776=_0x11a401||client;return _0x5a8776['request'](_0x353c15,_0x4c2624)[_0x689e('0x18')](function(_0x3ecc30){logger[_0x689e('0x19')](_0x689e('0x1a'),_0x39fe7d,_0x689e('0x1b'));logger[_0x689e('0x1c')](_0x689e('0x1d'),_0x39fe7d,_0x689e('0x1b'),JSON[_0x689e('0x1e')](_0x3ecc30));if(_0x3ecc30[_0x689e('0x1f')]){if(_0x3ecc30[_0x689e('0x1f')][_0x689e('0x20')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x39fe7d,_0x3ecc30[_0x689e('0x1f')][_0x689e('0x21')]);return _0x493606(_0x3ecc30[_0x689e('0x1f')]['message']);}logger[_0x689e('0x1f')](_0x689e('0x1a'),_0x39fe7d,_0x3ecc30[_0x689e('0x1f')][_0x689e('0x21')]);return _0x2aac49(_0x3ecc30[_0x689e('0x1f')][_0x689e('0x21')]);}else{logger[_0x689e('0x19')](_0x689e('0x1a'),_0x39fe7d,_0x689e('0x1b'));_0x2aac49(_0x3ecc30[_0x689e('0x22')]['message']);}})[_0x689e('0x23')](function(_0x2f4028){logger[_0x689e('0x1f')](_0x689e('0x1a'),_0x39fe7d,_0x2f4028);_0x493606(_0x2f4028);});});}function respondWithStatusCode(_0xc16e80,_0x489b25){_0x489b25=_0x489b25||0xcc;return function(_0x136ad9){if(_0x136ad9){return _0xc16e80[_0x689e('0x24')](_0x489b25);}return _0xc16e80[_0x689e('0x25')](_0x489b25)[_0x689e('0x26')]();};}function respondWithResult(_0x59f58a,_0x533d4f){_0x533d4f=_0x533d4f||0xc8;return function(_0x33e202){if(_0x33e202){return _0x59f58a[_0x689e('0x25')](_0x533d4f)[_0x689e('0x27')](_0x33e202);}};}function respondWithFilteredResult(_0x2d1b59,_0x4fdc18){return function(_0x15d33f){if(_0x15d33f){var _0x4b5e9a=typeof _0x4fdc18[_0x689e('0x28')]===_0x689e('0x29')&&typeof _0x4fdc18[_0x689e('0x2a')]==='undefined';var _0x3650d7=_0x15d33f[_0x689e('0x2b')];var _0x1b7875=_0x4b5e9a?0x0:_0x4fdc18[_0x689e('0x28')];var _0x24ee82=_0x4b5e9a?_0x15d33f[_0x689e('0x2b')]:_0x4fdc18['offset']+_0x4fdc18['limit'];var _0x3a0248;if(_0x24ee82>=_0x3650d7){_0x24ee82=_0x3650d7;_0x3a0248=0xc8;}else{_0x3a0248=0xce;}_0x2d1b59[_0x689e('0x25')](_0x3a0248);return _0x2d1b59[_0x689e('0x2c')](_0x689e('0x2d'),_0x1b7875+'-'+_0x24ee82+'/'+_0x3650d7)['json'](_0x15d33f);}return null;};}function saveUpdates(_0x18046a){return function(_0x5278a4){if(_0x5278a4){return _0x5278a4['update'](_0x18046a)[_0x689e('0x18')](function(_0x3235d7){return _0x3235d7;});}return null;};}function removeEntity(_0x52f351){return function(_0x422f6b){if(_0x422f6b){return _0x422f6b[_0x689e('0x2e')]()[_0x689e('0x18')](function(){_0x52f351[_0x689e('0x25')](0xcc)[_0x689e('0x26')]();});}};}function handleEntityNotFound(_0x5573a9){return function(_0x3c2928){if(!_0x3c2928){_0x5573a9[_0x689e('0x24')](0x194);}return _0x3c2928;};}function handleError(_0x52c169,_0x241725){_0x241725=_0x241725||0x1f4;return function(_0x15c813){logger[_0x689e('0x1f')](_0x15c813[_0x689e('0x2f')]);if(_0x15c813[_0x689e('0x30')]){delete _0x15c813['name'];}_0x52c169[_0x689e('0x25')](_0x241725)['send'](_0x15c813);};}function getMustacheRender(_0x52b355,_0x17d5a1){return Mustache[_0x689e('0x31')](_0x52b355,_[_0x689e('0x32')](_0x17d5a1[_0x689e('0x33')],{'contact':_0x17d5a1['contact'],'message':_0x17d5a1['message'],'agent':_0x17d5a1[_0x689e('0x34')],'interaction':_0x17d5a1[_0x689e('0x35')],'account':_0x17d5a1[_0x689e('0x36')]}))||'';}exports['index']=function(_0x351d89,_0x3333b0){var _0x3d8c14={};var _0x370e9e=_[_0x689e('0x37')](db['ChatInteraction'][_0x689e('0x38')],function(_0x385cf1){return{'name':_0x385cf1[_0x689e('0x39')],'type':_0x385cf1[_0x689e('0x3a')]['key']};});_0x3d8c14=qs[_0x689e('0x3b')](_0x370e9e,_0x351d89);return interaction['findAll']('chat',_0x351d89[_0x689e('0x3c')],_0x351d89[_0x689e('0x3d')],_0x3d8c14,_0x370e9e)[_0x689e('0x18')](respondWithFilteredResult(_0x3333b0,_0x3d8c14))[_0x689e('0x23')](handleError(_0x3333b0,null));};exports[_0x689e('0x3e')]=function(_0x40e776,_0x7b66fb){var _0x3b7666={'raw':![],'where':{'id':_0x40e776[_0x689e('0x3f')]['id']}},_0x14e5fe={};_0x14e5fe[_0x689e('0x40')]=_['keys'](db[_0x689e('0x41')]['rawAttributes']);_0x14e5fe[_0x689e('0x3c')]=_['keys'](_0x40e776[_0x689e('0x3c')]);_0x14e5fe[_0x689e('0x42')]=_[_0x689e('0x43')](_0x14e5fe[_0x689e('0x40')],_0x14e5fe[_0x689e('0x3c')]);_0x3b7666[_0x689e('0x44')]=_['intersection'](_0x14e5fe[_0x689e('0x40')],qs[_0x689e('0x45')](_0x40e776[_0x689e('0x3c')]['fields']));_0x3b7666[_0x689e('0x44')]=_0x3b7666[_0x689e('0x44')]['length']?_0x3b7666[_0x689e('0x44')]:_0x14e5fe[_0x689e('0x40')];if(_0x40e776['query'][_0x689e('0x46')]){_0x3b7666[_0x689e('0x47')]=[{'all':!![]}];}_0x3b7666=_[_0x689e('0x32')]({},_0x3b7666,_0x40e776[_0x689e('0x48')]);return db[_0x689e('0x41')][_0x689e('0x49')](_0x3b7666)[_0x689e('0x18')](handleEntityNotFound(_0x7b66fb,null))['then'](respondWithResult(_0x7b66fb,null))['catch'](handleError(_0x7b66fb,null));};exports['create']=function(_0x25d6b8,_0x342f90){return db['ChatInteraction'][_0x689e('0x4a')](_0x25d6b8[_0x689e('0x33')],{})['then'](respondWithResult(_0x342f90,0xc9))['catch'](handleError(_0x342f90,null));};exports[_0x689e('0x4b')]=function(_0x47d35a,_0x5e2377){if(_0x47d35a[_0x689e('0x33')]['id']){delete _0x47d35a[_0x689e('0x33')]['id'];}return db[_0x689e('0x41')][_0x689e('0x49')]({'where':{'id':_0x47d35a['params']['id']}})[_0x689e('0x18')](handleEntityNotFound(_0x5e2377,null))[_0x689e('0x18')](saveUpdates(_0x47d35a[_0x689e('0x33')],null))[_0x689e('0x18')](respondWithResult(_0x5e2377,null))['catch'](handleError(_0x5e2377,null));};exports[_0x689e('0x2e')]=function(_0x433932,_0x38a488){return db[_0x689e('0x41')][_0x689e('0x49')]({'where':{'id':_0x433932[_0x689e('0x3f')]['id']}})[_0x689e('0x18')](handleEntityNotFound(_0x38a488,null))[_0x689e('0x18')](removeEntity(_0x38a488,null))[_0x689e('0x23')](handleError(_0x38a488,null));};exports[_0x689e('0x4c')]=function(_0x1d0273,_0xdbd1ce){return db[_0x689e('0x41')][_0x689e('0x4c')]()[_0x689e('0x18')](respondWithResult(_0xdbd1ce,null))['catch'](handleError(_0xdbd1ce,null));};exports['createVidaooSession']=function(_0x363cb9,_0x3f4513){var _0x748285=_0x363cb9[_0x689e('0x3f')]['id'];var _0xa33ab2;var _0x1dfe03;var _0x4bed94;return db[_0x689e('0x41')][_0x689e('0x4d')]({'where':{'id':_0x748285}})['then'](function(_0x3a3f20){_0xa33ab2=_0x3a3f20;return db[_0x689e('0x4e')][_0x689e('0x4d')]({'where':{'id':_0x3a3f20['ChatWebsiteId']},'attributes':['id',_0x689e('0x4f'),_0x689e('0x50'),_0x689e('0x51'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x689e('0x18')](function(_0x5b04b4){if(_0x5b04b4&&_0x5b04b4[_0x689e('0x4f')]&&_0x5b04b4['vidaooEscalation']){_0x1dfe03=_0x5b04b4;var _0x1ace3d={'interaction':{'id':_0x748285},'agent':{'id':_0x363cb9[_0x689e('0x3d')]['id'],'name':_0x363cb9[_0x689e('0x3d')]['name'],'fullname':_0x363cb9[_0x689e('0x3d')][_0x689e('0x52')],'email':_0x363cb9[_0x689e('0x3d')][_0x689e('0x53')]},'contact':_0x363cb9[_0x689e('0x33')][_0x689e('0x54')],'account':_0x363cb9[_0x689e('0x33')]['account']};var _0x2ec6ba={'rejectUnauthorized':![],'method':_0x689e('0x55'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x5b04b4[_0x689e('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x363cb9[_0x689e('0x3d')][_0x689e('0x53')]],'buttons':null,'topic':_0x1dfe03['vidaooTopic'],'note':_[_0x689e('0x56')](_0x1dfe03[_0x689e('0x57')])?null:getMustacheRender(_0x1dfe03[_0x689e('0x57')],_0x1ace3d),'metadata':null},'redirect':_0x689e('0x58'),'json':!![]};try{if(!_['isNull'](_0x1dfe03[_0x689e('0x59')])){var _0x43de72=getMustacheRender(_0x1dfe03[_0x689e('0x59')],_0x1ace3d);var _0x511f2e=JSON[_0x689e('0x5a')](_0x43de72);_0x2ec6ba['body'][_0x689e('0x5b')]=_0x511f2e;}}catch(_0x484f74){throw new db['Sequelize'][(_0x689e('0x5c'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2ec6ba);}else{throw new db['Sequelize'][(_0x689e('0x5c'))](_0x689e('0x5d'));}})[_0x689e('0x18')](function(_0x3185cf){_0x4bed94=_0x3185cf;if(_0x4bed94['id']){var _0x1f1ea7={'body':_0x4bed94[_0x689e('0x5e')],'ChatWebsiteId':_0x1dfe03['id'],'ChatInteractionId':_0xa33ab2['id'],'direction':_0x689e('0x5f'),'UserId':_0x363cb9[_0x689e('0x3d')]['id']};return db['ChatMessage'][_0x689e('0x4a')](_0x1f1ea7,{});}else{throw new db['Sequelize']['ValidationError'](_0x689e('0x60'));}})[_0x689e('0x18')](function(){return _0xa33ab2['updateAttributes']({'vidaooSessionId':_0x4bed94['id']});})[_0x689e('0x18')](respondWithResult(_0x3f4513,null))['catch'](handleError(_0x3f4513,null));};exports[_0x689e('0x61')]=function(_0x35ec05,_0x169378){if(_0x35ec05[_0x689e('0x33')]['id']){delete _0x35ec05[_0x689e('0x33')]['id'];}return db[_0x689e('0x41')][_0x689e('0x49')]({'where':{'id':_0x35ec05[_0x689e('0x3f')]['id']},'include':[{'model':db[_0x689e('0x62')],'as':'Contact'}]})[_0x689e('0x18')](handleEntityNotFound(_0x169378,null))[_0x689e('0x18')](saveUpdates(_0x35ec05[_0x689e('0x33')],null))[_0x689e('0x18')](respondWithResult(_0x169378,null))['catch'](handleError(_0x169378,null));};exports['abandon']=function(_0x2ba647,_0x16f21a){if(_0x2ba647[_0x689e('0x33')]['id']){delete _0x2ba647['body']['id'];}return db[_0x689e('0x41')][_0x689e('0x49')]({'where':{'id':_0x2ba647['params']['id']}})[_0x689e('0x18')](function(_0x5f1c9c){if(!_0x5f1c9c){logger[_0x689e('0x1f')](_0x689e('0x63'),_0x689e('0x64'),0x194,_0x689e('0x65'));_0x16f21a[_0x689e('0x24')](0x194);}else{if(_0x5f1c9c[_0x689e('0x66')]){throw new db[(_0x689e('0x67'))][(_0x689e('0x5c'))](_0x689e('0x68'));}}return _0x5f1c9c;})[_0x689e('0x18')](function(_0xe4ae1e){if(_0xe4ae1e){return _0xe4ae1e[_0x689e('0x4b')]({'closed':_0x2ba647[_0x689e('0x33')][_0x689e('0x69')],'disposition':_0x2ba647[_0x689e('0x33')][_0x689e('0x6a')]})[_0x689e('0x18')](function(_0x738c62){return _0x738c62;});}})[_0x689e('0x18')](function(){return respondWithRpcPromise(_0x689e('0x6b'),_0x689e('0x64'),_0x2ba647['body'],client9004);})[_0x689e('0x18')](respondWithResult(_0x16f21a,null))[_0x689e('0x23')](handleError(_0x16f21a,null));};exports['attachmentUpload']=function(_0x48a993,_0xb3ece){_0x48a993[_0x689e('0x33')][_0x689e('0x30')]=_0x48a993[_0x689e('0x6c')][_0x689e('0x6d')];_0x48a993[_0x689e('0x33')][_0x689e('0x6e')]=_0x48a993[_0x689e('0x6c')]['filename'];_0x48a993[_0x689e('0x33')][_0x689e('0x3a')]=_0x48a993['file'][_0x689e('0x6f')];return db[_0x689e('0x70')][_0x689e('0x4a')](_0x48a993[_0x689e('0x33')])['then'](respondWithResult(_0xb3ece,0xc9))[_0x689e('0x23')](handleError(_0xb3ece,null));};exports['attachmentDownload']=function(_0x435808,_0x1e2562){return db['ChatInteraction'][_0x689e('0x4d')]({'where':{'id':_0x435808[_0x689e('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1e2562,null))['then'](function(_0x4c769d){if(_0x4c769d){if(_0x4c769d[_0x689e('0x69')]){return _0x1e2562[_0x689e('0x25')](0x193)['json']({'status':0x193,'message':_0x689e('0x71')});}return db[_0x689e('0x70')]['findOne']({'where':{'id':_0x435808[_0x689e('0x3c')][_0x689e('0x72')]},'raw':!![]})[_0x689e('0x18')](handleEntityNotFound(_0x1e2562,null));}})['then'](function(_0x55e369){if(_0x55e369){var _0x553a2e=_0x55e369[_0x689e('0x73')]!==null;var _0x529086=path[_0x689e('0x74')](config[_0x689e('0x75')],_0x689e('0x76'));if(_0x553a2e){_0x529086=path[_0x689e('0x74')](_0x529086,_0x689e('0x77'));}var _0x4043d5=path[_0x689e('0x74')](_0x529086,_0x55e369['basename']);return _0x1e2562[_0x689e('0x78')](_0x4043d5);}})[_0x689e('0x23')](handleError(_0x1e2562,null));};exports[_0x689e('0x79')]=function(_0x31f998,_0x1f6106){var _0x4d765e=null;var _0x30f459=null;var _0x55e66b=null;if(_0x31f998[_0x689e('0x33')]['id']){delete _0x31f998[_0x689e('0x33')]['id'];}if(_0x31f998['body'][_0x689e('0x7a')]){_0x55e66b=path['join'](config['root'],_0x689e('0x7b'),util[_0x689e('0x7c')](_0x689e('0x7d'),Date[_0x689e('0x7e')]()));_0x31f998['body'][_0x689e('0x7f')]=_0x55e66b;}return db[_0x689e('0x41')][_0x689e('0x49')]({'where':{'id':_0x31f998['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x689e('0x80'),'include':[{'model':db[_0x689e('0x81')],'as':'User'}]}]})[_0x689e('0x18')](handleEntityNotFound(_0x1f6106,null))[_0x689e('0x18')](saveUpdates(_0x31f998[_0x689e('0x33')],null))[_0x689e('0x18')](function(_0x6a63e){if(_0x6a63e){_0x4d765e=_0x6a63e;return db[_0x689e('0x4e')][_0x689e('0x49')]({'where':{'id':_0x4d765e[_0x689e('0x82')]}});}})[_0x689e('0x18')](function(_0xec6fe3){if(_0xec6fe3){_0x30f459=_0xec6fe3;return db['CmContact'][_0x689e('0x49')]({'where':{'id':_0x4d765e['ContactId']}});}})[_0x689e('0x18')](function(_0x6ccd06){if(_0x6ccd06){if(_0x55e66b){var _0x47a4b8=null;for(var _0x102e64=0x1;_0x102e64<_0x4d765e[_0x689e('0x80')][_0x689e('0x83')];++_0x102e64){_0x47a4b8=_0x4d765e['Messages'][_0x102e64];var _0x41ef16=_0x47a4b8[_0x689e('0x66')]?util[_0x689e('0x7c')]('%s%d',_0x30f459['agentAlias'],_0x47a4b8['UserId']):_0x689e('0x84');var _0x5b858f=_0x31f998[_0x689e('0x33')][_0x689e('0x85')]||util[_0x689e('0x7c')](_0x689e('0x86'),_0x689e('0x87'),_0x47a4b8['ContactId']);switch(_0x30f459[_0x689e('0x88')]){case _0x689e('0x89'):_0x41ef16=_0x47a4b8[_0x689e('0x66')]?util[_0x689e('0x7c')](_0x689e('0x86'),_0x30f459['agentAlias'],_0x47a4b8['UserId']):_0x689e('0x84');break;case'agent_alias':_0x41ef16=_0x47a4b8['UserId']?_0x47a4b8['User'][_0x689e('0x8a')]||_0x47a4b8['User'][_0x689e('0x52')]:_0x689e('0x84');break;case _0x689e('0x8b'):_0x41ef16=_0x47a4b8['UserId']?_0x47a4b8[_0x689e('0x81')]['fullname']:_0x689e('0x84');break;default:_0x41ef16=_0x47a4b8[_0x689e('0x66')]?util[_0x689e('0x7c')](_0x689e('0x86'),_0x30f459[_0x689e('0x8c')],_0x47a4b8[_0x689e('0x66')]):_0x689e('0x84');}var _0x4096dc=util[_0x689e('0x7c')](_0x689e('0x8d'),moment(_0x47a4b8[_0x689e('0x8e')])[_0x689e('0x7c')]('MM/DD/YYYY\x20HH:mm:ss'),_0x47a4b8[_0x689e('0x8f')]==='in'?_0x5b858f:_0x41ef16,_0x47a4b8['body']);if(!_0x47a4b8[_0x689e('0x90')]){fs[_0x689e('0x91')](_0x55e66b,_0x4096dc);}}return db[_0x689e('0x92')][_0x689e('0x4d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x689e('0x93'),'raw':!![],'include':[{'model':db[_0x689e('0x94')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x689e('0x18')](function(_0x243bf8){if(!_0x243bf8||!_0x243bf8[_0x689e('0x93')]||!_0x31f998[_0x689e('0x33')])return _0x4d765e;var _0x23f20e=_0x243bf8[_0x689e('0x95')]();return respondWithRpcPromise('SendMail',_0x689e('0x96'),{'account':_0x23f20e,'message':{'from':util[_0x689e('0x7c')](_0x689e('0x97'),_0x243bf8['name'],_0x243bf8['email']||_0x243bf8[_0x689e('0x93')][_0x689e('0x3d')]),'to':_0x31f998[_0x689e('0x33')][_0x689e('0x7a')],'subject':'Mail\x20Transcript','text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x31f998['body']['mailTranscript']),'attachments':[{'path':_0x55e66b}]}})['then'](function(){return _0x4d765e;})[_0x689e('0x23')](function(_0x40d0a3){logger['error'](_0x40d0a3);});})['then'](respondWithStatusCode(_0x1f6106,0xc8))[_0x689e('0x23')](handleError(_0x1f6106,null));};exports[_0x689e('0x98')]=function(_0x79f5fb,_0x4957b9){return db['ChatMessage']['find']({'where':{'id':_0x79f5fb[_0x689e('0x3f')]['id']}})[_0x689e('0x18')](handleEntityNotFound(_0x4957b9,null))[_0x689e('0x18')](function(_0x5d03be){if(_0x5d03be){return _0x5d03be[_0x689e('0x98')](_0x79f5fb[_0x689e('0x33')][_0x689e('0x99')],_[_0x689e('0x9a')](_0x79f5fb['body'],[_0x689e('0x99'),'id'])||{});}})['then'](respondWithResult(_0x4957b9,null))[_0x689e('0x23')](handleError(_0x4957b9,null));};exports['getMessages']=function(_0x260874,_0x508c12){var _0x380beb={'raw':![],'where':{}};var _0x4a3192={};var _0x573ebd={'count':0x0,'rows':[]};return db[_0x689e('0x41')]['findOne']({'where':{'id':_0x260874[_0x689e('0x3f')]['id']}})[_0x689e('0x18')](handleEntityNotFound(_0x508c12,null))[_0x689e('0x18')](function(_0x4f071a){if(_0x4f071a){_0x4a3192['model']=_['keys'](db[_0x689e('0x9b')][_0x689e('0x38')]);_0x4a3192['query']=_[_0x689e('0x9c')](_0x260874[_0x689e('0x3c')]);_0x4a3192[_0x689e('0x42')]=_['intersection'](_0x4a3192[_0x689e('0x40')],_0x4a3192[_0x689e('0x3c')]);_0x380beb['attributes']=_['intersection'](_0x4a3192[_0x689e('0x40')],qs[_0x689e('0x45')](_0x260874[_0x689e('0x3c')][_0x689e('0x45')]));_0x380beb['attributes']=_0x380beb[_0x689e('0x44')]['length']?_0x380beb[_0x689e('0x44')]:_0x4a3192['model'];if(!_0x260874[_0x689e('0x3c')][_0x689e('0x9d')](_0x689e('0x9e'))){_0x380beb['limit']=qs[_0x689e('0x2a')](_0x260874[_0x689e('0x3c')]['limit']);_0x380beb[_0x689e('0x28')]=qs[_0x689e('0x28')](_0x260874[_0x689e('0x3c')][_0x689e('0x28')]);}_0x380beb[_0x689e('0x9f')]=qs[_0x689e('0xa0')](_0x260874[_0x689e('0x3c')]['sort']);_0x380beb[_0x689e('0xa1')]=qs['filters'](_[_0x689e('0xa2')](_0x260874[_0x689e('0x3c')],_0x4a3192['filters']));_0x380beb[_0x689e('0xa1')][_0x689e('0xa3')]=_0x4f071a['id'];if(_0x260874[_0x689e('0x3c')]['filter']){_0x380beb[_0x689e('0xa1')]=_['merge'](_0x380beb[_0x689e('0xa1')],{'$or':_[_0x689e('0x37')](_0x380beb[_0x689e('0x44')],function(_0x191ebb){var _0x491d45={};_0x491d45[_0x191ebb]={'$like':'%'+_0x260874[_0x689e('0x3c')][_0x689e('0xa4')]+'%'};return _0x491d45;})});}if(_0x260874[_0x689e('0x3c')][_0x689e('0xa5')]){var _0x3eaab3=_0x260874['query'][_0x689e('0xa5')][_0x689e('0xa6')](',');var _0x16e6ba={};_0x16e6ba[_0x3eaab3[0x0]]={'$gte':moment(_0x3eaab3[0x1])[_0x689e('0x7c')](_0x689e('0xa7'))};_0x380beb[_0x689e('0xa1')]=_['merge'](_0x380beb['where'],_0x16e6ba);}_0x380beb=_['merge']({},_0x380beb,_0x260874[_0x689e('0x48')]);return db[_0x689e('0x9b')][_0x689e('0x2b')]({'where':_0x380beb[_0x689e('0xa1')]})[_0x689e('0x18')](function(_0x486289){_0x573ebd[_0x689e('0x2b')]=_0x486289;if(_0x260874[_0x689e('0x3c')]['includeAll']){_0x380beb[_0x689e('0x47')]=[{'all':!![]}];}return db[_0x689e('0x9b')]['findAll'](_0x380beb);})[_0x689e('0x18')](function(_0x5c74b7){_0x573ebd[_0x689e('0xa8')]=_0x5c74b7;return _0x573ebd;});}})[_0x689e('0x18')](respondWithFilteredResult(_0x508c12,_0x380beb))['catch'](handleError(_0x508c12,null));};exports[_0x689e('0xa9')]=function(_0x431b2e,_0x1fc26d){var _0x5baf9d={'where':{}},_0x101ffc={},_0x522bb6={'count':0x0,'rows':[]};return db[_0x689e('0x41')][_0x689e('0x4d')]({'where':{'id':_0x431b2e[_0x689e('0x3f')]['id']}})[_0x689e('0x18')](handleEntityNotFound(_0x1fc26d,null))[_0x689e('0x18')](function(_0x425296){if(_0x425296){_0x101ffc[_0x689e('0x40')]=_[_0x689e('0x9c')](db['ChatMessage']['rawAttributes']);_0x101ffc[_0x689e('0x3c')]=_[_0x689e('0x9c')](_0x431b2e[_0x689e('0x3c')]);_0x101ffc[_0x689e('0x42')]=_[_0x689e('0x43')](_0x101ffc[_0x689e('0x40')],_0x101ffc[_0x689e('0x3c')]);_0x5baf9d[_0x689e('0x44')]=_[_0x689e('0x43')](_0x101ffc[_0x689e('0x40')],qs[_0x689e('0x45')](_0x431b2e[_0x689e('0x3c')][_0x689e('0x45')]));_0x5baf9d[_0x689e('0x44')]=_0x5baf9d[_0x689e('0x44')][_0x689e('0x83')]?_0x5baf9d['attributes']:_0x101ffc[_0x689e('0x40')];if(!_0x431b2e['query'][_0x689e('0x9d')](_0x689e('0x9e'))){_0x5baf9d[_0x689e('0x2a')]=qs[_0x689e('0x2a')](_0x431b2e[_0x689e('0x3c')]['limit']);_0x5baf9d[_0x689e('0x28')]=qs[_0x689e('0x28')](_0x431b2e[_0x689e('0x3c')]['offset']);}_0x5baf9d[_0x689e('0x9f')]=qs['sort'](_0x431b2e[_0x689e('0x3c')]['sort']);_0x5baf9d[_0x689e('0xa1')]=qs[_0x689e('0x42')](_[_0x689e('0xa2')](_0x431b2e[_0x689e('0x3c')],_0x101ffc['filters']));_0x5baf9d[_0x689e('0xa1')][_0x689e('0xa3')]=_0x425296['id'];if(_0x431b2e['query'][_0x689e('0xa4')]){_0x5baf9d[_0x689e('0xa1')]=_[_0x689e('0x32')](_0x5baf9d['where'],{'$or':_[_0x689e('0x37')](_0x5baf9d[_0x689e('0x44')],function(_0x1d42f7){var _0x53f6e2={};_0x53f6e2[_0x1d42f7]={'$like':'%'+_0x431b2e[_0x689e('0x3c')][_0x689e('0xa4')]+'%'};return _0x53f6e2;})});}_0x5baf9d['where'][_0x689e('0x90')]=![];if(_0x431b2e['query']['id']){_0x5baf9d[_0x689e('0xa1')]['id']={'$gt':_0x431b2e[_0x689e('0x3c')]['id']};}_0x5baf9d=_[_0x689e('0x32')]({},_0x5baf9d,_0x431b2e['options']);return db[_0x689e('0x9b')][_0x689e('0x2b')]({'where':_0x5baf9d['where']})[_0x689e('0x18')](function(_0x1ee1ee){_0x522bb6[_0x689e('0x2b')]=_0x1ee1ee;_0x5baf9d[_0x689e('0x47')]=[];if(_0x431b2e[_0x689e('0x3c')][_0x689e('0xaa')]){_0x5baf9d['include']['push']({'model':db[_0x689e('0x81')],'as':_0x689e('0x81'),'attributes':['id',_0x689e('0x52'),'alias']});}if(_0x431b2e[_0x689e('0x3c')]['includeAll']){_0x5baf9d['include']=[{'all':!![]}];}return db[_0x689e('0x9b')]['findAll'](_0x5baf9d);})[_0x689e('0x18')](function(_0x4e7871){_0x522bb6[_0x689e('0xa8')]=_0x4e7871;return _0x522bb6;});}})[_0x689e('0x18')](respondWithFilteredResult(_0x1fc26d,_0x5baf9d))[_0x689e('0x23')](handleError(_0x1fc26d,null));};exports[_0x689e('0xab')]=function(_0x2c98f5,_0x577c82){return db[_0x689e('0x41')][_0x689e('0x49')]({'where':{'id':_0x2c98f5['params']['id']}})[_0x689e('0x18')](handleEntityNotFound(_0x577c82,null))[_0x689e('0x18')](function(_0x402109){if(_0x402109){return _0x402109[_0x689e('0xac')](_0x2c98f5[_0x689e('0x33')][_0x689e('0x99')],_[_0x689e('0x9a')](_0x2c98f5[_0x689e('0x33')],['ids','id'])||{})[_0x689e('0xad')](function(){return db[_0x689e('0xae')][_0x689e('0xaf')]({'attributes':['id',_0x689e('0x30'),'color'],'where':{'id':_0x2c98f5[_0x689e('0x33')][_0x689e('0x99')]}});})[_0x689e('0x18')](function(_0x47e7c9){socket[_0x689e('0xb0')](_0x689e('0xb1'),{'id':Number(_0x2c98f5[_0x689e('0x3f')]['id']),'tags':_0x47e7c9||[]});return{'id':Number(_0x2c98f5[_0x689e('0x3f')]['id']),'tags':_0x47e7c9||[]};});}})[_0x689e('0x18')](respondWithResult(_0x577c82,null))[_0x689e('0x23')](handleError(_0x577c82,null));};exports[_0x689e('0xb2')]=function(_0x2a52a2,_0x15e3d0){return db[_0x689e('0x41')]['find']({'where':{'id':_0x2a52a2[_0x689e('0x3f')]['id']}})[_0x689e('0x18')](handleEntityNotFound(_0x15e3d0,null))['then'](function(_0x3441c6){if(_0x3441c6){return _0x3441c6[_0x689e('0xb2')](_0x2a52a2[_0x689e('0x3c')][_0x689e('0x99')]);}})[_0x689e('0x18')](respondWithStatusCode(_0x15e3d0,null))[_0x689e('0x23')](handleError(_0x15e3d0,null));};exports[_0x689e('0x78')]=function(_0x2caf68,_0x2adf61){var _0x3a982c=moment()[_0x689e('0xb3')]()[_0x689e('0xb4')]();var _0x3babee=path['join'](config[_0x689e('0x75')],_0x689e('0xb5'),_0x689e('0xb6'),_0x689e('0xb7'));var _0x55941f=path['join'](config[_0x689e('0x75')],_0x689e('0xb5'),'files','attachments');var _0x364ca8=path[_0x689e('0x74')](_0x3babee,_0x3a982c);var _0xce3ba4=util[_0x689e('0x7c')](_0x689e('0xb8'),_0x2caf68['params']['id'],_0x3a982c);var _0x48ca6a=path['join'](_0x3babee,_0xce3ba4);var _0xa27384=[];_0xa27384['push']({'model':db[_0x689e('0x81')],'as':'User','attributes':['id',_0x689e('0x52')],'raw':!![]});_0xa27384['push']({'model':db['CmContact'],'as':_0x689e('0xb9'),'attributes':['id','firstName',_0x689e('0xba')],'raw':!![]});if(_0x2caf68[_0x689e('0x3c')]['attachments']){_0xa27384[_0x689e('0xbb')]({'model':db[_0x689e('0x70')],'as':_0x689e('0x70'),'raw':!![]});}var _0xb18ff5=[{'model':db[_0x689e('0x9b')],'as':'Messages','attributes':['id',_0x689e('0x33'),_0x689e('0x8e'),_0x689e('0x8f'),'secret',_0x689e('0xbc')],'include':_0xa27384}];_0xb18ff5[_0x689e('0xbb')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0x689e('0x30')]});_0xb18ff5[_0x689e('0xbb')]({'model':db['User'],'as':_0x689e('0xbd'),'attributes':['id',_0x689e('0x52')]});return db[_0x689e('0x41')][_0x689e('0x49')]({'where':{'id':_0x2caf68['params']['id']},'include':_0xb18ff5})[_0x689e('0x18')](handleEntityNotFound(_0x2adf61,null))[_0x689e('0x18')](function(_0x28516d){if(_0x28516d){var _0x554039=_0x28516d['get']({'plain':!![]});fs[_0x689e('0xbe')](_0x364ca8);var _0x3742bf={'channel':_0x689e('0xbf'),'account':_0x554039[_0x689e('0xc0')][_0x689e('0x30')],'agent':_0x554039['Owner']?_0x554039[_0x689e('0xbd')][_0x689e('0x52')]:_0x689e('0xc1'),'createdAt':moment(_0x554039[_0x689e('0x8e')])['format'](_0x689e('0xa7'))[_0x689e('0xb4')](),'closedAt':_0x554039[_0x689e('0x69')]?moment(_0x554039[_0x689e('0xc2')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x689e('0xb4')]():'','disposition':_0x554039['disposition'],'chatInfo':{'browser':_0x554039[_0x689e('0xc3')],'os':_0x554039[_0x689e('0xc4')],'referer':_0x554039['referer'],'customerIp':_0x554039[_0x689e('0xc5')],'customerPort':_0x554039[_0x689e('0xc6')]?_0x554039[_0x689e('0xc6')]:'N.A.'},'messages':_(_0x554039[_0x689e('0x80')])[_0x689e('0xc7')]()[_0x689e('0xa4')]({'secret':![]})['map'](function(_0x192160){if(_0x192160[_0x689e('0x70')]){var _0x11d71e=path['join'](_0x55941f,_0x192160[_0x689e('0x70')]['basename']);if(fs[_0x689e('0xc8')](_0x11d71e)){fs['createReadStream'](_0x11d71e)[_0x689e('0xc9')](fs[_0x689e('0xca')](path[_0x689e('0x74')](_0x364ca8,_0x192160[_0x689e('0x70')][_0x689e('0x6e')])));}}return{'date':moment(_0x192160[_0x689e('0x8e')])['format'](_0x689e('0xa7'))[_0x689e('0xb4')](),'sender':_0x192160[_0x689e('0x8f')]===_0x689e('0x5f')?_0x192160[_0x689e('0x81')]?_0x192160['User'][_0x689e('0x52')]:'System':_0x192160[_0x689e('0xb9')][_0x689e('0xcb')]+(_0x192160[_0x689e('0xb9')][_0x689e('0xba')]?'\x20'+_0x192160['Contact'][_0x689e('0xba')]:''),'body':_0x192160['Attachment']?_0x192160[_0x689e('0x70')]['basename']:_0x192160[_0x689e('0x33')],'direction':_0x192160[_0x689e('0x8f')]===_0x689e('0x5f')?'A':'C','secret':_0x192160[_0x689e('0x90')],'read':_0x192160[_0x689e('0xbc')],'attachment':_0x192160[_0x689e('0x70')]};})[_0x689e('0xcc')]()};return ejs[_0x689e('0xcd')](path['join'](config[_0x689e('0x75')],'server','views','downloadInteraction.ejs'),{'interaction':_0x3742bf})[_0x689e('0x18')](function(_0x41464a){var _0x32804c=path[_0x689e('0x74')](_0x364ca8,_0x689e('0xce')+_0x554039['id']+'-'+_0x3a982c+_0x689e('0xcf'));var _0x505e52={'path':_0x32804c,'channel':'Chat','interactionId':_0x554039['id']};return pdf['createPdfFromHTML'](_0x41464a,_0x505e52);})[_0x689e('0x18')](function(){return new Promise(function(_0x2ba195,_0x235d41){zipdir(_0x364ca8,{'saveTo':_0x48ca6a},function(_0x35780f,_0xcf7feb){if(_0x35780f)return _0x235d41(_0x35780f);return _0x2ba195(_0xcf7feb);});})[_0x689e('0x18')](function(){return new BPromise(function(_0x21b111,_0xca82b4){rimraf(_0x364ca8,function(_0x151e1f){if(_0x151e1f)_0xca82b4(_0x151e1f);return _0x21b111();});});})[_0x689e('0x18')](function(){return _0x2adf61[_0x689e('0x78')](_0x48ca6a,_0xce3ba4,function(_0x2edf95){if(_0x2edf95){logger[_0x689e('0x1f')]('err',_0x2edf95);}else{fs[_0x689e('0xd0')](_0x48ca6a);}});});});}else{return _0x2adf61[_0x689e('0x24')](0xc8);}})[_0x689e('0x23')](handleError(_0x2adf61,null));};
\ No newline at end of file
+var _0x6be2=['keys','filters','intersection','fields','length','attributes','includeAll','options','ChatInteraction','find','create','update','describe','findOne','ChatWebsiteId','vidaooApiKey','vidaooNote','vidaooMetadata','fullname','email','contact','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','parse','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','ValidationError','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','attachmentUpload','originalname','file','filename','type','mimetype','Attachment','attachmentDownload','closed','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','basename','download','close','mailTranscript','transcript-%s.txt','Messages','User','ChatWebsite','CmContact','ContactId','format','UserId','System','customer','Visitor','agentIdentifier','%s%d','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','appendFileSync','Smtp','getSmtpOptions','\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','order','sort','where','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','include','rows','getMyMessages','hasOwnProperty','nolimit','secret','push','addTags','Tag','emit','chatInteractionTags:save','removeTags','server','tmp','files','transcript-%d-%s.zip','Contact','firstName','lastName','direction','Account','Owner','get','mkdirSync','N.A.','createdAt','toString','closedAt','osName','customerPort','tail','createReadStream','pipe','value','renderFile','downloadInteraction.ejs','.pdf','Chat','err','unlinkSync','rimraf','zip-dir','moment','mustache','util','path','ejs','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','sendStatus','end','json','offset','undefined','limit','count','set','destroy','status','name','send','render','merge','body','agent','interaction','account','map','rawAttributes','key','getOptions','findAll','chat','query','user','catch','show','params','model'];(function(_0x290ced,_0x2ca190){var _0x39ceae=function(_0x1e3cdf){while(--_0x1e3cdf){_0x290ced['push'](_0x290ced['shift']());}};_0x39ceae(++_0x2ca190);}(_0x6be2,0x147));var _0x26be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6be2[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0x26be('0x0'));var zipdir=require(_0x26be('0x1'));var rp=require('request-promise');var moment=require(_0x26be('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x26be('0x3'));var util=require(_0x26be('0x4'));var path=require(_0x26be('0x5'));var ejs=require(_0x26be('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x26be('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x26be('0x8'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x26be('0x9'));var config=require('../../config/environment');var db=require(_0x26be('0xa'))['db'];config[_0x26be('0xb')]=_[_0x26be('0xc')](config[_0x26be('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x26be('0xb')]));require(_0x26be('0xd'))[_0x26be('0xe')](socket);var jayson=require(_0x26be('0xf'));var client=jayson[_0x26be('0x10')][_0x26be('0x11')]({'port':0x232b});var client9004=jayson[_0x26be('0x10')][_0x26be('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x227629,_0x2707b6,_0x1b34b3,_0x4ff5e9){return new BPromise(function(_0x12bd2d,_0x1f1ac0){var _0x18767a=_0x4ff5e9||client;return _0x18767a['request'](_0x227629,_0x1b34b3)[_0x26be('0x12')](function(_0x5eba44){logger[_0x26be('0x13')](_0x26be('0x14'),_0x2707b6,'request\x20sent');logger[_0x26be('0x15')](_0x26be('0x16'),_0x2707b6,'request\x20sent',JSON[_0x26be('0x17')](_0x5eba44));if(_0x5eba44['error']){if(_0x5eba44['error'][_0x26be('0x18')]===0x1f4){logger[_0x26be('0x19')](_0x26be('0x14'),_0x2707b6,_0x5eba44['error'][_0x26be('0x1a')]);return _0x1f1ac0(_0x5eba44[_0x26be('0x19')][_0x26be('0x1a')]);}logger[_0x26be('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x2707b6,_0x5eba44[_0x26be('0x19')][_0x26be('0x1a')]);return _0x12bd2d(_0x5eba44['error'][_0x26be('0x1a')]);}else{logger[_0x26be('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x2707b6,_0x26be('0x1b'));_0x12bd2d(_0x5eba44[_0x26be('0x1c')][_0x26be('0x1a')]);}})['catch'](function(_0x5d18f1){logger[_0x26be('0x19')](_0x26be('0x14'),_0x2707b6,_0x5d18f1);_0x1f1ac0(_0x5d18f1);});});}function respondWithStatusCode(_0x3a8639,_0x59bb01){_0x59bb01=_0x59bb01||0xcc;return function(_0x581c2b){if(_0x581c2b){return _0x3a8639[_0x26be('0x1d')](_0x59bb01);}return _0x3a8639['status'](_0x59bb01)[_0x26be('0x1e')]();};}function respondWithResult(_0x369d32,_0x262c94){_0x262c94=_0x262c94||0xc8;return function(_0x1db451){if(_0x1db451){return _0x369d32['status'](_0x262c94)[_0x26be('0x1f')](_0x1db451);}};}function respondWithFilteredResult(_0x3d0424,_0x56a983){return function(_0xf80e5d){if(_0xf80e5d){var _0x1fc1de=typeof _0x56a983[_0x26be('0x20')]===_0x26be('0x21')&&typeof _0x56a983[_0x26be('0x22')]==='undefined';var _0x2bb3e1=_0xf80e5d[_0x26be('0x23')];var _0x503bed=_0x1fc1de?0x0:_0x56a983[_0x26be('0x20')];var _0x5c4801=_0x1fc1de?_0xf80e5d[_0x26be('0x23')]:_0x56a983[_0x26be('0x20')]+_0x56a983[_0x26be('0x22')];var _0x31391c;if(_0x5c4801>=_0x2bb3e1){_0x5c4801=_0x2bb3e1;_0x31391c=0xc8;}else{_0x31391c=0xce;}_0x3d0424['status'](_0x31391c);return _0x3d0424[_0x26be('0x24')]('Content-Range',_0x503bed+'-'+_0x5c4801+'/'+_0x2bb3e1)[_0x26be('0x1f')](_0xf80e5d);}return null;};}function saveUpdates(_0x4feca1){return function(_0x556801){if(_0x556801){return _0x556801['update'](_0x4feca1)[_0x26be('0x12')](function(_0xe8215e){return _0xe8215e;});}return null;};}function removeEntity(_0x4b7a45){return function(_0x3fb781){if(_0x3fb781){return _0x3fb781[_0x26be('0x25')]()[_0x26be('0x12')](function(){_0x4b7a45[_0x26be('0x26')](0xcc)[_0x26be('0x1e')]();});}};}function handleEntityNotFound(_0x40caea){return function(_0x4635cd){if(!_0x4635cd){_0x40caea[_0x26be('0x1d')](0x194);}return _0x4635cd;};}function handleError(_0x4fdda1,_0x284b08){_0x284b08=_0x284b08||0x1f4;return function(_0x5bf73a){logger[_0x26be('0x19')](_0x5bf73a['stack']);if(_0x5bf73a[_0x26be('0x27')]){delete _0x5bf73a['name'];}_0x4fdda1[_0x26be('0x26')](_0x284b08)[_0x26be('0x28')](_0x5bf73a);};}function getMustacheRender(_0x4028ab,_0x9ec039){return Mustache[_0x26be('0x29')](_0x4028ab,_[_0x26be('0x2a')](_0x9ec039[_0x26be('0x2b')],{'contact':_0x9ec039['contact'],'message':_0x9ec039[_0x26be('0x1a')],'agent':_0x9ec039[_0x26be('0x2c')],'interaction':_0x9ec039[_0x26be('0x2d')],'account':_0x9ec039[_0x26be('0x2e')]}))||'';}exports['index']=function(_0x303104,_0xbdc6d2){var _0x574a46={};var _0x48f029=_[_0x26be('0x2f')](db['ChatInteraction'][_0x26be('0x30')],function(_0x2cf6fd){return{'name':_0x2cf6fd['fieldName'],'type':_0x2cf6fd['type'][_0x26be('0x31')]};});_0x574a46=qs[_0x26be('0x32')](_0x48f029,_0x303104);return interaction[_0x26be('0x33')](_0x26be('0x34'),_0x303104[_0x26be('0x35')],_0x303104[_0x26be('0x36')],_0x574a46,_0x48f029)[_0x26be('0x12')](respondWithFilteredResult(_0xbdc6d2,_0x574a46))[_0x26be('0x37')](handleError(_0xbdc6d2,null));};exports[_0x26be('0x38')]=function(_0xe4115c,_0x401d76){var _0x8d6858={'raw':![],'where':{'id':_0xe4115c[_0x26be('0x39')]['id']}},_0x1e27ba={};_0x1e27ba[_0x26be('0x3a')]=_[_0x26be('0x3b')](db['ChatInteraction'][_0x26be('0x30')]);_0x1e27ba['query']=_['keys'](_0xe4115c[_0x26be('0x35')]);_0x1e27ba[_0x26be('0x3c')]=_[_0x26be('0x3d')](_0x1e27ba[_0x26be('0x3a')],_0x1e27ba[_0x26be('0x35')]);_0x8d6858['attributes']=_[_0x26be('0x3d')](_0x1e27ba[_0x26be('0x3a')],qs[_0x26be('0x3e')](_0xe4115c[_0x26be('0x35')][_0x26be('0x3e')]));_0x8d6858['attributes']=_0x8d6858['attributes'][_0x26be('0x3f')]?_0x8d6858[_0x26be('0x40')]:_0x1e27ba[_0x26be('0x3a')];if(_0xe4115c[_0x26be('0x35')][_0x26be('0x41')]){_0x8d6858['include']=[{'all':!![]}];}_0x8d6858=_['merge']({},_0x8d6858,_0xe4115c[_0x26be('0x42')]);return db[_0x26be('0x43')][_0x26be('0x44')](_0x8d6858)[_0x26be('0x12')](handleEntityNotFound(_0x401d76,null))[_0x26be('0x12')](respondWithResult(_0x401d76,null))[_0x26be('0x37')](handleError(_0x401d76,null));};exports[_0x26be('0x45')]=function(_0x3771d8,_0x45ac59){return db[_0x26be('0x43')][_0x26be('0x45')](_0x3771d8['body'],{})[_0x26be('0x12')](respondWithResult(_0x45ac59,0xc9))['catch'](handleError(_0x45ac59,null));};exports[_0x26be('0x46')]=function(_0x39c9d8,_0xcc04de){if(_0x39c9d8[_0x26be('0x2b')]['id']){delete _0x39c9d8['body']['id'];}return db[_0x26be('0x43')]['find']({'where':{'id':_0x39c9d8['params']['id']}})[_0x26be('0x12')](handleEntityNotFound(_0xcc04de,null))[_0x26be('0x12')](saveUpdates(_0x39c9d8['body'],null))[_0x26be('0x12')](respondWithResult(_0xcc04de,null))[_0x26be('0x37')](handleError(_0xcc04de,null));};exports[_0x26be('0x25')]=function(_0x3552fe,_0x52c7a3){return db['ChatInteraction'][_0x26be('0x44')]({'where':{'id':_0x3552fe[_0x26be('0x39')]['id']}})[_0x26be('0x12')](handleEntityNotFound(_0x52c7a3,null))[_0x26be('0x12')](removeEntity(_0x52c7a3,null))[_0x26be('0x37')](handleError(_0x52c7a3,null));};exports[_0x26be('0x47')]=function(_0x64cec,_0x226b5b){return db['ChatInteraction'][_0x26be('0x47')]()[_0x26be('0x12')](respondWithResult(_0x226b5b,null))[_0x26be('0x37')](handleError(_0x226b5b,null));};exports['createVidaooSession']=function(_0x450090,_0xbc932e){var _0x1fb3a5=_0x450090[_0x26be('0x39')]['id'];var _0x93c47e;var _0x5e2284;var _0x4b7b5b;return db['ChatInteraction'][_0x26be('0x48')]({'where':{'id':_0x1fb3a5}})[_0x26be('0x12')](function(_0x1b4c9b){_0x93c47e=_0x1b4c9b;return db['ChatWebsite'][_0x26be('0x48')]({'where':{'id':_0x1b4c9b[_0x26be('0x49')]},'attributes':['id',_0x26be('0x4a'),'vidaooEscalation','vidaooTopic',_0x26be('0x4b'),_0x26be('0x4c')],'raw':!![]});})['then'](function(_0x520896){if(_0x520896&&_0x520896['vidaooApiKey']&&_0x520896['vidaooEscalation']){_0x5e2284=_0x520896;var _0x28c39e={'interaction':{'id':_0x1fb3a5},'agent':{'id':_0x450090[_0x26be('0x36')]['id'],'name':_0x450090[_0x26be('0x36')][_0x26be('0x27')],'fullname':_0x450090[_0x26be('0x36')][_0x26be('0x4d')],'email':_0x450090['user'][_0x26be('0x4e')]},'contact':_0x450090[_0x26be('0x2b')][_0x26be('0x4f')],'account':_0x450090[_0x26be('0x2b')][_0x26be('0x2e')]};var _0xf6cb84={'rejectUnauthorized':![],'method':'POST','url':_0x26be('0x50'),'headers':{'X-APIKEY':_0x520896[_0x26be('0x4a')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x450090[_0x26be('0x36')][_0x26be('0x4e')]],'buttons':null,'topic':_0x5e2284[_0x26be('0x51')],'note':_['isNull'](_0x5e2284['vidaooNote'])?null:getMustacheRender(_0x5e2284[_0x26be('0x4b')],_0x28c39e),'metadata':null},'redirect':_0x26be('0x52'),'json':!![]};try{if(!_[_0x26be('0x53')](_0x5e2284[_0x26be('0x4c')])){var _0x354243=getMustacheRender(_0x5e2284['vidaooMetadata'],_0x28c39e);var _0x304cd4=JSON[_0x26be('0x54')](_0x354243);_0xf6cb84[_0x26be('0x2b')]['metadata']=_0x304cd4;}}catch(_0x228679){throw new db[(_0x26be('0x55'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xf6cb84);}else{throw new db[(_0x26be('0x55'))]['ValidationError'](_0x26be('0x56'));}})['then'](function(_0x5ca608){_0x4b7b5b=_0x5ca608;if(_0x4b7b5b['id']){var _0x1fa23c={'body':_0x4b7b5b[_0x26be('0x57')],'ChatWebsiteId':_0x5e2284['id'],'ChatInteractionId':_0x93c47e['id'],'direction':_0x26be('0x58'),'UserId':_0x450090[_0x26be('0x36')]['id']};return db[_0x26be('0x59')]['create'](_0x1fa23c,{});}else{throw new db[(_0x26be('0x55'))][(_0x26be('0x5a'))](_0x26be('0x5b'));}})[_0x26be('0x12')](function(){return _0x93c47e[_0x26be('0x5c')]({'vidaooSessionId':_0x4b7b5b['id']});})[_0x26be('0x12')](respondWithResult(_0xbc932e,null))[_0x26be('0x37')](handleError(_0xbc932e,null));};exports[_0x26be('0x5d')]=function(_0x5d9516,_0x28dece){if(_0x5d9516[_0x26be('0x2b')]['id']){delete _0x5d9516[_0x26be('0x2b')]['id'];}return db[_0x26be('0x43')]['find']({'where':{'id':_0x5d9516['params']['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x26be('0x12')](handleEntityNotFound(_0x28dece,null))['then'](saveUpdates(_0x5d9516[_0x26be('0x2b')],null))[_0x26be('0x12')](respondWithResult(_0x28dece,null))['catch'](handleError(_0x28dece,null));};exports[_0x26be('0x5e')]=function(_0x16bf8b,_0x5500ce){if(_0x16bf8b[_0x26be('0x2b')]['id']){delete _0x16bf8b[_0x26be('0x2b')]['id'];}return db[_0x26be('0x43')][_0x26be('0x44')]({'where':{'id':_0x16bf8b[_0x26be('0x39')]['id']}})[_0x26be('0x12')](function(_0x22943c){if(!_0x22943c){logger[_0x26be('0x19')](_0x26be('0x5f'),'abandon',0x194,_0x26be('0x60'));_0x5500ce[_0x26be('0x1d')](0x194);}else{if(_0x22943c['UserId']){throw new db[(_0x26be('0x55'))][(_0x26be('0x5a'))](_0x26be('0x61'));}}return _0x22943c;})[_0x26be('0x12')](function(_0x46f9a1){if(_0x46f9a1){return _0x46f9a1['update']({'closed':_0x16bf8b[_0x26be('0x2b')]['closed'],'disposition':_0x16bf8b[_0x26be('0x2b')][_0x26be('0x62')]})[_0x26be('0x12')](function(_0x4977d5){return _0x4977d5;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0x26be('0x5e'),_0x16bf8b[_0x26be('0x2b')],client9004);})[_0x26be('0x12')](respondWithResult(_0x5500ce,null))[_0x26be('0x37')](handleError(_0x5500ce,null));};exports[_0x26be('0x63')]=function(_0x3c806f,_0x1c1150){_0x3c806f[_0x26be('0x2b')][_0x26be('0x27')]=_0x3c806f['file'][_0x26be('0x64')];_0x3c806f['body']['basename']=_0x3c806f[_0x26be('0x65')][_0x26be('0x66')];_0x3c806f[_0x26be('0x2b')][_0x26be('0x67')]=_0x3c806f[_0x26be('0x65')][_0x26be('0x68')];return db[_0x26be('0x69')][_0x26be('0x45')](_0x3c806f[_0x26be('0x2b')])[_0x26be('0x12')](respondWithResult(_0x1c1150,0xc9))['catch'](handleError(_0x1c1150,null));};exports[_0x26be('0x6a')]=function(_0x2d645a,_0x525269){return db['ChatInteraction'][_0x26be('0x48')]({'where':{'id':_0x2d645a[_0x26be('0x39')]['id']},'raw':!![]})[_0x26be('0x12')](handleEntityNotFound(_0x525269,null))[_0x26be('0x12')](function(_0xb0dc1d){if(_0xb0dc1d){if(_0xb0dc1d[_0x26be('0x6b')]){return _0x525269[_0x26be('0x26')](0x193)[_0x26be('0x1f')]({'status':0x193,'message':'Unauthorized'});}return db[_0x26be('0x69')]['findOne']({'where':{'id':_0x2d645a[_0x26be('0x35')][_0x26be('0x6c')]},'raw':!![]})[_0x26be('0x12')](handleEntityNotFound(_0x525269,null));}})['then'](function(_0x39049e){if(_0x39049e){var _0x26ed51=_0x39049e[_0x26be('0x6d')]!==null;var _0x403f93=path[_0x26be('0x6e')](config[_0x26be('0x6f')],_0x26be('0x70'));if(_0x26ed51){_0x403f93=path[_0x26be('0x6e')](_0x403f93,'offline-chat/');}var _0x58be41=path[_0x26be('0x6e')](_0x403f93,_0x39049e[_0x26be('0x71')]);return _0x525269[_0x26be('0x72')](_0x58be41);}})[_0x26be('0x37')](handleError(_0x525269,null));};exports[_0x26be('0x73')]=function(_0x4b94e5,_0x536d7c){var _0x3513e2=null;var _0x168148=null;var _0xe2cfca=null;if(_0x4b94e5['body']['id']){delete _0x4b94e5[_0x26be('0x2b')]['id'];}if(_0x4b94e5[_0x26be('0x2b')][_0x26be('0x74')]){_0xe2cfca=path[_0x26be('0x6e')](config['root'],'server/files/chat/upload/',util['format'](_0x26be('0x75'),Date['now']()));_0x4b94e5[_0x26be('0x2b')]['pathTranscript']=_0xe2cfca;}return db[_0x26be('0x43')][_0x26be('0x44')]({'where':{'id':_0x4b94e5[_0x26be('0x39')]['id']},'include':[{'model':db[_0x26be('0x59')],'as':_0x26be('0x76'),'include':[{'model':db[_0x26be('0x77')],'as':'User'}]}]})[_0x26be('0x12')](handleEntityNotFound(_0x536d7c,null))[_0x26be('0x12')](saveUpdates(_0x4b94e5[_0x26be('0x2b')],null))[_0x26be('0x12')](function(_0x2eef68){if(_0x2eef68){_0x3513e2=_0x2eef68;return db[_0x26be('0x78')][_0x26be('0x44')]({'where':{'id':_0x3513e2['ChatWebsiteId']}});}})['then'](function(_0x2e2415){if(_0x2e2415){_0x168148=_0x2e2415;return db[_0x26be('0x79')][_0x26be('0x44')]({'where':{'id':_0x3513e2[_0x26be('0x7a')]}});}})[_0x26be('0x12')](function(_0x2f2e1c){if(_0x2f2e1c){if(_0xe2cfca){var _0x19ca4c=null;for(var _0xbf5ca5=0x1;_0xbf5ca5<_0x3513e2[_0x26be('0x76')]['length'];++_0xbf5ca5){_0x19ca4c=_0x3513e2['Messages'][_0xbf5ca5];var _0x415a8e=_0x19ca4c['UserId']?util[_0x26be('0x7b')]('%s%d',_0x168148['agentAlias'],_0x19ca4c[_0x26be('0x7c')]):_0x26be('0x7d');var _0x1a702f=_0x4b94e5[_0x26be('0x2b')][_0x26be('0x7e')]||util[_0x26be('0x7b')]('%s%d',_0x26be('0x7f'),_0x19ca4c[_0x26be('0x7a')]);switch(_0x168148[_0x26be('0x80')]){case'website_alias':_0x415a8e=_0x19ca4c['UserId']?util[_0x26be('0x7b')](_0x26be('0x81'),_0x168148[_0x26be('0x82')],_0x19ca4c['UserId']):_0x26be('0x7d');break;case _0x26be('0x83'):_0x415a8e=_0x19ca4c[_0x26be('0x7c')]?_0x19ca4c[_0x26be('0x77')][_0x26be('0x84')]||_0x19ca4c[_0x26be('0x77')][_0x26be('0x4d')]:_0x26be('0x7d');break;case _0x26be('0x85'):_0x415a8e=_0x19ca4c[_0x26be('0x7c')]?_0x19ca4c[_0x26be('0x77')][_0x26be('0x4d')]:_0x26be('0x7d');break;default:_0x415a8e=_0x19ca4c['UserId']?util[_0x26be('0x7b')]('%s%d',_0x168148[_0x26be('0x82')],_0x19ca4c[_0x26be('0x7c')]):_0x26be('0x7d');}var _0x2c322a=util['format'](_0x26be('0x86'),moment(_0x19ca4c['createdAt'])[_0x26be('0x7b')]('MM/DD/YYYY\x20HH:mm:ss'),_0x19ca4c['direction']==='in'?_0x1a702f:_0x415a8e,_0x19ca4c[_0x26be('0x2b')]);if(!_0x19ca4c['secret']){fs[_0x26be('0x87')](_0xe2cfca,_0x2c322a);}}return db['MailAccount'][_0x26be('0x48')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x26be('0x88'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x26be('0x12')](function(_0x4efbdc){if(!_0x4efbdc||!_0x4efbdc[_0x26be('0x88')]||!_0x4b94e5['body'])return _0x3513e2;var _0x3d3a28=_0x4efbdc[_0x26be('0x89')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x3d3a28,'message':{'from':util[_0x26be('0x7b')](_0x26be('0x8a'),_0x4efbdc[_0x26be('0x27')],_0x4efbdc['email']||_0x4efbdc['Smtp'][_0x26be('0x36')]),'to':_0x4b94e5['body'][_0x26be('0x74')],'subject':_0x26be('0x8b'),'text':util[_0x26be('0x7b')](_0x26be('0x8c'),_0x4b94e5[_0x26be('0x2b')]['mailTranscript']),'attachments':[{'path':_0xe2cfca}]}})[_0x26be('0x12')](function(){return _0x3513e2;})[_0x26be('0x37')](function(_0x67e664){logger[_0x26be('0x19')](_0x67e664);});})[_0x26be('0x12')](respondWithStatusCode(_0x536d7c,0xc8))[_0x26be('0x37')](handleError(_0x536d7c,null));};exports['addMessage']=function(_0x12a217,_0x5e150a){return db[_0x26be('0x59')][_0x26be('0x44')]({'where':{'id':_0x12a217[_0x26be('0x39')]['id']}})[_0x26be('0x12')](handleEntityNotFound(_0x5e150a,null))[_0x26be('0x12')](function(_0x2c6689){if(_0x2c6689){return _0x2c6689[_0x26be('0x8d')](_0x12a217['body'][_0x26be('0x8e')],_[_0x26be('0x8f')](_0x12a217['body'],[_0x26be('0x8e'),'id'])||{});}})['then'](respondWithResult(_0x5e150a,null))['catch'](handleError(_0x5e150a,null));};exports[_0x26be('0x90')]=function(_0x1e93d0,_0x41ec6e){var _0x3e2d84={'raw':![],'where':{}};var _0x576c4f={};var _0x1a8cc7={'count':0x0,'rows':[]};return db[_0x26be('0x43')]['findOne']({'where':{'id':_0x1e93d0['params']['id']}})[_0x26be('0x12')](handleEntityNotFound(_0x41ec6e,null))['then'](function(_0x355302){if(_0x355302){_0x576c4f[_0x26be('0x3a')]=_['keys'](db[_0x26be('0x59')][_0x26be('0x30')]);_0x576c4f[_0x26be('0x35')]=_[_0x26be('0x3b')](_0x1e93d0[_0x26be('0x35')]);_0x576c4f[_0x26be('0x3c')]=_[_0x26be('0x3d')](_0x576c4f['model'],_0x576c4f[_0x26be('0x35')]);_0x3e2d84[_0x26be('0x40')]=_[_0x26be('0x3d')](_0x576c4f[_0x26be('0x3a')],qs['fields'](_0x1e93d0[_0x26be('0x35')][_0x26be('0x3e')]));_0x3e2d84[_0x26be('0x40')]=_0x3e2d84['attributes'][_0x26be('0x3f')]?_0x3e2d84[_0x26be('0x40')]:_0x576c4f[_0x26be('0x3a')];if(!_0x1e93d0['query']['hasOwnProperty']('nolimit')){_0x3e2d84[_0x26be('0x22')]=qs[_0x26be('0x22')](_0x1e93d0['query'][_0x26be('0x22')]);_0x3e2d84[_0x26be('0x20')]=qs[_0x26be('0x20')](_0x1e93d0[_0x26be('0x35')][_0x26be('0x20')]);}_0x3e2d84[_0x26be('0x91')]=qs[_0x26be('0x92')](_0x1e93d0[_0x26be('0x35')][_0x26be('0x92')]);_0x3e2d84[_0x26be('0x93')]=qs[_0x26be('0x3c')](_[_0x26be('0x94')](_0x1e93d0[_0x26be('0x35')],_0x576c4f[_0x26be('0x3c')]));_0x3e2d84['where'][_0x26be('0x95')]=_0x355302['id'];if(_0x1e93d0[_0x26be('0x35')][_0x26be('0x96')]){_0x3e2d84[_0x26be('0x93')]=_[_0x26be('0x2a')](_0x3e2d84['where'],{'$or':_['map'](_0x3e2d84[_0x26be('0x40')],function(_0x187928){var _0x5b823d={};_0x5b823d[_0x187928]={'$like':'%'+_0x1e93d0['query']['filter']+'%'};return _0x5b823d;})});}if(_0x1e93d0[_0x26be('0x35')][_0x26be('0x97')]){var _0x5afe8d=_0x1e93d0[_0x26be('0x35')][_0x26be('0x97')]['split'](',');var _0x1bd6a2={};_0x1bd6a2[_0x5afe8d[0x0]]={'$gte':moment(_0x5afe8d[0x1])[_0x26be('0x7b')](_0x26be('0x98'))};_0x3e2d84[_0x26be('0x93')]=_[_0x26be('0x2a')](_0x3e2d84[_0x26be('0x93')],_0x1bd6a2);}_0x3e2d84=_[_0x26be('0x2a')]({},_0x3e2d84,_0x1e93d0[_0x26be('0x42')]);return db[_0x26be('0x59')]['count']({'where':_0x3e2d84['where']})[_0x26be('0x12')](function(_0x4b9a21){_0x1a8cc7[_0x26be('0x23')]=_0x4b9a21;if(_0x1e93d0[_0x26be('0x35')][_0x26be('0x41')]){_0x3e2d84[_0x26be('0x99')]=[{'all':!![]}];}return db[_0x26be('0x59')][_0x26be('0x33')](_0x3e2d84);})['then'](function(_0x1ee155){_0x1a8cc7[_0x26be('0x9a')]=_0x1ee155;return _0x1a8cc7;});}})['then'](respondWithFilteredResult(_0x41ec6e,_0x3e2d84))[_0x26be('0x37')](handleError(_0x41ec6e,null));};exports[_0x26be('0x9b')]=function(_0x377369,_0x5226ae){var _0x1b3573={'where':{}},_0x3096b4={},_0x4cdd91={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x377369[_0x26be('0x39')]['id']}})['then'](handleEntityNotFound(_0x5226ae,null))[_0x26be('0x12')](function(_0x2a71cc){if(_0x2a71cc){_0x3096b4[_0x26be('0x3a')]=_[_0x26be('0x3b')](db[_0x26be('0x59')][_0x26be('0x30')]);_0x3096b4[_0x26be('0x35')]=_[_0x26be('0x3b')](_0x377369[_0x26be('0x35')]);_0x3096b4['filters']=_[_0x26be('0x3d')](_0x3096b4[_0x26be('0x3a')],_0x3096b4['query']);_0x1b3573[_0x26be('0x40')]=_[_0x26be('0x3d')](_0x3096b4[_0x26be('0x3a')],qs['fields'](_0x377369['query'][_0x26be('0x3e')]));_0x1b3573[_0x26be('0x40')]=_0x1b3573['attributes']['length']?_0x1b3573[_0x26be('0x40')]:_0x3096b4[_0x26be('0x3a')];if(!_0x377369[_0x26be('0x35')][_0x26be('0x9c')](_0x26be('0x9d'))){_0x1b3573[_0x26be('0x22')]=qs[_0x26be('0x22')](_0x377369[_0x26be('0x35')][_0x26be('0x22')]);_0x1b3573[_0x26be('0x20')]=qs[_0x26be('0x20')](_0x377369[_0x26be('0x35')][_0x26be('0x20')]);}_0x1b3573[_0x26be('0x91')]=qs[_0x26be('0x92')](_0x377369[_0x26be('0x35')][_0x26be('0x92')]);_0x1b3573['where']=qs['filters'](_['pick'](_0x377369[_0x26be('0x35')],_0x3096b4['filters']));_0x1b3573['where'][_0x26be('0x95')]=_0x2a71cc['id'];if(_0x377369['query']['filter']){_0x1b3573[_0x26be('0x93')]=_[_0x26be('0x2a')](_0x1b3573[_0x26be('0x93')],{'$or':_[_0x26be('0x2f')](_0x1b3573['attributes'],function(_0x24fa9d){var _0x9698ff={};_0x9698ff[_0x24fa9d]={'$like':'%'+_0x377369[_0x26be('0x35')][_0x26be('0x96')]+'%'};return _0x9698ff;})});}_0x1b3573[_0x26be('0x93')][_0x26be('0x9e')]=![];if(_0x377369[_0x26be('0x35')]['id']){_0x1b3573['where']['id']={'$gt':_0x377369[_0x26be('0x35')]['id']};}_0x1b3573=_[_0x26be('0x2a')]({},_0x1b3573,_0x377369['options']);return db['ChatMessage'][_0x26be('0x23')]({'where':_0x1b3573[_0x26be('0x93')]})[_0x26be('0x12')](function(_0x293c58){_0x4cdd91[_0x26be('0x23')]=_0x293c58;_0x1b3573[_0x26be('0x99')]=[];if(_0x377369['query']['includeAgent']){_0x1b3573['include'][_0x26be('0x9f')]({'model':db[_0x26be('0x77')],'as':_0x26be('0x77'),'attributes':['id',_0x26be('0x4d'),'alias']});}if(_0x377369[_0x26be('0x35')][_0x26be('0x41')]){_0x1b3573[_0x26be('0x99')]=[{'all':!![]}];}return db[_0x26be('0x59')][_0x26be('0x33')](_0x1b3573);})[_0x26be('0x12')](function(_0x59ebe3){_0x4cdd91['rows']=_0x59ebe3;return _0x4cdd91;});}})[_0x26be('0x12')](respondWithFilteredResult(_0x5226ae,_0x1b3573))[_0x26be('0x37')](handleError(_0x5226ae,null));};exports[_0x26be('0xa0')]=function(_0x210614,_0x4c3927){return db[_0x26be('0x43')][_0x26be('0x44')]({'where':{'id':_0x210614[_0x26be('0x39')]['id']}})['then'](handleEntityNotFound(_0x4c3927,null))['then'](function(_0x4efbda){if(_0x4efbda){return _0x4efbda['setTags'](_0x210614[_0x26be('0x2b')][_0x26be('0x8e')],_[_0x26be('0x8f')](_0x210614[_0x26be('0x2b')],['ids','id'])||{})['spread'](function(){return db[_0x26be('0xa1')][_0x26be('0x33')]({'attributes':['id',_0x26be('0x27'),'color'],'where':{'id':_0x210614[_0x26be('0x2b')][_0x26be('0x8e')]}});})['then'](function(_0x37931e){socket[_0x26be('0xa2')](_0x26be('0xa3'),{'id':Number(_0x210614[_0x26be('0x39')]['id']),'tags':_0x37931e||[]});return{'id':Number(_0x210614[_0x26be('0x39')]['id']),'tags':_0x37931e||[]};});}})[_0x26be('0x12')](respondWithResult(_0x4c3927,null))[_0x26be('0x37')](handleError(_0x4c3927,null));};exports[_0x26be('0xa4')]=function(_0x5645b3,_0x2dce38){return db[_0x26be('0x43')][_0x26be('0x44')]({'where':{'id':_0x5645b3[_0x26be('0x39')]['id']}})[_0x26be('0x12')](handleEntityNotFound(_0x2dce38,null))['then'](function(_0xc8417d){if(_0xc8417d){return _0xc8417d['removeTags'](_0x5645b3['query'][_0x26be('0x8e')]);}})[_0x26be('0x12')](respondWithStatusCode(_0x2dce38,null))['catch'](handleError(_0x2dce38,null));};exports[_0x26be('0x72')]=function(_0x517c78,_0x19f33b){var _0x5ecdac=moment()['unix']()['toString']();var _0x2e8e01=path['join'](config['root'],_0x26be('0xa5'),'files',_0x26be('0xa6'));var _0x6778a7=path[_0x26be('0x6e')](config['root'],_0x26be('0xa5'),_0x26be('0xa7'),'attachments');var _0x4fb209=path[_0x26be('0x6e')](_0x2e8e01,_0x5ecdac);var _0x38bc3d=util[_0x26be('0x7b')](_0x26be('0xa8'),_0x517c78[_0x26be('0x39')]['id'],_0x5ecdac);var _0x3887cc=path[_0x26be('0x6e')](_0x2e8e01,_0x38bc3d);var _0xa91f20=[];_0xa91f20[_0x26be('0x9f')]({'model':db[_0x26be('0x77')],'as':_0x26be('0x77'),'attributes':['id',_0x26be('0x4d')],'raw':!![]});_0xa91f20[_0x26be('0x9f')]({'model':db['CmContact'],'as':_0x26be('0xa9'),'attributes':['id',_0x26be('0xaa'),_0x26be('0xab')],'raw':!![]});if(_0x517c78[_0x26be('0x35')]['attachments']){_0xa91f20['push']({'model':db[_0x26be('0x69')],'as':_0x26be('0x69'),'raw':!![]});}var _0x30a080=[{'model':db[_0x26be('0x59')],'as':'Messages','attributes':['id',_0x26be('0x2b'),'createdAt',_0x26be('0xac'),_0x26be('0x9e'),'read'],'include':_0xa91f20}];_0x30a080[_0x26be('0x9f')]({'model':db[_0x26be('0x78')],'as':_0x26be('0xad'),'attributes':['id',_0x26be('0x27')]});_0x30a080[_0x26be('0x9f')]({'model':db['User'],'as':_0x26be('0xae'),'attributes':['id',_0x26be('0x4d')]});return db[_0x26be('0x43')][_0x26be('0x44')]({'where':{'id':_0x517c78['params']['id']},'include':_0x30a080})[_0x26be('0x12')](handleEntityNotFound(_0x19f33b,null))[_0x26be('0x12')](function(_0x1e49e5){if(_0x1e49e5){var _0x1ee765=_0x1e49e5[_0x26be('0xaf')]({'plain':!![]});fs[_0x26be('0xb0')](_0x4fb209);var _0x11a958={'channel':'Chat','account':_0x1ee765[_0x26be('0xad')][_0x26be('0x27')],'agent':_0x1ee765[_0x26be('0xae')]?_0x1ee765[_0x26be('0xae')][_0x26be('0x4d')]:_0x26be('0xb1'),'createdAt':moment(_0x1ee765[_0x26be('0xb2')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x26be('0xb3')](),'closedAt':_0x1ee765['closed']?moment(_0x1ee765[_0x26be('0xb4')])[_0x26be('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x1ee765[_0x26be('0x62')],'chatInfo':{'browser':_0x1ee765['browserName'],'os':_0x1ee765[_0x26be('0xb5')],'referer':_0x1ee765['referer'],'customerIp':_0x1ee765['customerIp'],'customerPort':_0x1ee765[_0x26be('0xb6')]?_0x1ee765[_0x26be('0xb6')]:_0x26be('0xb1')},'messages':_(_0x1ee765[_0x26be('0x76')])[_0x26be('0xb7')]()[_0x26be('0x96')]({'secret':![]})[_0x26be('0x2f')](function(_0x1b6609){if(_0x1b6609[_0x26be('0x69')]){var _0x142af2=path[_0x26be('0x6e')](_0x6778a7,_0x1b6609['Attachment'][_0x26be('0x71')]);if(fs['existsSync'](_0x142af2)){fs[_0x26be('0xb8')](_0x142af2)[_0x26be('0xb9')](fs['createWriteStream'](path[_0x26be('0x6e')](_0x4fb209,_0x1b6609[_0x26be('0x69')][_0x26be('0x71')])));}}return{'date':moment(_0x1b6609[_0x26be('0xb2')])[_0x26be('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')[_0x26be('0xb3')](),'sender':_0x1b6609[_0x26be('0xac')]===_0x26be('0x58')?_0x1b6609[_0x26be('0x77')]?_0x1b6609[_0x26be('0x77')]['fullname']:_0x26be('0x7d'):_0x1b6609['Contact'][_0x26be('0xaa')]+(_0x1b6609[_0x26be('0xa9')]['lastName']?'\x20'+_0x1b6609['Contact'][_0x26be('0xab')]:''),'body':_0x1b6609[_0x26be('0x69')]?_0x1b6609[_0x26be('0x69')][_0x26be('0x71')]:_0x1b6609['body'],'direction':_0x1b6609['direction']==='out'?'A':'C','secret':_0x1b6609[_0x26be('0x9e')],'read':_0x1b6609['read'],'attachment':_0x1b6609[_0x26be('0x69')]};})[_0x26be('0xba')]()};return ejs[_0x26be('0xbb')](path[_0x26be('0x6e')](config[_0x26be('0x6f')],_0x26be('0xa5'),'views',_0x26be('0xbc')),{'interaction':_0x11a958})[_0x26be('0x12')](function(_0x16f2fa){var _0x5b7a45=path['join'](_0x4fb209,'transcript-'+_0x1ee765['id']+'-'+_0x5ecdac+_0x26be('0xbd'));var _0x30c144={'path':_0x5b7a45,'channel':_0x26be('0xbe'),'interactionId':_0x1ee765['id']};return pdf['createPdfFromHTML'](_0x16f2fa,_0x30c144);})[_0x26be('0x12')](function(){return new Promise(function(_0x6b6235,_0x55e04f){zipdir(_0x4fb209,{'saveTo':_0x3887cc},function(_0x30c00d,_0xf1da64){if(_0x30c00d)return _0x55e04f(_0x30c00d);return _0x6b6235(_0xf1da64);});})[_0x26be('0x12')](function(){return new BPromise(function(_0x2ee780,_0xc957a6){rimraf(_0x4fb209,function(_0x1bf669){if(_0x1bf669)_0xc957a6(_0x1bf669);return _0x2ee780();});});})[_0x26be('0x12')](function(){return _0x19f33b[_0x26be('0x72')](_0x3887cc,_0x38bc3d,function(_0x23063f){if(_0x23063f){logger[_0x26be('0x19')](_0x26be('0xbf'),_0x23063f);}else{fs[_0x26be('0xc0')](_0x3887cc);}});});});}else{return _0x19f33b[_0x26be('0x1d')](0xc8);}})[_0x26be('0x37')](handleError(_0x19f33b,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 5a4d9bd..69e518b 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 _0xacc9=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','remove','getUsers','then','map','emit','catch','hasOwnProperty','hook'];(function(_0x21b706,_0x1022f4){var _0x13b94a=function(_0x3116da){while(--_0x3116da){_0x21b706['push'](_0x21b706['shift']());}};_0x13b94a(++_0x1022f4);}(_0xacc9,0x139));var _0x9acc=function(_0x5a29a7,_0x3e59a8){_0x5a29a7=_0x5a29a7-0x0;var _0x172198=_0xacc9[_0x5a29a7];return _0x172198;};'use strict';var EventEmitter=require(_0x9acc('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x9acc('0x1'))['db'][_0x9acc('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x9acc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9acc('0x4')};function emitEvent(_0x1ffec4){return function(_0x2df10d,_0x57bbdd,_0xe56f18){_0x2df10d[_0x9acc('0x5')]({'attributes':['id'],'raw':!![]})[_0x9acc('0x6')](function(_0x36e69c){_0x2df10d['setDataValue']('Users',_0x36e69c[_0x9acc('0x7')](function(_0x5225c1){return{'id':_0x5225c1['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2df10d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9acc('0x6')](function(_0x3d70a3){_0x2df10d['setDataValue']('unreadMessages',_0x3d70a3['length']);ChatInteractionEvents[_0x9acc('0x8')](_0x1ffec4+':'+_0x2df10d['id'],_0x2df10d);ChatInteractionEvents[_0x9acc('0x8')](_0x1ffec4,_0x2df10d);_0xe56f18(null);})[_0x9acc('0x9')](_0xe56f18(null));};}for(var e in events){if(events[_0x9acc('0xa')](e)){var event=events[e];ChatInteraction[_0x9acc('0xb')](e,emitEvent(event));}}module[_0x9acc('0xc')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xce1c=['ChatInteraction','ChatMessage','save','update','remove','getUsers','then','setDataValue','map','findAll','length','emit','hook','events','../../mysqldb'];(function(_0x263039,_0x31b9a7){var _0x452e7b=function(_0x359a2c){while(--_0x359a2c){_0x263039['push'](_0x263039['shift']());}};_0x452e7b(++_0x31b9a7);}(_0xce1c,0x10c));var _0xcce1=function(_0x391f75,_0x40b55e){_0x391f75=_0x391f75-0x0;var _0x379e5b=_0xce1c[_0x391f75];return _0x379e5b;};'use strict';var EventEmitter=require(_0xcce1('0x0'));var ChatInteraction=require(_0xcce1('0x1'))['db'][_0xcce1('0x2')];var ChatMessage=require(_0xcce1('0x1'))['db'][_0xcce1('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcce1('0x4'),'afterUpdate':_0xcce1('0x5'),'afterDestroy':_0xcce1('0x6')};function emitEvent(_0x781c1f){return function(_0x4a9dd6,_0x4093c5,_0x2aa747){_0x4a9dd6[_0xcce1('0x7')]({'attributes':['id'],'raw':!![]})[_0xcce1('0x8')](function(_0x21da4f){_0x4a9dd6[_0xcce1('0x9')]('Users',_0x21da4f[_0xcce1('0xa')](function(_0x4c2e34){return{'id':_0x4c2e34['id']};}));return ChatMessage[_0xcce1('0xb')]({'where':{'ChatInteractionId':_0x4a9dd6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcce1('0x8')](function(_0x350de2){_0x4a9dd6[_0xcce1('0x9')]('unreadMessages',_0x350de2[_0xcce1('0xc')]);ChatInteractionEvents[_0xcce1('0xd')](_0x781c1f+':'+_0x4a9dd6['id'],_0x4a9dd6);ChatInteractionEvents[_0xcce1('0xd')](_0x781c1f,_0x4a9dd6);_0x2aa747(null);})['catch'](_0x2aa747(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xcce1('0xe')](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 61a240c..77080ca 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 _0xb8c9=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x247ffb,_0x4f5bcd){var _0xafc7af=function(_0x1e4335){while(--_0x1e4335){_0x247ffb['push'](_0x247ffb['shift']());}};_0xafc7af(++_0x4f5bcd);}(_0xb8c9,0xb4));var _0x9b8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb8c9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9b8c('0x0'));var util=require(_0x9b8c('0x1'));var logger=require('../../config/logger')(_0x9b8c('0x2'));var moment=require(_0x9b8c('0x3'));var BPromise=require(_0x9b8c('0x4'));var rp=require(_0x9b8c('0x5'));var fs=require('fs');var path=require(_0x9b8c('0x6'));var rimraf=require(_0x9b8c('0x7'));var config=require(_0x9b8c('0x8'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x3609c4,_0x5a417c){return _0x3609c4[_0x9b8c('0x9')](_0x9b8c('0xa'),attributes,{'tableName':_0x9b8c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x310aa4,_0x3c7c14,_0x130de1){if(_0x310aa4[_0x9b8c('0xc')](_0x9b8c('0xd'))){_0x310aa4['closedAt']=moment()[_0x9b8c('0xe')](_0x9b8c('0xf'));}_0x130de1(null,_0x310aa4);}},'charset':_0x9b8c('0x10'),'collate':_0x9b8c('0x11')});};
\ No newline at end of file
+var _0xe53c=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed'];(function(_0x174752,_0x4d9f12){var _0xa311a0=function(_0x237b09){while(--_0x237b09){_0x174752['push'](_0x174752['shift']());}};_0xa311a0(++_0x4d9f12);}(_0xe53c,0x137));var _0xce53=function(_0x5c98ea,_0xa782aa){_0x5c98ea=_0x5c98ea-0x0;var _0x51e853=_0xe53c[_0x5c98ea];return _0x51e853;};'use strict';var _=require(_0xce53('0x0'));var util=require(_0xce53('0x1'));var logger=require(_0xce53('0x2'))('api');var moment=require(_0xce53('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xce53('0x4'));var config=require(_0xce53('0x5'));var attributes=require(_0xce53('0x6'));module['exports']=function(_0x44fb0e,_0x285fde){return _0x44fb0e[_0xce53('0x7')](_0xce53('0x8'),attributes,{'tableName':_0xce53('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8817da,_0x3c7873,_0xd49c50){if(_0x8817da[_0xce53('0xa')](_0xce53('0xb'))){_0x8817da[_0xce53('0xc')]=moment()[_0xce53('0xd')](_0xce53('0xe'));}_0xd49c50(null,_0x8817da);}},'charset':_0xce53('0xf'),'collate':_0xce53('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 6a36509..6cfb7a3 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 _0xd646=['jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','limit','find','omit','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1cf730,_0x42c362){var _0x35bfee=function(_0x26ca67){while(--_0x26ca67){_0x1cf730['push'](_0x1cf730['shift']());}};_0x35bfee(++_0x42c362);}(_0xd646,0x191));var _0x6d64=function(_0x447a9f,_0x48619b){_0x447a9f=_0x447a9f-0x0;var _0x1286fc=_0xd646[_0x447a9f];return _0x1286fc;};'use strict';var _=require(_0x6d64('0x0'));var util=require(_0x6d64('0x1'));var moment=require(_0x6d64('0x2'));var BPromise=require(_0x6d64('0x3'));var rs=require(_0x6d64('0x4'));var fs=require('fs');var Redis=require(_0x6d64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d64('0x6'));var logger=require(_0x6d64('0x7'))('rpc');var config=require(_0x6d64('0x8'));var jayson=require(_0x6d64('0x9'));var client=jayson[_0x6d64('0xa')][_0x6d64('0xb')]({'port':0x232a});config['redis']=_[_0x6d64('0xc')](config['redis'],{'host':_0x6d64('0xd'),'port':0x18eb});var socket=require(_0x6d64('0xe'))(new Redis(config[_0x6d64('0xf')]));require(_0x6d64('0x10'))[_0x6d64('0x11')](socket);function respondWithRpcPromise(_0x27e20b,_0x3a03fb,_0x33e032){return new BPromise(function(_0x1fbec9,_0x68010e){return client[_0x6d64('0x12')](_0x27e20b,_0x33e032)[_0x6d64('0x13')](function(_0x10f756){logger[_0x6d64('0x14')](_0x6d64('0x15'),_0x3a03fb,'request\x20sent');logger[_0x6d64('0x16')](_0x6d64('0x17'),_0x3a03fb,'request\x20sent',JSON[_0x6d64('0x18')](_0x10f756));if(_0x10f756[_0x6d64('0x19')]){if(_0x10f756[_0x6d64('0x19')][_0x6d64('0x1a')]===0x1f4){logger['error'](_0x6d64('0x15'),_0x3a03fb,_0x10f756[_0x6d64('0x19')][_0x6d64('0x1b')]);return _0x68010e(_0x10f756[_0x6d64('0x19')][_0x6d64('0x1b')]);}logger['error'](_0x6d64('0x15'),_0x3a03fb,_0x10f756[_0x6d64('0x19')][_0x6d64('0x1b')]);return _0x1fbec9(_0x10f756['error'][_0x6d64('0x1b')]);}else{logger[_0x6d64('0x14')](_0x6d64('0x15'),_0x3a03fb,'request\x20sent');_0x1fbec9(_0x10f756[_0x6d64('0x1c')][_0x6d64('0x1b')]);}})[_0x6d64('0x1d')](function(_0x1340a8){logger['error'](_0x6d64('0x15'),_0x3a03fb,_0x1340a8);_0x68010e(_0x1340a8);});});}exports[_0x6d64('0x1e')]=function(_0x14e9aa){var _0x1996a5=this;return new Promise(function(_0x2b2324,_0x2fdd0d){return db[_0x6d64('0x1f')][_0x6d64('0x20')](_0x14e9aa[_0x6d64('0x21')],{'raw':_0x14e9aa[_0x6d64('0x22')]?_0x14e9aa['options'][_0x6d64('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14e9aa[_0x6d64('0x22')]?_0x14e9aa[_0x6d64('0x22')]['where']||null:null,'attributes':_0x14e9aa['options']?_0x14e9aa['options']['attributes']||null:null,'limit':_0x14e9aa[_0x6d64('0x22')]?_0x14e9aa[_0x6d64('0x22')][_0x6d64('0x24')]||null:null})[_0x6d64('0x13')](function(_0x45bf2c){logger[_0x6d64('0x14')](_0x6d64('0x1e'),_0x14e9aa);logger[_0x6d64('0x16')](_0x6d64('0x1e'),_0x14e9aa,JSON['stringify'](_0x45bf2c));_0x2b2324(_0x45bf2c);})[_0x6d64('0x1d')](function(_0xf56ad6){logger[_0x6d64('0x19')](_0x6d64('0x1e'),_0xf56ad6[_0x6d64('0x1b')],_0x14e9aa);_0x2fdd0d(_0x1996a5[_0x6d64('0x19')](0x1f4,_0xf56ad6[_0x6d64('0x1b')]));});});};exports['AddTagsToChatInteraction']=function(_0x492ce7){return new Promise(function(_0x7c8890,_0x3d0d7b){return db[_0x6d64('0x1f')][_0x6d64('0x25')]({'where':_0x492ce7[_0x6d64('0x22')]?_0x492ce7[_0x6d64('0x22')]['where']||null:null})['then'](function(_0x4f2448){if(_0x4f2448){return _0x4f2448['addTags'](_0x492ce7[_0x6d64('0x21')]['ids'],_[_0x6d64('0x26')](_0x492ce7[_0x6d64('0x21')],[_0x6d64('0x27'),'id'])||{});}})['spread'](function(_0x1a248b){logger[_0x6d64('0x14')](_0x6d64('0x28'),_0x492ce7);logger[_0x6d64('0x16')](_0x6d64('0x28'),_0x492ce7,JSON[_0x6d64('0x18')](_0x1a248b));_0x7c8890(_0x1a248b);})['catch'](function(_0x54dfb6){logger[_0x6d64('0x19')](_0x6d64('0x28'),_0x54dfb6['message'],_0x492ce7);_0x3d0d7b(_this[_0x6d64('0x19')](0x1f4,_0x54dfb6[_0x6d64('0x1b')]));});});};
\ No newline at end of file
+var _0x2fb3=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','request','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','attributes','limit','AddTagsToChatInteraction','where','then','addTags','ids','omit','spread','info','AddTags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2fb3,0x9c));var _0x32fb=function(_0x567405,_0x4675dd){_0x567405=_0x567405-0x0;var _0x23079f=_0x2fb3[_0x567405];return _0x23079f;};'use strict';var _=require(_0x32fb('0x0'));var util=require('util');var moment=require(_0x32fb('0x1'));var BPromise=require(_0x32fb('0x2'));var rs=require(_0x32fb('0x3'));var fs=require('fs');var Redis=require(_0x32fb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x32fb('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x32fb('0x6'));var client=jayson['client'][_0x32fb('0x7')]({'port':0x232a});config[_0x32fb('0x8')]=_[_0x32fb('0x9')](config[_0x32fb('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x32fb('0xa'))(new Redis(config['redis']));require(_0x32fb('0xb'))['register'](socket);function respondWithRpcPromise(_0x4954be,_0x2648a5,_0x226845){return new BPromise(function(_0x5e1328,_0x149b60){return client[_0x32fb('0xc')](_0x4954be,_0x226845)['then'](function(_0x54a6a0){logger['info'](_0x32fb('0xd'),_0x2648a5,'request\x20sent');logger[_0x32fb('0xe')](_0x32fb('0xf'),_0x2648a5,'request\x20sent',JSON[_0x32fb('0x10')](_0x54a6a0));if(_0x54a6a0[_0x32fb('0x11')]){if(_0x54a6a0['error'][_0x32fb('0x12')]===0x1f4){logger['error'](_0x32fb('0xd'),_0x2648a5,_0x54a6a0[_0x32fb('0x11')][_0x32fb('0x13')]);return _0x149b60(_0x54a6a0[_0x32fb('0x11')][_0x32fb('0x13')]);}logger[_0x32fb('0x11')](_0x32fb('0xd'),_0x2648a5,_0x54a6a0[_0x32fb('0x11')][_0x32fb('0x13')]);return _0x5e1328(_0x54a6a0[_0x32fb('0x11')]['message']);}else{logger['info'](_0x32fb('0xd'),_0x2648a5,_0x32fb('0x14'));_0x5e1328(_0x54a6a0[_0x32fb('0x15')][_0x32fb('0x13')]);}})[_0x32fb('0x16')](function(_0x5d37e1){logger[_0x32fb('0x11')](_0x32fb('0xd'),_0x2648a5,_0x5d37e1);_0x149b60(_0x5d37e1);});});}exports[_0x32fb('0x17')]=function(_0x55610e){var _0x55fd45=this;return new Promise(function(_0x15b91f,_0x5c4974){return db[_0x32fb('0x18')][_0x32fb('0x19')](_0x55610e[_0x32fb('0x1a')],{'raw':_0x55610e[_0x32fb('0x1b')]?_0x55610e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55610e[_0x32fb('0x1b')]?_0x55610e[_0x32fb('0x1b')]['where']||null:null,'attributes':_0x55610e['options']?_0x55610e[_0x32fb('0x1b')][_0x32fb('0x1c')]||null:null,'limit':_0x55610e[_0x32fb('0x1b')]?_0x55610e['options'][_0x32fb('0x1d')]||null:null})['then'](function(_0x3e2994){logger['info']('UpdateChatInteraction',_0x55610e);logger[_0x32fb('0xe')](_0x32fb('0x17'),_0x55610e,JSON[_0x32fb('0x10')](_0x3e2994));_0x15b91f(_0x3e2994);})['catch'](function(_0x120637){logger[_0x32fb('0x11')]('UpdateChatInteraction',_0x120637[_0x32fb('0x13')],_0x55610e);_0x5c4974(_0x55fd45[_0x32fb('0x11')](0x1f4,_0x120637[_0x32fb('0x13')]));});});};exports[_0x32fb('0x1e')]=function(_0x418b09){return new Promise(function(_0x37163c,_0x2b493e){return db[_0x32fb('0x18')]['find']({'where':_0x418b09[_0x32fb('0x1b')]?_0x418b09['options'][_0x32fb('0x1f')]||null:null})[_0x32fb('0x20')](function(_0x449798){if(_0x449798){return _0x449798[_0x32fb('0x21')](_0x418b09[_0x32fb('0x1a')][_0x32fb('0x22')],_[_0x32fb('0x23')](_0x418b09[_0x32fb('0x1a')],[_0x32fb('0x22'),'id'])||{});}})[_0x32fb('0x24')](function(_0x3335d4){logger[_0x32fb('0x25')]('AddTags',_0x418b09);logger[_0x32fb('0xe')](_0x32fb('0x26'),_0x418b09,JSON[_0x32fb('0x10')](_0x3335d4));_0x37163c(_0x3335d4);})[_0x32fb('0x16')](function(_0x55b7ee){logger[_0x32fb('0x11')]('AddTags',_0x55b7ee[_0x32fb('0x13')],_0x418b09);_0x2b493e(_this[_0x32fb('0x11')](0x1f4,_0x55b7ee['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index d1950f1..c362b7a 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 _0x83f1=['emit','removeListener','register','length','./chatInteraction.events','save','remove','update'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x83f1,0x1cc));var _0x183f=function(_0x137264,_0x163896){_0x137264=_0x137264-0x0;var _0x26d615=_0x83f1[_0x137264];return _0x26d615;};'use strict';var ChatInteractionEvents=require(_0x183f('0x0'));var events=[_0x183f('0x1'),_0x183f('0x2'),_0x183f('0x3')];function createListener(_0x40525d,_0x50f14d){return function(_0x52688c){_0x50f14d[_0x183f('0x4')](_0x40525d,_0x52688c);};}function removeListener(_0x2668ca,_0x7f265){return function(){ChatInteractionEvents[_0x183f('0x5')](_0x2668ca,_0x7f265);};}exports[_0x183f('0x6')]=function(_0x5381b2){for(var _0x5c1cbd=0x0,_0xf702f5=events[_0x183f('0x7')];_0x5c1cbd<_0xf702f5;_0x5c1cbd++){var _0x5c75c3=events[_0x5c1cbd];var _0x434be2=createListener('chatInteraction:'+_0x5c75c3,_0x5381b2);ChatInteractionEvents['on'](_0x5c75c3,_0x434be2);}};
\ No newline at end of file
+var _0xd32d=['save','remove','emit','removeListener','register','./chatInteraction.events'];(function(_0x5b0332,_0x469074){var _0x55e280=function(_0x4619d9){while(--_0x4619d9){_0x5b0332['push'](_0x5b0332['shift']());}};_0x55e280(++_0x469074);}(_0xd32d,0x15b));var _0xdd32=function(_0x8f360c,_0x166c6e){_0x8f360c=_0x8f360c-0x0;var _0x37182b=_0xd32d[_0x8f360c];return _0x37182b;};'use strict';var ChatInteractionEvents=require(_0xdd32('0x0'));var events=[_0xdd32('0x1'),_0xdd32('0x2'),'update'];function createListener(_0x848a2b,_0x1df8ad){return function(_0x577087){_0x1df8ad[_0xdd32('0x3')](_0x848a2b,_0x577087);};}function removeListener(_0x4b36b2,_0x5089a1){return function(){ChatInteractionEvents[_0xdd32('0x4')](_0x4b36b2,_0x5089a1);};}exports[_0xdd32('0x5')]=function(_0xf87ad2){for(var _0x12f0a2=0x0,_0x179d27=events['length'];_0x12f0a2<_0x179d27;_0x12f0a2++){var _0x486537=events[_0x12f0a2];var _0x57e8b0=createListener('chatInteraction:'+_0x486537,_0xf87ad2);ChatInteractionEvents['on'](_0x486537,_0x57e8b0);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 4f4e25d..49677d6 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 _0xeb50=['post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','%s-%s','originalname','/:id/attachment_upload','file','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xeb50,0x167));var _0x0eb5=function(_0xfdec06,_0x9fa2f4){_0xfdec06=_0xfdec06-0x0;var _0x58a539=_0xeb50[_0xfdec06];return _0x58a539;};'use strict';var multer=require(_0x0eb5('0x0'));var util=require(_0x0eb5('0x1'));var path=require(_0x0eb5('0x2'));var timeout=require(_0x0eb5('0x3'));var express=require(_0x0eb5('0x4'));var router=express[_0x0eb5('0x5')]();var fs_extra=require(_0x0eb5('0x6'));var auth=require(_0x0eb5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0eb5('0x8'));var controller=require(_0x0eb5('0x9'));router[_0x0eb5('0xa')]('/',auth[_0x0eb5('0xb')](),controller[_0x0eb5('0xc')]);router[_0x0eb5('0xa')](_0x0eb5('0xd'),auth[_0x0eb5('0xb')](),controller[_0x0eb5('0xe')]);router[_0x0eb5('0xa')](_0x0eb5('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x0eb5('0x10')]);router[_0x0eb5('0xa')](_0x0eb5('0x11'),auth[_0x0eb5('0x12')](),controller[_0x0eb5('0x13')]);router[_0x0eb5('0xa')](_0x0eb5('0x14'),auth['isAuthenticated'](),controller[_0x0eb5('0x15')]);router[_0x0eb5('0xa')](_0x0eb5('0x16'),auth[_0x0eb5('0x12')](),controller[_0x0eb5('0x17')]);router[_0x0eb5('0xa')](_0x0eb5('0x18'),auth[_0x0eb5('0xb')](),controller[_0x0eb5('0x19')]);router[_0x0eb5('0x1a')]('/',auth[_0x0eb5('0xb')](),controller[_0x0eb5('0x1b')]);router[_0x0eb5('0x1a')](_0x0eb5('0x1c'),auth[_0x0eb5('0xb')](),controller[_0x0eb5('0x1d')]);var upload=multer({'storage':multer[_0x0eb5('0x1e')]({'destination':function(_0x238265,_0x120cc4,_0x4f51e8){_0x4f51e8(null,path[_0x0eb5('0x1f')](config[_0x0eb5('0x20')],'server/files/attachments/'));},'filename':function(_0x47e1f0,_0x23799f,_0x1136f5){_0x1136f5(null,util[_0x0eb5('0x21')](_0x0eb5('0x22'),Date['now'](),_0x23799f[_0x0eb5('0x23')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x0eb5('0x1a')](_0x0eb5('0x24'),upload['single'](_0x0eb5('0x25')),controller['attachmentUpload']);router[_0x0eb5('0x1a')](_0x0eb5('0x14'),auth[_0x0eb5('0x12')](),controller['addMessage']);router[_0x0eb5('0x1a')](_0x0eb5('0x26'),auth[_0x0eb5('0xb')](),interaction['tracked']('chat',_0x0eb5('0x27')),controller[_0x0eb5('0x28')]);router[_0x0eb5('0x29')](_0x0eb5('0xf'),auth[_0x0eb5('0xb')](),interaction[_0x0eb5('0x2a')](_0x0eb5('0x2b'),'chatinteraction:update'),controller[_0x0eb5('0x2c')]);router[_0x0eb5('0x29')](_0x0eb5('0x2d'),controller[_0x0eb5('0x2e')]);router['put']('/:id/abandon',auth[_0x0eb5('0x12')](),controller[_0x0eb5('0x2f')]);router['put'](_0x0eb5('0x30'),controller[_0x0eb5('0x31')]);router['delete']('/:id',auth[_0x0eb5('0xb')](),interaction[_0x0eb5('0x2a')](_0x0eb5('0x2b'),_0x0eb5('0x32')),controller[_0x0eb5('0x33')]);router[_0x0eb5('0x34')](_0x0eb5('0x26'),auth['isAuthenticated'](),controller[_0x0eb5('0x35')]);module[_0x0eb5('0x36')]=router;
\ No newline at end of file
+var _0x337e=['connect-timeout','express','Router','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','/:id/custom_update','/:id/abandon','delete','chatinteraction:destroy','destroy','exports','multer','util','path'];(function(_0x4eb367,_0x45d85b){var _0x5aea99=function(_0x32d2e6){while(--_0x32d2e6){_0x4eb367['push'](_0x4eb367['shift']());}};_0x5aea99(++_0x45d85b);}(_0x337e,0x12f));var _0xe337=function(_0x250337,_0x54267b){_0x250337=_0x250337-0x0;var _0x10c225=_0x337e[_0x250337];return _0x10c225;};'use strict';var multer=require(_0xe337('0x0'));var util=require(_0xe337('0x1'));var path=require(_0xe337('0x2'));var timeout=require(_0xe337('0x3'));var express=require(_0xe337('0x4'));var router=express[_0xe337('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe337('0x6'));var controller=require(_0xe337('0x7'));router[_0xe337('0x8')]('/',auth[_0xe337('0x9')](),controller[_0xe337('0xa')]);router[_0xe337('0x8')](_0xe337('0xb'),auth[_0xe337('0x9')](),controller['describe']);router['get'](_0xe337('0xc'),auth['isChatInteractionAuthorized'](),controller['show']);router[_0xe337('0x8')]('/:id/attachment_download',auth[_0xe337('0xd')](),controller[_0xe337('0xe')]);router[_0xe337('0x8')]('/:id/messages',auth[_0xe337('0x9')](),controller[_0xe337('0xf')]);router[_0xe337('0x8')](_0xe337('0x10'),auth[_0xe337('0xd')](),controller[_0xe337('0x11')]);router['get'](_0xe337('0x12'),auth[_0xe337('0x9')](),controller[_0xe337('0x13')]);router[_0xe337('0x14')]('/',auth[_0xe337('0x9')](),controller[_0xe337('0x15')]);router[_0xe337('0x14')](_0xe337('0x16'),auth[_0xe337('0x9')](),controller[_0xe337('0x17')]);var upload=multer({'storage':multer[_0xe337('0x18')]({'destination':function(_0x1c8d89,_0x55d8bc,_0x47176e){_0x47176e(null,path['join'](config[_0xe337('0x19')],'server/files/attachments/'));},'filename':function(_0x47e1a7,_0x506cda,_0x6d181b){_0x6d181b(null,util[_0xe337('0x1a')](_0xe337('0x1b'),Date[_0xe337('0x1c')](),_0x506cda[_0xe337('0x1d')][_0xe337('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe337('0x14')](_0xe337('0x1f'),upload[_0xe337('0x20')](_0xe337('0x21')),controller[_0xe337('0x22')]);router['post'](_0xe337('0x23'),auth[_0xe337('0xd')](),controller[_0xe337('0x24')]);router['post'](_0xe337('0x25'),auth['isAuthenticated'](),interaction['tracked'](_0xe337('0x26'),_0xe337('0x27')),controller[_0xe337('0x28')]);router[_0xe337('0x29')](_0xe337('0xc'),auth['isAuthenticated'](),interaction[_0xe337('0x2a')](_0xe337('0x26'),_0xe337('0x2b')),controller[_0xe337('0x2c')]);router[_0xe337('0x29')](_0xe337('0x2d'),controller['customUpdate']);router[_0xe337('0x29')](_0xe337('0x2e'),auth[_0xe337('0xd')](),controller['abandon']);router[_0xe337('0x29')]('/:id/close',controller['close']);router[_0xe337('0x2f')]('/:id',auth[_0xe337('0x9')](),interaction[_0xe337('0x2a')](_0xe337('0x26'),_0xe337('0x30')),controller[_0xe337('0x31')]);router['delete'](_0xe337('0x25'),auth[_0xe337('0x9')](),controller['removeTags']);module[_0xe337('0x32')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 5ff9032..0734a9d 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 _0x6855=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x3a0512,_0x2f78ea){var _0x1a8fd7=function(_0x48cbaa){while(--_0x48cbaa){_0x3a0512['push'](_0x3a0512['shift']());}};_0x1a8fd7(++_0x2f78ea);}(_0x6855,0xe0));var _0x5685=function(_0x5cbf0e,_0x4cd140){_0x5cbf0e=_0x5cbf0e-0x0;var _0x1c76f8=_0x6855[_0x5cbf0e];return _0x1c76f8;};'use strict';var Sequelize=require(_0x5685('0x0'));module['exports']={'body':{'type':Sequelize[_0x5685('0x1')](_0x5685('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5685('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5685('0x4')]}};
\ No newline at end of file
+var _0xc8da=['medium','INTEGER','sequelize','exports'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xc8da,0x1de));var _0xac8d=function(_0x42960a,_0x4932f0){_0x42960a=_0x42960a-0x0;var _0x44bcc5=_0xc8da[_0x42960a];return _0x44bcc5;};'use strict';var Sequelize=require(_0xac8d('0x0'));module[_0xac8d('0x1')]={'body':{'type':Sequelize['TEXT'](_0xac8d('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xac8d('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index ba06d89..11712e2 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 _0x6599=['VIRTUAL','options','ChatInternalMessage','count','includeAll','include','rows','catch','show','find','create','body','params','describe','get','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','findAll','agent','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','messages','FromId','ToId','read','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type'];(function(_0x32ab63,_0x4d6d70){var _0x18af42=function(_0x25397a){while(--_0x25397a){_0x32ab63['push'](_0x32ab63['shift']());}};_0x18af42(++_0x4d6d70);}(_0x6599,0xa3));var _0x9659=function(_0x590a38,_0x2bc65c){_0x590a38=_0x590a38-0x0;var _0xf36626=_0x6599[_0x590a38];return _0xf36626;};'use strict';var emlformat=require(_0x9659('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9659('0x1'));var jsonpatch=require(_0x9659('0x2'));var rp=require(_0x9659('0x3'));var moment=require(_0x9659('0x4'));var BPromise=require(_0x9659('0x5'));var Mustache=require(_0x9659('0x6'));var util=require(_0x9659('0x7'));var path=require('path');var sox=require(_0x9659('0x8'));var csv=require(_0x9659('0x9'));var ejs=require(_0x9659('0xa'));var fs=require('fs');var fs_extra=require(_0x9659('0xb'));var _=require(_0x9659('0xc'));var squel=require(_0x9659('0xd'));var crypto=require(_0x9659('0xe'));var jsforce=require(_0x9659('0xf'));var deskjs=require(_0x9659('0x10'));var toCsv=require(_0x9659('0x9'));var querystring=require(_0x9659('0x11'));var Papa=require(_0x9659('0x12'));var Redis=require(_0x9659('0x13'));var authService=require(_0x9659('0x14'));var qs=require(_0x9659('0x15'));var as=require(_0x9659('0x16'));var hardwareService=require(_0x9659('0x17'));var logger=require(_0x9659('0x18'))(_0x9659('0x19'));var utils=require('../../config/utils');var config=require(_0x9659('0x1a'));var licenseUtil=require(_0x9659('0x1b'));var db=require(_0x9659('0x1c'))['db'];config[_0x9659('0x1d')]=_[_0x9659('0x1e')](config[_0x9659('0x1d')],{'host':_0x9659('0x1f'),'port':0x18eb});var socket=require(_0x9659('0x20'))(new Redis(config[_0x9659('0x1d')]));require(_0x9659('0x21'))['register'](socket);function respondWithStatusCode(_0x2223ed,_0x4db09e){_0x4db09e=_0x4db09e||0xcc;return function(_0x528ea3){if(_0x528ea3){return _0x2223ed[_0x9659('0x22')](_0x4db09e);}return _0x2223ed[_0x9659('0x23')](_0x4db09e)['end']();};}function respondWithResult(_0x3b0407,_0x192bea){_0x192bea=_0x192bea||0xc8;return function(_0x1c2dfb){if(_0x1c2dfb){return _0x3b0407[_0x9659('0x23')](_0x192bea)[_0x9659('0x24')](_0x1c2dfb);}};}function respondWithFilteredResult(_0x4fe3ed,_0x247e37){return function(_0x15080a){if(_0x15080a){var _0xb23d4d=typeof _0x247e37['offset']==='undefined'&&typeof _0x247e37['limit']==='undefined';var _0x54a632=_0x15080a['count'];var _0x46766b=_0xb23d4d?0x0:_0x247e37[_0x9659('0x25')];var _0x2e8f1c=_0xb23d4d?_0x15080a['count']:_0x247e37[_0x9659('0x25')]+_0x247e37['limit'];var _0x473875;if(_0x2e8f1c>=_0x54a632){_0x2e8f1c=_0x54a632;_0x473875=0xc8;}else{_0x473875=0xce;}_0x4fe3ed[_0x9659('0x23')](_0x473875);return _0x4fe3ed[_0x9659('0x26')](_0x9659('0x27'),_0x46766b+'-'+_0x2e8f1c+'/'+_0x54a632)['json'](_0x15080a);}return null;};}function patchUpdates(_0x340ac6){return function(_0x359ba6){try{jsonpatch[_0x9659('0x28')](_0x359ba6,_0x340ac6,!![]);}catch(_0x7fff1c){return BPromise[_0x9659('0x29')](_0x7fff1c);}return _0x359ba6[_0x9659('0x2a')]();};}function saveUpdates(_0x5f4400,_0x341eec){return function(_0x459e4f){if(_0x459e4f){return _0x459e4f[_0x9659('0x2b')](_0x5f4400)[_0x9659('0x2c')](function(_0x423986){return _0x423986;});}return null;};}function removeEntity(_0x500ecd,_0x566674){return function(_0x24e83c){if(_0x24e83c){return _0x24e83c[_0x9659('0x2d')]()[_0x9659('0x2c')](function(){_0x500ecd[_0x9659('0x23')](0xcc)[_0x9659('0x2e')]();});}};}function handleEntityNotFound(_0x2f5f48,_0x47e2f7){return function(_0xc3eb55){if(!_0xc3eb55){_0x2f5f48[_0x9659('0x22')](0x194);}return _0xc3eb55;};}function handleError(_0x565063,_0x32b593){_0x32b593=_0x32b593||0x1f4;return function(_0x14506f){logger[_0x9659('0x2f')](_0x14506f[_0x9659('0x30')]);if(_0x14506f['name']){delete _0x14506f[_0x9659('0x31')];}_0x565063[_0x9659('0x23')](_0x32b593)[_0x9659('0x32')](_0x14506f);};}exports['index']=function(_0x603430,_0x222396){var _0x239930={},_0x2d28a7={},_0x20e2dc={'count':0x0,'rows':[]};var _0x39a1ca=_[_0x9659('0x33')](db['ChatInternalMessage'][_0x9659('0x34')],function(_0x9a7c7d){return{'name':_0x9a7c7d[_0x9659('0x35')],'type':_0x9a7c7d['type'][_0x9659('0x36')]};});_0x2d28a7[_0x9659('0x37')]=_[_0x9659('0x33')](_0x39a1ca,_0x9659('0x31'));_0x2d28a7[_0x9659('0x38')]=_[_0x9659('0x39')](_0x603430[_0x9659('0x38')]);_0x2d28a7[_0x9659('0x3a')]=_[_0x9659('0x3b')](_0x2d28a7[_0x9659('0x37')],_0x2d28a7[_0x9659('0x38')]);_0x239930['attributes']=_[_0x9659('0x3b')](_0x2d28a7[_0x9659('0x37')],qs[_0x9659('0x3c')](_0x603430['query'][_0x9659('0x3c')]));_0x239930[_0x9659('0x3d')]=_0x239930[_0x9659('0x3d')][_0x9659('0x3e')]?_0x239930[_0x9659('0x3d')]:_0x2d28a7[_0x9659('0x37')];if(!_0x603430[_0x9659('0x38')][_0x9659('0x3f')](_0x9659('0x40'))){_0x239930['limit']=qs[_0x9659('0x41')](_0x603430['query']['limit']);_0x239930[_0x9659('0x25')]=qs[_0x9659('0x25')](_0x603430['query']['offset']);}_0x239930[_0x9659('0x42')]=qs[_0x9659('0x43')](_0x603430[_0x9659('0x38')][_0x9659('0x43')]);_0x239930[_0x9659('0x44')]=qs['filters'](_[_0x9659('0x45')](_0x603430[_0x9659('0x38')],_0x2d28a7[_0x9659('0x3a')]),_0x39a1ca);if(_0x603430['query'][_0x9659('0x46')]){_0x239930[_0x9659('0x44')]=_[_0x9659('0x47')](_0x239930['where'],{'$or':_[_0x9659('0x33')](_0x39a1ca,function(_0x9f21d4){if(_0x9f21d4[_0x9659('0x48')]!==_0x9659('0x49')){var _0x298bed={};_0x298bed[_0x9f21d4['name']]={'$like':'%'+_0x603430[_0x9659('0x38')][_0x9659('0x46')]+'%'};return _0x298bed;}})});}_0x239930=_[_0x9659('0x47')]({},_0x239930,_0x603430[_0x9659('0x4a')]);var _0x10aaa8={'where':_0x239930[_0x9659('0x44')]};return db[_0x9659('0x4b')][_0x9659('0x4c')](_0x10aaa8)[_0x9659('0x2c')](function(_0x1ce4a6){_0x20e2dc[_0x9659('0x4c')]=_0x1ce4a6;if(_0x603430['query'][_0x9659('0x4d')]){_0x239930[_0x9659('0x4e')]=[{'all':!![]}];}return db[_0x9659('0x4b')]['findAll'](_0x239930);})['then'](function(_0x273aa0){_0x20e2dc[_0x9659('0x4f')]=_0x273aa0;return _0x20e2dc;})[_0x9659('0x2c')](respondWithFilteredResult(_0x222396,_0x239930))[_0x9659('0x50')](handleError(_0x222396,null));};exports[_0x9659('0x51')]=function(_0x18cda7,_0x56f2c7){var _0x33c23b={'raw':!![],'where':{'id':_0x18cda7['params']['id']}},_0x3e72a9={};_0x3e72a9[_0x9659('0x37')]=_[_0x9659('0x39')](db[_0x9659('0x4b')][_0x9659('0x34')]);_0x3e72a9[_0x9659('0x38')]=_[_0x9659('0x39')](_0x18cda7[_0x9659('0x38')]);_0x3e72a9['filters']=_[_0x9659('0x3b')](_0x3e72a9[_0x9659('0x37')],_0x3e72a9[_0x9659('0x38')]);_0x33c23b[_0x9659('0x3d')]=_[_0x9659('0x3b')](_0x3e72a9['model'],qs[_0x9659('0x3c')](_0x18cda7[_0x9659('0x38')][_0x9659('0x3c')]));_0x33c23b['attributes']=_0x33c23b[_0x9659('0x3d')][_0x9659('0x3e')]?_0x33c23b[_0x9659('0x3d')]:_0x3e72a9[_0x9659('0x37')];if(_0x18cda7['query'][_0x9659('0x4d')]){_0x33c23b['include']=[{'all':!![]}];}_0x33c23b=_[_0x9659('0x47')]({},_0x33c23b,_0x18cda7[_0x9659('0x4a')]);return db[_0x9659('0x4b')][_0x9659('0x52')](_0x33c23b)['then'](handleEntityNotFound(_0x56f2c7,null))[_0x9659('0x2c')](respondWithResult(_0x56f2c7,null))['catch'](handleError(_0x56f2c7,null));};exports['create']=function(_0x1faecd,_0x10c367){return db[_0x9659('0x4b')][_0x9659('0x53')](_0x1faecd[_0x9659('0x54')],{})[_0x9659('0x2c')](respondWithResult(_0x10c367,0xc9))[_0x9659('0x50')](handleError(_0x10c367,null));};exports[_0x9659('0x2b')]=function(_0x222842,_0x39a1e1){if(_0x222842[_0x9659('0x54')]['id']){delete _0x222842[_0x9659('0x54')]['id'];}return db[_0x9659('0x4b')][_0x9659('0x52')]({'where':{'id':_0x222842[_0x9659('0x55')]['id']}})['then'](handleEntityNotFound(_0x39a1e1,null))[_0x9659('0x2c')](saveUpdates(_0x222842['body'],null))[_0x9659('0x2c')](respondWithResult(_0x39a1e1,null))[_0x9659('0x50')](handleError(_0x39a1e1,null));};exports[_0x9659('0x2d')]=function(_0x1dcb46,_0x39e998){return db[_0x9659('0x4b')][_0x9659('0x52')]({'where':{'id':_0x1dcb46['params']['id']}})[_0x9659('0x2c')](handleEntityNotFound(_0x39e998,null))[_0x9659('0x2c')](removeEntity(_0x39e998,null))[_0x9659('0x50')](handleError(_0x39e998,null));};exports[_0x9659('0x56')]=function(_0x5cad7d,_0x469c35){return db[_0x9659('0x4b')][_0x9659('0x56')]()['then'](respondWithResult(_0x469c35,null))[_0x9659('0x50')](handleError(_0x469c35,null));};function wrapUser(_0xe06b74){return function(_0x237321){var _0x4acd2a=_0xe06b74[_0x9659('0x57')]({'plain':!![]});_0x4acd2a['messages']=[];if(_0x237321){_0x4acd2a['lastMessageAt']=_0x237321['createdAt'];_0x4acd2a['lastMessage']=_0x237321;}else{_0x4acd2a[_0x9659('0x58')]=moment(0x0)[_0x9659('0x59')](_0x9659('0x5a'));_0x4acd2a[_0x9659('0x5b')]={};}return _0x4acd2a;};}exports[_0x9659('0x5c')]=function(_0x2c2a54,_0x131094,_0x5ce62b){var _0x28fea9=[];return db[_0x9659('0x5d')][_0x9659('0x5e')]({'where':{'role':[_0x9659('0x5f'),_0x9659('0x60'),_0x9659('0x61')]},'attributes':['id','fullname',_0x9659('0x31'),_0x9659('0x62'),_0x9659('0x63'),_0x9659('0x64'),_0x9659('0x65'),_0x9659('0x66'),_0x9659('0x67'),_0x9659('0x68')],'order':qs[_0x9659('0x43')](_0x9659('0x69')),'include':[{'model':db[_0x9659('0x6a')],'as':'VoiceQueues','attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x9659('0x2c')](function(_0x5e80a0){if(_0x5e80a0){var _0x4caba1=_0x2c2a54['user'][_0x9659('0x57')]({'plain':!![]});if(!_0x4caba1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4caba1[_0x9659('0x62')]===_0x9659('0x61')){return db['UserProfileSection'][_0x9659('0x52')]({'where':{'name':_0x9659('0x6b'),'userProfileId':_0x4caba1[_0x9659('0x6c')]},'raw':!![]})[_0x9659('0x2c')](function(_0x51b656){if(_0x51b656){if(_0x51b656[_0x9659('0x6d')]===0x0){return db[_0x9659('0x6e')][_0x9659('0x5e')]({'where':{'sectionId':_0x51b656['id']},'raw':!![]})[_0x9659('0x2c')](function(_0x252e68){var _0x4a45b2=[];if(_[_0x9659('0x6f')](_0x252e68)){_0x4a45b2=_['filter'](_0x5e80a0,function(_0x33a432){if(_0x33a432[_0x9659('0x62')]!==_0x9659('0x5f')){return _0x33a432;}});return _0x4a45b2;}else{for(var _0x8357da=0x0;_0x8357da<_0x5e80a0[_0x9659('0x3e')];_0x8357da++){var _0x240e07=_0x5e80a0[_0x8357da];if(_0x240e07[_0x9659('0x62')]==='agent'){var _0x4aff2b=_[_0x9659('0x52')](_0x252e68,function(_0x17aee1){return _0x17aee1['resourceId']===_0x240e07['id'];});if(_0x4aff2b)_0x4a45b2[_0x9659('0x70')](_0x240e07);}else{_0x4a45b2[_0x9659('0x70')](_0x240e07);}}return _0x4a45b2;}});}else{return _0x5e80a0;}}else{var _0x5c6f78=_[_0x9659('0x46')](_0x5e80a0,function(_0x285a46){if(_0x285a46['role']!==_0x9659('0x5f')){return _0x285a46;}});return _0x5c6f78;}});}else{return _0x5e80a0;}}})['then'](function(_0x2fc04e){var _0x47228d=[];if(_0x2fc04e){_0x28fea9=_0x2fc04e;for(var _0x356f92=0x0;_0x356f92<_0x2fc04e[_0x9659('0x3e')];_0x356f92+=0x1){_0x28fea9[_0x356f92][_0x9659('0x71')]=[];_0x47228d[_0x9659('0x70')](db[_0x9659('0x4b')][_0x9659('0x52')]({'where':{'FromId':[_0x2c2a54['user']['id'],_0x2fc04e[_0x356f92]['id']],'ToId':[_0x2c2a54['user']['id'],_0x2fc04e[_0x356f92]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x9659('0x72'),_0x9659('0x73'),_0x9659('0x74'),'body'],'order':qs[_0x9659('0x43')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x2fc04e[_0x356f92])));}return BPromise[_0x9659('0x75')](_0x47228d);}return[];})['then'](function(_0x5b9a7e){return{'rows':_0x5b9a7e,'count':_0x5b9a7e[_0x9659('0x3e')]};})['then'](respondWithResult(_0x131094,null))['catch'](handleError(_0x131094,null));};
\ No newline at end of file
+var _0xc562=['ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','register','status','json','offset','undefined','limit','count','set','apply','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','ChatInternalMessage','findAll','rows','catch','includeAll','include','create','body','find','params','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','user','fullname','userpic','lastLoginAt','VoiceQueue','VoiceQueues','UserProfileSection','Agents','UserProfileResource','isEmpty','role','push','FromId','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x9f897b,_0x2bc0f7){var _0x595177=function(_0x45f07f){while(--_0x45f07f){_0x9f897b['push'](_0x9f897b['shift']());}};_0x595177(++_0x2bc0f7);}(_0xc562,0xcb));var _0x2c56=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc562[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x2c56('0x0'));var rimraf=require(_0x2c56('0x1'));var zipdir=require(_0x2c56('0x2'));var jsonpatch=require(_0x2c56('0x3'));var rp=require('request-promise');var moment=require(_0x2c56('0x4'));var BPromise=require(_0x2c56('0x5'));var Mustache=require(_0x2c56('0x6'));var util=require(_0x2c56('0x7'));var path=require(_0x2c56('0x8'));var sox=require(_0x2c56('0x9'));var csv=require(_0x2c56('0xa'));var ejs=require(_0x2c56('0xb'));var fs=require('fs');var fs_extra=require(_0x2c56('0xc'));var _=require('lodash');var squel=require(_0x2c56('0xd'));var crypto=require(_0x2c56('0xe'));var jsforce=require(_0x2c56('0xf'));var deskjs=require(_0x2c56('0x10'));var toCsv=require(_0x2c56('0xa'));var querystring=require(_0x2c56('0x11'));var Papa=require(_0x2c56('0x12'));var Redis=require(_0x2c56('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2c56('0x14'));var as=require(_0x2c56('0x15'));var hardwareService=require(_0x2c56('0x16'));var logger=require(_0x2c56('0x17'))(_0x2c56('0x18'));var utils=require(_0x2c56('0x19'));var config=require(_0x2c56('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x2c56('0x1b')]=_[_0x2c56('0x1c')](config['redis'],{'host':_0x2c56('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2c56('0x1b')]));require('./chatInternalMessage.socket')[_0x2c56('0x1e')](socket);function respondWithStatusCode(_0x4ca55c,_0x336c11){_0x336c11=_0x336c11||0xcc;return function(_0x432d2f){if(_0x432d2f){return _0x4ca55c['sendStatus'](_0x336c11);}return _0x4ca55c[_0x2c56('0x1f')](_0x336c11)['end']();};}function respondWithResult(_0x5527bd,_0x49898d){_0x49898d=_0x49898d||0xc8;return function(_0x37cef5){if(_0x37cef5){return _0x5527bd[_0x2c56('0x1f')](_0x49898d)[_0x2c56('0x20')](_0x37cef5);}};}function respondWithFilteredResult(_0x2e019d,_0xd133a8){return function(_0x2bb6c5){if(_0x2bb6c5){var _0x3d05cd=typeof _0xd133a8[_0x2c56('0x21')]===_0x2c56('0x22')&&typeof _0xd133a8[_0x2c56('0x23')]==='undefined';var _0x452dc1=_0x2bb6c5['count'];var _0x358d5e=_0x3d05cd?0x0:_0xd133a8[_0x2c56('0x21')];var _0x334a92=_0x3d05cd?_0x2bb6c5[_0x2c56('0x24')]:_0xd133a8[_0x2c56('0x21')]+_0xd133a8[_0x2c56('0x23')];var _0x1b29a6;if(_0x334a92>=_0x452dc1){_0x334a92=_0x452dc1;_0x1b29a6=0xc8;}else{_0x1b29a6=0xce;}_0x2e019d[_0x2c56('0x1f')](_0x1b29a6);return _0x2e019d[_0x2c56('0x25')]('Content-Range',_0x358d5e+'-'+_0x334a92+'/'+_0x452dc1)[_0x2c56('0x20')](_0x2bb6c5);}return null;};}function patchUpdates(_0x3075e2){return function(_0x4cf47c){try{jsonpatch[_0x2c56('0x26')](_0x4cf47c,_0x3075e2,!![]);}catch(_0x817a76){return BPromise['reject'](_0x817a76);}return _0x4cf47c[_0x2c56('0x27')]();};}function saveUpdates(_0x523914,_0x4886b4){return function(_0x3a6591){if(_0x3a6591){return _0x3a6591[_0x2c56('0x28')](_0x523914)[_0x2c56('0x29')](function(_0x1d2972){return _0x1d2972;});}return null;};}function removeEntity(_0x4b8011,_0x3e7ed8){return function(_0x85a9df){if(_0x85a9df){return _0x85a9df['destroy']()[_0x2c56('0x29')](function(){_0x4b8011['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xfc83f3,_0x49e14b){return function(_0x46c210){if(!_0x46c210){_0xfc83f3[_0x2c56('0x2a')](0x194);}return _0x46c210;};}function handleError(_0x3553b2,_0x338e2f){_0x338e2f=_0x338e2f||0x1f4;return function(_0x1cfb11){logger[_0x2c56('0x2b')](_0x1cfb11[_0x2c56('0x2c')]);if(_0x1cfb11[_0x2c56('0x2d')]){delete _0x1cfb11[_0x2c56('0x2d')];}_0x3553b2['status'](_0x338e2f)[_0x2c56('0x2e')](_0x1cfb11);};}exports[_0x2c56('0x2f')]=function(_0x4d646d,_0x23390c){var _0x3bbfb7={},_0x127214={},_0x4831f5={'count':0x0,'rows':[]};var _0x4e2789=_[_0x2c56('0x30')](db['ChatInternalMessage'][_0x2c56('0x31')],function(_0x345857){return{'name':_0x345857[_0x2c56('0x32')],'type':_0x345857['type'][_0x2c56('0x33')]};});_0x127214['model']=_['map'](_0x4e2789,_0x2c56('0x2d'));_0x127214[_0x2c56('0x34')]=_[_0x2c56('0x35')](_0x4d646d[_0x2c56('0x34')]);_0x127214[_0x2c56('0x36')]=_[_0x2c56('0x37')](_0x127214[_0x2c56('0x38')],_0x127214['query']);_0x3bbfb7[_0x2c56('0x39')]=_[_0x2c56('0x37')](_0x127214[_0x2c56('0x38')],qs['fields'](_0x4d646d[_0x2c56('0x34')][_0x2c56('0x3a')]));_0x3bbfb7[_0x2c56('0x39')]=_0x3bbfb7[_0x2c56('0x39')][_0x2c56('0x3b')]?_0x3bbfb7['attributes']:_0x127214[_0x2c56('0x38')];if(!_0x4d646d[_0x2c56('0x34')][_0x2c56('0x3c')]('nolimit')){_0x3bbfb7['limit']=qs['limit'](_0x4d646d[_0x2c56('0x34')]['limit']);_0x3bbfb7[_0x2c56('0x21')]=qs[_0x2c56('0x21')](_0x4d646d[_0x2c56('0x34')][_0x2c56('0x21')]);}_0x3bbfb7[_0x2c56('0x3d')]=qs[_0x2c56('0x3e')](_0x4d646d[_0x2c56('0x34')]['sort']);_0x3bbfb7['where']=qs['filters'](_[_0x2c56('0x3f')](_0x4d646d[_0x2c56('0x34')],_0x127214[_0x2c56('0x36')]),_0x4e2789);if(_0x4d646d['query'][_0x2c56('0x40')]){_0x3bbfb7[_0x2c56('0x41')]=_[_0x2c56('0x42')](_0x3bbfb7[_0x2c56('0x41')],{'$or':_[_0x2c56('0x30')](_0x4e2789,function(_0x5a0b70){if(_0x5a0b70[_0x2c56('0x43')]!==_0x2c56('0x44')){var _0x42353c={};_0x42353c[_0x5a0b70['name']]={'$like':'%'+_0x4d646d[_0x2c56('0x34')][_0x2c56('0x40')]+'%'};return _0x42353c;}})});}_0x3bbfb7=_['merge']({},_0x3bbfb7,_0x4d646d[_0x2c56('0x45')]);var _0x2a9100={'where':_0x3bbfb7['where']};return db['ChatInternalMessage'][_0x2c56('0x24')](_0x2a9100)['then'](function(_0x2754e4){_0x4831f5[_0x2c56('0x24')]=_0x2754e4;if(_0x4d646d['query']['includeAll']){_0x3bbfb7['include']=[{'all':!![]}];}return db[_0x2c56('0x46')][_0x2c56('0x47')](_0x3bbfb7);})[_0x2c56('0x29')](function(_0x161c0e){_0x4831f5[_0x2c56('0x48')]=_0x161c0e;return _0x4831f5;})['then'](respondWithFilteredResult(_0x23390c,_0x3bbfb7))[_0x2c56('0x49')](handleError(_0x23390c,null));};exports['show']=function(_0x17ca5c,_0x37e386){var _0x22671e={'raw':!![],'where':{'id':_0x17ca5c['params']['id']}},_0x314641={};_0x314641[_0x2c56('0x38')]=_[_0x2c56('0x35')](db[_0x2c56('0x46')]['rawAttributes']);_0x314641['query']=_[_0x2c56('0x35')](_0x17ca5c['query']);_0x314641[_0x2c56('0x36')]=_['intersection'](_0x314641[_0x2c56('0x38')],_0x314641[_0x2c56('0x34')]);_0x22671e['attributes']=_[_0x2c56('0x37')](_0x314641[_0x2c56('0x38')],qs['fields'](_0x17ca5c[_0x2c56('0x34')][_0x2c56('0x3a')]));_0x22671e[_0x2c56('0x39')]=_0x22671e[_0x2c56('0x39')][_0x2c56('0x3b')]?_0x22671e['attributes']:_0x314641[_0x2c56('0x38')];if(_0x17ca5c[_0x2c56('0x34')][_0x2c56('0x4a')]){_0x22671e[_0x2c56('0x4b')]=[{'all':!![]}];}_0x22671e=_['merge']({},_0x22671e,_0x17ca5c[_0x2c56('0x45')]);return db[_0x2c56('0x46')]['find'](_0x22671e)[_0x2c56('0x29')](handleEntityNotFound(_0x37e386,null))[_0x2c56('0x29')](respondWithResult(_0x37e386,null))[_0x2c56('0x49')](handleError(_0x37e386,null));};exports[_0x2c56('0x4c')]=function(_0x5799a5,_0x3806e0){return db[_0x2c56('0x46')][_0x2c56('0x4c')](_0x5799a5['body'],{})[_0x2c56('0x29')](respondWithResult(_0x3806e0,0xc9))[_0x2c56('0x49')](handleError(_0x3806e0,null));};exports['update']=function(_0x554c94,_0x3cd0b5){if(_0x554c94['body']['id']){delete _0x554c94[_0x2c56('0x4d')]['id'];}return db[_0x2c56('0x46')][_0x2c56('0x4e')]({'where':{'id':_0x554c94[_0x2c56('0x4f')]['id']}})[_0x2c56('0x29')](handleEntityNotFound(_0x3cd0b5,null))[_0x2c56('0x29')](saveUpdates(_0x554c94[_0x2c56('0x4d')],null))[_0x2c56('0x29')](respondWithResult(_0x3cd0b5,null))[_0x2c56('0x49')](handleError(_0x3cd0b5,null));};exports[_0x2c56('0x50')]=function(_0x498d07,_0x4fb189){return db['ChatInternalMessage']['find']({'where':{'id':_0x498d07['params']['id']}})[_0x2c56('0x29')](handleEntityNotFound(_0x4fb189,null))[_0x2c56('0x29')](removeEntity(_0x4fb189,null))[_0x2c56('0x49')](handleError(_0x4fb189,null));};exports[_0x2c56('0x51')]=function(_0x27eac4,_0x462db9){return db[_0x2c56('0x46')][_0x2c56('0x51')]()[_0x2c56('0x29')](respondWithResult(_0x462db9,null))[_0x2c56('0x49')](handleError(_0x462db9,null));};function wrapUser(_0x3d82d4){return function(_0x404ca8){var _0x3a7b84=_0x3d82d4[_0x2c56('0x52')]({'plain':!![]});_0x3a7b84[_0x2c56('0x53')]=[];if(_0x404ca8){_0x3a7b84[_0x2c56('0x54')]=_0x404ca8[_0x2c56('0x55')];_0x3a7b84[_0x2c56('0x56')]=_0x404ca8;}else{_0x3a7b84['lastMessageAt']=moment(0x0)[_0x2c56('0x57')](_0x2c56('0x58'));_0x3a7b84[_0x2c56('0x56')]={};}return _0x3a7b84;};}exports['getUsers']=function(_0x1d2a13,_0x164e39,_0x3a1e37){var _0x32506e=[];return db[_0x2c56('0x59')]['findAll']({'where':{'role':[_0x2c56('0x5a'),'admin',_0x2c56('0x5b')]},'attributes':['id',_0x2c56('0x5c'),'name','role',_0x2c56('0x5d'),'internal','online',_0x2c56('0x5e'),'allowmessenger','showWebBar'],'order':qs[_0x2c56('0x3e')]('-online'),'include':[{'model':db[_0x2c56('0x5f')],'as':_0x2c56('0x60'),'attributes':['id',_0x2c56('0x2d'),_0x2c56('0x43')],'through':{'attributes':[]}}]})[_0x2c56('0x29')](function(_0x2fac1b){if(_0x2fac1b){var _0x2f6244=_0x1d2a13[_0x2c56('0x5b')][_0x2c56('0x52')]({'plain':!![]});if(!_0x2f6244)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f6244['role']===_0x2c56('0x5b')){return db[_0x2c56('0x61')][_0x2c56('0x4e')]({'where':{'name':_0x2c56('0x62'),'userProfileId':_0x2f6244['userProfileId']},'raw':!![]})[_0x2c56('0x29')](function(_0x1e6894){if(_0x1e6894){if(_0x1e6894['autoAssociation']===0x0){return db[_0x2c56('0x63')][_0x2c56('0x47')]({'where':{'sectionId':_0x1e6894['id']},'raw':!![]})[_0x2c56('0x29')](function(_0x1d8bcc){var _0x53883f=[];if(_[_0x2c56('0x64')](_0x1d8bcc)){_0x53883f=_[_0x2c56('0x40')](_0x2fac1b,function(_0x4f092f){if(_0x4f092f[_0x2c56('0x65')]!==_0x2c56('0x5a')){return _0x4f092f;}});return _0x53883f;}else{for(var _0x41d81a=0x0;_0x41d81a<_0x2fac1b[_0x2c56('0x3b')];_0x41d81a++){var _0x5d3873=_0x2fac1b[_0x41d81a];if(_0x5d3873[_0x2c56('0x65')]===_0x2c56('0x5a')){var _0x32c496=_['find'](_0x1d8bcc,function(_0x42bc09){return _0x42bc09['resourceId']===_0x5d3873['id'];});if(_0x32c496)_0x53883f[_0x2c56('0x66')](_0x5d3873);}else{_0x53883f['push'](_0x5d3873);}}return _0x53883f;}});}else{return _0x2fac1b;}}else{var _0x40a5db=_[_0x2c56('0x40')](_0x2fac1b,function(_0x54b06a){if(_0x54b06a[_0x2c56('0x65')]!=='agent'){return _0x54b06a;}});return _0x40a5db;}});}else{return _0x2fac1b;}}})[_0x2c56('0x29')](function(_0xa4a69){var _0x16af69=[];if(_0xa4a69){_0x32506e=_0xa4a69;for(var _0x738ddd=0x0;_0x738ddd<_0xa4a69[_0x2c56('0x3b')];_0x738ddd+=0x1){_0x32506e[_0x738ddd][_0x2c56('0x53')]=[];_0x16af69['push'](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x1d2a13[_0x2c56('0x5b')]['id'],_0xa4a69[_0x738ddd]['id']],'ToId':[_0x1d2a13[_0x2c56('0x5b')]['id'],_0xa4a69[_0x738ddd]['id']],'ChatGroupId':null},'attributes':['id',_0x2c56('0x55'),_0x2c56('0x67'),_0x2c56('0x68'),_0x2c56('0x69'),_0x2c56('0x4d')],'order':qs[_0x2c56('0x3e')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2c56('0x29')](wrapUser(_0xa4a69[_0x738ddd])));}return BPromise[_0x2c56('0x6a')](_0x16af69);}return[];})[_0x2c56('0x29')](function(_0x2229d1){return{'rows':_0x2229d1,'count':_0x2229d1[_0x2c56('0x3b')]};})['then'](respondWithResult(_0x164e39,null))[_0x2c56('0x49')](handleError(_0x164e39,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 4126154..485a356 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 _0xb184=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hook'];(function(_0x2f1e68,_0x38b8f5){var _0x79d7dd=function(_0x3ff36a){while(--_0x3ff36a){_0x2f1e68['push'](_0x2f1e68['shift']());}};_0x79d7dd(++_0x38b8f5);}(_0xb184,0x14e));var _0x4b18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb184[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x4b18('0x0'));var ChatInternalMessage=require(_0x4b18('0x1'))['db'][_0x4b18('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4b18('0x3')](0x0);var events={'afterCreate':_0x4b18('0x4'),'afterUpdate':'update','afterDestroy':_0x4b18('0x5')};function emitEvent(_0x60cb1a){return function(_0x15fadb,_0x19500d,_0x1af7b5){ChatInternalMessageEvents[_0x4b18('0x6')](_0x60cb1a+':'+_0x15fadb['id'],_0x15fadb);ChatInternalMessageEvents['emit'](_0x60cb1a,_0x15fadb);_0x1af7b5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x4b18('0x7')](e,emitEvent(event));}}module[_0x4b18('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x4390=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hook'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x4390,0x88));var _0x0439=function(_0x89c25f,_0x447499){_0x89c25f=_0x89c25f-0x0;var _0x730ea5=_0x4390[_0x89c25f];return _0x730ea5;};'use strict';var EventEmitter=require(_0x0439('0x0'));var ChatInternalMessage=require(_0x0439('0x1'))['db'][_0x0439('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0439('0x3')](0x0);var events={'afterCreate':_0x0439('0x4'),'afterUpdate':_0x0439('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4ac968){return function(_0x5c8030,_0x196901,_0x25142f){ChatInternalMessageEvents[_0x0439('0x6')](_0x4ac968+':'+_0x5c8030['id'],_0x5c8030);ChatInternalMessageEvents[_0x0439('0x6')](_0x4ac968,_0x5c8030);_0x25142f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x0439('0x7')](e,emitEvent(event));}}module[_0x0439('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 1245c9c..3579865 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 _0xb9d6=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xb9d6,0xc9));var _0x6b9d=function(_0x42b3aa,_0x223f53){_0x42b3aa=_0x42b3aa-0x0;var _0x319157=_0xb9d6[_0x42b3aa];return _0x319157;};'use strict';var _=require(_0x6b9d('0x0'));var util=require('util');var logger=require(_0x6b9d('0x1'))(_0x6b9d('0x2'));var moment=require(_0x6b9d('0x3'));var BPromise=require(_0x6b9d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b9d('0x5'));var rimraf=require(_0x6b9d('0x6'));var config=require(_0x6b9d('0x7'));var attributes=require(_0x6b9d('0x8'));module[_0x6b9d('0x9')]=function(_0x5c0235,_0x570b7e){return _0x5c0235[_0x6b9d('0xa')](_0x6b9d('0xb'),attributes,{'tableName':_0x6b9d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b9d('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x4b53=['../../config/environment','exports','ChatInternalMessage','chat_internal_messages','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x4b53,0x1dd));var _0x34b5=function(_0xe23b4b,_0x208e2a){_0xe23b4b=_0xe23b4b-0x0;var _0x9a972a=_0x4b53[_0xe23b4b];return _0x9a972a;};'use strict';var _=require(_0x34b5('0x0'));var util=require(_0x34b5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x34b5('0x2'));var BPromise=require(_0x34b5('0x3'));var rp=require(_0x34b5('0x4'));var fs=require('fs');var path=require(_0x34b5('0x5'));var rimraf=require(_0x34b5('0x6'));var config=require(_0x34b5('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0x34b5('0x8')]=function(_0x57a948,_0x3d833c){return _0x57a948['define'](_0x34b5('0x9'),attributes,{'tableName':_0x34b5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index aa76047..c413853 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 _0x6d03=['./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x576ae7,_0x384abe){var _0x50b4c9=function(_0x199304){while(--_0x199304){_0x576ae7['push'](_0x576ae7['shift']());}};_0x50b4c9(++_0x384abe);}(_0x6d03,0x177));var _0x36d0=function(_0xaa7cc4,_0x46bdac){_0xaa7cc4=_0xaa7cc4-0x0;var _0x129f07=_0x6d03[_0xaa7cc4];return _0x129f07;};'use strict';var _=require(_0x36d0('0x0'));var util=require('util');var moment=require(_0x36d0('0x1'));var BPromise=require(_0x36d0('0x2'));var rs=require(_0x36d0('0x3'));var fs=require('fs');var Redis=require(_0x36d0('0x4'));var db=require(_0x36d0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x36d0('0x6'))(_0x36d0('0x7'));var config=require(_0x36d0('0x8'));var jayson=require(_0x36d0('0x9'));var client=jayson['client'][_0x36d0('0xa')]({'port':0x232a});config[_0x36d0('0xb')]=_[_0x36d0('0xc')](config[_0x36d0('0xb')],{'host':_0x36d0('0xd'),'port':0x18eb});var socket=require(_0x36d0('0xe'))(new Redis(config['redis']));require(_0x36d0('0xf'))[_0x36d0('0x10')](socket);function respondWithRpcPromise(_0x1cc21d,_0x285900,_0x3fa0fd){return new BPromise(function(_0x5e4666,_0x5b69ff){return client[_0x36d0('0x11')](_0x1cc21d,_0x3fa0fd)[_0x36d0('0x12')](function(_0x189792){logger[_0x36d0('0x13')](_0x36d0('0x14'),_0x285900,_0x36d0('0x15'));logger['debug'](_0x36d0('0x16'),_0x285900,'request\x20sent',JSON['stringify'](_0x189792));if(_0x189792['error']){if(_0x189792['error']['code']===0x1f4){logger[_0x36d0('0x17')](_0x36d0('0x14'),_0x285900,_0x189792[_0x36d0('0x17')][_0x36d0('0x18')]);return _0x5b69ff(_0x189792[_0x36d0('0x17')][_0x36d0('0x18')]);}logger[_0x36d0('0x17')](_0x36d0('0x14'),_0x285900,_0x189792[_0x36d0('0x17')][_0x36d0('0x18')]);return _0x5e4666(_0x189792[_0x36d0('0x17')]['message']);}else{logger['info'](_0x36d0('0x14'),_0x285900,_0x36d0('0x15'));_0x5e4666(_0x189792['result'][_0x36d0('0x18')]);}})[_0x36d0('0x19')](function(_0x20115c){logger[_0x36d0('0x17')](_0x36d0('0x14'),_0x285900,_0x20115c);_0x5b69ff(_0x20115c);});});}
\ No newline at end of file
+var _0xe95b=['bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x3247bd,_0x2bf86b){var _0x2fa768=function(_0xde652){while(--_0xde652){_0x3247bd['push'](_0x3247bd['shift']());}};_0x2fa768(++_0x2bf86b);}(_0xe95b,0x107));var _0xbe95=function(_0x2a3fc4,_0x3c038e){_0x2a3fc4=_0x2a3fc4-0x0;var _0x431759=_0xe95b[_0x2a3fc4];return _0x431759;};'use strict';var _=require(_0xbe95('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbe95('0x1'));var rs=require(_0xbe95('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbe95('0x3'));var logger=require(_0xbe95('0x4'))('rpc');var config=require(_0xbe95('0x5'));var jayson=require(_0xbe95('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xbe95('0x7')],{'host':_0xbe95('0x8'),'port':0x18eb});var socket=require(_0xbe95('0x9'))(new Redis(config[_0xbe95('0x7')]));require(_0xbe95('0xa'))[_0xbe95('0xb')](socket);function respondWithRpcPromise(_0x6442a2,_0xa9029d,_0xb3c5fd){return new BPromise(function(_0x53a02f,_0x37b226){return client[_0xbe95('0xc')](_0x6442a2,_0xb3c5fd)['then'](function(_0x1f1ac2){logger[_0xbe95('0xd')](_0xbe95('0xe'),_0xa9029d,_0xbe95('0xf'));logger[_0xbe95('0x10')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0xa9029d,_0xbe95('0xf'),JSON[_0xbe95('0x11')](_0x1f1ac2));if(_0x1f1ac2[_0xbe95('0x12')]){if(_0x1f1ac2['error']['code']===0x1f4){logger[_0xbe95('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0xa9029d,_0x1f1ac2[_0xbe95('0x12')][_0xbe95('0x13')]);return _0x37b226(_0x1f1ac2[_0xbe95('0x12')][_0xbe95('0x13')]);}logger[_0xbe95('0x12')](_0xbe95('0xe'),_0xa9029d,_0x1f1ac2[_0xbe95('0x12')][_0xbe95('0x13')]);return _0x53a02f(_0x1f1ac2['error'][_0xbe95('0x13')]);}else{logger[_0xbe95('0xd')]('ChatInternalMessage,\x20%s,\x20%s',_0xa9029d,_0xbe95('0xf'));_0x53a02f(_0x1f1ac2[_0xbe95('0x14')][_0xbe95('0x13')]);}})[_0xbe95('0x15')](function(_0x11827f){logger['error'](_0xbe95('0xe'),_0xa9029d,_0x11827f);_0x37b226(_0x11827f);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 7feb5da..247418d 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 _0x1ad9=['update','emit','removeListener','length','save','remove'];(function(_0x4f4f0f,_0x25c84f){var _0x2a0c8a=function(_0x2619c7){while(--_0x2619c7){_0x4f4f0f['push'](_0x4f4f0f['shift']());}};_0x2a0c8a(++_0x25c84f);}(_0x1ad9,0x94));var _0x91ad=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x1ad9[_0x387777];return _0x3f84c0;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x91ad('0x0'),_0x91ad('0x1'),_0x91ad('0x2')];function createListener(_0x147c7d,_0x111094){return function(_0x3b6b22){_0x111094[_0x91ad('0x3')](_0x147c7d,_0x3b6b22);};}function removeListener(_0x150718,_0x1604c5){return function(){ChatInternalMessageEvents[_0x91ad('0x4')](_0x150718,_0x1604c5);};}exports['register']=function(_0xe13125){for(var _0xb8028a=0x0,_0x2f7496=events[_0x91ad('0x5')];_0xb8028a<_0x2f7496;_0xb8028a++){var _0x554314=events[_0xb8028a];var _0x2e153c=createListener('chatInternalMessage:'+_0x554314,_0xe13125);ChatInternalMessageEvents['on'](_0x554314,_0x2e153c);}};
\ No newline at end of file
+var _0x503d=['remove','update','length','./chatInternalMessage.events','save'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0x503d,0x161));var _0xd503=function(_0x4f6f84,_0x31e197){_0x4f6f84=_0x4f6f84-0x0;var _0x20d989=_0x503d[_0x4f6f84];return _0x20d989;};'use strict';var ChatInternalMessageEvents=require(_0xd503('0x0'));var events=[_0xd503('0x1'),_0xd503('0x2'),_0xd503('0x3')];function createListener(_0x58ea37,_0x10e0a5){return function(_0x4ca480){_0x10e0a5['emit'](_0x58ea37,_0x4ca480);};}function removeListener(_0x3413e0,_0x49140d){return function(){ChatInternalMessageEvents['removeListener'](_0x3413e0,_0x49140d);};}exports['register']=function(_0x3592b3){for(var _0x9ba85d=0x0,_0x4f131d=events[_0xd503('0x4')];_0x9ba85d<_0x4f131d;_0x9ba85d++){var _0x18d7f9=events[_0x9ba85d];var _0x4fad98=createListener('chatInternalMessage:'+_0x18d7f9,_0x3592b3);ChatInternalMessageEvents['on'](_0x18d7f9,_0x4fad98);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index f415a38..692a194 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 _0x29a5=['Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x29a5,0x1e0));var _0x529a=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x29a5[_0x4a747d];return _0x3a5b5c;};'use strict';var multer=require(_0x529a('0x0'));var util=require(_0x529a('0x1'));var path=require(_0x529a('0x2'));var timeout=require('connect-timeout');var express=require(_0x529a('0x3'));var router=express[_0x529a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x529a('0x5'));var interaction=require(_0x529a('0x6'));var config=require('../../config/environment');var controller=require(_0x529a('0x7'));router[_0x529a('0x8')]('/',auth[_0x529a('0x9')](),controller[_0x529a('0xa')]);router[_0x529a('0x8')](_0x529a('0xb'),auth[_0x529a('0x9')](),controller['describe']);router[_0x529a('0x8')](_0x529a('0xc'),auth[_0x529a('0x9')](),controller['getUsers']);router[_0x529a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x529a('0xd')]);router[_0x529a('0xe')]('/',auth[_0x529a('0x9')](),controller[_0x529a('0xf')]);router[_0x529a('0x10')](_0x529a('0x11'),controller[_0x529a('0x12')]);router[_0x529a('0x13')](_0x529a('0x11'),auth[_0x529a('0x9')](),controller[_0x529a('0x14')]);module[_0x529a('0x15')]=router;
\ No newline at end of file
+var _0x7dfa=['create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','getUsers','show','post'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7dfa,0xa7));var _0xa7df=function(_0x3f3f40,_0x4c71f4){_0x3f3f40=_0x3f3f40-0x0;var _0x403b7a=_0x7dfa[_0x3f3f40];return _0x403b7a;};'use strict';var multer=require(_0xa7df('0x0'));var util=require(_0xa7df('0x1'));var path=require(_0xa7df('0x2'));var timeout=require(_0xa7df('0x3'));var express=require(_0xa7df('0x4'));var router=express['Router']();var fs_extra=require(_0xa7df('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa7df('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xa7df('0x7')]('/',auth[_0xa7df('0x8')](),controller[_0xa7df('0x9')]);router[_0xa7df('0x7')]('/describe',auth[_0xa7df('0x8')](),controller['describe']);router['get']('/users',auth[_0xa7df('0x8')](),controller[_0xa7df('0xa')]);router['get']('/:id',auth[_0xa7df('0x8')](),controller[_0xa7df('0xb')]);router[_0xa7df('0xc')]('/',auth['isAuthenticated'](),controller[_0xa7df('0xd')]);router[_0xa7df('0xe')](_0xa7df('0xf'),controller[_0xa7df('0x10')]);router[_0xa7df('0x11')](_0xa7df('0xf'),auth[_0xa7df('0x8')](),controller[_0xa7df('0x12')]);module[_0xa7df('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 86c9229..c450ece 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 _0xa062=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x116f1f,_0x504f9c){var _0x15d7ab=function(_0x27af2d){while(--_0x27af2d){_0x116f1f['push'](_0x116f1f['shift']());}};_0x15d7ab(++_0x504f9c);}(_0xa062,0x101));var _0x2a06=function(_0x510bc7,_0x540f0d){_0x510bc7=_0x510bc7-0x0;var _0x49e2cd=_0xa062[_0x510bc7];return _0x49e2cd;};'use strict';var Sequelize=require(_0x2a06('0x0'));module[_0x2a06('0x1')]={'body':{'type':Sequelize[_0x2a06('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2a06('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x2a06('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2a06('0x4')]('in',_0x2a06('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x2a06('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x1c3d=['TEXT','medium','BOOLEAN','out','DATE','STRING','exports'];(function(_0x42152d,_0x27738d){var _0x7c79a5=function(_0xe78d9e){while(--_0xe78d9e){_0x42152d['push'](_0x42152d['shift']());}};_0x7c79a5(++_0x27738d);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x43c341,_0x4aa2ca){_0x43c341=_0x43c341-0x0;var _0xf8e420=_0x1c3d[_0x43c341];return _0xf8e420;};'use strict';var Sequelize=require('sequelize');module[_0xd1c3('0x0')]={'body':{'type':Sequelize[_0xd1c3('0x1')](_0xd1c3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd1c3('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd1c3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xd1c3('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd1c3('0x5')]},'providerName':{'type':Sequelize[_0xd1c3('0x6')]},'providerResponse':{'type':Sequelize[_0xd1c3('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 348849e..912b21f 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 _0x6c98=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','socket.io-emitter','./chatMessage.socket','register','client','http','request','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','set','Content-Range','apply','then','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','ChatMessage','count','findAll','show','params','includeAll','include','find','create','body','describe','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','update','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','motionChannel','channel','event','EventManager','acceptmessage','formData','chat-interactions','reject','ChatInteraction','ChatInteractionId','info','role','null','rejectMessage','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x112661,_0x3404c8){var _0x29dc36=function(_0x564408){while(--_0x564408){_0x112661['push'](_0x112661['shift']());}};_0x29dc36(++_0x3404c8);}(_0x6c98,0x7c));var _0x86c9=function(_0x47d39e,_0x945d10){_0x47d39e=_0x47d39e-0x0;var _0x47e00a=_0x6c98[_0x47d39e];return _0x47e00a;};'use strict';var emlformat=require(_0x86c9('0x0'));var rimraf=require(_0x86c9('0x1'));var zipdir=require(_0x86c9('0x2'));var jsonpatch=require(_0x86c9('0x3'));var rp=require(_0x86c9('0x4'));var moment=require(_0x86c9('0x5'));var BPromise=require(_0x86c9('0x6'));var Mustache=require(_0x86c9('0x7'));var util=require(_0x86c9('0x8'));var path=require(_0x86c9('0x9'));var sox=require('sox');var csv=require(_0x86c9('0xa'));var ejs=require(_0x86c9('0xb'));var fs=require('fs');var fs_extra=require(_0x86c9('0xc'));var _=require(_0x86c9('0xd'));var squel=require(_0x86c9('0xe'));var crypto=require('crypto');var jsforce=require(_0x86c9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x86c9('0xa'));var querystring=require(_0x86c9('0x10'));var Papa=require(_0x86c9('0x11'));var Redis=require(_0x86c9('0x12'));var authService=require(_0x86c9('0x13'));var qs=require(_0x86c9('0x14'));var as=require(_0x86c9('0x15'));var hardwareService=require(_0x86c9('0x16'));var logger=require(_0x86c9('0x17'))('api');var utils=require(_0x86c9('0x18'));var config=require(_0x86c9('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x86c9('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x86c9('0x1b'))(new Redis(config[_0x86c9('0x1a')]));require(_0x86c9('0x1c'))[_0x86c9('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x86c9('0x1e')][_0x86c9('0x1f')]({'port':0x232c});var client9002=jayson[_0x86c9('0x1e')][_0x86c9('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2d8418,_0x3cf7b1,_0x21046e,_0x2c6e2c){return new BPromise(function(_0x5db56a,_0x3f1e87){var _0xe71fa3=_0x2c6e2c||client;return _0xe71fa3[_0x86c9('0x20')](_0x2d8418,_0x21046e)['then'](function(_0x25cc4a){logger['info'](_0x86c9('0x21'),_0x3cf7b1,_0x86c9('0x22'));logger['debug'](_0x86c9('0x23'),_0x3cf7b1,_0x86c9('0x22'),JSON[_0x86c9('0x24')](_0x25cc4a));if(_0x25cc4a[_0x86c9('0x25')]){if(_0x25cc4a[_0x86c9('0x25')][_0x86c9('0x26')]===0x1f4){logger[_0x86c9('0x25')]('ChatMessage,\x20%s,\x20%s',_0x3cf7b1,_0x25cc4a[_0x86c9('0x25')][_0x86c9('0x27')]);return _0x3f1e87(_0x25cc4a[_0x86c9('0x25')][_0x86c9('0x27')]);}logger[_0x86c9('0x25')](_0x86c9('0x21'),_0x3cf7b1,_0x25cc4a[_0x86c9('0x25')][_0x86c9('0x27')]);return _0x5db56a(_0x25cc4a[_0x86c9('0x25')]['message']);}else{logger['info'](_0x86c9('0x21'),_0x3cf7b1,'request\x20sent');_0x5db56a(_0x25cc4a[_0x86c9('0x28')]['message']);}})[_0x86c9('0x29')](function(_0x3c1b09){logger[_0x86c9('0x25')](_0x86c9('0x21'),_0x3cf7b1,_0x3c1b09);_0x3f1e87(_0x3c1b09);});});}function respondWithStatusCode(_0xa0c71a,_0x2e339e){_0x2e339e=_0x2e339e||0xcc;return function(_0x537884){if(_0x537884){return _0xa0c71a['sendStatus'](_0x2e339e);}return _0xa0c71a[_0x86c9('0x2a')](_0x2e339e)[_0x86c9('0x2b')]();};}function respondWithResult(_0x18519c,_0x487215){_0x487215=_0x487215||0xc8;return function(_0x3ed2ba){if(_0x3ed2ba){return _0x18519c[_0x86c9('0x2a')](_0x487215)[_0x86c9('0x2c')](_0x3ed2ba);}};}function respondWithFilteredResult(_0x5eead3,_0x553d8e){return function(_0x37ad40){if(_0x37ad40){var _0x41348b=typeof _0x553d8e[_0x86c9('0x2d')]===_0x86c9('0x2e')&&typeof _0x553d8e[_0x86c9('0x2f')]==='undefined';var _0x4aa290=_0x37ad40['count'];var _0x407b2c=_0x41348b?0x0:_0x553d8e[_0x86c9('0x2d')];var _0x27f017=_0x41348b?_0x37ad40['count']:_0x553d8e[_0x86c9('0x2d')]+_0x553d8e['limit'];var _0x3d09e8;if(_0x27f017>=_0x4aa290){_0x27f017=_0x4aa290;_0x3d09e8=0xc8;}else{_0x3d09e8=0xce;}_0x5eead3['status'](_0x3d09e8);return _0x5eead3[_0x86c9('0x30')](_0x86c9('0x31'),_0x407b2c+'-'+_0x27f017+'/'+_0x4aa290)[_0x86c9('0x2c')](_0x37ad40);}return null;};}function patchUpdates(_0x6c681d){return function(_0x27028b){try{jsonpatch[_0x86c9('0x32')](_0x27028b,_0x6c681d,!![]);}catch(_0x3a1bbd){return BPromise['reject'](_0x3a1bbd);}return _0x27028b['save']();};}function saveUpdates(_0x18d838,_0x5bbc39){return function(_0x170db9){if(_0x170db9){return _0x170db9['update'](_0x18d838)[_0x86c9('0x33')](function(_0x123fe3){return _0x123fe3;});}return null;};}function removeEntity(_0x3ec55f,_0x425f57){return function(_0x4509e9){if(_0x4509e9){return _0x4509e9[_0x86c9('0x34')]()[_0x86c9('0x33')](function(){_0x3ec55f[_0x86c9('0x2a')](0xcc)[_0x86c9('0x2b')]();});}};}function handleEntityNotFound(_0x16115b,_0x31b45f){return function(_0x357b82){if(!_0x357b82){_0x16115b[_0x86c9('0x35')](0x194);}return _0x357b82;};}function handleError(_0x8c778e,_0x39f28){_0x39f28=_0x39f28||0x1f4;return function(_0x322bb0){logger[_0x86c9('0x25')](_0x322bb0[_0x86c9('0x36')]);if(_0x322bb0[_0x86c9('0x37')]){delete _0x322bb0[_0x86c9('0x37')];}_0x8c778e[_0x86c9('0x2a')](_0x39f28)['send'](_0x322bb0);};}exports[_0x86c9('0x38')]=function(_0x322862,_0x30489a){var _0x264577={},_0x4cf751={},_0x1797b0={'count':0x0,'rows':[]};var _0x145aca=_[_0x86c9('0x39')](db['ChatMessage'][_0x86c9('0x3a')],function(_0x183b6e){return{'name':_0x183b6e[_0x86c9('0x3b')],'type':_0x183b6e[_0x86c9('0x3c')][_0x86c9('0x3d')]};});_0x4cf751['model']=_[_0x86c9('0x39')](_0x145aca,_0x86c9('0x37'));_0x4cf751[_0x86c9('0x3e')]=_[_0x86c9('0x3f')](_0x322862['query']);_0x4cf751['filters']=_[_0x86c9('0x40')](_0x4cf751[_0x86c9('0x41')],_0x4cf751[_0x86c9('0x3e')]);_0x264577[_0x86c9('0x42')]=_[_0x86c9('0x40')](_0x4cf751[_0x86c9('0x41')],qs[_0x86c9('0x43')](_0x322862['query'][_0x86c9('0x43')]));_0x264577['attributes']=_0x264577['attributes'][_0x86c9('0x44')]?_0x264577[_0x86c9('0x42')]:_0x4cf751['model'];if(!_0x322862[_0x86c9('0x3e')][_0x86c9('0x45')](_0x86c9('0x46'))){_0x264577[_0x86c9('0x2f')]=qs['limit'](_0x322862[_0x86c9('0x3e')][_0x86c9('0x2f')]);_0x264577[_0x86c9('0x2d')]=qs[_0x86c9('0x2d')](_0x322862[_0x86c9('0x3e')][_0x86c9('0x2d')]);}_0x264577[_0x86c9('0x47')]=qs[_0x86c9('0x48')](_0x322862[_0x86c9('0x3e')][_0x86c9('0x48')]);_0x264577[_0x86c9('0x49')]=qs[_0x86c9('0x4a')](_[_0x86c9('0x4b')](_0x322862[_0x86c9('0x3e')],_0x4cf751[_0x86c9('0x4a')]),_0x145aca);if(_0x322862['query']['filter']){_0x264577[_0x86c9('0x49')]=_[_0x86c9('0x4c')](_0x264577[_0x86c9('0x49')],{'$or':_[_0x86c9('0x39')](_0x145aca,function(_0x29c417){if(_0x29c417['type']!=='VIRTUAL'){var _0x47a5c6={};_0x47a5c6[_0x29c417[_0x86c9('0x37')]]={'$like':'%'+_0x322862[_0x86c9('0x3e')]['filter']+'%'};return _0x47a5c6;}})});}_0x264577=_[_0x86c9('0x4c')]({},_0x264577,_0x322862[_0x86c9('0x4d')]);var _0x27a14c={'where':_0x264577[_0x86c9('0x49')]};return db[_0x86c9('0x4e')][_0x86c9('0x4f')](_0x27a14c)[_0x86c9('0x33')](function(_0x1a7a23){_0x1797b0['count']=_0x1a7a23;if(_0x322862[_0x86c9('0x3e')]['includeAll']){_0x264577['include']=[{'all':!![]}];}return db[_0x86c9('0x4e')][_0x86c9('0x50')](_0x264577);})[_0x86c9('0x33')](function(_0x591802){_0x1797b0['rows']=_0x591802;return _0x1797b0;})[_0x86c9('0x33')](respondWithFilteredResult(_0x30489a,_0x264577))[_0x86c9('0x29')](handleError(_0x30489a,null));};exports[_0x86c9('0x51')]=function(_0x33dd94,_0x23fd6e){var _0x4b14a4={'raw':!![],'where':{'id':_0x33dd94[_0x86c9('0x52')]['id']}},_0x104141={};_0x104141['model']=_[_0x86c9('0x3f')](db[_0x86c9('0x4e')][_0x86c9('0x3a')]);_0x104141[_0x86c9('0x3e')]=_[_0x86c9('0x3f')](_0x33dd94['query']);_0x104141[_0x86c9('0x4a')]=_['intersection'](_0x104141['model'],_0x104141[_0x86c9('0x3e')]);_0x4b14a4[_0x86c9('0x42')]=_[_0x86c9('0x40')](_0x104141[_0x86c9('0x41')],qs[_0x86c9('0x43')](_0x33dd94['query']['fields']));_0x4b14a4[_0x86c9('0x42')]=_0x4b14a4['attributes'][_0x86c9('0x44')]?_0x4b14a4['attributes']:_0x104141[_0x86c9('0x41')];if(_0x33dd94[_0x86c9('0x3e')][_0x86c9('0x53')]){_0x4b14a4[_0x86c9('0x54')]=[{'all':!![]}];}_0x4b14a4=_[_0x86c9('0x4c')]({},_0x4b14a4,_0x33dd94[_0x86c9('0x4d')]);return db[_0x86c9('0x4e')][_0x86c9('0x55')](_0x4b14a4)[_0x86c9('0x33')](handleEntityNotFound(_0x23fd6e,null))['then'](respondWithResult(_0x23fd6e,null))[_0x86c9('0x29')](handleError(_0x23fd6e,null));};exports[_0x86c9('0x56')]=function(_0x50946b,_0x27d69f){return db[_0x86c9('0x4e')][_0x86c9('0x56')](_0x50946b[_0x86c9('0x57')],{})['then'](respondWithResult(_0x27d69f,0xc9))[_0x86c9('0x29')](handleError(_0x27d69f,null));};exports['update']=function(_0x44015f,_0x9f79b9){if(_0x44015f['body']['id']){delete _0x44015f['body']['id'];}return db[_0x86c9('0x4e')][_0x86c9('0x55')]({'where':{'id':_0x44015f[_0x86c9('0x52')]['id']}})[_0x86c9('0x33')](handleEntityNotFound(_0x9f79b9,null))[_0x86c9('0x33')](saveUpdates(_0x44015f['body'],null))[_0x86c9('0x33')](respondWithResult(_0x9f79b9,null))[_0x86c9('0x29')](handleError(_0x9f79b9,null));};exports['destroy']=function(_0x1e20bb,_0x38fabe){return db[_0x86c9('0x4e')][_0x86c9('0x55')]({'where':{'id':_0x1e20bb['params']['id']}})['then'](handleEntityNotFound(_0x38fabe,null))[_0x86c9('0x33')](removeEntity(_0x38fabe,null))[_0x86c9('0x29')](handleError(_0x38fabe,null));};exports['describe']=function(_0x4c0354,_0x7ac2ca){return db['ChatMessage'][_0x86c9('0x58')]()[_0x86c9('0x33')](respondWithResult(_0x7ac2ca,null))[_0x86c9('0x29')](handleError(_0x7ac2ca,null));};var interaction_log=require(_0x86c9('0x17'))('chat-interactions');exports[_0x86c9('0x59')]=function(_0x3ebb90,_0x1b3067,_0x5045a0){var _0x91685a={'agent':{},'channel':_0x86c9('0x5a')};if(_0x3ebb90[_0x86c9('0x57')]['id']){delete _0x3ebb90[_0x86c9('0x57')]['id'];}_0x3ebb90[_0x86c9('0x57')]['read']=!![];_0x3ebb90[_0x86c9('0x57')][_0x86c9('0x5b')]=moment()[_0x86c9('0x5c')](_0x86c9('0x5d'));_0x3ebb90[_0x86c9('0x57')][_0x86c9('0x5e')]=_0x3ebb90[_0x86c9('0x57')]['UserId']||_0x3ebb90['user']['id'];_0x91685a[_0x86c9('0x5f')]['id']=_0x3ebb90['body'][_0x86c9('0x5e')];return db[_0x86c9('0x4e')]['find']({'where':{'id':_0x3ebb90[_0x86c9('0x52')]['id'],'UserId':null}})[_0x86c9('0x33')](handleEntityNotFound(_0x1b3067,null))['then'](saveUpdates(_0x3ebb90[_0x86c9('0x57')],null))[_0x86c9('0x33')](function(_0x5e2c2e){if(_0x5e2c2e){_0x91685a[_0x86c9('0x27')]=_0x5e2c2e[_0x86c9('0x60')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x5e2c2e['ChatInteractionId']}});}return null;})[_0x86c9('0x33')](handleEntityNotFound(_0x1b3067,null))[_0x86c9('0x33')](function(_0x25fe42){if(_0x25fe42){return _0x25fe42[_0x86c9('0x61')]({'UserId':_0x3ebb90[_0x86c9('0x57')][_0x86c9('0x5e')],'read1stAt':_['isNil'](_0x25fe42['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x86c9('0x33')](function(_0x32ab1b){if(_0x32ab1b){_0x91685a[_0x86c9('0x62')]=_0x32ab1b['get']({'plain':!![]});interaction_log['info'](_0x86c9('0x63'),_0x3ebb90[_0x86c9('0x64')]['id'],_0x3ebb90[_0x86c9('0x64')][_0x86c9('0x37')],_0x3ebb90[_0x86c9('0x64')]['role'],_0x91685a[_0x86c9('0x62')]['id'],_0x3ebb90[_0x86c9('0x57')]?JSON[_0x86c9('0x24')](_0x3ebb90['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x86c9('0x65'),_0x91685a);}return null;})[_0x86c9('0x33')](function(_0x464437){var _0x1d8bd2=_0x86c9('0x66')+_0x464437[_0x86c9('0x27')][_0x86c9('0x67')];return db[_0x86c9('0x68')][_0x86c9('0x3e')](_0x1d8bd2,{'type':db[_0x86c9('0x69')][_0x86c9('0x6a')][_0x86c9('0x6b')],'raw':!![]})['then'](function(_0x20baaa){return _0x20baaa;});})[_0x86c9('0x33')](function(_0x3cb6bc){if(_0x3cb6bc){_0x91685a[_0x86c9('0x27')][_0x86c9('0x6c')]=_0x3cb6bc[0x0];if(!_0x3ebb90['body']['UserId'])return;return db[_0x86c9('0x6d')][_0x86c9('0x55')]({'where':{'id':_0x3ebb90[_0x86c9('0x57')]['UserId'],'role':_0x86c9('0x5f')},'attributes':['id',_0x86c9('0x37'),_0x86c9('0x6e'),_0x86c9('0x6f'),_0x86c9('0x70')],'raw':!![]});}return null;})[_0x86c9('0x33')](function(_0x11be9b){if(!_0x11be9b)return null;_0x91685a[_0x86c9('0x27')][_0x86c9('0x5f')]=_0x11be9b;return _0x91685a;})[_0x86c9('0x33')](function(_0x1c3d2b){if(_0x1c3d2b){if(_0x3ebb90[_0x86c9('0x57')][_0x86c9('0x71')]){_0x91685a[_0x86c9('0x27')][_0x86c9('0x72')]=util[_0x86c9('0x5c')]('SIP/%s',_0x3ebb90[_0x86c9('0x64')][_0x86c9('0x37')]);_0x91685a['message']['channel']=_0x91685a['channel'];_0x91685a[_0x86c9('0x27')][_0x86c9('0x73')]=_0x91685a[_0x86c9('0x74')];_0x91685a[_0x86c9('0x27')][_0x86c9('0x75')]=_0x86c9('0x59');return respondWithRpcPromise(_0x86c9('0x76'),_0x86c9('0x76'),{'event':_0x86c9('0x77'),'message':_['merge'](_0x91685a[_0x86c9('0x27')],JSON['parse'](_0x91685a[_0x86c9('0x62')][_0x86c9('0x78')]))},client9002)[_0x86c9('0x33')](function(){return _0x91685a;});}return _0x91685a;}return null;})[_0x86c9('0x33')](respondWithResult(_0x1b3067,null))[_0x86c9('0x29')](handleError(_0x1b3067,null));};var interaction_log=require(_0x86c9('0x17'))(_0x86c9('0x79'));exports[_0x86c9('0x7a')]=function(_0x457f04,_0x217eb3,_0x55cec7){var _0x2ae5de={'agent':{},'channel':_0x86c9('0x5a')};if(_0x457f04[_0x86c9('0x57')]['id']){delete _0x457f04['body']['id'];}_0x457f04[_0x86c9('0x57')]['UserId']=_0x457f04[_0x86c9('0x57')]['UserId']||_0x457f04['user']['id'];_0x2ae5de['agent']['id']=_0x457f04[_0x86c9('0x57')][_0x86c9('0x5e')];return db['ChatMessage']['find']({'where':{'id':_0x457f04['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x217eb3,null))[_0x86c9('0x33')](function(_0x3bbdc7){if(_0x3bbdc7){_0x2ae5de[_0x86c9('0x27')]=_0x3bbdc7[_0x86c9('0x60')]({'plain':!![]});return db[_0x86c9('0x7b')][_0x86c9('0x55')]({'where':{'id':_0x3bbdc7[_0x86c9('0x7c')]}});}return null;})[_0x86c9('0x33')](handleEntityNotFound(_0x217eb3,null))['then'](function(_0x26de3e){if(_0x26de3e){_0x2ae5de[_0x86c9('0x62')]=_0x26de3e[_0x86c9('0x60')]({'plain':!![]});interaction_log[_0x86c9('0x7d')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x457f04[_0x86c9('0x64')]['id'],_0x457f04[_0x86c9('0x64')]['name'],_0x457f04[_0x86c9('0x64')][_0x86c9('0x7e')],_0x2ae5de[_0x86c9('0x62')]['id'],_0x457f04[_0x86c9('0x57')]?JSON['stringify'](_0x457f04[_0x86c9('0x57')]):_0x86c9('0x7f'));return respondWithRpcPromise('RejectMessage',_0x86c9('0x80'),_0x2ae5de);}return null;})[_0x86c9('0x33')](function(_0x27b3aa){var _0x4bc3c4=_0x86c9('0x66')+_0x27b3aa[_0x86c9('0x27')][_0x86c9('0x67')];return db[_0x86c9('0x68')][_0x86c9('0x3e')](_0x4bc3c4,{'type':db['Sequelize']['QueryTypes'][_0x86c9('0x6b')],'raw':!![]})[_0x86c9('0x33')](function(_0x4bc4cc){return _0x4bc4cc;});})[_0x86c9('0x33')](function(_0xfb8b23){if(_0xfb8b23){_0x2ae5de[_0x86c9('0x27')][_0x86c9('0x6c')]=_0xfb8b23[0x0];if(!_0x457f04[_0x86c9('0x57')][_0x86c9('0x5e')])return;return db[_0x86c9('0x6d')][_0x86c9('0x55')]({'where':{'id':_0x457f04[_0x86c9('0x57')][_0x86c9('0x5e')],'role':'agent'},'attributes':['id',_0x86c9('0x37'),_0x86c9('0x6e'),'email',_0x86c9('0x70')],'raw':!![]});}return null;})[_0x86c9('0x33')](function(_0x4f084b){if(!_0x4f084b)return null;_0x2ae5de[_0x86c9('0x27')][_0x86c9('0x5f')]=_0x4f084b;return _0x2ae5de;})['then'](function(_0x4e91fe){if(_0x4e91fe){_0x4e91fe[_0x86c9('0x27')][_0x86c9('0x72')]=util['format']('SIP/%s',_0x457f04[_0x86c9('0x64')][_0x86c9('0x37')]);_0x4e91fe['message']['channel']=_0x2ae5de[_0x86c9('0x74')];_0x4e91fe['message'][_0x86c9('0x73')]=_0x2ae5de[_0x86c9('0x74')];_0x4e91fe[_0x86c9('0x27')][_0x86c9('0x75')]=_0x86c9('0x7a');respondWithRpcPromise(_0x86c9('0x76'),_0x86c9('0x76'),{'event':_0x86c9('0x81'),'message':_[_0x86c9('0x4c')](_0x2ae5de[_0x86c9('0x27')],JSON['parse'](_0x2ae5de[_0x86c9('0x62')]['formData']))},client9002);return _0x2ae5de;}return null;})[_0x86c9('0x33')](respondWithResult(_0x217eb3,null))['catch'](handleError(_0x217eb3,null));};
\ No newline at end of file
+var _0x9cc4=['interface','channel','motionChannel','event','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','User','email','SIP/%s','EventManager','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','end','status','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','find','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','ChatInteraction','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','internal','manual'];(function(_0x3eedaf,_0x60001){var _0x123065=function(_0x2f0bc8){while(--_0x2f0bc8){_0x3eedaf['push'](_0x3eedaf['shift']());}};_0x123065(++_0x60001);}(_0x9cc4,0x1b4));var _0x49cc=function(_0x188a8c,_0x4b4ed0){_0x188a8c=_0x188a8c-0x0;var _0x5242af=_0x9cc4[_0x188a8c];return _0x5242af;};'use strict';var emlformat=require(_0x49cc('0x0'));var rimraf=require(_0x49cc('0x1'));var zipdir=require(_0x49cc('0x2'));var jsonpatch=require(_0x49cc('0x3'));var rp=require(_0x49cc('0x4'));var moment=require(_0x49cc('0x5'));var BPromise=require(_0x49cc('0x6'));var Mustache=require(_0x49cc('0x7'));var util=require(_0x49cc('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x49cc('0x9'));var ejs=require(_0x49cc('0xa'));var fs=require('fs');var fs_extra=require(_0x49cc('0xb'));var _=require('lodash');var squel=require(_0x49cc('0xc'));var crypto=require(_0x49cc('0xd'));var jsforce=require(_0x49cc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x49cc('0x9'));var querystring=require(_0x49cc('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x49cc('0x10'));var qs=require(_0x49cc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49cc('0x12'));var logger=require(_0x49cc('0x13'))(_0x49cc('0x14'));var utils=require(_0x49cc('0x15'));var config=require(_0x49cc('0x16'));var licenseUtil=require(_0x49cc('0x17'));var db=require(_0x49cc('0x18'))['db'];config[_0x49cc('0x19')]=_[_0x49cc('0x1a')](config[_0x49cc('0x19')],{'host':_0x49cc('0x1b'),'port':0x18eb});var socket=require(_0x49cc('0x1c'))(new Redis(config[_0x49cc('0x19')]));require('./chatMessage.socket')[_0x49cc('0x1d')](socket);var jayson=require(_0x49cc('0x1e'));var client=jayson[_0x49cc('0x1f')][_0x49cc('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x49cc('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x577866,_0x43410a,_0x211205,_0xcca17a){return new BPromise(function(_0x121dbe,_0x47528e){var _0xf98867=_0xcca17a||client;return _0xf98867[_0x49cc('0x21')](_0x577866,_0x211205)['then'](function(_0x4b6a0f){logger[_0x49cc('0x22')](_0x49cc('0x23'),_0x43410a,_0x49cc('0x24'));logger[_0x49cc('0x25')](_0x49cc('0x26'),_0x43410a,_0x49cc('0x24'),JSON['stringify'](_0x4b6a0f));if(_0x4b6a0f[_0x49cc('0x27')]){if(_0x4b6a0f[_0x49cc('0x27')][_0x49cc('0x28')]===0x1f4){logger[_0x49cc('0x27')](_0x49cc('0x23'),_0x43410a,_0x4b6a0f[_0x49cc('0x27')][_0x49cc('0x29')]);return _0x47528e(_0x4b6a0f['error'][_0x49cc('0x29')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x43410a,_0x4b6a0f[_0x49cc('0x27')]['message']);return _0x121dbe(_0x4b6a0f['error'][_0x49cc('0x29')]);}else{logger[_0x49cc('0x22')](_0x49cc('0x23'),_0x43410a,'request\x20sent');_0x121dbe(_0x4b6a0f[_0x49cc('0x2a')][_0x49cc('0x29')]);}})[_0x49cc('0x2b')](function(_0x5a40c7){logger['error']('ChatMessage,\x20%s,\x20%s',_0x43410a,_0x5a40c7);_0x47528e(_0x5a40c7);});});}function respondWithStatusCode(_0x10c85f,_0x15965e){_0x15965e=_0x15965e||0xcc;return function(_0x2f76c0){if(_0x2f76c0){return _0x10c85f['sendStatus'](_0x15965e);}return _0x10c85f['status'](_0x15965e)[_0x49cc('0x2c')]();};}function respondWithResult(_0x36e76c,_0x2024a9){_0x2024a9=_0x2024a9||0xc8;return function(_0x4a44a0){if(_0x4a44a0){return _0x36e76c[_0x49cc('0x2d')](_0x2024a9)[_0x49cc('0x2e')](_0x4a44a0);}};}function respondWithFilteredResult(_0x50054b,_0x4162ec){return function(_0x41a0c0){if(_0x41a0c0){var _0x271216=typeof _0x4162ec[_0x49cc('0x2f')]===_0x49cc('0x30')&&typeof _0x4162ec['limit']===_0x49cc('0x30');var _0x7c067a=_0x41a0c0[_0x49cc('0x31')];var _0x1223e8=_0x271216?0x0:_0x4162ec[_0x49cc('0x2f')];var _0x5d3ee9=_0x271216?_0x41a0c0[_0x49cc('0x31')]:_0x4162ec[_0x49cc('0x2f')]+_0x4162ec[_0x49cc('0x32')];var _0x484da1;if(_0x5d3ee9>=_0x7c067a){_0x5d3ee9=_0x7c067a;_0x484da1=0xc8;}else{_0x484da1=0xce;}_0x50054b['status'](_0x484da1);return _0x50054b['set']('Content-Range',_0x1223e8+'-'+_0x5d3ee9+'/'+_0x7c067a)[_0x49cc('0x2e')](_0x41a0c0);}return null;};}function patchUpdates(_0x7edfc){return function(_0x41c2de){try{jsonpatch[_0x49cc('0x33')](_0x41c2de,_0x7edfc,!![]);}catch(_0x34adec){return BPromise[_0x49cc('0x34')](_0x34adec);}return _0x41c2de[_0x49cc('0x35')]();};}function saveUpdates(_0x5219a4,_0x55465b){return function(_0x598f72){if(_0x598f72){return _0x598f72[_0x49cc('0x36')](_0x5219a4)[_0x49cc('0x37')](function(_0xd3ac61){return _0xd3ac61;});}return null;};}function removeEntity(_0x7e0e7,_0x583b8e){return function(_0x578acb){if(_0x578acb){return _0x578acb[_0x49cc('0x38')]()[_0x49cc('0x37')](function(){_0x7e0e7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48a0f3,_0x57b04b){return function(_0x398ce4){if(!_0x398ce4){_0x48a0f3[_0x49cc('0x39')](0x194);}return _0x398ce4;};}function handleError(_0x14c111,_0x563697){_0x563697=_0x563697||0x1f4;return function(_0x45135d){logger['error'](_0x45135d[_0x49cc('0x3a')]);if(_0x45135d[_0x49cc('0x3b')]){delete _0x45135d['name'];}_0x14c111['status'](_0x563697)[_0x49cc('0x3c')](_0x45135d);};}exports[_0x49cc('0x3d')]=function(_0x3955b0,_0x1f1ddd){var _0x16027f={},_0x5616e5={},_0x4793ab={'count':0x0,'rows':[]};var _0x472905=_[_0x49cc('0x3e')](db[_0x49cc('0x3f')][_0x49cc('0x40')],function(_0x4e4176){return{'name':_0x4e4176[_0x49cc('0x41')],'type':_0x4e4176[_0x49cc('0x42')]['key']};});_0x5616e5[_0x49cc('0x43')]=_['map'](_0x472905,_0x49cc('0x3b'));_0x5616e5[_0x49cc('0x44')]=_[_0x49cc('0x45')](_0x3955b0[_0x49cc('0x44')]);_0x5616e5[_0x49cc('0x46')]=_[_0x49cc('0x47')](_0x5616e5['model'],_0x5616e5[_0x49cc('0x44')]);_0x16027f[_0x49cc('0x48')]=_['intersection'](_0x5616e5[_0x49cc('0x43')],qs[_0x49cc('0x49')](_0x3955b0[_0x49cc('0x44')][_0x49cc('0x49')]));_0x16027f['attributes']=_0x16027f[_0x49cc('0x48')][_0x49cc('0x4a')]?_0x16027f[_0x49cc('0x48')]:_0x5616e5['model'];if(!_0x3955b0[_0x49cc('0x44')][_0x49cc('0x4b')](_0x49cc('0x4c'))){_0x16027f[_0x49cc('0x32')]=qs[_0x49cc('0x32')](_0x3955b0[_0x49cc('0x44')][_0x49cc('0x32')]);_0x16027f[_0x49cc('0x2f')]=qs[_0x49cc('0x2f')](_0x3955b0[_0x49cc('0x44')][_0x49cc('0x2f')]);}_0x16027f[_0x49cc('0x4d')]=qs['sort'](_0x3955b0[_0x49cc('0x44')][_0x49cc('0x4e')]);_0x16027f[_0x49cc('0x4f')]=qs[_0x49cc('0x46')](_[_0x49cc('0x50')](_0x3955b0['query'],_0x5616e5[_0x49cc('0x46')]),_0x472905);if(_0x3955b0['query'][_0x49cc('0x51')]){_0x16027f[_0x49cc('0x4f')]=_[_0x49cc('0x52')](_0x16027f[_0x49cc('0x4f')],{'$or':_[_0x49cc('0x3e')](_0x472905,function(_0x53f7ba){if(_0x53f7ba[_0x49cc('0x42')]!==_0x49cc('0x53')){var _0x5b5fdf={};_0x5b5fdf[_0x53f7ba['name']]={'$like':'%'+_0x3955b0['query'][_0x49cc('0x51')]+'%'};return _0x5b5fdf;}})});}_0x16027f=_[_0x49cc('0x52')]({},_0x16027f,_0x3955b0[_0x49cc('0x54')]);var _0x5b9670={'where':_0x16027f[_0x49cc('0x4f')]};return db[_0x49cc('0x3f')]['count'](_0x5b9670)[_0x49cc('0x37')](function(_0x241c5f){_0x4793ab[_0x49cc('0x31')]=_0x241c5f;if(_0x3955b0[_0x49cc('0x44')][_0x49cc('0x55')]){_0x16027f[_0x49cc('0x56')]=[{'all':!![]}];}return db[_0x49cc('0x3f')][_0x49cc('0x57')](_0x16027f);})[_0x49cc('0x37')](function(_0x239935){_0x4793ab[_0x49cc('0x58')]=_0x239935;return _0x4793ab;})[_0x49cc('0x37')](respondWithFilteredResult(_0x1f1ddd,_0x16027f))['catch'](handleError(_0x1f1ddd,null));};exports[_0x49cc('0x59')]=function(_0x26b1f1,_0x44faab){var _0x286b24={'raw':!![],'where':{'id':_0x26b1f1[_0x49cc('0x5a')]['id']}},_0x54ed68={};_0x54ed68[_0x49cc('0x43')]=_[_0x49cc('0x45')](db[_0x49cc('0x3f')][_0x49cc('0x40')]);_0x54ed68['query']=_[_0x49cc('0x45')](_0x26b1f1[_0x49cc('0x44')]);_0x54ed68['filters']=_[_0x49cc('0x47')](_0x54ed68['model'],_0x54ed68[_0x49cc('0x44')]);_0x286b24[_0x49cc('0x48')]=_[_0x49cc('0x47')](_0x54ed68[_0x49cc('0x43')],qs[_0x49cc('0x49')](_0x26b1f1[_0x49cc('0x44')][_0x49cc('0x49')]));_0x286b24['attributes']=_0x286b24[_0x49cc('0x48')][_0x49cc('0x4a')]?_0x286b24['attributes']:_0x54ed68['model'];if(_0x26b1f1[_0x49cc('0x44')]['includeAll']){_0x286b24[_0x49cc('0x56')]=[{'all':!![]}];}_0x286b24=_['merge']({},_0x286b24,_0x26b1f1[_0x49cc('0x54')]);return db[_0x49cc('0x3f')]['find'](_0x286b24)[_0x49cc('0x37')](handleEntityNotFound(_0x44faab,null))['then'](respondWithResult(_0x44faab,null))[_0x49cc('0x2b')](handleError(_0x44faab,null));};exports[_0x49cc('0x5b')]=function(_0x1067fd,_0x464c08){return db[_0x49cc('0x3f')][_0x49cc('0x5b')](_0x1067fd[_0x49cc('0x5c')],{})[_0x49cc('0x37')](respondWithResult(_0x464c08,0xc9))['catch'](handleError(_0x464c08,null));};exports[_0x49cc('0x36')]=function(_0x15e74f,_0x378791){if(_0x15e74f[_0x49cc('0x5c')]['id']){delete _0x15e74f[_0x49cc('0x5c')]['id'];}return db[_0x49cc('0x3f')][_0x49cc('0x5d')]({'where':{'id':_0x15e74f[_0x49cc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x378791,null))[_0x49cc('0x37')](saveUpdates(_0x15e74f[_0x49cc('0x5c')],null))[_0x49cc('0x37')](respondWithResult(_0x378791,null))['catch'](handleError(_0x378791,null));};exports[_0x49cc('0x38')]=function(_0x1fd2e5,_0x3d9a12){return db[_0x49cc('0x3f')][_0x49cc('0x5d')]({'where':{'id':_0x1fd2e5[_0x49cc('0x5a')]['id']}})[_0x49cc('0x37')](handleEntityNotFound(_0x3d9a12,null))[_0x49cc('0x37')](removeEntity(_0x3d9a12,null))['catch'](handleError(_0x3d9a12,null));};exports[_0x49cc('0x5e')]=function(_0x2d5111,_0x1d9e76){return db[_0x49cc('0x3f')][_0x49cc('0x5e')]()['then'](respondWithResult(_0x1d9e76,null))['catch'](handleError(_0x1d9e76,null));};var interaction_log=require(_0x49cc('0x13'))(_0x49cc('0x5f'));exports[_0x49cc('0x60')]=function(_0x27144a,_0x36dc2a,_0x3fde5c){var _0x514c2b={'agent':{},'channel':_0x49cc('0x61')};if(_0x27144a['body']['id']){delete _0x27144a['body']['id'];}_0x27144a[_0x49cc('0x5c')][_0x49cc('0x62')]=!![];_0x27144a[_0x49cc('0x5c')][_0x49cc('0x63')]=moment()[_0x49cc('0x64')](_0x49cc('0x65'));_0x27144a['body'][_0x49cc('0x66')]=_0x27144a[_0x49cc('0x5c')][_0x49cc('0x66')]||_0x27144a['user']['id'];_0x514c2b[_0x49cc('0x67')]['id']=_0x27144a[_0x49cc('0x5c')]['UserId'];return db['ChatMessage'][_0x49cc('0x5d')]({'where':{'id':_0x27144a['params']['id'],'UserId':null}})[_0x49cc('0x37')](handleEntityNotFound(_0x36dc2a,null))[_0x49cc('0x37')](saveUpdates(_0x27144a['body'],null))[_0x49cc('0x37')](function(_0x4e0a06){if(_0x4e0a06){_0x514c2b[_0x49cc('0x29')]=_0x4e0a06['get']({'plain':!![]});return db[_0x49cc('0x68')][_0x49cc('0x5d')]({'where':{'id':_0x4e0a06['ChatInteractionId']}});}return null;})[_0x49cc('0x37')](handleEntityNotFound(_0x36dc2a,null))[_0x49cc('0x37')](function(_0x2c6329){if(_0x2c6329){return _0x2c6329[_0x49cc('0x36')]({'UserId':_0x27144a[_0x49cc('0x5c')]['UserId'],'read1stAt':_[_0x49cc('0x69')](_0x2c6329[_0x49cc('0x6a')])?moment()[_0x49cc('0x64')](_0x49cc('0x65')):undefined});}return null;})[_0x49cc('0x37')](function(_0x4d6f12){if(_0x4d6f12){_0x514c2b[_0x49cc('0x6b')]=_0x4d6f12[_0x49cc('0x6c')]({'plain':!![]});interaction_log[_0x49cc('0x22')](_0x49cc('0x6d'),_0x27144a[_0x49cc('0x6e')]['id'],_0x27144a[_0x49cc('0x6e')][_0x49cc('0x3b')],_0x27144a['user'][_0x49cc('0x6f')],_0x514c2b['interaction']['id'],_0x27144a[_0x49cc('0x5c')]?JSON[_0x49cc('0x70')](_0x27144a[_0x49cc('0x5c')]):_0x49cc('0x71'));return respondWithRpcPromise(_0x49cc('0x72'),_0x49cc('0x73'),_0x514c2b);}return null;})[_0x49cc('0x37')](function(_0x2c71d1){var _0x4ab23a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2c71d1[_0x49cc('0x29')][_0x49cc('0x74')];return db['sequelize'][_0x49cc('0x44')](_0x4ab23a,{'type':db[_0x49cc('0x75')][_0x49cc('0x76')][_0x49cc('0x77')],'raw':!![]})[_0x49cc('0x37')](function(_0x2c86ef){return _0x2c86ef;});})['then'](function(_0xf851ab){if(_0xf851ab){_0x514c2b['message'][_0x49cc('0x78')]=_0xf851ab[0x0];if(!_0x27144a[_0x49cc('0x5c')][_0x49cc('0x66')])return;return db['User'][_0x49cc('0x5d')]({'where':{'id':_0x27144a[_0x49cc('0x5c')][_0x49cc('0x66')],'role':_0x49cc('0x67')},'attributes':['id',_0x49cc('0x3b'),_0x49cc('0x79'),'email',_0x49cc('0x7a')],'raw':!![]});}return null;})[_0x49cc('0x37')](function(_0x1d407b){if(!_0x1d407b)return null;_0x514c2b[_0x49cc('0x29')][_0x49cc('0x67')]=_0x1d407b;return _0x514c2b;})[_0x49cc('0x37')](function(_0x313a6e){if(_0x313a6e){if(_0x27144a[_0x49cc('0x5c')][_0x49cc('0x7b')]){_0x514c2b[_0x49cc('0x29')][_0x49cc('0x7c')]=util[_0x49cc('0x64')]('SIP/%s',_0x27144a[_0x49cc('0x6e')]['name']);_0x514c2b['message']['channel']=_0x514c2b[_0x49cc('0x7d')];_0x514c2b[_0x49cc('0x29')][_0x49cc('0x7e')]=_0x514c2b[_0x49cc('0x7d')];_0x514c2b[_0x49cc('0x29')][_0x49cc('0x7f')]=_0x49cc('0x60');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_[_0x49cc('0x52')](_0x514c2b['message'],JSON[_0x49cc('0x80')](_0x514c2b[_0x49cc('0x6b')][_0x49cc('0x81')]))},client9002)[_0x49cc('0x37')](function(){return _0x514c2b;});}return _0x514c2b;}return null;})[_0x49cc('0x37')](respondWithResult(_0x36dc2a,null))[_0x49cc('0x2b')](handleError(_0x36dc2a,null));};var interaction_log=require('../../config/logger')(_0x49cc('0x5f'));exports[_0x49cc('0x34')]=function(_0x293fe2,_0x5b61d6,_0x4c8e5e){var _0x43eb79={'agent':{},'channel':_0x49cc('0x61')};if(_0x293fe2[_0x49cc('0x5c')]['id']){delete _0x293fe2[_0x49cc('0x5c')]['id'];}_0x293fe2[_0x49cc('0x5c')][_0x49cc('0x66')]=_0x293fe2['body']['UserId']||_0x293fe2['user']['id'];_0x43eb79[_0x49cc('0x67')]['id']=_0x293fe2['body'][_0x49cc('0x66')];return db[_0x49cc('0x3f')][_0x49cc('0x5d')]({'where':{'id':_0x293fe2['params']['id'],'UserId':null}})[_0x49cc('0x37')](handleEntityNotFound(_0x5b61d6,null))[_0x49cc('0x37')](function(_0x5377d9){if(_0x5377d9){_0x43eb79['message']=_0x5377d9[_0x49cc('0x6c')]({'plain':!![]});return db[_0x49cc('0x68')]['find']({'where':{'id':_0x5377d9[_0x49cc('0x82')]}});}return null;})[_0x49cc('0x37')](handleEntityNotFound(_0x5b61d6,null))[_0x49cc('0x37')](function(_0x5dda2b){if(_0x5dda2b){_0x43eb79[_0x49cc('0x6b')]=_0x5dda2b[_0x49cc('0x6c')]({'plain':!![]});interaction_log[_0x49cc('0x22')](_0x49cc('0x83'),_0x293fe2[_0x49cc('0x6e')]['id'],_0x293fe2[_0x49cc('0x6e')][_0x49cc('0x3b')],_0x293fe2[_0x49cc('0x6e')]['role'],_0x43eb79[_0x49cc('0x6b')]['id'],_0x293fe2[_0x49cc('0x5c')]?JSON[_0x49cc('0x70')](_0x293fe2[_0x49cc('0x5c')]):_0x49cc('0x71'));return respondWithRpcPromise(_0x49cc('0x84'),_0x49cc('0x85'),_0x43eb79);}return null;})[_0x49cc('0x37')](function(_0x28961b){var _0x1daf19='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x28961b[_0x49cc('0x29')][_0x49cc('0x74')];return db[_0x49cc('0x86')][_0x49cc('0x44')](_0x1daf19,{'type':db[_0x49cc('0x75')][_0x49cc('0x76')][_0x49cc('0x77')],'raw':!![]})[_0x49cc('0x37')](function(_0x3099df){return _0x3099df;});})[_0x49cc('0x37')](function(_0x38b231){if(_0x38b231){_0x43eb79['message']['contact']=_0x38b231[0x0];if(!_0x293fe2[_0x49cc('0x5c')][_0x49cc('0x66')])return;return db[_0x49cc('0x87')][_0x49cc('0x5d')]({'where':{'id':_0x293fe2[_0x49cc('0x5c')][_0x49cc('0x66')],'role':'agent'},'attributes':['id','name','fullname',_0x49cc('0x88'),_0x49cc('0x7a')],'raw':!![]});}return null;})[_0x49cc('0x37')](function(_0x4bc2eb){if(!_0x4bc2eb)return null;_0x43eb79[_0x49cc('0x29')][_0x49cc('0x67')]=_0x4bc2eb;return _0x43eb79;})[_0x49cc('0x37')](function(_0x535b76){if(_0x535b76){_0x535b76['message'][_0x49cc('0x7c')]=util[_0x49cc('0x64')](_0x49cc('0x89'),_0x293fe2[_0x49cc('0x6e')]['name']);_0x535b76[_0x49cc('0x29')]['channel']=_0x43eb79['channel'];_0x535b76[_0x49cc('0x29')][_0x49cc('0x7e')]=_0x43eb79[_0x49cc('0x7d')];_0x535b76['message']['event']=_0x49cc('0x34');respondWithRpcPromise(_0x49cc('0x8a'),_0x49cc('0x8a'),{'event':_0x49cc('0x8b'),'message':_[_0x49cc('0x52')](_0x43eb79[_0x49cc('0x29')],JSON[_0x49cc('0x80')](_0x43eb79[_0x49cc('0x6b')][_0x49cc('0x81')]))},client9002);return _0x43eb79;}return null;})[_0x49cc('0x37')](respondWithResult(_0x5b61d6,null))['catch'](handleError(_0x5b61d6,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 4a250b3..5db0ab9 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 _0x896c=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x15a489,_0x5c0b85){var _0x281fa4=function(_0xb1ee7){while(--_0xb1ee7){_0x15a489['push'](_0x15a489['shift']());}};_0x281fa4(++_0x5c0b85);}(_0x896c,0xd2));var _0xc896=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0x896c[_0x4b03c9];return _0x161ba2;};'use strict';var EventEmitter=require(_0xc896('0x0'));var ChatMessage=require(_0xc896('0x1'))['db'][_0xc896('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc896('0x3')](0x0);var events={'afterCreate':_0xc896('0x4'),'afterUpdate':_0xc896('0x5'),'afterDestroy':_0xc896('0x6')};function emitEvent(_0x86afbe){return function(_0x58b2b7,_0x261b68,_0x3b5421){ChatMessageEvents[_0xc896('0x7')](_0x86afbe+':'+_0x58b2b7['id'],_0x58b2b7);ChatMessageEvents[_0xc896('0x7')](_0x86afbe,_0x58b2b7);_0x3b5421(null);};}for(var e in events){if(events[_0xc896('0x8')](e)){var event=events[e];ChatMessage[_0xc896('0x9')](e,emitEvent(event));}}module[_0xc896('0xa')]=ChatMessageEvents;
\ No newline at end of file
+var _0x55b2=['update','remove','emit','hasOwnProperty','hook','exports','ChatMessage','setMaxListeners'];(function(_0x1c8314,_0x512e7e){var _0x4bfc4b=function(_0x2d8410){while(--_0x2d8410){_0x1c8314['push'](_0x1c8314['shift']());}};_0x4bfc4b(++_0x512e7e);}(_0x55b2,0x186));var _0x255b=function(_0x2ac766,_0x514088){_0x2ac766=_0x2ac766-0x0;var _0x3b31c8=_0x55b2[_0x2ac766];return _0x3b31c8;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x255b('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x255b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x255b('0x2'),'afterDestroy':_0x255b('0x3')};function emitEvent(_0x1fefaf){return function(_0x1a741d,_0x5bd4ec,_0x549cc1){ChatMessageEvents[_0x255b('0x4')](_0x1fefaf+':'+_0x1a741d['id'],_0x1a741d);ChatMessageEvents[_0x255b('0x4')](_0x1fefaf,_0x1a741d);_0x549cc1(null);};}for(var e in events){if(events[_0x255b('0x5')](e)){var event=events[e];ChatMessage[_0x255b('0x6')](e,emitEvent(event));}}module[_0x255b('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 132dab7..a89f8e3 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 _0x3dfa=['models','get','direction','toLowerCase','out','ChatInteraction','findOne','ChatInteractionId','then','update','catch','utf8mb4','lodash','util','moment','request-promise','path','rimraf','../../config/environment','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT'];(function(_0x472cfe,_0x161baf){var _0x22b3a2=function(_0x281466){while(--_0x281466){_0x472cfe['push'](_0x472cfe['shift']());}};_0x22b3a2(++_0x161baf);}(_0x3dfa,0x114));var _0xa3df=function(_0x17052c,_0x1c762d){_0x17052c=_0x17052c-0x0;var _0x3f436c=_0x3dfa[_0x17052c];return _0x3f436c;};'use strict';var _=require(_0xa3df('0x0'));var util=require(_0xa3df('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa3df('0x2'));var BPromise=require('bluebird');var rp=require(_0xa3df('0x3'));var fs=require('fs');var path=require(_0xa3df('0x4'));var rimraf=require(_0xa3df('0x5'));var config=require(_0xa3df('0x6'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x2af8b9,_0x39ed32){return _0x2af8b9[_0xa3df('0x7')](_0xa3df('0x8'),attributes,{'tableName':_0xa3df('0x9'),'paranoid':![],'indexes':[{'name':_0xa3df('0xa'),'fields':['body'],'type':_0xa3df('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b74ed,_0x2a02a2,_0xa25eab){var _0x4adbe0=_0x2af8b9[_0xa3df('0xc')];var _0x3ce422=_0x3b74ed[_0xa3df('0xd')]({'plain':!![]});if(_0x3ce422[_0xa3df('0xe')][_0xa3df('0xf')]()==='in'||_0x3ce422[_0xa3df('0xe')]['toLowerCase']()===_0xa3df('0x10')&&!_0x3ce422['secret']&&!_['isNil'](_0x3ce422['UserId'])){_0x4adbe0[_0xa3df('0x11')][_0xa3df('0x12')]({'where':{'id':_0x3ce422[_0xa3df('0x13')]}})[_0xa3df('0x14')](function(_0x5dcb75){if(_0x5dcb75){_0x5dcb75[_0xa3df('0x15')]({'lastMsgAt':_0x3ce422['createdAt'],'lastMsgDirection':_0x3ce422[_0xa3df('0xe')][_0xa3df('0xf')]()});}})[_0xa3df('0x16')](function(_0x5dcfa1){console['error'](_0x5dcfa1);});}_0xa25eab();}},'charset':_0xa3df('0x17'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x9e93=['then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne'];(function(_0x51ddfe,_0x63fe43){var _0x17c2da=function(_0x124196){while(--_0x124196){_0x51ddfe['push'](_0x51ddfe['shift']());}};_0x17c2da(++_0x63fe43);}(_0x9e93,0xca));var _0x39e9=function(_0x22cc16,_0x1f4fa2){_0x22cc16=_0x22cc16-0x0;var _0x399b70=_0x9e93[_0x22cc16];return _0x399b70;};'use strict';var _=require(_0x39e9('0x0'));var util=require('util');var logger=require(_0x39e9('0x1'))('api');var moment=require(_0x39e9('0x2'));var BPromise=require(_0x39e9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x39e9('0x4'));var config=require(_0x39e9('0x5'));var attributes=require(_0x39e9('0x6'));module[_0x39e9('0x7')]=function(_0x4edb6,_0x4b8aa4){return _0x4edb6['define'](_0x39e9('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x39e9('0x9'),'fields':[_0x39e9('0xa')],'type':_0x39e9('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x58848f,_0xc4e8b0,_0x5d824f){var _0x46ce34=_0x4edb6[_0x39e9('0xc')];var _0x2a2607=_0x58848f[_0x39e9('0xd')]({'plain':!![]});if(_0x2a2607[_0x39e9('0xe')][_0x39e9('0xf')]()==='in'||_0x2a2607['direction'][_0x39e9('0xf')]()===_0x39e9('0x10')&&!_0x2a2607[_0x39e9('0x11')]&&!_[_0x39e9('0x12')](_0x2a2607[_0x39e9('0x13')])){_0x46ce34[_0x39e9('0x14')][_0x39e9('0x15')]({'where':{'id':_0x2a2607['ChatInteractionId']}})[_0x39e9('0x16')](function(_0x3f87a4){if(_0x3f87a4){_0x3f87a4['update']({'lastMsgAt':_0x2a2607[_0x39e9('0x17')],'lastMsgDirection':_0x2a2607[_0x39e9('0xe')]['toLowerCase']()});}})[_0x39e9('0x18')](function(_0x46e593){console[_0x39e9('0x19')](_0x46e593);});}_0x5d824f();}},'charset':_0x39e9('0x1a'),'collate':_0x39e9('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index f1b474e..589a861 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 _0x961c=['ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','moment','bluebird','randomstring'];(function(_0x1534c3,_0x523f7a){var _0x3af905=function(_0x208c42){while(--_0x208c42){_0x1534c3['push'](_0x1534c3['shift']());}};_0x3af905(++_0x523f7a);}(_0x961c,0x15c));var _0xc961=function(_0x20255e,_0x2a615d){_0x20255e=_0x20255e-0x0;var _0x293046=_0x961c[_0x20255e];return _0x293046;};'use strict';var _=require(_0xc961('0x0'));var util=require('util');var moment=require(_0xc961('0x1'));var BPromise=require(_0xc961('0x2'));var rs=require(_0xc961('0x3'));var fs=require('fs');var Redis=require(_0xc961('0x4'));var db=require(_0xc961('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc961('0x6'))('rpc');var config=require(_0xc961('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc961('0x8')][_0xc961('0x9')]({'port':0x232a});config[_0xc961('0xa')]=_[_0xc961('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc961('0xc'))(new Redis(config[_0xc961('0xa')]));require('./chatMessage.socket')[_0xc961('0xd')](socket);function respondWithRpcPromise(_0x2890c9,_0x5d3789,_0x397033){return new BPromise(function(_0x34b028,_0x3315e1){return client[_0xc961('0xe')](_0x2890c9,_0x397033)[_0xc961('0xf')](function(_0x5c492e){logger[_0xc961('0x10')](_0xc961('0x11'),_0x5d3789,_0xc961('0x12'));logger[_0xc961('0x13')](_0xc961('0x14'),_0x5d3789,_0xc961('0x12'),JSON[_0xc961('0x15')](_0x5c492e));if(_0x5c492e[_0xc961('0x16')]){if(_0x5c492e[_0xc961('0x16')][_0xc961('0x17')]===0x1f4){logger[_0xc961('0x16')](_0xc961('0x11'),_0x5d3789,_0x5c492e[_0xc961('0x16')]['message']);return _0x3315e1(_0x5c492e[_0xc961('0x16')][_0xc961('0x18')]);}logger[_0xc961('0x16')](_0xc961('0x11'),_0x5d3789,_0x5c492e['error']['message']);return _0x34b028(_0x5c492e['error'][_0xc961('0x18')]);}else{logger[_0xc961('0x10')](_0xc961('0x11'),_0x5d3789,'request\x20sent');_0x34b028(_0x5c492e['result'][_0xc961('0x18')]);}})[_0xc961('0x19')](function(_0x799867){logger[_0xc961('0x16')](_0xc961('0x11'),_0x5d3789,_0x799867);_0x3315e1(_0x799867);});});}exports[_0xc961('0x1a')]=function(_0x259eff){var _0x422059=this;return new Promise(function(_0x39c74f,_0x100708){return db[_0xc961('0x1b')][_0xc961('0x1c')](_0x259eff[_0xc961('0x1d')],{'raw':_0x259eff['options']?_0x259eff[_0xc961('0x1e')][_0xc961('0x1f')]===undefined?!![]:![]:!![]})[_0xc961('0xf')](function(_0x14180e){logger['info']('CreateChatMessage',_0x259eff);logger[_0xc961('0x13')](_0xc961('0x1a'),_0x259eff,JSON[_0xc961('0x15')](_0x14180e));_0x39c74f(_0x14180e);})[_0xc961('0x19')](function(_0x75767e){logger[_0xc961('0x16')](_0xc961('0x1a'),_0x75767e[_0xc961('0x18')],_0x259eff);_0x100708(_0x422059[_0xc961('0x16')](0x1f4,_0x75767e[_0xc961('0x18')]));});});};
\ No newline at end of file
+var _0x1014=['http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','error','ChatMessage,\x20%s,\x20%s','message','request\x20sent','catch','CreateChatMessage','create','options','raw','stringify','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x31dcf3,_0x4536e7){var _0xdeb0ac=function(_0x3fb898){while(--_0x3fb898){_0x31dcf3['push'](_0x31dcf3['shift']());}};_0xdeb0ac(++_0x4536e7);}(_0x1014,0x1c7));var _0x4101=function(_0x379fb9,_0x487244){_0x379fb9=_0x379fb9-0x0;var _0x542669=_0x1014[_0x379fb9];return _0x542669;};'use strict';var _=require('lodash');var util=require(_0x4101('0x0'));var moment=require('moment');var BPromise=require(_0x4101('0x1'));var rs=require(_0x4101('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4101('0x3'))['db'];var utils=require(_0x4101('0x4'));var logger=require('../../config/logger')(_0x4101('0x5'));var config=require(_0x4101('0x6'));var jayson=require(_0x4101('0x7'));var client=jayson[_0x4101('0x8')][_0x4101('0x9')]({'port':0x232a});config[_0x4101('0xa')]=_[_0x4101('0xb')](config[_0x4101('0xa')],{'host':_0x4101('0xc'),'port':0x18eb});var socket=require(_0x4101('0xd'))(new Redis(config[_0x4101('0xa')]));require('./chatMessage.socket')[_0x4101('0xe')](socket);function respondWithRpcPromise(_0x2f98ed,_0x57728d,_0x769161){return new BPromise(function(_0x154aae,_0x27e99b){return client[_0x4101('0xf')](_0x2f98ed,_0x769161)[_0x4101('0x10')](function(_0x1f1471){logger[_0x4101('0x11')]('ChatMessage,\x20%s,\x20%s',_0x57728d,'request\x20sent');logger[_0x4101('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x57728d,'request\x20sent',JSON['stringify'](_0x1f1471));if(_0x1f1471[_0x4101('0x13')]){if(_0x1f1471[_0x4101('0x13')]['code']===0x1f4){logger[_0x4101('0x13')](_0x4101('0x14'),_0x57728d,_0x1f1471[_0x4101('0x13')][_0x4101('0x15')]);return _0x27e99b(_0x1f1471[_0x4101('0x13')][_0x4101('0x15')]);}logger[_0x4101('0x13')](_0x4101('0x14'),_0x57728d,_0x1f1471[_0x4101('0x13')][_0x4101('0x15')]);return _0x154aae(_0x1f1471[_0x4101('0x13')]['message']);}else{logger[_0x4101('0x11')](_0x4101('0x14'),_0x57728d,_0x4101('0x16'));_0x154aae(_0x1f1471['result'][_0x4101('0x15')]);}})[_0x4101('0x17')](function(_0x44f73e){logger[_0x4101('0x13')]('ChatMessage,\x20%s,\x20%s',_0x57728d,_0x44f73e);_0x27e99b(_0x44f73e);});});}exports[_0x4101('0x18')]=function(_0x2cb011){var _0x7f7e79=this;return new Promise(function(_0x13b129,_0xd88bcb){return db['ChatMessage'][_0x4101('0x19')](_0x2cb011['body'],{'raw':_0x2cb011[_0x4101('0x1a')]?_0x2cb011[_0x4101('0x1a')][_0x4101('0x1b')]===undefined?!![]:![]:!![]})[_0x4101('0x10')](function(_0x238134){logger[_0x4101('0x11')](_0x4101('0x18'),_0x2cb011);logger[_0x4101('0x12')](_0x4101('0x18'),_0x2cb011,JSON[_0x4101('0x1c')](_0x238134));_0x13b129(_0x238134);})[_0x4101('0x17')](function(_0x436a51){logger[_0x4101('0x13')]('CreateChatMessage',_0x436a51['message'],_0x2cb011);_0xd88bcb(_0x7f7e79[_0x4101('0x13')](0x1f4,_0x436a51['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 9e9bb64..200259d 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 _0x0d4d=['remove','update','emit','removeListener','chatMessage:','./chatMessage.events','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0d4d,0x132));var _0xd0d4=function(_0x3c937a,_0x551cb8){_0x3c937a=_0x3c937a-0x0;var _0x2a74a6=_0x0d4d[_0x3c937a];return _0x2a74a6;};'use strict';var ChatMessageEvents=require(_0xd0d4('0x0'));var events=[_0xd0d4('0x1'),_0xd0d4('0x2'),_0xd0d4('0x3')];function createListener(_0x1f74ab,_0x1515e0){return function(_0x4d5c19){_0x1515e0[_0xd0d4('0x4')](_0x1f74ab,_0x4d5c19);};}function removeListener(_0x58909f,_0x2e99ee){return function(){ChatMessageEvents[_0xd0d4('0x5')](_0x58909f,_0x2e99ee);};}exports['register']=function(_0x34d93b){for(var _0x3db5ab=0x0,_0x1c5d01=events['length'];_0x3db5ab<_0x1c5d01;_0x3db5ab++){var _0x5bfae8=events[_0x3db5ab];var _0x5403c0=createListener(_0xd0d4('0x6')+_0x5bfae8,_0x34d93b);ChatMessageEvents['on'](_0x5bfae8,_0x5403c0);}};
\ No newline at end of file
+var _0x9335=['register','length','chatMessage:','./chatMessage.events','save','update','emit'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0x9335,0xab));var _0x5933=function(_0x249e84,_0x4348b6){_0x249e84=_0x249e84-0x0;var _0x41115b=_0x9335[_0x249e84];return _0x41115b;};'use strict';var ChatMessageEvents=require(_0x5933('0x0'));var events=[_0x5933('0x1'),'remove',_0x5933('0x2')];function createListener(_0x407b89,_0x3617bd){return function(_0x1a529c){_0x3617bd[_0x5933('0x3')](_0x407b89,_0x1a529c);};}function removeListener(_0xc3fbd1,_0x310370){return function(){ChatMessageEvents['removeListener'](_0xc3fbd1,_0x310370);};}exports[_0x5933('0x4')]=function(_0x4de024){for(var _0x553710=0x0,_0x21f4c1=events[_0x5933('0x5')];_0x553710<_0x21f4c1;_0x553710++){var _0x21ab46=events[_0x553710];var _0x59c5cb=createListener(_0x5933('0x6')+_0x21ab46,_0x4de024);ChatMessageEvents['on'](_0x21ab46,_0x59c5cb);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index a44fd07..4708f2a 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 _0x2b96=['/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x2b96,0x18d));var _0x62b9=function(_0x38b575,_0x1f33cf){_0x38b575=_0x38b575-0x0;var _0x53f0c8=_0x2b96[_0x38b575];return _0x53f0c8;};'use strict';var multer=require(_0x62b9('0x0'));var util=require(_0x62b9('0x1'));var path=require(_0x62b9('0x2'));var timeout=require(_0x62b9('0x3'));var express=require(_0x62b9('0x4'));var router=express[_0x62b9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x62b9('0x6'));var interaction=require(_0x62b9('0x7'));var config=require(_0x62b9('0x8'));var controller=require(_0x62b9('0x9'));router[_0x62b9('0xa')]('/',auth[_0x62b9('0xb')](),controller[_0x62b9('0xc')]);router['get'](_0x62b9('0xd'),auth[_0x62b9('0xb')](),controller[_0x62b9('0xe')]);router[_0x62b9('0xa')](_0x62b9('0xf'),auth['isAuthenticated'](),controller[_0x62b9('0x10')]);router[_0x62b9('0x11')]('/',auth[_0x62b9('0xb')](),interaction[_0x62b9('0x12')](_0x62b9('0x13'),_0x62b9('0x14')),controller[_0x62b9('0x15')]);router[_0x62b9('0x16')](_0x62b9('0xf'),controller['update']);router[_0x62b9('0x16')](_0x62b9('0x17'),auth[_0x62b9('0xb')](),controller[_0x62b9('0x18')]);router[_0x62b9('0x16')](_0x62b9('0x19'),auth[_0x62b9('0xb')](),controller[_0x62b9('0x1a')]);router[_0x62b9('0x1b')](_0x62b9('0xf'),auth[_0x62b9('0xb')](),controller[_0x62b9('0x1c')]);module[_0x62b9('0x1d')]=router;
\ No newline at end of file
+var _0x2d9a=['reject','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','chat','create','update','put','/:id/reject'];(function(_0x5e89d2,_0x167d2c){var _0x2e81f3=function(_0x451fe1){while(--_0x451fe1){_0x5e89d2['push'](_0x5e89d2['shift']());}};_0x2e81f3(++_0x167d2c);}(_0x2d9a,0x128));var _0xa2d9=function(_0xb29bef,_0x45aff1){_0xb29bef=_0xb29bef-0x0;var _0x878163=_0x2d9a[_0xb29bef];return _0x878163;};'use strict';var multer=require(_0xa2d9('0x0'));var util=require('util');var path=require(_0xa2d9('0x1'));var timeout=require(_0xa2d9('0x2'));var express=require(_0xa2d9('0x3'));var router=express[_0xa2d9('0x4')]();var fs_extra=require(_0xa2d9('0x5'));var auth=require(_0xa2d9('0x6'));var interaction=require(_0xa2d9('0x7'));var config=require('../../config/environment');var controller=require(_0xa2d9('0x8'));router[_0xa2d9('0x9')]('/',auth[_0xa2d9('0xa')](),controller['index']);router['get'](_0xa2d9('0xb'),auth[_0xa2d9('0xa')](),controller[_0xa2d9('0xc')]);router[_0xa2d9('0x9')](_0xa2d9('0xd'),auth[_0xa2d9('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0xa2d9('0xe'),'chatmessage:create'),controller[_0xa2d9('0xf')]);router['put']('/:id',controller[_0xa2d9('0x10')]);router[_0xa2d9('0x11')]('/:id/accept',auth[_0xa2d9('0xa')](),controller['accept']);router[_0xa2d9('0x11')](_0xa2d9('0x12'),auth['isAuthenticated'](),controller[_0xa2d9('0x13')]);router['delete'](_0xa2d9('0xd'),auth[_0xa2d9('0xa')](),controller[_0xa2d9('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 2d6dfb1..96ab9c0 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(_0x20fb43,_0x2fff0b){var _0x3d31b8=function(_0x359930){while(--_0x359930){_0x20fb43['push'](_0x20fb43['shift']());}};_0x3d31b8(++_0x2fff0b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2d48fa,_0x103065){_0x2d48fa=_0x2d48fa-0x0;var _0x4645b7=_0x0b0e[_0x2d48fa];return _0x4645b7;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index f24036a..32f2076 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x58e8f9,_0x25faae){var _0x2b02a2=function(_0x200979){while(--_0x200979){_0x58e8f9['push'](_0x58e8f9['shift']());}};_0x2b02a2(++_0x25faae);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x7a54,0x106));var _0x47a5=function(_0xa5e637,_0x1ac25e){_0xa5e637=_0xa5e637-0x0;var _0x31b55b=_0x7a54[_0xa5e637];return _0x31b55b;};'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 ba134d5..04010e2 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 _0x1033=['update','remove','emit','hasOwnProperty','hook','exports','ChatOfflineMessage','setMaxListeners','save'];(function(_0x4f4669,_0x5af05d){var _0x48b29d=function(_0x3609e1){while(--_0x3609e1){_0x4f4669['push'](_0x4f4669['shift']());}};_0x48b29d(++_0x5af05d);}(_0x1033,0x11d));var _0x3103=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x1033[_0x1b2ff7];return _0x31656a;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db'][_0x3103('0x0')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x3103('0x1')](0x0);var events={'afterCreate':_0x3103('0x2'),'afterUpdate':_0x3103('0x3'),'afterDestroy':_0x3103('0x4')};function emitEvent(_0x4b7881){return function(_0x592134,_0x431007,_0x5b10c1){ChatOfflineMessageEvents['emit'](_0x4b7881+':'+_0x592134['id'],_0x592134);ChatOfflineMessageEvents[_0x3103('0x5')](_0x4b7881,_0x592134);_0x5b10c1(null);};}for(var e in events){if(events[_0x3103('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x3103('0x7')](e,emitEvent(event));}}module[_0x3103('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xcf81=['exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x225134,_0x2ef082){var _0x470b2b=function(_0xd56bf8){while(--_0xd56bf8){_0x225134['push'](_0x225134['shift']());}};_0x470b2b(++_0x2ef082);}(_0xcf81,0x199));var _0x1cf8=function(_0x191b8b,_0x1c3fdd){_0x191b8b=_0x191b8b-0x0;var _0x128968=_0xcf81[_0x191b8b];return _0x128968;};'use strict';var EventEmitter=require(_0x1cf8('0x0'));var ChatOfflineMessage=require(_0x1cf8('0x1'))['db'][_0x1cf8('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1cf8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1cf8('0x4')};function emitEvent(_0x56e81d){return function(_0x6d1583,_0x288172,_0x578612){ChatOfflineMessageEvents[_0x1cf8('0x5')](_0x56e81d+':'+_0x6d1583['id'],_0x6d1583);ChatOfflineMessageEvents[_0x1cf8('0x5')](_0x56e81d,_0x6d1583);_0x578612(null);};}for(var e in events){if(events[_0x1cf8('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x1cf8('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index f3caa96..5061964 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 _0x6617=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports','define'];(function(_0x552fce,_0x3f24bc){var _0x3e27a2=function(_0xc91154){while(--_0xc91154){_0x552fce['push'](_0x552fce['shift']());}};_0x3e27a2(++_0x3f24bc);}(_0x6617,0x1d2));var _0x7661=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0x6617[_0x5e238b];return _0x389bea;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x7661('0x0')]=function(_0x11c9e9){return _0x11c9e9[_0x7661('0x1')](_0x7661('0x2'),attributes,{'tableName':_0x7661('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7661('0x4'),'collate':_0x7661('0x5')});};
\ No newline at end of file
+var _0xcbd7=['utf8mb4','utf8mb4_unicode_ci','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x3e6a58,_0x4bbd5f){var _0xcb5ea4=function(_0x47ec63){while(--_0x47ec63){_0x3e6a58['push'](_0x3e6a58['shift']());}};_0xcb5ea4(++_0x4bbd5f);}(_0xcbd7,0x18e));var _0x7cbd=function(_0x30e62a,_0x254c90){_0x30e62a=_0x30e62a-0x0;var _0x20347d=_0xcbd7[_0x30e62a];return _0x20347d;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x7cbd('0x0')]=function(_0x289e11){return _0x289e11[_0x7cbd('0x1')](_0x7cbd('0x2'),attributes,{'tableName':_0x7cbd('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7cbd('0x4'),'collate':_0x7cbd('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 230876a..98f079a 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 _0x5f79=['http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x108c1c,_0x5db8b3){var _0x3face4=function(_0x12da50){while(--_0x12da50){_0x108c1c['push'](_0x108c1c['shift']());}};_0x3face4(++_0x5db8b3);}(_0x5f79,0x92));var _0x95f7=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0x5f79[_0x204eb7];return _0x37e444;};'use strict';var _=require('lodash');var util=require(_0x95f7('0x0'));var moment=require(_0x95f7('0x1'));var BPromise=require(_0x95f7('0x2'));var rs=require(_0x95f7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x95f7('0x4'));var logger=require(_0x95f7('0x5'))(_0x95f7('0x6'));var config=require('../../config/environment');var jayson=require(_0x95f7('0x7'));var client=jayson['client'][_0x95f7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe91a6d,_0x5819a6,_0x4bf8de){return new BPromise(function(_0x229ab2,_0x3693ea){return client[_0x95f7('0x9')](_0xe91a6d,_0x4bf8de)[_0x95f7('0xa')](function(_0xb08c28){logger[_0x95f7('0xb')](_0x95f7('0xc'),_0x5819a6,'request\x20sent');logger[_0x95f7('0xd')](_0x95f7('0xe'),_0x5819a6,_0x95f7('0xf'),JSON[_0x95f7('0x10')](_0xb08c28));if(_0xb08c28[_0x95f7('0x11')]){if(_0xb08c28[_0x95f7('0x11')][_0x95f7('0x12')]===0x1f4){logger[_0x95f7('0x11')](_0x95f7('0xc'),_0x5819a6,_0xb08c28[_0x95f7('0x11')]['message']);return _0x3693ea(_0xb08c28['error'][_0x95f7('0x13')]);}logger[_0x95f7('0x11')](_0x95f7('0xc'),_0x5819a6,_0xb08c28[_0x95f7('0x11')]['message']);return _0x229ab2(_0xb08c28['error']['message']);}else{logger[_0x95f7('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5819a6,_0x95f7('0xf'));_0x229ab2(_0xb08c28[_0x95f7('0x14')][_0x95f7('0x13')]);}})[_0x95f7('0x15')](function(_0x50998e){logger[_0x95f7('0x11')](_0x95f7('0xc'),_0x5819a6,_0x50998e);_0x3693ea(_0x50998e);});});}
\ No newline at end of file
+var _0x2a9a=['lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','catch'];(function(_0x630336,_0x586598){var _0x7c6754=function(_0x5c054f){while(--_0x5c054f){_0x630336['push'](_0x630336['shift']());}};_0x7c6754(++_0x586598);}(_0x2a9a,0x64));var _0xa2a9=function(_0x376c6d,_0x40ac36){_0x376c6d=_0x376c6d-0x0;var _0x2c1dc1=_0x2a9a[_0x376c6d];return _0x2c1dc1;};'use strict';var _=require(_0xa2a9('0x0'));var util=require('util');var moment=require(_0xa2a9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa2a9('0x2'));var db=require(_0xa2a9('0x3'))['db'];var utils=require(_0xa2a9('0x4'));var logger=require(_0xa2a9('0x5'))(_0xa2a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa2a9('0x7'));var client=jayson[_0xa2a9('0x8')][_0xa2a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bd1f3,_0x5c1fb2,_0x5d933f){return new BPromise(function(_0x540979,_0x523164){return client[_0xa2a9('0xa')](_0x2bd1f3,_0x5d933f)[_0xa2a9('0xb')](function(_0x3eaaa6){logger[_0xa2a9('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5c1fb2,_0xa2a9('0xd'));logger[_0xa2a9('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5c1fb2,_0xa2a9('0xd'),JSON[_0xa2a9('0xf')](_0x3eaaa6));if(_0x3eaaa6[_0xa2a9('0x10')]){if(_0x3eaaa6[_0xa2a9('0x10')]['code']===0x1f4){logger[_0xa2a9('0x10')](_0xa2a9('0x11'),_0x5c1fb2,_0x3eaaa6[_0xa2a9('0x10')][_0xa2a9('0x12')]);return _0x523164(_0x3eaaa6[_0xa2a9('0x10')][_0xa2a9('0x12')]);}logger['error'](_0xa2a9('0x11'),_0x5c1fb2,_0x3eaaa6[_0xa2a9('0x10')]['message']);return _0x540979(_0x3eaaa6['error']['message']);}else{logger[_0xa2a9('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5c1fb2,_0xa2a9('0xd'));_0x540979(_0x3eaaa6['result'][_0xa2a9('0x12')]);}})[_0xa2a9('0x13')](function(_0x657934){logger[_0xa2a9('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5c1fb2,_0x657934);_0x523164(_0x657934);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 3f8039a..0a46b9b 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 _0x8863=['/:id','isAuthenticated','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','describe'];(function(_0x2d0f4a,_0x4c32f3){var _0x5b9256=function(_0x2d7116){while(--_0x2d7116){_0x2d0f4a['push'](_0x2d0f4a['shift']());}};_0x5b9256(++_0x4c32f3);}(_0x8863,0xc5));var _0x3886=function(_0x5ed695,_0x4bf6bb){_0x5ed695=_0x5ed695-0x0;var _0x18a87f=_0x8863[_0x5ed695];return _0x18a87f;};'use strict';var multer=require('multer');var util=require(_0x3886('0x0'));var path=require(_0x3886('0x1'));var timeout=require(_0x3886('0x2'));var express=require(_0x3886('0x3'));var router=express[_0x3886('0x4')]();var fs_extra=require(_0x3886('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3886('0x6'));var config=require(_0x3886('0x7'));var controller=require(_0x3886('0x8'));router[_0x3886('0x9')]('/',auth['isAuthenticated'](),controller[_0x3886('0xa')]);router[_0x3886('0x9')](_0x3886('0xb'),auth['isAuthenticated'](),controller[_0x3886('0xc')]);router[_0x3886('0x9')](_0x3886('0xd'),auth[_0x3886('0xe')](),controller['show']);router[_0x3886('0xf')]('/',auth[_0x3886('0xe')](),controller[_0x3886('0x10')]);router[_0x3886('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3886('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3886('0x13')]);module[_0x3886('0x14')]=router;
\ No newline at end of file
+var _0x4cba=['/describe','describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index'];(function(_0x94ae20,_0x1799f2){var _0x5edd9f=function(_0x5ad310){while(--_0x5ad310){_0x94ae20['push'](_0x94ae20['shift']());}};_0x5edd9f(++_0x1799f2);}(_0x4cba,0xf1));var _0xa4cb=function(_0x29467a,_0x405f73){_0x29467a=_0x29467a-0x0;var _0xaec2df=_0x4cba[_0x29467a];return _0xaec2df;};'use strict';var multer=require('multer');var util=require(_0xa4cb('0x0'));var path=require(_0xa4cb('0x1'));var timeout=require(_0xa4cb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa4cb('0x3'));var auth=require(_0xa4cb('0x4'));var interaction=require(_0xa4cb('0x5'));var config=require(_0xa4cb('0x6'));var controller=require(_0xa4cb('0x7'));router[_0xa4cb('0x8')]('/',auth[_0xa4cb('0x9')](),controller[_0xa4cb('0xa')]);router[_0xa4cb('0x8')](_0xa4cb('0xb'),auth['isAuthenticated'](),controller[_0xa4cb('0xc')]);router[_0xa4cb('0x8')](_0xa4cb('0xd'),auth[_0xa4cb('0x9')](),controller[_0xa4cb('0xe')]);router[_0xa4cb('0xf')]('/',auth[_0xa4cb('0x9')](),controller[_0xa4cb('0x10')]);router[_0xa4cb('0x11')](_0xa4cb('0xd'),auth[_0xa4cb('0x9')](),controller['update']);router[_0xa4cb('0x12')](_0xa4cb('0xd'),auth['isAuthenticated'](),controller[_0xa4cb('0x13')]);module[_0xa4cb('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 61cb203..a4130ca 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 _0x8884=['STRING','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x5503ef,_0x3587f1){var _0x1f5c6f=function(_0x210dbb){while(--_0x210dbb){_0x5503ef['push'](_0x5503ef['shift']());}};_0x1f5c6f(++_0x3587f1);}(_0x8884,0x9a));var _0x4888=function(_0x5edf38,_0x279ecf){_0x5edf38=_0x5edf38-0x0;var _0x13adc2=_0x8884[_0x5edf38];return _0x13adc2;};'use strict';var Sequelize=require(_0x4888('0x0'));module[_0x4888('0x1')]={'name':{'type':Sequelize[_0x4888('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4888('0x3'),_0x4888('0x4')),'defaultValue':_0x4888('0x3')},'selector':{'type':Sequelize[_0x4888('0x2')]},'timeout':{'type':Sequelize[_0x4888('0x5')]}};
\ No newline at end of file
+var _0x5738=['INTEGER','exports','STRING','ENUM','mouseOver','timeout'];(function(_0xf0cae2,_0x22a2bc){var _0x36f427=function(_0x4a8b4d){while(--_0x4a8b4d){_0xf0cae2['push'](_0xf0cae2['shift']());}};_0x36f427(++_0x22a2bc);}(_0x5738,0x7f));var _0x8573=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x5738[_0x173d7e];return _0x2220d6;};'use strict';var Sequelize=require('sequelize');module[_0x8573('0x0')]={'name':{'type':Sequelize[_0x8573('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8573('0x2')](_0x8573('0x3'),_0x8573('0x4')),'defaultValue':_0x8573('0x3')},'selector':{'type':Sequelize[_0x8573('0x1')]},'timeout':{'type':Sequelize[_0x8573('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index e92ed4b..a31db03 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 _0x28aa=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge','options','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x2fc8a8,_0x71c3a2){var _0x3597b4=function(_0x41c345){while(--_0x41c345){_0x2fc8a8['push'](_0x2fc8a8['shift']());}};_0x3597b4(++_0x71c3a2);}(_0x28aa,0xf8));var _0xa28a=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x28aa[_0x4d8ed9];return _0x1e2140;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa28a('0x0'));var zipdir=require(_0xa28a('0x1'));var jsonpatch=require(_0xa28a('0x2'));var rp=require(_0xa28a('0x3'));var moment=require(_0xa28a('0x4'));var BPromise=require(_0xa28a('0x5'));var Mustache=require('mustache');var util=require(_0xa28a('0x6'));var path=require(_0xa28a('0x7'));var sox=require(_0xa28a('0x8'));var csv=require(_0xa28a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa28a('0xa'));var _=require(_0xa28a('0xb'));var squel=require(_0xa28a('0xc'));var crypto=require(_0xa28a('0xd'));var jsforce=require(_0xa28a('0xe'));var deskjs=require(_0xa28a('0xf'));var toCsv=require(_0xa28a('0x9'));var querystring=require(_0xa28a('0x10'));var Papa=require(_0xa28a('0x11'));var Redis=require(_0xa28a('0x12'));var authService=require(_0xa28a('0x13'));var qs=require(_0xa28a('0x14'));var as=require(_0xa28a('0x15'));var hardwareService=require(_0xa28a('0x16'));var logger=require(_0xa28a('0x17'))('api');var utils=require(_0xa28a('0x18'));var config=require(_0xa28a('0x19'));var licenseUtil=require(_0xa28a('0x1a'));var db=require(_0xa28a('0x1b'))['db'];function respondWithStatusCode(_0x5c93d6,_0x94e91f){_0x94e91f=_0x94e91f||0xcc;return function(_0x3e254c){if(_0x3e254c){return _0x5c93d6['sendStatus'](_0x94e91f);}return _0x5c93d6[_0xa28a('0x1c')](_0x94e91f)[_0xa28a('0x1d')]();};}function respondWithResult(_0x69f85f,_0x412e0d){_0x412e0d=_0x412e0d||0xc8;return function(_0x52ee62){if(_0x52ee62){return _0x69f85f[_0xa28a('0x1c')](_0x412e0d)[_0xa28a('0x1e')](_0x52ee62);}};}function respondWithFilteredResult(_0x11ef7c,_0x1b4f6f){return function(_0x413d48){if(_0x413d48){var _0x56c1ae=typeof _0x1b4f6f[_0xa28a('0x1f')]===_0xa28a('0x20')&&typeof _0x1b4f6f[_0xa28a('0x21')]==='undefined';var _0x15d22f=_0x413d48[_0xa28a('0x22')];var _0x468672=_0x56c1ae?0x0:_0x1b4f6f[_0xa28a('0x1f')];var _0x1fc027=_0x56c1ae?_0x413d48['count']:_0x1b4f6f['offset']+_0x1b4f6f[_0xa28a('0x21')];var _0x516340;if(_0x1fc027>=_0x15d22f){_0x1fc027=_0x15d22f;_0x516340=0xc8;}else{_0x516340=0xce;}_0x11ef7c['status'](_0x516340);return _0x11ef7c[_0xa28a('0x23')](_0xa28a('0x24'),_0x468672+'-'+_0x1fc027+'/'+_0x15d22f)[_0xa28a('0x1e')](_0x413d48);}return null;};}function patchUpdates(_0x46173d){return function(_0x115d49){try{jsonpatch[_0xa28a('0x25')](_0x115d49,_0x46173d,!![]);}catch(_0x3b0c0f){return BPromise[_0xa28a('0x26')](_0x3b0c0f);}return _0x115d49[_0xa28a('0x27')]();};}function saveUpdates(_0x512e6c,_0x15b9cf){return function(_0x43bf00){if(_0x43bf00){return _0x43bf00['update'](_0x512e6c)[_0xa28a('0x28')](function(_0x187981){return _0x187981;});}return null;};}function removeEntity(_0x461ab4,_0x57cd58){return function(_0x3770e4){if(_0x3770e4){return _0x3770e4[_0xa28a('0x29')]()['then'](function(){_0x461ab4[_0xa28a('0x1c')](0xcc)[_0xa28a('0x1d')]();});}};}function handleEntityNotFound(_0xa3541b,_0x41c68b){return function(_0x3751b8){if(!_0x3751b8){_0xa3541b['sendStatus'](0x194);}return _0x3751b8;};}function handleError(_0x5df6e5,_0x2c93a1){_0x2c93a1=_0x2c93a1||0x1f4;return function(_0x5502bf){logger[_0xa28a('0x2a')](_0x5502bf['stack']);if(_0x5502bf['name']){delete _0x5502bf[_0xa28a('0x2b')];}_0x5df6e5[_0xa28a('0x1c')](_0x2c93a1)[_0xa28a('0x2c')](_0x5502bf);};}exports[_0xa28a('0x2d')]=function(_0x5514f5,_0x103b0b){var _0x54d26d={'raw':!![],'where':{'id':_0x5514f5[_0xa28a('0x2e')]['id']}},_0x26c998={};_0x26c998[_0xa28a('0x2f')]=_[_0xa28a('0x30')](db[_0xa28a('0x31')][_0xa28a('0x32')]);_0x26c998[_0xa28a('0x33')]=_[_0xa28a('0x30')](_0x5514f5[_0xa28a('0x33')]);_0x26c998[_0xa28a('0x34')]=_[_0xa28a('0x35')](_0x26c998['model'],_0x26c998[_0xa28a('0x33')]);_0x54d26d['attributes']=_[_0xa28a('0x35')](_0x26c998[_0xa28a('0x2f')],qs[_0xa28a('0x36')](_0x5514f5['query'][_0xa28a('0x36')]));_0x54d26d[_0xa28a('0x37')]=_0x54d26d[_0xa28a('0x37')][_0xa28a('0x38')]?_0x54d26d['attributes']:_0x26c998[_0xa28a('0x2f')];if(_0x5514f5[_0xa28a('0x33')]['includeAll']){_0x54d26d[_0xa28a('0x39')]=[{'all':!![]}];}_0x54d26d=_[_0xa28a('0x3a')]({},_0x54d26d,_0x5514f5[_0xa28a('0x3b')]);return db[_0xa28a('0x31')][_0xa28a('0x3c')](_0x54d26d)['then'](handleEntityNotFound(_0x103b0b,null))[_0xa28a('0x28')](respondWithResult(_0x103b0b,null))[_0xa28a('0x3d')](handleError(_0x103b0b,null));};exports[_0xa28a('0x3e')]=function(_0x501dbf,_0x451c05){return db[_0xa28a('0x31')]['create'](_0x501dbf[_0xa28a('0x3f')],{})[_0xa28a('0x28')](respondWithResult(_0x451c05,0xc9))[_0xa28a('0x3d')](handleError(_0x451c05,null));};exports[_0xa28a('0x40')]=function(_0x4f6968,_0x2d74d1){if(_0x4f6968[_0xa28a('0x3f')]['id']){delete _0x4f6968[_0xa28a('0x3f')]['id'];}return db[_0xa28a('0x31')][_0xa28a('0x3c')]({'where':{'id':_0x4f6968['params']['id']}})[_0xa28a('0x28')](handleEntityNotFound(_0x2d74d1,null))[_0xa28a('0x28')](saveUpdates(_0x4f6968[_0xa28a('0x3f')],null))['then'](respondWithResult(_0x2d74d1,null))[_0xa28a('0x3d')](handleError(_0x2d74d1,null));};exports['destroy']=function(_0x5cf3af,_0x119338){return db[_0xa28a('0x31')][_0xa28a('0x3c')]({'where':{'id':_0x5cf3af[_0xa28a('0x2e')]['id']}})['then'](handleEntityNotFound(_0x119338,null))[_0xa28a('0x28')](removeEntity(_0x119338,null))['catch'](handleError(_0x119338,null));};
\ No newline at end of file
+var _0xc3b5=['jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','update','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto'];(function(_0x43b922,_0x5e33fd){var _0x9dba94=function(_0x39e138){while(--_0x39e138){_0x43b922['push'](_0x43b922['shift']());}};_0x9dba94(++_0x5e33fd);}(_0xc3b5,0x6f));var _0x5c3b=function(_0xffc2e7,_0x5bc33c){_0xffc2e7=_0xffc2e7-0x0;var _0x3bc22a=_0xc3b5[_0xffc2e7];return _0x3bc22a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5c3b('0x0'));var jsonpatch=require(_0x5c3b('0x1'));var rp=require(_0x5c3b('0x2'));var moment=require(_0x5c3b('0x3'));var BPromise=require(_0x5c3b('0x4'));var Mustache=require(_0x5c3b('0x5'));var util=require(_0x5c3b('0x6'));var path=require(_0x5c3b('0x7'));var sox=require('sox');var csv=require(_0x5c3b('0x8'));var ejs=require(_0x5c3b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c3b('0xa'));var squel=require(_0x5c3b('0xb'));var crypto=require(_0x5c3b('0xc'));var jsforce=require(_0x5c3b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5c3b('0x8'));var querystring=require(_0x5c3b('0xe'));var Papa=require(_0x5c3b('0xf'));var Redis=require(_0x5c3b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5c3b('0x11'));var as=require(_0x5c3b('0x12'));var hardwareService=require(_0x5c3b('0x13'));var logger=require(_0x5c3b('0x14'))(_0x5c3b('0x15'));var utils=require('../../config/utils');var config=require(_0x5c3b('0x16'));var licenseUtil=require(_0x5c3b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b2815,_0x3b953d){_0x3b953d=_0x3b953d||0xcc;return function(_0x507c2e){if(_0x507c2e){return _0x1b2815[_0x5c3b('0x18')](_0x3b953d);}return _0x1b2815[_0x5c3b('0x19')](_0x3b953d)[_0x5c3b('0x1a')]();};}function respondWithResult(_0x2384b9,_0x315e68){_0x315e68=_0x315e68||0xc8;return function(_0x3fef28){if(_0x3fef28){return _0x2384b9[_0x5c3b('0x19')](_0x315e68)['json'](_0x3fef28);}};}function respondWithFilteredResult(_0x2f7ab2,_0x5b55be){return function(_0x4cf80d){if(_0x4cf80d){var _0x195c1e=typeof _0x5b55be[_0x5c3b('0x1b')]===_0x5c3b('0x1c')&&typeof _0x5b55be['limit']===_0x5c3b('0x1c');var _0x229e28=_0x4cf80d[_0x5c3b('0x1d')];var _0x59f71b=_0x195c1e?0x0:_0x5b55be[_0x5c3b('0x1b')];var _0x34144d=_0x195c1e?_0x4cf80d['count']:_0x5b55be[_0x5c3b('0x1b')]+_0x5b55be[_0x5c3b('0x1e')];var _0x2b2307;if(_0x34144d>=_0x229e28){_0x34144d=_0x229e28;_0x2b2307=0xc8;}else{_0x2b2307=0xce;}_0x2f7ab2[_0x5c3b('0x19')](_0x2b2307);return _0x2f7ab2[_0x5c3b('0x1f')](_0x5c3b('0x20'),_0x59f71b+'-'+_0x34144d+'/'+_0x229e28)[_0x5c3b('0x21')](_0x4cf80d);}return null;};}function patchUpdates(_0x1af39c){return function(_0xc63307){try{jsonpatch[_0x5c3b('0x22')](_0xc63307,_0x1af39c,!![]);}catch(_0x4ec8c1){return BPromise['reject'](_0x4ec8c1);}return _0xc63307[_0x5c3b('0x23')]();};}function saveUpdates(_0x143022,_0x5942f1){return function(_0x439d8e){if(_0x439d8e){return _0x439d8e['update'](_0x143022)[_0x5c3b('0x24')](function(_0xb8006){return _0xb8006;});}return null;};}function removeEntity(_0x2bb9dc,_0xe9261d){return function(_0x529c39){if(_0x529c39){return _0x529c39[_0x5c3b('0x25')]()[_0x5c3b('0x24')](function(){_0x2bb9dc['status'](0xcc)[_0x5c3b('0x1a')]();});}};}function handleEntityNotFound(_0x2c8682,_0x3a8141){return function(_0x3c3991){if(!_0x3c3991){_0x2c8682['sendStatus'](0x194);}return _0x3c3991;};}function handleError(_0x15ae38,_0x20469d){_0x20469d=_0x20469d||0x1f4;return function(_0x2099dc){logger[_0x5c3b('0x26')](_0x2099dc[_0x5c3b('0x27')]);if(_0x2099dc[_0x5c3b('0x28')]){delete _0x2099dc['name'];}_0x15ae38['status'](_0x20469d)['send'](_0x2099dc);};}exports[_0x5c3b('0x29')]=function(_0x3e6832,_0x59b640){var _0xd93418={'raw':!![],'where':{'id':_0x3e6832[_0x5c3b('0x2a')]['id']}},_0x15044e={};_0x15044e[_0x5c3b('0x2b')]=_[_0x5c3b('0x2c')](db[_0x5c3b('0x2d')][_0x5c3b('0x2e')]);_0x15044e[_0x5c3b('0x2f')]=_[_0x5c3b('0x2c')](_0x3e6832[_0x5c3b('0x2f')]);_0x15044e[_0x5c3b('0x30')]=_[_0x5c3b('0x31')](_0x15044e['model'],_0x15044e[_0x5c3b('0x2f')]);_0xd93418[_0x5c3b('0x32')]=_[_0x5c3b('0x31')](_0x15044e[_0x5c3b('0x2b')],qs[_0x5c3b('0x33')](_0x3e6832[_0x5c3b('0x2f')][_0x5c3b('0x33')]));_0xd93418[_0x5c3b('0x32')]=_0xd93418[_0x5c3b('0x32')][_0x5c3b('0x34')]?_0xd93418[_0x5c3b('0x32')]:_0x15044e[_0x5c3b('0x2b')];if(_0x3e6832[_0x5c3b('0x2f')][_0x5c3b('0x35')]){_0xd93418[_0x5c3b('0x36')]=[{'all':!![]}];}_0xd93418=_[_0x5c3b('0x37')]({},_0xd93418,_0x3e6832[_0x5c3b('0x38')]);return db['ChatProactiveAction'][_0x5c3b('0x39')](_0xd93418)[_0x5c3b('0x24')](handleEntityNotFound(_0x59b640,null))[_0x5c3b('0x24')](respondWithResult(_0x59b640,null))[_0x5c3b('0x3a')](handleError(_0x59b640,null));};exports['create']=function(_0x35939b,_0x39c159){return db['ChatProactiveAction'][_0x5c3b('0x3b')](_0x35939b[_0x5c3b('0x3c')],{})[_0x5c3b('0x24')](respondWithResult(_0x39c159,0xc9))[_0x5c3b('0x3a')](handleError(_0x39c159,null));};exports[_0x5c3b('0x3d')]=function(_0x27e7f7,_0x27b34d){if(_0x27e7f7[_0x5c3b('0x3c')]['id']){delete _0x27e7f7[_0x5c3b('0x3c')]['id'];}return db['ChatProactiveAction'][_0x5c3b('0x39')]({'where':{'id':_0x27e7f7[_0x5c3b('0x2a')]['id']}})['then'](handleEntityNotFound(_0x27b34d,null))['then'](saveUpdates(_0x27e7f7[_0x5c3b('0x3c')],null))[_0x5c3b('0x24')](respondWithResult(_0x27b34d,null))[_0x5c3b('0x3a')](handleError(_0x27b34d,null));};exports[_0x5c3b('0x25')]=function(_0x223dc8,_0x406bf9){return db[_0x5c3b('0x2d')]['find']({'where':{'id':_0x223dc8['params']['id']}})[_0x5c3b('0x24')](handleEntityNotFound(_0x406bf9,null))[_0x5c3b('0x24')](removeEntity(_0x406bf9,null))[_0x5c3b('0x3a')](handleError(_0x406bf9,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 274ca0c..fcf0969 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 _0x4783=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatProactiveAction','util'];(function(_0x5b8b0a,_0x2c50db){var _0x75fc0c=function(_0x4037d6){while(--_0x4037d6){_0x5b8b0a['push'](_0x5b8b0a['shift']());}};_0x75fc0c(++_0x2c50db);}(_0x4783,0x6d));var _0x3478=function(_0x318269,_0x3b83b7){_0x318269=_0x318269-0x0;var _0x4a4832=_0x4783[_0x318269];return _0x4a4832;};'use strict';var _=require('lodash');var util=require(_0x3478('0x0'));var logger=require(_0x3478('0x1'))(_0x3478('0x2'));var moment=require(_0x3478('0x3'));var BPromise=require(_0x3478('0x4'));var rp=require(_0x3478('0x5'));var fs=require('fs');var path=require(_0x3478('0x6'));var rimraf=require(_0x3478('0x7'));var config=require(_0x3478('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0x3478('0x9')]=function(_0x2bb969,_0x31b87d){return _0x2bb969['define'](_0x3478('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1160=['api','moment','bluebird','path','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1160,0xfa));var _0x0116=function(_0x10e8ed,_0x384a0d){_0x10e8ed=_0x10e8ed-0x0;var _0x4aea4a=_0x1160[_0x10e8ed];return _0x4aea4a;};'use strict';var _=require(_0x0116('0x0'));var util=require(_0x0116('0x1'));var logger=require(_0x0116('0x2'))(_0x0116('0x3'));var moment=require(_0x0116('0x4'));var BPromise=require(_0x0116('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0116('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0116('0x7'));module[_0x0116('0x8')]=function(_0x23e3e1,_0x110dc7){return _0x23e3e1['define'](_0x0116('0x9'),attributes,{'tableName':_0x0116('0xa'),'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 53d2f83..42b58e2 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 _0xf04c=['client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x3c3710,_0x42b9ae){var _0x3d00db=function(_0x241e6b){while(--_0x241e6b){_0x3c3710['push'](_0x3c3710['shift']());}};_0x3d00db(++_0x42b9ae);}(_0xf04c,0x7c));var _0xcf04=function(_0x19680d,_0x4365e3){_0x19680d=_0x19680d-0x0;var _0x889d83=_0xf04c[_0x19680d];return _0x889d83;};'use strict';var _=require(_0xcf04('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcf04('0x1'));var rs=require(_0xcf04('0x2'));var fs=require('fs');var Redis=require(_0xcf04('0x3'));var db=require(_0xcf04('0x4'))['db'];var utils=require(_0xcf04('0x5'));var logger=require(_0xcf04('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcf04('0x7'));var client=jayson[_0xcf04('0x8')][_0xcf04('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x498fab,_0x4453f8,_0x38c36c){return new BPromise(function(_0x2200e6,_0x1e4f55){return client[_0xcf04('0xa')](_0x498fab,_0x38c36c)[_0xcf04('0xb')](function(_0x5ad9b1){logger[_0xcf04('0xc')](_0xcf04('0xd'),_0x4453f8,_0xcf04('0xe'));logger['debug'](_0xcf04('0xf'),_0x4453f8,_0xcf04('0xe'),JSON[_0xcf04('0x10')](_0x5ad9b1));if(_0x5ad9b1[_0xcf04('0x11')]){if(_0x5ad9b1['error'][_0xcf04('0x12')]===0x1f4){logger[_0xcf04('0x11')](_0xcf04('0xd'),_0x4453f8,_0x5ad9b1[_0xcf04('0x11')][_0xcf04('0x13')]);return _0x1e4f55(_0x5ad9b1['error']['message']);}logger['error'](_0xcf04('0xd'),_0x4453f8,_0x5ad9b1['error'][_0xcf04('0x13')]);return _0x2200e6(_0x5ad9b1['error'][_0xcf04('0x13')]);}else{logger['info'](_0xcf04('0xd'),_0x4453f8,_0xcf04('0xe'));_0x2200e6(_0x5ad9b1[_0xcf04('0x14')][_0xcf04('0x13')]);}})[_0xcf04('0x15')](function(_0x5ca5c0){logger[_0xcf04('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x4453f8,_0x5ca5c0);_0x1e4f55(_0x5ca5c0);});});}
\ No newline at end of file
+var _0x20bc=['http','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1263c1,_0x287a24){var _0x59639e=function(_0xf1c73c){while(--_0xf1c73c){_0x1263c1['push'](_0x1263c1['shift']());}};_0x59639e(++_0x287a24);}(_0x20bc,0xb5));var _0xc20b=function(_0x56fb7d,_0x539ea1){_0x56fb7d=_0x56fb7d-0x0;var _0x3be1c3=_0x20bc[_0x56fb7d];return _0x3be1c3;};'use strict';var _=require(_0xc20b('0x0'));var util=require(_0xc20b('0x1'));var moment=require('moment');var BPromise=require(_0xc20b('0x2'));var rs=require(_0xc20b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc20b('0x4'))['db'];var utils=require(_0xc20b('0x5'));var logger=require(_0xc20b('0x6'))(_0xc20b('0x7'));var config=require(_0xc20b('0x8'));var jayson=require(_0xc20b('0x9'));var client=jayson[_0xc20b('0xa')][_0xc20b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c171b,_0x16db57,_0x30d929){return new BPromise(function(_0x15a272,_0x65d1f8){return client['request'](_0x3c171b,_0x30d929)[_0xc20b('0xc')](function(_0x974295){logger['info'](_0xc20b('0xd'),_0x16db57,_0xc20b('0xe'));logger[_0xc20b('0xf')](_0xc20b('0x10'),_0x16db57,'request\x20sent',JSON[_0xc20b('0x11')](_0x974295));if(_0x974295[_0xc20b('0x12')]){if(_0x974295['error'][_0xc20b('0x13')]===0x1f4){logger[_0xc20b('0x12')](_0xc20b('0xd'),_0x16db57,_0x974295[_0xc20b('0x12')][_0xc20b('0x14')]);return _0x65d1f8(_0x974295[_0xc20b('0x12')]['message']);}logger[_0xc20b('0x12')](_0xc20b('0xd'),_0x16db57,_0x974295[_0xc20b('0x12')][_0xc20b('0x14')]);return _0x15a272(_0x974295['error']['message']);}else{logger[_0xc20b('0x15')](_0xc20b('0xd'),_0x16db57,_0xc20b('0xe'));_0x15a272(_0x974295[_0xc20b('0x16')]['message']);}})[_0xc20b('0x17')](function(_0x37c42f){logger[_0xc20b('0x12')](_0xc20b('0xd'),_0x16db57,_0x37c42f);_0x65d1f8(_0x37c42f);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 69896f8..45ef55c 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 _0xac9d=['get','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x40462a,_0x470472){var _0x463c6d=function(_0x563fd5){while(--_0x563fd5){_0x40462a['push'](_0x40462a['shift']());}};_0x463c6d(++_0x470472);}(_0xac9d,0x14d));var _0xdac9=function(_0x2652ef,_0x234230){_0x2652ef=_0x2652ef-0x0;var _0x2db578=_0xac9d[_0x2652ef];return _0x2db578;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xdac9('0x9')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0xc')]);router[_0xdac9('0xd')]('/',auth[_0xdac9('0xb')](),controller['create']);router[_0xdac9('0xe')]('/:id',auth[_0xdac9('0xb')](),controller[_0xdac9('0xf')]);router[_0xdac9('0x10')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0x11')]);module[_0xdac9('0x12')]=router;
\ No newline at end of file
+var _0x326f=['../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x471eec,_0x97e5f7){var _0x42818f=function(_0x3f90cf){while(--_0x3f90cf){_0x471eec['push'](_0x471eec['shift']());}};_0x42818f(++_0x97e5f7);}(_0x326f,0xd1));var _0xf326=function(_0xd84df2,_0x517955){_0xd84df2=_0xd84df2-0x0;var _0x3cf1e2=_0x326f[_0xd84df2];return _0x3cf1e2;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')](_0xf326('0xa'),auth['isAuthenticated'](),controller[_0xf326('0xb')]);router[_0xf326('0xc')]('/',auth[_0xf326('0xd')](),controller[_0xf326('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xf')]);router[_0xf326('0x10')](_0xf326('0xa'),auth[_0xf326('0xd')](),controller[_0xf326('0x11')]);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 1ba05b5..0acc2f6 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 _0x9f0d=['exports','STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x467e07,_0x2ac167){var _0x13efd3=function(_0x21f602){while(--_0x21f602){_0x467e07['push'](_0x467e07['shift']());}};_0x13efd3(++_0x2ac167);}(_0x9f0d,0x148));var _0xd9f0=function(_0x137fdc,_0x350ef5){_0x137fdc=_0x137fdc-0x0;var _0x4594b8=_0x9f0d[_0x137fdc];return _0x4594b8;};'use strict';var Sequelize=require(_0xd9f0('0x0'));module[_0xd9f0('0x1')]={'name':{'type':Sequelize[_0xd9f0('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd9f0('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd9f0('0x4')](_0xd9f0('0x5'),'beepall',_0xd9f0('0x6'))}};
\ No newline at end of file
+var _0x4863=['beepall','sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory'];(function(_0x1da2ad,_0x56f599){var _0x269367=function(_0x41e8c1){while(--_0x41e8c1){_0x1da2ad['push'](_0x1da2ad['shift']());}};_0x269367(++_0x56f599);}(_0x4863,0x1c1));var _0x3486=function(_0x2aea57,_0x2d9ab3){_0x2aea57=_0x2aea57-0x0;var _0x1ed997=_0x4863[_0x2aea57];return _0x1ed997;};'use strict';var Sequelize=require(_0x3486('0x0'));module[_0x3486('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3486('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3486('0x3')]},'timeout':{'type':Sequelize[_0x3486('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3486('0x5')](_0x3486('0x6'),_0x3486('0x7'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 6c6a222..ed40581 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 _0xffc6=['attributes','length','includeAll','merge','options','create','body','user','role','ChatQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserChatQueue','hasOwnProperty','nolimit','sort','pick','filter','findAndCountAll','UserId','agent','chatPause','createdAt','rows','format','%s/%s','SIP','updatedAt','Team','order','getTeams','ids','User','voicePause','interface','Agents','find','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','all','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','findOne','getAgents','bluebird','util','lodash','squel','ioredis','../../config/environment','redis','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','where','ChatQueue','include','query','findAll','catch','show','params','keys','filters','intersection','model','fields'];(function(_0x2389bc,_0x167cd2){var _0x170548=function(_0x2da7f2){while(--_0x2da7f2){_0x2389bc['push'](_0x2389bc['shift']());}};_0x170548(++_0x167cd2);}(_0xffc6,0x1a8));var _0x6ffc=function(_0x463cbe,_0x539756){_0x463cbe=_0x463cbe-0x0;var _0x49907a=_0xffc6[_0x463cbe];return _0x49907a;};'use strict';var BPromise=require(_0x6ffc('0x0'));var util=require(_0x6ffc('0x1'));var _=require(_0x6ffc('0x2'));var squel=require(_0x6ffc('0x3'));var Redis=require(_0x6ffc('0x4'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x6ffc('0x5'));var db=require('../../mysqldb')['db'];config[_0x6ffc('0x6')]=_['defaults'](config[_0x6ffc('0x6')],{'host':_0x6ffc('0x7'),'port':0x18eb});var socket=require(_0x6ffc('0x8'))(new Redis(config[_0x6ffc('0x6')]));require(_0x6ffc('0x9'))[_0x6ffc('0xa')](socket);function respondWithStatusCode(_0x5963cc,_0xfd6faa){_0xfd6faa=_0xfd6faa||0xcc;return function(_0x1db3b6){if(_0x1db3b6){return _0x5963cc[_0x6ffc('0xb')](_0xfd6faa);}return _0x5963cc[_0x6ffc('0xc')](_0xfd6faa)[_0x6ffc('0xd')]();};}function respondWithResult(_0x5e51f3,_0x1c87be){_0x1c87be=_0x1c87be||0xc8;return function(_0x1fd0b7){if(_0x1fd0b7){return _0x5e51f3[_0x6ffc('0xc')](_0x1c87be)[_0x6ffc('0xe')](_0x1fd0b7);}};}function respondWithFilteredResult(_0x351321,_0x564139){return function(_0x355a0b){if(_0x355a0b){var _0x275bb3=typeof _0x564139[_0x6ffc('0xf')]===_0x6ffc('0x10')&&typeof _0x564139[_0x6ffc('0x11')]===_0x6ffc('0x10');var _0x1dd693=_0x355a0b[_0x6ffc('0x12')];var _0x1c50a9=_0x275bb3?0x0:_0x564139[_0x6ffc('0xf')];var _0x250d09=_0x275bb3?_0x355a0b['count']:_0x564139[_0x6ffc('0xf')]+_0x564139[_0x6ffc('0x11')];var _0x25ba20;if(_0x250d09>=_0x1dd693){_0x250d09=_0x1dd693;_0x25ba20=0xc8;}else{_0x25ba20=0xce;}_0x351321['status'](_0x25ba20);return _0x351321[_0x6ffc('0x13')](_0x6ffc('0x14'),_0x1c50a9+'-'+_0x250d09+'/'+_0x1dd693)[_0x6ffc('0xe')](_0x355a0b);}return null;};}function saveUpdates(_0x348875){return function(_0x284229){if(_0x284229){return _0x284229[_0x6ffc('0x15')](_0x348875)[_0x6ffc('0x16')](function(_0x5cae01){return _0x5cae01;});}return null;};}function removeEntity(_0x2932cd){return function(_0x2a39ad){if(_0x2a39ad){return _0x2a39ad[_0x6ffc('0x17')]()['then'](function(){var _0x4992f5=_0x2a39ad[_0x6ffc('0x18')]({'plain':!![]});var _0x4bb2cc='ChatQueues';return db[_0x6ffc('0x19')]['destroy']({'where':{'type':_0x4bb2cc,'resourceId':_0x4992f5['id']}})[_0x6ffc('0x16')](function(){return _0x2a39ad;});})[_0x6ffc('0x16')](function(){_0x2932cd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fdb55){return function(_0x7969c9){if(!_0x7969c9){_0x4fdb55['sendStatus'](0x194);}return _0x7969c9;};}function handleError(_0x156655,_0x52fdf1){_0x52fdf1=_0x52fdf1||0x1f4;return function(_0x44ac79){logger[_0x6ffc('0x1a')](_0x44ac79['stack']);if(_0x44ac79['name']){delete _0x44ac79[_0x6ffc('0x1b')];}_0x156655['status'](_0x52fdf1)[_0x6ffc('0x1c')](_0x44ac79);};}exports[_0x6ffc('0x1d')]=function(_0x30f186,_0x4d0770){var _0x21b040={};var _0x517b64={'count':0x0,'rows':[]};var _0x367ce1=_[_0x6ffc('0x1e')](db['ChatQueue'][_0x6ffc('0x1f')],function(_0x115ab8){return{'name':_0x115ab8[_0x6ffc('0x20')],'type':_0x115ab8[_0x6ffc('0x21')][_0x6ffc('0x22')]};});_0x21b040=qs['getOptions'](_0x367ce1,_0x30f186);var _0x167010={'where':_0x21b040[_0x6ffc('0x23')]};return db[_0x6ffc('0x24')]['count'](_0x167010)['then'](function(_0x515ead){_0x517b64[_0x6ffc('0x12')]=_0x515ead;_0x21b040[_0x6ffc('0x25')]=qs['include'](_0x30f186[_0x6ffc('0x26')]);return db[_0x6ffc('0x24')][_0x6ffc('0x27')](_0x21b040);})[_0x6ffc('0x16')](function(_0x177d4c){_0x517b64['rows']=_0x177d4c;return _0x517b64;})[_0x6ffc('0x16')](respondWithFilteredResult(_0x4d0770,_0x21b040))[_0x6ffc('0x28')](handleError(_0x4d0770,null));};exports[_0x6ffc('0x29')]=function(_0x942ab2,_0xb641d2){var _0x3b18b5={'raw':!![],'where':{'id':_0x942ab2[_0x6ffc('0x2a')]['id']}},_0x2c0b46={};_0x2c0b46['model']=_[_0x6ffc('0x2b')](db['ChatQueue'][_0x6ffc('0x1f')]);_0x2c0b46[_0x6ffc('0x26')]=_[_0x6ffc('0x2b')](_0x942ab2[_0x6ffc('0x26')]);_0x2c0b46[_0x6ffc('0x2c')]=_['intersection'](_0x2c0b46['model'],_0x2c0b46[_0x6ffc('0x26')]);_0x3b18b5['attributes']=_[_0x6ffc('0x2d')](_0x2c0b46[_0x6ffc('0x2e')],qs[_0x6ffc('0x2f')](_0x942ab2[_0x6ffc('0x26')]['fields']));_0x3b18b5[_0x6ffc('0x30')]=_0x3b18b5[_0x6ffc('0x30')][_0x6ffc('0x31')]?_0x3b18b5[_0x6ffc('0x30')]:_0x2c0b46[_0x6ffc('0x2e')];if(_0x942ab2[_0x6ffc('0x26')][_0x6ffc('0x32')]){_0x3b18b5[_0x6ffc('0x25')]=[{'all':!![]}];}_0x3b18b5=_[_0x6ffc('0x33')]({},_0x3b18b5,_0x942ab2[_0x6ffc('0x34')]);return db[_0x6ffc('0x24')]['find'](_0x3b18b5)[_0x6ffc('0x16')](handleEntityNotFound(_0xb641d2,null))[_0x6ffc('0x16')](respondWithResult(_0xb641d2,null))[_0x6ffc('0x28')](handleError(_0xb641d2,null));};exports[_0x6ffc('0x35')]=function(_0x46d4ef,_0x962715){return db[_0x6ffc('0x24')][_0x6ffc('0x35')](_0x46d4ef[_0x6ffc('0x36')],{})['then'](function(_0x86aeb2){var _0x5421d9=_0x46d4ef[_0x6ffc('0x37')][_0x6ffc('0x18')]({'plain':!![]});if(!_0x5421d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5421d9[_0x6ffc('0x38')]===_0x6ffc('0x37')){var _0x21df63=_0x86aeb2[_0x6ffc('0x18')]({'plain':!![]});var _0x5ea25d=_0x6ffc('0x39');return db['UserProfileSection']['find']({'where':{'name':_0x5ea25d,'userProfileId':_0x5421d9[_0x6ffc('0x3a')]},'raw':!![]})[_0x6ffc('0x16')](function(_0x5d654e){if(_0x5d654e&&_0x5d654e[_0x6ffc('0x3b')]===0x0){return db[_0x6ffc('0x19')]['create']({'name':_0x21df63[_0x6ffc('0x1b')],'resourceId':_0x21df63['id'],'type':_0x5d654e['name'],'sectionId':_0x5d654e['id']},{})[_0x6ffc('0x16')](function(){return _0x86aeb2;});}else{return _0x86aeb2;}})[_0x6ffc('0x28')](function(_0x5bc9de){logger[_0x6ffc('0x1a')](_0x6ffc('0x3c'),_0x5bc9de);throw _0x5bc9de;});}return _0x86aeb2;})[_0x6ffc('0x16')](respondWithResult(_0x962715,0xc9))[_0x6ffc('0x28')](handleError(_0x962715,null));};exports[_0x6ffc('0x15')]=function(_0x4392c6,_0x37fd7b){if(_0x4392c6['body']['id']){delete _0x4392c6[_0x6ffc('0x36')]['id'];}return db[_0x6ffc('0x24')]['find']({'where':{'id':_0x4392c6[_0x6ffc('0x2a')]['id']}})[_0x6ffc('0x16')](handleEntityNotFound(_0x37fd7b,null))[_0x6ffc('0x16')](saveUpdates(_0x4392c6[_0x6ffc('0x36')],null))[_0x6ffc('0x16')](respondWithResult(_0x37fd7b,null))[_0x6ffc('0x28')](handleError(_0x37fd7b,null));};exports[_0x6ffc('0x17')]=function(_0x15d2ad,_0x22bd15){return db[_0x6ffc('0x24')]['find']({'where':{'id':_0x15d2ad[_0x6ffc('0x2a')]['id']}})[_0x6ffc('0x16')](handleEntityNotFound(_0x22bd15,null))[_0x6ffc('0x16')](removeEntity(_0x22bd15,null))[_0x6ffc('0x28')](handleError(_0x22bd15,null));};exports[_0x6ffc('0x3d')]=function(_0x3a0f90,_0x445d5a){return db['ChatQueue'][_0x6ffc('0x3d')]()[_0x6ffc('0x16')](respondWithResult(_0x445d5a,null))[_0x6ffc('0x28')](handleError(_0x445d5a,null));};exports['getMembers']=function(_0x29bcd3,_0xec8fb5){var _0x36f26e={'raw':!![],'where':{}},_0x3e1bf3={},_0x54896b;return db['ChatQueue']['findOne']({'where':{'id':_0x29bcd3['params']['id']}})[_0x6ffc('0x16')](handleEntityNotFound(_0xec8fb5,null))[_0x6ffc('0x16')](function(_0x7fda96){if(_0x7fda96){_0x54896b=_0x7fda96[_0x6ffc('0x18')]({'plain':!![]});_0x3e1bf3[_0x6ffc('0x2e')]=_[_0x6ffc('0x2b')](db[_0x6ffc('0x3e')][_0x6ffc('0x1f')]);_0x3e1bf3[_0x6ffc('0x26')]=_['keys'](_0x29bcd3[_0x6ffc('0x26')]);_0x3e1bf3['filters']=_[_0x6ffc('0x2d')](_0x3e1bf3[_0x6ffc('0x2e')],_0x3e1bf3['query']);_0x36f26e[_0x6ffc('0x30')]=_[_0x6ffc('0x2d')](_0x3e1bf3[_0x6ffc('0x2e')],qs[_0x6ffc('0x2f')](_0x29bcd3[_0x6ffc('0x26')][_0x6ffc('0x2f')]));_0x36f26e[_0x6ffc('0x30')]=_0x36f26e['attributes'][_0x6ffc('0x31')]?_0x36f26e[_0x6ffc('0x30')]:_0x3e1bf3[_0x6ffc('0x2e')];if(!_0x29bcd3['query'][_0x6ffc('0x3f')](_0x6ffc('0x40'))){_0x36f26e[_0x6ffc('0x11')]=qs[_0x6ffc('0x11')](_0x29bcd3[_0x6ffc('0x26')]['limit']);_0x36f26e[_0x6ffc('0xf')]=qs[_0x6ffc('0xf')](_0x29bcd3[_0x6ffc('0x26')][_0x6ffc('0xf')]);}_0x36f26e['order']=qs[_0x6ffc('0x41')](_0x29bcd3[_0x6ffc('0x26')][_0x6ffc('0x41')]);_0x36f26e[_0x6ffc('0x23')]=qs[_0x6ffc('0x2c')](_[_0x6ffc('0x42')](_0x29bcd3[_0x6ffc('0x26')],_0x3e1bf3['filters']));_0x36f26e[_0x6ffc('0x23')]['ChatQueueId']=_0x7fda96['id'];if(_0x29bcd3[_0x6ffc('0x26')][_0x6ffc('0x43')]){_0x36f26e['where']=_['merge'](_0x36f26e[_0x6ffc('0x23')],{'$or':_[_0x6ffc('0x1e')](_0x36f26e[_0x6ffc('0x30')],function(_0x57563e){var _0x1b608a={};_0x1b608a[_0x57563e]={'$like':'%'+_0x29bcd3['query'][_0x6ffc('0x43')]+'%'};return _0x1b608a;})});}_0x36f26e=_['merge']({},_0x36f26e,_0x29bcd3[_0x6ffc('0x34')]);return db['UserChatQueue'][_0x6ffc('0x27')](_0x36f26e);}})[_0x6ffc('0x16')](function(_0x313b2d){if(_0x313b2d){return db['User'][_0x6ffc('0x44')]({'where':{'id':_[_0x6ffc('0x1e')](_0x313b2d,_0x6ffc('0x45')),'role':_0x6ffc('0x46')},'attributes':['id',_0x6ffc('0x1b'),_0x6ffc('0x47'),'updatedAt',_0x6ffc('0x48')]});}})[_0x6ffc('0x16')](function(_0x5c2428){if(_0x5c2428){return{'count':_0x5c2428[_0x6ffc('0x12')],'rows':_['map'](_0x5c2428[_0x6ffc('0x49')],function(_0x22915a){return{'membername':_0x22915a[_0x6ffc('0x1b')],'UserId':_0x22915a['id'],'queue_name':_0x54896b[_0x6ffc('0x1b')],'ChatQueueId':_0x54896b['id'],'interface':util[_0x6ffc('0x4a')](_0x6ffc('0x4b'),_0x6ffc('0x4c'),_0x22915a[_0x6ffc('0x1b')]),'penalty':0x0,'paused':_0x22915a['chatPause'],'createdAt':_0x22915a['createdAt'],'updatedAt':_0x22915a[_0x6ffc('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6ffc('0x16')](respondWithFilteredResult(_0xec8fb5,_0x36f26e))[_0x6ffc('0x28')](handleError(_0xec8fb5,null));};exports['getTeams']=function(_0x37c280,_0x8af22f){var _0x313cf5={};var _0x152444={};var _0x3dc2e1;var _0x1efe6d;return db['ChatQueue']['findOne']({'where':{'id':_0x37c280[_0x6ffc('0x2a')]['id']}})[_0x6ffc('0x16')](handleEntityNotFound(_0x8af22f,null))[_0x6ffc('0x16')](function(_0x252ee7){if(_0x252ee7){_0x3dc2e1=_0x252ee7;_0x152444['model']=_[_0x6ffc('0x2b')](db[_0x6ffc('0x4e')]['rawAttributes']);_0x152444['query']=_[_0x6ffc('0x2b')](_0x37c280[_0x6ffc('0x26')]);_0x152444['filters']=_[_0x6ffc('0x2d')](_0x152444[_0x6ffc('0x2e')],_0x152444[_0x6ffc('0x26')]);_0x313cf5[_0x6ffc('0x30')]=_['intersection'](_0x152444[_0x6ffc('0x2e')],qs[_0x6ffc('0x2f')](_0x37c280[_0x6ffc('0x26')][_0x6ffc('0x2f')]));_0x313cf5[_0x6ffc('0x30')]=_0x313cf5[_0x6ffc('0x30')][_0x6ffc('0x31')]?_0x313cf5['attributes']:_0x152444['model'];_0x313cf5[_0x6ffc('0x4f')]=qs[_0x6ffc('0x41')](_0x37c280[_0x6ffc('0x26')]['sort']);_0x313cf5['where']=qs[_0x6ffc('0x2c')](_['pick'](_0x37c280[_0x6ffc('0x26')],_0x152444[_0x6ffc('0x2c')]));if(_0x37c280[_0x6ffc('0x26')][_0x6ffc('0x43')]){_0x313cf5['where']=_[_0x6ffc('0x33')](_0x313cf5[_0x6ffc('0x23')],{'$or':_[_0x6ffc('0x1e')](_0x313cf5[_0x6ffc('0x30')],function(_0x47a115){var _0x142fbe={};_0x142fbe[_0x47a115]={'$like':'%'+_0x37c280[_0x6ffc('0x26')][_0x6ffc('0x43')]+'%'};return _0x142fbe;})});}_0x313cf5=_[_0x6ffc('0x33')]({},_0x313cf5,_0x37c280[_0x6ffc('0x34')]);return _0x3dc2e1[_0x6ffc('0x50')](_0x313cf5);}})[_0x6ffc('0x16')](function(_0x3d78c3){if(_0x3d78c3){_0x1efe6d=_0x3d78c3['length'];if(!_0x37c280['query']['hasOwnProperty'](_0x6ffc('0x40'))){_0x313cf5['limit']=qs[_0x6ffc('0x11')](_0x37c280['query']['limit']);_0x313cf5[_0x6ffc('0xf')]=qs[_0x6ffc('0xf')](_0x37c280[_0x6ffc('0x26')][_0x6ffc('0xf')]);}return _0x3dc2e1[_0x6ffc('0x50')](_0x313cf5);}})[_0x6ffc('0x16')](function(_0x53a2bf){if(_0x53a2bf){return _0x53a2bf?{'count':_0x1efe6d,'rows':_0x53a2bf}:null;}})[_0x6ffc('0x16')](respondWithResult(_0x8af22f,null))[_0x6ffc('0x28')](handleError(_0x8af22f,null));};exports['addTeams']=function(_0x3730fe,_0x486215){var _0x47e0df=_0x3730fe['body'][_0x6ffc('0x51')];return db[_0x6ffc('0x4e')][_0x6ffc('0x27')]({'where':{'id':_0x47e0df},'attributes':['id'],'include':[{'model':db[_0x6ffc('0x52')],'as':'Agents','attributes':['id',_0x6ffc('0x1b'),'online',_0x6ffc('0x53'),_0x6ffc('0x54')],'raw':!![]}]})['then'](function(_0x5776d9){if(_0x5776d9){var _0x440489=_['flatMap'](_0x5776d9,function(_0xefb4c6){var _0x327bd9=_0xefb4c6[_0x6ffc('0x18')]({'plain':!![]});return _0x327bd9[_0x6ffc('0x55')];});return db[_0x6ffc('0x24')][_0x6ffc('0x56')]({'where':{'id':_0x3730fe[_0x6ffc('0x2a')]['id']}})['then'](function(_0x30a9be){return db[_0x6ffc('0x57')][_0x6ffc('0x58')](function(_0x2b201a){return _0x30a9be[_0x6ffc('0x59')](_0x47e0df,{'transaction':_0x2b201a})[_0x6ffc('0x16')](function(){return BPromise[_0x6ffc('0x5a')](_0x440489,function(_0x23ac96){return db[_0x6ffc('0x3e')][_0x6ffc('0x5b')]({'where':{'UserId':_0x23ac96['id'],'ChatQueueId':_0x3730fe[_0x6ffc('0x2a')]['id']},'transaction':_0x2b201a});});})['then'](function(){_0x440489[_0x6ffc('0x5c')](function(_0xeb6b15){socket[_0x6ffc('0x5d')](_0x6ffc('0x5e'),{'UserId':_0xeb6b15['id'],'ChatQueueId':_0x30a9be['id']});});});});});}})[_0x6ffc('0x16')](respondWithStatusCode(_0x486215,null))[_0x6ffc('0x28')](handleError(_0x486215,null));};exports[_0x6ffc('0x5f')]=function(_0x29654a,_0x3c61df){return db[_0x6ffc('0x4e')][_0x6ffc('0x27')]({'where':{'id':_0x29654a[_0x6ffc('0x26')][_0x6ffc('0x51')]},'attributes':['id'],'include':[{'model':db[_0x6ffc('0x52')],'as':_0x6ffc('0x55'),'attributes':['id'],'raw':!![]}]})[_0x6ffc('0x16')](handleEntityNotFound(_0x3c61df,null))['then'](function(_0x27751f){var _0x4c01fc=_[_0x6ffc('0x1e')](_0x27751f,'id');var _0x3fdae9=[];var _0x4c2095=[];var _0x195463=squel['select']();_0x195463[_0x6ffc('0x60')](_0x6ffc('0x61'))['from'](_0x6ffc('0x62'),'tq')['join'](_0x6ffc('0x63'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x6ffc('0x64'),_0x29654a['params']['id']);for(var _0x9f6a49=0x0;_0x9f6a49<_0x27751f[_0x6ffc('0x31')];_0x9f6a49+=0x1){let _0x3c680d=_0x27751f[_0x9f6a49];for(var _0x247458=0x0;_0x247458<_0x3c680d[_0x6ffc('0x55')][_0x6ffc('0x31')];_0x247458+=0x1){let _0x3c9de3=_0x3c680d['Agents'][_0x247458];var _0x45b91c=_0x195463['clone']();_0x45b91c[_0x6ffc('0x23')](_0x6ffc('0x65'),_0x3c9de3['id']);_0x4c2095[_0x6ffc('0x66')](db[_0x6ffc('0x57')][_0x6ffc('0x26')](_0x45b91c['toString'](),{'type':db[_0x6ffc('0x57')][_0x6ffc('0x67')][_0x6ffc('0x68')]})[_0x6ffc('0x16')](function(_0x4f0b9b){if(_0x4f0b9b[_0x6ffc('0x31')]===0x1){return _0x3c9de3['id'];}else{var _0x1ef497=_['every'](_['map'](_0x4f0b9b,_0x6ffc('0x69')),function(_0x12dc00){return _[_0x6ffc('0x6a')](_0x4c01fc,_0x12dc00);});if(_0x1ef497){return _0x3c9de3['id'];}}}));}}return BPromise[_0x6ffc('0x6b')](_0x4c2095)[_0x6ffc('0x16')](function(_0x335b03){_0x3fdae9=_(_0x3fdae9)['union'](_0x335b03)['compact']()[_0x6ffc('0x6c')]();return db[_0x6ffc('0x24')][_0x6ffc('0x56')]({'where':{'id':_0x29654a['params']['id']}})[_0x6ffc('0x16')](function(_0x1573d3){return db['sequelize']['transaction'](function(_0x355953){return _0x1573d3[_0x6ffc('0x5f')](_0x29654a[_0x6ffc('0x26')][_0x6ffc('0x51')],{'transaction':_0x355953})[_0x6ffc('0x16')](function(){if(!_[_0x6ffc('0x6d')](_0x3fdae9)){return _0x1573d3[_0x6ffc('0x6e')](_0x3fdae9,{'transaction':_0x355953});}})[_0x6ffc('0x16')](function(){_0x3fdae9[_0x6ffc('0x5c')](function(_0x3cb283){socket[_0x6ffc('0x5d')](_0x6ffc('0x6f'),{'UserId':_0x3cb283,'ChatQueueId':_0x1573d3['id']});});});});});});})[_0x6ffc('0x16')](respondWithStatusCode(_0x3c61df,null))[_0x6ffc('0x28')](handleError(_0x3c61df,null));};exports[_0x6ffc('0x70')]=function(_0x30ef9e,_0xa965e0){return db[_0x6ffc('0x24')][_0x6ffc('0x56')]({'where':{'id':_0x30ef9e['params']['id']}})['then'](handleEntityNotFound(_0xa965e0,null))[_0x6ffc('0x16')](function(_0x4e2d25){if(_0x4e2d25){return _0x4e2d25[_0x6ffc('0x70')](_0x30ef9e[_0x6ffc('0x36')][_0x6ffc('0x51')],_[_0x6ffc('0x71')](_0x30ef9e['body'],['ids','id'])||{})[_0x6ffc('0x72')](function(_0x49d5a7){for(var _0x14a24a=0x0;_0x14a24a<_0x30ef9e[_0x6ffc('0x36')][_0x6ffc('0x51')][_0x6ffc('0x31')];_0x14a24a+=0x1){socket[_0x6ffc('0x5d')](_0x6ffc('0x5e'),{'UserId':Number(_0x30ef9e['body'][_0x6ffc('0x51')][_0x14a24a]),'ChatQueueId':Number(_0x30ef9e[_0x6ffc('0x2a')]['id'])});}return _0x49d5a7;});}})[_0x6ffc('0x16')](respondWithResult(_0xa965e0,null))['catch'](handleError(_0xa965e0,null));};exports[_0x6ffc('0x6e')]=function(_0x59727e,_0x4cfabf){return db[_0x6ffc('0x24')][_0x6ffc('0x56')]({'where':{'id':_0x59727e[_0x6ffc('0x2a')]['id']}})[_0x6ffc('0x16')](handleEntityNotFound(_0x4cfabf,null))[_0x6ffc('0x16')](function(_0xc3b0fa){if(_0xc3b0fa){return _0xc3b0fa[_0x6ffc('0x6e')](_0x59727e['query'][_0x6ffc('0x51')])[_0x6ffc('0x16')](function(){if(_[_0x6ffc('0x73')](_0x59727e[_0x6ffc('0x26')]['ids'])){for(var _0x5634a0=0x0;_0x5634a0<_0x59727e[_0x6ffc('0x26')][_0x6ffc('0x51')][_0x6ffc('0x31')];_0x5634a0+=0x1){socket[_0x6ffc('0x5d')](_0x6ffc('0x6f'),{'UserId':Number(_0x59727e[_0x6ffc('0x26')][_0x6ffc('0x51')][_0x5634a0]),'ChatQueueId':Number(_0x59727e[_0x6ffc('0x2a')]['id'])});}}else{socket[_0x6ffc('0x5d')]('userChatQueue:remove',{'UserId':Number(_0x59727e[_0x6ffc('0x26')][_0x6ffc('0x51')]),'ChatQueueId':Number(_0x59727e[_0x6ffc('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x4cfabf,null))[_0x6ffc('0x28')](handleError(_0x4cfabf,null));};exports['getAgents']=function(_0x2c7f5c,_0x389c39){var _0xeb4681={};var _0x31e9f3={};var _0x18373b;var _0xa9d16c;return db[_0x6ffc('0x24')][_0x6ffc('0x74')]({'where':{'id':_0x2c7f5c[_0x6ffc('0x2a')]['id']}})[_0x6ffc('0x16')](handleEntityNotFound(_0x389c39,null))['then'](function(_0x4bfe33){if(_0x4bfe33){_0x18373b=_0x4bfe33;_0x31e9f3['model']=_[_0x6ffc('0x2b')](db['User'][_0x6ffc('0x1f')]);_0x31e9f3[_0x6ffc('0x26')]=_[_0x6ffc('0x2b')](_0x2c7f5c[_0x6ffc('0x26')]);_0x31e9f3[_0x6ffc('0x2c')]=_[_0x6ffc('0x2d')](_0x31e9f3[_0x6ffc('0x2e')],_0x31e9f3[_0x6ffc('0x26')]);_0xeb4681[_0x6ffc('0x30')]=_['intersection'](_0x31e9f3['model'],qs[_0x6ffc('0x2f')](_0x2c7f5c[_0x6ffc('0x26')][_0x6ffc('0x2f')]));_0xeb4681[_0x6ffc('0x30')]=_0xeb4681[_0x6ffc('0x30')][_0x6ffc('0x31')]?_0xeb4681['attributes']:_0x31e9f3[_0x6ffc('0x2e')];_0xeb4681[_0x6ffc('0x4f')]=qs[_0x6ffc('0x41')](_0x2c7f5c[_0x6ffc('0x26')][_0x6ffc('0x41')]);_0xeb4681[_0x6ffc('0x23')]=qs[_0x6ffc('0x2c')](_[_0x6ffc('0x42')](_0x2c7f5c[_0x6ffc('0x26')],_0x31e9f3[_0x6ffc('0x2c')]));if(_0x2c7f5c['query']['filter']){_0xeb4681[_0x6ffc('0x23')]=_[_0x6ffc('0x33')](_0xeb4681['where'],{'$or':_['map'](_0xeb4681[_0x6ffc('0x30')],function(_0x48062b){var _0x44de17={};_0x44de17[_0x48062b]={'$like':'%'+_0x2c7f5c[_0x6ffc('0x26')][_0x6ffc('0x43')]+'%'};return _0x44de17;})});}_0xeb4681=_[_0x6ffc('0x33')]({},_0xeb4681,_0x2c7f5c['options']);return _0x18373b[_0x6ffc('0x75')](_0xeb4681);}})['then'](function(_0x1f677d){if(_0x1f677d){_0xa9d16c=_0x1f677d[_0x6ffc('0x31')];if(!_0x2c7f5c['query']['hasOwnProperty'](_0x6ffc('0x40'))){_0xeb4681[_0x6ffc('0x11')]=qs[_0x6ffc('0x11')](_0x2c7f5c[_0x6ffc('0x26')]['limit']);_0xeb4681[_0x6ffc('0xf')]=qs[_0x6ffc('0xf')](_0x2c7f5c['query'][_0x6ffc('0xf')]);}return _0x18373b['getAgents'](_0xeb4681);}})[_0x6ffc('0x16')](function(_0x17a0e9){if(_0x17a0e9){return _0x17a0e9?{'count':_0xa9d16c,'rows':_0x17a0e9}:null;}})[_0x6ffc('0x16')](respondWithResult(_0x389c39,null))[_0x6ffc('0x28')](handleError(_0x389c39,null));};
\ No newline at end of file
+var _0x271c=['where','include','query','findAll','rows','catch','show','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','find','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','limit','sort','ChatQueueId','filter','findAndCountAll','UserId','agent','format','%s/%s','SIP','chatPause','createdAt','updatedAt','Team','order','pick','getTeams','addTeams','User','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','ids','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','undefined','count','offset','set','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','getOptions'];(function(_0x261e36,_0x1d284f){var _0x40f5a5=function(_0xb53476){while(--_0xb53476){_0x261e36['push'](_0x261e36['shift']());}};_0x40f5a5(++_0x1d284f);}(_0x271c,0x156));var _0xc271=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x271c[_0x4565bf];return _0x5610ba;};'use strict';var BPromise=require(_0xc271('0x0'));var util=require(_0xc271('0x1'));var _=require('lodash');var squel=require(_0xc271('0x2'));var Redis=require(_0xc271('0x3'));var qs=require(_0xc271('0x4'));var logger=require(_0xc271('0x5'))('api');var config=require(_0xc271('0x6'));var db=require(_0xc271('0x7'))['db'];config[_0xc271('0x8')]=_['defaults'](config['redis'],{'host':_0xc271('0x9'),'port':0x18eb});var socket=require(_0xc271('0xa'))(new Redis(config[_0xc271('0x8')]));require(_0xc271('0xb'))[_0xc271('0xc')](socket);function respondWithStatusCode(_0x2b6169,_0x26102f){_0x26102f=_0x26102f||0xcc;return function(_0x5607b7){if(_0x5607b7){return _0x2b6169[_0xc271('0xd')](_0x26102f);}return _0x2b6169[_0xc271('0xe')](_0x26102f)[_0xc271('0xf')]();};}function respondWithResult(_0x5b79e3,_0x11d837){_0x11d837=_0x11d837||0xc8;return function(_0x10202c){if(_0x10202c){return _0x5b79e3[_0xc271('0xe')](_0x11d837)['json'](_0x10202c);}};}function respondWithFilteredResult(_0x36757b,_0x11d740){return function(_0x19d609){if(_0x19d609){var _0x4c1414=typeof _0x11d740['offset']===_0xc271('0x10')&&typeof _0x11d740['limit']===_0xc271('0x10');var _0x445c84=_0x19d609[_0xc271('0x11')];var _0x163fcc=_0x4c1414?0x0:_0x11d740['offset'];var _0x763f52=_0x4c1414?_0x19d609[_0xc271('0x11')]:_0x11d740[_0xc271('0x12')]+_0x11d740['limit'];var _0x54cab9;if(_0x763f52>=_0x445c84){_0x763f52=_0x445c84;_0x54cab9=0xc8;}else{_0x54cab9=0xce;}_0x36757b[_0xc271('0xe')](_0x54cab9);return _0x36757b[_0xc271('0x13')]('Content-Range',_0x163fcc+'-'+_0x763f52+'/'+_0x445c84)['json'](_0x19d609);}return null;};}function saveUpdates(_0x5c48d6){return function(_0x210a11){if(_0x210a11){return _0x210a11['update'](_0x5c48d6)[_0xc271('0x14')](function(_0x3f890f){return _0x3f890f;});}return null;};}function removeEntity(_0x40deec){return function(_0x3a8691){if(_0x3a8691){return _0x3a8691[_0xc271('0x15')]()[_0xc271('0x14')](function(){var _0x1132ee=_0x3a8691[_0xc271('0x16')]({'plain':!![]});var _0x48c591=_0xc271('0x17');return db[_0xc271('0x18')][_0xc271('0x15')]({'where':{'type':_0x48c591,'resourceId':_0x1132ee['id']}})[_0xc271('0x14')](function(){return _0x3a8691;});})[_0xc271('0x14')](function(){_0x40deec[_0xc271('0xe')](0xcc)[_0xc271('0xf')]();});}};}function handleEntityNotFound(_0x3909e8){return function(_0x5249f8){if(!_0x5249f8){_0x3909e8['sendStatus'](0x194);}return _0x5249f8;};}function handleError(_0x5c7d0b,_0x21254f){_0x21254f=_0x21254f||0x1f4;return function(_0x4e7320){logger[_0xc271('0x19')](_0x4e7320[_0xc271('0x1a')]);if(_0x4e7320[_0xc271('0x1b')]){delete _0x4e7320[_0xc271('0x1b')];}_0x5c7d0b['status'](_0x21254f)[_0xc271('0x1c')](_0x4e7320);};}exports[_0xc271('0x1d')]=function(_0x347c16,_0xbd806e){var _0x116bf1={};var _0x12048b={'count':0x0,'rows':[]};var _0x34bccc=_[_0xc271('0x1e')](db[_0xc271('0x1f')][_0xc271('0x20')],function(_0x356254){return{'name':_0x356254[_0xc271('0x21')],'type':_0x356254['type'][_0xc271('0x22')]};});_0x116bf1=qs[_0xc271('0x23')](_0x34bccc,_0x347c16);var _0x2bc7cc={'where':_0x116bf1[_0xc271('0x24')]};return db[_0xc271('0x1f')][_0xc271('0x11')](_0x2bc7cc)[_0xc271('0x14')](function(_0x44800a){_0x12048b[_0xc271('0x11')]=_0x44800a;_0x116bf1[_0xc271('0x25')]=qs['include'](_0x347c16[_0xc271('0x26')]);return db[_0xc271('0x1f')][_0xc271('0x27')](_0x116bf1);})['then'](function(_0x43aec7){_0x12048b[_0xc271('0x28')]=_0x43aec7;return _0x12048b;})[_0xc271('0x14')](respondWithFilteredResult(_0xbd806e,_0x116bf1))[_0xc271('0x29')](handleError(_0xbd806e,null));};exports[_0xc271('0x2a')]=function(_0x4f1140,_0x41501f){var _0x531d6f={'raw':!![],'where':{'id':_0x4f1140['params']['id']}},_0x5b3c9c={};_0x5b3c9c[_0xc271('0x2b')]=_['keys'](db[_0xc271('0x1f')]['rawAttributes']);_0x5b3c9c[_0xc271('0x26')]=_[_0xc271('0x2c')](_0x4f1140['query']);_0x5b3c9c[_0xc271('0x2d')]=_['intersection'](_0x5b3c9c[_0xc271('0x2b')],_0x5b3c9c[_0xc271('0x26')]);_0x531d6f['attributes']=_[_0xc271('0x2e')](_0x5b3c9c['model'],qs['fields'](_0x4f1140[_0xc271('0x26')][_0xc271('0x2f')]));_0x531d6f[_0xc271('0x30')]=_0x531d6f[_0xc271('0x30')][_0xc271('0x31')]?_0x531d6f[_0xc271('0x30')]:_0x5b3c9c[_0xc271('0x2b')];if(_0x4f1140[_0xc271('0x26')][_0xc271('0x32')]){_0x531d6f[_0xc271('0x25')]=[{'all':!![]}];}_0x531d6f=_[_0xc271('0x33')]({},_0x531d6f,_0x4f1140[_0xc271('0x34')]);return db[_0xc271('0x1f')][_0xc271('0x35')](_0x531d6f)['then'](handleEntityNotFound(_0x41501f,null))[_0xc271('0x14')](respondWithResult(_0x41501f,null))[_0xc271('0x29')](handleError(_0x41501f,null));};exports[_0xc271('0x36')]=function(_0x1f4dd2,_0xf3c77d){return db[_0xc271('0x1f')][_0xc271('0x36')](_0x1f4dd2[_0xc271('0x37')],{})[_0xc271('0x14')](function(_0x2b9fba){var _0x1e052=_0x1f4dd2[_0xc271('0x38')][_0xc271('0x16')]({'plain':!![]});if(!_0x1e052)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e052['role']===_0xc271('0x38')){var _0x3f79c2=_0x2b9fba['get']({'plain':!![]});var _0x482ea8='ChatQueues';return db[_0xc271('0x39')][_0xc271('0x35')]({'where':{'name':_0x482ea8,'userProfileId':_0x1e052['userProfileId']},'raw':!![]})[_0xc271('0x14')](function(_0x2cbc59){if(_0x2cbc59&&_0x2cbc59[_0xc271('0x3a')]===0x0){return db[_0xc271('0x18')][_0xc271('0x36')]({'name':_0x3f79c2['name'],'resourceId':_0x3f79c2['id'],'type':_0x2cbc59[_0xc271('0x1b')],'sectionId':_0x2cbc59['id']},{})[_0xc271('0x14')](function(){return _0x2b9fba;});}else{return _0x2b9fba;}})[_0xc271('0x29')](function(_0x224fb4){logger[_0xc271('0x19')](_0xc271('0x3b'),_0x224fb4);throw _0x224fb4;});}return _0x2b9fba;})[_0xc271('0x14')](respondWithResult(_0xf3c77d,0xc9))[_0xc271('0x29')](handleError(_0xf3c77d,null));};exports[_0xc271('0x3c')]=function(_0x48fce3,_0x227b9e){if(_0x48fce3[_0xc271('0x37')]['id']){delete _0x48fce3[_0xc271('0x37')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x48fce3[_0xc271('0x3d')]['id']}})[_0xc271('0x14')](handleEntityNotFound(_0x227b9e,null))[_0xc271('0x14')](saveUpdates(_0x48fce3[_0xc271('0x37')],null))[_0xc271('0x14')](respondWithResult(_0x227b9e,null))[_0xc271('0x29')](handleError(_0x227b9e,null));};exports[_0xc271('0x15')]=function(_0x186cd8,_0x5f1171){return db[_0xc271('0x1f')]['find']({'where':{'id':_0x186cd8['params']['id']}})[_0xc271('0x14')](handleEntityNotFound(_0x5f1171,null))[_0xc271('0x14')](removeEntity(_0x5f1171,null))['catch'](handleError(_0x5f1171,null));};exports[_0xc271('0x3e')]=function(_0x2affa8,_0x43233c){return db[_0xc271('0x1f')][_0xc271('0x3e')]()[_0xc271('0x14')](respondWithResult(_0x43233c,null))[_0xc271('0x29')](handleError(_0x43233c,null));};exports[_0xc271('0x3f')]=function(_0x51d3ac,_0x2c5c96){var _0x320db3={'raw':!![],'where':{}},_0x5898f5={},_0x3cc029;return db['ChatQueue'][_0xc271('0x40')]({'where':{'id':_0x51d3ac[_0xc271('0x3d')]['id']}})[_0xc271('0x14')](handleEntityNotFound(_0x2c5c96,null))[_0xc271('0x14')](function(_0x146e33){if(_0x146e33){_0x3cc029=_0x146e33['get']({'plain':!![]});_0x5898f5[_0xc271('0x2b')]=_[_0xc271('0x2c')](db[_0xc271('0x41')][_0xc271('0x20')]);_0x5898f5[_0xc271('0x26')]=_[_0xc271('0x2c')](_0x51d3ac['query']);_0x5898f5[_0xc271('0x2d')]=_['intersection'](_0x5898f5[_0xc271('0x2b')],_0x5898f5['query']);_0x320db3['attributes']=_[_0xc271('0x2e')](_0x5898f5[_0xc271('0x2b')],qs[_0xc271('0x2f')](_0x51d3ac[_0xc271('0x26')]['fields']));_0x320db3['attributes']=_0x320db3[_0xc271('0x30')]['length']?_0x320db3[_0xc271('0x30')]:_0x5898f5['model'];if(!_0x51d3ac[_0xc271('0x26')][_0xc271('0x42')](_0xc271('0x43'))){_0x320db3[_0xc271('0x44')]=qs[_0xc271('0x44')](_0x51d3ac[_0xc271('0x26')]['limit']);_0x320db3[_0xc271('0x12')]=qs[_0xc271('0x12')](_0x51d3ac[_0xc271('0x26')][_0xc271('0x12')]);}_0x320db3['order']=qs['sort'](_0x51d3ac[_0xc271('0x26')][_0xc271('0x45')]);_0x320db3[_0xc271('0x24')]=qs[_0xc271('0x2d')](_['pick'](_0x51d3ac['query'],_0x5898f5[_0xc271('0x2d')]));_0x320db3[_0xc271('0x24')][_0xc271('0x46')]=_0x146e33['id'];if(_0x51d3ac[_0xc271('0x26')][_0xc271('0x47')]){_0x320db3[_0xc271('0x24')]=_[_0xc271('0x33')](_0x320db3[_0xc271('0x24')],{'$or':_[_0xc271('0x1e')](_0x320db3[_0xc271('0x30')],function(_0xfa84b8){var _0x508b2f={};_0x508b2f[_0xfa84b8]={'$like':'%'+_0x51d3ac[_0xc271('0x26')][_0xc271('0x47')]+'%'};return _0x508b2f;})});}_0x320db3=_[_0xc271('0x33')]({},_0x320db3,_0x51d3ac[_0xc271('0x34')]);return db[_0xc271('0x41')]['findAll'](_0x320db3);}})['then'](function(_0xf8987e){if(_0xf8987e){return db['User'][_0xc271('0x48')]({'where':{'id':_[_0xc271('0x1e')](_0xf8987e,_0xc271('0x49')),'role':_0xc271('0x4a')},'attributes':['id',_0xc271('0x1b'),'chatPause','updatedAt','createdAt']});}})[_0xc271('0x14')](function(_0x61ed2f){if(_0x61ed2f){return{'count':_0x61ed2f[_0xc271('0x11')],'rows':_[_0xc271('0x1e')](_0x61ed2f['rows'],function(_0x2536d8){return{'membername':_0x2536d8['name'],'UserId':_0x2536d8['id'],'queue_name':_0x3cc029[_0xc271('0x1b')],'ChatQueueId':_0x3cc029['id'],'interface':util[_0xc271('0x4b')](_0xc271('0x4c'),_0xc271('0x4d'),_0x2536d8[_0xc271('0x1b')]),'penalty':0x0,'paused':_0x2536d8[_0xc271('0x4e')],'createdAt':_0x2536d8[_0xc271('0x4f')],'updatedAt':_0x2536d8[_0xc271('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc271('0x14')](respondWithFilteredResult(_0x2c5c96,_0x320db3))[_0xc271('0x29')](handleError(_0x2c5c96,null));};exports['getTeams']=function(_0x16ce6a,_0x4a02e2){var _0x208efe={};var _0x44519f={};var _0x351333;var _0x128291;return db[_0xc271('0x1f')]['findOne']({'where':{'id':_0x16ce6a[_0xc271('0x3d')]['id']}})[_0xc271('0x14')](handleEntityNotFound(_0x4a02e2,null))[_0xc271('0x14')](function(_0x3aa4d8){if(_0x3aa4d8){_0x351333=_0x3aa4d8;_0x44519f[_0xc271('0x2b')]=_[_0xc271('0x2c')](db[_0xc271('0x51')][_0xc271('0x20')]);_0x44519f[_0xc271('0x26')]=_[_0xc271('0x2c')](_0x16ce6a[_0xc271('0x26')]);_0x44519f['filters']=_[_0xc271('0x2e')](_0x44519f[_0xc271('0x2b')],_0x44519f[_0xc271('0x26')]);_0x208efe[_0xc271('0x30')]=_[_0xc271('0x2e')](_0x44519f[_0xc271('0x2b')],qs[_0xc271('0x2f')](_0x16ce6a['query'][_0xc271('0x2f')]));_0x208efe[_0xc271('0x30')]=_0x208efe['attributes'][_0xc271('0x31')]?_0x208efe[_0xc271('0x30')]:_0x44519f[_0xc271('0x2b')];_0x208efe[_0xc271('0x52')]=qs[_0xc271('0x45')](_0x16ce6a[_0xc271('0x26')][_0xc271('0x45')]);_0x208efe['where']=qs[_0xc271('0x2d')](_[_0xc271('0x53')](_0x16ce6a[_0xc271('0x26')],_0x44519f[_0xc271('0x2d')]));if(_0x16ce6a['query'][_0xc271('0x47')]){_0x208efe['where']=_['merge'](_0x208efe[_0xc271('0x24')],{'$or':_[_0xc271('0x1e')](_0x208efe[_0xc271('0x30')],function(_0x5ef708){var _0x1bf4d7={};_0x1bf4d7[_0x5ef708]={'$like':'%'+_0x16ce6a[_0xc271('0x26')][_0xc271('0x47')]+'%'};return _0x1bf4d7;})});}_0x208efe=_['merge']({},_0x208efe,_0x16ce6a['options']);return _0x351333[_0xc271('0x54')](_0x208efe);}})[_0xc271('0x14')](function(_0x387e8b){if(_0x387e8b){_0x128291=_0x387e8b[_0xc271('0x31')];if(!_0x16ce6a[_0xc271('0x26')][_0xc271('0x42')](_0xc271('0x43'))){_0x208efe[_0xc271('0x44')]=qs[_0xc271('0x44')](_0x16ce6a[_0xc271('0x26')][_0xc271('0x44')]);_0x208efe['offset']=qs[_0xc271('0x12')](_0x16ce6a[_0xc271('0x26')]['offset']);}return _0x351333['getTeams'](_0x208efe);}})[_0xc271('0x14')](function(_0x28a5fa){if(_0x28a5fa){return _0x28a5fa?{'count':_0x128291,'rows':_0x28a5fa}:null;}})[_0xc271('0x14')](respondWithResult(_0x4a02e2,null))[_0xc271('0x29')](handleError(_0x4a02e2,null));};exports[_0xc271('0x55')]=function(_0x15c561,_0x55394c){var _0x2c9e8b=_0x15c561[_0xc271('0x37')]['ids'];return db[_0xc271('0x51')]['findAll']({'where':{'id':_0x2c9e8b},'attributes':['id'],'include':[{'model':db[_0xc271('0x56')],'as':_0xc271('0x57'),'attributes':['id',_0xc271('0x1b'),_0xc271('0x58'),_0xc271('0x59'),_0xc271('0x5a')],'raw':!![]}]})[_0xc271('0x14')](function(_0x1440f2){if(_0x1440f2){var _0x18fa0d=_[_0xc271('0x5b')](_0x1440f2,function(_0x345b16){var _0x3d980c=_0x345b16['get']({'plain':!![]});return _0x3d980c[_0xc271('0x57')];});return db[_0xc271('0x1f')]['find']({'where':{'id':_0x15c561[_0xc271('0x3d')]['id']}})[_0xc271('0x14')](function(_0x19b19a){return db['sequelize'][_0xc271('0x5c')](function(_0x119d6b){return _0x19b19a[_0xc271('0x55')](_0x2c9e8b,{'transaction':_0x119d6b})[_0xc271('0x14')](function(){return BPromise[_0xc271('0x5d')](_0x18fa0d,function(_0x345075){return db[_0xc271('0x41')][_0xc271('0x5e')]({'where':{'UserId':_0x345075['id'],'ChatQueueId':_0x15c561['params']['id']},'transaction':_0x119d6b});});})[_0xc271('0x14')](function(){_0x18fa0d[_0xc271('0x5f')](function(_0x2c8726){socket['emit']('userChatQueue:save',{'UserId':_0x2c8726['id'],'ChatQueueId':_0x19b19a['id']});});});});});}})[_0xc271('0x14')](respondWithStatusCode(_0x55394c,null))[_0xc271('0x29')](handleError(_0x55394c,null));};exports['removeTeams']=function(_0x1da0c6,_0xe297a5){return db['Team'][_0xc271('0x27')]({'where':{'id':_0x1da0c6['query'][_0xc271('0x60')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc271('0x57'),'attributes':['id'],'raw':!![]}]})[_0xc271('0x14')](handleEntityNotFound(_0xe297a5,null))[_0xc271('0x14')](function(_0x3d9476){var _0x2d9be8=_['map'](_0x3d9476,'id');var _0x3f5575=[];var _0x3e2c39=[];var _0x22c1e8=squel[_0xc271('0x61')]();_0x22c1e8[_0xc271('0x62')](_0xc271('0x63'))[_0xc271('0x64')](_0xc271('0x65'),'tq')['join'](_0xc271('0x66'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc271('0x24')](_0xc271('0x67'),_0x1da0c6[_0xc271('0x3d')]['id']);for(var _0xe9989c=0x0;_0xe9989c<_0x3d9476[_0xc271('0x31')];_0xe9989c+=0x1){let _0x12257d=_0x3d9476[_0xe9989c];for(var _0x2f91e4=0x0;_0x2f91e4<_0x12257d['Agents'][_0xc271('0x31')];_0x2f91e4+=0x1){let _0x2f03c9=_0x12257d['Agents'][_0x2f91e4];var _0x1d41c8=_0x22c1e8[_0xc271('0x68')]();_0x1d41c8['where'](_0xc271('0x69'),_0x2f03c9['id']);_0x3e2c39['push'](db['sequelize'][_0xc271('0x26')](_0x1d41c8['toString'](),{'type':db[_0xc271('0x6a')][_0xc271('0x6b')][_0xc271('0x6c')]})[_0xc271('0x14')](function(_0x27c378){if(_0x27c378['length']===0x1){return _0x2f03c9['id'];}else{var _0x13aa51=_[_0xc271('0x6d')](_['map'](_0x27c378,_0xc271('0x6e')),function(_0x1fee1e){return _[_0xc271('0x6f')](_0x2d9be8,_0x1fee1e);});if(_0x13aa51){return _0x2f03c9['id'];}}}));}}return BPromise[_0xc271('0x70')](_0x3e2c39)[_0xc271('0x14')](function(_0x362ee3){_0x3f5575=_(_0x3f5575)[_0xc271('0x71')](_0x362ee3)['compact']()[_0xc271('0x72')]();return db[_0xc271('0x1f')][_0xc271('0x35')]({'where':{'id':_0x1da0c6[_0xc271('0x3d')]['id']}})[_0xc271('0x14')](function(_0x4a7dd3){return db['sequelize'][_0xc271('0x5c')](function(_0xa8332f){return _0x4a7dd3[_0xc271('0x73')](_0x1da0c6[_0xc271('0x26')][_0xc271('0x60')],{'transaction':_0xa8332f})[_0xc271('0x14')](function(){if(!_[_0xc271('0x74')](_0x3f5575)){return _0x4a7dd3[_0xc271('0x75')](_0x3f5575,{'transaction':_0xa8332f});}})[_0xc271('0x14')](function(){_0x3f5575[_0xc271('0x5f')](function(_0x2954f3){socket[_0xc271('0x76')](_0xc271('0x77'),{'UserId':_0x2954f3,'ChatQueueId':_0x4a7dd3['id']});});});});});});})['then'](respondWithStatusCode(_0xe297a5,null))[_0xc271('0x29')](handleError(_0xe297a5,null));};exports['addAgents']=function(_0x3ed1da,_0x3788b2){return db['ChatQueue'][_0xc271('0x35')]({'where':{'id':_0x3ed1da[_0xc271('0x3d')]['id']}})[_0xc271('0x14')](handleEntityNotFound(_0x3788b2,null))[_0xc271('0x14')](function(_0x358d6f){if(_0x358d6f){return _0x358d6f[_0xc271('0x78')](_0x3ed1da[_0xc271('0x37')][_0xc271('0x60')],_[_0xc271('0x79')](_0x3ed1da[_0xc271('0x37')],[_0xc271('0x60'),'id'])||{})[_0xc271('0x7a')](function(_0x3727da){for(var _0x4859b3=0x0;_0x4859b3<_0x3ed1da[_0xc271('0x37')][_0xc271('0x60')][_0xc271('0x31')];_0x4859b3+=0x1){socket[_0xc271('0x76')](_0xc271('0x7b'),{'UserId':Number(_0x3ed1da[_0xc271('0x37')]['ids'][_0x4859b3]),'ChatQueueId':Number(_0x3ed1da['params']['id'])});}return _0x3727da;});}})[_0xc271('0x14')](respondWithResult(_0x3788b2,null))[_0xc271('0x29')](handleError(_0x3788b2,null));};exports['removeAgents']=function(_0x5ed932,_0x3dcf22){return db[_0xc271('0x1f')][_0xc271('0x35')]({'where':{'id':_0x5ed932['params']['id']}})[_0xc271('0x14')](handleEntityNotFound(_0x3dcf22,null))[_0xc271('0x14')](function(_0x6baddc){if(_0x6baddc){return _0x6baddc[_0xc271('0x75')](_0x5ed932[_0xc271('0x26')][_0xc271('0x60')])[_0xc271('0x14')](function(){if(_[_0xc271('0x7c')](_0x5ed932['query'][_0xc271('0x60')])){for(var _0x1ab8a8=0x0;_0x1ab8a8<_0x5ed932[_0xc271('0x26')][_0xc271('0x60')]['length'];_0x1ab8a8+=0x1){socket[_0xc271('0x76')](_0xc271('0x77'),{'UserId':Number(_0x5ed932[_0xc271('0x26')][_0xc271('0x60')][_0x1ab8a8]),'ChatQueueId':Number(_0x5ed932[_0xc271('0x3d')]['id'])});}}else{socket[_0xc271('0x76')](_0xc271('0x77'),{'UserId':Number(_0x5ed932[_0xc271('0x26')]['ids']),'ChatQueueId':Number(_0x5ed932[_0xc271('0x3d')]['id'])});}});}})[_0xc271('0x14')](respondWithStatusCode(_0x3dcf22,null))['catch'](handleError(_0x3dcf22,null));};exports[_0xc271('0x7d')]=function(_0x23b120,_0x12eda0){var _0xf8a161={};var _0xe4f7b8={};var _0xad6455;var _0x552e75;return db[_0xc271('0x1f')][_0xc271('0x40')]({'where':{'id':_0x23b120['params']['id']}})[_0xc271('0x14')](handleEntityNotFound(_0x12eda0,null))[_0xc271('0x14')](function(_0x33fe7e){if(_0x33fe7e){_0xad6455=_0x33fe7e;_0xe4f7b8[_0xc271('0x2b')]=_[_0xc271('0x2c')](db[_0xc271('0x56')]['rawAttributes']);_0xe4f7b8[_0xc271('0x26')]=_[_0xc271('0x2c')](_0x23b120[_0xc271('0x26')]);_0xe4f7b8[_0xc271('0x2d')]=_[_0xc271('0x2e')](_0xe4f7b8[_0xc271('0x2b')],_0xe4f7b8[_0xc271('0x26')]);_0xf8a161[_0xc271('0x30')]=_['intersection'](_0xe4f7b8[_0xc271('0x2b')],qs[_0xc271('0x2f')](_0x23b120[_0xc271('0x26')][_0xc271('0x2f')]));_0xf8a161[_0xc271('0x30')]=_0xf8a161[_0xc271('0x30')][_0xc271('0x31')]?_0xf8a161[_0xc271('0x30')]:_0xe4f7b8['model'];_0xf8a161[_0xc271('0x52')]=qs[_0xc271('0x45')](_0x23b120[_0xc271('0x26')][_0xc271('0x45')]);_0xf8a161[_0xc271('0x24')]=qs[_0xc271('0x2d')](_[_0xc271('0x53')](_0x23b120[_0xc271('0x26')],_0xe4f7b8['filters']));if(_0x23b120[_0xc271('0x26')][_0xc271('0x47')]){_0xf8a161['where']=_[_0xc271('0x33')](_0xf8a161[_0xc271('0x24')],{'$or':_[_0xc271('0x1e')](_0xf8a161[_0xc271('0x30')],function(_0x3d890e){var _0x4f0c1d={};_0x4f0c1d[_0x3d890e]={'$like':'%'+_0x23b120['query'][_0xc271('0x47')]+'%'};return _0x4f0c1d;})});}_0xf8a161=_[_0xc271('0x33')]({},_0xf8a161,_0x23b120[_0xc271('0x34')]);return _0xad6455[_0xc271('0x7d')](_0xf8a161);}})[_0xc271('0x14')](function(_0x2e25ed){if(_0x2e25ed){_0x552e75=_0x2e25ed[_0xc271('0x31')];if(!_0x23b120['query']['hasOwnProperty'](_0xc271('0x43'))){_0xf8a161[_0xc271('0x44')]=qs['limit'](_0x23b120[_0xc271('0x26')][_0xc271('0x44')]);_0xf8a161['offset']=qs[_0xc271('0x12')](_0x23b120[_0xc271('0x26')][_0xc271('0x12')]);}return _0xad6455[_0xc271('0x7d')](_0xf8a161);}})['then'](function(_0x3b8d03){if(_0x3b8d03){return _0x3b8d03?{'count':_0x552e75,'rows':_0x3b8d03}:null;}})[_0xc271('0x14')](respondWithResult(_0x12eda0,null))[_0xc271('0x29')](handleError(_0x12eda0,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index e5cdd38..9cd08f4 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 _0xff16=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x641ccb,_0x311d8c){var _0xeb5d0f=function(_0x3f9072){while(--_0x3f9072){_0x641ccb['push'](_0x641ccb['shift']());}};_0xeb5d0f(++_0x311d8c);}(_0xff16,0x7f));var _0x6ff1=function(_0x3b4f53,_0x57620c){_0x3b4f53=_0x3b4f53-0x0;var _0x258204=_0xff16[_0x3b4f53];return _0x258204;};'use strict';var EventEmitter=require(_0x6ff1('0x0'));var ChatQueue=require(_0x6ff1('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x6ff1('0x2')](0x0);var events={'afterCreate':_0x6ff1('0x3'),'afterUpdate':_0x6ff1('0x4'),'afterDestroy':_0x6ff1('0x5')};function emitEvent(_0x3f3c60){return function(_0x3f53b2,_0x3e4c94,_0x18be1c){ChatQueueEvents['emit'](_0x3f3c60+':'+_0x3f53b2['id'],_0x3f53b2);ChatQueueEvents[_0x6ff1('0x6')](_0x3f3c60,_0x3f53b2);_0x18be1c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x6ff1('0x7')](e,emitEvent(event));}}module[_0x6ff1('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x7188=['hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x7bf686,_0x4c445e){var _0x3c47bc=function(_0x2ecd47){while(--_0x2ecd47){_0x7bf686['push'](_0x7bf686['shift']());}};_0x3c47bc(++_0x4c445e);}(_0x7188,0x172));var _0x8718=function(_0x3da241,_0xeba26a){_0x3da241=_0x3da241-0x0;var _0x43e156=_0x7188[_0x3da241];return _0x43e156;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x8718('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8718('0x1')](0x0);var events={'afterCreate':_0x8718('0x2'),'afterUpdate':_0x8718('0x3'),'afterDestroy':_0x8718('0x4')};function emitEvent(_0x1020ae){return function(_0x200595,_0x48fa22,_0xedcd4d){ChatQueueEvents[_0x8718('0x5')](_0x1020ae+':'+_0x200595['id'],_0x200595);ChatQueueEvents['emit'](_0x1020ae,_0x200595);_0xedcd4d(null);};}for(var e in events){if(events[_0x8718('0x6')](e)){var event=events[e];ChatQueue[_0x8718('0x7')](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 d61fe99..a8197c6 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 _0xf1e1=['path','rimraf','../../config/environment','exports','define','ChatQueue','lodash','api','bluebird'];(function(_0x229105,_0x209fa6){var _0x28a88f=function(_0x40caf3){while(--_0x40caf3){_0x229105['push'](_0x229105['shift']());}};_0x28a88f(++_0x209fa6);}(_0xf1e1,0x192));var _0x1f1e=function(_0x3f994d,_0x249d72){_0x3f994d=_0x3f994d-0x0;var _0x5309b4=_0xf1e1[_0x3f994d];return _0x5309b4;};'use strict';var _=require(_0x1f1e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1f1e('0x1'));var moment=require('moment');var BPromise=require(_0x1f1e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f1e('0x3'));var rimraf=require(_0x1f1e('0x4'));var config=require(_0x1f1e('0x5'));var attributes=require('./chatQueue.attributes');module[_0x1f1e('0x6')]=function(_0x4a7db9,_0x255deb){return _0x4a7db9[_0x1f1e('0x7')](_0x1f1e('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7fbd=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatQueue.attributes','define','ChatQueue','chat_queues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fbd,0xfc));var _0xd7fb=function(_0x1d4760,_0x5a58e7){_0x1d4760=_0x1d4760-0x0;var _0x233074=_0x7fbd[_0x1d4760];return _0x233074;};'use strict';var _=require(_0xd7fb('0x0'));var util=require(_0xd7fb('0x1'));var logger=require(_0xd7fb('0x2'))(_0xd7fb('0x3'));var moment=require(_0xd7fb('0x4'));var BPromise=require(_0xd7fb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7fb('0x6'));var rimraf=require(_0xd7fb('0x7'));var config=require('../../config/environment');var attributes=require(_0xd7fb('0x8'));module['exports']=function(_0x1eaa7a,_0x229e6f){return _0x1eaa7a[_0xd7fb('0x9')](_0xd7fb('0xa'),attributes,{'tableName':_0xd7fb('0xb'),'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 fb38eba..c6d531f 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 _0x47cb=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','findAll','options','where','include','map','model','attributes','then','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3bfdc0,_0x543c89){var _0x2b7446=function(_0x71cda5){while(--_0x71cda5){_0x3bfdc0['push'](_0x3bfdc0['shift']());}};_0x2b7446(++_0x543c89);}(_0x47cb,0x74));var _0xb47c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47cb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb47c('0x0'));var util=require(_0xb47c('0x1'));var moment=require(_0xb47c('0x2'));var BPromise=require(_0xb47c('0x3'));var rs=require(_0xb47c('0x4'));var fs=require('fs');var Redis=require(_0xb47c('0x5'));var db=require(_0xb47c('0x6'))['db'];var utils=require(_0xb47c('0x7'));var logger=require('../../config/logger')(_0xb47c('0x8'));var config=require(_0xb47c('0x9'));var jayson=require(_0xb47c('0xa'));var client=jayson[_0xb47c('0xb')][_0xb47c('0xc')]({'port':0x232a});config[_0xb47c('0xd')]=_[_0xb47c('0xe')](config[_0xb47c('0xd')],{'host':_0xb47c('0xf'),'port':0x18eb});var socket=require(_0xb47c('0x10'))(new Redis(config[_0xb47c('0xd')]));require(_0xb47c('0x11'))[_0xb47c('0x12')](socket);function respondWithRpcPromise(_0x2e04d7,_0x336f67,_0x5a344c){return new BPromise(function(_0x76cc,_0x37a7d5){return client[_0xb47c('0x13')](_0x2e04d7,_0x5a344c)['then'](function(_0x22e56b){logger[_0xb47c('0x14')]('ChatQueue,\x20%s,\x20%s',_0x336f67,_0xb47c('0x15'));logger[_0xb47c('0x16')](_0xb47c('0x17'),_0x336f67,'request\x20sent',JSON[_0xb47c('0x18')](_0x22e56b));if(_0x22e56b[_0xb47c('0x19')]){if(_0x22e56b[_0xb47c('0x19')][_0xb47c('0x1a')]===0x1f4){logger[_0xb47c('0x19')](_0xb47c('0x1b'),_0x336f67,_0x22e56b[_0xb47c('0x19')][_0xb47c('0x1c')]);return _0x37a7d5(_0x22e56b[_0xb47c('0x19')][_0xb47c('0x1c')]);}logger[_0xb47c('0x19')]('ChatQueue,\x20%s,\x20%s',_0x336f67,_0x22e56b[_0xb47c('0x19')][_0xb47c('0x1c')]);return _0x76cc(_0x22e56b[_0xb47c('0x19')]['message']);}else{logger[_0xb47c('0x14')](_0xb47c('0x1b'),_0x336f67,_0xb47c('0x15'));_0x76cc(_0x22e56b[_0xb47c('0x1d')][_0xb47c('0x1c')]);}})[_0xb47c('0x1e')](function(_0x19867e){logger[_0xb47c('0x19')](_0xb47c('0x1b'),_0x336f67,_0x19867e);_0x37a7d5(_0x19867e);});});}exports[_0xb47c('0x1f')]=function(_0x21d6d8){var _0x292b4b=this;return new Promise(function(_0x51c30d,_0x3dfff2){return db[_0xb47c('0x20')][_0xb47c('0x21')]({'raw':_0x21d6d8['options']?_0x21d6d8['options']['raw']===undefined?!![]:![]:!![],'where':_0x21d6d8[_0xb47c('0x22')]?_0x21d6d8[_0xb47c('0x22')][_0xb47c('0x23')]||null:null,'attributes':_0x21d6d8['options']?_0x21d6d8[_0xb47c('0x22')]['attributes']||null:null,'limit':_0x21d6d8[_0xb47c('0x22')]?_0x21d6d8[_0xb47c('0x22')]['limit']||null:null,'include':_0x21d6d8['options']?_0x21d6d8[_0xb47c('0x22')][_0xb47c('0x24')]?_[_0xb47c('0x25')](_0x21d6d8[_0xb47c('0x22')][_0xb47c('0x24')],function(_0x1e55f7){return{'model':db[_0x1e55f7[_0xb47c('0x26')]],'as':_0x1e55f7['as'],'attributes':_0x1e55f7[_0xb47c('0x27')],'include':_0x1e55f7[_0xb47c('0x24')]?_[_0xb47c('0x25')](_0x1e55f7[_0xb47c('0x24')],function(_0x4d0076){return{'model':db[_0x4d0076[_0xb47c('0x26')]],'as':_0x4d0076['as'],'attributes':_0x4d0076[_0xb47c('0x27')],'include':_0x4d0076['include']?_['map'](_0x4d0076[_0xb47c('0x24')],function(_0x3722d4){return{'model':db[_0x3722d4[_0xb47c('0x26')]],'as':_0x3722d4['as'],'attributes':_0x3722d4[_0xb47c('0x27')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf3633){logger[_0xb47c('0x14')]('GetChatQueue',_0x21d6d8);logger[_0xb47c('0x16')]('GetChatQueue',_0x21d6d8,JSON[_0xb47c('0x18')](_0xf3633));_0x51c30d(_0xf3633);})[_0xb47c('0x1e')](function(_0x3b2a6e){logger[_0xb47c('0x19')](_0xb47c('0x1f'),_0x3b2a6e['message'],_0x21d6d8);_0x3dfff2(_0x292b4b['error'](0x1f4,_0x3b2a6e[_0xb47c('0x1c')]));});});};exports['ShowChatQueue']=function(_0x44818e){var _0x1a23f3=this;return new Promise(function(_0x4ca379,_0x5333cf){return db['ChatQueue']['find']({'raw':_0x44818e[_0xb47c('0x22')]?_0x44818e[_0xb47c('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x44818e[_0xb47c('0x22')]?_0x44818e['options'][_0xb47c('0x23')]||null:null,'attributes':_0x44818e[_0xb47c('0x22')]?_0x44818e[_0xb47c('0x22')][_0xb47c('0x27')]||null:null,'include':_0x44818e[_0xb47c('0x22')]?_0x44818e[_0xb47c('0x22')]['include']?_[_0xb47c('0x25')](_0x44818e[_0xb47c('0x22')][_0xb47c('0x24')],function(_0x18e2da){return{'model':db[_0x18e2da[_0xb47c('0x26')]],'as':_0x18e2da['as'],'attributes':_0x18e2da[_0xb47c('0x27')],'include':_0x18e2da['include']?_[_0xb47c('0x25')](_0x18e2da[_0xb47c('0x24')],function(_0x4e30c6){return{'model':db[_0x4e30c6[_0xb47c('0x26')]],'as':_0x4e30c6['as'],'attributes':_0x4e30c6[_0xb47c('0x27')],'include':_0x4e30c6['include']?_[_0xb47c('0x25')](_0x4e30c6[_0xb47c('0x24')],function(_0x545b0d){return{'model':db[_0x545b0d[_0xb47c('0x26')]],'as':_0x545b0d['as'],'attributes':_0x545b0d['attributes']};}):[]};}):[]};}):[]:[]})[_0xb47c('0x28')](function(_0x26157e){logger[_0xb47c('0x14')](_0xb47c('0x29'),_0x44818e);logger[_0xb47c('0x16')](_0xb47c('0x29'),_0x44818e,JSON[_0xb47c('0x18')](_0x26157e));_0x4ca379(_0x26157e);})[_0xb47c('0x1e')](function(_0xd228d0){logger[_0xb47c('0x19')](_0xb47c('0x29'),_0xd228d0[_0xb47c('0x1c')],_0x44818e);_0x5333cf(_0x1a23f3[_0xb47c('0x19')](0x1f4,_0xd228d0[_0xb47c('0x1c')]));});});};
\ No newline at end of file
+var _0xab75=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetChatQueue','ChatQueue','options','raw','limit','include','map','model','attributes','catch','ShowChatQueue','find','where'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0xab75,0x11f));var _0x5ab7=function(_0x459a2d,_0x2aadbf){_0x459a2d=_0x459a2d-0x0;var _0x148a0c=_0xab75[_0x459a2d];return _0x148a0c;};'use strict';var _=require(_0x5ab7('0x0'));var util=require(_0x5ab7('0x1'));var moment=require(_0x5ab7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ab7('0x3'));var db=require(_0x5ab7('0x4'))['db'];var utils=require(_0x5ab7('0x5'));var logger=require('../../config/logger')(_0x5ab7('0x6'));var config=require(_0x5ab7('0x7'));var jayson=require(_0x5ab7('0x8'));var client=jayson[_0x5ab7('0x9')][_0x5ab7('0xa')]({'port':0x232a});config[_0x5ab7('0xb')]=_[_0x5ab7('0xc')](config[_0x5ab7('0xb')],{'host':_0x5ab7('0xd'),'port':0x18eb});var socket=require(_0x5ab7('0xe'))(new Redis(config[_0x5ab7('0xb')]));require('./chatQueue.socket')[_0x5ab7('0xf')](socket);function respondWithRpcPromise(_0x16bbf4,_0x523404,_0x33ffe3){return new BPromise(function(_0x12e9a2,_0x45a8b8){return client[_0x5ab7('0x10')](_0x16bbf4,_0x33ffe3)[_0x5ab7('0x11')](function(_0x4e8f14){logger['info'](_0x5ab7('0x12'),_0x523404,_0x5ab7('0x13'));logger[_0x5ab7('0x14')](_0x5ab7('0x15'),_0x523404,_0x5ab7('0x13'),JSON[_0x5ab7('0x16')](_0x4e8f14));if(_0x4e8f14[_0x5ab7('0x17')]){if(_0x4e8f14[_0x5ab7('0x17')][_0x5ab7('0x18')]===0x1f4){logger[_0x5ab7('0x17')](_0x5ab7('0x12'),_0x523404,_0x4e8f14['error'][_0x5ab7('0x19')]);return _0x45a8b8(_0x4e8f14[_0x5ab7('0x17')][_0x5ab7('0x19')]);}logger[_0x5ab7('0x17')](_0x5ab7('0x12'),_0x523404,_0x4e8f14[_0x5ab7('0x17')][_0x5ab7('0x19')]);return _0x12e9a2(_0x4e8f14[_0x5ab7('0x17')][_0x5ab7('0x19')]);}else{logger[_0x5ab7('0x1a')]('ChatQueue,\x20%s,\x20%s',_0x523404,_0x5ab7('0x13'));_0x12e9a2(_0x4e8f14[_0x5ab7('0x1b')][_0x5ab7('0x19')]);}})['catch'](function(_0x1522eb){logger[_0x5ab7('0x17')](_0x5ab7('0x12'),_0x523404,_0x1522eb);_0x45a8b8(_0x1522eb);});});}exports[_0x5ab7('0x1c')]=function(_0x4b9182){var _0x1167be=this;return new Promise(function(_0x20dc68,_0x38dc30){return db[_0x5ab7('0x1d')]['findAll']({'raw':_0x4b9182[_0x5ab7('0x1e')]?_0x4b9182['options'][_0x5ab7('0x1f')]===undefined?!![]:![]:!![],'where':_0x4b9182[_0x5ab7('0x1e')]?_0x4b9182[_0x5ab7('0x1e')]['where']||null:null,'attributes':_0x4b9182['options']?_0x4b9182[_0x5ab7('0x1e')]['attributes']||null:null,'limit':_0x4b9182[_0x5ab7('0x1e')]?_0x4b9182[_0x5ab7('0x1e')][_0x5ab7('0x20')]||null:null,'include':_0x4b9182[_0x5ab7('0x1e')]?_0x4b9182['options'][_0x5ab7('0x21')]?_[_0x5ab7('0x22')](_0x4b9182['options']['include'],function(_0x158235){return{'model':db[_0x158235['model']],'as':_0x158235['as'],'attributes':_0x158235['attributes'],'include':_0x158235[_0x5ab7('0x21')]?_[_0x5ab7('0x22')](_0x158235[_0x5ab7('0x21')],function(_0x25bf65){return{'model':db[_0x25bf65[_0x5ab7('0x23')]],'as':_0x25bf65['as'],'attributes':_0x25bf65[_0x5ab7('0x24')],'include':_0x25bf65[_0x5ab7('0x21')]?_['map'](_0x25bf65[_0x5ab7('0x21')],function(_0x20f930){return{'model':db[_0x20f930[_0x5ab7('0x23')]],'as':_0x20f930['as'],'attributes':_0x20f930[_0x5ab7('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e4b14){logger[_0x5ab7('0x1a')](_0x5ab7('0x1c'),_0x4b9182);logger[_0x5ab7('0x14')]('GetChatQueue',_0x4b9182,JSON[_0x5ab7('0x16')](_0x4e4b14));_0x20dc68(_0x4e4b14);})[_0x5ab7('0x25')](function(_0x51ae7a){logger[_0x5ab7('0x17')](_0x5ab7('0x1c'),_0x51ae7a[_0x5ab7('0x19')],_0x4b9182);_0x38dc30(_0x1167be['error'](0x1f4,_0x51ae7a[_0x5ab7('0x19')]));});});};exports[_0x5ab7('0x26')]=function(_0x1389a2){var _0x2bdc1e=this;return new Promise(function(_0x241f84,_0x51b08a){return db['ChatQueue'][_0x5ab7('0x27')]({'raw':_0x1389a2['options']?_0x1389a2['options']['raw']===undefined?!![]:![]:!![],'where':_0x1389a2[_0x5ab7('0x1e')]?_0x1389a2[_0x5ab7('0x1e')][_0x5ab7('0x28')]||null:null,'attributes':_0x1389a2[_0x5ab7('0x1e')]?_0x1389a2['options'][_0x5ab7('0x24')]||null:null,'include':_0x1389a2['options']?_0x1389a2[_0x5ab7('0x1e')][_0x5ab7('0x21')]?_['map'](_0x1389a2[_0x5ab7('0x1e')][_0x5ab7('0x21')],function(_0x13a54d){return{'model':db[_0x13a54d[_0x5ab7('0x23')]],'as':_0x13a54d['as'],'attributes':_0x13a54d['attributes'],'include':_0x13a54d[_0x5ab7('0x21')]?_[_0x5ab7('0x22')](_0x13a54d[_0x5ab7('0x21')],function(_0x24221){return{'model':db[_0x24221[_0x5ab7('0x23')]],'as':_0x24221['as'],'attributes':_0x24221['attributes'],'include':_0x24221[_0x5ab7('0x21')]?_[_0x5ab7('0x22')](_0x24221[_0x5ab7('0x21')],function(_0x520122){return{'model':db[_0x520122[_0x5ab7('0x23')]],'as':_0x520122['as'],'attributes':_0x520122['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ab7('0x11')](function(_0x280b29){logger[_0x5ab7('0x1a')](_0x5ab7('0x26'),_0x1389a2);logger[_0x5ab7('0x14')](_0x5ab7('0x26'),_0x1389a2,JSON[_0x5ab7('0x16')](_0x280b29));_0x241f84(_0x280b29);})[_0x5ab7('0x25')](function(_0x5c5a03){logger[_0x5ab7('0x17')](_0x5ab7('0x26'),_0x5c5a03[_0x5ab7('0x19')],_0x1389a2);_0x51b08a(_0x2bdc1e['error'](0x1f4,_0x5c5a03['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 65f25e3..17afa26 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 _0x222f=['./chatQueue.events','save','remove','update','emit','register'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x222f,0x1a4));var _0xf222=function(_0x1d4e21,_0x4e8096){_0x1d4e21=_0x1d4e21-0x0;var _0x178fef=_0x222f[_0x1d4e21];return _0x178fef;};'use strict';var ChatQueueEvents=require(_0xf222('0x0'));var events=[_0xf222('0x1'),_0xf222('0x2'),_0xf222('0x3')];function createListener(_0x4d09ec,_0x4b4237){return function(_0x195de1){_0x4b4237[_0xf222('0x4')](_0x4d09ec,_0x195de1);};}function removeListener(_0x307791,_0x7b187d){return function(){ChatQueueEvents['removeListener'](_0x307791,_0x7b187d);};}exports[_0xf222('0x5')]=function(_0x54a758){for(var _0x112e6d=0x0,_0x26f129=events['length'];_0x112e6d<_0x26f129;_0x112e6d++){var _0xf5a105=events[_0x112e6d];var _0x302d7a=createListener('chatQueue:'+_0xf5a105,_0x54a758);ChatQueueEvents['on'](_0xf5a105,_0x302d7a);}};
\ No newline at end of file
+var _0xdace=['remove','update','emit','register','length','./chatQueue.events'];(function(_0x42b4e2,_0x317256){var _0x39f763=function(_0x5e10e4){while(--_0x5e10e4){_0x42b4e2['push'](_0x42b4e2['shift']());}};_0x39f763(++_0x317256);}(_0xdace,0xc5));var _0xedac=function(_0x1f71d8,_0x278518){_0x1f71d8=_0x1f71d8-0x0;var _0x10b045=_0xdace[_0x1f71d8];return _0x10b045;};'use strict';var ChatQueueEvents=require(_0xedac('0x0'));var events=['save',_0xedac('0x1'),_0xedac('0x2')];function createListener(_0x46eba0,_0x518516){return function(_0x413d77){_0x518516[_0xedac('0x3')](_0x46eba0,_0x413d77);};}function removeListener(_0x15d3bd,_0xefb142){return function(){ChatQueueEvents['removeListener'](_0x15d3bd,_0xefb142);};}exports[_0xedac('0x4')]=function(_0x1cba89){for(var _0x39328a=0x0,_0x5ecbd3=events[_0xedac('0x5')];_0x39328a<_0x5ecbd3;_0x39328a++){var _0x21440e=events[_0x39328a];var _0x162eea=createListener('chatQueue:'+_0x21440e,_0x1cba89);ChatQueueEvents['on'](_0x21440e,_0x162eea);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 1be3a11..f9fa0e4 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4b7b69,_0x3ab075){_0x4b7b69=_0x4b7b69-0x0;var _0x173b4c=_0x5fc3[_0x4b7b69];return _0x173b4c;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3e74,0x175));var _0x43e7=function(_0x4b9ce5,_0x93f34d){_0x4b9ce5=_0x4b9ce5-0x0;var _0x862c13=_0x3e74[_0x4b9ce5];return _0x862c13;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index afeaa78..a64f6d9 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 _0x1bdf=['STRING','DATE','moment','exports'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x1bdf,0x15e));var _0xf1bd=function(_0x480e20,_0x37df7f){_0x480e20=_0x480e20-0x0;var _0x1fe6e3=_0x1bdf[_0x480e20];return _0x1fe6e3;};'use strict';var moment=require(_0xf1bd('0x0'));var Sequelize=require('sequelize');module[_0xf1bd('0x1')]={'uniqueid':{'type':Sequelize[_0xf1bd('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf1bd('0x2')]},'joinAt':{'type':Sequelize[_0xf1bd('0x3')]},'leaveAt':{'type':Sequelize[_0xf1bd('0x3')]},'acceptAt':{'type':Sequelize[_0xf1bd('0x3')]},'exitAt':{'type':Sequelize[_0xf1bd('0x3')]},'reason':{'type':Sequelize[_0xf1bd('0x2')]}};
\ No newline at end of file
+var _0x864a=['exports','STRING','DATE','moment','sequelize'];(function(_0x165189,_0x19a741){var _0x44826b=function(_0x25bf5a){while(--_0x25bf5a){_0x165189['push'](_0x165189['shift']());}};_0x44826b(++_0x19a741);}(_0x864a,0x8a));var _0xa864=function(_0xc537a4,_0x278e4e){_0xc537a4=_0xc537a4-0x0;var _0x2f67bd=_0x864a[_0xc537a4];return _0x2f67bd;};'use strict';var moment=require(_0xa864('0x0'));var Sequelize=require(_0xa864('0x1'));module[_0xa864('0x2')]={'uniqueid':{'type':Sequelize[_0xa864('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa864('0x4')]},'exitAt':{'type':Sequelize['DATE']},'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 230d2b6..5ac8b7d 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 _0x6b1b=['create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../config/logger','api','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','keys','options','find'];(function(_0x5b2d27,_0x5632aa){var _0x21c166=function(_0x33b22a){while(--_0x33b22a){_0x5b2d27['push'](_0x5b2d27['shift']());}};_0x21c166(++_0x5632aa);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x6b1b[_0x433a86];return _0x23000c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb6b1('0x0'));var zipdir=require(_0xb6b1('0x1'));var jsonpatch=require(_0xb6b1('0x2'));var rp=require('request-promise');var moment=require(_0xb6b1('0x3'));var BPromise=require(_0xb6b1('0x4'));var Mustache=require(_0xb6b1('0x5'));var util=require(_0xb6b1('0x6'));var path=require(_0xb6b1('0x7'));var sox=require(_0xb6b1('0x8'));var csv=require(_0xb6b1('0x9'));var ejs=require(_0xb6b1('0xa'));var fs=require('fs');var fs_extra=require(_0xb6b1('0xb'));var _=require(_0xb6b1('0xc'));var squel=require(_0xb6b1('0xd'));var crypto=require('crypto');var jsforce=require(_0xb6b1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb6b1('0xf'));var Papa=require('papaparse');var Redis=require(_0xb6b1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6b1('0x11'))(_0xb6b1('0x12'));var utils=require('../../config/utils');var config=require(_0xb6b1('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x406dce,_0x2e5256){_0x2e5256=_0x2e5256||0xcc;return function(_0x12f3ff){if(_0x12f3ff){return _0x406dce[_0xb6b1('0x14')](_0x2e5256);}return _0x406dce[_0xb6b1('0x15')](_0x2e5256)[_0xb6b1('0x16')]();};}function respondWithResult(_0x360fc7,_0x429d0d){_0x429d0d=_0x429d0d||0xc8;return function(_0x2a4d72){if(_0x2a4d72){return _0x360fc7[_0xb6b1('0x15')](_0x429d0d)[_0xb6b1('0x17')](_0x2a4d72);}};}function respondWithFilteredResult(_0x14fef6,_0x4f770a){return function(_0x57572a){if(_0x57572a){var _0x513207=typeof _0x4f770a['offset']===_0xb6b1('0x18')&&typeof _0x4f770a[_0xb6b1('0x19')]===_0xb6b1('0x18');var _0x2b72e5=_0x57572a[_0xb6b1('0x1a')];var _0x51fb33=_0x513207?0x0:_0x4f770a['offset'];var _0x581e28=_0x513207?_0x57572a[_0xb6b1('0x1a')]:_0x4f770a[_0xb6b1('0x1b')]+_0x4f770a[_0xb6b1('0x19')];var _0x11e8ae;if(_0x581e28>=_0x2b72e5){_0x581e28=_0x2b72e5;_0x11e8ae=0xc8;}else{_0x11e8ae=0xce;}_0x14fef6[_0xb6b1('0x15')](_0x11e8ae);return _0x14fef6[_0xb6b1('0x1c')]('Content-Range',_0x51fb33+'-'+_0x581e28+'/'+_0x2b72e5)['json'](_0x57572a);}return null;};}function patchUpdates(_0x43312e){return function(_0x1067ea){try{jsonpatch['apply'](_0x1067ea,_0x43312e,!![]);}catch(_0x5ced4c){return BPromise[_0xb6b1('0x1d')](_0x5ced4c);}return _0x1067ea['save']();};}function saveUpdates(_0x509c55,_0x232157){return function(_0x2086ea){if(_0x2086ea){return _0x2086ea[_0xb6b1('0x1e')](_0x509c55)[_0xb6b1('0x1f')](function(_0x164952){return _0x164952;});}return null;};}function removeEntity(_0x3d0864,_0x1eb1b2){return function(_0x3b1ff7){if(_0x3b1ff7){return _0x3b1ff7[_0xb6b1('0x20')]()[_0xb6b1('0x1f')](function(){_0x3d0864['status'](0xcc)[_0xb6b1('0x16')]();});}};}function handleEntityNotFound(_0x4f1e2e,_0xd8e094){return function(_0x5864d6){if(!_0x5864d6){_0x4f1e2e[_0xb6b1('0x14')](0x194);}return _0x5864d6;};}function handleError(_0x48c1d2,_0x35a567){_0x35a567=_0x35a567||0x1f4;return function(_0x387603){logger[_0xb6b1('0x21')](_0x387603[_0xb6b1('0x22')]);if(_0x387603[_0xb6b1('0x23')]){delete _0x387603[_0xb6b1('0x23')];}_0x48c1d2[_0xb6b1('0x15')](_0x35a567)[_0xb6b1('0x24')](_0x387603);};}exports[_0xb6b1('0x25')]=function(_0x5a523c,_0xf40426){var _0x548f3f={},_0x427efb={},_0x2737f1={'count':0x0,'rows':[]};var _0x367d66=_[_0xb6b1('0x26')](db[_0xb6b1('0x27')][_0xb6b1('0x28')],function(_0x206b7f){return{'name':_0x206b7f['fieldName'],'type':_0x206b7f[_0xb6b1('0x29')][_0xb6b1('0x2a')]};});_0x427efb[_0xb6b1('0x2b')]=_['map'](_0x367d66,_0xb6b1('0x23'));_0x427efb[_0xb6b1('0x2c')]=_['keys'](_0x5a523c[_0xb6b1('0x2c')]);_0x427efb[_0xb6b1('0x2d')]=_[_0xb6b1('0x2e')](_0x427efb[_0xb6b1('0x2b')],_0x427efb[_0xb6b1('0x2c')]);_0x548f3f[_0xb6b1('0x2f')]=_['intersection'](_0x427efb[_0xb6b1('0x2b')],qs[_0xb6b1('0x30')](_0x5a523c['query'][_0xb6b1('0x30')]));_0x548f3f['attributes']=_0x548f3f[_0xb6b1('0x2f')][_0xb6b1('0x31')]?_0x548f3f[_0xb6b1('0x2f')]:_0x427efb[_0xb6b1('0x2b')];if(!_0x5a523c[_0xb6b1('0x2c')][_0xb6b1('0x32')]('nolimit')){_0x548f3f[_0xb6b1('0x19')]=qs[_0xb6b1('0x19')](_0x5a523c[_0xb6b1('0x2c')][_0xb6b1('0x19')]);_0x548f3f['offset']=qs['offset'](_0x5a523c['query'][_0xb6b1('0x1b')]);}_0x548f3f[_0xb6b1('0x33')]=qs[_0xb6b1('0x34')](_0x5a523c[_0xb6b1('0x2c')][_0xb6b1('0x34')]);_0x548f3f[_0xb6b1('0x35')]=qs[_0xb6b1('0x2d')](_[_0xb6b1('0x36')](_0x5a523c[_0xb6b1('0x2c')],_0x427efb[_0xb6b1('0x2d')]),_0x367d66);if(_0x5a523c[_0xb6b1('0x2c')][_0xb6b1('0x37')]){_0x548f3f['where']=_[_0xb6b1('0x38')](_0x548f3f[_0xb6b1('0x35')],{'$or':_[_0xb6b1('0x26')](_0x367d66,function(_0x453484){if(_0x453484[_0xb6b1('0x29')]!==_0xb6b1('0x39')){var _0xfe126={};_0xfe126[_0x453484[_0xb6b1('0x23')]]={'$like':'%'+_0x5a523c[_0xb6b1('0x2c')][_0xb6b1('0x37')]+'%'};return _0xfe126;}})});}_0x548f3f=_[_0xb6b1('0x38')]({},_0x548f3f,_0x5a523c['options']);var _0x45cb84={'where':_0x548f3f[_0xb6b1('0x35')]};return db[_0xb6b1('0x27')][_0xb6b1('0x1a')](_0x45cb84)[_0xb6b1('0x1f')](function(_0x2c583f){_0x2737f1[_0xb6b1('0x1a')]=_0x2c583f;if(_0x5a523c[_0xb6b1('0x2c')]['includeAll']){_0x548f3f['include']=[{'all':!![]}];}return db[_0xb6b1('0x27')][_0xb6b1('0x3a')](_0x548f3f);})[_0xb6b1('0x1f')](function(_0x541eb5){_0x2737f1[_0xb6b1('0x3b')]=_0x541eb5;return _0x2737f1;})[_0xb6b1('0x1f')](respondWithFilteredResult(_0xf40426,_0x548f3f))[_0xb6b1('0x3c')](handleError(_0xf40426,null));};exports[_0xb6b1('0x3d')]=function(_0xb6e8f5,_0x3c2780){var _0xa03b13={'raw':!![],'where':{'id':_0xb6e8f5['params']['id']}},_0x339edf={};_0x339edf[_0xb6b1('0x2b')]=_['keys'](db[_0xb6b1('0x27')][_0xb6b1('0x28')]);_0x339edf[_0xb6b1('0x2c')]=_[_0xb6b1('0x3e')](_0xb6e8f5[_0xb6b1('0x2c')]);_0x339edf[_0xb6b1('0x2d')]=_['intersection'](_0x339edf[_0xb6b1('0x2b')],_0x339edf[_0xb6b1('0x2c')]);_0xa03b13['attributes']=_[_0xb6b1('0x2e')](_0x339edf['model'],qs[_0xb6b1('0x30')](_0xb6e8f5[_0xb6b1('0x2c')][_0xb6b1('0x30')]));_0xa03b13[_0xb6b1('0x2f')]=_0xa03b13[_0xb6b1('0x2f')][_0xb6b1('0x31')]?_0xa03b13[_0xb6b1('0x2f')]:_0x339edf[_0xb6b1('0x2b')];if(_0xb6e8f5[_0xb6b1('0x2c')]['includeAll']){_0xa03b13['include']=[{'all':!![]}];}_0xa03b13=_[_0xb6b1('0x38')]({},_0xa03b13,_0xb6e8f5[_0xb6b1('0x3f')]);return db['ChatQueueReport'][_0xb6b1('0x40')](_0xa03b13)[_0xb6b1('0x1f')](handleEntityNotFound(_0x3c2780,null))[_0xb6b1('0x1f')](respondWithResult(_0x3c2780,null))[_0xb6b1('0x3c')](handleError(_0x3c2780,null));};exports[_0xb6b1('0x41')]=function(_0x505a80,_0x28f353){return db[_0xb6b1('0x27')][_0xb6b1('0x41')](_0x505a80[_0xb6b1('0x42')],{})['then'](respondWithResult(_0x28f353,0xc9))['catch'](handleError(_0x28f353,null));};exports[_0xb6b1('0x1e')]=function(_0x5bd5e9,_0x2be9e7){if(_0x5bd5e9[_0xb6b1('0x42')]['id']){delete _0x5bd5e9['body']['id'];}return db[_0xb6b1('0x27')]['find']({'where':{'id':_0x5bd5e9[_0xb6b1('0x43')]['id']}})[_0xb6b1('0x1f')](handleEntityNotFound(_0x2be9e7,null))[_0xb6b1('0x1f')](saveUpdates(_0x5bd5e9[_0xb6b1('0x42')],null))[_0xb6b1('0x1f')](respondWithResult(_0x2be9e7,null))[_0xb6b1('0x3c')](handleError(_0x2be9e7,null));};exports[_0xb6b1('0x20')]=function(_0x1c513c,_0x37bbbe){return db[_0xb6b1('0x27')]['find']({'where':{'id':_0x1c513c[_0xb6b1('0x43')]['id']}})[_0xb6b1('0x1f')](handleEntityNotFound(_0x37bbbe,null))[_0xb6b1('0x1f')](removeEntity(_0x37bbbe,null))[_0xb6b1('0x3c')](handleError(_0x37bbbe,null));};exports[_0xb6b1('0x44')]=function(_0x118ec3,_0x3eca0){return db[_0xb6b1('0x27')][_0xb6b1('0x44')]()['then'](respondWithResult(_0x3eca0,null))[_0xb6b1('0x3c')](handleError(_0x3eca0,null));};
\ No newline at end of file
+var _0x7d10=['intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','ChatQueueReport','include','findAll','rows','catch','show','params','rawAttributes','create','body','update','find','describe','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','error','stack','name','type','key','model','map','keys','query','filters'];(function(_0x378266,_0x11fd6a){var _0x20eb3e=function(_0x4b04c3){while(--_0x4b04c3){_0x378266['push'](_0x378266['shift']());}};_0x20eb3e(++_0x11fd6a);}(_0x7d10,0x1ce));var _0x07d1=function(_0xbe3f94,_0x2f2eee){_0xbe3f94=_0xbe3f94-0x0;var _0x5bb088=_0x7d10[_0xbe3f94];return _0x5bb088;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x07d1('0x0'));var zipdir=require(_0x07d1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x07d1('0x2'));var moment=require(_0x07d1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x07d1('0x4'));var util=require(_0x07d1('0x5'));var path=require('path');var sox=require(_0x07d1('0x6'));var csv=require(_0x07d1('0x7'));var ejs=require(_0x07d1('0x8'));var fs=require('fs');var fs_extra=require(_0x07d1('0x9'));var _=require('lodash');var squel=require(_0x07d1('0xa'));var crypto=require(_0x07d1('0xb'));var jsforce=require(_0x07d1('0xc'));var deskjs=require(_0x07d1('0xd'));var toCsv=require(_0x07d1('0x7'));var querystring=require(_0x07d1('0xe'));var Papa=require(_0x07d1('0xf'));var Redis=require(_0x07d1('0x10'));var authService=require(_0x07d1('0x11'));var qs=require(_0x07d1('0x12'));var as=require(_0x07d1('0x13'));var hardwareService=require(_0x07d1('0x14'));var logger=require(_0x07d1('0x15'))(_0x07d1('0x16'));var utils=require(_0x07d1('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x07d1('0x18'))['db'];function respondWithStatusCode(_0x427deb,_0x1625b4){_0x1625b4=_0x1625b4||0xcc;return function(_0x29c764){if(_0x29c764){return _0x427deb[_0x07d1('0x19')](_0x1625b4);}return _0x427deb[_0x07d1('0x1a')](_0x1625b4)[_0x07d1('0x1b')]();};}function respondWithResult(_0x19725b,_0x19ce74){_0x19ce74=_0x19ce74||0xc8;return function(_0x15bc80){if(_0x15bc80){return _0x19725b['status'](_0x19ce74)[_0x07d1('0x1c')](_0x15bc80);}};}function respondWithFilteredResult(_0x22fec9,_0x1c528d){return function(_0x3e1ee7){if(_0x3e1ee7){var _0x5f28f6=typeof _0x1c528d[_0x07d1('0x1d')]===_0x07d1('0x1e')&&typeof _0x1c528d[_0x07d1('0x1f')]==='undefined';var _0xd282ae=_0x3e1ee7[_0x07d1('0x20')];var _0x1e90dd=_0x5f28f6?0x0:_0x1c528d[_0x07d1('0x1d')];var _0x2f9a13=_0x5f28f6?_0x3e1ee7[_0x07d1('0x20')]:_0x1c528d[_0x07d1('0x1d')]+_0x1c528d['limit'];var _0x536f1b;if(_0x2f9a13>=_0xd282ae){_0x2f9a13=_0xd282ae;_0x536f1b=0xc8;}else{_0x536f1b=0xce;}_0x22fec9[_0x07d1('0x1a')](_0x536f1b);return _0x22fec9['set'](_0x07d1('0x21'),_0x1e90dd+'-'+_0x2f9a13+'/'+_0xd282ae)['json'](_0x3e1ee7);}return null;};}function patchUpdates(_0x2b5153){return function(_0x19e9de){try{jsonpatch[_0x07d1('0x22')](_0x19e9de,_0x2b5153,!![]);}catch(_0x42dd1f){return BPromise[_0x07d1('0x23')](_0x42dd1f);}return _0x19e9de[_0x07d1('0x24')]();};}function saveUpdates(_0x723829,_0xd9d94c){return function(_0x43b86c){if(_0x43b86c){return _0x43b86c['update'](_0x723829)['then'](function(_0x557e33){return _0x557e33;});}return null;};}function removeEntity(_0x3f5b53,_0x4f2e25){return function(_0x30755f){if(_0x30755f){return _0x30755f[_0x07d1('0x25')]()[_0x07d1('0x26')](function(){_0x3f5b53[_0x07d1('0x1a')](0xcc)[_0x07d1('0x1b')]();});}};}function handleEntityNotFound(_0x4d8b90,_0x1e9021){return function(_0x16b55c){if(!_0x16b55c){_0x4d8b90[_0x07d1('0x19')](0x194);}return _0x16b55c;};}function handleError(_0x3faa21,_0x2d717a){_0x2d717a=_0x2d717a||0x1f4;return function(_0x58e370){logger[_0x07d1('0x27')](_0x58e370[_0x07d1('0x28')]);if(_0x58e370[_0x07d1('0x29')]){delete _0x58e370[_0x07d1('0x29')];}_0x3faa21[_0x07d1('0x1a')](_0x2d717a)['send'](_0x58e370);};}exports['index']=function(_0x3a0254,_0x604380){var _0x513cf0={},_0x3ba5df={},_0x12cb9c={'count':0x0,'rows':[]};var _0x564b13=_['map'](db['ChatQueueReport']['rawAttributes'],function(_0x42a910){return{'name':_0x42a910['fieldName'],'type':_0x42a910[_0x07d1('0x2a')][_0x07d1('0x2b')]};});_0x3ba5df[_0x07d1('0x2c')]=_[_0x07d1('0x2d')](_0x564b13,_0x07d1('0x29'));_0x3ba5df['query']=_[_0x07d1('0x2e')](_0x3a0254[_0x07d1('0x2f')]);_0x3ba5df[_0x07d1('0x30')]=_[_0x07d1('0x31')](_0x3ba5df[_0x07d1('0x2c')],_0x3ba5df[_0x07d1('0x2f')]);_0x513cf0[_0x07d1('0x32')]=_[_0x07d1('0x31')](_0x3ba5df[_0x07d1('0x2c')],qs[_0x07d1('0x33')](_0x3a0254['query']['fields']));_0x513cf0['attributes']=_0x513cf0[_0x07d1('0x32')]['length']?_0x513cf0[_0x07d1('0x32')]:_0x3ba5df['model'];if(!_0x3a0254['query'][_0x07d1('0x34')](_0x07d1('0x35'))){_0x513cf0[_0x07d1('0x1f')]=qs[_0x07d1('0x1f')](_0x3a0254[_0x07d1('0x2f')][_0x07d1('0x1f')]);_0x513cf0[_0x07d1('0x1d')]=qs['offset'](_0x3a0254[_0x07d1('0x2f')][_0x07d1('0x1d')]);}_0x513cf0['order']=qs[_0x07d1('0x36')](_0x3a0254[_0x07d1('0x2f')][_0x07d1('0x36')]);_0x513cf0[_0x07d1('0x37')]=qs[_0x07d1('0x30')](_[_0x07d1('0x38')](_0x3a0254['query'],_0x3ba5df['filters']),_0x564b13);if(_0x3a0254[_0x07d1('0x2f')]['filter']){_0x513cf0['where']=_[_0x07d1('0x39')](_0x513cf0[_0x07d1('0x37')],{'$or':_[_0x07d1('0x2d')](_0x564b13,function(_0x1a6ea3){if(_0x1a6ea3[_0x07d1('0x2a')]!==_0x07d1('0x3a')){var _0x252718={};_0x252718[_0x1a6ea3['name']]={'$like':'%'+_0x3a0254[_0x07d1('0x2f')]['filter']+'%'};return _0x252718;}})});}_0x513cf0=_['merge']({},_0x513cf0,_0x3a0254[_0x07d1('0x3b')]);var _0x1529eb={'where':_0x513cf0[_0x07d1('0x37')]};return db[_0x07d1('0x3c')]['count'](_0x1529eb)['then'](function(_0x145775){_0x12cb9c[_0x07d1('0x20')]=_0x145775;if(_0x3a0254[_0x07d1('0x2f')]['includeAll']){_0x513cf0[_0x07d1('0x3d')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x07d1('0x3e')](_0x513cf0);})[_0x07d1('0x26')](function(_0xa4b063){_0x12cb9c[_0x07d1('0x3f')]=_0xa4b063;return _0x12cb9c;})[_0x07d1('0x26')](respondWithFilteredResult(_0x604380,_0x513cf0))[_0x07d1('0x40')](handleError(_0x604380,null));};exports[_0x07d1('0x41')]=function(_0x5836dd,_0x4e4154){var _0x2c3d91={'raw':!![],'where':{'id':_0x5836dd[_0x07d1('0x42')]['id']}},_0x3016cb={};_0x3016cb[_0x07d1('0x2c')]=_['keys'](db['ChatQueueReport'][_0x07d1('0x43')]);_0x3016cb[_0x07d1('0x2f')]=_[_0x07d1('0x2e')](_0x5836dd[_0x07d1('0x2f')]);_0x3016cb[_0x07d1('0x30')]=_['intersection'](_0x3016cb[_0x07d1('0x2c')],_0x3016cb[_0x07d1('0x2f')]);_0x2c3d91[_0x07d1('0x32')]=_[_0x07d1('0x31')](_0x3016cb[_0x07d1('0x2c')],qs[_0x07d1('0x33')](_0x5836dd[_0x07d1('0x2f')][_0x07d1('0x33')]));_0x2c3d91[_0x07d1('0x32')]=_0x2c3d91[_0x07d1('0x32')]['length']?_0x2c3d91['attributes']:_0x3016cb[_0x07d1('0x2c')];if(_0x5836dd[_0x07d1('0x2f')]['includeAll']){_0x2c3d91[_0x07d1('0x3d')]=[{'all':!![]}];}_0x2c3d91=_[_0x07d1('0x39')]({},_0x2c3d91,_0x5836dd[_0x07d1('0x3b')]);return db[_0x07d1('0x3c')]['find'](_0x2c3d91)[_0x07d1('0x26')](handleEntityNotFound(_0x4e4154,null))['then'](respondWithResult(_0x4e4154,null))[_0x07d1('0x40')](handleError(_0x4e4154,null));};exports[_0x07d1('0x44')]=function(_0x4918a9,_0xa0e6aa){return db[_0x07d1('0x3c')][_0x07d1('0x44')](_0x4918a9[_0x07d1('0x45')],{})['then'](respondWithResult(_0xa0e6aa,0xc9))[_0x07d1('0x40')](handleError(_0xa0e6aa,null));};exports[_0x07d1('0x46')]=function(_0x17e32c,_0x15da90){if(_0x17e32c[_0x07d1('0x45')]['id']){delete _0x17e32c['body']['id'];}return db[_0x07d1('0x3c')][_0x07d1('0x47')]({'where':{'id':_0x17e32c['params']['id']}})[_0x07d1('0x26')](handleEntityNotFound(_0x15da90,null))['then'](saveUpdates(_0x17e32c[_0x07d1('0x45')],null))[_0x07d1('0x26')](respondWithResult(_0x15da90,null))[_0x07d1('0x40')](handleError(_0x15da90,null));};exports[_0x07d1('0x25')]=function(_0x59bff2,_0x41d642){return db[_0x07d1('0x3c')][_0x07d1('0x47')]({'where':{'id':_0x59bff2[_0x07d1('0x42')]['id']}})[_0x07d1('0x26')](handleEntityNotFound(_0x41d642,null))[_0x07d1('0x26')](removeEntity(_0x41d642,null))[_0x07d1('0x40')](handleError(_0x41d642,null));};exports[_0x07d1('0x48')]=function(_0x513fad,_0x126b8a){return db[_0x07d1('0x3c')][_0x07d1('0x48')]()[_0x07d1('0x26')](respondWithResult(_0x126b8a,null))[_0x07d1('0x40')](handleError(_0x126b8a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index f8bbd81..2413509 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x56da28,_0x597cc0){var _0x4d5f1d=function(_0x554b94){while(--_0x554b94){_0x56da28['push'](_0x56da28['shift']());}};_0x4d5f1d(++_0x597cc0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1fbd2b,_0xe9949d){var _0x46dece=function(_0x32dbcd){while(--_0x32dbcd){_0x1fbd2b['push'](_0x1fbd2b['shift']());}};_0x46dece(++_0xe9949d);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index e00d6ea..efa0577 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 _0xba44=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport','update','raw','where','attributes','limit','catch','util','moment','bluebird'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xba44,0x189));var _0x4ba4=function(_0x4ec334,_0x32e7c6){_0x4ec334=_0x4ec334-0x0;var _0xa0ed5f=_0xba44[_0x4ec334];return _0xa0ed5f;};'use strict';var _=require('lodash');var util=require(_0x4ba4('0x0'));var moment=require(_0x4ba4('0x1'));var BPromise=require(_0x4ba4('0x2'));var rs=require(_0x4ba4('0x3'));var fs=require('fs');var Redis=require(_0x4ba4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba4('0x5'))(_0x4ba4('0x6'));var config=require(_0x4ba4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4ba4('0x8')][_0x4ba4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29e36b,_0xcabb3f,_0x12da47){return new BPromise(function(_0x33c00b,_0x2a54b7){return client[_0x4ba4('0xa')](_0x29e36b,_0x12da47)[_0x4ba4('0xb')](function(_0x47a2ed){logger[_0x4ba4('0xc')](_0x4ba4('0xd'),_0xcabb3f,_0x4ba4('0xe'));logger[_0x4ba4('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0xcabb3f,_0x4ba4('0xe'),JSON[_0x4ba4('0x10')](_0x47a2ed));if(_0x47a2ed[_0x4ba4('0x11')]){if(_0x47a2ed[_0x4ba4('0x11')][_0x4ba4('0x12')]===0x1f4){logger['error'](_0x4ba4('0xd'),_0xcabb3f,_0x47a2ed[_0x4ba4('0x11')]['message']);return _0x2a54b7(_0x47a2ed[_0x4ba4('0x11')][_0x4ba4('0x13')]);}logger[_0x4ba4('0x11')](_0x4ba4('0xd'),_0xcabb3f,_0x47a2ed[_0x4ba4('0x11')][_0x4ba4('0x13')]);return _0x33c00b(_0x47a2ed['error']['message']);}else{logger[_0x4ba4('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0xcabb3f,'request\x20sent');_0x33c00b(_0x47a2ed[_0x4ba4('0x14')][_0x4ba4('0x13')]);}})['catch'](function(_0xc2e13){logger[_0x4ba4('0x11')](_0x4ba4('0xd'),_0xcabb3f,_0xc2e13);_0x2a54b7(_0xc2e13);});});}exports[_0x4ba4('0x15')]=function(_0x262e1e){var _0x360764=this;return new Promise(function(_0x449635,_0x2fc10e){return db[_0x4ba4('0x16')][_0x4ba4('0x17')](_0x262e1e[_0x4ba4('0x18')],{'raw':_0x262e1e[_0x4ba4('0x19')]?_0x262e1e[_0x4ba4('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x4ba4('0xb')](function(_0x5d960a){logger[_0x4ba4('0xc')](_0x4ba4('0x15'),_0x262e1e);logger[_0x4ba4('0xf')]('CreateChatQueueReport',_0x262e1e,JSON[_0x4ba4('0x10')](_0x5d960a));_0x449635(_0x5d960a);})['catch'](function(_0x28a89b){logger[_0x4ba4('0x11')](_0x4ba4('0x15'),_0x28a89b[_0x4ba4('0x13')],_0x262e1e);_0x2fc10e(_0x360764[_0x4ba4('0x11')](0x1f4,_0x28a89b[_0x4ba4('0x13')]));});});};exports[_0x4ba4('0x1a')]=function(_0x34eb84){var _0xe28cb0=this;return new Promise(function(_0x42e0fd,_0x53d1dd){return db['ChatQueueReport'][_0x4ba4('0x1b')](_0x34eb84[_0x4ba4('0x18')],{'raw':_0x34eb84['options']?_0x34eb84['options'][_0x4ba4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34eb84['options']?_0x34eb84[_0x4ba4('0x19')][_0x4ba4('0x1d')]||null:null,'attributes':_0x34eb84[_0x4ba4('0x19')]?_0x34eb84[_0x4ba4('0x19')][_0x4ba4('0x1e')]||null:null,'limit':_0x34eb84[_0x4ba4('0x19')]?_0x34eb84['options'][_0x4ba4('0x1f')]||null:null})[_0x4ba4('0xb')](function(_0x1babc1){logger[_0x4ba4('0xc')](_0x4ba4('0x1a'),_0x34eb84);logger[_0x4ba4('0xf')](_0x4ba4('0x1a'),_0x34eb84,JSON[_0x4ba4('0x10')](_0x1babc1));_0x42e0fd(_0x1babc1);})[_0x4ba4('0x20')](function(_0x305f08){logger[_0x4ba4('0x11')](_0x4ba4('0x1a'),_0x305f08[_0x4ba4('0x13')],_0x34eb84);_0x53d1dd(_0xe28cb0[_0x4ba4('0x11')](0x1f4,_0x305f08[_0x4ba4('0x13')]));});});};
\ No newline at end of file
+var _0xa928=['create','options','update','raw','where','attributes','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa928,0x93));var _0x8a92=function(_0x1a30ae,_0x517b4b){_0x1a30ae=_0x1a30ae-0x0;var _0x45fc2b=_0xa928[_0x1a30ae];return _0x45fc2b;};'use strict';var _=require(_0x8a92('0x0'));var util=require(_0x8a92('0x1'));var moment=require(_0x8a92('0x2'));var BPromise=require(_0x8a92('0x3'));var rs=require(_0x8a92('0x4'));var fs=require('fs');var Redis=require(_0x8a92('0x5'));var db=require(_0x8a92('0x6'))['db'];var utils=require(_0x8a92('0x7'));var logger=require(_0x8a92('0x8'))(_0x8a92('0x9'));var config=require(_0x8a92('0xa'));var jayson=require(_0x8a92('0xb'));var client=jayson[_0x8a92('0xc')][_0x8a92('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1eb32a,_0x238bc4,_0x41b83c){return new BPromise(function(_0x2d2336,_0x16290e){return client[_0x8a92('0xe')](_0x1eb32a,_0x41b83c)[_0x8a92('0xf')](function(_0x1e6ef0){logger[_0x8a92('0x10')](_0x8a92('0x11'),_0x238bc4,'request\x20sent');logger[_0x8a92('0x12')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x238bc4,_0x8a92('0x13'),JSON[_0x8a92('0x14')](_0x1e6ef0));if(_0x1e6ef0['error']){if(_0x1e6ef0[_0x8a92('0x15')][_0x8a92('0x16')]===0x1f4){logger['error'](_0x8a92('0x11'),_0x238bc4,_0x1e6ef0['error']['message']);return _0x16290e(_0x1e6ef0[_0x8a92('0x15')][_0x8a92('0x17')]);}logger[_0x8a92('0x15')](_0x8a92('0x11'),_0x238bc4,_0x1e6ef0[_0x8a92('0x15')][_0x8a92('0x17')]);return _0x2d2336(_0x1e6ef0[_0x8a92('0x15')][_0x8a92('0x17')]);}else{logger[_0x8a92('0x10')](_0x8a92('0x11'),_0x238bc4,_0x8a92('0x13'));_0x2d2336(_0x1e6ef0[_0x8a92('0x18')]['message']);}})[_0x8a92('0x19')](function(_0x4d2a34){logger[_0x8a92('0x15')](_0x8a92('0x11'),_0x238bc4,_0x4d2a34);_0x16290e(_0x4d2a34);});});}exports[_0x8a92('0x1a')]=function(_0x2ecd45){var _0x2e311a=this;return new Promise(function(_0xa455ec,_0x46ae4a){return db[_0x8a92('0x1b')][_0x8a92('0x1c')](_0x2ecd45['body'],{'raw':_0x2ecd45[_0x8a92('0x1d')]?_0x2ecd45[_0x8a92('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x8a92('0xf')](function(_0x2272fd){logger[_0x8a92('0x10')](_0x8a92('0x1a'),_0x2ecd45);logger[_0x8a92('0x12')](_0x8a92('0x1a'),_0x2ecd45,JSON['stringify'](_0x2272fd));_0xa455ec(_0x2272fd);})['catch'](function(_0x46ab31){logger[_0x8a92('0x15')]('CreateChatQueueReport',_0x46ab31['message'],_0x2ecd45);_0x46ae4a(_0x2e311a[_0x8a92('0x15')](0x1f4,_0x46ab31[_0x8a92('0x17')]));});});};exports['UpdateChatQueueReport']=function(_0x255699){var _0x21ce0a=this;return new Promise(function(_0x2c19a1,_0x134dfb){return db[_0x8a92('0x1b')][_0x8a92('0x1e')](_0x255699['body'],{'raw':_0x255699[_0x8a92('0x1d')]?_0x255699[_0x8a92('0x1d')][_0x8a92('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x255699[_0x8a92('0x1d')]?_0x255699[_0x8a92('0x1d')][_0x8a92('0x20')]||null:null,'attributes':_0x255699['options']?_0x255699['options'][_0x8a92('0x21')]||null:null,'limit':_0x255699['options']?_0x255699['options']['limit']||null:null})[_0x8a92('0xf')](function(_0x397158){logger[_0x8a92('0x10')](_0x8a92('0x22'),_0x255699);logger[_0x8a92('0x12')]('UpdateChatQueueReport',_0x255699,JSON[_0x8a92('0x14')](_0x397158));_0x2c19a1(_0x397158);})[_0x8a92('0x19')](function(_0x1eedae){logger[_0x8a92('0x15')](_0x8a92('0x22'),_0x1eedae[_0x8a92('0x17')],_0x255699);_0x134dfb(_0x21ce0a[_0x8a92('0x15')](0x1f4,_0x1eedae[_0x8a92('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 4a2fed4..f2dbbc5 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 _0xbb30=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','describe','post','put','delete','exports','multer'];(function(_0x359e4f,_0x25efbe){var _0x3d0d31=function(_0x5b9420){while(--_0x5b9420){_0x359e4f['push'](_0x359e4f['shift']());}};_0x3d0d31(++_0x25efbe);}(_0xbb30,0x8f));var _0x0bb3=function(_0x3a03cf,_0xf70834){_0x3a03cf=_0x3a03cf-0x0;var _0x2e943c=_0xbb30[_0x3a03cf];return _0x2e943c;};'use strict';var multer=require(_0x0bb3('0x0'));var util=require('util');var path=require(_0x0bb3('0x1'));var timeout=require(_0x0bb3('0x2'));var express=require('express');var router=express[_0x0bb3('0x3')]();var fs_extra=require(_0x0bb3('0x4'));var auth=require(_0x0bb3('0x5'));var interaction=require(_0x0bb3('0x6'));var config=require(_0x0bb3('0x7'));var controller=require(_0x0bb3('0x8'));router[_0x0bb3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x0bb3('0xa')](),controller[_0x0bb3('0xb')]);router[_0x0bb3('0x9')]('/:id',auth[_0x0bb3('0xa')](),controller['show']);router[_0x0bb3('0xc')]('/',auth[_0x0bb3('0xa')](),controller['create']);router[_0x0bb3('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0bb3('0xe')]('/:id',auth[_0x0bb3('0xa')](),controller['destroy']);module[_0x0bb3('0xf')]=router;
\ No newline at end of file
+var _0x31fb=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','/:id','show','create','put','update','delete','destroy'];(function(_0x3dc6a5,_0x44a6c1){var _0x8961d9=function(_0x4cf66c){while(--_0x4cf66c){_0x3dc6a5['push'](_0x3dc6a5['shift']());}};_0x8961d9(++_0x44a6c1);}(_0x31fb,0x17d));var _0xb31f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x31fb[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xb31f('0x0'));var util=require(_0xb31f('0x1'));var path=require('path');var timeout=require(_0xb31f('0x2'));var express=require(_0xb31f('0x3'));var router=express[_0xb31f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb31f('0x5'));var interaction=require(_0xb31f('0x6'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb31f('0x7')]);router[_0xb31f('0x8')](_0xb31f('0x9'),auth[_0xb31f('0xa')](),controller['describe']);router[_0xb31f('0x8')](_0xb31f('0xb'),auth[_0xb31f('0xa')](),controller[_0xb31f('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb31f('0xd')]);router[_0xb31f('0xe')](_0xb31f('0xb'),auth[_0xb31f('0xa')](),controller[_0xb31f('0xf')]);router[_0xb31f('0x10')]('/:id',auth[_0xb31f('0xa')](),controller[_0xb31f('0x11')]);module[_0xb31f('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 97eba34..eef28f4 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(_0x376256,_0x3d2caa){var _0x39b953=function(_0x57008e){while(--_0x57008e){_0x376256['push'](_0x376256['shift']());}};_0x39b953(++_0x3d2caa);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2dc53b,_0x29b63f){_0x2dc53b=_0x2dc53b-0x0;var _0x1083f8=_0xf4eb[_0x2dc53b];return _0x1083f8;};'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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x5b5f67,_0x1cf60e){var _0x2191f9=function(_0x544235){while(--_0x544235){_0x5b5f67['push'](_0x5b5f67['shift']());}};_0x2191f9(++_0x1cf60e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0xcb91[_0x903228];return _0xcec81d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index ba0d790..7d6c8c8 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 _0x93ac=['mustache','util','path','sox','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','Content-Range','json','save','update','then','destroy','send','index','map','rawAttributes','fieldName','type','model','name','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','catch','show','keys','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x37baaf,_0xfe26d){var _0x2abbf0=function(_0x2a379b){while(--_0x2a379b){_0x37baaf['push'](_0x37baaf['shift']());}};_0x2abbf0(++_0xfe26d);}(_0x93ac,0x15d));var _0xc93a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x93ac[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc93a('0x0'));var zipdir=require(_0xc93a('0x1'));var jsonpatch=require(_0xc93a('0x2'));var rp=require(_0xc93a('0x3'));var moment=require(_0xc93a('0x4'));var BPromise=require(_0xc93a('0x5'));var Mustache=require(_0xc93a('0x6'));var util=require(_0xc93a('0x7'));var path=require(_0xc93a('0x8'));var sox=require(_0xc93a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc93a('0xa'));var _=require('lodash');var squel=require(_0xc93a('0xb'));var crypto=require(_0xc93a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc93a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc93a('0xe'));var Papa=require(_0xc93a('0xf'));var Redis=require(_0xc93a('0x10'));var authService=require(_0xc93a('0x11'));var qs=require(_0xc93a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc93a('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc93a('0x14'));var licenseUtil=require(_0xc93a('0x15'));var db=require(_0xc93a('0x16'))['db'];function respondWithStatusCode(_0x1640d,_0x8f0bc1){_0x8f0bc1=_0x8f0bc1||0xcc;return function(_0x3c1f91){if(_0x3c1f91){return _0x1640d[_0xc93a('0x17')](_0x8f0bc1);}return _0x1640d[_0xc93a('0x18')](_0x8f0bc1)[_0xc93a('0x19')]();};}function respondWithResult(_0x326ed6,_0x16a7e2){_0x16a7e2=_0x16a7e2||0xc8;return function(_0x4f9d3b){if(_0x4f9d3b){return _0x326ed6[_0xc93a('0x18')](_0x16a7e2)['json'](_0x4f9d3b);}};}function respondWithFilteredResult(_0x1443bc,_0x3d512e){return function(_0x735098){if(_0x735098){var _0x55d927=typeof _0x3d512e['offset']==='undefined'&&typeof _0x3d512e[_0xc93a('0x1a')]===_0xc93a('0x1b');var _0x3ee21a=_0x735098['count'];var _0x43d092=_0x55d927?0x0:_0x3d512e[_0xc93a('0x1c')];var _0x297fce=_0x55d927?_0x735098[_0xc93a('0x1d')]:_0x3d512e[_0xc93a('0x1c')]+_0x3d512e[_0xc93a('0x1a')];var _0x4de28d;if(_0x297fce>=_0x3ee21a){_0x297fce=_0x3ee21a;_0x4de28d=0xc8;}else{_0x4de28d=0xce;}_0x1443bc[_0xc93a('0x18')](_0x4de28d);return _0x1443bc[_0xc93a('0x1e')](_0xc93a('0x1f'),_0x43d092+'-'+_0x297fce+'/'+_0x3ee21a)[_0xc93a('0x20')](_0x735098);}return null;};}function patchUpdates(_0xe135b6){return function(_0x20c4a8){try{jsonpatch['apply'](_0x20c4a8,_0xe135b6,!![]);}catch(_0x251712){return BPromise['reject'](_0x251712);}return _0x20c4a8[_0xc93a('0x21')]();};}function saveUpdates(_0x586e87,_0x5d3fb7){return function(_0xa98ec8){if(_0xa98ec8){return _0xa98ec8[_0xc93a('0x22')](_0x586e87)[_0xc93a('0x23')](function(_0x37b589){return _0x37b589;});}return null;};}function removeEntity(_0x548085,_0x4a3c41){return function(_0x14e578){if(_0x14e578){return _0x14e578[_0xc93a('0x24')]()[_0xc93a('0x23')](function(){_0x548085[_0xc93a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x330c45,_0x5d244a){return function(_0x40ccd7){if(!_0x40ccd7){_0x330c45['sendStatus'](0x194);}return _0x40ccd7;};}function handleError(_0x313e24,_0x7ff074){_0x7ff074=_0x7ff074||0x1f4;return function(_0x41a441){logger['error'](_0x41a441['stack']);if(_0x41a441['name']){delete _0x41a441['name'];}_0x313e24[_0xc93a('0x18')](_0x7ff074)[_0xc93a('0x25')](_0x41a441);};}exports[_0xc93a('0x26')]=function(_0x558265,_0x1b7346){var _0x2f6557={},_0x1e77d9={},_0x308c45={'count':0x0,'rows':[]};var _0xf0ccae=_[_0xc93a('0x27')](db['ChatTransferReport'][_0xc93a('0x28')],function(_0x428390){return{'name':_0x428390[_0xc93a('0x29')],'type':_0x428390[_0xc93a('0x2a')]['key']};});_0x1e77d9[_0xc93a('0x2b')]=_[_0xc93a('0x27')](_0xf0ccae,_0xc93a('0x2c'));_0x1e77d9[_0xc93a('0x2d')]=_['keys'](_0x558265[_0xc93a('0x2d')]);_0x1e77d9[_0xc93a('0x2e')]=_[_0xc93a('0x2f')](_0x1e77d9[_0xc93a('0x2b')],_0x1e77d9[_0xc93a('0x2d')]);_0x2f6557[_0xc93a('0x30')]=_[_0xc93a('0x2f')](_0x1e77d9[_0xc93a('0x2b')],qs['fields'](_0x558265[_0xc93a('0x2d')][_0xc93a('0x31')]));_0x2f6557['attributes']=_0x2f6557[_0xc93a('0x30')][_0xc93a('0x32')]?_0x2f6557[_0xc93a('0x30')]:_0x1e77d9[_0xc93a('0x2b')];if(!_0x558265[_0xc93a('0x2d')]['hasOwnProperty']('nolimit')){_0x2f6557[_0xc93a('0x1a')]=qs[_0xc93a('0x1a')](_0x558265[_0xc93a('0x2d')]['limit']);_0x2f6557[_0xc93a('0x1c')]=qs[_0xc93a('0x1c')](_0x558265[_0xc93a('0x2d')][_0xc93a('0x1c')]);}_0x2f6557[_0xc93a('0x33')]=qs['sort'](_0x558265['query'][_0xc93a('0x34')]);_0x2f6557[_0xc93a('0x35')]=qs[_0xc93a('0x2e')](_[_0xc93a('0x36')](_0x558265[_0xc93a('0x2d')],_0x1e77d9[_0xc93a('0x2e')]),_0xf0ccae);if(_0x558265['query'][_0xc93a('0x37')]){_0x2f6557[_0xc93a('0x35')]=_[_0xc93a('0x38')](_0x2f6557[_0xc93a('0x35')],{'$or':_[_0xc93a('0x27')](_0xf0ccae,function(_0x80a241){if(_0x80a241[_0xc93a('0x2a')]!==_0xc93a('0x39')){var _0x1609ca={};_0x1609ca[_0x80a241['name']]={'$like':'%'+_0x558265[_0xc93a('0x2d')][_0xc93a('0x37')]+'%'};return _0x1609ca;}})});}_0x2f6557=_[_0xc93a('0x38')]({},_0x2f6557,_0x558265[_0xc93a('0x3a')]);var _0x5e07ac={'where':_0x2f6557[_0xc93a('0x35')]};return db[_0xc93a('0x3b')][_0xc93a('0x1d')](_0x5e07ac)[_0xc93a('0x23')](function(_0x3b6aa9){_0x308c45[_0xc93a('0x1d')]=_0x3b6aa9;if(_0x558265[_0xc93a('0x2d')][_0xc93a('0x3c')]){_0x2f6557[_0xc93a('0x3d')]=[{'all':!![]}];}return db[_0xc93a('0x3b')][_0xc93a('0x3e')](_0x2f6557);})[_0xc93a('0x23')](function(_0x1ae442){_0x308c45['rows']=_0x1ae442;return _0x308c45;})[_0xc93a('0x23')](respondWithFilteredResult(_0x1b7346,_0x2f6557))[_0xc93a('0x3f')](handleError(_0x1b7346,null));};exports[_0xc93a('0x40')]=function(_0x21c32c,_0xccd9b0){var _0x1ea47e={'raw':!![],'where':{'id':_0x21c32c['params']['id']}},_0x176a55={};_0x176a55[_0xc93a('0x2b')]=_[_0xc93a('0x41')](db[_0xc93a('0x3b')][_0xc93a('0x28')]);_0x176a55['query']=_['keys'](_0x21c32c['query']);_0x176a55[_0xc93a('0x2e')]=_[_0xc93a('0x2f')](_0x176a55['model'],_0x176a55[_0xc93a('0x2d')]);_0x1ea47e[_0xc93a('0x30')]=_[_0xc93a('0x2f')](_0x176a55['model'],qs[_0xc93a('0x31')](_0x21c32c[_0xc93a('0x2d')][_0xc93a('0x31')]));_0x1ea47e[_0xc93a('0x30')]=_0x1ea47e[_0xc93a('0x30')]['length']?_0x1ea47e['attributes']:_0x176a55[_0xc93a('0x2b')];if(_0x21c32c[_0xc93a('0x2d')][_0xc93a('0x3c')]){_0x1ea47e[_0xc93a('0x3d')]=[{'all':!![]}];}_0x1ea47e=_['merge']({},_0x1ea47e,_0x21c32c[_0xc93a('0x3a')]);return db[_0xc93a('0x3b')]['find'](_0x1ea47e)[_0xc93a('0x23')](handleEntityNotFound(_0xccd9b0,null))[_0xc93a('0x23')](respondWithResult(_0xccd9b0,null))[_0xc93a('0x3f')](handleError(_0xccd9b0,null));};exports[_0xc93a('0x42')]=function(_0x5757b1,_0xa4e464){return db[_0xc93a('0x3b')][_0xc93a('0x42')](_0x5757b1[_0xc93a('0x43')],{})[_0xc93a('0x23')](respondWithResult(_0xa4e464,0xc9))[_0xc93a('0x3f')](handleError(_0xa4e464,null));};exports['update']=function(_0x2df92d,_0x23f833){if(_0x2df92d[_0xc93a('0x43')]['id']){delete _0x2df92d[_0xc93a('0x43')]['id'];}return db[_0xc93a('0x3b')][_0xc93a('0x44')]({'where':{'id':_0x2df92d[_0xc93a('0x45')]['id']}})[_0xc93a('0x23')](handleEntityNotFound(_0x23f833,null))[_0xc93a('0x23')](saveUpdates(_0x2df92d[_0xc93a('0x43')],null))[_0xc93a('0x23')](respondWithResult(_0x23f833,null))[_0xc93a('0x3f')](handleError(_0x23f833,null));};exports['destroy']=function(_0x17b2bd,_0x458c1a){return db[_0xc93a('0x3b')][_0xc93a('0x44')]({'where':{'id':_0x17b2bd[_0xc93a('0x45')]['id']}})[_0xc93a('0x23')](handleEntityNotFound(_0x458c1a,null))[_0xc93a('0x23')](removeEntity(_0x458c1a,null))['catch'](handleError(_0x458c1a,null));};exports[_0xc93a('0x46')]=function(_0x498fd8,_0xeb536c){return db[_0xc93a('0x3b')][_0xc93a('0x46')]()['then'](respondWithResult(_0xeb536c,null))[_0xc93a('0x3f')](handleError(_0xeb536c,null));};
\ No newline at end of file
+var _0x78d2=['includeAll','include','findAll','rows','params','find','catch','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','error','stack','name','index','ChatTransferReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x78d2,0x17d));var _0x278d=function(_0x18d36f,_0x31b65f){_0x18d36f=_0x18d36f-0x0;var _0x10034d=_0x78d2[_0x18d36f];return _0x10034d;};'use strict';var emlformat=require(_0x278d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x278d('0x1'));var jsonpatch=require(_0x278d('0x2'));var rp=require(_0x278d('0x3'));var moment=require(_0x278d('0x4'));var BPromise=require(_0x278d('0x5'));var Mustache=require(_0x278d('0x6'));var util=require(_0x278d('0x7'));var path=require(_0x278d('0x8'));var sox=require(_0x278d('0x9'));var csv=require('to-csv');var ejs=require(_0x278d('0xa'));var fs=require('fs');var fs_extra=require(_0x278d('0xb'));var _=require(_0x278d('0xc'));var squel=require(_0x278d('0xd'));var crypto=require(_0x278d('0xe'));var jsforce=require(_0x278d('0xf'));var deskjs=require(_0x278d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x278d('0x11'));var Papa=require('papaparse');var Redis=require(_0x278d('0x12'));var authService=require(_0x278d('0x13'));var qs=require(_0x278d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x278d('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x278d('0x16'));var config=require(_0x278d('0x17'));var licenseUtil=require(_0x278d('0x18'));var db=require(_0x278d('0x19'))['db'];function respondWithStatusCode(_0x291e77,_0x58f780){_0x58f780=_0x58f780||0xcc;return function(_0x388895){if(_0x388895){return _0x291e77[_0x278d('0x1a')](_0x58f780);}return _0x291e77[_0x278d('0x1b')](_0x58f780)[_0x278d('0x1c')]();};}function respondWithResult(_0x1722fa,_0x2cd203){_0x2cd203=_0x2cd203||0xc8;return function(_0x3e55cd){if(_0x3e55cd){return _0x1722fa[_0x278d('0x1b')](_0x2cd203)[_0x278d('0x1d')](_0x3e55cd);}};}function respondWithFilteredResult(_0x19f1c8,_0x577220){return function(_0x3c3904){if(_0x3c3904){var _0x5e2880=typeof _0x577220[_0x278d('0x1e')]==='undefined'&&typeof _0x577220[_0x278d('0x1f')]===_0x278d('0x20');var _0x233cc0=_0x3c3904[_0x278d('0x21')];var _0x50cc5c=_0x5e2880?0x0:_0x577220[_0x278d('0x1e')];var _0x261c5d=_0x5e2880?_0x3c3904[_0x278d('0x21')]:_0x577220[_0x278d('0x1e')]+_0x577220['limit'];var _0x3eaa86;if(_0x261c5d>=_0x233cc0){_0x261c5d=_0x233cc0;_0x3eaa86=0xc8;}else{_0x3eaa86=0xce;}_0x19f1c8[_0x278d('0x1b')](_0x3eaa86);return _0x19f1c8[_0x278d('0x22')](_0x278d('0x23'),_0x50cc5c+'-'+_0x261c5d+'/'+_0x233cc0)[_0x278d('0x1d')](_0x3c3904);}return null;};}function patchUpdates(_0x2b10fa){return function(_0xb48aa0){try{jsonpatch['apply'](_0xb48aa0,_0x2b10fa,!![]);}catch(_0x42e5c3){return BPromise['reject'](_0x42e5c3);}return _0xb48aa0['save']();};}function saveUpdates(_0x41ce85,_0x5d92c1){return function(_0x2c4bd3){if(_0x2c4bd3){return _0x2c4bd3[_0x278d('0x24')](_0x41ce85)[_0x278d('0x25')](function(_0x34f16e){return _0x34f16e;});}return null;};}function removeEntity(_0x278c9b,_0x561829){return function(_0x60fed6){if(_0x60fed6){return _0x60fed6['destroy']()[_0x278d('0x25')](function(){_0x278c9b[_0x278d('0x1b')](0xcc)[_0x278d('0x1c')]();});}};}function handleEntityNotFound(_0x556087,_0x47328b){return function(_0x49d8b8){if(!_0x49d8b8){_0x556087[_0x278d('0x1a')](0x194);}return _0x49d8b8;};}function handleError(_0x206b1e,_0x487720){_0x487720=_0x487720||0x1f4;return function(_0x263425){logger[_0x278d('0x26')](_0x263425[_0x278d('0x27')]);if(_0x263425[_0x278d('0x28')]){delete _0x263425['name'];}_0x206b1e[_0x278d('0x1b')](_0x487720)['send'](_0x263425);};}exports[_0x278d('0x29')]=function(_0x1b16d9,_0x59bf85){var _0x4d3738={},_0x122c52={},_0x580915={'count':0x0,'rows':[]};var _0x3343fb=_['map'](db[_0x278d('0x2a')][_0x278d('0x2b')],function(_0x3dbf15){return{'name':_0x3dbf15[_0x278d('0x2c')],'type':_0x3dbf15[_0x278d('0x2d')]['key']};});_0x122c52[_0x278d('0x2e')]=_[_0x278d('0x2f')](_0x3343fb,_0x278d('0x28'));_0x122c52[_0x278d('0x30')]=_[_0x278d('0x31')](_0x1b16d9['query']);_0x122c52['filters']=_['intersection'](_0x122c52['model'],_0x122c52[_0x278d('0x30')]);_0x4d3738['attributes']=_[_0x278d('0x32')](_0x122c52['model'],qs[_0x278d('0x33')](_0x1b16d9['query'][_0x278d('0x33')]));_0x4d3738[_0x278d('0x34')]=_0x4d3738[_0x278d('0x34')][_0x278d('0x35')]?_0x4d3738[_0x278d('0x34')]:_0x122c52[_0x278d('0x2e')];if(!_0x1b16d9[_0x278d('0x30')][_0x278d('0x36')]('nolimit')){_0x4d3738[_0x278d('0x1f')]=qs['limit'](_0x1b16d9['query']['limit']);_0x4d3738[_0x278d('0x1e')]=qs['offset'](_0x1b16d9[_0x278d('0x30')][_0x278d('0x1e')]);}_0x4d3738[_0x278d('0x37')]=qs[_0x278d('0x38')](_0x1b16d9['query']['sort']);_0x4d3738[_0x278d('0x39')]=qs[_0x278d('0x3a')](_[_0x278d('0x3b')](_0x1b16d9[_0x278d('0x30')],_0x122c52[_0x278d('0x3a')]),_0x3343fb);if(_0x1b16d9['query'][_0x278d('0x3c')]){_0x4d3738['where']=_[_0x278d('0x3d')](_0x4d3738['where'],{'$or':_[_0x278d('0x2f')](_0x3343fb,function(_0x1f3712){if(_0x1f3712['type']!=='VIRTUAL'){var _0x2ab4f6={};_0x2ab4f6[_0x1f3712[_0x278d('0x28')]]={'$like':'%'+_0x1b16d9[_0x278d('0x30')]['filter']+'%'};return _0x2ab4f6;}})});}_0x4d3738=_[_0x278d('0x3d')]({},_0x4d3738,_0x1b16d9[_0x278d('0x3e')]);var _0x158660={'where':_0x4d3738[_0x278d('0x39')]};return db['ChatTransferReport'][_0x278d('0x21')](_0x158660)[_0x278d('0x25')](function(_0x24ade6){_0x580915[_0x278d('0x21')]=_0x24ade6;if(_0x1b16d9['query'][_0x278d('0x3f')]){_0x4d3738[_0x278d('0x40')]=[{'all':!![]}];}return db[_0x278d('0x2a')][_0x278d('0x41')](_0x4d3738);})['then'](function(_0x598f1a){_0x580915[_0x278d('0x42')]=_0x598f1a;return _0x580915;})[_0x278d('0x25')](respondWithFilteredResult(_0x59bf85,_0x4d3738))['catch'](handleError(_0x59bf85,null));};exports['show']=function(_0xf5b715,_0x329557){var _0x124f65={'raw':!![],'where':{'id':_0xf5b715[_0x278d('0x43')]['id']}},_0x9023ad={};_0x9023ad[_0x278d('0x2e')]=_['keys'](db['ChatTransferReport']['rawAttributes']);_0x9023ad[_0x278d('0x30')]=_['keys'](_0xf5b715['query']);_0x9023ad[_0x278d('0x3a')]=_[_0x278d('0x32')](_0x9023ad[_0x278d('0x2e')],_0x9023ad[_0x278d('0x30')]);_0x124f65[_0x278d('0x34')]=_['intersection'](_0x9023ad['model'],qs[_0x278d('0x33')](_0xf5b715[_0x278d('0x30')][_0x278d('0x33')]));_0x124f65[_0x278d('0x34')]=_0x124f65['attributes'][_0x278d('0x35')]?_0x124f65[_0x278d('0x34')]:_0x9023ad[_0x278d('0x2e')];if(_0xf5b715[_0x278d('0x30')][_0x278d('0x3f')]){_0x124f65[_0x278d('0x40')]=[{'all':!![]}];}_0x124f65=_[_0x278d('0x3d')]({},_0x124f65,_0xf5b715[_0x278d('0x3e')]);return db[_0x278d('0x2a')][_0x278d('0x44')](_0x124f65)[_0x278d('0x25')](handleEntityNotFound(_0x329557,null))[_0x278d('0x25')](respondWithResult(_0x329557,null))[_0x278d('0x45')](handleError(_0x329557,null));};exports[_0x278d('0x46')]=function(_0x245209,_0x53dfa1){return db['ChatTransferReport'][_0x278d('0x46')](_0x245209['body'],{})['then'](respondWithResult(_0x53dfa1,0xc9))[_0x278d('0x45')](handleError(_0x53dfa1,null));};exports[_0x278d('0x24')]=function(_0x4c7152,_0x2928e8){if(_0x4c7152[_0x278d('0x47')]['id']){delete _0x4c7152[_0x278d('0x47')]['id'];}return db['ChatTransferReport'][_0x278d('0x44')]({'where':{'id':_0x4c7152[_0x278d('0x43')]['id']}})[_0x278d('0x25')](handleEntityNotFound(_0x2928e8,null))[_0x278d('0x25')](saveUpdates(_0x4c7152['body'],null))[_0x278d('0x25')](respondWithResult(_0x2928e8,null))[_0x278d('0x45')](handleError(_0x2928e8,null));};exports[_0x278d('0x48')]=function(_0x8bb6c3,_0x3735e0){return db[_0x278d('0x2a')]['find']({'where':{'id':_0x8bb6c3[_0x278d('0x43')]['id']}})['then'](handleEntityNotFound(_0x3735e0,null))[_0x278d('0x25')](removeEntity(_0x3735e0,null))[_0x278d('0x45')](handleError(_0x3735e0,null));};exports[_0x278d('0x49')]=function(_0x3a0312,_0x3c309b){return db['ChatTransferReport']['describe']()[_0x278d('0x25')](respondWithResult(_0x3c309b,null))[_0x278d('0x45')](handleError(_0x3c309b,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 4af0b61..7aa8cf1 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 _0xa2b4=['ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','exports','define'];(function(_0x28198f,_0x4b1fb8){var _0x5eef0a=function(_0x26929a){while(--_0x26929a){_0x28198f['push'](_0x28198f['shift']());}};_0x5eef0a(++_0x4b1fb8);}(_0xa2b4,0xfc));var _0x4a2b=function(_0x10afad,_0x30da9d){_0x10afad=_0x10afad-0x0;var _0x588d7e=_0xa2b4[_0x10afad];return _0x588d7e;};'use strict';var _=require(_0x4a2b('0x0'));var util=require(_0x4a2b('0x1'));var logger=require(_0x4a2b('0x2'))(_0x4a2b('0x3'));var moment=require(_0x4a2b('0x4'));var BPromise=require('bluebird');var rp=require(_0x4a2b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x4a2b('0x6')]=function(_0x856106,_0x3c14c2){return _0x856106[_0x4a2b('0x7')](_0x4a2b('0x8'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x4a2b('0x9'),'fields':[_0x4a2b('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x234f=['exports','define','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x4fd75e,_0x219e4a){var _0x5b6338=function(_0xf2969c){while(--_0xf2969c){_0x4fd75e['push'](_0x4fd75e['shift']());}};_0x5b6338(++_0x219e4a);}(_0x234f,0x87));var _0xf234=function(_0x3a42c2,_0x1860f5){_0x3a42c2=_0x3a42c2-0x0;var _0x525455=_0x234f[_0x3a42c2];return _0x525455;};'use strict';var _=require('lodash');var util=require(_0xf234('0x0'));var logger=require(_0xf234('0x1'))('api');var moment=require(_0xf234('0x2'));var BPromise=require(_0xf234('0x3'));var rp=require(_0xf234('0x4'));var fs=require('fs');var path=require(_0xf234('0x5'));var rimraf=require(_0xf234('0x6'));var config=require(_0xf234('0x7'));var attributes=require(_0xf234('0x8'));module[_0xf234('0x9')]=function(_0x397f4a,_0x5076af){return _0x397f4a[_0xf234('0xa')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xf234('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index b1fc381..3f37643 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 _0x85a3=['info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','client','http'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x85a3,0x13a));var _0x385a=function(_0x413b15,_0x5bb73f){_0x413b15=_0x413b15-0x0;var _0x1debc7=_0x85a3[_0x413b15];return _0x1debc7;};'use strict';var _=require(_0x385a('0x0'));var util=require(_0x385a('0x1'));var moment=require(_0x385a('0x2'));var BPromise=require(_0x385a('0x3'));var rs=require(_0x385a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x385a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x385a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x385a('0x7')][_0x385a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5911be,_0x23e436,_0x271dd1){return new BPromise(function(_0x6d1790,_0x533153){return client['request'](_0x5911be,_0x271dd1)['then'](function(_0x50bfdf){logger[_0x385a('0x9')](_0x385a('0xa'),_0x23e436,'request\x20sent');logger[_0x385a('0xb')](_0x385a('0xc'),_0x23e436,'request\x20sent',JSON[_0x385a('0xd')](_0x50bfdf));if(_0x50bfdf[_0x385a('0xe')]){if(_0x50bfdf[_0x385a('0xe')][_0x385a('0xf')]===0x1f4){logger[_0x385a('0xe')](_0x385a('0xa'),_0x23e436,_0x50bfdf['error'][_0x385a('0x10')]);return _0x533153(_0x50bfdf[_0x385a('0xe')][_0x385a('0x10')]);}logger[_0x385a('0xe')](_0x385a('0xa'),_0x23e436,_0x50bfdf['error']['message']);return _0x6d1790(_0x50bfdf[_0x385a('0xe')][_0x385a('0x10')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x23e436,_0x385a('0x11'));_0x6d1790(_0x50bfdf[_0x385a('0x12')][_0x385a('0x10')]);}})['catch'](function(_0x3b4bad){logger[_0x385a('0xe')](_0x385a('0xa'),_0x23e436,_0x3b4bad);_0x533153(_0x3b4bad);});});}
\ No newline at end of file
+var _0x0b5b=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x520449,_0x45e8de){var _0x4d38ff=function(_0x4b2287){while(--_0x4b2287){_0x520449['push'](_0x520449['shift']());}};_0x4d38ff(++_0x45e8de);}(_0x0b5b,0xe9));var _0xb0b5=function(_0x1acf69,_0x2a6dea){_0x1acf69=_0x1acf69-0x0;var _0x17c66e=_0x0b5b[_0x1acf69];return _0x17c66e;};'use strict';var _=require(_0xb0b5('0x0'));var util=require(_0xb0b5('0x1'));var moment=require(_0xb0b5('0x2'));var BPromise=require('bluebird');var rs=require(_0xb0b5('0x3'));var fs=require('fs');var Redis=require(_0xb0b5('0x4'));var db=require(_0xb0b5('0x5'))['db'];var utils=require(_0xb0b5('0x6'));var logger=require(_0xb0b5('0x7'))(_0xb0b5('0x8'));var config=require(_0xb0b5('0x9'));var jayson=require(_0xb0b5('0xa'));var client=jayson[_0xb0b5('0xb')][_0xb0b5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1673cc,_0x444b22,_0x21022a){return new BPromise(function(_0x2bc935,_0xfb8d1d){return client[_0xb0b5('0xd')](_0x1673cc,_0x21022a)[_0xb0b5('0xe')](function(_0xa2d61e){logger[_0xb0b5('0xf')](_0xb0b5('0x10'),_0x444b22,_0xb0b5('0x11'));logger[_0xb0b5('0x12')](_0xb0b5('0x13'),_0x444b22,_0xb0b5('0x11'),JSON[_0xb0b5('0x14')](_0xa2d61e));if(_0xa2d61e[_0xb0b5('0x15')]){if(_0xa2d61e['error'][_0xb0b5('0x16')]===0x1f4){logger[_0xb0b5('0x15')](_0xb0b5('0x10'),_0x444b22,_0xa2d61e[_0xb0b5('0x15')][_0xb0b5('0x17')]);return _0xfb8d1d(_0xa2d61e[_0xb0b5('0x15')]['message']);}logger['error'](_0xb0b5('0x10'),_0x444b22,_0xa2d61e[_0xb0b5('0x15')][_0xb0b5('0x17')]);return _0x2bc935(_0xa2d61e[_0xb0b5('0x15')][_0xb0b5('0x17')]);}else{logger['info'](_0xb0b5('0x10'),_0x444b22,_0xb0b5('0x11'));_0x2bc935(_0xa2d61e[_0xb0b5('0x18')][_0xb0b5('0x17')]);}})[_0xb0b5('0x19')](function(_0x2b1f8c){logger[_0xb0b5('0x15')](_0xb0b5('0x10'),_0x444b22,_0x2b1f8c);_0xfb8d1d(_0x2b1f8c);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 829abe3..9c14514 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 _0xc43e=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','/describe','describe','/:id','isAuthenticated','show','post','create'];(function(_0x37d915,_0x4d8742){var _0x58e8b9=function(_0xdc5424){while(--_0xdc5424){_0x37d915['push'](_0x37d915['shift']());}};_0x58e8b9(++_0x4d8742);}(_0xc43e,0x1e8));var _0xec43=function(_0x23e100,_0x434387){_0x23e100=_0x23e100-0x0;var _0x58ed9a=_0xc43e[_0x23e100];return _0x58ed9a;};'use strict';var multer=require(_0xec43('0x0'));var util=require(_0xec43('0x1'));var path=require(_0xec43('0x2'));var timeout=require(_0xec43('0x3'));var express=require(_0xec43('0x4'));var router=express['Router']();var fs_extra=require(_0xec43('0x5'));var auth=require(_0xec43('0x6'));var interaction=require(_0xec43('0x7'));var config=require(_0xec43('0x8'));var controller=require(_0xec43('0x9'));router[_0xec43('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xec43('0xa')](_0xec43('0xb'),auth['isAuthenticated'](),controller[_0xec43('0xc')]);router[_0xec43('0xa')](_0xec43('0xd'),auth[_0xec43('0xe')](),controller[_0xec43('0xf')]);router[_0xec43('0x10')]('/',auth[_0xec43('0xe')](),controller[_0xec43('0x11')]);router[_0xec43('0x12')](_0xec43('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xec43('0x13')](_0xec43('0xd'),auth[_0xec43('0xe')](),controller[_0xec43('0x14')]);module[_0xec43('0x15')]=router;
\ No newline at end of file
+var _0x45b8=['isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x33c638,_0x462bff){var _0x18a079=function(_0x336610){while(--_0x336610){_0x33c638['push'](_0x33c638['shift']());}};_0x18a079(++_0x462bff);}(_0x45b8,0x1d7));var _0x845b=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x45b8[_0x9cd4c3];return _0x4c9025;};'use strict';var multer=require('multer');var util=require(_0x845b('0x0'));var path=require(_0x845b('0x1'));var timeout=require(_0x845b('0x2'));var express=require(_0x845b('0x3'));var router=express[_0x845b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x845b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x845b('0x6'));var controller=require(_0x845b('0x7'));router[_0x845b('0x8')]('/',auth[_0x845b('0x9')](),controller[_0x845b('0xa')]);router['get'](_0x845b('0xb'),auth[_0x845b('0x9')](),controller[_0x845b('0xc')]);router['get'](_0x845b('0xd'),auth[_0x845b('0x9')](),controller[_0x845b('0xe')]);router['post']('/',auth[_0x845b('0x9')](),controller[_0x845b('0xf')]);router[_0x845b('0x10')](_0x845b('0xd'),auth[_0x845b('0x9')](),controller[_0x845b('0x11')]);router[_0x845b('0x12')](_0x845b('0xd'),auth[_0x845b('0x9')](),controller['destroy']);module[_0x845b('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 30019b0..daa5925 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 _0xc06f=['#ffffff','INTEGER','rounded','We\x20are\x20here!','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','stringify','input','name','text','onlineForm','getDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','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.','TEXT','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','address','STRING','email','Agent','#011F6A'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc06f,0x13c));var _0xfc06=function(_0x443f0c,_0x2696a5){_0x443f0c=_0x443f0c-0x0;var _0x1090eb=_0xc06f[_0x443f0c];return _0x1090eb;};'use strict';var Sequelize=require(_0xfc06('0x0'));var rs=require(_0xfc06('0x1'));module[_0xfc06('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfc06('0x3')},'description':{'type':Sequelize[_0xfc06('0x4')]},'mapKey':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x5')},'mapKeyOffline':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x5')},'key':{'type':Sequelize[_0xfc06('0x4')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x6')},'customerAlias':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xfc06('0x4')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xfc06('0x4')],'allowNull':![],'defaultValue':_0xfc06('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xfc06('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xfc06('0x4')],'allowNull':![],'defaultValue':_0xfc06('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xfc06('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xfc06('0xa'),'squared'),'defaultValue':_0xfc06('0xa')},'header_online':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0xb')},'start_chat_button':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0xc')},'header_offline':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0xd')},'download_transcript':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xfc06('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xfc06('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xfc06('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x12')},'noteTitle':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x13')},'placeholderMessage':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x14')},'closingMessage':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xfc06('0xc')},'skipMessageButton':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x17')},'ratingType':{'type':Sequelize[_0xfc06('0x18')]('star','thumb'),'defaultValue':_0xfc06('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xfc06('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xfc06('0x1a')]({'items':[{'type':_0xfc06('0x1b'),'variable':null,'config':{'placeholder':_0xfc06('0x1c'),'type':_0xfc06('0x1d'),'required':!![]},'props':{'title':_0xfc06('0x1c'),'helpText':''}},{'type':_0xfc06('0x1b'),'props':{'title':_0xfc06('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xfc06('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xfc06('0x1e'))?JSON['parse'](this[_0xfc06('0x1f')](_0xfc06('0x1e'))):{};},'set':function(_0x19ea69){return this['setDataValue']('onlineForm',JSON[_0xfc06('0x1a')](_0x19ea69));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xfc06('0x1a')]({'items':[{'type':_0xfc06('0x1b'),'props':{'title':_0xfc06('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xfc06('0x5'),'type':_0xfc06('0x5')},'variable':null},{'type':_0xfc06('0x20'),'config':{'placeholder':_0xfc06('0x21')},'props':{'title':_0xfc06('0x21'),'helpText':_0xfc06('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xfc06('0x1f')](_0xfc06('0x23'))?JSON['parse'](this[_0xfc06('0x1f')](_0xfc06('0x23'))):{};},'set':function(_0x4d6b7b){return this[_0xfc06('0x24')](_0xfc06('0x23'),JSON[_0xfc06('0x1a')](_0x4d6b7b));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfc06('0x4')]},'forwardOffline':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfc06('0x4')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xfc06('0x25')},'waitingMessage':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xfc06('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x29')},'skipUnmanaged':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x16')},'sendUnmanaged':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xfc06('0x2a')]},'showAgentAvatar':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xfc06('0x4')]},'notificationTemplate':{'type':Sequelize[_0xfc06('0x2a')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xfc06('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x2c')},'verticalAlignment':{'type':Sequelize[_0xfc06('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x2d')},'messagesAlignment':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x2e')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfc06('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xfc06('0x4')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfc06('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfc06('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xfc06('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfc06('0x9')],'comment':_0xfc06('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![],'comment':_0xfc06('0x31'),'set':function(_0x9c8728){if(!_0x9c8728)this[_0xfc06('0x24')](_0xfc06('0x32'),null);this['setDataValue'](_0xfc06('0x33'),_0x9c8728);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfc06('0x34')},'vidaooNote':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':function(){return _0xfc06('0x35');}},'vidaooMetadata':{'type':Sequelize[_0xfc06('0x2a')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xfb50=['mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','input','name','text','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x1ca993,_0x243c1e){var _0x150e5e=function(_0xaf1a3e){while(--_0xaf1a3e){_0x1ca993['push'](_0x1ca993['shift']());}};_0x150e5e(++_0x243c1e);}(_0xfb50,0x10b));var _0x0fb5=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xfb50[_0x4914e2];return _0x2dcd07;};'use strict';var Sequelize=require(_0x0fb5('0x0'));var rs=require(_0x0fb5('0x1'));module[_0x0fb5('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x0fb5('0x3')],'allowNull':![],'unique':_0x0fb5('0x4')},'description':{'type':Sequelize[_0x0fb5('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x5')},'key':{'type':Sequelize[_0x0fb5('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x6')},'customerAlias':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0fb5('0x3')],'allowNull':![],'defaultValue':_0x0fb5('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x0fb5('0x3')],'allowNull':![],'defaultValue':_0x0fb5('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0fb5('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0fb5('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0fb5('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0fb5('0x3')]},'animation':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x0fb5('0xb'),_0x0fb5('0xc')),'defaultValue':_0x0fb5('0xb')},'header_online':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0xd')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0xe')},'header_offline':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0xf')},'download_transcript':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0fb5('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0fb5('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x14')},'placeholderMessage':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x15')},'closingMessage':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x16')},'closingMessageButton':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x17')},'conditionAgreement':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x18')},'ratingType':{'type':Sequelize[_0x0fb5('0x19')](_0x0fb5('0x1a'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x0fb5('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0fb5('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x0fb5('0x1b'),'variable':null,'config':{'placeholder':_0x0fb5('0x1c'),'type':_0x0fb5('0x1d'),'required':!![]},'props':{'title':_0x0fb5('0x1c'),'helpText':''}},{'type':_0x0fb5('0x1b'),'props':{'title':_0x0fb5('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x0fb5('0x5'),'type':_0x0fb5('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0fb5('0x1e')]('onlineForm')?JSON['parse'](this[_0x0fb5('0x1e')](_0x0fb5('0x1f'))):{};},'set':function(_0x50c3d9){return this[_0x0fb5('0x20')]('onlineForm',JSON['stringify'](_0x50c3d9));}},'offlineForm':{'type':Sequelize[_0x0fb5('0x10')],'defaultValue':function(){return JSON[_0x0fb5('0x21')]({'items':[{'type':_0x0fb5('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0fb5('0x5'),'type':'email'},'variable':null},{'type':_0x0fb5('0x22'),'config':{'placeholder':_0x0fb5('0x23')},'props':{'title':_0x0fb5('0x23'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x0fb5('0x24'))?JSON[_0x0fb5('0x25')](this[_0x0fb5('0x1e')]('offlineForm')):{};},'set':function(_0x43cb61){return this[_0x0fb5('0x20')](_0x0fb5('0x24'),JSON[_0x0fb5('0x21')](_0x43cb61));}},'token':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':function(){return rs[_0x0fb5('0x26')]();}},'autoclose':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x0fb5('0x3')]},'forwardOffline':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0fb5('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x27')},'waitingMessage':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x28')},'offlineMessageSubject':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x17')},'sendUnmanaged':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0fb5('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0fb5('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0fb5('0x10')],'defaultValue':function(){return _0x0fb5('0x2b');}},'notificationSound':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0fb5('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x0fb5('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x2d')},'verticalAlignment':{'type':Sequelize[_0x0fb5('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x2e')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x0fb5('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0fb5('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0fb5('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0fb5('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x2f')},'systemAvatar':{'type':Sequelize[_0x0fb5('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0fb5('0x9')],'comment':_0x0fb5('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![],'comment':_0x0fb5('0x31'),'set':function(_0x33134a){if(!_0x33134a)this[_0x0fb5('0x20')](_0x0fb5('0x32'),null);this[_0x0fb5('0x20')](_0x0fb5('0x33'),_0x33134a);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0fb5('0x3')]},'vidaooTopic':{'type':Sequelize[_0x0fb5('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':function(){return _0x0fb5('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0fb5('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index c750ffa..1e53e6c 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 _0x7118=['headers','origin','http://localhost:9000','testWebsiteWithWildcard','connection','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','findAndCountAll','finally','getApplications','addProactiveActions','omit','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','path','ejs','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','URL','../../mysqldb','redis','localhost','socket.io-emitter','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','json','undefined','count','offset','limit','set','Content-Range','update','get','ChatWebsites','UserProfileResource','destroy','sendStatus','stack','name','send','setUA','user-agent','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','index','Pause','map','ChatWebsite','fieldName','key','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','show','params','mandatoryDispositionPause','rawAttributes','length','find','create','body','address','forEach','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','testWildcardValidity','describe','ChatWebsiteId','Disposition','getDispositions','keys','includeAll','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','rows','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','customerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','Interval','resolve','timezone','notify','chat','from','From\x20is\x20mandatory','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','mapKey','DESC','ChatApplication','Applications','Intervals','interval','account','applications','orderBy','priority','asc','list','List','ListId','Contacts','defaults','contact','threadId','ChatInteraction','closed','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','forcedOwnership','queueId','ChatQueue','unshift','waitForTheAssignedQueue','offline','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','CmList','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','offlineMessageSubject','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','User','Owner','Tag','Tags','color','tag','getSnippet','getProactiveActions','virtual','License','increment','chatLicenseExceeded','ifTime','server/files/chat/iframe.ejs'];(function(_0x1bc504,_0x50a8bf){var _0x17656e=function(_0x16ca1b){while(--_0x16ca1b){_0x1bc504['push'](_0x1bc504['shift']());}};_0x17656e(++_0x50a8bf);}(_0x7118,0x159));var _0x8711=function(_0x32843c,_0x205bbf){_0x32843c=_0x32843c-0x0;var _0x5e2059=_0x7118[_0x32843c];return _0x5e2059;};'use strict';var Mustache=require('mustache');var util=require('util');var path=require(_0x8711('0x0'));var ejs=require(_0x8711('0x1'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8711('0x2'));var querystring=require(_0x8711('0x3'));var htmlToText=require(_0x8711('0x4'));var Redis=require(_0x8711('0x5'));var jayson=require(_0x8711('0x6'));var qs=require(_0x8711('0x7'));var logger=require(_0x8711('0x8'))('api');var config=require(_0x8711('0x9'));var APIBadRequestError=require(_0x8711('0xa'))[_0x8711('0xb')];var APINotFoundError=require(_0x8711('0xa'))[_0x8711('0xc')];var APIOutOfIntervalError=require(_0x8711('0xa'))[_0x8711('0xd')];var APIHandleError=require(_0x8711('0xa'))[_0x8711('0xe')];var APIConflictError=require(_0x8711('0xa'))[_0x8711('0xf')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require('url')[_0x8711('0x10')];var db=require(_0x8711('0x11'))['db'];config[_0x8711('0x12')]=_['defaults'](config['redis'],{'host':_0x8711('0x13'),'port':0x18eb});var socket=require(_0x8711('0x14'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x8711('0x15')](socket);var client=jayson[_0x8711('0x16')][_0x8711('0x17')]({'port':0x232c});var client9002=jayson[_0x8711('0x16')][_0x8711('0x17')]({'port':0x232a});var client9003=jayson[_0x8711('0x16')][_0x8711('0x17')]({'port':0x232b});var client9001=jayson['client'][_0x8711('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x363bcd,_0x13f394,_0x2e12ec,_0x3ab905){return new Promise(function(_0x4628e9,_0x57fedb){var _0x2f96a0=_0x3ab905||client;return _0x2f96a0[_0x8711('0x18')](_0x363bcd,_0x2e12ec)[_0x8711('0x19')](function(_0xe1e9b3){logger[_0x8711('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x13f394,'request\x20sent');logger['debug'](_0x8711('0x1b'),_0x13f394,_0x8711('0x1c'),JSON[_0x8711('0x1d')](_0xe1e9b3));if(_0xe1e9b3['error']){if(_0xe1e9b3['error'][_0x8711('0x1e')]===0x1f4){logger[_0x8711('0x1f')](_0x8711('0x20'),_0x13f394,_0xe1e9b3[_0x8711('0x1f')][_0x8711('0x21')]);return _0x57fedb(_0xe1e9b3[_0x8711('0x1f')][_0x8711('0x21')]);}logger[_0x8711('0x1f')](_0x8711('0x20'),_0x13f394,_0xe1e9b3[_0x8711('0x1f')]['message']);return _0x4628e9(_0xe1e9b3[_0x8711('0x1f')][_0x8711('0x21')]);}else{logger[_0x8711('0x1a')](_0x8711('0x20'),_0x13f394,'request\x20sent');_0x4628e9(_0xe1e9b3[_0x8711('0x22')][_0x8711('0x21')]);}})[_0x8711('0x23')](function(_0x5ab925){logger[_0x8711('0x1f')](_0x8711('0x20'),_0x13f394,_0x5ab925);_0x57fedb(_0x5ab925);});});}function respondWithStatusCode(_0x3e8281,_0x217197){_0x217197=_0x217197||0xcc;return function(_0x3f937b){if(_0x3f937b){return _0x3e8281['sendStatus'](_0x217197);}return _0x3e8281['status'](_0x217197)['end']();};}function respondWithResult(_0x2ad1fa,_0x16ea3b){_0x16ea3b=_0x16ea3b||0xc8;return function(_0x2d0901){if(_0x2d0901){return _0x2ad1fa[_0x8711('0x24')](_0x16ea3b)[_0x8711('0x25')](_0x2d0901);}};}function respondWithFilteredResult(_0x254b35,_0x359093){return function(_0x3ca2b5){if(_0x3ca2b5){var _0x398097=typeof _0x359093['offset']===_0x8711('0x26')&&typeof _0x359093['limit']===_0x8711('0x26');var _0xd0c671=_0x3ca2b5[_0x8711('0x27')];var _0x5a11dd=_0x398097?0x0:_0x359093[_0x8711('0x28')];var _0x5e6111=_0x398097?_0x3ca2b5[_0x8711('0x27')]:_0x359093[_0x8711('0x28')]+_0x359093[_0x8711('0x29')];var _0x5c4fcc;if(_0x5e6111>=_0xd0c671){_0x5e6111=_0xd0c671;_0x5c4fcc=0xc8;}else{_0x5c4fcc=0xce;}_0x254b35['status'](_0x5c4fcc);return _0x254b35[_0x8711('0x2a')](_0x8711('0x2b'),_0x5a11dd+'-'+_0x5e6111+'/'+_0xd0c671)[_0x8711('0x25')](_0x3ca2b5);}return null;};}function saveUpdates(_0x6ab2c7){return function(_0x1c2fae){if(_0x1c2fae){return _0x1c2fae[_0x8711('0x2c')](_0x6ab2c7)[_0x8711('0x19')](function(_0x64cf25){return _0x64cf25;});}return null;};}function removeEntity(_0x356303){return function(_0x36f3bd){if(_0x36f3bd){return _0x36f3bd['destroy']()[_0x8711('0x19')](function(){var _0x11c1e9=_0x36f3bd[_0x8711('0x2d')]({'plain':!![]});var _0x285390=_0x8711('0x2e');return db[_0x8711('0x2f')][_0x8711('0x30')]({'where':{'type':_0x285390,'resourceId':_0x11c1e9['id']}})[_0x8711('0x19')](function(){return _0x36f3bd;});})[_0x8711('0x19')](function(){_0x356303[_0x8711('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18643f){return function(_0x318e5d){if(!_0x318e5d){_0x18643f[_0x8711('0x31')](0x194);}return _0x318e5d;};}function handleError(_0x33b1e7,_0x2ddf9f){_0x2ddf9f=_0x2ddf9f||0x1f4;return function(_0x4cbf06){logger[_0x8711('0x1f')](_0x4cbf06[_0x8711('0x32')]);if(_0x4cbf06[_0x8711('0x33')]){delete _0x4cbf06['name'];}_0x33b1e7[_0x8711('0x24')](_0x2ddf9f)[_0x8711('0x34')](_0x4cbf06);};}function createInteractionObject(_0x612a46,_0x1f2b1f,_0x1953ef,_0x14922d){var _0x263be0=require('user-agent-parser');var _0xd805b9=new _0x263be0();var _0x1c1f1b=_0xd805b9[_0x8711('0x35')](_0x1953ef[_0x8711('0x36')])['getResult']();var _0x5de511=_0x1f2b1f[_0x8711('0x37')];if(_0x1953ef[_0x8711('0x38')]){_0x5de511=_0x1953ef[_0x8711('0x38')];}else if(_0x1953ef[_0x8711('0x39')]){_0x5de511=_[_0x8711('0x3a')](_0x1953ef[_0x8711('0x39')][_0x8711('0x3b')](','));}return{'ContactId':_0x14922d['id'],'ChatWebsiteId':_0x612a46,'from':(_0x14922d[_0x8711('0x3c')]||'')+'\x20'+(_0x14922d[_0x8711('0x3d')]||''),'customerIp':_0x5de511,'customerPort':_0x1953ef[_0x8711('0x3e')]?_0x1953ef[_0x8711('0x3e')]:null,'referer':_0x1f2b1f[_0x8711('0x3f')],'browserName':_0x1c1f1b[_0x8711('0x40')][_0x8711('0x33')]&&_0x1c1f1b[_0x8711('0x40')][_0x8711('0x41')]?util[_0x8711('0x42')](_0x8711('0x43'),_0x1c1f1b[_0x8711('0x40')][_0x8711('0x33')],_0x1c1f1b[_0x8711('0x40')]['version']):_0x8711('0x44'),'browserVersion':_0x1c1f1b['browser'][_0x8711('0x41')]||_0x8711('0x44'),'osName':util[_0x8711('0x42')](_0x8711('0x43'),_0x1c1f1b['os']['name'],_0x1c1f1b['os'][_0x8711('0x41')]),'osVersion':_0x1c1f1b['os'][_0x8711('0x41')],'deviceModel':_0x1c1f1b[_0x8711('0x45')][_0x8711('0x46')]&&_0x1c1f1b[_0x8711('0x45')][_0x8711('0x47')]?util['format'](_0x8711('0x48'),_0x1c1f1b[_0x8711('0x45')][_0x8711('0x46')],_0x1c1f1b[_0x8711('0x45')]['vendor'],_0x1c1f1b[_0x8711('0x45')][_0x8711('0x49')]):null,'deviceVendor':_0x1c1f1b[_0x8711('0x45')][_0x8711('0x47')],'deviceType':_0x1c1f1b[_0x8711('0x45')]['type'],'formData':JSON['stringify'](_0x1f2b1f)};}exports[_0x8711('0x4a')]=function(_0x291d0e,_0x5579a6){var _0x9fba5c={'include':[{'model':db[_0x8711('0x4b')],'as':'mandatoryDispositionPause'}]},_0x22a256={},_0x344548={'count':0x0,'rows':[]};var _0x34ef5a=_[_0x8711('0x4c')](db[_0x8711('0x4d')]['rawAttributes'],function(_0x3cb781){return{'name':_0x3cb781[_0x8711('0x4e')],'type':_0x3cb781['type'][_0x8711('0x4f')]};});_0x22a256[_0x8711('0x46')]=_['map'](_0x34ef5a,_0x8711('0x33'));_0x22a256[_0x8711('0x50')]=_['keys'](_0x291d0e[_0x8711('0x50')]);_0x22a256[_0x8711('0x51')]=_[_0x8711('0x52')](_0x22a256[_0x8711('0x46')],_0x22a256['query']);_0x9fba5c[_0x8711('0x53')]=_[_0x8711('0x52')](_0x22a256['model'],qs[_0x8711('0x54')](_0x291d0e[_0x8711('0x50')]['fields']));_0x9fba5c['attributes']=_0x9fba5c['attributes']['length']?_0x9fba5c[_0x8711('0x53')]:_0x22a256[_0x8711('0x46')];if(!_0x291d0e[_0x8711('0x50')][_0x8711('0x55')](_0x8711('0x56'))){_0x9fba5c[_0x8711('0x29')]=qs[_0x8711('0x29')](_0x291d0e['query']['limit']);_0x9fba5c['offset']=qs[_0x8711('0x28')](_0x291d0e[_0x8711('0x50')][_0x8711('0x28')]);}_0x9fba5c[_0x8711('0x57')]=qs[_0x8711('0x58')](_0x291d0e[_0x8711('0x50')]['sort']);_0x9fba5c[_0x8711('0x59')]=qs[_0x8711('0x51')](_[_0x8711('0x5a')](_0x291d0e['query'],_0x22a256[_0x8711('0x51')]),_0x34ef5a);if(_0x291d0e[_0x8711('0x50')][_0x8711('0x5b')]){_0x9fba5c[_0x8711('0x59')]=_[_0x8711('0x5c')](_0x9fba5c[_0x8711('0x59')],{'$or':_[_0x8711('0x4c')](_0x34ef5a,function(_0x171f3f){if(_0x171f3f['type']!==_0x8711('0x5d')){var _0x55d8b7={};_0x55d8b7[_0x171f3f[_0x8711('0x33')]]={'$like':'%'+_0x291d0e['query']['filter']+'%'};return _0x55d8b7;}})});}_0x9fba5c=_['merge']({},_0x9fba5c,_0x291d0e[_0x8711('0x5e')]);var _0x1ee501={'where':_0x9fba5c['where']};return db[_0x8711('0x4d')]['count'](_0x1ee501)[_0x8711('0x19')](function(_0x152863){_0x344548['count']=_0x152863;if(_0x291d0e[_0x8711('0x50')]['includeAll']){_0x9fba5c[_0x8711('0x5f')]=[{'all':!![]}];}return db[_0x8711('0x4d')]['findAll'](_0x9fba5c);})['then'](function(_0x44e243){_0x344548['rows']=_0x44e243;return _0x344548;})[_0x8711('0x19')](respondWithFilteredResult(_0x5579a6,_0x9fba5c))[_0x8711('0x23')](handleError(_0x5579a6,null));};exports[_0x8711('0x60')]=function(_0x158d97,_0x3c03bf){var _0x5dfb08={'raw':![],'where':{'id':_0x158d97[_0x8711('0x61')]['id']},'include':[{'model':db[_0x8711('0x4b')],'as':_0x8711('0x62')}]},_0x20bceb={};_0x20bceb[_0x8711('0x46')]=_['keys'](db[_0x8711('0x4d')][_0x8711('0x63')]);_0x20bceb[_0x8711('0x50')]=_['keys'](_0x158d97['query']);_0x20bceb[_0x8711('0x51')]=_[_0x8711('0x52')](_0x20bceb['model'],_0x20bceb['query']);_0x5dfb08['attributes']=_[_0x8711('0x52')](_0x20bceb[_0x8711('0x46')],qs[_0x8711('0x54')](_0x158d97[_0x8711('0x50')][_0x8711('0x54')]));_0x5dfb08[_0x8711('0x53')]=_0x5dfb08[_0x8711('0x53')][_0x8711('0x64')]?_0x5dfb08[_0x8711('0x53')]:_0x20bceb[_0x8711('0x46')];if(_0x158d97[_0x8711('0x50')]['includeAll']){_0x5dfb08[_0x8711('0x5f')]=[{'all':!![]}];}_0x5dfb08=_[_0x8711('0x5c')]({},_0x5dfb08,_0x158d97[_0x8711('0x5e')]);return db[_0x8711('0x4d')][_0x8711('0x65')](_0x5dfb08)[_0x8711('0x19')](handleEntityNotFound(_0x3c03bf,null))[_0x8711('0x19')](respondWithResult(_0x3c03bf,null))[_0x8711('0x23')](handleError(_0x3c03bf,null));};exports[_0x8711('0x66')]=function(_0x397c02,_0x5706f5){var _0x2d4142=null;_0x397c02[_0x8711('0x67')][_0x8711('0x68')]['split'](',')[_0x8711('0x69')](_0x19f845=>{if(_0x19f845[_0x8711('0x6a')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x19f845['trim']())){_0x2d4142=new APIBadRequestError('\x22'+_0x19f845['trim']()+_0x8711('0x6b'));}});if(_0x2d4142){return handleError(_0x5706f5,null)(_0x2d4142);}return db[_0x8711('0x4d')]['create'](_0x397c02[_0x8711('0x67')],{})[_0x8711('0x19')](function(_0x4e6d39){var _0x1c4c70=_0x397c02[_0x8711('0x6c')][_0x8711('0x2d')]({'plain':!![]});if(!_0x1c4c70)throw new Error(_0x8711('0x6d'));if(_0x1c4c70['role']===_0x8711('0x6c')){var _0xf5326c=_0x4e6d39['get']({'plain':!![]});var _0x3ceb32=_0x8711('0x2e');return db['UserProfileSection'][_0x8711('0x65')]({'where':{'name':_0x3ceb32,'userProfileId':_0x1c4c70['userProfileId']},'raw':!![]})[_0x8711('0x19')](function(_0x3c86d3){if(_0x3c86d3&&_0x3c86d3[_0x8711('0x6e')]===0x0){return db[_0x8711('0x2f')][_0x8711('0x66')]({'name':_0xf5326c[_0x8711('0x33')],'resourceId':_0xf5326c['id'],'type':_0x3c86d3[_0x8711('0x33')],'sectionId':_0x3c86d3['id']},{})[_0x8711('0x19')](function(){return _0x4e6d39;});}else{return _0x4e6d39;}})[_0x8711('0x23')](function(_0x320dae){logger[_0x8711('0x1f')](_0x8711('0x6f'),_0x320dae);throw _0x320dae;});}return _0x4e6d39;})[_0x8711('0x19')](respondWithResult(_0x5706f5,0xc9))[_0x8711('0x23')](handleError(_0x5706f5,null));};exports[_0x8711('0x2c')]=function(_0x368323,_0x3f5371){var _0x58a7ed=null;_0x368323[_0x8711('0x67')][_0x8711('0x68')][_0x8711('0x3b')](',')['forEach'](_0x4e3d63=>{if(_0x4e3d63[_0x8711('0x6a')]()!==''&&!wildcardUtils[_0x8711('0x70')](_0x4e3d63[_0x8711('0x6a')]())){_0x58a7ed=new APIBadRequestError('\x22'+_0x4e3d63['trim']()+_0x8711('0x6b'));}});if(_0x58a7ed){return handleError(_0x3f5371,null)(_0x58a7ed);}if(_0x368323['body']['id']){delete _0x368323[_0x8711('0x67')]['id'];}return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x368323[_0x8711('0x61')]['id']},'include':[{'model':db['Pause'],'as':_0x8711('0x62')}]})[_0x8711('0x19')](handleEntityNotFound(_0x3f5371,null))[_0x8711('0x19')](saveUpdates(_0x368323['body'],null))[_0x8711('0x19')](respondWithResult(_0x3f5371,null))['catch'](handleError(_0x3f5371,null));};exports[_0x8711('0x30')]=function(_0x1491e5,_0x5f5d85){return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x1491e5[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x5f5d85,null))[_0x8711('0x19')](removeEntity(_0x5f5d85,null))[_0x8711('0x23')](handleError(_0x5f5d85,null));};exports[_0x8711('0x71')]=function(_0x1db6b8,_0x3bb1e1){return db[_0x8711('0x4d')]['describe']()[_0x8711('0x19')](respondWithResult(_0x3bb1e1,null))['catch'](handleError(_0x3bb1e1,null));};exports['addDisposition']=function(_0x98beca,_0x550bf1){if(_0x98beca[_0x8711('0x67')]['id']){delete _0x98beca[_0x8711('0x67')]['id'];}return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x98beca[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x550bf1,null))[_0x8711('0x19')](function(_0x176ce0){if(_0x176ce0){_0x98beca[_0x8711('0x67')][_0x8711('0x72')]=_0x176ce0['id'];return db[_0x8711('0x73')][_0x8711('0x66')](_0x98beca[_0x8711('0x67')]);}})[_0x8711('0x19')](respondWithResult(_0x550bf1,null))[_0x8711('0x23')](handleError(_0x550bf1,null));};exports[_0x8711('0x74')]=function(_0x3d9432,_0x490d0c){var _0x71037d={'raw':![],'where':{}};var _0x438c4b={};var _0x449713={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x3d9432['params']['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x490d0c,null))[_0x8711('0x19')](function(_0x510081){if(_0x510081){_0x438c4b[_0x8711('0x46')]=_[_0x8711('0x75')](db['Disposition']['rawAttributes']);_0x438c4b[_0x8711('0x50')]=_[_0x8711('0x75')](_0x3d9432[_0x8711('0x50')]);_0x438c4b[_0x8711('0x51')]=_[_0x8711('0x52')](_0x438c4b[_0x8711('0x46')],_0x438c4b[_0x8711('0x50')]);_0x71037d[_0x8711('0x53')]=_[_0x8711('0x52')](_0x438c4b[_0x8711('0x46')],qs[_0x8711('0x54')](_0x3d9432[_0x8711('0x50')][_0x8711('0x54')]));_0x71037d[_0x8711('0x53')]=_0x71037d['attributes'][_0x8711('0x64')]?_0x71037d[_0x8711('0x53')]:_0x438c4b[_0x8711('0x46')];if(!_0x3d9432['query'][_0x8711('0x55')]('nolimit')){_0x71037d[_0x8711('0x29')]=qs[_0x8711('0x29')](_0x3d9432[_0x8711('0x50')][_0x8711('0x29')]);_0x71037d[_0x8711('0x28')]=qs[_0x8711('0x28')](_0x3d9432[_0x8711('0x50')][_0x8711('0x28')]);}_0x71037d[_0x8711('0x57')]=qs[_0x8711('0x58')](_0x3d9432[_0x8711('0x50')][_0x8711('0x58')]);_0x71037d[_0x8711('0x59')]=qs[_0x8711('0x51')](_[_0x8711('0x5a')](_0x3d9432['query'],_0x438c4b[_0x8711('0x51')]));_0x71037d[_0x8711('0x59')][_0x8711('0x72')]=_0x510081['id'];if(_0x3d9432['query'][_0x8711('0x5b')]){_0x71037d[_0x8711('0x59')]=_[_0x8711('0x5c')](_0x71037d['where'],{'$or':_[_0x8711('0x4c')](_0x71037d['attributes'],function(_0x189142){var _0x5e70ce={};_0x5e70ce[_0x189142]={'$like':'%'+_0x3d9432[_0x8711('0x50')][_0x8711('0x5b')]+'%'};return _0x5e70ce;})});}_0x71037d=_[_0x8711('0x5c')]({},_0x71037d,_0x3d9432[_0x8711('0x5e')]);return db[_0x8711('0x73')][_0x8711('0x27')]({'where':_0x71037d[_0x8711('0x59')]})[_0x8711('0x19')](function(_0x15eb24){_0x449713['count']=_0x15eb24;if(_0x3d9432['query'][_0x8711('0x76')]){_0x71037d['include']=[{'all':!![]}];}return db[_0x8711('0x73')][_0x8711('0x77')](_0x71037d);})[_0x8711('0x19')](function(_0x5151fb){_0x449713['rows']=_0x5151fb;return _0x449713;});}})['then'](respondWithFilteredResult(_0x490d0c,_0x71037d))[_0x8711('0x23')](handleError(_0x490d0c,null));};exports[_0x8711('0x78')]=function(_0x330ed1,_0x2fbe50){return db['ChatWebsite']['find']({'where':{'id':_0x330ed1[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x2fbe50,null))[_0x8711('0x19')](function(_0x5d77c8){if(_0x5d77c8){return _0x5d77c8[_0x8711('0x78')](_0x330ed1[_0x8711('0x50')][_0x8711('0x79')]);}})['then'](respondWithStatusCode(_0x2fbe50,null))[_0x8711('0x23')](handleError(_0x2fbe50,null));};exports[_0x8711('0x7a')]=function(_0x2d5491,_0x27e061){if(_0x2d5491[_0x8711('0x67')]['id']){delete _0x2d5491['body']['id'];}return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x2d5491[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x27e061,null))[_0x8711('0x19')](function(_0x4d1eaa){if(_0x4d1eaa){_0x2d5491[_0x8711('0x67')][_0x8711('0x72')]=_0x4d1eaa['id'];return db[_0x8711('0x7b')][_0x8711('0x66')](_0x2d5491[_0x8711('0x67')]);}})['then'](respondWithResult(_0x27e061,null))[_0x8711('0x23')](handleError(_0x27e061,null));};exports[_0x8711('0x7c')]=function(_0x1ee4db,_0xa49d38){var _0x42b60d={'raw':![],'where':{}};var _0x3547c1={};var _0x24e569={'count':0x0,'rows':[]};return db[_0x8711('0x4d')][_0x8711('0x7d')]({'where':{'id':_0x1ee4db[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0xa49d38,null))['then'](function(_0x4903b2){if(_0x4903b2){_0x3547c1[_0x8711('0x46')]=_[_0x8711('0x75')](db[_0x8711('0x7b')]['rawAttributes']);_0x3547c1['query']=_[_0x8711('0x75')](_0x1ee4db[_0x8711('0x50')]);_0x3547c1[_0x8711('0x51')]=_[_0x8711('0x52')](_0x3547c1[_0x8711('0x46')],_0x3547c1[_0x8711('0x50')]);_0x42b60d['attributes']=_[_0x8711('0x52')](_0x3547c1[_0x8711('0x46')],qs[_0x8711('0x54')](_0x1ee4db[_0x8711('0x50')][_0x8711('0x54')]));_0x42b60d[_0x8711('0x53')]=_0x42b60d[_0x8711('0x53')]['length']?_0x42b60d[_0x8711('0x53')]:_0x3547c1[_0x8711('0x46')];if(!_0x1ee4db[_0x8711('0x50')]['hasOwnProperty'](_0x8711('0x56'))){_0x42b60d[_0x8711('0x29')]=qs[_0x8711('0x29')](_0x1ee4db[_0x8711('0x50')][_0x8711('0x29')]);_0x42b60d[_0x8711('0x28')]=qs['offset'](_0x1ee4db[_0x8711('0x50')][_0x8711('0x28')]);}_0x42b60d['order']=qs[_0x8711('0x58')](_0x1ee4db[_0x8711('0x50')][_0x8711('0x58')]);_0x42b60d['where']=qs['filters'](_[_0x8711('0x5a')](_0x1ee4db['query'],_0x3547c1[_0x8711('0x51')]));_0x42b60d[_0x8711('0x59')][_0x8711('0x72')]=_0x4903b2['id'];if(_0x1ee4db['query'][_0x8711('0x5b')]){_0x42b60d[_0x8711('0x59')]=_[_0x8711('0x5c')](_0x42b60d[_0x8711('0x59')],{'$or':_[_0x8711('0x4c')](_0x42b60d[_0x8711('0x53')],function(_0x437ebb){var _0x167437={};_0x167437[_0x437ebb]={'$like':'%'+_0x1ee4db[_0x8711('0x50')][_0x8711('0x5b')]+'%'};return _0x167437;})});}_0x42b60d=_[_0x8711('0x5c')]({},_0x42b60d,_0x1ee4db[_0x8711('0x5e')]);return db['CannedAnswer'][_0x8711('0x27')]({'where':_0x42b60d['where']})[_0x8711('0x19')](function(_0x4ee3f3){_0x24e569[_0x8711('0x27')]=_0x4ee3f3;if(_0x1ee4db[_0x8711('0x50')][_0x8711('0x76')]){_0x42b60d[_0x8711('0x5f')]=[{'all':!![]}];}return db[_0x8711('0x7b')][_0x8711('0x77')](_0x42b60d);})[_0x8711('0x19')](function(_0x19391b){_0x24e569[_0x8711('0x7e')]=_0x19391b;return _0x24e569;});}})[_0x8711('0x19')](respondWithFilteredResult(_0xa49d38,_0x42b60d))[_0x8711('0x23')](handleError(_0xa49d38,null));};exports[_0x8711('0x7f')]=function(_0x2f120a,_0x58f6a1){return db[_0x8711('0x4d')]['find']({'where':{'id':_0x2f120a['params']['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x58f6a1,null))['then'](function(_0x42ac03){if(_0x42ac03){return _0x42ac03[_0x8711('0x7f')](_0x2f120a['query'][_0x8711('0x79')]);}})[_0x8711('0x19')](respondWithStatusCode(_0x58f6a1,null))[_0x8711('0x23')](handleError(_0x58f6a1,null));};exports[_0x8711('0x80')]=function(_0x2953fa,_0x32ddbc){_0x2953fa[_0x8711('0x67')][_0x8711('0x81')]=_0x2953fa[_0x8711('0x82')][_0x8711('0x83')];return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x2953fa['params']['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x32ddbc,null))[_0x8711('0x19')](saveUpdates(_0x2953fa[_0x8711('0x67')],null))[_0x8711('0x19')](respondWithResult(_0x32ddbc,null))[_0x8711('0x23')](handleError(_0x32ddbc,null));};exports['addAvatar']=function(_0x34f15b,_0x117bce){_0x34f15b[_0x8711('0x67')][_0x8711('0x84')]=_0x34f15b[_0x8711('0x82')][_0x8711('0x83')];return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x34f15b[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x117bce,null))['then'](saveUpdates(_0x34f15b[_0x8711('0x67')],null))[_0x8711('0x19')](respondWithResult(_0x117bce,null))['catch'](handleError(_0x117bce,null));};exports['addCustomerAvatar']=function(_0x4bd230,_0x1744ca){_0x4bd230['body'][_0x8711('0x85')]=_0x4bd230[_0x8711('0x82')][_0x8711('0x83')];return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x4bd230[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x1744ca,null))[_0x8711('0x19')](saveUpdates(_0x4bd230[_0x8711('0x67')],null))[_0x8711('0x19')](respondWithResult(_0x1744ca,null))['catch'](handleError(_0x1744ca,null));};exports[_0x8711('0x86')]=function(_0x2e867c,_0x26662c){_0x2e867c['body']['systemAvatar']=_0x2e867c[_0x8711('0x82')][_0x8711('0x83')];return db['ChatWebsite'][_0x8711('0x65')]({'where':{'id':_0x2e867c['params']['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x26662c,null))[_0x8711('0x19')](saveUpdates(_0x2e867c[_0x8711('0x67')],null))[_0x8711('0x19')](respondWithResult(_0x26662c,null))['catch'](handleError(_0x26662c,null));};exports[_0x8711('0x87')]=function(_0x9ed045,_0x2c379d){var _0x304c63=path['join'](config[_0x8711('0x88')],_0x8711('0x89'));var _0x34437={'where':{'id':_0x9ed045['params']['id']},'attributes':['id',_0x8711('0x81')],'raw':!![]};var _0x1ff6a3=![];return require(_0x8711('0x8a'))[_0x8711('0x8b')]()[_0x8711('0x19')](function(_0x304e15){if(_0x304e15){_0x1ff6a3=_0x304e15[_0x8711('0x8c')];}})[_0x8711('0x19')](function(){return db['ChatWebsite'][_0x8711('0x65')](_0x34437);})[_0x8711('0x19')](handleEntityNotFound(_0x2c379d,null))[_0x8711('0x19')](function(_0x47113a){if(_0x47113a){if(!_['isNil'](_0x47113a[_0x8711('0x81')])){if(fs[_0x8711('0x8d')](path[_0x8711('0x8e')](config[_0x8711('0x88')],_0x8711('0x8f'),_0x47113a[_0x8711('0x81')]))&&_0x1ff6a3){_0x304c63=path[_0x8711('0x8e')](config[_0x8711('0x88')],_0x8711('0x8f'),_0x47113a[_0x8711('0x81')]);}}return _0x2c379d[_0x8711('0x90')](_0x304c63);}})['catch'](handleError(_0x2c379d,null));};exports[_0x8711('0x91')]=function(_0x2c41c9,_0xb3b31e){var _0x2a5542=path[_0x8711('0x8e')](config[_0x8711('0x88')],_0x8711('0x92'));var _0x2927b9={'where':{'id':_0x2c41c9[_0x8711('0x61')]['id']},'attributes':['id',_0x8711('0x84')],'raw':!![]};return db[_0x8711('0x4d')][_0x8711('0x65')](_0x2927b9)['then'](handleEntityNotFound(_0xb3b31e,null))[_0x8711('0x19')](function(_0x99e198){if(_0x99e198){if(!_[_0x8711('0x93')](_0x99e198[_0x8711('0x84')])){if(fs[_0x8711('0x8d')](path['join'](config[_0x8711('0x88')],_0x8711('0x94'),_0x99e198[_0x8711('0x84')]))){_0x2a5542=path[_0x8711('0x8e')](config[_0x8711('0x88')],_0x8711('0x94'),_0x99e198[_0x8711('0x84')]);}}return _0xb3b31e[_0x8711('0x90')](_0x2a5542);}})[_0x8711('0x23')](handleError(_0xb3b31e,null));};exports[_0x8711('0x95')]=function(_0x1bfa18,_0x2c4cad){var _0xd59a3=path[_0x8711('0x8e')](config[_0x8711('0x88')],_0x8711('0x96'));var _0x4fca3c={'where':{'id':_0x1bfa18[_0x8711('0x61')]['id']},'attributes':['id',_0x8711('0x85'),'showCustomerAvatar'],'raw':!![]};return db[_0x8711('0x4d')][_0x8711('0x65')](_0x4fca3c)[_0x8711('0x19')](handleEntityNotFound(_0x2c4cad,null))[_0x8711('0x19')](function(_0x3ae1a0){if(_0x3ae1a0){if(!_[_0x8711('0x93')](_0x3ae1a0['customerAvatar'])){if(fs['existsSync'](path[_0x8711('0x8e')](config['root'],'server/files/images/avatars/',_0x3ae1a0[_0x8711('0x85')]))&&_0x3ae1a0[_0x8711('0x97')]){_0xd59a3=path['join'](config['root'],'server/files/images/avatars/',_0x3ae1a0[_0x8711('0x85')]);}}return _0x2c4cad[_0x8711('0x90')](_0xd59a3);}})[_0x8711('0x23')](handleError(_0x2c4cad,null));};exports[_0x8711('0x98')]=function(_0x21426d,_0x400835){var _0x2e991=path[_0x8711('0x8e')](config['root'],_0x8711('0x99'));var _0x389dee={'where':{'id':_0x21426d[_0x8711('0x61')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x8711('0x4d')][_0x8711('0x65')](_0x389dee)[_0x8711('0x19')](handleEntityNotFound(_0x400835,null))[_0x8711('0x19')](function(_0xc2cb37){if(_0xc2cb37){if(!_['isNil'](_0xc2cb37[_0x8711('0x9a')])){if(fs['existsSync'](path[_0x8711('0x8e')](config[_0x8711('0x88')],_0x8711('0x94'),_0xc2cb37['systemAvatar']))){_0x2e991=path[_0x8711('0x8e')](config['root'],_0x8711('0x94'),_0xc2cb37[_0x8711('0x9a')]);}}return _0x400835['download'](_0x2e991);}})['catch'](handleError(_0x400835,null));};function checkWebsiteInterval(_0x2b605e){var _0x1e9e0d=_0x2b605e[_0x8711('0x9b')];if(!_0x1e9e0d){return Promise[_0x8711('0x9c')](_0x2b605e);}var _0x437ed3=_0x2b605e[_0x8711('0x9d')]||undefined;return _0x1e9e0d['ifTime'](_0x437ed3)[_0x8711('0x19')](function(_0x10aee7){if(!_0x10aee7){throw new APIOutOfIntervalError();}return _0x2b605e;});}exports[_0x8711('0x9e')]=function(_0x39e55b,_0xc9bcb1){var _0x4a7c22={'body':_0x39e55b[_0x8711('0x67')],'channel':_0x8711('0x9f')};var _0x12b610=[];var _0x4fe28c=[];var _0x3c118c={};var _0x5aeaea=![];if(_0x39e55b['body']['id']){delete _0x39e55b['body']['id'];}if(_[_0x8711('0x93')](_0x39e55b[_0x8711('0x67')][_0x8711('0xa0')])){throw new APIBadRequestError(_0x8711('0xa1'));}if(_[_0x8711('0x93')](_0x39e55b[_0x8711('0x67')]['mapKey'])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_['isEmpty'](_0x39e55b[_0x8711('0x67')][_0x8711('0x67')])){throw new APIBadRequestError(_0x8711('0xa2'));}var _0x6452ab=_0x39e55b['body']['customerIp']&&_0x39e55b[_0x8711('0x67')][_0x8711('0x3f')];return db[_0x8711('0xa3')]['describe']()[_0x8711('0x19')](function(_0x435d5d){if(!_0x435d5d){throw new Error(_0x8711('0xa4'));}_0x12b610=Object[_0x8711('0x75')](_0x435d5d)['filter'](function(_0x11edd6){return![_0x8711('0xa5'),_0x8711('0xa6')]['includes'](_0x11edd6);});_0x4fe28c=Object[_0x8711('0x75')](_0x435d5d)[_0x8711('0x5b')](function(_0x1f308f){return!['createdAt',_0x8711('0xa6'),'CompanyId','ListId'][_0x8711('0xa7')](_0x1f308f);});if(!_[_0x8711('0xa7')](_0x4fe28c,_0x39e55b[_0x8711('0x67')]['mapKey'])){throw new APIBadRequestError(_0x8711('0xa8')+_0x4fe28c[_0x8711('0x8e')](',\x20'));}_0x3c118c[_0x39e55b[_0x8711('0x67')][_0x8711('0xa9')]]=_0x39e55b[_0x8711('0x67')]['from'];})[_0x8711('0x19')](function(){return db[_0x8711('0x4d')]['find']({'where':{'id':_0x39e55b[_0x8711('0x61')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x8711('0xa3')],'as':'Contacts','where':_0x3c118c,'limit':0x1,'order':[['updatedAt',_0x8711('0xaa')]]}]},{'model':db[_0x8711('0xab')],'as':_0x8711('0xac')},{'model':db[_0x8711('0x9b')],'as':'Interval','include':[{'model':db[_0x8711('0x9b')],'as':_0x8711('0xad'),'attributes':['id',_0x8711('0xae')],'raw':!![]}]}]});})[_0x8711('0x19')](function(_0x50bd4b){if(!_0x50bd4b){throw new APINotFoundError(util[_0x8711('0x42')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x39e55b[_0x8711('0x61')]['id']));}if(_0x6452ab){return checkWebsiteInterval(_0x50bd4b);}return _0x50bd4b;})[_0x8711('0x19')](function(_0x4e4e28){_0x4a7c22[_0x8711('0xaf')]=_0x4e4e28;_0x4a7c22[_0x8711('0xb0')]=_[_0x8711('0xb1')](_0x4e4e28[_0x8711('0xac')],[_0x8711('0xb2')],[_0x8711('0xb3')]);if(_0x4a7c22[_0x8711('0xaf')][_0x8711('0xac')]){delete _0x4a7c22[_0x8711('0xaf')][_0x8711('0xac')];}_0x4a7c22[_0x8711('0xb4')]=_0x4e4e28[_0x8711('0xb5')]||{'id':_0x4e4e28[_0x8711('0xb6')]};if(_0x4a7c22['list']&&_0x4a7c22[_0x8711('0xb4')][_0x8711('0xb7')][_0x8711('0x64')]){return _0x4a7c22[_0x8711('0xb4')][_0x8711('0xb7')][0x0];}var _0x2b26b2=_[_0x8711('0xb8')](_0x39e55b['body'],{'firstName':_0x39e55b[_0x8711('0x67')][_0x8711('0xa0')],'ListId':_0x4e4e28[_0x8711('0xb6')]});_0x2b26b2[_0x39e55b[_0x8711('0x67')][_0x8711('0xa9')]]=_0x39e55b[_0x8711('0x67')][_0x8711('0xa0')];return db['CmContact'][_0x8711('0x66')](_0x2b26b2,{'fields':_0x12b610,'raw':!![]});})['then'](function(_0x43fe92){_0x4a7c22[_0x8711('0xb9')]=_0x43fe92;var _0x8ce7ae=createInteractionObject(_0x39e55b[_0x8711('0x61')]['id'],_0x39e55b['body'],_0x39e55b['headers'],_0x43fe92);var _0x45dae9={'ChatWebsiteId':_0x39e55b['params']['id']};if(_0x39e55b[_0x8711('0x67')][_0x8711('0xba')]){_0x45dae9[_0x8711('0xba')]=_0x39e55b[_0x8711('0x67')]['threadId'];_0x45dae9['closed']=![];return db[_0x8711('0xbb')][_0x8711('0x65')]({'where':_0x45dae9})[_0x8711('0x19')](function(_0x40574a){var _0x8e3893=_0x39e55b[_0x8711('0x67')][_0x8711('0x37')]&&_0x39e55b['body'][_0x8711('0x3f')];if(_0x40574a){_0x5aeaea=!![];return _0x40574a;}else if(!_0x8e3893&&_0x40574a&&_0x40574a[_0x8711('0xbc')]){throw new APIConflictError(_0x8711('0xbd'));}_0x8ce7ae[_0x8711('0xba')]=_0x39e55b['body'][_0x8711('0xba')];_0x8ce7ae[_0x8711('0xbe')]=_0x39e55b['body'][_0x8711('0xbe')];return db[_0x8711('0xbb')][_0x8711('0x66')](_0x8ce7ae);});}_0x45dae9[_0x8711('0xbf')]=_0x43fe92['id'];if(_0x39e55b[_0x8711('0x67')]['interaction']&&_0x39e55b[_0x8711('0x67')][_0x8711('0xc0')]['id']){_0x45dae9['id']=_0x39e55b['body'][_0x8711('0xc0')]['id'];return db[_0x8711('0xbb')][_0x8711('0x65')]({'where':_0x45dae9})[_0x8711('0x19')](function(_0x11daaa){var _0x165430=_0x39e55b[_0x8711('0x67')][_0x8711('0x37')]&&_0x39e55b[_0x8711('0x67')][_0x8711('0x3f')];if(!_0x165430&&_0x11daaa&&_0x11daaa[_0x8711('0xbc')]){throw new APIConflictError(_0x8711('0xbd'));}else if(_0x11daaa){_0x5aeaea=!![];return _0x11daaa;}else{return db['ChatInteraction'][_0x8711('0x66')](_0x8ce7ae);}});}return db[_0x8711('0xbb')][_0x8711('0x66')](_0x8ce7ae);})['then'](function(_0x3b1f25){if(!_0x5aeaea){return _0x3b1f25;}var _0xd28f60={'from':(_0x4a7c22[_0x8711('0xb9')][_0x8711('0x3c')]||'')+'\x20'+(_0x4a7c22[_0x8711('0xb9')][_0x8711('0x3d')]||'')};if(_0x39e55b['body'][_0x8711('0xba')]&&_0x39e55b[_0x8711('0x67')][_0x8711('0xc1')]&&_0x39e55b['body']['threadId']!=_0x39e55b[_0x8711('0x67')][_0x8711('0xc1')]){_0xd28f60[_0x8711('0xba')]=_0x39e55b['body'][_0x8711('0xc1')];}return _0x3b1f25[_0x8711('0x2c')](_0xd28f60);})[_0x8711('0x19')](function(_0x229a6a){_0x4a7c22[_0x8711('0xc0')]=_0x229a6a[_0x8711('0x2d')]({'plain':!![]});_0x4a7c22[_0x8711('0xc0')][_0x8711('0xc2')]=!_0x5aeaea;if(_0x4a7c22[_0x8711('0xc0')][_0x8711('0xc2')]){if(_0x4a7c22[_0x8711('0xaf')]['autoclose']){_0x4a7c22[_0x8711('0xb0')]['push']({'id':0x0,'priority':_0x4a7c22[_0x8711('0xb0')][_0x8711('0x64')]+0x1,'app':_0x8711('0xc3'),'appdata':_0x8711('0xc4'),'interval':_0x8711('0xc5')});}}return db[_0x8711('0xc6')][_0x8711('0x66')]({'body':_0x39e55b[_0x8711('0x67')][_0x8711('0x67')],'ChatWebsiteId':_0x39e55b[_0x8711('0x61')]['id'],'ChatInteractionId':_0x229a6a['id'],'direction':'in','ContactId':_0x4a7c22[_0x8711('0xb9')]['id'],'AttachmentId':_0x39e55b['body'][_0x8711('0xc7')]});})[_0x8711('0x19')](function(_0x3263d9){_0x4a7c22[_0x8711('0x21')]=_0x3263d9;if(!_0x4a7c22['interaction'][_0x8711('0xc8')]){return;}return db['User'][_0x8711('0x65')]({'attributes':['id',_0x8711('0x33')],'where':{'id':_0x4a7c22[_0x8711('0xc0')][_0x8711('0xc8')]}});})[_0x8711('0x19')](function(_0x3788f6){if(_0x3788f6){_0x4a7c22['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3788f6[_0x8711('0x33')]+','+(_0x4a7c22[_0x8711('0xaf')]['waitForTheAssignedAgent']||0xa),'interval':_0x8711('0xc5')});_0x4a7c22[_0x8711('0xc9')]=!![];}if(!_0x4a7c22[_0x8711('0xc0')][_0x8711('0xca')]){return;}return db[_0x8711('0xcb')][_0x8711('0x65')]({'attributes':['id',_0x8711('0x33')],'where':{'id':_0x4a7c22[_0x8711('0xc0')]['queueId']}});})['then'](function(_0x3f643c){if(_0x3f643c){_0x4a7c22['applications'][_0x8711('0xcc')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x3f643c[_0x8711('0x33')]+','+(_0x4a7c22[_0x8711('0xaf')][_0x8711('0xcd')]||0x12c),'interval':_0x8711('0xc5')});}return respondWithRpcPromise('Start','startRouting',_0x4a7c22);})[_0x8711('0x19')](function(_0x480f73){respondWithRpcPromise('EventManager','EventManager',{'event':_0x8711('0x9e'),'message':_0x480f73},client9002);return _0x480f73;})[_0x8711('0x19')](respondWithResult(_0xc9bcb1,null))['catch'](APIHandleError(_0xc9bcb1));};exports[_0x8711('0xce')]=function(_0x2ee2ed,_0x4456f3){var _0x5a3bf4,_0x192b72,_0x45ac86;var _0xee0bdf=[];var _0x5f368a={};var _0x103139=_0x2ee2ed['files']||[];var _0x556546=[];var _0x3d0d45;return db[_0x8711('0xa3')][_0x8711('0x71')]()[_0x8711('0x19')](function(_0x5bad74){if(!_0x5bad74){throw new db[(_0x8711('0xcf'))][(_0x8711('0xd0'))](_0x8711('0xd1'));}_0xee0bdf=_[_0x8711('0xd2')](_[_0x8711('0x75')](_0x5bad74),[_0x8711('0xa5'),_0x8711('0xa6'),'CompanyId',_0x8711('0xb6')]);if(_0x2ee2ed['body']['id']){delete _0x2ee2ed[_0x8711('0x67')]['id'];}if(_[_0x8711('0x93')](_0x2ee2ed[_0x8711('0x67')][_0x8711('0xa0')])){throw _0x4456f3[_0x8711('0x24')](0x1f4)[_0x8711('0x34')](new db['Sequelize'][(_0x8711('0xd0'))](_0x8711('0xd3')));}if(_[_0x8711('0x93')](_0x2ee2ed[_0x8711('0x67')][_0x8711('0x67')])||_0x2ee2ed[_0x8711('0x67')]['body']===''){throw _0x4456f3[_0x8711('0x24')](0x1f4)[_0x8711('0x34')](new db[(_0x8711('0xcf'))][(_0x8711('0xd0'))](_0x8711('0xd4')));}if(_[_0x8711('0x93')](_0x2ee2ed['body']['mapKeyOffline'])){throw _0x4456f3['status'](0x1f4)[_0x8711('0x34')](new db['Sequelize']['ValidationError'](_0x8711('0xd5')+_0xee0bdf));}if(!_[_0x8711('0xa7')](_0xee0bdf,_0x2ee2ed['body']['mapKeyOffline'])){throw _0x4456f3[_0x8711('0x24')](0x1f4)[_0x8711('0x34')](new db[(_0x8711('0xcf'))][(_0x8711('0xd0'))](_0x8711('0xd6')+_0xee0bdf));}_0x5f368a[_0x2ee2ed[_0x8711('0x67')][_0x8711('0xd7')]]=_0x2ee2ed[_0x8711('0x67')][_0x8711('0xa0')];})[_0x8711('0x19')](function(){return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x2ee2ed[_0x8711('0x61')]['id']},'include':[{'model':db[_0x8711('0xd8')],'as':'List'},{'model':db[_0x8711('0xd9')],'as':_0x8711('0xd9')}]});})[_0x8711('0x19')](handleEntityNotFound(_0x4456f3,null))['then'](function(_0x508ae7){if(_0x508ae7&&_0x508ae7['List']){_0x192b72=_0x508ae7;var _0xb544de=_[_0x8711('0xb8')](_0x2ee2ed[_0x8711('0x67')],{'firstName':_0x2ee2ed[_0x8711('0x67')][_0x8711('0xa0')],'phone':_0x2ee2ed[_0x8711('0x67')][_0x8711('0xa0')],'ListId':_0x508ae7[_0x8711('0xb6')]});_0xb544de[_0x2ee2ed[_0x8711('0x67')][_0x8711('0xd7')]]=_0x2ee2ed['body'][_0x8711('0xa0')];return db[_0x8711('0xa3')][_0x8711('0xda')]({'where':_0x5f368a,'defaults':_0xb544de});}})[_0x8711('0xdb')](function(_0x4b764f){if(_0x4b764f){_0x45ac86=_0x4b764f;var _0x3f5efe=fs[_0x8711('0xdc')](path['join'](config[_0x8711('0x88')],_0x8711('0xdd')),_0x8711('0xde'));var _0x1dfdad=ejs[_0x8711('0xdf')](_0x3f5efe,{'body':_[_0x8711('0xe0')](_0x2ee2ed[_0x8711('0x67')][_0x8711('0x67')]),'bodyTitle':_0x192b72[_0x8711('0xe1')]});return db[_0x8711('0xe2')][_0x8711('0x66')]({'body':_0x1dfdad,'plainBody':htmlToText['fromString'](_0x1dfdad),'ContactId':_0x4b764f['id'],'ChatWebsiteId':_0x192b72['id']});}})[_0x8711('0x19')](function(_0x2ff225){_0x3d0d45=_0x2ff225;if(_0x103139['length']){var _0x567adb=_0x103139[_0x8711('0x4c')](function(_0x4c755f){return{'name':_0x4c755f[_0x8711('0xe3')],'basename':_0x4c755f['filename'],'type':_0x4c755f[_0x8711('0xe4')],'ChatOfflineMessageId':_0x2ff225['id']};});_0x556546=_0x567adb[_0x8711('0x4c')](_0x26f0e5=>{var _0x4ed2e3={'filename':_0x26f0e5[_0x8711('0x33')],'path':path[_0x8711('0x8e')](config[_0x8711('0x88')],_0x8711('0xe5'),'files',_0x8711('0xe6'),_0x8711('0xe7'),_0x26f0e5['basename'])};return _0x4ed2e3;});if(!_0x192b72[_0x8711('0xe8')]){return db[_0x8711('0xe9')][_0x8711('0xea')](function(_0x35cc7d){return db[_0x8711('0xeb')][_0x8711('0xec')](_0x567adb,{'transaction':_0x35cc7d});});}}})[_0x8711('0x19')](function(){if(_0x3d0d45){_0x5a3bf4=_0x3d0d45;return db['MailAccount'][_0x8711('0x7d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x8711('0xed'),'raw':!![],'include':[{'model':db[_0x8711('0xee')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x8711('0x19')](function(_0x918e80){if(_0x918e80&&_0x918e80[_0x8711('0xed')]&&_0x192b72[_0x8711('0xef')]&&_0x192b72[_0x8711('0xf0')]){var _0x3c6f02=_0x918e80[_0x8711('0xf1')]();return respondWithRpcPromise(_0x8711('0xf2'),_0x8711('0xf3'),{'account':_0x3c6f02,'message':{'from':util[_0x8711('0x42')](_0x8711('0xf4'),_0x918e80[_0x8711('0x33')],_0x918e80[_0x8711('0xf5')]||_0x918e80[_0x8711('0xed')][_0x8711('0x6c')]),'to':_0x192b72[_0x8711('0xf0')],'subject':_0x192b72['offlineMessageSubject'],'html':_0x5a3bf4[_0x8711('0x67')],'attachments':_0x556546}},client9003)['then'](function(){return _0x5a3bf4;})[_0x8711('0x23')](function(_0x2c0ccb){logger[_0x8711('0x1f')](_0x2c0ccb);});}})[_0x8711('0x19')](function(){if(_0x192b72&&_0x192b72[_0x8711('0xe8')]&&_0x192b72[_0x8711('0xf6')]){var _0x5253ea=[];if(_0x103139['length']){_0x5253ea=_0x103139['map'](function(_0x43cc85){return{'name':_0x43cc85[_0x8711('0xe3')],'basename':_0x43cc85[_0x8711('0x83')],'type':_0x43cc85[_0x8711('0xe4')],'ChatOfflineMessageId':_0x3d0d45['id']};});}var _0x4476a2;if(!_['isNil'](_0x192b72['subjectOffline'])){var _0x5dd614=_[_0x8711('0x4c')](_0x2ee2ed[_0x8711('0x67')],function(_0x34d4e8){return _0x34d4e8;});var _0x16d6f0=_['toPairsIn'](_0x5dd614)[0x0];var _0x114a7c=_['mapValues'](_0x16d6f0,function(_0x392f22){return _0x392f22;});_0x4476a2=_0x114a7c[0x1][_0x192b72[_0x8711('0xf7')]];}var _0x3b4098={'from':_0x45ac86[_0x8711('0xf5')],'firstName':_0x45ac86[_0x8711('0x3c')],'lastName':_0x45ac86[_0x8711('0x3d')],'mapKey':_0x8711('0xf5'),'message':{'from':_0x45ac86[_0x8711('0xf5')],'to':_0x192b72['MailAccount'][_0x8711('0xf5')],'cc':'','subject':_[_0x8711('0x93')](_0x4476a2)?_0x192b72[_0x8711('0xf8')]:_0x4476a2,'messageId':'','sentAt':new Date(),'attach':_0x5253ea['length'],'attachments':_0x5253ea,'originChannel':_0x8711('0xf9'),'ChatWebsiteId':_0x192b72['id'],'ChatOfflineMessageId':_0x5a3bf4['id'],'originTo':_0x192b72[_0x8711('0xd9')][_0x8711('0xf5')]},'body':_0x5a3bf4[_0x8711('0x67')]};var _0x48e5ea={'account':{'id':_0x192b72[_0x8711('0xf6')]},'body':_0x3b4098,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x8711('0xfa'),'notifyMail',_0x48e5ea,client9001)['then'](function(){return _0x5a3bf4;})['catch'](function(_0x6826a0){logger[_0x8711('0x1f')](_0x6826a0);});}return;})[_0x8711('0x19')](function(){if(_0x5a3bf4){return _0x5a3bf4;}})['then'](respondWithResult(_0x4456f3,null))[_0x8711('0x23')](function(){for(var _0x2c7075 of _0x103139){var _0x3c1532=path['join'](config[_0x8711('0x88')],'server','files',_0x8711('0xe6'),_0x8711('0xe7'),_0x2c7075['filename']);fs_extra[_0x8711('0xfb')](_0x3c1532)[_0x8711('0x23')](function(_0x300256){logger[_0x8711('0x1f')](_0x8711('0xfc'),_0x3c1532,_0x300256);});}});};exports[_0x8711('0xfd')]=function(_0x50cd36,_0x23f318){return db['ChatInteraction']['find']({'where':{'id':_0x50cd36['params']['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x23f318,null))[_0x8711('0x19')](function(_0x4c939b){if(_0x4c939b){return _0x4c939b[_0x8711('0xfd')](_0x50cd36[_0x8711('0x67')][_0x8711('0x79')],_['omit'](_0x50cd36['body'],[_0x8711('0x79'),'id'])||{});}})[_0x8711('0x19')](respondWithResult(_0x23f318,null))[_0x8711('0x23')](handleError(_0x23f318,null));};exports[_0x8711('0xfe')]=function(_0x26c84c,_0x44a135){var _0x5ac2ba={'raw':![],'where':{}};var _0x4f8b93={};var _0x117616={'count':0x0,'rows':[]};return db[_0x8711('0x4d')][_0x8711('0x7d')]({'where':{'id':_0x26c84c['params']['id']}})['then'](handleEntityNotFound(_0x44a135,null))[_0x8711('0x19')](function(_0x451a44){if(_0x451a44){_0x4f8b93[_0x8711('0x46')]=_[_0x8711('0x75')](db[_0x8711('0xbb')][_0x8711('0x63')]);_0x4f8b93[_0x8711('0x50')]=_[_0x8711('0x75')](_0x26c84c[_0x8711('0x50')]);_0x4f8b93[_0x8711('0x51')]=_['intersection'](_0x4f8b93[_0x8711('0x46')],_0x4f8b93[_0x8711('0x50')]);_0x5ac2ba[_0x8711('0x53')]=_[_0x8711('0x52')](_0x4f8b93[_0x8711('0x46')],qs[_0x8711('0x54')](_0x26c84c[_0x8711('0x50')][_0x8711('0x54')]));_0x5ac2ba[_0x8711('0x53')]=_0x5ac2ba[_0x8711('0x53')][_0x8711('0x64')]?_0x5ac2ba[_0x8711('0x53')]:_0x4f8b93[_0x8711('0x46')];if(!_0x26c84c['query'][_0x8711('0x55')](_0x8711('0x56'))){_0x5ac2ba[_0x8711('0x29')]=qs[_0x8711('0x29')](_0x26c84c[_0x8711('0x50')][_0x8711('0x29')]);_0x5ac2ba['offset']=qs[_0x8711('0x28')](_0x26c84c[_0x8711('0x50')][_0x8711('0x28')]);}_0x5ac2ba['order']=qs[_0x8711('0x58')](_0x26c84c[_0x8711('0x50')][_0x8711('0x58')]);_0x5ac2ba['where']=qs[_0x8711('0x51')](_['pick'](_0x26c84c[_0x8711('0x50')],_0x4f8b93['filters']));_0x5ac2ba[_0x8711('0x59')][_0x8711('0x72')]=_0x451a44['id'];if(_0x26c84c[_0x8711('0x50')][_0x8711('0x5b')]){_0x5ac2ba[_0x8711('0x59')]=_[_0x8711('0x5c')](_0x5ac2ba[_0x8711('0x59')],{'$or':_[_0x8711('0x4c')](_0x5ac2ba[_0x8711('0x53')],function(_0x1ab1d9){var _0x4e0038={};_0x4e0038[_0x1ab1d9]={'$like':'%'+_0x26c84c[_0x8711('0x50')][_0x8711('0x5b')]+'%'};return _0x4e0038;})});}_0x5ac2ba=_[_0x8711('0x5c')]({},_0x5ac2ba,_0x26c84c['options']);return db[_0x8711('0xbb')][_0x8711('0x27')]({'where':_0x5ac2ba[_0x8711('0x59')]})[_0x8711('0x19')](function(_0x43c39c){_0x117616[_0x8711('0x27')]=_0x43c39c;if(_0x26c84c[_0x8711('0x50')][_0x8711('0x76')]){_0x5ac2ba[_0x8711('0x5f')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x8711('0xff')],'as':_0x8711('0x100'),'attributes':[_0x8711('0x33'),'fullname','internal'],'required':![]},{'model':db[_0x8711('0x101')],'as':_0x8711('0x102'),'attributes':['id',_0x8711('0x33'),_0x8711('0x103')],'where':_0x26c84c[_0x8711('0x50')][_0x8711('0x104')]?{'id':_0x26c84c[_0x8711('0x50')][_0x8711('0x104')]}:undefined,'required':_0x26c84c['query']['tag']?!![]:![]}];}return db[_0x8711('0xbb')][_0x8711('0x77')](_0x5ac2ba);})[_0x8711('0x19')](function(_0x1607f5){_0x117616[_0x8711('0x7e')]=_0x1607f5;return _0x117616;});}})[_0x8711('0x19')](respondWithFilteredResult(_0x44a135,_0x5ac2ba))[_0x8711('0x23')](handleError(_0x44a135,null));};exports[_0x8711('0x105')]=function(_0x4635bb,_0x69fe23){var _0x12c327=0x0;var _0x5656d4=0x0;var _0x498d54=![];var _0x496ef9;var _0x364c26;return db['ChatWebsite'][_0x8711('0x65')]({'where':{'id':_0x4635bb['params']['id']},'include':[{'model':db[_0x8711('0x9b')],'as':_0x8711('0x9b'),'include':[{'model':db[_0x8711('0x9b')],'as':_0x8711('0xad'),'attributes':['id',_0x8711('0xae')]}]}]})[_0x8711('0x19')](handleEntityNotFound(_0x69fe23,null))[_0x8711('0x19')](function(_0x453270){if(_0x453270){_0x496ef9=_0x453270;return _0x453270[_0x8711('0x106')]({'raw':!![]});}})['then'](function(_0x12a8fa){if(_0x496ef9){if(_0x12a8fa){_0x364c26=_0x12a8fa;}}return require(_0x8711('0x8a'))['getLicense']();})[_0x8711('0x19')](function(_0x5d83ab){if(_0x5d83ab){_0x5656d4=_0x5d83ab[_0x8711('0x107')];_0x498d54=_0x5d83ab['custom'];}})[_0x8711('0x19')](function(){return db[_0x8711('0xbb')]['count']({'where':{'closed':![]}});})['then'](function(_0x3d7a1c){_0x12c327=_0x3d7a1c;if(_0x5656d4&&_0x3d7a1c>_0x5656d4){return db[_0x8711('0x108')]['findOne']({'where':{'id':0x1}})[_0x8711('0x19')](function(_0x599431){if(_0x599431){_0x599431[_0x8711('0x109')](_0x8711('0x10a'));}});}})[_0x8711('0x19')](function(){var _0x4db598=_0x496ef9[_0x8711('0x9b')];var _0x6756e3=_0x496ef9[_0x8711('0x9d')]||undefined;return _0x4db598?_0x4db598[_0x8711('0x10b')](_0x6756e3):!![];})['then'](function(_0x4e828a){var _0x581b97=fs['readFileSync'](path['join'](config['root'],_0x8711('0x10c')),_0x8711('0xde'));var _0x34a20d='3.10.1';var _0x5f29c5=![];var _0x10757e,_0x45676b;if(_0x4635bb[_0x8711('0x10d')]['referer']){_0x10757e=new URL(_0x4635bb[_0x8711('0x10d')][_0x8711('0x3f')])[_0x8711('0x10e')];}else if(_0x4635bb[_0x8711('0x10d')]['origin']){_0x10757e=new URL(_0x4635bb[_0x8711('0x10d')]['origin'])[_0x8711('0x10e')];}else{_0x10757e=_0x8711('0x10f');}_0x45676b=typeof _0x496ef9[_0x8711('0x68')][_0x8711('0x3b')](',')[_0x8711('0x65')](function(_0x2cecbc){return wildcardUtils[_0x8711('0x110')](_0x2cecbc,_0x10757e);})!=='undefined';var _0x1e32f8={'chatVersion':_0x34a20d,'chatWebsiteAddressOrigin':_0x45676b?_0x10757e:_0x496ef9[_0x8711('0x68')],'remote':_0x496ef9['remote'],'query':querystring[_0x8711('0x1d')](_[_0x8711('0x5c')](_0x496ef9['get']({'plain':!![]}),{'customerIp':_0x4635bb[_0x8711('0x10d')]['x-forwarded-for']||_0x4635bb[_0x8711('0x10d')]['x-real-ip']||_0x4635bb[_0x8711('0x111')]['remoteAddress']||_0x4635bb['ip'],'referer':_0x4635bb['headers'][_0x8711('0x3f')],'openedInteractions':_0x12c327,'maxInteractions':_0x5656d4,'virtual':_0x498d54[_0x8711('0x107')],'online':_0x4e828a,'custom':_0x498d54,'address':_0x45676b?_0x10757e:null}))[_0x8711('0x112')](/'/g,'\x5c\x27')};_0x69fe23[_0x8711('0x34')](ejs[_0x8711('0xdf')](Mustache['render'](_0x581b97,_0x1e32f8),{'proactiveActions':_0x364c26,'alignment':_0x496ef9[_0x8711('0x113')],'verticalAlignment':_0x496ef9[_0x8711('0x114')],'div_color':_0x496ef9[_0x8711('0x103')],'labelText':_0x496ef9[_0x8711('0x115')],'text_color':_0x496ef9[_0x8711('0x116')],'text_button_color':_0x496ef9[_0x8711('0x117')],'button_color':_0x496ef9[_0x8711('0x118')],'background_color':_0x496ef9[_0x8711('0x119')],'hideWhenOffline':_0x496ef9[_0x8711('0x11a')],'intervalId':_0x496ef9[_0x8711('0x11b')],'isDevelopment':_0x5f29c5,'chatVersion':_0x34a20d}));})['catch'](handleError(_0x69fe23,null));};exports[_0x8711('0x11c')]=function(_0x44b35c,_0x865cec){var _0xa525a6=_0x44b35c[_0x8711('0x61')]['id'];var _0x168ff0=_0x44b35c[_0x8711('0x67')];var _0x3a347a=0xc8;var _0x152af9=null;return db['sequelize'][_0x8711('0xea')]({'isolationLevel':db[_0x8711('0xe9')][_0x8711('0x11d')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x23a174){return db[_0x8711('0x4d')][_0x8711('0x7d')]({'where':{'id':_0xa525a6},'transaction':_0x23a174})[_0x8711('0x19')](function(_0x30654f){if(_0x30654f){return db[_0x8711('0xab')][_0x8711('0x30')]({'where':{'ChatWebsiteId':_0xa525a6},'transaction':_0x23a174})[_0x8711('0x19')](function(){var _0x2819d1=_['map'](_0x168ff0,function(_0x1d9d6c){_0x1d9d6c[_0x8711('0x72')]=_0xa525a6;return _0x1d9d6c;});return db[_0x8711('0xab')][_0x8711('0xec')](_0x2819d1,{'transaction':_0x23a174});});}else{_0x3a347a=0x194;_0x152af9=[];}});})['then'](function(){if(_0x3a347a!==0x194){return db[_0x8711('0xab')][_0x8711('0x11e')]({'where':{'ChatWebsiteId':_0xa525a6},'order':_0x8711('0xb2')})['then'](function(_0x3d3d38){_0x152af9=_0x3d3d38;});}})[_0x8711('0x23')](function(_0x262ad5){_0x3a347a=0x1f4;logger[_0x8711('0x1f')](_0x262ad5[_0x8711('0x32')]);if(_0x262ad5[_0x8711('0x33')]){delete _0x262ad5[_0x8711('0x33')];}_0x152af9=_0x262ad5;})[_0x8711('0x11f')](function(){if(_0x152af9===null){_0x865cec[_0x8711('0x31')](_0x3a347a);}else{if(_0x3a347a===0x1f4){_0x865cec['status'](_0x3a347a)['send'](_0x152af9);}else{_0x865cec[_0x8711('0x24')](_0x3a347a)[_0x8711('0x25')](_0x152af9);}}});};exports[_0x8711('0x120')]=function(_0x355abe,_0x40923b){var _0x1f38e4={};var _0x3b8182={};var _0x522b07;var _0x4737a3;return db[_0x8711('0x4d')][_0x8711('0x7d')]({'where':{'id':_0x355abe['params']['id']}})['then'](handleEntityNotFound(_0x40923b,null))[_0x8711('0x19')](function(_0x11bc79){if(_0x11bc79){_0x522b07=_0x11bc79;_0x3b8182[_0x8711('0x46')]=_[_0x8711('0x75')](db['ChatApplication'][_0x8711('0x63')]);_0x3b8182[_0x8711('0x50')]=_[_0x8711('0x75')](_0x355abe[_0x8711('0x50')]);_0x3b8182[_0x8711('0x51')]=_[_0x8711('0x52')](_0x3b8182[_0x8711('0x46')],_0x3b8182[_0x8711('0x50')]);_0x1f38e4[_0x8711('0x53')]=_[_0x8711('0x52')](_0x3b8182[_0x8711('0x46')],qs[_0x8711('0x54')](_0x355abe[_0x8711('0x50')][_0x8711('0x54')]));_0x1f38e4['attributes']=_0x1f38e4[_0x8711('0x53')][_0x8711('0x64')]?_0x1f38e4[_0x8711('0x53')]:_0x3b8182['model'];_0x1f38e4[_0x8711('0x57')]=qs[_0x8711('0x58')](_0x355abe[_0x8711('0x50')][_0x8711('0x58')]);_0x1f38e4[_0x8711('0x59')]=qs[_0x8711('0x51')](_[_0x8711('0x5a')](_0x355abe[_0x8711('0x50')],_0x3b8182[_0x8711('0x51')]));if(_0x355abe[_0x8711('0x50')][_0x8711('0x5b')]){_0x1f38e4[_0x8711('0x59')]=_['merge'](_0x1f38e4[_0x8711('0x59')],{'$or':_[_0x8711('0x4c')](_0x1f38e4[_0x8711('0x53')],function(_0x15fb7d){var _0x42f6d6={};_0x42f6d6[_0x15fb7d]={'$like':'%'+_0x355abe[_0x8711('0x50')][_0x8711('0x5b')]+'%'};return _0x42f6d6;})});}_0x1f38e4=_['merge']({},_0x1f38e4,_0x355abe[_0x8711('0x5e')]);return _0x522b07[_0x8711('0x120')](_0x1f38e4);}})['then'](function(_0x490dfc){if(_0x490dfc){_0x4737a3=_0x490dfc[_0x8711('0x64')];if(!_0x355abe[_0x8711('0x50')][_0x8711('0x55')](_0x8711('0x56'))){_0x1f38e4[_0x8711('0x29')]=qs[_0x8711('0x29')](_0x355abe['query'][_0x8711('0x29')]);_0x1f38e4[_0x8711('0x28')]=qs[_0x8711('0x28')](_0x355abe[_0x8711('0x50')][_0x8711('0x28')]);}return _0x522b07[_0x8711('0x120')](_0x1f38e4);}})[_0x8711('0x19')](function(_0x4602ae){if(_0x4602ae){return _0x4602ae?{'count':_0x4737a3,'rows':_0x4602ae}:null;}})[_0x8711('0x19')](respondWithResult(_0x40923b,null))[_0x8711('0x23')](handleError(_0x40923b,null));};exports[_0x8711('0x121')]=function(_0x46abe9,_0x316d74){return db['chatProactiveAction'][_0x8711('0x65')]({'where':{'id':_0x46abe9['params']['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x316d74,null))[_0x8711('0x19')](function(_0x2b05cb){if(_0x2b05cb){return _0x2b05cb['addProactiveActions'](_0x46abe9['body'][_0x8711('0x79')],_[_0x8711('0x122')](_0x46abe9['body'],[_0x8711('0x79'),'id'])||{});}})['then'](respondWithResult(_0x316d74,null))[_0x8711('0x23')](handleError(_0x316d74,null));};exports[_0x8711('0x106')]=function(_0x4fd365,_0x41d14b){var _0x523515={};var _0x16e604={};var _0x423e17;var _0x3b4b04;return db['ChatWebsite'][_0x8711('0x7d')]({'where':{'id':_0x4fd365['params']['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x41d14b,null))[_0x8711('0x19')](function(_0x1bfc1a){if(_0x1bfc1a){_0x423e17=_0x1bfc1a;_0x16e604[_0x8711('0x46')]=_[_0x8711('0x75')](db[_0x8711('0x123')][_0x8711('0x63')]);_0x16e604[_0x8711('0x50')]=_['keys'](_0x4fd365[_0x8711('0x50')]);_0x16e604[_0x8711('0x51')]=_[_0x8711('0x52')](_0x16e604['model'],_0x16e604[_0x8711('0x50')]);_0x523515[_0x8711('0x53')]=_[_0x8711('0x52')](_0x16e604[_0x8711('0x46')],qs[_0x8711('0x54')](_0x4fd365[_0x8711('0x50')]['fields']));_0x523515['attributes']=_0x523515[_0x8711('0x53')][_0x8711('0x64')]?_0x523515[_0x8711('0x53')]:_0x16e604[_0x8711('0x46')];_0x523515[_0x8711('0x57')]=qs[_0x8711('0x58')](_0x4fd365[_0x8711('0x50')]['sort']);_0x523515[_0x8711('0x59')]=qs[_0x8711('0x51')](_[_0x8711('0x5a')](_0x4fd365[_0x8711('0x50')],_0x16e604[_0x8711('0x51')]));if(_0x4fd365[_0x8711('0x50')][_0x8711('0x5b')]){_0x523515[_0x8711('0x59')]=_[_0x8711('0x5c')](_0x523515[_0x8711('0x59')],{'$or':_[_0x8711('0x4c')](_0x523515[_0x8711('0x53')],function(_0x1dd734){var _0x2f9a08={};_0x2f9a08[_0x1dd734]={'$like':'%'+_0x4fd365[_0x8711('0x50')][_0x8711('0x5b')]+'%'};return _0x2f9a08;})});}_0x523515=_[_0x8711('0x5c')]({},_0x523515,_0x4fd365[_0x8711('0x5e')]);return _0x423e17[_0x8711('0x106')](_0x523515);}})[_0x8711('0x19')](function(_0x41ee87){if(_0x41ee87){_0x3b4b04=_0x41ee87['length'];if(!_0x4fd365[_0x8711('0x50')][_0x8711('0x55')](_0x8711('0x56'))){_0x523515[_0x8711('0x29')]=qs[_0x8711('0x29')](_0x4fd365[_0x8711('0x50')][_0x8711('0x29')]);_0x523515['offset']=qs[_0x8711('0x28')](_0x4fd365['query'][_0x8711('0x28')]);}return _0x423e17[_0x8711('0x106')](_0x523515);}})[_0x8711('0x19')](function(_0x218304){if(_0x218304){return _0x218304?{'count':_0x3b4b04,'rows':_0x218304}:null;}})[_0x8711('0x19')](respondWithResult(_0x41d14b,null))['catch'](handleError(_0x41d14b,null));};exports[_0x8711('0x124')]=function(_0x31f9f3,_0x416f56){var _0x374e46=_0x31f9f3['query'][_0x8711('0x125')]===_0x8711('0x126')?'offlineForm':_0x8711('0x127');return db['ChatWebsite'][_0x8711('0x65')]({'attributes':['id',_0x374e46],'where':{'id':_0x31f9f3[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x416f56,null))[_0x8711('0x19')](function(_0x2a94c1){if(_0x2a94c1){var _0x315c0f=_0x2a94c1[_0x374e46];var _0xfce89=_0x315c0f&&_0x315c0f[_0x8711('0x128')]?_0x315c0f[_0x8711('0x128')]:[];_0x416f56[_0x8711('0x34')]({'fromKey':_[_0x8711('0x93')](_0x315c0f[_0x8711('0x129')])?undefined:_0x315c0f[_0x8711('0x129')],'count':_0xfce89[_0x8711('0x64')],'rows':_0xfce89});}})[_0x8711('0x23')](handleError(_0x416f56,null));};exports[_0x8711('0x12a')]=function(_0xb22041,_0xa65247){var _0x27e5eb={'raw':![],'where':{}};var _0x7e4f82={};var _0x16c254={'count':0x0,'rows':[]};return db[_0x8711('0x4d')]['findOne']({'where':{'id':_0xb22041['params']['id']}})[_0x8711('0x19')](handleEntityNotFound(_0xa65247,null))[_0x8711('0x19')](function(_0x387cc9){if(_0x387cc9){_0x7e4f82[_0x8711('0x46')]=_['keys'](db[_0x8711('0xe2')]['rawAttributes']);_0x7e4f82[_0x8711('0x50')]=_[_0x8711('0x75')](_0xb22041[_0x8711('0x50')]);_0x7e4f82['filters']=_[_0x8711('0x52')](_0x7e4f82[_0x8711('0x46')],_0x7e4f82['query']);_0x27e5eb['attributes']=_[_0x8711('0x52')](_0x7e4f82[_0x8711('0x46')],qs[_0x8711('0x54')](_0xb22041['query']['fields']));_0x27e5eb[_0x8711('0x53')]=_0x27e5eb['attributes'][_0x8711('0x64')]?_0x27e5eb[_0x8711('0x53')]:_0x7e4f82[_0x8711('0x46')];if(!_0xb22041[_0x8711('0x50')][_0x8711('0x55')](_0x8711('0x56'))){_0x27e5eb['limit']=qs[_0x8711('0x29')](_0xb22041[_0x8711('0x50')][_0x8711('0x29')]);_0x27e5eb[_0x8711('0x28')]=qs['offset'](_0xb22041[_0x8711('0x50')]['offset']);}_0x27e5eb[_0x8711('0x57')]=qs[_0x8711('0x58')](_0xb22041[_0x8711('0x50')][_0x8711('0x58')]);_0x27e5eb[_0x8711('0x59')]=qs['filters'](_['pick'](_0xb22041[_0x8711('0x50')],_0x7e4f82[_0x8711('0x51')]));_0x27e5eb[_0x8711('0x59')]['ChatWebsiteId']=_0x387cc9['id'];if(_0xb22041['query']['filter']){_0x27e5eb[_0x8711('0x59')]=_[_0x8711('0x5c')](_0x27e5eb[_0x8711('0x59')],{'$or':_[_0x8711('0x4c')](_0x27e5eb[_0x8711('0x53')],function(_0x297c87){var _0x38f69f={};_0x38f69f[_0x297c87]={'$like':'%'+_0xb22041['query'][_0x8711('0x5b')]+'%'};return _0x38f69f;})});}_0x27e5eb=_[_0x8711('0x5c')]({},_0x27e5eb,_0xb22041[_0x8711('0x5e')]);return db[_0x8711('0xe2')]['count']({'where':_0x27e5eb['where']})[_0x8711('0x19')](function(_0x1f59be){_0x16c254['count']=_0x1f59be;if(_0xb22041[_0x8711('0x50')][_0x8711('0x76')]){_0x27e5eb['include']=[{'all':!![]}];}else{_0x27e5eb[_0x8711('0x5f')]=[{'model':db[_0x8711('0xa3')],'as':_0x8711('0x12b'),'required':![]},{'model':db[_0x8711('0xeb')],'as':_0x8711('0x12c'),'required':![]}];}return db[_0x8711('0xe2')][_0x8711('0x77')](_0x27e5eb);})[_0x8711('0x19')](function(_0x1814aa){_0x16c254[_0x8711('0x7e')]=_0x1814aa;return _0x16c254;});}})[_0x8711('0x19')](respondWithFilteredResult(_0xa65247,_0x27e5eb))[_0x8711('0x23')](handleError(_0xa65247,null));};exports[_0x8711('0x12d')]=function(_0x324484,_0x337c9f){return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x324484[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x337c9f,null))[_0x8711('0x19')](function(_0x34aab4){if(_0x34aab4){return _0x34aab4[_0x8711('0x12d')](_0x324484[_0x8711('0x67')][_0x8711('0x79')],_[_0x8711('0x122')](_0x324484[_0x8711('0x67')],[_0x8711('0x79'),'id'])||{})[_0x8711('0xdb')](function(_0x1b253c){for(var _0x4cc632=0x0;_0x4cc632<_0x324484[_0x8711('0x67')][_0x8711('0x79')]['length'];_0x4cc632+=0x1){socket[_0x8711('0x12e')](_0x8711('0x12f'),{'UserId':Number(_0x324484['body']['ids'][_0x4cc632]),'ChatWebsiteId':Number(_0x324484['params']['id'])});}return _0x1b253c;});}})[_0x8711('0x19')](respondWithResult(_0x337c9f,null))[_0x8711('0x23')](handleError(_0x337c9f,null));};exports[_0x8711('0x130')]=function(_0x26e74f,_0x3eb389){return db['ChatWebsite']['find']({'where':{'id':_0x26e74f[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x3eb389,null))['then'](function(_0x49dab7){if(_0x49dab7){return _0x49dab7[_0x8711('0x130')](_0x26e74f[_0x8711('0x50')][_0x8711('0x79')])[_0x8711('0x19')](function(){if(_['isArray'](_0x26e74f[_0x8711('0x50')]['ids'])){for(var _0x284556=0x0;_0x284556<_0x26e74f[_0x8711('0x50')][_0x8711('0x79')]['length'];_0x284556+=0x1){socket[_0x8711('0x12e')](_0x8711('0x131'),{'UserId':Number(_0x26e74f[_0x8711('0x50')][_0x8711('0x79')][_0x284556]),'ChatWebsiteId':Number(_0x26e74f[_0x8711('0x61')]['id'])});}}else{socket['emit'](_0x8711('0x131'),{'UserId':Number(_0x26e74f[_0x8711('0x50')][_0x8711('0x79')]),'ChatWebsiteId':Number(_0x26e74f[_0x8711('0x61')]['id'])});}});}})[_0x8711('0x19')](respondWithStatusCode(_0x3eb389,null))[_0x8711('0x23')](handleError(_0x3eb389,null));};exports[_0x8711('0x132')]=function(_0x33fcac,_0x13ddd0){var _0x2e7cb5={};var _0x455c1f={};var _0x1a0191;var _0xc335ea;return db[_0x8711('0x4d')][_0x8711('0x7d')]({'where':{'id':_0x33fcac['params']['id']}})['then'](handleEntityNotFound(_0x13ddd0,null))[_0x8711('0x19')](function(_0x32b985){if(_0x32b985){_0x1a0191=_0x32b985;_0x455c1f[_0x8711('0x46')]=_[_0x8711('0x75')](db[_0x8711('0xff')][_0x8711('0x63')]);_0x455c1f[_0x8711('0x50')]=_[_0x8711('0x75')](_0x33fcac[_0x8711('0x50')]);_0x455c1f[_0x8711('0x51')]=_[_0x8711('0x52')](_0x455c1f['model'],_0x455c1f[_0x8711('0x50')]);_0x2e7cb5['attributes']=_['intersection'](_0x455c1f[_0x8711('0x46')],qs[_0x8711('0x54')](_0x33fcac['query']['fields']));_0x2e7cb5[_0x8711('0x53')]=_0x2e7cb5[_0x8711('0x53')][_0x8711('0x64')]?_0x2e7cb5[_0x8711('0x53')]:_0x455c1f['model'];_0x2e7cb5[_0x8711('0x57')]=qs[_0x8711('0x58')](_0x33fcac[_0x8711('0x50')]['sort']);_0x2e7cb5[_0x8711('0x59')]=qs[_0x8711('0x51')](_[_0x8711('0x5a')](_0x33fcac['query'],_0x455c1f[_0x8711('0x51')]));if(_0x33fcac[_0x8711('0x50')]['filter']){_0x2e7cb5[_0x8711('0x59')]=_['merge'](_0x2e7cb5[_0x8711('0x59')],{'$or':_['map'](_0x2e7cb5[_0x8711('0x53')],function(_0x363e16){var _0x12d40d={};_0x12d40d[_0x363e16]={'$like':'%'+_0x33fcac[_0x8711('0x50')][_0x8711('0x5b')]+'%'};return _0x12d40d;})});}_0x2e7cb5=_[_0x8711('0x5c')]({},_0x2e7cb5,_0x33fcac[_0x8711('0x5e')]);return _0x1a0191[_0x8711('0x132')](_0x2e7cb5);}})[_0x8711('0x19')](function(_0x6d4ce3){if(_0x6d4ce3){_0xc335ea=_0x6d4ce3[_0x8711('0x64')];if(!_0x33fcac['query'][_0x8711('0x55')](_0x8711('0x56'))){_0x2e7cb5[_0x8711('0x29')]=qs[_0x8711('0x29')](_0x33fcac[_0x8711('0x50')][_0x8711('0x29')]);_0x2e7cb5[_0x8711('0x28')]=qs[_0x8711('0x28')](_0x33fcac[_0x8711('0x50')][_0x8711('0x28')]);}return _0x1a0191[_0x8711('0x132')](_0x2e7cb5);}})[_0x8711('0x19')](function(_0x243a0e){if(_0x243a0e){return _0x243a0e?{'count':_0xc335ea,'rows':_0x243a0e}:null;}})['then'](respondWithResult(_0x13ddd0,null))[_0x8711('0x23')](handleError(_0x13ddd0,null));};
\ No newline at end of file
+var _0x202c=['offlineMessageSubject','toPairsIn','subjectOffline','Chat','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','fullname','internal','Tags','color','tag','getSnippet','interval','getProactiveActions','custom','increment','chatLicenseExceeded','readFileSync','origin','http://localhost:9000','address','remote','x-real-ip','connection','replace','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','bulkCreate','stack','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','onlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','mustache','ejs','fs-extra','lodash','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','api','../../config/environment','APIBadRequestError','APINotFoundError','../../errors/api','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','result','message','sendStatus','status','json','undefined','limit','offset','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','name','send','user-agent-parser','setUA','user-agent','getResult','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','unknown','version','device','model','vendor','%s\x20%s\x20%s','type','stringify','index','Pause','ChatWebsite','rawAttributes','fieldName','key','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','length','find','catch','create','forEach','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','testWildcardValidity','params','mandatoryDispositionPause','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addCustomerAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','agentAvatar','join','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','Interval','resolve','timezone','ifTime','notify','chat','from','From\x20is\x20mandatory','mapKey','isEmpty','Body\x20is\x20mandatory','CmContact','createdAt','updatedAt','CompanyId','includes','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','List','Contacts','DESC','Intervals','account','orderBy','Applications','priority','list','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','applications','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','ListId','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','utf8','render','fromString','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','SendMail','sendMail','\x22%s\x22\x20<%s>','email','user','forwardOfflineAddress'];(function(_0x2365db,_0x4ea500){var _0x2bee41=function(_0x617f7b){while(--_0x617f7b){_0x2365db['push'](_0x2365db['shift']());}};_0x2bee41(++_0x4ea500);}(_0x202c,0x178));var _0xc202=function(_0x1c30bf,_0x68313b){_0x1c30bf=_0x1c30bf-0x0;var _0x5adc49=_0x202c[_0x1c30bf];return _0x5adc49;};'use strict';var Mustache=require(_0xc202('0x0'));var util=require('util');var path=require('path');var ejs=require(_0xc202('0x1'));var fs=require('fs');var fs_extra=require(_0xc202('0x2'));var _=require(_0xc202('0x3'));var querystring=require('querystring');var htmlToText=require(_0xc202('0x4'));var Redis=require(_0xc202('0x5'));var jayson=require(_0xc202('0x6'));var qs=require(_0xc202('0x7'));var logger=require('../../config/logger')(_0xc202('0x8'));var config=require(_0xc202('0x9'));var APIBadRequestError=require('../../errors/api')[_0xc202('0xa')];var APINotFoundError=require('../../errors/api')[_0xc202('0xb')];var APIOutOfIntervalError=require(_0xc202('0xc'))[_0xc202('0xd')];var APIHandleError=require(_0xc202('0xc'))[_0xc202('0xe')];var APIConflictError=require(_0xc202('0xc'))[_0xc202('0xf')];var wildcardUtils=require(_0xc202('0x10'));var URL=require(_0xc202('0x11'))[_0xc202('0x12')];var db=require(_0xc202('0x13'))['db'];config[_0xc202('0x14')]=_[_0xc202('0x15')](config['redis'],{'host':_0xc202('0x16'),'port':0x18eb});var socket=require(_0xc202('0x17'))(new Redis(config[_0xc202('0x14')]));require(_0xc202('0x18'))[_0xc202('0x19')](socket);var client=jayson[_0xc202('0x1a')][_0xc202('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0xc202('0x1b')]({'port':0x232a});var client9003=jayson[_0xc202('0x1a')]['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x2dafa5,_0x4a333c,_0x2f18ec,_0x5971a6){return new Promise(function(_0x19af73,_0x1d580c){var _0x3018c8=_0x5971a6||client;return _0x3018c8[_0xc202('0x1c')](_0x2dafa5,_0x2f18ec)[_0xc202('0x1d')](function(_0x2419c5){logger[_0xc202('0x1e')]('ChatWebsite,\x20%s,\x20%s',_0x4a333c,_0xc202('0x1f'));logger[_0xc202('0x20')](_0xc202('0x21'),_0x4a333c,'request\x20sent',JSON['stringify'](_0x2419c5));if(_0x2419c5[_0xc202('0x22')]){if(_0x2419c5[_0xc202('0x22')][_0xc202('0x23')]===0x1f4){logger[_0xc202('0x22')](_0xc202('0x24'),_0x4a333c,_0x2419c5['error']['message']);return _0x1d580c(_0x2419c5[_0xc202('0x22')]['message']);}logger[_0xc202('0x22')](_0xc202('0x24'),_0x4a333c,_0x2419c5['error']['message']);return _0x19af73(_0x2419c5[_0xc202('0x22')]['message']);}else{logger[_0xc202('0x1e')](_0xc202('0x24'),_0x4a333c,_0xc202('0x1f'));_0x19af73(_0x2419c5[_0xc202('0x25')][_0xc202('0x26')]);}})['catch'](function(_0x59f84d){logger[_0xc202('0x22')](_0xc202('0x24'),_0x4a333c,_0x59f84d);_0x1d580c(_0x59f84d);});});}function respondWithStatusCode(_0x459bc2,_0x4ff3e3){_0x4ff3e3=_0x4ff3e3||0xcc;return function(_0xdd5798){if(_0xdd5798){return _0x459bc2[_0xc202('0x27')](_0x4ff3e3);}return _0x459bc2['status'](_0x4ff3e3)['end']();};}function respondWithResult(_0x257dfe,_0x2f8011){_0x2f8011=_0x2f8011||0xc8;return function(_0xd88a43){if(_0xd88a43){return _0x257dfe[_0xc202('0x28')](_0x2f8011)[_0xc202('0x29')](_0xd88a43);}};}function respondWithFilteredResult(_0x483357,_0x114abb){return function(_0x32f56c){if(_0x32f56c){var _0x4f01fa=typeof _0x114abb['offset']===_0xc202('0x2a')&&typeof _0x114abb[_0xc202('0x2b')]===_0xc202('0x2a');var _0x189211=_0x32f56c['count'];var _0x1f09cf=_0x4f01fa?0x0:_0x114abb[_0xc202('0x2c')];var _0x3c3f22=_0x4f01fa?_0x32f56c['count']:_0x114abb[_0xc202('0x2c')]+_0x114abb[_0xc202('0x2b')];var _0xf1fe4c;if(_0x3c3f22>=_0x189211){_0x3c3f22=_0x189211;_0xf1fe4c=0xc8;}else{_0xf1fe4c=0xce;}_0x483357[_0xc202('0x28')](_0xf1fe4c);return _0x483357[_0xc202('0x2d')](_0xc202('0x2e'),_0x1f09cf+'-'+_0x3c3f22+'/'+_0x189211)[_0xc202('0x29')](_0x32f56c);}return null;};}function saveUpdates(_0x358b35){return function(_0x561070){if(_0x561070){return _0x561070[_0xc202('0x2f')](_0x358b35)[_0xc202('0x1d')](function(_0x442653){return _0x442653;});}return null;};}function removeEntity(_0x50c547){return function(_0x38e439){if(_0x38e439){return _0x38e439[_0xc202('0x30')]()[_0xc202('0x1d')](function(){var _0x5a59a4=_0x38e439[_0xc202('0x31')]({'plain':!![]});var _0x501db2=_0xc202('0x32');return db[_0xc202('0x33')][_0xc202('0x30')]({'where':{'type':_0x501db2,'resourceId':_0x5a59a4['id']}})[_0xc202('0x1d')](function(){return _0x38e439;});})[_0xc202('0x1d')](function(){_0x50c547[_0xc202('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0xed50bd){return function(_0x5087e3){if(!_0x5087e3){_0xed50bd[_0xc202('0x27')](0x194);}return _0x5087e3;};}function handleError(_0x52e163,_0x244489){_0x244489=_0x244489||0x1f4;return function(_0x147272){logger[_0xc202('0x22')](_0x147272['stack']);if(_0x147272[_0xc202('0x34')]){delete _0x147272[_0xc202('0x34')];}_0x52e163[_0xc202('0x28')](_0x244489)[_0xc202('0x35')](_0x147272);};}function createInteractionObject(_0x306889,_0x2afa4e,_0x578344,_0x16608b){var _0x1e57c3=require(_0xc202('0x36'));var _0x4a8d2b=new _0x1e57c3();var _0x41e42b=_0x4a8d2b[_0xc202('0x37')](_0x578344[_0xc202('0x38')])[_0xc202('0x39')]();var _0x5bfaa2=_0x2afa4e['customerIp'];if(_0x578344[_0xc202('0x3a')]){_0x5bfaa2=_0x578344['cf-connecting-ip'];}else if(_0x578344[_0xc202('0x3b')]){_0x5bfaa2=_[_0xc202('0x3c')](_0x578344[_0xc202('0x3b')][_0xc202('0x3d')](','));}return{'ContactId':_0x16608b['id'],'ChatWebsiteId':_0x306889,'from':(_0x16608b[_0xc202('0x3e')]||'')+'\x20'+(_0x16608b[_0xc202('0x3f')]||''),'customerIp':_0x5bfaa2,'customerPort':_0x578344['x-real-port']?_0x578344[_0xc202('0x40')]:null,'referer':_0x2afa4e[_0xc202('0x41')],'browserName':_0x41e42b[_0xc202('0x42')][_0xc202('0x34')]&&_0x41e42b[_0xc202('0x42')]['version']?util[_0xc202('0x43')](_0xc202('0x44'),_0x41e42b[_0xc202('0x42')][_0xc202('0x34')],_0x41e42b[_0xc202('0x42')]['version']):_0xc202('0x45'),'browserVersion':_0x41e42b['browser'][_0xc202('0x46')]||'unknown','osName':util[_0xc202('0x43')](_0xc202('0x44'),_0x41e42b['os'][_0xc202('0x34')],_0x41e42b['os'][_0xc202('0x46')]),'osVersion':_0x41e42b['os']['version'],'deviceModel':_0x41e42b[_0xc202('0x47')][_0xc202('0x48')]&&_0x41e42b[_0xc202('0x47')][_0xc202('0x49')]?util[_0xc202('0x43')](_0xc202('0x4a'),_0x41e42b[_0xc202('0x47')][_0xc202('0x48')],_0x41e42b[_0xc202('0x47')][_0xc202('0x49')],_0x41e42b[_0xc202('0x47')][_0xc202('0x4b')]):null,'deviceVendor':_0x41e42b[_0xc202('0x47')][_0xc202('0x49')],'deviceType':_0x41e42b[_0xc202('0x47')][_0xc202('0x4b')],'formData':JSON[_0xc202('0x4c')](_0x2afa4e)};}exports[_0xc202('0x4d')]=function(_0x9f8ab3,_0x38e9c8){var _0x484013={'include':[{'model':db[_0xc202('0x4e')],'as':'mandatoryDispositionPause'}]},_0x39f2c1={},_0x187934={'count':0x0,'rows':[]};var _0x4ae64d=_['map'](db[_0xc202('0x4f')][_0xc202('0x50')],function(_0x1ae220){return{'name':_0x1ae220[_0xc202('0x51')],'type':_0x1ae220[_0xc202('0x4b')][_0xc202('0x52')]};});_0x39f2c1[_0xc202('0x48')]=_[_0xc202('0x53')](_0x4ae64d,_0xc202('0x34'));_0x39f2c1[_0xc202('0x54')]=_[_0xc202('0x55')](_0x9f8ab3[_0xc202('0x54')]);_0x39f2c1[_0xc202('0x56')]=_['intersection'](_0x39f2c1[_0xc202('0x48')],_0x39f2c1[_0xc202('0x54')]);_0x484013['attributes']=_[_0xc202('0x57')](_0x39f2c1[_0xc202('0x48')],qs[_0xc202('0x58')](_0x9f8ab3[_0xc202('0x54')][_0xc202('0x58')]));_0x484013['attributes']=_0x484013[_0xc202('0x59')]['length']?_0x484013[_0xc202('0x59')]:_0x39f2c1['model'];if(!_0x9f8ab3[_0xc202('0x54')][_0xc202('0x5a')]('nolimit')){_0x484013[_0xc202('0x2b')]=qs[_0xc202('0x2b')](_0x9f8ab3['query']['limit']);_0x484013['offset']=qs[_0xc202('0x2c')](_0x9f8ab3['query'][_0xc202('0x2c')]);}_0x484013[_0xc202('0x5b')]=qs[_0xc202('0x5c')](_0x9f8ab3[_0xc202('0x54')][_0xc202('0x5c')]);_0x484013[_0xc202('0x5d')]=qs[_0xc202('0x56')](_[_0xc202('0x5e')](_0x9f8ab3[_0xc202('0x54')],_0x39f2c1[_0xc202('0x56')]),_0x4ae64d);if(_0x9f8ab3[_0xc202('0x54')][_0xc202('0x5f')]){_0x484013[_0xc202('0x5d')]=_['merge'](_0x484013[_0xc202('0x5d')],{'$or':_['map'](_0x4ae64d,function(_0x5a7f2c){if(_0x5a7f2c[_0xc202('0x4b')]!==_0xc202('0x60')){var _0x40f55f={};_0x40f55f[_0x5a7f2c['name']]={'$like':'%'+_0x9f8ab3[_0xc202('0x54')]['filter']+'%'};return _0x40f55f;}})});}_0x484013=_[_0xc202('0x61')]({},_0x484013,_0x9f8ab3[_0xc202('0x62')]);var _0x5464ea={'where':_0x484013[_0xc202('0x5d')]};return db[_0xc202('0x4f')]['count'](_0x5464ea)[_0xc202('0x1d')](function(_0x499e75){_0x187934[_0xc202('0x63')]=_0x499e75;if(_0x9f8ab3[_0xc202('0x54')][_0xc202('0x64')]){_0x484013[_0xc202('0x65')]=[{'all':!![]}];}return db[_0xc202('0x4f')][_0xc202('0x66')](_0x484013);})[_0xc202('0x1d')](function(_0x5dc65f){_0x187934[_0xc202('0x67')]=_0x5dc65f;return _0x187934;})[_0xc202('0x1d')](respondWithFilteredResult(_0x38e9c8,_0x484013))['catch'](handleError(_0x38e9c8,null));};exports[_0xc202('0x68')]=function(_0x4860cf,_0x28ba39){var _0x4a2a48={'raw':![],'where':{'id':_0x4860cf['params']['id']},'include':[{'model':db[_0xc202('0x4e')],'as':'mandatoryDispositionPause'}]},_0x3642d2={};_0x3642d2['model']=_[_0xc202('0x55')](db[_0xc202('0x4f')][_0xc202('0x50')]);_0x3642d2[_0xc202('0x54')]=_[_0xc202('0x55')](_0x4860cf[_0xc202('0x54')]);_0x3642d2[_0xc202('0x56')]=_[_0xc202('0x57')](_0x3642d2[_0xc202('0x48')],_0x3642d2[_0xc202('0x54')]);_0x4a2a48['attributes']=_[_0xc202('0x57')](_0x3642d2[_0xc202('0x48')],qs['fields'](_0x4860cf[_0xc202('0x54')][_0xc202('0x58')]));_0x4a2a48[_0xc202('0x59')]=_0x4a2a48[_0xc202('0x59')][_0xc202('0x69')]?_0x4a2a48[_0xc202('0x59')]:_0x3642d2[_0xc202('0x48')];if(_0x4860cf[_0xc202('0x54')]['includeAll']){_0x4a2a48[_0xc202('0x65')]=[{'all':!![]}];}_0x4a2a48=_[_0xc202('0x61')]({},_0x4a2a48,_0x4860cf[_0xc202('0x62')]);return db[_0xc202('0x4f')][_0xc202('0x6a')](_0x4a2a48)['then'](handleEntityNotFound(_0x28ba39,null))[_0xc202('0x1d')](respondWithResult(_0x28ba39,null))[_0xc202('0x6b')](handleError(_0x28ba39,null));};exports[_0xc202('0x6c')]=function(_0x5ae21d,_0x7f638c){var _0x4dfb2f=null;_0x5ae21d['body']['address'][_0xc202('0x3d')](',')[_0xc202('0x6d')](_0x189884=>{if(_0x189884[_0xc202('0x6e')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x189884[_0xc202('0x6e')]())){_0x4dfb2f=new APIBadRequestError('\x22'+_0x189884['trim']()+_0xc202('0x6f'));}});if(_0x4dfb2f){return handleError(_0x7f638c,null)(_0x4dfb2f);}return db[_0xc202('0x4f')]['create'](_0x5ae21d[_0xc202('0x70')],{})[_0xc202('0x1d')](function(_0xea479f){var _0x4d9423=_0x5ae21d['user']['get']({'plain':!![]});if(!_0x4d9423)throw new Error(_0xc202('0x71'));if(_0x4d9423[_0xc202('0x72')]==='user'){var _0x44d834=_0xea479f[_0xc202('0x31')]({'plain':!![]});var _0x5a97d5=_0xc202('0x32');return db['UserProfileSection'][_0xc202('0x6a')]({'where':{'name':_0x5a97d5,'userProfileId':_0x4d9423[_0xc202('0x73')]},'raw':!![]})[_0xc202('0x1d')](function(_0x436c8e){if(_0x436c8e&&_0x436c8e[_0xc202('0x74')]===0x0){return db['UserProfileResource']['create']({'name':_0x44d834[_0xc202('0x34')],'resourceId':_0x44d834['id'],'type':_0x436c8e[_0xc202('0x34')],'sectionId':_0x436c8e['id']},{})[_0xc202('0x1d')](function(){return _0xea479f;});}else{return _0xea479f;}})[_0xc202('0x6b')](function(_0x4171d8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4171d8);throw _0x4171d8;});}return _0xea479f;})[_0xc202('0x1d')](respondWithResult(_0x7f638c,0xc9))[_0xc202('0x6b')](handleError(_0x7f638c,null));};exports[_0xc202('0x2f')]=function(_0x44cbd2,_0x6dc70e){var _0x1dd5c0=null;_0x44cbd2['body']['address'][_0xc202('0x3d')](',')[_0xc202('0x6d')](_0x16229b=>{if(_0x16229b['trim']()!==''&&!wildcardUtils[_0xc202('0x75')](_0x16229b[_0xc202('0x6e')]())){_0x1dd5c0=new APIBadRequestError('\x22'+_0x16229b['trim']()+_0xc202('0x6f'));}});if(_0x1dd5c0){return handleError(_0x6dc70e,null)(_0x1dd5c0);}if(_0x44cbd2[_0xc202('0x70')]['id']){delete _0x44cbd2['body']['id'];}return db[_0xc202('0x4f')][_0xc202('0x6a')]({'where':{'id':_0x44cbd2[_0xc202('0x76')]['id']},'include':[{'model':db[_0xc202('0x4e')],'as':_0xc202('0x77')}]})['then'](handleEntityNotFound(_0x6dc70e,null))[_0xc202('0x1d')](saveUpdates(_0x44cbd2['body'],null))[_0xc202('0x1d')](respondWithResult(_0x6dc70e,null))[_0xc202('0x6b')](handleError(_0x6dc70e,null));};exports['destroy']=function(_0x2d149a,_0x5b8a32){return db[_0xc202('0x4f')][_0xc202('0x6a')]({'where':{'id':_0x2d149a[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x5b8a32,null))['then'](removeEntity(_0x5b8a32,null))[_0xc202('0x6b')](handleError(_0x5b8a32,null));};exports[_0xc202('0x78')]=function(_0x3b8197,_0x3d33e5){return db[_0xc202('0x4f')][_0xc202('0x78')]()['then'](respondWithResult(_0x3d33e5,null))[_0xc202('0x6b')](handleError(_0x3d33e5,null));};exports[_0xc202('0x79')]=function(_0x4e4604,_0x1f7734){if(_0x4e4604[_0xc202('0x70')]['id']){delete _0x4e4604['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x4e4604[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x1f7734,null))[_0xc202('0x1d')](function(_0x51e2df){if(_0x51e2df){_0x4e4604[_0xc202('0x70')][_0xc202('0x7a')]=_0x51e2df['id'];return db[_0xc202('0x7b')][_0xc202('0x6c')](_0x4e4604[_0xc202('0x70')]);}})['then'](respondWithResult(_0x1f7734,null))[_0xc202('0x6b')](handleError(_0x1f7734,null));};exports[_0xc202('0x7c')]=function(_0x963cc,_0x3b7c1c){var _0x20621b={'raw':![],'where':{}};var _0x291848={};var _0x429ebc={'count':0x0,'rows':[]};return db[_0xc202('0x4f')][_0xc202('0x7d')]({'where':{'id':_0x963cc[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x3b7c1c,null))['then'](function(_0x274c94){if(_0x274c94){_0x291848[_0xc202('0x48')]=_['keys'](db[_0xc202('0x7b')][_0xc202('0x50')]);_0x291848[_0xc202('0x54')]=_[_0xc202('0x55')](_0x963cc[_0xc202('0x54')]);_0x291848['filters']=_[_0xc202('0x57')](_0x291848['model'],_0x291848[_0xc202('0x54')]);_0x20621b[_0xc202('0x59')]=_[_0xc202('0x57')](_0x291848[_0xc202('0x48')],qs['fields'](_0x963cc[_0xc202('0x54')][_0xc202('0x58')]));_0x20621b[_0xc202('0x59')]=_0x20621b[_0xc202('0x59')][_0xc202('0x69')]?_0x20621b[_0xc202('0x59')]:_0x291848[_0xc202('0x48')];if(!_0x963cc[_0xc202('0x54')][_0xc202('0x5a')](_0xc202('0x7e'))){_0x20621b[_0xc202('0x2b')]=qs['limit'](_0x963cc['query'][_0xc202('0x2b')]);_0x20621b[_0xc202('0x2c')]=qs[_0xc202('0x2c')](_0x963cc[_0xc202('0x54')]['offset']);}_0x20621b[_0xc202('0x5b')]=qs['sort'](_0x963cc['query'][_0xc202('0x5c')]);_0x20621b[_0xc202('0x5d')]=qs['filters'](_['pick'](_0x963cc['query'],_0x291848[_0xc202('0x56')]));_0x20621b[_0xc202('0x5d')]['ChatWebsiteId']=_0x274c94['id'];if(_0x963cc[_0xc202('0x54')][_0xc202('0x5f')]){_0x20621b[_0xc202('0x5d')]=_[_0xc202('0x61')](_0x20621b['where'],{'$or':_[_0xc202('0x53')](_0x20621b[_0xc202('0x59')],function(_0x330f97){var _0x1c50cb={};_0x1c50cb[_0x330f97]={'$like':'%'+_0x963cc['query'][_0xc202('0x5f')]+'%'};return _0x1c50cb;})});}_0x20621b=_['merge']({},_0x20621b,_0x963cc['options']);return db[_0xc202('0x7b')][_0xc202('0x63')]({'where':_0x20621b[_0xc202('0x5d')]})[_0xc202('0x1d')](function(_0xaf2f5c){_0x429ebc['count']=_0xaf2f5c;if(_0x963cc[_0xc202('0x54')][_0xc202('0x64')]){_0x20621b[_0xc202('0x65')]=[{'all':!![]}];}return db['Disposition'][_0xc202('0x66')](_0x20621b);})[_0xc202('0x1d')](function(_0xe0c7b2){_0x429ebc['rows']=_0xe0c7b2;return _0x429ebc;});}})[_0xc202('0x1d')](respondWithFilteredResult(_0x3b7c1c,_0x20621b))[_0xc202('0x6b')](handleError(_0x3b7c1c,null));};exports[_0xc202('0x7f')]=function(_0x27fdb4,_0x558384){return db[_0xc202('0x4f')][_0xc202('0x6a')]({'where':{'id':_0x27fdb4[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x558384,null))['then'](function(_0x2a2f56){if(_0x2a2f56){return _0x2a2f56['removeDispositions'](_0x27fdb4[_0xc202('0x54')][_0xc202('0x80')]);}})[_0xc202('0x1d')](respondWithStatusCode(_0x558384,null))['catch'](handleError(_0x558384,null));};exports[_0xc202('0x81')]=function(_0xc3e1f6,_0x130c8b){if(_0xc3e1f6[_0xc202('0x70')]['id']){delete _0xc3e1f6[_0xc202('0x70')]['id'];}return db[_0xc202('0x4f')][_0xc202('0x6a')]({'where':{'id':_0xc3e1f6['params']['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x130c8b,null))[_0xc202('0x1d')](function(_0x4bb3fa){if(_0x4bb3fa){_0xc3e1f6[_0xc202('0x70')][_0xc202('0x7a')]=_0x4bb3fa['id'];return db[_0xc202('0x82')]['create'](_0xc3e1f6[_0xc202('0x70')]);}})[_0xc202('0x1d')](respondWithResult(_0x130c8b,null))['catch'](handleError(_0x130c8b,null));};exports['getAnswers']=function(_0x100ca6,_0xf3eda3){var _0x3f68ba={'raw':![],'where':{}};var _0x3c2d12={};var _0xf2094a={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc202('0x7d')]({'where':{'id':_0x100ca6[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0xf3eda3,null))[_0xc202('0x1d')](function(_0x2a2a3e){if(_0x2a2a3e){_0x3c2d12[_0xc202('0x48')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x3c2d12[_0xc202('0x54')]=_[_0xc202('0x55')](_0x100ca6[_0xc202('0x54')]);_0x3c2d12[_0xc202('0x56')]=_['intersection'](_0x3c2d12['model'],_0x3c2d12[_0xc202('0x54')]);_0x3f68ba[_0xc202('0x59')]=_[_0xc202('0x57')](_0x3c2d12[_0xc202('0x48')],qs[_0xc202('0x58')](_0x100ca6[_0xc202('0x54')][_0xc202('0x58')]));_0x3f68ba[_0xc202('0x59')]=_0x3f68ba[_0xc202('0x59')][_0xc202('0x69')]?_0x3f68ba[_0xc202('0x59')]:_0x3c2d12[_0xc202('0x48')];if(!_0x100ca6[_0xc202('0x54')][_0xc202('0x5a')](_0xc202('0x7e'))){_0x3f68ba[_0xc202('0x2b')]=qs[_0xc202('0x2b')](_0x100ca6[_0xc202('0x54')][_0xc202('0x2b')]);_0x3f68ba[_0xc202('0x2c')]=qs['offset'](_0x100ca6[_0xc202('0x54')]['offset']);}_0x3f68ba['order']=qs[_0xc202('0x5c')](_0x100ca6['query']['sort']);_0x3f68ba[_0xc202('0x5d')]=qs[_0xc202('0x56')](_[_0xc202('0x5e')](_0x100ca6[_0xc202('0x54')],_0x3c2d12['filters']));_0x3f68ba[_0xc202('0x5d')][_0xc202('0x7a')]=_0x2a2a3e['id'];if(_0x100ca6[_0xc202('0x54')][_0xc202('0x5f')]){_0x3f68ba[_0xc202('0x5d')]=_['merge'](_0x3f68ba[_0xc202('0x5d')],{'$or':_['map'](_0x3f68ba[_0xc202('0x59')],function(_0x1b3c73){var _0x186b17={};_0x186b17[_0x1b3c73]={'$like':'%'+_0x100ca6['query']['filter']+'%'};return _0x186b17;})});}_0x3f68ba=_[_0xc202('0x61')]({},_0x3f68ba,_0x100ca6[_0xc202('0x62')]);return db[_0xc202('0x82')][_0xc202('0x63')]({'where':_0x3f68ba['where']})[_0xc202('0x1d')](function(_0x23e3f0){_0xf2094a['count']=_0x23e3f0;if(_0x100ca6[_0xc202('0x54')][_0xc202('0x64')]){_0x3f68ba[_0xc202('0x65')]=[{'all':!![]}];}return db[_0xc202('0x82')][_0xc202('0x66')](_0x3f68ba);})[_0xc202('0x1d')](function(_0x1b8507){_0xf2094a['rows']=_0x1b8507;return _0xf2094a;});}})[_0xc202('0x1d')](respondWithFilteredResult(_0xf3eda3,_0x3f68ba))[_0xc202('0x6b')](handleError(_0xf3eda3,null));};exports[_0xc202('0x83')]=function(_0x31bcfa,_0x3da1f6){return db[_0xc202('0x4f')]['find']({'where':{'id':_0x31bcfa[_0xc202('0x76')]['id']}})['then'](handleEntityNotFound(_0x3da1f6,null))['then'](function(_0x1cacd7){if(_0x1cacd7){return _0x1cacd7['removeAnswers'](_0x31bcfa[_0xc202('0x54')][_0xc202('0x80')]);}})[_0xc202('0x1d')](respondWithStatusCode(_0x3da1f6,null))[_0xc202('0x6b')](handleError(_0x3da1f6,null));};exports[_0xc202('0x84')]=function(_0x17c92f,_0x16c444){_0x17c92f[_0xc202('0x70')][_0xc202('0x85')]=_0x17c92f[_0xc202('0x86')][_0xc202('0x87')];return db['ChatWebsite'][_0xc202('0x6a')]({'where':{'id':_0x17c92f[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x16c444,null))[_0xc202('0x1d')](saveUpdates(_0x17c92f['body'],null))[_0xc202('0x1d')](respondWithResult(_0x16c444,null))[_0xc202('0x6b')](handleError(_0x16c444,null));};exports['addAvatar']=function(_0x3f09aa,_0x31bed9){_0x3f09aa[_0xc202('0x70')]['agentAvatar']=_0x3f09aa[_0xc202('0x86')][_0xc202('0x87')];return db[_0xc202('0x4f')]['find']({'where':{'id':_0x3f09aa[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x31bed9,null))['then'](saveUpdates(_0x3f09aa[_0xc202('0x70')],null))[_0xc202('0x1d')](respondWithResult(_0x31bed9,null))[_0xc202('0x6b')](handleError(_0x31bed9,null));};exports[_0xc202('0x88')]=function(_0x36def4,_0x22b25c){_0x36def4[_0xc202('0x70')]['customerAvatar']=_0x36def4[_0xc202('0x86')][_0xc202('0x87')];return db[_0xc202('0x4f')]['find']({'where':{'id':_0x36def4[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x22b25c,null))[_0xc202('0x1d')](saveUpdates(_0x36def4[_0xc202('0x70')],null))['then'](respondWithResult(_0x22b25c,null))['catch'](handleError(_0x22b25c,null));};exports['addSystemAvatar']=function(_0xb1d213,_0xa3293c){_0xb1d213[_0xc202('0x70')]['systemAvatar']=_0xb1d213['file']['filename'];return db['ChatWebsite'][_0xc202('0x6a')]({'where':{'id':_0xb1d213[_0xc202('0x76')]['id']}})['then'](handleEntityNotFound(_0xa3293c,null))['then'](saveUpdates(_0xb1d213[_0xc202('0x70')],null))[_0xc202('0x1d')](respondWithResult(_0xa3293c,null))[_0xc202('0x6b')](handleError(_0xa3293c,null));};exports[_0xc202('0x89')]=function(_0x416b2a,_0xa58f72){var _0x1f33dd=path['join'](config[_0xc202('0x8a')],_0xc202('0x8b'));var _0x161d84={'where':{'id':_0x416b2a['params']['id']},'attributes':['id',_0xc202('0x85')],'raw':!![]};var _0x236f7d=![];return require(_0xc202('0x8c'))[_0xc202('0x8d')]()['then'](function(_0xacffae){if(_0xacffae){_0x236f7d=_0xacffae['custom'];}})[_0xc202('0x1d')](function(){return db['ChatWebsite'][_0xc202('0x6a')](_0x161d84);})['then'](handleEntityNotFound(_0xa58f72,null))[_0xc202('0x1d')](function(_0x112b2e){if(_0x112b2e){if(!_[_0xc202('0x8e')](_0x112b2e[_0xc202('0x85')])){if(fs[_0xc202('0x8f')](path['join'](config[_0xc202('0x8a')],_0xc202('0x90'),_0x112b2e[_0xc202('0x85')]))&&_0x236f7d){_0x1f33dd=path['join'](config[_0xc202('0x8a')],_0xc202('0x90'),_0x112b2e[_0xc202('0x85')]);}}return _0xa58f72[_0xc202('0x91')](_0x1f33dd);}})['catch'](handleError(_0xa58f72,null));};exports[_0xc202('0x92')]=function(_0x37557a,_0x1d2f46){var _0x2fe360=path['join'](config[_0xc202('0x8a')],'server/files/images/avatars/default_avatar.png');var _0x2b4fd8={'where':{'id':_0x37557a[_0xc202('0x76')]['id']},'attributes':['id',_0xc202('0x93')],'raw':!![]};return db[_0xc202('0x4f')][_0xc202('0x6a')](_0x2b4fd8)['then'](handleEntityNotFound(_0x1d2f46,null))[_0xc202('0x1d')](function(_0x2892b2){if(_0x2892b2){if(!_['isNil'](_0x2892b2['agentAvatar'])){if(fs['existsSync'](path[_0xc202('0x94')](config[_0xc202('0x8a')],'server/files/images/avatars/',_0x2892b2['agentAvatar']))){_0x2fe360=path[_0xc202('0x94')](config[_0xc202('0x8a')],_0xc202('0x95'),_0x2892b2[_0xc202('0x93')]);}}return _0x1d2f46[_0xc202('0x91')](_0x2fe360);}})['catch'](handleError(_0x1d2f46,null));};exports[_0xc202('0x96')]=function(_0x7fe0e3,_0xc2e3de){var _0xcfb0cc=path[_0xc202('0x94')](config[_0xc202('0x8a')],'server/files/images/avatars/customer_avatar.png');var _0x462e41={'where':{'id':_0x7fe0e3[_0xc202('0x76')]['id']},'attributes':['id','customerAvatar',_0xc202('0x97')],'raw':!![]};return db[_0xc202('0x4f')]['find'](_0x462e41)[_0xc202('0x1d')](handleEntityNotFound(_0xc2e3de,null))[_0xc202('0x1d')](function(_0x55b895){if(_0x55b895){if(!_['isNil'](_0x55b895[_0xc202('0x98')])){if(fs[_0xc202('0x8f')](path[_0xc202('0x94')](config[_0xc202('0x8a')],_0xc202('0x95'),_0x55b895[_0xc202('0x98')]))&&_0x55b895['showCustomerAvatar']){_0xcfb0cc=path[_0xc202('0x94')](config['root'],'server/files/images/avatars/',_0x55b895['customerAvatar']);}}return _0xc2e3de[_0xc202('0x91')](_0xcfb0cc);}})['catch'](handleError(_0xc2e3de,null));};exports[_0xc202('0x99')]=function(_0x4b3d78,_0x335884){var _0x1271fd=path[_0xc202('0x94')](config[_0xc202('0x8a')],_0xc202('0x9a'));var _0xff16e2={'where':{'id':_0x4b3d78[_0xc202('0x76')]['id']},'attributes':['id',_0xc202('0x9b')],'raw':!![]};return db[_0xc202('0x4f')]['find'](_0xff16e2)[_0xc202('0x1d')](handleEntityNotFound(_0x335884,null))[_0xc202('0x1d')](function(_0x108dc5){if(_0x108dc5){if(!_['isNil'](_0x108dc5['systemAvatar'])){if(fs['existsSync'](path[_0xc202('0x94')](config['root'],_0xc202('0x95'),_0x108dc5[_0xc202('0x9b')]))){_0x1271fd=path[_0xc202('0x94')](config[_0xc202('0x8a')],_0xc202('0x95'),_0x108dc5[_0xc202('0x9b')]);}}return _0x335884[_0xc202('0x91')](_0x1271fd);}})[_0xc202('0x6b')](handleError(_0x335884,null));};function checkWebsiteInterval(_0x30b4de){var _0x379423=_0x30b4de[_0xc202('0x9c')];if(!_0x379423){return Promise[_0xc202('0x9d')](_0x30b4de);}var _0x3efa0b=_0x30b4de[_0xc202('0x9e')]||undefined;return _0x379423[_0xc202('0x9f')](_0x3efa0b)[_0xc202('0x1d')](function(_0x26351f){if(!_0x26351f){throw new APIOutOfIntervalError();}return _0x30b4de;});}exports[_0xc202('0xa0')]=function(_0x392125,_0x28b1cb){var _0x3a2e64={'body':_0x392125[_0xc202('0x70')],'channel':_0xc202('0xa1')};var _0x4cdcc8=[];var _0x2a12e1=[];var _0x3c1042={};var _0x180c0b=![];if(_0x392125[_0xc202('0x70')]['id']){delete _0x392125[_0xc202('0x70')]['id'];}if(_[_0xc202('0x8e')](_0x392125[_0xc202('0x70')][_0xc202('0xa2')])){throw new APIBadRequestError(_0xc202('0xa3'));}if(_[_0xc202('0x8e')](_0x392125[_0xc202('0x70')][_0xc202('0xa4')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0xc202('0xa5')](_0x392125['body'][_0xc202('0x70')])){throw new APIBadRequestError(_0xc202('0xa6'));}var _0x52b876=_0x392125[_0xc202('0x70')]['customerIp']&&_0x392125['body'][_0xc202('0x41')];return db[_0xc202('0xa7')][_0xc202('0x78')]()[_0xc202('0x1d')](function(_0x1b5980){if(!_0x1b5980){throw new Error('No\x20available\x20attributes');}_0x4cdcc8=Object[_0xc202('0x55')](_0x1b5980)[_0xc202('0x5f')](function(_0x4332e1){return![_0xc202('0xa8'),'updatedAt']['includes'](_0x4332e1);});_0x2a12e1=Object[_0xc202('0x55')](_0x1b5980)['filter'](function(_0x4122fe){return![_0xc202('0xa8'),_0xc202('0xa9'),_0xc202('0xaa'),'ListId'][_0xc202('0xab')](_0x4122fe);});if(!_['includes'](_0x2a12e1,_0x392125[_0xc202('0x70')][_0xc202('0xa4')])){throw new APIBadRequestError(_0xc202('0xac')+_0x2a12e1[_0xc202('0x94')](',\x20'));}_0x3c1042[_0x392125[_0xc202('0x70')][_0xc202('0xa4')]]=_0x392125[_0xc202('0x70')][_0xc202('0xa2')];})[_0xc202('0x1d')](function(){return db['ChatWebsite'][_0xc202('0x6a')]({'where':{'id':_0x392125[_0xc202('0x76')]['id']},'include':[{'model':db['CmList'],'as':_0xc202('0xad'),'include':[{'model':db[_0xc202('0xa7')],'as':_0xc202('0xae'),'where':_0x3c1042,'limit':0x1,'order':[[_0xc202('0xa9'),_0xc202('0xaf')]]}]},{'model':db['ChatApplication'],'as':'Applications'},{'model':db['Interval'],'as':_0xc202('0x9c'),'include':[{'model':db[_0xc202('0x9c')],'as':_0xc202('0xb0'),'attributes':['id','interval'],'raw':!![]}]}]});})['then'](function(_0x552308){if(!_0x552308){throw new APINotFoundError(util[_0xc202('0x43')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x392125[_0xc202('0x76')]['id']));}if(_0x52b876){return checkWebsiteInterval(_0x552308);}return _0x552308;})[_0xc202('0x1d')](function(_0x30c7ab){_0x3a2e64[_0xc202('0xb1')]=_0x30c7ab;_0x3a2e64['applications']=_[_0xc202('0xb2')](_0x30c7ab[_0xc202('0xb3')],[_0xc202('0xb4')],['asc']);if(_0x3a2e64[_0xc202('0xb1')][_0xc202('0xb3')]){delete _0x3a2e64[_0xc202('0xb1')]['Applications'];}_0x3a2e64[_0xc202('0xb5')]=_0x30c7ab[_0xc202('0xad')]||{'id':_0x30c7ab['ListId']};if(_0x3a2e64[_0xc202('0xb5')]&&_0x3a2e64['list'][_0xc202('0xae')]['length']){return _0x3a2e64[_0xc202('0xb5')][_0xc202('0xae')][0x0];}var _0x5bcab0=_[_0xc202('0x15')](_0x392125[_0xc202('0x70')],{'firstName':_0x392125[_0xc202('0x70')]['from'],'ListId':_0x30c7ab['ListId']});_0x5bcab0[_0x392125[_0xc202('0x70')][_0xc202('0xa4')]]=_0x392125[_0xc202('0x70')][_0xc202('0xa2')];return db['CmContact'][_0xc202('0x6c')](_0x5bcab0,{'fields':_0x4cdcc8,'raw':!![]});})['then'](function(_0x3fda23){_0x3a2e64[_0xc202('0xb6')]=_0x3fda23;var _0x35fdb5=createInteractionObject(_0x392125[_0xc202('0x76')]['id'],_0x392125['body'],_0x392125[_0xc202('0xb7')],_0x3fda23);var _0x3da9d6={'ChatWebsiteId':_0x392125['params']['id']};if(_0x392125[_0xc202('0x70')][_0xc202('0xb8')]){_0x3da9d6[_0xc202('0xb8')]=_0x392125[_0xc202('0x70')][_0xc202('0xb8')];_0x3da9d6[_0xc202('0xb9')]=![];return db[_0xc202('0xba')][_0xc202('0x6a')]({'where':_0x3da9d6})[_0xc202('0x1d')](function(_0x335ce5){var _0x1bdcd0=_0x392125[_0xc202('0x70')]['customerIp']&&_0x392125[_0xc202('0x70')]['referer'];if(_0x335ce5){_0x180c0b=!![];return _0x335ce5;}else if(!_0x1bdcd0&&_0x335ce5&&_0x335ce5['closed']){throw new APIConflictError(_0xc202('0xbb'));}_0x35fdb5[_0xc202('0xb8')]=_0x392125[_0xc202('0x70')][_0xc202('0xb8')];_0x35fdb5[_0xc202('0xbc')]=_0x392125['body']['externalUrl'];return db[_0xc202('0xba')][_0xc202('0x6c')](_0x35fdb5);});}_0x3da9d6[_0xc202('0xbd')]=_0x3fda23['id'];if(_0x392125[_0xc202('0x70')][_0xc202('0xbe')]&&_0x392125[_0xc202('0x70')]['interaction']['id']){_0x3da9d6['id']=_0x392125['body'][_0xc202('0xbe')]['id'];return db[_0xc202('0xba')][_0xc202('0x6a')]({'where':_0x3da9d6})['then'](function(_0x5a6d7e){var _0xe68860=_0x392125[_0xc202('0x70')]['customerIp']&&_0x392125[_0xc202('0x70')][_0xc202('0x41')];if(!_0xe68860&&_0x5a6d7e&&_0x5a6d7e['closed']){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x5a6d7e){_0x180c0b=!![];return _0x5a6d7e;}else{return db[_0xc202('0xba')]['create'](_0x35fdb5);}});}return db['ChatInteraction'][_0xc202('0x6c')](_0x35fdb5);})[_0xc202('0x1d')](function(_0xfdf0fd){if(!_0x180c0b){return _0xfdf0fd;}var _0x1367b7={'from':(_0x3a2e64['contact']['firstName']||'')+'\x20'+(_0x3a2e64[_0xc202('0xb6')][_0xc202('0x3f')]||'')};if(_0x392125[_0xc202('0x70')][_0xc202('0xb8')]&&_0x392125[_0xc202('0x70')]['messageId']&&_0x392125[_0xc202('0x70')][_0xc202('0xb8')]!=_0x392125[_0xc202('0x70')]['messageId']){_0x1367b7[_0xc202('0xb8')]=_0x392125['body'][_0xc202('0xbf')];}return _0xfdf0fd[_0xc202('0x2f')](_0x1367b7);})['then'](function(_0x32184b){_0x3a2e64['interaction']=_0x32184b[_0xc202('0x31')]({'plain':!![]});_0x3a2e64[_0xc202('0xbe')][_0xc202('0xc0')]=!_0x180c0b;if(_0x3a2e64[_0xc202('0xbe')]['created']){if(_0x3a2e64['account'][_0xc202('0xc1')]){_0x3a2e64['applications'][_0xc202('0xc2')]({'id':0x0,'priority':_0x3a2e64[_0xc202('0xc3')][_0xc202('0x69')]+0x1,'app':_0xc202('0xc4'),'appdata':_0xc202('0xc5'),'interval':_0xc202('0xc6')});}}return db[_0xc202('0xc7')][_0xc202('0x6c')]({'body':_0x392125[_0xc202('0x70')][_0xc202('0x70')],'ChatWebsiteId':_0x392125[_0xc202('0x76')]['id'],'ChatInteractionId':_0x32184b['id'],'direction':'in','ContactId':_0x3a2e64['contact']['id'],'AttachmentId':_0x392125[_0xc202('0x70')][_0xc202('0xc8')]});})[_0xc202('0x1d')](function(_0x59043d){_0x3a2e64[_0xc202('0x26')]=_0x59043d;if(!_0x3a2e64['interaction']['UserId']){return;}return db[_0xc202('0xc9')][_0xc202('0x6a')]({'attributes':['id',_0xc202('0x34')],'where':{'id':_0x3a2e64[_0xc202('0xbe')][_0xc202('0xca')]}});})[_0xc202('0x1d')](function(_0x4963da){if(_0x4963da){_0x3a2e64[_0xc202('0xc3')][_0xc202('0xcb')]({'id':0x0,'priority':0x0,'app':_0xc202('0xcc'),'appdata':_0x4963da[_0xc202('0x34')]+','+(_0x3a2e64[_0xc202('0xb1')][_0xc202('0xcd')]||0xa),'interval':_0xc202('0xc6')});_0x3a2e64[_0xc202('0xce')]=!![];}if(!_0x3a2e64['interaction'][_0xc202('0xcf')]){return;}return db[_0xc202('0xd0')][_0xc202('0x6a')]({'attributes':['id',_0xc202('0x34')],'where':{'id':_0x3a2e64[_0xc202('0xbe')][_0xc202('0xcf')]}});})[_0xc202('0x1d')](function(_0x569881){if(_0x569881){_0x3a2e64[_0xc202('0xc3')][_0xc202('0xcb')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x569881[_0xc202('0x34')]+','+(_0x3a2e64[_0xc202('0xb1')][_0xc202('0xd1')]||0x12c),'interval':_0xc202('0xc6')});}return respondWithRpcPromise(_0xc202('0xd2'),_0xc202('0xd3'),_0x3a2e64);})[_0xc202('0x1d')](function(_0x39679b){respondWithRpcPromise(_0xc202('0xd4'),_0xc202('0xd4'),{'event':'notify','message':_0x39679b},client9002);return _0x39679b;})[_0xc202('0x1d')](respondWithResult(_0x28b1cb,null))[_0xc202('0x6b')](APIHandleError(_0x28b1cb));};exports[_0xc202('0xd5')]=function(_0x45eab9,_0x3d5ea7){var _0x20f958,_0x4efa8e,_0x553dab;var _0x1ca42d=[];var _0xc5679f={};var _0x2b6b6b=_0x45eab9[_0xc202('0xd6')]||[];var _0x3cb323=[];var _0x56553b;return db[_0xc202('0xa7')][_0xc202('0x78')]()[_0xc202('0x1d')](function(_0x22c560){if(!_0x22c560){throw new db[(_0xc202('0xd7'))][(_0xc202('0xd8'))](_0xc202('0xd9'));}_0x1ca42d=_[_0xc202('0xda')](_['keys'](_0x22c560),[_0xc202('0xa8'),_0xc202('0xa9'),_0xc202('0xaa'),_0xc202('0xdb')]);if(_0x45eab9[_0xc202('0x70')]['id']){delete _0x45eab9[_0xc202('0x70')]['id'];}if(_[_0xc202('0x8e')](_0x45eab9[_0xc202('0x70')][_0xc202('0xa2')])){throw _0x3d5ea7[_0xc202('0x28')](0x1f4)[_0xc202('0x35')](new db[(_0xc202('0xd7'))][(_0xc202('0xd8'))](_0xc202('0xdc')));}if(_[_0xc202('0x8e')](_0x45eab9[_0xc202('0x70')][_0xc202('0x70')])||_0x45eab9[_0xc202('0x70')][_0xc202('0x70')]===''){throw _0x3d5ea7['status'](0x1f4)[_0xc202('0x35')](new db[(_0xc202('0xd7'))][(_0xc202('0xd8'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xc202('0x8e')](_0x45eab9['body'][_0xc202('0xdd')])){throw _0x3d5ea7['status'](0x1f4)[_0xc202('0x35')](new db[(_0xc202('0xd7'))][(_0xc202('0xd8'))](_0xc202('0xde')+_0x1ca42d));}if(!_[_0xc202('0xab')](_0x1ca42d,_0x45eab9['body']['mapKeyOffline'])){throw _0x3d5ea7['status'](0x1f4)[_0xc202('0x35')](new db['Sequelize'][(_0xc202('0xd8'))](_0xc202('0xdf')+_0x1ca42d));}_0xc5679f[_0x45eab9['body']['mapKeyOffline']]=_0x45eab9[_0xc202('0x70')][_0xc202('0xa2')];})['then'](function(){return db['ChatWebsite'][_0xc202('0x6a')]({'where':{'id':_0x45eab9[_0xc202('0x76')]['id']},'include':[{'model':db[_0xc202('0xe0')],'as':_0xc202('0xad')},{'model':db[_0xc202('0xe1')],'as':_0xc202('0xe1')}]});})[_0xc202('0x1d')](handleEntityNotFound(_0x3d5ea7,null))[_0xc202('0x1d')](function(_0x12b519){if(_0x12b519&&_0x12b519['List']){_0x4efa8e=_0x12b519;var _0x34538d=_[_0xc202('0x15')](_0x45eab9[_0xc202('0x70')],{'firstName':_0x45eab9[_0xc202('0x70')][_0xc202('0xa2')],'phone':_0x45eab9[_0xc202('0x70')][_0xc202('0xa2')],'ListId':_0x12b519[_0xc202('0xdb')]});_0x34538d[_0x45eab9[_0xc202('0x70')][_0xc202('0xdd')]]=_0x45eab9['body'][_0xc202('0xa2')];return db[_0xc202('0xa7')][_0xc202('0xe2')]({'where':_0xc5679f,'defaults':_0x34538d});}})[_0xc202('0xe3')](function(_0x58243f){if(_0x58243f){_0x553dab=_0x58243f;var _0x4b94f6=fs['readFileSync'](path[_0xc202('0x94')](config[_0xc202('0x8a')],'server/files/templates/chatOfflineMessage.ejs'),_0xc202('0xe4'));var _0x1fd98b=ejs[_0xc202('0xe5')](_0x4b94f6,{'body':_['toPairs'](_0x45eab9['body'][_0xc202('0x70')]),'bodyTitle':_0x4efa8e['offlineMessageBody']});return db['ChatOfflineMessage'][_0xc202('0x6c')]({'body':_0x1fd98b,'plainBody':htmlToText[_0xc202('0xe6')](_0x1fd98b),'ContactId':_0x58243f['id'],'ChatWebsiteId':_0x4efa8e['id']});}})[_0xc202('0x1d')](function(_0x417f99){_0x56553b=_0x417f99;if(_0x2b6b6b[_0xc202('0x69')]){var _0xd981a9=_0x2b6b6b[_0xc202('0x53')](function(_0x5438cf){return{'name':_0x5438cf[_0xc202('0xe7')],'basename':_0x5438cf[_0xc202('0x87')],'type':_0x5438cf[_0xc202('0xe8')],'ChatOfflineMessageId':_0x417f99['id']};});_0x3cb323=_0xd981a9['map'](_0x213a6d=>{var _0x5c3a6b={'filename':_0x213a6d['name'],'path':path[_0xc202('0x94')](config[_0xc202('0x8a')],_0xc202('0xe9'),_0xc202('0xd6'),_0xc202('0xea'),_0xc202('0xeb'),_0x213a6d['basename'])};return _0x5c3a6b;});if(!_0x4efa8e[_0xc202('0xec')]){return db[_0xc202('0xed')][_0xc202('0xee')](function(_0x54ee3e){return db[_0xc202('0xef')]['bulkCreate'](_0xd981a9,{'transaction':_0x54ee3e});});}}})[_0xc202('0x1d')](function(){if(_0x56553b){_0x20f958=_0x56553b;return db[_0xc202('0xe1')][_0xc202('0x7d')]({'where':{'service':!![]},'include':[{'model':db[_0xc202('0xf0')],'as':_0xc202('0xf1'),'raw':!![],'include':[{'model':db[_0xc202('0xf2')],'as':_0xc202('0xf2'),'raw':!![]}]}]});}})[_0xc202('0x1d')](function(_0x2e0f8c){if(_0x2e0f8c&&_0x2e0f8c[_0xc202('0xf1')]&&_0x4efa8e[_0xc202('0xf3')]&&_0x4efa8e['forwardOfflineAddress']){var _0x6f15d=_0x2e0f8c['getSmtpOptions']();return respondWithRpcPromise(_0xc202('0xf4'),_0xc202('0xf5'),{'account':_0x6f15d,'message':{'from':util[_0xc202('0x43')](_0xc202('0xf6'),_0x2e0f8c['name'],_0x2e0f8c[_0xc202('0xf7')]||_0x2e0f8c['Smtp'][_0xc202('0xf8')]),'to':_0x4efa8e[_0xc202('0xf9')],'subject':_0x4efa8e[_0xc202('0xfa')],'html':_0x20f958['body'],'attachments':_0x3cb323}},client9003)[_0xc202('0x1d')](function(){return _0x20f958;})[_0xc202('0x6b')](function(_0x4a1b1a){logger['error'](_0x4a1b1a);});}})[_0xc202('0x1d')](function(){if(_0x4efa8e&&_0x4efa8e[_0xc202('0xec')]&&_0x4efa8e['MailAccountId']){var _0x47963d=[];if(_0x2b6b6b[_0xc202('0x69')]){_0x47963d=_0x2b6b6b[_0xc202('0x53')](function(_0x1f62a0){return{'name':_0x1f62a0[_0xc202('0xe7')],'basename':_0x1f62a0['filename'],'type':_0x1f62a0[_0xc202('0xe8')],'ChatOfflineMessageId':_0x56553b['id']};});}var _0x2f5fd7;if(!_['isNil'](_0x4efa8e['subjectOffline'])){var _0x28e6e3=_[_0xc202('0x53')](_0x45eab9['body'],function(_0x5ae204){return _0x5ae204;});var _0x4e811d=_[_0xc202('0xfb')](_0x28e6e3)[0x0];var _0x1128b9=_['mapValues'](_0x4e811d,function(_0x2d1f45){return _0x2d1f45;});_0x2f5fd7=_0x1128b9[0x1][_0x4efa8e[_0xc202('0xfc')]];}var _0x329572={'from':_0x553dab[_0xc202('0xf7')],'firstName':_0x553dab[_0xc202('0x3e')],'lastName':_0x553dab[_0xc202('0x3f')],'mapKey':_0xc202('0xf7'),'message':{'from':_0x553dab[_0xc202('0xf7')],'to':_0x4efa8e[_0xc202('0xe1')][_0xc202('0xf7')],'cc':'','subject':_[_0xc202('0x8e')](_0x2f5fd7)?_0x4efa8e[_0xc202('0xfa')]:_0x2f5fd7,'messageId':'','sentAt':new Date(),'attach':_0x47963d[_0xc202('0x69')],'attachments':_0x47963d,'originChannel':_0xc202('0xfd'),'ChatWebsiteId':_0x4efa8e['id'],'ChatOfflineMessageId':_0x20f958['id'],'originTo':_0x4efa8e['MailAccount'][_0xc202('0xf7')]},'body':_0x20f958[_0xc202('0x70')]};var _0x5e91e4={'account':{'id':_0x4efa8e[_0xc202('0xfe')]},'body':_0x329572,'log':_0xc202('0xff')};return respondWithRpcPromise('NotifyMailAccount',_0xc202('0x100'),_0x5e91e4,client9001)['then'](function(){return _0x20f958;})[_0xc202('0x6b')](function(_0x349393){logger[_0xc202('0x22')](_0x349393);});}return;})[_0xc202('0x1d')](function(){if(_0x20f958){return _0x20f958;}})[_0xc202('0x1d')](respondWithResult(_0x3d5ea7,null))[_0xc202('0x6b')](function(){for(var _0x12f70f of _0x2b6b6b){var _0x432253=path[_0xc202('0x94')](config[_0xc202('0x8a')],_0xc202('0xe9'),_0xc202('0xd6'),_0xc202('0xea'),_0xc202('0xeb'),_0x12f70f[_0xc202('0x87')]);fs_extra[_0xc202('0x101')](_0x432253)['catch'](function(_0x109dc9){logger[_0xc202('0x22')](_0xc202('0x102'),_0x432253,_0x109dc9);});}});};exports['addInteraction']=function(_0x168281,_0x1c4245){return db[_0xc202('0xba')][_0xc202('0x6a')]({'where':{'id':_0x168281['params']['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x1c4245,null))['then'](function(_0x2033da){if(_0x2033da){return _0x2033da[_0xc202('0x103')](_0x168281[_0xc202('0x70')][_0xc202('0x80')],_[_0xc202('0x104')](_0x168281[_0xc202('0x70')],[_0xc202('0x80'),'id'])||{});}})[_0xc202('0x1d')](respondWithResult(_0x1c4245,null))[_0xc202('0x6b')](handleError(_0x1c4245,null));};exports['getInteractions']=function(_0x495314,_0x413380){var _0x431397={'raw':![],'where':{}};var _0x541fc4={};var _0xf9792={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x495314[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x413380,null))[_0xc202('0x1d')](function(_0x1ba783){if(_0x1ba783){_0x541fc4[_0xc202('0x48')]=_['keys'](db[_0xc202('0xba')][_0xc202('0x50')]);_0x541fc4['query']=_[_0xc202('0x55')](_0x495314[_0xc202('0x54')]);_0x541fc4[_0xc202('0x56')]=_['intersection'](_0x541fc4[_0xc202('0x48')],_0x541fc4['query']);_0x431397[_0xc202('0x59')]=_['intersection'](_0x541fc4[_0xc202('0x48')],qs[_0xc202('0x58')](_0x495314[_0xc202('0x54')][_0xc202('0x58')]));_0x431397[_0xc202('0x59')]=_0x431397[_0xc202('0x59')][_0xc202('0x69')]?_0x431397[_0xc202('0x59')]:_0x541fc4['model'];if(!_0x495314[_0xc202('0x54')][_0xc202('0x5a')](_0xc202('0x7e'))){_0x431397['limit']=qs[_0xc202('0x2b')](_0x495314[_0xc202('0x54')][_0xc202('0x2b')]);_0x431397[_0xc202('0x2c')]=qs[_0xc202('0x2c')](_0x495314[_0xc202('0x54')][_0xc202('0x2c')]);}_0x431397['order']=qs[_0xc202('0x5c')](_0x495314[_0xc202('0x54')][_0xc202('0x5c')]);_0x431397[_0xc202('0x5d')]=qs[_0xc202('0x56')](_[_0xc202('0x5e')](_0x495314[_0xc202('0x54')],_0x541fc4['filters']));_0x431397[_0xc202('0x5d')]['ChatWebsiteId']=_0x1ba783['id'];if(_0x495314[_0xc202('0x54')][_0xc202('0x5f')]){_0x431397[_0xc202('0x5d')]=_[_0xc202('0x61')](_0x431397[_0xc202('0x5d')],{'$or':_[_0xc202('0x53')](_0x431397[_0xc202('0x59')],function(_0x5e5522){var _0x3998ae={};_0x3998ae[_0x5e5522]={'$like':'%'+_0x495314[_0xc202('0x54')]['filter']+'%'};return _0x3998ae;})});}_0x431397=_[_0xc202('0x61')]({},_0x431397,_0x495314[_0xc202('0x62')]);return db[_0xc202('0xba')]['count']({'where':_0x431397[_0xc202('0x5d')]})[_0xc202('0x1d')](function(_0x2e1b42){_0xf9792['count']=_0x2e1b42;if(_0x495314[_0xc202('0x54')][_0xc202('0x64')]){_0x431397[_0xc202('0x65')]=[{'model':db[_0xc202('0xa7')],'as':_0xc202('0x105'),'required':![]},{'model':db[_0xc202('0xc9')],'as':'Owner','attributes':[_0xc202('0x34'),_0xc202('0x106'),_0xc202('0x107')],'required':![]},{'model':db['Tag'],'as':_0xc202('0x108'),'attributes':['id',_0xc202('0x34'),_0xc202('0x109')],'where':_0x495314[_0xc202('0x54')][_0xc202('0x10a')]?{'id':_0x495314[_0xc202('0x54')][_0xc202('0x10a')]}:undefined,'required':_0x495314[_0xc202('0x54')][_0xc202('0x10a')]?!![]:![]}];}return db[_0xc202('0xba')][_0xc202('0x66')](_0x431397);})[_0xc202('0x1d')](function(_0x10cb76){_0xf9792[_0xc202('0x67')]=_0x10cb76;return _0xf9792;});}})['then'](respondWithFilteredResult(_0x413380,_0x431397))[_0xc202('0x6b')](handleError(_0x413380,null));};exports[_0xc202('0x10b')]=function(_0x574c42,_0x1ce067){var _0x5398b2=0x0;var _0x1cad99=0x0;var _0x22fa07=![];var _0x11f203;var _0x5667e6;return db[_0xc202('0x4f')][_0xc202('0x6a')]({'where':{'id':_0x574c42[_0xc202('0x76')]['id']},'include':[{'model':db[_0xc202('0x9c')],'as':_0xc202('0x9c'),'include':[{'model':db[_0xc202('0x9c')],'as':_0xc202('0xb0'),'attributes':['id',_0xc202('0x10c')]}]}]})[_0xc202('0x1d')](handleEntityNotFound(_0x1ce067,null))[_0xc202('0x1d')](function(_0x21bb38){if(_0x21bb38){_0x11f203=_0x21bb38;return _0x21bb38[_0xc202('0x10d')]({'raw':!![]});}})['then'](function(_0x20c408){if(_0x11f203){if(_0x20c408){_0x5667e6=_0x20c408;}}return require(_0xc202('0x8c'))[_0xc202('0x8d')]();})[_0xc202('0x1d')](function(_0x4fa995){if(_0x4fa995){_0x1cad99=_0x4fa995['virtual'];_0x22fa07=_0x4fa995[_0xc202('0x10e')];}})[_0xc202('0x1d')](function(){return db['ChatInteraction'][_0xc202('0x63')]({'where':{'closed':![]}});})[_0xc202('0x1d')](function(_0x5645fe){_0x5398b2=_0x5645fe;if(_0x1cad99&&_0x5645fe>_0x1cad99){return db['License'][_0xc202('0x7d')]({'where':{'id':0x1}})['then'](function(_0x295345){if(_0x295345){_0x295345[_0xc202('0x10f')](_0xc202('0x110'));}});}})[_0xc202('0x1d')](function(){var _0x395aa7=_0x11f203[_0xc202('0x9c')];var _0x5842d0=_0x11f203[_0xc202('0x9e')]||undefined;return _0x395aa7?_0x395aa7['ifTime'](_0x5842d0):!![];})[_0xc202('0x1d')](function(_0x130542){var _0x43a30e=fs[_0xc202('0x111')](path[_0xc202('0x94')](config[_0xc202('0x8a')],'server/files/chat/iframe.ejs'),_0xc202('0xe4'));var _0x15cebb='3.10.1';var _0x3318f2=![];var _0x3df8a6,_0x271ac3;if(_0x574c42['headers']['referer']){_0x3df8a6=new URL(_0x574c42[_0xc202('0xb7')][_0xc202('0x41')])[_0xc202('0x112')];}else if(_0x574c42[_0xc202('0xb7')][_0xc202('0x112')]){_0x3df8a6=new URL(_0x574c42['headers']['origin'])[_0xc202('0x112')];}else{_0x3df8a6=_0xc202('0x113');}_0x271ac3=typeof _0x11f203[_0xc202('0x114')][_0xc202('0x3d')](',')[_0xc202('0x6a')](function(_0x5d435e){return wildcardUtils['testWebsiteWithWildcard'](_0x5d435e,_0x3df8a6);})!==_0xc202('0x2a');var _0x590be4={'chatVersion':_0x15cebb,'chatWebsiteAddressOrigin':_0x271ac3?_0x3df8a6:_0x11f203[_0xc202('0x114')],'remote':_0x11f203[_0xc202('0x115')],'query':querystring['stringify'](_[_0xc202('0x61')](_0x11f203[_0xc202('0x31')]({'plain':!![]}),{'customerIp':_0x574c42[_0xc202('0xb7')][_0xc202('0x3b')]||_0x574c42['headers'][_0xc202('0x116')]||_0x574c42[_0xc202('0x117')]['remoteAddress']||_0x574c42['ip'],'referer':_0x574c42[_0xc202('0xb7')][_0xc202('0x41')],'openedInteractions':_0x5398b2,'maxInteractions':_0x1cad99,'virtual':_0x22fa07['virtual'],'online':_0x130542,'custom':_0x22fa07,'address':_0x271ac3?_0x3df8a6:null}))[_0xc202('0x118')](/'/g,'\x5c\x27')};_0x1ce067['send'](ejs['render'](Mustache[_0xc202('0xe5')](_0x43a30e,_0x590be4),{'proactiveActions':_0x5667e6,'alignment':_0x11f203['alignment'],'verticalAlignment':_0x11f203['verticalAlignment'],'div_color':_0x11f203[_0xc202('0x109')],'labelText':_0x11f203[_0xc202('0x119')],'text_color':_0x11f203[_0xc202('0x11a')],'text_button_color':_0x11f203[_0xc202('0x11b')],'button_color':_0x11f203[_0xc202('0x11c')],'background_color':_0x11f203[_0xc202('0x11d')],'hideWhenOffline':_0x11f203[_0xc202('0x11e')],'intervalId':_0x11f203[_0xc202('0x11f')],'isDevelopment':_0x3318f2,'chatVersion':_0x15cebb}));})[_0xc202('0x6b')](handleError(_0x1ce067,null));};exports['addApplications']=function(_0x4c5ff1,_0x35c279){var _0x33c584=_0x4c5ff1['params']['id'];var _0x45da3e=_0x4c5ff1[_0xc202('0x70')];var _0x21bca1=0xc8;var _0x13e5ac=null;return db['sequelize'][_0xc202('0xee')]({'isolationLevel':db[_0xc202('0xed')][_0xc202('0x120')][_0xc202('0x121')][_0xc202('0x122')]},function(_0xda11ce){return db[_0xc202('0x4f')][_0xc202('0x7d')]({'where':{'id':_0x33c584},'transaction':_0xda11ce})['then'](function(_0xb1ad01){if(_0xb1ad01){return db[_0xc202('0x123')][_0xc202('0x30')]({'where':{'ChatWebsiteId':_0x33c584},'transaction':_0xda11ce})['then'](function(){var _0xfb699f=_['map'](_0x45da3e,function(_0x43f08c){_0x43f08c[_0xc202('0x7a')]=_0x33c584;return _0x43f08c;});return db[_0xc202('0x123')][_0xc202('0x124')](_0xfb699f,{'transaction':_0xda11ce});});}else{_0x21bca1=0x194;_0x13e5ac=[];}});})[_0xc202('0x1d')](function(){if(_0x21bca1!==0x194){return db[_0xc202('0x123')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x33c584},'order':_0xc202('0xb4')})['then'](function(_0x30581b){_0x13e5ac=_0x30581b;});}})[_0xc202('0x6b')](function(_0x50edd5){_0x21bca1=0x1f4;logger[_0xc202('0x22')](_0x50edd5[_0xc202('0x125')]);if(_0x50edd5[_0xc202('0x34')]){delete _0x50edd5['name'];}_0x13e5ac=_0x50edd5;})[_0xc202('0x126')](function(){if(_0x13e5ac===null){_0x35c279['sendStatus'](_0x21bca1);}else{if(_0x21bca1===0x1f4){_0x35c279[_0xc202('0x28')](_0x21bca1)['send'](_0x13e5ac);}else{_0x35c279[_0xc202('0x28')](_0x21bca1)['json'](_0x13e5ac);}}});};exports[_0xc202('0x127')]=function(_0x458e18,_0x241669){var _0x564f29={};var _0x3df3bf={};var _0x49e94d;var _0x51d4ec;return db[_0xc202('0x4f')][_0xc202('0x7d')]({'where':{'id':_0x458e18[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x241669,null))[_0xc202('0x1d')](function(_0x502ab3){if(_0x502ab3){_0x49e94d=_0x502ab3;_0x3df3bf[_0xc202('0x48')]=_['keys'](db['ChatApplication'][_0xc202('0x50')]);_0x3df3bf[_0xc202('0x54')]=_[_0xc202('0x55')](_0x458e18['query']);_0x3df3bf[_0xc202('0x56')]=_[_0xc202('0x57')](_0x3df3bf['model'],_0x3df3bf[_0xc202('0x54')]);_0x564f29[_0xc202('0x59')]=_[_0xc202('0x57')](_0x3df3bf[_0xc202('0x48')],qs[_0xc202('0x58')](_0x458e18[_0xc202('0x54')][_0xc202('0x58')]));_0x564f29['attributes']=_0x564f29[_0xc202('0x59')][_0xc202('0x69')]?_0x564f29['attributes']:_0x3df3bf[_0xc202('0x48')];_0x564f29[_0xc202('0x5b')]=qs[_0xc202('0x5c')](_0x458e18[_0xc202('0x54')][_0xc202('0x5c')]);_0x564f29['where']=qs[_0xc202('0x56')](_['pick'](_0x458e18['query'],_0x3df3bf[_0xc202('0x56')]));if(_0x458e18[_0xc202('0x54')]['filter']){_0x564f29[_0xc202('0x5d')]=_[_0xc202('0x61')](_0x564f29[_0xc202('0x5d')],{'$or':_[_0xc202('0x53')](_0x564f29[_0xc202('0x59')],function(_0x170c56){var _0x1df94e={};_0x1df94e[_0x170c56]={'$like':'%'+_0x458e18[_0xc202('0x54')][_0xc202('0x5f')]+'%'};return _0x1df94e;})});}_0x564f29=_[_0xc202('0x61')]({},_0x564f29,_0x458e18['options']);return _0x49e94d[_0xc202('0x127')](_0x564f29);}})[_0xc202('0x1d')](function(_0x3e23ca){if(_0x3e23ca){_0x51d4ec=_0x3e23ca[_0xc202('0x69')];if(!_0x458e18[_0xc202('0x54')][_0xc202('0x5a')]('nolimit')){_0x564f29['limit']=qs['limit'](_0x458e18[_0xc202('0x54')]['limit']);_0x564f29['offset']=qs[_0xc202('0x2c')](_0x458e18[_0xc202('0x54')]['offset']);}return _0x49e94d['getApplications'](_0x564f29);}})['then'](function(_0x1a523c){if(_0x1a523c){return _0x1a523c?{'count':_0x51d4ec,'rows':_0x1a523c}:null;}})['then'](respondWithResult(_0x241669,null))[_0xc202('0x6b')](handleError(_0x241669,null));};exports[_0xc202('0x128')]=function(_0x21aff8,_0x347fbb){return db[_0xc202('0x129')][_0xc202('0x6a')]({'where':{'id':_0x21aff8[_0xc202('0x76')]['id']}})['then'](handleEntityNotFound(_0x347fbb,null))[_0xc202('0x1d')](function(_0x5d23f7){if(_0x5d23f7){return _0x5d23f7[_0xc202('0x128')](_0x21aff8[_0xc202('0x70')][_0xc202('0x80')],_[_0xc202('0x104')](_0x21aff8[_0xc202('0x70')],[_0xc202('0x80'),'id'])||{});}})['then'](respondWithResult(_0x347fbb,null))[_0xc202('0x6b')](handleError(_0x347fbb,null));};exports[_0xc202('0x10d')]=function(_0x1cdf57,_0x1f3e6a){var _0xd9dd75={};var _0x17130d={};var _0x350b15;var _0x3d9c89;return db['ChatWebsite'][_0xc202('0x7d')]({'where':{'id':_0x1cdf57['params']['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x1f3e6a,null))['then'](function(_0x252772){if(_0x252772){_0x350b15=_0x252772;_0x17130d[_0xc202('0x48')]=_[_0xc202('0x55')](db[_0xc202('0x12a')][_0xc202('0x50')]);_0x17130d['query']=_[_0xc202('0x55')](_0x1cdf57[_0xc202('0x54')]);_0x17130d[_0xc202('0x56')]=_[_0xc202('0x57')](_0x17130d[_0xc202('0x48')],_0x17130d[_0xc202('0x54')]);_0xd9dd75[_0xc202('0x59')]=_['intersection'](_0x17130d['model'],qs['fields'](_0x1cdf57['query'][_0xc202('0x58')]));_0xd9dd75[_0xc202('0x59')]=_0xd9dd75[_0xc202('0x59')][_0xc202('0x69')]?_0xd9dd75[_0xc202('0x59')]:_0x17130d[_0xc202('0x48')];_0xd9dd75['order']=qs[_0xc202('0x5c')](_0x1cdf57[_0xc202('0x54')][_0xc202('0x5c')]);_0xd9dd75[_0xc202('0x5d')]=qs['filters'](_[_0xc202('0x5e')](_0x1cdf57[_0xc202('0x54')],_0x17130d['filters']));if(_0x1cdf57[_0xc202('0x54')]['filter']){_0xd9dd75[_0xc202('0x5d')]=_['merge'](_0xd9dd75['where'],{'$or':_[_0xc202('0x53')](_0xd9dd75['attributes'],function(_0x5b0e5b){var _0x26988d={};_0x26988d[_0x5b0e5b]={'$like':'%'+_0x1cdf57[_0xc202('0x54')][_0xc202('0x5f')]+'%'};return _0x26988d;})});}_0xd9dd75=_[_0xc202('0x61')]({},_0xd9dd75,_0x1cdf57[_0xc202('0x62')]);return _0x350b15['getProactiveActions'](_0xd9dd75);}})['then'](function(_0x31dc3c){if(_0x31dc3c){_0x3d9c89=_0x31dc3c[_0xc202('0x69')];if(!_0x1cdf57['query'][_0xc202('0x5a')]('nolimit')){_0xd9dd75[_0xc202('0x2b')]=qs['limit'](_0x1cdf57[_0xc202('0x54')][_0xc202('0x2b')]);_0xd9dd75['offset']=qs['offset'](_0x1cdf57[_0xc202('0x54')][_0xc202('0x2c')]);}return _0x350b15[_0xc202('0x10d')](_0xd9dd75);}})[_0xc202('0x1d')](function(_0x42b7b6){if(_0x42b7b6){return _0x42b7b6?{'count':_0x3d9c89,'rows':_0x42b7b6}:null;}})[_0xc202('0x1d')](respondWithResult(_0x1f3e6a,null))[_0xc202('0x6b')](handleError(_0x1f3e6a,null));};exports['getFields']=function(_0x3fd086,_0x422baf){var _0x4a7c78=_0x3fd086[_0xc202('0x54')][_0xc202('0x12b')]===_0xc202('0x12c')?'offlineForm':_0xc202('0x12d');return db[_0xc202('0x4f')][_0xc202('0x6a')]({'attributes':['id',_0x4a7c78],'where':{'id':_0x3fd086[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x422baf,null))['then'](function(_0x254d69){if(_0x254d69){var _0x599219=_0x254d69[_0x4a7c78];var _0x3b39a6=_0x599219&&_0x599219[_0xc202('0x12e')]?_0x599219[_0xc202('0x12e')]:[];_0x422baf['send']({'fromKey':_['isNil'](_0x599219[_0xc202('0x12f')])?undefined:_0x599219[_0xc202('0x12f')],'count':_0x3b39a6[_0xc202('0x69')],'rows':_0x3b39a6});}})['catch'](handleError(_0x422baf,null));};exports['getOfflineMessages']=function(_0x1d1b81,_0x5aa4b9){var _0x910f81={'raw':![],'where':{}};var _0x5e1225={};var _0x469bfe={'count':0x0,'rows':[]};return db[_0xc202('0x4f')][_0xc202('0x7d')]({'where':{'id':_0x1d1b81[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x5aa4b9,null))['then'](function(_0x562960){if(_0x562960){_0x5e1225[_0xc202('0x48')]=_['keys'](db[_0xc202('0x130')]['rawAttributes']);_0x5e1225['query']=_[_0xc202('0x55')](_0x1d1b81[_0xc202('0x54')]);_0x5e1225[_0xc202('0x56')]=_[_0xc202('0x57')](_0x5e1225['model'],_0x5e1225[_0xc202('0x54')]);_0x910f81[_0xc202('0x59')]=_[_0xc202('0x57')](_0x5e1225[_0xc202('0x48')],qs[_0xc202('0x58')](_0x1d1b81['query']['fields']));_0x910f81[_0xc202('0x59')]=_0x910f81[_0xc202('0x59')][_0xc202('0x69')]?_0x910f81[_0xc202('0x59')]:_0x5e1225[_0xc202('0x48')];if(!_0x1d1b81['query']['hasOwnProperty']('nolimit')){_0x910f81['limit']=qs[_0xc202('0x2b')](_0x1d1b81[_0xc202('0x54')][_0xc202('0x2b')]);_0x910f81[_0xc202('0x2c')]=qs['offset'](_0x1d1b81[_0xc202('0x54')][_0xc202('0x2c')]);}_0x910f81[_0xc202('0x5b')]=qs[_0xc202('0x5c')](_0x1d1b81['query'][_0xc202('0x5c')]);_0x910f81[_0xc202('0x5d')]=qs[_0xc202('0x56')](_[_0xc202('0x5e')](_0x1d1b81['query'],_0x5e1225['filters']));_0x910f81[_0xc202('0x5d')]['ChatWebsiteId']=_0x562960['id'];if(_0x1d1b81[_0xc202('0x54')][_0xc202('0x5f')]){_0x910f81[_0xc202('0x5d')]=_[_0xc202('0x61')](_0x910f81['where'],{'$or':_[_0xc202('0x53')](_0x910f81[_0xc202('0x59')],function(_0x29a9fc){var _0x28719a={};_0x28719a[_0x29a9fc]={'$like':'%'+_0x1d1b81[_0xc202('0x54')]['filter']+'%'};return _0x28719a;})});}_0x910f81=_[_0xc202('0x61')]({},_0x910f81,_0x1d1b81[_0xc202('0x62')]);return db[_0xc202('0x130')][_0xc202('0x63')]({'where':_0x910f81[_0xc202('0x5d')]})[_0xc202('0x1d')](function(_0x3a03e2){_0x469bfe[_0xc202('0x63')]=_0x3a03e2;if(_0x1d1b81[_0xc202('0x54')][_0xc202('0x64')]){_0x910f81[_0xc202('0x65')]=[{'all':!![]}];}else{_0x910f81[_0xc202('0x65')]=[{'model':db[_0xc202('0xa7')],'as':_0xc202('0x105'),'required':![]},{'model':db['Attachment'],'as':_0xc202('0x131'),'required':![]}];}return db['ChatOfflineMessage'][_0xc202('0x66')](_0x910f81);})[_0xc202('0x1d')](function(_0x11e865){_0x469bfe[_0xc202('0x67')]=_0x11e865;return _0x469bfe;});}})[_0xc202('0x1d')](respondWithFilteredResult(_0x5aa4b9,_0x910f81))[_0xc202('0x6b')](handleError(_0x5aa4b9,null));};exports[_0xc202('0x132')]=function(_0x54152a,_0x54f951){return db[_0xc202('0x4f')]['find']({'where':{'id':_0x54152a[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x54f951,null))['then'](function(_0x216405){if(_0x216405){return _0x216405[_0xc202('0x132')](_0x54152a[_0xc202('0x70')][_0xc202('0x80')],_['omit'](_0x54152a[_0xc202('0x70')],[_0xc202('0x80'),'id'])||{})['spread'](function(_0x55aea6){for(var _0x4ea2e1=0x0;_0x4ea2e1<_0x54152a[_0xc202('0x70')]['ids'][_0xc202('0x69')];_0x4ea2e1+=0x1){socket['emit'](_0xc202('0x133'),{'UserId':Number(_0x54152a[_0xc202('0x70')][_0xc202('0x80')][_0x4ea2e1]),'ChatWebsiteId':Number(_0x54152a[_0xc202('0x76')]['id'])});}return _0x55aea6;});}})['then'](respondWithResult(_0x54f951,null))['catch'](handleError(_0x54f951,null));};exports[_0xc202('0x134')]=function(_0x48c265,_0x2f0bfb){return db[_0xc202('0x4f')][_0xc202('0x6a')]({'where':{'id':_0x48c265[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x2f0bfb,null))['then'](function(_0xac55a1){if(_0xac55a1){return _0xac55a1[_0xc202('0x134')](_0x48c265[_0xc202('0x54')][_0xc202('0x80')])[_0xc202('0x1d')](function(){if(_[_0xc202('0x135')](_0x48c265[_0xc202('0x54')]['ids'])){for(var _0x511242=0x0;_0x511242<_0x48c265['query'][_0xc202('0x80')]['length'];_0x511242+=0x1){socket['emit'](_0xc202('0x136'),{'UserId':Number(_0x48c265[_0xc202('0x54')]['ids'][_0x511242]),'ChatWebsiteId':Number(_0x48c265[_0xc202('0x76')]['id'])});}}else{socket[_0xc202('0x137')](_0xc202('0x136'),{'UserId':Number(_0x48c265[_0xc202('0x54')]['ids']),'ChatWebsiteId':Number(_0x48c265[_0xc202('0x76')]['id'])});}});}})[_0xc202('0x1d')](respondWithStatusCode(_0x2f0bfb,null))[_0xc202('0x6b')](handleError(_0x2f0bfb,null));};exports[_0xc202('0x138')]=function(_0x764ea3,_0x43331c){var _0x43bb37={};var _0x41076d={};var _0x136a25;var _0x5dcf4b;return db[_0xc202('0x4f')]['findOne']({'where':{'id':_0x764ea3[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x43331c,null))[_0xc202('0x1d')](function(_0x525262){if(_0x525262){_0x136a25=_0x525262;_0x41076d['model']=_[_0xc202('0x55')](db[_0xc202('0xc9')]['rawAttributes']);_0x41076d[_0xc202('0x54')]=_[_0xc202('0x55')](_0x764ea3[_0xc202('0x54')]);_0x41076d['filters']=_[_0xc202('0x57')](_0x41076d[_0xc202('0x48')],_0x41076d[_0xc202('0x54')]);_0x43bb37[_0xc202('0x59')]=_[_0xc202('0x57')](_0x41076d[_0xc202('0x48')],qs['fields'](_0x764ea3[_0xc202('0x54')]['fields']));_0x43bb37[_0xc202('0x59')]=_0x43bb37[_0xc202('0x59')]['length']?_0x43bb37[_0xc202('0x59')]:_0x41076d[_0xc202('0x48')];_0x43bb37[_0xc202('0x5b')]=qs[_0xc202('0x5c')](_0x764ea3[_0xc202('0x54')][_0xc202('0x5c')]);_0x43bb37[_0xc202('0x5d')]=qs['filters'](_[_0xc202('0x5e')](_0x764ea3[_0xc202('0x54')],_0x41076d[_0xc202('0x56')]));if(_0x764ea3[_0xc202('0x54')][_0xc202('0x5f')]){_0x43bb37[_0xc202('0x5d')]=_['merge'](_0x43bb37[_0xc202('0x5d')],{'$or':_['map'](_0x43bb37[_0xc202('0x59')],function(_0x542a36){var _0x17de40={};_0x17de40[_0x542a36]={'$like':'%'+_0x764ea3[_0xc202('0x54')]['filter']+'%'};return _0x17de40;})});}_0x43bb37=_[_0xc202('0x61')]({},_0x43bb37,_0x764ea3[_0xc202('0x62')]);return _0x136a25['getAgents'](_0x43bb37);}})['then'](function(_0x4006ae){if(_0x4006ae){_0x5dcf4b=_0x4006ae[_0xc202('0x69')];if(!_0x764ea3[_0xc202('0x54')][_0xc202('0x5a')](_0xc202('0x7e'))){_0x43bb37[_0xc202('0x2b')]=qs[_0xc202('0x2b')](_0x764ea3[_0xc202('0x54')][_0xc202('0x2b')]);_0x43bb37[_0xc202('0x2c')]=qs[_0xc202('0x2c')](_0x764ea3[_0xc202('0x54')][_0xc202('0x2c')]);}return _0x136a25['getAgents'](_0x43bb37);}})[_0xc202('0x1d')](function(_0x5ebfd1){if(_0x5ebfd1){return _0x5ebfd1?{'count':_0x5dcf4b,'rows':_0x5ebfd1}:null;}})[_0xc202('0x1d')](respondWithResult(_0x43331c,null))[_0xc202('0x6b')](handleError(_0x43331c,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 92322ae..2297396 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 _0x99c9=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite'];(function(_0x3c569d,_0x13f97d){var _0x5f3326=function(_0xf005f3){while(--_0xf005f3){_0x3c569d['push'](_0x3c569d['shift']());}};_0x5f3326(++_0x13f97d);}(_0x99c9,0x13c));var _0x999c=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x99c9[_0x36ed48];return _0x51c63a;};'use strict';var EventEmitter=require(_0x999c('0x0'));var ChatWebsite=require(_0x999c('0x1'))['db'][_0x999c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x999c('0x3')](0x0);var events={'afterCreate':_0x999c('0x4'),'afterUpdate':_0x999c('0x5'),'afterDestroy':_0x999c('0x6')};function emitEvent(_0x52dc75){return function(_0x2a4e06,_0x140cd5,_0x2d4f2d){ChatWebsiteEvents[_0x999c('0x7')](_0x52dc75+':'+_0x2a4e06['id'],_0x2a4e06);ChatWebsiteEvents[_0x999c('0x7')](_0x52dc75,_0x2a4e06);_0x2d4f2d(null);};}for(var e in events){if(events[_0x999c('0x8')](e)){var event=events[e];ChatWebsite[_0x999c('0x9')](e,emitEvent(event));}}module[_0x999c('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xb0b9=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x4716ec,_0x34b4c9){var _0x6e31b0=function(_0x3dbf0a){while(--_0x3dbf0a){_0x4716ec['push'](_0x4716ec['shift']());}};_0x6e31b0(++_0x34b4c9);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x77d8b3,_0xbcb559){_0x77d8b3=_0x77d8b3-0x0;var _0x3306d4=_0xb0b9[_0x77d8b3];return _0x3306d4;};'use strict';var EventEmitter=require(_0x9b0b('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9b0b('0x1')](0x0);var events={'afterCreate':_0x9b0b('0x2'),'afterUpdate':_0x9b0b('0x3'),'afterDestroy':_0x9b0b('0x4')};function emitEvent(_0x1888ce){return function(_0xeb15c0,_0x311e29,_0x271b79){ChatWebsiteEvents[_0x9b0b('0x5')](_0x1888ce+':'+_0xeb15c0['id'],_0xeb15c0);ChatWebsiteEvents[_0x9b0b('0x5')](_0x1888ce,_0xeb15c0);_0x271b79(null);};}for(var e in events){if(events[_0x9b0b('0x6')](e)){var event=events[e];ChatWebsite[_0x9b0b('0x7')](e,emitEvent(event));}}module[_0x9b0b('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 32652b3..ae0f035 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 _0x993d=['../../config/environment','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x22c5df,_0x445b1a){var _0x193166=function(_0x43ef54){while(--_0x43ef54){_0x22c5df['push'](_0x22c5df['shift']());}};_0x193166(++_0x445b1a);}(_0x993d,0x7c));var _0xd993=function(_0x42203c,_0x448a8a){_0x42203c=_0x42203c-0x0;var _0x267a6d=_0x993d[_0x42203c];return _0x267a6d;};'use strict';var _=require(_0xd993('0x0'));var util=require(_0xd993('0x1'));var logger=require(_0xd993('0x2'))(_0xd993('0x3'));var moment=require(_0xd993('0x4'));var BPromise=require('bluebird');var rp=require(_0xd993('0x5'));var fs=require('fs');var path=require(_0xd993('0x6'));var rimraf=require(_0xd993('0x7'));var config=require(_0xd993('0x8'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0xa4c7da,_0x2bcf5a){return _0xa4c7da[_0xd993('0x9')](_0xd993('0xa'),attributes,{'tableName':_0xd993('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb2db=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','ChatWebsite','chat_websites','lodash','util'];(function(_0x208f5e,_0x466ecf){var _0x502ccc=function(_0x3a9071){while(--_0x3a9071){_0x208f5e['push'](_0x208f5e['shift']());}};_0x502ccc(++_0x466ecf);}(_0xb2db,0x15a));var _0xbb2d=function(_0x163cce,_0x688663){_0x163cce=_0x163cce-0x0;var _0x10bd6b=_0xb2db[_0x163cce];return _0x10bd6b;};'use strict';var _=require(_0xbb2d('0x0'));var util=require(_0xbb2d('0x1'));var logger=require('../../config/logger')(_0xbb2d('0x2'));var moment=require(_0xbb2d('0x3'));var BPromise=require(_0xbb2d('0x4'));var rp=require(_0xbb2d('0x5'));var fs=require('fs');var path=require(_0xbb2d('0x6'));var rimraf=require(_0xbb2d('0x7'));var config=require(_0xbb2d('0x8'));var attributes=require(_0xbb2d('0x9'));module['exports']=function(_0x1121a7,_0x554b0a){return _0x1121a7['define'](_0xbb2d('0xa'),attributes,{'tableName':_0xbb2d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 58e5568..72234a2 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 _0xbe31=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x18a5b3,_0x4f4784){var _0x54b51c=function(_0x42773a){while(--_0x42773a){_0x18a5b3['push'](_0x18a5b3['shift']());}};_0x54b51c(++_0x4f4784);}(_0xbe31,0x103));var _0x1be3=function(_0x11e2f0,_0x150828){_0x11e2f0=_0x11e2f0-0x0;var _0x1d9680=_0xbe31[_0x11e2f0];return _0x1d9680;};'use strict';var _=require(_0x1be3('0x0'));var util=require(_0x1be3('0x1'));var moment=require(_0x1be3('0x2'));var BPromise=require(_0x1be3('0x3'));var rs=require(_0x1be3('0x4'));var fs=require('fs');var Redis=require(_0x1be3('0x5'));var db=require(_0x1be3('0x6'))['db'];var utils=require(_0x1be3('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1be3('0x8'));var jayson=require(_0x1be3('0x9'));var client=jayson['client'][_0x1be3('0xa')]({'port':0x232a});config[_0x1be3('0xb')]=_[_0x1be3('0xc')](config[_0x1be3('0xb')],{'host':_0x1be3('0xd'),'port':0x18eb});var socket=require(_0x1be3('0xe'))(new Redis(config[_0x1be3('0xb')]));require('./chatWebsite.socket')[_0x1be3('0xf')](socket);function respondWithRpcPromise(_0x480651,_0x5362e4,_0x2ee1f0){return new BPromise(function(_0x4440bc,_0x370bce){return client[_0x1be3('0x10')](_0x480651,_0x2ee1f0)[_0x1be3('0x11')](function(_0x1f9c7b){logger['info'](_0x1be3('0x12'),_0x5362e4,'request\x20sent');logger['debug'](_0x1be3('0x13'),_0x5362e4,_0x1be3('0x14'),JSON[_0x1be3('0x15')](_0x1f9c7b));if(_0x1f9c7b['error']){if(_0x1f9c7b[_0x1be3('0x16')][_0x1be3('0x17')]===0x1f4){logger[_0x1be3('0x16')](_0x1be3('0x12'),_0x5362e4,_0x1f9c7b[_0x1be3('0x16')][_0x1be3('0x18')]);return _0x370bce(_0x1f9c7b[_0x1be3('0x16')]['message']);}logger[_0x1be3('0x16')](_0x1be3('0x12'),_0x5362e4,_0x1f9c7b[_0x1be3('0x16')][_0x1be3('0x18')]);return _0x4440bc(_0x1f9c7b[_0x1be3('0x16')]['message']);}else{logger[_0x1be3('0x19')](_0x1be3('0x12'),_0x5362e4,_0x1be3('0x14'));_0x4440bc(_0x1f9c7b[_0x1be3('0x1a')][_0x1be3('0x18')]);}})[_0x1be3('0x1b')](function(_0x466ab5){logger[_0x1be3('0x16')](_0x1be3('0x12'),_0x5362e4,_0x466ab5);_0x370bce(_0x466ab5);});});}
\ No newline at end of file
+var _0xabb0=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','request\x20sent','debug','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','util','moment'];(function(_0x36ac5e,_0x5a8b5d){var _0x4fadf2=function(_0x3bcb4e){while(--_0x3bcb4e){_0x36ac5e['push'](_0x36ac5e['shift']());}};_0x4fadf2(++_0x5a8b5d);}(_0xabb0,0x116));var _0x0abb=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xabb0[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x0abb('0x0'));var moment=require(_0x0abb('0x1'));var BPromise=require(_0x0abb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0abb('0x3'));var db=require(_0x0abb('0x4'))['db'];var utils=require(_0x0abb('0x5'));var logger=require(_0x0abb('0x6'))(_0x0abb('0x7'));var config=require(_0x0abb('0x8'));var jayson=require(_0x0abb('0x9'));var client=jayson[_0x0abb('0xa')][_0x0abb('0xb')]({'port':0x232a});config[_0x0abb('0xc')]=_[_0x0abb('0xd')](config[_0x0abb('0xc')],{'host':_0x0abb('0xe'),'port':0x18eb});var socket=require(_0x0abb('0xf'))(new Redis(config['redis']));require(_0x0abb('0x10'))['register'](socket);function respondWithRpcPromise(_0x2d9923,_0x138e05,_0x4946f7){return new BPromise(function(_0x47f595,_0x26b003){return client[_0x0abb('0x11')](_0x2d9923,_0x4946f7)[_0x0abb('0x12')](function(_0x5d800f){logger[_0x0abb('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x138e05,_0x0abb('0x14'));logger[_0x0abb('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x138e05,_0x0abb('0x14'),JSON[_0x0abb('0x16')](_0x5d800f));if(_0x5d800f[_0x0abb('0x17')]){if(_0x5d800f[_0x0abb('0x17')][_0x0abb('0x18')]===0x1f4){logger[_0x0abb('0x17')](_0x0abb('0x19'),_0x138e05,_0x5d800f['error'][_0x0abb('0x1a')]);return _0x26b003(_0x5d800f[_0x0abb('0x17')]['message']);}logger['error'](_0x0abb('0x19'),_0x138e05,_0x5d800f[_0x0abb('0x17')][_0x0abb('0x1a')]);return _0x47f595(_0x5d800f[_0x0abb('0x17')][_0x0abb('0x1a')]);}else{logger[_0x0abb('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x138e05,'request\x20sent');_0x47f595(_0x5d800f[_0x0abb('0x1b')][_0x0abb('0x1a')]);}})['catch'](function(_0x5d1460){logger[_0x0abb('0x17')](_0x0abb('0x19'),_0x138e05,_0x5d1460);_0x26b003(_0x5d1460);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index e6bfc05..2c6599b 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 _0x21ef=['remove','update','removeListener','register','length','chatWebsite:'];(function(_0x40e074,_0x391ad8){var _0x33014d=function(_0x3e1983){while(--_0x3e1983){_0x40e074['push'](_0x40e074['shift']());}};_0x33014d(++_0x391ad8);}(_0x21ef,0x108));var _0xf21e=function(_0x48d0d2,_0xa6a3ee){_0x48d0d2=_0x48d0d2-0x0;var _0x176c2b=_0x21ef[_0x48d0d2];return _0x176c2b;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0xf21e('0x0'),_0xf21e('0x1')];function createListener(_0x2032b8,_0x208231){return function(_0x2aa165){_0x208231['emit'](_0x2032b8,_0x2aa165);};}function removeListener(_0x352bd7,_0x7c82ef){return function(){ChatWebsiteEvents[_0xf21e('0x2')](_0x352bd7,_0x7c82ef);};}exports[_0xf21e('0x3')]=function(_0x2ff04a){for(var _0x2b4fdc=0x0,_0x4384fe=events[_0xf21e('0x4')];_0x2b4fdc<_0x4384fe;_0x2b4fdc++){var _0x294e38=events[_0x2b4fdc];var _0x2dc2f2=createListener(_0xf21e('0x5')+_0x294e38,_0x2ff04a);ChatWebsiteEvents['on'](_0x294e38,_0x2dc2f2);}};
\ No newline at end of file
+var _0x3ddd=['removeListener','register','chatWebsite:','save','update','emit'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x3ddd,0x1bf));var _0xd3dd=function(_0xa5e8d7,_0x2baefd){_0xa5e8d7=_0xa5e8d7-0x0;var _0x4e6b0c=_0x3ddd[_0xa5e8d7];return _0x4e6b0c;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xd3dd('0x0'),'remove',_0xd3dd('0x1')];function createListener(_0x126f9a,_0x2bc8bf){return function(_0x1789aa){_0x2bc8bf[_0xd3dd('0x2')](_0x126f9a,_0x1789aa);};}function removeListener(_0x587612,_0xe4fabd){return function(){ChatWebsiteEvents[_0xd3dd('0x3')](_0x587612,_0xe4fabd);};}exports[_0xd3dd('0x4')]=function(_0x72f2a3){for(var _0x1e71b1=0x0,_0x57d15a=events['length'];_0x1e71b1<_0x57d15a;_0x1e71b1++){var _0x4c3aba=events[_0x1e71b1];var _0x195649=createListener(_0xd3dd('0x5')+_0x4c3aba,_0x72f2a3);ChatWebsiteEvents['on'](_0x4c3aba,_0x195649);}};
\ 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 96e14de..d7bb8ae 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 _0xd991=['URL','replace','localhost','test','trim','([\x5cw]+)','exports','../../../utils/misc','escapeRegExp','url'];(function(_0x24a8f1,_0xafbff1){var _0x1bb3b2=function(_0x4d65c1){while(--_0x4d65c1){_0x24a8f1['push'](_0x24a8f1['shift']());}};_0x1bb3b2(++_0xafbff1);}(_0xd991,0x115));var _0x1d99=function(_0x45f2d6,_0x5df5ec){_0x45f2d6=_0x45f2d6-0x0;var _0x341361=_0xd991[_0x45f2d6];return _0x341361;};var escapeRegExp=require(_0x1d99('0x0'))[_0x1d99('0x1')];var URL=require(_0x1d99('0x2'))[_0x1d99('0x3')];function testWildcardValidity(_0x163bfb){var _0x5e7e82=!![];try{new URL(_0x163bfb[_0x1d99('0x4')]('*',_0x1d99('0x5')));}catch(_0xf03459){_0x5e7e82=![];}return _0x5e7e82&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x1d99('0x6')](_0x163bfb);}function testWebsiteWithWildcard(_0x300c32,_0x1474ff){var _0x5f3a37;var _0x1adbca=escapeRegExp(_0x300c32[_0x1d99('0x7')]()['replace'](/\/$/,''))[_0x1d99('0x4')]('\x5c*',_0x1d99('0x8'));try{new URL(_0x300c32[_0x1d99('0x4')]('\x5c*',_0x1d99('0x5')));_0x5f3a37=new RegExp(_0x1adbca)[_0x1d99('0x6')](_0x1474ff);}catch(_0x3d55b1){_0x5f3a37=![];}return _0x5f3a37;}module[_0x1d99('0x9')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0xd6f9=['test','exports','../../../utils/misc','escapeRegExp','replace','localhost'];(function(_0x57928b,_0x29a111){var _0x49aad6=function(_0x34a268){while(--_0x34a268){_0x57928b['push'](_0x57928b['shift']());}};_0x49aad6(++_0x29a111);}(_0xd6f9,0x1ca));var _0x9d6f=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xd6f9[_0x513aa5];return _0x1a1a7c;};var escapeRegExp=require(_0x9d6f('0x0'))[_0x9d6f('0x1')];var URL=require('url')['URL'];function testWildcardValidity(_0x2ddc4a){var _0x2eb1a8=!![];try{new URL(_0x2ddc4a[_0x9d6f('0x2')]('*',_0x9d6f('0x3')));}catch(_0x5d8c7f){_0x2eb1a8=![];}return _0x2eb1a8&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x9d6f('0x4')](_0x2ddc4a);}function testWebsiteWithWildcard(_0x39810d,_0x3ffd28){var _0x5ec60d;var _0x12d741=escapeRegExp(_0x39810d['trim']()['replace'](/\/$/,''))[_0x9d6f('0x2')]('\x5c*','([\x5cw]+)');try{new URL(_0x39810d[_0x9d6f('0x2')]('\x5c*',_0x9d6f('0x3')));_0x5ec60d=new RegExp(_0x12d741)[_0x9d6f('0x4')](_0x3ffd28);}catch(_0x5f7600){_0x5ec60d=![];}return _0x5ec60d;}module[_0x9d6f('0x5')]={'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 5c61717..7b9d38e 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 _0x3c00=['attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','/:id/interactions','addInteraction','/:id/applications','addApplications','addProactiveActions','addAgents','/:id','update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','diskStorage','join','server/files/images/logos/','format','%s-%s','file','addLogo','server/files/images/avatars/','originalname','/:id/avatar','single','addAvatar','now','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files'];(function(_0x483463,_0x3e8519){var _0x740611=function(_0x5b6971){while(--_0x5b6971){_0x483463['push'](_0x483463['shift']());}};_0x740611(++_0x3e8519);}(_0x3c00,0x18b));var _0x03c0=function(_0x3d4677,_0x1e3dd8){_0x3d4677=_0x3d4677-0x0;var _0x2ea5a5=_0x3c00[_0x3d4677];return _0x2ea5a5;};'use strict';var multer=require('multer');var util=require(_0x03c0('0x0'));var path=require(_0x03c0('0x1'));var timeout=require(_0x03c0('0x2'));var express=require(_0x03c0('0x3'));var router=express[_0x03c0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x03c0('0x5'));var interaction=require(_0x03c0('0x6'));var config=require(_0x03c0('0x7'));var controller=require(_0x03c0('0x8'));router['get']('/',auth[_0x03c0('0x9')](),controller[_0x03c0('0xa')]);router[_0x03c0('0xb')](_0x03c0('0xc'),auth['isAuthenticated'](),controller[_0x03c0('0xd')]);router[_0x03c0('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x03c0('0xe')]);router['get'](_0x03c0('0xf'),auth[_0x03c0('0x9')](),controller[_0x03c0('0x10')]);router[_0x03c0('0xb')](_0x03c0('0x11'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x03c0('0x12'),controller[_0x03c0('0x13')]);router['get']('/:id/avatar',controller['getAvatar']);router[_0x03c0('0xb')](_0x03c0('0x14'),controller[_0x03c0('0x15')]);router[_0x03c0('0xb')](_0x03c0('0x16'),controller[_0x03c0('0x17')]);router[_0x03c0('0xb')]('/:id/interactions',auth[_0x03c0('0x9')](),controller[_0x03c0('0x18')]);router[_0x03c0('0xb')](_0x03c0('0x19'),controller[_0x03c0('0x1a')]);router[_0x03c0('0xb')]('/:id/applications',auth[_0x03c0('0x9')](),controller['getApplications']);router[_0x03c0('0xb')](_0x03c0('0x1b'),auth[_0x03c0('0x9')](),controller[_0x03c0('0x1c')]);router[_0x03c0('0xb')](_0x03c0('0x1d'),controller[_0x03c0('0x1e')]);router['get'](_0x03c0('0x1f'),auth[_0x03c0('0x9')](),controller[_0x03c0('0x20')]);router[_0x03c0('0xb')](_0x03c0('0x21'),auth['isAuthenticated'](),controller['getAgents']);router[_0x03c0('0x22')]('/',auth[_0x03c0('0x9')](),controller[_0x03c0('0x23')]);router['post'](_0x03c0('0xf'),auth[_0x03c0('0x9')](),controller[_0x03c0('0x24')]);router[_0x03c0('0x22')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0x03c0('0x25')]({'destination':function(_0x5eec2c,_0x4617ee,_0x52be23){_0x52be23(null,path[_0x03c0('0x26')](config['root'],_0x03c0('0x27')));},'filename':function(_0xd3b7f,_0x13d55e,_0x374f61){_0x374f61(null,util[_0x03c0('0x28')](_0x03c0('0x29'),Date['now'](),_0x13d55e['originalname']));}})});router['post'](_0x03c0('0x12'),upload['single'](_0x03c0('0x2a')),controller[_0x03c0('0x2b')]);var upload=multer({'storage':multer[_0x03c0('0x25')]({'destination':function(_0x1adf32,_0x1e7c25,_0x3db049){_0x3db049(null,path[_0x03c0('0x26')](config['root'],_0x03c0('0x2c')));},'filename':function(_0x438c09,_0x37a6c4,_0x5cb558){_0x5cb558(null,util[_0x03c0('0x28')](_0x03c0('0x29'),Date['now'](),_0x37a6c4[_0x03c0('0x2d')]));}})});router[_0x03c0('0x22')](_0x03c0('0x2e'),upload[_0x03c0('0x2f')](_0x03c0('0x2a')),controller[_0x03c0('0x30')]);var upload=multer({'storage':multer[_0x03c0('0x25')]({'destination':function(_0x439200,_0x12f400,_0x1a288a){_0x1a288a(null,path[_0x03c0('0x26')](config['root'],_0x03c0('0x2c')));},'filename':function(_0x21eda3,_0x56ddb7,_0x16c2fc){_0x16c2fc(null,util[_0x03c0('0x28')]('%s-%s',Date[_0x03c0('0x31')](),_0x56ddb7['originalname']));}})});router[_0x03c0('0x22')](_0x03c0('0x14'),upload[_0x03c0('0x2f')](_0x03c0('0x2a')),controller[_0x03c0('0x32')]);var upload=multer({'storage':multer[_0x03c0('0x25')]({'destination':function(_0x1ad494,_0x25ebf7,_0x207423){_0x207423(null,path['join'](config['root'],_0x03c0('0x2c')));},'filename':function(_0x484e4b,_0x489dd8,_0x54db79){_0x54db79(null,util[_0x03c0('0x28')](_0x03c0('0x29'),Date['now'](),_0x489dd8[_0x03c0('0x2d')]));}})});router['post'](_0x03c0('0x16'),upload[_0x03c0('0x2f')](_0x03c0('0x2a')),controller[_0x03c0('0x33')]);router[_0x03c0('0x22')](_0x03c0('0x34'),controller[_0x03c0('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x03c0('0x25')]({'destination':function(_0x396b7f,_0x5dfef4,_0x4630c1){const _0x470486=path[_0x03c0('0x26')](config['root'],_0x03c0('0x36'),_0x03c0('0x37'),_0x03c0('0x38'));fs_extra[_0x03c0('0x39')](_0x470486,function(){_0x4630c1(null,_0x470486);});},'filename':function(_0x43ef9b,_0xc63acd,_0x578f30){const _0x4a8131=_0xc63acd[_0x03c0('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x19cb5e=path[_0x03c0('0x3a')](_0x4a8131);const _0x14a213=Date[_0x03c0('0x31')]()+'-'+_0x4a8131[_0x03c0('0x3b')](_0x19cb5e,'')+_0x19cb5e;_0x578f30(null,_0x14a213);}})});router[_0x03c0('0x22')](_0x03c0('0x3c'),offlineUploadMulter[_0x03c0('0x3d')](),controller['offline']);router[_0x03c0('0x22')](_0x03c0('0x3e'),auth[_0x03c0('0x9')](),controller[_0x03c0('0x3f')]);router[_0x03c0('0x22')](_0x03c0('0x40'),auth[_0x03c0('0x9')](),controller[_0x03c0('0x41')]);router[_0x03c0('0x22')]('/:id/proactive_actions',auth[_0x03c0('0x9')](),controller[_0x03c0('0x42')]);router[_0x03c0('0x22')](_0x03c0('0x21'),auth['isAuthenticated'](),controller[_0x03c0('0x43')]);router['put'](_0x03c0('0x44'),auth[_0x03c0('0x9')](),controller[_0x03c0('0x45')]);router[_0x03c0('0x46')]('/:id',auth[_0x03c0('0x9')](),controller[_0x03c0('0x47')]);router['delete'](_0x03c0('0xf'),auth[_0x03c0('0x9')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x03c0('0x48')]);router['delete'](_0x03c0('0x21'),auth[_0x03c0('0x9')](),controller[_0x03c0('0x49')]);module[_0x03c0('0x4a')]=router;
\ No newline at end of file
+var _0xb7d6=['get','/describe','isAuthenticated','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','/:id/applications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','format','now','file','addLogo','join','server/files/images/avatars/','%s-%s','originalname','/:id/avatar','single','addAvatar','addCustomerAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','index'];(function(_0x575057,_0x14baf3){var _0x49dbc8=function(_0x23599a){while(--_0x23599a){_0x575057['push'](_0x575057['shift']());}};_0x49dbc8(++_0x14baf3);}(_0xb7d6,0x8a));var _0x6b7d=function(_0x4d3d33,_0x450541){_0x4d3d33=_0x4d3d33-0x0;var _0x386f63=_0xb7d6[_0x4d3d33];return _0x386f63;};'use strict';var multer=require('multer');var util=require(_0x6b7d('0x0'));var path=require(_0x6b7d('0x1'));var timeout=require(_0x6b7d('0x2'));var express=require(_0x6b7d('0x3'));var router=express[_0x6b7d('0x4')]();var fs_extra=require(_0x6b7d('0x5'));var auth=require(_0x6b7d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6b7d('0x7'));var controller=require(_0x6b7d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6b7d('0x9')]);router[_0x6b7d('0xa')](_0x6b7d('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x6b7d('0xa')]('/:id',auth[_0x6b7d('0xc')](),controller[_0x6b7d('0xd')]);router[_0x6b7d('0xa')](_0x6b7d('0xe'),auth[_0x6b7d('0xc')](),controller['getDispositions']);router[_0x6b7d('0xa')](_0x6b7d('0xf'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x10')]);router['get'](_0x6b7d('0x11'),controller[_0x6b7d('0x12')]);router['get']('/:id/avatar',controller[_0x6b7d('0x13')]);router[_0x6b7d('0xa')](_0x6b7d('0x14'),controller['getCustomerAvatar']);router[_0x6b7d('0xa')](_0x6b7d('0x15'),controller[_0x6b7d('0x16')]);router[_0x6b7d('0xa')](_0x6b7d('0x17'),auth[_0x6b7d('0xc')](),controller['getInteractions']);router[_0x6b7d('0xa')](_0x6b7d('0x18'),controller['getSnippet']);router[_0x6b7d('0xa')](_0x6b7d('0x19'),auth[_0x6b7d('0xc')](),controller['getApplications']);router[_0x6b7d('0xa')](_0x6b7d('0x1a'),auth['isAuthenticated'](),controller['getProactiveActions']);router['get'](_0x6b7d('0x1b'),controller[_0x6b7d('0x1c')]);router['get'](_0x6b7d('0x1d'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x1e')]);router[_0x6b7d('0xa')](_0x6b7d('0x1f'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x20')]);router[_0x6b7d('0x21')]('/',auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x22')]);router[_0x6b7d('0x21')](_0x6b7d('0xe'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x23')]);router[_0x6b7d('0x21')](_0x6b7d('0xf'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x24')]);var upload=multer({'storage':multer[_0x6b7d('0x25')]({'destination':function(_0x59fac2,_0x15c1d1,_0x239ca8){_0x239ca8(null,path['join'](config[_0x6b7d('0x26')],'server/files/images/logos/'));},'filename':function(_0x4a4d0b,_0xbe47e9,_0x31001d){_0x31001d(null,util[_0x6b7d('0x27')]('%s-%s',Date[_0x6b7d('0x28')](),_0xbe47e9['originalname']));}})});router[_0x6b7d('0x21')]('/:id/logo',upload['single'](_0x6b7d('0x29')),controller[_0x6b7d('0x2a')]);var upload=multer({'storage':multer[_0x6b7d('0x25')]({'destination':function(_0x20db57,_0x3850d6,_0x1e613d){_0x1e613d(null,path[_0x6b7d('0x2b')](config[_0x6b7d('0x26')],_0x6b7d('0x2c')));},'filename':function(_0x141566,_0x5a997f,_0x5a3002){_0x5a3002(null,util[_0x6b7d('0x27')](_0x6b7d('0x2d'),Date[_0x6b7d('0x28')](),_0x5a997f[_0x6b7d('0x2e')]));}})});router[_0x6b7d('0x21')](_0x6b7d('0x2f'),upload[_0x6b7d('0x30')](_0x6b7d('0x29')),controller[_0x6b7d('0x31')]);var upload=multer({'storage':multer[_0x6b7d('0x25')]({'destination':function(_0x577f62,_0x273417,_0x2964df){_0x2964df(null,path[_0x6b7d('0x2b')](config[_0x6b7d('0x26')],'server/files/images/avatars/'));},'filename':function(_0xceb7fa,_0xace21e,_0x167756){_0x167756(null,util[_0x6b7d('0x27')](_0x6b7d('0x2d'),Date[_0x6b7d('0x28')](),_0xace21e[_0x6b7d('0x2e')]));}})});router[_0x6b7d('0x21')](_0x6b7d('0x14'),upload['single'](_0x6b7d('0x29')),controller[_0x6b7d('0x32')]);var upload=multer({'storage':multer[_0x6b7d('0x25')]({'destination':function(_0x38f6e3,_0x36f025,_0x145be3){_0x145be3(null,path[_0x6b7d('0x2b')](config[_0x6b7d('0x26')],'server/files/images/avatars/'));},'filename':function(_0x1f2119,_0x36c475,_0x586ad4){_0x586ad4(null,util['format'](_0x6b7d('0x2d'),Date[_0x6b7d('0x28')](),_0x36c475[_0x6b7d('0x2e')]));}})});router[_0x6b7d('0x21')](_0x6b7d('0x15'),upload[_0x6b7d('0x30')](_0x6b7d('0x29')),controller['addSystemAvatar']);router[_0x6b7d('0x21')](_0x6b7d('0x33'),controller[_0x6b7d('0x34')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x945392,_0x4acea9,_0x1a3166){const _0x1731b7=path[_0x6b7d('0x2b')](config['root'],_0x6b7d('0x35'),_0x6b7d('0x36'),_0x6b7d('0x37'));fs_extra[_0x6b7d('0x38')](_0x1731b7,function(){_0x1a3166(null,_0x1731b7);});},'filename':function(_0x1005da,_0x5d8c55,_0xe1f7b8){const _0x477cf2=_0x5d8c55[_0x6b7d('0x2e')][_0x6b7d('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x354b6e=path[_0x6b7d('0x3a')](_0x477cf2);const _0x576464=Date[_0x6b7d('0x28')]()+'-'+_0x477cf2[_0x6b7d('0x39')](_0x354b6e,'')+_0x354b6e;_0xe1f7b8(null,_0x576464);}})});router[_0x6b7d('0x21')](_0x6b7d('0x3b'),offlineUploadMulter[_0x6b7d('0x3c')](),controller[_0x6b7d('0x3d')]);router['post']('/:id/interactions',auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x3e')]);router[_0x6b7d('0x21')](_0x6b7d('0x19'),auth['isAuthenticated'](),controller[_0x6b7d('0x3f')]);router[_0x6b7d('0x21')](_0x6b7d('0x1a'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x40')]);router['post'](_0x6b7d('0x1f'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x41')]);router[_0x6b7d('0x42')](_0x6b7d('0x43'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x44')]);router['delete']('/:id',auth[_0x6b7d('0xc')](),controller['destroy']);router[_0x6b7d('0x45')](_0x6b7d('0xe'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x46')]);router[_0x6b7d('0x45')](_0x6b7d('0xf'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x47')]);router['delete']('/:id/users',auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x48')]);module[_0x6b7d('0x49')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 71bdc61..9685c37 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 _0x7035=['app','get','client-side-logger','use','isAuthenticated','exports','beaver-logger/server','Router','production'];(function(_0x3e817f,_0x3d51df){var _0x2e90b3=function(_0x17c237){while(--_0x17c237){_0x3e817f['push'](_0x3e817f['shift']());}};_0x2e90b3(++_0x3d51df);}(_0x7035,0x69));var _0x5703=function(_0x2b25be,_0x599e51){_0x2b25be=_0x2b25be-0x0;var _0x37bbd4=_0x7035[_0x2b25be];return _0x37bbd4;};var beaverLogger=require(_0x5703('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x5703('0x1')]();var isProduction=config['env']===_0x5703('0x2')||![];function clientSideLogs(_0x14b444,_0x55d7e6,_0x63ad31){var _0x24ccf7=_0x14b444[_0x5703('0x3')][_0x5703('0x4')](_0x5703('0x5'));if(!_0x24ccf7){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x24ccf7,'enableCors':!isProduction})(_0x14b444,_0x55d7e6,_0x63ad31);}router[_0x5703('0x6')](auth[_0x5703('0x7')](),clientSideLogs);module[_0x5703('0x8')]=router;
\ No newline at end of file
+var _0x1653=['use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','Router','production','app','client-side-logger','expressEndpoint','/client-logs'];(function(_0x38e0c4,_0xe994c3){var _0x536e88=function(_0x150aee){while(--_0x150aee){_0x38e0c4['push'](_0x38e0c4['shift']());}};_0x536e88(++_0xe994c3);}(_0x1653,0x1cb));var _0x3165=function(_0x2e58c7,_0x23d092){_0x2e58c7=_0x2e58c7-0x0;var _0x26eb00=_0x1653[_0x2e58c7];return _0x26eb00;};var beaverLogger=require(_0x3165('0x0'));var express=require(_0x3165('0x1'));var auth=require(_0x3165('0x2'));var config=require('../config/environment');var router=express[_0x3165('0x3')]();var isProduction=config['env']===_0x3165('0x4')||![];function clientSideLogs(_0x5ba265,_0x1b4cc1,_0x21fba7){var _0x109cbe=_0x5ba265[_0x3165('0x5')]['get'](_0x3165('0x6'));if(!_0x109cbe){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x3165('0x7')]({'uri':_0x3165('0x8'),'logger':_0x109cbe,'enableCors':!isProduction})(_0x5ba265,_0x1b4cc1,_0x21fba7);}router[_0x3165('0x9')](auth[_0x3165('0xa')](),clientSideLogs);module[_0x3165('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 98fcfc8..eb6febd 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 _0xde4d=['ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','STRING','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports'];(function(_0x5b1c5c,_0x2f4f0a){var _0x26fba2=function(_0x4ffa7c){while(--_0x4ffa7c){_0x5b1c5c['push'](_0x5b1c5c['shift']());}};_0x26fba2(++_0x2f4f0a);}(_0xde4d,0x10f));var _0xdde4=function(_0xc47cc3,_0xace73c){_0xc47cc3=_0xc47cc3-0x0;var _0x55953b=_0xde4d[_0xc47cc3];return _0x55953b;};'use strict';var Sequelize=require(_0xdde4('0x0'));module[_0xdde4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xdde4('0x2')](_0xdde4('0x3'),_0xdde4('0x4'),_0xdde4('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xdde4('0x2')](_0xdde4('0x6'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0xdde4('0x7')},'data2':{'type':Sequelize[_0xdde4('0x8')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xdde4('0x8')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xdde4('0x8')],'comment':_0xdde4('0x9')},'data5':{'type':Sequelize[_0xdde4('0xa')],'comment':_0xdde4('0xb')},'data6':{'type':Sequelize[_0xdde4('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xdde4('0xa')],'comment':_0xdde4('0xc')}};
\ No newline at end of file
+var _0xbd61=['MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x54c080,_0x38a0c8){var _0x504070=function(_0x237922){while(--_0x237922){_0x54c080['push'](_0x54c080['shift']());}};_0x504070(++_0x38a0c8);}(_0xbd61,0xfc));var _0x1bd6=function(_0x34b1e4,_0x55c6f6){_0x34b1e4=_0x34b1e4-0x0;var _0x20da42=_0xbd61[_0x34b1e4];return _0x20da42;};'use strict';var Sequelize=require(_0x1bd6('0x0'));module[_0x1bd6('0x1')]={'name':{'type':Sequelize[_0x1bd6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x1bd6('0x3'),_0x1bd6('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x1bd6('0x5'),_0x1bd6('0x6'))},'data1':{'type':Sequelize[_0x1bd6('0x2')],'comment':_0x1bd6('0x7')},'data2':{'type':Sequelize[_0x1bd6('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x1bd6('0x2')],'comment':_0x1bd6('0x8')},'data4':{'type':Sequelize[_0x1bd6('0x2')],'comment':_0x1bd6('0x9')},'data5':{'type':Sequelize[_0x1bd6('0xa')],'comment':_0x1bd6('0xb')},'data6':{'type':Sequelize[_0x1bd6('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x1bd6('0xa')],'comment':_0x1bd6('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index edebe1e..a900d92 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 _0x046f=['Invalid\x20state\x20parameter','parse','from','state','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','microsoftAuthorization:error','error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','sendStatus','stack','name','send','padEnd','slice','index','CloudProvider','fieldName','key','model','map','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','rows','service','data3','catch','show','keys','rawAttributes','length','find','MicrosoftAzure','Name\x20parameter\x20not\x20specified','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','params','findOne','generateMicrosoftAuthorizationUrl','user','get'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x046f,0x79));var _0xf046=function(_0xd2dc21,_0x4740b1){_0xd2dc21=_0xd2dc21-0x0;var _0x5ea404=_0x046f[_0xd2dc21];return _0x5ea404;};'use strict';var _=require(_0xf046('0x0'));var Redis=require(_0xf046('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xf046('0x2'));var config=require(_0xf046('0x3'));var logger=require(_0xf046('0x4'))(_0xf046('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0xf046('0x6'));config[_0xf046('0x7')]=_[_0xf046('0x8')](config[_0xf046('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf046('0x7')]));var redis=new Redis(config[_0xf046('0x7')]);function respondWithStatusCode(_0x1b6a6b,_0x2d5b21){_0x2d5b21=_0x2d5b21||0xcc;return function(_0x5d45dd){if(_0x5d45dd){return _0x1b6a6b['sendStatus'](_0x2d5b21);}return _0x1b6a6b[_0xf046('0x9')](_0x2d5b21)['end']();};}function respondWithResult(_0x258398,_0x1e995a){_0x1e995a=_0x1e995a||0xc8;return function(_0x185ed1){if(_0x185ed1){return _0x258398[_0xf046('0x9')](_0x1e995a)['json'](_0x185ed1);}};}function respondWithFilteredResult(_0x26842a,_0x776307){return function(_0x460276){if(_0x460276){var _0x17cbe6=typeof _0x776307[_0xf046('0xa')]===_0xf046('0xb')&&typeof _0x776307[_0xf046('0xc')]==='undefined';var _0x47ccd0=_0x460276[_0xf046('0xd')];var _0x3ccc00=_0x17cbe6?0x0:_0x776307[_0xf046('0xa')];var _0x3330fa=_0x17cbe6?_0x460276[_0xf046('0xd')]:_0x776307['offset']+_0x776307['limit'];var _0xae3ed6;if(_0x3330fa>=_0x47ccd0){_0x3330fa=_0x47ccd0;_0xae3ed6=0xc8;}else{_0xae3ed6=0xce;}_0x26842a[_0xf046('0x9')](_0xae3ed6);return _0x26842a[_0xf046('0xe')](_0xf046('0xf'),_0x3ccc00+'-'+_0x3330fa+'/'+_0x47ccd0)[_0xf046('0x10')](_0x460276);}return null;};}function saveUpdates(_0x52ea2f){return function(_0x3281c3){if(_0x3281c3){return _0x3281c3[_0xf046('0x11')](_0x52ea2f)[_0xf046('0x12')](function(_0x5c44b8){return _0x5c44b8;});}return null;};}function removeEntity(_0x117319){return function(_0x4885b6){if(_0x4885b6){return _0x4885b6[_0xf046('0x13')]()[_0xf046('0x12')](function(){_0x117319['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16aef7){return function(_0x27a938){if(!_0x27a938){_0x16aef7[_0xf046('0x14')](0x194);}return _0x27a938;};}function handleError(_0x291243,_0x1ee9d5){_0x1ee9d5=_0x1ee9d5||0x1f4;return function(_0x4a68bd){logger['error'](_0x4a68bd[_0xf046('0x15')]);if(_0x4a68bd[_0xf046('0x16')]){delete _0x4a68bd[_0xf046('0x16')];}_0x291243[_0xf046('0x9')](_0x1ee9d5)[_0xf046('0x17')](_0x4a68bd);};}function maskClientSecret(_0x525b79){return _[_0xf046('0x18')](_0x525b79[_0xf046('0x19')](0x0,0x3),0x14,'*');}exports[_0xf046('0x1a')]=function(_0x2abe12,_0x5c3599){var _0x481de2={},_0x1fc4a3={},_0x4dd992={'count':0x0,'rows':[]};var _0x7167c3=_['map'](db[_0xf046('0x1b')]['rawAttributes'],function(_0x5400c1){return{'name':_0x5400c1[_0xf046('0x1c')],'type':_0x5400c1['type'][_0xf046('0x1d')]};});_0x1fc4a3[_0xf046('0x1e')]=_[_0xf046('0x1f')](_0x7167c3,'name');_0x1fc4a3[_0xf046('0x20')]=_['keys'](_0x2abe12['query']);_0x1fc4a3[_0xf046('0x21')]=_[_0xf046('0x22')](_0x1fc4a3[_0xf046('0x1e')],_0x1fc4a3[_0xf046('0x20')]);_0x481de2[_0xf046('0x23')]=_[_0xf046('0x22')](_0x1fc4a3[_0xf046('0x1e')],qs['fields'](_0x2abe12[_0xf046('0x20')]['fields']));_0x481de2[_0xf046('0x23')]=_0x481de2[_0xf046('0x23')]['length']?_0x481de2[_0xf046('0x23')]:_0x1fc4a3[_0xf046('0x1e')];if(!_0x2abe12[_0xf046('0x20')][_0xf046('0x24')](_0xf046('0x25'))){_0x481de2[_0xf046('0xc')]=qs[_0xf046('0xc')](_0x2abe12[_0xf046('0x20')][_0xf046('0xc')]);_0x481de2[_0xf046('0xa')]=qs['offset'](_0x2abe12[_0xf046('0x20')][_0xf046('0xa')]);}_0x481de2[_0xf046('0x26')]=qs[_0xf046('0x27')](_0x2abe12['query'][_0xf046('0x27')]);_0x481de2[_0xf046('0x28')]=qs[_0xf046('0x21')](_['pick'](_0x2abe12[_0xf046('0x20')],_0x1fc4a3['filters']),_0x7167c3);if(_0x2abe12[_0xf046('0x20')][_0xf046('0x29')]){_0x481de2['where']=_['merge'](_0x481de2[_0xf046('0x28')],{'$or':_[_0xf046('0x1f')](_0x7167c3,function(_0xf1ab6d){if(_0xf1ab6d[_0xf046('0x2a')]!==_0xf046('0x2b')){var _0x352f8a={};_0x352f8a[_0xf1ab6d[_0xf046('0x16')]]={'$like':'%'+_0x2abe12['query'][_0xf046('0x29')]+'%'};return _0x352f8a;}})});}_0x481de2=_[_0xf046('0x2c')]({},_0x481de2,_0x2abe12[_0xf046('0x2d')]);var _0xc9fc47={'where':_0x481de2[_0xf046('0x28')]};return db['CloudProvider'][_0xf046('0xd')](_0xc9fc47)['then'](function(_0xcd4d57){_0x4dd992['count']=_0xcd4d57;if(_0x2abe12[_0xf046('0x20')][_0xf046('0x2e')]){_0x481de2[_0xf046('0x2f')]=[{'all':!![]}];}return db[_0xf046('0x1b')]['findAll'](_0x481de2);})[_0xf046('0x12')](function(_0x162d27){_0x4dd992[_0xf046('0x30')]=_['map'](_0x162d27,function(_0x5642a9){if(_0x5642a9[_0xf046('0x31')]==='MicrosoftAzure'){var _0x4186d4=encryptor['decryptString'](_0x5642a9[_0xf046('0x32')]);_0x5642a9[_0xf046('0x32')]=maskClientSecret(_0x4186d4);}return _0x5642a9;});return _0x4dd992;})['then'](respondWithFilteredResult(_0x5c3599,_0x481de2))[_0xf046('0x33')](handleError(_0x5c3599,null));};exports[_0xf046('0x34')]=function(_0x241f77,_0xb83d9f){var _0x12338e={'raw':!![],'where':{'id':_0x241f77['params']['id']}},_0x5df1fd={};_0x5df1fd[_0xf046('0x1e')]=_[_0xf046('0x35')](db[_0xf046('0x1b')][_0xf046('0x36')]);_0x5df1fd[_0xf046('0x20')]=_['keys'](_0x241f77[_0xf046('0x20')]);_0x5df1fd[_0xf046('0x21')]=_[_0xf046('0x22')](_0x5df1fd['model'],_0x5df1fd[_0xf046('0x20')]);_0x12338e['attributes']=_[_0xf046('0x22')](_0x5df1fd[_0xf046('0x1e')],qs['fields'](_0x241f77[_0xf046('0x20')]['fields']));_0x12338e[_0xf046('0x23')]=_0x12338e[_0xf046('0x23')][_0xf046('0x37')]?_0x12338e['attributes']:_0x5df1fd[_0xf046('0x1e')];if(_0x241f77[_0xf046('0x20')][_0xf046('0x2e')]){_0x12338e[_0xf046('0x2f')]=[{'all':!![]}];}_0x12338e=_[_0xf046('0x2c')]({},_0x12338e,_0x241f77[_0xf046('0x2d')]);return db[_0xf046('0x1b')][_0xf046('0x38')](_0x12338e)[_0xf046('0x12')](handleEntityNotFound(_0xb83d9f,null))[_0xf046('0x12')](function(_0x10f180){if(_0x10f180[_0xf046('0x31')]===_0xf046('0x39')){var _0x684fb1=encryptor['decryptString'](_0x10f180['data3']);_0x10f180[_0xf046('0x32')]=maskClientSecret(_0x684fb1);}return _0x10f180;})['then'](respondWithResult(_0xb83d9f,null))[_0xf046('0x33')](handleError(_0xb83d9f,null));};exports['create']=function(_0x4eaa1b,_0x14d324){if(!_0x4eaa1b['body'][_0xf046('0x16')])throw new Error(_0xf046('0x3a'));if(!_0x4eaa1b[_0xf046('0x3b')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x594b35=db['CloudProvider'][_0xf046('0x36')][_0xf046('0x31')][_0xf046('0x3c')];if(!_0x594b35[_0xf046('0x3d')](_0x4eaa1b[_0xf046('0x3b')][_0xf046('0x31')]))throw new Error(_0xf046('0x3e')+_0x594b35[_0xf046('0x3f')](',\x20'));if(_0x4eaa1b['body'][_0xf046('0x31')]===_0xf046('0x39')&&_0x4eaa1b['body'][_0xf046('0x32')]){_0x4eaa1b[_0xf046('0x3b')]['data3']=encryptor[_0xf046('0x40')](_0x4eaa1b['body'][_0xf046('0x32')]);}return db[_0xf046('0x1b')][_0xf046('0x41')](_0x4eaa1b[_0xf046('0x3b')],{})[_0xf046('0x12')](respondWithResult(_0x14d324,0xc9))['catch'](handleError(_0x14d324,null));};exports[_0xf046('0x11')]=function(_0x9488c0,_0x1c72eb){if(_0x9488c0[_0xf046('0x3b')]['id']){delete _0x9488c0[_0xf046('0x3b')]['id'];}return db[_0xf046('0x1b')][_0xf046('0x38')]({'where':{'id':_0x9488c0[_0xf046('0x42')]['id']}})[_0xf046('0x12')](handleEntityNotFound(_0x1c72eb,null))[_0xf046('0x12')](function(_0x2ac3e0){if(_0x2ac3e0[_0xf046('0x31')]===_0xf046('0x39')&&_0x9488c0[_0xf046('0x3b')][_0xf046('0x32')]){_0x9488c0[_0xf046('0x3b')][_0xf046('0x32')]=encryptor[_0xf046('0x40')](_0x9488c0[_0xf046('0x3b')][_0xf046('0x32')]);}return _0x2ac3e0;})[_0xf046('0x12')](saveUpdates(_0x9488c0[_0xf046('0x3b')],null))[_0xf046('0x12')](respondWithResult(_0x1c72eb,null))['catch'](handleError(_0x1c72eb,null));};exports[_0xf046('0x13')]=function(_0x3a32ab,_0x59223b){return db[_0xf046('0x1b')][_0xf046('0x38')]({'where':{'id':_0x3a32ab[_0xf046('0x42')]['id']}})['then'](handleEntityNotFound(_0x59223b,null))[_0xf046('0x12')](removeEntity(_0x59223b,null))[_0xf046('0x33')](handleError(_0x59223b,null));};exports['oauth2MicrosoftAuthorize']=function(_0x50fc69,_0xc12404){return db[_0xf046('0x1b')][_0xf046('0x43')]({'where':{'id':_0x50fc69['params']['id']},'raw':!![]})[_0xf046('0x12')](function(_0xe004a4){if(!_0xe004a4)return _0xc12404['sendStatus'](0x194);return{'url':oauth[_0xf046('0x44')](_0xe004a4,_0x50fc69[_0xf046('0x45')]['id'])};})[_0xf046('0x12')](respondWithResult(_0xc12404,null))[_0xf046('0x33')](handleError(_0xc12404,null));};exports['oauth2MicrosoftCallback']=function(_0x35abd4,_0x156f93){var _0x1e7ed0=_0x35abd4[_0xf046('0x3b')];var _0x4766ed;var _0x308b21;if(_0x1e7ed0['error'])throw _0x1e7ed0;redis[_0xf046('0x46')](_0x1e7ed0['state'])[_0xf046('0x12')](function(_0x87e579){if(!_0x87e579)throw new Error(_0xf046('0x47'));_0x4766ed=JSON[_0xf046('0x48')](_0x87e579);var _0x2591cd=Buffer[_0xf046('0x49')](_0x1e7ed0[_0xf046('0x4a')],_0xf046('0x4b'))[_0xf046('0x4c')](_0xf046('0x4d'));_0x308b21=JSON['parse'](_0x2591cd);if(!oauth[_0xf046('0x4e')](_0x1e7ed0[_0xf046('0x4f')],_0x4766ed[_0xf046('0x50')]))throw new Error(_0xf046('0x51'));redis[_0xf046('0x52')](_0x1e7ed0[_0xf046('0x4a')]);return oauth[_0xf046('0x53')](_0x1e7ed0[_0xf046('0x54')],_0x4766ed);})['then'](function(_0x571357){_0x4766ed['data5']=_0x571357[_0xf046('0x55')];_0x4766ed[_0xf046('0x56')]=_0x571357[_0xf046('0x57')];return db[_0xf046('0x1b')][_0xf046('0x11')]({'data5':_0x4766ed[_0xf046('0x58')],'data6':_0x4766ed[_0xf046('0x56')]},{'where':{'id':_0x4766ed['id']}});})[_0xf046('0x12')](function(){oauth[_0xf046('0x59')](_0x4766ed);socket['emit']('microsoftAuthorization:success',{'id':_0x308b21['id']});return;})[_0xf046('0x12')](respondWithStatusCode(_0x156f93,null))[_0xf046('0x33')](function(_0x22d648){if(_0x308b21){socket['emit'](_0xf046('0x5a'),{'id':_0x308b21['id']});}if(!_0x4766ed){logger[_0xf046('0x5b')](_0xf046('0x5c'),_0x22d648);return _0x156f93[_0xf046('0x9')](0x1f4)[_0xf046('0x17')](_0x22d648[_0xf046('0x5d')]);}logger['error'](_0xf046('0x5e'),_0x4766ed['id'],JSON[_0xf046('0x5f')](_0x22d648));});};
\ No newline at end of file
+var _0x991f=['CloudProvider','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','rows','MicrosoftAzure','decryptString','data3','show','keys','includeAll','service','catch','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','params','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','error','get','parse','base64','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','state','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','set','update','then','stack','name','padEnd','index','map'];(function(_0x239065,_0x5bde46){var _0x4cda34=function(_0x3f0e4e){while(--_0x3f0e4e){_0x239065['push'](_0x239065['shift']());}};_0x4cda34(++_0x5bde46);}(_0x991f,0x15c));var _0xf991=function(_0x5d7beb,_0x12270){_0x5d7beb=_0x5d7beb-0x0;var _0xe2a97a=_0x991f[_0x5d7beb];return _0xe2a97a;};'use strict';var _=require(_0xf991('0x0'));var Redis=require(_0xf991('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xf991('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');var db=require(_0xf991('0x3'))['db'];var oauth=require(_0xf991('0x4'));config[_0xf991('0x5')]=_[_0xf991('0x6')](config['redis'],{'host':_0xf991('0x7'),'port':0x18eb});var socket=require(_0xf991('0x8'))(new Redis(config[_0xf991('0x5')]));var redis=new Redis(config[_0xf991('0x5')]);function respondWithStatusCode(_0x3dd9ea,_0x58529f){_0x58529f=_0x58529f||0xcc;return function(_0x56df8f){if(_0x56df8f){return _0x3dd9ea[_0xf991('0x9')](_0x58529f);}return _0x3dd9ea[_0xf991('0xa')](_0x58529f)[_0xf991('0xb')]();};}function respondWithResult(_0x471a56,_0x1f330e){_0x1f330e=_0x1f330e||0xc8;return function(_0x49d4bf){if(_0x49d4bf){return _0x471a56[_0xf991('0xa')](_0x1f330e)[_0xf991('0xc')](_0x49d4bf);}};}function respondWithFilteredResult(_0x339e19,_0x443bf0){return function(_0x58ac17){if(_0x58ac17){var _0xdffa06=typeof _0x443bf0[_0xf991('0xd')]==='undefined'&&typeof _0x443bf0[_0xf991('0xe')]===_0xf991('0xf');var _0x3c9653=_0x58ac17['count'];var _0x154003=_0xdffa06?0x0:_0x443bf0['offset'];var _0x633cb5=_0xdffa06?_0x58ac17['count']:_0x443bf0[_0xf991('0xd')]+_0x443bf0[_0xf991('0xe')];var _0x3aa7ba;if(_0x633cb5>=_0x3c9653){_0x633cb5=_0x3c9653;_0x3aa7ba=0xc8;}else{_0x3aa7ba=0xce;}_0x339e19[_0xf991('0xa')](_0x3aa7ba);return _0x339e19[_0xf991('0x10')]('Content-Range',_0x154003+'-'+_0x633cb5+'/'+_0x3c9653)[_0xf991('0xc')](_0x58ac17);}return null;};}function saveUpdates(_0x2db03d){return function(_0x36ddb4){if(_0x36ddb4){return _0x36ddb4[_0xf991('0x11')](_0x2db03d)['then'](function(_0x4042d6){return _0x4042d6;});}return null;};}function removeEntity(_0x3b4a15){return function(_0x4d7cc9){if(_0x4d7cc9){return _0x4d7cc9['destroy']()[_0xf991('0x12')](function(){_0x3b4a15['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2db9f6){return function(_0x382a7b){if(!_0x382a7b){_0x2db9f6['sendStatus'](0x194);}return _0x382a7b;};}function handleError(_0x29eac3,_0x3c5e60){_0x3c5e60=_0x3c5e60||0x1f4;return function(_0x3e7472){logger['error'](_0x3e7472[_0xf991('0x13')]);if(_0x3e7472[_0xf991('0x14')]){delete _0x3e7472[_0xf991('0x14')];}_0x29eac3['status'](_0x3c5e60)['send'](_0x3e7472);};}function maskClientSecret(_0x12e785){return _[_0xf991('0x15')](_0x12e785['slice'](0x0,0x3),0x14,'*');}exports[_0xf991('0x16')]=function(_0x208d7b,_0x4c0edf){var _0x46ba23={},_0x358bc5={},_0x35b24d={'count':0x0,'rows':[]};var _0x491f61=_[_0xf991('0x17')](db[_0xf991('0x18')][_0xf991('0x19')],function(_0x84c901){return{'name':_0x84c901[_0xf991('0x1a')],'type':_0x84c901[_0xf991('0x1b')][_0xf991('0x1c')]};});_0x358bc5[_0xf991('0x1d')]=_[_0xf991('0x17')](_0x491f61,_0xf991('0x14'));_0x358bc5[_0xf991('0x1e')]=_['keys'](_0x208d7b[_0xf991('0x1e')]);_0x358bc5[_0xf991('0x1f')]=_[_0xf991('0x20')](_0x358bc5[_0xf991('0x1d')],_0x358bc5['query']);_0x46ba23[_0xf991('0x21')]=_[_0xf991('0x20')](_0x358bc5[_0xf991('0x1d')],qs[_0xf991('0x22')](_0x208d7b[_0xf991('0x1e')][_0xf991('0x22')]));_0x46ba23['attributes']=_0x46ba23['attributes'][_0xf991('0x23')]?_0x46ba23[_0xf991('0x21')]:_0x358bc5[_0xf991('0x1d')];if(!_0x208d7b[_0xf991('0x1e')][_0xf991('0x24')]('nolimit')){_0x46ba23[_0xf991('0xe')]=qs[_0xf991('0xe')](_0x208d7b['query'][_0xf991('0xe')]);_0x46ba23[_0xf991('0xd')]=qs['offset'](_0x208d7b[_0xf991('0x1e')][_0xf991('0xd')]);}_0x46ba23[_0xf991('0x25')]=qs['sort'](_0x208d7b[_0xf991('0x1e')][_0xf991('0x26')]);_0x46ba23[_0xf991('0x27')]=qs[_0xf991('0x1f')](_[_0xf991('0x28')](_0x208d7b[_0xf991('0x1e')],_0x358bc5[_0xf991('0x1f')]),_0x491f61);if(_0x208d7b['query'][_0xf991('0x29')]){_0x46ba23[_0xf991('0x27')]=_[_0xf991('0x2a')](_0x46ba23['where'],{'$or':_[_0xf991('0x17')](_0x491f61,function(_0x1c7fa8){if(_0x1c7fa8[_0xf991('0x1b')]!==_0xf991('0x2b')){var _0x324fa9={};_0x324fa9[_0x1c7fa8[_0xf991('0x14')]]={'$like':'%'+_0x208d7b[_0xf991('0x1e')][_0xf991('0x29')]+'%'};return _0x324fa9;}})});}_0x46ba23=_[_0xf991('0x2a')]({},_0x46ba23,_0x208d7b[_0xf991('0x2c')]);var _0xfde4d0={'where':_0x46ba23[_0xf991('0x27')]};return db[_0xf991('0x18')]['count'](_0xfde4d0)['then'](function(_0x268c90){_0x35b24d[_0xf991('0x2d')]=_0x268c90;if(_0x208d7b[_0xf991('0x1e')]['includeAll']){_0x46ba23[_0xf991('0x2e')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x46ba23);})[_0xf991('0x12')](function(_0xd5224e){_0x35b24d[_0xf991('0x2f')]=_[_0xf991('0x17')](_0xd5224e,function(_0x3f92fe){if(_0x3f92fe['service']===_0xf991('0x30')){var _0x1c9d24=encryptor[_0xf991('0x31')](_0x3f92fe[_0xf991('0x32')]);_0x3f92fe[_0xf991('0x32')]=maskClientSecret(_0x1c9d24);}return _0x3f92fe;});return _0x35b24d;})[_0xf991('0x12')](respondWithFilteredResult(_0x4c0edf,_0x46ba23))['catch'](handleError(_0x4c0edf,null));};exports[_0xf991('0x33')]=function(_0x1d2223,_0x3aa36f){var _0x1fe5cb={'raw':!![],'where':{'id':_0x1d2223['params']['id']}},_0x169737={};_0x169737[_0xf991('0x1d')]=_[_0xf991('0x34')](db[_0xf991('0x18')]['rawAttributes']);_0x169737['query']=_[_0xf991('0x34')](_0x1d2223[_0xf991('0x1e')]);_0x169737[_0xf991('0x1f')]=_[_0xf991('0x20')](_0x169737[_0xf991('0x1d')],_0x169737[_0xf991('0x1e')]);_0x1fe5cb['attributes']=_['intersection'](_0x169737['model'],qs[_0xf991('0x22')](_0x1d2223[_0xf991('0x1e')][_0xf991('0x22')]));_0x1fe5cb['attributes']=_0x1fe5cb[_0xf991('0x21')][_0xf991('0x23')]?_0x1fe5cb[_0xf991('0x21')]:_0x169737[_0xf991('0x1d')];if(_0x1d2223[_0xf991('0x1e')][_0xf991('0x35')]){_0x1fe5cb[_0xf991('0x2e')]=[{'all':!![]}];}_0x1fe5cb=_[_0xf991('0x2a')]({},_0x1fe5cb,_0x1d2223[_0xf991('0x2c')]);return db[_0xf991('0x18')]['find'](_0x1fe5cb)[_0xf991('0x12')](handleEntityNotFound(_0x3aa36f,null))[_0xf991('0x12')](function(_0x22aa89){if(_0x22aa89[_0xf991('0x36')]===_0xf991('0x30')){var _0x4c1007=encryptor['decryptString'](_0x22aa89['data3']);_0x22aa89['data3']=maskClientSecret(_0x4c1007);}return _0x22aa89;})[_0xf991('0x12')](respondWithResult(_0x3aa36f,null))[_0xf991('0x37')](handleError(_0x3aa36f,null));};exports[_0xf991('0x38')]=function(_0x407c0a,_0x3c9bc1){if(!_0x407c0a[_0xf991('0x39')][_0xf991('0x14')])throw new Error(_0xf991('0x3a'));if(!_0x407c0a[_0xf991('0x39')][_0xf991('0x36')])throw new Error(_0xf991('0x3b'));var _0x544ed7=db[_0xf991('0x18')][_0xf991('0x19')]['service'][_0xf991('0x3c')];if(!_0x544ed7[_0xf991('0x3d')](_0x407c0a[_0xf991('0x39')][_0xf991('0x36')]))throw new Error(_0xf991('0x3e')+_0x544ed7[_0xf991('0x3f')](',\x20'));if(_0x407c0a['body'][_0xf991('0x36')]===_0xf991('0x30')&&_0x407c0a[_0xf991('0x39')]['data3']){_0x407c0a[_0xf991('0x39')]['data3']=encryptor[_0xf991('0x40')](_0x407c0a['body'][_0xf991('0x32')]);}return db[_0xf991('0x18')][_0xf991('0x38')](_0x407c0a[_0xf991('0x39')],{})[_0xf991('0x12')](respondWithResult(_0x3c9bc1,0xc9))[_0xf991('0x37')](handleError(_0x3c9bc1,null));};exports[_0xf991('0x11')]=function(_0x1d48ef,_0x2a3ddd){if(_0x1d48ef['body']['id']){delete _0x1d48ef[_0xf991('0x39')]['id'];}return db[_0xf991('0x18')][_0xf991('0x41')]({'where':{'id':_0x1d48ef[_0xf991('0x42')]['id']}})['then'](handleEntityNotFound(_0x2a3ddd,null))[_0xf991('0x12')](function(_0x1f809e){if(_0x1f809e['service']===_0xf991('0x30')&&_0x1d48ef[_0xf991('0x39')]['data3']){_0x1d48ef[_0xf991('0x39')]['data3']=encryptor[_0xf991('0x40')](_0x1d48ef['body'][_0xf991('0x32')]);}return _0x1f809e;})[_0xf991('0x12')](saveUpdates(_0x1d48ef[_0xf991('0x39')],null))[_0xf991('0x12')](respondWithResult(_0x2a3ddd,null))[_0xf991('0x37')](handleError(_0x2a3ddd,null));};exports['destroy']=function(_0x3777e3,_0x3fa686){return db[_0xf991('0x18')][_0xf991('0x41')]({'where':{'id':_0x3777e3[_0xf991('0x42')]['id']}})[_0xf991('0x12')](handleEntityNotFound(_0x3fa686,null))['then'](removeEntity(_0x3fa686,null))['catch'](handleError(_0x3fa686,null));};exports[_0xf991('0x43')]=function(_0x404c53,_0x5937da){return db['CloudProvider']['findOne']({'where':{'id':_0x404c53[_0xf991('0x42')]['id']},'raw':!![]})[_0xf991('0x12')](function(_0x392bf7){if(!_0x392bf7)return _0x5937da['sendStatus'](0x194);return{'url':oauth[_0xf991('0x44')](_0x392bf7,_0x404c53[_0xf991('0x45')]['id'])};})[_0xf991('0x12')](respondWithResult(_0x5937da,null))[_0xf991('0x37')](handleError(_0x5937da,null));};exports['oauth2MicrosoftCallback']=function(_0x37af08,_0x1430f2){var _0x3e0d54=_0x37af08[_0xf991('0x39')];var _0x17fafd;var _0x456210;if(_0x3e0d54[_0xf991('0x46')])throw _0x3e0d54;redis[_0xf991('0x47')](_0x3e0d54['state'])[_0xf991('0x12')](function(_0x2c5d64){if(!_0x2c5d64)throw new Error('Invalid\x20state\x20parameter');_0x17fafd=JSON[_0xf991('0x48')](_0x2c5d64);var _0x2d7e57=Buffer['from'](_0x3e0d54['state'],_0xf991('0x49'))['toString']('ascii');_0x456210=JSON[_0xf991('0x48')](_0x2d7e57);if(!oauth[_0xf991('0x4a')](_0x3e0d54[_0xf991('0x4b')],_0x17fafd[_0xf991('0x4c')]))throw new Error(_0xf991('0x4d'));redis[_0xf991('0x4e')](_0x3e0d54[_0xf991('0x4f')]);return oauth[_0xf991('0x50')](_0x3e0d54[_0xf991('0x51')],_0x17fafd);})[_0xf991('0x12')](function(_0x726b33){_0x17fafd[_0xf991('0x52')]=_0x726b33['access_token'];_0x17fafd[_0xf991('0x53')]=_0x726b33[_0xf991('0x54')];return db[_0xf991('0x18')][_0xf991('0x11')]({'data5':_0x17fafd[_0xf991('0x52')],'data6':_0x17fafd[_0xf991('0x53')]},{'where':{'id':_0x17fafd['id']}});})[_0xf991('0x12')](function(){oauth[_0xf991('0x55')](_0x17fafd);socket[_0xf991('0x56')](_0xf991('0x57'),{'id':_0x456210['id']});return;})[_0xf991('0x12')](respondWithStatusCode(_0x1430f2,null))['catch'](function(_0x6fda83){if(_0x456210){socket[_0xf991('0x56')]('microsoftAuthorization:error',{'id':_0x456210['id']});}if(!_0x17fafd){logger['error'](_0xf991('0x58'),_0x6fda83);return _0x1430f2[_0xf991('0xa')](0x1f4)[_0xf991('0x59')](_0x6fda83[_0xf991('0x5a')]);}logger['error'](_0xf991('0x5b'),_0x17fafd['id'],JSON[_0xf991('0x5c')](_0x6fda83));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 0a34fe6..438380e 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 _0x65a8=['moment','request-promise','path','./cloudProvider.attributes','define','cloud_providers','../../config/logger'];(function(_0x55d7c2,_0x4ce6fb){var _0x1755ef=function(_0xddc25c){while(--_0xddc25c){_0x55d7c2['push'](_0x55d7c2['shift']());}};_0x1755ef(++_0x4ce6fb);}(_0x65a8,0x1d4));var _0x865a=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x65a8[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x865a('0x0'))('api');var moment=require(_0x865a('0x1'));var BPromise=require('bluebird');var rp=require(_0x865a('0x2'));var fs=require('fs');var path=require(_0x865a('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x865a('0x4'));module['exports']=function(_0x433ac3,_0x1e888e){return _0x433ac3[_0x865a('0x5')]('CloudProvider',attributes,{'tableName':_0x865a('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x895b=['moment','path','rimraf','../../config/environment','define','CloudProvider','cloud_providers','lodash','util','api'];(function(_0x426e3b,_0x2b013b){var _0x662459=function(_0x3d5280){while(--_0x3d5280){_0x426e3b['push'](_0x426e3b['shift']());}};_0x662459(++_0x2b013b);}(_0x895b,0x18d));var _0xb895=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x895b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb895('0x0'));var util=require(_0xb895('0x1'));var logger=require('../../config/logger')(_0xb895('0x2'));var moment=require(_0xb895('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb895('0x4'));var rimraf=require(_0xb895('0x5'));var config=require(_0xb895('0x6'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x1776b5,_0xb11b1b){return _0x1776b5[_0xb895('0x7')](_0xb895('0x8'),attributes,{'tableName':_0xb895('0x9'),'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 a19dd8f..aad91c5 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 _0xa06c=['type','Dynamics365','push','data7','/.default','Outlook365','replace','{TENANT_ID}','code','toString','base64','randomBytes','hex','client_id','redirect_uri','data4','response_mode','form_post','scope','state','prompt','login','oauth2Claims','oauth2/','data1','set','stringify','decode','payload','iss','issuer','aud','audience','nonce','isAfter','unix','exp','resolve','then','data3','findOne','refresh_token','POST','access_token','data6','CloudProvider','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','decryptString','data2','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','moment','request-promise','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map'];(function(_0x388b47,_0x5cdac5){var _0x4859df=function(_0x466a16){while(--_0x466a16){_0x388b47['push'](_0x388b47['shift']());}};_0x4859df(++_0x5cdac5);}(_0xa06c,0xdb));var _0xca06=function(_0x2cd85a,_0x47d1ff){_0x2cd85a=_0x2cd85a-0x0;var _0x48e048=_0xa06c[_0x2cd85a];return _0x48e048;};'use strict';var _=require(_0xca06('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xca06('0x1'));var Redis=require('ioredis');var rp=require(_0xca06('0x2'));var util=require('util');var encryptor=require(_0xca06('0x3'));var config=require('../../config/environment');var logger=require(_0xca06('0x4'))(_0xca06('0x5'));var schedule=require(_0xca06('0x6'));var db=require(_0xca06('0x7'))['db'];config[_0xca06('0x8')]=_[_0xca06('0x9')](config['redis'],{'host':_0xca06('0xa'),'port':0x18eb});var redis=new Redis(config[_0xca06('0x8')]);var MICROSOFT_AUTH_URL=_0xca06('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xca06('0xc'),_0xca06('0xd'),_0xca06('0xe'),_0xca06('0xf'),_0xca06('0x10'),_0xca06('0x11'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':['openid',_0xca06('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0xca06('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xca06('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x645655){var _0x2c7031=_[_0xca06('0x14')](AZURE_AUTH_SCOPES[_0x645655[_0xca06('0x15')]]);if(_0x645655[_0xca06('0x15')]===_0xca06('0x16'))_0x2c7031[_0xca06('0x17')](_0x645655[_0xca06('0x18')]+_0xca06('0x19'));return _0x2c7031['join']('\x20');}function getAccessTokenScope(_0x4357d2){if(_0x4357d2['type']===_0xca06('0x1a'))return _0xca06('0x10');if(_0x4357d2[_0xca06('0x15')]===_0xca06('0x16'))return _0x4357d2[_0xca06('0x18')]+_0xca06('0x19');}function generateMicrosoftAuthorizationUrl(_0x4ce842,_0x31381b){var _0x5cc750=MICROSOFT_AUTH_URL[_0xca06('0x1b')](_0xca06('0x1c'),_0x4ce842['data2']);var _0x2bc8f5=[_0xca06('0x1d'),'id_token'];var _0xc41d6b=Buffer['from'](JSON['stringify']({'id':_0x31381b}))[_0xca06('0x1e')](_0xca06('0x1f'));var _0x1f0b94=crypto[_0xca06('0x20')](0x10)[_0xca06('0x1e')](_0xca06('0x21'));var _0x2affa0=getAuthorizationScopes(_0x4ce842);var _0xd62267=[{'key':_0xca06('0x22'),'value':_0x4ce842['data1']},{'key':'response_type','value':encodeURIComponent(_0x2bc8f5['join']('\x20'))},{'key':_0xca06('0x23'),'value':_0x4ce842[_0xca06('0x24')]},{'key':_0xca06('0x25'),'value':_0xca06('0x26')},{'key':_0xca06('0x27'),'value':encodeURIComponent(_0x2affa0)},{'key':_0xca06('0x28'),'value':_0xc41d6b},{'key':'nonce','value':_0x1f0b94},{'key':_0xca06('0x29'),'value':_0xca06('0x2a')}];var _0x287151=_0x5cc750+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0xd62267,function(_0x13099b){return _0x13099b['key']+'='+_0x13099b['value'];})['join']('&');_0x4ce842[_0xca06('0x2b')]={'issuer':_0x5cc750[_0xca06('0x1b')](_0xca06('0x2c'),''),'audience':_0x4ce842[_0xca06('0x2d')],'state':_0xc41d6b,'nonce':_0x1f0b94};redis[_0xca06('0x2e')](_0xc41d6b,JSON[_0xca06('0x2f')](_0x4ce842));return _0x287151;}function isValidIdToken(_0x10ab4f,_0x201a65){try{var _0x5466fd=jwt[_0xca06('0x30')](_0x10ab4f,{'complete':!![]});var _0x6e1d01=_0x5466fd[_0xca06('0x31')];if(_0x6e1d01[_0xca06('0x32')]!==_0x201a65[_0xca06('0x33')])return![];if(_0x6e1d01[_0xca06('0x34')]!==_0x201a65[_0xca06('0x35')])return![];if(_0x6e1d01[_0xca06('0x36')]!==_0x201a65[_0xca06('0x36')])return![];if(moment()[_0xca06('0x37')](moment[_0xca06('0x38')](_0x6e1d01[_0xca06('0x39')])))return![];return!![];}catch(_0x7622dd){throw _0x7622dd;}}function refreshOauth2MicrosoftAccessToken(_0x2c84d9){return Promise[_0xca06('0x3a')]()[_0xca06('0x3b')](function(){if(_0x2c84d9[_0xca06('0x3c')])return _0x2c84d9;return db['CloudProvider'][_0xca06('0x3d')]({'where':{'id':_0x2c84d9['id']},'raw':!![]});})[_0xca06('0x3b')](function(_0x2c47f9){var _0x12af0f={'grant_type':_0xca06('0x3e'),'refresh_token':_0x2c47f9['data6'],'scope':getAccessTokenScope(_0x2c47f9),'redirect_uri':_0x2c47f9[_0xca06('0x24')],'client_id':_0x2c47f9[_0xca06('0x2d')],'client_secret':encryptor['decryptString'](_0x2c47f9[_0xca06('0x3c')])};var _0x125e1f={'method':_0xca06('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xca06('0x1b')]('{TENANT_ID}',_0x2c47f9['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x12af0f,'json':!![]};return rp(_0x125e1f);})[_0xca06('0x3b')](function(_0x1c0095){_0x2c84d9['data5']=_0x1c0095[_0xca06('0x40')];_0x2c84d9[_0xca06('0x41')]=_0x1c0095['refresh_token'];return db[_0xca06('0x42')]['update']({'data5':_0x2c84d9[_0xca06('0x43')],'data6':_0x2c84d9[_0xca06('0x41')]},{'where':{'id':_0x2c84d9['id']}});})['then'](function(){return _0x2c84d9;})[_0xca06('0x44')](function(_0x34ed8a){logger[_0xca06('0x45')](_0xca06('0x46'),_0x2c84d9['id'],_0x34ed8a);});}function getOauth2MicrosoftAccessToken(_0xc0a62a,_0x14a017){var _0x498e15={'grant_type':'authorization_code','code':_0xc0a62a,'scope':getAccessTokenScope(_0x14a017),'redirect_uri':_0x14a017[_0xca06('0x24')],'client_id':_0x14a017[_0xca06('0x2d')],'client_secret':encryptor[_0xca06('0x47')](_0x14a017[_0xca06('0x3c')])};var _0x13c8ec={'method':_0xca06('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xca06('0x1b')](_0xca06('0x1c'),_0x14a017[_0xca06('0x48')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x498e15,'json':!![]};return rp(_0x13c8ec);}function startRefreshInterval(_0xf659e9){var _0x42cb49=schedule[_0xca06('0x49')];if(_0x42cb49[_0xf659e9['id']])clearInterval(_0x42cb49[_0xf659e9['id']]);_0x42cb49[_0xf659e9['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xca06('0x4a')](this,{'id':_0xf659e9['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xca06('0x49')]=_0x42cb49;}function startAllRefreshIntervals(){return db[_0xca06('0x42')][_0xca06('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xca06('0x3b')](function(_0x53bb9a){var _0x86232a=_0x53bb9a[_0xca06('0x14')](function(_0x5b053a){return refreshOauth2MicrosoftAccessToken(_0x5b053a)[_0xca06('0x3b')](function(_0x1cb17d){startRefreshInterval(_0x1cb17d);});});return Promise[_0xca06('0x4c')](_0x86232a);})[_0xca06('0x44')](function(_0x3adf5b){var _0x560ba1=_0x3adf5b?util[_0xca06('0x4d')](_0x3adf5b,{'showHidden':![],'depth':null}):'';logger[_0xca06('0x45')](_0xca06('0x4e'),_0x560ba1);});}module[_0xca06('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x8d96=['authorization_code','intervals','bind','findAll','all','catch','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','offline_access','/authorize','map','type','Dynamics365','push','/.default','join','data7','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','client_id','response_type','redirect_uri','response_mode','form_post','state','nonce','login','value','oauth2Claims','oauth2/','data1','set','decode','iss','issuer','aud','audience','isAfter','unix','exp','then','CloudProvider','findOne','data6','data4','decryptString','data3','POST','access_token','update','data5','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s'];(function(_0x18c864,_0x5724b1){var _0x5c5373=function(_0x1e3d7b){while(--_0x1e3d7b){_0x18c864['push'](_0x18c864['shift']());}};_0x5c5373(++_0x5724b1);}(_0x8d96,0xa6));var _0x68d9=function(_0x470ada,_0x453059){_0x470ada=_0x470ada-0x0;var _0x5a71e0=_0x8d96[_0x470ada];return _0x5a71e0;};'use strict';var _=require(_0x68d9('0x0'));var crypto=require(_0x68d9('0x1'));var jwt=require(_0x68d9('0x2'));var moment=require(_0x68d9('0x3'));var Redis=require(_0x68d9('0x4'));var rp=require(_0x68d9('0x5'));var util=require(_0x68d9('0x6'));var encryptor=require(_0x68d9('0x7'));var config=require('../../config/environment');var logger=require(_0x68d9('0x8'))(_0x68d9('0x9'));var schedule=require(_0x68d9('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x68d9('0xb')],{'host':_0x68d9('0xc'),'port':0x18eb});var redis=new Redis(config[_0x68d9('0xb')]);var MICROSOFT_AUTH_URL=_0x68d9('0xd');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x68d9('0xe'),'email','offline_access',_0x68d9('0xf'),'https://outlook.office.com/POP.AccessAsUser.All',_0x68d9('0x10')],'Dynamics365':[_0x68d9('0x11'),_0x68d9('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0x68d9('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4a9b27){var _0x116179=_[_0x68d9('0x14')](AZURE_AUTH_SCOPES[_0x4a9b27[_0x68d9('0x15')]]);if(_0x4a9b27[_0x68d9('0x15')]===_0x68d9('0x16'))_0x116179[_0x68d9('0x17')](_0x4a9b27['data7']+_0x68d9('0x18'));return _0x116179[_0x68d9('0x19')]('\x20');}function getAccessTokenScope(_0x257f6d){if(_0x257f6d[_0x68d9('0x15')]==='Outlook365')return _0x68d9('0xf');if(_0x257f6d[_0x68d9('0x15')]===_0x68d9('0x16'))return _0x257f6d[_0x68d9('0x1a')]+_0x68d9('0x18');}function generateMicrosoftAuthorizationUrl(_0x1d42ff,_0xd3feb5){var _0x399c2e=MICROSOFT_AUTH_URL[_0x68d9('0x1b')](_0x68d9('0x1c'),_0x1d42ff[_0x68d9('0x1d')]);var _0x51e3b5=[_0x68d9('0x1e'),_0x68d9('0x1f')];var _0x6e99f=Buffer[_0x68d9('0x20')](JSON[_0x68d9('0x21')]({'id':_0xd3feb5}))[_0x68d9('0x22')](_0x68d9('0x23'));var _0x4774a4=crypto[_0x68d9('0x24')](0x10)[_0x68d9('0x22')]('hex');var _0x3204e8=getAuthorizationScopes(_0x1d42ff);var _0x4a6dbf=[{'key':_0x68d9('0x25'),'value':_0x1d42ff['data1']},{'key':_0x68d9('0x26'),'value':encodeURIComponent(_0x51e3b5[_0x68d9('0x19')]('\x20'))},{'key':_0x68d9('0x27'),'value':_0x1d42ff['data4']},{'key':_0x68d9('0x28'),'value':_0x68d9('0x29')},{'key':'scope','value':encodeURIComponent(_0x3204e8)},{'key':_0x68d9('0x2a'),'value':_0x6e99f},{'key':_0x68d9('0x2b'),'value':_0x4774a4},{'key':'prompt','value':_0x68d9('0x2c')}];var _0x3b3fe2=_0x399c2e+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x68d9('0x14')](_0x4a6dbf,function(_0x586529){return _0x586529['key']+'='+_0x586529[_0x68d9('0x2d')];})[_0x68d9('0x19')]('&');_0x1d42ff[_0x68d9('0x2e')]={'issuer':_0x399c2e[_0x68d9('0x1b')](_0x68d9('0x2f'),''),'audience':_0x1d42ff[_0x68d9('0x30')],'state':_0x6e99f,'nonce':_0x4774a4};redis[_0x68d9('0x31')](_0x6e99f,JSON['stringify'](_0x1d42ff));return _0x3b3fe2;}function isValidIdToken(_0x3de123,_0x3c3b98){try{var _0x22b6e1=jwt[_0x68d9('0x32')](_0x3de123,{'complete':!![]});var _0x29b968=_0x22b6e1['payload'];if(_0x29b968[_0x68d9('0x33')]!==_0x3c3b98[_0x68d9('0x34')])return![];if(_0x29b968[_0x68d9('0x35')]!==_0x3c3b98[_0x68d9('0x36')])return![];if(_0x29b968[_0x68d9('0x2b')]!==_0x3c3b98[_0x68d9('0x2b')])return![];if(moment()[_0x68d9('0x37')](moment[_0x68d9('0x38')](_0x29b968[_0x68d9('0x39')])))return![];return!![];}catch(_0x521bcd){throw _0x521bcd;}}function refreshOauth2MicrosoftAccessToken(_0x4a1fa4){return Promise['resolve']()[_0x68d9('0x3a')](function(){if(_0x4a1fa4['data3'])return _0x4a1fa4;return db[_0x68d9('0x3b')][_0x68d9('0x3c')]({'where':{'id':_0x4a1fa4['id']},'raw':!![]});})['then'](function(_0x2c6534){var _0x4e3871={'grant_type':'refresh_token','refresh_token':_0x2c6534[_0x68d9('0x3d')],'scope':getAccessTokenScope(_0x2c6534),'redirect_uri':_0x2c6534[_0x68d9('0x3e')],'client_id':_0x2c6534['data1'],'client_secret':encryptor[_0x68d9('0x3f')](_0x2c6534[_0x68d9('0x40')])};var _0x2ff640={'method':_0x68d9('0x41'),'uri':MICROSOFT_AUTH_URL[_0x68d9('0x1b')](_0x68d9('0x1c'),_0x2c6534[_0x68d9('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4e3871,'json':!![]};return rp(_0x2ff640);})[_0x68d9('0x3a')](function(_0x507c5f){_0x4a1fa4['data5']=_0x507c5f[_0x68d9('0x42')];_0x4a1fa4[_0x68d9('0x3d')]=_0x507c5f['refresh_token'];return db[_0x68d9('0x3b')][_0x68d9('0x43')]({'data5':_0x4a1fa4[_0x68d9('0x44')],'data6':_0x4a1fa4[_0x68d9('0x3d')]},{'where':{'id':_0x4a1fa4['id']}});})['then'](function(){return _0x4a1fa4;})['catch'](function(_0x4e29e9){logger[_0x68d9('0x45')](_0x68d9('0x46'),_0x4a1fa4['id'],_0x4e29e9);});}function getOauth2MicrosoftAccessToken(_0x2e014a,_0x40221d){var _0x12de98={'grant_type':_0x68d9('0x47'),'code':_0x2e014a,'scope':getAccessTokenScope(_0x40221d),'redirect_uri':_0x40221d[_0x68d9('0x3e')],'client_id':_0x40221d['data1'],'client_secret':encryptor[_0x68d9('0x3f')](_0x40221d['data3'])};var _0x2939b0={'method':_0x68d9('0x41'),'uri':MICROSOFT_AUTH_URL[_0x68d9('0x1b')](_0x68d9('0x1c'),_0x40221d[_0x68d9('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x12de98,'json':!![]};return rp(_0x2939b0);}function startRefreshInterval(_0x96b677){var _0xb5ddf3=schedule[_0x68d9('0x48')];if(_0xb5ddf3[_0x96b677['id']])clearInterval(_0xb5ddf3[_0x96b677['id']]);_0xb5ddf3[_0x96b677['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x68d9('0x49')](this,{'id':_0x96b677['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x68d9('0x48')]=_0xb5ddf3;}function startAllRefreshIntervals(){return db[_0x68d9('0x3b')][_0x68d9('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x68d9('0x3a')](function(_0x2aae20){var _0x3f0ce0=_0x2aae20[_0x68d9('0x14')](function(_0x11c616){return refreshOauth2MicrosoftAccessToken(_0x11c616)[_0x68d9('0x3a')](function(_0x53f47b){startRefreshInterval(_0x53f47b);});});return Promise[_0x68d9('0x4b')](_0x3f0ce0);})[_0x68d9('0x4c')](function(_0x394abd){var _0x2535a6=_0x394abd?util['inspect'](_0x394abd,{'showHidden':![],'depth':null}):'';logger[_0x68d9('0x45')](_0x68d9('0x4d'),_0x2535a6);});}module[_0x68d9('0x4e')]={'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 6fd4c39..de729f5 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 _0x7096=['code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0x7096,0x10c));var _0x6709=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x7096[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var moment=require('moment');var BPromise=require(_0x6709('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];var utils=require(_0x6709('0x4'));var logger=require(_0x6709('0x5'))(_0x6709('0x6'));var config=require(_0x6709('0x7'));var jayson=require(_0x6709('0x8'));var client=jayson[_0x6709('0x9')][_0x6709('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2223,_0x11ad23,_0x985814){return new BPromise(function(_0x30147f,_0x513ab6){return client['request'](_0x3e2223,_0x985814)[_0x6709('0xb')](function(_0x2d8c0b){logger[_0x6709('0xc')](_0x6709('0xd'),_0x11ad23,_0x6709('0xe'));logger[_0x6709('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x11ad23,'request\x20sent',JSON[_0x6709('0x10')](_0x2d8c0b));if(_0x2d8c0b[_0x6709('0x11')]){if(_0x2d8c0b[_0x6709('0x11')][_0x6709('0x12')]===0x1f4){logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')][_0x6709('0x13')]);return _0x513ab6(_0x2d8c0b['error'][_0x6709('0x13')]);}logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')]['message']);return _0x30147f(_0x2d8c0b[_0x6709('0x11')]['message']);}else{logger[_0x6709('0xc')]('CloudProvider,\x20%s,\x20%s',_0x11ad23,_0x6709('0xe'));_0x30147f(_0x2d8c0b[_0x6709('0x14')][_0x6709('0x13')]);}})[_0x6709('0x15')](function(_0x4cab30){logger['error']('CloudProvider,\x20%s,\x20%s',_0x11ad23,_0x4cab30);_0x513ab6(_0x4cab30);});});}
\ No newline at end of file
+var _0xbd9e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','moment','randomstring'];(function(_0x10c45e,_0x3e5237){var _0x425d90=function(_0x1b9eb9){while(--_0x1b9eb9){_0x10c45e['push'](_0x10c45e['shift']());}};_0x425d90(++_0x3e5237);}(_0xbd9e,0x108));var _0xebd9=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xbd9e[_0x56482c];return _0x5aae7a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xebd9('0x0'));var BPromise=require('bluebird');var rs=require(_0xebd9('0x1'));var fs=require('fs');var Redis=require(_0xebd9('0x2'));var db=require(_0xebd9('0x3'))['db'];var utils=require(_0xebd9('0x4'));var logger=require(_0xebd9('0x5'))('rpc');var config=require(_0xebd9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xebd9('0x7')][_0xebd9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe1bf09,_0x23c503,_0x285c28){return new BPromise(function(_0x1f7734,_0x55e858){return client[_0xebd9('0x9')](_0xe1bf09,_0x285c28)[_0xebd9('0xa')](function(_0x12d27a){logger[_0xebd9('0xb')](_0xebd9('0xc'),_0x23c503,'request\x20sent');logger[_0xebd9('0xd')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x23c503,_0xebd9('0xe'),JSON['stringify'](_0x12d27a));if(_0x12d27a[_0xebd9('0xf')]){if(_0x12d27a[_0xebd9('0xf')]['code']===0x1f4){logger[_0xebd9('0xf')](_0xebd9('0xc'),_0x23c503,_0x12d27a['error'][_0xebd9('0x10')]);return _0x55e858(_0x12d27a[_0xebd9('0xf')][_0xebd9('0x10')]);}logger[_0xebd9('0xf')]('CloudProvider,\x20%s,\x20%s',_0x23c503,_0x12d27a[_0xebd9('0xf')][_0xebd9('0x10')]);return _0x1f7734(_0x12d27a[_0xebd9('0xf')][_0xebd9('0x10')]);}else{logger[_0xebd9('0xb')](_0xebd9('0xc'),_0x23c503,_0xebd9('0xe'));_0x1f7734(_0x12d27a[_0xebd9('0x11')][_0xebd9('0x10')]);}})[_0xebd9('0x12')](function(_0x37cdf3){logger[_0xebd9('0xf')](_0xebd9('0xc'),_0x23c503,_0x37cdf3);_0x55e858(_0x37cdf3);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index c9306bb..f7decf4 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(_0x4c80d7,_0x2bef29){var _0x3c5095=function(_0x1b0e67){while(--_0x1b0e67){_0x4c80d7['push'](_0x4c80d7['shift']());}};_0x3c5095(++_0x2bef29);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5528ce,_0x2a8c7b){_0x5528ce=_0x5528ce-0x0;var _0x30846b=_0x5f2f[_0x5528ce];return _0x30846b;};'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 _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0xe31b33,_0x56e7c2){var _0x506ea6=function(_0x512c40){while(--_0x512c40){_0xe31b33['push'](_0xe31b33['shift']());}};_0x506ea6(++_0x56e7c2);}(_0x2ef3,0xba));var _0x32ef=function(_0x44a88c,_0x4eb614){_0x44a88c=_0x44a88c-0x0;var _0xa0f93d=_0x2ef3[_0x44a88c];return _0xa0f93d;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 9c11441..4865311 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 _0x2ff8=['sequelize','exports','name','STRING'];(function(_0x58ecb7,_0x3ce107){var _0xf8856=function(_0x5c0138){while(--_0x5c0138){_0x58ecb7['push'](_0x58ecb7['shift']());}};_0xf8856(++_0x3ce107);}(_0x2ff8,0x1b0));var _0x82ff=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x2ff8[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require(_0x82ff('0x0'));module[_0x82ff('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x82ff('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x82ff('0x3')]},'companyId':{'type':Sequelize[_0x82ff('0x3')]},'website':{'type':Sequelize[_0x82ff('0x3')]},'phone':{'type':Sequelize[_0x82ff('0x3')]},'fax':{'type':Sequelize[_0x82ff('0x3')]},'type':{'type':Sequelize[_0x82ff('0x3')]},'street':{'type':Sequelize[_0x82ff('0x3')]},'postalCode':{'type':Sequelize[_0x82ff('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x82ff('0x3')]},'sStreet':{'type':Sequelize[_0x82ff('0x3')]},'sPostalCode':{'type':Sequelize[_0x82ff('0x3')]},'sCity':{'type':Sequelize[_0x82ff('0x3')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x82ff('0x3')]}};
\ No newline at end of file
+var _0x0863=['STRING','name','sequelize','exports'];(function(_0x39475,_0xfc9d3e){var _0x58e849=function(_0x4fe977){while(--_0x4fe977){_0x39475['push'](_0x39475['shift']());}};_0x58e849(++_0xfc9d3e);}(_0x0863,0x126));var _0x3086=function(_0x1a085c,_0x5d0b09){_0x1a085c=_0x1a085c-0x0;var _0x2444db=_0x0863[_0x1a085c];return _0x2444db;};'use strict';var Sequelize=require(_0x3086('0x0'));module[_0x3086('0x1')]={'name':{'type':Sequelize[_0x3086('0x2')],'unique':_0x3086('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3086('0x2')]},'companyId':{'type':Sequelize[_0x3086('0x2')]},'website':{'type':Sequelize[_0x3086('0x2')]},'phone':{'type':Sequelize[_0x3086('0x2')]},'fax':{'type':Sequelize[_0x3086('0x2')]},'type':{'type':Sequelize[_0x3086('0x2')]},'street':{'type':Sequelize[_0x3086('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x3086('0x2')]},'country':{'type':Sequelize[_0x3086('0x2')]},'email':{'type':Sequelize[_0x3086('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x3086('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x3086('0x2')]},'sCountry':{'type':Sequelize[_0x3086('0x2')]},'description':{'type':Sequelize[_0x3086('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 0023fa9..afc7d73 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 _0xb162=['nolimit','order','sort','pick','filter','where','merge','map','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','UserProfileResource','end','error','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x392485,_0x36a200){var _0xa34d31=function(_0x4a4dd6){while(--_0x4a4dd6){_0x392485['push'](_0x392485['shift']());}};_0xa34d31(++_0x36a200);}(_0xb162,0x7e));var _0x2b16=function(_0x5c273c,_0xe3517){_0x5c273c=_0x5c273c-0x0;var _0xfa1d67=_0xb162[_0x5c273c];return _0xfa1d67;};'use strict';var emlformat=require(_0x2b16('0x0'));var rimraf=require(_0x2b16('0x1'));var zipdir=require(_0x2b16('0x2'));var jsonpatch=require(_0x2b16('0x3'));var rp=require(_0x2b16('0x4'));var moment=require(_0x2b16('0x5'));var BPromise=require(_0x2b16('0x6'));var Mustache=require(_0x2b16('0x7'));var util=require(_0x2b16('0x8'));var path=require(_0x2b16('0x9'));var sox=require('sox');var csv=require(_0x2b16('0xa'));var ejs=require(_0x2b16('0xb'));var fs=require('fs');var fs_extra=require(_0x2b16('0xc'));var _=require(_0x2b16('0xd'));var squel=require(_0x2b16('0xe'));var crypto=require(_0x2b16('0xf'));var jsforce=require(_0x2b16('0x10'));var deskjs=require(_0x2b16('0x11'));var toCsv=require(_0x2b16('0xa'));var querystring=require('querystring');var Papa=require(_0x2b16('0x12'));var Redis=require(_0x2b16('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2b16('0x14'));var hardwareService=require(_0x2b16('0x15'));var logger=require(_0x2b16('0x16'))(_0x2b16('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2b16('0x18'))['db'];function respondWithStatusCode(_0x13dba2,_0x503442){_0x503442=_0x503442||0xcc;return function(_0x52e2a9){if(_0x52e2a9){return _0x13dba2[_0x2b16('0x19')](_0x503442);}return _0x13dba2['status'](_0x503442)['end']();};}function respondWithResult(_0x5921e5,_0x4a2be9){_0x4a2be9=_0x4a2be9||0xc8;return function(_0x112da9){if(_0x112da9){return _0x5921e5[_0x2b16('0x1a')](_0x4a2be9)['json'](_0x112da9);}};}function respondWithFilteredResult(_0x2e6120,_0x5beb86){return function(_0x44e526){if(_0x44e526){var _0x191b07=typeof _0x5beb86['offset']===_0x2b16('0x1b')&&typeof _0x5beb86[_0x2b16('0x1c')]===_0x2b16('0x1b');var _0x1406d5=_0x44e526[_0x2b16('0x1d')];var _0x49d59f=_0x191b07?0x0:_0x5beb86[_0x2b16('0x1e')];var _0x5a6e8a=_0x191b07?_0x44e526[_0x2b16('0x1d')]:_0x5beb86[_0x2b16('0x1e')]+_0x5beb86['limit'];var _0x5d9db5;if(_0x5a6e8a>=_0x1406d5){_0x5a6e8a=_0x1406d5;_0x5d9db5=0xc8;}else{_0x5d9db5=0xce;}_0x2e6120[_0x2b16('0x1a')](_0x5d9db5);return _0x2e6120[_0x2b16('0x1f')](_0x2b16('0x20'),_0x49d59f+'-'+_0x5a6e8a+'/'+_0x1406d5)[_0x2b16('0x21')](_0x44e526);}return null;};}function patchUpdates(_0x99c1e){return function(_0x154c2e){try{jsonpatch['apply'](_0x154c2e,_0x99c1e,!![]);}catch(_0x4b78ea){return BPromise[_0x2b16('0x22')](_0x4b78ea);}return _0x154c2e[_0x2b16('0x23')]();};}function saveUpdates(_0x3bc000,_0x43cd6e){return function(_0x54cb42){if(_0x54cb42){return _0x54cb42[_0x2b16('0x24')](_0x3bc000)[_0x2b16('0x25')](function(_0x1260ee){return _0x1260ee;});}return null;};}function removeEntity(_0x3df610,_0x4fd05d){return function(_0x44aeda){if(_0x44aeda){return _0x44aeda[_0x2b16('0x26')]()[_0x2b16('0x25')](function(){var _0x479627=_0x44aeda['get']({'plain':!![]});var _0x36ce19='Companies';return db[_0x2b16('0x27')][_0x2b16('0x26')]({'where':{'type':_0x36ce19,'resourceId':_0x479627['id']}})[_0x2b16('0x25')](function(){return _0x44aeda;});})[_0x2b16('0x25')](function(){_0x3df610[_0x2b16('0x1a')](0xcc)[_0x2b16('0x28')]();});}};}function handleEntityNotFound(_0xc3386d,_0x30345e){return function(_0x2411d7){if(!_0x2411d7){_0xc3386d[_0x2b16('0x19')](0x194);}return _0x2411d7;};}function handleError(_0x29c830,_0x422c63){_0x422c63=_0x422c63||0x1f4;return function(_0x430f86){logger[_0x2b16('0x29')](_0x430f86[_0x2b16('0x2a')]);if(_0x430f86['name']){delete _0x430f86[_0x2b16('0x2b')];}_0x29c830[_0x2b16('0x1a')](_0x422c63)[_0x2b16('0x2c')](_0x430f86);};}exports[_0x2b16('0x2d')]=function(_0x302443,_0x279ef3){var _0x5afd80={},_0x2830c0={},_0x50c74e={'count':0x0,'rows':[]};return db[_0x2b16('0x2e')][_0x2b16('0x2f')]()[_0x2b16('0x25')](function(_0x32e275){_0x2830c0[_0x2b16('0x30')]=_['keys'](_0x32e275);_0x2830c0[_0x2b16('0x31')]=_[_0x2b16('0x32')](_0x302443[_0x2b16('0x31')]);_0x2830c0[_0x2b16('0x33')]=_[_0x2b16('0x34')](_0x2830c0[_0x2b16('0x30')],_0x2830c0[_0x2b16('0x31')]);_0x5afd80['attributes']=_[_0x2b16('0x34')](_0x2830c0[_0x2b16('0x30')],qs[_0x2b16('0x35')](_0x302443[_0x2b16('0x31')][_0x2b16('0x35')]));_0x5afd80['attributes']=_0x5afd80[_0x2b16('0x36')]['length']?_0x5afd80[_0x2b16('0x36')]:_0x2830c0[_0x2b16('0x30')];if(!_0x302443[_0x2b16('0x31')][_0x2b16('0x37')](_0x2b16('0x38'))){_0x5afd80[_0x2b16('0x1c')]=qs['limit'](_0x302443[_0x2b16('0x31')][_0x2b16('0x1c')]);_0x5afd80[_0x2b16('0x1e')]=qs[_0x2b16('0x1e')](_0x302443[_0x2b16('0x31')][_0x2b16('0x1e')]);}_0x5afd80[_0x2b16('0x39')]=qs['sort'](_0x302443[_0x2b16('0x31')][_0x2b16('0x3a')]);_0x5afd80['where']=qs['filters'](_[_0x2b16('0x3b')](_0x302443[_0x2b16('0x31')],_0x2830c0[_0x2b16('0x33')]),_0x32e275);if(_0x302443[_0x2b16('0x31')][_0x2b16('0x3c')]){_0x5afd80[_0x2b16('0x3d')]=_[_0x2b16('0x3e')](_0x5afd80[_0x2b16('0x3d')],{'$or':_[_0x2b16('0x3f')](_0x5afd80['attributes'],function(_0x2ed1a0){var _0x449452={};_0x449452[_0x2ed1a0]={'$like':'%'+_0x302443[_0x2b16('0x31')]['filter']+'%'};return _0x449452;})});}_0x5afd80=_[_0x2b16('0x3e')]({},_0x5afd80,_0x302443['options']);var _0x5ce0e7={'where':_0x5afd80[_0x2b16('0x3d')]};return db[_0x2b16('0x2e')][_0x2b16('0x1d')](_0x5ce0e7)['then'](function(_0x44eb90){_0x50c74e[_0x2b16('0x1d')]=_0x44eb90;if(_0x302443[_0x2b16('0x31')][_0x2b16('0x40')]){_0x5afd80[_0x2b16('0x41')]=[{'all':!![]}];}return db[_0x2b16('0x2e')][_0x2b16('0x42')](_0x5afd80);})[_0x2b16('0x25')](function(_0x44511c){_0x50c74e[_0x2b16('0x43')]=_0x44511c;return _0x50c74e;})['then'](respondWithFilteredResult(_0x279ef3,_0x5afd80))[_0x2b16('0x44')](handleError(_0x279ef3,null));})[_0x2b16('0x44')](handleError(_0x279ef3,null));};exports[_0x2b16('0x45')]=function(_0x4ab1d5,_0x53ddf5){var _0x2573dc={'raw':![],'where':{'id':_0x4ab1d5[_0x2b16('0x46')]['id']}},_0x1caa44={};_0x1caa44['model']=_[_0x2b16('0x32')](db[_0x2b16('0x2e')][_0x2b16('0x47')]);_0x1caa44[_0x2b16('0x31')]=_[_0x2b16('0x32')](_0x4ab1d5[_0x2b16('0x31')]);_0x1caa44[_0x2b16('0x33')]=_[_0x2b16('0x34')](_0x1caa44[_0x2b16('0x30')],_0x1caa44[_0x2b16('0x31')]);_0x2573dc[_0x2b16('0x36')]=_['intersection'](_0x1caa44[_0x2b16('0x30')],qs[_0x2b16('0x35')](_0x4ab1d5['query']['fields']));_0x2573dc['attributes']=_0x2573dc[_0x2b16('0x36')][_0x2b16('0x48')]?_0x2573dc[_0x2b16('0x36')]:_0x1caa44['model'];if(_0x4ab1d5[_0x2b16('0x31')]['includeAll']){_0x2573dc[_0x2b16('0x41')]=[{'all':!![]}];}_0x2573dc=_[_0x2b16('0x3e')]({},_0x2573dc,_0x4ab1d5[_0x2b16('0x49')]);return db[_0x2b16('0x2e')][_0x2b16('0x4a')](_0x2573dc)[_0x2b16('0x25')](handleEntityNotFound(_0x53ddf5,null))[_0x2b16('0x25')](respondWithResult(_0x53ddf5,null))[_0x2b16('0x44')](handleError(_0x53ddf5,null));};exports[_0x2b16('0x4b')]=function(_0x53d8c4,_0x244317){return db['CmCompany'][_0x2b16('0x4b')](_0x53d8c4[_0x2b16('0x4c')],{})[_0x2b16('0x25')](function(_0x53055c){var _0x18dea3=_0x53d8c4[_0x2b16('0x4d')][_0x2b16('0x4e')]({'plain':!![]});if(!_0x18dea3)throw new Error(_0x2b16('0x4f'));if(_0x18dea3[_0x2b16('0x50')]===_0x2b16('0x4d')){var _0x512984=_0x53055c[_0x2b16('0x4e')]({'plain':!![]});var _0x3352bc=_0x2b16('0x51');return db[_0x2b16('0x52')][_0x2b16('0x4a')]({'where':{'name':_0x3352bc,'userProfileId':_0x18dea3[_0x2b16('0x53')]},'raw':!![]})['then'](function(_0x22b863){if(_0x22b863&&_0x22b863[_0x2b16('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x512984[_0x2b16('0x2b')],'resourceId':_0x512984['id'],'type':_0x22b863[_0x2b16('0x2b')],'sectionId':_0x22b863['id']},{})[_0x2b16('0x25')](function(){return _0x53055c;});}else{return _0x53055c;}})[_0x2b16('0x44')](function(_0x2d0e3e){logger[_0x2b16('0x29')](_0x2b16('0x55'),_0x2d0e3e);throw _0x2d0e3e;});}return _0x53055c;})[_0x2b16('0x25')](respondWithResult(_0x244317,0xc9))[_0x2b16('0x44')](handleError(_0x244317,null));};exports[_0x2b16('0x24')]=function(_0x153bfc,_0x477765){if(_0x153bfc[_0x2b16('0x4c')]['id']){delete _0x153bfc[_0x2b16('0x4c')]['id'];}return db[_0x2b16('0x2e')]['find']({'where':{'id':_0x153bfc[_0x2b16('0x46')]['id']}})[_0x2b16('0x25')](handleEntityNotFound(_0x477765,null))[_0x2b16('0x25')](saveUpdates(_0x153bfc[_0x2b16('0x4c')],null))[_0x2b16('0x25')](respondWithResult(_0x477765,null))[_0x2b16('0x44')](handleError(_0x477765,null));};exports[_0x2b16('0x26')]=function(_0x55f558,_0x10a89e){return db[_0x2b16('0x2e')][_0x2b16('0x4a')]({'where':{'id':_0x55f558[_0x2b16('0x46')]['id']}})[_0x2b16('0x25')](handleEntityNotFound(_0x10a89e,null))['then'](removeEntity(_0x10a89e,null))[_0x2b16('0x44')](handleError(_0x10a89e,null));};exports[_0x2b16('0x2f')]=function(_0x1909ad,_0x40c94b){return db[_0x2b16('0x2e')][_0x2b16('0x2f')]()[_0x2b16('0x25')](respondWithResult(_0x40c94b,null))[_0x2b16('0x44')](handleError(_0x40c94b,null));};exports[_0x2b16('0x56')]=function(_0x1a5c0d,_0x397554,_0x5dd571){return db[_0x2b16('0x57')][_0x2b16('0x4a')]({'where':{'id':_0x1a5c0d[_0x2b16('0x46')]['id']}})[_0x2b16('0x25')](handleEntityNotFound(_0x397554,null))[_0x2b16('0x25')](function(_0x3925bd){if(_0x3925bd){return _0x3925bd[_0x2b16('0x56')](_0x1a5c0d[_0x2b16('0x4c')][_0x2b16('0x58')],_['omit'](_0x1a5c0d[_0x2b16('0x4c')],[_0x2b16('0x58'),'id'])||{});}})[_0x2b16('0x25')](respondWithResult(_0x397554,null))[_0x2b16('0x44')](handleError(_0x397554,null));};exports[_0x2b16('0x59')]=function(_0x4e7b6e,_0xe57d82,_0x2dc6ae){var _0x56a188={};var _0xc64734={};var _0x5c7314;var _0x314fa9;return db['CmCompany'][_0x2b16('0x5a')]({'where':{'id':_0x4e7b6e[_0x2b16('0x46')]['id']}})[_0x2b16('0x25')](handleEntityNotFound(_0xe57d82,null))[_0x2b16('0x25')](function(_0x50a10c){if(_0x50a10c){_0x5c7314=_0x50a10c;_0xc64734['model']=_['keys'](db[_0x2b16('0x57')][_0x2b16('0x47')]);_0xc64734[_0x2b16('0x31')]=_[_0x2b16('0x32')](_0x4e7b6e[_0x2b16('0x31')]);_0xc64734['filters']=_[_0x2b16('0x34')](_0xc64734[_0x2b16('0x30')],_0xc64734[_0x2b16('0x31')]);_0x56a188['attributes']=_[_0x2b16('0x34')](_0xc64734[_0x2b16('0x30')],qs['fields'](_0x4e7b6e['query'][_0x2b16('0x35')]));_0x56a188['attributes']=_0x56a188[_0x2b16('0x36')]['length']?_0x56a188[_0x2b16('0x36')]:_0xc64734[_0x2b16('0x30')];_0x56a188[_0x2b16('0x39')]=qs['sort'](_0x4e7b6e[_0x2b16('0x31')][_0x2b16('0x3a')]);_0x56a188[_0x2b16('0x3d')]=qs['filters'](_[_0x2b16('0x3b')](_0x4e7b6e['query'],_0xc64734[_0x2b16('0x33')]));if(_0x4e7b6e[_0x2b16('0x31')][_0x2b16('0x3c')]){_0x56a188[_0x2b16('0x3d')]=_[_0x2b16('0x3e')](_0x56a188['where'],{'$or':_['map'](_0x56a188['attributes'],function(_0x898c4c){var _0x2981b3={};_0x2981b3[_0x898c4c]={'$like':'%'+_0x4e7b6e[_0x2b16('0x31')][_0x2b16('0x3c')]+'%'};return _0x2981b3;})});}_0x56a188=_[_0x2b16('0x3e')]({},_0x56a188,_0x4e7b6e['options']);return _0x5c7314['getContacts'](_0x56a188);}})[_0x2b16('0x25')](function(_0x389475){if(_0x389475){_0x314fa9=_0x389475[_0x2b16('0x48')];if(!_0x4e7b6e['query']['hasOwnProperty'](_0x2b16('0x38'))){_0x56a188[_0x2b16('0x1c')]=qs[_0x2b16('0x1c')](_0x4e7b6e[_0x2b16('0x31')][_0x2b16('0x1c')]);_0x56a188[_0x2b16('0x1e')]=qs[_0x2b16('0x1e')](_0x4e7b6e[_0x2b16('0x31')]['offset']);}return _0x5c7314['getContacts'](_0x56a188);}})['then'](function(_0x5af2a5){if(_0x5af2a5){return _0x5af2a5?{'count':_0x314fa9,'rows':_0x5af2a5}:null;}})[_0x2b16('0x25')](respondWithResult(_0xe57d82,null))[_0x2b16('0x44')](handleError(_0xe57d82,null));};
\ No newline at end of file
+var _0x7c41=['order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','CmContact','addContacts','ids','omit','getContacts','findOne','map','length','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','UserProfileResource','error','name','send','index','CmCompany','describe','model','keys','filters','attributes','intersection','fields','hasOwnProperty','query'];(function(_0x3cc1ef,_0x4d8511){var _0x4df6c8=function(_0x406a18){while(--_0x406a18){_0x3cc1ef['push'](_0x3cc1ef['shift']());}};_0x4df6c8(++_0x4d8511);}(_0x7c41,0x174));var _0x17c4=function(_0x259c9f,_0x447312){_0x259c9f=_0x259c9f-0x0;var _0x187ae4=_0x7c41[_0x259c9f];return _0x187ae4;};'use strict';var emlformat=require(_0x17c4('0x0'));var rimraf=require(_0x17c4('0x1'));var zipdir=require(_0x17c4('0x2'));var jsonpatch=require(_0x17c4('0x3'));var rp=require('request-promise');var moment=require(_0x17c4('0x4'));var BPromise=require(_0x17c4('0x5'));var Mustache=require(_0x17c4('0x6'));var util=require('util');var path=require(_0x17c4('0x7'));var sox=require('sox');var csv=require(_0x17c4('0x8'));var ejs=require(_0x17c4('0x9'));var fs=require('fs');var fs_extra=require(_0x17c4('0xa'));var _=require(_0x17c4('0xb'));var squel=require(_0x17c4('0xc'));var crypto=require(_0x17c4('0xd'));var jsforce=require(_0x17c4('0xe'));var deskjs=require(_0x17c4('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x17c4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x17c4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x17c4('0x12'));var logger=require(_0x17c4('0x13'))(_0x17c4('0x14'));var utils=require(_0x17c4('0x15'));var config=require(_0x17c4('0x16'));var licenseUtil=require(_0x17c4('0x17'));var db=require(_0x17c4('0x18'))['db'];function respondWithStatusCode(_0x421a92,_0x478c82){_0x478c82=_0x478c82||0xcc;return function(_0x4757fc){if(_0x4757fc){return _0x421a92['sendStatus'](_0x478c82);}return _0x421a92[_0x17c4('0x19')](_0x478c82)['end']();};}function respondWithResult(_0x564898,_0xb38b8a){_0xb38b8a=_0xb38b8a||0xc8;return function(_0x4e58d3){if(_0x4e58d3){return _0x564898[_0x17c4('0x19')](_0xb38b8a)[_0x17c4('0x1a')](_0x4e58d3);}};}function respondWithFilteredResult(_0x2a27ee,_0x3a9dc3){return function(_0x1ea27b){if(_0x1ea27b){var _0x167d34=typeof _0x3a9dc3[_0x17c4('0x1b')]===_0x17c4('0x1c')&&typeof _0x3a9dc3[_0x17c4('0x1d')]===_0x17c4('0x1c');var _0x1ea306=_0x1ea27b[_0x17c4('0x1e')];var _0x15916e=_0x167d34?0x0:_0x3a9dc3[_0x17c4('0x1b')];var _0x348f0c=_0x167d34?_0x1ea27b[_0x17c4('0x1e')]:_0x3a9dc3[_0x17c4('0x1b')]+_0x3a9dc3[_0x17c4('0x1d')];var _0x3d0cec;if(_0x348f0c>=_0x1ea306){_0x348f0c=_0x1ea306;_0x3d0cec=0xc8;}else{_0x3d0cec=0xce;}_0x2a27ee[_0x17c4('0x19')](_0x3d0cec);return _0x2a27ee['set'](_0x17c4('0x1f'),_0x15916e+'-'+_0x348f0c+'/'+_0x1ea306)[_0x17c4('0x1a')](_0x1ea27b);}return null;};}function patchUpdates(_0x1246f4){return function(_0x455766){try{jsonpatch[_0x17c4('0x20')](_0x455766,_0x1246f4,!![]);}catch(_0xddd813){return BPromise[_0x17c4('0x21')](_0xddd813);}return _0x455766[_0x17c4('0x22')]();};}function saveUpdates(_0xddddc8,_0x5d6b03){return function(_0x528658){if(_0x528658){return _0x528658[_0x17c4('0x23')](_0xddddc8)[_0x17c4('0x24')](function(_0x13ab21){return _0x13ab21;});}return null;};}function removeEntity(_0x4e7cf9,_0x5cf11a){return function(_0x4037d3){if(_0x4037d3){return _0x4037d3['destroy']()['then'](function(){var _0x14eb6d=_0x4037d3[_0x17c4('0x25')]({'plain':!![]});var _0x24ca20='Companies';return db[_0x17c4('0x26')]['destroy']({'where':{'type':_0x24ca20,'resourceId':_0x14eb6d['id']}})['then'](function(){return _0x4037d3;});})[_0x17c4('0x24')](function(){_0x4e7cf9[_0x17c4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa54d50,_0x1cbe24){return function(_0x404bd9){if(!_0x404bd9){_0xa54d50['sendStatus'](0x194);}return _0x404bd9;};}function handleError(_0x214b2,_0x32762a){_0x32762a=_0x32762a||0x1f4;return function(_0x529f35){logger[_0x17c4('0x27')](_0x529f35['stack']);if(_0x529f35[_0x17c4('0x28')]){delete _0x529f35[_0x17c4('0x28')];}_0x214b2[_0x17c4('0x19')](_0x32762a)[_0x17c4('0x29')](_0x529f35);};}exports[_0x17c4('0x2a')]=function(_0x642f4d,_0x5b02ba){var _0x18265a={},_0x3bec97={},_0x24adf0={'count':0x0,'rows':[]};return db[_0x17c4('0x2b')][_0x17c4('0x2c')]()[_0x17c4('0x24')](function(_0x424cce){_0x3bec97[_0x17c4('0x2d')]=_[_0x17c4('0x2e')](_0x424cce);_0x3bec97['query']=_[_0x17c4('0x2e')](_0x642f4d['query']);_0x3bec97[_0x17c4('0x2f')]=_['intersection'](_0x3bec97[_0x17c4('0x2d')],_0x3bec97['query']);_0x18265a[_0x17c4('0x30')]=_[_0x17c4('0x31')](_0x3bec97[_0x17c4('0x2d')],qs[_0x17c4('0x32')](_0x642f4d['query']['fields']));_0x18265a[_0x17c4('0x30')]=_0x18265a[_0x17c4('0x30')]['length']?_0x18265a[_0x17c4('0x30')]:_0x3bec97['model'];if(!_0x642f4d['query'][_0x17c4('0x33')]('nolimit')){_0x18265a[_0x17c4('0x1d')]=qs[_0x17c4('0x1d')](_0x642f4d['query']['limit']);_0x18265a[_0x17c4('0x1b')]=qs['offset'](_0x642f4d[_0x17c4('0x34')][_0x17c4('0x1b')]);}_0x18265a[_0x17c4('0x35')]=qs['sort'](_0x642f4d[_0x17c4('0x34')][_0x17c4('0x36')]);_0x18265a[_0x17c4('0x37')]=qs[_0x17c4('0x2f')](_[_0x17c4('0x38')](_0x642f4d[_0x17c4('0x34')],_0x3bec97['filters']),_0x424cce);if(_0x642f4d[_0x17c4('0x34')][_0x17c4('0x39')]){_0x18265a[_0x17c4('0x37')]=_[_0x17c4('0x3a')](_0x18265a[_0x17c4('0x37')],{'$or':_['map'](_0x18265a[_0x17c4('0x30')],function(_0x37f08c){var _0x502484={};_0x502484[_0x37f08c]={'$like':'%'+_0x642f4d[_0x17c4('0x34')][_0x17c4('0x39')]+'%'};return _0x502484;})});}_0x18265a=_[_0x17c4('0x3a')]({},_0x18265a,_0x642f4d[_0x17c4('0x3b')]);var _0x3d7dc3={'where':_0x18265a['where']};return db[_0x17c4('0x2b')][_0x17c4('0x1e')](_0x3d7dc3)['then'](function(_0x48f30c){_0x24adf0[_0x17c4('0x1e')]=_0x48f30c;if(_0x642f4d[_0x17c4('0x34')][_0x17c4('0x3c')]){_0x18265a[_0x17c4('0x3d')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x18265a);})[_0x17c4('0x24')](function(_0x3543e6){_0x24adf0[_0x17c4('0x3e')]=_0x3543e6;return _0x24adf0;})[_0x17c4('0x24')](respondWithFilteredResult(_0x5b02ba,_0x18265a))[_0x17c4('0x3f')](handleError(_0x5b02ba,null));})['catch'](handleError(_0x5b02ba,null));};exports[_0x17c4('0x40')]=function(_0x168246,_0x60045d){var _0x220e3a={'raw':![],'where':{'id':_0x168246[_0x17c4('0x41')]['id']}},_0x59d0bb={};_0x59d0bb[_0x17c4('0x2d')]=_[_0x17c4('0x2e')](db[_0x17c4('0x2b')][_0x17c4('0x42')]);_0x59d0bb['query']=_[_0x17c4('0x2e')](_0x168246[_0x17c4('0x34')]);_0x59d0bb[_0x17c4('0x2f')]=_[_0x17c4('0x31')](_0x59d0bb[_0x17c4('0x2d')],_0x59d0bb[_0x17c4('0x34')]);_0x220e3a[_0x17c4('0x30')]=_[_0x17c4('0x31')](_0x59d0bb[_0x17c4('0x2d')],qs['fields'](_0x168246['query'][_0x17c4('0x32')]));_0x220e3a[_0x17c4('0x30')]=_0x220e3a[_0x17c4('0x30')]['length']?_0x220e3a[_0x17c4('0x30')]:_0x59d0bb[_0x17c4('0x2d')];if(_0x168246['query'][_0x17c4('0x3c')]){_0x220e3a[_0x17c4('0x3d')]=[{'all':!![]}];}_0x220e3a=_[_0x17c4('0x3a')]({},_0x220e3a,_0x168246[_0x17c4('0x3b')]);return db['CmCompany'][_0x17c4('0x43')](_0x220e3a)[_0x17c4('0x24')](handleEntityNotFound(_0x60045d,null))['then'](respondWithResult(_0x60045d,null))[_0x17c4('0x3f')](handleError(_0x60045d,null));};exports[_0x17c4('0x44')]=function(_0x4927e3,_0x4ebe26){return db[_0x17c4('0x2b')][_0x17c4('0x44')](_0x4927e3['body'],{})[_0x17c4('0x24')](function(_0x429e75){var _0x16a81c=_0x4927e3[_0x17c4('0x45')][_0x17c4('0x25')]({'plain':!![]});if(!_0x16a81c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16a81c[_0x17c4('0x46')]===_0x17c4('0x45')){var _0x2d093d=_0x429e75[_0x17c4('0x25')]({'plain':!![]});var _0x37590f='Companies';return db[_0x17c4('0x47')]['find']({'where':{'name':_0x37590f,'userProfileId':_0x16a81c['userProfileId']},'raw':!![]})[_0x17c4('0x24')](function(_0x4ed826){if(_0x4ed826&&_0x4ed826[_0x17c4('0x48')]===0x0){return db[_0x17c4('0x26')]['create']({'name':_0x2d093d[_0x17c4('0x28')],'resourceId':_0x2d093d['id'],'type':_0x4ed826['name'],'sectionId':_0x4ed826['id']},{})[_0x17c4('0x24')](function(){return _0x429e75;});}else{return _0x429e75;}})[_0x17c4('0x3f')](function(_0x413b4c){logger[_0x17c4('0x27')](_0x17c4('0x49'),_0x413b4c);throw _0x413b4c;});}return _0x429e75;})[_0x17c4('0x24')](respondWithResult(_0x4ebe26,0xc9))[_0x17c4('0x3f')](handleError(_0x4ebe26,null));};exports['update']=function(_0x40bfde,_0x148fd7){if(_0x40bfde[_0x17c4('0x4a')]['id']){delete _0x40bfde[_0x17c4('0x4a')]['id'];}return db[_0x17c4('0x2b')][_0x17c4('0x43')]({'where':{'id':_0x40bfde[_0x17c4('0x41')]['id']}})['then'](handleEntityNotFound(_0x148fd7,null))[_0x17c4('0x24')](saveUpdates(_0x40bfde['body'],null))['then'](respondWithResult(_0x148fd7,null))['catch'](handleError(_0x148fd7,null));};exports[_0x17c4('0x4b')]=function(_0x87e683,_0x27ab94){return db['CmCompany']['find']({'where':{'id':_0x87e683['params']['id']}})['then'](handleEntityNotFound(_0x27ab94,null))[_0x17c4('0x24')](removeEntity(_0x27ab94,null))[_0x17c4('0x3f')](handleError(_0x27ab94,null));};exports[_0x17c4('0x2c')]=function(_0x32eacf,_0x298930){return db[_0x17c4('0x2b')]['describe']()['then'](respondWithResult(_0x298930,null))[_0x17c4('0x3f')](handleError(_0x298930,null));};exports['addContacts']=function(_0x47d3ca,_0x545718,_0x118aae){return db[_0x17c4('0x4c')][_0x17c4('0x43')]({'where':{'id':_0x47d3ca[_0x17c4('0x41')]['id']}})[_0x17c4('0x24')](handleEntityNotFound(_0x545718,null))[_0x17c4('0x24')](function(_0x958d70){if(_0x958d70){return _0x958d70[_0x17c4('0x4d')](_0x47d3ca[_0x17c4('0x4a')][_0x17c4('0x4e')],_[_0x17c4('0x4f')](_0x47d3ca[_0x17c4('0x4a')],[_0x17c4('0x4e'),'id'])||{});}})[_0x17c4('0x24')](respondWithResult(_0x545718,null))[_0x17c4('0x3f')](handleError(_0x545718,null));};exports[_0x17c4('0x50')]=function(_0x43f093,_0x314030,_0x1ef938){var _0x1686ba={};var _0x1a5f84={};var _0x1f516b;var _0x2689d2;return db[_0x17c4('0x2b')][_0x17c4('0x51')]({'where':{'id':_0x43f093[_0x17c4('0x41')]['id']}})[_0x17c4('0x24')](handleEntityNotFound(_0x314030,null))['then'](function(_0x1baf5e){if(_0x1baf5e){_0x1f516b=_0x1baf5e;_0x1a5f84[_0x17c4('0x2d')]=_[_0x17c4('0x2e')](db['CmContact']['rawAttributes']);_0x1a5f84[_0x17c4('0x34')]=_['keys'](_0x43f093['query']);_0x1a5f84['filters']=_[_0x17c4('0x31')](_0x1a5f84['model'],_0x1a5f84['query']);_0x1686ba[_0x17c4('0x30')]=_['intersection'](_0x1a5f84['model'],qs['fields'](_0x43f093[_0x17c4('0x34')][_0x17c4('0x32')]));_0x1686ba[_0x17c4('0x30')]=_0x1686ba[_0x17c4('0x30')]['length']?_0x1686ba['attributes']:_0x1a5f84[_0x17c4('0x2d')];_0x1686ba['order']=qs['sort'](_0x43f093['query']['sort']);_0x1686ba['where']=qs[_0x17c4('0x2f')](_['pick'](_0x43f093['query'],_0x1a5f84['filters']));if(_0x43f093[_0x17c4('0x34')][_0x17c4('0x39')]){_0x1686ba[_0x17c4('0x37')]=_['merge'](_0x1686ba[_0x17c4('0x37')],{'$or':_[_0x17c4('0x52')](_0x1686ba[_0x17c4('0x30')],function(_0x2e44a3){var _0x1e4988={};_0x1e4988[_0x2e44a3]={'$like':'%'+_0x43f093['query']['filter']+'%'};return _0x1e4988;})});}_0x1686ba=_[_0x17c4('0x3a')]({},_0x1686ba,_0x43f093['options']);return _0x1f516b[_0x17c4('0x50')](_0x1686ba);}})['then'](function(_0x26ef04){if(_0x26ef04){_0x2689d2=_0x26ef04[_0x17c4('0x53')];if(!_0x43f093[_0x17c4('0x34')][_0x17c4('0x33')](_0x17c4('0x54'))){_0x1686ba[_0x17c4('0x1d')]=qs['limit'](_0x43f093[_0x17c4('0x34')][_0x17c4('0x1d')]);_0x1686ba[_0x17c4('0x1b')]=qs[_0x17c4('0x1b')](_0x43f093[_0x17c4('0x34')]['offset']);}return _0x1f516b['getContacts'](_0x1686ba);}})[_0x17c4('0x24')](function(_0x1929fe){if(_0x1929fe){return _0x1929fe?{'count':_0x2689d2,'rows':_0x1929fe}:null;}})['then'](respondWithResult(_0x314030,null))[_0x17c4('0x3f')](handleError(_0x314030,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 45a4d5d..76c4c57 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 _0xac1e=['path','rimraf','define','CmCompany','cm_companies','util','../../config/logger','api','moment','bluebird'];(function(_0x860e29,_0x2b30b8){var _0xc9f706=function(_0x5aa8f7){while(--_0x5aa8f7){_0x860e29['push'](_0x860e29['shift']());}};_0xc9f706(++_0x2b30b8);}(_0xac1e,0xf5));var _0xeac1=function(_0x330133,_0x5dfcab){_0x330133=_0x330133-0x0;var _0x16c2b1=_0xac1e[_0x330133];return _0x16c2b1;};'use strict';var _=require('lodash');var util=require(_0xeac1('0x0'));var logger=require(_0xeac1('0x1'))(_0xeac1('0x2'));var moment=require(_0xeac1('0x3'));var BPromise=require(_0xeac1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeac1('0x5'));var rimraf=require(_0xeac1('0x6'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module['exports']=function(_0x5c19fc,_0x53dc29){return _0x5c19fc[_0xeac1('0x7')](_0xeac1('0x8'),attributes,{'tableName':_0xeac1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcd56=['api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','util','../../config/logger'];(function(_0x4f921d,_0x5cf169){var _0x4382a8=function(_0x2a6721){while(--_0x2a6721){_0x4f921d['push'](_0x4f921d['shift']());}};_0x4382a8(++_0x5cf169);}(_0xcd56,0x66));var _0x6cd5=function(_0x3f883d,_0x28a22e){_0x3f883d=_0x3f883d-0x0;var _0x51bcb1=_0xcd56[_0x3f883d];return _0x51bcb1;};'use strict';var _=require('lodash');var util=require(_0x6cd5('0x0'));var logger=require(_0x6cd5('0x1'))(_0x6cd5('0x2'));var moment=require('moment');var BPromise=require(_0x6cd5('0x3'));var rp=require(_0x6cd5('0x4'));var fs=require('fs');var path=require(_0x6cd5('0x5'));var rimraf=require(_0x6cd5('0x6'));var config=require(_0x6cd5('0x7'));var attributes=require(_0x6cd5('0x8'));module[_0x6cd5('0x9')]=function(_0x196fb7,_0x163c9c){return _0x196fb7[_0x6cd5('0xa')](_0x6cd5('0xb'),attributes,{'tableName':_0x6cd5('0xc'),'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 14d9fca..3a12170 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 _0x5e36=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','info','request\x20sent','result','catch'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5e36,0xc8));var _0x65e3=function(_0x5a3876,_0x397364){_0x5a3876=_0x5a3876-0x0;var _0x59af7a=_0x5e36[_0x5a3876];return _0x59af7a;};'use strict';var _=require(_0x65e3('0x0'));var util=require(_0x65e3('0x1'));var moment=require('moment');var BPromise=require(_0x65e3('0x2'));var rs=require(_0x65e3('0x3'));var fs=require('fs');var Redis=require(_0x65e3('0x4'));var db=require(_0x65e3('0x5'))['db'];var utils=require(_0x65e3('0x6'));var logger=require(_0x65e3('0x7'))(_0x65e3('0x8'));var config=require(_0x65e3('0x9'));var jayson=require(_0x65e3('0xa'));var client=jayson['client'][_0x65e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a3b49,_0x3852cb,_0x32032d){return new BPromise(function(_0x46fb4e,_0x58f48b){return client[_0x65e3('0xc')](_0x1a3b49,_0x32032d)[_0x65e3('0xd')](function(_0x5aa062){logger['info']('CmCompany,\x20%s,\x20%s',_0x3852cb,'request\x20sent');logger[_0x65e3('0xe')](_0x65e3('0xf'),_0x3852cb,'request\x20sent',JSON[_0x65e3('0x10')](_0x5aa062));if(_0x5aa062['error']){if(_0x5aa062[_0x65e3('0x11')][_0x65e3('0x12')]===0x1f4){logger[_0x65e3('0x11')](_0x65e3('0x13'),_0x3852cb,_0x5aa062[_0x65e3('0x11')][_0x65e3('0x14')]);return _0x58f48b(_0x5aa062[_0x65e3('0x11')]['message']);}logger[_0x65e3('0x11')](_0x65e3('0x13'),_0x3852cb,_0x5aa062[_0x65e3('0x11')]['message']);return _0x46fb4e(_0x5aa062['error']['message']);}else{logger[_0x65e3('0x15')]('CmCompany,\x20%s,\x20%s',_0x3852cb,_0x65e3('0x16'));_0x46fb4e(_0x5aa062[_0x65e3('0x17')][_0x65e3('0x14')]);}})[_0x65e3('0x18')](function(_0x22728a){logger[_0x65e3('0x11')]('CmCompany,\x20%s,\x20%s',_0x3852cb,_0x22728a);_0x58f48b(_0x22728a);});});}
\ No newline at end of file
+var _0x702b=['lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x702b,0x168));var _0xb702=function(_0x3fa173,_0x40a115){_0x3fa173=_0x3fa173-0x0;var _0x554d4b=_0x702b[_0x3fa173];return _0x554d4b;};'use strict';var _=require(_0xb702('0x0'));var util=require('util');var moment=require(_0xb702('0x1'));var BPromise=require(_0xb702('0x2'));var rs=require(_0xb702('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb702('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb702('0x5'));var config=require(_0xb702('0x6'));var jayson=require(_0xb702('0x7'));var client=jayson[_0xb702('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8e8e52,_0x14d43e,_0xd1a309){return new BPromise(function(_0x6af90f,_0x3418b0){return client['request'](_0x8e8e52,_0xd1a309)['then'](function(_0x580e32){logger[_0xb702('0x9')](_0xb702('0xa'),_0x14d43e,_0xb702('0xb'));logger[_0xb702('0xc')](_0xb702('0xd'),_0x14d43e,_0xb702('0xb'),JSON['stringify'](_0x580e32));if(_0x580e32[_0xb702('0xe')]){if(_0x580e32[_0xb702('0xe')][_0xb702('0xf')]===0x1f4){logger[_0xb702('0xe')](_0xb702('0xa'),_0x14d43e,_0x580e32['error'][_0xb702('0x10')]);return _0x3418b0(_0x580e32[_0xb702('0xe')][_0xb702('0x10')]);}logger[_0xb702('0xe')](_0xb702('0xa'),_0x14d43e,_0x580e32[_0xb702('0xe')][_0xb702('0x10')]);return _0x6af90f(_0x580e32['error'][_0xb702('0x10')]);}else{logger['info'](_0xb702('0xa'),_0x14d43e,'request\x20sent');_0x6af90f(_0x580e32[_0xb702('0x11')][_0xb702('0x10')]);}})['catch'](function(_0x1c5afd){logger[_0xb702('0xe')]('CmCompany,\x20%s,\x20%s',_0x14d43e,_0x1c5afd);_0x3418b0(_0x1c5afd);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index f3730d0..ba81400 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 _0x3610=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','post','addContacts','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x529ead,_0x523759){var _0x10c7fb=function(_0x3aa1c3){while(--_0x3aa1c3){_0x529ead['push'](_0x529ead['shift']());}};_0x10c7fb(++_0x523759);}(_0x3610,0x156));var _0x0361=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x3610[_0x3740fe];return _0x55492b;};'use strict';var multer=require('multer');var util=require(_0x0361('0x0'));var path=require(_0x0361('0x1'));var timeout=require(_0x0361('0x2'));var express=require(_0x0361('0x3'));var router=express[_0x0361('0x4')]();var fs_extra=require(_0x0361('0x5'));var auth=require(_0x0361('0x6'));var interaction=require(_0x0361('0x7'));var config=require(_0x0361('0x8'));var controller=require(_0x0361('0x9'));router[_0x0361('0xa')]('/',auth[_0x0361('0xb')](),controller['index']);router[_0x0361('0xa')](_0x0361('0xc'),auth['isAuthenticated'](),controller[_0x0361('0xd')]);router[_0x0361('0xa')](_0x0361('0xe'),auth[_0x0361('0xb')](),controller[_0x0361('0xf')]);router[_0x0361('0xa')](_0x0361('0x10'),auth[_0x0361('0xb')](),controller['getContacts']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0361('0x11')](_0x0361('0x10'),auth[_0x0361('0xb')](),controller[_0x0361('0x12')]);router[_0x0361('0x13')](_0x0361('0xe'),auth[_0x0361('0xb')](),controller['update']);router[_0x0361('0x14')]('/:id',auth[_0x0361('0xb')](),controller[_0x0361('0x15')]);module[_0x0361('0x16')]=router;
\ No newline at end of file
+var _0x79bf=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','describe','/:id','isAuthenticated','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','util'];(function(_0x39bed8,_0xcf6104){var _0x5e4003=function(_0x445372){while(--_0x445372){_0x39bed8['push'](_0x39bed8['shift']());}};_0x5e4003(++_0xcf6104);}(_0x79bf,0x1df));var _0xf79b=function(_0x582210,_0x184c36){_0x582210=_0x582210-0x0;var _0x18cf58=_0x79bf[_0x582210];return _0x18cf58;};'use strict';var multer=require('multer');var util=require(_0xf79b('0x0'));var path=require('path');var timeout=require(_0xf79b('0x1'));var express=require('express');var router=express[_0xf79b('0x2')]();var fs_extra=require(_0xf79b('0x3'));var auth=require(_0xf79b('0x4'));var interaction=require(_0xf79b('0x5'));var config=require(_0xf79b('0x6'));var controller=require(_0xf79b('0x7'));router[_0xf79b('0x8')]('/',auth['isAuthenticated'](),controller[_0xf79b('0x9')]);router[_0xf79b('0x8')](_0xf79b('0xa'),auth['isAuthenticated'](),controller[_0xf79b('0xb')]);router[_0xf79b('0x8')](_0xf79b('0xc'),auth[_0xf79b('0xd')](),controller['show']);router['get'](_0xf79b('0xe'),auth[_0xf79b('0xd')](),controller[_0xf79b('0xf')]);router[_0xf79b('0x10')]('/',auth[_0xf79b('0xd')](),controller[_0xf79b('0x11')]);router[_0xf79b('0x10')]('/:id/contacts',auth[_0xf79b('0xd')](),controller[_0xf79b('0x12')]);router[_0xf79b('0x13')](_0xf79b('0xc'),auth[_0xf79b('0xd')](),controller[_0xf79b('0x14')]);router[_0xf79b('0x15')](_0xf79b('0xc'),auth[_0xf79b('0xd')](),controller[_0xf79b('0x16')]);module[_0xf79b('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 8cf61b0..611eeed 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 _0x663d=['INTEGER','UNSIGNED','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x2764c9,_0x3d5b79){var _0x158aee=function(_0x2b21ef){while(--_0x2b21ef){_0x2764c9['push'](_0x2764c9['shift']());}};_0x158aee(++_0x3d5b79);}(_0x663d,0xdb));var _0xd663=function(_0x3f1f08,_0x5e8f9f){_0x3f1f08=_0x3f1f08-0x0;var _0x51fa34=_0x663d[_0x3f1f08];return _0x51fa34;};'use strict';var _=require(_0xd663('0x0'));var Sequelize=require(_0xd663('0x1'));module[_0xd663('0x2')]={'firstName':{'type':Sequelize[_0xd663('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xd663('0x3')]},'street':{'type':Sequelize[_0xd663('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xd663('0x3')]},'dateOfBirth':{'type':Sequelize[_0xd663('0x3')]},'description':{'type':Sequelize[_0xd663('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xd663('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xd663('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xd663('0x3')]},'skype':{'type':Sequelize[_0xd663('0x3')]},'teams':{'type':Sequelize[_0xd663('0x3')]},'viber':{'type':Sequelize[_0xd663('0x3')]},'line':{'type':Sequelize[_0xd663('0x3')]},'wechat':{'type':Sequelize[_0xd663('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xd663('0x3')]},'priority':{'type':Sequelize[_0xd663('0x5')](0x2)[_0xd663('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xd663('0x7')]},'dialTimezone':{'type':Sequelize[_0xd663('0x3')]},'utcOffset':{'type':Sequelize[_0xd663('0x5')]}};
\ No newline at end of file
+var _0x159f=['NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x159f,0xf6));var _0xf159=function(_0x352f4b,_0xa59ba5){_0x352f4b=_0x352f4b-0x0;var _0xcb68c4=_0x159f[_0x352f4b];return _0xcb68c4;};'use strict';var _=require(_0xf159('0x0'));var Sequelize=require('sequelize');module[_0xf159('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xf159('0x2')]},'street':{'type':Sequelize[_0xf159('0x2')]},'postalCode':{'type':Sequelize[_0xf159('0x2')]},'city':{'type':Sequelize[_0xf159('0x2')]},'country':{'type':Sequelize[_0xf159('0x2')]},'dateOfBirth':{'type':Sequelize[_0xf159('0x2')]},'description':{'type':Sequelize[_0xf159('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xf159('0x2')]},'fax':{'type':Sequelize[_0xf159('0x2')]},'email':{'type':Sequelize[_0xf159('0x2')]},'url':{'type':Sequelize[_0xf159('0x2')]},'facebook':{'type':Sequelize[_0xf159('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xf159('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xf159('0x2')]},'viber':{'type':Sequelize[_0xf159('0x2')]},'line':{'type':Sequelize[_0xf159('0x2')]},'wechat':{'type':Sequelize[_0xf159('0x2')]},'telegram':{'type':Sequelize[_0xf159('0x2')]},'UserId':{'type':Sequelize[_0xf159('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf159('0x4')](0x2)[_0xf159('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xf159('0x6')]},'dialTimezone':{'type':Sequelize[_0xf159('0x2')]},'utcOffset':{'type':Sequelize[_0xf159('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 7c65b9e..3de4593 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 _0x779f=['stack','name','describe','findAll','query','destroy','CmContact','find','catch','tags','keys','startsWith','cf_','columnName','displayName','analytics','CmCustomField','length','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','hasOwnProperty','merge','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','show','params','Tag','color','tag','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','omit','format','cf_%d','map','table','cm_contacts','setFields','toParam','text','CmHopper','phone','findOne','model','rawAttributes','intersection','attributes','fields','sort','filters','pick','filter','options','getTags','nolimit','setTags','ids','setAdditionalPhones','all','OrderBy','items','item_types','ItemTypeId','CmHopperAdditionalPhone','item','PHONE','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','getHoppers','order','ContactId','includeAll','rows','getHopperHistories','include','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','root','file','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','User','agent','No\x20firstName\x20column\x20specified','../../components/import/cm/csvUpdates','getJourney','openchannel','fax','whatsapp','-createdAt','resolve','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','voice','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','VoiceCallReport','findAndCountAll','startCase','chat','Website','Account','closed','closedAt','secondDisposition','key','Owner','Tags','DESC','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','mail','subject','threadId','Interaction','flatten','value','moment','bluebird','util','path','lodash','papaparse','ioredis','../../components/contacts','../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','json','offset','limit','undefined','count','status','set','then','end','sendStatus','error'];(function(_0x4ede04,_0x58132b){var _0x49ccfc=function(_0x51a704){while(--_0x51a704){_0x4ede04['push'](_0x4ede04['shift']());}};_0x49ccfc(++_0x58132b);}(_0x779f,0xe1));var _0xf779=function(_0x3e8fd7,_0x5628f4){_0x3e8fd7=_0x3e8fd7-0x0;var _0x452529=_0x779f[_0x3e8fd7];return _0x452529;};'use strict';var moment=require(_0xf779('0x0'));var BPromise=require(_0xf779('0x1'));var util=require(_0xf779('0x2'));var path=require(_0xf779('0x3'));var fs=require('fs');var _=require(_0xf779('0x4'));var squel=require('squel');var Papa=require(_0xf779('0x5'));var Redis=require(_0xf779('0x6'));var contacts=require(_0xf779('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0xf779('0x8'))('api');var config=require(_0xf779('0x9'));var shared=require(_0xf779('0xa'));var db=require(_0xf779('0xb'))['db'];config['redis']=_['defaults'](config[_0xf779('0xc')],{'host':_0xf779('0xd'),'port':0x18eb});var socket=require(_0xf779('0xe'))(new Redis(config['redis']));require(_0xf779('0xf'))[_0xf779('0x10')](socket);function respondWithResult(_0x2f55fb,_0x42e343){_0x42e343=_0x42e343||0xc8;return function(_0x57f411){if(_0x57f411){return _0x2f55fb['status'](_0x42e343)[_0xf779('0x11')](_0x57f411);}};}function respondWithFilteredResult(_0x847786,_0x5bf8e1){return function(_0x51cc89){if(_0x51cc89){var _0x403954=typeof _0x5bf8e1[_0xf779('0x12')]==='undefined'&&typeof _0x5bf8e1[_0xf779('0x13')]===_0xf779('0x14');var _0x435f1f=_0x51cc89['count'];var _0xbcf67b=_0x403954?0x0:_0x5bf8e1[_0xf779('0x12')];var _0x4e3962=_0x403954?_0x51cc89[_0xf779('0x15')]:_0x5bf8e1[_0xf779('0x12')]+_0x5bf8e1['limit'];var _0x2fddd3;if(_0x4e3962>=_0x435f1f){_0x4e3962=_0x435f1f;_0x2fddd3=0xc8;}else{_0x2fddd3=0xce;}_0x847786[_0xf779('0x16')](_0x2fddd3);return _0x847786[_0xf779('0x17')]('Content-Range',_0xbcf67b+'-'+_0x4e3962+'/'+_0x435f1f)[_0xf779('0x11')](_0x51cc89);}return null;};}function saveUpdates(_0x3579af){return function(_0x3eefce){if(_0x3eefce){return _0x3eefce['update'](_0x3579af)['then'](function(_0x1fc00a){return _0x1fc00a;});}return null;};}function removeEntity(_0x3ece54){return function(_0x4348da){if(_0x4348da){return _0x4348da['destroy']()[_0xf779('0x18')](function(){_0x3ece54[_0xf779('0x16')](0xcc)[_0xf779('0x19')]();});}};}function handleEntityNotFound(_0x1e0064){return function(_0xb41d50){if(!_0xb41d50){_0x1e0064[_0xf779('0x1a')](0x194);}return _0xb41d50;};}function handleError(_0x478913,_0x7e0927){_0x7e0927=_0x7e0927||0x1f4;return function(_0x3990e0){logger[_0xf779('0x1b')](_0x3990e0[_0xf779('0x1c')]);if(_0x3990e0[_0xf779('0x1d')]){delete _0x3990e0[_0xf779('0x1d')];}_0x478913[_0xf779('0x16')](_0x7e0927)['send'](_0x3990e0);};}exports['index']=function(_0x1ce74a,_0x5c9ec3){var _0x190bf5={};return contacts[_0xf779('0x1e')]()[_0xf779('0x18')](function(_0x2022f9){_0x190bf5=qs['getOptions'](_0x2022f9,_0x1ce74a);return contacts[_0xf779('0x1f')](_0x1ce74a[_0xf779('0x20')],_0x1ce74a['user'],_0x190bf5,_0x2022f9);})[_0xf779('0x18')](respondWithFilteredResult(_0x5c9ec3,_0x190bf5))['catch'](handleError(_0x5c9ec3,null));};exports[_0xf779('0x21')]=function(_0x53016d,_0x3aca3c){return db[_0xf779('0x22')][_0xf779('0x23')]({'where':{'id':_0x53016d['params']['id']}})['then'](handleEntityNotFound(_0x3aca3c,null))[_0xf779('0x18')](removeEntity(_0x3aca3c,null))[_0xf779('0x24')](handleError(_0x3aca3c,null));};exports[_0xf779('0x1e')]=function(_0x2417ed,_0xfce05){return db[_0xf779('0x22')][_0xf779('0x1e')]()['then'](function(_0x2a4fc9){delete _0x2a4fc9[_0xf779('0x25')];for(var _0xa97f12=0x0;_0xa97f12
','Attachments','Title','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','path','util','email','../../../config/environment','head','value'];(function(_0x16b8b5,_0x3729bc){var _0x518ea7=function(_0x4eab01){while(--_0x4eab01){_0x16b8b5['push'](_0x16b8b5['shift']());}};_0x518ea7(++_0x3729bc);}(_0x2537,0xd6));var _0x7253=function(_0x23f720,_0x5dba43){_0x23f720=_0x23f720-0x0;var _0x190f8f=_0x2537[_0x23f720];return _0x190f8f;};'use strict';var _=require(_0x7253('0x0'));var moment=require(_0x7253('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x7253('0x2'));var util=require(_0x7253('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x7253('0x4'));var config=require(_0x7253('0x5'));function getAddress(_0x16f514){var _0x4d8b4f=_[_0x7253('0x6')](_0x16f514[_0x7253('0x7')]);return _0x4d8b4f&&_0x4d8b4f[_0x7253('0x8')]?_0x4d8b4f[_0x7253('0x8')]:_0x7253('0x9')+random[_0x7253('0xa')](0x6)+_0x7253('0xb');}function getFirstName(_0x3495fd){var _0x3f7c9b=_['head'](_0x3495fd['value']);if(_0x3f7c9b&&_0x3f7c9b[_0x7253('0xc')]){if(_0x3f7c9b[_0x7253('0xc')]==_0x3f7c9b[_0x7253('0x8')]){return _0x3f7c9b[_0x7253('0xc')][_0x7253('0xd')](0x0,_0x3f7c9b['name'][_0x7253('0xe')]('@'));}var _0x28fd00=_0x3f7c9b[_0x7253('0xc')][_0x7253('0xf')](/\s+/);return _0x28fd00[_0x7253('0x10')]>0x1?_0x28fd00[_0x7253('0x11')](0x0,-0x1)[_0x7253('0x12')]('\x20'):_0x3f7c9b[_0x7253('0xc')];}return _0x7253('0x13');}function getLastName(_0x35fa83){var _0x29fc81=_[_0x7253('0x6')](_0x35fa83[_0x7253('0x7')]);if(_0x29fc81&&_0x29fc81[_0x7253('0xc')]){var _0x4c8e74=_0x29fc81[_0x7253('0xc')][_0x7253('0xf')](/\s+/);return _0x4c8e74['length']>0x1?_0x4c8e74[_0x7253('0x14')]():'';}return'';}function getMails(_0xfbd258,_0x5a321e){var _0x37dc9c='';for(var _0xa46013=0x0;_0xa46013<_0x5a321e[_0x7253('0x7')][_0x7253('0x10')];_0xa46013+=0x1){if(_0x5a321e[_0x7253('0x7')][_0xa46013][_0x7253('0x8')]!==_0xfbd258){if(!_[_0x7253('0x15')](_0x37dc9c)){_0x37dc9c+=',';}_0x37dc9c+=_0x5a321e[_0x7253('0x7')][_0xa46013][_0x7253('0xc')]||_0x5a321e[_0x7253('0x7')][_0xa46013]['address']||'';_0x37dc9c+='\x20<';_0x37dc9c+=_0x5a321e['value'][_0xa46013][_0x7253('0x8')]?_0x5a321e['value'][_0xa46013][_0x7253('0x8')]:_0x7253('0x9')+random['generate'](0x6)+_0x7253('0xb');_0x37dc9c+='>';}}return _0x37dc9c;}function parseEmail(_0x14a35c,_0x55e683,_0x3d8cf4){if(_0x55e683[_0x7253('0x16')]){var _0x307988=/